[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>Inherits</h2>
This class inherits the following classes <a href="std.living.corpse.c.shtml">/std/living/corpse.c</a> and /std/weapon_logic.c<h2>Includes</h2>
This class includes the following files /include/player.h, /include/tasks.h, /include/playtesters.h, /include/weapon.h, /include/living.h, /include/skills.h, /include/attack_messages.h, /include/command.h, /include/combat.h and /include/group_handler.h<h2>Method index</h2>
<ul>
<li><a href="#accepted_surrender">accepted_surrender</a>(object)<br/>
This method is called if surrender was accepted for the particular
person.
<li><a href="#add_defender">add_defender</a>(object)<br/>
This method will add a defender to the current list of defenders
for this living object.
<li><a href="#add_protector">add_protector</a>(object)<br/>
This method will add a protector to the current list of protectors
for this living object.
<li><a href="#adjust_action_defecit">adjust_action_defecit</a>(int)<li><a href="#adjust_actions">adjust_actions</a>(class attack)<br/>
Adjust the time left, combat actions and gp used by this attack.
<li><a href="#after_attack">after_attack</a>(class attack)<br/>
This function is called after it's all over and done (just before the
costs are charged).
<li><a href="#attack_by">attack_by</a>(object)<br/>
This method is called when the living object is attacked by some opponent.
<li><a href="#attack_ob">attack_ob</a>(object)<br/>
This method is called to make us attack someone else.
<li><a href="#calc_armour_protection">calc_armour_protection</a>(class attack)<br/>
Calculate how much of the damage is saved by the armour.
<li><a href="#calc_attack_modifier">calc_attack_modifier</a>(class attack)<br/>
This method calculates the modifier to the attack.
<li><a href="#calc_damage">calc_damage</a>(class attack)<br/>
After a successful attack (or possibly a parried one) calculate the
amount of damage done to the opponent.
<li><a href="#calc_defense_modifier">calc_defense_modifier</a>(class attack)<br/>
This method calculates the modifier to the defense.
<li><a href="#call_special">call_special</a>(int, class attack)<br/>
Go through the list of the attacker & opponents specials and
call any that have registered for this stage.
<li><a href="#choose_attack">choose_attack</a>(class attack)<br/>
Determine which attack they'll use.
<li><a href="#choose_defender">choose_defender</a>(class attack)<br/>
This method is used to choose who will defend this attack.
<li><a href="#choose_defense">choose_defense</a>(class attack)<br/>
Will the defender defend or not?
<li><a href="#choose_opponent">choose_opponent</a>(class attack)<br/>
Choose an opponent and attack them.
<li><a href="#damage_weapon">damage_weapon</a>(class attack)<br/>
Do damage to the attacking & defending weapons.
<li><a href="#do_attack">do_attack</a>()<br/>
This performs the actual attack itself.
<li><a href="#do_surrender">do_surrender</a>(object)<br/>
This method will be called when we surrender.
<li><a href="#dont_attack_me">dont_attack_me</a>()<li><a href="#end_combat">end_combat</a>()<br/>
This method is called when combat ends.
<li><a href="#event_surrender">event_surrender</a>(object, object *)<br/>
This method tells us what the npc shouuld do in the case that it
might possibly surrender.
<li><a href="#fight_in_progress">fight_in_progress</a>(object)<br/>
This method is called when there is a fight in progress.
<li><a href="#is_fighting">is_fighting</a>(object, int)<br/>
This method determines whether or not the object is fighting another
object.
<li><a href="#monitor_points">monitor_points</a>()<br/>
Display the hitpoint monitor.
<li><a href="#offered_surrender">offered_surrender</a>(object)<br/>
This method is called when someone offers to surrender to the living
object.
<li><a href="#opponent_died">opponent_died</a>(object, object)<br/>
This is called by /std/living/corpse to notify us that the opponent
died.
<li><a href="#perform_movement">perform_movement</a>(class attack)<br/>
This function is called as part of the post attack processing and performs
the checks to see if someone can move closer or further away from their
opponent.
<li><a href="#prepare_messages">prepare_messages</a>(class attack)<br/>
Prepare the result messages.
<li><a href="#query_action_defecit">query_action_defecit</a>()<li><a href="#query_arcane_shields">query_arcane_shields</a>()<li><a href="#query_attackable">query_attackable</a>()<br/>
Is this object attackable or not?
<li><a href="#query_attacker_list">query_attacker_list</a>()<br/>
This method returns the current list of people in the attacker list
on the object.
<li><a href="#query_can_attack">query_can_attack</a>()<br/>
Decide if we will attack this round or not.
<li><a href="#query_can_defend">query_can_defend</a>()<br/>
Decide if we are able to defend ourselves this time or not.
<li><a href="#query_combat">query_combat</a>()<li><a href="#query_combat_attack">query_combat_attack</a>()<li><a href="#query_combat_attitude">query_combat_attitude</a>()<li><a href="#query_combat_distance">query_combat_distance</a>()<li><a href="#query_combat_focus">query_combat_focus</a>()<li><a href="#query_combat_mercy">query_combat_mercy</a>()<li><a href="#query_combat_parry">query_combat_parry</a>()<li><a href="#query_combat_response">query_combat_response</a>()<li><a href="#query_concentrating">query_concentrating</a>()<li><a href="#query_defend">query_defend</a>()<br/>
Is this object prepared to try to defend someone else at this time?
<li><a href="#query_defenders">query_defenders</a>()<br/>
This method returns the current array of defenders on the living
object.
<li><a href="#query_distance">query_distance</a>(object)<br/>
Query the distance from this object to the given opponent.
<li><a href="#query_fighting">query_fighting</a>()<br/>
Is the player currently fighting anyone.
<li><a href="#query_last_action">query_last_action</a>()<br/>
This method returns the last (combat) action performed.
<li><a href="#query_last_opponent">query_last_opponent</a>()<br/>
This method returns the last known opponent we attacked or defended
against.
<li><a href="#query_last_result">query_last_result</a>()<br/>
This method returns the result of the last combat round.
<li><a href="#query_last_weapon">query_last_weapon</a>()<br/>
This method returns the last weapon we used for an attack or defense.
<li><a href="#query_monitor_string">query_monitor_string</a>()<br/>
Returns the raw monitor string.
<li><a href="#query_protect">query_protect</a>()<br/>
Is this object prepared to try to protect someone else at this time?
<li><a href="#query_protectors">query_protectors</a>()<br/>
This method returns the current array of protectors on the living
object.
<li><a href="#query_specials">query_specials</a>()<br/>
List the specials currently registered for this npc/player.
<li><a href="#query_surrender">query_surrender</a>()<li><a href="#query_surrenderers">query_surrenderers</a>()<br/>
This method returns the current list of people surrendering to us.
<li><a href="#query_tactics">query_tactics</a>()<br/>
This method returns the current tactics set using the tactics class.
<li><a href="#query_unarmed_parry">query_unarmed_parry</a>()<li><a href="#recalc_hunting_list">recalc_hunting_list</a>()<li><a href="#refused_surrender">refused_surrender</a>(object)<br/>
This method is called if surrender was refused for the particular
person.
<li><a href="#register_special">register_special</a>(int, int, mixed, mixed)<br/>
Register a combat special.
<li><a href="#remove_attacker_list">remove_attacker_list</a>(object)<br/>
This method removes someone from an attacker/hunting list.
<li><a href="#remove_defender">remove_defender</a>(object)<br/>
This method will remove a defender to the current list of defenders
for this living object.
<li><a href="#remove_noncont_specials">remove_noncont_specials</a>()<br/>
This method removes all non-continuous specials.
<li><a href="#remove_protector">remove_protector</a>(object)<br/>
This method will remove a protector to the current list of protectors
for this living object.
<li><a href="#remove_special">remove_special</a>(int)<br/>
Remove a combat special.
<li><a href="#remove_surrenderer">remove_surrenderer</a>(object)<br/>
This method removes a person surrendering from our current list.
<li><a href="#reset_defenders">reset_defenders</a>()<br/>
This method resets the defender array back to being nothing.
<li><a href="#reset_protectors">reset_protectors</a>()<br/>
This method resets the protector array back to being nothing.
<li><a href="#set_combat_attack">set_combat_attack</a>(string)<li><a href="#set_combat_attitude">set_combat_attitude</a>(string)<li><a href="#set_combat_distance">set_combat_distance</a>(string)<li><a href="#set_combat_focus">set_combat_focus</a>(string)<li><a href="#set_combat_mercy">set_combat_mercy</a>(string)<li><a href="#set_combat_parry">set_combat_parry</a>(string)<li><a href="#set_combat_response">set_combat_response</a>(string)<li><a href="#set_concentrating">set_concentrating</a>(object)<li><a href="#set_distance">set_distance</a>(object, int)<br/>
Set the distance from this object to the given opponent.
<li><a href="#set_monitor_string">set_monitor_string</a>(string)<br/>
Sets the monitor string.
<li><a href="#set_special_data">set_special_data</a>(int, mixed)<br/>
Update the user data for a specific special.
<li><a href="#set_specials">set_specials</a>(class combat_special *)<br/>
Directly set the special list.
<li><a href="#set_tactics">set_tactics</a>(class tactics)<br/>
This sets the current attitude to use in combat.
<li><a href="#set_unarmed_parry">set_unarmed_parry</a>(int)<li><a href="#start_combat">start_combat</a>(object)<br/>
This method is called when combat starts.
<li><a href="#stop_all_fight">stop_all_fight</a>()<li><a href="#stop_fight">stop_fight</a>(object)<li><a href="#stop_hunting">stop_hunting</a>(object)<li><a href="#stopped_fighting">stopped_fighting</a>(object)<br/>
This method is called when the fight has stopped.
<li><a href="#write_messages">write_messages</a>(class attack)<br/>
Write out the attack/defense messages.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="accepted_surrender">
accepted_surrender</a><pre class="autodocfuncdef">
void accepted_surrender(object attacker)
</pre><dd><br />
This method is called if surrender was accepted for the particular
person.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
attacker - the person who is surrendering<br />
<br />
<dd><b>See also:</b>
<br /><a href="#refused_surrender">refused_surrender()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="add_defender">
add_defender</a><pre class="autodocfuncdef">
int add_defender(object thing)
</pre><dd><br />
This method will add a defender to the current list of defenders
for this living object.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
thing - the defender to add<br />
<br />
<dd><b>See also:</b>
<br /><a href="#remove_defender">remove_defender()</a> and <a href="#query_defenders">query_defenders()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="add_protector">
add_protector</a><pre class="autodocfuncdef">
int add_protector(object thing)
</pre><dd><br />
This method will add a protector to the current list of protectors
for this living object.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
thing - the protector to add<br />
<br />
<dd><b>See also:</b>
<br /><a href="#remove_protector">remove_protector()</a> and <a href="#query_protectors">query_protectors()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="adjust_action_defecit">
adjust_action_defecit</a><pre class="autodocfuncdef">
void adjust_action_defecit(int amount)
</pre>
<dt class="autodocfuncname"><a name="after_attack">
after_attack</a><pre class="autodocfuncdef">
class attack after_attack(class attack att)
</pre><dd><br />
This function is called after it's all over and done (just before the
costs are charged). It can be used to do any special outcomes that
we may decide on.
Note that if you override this function in a special be absolutely certain
you know what you're doing if you return R_ABORT or R_DONE. Use of either
of these two could cause really nasty side-effects.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
class - attack<br />
<br />
<dd><b>Returns:</b>
<br />class attack
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="attack_by">
attack_by</a><pre class="autodocfuncdef">
int attack_by(object opponent)
</pre><dd><br />
This method is called when the living object is attacked by some opponent.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
opponent - the opponent we are attacked by<br />
<br />
<dd><b>Returns:</b>
<br />0 if we cannot attack them, 1 if we can<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_attacker_list">query_attacker_list()</a> and <a href="#attack_ob">attack_ob()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="attack_ob">
attack_ob</a><pre class="autodocfuncdef">
int attack_ob(object opponent)
</pre><dd><br />
This method is called to make us attack someone else.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
opponent - the person to attack<br />
<br />
<dd><b>Returns:</b>
<br />0 if we cannot attack them, 1 if we can<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_attacker_list">query_attacker_list()</a> and <a href="#attack_by">attack_by()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="calc_armour_protection">
calc_armour_protection</a><pre class="autodocfuncdef">
class attack calc_armour_protection(class attack att)
</pre><dd><br />
Calculate how much of the damage is saved by the armour.

