Пример #1
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);
        }
Пример #2
0
 public void ChangePosition(WrestlerPosition newPosition)
 {
     currentPosition = newPosition;
     if (!IsStunned())
     {
         AddCooldown(0.4f);
     }
 }
Пример #3
0
 public Wrestler(WrestlerData myData)
 {
     this.myData     = myData;
     health          = MAX_HEALTH_POINTS;
     maxHealth       = MAX_HEALTH_POINTS;
     headHealth      = MAX_HEALTH_POINTS;
     torsoHealth     = MAX_HEALTH_POINTS;
     armHealth       = MAX_HEALTH_POINTS;
     legHealth       = MAX_HEALTH_POINTS;
     stamina         = MAX_STAMINA;
     momentum        = 100;
     actionTimer     = 0;
     stunnedTimer    = 0;
     collapseCounter = 0;
     currentPosition = WrestlerPosition.STANDING;
 }
Пример #4
0
        public readonly float lowerMoveTime, upperMoveTime;         //length of time it takes to perform the move

        public MoveData(string textToParse)
        {
            string textFromFile = UsefulActions.GetDataFromUnparsedFile(textToParse, "Name: ");

            name = textFromFile;

            textFromFile = UsefulActions.GetDataFromUnparsedFile(textToParse, "Description: ");
            description  = textFromFile;

            textFromFile = UsefulActions.GetDataFromUnparsedFile(textToParse, "Stamina Cost: ");
            switch (textFromFile.ToUpper())
            {
            case "VERY LOW":
                staminaCost = StaminaCost.VERY_LOW;
                break;

            case "LOW":
                staminaCost = StaminaCost.LOW;
                break;

            case "NORMAL":
                staminaCost = StaminaCost.NORMAL;
                break;

            case "HIGH":
                staminaCost = StaminaCost.HIGH;
                break;

            case "VERY HIGH":
                staminaCost = StaminaCost.VERY_HIGH;
                break;
            }

            textFromFile = UsefulActions.GetDataFromUnparsedFile(textToParse, "Offence Type: ");
            switch (textFromFile.ToUpper())
            {
            case "GRAPPLE":
                offenceType = OffenceType.GRAPPLE;
                break;

            case "STRIKE":
                offenceType = OffenceType.STRIKE;
                break;

            case "DIVE":
                offenceType = OffenceType.FLYING;
                break;

            case "RUNNING":
                offenceType = OffenceType.RUNNING;
                break;
            }

            textFromFile     = UsefulActions.GetDataFromUnparsedFile(textToParse, "Required Position: ");
            requiredPosition = StringToPosition(textFromFile);

            textFromFile             = UsefulActions.GetDataFromUnparsedFile(textToParse, "Required Opponent Position: ");
            requiredOpponentPosition = StringToPosition(textFromFile);

            textFromFile     = UsefulActions.GetDataFromUnparsedFile(textToParse, "Finished Position: ");
            finishedPosition = StringToPosition(textFromFile);

            textFromFile     = UsefulActions.GetDataFromUnparsedFile(textToParse, "Reversal Position: ");
            reversalPosition = StringToPosition(textFromFile);

            textFromFile = UsefulActions.GetDataFromUnparsedFile(textToParse, "Damaged Body Parts: ");
            string[] bodyParts = textFromFile.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries);
            damagedBodyParts = new BodyPart[bodyParts.Length];
            for (byte i = 0; i < bodyParts.Length; i++)
            {
                switch (bodyParts [i].ToUpper())
                {
                case "HEAD":
                    damagedBodyParts [i] = BodyPart.HEAD;
                    break;

                case "TORSO":
                    damagedBodyParts [i] = BodyPart.TORSO;
                    break;

                case "ARMS":
                    damagedBodyParts [i] = BodyPart.ARMS;
                    break;

                case "LEGS":
                    damagedBodyParts [i] = BodyPart.LEGS;
                    break;

                default:
                    throw new Exception("Not a valid body part.");
                }
            }

            textFromFile  = UsefulActions.GetDataFromUnparsedFile(textToParse, "Lower Move Time: ");
            lowerMoveTime = float.Parse(textFromFile);

            textFromFile  = UsefulActions.GetDataFromUnparsedFile(textToParse, "Upper Move Time: ");
            upperMoveTime = float.Parse(textFromFile);
        }
Пример #5
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);
        }
Пример #6
0
 public PositionLayout(WrestlerPosition currentPosition, WrestlerPosition currentOpponentPosition)
 {
     this.currentPosition         = currentPosition;
     this.currentOpponentPosition = currentOpponentPosition;
 }