ScummVM
action.cpp File Reference
Include dependency graph for action.cpp:

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.
 

Macros

#define ENTITY_PARAMS(entity, index, id)   ((EntityData::EntityParametersIIII*)getEntities()->get(entity)->getParamData()->getParameters(8, index))->param##id
 

Functions

 LastExpress::error ("[Action::action_dummy] Dummy action function called (hotspot action: %d)", hotspot.action)
 
 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())
 
 getSavePoints () -> push(kEntityPlayer,(EntityIndex) hotspot.param1,(ActionIndex) hotspot.param2)
 
 if (hotspot.param2||!getSoundQueue() ->isBuffered(Common::String::format("LIB%03d", hotspot.param1), true)) getSound() -> playSoundEvent(kEntityPlayer, hotspot.param1, hotspot.param2)
 
 if (!getSoundQueue() ->isBuffered(filename) &&(hotspot.param1 !=50||getProgress().chapter==kChapter5)) getSound() -> playSound(kEntityPlayer, filename, kVolumeFull, hotspot.param2)
 
 if (object >=kObjectMax) return kSceneInvalid
 
 if (getObjects() ->get(object).entity)
 
 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()
 
 if (getEvent(hotspot.param1)) return kSceneInvalid
 
 playAnimation ((EventIndex) hotspot.param1)
 
 if (!hotspot.scene) getScenes() -> processScene()
 
 switch (location)
 
 if (object !=kObject112||getSoundQueue() ->isBuffered("LIB096"))
 
 if (item >=kPortraitOriginal) return kSceneInvalid
 
 if (entry->inPocket) return kSceneInvalid
 
 if (item==kItemCorpse)
 
 if (!entry->location) return kSceneInvalid
 
 switch (item)
 
 if (getInventory() ->get(item) ->scene)
 
 if (!getInventory() ->hasItem(item)) return kSceneInvalid
 
 if (location< kObjectLocation1) return kSceneInvalid
 
 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
 
 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)
 
 switch ((ObjectIndex) hotspot.param1)
 
 if (action !=1 &&action !=2) return kSceneInvalid
 
 switch (getProgress().chapter)
 
 playAnimation (evt)
 
 if (evt==kEventCathClimbDownTrainNoJacketDay) getSound() -> playSoundEvent(kEntityPlayer, 37)
 
 switch (hotspot.param1)
 
 switch (action)
 
 if (!getSoundQueue() ->isBuffered("LIB031", true)) getSound() -> playSoundEvent(kEntityPlayer, 31)
 
 switch (getEntityData(kEntityPlayer) ->car)
 
 if (!getSoundQueue() ->isBuffered(filename)) getSound() -> playSound(kEntityPlayer, filename, kVolumeFull)
 
 if (!getBeetle() ->isLoaded()) return kSceneInvalid
 
 if (getBeetle() ->catchBeetle())
 
 if (!getProgress().field_30 &&getProgress().jacket !=kJacketOriginal)
 
return action_enterCompartment (hotspot)
 
 if (evt !=kEventNone)
 
 if (!getInventory() ->get(kItemMatch) ->location||getInventory() ->get(kItemMatch) ->inPocket) return kSceneInvalid
 
 if (getProgress().field_7C &&!getSoundQueue() ->isBuffered("MUS003"))
 
 if (getProgress().field_80 &&!getSoundQueue() ->isBuffered("MUS003"))
 
return action_knockInside (hotspot)
 
 if (id)
 
 if (!getSoundQueue() ->isBuffered(filename) &&hotspot.param3 &id)
 

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
 
Common::String filename = Common::String::format("MUS%03d", hotspot.param1)
 
ObjectIndex object = (ObjectIndex)hotspot.param1
 
ObjectIndex compartment = (ObjectIndex)hotspot.param1
 
ObjectLocation location = getObjects()->get(compartment).status
 
return kSceneNone
 
bool isNotWindow = ((object <= kObjectCompartment8 || object >= kObjectHandleBathroom) && (object <= kObjectCompartmentH || object >= kObject48))
 
ObjectModel model = (ObjectModel)hotspot.param2
 
InventoryItem item = (InventoryItem)hotspot.param1
 
Inventory::InventoryEntry * entry = getInventory()->get(item)
 
bool process = (hotspot.scene == 0)
 
SceneIndex sceneIndex = kSceneInvalid
 
return kSceneCompartmentCorpse
 
byte action = hotspot.param1
 
EventIndex evt = kEventNone
 
byte id = 0
 

Macro Definition Documentation

◆ ENTITY_PARAMS

#define ENTITY_PARAMS (   entity,
  index,
  id 
)    ((EntityData::EntityParametersIIII*)getEntities()->get(entity)->getParamData()->getParameters(8, index))->param##id

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)

◆ getSavePoints()

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

◆ getScenes()

getScenes ( ) -> loadScene(index)

◆ getSound()

getSound ( ) -> playSoundEvent(kEntityPlayer, 16)

◆ if() [1/40]

if ( !getState() ->  sceneUseBackup)

◆ if() [2/40]

if ( getState() ->  sceneBackup2)

Definition at line 433 of file action.cpp.

◆ if() [3/40]

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

