Addammo

From EDukeWiki
Revision as of 14:38, 10 May 2012 by Helixhorned (talk | contribs) (note that addammo may break out of the code (actually all the way to the entry point?))
Jump to navigation Jump to search

addammo <weapon> <amount>

Adds <amount> to ammo of <weapon>. Similar to addweapon and addweaponvar, but doesn't add the weapon if the player doesn't already have it.

If the player already has full ammo for <weapon>, execution of subsequent code is halted in a fashion similar to break.

actor AMMO
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
            ifcanseetarget
      {
        addammo PISTOL_WEAPON PISTOLAMMOAMOUNT
        quote 65
        ifspawnedby AMMO
          state getcode
        else
          state quikget
      }
enda