TWINE: added constants
This commit is contained in:
parent
019dfb9623
commit
9f4d5809d4
7 changed files with 26 additions and 22 deletions
|
@ -422,9 +422,9 @@ void Actor::hitActor(int32 actorIdx, int32 actorIdxAttacked, int32 strengthOfHit
|
|||
}
|
||||
|
||||
if (_engine->getRandomNumber() & 1) {
|
||||
_engine->_animations->initAnim(AnimationTypes::kHit2, 3, AnimationTypes::kAnimInvalid, actorIdxAttacked);
|
||||
_engine->_animations->initAnim(AnimationTypes::kHit2, kAnimationType_3, AnimationTypes::kAnimInvalid, actorIdxAttacked);
|
||||
} else {
|
||||
_engine->_animations->initAnim(AnimationTypes::kBigHit, 3, AnimationTypes::kAnimInvalid, actorIdxAttacked);
|
||||
_engine->_animations->initAnim(AnimationTypes::kBigHit, kAnimationType_3, AnimationTypes::kAnimInvalid, actorIdxAttacked);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -440,7 +440,7 @@ void Actor::hitActor(int32 actorIdx, int32 actorIdxAttacked, int32 strengthOfHit
|
|||
actor->life = 0;
|
||||
}
|
||||
} else {
|
||||
_engine->_animations->initAnim(AnimationTypes::kHit, 3, AnimationTypes::kAnimInvalid, actorIdxAttacked);
|
||||
_engine->_animations->initAnim(AnimationTypes::kHit, kAnimationType_3, AnimationTypes::kAnimInvalid, actorIdxAttacked);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -141,6 +141,10 @@ struct BonusParameter {
|
|||
};
|
||||
|
||||
#define kAnimationTypeLoop 0
|
||||
#define kAnimationType_1 1
|
||||
#define kAnimationType_2 2
|
||||
#define kAnimationType_3 3
|
||||
#define kAnimationType_4 4
|
||||
|
||||
/**
|
||||
* Actors structure
|
||||
|
|
|
@ -759,7 +759,7 @@ void Animations::processActorAnimations(int32 actorIdx) { // DoAnim
|
|||
if (_engine->_renderer->destX >= 0 && _engine->_renderer->destZ >= 0 && _engine->_renderer->destX <= 0x7E00 && _engine->_renderer->destZ <= 0x7E00) {
|
||||
if (_engine->_grid->getBrickShape(_engine->_renderer->destX, _engine->_movements->processActorY + BRICK_HEIGHT, _engine->_renderer->destZ) != ShapeType::kNone && _engine->cfgfile.WallCollision) { // avoid wall hit damage
|
||||
_engine->_extra->addExtraSpecial(actor->x, actor->y + 1000, actor->z, ExtraSpecialType::kHitStars);
|
||||
initAnim(AnimationTypes::kBigHit, 2, AnimationTypes::kStanding, currentlyProcessedActorIdx);
|
||||
initAnim(AnimationTypes::kBigHit, kAnimationType_2, AnimationTypes::kStanding, currentlyProcessedActorIdx);
|
||||
|
||||
if (IS_HERO(currentlyProcessedActorIdx)) {
|
||||
_engine->_movements->heroMoved = true;
|
||||
|
@ -781,7 +781,7 @@ void Animations::processActorAnimations(int32 actorIdx) { // DoAnim
|
|||
} else {
|
||||
if (IS_HERO(actorIdx) && _engine->_actor->heroBehaviour == HeroBehaviourType::kAthletic && actor->anim == AnimationTypes::kForward && _engine->cfgfile.WallCollision) { // avoid wall hit damage
|
||||
_engine->_extra->addExtraSpecial(actor->x, actor->y + 1000, actor->z, ExtraSpecialType::kHitStars);
|
||||
initAnim(AnimationTypes::kBigHit, 2, AnimationTypes::kStanding, currentlyProcessedActorIdx);
|
||||
initAnim(AnimationTypes::kBigHit, kAnimationType_2, AnimationTypes::kStanding, currentlyProcessedActorIdx);
|
||||
_engine->_movements->heroMoved = true;
|
||||
actor->life--;
|
||||
}
|
||||
|
|
|
@ -453,16 +453,16 @@ void Collision::stopFalling() { // ReceptionObj()
|
|||
if (fall >= BRICK_HEIGHT * 8) {
|
||||
_engine->_extra->addExtraSpecial(_engine->_actor->processActorPtr->x, _engine->_actor->processActorPtr->y + 1000, _engine->_actor->processActorPtr->z, ExtraSpecialType::kHitStars);
|
||||
_engine->_actor->processActorPtr->life--;
|
||||
_engine->_animations->initAnim(AnimationTypes::kLandingHit, 2, AnimationTypes::kStanding, _engine->_animations->currentlyProcessedActorIdx);
|
||||
_engine->_animations->initAnim(AnimationTypes::kLandingHit, kAnimationType_2, AnimationTypes::kStanding, _engine->_animations->currentlyProcessedActorIdx);
|
||||
} else if (fall > 10) {
|
||||
_engine->_animations->initAnim(AnimationTypes::kLanding, 2, AnimationTypes::kStanding, _engine->_animations->currentlyProcessedActorIdx);
|
||||
_engine->_animations->initAnim(AnimationTypes::kLanding, kAnimationType_2, AnimationTypes::kStanding, _engine->_animations->currentlyProcessedActorIdx);
|
||||
} else {
|
||||
_engine->_animations->initAnim(AnimationTypes::kStanding, kAnimationTypeLoop, AnimationTypes::kStanding, _engine->_animations->currentlyProcessedActorIdx);
|
||||
}
|
||||
|
||||
_engine->_scene->heroYBeforeFall = 0;
|
||||
} else {
|
||||
_engine->_animations->initAnim(AnimationTypes::kLanding, 2, _engine->_actor->processActorPtr->animExtra, _engine->_animations->currentlyProcessedActorIdx);
|
||||
_engine->_animations->initAnim(AnimationTypes::kLanding, kAnimationType_2, _engine->_actor->processActorPtr->animExtra, _engine->_animations->currentlyProcessedActorIdx);
|
||||
}
|
||||
|
||||
_engine->_actor->processActorPtr->dynamicFlags.bIsFalling = 0;
|
||||
|
|
|
@ -224,7 +224,7 @@ bool Movements::processBehaviourExecution(int actorIdx) {
|
|||
executeAction = true;
|
||||
break;
|
||||
case HeroBehaviourType::kAthletic:
|
||||
_engine->_animations->initAnim(AnimationTypes::kJump, 1, AnimationTypes::kStanding, actorIdx);
|
||||
_engine->_animations->initAnim(AnimationTypes::kJump, kAnimationType_1, AnimationTypes::kStanding, actorIdx);
|
||||
break;
|
||||
case HeroBehaviourType::kAggressive:
|
||||
if (_engine->_actor->autoAggressive) {
|
||||
|
@ -237,23 +237,23 @@ bool Movements::processBehaviourExecution(int actorIdx) {
|
|||
|
||||
switch (aggresiveMode) {
|
||||
case 0:
|
||||
_engine->_animations->initAnim(AnimationTypes::kKick, 1, AnimationTypes::kStanding, actorIdx);
|
||||
_engine->_animations->initAnim(AnimationTypes::kKick, kAnimationType_1, AnimationTypes::kStanding, actorIdx);
|
||||
break;
|
||||
case 1:
|
||||
_engine->_animations->initAnim(AnimationTypes::kRightPunch, 1, AnimationTypes::kStanding, actorIdx);
|
||||
_engine->_animations->initAnim(AnimationTypes::kRightPunch, kAnimationType_1, AnimationTypes::kStanding, actorIdx);
|
||||
break;
|
||||
case 2:
|
||||
_engine->_animations->initAnim(AnimationTypes::kLeftPunch, 1, AnimationTypes::kStanding, actorIdx);
|
||||
_engine->_animations->initAnim(AnimationTypes::kLeftPunch, kAnimationType_1, AnimationTypes::kStanding, actorIdx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (_engine->_input->isActionActive(TwinEActionType::TurnLeft)) {
|
||||
_engine->_animations->initAnim(AnimationTypes::kLeftPunch, 1, AnimationTypes::kStanding, actorIdx);
|
||||
_engine->_animations->initAnim(AnimationTypes::kLeftPunch, kAnimationType_1, AnimationTypes::kStanding, actorIdx);
|
||||
} else if (_engine->_input->isActionActive(TwinEActionType::TurnRight)) {
|
||||
_engine->_animations->initAnim(AnimationTypes::kRightPunch, 1, AnimationTypes::kStanding, actorIdx);
|
||||
_engine->_animations->initAnim(AnimationTypes::kRightPunch, kAnimationType_1, AnimationTypes::kStanding, actorIdx);
|
||||
} else if (_engine->_input->isActionActive(TwinEActionType::MoveForward)) {
|
||||
_engine->_animations->initAnim(AnimationTypes::kKick, 1, AnimationTypes::kStanding, actorIdx);
|
||||
_engine->_animations->initAnim(AnimationTypes::kKick, kAnimationType_1, AnimationTypes::kStanding, actorIdx);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -271,7 +271,7 @@ bool Movements::processAttackExecution(int actorIdx) {
|
|||
if (!_engine->_gameState->usingSabre) { // Use Magic Ball
|
||||
if (_engine->_gameState->hasItem(InventoryItems::kiMagicBall)) {
|
||||
if (_engine->_gameState->magicBallIdx == -1) {
|
||||
_engine->_animations->initAnim(AnimationTypes::kThrowBall, 1, AnimationTypes::kStanding, actorIdx);
|
||||
_engine->_animations->initAnim(AnimationTypes::kThrowBall, kAnimationType_1, AnimationTypes::kStanding, actorIdx);
|
||||
}
|
||||
|
||||
actor->angle = actor->move.getRealAngle(_engine->lbaTime);
|
||||
|
@ -282,7 +282,7 @@ bool Movements::processAttackExecution(int actorIdx) {
|
|||
_engine->_actor->initModelActor(InventoryItems::kiUseSabre, actorIdx);
|
||||
}
|
||||
|
||||
_engine->_animations->initAnim(AnimationTypes::kSabreAttack, 1, AnimationTypes::kStanding, actorIdx);
|
||||
_engine->_animations->initAnim(AnimationTypes::kSabreAttack, kAnimationType_1, AnimationTypes::kStanding, actorIdx);
|
||||
|
||||
actor->angle = actor->move.getRealAngle(_engine->lbaTime);
|
||||
return true;
|
||||
|
|
|
@ -525,7 +525,7 @@ void Scene::processActorZones(int32 actorIdx) {
|
|||
break;
|
||||
case ZoneType::kObject:
|
||||
if (IS_HERO(actorIdx) && _engine->_movements->shouldTriggerZoneAction()) {
|
||||
_engine->_animations->initAnim(AnimationTypes::kAction, 1, AnimationTypes::kStanding, 0);
|
||||
_engine->_animations->initAnim(AnimationTypes::kAction, kAnimationType_1, AnimationTypes::kStanding, 0);
|
||||
processZoneExtraBonus(zone);
|
||||
}
|
||||
break;
|
||||
|
@ -549,7 +549,7 @@ void Scene::processActorZones(int32 actorIdx) {
|
|||
if (_engine->_grid->getBrickShape(_engine->_renderer->destX, actor->y + ANGLE_90, _engine->_renderer->destZ) != ShapeType::kNone) {
|
||||
currentActorInZone = true;
|
||||
if (actor->y >= ABS(zone->bottomLeft.y + zone->topRight.y) / 2) {
|
||||
_engine->_animations->initAnim(AnimationTypes::kTopLadder, 2, AnimationTypes::kStanding, actorIdx); // reached end of ladder
|
||||
_engine->_animations->initAnim(AnimationTypes::kTopLadder, kAnimationType_2, AnimationTypes::kStanding, actorIdx); // reached end of ladder
|
||||
} else {
|
||||
_engine->_animations->initAnim(AnimationTypes::kClimbLadder, kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx); // go up in ladder
|
||||
}
|
||||
|
|
|
@ -606,7 +606,7 @@ void TwinEEngine::processInventoryAction() {
|
|||
_actor->setBehaviour(HeroBehaviourType::kNormal);
|
||||
}
|
||||
_actor->initModelActor(2, OWN_ACTOR_SCENE_INDEX);
|
||||
_animations->initAnim(AnimationTypes::kSabreUnknown, 1, AnimationTypes::kStanding, OWN_ACTOR_SCENE_INDEX);
|
||||
_animations->initAnim(AnimationTypes::kSabreUnknown, kAnimationType_1, AnimationTypes::kStanding, OWN_ACTOR_SCENE_INDEX);
|
||||
|
||||
_gameState->usingSabre = true;
|
||||
}
|
||||
|
@ -873,7 +873,7 @@ int32 TwinEEngine::runGameEngine() { // mainLoopInteration
|
|||
|
||||
if (actor->life == 0) {
|
||||
if (IS_HERO(a)) {
|
||||
_animations->initAnim(AnimationTypes::kLandDeath, 4, AnimationTypes::kStanding, 0);
|
||||
_animations->initAnim(AnimationTypes::kLandDeath, kAnimationType_4, AnimationTypes::kStanding, 0);
|
||||
actor->controlMode = ControlMode::kNoMove;
|
||||
} else {
|
||||
_sound->playSample(Samples::Explode, 1, actor->x, actor->y, actor->z, a);
|
||||
|
@ -923,7 +923,7 @@ int32 TwinEEngine::runGameEngine() { // mainLoopInteration
|
|||
if (IS_HERO(a)) {
|
||||
if (_actor->heroBehaviour != HeroBehaviourType::kProtoPack || actor->anim != AnimationTypes::kForward) {
|
||||
if (!_actor->cropBottomScreen) {
|
||||
_animations->initAnim(AnimationTypes::kDrawn, 4, AnimationTypes::kStanding, 0);
|
||||
_animations->initAnim(AnimationTypes::kDrawn, kAnimationType_4, AnimationTypes::kStanding, 0);
|
||||
_renderer->projectPositionOnScreen(actor->x - _grid->cameraX, actor->y - _grid->cameraY, actor->z - _grid->cameraZ);
|
||||
_actor->cropBottomScreen = _renderer->projPosY;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue