Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2009, 8:30:15 PM (16 years ago)
Author:
landauf
Message:

merged pickups2 branch back to trunk. not yet tested.

Location:
code/trunk
Files:
9 deleted
9 edited
27 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/controllers/HumanController.cc

    r3053 r3073  
    4949    SetConsoleCommand(HumanController, boost,         true).keybindMode(KeybindMode::OnHold);
    5050    SetConsoleCommand(HumanController, greet,         true);
    51     SetConsoleCommand(HumanController, use,           true);
    5251    SetConsoleCommand(HumanController, switchCamera,  true);
    5352    SetConsoleCommand(HumanController, mouseLook,     true);
     
    5655    SetConsoleCommand(HumanController, killBots,      true).defaultValues(0);
    5756    SetConsoleCommand(HumanController, dropItems,     true);
     57    SetConsoleCommand(HumanController, useItem,       true);
    5858
    5959    CreateUnloadableFactory(HumanController);
     
    133133    }
    134134
    135     void HumanController::use()
    136     {
    137         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
    138             HumanController::localController_s->controllableEntity_->use();
    139     }
    140 
    141135    void HumanController::switchCamera()
    142136    {
     
    163157    }
    164158
     159    void HumanController::useItem()
     160    {
     161        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
     162            HumanController::localController_s->controllableEntity_->useItem();
     163    }
     164
    165165    void HumanController::addBots(unsigned int amount)
    166166    {
  • code/trunk/src/orxonox/objects/controllers/HumanController.h

    r3053 r3073  
    3434#include "util/Math.h"
    3535#include "Controller.h"
     36#include "objects/worldentities/pawns/Pawn.h"
    3637
    3738namespace orxonox
     
    5657            static void boost();
    5758            static void greet();
    58             static void use();
    5959            static void switchCamera();
    6060            static void mouseLook();
    6161            static void dropItems();
     62            static void useItem();
    6263
    6364            static void suicide();
     
    6566            static void addBots(unsigned int amount);
    6667            static void killBots(unsigned int amount = 0);
     68
     69            static inline HumanController* getLocalControllerSingleton()
     70                { return HumanController::localController_s; }
     71            static inline Pawn* getLocalControllerEntityAsPawn()
     72            {
     73                if (HumanController::localController_s) {
     74                    return dynamic_cast<Pawn*>(HumanController::localController_s->getControllableEntity());
     75                } else {
     76                    return NULL;
     77                }
     78            }
    6779
    6880        private:
  • code/trunk/src/orxonox/objects/items/Engine.cc

    r3060 r3073  
    200200        }
    201201
    202         this->ship_->setAcceleration(this->ship_->getOrientation() * acceleration);
     202        this->ship_->setAcceleration(this->ship_->getPickups().processModifiers(ModifierType::Acceleration, this->ship_->getOrientation() * acceleration, false));
    203203
    204204        if (!this->ship_->getPermanentBoost())
  • code/trunk/src/orxonox/objects/pickup/CMakeLists.txt

    r2710 r3073  
    11ADD_SOURCE_FILES(ORXONOX_SRC_FILES
     2  BaseItem.cc
     3  DroppedItem.cc
     4  EquipmentItem.cc
     5  ModifierPickup.cc
     6  PassiveItem.cc
     7  PickupCollection.cc
     8  PickupInventory.cc
    29  PickupSpawner.cc
    3   BaseItem.cc
    4   Turbo.cc
    5   ShipEquipment.cc
     10  UsableItem.cc
    611)
     12
     13ADD_SUBDIRECTORY(items)
  • code/trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.cc

    r3053 r3073  
    126126            }
    127127
     128            float dmg = this->damage_;
     129            if (this->owner_)
     130                dmg = this->owner_->getPickups().processModifiers(ModifierType::Damage, dmg, false);
     131
    128132            Pawn* victim = dynamic_cast<Pawn*>(otherObject);
    129133            if (victim)
    130                 victim->damage(this->damage_, this->owner_);
     134                victim->damage(dmg, this->owner_);
    131135        }
    132136        return false;
  • code/trunk/src/orxonox/objects/worldentities/ControllableEntity.h

    r3053 r3073  
    8585            virtual void boost() {}
    8686            virtual void greet() {}
    87             virtual void use() {}
     87            virtual void useItem() {}
    8888            virtual void dropItems() {}
    8989            virtual void switchCamera();
  • code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r3053 r3073  
    6666        this->spawnparticleduration_ = 3.0f;
    6767
    68         this->getPickUp().setPlayer(this);
     68        this->getPickups().setOwner(this);
    6969
    7070        if (GameMode::isMaster())
     
    214214            this->setDestroyWhenPlayerLeft(false);
    215215
     216            this->dropItems();
     217
    216218            if (this->getGametype())
    217219                this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
     
    278280    void Pawn::dropItems()
    279281    {
    280         pickUp.eraseAll();
     282        this->getPickups().clear();
    281283    }
    282284
  • code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h

    r3053 r3073  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 #include "objects/pickup/ShipEquipment.h"
    3433#include "objects/worldentities/ControllableEntity.h"
    3534#include "objects/RadarViewable.h"
     35#include "objects/pickup/PickupCollection.h"
    3636
    3737namespace orxonox
     
    106106                { return this->numexplosionchunks_; }
    107107
    108             inline ShipEquipment& getPickUp()
    109                 {return this->pickUp;}
    110 
    111108            virtual void dropItems();
     109            inline PickupCollection& getPickups()
     110                { return this->pickups_; }
     111            virtual void useItem()
     112                { this->pickups_.useItem(); }
    112113
    113114        protected:
     
    119120            virtual void spawneffect();
    120121
    121             ShipEquipment pickUp;
    122122            bool bAlive_;
    123123
     124            PickupCollection pickups_;
    124125
    125126            float health_;
Note: See TracChangeset for help on using the changeset viewer.