shithub: cstory

Download patch

ref: ed4d67b0cb75d4b396be7464ba679d2c2bf0b2ce
parent: d152ff5ef9db107a5f4e3093a1d355e63ced7155
author: cuckydev <cuckydev@users.noreply.github.com>
date: Thu Jan 31 05:58:04 EST 2019

nope

--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -9,6 +9,7 @@
 
 #include "Draw.h"
 #include "Input.h"
+#include "Profile.h"
 #include "Organya.h"
 #include "Sound.h"
 #include "Game.h"
@@ -399,6 +400,11 @@
 					default:
 						break;
 				}
+				break;
+				
+			case SDL_DROPFILE:
+				LoadProfile(event.drop.file);
+				SDL_free(event.drop.file);
 				break;
 			
 			case SDL_KEYDOWN:
--- a/src/MyChar.cpp
+++ b/src/MyChar.cpp
@@ -151,7 +151,7 @@
 
 void PutMyChar(int fx, int fy)
 {
-	if ((gMC.cond & 0x80u) && !(gMC.cond & 2))
+	if ((gMC.cond & 0x80) && !(gMC.cond & 2))
 	{
 		//Draw weapon
 		gMC.rect_arms.left = 24 * (gArmsData[gSelectedArms].code % 13);
--- a/src/NpcAct.h
+++ b/src/NpcAct.h
@@ -46,7 +46,7 @@
 void ActNpc060(NPCHAR *npc);
 void ActNpc061(NPCHAR *npc);
 void ActNpc062(NPCHAR *npc);
-
+void ActNpc063(NPCHAR *npc);
 void ActNpc064(NPCHAR *npc);
 void ActNpc065(NPCHAR *npc);
 
@@ -78,6 +78,7 @@
 
 void ActNpc145(NPCHAR *npc);
 
+void ActNpc150(NPCHAR *npc);
 void ActNpc151(NPCHAR *npc);
 
 void ActNpc211(NPCHAR *npc);
--- a/src/NpcAct000.cpp
+++ b/src/NpcAct000.cpp
@@ -802,6 +802,43 @@
 		npc->rect = rcRight[npc->ani_no];
 }
 
+//Balrog (cutscene)
+void ActNpc012(NPCHAR *npc)
+{
+	RECT rect_left[14];
+	RECT rect_right[14];
+	
+	rect_left[0] = {0, 0, 40, 24};
+	rect_left[1] = {160, 0, 200, 24};
+	rect_left[2] = {80, 0, 120, 24};
+	rect_left[3] = {120, 0, 160, 24};
+	rect_left[4] = {240, 0, 280, 24};
+	rect_left[5] = {200, 0, 240, 24};
+	rect_left[6] = {280, 0, 320, 24};
+	rect_left[7] = {0, 0, 0, 0};
+	rect_left[8] = {80, 48, 120, 72};
+	rect_left[9] = {0, 48, 40, 72};
+	rect_left[10] = {0, 0, 40, 24};
+	rect_left[11] = {40, 48, 80, 72};
+	rect_left[12] = {0, 0, 40, 24};
+	rect_left[13] = {280, 0, 320, 24};
+	
+	rect_right[0] = {0, 24, 40, 48};
+	rect_right[1] = {160, 24, 200, 48};
+	rect_right[2] = {80, 24, 120, 48};
+	rect_right[3] = {120, 24, 160, 48};
+	rect_right[4] = {240, 24, 280, 48};
+	rect_right[5] = {200, 24, 240, 48};
+	rect_right[6] = {280, 24, 320, 48};
+	rect_right[7] = {0, 0, 0, 0};
+	rect_right[8] = {80, 72, 120, 96};
+	rect_right[9] = {0, 72, 40, 96};
+	rect_right[10] = {0, 24, 40, 48};
+	rect_right[11] = {40, 72, 80, 96};
+	rect_right[12] = {0, 24, 40, 48};
+	rect_right[13] = {280, 24, 320, 48};
+}
+
 //Chest (closed)
 void ActNpc015(NPCHAR *npc)
 {
--- a/src/NpcAct060.cpp
+++ b/src/NpcAct060.cpp
@@ -481,6 +481,136 @@
 	npc->rect = rcLeft[npc->ani_no];
 }
 
+//Toroko with stick
+void ActNpc063(NPCHAR *npc)
+{
+	RECT rcRight[6];
+	RECT rcLeft[6];
+
+	rcLeft[0] = {64, 64, 80, 80};
+	rcLeft[1] = {80, 64, 96, 80};
+	rcLeft[2] = {64, 64, 80, 80};
+	rcLeft[3] = {96, 64, 112, 80};
+	rcLeft[4] = {112, 64, 128, 80};
+	rcLeft[5] = {128, 64, 144, 80};	
+	
+	rcRight[0] = {64, 80, 80, 96};
+	rcRight[1] = {80, 80, 96, 96};
+	rcRight[2] = {64, 80, 80, 96};
+	rcRight[3] = {96, 80, 112, 96};
+	rcRight[4] = {112, 80, 128, 96};
+	rcRight[5] = {128, 80, 144, 96};
+	
+	switch ( npc->act_no )
+	{
+		case 0:
+			npc->act_no = 1;
+			npc->act_wait = 0;
+			npc->ani_wait = 0;
+			npc->ym = -1024;
+		case 1:
+			if (npc->ym > 0)
+				npc->bits &= ~npc_ignoreSolid;
+			
+			if (++npc->ani_wait > 2)
+			{
+				npc->ani_wait = 0;
+				++npc->ani_no;
+			}
+			
+			if (npc->ani_no > 3)
+				npc->ani_no = 0;
+			
+			if (npc->direct)
+				npc->xm = 0x100;
+			else
+				npc->xm = -0x100;
+			
+			if (npc->act_wait != 0 && npc->flag & 8)
+				npc->act_no = 2;
+			npc->act_wait++;
+			break;
+		case 2:
+			npc->act_no = 3;
+			npc->act_wait = 0;
+			npc->ani_no = 0;
+			npc->ani_wait = 0;
+		case 3:
+			if (++npc->ani_wait > 2)
+			{
+				npc->ani_wait = 0;
+				++npc->ani_no;
+			}
+			
+			if (npc->ani_no > 3)
+				npc->ani_no = 0;
+			
+			if (++npc->act_wait > 50)
+			{
+				npc->act_wait = 40;
+				npc->xm = -npc->xm;
+				if (npc->direct)
+					npc->direct = 0;
+				else
+					npc->direct = 2;
+			}
+			
+			if (npc->act_wait > 35)
+				npc->bits |= npc_shootable;
+			
+			if (npc->direct)
+				npc->xm += 0x40;
+			else
+				npc->xm -= 0x40;
+			
+			if (npc->shock)
+			{
+				npc->act_no = 4;
+				npc->ani_no = 4;
+				npc->ym = -0x400;
+				npc->bits &= ~npc_shootable;
+				npc->damage = 0;
+			}
+			break;
+		case 4:
+			if (npc->direct)
+				npc->xm = 0x100;
+			else
+				npc->xm = -0x100;
+			
+			if (npc->act_wait != 0 && npc->flag & 8)
+			{
+				npc->act_no = 5;
+				npc->bits |= npc_interact;
+			}
+			npc->act_wait++;
+			break;
+		case 5:
+			npc->xm = 0;
+			npc->ani_no = 5;
+			break;
+		default:
+			break;
+	}
+	
+	npc->ym += 0x40;
+	
+	if (npc->xm > 0x400)
+		npc->xm = 0x400;
+	if (npc->xm < -0x400)
+		npc->xm = -0x400;
+	if (npc->ym > 0x5FF)
+		npc->ym = 0x5FF;
+	
+	npc->x += npc->xm;
+	npc->y += npc->ym;
+	
+	if (npc->direct)
+		npc->rect = rcRight[npc->ani_no];
+	else
+		npc->rect = rcLeft[npc->ani_no];
+}
+
 //First Cave Critter
 void ActNpc064(NPCHAR *npc)
 {
--- a/src/NpcAct140.cpp
+++ b/src/NpcAct140.cpp
@@ -49,6 +49,162 @@
 		npc->rect = rcRight[npc->ani_no];
 }
 
+//Quote
+void ActNpc150(NPCHAR *npc)
+{
+	RECT rcLeft[9];
+	RECT rcRight[9];
+	
+	rcLeft[0] = {0, 0, 16, 16};
+	rcLeft[1] = {48, 0, 64, 16};
+	rcLeft[2] = {144, 0, 160, 16};
+	rcLeft[3] = {16, 0, 32, 16};
+	rcLeft[4] = {0, 0, 16, 16};
+	rcLeft[5] = {32, 0, 48, 16};
+	rcLeft[6] = {0, 0, 16, 16};
+	rcLeft[7] = {160, 0, 176, 16};
+	rcLeft[8] = {112, 0, 128, 16};
+	
+	rcRight[0] = {0, 16, 16, 32};
+	rcRight[1] = {48, 16, 64, 32};
+	rcRight[2] = {144, 16, 160, 32};
+	rcRight[3] = {16, 16, 32, 32};
+	rcRight[4] = {0, 16, 16, 32};
+	rcRight[5] = {32, 16, 48, 32};
+	rcRight[6] = {0, 16, 16, 32};
+	rcRight[7] = {160, 16, 176, 32};
+	rcRight[8] = {112, 16, 128, 32};
+	
+	switch (npc->act_no)
+	{
+		case 0:
+			npc->act_no = 1;
+			npc->ani_no = 0;
+			
+			if (npc->direct > 10)
+			{
+				npc->x = gMC.x;
+				npc->y = gMC.y;
+				npc->direct -= 10;
+			}
+			break;
+		case 2:
+			npc->ani_no = 1;
+			break;
+		case 10:
+			npc->act_no = 11;
+			for (int i = 0; i < 4; i++)
+				SetNpChar(4, npc->x, npc->y, Random(-0x155, 0x155), Random(-0x600, 0), 0, 0, 0x100);
+			PlaySoundObject(71, 1);
+		case 11:
+			npc->ani_no = 2;
+			break;
+		case 20:
+			npc->act_no = 21;
+			npc->act_wait = 64;
+			PlaySoundObject(29, 1);
+		case 21:
+			if (!--npc->act_wait)
+				npc->cond = 0;
+			break;
+		case 50:
+			npc->act_no = 51;
+			npc->ani_no = 3;
+			npc->ani_wait = 0;
+		case 51:
+			if (++npc->ani_wait > 4)
+			{
+				npc->ani_wait = 0;
+				++npc->ani_no;
+			}
+			if (npc->ani_no > 6)
+				npc->ani_no = 3;
+			
+			if ( npc->direct )
+				npc->x += 0x200;
+			else
+				npc->x -= 0x200;
+			break;
+		case 60:
+			npc->act_no = 61;
+			npc->ani_no = 7;
+			npc->tgt_x = npc->x;
+			npc->tgt_y = npc->y;
+		case 61:
+			npc->tgt_y += 0x100;
+			npc->x = npc->tgt_x + (Random(-1, 1) << 9);
+			npc->y = npc->tgt_y + (Random(-1, 1) << 9);
+			break;
+		case 70:
+			npc->act_no = 71;
+			npc->act_wait = 0;
+			npc->ani_no = 3;
+			npc->ani_wait = 0;
+		case 0x47:
+			if ( npc->direct )
+				npc->x -= 0x100;
+			else
+				npc->x += 0x100;
+			
+			if (++npc->ani_wait > 8)
+			{
+				npc->ani_wait = 0;
+				++npc->ani_no;
+			}
+			if (npc->ani_no > 6)
+				npc->ani_no = 3;
+			break;
+		case 80:
+			npc->ani_no = 8;
+			break;
+		case 99:
+		case 100:
+			npc->act_no = 101;
+			npc->ani_no = 3;
+			npc->ani_wait = 0;
+		case 101:
+			npc->ym += 0x40;
+			if (npc->ym > 0x5FF)
+				npc->ym = 0x5FF;
+			if (npc->flag & 8)
+			{
+				npc->ym = 0;
+				npc->act_no = 102;
+			}
+			npc->y += npc->ym;
+			break;
+		case 102:
+			if (++npc->ani_wait > 8)
+			{
+				npc->ani_wait = 0;
+				++npc->ani_no;
+			}
+			if (npc->ani_no > 6)
+				npc->ani_no = 3;
+			break;
+		default:
+			break;
+	}
+	
+	if (npc->direct)
+		npc->rect = rcRight[npc->ani_no];
+	else
+		npc->rect = rcLeft[npc->ani_no];
+	
+	if (npc->act_no == 21)
+	{
+		npc->rect.bottom = npc->act_wait / 4 + npc->rect.top;
+		if (npc->act_wait / 2 & 1)
+			++npc->rect.left;
+	}
+	
+	if (gMC.equip & 0x40)
+	{
+		npc->rect.top += 32;
+		npc->rect.bottom += 32;
+	}
+}
+
 //Blue robot (standing)
 void ActNpc151(NPCHAR *npc)
 {
--- a/src/NpcTbl.cpp
+++ b/src/NpcTbl.cpp
@@ -119,7 +119,7 @@
 	ActNpc060,
 	ActNpc061,
 	ActNpc062,
-	nullptr,
+	ActNpc063,
 	ActNpc064,
 	ActNpc065,
 	nullptr,
@@ -206,7 +206,7 @@
 	nullptr,
 	nullptr,
 	nullptr,
-	nullptr,
+	ActNpc150,
 	ActNpc151,
 	nullptr,
 	nullptr,
--- a/src/TextScr.cpp
+++ b/src/TextScr.cpp
@@ -785,6 +785,12 @@
 						gTS.p_read += 8;
 						bExit = true;
 					}
+					else if (IS_COMMAND('W','A','S'))
+					{
+						gTS.mode = 7;
+						gTS.p_read += 4;
+						bExit = true;
+					}
 					else if (IS_COMMAND('T','U','R'))
 					{
 						gTS.p_read += 4;
@@ -976,6 +982,23 @@
 						z = GetTextScriptNo(gTS.p_read + 19);
 						MoveNpChar(w, x << 13, y << 13, z);
 						gTS.p_read += 23;
+					}
+					else if (IS_COMMAND('M','Y','D'))
+					{
+						z = GetTextScriptNo(gTS.p_read + 4);
+						SetMyCharDirect(z);
+						gTS.p_read += 8;
+					}
+					else if (IS_COMMAND('M','Y','B'))
+					{
+						z = GetTextScriptNo(gTS.p_read + 4);
+						BackStepMyChar(z);
+						gTS.p_read += 8;
+					}
+					else if (IS_COMMAND('M','M','0'))
+					{
+						ZeroMyCharXMove();
+						gTS.p_read += 4;
 					}
 					else if (IS_COMMAND('I','N','I'))
 					{
--