public void FightWith(Command command) { ((Player.PlayerStrategy)player.Strategy).SetWeapon(command); Weapon playerWeapon = player.SelectWeapon(); Weapon creatureWeapon = creature.SelectWeapon(); int result = CompareWeapon(playerWeapon, creatureWeapon); switch (result) { case 1: creature.TakeDamage(player.GetDamage(playerWeapon)); Console.WriteLine("YOU HAVE WON."); Console.WriteLine("Creature have {0}/{1} HP", creature.Hitpoints, creature.MaxHP); break; case 0: Console.WriteLine("DRAW."); break; case -1: player.TakeDamage(creature.GetDamage(creatureWeapon)); Console.WriteLine("YOU HAVE LOST."); Console.WriteLine("You have {0}/{1} HP", player.Hitpoints, player.MaxHP); break; } IsInFight = !EvaluateFight(); }
public void Attack(IFighter another) { int critModifier = GetCritModifier(); attackPoints += (int)((critModifier / 100.0) * attackPoints); Console.WriteLine($"{Team}->{Name} attacks for {attackPoints} with critModifier {critModifier}"); another.TakeDamage(attackPoints); }
public async Task CodeGenVoidParametersTask() { int messageCount = Messages; for (var i = 0; i < messageCount; i++) { await _codegenProxy.TakeDamage(10); } }
public async Task NativeVoidParametersTask() { int messageCount = Messages; for (var i = 0; i < messageCount; i++) { await _staticProxy.TakeDamage(10); } }
private void RangeAttack(IFighter target) { target.TakeDamage(Damage, this, "bow"); }
public ValueTask Invoke() => _target.TakeDamage(_value);