This commit is contained in:
parent
95708325a7
commit
f53a8ac365
14 changed files with 215 additions and 88 deletions
|
@ -135,7 +135,8 @@ platform_src := platform \
|
|||
psswitch \
|
||||
plift \
|
||||
plurve \
|
||||
psoil
|
||||
psoil \
|
||||
pbubtube
|
||||
|
||||
hazard_src := hazard \
|
||||
hfalling \
|
||||
|
|
|
@ -39,11 +39,6 @@
|
|||
#include "player\player.h"
|
||||
#endif
|
||||
|
||||
#include "fx\fx.h"
|
||||
#include "fx\fxjfish.h"
|
||||
#include "fx\fxnrgbar.h"
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -58,7 +53,25 @@ void CNpcMotherJellyfishEnemy::postInit()
|
|||
m_health = CLevel::getBossHealth();
|
||||
}
|
||||
|
||||
CFXJellyFishLegs *T=(CFXJellyFishLegs*)CFX::Create(CFX::FX_TYPE_JELLYFISH_LEGS,this);
|
||||
legsPos[0].vx = 80;
|
||||
legsPos[0].vy = -5;
|
||||
|
||||
legsPos[1].vx = 40;
|
||||
legsPos[1].vy = 0;
|
||||
|
||||
legsPos[2].vx = -40;
|
||||
legsPos[2].vy = -5;
|
||||
|
||||
legsPos[3].vx = -80;
|
||||
legsPos[3].vy = 0;
|
||||
|
||||
for ( int i = 0 ; i < 4 ; i++ )
|
||||
{
|
||||
legs[i] = (CFXJellyFishLegs*)CFX::Create(CFX::FX_TYPE_JELLYFISH_LEGS,this);
|
||||
legs[i]->Setup( legsPos[i].vx, legsPos[i].vy, i > 1 );
|
||||
}
|
||||
|
||||
/*CFXJellyFishLegs *T=(CFXJellyFishLegs*)CFX::Create(CFX::FX_TYPE_JELLYFISH_LEGS,this);
|
||||
T->Setup(80,-5,0);
|
||||
|
||||
T=(CFXJellyFishLegs*)CFX::Create(CFX::FX_TYPE_JELLYFISH_LEGS,this);
|
||||
|
@ -68,7 +81,7 @@ void CNpcMotherJellyfishEnemy::postInit()
|
|||
T->Setup(-40,-5,1);
|
||||
|
||||
T=(CFXJellyFishLegs*)CFX::Create(CFX::FX_TYPE_JELLYFISH_LEGS,this);
|
||||
T->Setup(-80,0,1);
|
||||
T->Setup(-80,0,1);*/
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -384,8 +397,11 @@ void CNpcMotherJellyfishEnemy::render()
|
|||
|
||||
DVECTOR &renderPos=getRenderPos();
|
||||
|
||||
s16 scale;
|
||||
scale = 2048 + ( ( ( 8192 - 2048 ) * m_health ) / m_data[m_type].initHealth );
|
||||
|
||||
SprFrame = m_actorGfx->Render(renderPos,m_animNo,( m_frame >> 8 ),false);
|
||||
m_actorGfx->RotateScale( SprFrame, renderPos, 0, 8192, 8192 );
|
||||
m_actorGfx->RotateScale( SprFrame, renderPos, 0, scale, scale );
|
||||
|
||||
sBBox boundingBox = m_actorGfx->GetBBox();
|
||||
setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) );
|
||||
|
@ -396,6 +412,20 @@ void CNpcMotherJellyfishEnemy::render()
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcMotherJellyfishEnemy::processUserCollision( CThing *thisThing )
|
||||
/*void CNpcMotherJellyfishEnemy::processUserCollision( CThing *thisThing )
|
||||
{
|
||||
}*/
|
||||
|
||||
void CNpcMotherJellyfishEnemy::processShot( int _frames )
|
||||
{
|
||||
s16 scale;
|
||||
scale = 2048 + ( ( ( 8192 - 2048 ) * m_health ) / m_data[m_type].initHealth );
|
||||
|
||||
for ( int i = 0 ; i < 4 ; i++ )
|
||||
{
|
||||
legs[i]->Setup( ( legsPos[i].vx * scale ) >> 13, legsPos[i].vy, i > 1 );
|
||||
legs[i]->setScale( scale >> 1 );
|
||||
}
|
||||
|
||||
CNpcEnemy::processShot( _frames );
|
||||
}
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
#ifndef __ENEMY_NMJFISH_H__
|
||||
#define __ENEMY_NMJFISH_H__
|
||||
|
||||
#include "fx\fx.h"
|
||||
#include "fx\fxjfish.h"
|
||||
#include "fx\fxnrgbar.h"
|
||||
|
||||
class CNpcMotherJellyfishEnemy : public CNpcEnemy
|
||||
{
|
||||
public:
|
||||
|
@ -24,8 +28,9 @@ public:
|
|||
protected:
|
||||
virtual void processClose( int _frames );
|
||||
virtual void processMovement( int _frames );
|
||||
virtual void processShot( int _frames );
|
||||
void spawnJellyfish( int _frames );
|
||||
virtual void processUserCollision( CThing *thisThing );
|
||||
//virtual void processUserCollision( CThing *thisThing );
|
||||
|
||||
enum NPC_MOTHER_JELLYFISH_STATE
|
||||
{
|
||||
|
@ -45,6 +50,9 @@ protected:
|
|||
s32 m_cycleWidth;
|
||||
s32 m_halfCycleWidth;
|
||||
bool m_meterOn;
|
||||
|
||||
CFXJellyFishLegs *legs[4];
|
||||
DVECTOR legsPos[4];
|
||||
};
|
||||
|
||||
#endif
|
|
@ -33,7 +33,7 @@ void CNpcShellEnemy::postInit()
|
|||
|
||||
m_shellType = FRM_SHELL_STATIC0000 + ( getRnd() % ( FRM_SHELL_STATIC0002 - FRM_SHELL_STATIC0000 + 1 ) );
|
||||
|
||||
Pos.vy -= 12;
|
||||
Pos.vy -= 20;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -29,6 +29,7 @@ void CFXJellyFishLegs::init(DVECTOR const &_Pos)
|
|||
Ofs.vx=0; Ofs.vy=0;
|
||||
Angle=getRnd();
|
||||
AngleInc=LegAngleInc+getRndRange(3);
|
||||
Scale = ONE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -72,6 +73,8 @@ int WOfs=0;
|
|||
int H;
|
||||
int ThisAngle=Angle;
|
||||
int LegHeight=SprBank->getFrameHeight(FRM__LEG)-4;
|
||||
int ScaleWInc=(Scale*LegWInc)>>12;
|
||||
int ScaleHInc=(Scale*LegHInc)>>12;
|
||||
|
||||
RenderPos.vx+=Ofs.vx;
|
||||
RenderPos.vy+=Ofs.vy;
|
||||
|
@ -82,7 +85,18 @@ int LegHeight=SprBank->getFrameHeight(FRM__LEG)-4;
|
|||
ThisAngle&=CIRCLE_TAB_MASK;
|
||||
H=LegHeight+(CircleTable[ThisAngle]>>5);
|
||||
|
||||
POLY_FT4 *Ft4=SprBank->printFT4(FRM__LEG,RenderPos.vx,RenderPos.vy,XFlip,0,OtPos);
|
||||
int spriteWidth = ( Scale * CGameScene::getSpriteBank()->getFrameWidth(FRM__LEG) ) >> 12;
|
||||
|
||||
POLY_FT4 *Ft4;
|
||||
|
||||
if ( XFlip )
|
||||
{
|
||||
Ft4=SprBank->printFT4Scaled(FRM__LEG,RenderPos.vx + 6 + ( spriteWidth >> 1 ),RenderPos.vy,XFlip,0,OtPos,Scale>>4);
|
||||
}
|
||||
else
|
||||
{
|
||||
Ft4=SprBank->printFT4Scaled(FRM__LEG,RenderPos.vx - 6 - ( spriteWidth >> 1 ),RenderPos.vy,XFlip,0,OtPos,Scale>>4);
|
||||
}
|
||||
|
||||
if (!XFlip)
|
||||
{
|
||||
|
@ -98,7 +112,10 @@ int LegHeight=SprBank->getFrameHeight(FRM__LEG)-4;
|
|||
|
||||
Ft4->y2=Ft4->y0+H;
|
||||
Ft4->y3=Ft4->y1+H;
|
||||
RenderPos.vy+=H+LegHInc;
|
||||
WOfs+=LegWInc;
|
||||
// RenderPos.vy+=H+LegHInc;
|
||||
// WOfs+=LegWInc;
|
||||
RenderPos.vy+=H+ScaleHInc;
|
||||
WOfs+=ScaleWInc;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,12 +18,14 @@ virtual void think(int _frames);
|
|||
virtual void render();
|
||||
|
||||
void Setup(int XOfs,int YOfs,bool XFlip);
|
||||
void setScale( s16 newScale ) {Scale = newScale;}
|
||||
|
||||
protected:
|
||||
DVECTOR Ofs;
|
||||
|
||||
int Angle,AngleInc;
|
||||
bool XFlip;
|
||||
s16 Scale;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -36,6 +36,13 @@ void CNpcCartPlatform::postInit()
|
|||
m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH );
|
||||
|
||||
m_carSpeed = m_speed << 8;
|
||||
m_isActivated = false;
|
||||
|
||||
sBBox boundingBox = m_modelGfx->GetBBox();
|
||||
boundingBox.YMin = boundingBox.YMax - 32;
|
||||
setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) );
|
||||
setCollisionCentreOffset( ( boundingBox.XMax + boundingBox.XMin ) >> 1, ( boundingBox.YMax + boundingBox.YMin ) >> 1 );
|
||||
calculateNonRotatedCollisionData();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -51,6 +58,8 @@ void CNpcCartPlatform::processMovement( int _frames )
|
|||
|
||||
bool pathComplete;
|
||||
|
||||
if ( m_isActivated )
|
||||
{
|
||||
m_npcPath.thinkFlat( Pos, &pathComplete, &distX, &distY, &heading );
|
||||
|
||||
if ( !pathComplete )
|
||||
|
@ -141,6 +150,29 @@ void CNpcCartPlatform::processMovement( int _frames )
|
|||
|
||||
setCollisionAngle( heading );
|
||||
}
|
||||
else
|
||||
{
|
||||
groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx, Pos.vy, yMovement + 16 );
|
||||
|
||||
if ( groundHeight <= yMovement )
|
||||
{
|
||||
moveY = groundHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
// fall
|
||||
|
||||
moveY = yMovement;
|
||||
}
|
||||
|
||||
Pos.vy += moveY;
|
||||
|
||||
if ( m_contact )
|
||||
{
|
||||
m_isActivated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ protected:
|
|||
virtual void processMovement( int _frames );
|
||||
|
||||
s32 m_carSpeed;
|
||||
u8 m_isActivated;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -526,6 +526,18 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] =
|
|||
0,
|
||||
NPC_PLATFORM_TIMER_NONE,
|
||||
},
|
||||
|
||||
{ // NPC_BUBBLE_TUBE_PLATFORM
|
||||
2,
|
||||
128,
|
||||
true,
|
||||
DAMAGE__NONE,
|
||||
0,
|
||||
2,
|
||||
NPC_PLATFORM_INFINITE_LIFE,
|
||||
0,
|
||||
NPC_PLATFORM_TIMER_NONE,
|
||||
},
|
||||
};
|
||||
|
||||
CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATFORM_TYPE_MAX] =
|
||||
|
@ -567,6 +579,7 @@ CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATF
|
|||
NPC_LIFT_PLATFORM,
|
||||
NPC_LOVE_BOAT_PLATFORM,
|
||||
NPC_STEERABLE_OILDRUM_PLATFORM,
|
||||
NPC_BUBBLE_TUBE_PLATFORM,
|
||||
NPC_CONVEYOR_PLATFORM,
|
||||
NPC_PLAYER_BUBBLE_PLATFORM,
|
||||
NPC_CLAM_PLATFORM,
|
||||
|
|
|
@ -191,6 +191,10 @@
|
|||
#include "platform\psoil.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLATFORM_PBUBTUBE_H__
|
||||
#include "platform\pbubtube.h"
|
||||
#endif
|
||||
|
||||
#include "fx\fx.h"
|
||||
#include "fx\fxjfish.h"
|
||||
|
||||
|
@ -441,6 +445,12 @@ CNpcPlatform *CNpcPlatform::Create(int Type)
|
|||
break;
|
||||
}
|
||||
|
||||
case NPC_BUBBLE_TUBE_PLATFORM:
|
||||
{
|
||||
platform = new ("bubble tube platform") CNpcBubbleTubePlatform;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
ASSERT( 0 );
|
||||
|
|
|
@ -94,6 +94,7 @@ public:
|
|||
NPC_LIFT_PLATFORM,
|
||||
NPC_LOVE_BOAT_PLATFORM,
|
||||
NPC_STEERABLE_OILDRUM_PLATFORM,
|
||||
NPC_BUBBLE_TUBE_PLATFORM,
|
||||
NPC_PLATFORM_TYPE_MAX,
|
||||
};
|
||||
enum
|
||||
|
|
|
@ -124,6 +124,7 @@ OilRigPlatform=1
|
|||
RockBridge=32
|
||||
SteamSwitch=33
|
||||
LiftPlatform=34
|
||||
BubbleTubePlatform=37
|
||||
|
||||
################################################
|
||||
# Triggers
|
||||
|
|
|
@ -144,3 +144,6 @@ Gfx=..\..\Graphics\platforms\steam_switch\steam_switch.gin
|
|||
|
||||
[LiftPlatform]
|
||||
Gfx=..\..\Graphics\platforms\Industrial\Industrial.gin
|
||||
|
||||
[BubbleTubePlatform]
|
||||
Gfx=..\..\Graphics\platforms\Oilrig2\oilrigplatform2.gin
|
||||
|
|
|
@ -1425,6 +1425,14 @@ SOURCE=..\..\..\source\platform\pbubble.h
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\platform\pbubtube.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\platform\pbubtube.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\platform\pbwheel.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue