コード例 #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);
        }
コード例 #2
0
        //Move with a destination
        public void MoveToAdjacentNode(Wrestler wrestler, NodeIndex start, NodeIndex destination)
        {
            if (!IsValidNode(start) || !IsValidNode(destination))
            {
                throw new Exception("The path you requested cannot be done.");
            }
            NodeIndex difference = start - destination;

            if (Math.Abs(start.x) > 1)
            {
                NodeIndex newDestination = start + new NodeIndex((sbyte)Math.Sign(difference.x), (sbyte)0);
                MoveToAdjacentNode(wrestler, start, newDestination);
                MoveToAdjacentNode(wrestler, newDestination, destination);
            }

            if (Math.Abs(start.y) > 1)
            {
                NodeIndex newDestination = start + new NodeIndex((sbyte)0, (sbyte)Math.Sign(difference.y));
                MoveToAdjacentNode(wrestler, start, newDestination);
                MoveToAdjacentNode(wrestler, newDestination, destination);
            }

            allNodes [start.y, start.x].RemoveWrestlerFromNode(wrestler);
            allNodes [destination.y, destination.x].AddWrestlerToNode(wrestler);
            wrestler.SetEnvironment(this, destination);
            wrestler.AddCooldown(0.5f);
        }
コード例 #3
0
        protected void ChangePosition(Wrestler wrestler, WrestlerPosition newPosition)
        {
            string outputText = null;

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

            case WrestlerPosition.STANDING:
                outputText = "{Attacker} regains their bearings";
                break;

            case WrestlerPosition.GROUNDED:
                outputText = "{Attacker} drops down to the mat";
                break;

            case WrestlerPosition.CORNER:
                outputText = "{Attacker} moves to the corner";
                break;

            case WrestlerPosition.RUNNING:
                outputText = "{Attacker} runs and bounces off of the ropes";
                break;
            }

            outputText = FormatText(outputText, wrestler);
            Output.AddToOutput(outputText);

            wrestler.AddCooldown(0.5f);
            wrestler.ChangePosition(newPosition);
        }