public bool TryPayUpkeep(GameState gameState) { if (gameState.CanPayCost(type.upkeep)) { gameState.PayCost(type.upkeep); return true; } else { return false; } }
public void Attack(GameState gameState, Minion target, int bonusDamage, MinionAnimationBatch attackAnim, MinionAnimationBatch recoverAnim) { if (deleted) return; gameState.PayCost(mtype.attackCost); Vector2 basePos = drawPos; Vector2 targetPos = target.drawPos; targetPos = new Vector2(targetPos.X, targetPos.Y+target.type.texture.Height - type.texture.Height); Vector2 attackPos = basePos + (targetPos - basePos) * 0.5f; attackAnim.AddAnimation(this, basePos, attackPos); recoverAnim.AddAnimation(this, attackPos, basePos); DamageType damageType = stats.hasKeyword(Keyword.corrosive)? DamageType.acid: stats.hasKeyword(Keyword.fireform)? DamageType.fire: DamageType.attack; gameState.HandleTriggers(new TriggerEvent(TriggerType.onAttack, this, target)); target.TakeDamage(gameState, stats.attack+bonusDamage, damageType, this); }