Elin:Code Analysis/Combat: Difference between revisions

m
m (→‎Weapon Hit Mechanics: Changed erroneous = to +)
 
(24 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Spoiler}}
{{Spoiler}}
 
{{Version|23.46}}
== Evalue List ==
== Evalue List ==
{| class="wikitable"
{| class="wikitable"
Line 212: Line 212:
| TO HIT = TO HIT + 25 + sqrt([attacker's two handed skill] * 2)
| TO HIT = TO HIT + 25 + sqrt([attacker's two handed skill] * 2)
|-
|-
| Attack is Dual Wield
| Attack is Dual Wield ^
| TO HIT = TO HIT * 100 / (115 * 15 * (2000 / (20 + [attacker's DualWield skill])[Clamped to 0-100])
| TO HIT(DW) = TO HIT * 100 / (115 + Slot# * 15 + Slot# * (2000/(20+ attacker's dual wield skill)) [Clamped to 1-100]
|-
|-
| Attacker is Blind
| Attacker is Blind
Line 227: Line 227:
| EVASION + 20%
| 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
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
Line 336: Line 338:
Penetration is calculated at '''(Martial Arts/10)+5''', with a minimum of '''5%''' and a maximum of '''20% + Penetration.'''
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 371: 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 443: 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 '''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 '''Casting''' skill instead of Tactics or Marksman skill


Damage Bonus is '''Player Character Damage Bonus''' + '''Weapon Mod Tool Damage Bonus''' + '''Weapon Damage Bonus'''
If the weapon is: '''Cane''' or it has the '''Force Weapon''' enchantment it uses Magic Device skill instead of Longsword / Shortsword / Axes / etc...


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 Bonus is: '''Player Character Damage Bonus''' + '''Weapon Mod Tool Damage Bonus''' + '''Weapon Damage Bonus'''
 
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 addtional + 50
If it's '''Cane''' accuracy additional + 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'''
Penetration is: '''Character Penetration''' + '''Weapon Penetration'''
==Spellcasting/Spellpower==
==Spellcasting/Spellpower==
<syntaxhighlight lang="c#">
This is line 44 of Ability.cs
public override int GetPower(Card c)
 
{
 
    int num = base.Value * 8 + 50;
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">
    if (!c.IsPC)
    public override int GetPower(Card c)
     {
     {
         num = Mathf.Max(num, c.LV * 6 + 30);
         int num = base.Value * 8 + 50;
    }
        if (!c.IsPC)
    num = EClass.curve(num, 400, 100, 75);
        {
    if (this is Spell)
            num = Mathf.Max(num, c.LV * 6 + 30);
    {
            if (c.IsPCFactionOrMinion && !base.source.aliasParent.IsEmpty())
        num = num * (100 + c.Evalue(411)) / 100;
            {
                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;
     }
     }
    return num;
</syntaxhighlight>Here we have the curve function:<syntaxhighlight lang="c#" line="1">
}
</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 498: 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 the larger one between '''Spell Level''' x 8 + 50 or '''Char Level''' x 6 + 30 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 function:''' '''<code>curve(a, start, step, rate)</code>'''  
About '''curve function:''' '''<code>curve(a, start, step, rate)</code>'''  
Line 507: Line 518:


== Spellcasting/Damaging Spells ==
== 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 562: Line 576:
|-
|-
|Earthquake
|Earthquake
|5+Spellpower/30
|1+Spellpower/30
|10+Attribute/3
|2+Attribute/3
|
|
|Always Imapct element
|Always Imapct element
Line 635: Line 649:
|
|
|}
|}
== 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 663: Line 801:
!Notes
!Notes
|-
|-
|Summon Bits
|Summon Funnels
|20 + rnd (20) + Spellpower / 20
|20 + rnd (10) + Spellpower / 20
|Spellpower / 15
|Spellpower / 15
|
|
Line 683: 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]]