Changeset 10029 for code/branches
- Timestamp:
- Apr 10, 2014, 3:45:56 PM (11 years ago)
- Location:
- code/branches/modularships
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/modularships/data/levels/emptyLevel.oxw
r10023 r10029 98 98 </ModularSpaceShip> 99 99 100 <ModularSpaceShip position="0,-1000,-200" health=" 1000" maxhealth="2000" initialhealth="1000">100 <ModularSpaceShip position="0,-1000,-200" health="2000" maxhealth="4000" initialhealth="2000"> 101 101 <templates> 102 102 <Template link=HeavyCruiser /> -
code/branches/modularships/data/levels/templates/HeavyCruiser.oxt
r10023 r10029 11 11 explosionchunks = 6 12 12 13 health = 100014 maxhealth = 200015 initialhealth = 100013 health = 2000 14 maxhealth = 4000 15 initialhealth = 2000 16 16 17 17 shieldhealth = 100 … … 51 51 52 52 <parts> 53 <ShipPart name="frontL" health="100" damageabsorption="0.5" />54 <ShipPart name="frontR" health="100" damageabsorption="0.5" />55 <ShipPart name="partL" health="100" damageabsorption="0.5" />56 <ShipPart name="partR" health="100" damageabsorption="0.5" />57 <ShipPart name="sidearmL" health="201" damageabsorption="0.2" />58 <ShipPart name="sidearmLfront" health="100" damageabsorption="0.5" />59 <ShipPart name="sidearmR" health="200" damageabsorption="0.2" />60 <ShipPart name="sidearmRfront" health="100" damageabsorption="0.5" />53 <ShipPart name="frontL" initialhealth="10" damageabsorption="0.5" /> 54 <ShipPart name="frontR" initialhealth="10" damageabsorption="0.5" /> 55 <ShipPart name="partL" initialhealth="10" damageabsorption="0.5" /> 56 <ShipPart name="partR" initialhealth="10" damageabsorption="0.5" /> 57 <ShipPart name="sidearmL" initialhealth="20" damageabsorption="0.2" /> 58 <ShipPart name="sidearmLfront" initialhealth="10" damageabsorption="0.5" /> 59 <ShipPart name="sidearmR" initialhealth="20" damageabsorption="0.2" /> 60 <ShipPart name="sidearmRfront" initialhealth="10" damageabsorption="0.5" /> 61 61 </parts> 62 62 -
code/branches/modularships/src/orxonox/worldentities/WorldEntity.h
r10011 r10029 206 206 207 207 void notifyChildPropsChanged(); 208 209 inline int getNumAttachedObj() 210 { return this->children_.size(); } 208 211 209 212 protected: -
code/branches/modularships/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
r10023 r10029 78 78 { 79 79 // iterate through all attached objects 80 for (unsigned int i=0; i < 100; i++)80 for (unsigned int i=0; i < this->getNumAttachedObj(); i++) 81 81 { 82 82 if (this->getAttachedObject(i) == NULL) 83 { 83 84 break; 85 } 84 86 // iterate through all attached parts 85 87 for(unsigned int j = 0; j < this->partList_.size(); j++) … … 149 151 void ModularSpaceShip::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) 150 152 { 151 orxout() << "Mdamage(): Collision detected on " << this->getRadarName() << ", btCS*: " << cs << endl;153 /*orxout() << "Mdamage(): Collision detected on " << this->getRadarName() << ", btCS*: " << cs << endl; 152 154 orxout() << "UserPtr of said collisionShape: " << cs->getUserPointer() << endl; 153 155 … … 177 179 //orxout() << "ShipPart of Entity " << cs->getUserPointer() << ": " << this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) << endl; 178 180 179 orxout() << "CP_start" << endl;180 181 181 if (this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != NULL) 182 182 this->getPartOfEntity((StaticEntity*)(cs->getUserPointer()))->handleHit(damage, healthdamage, shielddamage, originator); 183 183 else 184 184 SpaceShip::damage(damage, healthdamage, shielddamage, originator, cs); 185 186 orxout() << "CP_end" << endl;187 185 188 186 /* … … 267 265 { 268 266 if(this->partList_[i] == part) 267 { 269 268 this->partList_.erase(it); 269 break; 270 } 270 271 it++; 271 272 } … … 275 276 if (itt->second == part) 276 277 { 277 this->detach(itt->first); 278 //this->detach(itt->first); 279 //itt->first->destroy(); 280 itt->first->setActive(false); 281 itt->first->setVisible(false); 282 itt->first->setCollisionResponse(false); 278 283 this->partMap_.erase(itt); 279 284 }
Note: See TracChangeset
for help on using the changeset viewer.