This commit is contained in:
parent
1d62c1aa7e
commit
a17ebb002a
4 changed files with 50 additions and 24 deletions
|
@ -61,7 +61,8 @@ void CNpcGeyserPlatformGenerator::think( int _frames )
|
||||||
{
|
{
|
||||||
case NPC_BUBBLE_PLATFORM:
|
case NPC_BUBBLE_PLATFORM:
|
||||||
{
|
{
|
||||||
newPlatform = new ("falling platform") CNpcBubblePlatform;
|
//newPlatform = new ("falling platform") CNpcBubblePlatform;
|
||||||
|
newPlatform = CNpcPlatform::Create( m_targetType );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,8 @@ void CNpcFallingPlatformGenerator::think( int _frames )
|
||||||
case NPC_CRATE_PLATFORM:
|
case NPC_CRATE_PLATFORM:
|
||||||
case NPC_VERTICAL_OILDRUM_PLATFORM:
|
case NPC_VERTICAL_OILDRUM_PLATFORM:
|
||||||
{
|
{
|
||||||
newPlatform = new ("falling platform") CNpcFallingNoRespawnPlatform;
|
//newPlatform = new ("falling platform") CNpcFallingNoRespawnPlatform;
|
||||||
|
newPlatform = CNpcPlatform::Create( m_targetType );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,12 +169,10 @@
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
|
CNpcPlatform *CNpcPlatform::Create(int Type)
|
||||||
{
|
{
|
||||||
CNpcPlatform *platform;
|
CNpcPlatform *platform;
|
||||||
|
|
||||||
NPC_PLATFORM_UNIT_TYPE Type = getTypeFromMapEdit( ThisPlatform->Type );
|
|
||||||
|
|
||||||
platform = (CNpcPlatform*)CThingManager::GetThing(CThing::TYPE_PLATFORM,Type);
|
platform = (CNpcPlatform*)CThingManager::GetThing(CThing::TYPE_PLATFORM,Type);
|
||||||
if (!platform)
|
if (!platform)
|
||||||
switch( Type )
|
switch( Type )
|
||||||
|
@ -182,7 +180,6 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
|
||||||
case NPC_LINEAR_PLATFORM:
|
case NPC_LINEAR_PLATFORM:
|
||||||
{
|
{
|
||||||
platform = new ("linear platform") CNpcLinearPlatform;
|
platform = new ("linear platform") CNpcLinearPlatform;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,19 +265,7 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
|
||||||
|
|
||||||
case NPC_DUAL_PLATFORM:
|
case NPC_DUAL_PLATFORM:
|
||||||
{
|
{
|
||||||
CNpcDualPlatform *dualPlatformMaster;
|
platform = new ("dual platform master") CNpcDualPlatform;
|
||||||
platform = dualPlatformMaster = new ("dual platform master") CNpcDualPlatform;
|
|
||||||
dualPlatformMaster->setMaster( true );
|
|
||||||
CNpcDualPlatform *dualPlatformSlave;
|
|
||||||
dualPlatformSlave = new ("dual platform slave") CNpcDualPlatform;
|
|
||||||
dualPlatformSlave->setMaster( false );
|
|
||||||
dualPlatformMaster->setOtherPlatform( dualPlatformSlave );
|
|
||||||
dualPlatformSlave->setOtherPlatform( dualPlatformMaster );
|
|
||||||
|
|
||||||
dualPlatformSlave->setType( Type );
|
|
||||||
dualPlatformSlave->setGraphic( ThisPlatform );
|
|
||||||
dualPlatformSlave->setTiltable( false );
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,12 +374,8 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(platform);
|
ASSERT(platform);
|
||||||
platform->setType( Type );
|
platform->setType( (NPC_PLATFORM_UNIT_TYPE) Type );
|
||||||
platform->setThingSubType( Type );
|
platform->setThingSubType( Type );
|
||||||
platform->setGraphic( ThisPlatform );
|
|
||||||
|
|
||||||
platform->setWaypoints( ThisPlatform );
|
|
||||||
|
|
||||||
platform->setTiltable( false );
|
platform->setTiltable( false );
|
||||||
|
|
||||||
return( platform );
|
return( platform );
|
||||||
|
@ -402,6 +383,48 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
|
||||||
|
{
|
||||||
|
CNpcPlatform *platform;
|
||||||
|
|
||||||
|
NPC_PLATFORM_UNIT_TYPE Type = getTypeFromMapEdit( ThisPlatform->Type );
|
||||||
|
|
||||||
|
platform=Create(Type);
|
||||||
|
|
||||||
|
switch( Type )
|
||||||
|
{
|
||||||
|
case NPC_DUAL_PLATFORM:
|
||||||
|
{
|
||||||
|
CNpcDualPlatform *dualPlatformMaster = (CNpcDualPlatform *) platform;
|
||||||
|
dualPlatformMaster->setMaster( true );
|
||||||
|
|
||||||
|
CNpcDualPlatform *dualPlatformSlave;
|
||||||
|
dualPlatformSlave = (CNpcDualPlatform *) CNpcPlatform::Create( NPC_DUAL_PLATFORM );
|
||||||
|
dualPlatformSlave->setMaster( false );
|
||||||
|
|
||||||
|
dualPlatformSlave->setType( Type );
|
||||||
|
dualPlatformSlave->setGraphic( ThisPlatform );
|
||||||
|
dualPlatformSlave->setTiltable( false );
|
||||||
|
|
||||||
|
dualPlatformMaster->setOtherPlatform( dualPlatformSlave );
|
||||||
|
dualPlatformSlave->setOtherPlatform( dualPlatformMaster );
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ASSERT(platform);
|
||||||
|
platform->setGraphic( ThisPlatform );
|
||||||
|
platform->setWaypoints( ThisPlatform );
|
||||||
|
|
||||||
|
return( platform );
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void CNpcPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
void CNpcPlatform::setWaypoints( sThingPlatform *ThisPlatform )
|
||||||
{
|
{
|
||||||
int pointNum;
|
int pointNum;
|
||||||
|
|
|
@ -115,6 +115,7 @@ public:
|
||||||
NPC_PLATFORM_UNIT_TYPE getType() {return( m_type );}
|
NPC_PLATFORM_UNIT_TYPE getType() {return( m_type );}
|
||||||
|
|
||||||
static NPC_PLATFORM_UNIT_TYPE getTypeFromMapEdit( u16 newType );
|
static NPC_PLATFORM_UNIT_TYPE getTypeFromMapEdit( u16 newType );
|
||||||
|
static CNpcPlatform *Create(int Type);
|
||||||
static CNpcPlatform *Create(sThingPlatform *ThisPlatform);
|
static CNpcPlatform *Create(sThingPlatform *ThisPlatform);
|
||||||
|
|
||||||
void setSpeed( s16 newSpeed ) {m_speed = newSpeed;}
|
void setSpeed( s16 newSpeed ) {m_speed = newSpeed;}
|
||||||
|
|
Loading…
Add table
Reference in a new issue