In my game there are hundreds of states the main protagonists can affect enemies and vice-versa (enemies can affect my party) and each state has similar effect (deals percentage damage to HP and shows specific animation depending on element (ice, fire, earth etc) and each state has following notetag: https://prnt.sc/uz2dab (they differs effects and animations)
Wich is great, because it behaves exacly what I wanted and designed. The main problem begins, when specific actor or enemy has more than one or more states currently active, animations, damage popups, sound effects overlaps one on each other causing chaos on screen, confusing player wich and what kind of effect where triggered...
So... I wrote small function to "overcome" that chaos:
and this works also perfectly (everything - actors and enemies has that state as global - https://prnt.sc/uz2hvt) - this function sums all states on user and by that and formula calculates total damage to deal on user, but it shows no animations (I'll fix that later - cosmetic issue - not important at the moment)
So, the question of this issue, do you guys have some other alternatives how to deal with large number of states currently active on actor/enemy without causing mystagmus on screen for player?
I thought about queue'ing states effects, but that will end up in taking lot of time, before turns ends.
Wich is great, because it behaves exacly what I wanted and designed. The main problem begins, when specific actor or enemy has more than one or more states currently active, animations, damage popups, sound effects overlaps one on each other causing chaos on screen, confusing player wich and what kind of effect where triggered...
So... I wrote small function to "overcome" that chaos:
JavaScript:
Soulrender.prototype.dealDamageByStates = function(user){
//obtain number of states on user
var numStates = user._states.length - 1;
//define default damage per state
var dmgFormula = Math.floor(user.mhp * 0.05) - (user.mdf + user.def);
//this variable will be handler to display damage in game (battle)
var dmgDisplay = 0;
//this variable will be summed value of all states on user
//and calculate total damage to deal at end of turn
var dmgDeal = 0;
//sum damage by number of states
for (var i = 0; i <= numStates; i++){
dmgDeal += dmgFormula;
}
//set display variable
dmgDisplay = dmgDeal;
//if there are no states do nothing, else show damage value
//and deduct calculated value from user
if (numStates > 0){
//user.customPopup() types
//0 - neutral (white)
//1 - positive (green)
//2 - negative (red)
user.customPopup("-" + dmgDisplay + " HP", 2);
user.gainHp(-dmgDeal);
}
//end function - return 0 value to avoid unnecesary
//additional damage to deal.
return 0;
}
So, the question of this issue, do you guys have some other alternatives how to deal with large number of states currently active on actor/enemy without causing mystagmus on screen for player?
I thought about queue'ing states effects, but that will end up in taking lot of time, before turns ends.