Danbias/Code/Game/GameLogic/PickupSystem/PickupHealth.cpp

22 lines
558 B
C++
Raw Normal View History

2014-02-25 14:36:54 +01:00
#include "PickupHealth.h"
2014-02-26 10:23:38 +01:00
#include "../Game.h"
2014-02-25 14:36:54 +01:00
using namespace GameLogic;
PickupHealth::PickupHealth(Oyster::Physics::ICustomBody *rigidBody, ObjectSpecialType type, int objectID, Oyster::Math::Float spawnTime, Oyster::Math::Float healthValue)
: Pickup(rigidBody, Pickup::PickupCollision, type, objectID, spawnTime)
{
this->hpValue = healthValue;
}
PickupHealth::~PickupHealth()
{}
void PickupHealth::OnCollision(Player *player)
{
timer.reset();
2014-02-26 10:23:38 +01:00
((Game*)&Game::Instance())->onDisableFnc(this);
this->active = false;
2014-02-25 14:36:54 +01:00
player->DamageLife(-hpValue);
}