Elin:Code Analysis/Combat: Difference between revisions

m
No edit summary
 
(40 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{Spoiler}}
{{Version|23.46}}
== Evalue List ==
== Evalue List ==
{| class="wikitable"
{| class="wikitable"
Line 46: Line 48:
|1, 2
|1, 2
|}
|}
== Damage Reduction Scaling with Enemy Level ==
'''As of Beta version: 22.23. Last updated EA23.46'''
The following is how much damage reduction the enemy receives past level 50:
Firstly, enemies at or below level 50 have 0% DR.
Conversely, enemies at or above level 1024 have 80% DR. 
if (!this.IsPCFaction && this.LV > 50)
{
    dmg = dmg * (100 - (int)Mathf.Min(80f, Mathf.Sqrt((float)(this.LV - 50)) * 2.5f)) / 100;
}
If it is the player character faction and the enemy's level is higher than lvl 51, then:
your damage is multiplied by * (100 - an integer that is the smallest of either (80, the sqrt of a float (the enemies level - 50) * 2.5) / 100)
so either your damage is reduced by 80% against enemies above 1024 or its  [sqrt(floor - 50) * 2.5] / 100 for enemies between lvl 51 and lvl 1023
{| class="wikitable"
|+DR at specified levels
!Enemy Level:
!DR percentage (%)
|-
|51
|2.50
|-
|100
|17.67
|-
|150
|25.00
|-
|200
|30.61
|-
|250
|35.35
|-
|300
|39.53
|-
|350
|43.30
|-
|400
|46.77
|-
|450
|50.00
|-
|500
|53.03
|-
|550
|55.90
|-
|600
|58.63
|-
|650
|61.24
|-
|700
|63.74
|-
|750
|66.14
|-
|800
|68.47
|-
|850
|70.71
|-
|900
|72.89
|-
|950
|75
|-
|1000
|77.06
|}
==Weapon Hit Mechanics==
'''Updated EA23.46'''
"Curve" refers to the game's method for adding a sliding curve to the effectiveness of skill values
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
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(DW) = TO HIT * 100 / (115 + Slot# * 15 + Slot# * (2000/(20+ attacker's dual wield skill)) [Clamped to 1-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%
|}
^ Where Slot# represents the main hand / off hand and any indexed hand after two. Only the (2000/(20 + attacker's dual wielding skill)) is clamped between 1-100. This means optimally the best dual wielding scenario occurs when you have 1980 dual wielding.
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>


==Martial Arts==
==Martial Arts==
Line 86: Line 330:
The damage value of the dice is '''5+√(Martial Arts / 3).'''  
The damage value of the dice is '''5+√(Martial Arts / 3).'''  


Damage multiplier is '''0.6 + ((Strength / 2 + Martial Arts / 2 + Evalue(132) / 2) / 50.0).'''
Damage multiplier is '''0.6 + ((Strength / 2 + Martial Arts / 2 + Tactics / 2) / 50.0).'''


If the player has the Weapon Mastery feat, additional damage is provided at a rate of  '''0.05x(Weapon Mastery Rank).''' <sub>''(Effectively, +0.05 or +0.10)''</sub>
If the player has the Weapon Mastery feat, additional damage is provided at a rate of  '''0.05x(Weapon Mastery Rank).''' <sub>''(Effectively, +0.05 or +0.10)''</sub>
Line 92: Line 336:
Accuracy is  '''((Strength /3 + Dexterity /3 + Martial Arts)+50)),''' with a minimum value of '''25+50''' and a maximum of '''75+50.''' If the player is wielding a '''Shield,''' there is a '''-25%''' downward adjustment.
Accuracy is  '''((Strength /3 + Dexterity /3 + Martial Arts)+50)),''' with a minimum value of '''25+50''' and a maximum of '''75+50.''' If the player is wielding a '''Shield,''' there is a '''-25%''' downward adjustment.


Penetration is calculated at '''(Martial Arts/10)+5''', with a minimum of '''5%''' and a maximum of '''20%+Evalue(92).'''
Penetration is calculated at '''(Martial Arts/10)+5''', with a minimum of '''5%''' and a maximum of '''20% + Penetration.'''


If weilding Martial Art Weapon:
If wielding Martial Art Weapon:


