Elin:Code Analysis/Feats: Difference between revisions

(→‎Depiction of Feats in code: an Index: featElea is only influencing on ether resistance.)
Line 531: Line 531:
** If equipment is doomed, further times 2.
** If equipment is doomed, further times 2.


=== featSnail (Snaily) ===
<syntaxhighlight lang="c#" line="1">
    if (idAct == "janitor" && EClass.rnd(5) == 0)
{
DoSomethingToCharaInRadius(4, null, delegate(Chara c)
{
if (c.HasElement(1211) && !(EClass._zone is Zone_Casino))
{
owner.Talk("snail");
Thing t4 = ThingGen.Create("1142");
ActThrow.Throw(owner, c.pos, t4);
}
});
yield return Restart();
}
</syntaxhighlight>
* Oh you poor snail...Hope you are doing ok, but this piece of code will ruin your day...
* If a janitor sees a snail within 4 blocks, and they are not in the casino:
** The janitor will generate a pot of salt water and throw it to the snail's position.
*** The id of salt water is hard coded though, and if the id change...
<syntaxhighlight lang="c#" line="1">
case EffectId.SaltWater:
if (TC.HasElement(1211))
{
TC.Say("drinkSaltWater_snail", TC);
int dmg = ((TC.hp > 10) ? (TC.hp - EClass.rnd(10)) : 10000);
TC.DamageHP(dmg, AttackSource.None, CC);
}
else if (TC.IsPC)
{
TC.Say("drinkSaltWater", TC);
}
break;
</syntaxhighlight>
* If a poor snail accidentally drank salt water, it will receive very, very high damage.
** If the snail's HP is higher than 10, it's HP will be reduced to at most 10.
** If the snail's HP is lower or equal to 10, then it will receive 10000 damage.
*** But if you are in autocombat, because the damage is not a source of Finish, it will at most leave you to 0 HP.
[[Category:EN]]
[[Category:EN]]
[[Category:Elin Spoiler]]
[[Category:Elin Spoiler]]
443

edits