This commit is contained in:
Charles 2001-04-24 22:05:29 +00:00
parent 6be6fdb917
commit be70fbdcfa
9 changed files with 135 additions and 11 deletions

View file

@ -91,7 +91,9 @@ platform_src := platform \
pbob \ pbob \
pfalling \ pfalling \
pcart \ pcart \
pretract pretract \
pbranch \
ppendulm
hazard_src := hazard \ hazard_src := hazard \
hfalling \ hfalling \

View file

@ -162,6 +162,20 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] =
NPC_PLATFORM_TIMER_NONE, NPC_PLATFORM_TIMER_NONE,
}, },
{ // NPC_FISH_HOOK_2_PLATFORM
ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP,
3,
128,
true,
DAMAGE__NONE,
0,
4,
NPC_PLATFORM_INFINITE_LIFE,
0,
NPC_PLATFORM_TIMER_NONE,
},
{ // NPC_PLAYER_BUBBLE_PLATFORM { // NPC_PLAYER_BUBBLE_PLATFORM
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
@ -189,5 +203,6 @@ CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATF
NPC_GEYSER_PLATFORM, NPC_GEYSER_PLATFORM,
NPC_BOBBING_PLATFORM, NPC_BOBBING_PLATFORM,
NPC_CART_PLATFORM, NPC_CART_PLATFORM,
NPC_FISH_HOOK_2_PLATFORM,
NPC_PLAYER_BUBBLE_PLATFORM, NPC_PLAYER_BUBBLE_PLATFORM,
}; };

View file

