예제 #1
0
 public void StrongActionPlayerScenario(Gladiator attackingPlayer, Gladiator defenderPlayer, PlayerActions actionFromPlayer)
 {
     if (attackingPlayer.Stamina >= 50)
     {
         AttackFromAttackingPlayer(attackingPlayer, defenderPlayer, actionFromPlayer);
     }
 }
예제 #2
0
        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);
                }
            }
        }
예제 #3
0
        public void ParryActionFromDefenderPlayer(Gladiator defenderPlayer, PlayerActions playeractions)
        {
            defenderPlayer.Parry();

            if (defenderPlayer.Stamina == 100)
            {
                defenderPlayer.Stamina = defenderPlayer.Stamina;
            }
            else
            {
                defenderPlayer.GainStamina();
            }
        }
예제 #4
0
        //        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();
            }
        }
예제 #5
0
        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);
        }
예제 #6
0
 public void ParryActionPlayerScenario(Gladiator defenderPlayer, PlayerActions actionFromPlayer)
 {
     ParryActionFromDefenderPlayer(defenderPlayer, actionFromPlayer);
 }