Hyperlink Combat System

version 1 by Philip Black

  • Home page
  • Beginning
  • Previous
  • Next



  • Section CARRY OUT COMBAT
        
    Aim Total is a number that varies. [Storing totals for global use]
    DTotal is a number that varies.
    d20 is a number that varies.
    Damage Total is a number that varies.
    FirstTurn is a truth state that varies. FirstTurn is True.
    Generic Ending is initially False.
    Reset Dummy is a person. [This loops combat and stops the player attacking infinitely]
    [Global Attacker]
    Every turn when a AttackingFoe is in the location of the player:
        Now EnemyCombatants is the number of AttackingFoe in the location of the player;
        if the health of the Player is at least 1:
            If FirstTurn is true: [First Turn of Combat rules!]
                follow the set Combat Prompt rule;
                Now FirstTurn is false;
                Now CombatActive is true;
                Now AttackerOrder is 1;
                RoleCall;
                Let DScore1 be a random number between 1 and 20;
                Let Xtotal be the initiative of the player plus DScore1 plus level;
                if Xtotal is at least GlobalFoeInitiative:
                    now the Global Attacker is the player;
                    If numbers boolean is true:
                        Say "[line break]Rolling initiative: 1d20 + [initiative of the player] + Level [Level] -VS- Enemy Initiative [GlobalFoeInitiative] [line break][italic type]([DScore1] + [initiative of the player] = [bold type][Xtotal][roman type] -VS- [italic type] [GlobalFoeInitiative])[Roman type] [bold type]WIN! You go first![Roman type][line break][line break]";
                otherwise:
                    now the Global Attacker is a random AttackingFoe;
                    If numbers boolean is true:
                        Say "[line break]Rolling initiative: 1d20 + [initiative of the player] + Level [Level] -VS- Enemy Initiative [GlobalFoeInitiative] [line break][italic type]([DScore1] + [initiative of the player] = [bold type][Xtotal][roman type] -VS- [italic type] [GlobalFoeInitiative])[Roman type] [bold type]FAIL!![Roman type][line break][line break]"; [<-----------------------------------------------------END OF ROLLING INT]
            If EnemyCombatants is 0: [YOU WIN!]
                If CombatActive is true:
                    Combat Reset System;
                    Follow the Victory rules for the player;
            If Global Attacker is the player: [THIS IS WHERE FIGHTING BEGINS]
                say "[line break][bold type][Waiting Text of a random AttackingFoe][roman type][line break][line break]"; [ATTACKING]
                list the AttackMenu;
            Otherwise:
                repeat through the Table of IntFoes: [ENEMIES]
                    Now the Global Attacker is CAttacker entry;
                    If the health of CAttacker entry is at least 1:
                        follow the Default-Attack rules for CAttacker entry;
                        If numbers boolean is true:
                            Say "[line break][line break][bold type](Press Any Key to Continue)[roman type][line break]";
                            Wait for any key;
                    Otherwise:
                        blank out the whole row;
                Now the global Attacker is the player;
                Say "[line break][line break]";
                Continue Combat;
        Otherwise: [if the health of the Player NOT AT LEAST 1 --- END COMBAT IN DEFEAT!]
            Combat Reset System;
            If Generic Ending is true:
                follow the Defeat rules for the Player;
            Otherwise:
                If Global Attacker is the player:
                    follow the Victory rules for a random AttackingFoe;
                Otherwise:
                    follow the Victory rules for the Global Attacker;
    To Continue Combat: [This kicks in to keep attacks flipping between the teams]
        If the health of the player is at least 1:
            Now EnemyCombatants is the number of AttackingFoe in the location of the player;
            If EnemyCombatants is 0:
                If CombatActive is true:
                    Say "[Paragraph Break]VICTORY! The enemy has defeated itself! You have won!";
                    Combat Reset System;
            Otherwise:
                list the AttackMenu;
        Otherwise:
            Combat Reset System;
            If Generic Ending is true:
                follow the Defeat rules for the Player;
            Otherwise:
                If Global Attacker is the player:
                    follow the Victory rules for a random AttackingFoe;
                Otherwise:
                    follow the Victory rules for the Global Attacker;
    To Combat Reset System: [Generic end of combat rules - This is seperate to make it easier to modify]
        Level Up Checker;
        Now CombatActive is false;
        Now FirstTurn is true;
        follow the set hyperlink command prompt rule;
        repeat with item running through people in the location:
            Now the Concentration of item is 0;
            Now the Defensive Focus of item is 0;