Jump to content

Elin:Code Analysis/Combat: Difference between revisions

m
Moving to-hit mechanics here from Elin:Combat
m (Hachimitsu moved page Elin:Spoiler/Damage Calculations to Elin:Code Analysis/Combat without leaving a redirect)
m (Moving to-hit mechanics here from Elin:Combat)
Line 48: Line 48:
|1, 2
|1, 2
|}
|}
==Weapon Hit Mechanics==
<div class="mw-collapsible mw-collapsed" style="overflow:auto;">
<div style="font-weight:bold;line-height:1.6;">Expand on the right</div>
<div class="mw-collapsible-content">
'''Updated EA23.46'''
"Curve" refers to the game's method for adding a sliding curve to the effectiveness of skill values
<nowiki>
CURVE( input, start, step, rate)
if input <= start
return input
repeat x10
{
num = start + repeatindex * step
if input <= num
return input
else
input = num = (input - num) * rate /100
}
return input</nowiki>
First the system evaluates the attacker's 'TO HIT' and the target's 'EVASION'
The TO HIT value will be calculated differently depending on the type of weapon used (thrown, range, melee, martial) and style
{| class="wikitable"
|+ TO HIT
! Weapon Type
! Calculation
|-
| Thrown
| Curve([attacker's DEX]/4 + [attacker's STR]/2 + [attacker's weapon skill], 50, 25, 75) + 75 (250 if not PC Faction)
|-
| Martial (No Shield)
| Curve([attacker's DEX]/3 + [attacker's STR]/3 + [attacker's weapon skill], 50, 25, 75) + 50
|-
|Martial (With Shield)
| 75% of Curve([attacker's DEX]/3 + [attacker's STR]/3 + [attacker's weapon skill], 50, 25, 75) + 50
|-
| Cane
| Curve([attacker's WIL]/4 + [attacker's weapon's primary attribute]/3 [attacker's weapon skill], 50, 25, 75) + 100
|-
| All Others
| Curve([attacker's DEX]/4 + [attacker's weapon's primary attribute]/3 [attacker's weapon skill], 50, 25, 75) + 50
|}
Your Hit modifier from gear and the weapon are then added to the above
(a distance modifier is then applied for Ranged weapons)
EVASION is calculated on a Curve([target's PER] / 3 + [target's evasion skill], 50, 10, 75) + [target's DV] + 25
These values are then modified in the following order with compounding effect:
{| class="wikitable"
|+ MODIFIERS
! Condition
! Effect
|-
| Attacker has Bane
| TO HIT = 75%
|-
| Attacker has HigherGround
| TO HIT +20%
|-
| Attacker is Riding
| TO HIT = TO HIT * 100 / (100 + 500 / higher of(5 or 10 + [attacker's riding skill]))
|-
| Attacker is Hosting
| TO HIT = TO HIT * 100 / (100 + 1000 / higher of(5 or 10 + [attacker's symbiosis skill]))
|-
| Attacker is Being Ridden
| TO HIT = TO HIT * 100 / (100 + 1000 / higher of(5 or 10 + [attacker's STR]))
|-
| Attacker is a Parasite
| TO HIT = TO HIT * 100 / (100 + 1000 / higher of(5 or 10 + [attacker's DEX]))
|-
| Attack is Two Handed
| TO HIT = TO HIT + 25 + sqrt([attacker's two handed skill] * 2)
|-
| Attack is Dual Wield
| TO HIT = TO HIT * 100 / (115 * 15 * (2000 / (20 + [attacker's DualWield skill])[Clamped to 0-100])
|-
| Attacker is Blind
| TO HIT = 33.33% (or 10% if ranged/throwing)
|-
| Target is Blind
| EVASION = 50%
|-
| Target is Dim
| EVASION = 50%
|-
| Target has Higher Ground
| EVASION + 20%
|}
Now the system has the TO HIT and EVASION values, it uses these to calculate if an attack was a hit, miss, or crit in this order
<nowiki>
IF Target is Dim & 1 in 4 chance
  CRIT</nowiki>
<nowiki>
IF Target is Dead or Sleeping
  CRIT</nowiki>
<nowiki>
IF [target's Greater Evasion] * 10 > TO HIT
  num = EVASION * 100 / TO HIT
  IF 'num2' > 300 & random 0 to ([target's Greater Evasion]+250) > 100
MISS
  IF 'num2' > 200 & random 0 to ([target's Greater Evasion]+250) > 150
MISS
  IF 'num2' > 150 & random 0 to ([target's Greater Evasion]+250) > 200
MISS</nowiki>
<nowiki>
IF [target's Perfect Evasion] > random 0 - 99
  MISS</nowiki>
<nowiki>
IF 1 in 20
  HIT</nowiki>
<nowiki>
IF 1 in 20
  MISS</nowiki>
<nowiki>
IF TO HIT < 1
  MISS</nowiki>
<nowiki>
IF EVASION < 1
  HIT</nowiki>
<nowiki>
IF random 0 - TO HIT < random 0 - (EVASION * 125 (150 if ranged attack) / 100)
  MISS</nowiki>
<nowiki>
IF random 0 - 5000 < [attacker's PER]
  CRIT</nowiki>
<nowiki>
IF [attacker's Critical skill] + sqrt([attacker's Eye of Mind skill]) > random 0 -200
  CRIT</nowiki>
<nowiki>
IF attacker has [Heart of Death]
  num = 100 - [attacker's current HP] * 100 / [attacker's Max HP]
  IF num >= 50 & (num^3 / 3) > random 0 - 100000000
      CRIT</nowiki>
<nowiki>
HIT</nowiki>
</div></div>


==Martial Arts==
==Martial Arts==