Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11679


Ignore:
Timestamp:
Dec 16, 2017, 12:52:32 PM (7 years ago)
Author:
patricwi
Message:

merged AsteroidMining

Location:
code/branches/Presentation_HS17
Files:
7 edited
2 copied

Legend:

Unmodified
Added
Removed
  • code/branches/Presentation_HS17

  • code/branches/Presentation_HS17/data/levels/AsteroidFarming.oxw

    r11678 r11679  
    33 description = "Testing the Asteroid Mining Project, PPS HS 17"
    44 tags = "test, showcase"
    5  screenshot = "AsteroidFarming.png"
     5 screenshot = "asteroids.png"
    66/>
    77
  • code/branches/Presentation_HS17/src/modules/CMakeLists.txt

    r11678 r11679  
    2626################ Sub Directories ################
    2727
     28ADD_SUBDIRECTORY(asteroidmining)
    2829ADD_SUBDIRECTORY(dialogue)
    2930ADD_SUBDIRECTORY(designtools)
  • code/branches/Presentation_HS17/src/modules/pickup/Pickup.h

    r11071 r11679  
    145145            virtual void changedPickedUp(void) override; //!< Should be called when the pickup has transited from picked up to dropped or the other way around.
    146146
     147
     148            virtual bool createSpawner(void) override; //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
     149
     150
    147151        protected:
    148             virtual bool createSpawner(void) override; //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
    149152
    150153            /**
  • code/branches/Presentation_HS17/src/modules/pickup/PickupSpawner.cc

    r11103 r11679  
    158158            for(Pawn* pawn : ObjectList<Pawn>())
    159159            {
    160                 if(spawner == nullptr) // Stop if the PickupSpawner has been deleted (e.g. because it has run out of pickups to distribute).
     160                // Stop if the PickupSpawner has been deleted (e.g. because it has run out of pickups to distribute). 2nd condition prevents a possible error in isTarget(...) below.
     161                if(spawner == nullptr || this->pickup_ == nullptr)
    161162                    break;
     163
     164                if(!(pawn->doesAcceptPickups())){continue;} // skip those pawns, e.g. AsteroidMinables.
    162165
    163166                Vector3 distance = pawn->getWorldPosition() - this->getWorldPosition();
  • code/branches/Presentation_HS17/src/modules/pickup/PickupSpawner.h

    r11071 r11679  
    114114                {return this->pickupTemplate_; }
    115115
     116
     117            void setPickupTemplateName(const std::string& name);
     118            void setMaxSpawnedItems(int items); //!< Sets the maximum number of spawned items.
     119
     120            inline void setRespawnTime(float time)
     121                { this->respawnTime_ = time; }
     122
     123
    116124        private:
    117125            void initialize(void);
     
    141149            @param time New time after which this gets re-actived.
    142150            */
    143             inline void setRespawnTime(float time)
    144                 { this->respawnTime_ = time; }
    145151
    146             void setMaxSpawnedItems(int items); //!< Sets the maximum number of spawned items.
    147152
    148             void setPickupTemplateName(const std::string& name);
     153
    149154            void setPickupTemplate(Template* temp);
    150155
  • code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/Pawn.cc

    r11176 r11679  
    8484        // set damage multiplier to default value 1, meaning nominal damage
    8585        this->damageMultiplier_ = 1;
     86        this->acceptsPickups_ = true;
    8687
    8788        this->spawnparticleduration_ = 3.0f;
  • code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/Pawn.h

    r11176 r11679  
    199199                { return this->damageMultiplier_; }
    200200
     201            // Some pawns can-t harvest pickups (e.g. AsteroidMinables). Checked in PickupSpawner.
     202            inline void setPickupAcceptance(bool b)
     203                { this->acceptsPickups_ = b; }
     204            inline bool doesAcceptPickups()
     205                { return this->acceptsPickups_;}
    201206
    202207            virtual void startLocalHumanControl() override;
     
    218223                { return this->weaponSystem_; }
    219224
    220             static void consoleCommand_debugDrawWeapons(bool bDraw);
     225            static void consoleCommand_debugDrawWeapons(bool bDraw);
     226
     227
    221228
    222229        protected:
     
    256263
    257264            float damageMultiplier_; ///< Used by the Damage Boost Pickup.
     265            bool acceptsPickups_; // Added for the asteroidMinable class, avoid that they attempt to grab the resources
    258266
    259267            WeakPtr<Pawn> lastHitOriginator_;
Note: See TracChangeset for help on using the changeset viewer.