Changeset 10690 in orxonox.OLD for branches/adm/src/world_entities
- Timestamp:
- Jun 13, 2007, 7:54:24 PM (18 years ago)
- Location:
- branches/adm/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/adm/src/world_entities/npcs/adm_turret.cc
r10689 r10690 243 243 244 244 this->weapon = new BspWeapon(); 245 this->weapon->loadParams(root); 245 246 this->weapon->setParent( this->cannons ); 246 247 this->weapon->toList( getOMListNumber() ); -
branches/adm/src/world_entities/weapons/bsp_weapon.cc
r10689 r10690 67 67 .describe("Damage that the weapon inflicts"); 68 68 LoadParam(root, "FireRate", this, BspWeapon, setFireRate) 69 69 .describe("how fast it shoots"); 70 70 LoadParam(root, "AlwaysHits", this, BspWeapon, setAlwaysHits) 71 .describe("No, if the weapon should hit with a probability"); 72 } 73 } 74 75 71 .describe("No, if the weapon should hit with a probability"); 72 73 LOAD_PARAM_START_CYCLE(root, element); 74 { 75 LoadParam_CYCLE(element, "addPoint", this, BspWeapon, addPoint) 76 .describe("Adds a new Point for Gunfire"); 77 } 78 LOAD_PARAM_END_CYCLE(element); 79 } 80 } 81 82 void BspWeapon::addPoint(float x, float y, float z) 83 { 84 if (element == 1 ){ 85 gunFire1->setRelCoor(Vector(x,y,z)); 86 element++; 87 } 88 if (element == 2 ){ 89 gunFire2->setRelCoor(Vector(x,y,z)); 90 } 91 } 76 92 77 93 void BspWeapon::tick( float dt ) … … 101 117 fireRate = 0.5; 102 118 alwaysHits = true; 119 element=1; 103 120 104 121 this->registerObject(this, BspWeapon::_objectList); … … 110 127 void BspWeapon::shoot() 111 128 { 129 gunFire.explode(gunFire1,Vector(2,2,2)); 130 gunFire.explode(gunFire2,Vector(2,2,2)); 112 131 std::list<WorldEntity*>::iterator entityIterator; 113 132 // for all bsp managers check all entities -
branches/adm/src/world_entities/weapons/bsp_weapon.h
r10689 r10690 9 9 #include "world_entity.h" 10 10 #include "aiming_system.h" 11 #include "effects/explosion.h" 11 12 12 13 class BspWeapon : public WorldEntity … … 36 37 bool alwaysHits; 37 38 void setAlwaysHits( bool r ){ this->alwaysHits = r; } 39 void addPoint(float x, float y, float z); 40 PNode* gunFire1; 41 PNode* gunFire2; 38 42 39 43 float bRate; 40 44 bool bFire; 45 int element; 46 47 Explosion gunFire; 41 48 42 49 AimingSystem* aimingSystem;
Note: See TracChangeset
for help on using the changeset viewer.