public void Destroy(GameEffect cause, Game game) { // inform the controller Writable_GamePlayer controller = game.GetWritable(this.ControllerID); controller.MonsterIDsInPlay.GetWritable().Remove(this.GetID((Readable_MonsterCard)null)); // process any on-death effects GameTrigger_Factory.TriggerAll <GameEffect>(this.afterDeath_triggers, cause, this.ControllerID, game); }
public void AddHealth(Specific_LifeEffect effect, Game game) { if (effect.AmountToGain < 0) { GameTrigger_Factory.TriggerAll <Specific_LifeEffect>(this.beforeReceivingDamage_Triggers, effect, this.ControllerID, game); } this.Health += effect.AmountToGain; // check for death if (this.Health <= 0) { this.Destroy(effect, game); } this.Health = Math.Min(this.Health, this.originalHealth); }