Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impact of chilling_touch on player's battle action appears wrong. BattleAction::Parry execution block should set player.parry = true so they are defending (parrying). BattleAction::Guardbreak execution block should set enemy.parry = false; and its success log should be success: !enemy.parry, since it breaks the enemy defense/parrying #68

Open
ltfschoen opened this issue Jan 23, 2024 · 2 comments

Comments

@ltfschoen
Copy link
Contributor

ltfschoen commented Jan 23, 2024

here in the code https://github.com/ImpulseDAO/Vara-Arena/blob/master/contracts/arena/src/battle.rs#L200
it shows what happens to a players battle action if their enemy has cast a fire_haste or chilling_touch spell on them.

if the player has been affected by the fire_haste spell, their fire_haste value of 0 is set to 4 and decrements back down to 0 each turn. if they are affected by that spell where fire_haste > 0 - that increases the modifier, which increases more the more intelligence they have

if the player has been affected by chilling_touch, their chilling_touch value of 0 is set to 4 and decrements back down to 0 each turn. if they are affected by that spell where chilling_touch > 0 - that decreases the modifier, which decreases more the more intelligence they have

basically that modifier output value is the output of combining the impacts of the above spells, and is used to affect that players battle action.

then if the player character has config attributes ofdisable_agiim = true, which requires their parry = true (defending themselves) to be set first, then the fire_haste and chilling_touch spells have no further impact on their battle action against the enemy.

but if the player character has config attributes ofdisable_agiim = false (not defending themselves), the intensity of the battle action undertaken by the player is changed by the modifier output value (more if the player has a higher agility), so in that case a:

  • higher fire_haste spell on that player would cause their battle action to have less impact, whereas a;
  • higher chilling_touch spell on them would cause their battle action to have a higher impact since base_initiative - (u16::from(player.attributes.agility) * modifier), where the modifier is a negative number, so subtracting a negative modifier results in an increase (x - (y * -z)) = (x - (-yz)). so i don't think the chilling_touch spell makes sense, why would you cast a chilling_touch spell on an enemy if it actually increases the impact of their battle action? shouldn't it decrease the impact of their battle action instead?

the player and enemy each have an attribute parry = false set by default.

and the only way the player or enemy can have their default disable_agiim = false changed to disable_agiim = true seems to be by somehow changing their attribute to parry = true.

note that parry is in the dictionary, it means "deflect or ward off a thrust or blow, evade, or avoid".

for the player or enemy to parry (defensive battle action), the player or enemy would have to run the BattleAction::Parry on themselves.
BattleAction::Parry is defined here https://github.com/ImpulseDAO/Vara-Arena/blob/master/contracts/arena/src/execute.rs#L216, but i think we need to add a new line of code player.parry = true below that line for it to work.

then the opponent would have to run the BattleAction::Guardbreak to break that player's defense, which first checks if enemy.parry is true (if they are defending themselves) and then sets enemy.disable_agiim = true;,
but i also think Guardbreak should reset the enemy parry value back to its default of not defending enemy.parry = false; here https://github.com/ImpulseDAO/Vara-Arena/blob/master/contracts/arena/src/execute.rs#L234C21-L234C48 since the just broke their defence, and;
i also think the success log here https://github.com/ImpulseDAO/Vara-Arena/blob/master/contracts/arena/src/execute.rs#L239 should be changed to success: !enemy.parry,, since success is when the enemy isn't parrying anymore since we broke their defense.

but i don't actually know what agiim is an abbreviation for... so maybe the BattleAction::Parry should actually have an extra line to set player.disable_agiim = true too, and then BattleAction::Guardbreak would actually set enemy.disable_agiim = false; (back to default value) instead of enemy.disable_agiim = true; so they can be impacted by those spells.

we'd also need pub struct CharacterState { to include parry: boolean

@tmcgroul
Copy link
Member

disable_agiim means disable agility modificator. maybe one i is extra here 🤔 but i'm not sure. the answer is probably somewhere in the game design docs.

because Parry and Guardbreak actions rely on players initiative they can't be handled as other actions like Attack, SpellCast, etc. so their handling is happening here:

self.c1.parry = matches!(&p1_action, BattleAction::Parry);
self.c2.parry = false;

and because players have to send their actions before any actions handling it's just impossible to provide information about parry to strategies.

my answer is much smaller than your question... but... have i covered all your concerns?

@0xKube
Copy link
Member

0xKube commented Mar 5, 2024

@ltfschoen should we close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants