Changeset 5435 in orxonox.OLD for trunk/src/world_entities/player.cc
- Timestamp:
- Oct 25, 2005, 5:31:54 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/player.cc
r5420 r5435 92 92 wpLeft->setName("testGun Left"); 93 93 94 Weapon* turret1 = new Turret(this->weaponMan);95 turret1->setName("Turret1");96 turret1->setStateDuration(WS_SHOOTING, .2);97 Weapon* turret2 = new Turret(this->weaponMan);98 turret2->setName("Turret2");99 turret2->setStateDuration(WS_SHOOTING, .3);100 Weapon* turret3 = new Turret(this->weaponMan);101 turret3->setName("Turret3");102 turret3->setStateDuration(WS_SHOOTING, .17);103 104 Weapon* turret4 = new Turret(this->weaponMan);105 turret4->setName("Turret4");106 turret4->setStateDuration(WS_SHOOTING, .3);107 108 109 94 this->weaponMan->addWeapon(wpLeft, 1, 0); 110 95 this->weaponMan->addWeapon(wpRight,1 ,1); 111 this->weaponMan->addWeapon(turret1, 2, 2);112 this->weaponMan->addWeapon(turret2, 2, 3);113 this->weaponMan->addWeapon(turret3, 2, 4);114 this->weaponMan->addWeapon(turret4, 2, 5);115 116 96 //this->weaponMan->addWeapon(turret, 3, 0); 117 97 118 this->weaponMan->changeWeaponConfig( 0);98 this->weaponMan->changeWeaponConfig(1); 119 99 } 120 100 … … 153 133 154 134 this->weaponMan = new WeaponManager(this); 155 this->weaponMan->setSlotCount( 6);135 this->weaponMan->setSlotCount(10); 156 136 157 137 this->weaponMan->setSlotPosition(0, Vector(-2.6, .1, -3.0)); … … 171 151 this->weaponMan->setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0))); 172 152 153 this->weaponMan->setSlotPosition(6, Vector(-2.0, 0.1, -2.0)); 154 this->weaponMan->setSlotPosition(7, Vector(-2.0, 0.1, 2.0)); 155 156 this->weaponMan->setSlotPosition(8, Vector(-2.5, -0.3, -2.0)); 157 this->weaponMan->setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0))); 158 159 this->weaponMan->setSlotPosition(9, Vector(-2.5, -0.3, 2.0)); 160 this->weaponMan->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0))); 161 173 162 } 174 163 … … 222 211 223 212 224 225 /** 226 * if the player is hit, call this function 227 * @param weapon hit by this weapon 228 * @param loc ?? 229 */ 230 void Player::hit (WorldEntity* weapon, Vector* loc) 231 { 232 } 233 234 235 /** 236 * Collision with another Entity has this effect 237 * @param other the other colider 238 * @param ownhitflags ?? 239 * @param otherhitflags ?? 240 */ 241 void Player::collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags) 242 { 243 } 244 213 WorldEntity* ref = NULL; 214 /** 215 * this function is called, when two entities collide 216 * @param entity: the world entity with whom it collides 217 * 218 * Implement behaviour like damage application or other miscellaneous collision stuff in this function 219 */ 220 void Player::collidesWith(WorldEntity* entity, const Vector& location) 221 { 222 if (entity->isA(CL_TURRET_POWER_UP) && entity != ref) 223 { 224 this->ADDWEAPON(); 225 ref = entity; 226 } 227 // PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassName(), entity->getClassName(), location.x, location.y, location.z); 228 } 245 229 246 230 /** … … 343 327 this->weaponMan->previousWeaponConfig(); 344 328 } 329 330 // FIXME THIS MIGHT BE CONSIDERED EITHER A FEATURE, OR A BUG 331 int slot = 2; 332 void Player::ADDWEAPON() 333 { 334 Weapon* turret1 = new Turret(this->weaponMan); 335 turret1->setName("Turret"); 336 turret1->setStateDuration(WS_SHOOTING, (float)rand()/RAND_MAX*.5+.1); 337 338 this->weaponMan->addWeapon(turret1, 2, slot++); 339 340 this->weaponMan->changeWeaponConfig(2); 341 }
Note: See TracChangeset
for help on using the changeset viewer.