PRE: all information has been filled in except the amount of damage
stopped by armour, and which piece of armour did the stopping.<br>
POST: The damage stopped and which armour did it is filled in.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
class - attack<br />
<br />
<dd><b>Returns:</b>
<br />class attack
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="calc_attack_modifier">
calc_attack_modifier</a><pre class="autodocfuncdef">
class attack calc_attack_modifier(class attack att)
</pre><dd><br />
This method calculates the modifier to the attack.

It will take into account all the basic stuff that makes the attack
harder or easier.

PRE: All attack and response data has been filled in.<br>
POST: The offensive modifier must be set.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
class - attack<br />
<br />
<dd><b>Returns:</b>
<br />class attack
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="calc_damage">
calc_damage</a><pre class="autodocfuncdef">
class attack calc_damage(class attack att)
</pre><dd><br />
After a successful attack (or possibly a parried one) calculate the
amount of damage done to the opponent.

This method must fill in the amount of damage to be done and may adjust
the time taken too.

PRE: the outcome of an attack must have been determined.<br>
POST: damage must be filled in.
<br />

<dt class="autodocfuncname"><a name="calc_defense_modifier">
calc_defense_modifier</a><pre class="autodocfuncdef">
class attack calc_defense_modifier(class attack att)
</pre><dd><br />
This method calculates the modifier to the defense.

