ScummVM
action.cpp File Reference

Go to the source code of this file.

Classes

class  LastExpress::Functor1MemConst< Arg, Res, T >
 

Namespaces

 LastExpress
 This is the namespace of the LastExpress engine.
 

Functions

 IMPLEMENT_ACTION (inventory) if(!getState() -> sceneUseBackup) return kSceneInvalid
 
 if (getState() ->sceneBackup2)
 
 if (getEntities() ->getPosition(backup->car, backup->position)) index
 
 getScenes () -> loadScene(index)
 
 if (!getInventory() ->getSelectedItem()) return kSceneInvalid
 
 if (!getInventory() ->getSelectedEntry() ->isSelectable||(!getState() ->sceneBackup2 &&getInventory() ->getFirstExaminableItem())) getInventory() -> selectItem(getInventory() ->getFirstExaminableItem())
 
 IMPLEMENT_ACTION (savePoint) getSavePoints() -> push(kEntityPlayer,(EntityIndex) hotspot.param1,(ActionIndex) hotspot.param2)
 
 IMPLEMENT_ACTION (playSound) if(hotspot.param2||!getSoundQueue() -> isBuffered(Common::String::format("LIB%03d", hotspot.param1), true)) getSound() ->playSoundEvent(kEntityPlayer, hotspot.param1, hotspot.param2)
 
