// Called when the unit has a new stat effect added public virtual bool onStatsEffected(Profession prof, bool isEffected, ref Unit unit, ref StatEffect statEffect, ref BattleMap map) { return isEffected; }
// Called when the unit has just finished with a stat effect public virtual void onDoneWithStatEffect(Profession prof, ref Unit unit, ref StatEffect statEffect, ref BattleMap map) { }
// Called when the unit is updating the stat effects public virtual void onUpdateStatEffect(ref StatEffect statEffect, ref BattleMap map) { prof.onUpdateStatEffect(this, ref statEffect, ref map); }
// Called before the unit is updating the stat effects to see if it will update public virtual bool onPreUpdateStatEffect(Profession prof, ref Unit unit, bool canUpdate, ref StatEffect statEffect, ref BattleMap map) { return canUpdate; }
// Called before the unit is updating the stat effects to see if it will update public virtual bool onPreUpdateStatEffect(ref StatEffect statEffect, ref BattleMap map) { return prof.onPreUpdateStatEffect( this, ((map.isUnitNearbyWithPassive(mapPos[0], mapPos[1], map.getTeamID(mapPos), "lamb\'s_blood", 2)) ? (Start.rng.Next(0, 5)>= 2) : true ), ref statEffect, ref map ); }
// Called when the unit has a new stat effect added public virtual bool onStatsEffected(ref StatEffect statEffect, ref BattleMap map) { return prof.onStatsEffected(this, true, ref statEffect, ref map); }
// Adds the stat effect to the unit and runs public virtual void addStatEffect(StatEffect statEffect, ref BattleMap map) { if(statEffect.type== EffectType.Status) { for(int i= 0; i< statEffects.size; i++) { if(statEffects.items[i].type== statEffect.type) return; // Does nothing to someone already affected } } statEffects.add(statEffect); if(!onStatsEffected(ref statEffect, ref map)) // Is not effected! { statEffects.removeAt(statEffects.size-1); return; } resetStatAffecedtStats(ref map); updateEffects(ref map); }
// Called when the unit has just finished with a stat effect public virtual void onDoneWithStatEffect(ref StatEffect statEffect, ref BattleMap map) { prof.onDoneWithStatEffect(this, ref statEffect, ref map); }
// Called when the unit is updating the stat effects public virtual void onUpdateStatEffect(Unit unit, ref StatEffect statEffect, ref BattleMap map) { // Variables Passive passive; for(int i= 0; i< currPassives.Length; i++) { if(currPassives[i]== null) continue; if(passives.get(currPassives[i], out passive)) passive.onUpdateStatEffect(this, ref unit, ref statEffect, ref map); } }
// --- Inherited Methods --- // Called when the unit has a new stat effect added public override bool onStatsEffected(Profession prof, bool isEffected, ref Unit unit, ref StatEffect statEffect, ref BattleMap map) { if(statEffect.type== EffectType.Debuff) { unit.addStatEffect( new StatEffect( EffectType.Buff, "Sturdy", "+25% Def", sturdySE, -1 ), ref map ); } return isEffected; }
// Called when the unit has a new stat effect added public virtual bool onStatsEffected(Unit unit, bool isEffected, ref StatEffect statEffect, ref BattleMap map) { // Variables Passive passive; for(int i= 0; i< currPassives.Length; i++) { if(currPassives[i]== null) continue; if(passives.get(currPassives[i], out passive)) isEffected= passive.onStatsEffected(this, isEffected, ref unit, ref statEffect, ref map); } return isEffected; }
// Called before the unit is updating the stat effects to see if it will update public virtual bool onPreUpdateStatEffect(Unit unit, bool canUpdate, ref StatEffect statEffect, ref BattleMap map) { // Variables Passive passive; for(int i= 0; i< currPassives.Length; i++) { if(currPassives[i]== null) continue; if(passives.get(currPassives[i], out passive)) canUpdate= passive.onPreUpdateStatEffect(this, ref unit, canUpdate, ref statEffect, ref map); } return canUpdate; }
// Called when the unit has a new stat effect added public override bool onStatsEffected(Unit unit, bool isEffected, ref StatEffect statEffect, ref BattleMap map) { if(statEffect.name== "Enraged") { statEffect.turnsLeft*= 2; statEffect.effectEvent= stockpileRageSE; } return base.onStatsEffected(unit, isEffected, ref statEffect, ref map); }
// Called when the unit has just finished with a stat effect public override void onDoneWithStatEffect(Unit unit, ref StatEffect statEffect, ref BattleMap map) { if(statEffect.name== "Enraged") stockpiled= 0f; base.onDoneWithStatEffect(unit, ref statEffect, ref map); }
// Called when the unit has just finished with a stat effect public override void onDoneWithStatEffect(Unit unit, ref StatEffect statEffect, ref BattleMap map) { if(statEffect.name== "Prophetic Prayer") { // Variables List<int[]> enemies= map.findAllEnemies(map.getTeamID(unit.mapPos)); AttackInfo info; int[] unitID= map.getFullUnitID(unit.mapPos); for(int i= 0; i< enemies.size; i++) { info= AttackInfo.create("prophetic_reap", unitID, enemies.items[i], ref map); info.damage= (int)((float)(unit.magic)/7f); info.accuracy= 1f; info.criticalChance= 0f; map.teams.items[enemies.items[i][0]].units.items[enemies.items[i][1]].takeDamage(ref info, ref unit, ref map); } activatedPropheticReap= false; } base.onDoneWithStatEffect(unit, ref statEffect, ref map); }