It will take into account all the basic stuff that makes the defense
harder or easier.

PRE: All attack and response data has been filled in.<br>
POST: The defensive modifier must be set.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
class - attack<br />
<br />
<dd><b>Returns:</b>
<br />class attack
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="choose_defender">
choose_defender</a><pre class="autodocfuncdef">
class attack choose_defender(class attack att)
</pre><dd><br />
This method is used to choose who will defend this attack. Typically this
will be the person who was attacked, however it could be someone else in
some circumstances.

PRE: attacker, attack and defender information has been set.<br>
POST: defender and person_hit must be set.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
class - attack<br />
<br />
<dd><b>Returns:</b>
<br />class attack
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="choose_defense">
choose_defense</a><pre class="autodocfuncdef">
class attack choose_defense(class attack att)
</pre><dd><br />
Will the defender defend or not? If so, with what skill and weapon and at
what action cost?

PRE: all attack data and opponent and defender data have been set.<br>
POST: defense type, skill and weapon must be set. If defense_action
is "none" the defender will have a big negative modifier.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
class - attack<br />
<br />
<dd><b>Returns:</b>
<br />class attack
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="do_attack">
do_attack</a><pre class="autodocfuncdef">
void do_attack()
</pre><dd><br />
This performs the actual attack itself.
All attack data, everything we know about the attacker and the defender
is stored in the attack class which is passed into and back by every
function at every step of the attack.
<br />

