diff options
author | whiterandrek | 2018-04-05 08:15:14 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2018-06-28 23:51:32 +0200 |
commit | cad72b1532faa96c68848392766f25a4a58398ab (patch) | |
tree | 04d5e0cbda2aadb79fce35a1ddd45f0f0798f60f /engines/pink/objects/side_effect.cpp | |
parent | 4b7c75607a5d54d95c383fabf381d82d4ac77b94 (diff) | |
download | scummvm-rg350-cad72b1532faa96c68848392766f25a4a58398ab.tar.gz scummvm-rg350-cad72b1532faa96c68848392766f25a4a58398ab.tar.bz2 scummvm-rg350-cad72b1532faa96c68848392766f25a4a58398ab.zip |
PINK: basic walk, left click and seqTimer implementation
Diffstat (limited to 'engines/pink/objects/side_effect.cpp')
-rw-r--r-- | engines/pink/objects/side_effect.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/engines/pink/objects/side_effect.cpp b/engines/pink/objects/side_effect.cpp index 124ba8a1a0..1790917dd2 100644 --- a/engines/pink/objects/side_effect.cpp +++ b/engines/pink/objects/side_effect.cpp @@ -36,8 +36,8 @@ void SideEffectExit::deserialize(Archive &archive) { archive >> _nextModule >> _nextPage; } -void SideEffectExit::execute(LeadActor *actor) { - actor->setNextExecutors(_nextModule, _nextPage); +void SideEffectExit::execute(Actor *actor) { + actor->getPage()->getLeadActor()->setNextExecutors(_nextModule, _nextPage); } void SideEffectExit::toConsole() { @@ -48,10 +48,11 @@ void SideEffectLocation::deserialize(Archive &archive) { archive >> _location; } -void SideEffectLocation::execute(LeadActor *actor) { +void SideEffectLocation::execute(Actor *actor) { WalkMgr *mgr = actor->getPage()->getWalkMgr(); WalkLocation *location = mgr->findLocation(_location); - //TODO end this method + assert(location); + mgr->setCurrentWayPoint(location); } void SideEffectLocation::toConsole() { @@ -62,8 +63,10 @@ void SideEffectInventoryItemOwner::deserialize(Archive &archive) { archive >> _item >> _owner; } -void SideEffectInventoryItemOwner::execute(LeadActor *actor) { - //TODO +void SideEffectInventoryItemOwner::execute(Actor *actor) { + InventoryMgr *mgr = actor->getPage()->getModule()->getInventoryMgr(); + InventoryItem *item = mgr->findInventoryItem(_item); + mgr->setItemOwner(_item, item); } void SideEffectInventoryItemOwner::toConsole() { @@ -74,7 +77,7 @@ void SideEffectVariable::deserialize(Pink::Archive &archive) { archive >> _name >> _value; } -void SideEffectGameVariable::execute(LeadActor *actor) { +void SideEffectGameVariable::execute(Actor *actor) { actor->getPage()->getGame()->setVariable(_name, _value); } @@ -82,7 +85,7 @@ void SideEffectGameVariable::toConsole() { debug("\t\tSideEffectGameVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str()); } -void SideEffectModuleVariable::execute(LeadActor *actor) { +void SideEffectModuleVariable::execute(Actor *actor) { actor->getPage()->getModule()->setVariable(_name, _value); } @@ -90,7 +93,7 @@ void SideEffectModuleVariable::toConsole() { debug("\t\tSideEffectModuleVariable: _name=%s, _value=%s", _name.c_str(), _value.c_str()); } -void SideEffectPageVariable::execute(LeadActor *actor) { +void SideEffectPageVariable::execute(Actor *actor) { actor->getPage()->setVariable(_name, _value); } @@ -102,7 +105,7 @@ void SideEffectRandomPageVariable::deserialize(Archive &archive) { archive >> _name >> _values; } -void SideEffectRandomPageVariable::execute(LeadActor *actor) { +void SideEffectRandomPageVariable::execute(Actor *actor) { assert(!_values.empty()); Common::RandomSource &rnd = actor->getPage()->getGame()->getRnd(); |