Changeset 8577
- Timestamp:
- May 25, 2011, 9:07:17 PM (14 years ago)
- Location:
- code/branches/gameimmersion
- Files:
-
- 9 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gameimmersion/data/levels/includes/weaponSettingsAssff.oxi
r7845 r8577 26 26 <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" /> 27 27 <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" /> 28 <LightningGun mode=1 muzzleoffset="0,0,0" damage= 23/>28 <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 /> 29 29 </Weapon> 30 30 <Weapon> … … 36 36 <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" /> 37 37 <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" /> 38 <LightningGun mode=1 muzzleoffset="0,0,0" damage= 23/>38 <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 /> 39 39 </Weapon> 40 40 <Weapon> 41 <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage= 50 />42 <RocketFire mode=3 muzzleoffset="0,0,0" damage= 100 />41 <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 /> 42 <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 /> 43 43 </Weapon> 44 44 </WeaponPack> -
code/branches/gameimmersion/data/levels/shieldTest.oxw
r8573 r8577 1 1 <LevelInfo 2 name = " shield-test-level"2 name = "Shield Testlevel" 3 3 description = "A simple Level with one shielded drone to shoot at" 4 tags = "test" 4 5 /> 5 6 … … 29 30 30 31 <Drone name="meineDrohne" 31 primarythrust="80"32 auxilarythrust="10"33 rotationthrust="10"34 mass="50"35 linearDamping="0.9"36 angularDamping="0.7"32 primarythrust= "80" 33 auxilarythrust= "10" 34 rotationthrust= "10" 35 mass= "50" 36 linearDamping= "0.9" 37 angularDamping= "0.7" 37 38 38 health=10039 maxhealth=15040 inithealth=20039 health= 100 40 maxhealth= 150 41 inithealth= 200 41 42 42 shieldhealth=10043 initialshieldhealth=20044 maxshieldhealth=25043 shieldhealth= 100 44 initialshieldhealth= 200 45 maxshieldhealth= 250 45 46 46 shieldabsorption=147 shieldabsorption= 1 47 48 48 reloadrate="10"49 reloadwaittime=149 reloadrate= "10" 50 reloadwaittime= 1 50 51 51 52 > -
code/branches/gameimmersion/data/levels/templates/spaceshipAssff.oxt
r7845 r8577 12 12 initialhealth = 100 13 13 14 primaryThrust = 100; 15 auxilaryThrust = 30; 16 rotationThrust = 25; 14 shieldhealth = 30 15 initialshieldhealth = 30 16 maxshieldhealth = 50 17 shieldabsorption = 0.8 18 reloadrate = 1 19 reloadwaittime = 1 20 21 primaryThrust = 100 22 auxilaryThrust = 30 23 rotationThrust = 25 24 25 boostPower = 15 26 boostPowerRate = 1 27 boostRate = 5 28 boostCooldownDuration = 10 29 30 shakeFrequency = 15 31 shakeAmplitude = 7 17 32 18 33 collisionType = "dynamic" -
code/branches/gameimmersion/src/orxonox/graphics/Camera.cc
r8138 r8577 48 48 CreateFactory(Camera); 49 49 50 //Camera::Camera(BaseObject* creator) : StaticEntity(creator)51 50 Camera::Camera(BaseObject* creator) : MovableEntity(creator) 52 51 { -
code/branches/gameimmersion/src/orxonox/graphics/Camera.h
r8138 r8577 36 36 #include "tools/interfaces/Tickable.h" 37 37 #include "tools/interfaces/TimeFactorListener.h" 38 //#include "worldentities/StaticEntity.h"39 38 #include "worldentities/MovableEntity.h" 40 39 41 40 namespace orxonox 42 41 { 43 //class _OrxonoxExport Camera : public StaticEntity, public Tickable, public TimeFactorListener, public WindowEventListener 42 44 43 class _OrxonoxExport Camera : public MovableEntity, public TimeFactorListener, public WindowEventListener 45 44 { -
code/branches/gameimmersion/src/orxonox/weaponsystem/WeaponMode.cc
r8386 r8577 66 66 67 67 this->damage_ = 0; 68 ///////////////////me69 68 this->healthdamage_ = 0; 70 69 this->shielddamage_ = 0; 71 ///////////////////end me 70 72 71 this->muzzleOffset_ = Vector3::ZERO; 73 72 this->muzzlePosition_ = Vector3::ZERO; … … 109 108 110 109 XMLPortParam(WeaponMode, "damage", setDamage, getDamage, xmlelement, mode); 111 //////////me112 110 XMLPortParam(WeaponMode, "healthdamage", setHealthDamage, getHealthDamage, xmlelement, mode); 113 111 XMLPortParam(WeaponMode, "shielddamage", setShieldDamage, getShieldDamage, xmlelement, mode); 114 /////////end me115 112 XMLPortParam(WeaponMode, "muzzleoffset", setMuzzleOffset, getMuzzleOffset, xmlelement, mode); 116 113 } -
code/branches/gameimmersion/src/orxonox/weaponsystem/WeaponMode.h
r8533 r8577 107 107 inline float getDamage() const 108 108 { return this->damage_; } 109 ////////////////////me, copied to projectile.cc110 111 109 inline void setHealthDamage(float healthdamage) 112 110 { this->healthdamage_ = healthdamage; } … … 119 117 { return this->shielddamage_; } 120 118 121 ///////////////////end me122 119 inline void setMuzzleOffset(const Vector3& offset) 123 120 { this->muzzleOffset_ = offset; } -
code/branches/gameimmersion/src/orxonox/worldentities/pawns/Pawn.cc
r8575 r8577 130 130 XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0); 131 131 XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f); 132 133 //TODO: DEFINES fuer defaultwerte (hier und weiter oben dieselben)134 132 } 135 133 … … 227 225 } 228 226 229 /* Old damage function.230 * For effects causing only damage not specifically to shield or health231 */232 void Pawn::damage(float damage, Pawn* originator)233 {234 if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))235 {236 //share the dealt damage to the shield and the Pawn.237 float shielddamage = damage*this->shieldAbsorption_;238 float healthdamage = damage*(1-this->shieldAbsorption_);239 240 // In case the shield can not take all the shield damage.241 if (shielddamage > this->getShieldHealth())242 {243 healthdamage += shielddamage-this->getShieldHealth();244 this->setShieldHealth(0);245 }246 247 this->setHealth(this->health_ - healthdamage);248 249 if (this->getShieldHealth() > 0)250 {251 this->setShieldHealth(this->shieldHealth_ - shielddamage);252 }253 254 this->lastHitOriginator_ = originator;255 256 // play damage effect257 }258 }259 260 /* Does damage to the pawn, splits it up to shield and health.261 * Sets lastHitOriginator.262 */263 227 void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator) 264 228 { … … 284 248 285 249 this->lastHitOriginator_ = originator; 286 287 // play damage effect 288 } 289 } 290 291 250 } 251 } 252 253 // TODO: Still valid? 292 254 /* HIT-Funktionen 293 255 Die hit-Funktionen muessen auch in src/orxonox/controllers/Controller.h angepasst werden! (Visuelle Effekte) … … 295 257 */ 296 258 297 /* Old hit function, calls the old damage function and changes velocity vector298 */299 void Pawn::hit(Pawn* originator, const Vector3& force, float damage)300 {301 if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) )302 {303 this->damage(damage, originator);304 this->setVelocity(this->getVelocity() + force);305 306 // play hit effect307 }308 }309 310 /* calls the damage function and adds the force that hit the pawn to the velocity vector311 */312 259 void Pawn::hit(Pawn* originator, const Vector3& force, float damage, float healthdamage, float shielddamage) 313 260 { … … 316 263 this->damage(damage, healthdamage, shielddamage, originator); 317 264 this->setVelocity(this->getVelocity() + force); 318 319 // play hit effect 320 } 321 } 322 323 /* Old hit (2) function, calls the old damage function and hits controller 324 */ 325 void Pawn::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) 326 { 327 if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) ) 328 { 329 this->damage(damage, originator); 330 331 if ( this->getController() ) 332 this->getController()->hit(originator, contactpoint, damage); 333 334 // play hit effect 335 } 336 } 337 338 /* Hit (2) function, calls the damage function and hits controller 339 */ 265 } 266 } 267 268 340 269 void Pawn::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage, float healthdamage, float shielddamage) 341 270 { … … 346 275 if ( this->getController() ) 347 276 this->getController()->hit(originator, contactpoint, damage); // changed to damage, why shielddamage? 348 349 // play hit effect350 277 } 351 278 } -
code/branches/gameimmersion/src/orxonox/worldentities/pawns/Pawn.h
r8386 r8577 53 53 inline bool isAlive() const 54 54 { return this->bAlive_; } 55 56 ///////////////////////////////// me57 virtual void setReloadRate(float reloadrate);58 inline float getReloadRate() const59 { return this->reloadRate_; }60 61 inline void addShieldHealth(float amount)62 { this->setShieldHealth(this->shieldHealth_ + amount); }63 64 inline bool hasShield()65 { return (this->getShieldHealth() > 0); }66 67 virtual void setReloadWaitTime(float reloadwaittime);68 inline float getReloadWaitTime() const69 { return this->reloadWaitTime_; }70 71 inline void resetReloadCountdown()72 { this->reloadWaitCountdown_ = 0; }73 74 inline void startReloadCountdown()75 { this->reloadWaitCountdown_ = this->getReloadWaitTime(); } //in projectile.cc einbauen!!!!!!1111!!111!76 77 virtual void decreaseReloadCountdownTime(float dt);78 79 virtual void setMaxShieldHealth(float maxshieldhealth);80 inline float getMaxShieldHealth() const81 { return this->maxShieldHealth_; }82 83 inline void setInitialShieldHealth(float initialshieldhealth)84 { this->initialShieldHealth_ = initialshieldhealth; this->setShieldHealth(initialshieldhealth); }85 inline float getInitialShieldHealth() const86 { return this->initialShieldHealth_; }87 88 inline void restoreInitialShieldHealth()89 { this->setShieldHealth(this->initialShieldHealth_); }90 inline void restoreMaxShieldHealth()91 { this->setShieldHealth(this->maxShieldHealth_); }92 93 94 ///////////////////////////////// end me95 55 96 56 virtual void setHealth(float health); … … 117 77 { return this->shieldHealth_; } 118 78 79 inline void addShieldHealth(float amount) 80 { this->setShieldHealth(this->shieldHealth_ + amount); } 81 82 inline bool hasShield() 83 { return (this->getShieldHealth() > 0); } 84 85 virtual void setMaxShieldHealth(float maxshieldhealth); 86 inline float getMaxShieldHealth() const 87 { return this->maxShieldHealth_; } 88 89 inline void setInitialShieldHealth(float initialshieldhealth) 90 { this->initialShieldHealth_ = initialshieldhealth; this->setShieldHealth(initialshieldhealth); } 91 inline float getInitialShieldHealth() const 92 { return this->initialShieldHealth_; } 93 94 inline void restoreInitialShieldHealth() 95 { this->setShieldHealth(this->initialShieldHealth_); } 96 inline void restoreMaxShieldHealth() 97 { this->setShieldHealth(this->maxShieldHealth_); } 98 119 99 inline void setShieldAbsorption(float shieldAbsorption) 120 100 { this->shieldAbsorption_ = shieldAbsorption; } … … 122 102 { return this->shieldAbsorption_; } 123 103 104 // TODO: Rename to shieldRechargeRate 105 virtual void setReloadRate(float reloadrate); 106 inline float getReloadRate() const 107 { return this->reloadRate_; } 108 109 virtual void setReloadWaitTime(float reloadwaittime); 110 inline float getReloadWaitTime() const 111 { return this->reloadWaitTime_; } 112 113 inline void resetReloadCountdown() 114 { this->reloadWaitCountdown_ = 0; } 115 116 inline void startReloadCountdown() 117 { this->reloadWaitCountdown_ = this->getReloadWaitTime(); } // TODO: Implement in Projectile.cc 118 119 virtual void decreaseReloadCountdownTime(float dt); 120 124 121 inline ControllableEntity* getLastHitOriginator() const 125 122 { return this->lastHitOriginator_; } 126 123 127 virtual void hit(Pawn* originator, const Vector3& force, float damage); 128 virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage); 129 /////////me 130 virtual void hit(Pawn* originator, const Vector3& force, float damage, float healthdamage, float shielddamage); 131 virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage, float healthdamage, float shielddamage); 132 ////////end me 124 //virtual void hit(Pawn* originator, const Vector3& force, float damage); 125 //virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage); 126 virtual void hit(Pawn* originator, const Vector3& force, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f); 127 virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f); 128 133 129 virtual void kill(); 134 130 … … 186 182 virtual void spawneffect(); 187 183 188 virtual void damage(float damage, Pawn* originator = 0); 189 //////////me 190 virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator); 191 /////////end me 184 //virtual void damage(float damage, Pawn* originator = 0); 185 virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL); 192 186 193 187 bool bAlive_; … … 198 192 { return NULL; } 199 193 200 /////////////////////////// me 194 float health_; 195 float maxHealth_; 196 float initialHealth_; 197 198 float shieldHealth_; 199 float maxShieldHealth_; 200 float initialShieldHealth_; 201 float shieldAbsorption_; // Has to be between 0 and 1 201 202 float reloadRate_; 202 203 float reloadWaitTime_; 203 204 float reloadWaitCountdown_; 204 205 float maxShieldHealth_;206 float initialShieldHealth_;207 208 ////////////////////////// end me209 210 float health_;211 float maxHealth_;212 float initialHealth_;213 float shieldHealth_;214 float shieldAbsorption_; // Has to be between 0 and 1215 205 216 206 WeakPtr<Pawn> lastHitOriginator_; -
code/branches/gameimmersion/src/orxonox/worldentities/pawns/SpaceShip.cc
r8575 r8577 107 107 XMLPortParamVariable(SpaceShip, "boostCooldownDuration", boostCooldownDuration_, xmlelement, mode); 108 108 XMLPortParamVariable(SpaceShip, "shakeFrequency", shakeFrequency_, xmlelement, mode); 109 XMLPortParamVariable(SpaceShip, "shakeAmplitude", shakeAmplitude_, xmlelement, mode); 109 110 } 110 111 … … 114 115 registerVariable(this->auxilaryThrust_, VariableDirection::ToClient); 115 116 registerVariable(this->rotationThrust_, VariableDirection::ToClient); 117 // TODO: Synchronization of boost needed? 116 118 registerVariable(this->boostPower_, VariableDirection::ToClient); 117 119 registerVariable(this->boostPowerRate_, VariableDirection::ToClient); … … 119 121 registerVariable(this->boostCooldownDuration_, VariableDirection::ToClient); 120 122 registerVariable(this->shakeFrequency_, VariableDirection::ToClient); 123 registerVariable(this->shakeAmplitude_, VariableDirection::ToClient); 121 124 } 122 125
Note: See TracChangeset
for help on using the changeset viewer.