TWINE: replaced magic numbers
This commit is contained in:
parent
9d8eaa3f97
commit
4010c23d69
7 changed files with 13 additions and 11 deletions
|
@ -492,12 +492,12 @@ void Actor::processActorExtraBonus(int32 actorIdx) { // GiveExtraBonus
|
|||
return;
|
||||
}
|
||||
if (actor->dynamicFlags.bIsDead) {
|
||||
_engine->_extra->addExtraBonus(actor->x, actor->y, actor->z, ANGLE_90, 0, bonusSprite, actor->bonusAmount);
|
||||
_engine->_extra->addExtraBonus(actor->x, actor->y, actor->z, ANGLE_90, ANGLE_0, bonusSprite, actor->bonusAmount);
|
||||
_engine->_sound->playSample(Samples::ItemPopup, 1, actor->x, actor->y, actor->z, actorIdx);
|
||||
} else {
|
||||
ActorStruct *sceneHero = _engine->_scene->sceneHero;
|
||||
const int32 angle = _engine->_movements->getAngleAndSetTargetActorDistance(actor->x, actor->z, sceneHero->x, sceneHero->z);
|
||||
_engine->_extra->addExtraBonus(actor->x, actor->y + actor->boudingBox.y.topRight, actor->z, 200, angle, bonusSprite, actor->bonusAmount);
|
||||
_engine->_extra->addExtraBonus(actor->x, actor->y + actor->boudingBox.y.topRight, actor->z, ANGLE_70, angle, bonusSprite, actor->bonusAmount);
|
||||
_engine->_sound->playSample(Samples::ItemPopup, 1, actor->x, actor->y + actor->boudingBox.y.topRight, actor->z, actorIdx);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,11 +40,11 @@
|
|||
namespace TwinE {
|
||||
|
||||
static const int32 magicLevelStrengthOfHit[] = {
|
||||
kNoBallStrength,
|
||||
kYellowBallStrength,
|
||||
kGreenBallStrength,
|
||||
kRedBallStrength,
|
||||
kFireBallStrength,
|
||||
MagicballStrengthType::kNoBallStrength,
|
||||
MagicballStrengthType::kYellowBallStrength,
|
||||
MagicballStrengthType::kGreenBallStrength,
|
||||
MagicballStrengthType::kRedBallStrength,
|
||||
MagicballStrengthType::kFireBallStrength,
|
||||
0
|
||||
};
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ struct OverlayListStruct {
|
|||
int16 info0 = 0; // sprite/3d model entry | number | number range
|
||||
int16 x = 0;
|
||||
int16 y = 0;
|
||||
int16 info1 = 0; // followed actor | total coins
|
||||
int16 info1 = 0; // text = actor | total coins
|
||||
OverlayPosType posType = OverlayPosType::koNormal;
|
||||
int16 lifeTime = 0;
|
||||
};
|
||||
|
|
|
@ -447,7 +447,7 @@ void Scene::processZoneExtraBonus(ZoneStruct *zone) {
|
|||
|
||||
const int16 amount = zone->infoData.Bonus.amount;
|
||||
const int32 angle = _engine->_movements->getAngleAndSetTargetActorDistance(ABS(zone->topRight.x + zone->bottomLeft.x) / 2, ABS(zone->topRight.z + zone->bottomLeft.z) / 2, sceneHero->x, sceneHero->z);
|
||||
const int32 index = _engine->_extra->addExtraBonus(ABS(zone->topRight.x + zone->bottomLeft.x) / 2, zone->topRight.y, ABS(zone->topRight.z + zone->bottomLeft.z) / 2, 180, angle, bonusSprite, amount);
|
||||
const int32 index = _engine->_extra->addExtraBonus(ABS(zone->topRight.x + zone->bottomLeft.x) / 2, zone->topRight.y, ABS(zone->topRight.z + zone->bottomLeft.z) / 2, ANGLE_63, angle, bonusSprite, amount);
|
||||
|
||||
if (index != -1) {
|
||||
_engine->_extra->extraList[index].type |= 0x400;
|
||||
|
|
|
@ -1331,7 +1331,7 @@ static int32 lSET_HOLO_POS(TwinEEngine *engine, LifeScriptContext &ctx) {
|
|||
static int32 location = ctx.stream.readByte();
|
||||
engine->_holomap->setHolomapPosition(location);
|
||||
if (engine->_gameState->hasItem(InventoryItems::kiHolomap)) {
|
||||
engine->_redraw->addOverlay(OverlayType::koInventoryItem, 0, 0, 0, 0, OverlayPosType::koNormal, 3);
|
||||
engine->_redraw->addOverlay(OverlayType::koInventoryItem, InventoryItems::kiHolomap, 0, 0, 0, OverlayPosType::koNormal, 3);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -123,6 +123,8 @@ enum class ExtraSpecialType {
|
|||
#define ANGLE_180 512
|
||||
#define ANGLE_135 384
|
||||
#define ANGLE_90 256
|
||||
#define ANGLE_70 200
|
||||
#define ANGLE_63 180
|
||||
#define ANGLE_45 128
|
||||
#define ANGLE_0 0
|
||||
|
||||
|
|
|
@ -570,7 +570,7 @@ void TwinEEngine::processInventoryAction() {
|
|||
_scene->sceneHero->life = 50;
|
||||
_gameState->inventoryMagicPoints = _gameState->magicLevelIdx * 20;
|
||||
_gameState->inventoryNumLeafs--;
|
||||
_redraw->addOverlay(OverlayType::koInventoryItem, 27, 0, 0, 0, OverlayPosType::koNormal, 3);
|
||||
_redraw->addOverlay(OverlayType::koInventoryItem, InventoryItems::kiCloverLeaf, 0, 0, 0, OverlayPosType::koNormal, 3);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue