public void SpecialMoveFailedEvent_RaisedWhenShieldBusterFails_BusterPowerLessThanShieldBusterDefense() { _logger.Subscribe(_humanFighter, EventType.SpecialMoveFailed); IronBattleShield shield = new IronBattleShield(5, 5, 3, 2); _enemy.SetBattleShield(shield); Assert.NotNull(_enemy.BattleShield); ShieldBusterMove shieldBuster = new ShieldBusterMove("shieldBuster", TargetType.SingleEnemy, null, 1); _humanFighter.SetMove(shieldBuster, 1); _humanFighter.SetMoveTarget(_enemy); _humanFighter.SetMove(_runawayMove); _enemy.SetMove(_doNothingMove); _battleManager.Battle(_humanTeam, _enemyTeam); List <EventLog> logs = _logger.Logs; Assert.AreEqual(1, logs.Count); EventLog log = logs[0]; Assert.AreEqual(EventType.SpecialMoveFailed, log.Type); SpecialMoveFailedEventArgs e = log.E as SpecialMoveFailedEventArgs; Assert.NotNull(e); Assert.AreEqual(SpecialMoveFailedReasonType.ShieldBusterDefenseHigherThanShieldBusterPower, e.Reason); }
public void LogSpecialMoveFailed(object sender, SpecialMoveFailedEventArgs e) { if (e.Move is ShieldBusterMove) { ++_shieldBusterFails; switch (_shieldBusterFails) { case 1: _output.WriteLine("\nBarbarian: Ha! I already told you it was useless!\nTry it another thousand times, idiot, it'll be the same!"); break; case 3: _output.WriteLine("\nBarbarian: Huh? Did you crack my shield?\nHa! I'm just kidding, it won't work, fool!"); break; } } }
private void _logSpecialMoveFailed(object sender, SpecialMoveFailedEventArgs e) { Logs.Add(new EventLog(EventType.SpecialMoveFailed, sender, e)); }
public void OnSpecialMoveFailed(SpecialMoveFailedEventArgs e) { SpecialMoveFailed?.Invoke(this, e); }