Changeset 6998 for code/branches/presentation3
- Timestamp:
- May 27, 2010, 11:50:24 PM (15 years ago)
- Location:
- code/branches/presentation3
- Files:
-
- 2 deleted
- 9 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3
- Property svn:mergeinfo changed
/code/branches/ppspickups3 (added) merged: 6869,6884,6887,6892-6896,6980,6985
- Property svn:mergeinfo changed
-
code/branches/presentation3/data/levels/includes/pickups.oxi
r6725 r6998 1 <!-- Shield pickups --> 2 3 <PickupRepresentation 4 pickupName = "Small Shield Pickup" 5 pickupDescription = "Gives you a small shield for 10 seconds." 6 inventoryRepresentation = "SmallShield" 7 spawnerTemplate = "smallshieldpickupRepresentation" 8 > 9 <pickup> 10 <ShieldPickup template=smallshieldpickup /> 11 </pickup> 12 </PickupRepresentation> 13 14 <PickupRepresentation 15 pickupName = "Medium Shield Pickup" 16 pickupDescription = "Gives you a medium-sized shield for 30 seconds." 17 inventoryRepresentation = "MediumShield" 18 spawnerTemplate = "mediumshieldpickupRepresentation" 19 > 20 <pickup> 21 <ShieldPickup template=mediumshieldpickup /> 22 </pickup> 23 </PickupRepresentation> 24 25 <PickupRepresentation 26 pickupName = "Huge Shield Pickup" 27 pickupDescription = "Gives you a big shield for 60 seconds." 28 inventoryRepresentation = "HugeShield" 29 spawnerTemplate = "hugeshieldpickupRepresentation" 30 > 31 <pickup> 32 <ShieldPickup template=hugeshieldpickup /> 33 </pickup> 34 </PickupRepresentation> 1 35 2 36 <!-- Health pickups --> … … 73 107 74 108 <PickupRepresentation 75 name = "Small Speed Boost"76 description = "Multiplies Speed of the Ship by a small amount."109 pickupName = "Small Speed Boost" 110 pickupDescription = "Multiplies Speed of the Ship by a small amount." 77 111 spawnerTemplate = "smallspeedpickupRepresentation" 112 inventoryRepresentation = "SmallSpeed" 78 113 > 79 114 <pickup> … … 83 118 84 119 <PickupRepresentation 85 name = "Medium Speed Boost"86 description = "Multiplies Speed of the Ship by a bigger amount."120 pickupName = "Medium Speed Boost" 121 pickupDescription = "Multiplies Speed of the Ship by a bigger amount." 87 122 spawnerTemplate = "mediumspeedpickupRepresentation" 123 inventoryRepresentation = "MediumSpeed" 88 124 > 89 125 <pickup> … … 93 129 94 130 <PickupRepresentation 95 name = "Huge Speed Boost"96 description = "Multiplies Speed of the Ship by a huge amount."131 pickupName = "Huge Speed Boost" 132 pickupDescription = "Multiplies Speed of the Ship by a huge amount." 97 133 spawnerTemplate = "hugespeedpickupRepresentation" 134 inventoryRepresentation = "HugeSpeed" 98 135 > 99 136 <pickup> … … 103 140 104 141 <PickupRepresentation 105 name = "Small Jump Boost"106 description = "Boosts the Ship with a massive amount for a very short time."142 pickupName = "Small Jump Boost" 143 pickupDescription = "Boosts the Ship with a massive amount for a very short time." 107 144 spawnerTemplate = "smalljumppickupRepresentation" 145 inventoryRepresentation = "SmallSpeed" 108 146 > 109 147 <pickup> … … 115 153 116 154 <PickupRepresentation 117 name = "small Invisibility"118 description = "Makes you invisible for 5 seconds."155 pickupName = "Small Invisibility" 156 pickupDescription = "Makes you invisible for 5 seconds." 119 157 spawnerTemplate = "smallinvisiblepickupRepresentation" 158 inventoryRepresentation = "SmallInvisible" 120 159 > 121 160 <pickup> … … 125 164 126 165 <PickupRepresentation 127 name = "medium Invisibility"128 description = "Makes you invisible for 10 seconds."166 pickupName = "Medium Invisibility" 167 pickupDescription = "Makes you invisible for 10 seconds." 129 168 spawnerTemplate = "mediuminvisiblepickupRepresentation" 169 inventoryRepresentation = "MediumInvisible" 130 170 > 131 171 <pickup> … … 135 175 136 176 <PickupRepresentation 137 name = "hunge Invisibility"138 description = "Makes you invisible for 20 seconds."177 pickupName = "Huge Invisibility" 178 pickupDescription = "Makes you invisible for 20 seconds." 139 179 spawnerTemplate = "hugeinvisiblepickupRepresentation" 180 inventoryRepresentation = "HugeInvisible" 140 181 > 141 182 <pickup> -
code/branches/presentation3/data/levels/pickup.oxw
r6901 r6998 26 26 <SpawnPoint position="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /> 27 27 28 29 <!-- Shield pickups --> 30 31 <PickupSpawner position="-25,-25,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10"> 32 <pickup> 33 <ShieldPickup template=smallshieldpickup /> 34 </pickup> 35 </PickupSpawner> 36 37 <PickupSpawner position="0,-25,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10"> 38 <pickup> 39 <ShieldPickup template=mediumshieldpickup /> 40 </pickup> 41 </PickupSpawner> 42 43 <PickupSpawner position="25,-25,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10"> 44 <pickup> 45 <ShieldPickup template=hugeshieldpickup /> 46 </pickup> 47 </PickupSpawner> 48 28 49 <!-- Health pickups --> 29 50 … … 114 135 <!-- Pickup Collection pickups --> 115 136 116 <PickupSpawner position="0, -25,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">137 <PickupSpawner position="0,100,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10"> 117 138 <pickup> 118 139 <PickupCollection template=triplehealthspeedinvisibilitypickup /> -
code/branches/presentation3/data/levels/templates/pickup_representation_templates.oxt
r6712 r6998 1 <!-- Shield pickups: --> 2 3 <Template name=smallshieldpickupRepresentation> 4 <PickupRepresentation> 5 <spawner-representation> 6 <StaticEntity> 7 <attached> 8 <Billboard position="0,0,0" colour="1,1,1" material="Sphere2" scale=0.1> 9 <attached> 10 <Billboard position="0,0,0" colour="1,1,1" material="Shield" scale=0.3 /> 11 </attached> 12 </Billboard> 13 </attached> 14 </StaticEntity> 15 </spawner-representation> 16 </PickupRepresentation> 17 </Template> 18 19 <Template name=smallshieldpickup> 20 <ShieldPickup 21 duration = 10 22 shieldabsorption = 0.7 23 shieldhealth = 300 24 activationType = "immediate" 25 durationType = "once" 26 /> 27 </Template> 28 29 30 <Template name=mediumshieldpickupRepresentation> 31 <PickupRepresentation> 32 <spawner-representation> 33 <StaticEntity> 34 <attached> 35 <Billboard position="0,0,0" colour="1,1,1" material="Sphere2" scale=0.1> 36 <attached> 37 <Billboard position="0,0,0" colour="1,1,1" material="Shield" scale=0.5 /> 38 </attached> 39 </Billboard> 40 </attached> 41 </StaticEntity> 42 </spawner-representation> 43 </PickupRepresentation> 44 </Template> 45 46 <Template name=mediumshieldpickup> 47 <ShieldPickup 48 duration = 30 49 shieldabsorption = 0.8 50 shieldhealth = 500 51 activationType = "immediate" 52 durationType = "once" 53 /> 54 </Template> 55 56 57 <Template name=hugeshieldpickupRepresentation> 58 <PickupRepresentation> 59 <spawner-representation> 60 <StaticEntity> 61 <attached> 62 <Billboard position="0,0,0" colour="1,1,1" material="Sphere2" scale=0.1> 63 <attached> 64 <Billboard position="0,0,0" colour="1,1,1" material="Shield" scale=0.7 /> 65 </attached> 66 </Billboard> 67 </attached> 68 </StaticEntity> 69 </spawner-representation> 70 </PickupRepresentation> 71 </Template> 72 73 <Template name=hugeshieldpickup> 74 <ShieldPickup 75 duration = 60 76 shieldabsorption = 0.95 77 shieldhealth = 700 78 activationType = "immediate" 79 durationType = "once" 80 /> 81 </Template> 1 82 2 83 <!-- Health pickups: --> -
code/branches/presentation3/src/modules/pickup/PickupPrereqs.h
r6711 r6998 79 79 class MetaPickup; 80 80 class SpeedPickup; 81 class ShieldPickup; 81 82 82 83 } -
code/branches/presentation3/src/modules/pickup/items/CMakeLists.txt
r6710 r6998 4 4 MetaPickup.cc 5 5 SpeedPickup.cc 6 ShieldPickup.cc 6 7 ) -
code/branches/presentation3/src/orxonox/controllers/AIController.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/presentation3/src/orxonox/worldentities/pawns/Pawn.cc
r6942 r6998 66 66 this->maxHealth_ = 0; 67 67 this->initialHealth_ = 0; 68 this->shieldHealth_ = 0; 69 this->shieldAbsorption_ = 0.5; 68 70 69 71 this->lastHitOriginator_ = 0; … … 80 82 else 81 83 this->weaponSystem_ = 0; 82 84 83 85 this->setCarrierName("Pawn"); 84 86 … … 107 109 XMLPortParam(Pawn, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200); 108 110 XMLPortParam(Pawn, "initialhealth", setInitialHealth, getInitialHealth, xmlelement, mode).defaultValues(100); 111 112 XMLPortParam(Pawn, "shieldhealth", setShieldHealth, getShieldHealth, xmlelement, mode).defaultValues(0); 113 XMLPortParam(Pawn, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode).defaultValues(0); 114 109 115 XMLPortParam(Pawn, "spawnparticlesource", setSpawnParticleSource, getSpawnParticleSource, xmlelement, mode); 110 116 XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f); … … 118 124 void Pawn::registerVariables() 119 125 { 120 registerVariable(this->bAlive_, VariableDirection::ToClient); 121 registerVariable(this->health_, VariableDirection::ToClient); 122 registerVariable(this->initialHealth_, VariableDirection::ToClient); 123 registerVariable(this->bReload_, VariableDirection::ToServer); 124 registerVariable(this->aimPosition_, Bidirectionality::ServerMaster, 0, true); 126 registerVariable(this->bAlive_, VariableDirection::ToClient); 127 registerVariable(this->health_, VariableDirection::ToClient); 128 registerVariable(this->initialHealth_, VariableDirection::ToClient); 129 registerVariable(this->shieldHealth_, VariableDirection::ToClient); 130 registerVariable(this->shieldAbsorption_, VariableDirection::ToClient); 131 registerVariable(this->bReload_, VariableDirection::ToServer); 132 registerVariable(this->aimPosition_, Bidirectionality::ServerMaster, 0, true); 125 133 } 126 134 … … 164 172 if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator)) 165 173 { 166 this->setHealth(this->health_ - damage); 174 //share the dealt damage to the shield and the Pawn. 175 float shielddamage = damage*this->shieldAbsorption_; 176 float healthdamage = damage*(1-this->shieldAbsorption_); 177 178 // In case the shield can not take all the shield damage. 179 if (shielddamage > this->getShieldHealth()) 180 { 181 healthdamage += shielddamage-this->getShieldHealth(); 182 this->setShieldHealth(0); 183 } 184 185 this->setHealth(this->health_ - healthdamage); 186 187 if (this->getShieldHealth() > 0) 188 { 189 this->setShieldHealth(this->shieldHealth_ - shielddamage); 190 } 191 167 192 this->lastHitOriginator_ = originator; 168 193 -
code/branches/presentation3/src/orxonox/worldentities/pawns/Pawn.h
r6711 r6998 73 73 { return this->initialHealth_; } 74 74 75 inline void setShieldHealth(float shieldHealth) 76 { this->shieldHealth_ = shieldHealth; } 77 inline float getShieldHealth() 78 { return this->shieldHealth_; } 79 80 inline void setShieldAbsorption(float shieldAbsorption) 81 { this->shieldAbsorption_ = shieldAbsorption; } 82 inline float getShieldAbsorption() 83 { return this->shieldAbsorption_; } 84 75 85 inline ControllableEntity* getLastHitOriginator() const 76 86 { return this->lastHitOriginator_; } … … 141 151 float maxHealth_; 142 152 float initialHealth_; 153 float shieldHealth_; 154 float shieldAbsorption_; // Has to be between 0 and 1 143 155 144 156 Pawn* lastHitOriginator_;
Note: See TracChangeset
for help on using the changeset viewer.