<dt class="autodocfuncname"><a name="do_surrender">
do_surrender</a><pre class="autodocfuncdef">
object do_surrender(object thing)
</pre><dd><br />
This method will be called when we surrender.  This does mean that
the opponent must have accepted our surrender plea.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
thing - the thing which made us surrender
<br />
<br />
<dd><b>Returns:</b>
<br />always returns 0<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="dont_attack_me">
dont_attack_me</a><pre class="autodocfuncdef">
int dont_attack_me()
</pre>
<dt class="autodocfuncname"><a name="end_combat">
end_combat</a><pre class="autodocfuncdef">
void end_combat()
</pre><dd><br />
This method is called when combat ends.  You can overload this function
to make your NPC do things at the end of combat.
You do not need to call ::end_combat() since this is just a stub function.
<br />

<dt class="autodocfuncname"><a name="event_surrender">
event_surrender</a><pre class="autodocfuncdef">
void event_surrender(object victim,
                     object * attackers)
</pre><dd><br />
This method tells us what the npc shouuld do in the case that it
might possibly surrender.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
victim - the person surrendering<br />
attacker - the person beating up the surrenderer
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="fight_in_progress">
fight_in_progress</a><pre class="autodocfuncdef">
void fight_in_progress(object thing)
</pre><dd><br />
This method is called when there is a fight in progress.  It will
propogate the event onto all the objects in the room.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
thing - the person fighting
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="is_fighting">
is_fighting</a><pre class="autodocfuncdef">
varargs int is_fighting(object ob,
                        int actively)
</pre><dd><br />
This method determines whether or not the object is fighting another
object.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
ob - the object being tested<br />
actively - is the opponent being actively fought at this time?<br />
<br />
<dd><b>Returns:</b>
<br />1 if it is in combat, 0 if it is not.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="monitor_points">
monitor_points</a><pre class="autodocfuncdef">
void monitor_points()
</pre><dd><br />
Display the hitpoint monitor.
<br />

<dt class="autodocfuncname"><a name="offered_surrender">
offered_surrender</a><pre class="autodocfuncdef">
void offered_surrender(object victim)
</pre><dd><br />
This method is called when someone offers to surrender to the living
object.  It will check the current tactics for surrender and then
handle the response appropriately.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
victim - the person surrendering
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="opponent_died">
opponent_died</a><pre class="autodocfuncdef">
void opponent_died(object opponent,
                   object corpse)
</pre><dd><br />
This is called by /std/living/corpse to notify us that the opponent
died.
<br />