IMPLEMENT_ACTION(playMusic) Common if (!getSoundQueue() ->isBuffered(filename) &&(hotspot.param1 !=50||getProgress().chapter==kChapter5)) getSound() -> playSound(kEntityPlayer, filename, kVolumeFull, hotspot.param2)
 
 IMPLEMENT_ACTION (knock) ObjectIndex object
 
 if (object >=kObjectMax) return kSceneInvalid
 
 if (getObjects() ->get(object).entity)
 
 IMPLEMENT_ACTION (compartment) ObjectIndex compartment
 
 if (compartment >=kObjectMax) return kSceneInvalid
 
 if (getObjects() ->get(compartment).entity)
 
 if (handleOtherCompartment(compartment, true, true))
 
 if (location==kObjectLocation1||location==kObjectLocation3||getEntities() ->checkFields2(compartment))
 
 if (hotspot.action !=SceneHotspot::kActionEnterCompartment||getInventory() ->getSelectedItem() !=kItemKey)
 
 getObjects () -> update(kObjectCompartment1, kEntityPlayer, kObjectLocation1, kCursorHandKnock, kCursorHand)
 
 getSound () -> playSoundEvent(kEntityPlayer, 16)
 
 getInventory () -> unselectItem()
 
 IMPLEMENT_ACTION (playSounds) getSound() -> playSoundEvent(kEntityPlayer, hotspot.param1)
 
 IMPLEMENT_ACTION (playAnimation) if(getEvent(hotspot.param1)) return kSceneInvalid
 
 playAnimation ((EventIndex) hotspot.param1)
 
 if (!hotspot.scene) getScenes() -> processScene()
 
 IMPLEMENT_ACTION (openCloseObject) ObjectIndex object
 
 switch (location)
 
 IMPLEMENT_ACTION (setModel) ObjectIndex object
 
 if (object !=kObject112||getSoundQueue() ->isBuffered("LIB096"))
 
 IMPLEMENT_ACTION (setItem) InventoryItem item
 
 if (item >=kPortraitOriginal) return kSceneInvalid
 
 if (entry->inPocket) return kSceneInvalid
 
 if (item==kItemCorpse)
 
 IMPLEMENT_ACTION (knockInside) ObjectIndex object
 
 IMPLEMENT_ACTION (pickItem) InventoryItem item
 
 if (!entry->location) return kSceneInvalid
 
 switch (item)
 
 if (getInventory() ->get(item) ->scene)
 
 IMPLEMENT_ACTION (dropItem) InventoryItem item
 
 if (!getInventory() ->hasItem(item)) return kSceneInvalid
 
 if (location< kObjectLocation1) return kSceneInvalid
 
 IMPLEMENT_ACTION (enterCompartment) if(getObjects() -> get(kObjectCompartment1).status==kObjectLocation1||getObjects() ->get(kObjectCompartment1).status==kObjectLocation3||getInventory() ->getSelectedItem()==kItemKey) return action_compartment(hotspot)
 
 if (getProgress().eventCorpseFound)
 
 getSaveLoad () -> saveGame(kSavegameTypeTime, kEntityPlayer, kTimeNone)
 
 playAnimation (kEventCathFindCorpse)
 
 getProgress ().eventCorpseFound
 
 IMPLEMENT_ACTION (leanOutWindow) ObjectIndex object
 
 if ((getEvent(kEventCathLookOutsideWindowDay)||getEvent(kEventCathLookOutsideWindowNight)||getObjects() ->get(kObjectCompartment1).model==kObjectModel1) &&getProgress().isTrainRunning &&(object !=kObjectOutsideAnnaCompartment||(!getEntities() ->isInsideCompartment(kEntityRebecca, kCarRedSleeping, kPosition_4840) &&getObjects() ->get(kObjectOutsideBetweenCompartments).status==kObjectLocation2)) &&getInventory() ->getSelectedItem() !=kItemFirebird &&getInventory() ->getSelectedItem() !=kItemBriefcase)
 
 IMPLEMENT_ACTION (almostFall) switch((ObjectIndex) hotspot.param1)
 
 IMPLEMENT_ACTION (climbInWindow) switch((ObjectIndex) hotspot.param1)
 
 IMPLEMENT_ACTION (climbLadder) byte action
 
 if (action !=1 &&action !=2) return kSceneInvalid
 
 switch (getProgress().chapter)
 
 IMPLEMENT_ACTION (climbDownTrain) EventIndex evt
 
 playAnimation (evt)
 
 if (evt==kEventCathClimbDownTrainNoJacketDay) getSound() -> playSoundEvent(kEntityPlayer, 37)
 
 IMPLEMENT_ACTION (kronosSanctum) switch(hotspot.param1)
 
 IMPLEMENT_ACTION (escapeBaggage) byte action
 
 switch (action)
 
 IMPLEMENT_ACTION (enterBaggage) switch(hotspot.param1)
 
 IMPLEMENT_ACTION (bombPuzzle) switch(hotspot.param1)
 
 IMPLEMENT_ACTION (27) if(!getSoundQueue() -> isBuffered("LIB031", true)) getSound() ->playSoundEvent(kEntityPlayer, 31)
 
 switch (getEntityData(kEntityPlayer) ->car)
 
 IMPLEMENT_ACTION (kronosConcert) switch(hotspot.param1)
 
 IMPLEMENT_ACTION (29) getProgress().field_C
 
 if (!getSoundQueue() ->isBuffered(filename)) getSound() -> playSound(kEntityPlayer, filename, kVolumeFull)
 
 IMPLEMENT_ACTION (catchBeetle) if(!getBeetle() -> isLoaded()) return kSceneInvalid
 
 if (getBeetle() ->catchBeetle())
 
 IMPLEMENT_ACTION (exitCompartment) if(!getProgress().field_30 &&getProgress().jacket !
 
return action_enterCompartment (hotspot)
 
 IMPLEMENT_ACTION (outsideTrain) switch(hotspot.param1)
 
 IMPLEMENT_ACTION (firebirdPuzzle) EventIndex evt
 
 switch (hotspot.param1)
 
 if (evt !=kEventNone)
 
 IMPLEMENT_ACTION (openMatchBox) if(!getInventory() -> get(kItemMatch) ->location||getInventory() ->get(kItemMatch) ->inPocket) return kSceneInvalid
 
 IMPLEMENT_ACTION (openBed) getSound() -> playSoundEvent(kEntityPlayer, 59)
 
 IMPLEMENT_ACTION (dialog) getSound() -> playDialog(kEntityTables4,(EntityIndex) hotspot.param1, kVolumeFull, 0)
 
 IMPLEMENT_ACTION (eggBox) getSound() -> playSoundEvent(kEntityPlayer, 43)
 
 if (getProgress().field_7C &&!getSoundQueue() ->isBuffered("MUS003"))
 
 IMPLEMENT_ACTION (39) getSound() -> playSoundEvent(kEntityPlayer, 24)
 
 if (getProgress().field_80 &&!getSoundQueue() ->isBuffered("MUS003"))
 
 IMPLEMENT_ACTION (bed) getSound() -> playSoundEvent(kEntityPlayer, 85)
 
return action_knockInside (hotspot)
 
 IMPLEMENT_ACTION (playMusicChapter) byte id=0
 
 if (id)
 
 IMPLEMENT_ACTION (playMusicChapterSetupTrain) int id=0
 
 if (!getSoundQueue() ->isBuffered(filename) &&hotspot.param3 &id)
 
 IMPLEMENT_ACTION (switchChapter) return kSceneInvalid
 
 IMPLEMENT_ACTION (44) switch(hotspot.param1)
 

Variables

static const int LastExpress::_animationListSize = 273
 
struct {
   const char *   LastExpress::filename
 
   uint16   LastExpress::time
 
LastExpress::_animationList [_animationListSize]
 
SceneIndex index = kSceneNone
 
 else
 
Scene * backup = getScenes()->get(getState()->sceneBackup)
 
return kSceneInvalid
 
ObjectLocation location = getObjects()->get(compartment).status
 
return kSceneNone
 
bool isNotWindow = ((object <= kObjectCompartment8 || object >= kObjectHandleBathroom) && (object <= kObjectCompartmentH || object >= kObject48))
 
ObjectModel model = (ObjectModel)hotspot.param2
 
Inventory::InventoryEntry * entry = getInventory()->get(item)
 
bool process = (hotspot.scene == 0)
 
SceneIndex sceneIndex = kSceneInvalid
 
return kSceneCompartmentCorpse
 
Common::String filename = Common::String::format("MUS%03d", hotspot.param3)
 

Function Documentation

◆ action_enterCompartment()

return action_enterCompartment ( hotspot  )

◆ action_knockInside()

return action_knockInside ( hotspot  )

◆ getInventory()

getInventory ( ) -> unselectItem()

◆ getObjects()

getObjects ( ) -> update(kObjectCompartment1, kEntityPlayer, kObjectLocation1, kCursorHandKnock, kCursorHand)

◆ getProgress()

getProgress ( )

◆ getSaveLoad()

getSaveLoad ( ) -> saveGame(kSavegameTypeTime, kEntityPlayer, kTimeNone)

◆ getScenes()

getScenes ( ) -> loadScene(index)

◆ getSound()

getSound ( ) -> playSoundEvent(kEntityPlayer, 16)

◆ if() [1/32]

if ( !entry->  location)

◆ if() [2/32]

if ( getInventory) ->getSelectedEntry() ->isSelectable||(!getState() ->sceneBackup2 &&getInventory() ->getFirstExaminableItem()) -> selectItem(getInventory() ->getFirstExaminableItem())

◆ if() [3/32]

if ( getInventory) ->getSelectedItem()

◆ if() [4/32]

if ( getInventory) ->hasItem(item)

◆ if() [5/32]

IMPLEMENT_ACTION (playMusic) Common if ( getSoundQueue) ->isBuffered(filename) &&(hotspot.param1 !=50||getProgress().chapter==kChapter5) -> playSound(kEntityPlayer, filename, kVolumeFull, hotspot.param2)

◆ if() [6/32]

if ( !getSoundQueue() ->isBuffered(filename) &&hotspot.param3 &  id)

Definition at line 1456 of file action.cpp.

◆ if() [7/32]

if ( getSoundQueue) ->isBuffered(filename) -> playSound(kEntityPlayer, filename, kVolumeFull)

◆ if() [8/32]

if ( !hotspot.  scene) -> processScene()

◆ if() [9/32]

if ( (getEvent(kEventCathLookOutsideWindowDay)||getEvent(kEventCathLookOutsideWindowNight)||getObjects() ->get(kObjectCompartment1).model==kObjectModel1) &&getProgress().isTrainRunning &&(object !=kObjectOutsideAnnaCompartment||(!getEntities() ->isInsideCompartment(kEntityRebecca, kCarRedSleeping, kPosition_4840) &&getObjects() ->get(kObjectOutsideBetweenCompartments).status==kObjectLocation2)) &&getInventory() ->getSelectedItem() !  = kItemFirebird && getInventory()->getSelectedItem() != kItemBriefcase)

Definition at line 848 of file action.cpp.

◆ if() [10/32]

if ( action !  = 1 &&action !=2)

◆ if() [11/32]

if ( compartment >=  kObjectMax)

◆ if() [12/32]

if ( entry->  inPocket)

◆ if() [13/32]

if ( evt !  = kEventNone)

Definition at line 1324 of file action.cpp.

◆ if() [14/32]

if ( evt  = =kEventCathClimbDownTrainNoJacketDay) -> playSoundEvent(kEntityPlayer, 37)

◆ if() [15/32]

if ( getBeetle() ->catchBeetle()  )

Definition at line 1210 of file action.cpp.

◆ if() [16/32]

if ( getEntities() ->getPosition(backup->car, backup->position)  )

◆ if() [17/32]

if ( getInventory() ->get(item) ->  scene)

Definition at line 738 of file action.cpp.

◆ if() [18/32]

if ( getObjects() ->get(compartment).  entity)

Definition at line 512 of file action.cpp.

◆ if() [19/32]

if ( getObjects() ->get(object).  entity)

Definition at line 494 of file action.cpp.

◆ if() [20/32]

if ( getProgress().  eventCorpseFound)

Definition at line 814 of file action.cpp.

◆ if() [21/32]

if ( getProgress().field_7C &&!getSoundQueue() ->isBuffered("MUS003")  )

Definition at line 1370 of file action.cpp.

◆ if() [22/32]

if ( getProgress().field_80 &&!getSoundQueue() ->isBuffered("MUS003")  )

Definition at line 1382 of file action.cpp.

◆ if() [23/32]

if ( getState() ->  sceneBackup2)

Definition at line 433 of file action.cpp.

◆ if() [24/32]

if ( handleOtherCompartment(compartment, true, true)  )

Definition at line 519 of file action.cpp.

◆ if() [25/32]

if ( hotspot.action !  = SceneHotspot::kActionEnterCompartment || getInventory()->getSelectedItem() != kItemKey)

Definition at line 550 of file action.cpp.

◆ if() [26/32]

if ( id  )

Definition at line 1421 of file action.cpp.

◆ if() [27/32]

if ( item >=  kPortraitOriginal)

◆ if() [28/32]

if ( item  = =kItemCorpse)

Definition at line 660 of file action.cpp.

◆ if() [29/32]

if ( )

◆ if() [30/32]

if ( location  = = kObjectLocation1 || location == kObjectLocation3 || getEntities()->checkFields2(compartment))

Definition at line 525 of file action.cpp.

◆ if() [31/32]

if ( object !  = kObject112 || getSoundQueue()->isBuffered("LIB096"))

Definition at line 637 of file action.cpp.

◆ if() [32/32]

if ( object >=  kObjectMax)

◆ IMPLEMENT_ACTION() [1/40]

IMPLEMENT_ACTION ( 27  ) -> isBuffered("LIB031", true)) getSound() ->playSoundEvent(kEntityPlayer, 31)

◆ IMPLEMENT_ACTION() [2/40]

IMPLEMENT_ACTION ( 29  )

◆ IMPLEMENT_ACTION() [3/40]

IMPLEMENT_ACTION ( 39  ) -> playSoundEvent(kEntityPlayer, 24)

◆ IMPLEMENT_ACTION() [4/40]

IMPLEMENT_ACTION ( 44  )

Definition at line 1475 of file action.cpp.

◆ IMPLEMENT_ACTION() [5/40]

IMPLEMENT_ACTION ( almostFall  )

Definition at line 890 of file action.cpp.

◆ IMPLEMENT_ACTION() [6/40]

IMPLEMENT_ACTION ( bed  ) -> playSoundEvent(kEntityPlayer, 85)

◆ IMPLEMENT_ACTION() [7/40]

IMPLEMENT_ACTION ( bombPuzzle  )

Definition at line 1117 of file action.cpp.

◆ IMPLEMENT_ACTION() [8/40]

IMPLEMENT_ACTION ( catchBeetle  ) -> isLoaded()) return kSceneInvalid

