diff options
-rw-r--r-- | engines/lastexpress/entities/milos.cpp | 2 | ||||
-rw-r--r-- | engines/lastexpress/entities/vesna.cpp | 80 | ||||
-rw-r--r-- | engines/lastexpress/entities/vesna.h | 37 |
3 files changed, 53 insertions, 66 deletions
diff --git a/engines/lastexpress/entities/milos.cpp b/engines/lastexpress/entities/milos.cpp index 90a397c7cb..65cad07b1b 100644 --- a/engines/lastexpress/entities/milos.cpp +++ b/engines/lastexpress/entities/milos.cpp @@ -1352,7 +1352,7 @@ IMPLEMENT_FUNCTION(25, Milos, function25) break; } - RESET_ENTITY_STATE(kEntityVesna, Vesna, setup_chapter3Handler); + RESET_ENTITY_STATE(kEntityVesna, Vesna, setup_inCompartment); getData()->location = kLocationInsideCompartment; diff --git a/engines/lastexpress/entities/vesna.cpp b/engines/lastexpress/entities/vesna.cpp index 6e9fb4f204..8ab3902b16 100644 --- a/engines/lastexpress/entities/vesna.cpp +++ b/engines/lastexpress/entities/vesna.cpp @@ -47,26 +47,26 @@ Vesna::Vesna(LastExpressEngine *engine) : Entity(engine, kEntityVesna) { ADD_CALLBACK_FUNCTION(Vesna, callbackActionRestaurantOrSalon); ADD_CALLBACK_FUNCTION(Vesna, callbackActionOnDirection); ADD_CALLBACK_FUNCTION(Vesna, savegame); - ADD_CALLBACK_FUNCTION(Vesna, function11); + ADD_CALLBACK_FUNCTION(Vesna, homeAlone); ADD_CALLBACK_FUNCTION(Vesna, chapter1); - ADD_CALLBACK_FUNCTION(Vesna, chapter1Handler); - ADD_CALLBACK_FUNCTION(Vesna, function14); + ADD_CALLBACK_FUNCTION(Vesna, withMilos); + ADD_CALLBACK_FUNCTION(Vesna, homeTogether); ADD_CALLBACK_FUNCTION(Vesna, function15); ADD_CALLBACK_FUNCTION(Vesna, chapter2); ADD_CALLBACK_FUNCTION(Vesna, chapter2Handler); - ADD_CALLBACK_FUNCTION(Vesna, function18); + ADD_CALLBACK_FUNCTION(Vesna, checkTrain); ADD_CALLBACK_FUNCTION(Vesna, chapter3); - ADD_CALLBACK_FUNCTION(Vesna, chapter3Handler); - ADD_CALLBACK_FUNCTION(Vesna, function21); - ADD_CALLBACK_FUNCTION(Vesna, function22); - ADD_CALLBACK_FUNCTION(Vesna, function23); + ADD_CALLBACK_FUNCTION(Vesna, inCompartment); + ADD_CALLBACK_FUNCTION(Vesna, takeAWalk); + ADD_CALLBACK_FUNCTION(Vesna, killAnna); + ADD_CALLBACK_FUNCTION(Vesna, killedAnna); ADD_CALLBACK_FUNCTION(Vesna, chapter4); - ADD_CALLBACK_FUNCTION(Vesna, function25); - ADD_CALLBACK_FUNCTION(Vesna, function26); + ADD_CALLBACK_FUNCTION(Vesna, exitLocation); + ADD_CALLBACK_FUNCTION(Vesna, done); ADD_CALLBACK_FUNCTION(Vesna, function27); ADD_CALLBACK_FUNCTION(Vesna, chapter5); - ADD_CALLBACK_FUNCTION(Vesna, chapter5Handler); - ADD_CALLBACK_FUNCTION(Vesna, function30); + ADD_CALLBACK_FUNCTION(Vesna, guarding); + ADD_CALLBACK_FUNCTION(Vesna, climbing); ADD_NULL_FUNCTION(); } @@ -152,7 +152,7 @@ IMPLEMENT_FUNCTION_II(10, Vesna, savegame, SavegameType, uint32) IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// -IMPLEMENT_FUNCTION(11, Vesna, function11) +IMPLEMENT_FUNCTION(11, Vesna, homeAlone) // Expose parameters as IIIS and ignore the default exposed parameters EntityData::EntityParametersIIIS *parameters = (EntityData::EntityParametersIIIS*)_data->getCurrentParameters(); @@ -255,7 +255,7 @@ IMPLEMENT_FUNCTION(12, Vesna, chapter1) break; case kActionNone: - Entity::timeCheck(kTimeChapter1, params->param1, WRAP_SETUP_FUNCTION(Vesna, setup_chapter1Handler)); + Entity::timeCheck(kTimeChapter1, params->param1, WRAP_SETUP_FUNCTION(Vesna, setup_withMilos)); break; case kActionDefault: @@ -269,7 +269,7 @@ IMPLEMENT_FUNCTION(12, Vesna, chapter1) IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// -IMPLEMENT_FUNCTION(13, Vesna, chapter1Handler) +IMPLEMENT_FUNCTION(13, Vesna, withMilos) switch (savepoint.action) { default: break; @@ -282,7 +282,7 @@ IMPLEMENT_FUNCTION(13, Vesna, chapter1Handler) case kActionCallback: if (getCallback() == 1) { getEntities()->clearSequences(kEntityVesna); - setup_function14(); + setup_homeTogether(); } break; @@ -294,7 +294,7 @@ IMPLEMENT_FUNCTION(13, Vesna, chapter1Handler) IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// -IMPLEMENT_FUNCTION(14, Vesna, function14) +IMPLEMENT_FUNCTION(14, Vesna, homeTogether) switch (savepoint.action) { default: break; @@ -307,7 +307,7 @@ IMPLEMENT_FUNCTION(14, Vesna, function14) case kAction190412928: setCallback(1); - setup_function11(); + setup_homeAlone(); break; } IMPLEMENT_FUNCTION_END @@ -355,18 +355,18 @@ IMPLEMENT_FUNCTION(17, Vesna, chapter2Handler) case kAction135024800: setCallback(2); - setup_function18(); + setup_checkTrain(); break; case kAction137165825: setCallback(1); - setup_function11(); + setup_homeAlone(); break; } IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// -IMPLEMENT_FUNCTION(18, Vesna, function18) +IMPLEMENT_FUNCTION(18, Vesna, checkTrain) switch (savepoint.action) { default: break; @@ -470,7 +470,7 @@ IMPLEMENT_FUNCTION(19, Vesna, chapter3) break; case kActionNone: - setup_chapter3Handler(); + setup_inCompartment(); break; case kActionDefault: @@ -486,7 +486,7 @@ IMPLEMENT_FUNCTION(19, Vesna, chapter3) IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// -IMPLEMENT_FUNCTION(20, Vesna, chapter3Handler) +IMPLEMENT_FUNCTION(20, Vesna, inCompartment) EntityData::EntityParametersIIIS *parameters = (EntityData::EntityParametersIIIS*)_data->getCurrentParameters(); switch (savepoint.action) { @@ -497,7 +497,7 @@ IMPLEMENT_FUNCTION(20, Vesna, chapter3Handler) if (getProgress().field_54 && parameters->param7 != kTimeInvalid) { if (getState()->time > kTime2250000) { parameters->param7 = kTimeInvalid; - setup_function22(); + setup_killAnna(); break; } @@ -506,7 +506,7 @@ IMPLEMENT_FUNCTION(20, Vesna, chapter3Handler) if (parameters->param7 < getState()->time) { parameters->param7 = kTimeInvalid; - setup_function22(); + setup_killAnna(); break; } } @@ -603,12 +603,12 @@ IMPLEMENT_FUNCTION(20, Vesna, chapter3Handler) case kAction137165825: setCallback(5); - setup_function11(); + setup_homeAlone(); break; case kAction155913424: setCallback(6); - setup_function21(); + setup_takeAWalk(); break; case kAction203663744: @@ -618,7 +618,7 @@ IMPLEMENT_FUNCTION(20, Vesna, chapter3Handler) IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// -IMPLEMENT_FUNCTION(21, Vesna, function21) +IMPLEMENT_FUNCTION(21, Vesna, takeAWalk) switch (savepoint.action) { default: break; @@ -718,7 +718,7 @@ IMPLEMENT_FUNCTION(21, Vesna, function21) IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// -IMPLEMENT_FUNCTION(22, Vesna, function22) +IMPLEMENT_FUNCTION(22, Vesna, killAnna) switch (savepoint.action) { default: break; @@ -805,7 +805,7 @@ IMPLEMENT_FUNCTION(22, Vesna, function22) getData()->location = kLocationInsideCompartment; getEntities()->clearSequences(kEntityVesna); - setup_function23(); + setup_killedAnna(); break; } break; @@ -818,7 +818,7 @@ IMPLEMENT_FUNCTION(22, Vesna, function22) IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// -IMPLEMENT_FUNCTION(23, Vesna, function23) +IMPLEMENT_FUNCTION(23, Vesna, killedAnna) switch (savepoint.action) { default: break; @@ -869,7 +869,7 @@ IMPLEMENT_FUNCTION(24, Vesna, chapter4) case kActionNone: setCallback(1); - setup_function11(); + setup_homeAlone(); break; case kActionDefault: @@ -885,12 +885,12 @@ IMPLEMENT_FUNCTION(24, Vesna, chapter4) case kActionCallback: if (getCallback() == 1) - setup_function25(); + setup_exitLocation(); } IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// -IMPLEMENT_FUNCTION(25, Vesna, function25) +IMPLEMENT_FUNCTION(25, Vesna, exitLocation) switch (savepoint.action) { default: break; @@ -898,7 +898,7 @@ IMPLEMENT_FUNCTION(25, Vesna, function25) case kActionNone: if (getState()->time > kTime2428200 && !params->param1) { params->param1 = 1; - setup_function26(); + setup_done(); } break; @@ -958,7 +958,7 @@ IMPLEMENT_FUNCTION(25, Vesna, function25) IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// -IMPLEMENT_FUNCTION(26, Vesna, function26) +IMPLEMENT_FUNCTION(26, Vesna, done) switch (savepoint.action) { default: break; @@ -1030,7 +1030,7 @@ IMPLEMENT_FUNCTION(28, Vesna, chapter5) break; case kActionNone: - setup_chapter5Handler(); + setup_guarding(); break; case kActionDefault: @@ -1044,7 +1044,7 @@ IMPLEMENT_FUNCTION(28, Vesna, chapter5) IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// -IMPLEMENT_FUNCTION(29, Vesna, chapter5Handler) +IMPLEMENT_FUNCTION(29, Vesna, guarding) switch (savepoint.action) { default: break; @@ -1069,13 +1069,13 @@ IMPLEMENT_FUNCTION(29, Vesna, chapter5Handler) case kAction134427424: getObjects()->update(kObject64, kEntityPlayer, kObjectLocationNone, kCursorNormal, kCursorForward); - setup_function30(); + setup_climbing(); break; } IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// -IMPLEMENT_FUNCTION(30, Vesna, function30) +IMPLEMENT_FUNCTION(30, Vesna, climbing) switch (savepoint.action) { default: break; diff --git a/engines/lastexpress/entities/vesna.h b/engines/lastexpress/entities/vesna.h index 8d255500be..f47943c979 100644 --- a/engines/lastexpress/entities/vesna.h +++ b/engines/lastexpress/entities/vesna.h @@ -54,7 +54,6 @@ public: */ DECLARE_FUNCTION_2(enterExitCompartment, const char *sequence, ObjectIndex compartment) - /** * Draws the entity * @@ -103,19 +102,15 @@ public: */ DECLARE_FUNCTION_2(savegame, SavegameType savegameType, uint32 param) - DECLARE_FUNCTION(function11) + DECLARE_FUNCTION(homeAlone) /** * Setup Chapter 1 */ DECLARE_FUNCTION(chapter1) - /** - * Handle Chapter 1 events - */ - DECLARE_FUNCTION(chapter1Handler) - - DECLARE_FUNCTION(function14) + DECLARE_FUNCTION(withMilos) + DECLARE_FUNCTION(homeTogether) DECLARE_FUNCTION(function15) /** @@ -128,29 +123,25 @@ public: */ DECLARE_FUNCTION(chapter2Handler) - DECLARE_FUNCTION(function18) + DECLARE_FUNCTION(checkTrain) /** * Setup Chapter 3 */ DECLARE_FUNCTION(chapter3) - /** - * Handle Chapter 3 events - */ - DECLARE_FUNCTION(chapter3Handler) - - DECLARE_FUNCTION(function21) - DECLARE_FUNCTION(function22) - DECLARE_FUNCTION(function23) + DECLARE_FUNCTION(inCompartment) + DECLARE_FUNCTION(takeAWalk) + DECLARE_FUNCTION(killAnna) + DECLARE_FUNCTION(killedAnna) /** * Setup Chapter 4 */ DECLARE_FUNCTION(chapter4) - DECLARE_FUNCTION(function25) - DECLARE_FUNCTION(function26) + DECLARE_FUNCTION(exitLocation) + DECLARE_FUNCTION(done) DECLARE_FUNCTION(function27) /** @@ -158,12 +149,8 @@ public: */ DECLARE_FUNCTION(chapter5) - /** - * Handle Chapter 5 events - */ - DECLARE_FUNCTION(chapter5Handler) - - DECLARE_FUNCTION(function30) + DECLARE_FUNCTION(guarding) + DECLARE_FUNCTION(climbing) DECLARE_NULL_FUNCTION() }; |