<dt class="autodocfuncname"><a name="query_action_defecit">
query_action_defecit</a><pre class="autodocfuncdef">
int query_action_defecit()
</pre>
<dt class="autodocfuncname"><a name="query_arcane_shields">
query_arcane_shields</a><pre class="autodocfuncdef">
string * query_arcane_shields()
</pre>
<dt class="autodocfuncname"><a name="query_attackable">
query_attackable</a><pre class="autodocfuncdef">
int query_attackable()
</pre><dd><br />
Is this object attackable or not?
<br />
<br /><dl>
<dd><b>Returns:</b>
<br />1 or 0 for true or false.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_attacker_list">
query_attacker_list</a><pre class="autodocfuncdef">
object * query_attacker_list()
</pre><dd><br />
This method returns the current list of people in the attacker list
on the object.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the current attacker array
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_can_attack">
query_can_attack</a><pre class="autodocfuncdef">
int query_can_attack()
</pre><dd><br />
Decide if we will attack this round or not.  This function can be
overloaded if necessary. It also checks for the property "cannot attack"
on this object. If the property is set the object cannot attack.
<br />
<br /><dl>
<dd><b>Returns:</b>
<br />1 if we want to, 0 if we don't.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_can_defend">
query_can_defend</a><pre class="autodocfuncdef">
int query_can_defend()
</pre><dd><br />
Decide if we are able to defend ourselves this time or not.
This function can be overloaded if necessary. It also checks for the
property "cannot defend"
on this object. If the property is set the object cannot defend.
<br />
<br /><dl>
<dd><b>Returns:</b>
<br />1 if we want to, 0 if we don't.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_combat">
query_combat</a><pre class="autodocfuncdef">
class combat_information query_combat()
</pre>
<dt class="autodocfuncname"><a name="query_combat_attack">
query_combat_attack</a><pre class="autodocfuncdef">
string query_combat_attack()
</pre>
<dt class="autodocfuncname"><a name="query_combat_attitude">
query_combat_attitude</a><pre class="autodocfuncdef">
string query_combat_attitude()
</pre>
<dt class="autodocfuncname"><a name="query_combat_distance">
query_combat_distance</a><pre class="autodocfuncdef">
string query_combat_distance()
</pre>
<dt class="autodocfuncname"><a name="query_combat_focus">
query_combat_focus</a><pre class="autodocfuncdef">
string query_combat_focus()
</pre>
<dt class="autodocfuncname"><a name="query_combat_mercy">
query_combat_mercy</a><pre class="autodocfuncdef">
string query_combat_mercy()
</pre>
<dt class="autodocfuncname"><a name="query_combat_parry">
query_combat_parry</a><pre class="autodocfuncdef">
string query_combat_parry()
</pre>
<dt class="autodocfuncname"><a name="query_combat_response">
query_combat_response</a><pre class="autodocfuncdef">
string query_combat_response()
</pre>
<dt class="autodocfuncname"><a name="query_concentrating">
query_concentrating</a><pre class="autodocfuncdef">
object query_concentrating()
</pre>
<dt class="autodocfuncname"><a name="query_defend">
query_defend</a><pre class="autodocfuncdef">
int query_defend()
</pre><dd><br />
Is this object prepared to try to defend someone else at this time?
<br />
<br /><dl>
<dd><b>Returns:</b>
<br />1 or 0 for true or false.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_defenders">
query_defenders</a><pre class="autodocfuncdef">
object * query_defenders()
</pre><dd><br />
This method returns the current array of defenders on the living
object.  This is the people who are protecting us, so if we are hit
make them attack the hitter.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the current defenders array<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_protector">add_protector()</a> and <a href="#remove_protector">remove_protector()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_distance">
query_distance</a><pre class="autodocfuncdef">
int query_distance(object opponent)
</pre><dd><br />
Query the distance from this object to the given opponent.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
opponent - the object to check
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_fighting">
query_fighting</a><pre class="autodocfuncdef">
int query_fighting()
</pre><dd><br />
Is the player currently fighting anyone.
<br />
<br /><dl>
<dd><b>Returns:</b>
<br />1 for yes, 0 for no.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_last_action">
query_last_action</a><pre class="autodocfuncdef">
string query_last_action()
</pre><dd><br />
This method returns the last (combat) action performed.
<br />
<br /><dl>
<dd><b>Returns:</b>
<br />string the action.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_last_opponent">
query_last_opponent</a><pre class="autodocfuncdef">
object query_last_opponent()
</pre><dd><br />
This method returns the last known opponent we attacked or defended
against.  It is kept as up to date as the system can manage and so will
include anyone who is currently attacking us or who we are currently
attacking.
<br />
<br /><dl>
<dd><b>Returns:</b>
<br />object the opponent.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_last_result">
query_last_result</a><pre class="autodocfuncdef">
int query_last_result()
</pre><dd><br />
This method returns the result of the last combat round.
<br />
<br /><dl>
<dd><b>Returns:</b>
<br />int the result.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_last_weapon">
query_last_weapon</a><pre class="autodocfuncdef">
object query_last_weapon()
</pre><dd><br />
This method returns the last weapon we used for an attack or defense.
<br />
<br /><dl>
<dd><b>Returns:</b>
<br />object the weapon.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_monitor_string">
query_monitor_string</a><pre class="autodocfuncdef">
string query_monitor_string()
</pre><dd><br />
Returns the raw monitor string.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />The monitor string, 0 for the default monitor
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_protect">
query_protect</a><pre class="autodocfuncdef">
int query_protect()
</pre><dd><br />
Is this object prepared to try to protect someone else at this time?<br />
<br /><dl>
<dd><b>Returns:</b>
<br />1 or 0 for true or false.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_protectors">
query_protectors</a><pre class="autodocfuncdef">
object * query_protectors()
</pre><dd><br />
This method returns the current array of protectors on the living
object.  This is the people who are protecting us, so if we are hit
make them attack the hitter.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the current protectors array<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_protector">add_protector()</a> and <a href="#remove_protector">remove_protector()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_specials">
query_specials</a><pre class="autodocfuncdef">
class combat_special * query_specials()
</pre><dd><br />
List the specials currently registered for this npc/player.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />an array of combat_special classes.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_surrender">
query_surrender</a><pre class="autodocfuncdef">
class surrender_information query_surrender()
</pre>
<dt class="autodocfuncname"><a name="query_surrenderers">
query_surrenderers</a><pre class="autodocfuncdef">
object * query_surrenderers()
</pre><dd><br />
This method returns the current list of people surrendering to us.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the list of people surrendering<br /><br />
<dd><b>See also:</b>
<br /><a href="#remove_surrenderer">remove_surrenderer()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_tactics">
query_tactics</a><pre class="autodocfuncdef">
class tactics query_tactics()
</pre><dd><br />
This method returns the current tactics set using the tactics class.<br />
<br /><dl>
<dd><b>See also:</b>
<br /><a href="#set_tactics">set_tactics()</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_unarmed_parry">
query_unarmed_parry</a><pre class="autodocfuncdef">
int query_unarmed_parry()
</pre>
<dt class="autodocfuncname"><a name="recalc_hunting_list">
recalc_hunting_list</a><pre class="autodocfuncdef">
void recalc_hunting_list()
</pre>
<dt class="autodocfuncname"><a name="refused_surrender">
refused_surrender</a><pre class="autodocfuncdef">
void refused_surrender(object attacker)
</pre><dd><br />
This method is called if surrender was refused for the particular
person.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
attacker - the person who is surrendering<br />
<br />
<dd><b>See also:</b>
<br /><a href="#accepted_surrender">accepted_surrender()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="register_special">
register_special</a><pre class="autodocfuncdef">
int register_special(int type,
                     int events,
                     mixed callback,
                     mixed data)