◆ IMPLEMENT_ACTION() [9/40]

IMPLEMENT_ACTION ( climbDownTrain  )

◆ IMPLEMENT_ACTION() [10/40]

IMPLEMENT_ACTION ( climbInWindow  )

Definition at line 914 of file action.cpp.

◆ IMPLEMENT_ACTION() [11/40]

IMPLEMENT_ACTION ( climbLadder  )

◆ IMPLEMENT_ACTION() [12/40]

IMPLEMENT_ACTION ( compartment  )

◆ IMPLEMENT_ACTION() [13/40]

IMPLEMENT_ACTION ( dialog  ) -> playDialog(kEntityTables4,(EntityIndex) hotspot.param1, kVolumeFull, 0)

◆ IMPLEMENT_ACTION() [14/40]

IMPLEMENT_ACTION ( dropItem  )

◆ IMPLEMENT_ACTION() [15/40]

IMPLEMENT_ACTION ( eggBox  ) -> playSoundEvent(kEntityPlayer, 43)

◆ IMPLEMENT_ACTION() [16/40]

IMPLEMENT_ACTION ( enterBaggage  )

Definition at line 1089 of file action.cpp.

◆ IMPLEMENT_ACTION() [17/40]

IMPLEMENT_ACTION ( enterCompartment  ) -> get(kObjectCompartment1).status==kObjectLocation1||getObjects() ->get(kObjectCompartment1).status==kObjectLocation3||getInventory() ->getSelectedItem()==kItemKey) return action_compartment(hotspot)

