Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 4, 2016, 10:13:21 AM (9 years ago)
Author:
fvultier
Message:

Merge latest changes from fabienHS15 to presentationHS15.

Location:
code/branches/presentationHS15
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationHS15

  • code/branches/presentationHS15/src/orxonox/worldentities/pawns/Pawn.cc

    r10962 r11034  
    3434#include "core/GameMode.h"
    3535#include "core/XMLPort.h"
     36#include "core/EventIncludes.h"
    3637#include "network/NetworkFunction.h"
    3738
     
    6263
    6364        this->bAlive_ = true;
     65        this->bVulnerable_ = true;
    6466
    6567        this->health_ = 0;
     
    136138        XMLPortParam(Pawn, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode).defaultValues(0);
    137139
     140        XMLPortParam(Pawn, "vulnerable", setVulnerable, isVulnerable, xmlelement, mode).defaultValues(true);
     141
    138142        XMLPortParam(Pawn, "spawnparticlesource", setSpawnParticleSource, getSpawnParticleSource, xmlelement, mode);
    139143        XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f);
     
    145149        XMLPortObject(Pawn, Munition, "munition", addMunitionXML, getMunitionXML, xmlelement, mode);
    146150
     151        XMLPortObject(Pawn, ExplosionPart, "explosion", addExplosionPart, getExplosionPart, xmlelement, mode);
    147152        XMLPortParam(Pawn, "shieldrechargerate", setShieldRechargeRate, getShieldRechargeRate, xmlelement, mode).defaultValues(0);
    148153        XMLPortParam(Pawn, "shieldrechargewaittime", setShieldRechargeWaitTime, getShieldRechargeWaitTime, xmlelement, mode).defaultValues(1.0f);
    149         XMLPortObject(Pawn, ExplosionPart, "explosion", addExplosionPart, getExplosionPart, xmlelement, mode);
    150154
    151155        XMLPortParam(Pawn, "explosionSound",  setExplosionSound,  getExplosionSound,  xmlelement, mode);
    152156
    153157        XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode );
     158    }
     159
     160    void Pawn::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
     161    {
     162        SUPER(Pawn, XMLEventPort, xmlelement, mode);
     163
     164        XMLPortEventState(Pawn, BaseObject, "vulnerability", setVulnerable, xmlelement, mode);
    154165    }
    155166
     
    246257    }
    247258
     259    void Pawn::changedVulnerability()
     260    {
     261
     262    }
     263
    248264    void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
    249265    {
     266        // A pawn can only get damaged if it is vulnerable
     267        if (!isVulnerable())
     268        {
     269            return;
     270        }
     271
    250272        // Applies multiplier given by the DamageBoost Pickup.
    251273        if (originator)
Note: See TracChangeset for help on using the changeset viewer.