</pre><dd><br />
Register a combat special.

The combat system maintains a list of combat specials. These specials can
be used to override or alter any facet of a combat attack (or defense).
<p>
A special must register what type of special it is:<br>
T_OFFENSIVE - an offensive special<br>
T_DEFENSIVE - a defensive special<br>
T_CONTINUOUS - can be used with one of the above to indicate that the
               special is continuous and not a one-time event.<br>
<p>
It also indicates which stages of combat it wants to be notified of:<br>
E_OPPONENT_SELECTION - selection of an opponent<br>
E_DEFENDER_SELECTION - selection of the defender<br>
E_ATTACK_SELECTION - selecting which attack the attacker will perform<br>
E_DEFENSE_SELECTION - selection of the method of defense<br>
E_ATTACK_MODIFIER - calculating the modifier for attack (how easy/hard it
is)<br>
E_DEFENSE_MODIFIER - doing the same for the defense<br>
E_DAMAGE_CALCULATION - calculating how much damage the attack can do<br>
E_ARMOUR_CALCULATION - calculating how much damage the armour will stop<br>
E_WEAPON_DAMAGE - performing damage to the weapons involved<br>
E_WRITE_MESSAGES - writing out the success/failure messages<br>
E_AFTER_ATTACK - any post-attack cleanup.<br>
<p>
The special provides the combat system with a callback function to be
called and any additional data the special wants tracked by the combat
system.
<p>
Then, when combat reaches one of the stages requested it calls the callback
function. This function is passed the stage we're at, all the data for this
attack and also the extra data the special requested.
<p>
The callback can then modify any aspect of the attack data (it could change
the attack skill, the defensive weapon, the defense modifier, anything at
all) and then return back into combat.
<p>
The return tells the combat system what to do next. The options are:<br>
R_CONTINUE - continue as though the special hadn't done anything.<br>
R_DONE - treat this step as completed.<br>
R_ABORT - abort the attack<br>
R_REMOVE_ME - do one of the above and then remove the special.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
type - Is this an offensive or defensive special.<br />
events - A bitmap of the events this special is interested in.<br />
callback - the function to be called. A mixed array containing
an object and a function string.<br />
data - A mixed variable containing any data you want stored
and passed in (often used to record info about the special)
<br />
<br />
<dd><b>Returns:</b>
<br />the id of the special.
<br /><br />
<dd><b>Example:</b>
<br/><pre>
This example registers a special that causes the player to be unable to
defend themselves for three rounds.

id = player->register_special(T_DEFENSIVE | T_CONTINUOUS,
                              E_DEFENSE_SELECTION | E_DAMAGE_CALCULATION,
                              ({ base_name(this_object()), "callback" }),
                              ({ player, 0}));

mixed *callback(int stage, class attack att, mixed data) {
  // If it's not our player defending we won't do anything.
  if(att->defender != data[1])
    return ({ R_CONTINUE, att, data });

   switch(stage) {
   case E_DEFENSE_SELECTION: // We won't let them defend themselves!
     att->defense_action = "none";
     return ({ R_DONE, att, data });
   case E_DAMAGE_CALCULATION:
     // If they managed to defend themself, turn it into a failure.
     if(att->result == DEFWIN || att->result == DEFAWARD)
       att->result = OFFWIN;

     // By using R_CONTINUE they take 500 hits _plus_ the normal damage.
     att->damage = 500;

     // The R_REMOVE_ME causes our special to disappear once we've hurt
     // them three times.
     if(data[1] > 3)
       return ({ R_CONTINUE | R_REMOVE_ME, att, data });

     data[1]++;
     return ({ R_CONTINUE, att, data });
   }
}
</pre><br /></dl>

