Jump to content

Elin:Code Analysis/Unclassified: Difference between revisions

Line 125: Line 125:
** Which is pretty good, yes, you get 2 wishes out of 1 rod, but can you cast it, hum?
** Which is pretty good, yes, you get 2 wishes out of 1 rod, but can you cast it, hum?
* After that, if you are not PC, your mana will be drained by 50 per charge of rod. Then the rod goes to 0 charges.
* After that, if you are not PC, your mana will be drained by 50 per charge of rod. Then the rod goes to 0 charges.
=== Poison Hand ===
<syntaxhighlight lang="c#" line="1">
    case 1565:
ModBase(955, a * 20, hide: false);
break;
</syntaxhighlight>
* Each level of poison hand raise your poison resistance by 20 (there is only 1 level).
<syntaxhighlight lang="c#" line="1">
    if (conWeapon == null && weapon == null && (CC.MainElement != Element.Void || CC.HasElement(1565)))
{
num5 = (CC.HasElement(1565) ? 915 : CC.MainElement.id);
num6 = CC.Power / 3 + EClass.rnd(CC.Power / 2);
if (CC.MainElement != Element.Void)
{
num6 += CC.MainElement.Value;
}
showEffect = false;
num7 = 50;
}
</syntaxhighlight>
* When you attack with no weapon, all your attack will be transformed into element Poison (915).
* We see in the code a -50% penalty will be applied to your damage as well but this '''need confirmation'''.
<syntaxhighlight lang="c#" line="1">
    public Thing TryPoisonPotion(Thing t)
{
if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
{
string text = EClass.sources.things.rows.Where((SourceThing.Row a) => a._origin == "potion" && a.tag.Contains("neg") && a.chance > 100).ToList().RandomItemWeighted((SourceThing.Row a) => a.chance)
.id;
Say("poisonDrip", this);
int num = t.Num;
t.Destroy();
t = ThingGen.Create(text).SetNum(num);
}
return t;
}
</syntaxhighlight>
* This is the code use to make all your potions in your bag poison.
* A random chance of 50% is applied first, so there is 50% chance your potion will be spared.
* It also looks like it will transform a whole stack of your potions at once.
===
[[Category:EN]]
[[Category:EN]]
[[Category:Elin Spoiler]]
[[Category:Elin Spoiler]]
399

edits