aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rwxr-xr-xengines/pegasus/items/biochips/retscanchip.cpp49
-rwxr-xr-xengines/pegasus/items/biochips/retscanchip.h43
-rwxr-xr-xengines/pegasus/items/biochips/shieldchip.cpp53
-rwxr-xr-xengines/pegasus/items/biochips/shieldchip.h46
-rw-r--r--engines/pegasus/module.mk2
-rw-r--r--engines/pegasus/neighborhood/neighborhood.h3
-rw-r--r--engines/pegasus/pegasus.cpp12
7 files changed, 205 insertions, 3 deletions
diff --git a/engines/pegasus/items/biochips/retscanchip.cpp b/engines/pegasus/items/biochips/retscanchip.cpp
new file mode 100755
index 0000000000..e9904056c1
--- /dev/null
+++ b/engines/pegasus/items/biochips/retscanchip.cpp
@@ -0,0 +1,49 @@
+/* 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.
+ *
+ * Additional copyright for this file:
+ * Copyright (C) 1995-1997 Presto Studios, Inc.
+ *
+ * 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 "pegasus/ai/ai_area.h"
+#include "pegasus/items/biochips/retscanchip.h"
+
+namespace Pegasus {
+
+RetScanChip::RetScanChip(const tItemID id, const tNeighborhoodID neighborhood, const tRoomID room, const tDirectionConstant direction) :
+ BiochipItem(id, neighborhood, room, direction) {
+}
+
+void RetScanChip::searchForLaser() {
+ ItemExtraEntry entry;
+ findItemExtra(kRetinalScanSearching, entry);
+
+ if (g_AIArea)
+ g_AIArea->playAIAreaSequence(kBiochipSignature, kMiddleAreaSignature, entry.extraStart, entry.extraStop);
+
+ findItemExtra(kRetinalScanActivated, entry);
+ if (g_AIArea)
+ g_AIArea->playAIAreaSequence(kBiochipSignature, kRightAreaSignature, entry.extraStart, entry.extraStop);
+
+ setItemState(kRetinalSimulating);
+}
+
+} // End of namespace Pegasus
diff --git a/engines/pegasus/items/biochips/retscanchip.h b/engines/pegasus/items/biochips/retscanchip.h
new file mode 100755
index 0000000000..7d8fe6d401
--- /dev/null
+++ b/engines/pegasus/items/biochips/retscanchip.h
@@ -0,0 +1,43 @@
+/* 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.
+ *
+ * Additional copyright for this file:
+ * Copyright (C) 1995-1997 Presto Studios, Inc.
+ *
+ * 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 PEGASUS_ITEMS_BIOCHIPS_RETSCANCHIP_H
+#define PEGASUS_ITEMS_BIOCHIPS_RETSCANCHIP_H
+
+#include "pegasus/items/biochips/biochipitem.h"
+
+namespace Pegasus {
+
+class RetScanChip : public BiochipItem {
+public:
+ RetScanChip(const tItemID, const tNeighborhoodID, const tRoomID, const tDirectionConstant);
+ virtual ~RetScanChip() {}
+
+ void searchForLaser();
+};
+
+} // End of namespace Pegasus
+
+#endif
diff --git a/engines/pegasus/items/biochips/shieldchip.cpp b/engines/pegasus/items/biochips/shieldchip.cpp
new file mode 100755
index 0000000000..4bd05728b4
--- /dev/null
+++ b/engines/pegasus/items/biochips/shieldchip.cpp
@@ -0,0 +1,53 @@
+/* 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.
+ *
+ * Additional copyright for this file:
+ * Copyright (C) 1995-1997 Presto Studios, Inc.
+ *
+ * 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 "pegasus/gamestate.h"
+#include "pegasus/items/biochips/shieldchip.h"
+#include "pegasus/neighborhood/neighborhood.h"
+
+namespace Pegasus {
+
+ShieldChip *g_shield = 0;
+
+ShieldChip::ShieldChip(const tItemID id, const tNeighborhoodID neighborhood, const tRoomID room, const tDirectionConstant direction) :
+ BiochipItem(id, neighborhood, room, direction) {
+ g_shield = this;
+}
+
+void ShieldChip::select() {
+ BiochipItem::select();
+ GameState.setShieldOn(true);
+ if (g_neighborhood)
+ g_neighborhood->shieldOn();
+}
+
+void ShieldChip::deselect() {
+ BiochipItem::deselect();
+ GameState.setShieldOn(false);
+ if (g_neighborhood)
+ g_neighborhood->shieldOff();
+}
+
+} // End of namespace Pegasus
diff --git a/engines/pegasus/items/biochips/shieldchip.h b/engines/pegasus/items/biochips/shieldchip.h
new file mode 100755
index 0000000000..c0b9cc5183
--- /dev/null
+++ b/engines/pegasus/items/biochips/shieldchip.h
@@ -0,0 +1,46 @@
+/* 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.
+ *
+ * Additional copyright for this file:
+ * Copyright (C) 1995-1997 Presto Studios, Inc.
+ *
+ * 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 PEGASUS_ITEMS_BIOCHIPS_SHIELDCHIP_H
+#define PEGASUS_ITEMS_BIOCHIPS_SHIELDCHIP_H
+
+#include "pegasus/items/biochips/biochipitem.h"
+
+namespace Pegasus {
+
+class ShieldChip : public BiochipItem {
+public:
+ ShieldChip(const tItemID, const tNeighborhoodID, const tRoomID, const tDirectionConstant);
+ virtual ~ShieldChip() {}
+
+ void select();
+ void deselect();
+};
+
+extern ShieldChip *g_shield;
+
+} // End of namespace Pegasus
+
+#endif
diff --git a/engines/pegasus/module.mk b/engines/pegasus/module.mk
index 0bac02d48d..2636b6c56d 100644
--- a/engines/pegasus/module.mk
+++ b/engines/pegasus/module.mk
@@ -32,6 +32,8 @@ MODULE_OBJS = \
items/biochips/biochipitem.o \
items/biochips/opticalchip.o \
items/biochips/pegasuschip.o \
+ items/biochips/retscanchip.o \
+ items/biochips/shieldchip.o \
items/inventory/airmask.o \
items/inventory/gascanister.o \
items/inventory/inventoryitem.o \
diff --git a/engines/pegasus/neighborhood/neighborhood.h b/engines/pegasus/neighborhood/neighborhood.h
index cf5abfb8e7..fcfc833a52 100644
--- a/engines/pegasus/neighborhood/neighborhood.h
+++ b/engines/pegasus/neighborhood/neighborhood.h
@@ -30,6 +30,7 @@
#include "common/str.h"
#include "pegasus/hotspot.h"
+#include "pegasus/input.h"
#include "pegasus/notification.h"
#include "pegasus/sound.h"
#include "pegasus/util.h"
@@ -127,6 +128,8 @@ public:
virtual tAirQuality getAirQuality(const tRoomID);
virtual void checkAirMask() {}
virtual void checkFlashlight() {}
+ virtual void shieldOn() {}
+ virtual void shieldOff() {}
protected:
virtual void receiveNotification(Notification *, const tNotificationFlags);
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp
index 22d2d863b5..9198f37d60 100644
--- a/engines/pegasus/pegasus.cpp
+++ b/engines/pegasus/pegasus.cpp
@@ -45,6 +45,8 @@
#include "pegasus/items/biochips/biochipitem.h"
#include "pegasus/items/biochips/opticalchip.h"
#include "pegasus/items/biochips/pegasuschip.h"
+#include "pegasus/items/biochips/retscanchip.h"
+#include "pegasus/items/biochips/shieldchip.h"
#include "pegasus/items/inventory/airmask.h"
#include "pegasus/items/inventory/gascanister.h"
#include "pegasus/items/inventory/inventoryitem.h"
@@ -198,11 +200,15 @@ void PegasusEngine::createItem(tItemID itemID, tNeighborhoodID neighborhoodID, t
new OpticalChip(itemID, neighborhoodID, roomID, direction);
break;
case kMapBiochip:
- case kRetinalScanBiochip:
- case kShieldBiochip:
- // TODO: Rest of specialized biochip classes
+ // TODO: Implement this biochip
new BiochipItem(itemID, neighborhoodID, roomID, direction);
break;
+ case kRetinalScanBiochip:
+ new RetScanChip(itemID, neighborhoodID, roomID, direction);
+ break;
+ case kShieldBiochip:
+ new ShieldChip(itemID, neighborhoodID, roomID, direction);
+ break;
case kAirMask:
new AirMask(itemID, neighborhoodID, roomID, direction);
break;