<dt class="autodocfuncname"><a name="remove_attacker_list">
remove_attacker_list</a><pre class="autodocfuncdef">
void remove_attacker_list(object ob)
</pre><dd><br />
This method removes someone from an attacker/hunting list.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
ob - the object to be removed.
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="remove_defender">
remove_defender</a><pre class="autodocfuncdef">
int remove_defender(object defender)
</pre><dd><br />
This method will remove a defender to the current list of defenders
for this living object.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
thing - the defender to remove<br />
<br />
<dd><b>Returns:</b>
<br />1 for success, 0 for failure.
<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_defender">add_defender()</a> and <a href="#query_defenders">query_defenders()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="remove_noncont_specials">
remove_noncont_specials</a><pre class="autodocfuncdef">
void remove_noncont_specials()
</pre><dd><br />
This method removes all non-continuous specials. It is called by the
"stop" command.
<br />
<br /><dl>
<dd><b>Returns:</b>
<br />1 for success, 0 for failure
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="remove_protector">
remove_protector</a><pre class="autodocfuncdef">
int remove_protector(object protector)
</pre><dd><br />
This method will remove a protector to the current list of protectors
for this living object.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
thing - the protector to remove<br />
<br />
<dd><b>Returns:</b>
<br />1 for success, 0 for failure.
<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_protector">add_protector()</a> and <a href="#query_protectors">query_protectors()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="remove_special">
remove_special</a><pre class="autodocfuncdef">
int remove_special(int id)
</pre><dd><br />
Remove a combat special.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
id - The id of the special<br />
<br />
<dd><b>Returns:</b>
<br />1 for success, 0 for failure
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="remove_surrenderer">
remove_surrenderer</a><pre class="autodocfuncdef">
void remove_surrenderer(object victim)
</pre><dd><br />
This method removes a person surrendering from our current list.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
victim - the person to remove<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_surrenderers">query_surrenderers()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="reset_defenders">
reset_defenders</a><pre class="autodocfuncdef">
void reset_defenders()
</pre><dd><br />
This method resets the defender array back to being nothing.
<br />

<dt class="autodocfuncname"><a name="reset_protectors">
reset_protectors</a><pre class="autodocfuncdef">
void reset_protectors()
</pre><dd><br />
This method resets the protector array back to being nothing.
<br />

<dt class="autodocfuncname"><a name="set_combat_attack">
set_combat_attack</a><pre class="autodocfuncdef">
void set_combat_attack(string attack)
</pre>
<dt class="autodocfuncname"><a name="set_combat_attitude">
set_combat_attitude</a><pre class="autodocfuncdef">
void set_combat_attitude(string attitude)
</pre>
<dt class="autodocfuncname"><a name="set_combat_distance">
set_combat_distance</a><pre class="autodocfuncdef">
void set_combat_distance(string distance)
</pre>
<dt class="autodocfuncname"><a name="set_combat_focus">
set_combat_focus</a><pre class="autodocfuncdef">
void set_combat_focus(string focus)
</pre>
<dt class="autodocfuncname"><a name="set_combat_mercy">
set_combat_mercy</a><pre class="autodocfuncdef">
void set_combat_mercy(string mercy)
</pre>
<dt class="autodocfuncname"><a name="set_combat_parry">
set_combat_parry</a><pre class="autodocfuncdef">
void set_combat_parry(string parry)
</pre>
<dt class="autodocfuncname"><a name="set_combat_response">
set_combat_response</a><pre class="autodocfuncdef">
void set_combat_response(string response)
</pre>
<dt class="autodocfuncname"><a name="set_concentrating">
set_concentrating</a><pre class="autodocfuncdef">
int set_concentrating(object thing)
</pre>
<dt class="autodocfuncname"><a name="set_distance">
set_distance</a><pre class="autodocfuncdef">
int set_distance(object opponent,
                 int distance)
</pre><dd><br />
Set the distance from this object to the given opponent.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
opponent - the object to set the distance to.<br />
distance - the new distance.
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_monitor_string">
set_monitor_string</a><pre class="autodocfuncdef">
void set_monitor_string(string str)
</pre><dd><br />
Sets the monitor string.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
str - The string to set the monitor string to
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_special_data">
set_special_data</a><pre class="autodocfuncdef">
int set_special_data(int id,
                     mixed data)
