commit
32dd3bef65
6 changed files with 3057 additions and 96 deletions
143
src/Flash.cpp
143
src/Flash.cpp
|
@ -1,14 +1,14 @@
|
||||||
#include "WindowsWrapper.h"
|
|
||||||
|
|
||||||
#include "Flash.h"
|
#include "Flash.h"
|
||||||
#include "Draw.h"
|
|
||||||
#include "CommonDefines.h"
|
#include "CommonDefines.h"
|
||||||
|
#include "Draw.h"
|
||||||
|
#include "WindowsWrapper.h"
|
||||||
|
|
||||||
static struct
|
static struct
|
||||||
{
|
{
|
||||||
int mode;
|
int mode;
|
||||||
int act_no;
|
int act_no;
|
||||||
bool flag;
|
BOOL flag;
|
||||||
int cnt;
|
int cnt;
|
||||||
int width;
|
int width;
|
||||||
int x;
|
int x;
|
||||||
|
@ -27,7 +27,7 @@ void InitFlash(void)
|
||||||
void SetFlash(int x, int y, int mode)
|
void SetFlash(int x, int y, int mode)
|
||||||
{
|
{
|
||||||
flash.act_no = 0;
|
flash.act_no = 0;
|
||||||
flash.flag = true;
|
flash.flag = TRUE;
|
||||||
flash.x = x;
|
flash.x = x;
|
||||||
flash.y = y;
|
flash.y = y;
|
||||||
flash.mode = mode;
|
flash.mode = mode;
|
||||||
|
@ -37,66 +37,72 @@ void SetFlash(int x, int y, int mode)
|
||||||
|
|
||||||
void ActFlash_Explosion(int flx, int fly)
|
void ActFlash_Explosion(int flx, int fly)
|
||||||
{
|
{
|
||||||
if (flash.act_no == 0)
|
int left, right, top, bottom;
|
||||||
|
|
||||||
|
switch (flash.act_no)
|
||||||
{
|
{
|
||||||
flash.cnt += 0x200;
|
case 0:
|
||||||
flash.width += flash.cnt;
|
flash.cnt += 0x200;
|
||||||
|
flash.width += flash.cnt;
|
||||||
|
|
||||||
int right = (flash.x - flx - flash.width) / 0x200;
|
right = (flash.x - flx - flash.width) / 0x200;
|
||||||
int left = (flash.y - fly - flash.width) / 0x200;
|
left = (flash.y - fly - flash.width) / 0x200;
|
||||||
int top = (flash.width + flash.x - flx) / 0x200;
|
top = (flash.x - flx + flash.width) / 0x200;
|
||||||
int bottom = (flash.width + flash.y - fly) / 0x200;
|
bottom = (flash.y - fly + flash.width) / 0x200;
|
||||||
|
|
||||||
if (right < 0)
|
if (right < 0)
|
||||||
right = 0;
|
right = 0;
|
||||||
if (left < 0)
|
if (left < 0)
|
||||||
left = 0;
|
left = 0;
|
||||||
if (top > WINDOW_WIDTH)
|
if (top > WINDOW_WIDTH)
|
||||||
top = WINDOW_WIDTH;
|
top = WINDOW_WIDTH;
|
||||||
if (bottom > WINDOW_HEIGHT)
|
if (bottom > WINDOW_HEIGHT)
|
||||||
bottom = WINDOW_HEIGHT;
|
bottom = WINDOW_HEIGHT;
|
||||||
|
|
||||||
flash.rect1.left = right;
|
flash.rect1.left = right;
|
||||||
flash.rect1.right = top;
|
flash.rect1.right = top;
|
||||||
flash.rect1.top = 0;
|
flash.rect1.top = 0;
|
||||||
flash.rect1.bottom = WINDOW_HEIGHT;
|
flash.rect1.bottom = WINDOW_HEIGHT;
|
||||||
|
|
||||||
flash.rect2.left = 0;
|
flash.rect2.left = 0;
|
||||||
flash.rect2.right = WINDOW_WIDTH;
|
flash.rect2.right = WINDOW_WIDTH;
|
||||||
flash.rect2.top = left;
|
flash.rect2.top = left;
|
||||||
flash.rect2.bottom = bottom;
|
flash.rect2.bottom = bottom;
|
||||||
|
|
||||||
if (flash.width > (WINDOW_WIDTH << 11))
|
if (flash.width > (WINDOW_WIDTH << 11))
|
||||||
{
|
{
|
||||||
flash.act_no = 1;
|
flash.act_no = 1;
|
||||||
flash.cnt = 0;
|
flash.cnt = 0;
|
||||||
flash.width = (WINDOW_HEIGHT << 9);
|
flash.width = (WINDOW_HEIGHT << 9);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (flash.act_no == 1)
|
|
||||||
{
|
|
||||||
flash.width -= flash.width / 8;
|
|
||||||
|
|
||||||
if ((flash.width / 0x100) == 0)
|
break;
|
||||||
flash.flag = false;
|
|
||||||
|
|
||||||
int top = (flash.y - fly - flash.width) / 0x200;
|
case 1:
|
||||||
if (top < 0)
|
flash.width -= flash.width / 8;
|
||||||
top = 0;
|
|
||||||
|
|
||||||
int bottom = (flash.width + flash.y - fly) / 0x200;
|
if ((flash.width / 0x100) == 0)
|
||||||
if (bottom > WINDOW_HEIGHT)
|
flash.flag = FALSE;
|
||||||
bottom = WINDOW_HEIGHT;
|
|
||||||
|
|
||||||
flash.rect1.left = 0;
|
top = (flash.y - fly - flash.width) / 0x200;
|
||||||
flash.rect1.right = 0;
|
if (top < 0)
|
||||||
flash.rect1.top = 0;
|
top = 0;
|
||||||
flash.rect1.bottom = 0;
|
|
||||||
|
|
||||||
flash.rect2.top = top;
|
bottom = (flash.y - fly + flash.width) / 0x200;
|
||||||
flash.rect2.bottom = bottom;
|
if (bottom > WINDOW_HEIGHT)
|
||||||
flash.rect2.left = 0;
|
bottom = WINDOW_HEIGHT;
|
||||||
flash.rect2.right = WINDOW_WIDTH;
|
|
||||||
|
flash.rect1.left = 0;
|
||||||
|
flash.rect1.right = 0;
|
||||||
|
flash.rect1.top = 0;
|
||||||
|
flash.rect1.bottom = 0;
|
||||||
|
|
||||||
|
flash.rect2.top = top;
|
||||||
|
flash.rect2.bottom = bottom;
|
||||||
|
flash.rect2.left = 0;
|
||||||
|
flash.rect2.right = WINDOW_WIDTH;
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,23 +131,36 @@ void ActFlash_Flash(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flash.cnt > 20)
|
if (flash.cnt > 20)
|
||||||
flash.flag = false;
|
flash.flag = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActFlash(int flx, int fly)
|
void ActFlash(int flx, int fly)
|
||||||
{
|
{
|
||||||
if (flash.flag)
|
if (flash.flag == FALSE)
|
||||||
{
|
{
|
||||||
if (flash.mode == 1)
|
// Do nothing
|
||||||
ActFlash_Explosion(flx, fly);
|
}
|
||||||
else if (flash.mode == 2)
|
else
|
||||||
ActFlash_Flash();
|
{
|
||||||
|
switch (flash.mode)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
ActFlash_Explosion(flx, fly);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ActFlash_Flash();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PutFlash(void)
|
void PutFlash(void)
|
||||||
{
|
{
|
||||||
if (flash.flag)
|
if (flash.flag == FALSE)
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
CortBox(&flash.rect1, gFlashColor);
|
CortBox(&flash.rect1, gFlashColor);
|
||||||
CortBox(&flash.rect2, gFlashColor);
|
CortBox(&flash.rect2, gFlashColor);
|
||||||
|
@ -150,5 +169,5 @@ void PutFlash(void)
|
||||||
|
|
||||||
void ResetFlash(void)
|
void ResetFlash(void)
|
||||||
{
|
{
|
||||||
flash.flag = false;
|
flash.flag = FALSE;
|
||||||
}
|
}
|
||||||
|
|
34
src/NpcAct.h
34
src/NpcAct.h
|
@ -243,15 +243,43 @@ void ActNpc237(NPCHAR *npc);
|
||||||
void ActNpc238(NPCHAR *npc);
|
void ActNpc238(NPCHAR *npc);
|
||||||
void ActNpc239(NPCHAR *npc);
|
void ActNpc239(NPCHAR *npc);
|
||||||
void ActNpc240(NPCHAR *npc);
|
void ActNpc240(NPCHAR *npc);
|
||||||
|
void ActNpc241(NPCHAR *npc);
|
||||||
|
void ActNpc242(NPCHAR *npc);
|
||||||
|
void ActNpc243(NPCHAR *npc);
|
||||||
|
void ActNpc244(NPCHAR *npc);
|
||||||
|
void ActNpc245(NPCHAR *npc);
|
||||||
|
void ActNpc246(NPCHAR *npc);
|
||||||
|
void ActNpc247(NPCHAR *npc);
|
||||||
|
void ActNpc248(NPCHAR *npc);
|
||||||
|
void ActNpc249(NPCHAR *npc);
|
||||||
|
void ActNpc250(NPCHAR *npc);
|
||||||
|
void ActNpc251(NPCHAR *npc);
|
||||||
|
void ActNpc252(NPCHAR *npc);
|
||||||
|
void ActNpc253(NPCHAR *npc);
|
||||||
|
void ActNpc254(NPCHAR *npc);
|
||||||
|
void ActNpc255(NPCHAR *npc);
|
||||||
|
void ActNpc256(NPCHAR *npc);
|
||||||
|
void ActNpc257(NPCHAR *npc);
|
||||||
|
void ActNpc258(NPCHAR *npc);
|
||||||
void ActNpc259(NPCHAR *npc);
|
void ActNpc259(NPCHAR *npc);
|
||||||
|
void ActNpc260(NPCHAR *npc);
|
||||||
|
void ActNpc261(NPCHAR *npc);
|
||||||
|
void ActNpc262(NPCHAR *npc);
|
||||||
|
void ActNpc263(NPCHAR *npc);
|
||||||
|
void ActNpc264(NPCHAR *npc);
|
||||||
|
void ActNpc265(NPCHAR *npc);
|
||||||
|
void ActNpc266(NPCHAR *npc);
|
||||||
|
void ActNpc267(NPCHAR *npc);
|
||||||
|
void ActNpc268(NPCHAR *npc);
|
||||||
|
void ActNpc269(NPCHAR *npc);
|
||||||
|
void ActNpc270(NPCHAR *npc);
|
||||||
void ActNpc271(NPCHAR *npc);
|
void ActNpc271(NPCHAR *npc);
|
||||||
void ActNpc272(NPCHAR *npc);
|
void ActNpc272(NPCHAR *npc);
|
||||||
void ActNpc273(NPCHAR *npc);
|
void ActNpc273(NPCHAR *npc);
|
||||||
void ActNpc274(NPCHAR *npc);
|
void ActNpc274(NPCHAR *npc);
|
||||||
void ActNpc275(NPCHAR *npc);
|
void ActNpc275(NPCHAR *npc);
|
||||||
|
void ActNpc276(NPCHAR *npc);
|
||||||
|
void ActNpc277(NPCHAR *npc);
|
||||||
void ActNpc278(NPCHAR *npc);
|
void ActNpc278(NPCHAR *npc);
|
||||||
|
|
||||||
void ActNpc292(NPCHAR *npc);
|
void ActNpc292(NPCHAR *npc);
|
||||||
|
|
1241
src/NpcAct240.cpp
1241
src/NpcAct240.cpp
File diff suppressed because it is too large
Load diff
1662
src/NpcAct260.cpp
1662
src/NpcAct260.cpp
File diff suppressed because it is too large
Load diff
|
@ -297,43 +297,43 @@ NPCFUNCTION gpNpcFuncTbl[361] =
|
||||||
ActNpc238,
|
ActNpc238,
|
||||||
ActNpc239,
|
ActNpc239,
|
||||||
ActNpc240,
|
ActNpc240,
|
||||||
nullptr,
|
ActNpc241,
|
||||||
nullptr,
|
ActNpc242,
|
||||||
nullptr,
|
ActNpc243,
|
||||||
nullptr,
|
ActNpc244,
|
||||||
nullptr,
|
ActNpc245,
|
||||||
nullptr,
|
ActNpc246,
|
||||||
nullptr,
|
ActNpc247,
|
||||||
nullptr,
|
ActNpc248,
|
||||||
nullptr,
|
ActNpc249,
|
||||||
nullptr,
|
ActNpc250,
|
||||||
nullptr,
|
ActNpc251,
|
||||||
nullptr,
|
ActNpc252,
|
||||||
nullptr,
|
ActNpc253,
|
||||||
nullptr,
|
ActNpc254,
|
||||||
nullptr,
|
ActNpc255,
|
||||||
nullptr,
|
ActNpc256,
|
||||||
nullptr,
|
ActNpc257,
|
||||||
nullptr,
|
ActNpc258,
|
||||||
ActNpc259,
|
ActNpc259,
|
||||||
nullptr,
|
ActNpc260,
|
||||||
nullptr,
|
ActNpc261,
|
||||||
nullptr,
|
ActNpc262,
|
||||||
nullptr,
|
ActNpc263,
|
||||||
nullptr,
|
ActNpc264,
|
||||||
nullptr,
|
ActNpc265,
|
||||||
nullptr,
|
ActNpc266,
|
||||||
nullptr,
|
ActNpc267,
|
||||||
nullptr,
|
ActNpc268,
|
||||||
nullptr,
|
ActNpc269,
|
||||||
nullptr,
|
ActNpc270,
|
||||||
ActNpc271,
|
ActNpc271,
|
||||||
ActNpc272,
|
ActNpc272,
|
||||||
ActNpc273,
|
ActNpc273,
|
||||||
ActNpc274,
|
ActNpc274,
|
||||||
ActNpc275,
|
ActNpc275,
|
||||||
nullptr,
|
ActNpc276,
|
||||||
nullptr,
|
ActNpc277,
|
||||||
ActNpc278,
|
ActNpc278,
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
|
|
@ -1,4 +1,15 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
typedef int BOOL;
|
||||||
|
|
||||||
|
#ifndef FALSE
|
||||||
|
#define FALSE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef TRUE
|
||||||
|
#define TRUE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
struct RECT
|
struct RECT
|
||||||
{
|
{
|
||||||
union
|
union
|
||||||
|
|
Loading…
Add table
Reference in a new issue