WeaponCtrOp

From Eternity Wiki
Revision as of 16:51, 8 May 2011 by Printz (talk | contribs) (Created page with '{{codepointer|description= Sets the value of the indicated counter variable for the weapon using two (possibly the same) counters as operands.|usage= '''WeaponCtrOp'''(''c_oper1_…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Description

Sets the value of the indicated counter variable for the weapon using two (possibly the same) counters as operands.

Usage

WeaponCtrOp(c_oper1_num, c_oper2_num, c_dest_num, specialop)

Parameters

  • c_oper1_num: counter operand #1 (0 to 2)
  • c_oper2_num: counter operand #2 (0 to 2)
  • c_dest_num: counter destination (0 to 2)
  • specialop: operation to perform. One of the following (consider c1, c2 and cdest the contents of the three counters):
    • add or 1
    • sub or 2
    • mul or 3
    • div or 4: integer division. Only operates if c2 <> 0
    • mod or 5: modulus operation (remainder of integer division). Only operates if c2 > 0
    • and or 6: bitwise "and" (only common bits)
    • or or 8: bitwise "or" (any true bits)
    • xor or 9: bitwise "xor" (bit-by-bit added modulo-2)
    • hitdice or 12: "damage" calculation (cdest = c1*random(1, c2)). Only operates if c2 > 0.
    • rshift or 13: divide c1 by 2^c2
    • lshift or 14: multiply c1 by 2^c2
    • abs or 15: cdest = absolute of c1. Unary.
    • negate or 16: cdest = -c1. Unary.
    • not or 17: cdest becomes 1 if c1 is null. Otherwise it becomes 0. Unary.
    • invert or 18: cdest becomes one's complement of c1. Unary.

Examples

No examples given.

Notes

Each weapon has 3 counters. Counter values cannot be transferred between weapons.

See also