# Hyperlink Combat System

## version 1 by Philip Black

**SECTION - ATTACK TYPES**

To StandardAttackSequence:

let d20 be a random number between 1 and 20; [ATTACK ROLL]

Let W be the Global Attacker;

Let FriendW be the Target; [This section stops errors]

If Global Attacker encloses a readied weapon: [This checks to see if they are armed with a ranged weapon]

Let W be a random readied weapon enclosed by the Global Attacker;

If the Global Attacker is Chaotic Stupid:

Now Target is a random person in the location;

Otherwise if the Global Attacker is Hostile:

If the Global Attacker is Erratic Attacker:

Now Target is a random Friendly person in the location;

Otherwise:

choose a row with a CAttacker of the Global Attacker in the Table of IntFoes;

Now Target is CTarget entry;

If the Global Attacker is the player or the Global Attacker is friendly:

If the Current Range of the Target is greater than the Max Range of W: [GETTING INTO RANGE]

Decrease the Current Range of the Target by the Move Speed of the Target;

If the Current Range of the Target is less than the Min Range of W:

Now the Current Range of Target is the Max Range of W; [Close, but not too close!]

Say "[Advancing Text of the Global Attacker](Range: [Current Range of the Target]) ";

Now the Global Attacker is Reset Dummy;

Otherwise if the Current Range of the Target is less than the Min Range of W: [BACKING AWAY INTO RANGE]

Increase the Current Range of the Target by the Move Speed of the Target;

If the Current Range of the Target is greater than the Max Range of W:

Now the Current Range of Target is the Max Range of W; [Far, but not too far!]

Say "[Backing Away Text of the Global Attacker](Range: [Current Range of the Target]) ";

Now the Global Attacker is Reset Dummy;

Otherwise:

If the Current Range of the Global Attacker is greater than the Max Range of W: [GETTING INTO RANGE]

Decrease the Current Range of the Global Attacker by the Move Speed of the Global Attacker;

If the Current Range of the Global Attacker is less than the Min Range of W:

Now the Current Range of Global Attacker is the Max Range of W; [Close, but not too close!]

Say "[Advancing Text of the Global Attacker] (Range: [Current Range of the Global Attacker]) ";

Now the Global Attacker is Reset Dummy;

Otherwise if the Current Range of the Global Attacker is less than the Min Range of W: [BACKING AWAY INTO RANGE]

Increase the Current Range of the Global Attacker by the Move Speed of the Global Attacker;

If the Current Range of the Global Attacker is greater than the Max Range of W:

Now the Current Range of Global Attacker is the Max Range of W; [Far, but not too far!]

Say "[Backing Away Text of the Global Attacker](Range: [Current Range of the Global Attacker]) ";

Now the Global Attacker is Reset Dummy;

If Global Attacker is NOT Reset Dummy:

If W is a melee weapon or W is a person or the maximum shots of W is 0 or the current shots of W is at least 1: [TIME TO ATTACK!!!]

If the current shots of W is at least 1:

Decrease the current shots of W by 1;

Let Aim Total be d20 plus accuracy bonus of W plus Base Accuracy of the Global Attacker plus the concentration of the Global Attacker; [ATTACK ROLL]

If W is melee weapon or W is a person: [VS Defence & Defense bonus]

If Target encloses a readied weapon:

Let FriendW be a random readied weapon enclosed by the Target;

Now DTotal is the defence of the Target plus the parry bonus of FriendW plus the defence Bonus of the Target plus the Defensive Focus of the Target; [VS Defence Total]

Otherwise: [VS Evasion & Dodge Bonus]

Now DTotal is the Evasion of the Target plus the Dodge Bonus of the Target plus the Defensive Focus of the Target;

If d20 is 1:

let Crit be the Level times 5;

Say "[TheyCritMiss of Global Attacker]";

Otherwise if Aim Total is greater than DTotal or d20 is 20:

