public override void Initialise(StateManager a_controller) { base.Initialise(a_controller); _entity = a_controller.GetComponent <BattleEntity>(); _startStatus = _entity.CurrentStatus; }
public void RemoveStatus(eStatusEffect effect) { var status = GetStatus(effect); if (status != null) { status.Reverse(node); statuses.Remove(status); } }
internal static IStatusEffect Create(eStatusEffect s) { switch (s) { case eStatusEffect.INTANGIBLE: return(new IntangibleEffect()); case eStatusEffect.JOLTED: return(new JoltedEffect()); default: return(null); } }
/** * @brief Calculate the damage value that should be applied to the defender, also taking into account status effect modifiers. * @param a_status is the status effect of the attack. * @param a_attacker is the entity doing the damaging. * @param a_defender is the entity being damaged. * @return Amount of damage defender should take. * */ float CalcDmgVal(eStatusEffect a_status, BattleEntity a_attacker, BattleEntity a_defender) { float dmg = 0; switch (a_status) { // Regular bash case eStatusEffect.NORMAL: dmg += a_attacker.BattleProfile.Offense * (100f / (100f + (a_defender.BattleProfile.Defense))); int percentModifier = (Random.Range(0, 2) == 0 ? 1 : -1); dmg += dmg * 0.25f * percentModifier; break; default: break; } return(dmg); }
public void RemoveEffect(eStatusEffect eff) { state.statusHandler.RemoveStatus(eff); }
public void AddStatus(eStatusEffect s, int duration) { statusHandler.AddStatus(StatusEffect.Create(s)); tickHandler.AddOrder(new RemoveStatusOrder(node as ISufferStatusEffects, s), duration); }
public RemoveStatusOrder(ISufferStatusEffects effected, eStatusEffect effect) { this.effected = effected; this.effect = effect; }
public StatusEffect(eStatusEffect type) { this.type = type; enacted = false; }
public bool HasStatusEffect(eStatusEffect e) { return(state.statusHandler.HasStatus(e)); }
public bool HasStatus(eStatusEffect effect) { return(GetStatus(effect) != null); }
public IStatusEffect GetStatus(eStatusEffect effect) { return(statuses.Where(s => s.type == effect).FirstOrDefault()); }