Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6980 for code


Ignore:
Timestamp:
May 27, 2010, 7:05:36 PM (15 years ago)
Author:
ebeier
Message:

created more pickup representations, prepared pickup-level for presentation, removed debug code etc.

Location:
code/branches/ppspickups3
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ppspickups3/data/levels/includes/pickups.oxi

    r6884 r6980  
    22
    33<PickupRepresentation
    4     pickupName = "Super Shield Pickup"
    5     pickupDescription = "Gives you a shield with 1000000 helath points for 5 minutes"
    6     inventoryRepresentation = "SmallHealth"
    7     spawnerTemplate = "supershieldpickupRepresentation"
     4    pickupName = "Small Shield Pickup"
     5    pickupDescription = "Gives you a small shield for 10 seconds."
     6    inventoryRepresentation = "SmallShield"
     7    spawnerTemplate = "smallshieldpickupRepresentation"
    88>
    99    <pickup>
    10         <ShieldPickup template=supershieldpickup />
     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 />
    1133    </pickup>
    1234</PickupRepresentation>
  • code/branches/ppspickups3/data/levels/pickup.oxw

    r6884 r6980  
    2929    <!-- Shield pickups -->
    3030   
    31     <PickupSpawner position="-50,50,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
     31    <PickupSpawner position="-25,-25,-100" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
    3232        <pickup>
    33             <ShieldPickup template=supershieldpickup />
     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 />
    3446        </pickup>
    3547    </PickupSpawner>
  • code/branches/ppspickups3/data/levels/templates/pickup_representation_templates.oxt

    r6884 r6980  
    11<!-- Shield pickups: -->
    22
    3 <Template name=supershieldpickupRepresentation>
     3<Template name=smallshieldpickupRepresentation>
    44    <PickupRepresentation>
    55        <spawner-representation>
     
    88                    <Billboard position="0,0,0" colour="1,1,1" material="Sphere2" scale=0.1>
    99                        <attached>
    10                             <Billboard position="0,0,0" colour="1,1,1" material="Shield" scale=10 />
    11                         </attached>
    12                     </Billboard>
    13                 </attached>
    14             </StaticEntity>
    15         </spawner-representation>
    16     </PickupRepresentation>
    17 </Template>
    18 
    19 <Template name=supershieldpickup>
     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>
    2020  <ShieldPickup
    21     absorption = 1
    22     duration = 6000
    23     shieldhealth = 1000000
     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
    2478    activationType = "immediate"
    2579    durationType = "once"
  • code/branches/ppspickups3/src/orxonox/worldentities/pawns/Pawn.cc

    r6896 r6980  
    8080        else
    8181            this->weaponSystem_ = 0;
    82        
     82
    8383        this->setCarrierName("Pawn");
    8484
     
    107107        XMLPortParam(Pawn, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200);
    108108        XMLPortParam(Pawn, "initialhealth", setInitialHealth, getInitialHealth, xmlelement, mode).defaultValues(100);
    109        
     109
    110110        XMLPortParam(Pawn, "shieldhealth", setShieldHealth, getShieldHealth, xmlelement, mode).defaultValues(0);
    111111        XMLPortParam(Pawn, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode).defaultValues(0);
    112        
     112
    113113        XMLPortParam(Pawn, "spawnparticlesource", setSpawnParticleSource, getSpawnParticleSource, xmlelement, mode);
    114114        XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f);
     
    170170            float shielddamage = damage*this->shieldAbsorption_;
    171171            float healthdamage = damage*(1-this->shieldAbsorption_);
    172            
     172
    173173            // In case the shield can not take all the shield damage.
    174             if (shielddamage > this->getShieldHealth()) 
     174            if (shielddamage > this->getShieldHealth())
    175175            {
    176                 COUT(1) << "the shield is too weak to take its share of the damage!" << std::endl;
    177 
    178176                healthdamage += shielddamage-this->getShieldHealth();
    179177                this->setShieldHealth(0);
     
    181179
    182180            this->setHealth(this->health_ - healthdamage);
    183            
     181
    184182            if (this->getShieldHealth() > 0)
    185183            {
    186184                this->setShieldHealth(this->shieldHealth_ - shielddamage);
    187                 COUT(1) << "damage " << damage  << " getShieldAbsorption " << getShieldAbsorption() << std::endl;
    188                 COUT(1) << "shielddamage " << shielddamage  << " healthdamage " << healthdamage << std::endl;
    189                 COUT(1) << "the shield takes its share of the damage and is left with " << this->getShieldHealth() << std::endl;
    190185            }
    191186
     
    195190        }
    196191    }
    197    
     192
    198193    void Pawn::hit(Pawn* originator, const Vector3& force, float damage)
    199194    {
Note: See TracChangeset for help on using the changeset viewer.