◆ IMPLEMENT_ACTION() [18/40]

IMPLEMENT_ACTION ( escapeBaggage  )

◆ IMPLEMENT_ACTION() [19/40]

IMPLEMENT_ACTION ( exitCompartment  ) &&

◆ IMPLEMENT_ACTION() [20/40]

IMPLEMENT_ACTION ( firebirdPuzzle  )

◆ IMPLEMENT_ACTION() [21/40]

IMPLEMENT_ACTION ( inventory  ) -> sceneUseBackup) return kSceneInvalid

◆ IMPLEMENT_ACTION() [22/40]

IMPLEMENT_ACTION ( knock  )

◆ IMPLEMENT_ACTION() [23/40]

IMPLEMENT_ACTION ( knockInside  )

◆ IMPLEMENT_ACTION() [24/40]

IMPLEMENT_ACTION ( kronosConcert  )

Definition at line 1171 of file action.cpp.

◆ IMPLEMENT_ACTION() [25/40]

IMPLEMENT_ACTION ( kronosSanctum  )

Definition at line 1002 of file action.cpp.

◆ IMPLEMENT_ACTION() [26/40]

IMPLEMENT_ACTION ( leanOutWindow  )

◆ IMPLEMENT_ACTION() [27/40]

IMPLEMENT_ACTION ( openBed  ) -> playSoundEvent(kEntityPlayer, 59)

