This commit is contained in:
parent
6be6fdb917
commit
be70fbdcfa
9 changed files with 135 additions and 11 deletions
|
@ -91,7 +91,9 @@ platform_src := platform \
|
|||
pbob \
|
||||
pfalling \
|
||||
pcart \
|
||||
pretract
|
||||
pretract \
|
||||
pbranch \
|
||||
ppendulm
|
||||
|
||||
hazard_src := hazard \
|
||||
hfalling \
|
||||
|
|
|
@ -162,6 +162,20 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] =
|
|||
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
|
||||
ACTORS_CLAM_SBK,
|
||||
ANIM_CLAM_SIDESNAP,
|
||||
|
@ -189,5 +203,6 @@ CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATF
|
|||
NPC_GEYSER_PLATFORM,
|
||||
NPC_BOBBING_PLATFORM,
|
||||
NPC_CART_PLATFORM,
|
||||
NPC_FISH_HOOK_2_PLATFORM,
|
||||
NPC_PLAYER_BUBBLE_PLATFORM,
|
||||
};
|
||||
|
|
|
@ -79,6 +79,10 @@
|
|||
#include "platform\pfalling.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLATFORM_PPENDULM_H__
|
||||
#include "platform\ppendulm.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLATFORM_PPLAYER_H__
|
||||
#include "platform\pplayer.h"
|
||||
#endif
|
||||
|
@ -91,7 +95,6 @@ class CLayerCollision *CNpcPlatform::m_layerCollision;
|
|||
|
||||
CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
|
||||
{
|
||||
int pointNum;
|
||||
CNpcPlatform *platform;
|
||||
|
||||
NPC_PLATFORM_UNIT_TYPE platformType = getTypeFromMapEdit( ThisPlatform->Type );
|
||||
|
@ -152,8 +155,15 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
|
|||
break;
|
||||
}
|
||||
|
||||
case NPC_FISH_HOOK_2_PLATFORM:
|
||||
{
|
||||
platform = new ("fish hook 2 platform") CNpcPendulumPlatform;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
ASSERT( 0 );
|
||||
platform = new ("platform") CNpcPlatform;
|
||||
break;
|
||||
}
|
||||
|
@ -161,6 +171,20 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
|
|||
|
||||
ASSERT(platform);
|
||||
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));
|
||||
|
||||
|
@ -175,10 +199,9 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
|
|||
startPos.vx = newXPos << 4;
|
||||
startPos.vy = newYPos << 4;
|
||||
|
||||
platform->init( startPos );
|
||||
platform->setTiltable( false );
|
||||
init( startPos );
|
||||
|
||||
platform->addWaypoint( newXPos, newYPos );
|
||||
addWaypoint( newXPos, newYPos );
|
||||
|
||||
if ( ThisPlatform->PointCount > 1 )
|
||||
{
|
||||
|
@ -189,11 +212,17 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
|
|||
newYPos = (u16) *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();
|
||||
|
||||
|
||||
m_modelGfx=new ("ModelGfx") CModelGfx;
|
||||
m_modelGfx->SetModel(0);
|
||||
|
||||
m_animPlaying = true;
|
||||
m_animNo = m_data[m_type].initAnim;
|
||||
m_frame = 0;
|
||||
|
|
|
@ -52,6 +52,7 @@ public:
|
|||
NPC_BOBBING_PLATFORM,
|
||||
NPC_FALLING_PLATFORM,
|
||||
NPC_CART_PLATFORM,
|
||||
NPC_FISH_HOOK_2_PLATFORM,
|
||||
NPC_PLAYER_BUBBLE_PLATFORM,
|
||||
NPC_PLATFORM_TYPE_MAX,
|
||||
};
|
||||
|
@ -70,6 +71,8 @@ public:
|
|||
virtual s32 getNewYPos( CThing *_thisThing );
|
||||
void setTiltable( bool isTiltable );
|
||||
void addWaypoint( s32 xPos, s32 yPos );
|
||||
void setGraphic( sThingPlatform *ThisPlatform );
|
||||
virtual void setWaypoints( sThingPlatform *ThisPlatform );
|
||||
|
||||
static NPC_PLATFORM_UNIT_TYPE getTypeFromMapEdit( u16 newType );
|
||||
static CNpcPlatform *Create(sThingPlatform *ThisPlatform);
|
||||
|
@ -91,6 +94,16 @@ protected:
|
|||
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
|
||||
{
|
||||
FileEquate ActorType;
|
||||
|
@ -157,6 +170,7 @@ protected:
|
|||
bool m_tiltable;
|
||||
s32 m_tiltAngle;
|
||||
s32 m_tiltVelocity;
|
||||
bool m_extendDir;
|
||||
|
||||
int m_frame;
|
||||
int m_animNo;
|
||||
|
|
|
@ -15,14 +15,53 @@
|
|||
#include "platform\ppendulm.h"
|
||||
#endif
|
||||
|
||||
#ifndef __UTILS_HEADER__
|
||||
#include "utils\utils.h"
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcPendulumPlatform::postInit()
|
||||
{
|
||||
m_extendDir = EXTEND_LEFT;
|
||||
m_extension = 0;
|
||||
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 )
|
||||
{
|
||||
if ( m_extendDir == EXTEND_LEFT )
|
||||
|
|
|
@ -23,6 +23,7 @@ class CNpcPendulumPlatform : public CNpcPlatform
|
|||
public:
|
||||
virtual void postInit();
|
||||
protected:
|
||||
virtual void setWaypoints( sThingPlatform *ThisPlatform );
|
||||
virtual void processMovement( int _frames );
|
||||
|
||||
s32 m_length;
|
||||
|
|
|
@ -80,6 +80,9 @@ Bubble=0
|
|||
Jellyfish=1
|
||||
Industrial=1
|
||||
Leaf=2
|
||||
FishHook1=5
|
||||
FishHook2=5
|
||||
SwingingFishHook=10
|
||||
|
||||
################################################
|
||||
# Triggers
|
||||
|
|
|
@ -18,3 +18,11 @@ Gfx=..\..\Graphics\platforms\Industrial\Industrial.gin
|
|||
[Leaf]
|
||||
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
|
||||
|
|
|
@ -1369,6 +1369,14 @@ SOURCE=..\..\..\source\platform\pbob.h
|
|||
# End 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
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -1441,6 +1449,14 @@ SOURCE=..\..\..\source\platform\plinear.h
|
|||
# End 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
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue