diff options
author | Paul Gilbert | 2016-02-25 19:52:21 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-02-25 19:52:21 -0500 |
commit | 4bd8ae116624802dd9e6e371bae8599523aa19b2 (patch) | |
tree | 508d012effe473cde763b9c2ad58e29aa2d56f60 /engines | |
parent | 63db0980e5f48764667863afe15b8f43b386c1a8 (diff) | |
download | scummvm-rg350-4bd8ae116624802dd9e6e371bae8599523aa19b2.tar.gz scummvm-rg350-4bd8ae116624802dd9e6e371bae8599523aa19b2.tar.bz2 scummvm-rg350-4bd8ae116624802dd9e6e371bae8599523aa19b2.zip |
TITANIC: Implemented CSuccUBus and ancestor classes
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/core/saveable_object.cpp | 3 | ||||
-rw-r--r-- | engines/titanic/module.mk | 5 | ||||
-rw-r--r-- | engines/titanic/npcs/character.cpp (renamed from engines/titanic/game/succubus.cpp) | 16 | ||||
-rw-r--r-- | engines/titanic/npcs/character.h (renamed from engines/titanic/game/succubus.h) | 16 | ||||
-rw-r--r-- | engines/titanic/npcs/succubus.cpp | 215 | ||||
-rw-r--r-- | engines/titanic/npcs/succubus.h | 110 | ||||
-rw-r--r-- | engines/titanic/npcs/true_talk_npc.cpp | 66 | ||||
-rw-r--r-- | engines/titanic/npcs/true_talk_npc.h | 64 |
8 files changed, 475 insertions, 20 deletions
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp index c7e749e9dd..ec0f2937ec 100644 --- a/engines/titanic/core/saveable_object.cpp +++ b/engines/titanic/core/saveable_object.cpp @@ -36,6 +36,7 @@ #include "titanic/game/room_item.h" #include "titanic/game/service_elevator_door.h" #include "titanic/game/sub_glass.h" +#include "titanic/npcs/succubus.h" namespace Titanic { @@ -58,6 +59,7 @@ DEFFN(CProjectItem); DEFFN(CRoomItem); DEFFN(CServiceElevatorDoor); DEFFN(CSUBGlass); +DEFFN(CSuccUBus); DEFFN(CTreeItem); DEFFN(CViewItem); @@ -76,6 +78,7 @@ void CSaveableObject::initClassList() { ADDFN(CRoomItem); ADDFN(CServiceElevatorDoor); ADDFN(CSUBGlass); + ADDFN(CSuccUBus); ADDFN(CTreeItem); ADDFN(CViewItem); } diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index 97053a52b7..7ae284add1 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -36,7 +36,10 @@ MODULE_OBJS := \ game/pet_position.o \ game/room_item.o \ game/service_elevator_door.o \ - game/sub_glass.o + game/sub_glass.o \ + npcs/character.o \ + npcs/succubus.o \ + npcs/true_talk_npc.o # This module can be built as a plugin ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN) diff --git a/engines/titanic/game/succubus.cpp b/engines/titanic/npcs/character.cpp index 27f47fd017..b8112ce56b 100644 --- a/engines/titanic/game/succubus.cpp +++ b/engines/titanic/npcs/character.cpp @@ -20,33 +20,29 @@ * */ -#include "titanic/rooms/sub_glass.h" +#include "titanic/npcs/character.h" namespace Titanic { -CSUBGlass::CSUBGlass() : _fieldBC(0), _fieldC0(0), _fieldC4(1), _fieldC8(0) { +CCharacter::CCharacter() : CGameObject(), _fieldBC(0), _fieldC0(0), _fieldC4(1) { } -void CSUBGlass::save(SimpleFile *file, int indent) const { +void CCharacter::save(SimpleFile *file, int indent) const { file->writeNumberLine(1, indent); file->writeNumberLine(_fieldBC, indent); file->writeNumberLine(_fieldC0, indent); file->writeNumberLine(_fieldC4, indent); - file->writeNumberLine(_fieldC8, indent); - file->writeNumberLine(_fieldCC, indent); - file->writeQuotedLine(_string, indent); + file->writeQuotedLine(_charName, indent); CGameObject::save(file, indent); } -void CSUBGlass::load(SimpleFile *file) { +void CCharacter::load(SimpleFile *file) { file->readNumber(); _fieldBC = file->readNumber(); _fieldC0 = file->readNumber(); _fieldC4 = file->readNumber(); - _fieldC8 = file->readNumber(); - _fieldCC = file->readNumber(); - _string = file->readString(); + _charName = file->readString(); CGameObject::load(file); } diff --git a/engines/titanic/game/succubus.h b/engines/titanic/npcs/character.h index f99597b53e..7f489d238f 100644 --- a/engines/titanic/game/succubus.h +++ b/engines/titanic/npcs/character.h @@ -20,28 +20,26 @@ * */ -#ifndef TITANIC_SUCCUBUS_H -#define TITANIC_SUCCUBUS_H +#ifndef TITANIC_CHARACTER_H +#define TITANIC_CHARACTER_H #include "titanic/core/game_object.h" namespace Titanic { -class CSuccUBus : public CGameObject { -private: +class CCharacter : public CGameObject { +protected: int _fieldBC; int _fieldC0; int _fieldC4; - int _fieldC8; - int _fieldCC; - CString _string; + CString _charName; public: - CSuccUBus(); + CCharacter(); /** * Return the class name */ - virtual const char *getClassName() const { return "CSuccUBus"; } + virtual const char *getClassName() const { return "CCharacter"; } /** * Save the data for the class to file diff --git a/engines/titanic/npcs/succubus.cpp b/engines/titanic/npcs/succubus.cpp new file mode 100644 index 0000000000..7570338274 --- /dev/null +++ b/engines/titanic/npcs/succubus.cpp @@ -0,0 +1,215 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/npcs/succubus.h" + +namespace Titanic { + +int CSuccUBus::_v0; +int CSuccUBus::_v1; +int CSuccUBus::_v2; +int CSuccUBus::_v3; +int CSuccUBus::_v4; + +CSuccUBus::CSuccUBus() : CTrueTalkNPC() { + _field108 = -1; + _field10C = -1; + _field110 = -1; + _field114 = -1; + _field118 = 0x44; + _field11C = 0xA8; + _field120 = 0xA8; + _field124 = 0xF8; + _field128 = 0; + _field12C = 0x0E; + _field130 = 0x0E; + _field134 = 27; + _field138 = 40; + _field13C = 0x44; + _field140 = 1; + _field144 = 0; + _field148 = 0; + _field14C = 0; + _field150 = 0xE0; + _field154 = 0; + _field158 = 0; + _field15C = 0; + _string2 = "NULL"; + _field16C = 28; + _field170 = 40; + _field174 = 82; + _field178 = 284; + _field17C = 148; + _field180 = 339; + _field184 = 15; + _field188 = 0; + _field18C = 0; + _field190 = 0; + _field194 = 240; + _field198 = 340; + _field19C = 0; + _field1A0 = -1; + _field1A4 = 0; + _field1A8 = 0; + _field1AC = 0; + _field1B0 = 0; + _field1B4 = 303; + _field1B8 = 312; + _field1BC = 313; + _field1C0 = 325; + _field1C4 = 326; + _field1C8 = 347; + _field1CC = 348; + _field1D0 = 375; + _field1D4 = 1; + _field1D8 = 0; +} + +void CSuccUBus::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + + file->writeNumberLine(_v0, indent); + file->writeNumberLine(_field108, indent); + file->writeNumberLine(_field10C, indent); + file->writeNumberLine(_field110, indent); + file->writeNumberLine(_field114, indent); + file->writeNumberLine(_field118, indent); + file->writeNumberLine(_field11C, indent); + file->writeNumberLine(_field120, indent); + file->writeNumberLine(_field124, indent); + file->writeNumberLine(_field128, indent); + file->writeNumberLine(_field12C, indent); + file->writeNumberLine(_field130, indent); + file->writeNumberLine(_field134, indent); + file->writeNumberLine(_field138, indent); + file->writeNumberLine(_field13C, indent); + file->writeNumberLine(_field140, indent); + + file->writeNumberLine(_v2, indent); + file->writeNumberLine(_field148, indent); + file->writeNumberLine(_field14C, indent); + file->writeNumberLine(_field150, indent); + file->writeNumberLine(_field154, indent); + file->writeNumberLine(_field158, indent); + file->writeNumberLine(_field15C, indent); + + file->writeQuotedLine(_string2, indent); + file->writeNumberLine(_field16C, indent); + file->writeNumberLine(_field170, indent); + file->writeNumberLine(_field174, indent); + file->writeNumberLine(_field178, indent); + file->writeNumberLine(_field17C, indent); + file->writeNumberLine(_field180, indent); + file->writeNumberLine(_field184, indent); + file->writeNumberLine(_field188, indent); + file->writeNumberLine(_field18C, indent); + file->writeNumberLine(_field190, indent); + file->writeNumberLine(_field194, indent); + file->writeNumberLine(_field198, indent); + file->writeNumberLine(_field19C, indent); + file->writeNumberLine(_field1A0, indent); + file->writeNumberLine(_field1A4, indent); + file->writeNumberLine(_field1A8, indent); + file->writeNumberLine(_field1AC, indent); + file->writeNumberLine(_field1B0, indent); + file->writeNumberLine(_field1B4, indent); + file->writeNumberLine(_field1B8, indent); + file->writeNumberLine(_field1BC, indent); + file->writeNumberLine(_field1C0, indent); + file->writeNumberLine(_field1C4, indent); + file->writeNumberLine(_field1C8, indent); + file->writeNumberLine(_field1CC, indent); + file->writeNumberLine(_field1D0, indent); + file->writeNumberLine(_field1D4, indent); + + file->writeNumberLine(_v3, indent); + file->writeNumberLine(_field1D8, indent); + file->writeNumberLine(_field104, indent); + + CTrueTalkNPC::save(file, indent); +} + +void CSuccUBus::load(SimpleFile *file) { + file->readNumber(); + + _v0 = file->readNumber(); + _field108 = file->readNumber(); + _field10C = file->readNumber(); + _field110 = file->readNumber(); + _field114 = file->readNumber(); + _field118 = file->readNumber(); + _field11C = file->readNumber(); + _field120 = file->readNumber(); + _field124 = file->readNumber(); + _field128 = file->readNumber(); + _field12C = file->readNumber(); + _field130 = file->readNumber(); + _field134 = file->readNumber(); + _field138 = file->readNumber(); + _field13C = file->readNumber(); + _field140 = file->readNumber(); + + _v2 = file->readNumber(); + _field148 = file->readNumber(); + _field14C = file->readNumber(); + _field150 = file->readNumber(); + _field154 = file->readNumber(); + _field158 = file->readNumber(); + _field15C = file->readNumber(); + + _string2 = file->readString(); + _field16C = file->readNumber(); + _field170 = file->readNumber(); + _field174 = file->readNumber(); + _field178 = file->readNumber(); + _field17C = file->readNumber(); + _field180 = file->readNumber(); + _field184 = file->readNumber(); + _field188 = file->readNumber(); + _field18C = file->readNumber(); + _field190 = file->readNumber(); + _field194 = file->readNumber(); + _field198 = file->readNumber(); + _field19C = file->readNumber(); + _field1A0 = file->readNumber(); + _field1A4 = file->readNumber(); + _field1A8 = file->readNumber(); + _field1AC = file->readNumber(); + _field1B0 = file->readNumber(); + _field1B4 = file->readNumber(); + _field1B8 = file->readNumber(); + _field1BC = file->readNumber(); + _field1C0 = file->readNumber(); + _field1C4 = file->readNumber(); + _field1C8 = file->readNumber(); + _field1CC = file->readNumber(); + _field1D0 = file->readNumber(); + _field1D4 = file->readNumber(); + + _v3 = file->readNumber(); + _field1D8 = file->readNumber(); + _field104 = file->readNumber(); + + CTrueTalkNPC::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/npcs/succubus.h b/engines/titanic/npcs/succubus.h new file mode 100644 index 0000000000..2e30b12ab5 --- /dev/null +++ b/engines/titanic/npcs/succubus.h @@ -0,0 +1,110 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_SUCCUBUS_H +#define TITANIC_SUCCUBUS_H + +#include "titanic/npcs/true_talk_npc.h" + +namespace Titanic { + +class CSuccUBus : public CTrueTalkNPC { +private: + static int _v0; + static int _v1; + static int _v2; + static int _v3; + static int _v4; +private: + int _field108; + int _field10C; + int _field110; + int _field114; + int _field118; + int _field11C; + int _field120; + int _field124; + int _field128; + int _field12C; + int _field130; + int _field134; + int _field138; + int _field13C; + int _field140; + int _field144; + int _field148; + int _field14C; + int _field150; + int _field154; + int _field158; + int _field15C; + CString _string2; + int _field16C; + int _field170; + int _field174; + int _field178; + int _field17C; + int _field180; + int _field184; + int _field188; + int _field18C; + int _field190; + int _field194; + int _field198; + int _field19C; + int _field1A0; + int _field1A4; + int _field1A8; + int _field1AC; + int _field1B0; + int _field1B4; + int _field1B8; + int _field1BC; + int _field1C0; + int _field1C4; + int _field1C8; + int _field1CC; + int _field1D0; + int _field1D4; + int _field1D8; +public: + CSuccUBus(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CSuccUBus"; } + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent) const; + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_SUCCUBUS_H */ diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp new file mode 100644 index 0000000000..924ea5657c --- /dev/null +++ b/engines/titanic/npcs/true_talk_npc.cpp @@ -0,0 +1,66 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/npcs/true_talk_npc.h" + +namespace Titanic { + +CTrueTalkNPC::CTrueTalkNPC() : _string1("z451.dlg"), + _fieldD4(0x11170), _fieldE4(0), _fieldE8(0), _fieldEC(0), _fieldF0(0), + _fieldF4(0), _fieldF8(0), _fieldFC(0), _field100(0), _field104(0) { +} + +void CTrueTalkNPC::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeNumberLine(_fieldD4, indent); + file->writeQuotedLine(_string1, indent); + file->writeNumberLine(_fieldE4, indent); + file->writeNumberLine(_fieldE8, indent); + file->writeNumberLine(_fieldEC, indent); + file->writeNumberLine(_fieldF0, indent); + file->writeNumberLine(_fieldF4, indent); + file->writeNumberLine(_fieldF8, indent); + file->writeNumberLine(_fieldFC, indent); + file->writeNumberLine(_field100, indent); + file->writeNumberLine(_field104, indent); + + CCharacter::save(file, indent); +} + +void CTrueTalkNPC::load(SimpleFile *file) { + file->readNumber(); + _fieldD4 = file->readNumber(); + _string1 = file->readString(); + _fieldE4 = file->readNumber(); + _fieldE8 = file->readNumber(); + _fieldEC = file->readNumber(); + _fieldF0 = file->readNumber(); + _fieldF4 = file->readNumber(); + _fieldF8 = file->readNumber(); + _fieldFC = file->readNumber(); + _field100 = file->readNumber(); + _field104 = file->readNumber(); + + CCharacter::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h new file mode 100644 index 0000000000..aed1ddb404 --- /dev/null +++ b/engines/titanic/npcs/true_talk_npc.h @@ -0,0 +1,64 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_TRUE_TALK_NPC_H +#define TITANIC_TRUE_TALK_NPC_H + +#include "titanic/npcs/character.h" + +namespace Titanic { + +class CTrueTalkNPC : public CCharacter { +protected: + int _fieldD4; + CString _string1; + int _fieldE4; + int _fieldE8; + int _fieldEC; + int _fieldF0; + int _fieldF4; + int _fieldF8; + int _fieldFC; + int _field100; + int _field104; +public: + CTrueTalkNPC(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CTrueTalkNPC"; } + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent) const; + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_TRUE_TALK_NPC_H */ |