◆ IMPLEMENT_ACTION() [28/40]

IMPLEMENT_ACTION ( openCloseObject  )

◆ IMPLEMENT_ACTION() [29/40]

IMPLEMENT_ACTION ( openMatchBox  ) -> get(kItemMatch) ->location||getInventory() ->get(kItemMatch) ->inPocket) return kSceneInvalid

◆ IMPLEMENT_ACTION() [30/40]

IMPLEMENT_ACTION ( outsideTrain  )

Definition at line 1235 of file action.cpp.

◆ IMPLEMENT_ACTION() [31/40]

IMPLEMENT_ACTION ( pickItem  )

◆ IMPLEMENT_ACTION() [32/40]

IMPLEMENT_ACTION ( playAnimation  )

◆ IMPLEMENT_ACTION() [33/40]

IMPLEMENT_ACTION ( playMusicChapter  )
pure virtual

◆ IMPLEMENT_ACTION() [34/40]

IMPLEMENT_ACTION ( playMusicChapterSetupTrain  )
pure virtual

◆ IMPLEMENT_ACTION() [35/40]

IMPLEMENT_ACTION ( playSound  ) -> isBuffered(Common::String::format("LIB%03d", hotspot.param1), true)) getSound() ->playSoundEvent(kEntityPlayer, hotspot.param1, hotspot.param2)