◆ if() [4/40]

if ( getInventory) ->getSelectedItem()

◆ if() [5/40]

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

◆ if() [6/40]

if ( hotspot.param2||!  getSoundQueue) ->isBuffered(Common::String::format("LIB%03d", hotspot.param1), true) -> playSoundEvent(kEntityPlayer, hotspot.param1, hotspot.param2)

◆ if() [7/40]

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

◆ if() [8/40]

if ( object >=  kObjectMax)

◆ if() [9/40]

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

Definition at line 494 of file action.cpp.

◆ if() [10/40]

if ( compartment >=  kObjectMax)

◆ if() [11/40]

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

Definition at line 512 of file action.cpp.

◆ if() [12/40]

if ( handleOtherCompartment(compartment, true, true)  )

Definition at line 519 of file action.cpp.

◆ if() [13/40]

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

Definition at line 525 of file action.cpp.

◆ if() [14/40]

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

Definition at line 550 of file action.cpp.

◆ if() [15/40]

if ( getEvent(hotspot.param1)  )

◆ if() [16/40]

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

◆ if() [17/40]

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

Definition at line 637 of file action.cpp.

◆ if() [18/40]

if ( item >=  kPortraitOriginal)

◆ if() [19/40]

if ( entry->  inPocket)

◆ if() [20/40]

if ( item  = =kItemCorpse)

Definition at line 660 of file action.cpp.

◆ if() [21/40]

if ( !entry->  location)

◆ if() [22/40]

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

Definition at line 738 of file action.cpp.

◆ if() [23/40]

if ( getInventory) ->hasItem(item)

◆ if() [24/40]

if ( )

◆ if() [25/40]

if ( getObjects() ->get(kObjectCompartment1).  status = =kObjectLocation1||getObjects() ->get(kObjectCompartment1).status==kObjectLocation3||getInventory() ->getSelectedItem()==kItemKey)

◆ if() [26/40]

if ( getProgress().  eventCorpseFound)

Definition at line 814 of file action.cpp.

◆ if() [27/40]

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() [28/40]

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

◆ if() [29/40]

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

◆ if() [30/40]

if ( getSoundQueue) ->isBuffered("LIB031", true) -> playSoundEvent(kEntityPlayer, 31)

◆ if() [31/40]

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

◆ if() [32/40]

if ( getBeetle) ->isLoaded()

◆ if() [33/40]

if ( getBeetle() ->catchBeetle()  )

Definition at line 1210 of file action.cpp.

◆ if() [34/40]

if ( !getProgress().field_30 &&getProgress().jacket !  = kJacketOriginal)

Definition at line 1222 of file action.cpp.

◆ if() [35/40]

if ( evt = kEventNone)

Definition at line 1324 of file action.cpp.

◆ if() [36/40]

if ( !getInventory() ->get(kItemMatch) ->location||getInventory() ->get(kItemMatch) ->  inPocket)

◆ if() [37/40]

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

Definition at line 1370 of file action.cpp.

◆ if() [38/40]

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

Definition at line 1382 of file action.cpp.

◆ if() [39/40]

if ( id  )

Definition at line 1421 of file action.cpp.

◆ if() [40/40]

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

Definition at line 1456 of file action.cpp.

◆ playAnimation() [1/3]

playAnimation ( (EventIndex) hotspot.  param1)

◆ playAnimation() [2/3]

playAnimation ( kEventCathFindCorpse  )

◆ playAnimation() [3/3]

playAnimation ( evt  )

◆ switch() [1/7]

switch ( location  )

Definition at line 604 of file action.cpp.

◆ switch() [2/7]

switch ( item  )

Definition at line 705 of file action.cpp.

◆ switch() [3/7]

switch ( (ObjectIndex) hotspot.  param1)

Definition at line 891 of file action.cpp.

◆ switch() [4/7]

switch ( getProgress().  chapter)

Definition at line 946 of file action.cpp.

◆ switch() [5/7]

switch ( hotspot.  param1)

Definition at line 1003 of file action.cpp.

◆ switch() [6/7]

switch ( action  )

Definition at line 1044 of file action.cpp.

◆ switch() [7/7]

switch ( getEntityData(kEntityPlayer) ->  car)

Definition at line 1153 of file action.cpp.

Variable Documentation

◆ action

byte action = hotspot.param1

Definition at line 941 of file action.cpp.

◆ backup

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

Definition at line 440 of file action.cpp.

◆ compartment

ObjectIndex compartment = (ObjectIndex)hotspot.param1

Definition at line 507 of file action.cpp.

◆ else

else
Initial value:
{
getState()->sceneUseBackup = false
#define getState()
Definition: helpers.h:49

Definition at line 436 of file action.cpp.

◆ entry

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

Definition at line 654 of file action.cpp.

◆ evt

EventIndex evt = kEventNone

Definition at line 975 of file action.cpp.

◆ filename

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

Definition at line 479 of file action.cpp.

◆ id

int id = 0

Definition at line 1401 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.

◆ item

InventoryItem item = (InventoryItem)hotspot.param1

Definition at line 650 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.

◆ object

ObjectIndex object = (ObjectIndex)hotspot.param1

Definition at line 490 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.