CRoboRed::CRoboRed(CMap *pmap, const Uint16 foeID, const Uint32 x, const Uint32 y) : CStunnable(pmap, foeID, x, y), mTimer(0), mLookTimer(0), swapYDir(false), mKeenNearby(false) { mActionMap[A_RED_MOVE] = (GASOFctr) &CRoboRed::processMoving; mActionMap[A_RED_PAUSE] = (GASOFctr) &CRoboRed::processPauseBeforeShoot; mActionMap[A_RED_SHOOT] = (GASOFctr) &CRoboRed::processShoot; auto diff = g_pBehaviorEngine->mDifficulty; moveHorizSpeed = 15; if(diff > NINJA) { moveHorizSpeed = 30; } if(diff > EXPERT) { moveHorizSpeed = 25; } if(diff > HARD) { moveHorizSpeed = 20; } // Adapt this AI setupGalaxyObjectOnMap(0x2734, A_RED_MOVE); xDirection = LEFT; }
CAmpton::CAmpton(CMap *pmap, const Uint16 foeID, const Uint32 x, const Uint32 y) : CStunnable(pmap, foeID, x, y), mTimer(0) { mActionMap[A_AMPTON_WALK] = (GASOFctr) &CAmpton::processWalking; mActionMap[A_AMPTON_TURN] = (GASOFctr) &CAmpton::processTurn; mActionMap[A_AMPTON_START_POLE] = (GASOFctr) &CAmpton::processStartPole; mActionMap[A_AMPTON_POLE_SLIDE] = (GASOFctr) &CAmpton::processPoleSlide; mActionMap[A_AMPTON_STOP_POLE] = (GASOFctr) &CAmpton::processStopPole; mActionMap[A_AMPTON_FLIP_SWITCH] = (GASOFctr) &CAmpton::processFlipSwitch; mActionMap[A_AMPTON_STUNNED] = (GASOFctr) &CStunnable::processGettingStunned; // Adapt this AI setupGalaxyObjectOnMap(0x21DC, A_AMPTON_WALK); auto diff = g_pBehaviorEngine->mDifficulty; if(diff > NINJA && foeID == 0x2C) { mSprVar = 3; mHealthPoints = 4; } if(diff > EXPERT && foeID == 0x2b) { mSprVar = 2; mHealthPoints = 3; } if(diff > HARD && foeID == 0x2A) { mSprVar = 1; mHealthPoints = 2; } xDirection = LEFT; }
COrbatrix::COrbatrix(CMap* pmap, const Uint16 foeID, Uint32 x, Uint32 y, const int sprVar) : CGalaxyActionSpriteObject(pmap, foeID, x, y, sprVar), mTimer(0), mGivesKey(false) { mActionMap[A_ORBATRIX_FLOAT] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processFloat; mActionMap[A_ORBATRIX_MOVE] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processMove; mActionMap[A_ORBATRIX_CURL] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processCurl; mActionMap[A_ORBATRIX_UNCURL] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processUncurl; mActionMap[A_ORBATRIX_MOVE_ALT] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processMove; mActionMap[A_ORBATRIX_BOUNCE] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processBounce; mActionMap[A_ORBATRIX_LAND] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processLand; mActionMap[A_ORBATRIX_SLIDE] = (void (CGalaxyActionSpriteObject::*)()) &COrbatrix::processSlide; setupGalaxyObjectOnMap(0x27E6, A_ORBATRIX_FLOAT); xDirection = LEFT; byte *ptr = g_pBehaviorEngine->m_ExeFile.getRawData(); ptr += 0x114F2; const byte endpattern[] = { 0x05, 0x00 }; if(memcmp(endpattern, ptr, 2) == 0) { mGivesKey = true; } }
CMimrock::CMimrock(CMap *pmap, Uint32 x, Uint32 y) : CObject(pmap, x, y, OBJ_NONE), CStunnable(pmap, x, y, OBJ_NONE) { setupGalaxyObjectOnMap(0x343A, A_MIMROCK_SIT); mp_processState = (void (CStunnable::*)()) &CMimrock::processSit; m_hDir = NONE; }
CSchoolFish::CSchoolFish(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) : CGalaxySpriteObject(pmap, foeID, x, y, 0), m_moveSpeed(0) { setupGalaxyObjectOnMap(0x3692, A_DOPEFISHFOOD_NORMAL); xDirection = RIGHT; yDirection = DOWN; }
CSkypest::CSkypest(CMap *pmap, Uint32 x, Uint32 y) : CObject(pmap, x, y, OBJ_NONE) { setupGalaxyObjectOnMap(0x2486, A_SKYPEST_FLY); mp_processState = &CSkypest::processFly; m_hDir = RIGHT; m_vDir = UP; }
CLick::CLick(CMap *pmap, Uint32 x, Uint32 y) : CObject(pmap, x, y, OBJ_NONE), CStunnable(pmap, x, y, OBJ_NONE), m_timer(0) { setupGalaxyObjectOnMap(0x2FC6, A_LICK_HOP); mp_processState = (void (CStunnable::*)()) (&CLick::processHop); }
CSkypest::CSkypest(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) : CGalaxySpriteObject(pmap, foeID, x, y) { setupGalaxyObjectOnMap(0x2486, A_SKYPEST_FLY); mp_processState = &CSkypest::processFly; xDirection = RIGHT; yDirection = UP; }
CSchoolFish::CSchoolFish(CMap *pmap, Uint32 x, Uint32 y) : CObject(pmap, x, y, OBJ_NONE), m_moveSpeed(0) { setupGalaxyObjectOnMap(0x3692, A_DOPEFISHFOOD_NORMAL); m_hDir = RIGHT; m_vDir = DOWN; }
CDevilSprite::CDevilSprite(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) : CGalaxySpriteObject(pmap, foeID, x, y, 0), m_timer(0) { setupGalaxyObjectOnMap(0x37A0, A_SPRITE_MOVE); mp_processState = &CDevilSprite::processMove; xDirection = LEFT; yDirection = UP; }
CGrabbiter::CGrabbiter(CMap* pmap, const Uint16 foeID, const Uint32 x, const Uint32 y) : CStunnable(pmap, foeID, x, y) { mActionMap[A_GRABBITER_HUNGRY] = (GASOFctr) &CGrabbiter::processHungry; mActionMap[A_GRABBITER_NAPPING] = (GASOFctr) &CGrabbiter::processNapping; setupGalaxyObjectOnMap(0x1A90, A_GRABBITER_HUNGRY); honorPriority = false; }
CMastersSpark::CMastersSpark(CMap *pmap, const Uint16 foeID, const Uint32 x, const Uint32 y) : CStunnable(pmap, foeID, x, y), mTimer(0) { // Adapt this AI setupGalaxyObjectOnMap(0x2C98, 0); xDirection = LEFT; }
CDopeFish::CDopeFish(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) : CGalaxySpriteObject(pmap, foeID, x, y), m_eatTimer(0), m_burped(false) { setupGalaxyObjectOnMap(0x35C0, A_DOPEFISH_SWIM); mp_processState = &CDopeFish::processSwim; xDirection = RIGHT; yDirection = UP; }
CShellyFrags::CShellyFrags(CMap* pmap, const Uint16 foeID, const Uint32 x, const Uint32 y, const int xSpeed) : CStunnable(pmap, foeID, x, y), mXSpeed(xSpeed) { xDirection = (xSpeed < 0) ? LEFT : RIGHT; setupGalaxyObjectOnMap(0x25BA, 0); yinertia = -100; }
CBlorb::CBlorb(CMap *pmap, const Uint16 foeID, const Uint32 x, const Uint32 y) : CStunnable(pmap, foeID, x, y) { mActionMap[0] = (GASOFctr) &CBlorb::processMoving; setupGalaxyObjectOnMap(0x3164, 0); xDirection = LEFT; yDirection = DOWN; }
CArachnut::CArachnut(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) : CGalaxySpriteObject(pmap, foeID, x, y) { setupGalaxyObjectOnMap( 0x2378, A_ARACHNUT_WALK ); xDirection = LEFT; CSprite &rSprite = g_pGfxEngine->getSprite(sprite); performCollisions(); processMove( 0, rSprite.m_bboxY1-rSprite.m_bboxY2 ); processActionRoutine(); }
CMadMushroom::CMadMushroom(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) : CGalaxySpriteObject(pmap, foeID, x, y), jumpcounter(0) { setupGalaxyObjectOnMap(0x20E4, A_MUSHROOM_BOUNCE); CSprite &rSprite = g_pGfxEngine->getSprite(sprite); performCollisions(); processMove( 0, rSprite.m_bboxY1-rSprite.m_bboxY2 ); processActionRoutine(); }
CBobba::CBobba(CMap* pmap, const Uint16 foeID, const Uint32 x, const Uint32 y) : CGalaxyActionSpriteObject(pmap, foeID, x, y, 0) { mActionMap[A_BOBBA_JUMP] = (void (CGalaxyActionSpriteObject::*)()) &CBobba::processJumping; mActionMap[A_BOBBA_SIT] = (void (CGalaxyActionSpriteObject::*)()) &CBobba::processSitting; mActionMap[A_BOBBA_SHOOT] = (void (CGalaxyActionSpriteObject::*)()) &CBobba::processShooting; setupGalaxyObjectOnMap(0x2D86, A_BOBBA_JUMP); xDirection = LEFT; yinertia = MAX_JUMP_INERTIA; }
CEnemyShot::CEnemyShot(CMap *pmap, const Uint16 foeID, const Uint32 x, const Uint32 y, const int actionFormatOffset, const int xDir, const int yDir, const float speed, const int sprVar) : CGalaxySpriteObject(pmap, foeID, x, y, sprVar), m_speedF(speed) { setupGalaxyObjectOnMap(actionFormatOffset, 0); xDirection = xDir; yDirection = yDir; }
CBip::CBip(CMap* pmap, const Uint16 foeID, const Uint32 x, const Uint32 y) : CGalaxyActionSpriteObject(pmap, foeID, x, y, 0), mTimer(0) { mActionMap[A_BIP_STAND] = (void (CGalaxyActionSpriteObject::*)()) &CBip::processStanding; mActionMap[A_BIP_WALK] = (void (CGalaxyActionSpriteObject::*)()) &CBip::processWalking; mActionMap[A_BIP_SQUISHED] = (void (CGalaxyActionSpriteObject::*)()) &CBip::processSquished; setupGalaxyObjectOnMap(0x29A8, A_BIP_STAND); xDirection = LEFT; }
CBerkFlame::CBerkFlame(CMap *pmap, Uint32 x, Uint32 y, const int xDir) : CGalaxySpriteObject(pmap, 0, x, y, 0), mpProcessState(NULL) { mActionMap[A_FLAME_THROWN] = &CBerkFlame::processThrown; mActionMap[A_FLAME_LANDED] = &CBerkFlame::processLanded; xDirection = xDir; xinertia = FLAME_INERTIAX; setupGalaxyObjectOnMap(0x2CD8, A_FLAME_THROWN); }
CKorath::CKorath(CMap *pmap, const Uint16 foeID, const Uint32 x, const Uint32 y) : CStunnable(pmap, foeID, x, y), mTimer(0) { mActionMap[A_KORATH_WALK] = (GASOFctr) &CKorath::processWalking; mActionMap[A_KORATH_SIT] = (GASOFctr) &CKorath::processSitting; mActionMap[A_KORATH_STUNNED] = (GASOFctr) &CStunnable::processGettingStunned; setupGalaxyObjectOnMap(0x30D2, A_KORATH_WALK); xDirection = LEFT; }
CWaterMine::CWaterMine(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y, const direction_t xDir, const bool vertical) : CGalaxySpriteObject(pmap, foeID, x, y, 0) { yDirection = 0; xDirection = xDir; if(vertical) yDirection = DOWN; setupGalaxyObjectOnMap(0x3890, A_MINE_MOVE); mp_processState = &CWaterMine::processMove; }
CPoisonSlug::CPoisonSlug(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) : CStunnable(pmap, foeID, x, y), m_timer(0) { mActionMap[A_SLUG_MOVE] = (void (CStunnable::*)()) &CPoisonSlug::processCrawling; mActionMap[A_SLUG_POOING] = (void (CStunnable::*)()) &CPoisonSlug::processPooing; mActionMap[A_SLUG_STUNNED] = &CStunnable::processGettingStunned; mActionMap[A_SLUG_STUNNED_ALT] = &CStunnable::processGettingStunned; setupGalaxyObjectOnMap(0x2012, A_SLUG_MOVE); xDirection = LEFT; }
CWaterMine::CWaterMine(CMap *pmap, Uint32 x, Uint32 y, const bool vertical) : CObject(pmap, x, y, OBJ_NONE) { m_vDir = m_hDir = NONE; if(vertical) m_vDir = DOWN; else m_hDir = RIGHT; setupGalaxyObjectOnMap(0x3890, A_MINE_MOVE); mp_processState = &CWaterMine::processMove; }
CMadMushroom::CMadMushroom(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) : CGalaxySpriteObject(pmap, foeID, x, y, 0), jumpcounter(0) { setupGalaxyObjectOnMap(0x20E4, A_MUSHROOM_BOUNCE); processActionRoutine(); honorPriority = false; bounceAmount = 0; byte *ptr = gKeenFiles.exeFile.getRawData(); ptr += 0xFF90; memcpy(&bounceAmount, ptr, 1 ); }
CArachnut::CArachnut(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) : CGalaxySpriteObject(pmap, foeID, x, y, 0) { setupGalaxyObjectOnMap( 0x2378, A_ARACHNUT_WALK ); xDirection = LEFT; GsSprite &rSprite = gGraphics.getSprite(mSprVar, mSpriteIdx); performCollisions(); const int xcentering=(rSprite.m_bboxX2-rSprite.m_bboxX1)/2; processMove( xcentering, 0 ); processActionRoutine(); }
CThunderCloud::CThunderCloud(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y, const int sprVar) : CGalaxySpriteObject(pmap, foeID, x, y, sprVar), mTimer(0), mpBolt(NULL), mSecondTry(false) { mActionMap[A_CLOUD_ASLEEP] = &CThunderCloud::processAsleep; mActionMap[A_CLOUD_WAKING] = &CThunderCloud::processWaking; mActionMap[A_CLOUD_MOVING] = &CThunderCloud::processMoving; mActionMap[A_CLOUD_STRIKING] = &CThunderCloud::processStriking; setupGalaxyObjectOnMap(0x28A0, A_CLOUD_ASLEEP); inhibitfall = true; }
CLindsey::CLindsey(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) : CGalaxySpriteObject(pmap, foeID, x, y), m_timer(0) { setupGalaxyObjectOnMap(0x38EA, 0); answermap[0] = "LINDSEY_START_TEXT"; answermap[1] = "LINDSEY_TEXT1"; answermap[2] = "LINDSEY_TEXT2"; answermap[3] = "LINDSEY_END_TEXT1"; answermap[4] = "LINDSEY_END_TEXT2"; }
CBullet::CBullet(CMap *pmap, const Uint16 foeID, const Uint32 x, const Uint32 y, const int xDir, const int yDir, const int sprVar) : CGalaxySpriteObject(pmap, foeID, x, y, sprVar), mReversed(false) { xDirection = xDir; yDirection = yDir; const size_t ep = g_pBehaviorEngine->getEpisode(); setupGalaxyObjectOnMap(bulletActionMap[ep-4], A_KEENSHOT_MOVING); setActionSprite(); calcBoundingBoxes(); playSound( SOUND_KEEN_FIRE ); }