let D be the dice number of W; [DAMAGE]

let y be the damage die of W;

Let Q be D times y;

let Damage Total be a random number between D and Q;

If d20 is 20:

let Crit be the Level times 5;

Increase Damage Total by Crit;

Decrease the health of Target by Damage Total;

If W is CustomWeapon:

follow the Custom Weapon Power for W;

Say "[If W is Ranged Weapon][Ranged Attack Text of Global Attacker][otherwise][Attacking Text of Global Attacker][end if][if d20 is NOT 20][HITTING U of the Global Attacker][otherwise][CRITICAL HIT of the Global Attacker][end if] ([if d20 is 20]CRIT! [otherwise if d20 is 1]Critical MISS!! [end if][Damage Total] Damage) ";

If numbers boolean is true:

If W is ranged weapon:

Say "[line break]d20 + Accuracy Bonus of weapon + Concentration + Base Accuracy of [Global Attacker] -VS- [if Target is the Player]Your[otherwise][Target Name]'s[end if] Evasion + Dodge Bonus + Defensive Focus[line break][italic type]([d20] + [accuracy bonus of W] + [Concentration of Global Attacker] + [Base Accuracy of Global Attacker] = [Aim Total] ~VS~ [bold type][DTotal][roman type][italic type] = [Evasion of the Target] + [Dodge Bonus of the Target] + [Defensive Focus of the Target])[roman type]";

Otherwise:

Say "[line break]d20 + Accuracy Bonus of weapon + Concentration + Base Accuracy of [Global Attacker] -VS- [if Target is the Player]Your[otherwise][Target Name]'s[end if] Defence + Defence Bonus + Weapon Parry + Defensive Focus[line break][italic type]([d20][if d20 is 20] CRIT![end if] + [accuracy bonus of W] + [Concentration of Global Attacker] + [Base Accuracy of Global Attacker] = [bold type][Aim Total][roman type][italic type] ~VS~ [bold type][DTotal][roman type][italic type] = [defence of the Target] + [defence Bonus of the Target] + [parry bonus of FriendW] + [Defensive Focus of the Target])[roman type]";

Otherwise if Aim Total is NOT greater than DTotal:

If the Global Attacker is Hostile:

Say "[If W is a melee weapon or W is a person or the maximum shots of W is 0][You Block Them of Global Attacker][otherwise][You-Dodge-Ranged of Global Attacker][end if]";

Otherwise:

Say "[If W is a melee weapon or W is a person or the maximum shots of W is 0][YouMiss TheyBlock of Target][otherwise][You-Dodge-Ranged of Target][end if]";

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 0 and the Global Attacker is the player:

Say "[line break]Your weapon is out of ammo! ▶[o]RELOAD[x]◀";

If the health of the Target is NOT at least 1: [For when the target drops dead]

If the Target is Hostile:

choose a row with a CAttacker of the Target in the Table of IntFoes;

Decrease EnemyCombatants by 1;

Otherwise if the Target is Friendly and the Target is NOT the player:

choose a row with a CAttacker of the Target in the Table of IntFriends;

blank out the whole row;

Follow the Defeat rules for the Target;

If EnemyCombatants is 0:

If CombatActive is true:

Now CombatActive is false;

Now FirstTurn is true;

Follow the Victory rules for the player;

follow the set hyperlink command prompt rule;

Otherwise if the maximum shots of W is at least 1: [This is if the weapon is out of ammo]

If the current shots of W is 0:

Say "[Reloading Text of Global Attacker]";

Now the current shots of W is the maximum shots of W;

Otherwise:

Say "[Global Attacker] tries to attack, but their weapon breaks! "; [This allows us to activate weapon breakage by setting current shots to -1]

Otherwise:

Say "[Global Attacker] can't attack! ";

If the Global Attacker is the player:

Now the Global Attacker is Reset Dummy;

[ + Shield Bonus + Armour Bonus (Armour is only for melee attacks?)]