Commit c48fb294 authored by Gerhard Stein's avatar Gerhard Stein

now owners of rays in the vorticon engine can be determined.

parent 7ed1f10c
......@@ -527,7 +527,7 @@ void CObject::processFalling()
// In order to avoid, that they can't get out, pull them out of there!
}
void CObject::getShotByRay()
void CObject::getShotByRay(object_t &obj_type)
{
if( !m_invincible && HealthPoints>0)
{
......
......@@ -157,7 +157,7 @@ public:
void processFalling();
virtual void getTouchedBy(CObject &theObject) {};
virtual void getShotByRay();
virtual void getShotByRay(object_t &obj_type);
void kill_intersecting_tile(int mpx, int mpy, CObject &theObject);
CMap *getMapPtr() { return mp_Map; }
......
......@@ -73,7 +73,7 @@ public:
void checkSolidDoors();
void SelectFrame();
int pollLevelTrigger();
void getShotByRay();
void getShotByRay(object_t &obj_type);
// Used for both situations
void InertiaAndFriction_X();
......
......@@ -919,7 +919,7 @@ int CPlayer::pollLevelTrigger()
return trigger;
}
void CPlayer::getShotByRay()
void CPlayer::getShotByRay(object_t &obj_type)
{
if (pfrozentime)
{
......
......@@ -126,7 +126,7 @@ void CBallJack::process()
}
}
void CBallJack::getShotByRay()
void CBallJack::getShotByRay(object_t &obj_type)
{
// have ball change direction when zapped
if (zapd==LEFT)
......
......@@ -8,8 +8,8 @@
#ifndef CBALLJACK_H_
#define CBALLJACK_H_
#include "../../../common/CObject.h"
#include "../../../common/CPlayer.h"
#include "common/CObject.h"
#include "common/CPlayer.h"
#include <vector>
class CBallJack : public CObject
......@@ -19,7 +19,7 @@ public:
std::vector<CPlayer> &PlayerVect, object_t type);
void process();
void getShotByRay();
void getShotByRay(object_t &obj_type);
private:
enum {
......
#include "../../../sdl/sound/CSound.h"
#include "../../spritedefines.h"
#include "sdl/sound/CSound.h"
#include "sdl/CVideoDriver.h"
#include "engine/spritedefines.h"
#include "CGuardRobot.h"
#include "CRay.h"
......@@ -35,7 +36,7 @@ CGuardRobot::CGuardRobot(CMap *p_map, Uint32 x, Uint32 y,
CObject(p_map, x, y, OBJ_GUARDROBOT),
m_ObjectVect(Object)
{
//first time initilization
//first time initialization
state = TANK_WALK;
movedir = RIGHT;
fireafterlook = 0;
......@@ -208,3 +209,14 @@ void CGuardRobot::tank2_fire()
timetillcanfire = (rnd()%(MAX_TIME_TILL_CAN_FIRE-MIN_TIME_TILL_CAN_FIRE))+MIN_TIME_TILL_CAN_FIRE;
pausetime = FIRE_PAUSE_TIME;
}
void CGuardRobot::getShotByRay(object_t &obj_type)
{
if( !m_invincible && HealthPoints>0 && obj_type != OBJ_VORTELITE)
{
if(HealthPoints>1 && g_pVideoDriver->getSpecialFXConfig())
blink(10);
HealthPoints--;
}
}
......@@ -21,6 +21,8 @@ public:
std::vector<CObject*>& Object);
void process();
void tank2_fire();
void getShotByRay(object_t &obj_type);
private:
std::vector<CObject*>& m_ObjectVect;
......
......@@ -166,13 +166,13 @@ void CRay::getTouchedBy(CObject &theObject)
{
state = RAY_STATE_SETZAPZOT;
canbezapped = false;
theObject.getShotByRay();
theObject.getShotByRay(owner.obj_type);
}
}
}
}
void CRay::getShotByRay()
void CRay::getShotByRay(object_t &obj_type)
{
state = RAY_STATE_SETZAPZOT;
canbezapped = false;
......
......@@ -25,7 +25,7 @@ public:
void setOwner(object_t type, unsigned int index);
void setSpeed(size_t speed);
void getTouchedBy(CObject &theObject);
void getShotByRay();
void getShotByRay(object_t &obj_type);
bool isFlying();
void setZapped();
void gotZapped();
......
......@@ -48,7 +48,7 @@ void CRope::process()
}
}
void CRope::getShotByRay()
void CRope::getShotByRay(object_t &obj_type)
{
if(state == ROPE_IDLE)
{
......
......@@ -19,7 +19,7 @@ class CRope : public CObject
public:
CRope(CMap *p_map, Uint32 x, Uint32 y);
void process();
void getShotByRay();
void getShotByRay(object_t &obj_type);
void rope_movestone();
void getTouchedBy(CObject &theObject);
......
......@@ -40,7 +40,7 @@ public:
void set_mortimer_surprised(bool yes);
void getTouchedBy(CObject &theObject);
void getShotByRay(){};
void getShotByRay(object_t &obj_type){};
//private:
unsigned int setype;
......
......@@ -139,7 +139,7 @@ void CVortiMom::process()
}
}
void CVortiMom::getShotByRay()
void CVortiMom::getShotByRay(object_t &obj_type)
{
if( state != MOTHER_HURT && HealthPoints>0 )
{
......
......@@ -46,7 +46,7 @@ public:
std::vector<CPlayer>& Player,
std::vector<CObject*>& Object);
void process();
void getShotByRay();
void getShotByRay(object_t &obj_type);
private:
vortimom_actions state;
......
#include "../../../misc.h"
#include "../../../sdl/sound/CSound.h"
#include "../../../graphics/CGfxEngine.h"
#include "../../spritedefines.h"
#include "misc.h"
#include "sdl/sound/CSound.h"
#include "sdl/CVideoDriver.h"
#include "graphics/CGfxEngine.h"
#include "engine/spritedefines.h"
#include "CVorticonElite.h"
#include "CRay.h"
......@@ -291,3 +292,14 @@ void CVorticonElite::initiatejump()
state = VORTELITE_JUMP;
}
void CVorticonElite::getShotByRay(object_t &obj_type)
{
if( !m_invincible && HealthPoints>0 && obj_type != OBJ_GUARDROBOT)
{
if(HealthPoints>1 && g_pVideoDriver->getSpecialFXConfig())
blink(10);
HealthPoints--;
}
}
......@@ -27,6 +27,8 @@ public:
Uint32 x, Uint32 y );
void process();
void initiatejump();
void getShotByRay(object_t &obj_type);
private:
vortelite_actions state;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment