2017-06-14 23:00:36 +02:00
|
|
|
/* 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 "kingdom/kingdom.h"
|
|
|
|
|
|
|
|
namespace Kingdom {
|
|
|
|
|
|
|
|
void KingdomGame::GPLogic4() {
|
|
|
|
switch(_StatPlay) {
|
|
|
|
case 900:
|
|
|
|
if (_ATimer > 0) {
|
|
|
|
PlaySound(0);
|
|
|
|
_ATimer = 133;
|
|
|
|
}
|
2017-06-17 17:40:55 +02:00
|
|
|
if (_ASMode) {
|
2017-06-14 23:00:36 +02:00
|
|
|
SwitchMtoA();
|
|
|
|
_MapStat = 0;
|
|
|
|
_OldStatPlay--;
|
2017-06-17 17:40:55 +02:00
|
|
|
_ASMode = false;
|
2017-06-14 23:00:36 +02:00
|
|
|
}
|
|
|
|
SaveAS();
|
|
|
|
FadeToBlack2();
|
|
|
|
|
|
|
|
if (_Health == 10 || _Health == 6 || _Health == 2) {
|
|
|
|
ShowPic(121);
|
|
|
|
_BTimer = 38;
|
|
|
|
ReadMouse();
|
|
|
|
while (_BTimer && !_MouseButton) {
|
2017-07-03 08:13:10 +02:00
|
|
|
checkTimers();
|
2017-06-14 23:00:36 +02:00
|
|
|
RefreshSound();
|
2017-06-20 01:41:43 +02:00
|
|
|
ReadMouse();
|
2017-06-14 23:00:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (_ATimer > 0)
|
|
|
|
SetATimer();
|
|
|
|
|
|
|
|
_UserInput = 0;
|
|
|
|
GPLogic4_SP901();
|
|
|
|
} else {
|
|
|
|
if (_ATimer > 0) {
|
|
|
|
SetATimer();
|
|
|
|
_ATimer = 133;
|
|
|
|
}
|
|
|
|
ShowPic(120);
|
|
|
|
_StatPlay = 901;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 901:
|
|
|
|
GPLogic4_SP901();
|
|
|
|
break;
|
|
|
|
case 991:
|
|
|
|
_CurrMap = 10;
|
|
|
|
_UserInput = 0;
|
|
|
|
PlaySound(0);
|
|
|
|
if (_Health == 10 || _Health == 6 || _Health == 2)
|
|
|
|
_Health -= 2;
|
|
|
|
else
|
|
|
|
_Health -= 4;
|
|
|
|
|
|
|
|
if (_Health == 0) {
|
|
|
|
PlayMovie(194);
|
|
|
|
_NoIFScreen = 1;
|
|
|
|
FShowPic(107);
|
|
|
|
_CurrMap = 3;
|
|
|
|
DsAll();
|
|
|
|
_Pouch = 0;
|
|
|
|
PlaySound(1);
|
|
|
|
memset(_Inventory, -1, 19);
|
|
|
|
_StatPlay = 994;
|
|
|
|
} else {
|
|
|
|
_BTimer = 36;
|
2017-07-03 08:13:10 +02:00
|
|
|
while(_BTimer) {
|
|
|
|
checkTimers();
|
2017-06-14 23:00:36 +02:00
|
|
|
RefreshSound();
|
2017-07-03 08:13:10 +02:00
|
|
|
}
|
2017-06-14 23:00:36 +02:00
|
|
|
|
|
|
|
_LoopFlag = true;
|
2017-06-29 07:20:11 +02:00
|
|
|
if (_Nodes[29] == 1) {
|
|
|
|
_Nodes[29] = 0;
|
|
|
|
_Nodes[49] = 0;
|
2017-06-14 23:00:36 +02:00
|
|
|
}
|
|
|
|
|
2017-06-29 00:38:03 +02:00
|
|
|
_ItemInhibit = false;
|
|
|
|
_TideCntl = false;
|
2017-06-14 23:00:36 +02:00
|
|
|
DrawPic(179);
|
|
|
|
_SkylarTimer = 0;
|
2017-07-01 11:25:11 +02:00
|
|
|
_SkylarTimerFlag = false;
|
2017-06-14 23:00:36 +02:00
|
|
|
EnAll();
|
2017-06-29 00:38:03 +02:00
|
|
|
_MapEx = true;
|
2017-06-14 23:00:36 +02:00
|
|
|
_NodeNum = 5;
|
|
|
|
DrawLocation();
|
|
|
|
PlaySound(0);
|
2017-06-29 07:20:11 +02:00
|
|
|
if (_Nodes[5] > 0) {
|
2017-06-14 23:00:36 +02:00
|
|
|
PlayMovie(197);
|
|
|
|
_Resurrect = 1;
|
|
|
|
}
|
|
|
|
InventoryDel(12);
|
|
|
|
_StatPlay = 50;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 992:
|
|
|
|
_CurrMap = 10;
|
|
|
|
_UserInput = 0;
|
|
|
|
PlaySound(0);
|
|
|
|
if (_Health == 10 || _Health == 6 || _Health == 2)
|
|
|
|
_Health -= 2;
|
|
|
|
else
|
|
|
|
_Health -= 4;
|
|
|
|
|
|
|
|
if (_Health == 0) {
|
|
|
|
PlayMovie(194);
|
|
|
|
_NoIFScreen = 1;
|
|
|
|
FShowPic(107);
|
|
|
|
_CurrMap = 3;
|
|
|
|
DsAll();
|
|
|
|
_Pouch = 0;
|
|
|
|
PlaySound(1);
|
|
|
|
memset(_Inventory, -1, 19);
|
|
|
|
_StatPlay = 994;
|
|
|
|
} else {
|
|
|
|
_BTimer = 36;
|
2017-07-03 08:13:10 +02:00
|
|
|
while(_BTimer != 0) {
|
|
|
|
checkTimers();
|
2017-06-14 23:00:36 +02:00
|
|
|
RefreshSound();
|
2017-07-03 08:13:10 +02:00
|
|
|
}
|
2017-06-14 23:00:36 +02:00
|
|
|
|
|
|
|
_LoopFlag = true;
|
2017-06-29 07:20:11 +02:00
|
|
|
if (_Nodes[29] == 1) {
|
|
|
|
_Nodes[29] = 0;
|
|
|
|
_Nodes[49] = 0;
|
2017-06-14 23:00:36 +02:00
|
|
|
}
|
|
|
|
|
2017-06-29 00:38:03 +02:00
|
|
|
_ItemInhibit = false;
|
|
|
|
_TideCntl = false;
|
2017-06-14 23:00:36 +02:00
|
|
|
DrawPic(179);
|
|
|
|
_SkylarTimer = 0;
|
2017-07-01 11:25:11 +02:00
|
|
|
_SkylarTimerFlag = false;
|
2017-06-14 23:00:36 +02:00
|
|
|
EnAll();
|
2017-06-29 00:38:03 +02:00
|
|
|
_MapEx = true;
|
2017-06-14 23:00:36 +02:00
|
|
|
_NodeNum = 27;
|
|
|
|
DrawLocation();
|
|
|
|
_Resurrect = 1;
|
|
|
|
PlaySound(0);
|
|
|
|
PlayMovie(195);
|
|
|
|
InventoryDel(12);
|
|
|
|
_StatPlay = 270;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 993:
|
|
|
|
_CurrMap = 10;
|
|
|
|
_UserInput = 0;
|
|
|
|
PlaySound(0);
|
|
|
|
if (_Health == 10 || _Health == 6 || _Health == 2)
|
|
|
|
_Health -= 2;
|
|
|
|
else
|
|
|
|
_Health -= 4;
|
|
|
|
|
|
|
|
if (_Health == 0) {
|
|
|
|
PlayMovie(194);
|
|
|
|
_NoIFScreen = 1;
|
|
|
|
FShowPic(107);
|
|
|
|
_CurrMap = 3;
|
|
|
|
DsAll();
|
|
|
|
_Pouch = 0;
|
|
|
|
PlaySound(1);
|
|
|
|
memset(_Inventory, -1, 19);
|
|
|
|
_StatPlay = 994;
|
|
|
|
} else {
|
|
|
|
_BTimer = 36;
|
2017-07-03 08:13:10 +02:00
|
|
|
while (_BTimer != 0) {
|
|
|
|
checkTimers();
|
2017-06-14 23:00:36 +02:00
|
|
|
RefreshSound();
|
2017-07-03 08:13:10 +02:00
|
|
|
}
|
2017-06-14 23:00:36 +02:00
|
|
|
|
|
|
|
_LoopFlag = true;
|
2017-06-29 07:20:11 +02:00
|
|
|
if (_Nodes[29] == 1) {
|
|
|
|
_Nodes[29] = 0;
|
|
|
|
_Nodes[49] = 0;
|
2017-06-14 23:00:36 +02:00
|
|
|
}
|
2017-06-29 07:20:11 +02:00
|
|
|
if (_Nodes[68] == 1)
|
|
|
|
_Nodes[68] = 0;
|
2017-06-14 23:00:36 +02:00
|
|
|
|
2017-06-29 00:38:03 +02:00
|
|
|
_ItemInhibit = false;
|
|
|
|
_TideCntl = false;
|
2017-06-14 23:00:36 +02:00
|
|
|
DrawPic(179);
|
|
|
|
_SkylarTimer = 0;
|
2017-07-01 11:25:11 +02:00
|
|
|
_SkylarTimerFlag = false;
|
2017-06-14 23:00:36 +02:00
|
|
|
EnAll();
|
2017-06-29 00:38:03 +02:00
|
|
|
_MapEx = true;
|
2017-06-14 23:00:36 +02:00
|
|
|
_NodeNum = 52;
|
|
|
|
DrawLocation();
|
|
|
|
_Resurrect = 1;
|
|
|
|
PlaySound(0);
|
|
|
|
PlayMovie(196);
|
|
|
|
InventoryDel(12);
|
|
|
|
_StatPlay = 520;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 994:
|
|
|
|
switch(_UserInput) {
|
|
|
|
case 0x190:
|
|
|
|
InitPlay();
|
|
|
|
// TODO _QuitFlag = 1;
|
|
|
|
_quit = true;
|
|
|
|
break;
|
|
|
|
case 0x191:
|
|
|
|
// TODO _QuitFlag = 2;
|
|
|
|
_quit = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void KingdomGame::GPLogic4_SP901() {
|
|
|
|
SetMouse();
|
|
|
|
EraseCursor();
|
|
|
|
FadeToBlack2();
|
|
|
|
ShowPic(106);
|
2017-06-16 21:30:52 +02:00
|
|
|
DrawIcon(4, 0, 12 - _HealthOld);
|
2017-06-29 00:38:03 +02:00
|
|
|
if (_TideCntl)
|
2017-06-14 23:00:36 +02:00
|
|
|
DrawPic(178);
|
|
|
|
else
|
|
|
|
DrawPic(179);
|
|
|
|
|
|
|
|
_IconRedraw = true;
|
|
|
|
if (_UserInput == 0x2F1) {
|
2017-06-17 17:40:55 +02:00
|
|
|
_ASMode = false;
|
2017-06-14 23:00:36 +02:00
|
|
|
RestoreAS();
|
|
|
|
_StatPlay = _OldStatPlay;
|
|
|
|
_LoopFlag = true;
|
|
|
|
} else {
|
|
|
|
if (_Health == 10 || _Health == 6 || _Health == 2 || _UserInput < 0x400 || _UserInput > 0x427) {
|
2017-06-17 17:40:55 +02:00
|
|
|
_ASMode = false;
|
2017-06-14 23:00:36 +02:00
|
|
|
RestoreAS();
|
|
|
|
_StatPlay = _OldStatPlay;
|
|
|
|
} else {
|
|
|
|
_StatPlay = _MapExit[_UserInput - 0x400];
|
|
|
|
_UserInput = 0;
|
|
|
|
Wound();
|
|
|
|
PlayMovie(10);
|
|
|
|
InventoryDel(3);
|
|
|
|
_TSIconOnly = 0;
|
|
|
|
EnAll();
|
|
|
|
SwitchAS();
|
|
|
|
_MapStat = 0;
|
|
|
|
}
|
|
|
|
_UserInput = 0;
|
|
|
|
_LoopFlag = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // Namespace
|