Changeset 10268 in orxonox.OLD for branches/ai/src/world_entities/npcs/npc.cc
- Timestamp:
- Jan 17, 2007, 5:15:00 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ai/src/world_entities/npcs/npc.cc
r10263 r10268 23 23 #include "ai_swarm.h" 24 24 #include "ai_engine.h" 25 26 #include "debug.h" 25 27 26 28 #include "loading/load_param.h" … … 74 76 75 77 78 /** 79 * @brief adds a Weapon to the NPC. 80 * @param weapon the Weapon to add. 81 * @param configID the Configuration ID to add this weapon to. 82 * @param slotID the slotID to add the Weapon to. 83 */ 84 bool NPC::addWeapon(Weapon* weapon, int configID, int slotID) 85 { 86 weapon->setOwner(this->getOwner()); 87 88 89 if(this->weaponMan.addWeapon(weapon, configID, slotID)) 90 { 91 return true; 92 } 93 else 94 { 95 if (weapon != NULL) 96 PRINTF(2)("Unable to add Weapon (%s::%s) to %s::%s\n", 97 weapon->getClassCName(), weapon->getCName(), this->getClassCName(), this->getCName()); 98 else 99 PRINTF(2)("No weapon defined\n"); 100 return false; 101 102 } 103 } 104 105 /** 106 * @brief removes a Weapon. 107 * @param weapon the Weapon to remove. 108 */ 109 void NPC::removeWeapon(Weapon* weapon) 110 { 111 this->weaponMan.removeWeapon(weapon); 112 113 } 114 115 /** 116 * @brief jumps to the next WeaponConfiguration 117 */ 118 void NPC::nextWeaponConfig() 119 { 120 this->weaponMan.nextWeaponConfig(); 121 } 122 123 /** 124 * @brief moves to the last WeaponConfiguration 125 */ 126 void NPC::previousWeaponConfig() 127 { 128 this->weaponMan.previousWeaponConfig(); 129 } 130 131 132 133 134 /** 135 * ticking 136 * @param dt time since last tick 137 */ 76 138 void NPC::tick(float dt) 77 139 { … … 79 141 if (this->bFire) 80 142 weaponMan.fire(); 143 this->bFire = false; 81 144 }
Note: See TracChangeset
for help on using the changeset viewer.