@ -79,6 +79,10 @@
#include "platform\pfalling.h" #include "platform\pfalling.h"
#endif #endif
#ifndef __PLATFORM_PPENDULM_H__
#include "platform\ppendulm.h"
#endif
#ifndef __PLATFORM_PPLAYER_H__ #ifndef __PLATFORM_PPLAYER_H__
#include "platform\pplayer.h" #include "platform\pplayer.h"
#endif #endif
@ -91,7 +95,6 @@ class CLayerCollision *CNpcPlatform::m_layerCollision;
CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform) CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
{ {
int pointNum;
CNpcPlatform *platform; CNpcPlatform *platform;
NPC_PLATFORM_UNIT_TYPE platformType = getTypeFromMapEdit( ThisPlatform->Type ); NPC_PLATFORM_UNIT_TYPE platformType = getTypeFromMapEdit( ThisPlatform->Type );
@ -152,8 +155,15 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
break; break;
} }
case NPC_FISH_HOOK_2_PLATFORM:
{
platform = new ("fish hook 2 platform") CNpcPendulumPlatform;
break;
}
default: default:
{ {
ASSERT( 0 );
platform = new ("platform") CNpcPlatform; platform = new ("platform") CNpcPlatform;
break; break;
} }
@ -161,6 +171,20 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
ASSERT(platform); ASSERT(platform);
platform->setType( platformType ); platform->setType( platformType );
platform->setGraphic( ThisPlatform );
platform->setWaypoints( ThisPlatform );
platform->setTiltable( false );
return( platform );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcPlatform::setWaypoints( sThingPlatform *ThisPlatform )
{
int pointNum;
u16 *PntList=(u16*)MakePtr(ThisPlatform,sizeof(sThingPlatform)); u16 *PntList=(u16*)MakePtr(ThisPlatform,sizeof(sThingPlatform));
@ -175,10 +199,9 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
startPos.vx = newXPos << 4; startPos.vx = newXPos << 4;
startPos.vy = newYPos << 4; startPos.vy = newYPos << 4;
platform->init( startPos ); init( startPos );
platform->setTiltable( false );
platform->addWaypoint( newXPos, newYPos ); addWaypoint( newXPos, newYPos );
if ( ThisPlatform->PointCount > 1 ) if ( ThisPlatform->PointCount > 1 )
{ {
@ -189,11 +212,17 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
newYPos = (u16) *PntList; newYPos = (u16) *PntList;
PntList++; PntList++;
platform->addWaypoint( newXPos, newYPos ); addWaypoint( newXPos, newYPos );
}
} }
} }
return( platform ); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcPlatform::setGraphic( sThingPlatform *ThisPlatform )
{
m_modelGfx = new ("ModelGfx") CModelGfx;
m_modelGfx->SetModel( ThisPlatform->Gfx );
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -203,9 +232,6 @@ void CNpcPlatform::init()
CPlatformThing::init(); CPlatformThing::init();
m_modelGfx=new ("ModelGfx") CModelGfx;
m_modelGfx->SetModel(0);
m_animPlaying = true; m_animPlaying = true;
m_animNo = m_data[m_type].initAnim; m_animNo = m_data[m_type].initAnim;
m_frame = 0; m_frame = 0;

View file

@ -52,6 +52,7 @@ public:
NPC_BOBBING_PLATFORM, NPC_BOBBING_PLATFORM,
NPC_FALLING_PLATFORM, NPC_FALLING_PLATFORM,
NPC_CART_PLATFORM, NPC_CART_PLATFORM,
NPC_FISH_HOOK_2_PLATFORM,
NPC_PLAYER_BUBBLE_PLATFORM, NPC_PLAYER_BUBBLE_PLATFORM,
NPC_PLATFORM_TYPE_MAX, NPC_PLATFORM_TYPE_MAX,
}; };
@ -70,6 +71,8 @@ public:
virtual s32 getNewYPos( CThing *_thisThing ); virtual s32 getNewYPos( CThing *_thisThing );
void setTiltable( bool isTiltable ); void setTiltable( bool isTiltable );
void addWaypoint( s32 xPos, s32 yPos ); void addWaypoint( s32 xPos, s32 yPos );
void setGraphic( sThingPlatform *ThisPlatform );
virtual void setWaypoints( sThingPlatform *ThisPlatform );
static NPC_PLATFORM_UNIT_TYPE getTypeFromMapEdit( u16 newType ); static NPC_PLATFORM_UNIT_TYPE getTypeFromMapEdit( u16 newType );
static CNpcPlatform *Create(sThingPlatform *ThisPlatform); static CNpcPlatform *Create(sThingPlatform *ThisPlatform);
@ -91,6 +94,16 @@ protected:
NPC_PLATFORM_TIMER_RESPAWN = 1, NPC_PLATFORM_TIMER_RESPAWN = 1,
}; };
enum
{
EXTEND_UP = true,
EXTEND_DOWN = false,
EXTEND_RIGHT = true,
EXTEND_LEFT = false,
EXTEND_CLOCKWISE = true,
EXTEND_ANTICLOCKWISE = false,
};
typedef struct NPC_PLATFORM_DATA_TYPE typedef struct NPC_PLATFORM_DATA_TYPE
{ {
FileEquate ActorType; FileEquate ActorType;
@ -157,6 +170,7 @@ protected:
bool m_tiltable; bool m_tiltable;
s32 m_tiltAngle; s32 m_tiltAngle;
s32 m_tiltVelocity; s32 m_tiltVelocity;
bool m_extendDir;
int m_frame; int m_frame;
int m_animNo; int m_animNo;

View file

@ -15,14 +15,53 @@
#include "platform\ppendulm.h" #include "platform\ppendulm.h"
#endif #endif
#ifndef __UTILS_HEADER__
#include "utils\utils.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcPendulumPlatform::postInit() void CNpcPendulumPlatform::postInit()
{ {
m_extendDir = EXTEND_LEFT; m_extendDir = EXTEND_LEFT;
m_extension = 0; m_extension = 0;
m_heading = 1024; m_heading = 1024;
m_length = 200;
} }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcPendulumPlatform::setWaypoints( sThingPlatform *ThisPlatform )
{
int pointNum;
u16 *PntList=(u16*)MakePtr(ThisPlatform,sizeof(sThingPlatform));
u16 initYPos, newXPos, newYPos;
newXPos = (u16) *PntList;
PntList++;
initYPos = newYPos = (u16) *PntList;
PntList++;
DVECTOR startPos;
startPos.vx = newXPos << 4;
startPos.vy = newYPos << 4;
init( startPos );
if ( ThisPlatform->PointCount > 1 )
{
newXPos = (u16) *PntList;
PntList++;
newYPos = (u16) *PntList;
PntList++;
m_length = ( newYPos - initYPos ) << 4;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcPendulumPlatform::processMovement( int _frames ) void CNpcPendulumPlatform::processMovement( int _frames )
{ {
if ( m_extendDir == EXTEND_LEFT ) if ( m_extendDir == EXTEND_LEFT )

View file

@ -23,6 +23,7 @@ class CNpcPendulumPlatform : public CNpcPlatform
public: public:
virtual void postInit(); virtual void postInit();
protected: protected:
virtual void setWaypoints( sThingPlatform *ThisPlatform );
virtual void processMovement( int _frames ); virtual void processMovement( int _frames );
s32 m_length; s32 m_length;

View file

@ -80,6 +80,9 @@ Bubble=0
Jellyfish=1 Jellyfish=1
Industrial=1 Industrial=1
Leaf=2 Leaf=2
FishHook1=5
FishHook2=5
SwingingFishHook=10
################################################ ################################################
# Triggers # Triggers

View file

@ -18,3 +18,11 @@ Gfx=..\..\Graphics\platforms\Industrial\Industrial.gin
[Leaf] [Leaf]
Gfx=..\..\Graphics\platforms\Leaf\Leaf.gin Gfx=..\..\Graphics\platforms\Leaf\Leaf.gin
[FishHook1]
Gfx=..\..\Graphics\platforms\FishHook1\FishHook1.gin
[FishHook2]
Gfx=..\..\Graphics\platforms\FishHook2\FishHook2.gin
[SwingingFishHook]
Gfx=..\..\Graphics\platforms\FishHook3\FishHook3.gin

View file

@ -1369,6 +1369,14 @@ SOURCE=..\..\..\source\platform\pbob.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\source\platform\pbranch.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\pbranch.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\pbubble.cpp SOURCE=..\..\..\source\platform\pbubble.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -1441,6 +1449,14 @@ SOURCE=..\..\..\source\platform\plinear.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\source\platform\ppendulm.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\ppendulm.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\pplayer.h SOURCE=..\..\..\source\platform\pplayer.h
# End Source File # End Source File
# Begin Source File # Begin Source File