The Cathedral of Attnam

Changes

Jump to navigation Jump to search
1,558 bytes added ,  02:08, 1 September 2014
m
no edit summary
{{code}}
{{spoiler}}
//work in progress<br>
Kicking with (k) allows the player to apply the full force of his legs upon an adjacent tile and anything that happens to be occupying it at the time.
}</pre>
== Enemies ==
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)
{
return !CanMove()
|| IsStuck()
|| !KickDamage
|| (!IsFlying()
&& 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());
}
== Enemies == ReceiveDamage(GuiltyGuy, 1 + RAND() % 5, PHYSICAL_DAMAGE, HEAD);Enemies that are kicked can both be damaged CheckDeath(CONST_S("killed by it and be thrown backward hitting a few tiles.wall due to being kicked @bk"), GuiltyGuy); }</pre>[[Category:Game Mechanics]]
Moderator
952

edits

Navigation menu