public void StrongActionPlayerScenario(Gladiator attackingPlayer, Gladiator defenderPlayer, PlayerActions actionFromPlayer) { if (attackingPlayer.Stamina >= 50) { AttackFromAttackingPlayer(attackingPlayer, defenderPlayer, actionFromPlayer); } }
public void ExecuteBattle() { foreach (var playerAction in _playerActions) { var player = Players[playerAction.Key]; Gladiator playerSource = Players[playerAction.Key]; Gladiator playerTarget = Players.Single(p => p.Key != playerSource.GladiatorId).Value; var action = playerAction.Value; if (action == PlayerActions.Weak) { WeakActionPlayerScenario(playerSource, playerTarget, action); } if (action == PlayerActions.Strong) { StrongActionPlayerScenario(playerSource, playerTarget, action); } if (action == PlayerActions.Parry) { ParryActionPlayerScenario(player, action); } } }
public void ParryActionFromDefenderPlayer(Gladiator defenderPlayer, PlayerActions playeractions) { defenderPlayer.Parry(); if (defenderPlayer.Stamina == 100) { defenderPlayer.Stamina = defenderPlayer.Stamina; } else { defenderPlayer.GainStamina(); } }
// List<PlayerActions> playerActions = new List<PlayerActions>(); public void AttackFromAttackingPlayer(Gladiator attackingPlayer, Gladiator defenderPlayer, PlayerActions playeraction) { if (playeraction == PlayerActions.Weak) { defenderPlayer.Pv = defenderPlayer.Pv - attackingPlayer.WeakAtt; attackingPlayer.ReduceStamina(); } if (playeraction == PlayerActions.Strong) { defenderPlayer.Pv = defenderPlayer.Pv - attackingPlayer.StrongAtt; attackingPlayer.BigReduceStamina(); } }
public Guid RegisterPlayerInBattle(Guid battleId, String name) { if (BattleGroup.ContainsKey(battleId)) { Gladiator choosedGladiator = null; switch (name) { case "Spartacus": { choosedGladiator = new Spartacus(); break; } case "Crixus": { choosedGladiator = new Crixus(); break; } case "Piscus": { choosedGladiator = new Piscus(); break; } default: choosedGladiator = new Spartacus(); break; } BattleGroup[battleId].Players.Add(choosedGladiator.GladiatorId, choosedGladiator); return(choosedGladiator.GladiatorId); } return(Guid.Empty); }
public void ParryActionPlayerScenario(Gladiator defenderPlayer, PlayerActions actionFromPlayer) { ParryActionFromDefenderPlayer(defenderPlayer, actionFromPlayer); }