This commit is contained in:
Charles 2001-04-08 20:46:34 +00:00
parent cfa0d08f9e
commit 7d9f17da0f
3 changed files with 104 additions and 42 deletions

View File

@ -1250,45 +1250,60 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
CNpcEnemy::NPC_UNIT_TYPE CNpcEnemy::mapEditConvertTable[NPC_UNIT_TYPE_MAX] = CNpcEnemy::NPC_UNIT_TYPE CNpcEnemy::mapEditConvertTable[NPC_UNIT_TYPE_MAX] =
{ {
NPC_SMALL_JELLYFISH_1, NPC_SMALL_JELLYFISH_1,
NPC_SMALL_JELLYFISH_2, NPC_SMALL_JELLYFISH_2,
NPC_MOTHER_JELLYFISH, NPC_MOTHER_JELLYFISH,
NPC_ANEMONE_1, NPC_ANEMONE_1,
NPC_ANEMONE_2, NPC_ANEMONE_2,
NPC_ANEMONE_3, NPC_ANEMONE_3,
NPC_BABY_OCTOPUS, NPC_BABY_OCTOPUS,
NPC_BALL_BLOB, NPC_BALL_BLOB,
NPC_BOOGER_MONSTER, NPC_BOOGER_MONSTER,
NPC_PRICKLY_BUG, NPC_PRICKLY_BUG,
NPC_CLAM_JUMP, NPC_CLAM_JUMP,
NPC_CLAM_STATIC, NPC_CLAM_STATIC,
NPC_EYEBALL, NPC_EYEBALL,
NPC_FLAMING_SKULL, NPC_FLAMING_SKULL,
NPC_FLYING_DUTCHMAN, NPC_FLYING_DUTCHMAN,
NPC_GHOST, NPC_GHOST,
NPC_PARASITIC_WORM, NPC_PARASITIC_WORM,
NPC_HERMIT_CRAB, NPC_HERMIT_CRAB,
NPC_IRON_DOGFISH, NPC_IRON_DOGFISH,
NPC_PUFFA_FISH, NPC_PUFFA_FISH,
NPC_SEA_SNAKE, NPC_SEA_SNAKE,
NPC_SHARK_MAN, NPC_SHARK_MAN,
NPC_SUB_SHARK, NPC_SUB_SHARK,
NPC_SKELETAL_FISH, NPC_SKELETAL_FISH,
NPC_SPIDER_CRAB, NPC_SPIDER_CRAB,
NPC_SQUID_DART, NPC_SQUID_DART,
NPC_SKULL_STOMPER, NPC_SKULL_STOMPER,
NPC_DUST_DEVIL, NPC_DUST_DEVIL,
NPC_FALLING_ITEM, NPC_FALLING_ITEM,
NPC_FISH_HOOK, NPC_FISH_HOOK,
NPC_PENDULUM, NPC_PENDULUM,
NPC_FIREBALL, NPC_FIREBALL,
NPC_SAW_BLADE, NPC_SAW_BLADE,
NPC_FISH_FOLK, NPC_FISH_FOLK,
NPC_ANGLER_FISH, NPC_ANGLER_FISH,
NPC_MINE, NPC_MINE,
NPC_ZOMBIE_FISH_FOLK, NPC_ZOMBIE_FISH_FOLK,
NPC_NINJA_STARFISH, NPC_NINJA_STARFISH,
NPC_GHOST_PIRATE, NPC_GHOST_PIRATE,
NPC_OIL_BLOB, NPC_OIL_BLOB,
NPC_PARASITIC_WORM_SEGMENT, NPC_PARASITIC_WORM_SEGMENT,
};
CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATFORM_TYPE_MAX] =
{
NPC_BUBBLE_PLATFORM,
NPC_LINEAR_PLATFORM,
NPC_CIRCULAR_PLATFORM,
NPC_COLLAPSING_BUBBLE_PLATFORM,
NPC_FISH_HOOK_PLATFORM,
NPC_RETRACTING_PLATFORM,
NPC_GEYSER_PLATFORM,
NPC_BOBBING_PLATFORM,
NPC_FALLING_PLATFORM,
NPC_CART_PLATFORM,
NPC_PLAYER_BUBBLE_PLATFORM,
}; };

View File

@ -276,7 +276,9 @@ void CGameScene::initLevel()
m_player->setMapSize(Level.getMapSize()); m_player->setMapSize(Level.getMapSize());
// Init actors (needs moving and tidying // Init actors (needs moving and tidying
int pointNum;
int actorNum; int actorNum;
int platformNum;
sThingActor **actorList = Level.getActorList(); sThingActor **actorList = Level.getActorList();
if (actorList) if (actorList)
@ -296,7 +298,6 @@ void CGameScene::initLevel()
enemy->init(); enemy->init();
enemy->setLayerCollision( Level.getCollisionLayer() ); enemy->setLayerCollision( Level.getCollisionLayer() );
int pointNum;
u16 *PntList=(u16*)MakePtr(actorList[actorNum],sizeof(sThingActor)); u16 *PntList=(u16*)MakePtr(actorList[actorNum],sizeof(sThingActor));
u16 newXPos, newYPos; u16 newXPos, newYPos;
@ -332,6 +333,50 @@ void CGameScene::initLevel()
} }
} }
} }
sThingPlatform **platformList = Level.getPlatformList();
if (platformList)
{
for ( platformNum = 0 ; platformNum < Level.getPlatformCount() ; platformNum++ )
{
CNpcPlatform *platform;
platform = new ("platform") CNpcPlatform;
ASSERT(platform);
platform->setTypeFromMapEdit( platformList[platformNum]->Type );
u16 *PntList=(u16*)MakePtr(platformList[platformNum],sizeof(sThingPlatform));
u16 newXPos, newYPos;
newXPos = (u16) *PntList;
PntList++;
newYPos = (u16) *PntList;
PntList++;
DVECTOR startPos;
startPos.vx = newXPos;
startPos.vy = newYPos;
platform->init( startPos );
platform->setLayerCollision( Level.getCollisionLayer() );
platform->addWaypoint( newXPos, newYPos );
if ( platformList[platformNum]->PointCount > 1 )
{
for ( pointNum = 1 ; pointNum < platformList[platformNum]->PointCount ; pointNum++ )
{
newXPos = (u16) *PntList;
PntList++;
newYPos = (u16) *PntList;
PntList++;
platform->addWaypoint( newXPos, newYPos );
}
}
}
}
// Song is loaded/dumped by the level, and played from here. This just gives some // Song is loaded/dumped by the level, and played from here. This just gives some
// better timing over when it starts (pkg) // better timing over when it starts (pkg)
CSoundMediator::playSong(); CSoundMediator::playSong();

View File

@ -36,6 +36,8 @@ public:
static DVECTOR getPlayerSpawnPos() {return s_playerSpawnPos;} static DVECTOR getPlayerSpawnPos() {return s_playerSpawnPos;}
int getActorCount() {return ActorCount;} int getActorCount() {return ActorCount;}
sThingActor **getActorList() {return ActorList;} sThingActor **getActorList() {return ActorList;}
int getPlatformCount() {return PlatformCount;}
sThingPlatform **getPlatformList() {return PlatformList;}
CLayerCollision *getCollisionLayer() {return CollisionLayer;} CLayerCollision *getCollisionLayer() {return CollisionLayer;}
DVECTOR getMapSize(); DVECTOR getMapSize();