CBlueBird::CBlueBird(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) : CGalaxySpriteObject(pmap, foeID, x, y, 0), mTimer(0) { mActionMap[A_EAGLE_HATCHED] = &CBlueBird::processHatched; mActionMap[A_EAGLE_WALKING] = &CBlueBird::processWalking; mActionMap[A_EAGLE_WALKING+1] = &CBlueBird::processWalking; mActionMap[A_EAGLE_FLYING] = &CBlueBird::processFlying; mActionMap[A_EAGLE_STUNNED] = &CBlueBird::processStunned; setupGalaxyObjectOnMap( 0x21B6, A_EAGLE_HATCHED ); xDirection = LEFT; GsSprite &rSprite = gGraphics.getSprite(mSprVar,sprite); performCollisions(); processMove( 0, rSprite.m_bboxY1-rSprite.m_bboxY2 ); processActionRoutine(); }
CBloog::CBloog(CMap *pmap, const Uint16 foeID, const Uint32 x, const Uint32 y) : CStunnable(pmap, foeID, x, y), mTimer(0) { mHealthPoints = 1; const Difficulty diff = g_pBehaviorEngine->mDifficulty; if(foeID == 0x04 && diff > HARD) { // Set the bloog to another color and double his health mSprVar = 1; mHealthPoints *= 2; } if(foeID == 0x05 && diff > EXPERT) { // Set the bloog to another color and increase his health mSprVar = 2; mHealthPoints *= 3; } if(foeID == 0x06 && diff > NINJA) { // Set the bloog to another color and increase his health mSprVar = 3; mHealthPoints *= 4; } mActionMap[A_BLOOG_WALK] = (GASOFctr) &CBloog::processWalking; mActionMap[A_BLOOG_STUNNED] = (GASOFctr) &CStunnable::processGettingStunned; setupGalaxyObjectOnMap(0x1EE6, A_BLOOG_WALK); xDirection = LEFT; // Some mods suffer the fact (Keen 8 Dead in Desert) that those foes appear embedded in the floor CSprite &rSprite = g_pGfxEngine->getSprite(mSprVar,sprite); performCollisions(); processMove( 0, rSprite.m_bboxY1-rSprite.m_bboxY2 ); processActionRoutine(); }
void CSpriteItem::process() { if(mGravity) { performCollisions(); performGravityHigh(); } // Do the animation stuff here! if(m_timer == 0) { this->sprite = (m_basesprite == this->sprite) ? m_basesprite + 1 : m_basesprite; } if(m_timer < MAX_ANIMATION_TIMER) m_timer++; else m_timer = 0; }
void CRoboRed::process() { performCollisions(); performGravityMid(); if( blockedl ) { xDirection = RIGHT; } else if(blockedr) { xDirection = LEFT; } if(!processActionRoutine()) exists = false; (this->*mp_processState)(); }
void CGalaxySpriteObject::setupGalaxyObjectOnMap(const size_t ActionBaseOffset, const size_t ActionNumber ) { m_ActionBaseOffset = ActionBaseOffset; m_climbing = false; m_jumped = false; setActionForce(ActionNumber); setActionSprite(); calcBoundingBoxes(); alignToTile(); performCollisions(); if(!processActionRoutine()) exists = false; }
void CInchWorm::process() { performCollisions(); performGravityLow(); if(!processActionRoutine()) exists = false; if( blockedl ) xDirection = RIGHT; else if(blockedr) xDirection = LEFT; if(!getActionStatus(0)) return; // Move normally in the direction if( xDirection == RIGHT ) moveRight( (m_Action.h_anim_move>>3)*((rand()%2)+1) ); else
CBallJack::CBallJack(CMap *pmap, Uint32 x, Uint32 y, object_t type): CVorticonSpriteObject(pmap, x, y, type) { m_Direction = DUPLEFT; animframe = 0; animtimer = 0; inhibitfall = 1; if (m_type==OBJ_BALL) { speed = BALL_SPEED; canbezapped = 1; } else { speed = JACK_SPEED; canbezapped = 0; } performCollisions(); }
void CMastersSpark::process() { performCollisions(); performGravityMid(); if( blockedl ) { xDirection = RIGHT; mIsDead = true; } else if(blockedr) { xDirection = LEFT; mIsDead = true; } if(!processActionRoutine()) exists = false; (this->*mp_processState)(); }
void CThunderCloud::process() { if( mpBolt ) { if(!mpBolt->exists) mpBolt = NULL; // This can be done because the object container will care deleting the it. } performCollisions(); processFalling(); if( blockedl ) xDirection = RIGHT; else if( blockedr ) xDirection = LEFT; (this->*mpProcessState)(); mTimer++; processActionRoutine(); }
void CBlueBird::process() { performCollisions(); if(!inhibitfall) performGravityMid(); if( blockedl ) xDirection = RIGHT; else if( blockedr ) xDirection = LEFT; if( blockedu ) yDirection = DOWN; else if( blockedu ) yDirection = UP; (this->*mpProcessState)(); if(!processActionRoutine()) exists = false; }
void CWormmouth::process() { if( getActionNumber(A_WORMMOUTH_MOVE) || getActionNumber(A_WORMMOUTH_STUNNED) ) { performCollisions(); performGravityLow(); } (this->*mp_processState)(); if( getActionNumber(A_WORMMOUTH_STUNNED) ) return; if( blockedl ) xDirection = RIGHT; else if(blockedr) xDirection = LEFT; if(!processActionRoutine()) exists = false; }
void CKorath::process() { performCollisions(); performGravityMid(); if(!dead) // If we is dead, there is no way to continue moving or turning { if( blockedl ) { xDirection = RIGHT; } else if(blockedr) { xDirection = LEFT; } } if(!processActionRoutine()) exists = false; (this->*mp_processState)(); }
void CCouncilMember::processWalking() { performCollisions(); processFalling(); // Check if there is a cliff and move him back in case performCliffStop(m_Action.H_anim_move_amount<<1); if( m_timer < ELDER_MOVE_TIMER ) { m_timer++; return; } else { m_timer = 0; } // Chance if he will think if( getProbability(25) ) { m_timer = 0; mp_processState = &CCouncilMember::processThinking; setAction(A_COUNCIL_MEMBER_THINK); return; } // Move normally in the direction if( m_hDir == RIGHT ) moveRight( m_Action.H_anim_move_amount<<1 ); else moveLeft( m_Action.H_anim_move_amount<<1 ); }
//// // Process the stuff of the player when playing in a normal level void CPlayer::processInLevel() { StatusBox(); if (pdie) dieanim(); else { inhibitwalking = false; inhibitfall = false; // when walking through the exit door don't show keen's sprite past // the door frame (so it looks like he walks "through" the door) if(!pfrozentime) { if (!level_done) ProcessInput(); else ProcessExitLevel(); } setDir(); if(!level_done) { getgoodies(); raygun(); keencicle(); } if(!pfrozentime) { if(!pjumping) { Walking(); // if we bump against a wall all inertia stops if (xinertia > 0 && blockedr) xinertia = 0; if (xinertia < 0 && blockedl) xinertia = 0; WalkingAnimation(); } } checkSolidDoors(); InertiaAndFriction_X(); if(!level_done) { TogglePogo_and_Switches(); JumpAndPogo(); } // Check collision with other objects performCollisions(); checkObjSolid(); if(!inhibitfall) Playerfalling(); } if(pSupportedbyobject) blockedd = true; }