Added some TSC commands and BossLife.cpp
This commit is contained in:
parent
8954e9aaca
commit
5c8f80e611
6 changed files with 141 additions and 5 deletions
1
Makefile
1
Makefile
|
@ -41,6 +41,7 @@ endif
|
||||||
SOURCES = \
|
SOURCES = \
|
||||||
ArmsItem \
|
ArmsItem \
|
||||||
Back \
|
Back \
|
||||||
|
BossLife \
|
||||||
BulHit \
|
BulHit \
|
||||||
Bullet \
|
Bullet \
|
||||||
Caret \
|
Caret \
|
||||||
|
|
84
src/BossLife.cpp
Normal file
84
src/BossLife.cpp
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
#include "BossLife.h"
|
||||||
|
|
||||||
|
#include "Draw.h"
|
||||||
|
#include "NpChar.h"
|
||||||
|
#include "WindowsWrapper.h"
|
||||||
|
|
||||||
|
static struct
|
||||||
|
{
|
||||||
|
bool flag;
|
||||||
|
int *pLife;
|
||||||
|
int max;
|
||||||
|
int br;
|
||||||
|
int count;
|
||||||
|
} gBL;
|
||||||
|
|
||||||
|
void InitBossLife(void)
|
||||||
|
{
|
||||||
|
gBL.flag = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool StartBossLife(int code_event)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 0x200; ++i)
|
||||||
|
{
|
||||||
|
if (gNPC[i].code_event == code_event)
|
||||||
|
{
|
||||||
|
gBL.flag = true;
|
||||||
|
gBL.max = gNPC[i].life;
|
||||||
|
gBL.br = gNPC[i].life;
|
||||||
|
gBL.pLife = &gNPC[i].life;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool StartBossLife2(void)
|
||||||
|
{
|
||||||
|
// TODO uncomment me when Boss.cpp is done!
|
||||||
|
// gBL.flag = true;
|
||||||
|
// gBL.max = gBoss[0].life;
|
||||||
|
// gBL.br = gBoss[0].life;
|
||||||
|
// gBL.pLife = &gBoss[0].life;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PutBossLife(void)
|
||||||
|
{
|
||||||
|
RECT rcText = {0, 48, 32, 56};
|
||||||
|
RECT rcBox1 = {0, 0, 244, 8};
|
||||||
|
RECT rcBox2 = {0, 16, 244, 24};
|
||||||
|
RECT rcLife = {0, 24, 0, 32};
|
||||||
|
RECT rcBr = {0, 32, 232, 40};
|
||||||
|
|
||||||
|
if (gBL.flag)
|
||||||
|
{
|
||||||
|
if (*gBL.pLife >= 1)
|
||||||
|
{
|
||||||
|
rcLife.right = 198 * *gBL.pLife / gBL.max;
|
||||||
|
|
||||||
|
if (gBL.br <= *gBL.pLife)
|
||||||
|
{
|
||||||
|
gBL.count = 0;
|
||||||
|
}
|
||||||
|
else if (++gBL.count > 30)
|
||||||
|
{
|
||||||
|
--gBL.br;
|
||||||
|
}
|
||||||
|
|
||||||
|
rcBr.right = 198 * gBL.br / gBL.max;
|
||||||
|
|
||||||
|
PutBitmap3(&grcGame, 32, 220, &rcBox1, SURFACE_ID_TEXT_BOX);
|
||||||
|
PutBitmap3(&grcGame, 32, 228, &rcBox2, SURFACE_ID_TEXT_BOX);
|
||||||
|
PutBitmap3(&grcGame, 72, 224, &rcBr, SURFACE_ID_TEXT_BOX);
|
||||||
|
PutBitmap3(&grcGame, 72, 224, &rcLife, SURFACE_ID_TEXT_BOX);
|
||||||
|
PutBitmap3(&grcGame, 40, 224, &rcText, SURFACE_ID_TEXT_BOX);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gBL.flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
src/BossLife.h
Normal file
6
src/BossLife.h
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
void InitBossLife(void);
|
||||||
|
bool StartBossLife(int code_event);
|
||||||
|
bool StartBossLife2(void);
|
||||||
|
void PutBossLife(void);
|
|
@ -37,6 +37,7 @@
|
||||||
#include "Draw.h"
|
#include "Draw.h"
|
||||||
#include "Ending.h"
|
#include "Ending.h"
|
||||||
#include "Flash.h"
|
#include "Flash.h"
|
||||||
|
#include "BossLife.h"
|
||||||
|
|
||||||
int g_GameFlags;
|
int g_GameFlags;
|
||||||
int gCounter;
|
int gCounter;
|
||||||
|
@ -103,7 +104,7 @@ int ModeOpening()
|
||||||
//InitStar();
|
//InitStar();
|
||||||
InitFade();
|
InitFade();
|
||||||
InitFlash();
|
InitFlash();
|
||||||
//InitBossLife();
|
InitBossLife();
|
||||||
ChangeMusic(0);
|
ChangeMusic(0);
|
||||||
TransferStage(72, 100, 3, 3);
|
TransferStage(72, 100, 3, 3);
|
||||||
SetFrameTargetMyChar(16);
|
SetFrameTargetMyChar(16);
|
||||||
|
@ -441,7 +442,7 @@ int ModeAction()
|
||||||
//ClearPermitStage();
|
//ClearPermitStage();
|
||||||
//StartMapping();
|
//StartMapping();
|
||||||
InitFlags();
|
InitFlags();
|
||||||
//InitBossLife();
|
InitBossLife();
|
||||||
|
|
||||||
if ((bContinue && LoadProfile(NULL)) || InitializeGame())
|
if ((bContinue && LoadProfile(NULL)) || InitializeGame())
|
||||||
{
|
{
|
||||||
|
@ -517,7 +518,7 @@ int ModeAction()
|
||||||
PutFlash();
|
PutFlash();
|
||||||
PutCaret(frame_x, frame_y);
|
PutCaret(frame_x, frame_y);
|
||||||
PutValueView(frame_x, frame_y);
|
PutValueView(frame_x, frame_y);
|
||||||
//PutBossLife();
|
PutBossLife();
|
||||||
PutFade();
|
PutFade();
|
||||||
|
|
||||||
if (!(g_GameFlags & 4))
|
if (!(g_GameFlags & 4))
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "ValueView.h"
|
#include "ValueView.h"
|
||||||
#include "Stage.h"
|
#include "Stage.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
|
#include "BossLife.h"
|
||||||
|
|
||||||
const char *gDefaultName = "Profile.dat";
|
const char *gDefaultName = "Profile.dat";
|
||||||
const char *gProfileCode = "Do041220";
|
const char *gProfileCode = "Do041220";
|
||||||
|
@ -130,7 +131,7 @@ bool LoadProfile(char *name)
|
||||||
ClearFade();
|
ClearFade();
|
||||||
SetFrameMyChar();
|
SetFrameMyChar();
|
||||||
SetFrameTargetMyChar(16);
|
SetFrameTargetMyChar(16);
|
||||||
//InitBossLife();
|
InitBossLife();
|
||||||
CutNoise();
|
CutNoise();
|
||||||
//InitStar();
|
//InitStar();
|
||||||
ClearValueView();
|
ClearValueView();
|
||||||
|
@ -154,7 +155,7 @@ bool InitializeGame()
|
||||||
ClearFade();
|
ClearFade();
|
||||||
SetFrameMyChar();
|
SetFrameMyChar();
|
||||||
SetFrameTargetMyChar(16);
|
SetFrameTargetMyChar(16);
|
||||||
//InitBossLife();
|
InitBossLife();
|
||||||
CutNoise();
|
CutNoise();
|
||||||
ClearValueView();
|
ClearValueView();
|
||||||
//gCurlyShoot_wait = 0;
|
//gCurlyShoot_wait = 0;
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
#include "Sound.h"
|
#include "Sound.h"
|
||||||
#include "Organya.h"
|
#include "Organya.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
|
#include "Map.h"
|
||||||
|
#include "BossLife.h"
|
||||||
|
|
||||||
#define IS_COMMAND(c1, c2, c3) gTS.data[gTS.p_read + 1] == c1 && gTS.data[gTS.p_read + 2] == c2 && gTS.data[gTS.p_read + 3] == c3
|
#define IS_COMMAND(c1, c2, c3) gTS.data[gTS.p_read + 1] == c1 && gTS.data[gTS.p_read + 2] == c2 && gTS.data[gTS.p_read + 3] == c3
|
||||||
|
|
||||||
|
@ -840,6 +842,16 @@ int TextScriptProc()
|
||||||
else
|
else
|
||||||
gTS.p_read += 13;
|
gTS.p_read += 13;
|
||||||
}
|
}
|
||||||
|
else if (IS_COMMAND('I','T','J'))
|
||||||
|
{
|
||||||
|
x = GetTextScriptNo(gTS.p_read + 4);
|
||||||
|
z = GetTextScriptNo(gTS.p_read + 9);
|
||||||
|
|
||||||
|
if (CheckItem(x))
|
||||||
|
JumpTextScript(z);
|
||||||
|
else
|
||||||
|
gTS.p_read += 13;
|
||||||
|
}
|
||||||
else if (IS_COMMAND('S','S','S'))
|
else if (IS_COMMAND('S','S','S'))
|
||||||
{
|
{
|
||||||
x = GetTextScriptNo(gTS.p_read + 4);
|
x = GetTextScriptNo(gTS.p_read + 4);
|
||||||
|
@ -968,6 +980,37 @@ int TextScriptProc()
|
||||||
SetNpChar(w, x << 13, y << 13, 0, 0, z, 0, 0x100);
|
SetNpChar(w, x << 13, y << 13, 0, 0, z, 0, 0x100);
|
||||||
gTS.p_read += 23;
|
gTS.p_read += 23;
|
||||||
}
|
}
|
||||||
|
else if (IS_COMMAND('C','M','P'))
|
||||||
|
{
|
||||||
|
x = GetTextScriptNo(gTS.p_read + 4);
|
||||||
|
y = GetTextScriptNo(gTS.p_read + 9);
|
||||||
|
z = GetTextScriptNo(gTS.p_read + 14);
|
||||||
|
ChangeMapParts(x, y, z);
|
||||||
|
gTS.p_read += 18;
|
||||||
|
}
|
||||||
|
else if (IS_COMMAND('B','S','L'))
|
||||||
|
{
|
||||||
|
z = GetTextScriptNo(gTS.p_read + 4);
|
||||||
|
|
||||||
|
if (z)
|
||||||
|
StartBossLife(z);
|
||||||
|
else
|
||||||
|
StartBossLife2();
|
||||||
|
|
||||||
|
gTS.p_read += 8;
|
||||||
|
}
|
||||||
|
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','N','P'))
|
else if (IS_COMMAND('M','N','P'))
|
||||||
{
|
{
|
||||||
w = GetTextScriptNo(gTS.p_read + 4);
|
w = GetTextScriptNo(gTS.p_read + 4);
|
||||||
|
|
Loading…
Add table
Reference in a new issue