aboutsummaryrefslogtreecommitdiff
path: root/engines/lure/hotspots.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2007-09-19 13:55:05 +0000
committerEugene Sandulenko2007-09-19 13:55:05 +0000
commit77eea722afe175003baba3ed5341bfbf8cf988f6 (patch)
treeff95cd001b8929308468d69466623f0c28be476b /engines/lure/hotspots.cpp
parent2254028365cf5f162bd41cf0011b4475ec608f4c (diff)
downloadscummvm-rg350-77eea722afe175003baba3ed5341bfbf8cf988f6.tar.gz
scummvm-rg350-77eea722afe175003baba3ed5341bfbf8cf988f6.tar.bz2
scummvm-rg350-77eea722afe175003baba3ed5341bfbf8cf988f6.zip
Modified patch #1738058: "Action recorder".
svn-id: r28968
Diffstat (limited to 'engines/lure/hotspots.cpp')
-rw-r--r--engines/lure/hotspots.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp
index 93860bbd3e..f3235dd3d9 100644
--- a/engines/lure/hotspots.cpp
+++ b/engines/lure/hotspots.cpp
@@ -588,6 +588,8 @@ void Hotspot::setRandomDest() {
Common::RandomSource rnd;
int16 xp, yp;
+ g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots");
+
if (_currentActions.isEmpty())
_currentActions.addFront(START_WALKING, roomNumber());
else
@@ -2925,6 +2927,8 @@ void HotspotTickHandlers::followerAnimHandler(Hotspot &h) {
Common::RandomSource rnd;
RandomActionType actionType;
uint16 scheduleId;
+ g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots");
+
int actionIndex = rnd.getRandomNumber(set->numActions() - 1);
set->getEntry(actionIndex, actionType, scheduleId);
@@ -3113,6 +3117,8 @@ void HotspotTickHandlers::prisonerAnimHandler(Hotspot &h) {
ValueTableData &fields = Resources::getReference().fieldList();
Common::RandomSource rnd;
+ g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots");
+
h.handleTalkDialog();
if (h.frameCtr() > 0) {
h.setFrameCtr(h.frameCtr() - 1);
@@ -3153,6 +3159,8 @@ void HotspotTickHandlers::morkusAnimHandler(Hotspot &h) {
if (h.executeScript()) {
// Script is done - set new script to one of two alternates randomly
Common::RandomSource rnd;
+ g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots");
+
h.setHotspotScript(rnd.getRandomNumber(100) >= 50 ? 0x54 : 0);
h.setFrameCtr(20 + rnd.getRandomNumber(63));
}
@@ -3417,6 +3425,8 @@ void HotspotTickHandlers::barmanAnimHandler(Hotspot &h) {
Common::RandomSource rnd;
static bool ewanXOffset = false;
+ g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots");
+
h.handleTalkDialog();
if (h.delayCtr() > 0) {
h.setDelayCtr(h.delayCtr() - 1);