Battle(3)                                                            Battle(3)



NNAAMMEE
       Battle -

SSYYNNOOPPSSIISS
       Inherited by AArrmmoouurr, LLiivviinngg, WWeeaappoonn, WWeeaappoonn, and WWeeaappoonnOObbjj.


   PPuubblliicc MMeetthhooddss
       varargs object * qquueerryy__wwiieellddeedd__wweeaappoonnss (object who, mixed type)
       varargs object * qquueerryy__wwoorrnn__aarrmmoouurr (object who, mixed type)
       int wwcc__ttoo__ddaammaaggee (int wc)
       varargs int ccaallcc__ddaammaaggee (mixed wc)
       varargs int hhiitt__ppeerrcceenntt (object target, int type, string skill)
       int eevvaaddee__ppeerrcceenntt (object target, int type)
       int aattttaacckk__hhiittss (object actor, object target, int type, string skill)
       varargs mixed * mmaakkee__aaccttiioonn (mixed target, int readiness_req, int
           stance, string ob_name, mixed param)
       int cchheecckk__lleeggaall__mmeelleeee (object victim, string verb)
       int aarrmmoouurr__ssoorrtt (object a, object b)
       mixed eexxeeccuuttee__mmeelleeee (object weapon, mapping wc, object target, int
           speed, int flag)

DDEETTAAIILLEEDD DDEESSCCRRIIPPTTIIOONN
       TTooddoo::
            Document this file.

       Definition at line 13 of file battle.c.

MMEEMMBBEERR FFUUNNCCTTIIOONN DDOOCCUUMMEENNTTAATTIIOONN
   iinntt aarrmmoouurr__ssoorrtt ((oobbjjeecctt aa,, oobbjjeecctt bb))
       for sorting armour by layers - called in execute_melee

       Definition at line 205 of file battle.c.

   iinntt aattttaacckk__hhiittss ((oobbjjeecctt aaccttoorr,, oobbjjeecctt ttaarrggeett,, iinntt ttyyppee,, ssttrriinngg sskkiillll))
       This function is called by the various execute_xxx functions to
       determine whether or not an attack is worth considering for reactions,
       damage and whatnot.

       Definition at line 158 of file battle.c.

       References evade_percent(), and hit_percent().

       Referenced by execute_melee().

   vvaarraarrggss iinntt ccaallcc__ddaammaaggee ((mmiixxeedd wwcc))
       Takes a wc mapping and converts it into actual points of damage.

       Definition at line 103 of file battle.c.

       References wc_to_damage().

       Referenced by Living::take_damage().

   iinntt cchheecckk__lleeggaall__mmeelleeee ((oobbjjeecctt vviiccttiimm,, ssttrriinngg vveerrbb))
       RReettuurrnnss::
           True, if conditions are legal for this_player() to attack _v_i_c_t_i_m.
           This checks to see that the two parties are next to each other,
           that both are alive, that victim != this_player(), and similar. If
           any condition fails, false is returned.

       Definition at line 185 of file battle.c.

   iinntt eevvaaddee__ppeerrcceenntt ((oobbjjeecctt ttaarrggeett,, iinntt ttyyppee))
       Returns target's hit% of type (melee, missile, magic, mental).

       Definition at line 135 of file battle.c.

       Referenced by attack_hits().

   mmiixxeedd eexxeeccuuttee__mmeelleeee ((oobbjjeecctt wweeaappoonn,, mmaappppiinngg wwcc,, oobbjjeecctt ttaarrggeett,, iinntt ssppeeeedd,,
       iinntt ffllaagg))
       Executes a melee attack and returns the result. Returns zero if no hit-
       points were lost. It is assumed that this_player() is the one
       attacking.

       The result is something like this:

       ({ string class, int damage, string message, (optional) int bp,
       (optional) object armour })

       The 'class' is one of a set of standardized strings. The list of
       meaningful strings is found in battconst.h. The 'damage' is the damage
       dealt as a percent of the target's hitpoints. The message describes the
       target's reaction (I think?) and is provided for those too lazy to
       integrate the reaction into their descriptions.

       WWaarrnniinngg::
           The docs in battconst.h claim that the 'damage' amount may also be
           a mapping. I don't know what that would mean, but may have
           something to do with multiple types of damage.

       Definition at line 228 of file battle.c.

       References attack_hits().

   vvaarraarrggss iinntt hhiitt__ppeerrcceenntt ((oobbjjeecctt ttaarrggeett,, iinntt ttyyppee,, ssttrriinngg sskkiillll))
       Returns target's hit% of type (melee, missile, magic, mental).

       Definition at line 114 of file battle.c.

       Referenced by attack_hits().

   vvaarraarrggss mmiixxeedd** mmaakkee__aaccttiioonn ((mmiixxeedd ttaarrggeett,, iinntt rreeaaddiinneessss__rreeqq,, iinntt ssttaannccee,,
       ssttrriinngg oobb__nnaammee,, mmiixxeedd ppaarraamm))
       This function is designed to make it more convenient to build battle
       actions. It takes six parameters, but all but the first one are
       optional.

       Definition at line 168 of file battle.c.

   vvaarraarrggss oobbjjeecctt** qquueerryy__wwiieellddeedd__wweeaappoonnss ((oobbjjeecctt wwhhoo,, mmiixxeedd ttyyppee))
       Returns an array containing objects wielded by who. If type is
       declared (either as a single string or as an array of strings), the
       function will only return those weapons of the appropriate type (sword,
       axe, etc...)

       Definition at line 25 of file battle.c.

       Referenced by Living::adopt_best_form(), and Living::on_threaten().

   vvaarraarrggss oobbjjeecctt** qquueerryy__wwoorrnn__aarrmmoouurr ((oobbjjeecctt wwhhoo,, mmiixxeedd ttyyppee))
       This is like qquueerryy__wwiieellddeedd__wweeaappoonnss(()), except that it does it for
       armour.

       Definition at line 47 of file battle.c.

       Referenced by Living::query_armour_ac().

   iinntt wwcc__ttoo__ddaammaaggee ((iinntt wwcc))
       Convert a single wc value into an amount of damage.

       Definition at line 67 of file battle.c.

       Referenced by calc_damage().


AAUUTTHHOORR
       Generated automatically by Doxygen for Walraven from the source code.



Walraven                          13 Aug 2003                        Battle(3)
