Page 1 of 1

Status change inversion

Posted: Tue Aug 14, 2018 2:00 am
by Sunrise Samurai
Been having trouble with buffs and debuffs self adjusting to the base unit stats, then adjusting in the opposite direction when they end. Fear becomes a buff this way, and in my picture here I ended up with a very lazy halberdier who won't attack because double strike ended up giving a permanent -1 to actions.
Image

Re: Status change inversion

Posted: Tue Aug 14, 2018 4:56 am
by makazuwr32
Is it after upgrade of halberdiers?

Re: Status change inversion

Posted: Tue Aug 14, 2018 4:59 am
by General Brave
I'm guessing this is after a enemy magic user use a negative spell on him.

Re: Status change inversion

Posted: Tue Aug 14, 2018 5:11 am
by makazuwr32
Uhm. As for me everything worked fine with disenchant.

Re: Status change inversion

Posted: Tue Aug 14, 2018 5:24 am
by General Brave
It's not like that, if one of my archers got curse. After the effect wears off, it becomes plus not negative.

Re: Status change inversion

Posted: Tue Aug 14, 2018 5:47 am
by Stratego (dev)
sunrise: please tell me these
- do u use the latest dev version? (uploaded about 2 days ago - where there were a fix attempt on these enchantment like effects)
- if so, how to reproduce this?

Re: Status change inversion

Posted: Tue Aug 14, 2018 10:09 am
by Sunrise Samurai
If you uploaded 2 days ago it's probably not the latest. I'll download now. There's no post in dev version topic so I didn't update, sorry.

Re: Status change inversion

Posted: Sun Aug 26, 2018 11:59 pm
by HokanPL
I don't know EXACTLY (I mean the code inside a game) how it works, so below I give my analysis Maybe this will help.

At first you, devs, have to decide if fear has to change action value to 0 for all units (no matter if they have 1 action per turn, 2+ actions by default and/or because of "double strike effect"), or to decrease it with -1. First option is much harder to code right because of many possibilities with effects' combinations (it's even worse if somebody changes "actions" value in map editor for missions).

I could describe tens of possible combinations of Powers/effects, but let's focus on this situation:

*Atack per turn = APT to make it shorter

WHAT WE HAVE NOW (speculation mode)
Halberdier. Nice guy, but he doesn't like his job. He can attack once per turn. Priest comes nearby and strikes him twice with his stab to motivate him. +1 APT, so now APT=2. But then the mummy comes and attack our motivated halberdier with "Fear". APT=0 (but it isn't APT=2-2=0, just APT=0, for programmer this is a huge difference: you can set completely new value or modify existing one). Then halberdier wants to attack, but "Double strike" motivation effect ends and APT=0-1=-1 (Another reality or something). But the mummy is killed by halberdier's friends swordsman, so "fear" disappeares soon and isn't refreshed. APT=-1+1=0.
You see? It this case, because of "fear", APT was decreased with -2 (in practice, because in technical view it was reseted to 0), and then was increased with +1 only.

POSSIBLY SOLUTION:
"Fear" should a.l.w.a.y.s. decrease APT with -1, so for example quick archer affected with this debuff should be able to shoot once (APT=2(base value) -1=1).
Or "Fear" can reset APT to 0 in all cases, but the value which was used to lower APT to 0 has to be stored in game memory and added after eliminating debuff.

..........
Yeah, it sounds complicated. You know, #gamedev_stuff 😂