Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 4, 2012, 3:56:56 PM (13 years ago)
Author:
lkevin
Message:

Changed pickup icon and xml for possible varieties of the pickup in the future.

Location:
code/branches/pickup2012/src/modules/pickup/items
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup2012/src/modules/pickup/items/DamageBoostPickup.cc

    r9119 r9155  
    2121 *
    2222 *   Author:
    23  *      Eric Beier
     23 *      Kevin Lengauer
    2424 *   Co-authors:
    2525 *      ...
     
    2828
    2929/**
    30     @file SpeedPickup.cc
    31     @brief Implementation of the SpeedPickup class.
     30    @file DamageBoostPickup.cc
     31    @brief Implementation of the DamageBoostPickup class.
    3232*/
    3333
     
    7171    {
    7272        this->duration_ = 0.0f;
    73         this->damageMultiplier_ = 20.0f;
     73        this->damageMultiplier_ = 1.0f; //The default damage multiplier.
    7474        //Defines who is allowed to pick up the pickup.
    7575        this->addTarget(ClassIdentifier<SpaceShip>::getIdentifier());
     
    105105
    106106        XMLPortParam(DamageBoostPickup, "duration", setDuration, getDuration, xmlelement, mode);
    107         XMLPortParam(DamageBoostPickup, "damageMultiplier", setDefaultDamageMultiplier, getDefaultDamageMultiplier, xmlelement, mode);
     107        XMLPortParam(DamageBoostPickup, "damageMultiplier", setDamageMultiplier, getDamageMultiplier, xmlelement, mode);
    108108
    109109        this->initializeIdentifier();
    110110    }
     111
     112    // Work in Progress setDamage Function
     113    void DamageBoostPickup::setDamageMultiplier(float damageMultiplier)
     114    {
     115        if(damageMultiplier >= 1.0f)
     116        {
     117            this->damageMultiplier_ = damageMultiplier;
     118            orxout() << "Set Damage " << damageMultiplier << endl;
     119        }
     120    }
     121
    111122
    112123    /**
     
    138149                }
    139150            }
    140             // NOTE: commented this since its use was not apparent
    141             // ship->getCreator();
    142 
     151
     152            // Saves the old default Damage that is needed to restore the original damage
    143153            this->olddamageMultiplier_ = ship->getDamageMultiplier();
     154            // Sets the new Damage with the damage multiplier.
    144155            ship->setDamageMultiplier( this->damageMultiplier_ );
    145156        }
     
    214225        else
    215226        {
    216             orxout(internal_error, context::pickups) << "Invalid duration in SpeedPickup." << endl;
     227            orxout(internal_error, context::pickups) << "Invalid duration in DamagePickup." << endl;
    217228            this->duration_ = 0.0f;
    218229        }
    219230    }
    220231
    221    /* void DamageBoostPickup::setDamageBoost(float damageBoost)
    222        {
    223 
    224        }
    225     void DamageBoostPickup::setDamageSave(float damageSave)
    226     {
    227 
    228     }
    229     */
    230 
     232    /**
     233    @brief
     234        Helper method. Is called by the Timer as soon as it expires.
     235    */
    231236    void DamageBoostPickup::pickupTimerCallback(void)
    232237    {
  • code/branches/pickup2012/src/modules/pickup/items/DamageBoostPickup.h

    r9119 r9155  
    2121 *
    2222 *   Author:
    23  *      Damian 'Mozork' Frick
     23 *      Kevin Lengauer
    2424 *   Co-authors:
    2525 *      ...
     
    5353
    5454            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a DamageBoostPickup object through XML.
    55             // commented out cuz was not used
    56             // virtual void tick(float dt); //!< Is called every tick.
    5755
    5856            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
    5957            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
    60 
    61             /**
    62             @brief Get the damageboost that is transferred to the Pawn upon usage of this pickup.
    63             @return Returns the damageboost.
    64             */
    65             // Commentend, may not be used
    66             // inline float setDamageMultiplier(void) const
    67             //    { ship->setMultiplier(); }
    68 
    6958
    7059            /**
     
    7766
    7867
    79             // we need these methods to set the default damage multiplier from XML
    80             // not that beautiful yet
    81             inline void setDefaultDamageMultiplier(float multiplier)
    82                 { this->damageMultiplier_ = multiplier; }
    83             inline float getDefaultDamageMultiplier()
     68
     69            /**
     70             @brief set Damage multiplier
     71             @param multiplier The default damage multiplier to set
     72             */
     73            inline float getDamageMultiplier()
    8474                { return this->damageMultiplier_; }
    8575
     
    8979        protected:
    9080            void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
     81            void setDamageMultiplier(float damageMultiplier);
    9182
    92             // void setDamageBoost(float damageBoost);//!< Sets the damage boost.
    93             // void setDamageSave(float damageSave); //!< Saves the original damage.
    9483
    9584        private:
    9685            void initialize(void); //!< Initializes the member variables.
    9786            Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
    98             SpaceShip* carrierToSpaceShipHelper(void);
     87            SpaceShip* carrierToSpaceShipHelper(void); //!< Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
    9988            void pickupTimerCallback(void);
    10089
  • code/branches/pickup2012/src/modules/pickup/items/SpeedPickup.h

    r8727 r9155  
    112112        private:
    113113            void initialize(void); //!< Initializes the member variables.
    114             SpaceShip* carrierToSpaceShipHelper(void); //!< Helper to transform the PickupCarrier to a SpaceSHip, and throw an error message if the conversion fails.
     114            SpaceShip* carrierToSpaceShipHelper(void); //!< Helper to transform the PickupCarrier to a SpaceShip, and throw an error message if the conversion fails.
    115115
    116116            Timer durationTimer_; //!< Timer.
Note: See TracChangeset for help on using the changeset viewer.