[Scummvm-git-logs] scummvm master -> bad74a45c05d3ff4678ce460b7dbc31331954e06
Strangerke
noreply at scummvm.org
Fri Jan 17 07:59:38 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
bad74a45c0 GOT: Start renaming ACTOR
Commit: bad74a45c05d3ff4678ce460b7dbc31331954e06
https://github.com/scummvm/scummvm/commit/bad74a45c05d3ff4678ce460b7dbc31331954e06
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-01-17T08:59:28+01:00
Commit Message:
GOT: Start renaming ACTOR
Changed paths:
engines/got/console.cpp
engines/got/data/actor.cpp
engines/got/data/actor.h
engines/got/data/level.h
engines/got/game/back.cpp
engines/got/game/boss1.cpp
engines/got/game/boss2.cpp
engines/got/game/boss3.cpp
engines/got/game/init.cpp
engines/got/game/main.cpp
engines/got/game/move.cpp
engines/got/game/move_patterns.cpp
engines/got/game/object.cpp
engines/got/game/script.cpp
engines/got/game/shot_movement.cpp
engines/got/game/shot_pattern.cpp
engines/got/game/special_tile.cpp
engines/got/game/status.cpp
engines/got/gfx/image.cpp
engines/got/got.cpp
engines/got/views/game_content.cpp
engines/got/views/game_status.cpp
diff --git a/engines/got/console.cpp b/engines/got/console.cpp
index acc88eb4692..ebbcc42d9c9 100644
--- a/engines/got/console.cpp
+++ b/engines/got/console.cpp
@@ -145,8 +145,8 @@ bool Console::cmdLevel(int argc, const char **argv) {
}
bool Console::cmdFlying(int argc, const char **argv) {
- _G(thor)->flying = !_G(thor)->flying;
- debugPrintf("Flying is %s\n", _G(thor)->flying ? "on" : "off");
+ _G(thor)->_flying = !_G(thor)->_flying;
+ debugPrintf("Flying is %s\n", _G(thor)->_flying ? "on" : "off");
return true;
}
diff --git a/engines/got/data/actor.cpp b/engines/got/data/actor.cpp
index f0d3c4d0a84..682d5db939f 100644
--- a/engines/got/data/actor.cpp
+++ b/engines/got/data/actor.cpp
@@ -26,31 +26,31 @@
namespace Got {
void ACTOR::loadFixed(Common::SeekableReadStream *src) {
- move = src->readByte();
- width = src->readByte();
- height = src->readByte();
- directions = src->readByte();
- frames = src->readByte();
- frame_speed = src->readByte();
- src->read(frame_sequence, 4);
- speed = src->readByte();
- size_x = src->readByte();
- size_y = src->readByte();
- strength = src->readByte();
- health = src->readByte();
- num_moves = src->readByte();
- shot_type = src->readByte();
- shot_pattern = src->readByte();
- shots_allowed = src->readByte();
- solid = src->readByte();
- flying = src->readByte();
- rating = src->readByte();
- type = src->readByte();
- src->read(name, 9);
- func_num = src->readByte();
- func_pass = src->readByte();
- magic_hurts = src->readSint16LE();
- src->read(future1, 4);
+ _moveType = src->readByte();
+ _width = src->readByte();
+ _height = src->readByte();
+ _directions = src->readByte();
+ _framesPerDirection = src->readByte();
+ _frameSpeed = src->readByte();
+ src->read(_frameSequence, 4);
+ _speed = src->readByte();
+ _sizeX = src->readByte();
+ _sizeY = src->readByte();
+ _hitStrength = src->readByte();
+ _health = src->readByte();
+ _numMoves = src->readByte();
+ _shotType = src->readByte();
+ _shotPattern = src->readByte();
+ _numShotsAllowed = src->readByte();
+ _solid = src->readByte();
+ _flying = src->readByte() == 1;
+ _dropRating = src->readByte();
+ _type = src->readByte();
+ src->read(_name, 9);
+ _funcNum = src->readByte();
+ _funcPass = src->readByte();
+ _magicHurts = src->readSint16LE();
+ src->read(_future1, 4);
}
void ACTOR::loadFixed(const byte *src) {
@@ -59,31 +59,31 @@ void ACTOR::loadFixed(const byte *src) {
}
void ACTOR::copyFixedAndPics(const ACTOR &src) {
- move = src.move;
- width = src.width;
- height = src.height;
- directions = src.directions;
- frames = src.frames;
- frame_speed = src.frame_speed;
- Common::copy(src.frame_sequence, src.frame_sequence + 4, frame_sequence);
- speed = src.speed;
- size_x = src.size_x;
- size_y = src.size_y;
- strength = src.strength;
- health = src.health;
- num_moves = src.num_moves;
- shot_type = src.shot_type;
- shot_pattern = src.shot_pattern;
- shots_allowed = src.shots_allowed;
- solid = src.solid;
- flying = src.flying;
- rating = src.rating;
- type = src.type;
- Common::copy(src.name, src.name + 9, name);
- func_num = src.func_num;
- func_pass = src.func_pass;
- magic_hurts = src.magic_hurts;
- Common::copy(src.future1, src.future1 + 4, future1);
+ _moveType = src._moveType;
+ _width = src._width;
+ _height = src._height;
+ _directions = src._directions;
+ _framesPerDirection = src._framesPerDirection;
+ _frameSpeed = src._frameSpeed;
+ Common::copy(src._frameSequence, src._frameSequence + 4, _frameSequence);
+ _speed = src._speed;
+ _sizeX = src._sizeX;
+ _sizeY = src._sizeY;
+ _hitStrength = src._hitStrength;
+ _health = src._health;
+ _numMoves = src._numMoves;
+ _shotType = src._shotType;
+ _shotPattern = src._shotPattern;
+ _numShotsAllowed = src._numShotsAllowed;
+ _solid = src._solid;
+ _flying = src._flying;
+ _dropRating = src._dropRating;
+ _type = src._type;
+ Common::copy(src._name, src._name + 9, _name);
+ _funcNum = src._funcNum;
+ _funcPass = src._funcPass;
+ _magicHurts = src._magicHurts;
+ Common::copy(src._future1, src._future1 + 4, _future1);
// Copy all the surfaces for all the directions over
for (int d = 0; d < DIRECTION_COUNT; ++d) {
@@ -97,54 +97,54 @@ ACTOR &ACTOR::operator=(const ACTOR &src) {
copyFixedAndPics(src);
// Copy temporary fields
- frame_count = src.frame_count;
- dir = src.dir;
- last_dir = src.last_dir;
- x = src.x;
- y = src.y;
- center = src.center;
- Common::copy(src.last_x, src.last_x + 2, last_x);
- Common::copy(src.last_y, src.last_y + 2, last_y);
- used = src.used;
- next = src.next;
- speed_count = src.speed_count;
- vunerable = src.vunerable;
- shot_cnt = src.shot_cnt;
- num_shots = src.num_shots;
- creator = src.creator;
- pause = src.pause;
- actor_num = src.actor_num;
- move_count = src.move_count;
- dead = src.dead;
- toggle = src.toggle;
- center_x = src.center_x;
- center_y = src.center_y;
- show = src.show;
- temp1 = src.temp1;
- temp2 = src.temp2;
- counter = src.counter;
- move_counter = src.move_counter;
- edge_counter = src.edge_counter;
- temp3 = src.temp3;
- temp4 = src.temp4;
- temp5 = src.temp5;
- hit_thor = src.hit_thor;
- rand = src.rand;
- init_dir = src.init_dir;
- pass_value = src.pass_value;
- shot_actor = src.shot_actor;
- magic_hit = src.magic_hit;
- temp6 = src.temp6;
- i1 = src.i1;
- i2 = src.i2;
- i3 = src.i3;
- i4 = src.i4;
- i5 = src.i5;
- i6 = src.i6;
- init_health = src.init_health;
- talk_counter = src.talk_counter;
- etype = src.etype;
- Common::copy(src.future2, src.future2 + 25, future2);
+ _frameCount = src._frameCount;
+ _dir = src._dir;
+ _lastDir = src._lastDir;
+ _x = src._x;
+ _y = src._y;
+ _center = src._center;
+ Common::copy(src._lastX, src._lastX + 2, _lastX);
+ Common::copy(src._lastY, src._lastY + 2, _lastY);
+ _active = src._active;
+ _nextFrame = src._nextFrame;
+ _moveCountdown = src._moveCountdown;
+ _vulnerableCountdown = src._vulnerableCountdown;
+ _shotCountdown = src._shotCountdown;
+ _currNumShots = src._currNumShots;
+ _creator = src._creator;
+ _unpauseCountdown = src._unpauseCountdown;
+ _actorNum = src._actorNum;
+ _moveCount = src._moveCount;
+ _dead = src._dead;
+ _toggle = src._toggle;
+ _centerX = src._centerX;
+ _centerY = src._centerY;
+ _show = src._show;
+ _temp1 = src._temp1;
+ _temp2 = src._temp2;
+ _counter = src._counter;
+ _moveCounter = src._moveCounter;
+ _edgeCounter = src._edgeCounter;
+ _temp3 = src._temp3;
+ _temp4 = src._temp4;
+ _temp5 = src._temp5;
+ _hitThor = src._hitThor;
+ _rand = src._rand;
+ _initDir = src._initDir;
+ _passValue = src._passValue;
+ _shotActor = src._shotActor;
+ _magicHit = src._magicHit;
+ _temp6 = src._temp6;
+ _i1 = src._i1;
+ _i2 = src._i2;
+ _i3 = src._i3;
+ _i4 = src._i4;
+ _i5 = src._i5;
+ _i6 = src._i6;
+ _initHealth = src._initHealth;
+ _talkCounter = src._talkCounter;
+ _eType = src._eType;
+ Common::copy(src._future2, src._future2 + 25, _future2);
return *this;
}
diff --git a/engines/got/data/actor.h b/engines/got/data/actor.h
index ac3233b3f82..1614c1b43ac 100644
--- a/engines/got/data/actor.h
+++ b/engines/got/data/actor.h
@@ -32,79 +32,79 @@ namespace Got {
struct ACTOR { // Size=256
// First part loaded from disk (size=40)
- byte move = 0; // Movement pattern (0=none)
- byte width = 0; // Physical width
- byte height = 0; // Physical height
- byte directions = 0; // 1,2 or 4 (1=uni-directional)
- byte frames = 0; // # frames per direction
- byte frame_speed = 0; // # cycles between frame changes
- byte frame_sequence[4] = {}; // Sequence
- byte speed = 0; // Move every Nth cycle
- byte size_x = 0; // Non-physical padding on X coordinate
- byte size_y = 0; // Non-physical padding on Y coordinate
- byte strength = 0; // Hit strength
- byte health = 0; //
- byte num_moves = 0; // # of moves every <speed> cycles
- byte shot_type = 0; // Actor # of shot
- byte shot_pattern = 0; // Func number to decide to shoot
- byte shots_allowed = 0; // # shots allowed on screen
- byte solid = 0; // 1=solid (not ghost,etc)
- byte flying = 0; //
- byte rating = 0; // rnd(100) < rating = jewel
- byte type = 0; // Actor (0=thor,1=hammer,2=enemy,3=shot)
- char name[9] = {}; // Actors name
- byte func_num = 0; // Special function when thor touches
- byte func_pass = 0; // Value to pass to func
- uint16 magic_hurts = 0; // Bitwise magic hurts flags
- byte future1[4] = {};
+ byte _moveType = 0; // Movement pattern (0=none)
+ byte _width = 0; // Physical width
+ byte _height = 0; // Physical height
+ byte _directions = 0; // 1,2 or 4 (1=uni-directional)
+ byte _framesPerDirection = 0; // # frames per direction
+ byte _frameSpeed = 0; // # cycles between frame changes
+ byte _frameSequence[4] = {}; // Sequence
+ byte _speed = 0; // Move every Nth cycle
+ byte _sizeX = 0; // Non-physical padding on X coordinate
+ byte _sizeY = 0; // Non-physical padding on Y coordinate
+ byte _hitStrength = 0; // Hit strength
+ byte _health = 0; //
+ byte _numMoves = 0; // # of moves every <_speed> cycles
+ byte _shotType = 0; // Actor # of shot
+ byte _shotPattern = 0; // Func number to decide to shoot
+ byte _numShotsAllowed = 0; // # shots allowed on screen
+ byte _solid = 0; // 1=solid (not ghost,etc)
+ bool _flying = false; //
+ byte _dropRating = 0; // rnd(100) < _dropRating = jewel
+ byte _type = 0; // Actor (0=thor,1=hammer,2=enemy,3=shot)
+ char _name[9] = {}; // Actors name
+ byte _funcNum = 0; // Special function when thor touches
+ byte _funcPass = 0; // Value to pass to func
+ uint16 _magicHurts = 0; // Bitwise magic hurts flags
+ byte _future1[4] = {}; // Padding
- // The rest is dynamic //size=216
+ // The rest is dynamic //size=216
// Direction/frame surfaces
Graphics::ManagedSurface pic[DIRECTION_COUNT][FRAME_COUNT];
- byte frame_count = 0; // Count to switch frames
- byte dir = 0; // Direction of travel
- byte last_dir = 0; // Last direction of travel
- int x = 0; // Actual X coordinate
- int y = 0; // Actual Y coordinate
- int center = 0; // Center of object
- int last_x[2] = {}; // Last X coordinate on each page
- int last_y[2] = {}; // Last Y coordinate on each page
- byte used = 0; // 1=active, 0=not active
- byte next = 0; // Next frame to be shown
- byte speed_count = 0; // Count down to movement
- byte vunerable = 0; // Count down to vulnerability
- byte shot_cnt = 0; // Count down to another shot
- byte num_shots = 0; // # of shots currently on screen
- byte creator = 0; // Which actor # created this actor
- byte pause = 0; // Pause must be 0 to move
- byte actor_num = 0;
- byte move_count = 0;
- byte dead = 0;
- byte toggle = 0;
- byte center_x = 0;
- byte center_y = 0;
- byte show = 0; // Display or not (for blinking)
- byte temp1 = 0;
- byte temp2 = 0;
- byte counter = 0;
- byte move_counter = 0;
- byte edge_counter = 0;
- byte temp3 = 0;
- byte temp4 = 0;
- byte temp5 = 0;
- byte hit_thor = 0;
- int rand = 0;
- byte init_dir = 0;
- byte pass_value = 0;
- byte shot_actor = 0;
- byte magic_hit = 0;
- byte temp6 = 0;
- int i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0;
- byte init_health = 0;
- byte talk_counter = 0;
- byte etype = 0;
- byte future2[25] = {};
+ byte _frameCount = 0; // Count to switch frames
+ byte _dir = 0; // Direction of travel
+ byte _lastDir = 0; // Last direction of travel
+ int _x = 0; // Actual X coordinate
+ int _y = 0; // Actual Y coordinate
+ int _center = 0; // Center of object
+ int _lastX[2] = {}; // Last X coordinate on each page
+ int _lastY[2] = {}; // Last Y coordinate on each page
+ byte _active = 0; //boolean // 1=active, 0=not active
+ byte _nextFrame = 0; // Next frame to be shown
+ byte _moveCountdown = 0; // Count down to movement
+ byte _vulnerableCountdown = 0; // Count down to vulnerability
+ byte _shotCountdown = 0; // Count down to another shot
+ byte _currNumShots = 0; // # of shots currently on screen
+ byte _creator = 0; // Which actor # created this actor
+ byte _unpauseCountdown = 0; // Must be 0 to move
+ byte _actorNum = 0;
+ byte _moveCount = 0;
+ byte _dead = 0;
+ byte _toggle = 0;
+ byte _centerX = 0;
+ byte _centerY = 0;
+ byte _show = 0; // Display or not (for blinking)
+ byte _temp1 = 0;
+ byte _temp2 = 0;
+ byte _counter = 0;
+ byte _moveCounter = 0;
+ byte _edgeCounter = 0;
+ byte _temp3 = 0;
+ byte _temp4 = 0;
+ byte _temp5 = 0;
+ byte _hitThor = 0; // boolean
+ int _rand = 0;
+ byte _initDir = 0;
+ byte _passValue = 0;
+ byte _shotActor = 0;
+ byte _magicHit = 0;
+ byte _temp6 = 0;
+ int _i1 = 0, _i2 = 0, _i3 = 0, _i4 = 0, _i5 = 0, _i6 = 0;
+ byte _initHealth = 0;
+ byte _talkCounter = 0;
+ byte _eType = 0; // unused
+ byte _future2[25] = {}; // padding
void loadFixed(Common::SeekableReadStream *src);
void loadFixed(const byte *src);
@@ -117,7 +117,7 @@ struct ACTOR { // Size=256
ACTOR &operator=(const ACTOR &src);
int getPos() const {
- return ((x + 7) / 16) + (((y + 8) / 16) * 20);
+ return ((_x + 7) / 16) + (((_y + 8) / 16) * 20);
}
};
diff --git a/engines/got/data/level.h b/engines/got/data/level.h
index 2308e3dd83d..1c00c2aef7c 100644
--- a/engines/got/data/level.h
+++ b/engines/got/data/level.h
@@ -49,7 +49,7 @@ public:
byte new_level[10] = {}; // 452 level jump for icon 200-204
byte new_level_loc[10] = {}; // 462 grid location to jump in to
byte area = 0; // 472 game area (1=forest,etc)
- byte actor_dir[16] = {}; // initial dir
+ byte actor_dir[16] = {}; // initial _dir
byte future[3] = {}; // 473
/**
diff --git a/engines/got/game/back.cpp b/engines/got/game/back.cpp
index daee50eb5b8..b9609fcab06 100644
--- a/engines/got/game/back.cpp
+++ b/engines/got/game/back.cpp
@@ -48,12 +48,12 @@ static const char *odinEndMessage;
void show_level(int new_level) {
_G(boss_active) = false;
if (!_G(shield_on))
- _G(actor[2]).used = 0;
+ _G(actor[2])._active = 0;
_G(bomb_flag) = false;
_G(slipping) = false;
- if (_G(scrn).icon[_G(thor)->center_y][_G(thor)->center_x] == 154)
- _G(thor)->dir = 0;
+ if (_G(scrn).icon[_G(thor)->_centerY][_G(thor)->_centerX] == 154)
+ _G(thor)->_dir = 0;
// The original copied 130 bytes from _G(scrn).static_object onwards into sd_data.
// This doesn't make sense, because that would put the ending in the middle of static_y.
@@ -64,14 +64,14 @@ void show_level(int new_level) {
_G(level_type) = _G(scrn).type;
- _G(thor)->next = 0;
+ _G(thor)->_nextFrame = 0;
show_objects();
show_enemies();
// The original was probably shortly displaying Thor in direction 0 before switching back to its prior position.
// This behavior wasn't noticed during initial playthrough by Dreammaster - Warning has been added so it can be checked eventually.
- if (_G(scrn).icon[_G(thor)->center_y][_G(thor)->center_x] == 154)
+ if (_G(scrn).icon[_G(thor)->_centerY][_G(thor)->_centerX] == 154)
warning("show_level - Potential short move missing");
if (_G(warp_flag))
@@ -80,13 +80,13 @@ void show_level(int new_level) {
if (_G(warp_scroll)) {
_G(warp_scroll) = false;
- if (_G(thor)->dir == 0)
+ if (_G(thor)->_dir == 0)
_G(current_level) = new_level + 10;
- else if (_G(thor)->dir == 1)
+ else if (_G(thor)->_dir == 1)
_G(current_level) = new_level - 10;
- else if (_G(thor)->dir == 2)
+ else if (_G(thor)->_dir == 2)
_G(current_level) = new_level + 1;
- else if (_G(thor)->dir == 3)
+ else if (_G(thor)->_dir == 3)
_G(current_level) = new_level - 1;
}
@@ -127,15 +127,15 @@ void show_level(int new_level) {
void show_level_done() {
_G(current_level) = _G(new_level);
- _G(thor_info).last_health = _G(thor)->health;
+ _G(thor_info).last_health = _G(thor)->_health;
_G(thor_info).last_magic = _G(thor_info).magic;
_G(thor_info).last_jewels = _G(thor_info).jewels;
_G(thor_info).last_keys = _G(thor_info).keys;
_G(thor_info).last_score = _G(thor_info).score;
_G(thor_info).last_item = _G(thor_info).item;
_G(thor_info).last_screen = _G(current_level);
- _G(thor_info).last_icon = ((_G(thor)->x + 8) / 16) + (((_G(thor)->y + 14) / 16) * 20);
- _G(thor_info).last_dir = _G(thor)->dir;
+ _G(thor_info).last_icon = ((_G(thor)->_x + 8) / 16) + (((_G(thor)->_y + 14) / 16) * 20);
+ _G(thor_info).last_dir = _G(thor)->_dir;
_G(thor_info).last_inventory = _G(thor_info).inventory;
_G(thor_info).last_object = _G(thor_info).object;
_G(thor_info).last_object_name = _G(thor_info).object_name;
@@ -179,8 +179,8 @@ void show_level_done() {
static void odin_speaks_end() {
// In case Thor is now dead, flag as such
- if (!_G(thor)->health) {
- _G(thor)->show = 0;
+ if (!_G(thor)->_health) {
+ _G(thor)->_show = 0;
_G(exit_flag) = 2;
}
@@ -245,11 +245,11 @@ void kill_enemies(int iy, int ix) {
int x1, y1, x2, y2;
for (int i = 3; i < MAX_ACTORS; i++) {
- if (_G(actor[i]).used) {
- x1 = _G(actor[i]).x;
- y1 = _G(actor[i]).y + _G(actor[i]).size_y - 2;
- x2 = (_G(actor[i]).x + _G(actor[i]).size_x);
- y2 = _G(actor[i]).y + _G(actor[i]).size_y - 1;
+ if (_G(actor[i])._active) {
+ x1 = _G(actor[i])._x;
+ y1 = _G(actor[i])._y + _G(actor[i])._sizeY - 2;
+ x2 = (_G(actor[i])._x + _G(actor[i])._sizeX);
+ y2 = _G(actor[i])._y + _G(actor[i])._sizeY - 1;
if (point_within(x1, y1, ix, iy, ix + 15, iy + 15))
actor_destroyed(&_G(actor[i]));
@@ -262,14 +262,14 @@ void kill_enemies(int iy, int ix) {
}
}
- x1 = _G(thor)->x;
- y1 = _G(thor)->y + 11;
+ x1 = _G(thor)->_x;
+ y1 = _G(thor)->_y + 11;
x2 = x1 + 13;
y2 = y1 + 5;
if (point_within(x1, y1, ix, iy, ix + 15, iy + 15) || point_within(x2, y1, ix, iy, ix + 15, iy + 15) || point_within(x1, y2, ix, iy, ix + 15, iy + 15) || point_within(x2, y2, ix, iy, ix + 15, iy + 15)) {
if (!_G(cheats).freezeHealth) {
- _G(thor)->health = 0;
+ _G(thor)->_health = 0;
g_events->send(GameMessage("THOR_DIES"));
}
}
@@ -307,16 +307,16 @@ void select_item() {
}
int actor_speaks(ACTOR *actr, int index, int item) {
- if (actr->type != 4)
+ if (actr->_type != 4)
return 0;
- int v = atoi(actr->name);
+ int v = atoi(actr->_name);
if (v < 1 || v > 20)
return 0;
long lind = (long)_G(current_level);
lind = lind * 1000;
- lind += (long)actr->actor_num;
+ lind += (long)actr->_actorNum;
Common::String str = Common::String::format("FACE%d", v);
if (Common::File::exists(Common::Path(str))) {
@@ -326,8 +326,8 @@ int actor_speaks(ACTOR *actr, int index, int item) {
execute_script(lind, _G(odin));
}
- if (!_G(thor)->health) {
- _G(thor)->show = 0;
+ if (!_G(thor)->_health) {
+ _G(thor)->_show = 0;
_G(exit_flag) = 2;
}
diff --git a/engines/got/game/boss1.cpp b/engines/got/game/boss1.cpp
index 31e42a3f5be..adcb3fc1bf6 100644
--- a/engines/got/game/boss1.cpp
+++ b/engines/got/game/boss1.cpp
@@ -42,88 +42,88 @@ int boss1_movement(ACTOR *actr) {
if (_G(boss_dead))
return boss1_dead();
- int d = actr->last_dir;
- if (actr->edge_counter) {
- actr->edge_counter--;
+ int d = actr->_lastDir;
+ if (actr->_edgeCounter) {
+ actr->_edgeCounter--;
goto done;
}
- x1 = actr->x;
- y1 = actr->y;
+ x1 = actr->_x;
+ y1 = actr->_y;
- if (overlap(actr->x + 2, actr->y + 8, actr->x + 30, actr->y + 30,
- _G(thor)->x, _G(thor)->y + 8, _G(thor)->x + 15, _G(thor)->y + 15)) {
+ if (overlap(actr->_x + 2, actr->_y + 8, actr->_x + 30, actr->_y + 30,
+ _G(thor)->_x, _G(thor)->_y + 8, _G(thor)->_x + 15, _G(thor)->_y + 15)) {
thor_damaged(actr);
}
- if (actr->temp3) { //start striking
- actr->temp3--;
- if (!actr->temp3)
+ if (actr->_temp3) { //start striking
+ actr->_temp3--;
+ if (!actr->_temp3)
play_sound(BOSS11, false);
if (_G(hourglass_flag))
- actr->num_moves = 3;
+ actr->_numMoves = 3;
else
- actr->num_moves = 6;
+ actr->_numMoves = 6;
goto done0;
}
// Strike
- if (actr->temp1) {
- actr->temp1--;
- if (actr->x < (_G(thor_x1) + 12))
- actr->temp1 = 0;
- actr->temp2 = 1;
+ if (actr->_temp1) {
+ actr->_temp1--;
+ if (actr->_x < (_G(thor_x1) + 12))
+ actr->_temp1 = 0;
+ actr->_temp2 = 1;
d = 2;
- actr->x -= 2;
+ actr->_x -= 2;
- if (overlap(actr->x + 2, actr->y + 8, actr->x + 32, actr->y + 30,
- _G(thor)->x, _G(thor)->y + 8, _G(thor)->x + 15, _G(thor)->y + 15)) {
- actr->temp1 = 0;
+ if (overlap(actr->_x + 2, actr->_y + 8, actr->_x + 32, actr->_y + 30,
+ _G(thor)->_x, _G(thor)->_y + 8, _G(thor)->_x + 15, _G(thor)->_y + 15)) {
+ actr->_temp1 = 0;
goto done1;
}
- actr->next = 3;
- actr->num_moves = _G(setup).skill + 2;
+ actr->_nextFrame = 3;
+ actr->_numMoves = _G(setup).skill + 2;
goto done1;
}
- if (actr->temp2) { // Retreating
- if (actr->x < 256) {
+ if (actr->_temp2) { // Retreating
+ if (actr->_x < 256) {
d = 3;
- actr->x += 2;
- if (overlap(actr->x + 2, actr->y + 8, actr->x + 32, actr->y + 30,
- _G(thor)->x, _G(thor)->y + 8, _G(thor)->x + 15, _G(thor)->y + 15)) {
+ actr->_x += 2;
+ if (overlap(actr->_x + 2, actr->_y + 8, actr->_x + 32, actr->_y + 30,
+ _G(thor)->_x, _G(thor)->_y + 8, _G(thor)->_x + 15, _G(thor)->_y + 15)) {
goto done1;
}
- actr->num_moves = _G(setup).skill + 1;
+ actr->_numMoves = _G(setup).skill + 1;
goto done0;
}
- actr->temp2 = 0;
+ actr->_temp2 = 0;
}
- if (actr->x > _G(thor_x1) && ABS((_G(thor_y1)) - (actr->y + 20)) < 8) {
- actr->temp3 = 75;
- actr->temp1 = 130;
- actr->temp2 = 0;
+ if (actr->_x > _G(thor_x1) && ABS((_G(thor_y1)) - (actr->_y + 20)) < 8) {
+ actr->_temp3 = 75;
+ actr->_temp1 = 130;
+ actr->_temp2 = 0;
}
- if (actr->counter) {
- actr->counter--;
+ if (actr->_counter) {
+ actr->_counter--;
switch (d) {
case 1:
case 3:
- x1 = _G(actor[5]).x;
- y1 = _G(actor[5]).y;
+ x1 = _G(actor[5])._x;
+ y1 = _G(actor[5])._y;
y1 += 2;
if (!check_move2(x1, y1, &_G(actor[5])))
f = true;
else {
- actr->x = _G(actor[5]).x;
- actr->y = _G(actor[5]).y - 16;
+ actr->_x = _G(actor[5])._x;
+ actr->_y = _G(actor[5])._y - 16;
}
break;
case 0:
@@ -140,9 +140,9 @@ int boss1_movement(ACTOR *actr) {
f = true;
if (f) {
- actr->counter = g_events->getRandomNumber(10, 99);
+ actr->_counter = g_events->getRandomNumber(10, 99);
d = g_events->getRandomNumber(1);
- actr->edge_counter = 20;
+ actr->_edgeCounter = 20;
}
done:
@@ -151,56 +151,56 @@ done:
done0:
next_frame(actr);
- if (actr->next == 3)
- actr->next = 0;
+ if (actr->_nextFrame == 3)
+ actr->_nextFrame = 0;
done1:
- actr->last_dir = d;
-
- _G(actor[4]).next = actr->next;
- _G(actor[5]).next = actr->next;
- _G(actor[6]).next = actr->next;
-
- _G(actor[4]).last_dir = d;
- _G(actor[5]).last_dir = d;
- _G(actor[6]).last_dir = d;
-
- _G(actor[4]).x = actr->x + 16;
- _G(actor[4]).y = actr->y;
- _G(actor[5]).x = actr->x;
- _G(actor[5]).y = actr->y + 16;
- _G(actor[6]).x = actr->x + 16;
- _G(actor[6]).y = actr->y + 16;
- _G(actor[4]).num_moves = actr->num_moves;
- _G(actor[5]).num_moves = actr->num_moves;
- _G(actor[6]).num_moves = actr->num_moves;
-
- if (actr->directions == 1)
+ actr->_lastDir = d;
+
+ _G(actor[4])._nextFrame = actr->_nextFrame;
+ _G(actor[5])._nextFrame = actr->_nextFrame;
+ _G(actor[6])._nextFrame = actr->_nextFrame;
+
+ _G(actor[4])._lastDir = d;
+ _G(actor[5])._lastDir = d;
+ _G(actor[6])._lastDir = d;
+
+ _G(actor[4])._x = actr->_x + 16;
+ _G(actor[4])._y = actr->_y;
+ _G(actor[5])._x = actr->_x;
+ _G(actor[5])._y = actr->_y + 16;
+ _G(actor[6])._x = actr->_x + 16;
+ _G(actor[6])._y = actr->_y + 16;
+ _G(actor[4])._numMoves = actr->_numMoves;
+ _G(actor[5])._numMoves = actr->_numMoves;
+ _G(actor[6])._numMoves = actr->_numMoves;
+
+ if (actr->_directions == 1)
return 0;
return d;
}
void check_boss1_hit(ACTOR *actr, int x1, int y1, int x2, int y2, int act_num) {
- if (actr->move == 15 && act_num == 4) {
- if ((!_G(actor[3]).vunerable) && (_G(actor[3]).next != 3) &&
- overlap(x1, y1, x2, y2, actr->x + 6, actr->y + 4, actr->x + 14, actr->y + 20)) {
- actor_damaged(&_G(actor[3]), _G(hammer)->strength);
+ if (actr->_moveType == 15 && act_num == 4) {
+ if ((!_G(actor[3])._vulnerableCountdown) && (_G(actor[3])._nextFrame != 3) &&
+ overlap(x1, y1, x2, y2, actr->_x + 6, actr->_y + 4, actr->_x + 14, actr->_y + 20)) {
+ actor_damaged(&_G(actor[3]), _G(hammer)->_hitStrength);
if (_G(cheat) && _G(key_flag[_Z]))
- _G(actor[3]).health = 0;
+ _G(actor[3])._health = 0;
else
- _G(actor[3]).health -= 10;
+ _G(actor[3])._health -= 10;
- _G(actor[3]).speed_count = 50;
- _G(actor[3]).vunerable = 100;
+ _G(actor[3])._moveCountdown = 50;
+ _G(actor[3])._vulnerableCountdown = 100;
play_sound(BOSS13, true);
- _G(actor[3]).next = 1;
+ _G(actor[3])._nextFrame = 1;
for (int rep = 4; rep < 7; rep++) {
- _G(actor[rep]).next = 1;
- _G(actor[rep]).speed_count = 50;
+ _G(actor[rep])._nextFrame = 1;
+ _G(actor[rep])._moveCountdown = 50;
}
- if (_G(actor[3]).health == 0)
+ if (_G(actor[3])._health == 0)
_G(boss_dead) = true;
}
}
@@ -221,40 +221,40 @@ static int boss1_dead() {
int rep;
for (rep = 0; rep < 4; rep++) {
- int x1 = _G(actor[3 + rep]).last_x[_G(pge)];
- int y1 = _G(actor[3 + rep]).last_y[_G(pge)];
- int x = _G(actor[3 + rep]).x;
- int y = _G(actor[3 + rep]).y;
- int n = _G(actor[3 + rep]).actor_num;
- int r = _G(actor[3 + rep]).rating;
+ int x1 = _G(actor[3 + rep])._lastX[_G(pge)];
+ int y1 = _G(actor[3 + rep])._lastY[_G(pge)];
+ int x = _G(actor[3 + rep])._x;
+ int y = _G(actor[3 + rep])._y;
+ int n = _G(actor[3 + rep])._actorNum;
+ int r = _G(actor[3 + rep])._dropRating;
_G(actor[3 + rep]) = _G(explosion);
- _G(actor[3 + rep]).actor_num = n;
- _G(actor[3 + rep]).rating = r;
- _G(actor[3 + rep]).x = x;
- _G(actor[3 + rep]).y = y;
- _G(actor[3 + rep]).last_x[_G(pge)] = x1;
- _G(actor[3 + rep]).last_x[_G(pge) ^ 1] = x;
- _G(actor[3 + rep]).last_y[_G(pge)] = y1;
- _G(actor[3 + rep]).last_y[_G(pge) ^ 1] = y;
- _G(actor[3 + rep]).used = 1;
- _G(actor[3 + rep]).vunerable = 255;
- _G(actor[3 + rep]).move = 6;
- _G(actor[3 + rep]).next = rep;
- _G(actor[3 + rep]).speed = g_events->getRandomNumber(6, 8);
- _G(actor[3 + rep]).num_shots = (10 - _G(actor[3 + rep]).speed) * 10;
- _G(actor[3 + rep]).speed_count = _G(actor[3 + rep]).speed;
+ _G(actor[3 + rep])._actorNum = n;
+ _G(actor[3 + rep])._dropRating = r;
+ _G(actor[3 + rep])._x = x;
+ _G(actor[3 + rep])._y = y;
+ _G(actor[3 + rep])._lastX[_G(pge)] = x1;
+ _G(actor[3 + rep])._lastX[_G(pge) ^ 1] = x;
+ _G(actor[3 + rep])._lastY[_G(pge)] = y1;
+ _G(actor[3 + rep])._lastY[_G(pge) ^ 1] = y;
+ _G(actor[3 + rep])._active = 1;
+ _G(actor[3 + rep])._vulnerableCountdown = 255;
+ _G(actor[3 + rep])._moveType = 6;
+ _G(actor[3 + rep])._nextFrame = rep;
+ _G(actor[3 + rep])._speed = g_events->getRandomNumber(6, 8);
+ _G(actor[3 + rep])._currNumShots = (10 - _G(actor[3 + rep])._speed) * 10;
+ _G(actor[3 + rep])._moveCountdown = _G(actor[3 + rep])._speed;
}
play_sound(EXPLODE, true);
_G(boss_dead) = true;
for (rep = 7; rep < MAX_ACTORS; rep++) {
- if (_G(actor[rep]).used)
+ if (_G(actor[rep])._active)
actor_destroyed(&_G(actor[rep]));
}
}
- return _G(actor[3]).last_dir;
+ return _G(actor[3])._lastDir;
}
void closing_sequence1() {
@@ -266,8 +266,8 @@ void closing_sequence1() {
void closing_sequence1_2() {
_G(thor_info).armor = 1;
load_new_thor();
- _G(thor)->dir = 1;
- _G(thor)->next = 0;
+ _G(thor)->_dir = 1;
+ _G(thor)->_nextFrame = 0;
fill_score(20, "CLOSING");
}
diff --git a/engines/got/game/boss2.cpp b/engines/got/game/boss2.cpp
index b1a8957d362..172e3fd359c 100644
--- a/engines/got/game/boss2.cpp
+++ b/engines/got/game/boss2.cpp
@@ -69,43 +69,43 @@ int boss2_movement(ACTOR *actr) {
if (_G(boss_dead))
return boss2_die();
- if (actr->i1) {
- if (actr->i1 == 1)
+ if (actr->_i1) {
+ if (actr->_i1 == 1)
return boss2a_movement(actr);
return boss2b_movement(actr);
}
- int d = actr->last_dir;
- int x = actr->x;
+ int d = actr->_lastDir;
+ int x = actr->_x;
- if (actr->temp6)
- actr->temp6--;
+ if (actr->_temp6)
+ actr->_temp6--;
- if (!actr->temp6) {
+ if (!actr->_temp6) {
bool f = false;
drop_flag = false;
- if (actr->temp5)
- actr->temp5--;
+ if (actr->_temp5)
+ actr->_temp5--;
- if (!actr->temp5)
+ if (!actr->_temp5)
f = true;
else {
if (d == 2) {
if (x > 18)
- actr->x -= 2;
+ actr->_x -= 2;
else
f = true;
} else if (d == 3) {
if (x < 272)
- actr->x += 2;
+ actr->_x += 2;
else
f = true;
}
}
if (f) {
- actr->temp5 = _G(rand1) + 60;
+ actr->_temp5 = _G(rand1) + 60;
if (d == 2)
d = 3;
else
@@ -113,91 +113,91 @@ int boss2_movement(ACTOR *actr) {
}
}
- const int count = actr->frame_count - 1;
+ const int count = actr->_frameCount - 1;
if (count <= 0) {
- actr->next++;
- if (actr->next > 2)
- actr->next = 0;
- actr->frame_count = actr->frame_speed;
+ actr->_nextFrame++;
+ if (actr->_nextFrame > 2)
+ actr->_nextFrame = 0;
+ actr->_frameCount = actr->_frameSpeed;
} else
- actr->frame_count = count;
+ actr->_frameCount = count;
- x = actr->x;
- if (actr->num_shots < num_skulls && !drop_flag) {
+ x = actr->_x;
+ if (actr->_currNumShots < num_skulls && !drop_flag) {
if (x == 48 || x == 112 || x == 176 || x == 240) {
drop_flag = true;
- _G(actor[3]).temp6 = 40;
+ _G(actor[3])._temp6 = 40;
actor_always_shoots(actr, 1);
play_sound(FALL, false);
- _G(actor[actr->shot_actor]).x = actr->x + 12;
- _G(actor[actr->shot_actor]).y = actr->y + 32;
- _G(actor[actr->shot_actor]).temp2 = 0;
- _G(actor[actr->shot_actor]).temp3 = 4;
- _G(actor[actr->shot_actor]).temp4 = 4;
+ _G(actor[actr->_shotActor])._x = actr->_x + 12;
+ _G(actor[actr->_shotActor])._y = actr->_y + 32;
+ _G(actor[actr->_shotActor])._temp2 = 0;
+ _G(actor[actr->_shotActor])._temp3 = 4;
+ _G(actor[actr->_shotActor])._temp4 = 4;
}
}
- boss_set(d, x, actr->y);
+ boss_set(d, x, actr->_y);
- if (actr->directions == 1)
+ if (actr->_directions == 1)
return 0;
return d;
}
static void boss_set(int d, int x, int y) {
- _G(actor[4]).next = _G(actor[3]).next;
- _G(actor[5]).next = _G(actor[3]).next;
- _G(actor[6]).next = _G(actor[3]).next;
- _G(actor[3]).last_dir = d;
- _G(actor[4]).last_dir = d;
- _G(actor[5]).last_dir = d;
- _G(actor[6]).last_dir = d;
- _G(actor[4]).x = x + 16;
- _G(actor[4]).y = y;
- _G(actor[5]).x = x;
- _G(actor[5]).y = y + 16;
- _G(actor[6]).x = x + 16;
- _G(actor[6]).y = y + 16;
+ _G(actor[4])._nextFrame = _G(actor[3])._nextFrame;
+ _G(actor[5])._nextFrame = _G(actor[3])._nextFrame;
+ _G(actor[6])._nextFrame = _G(actor[3])._nextFrame;
+ _G(actor[3])._lastDir = d;
+ _G(actor[4])._lastDir = d;
+ _G(actor[5])._lastDir = d;
+ _G(actor[6])._lastDir = d;
+ _G(actor[4])._x = x + 16;
+ _G(actor[4])._y = y;
+ _G(actor[5])._x = x;
+ _G(actor[5])._y = y + 16;
+ _G(actor[6])._x = x + 16;
+ _G(actor[6])._y = y + 16;
}
void check_boss2_hit(ACTOR *actr, int x1, int y1, int x2, int y2, int act_num) {
- if ((!_G(actor[3]).vunerable)) {
+ if ((!_G(actor[3])._vulnerableCountdown)) {
int rep;
- actor_damaged(&_G(actor[3]), _G(hammer)->strength);
- _G(actor[3]).health -= 10;
- if (_G(actor[3]).health == 50) {
+ actor_damaged(&_G(actor[3]), _G(hammer)->_hitStrength);
+ _G(actor[3])._health -= 10;
+ if (_G(actor[3])._health == 50) {
play_sound(BOSS12, 1);
g_events->send("Game", GameMessage("PAUSE", 40));
- _G(actor[3]).i1 = 1;
- _G(actor[3]).i2 = 0;
+ _G(actor[3])._i1 = 1;
+ _G(actor[3])._i2 = 0;
memset(expf, 0, 60);
for (rep = 7; rep < MAX_ACTORS; rep++) {
- if (_G(actor[rep]).used)
+ if (_G(actor[rep])._active)
actor_destroyed(&_G(actor[rep]));
}
- _G(actor[3]).num_shots = 0;
+ _G(actor[3])._currNumShots = 0;
} else
play_sound(BOSS13, true);
- _G(actor[3]).speed_count = 75;
- _G(actor[3]).vunerable = 75;
- _G(actor[3]).next = 1;
+ _G(actor[3])._moveCountdown = 75;
+ _G(actor[3])._vulnerableCountdown = 75;
+ _G(actor[3])._nextFrame = 1;
for (rep = 4; rep < 7; rep++) {
- _G(actor[rep]).next = 1;
- _G(actor[rep]).speed_count = 50;
+ _G(actor[rep])._nextFrame = 1;
+ _G(actor[rep])._moveCountdown = 50;
}
- if (_G(actor[3]).health == 0) {
+ if (_G(actor[3])._health == 0) {
_G(boss_dead) = true;
for (rep = 7; rep < MAX_ACTORS; rep++) {
- if (_G(actor[rep]).used)
+ if (_G(actor[rep])._active)
actor_destroyed(&_G(actor[rep]));
}
}
@@ -223,54 +223,54 @@ static int boss2_die() {
_G(thunder_flag) = 0;
if (_G(boss_dead)) {
for (int rep = 0; rep < 4; rep++) {
- int x1 = _G(actor[3 + rep]).last_x[_G(pge)];
- int y1 = _G(actor[3 + rep]).last_y[_G(pge)];
- int x = _G(actor[3 + rep]).x;
- int y = _G(actor[3 + rep]).y;
- int n = _G(actor[3 + rep]).actor_num;
- int r = _G(actor[3 + rep]).rating;
+ int x1 = _G(actor[3 + rep])._lastX[_G(pge)];
+ int y1 = _G(actor[3 + rep])._lastY[_G(pge)];
+ int x = _G(actor[3 + rep])._x;
+ int y = _G(actor[3 + rep])._y;
+ int n = _G(actor[3 + rep])._actorNum;
+ int r = _G(actor[3 + rep])._dropRating;
_G(actor[3 + rep]) = _G(explosion);
- _G(actor[3 + rep]).actor_num = n;
- _G(actor[3 + rep]).rating = r;
- _G(actor[3 + rep]).x = x;
- _G(actor[3 + rep]).y = y;
- _G(actor[3 + rep]).last_x[_G(pge)] = x1;
- _G(actor[3 + rep]).last_x[_G(pge) ^ 1] = x;
- _G(actor[3 + rep]).last_y[_G(pge)] = y1;
- _G(actor[3 + rep]).last_y[_G(pge) ^ 1] = y;
- _G(actor[3 + rep]).used = 1;
- _G(actor[3 + rep]).vunerable = 255;
- _G(actor[3 + rep]).move = 6;
- _G(actor[3 + rep]).next = rep;
- _G(actor[3 + rep]).speed = g_events->getRandomNumber(6, 8);
- _G(actor[3 + rep]).num_shots = (10 - _G(actor[3 + rep]).speed) * 10;
- _G(actor[3 + rep]).speed_count = _G(actor[3 + rep]).speed;
+ _G(actor[3 + rep])._actorNum = n;
+ _G(actor[3 + rep])._dropRating = r;
+ _G(actor[3 + rep])._x = x;
+ _G(actor[3 + rep])._y = y;
+ _G(actor[3 + rep])._lastX[_G(pge)] = x1;
+ _G(actor[3 + rep])._lastX[_G(pge) ^ 1] = x;
+ _G(actor[3 + rep])._lastY[_G(pge)] = y1;
+ _G(actor[3 + rep])._lastY[_G(pge) ^ 1] = y;
+ _G(actor[3 + rep])._active = 1;
+ _G(actor[3 + rep])._vulnerableCountdown = 255;
+ _G(actor[3 + rep])._moveType = 6;
+ _G(actor[3 + rep])._nextFrame = rep;
+ _G(actor[3 + rep])._speed = g_events->getRandomNumber(6, 8);
+ _G(actor[3 + rep])._currNumShots = (10 - _G(actor[3 + rep])._speed) * 10;
+ _G(actor[3 + rep])._moveCountdown = _G(actor[3 + rep])._speed;
}
play_sound(EXPLODE, true);
_G(boss_dead) = true;
}
- return _G(actor[3]).last_dir;
+ return _G(actor[3])._lastDir;
}
// Boss - skull (explode)
static int boss2a_movement(ACTOR *actr) {
next_frame(actr);
- _G(actor[4]).next = actr->next;
- _G(actor[5]).next = actr->next;
- _G(actor[6]).next = actr->next;
- actr->vunerable = 20;
+ _G(actor[4])._nextFrame = actr->_nextFrame;
+ _G(actor[5])._nextFrame = actr->_nextFrame;
+ _G(actor[6])._nextFrame = actr->_nextFrame;
+ actr->_vulnerableCountdown = 20;
- if (actr->num_shots || _G(actor[5]).num_shots)
+ if (actr->_currNumShots || _G(actor[5])._currNumShots)
return 0;
play_sound(EXPLODE, true);
actor_always_shoots(&_G(actor[5]), 0);
- int an = _G(actor[5]).shot_actor;
- _G(actor[an]).move = 9;
+ int an = _G(actor[5])._shotActor;
+ _G(actor[an])._moveType = 9;
int r = _G(rand1) % 60;
while (expf[r]) {
@@ -281,16 +281,16 @@ static int boss2a_movement(ACTOR *actr) {
expf[r] = 1;
int x = (EXPLOSION[r] % 20) * 16;
int y = (EXPLOSION[r] / 20) * 16;
- _G(actor[an]).x = x;
- _G(actor[an]).y = y;
+ _G(actor[an])._x = x;
+ _G(actor[an])._y = y;
_G(scrn).icon[y / 16][x / 16] = _G(scrn).bg_color;
- _G(actor[3]).i2++;
- if (_G(actor[3]).i2 > 59) {
- _G(actor[3]).i1 = 2;
- _G(actor[3]).i2 = 0;
- _G(actor[3]).num_moves = 3;
+ _G(actor[3])._i2++;
+ if (_G(actor[3])._i2 > 59) {
+ _G(actor[3])._i1 = 2;
+ _G(actor[3])._i2 = 0;
+ _G(actor[3])._numMoves = 3;
}
return 0;
@@ -300,65 +300,65 @@ static int boss2a_movement(ACTOR *actr) {
static int boss2b_movement(ACTOR *actr) {
int rep, an, hx;
- if (_G(hammer)->used && _G(hammer)->move != 5) {
- hx = _G(hammer)->x;
- int hy = _G(hammer)->y;
+ if (_G(hammer)->_active && _G(hammer)->_moveType != 5) {
+ hx = _G(hammer)->_x;
+ int hy = _G(hammer)->_y;
for (rep = 7; rep < 15; rep++) {
- if (!_G(actor[rep]).used)
+ if (!_G(actor[rep])._active)
continue;
- if (overlap(hx + 1, hy + 1, hx + 10, hy + 10, _G(actor[rep]).x, _G(actor[rep]).y,
- _G(actor[rep]).x + _G(actor[rep]).size_x - 1, _G(actor[rep]).y + _G(actor[rep]).size_y - 1)) {
- _G(hammer)->move = 5;
+ if (overlap(hx + 1, hy + 1, hx + 10, hy + 10, _G(actor[rep])._x, _G(actor[rep])._y,
+ _G(actor[rep])._x + _G(actor[rep])._sizeX - 1, _G(actor[rep])._y + _G(actor[rep])._sizeY - 1)) {
+ _G(hammer)->_moveType = 5;
int d = reverse_direction(_G(hammer));
- _G(hammer)->dir = d;
+ _G(hammer)->_dir = d;
break;
}
}
}
- if (actr->i4) {
- actr->i4--;
- if (!actr->i4)
+ if (actr->_i4) {
+ actr->_i4--;
+ if (!actr->_i4)
_G(thunder_flag) = 0;
}
- if (!actr->i2) {
- if (actr->x < 144)
- actr->x += 2;
- else if (actr->x > 144)
- actr->x -= 2;
+ if (!actr->_i2) {
+ if (actr->_x < 144)
+ actr->_x += 2;
+ else if (actr->_x > 144)
+ actr->_x -= 2;
else {
- actr->i2 = 1;
- actr->i3 = 0;
+ actr->_i2 = 1;
+ actr->_i3 = 0;
}
goto done;
}
- if (_G(actor[4]).num_shots)
+ if (_G(actor[4])._currNumShots)
goto done;
- if (!actr->i3) {
- actr->i3 = g_events->getRandomNumber(2, 3);
+ if (!actr->_i3) {
+ actr->_i3 = g_events->getRandomNumber(2, 3);
}
- if (actr->i3 == 2)
- actr->x -= 2;
+ if (actr->_i3 == 2)
+ actr->_x -= 2;
else
- actr->x += 2;
+ actr->_x += 2;
- if (actr->x < 20 || actr->x > 270) {
+ if (actr->_x < 20 || actr->_x > 270) {
_G(thunder_flag) = 100;
- actr->i4 = 50;
+ actr->_i4 = 50;
play_sound(EXPLODE, true);
- actr->i2 = 0;
+ actr->_i2 = 0;
Common::fill(su, su + 18, 0);
actor_always_shoots(&_G(actor[4]), 1);
- an = _G(actor[4]).shot_actor;
- hx = (_G(thor)->x / 16);
- _G(actor[an]).x = _G(thor)->x; //hx*16;
- _G(actor[an]).y = g_events->getRandomNumber(15);
+ an = _G(actor[4])._shotActor;
+ hx = (_G(thor)->_x / 16);
+ _G(actor[an])._x = _G(thor)->_x; //hx*16;
+ _G(actor[an])._y = g_events->getRandomNumber(15);
su[hx] = 1;
- _G(actor[an]).next = g_events->getRandomNumber(3);
+ _G(actor[an])._nextFrame = g_events->getRandomNumber(3);
for (rep = 0; rep < num_spikes; rep++) {
while (1) {
hx = g_events->getRandomNumber(17);
@@ -367,16 +367,16 @@ static int boss2b_movement(ACTOR *actr) {
}
su[hx] = 1;
actor_always_shoots(&_G(actor[4]), 1);
- an = _G(actor[4]).shot_actor;
- _G(actor[an]).next = g_events->getRandomNumber(3);
- _G(actor[an]).x = 16 + hx * 16;
- _G(actor[an]).y = g_events->getRandomNumber(15);
+ an = _G(actor[4])._shotActor;
+ _G(actor[an])._nextFrame = g_events->getRandomNumber(3);
+ _G(actor[an])._x = 16 + hx * 16;
+ _G(actor[an])._y = g_events->getRandomNumber(15);
}
}
done:
next_frame(actr);
- boss_set(actr->dir, actr->x, actr->y);
+ boss_set(actr->_dir, actr->_x, actr->_y);
return 0;
}
@@ -388,8 +388,8 @@ void closing_sequence2() {
void closing_sequence2_2() {
_G(thor_info).armor = 10;
load_new_thor();
- _G(thor)->dir = 1;
- _G(thor)->next = 0;
+ _G(thor)->_dir = 1;
+ _G(thor)->_nextFrame = 0;
fill_score(20, "CLOSING");
}
@@ -417,10 +417,10 @@ void closing_sequence2_4() {
place_tile(19, 10, 202);
actor_visible(1);
actor_visible(2);
- _G(actor[7]).x = 288;
- _G(actor[7]).y = 160;
- _G(actor[8]).x = 304;
- _G(actor[8]).y = 160;
+ _G(actor[7])._x = 288;
+ _G(actor[7])._y = 160;
+ _G(actor[8])._x = 304;
+ _G(actor[8])._y = 160;
LEVEL lvl;
lvl.load(BOSS_LEVEL2);
diff --git a/engines/got/game/boss3.cpp b/engines/got/game/boss3.cpp
index edfeeda2ee3..6fca30e1bc1 100644
--- a/engines/got/game/boss3.cpp
+++ b/engines/got/game/boss3.cpp
@@ -50,23 +50,23 @@ static void check_boss_hit();
static void boss_change_mode();
static void set_boss(ACTOR *actr) {
- _G(actor[4]).next = actr->next;
- _G(actor[5]).next = actr->next;
- _G(actor[6]).next = actr->next;
-
- _G(actor[4]).last_dir = actr->dir;
- _G(actor[5]).last_dir = actr->dir;
- _G(actor[6]).last_dir = actr->dir;
- _G(actor[4]).dir = actr->dir;
- _G(actor[5]).dir = actr->dir;
- _G(actor[6]).dir = actr->dir;
-
- _G(actor[4]).x = actr->x + 16;
- _G(actor[4]).y = actr->y;
- _G(actor[5]).x = actr->x;
- _G(actor[5]).y = actr->y + 16;
- _G(actor[6]).x = actr->x + 16;
- _G(actor[6]).y = actr->y + 16;
+ _G(actor[4])._nextFrame = actr->_nextFrame;
+ _G(actor[5])._nextFrame = actr->_nextFrame;
+ _G(actor[6])._nextFrame = actr->_nextFrame;
+
+ _G(actor[4])._lastDir = actr->_dir;
+ _G(actor[5])._lastDir = actr->_dir;
+ _G(actor[6])._lastDir = actr->_dir;
+ _G(actor[4])._dir = actr->_dir;
+ _G(actor[5])._dir = actr->_dir;
+ _G(actor[6])._dir = actr->_dir;
+
+ _G(actor[4])._x = actr->_x + 16;
+ _G(actor[4])._y = actr->_y;
+ _G(actor[5])._x = actr->_x;
+ _G(actor[5])._y = actr->_y + 16;
+ _G(actor[6])._x = actr->_x + 16;
+ _G(actor[6])._y = actr->_y + 16;
}
// Boss - Loki-2
@@ -74,7 +74,7 @@ static int boss_movement_one(ACTOR *actr) {
int rx, ry, i, numPods = 0;
int fcount;
- actr->num_moves = 2;
+ actr->_numMoves = 2;
pod_speed = 2;
switch (_G(setup).skill) {
@@ -89,43 +89,43 @@ static int boss_movement_one(ACTOR *actr) {
break;
}
- if (!actr->temp1) {
+ if (!actr->_temp1) {
// Disappear
- actr->dir = 1;
- actr->frame_count = LFC;
- actr->next = 0;
- actr->temp1 = 1;
- actr->i6 = 1;
- actr->solid |= 128;
- _G(actor[4]).solid |= 128;
- _G(actor[5]).solid |= 128;
- _G(actor[6]).solid |= 128;
+ actr->_dir = 1;
+ actr->_frameCount = LFC;
+ actr->_nextFrame = 0;
+ actr->_temp1 = 1;
+ actr->_i6 = 1;
+ actr->_solid |= 128;
+ _G(actor[4])._solid |= 128;
+ _G(actor[5])._solid |= 128;
+ _G(actor[6])._solid |= 128;
play_sound(EXPLODE, true);
goto done;
}
- if (actr->i6) {
+ if (actr->_i6) {
// Fade out
- fcount = actr->frame_count - 1;
+ fcount = actr->_frameCount - 1;
if (fcount <= 0) {
- actr->next++;
- if (actr->next > 2) {
- actr->i6 = 0;
- actr->temp3 = 160;
+ actr->_nextFrame++;
+ if (actr->_nextFrame > 2) {
+ actr->_i6 = 0;
+ actr->_temp3 = 160;
}
- actr->frame_count = 3;
+ actr->_frameCount = 3;
} else
- actr->frame_count = fcount;
+ actr->_frameCount = fcount;
goto done1;
}
- if (actr->temp3 > 1) {
- actr->temp3--;
+ if (actr->_temp3 > 1) {
+ actr->_temp3--;
goto done1;
}
- if (actr->temp3) {
+ if (actr->_temp3) {
for (i = 0; i < num_pods1; i++)
- if (_G(actor[19 + i]).used)
+ if (_G(actor[19 + i])._active)
goto done1;
while (1) {
@@ -136,79 +136,79 @@ static int boss_movement_one(ACTOR *actr) {
break;
}
- actr->x = rx;
- actr->y = ry;
- actr->frame_count = LFC;
- actr->temp4 = 40;
- actr->temp3 = 0;
+ actr->_x = rx;
+ actr->_y = ry;
+ actr->_frameCount = LFC;
+ actr->_temp4 = 40;
+ actr->_temp3 = 0;
play_sound(EXPLODE, true);
goto done1;
}
- if (actr->temp4) {
+ if (actr->_temp4) {
// Fade in
- fcount = actr->frame_count - 1;
+ fcount = actr->_frameCount - 1;
if (fcount <= 0) {
- actr->next--;
- if (actr->next > 254) {
- actr->next = 0;
- actr->dir = 0;
- actr->temp4 = 0;
- actr->temp5 = 80;
- actr->solid &= 0x7f;
- _G(actor[4]).solid &= 0x7f;
- _G(actor[5]).solid &= 0x7f;
- _G(actor[6]).solid &= 0x7f;
+ actr->_nextFrame--;
+ if (actr->_nextFrame > 254) {
+ actr->_nextFrame = 0;
+ actr->_dir = 0;
+ actr->_temp4 = 0;
+ actr->_temp5 = 80;
+ actr->_solid &= 0x7f;
+ _G(actor[4])._solid &= 0x7f;
+ _G(actor[5])._solid &= 0x7f;
+ _G(actor[6])._solid &= 0x7f;
}
- actr->frame_count = 3;
+ actr->_frameCount = 3;
} else
- actr->frame_count = fcount;
+ actr->_frameCount = fcount;
goto done1;
}
- if (actr->temp5) {
+ if (actr->_temp5) {
// Shoot
- actr->temp5--;
- if (actr->temp5 == 20) {
- actr->next = 3;
+ actr->_temp5--;
+ if (actr->_temp5 == 20) {
+ actr->_nextFrame = 3;
goto done1;
}
- if (!actr->temp5) {
- if (_G(actor[4]).num_shots < _G(actor[4]).shots_allowed) {
+ if (!actr->_temp5) {
+ if (_G(actor[4])._currNumShots < _G(actor[4])._numShotsAllowed) {
actor_always_shoots(&_G(actor[4]), 0);
- const byte shot_actor = _G(actor[4]).shot_actor;
- _G(actor[shot_actor]).num_moves = pod_speed;
- _G(actor[shot_actor]).x = actr->x + 8;
- _G(actor[shot_actor]).y = actr->y + 16;
- _G(actor[shot_actor]).temp5 = 0;
+ const byte shot_actor = _G(actor[4])._shotActor;
+ _G(actor[shot_actor])._numMoves = pod_speed;
+ _G(actor[shot_actor])._x = actr->_x + 8;
+ _G(actor[shot_actor])._y = actr->_y + 16;
+ _G(actor[shot_actor])._temp5 = 0;
for (i = 0; i < numPods; i++)
_G(actor[20 + i]) = _G(actor[19]);
num_pods1 = numPods;
- actr->temp1 = 0;
+ actr->_temp1 = 0;
}
}
- if (actr->temp5 < 31)
+ if (actr->_temp5 < 31)
goto done1;
}
done:
- fcount = actr->frame_count - 1;
+ fcount = actr->_frameCount - 1;
if (fcount <= 0) {
- actr->next++;
- if (actr->next > 2)
- actr->next = 0;
- actr->frame_count = LFC;
+ actr->_nextFrame++;
+ if (actr->_nextFrame > 2)
+ actr->_nextFrame = 0;
+ actr->_frameCount = LFC;
} else
- actr->frame_count = fcount;
+ actr->_frameCount = fcount;
done1:
set_boss(actr);
- return actr->dir;
+ return actr->_dir;
}
// Boss - Loki-1
@@ -217,8 +217,8 @@ int boss3_movement(ACTOR *actr) {
int fcount;
- if (actr->temp2)
- actr->temp2--;
+ if (actr->_temp2)
+ actr->_temp2--;
if (_G(boss_dead))
return boss_die();
check_boss_hit();
@@ -228,142 +228,142 @@ int boss3_movement(ACTOR *actr) {
num_pods1 = 10;
switch (_G(setup).skill) {
case 0:
- actr->num_moves = 3;
- actr->speed = 2;
+ actr->_numMoves = 3;
+ actr->_speed = 2;
break;
case 1:
- actr->num_moves = 2;
- actr->speed = 1;
+ actr->_numMoves = 2;
+ actr->_speed = 1;
break;
case 2:
- actr->num_moves = 5;
- actr->speed = 2;
+ actr->_numMoves = 5;
+ actr->_speed = 2;
break;
}
- int d = actr->last_dir;
- actr->temp3++;
+ int d = actr->_lastDir;
+ actr->_temp3++;
int f = 0;
- if (actr->temp4) {
- actr->temp4--;
- if (!actr->temp4) {
- actr->temp3 = 0;
- _G(actor[3]).frame_speed = 4;
- _G(actor[3]).dir = 0;
- _G(actor[3]).last_dir = 0;
- _G(actor[3]).next = 3;
- _G(actor[4]).dir = 0;
- _G(actor[4]).last_dir = 0;
- _G(actor[4]).next = 3;
+ if (actr->_temp4) {
+ actr->_temp4--;
+ if (!actr->_temp4) {
+ actr->_temp3 = 0;
+ _G(actor[3])._frameSpeed = 4;
+ _G(actor[3])._dir = 0;
+ _G(actor[3])._lastDir = 0;
+ _G(actor[3])._nextFrame = 3;
+ _G(actor[4])._dir = 0;
+ _G(actor[4])._lastDir = 0;
+ _G(actor[4])._nextFrame = 3;
}
goto skip_move;
}
- if (actr->edge_counter)
- actr->edge_counter--;
+ if (actr->_edgeCounter)
+ actr->_edgeCounter--;
else
goto new_dir;
- if (overlap(actr->x + 2, actr->y + 8, actr->x + 30, actr->y + 30, _G(thor)->x, _G(thor)->y + 4, _G(thor)->x + 15, _G(thor)->y + 15))
+ if (overlap(actr->_x + 2, actr->_y + 8, actr->_x + 30, actr->_y + 30, _G(thor)->_x, _G(thor)->_y + 4, _G(thor)->_x + 15, _G(thor)->_y + 15))
thor_damaged(actr);
- ox = actr->x;
- oy = actr->y;
- switch (actr->temp5) {
+ ox = actr->_x;
+ oy = actr->_y;
+ switch (actr->_temp5) {
case 0:
- x1 = _G(actor[3]).x;
- y1 = _G(actor[3]).y - 2;
+ x1 = _G(actor[3])._x;
+ y1 = _G(actor[3])._y - 2;
if (!check_move2(x1, y1, &_G(actor[3]))) {
f = 1;
break;
}
if (!check_move2(x1 + 16, y1, &_G(actor[4])))
f = 1;
- actr->y = oy - 2;
+ actr->_y = oy - 2;
break;
case 1:
- x1 = _G(actor[5]).x;
- y1 = _G(actor[5]).y + 2;
+ x1 = _G(actor[5])._x;
+ y1 = _G(actor[5])._y + 2;
if (!check_move2(x1, y1, &_G(actor[5]))) {
f = 1;
break;
}
if (!check_move2(x1 + 16, y1, &_G(actor[6])))
f = 1;
- actr->y = oy + 2;
+ actr->_y = oy + 2;
break;
case 2:
- x1 = _G(actor[3]).x - 2;
- y1 = _G(actor[3]).y;
+ x1 = _G(actor[3])._x - 2;
+ y1 = _G(actor[3])._y;
if (!check_move2(x1, y1, &_G(actor[3]))) {
f = 1;
break;
}
if (!check_move2(x1, y1 + 16, &_G(actor[5])))
f = 1;
- actr->x = ox - 2;
+ actr->_x = ox - 2;
break;
case 3:
- x1 = _G(actor[4]).x + 2;
- y1 = _G(actor[4]).y;
+ x1 = _G(actor[4])._x + 2;
+ y1 = _G(actor[4])._y;
if (!check_move2(x1, y1, &_G(actor[4]))) {
f = 1;
break;
}
if (!check_move2(x1, y1 + 16, &_G(actor[6])))
f = 1;
- actr->x = ox + 2;
+ actr->_x = ox + 2;
break;
case 4: //ul
- x1 = _G(actor[3]).x - 2;
- y1 = _G(actor[3]).y - 2;
+ x1 = _G(actor[3])._x - 2;
+ y1 = _G(actor[3])._y - 2;
if (!check_move2(x1, y1, &_G(actor[3]))) {
f = 1;
break;
}
- actr->x = ox - 2;
- actr->y = oy - 2;
+ actr->_x = ox - 2;
+ actr->_y = oy - 2;
break;
case 5:
- x1 = _G(actor[4]).x + 2;
- y1 = _G(actor[4]).y - 2;
+ x1 = _G(actor[4])._x + 2;
+ y1 = _G(actor[4])._y - 2;
if (!check_move2(x1, y1, &_G(actor[4]))) {
f = 1;
break;
}
- actr->x = ox + 2;
- actr->y = oy - 2;
+ actr->_x = ox + 2;
+ actr->_y = oy - 2;
break;
case 6:
- x1 = _G(actor[6]).x + 2;
- y1 = _G(actor[6]).y + 2;
+ x1 = _G(actor[6])._x + 2;
+ y1 = _G(actor[6])._y + 2;
if (!check_move2(x1, y1, &_G(actor[6]))) {
f = 1;
break;
}
- actr->x = ox + 2;
- actr->y = oy + 2;
+ actr->_x = ox + 2;
+ actr->_y = oy + 2;
break;
case 7:
- x1 = _G(actor[5]).x - 2;
- y1 = _G(actor[5]).y + 2;
+ x1 = _G(actor[5])._x - 2;
+ y1 = _G(actor[5])._y + 2;
if (!check_move2(x1, y1, &_G(actor[5]))) {
f = 1;
break;
}
- actr->x = ox - 2;
- actr->y = oy + 2;
+ actr->_x = ox - 2;
+ actr->_y = oy + 2;
break;
}
- fcount = actr->frame_count - 1;
+ fcount = actr->_frameCount - 1;
if (fcount) {
- actr->next++;
- if (actr->next > 2)
- actr->next = 0;
- actr->frame_count = 30;
+ actr->_nextFrame++;
+ if (actr->_nextFrame > 2)
+ actr->_nextFrame = 0;
+ actr->_frameCount = 30;
} else
- actr->frame_count = fcount;
+ actr->_frameCount = fcount;
skip_move:
@@ -372,27 +372,27 @@ skip_move:
goto done;
new_dir:
- if (actr->temp3 < 120)
+ if (actr->_temp3 < 120)
goto new_dir1;
- _G(actor[3]).frame_speed = 8;
- _G(actor[3]).next = 3;
- _G(actor[4]).next = 3;
- actr->temp4 = 120;
+ _G(actor[3])._frameSpeed = 8;
+ _G(actor[3])._nextFrame = 3;
+ _G(actor[4])._nextFrame = 3;
+ actr->_temp4 = 120;
actor_always_shoots(actr, 0);
- _G(actor[actr->shot_actor]).x = actr->x + 8;
- _G(actor[actr->shot_actor]).y = actr->y - 8;
- _G(actor[actr->shot_actor]).temp1 = g_events->getRandomNumber(90, 189);
- _G(actor[actr->shot_actor]).temp5 = 30;
- _G(actor[actr->shot_actor]).speed = 2;
+ _G(actor[actr->_shotActor])._x = actr->_x + 8;
+ _G(actor[actr->_shotActor])._y = actr->_y - 8;
+ _G(actor[actr->_shotActor])._temp1 = g_events->getRandomNumber(90, 189);
+ _G(actor[actr->_shotActor])._temp5 = 30;
+ _G(actor[actr->_shotActor])._speed = 2;
play_sound(BOSS12, true);
new_dir1:
- actr->temp5 = _G(rand1) % 8;
- actr->edge_counter = _G(rand2) + 60;
+ actr->_temp5 = _G(rand1) % 8;
+ actr->_edgeCounter = _G(rand2) + 60;
done:
- if (actr->directions == 1)
+ if (actr->_directions == 1)
return 0;
return d;
}
@@ -400,55 +400,55 @@ done:
static void check_boss_hit() {
int rep;
- if (_G(actor[3]).solid & 128) {
+ if (_G(actor[3])._solid & 128) {
for (rep = 3; rep < 7; rep++)
- _G(actor[rep]).magic_hit = 0;
+ _G(actor[rep])._magicHit = 0;
return;
}
- if (_G(actor[3]).magic_hit || _G(actor[4]).magic_hit || _G(actor[5]).magic_hit || _G(actor[6]).magic_hit) {
- if (!_G(actor[3]).temp2) {
+ if (_G(actor[3])._magicHit || _G(actor[4])._magicHit || _G(actor[5])._magicHit || _G(actor[6])._magicHit) {
+ if (!_G(actor[3])._temp2) {
actor_damaged(&_G(actor[3]), 10);
if (_G(cheat) && _G(key_flag[_Z]))
- _G(actor[3]).health -= 50;
+ _G(actor[3])._health -= 50;
else
- _G(actor[3]).health -= 10;
+ _G(actor[3])._health -= 10;
- _G(actor[3]).speed_count = 50;
+ _G(actor[3])._moveCountdown = 50;
- _G(actor[3]).vunerable = 50;
+ _G(actor[3])._vulnerableCountdown = 50;
play_sound(BOSS13, true);
for (rep = 4; rep < 7; rep++) {
- _G(actor[rep]).magic_hit = 0;
- _G(actor[rep]).next = 1;
- _G(actor[rep]).speed_count = 50;
+ _G(actor[rep])._magicHit = 0;
+ _G(actor[rep])._nextFrame = 1;
+ _G(actor[rep])._moveCountdown = 50;
}
- if (_G(actor[3]).health == 0) {
+ if (_G(actor[3])._health == 0) {
_G(boss_dead) = true;
for (rep = 7; rep < MAX_ACTORS; rep++) {
- if (_G(actor[rep]).used)
+ if (_G(actor[rep])._active)
actor_destroyed(&_G(actor[rep]));
}
}
- if (_G(actor[3]).health == 50) {
+ if (_G(actor[3])._health == 50) {
boss_change_mode();
- _G(actor[3]).temp1 = 0;
- _G(actor[3]).temp2 = 0;
- _G(actor[3]).temp3 = 0;
- _G(actor[3]).temp4 = 0;
- _G(actor[3]).temp5 = 0;
- _G(actor[3]).i6 = 0;
- _G(actor[3]).speed_count = 2;
+ _G(actor[3])._temp1 = 0;
+ _G(actor[3])._temp2 = 0;
+ _G(actor[3])._temp3 = 0;
+ _G(actor[3])._temp4 = 0;
+ _G(actor[3])._temp5 = 0;
+ _G(actor[3])._i6 = 0;
+ _G(actor[3])._moveCountdown = 2;
} else {
- _G(actor[3]).temp2 = 40;
+ _G(actor[3])._temp2 = 40;
}
}
for (rep = 3; rep < 7; rep++)
- _G(actor[rep]).magic_hit = 0;
+ _G(actor[rep])._magicHit = 0;
}
}
@@ -484,37 +484,37 @@ void boss_level3() {
static int boss_die() {
if (_G(boss_dead)) {
for (int rep = 0; rep < 4; rep++) {
- int x1 = _G(actor[3 + rep]).last_x[_G(pge)];
- int y1 = _G(actor[3 + rep]).last_y[_G(pge)];
- int x = _G(actor[3 + rep]).x;
- int y = _G(actor[3 + rep]).y;
- int n = _G(actor[3 + rep]).actor_num;
- int r = _G(actor[3 + rep]).rating;
+ int x1 = _G(actor[3 + rep])._lastX[_G(pge)];
+ int y1 = _G(actor[3 + rep])._lastY[_G(pge)];
+ int x = _G(actor[3 + rep])._x;
+ int y = _G(actor[3 + rep])._y;
+ int n = _G(actor[3 + rep])._actorNum;
+ int r = _G(actor[3 + rep])._dropRating;
_G(actor[3 + rep]) = _G(explosion);
- _G(actor[3 + rep]).actor_num = n;
- _G(actor[3 + rep]).rating = r;
- _G(actor[3 + rep]).x = x;
- _G(actor[3 + rep]).y = y;
- _G(actor[3 + rep]).last_x[_G(pge)] = x1;
- _G(actor[3 + rep]).last_x[_G(pge) ^ 1] = x;
- _G(actor[3 + rep]).last_y[_G(pge)] = y1;
- _G(actor[3 + rep]).last_y[_G(pge) ^ 1] = y;
- _G(actor[3 + rep]).used = 1;
- _G(actor[3 + rep]).vunerable = 255;
- _G(actor[3 + rep]).move = 6;
- _G(actor[3 + rep]).next = rep;
- _G(actor[3 + rep]).speed = g_events->getRandomNumber(6, 8);
- _G(actor[3 + rep]).num_shots = (10 - _G(actor[3 + rep]).speed) * 10;
- _G(actor[3 + rep]).speed_count = _G(actor[3 + rep]).speed;
+ _G(actor[3 + rep])._actorNum = n;
+ _G(actor[3 + rep])._dropRating = r;
+ _G(actor[3 + rep])._x = x;
+ _G(actor[3 + rep])._y = y;
+ _G(actor[3 + rep])._lastX[_G(pge)] = x1;
+ _G(actor[3 + rep])._lastX[_G(pge) ^ 1] = x;
+ _G(actor[3 + rep])._lastY[_G(pge)] = y1;
+ _G(actor[3 + rep])._lastY[_G(pge) ^ 1] = y;
+ _G(actor[3 + rep])._active = 1;
+ _G(actor[3 + rep])._vulnerableCountdown = 255;
+ _G(actor[3 + rep])._moveType = 6;
+ _G(actor[3 + rep])._nextFrame = rep;
+ _G(actor[3 + rep])._speed = g_events->getRandomNumber(6, 8);
+ _G(actor[3 + rep])._currNumShots = (10 - _G(actor[3 + rep])._speed) * 10;
+ _G(actor[3 + rep])._moveCountdown = _G(actor[3 + rep])._speed;
}
play_sound(EXPLODE, true);
_G(boss_dead) = true;
}
- return _G(actor[3]).last_dir;
+ return _G(actor[3])._lastDir;
}
void closing_sequence3() {
@@ -544,14 +544,14 @@ void closing_sequence3_3() {
music_pause();
_G(new_level) = ENDING_SCREEN;
- _G(thor)->x = 152;
- _G(thor)->y = 160;
- _G(thor)->dir = 1;
+ _G(thor)->_x = 152;
+ _G(thor)->_y = 160;
+ _G(thor)->_dir = 1;
}
void ending_screen() {
for (int i = 3; i < MAX_ACTORS; i++)
- _G(actor[i]).move = 1;
+ _G(actor[i])._moveType = 1;
music_play(6, true);
_G(timer_cnt) = 0;
@@ -563,22 +563,22 @@ void ending_screen() {
expcnt = 0;
_G(actor[34]) = _G(explosion);
- _G(actor[34]).used = 0;
- _G(actor[34]).speed = 2;
- _G(actor[34]).speed_count = _G(actor[34]).speed;
- _G(actor[34]).num_shots = 3; // Used to reverse explosion
- _G(actor[34]).vunerable = 255;
- _G(actor[34]).i2 = 6;
+ _G(actor[34])._active = 0;
+ _G(actor[34])._speed = 2;
+ _G(actor[34])._moveCountdown = _G(actor[34])._speed;
+ _G(actor[34])._currNumShots = 3; // Used to reverse explosion
+ _G(actor[34])._vulnerableCountdown = 255;
+ _G(actor[34])._i2 = 6;
}
// Explode
int endgame_one() {
- if (_G(actor[34]).i2) {
- _G(actor[34]).i2--;
+ if (_G(actor[34])._i2) {
+ _G(actor[34])._i2--;
return 0;
}
- _G(actor[34]).i2 = 6;
+ _G(actor[34])._i2 = 6;
play_sound(EXPLODE, true);
int r = _G(rand1) % 32;
@@ -590,17 +590,17 @@ int endgame_one() {
expf[r / 8][r % 8] = 1;
int x = (EXPLOSION[r / 8][r % 8] % 20) * 16;
int y = (EXPLOSION[r / 8][r % 8] / 20) * 16;
- _G(actor[34]).x = x;
- _G(actor[34]).y = y;
- _G(actor[34]).used = 1;
- _G(actor[34]).next = 0;
- _G(actor[34]).num_shots = 3;
+ _G(actor[34])._x = x;
+ _G(actor[34])._y = y;
+ _G(actor[34])._active = 1;
+ _G(actor[34])._nextFrame = 0;
+ _G(actor[34])._currNumShots = 3;
_G(scrn).icon[y / 16][x / 16] = _G(scrn).bg_color;
_G(endgame++);
if (_G(endgame) > 32) {
- _G(actor[34]).used = 0;
+ _G(actor[34])._active = 0;
_G(endgame) = 0;
}
return 1;
@@ -614,11 +614,11 @@ int endgame_movement() {
endgame_one();
return 0;
}
- if (_G(actor[34]).i2) {
- _G(actor[34]).i2--;
+ if (_G(actor[34])._i2) {
+ _G(actor[34])._i2--;
return 0;
}
- _G(actor[34]).i2 = 6;
+ _G(actor[34])._i2 = 6;
play_sound(EXPLODE, true);
int r = _G(rand1) % 8;
@@ -630,11 +630,11 @@ int endgame_movement() {
expf[_G(exprow)][r] = 1;
int x = (EXPLOSION[_G(exprow)][r] % 20) * 16;
int y = (EXPLOSION[_G(exprow)][r] / 20) * 16;
- _G(actor[34]).x = x;
- _G(actor[34]).y = y;
- _G(actor[34]).used = 1;
- _G(actor[34]).next = 0;
- _G(actor[34]).num_shots = 3;
+ _G(actor[34])._x = x;
+ _G(actor[34])._y = y;
+ _G(actor[34])._active = 1;
+ _G(actor[34])._nextFrame = 0;
+ _G(actor[34])._currNumShots = 3;
_G(scrn).icon[y / 16][x / 16] = _G(scrn).bg_color;
_G(scrn).icon[(y / 16) - 4][x / 16] = _G(scrn).bg_color;
diff --git a/engines/got/game/init.cpp b/engines/got/game/init.cpp
index 429db4bc84e..1912b28b4b5 100644
--- a/engines/got/game/init.cpp
+++ b/engines/got/game/init.cpp
@@ -39,7 +39,7 @@ void setup_player() {
if (_G(area) > 2)
_G(thor_info).inventory |= BOOTS_MAGIC + WIND_MAGIC;
- _G(thor)->health = 150;
+ _G(thor)->_health = 150;
_G(thor_info).magic = _G(area) > 1 ? 150 : 0;
_G(thor_info).jewels = 0;
_G(thor_info).score = 0;
@@ -47,26 +47,26 @@ void setup_player() {
_G(thor_info).last_item = 0;
_G(thor_info).object = 0;
_G(thor_info).object_name = nullptr;
- _G(thor)->last_x[0] = _G(thor)->x;
- _G(thor)->last_x[1] = _G(thor)->x;
- _G(thor)->last_y[0] = _G(thor)->y;
- _G(thor)->last_y[1] = _G(thor)->y;
+ _G(thor)->_lastX[0] = _G(thor)->_x;
+ _G(thor)->_lastX[1] = _G(thor)->_x;
+ _G(thor)->_lastY[0] = _G(thor)->_y;
+ _G(thor)->_lastY[1] = _G(thor)->_y;
_G(thor_info).last_icon = (6 * 20) + 8;
_G(thor_info).last_screen = 23;
- _G(thor)->dir = 1;
+ _G(thor)->_dir = 1;
switch (_G(area)) {
case 1:
- _G(thor)->x = 152;
- _G(thor)->y = 96;
+ _G(thor)->_x = 152;
+ _G(thor)->_y = 96;
break;
case 2:
- _G(thor)->x = 32;
- _G(thor)->y = 32;
+ _G(thor)->_x = 32;
+ _G(thor)->_y = 32;
break;
case 3:
- _G(thor)->x = 272;
- _G(thor)->y = 80;
+ _G(thor)->_x = 272;
+ _G(thor)->_y = 80;
break;
default:
break;
@@ -79,7 +79,7 @@ void initialize_game() {
if (_G(demo)) {
g_vars->setArea(1);
- _G(thor)->health = 100;
+ _G(thor)->_health = 100;
_G(thor_info).magic = 100;
_G(thor_info).jewels = 463;
_G(thor_info).score = 12455;
@@ -100,7 +100,7 @@ void initialize_game() {
_G(demoKeys).pop();
}
- _G(thor)->speed_count = 6;
+ _G(thor)->_moveCountdown = 6;
// Load level data
_G(new_level) = _G(current_level);
diff --git a/engines/got/game/main.cpp b/engines/got/game/main.cpp
index 0972a7412ee..1a2d46ad73a 100644
--- a/engines/got/game/main.cpp
+++ b/engines/got/game/main.cpp
@@ -26,21 +26,21 @@
namespace Got {
void setup_load() {
- _G(thor)->used = 1;
+ _G(thor)->_active = 1;
_G(new_level) = _G(thor_info).last_screen;
- _G(thor)->x = (_G(thor_info).last_icon % 20) * 16;
- _G(thor)->y = ((_G(thor_info).last_icon / 20) * 16) - 1;
- if (_G(thor)->x < 1)
- _G(thor)->x = 1;
- if (_G(thor)->y < 0)
- _G(thor)->y = 0;
- _G(thor)->last_x[0] = _G(thor)->x;
- _G(thor)->last_x[1] = _G(thor)->x;
- _G(thor)->last_y[0] = _G(thor)->y;
- _G(thor)->last_y[1] = _G(thor)->y;
- _G(thor)->dir = _G(thor_info).last_dir;
- _G(thor)->last_dir = _G(thor_info).last_dir;
- _G(thor)->health = _G(thor_info).last_health;
+ _G(thor)->_x = (_G(thor_info).last_icon % 20) * 16;
+ _G(thor)->_y = ((_G(thor_info).last_icon / 20) * 16) - 1;
+ if (_G(thor)->_x < 1)
+ _G(thor)->_x = 1;
+ if (_G(thor)->_y < 0)
+ _G(thor)->_y = 0;
+ _G(thor)->_lastX[0] = _G(thor)->_x;
+ _G(thor)->_lastX[1] = _G(thor)->_x;
+ _G(thor)->_lastY[0] = _G(thor)->_y;
+ _G(thor)->_lastY[1] = _G(thor)->_y;
+ _G(thor)->_dir = _G(thor_info).last_dir;
+ _G(thor)->_lastDir = _G(thor_info).last_dir;
+ _G(thor)->_health = _G(thor_info).last_health;
_G(thor_info).magic = _G(thor_info).last_magic;
_G(thor_info).jewels = _G(thor_info).last_jewels;
_G(thor_info).keys = _G(thor_info).last_keys;
@@ -49,9 +49,9 @@ void setup_load() {
_G(thor_info).inventory = _G(thor_info).last_inventory;
_G(thor_info).object = _G(thor_info).last_object;
_G(thor_info).object_name = _G(thor_info).last_object_name;
- _G(thor)->num_moves = 1;
- _G(thor)->vunerable = 60;
- _G(thor)->show = 60;
+ _G(thor)->_numMoves = 1;
+ _G(thor)->_vulnerableCountdown = 60;
+ _G(thor)->_show = 60;
_G(hourglass_flag) = 0;
_G(apple_flag) = false;
_G(bomb_flag) = false;
@@ -59,9 +59,9 @@ void setup_load() {
_G(lightning_used) = false;
_G(tornado_used) = false;
_G(shield_on) = false;
- _G(actor[1]).used = 0;
- _G(actor[2]).used = 0;
- _G(thor)->speed_count = 6;
+ _G(actor[1])._active = 0;
+ _G(actor[2])._active = 0;
+ _G(thor)->_moveCountdown = 6;
_G(scrn).load(_G(new_level));
diff --git a/engines/got/game/move.cpp b/engines/got/game/move.cpp
index aff6c6117fe..4e70e4a2d94 100644
--- a/engines/got/game/move.cpp
+++ b/engines/got/game/move.cpp
@@ -31,17 +31,17 @@
namespace Got {
void next_frame(ACTOR *actr) {
- const int fcount = actr->frame_count - 1;
+ const int fcount = actr->_frameCount - 1;
if (fcount <= 0) {
- actr->next++;
+ actr->_nextFrame++;
- if (actr->next > 3)
- actr->next = 0;
+ if (actr->_nextFrame > 3)
+ actr->_nextFrame = 0;
- actr->frame_count = actr->frame_speed;
+ actr->_frameCount = actr->_frameSpeed;
} else
- actr->frame_count = fcount;
+ actr->_frameCount = fcount;
}
bool point_within(int x, int y, int x1, int y1, int x2, int y2) {
@@ -69,30 +69,30 @@ bool overlap(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) {
}
int reverse_direction(ACTOR *actr) {
- if (actr->dir == 1)
+ if (actr->_dir == 1)
return 0;
- if (actr->dir == 2)
+ if (actr->_dir == 2)
return 3;
- if (actr->dir == 3)
+ if (actr->_dir == 3)
return 2;
return 1;
}
void thor_shoots() {
- if ((_G(hammer)->used != 1) && (!_G(hammer)->dead) && (!_G(thor)->shot_cnt)) {
+ if ((_G(hammer)->_active != 1) && (!_G(hammer)->_dead) && (!_G(thor)->_shotCountdown)) {
play_sound(SWISH, false);
- _G(thor)->shot_cnt = 20;
- _G(hammer)->used = 1;
- _G(hammer)->dir = _G(thor)->dir;
- _G(hammer)->last_dir = _G(thor)->dir;
- _G(hammer)->x = _G(thor)->x;
- _G(hammer)->y = _G(thor)->y + 2;
- _G(hammer)->move = 2;
- _G(hammer)->next = 0;
- _G(hammer)->last_x[0] = _G(hammer)->x;
- _G(hammer)->last_x[1] = _G(hammer)->x;
- _G(hammer)->last_y[0] = _G(hammer)->y;
- _G(hammer)->last_y[1] = _G(hammer)->y;
+ _G(thor)->_shotCountdown = 20;
+ _G(hammer)->_active = 1;
+ _G(hammer)->_dir = _G(thor)->_dir;
+ _G(hammer)->_lastDir = _G(thor)->_dir;
+ _G(hammer)->_x = _G(thor)->_x;
+ _G(hammer)->_y = _G(thor)->_y + 2;
+ _G(hammer)->_moveType = 2;
+ _G(hammer)->_nextFrame = 0;
+ _G(hammer)->_lastX[0] = _G(hammer)->_x;
+ _G(hammer)->_lastX[1] = _G(hammer)->_x;
+ _G(hammer)->_lastY[0] = _G(hammer)->_y;
+ _G(hammer)->_lastY[1] = _G(hammer)->_y;
}
}
@@ -112,11 +112,11 @@ void actor_damaged(ACTOR *actr, int damage) {
else if (_G(setup).skill == 2)
damage /= 2;
- if (!actr->vunerable && actr->type != 3 && (actr->solid & 0x7f) != 2) {
- actr->vunerable = STAMINA;
- if (damage >= actr->health) {
- if (actr->type != 4) {
- add_score(actr->init_health * 10);
+ if (!actr->_vulnerableCountdown && actr->_type != 3 && (actr->_solid & 0x7f) != 2) {
+ actr->_vulnerableCountdown = STAMINA;
+ if (damage >= actr->_health) {
+ if (actr->_type != 4) {
+ add_score(actr->_initHealth * 10);
} else {
kill_good_guy();
@@ -124,119 +124,119 @@ void actor_damaged(ACTOR *actr, int damage) {
actor_destroyed(actr);
} else {
- actr->show = 10;
- actr->health -= damage;
- actr->speed_count += 8;
+ actr->_show = 10;
+ actr->_health -= damage;
+ actr->_moveCountdown += 8;
}
- } else if (!actr->vunerable) {
- actr->vunerable = STAMINA;
+ } else if (!actr->_vulnerableCountdown) {
+ actr->_vulnerableCountdown = STAMINA;
- if (actr->func_num == 4) {
+ if (actr->_funcNum == 4) {
switch_icons();
}
- if (actr->func_num == 7) {
+ if (actr->_funcNum == 7) {
rotate_arrows();
}
}
}
void thor_damaged(ACTOR *actr) {
- actr->hit_thor = 1;
+ actr->_hitThor = 1;
// If we're invincible, ignore any damage
if (_G(cheats).freezeHealth)
return;
- if (GAME3 && actr->func_num == 11) {
- if (actr->talk_counter) {
- actr->talk_counter--;
+ if (GAME3 && actr->_funcNum == 11) {
+ if (actr->_talkCounter) {
+ actr->_talkCounter--;
return;
}
- int t = actr->type;
- actr->type = 4;
+ int t = actr->_type;
+ actr->_type = 4;
actor_speaks(actr, 0, 0);
- actr->type = t;
- actr->talk_counter = 30;
+ actr->_type = t;
+ actr->_talkCounter = 30;
return;
}
- int damage = actr->strength;
+ int damage = actr->_hitStrength;
if (damage != 255) {
if (!_G(setup).skill)
damage /= 2;
else if (_G(setup).skill == 2)
damage *= 2;
}
- if ((!_G(thor)->vunerable && !_G(shield_on)) || damage == 255) {
- if (damage >= _G(thor)->health) {
- _G(thor)->vunerable = 40;
- _G(thor)->show = 0;
- _G(thor)->health = 0;
+ if ((!_G(thor)->_vulnerableCountdown && !_G(shield_on)) || damage == 255) {
+ if (damage >= _G(thor)->_health) {
+ _G(thor)->_vulnerableCountdown = 40;
+ _G(thor)->_show = 0;
+ _G(thor)->_health = 0;
_G(exit_flag) = 2;
g_events->send(GameMessage("THOR_DIES"));
} else if (damage) {
- _G(thor)->vunerable = 40;
+ _G(thor)->_vulnerableCountdown = 40;
_G(sound).play_sound(OW, 0);
- _G(thor)->show = 10;
- _G(thor)->health -= damage;
+ _G(thor)->_show = 10;
+ _G(thor)->_health -= damage;
}
}
}
void actor_destroyed(ACTOR *actr) {
- if (actr->actor_num > 2) {
+ if (actr->_actorNum > 2) {
int pge = _G(pge);
- int x = actr->last_x[pge ^ 1];
- int y = actr->last_y[pge ^ 1];
- int x1 = actr->last_x[pge];
- int y1 = actr->last_y[pge];
- int r = actr->rating;
- int n = actr->actor_num;
- int t = actr->type;
+ int x = actr->_lastX[pge ^ 1];
+ int y = actr->_lastY[pge ^ 1];
+ int x1 = actr->_lastX[pge];
+ int y1 = actr->_lastY[pge];
+ int r = actr->_dropRating;
+ int n = actr->_actorNum;
+ int t = actr->_type;
- if (actr->func_num == 255)
+ if (actr->_funcNum == 255)
actr->copyFixedAndPics(_G(explosion));
else
actr->copyFixedAndPics(_G(sparkle));
- actr->type = t;
- actr->actor_num = n;
- actr->rating = r;
- actr->x = x;
- actr->y = y;
- actr->last_x[pge] = x1;
- actr->last_x[pge ^ 1] = x;
- actr->last_y[pge] = y1;
- actr->last_y[pge ^ 1] = y;
- actr->speed_count = actr->speed;
- actr->used = 1;
- actr->num_shots = 3; // used to reverse explosion
- actr->vunerable = 255;
+ actr->_type = t;
+ actr->_actorNum = n;
+ actr->_dropRating = r;
+ actr->_x = x;
+ actr->_y = y;
+ actr->_lastX[pge] = x1;
+ actr->_lastX[pge ^ 1] = x;
+ actr->_lastY[pge] = y1;
+ actr->_lastY[pge ^ 1] = y;
+ actr->_moveCountdown = actr->_speed;
+ actr->_active = 1;
+ actr->_currNumShots = 3; // used to reverse explosion
+ actr->_vulnerableCountdown = 255;
} else {
- actr->dead = 2;
- actr->used = 0;
+ actr->_dead = 2;
+ actr->_active = 0;
}
}
int _actor_shoots(ACTOR *actr, int dir) {
- int t = actr->shot_type - 1;
+ int t = actr->_shotType - 1;
for (int i = MAX_ENEMIES + 3; i < MAX_ACTORS; i++) {
- if ((!_G(actor[i]).used) && (!_G(actor[i]).dead)) {
+ if ((!_G(actor[i])._active) && (!_G(actor[i])._dead)) {
ACTOR *act = &_G(actor[i]);
*act = _G(shot[t]);
int cx, cy;
- if (actr->size_y < act->size_y)
- cy = actr->y - ((act->size_y - actr->size_y) / 2);
+ if (actr->_sizeY < act->_sizeY)
+ cy = actr->_y - ((act->_sizeY - actr->_sizeY) / 2);
else
- cy = actr->y + ((actr->size_y - act->size_y) / 2);
+ cy = actr->_y + ((actr->_sizeY - act->_sizeY) / 2);
- if (actr->size_x < act->size_x)
- cx = actr->x - ((act->size_x - actr->size_x) / 2);
+ if (actr->_sizeX < act->_sizeX)
+ cx = actr->_x - ((act->_sizeX - actr->_sizeX) / 2);
else
- cx = actr->x + ((actr->size_x - act->size_x) / 2);
+ cx = actr->_x + ((actr->_sizeX - act->_sizeX) / 2);
if (cy > 174)
cy = 174;
@@ -244,32 +244,32 @@ int _actor_shoots(ACTOR *actr, int dir) {
if (cx > 304)
cx = 304;
- act->x = cx;
- act->y = cy;
- act->last_dir = dir;
- act->next = 0;
- act->dir = dir;
- if (act->directions == 1)
- act->dir = 0;
- else if (act->directions == 4 && act->frames == 1) {
- act->next = dir;
- act->dir = 0;
+ act->_x = cx;
+ act->_y = cy;
+ act->_lastDir = dir;
+ act->_nextFrame = 0;
+ act->_dir = dir;
+ if (act->_directions == 1)
+ act->_dir = 0;
+ else if (act->_directions == 4 && act->_framesPerDirection == 1) {
+ act->_nextFrame = dir;
+ act->_dir = 0;
}
- act->frame_count = act->frame_speed;
- act->speed_count = act->speed;
- act->last_x[0] = cx;
- act->last_x[1] = cx;
- act->last_x[0] = actr->x;
- act->last_x[1] = actr->x;
- act->last_y[0] = cy;
- act->last_y[1] = cy;
- act->used = 1;
- act->creator = actr->actor_num;
- act->move_count = act->num_moves;
- act->dead = 0;
- actr->shot_actor = i;
- actr->num_shots++;
- actr->shot_cnt = 20;
+ act->_frameCount = act->_frameSpeed;
+ act->_moveCountdown = act->_speed;
+ act->_lastX[0] = cx;
+ act->_lastX[1] = cx;
+ act->_lastX[0] = actr->_x;
+ act->_lastX[1] = actr->_x;
+ act->_lastY[0] = cy;
+ act->_lastY[1] = cy;
+ act->_active = 1;
+ act->_creator = actr->_actorNum;
+ act->_moveCount = act->_numMoves;
+ act->_dead = 0;
+ actr->_shotActor = i;
+ actr->_currNumShots++;
+ actr->_shotCountdown = 20;
_G(shot_ok) = false;
return 1;
}
@@ -284,15 +284,15 @@ void actor_always_shoots(ACTOR *actr, int dir) {
int actor_shoots(ACTOR *actr, int dir) {
int i;
- int cx = (actr->x + (actr->size_x / 2)) >> 4;
- int cy = ((actr->y + actr->size_y) - 2) >> 4;
+ int cx = (actr->_x + (actr->_sizeX / 2)) >> 4;
+ int cy = ((actr->_y + actr->_sizeY) - 2) >> 4;
- int tx = _G(thor)->center_x;
- int ty = _G(thor)->center_y;
+ int tx = _G(thor)->_centerX;
+ int ty = _G(thor)->_centerY;
int icn = 140;
- if (_G(shot[actr->shot_type - 1]).flying)
+ if (_G(shot[actr->_shotType - 1])._flying)
icn = 80;
switch (dir) {
@@ -325,55 +325,55 @@ int actor_shoots(ACTOR *actr, int dir) {
}
void move_actor(ACTOR *actr) {
- if (actr->vunerable != 0)
- actr->vunerable--;
- if (actr->shot_cnt != 0)
- actr->shot_cnt--;
- if (actr->show != 0)
- actr->show--;
-
- if (!actr->shot_cnt && _G(shot_ok)) {
- if (actr->shots_allowed) {
- if (actr->num_shots < actr->shots_allowed) {
- shot_pattern_func[actr->shot_pattern](actr);
+ if (actr->_vulnerableCountdown != 0)
+ actr->_vulnerableCountdown--;
+ if (actr->_shotCountdown != 0)
+ actr->_shotCountdown--;
+ if (actr->_show != 0)
+ actr->_show--;
+
+ if (!actr->_shotCountdown && _G(shot_ok)) {
+ if (actr->_numShotsAllowed) {
+ if (actr->_currNumShots < actr->_numShotsAllowed) {
+ shot_pattern_func[actr->_shotPattern](actr);
}
}
}
- const int scount = actr->speed_count -1;
+ const int scount = actr->_moveCountdown - 1;
if (scount <= 0) {
- if (!actr->move_counter)
- actr->speed_count = actr->speed;
+ if (!actr->_moveCounter)
+ actr->_moveCountdown = actr->_speed;
else
- actr->speed_count = (actr->speed << 1);
+ actr->_moveCountdown = (actr->_speed << 1);
int i;
- if (actr->type == 3)
- i = shot_movement_func[actr->move](actr);
+ if (actr->_type == 3)
+ i = shot_movement_func[actr->_moveType](actr);
else
- i = movement_func[actr->move](actr);
+ i = movement_func[actr->_moveType](actr);
- if (actr->directions == 2)
+ if (actr->_directions == 2)
i &= 1;
- if (i != actr->dir)
- actr->dir = i;
-
- if (actr->move == 0 && _G(current_level) != _G(new_level) && _G(shield_on)) {
- _G(actor[2]).x = actr->x - 2;
- if (_G(actor[2]).x < 0)
- _G(actor[2]).x = 0;
- _G(actor[2]).y = actr->y;
- _G(actor[2]).last_x[0] = _G(actor[2]).x;
- _G(actor[2]).last_x[1] = _G(actor[2]).x;
- _G(actor[2]).last_y[0] = _G(actor[2]).y;
- _G(actor[2]).last_y[1] = _G(actor[2]).y;
+ if (i != actr->_dir)
+ actr->_dir = i;
+
+ if (actr->_moveType == 0 && _G(current_level) != _G(new_level) && _G(shield_on)) {
+ _G(actor[2])._x = actr->_x - 2;
+ if (_G(actor[2])._x < 0)
+ _G(actor[2])._x = 0;
+ _G(actor[2])._y = actr->_y;
+ _G(actor[2])._lastX[0] = _G(actor[2])._x;
+ _G(actor[2])._lastX[1] = _G(actor[2])._x;
+ _G(actor[2])._lastY[0] = _G(actor[2])._y;
+ _G(actor[2])._lastY[1] = _G(actor[2])._y;
}
} else
- actr->speed_count = scount;
+ actr->_moveCountdown = scount;
- actr->x &= 0xfffe;
+ actr->_x &= 0xfffe;
}
} // namespace Got
diff --git a/engines/got/game/move_patterns.cpp b/engines/got/game/move_patterns.cpp
index 2249c4b6b46..3fdd8f0a53a 100644
--- a/engines/got/game/move_patterns.cpp
+++ b/engines/got/game/move_patterns.cpp
@@ -166,11 +166,11 @@ int check_move0(int x, int y, ACTOR *actr) {
if (x < 0) {
if (_G(current_level) > 0) {
_G(new_level) = _G(current_level) - 1;
- actr->x = 304;
- actr->last_x[0] = 304;
- actr->last_x[1] = 304;
- actr->show = 0;
- actr->move_count = 0;
+ actr->_x = 304;
+ actr->_lastX[0] = 304;
+ actr->_lastX[1] = 304;
+ actr->_show = 0;
+ actr->_moveCount = 0;
set_thor_vars();
return 1;
}
@@ -181,11 +181,11 @@ int check_move0(int x, int y, ACTOR *actr) {
if (x > 306) {
if (_G(current_level) < 119) {
_G(new_level) = _G(current_level) + 1;
- actr->x = 0;
- actr->last_x[0] = 0;
- actr->last_x[1] = 0;
- actr->show = 0;
- actr->move_count = 0;
+ actr->_x = 0;
+ actr->_lastX[0] = 0;
+ actr->_lastX[1] = 0;
+ actr->_show = 0;
+ actr->_moveCount = 0;
set_thor_vars();
return 1;
}
@@ -196,11 +196,11 @@ int check_move0(int x, int y, ACTOR *actr) {
if (y < 0) {
if (_G(current_level) > 9) {
_G(new_level) = _G(current_level) - 10;
- actr->y = 175;
- actr->last_y[0] = 175;
- actr->show = 0;
- actr->last_y[1] = 175;
- actr->move_count = 0;
+ actr->_y = 175;
+ actr->_lastY[0] = 175;
+ actr->_show = 0;
+ actr->_lastY[1] = 175;
+ actr->_moveCount = 0;
set_thor_vars();
return 1;
}
@@ -211,11 +211,11 @@ int check_move0(int x, int y, ACTOR *actr) {
if (y > 175) {
if (_G(current_level) < 110) {
_G(new_level) = _G(current_level) + 10;
- actr->y = 0;
- actr->last_y[0] = 0;
- actr->last_y[1] = 0;
- actr->show = 0;
- actr->move_count = 0;
+ actr->_y = 0;
+ actr->_lastY[0] = 0;
+ actr->_lastY[1] = 0;
+ actr->_show = 0;
+ actr->_moveCount = 0;
set_thor_vars();
return 1;
}
@@ -225,13 +225,13 @@ int check_move0(int x, int y, ACTOR *actr) {
int x1 = (x + 1) >> 4;
int y1 = (y + 8) >> 4;
- int x2 = (_G(thor)->dir > 1) ? (x + 12) >> 4 : (x + 10) >> 4;
+ int x2 = (_G(thor)->_dir > 1) ? (x + 12) >> 4 : (x + 10) >> 4;
int y2 = (y + 15) >> 4;
_G(slip_flag) = false;
// Check for cheat flying mode
- if (!actr->flying) {
+ if (!actr->_flying) {
byte icn1 = _G(scrn).icon[y1][x1];
byte icn2 = _G(scrn).icon[y2][x1];
byte icn3 = _G(scrn).icon[y1][x2];
@@ -308,44 +308,44 @@ int check_move0(int x, int y, ACTOR *actr) {
_G(thor_special_flag) = false;
for (int i = 3; i < MAX_ACTORS; i++) {
ACTOR *act = &_G(actor[i]);
- if ((act->solid & 128) || !act->used)
+ if ((act->_solid & 128) || !act->_active)
continue;
- int x3 = act->x + 1;
- int y3 = act->y + 1;
+ int x3 = act->_x + 1;
+ int y3 = act->_y + 1;
if (ABS(x3 - x1) > 16 || ABS(y3 - y1) > 16)
continue;
- int x4 = act->x + act->size_x - 1;
- int y4 = act->y + act->size_y - 1;
+ int x4 = act->_x + act->_sizeX - 1;
+ int y4 = act->_y + act->_sizeY - 1;
if (overlap(x1, y1, x2, y2, x3, y3, x4, y4)) {
- if (act->func_num > 0) { // 255=explosion
- if (act->func_num == 255)
+ if (act->_funcNum > 0) { // 255=explosion
+ if (act->_funcNum == 255)
return 0;
- act->temp1 = x;
- act->temp2 = y;
+ act->_temp1 = x;
+ act->_temp2 = y;
_G(thor_special_flag) = true;
- return special_movement_func[act->func_num](act);
+ return special_movement_func[act->_funcNum](act);
}
_G(thor_special_flag) = false;
thor_damaged(act);
- if (act->solid < 2) {
- if (!act->vunerable && (!(act->type & 1)))
+ if (act->_solid < 2) {
+ if (!act->_vulnerableCountdown && (!(act->_type & 1)))
play_sound(PUNCH1, false);
- if (!_G(hammer)->used && _G(key_flag[key_fire]))
- actor_damaged(act, _G(hammer)->strength);
+ if (!_G(hammer)->_active && _G(key_flag[key_fire]))
+ actor_damaged(act, _G(hammer)->_hitStrength);
else
- actor_damaged(act, _G(thor)->strength);
+ actor_damaged(act, _G(thor)->_hitStrength);
}
return 1;
}
}
- actr->x = x;
- actr->y = y;
+ actr->_x = x;
+ actr->_y = y;
return 1;
}
@@ -361,7 +361,7 @@ int check_move1(int x, int y, ACTOR *actr) {
// Check for solid or fly over
int icn = TILE_FLY;
- if (actr->flying)
+ if (actr->_flying)
icn = TILE_SOLID;
byte icn1 = _G(scrn).icon[y1][x1];
@@ -369,7 +369,7 @@ int check_move1(int x, int y, ACTOR *actr) {
byte icn3 = _G(scrn).icon[y1][x2];
byte icn4 = _G(scrn).icon[y2][x2];
if (icn1 < icn || icn2 < icn || icn3 < icn || icn4 < icn) {
- if (actr->actor_num == 1 && actr->move == 2)
+ if (actr->_actorNum == 1 && actr->_moveType == 2)
play_sound(CLANG, false);
return 0;
@@ -395,17 +395,17 @@ int check_move1(int x, int y, ACTOR *actr) {
int f = 0;
for (int i = 3; i < MAX_ACTORS; i++) {
ACTOR *act = &_G(actor[i]);
- if (!act->used || act->type == 3)
+ if (!act->_active || act->_type == 3)
continue;
- int x3 = act->x;
- int y3 = act->y;
+ int x3 = act->_x;
+ int y3 = act->_y;
if (ABS(x3 - x1) > 16 || ABS(y3 - y1) > 16)
continue;
- int x4 = act->x + act->size_x - 1;
- int y4 = act->y + act->size_y - 1;
+ int x4 = act->_x + act->_sizeX - 1;
+ int y4 = act->_y + act->_sizeY - 1;
if (overlap(x1, y1, x2, y2, x3, y3, x4, y4)) {
if (_G(boss_active) && !GAME3) {
@@ -421,43 +421,43 @@ int check_move1(int x, int y, ACTOR *actr) {
break;
}
} else {
- if (act->solid == 2 && (actr->move == 16 || actr->move == 17))
+ if (act->_solid == 2 && (actr->_moveType == 16 || actr->_moveType == 17))
return 0;
- actor_damaged(act, actr->strength);
+ actor_damaged(act, actr->_hitStrength);
}
f++;
}
}
- if (f && actr->move == 2)
+ if (f && actr->_moveType == 2)
return 0;
- actr->x = x;
- actr->y = y;
+ actr->_x = x;
+ actr->_y = y;
return 1;
}
// Check enemy move
int check_move2(int x, int y, ACTOR *actr) {
- if (actr->actor_num < 3)
+ if (actr->_actorNum < 3)
return check_move1(x, y, actr);
- if (x < 0 || x > (319 - actr->size_x) || y < 0 || y > 175)
+ if (x < 0 || x > (319 - actr->_sizeX) || y < 0 || y > 175)
return 0;
int x1 = (x + 1) >> 4;
int y1;
- if (!actr->func_num)
- y1 = (y + (actr->size_y / 2)) >> 4;
+ if (!actr->_funcNum)
+ y1 = (y + (actr->_sizeY / 2)) >> 4;
else
y1 = (y + 1) >> 4;
- int x2 = ((x + actr->size_x) - 1) >> 4;
- int y2 = ((y + actr->size_y) - 1) >> 4;
+ int x2 = ((x + actr->_sizeX) - 1) >> 4;
+ int y2 = ((y + actr->_sizeY) - 1) >> 4;
// Check for solid or fly over
int icn = TILE_FLY;
- if (actr->flying)
+ if (actr->_flying)
icn = TILE_SOLID;
byte icn1 = _G(scrn).icon[y1][x1];
@@ -482,14 +482,14 @@ int check_move2(int x, int y, ACTOR *actr) {
x1 = x + 1;
y1 = y + 1;
- x2 = (x + actr->size_x) - 1;
- y2 = (y + actr->size_y) - 1;
+ x2 = (x + actr->_sizeX) - 1;
+ y2 = (y + actr->_sizeY) - 1;
for (int i = 0; i < MAX_ACTORS; i++) {
ACTOR *act = &_G(actor[i]);
- if (act->actor_num == actr->actor_num || act->actor_num == 1 || !act->used)
+ if (act->_actorNum == actr->_actorNum || act->_actorNum == 1 || !act->_active)
continue;
- if (act->type == 3)
+ if (act->_type == 3)
continue; // Shot
if (i == 0) {
@@ -498,44 +498,44 @@ int check_move2(int x, int y, ACTOR *actr) {
return 0;
}
} else {
- int x3 = act->x;
- int y3 = act->y;
+ int x3 = act->_x;
+ int y3 = act->_y;
if (ABS(x3 - x1) > 16 || ABS(y3 - y1) > 16)
continue;
- int x4 = act->x + act->size_x;
- int y4 = act->y + act->size_y;
+ int x4 = act->_x + act->_sizeX;
+ int y4 = act->_y + act->_sizeY;
if (overlap(x1, y1, x2, y2, x3, y3, x4, y4)) {
- if (actr->move == 38) {
- if (act->func_num == 4)
+ if (actr->_moveType == 38) {
+ if (act->_funcNum == 4)
_G(switch_flag) = 1;
- else if (act->func_num == 7)
+ else if (act->_funcNum == 7)
_G(switch_flag) = 2;
}
return 0;
}
}
}
- actr->x = x;
- actr->y = y;
+ actr->_x = x;
+ actr->_y = y;
return 1;
}
// Check enemy shot move
int check_move3(int x, int y, ACTOR *actr) {
- if (x < 0 || x > (319 - actr->size_x) || y < 0 || y > 175)
+ if (x < 0 || x > (319 - actr->_sizeX) || y < 0 || y > 175)
return 0;
int x1 = (x + 1) >> 4;
- int y1 = (y + (actr->size_y / 2)) >> 4;
- int x2 = ((x + actr->size_x) - 1) >> 4;
- int y2 = ((y + actr->size_y) - 1) >> 4;
+ int y1 = (y + (actr->_sizeY / 2)) >> 4;
+ int x2 = ((x + actr->_sizeX) - 1) >> 4;
+ int y2 = ((y + actr->_sizeY) - 1) >> 4;
// Check for solid or fly over
int icn = TILE_FLY;
- if (actr->flying)
+ if (actr->_flying)
icn = TILE_SOLID;
byte icn1 = _G(scrn).icon[y1][x1];
@@ -557,30 +557,30 @@ int check_move3(int x, int y, ACTOR *actr) {
// Check for solid or fly over
x1 = x + 1;
y1 = y + 1;
- x2 = (x + actr->size_x) - 1;
- y2 = (y + actr->size_y) - 1;
+ x2 = (x + actr->_sizeX) - 1;
+ y2 = (y + actr->_sizeY) - 1;
if (overlap(x1, y1, x2, y2, _G(thor_x1), _G(thor_real_y1), _G(thor_x2), _G(thor_y2))) {
thor_damaged(actr);
return 0;
}
for (int i = 3; i < MAX_ACTORS; i++) {
- if (i == actr->actor_num)
+ if (i == actr->_actorNum)
continue;
ACTOR *act = &_G(actor[i]);
- if (!act->used)
+ if (!act->_active)
continue;
- if (act->solid < 2)
+ if (act->_solid < 2)
continue;
- if (act->type == 3)
+ if (act->_type == 3)
continue; // Shot
- if (act->actor_num == actr->creator)
+ if (act->_actorNum == actr->_creator)
continue;
- int x3 = act->x;
- int y3 = act->y;
+ int x3 = act->_x;
+ int y3 = act->_y;
if (ABS(x3 - x1) > 16 || ABS(y3 - y1) > 16)
continue;
@@ -590,23 +590,23 @@ int check_move3(int x, int y, ACTOR *actr) {
if (overlap(x1, y1, x2, y2, x3, y3, x4, y4))
return 0;
}
- actr->x = x;
- actr->y = y;
+ actr->_x = x;
+ actr->_y = y;
return 1;
}
// Flying enemies
int check_move4(int x, int y, ACTOR *actr) {
- if (x < 0 || x > (319 - actr->size_x) || y < 0 || y > 175)
+ if (x < 0 || x > (319 - actr->_sizeX) || y < 0 || y > 175)
return 0;
- if (overlap(x, y, x + actr->size_x - 1, y + actr->size_y - 1,
+ if (overlap(x, y, x + actr->_sizeX - 1, y + actr->_sizeY - 1,
_G(thor_x1), _G(thor_y1), _G(thor_x2), _G(thor_y2))) {
- if (actr->type == 3)
+ if (actr->_type == 3)
thor_damaged(actr);
return 0;
}
- actr->x = x;
- actr->y = y;
+ actr->_x = x;
+ actr->_y = y;
return 1;
}
@@ -622,38 +622,38 @@ int check_thor_move(int x, int y, ACTOR *actr) {
if (_G(thor_icon1) + _G(thor_icon2) + _G(thor_icon3) + _G(thor_icon4) > 1)
return 0;
- switch (actr->dir) {
+ switch (actr->_dir) {
case 0:
if (_G(thor_icon1)) {
- actr->dir = 3;
+ actr->_dir = 3;
if (check_move0(x + THOR_PAD1, y + 2, actr)) {
- actr->dir = 0;
+ actr->_dir = 0;
return 1;
}
} else if (_G(thor_icon3)) {
- actr->dir = 2;
+ actr->_dir = 2;
if (check_move0(x - THOR_PAD1, y + 2, actr)) {
- actr->dir = 0;
+ actr->_dir = 0;
return 1;
}
}
- actr->dir = 0;
+ actr->_dir = 0;
break;
case 1:
if (_G(thor_icon2)) {
- actr->dir = 3;
+ actr->_dir = 3;
if (check_move0(x + THOR_PAD1, y - 2, actr)) {
- actr->dir = 1;
+ actr->_dir = 1;
return 1;
}
} else if (_G(thor_icon4)) {
- actr->dir = 2;
+ actr->_dir = 2;
if (check_move0(x - THOR_PAD1, y - 2, actr)) {
- actr->dir = 1;
+ actr->_dir = 1;
return 1;
}
}
- actr->dir = 1;
+ actr->_dir = 1;
break;
case 2:
if (_G(thor_icon1)) {
@@ -680,22 +680,22 @@ int check_thor_move(int x, int y, ACTOR *actr) {
// Player control
int movement_zero(ACTOR *actr) {
- int d = actr->dir;
+ int d = actr->_dir;
int od = d;
set_thor_vars();
- if (_G(hammer)->used && _G(hammer)->move == 5) {
+ if (_G(hammer)->_active && _G(hammer)->_moveType == 5) {
if (overlap(_G(thor_x1), _G(thor_y1), _G(thor_x2), _G(thor_y2),
- _G(hammer)->x, _G(hammer)->y, _G(hammer)->x + 13, _G(hammer)->y + 13)) {
+ _G(hammer)->_x, _G(hammer)->_y, _G(hammer)->_x + 13, _G(hammer)->_y + 13)) {
actor_destroyed(_G(hammer));
}
}
- int x = actr->x;
- int y = actr->y;
+ int x = actr->_x;
+ int y = actr->_y;
_G(diag_flag) = false;
- if (actr->move_counter)
- actr->move_counter--;
+ if (actr->_moveCounter)
+ actr->_moveCounter--;
if (_G(slipping)) {
if (_G(slip_cnt) == 8)
@@ -707,13 +707,13 @@ int movement_zero(ACTOR *actr) {
_G(slipping) = false;
check_thor_move(x, y, actr);
- _G(thor)->speed_count = 4;
+ _G(thor)->_moveCountdown = 4;
return d;
}
if (_G(key_flag[key_up]) && _G(key_flag[key_left])) {
d = 2;
- actr->dir = d;
+ actr->_dir = d;
_G(diag) = 1;
_G(diag_flag) = true;
if (check_thor_move(x - 2, y - 2, actr)) {
@@ -722,7 +722,7 @@ int movement_zero(ACTOR *actr) {
}
} else if (_G(key_flag[key_up]) && _G(key_flag[key_right])) {
d = 3;
- actr->dir = d;
+ actr->_dir = d;
_G(diag) = 2;
_G(diag_flag) = true;
if (check_thor_move(x + 2, y - 2, actr)) {
@@ -731,7 +731,7 @@ int movement_zero(ACTOR *actr) {
}
} else if (_G(key_flag[key_down]) && _G(key_flag[key_left])) {
d = 2;
- actr->dir = d;
+ actr->_dir = d;
_G(diag) = 4;
_G(diag_flag) = true;
if (check_thor_move(x - 2, y + 2, actr)) {
@@ -740,7 +740,7 @@ int movement_zero(ACTOR *actr) {
}
} else if (_G(key_flag[key_down]) && _G(key_flag[key_right])) {
d = 3;
- actr->dir = d;
+ actr->_dir = d;
_G(diag) = 3;
_G(diag_flag) = true;
if (check_thor_move(x + 2, y + 2, actr)) {
@@ -752,7 +752,7 @@ int movement_zero(ACTOR *actr) {
if (_G(key_flag[key_right])) {
if (!_G(key_flag[key_left])) {
d = 3;
- actr->dir = d;
+ actr->_dir = d;
if (check_thor_move(x + 2, y, actr)) {
next_frame(actr);
return d;
@@ -762,7 +762,7 @@ int movement_zero(ACTOR *actr) {
if (_G(key_flag[key_left])) {
if (!_G(key_flag[key_right])) {
d = 2;
- actr->dir = d;
+ actr->_dir = d;
if (check_thor_move(x - 2, y, actr)) {
next_frame(actr);
return d;
@@ -772,7 +772,7 @@ int movement_zero(ACTOR *actr) {
if (_G(key_flag[key_down])) {
if (!_G(key_flag[key_up])) {
d = 1;
- actr->dir = d;
+ actr->_dir = d;
if (check_thor_move(x, y + 2, actr)) {
next_frame(actr);
return d;
@@ -782,16 +782,16 @@ int movement_zero(ACTOR *actr) {
if (_G(key_flag[key_up])) {
if (!_G(key_flag[key_down])) {
d = 0;
- actr->dir = d;
+ actr->_dir = d;
if (check_thor_move(x, y - 2, actr)) {
next_frame(actr);
return d;
}
}
}
- actr->move_counter = 5;
- actr->next = 0;
- actr->dir = od;
+ actr->_moveCounter = 5;
+ actr->_nextFrame = 0;
+ actr->_dir = od;
return d;
}
@@ -801,7 +801,7 @@ int check_special_move1(int x, int y, ACTOR *actr) {
ACTOR *act;
- if (actr->actor_num < 3)
+ if (actr->_actorNum < 3)
return check_move1(x, y, actr);
if (x < 0 || x > 304 || y < 0 || y > 176)
@@ -815,7 +815,7 @@ int check_special_move1(int x, int y, ACTOR *actr) {
// Check for solid or fly over
int icn = TILE_FLY;
- if (actr->flying)
+ if (actr->_flying)
icn = TILE_SOLID;
byte icn1 = _G(scrn).icon[y1][x1];
@@ -841,44 +841,44 @@ int check_special_move1(int x, int y, ACTOR *actr) {
for (i = 3; i < MAX_ACTORS; i++) {
act = &_G(actor[i]);
- if (act->actor_num == actr->actor_num)
+ if (act->_actorNum == actr->_actorNum)
continue;
- if (!act->used)
+ if (!act->_active)
continue;
- if (act->type == 3)
+ if (act->_type == 3)
continue; //shot
- x3 = act->x;
+ x3 = act->_x;
if ((ABS(x3 - x1)) > 16)
continue;
- y3 = act->y;
+ y3 = act->_y;
if ((ABS(y3 - y1)) > 16)
continue;
- x4 = act->x + act->size_x;
- y4 = act->y + 15;
+ x4 = act->_x + act->_sizeX;
+ y4 = act->_y + 15;
if (overlap(x1, y1, x2, y2, x3, y3, x4, y4))
return 0;
}
for (i = 3; i < MAX_ACTORS; i++) {
act = &_G(actor[i]);
- if (act->actor_num == actr->actor_num)
+ if (act->_actorNum == actr->_actorNum)
continue;
- if (!act->used)
+ if (!act->_active)
continue;
- if (act->type == 3)
+ if (act->_type == 3)
continue; // Shot
- x3 = act->x;
+ x3 = act->_x;
if ((ABS(x3 - x1)) > 16)
continue;
- y3 = act->y;
+ y3 = act->_y;
if ((ABS(y3 - y1)) > 16)
continue;
- x4 = act->x + act->size_x;
- y4 = act->y + act->size_y;
+ x4 = act->_x + act->_sizeX;
+ y4 = act->_y + act->_sizeY;
if (overlap(_G(thor_x1), _G(thor_y1), _G(thor_x2), _G(thor_y2), x3, y3, x4, y4))
return 0;
}
- actr->x = x;
- actr->y = y;
+ actr->_x = x;
+ actr->_y = y;
return 1;
}
@@ -889,76 +889,76 @@ int special_movement_one(ACTOR *actr) {
if (_G(diag_flag))
return 0;
- int d = _G(thor)->dir;
- int x1 = actr->x;
- int y1 = actr->y;
- int sd = actr->last_dir;
- actr->last_dir = d;
+ int d = _G(thor)->_dir;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
+ int sd = actr->_lastDir;
+ actr->_lastDir = d;
switch (d) {
case 0:
y1 -= 2;
if (!check_special_move1(x1, y1, actr)) {
- actr->last_dir = sd;
+ actr->_lastDir = sd;
return 0;
}
break;
case 1:
y1 += 2;
if (!check_special_move1(x1, y1, actr)) {
- actr->last_dir = sd;
+ actr->_lastDir = sd;
return 0;
}
break;
case 2:
x1 -= 2;
if (!check_special_move1(x1, y1, actr)) {
- actr->last_dir = sd;
+ actr->_lastDir = sd;
return 0;
}
break;
case 3:
x1 += 2;
if (!check_special_move1(x1, y1, actr)) {
- actr->last_dir = sd;
+ actr->_lastDir = sd;
return 0;
}
break;
}
next_frame(actr);
- actr->last_dir = d;
+ actr->_lastDir = d;
return 1;
}
// Angle
int special_movement_two(ACTOR *actr) {
- int x1 = actr->temp1; // Calc thor pos
- int y1 = actr->temp2;
+ int x1 = actr->_temp1; // Calc thor pos
+ int y1 = actr->_temp2;
int x2 = x1 + 13;
int y2 = y1 + 14;
for (int i = 3; i < MAX_ACTORS; i++) {
ACTOR *act = &_G(actor[i]);
- if (actr->actor_num == act->actor_num)
+ if (actr->_actorNum == act->_actorNum)
continue;
- if (!act->used)
+ if (!act->_active)
continue;
- int x3 = act->x;
+ int x3 = act->_x;
if ((ABS(x3 - x1)) > 16)
continue;
- int y3 = act->y;
+ int y3 = act->_y;
if ((ABS(y3 - y1)) > 16)
continue;
- int x4 = act->x + act->size_x;
- int y4 = act->y + act->size_y;
+ int x4 = act->_x + act->_sizeX;
+ int y4 = act->_y + act->_sizeY;
if (overlap(x1, y1, x2, y2, x3, y3, x4, y4))
return 0;
}
- if (!actr->func_pass) {
- if (_G(thor)->health < 150) {
+ if (!actr->_funcPass) {
+ if (_G(thor)->_health < 150) {
if (!sound_playing())
play_sound(ANGEL, false);
- _G(thor)->health += 1;
+ _G(thor)->_health += 1;
}
} else if (_G(thor_info).magic < 150) {
if (!sound_playing())
@@ -976,7 +976,7 @@ int special_movement_three(ACTOR *actr) {
long lind = (long)_G(current_level);
lind *= 1000;
- lind += (long)actr->actor_num;
+ lind += (long)actr->_actorNum;
execute_script(lind, _G(odin));
return 0;
@@ -984,9 +984,9 @@ int special_movement_three(ACTOR *actr) {
// Peg switch
int special_movement_four(ACTOR *actr) {
- if (actr->shot_cnt != 0)
+ if (actr->_shotCountdown != 0)
return 0;
- actr->shot_cnt = 30;
+ actr->_shotCountdown = 30;
_G(switch_flag) = 1;
return 0;
@@ -994,30 +994,30 @@ int special_movement_four(ACTOR *actr) {
// Boulder roll
int special_movement_five(ACTOR *actr) {
- int d = _G(thor)->dir;
+ int d = _G(thor)->_dir;
if (_G(diag_flag)) {
switch (_G(diag)) {
case 1:
- if (_G(thor_x1) < (actr->x + 15))
+ if (_G(thor_x1) < (actr->_x + 15))
d = 0;
else
d = 2;
break;
case 2:
- if (_G(thor_x2) < actr->x)
+ if (_G(thor_x2) < actr->_x)
d = 3;
else
d = 0;
break;
case 3:
- if (_G(thor_x2) > (actr->x))
+ if (_G(thor_x2) > (actr->_x))
d = 1;
else
d = 3;
break;
case 4:
- if (_G(thor_x1) > (actr->x + 15))
+ if (_G(thor_x1) > (actr->_x + 15))
d = 2;
else
d = 1;
@@ -1025,8 +1025,8 @@ int special_movement_five(ACTOR *actr) {
}
}
- actr->last_dir = d;
- actr->move = 14;
+ actr->_lastDir = d;
+ actr->_moveType = 14;
return 0;
}
@@ -1036,35 +1036,35 @@ int special_movement_six(ACTOR *actr) {
}
int special_movement_seven(ACTOR *actr) {
- if (actr->shot_cnt != 0)
+ if (actr->_shotCountdown != 0)
return 0;
- actr->shot_cnt = 30;
+ actr->_shotCountdown = 30;
_G(switch_flag) = 2;
return 0;
}
int special_movement_eight(ACTOR *actr) {
- if (_G(thor)->dir < 2 || _G(diag_flag))
+ if (_G(thor)->_dir < 2 || _G(diag_flag))
return 0;
- actr->last_dir = _G(thor)->dir;
- actr->move = 14;
+ actr->_lastDir = _G(thor)->_dir;
+ actr->_moveType = 14;
return 0;
}
int special_movement_nine(ACTOR *actr) {
- if (_G(thor)->dir > 1 || _G(diag_flag))
+ if (_G(thor)->_dir > 1 || _G(diag_flag))
return 0;
- actr->last_dir = _G(thor)->dir;
- actr->move = 14;
+ actr->_lastDir = _G(thor)->_dir;
+ actr->_moveType = 14;
return 0;
}
int special_movement_ten(ACTOR *actr) {
- byte &actor_ctr = GAME1 ? actr->temp6 : actr->talk_counter;
+ byte &actor_ctr = GAME1 ? actr->_temp6 : actr->_talkCounter;
if (actor_ctr) {
actor_ctr--;
@@ -1075,22 +1075,22 @@ int special_movement_ten(ACTOR *actr) {
return 0;
actor_ctr = 10;
- actor_speaks(actr, 0 - actr->pass_value, 0);
+ actor_speaks(actr, 0 - actr->_passValue, 0);
return 0;
}
// Red guard
int special_movement_eleven(ACTOR *actr) {
- if (actr->talk_counter) {
- actr->talk_counter--;
+ if (actr->_talkCounter) {
+ actr->_talkCounter--;
return 0;
}
- const int oldType = actr->type;
- actr->type = 4;
+ const int oldType = actr->_type;
+ actr->_type = 4;
actor_speaks(actr, 0, 0);
- actr->type = oldType;
- actr->talk_counter = 10;
+ actr->_type = oldType;
+ actr->_talkCounter = 10;
return 0;
}
@@ -1098,14 +1098,14 @@ int special_movement_eleven(ACTOR *actr) {
// No movement - frame cycle
int movement_one(ACTOR *actr) {
next_frame(actr);
- return actr->dir;
+ return actr->_dir;
}
// Hammer only
int movement_two(ACTOR *actr) {
- int d = actr->last_dir;
- int x1 = actr->x;
- int y1 = actr->y;
+ int d = actr->_lastDir;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
switch (d) {
case 0:
@@ -1122,30 +1122,30 @@ int movement_two(ACTOR *actr) {
break;
}
if (!check_move2(x1, y1, actr)) {
- if (actr->actor_num == 1) {
- _G(hammer)->move = 5;
+ if (actr->_actorNum == 1) {
+ _G(hammer)->_moveType = 5;
d = reverse_direction(_G(hammer));
- _G(hammer)->dir = d;
+ _G(hammer)->_dir = d;
}
- if (actr->actor_num == 2) {
- actr->used = 0;
- actr->dead = 2;
+ if (actr->_actorNum == 2) {
+ actr->_active = 0;
+ actr->_dead = 2;
_G(lightning_used) = false;
_G(tornado_used) = false;
}
}
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
// Walk-bump-random turn
int movement_three(ACTOR *actr) {
- int d = actr->last_dir;
- int x1 = actr->x;
- int y1 = actr->y;
+ int d = actr->_lastDir;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
switch (d) {
case 0:
@@ -1174,18 +1174,18 @@ int movement_three(ACTOR *actr) {
break;
}
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
// Simple tracking
int movement_four(ACTOR *actr) {
- int d = actr->last_dir;
+ int d = actr->_lastDir;
- int x1 = actr->x;
- int y1 = actr->y;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
int f = 0;
if (x1 > _G(thor_x1) - 1) {
@@ -1218,30 +1218,30 @@ int movement_four(ACTOR *actr) {
f = 1;
}
if (f)
- f = check_move2(actr->x, y1, actr);
+ f = check_move2(actr->_x, y1, actr);
if (!f)
- check_move2(actr->x, actr->y, actr);
+ check_move2(actr->_x, actr->_y, actr);
}
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
int movement_five(ACTOR *actr) {
- int x1 = actr->x;
- int y1 = actr->y;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
int xd = 0;
int yd = 0;
- int d = actr->last_dir;
+ int d = actr->_lastDir;
- if (x1 > (_G(thor)->x + 1))
+ if (x1 > (_G(thor)->_x + 1))
xd = -2; //+1
- else if (x1 < (_G(thor)->x - 1))
+ else if (x1 < (_G(thor)->_x - 1))
xd = 2;
- if (actr->actor_num == 1) {
+ if (actr->_actorNum == 1) {
if (y1 < (_G(thor_y1) - 6))
yd = 2;
else if (y1 > (_G(thor_y1) - 6))
@@ -1266,8 +1266,8 @@ int movement_five(ACTOR *actr) {
y1 += yd;
if (check_move2(x1, y1, actr)) {
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
@@ -1281,11 +1281,11 @@ int movement_five(ACTOR *actr) {
else if (xd == -2 && yd == 0)
d = 2;
}
- x1 = actr->x;
- y1 = actr->y;
- actr->toggle ^= 1;
+ x1 = actr->_x;
+ y1 = actr->_y;
+ actr->_toggle ^= 1;
- if (actr->toggle) {
+ if (actr->_toggle) {
if (xd) {
x1 += xd;
if (check_move2(x1, y1, actr)) {
@@ -1294,12 +1294,12 @@ int movement_five(ACTOR *actr) {
else
d = 2;
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
- x1 = actr->x;
+ x1 = actr->_x;
}
if (yd) {
y1 += yd;
@@ -1309,8 +1309,8 @@ int movement_five(ACTOR *actr) {
else
d = 0;
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
@@ -1324,12 +1324,12 @@ int movement_five(ACTOR *actr) {
else
d = 0;
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
- y1 = actr->y;
+ y1 = actr->_y;
}
if (xd) {
x1 += xd;
@@ -1339,36 +1339,36 @@ int movement_five(ACTOR *actr) {
else
d = 2;
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
}
}
- check_move2(actr->x, actr->y, actr);
+ check_move2(actr->_x, actr->_y, actr);
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
// Explosion only
int movement_six(ACTOR *actr) {
- if (actr->num_shots > 0) {
- actr->next++;
- if (actr->next > 2) {
- actr->next = 0;
+ if (actr->_currNumShots > 0) {
+ actr->_nextFrame++;
+ if (actr->_nextFrame > 2) {
+ actr->_nextFrame = 0;
if (_G(boss_dead))
play_sound(EXPLODE, false);
}
- actr->num_shots--;
+ actr->_currNumShots--;
} else {
- actr->dead = 2;
- actr->used = 0;
+ actr->_dead = 2;
+ actr->_active = 0;
if (!_G(boss_dead) && !_G(endgame)) {
- if (actr->type == 2)
+ if (actr->_type == 2)
drop_object(actr);
}
}
@@ -1379,33 +1379,33 @@ int movement_six(ACTOR *actr) {
// Walk-bump-random turn (pause also)
int movement_seven(ACTOR *actr) {
- if (actr->next == 0 && actr->frame_count == actr->frame_speed) {
- actr->speed_count = 12;
- actr->last_dir = g_events->getRandomNumber(3);
+ if (actr->_nextFrame == 0 && actr->_frameCount == actr->_frameSpeed) {
+ actr->_moveCountdown = 12;
+ actr->_lastDir = g_events->getRandomNumber(3);
}
return movement_three(actr);
}
// Follow thor
int movement_eight(ACTOR *actr) {
- if (_G(thor)->x > 0)
- actr->x = _G(thor)->x - 1;
+ if (_G(thor)->_x > 0)
+ actr->_x = _G(thor)->_x - 1;
else
- actr->x = _G(thor)->x;
- actr->y = _G(thor)->y;
+ actr->_x = _G(thor)->_x;
+ actr->_y = _G(thor)->_y;
next_frame(actr);
return 0;
}
// 4-way straight (random length) change
int movement_nine(ACTOR *actr) {
- int d = actr->last_dir;
- int x1 = actr->x;
- int y1 = actr->y;
+ int d = actr->_lastDir;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
int f = 0;
- if (actr->counter) {
- actr->counter--;
+ if (actr->_counter) {
+ actr->_counter--;
switch (d) {
case 0:
y1 -= 2;
@@ -1432,26 +1432,26 @@ int movement_nine(ACTOR *actr) {
f = 1;
if (f == 1) {
- actr->counter = g_events->getRandomNumber(10, 99);
+ actr->_counter = g_events->getRandomNumber(10, 99);
d = g_events->getRandomNumber(3);
}
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
// Vert straight (random length) change
int movement_ten(ACTOR *actr) {
- int lastDir = actr->last_dir;
- int x1 = actr->x;
- int y1 = actr->y;
+ int lastDir = actr->_lastDir;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
bool setRandomDirFl = false;
- if (actr->counter) {
- if (actr->pass_value != 1)
- actr->counter--;
+ if (actr->_counter) {
+ if (actr->_passValue != 1)
+ actr->_counter--;
switch (lastDir) {
case 0:
case 2:
@@ -1473,7 +1473,7 @@ int movement_ten(ACTOR *actr) {
setRandomDirFl = true;
if (setRandomDirFl) {
- actr->counter = g_events->getRandomNumber(10, 99);
+ actr->_counter = g_events->getRandomNumber(10, 99);
lastDir = g_events->getRandomNumber(1);
}
@@ -1481,104 +1481,104 @@ int movement_ten(ACTOR *actr) {
lastDir -= 2;
next_frame(actr);
- actr->last_dir = lastDir;
- if (actr->directions == 1)
+ actr->_lastDir = lastDir;
+ if (actr->_directions == 1)
return 0;
return lastDir;
}
// Horz only (bats)
int movement_eleven(ACTOR *actr) {
- int d = actr->last_dir;
+ int d = actr->_lastDir;
switch (d) {
case 0:
- if (check_move2(actr->x - 2, actr->y - 2, actr))
+ if (check_move2(actr->_x - 2, actr->_y - 2, actr))
break;
d = 1;
- if (check_move2(actr->x - 2, actr->y + 2, actr))
+ if (check_move2(actr->_x - 2, actr->_y + 2, actr))
break;
d = 2;
break;
case 1:
- if (check_move2(actr->x - 2, actr->y + 2, actr))
+ if (check_move2(actr->_x - 2, actr->_y + 2, actr))
break;
d = 0;
- if (check_move2(actr->x - 2, actr->y - 2, actr))
+ if (check_move2(actr->_x - 2, actr->_y - 2, actr))
break;
d = 3;
break;
case 2:
- if (check_move2(actr->x + 2, actr->y - 2, actr))
+ if (check_move2(actr->_x + 2, actr->_y - 2, actr))
break;
d = 3;
- if (check_move2(actr->x + 2, actr->y + 2, actr))
+ if (check_move2(actr->_x + 2, actr->_y + 2, actr))
break;
d = 0;
break;
case 3:
- if (check_move2(actr->x + 2, actr->y + 2, actr))
+ if (check_move2(actr->_x + 2, actr->_y + 2, actr))
break;
d = 2;
- if (check_move2(actr->x + 2, actr->y - 2, actr))
+ if (check_move2(actr->_x + 2, actr->_y - 2, actr))
break;
d = 1;
break;
}
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
// Horz straight until bump
int movement_twelve(ACTOR *actr) {
- int d = actr->last_dir;
+ int d = actr->_lastDir;
switch (d) {
case 0:
case 2:
- if (check_move2(actr->x - 2, actr->y, actr))
+ if (check_move2(actr->_x - 2, actr->_y, actr))
break;
d = 3;
break;
case 1:
case 3:
- if (check_move2(actr->x + 2, actr->y, actr))
+ if (check_move2(actr->_x + 2, actr->_y, actr))
break;
d = 2;
break;
}
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
// Pause-seek (mushroom)
int movement_thirteen(ACTOR *actr) {
- int d = actr->last_dir;
+ int d = actr->_lastDir;
- if (actr->counter == 0 && actr->pause == 0) {
- actr->pause = 60;
+ if (actr->_counter == 0 && actr->_unpauseCountdown == 0) {
+ actr->_unpauseCountdown = 60;
return d;
}
- if (actr->pause > 0) {
- actr->pause--;
- if (!actr->pause)
- actr->counter = 60;
- actr->vunerable = 5;
- actr->strength = 0;
+ if (actr->_unpauseCountdown > 0) {
+ actr->_unpauseCountdown--;
+ if (!actr->_unpauseCountdown)
+ actr->_counter = 60;
+ actr->_vulnerableCountdown = 5;
+ actr->_hitStrength = 0;
return d;
}
- if (actr->counter > 0) {
- actr->counter--;
- if (!actr->counter)
- actr->pause = 60;
- actr->strength = 10;
+ if (actr->_counter > 0) {
+ actr->_counter--;
+ if (!actr->_counter)
+ actr->_unpauseCountdown = 60;
+ actr->_hitStrength = 10;
return movement_five(actr);
}
return d;
@@ -1586,58 +1586,58 @@ int movement_thirteen(ACTOR *actr) {
// Move-bump-stop (boulder)
int movement_fourteen(ACTOR *actr) {
- int d = actr->last_dir;
- actr->dir = d;
- int x1 = actr->x;
- int y1 = actr->y;
+ int d = actr->_lastDir;
+ actr->_dir = d;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
switch (d) {
case 0:
y1 -= 2;
if (!check_move2(x1, y1, actr)) {
- actr->move = 15;
+ actr->_moveType = 15;
return 0;
}
break;
case 1:
y1 += 2;
if (!check_move2(x1, y1, actr)) {
- actr->move = 15;
+ actr->_moveType = 15;
return 0;
}
break;
case 2:
x1 -= 2;
if (!check_move2(x1, y1, actr)) {
- actr->move = 15;
+ actr->_moveType = 15;
return 0;
}
break;
case 3:
x1 += 2;
if (!check_move2(x1, y1, actr)) {
- actr->move = 15;
+ actr->_moveType = 15;
return 0;
}
break;
}
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
// No movement - no frame cycle
int movement_fifteen(ACTOR *actr) {
- return actr->dir;
+ return actr->_dir;
}
// Tornado 1
int movement_sixteen(ACTOR *actr) {
- int d = actr->last_dir;
- int x1 = actr->x;
- int y1 = actr->y;
+ int d = actr->_lastDir;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
switch (d) {
case 0:
@@ -1654,58 +1654,58 @@ int movement_sixteen(ACTOR *actr) {
break;
}
if (!check_move1(x1, y1, actr)) {
- actr->move = 17;
+ actr->_moveType = 17;
d = g_events->getRandomNumber(3);
}
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
// Tornado 2
int movement_seventeen(ACTOR *actr) {
- int d = actr->last_dir;
+ int d = actr->_lastDir;
switch (d) {
case 0:
- if (check_move1(actr->x - 2, actr->y - 2, actr))
+ if (check_move1(actr->_x - 2, actr->_y - 2, actr))
break;
d = 1;
- if (check_move1(actr->x - 2, actr->y + 2, actr))
+ if (check_move1(actr->_x - 2, actr->_y + 2, actr))
break;
d = 2;
break;
case 1:
- if (check_move1(actr->x - 2, actr->y + 2, actr))
+ if (check_move1(actr->_x - 2, actr->_y + 2, actr))
break;
d = 0;
- if (check_move1(actr->x - 2, actr->y - 2, actr))
+ if (check_move1(actr->_x - 2, actr->_y - 2, actr))
break;
d = 3;
break;
case 2:
- if (check_move1(actr->x + 2, actr->y - 2, actr))
+ if (check_move1(actr->_x + 2, actr->_y - 2, actr))
break;
d = 3;
- if (check_move1(actr->x + 2, actr->y + 2, actr))
+ if (check_move1(actr->_x + 2, actr->_y + 2, actr))
break;
d = 0;
break;
case 3:
- if (check_move1(actr->x + 2, actr->y + 2, actr))
+ if (check_move1(actr->_x + 2, actr->_y + 2, actr))
break;
d = 2;
- if (check_move1(actr->x + 2, actr->y - 2, actr))
+ if (check_move1(actr->_x + 2, actr->_y - 2, actr))
break;
d = 1;
break;
}
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
@@ -1714,38 +1714,38 @@ int movement_seventeen(ACTOR *actr) {
int movement_eighteen(ACTOR *actr) {
int d;
- if (actr->temp5) {
- actr->temp5--;
- if (!actr->temp5)
- actr->num_moves = 1;
+ if (actr->_temp5) {
+ actr->_temp5--;
+ if (!actr->_temp5)
+ actr->_numMoves = 1;
}
- if (actr->temp1) {
+ if (actr->_temp1) {
d = movement_five(actr);
- actr->rand--;
- if (actr->hit_thor || !actr->rand) {
- if (actr->hit_thor) {
- actr->temp5 = 50;
- actr->num_moves = 2;
- actr->hit_thor = 0;
- actr->dir = d;
+ actr->_rand--;
+ if (actr->_hitThor || !actr->_rand) {
+ if (actr->_hitThor) {
+ actr->_temp5 = 50;
+ actr->_numMoves = 2;
+ actr->_hitThor = 0;
+ actr->_dir = d;
d = reverse_direction(actr);
}
- actr->temp1 = 0;
- actr->rand = g_events->getRandomNumber(50, 149);
+ actr->_temp1 = 0;
+ actr->_rand = g_events->getRandomNumber(50, 149);
}
} else {
d = movement_three(actr);
- actr->rand--;
- if (!actr->rand) {
- actr->temp5 = 0;
- actr->temp1 = 1;
- actr->rand = g_events->getRandomNumber(50, 149);
- }
- if (actr->hit_thor) {
- actr->temp5 = 50;
- actr->num_moves = 2;
- actr->hit_thor = 0;
- actr->dir = d;
+ actr->_rand--;
+ if (!actr->_rand) {
+ actr->_temp5 = 0;
+ actr->_temp1 = 1;
+ actr->_rand = g_events->getRandomNumber(50, 149);
+ }
+ if (actr->_hitThor) {
+ actr->_temp5 = 50;
+ actr->_numMoves = 2;
+ actr->_hitThor = 0;
+ actr->_dir = d;
d = reverse_direction(actr);
}
}
@@ -1773,89 +1773,89 @@ int movement_twentyone(ACTOR *actr) {
// Spear
int movement_twentytwo(ACTOR *actr) {
- int d = actr->last_dir;
- if (actr->directions == 1)
+ int d = actr->_lastDir;
+ if (actr->_directions == 1)
d = 0;
redo:
- switch (actr->temp2) {
+ switch (actr->_temp2) {
case 0:
- if (bgtile(actr->x, actr->y) >= TILE_SOLID)
- actr->next = 1;
+ if (bgtile(actr->_x, actr->_y) >= TILE_SOLID)
+ actr->_nextFrame = 1;
else {
- actr->temp2 = 6;
- actr->temp1 = 1;
+ actr->_temp2 = 6;
+ actr->_temp1 = 1;
goto redo;
}
- actr->temp2++;
+ actr->_temp2++;
break;
case 1:
- actr->next = 2;
- actr->temp2++;
+ actr->_nextFrame = 2;
+ actr->_temp2++;
break;
case 2:
- actr->next = 3;
- actr->strength = 255;
- actr->temp2++;
- actr->temp1 = 10;
+ actr->_nextFrame = 3;
+ actr->_hitStrength = 255;
+ actr->_temp2++;
+ actr->_temp1 = 10;
break;
case 3:
- check_move2(actr->x, actr->y, actr);
- actr->temp1--;
- if (actr->temp1)
+ check_move2(actr->_x, actr->_y, actr);
+ actr->_temp1--;
+ if (actr->_temp1)
break;
- actr->temp2++;
- actr->next = 2;
+ actr->_temp2++;
+ actr->_nextFrame = 2;
break;
case 4:
- actr->strength = 0;
- actr->temp2++;
- actr->next = 1;
+ actr->_hitStrength = 0;
+ actr->_temp2++;
+ actr->_nextFrame = 1;
break;
case 5:
- actr->temp2++;
- actr->next = 0;
- actr->temp1 = 10;
+ actr->_temp2++;
+ actr->_nextFrame = 0;
+ actr->_temp1 = 10;
break;
case 6:
- actr->temp1--;
- if (actr->temp1)
+ actr->_temp1--;
+ if (actr->_temp1)
break;
- actr->temp2 = 0;
- actr->next = 0;
+ actr->_temp2 = 0;
+ actr->_nextFrame = 0;
switch (d) {
case 0:
- actr->x += 16;
- actr->y += 16;
+ actr->_x += 16;
+ actr->_y += 16;
d = 3;
- if (bgtile(actr->x, actr->y) < TILE_SOLID)
+ if (bgtile(actr->_x, actr->_y) < TILE_SOLID)
goto redo;
break;
case 1:
- actr->x -= 16;
- actr->y -= 16;
+ actr->_x -= 16;
+ actr->_y -= 16;
d = 2;
- if (bgtile(actr->x, actr->y) < TILE_SOLID)
+ if (bgtile(actr->_x, actr->_y) < TILE_SOLID)
goto redo;
break;
case 2:
- actr->x += 16;
- actr->y -= 16;
+ actr->_x += 16;
+ actr->_y -= 16;
d = 0;
- if (bgtile(actr->x, actr->y) < TILE_SOLID)
+ if (bgtile(actr->_x, actr->_y) < TILE_SOLID)
goto redo;
break;
case 3:
- actr->x -= 16;
- actr->y += 16;
+ actr->_x -= 16;
+ actr->_y += 16;
d = 1;
- if (bgtile(actr->x, actr->y) < TILE_SOLID)
+ if (bgtile(actr->_x, actr->_y) < TILE_SOLID)
goto redo;
break;
}
- actr->dir = d;
- actr->last_dir = d;
+ actr->_dir = d;
+ actr->_lastDir = d;
break;
}
return d;
@@ -1863,216 +1863,216 @@ redo:
// Spinball counter-clockwise
int movement_twentythree(ACTOR *actr) {
- int d = actr->last_dir;
+ int d = actr->_lastDir;
next_frame(actr);
- if (actr->pass_value & 2)
- actr->num_moves = 2;
+ if (actr->_passValue & 2)
+ actr->_numMoves = 2;
switch (d) {
case 0:
- if (bgtile(actr->x - 2, actr->y) >= TILE_FLY &&
- bgtile(actr->x - 2, actr->y + actr->size_y - 1) >= TILE_FLY) {
+ if (bgtile(actr->_x - 2, actr->_y) >= TILE_FLY &&
+ bgtile(actr->_x - 2, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 2;
- actr->x -= 2;
+ actr->_x -= 2;
} else {
- if (bgtile(actr->x, actr->y - 2) < TILE_FLY ||
- bgtile(actr->x + actr->size_x - 1, actr->y - 2) < TILE_FLY) {
- if (bgtile(actr->x + actr->size_x + 1, actr->y) >= TILE_FLY &&
- bgtile(actr->x + actr->size_x + 1, actr->y + actr->size_y - 1) >= TILE_FLY) {
+ if (bgtile(actr->_x, actr->_y - 2) < TILE_FLY ||
+ bgtile(actr->_x + actr->_sizeX - 1, actr->_y - 2) < TILE_FLY) {
+ if (bgtile(actr->_x + actr->_sizeX + 1, actr->_y) >= TILE_FLY &&
+ bgtile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 3;
- actr->x += 2;
+ actr->_x += 2;
} else {
d = 1;
break;
}
} else
- actr->y -= 2;
+ actr->_y -= 2;
}
break;
case 1:
- if (bgtile(actr->x + actr->size_x + 1, actr->y) >= TILE_FLY &&
- bgtile(actr->x + actr->size_x + 1, actr->y + actr->size_y - 1) >= TILE_FLY) {
+ if (bgtile(actr->_x + actr->_sizeX + 1, actr->_y) >= TILE_FLY &&
+ bgtile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 3;
- actr->x += 2;
+ actr->_x += 2;
} else {
- if (bgtile(actr->x, actr->y + actr->size_y + 1) < TILE_FLY ||
- bgtile(actr->x + actr->size_x - 1, actr->y + actr->size_y + 1) < TILE_FLY) {
- if (bgtile(actr->x - 2, actr->y) >= TILE_FLY &&
- bgtile(actr->x - 2, actr->y + actr->size_y - 1) >= TILE_FLY) {
+ if (bgtile(actr->_x, actr->_y + actr->_sizeY + 1) < TILE_FLY ||
+ bgtile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) < TILE_FLY) {
+ if (bgtile(actr->_x - 2, actr->_y) >= TILE_FLY &&
+ bgtile(actr->_x - 2, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 2;
- actr->x -= 2;
+ actr->_x -= 2;
} else {
d = 0;
break;
}
} else
- actr->y += 2;
+ actr->_y += 2;
}
break;
case 2:
- if (bgtile(actr->x, actr->y + actr->size_y + 1) >= TILE_FLY &&
- bgtile(actr->x + actr->size_x - 1, actr->y + actr->size_y + 1) >= TILE_FLY) {
+ if (bgtile(actr->_x, actr->_y + actr->_sizeY + 1) >= TILE_FLY &&
+ bgtile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) >= TILE_FLY) {
d = 1;
- actr->y += 2;
+ actr->_y += 2;
} else {
- if (bgtile(actr->x - 2, actr->y) < TILE_FLY ||
- bgtile(actr->x - 2, actr->y + actr->size_y - 1) < TILE_FLY) {
- if (bgtile(actr->x, actr->y - 2) >= TILE_FLY &&
- bgtile(actr->x + actr->size_x - 1, actr->y - 2) >= TILE_FLY) {
+ if (bgtile(actr->_x - 2, actr->_y) < TILE_FLY ||
+ bgtile(actr->_x - 2, actr->_y + actr->_sizeY - 1) < TILE_FLY) {
+ if (bgtile(actr->_x, actr->_y - 2) >= TILE_FLY &&
+ bgtile(actr->_x + actr->_sizeX - 1, actr->_y - 2) >= TILE_FLY) {
d = 0;
- actr->y -= 2;
+ actr->_y -= 2;
} else {
d = 3;
break;
}
} else
- actr->x -= 2;
+ actr->_x -= 2;
}
break;
case 3:
- if (bgtile(actr->x, actr->y - 2) >= TILE_FLY &&
- bgtile(actr->x + actr->size_x - 1, actr->y - 2) >= TILE_FLY) {
+ if (bgtile(actr->_x, actr->_y - 2) >= TILE_FLY &&
+ bgtile(actr->_x + actr->_sizeX - 1, actr->_y - 2) >= TILE_FLY) {
d = 0;
- actr->y -= 2;
+ actr->_y -= 2;
} else {
- if (bgtile(actr->x + actr->size_x + 1, actr->y) < TILE_FLY ||
- bgtile(actr->x + actr->size_x + 1, actr->y + actr->size_y - 1) < TILE_FLY) {
- if (bgtile(actr->x, actr->y + actr->size_y + 1) >= TILE_FLY &&
- bgtile(actr->x + actr->size_x - 1, actr->y + actr->size_y + 1) >= TILE_FLY) {
+ if (bgtile(actr->_x + actr->_sizeX + 1, actr->_y) < TILE_FLY ||
+ bgtile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) < TILE_FLY) {
+ if (bgtile(actr->_x, actr->_y + actr->_sizeY + 1) >= TILE_FLY &&
+ bgtile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) >= TILE_FLY) {
d = 1;
- actr->y += 2;
+ actr->_y += 2;
} else {
d = 2;
break;
}
} else
- actr->x += 2;
+ actr->_x += 2;
}
break;
}
- check_move2(actr->x, actr->y, actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ check_move2(actr->_x, actr->_y, actr);
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
// Spinball clockwise
int movement_twentyfour(ACTOR *actr) {
- int d = actr->last_dir;
+ int d = actr->_lastDir;
next_frame(actr);
- if (actr->pass_value & 2)
- actr->num_moves = 2;
+ if (actr->_passValue & 2)
+ actr->_numMoves = 2;
switch (d) {
case 0:
- if (bgtile(actr->x + actr->size_x + 1, actr->y) >= TILE_FLY &&
- bgtile(actr->x + actr->size_x + 1, actr->y + actr->size_y - 1) >= TILE_FLY) {
+ if (bgtile(actr->_x + actr->_sizeX + 1, actr->_y) >= TILE_FLY &&
+ bgtile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 3;
- actr->x += 2;
+ actr->_x += 2;
} else {
- if (bgtile(actr->x, actr->y - 2) < TILE_FLY ||
- bgtile(actr->x + actr->size_x - 1, actr->y - 2) < TILE_FLY) {
- if (bgtile(actr->x - 2, actr->y) >= TILE_FLY &&
- bgtile(actr->x - 2, actr->y + actr->size_y - 1) >= TILE_FLY) {
+ if (bgtile(actr->_x, actr->_y - 2) < TILE_FLY ||
+ bgtile(actr->_x + actr->_sizeX - 1, actr->_y - 2) < TILE_FLY) {
+ if (bgtile(actr->_x - 2, actr->_y) >= TILE_FLY &&
+ bgtile(actr->_x - 2, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 2;
- actr->x -= 2;
+ actr->_x -= 2;
} else {
d = 1;
break;
}
} else
- actr->y -= 2;
+ actr->_y -= 2;
}
break;
case 1:
- if (bgtile(actr->x - 2, actr->y) >= TILE_FLY &&
- bgtile(actr->x - 2, actr->y + actr->size_y - 1) >= TILE_FLY) {
+ if (bgtile(actr->_x - 2, actr->_y) >= TILE_FLY &&
+ bgtile(actr->_x - 2, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 2;
- actr->x -= 2;
+ actr->_x -= 2;
} else {
- if (bgtile(actr->x, actr->y + actr->size_y + 1) < TILE_FLY ||
- bgtile(actr->x + actr->size_x - 1, actr->y + actr->size_y + 1) < TILE_FLY) {
- if (bgtile(actr->x + actr->size_x + 1, actr->y) >= TILE_FLY &&
- bgtile(actr->x + actr->size_x + 1, actr->y + actr->size_y - 1) >= TILE_FLY) {
+ if (bgtile(actr->_x, actr->_y + actr->_sizeY + 1) < TILE_FLY ||
+ bgtile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) < TILE_FLY) {
+ if (bgtile(actr->_x + actr->_sizeX + 1, actr->_y) >= TILE_FLY &&
+ bgtile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) >= TILE_FLY) {
d = 3;
- actr->x += 2;
+ actr->_x += 2;
} else {
d = 0;
break;
}
} else
- actr->y += 2;
+ actr->_y += 2;
}
break;
case 2:
- if (bgtile(actr->x, actr->y - 2) >= TILE_FLY &&
- bgtile(actr->x + actr->size_x - 1, actr->y - 2) >= TILE_FLY) {
+ if (bgtile(actr->_x, actr->_y - 2) >= TILE_FLY &&
+ bgtile(actr->_x + actr->_sizeX - 1, actr->_y - 2) >= TILE_FLY) {
d = 0;
- actr->y -= 2;
+ actr->_y -= 2;
} else {
- if (bgtile(actr->x - 2, actr->y) < TILE_FLY ||
- bgtile(actr->x - 2, actr->y + actr->size_y - 1) < TILE_FLY) {
- if (bgtile(actr->x, actr->y + actr->size_y + 1) >= TILE_FLY &&
- bgtile(actr->x + actr->size_x - 1, actr->y + actr->size_y + 1) >= TILE_FLY) {
+ if (bgtile(actr->_x - 2, actr->_y) < TILE_FLY ||
+ bgtile(actr->_x - 2, actr->_y + actr->_sizeY - 1) < TILE_FLY) {
+ if (bgtile(actr->_x, actr->_y + actr->_sizeY + 1) >= TILE_FLY &&
+ bgtile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) >= TILE_FLY) {
d = 1;
- actr->y += 2;
+ actr->_y += 2;
} else {
d = 3;
break;
}
} else
- actr->x -= 2;
+ actr->_x -= 2;
}
break;
case 3:
- if (bgtile(actr->x, actr->y + actr->size_y + 1) >= TILE_FLY &&
- bgtile(actr->x + actr->size_x - 1, actr->y + actr->size_y + 1) >= TILE_FLY) {
+ if (bgtile(actr->_x, actr->_y + actr->_sizeY + 1) >= TILE_FLY &&
+ bgtile(actr->_x + actr->_sizeX - 1, actr->_y + actr->_sizeY + 1) >= TILE_FLY) {
d = 1;
- actr->y += 2;
+ actr->_y += 2;
} else {
- if (bgtile(actr->x + actr->size_x + 1, actr->y) < TILE_FLY ||
- bgtile(actr->x + actr->size_x + 1, actr->y + actr->size_y - 1) < TILE_FLY) {
- if (bgtile(actr->x, actr->y - 2) >= TILE_FLY &&
- bgtile(actr->x + actr->size_x - 1, actr->y - 2) >= TILE_FLY) {
+ if (bgtile(actr->_x + actr->_sizeX + 1, actr->_y) < TILE_FLY ||
+ bgtile(actr->_x + actr->_sizeX + 1, actr->_y + actr->_sizeY - 1) < TILE_FLY) {
+ if (bgtile(actr->_x, actr->_y - 2) >= TILE_FLY &&
+ bgtile(actr->_x + actr->_sizeX - 1, actr->_y - 2) >= TILE_FLY) {
d = 0;
- actr->y -= 2;
+ actr->_y -= 2;
} else {
d = 2;
break;
}
} else
- actr->x += 2;
+ actr->_x += 2;
}
break;
}
- check_move2(actr->x, actr->y, actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ check_move2(actr->_x, actr->_y, actr);
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
// Acid puddle
int movement_twentyfive(ACTOR *actr) {
- if (actr->temp2) {
- actr->temp2--;
+ if (actr->_temp2) {
+ actr->_temp2--;
return movement_one(actr);
}
- if (!actr->temp1) {
- actr->last_dir = g_events->getRandomNumber(3);
+ if (!actr->_temp1) {
+ actr->_lastDir = g_events->getRandomNumber(3);
int i = 4;
while (i--) {
int ret = movement_three(actr);
if (ret)
return ret;
- actr->last_dir++;
- if (actr->last_dir > 3)
- actr->last_dir = 0;
+ actr->_lastDir++;
+ if (actr->_lastDir > 3)
+ actr->_lastDir = 0;
}
- actr->temp1 = 16;
+ actr->_temp1 = 16;
}
- actr->temp1--;
+ actr->_temp1--;
return movement_three(actr);
}
@@ -2093,52 +2093,52 @@ int movement_twentyseven(ACTOR *actr) {
}
void set_thor_vars() {
- _G(thor_x1) = _G(thor)->x + 1;
- _G(thor_y1) = _G(thor)->y + 8;
+ _G(thor_x1) = _G(thor)->_x + 1;
+ _G(thor_y1) = _G(thor)->_y + 8;
- _G(thor_real_y1) = _G(thor)->y;
- _G(thor_x2) = (_G(thor)->x + 12);
- _G(thor_y2) = _G(thor)->y + 15;
+ _G(thor_real_y1) = _G(thor)->_y;
+ _G(thor_x2) = (_G(thor)->_x + 12);
+ _G(thor_y2) = _G(thor)->_y + 15;
}
// Fish
int movement_twentyeight(ACTOR *actr) {
- int d = actr->last_dir;
- int x1 = actr->x;
- int y1 = actr->y;
+ int d = actr->_lastDir;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
int ret;
- if (actr->i1)
- actr->i1--;
+ if (actr->_i1)
+ actr->_i1--;
else {
- if (!actr->temp3) {
- if (!actr->next) {
- actr->frame_count = 1;
- actr->frame_speed = 4;
+ if (!actr->_temp3) {
+ if (!actr->_nextFrame) {
+ actr->_frameCount = 1;
+ actr->_frameSpeed = 4;
}
next_frame(actr);
- if (actr->next == 3) {
- if (actr->num_shots < actr->shots_allowed)
+ if (actr->_nextFrame == 3) {
+ if (actr->_currNumShots < actr->_numShotsAllowed)
actor_shoots(actr, 0);
- actr->temp3 = 1;
+ actr->_temp3 = 1;
}
} else {
- const int fcount = actr->frame_count - 1;
+ const int fcount = actr->_frameCount - 1;
if (fcount <= 0) {
- actr->next--;
- actr->frame_count = actr->frame_speed;
- if (!actr->next) {
- actr->temp3 = 0;
- actr->frame_speed = 4;
- actr->i1 = g_events->getRandomNumber(60, 159);
+ actr->_nextFrame--;
+ actr->_frameCount = actr->_frameSpeed;
+ if (!actr->_nextFrame) {
+ actr->_temp3 = 0;
+ actr->_frameSpeed = 4;
+ actr->_i1 = g_events->getRandomNumber(60, 159);
}
} else
- actr->frame_count = fcount;
+ actr->_frameCount = fcount;
}
goto done;
}
- switch (actr->temp2) {
+ switch (actr->_temp2) {
case 0:
y1 -= 2;
break;
@@ -2156,42 +2156,42 @@ int movement_twentyeight(ACTOR *actr) {
ret = bgtile(x1, y1);
if (ret != 100 && ret != 106 && ret != 110 && ret != 111 && ret != 113)
goto chg_dir;
- ret = bgtile((x1 + actr->size_x) - 1, y1);
+ ret = bgtile((x1 + actr->_sizeX) - 1, y1);
if (ret != 100 && ret != 106 && ret != 110 && ret != 111 && ret != 113)
goto chg_dir;
- ret = bgtile(x1, (y1 + actr->size_y) - 1);
+ ret = bgtile(x1, (y1 + actr->_sizeY) - 1);
if (ret != 100 && ret != 106 && ret != 110 && ret != 111 && ret != 113)
goto chg_dir;
- ret = bgtile((x1 + actr->size_x) - 1, (y1 + actr->size_y) - 1);
+ ret = bgtile((x1 + actr->_sizeX) - 1, (y1 + actr->_sizeY) - 1);
if (ret != 100 && ret != 106 && ret != 110 && ret != 111 && ret != 113)
goto chg_dir;
- actr->x = x1;
- actr->y = y1;
+ actr->_x = x1;
+ actr->_y = y1;
goto done;
chg_dir:
- actr->temp2 = _G(rand1) % 4;
+ actr->_temp2 = _G(rand1) % 4;
done:
- if (actr->next) {
- x1 = actr->x;
- y1 = actr->y;
- actr->solid = 1;
+ if (actr->_nextFrame) {
+ x1 = actr->_x;
+ y1 = actr->_y;
+ actr->_solid = 1;
check_move2(x1, y1, actr);
- actr->x = x1;
- actr->y = y1;
+ actr->_x = x1;
+ actr->_y = y1;
} else
- actr->solid = 2;
- if (actr->directions == 1)
+ actr->_solid = 2;
+ if (actr->_directions == 1)
return 0;
return d;
}
// Horz or vert (pass_val)
int movement_twentynine(ACTOR *actr) {
- if (!actr->pass_value)
+ if (!actr->_passValue)
return movement_thirty(actr);
return movement_twelve(actr);
@@ -2199,9 +2199,9 @@ int movement_twentynine(ACTOR *actr) {
// Vert straight
int movement_thirty(ACTOR *actr) {
- int d = actr->last_dir;
- int x1 = actr->x;
- int y1 = actr->y;
+ int d = actr->_lastDir;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
switch (d) {
case 0:
@@ -2215,37 +2215,37 @@ int movement_thirty(ACTOR *actr) {
d ^= 1;
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
// Drop (stalagtite)
int movement_thirtyone(ACTOR *actr) {
- int d = actr->last_dir;
- int x1 = actr->x;
- int y1 = actr->y;
+ int d = actr->_lastDir;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
- if (actr->temp1) {
+ if (actr->_temp1) {
y1 += 2;
if (!check_move2(x1, y1, actr))
actor_destroyed(actr);
} else if (_G(thor_y1) > y1 && ABS(x1 - _G(thor_x1)) < 16) {
- int cx = (actr->x + (actr->size_x / 2)) >> 4;
- int cy = ((actr->y + actr->size_y) - 2) >> 4;
- int ty = _G(thor)->center_y;
+ int cx = (actr->_x + (actr->_sizeX / 2)) >> 4;
+ int cy = ((actr->_y + actr->_sizeY) - 2) >> 4;
+ int ty = _G(thor)->_centerY;
for (int i = cy; i <= ty; i++)
if (_G(scrn).icon[i][cx] < TILE_SOLID)
goto done;
- actr->num_moves = actr->pass_value + 1;
- actr->temp1 = 1;
+ actr->_numMoves = actr->_passValue + 1;
+ actr->_temp1 = 1;
}
done:
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
@@ -2267,30 +2267,30 @@ int movement_thirtyfour(ACTOR *actr) {
// Gun (single)
int movement_thirtyfive(ACTOR *actr) {
- actr->next = actr->last_dir;
- return actr->dir;
+ actr->_nextFrame = actr->_lastDir;
+ return actr->_dir;
}
// Acid drop
int movement_thirtysix(ACTOR *actr) {
- actr->speed = actr->pass_value;
+ actr->_speed = actr->_passValue;
next_frame(actr);
- if (actr->next == 0 && actr->frame_count == actr->frame_speed) {
+ if (actr->_nextFrame == 0 && actr->_frameCount == actr->_frameSpeed) {
actor_always_shoots(actr, 1);
- _G(actor[actr->shot_actor]).x -= 2;
+ _G(actor[actr->_shotActor])._x -= 2;
}
return 0;
}
// 4-way straight (random length) change
int movement_thirtyseven(ACTOR *actr) {
- int d = actr->last_dir;
- int x1 = actr->x;
- int y1 = actr->y;
+ int d = actr->_lastDir;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
int f = 0;
- if (actr->counter) {
- actr->counter--;
+ if (actr->_counter) {
+ actr->_counter--;
switch (d) {
case 0:
y1 -= 2;
@@ -2317,36 +2317,36 @@ int movement_thirtyseven(ACTOR *actr) {
f = 1;
if (f == 1) {
- actr->counter = g_events->getRandomNumber(10, 99);
+ actr->_counter = g_events->getRandomNumber(10, 99);
d = g_events->getRandomNumber(3);
}
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
// Timed darting
-#define TIMER actr->i1
-#define INIT_DIR actr->temp1
-#define OTHER_DIR actr->temp2
-#define FLAG actr->temp3
-#define OX actr->i2
-#define OY actr->i3
-#define CNT actr->i4
+#define TIMER actr->_i1
+#define INIT_DIR actr->_temp1
+#define OTHER_DIR actr->_temp2
+#define FLAG actr->_temp3
+#define OX actr->_i2
+#define OY actr->_i3
+#define CNT actr->_i4
int movement_thirtyeight(ACTOR *actr) {
- int d = actr->last_dir;
- int x1 = actr->x;
- int y1 = actr->y;
+ int d = actr->_lastDir;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
if (!FLAG) {
FLAG = 1;
- if (actr->pass_value)
- TIMER = actr->pass_value * 15;
+ if (actr->_passValue)
+ TIMER = actr->_passValue * 15;
else
TIMER = g_events->getRandomNumber(5, 364);
- INIT_DIR = actr->last_dir;
+ INIT_DIR = actr->_lastDir;
OX = x1;
OY = y1;
CNT = 0;
@@ -2390,10 +2390,10 @@ int movement_thirtyeight(ACTOR *actr) {
if (!check_move2(x1, y1, actr)) {
if (CNT) {
d = OTHER_DIR;
- actr->last_dir = d;
+ actr->_lastDir = d;
FLAG = 2;
} else {
- actr->next = 0;
+ actr->_nextFrame = 0;
FLAG = 0;
goto done;
}
@@ -2405,16 +2405,16 @@ int movement_thirtyeight(ACTOR *actr) {
if (x1 == OX && y1 == OY) {
FLAG = 0;
d = INIT_DIR;
- actr->last_dir = d;
- actr->next = 0;
+ actr->_lastDir = d;
+ actr->_nextFrame = 0;
goto done;
}
}
next_frame(actr);
done:
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
@@ -2422,87 +2422,87 @@ done:
// Troll 1
int movement_thirtynine(ACTOR *actr) {
if (_G(setup).skill == 0) {
- actr->speed = 3;
- actr->num_moves = 1;
+ actr->_speed = 3;
+ actr->_numMoves = 1;
} else if (_G(setup).skill == 1) {
- actr->speed = 2;
- actr->num_moves = 1;
+ actr->_speed = 2;
+ actr->_numMoves = 1;
} else if (_G(setup).skill == 2) {
- actr->speed = 1;
- actr->num_moves = 1;
+ actr->_speed = 1;
+ actr->_numMoves = 1;
}
- if (actr->pass_value < 5)
+ if (actr->_passValue < 5)
return movement_forty(actr);
- if (actr->pass_value == 10) {
- if (overlap(actr->x + 1, actr->y + 1, actr->x + actr->size_x - 1,
- actr->y + actr->size_y - 1, _G(thor_x1), _G(thor_y1), _G(thor_x2), _G(thor_y2))) {
- actr->strength = 255;
+ if (actr->_passValue == 10) {
+ if (overlap(actr->_x + 1, actr->_y + 1, actr->_x + actr->_sizeX - 1,
+ actr->_y + actr->_sizeY - 1, _G(thor_x1), _G(thor_y1), _G(thor_x2), _G(thor_y2))) {
+ actr->_hitStrength = 255;
thor_damaged(actr);
}
- return actr->dir;
+ return actr->_dir;
}
- if (actr->actor_num != 3)
- return actr->dir;
+ if (actr->_actorNum != 3)
+ return actr->_dir;
- if (actr->i1) {
- actr->i1--;
- actr->x -= 2;
- check_move2(actr->x, actr->y, actr);
- _G(actor[4]).x -= 2;
- _G(actor[5]).x -= 2;
- _G(actor[6]).x -= 2;
+ if (actr->_i1) {
+ actr->_i1--;
+ actr->_x -= 2;
+ check_move2(actr->_x, actr->_y, actr);
+ _G(actor[4])._x -= 2;
+ _G(actor[5])._x -= 2;
+ _G(actor[6])._x -= 2;
}
next_frame(actr);
- if (actr->next == 3)
- actr->next = 0;
- _G(actor[4]).next = _G(actor[3]).next;
- _G(actor[5]).next = 0;
- _G(actor[6]).next = 0;
- return actr->dir;
+ if (actr->_nextFrame == 3)
+ actr->_nextFrame = 0;
+ _G(actor[4])._nextFrame = _G(actor[3])._nextFrame;
+ _G(actor[5])._nextFrame = 0;
+ _G(actor[6])._nextFrame = 0;
+ return actr->_dir;
}
// Troll 2
int movement_forty(ACTOR *actr) {
- if (overlap(actr->x + 1, actr->y + 1, actr->x + actr->size_x + 3,
- actr->y + actr->size_y - 1, _G(thor_x1), _G(thor_y1), _G(thor_x2), _G(thor_y2))) {
- actr->strength = 150;
+ if (overlap(actr->_x + 1, actr->_y + 1, actr->_x + actr->_sizeX + 3,
+ actr->_y + actr->_sizeY - 1, _G(thor_x1), _G(thor_y1), _G(thor_x2), _G(thor_y2))) {
+ actr->_hitStrength = 150;
thor_damaged(actr);
}
- int a = 5 + (actr->pass_value * 4);
- const int x1 = actr->x;
- int d = actr->last_dir;
+ int a = 5 + (actr->_passValue * 4);
+ const int x1 = actr->_x;
+ int d = actr->_lastDir;
- if (actr->last_dir == 2) {
- if (bgtile(x1 - 2, actr->y) >= TILE_SOLID) {
- _G(actor[a].x) -= 2;
- _G(actor[a - 1]).x -= 2;
- _G(actor[a - 2]).x -= 2;
- _G(actor[a + 1]).x -= 2;
+ if (actr->_lastDir == 2) {
+ if (bgtile(x1 - 2, actr->_y) >= TILE_SOLID) {
+ _G(actor[a]._x) -= 2;
+ _G(actor[a - 1])._x -= 2;
+ _G(actor[a - 2])._x -= 2;
+ _G(actor[a + 1])._x -= 2;
} else
d = 3;
- } else if (bgtile(_G(actor[a + 1]).x + 14, _G(actor[a + 1]).y) >= TILE_SOLID) {
- _G(actor[a]).x += 2;
- _G(actor[a - 1]).x += 2;
- _G(actor[a - 2]).x += 2;
- _G(actor[a + 1]).x += 2;
+ } else if (bgtile(_G(actor[a + 1])._x + 14, _G(actor[a + 1])._y) >= TILE_SOLID) {
+ _G(actor[a])._x += 2;
+ _G(actor[a - 1])._x += 2;
+ _G(actor[a - 2])._x += 2;
+ _G(actor[a + 1])._x += 2;
} else
d = 2;
- if (actr->next == 3 && !actr->num_shots && actr->frame_count == actr->frame_speed) {
+ if (actr->_nextFrame == 3 && !actr->_currNumShots && actr->_frameCount == actr->_frameSpeed) {
actor_always_shoots(actr, 1);
- _G(actor[actr->shot_actor]).x += 6;
+ _G(actor[actr->_shotActor])._x += 6;
}
next_frame(actr);
- _G(actor[a - 2]).next = actr->next;
- _G(actor[a - 1]).next = actr->next;
- _G(actor[a + 1]).next = actr->next;
- _G(actor[a - 2]).last_dir = d;
- _G(actor[a - 1]).last_dir = d;
- _G(actor[a + 1]).last_dir = d;
- actr->last_dir = d;
- if (actr->directions == 1)
+ _G(actor[a - 2])._nextFrame = actr->_nextFrame;
+ _G(actor[a - 1])._nextFrame = actr->_nextFrame;
+ _G(actor[a + 1])._nextFrame = actr->_nextFrame;
+ _G(actor[a - 2])._lastDir = d;
+ _G(actor[a - 1])._lastDir = d;
+ _G(actor[a + 1])._lastDir = d;
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
diff --git a/engines/got/game/object.cpp b/engines/got/game/object.cpp
index 74db95b8b8c..cecf9f6c538 100644
--- a/engines/got/game/object.cpp
+++ b/engines/got/game/object.cpp
@@ -79,7 +79,7 @@ void pick_up_object(int p) {
add_magic(3);
break;
case 5: // Good apple
- if (_G(thor)->health >= 150) {
+ if (_G(thor)->_health >= 150) {
cannot_carry_more();
return;
}
@@ -123,9 +123,9 @@ void pick_up_object(int p) {
case 26:
if (_G(object_map[p]) == 13 && HERMIT_HAS_DOLL)
return;
- _G(thor)->num_moves = 1;
- _G(hammer)->num_moves = 2;
- _G(actor[2]).used = 0;
+ _G(thor)->_numMoves = 1;
+ _G(hammer)->_numMoves = 2;
+ _G(actor[2])._active = 0;
_G(shield_on) = false;
_G(tornado_used) = false;
_G(thor_info).inventory |= 64;
@@ -145,9 +145,9 @@ void pick_up_object(int p) {
_G(shield_on) = false;
_G(lightning_used) = false;
_G(tornado_used) = false;
- _G(hammer)->num_moves = 2;
- _G(thor)->num_moves = 1;
- _G(actor[2]).used = 0;
+ _G(hammer)->_numMoves = 2;
+ _G(thor)->_numMoves = 1;
+ _G(actor[2])._active = 0;
s = 1 << (_G(object_map[p]) - 27);
_G(thor_info).inventory |= s;
odin_speaks((_G(object_map[p]) - 27) + 516, _G(object_map[p]) - 1);
@@ -200,10 +200,10 @@ int drop_object(ACTOR *actr) {
}
int _drop_obj(ACTOR *actr, int o) {
- int p = (actr->x + (actr->size_x / 2)) / 16 + (((actr->y + (actr->size_y / 2)) / 16) * 20);
+ int p = (actr->_x + (actr->_sizeX / 2)) / 16 + (((actr->_y + (actr->_sizeY / 2)) / 16) * 20);
if (!_G(object_map[p]) && _G(scrn).icon[p / 20][p % 20] >= 140) { //nothing there and solid
_G(object_map[p]) = o;
- _G(object_index[p]) = 27 + actr->actor_num; //actor is 3-15
+ _G(object_index[p]) = 27 + actr->_actorNum; //actor is 3-15
return 1;
}
@@ -212,7 +212,7 @@ int _drop_obj(ACTOR *actr, int o) {
}
int use_apple(int flag) {
- if (_G(thor)->health == 150)
+ if (_G(thor)->_health == 150)
return 0;
if (flag && _G(thor_info).magic > 0) {
@@ -261,25 +261,25 @@ int use_thunder(int flag) {
int use_boots(int flag) {
if (flag) {
if (_G(thor_info).magic > 0) {
- if (_G(thor)->num_moves == 1) {
+ if (_G(thor)->_numMoves == 1) {
_G(magic_cnt) = 0;
add_magic(-1);
} else if (_G(magic_cnt) > 8) {
_G(magic_cnt) = 0;
add_magic(-1);
}
- _G(thor)->num_moves = 2;
- _G(hammer)->num_moves = 3;
+ _G(thor)->_numMoves = 2;
+ _G(hammer)->_numMoves = 3;
return 1;
}
not_enough_magic();
- _G(thor)->num_moves = 1;
- _G(hammer)->num_moves = 2;
+ _G(thor)->_numMoves = 1;
+ _G(hammer)->_numMoves = 2;
} else {
- _G(thor)->num_moves = 1;
- _G(hammer)->num_moves = 2;
+ _G(thor)->_numMoves = 1;
+ _G(hammer)->_numMoves = 2;
}
return 0;
}
@@ -293,9 +293,9 @@ int use_shield(int flag) {
setup_magic_item(1);
_G(actor[2]) = _G(magic_item[1]);
- setup_actor(&_G(actor[2]), 2, 0, _G(thor)->x, _G(thor)->y);
- _G(actor[2]).speed_count = 1;
- _G(actor[2]).speed = 1;
+ setup_actor(&_G(actor[2]), 2, 0, _G(thor)->_x, _G(thor)->_y);
+ _G(actor[2])._moveCountdown = 1;
+ _G(actor[2])._speed = 1;
_G(shield_on) = true;
} else if (_G(magic_cnt) > 8) {
_G(magic_cnt) = 0;
@@ -309,8 +309,8 @@ int use_shield(int flag) {
}
if (_G(shield_on)) {
- _G(actor[2]).dead = 2;
- _G(actor[2]).used = 0;
+ _G(actor[2])._dead = 2;
+ _G(actor[2])._active = 0;
_G(shield_on) = false;
}
@@ -333,15 +333,15 @@ int use_lightning(int flag) {
int use_tornado(int flag) {
if (flag) {
if (_G(thor_info).magic > 10) {
- if (!_G(tornado_used) && !_G(actor[2]).dead && _G(magic_cnt) > 20) {
+ if (!_G(tornado_used) && !_G(actor[2])._dead && _G(magic_cnt) > 20) {
_G(magic_cnt) = 0;
add_magic(-10);
setup_magic_item(0);
_G(actor[2]) = _G(magic_item[0]);
- setup_actor(&_G(actor[2]), 2, 0, _G(thor)->x, _G(thor)->y);
- _G(actor[2]).last_dir = _G(thor)->dir;
- _G(actor[2]).move = 16;
+ setup_actor(&_G(actor[2]), 2, 0, _G(thor)->_x, _G(thor)->_y);
+ _G(actor[2])._lastDir = _G(thor)->_dir;
+ _G(actor[2])._moveType = 16;
_G(tornado_used) = true;
play_sound(WIND, false);
}
diff --git a/engines/got/game/script.cpp b/engines/got/game/script.cpp
index c2a7f137270..8c00d3ff58d 100644
--- a/engines/got/game/script.cpp
+++ b/engines/got/game/script.cpp
@@ -102,7 +102,7 @@ Scripts::~Scripts() {
void Scripts::execute_script(long index, const Gfx::Pics &speakerIcon, ScriptEndFn endFn) {
// Firstly disable any on-screen actors
for (int i = 0; i < MAX_ACTORS; i++)
- _G(actor[i]).show = 0;
+ _G(actor[i])._show = 0;
_endFn = endFn;
_scrIndex = index;
@@ -405,7 +405,7 @@ int Scripts::get_internal_variable() {
_lTemp = _G(thor_info).jewels;
break;
case 1:
- _lTemp = _G(thor)->health;
+ _lTemp = _G(thor)->_health;
break;
case 2:
_lTemp = _G(thor_info).magic;
@@ -453,10 +453,10 @@ int Scripts::get_internal_variable() {
_lTemp = 0;
break;
case 24:
- _lTemp = _G(scrn).icon[(_G(thor)->y + 8) / 16][(_G(thor)->x + 7) / 16];
+ _lTemp = _G(scrn).icon[(_G(thor)->_y + 8) / 16][(_G(thor)->_x + 7) / 16];
break;
case 25:
- _lTemp = (((_G(thor)->y + 8) / 16) * 20) + ((_G(thor)->x + 7) / 16);
+ _lTemp = (((_G(thor)->_y + 8) / 16) * 20) + ((_G(thor)->_x + 7) / 16);
break;
default:
return 0;
@@ -1019,14 +1019,14 @@ void Scripts::scr_func1() {
_G(new_level) = 109;
_G(new_level_tile) = 215;
- _G(thor)->x = (_G(new_level_tile) % 20) * 16;
- _G(thor)->y = ((_G(new_level_tile) / 20) * 16) - 2;
-
- _G(thor)->last_x[0] = _G(thor)->x;
- _G(thor)->last_x[1] = _G(thor)->x;
- _G(thor)->last_y[0] = _G(thor)->y;
- _G(thor)->last_y[1] = _G(thor)->y;
- _G(thor)->show = 2;
+ _G(thor)->_x = (_G(new_level_tile) % 20) * 16;
+ _G(thor)->_y = ((_G(new_level_tile) / 20) * 16) - 2;
+
+ _G(thor)->_lastX[0] = _G(thor)->_x;
+ _G(thor)->_lastX[1] = _G(thor)->_x;
+ _G(thor)->_lastY[0] = _G(thor)->_y;
+ _G(thor)->_lastY[1] = _G(thor)->_y;
+ _G(thor)->_show = 2;
}
void Scripts::scr_func2() {
@@ -1036,7 +1036,7 @@ void Scripts::scr_func2() {
}
void Scripts::scr_func3() {
- int p = (((_G(thor)->y + 8) / 16) * 20) + ((_G(thor)->x + 7) / 16);
+ int p = (((_G(thor)->_y + 8) / 16) * 20) + ((_G(thor)->_x + 7) / 16);
int y = p / 20;
int x = p % 20;
@@ -1084,7 +1084,7 @@ void Scripts::scr_func5() {
_G(scrn).actor_loc[1] -= 2;
_G(scrn).actor_loc[2] -= 2;
_G(scrn).actor_loc[3] -= 2;
- _G(actor[3]).i1 = 16;
+ _G(actor[3])._i1 = 16;
}
int Scripts::cmd_exec() {
diff --git a/engines/got/game/shot_movement.cpp b/engines/got/game/shot_movement.cpp
index 30483690fbe..08b032216c2 100644
--- a/engines/got/game/shot_movement.cpp
+++ b/engines/got/game/shot_movement.cpp
@@ -60,75 +60,75 @@ int (*const shot_movement_func[])(ACTOR *actr) = {
shot_movement_thirteen};
void next_shot_frame(ACTOR *actr) {
- if (actr->directions == 4 && actr->frames == 1) {
- actr->next = actr->last_dir;
- actr->dir = 0;
+ if (actr->_directions == 4 && actr->_framesPerDirection == 1) {
+ actr->_nextFrame = actr->_lastDir;
+ actr->_dir = 0;
} else {
- const int fcount = actr->frame_count - 1;
+ const int fcount = actr->_frameCount - 1;
if (fcount <= 0) {
- actr->next++;
- if (actr->next > 3)
- actr->next = 0;
+ actr->_nextFrame++;
+ if (actr->_nextFrame > 3)
+ actr->_nextFrame = 0;
- actr->frame_count = actr->frame_speed;
+ actr->_frameCount = actr->_frameSpeed;
} else
- actr->frame_count = fcount;
+ actr->_frameCount = fcount;
}
}
// Boss - snake
int shot_movement_none(ACTOR *actr) {
- actr->temp3--;
- if (!actr->temp3) {
+ actr->_temp3--;
+ if (!actr->_temp3) {
actor_destroyed(actr);
- if (_G(actor[actr->creator]).num_shots)
- _G(actor[actr->creator]).num_shots--;
+ if (_G(actor[actr->_creator])._currNumShots)
+ _G(actor[actr->_creator])._currNumShots--;
}
next_shot_frame(actr);
- if (actr->directions == 1)
+ if (actr->_directions == 1)
return 0;
- return actr->last_dir;
+ return actr->_lastDir;
}
int shot_movement_one(ACTOR *actr) {
int x1 = 0, y1 = 0;
- int d = actr->last_dir;
+ int d = actr->_lastDir;
switch (d) {
case 0:
- x1 = actr->x;
- y1 = actr->y - 2;
+ x1 = actr->_x;
+ y1 = actr->_y - 2;
break;
case 1:
- x1 = actr->x;
- y1 = actr->y + 2;
+ x1 = actr->_x;
+ y1 = actr->_y + 2;
break;
case 2:
- x1 = actr->x - 2;
- y1 = actr->y;
+ x1 = actr->_x - 2;
+ y1 = actr->_y;
break;
case 3:
- x1 = actr->x + 2;
- y1 = actr->y;
+ x1 = actr->_x + 2;
+ y1 = actr->_y;
break;
}
if (!check_move3(x1, y1, actr)) {
actor_destroyed(actr);
- if (_G(actor[actr->creator]).num_shots)
- _G(actor[actr->creator]).num_shots--;
+ if (_G(actor[actr->_creator])._currNumShots)
+ _G(actor[actr->_creator])._currNumShots--;
} else {
next_shot_frame(actr);
- actr->last_dir = d;
+ actr->_lastDir = d;
}
- if (actr->directions == 1)
+ if (actr->_directions == 1)
return 0;
- if (actr->directions == 4 && actr->frames == 1)
+ if (actr->_directions == 4 && actr->_framesPerDirection == 1)
return 0;
return d;
@@ -137,80 +137,80 @@ int shot_movement_one(ACTOR *actr) {
int shot_movement_two(ACTOR *actr) {
int x1 = 0, y1 = 0;
- int d = actr->last_dir;
+ int d = actr->_lastDir;
switch (d) {
case 0:
- x1 = actr->x;
- y1 = actr->y - 2;
+ x1 = actr->_x;
+ y1 = actr->_y - 2;
break;
case 1:
- x1 = actr->x;
- y1 = actr->y + 2;
+ x1 = actr->_x;
+ y1 = actr->_y + 2;
break;
case 2:
- x1 = actr->x - 2;
- y1 = actr->y;
+ x1 = actr->_x - 2;
+ y1 = actr->_y;
break;
case 3:
- x1 = actr->x + 2;
- y1 = actr->y;
+ x1 = actr->_x + 2;
+ y1 = actr->_y;
break;
}
if (!check_move4(x1, y1, actr)) {
actor_destroyed(actr);
- if (_G(actor[actr->creator]).num_shots)
- _G(actor[actr->creator]).num_shots--;
+ if (_G(actor[actr->_creator])._currNumShots)
+ _G(actor[actr->_creator])._currNumShots--;
} else {
next_shot_frame(actr);
- actr->last_dir = d;
+ actr->_lastDir = d;
}
- if (actr->directions == 1)
+ if (actr->_directions == 1)
return 0;
- if (actr->directions == 4 && actr->frames == 1)
+ if (actr->_directions == 4 && actr->_framesPerDirection == 1)
return 0;
return d;
}
// Serpent fire
int shot_movement_three(ACTOR *actr) {
- int d = actr->last_dir;
+ int d = actr->_lastDir;
- actr->x -= 2;
- actr->temp3--;
- actr->temp4--;
+ actr->_x -= 2;
+ actr->_temp3--;
+ actr->_temp4--;
if (overlap(_G(thor_x1) - 1, _G(thor_y1) - 1, _G(thor_x2) + 1, _G(thor_y2) + 1,
- actr->x, actr->y, actr->x + 15, actr->y + 15)) {
- actr->move = 0;
- actr->speed = 6;
+ actr->_x, actr->_y, actr->_x + 15, actr->_y + 15)) {
+ actr->_moveType = 0;
+ actr->_speed = 6;
thor_damaged(actr);
- actr->x += 2;
+ actr->_x += 2;
}
- if (!actr->temp4) {
- actr->temp4 = actr->temp5;
- actr->speed++;
- if (actr->speed > 6)
- actr->move = 0;
+ if (!actr->_temp4) {
+ actr->_temp4 = actr->_temp5;
+ actr->_speed++;
+ if (actr->_speed > 6)
+ actr->_moveType = 0;
}
- if (!actr->temp3) {
+ if (!actr->_temp3) {
actor_destroyed(actr);
- if (_G(actor[actr->creator]).num_shots)
- _G(actor[actr->creator]).num_shots--;
+ if (_G(actor[actr->_creator])._currNumShots)
+ _G(actor[actr->_creator])._currNumShots--;
} else {
next_shot_frame(actr);
- actr->last_dir = d;
+ actr->_lastDir = d;
}
- if (actr->directions == 1)
+ if (actr->_directions == 1)
return 0;
return d;
}
// Wraith balls
int shot_movement_four(ACTOR *actr) {
- if (actr->temp1) {
- actr->temp1--;
- if (!actr->temp1) {
+ if (actr->_temp1) {
+ actr->_temp1--;
+ if (!actr->_temp1) {
actor_destroyed(actr);
_G(apple_drop++);
if (_G(apple_drop) == 4) {
@@ -223,25 +223,25 @@ int shot_movement_four(ACTOR *actr) {
return 0;
}
}
- if (overlap(_G(thor)->x - 1, _G(thor)->y - 1, _G(thor_x2) + 1, _G(thor_y2) + 1,
- actr->x, actr->y, actr->x + 15, actr->y + 15)) {
+ if (overlap(_G(thor)->_x - 1, _G(thor)->_y - 1, _G(thor_x2) + 1, _G(thor_y2) + 1,
+ actr->_x, actr->_y, actr->_x + 15, actr->_y + 15)) {
thor_damaged(actr);
actor_destroyed(actr);
return 0;
}
- int x1 = actr->x;
- int y1 = actr->y;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
int yd = 0;
int xd = 0;
- int d = actr->last_dir;
+ int d = actr->_lastDir;
if ((x1 > (_G(thor_x1)) + 1))
xd = -2;
else if ((x1 < (_G(thor_x1)) - 1))
xd = 2;
- if (actr->actor_num == 1) {
+ if (actr->_actorNum == 1) {
if (y1 < (_G(thor_y1) - 6))
yd = 2;
else if (y1 > (_G(thor_y1) - 6))
@@ -266,8 +266,8 @@ int shot_movement_four(ACTOR *actr) {
y1 += yd;
if (check_move3(x1, y1, actr)) {
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
@@ -280,11 +280,11 @@ int shot_movement_four(ACTOR *actr) {
else if (xd == -2 && yd == 0)
d = 2;
- x1 = actr->x;
- y1 = actr->y;
- actr->toggle ^= 1;
+ x1 = actr->_x;
+ y1 = actr->_y;
+ actr->_toggle ^= 1;
- if (actr->toggle) {
+ if (actr->_toggle) {
if (xd) {
x1 += xd;
if (check_move3(x1, y1, actr)) {
@@ -293,12 +293,12 @@ int shot_movement_four(ACTOR *actr) {
else
d = 2;
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
- x1 = actr->x;
+ x1 = actr->_x;
}
if (yd) {
y1 += yd;
@@ -308,8 +308,8 @@ int shot_movement_four(ACTOR *actr) {
else
d = 0;
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
@@ -323,12 +323,12 @@ int shot_movement_four(ACTOR *actr) {
else
d = 0;
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
- y1 = actr->y;
+ y1 = actr->_y;
}
if (xd) {
x1 += xd;
@@ -338,17 +338,17 @@ int shot_movement_four(ACTOR *actr) {
else
d = 2;
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
}
}
- check_move3(actr->x, actr->y, actr);
+ check_move3(actr->_x, actr->_y, actr);
next_frame(actr);
- actr->last_dir = d;
- if (actr->directions == 1)
+ actr->_lastDir = d;
+ if (actr->_directions == 1)
return 0;
return d;
}
@@ -356,62 +356,62 @@ int shot_movement_four(ACTOR *actr) {
// No move, frame cycle
int shot_movement_five(ACTOR *actr) {
next_shot_frame(actr);
- if (actr->directions == 1)
+ if (actr->_directions == 1)
return 0;
- return actr->last_dir;
+ return actr->_lastDir;
}
// Wraith spots
int shot_movement_six(ACTOR *actr) {
- actr->temp1--;
- if (!actr->temp1) {
+ actr->_temp1--;
+ if (!actr->_temp1) {
actor_destroyed(actr);
- if (_G(actor[actr->creator]).num_shots)
- _G(actor[actr->creator]).num_shots--;
+ if (_G(actor[actr->_creator])._currNumShots)
+ _G(actor[actr->_creator])._currNumShots--;
} else
next_shot_frame(actr);
- if (actr->directions == 1)
+ if (actr->_directions == 1)
return 0;
- return actr->last_dir;
+ return actr->_lastDir;
}
-#define YV actr->i1
-#define YC actr->i2
-#define BC actr->i3
-#define YD actr->i4
-#define XD actr->i5
-#define XC actr->i6
+#define YV actr->_i1
+#define YC actr->_i2
+#define BC actr->_i3
+#define YD actr->_i4
+#define XD actr->_i5
+#define XC actr->_i6
#define IV 100
#define IC 50
// Skull drop
int shot_movement_seven(ACTOR *actr) {
- if (actr->temp3) {
- actr->temp3--;
+ if (actr->_temp3) {
+ actr->_temp3--;
goto done;
}
- if (overlap(actr->x, actr->y, actr->x + actr->size_x, actr->y + actr->size_y,
- _G(thor)->x, _G(thor)->y + 4, _G(thor)->x + 15, _G(thor)->y + 15))
+ if (overlap(actr->_x, actr->_y, actr->_x + actr->_sizeX, actr->_y + actr->_sizeY,
+ _G(thor)->_x, _G(thor)->_y + 4, _G(thor)->_x + 15, _G(thor)->_y + 15))
thor_damaged(actr);
- actr->temp2++;
- if (actr->temp2 > 2) {
- if (actr->temp4)
- actr->temp4--;
- actr->temp2 = 0;
+ actr->_temp2++;
+ if (actr->_temp2 > 2) {
+ if (actr->_temp4)
+ actr->_temp4--;
+ actr->_temp2 = 0;
}
- actr->temp3 = actr->temp4;
+ actr->_temp3 = actr->_temp4;
- actr->y += 2;
- if (actr->y > 160 - 36) {
- actr->x += (4 - g_events->getRandomNumber(8));
- actr->move = 8;
+ actr->_y += 2;
+ if (actr->_y > 160 - 36) {
+ actr->_x += (4 - g_events->getRandomNumber(8));
+ actr->_moveType = 8;
YV = IV;
YC = 0;
BC = IC;
YD = 0;
XC = 3;
- if (actr->x < 150)
+ if (actr->_x < 150)
XD = 1;
else
XD = 0;
@@ -419,17 +419,17 @@ int shot_movement_seven(ACTOR *actr) {
done:
next_shot_frame(actr);
- if (actr->directions == 1)
+ if (actr->_directions == 1)
return 0;
- return actr->last_dir;
+ return actr->_lastDir;
}
// Skull bounce
int shot_movement_eight(ACTOR *actr) {
int x, y;
- x = actr->x;
- y = actr->y;
+ x = actr->_x;
+ y = actr->_y;
XC--;
if (!XC) {
@@ -469,51 +469,51 @@ int shot_movement_eight(ACTOR *actr) {
if (y > 164)
y = 164;
// 8 311
- if (x < 1 || x > (319 - actr->size_x)) {
- if (!actr->dead)
- if (_G(actor[actr->creator]).num_shots)
- _G(actor[actr->creator]).num_shots--;
+ if (x < 1 || x > (319 - actr->_sizeX)) {
+ if (!actr->_dead)
+ if (_G(actor[actr->_creator])._currNumShots)
+ _G(actor[actr->_creator])._currNumShots--;
actor_destroyed(actr);
}
- if (overlap(actr->x, actr->y, actr->x + actr->size_x, actr->y + actr->size_y,
- _G(thor)->x, _G(thor)->y + 4, _G(thor)->x + 15, _G(thor)->y + 15))
+ if (overlap(actr->_x, actr->_y, actr->_x + actr->_sizeX, actr->_y + actr->_sizeY,
+ _G(thor)->_x, _G(thor)->_y + 4, _G(thor)->_x + 15, _G(thor)->_y + 15))
thor_damaged(actr);
- actr->x = x;
- actr->y = y;
+ actr->_x = x;
+ actr->_y = y;
//done:
next_shot_frame(actr);
- if (actr->directions == 1)
+ if (actr->_directions == 1)
return 0;
- return actr->last_dir;
+ return actr->_lastDir;
}
// Skull explode
int shot_movement_nine(ACTOR *actr) {
- actr->next++;
- if (actr->next == 3) {
- _G(actor[actr->creator]).num_shots--;
+ actr->_nextFrame++;
+ if (actr->_nextFrame == 3) {
+ _G(actor[actr->_creator])._currNumShots--;
actor_destroyed(actr);
return 0;
}
- if (actr->directions == 1)
+ if (actr->_directions == 1)
return 0;
- return actr->last_dir;
+ return actr->_lastDir;
}
// Skull - stalagtites
int shot_movement_ten(ACTOR *actr) {
int f = 0;
- actr->y += 2;
+ actr->_y += 2;
- if (overlap(actr->x, actr->y, actr->x + actr->size_x, actr->y + actr->size_y,
- _G(thor)->x, _G(thor)->y + 4, _G(thor)->x + 15, _G(thor)->y + 15)) {
+ if (overlap(actr->_x, actr->_y, actr->_x + actr->_sizeX, actr->_y + actr->_sizeY,
+ _G(thor)->_x, _G(thor)->_y + 4, _G(thor)->_x + 15, _G(thor)->_y + 15)) {
thor_damaged(actr);
f = 1;
}
- if ((actr->y > 160) || f) {
- if (_G(actor[actr->creator]).num_shots)
- _G(actor[actr->creator]).num_shots--;
+ if ((actr->_y > 160) || f) {
+ if (_G(actor[actr->_creator])._currNumShots)
+ _G(actor[actr->_creator])._currNumShots--;
actor_destroyed(actr);
}
@@ -522,12 +522,12 @@ int shot_movement_ten(ACTOR *actr) {
#undef YD
#undef XD
-#define YA actr->i1
-#define XA actr->i2
-#define YD actr->i3
-#define XD actr->i4
-#define DIR actr->i5
-#define CNT actr->i6
+#define YA actr->_i1
+#define XA actr->_i2
+#define YD actr->_i3
+#define XD actr->_i4
+#define DIR actr->_i5
+#define CNT actr->_i6
void calc_angle(int x1, int y1, int x2, int y2, ACTOR *actr) {
if (x1 < x2) {
@@ -561,12 +561,12 @@ void calc_angle(int x1, int y1, int x2, int y2, ACTOR *actr) {
// Angle throw
int shot_movement_eleven(ACTOR *actr) {
- int x1 = actr->x;
- int y1 = actr->y;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
- if (!actr->temp1) {
+ if (!actr->_temp1) {
calc_angle(_G(thor_x1), _G(thor_real_y1), x1, y1, actr);
- actr->temp1 = 1;
+ actr->_temp1 = 1;
}
if (DIR) {
@@ -586,25 +586,25 @@ int shot_movement_eleven(ACTOR *actr) {
}
if (!check_move3(x1, y1, actr)) {
- if (_G(actor[actr->creator]).num_shots)
- _G(actor[actr->creator]).num_shots--;
+ if (_G(actor[actr->_creator])._currNumShots)
+ _G(actor[actr->_creator])._currNumShots--;
actor_destroyed(actr);
} else
next_frame(actr);
- if (actr->directions == 1)
+ if (actr->_directions == 1)
return 0;
- return actr->last_dir;
+ return actr->_lastDir;
}
// Angle throw Loki
int shot_movement_twelve(ACTOR *actr) {
- int x1 = actr->x;
- int y1 = actr->y;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
- if (!actr->temp5) {
+ if (!actr->_temp5) {
calc_angle(_G(thor_x1), _G(thor_real_y1), x1, y1, actr);
- actr->temp5 = 1;
+ actr->_temp5 = 1;
}
if (DIR) {
@@ -626,39 +626,39 @@ int shot_movement_twelve(ACTOR *actr) {
if (x1 < 16 || x1 > 287 || y1 < 16 || y1 > 159) {
calc_angle(g_events->getRandomNumber(319),
g_events->getRandomNumber(191), x1, y1, actr);
- actr->move = 13;
- actr->temp4 = 240;
- actr->next = 2;
+ actr->_moveType = 13;
+ actr->_temp4 = 240;
+ actr->_nextFrame = 2;
} else {
if (overlap(x1 + 2, y1 + 2, x1 + 14, y1 + 14, _G(thor_x1), _G(thor_y1), _G(thor_x2), _G(thor_y2))) {
thor_damaged(actr);
}
- actr->x = x1;
- actr->y = y1;
+ actr->_x = x1;
+ actr->_y = y1;
}
- int fcount = actr->frame_count - 1;
+ int fcount = actr->_frameCount - 1;
if (fcount <= 0) {
- actr->next++;
- if (actr->next > 1)
- actr->next = 0;
- actr->frame_count = actr->frame_speed;
+ actr->_nextFrame++;
+ if (actr->_nextFrame > 1)
+ actr->_nextFrame = 0;
+ actr->_frameCount = actr->_frameSpeed;
} else
- actr->frame_count = fcount;
+ actr->_frameCount = fcount;
- if (actr->directions == 1)
+ if (actr->_directions == 1)
return 0;
- return actr->last_dir;
+ return actr->_lastDir;
}
// Angle throw Loki-2
int shot_movement_thirteen(ACTOR *actr) {
- int x1 = actr->x;
- int y1 = actr->y;
+ int x1 = actr->_x;
+ int y1 = actr->_y;
- if (!actr->temp5) {
+ if (!actr->_temp5) {
calc_angle(_G(thor_x1), _G(thor_real_y1), x1, y1, actr);
- actr->temp5 = 1;
+ actr->_temp5 = 1;
}
if (DIR) {
@@ -677,12 +677,12 @@ int shot_movement_thirteen(ACTOR *actr) {
}
}
- if (actr->temp4)
- actr->temp4--;
+ if (actr->_temp4)
+ actr->_temp4--;
- if (!actr->temp4) {
- if (_G(actor[actr->creator]).num_shots)
- _G(actor[actr->creator]).num_shots--;
+ if (!actr->_temp4) {
+ if (_G(actor[actr->_creator])._currNumShots)
+ _G(actor[actr->_creator])._currNumShots--;
actor_destroyed(actr);
_G(apple_drop++);
if (_G(apple_drop) > 4) {
@@ -704,23 +704,23 @@ int shot_movement_thirteen(ACTOR *actr) {
if (overlap(x1 + 4, y1 + 4, x1 + 12, y1 + 12, _G(thor_x1), _G(thor_y1), _G(thor_x2), _G(thor_y2))) {
thor_damaged(actr);
}
- actr->x = x1;
- actr->y = y1;
+ actr->_x = x1;
+ actr->_y = y1;
}
- int fcount = actr->frame_count - 1;
+ int fcount = actr->_frameCount - 1;
if (fcount <= 0) {
- actr->next++;
- if (actr->next > 3)
- actr->next = 2;
- actr->frame_count = actr->frame_speed;
+ actr->_nextFrame++;
+ if (actr->_nextFrame > 3)
+ actr->_nextFrame = 2;
+ actr->_frameCount = actr->_frameSpeed;
} else
- actr->frame_count = fcount;
+ actr->_frameCount = fcount;
- if (actr->directions == 1)
+ if (actr->_directions == 1)
return 0;
- return actr->last_dir;
+ return actr->_lastDir;
}
} // namespace Got
diff --git a/engines/got/game/shot_pattern.cpp b/engines/got/game/shot_pattern.cpp
index 9ab3d93a7d5..fed83dc8056 100644
--- a/engines/got/game/shot_pattern.cpp
+++ b/engines/got/game/shot_pattern.cpp
@@ -54,34 +54,34 @@ int shot_pattern_none(ACTOR *actr) {
// Uni-directional seek
int shot_pattern_one(ACTOR *actr) {
- switch (actr->last_dir) {
+ switch (actr->_lastDir) {
case 0:
- if (ABS(_G(thor_x1) - actr->x) < 8) {
- if (actr->y > _G(thor_real_y1)) { //r
+ if (ABS(_G(thor_x1) - actr->_x) < 8) {
+ if (actr->_y > _G(thor_real_y1)) { //r
if (actor_shoots(actr, 0))
return 1;
}
}
break;
case 1:
- if (ABS(_G(thor_x1) - actr->x) < 8) {
- if (actr->y < _G(thor_real_y1)) { //r
+ if (ABS(_G(thor_x1) - actr->_x) < 8) {
+ if (actr->_y < _G(thor_real_y1)) { //r
if (actor_shoots(actr, 1))
return 1;
}
}
break;
case 2:
- if (ABS(_G(thor_real_y1) - actr->y) < 8) { //r
- if (actr->x > _G(thor_x1)) {
+ if (ABS(_G(thor_real_y1) - actr->_y) < 8) { //r
+ if (actr->_x > _G(thor_x1)) {
if (actor_shoots(actr, 2))
return 1;
}
}
break;
case 3:
- if (ABS(_G(thor_real_y1) - actr->y) < 8) { //r
- if (actr->x < _G(thor_x1)) {
+ if (ABS(_G(thor_real_y1) - actr->_y) < 8) { //r
+ if (actr->_x < _G(thor_x1)) {
if (actor_shoots(actr, 3))
return 1;
}
@@ -94,17 +94,17 @@ int shot_pattern_one(ACTOR *actr) {
// Omni directional
int shot_pattern_two(ACTOR *actr) {
- if (ABS(_G(thor)->x - actr->x) < 8) {
- if (_G(thor)->y > actr->y)
+ if (ABS(_G(thor)->_x - actr->_x) < 8) {
+ if (_G(thor)->_y > actr->_y)
actor_shoots(actr, 1);
- else if (_G(thor)->y < actr->y)
+ else if (_G(thor)->_y < actr->_y)
actor_shoots(actr, 0);
else
return 0;
- } else if (ABS(_G(thor)->y - actr->y) < 8) {
- if (_G(thor)->x > actr->x)
+ } else if (ABS(_G(thor)->_y - actr->_y) < 8) {
+ if (_G(thor)->_x > actr->_x)
actor_shoots(actr, 3);
- else if (_G(thor)->x < actr->x)
+ else if (_G(thor)->_x < actr->_x)
actor_shoots(actr, 2);
} else {
return 0;
@@ -115,32 +115,32 @@ int shot_pattern_two(ACTOR *actr) {
// Uni directional (backwards)
int shot_pattern_three(ACTOR *actr) {
- int ld = actr->last_dir;
+ int ld = actr->_lastDir;
if (shot_pattern_one(actr)) {
- actr->last_dir = reverse_direction(actr);
+ actr->_lastDir = reverse_direction(actr);
return 1;
}
- actr->last_dir = reverse_direction(actr);
+ actr->_lastDir = reverse_direction(actr);
shot_pattern_one(actr);
- actr->last_dir = ld;
+ actr->_lastDir = ld;
return 1;
}
// Omni-directional not solid shot
int shot_pattern_four(ACTOR *actr) {
- if (ABS(_G(thor)->x - actr->x) < 8) {
- if (_G(thor)->y > actr->y)
+ if (ABS(_G(thor)->_x - actr->_x) < 8) {
+ if (_G(thor)->_y > actr->_y)
actor_always_shoots(actr, 1);
- else if (_G(thor)->y < actr->y)
+ else if (_G(thor)->_y < actr->_y)
actor_always_shoots(actr, 0);
else
return 0;
- } else if (ABS(_G(thor)->y - actr->y) < 8) {
- if (_G(thor)->x > actr->x)
+ } else if (ABS(_G(thor)->_y - actr->_y) < 8) {
+ if (_G(thor)->_x > actr->_x)
actor_always_shoots(actr, 3);
- else if (_G(thor)->x < actr->x)
+ else if (_G(thor)->_x < actr->_x)
actor_always_shoots(actr, 2);
} else {
return 0;
@@ -151,18 +151,18 @@ int shot_pattern_four(ACTOR *actr) {
// Boss - snake
int shot_pattern_five(ACTOR *actr) {
- if (_G(rand1) < 15 && (actr->temp1 == 0) && (actr->temp2 == 0)) {
- actr->y += 16;
- actr->shots_allowed = 3 + _G(setup).skill;
+ if (_G(rand1) < 15 && (actr->_temp1 == 0) && (actr->_temp2 == 0)) {
+ actr->_y += 16;
+ actr->_numShotsAllowed = 3 + _G(setup).skill;
actor_shoots(actr, 2);
play_sound(BOSS12, false);
- int num = actr->shot_actor;
- actr->shot_cnt = 50;
- _G(actor[num]).temp3 = 120;
- _G(actor[num]).temp4 = 5 + (_G(rand2) % 17);
- _G(actor[num]).temp5 = _G(actor[num]).temp4;
- actr->y -= 16;
+ int num = actr->_shotActor;
+ actr->_shotCountdown = 50;
+ _G(actor[num])._temp3 = 120;
+ _G(actor[num])._temp4 = 5 + (_G(rand2) % 17);
+ _G(actor[num])._temp5 = _G(actor[num])._temp4;
+ actr->_y -= 16;
return 1;
}
@@ -171,7 +171,7 @@ int shot_pattern_five(ACTOR *actr) {
// 4 surrounding squares
int shot_pattern_six(ACTOR *actr) {
- int pos = ((actr->x) / 16) + (((actr->y) / 16) * 20);
+ int pos = ((actr->_x) / 16) + (((actr->_y) / 16) * 20);
if (_G(thor_pos) == pos - 20)
actor_shoots(actr, 0);
@@ -184,8 +184,8 @@ int shot_pattern_six(ACTOR *actr) {
else
return 0;
- actr->frame_sequence[3] = 3;
- actr->next = 3;
+ actr->_frameSequence[3] = 3;
+ actr->_nextFrame = 3;
return 1;
}
@@ -196,16 +196,16 @@ int shot_pattern_seven(ACTOR *actr) {
// random
int shot_pattern_eight(ACTOR *actr) {
- if (!actr->i2) {
- actr->i1 = actr->func_pass;
- actr->i2 = 1;
+ if (!actr->_i2) {
+ actr->_i1 = actr->_funcPass;
+ actr->_i2 = 1;
}
- if (actr->i1) {
- actr->i1--;
+ if (actr->_i1) {
+ actr->_i1--;
} else if (_G(rand1) < 10) {
- actr->i1 = actr->func_pass;
- actr->i2 = _G(thor_real_y1);
+ actr->_i1 = actr->_funcPass;
+ actr->_i2 = _G(thor_real_y1);
actor_shoots(actr, 0);
return 1;
}
diff --git a/engines/got/game/special_tile.cpp b/engines/got/game/special_tile.cpp
index 092f5c555c6..d1b80109abc 100644
--- a/engines/got/game/special_tile.cpp
+++ b/engines/got/game/special_tile.cpp
@@ -51,7 +51,7 @@ int special_tile_thor(int x, int y, int icon) {
return 0;
}
- if (_G(thor)->x > 300)
+ if (_G(thor)->_x > 300)
// Ending bridge
_G(end_tile) = true;
return 1;
@@ -74,25 +74,25 @@ int special_tile_thor(int x, int y, int icon) {
_G(slip_flag) = true;
return 1;
} else if (GAME3) {
- if (_G(thor)->x < 4)
+ if (_G(thor)->_x < 4)
_G(end_tile) = true;
return 1;
}
return 0;
case 205:
- if (!_G(diag) && _G(thor)->dir != 1)
+ if (!_G(diag) && _G(thor)->_dir != 1)
return 1;
break;
case 206:
- if (!_G(diag) && _G(thor)->dir != 0)
+ if (!_G(diag) && _G(thor)->_dir != 0)
return 1;
break;
case 207:
- if (!_G(diag) && _G(thor)->dir != 3)
+ if (!_G(diag) && _G(thor)->_dir != 3)
return 1;
break;
case 208:
- if (!_G(diag) && _G(thor)->dir != 2)
+ if (!_G(diag) && _G(thor)->_dir != 2)
return 1;
break;
case 209:
@@ -104,7 +104,7 @@ int special_tile_thor(int x, int y, int icon) {
place_tile(y, x, 79);
_G(exit_flag) = 2;
} else if (GAME2) {
- if (_G(thor)->dir == 0 && _G(setup).f29 && _G(setup).f21 && !_G(setup).f22) {
+ if (_G(thor)->_dir == 0 && _G(setup).f29 && _G(setup).f21 && !_G(setup).f22) {
actor_visible(1);
actor_visible(2);
actor_visible(3);
@@ -131,19 +131,19 @@ int special_tile_thor(int x, int y, int icon) {
cx = (_G(thor_x1) + 7) / 16;
cy = (_G(thor_real_y1) + 8) / 16;
if (_G(scrn).icon[cy][cx] == icon) {
- _G(thor)->vunerable = STAMINA;
+ _G(thor)->_vulnerableCountdown = STAMINA;
play_sound(WOOP, false);
int nt = _G(scrn).new_level_loc[icon - 214];
int display_page = _G(pge);
int draw_page = _G(pge) ^ 1;
- _G(thor)->last_x[display_page] = _G(thor)->x;
- _G(thor)->last_y[display_page] = _G(thor)->y;
- _G(thor)->x = (nt % 20) * 16;
- _G(thor)->y = ((nt / 20) * 16) - 2;
- _G(thor)->last_x[draw_page] = _G(thor)->x;
- _G(thor)->last_y[draw_page] = _G(thor)->y;
+ _G(thor)->_lastX[display_page] = _G(thor)->_x;
+ _G(thor)->_lastY[display_page] = _G(thor)->_y;
+ _G(thor)->_x = (nt % 20) * 16;
+ _G(thor)->_y = ((nt / 20) * 16) - 2;
+ _G(thor)->_lastX[draw_page] = _G(thor)->_x;
+ _G(thor)->_lastY[draw_page] = _G(thor)->_y;
return 0;
}
return 1;
@@ -168,7 +168,7 @@ int special_tile_thor(int x, int y, int icon) {
cx = (_G(thor_x1) + 7) / 16;
cy = (_G(thor_real_y1) + 8) / 16;
if (_G(scrn).icon[cy][cx] == icon) {
- _G(thor)->vunerable = STAMINA;
+ _G(thor)->_vulnerableCountdown = STAMINA;
if (icon < 224 && icon > 219)
play_sound(FALL, false);
@@ -183,22 +183,22 @@ int special_tile_thor(int x, int y, int icon) {
_G(warp_flag) = true;
if (_G(warp_scroll)) {
- if (_G(thor)->dir == 0)
- _G(thor)->y = 175;
- else if (_G(thor)->dir == 1)
- _G(thor)->y = 0;
- else if (_G(thor)->dir == 2)
- _G(thor)->x = 304;
- else if (_G(thor)->dir == 3)
- _G(thor)->x = 0;
+ if (_G(thor)->_dir == 0)
+ _G(thor)->_y = 175;
+ else if (_G(thor)->_dir == 1)
+ _G(thor)->_y = 0;
+ else if (_G(thor)->_dir == 2)
+ _G(thor)->_x = 304;
+ else if (_G(thor)->_dir == 3)
+ _G(thor)->_x = 0;
} else {
- _G(thor)->x = (_G(new_level_tile) % 20) * 16;
- _G(thor)->y = ((_G(new_level_tile) / 20) * 16) - 2;
+ _G(thor)->_x = (_G(new_level_tile) % 20) * 16;
+ _G(thor)->_y = ((_G(new_level_tile) / 20) * 16) - 2;
}
- _G(thor)->last_x[0] = _G(thor)->x;
- _G(thor)->last_x[1] = _G(thor)->x;
- _G(thor)->last_y[0] = _G(thor)->y;
- _G(thor)->last_y[1] = _G(thor)->y;
+ _G(thor)->_lastX[0] = _G(thor)->_x;
+ _G(thor)->_lastX[1] = _G(thor)->_x;
+ _G(thor)->_lastY[0] = _G(thor)->_y;
+ _G(thor)->_lastY[1] = _G(thor)->_y;
return 0;
}
@@ -231,7 +231,7 @@ int special_tile(ACTOR *actr, int x, int y, int icon) {
case 225:
case 226:
case 227:
- if (!actr->flying)
+ if (!actr->_flying)
return 0;
return 1;
default:
diff --git a/engines/got/game/status.cpp b/engines/got/game/status.cpp
index 4a491815343..481078bccc4 100644
--- a/engines/got/game/status.cpp
+++ b/engines/got/game/status.cpp
@@ -38,9 +38,9 @@ void add_magic(int num) {
}
void add_health(int num) {
- _G(thor)->health = CLIP(_G(thor)->health + num, 0, 150);
+ _G(thor)->_health = CLIP(_G(thor)->_health + num, 0, 150);
- if (_G(thor)->health < 1)
+ if (_G(thor)->_health < 1)
g_events->send(GameMessage("THOR_DIES"));
}
diff --git a/engines/got/gfx/image.cpp b/engines/got/gfx/image.cpp
index bd244c0c984..cf769204d70 100644
--- a/engines/got/gfx/image.cpp
+++ b/engines/got/gfx/image.cpp
@@ -41,50 +41,50 @@ static void createSurface(Graphics::ManagedSurface &s, const byte *src) {
}
void setup_actor(ACTOR *actr, char num, char dir, int x, int y) {
- actr->next = 0; // Next frame to be shown
- actr->frame_count = actr->frame_speed;
- actr->dir = dir; // Direction of travel
- actr->last_dir = dir; // Last direction of travel
- if (actr->directions == 1)
- actr->dir = 0;
- if (actr->directions == 2)
- actr->dir &= 1;
- if (actr->directions == 4 && actr->frames == 1) {
- actr->dir = 0;
- actr->next = dir;
+ actr->_nextFrame = 0; // Next frame to be shown
+ actr->_frameCount = actr->_frameSpeed;
+ actr->_dir = dir; // Direction of travel
+ actr->_lastDir = dir; // Last direction of travel
+ if (actr->_directions == 1)
+ actr->_dir = 0;
+ if (actr->_directions == 2)
+ actr->_dir &= 1;
+ if (actr->_directions == 4 && actr->_framesPerDirection == 1) {
+ actr->_dir = 0;
+ actr->_nextFrame = dir;
}
- actr->x = x; // Actual X coor
- actr->y = y; // Actual Y coor
- actr->width = 16; // Actual X coor
- actr->height = 16; // Actual Y coor
- actr->center = 0; // Center of object
- actr->last_x[0] = x; // Last X coor on each page
- actr->last_x[1] = x;
- actr->last_y[0] = y; // Last Y coor on each page
- actr->last_y[1] = y;
- actr->used = 1; // 1=active, 0=not active
- actr->speed_count = 8; // Count down to movement
- actr->vunerable = STAMINA; // Count down to vulnerability
- actr->shot_cnt = 20; // Count down to another shot
- actr->num_shots = 0; // # of shots currently on screen
- actr->creator = 0; // which actor # created this actor
- actr->pause = 0; // Pause must be 0 to move
- actr->show = 0;
- actr->actor_num = num;
- actr->counter = 0;
- actr->move_counter = 0;
- actr->edge_counter = 20;
- actr->hit_thor = 0;
- actr->rand = g_engine->getRandomNumber(99);
- actr->temp1 = 0;
- actr->init_health = actr->health;
+ actr->_x = x; // Actual X coor
+ actr->_y = y; // Actual Y coor
+ actr->_width = 16; // Actual X coor
+ actr->_height = 16; // Actual Y coor
+ actr->_center = 0; // Center of object
+ actr->_lastX[0] = x; // Last X coor on each page
+ actr->_lastX[1] = x;
+ actr->_lastY[0] = y; // Last Y coor on each page
+ actr->_lastY[1] = y;
+ actr->_active = 1; // 1=active, 0=not active
+ actr->_moveCountdown = 8; // Count down to movement
+ actr->_vulnerableCountdown = STAMINA; // Count down to vulnerability
+ actr->_shotCountdown = 20; // Count down to another shot
+ actr->_currNumShots = 0; // # of shots currently on screen
+ actr->_creator = 0; // which actor # created this actor
+ actr->_unpauseCountdown = 0; // Pause must be 0 to move
+ actr->_show = 0;
+ actr->_actorNum = num;
+ actr->_counter = 0;
+ actr->_moveCounter = 0;
+ actr->_edgeCounter = 20;
+ actr->_hitThor = 0;
+ actr->_rand = g_engine->getRandomNumber(99);
+ actr->_temp1 = 0;
+ actr->_initHealth = actr->_health;
}
void make_actor_surface(ACTOR *actr) {
- assert(actr->directions <= 4 && actr->frames <= 4);
- for (int d = 0; d < actr->directions; d++) {
- for (int f = 0; f < actr->frames; f++) {
+ assert(actr->_directions <= 4 && actr->_framesPerDirection <= 4);
+ for (int d = 0; d < actr->_directions; d++) {
+ for (int f = 0; f < actr->_framesPerDirection; f++) {
Graphics::ManagedSurface &s = actr->pic[d][f];
const byte *src = &_G(tmp_buff[256 * ((d * 4) + f)]);
createSurface(s, src);
@@ -100,15 +100,15 @@ int load_standard_actors() {
make_actor_surface(&_G(actor[0]));
- _G(thor_x1) = _G(thor)->x + 2;
- _G(thor_y1) = _G(thor)->y + 2;
- _G(thor_x2) = _G(thor)->x + 14;
- _G(thor_y2) = _G(thor)->y + 14;
+ _G(thor_x1) = _G(thor)->_x + 2;
+ _G(thor_y1) = _G(thor)->_y + 2;
+ _G(thor_x2) = _G(thor)->_x + 14;
+ _G(thor_y2) = _G(thor)->_y + 14;
load_actor(0, 103 + _G(thor_info).armor); // Load hammer
_G(actor[1]).loadFixed(_G(tmp_buff) + 5120);
setup_actor(&_G(actor[1]), 1, 0, 100, 100);
- _G(actor[1]).used = 0;
+ _G(actor[1])._active = 0;
_G(hammer) = &_G(actor[1]);
make_actor_surface(&_G(actor[1]));
@@ -117,14 +117,14 @@ int load_standard_actors() {
load_actor(0, 106);
_G(sparkle).loadFixed(_G(tmp_buff) + 5120);
setup_actor(&_G(sparkle), 20, 0, 100, 100);
- _G(sparkle).used = 0;
+ _G(sparkle)._active = 0;
make_actor_surface(&_G(sparkle));
// Load explosion
load_actor(0, 107);
_G(explosion).loadFixed(_G(tmp_buff) + 5120);
setup_actor(&_G(explosion), 21, 0, 100, 100);
- _G(explosion).used = 0;
+ _G(explosion)._active = 0;
make_actor_surface(&_G(explosion));
// Load tornado
@@ -133,7 +133,7 @@ int load_standard_actors() {
Common::copy(_G(tmp_buff), _G(tmp_buff) + 1024, _G(magic_pic[0]));
setup_actor(&_G(magic_item[0]), 20, 0, 0, 0);
- _G(magic_item[0]).used = 0;
+ _G(magic_item[0])._active = 0;
// Load shield
load_actor(0, 109);
@@ -141,9 +141,9 @@ int load_standard_actors() {
Common::copy(_G(tmp_buff), _G(tmp_buff) + 1024, _G(magic_pic[1]));
setup_actor(&_G(magic_item[1]), 20, 0, 0, 0);
- _G(magic_item[1]).used = 0;
+ _G(magic_item[1])._active = 0;
- _G(actor[2]).used = 0;
+ _G(actor[2])._active = 0;
make_actor_surface(&_G(magic_item[0]));
@@ -151,34 +151,33 @@ int load_standard_actors() {
}
void show_enemies() {
- int i, d, r;
+ for (int i = 3; i < MAX_ACTORS; i++)
+ _G(actor[i])._active = 0;
- for (i = 3; i < MAX_ACTORS; i++)
- _G(actor[i]).used = 0;
- for (i = 0; i < MAX_ENEMIES; i++)
+ for (int i = 0; i < MAX_ENEMIES; i++)
_G(enemy_type[i]) = 0;
- for (i = 0; i < MAX_ENEMIES; i++) {
+ for (int i = 0; i < MAX_ENEMIES; i++) {
if (_G(scrn).actor_type[i] > 0) {
- r = load_enemy(_G(scrn).actor_type[i]);
+ int r = load_enemy(_G(scrn).actor_type[i]);
if (r >= 0) {
_G(actor[i + 3]) = _G(enemy[r]);
- d = _G(scrn).actor_dir[i];
+ int d = _G(scrn).actor_dir[i];
setup_actor(&_G(actor[i + 3]), i + 3, d, (_G(scrn).actor_loc[i] % 20) * 16,
(_G(scrn).actor_loc[i] / 20) * 16);
- _G(actor[i + 3]).init_dir = _G(scrn).actor_dir[i];
- _G(actor[i + 3]).pass_value = _G(scrn).actor_value[i];
+ _G(actor[i + 3])._initDir = _G(scrn).actor_dir[i];
+ _G(actor[i + 3])._passValue = _G(scrn).actor_value[i];
- if (_G(actor[i + 3]).move == 23) {
+ if (_G(actor[i + 3])._moveType == 23) {
// Spinball
- if (_G(actor[i + 3]).pass_value & 1)
- _G(actor[i + 3]).move = 24;
+ if (_G(actor[i + 3])._passValue & 1)
+ _G(actor[i + 3])._moveType = 24;
}
if (_G(scrn).actor_invis[i])
- _G(actor[i + 3]).used = 0;
+ _G(actor[i + 3])._active = 0;
}
_G(etype[i]) = r;
@@ -187,9 +186,7 @@ void show_enemies() {
}
int load_enemy(int type) {
- int i, e;
-
- for (i = 0; i < MAX_ENEMIES; i++) {
+ for (int i = 0; i < MAX_ENEMIES; i++) {
if (_G(enemy_type[i]) == type)
return i;
}
@@ -198,8 +195,8 @@ int load_enemy(int type) {
return -1;
}
- e = -1;
- for (i = 0; i < MAX_ENEMIES; i++) {
+ int e = -1;
+ for (int i = 0; i < MAX_ENEMIES; i++) {
if (!_G(enemy_type[i])) {
e = i;
break;
@@ -213,18 +210,18 @@ int load_enemy(int type) {
make_actor_surface(&_G(enemy[e]));
_G(enemy_type[e]) = type;
- _G(enemy[e]).shot_type = 0;
+ _G(enemy[e])._shotType = 0;
- if (_G(enemy[e]).shots_allowed) {
- _G(enemy[e]).shot_type = e + 1;
+ if (_G(enemy[e])._numShotsAllowed) {
+ _G(enemy[e])._shotType = e + 1;
// Set up shot info
_G(shot[e]).loadFixed(_G(tmp_buff) + 5160);
// Loop to set up graphics
- for (int d = 0; d < _G(shot[e]).directions; d++) {
- for (int f = 0; f < _G(shot[e]).frames; f++) {
- if (_G(shot[e]).directions < _G(shot[e]).frames) {
+ for (int d = 0; d < _G(shot[e])._directions; d++) {
+ for (int f = 0; f < _G(shot[e])._framesPerDirection; f++) {
+ if (_G(shot[e])._directions < _G(shot[e])._framesPerDirection) {
Graphics::ManagedSurface &s = _G(shot[e]).pic[d][f];
const byte *src = &_G(tmp_buff[4096 + (256 * ((d * 4) + f))]);
createSurface(s, src);
@@ -244,14 +241,14 @@ int actor_visible(int invis_num) {
for (int i = 0; i < MAX_ENEMIES; i++) {
if (_G(scrn).actor_invis[i] == invis_num) {
int etype = _G(etype[i]);
- if (etype >= 0 && !_G(actor[i + 3]).used) {
+ if (etype >= 0 && !_G(actor[i + 3])._active) {
_G(actor[i + 3]) = _G(enemy[etype]);
int d = _G(scrn).actor_dir[i];
setup_actor(&_G(actor[i + 3]), i + 3, d, (_G(scrn).actor_loc[i] % 20) * 16,
(_G(scrn).actor_loc[i] / 20) * 16);
- _G(actor[i + 3]).init_dir = _G(scrn).actor_dir[i];
- _G(actor[i + 3]).pass_value = _G(scrn).actor_value[i];
+ _G(actor[i + 3])._initDir = _G(scrn).actor_dir[i];
+ _G(actor[i + 3])._passValue = _G(scrn).actor_value[i];
return i;
}
diff --git a/engines/got/got.cpp b/engines/got/got.cpp
index bb8b66dce81..2da43feaa02 100644
--- a/engines/got/got.cpp
+++ b/engines/got/got.cpp
@@ -139,19 +139,19 @@ Common::Error GotEngine::syncGame(Common::Serializer &s) {
void GotEngine::savegameLoaded() {
_G(current_area) = _G(thor_info).last_screen;
- _G(thor)->x = (_G(thor_info).last_icon % 20) * 16;
- _G(thor)->y = ((_G(thor_info).last_icon / 20) * 16) - 1;
- if (_G(thor)->x < 1)
- _G(thor)->x = 1;
- if (_G(thor)->y < 0)
- _G(thor)->y = 0;
- _G(thor)->dir = _G(thor_info).last_dir;
- _G(thor)->last_dir = _G(thor_info).last_dir;
- _G(thor)->health = _G(thor_info).last_health;
- _G(thor)->num_moves = 1;
- _G(thor)->vunerable = 60;
- _G(thor)->show = 60;
- _G(thor)->speed_count = 6;
+ _G(thor)->_x = (_G(thor_info).last_icon % 20) * 16;
+ _G(thor)->_y = ((_G(thor_info).last_icon / 20) * 16) - 1;
+ if (_G(thor)->_x < 1)
+ _G(thor)->_x = 1;
+ if (_G(thor)->_y < 0)
+ _G(thor)->_y = 0;
+ _G(thor)->_dir = _G(thor_info).last_dir;
+ _G(thor)->_lastDir = _G(thor_info).last_dir;
+ _G(thor)->_health = _G(thor_info).last_health;
+ _G(thor)->_numMoves = 1;
+ _G(thor)->_vulnerableCountdown = 60;
+ _G(thor)->_show = 60;
+ _G(thor)->_moveCountdown = 6;
load_new_thor();
g_vars->resetEndgameFlags();
@@ -225,8 +225,8 @@ void GotEngine::pauseEngineIntern(bool pause) {
}
if (_G(shield_on)) {
- _G(actor[2]).dead = 2;
- _G(actor[2]).used = 0;
+ _G(actor[2])._dead = 2;
+ _G(actor[2])._active = 0;
_G(shield_on) = false;
}
diff --git a/engines/got/views/game_content.cpp b/engines/got/views/game_content.cpp
index c837a2f7f50..046c7b3cfbb 100644
--- a/engines/got/views/game_content.cpp
+++ b/engines/got/views/game_content.cpp
@@ -155,7 +155,7 @@ bool GameContent::tick() {
if (_deathCtr < DEATH_THRESHOLD) {
spinThor();
} else if (_deathCtr < DEATH_THRESHOLD + 60) {
- _G(thor)->used = 0;
+ _G(thor)->_active = 0;
++_deathCtr;
} else {
thorDead();
@@ -177,8 +177,8 @@ bool GameContent::tick() {
if (--_pauseCtr <= 0) {
_pauseCtr = 2;
- if (_G(thor)->health > 0) {
- _G(thor)->health--;
+ if (_G(thor)->_health > 0) {
+ _G(thor)->_health--;
play_sound(WOOP, 1);
add_health(-1);
add_score(10);
@@ -254,12 +254,12 @@ void GameContent::drawActors(GfxSurface &s) {
for (int actor_num = 0; actor_num <= MAX_ACTORS;) {
// Check for blinking flag
- if (actor_ptr->used && !(actor_ptr->show & 2)) {
- actor_ptr->last_x[_G(pge)] = actor_ptr->x;
- actor_ptr->last_y[_G(pge)] = actor_ptr->y;
+ if (actor_ptr->_active && !(actor_ptr->_show & 2)) {
+ actor_ptr->_lastX[_G(pge)] = actor_ptr->_x;
+ actor_ptr->_lastY[_G(pge)] = actor_ptr->_y;
- const Graphics::ManagedSurface &frame = actor_ptr->pic[actor_ptr->dir][actor_ptr->frame_sequence[actor_ptr->next]];
- s.simpleBlitFrom(frame, Common::Point(actor_ptr->x, actor_ptr->y));
+ const Graphics::ManagedSurface &frame = actor_ptr->pic[actor_ptr->_dir][actor_ptr->_frameSequence[actor_ptr->_nextFrame]];
+ s.simpleBlitFrom(frame, Common::Point(actor_ptr->_x, actor_ptr->_y));
}
// Move to the next actor
@@ -275,13 +275,13 @@ void GameContent::drawActors(GfxSurface &s) {
}
if (_G(gameMode) == MODE_THOR_DIES && _deathCtr >= DEATH_THRESHOLD)
- s.simpleBlitFrom(_G(objects[10]), Common::Point(_G(thor)->x, _G(thor)->y));
+ s.simpleBlitFrom(_G(objects[10]), Common::Point(_G(thor)->_x, _G(thor)->_y));
}
void GameContent::drawBossHealth(GfxSurface &s) {
int c;
- int health = _G(actor[3]).health;
+ int health = _G(actor[3])._health;
s.fillRect(Common::Rect(304, 2, 317, 81), 0);
s.fillRect(Common::Rect(305, 3, 316, 80), 28);
@@ -313,8 +313,8 @@ void GameContent::checkThunderShake() {
_G(thunder_flag--);
if ((_G(thunder_flag) < MAX_ACTORS) && _G(thunder_flag) > 2) {
int thunderFl = _G(thunder_flag);
- if (_G(actor[thunderFl]).used) {
- _G(actor[thunderFl]).vunerable = 0;
+ if (_G(actor[thunderFl])._active) {
+ _G(actor[thunderFl])._vulnerableCountdown = 0;
actor_damaged(&_G(actor[thunderFl]), 20);
}
}
@@ -353,13 +353,13 @@ void GameContent::checkForItem() {
void GameContent::moveActors() {
for (int i = 0; i < MAX_ACTORS; i++) {
- if (_G(actor[i]).used) {
+ if (_G(actor[i])._active) {
if (_G(hourglass_flag))
- if ((i > 2) && (!_G(pge)) && (!(_G(actor[i]).magic_hurts & LIGHTNING_MAGIC)))
+ if ((i > 2) && (!_G(pge)) && (!(_G(actor[i])._magicHurts & LIGHTNING_MAGIC)))
continue;
- _G(actor[i]).move_count = _G(actor[i]).num_moves;
- while (_G(actor[i]).move_count--)
+ _G(actor[i])._moveCount = _G(actor[i])._numMoves;
+ while (_G(actor[i])._moveCount--)
move_actor(&_G(actor[i]));
if (i == 0)
@@ -371,16 +371,16 @@ void GameContent::moveActors() {
}
int thor_pos = _G(thor)->getPos();
- _G(thor)->center_x = thor_pos % 20;
- _G(thor)->center_y = thor_pos / 20;
+ _G(thor)->_centerX = thor_pos % 20;
+ _G(thor)->_centerY = thor_pos / 20;
}
void GameContent::updateActors() {
for (int i = 0; i < MAX_ACTORS; ++i) {
ACTOR *actor = &_G(actor[i]);
- if (!actor->used && actor->dead > 0)
- actor->dead--;
+ if (!actor->_active && actor->_dead > 0)
+ actor->_dead--;
}
}
@@ -388,7 +388,7 @@ void GameContent::checkForBossDead() {
if (_G(boss_dead)) {
int loop;
for (loop = 3; loop < 7; loop++) {
- if (_G(actor[loop]).used)
+ if (_G(actor[loop])._active)
break;
}
@@ -465,9 +465,9 @@ void GameContent::checkForAreaChange() {
} else if (_G(new_level) != _G(current_level)) {
// Area transition beginning
- _G(thor)->show = 0;
- _G(thor)->used = 0;
- _G(hammer)->used = 0;
+ _G(thor)->_show = 0;
+ _G(thor)->_active = 0;
+ _G(hammer)->_active = 0;
_G(tornado_used) = false;
// Draws the old area without Thor, and then save a copy of it.
@@ -476,7 +476,7 @@ void GameContent::checkForAreaChange() {
_surface.copyFrom(getSurface());
// Set up new level
- _G(thor)->used = 1;
+ _G(thor)->_active = 1;
show_level(_G(new_level));
}
}
@@ -487,8 +487,8 @@ void GameContent::thorDies() {
// Stop any actors on-screen from moving
for (int li = 0; li < MAX_ACTORS; li++)
- _G(actor[li]).show = 0;
- _G(actor[2]).used = 0;
+ _G(actor[li])._show = 0;
+ _G(actor[2])._active = 0;
// Set the state for showing death animation
_G(gameMode) = MODE_THOR_DIES;
@@ -501,8 +501,8 @@ void GameContent::thorDies() {
void GameContent::spinThor() {
static const byte DIRS[] = {0, 2, 1, 3};
- _G(thor)->dir = DIRS[(_deathCtr / SPIN_INTERVAL) % 4];
- _G(thor)->last_dir = DIRS[(_deathCtr / SPIN_INTERVAL) % 4];
+ _G(thor)->_dir = DIRS[(_deathCtr / SPIN_INTERVAL) % 4];
+ _G(thor)->_lastDir = DIRS[(_deathCtr / SPIN_INTERVAL) % 4];
++_deathCtr;
}
@@ -512,19 +512,19 @@ void GameContent::thorDead() {
int ln = _G(thor_info).inventory;
_G(new_level) = _G(thor_info).last_screen;
- _G(thor)->x = (_G(thor_info).last_icon % 20) * 16;
- _G(thor)->y = ((_G(thor_info).last_icon / 20) * 16) - 1;
- if (_G(thor)->x < 1)
- _G(thor)->x = 1;
- if (_G(thor)->y < 0)
- _G(thor)->y = 0;
- _G(thor)->last_x[0] = _G(thor)->x;
- _G(thor)->last_x[1] = _G(thor)->x;
- _G(thor)->last_y[0] = _G(thor)->y;
- _G(thor)->last_y[1] = _G(thor)->y;
- _G(thor)->dir = _G(thor_info).last_dir;
- _G(thor)->last_dir = _G(thor_info).last_dir;
- _G(thor)->health = _G(thor_info).last_health;
+ _G(thor)->_x = (_G(thor_info).last_icon % 20) * 16;
+ _G(thor)->_y = ((_G(thor_info).last_icon / 20) * 16) - 1;
+ if (_G(thor)->_x < 1)
+ _G(thor)->_x = 1;
+ if (_G(thor)->_y < 0)
+ _G(thor)->_y = 0;
+ _G(thor)->_lastX[0] = _G(thor)->_x;
+ _G(thor)->_lastX[1] = _G(thor)->_x;
+ _G(thor)->_lastY[0] = _G(thor)->_y;
+ _G(thor)->_lastY[1] = _G(thor)->_y;
+ _G(thor)->_dir = _G(thor_info).last_dir;
+ _G(thor)->_lastDir = _G(thor_info).last_dir;
+ _G(thor)->_health = _G(thor_info).last_health;
_G(thor_info).magic = _G(thor_info).last_magic;
_G(thor_info).jewels = _G(thor_info).last_jewels;
_G(thor_info).keys = _G(thor_info).last_keys;
@@ -541,9 +541,9 @@ void GameContent::thorDead() {
_G(setup) = _G(last_setup);
- _G(thor)->num_moves = 1;
- _G(thor)->vunerable = 60;
- _G(thor)->show = 60;
+ _G(thor)->_numMoves = 1;
+ _G(thor)->_vulnerableCountdown = 60;
+ _G(thor)->_show = 60;
_G(hourglass_flag) = 0;
_G(apple_flag) = false;
_G(bomb_flag) = false;
@@ -552,10 +552,10 @@ void GameContent::thorDead() {
_G(tornado_used) = false;
_G(shield_on) = false;
music_resume();
- _G(actor[1]).used = 0;
- _G(actor[2]).used = 0;
- _G(thor)->speed_count = 6;
- _G(thor)->used = 1;
+ _G(actor[1])._active = 0;
+ _G(actor[2])._active = 0;
+ _G(thor)->_moveCountdown = 6;
+ _G(thor)->_active = 1;
// Load saved data for new level back into scrn
_G(scrn).load(_G(new_level));
@@ -569,7 +569,7 @@ void GameContent::thorDead() {
void GameContent::checkForCheats() {
if (_G(cheats).freezeHealth)
- _G(thor)->health = 150;
+ _G(thor)->_health = 150;
if (_G(cheats).freezeMagic)
_G(thor_info).magic = 150;
if (_G(cheats).freezeJewels)
@@ -647,15 +647,15 @@ void GameContent::throwLightning() {
_lightningCtr = 20;
for (int i = 0; i < MAX_ACTORS; i++)
- _G(actor[i]).show = 0;
+ _G(actor[i])._show = 0;
play_sound(ELECTRIC, 1);
}
void GameContent::drawLightning(GfxSurface &s) {
for (int i = 0; i < 8; i++) {
- _pixelX[i][0] = _G(thor)->x + 7;
- _pixelY[i][0] = _G(thor)->y + 7;
+ _pixelX[i][0] = _G(thor)->_x + 7;
+ _pixelY[i][0] = _G(thor)->_y + 7;
_pixelC[i] = 14 + g_events->getRandomNumber(1);
}
@@ -669,19 +669,19 @@ void GameContent::drawLightning(GfxSurface &s) {
void GameContent::lightningCountdownDone() {
_G(gameMode) = MODE_NORMAL;
- int x = _G(thor)->x + 7;
- int y = _G(thor)->y + 7;
+ int x = _G(thor)->_x + 7;
+ int y = _G(thor)->_y + 7;
for (int i = 3; i < MAX_ACTORS; i++) {
- if (!_G(actor[i]).used)
+ if (!_G(actor[i])._active)
continue;
- int ax = _G(actor[i]).x + (_G(actor[i]).size_x / 2);
- int ay = _G(actor[i]).y + (_G(actor[i]).size_y / 2);
+ int ax = _G(actor[i])._x + (_G(actor[i])._sizeX / 2);
+ int ay = _G(actor[i])._y + (_G(actor[i])._sizeY / 2);
if ((ABS(ax - x) < 30) && (ABS(ay - y) < 30)) {
- _G(actor[i]).magic_hit = 1;
- _G(actor[i]).vunerable = 0;
+ _G(actor[i])._magicHit = 1;
+ _G(actor[i])._vulnerableCountdown = 0;
actor_damaged(&_G(actor[i]), 254);
}
}
diff --git a/engines/got/views/game_status.cpp b/engines/got/views/game_status.cpp
index e889412f0fb..d6a4cffbf62 100644
--- a/engines/got/views/game_status.cpp
+++ b/engines/got/views/game_status.cpp
@@ -46,7 +46,7 @@ void GameStatus::draw() {
}
void GameStatus::displayHealth(GfxSurface &s) {
- int b = 59 + _G(thor)->health;
+ int b = 59 + _G(thor)->_health;
s.fillRect(Common::Rect(59, 8, b, 12), 32);
s.fillRect(Common::Rect(b, 8, 209, 12), STAT_COLOR);
More information about the Scummvm-git-logs
mailing list