Equipment - Past-to-Future/DarkEmpire GitHub Wiki

Equipment (Weapons, armors, and other accessories) provide offensive and defensive capabilities in battle. Skills allow for and enhance the effectiveness of the use of such items. All equipment have tiers, effectively the level of the equipment, which determines the magnitude of their attributes. The distribution of equipment attributes does not change.

Weapons

  • Sharpness: Determines Slash and Pierce Damage.
  • Inertia/Draw: Determines Blunt and Pierce Damage, and time for swings.
  • Hardness: Determines armor penetration.
  • Stability: Determines attack accuracy.
  • Related Attribute: Which character attribute to use in the damage calculation.
  • Reach: Melee Weapons only. Measured in feet. Determines slowdown for melee vs. melee weapon combat.
  • Critical: The amount that damage is multiplied by when a critical hit is scored.

Weapons come in 4 types: Melee, Bow, Thrown, and Mechanical. Melee Weapons have all 7 weapon attributes. Thrown Weapons have all but Reach. Ranged and Mechanical weapons only have Draw and Stability, while their ammo have Sharpness, Hardness, and Critical.

[List of Melee Weapons](Melee Weapons)

Armor

  • Thickness: Describes damage reduction against Slash and Pierce Damage.
  • Hardness: Describes damage reduction against Blunt and Pierce Damage.
  • Mobility: Determines ability to dodge.
  • Weight: Determines slowdown due to armor. Each armor will also be rated for certain damage types:
Divine Heat Cold Electricity
Water Air Earth Shadow

Attack Roll

In order to calculate the attack roll, a few numbers needed first. Time (the length of time in seconds that the attack will take,) Aggregate Damage (the pre-multiplier damage potential,) Offense (representing the attacker's relative skill with their weapon,) Defense (the defender's ability to avoid a blow.)

Time

For melee vs. melee combat, the Reach Bonus to Time is based on the difference between the defender's weapon's reach and the attacker's weapon's reach, otherwise it is just 0.

Reach Bonus (Melee vs. Melee): rb = Defender Reach - Attacker Reach

Reach Bonus (Other): rb = 0

The difficulty of executing the attack quickly can be calculated by weapon type and armor weight. The weapon type determines whether or not a character's strength can make the attack go faster. Melee, Bow, and Thrown weapons rely on Strength. Mechanical weapons are considered to have constant execution times.

Execution Difficulty (Melee, Bow, Thrown): exec = Weight/10 + (Inertia,Draw)/4 - Strength

Execution Difficulty (Mechanical): exec = Weight/10 + 5

Time can then be calculated with the Reach Bonus, Execution Difficulty, and Movement Bonus in mind.

Time: t = 3 + rb + exec

This tells us how long it will take from the issuing of the command to execute the attack.

Aggregate Damage

There are three main damage types: Slashing, Piercing, and Blunt. These are the only damage types for most weapons (special ammo and enchanted weapons are the exceptions.) Each damage type gets its own damage calculation.

First, the attack and defense factors must be calculated for each type. The attacker's weapon attributes and the defender armor attributes are implied (replace Inertia with Draw when using Bows and Mechanical Weapons.) For the Pierce calculations, there is a chance of division by zero in the comparison. Catch it by setting the factor to zero if either of its terms is zero.

Slash Attack Factor: saf = Sharpness / ( Sharpness + Inertia )

Pierce Attack Factor: paf = (Sharpness + Inertia) * min( Sharpness / Inertia, Inertia / Sharpness )/SQRT(2)

Blunt Attack Factor: baf = Intertia / ( Sharpness + Inertia )

Attack Correction Term: atkcor = (Sharpness + Inertia) / SQRT( sf ^ 2 + pf ^ 2 + bf ^ 2)

Slash Defense Factor: sdf = Thickness / ( Thickness + Hardness )

Pierce Defense Factor: pdf = min( Thickness / Hardness, Hardness / Thickness )/SQRT(2)

Blunt Defense Factor: bdf = Inertia / ( Thickness + Hardness )

Defense Correction Term: defcor = (Thickness + Hardness) / SQRT( sf ^ 2 + pf ^ 2 + bf ^ 2)

This allows us to calculate the damage for each main type.

Slash Damage: sdam = max(0, saf*atkcor - max(0,sdf - Weapon Hardness)*defcor)

Pierce Damage: pdam = max(0, paf*atkcor - max(0,pdf - Weapon Hardness)*defcor)

Blunt Damage: bdam = max(0, baf*atkcor - max(0,bdf - Weapon Hardness)*defcor)

For additional damage types, the damage will be calculated separately or be a given value. The damage contribution for that additional type is that given damage less the armor's defense rating for that damage type.

(Type) Damage (t)dam = max(0, (given damage) - (armor rating for damage type) )

The aggregate damage is the sum of all the damages for each type. Remember that this is still a decimal number.

Aggregate Damage: agg = Related Attribute + sdam + pdam + bdam + (additional damage types)

Offense and Defense

When the attack executes, Offense and Defense must be calculated to make the attack roll.

Offense takes into account Weapons Stability and Character Perception for accuracy.

Offense: off = 1 + Perception + (Stability/2)

Defense Takes into account the defender's Agility and their armor's Mobility.

Defense: def = 1 + Agility + (Mobility/2)

Resolving the Attack Roll

The attack roll takes Offense and Defense and a Random Number (from -3 to 3,) Offense, and Defense to determine an attack multiplier.

Random Number rand = [-3, 3]

Attack Roll: att = D*( erf(Arand + Berf(1 - def/off)) + 1 ) + E

A = 0.423 B = 0.259 D = 0.505 E = 0.04

The Attack Roll is the multiplier for the Aggregate Damage done. The numbers A, B, C, and D are calculated via computer and are subject to fine tuning. When the Random Number is at least 2.7, a critical hit is scored. This further multiplies the damage by the weapon's Critical. When the Random Number is less than -1.8, the attack misses.

Total Damage (-1.8<=rand<2.7): tot = att * agg

Total Damage (rand>=2.7): tot = Critical * att * agg

Total Damage (-1.8<=rand): (Miss)

The damage applied to the defender is Total Damage rounded up to an integer.

⚠️ **GitHub.com Fallback** ⚠️