This commit is contained in:
parent
85f401edf0
commit
773d29ea89
@ -152,7 +152,8 @@ hazard_src := hazard \
|
|||||||
hrwheel \
|
hrwheel \
|
||||||
hpswitch \
|
hpswitch \
|
||||||
hrckshrd \
|
hrckshrd \
|
||||||
hinert
|
hinert \
|
||||||
|
hcswitch
|
||||||
|
|
||||||
fx_src := fx \
|
fx_src := fx \
|
||||||
fxbaseanim \
|
fxbaseanim \
|
||||||
@ -303,7 +304,8 @@ triggers_src := trigger \
|
|||||||
tifemit \
|
tifemit \
|
||||||
tggleft \
|
tggleft \
|
||||||
tggright \
|
tggright \
|
||||||
tgstop
|
tgstop \
|
||||||
|
thazard
|
||||||
|
|
||||||
utils_src := utils \
|
utils_src := utils \
|
||||||
sincos \
|
sincos \
|
||||||
|
@ -82,7 +82,7 @@ CFXBaseAnim::sFXAnim FXExplodeData=
|
|||||||
|
|
||||||
CFXBaseAnim::sFXAnim FXFireData=
|
CFXBaseAnim::sFXAnim FXFireData=
|
||||||
{
|
{
|
||||||
ONE << 1,
|
ONE,
|
||||||
FRM__FIRE01,FRM__FIRE06,
|
FRM__FIRE01,FRM__FIRE06,
|
||||||
1,
|
1,
|
||||||
127,127,127,
|
127,127,127,
|
||||||
|
@ -19,7 +19,8 @@ void CFXBaseAnim::init(DVECTOR const &_Pos)
|
|||||||
{
|
{
|
||||||
CFX::init(_Pos);
|
CFX::init(_Pos);
|
||||||
CurrentFrame=0;
|
CurrentFrame=0;
|
||||||
CurrentScale=DataPtr->Scale;
|
CurrentScaleX=CurrentScaleY=DataPtr->Scale;
|
||||||
|
CurrentHeading = 0;
|
||||||
MaxFrame=((DataPtr->EndFrame-DataPtr->StartFrame)<<DataPtr->FrameShift)-1;
|
MaxFrame=((DataPtr->EndFrame-DataPtr->StartFrame)<<DataPtr->FrameShift)-1;
|
||||||
if (DataPtr->Flags & FXANIM_FLAG_LOOP)
|
if (DataPtr->Flags & FXANIM_FLAG_LOOP)
|
||||||
{ // Looping Anim, so let it live forever!
|
{ // Looping Anim, so let it live forever!
|
||||||
@ -100,7 +101,8 @@ DVECTOR RenderPos;
|
|||||||
|
|
||||||
SpriteBank *SprBank=CGameScene::getSpriteBank();
|
SpriteBank *SprBank=CGameScene::getSpriteBank();
|
||||||
|
|
||||||
POLY_FT4 *Ft4=SprBank->printFT4Scaled(renderFrame,RenderPos.vx,RenderPos.vy,0,0,OtPos*0,CurrentScale>>4);
|
//POLY_FT4 *Ft4=SprBank->printFT4Scaled(renderFrame,RenderPos.vx,RenderPos.vy,0,0,OtPos*0,CurrentScale>>4);
|
||||||
|
POLY_FT4 *Ft4=SprBank->printRotatedScaledSprite(renderFrame,RenderPos.vx,RenderPos.vy,CurrentScaleX,CurrentScaleY,CurrentHeading,OtPos*0);
|
||||||
Ft4->u1--; Ft4->u3--;
|
Ft4->u1--; Ft4->u3--;
|
||||||
Ft4->v2--; Ft4->v3--;
|
Ft4->v2--; Ft4->v3--;
|
||||||
setShadeTex(Ft4,0);
|
setShadeTex(Ft4,0);
|
||||||
|
@ -36,7 +36,10 @@ virtual void killFX();
|
|||||||
|
|
||||||
void setData(void *Data) {DataPtr=(sFXAnim*)Data;}
|
void setData(void *Data) {DataPtr=(sFXAnim*)Data;}
|
||||||
|
|
||||||
virtual void SetScale(int S) {CurrentScale=S;}
|
virtual void SetScale(int S) {CurrentScaleX=CurrentScaleY=S;}
|
||||||
|
virtual void SetScaleX(int S) {CurrentScaleX=S;}
|
||||||
|
virtual void SetScaleY(int S) {CurrentScaleY=S;}
|
||||||
|
virtual void SetHeading(int H) {CurrentHeading=H;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
sFXAnim *DataPtr;
|
sFXAnim *DataPtr;
|
||||||
@ -44,7 +47,9 @@ protected:
|
|||||||
s16 MaxFrame;
|
s16 MaxFrame;
|
||||||
s16 CurrentFrame;
|
s16 CurrentFrame;
|
||||||
u16 renderFrame;
|
u16 renderFrame;
|
||||||
s16 CurrentScale;
|
s32 CurrentScaleX;
|
||||||
|
s32 CurrentScaleY;
|
||||||
|
s16 CurrentHeading;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,7 +21,7 @@ void CFXBubble::init(DVECTOR const &_Pos)
|
|||||||
CFXBaseAnim::init(_Pos);
|
CFXBaseAnim::init(_Pos);
|
||||||
Life=32+getRndRange(63);
|
Life=32+getRndRange(63);
|
||||||
VelY=-getRndRange(4)-1;
|
VelY=-getRndRange(4)-1;
|
||||||
CurrentScale=getRndRange(DataPtr->Scale/2)+(DataPtr->Scale/2);
|
CurrentScaleX=CurrentScaleY=getRndRange(DataPtr->Scale/2)+(DataPtr->Scale/2);
|
||||||
Die=0;
|
Die=0;
|
||||||
XIdx=getRnd()&15;
|
XIdx=getRnd()&15;
|
||||||
|
|
||||||
|
@ -115,6 +115,10 @@
|
|||||||
#include "hazard\hinert.h"
|
#include "hazard\hinert.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __HAZARD_HCSWITCH_H__
|
||||||
|
#include "hazard\hcswitch.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@ -141,6 +145,7 @@ CNpcHazard::NPC_HAZARD_UNIT_TYPE CNpcHazard::mapEditConvertTable[NPC_HAZARD_TYPE
|
|||||||
NPC_PRESSURE_SWITCH_HAZARD,
|
NPC_PRESSURE_SWITCH_HAZARD,
|
||||||
NPC_ROCKSHARD_HAZARD,
|
NPC_ROCKSHARD_HAZARD,
|
||||||
NPC_INERT_HAZARD,
|
NPC_INERT_HAZARD,
|
||||||
|
NPC_CONVEYOR_SWITCH_HAZARD,
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -279,6 +284,12 @@ CNpcHazard *hazard;
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case NPC_CONVEYOR_SWITCH_HAZARD:
|
||||||
|
{
|
||||||
|
hazard = new ("conveyor switch hazard") CNpcConveyorSwitchHazard;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
hazard = NULL;
|
hazard = NULL;
|
||||||
|
@ -60,6 +60,7 @@ public:
|
|||||||
NPC_PRESSURE_SWITCH_HAZARD,
|
NPC_PRESSURE_SWITCH_HAZARD,
|
||||||
NPC_ROCKSHARD_HAZARD,
|
NPC_ROCKSHARD_HAZARD,
|
||||||
NPC_INERT_HAZARD,
|
NPC_INERT_HAZARD,
|
||||||
|
NPC_CONVEYOR_SWITCH_HAZARD,
|
||||||
|
|
||||||
NPC_HAZARD_TYPE_MAX,
|
NPC_HAZARD_TYPE_MAX,
|
||||||
};
|
};
|
||||||
@ -77,6 +78,7 @@ public:
|
|||||||
void setWaypointPtr( u16 *newPtr ) {m_npcPath.setWaypointPtr( newPtr );}
|
void setWaypointPtr( u16 *newPtr ) {m_npcPath.setWaypointPtr( newPtr );}
|
||||||
void setWaypointCount( u8 newCount ) {m_npcPath.setWaypointCount( newCount );}
|
void setWaypointCount( u8 newCount ) {m_npcPath.setWaypointCount( newCount );}
|
||||||
virtual void setRespawnRate( s16 newRespawnRate ) {m_respawnRate=newRespawnRate;}
|
virtual void setRespawnRate( s16 newRespawnRate ) {m_respawnRate=newRespawnRate;}
|
||||||
|
virtual void trigger() {}
|
||||||
|
|
||||||
static NPC_HAZARD_UNIT_TYPE getTypeFromMapEdit( u16 newType );
|
static NPC_HAZARD_UNIT_TYPE getTypeFromMapEdit( u16 newType );
|
||||||
static CNpcHazard *Create(int Type);
|
static CNpcHazard *Create(int Type);
|
||||||
|
@ -27,6 +27,26 @@ void CFlameEmitterTrigger::setPositionAndSize(int _x,int _y,int _w,int _h)
|
|||||||
CTrigger::setPositionAndSize( _x, _y, _w, _h );
|
CTrigger::setPositionAndSize( _x, _y, _w, _h );
|
||||||
|
|
||||||
m_effect = CFX::Create( CFX::FX_TYPE_FLAMES, Pos );
|
m_effect = CFX::Create( CFX::FX_TYPE_FLAMES, Pos );
|
||||||
|
CFXBaseAnim *m_animEffect = (CFXBaseAnim *) m_effect;
|
||||||
|
m_animEffect->SetScaleX( ( _w * ONE ) >> 5 );
|
||||||
|
m_animEffect->SetScaleY( ( _h * ONE ) >> 5 );
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CFlameEmitterTrigger::setHeading(int newHeading)
|
||||||
|
{
|
||||||
|
CFXBaseAnim *m_animEffect = (CFXBaseAnim *) m_effect;
|
||||||
|
m_animEffect->SetHeading( newHeading );
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CFlameEmitterTrigger::setSize( int _w, int _h )
|
||||||
|
{
|
||||||
|
CFXBaseAnim *m_animEffect = (CFXBaseAnim *) m_effect;
|
||||||
|
m_animEffect->SetScaleX( ( _w * ONE ) >> 5 );
|
||||||
|
m_animEffect->SetScaleY( ( _h * ONE ) >> 5 );
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "fx\fx.h"
|
#include "fx\fx.h"
|
||||||
|
#include "fx\fxbaseanim.h"
|
||||||
|
|
||||||
/* Std Lib
|
/* Std Lib
|
||||||
------- */
|
------- */
|
||||||
@ -43,6 +44,8 @@ class CFlameEmitterTrigger : public CTrigger
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void setPositionAndSize(int _x,int _y,int _w,int _h);
|
virtual void setPositionAndSize(int _x,int _y,int _w,int _h);
|
||||||
|
void setHeading(int newHeading);
|
||||||
|
void setSize( int _w, int _h );
|
||||||
protected:
|
protected:
|
||||||
virtual void collidedWith(CThing *_thisThing);
|
virtual void collidedWith(CThing *_thisThing);
|
||||||
CFX *m_effect;
|
CFX *m_effect;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
tplatfrm.cpp
|
tplatfrm.cpp
|
||||||
|
|
||||||
Author: PKG
|
Author: CRB
|
||||||
Created:
|
Created:
|
||||||
Project: Spongebob
|
Project: Spongebob
|
||||||
Purpose:
|
Purpose:
|
||||||
|
@ -67,6 +67,10 @@
|
|||||||
#include "triggers\tgstop.h"
|
#include "triggers\tgstop.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __TRIGGERS_THAZARD_H__
|
||||||
|
#include "triggers\thazard.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __GAME_GAME_H__
|
#ifndef __GAME_GAME_H__
|
||||||
#include "game\game.h"
|
#include "game\game.h"
|
||||||
#endif
|
#endif
|
||||||
@ -135,6 +139,8 @@ CTrigger *trigger;
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TRIGGER_INTERMITTENTFLAMEEMITTER:
|
case TRIGGER_INTERMITTENTFLAMEEMITTER:
|
||||||
|
case TRIGGER_INTERMITTENTLEFTFLAMEEMITTER:
|
||||||
|
case TRIGGER_INTERMITTENTDOWNFLAMEEMITTER:
|
||||||
trigger=(CIntermittentFlameEmitterTrigger*)new( "IntermittentFlameEmitterTrigger") CIntermittentFlameEmitterTrigger();
|
trigger=(CIntermittentFlameEmitterTrigger*)new( "IntermittentFlameEmitterTrigger") CIntermittentFlameEmitterTrigger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -146,6 +152,11 @@ CTrigger *trigger;
|
|||||||
case TRIGGER_PLATFORM:
|
case TRIGGER_PLATFORM:
|
||||||
trigger = (CPlatformTrigger*)new ("PlatformTrigger") CPlatformTrigger();
|
trigger = (CPlatformTrigger*)new ("PlatformTrigger") CPlatformTrigger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TRIGGER_HAZARD:
|
||||||
|
trigger = (CHazardTrigger*)new("HazardTrigger") CHazardTrigger();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
trigger=NULL;
|
trigger=NULL;
|
||||||
}
|
}
|
||||||
@ -161,9 +172,35 @@ CTrigger *trigger;
|
|||||||
CTrigger *CTrigger::Create(sThingTrigger *ThisTrigger)
|
CTrigger *CTrigger::Create(sThingTrigger *ThisTrigger)
|
||||||
{
|
{
|
||||||
CTrigger *trigger=Create(ThisTrigger->Type);
|
CTrigger *trigger=Create(ThisTrigger->Type);
|
||||||
|
|
||||||
trigger->setPositionAndSize(ThisTrigger->Pos.X<<4,ThisTrigger->Pos.Y<<4,ThisTrigger->Width<<4,ThisTrigger->Height<<4);
|
trigger->setPositionAndSize(ThisTrigger->Pos.X<<4,ThisTrigger->Pos.Y<<4,ThisTrigger->Width<<4,ThisTrigger->Height<<4);
|
||||||
trigger->setTargetBox(ThisTrigger->TargetPos.X<<4,ThisTrigger->TargetPos.Y<<4,ThisTrigger->TargetSize.X<<4,ThisTrigger->TargetSize.Y<<4);
|
trigger->setTargetBox(ThisTrigger->TargetPos.X<<4,ThisTrigger->TargetPos.Y<<4,ThisTrigger->TargetSize.X<<4,ThisTrigger->TargetSize.Y<<4);
|
||||||
|
|
||||||
|
switch( ThisTrigger->Type )
|
||||||
|
{
|
||||||
|
case TRIGGER_INTERMITTENTLEFTFLAMEEMITTER:
|
||||||
|
{
|
||||||
|
CIntermittentFlameEmitterTrigger *m_flameEmitter = (CIntermittentFlameEmitterTrigger *) trigger;
|
||||||
|
|
||||||
|
m_flameEmitter->setHeading( 3072 );
|
||||||
|
m_flameEmitter->setSize( ThisTrigger->Height<<4, ThisTrigger->Width<<4 );
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case TRIGGER_INTERMITTENTDOWNFLAMEEMITTER:
|
||||||
|
{
|
||||||
|
CIntermittentFlameEmitterTrigger *m_flameEmitter = (CIntermittentFlameEmitterTrigger *) trigger;
|
||||||
|
|
||||||
|
m_flameEmitter->setHeading( 2048 );
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return( trigger);
|
return( trigger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,9 +36,12 @@ enum TRIGGER_TYPE
|
|||||||
TRIGGER_GARYGOLEFT,
|
TRIGGER_GARYGOLEFT,
|
||||||
TRIGGER_GARYGORIGHT,
|
TRIGGER_GARYGORIGHT,
|
||||||
TRIGGER_BUBBLEEMITTER,
|
TRIGGER_BUBBLEEMITTER,
|
||||||
|
TRIGGER_INTERMITTENTLEFTFLAMEEMITTER,
|
||||||
|
TRIGGER_INTERMITTENTDOWNFLAMEEMITTER,
|
||||||
|
|
||||||
// Code based triggers
|
// Code based triggers
|
||||||
TRIGGER_PLATFORM,
|
TRIGGER_PLATFORM,
|
||||||
|
TRIGGER_HAZARD,
|
||||||
TRIGGER_MAX,
|
TRIGGER_MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -138,6 +138,8 @@ GaryStop=9
|
|||||||
GaryGoLeft=10
|
GaryGoLeft=10
|
||||||
GaryGoRight=11
|
GaryGoRight=11
|
||||||
BubbleEmitter=12
|
BubbleEmitter=12
|
||||||
|
IntermittentLeftFlameEmitter=13
|
||||||
|
IntermittentDownFlameEmitter=14
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
# FX
|
# FX
|
||||||
@ -173,3 +175,4 @@ PressureSwitch=18
|
|||||||
SingleSpike=19
|
SingleSpike=19
|
||||||
CheckPoint=20
|
CheckPoint=20
|
||||||
WaterBucket=20
|
WaterBucket=20
|
||||||
|
ConveyorSwitch=21
|
@ -259,3 +259,13 @@ Collision=0
|
|||||||
Health=0
|
Health=0
|
||||||
AttackStrength=0
|
AttackStrength=0
|
||||||
Respawn=1
|
Respawn=1
|
||||||
|
|
||||||
|
[ConveyorSwitch]
|
||||||
|
Gfx=..\..\graphics\hazards\water_bucket\water_bucket.gin
|
||||||
|
WayPoints=0
|
||||||
|
Speed=0
|
||||||
|
TurnRate=0
|
||||||
|
Collision=0
|
||||||
|
Health=0
|
||||||
|
AttackStrength=0
|
||||||
|
Respawn=1
|
||||||
|
@ -25,6 +25,10 @@ HasBox=1
|
|||||||
|
|
||||||
[IntermittentFlameEmitter]
|
[IntermittentFlameEmitter]
|
||||||
|
|
||||||
|
[IntermittentLeftFlameEmitter]
|
||||||
|
|
||||||
|
[IntermittentDownFlameEmitter]
|
||||||
|
|
||||||
[BubbleEmitter]
|
[BubbleEmitter]
|
||||||
|
|
||||||
[GaryStop]
|
[GaryStop]
|
||||||
|
@ -857,6 +857,14 @@ SOURCE=..\..\..\source\hazard\hcsaw.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\hazard\hcswitch.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\hazard\hcswitch.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\..\source\hazard\hdbarrel.cpp
|
SOURCE=..\..\..\source\hazard\hdbarrel.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@ -1965,6 +1973,14 @@ SOURCE=..\..\..\source\triggers\tgstop.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\triggers\thazard.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\triggers\thazard.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\..\source\triggers\tifemit.cpp
|
SOURCE=..\..\..\source\triggers\tifemit.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
Loading…
Reference in New Issue
Block a user