allenjiang17 / theSearchForEden

1 stars 0 forks source link

Adding a new incantation #32

Open Larinitus opened 2 months ago

Larinitus commented 2 months ago

I can't figure out how to add a new incantation to a player's list of learned incantations. I tried something like the following two but they don't work. What am I supposed to write?

V1: func: (gameState, event, setCurrentEvent) => { gameState.setIncantation(produce((newIncantation)=>{ newIncantation.incantations.push("basicAttackTest"); })); }

V2: func: (gameState, event, setCurrentEvent) => { gameState.setCharCondition(produce((newCharCondition)=>{ newCharCondition.incantations.push("basicAttackTest"); })); }

allenjiang17 commented 2 months ago

incantations i think is under the character object, you have to set the character

Larinitus commented 2 months ago

Sorry I don't know how to do that. Am I not setting the character in V2? Or do I need to write "newCharCondition.character.incantations.push"?