#include <wp_magnet.h>
Inherits Weapon.
Inheritance diagram for wp_magnet:
Public Member Functions | |
wp_magnet (Player *p) | |
virtual | ~wp_magnet () |
virtual void | weaponTick () |
Executed every frame to fire the Weapon if it is a held-fire Weapon and firing. | |
Protected Member Functions | |
virtual void | weaponFireAction () |
Actions to perform when the Weapon is fired. | |
virtual void | stopFiring () |
Called by a Player to stop this Weapon from firing, usually to stop a held-fire Weapon's weaponFireAction(). | |
void | popOutPawnWeapon (Player *p) |
Static Protected Attributes | |
static const u8 | PULLSTR = 5 |
Definition at line 26 of file wp_magnet.h.
wp_magnet::wp_magnet | ( | Player * | p | ) | [inline] |
Definition at line 29 of file wp_magnet.h.
References Weapon::ammo, Weapon::bHeldFire, Weapon::canFireCrouching, Weapon::canFireInAir, Weapon::canFireStanding, Weapon::canMoveWhileFiring, Weapon::myType, and Pickup::PT_MAGNET.
wp_magnet::~wp_magnet | ( | ) | [virtual] |
Definition at line 29 of file wp_magnet.cpp.
References Weapon::isFiring(), Weapon::pawn, Player::updateAnimation(), and Weapon::wasFiring().
Here is the call graph for this function:
void wp_magnet::weaponTick | ( | ) | [virtual] |
Executed every frame to fire the Weapon if it is a held-fire Weapon and firing.
Reimplemented from Weapon.
Definition at line 35 of file wp_magnet.cpp.
References Player::isCrouched(), Weapon::isFiring(), massObject::isOnGround(), Weapon::pawn, stopFiring(), Player::updateAnimation(), Weapon::wasFiring(), and Weapon::weaponTick().
Here is the call graph for this function:
void wp_magnet::weaponFireAction | ( | ) | [protected, virtual] |
Actions to perform when the Weapon is fired.
This may be only executed once for single-fire Weapons or every frame for held-fire Weapons.
Implements Weapon.
Definition at line 46 of file wp_magnet.cpp.
References spriteObject::ANIMSPEED, spriteObject::getFlippedh(), spriteObject::getTop(), Player::getWeapon(), spriteObject::getx(), spriteObject::gety(), Player::gm, spriteObject::hasSoundLooping(), gameManager::magnetLoop, Weapon::pawn, gameManager::pickups, gameManager::player1, gameManager::player2, spriteObject::playSound(), spriteObject::pointCollision(), popOutPawnWeapon(), PULLSTR, spriteObject::setAnim(), Player::setInputInterrupt(), and Weapon::wasFiring().
Here is the call graph for this function:
void wp_magnet::stopFiring | ( | ) | [protected, virtual] |
Called by a Player to stop this Weapon from firing, usually to stop a held-fire Weapon's weaponFireAction().
Reimplemented from Weapon.
Definition at line 85 of file wp_magnet.cpp.
References spriteObject::hasSoundLooping(), Weapon::pawn, Weapon::stopFiring(), and spriteObject::stopSound().
Referenced by weaponTick().
Here is the call graph for this function:
void wp_magnet::popOutPawnWeapon | ( | Player * | p | ) | [protected] |
Definition at line 94 of file wp_magnet.cpp.
References Player::clearWeapon(), gameManager::getNextAvailablePickupGFXSet(), Weapon::getType(), Player::getWeapon(), spriteObject::getx(), spriteObject::gety(), Player::gm, Weapon::pawn, pickupSpawner::PICKUPLIFEMAX, pickupSpawner::PICKUPLIFEMIN, spriteObject::setSpeed(), and Player::WALKSPEED.
Referenced by weaponFireAction().
Here is the call graph for this function:
const u8 wp_magnet::PULLSTR = 5 [static, protected] |