</pre><dd><br />
Update the user data for a specific special.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
id - The id of the special<br />
data - The data to be set<br />
<br />
<dd><b>Returns:</b>
<br />True or false for success or failure
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_specials">
set_specials</a><pre class="autodocfuncdef">
void set_specials(class combat_special * specials)
</pre><dd><br />
Directly set the special list. Use with care!<br />
<br /><dl>
<dd><b>Parameters:</b><br />
class - combat_special *
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_tactics">
set_tactics</a><pre class="autodocfuncdef">
void set_tactics(class tactics new_tactics)
</pre><dd><br />
This sets the current attitude to use in combat.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
attitude - the new combat attitude<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_tactics">query_tactics()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="set_unarmed_parry">
set_unarmed_parry</a><pre class="autodocfuncdef">
void set_unarmed_parry(int parry)
</pre>
<dt class="autodocfuncname"><a name="start_combat">
start_combat</a><pre class="autodocfuncdef">
void start_combat(object opponent)
</pre><dd><br />
This method is called when combat starts.  You can overload this function
to make your NPC do things at the start of combat.
You do not need to call ::start_combat() since this is just a stub function.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
opponent - The first opponent to be attacked.
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="stop_all_fight">
stop_all_fight</a><pre class="autodocfuncdef">
void stop_all_fight()
</pre>
<dt class="autodocfuncname"><a name="stop_fight">
stop_fight</a><pre class="autodocfuncdef">
void stop_fight(object opponent)
</pre>
<dt class="autodocfuncname"><a name="stop_hunting">
stop_hunting</a><pre class="autodocfuncdef">
void stop_hunting(object opponent)
</pre>
<dt class="autodocfuncname"><a name="stopped_fighting">
stopped_fighting</a><pre class="autodocfuncdef">
void stopped_fighting(object thing)
</pre><dd><br />
This method is called when the fight has stopped.  It propogates the
stopped fighting event onto all the objects in the room.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
thing - the thing which stopped fighting?
<br />
<br />
<br /></dl>

</dl>
<h2>Protected Functions</h2>
These are functions that only objects inheriting the class can access.<p>
<dl>
<dt class="autodocfuncname"><a name="adjust_actions">
adjust_actions</a><pre class="autodocfuncdef">
void adjust_actions(class attack att)
</pre><dd><br />
Adjust the time left, combat actions and gp used by this attack.
This calls adjust_action_defecit in both the attacker and defender
as appropriate.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
class - attack
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="call_special">
call_special</a><pre class="autodocfuncdef">
mixed * call_special(int stage,
                     class attack att)
</pre><dd><br />
Go through the list of the attacker & opponents specials and
call any that have registered for this stage.
<br />

<dt class="autodocfuncname"><a name="choose_attack">
choose_attack</a><pre class="autodocfuncdef">
class attack choose_attack(class attack att)
</pre><dd><br />
Determine which attack they'll use.

This picks a weapon, gets the attack data and the weapon skill and
determines how much the attack will cost.

PRE: attacker info, opponent and defender info have been set.<br>
POST: attack weapon, attack skill, attack data, and attack_cost must
be set.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
class - attack<br />
<br />
<dd><b>Returns:</b>
<br />class attack
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="choose_opponent">
choose_opponent</a><pre class="autodocfuncdef">
class attack choose_opponent(class attack att)
</pre><dd><br />
Choose an opponent and attack them.

This method must fill in the opponent variable. If no opponent is chosen
the attack will be aborted.

PRE: Attacker information has been filled in.<BR>
POST: opponent must be chosen or the attack will be aborted.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
class - attack<br />
<br />
<dd><b>Returns:</b>
<br />class attack
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="damage_weapon">
damage_weapon</a><pre class="autodocfuncdef">
class attack damage_weapon(class attack att)
</pre><dd><br />
Do damage to the attacking & defending weapons.

PRE: all information has been filled in<br>
POST: the weapons involved have taken appropriate damage.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
class - attack<br />
<br />
<dd><b>Returns:</b>
<br />class attack
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="perform_movement">
perform_movement</a><pre class="autodocfuncdef">
class attack perform_movement(class attack att)
</pre><dd><br />
This function is called as part of the post attack processing and performs
the checks to see if someone can move closer or further away from their
opponent.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
class - attack<br />
<br />
<dd><b>Returns:</b>
<br />class attack<br /><br />
<dd><b>See also:</b>
<br /><a href="#after_attack">after_attack()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="prepare_messages">
prepare_messages</a><pre class="autodocfuncdef">
class attack prepare_messages(class attack att)
</pre><dd><br />
Prepare the result messages.

This method prepares the attack and defense messages setting up the 5
element arrays of att_mess & def_mess. The elements are as follows:
0 - the attacker, 1 - the opponent, 2 - everyone else, 3 - the defender
4 - the person hit

PRE: The attack has been done and the amount of damage done and stopped
has been calculated.<br>
POST: The 5 element att_mess & def_mess arrays are populated.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
class - attack
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="write_messages">
write_messages</a><pre class="autodocfuncdef">
class attack write_messages(class attack att)
</pre><dd><br />
Write out the attack/defense messages.

PRE: all information has been filled in<br>
POST: the appropriate messages have been written out.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
class - attack<br />
<br />
<dd><b>Returns:</b>
<br />class attack
<br /><br />
<br /></dl>

</dl>
[an error occurred while processing this directive]

