Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10256


Ignore:
Timestamp:
Feb 5, 2015, 11:21:35 PM (10 years ago)
Author:
landauf
Message:

found some hidden changes in a merge commit in presentationHS14 and applied it to this branch.
cleanup in Mini4DgamePrereqs.h

Location:
code/branches/presentationHS14merge/src/modules
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationHS14merge/src/modules/mini4dgame/Mini4DgamePrereqs.h

    r10227 r10256  
    3030@file
    3131@brief
    32     Shared library macros, enums, constants and forward declarations for the pong module
     32    Shared library macros, enums, constants and forward declarations for the mini4dgame module
    3333*/
    3434
     
    7272}
    7373
    74 #endif /* _PongPrereqs_H__ */
     74#endif /* _Mini4DgamePrereqs_H__ */
  • code/branches/presentationHS14merge/src/modules/towerdefense/TowerDefenseEnemy.cc

    r10248 r10256  
    3030        //needed to keep track of the PlayerStats coded in TowerDefense.h
    3131        this->td = orxonox_cast<TowerDefense*>(this->getGametype().get());
     32        once_=false;
    3233
    3334    }
    3435    //add credit if enemy is destroyed
    3536    TowerDefenseEnemy::~TowerDefenseEnemy(){
    36         this->td->addCredit(1);
     37        //this->td->addCredit(1);
    3738    }
    3839
     
    4849    }
    4950
     51    WeakPtr<TowerDefense> TowerDefenseEnemy::getGame()
     52    {
     53        if (game == NULL)
     54        {
     55            for (ObjectList<TowerDefense>::iterator it = ObjectList<TowerDefense>::begin(); it != ObjectList<TowerDefense>::end(); ++it)
     56                game = *it;
     57        }
     58        return game;
     59    }
     60
     61    void TowerDefenseEnemy::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
     62    {
     63        Pawn::damage(damage, healthdamage, shielddamage, originator);
     64        if (getGame() && once_ == false && getHealth() <= 0)
     65        {
     66            getGame()->addCredit(1);
     67            once_ = true;
     68        }
     69    }
    5070/*
    5171    void TowerDefenseEnemy::popWaypoint()
  • code/branches/presentationHS14merge/src/modules/towerdefense/TowerDefenseEnemy.h

    r10248 r10256  
    4343        TDCoordinate peekWaypoint();
    4444
     45        virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator);
     46
    4547
    4648    private:
     49        WeakPtr<TowerDefense> getGame();
     50        WeakPtr<TowerDefense> game;
    4751        TowerDefense* td;
    4852        bool once_;
Note: See TracChangeset for help on using the changeset viewer.