diff options
author | Paul Gilbert | 2016-08-28 11:29:23 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-28 11:29:23 -0400 |
commit | 56c2ef9efc966286eefa451eba6f5acb1f58886f (patch) | |
tree | 6f856e9e387c9e61c53ad3df71fd2e808cc6306e /engines/titanic/game/show_cell_points.cpp | |
parent | 1dcfe25808164c5f2540662028862ac8a0e56831 (diff) | |
download | scummvm-rg350-56c2ef9efc966286eefa451eba6f5acb1f58886f.tar.gz scummvm-rg350-56c2ef9efc966286eefa451eba6f5acb1f58886f.tar.bz2 scummvm-rg350-56c2ef9efc966286eefa451eba6f5acb1f58886f.zip |
TITANIC: Implemented more game classes
Diffstat (limited to 'engines/titanic/game/show_cell_points.cpp')
-rw-r--r-- | engines/titanic/game/show_cell_points.cpp | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/engines/titanic/game/show_cell_points.cpp b/engines/titanic/game/show_cell_points.cpp index 7d54401a02..985cb93734 100644 --- a/engines/titanic/game/show_cell_points.cpp +++ b/engines/titanic/game/show_cell_points.cpp @@ -21,21 +21,50 @@ */ #include "titanic/game/show_cell_points.h" +#include "titanic/pet_control/pet_control.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CShowCellpoints, CGameObject) + ON_MESSAGE(EnterViewMsg) + ON_MESSAGE(LeaveViewMsg) +END_MESSAGE_MAP() + void CShowCellpoints::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeQuotedLine(_strValue, indent); - file->writeNumberLine(_numValue, indent); + file->writeQuotedLine(_npcName, indent); + file->writeNumberLine(_flag, indent); CGameObject::save(file, indent); } void CShowCellpoints::load(SimpleFile *file) { file->readNumber(); - _strValue = file->readString(); - _numValue = file->readNumber(); + _npcName = file->readString(); + _flag = file->readNumber(); CGameObject::load(file); } +bool CShowCellpoints::EnterViewMsg(CEnterViewMsg *msg) { + CPetControl *pet = getPetControl(); + if (pet) { + petSetArea(PET_CONVERSATION); + pet->setActiveNPC(_npcName); + pet->incAreaLocks(); + _flag = true; + } + + return true; +} + +bool CShowCellpoints::LeaveViewMsg(CLeaveViewMsg *msg) { + CPetControl *pet = getPetControl(); + if (pet && _flag) { + pet->resetDials0(); + pet->decAreaLocks(); + _flag = false; + } + + return true; +} + } // End of namespace Titanic |