This commit is contained in:
parent
25de06c1a6
commit
0512dd7aab
14 changed files with 225 additions and 5 deletions
|
@ -299,6 +299,7 @@ triggers_src := trigger \
|
|||
tfemit \
|
||||
tifemit \
|
||||
tggleft \
|
||||
tggright \
|
||||
tgstop
|
||||
|
||||
utils_src := utils \
|
||||
|
|
|
@ -179,3 +179,13 @@ void CNpcGaryFriend::startLeft()
|
|||
m_extension = EXTEND_LEFT;
|
||||
m_reversed = true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcGaryFriend::startRight()
|
||||
{
|
||||
start();
|
||||
|
||||
m_extension = EXTEND_RIGHT;
|
||||
m_reversed = false;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ public:
|
|||
void start() {m_started = true;}
|
||||
void stop() {m_started = false;}
|
||||
void startLeft();
|
||||
void startRight();
|
||||
virtual void render();
|
||||
|
||||
protected:
|
||||
|
|
|
@ -58,7 +58,7 @@ protected:
|
|||
|
||||
/*---------------------------------------------------------------------- */
|
||||
|
||||
#endif /* __TRIGGERS_TLEVEXIT_H__ */
|
||||
#endif
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
||||
|
|
|
@ -62,7 +62,7 @@ protected:
|
|||
|
||||
/*---------------------------------------------------------------------- */
|
||||
|
||||
#endif /* __TRIGGERS_TPLATFRM_H__ */
|
||||
#endif
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
||||
|
|
|
@ -54,7 +54,7 @@ protected:
|
|||
|
||||
/*---------------------------------------------------------------------- */
|
||||
|
||||
#endif /* __TRIGGERS_TPLATFRM_H__ */
|
||||
#endif
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
||||
|
|
127
source/triggers/tggright.cpp
Normal file
127
source/triggers/tggright.cpp
Normal file
|
@ -0,0 +1,127 @@
|
|||
/*=========================================================================
|
||||
|
||||
tggright.cpp
|
||||
|
||||
Author: CRB
|
||||
Created:
|
||||
Project: Spongebob
|
||||
Purpose:
|
||||
|
||||
Copyright (c) 2001 Climax Development Ltd
|
||||
|
||||
===========================================================================*/
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Includes
|
||||
-------- */
|
||||
|
||||
#include "triggers\trigger.h"
|
||||
#include "triggers\tggright.h"
|
||||
|
||||
#ifndef __GAME_GAME_H__
|
||||
#include "game\game.h"
|
||||
#endif
|
||||
|
||||
#ifndef __FRIEND_FRIEND_H__
|
||||
#include "friend\friend.h"
|
||||
#endif
|
||||
|
||||
#ifndef __FRIEND_FGARY_H__
|
||||
#include "friend\fgary.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
||||
/* Data
|
||||
---- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Tyepdefs && Defines
|
||||
------------------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Structure defintions
|
||||
-------------------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function Prototypes
|
||||
------------------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Vars
|
||||
---- */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
#if defined (__USER_art__) || defined (__USER_sbart__)
|
||||
#include "gfx\prim.h"
|
||||
void CGaryGoRightTrigger::render()
|
||||
{
|
||||
DVECTOR ofs;
|
||||
CRECT area;
|
||||
|
||||
CTriggerThing::render();
|
||||
|
||||
ofs=CLevel::getCameraPos();
|
||||
area=getCollisionArea();
|
||||
area.x1-=ofs.vx;
|
||||
area.y1-=ofs.vy;
|
||||
area.x2-=ofs.vx;
|
||||
area.y2-=ofs.vy;
|
||||
|
||||
if(area.x1<=511&&area.x2>=0&&
|
||||
area.y1<=255&&area.y2>=0)
|
||||
{
|
||||
POLY_F4 *f4;
|
||||
f4=GetPrimF4();
|
||||
setXY4(f4,area.x1,area.y1,
|
||||
area.x2,area.y1,
|
||||
area.x1,area.y2,
|
||||
area.x2,area.y2);
|
||||
setRGB0(f4,0,255,0);
|
||||
setSemiTrans(f4,true);
|
||||
AddPrimToList(f4,0);
|
||||
DrawLine(area.x1,area.y1,area.x2,area.y1,0,255,0,0);
|
||||
DrawLine(area.x2,area.y1,area.x2,area.y2,0,255,0,0);
|
||||
DrawLine(area.x2,area.y2,area.x1,area.y2,0,255,0,0);
|
||||
DrawLine(area.x1,area.y2,area.x1,area.y1,0,255,0,0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CGaryGoRightTrigger::collidedWith(CThing *_thisThing)
|
||||
{
|
||||
switch( _thisThing->getThingType() )
|
||||
{
|
||||
case TYPE_NPC:
|
||||
{
|
||||
if ( _thisThing->getThingSubType() == CNpcFriend::NPC_FRIEND_GARY )
|
||||
{
|
||||
CNpcGaryFriend *gary = (CNpcGaryFriend *) _thisThing;
|
||||
|
||||
gary->startRight();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
60
source/triggers/tggright.h
Normal file
60
source/triggers/tggright.h
Normal file
|
@ -0,0 +1,60 @@
|
|||
/*=========================================================================
|
||||
|
||||
tggright.h
|
||||
|
||||
Author: Charles Blair
|
||||
Created:
|
||||
Project: Spongebob
|
||||
Purpose:
|
||||
|
||||
Copyright (c) 2001 Climax Development Ltd
|
||||
|
||||
===========================================================================*/
|
||||
|
||||
#ifndef __TRIGGERS_TGGRIGHT_H__
|
||||
#define __TRIGGERS_TGGRIGHT_H__
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Includes
|
||||
-------- */
|
||||
|
||||
#ifndef __THING_THING_H__
|
||||
#include "thing/thing.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Tyepdefs && Defines
|
||||
------------------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Structure defintions
|
||||
-------------------- */
|
||||
|
||||
class CGaryGoRightTrigger : public CTrigger
|
||||
{
|
||||
public:
|
||||
#if defined (__USER_art__) || defined (__USER_sbart__)
|
||||
virtual void render();
|
||||
#endif
|
||||
protected:
|
||||
virtual void collidedWith(CThing *_thisThing);
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Globals
|
||||
------- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Functions
|
||||
--------- */
|
||||
|
||||
/*---------------------------------------------------------------------- */
|
||||
|
||||
#endif
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
|
@ -54,7 +54,7 @@ protected:
|
|||
|
||||
/*---------------------------------------------------------------------- */
|
||||
|
||||
#endif /* __TRIGGERS_TPLATFRM_H__ */
|
||||
#endif
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
||||
|
|
|
@ -55,6 +55,10 @@
|
|||
#include "triggers\tggleft.h"
|
||||
#endif
|
||||
|
||||
#ifndef __TRIGGERS_TGGRIGHT_H__
|
||||
#include "triggers\tggright.h"
|
||||
#endif
|
||||
|
||||
#ifndef __TRIGGERS_TGSTOP_H__
|
||||
#include "triggers\tgstop.h"
|
||||
#endif
|
||||
|
@ -121,6 +125,11 @@ CTrigger *trigger;
|
|||
trigger=(CGaryGoLeftTrigger*)new("GaryGoLeftTrigger") CGaryGoLeftTrigger();
|
||||
break;
|
||||
|
||||
// Gary go right trigger
|
||||
case TRIGGER_GARYGORIGHT:
|
||||
trigger=(CGaryGoRightTrigger*)new("GaryGoRightTrigger") CGaryGoRightTrigger();
|
||||
break;
|
||||
|
||||
case TRIGGER_INTERMITTENTFLAMEEMITTER:
|
||||
trigger=(CIntermittentFlameEmitterTrigger*)new( "IntermittentFlameEmitterTrigger") CIntermittentFlameEmitterTrigger();
|
||||
break;
|
||||
|
|
|
@ -34,6 +34,7 @@ enum TRIGGER_TYPE
|
|||
TRIGGER_INTERMITTENTFLAMEEMITTER,
|
||||
TRIGGER_GARYSTOP,
|
||||
TRIGGER_GARYGOLEFT,
|
||||
TRIGGER_GARYGORIGHT,
|
||||
|
||||
// Code based triggers
|
||||
TRIGGER_PLATFORM,
|
||||
|
|
|
@ -136,6 +136,7 @@ FlameEmitter=7
|
|||
IntermittentFlameEmitter=8
|
||||
GaryStop=9
|
||||
GaryGoLeft=10
|
||||
GaryGoRight=11
|
||||
|
||||
################################################
|
||||
# FX
|
||||
|
|
|
@ -28,3 +28,5 @@ HasBox=1
|
|||
[GaryStop]
|
||||
|
||||
[GaryGoLeft]
|
||||
|
||||
[GaryGoRight]
|
|
@ -1941,6 +1941,14 @@ SOURCE=..\..\..\source\triggers\tggleft.h
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\triggers\tggright.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\triggers\tggright.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\triggers\tgstop.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue