836 bytes added
, 11:32, 17 September 2014
{{code}}
IsSadism is a char.dat tag that designates the character as a sadist. A sadist character equipped with a sadist weapon (belt, whip, [[banana]], banana peel, broken bottle, [[nut]], bodypart) will randomly attack allied [[masochist]]ic characters.
<pre>
truth character::CheckSadism()
{
if(!IsSadist() || !HasSadistAttackMode() || !IsSmall()) // gum
return false;
if(!RAND_N(10))
{
for(int d = 0; d < 8; ++d)
{
square* Square = GetNeighbourSquare(d);
if(Square)
{
character* Char = Square->GetCharacter();
if(Char && Char->IsMasochist() && GetRelation(Char) == FRIEND
&& Char->GetHP() * 3 >= Char->GetMaxHP() * 2
&& Hit(Char, Square->GetPos(), d, SADIST_HIT))
{
TerminateGoingTo();
return true;
}
}
}
}
return false;
}
</pre>
[[category:Game Mechanics]]