public void AddActiveEffect(ActiveEffect a, BattleGame game) { ActivateEffect(a, game); a.duration--; if (a.duration > 0) { game.battleLog.AddEntry(string.Format("{0} was added to {1}.", a.name, this.name)); activeEffects.Add(a); } }
private void ActivateEffect(ActiveEffect effect, BattleGame game) { int amt = 0; switch (effect.statType) { case StatType.Damage: amt = game.r.Next(effect.minAmount, effect.maxAmount); game.battleLog.AddEntry(string.Format("{0} was damaged by {1} for {2}", this.name, effect.name, amt.ToString())); game.gameControllerScript.StartTempTextOnChar(this, amt, true); this.Damage(amt, game); break; case StatType.Heal: amt = game.r.Next(effect.minAmount, effect.maxAmount); game.battleLog.AddEntry(string.Format("{0} was healed by {1} for {2}", this.name, effect.name, amt.ToString())); game.gameControllerScript.StartTempTextOnChar(this, amt, false); this.Heal(amt, game); break; case StatType.Dispell: amt = game.r.Next(effect.minAmount, effect.maxAmount); game.battleLog.AddEntry(string.Format("{0} removed {1} effects from {2}", effect.name, amt, this.name)); RemoveTopActiveEffects(amt); break; default: break; } }
public static ActiveEffect cloneActiveEffect(ActiveEffect ae) { return(ae); // return JsonConvert.DeserializeObject<ActiveEffect>(JsonConvert.SerializeObject(ae)); }
public static ActiveEffect cloneActiveEffect(ActiveEffect ae) { return ae; // return JsonConvert.DeserializeObject<ActiveEffect>(JsonConvert.SerializeObject(ae)); }