Damage Bonus is your empty hand Damage Bonus + '''Weapon's''' '''Damage Bonus'''
Damage Bonus is your empty hand Damage Bonus + '''Weapon's''' '''Damage Bonus'''
Line 129: Line 373:
Attack Type is always '''Blunt'''
Attack Type is always '''Blunt'''


Weight Value is '''√Throwing Item Weight x 3 + if''' '''is Throwing Weapon: 75''' else '''0''', with floor of '''10''' to ceiling of '''400''' + '''√(Strength x 50)'''
Weight Value is ['''√Throwing Item Weight] x 3 + 25 + if''' '''is Throwing Weapon: 75''' else '''0''', with floor of '''10''' to ceiling of '''400''' + ['''√Strength] x 50'''


Material Value is '''Material Hardness''', with floor of '''if''' '''is Throwing Weapon: 40''' else '''0''' to ceiling of '''200'''
Material Value is '''Material Hardness''', with floor of '''if''' '''is Throwing Weapon: 40''' else '''25''' to ceiling of '''200'''


Dice Number is always '''2'''
Dice Number is always '''2'''
Line 201: Line 445:
     this.dDimAmmo = 0;
     this.dDimAmmo = 0;
}
}
</syntaxhighlight>The player swing thier melee weapon using the Tactics skill or shoot ranged weapon using the Marksman skill
</syntaxhighlight>The player swings their melee weapon using the Tactics skill or shoots ranged weapons using the Marksman skill
 
If the weapon is: '''Cane''' or it has the '''Force Weapon''' enchantment it uses '''Casting''' skill instead of Tactics or Marksman skill


If the weapon is '''Cane''' or it has '''Force Weapon''' enchantment it uses '''Magic Device''' skill instead of Tactics or Marksman skill
If the weapon is: '''Cane''' or it has the '''Force Weapon''' enchantment it uses Magic Device skill instead of Longsword / Shortsword / Axes / etc...


Damage Bonus is '''Player Character Damage Bonus''' + '''Weapon Mod Tool Damage Bonus''' + '''Weapon Damage Bonus'''
Damage Bonus is: '''Player Character Damage Bonus''' + '''Weapon Mod Tool Damage Bonus''' + '''Weapon Damage Bonus'''


Damage Multiplier is 0.6 + ('''Weapon''' '''Main Stat''' + '''Weapon''' '''Skill / 2''' + (If Melee Weapon '''Tactics,''' if Ranged Weapon '''Marksman,''' if Cane or Force Weapon '''Magic Device''')) / 50
Damage Multiplier is: 0.6 + ('''Weapon Skill Attribute''' + '''Weapon''' '''Skill / 2''' + (If Melee Weapon its '''Tactics,''' if Ranged Weapon its '''Marksman,''' if Cane or Force Weapon its '''Casting''')) / 50


If the player has the Weapon/Ranged Mastery feat, additional damage is provided at a rate of  '''0.05 x (Weapon/Ranged Mastery Rank).''' <sub>''(Effectively, +0.05 or +0.10)''</sub>
If the player has the Weapon/Ranged Mastery feat, additional damage is provided at a rate of  '''0.05 x (Weapon/Ranged Mastery Rank).''' <sub>''(Effectively, +0.05 or +0.10)''</sub>


Accuracy is ('''Dexterty''' or if '''Cane''' or Force Weapon '''Will''') / 4 + '''Weapon Skill''' / 3 + (If Melee Weapon '''Tactics''', if Ranged Weapon '''Marksman''', if '''Cane''' or Force Weapon '''Magic Device''') with a minimum value of '''25+50''' and a maximum of '''75+50'''
Accuracy is: ('''Dexterity''' or '''Will if Cane''') / 4 + '''Weapon Skill Attribute''' / 3 + (If Melee Weapon '''Tactics''', if Ranged Weapon '''Marksman''', if '''Cane''' or Force Weapon '''Magic Device''')  
 
