Elin:Code Analysis/Combat: Difference between revisions

Line 467: Line 467:
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.IsPCFactionOrMinion && !base.source.aliasParent.IsEmpty())
         if (!c.IsPC)
         {
         {
             num = Mathf.Max(num, c.Evalue(base.source.aliasParent) * 4 + 30);
             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)
{
{
160

edits