Difference between revisions of "Manual:DIL Manual/opponent()"

From DikuMUD Wiki
Jump to navigation Jump to search
(XML import)
 
(XML import)
 
Line 1: Line 1:
 +
<span id="bfop"></span>
 +
integer opponent(u1 : unitptr, u2 : unitptr)
 +
    u1, u2: Two characters
 +
    return: TRUE if u1 is in combat with u2, FALSE otherwise.
 +
    Example: if (opponent(self, victim)) ...
  
 +
    When in a combat, you are usually only melee-attacking one opponent,
 +
    although you may have many other opponents. This function lets you
 +
    check if you are directly / indirectly an opponent to another unit.
  
 +
---~---~---~---~---~---~---~---~---
 
<span id="bfop"></span>
 
<span id="bfop"></span>
 
  integer opponent(u1 : unitptr, u2 : unitptr)
 
  integer opponent(u1 : unitptr, u2 : unitptr)

Latest revision as of 22:30, 4 December 2025

integer opponent(u1 : unitptr, u2 : unitptr)
   u1, u2: Two characters
   return: TRUE if u1 is in combat with u2, FALSE otherwise.
   Example: if (opponent(self, victim)) ...
   When in a combat, you are usually only melee-attacking one opponent,
   although you may have many other opponents. This function lets you
   check if you are directly / indirectly an opponent to another unit.
---~---~---~---~---~---~---~---~---

integer opponent(u1 : unitptr, u2 : unitptr)
   u1, u2: Two characters
   return: TRUE if u1 is in combat with u2, FALSE otherwise.
   Example: if (opponent(self, victim)) ...
   When in a combat, you are usually only melee-attacking one opponent,
   although you may have many other opponents. This function lets you
   check if you are directly / indirectly an opponent to another unit.
---~---~---~---~---~---~---~---~---