Changeset 7350 in orxonox.OLD for trunk/src/world_entities/playable.cc
- Timestamp:
- Apr 19, 2006, 3:42:23 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/playable.cc
r7347 r7350 16 16 17 17 #include "playable.h" 18 19 #include "weapons/weapon_manager.h"20 18 #include "event_handler.h" 19 21 20 #include "player.h" 22 21 #include "state.h" … … 25 24 #include "util/loading/load_param.h" 26 25 27 #include "world_entities/projectiles/projectile.h"28 29 26 #include "power_ups/weapon_power_up.h" 30 27 #include "power_ups/param_power_up.h" … … 38 35 39 36 #include "effects/explosion.h" 37 38 #include "shell_command.h" 39 SHELL_COMMAND(orxoWeapon, Playable, addSomeWeapons_CHEAT); 40 40 41 41 … … 122 122 * @param slotID the slotID to add the Weapon to. 123 123 */ 124 void Playable::addWeapon(Weapon* weapon, int configID, int slotID) 125 { 126 this->weaponMan.addWeapon(weapon, configID, slotID); 127 128 this->weaponConfigChanged(); 124 bool Playable::addWeapon(Weapon* weapon, int configID, int slotID) 125 { 126 if(this->weaponMan.addWeapon(weapon, configID, slotID)) 127 { 128 this->weaponConfigChanged(); 129 return true; 130 } 131 else 132 { 133 if (weapon != NULL) 134 PRINTF(2)("Unable to add Weapon (%s::%s) to %s::%s\n", 135 weapon->getClassName(), weapon->getName(), this->getClassName(), this->getName()); 136 else 137 PRINTF(2)("No weapon defined\n"); 138 return false; 139 140 } 129 141 } 130 142 … … 170 182 } 171 183 184 /** 185 * @brief a Cheat that gives us some Weapons 186 */ 187 void Playable::addSomeWeapons_CHEAT() 188 { 189 PRINTF(2)("ADDING WEAPONS - you cheater\n"); 190 this->addWeapon(Weapon::createWeapon(CL_HYPERBLASTER)); 191 this->addWeapon(Weapon::createWeapon(CL_TURRET)); 192 this->addWeapon(Weapon::createWeapon(CL_AIMING_TURRET)); 193 this->addWeapon(Weapon::createWeapon(CL_CANNON)); 194 this->addWeapon(Weapon::createWeapon(CL_TARGETING_TURRET)); 195 PRINTF(2)("ADDING WEAPONS FINISHED\n"); 196 } 172 197 173 198 /**
Note: See TracChangeset
for help on using the changeset viewer.