aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2015-01-20 08:46:27 -0500
committerPaul Gilbert2015-01-20 08:46:27 -0500
commit8b4d25d415bff87cfcc00fdf827139dda2fa4014 (patch)
treed0af12c3719452403942fe4890d8536d05f1f85f /engines
parent2427f203ee9b98d639ecb0bde6aad17c35875a43 (diff)
downloadscummvm-rg350-8b4d25d415bff87cfcc00fdf827139dda2fa4014.tar.gz
scummvm-rg350-8b4d25d415bff87cfcc00fdf827139dda2fa4014.tar.bz2
scummvm-rg350-8b4d25d415bff87cfcc00fdf827139dda2fa4014.zip
XEEN: Implemented doStepCode
Diffstat (limited to 'engines')
-rw-r--r--engines/xeen/combat.h18
-rw-r--r--engines/xeen/interface.cpp71
-rw-r--r--engines/xeen/interface.h2
-rw-r--r--engines/xeen/map.cpp6
-rw-r--r--engines/xeen/map.h21
-rw-r--r--engines/xeen/party.cpp2
-rw-r--r--engines/xeen/party.h3
-rw-r--r--engines/xeen/scripts.cpp1
-rw-r--r--engines/xeen/scripts.h1
-rw-r--r--engines/xeen/xeen.cpp1
-rw-r--r--engines/xeen/xeen.h1
11 files changed, 103 insertions, 24 deletions
diff --git a/engines/xeen/combat.h b/engines/xeen/combat.h
index c64741b59e..8e54353212 100644
--- a/engines/xeen/combat.h
+++ b/engines/xeen/combat.h
@@ -27,6 +27,24 @@
namespace Xeen {
+enum DamageType {
+ DT_PHYSICAL = 0, DT_1 = 1, DT_FIRE = 2, DT_ELECTRICAL = 3,
+ DT_COLD = 4, DT_POISON = 5, DT_ENERGY = 6, DT_SLEEP = 7,
+ DT_FINGEROFDEATH = 8, DT_HOLYWORD = 9, DT_MASS_DISTORTION = 10,
+ DT_UNDED = 11, DT_BEASTMASTER = 12, DT_DRAGONSLEEP = 13,
+ DT_GOLEMSTOPPER = 14, DT_HYPNOTIZE = 15, DT_INSECT_SPRAY = 16,
+ DT_POISON_VALLEY = 17, DT_MAGIC_ARROW = 18
+};
+
+enum SpecialAttack {
+ SA_NONE = 0, SA_MAGIC = 1, SA_FIRE = 2, SA_ELEC = 3, SA_COLD = 4,
+ SA_POISON = 5, SA_ENERGY = 6, SA_DISEASE = 7, SA_INSANE = 8,
+ SA_SLEEP = 9, SA_CURSEITEM = 10, SA_INLOVE = 11, SA_DRAINSP = 12,
+ SA_CURSE = 13, SA_PARALYZE = 14, SA_UNCONSCIOUS = 15,
+ SA_CONFUSE = 16, SA_BREAKWEAPON = 17, SA_WEAKEN = 18,
+ SA_ERADICATE = 19, SA_AGING = 20, SA_DEATH = 21, SA_STONE = 22
+};
+
class XeenEngine;
class Combat {
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index e117813756..cd96f05ab9 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -541,6 +541,7 @@ void Interface::draw3d(bool updateFlag) {
Combat &combat = *_vm->_combat;
EventsManager &events = *_vm->_events;
Map &map = *_vm->_map;
+ Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
if (screen._windows[11]._enabled)
@@ -724,11 +725,11 @@ void Interface::draw3d(bool updateFlag) {
animate3d();
drawMiniMap();
- if (_vm->_falling == 1) {
+ if (party._falling == 1) {
error("TODO: Indoor falling");
}
- if (_vm->_falling == 2) {
+ if (party._falling == 2) {
screen.saveBackground(1);
}
@@ -2940,6 +2941,72 @@ void Interface::stepTime() {
}
void Interface::doStepCode() {
+ Map &map = *_vm->_map;
+ Party &party = *_vm->_party;
+ int damage = 0;
+
+ party._stepped = true;
+ _upDoorText = false;
+
+ map.getCell(2);
+ int surfaceId = map.mazeData()._surfaceTypes[map._currentSurfaceId];
+
+ switch (surfaceId) {
+ case SURFTYPE_SPACE:
+ // Wheeze.. can't breathe in space! Explosive decompression, here we come
+ party._partyDead = true;
+ break;
+ case SURFTYPE_LAVA:
+ // It burns, it burns!
+ damage = 100;
+ party._damageType = DT_FIRE;
+ break;
+ case SURFTYPE_SKY:
+ // We can fly, we can.. oh wait, we can't!
+ damage = 100;
+ party._damageType = DT_PHYSICAL;
+ party._falling = true;
+ break;
+ case SURFTYPE_DESERT:
+ // Without navigation skills, simulate getting lost by adding extra time
+ if (map._isOutdoors && !party.checkSkill(NAVIGATOR))
+ party.addTime(170);
+ break;
+ case SURFTYPE_CLOUD:
+ if (!party._levitateActive) {
+ party._damageType = DT_PHYSICAL;
+ party._falling = true;
+ damage = 100;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (_vm->_files->_isDarkCc && party._gameFlags[374]) {
+ party._falling = false;
+ } else {
+ if (party._falling)
+ doFalling();
+
+ if ((party._mazePosition.x & 16) || (party._mazePosition.y & 16)) {
+ map.getNewMaze();
+ }
+
+ if (damage) {
+ _flipGround = !_flipGround;
+ draw3d(true);
+
+ warning("TODO: apply damage");
+
+ _flipGround = !_flipGround;
+ } else if (party._partyDead) {
+ draw3d(true);
+ }
+ }
+}
+
+void Interface::doFalling() {
// TODO
}
diff --git a/engines/xeen/interface.h b/engines/xeen/interface.h
index 9634788df3..4cd40b9d4f 100644
--- a/engines/xeen/interface.h
+++ b/engines/xeen/interface.h
@@ -129,6 +129,8 @@ public:
void charIconsPrint(bool updateFlag);
+ void doFalling();
+
void perform();
};
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index 655412543b..7e1f8546ea 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -877,7 +877,7 @@ void Map::load(int mapId) {
IndoorDrawList &indoorList = _vm->_interface->_indoorList;
OutdoorDrawList &outdoorList = _vm->_interface->_outdoorList;
- if (_vm->_falling) {
+ if (_vm->_party->_falling) {
Window &w = screen._windows[9];
w.open();
w.writeString(OOPS);
@@ -1500,4 +1500,8 @@ void Map::loadSky() {
? "sky.sky" : "night.sky");
}
+void Map::getNewMaze() {
+ // TODO
+}
+
} // End of namespace Xeen
diff --git a/engines/xeen/map.h b/engines/xeen/map.h
index 80c46dd607..32418257f4 100644
--- a/engines/xeen/map.h
+++ b/engines/xeen/map.h
@@ -26,6 +26,7 @@
#include "common/stream.h"
#include "common/array.h"
#include "common/rect.h"
+#include "xeen/combat.h"
#include "xeen/party.h"
#include "xeen/scripts.h"
#include "xeen/sprites.h"
@@ -39,24 +40,6 @@ namespace Xeen {
class XeenEngine;
-enum DamageType {
- DT_PHYSICAL = 0, DT_1 = 1, DT_FIRE = 2, DT_ELECTRICAL = 3,
- DT_COLD = 4, DT_POISON = 5, DT_ENERGY = 6, DT_SLEEP = 7,
- DT_FINGEROFDEATH = 8, DT_HOLYWORD = 9, DT_MASS_DISTORTION = 10,
- DT_UNDED = 11, DT_BEASTMASTER = 12, DT_DRAGONSLEEP = 13,
- DT_GOLEMSTOPPER = 14, DT_HYPNOTIZE = 15, DT_INSECT_SPRAY = 16,
- DT_POISON_VALLEY = 17, DT_MAGIC_ARROW = 18
-};
-
-enum SpecialAttack {
- SA_NONE = 0, SA_MAGIC = 1, SA_FIRE = 2, SA_ELEC = 3, SA_COLD = 4,
- SA_POISON = 5, SA_ENERGY = 6, SA_DISEASE = 7, SA_INSANE = 8,
- SA_SLEEP = 9, SA_CURSEITEM = 10, SA_INLOVE = 11, SA_DRAINSP = 12,
- SA_CURSE = 13, SA_PARALYZE = 14, SA_UNCONSCIOUS = 15,
- SA_CONFUSE = 16, SA_BREAKWEAPON = 17, SA_WEAKEN = 18,
- SA_ERADICATE = 19, SA_AGING = 20, SA_DEATH = 21, SA_STONE = 22
-};
-
enum MonsterType {
MONSTER_0 = 0, MONSTER_ANIMAL = 1, MONSTER_INSECT = 2,
MONSTER_HUMANOID = 3, MONSTER_UNDEAD = 4, MONSTER_GOLEM = 5,
@@ -407,6 +390,8 @@ public:
MazeData mazeDataCurrent() { return _mazeData[_mazeDataIndex]; }
void loadSky();
+
+ void getNewMaze();
};
} // End of namespace Xeen
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp
index 3736869eb4..d465cc9975 100644
--- a/engines/xeen/party.cpp
+++ b/engines/xeen/party.cpp
@@ -232,6 +232,8 @@ Party::Party(XeenEngine *vm): _vm(vm) {
_newDay = false;
_isNight = false;
_stepped = false;
+ _damageType = DT_PHYSICAL;
+ _falling = false;
}
void Party::synchronize(Common::Serializer &s) {
diff --git a/engines/xeen/party.h b/engines/xeen/party.h
index e2180e535d..c598e8c3f9 100644
--- a/engines/xeen/party.h
+++ b/engines/xeen/party.h
@@ -27,6 +27,7 @@
#include "common/array.h"
#include "common/rect.h"
#include "common/serializer.h"
+#include "xeen/combat.h"
#include "xeen/items.h"
namespace Xeen {
@@ -213,6 +214,8 @@ public:
bool _newDay;
bool _isNight;
bool _stepped;
+ int _falling;
+ DamageType _damageType;
public:
Party(XeenEngine *vm);
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 5a36a32a7e..55388ec343 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -21,6 +21,7 @@
*/
#include "xeen/scripts.h"
+#include "xeen/party.h"
namespace Xeen {
diff --git a/engines/xeen/scripts.h b/engines/xeen/scripts.h
index 4f49018e2b..9974892221 100644
--- a/engines/xeen/scripts.h
+++ b/engines/xeen/scripts.h
@@ -27,7 +27,6 @@
#include "common/system.h"
#include "common/serializer.h"
#include "xeen/files.h"
-#include "xeen/party.h"
namespace Xeen {
diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp
index e9b4d93de8..38026d0117 100644
--- a/engines/xeen/xeen.cpp
+++ b/engines/xeen/xeen.cpp
@@ -53,7 +53,6 @@ XeenEngine::XeenEngine(OSystem *syst, const XeenGameDescription *gameDesc)
_face1State = 0;
_face2State = 0;
_noDirectionSense = false;
- _falling = 0;
_moveMonsters = false;
_mode = MODE_0;
_openDoor = 0;
diff --git a/engines/xeen/xeen.h b/engines/xeen/xeen.h
index 59816b0d91..3e8637476a 100644
--- a/engines/xeen/xeen.h
+++ b/engines/xeen/xeen.h
@@ -148,7 +148,6 @@ public:
int _face1State;
int _face2State;
bool _noDirectionSense;
- int _falling;
bool _moveMonsters;
int _openDoor;
public: