scummvm/engines/bladerunner/script/scene/rc51.cpp

140 lines
4.5 KiB
C++
Raw Normal View History

/* 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 "bladerunner/script/scene_script.h"
namespace BladeRunner {
2018-02-13 23:08:37 +01:00
enum kRC51Loops {
kRC51LoopInshotFromRC02 = 0,
kRC51LoopMain = 1
};
enum kRC51Exits {
kRC51ExitRC02 = 0
};
2017-03-23 16:20:10 +01:00
void SceneScriptRC51::InitializeScene() {
Setup_Scene_Information(-8.87f, -1238.89f, 108164.27f, 66);
2018-02-13 23:08:37 +01:00
Scene_Exit_Add_2D_Exit(kRC51ExitRC02, 0, 460, 639, 479, 2);
Scene_Loop_Start_Special(kSceneLoopModeLoseControl, kRC51LoopInshotFromRC02, false);
Scene_Loop_Set_Default(kRC51LoopMain);
}
2017-03-23 16:20:10 +01:00
void SceneScriptRC51::SceneLoaded() {
Obstacle_Object("POSTER_2", true);
Obstacle_Object("CURTAIN", true);
Clickable_Object("POSTER_2");
Unclickable_Object("GRL_DSK");
Unclickable_Object("GRL_DSKLEG");
Unclickable_Object("CURTAIN");
2018-02-13 23:08:37 +01:00
if (!Game_Flag_Query(kFlagChopstickWrapperTaken)) {
Item_Add_To_World(kItemChopstickWrapper, 937, kSetRC02_RC51, 47.56f, -1238.89f, 108048.61f, 0, 6, 18, false, true, false, true);
}
2018-02-13 23:08:37 +01:00
if (!Game_Flag_Query(kFlagCandyTaken)) {
Item_Add_To_World(kItemCandy, 933, kSetRC02_RC51, 67.28f, -1193.38f, 108011.27f, 0, 6, 6, false, true, false, true);
}
2018-02-13 23:08:37 +01:00
if (!Game_Flag_Query(kFlagDogTaken)) {
Item_Add_To_World(kItemToyDog, 971, kSetRC02_RC51, -69.65f, -1238.89f, 107995.24f, 256, 18, 18, false, true, false, true);
}
}
2017-03-23 16:20:10 +01:00
bool SceneScriptRC51::MouseClick(int x, int y) {
return false;
}
2017-03-23 16:20:10 +01:00
bool SceneScriptRC51::ClickedOn3DObject(const char *objectName, bool a2) {
if (Object_Query_Click("POSTER_2", objectName)) {
Actor_Face_Object(kActorMcCoy, "POSTER_2", true);
Actor_Says(kActorMcCoy, 8620, 3);
return true;
}
return false;
}
2017-03-23 16:20:10 +01:00
bool SceneScriptRC51::ClickedOnActor(int actorId) {
return false;
}
2017-03-23 16:20:10 +01:00
bool SceneScriptRC51::ClickedOnItem(int itemId, bool a2) {
2018-02-13 23:08:37 +01:00
if (itemId == kItemChopstickWrapper && !Loop_Actor_Walk_To_XYZ(kActorMcCoy, 17.97f, -1238.89f, 108053.5f, 0, false, false, 0)) {
Actor_Face_Item(kActorMcCoy, kItemChopstickWrapper, true);
Actor_Clue_Acquire(kActorMcCoy, kClueChopstickWrapper, 1, -1);
2018-02-13 23:08:37 +01:00
Item_Remove_From_World(kItemChopstickWrapper);
Item_Pickup_Spin_Effect(937, 437, 407);
Actor_Voice_Over(2010, kActorVoiceOver);
2018-02-13 23:08:37 +01:00
Game_Flag_Set(kFlagChopstickWrapperTaken);
return true;
}
2018-02-13 23:08:37 +01:00
if (itemId == kItemCandy && !Loop_Actor_Walk_To_Item(kActorMcCoy, kItemCandy, 36, true, false)) {
Actor_Face_Item(kActorMcCoy, kItemCandy, true);
Actor_Clue_Acquire(kActorMcCoy, kClueCandy, 1, -1);
2018-02-13 23:08:37 +01:00
Item_Remove_From_World(kItemCandy);
Item_Pickup_Spin_Effect(933, 445, 230);
Actor_Says(kActorMcCoy, 8735, 3);
Actor_Says(kActorMcCoy, 8529, 3);
2018-02-13 23:08:37 +01:00
Game_Flag_Set(kFlagCandyTaken);
return true;
}
2018-02-13 23:08:37 +01:00
if (itemId == kItemToyDog && !Loop_Actor_Walk_To_Item(kActorMcCoy, kItemToyDog, 36, true, false)) {
Actor_Face_Item(kActorMcCoy, kItemToyDog, true);
Actor_Clue_Acquire(kActorMcCoy, kClueToyDog, 1, -1);
2018-02-13 23:08:37 +01:00
Item_Remove_From_World(kItemToyDog);
Item_Pickup_Spin_Effect(971, 55, 376);
Actor_Says(kActorMcCoy, 8525, 3);
Actor_Says(kActorMcCoy, 8740, 3);
2018-02-13 23:08:37 +01:00
Game_Flag_Set(kFlagDogTaken);
return true;
}
return false;
}
2017-03-23 16:20:10 +01:00
bool SceneScriptRC51::ClickedOnExit(int exitId) {
2018-02-13 23:08:37 +01:00
if (exitId == kRC51ExitRC02 && !Loop_Actor_Walk_To_XYZ(kActorMcCoy, -8.87f, -1238.89f, 108173.27f, 0, true, false, 0)) {
Set_Enter(kSetRC02_RC51, kSceneRC02);
return true;
}
return false;
}
2017-03-23 16:20:10 +01:00
bool SceneScriptRC51::ClickedOn2DRegion(int region) {
return false;
}
2017-03-23 16:20:10 +01:00
void SceneScriptRC51::SceneFrameAdvanced(int frame) {
}
2017-03-23 16:20:10 +01:00
void SceneScriptRC51::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
}
2017-03-23 16:20:10 +01:00
void SceneScriptRC51::PlayerWalkedIn() {
2018-02-13 23:08:37 +01:00
Game_Flag_Set(kFlagRC51Discovered);
}
2017-03-23 16:20:10 +01:00
void SceneScriptRC51::PlayerWalkedOut() {
}
2017-03-23 16:20:10 +01:00
void SceneScriptRC51::DialogueQueueFlushed(int a1) {
}
} // End of namespace BladeRunner