Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 8, 2009, 12:58:47 AM (16 years ago)
Author:
dafrick
Message:

Reverted to revision 2906 (because I'm too stupid to merge correctly, 2nd try will follow shortly. ;))

Location:
code/branches/questsystem5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem5

  • code/branches/questsystem5/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r2907 r2908  
    3030#include "Pawn.h"
    3131
    32 #include "core/GameMode.h"
     32#include "core/Core.h"
    3333#include "core/CoreIncludes.h"
    3434#include "core/XMLPort.h"
     
    6363        this->getPickUp().setPlayer(this);
    6464
    65         if (GameMode::isMaster())
     65        if (Core::isMaster())
    6666        {
    6767            this->weaponSystem_ = new WeaponSystem(this);
     
    133133    }
    134134
    135     void Pawn::setPlayer(PlayerInfo* player)
    136     {
    137         ControllableEntity::setPlayer(player);
    138 
    139         if (this->getGametype())
    140             this->getGametype()->playerStartsControllingPawn(player, this);
    141     }
    142 
    143     void Pawn::removePlayer()
    144     {
    145         if (this->getGametype())
    146             this->getGametype()->playerStopsControllingPawn(this->getPlayer(), this);
    147 
    148         ControllableEntity::removePlayer();
    149     }
    150 
    151135    void Pawn::setHealth(float health)
    152136    {
     
    156140    void Pawn::damage(float damage, Pawn* originator)
    157141    {
    158         if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
    159         {
    160             this->setHealth(this->health_ - damage);
    161             this->lastHitOriginator_ = originator;
    162 
    163             // play damage effect
    164         }
     142        this->setHealth(this->health_ - damage);
     143        this->lastHitOriginator_ = originator;
     144
     145        // play damage effect
    165146    }
    166147
    167148    void Pawn::hit(Pawn* originator, const Vector3& force, float damage)
    168149    {
    169         if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator))
    170         {
    171             this->damage(damage, originator);
    172             this->setVelocity(this->getVelocity() + force);
    173 
    174             // play hit effect
    175         }
     150        this->damage(damage, originator);
     151        this->setVelocity(this->getVelocity() + force);
     152
     153        // play hit effect
    176154    }
    177155
     
    198176    void Pawn::death()
    199177    {
    200         if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_))
    201         {
    202             // Set bAlive_ to false and wait for PawnManager to do the destruction
    203             this->bAlive_ = false;
    204 
    205             this->setDestroyWhenPlayerLeft(false);
    206 
    207             if (this->getGametype())
    208                 this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
    209 
    210             if (this->getPlayer())
    211                 this->getPlayer()->stopControl(this);
    212 
    213             if (GameMode::isMaster())
    214                 this->deatheffect();
    215         }
    216         else
    217             this->setHealth(1);
     178        // Set bAlive_ to false and wait for PawnManager to do the destruction
     179        this->bAlive_ = false;
     180
     181        this->setDestroyWhenPlayerLeft(false);
     182
     183        if (this->getGametype())
     184            this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
     185
     186        if (this->getPlayer())
     187            this->getPlayer()->stopControl(this);
     188
     189        if (Core::isMaster())
     190            this->deatheffect();
    218191    }
    219192
     
    249222            ExplosionChunk* chunk = new ExplosionChunk(this->getCreator());
    250223            chunk->setPosition(this->getPosition());
     224
    251225        }
    252226    }
     
    260234    {
    261235        this->setHealth(this->initialHealth_);
    262         if (GameMode::isMaster())
     236        if (Core::isMaster())
    263237            this->spawneffect();
    264238    }
     
    269243    }
    270244
    271 
    272     /* WeaponSystem:
    273     *   functions load Slot, Set, Pack from XML and make sure all parent-pointers are set.
    274     *   with setWeaponPack you can not just load a Pack from XML but if a Pack already exists anywhere, you can attach it.
    275     *       --> e.g. Pickup-Items
    276     */
    277245    void Pawn::setWeaponSlot(WeaponSlot * wSlot)
    278246    {
Note: See TracChangeset for help on using the changeset viewer.