Esempio n. 1
0
        protected void ChangeReceiverPosition(Wrestler attackingWrestler, Wrestler receivingWrestler, WrestlerPosition newPosition)
        {
            string outputText = null;

            switch (newPosition)
            {
            case WrestlerPosition.GROGGY:
                outputText = "{Attacker} picks {Receiver} up off of the mat";
                break;

            case WrestlerPosition.STANDING:
                outputText = "{Attacker} stands {Receiver} back up";
                break;

            case WrestlerPosition.GROUNDED:
                outputText = "{Attacker} puts {Receiver} down onto the floor";
                break;

            case WrestlerPosition.CORNER:
                outputText = "{Attacker} whips {Receiver} into the corner";
                break;

            case WrestlerPosition.RUNNING:
                outputText = "{Attacker} irish whip's {Receiver}";
                break;
            }

            outputText = FormatText(outputText, attackingWrestler, receivingWrestler);
            Output.AddToOutput(outputText);

            attackingWrestler.AddCooldown(0.5f);
            receivingWrestler.AddStun(0.25f);
            receivingWrestler.ChangePosition(newPosition);
        }
Esempio n. 2
0
        //Left public because in the future there may be match specific moves
        public MoveResult AttemptMove(Wrestler receivingWrestler, IMove move, float costMultiplier = 1)
        {
            float staminaCost      = 0.4f * (byte)move.GetStaminaCost() * costMultiplier;
            float maxSuccessChance = myData.technique / staminaCost;

            //Without increasing this value, people with less technique than someone's counter stat can never ever land a move
            maxSuccessChance *= UsefulActions.ClampValue(GetStaminaAsAPercentage()) * 3;

            MoveData moveData = move.GetMove();
            float    damage   = GetDamageByOffenceType(moveData) * staminaCost;

            damage = UsefulActions.RandomiseNumber(damage);

            ConsumeStamina(MOVE_BASE_STAMINA_COST * staminaCost);
            MoveResult result = receivingWrestler.ReceiveMove(maxSuccessChance, moveData, damage);

            receivingWrestler.ChangeTarget(this);              //Without this, multi-man matches get kinda silly with someone getting beat up for free

            if (result == MoveResult.COUNTERED)
            {
                AddStun(receivingWrestler.GetCounterStunLength());
                ChangePosition(moveData.reversalPosition);
                return(result);
            }

            if (result == MoveResult.NORMAL)
            {
                AddMomentum(MOVE_BASE_MOMENTUM_GAIN + damage / 50);                  //No charisma stat, simply made it so that wrestlers who hit harder gain more momentum
            }

            float moveTime = UsefulActions.RandomiseNumber(moveData.lowerMoveTime, moveData.upperMoveTime);              //How long the move took

            AddCooldown(moveTime);
            receivingWrestler.AddStun(moveTime);

            return(result);
        }