If it's '''Cane''' accuracy additional + 50


If it's '''Cane''' accuracy addtional + 50
To Hit Bonus is: '''Character To Hit Bonus''' + '''Weapon To Hit Bonus''' + '''Ammo To Hit Bonus''' (if load with ammo)


To Hit Bonus is '''Character To Hit Bonus''' + '''Weapon To Hit Bonus''' + '''Ammo To Hit Bonus''' (if load with ammo)
Damage Bonus is: '''Character Damage Bonus''' + '''Weapon Damage Bonus''' + '''Ammo Damage Bonus''' (if load with ammo)


Damage Bonus is '''Character Damage Bonus''' + '''Weapon Damage Bonus''' + '''Ammo Damage Bonus''' (if load with ammo)
Penetration is: '''Character Penetration''' + '''Weapon Penetration'''
==Spellcasting/Spellpower==
This is line 44 of Ability.cs


Penetration is '''Character Penetration''' + '''Weapon Penetration'''
 
==Spellcasting/Damaging Spells==
Here we have the code that describes which formula it uses to determine the spellpower of an NPC's spell<syntaxhighlight lang="c#" line="1">
<syntaxhighlight lang="c#">
    public override int GetPower(Card c)
public override int GetPower(Card c)
{
    int num = base.Value * 8 + 50;
    if (!c.IsPC)
     {
     {
         num = Mathf.Max(num, c.LV * 6 + 30);
         int num = base.Value * 8 + 50;
        if (!c.IsPC)
        {
            num = Mathf.Max(num, c.LV * 6 + 30);
            if (c.IsPCFactionOrMinion && !base.source.aliasParent.IsEmpty())
            {
                num = Mathf.Max(num, c.Evalue(base.source.aliasParent) * 4 + 30);
            }
        }
        num = EClass.curve(num, 400, 100, 75);
        if (this is Spell)
        {
            num = num * (100 + c.Evalue(411)) / 100;
        }
        return num;
     }
     }
    num = EClass.curve(num, 400, 100, 75);
</syntaxhighlight>Here we have the curve function:<syntaxhighlight lang="c#" line="1">
    if (this is Spell)
    {
        num = num * (100 + c.Evalue(411)) / 100;
    }
    return num;
}
</syntaxhighlight><syntaxhighlight lang="c#">
public static int curve(int a, int start, int step, int rate = 75)
public static int curve(int a, int start, int step, int rate = 75)
{
{
Line 256: Line 509:
</syntaxhighlight>Spellpower is curve( ('''Spell Level''' x 8 + 50), 400, 100, 75 ) x (100 + '''Spell Enhance Enchanement''') / 100 if it's Player Character
</syntaxhighlight>Spellpower is curve( ('''Spell Level''' x 8 + 50), 400, 100, 75 ) x (100 + '''Spell Enhance Enchanement''') / 100 if it's Player Character


Spellpower is'''Spell Level''' x 8 + 50 or '''Char Level''' x 6 + 30, choose the bigger one of it's not Player Character
Spellpower is the larger one between '''Spell Level''' x 8 + 50 or '''Char Level''' x 6 + 30 or '''Main Attribute''' x 4 + 30 if it's not the Player Character


About '''curve''' '''<code>curve(a, start, step, rate)</code> Function:'''
About '''curve function:''' '''<code>curve(a, start, step, rate)</code>'''  


Set <code>i = 0</code>. Calculate <code>num = start + i * step</code>. When <code>a</code> exceeds <code>num</code>, the excess portion needs to be multiplied by <code>rate / 100</code>. Then increment <code>i</code> by 1. Repeat the above steps 10 times
Set <code>i = 0</code>. Calculate <code>num = start + i * step</code>. When <code>a</code> exceeds <code>num</code>, the excess portion needs to be multiplied by <code>rate / 100</code>. Then increment <code>i</code> by 1. Repeat the above steps 10 times


In simple terms, this function is used to compress numerical values. The slope of the function's curve gradually decreases to <code>(rate / 100)^10</code>
In simple terms, this function is used to compress numerical values. The slope of the function's curve gradually decreases to <code>(rate / 100)^10</code>
== Spellcasting/Damaging Spells ==
Dice number, dice sides and damage bonus are rounded down.
[[File:Damage of different types of spells as of EA23.71.png|thumb|upright=5.0|Damage of different types of spells as of EA23.71, including standard deviation. The parameter is fixed at MAG = 100, x-axis for spell level, and y-axis for average damage.]]
{| class="wikitable"
{| class="wikitable"
|+
|+
Line 301: Line 559:
|
|
|Damage once per turn
|Damage once per turn
|-
|Breath
|1+Spellpower/80+Attribute/20
|6+Spellpower/100
|Attribute/4
|Damage all targets in a 7 tiles long 35° cone from the caster
|-
|-
|Meteor
|Meteor
Line 312: Line 576:
|-
|-
|Earthquake
|Earthquake
|5+Spellpower/30
|1+Spellpower/30
|10+Attribute/3
|2+Attribute/3
|
|
|Always Imapct element
|Always Imapct element
Line 379: Line 643:
|
|
|-
|-
|SpHOT?
|Nature's Embrace
|1+Spellpower/125
|1+Spellpower/125
|4+Spellpower/75
|4+Spellpower/75
|
|
|Saw this in source code
|
Dunno what this is
|}
|}
== Spellcasting/Buff Spells ==
{| class="wikitable"
|+
!Type
!Power
!Duration
!Notes
|-
|Intonation of (Element)
|(CHA/40 + 1)*5
|Spellpower/25 + 8
|The power in this case is the resistance it provides
|-
|Telepathy
|
|Spellpower/5 + 15
|
|-
|Invisibility
|Spellpower/30 + 5
|Spellpower/12 + 6
|
|-
|See Invisible
|Spellpower/40 + 6
|Spellpower/6 + 12
|
|-
|Disguise
|
|Spellpower/2 + 20
|
|-
|Cat's Eye
|Spellpower/30 + 5
|Spellpower*3
|
|-
|Holy Veil
|
|Spellpower/6 + 5
|
|-
|Elemental Shield
|Spellpower/200 + 5
|Spellpower/15 + 8
|The power in this case is the resistance it provides for all three types
|-
|Hero
|STR: Spellpower/30 + 5
DEX: Spellpower/30 + 5
|Spellpower/4 + 10
|
|-
|Levitation
|
|Spellpower/5 + 10
|
|-
|Holy Shield
|Spellpower/15 + 15
|Spellpower/3 + 10
|
|-
|Divine Wisdom
|MAG: Spellpower/40 + 6
LER: Spellpower/40 + 6
LIT: Spellpower/40 + 3
|Spellpower/4 + 10
|
|-
|Broomification
|
|Spellpower + 30
|
|}
The cells with empty Power entries do not scale.
== Spellcasting/Debuff Spells ==
{| class="wikitable"
|+
!Type
!Power
!Duration
!Notes
|-
|Miasma
|
|Spellpower/100 + 5
|
|-
|Gravity
|
|Spellpower/20 + 10
|
|-
|Silence
|
|Spellpower/80 + 5
|
|-
|Weakness
|
|Spellpower/50 + 10
|
|-
|Bane
|Spellpower/30 + 50
|Spellpower/50 + 10
|The power in this case is the luck it reduces
|-
|Excommunicate
|
|Spellpower/50 + 20
|
|-
|Elemental Scar
|Spellpower/100 + 5
|Spellpower/40 + 8
|The power in this case is the resistance it reduces for all three types
|}
==Spellcasting/Summoning Spells==
==Spellcasting/Summoning Spells==
<syntaxhighlight lang="c#" line="1">
<syntaxhighlight lang="c#" line="1">
Line 414: Line 801:
!Notes
!Notes
|-
|-
|Summon Bits
|Summon Funnels
|20 + rnd (20) + Spellpower / 20
|20 + rnd (10) + Spellpower / 20
|Spellpower / 15
|Spellpower / 15
|
|
Line 421: Line 808:
|Summon Animal
|Summon Animal
|Until it dies
|Until it dies
|Summoner LV * (100 + Spellpower / 10) / 100 + Spellpower / 30
|Spell Level  * (100 + Spellpower / 10) / 100 + Spellpower / 30
|
|
|-
|-
|Summon Undead Younger Sisters
|Summon Undead Younger Sisters
|Until it dies
|Until it dies
|Summoner LV * (100 + Spellpower / 10) / 100 + Spellpower / 30
|Spell Level * (100 + Spellpower / 10) / 100 + Spellpower / 30
|
|
|-
|-
Line 434: Line 821:
|Use Suicide Explostion attack
|Use Suicide Explostion attack
|}
|}
Note that summons other than Bits has infinite duration
Note that summons other than Funnels has infinite duration
[[Category:EN]]
[[Category:EN]]
[[Category:Elin Spoiler]]
[[Category:Elin Spoiler]]