Hyperlink Combat System

version 1 by Philip Black

  • Home page
  • Beginning
  • Previous
  • Next



  • Section Setting up Combat
    A person can be Predatory Attacker, Pack Predator Attacker, Traitorous Attacker, Erratic Attacker, or Chaotic Stupid.
                
    A person can be Raging, De-Raged, Worried, Frightened, or Defensive-Stance.
    Definition: a person is AttackingFoe if they are Hostile and their health is at least 1 and they are not the player and they are in the location.
    AttackerOrder is a number that varies. AttackerOrder is 1.
    Table of IntFoes
    Recorded Initiative  CAttacker  CTarget  
    0  Person  Person  
    with 30 blank rows.   
    Table of IntFriends
    Recorded Initiative  CAttacker  CTarget  
    0  Person  Person  
    with 30 blank rows.   
    To record (TTX - Person) in (target table - table name): [note that I called the variable TTX]
        choose a blank row in the target table; [you don't need to manually keep track of the number of the row you're writing to--this phrase will find the first blank row]
        now the Recorded Initiative entry is Initiative of TTX;
        now the CAttacker entry is TTX;
        If TTX is Hostile:
            If Reset Dummy is Pack Target:
                Now Pack Target is a random Friendly person in the location;
                now the CTarget entry is Pack Target;
            Otherwise:
                If TTX is Pack Predator Attacker:
                    now the CTarget entry is Pack Target;
                Otherwise:
                    now the CTarget entry is a random Friendly person in the location;
        Otherwise:
            If Reset Dummy is Pack Target:
                Now Pack Target is a random AttackingFoe in the location;
                now the CTarget entry is Pack Target;
            Otherwise:
                If TTX is Pack Predator Attacker:
                    now the CTarget entry is Pack Target;
                Otherwise:
                    now the CTarget entry is a random AttackingFoe in the location;
    To RoleCall:
        blank out the whole of the Table of IntFoes;
        Now GlobalFoeInitiative is 0;
        Now Pack Target is Reset Dummy;
        repeat with attacker running through people in the location: [this is important! it collects every AttackingFoe in the location and runs the following loop on it; so we don't need to pick them out at random, and we don't need to use IntSorting to see whether we've already recorded them]
            If attacker is NOT Non-Combat:
                Record attacker in Table of IntFoes; [and now the "attacker" will get copied to the "TTX" variable in our "to record" phase]
                Increase GlobalFoeInitiative by the Initiative of the attacker;
        choose a row with a CAttacker of the player in the Table of IntFoes;
        blank out the whole row;
        Sort Table of IntFoes in reverse Recorded Initiative order; [This is to rank them by speed so they attack in that order]
        
        
    To say CombatComandLine:
        Say "[if the player is Classed][line break]-------------------------------------------------------------[line break][end if][if the player is Warrior][o]Focus[x] -- [o]Defend[x] --[end if][if the player is Mage][o]Magic[x] --[end if][if player is Cleric] [o]Divine Power[x] -- [end if] ";
    To list the AttackMenu: [This is the way I am checking if it all works]
        If the player is Global Attacker:
            Let W be the player;
            If the player encloses a readied weapon:
                Let W be a random readied weapon enclosed by player; [if the maximum shots of W is at least 1 and the current shots of W is at least 1]
            Say "-------------------------------------------------------------[line break][bold type]Health:[roman type] [Health of Player]/[Permanent Health of Player] [if player is Mage or player is Cleric]-- [bold type]Mana:[roman type] [Mana of Player]/[Permanent Mana of Player][end if][if the maximum shots of W is at least 1 and the current shots of W is at least 1] -- [bold type]Ammo:[roman type] [current shots of W]/[maximum shots of W][otherwise if the maximum shots of W is at least 1] -- [bold type]Ammo:[roman type] [current shots of W]/[maximum shots of W] ▶[o]RELOAD[x]◀[end if][line break][bold type]Weapon:[roman type] [if the player encloses a readied weapon][o][W][x][otherwise]Unarmed[end if] -- [bold type]Damage:[roman type] [dice number of W]d[damage die of W] -- [bold type]Range:[roman type] [Min Range of W] to [Max Range of W][CombatComandLine][line break]-------------------------------------------------------------[line break]";
            Now AttackerOrder is 1;
            repeat through the Table of IntFoes:
                If CAttacker entry is Friendly:
                    say "[AttackerOrder]: [CAttacker entry] -- [bold type]Health:[roman type] [Health of CAttacker entry]/[Permanent Health of CAttacker entry] [bold type]Mana:[roman type] [Mana of Player]/[Permanent Mana of Player][line break]"; [say "[o]Attack [CAttacker entry][x] | [line break]";] [you don't need to choose row AttackerOrder--the "repeat through the table" loop is choosing each row one by one anyway]
                    Increment AttackerOrder;
            Say "[if AttackerOrder is not 0][line break]-------------------------------------------------------------[line break][end if]";
            Now AttackerOrder is 1;
            repeat through the Table of IntFoes:
                If CAttacker entry is Hostile:
                    say " [AttackerOrder]: [CAttacker entry] ▶ HP [health of the CAttacker entry]/[permanent health of the CAttacker entry] +++ [o]Attack [CAttacker entry][x] [If the Player is Mage]+++ [o]Magic [CAttacker entry][x][end if][line break]"; [say "[o]Attack [CAttacker entry][x] | [line break]";] [you don't need to choose row AttackerOrder--the "repeat through the table" loop is choosing each row one by one anyway]
                    Increment AttackerOrder; [...but you still do want to keep track of AttackerOrder so you can print out the row number]