The Cathedral of Attnam

Changes

Jump to navigation Jump to search
599 bytes added ,  02:08, 1 September 2014
m
no edit summary
Enemies that are kicked can both be damaged by it and be thrown backward a single tile. A kick's hit value is calculated in the same way as a normal hit, using the same takeHit(...) function as in normal combat.<br>
In order to be launched by a kick, the enemy must fail a balance check. Firstly, the enemy must be able to move and cannot be flying. Secondly, a check is made against the KickDamage found above versus the remainder found after dividing the enemy's size by a randomly generated number.<br>
 
If this check is failed, the enemy will be thrown back a single tile. However, if a wall is in the way the enemy will crash into it with its head and take damage. If another entity is in the way of the kicked enemy, it will either swap places with it (due to the monster charging forward to occupy the tile next to the player) or fail to be moved at all.
<pre>truth character::CheckBalance(double KickDamage)
&& KickDamage * 5 < RAND() % GetSize());
}</pre>
 
The damage done by being kicked into a wall is equivalent to the remainder of (1 + a random number) / 5 and is applied directly to the head.
<pre>if(NoRoom)
{
if(HasHead())
{
if(IsPlayer())
ADD_MESSAGE("You hit your head on the wall.");
else if(CanBeSeenByPlayer())
ADD_MESSAGE("%s hits %s head on the wall.", CHAR_NAME(DEFINITE), GetPossessivePronoun().CStr());
}
 
ReceiveDamage(GuiltyGuy, 1 + RAND() % 5, PHYSICAL_DAMAGE, HEAD);
CheckDeath(CONST_S("killed by hitting a wall due to being kicked @bk"), GuiltyGuy);
}</pre>
[[Category:Game Mechanics]]
Moderator
952

edits

Navigation menu