◆ IMPLEMENT_ACTION() [36/40]

IMPLEMENT_ACTION ( playSounds  ) -> playSoundEvent(kEntityPlayer, hotspot.param1)

◆ IMPLEMENT_ACTION() [37/40]

IMPLEMENT_ACTION ( savePoint  ) -> push(kEntityPlayer,(EntityIndex) hotspot.param1,(ActionIndex) hotspot.param2)

◆ IMPLEMENT_ACTION() [38/40]

IMPLEMENT_ACTION ( setItem  )

◆ IMPLEMENT_ACTION() [39/40]

IMPLEMENT_ACTION ( setModel  )

◆ IMPLEMENT_ACTION() [40/40]

IMPLEMENT_ACTION ( switchChapter  )

◆ playAnimation() [1/3]

playAnimation ( (EventIndex) hotspot.  param1)

◆ playAnimation() [2/3]

playAnimation ( evt  )

◆ playAnimation() [3/3]

playAnimation ( kEventCathFindCorpse  )

◆ switch() [1/6]

switch ( action  )

Definition at line 1044 of file action.cpp.

◆ switch() [2/6]

switch ( getEntityData(kEntityPlayer) ->  car)

Definition at line 1153 of file action.cpp.

◆ switch() [3/6]

switch ( getProgress().  chapter)

Definition at line 946 of file action.cpp.

◆ switch() [4/6]

switch ( hotspot.  param1)

Definition at line 1280 of file action.cpp.

◆ switch() [5/6]

switch ( item  )

Definition at line 705 of file action.cpp.

◆ switch() [6/6]

switch ( location  )

Definition at line 604 of file action.cpp.

Variable Documentation

◆ backup

Scene* backup = getScenes()->get(getState()->sceneBackup)

Definition at line 440 of file action.cpp.

◆ else

else
Initial value:
{
getState()->sceneUseBackup = false

Definition at line 436 of file action.cpp.

◆ entry

Inventory::InventoryEntry * entry = getInventory()->get(item)

Definition at line 654 of file action.cpp.

◆ filename

Common::String filename = Common::String::format("MUS%03d", hotspot.param3)

Definition at line 1197 of file action.cpp.

◆ index

index = kSceneNone

Definition at line 432 of file action.cpp.

◆ isNotWindow

bool isNotWindow = ((object <= kObjectCompartment8 || object >= kObjectHandleBathroom) && (object <= kObjectCompartmentH || object >= kObject48))

Definition at line 602 of file action.cpp.

◆ kSceneCompartmentCorpse

return kSceneCompartmentCorpse

Definition at line 837 of file action.cpp.

◆ kSceneInvalid

return kSceneInvalid

Definition at line 453 of file action.cpp.

◆ kSceneNone

return kSceneNone

Definition at line 565 of file action.cpp.

◆ location

ObjectLocation location = getObjects()->get(compartment).status

Definition at line 524 of file action.cpp.

◆ model

ObjectModel model = (ObjectModel)hotspot.param2

Definition at line 630 of file action.cpp.

◆ process

bool process = (hotspot.scene == 0)

Definition at line 686 of file action.cpp.

◆ sceneIndex

return sceneIndex = kSceneInvalid

Definition at line 687 of file action.cpp.

LastExpress::getState
getState() -> time=kTimeStartGame