Merge branch 'accurate' into portable

This commit is contained in:
Clownacy 2020-08-29 17:11:28 +01:00
commit 71970c1f74
41 changed files with 716 additions and 595 deletions

View file

@ -2,22 +2,19 @@
## Table of Contents
This repo has multiple branches:
This repo has two main branches:
Branch | Description
--------|--------
[accurate](https://www.github.com/Clownacy/CSE2/tree/accurate) | The main decompilation branch. The code intended to be as close to the original as possible, down to all the bugs and platform-dependencies.
[accurate](https://www.github.com/Clownacy/CSE2/tree/accurate) | The main decompilation branch. The code is intended to be as close to the original as possible, down to all the bugs and platform-dependencies.
[portable](https://www.github.com/Clownacy/CSE2/tree/portable) | This branch ports the engine away from WinAPI and DirectX, and addresses numerous portability issues, allowing it to run on other platforms.
[enhanced-lite](https://www.github.com/Clownacy/CSE2/tree/enhanced-lite) | Based on the `portable` branch, this branch is **intended for modders**, and adds several enhancements and features to the engine.
[enhanced](https://www.github.com/Clownacy/CSE2/tree/enhanced) | Based on the `enhanced-lite` branch, this branch is **intended for players**, and adds further enhancements and features to the engine.
[emscripten](https://www.github.com/Clownacy/CSE2/tree/emscripten) | Modifies the engine to build with Emscripten, [allowing it to run in web browsers](http://sonicresearch.org/clownacy/cave.html) (no longer maintained).
[wii](https://www.github.com/Clownacy/CSE2/tree/wii) | Ports the engine to the Nintendo Wii (no longer maintained).
# CSE2 (Portable)
CSE2 is a decompilation of Cave Story.
This branch migrates the engine away from WinAPI and DirectX, and addresses numerous portability issues, allowing it to run on other platforms.
This branch migrates the engine away from WinAPI and DirectX, and addresses
numerous portability issues, allowing it to run on other platforms.
Supported platforms include...
* Windows
@ -29,19 +26,39 @@ Supported platforms include...
## Background
When Pixel made Cave Story, he compiled the original Windows EXE with no optimisations. This left the generated assembly code extremely verbose and easy to read. It also made the code very decompiler-friendly, since the assembly could be mapped directly back to the original C(++) code.
When Pixel made Cave Story, he compiled the original Windows EXE with no
optimisations. This left the generated assembly code extremely verbose and easy
to read. It also made the code very decompiler-friendly, since the assembly
could be mapped directly back to the original C(++) code.
Technically, this alone made a decompilation feasible, as was the case for [the Super Mario 64 decompilation project](https://github.com/n64decomp/sm64) - however, there was more to be found...
Technically, this alone made a decompilation feasible, as was the case for [the
Super Mario 64 decompilation project](https://github.com/n64decomp/sm64) -
however, there was more to be found...
In 2007, a Linux port of Cave Story was made by Peter Mackay and Simon Parzer. Details about it can be found on [Peter's old blog](https://web.archive.org/web/20070911202919/http://aaiiee.wordpress.com:80/). This port received an update in 2011, including two shiny new executables. What Peter and Simon didn't realise was that they left huge amounts of debugging information in these executables, including the names of every C++ source file, as well as the variables, functions, and structs they contained.
In 2007, a Linux port of Cave Story was made by Peter Mackay and Simon Parzer.
Details about it can be found on [Peter's old blog](https://web.archive.org/web/20070911202919/http://aaiiee.wordpress.com:80/).
This port received an update in 2011, including two shiny new executables. What
Peter and Simon didn't realise was that they left huge amounts of debugging
information in these executables, including the names of every C++ source file,
as well as the variables, functions, and structs they contained.
This was a goldmine of information about not just the game's inner-workings, but its _source code._ This is the same lucky-break [the Diablo decompilation project](https://github.com/diasurgical/devilution) had. With it, much of the game's code was pre-documented and explained _for_ us, saving us the effort of doing it ourselves. In fact, the combination of easy-to-decompile code, and a near-full set of function/variable names, reduced much of the decompilation process to mere copy-paste.
This was a goldmine of information about not just the game's inner-workings, but
its _source code._ This is the same lucky-break [the Diablo decompilation project](https://github.com/diasurgical/devilution)
had. With it, much of the game's code was pre-documented and explained _for_ us,
saving us the effort of doing it ourselves. In fact, the combination of
easy-to-decompile code, and a near-full set of function/variable names, reduced
much of the decompilation process to mere copy-paste.
To top it all off, some of Cave Story's original source code would eventually see the light of day...
To top it all off, some of Cave Story's original source code would eventually
see the light of day...
In early 2018, the Organya music engine was [released on GitHub](https://github.com/shbow/organya) by an old friend of Pixel's. On top of providing an insight into Pixel's coding style, this helped with figuring out one of the most complex parts of Cave Story's codebase.
In early 2018, the Organya music engine was [released on GitHub](https://github.com/shbow/organya)
by an old friend of Pixel's. On top of providing an insight into Pixel's coding
style, this helped with figuring out one of the most complex parts of Cave
Story's codebase.
And... that's it! It's not often that a game this decompilable comes along, so I'm glad that Cave Story was one of them. [Patching a dusty old executable from 2004 has its downsides](https://github.com/Clownacy/Cave-Story-Mod-Loader/blob/master/src/mods/graphics_enhancement/widescreen/patch_camera.c).
And... that's it! It's not often that a game this decompilable comes along, so
I'm glad that Cave Story was one of them. [Patching a dusty old executable from 2004 has its downsides](https://github.com/Clownacy/Cave-Story-Mod-Loader/blob/master/src/mods/graphics_enhancement/widescreen/patch_camera.c).
## Dependencies
@ -59,7 +76,9 @@ A list of dependencies for specific platforms can be found [on the wiki](https:/
This project uses CMake, allowing it to be built with a range of compilers.
Switch to the terminal (Visual Studio users should open the [Developer Command Prompt](https://docs.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs)) and `cd` into this folder. After that, generate the files for your build system with:
Switch to the terminal (Visual Studio users should open the [Developer Command Prompt](https://docs.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs))
and `cd` into this folder. After that, generate the files for your build system
with:
```
cmake -B build -DCMAKE_BUILD_TYPE=Release
@ -104,15 +123,18 @@ You can then compile CSE2 with this command:
cmake --build build --config Release
```
If you're a Visual Studio user, you can open the generated `CSE2.sln` file instead, which can be found in the `build` folder.
If you're a Visual Studio user, you can open the generated `CSE2.sln` file
instead, which can be found in the `build` folder.
Once built, the executables can be found in the `game_english`/`game_japanese` folder, depending on the selected language.
Once built, the executables can be found in the `game_english`/`game_japanese`
folder, depending on the selected language.
### Building for the Wii U
To target the Wii U, you'll need devkitPro, and WUT.
First, add the devkitPPC tools directory to your PATH (because WUT's CMake support is broken, as of writing):
First, add the devkitPPC tools directory to your PATH (because WUT's CMake
support is broken, as of writing):
```
PATH=$PATH:$DEVKITPPC/bin
@ -130,7 +152,8 @@ Finally, build the game with this command:
cmake --build buildwiiu
```
This will build a binary, but you still need to convert it to an `.rpx` file that can be ran on your Wii U.
This will build a binary, but you still need to convert it to an `.rpx` file
that can be ran on your Wii U.
First, we need to strip the binary:
@ -143,8 +166,12 @@ Then, we convert it to an `.rpx`:
elf2rpl game_english/CSE2 game_english/CSE2.rpx
```
`game_english/CSE2.rpx` is now ready to be ran on your Wii U. This port expects the data folder to be in a folder called `CSE2-portable-en`/`CSE2-portable-jp` on the root of your SD card.
`game_english/CSE2.rpx` is now ready to be ran on your Wii U. This port expects
the data folder to be in a folder called `CSE2-portable-en`/`CSE2-portable-jp`
on the root of your SD card.
## Licensing
Being a decompilation, the majority of the code in this project belongs to Daisuke "Pixel" Amaya - not us. We've yet to agree on a licence for our own code.
Being a decompilation, the majority of the code in this project belongs to
Daisuke "Pixel" Amaya - not us. We've yet to agree on a licence for our own
code.

View file

@ -18,10 +18,9 @@ static unsigned long color_black;
// TODO - Another function that has an incorrect stack frame
BOOL InitBack(const char *fName, int type)
{
// Unused
color_black = GetCortBoxColor(RGB(0, 0, 0x10));
color_black = GetCortBoxColor(RGB(0, 0, 0x10)); // Unused. This may have once been used by background type 4 (the solid black background)
// Get width and height
// We're not actually loading the bitmap here - we're just reading its width/height and making sure it's really a BMP file
std::string path = gDataPath + '/' + fName + ".pbm";
FILE *fp = fopen(path.c_str(), "rb");
@ -39,12 +38,14 @@ BOOL InitBack(const char *fName, int type)
fseek(fp, 18, SEEK_SET);
// Get bitmap width and height
gBack.partsW = File_ReadLE32(fp);
gBack.partsH = File_ReadLE32(fp);
fclose(fp);
// Set background stuff and load texture
gBack.flag = TRUE;
gBack.flag = TRUE; // This variable is otherwise unused
// *Now* we actually load the bitmap
if (!ReloadBitmap_File(fName, SURFACE_ID_LEVEL_BACKGROUND))
return FALSE;
@ -57,18 +58,19 @@ void ActBack(void)
{
switch (gBack.type)
{
case 5:
case BACKGROUND_TYPE_AUTOSCROLL:
gBack.fx += 6 * 0x200;
break;
case 6:
case 7:
case BACKGROUND_TYPE_OUTSIDE_WITH_WIND:
case BACKGROUND_TYPE_OUTSIDE:
++gBack.fx;
gBack.fx %= 640;
break;
}
}
/// Draw background background elements
void PutBack(int fx, int fy)
{
int x, y;
@ -76,42 +78,44 @@ void PutBack(int fx, int fy)
switch (gBack.type)
{
case 0:
case BACKGROUND_TYPE_STATIONARY:
for (y = 0; y < WINDOW_HEIGHT; y += gBack.partsH)
for (x = 0; x < WINDOW_WIDTH; x += gBack.partsW)
PutBitmap4(&grcGame, x, y, &rect, SURFACE_ID_LEVEL_BACKGROUND);
break;
case 1:
case BACKGROUND_TYPE_MOVE_DISTANT:
for (y = -((fy / 2 / 0x200) % gBack.partsH); y < WINDOW_HEIGHT; y += gBack.partsH)
for (x = -((fx / 2 / 0x200) % gBack.partsW); x < WINDOW_WIDTH; x += gBack.partsW)
PutBitmap4(&grcGame, x, y, &rect, SURFACE_ID_LEVEL_BACKGROUND);
break;
case 2:
case BACKGROUND_TYPE_MOVE_NEAR:
for (y = -((fy / 0x200) % gBack.partsH); y < WINDOW_HEIGHT; y += gBack.partsH)
for (x = -((fx / 0x200) % gBack.partsW); x < WINDOW_WIDTH; x += gBack.partsW)
PutBitmap4(&grcGame, x, y, &rect, SURFACE_ID_LEVEL_BACKGROUND);
break;
case 5:
case BACKGROUND_TYPE_AUTOSCROLL:
for (y = -gBack.partsH; y < WINDOW_HEIGHT; y += gBack.partsH)
for (x = -((gBack.fx / 0x200) % gBack.partsW); x < WINDOW_WIDTH; x += gBack.partsW)
PutBitmap4(&grcGame, x, y, &rect, SURFACE_ID_LEVEL_BACKGROUND);
break;
case 6:
case 7:
case BACKGROUND_TYPE_OUTSIDE_WITH_WIND:
case BACKGROUND_TYPE_OUTSIDE:
// Draw sky
rect.top = 0;
rect.bottom = 88;
rect.left = 0;
rect.right = 320;
PutBitmap4(&grcGame, 0, 0, &rect, SURFACE_ID_LEVEL_BACKGROUND);
// Draw first cloud layer
rect.top = 88;
rect.bottom = 123;
rect.left = gBack.fx / 2;
@ -121,6 +125,7 @@ void PutBack(int fx, int fy)
rect.left = 0;
PutBitmap4(&grcGame, 320 - ((gBack.fx / 2) % 320), 88, &rect, SURFACE_ID_LEVEL_BACKGROUND);
// Draw second cloud layer
rect.top = 123;
rect.bottom = 146;
rect.left = gBack.fx % 320;
@ -130,6 +135,7 @@ void PutBack(int fx, int fy)
rect.left = 0;
PutBitmap4(&grcGame, 320 - (gBack.fx % 320), 123, &rect, SURFACE_ID_LEVEL_BACKGROUND);
// Draw third cloud layer
rect.top = 146;
rect.bottom = 176;
rect.left = 2 * gBack.fx % 320;
@ -139,6 +145,7 @@ void PutBack(int fx, int fy)
rect.left = 0;
PutBitmap4(&grcGame, 320 - ((gBack.fx * 2) % 320), 146, &rect, SURFACE_ID_LEVEL_BACKGROUND);
// Draw fourth cloud layer
rect.top = 176;
rect.bottom = 240;
rect.left = 4 * gBack.fx % 320;
@ -152,6 +159,7 @@ void PutBack(int fx, int fy)
}
}
/// Draw background foreground elements - only the water background type makes use of this
void PutFront(int fx, int fy)
{
int xpos, ypos;
@ -164,7 +172,7 @@ void PutFront(int fx, int fy)
switch (gBack.type)
{
case 3:
case BACKGROUND_TYPE_WATER:
x_1 = fx / (32 * 0x200);
x_2 = x_1 + (((WINDOW_WIDTH + (32 - 1)) / 32) + 1);
y_1 = 0;

View file

@ -2,9 +2,21 @@
#include "WindowsWrapper.h"
enum
{
BACKGROUND_TYPE_STATIONARY = 0, // Doesn't move at all
BACKGROUND_TYPE_MOVE_DISTANT = 1, // Moves at half the speed of the foreground
BACKGROUND_TYPE_MOVE_NEAR = 2, // Moves at the same speed as the foreground
BACKGROUND_TYPE_WATER = 3, // No background - draws a water foreground layer instead
BACKGROUND_TYPE_BLACK = 4, // No background - just black
BACKGROUND_TYPE_AUTOSCROLL = 5, // Constantly scrolls to the left (used by Ironhead)
BACKGROUND_TYPE_OUTSIDE_WITH_WIND = 6, // Fancy parallax scrolling, items are blown to the left (used by bkMoon)
BACKGROUND_TYPE_OUTSIDE = 7 // Fancy parallax scrolling (used by bkFog)
};
typedef struct BACK
{
BOOL flag; // Basically unused
BOOL flag; // Unused - purpose unknown
int partsW;
int partsH;
int numX;

View file

@ -15,6 +15,7 @@
#include "BossX.h"
#include "Bullet.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Draw.h"
#include "Map.h"
#include "MyChar.h"
@ -158,9 +159,9 @@ void HitBossBullet(void)
{
if (gBoss[bos].shock < 14)
{
SetCaret(gBul[bul].x, gBul[bul].y, 11, 0);
SetCaret(gBul[bul].x, gBul[bul].y, 11, 0);
SetCaret(gBul[bul].x, gBul[bul].y, 11, 0);
SetCaret(gBul[bul].x, gBul[bul].y, CARET_HURT_PARTICLES, DIR_LEFT);
SetCaret(gBul[bul].x, gBul[bul].y, CARET_HURT_PARTICLES, DIR_LEFT);
SetCaret(gBul[bul].x, gBul[bul].y, CARET_HURT_PARTICLES, DIR_LEFT);
PlaySoundObject(gBoss[bos_].hit_voice, SOUND_MODE_PLAY);
}
@ -187,7 +188,7 @@ void HitBossBullet(void)
{
if (!(gBul[bul].bbits & 0x10))
{
SetCaret(gBul[bul].x, gBul[bul].y, 2, 2);
SetCaret(gBul[bul].x, gBul[bul].y, CARET_PROJECTILE_DISSIPATION, DIR_RIGHT);
PlaySoundObject(31, SOUND_MODE_PLAY);
gBul[bul].cond = 0;
continue;

View file

@ -385,7 +385,7 @@ void ActBossChar_Frog(void)
else
SetNpChar(NPC_PROJECTILE_BALFROG_SPITBALL, boss->x + 2 * (0x200 * 0x10), boss->y - 8 * 0x200, xm, ym, DIR_LEFT, NULL, 0x100);
PlaySoundObject(SND_ENEMY_SHOOT_PROJETILE, SOUND_MODE_PLAY);
PlaySoundObject(SND_ENEMY_SHOOT_PROJECTILE, SOUND_MODE_PLAY);
if (boss->count1 == 0 || boss->life < boss->tgt_x - 90)
{

View file

@ -6,6 +6,7 @@
#include "Bullet.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Game.h"
#include "Map.h"
#include "NpChar.h"
@ -16,10 +17,10 @@ static void Vanish(BULLET *bul)
if (bul->code_bullet != 37 && bul->code_bullet != 38 && bul->code_bullet != 39)
PlaySoundObject(28, SOUND_MODE_PLAY);
else
SetCaret(bul->x, bul->y, 2, 1);
SetCaret(bul->x, bul->y, CARET_PROJECTILE_DISSIPATION, DIR_UP);
bul->cond = 0;
SetCaret(bul->x, bul->y, 2, 2);
SetCaret(bul->x, bul->y, CARET_PROJECTILE_DISSIPATION, DIR_RIGHT);
}
int JudgeHitBulletBlock(int x, int y, BULLET *bul)
@ -37,7 +38,7 @@ int JudgeHitBulletBlock(int x, int y, BULLET *bul)
if (!(bul->bbits & 0x40))
bul->cond = 0;
SetCaret(bul->x, bul->y, 2, 0);
SetCaret(bul->x, bul->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
PlaySoundObject(12, SOUND_MODE_PLAY);
for (i = 0; i < 4; ++i)

File diff suppressed because it is too large Load diff

View file

@ -4,31 +4,59 @@
#include "WindowsWrapper.h"
#include "CommonDefines.h"
#include "Draw.h"
#include "Game.h"
#include "Triangle.h"
#define CARET_MAX 0x40
struct CARET
{
int cond;
int code;
int direct;
int x;
int y;
int xm;
int ym;
int act_no;
int act_wait;
int ani_no;
int ani_wait;
int view_left;
int view_top;
RECT rect;
};
struct CARET_TABLE
{
int view_left;
int view_top;
};
CARET gCrt[CARET_MAX];
// Sprite offsets
CARET_TABLE gCaretTable[18] = {
{0, 0},
{0x800, 0x800},
{0x1000, 0x1000},
{0x1000, 0x1000},
{0x1000, 0x1000},
{0x800, 0x800},
{0x1000, 0x1000},
{0x800, 0x800},
{0x1000, 0x1000},
{0x1000, 0x1000},
{0x3800, 0x1000},
{0x800, 0x800},
{0x2000, 0x2000},
{0x800, 0x800},
{0x2800, 0x2800},
{0x800, 0x800},
{0x2800, 0x800},
{0x6800, 0x800}
{0, 0}, // CARET_NULL
{ 4 * 0x200, 4 * 0x200}, // CARET_BUBBLE
{ 8 * 0x200, 8 * 0x200}, // CARET_PROJECTILE_DISSIPATION
{ 8 * 0x200, 8 * 0x200}, // CARET_SHOOT
{ 8 * 0x200, 8 * 0x200}, // CARET_SNAKE_AFTERIMAGE
{ 4 * 0x200, 4 * 0x200}, // CARET_ZZZ
{ 8 * 0x200, 8 * 0x200}, // CARET_SNAKE_AFTERIMAGE_DUPLICATE
{ 4 * 0x200, 4 * 0x200}, // CARET_EXHAUST
{ 8 * 0x200, 8 * 0x200}, // CARET_DROWNED_QUOTE
{ 8 * 0x200, 8 * 0x200}, // CARET_QUESTION_MARK
{28 * 0x200, 8 * 0x200}, // CARET_LEVEL_UP
{ 4 * 0x200, 4 * 0x200}, // CARET_HURT_PARTICLES
{16 * 0x200, 16 * 0x200}, // CARET_EXPLOSION
{ 4 * 0x200, 4 * 0x200}, // CARET_TINY_PARTICLES
{20 * 0x200, 20 * 0x200}, // CARET_UNKNOWN
{ 4 * 0x200, 4 * 0x200}, // CARET_PROJECTILE_DISSIPATION_TINY
{20 * 0x200, 4 * 0x200}, // CARET_EMPTY
{52 * 0x200, 4 * 0x200} // CARET_PUSH_JUMP_KEY
};
void InitCaret(void)
@ -36,16 +64,18 @@ void InitCaret(void)
memset(gCrt, 0, sizeof(gCrt));
}
// Null
void ActCaret00(CARET *crt)
{
(void)crt;
}
// Bubble
void ActCaret01(CARET *crt)
{
RECT rcLeft[4] = {
{0, 64, 8, 72},
{8, 64, 16, 72},
{ 0, 64, 8, 72},
{ 8, 64, 16, 72},
{16, 64, 24, 72},
{24, 64, 32, 72},
};
@ -81,16 +111,17 @@ void ActCaret01(CARET *crt)
}
}
if (crt->direct == 0)
if (crt->direct == DIR_LEFT)
crt->rect = rcLeft[crt->ani_no];
else
crt->rect = rcRight[crt->ani_no];
}
// Projectile dissipation
void ActCaret02(CARET *crt)
{
RECT rect_left[4] = {
{0, 32, 16, 48},
{ 0, 32, 16, 48},
{16, 32, 32, 48},
{32, 32, 48, 48},
{48, 32, 64, 48},
@ -104,14 +135,14 @@ void ActCaret02(CARET *crt)
};
RECT rect_up[3] = {
{0, 32, 16, 48},
{ 0, 32, 16, 48},
{32, 32, 48, 48},
{16, 32, 32, 48},
};
switch (crt->direct)
{
case 0:
case DIR_LEFT:
crt->ym -= 0x10;
crt->y += crt->ym;
@ -132,7 +163,7 @@ void ActCaret02(CARET *crt)
crt->rect = rect_left[crt->ani_no];
break;
case 2:
case DIR_RIGHT:
if (++crt->ani_wait > 2)
{
crt->ani_wait = 0;
@ -150,7 +181,7 @@ void ActCaret02(CARET *crt)
crt->rect = rect_right[crt->ani_no];
break;
case 1:
case DIR_UP:
crt->rect = rect_up[++crt->ani_wait / 2 % 3];
if (crt->ani_wait > 24)
@ -160,10 +191,11 @@ void ActCaret02(CARET *crt)
}
}
// Shoot
void ActCaret03(CARET *crt)
{
RECT rect[4] = {
{0, 48, 16, 64},
{ 0, 48, 16, 64},
{16, 48, 32, 64},
{32, 48, 48, 64},
{48, 48, 64, 64},
@ -185,19 +217,21 @@ void ActCaret03(CARET *crt)
crt->rect = rect[crt->ani_no];
}
// Snake after-image? This doesn't seem to be used.
void ActCaret04(CARET *crt)
{
RECT rect[9] = {
{64, 32, 80, 48},
{80, 32, 96, 48},
// Left
{64, 32, 80, 48},
{80, 32, 96, 48},
{96, 32, 112, 48},
{64, 48, 80, 64},
{80, 48, 96, 64},
// Up
{64, 48, 80, 64},
{80, 48, 96, 64},
{96, 48, 112, 64},
{64, 64, 80, 80},
{80, 64, 96, 80},
// Right
{64, 64, 80, 80},
{80, 64, 96, 80},
{96, 64, 112, 80},
};
@ -217,6 +251,7 @@ void ActCaret04(CARET *crt)
crt->rect = rect[(crt->direct * 3) + crt->ani_no];
}
// 'Zzz' - snoring
void ActCaret05(CARET *crt)
{
RECT rect[7] = {
@ -249,15 +284,18 @@ void ActCaret05(CARET *crt)
crt->rect = rect[crt->ani_no];
}
// No ActCaret06...
// Exhaust (used by the Booster and hoverbike)
void ActCaret07(CARET *crt)
{
RECT rcLeft[7] = {
{56, 0, 64, 8},
{64, 0, 72, 8},
{72, 0, 80, 8},
{80, 0, 88, 8},
{88, 0, 96, 8},
{96, 0, 104, 8},
{ 56, 0, 64, 8},
{ 64, 0, 72, 8},
{ 72, 0, 80, 8},
{ 80, 0, 88, 8},
{ 88, 0, 96, 8},
{ 96, 0, 104, 8},
{104, 0, 112, 8},
};
@ -278,32 +316,34 @@ void ActCaret07(CARET *crt)
switch (crt->direct)
{
case 0:
case DIR_LEFT:
crt->x -= 2 * 0x200;
break;
case 1:
case DIR_UP:
crt->y -= 2 * 0x200;
break;
case 2:
case DIR_RIGHT:
crt->x += 2 * 0x200;
break;
case 3:
case DIR_DOWN:
crt->y += 2 * 0x200;
break;
}
}
// Drowned Quote
void ActCaret08(CARET *crt)
{
RECT rcLeft = {16, 80, 32, 96};
RECT rcRight = {32, 80, 48, 96};
if (crt->direct == 0)
if (crt->direct == DIR_LEFT)
crt->rect = rcLeft;
else
crt->rect = rcRight;
}
// The '?' that appears when you press the down key
void ActCaret09(CARET *crt)
{
RECT rcLeft = {0, 80, 16, 96};
@ -315,27 +355,28 @@ void ActCaret09(CARET *crt)
if (crt->ani_wait == 32)
crt->cond = 0;
if (crt->direct == 0)
if (crt->direct == DIR_LEFT)
crt->rect = rcLeft;
else
crt->rect = rcRight;
}
// 'Level Up!'
void ActCaret10(CARET *crt)
{
RECT rcLeft[2] = {
{0, 0, 56, 16},
{0, 0, 56, 16},
{0, 16, 56, 32},
};
RECT rcRight[2] = {
{0, 96, 56, 112},
{0, 96, 56, 112},
{0, 112, 56, 128},
};
++crt->ani_wait;
if (crt->direct == 0)
if (crt->direct == DIR_LEFT)
{
if (crt->ani_wait < 20)
crt->y -= 2 * 0x200;
@ -352,12 +393,13 @@ void ActCaret10(CARET *crt)
crt->cond = 0;
}
if (crt->direct == 0)
if (crt->direct == DIR_LEFT)
crt->rect = rcLeft[crt->ani_wait / 2 % 2];
else
crt->rect = rcRight[crt->ani_wait / 2 % 2];
}
// Red hurt particles (used by bosses and invisible hidden pickups)
void ActCaret11(CARET *crt)
{
unsigned char deg;
@ -374,12 +416,12 @@ void ActCaret11(CARET *crt)
crt->y += crt->ym;
RECT rcRight[7] = {
{56, 8, 64, 16},
{64, 8, 72, 16},
{72, 8, 80, 16},
{80, 8, 88, 16},
{88, 8, 96, 16},
{96, 8, 104, 16},
{ 56, 8, 64, 16},
{ 64, 8, 72, 16},
{ 72, 8, 80, 16},
{ 80, 8, 88, 16},
{ 88, 8, 96, 16},
{ 96, 8, 104, 16},
{104, 8, 112, 16},
};
@ -399,6 +441,7 @@ void ActCaret11(CARET *crt)
crt->rect = rcRight[crt->ani_no];
}
// Missile Launcher explosion flash
void ActCaret12(CARET *crt)
{
RECT rcLeft[2] = {
@ -422,6 +465,7 @@ void ActCaret12(CARET *crt)
crt->rect = rcLeft[crt->ani_no];
}
// Particles used when Quote jumps into the ceiling, and also used by the Demon Crown and Ballos's puppy
void ActCaret13(CARET *crt)
{
RECT rcLeft[2] = {
@ -435,12 +479,12 @@ void ActCaret13(CARET *crt)
switch (crt->direct)
{
case 0:
case DIR_LEFT:
crt->xm = Random(-0x600, 0x600);
crt->ym = Random(-0x200, 0x200);
break;
case 1:
case DIR_UP:
crt->ym = -0x200 * Random(1, 3);
break;
}
@ -448,7 +492,7 @@ void ActCaret13(CARET *crt)
switch (crt->direct)
{
case 0:
case DIR_LEFT:
crt->xm = (crt->xm * 4) / 5;
crt->ym = (crt->ym * 4) / 5;
break;
@ -462,12 +506,16 @@ void ActCaret13(CARET *crt)
crt->rect = rcLeft[crt->ani_wait / 2 % 2];
if (crt->direct == 5)
if (crt->direct == DIR_OTHER)
crt->x -= 4 * 0x200;
}
// Broken (unknown and unused)
void ActCaret14(CARET *crt)
{
// These rects are invalid.
// However, notably, there are 5 unused 40x40 sprites at the bottom of Caret.pbm.
// Perhaps those were originally at these coordinates.
RECT rect[5] = {
{0, 96, 40, 136},
{40, 96, 80, 136},
@ -492,11 +540,12 @@ void ActCaret14(CARET *crt)
crt->rect = rect[crt->ani_no];
}
// Tiny version of the projectile dissipation effect
void ActCaret15(CARET *crt)
{
RECT rcLeft[4] = {
{0, 72, 8, 80},
{8, 72, 16, 80},
{ 0, 72, 8, 80},
{ 8, 72, 16, 80},
{16, 72, 24, 80},
{24, 72, 32, 80},
};
@ -517,10 +566,11 @@ void ActCaret15(CARET *crt)
crt->rect = rcLeft[crt->ani_no];
}
// 'Empty!'
void ActCaret16(CARET *crt)
{
RECT rcLeft[2] = {
{104, 96, 144, 104},
{104, 96, 144, 104},
{104, 104, 144, 112},
};
@ -533,6 +583,7 @@ void ActCaret16(CARET *crt)
crt->rect = rcLeft[crt->ani_wait / 2 % 2];
}
// 'PUSH JUMP KEY!' (unused)
void ActCaret17(CARET *crt)
{
RECT rcLeft[2] = {
@ -558,7 +609,7 @@ CARETFUNCTION gpCaretFuncTbl[18] =
ActCaret03,
ActCaret04,
ActCaret05,
ActCaret04,
ActCaret04, // Interestingly, this slot is a duplicate
ActCaret07,
ActCaret08,
ActCaret09,
@ -569,7 +620,7 @@ CARETFUNCTION gpCaretFuncTbl[18] =
ActCaret14,
ActCaret15,
ActCaret16,
ActCaret17,
ActCaret17
};
void ActCaret(void)

View file

@ -2,35 +2,28 @@
#include "WindowsWrapper.h"
#define CARET_MAX 0x40
struct CARET_TABLE
enum
{
int view_left;
int view_top;
CARET_NULL = 0,
CARET_BUBBLE = 1,
CARET_PROJECTILE_DISSIPATION = 2,
CARET_SHOOT = 3,
CARET_SNAKE_AFTERIMAGE = 4,
CARET_ZZZ = 5,
CARET_SNAKE_AFTERIMAGE_DUPLICATE = 6,
CARET_EXHAUST = 7,
CARET_DROWNED_QUOTE = 8,
CARET_QUESTION_MARK = 9,
CARET_LEVEL_UP = 10,
CARET_HURT_PARTICLES = 11,
CARET_EXPLOSION = 12,
CARET_TINY_PARTICLES = 13,
CARET_UNKNOWN = 14,
CARET_PROJECTILE_DISSIPATION_TINY = 15,
CARET_EMPTY = 16,
CARET_PUSH_JUMP_KEY = 17
};
struct CARET
{
int cond;
int code;
int direct;
int x;
int y;
int xm;
int ym;
int act_no;
int act_wait;
int ani_no;
int ani_wait;
int view_left;
int view_top;
RECT rect;
};
extern CARET gCrt[CARET_MAX];
extern CARET_TABLE gCaretTable[18];
void InitCaret(void);
void ActCaret(void);
void PutCaret(int fx, int fy);

View file

@ -18,7 +18,8 @@ enum Direction
DIR_UP = 1,
DIR_RIGHT = 2,
DIR_DOWN = 3,
DIR_AUTO = 4
DIR_AUTO = 4,
DIR_OTHER = 5
};
struct OTHER_RECT // The original name for this struct is unknown

View file

@ -12,10 +12,10 @@
const char* const gConfigName = "Config.dat";
const char* const gProof = "DOUKUTSU20041206";
BOOL LoadConfigData(CONFIG *conf)
BOOL LoadConfigData(CONFIGDATA *conf)
{
// Clear old configuration data
memset(conf, 0, sizeof(CONFIG));
memset(conf, 0, sizeof(CONFIGDATA));
// Get path
std::string path = gModulePath + '/' + gConfigName;
@ -48,17 +48,17 @@ BOOL LoadConfigData(CONFIG *conf)
// Check if version is not correct, and return if it failed
if (strcmp(conf->proof, gProof))
{
memset(conf, 0, sizeof(CONFIG));
memset(conf, 0, sizeof(CONFIGDATA));
return FALSE;
}
return TRUE;
}
void DefaultConfigData(CONFIG *conf)
void DefaultConfigData(CONFIGDATA *conf)
{
// Clear old configuration data
memset(conf, 0, sizeof(CONFIG));
memset(conf, 0, sizeof(CONFIGDATA));
// Fun fact: The Linux port added this line:
// conf->display_mode = 1;

View file

@ -2,7 +2,7 @@
#include "WindowsWrapper.h"
struct CONFIG
struct CONFIGDATA
{
char proof[0x20];
char font_name[0x40];
@ -17,5 +17,5 @@ struct CONFIG
extern const char* const gConfigName;
extern const char* const gProof;
BOOL LoadConfigData(CONFIG *conf);
void DefaultConfigData(CONFIG *conf);
BOOL LoadConfigData(CONFIGDATA *conf);
void DefaultConfigData(CONFIGDATA *conf);

View file

@ -17,7 +17,7 @@ BOOL InitDirectInput(void)
return ControllerBackend_Init();
}
BOOL GetJoystickStatus(JOYSTICK_STATUS *status)
BOOL GetJoystickStatus(DIRECTINPUTSTATUS *status)
{
bool *buttons;
unsigned int button_count;

View file

@ -2,7 +2,7 @@
#include "WindowsWrapper.h"
struct JOYSTICK_STATUS
struct DIRECTINPUTSTATUS
{
BOOL bLeft;
BOOL bRight;
@ -13,5 +13,5 @@ struct JOYSTICK_STATUS
void ReleaseDirectInput(void);
BOOL InitDirectInput(void);
BOOL GetJoystickStatus(JOYSTICK_STATUS *status);
BOOL GetJoystickStatus(DIRECTINPUTSTATUS *status);
BOOL ResetJoystickStatus(void);

View file

@ -108,7 +108,7 @@ int main(int argc, char *argv[])
// Get path of the data folder
gDataPath = gModulePath + "/data";
CONFIG conf;
CONFIGDATA conf;
if (!LoadConfigData(&conf))
DefaultConfigData(&conf);
@ -578,7 +578,7 @@ BOOL SystemTask(void)
void JoystickProc(void)
{
int i;
JOYSTICK_STATUS status;
DIRECTINPUTSTATUS status;
if (!GetJoystickStatus(&status))
return;

View file

@ -7,6 +7,7 @@
#include "ArmsItem.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Draw.h"
#include "Flags.h"
#include "Game.h"
@ -494,9 +495,9 @@ void ActMyChar_Normal(BOOL bKey)
if (gKeyTrg & gKeyJump || gMC.boost_cnt % 3 == 1)
{
if (gMC.direct == 0)
SetCaret(gMC.x + (2 * 0x200), gMC.y + (2 * 0x200), 7, 2);
SetCaret(gMC.x + (2 * 0x200), gMC.y + (2 * 0x200), CARET_EXHAUST, DIR_RIGHT);
if (gMC.direct == 2)
SetCaret(gMC.x - (2 * 0x200), gMC.y + (2 * 0x200), 7, 0);
SetCaret(gMC.x - (2 * 0x200), gMC.y + (2 * 0x200), CARET_EXHAUST, DIR_LEFT);
PlaySoundObject(113, SOUND_MODE_PLAY);
}
@ -509,14 +510,14 @@ void ActMyChar_Normal(BOOL bKey)
// Boost particles (and sound)
if (gKeyTrg & gKeyJump || gMC.boost_cnt % 3 == 1)
{
SetCaret(gMC.x, gMC.y + (6 * 0x200), 7, 3);
SetCaret(gMC.x, gMC.y + (6 * 0x200), CARET_EXHAUST, DIR_DOWN);
PlaySoundObject(113, SOUND_MODE_PLAY);
}
}
else if (gMC.boost_sw == 3 && (gKeyTrg & gKeyJump || gMC.boost_cnt % 3 == 1))
{
// Boost particles (and sound)
SetCaret(gMC.x, gMC.y - (6 * 0x200), 7, 1);
SetCaret(gMC.x, gMC.y - (6 * 0x200), CARET_EXHAUST, DIR_UP);
PlaySoundObject(113, SOUND_MODE_PLAY);
}
}
@ -533,7 +534,7 @@ void ActMyChar_Normal(BOOL bKey)
if (gMC.boost_cnt % 3 == 0)
{
SetCaret(gMC.x, gMC.y + (gMC.hit.bottom / 2), 7, 3);
SetCaret(gMC.x, gMC.y + (gMC.hit.bottom / 2), CARET_EXHAUST, DIR_DOWN);
PlaySoundObject(113, SOUND_MODE_PLAY);
}
@ -758,9 +759,9 @@ void ActMyChar_Stream(BOOL bKey)
}
if (gMC.ym < -0x200 && gMC.flag & 2)
SetCaret(gMC.x, gMC.y - gMC.hit.top, 13, 5);
SetCaret(gMC.x, gMC.y - gMC.hit.top, CARET_TINY_PARTICLES, DIR_OTHER);
if (gMC.ym > 0x200 && gMC.flag & 8)
SetCaret(gMC.x, gMC.y + gMC.hit.bottom, 13, 5);
SetCaret(gMC.x, gMC.y + gMC.hit.bottom, CARET_TINY_PARTICLES, DIR_OTHER);
if (gMC.xm > 0x400)
gMC.xm = 0x400;
@ -836,9 +837,9 @@ void AirProcess(void)
StartTextScript(41);
if (gMC.direct == 0)
SetCaret(gMC.x, gMC.y, 8, 0);
SetCaret(gMC.x, gMC.y, CARET_DROWNED_QUOTE, DIR_LEFT);
else
SetCaret(gMC.x, gMC.y, 8, 2);
SetCaret(gMC.x, gMC.y, CARET_DROWNED_QUOTE, DIR_RIGHT);
gMC.cond &= ~0x80;
}

View file

@ -5,6 +5,7 @@
#include "Back.h"
#include "Boss.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Game.h"
#include "KeyControl.h"
#include "Map.h"
@ -24,8 +25,8 @@ static void PutlittleStar(void)
if (!(gMC.cond & 2) && gMC.ym < -0x200)
{
PlaySoundObject(3, SOUND_MODE_PLAY);
SetCaret(gMC.x, gMC.y - gMC.hit.top, 13, 0);
SetCaret(gMC.x, gMC.y - gMC.hit.top, 13, 0);
SetCaret(gMC.x, gMC.y - gMC.hit.top, CARET_TINY_PARTICLES, DIR_LEFT);
SetCaret(gMC.x, gMC.y - gMC.hit.top, CARET_TINY_PARTICLES, DIR_LEFT);
}
}
@ -853,7 +854,7 @@ void HitMyCharNpChar(void)
// Create question mark when NPC hasn't been interacted with
if (gMC.ques)
SetCaret(gMC.x, gMC.y, 9, 0);
SetCaret(gMC.x, gMC.y, CARET_QUESTION_MARK, DIR_LEFT);
}
void HitMyCharBoss(void)
@ -913,5 +914,5 @@ void HitMyCharBoss(void)
}
if (gMC.ques)
SetCaret(gMC.x, gMC.y, 9, 0);
SetCaret(gMC.x, gMC.y, CARET_QUESTION_MARK, DIR_LEFT);
}

View file

@ -69,7 +69,7 @@ void AddExpMyChar(int x)
if (gArmsData[gSelectedArms].code != 13)
{
PlaySoundObject(27, SOUND_MODE_PLAY);
SetCaret(gMC.x, gMC.y, 10, 0);
SetCaret(gMC.x, gMC.y, CARET_LEVEL_UP, DIR_LEFT);
}
}
}
@ -159,7 +159,7 @@ void DamageMyChar(int damage)
gArmsData[gSelectedArms].exp = gArmsLevelTable[arms_code].exp[lv] + gArmsData[gSelectedArms].exp;
if (gMC.life > 0 && gArmsData[gSelectedArms].code != 13)
SetCaret(gMC.x, gMC.y, 10, 2);
SetCaret(gMC.x, gMC.y, CARET_LEVEL_UP, DIR_RIGHT);
}
else
{

View file

@ -9,6 +9,7 @@
#include "ArmsItem.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Draw.h"
#include "File.h"
#include "Flags.h"
@ -170,7 +171,7 @@ void SetDestroyNpChar(int x, int y, int w, int num)
}
// Flash effect
SetCaret(x, y, 12, 0);
SetCaret(x, y, CARET_EXPLOSION, DIR_LEFT);
}
void SetDestroyNpCharUp(int x, int y, int w, int num)
@ -189,7 +190,7 @@ void SetDestroyNpCharUp(int x, int y, int w, int num)
}
// Flash effect
SetCaret(x, y, 12, 0);
SetCaret(x, y, CARET_EXPLOSION, DIR_LEFT);
}
void SetExpObjects(int x, int y, int exp)

View file

@ -6,6 +6,7 @@
#include "Back.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "Map.h"
@ -17,7 +18,7 @@
// Null
void ActNpc000(NPCHAR *npc)
{
RECT rect = {0x00, 0x00, 0x10, 0x10};
RECT rect = {0, 0, 16, 16};
if (npc->act_no == 0)
{
@ -34,7 +35,7 @@ void ActNpc000(NPCHAR *npc)
void ActNpc001(NPCHAR *npc)
{
// In wind
if (gBack.type == 5 || gBack.type == 6)
if (gBack.type == BACKGROUND_TYPE_AUTOSCROLL || gBack.type == BACKGROUND_TYPE_OUTSIDE_WITH_WIND)
{
if (npc->act_no == 0)
{
@ -144,12 +145,12 @@ void ActNpc001(NPCHAR *npc)
// Get framerects
RECT rect[6] = {
{0x00, 0x10, 0x10, 0x20},
{0x10, 0x10, 0x20, 0x20},
{0x20, 0x10, 0x30, 0x20},
{0x30, 0x10, 0x40, 0x20},
{0x40, 0x10, 0x50, 0x20},
{0x50, 0x10, 0x60, 0x20},
{ 0, 16, 16, 32},
{16, 16, 32, 32},
{32, 16, 48, 32},
{48, 16, 64, 32},
{64, 16, 80, 32},
{80, 16, 96, 32},
};
RECT rcNo = {0, 0, 0, 0};
@ -214,21 +215,21 @@ void ActNpc002(NPCHAR *npc)
{
// Rects
RECT rcLeft[7] = {
{32, 0, 64, 24},
{0, 0, 32, 24},
{32, 0, 64, 24},
{64, 0, 96, 24},
{96, 0, 128, 24},
{ 32, 0, 64, 24},
{ 0, 0, 32, 24},
{ 32, 0, 64, 24},
{ 64, 0, 96, 24},
{ 96, 0, 128, 24},
{128, 0, 160, 24},
{160, 0, 192, 24},
};
RECT rcRight[7] = {
{32, 24, 64, 48},
{0, 24, 32, 48},
{32, 24, 64, 48},
{64, 24, 96, 48},
{96, 24, 128, 48},
{ 32, 24, 64, 48},
{ 0, 24, 32, 48},
{ 32, 24, 64, 48},
{ 64, 24, 96, 48},
{ 96, 24, 128, 48},
{128, 24, 160, 48},
{160, 24, 192, 48},
};
@ -346,20 +347,20 @@ void ActNpc003(NPCHAR *npc)
void ActNpc004(NPCHAR *npc)
{
RECT rcLeft[8] = {
{16, 0, 17, 1},
{16, 0, 32, 16},
{32, 0, 48, 16},
{48, 0, 64, 16},
{64, 0, 80, 16},
{80, 0, 96, 16},
{96, 0, 112, 16},
{ 16, 0, 17, 1},
{ 16, 0, 32, 16},
{ 32, 0, 48, 16},
{ 48, 0, 64, 16},
{ 64, 0, 80, 16},
{ 80, 0, 96, 16},
{ 96, 0, 112, 16},
{112, 0, 128, 16},
};
RECT rcUp[8] = {
{16, 0, 17, 1},
{80, 48, 96, 64},
{0, 128, 16, 144},
{16, 0, 17, 1},
{80, 48, 96, 64},
{ 0, 128, 16, 144},
{16, 128, 32, 144},
{32, 128, 48, 144},
{48, 128, 64, 144},
@ -423,13 +424,13 @@ void ActNpc004(NPCHAR *npc)
void ActNpc005(NPCHAR *npc)
{
RECT rcLeft[3] = {
{0, 48, 16, 64},
{ 0, 48, 16, 64},
{16, 48, 32, 64},
{32, 48, 48, 64},
};
RECT rcRight[3] = {
{0, 64, 16, 80},
{ 0, 64, 16, 80},
{16, 64, 32, 80},
{32, 64, 48, 80},
};
@ -532,7 +533,7 @@ void ActNpc005(NPCHAR *npc)
void ActNpc006(NPCHAR *npc)
{
RECT rcLeft[5] = {
{0, 80, 16, 96},
{ 0, 80, 16, 96},
{16, 80, 32, 96},
{32, 80, 48, 96},
{48, 80, 64, 96},
@ -540,7 +541,7 @@ void ActNpc006(NPCHAR *npc)
};
RECT rcRight[5] = {
{0, 96, 16, 112},
{ 0, 96, 16, 112},
{16, 96, 32, 112},
{32, 96, 48, 112},
{48, 96, 64, 112},
@ -656,21 +657,21 @@ void ActNpc006(NPCHAR *npc)
void ActNpc007(NPCHAR *npc)
{
RECT rcLeft[3] = {
{256, 64, 288, 80},
{256, 80, 288, 96},
{256, 64, 288, 80},
{256, 80, 288, 96},
{256, 96, 288, 112},
};
RECT rcRight[3] = {
{288, 64, 320, 80},
{288, 80, 320, 96},
{288, 64, 320, 80},
{288, 80, 320, 96},
{288, 96, 320, 112},
};
switch (npc->act_no)
{
case 0:
npc->x = gMC.x;
npc->x = gMC.x; // Spawn beneath player
if (npc->direct == 0)
npc->act_no = 1;
@ -679,12 +680,14 @@ void ActNpc007(NPCHAR *npc)
break;
case 1:
case 1: // Going left
npc->xm -= 0x40;
// Turn around if far enough away from the player
if (npc->x < gMC.x - (192 * 0x200))
npc->act_no = 2;
// Turn around if touching a wall
if (npc->flag & 1)
{
npc->xm = 0;
@ -693,12 +696,14 @@ void ActNpc007(NPCHAR *npc)
break;
case 2:
case 2: // Going right
npc->xm += 0x40;
// Turn around if far enough away from the player
if (npc->x > gMC.x + (192 * 0x200))
npc->act_no = 1;
// Turn around if touching a wall
if (npc->flag & 4)
{
npc->xm = 0;
@ -708,27 +713,33 @@ void ActNpc007(NPCHAR *npc)
break;
}
// Face direction Bazil is moving
if (npc->xm < 0)
npc->direct = 0;
else
npc->direct = 2;
// Cap speed
if (npc->xm > 0x5FF)
npc->xm = 0x5FF;
if (npc->xm < -0x5FF)
npc->xm = -0x5FF;
// Apply momentum
npc->x += npc->xm;
// Increment animation
if (++npc->ani_wait > 1)
{
npc->ani_wait = 0;
++npc->ani_no;
}
// Loop animation
if (npc->ani_no > 2)
npc->ani_no = 0;
// Update sprite
if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
else
@ -739,12 +750,12 @@ void ActNpc007(NPCHAR *npc)
void ActNpc008(NPCHAR *npc)
{
RECT rcLeft[2] = {
{80, 80, 96, 96},
{80, 80, 96, 96},
{96, 80, 112, 96},
};
RECT rcRight[2] = {
{80, 96, 96, 112},
{80, 96, 96, 112},
{96, 96, 112, 112},
};
@ -1041,7 +1052,7 @@ void ActNpc011(NPCHAR *npc)
if (npc->flag & 0xFF)
{
npc->cond = 0;
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
npc->y += npc->ym;
@ -1065,7 +1076,7 @@ void ActNpc011(NPCHAR *npc)
if (++npc->count1 > 150)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}

View file

@ -5,6 +5,7 @@
#include "WindowsWrapper.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Game.h"
#include "Frame.h"
#include "MyChar.h"
@ -803,7 +804,7 @@ void ActNpc030(NPCHAR *npc)
if (++npc->act_wait > 100)
{
npc->act_wait = 0;
SetCaret(npc->x, npc->y - (2 * 0x200), 5, 0);
SetCaret(npc->x, npc->y - (2 * 0x200), CARET_ZZZ, DIR_LEFT);
}
}
@ -970,7 +971,7 @@ void ActNpc033(NPCHAR *npc)
{
if (npc->flag & 5)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
else if (npc->flag & 8)
@ -1000,7 +1001,7 @@ void ActNpc033(NPCHAR *npc)
if (++npc->act_wait > 250)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}

View file

@ -819,7 +819,7 @@ void ActNpc048(NPCHAR *npc)
if (++npc->count1 > 2 || npc->direct == 2)
{
VanishNpChar(npc);
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
else
{
@ -856,7 +856,7 @@ void ActNpc048(NPCHAR *npc)
if (++npc->act_wait > 750)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
@ -1064,7 +1064,7 @@ void ActNpc050(NPCHAR *npc)
{
if (++npc->count1 > 1)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}

View file

@ -637,7 +637,7 @@ void ActNpc084(NPCHAR *npc)
{
if (npc->flag & 0xFF)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
@ -664,7 +664,7 @@ void ActNpc084(NPCHAR *npc)
if (++npc->count1 > 300)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}
@ -737,7 +737,7 @@ void ActNpc086(NPCHAR *npc)
npc->ani_no = 0;
}
if (gBack.type == 5 || gBack.type == 6)
if (gBack.type == BACKGROUND_TYPE_AUTOSCROLL || gBack.type == BACKGROUND_TYPE_OUTSIDE_WITH_WIND)
{
if (npc->act_no == 0)
{
@ -818,7 +818,7 @@ void ActNpc087(NPCHAR *npc)
npc->ani_no = 0;
}
if (gBack.type == 5 || gBack.type == 6)
if (gBack.type == BACKGROUND_TYPE_AUTOSCROLL || gBack.type == BACKGROUND_TYPE_OUTSIDE_WITH_WIND)
{
if (npc->act_no == 0)
{
@ -1410,7 +1410,7 @@ void ActNpc093(NPCHAR *npc)
if (++npc->act_wait > 200)
{
npc->act_wait = 0;
SetCaret(npc->x, npc->y, 5, 0);
SetCaret(npc->x, npc->y, CARET_ZZZ, DIR_LEFT);
}
break;

View file

@ -6,6 +6,7 @@
#include "Bullet.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "MyChar.h"
@ -500,7 +501,7 @@ void ActNpc108(NPCHAR *npc)
{
if (npc->flag & 0xFF)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
@ -526,7 +527,7 @@ void ActNpc108(NPCHAR *npc)
if (++npc->count1 > 300)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}

View file

@ -7,6 +7,7 @@
#include "Bullet.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "KeyControl.h"
@ -75,7 +76,7 @@ void ActNpc121(NPCHAR *npc)
if (++npc->act_wait > 100)
{
npc->act_wait = 0;
SetCaret(npc->x, npc->y, 5, 0);
SetCaret(npc->x, npc->y, CARET_ZZZ, DIR_LEFT);
}
}
}
@ -285,7 +286,7 @@ void ActNpc123(NPCHAR *npc)
{
case 0:
npc->act_no = 1;
SetCaret(npc->x, npc->y, 3, 0);
SetCaret(npc->x, npc->y, CARET_SHOOT, DIR_LEFT);
PlaySoundObject(32, SOUND_MODE_PLAY);
switch (npc->direct)
@ -345,7 +346,7 @@ void ActNpc123(NPCHAR *npc)
if (bBreak)
{
SetCaret(npc->x, npc->y, 2, 2);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_RIGHT);
PlaySoundObject(28, SOUND_MODE_PLAY);
npc->cond = 0;
}
@ -819,7 +820,7 @@ void ActNpc131(NPCHAR *npc)
if (++npc->act_wait > 100)
{
npc->act_wait = 0;
SetCaret(npc->x, npc->y, 5, 0);
SetCaret(npc->x, npc->y, CARET_ZZZ, DIR_LEFT);
}
if (npc->direct == 0)

View file

@ -413,7 +413,7 @@ void ActNpc141(NPCHAR *npc)
{
npc->act_no = 20;
npc->act_wait = 0;
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
PlaySoundObject(12, SOUND_MODE_PLAY);
for (i = 0; i < 4; ++i)
@ -952,7 +952,7 @@ void ActNpc148(NPCHAR *npc)
{
if (npc->flag & 0xFF)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
@ -971,7 +971,7 @@ void ActNpc148(NPCHAR *npc)
if (++npc->count1 > 300)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}
@ -1734,7 +1734,7 @@ void ActNpc156(NPCHAR *npc)
{
if (npc->flag & 0xFF)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
@ -1754,7 +1754,7 @@ void ActNpc156(NPCHAR *npc)
if (++npc->count1 > 300)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}
@ -1956,7 +1956,7 @@ void ActNpc158(NPCHAR *npc)
if (++npc->ani_wait > 2)
{
npc->ani_wait = 0;
SetCaret(npc->x, npc->y, 7, 4);
SetCaret(npc->x, npc->y, CARET_EXHAUST, DIR_AUTO);
}
npc->ani_no = (npc->count1 + 0x10) / 0x20;

View file

@ -896,14 +896,14 @@ void ActNpc170(NPCHAR *npc)
npc->xm -= 0x20;
if (npc->count1 % 3 == 1)
SetCaret(npc->x + (8 * 0x200), npc->y, 7, 2);
SetCaret(npc->x + (8 * 0x200), npc->y, CARET_EXHAUST, DIR_RIGHT);
}
else
{
npc->xm += 0x20;
if (npc->count1 % 3 == 1)
SetCaret(npc->x - (8 * 0x200), npc->y, 7, 0);
SetCaret(npc->x - (8 * 0x200), npc->y, CARET_EXHAUST, DIR_LEFT);
}
if (npc->count1 < 50)
@ -1056,7 +1056,7 @@ void ActNpc172(NPCHAR *npc)
if (npc->flag & 1 || npc->flag & 4)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
VanishNpChar(npc);
return;
}
@ -1294,7 +1294,7 @@ void ActNpc174(NPCHAR *npc)
{
if (++npc->count1 > 1)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}
@ -1474,7 +1474,7 @@ void ActNpc177(NPCHAR *npc)
if (npc->flag & 0xFF)
{
SetCaret(npc->x, npc->y, 3, 0);
SetCaret(npc->x, npc->y, CARET_SHOOT, DIR_LEFT);
npc->cond = 0;
return;
}
@ -1521,7 +1521,7 @@ void ActNpc177(NPCHAR *npc)
if (++npc->act_wait > 300)
{
SetCaret(npc->x, npc->y, 3, 0);
SetCaret(npc->x, npc->y, CARET_SHOOT, DIR_LEFT);
npc->cond = 0;
return;
}
@ -1564,7 +1564,7 @@ void ActNpc178(NPCHAR *npc)
{
if (npc->flag & 0xFF)
{
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
@ -1599,7 +1599,7 @@ void ActNpc178(NPCHAR *npc)
if (++npc->count1 > 150)
{
VanishNpChar(npc);
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
}
@ -1609,7 +1609,7 @@ void ActNpc179(NPCHAR *npc)
if (npc->flag & 0xFF)
{
npc->cond = 0;
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
npc->xm -= 0x20;
@ -1641,6 +1641,6 @@ void ActNpc179(NPCHAR *npc)
if (++npc->count1 > 300)
{
VanishNpChar(npc);
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
}

View file

@ -7,6 +7,7 @@
#include "Back.h"
#include "Bullet.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Flags.h"
#include "Frame.h"
#include "Game.h"
@ -386,12 +387,12 @@ void ActNpc181(NPCHAR *npc)
if (npc->direct == 0)
{
SetBullet(12, npc->x - (4 * 0x200), npc->y + (3 * 0x200), 0);
SetCaret(npc->x - (4 * 0x200), npc->y + (3 * 0x200), 3, 0);
SetCaret(npc->x - (4 * 0x200), npc->y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(12, npc->x + (4 * 0x200), npc->y + (3 * 0x200), 2);
SetCaret(npc->x + (4 * 0x200), npc->y + (3 * 0x200), 3, 0);
SetCaret(npc->x + (4 * 0x200), npc->y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@ -399,12 +400,12 @@ void ActNpc181(NPCHAR *npc)
if (npc->direct == 0)
{
SetBullet(12, npc->x - (2 * 0x200), npc->y - (4 * 0x200), 1);
SetCaret(npc->x - (2 * 0x200), npc->y - (4 * 0x200), 3, 0);
SetCaret(npc->x - (2 * 0x200), npc->y - (4 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(12, npc->x + (2 * 0x200), npc->y - (4 * 0x200), 1);
SetCaret(npc->x + (2 * 0x200), npc->y - (4 * 0x200), 3, 0);
SetCaret(npc->x + (2 * 0x200), npc->y - (4 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
}
@ -493,12 +494,12 @@ void ActNpc182(NPCHAR *npc)
if (npc->direct == 0)
{
SetBullet(6, npc->x - (4 * 0x200), npc->y + (3 * 0x200), 0);
SetCaret(npc->x - (4 * 0x200), npc->y + (3 * 0x200), 3, 0);
SetCaret(npc->x - (4 * 0x200), npc->y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(6, npc->x + (4 * 0x200), npc->y + (3 * 0x200), 2);
SetCaret(npc->x + (4 * 0x200), npc->y + (3 * 0x200), 3, 0);
SetCaret(npc->x + (4 * 0x200), npc->y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@ -506,12 +507,12 @@ void ActNpc182(NPCHAR *npc)
if (npc->direct == 0)
{
SetBullet(6, npc->x - (2 * 0x200), npc->y - (4 * 0x200), 1);
SetCaret(npc->x - (2 * 0x200), npc->y - (4 * 0x200), 3, 0);
SetCaret(npc->x - (2 * 0x200), npc->y - (4 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(6, npc->x + (2 * 0x200), npc->y - (4 * 0x200), 1);
SetCaret(npc->x + (2 * 0x200), npc->y - (4 * 0x200), 3, 0);
SetCaret(npc->x + (2 * 0x200), npc->y - (4 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
}
@ -1184,9 +1185,9 @@ void ActNpc192(NPCHAR *npc)
PlaySoundObject(34, SOUND_MODE_PLAY);
if (npc->direct == 0)
SetCaret(npc->x + (10 * 0x200), npc->y + (10 * 0x200), 7, 2);
SetCaret(npc->x + (10 * 0x200), npc->y + (10 * 0x200), CARET_EXHAUST, DIR_RIGHT);
else
SetCaret(npc->x - (10 * 0x200), npc->y + (10 * 0x200), 7, 0);
SetCaret(npc->x - (10 * 0x200), npc->y + (10 * 0x200), CARET_EXHAUST, DIR_LEFT);
}
RECT rcLeft[2] = {

View file

@ -6,6 +6,7 @@
#include "Bullet.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "MyChar.h"
@ -163,7 +164,7 @@ void ActNpc202(NPCHAR *npc)
if (npc->flag & 0xFF)
{
npc->cond = 0;
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
npc->y += npc->ym;
@ -189,7 +190,7 @@ void ActNpc202(NPCHAR *npc)
if (++npc->count1 > 300)
{
npc->cond = 0;
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
}
@ -750,7 +751,7 @@ void ActNpc209(NPCHAR *npc)
if (npc->flag & 0xFF)
{
npc->cond = 0;
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
npc->y += npc->ym;
@ -777,7 +778,7 @@ void ActNpc209(NPCHAR *npc)
if (++npc->count1 > 300)
{
npc->cond = 0;
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
}

View file

@ -5,6 +5,7 @@
#include "WindowsWrapper.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Game.h"
#include "MyChar.h"
#include "NpChar.h"
@ -617,9 +618,9 @@ void ActNpc231(NPCHAR *npc)
++npc->act_wait;
if (npc->act_wait % 2 == 0)
SetCaret(npc->x - (10 * 0x200), npc->y + (8 * 0x200), 7, 3);
SetCaret(npc->x - (10 * 0x200), npc->y + (8 * 0x200), CARET_EXHAUST, DIR_DOWN);
if (npc->act_wait % 2 == 1)
SetCaret(npc->x + (10 * 0x200), npc->y + (8 * 0x200), 7, 3);
SetCaret(npc->x + (10 * 0x200), npc->y + (8 * 0x200), CARET_EXHAUST, DIR_DOWN);
if (npc->act_wait % 4 == 1)
PlaySoundObject(34, SOUND_MODE_PLAY);
@ -647,10 +648,10 @@ void ActNpc231(NPCHAR *npc)
if (npc->ym < 0)
{
if (npc->act_wait % 8 == 0)
SetCaret(npc->x - (10 * 0x200), npc->y + (8 * 0x200), 7, 3);
SetCaret(npc->x - (10 * 0x200), npc->y + (8 * 0x200), CARET_EXHAUST, DIR_DOWN);
if (npc->act_wait % 8 == 4)
SetCaret(npc->x + (10 * 0x200), npc->y + (8 * 0x200), 7, 3);
SetCaret(npc->x + (10 * 0x200), npc->y + (8 * 0x200), CARET_EXHAUST, DIR_DOWN);
if (npc->act_wait % 16 == 1)
PlaySoundObject(34, SOUND_MODE_PLAY);
@ -1153,7 +1154,7 @@ void ActNpc237(NPCHAR *npc)
if (bHit)
{
for (i = 0; i < 5; ++i)
SetCaret(npc->x, npc->y, 1, 0);
SetCaret(npc->x, npc->y, CARET_BUBBLE, DIR_LEFT);
PlaySoundObject(21, SOUND_MODE_PLAY);
npc->cond = 0;

View file

@ -5,6 +5,7 @@
#include "WindowsWrapper.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "Map.h"
@ -338,7 +339,7 @@ void ActNpc244(NPCHAR *npc)
if (bHit)
{
for (i = 0; i < 3; ++i)
SetCaret(npc->x, npc->y + (4 * 0x200), 1, 2);
SetCaret(npc->x, npc->y + (4 * 0x200), CARET_BUBBLE, DIR_RIGHT);
if (npc->x > gMC.x - (256 * 0x200) && npc->x < gMC.x + (256 * 0x200) && npc->y > gMC.y - (160 * 0x200) && npc->y < gMC.y + (160 * 0x200))
PlaySoundObject(21, SOUND_MODE_PLAY);
@ -831,7 +832,7 @@ void ActNpc248(NPCHAR *npc)
if (npc->flag & 0xFF)
{
npc->cond = 0;
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
npc->y += npc->ym;
@ -856,7 +857,7 @@ void ActNpc248(NPCHAR *npc)
if (++npc->count1 > 300)
{
npc->cond = 0;
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
}

View file

@ -5,6 +5,7 @@
#include "WindowsWrapper.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "Map.h"
@ -1527,15 +1528,15 @@ void ActNpc271(NPCHAR *npc)
if (npc->ym < 0 && npc->y - npc->hit.top < 8 * 0x200)
{
npc->ym *= -1;
SetCaret(npc->x, npc->y - (8 * 0x200), 13, 0);
SetCaret(npc->x, npc->y - (8 * 0x200), 13, 0);
SetCaret(npc->x, npc->y - (8 * 0x200), CARET_TINY_PARTICLES, DIR_LEFT);
SetCaret(npc->x, npc->y - (8 * 0x200), CARET_TINY_PARTICLES, DIR_LEFT);
}
if (npc->ym > 0 && npc->y + npc->hit.bottom > 232 * 0x200)
{
npc->ym *= -1;
SetCaret(npc->x, npc->y + (8 * 0x200), 13, 0);
SetCaret(npc->x, npc->y + (8 * 0x200), 13, 0);
SetCaret(npc->x, npc->y + (8 * 0x200), CARET_TINY_PARTICLES, DIR_LEFT);
SetCaret(npc->x, npc->y + (8 * 0x200), CARET_TINY_PARTICLES, DIR_LEFT);
}
npc->x += npc->xm;

View file

@ -7,6 +7,7 @@
#include "Boss.h"
#include "Bullet.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "Map.h"
@ -27,7 +28,7 @@ void ActNpc300(NPCHAR *npc)
}
if (++npc->ani_wait % 8 == 1)
SetCaret(npc->x + (Random(-8, 8) * 0x200), npc->y + (8 * 0x200), 13, 1);
SetCaret(npc->x + (Random(-8, 8) * 0x200), npc->y + (8 * 0x200), CARET_TINY_PARTICLES, DIR_UP);
npc->rect = rc;
}
@ -89,7 +90,7 @@ void ActNpc301(NPCHAR *npc)
if (++npc->ani_wait > 2)
{
npc->ani_wait = 0;
SetCaret(npc->x, npc->y, 7, 4);
SetCaret(npc->x, npc->y, CARET_EXHAUST, DIR_AUTO);
}
npc->ani_no = (npc->count1 + 0x10) / 0x20;

View file

@ -6,6 +6,7 @@
#include "Bullet.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "KeyControl.h"
@ -167,7 +168,7 @@ void ActNpc321(NPCHAR *npc)
if (g_GameFlags & 2 && CountBulletNum(43) < 2 && gKeyTrg & gKeyShot)
{
SetBullet(43, npc->pNpc->x, npc->pNpc->y, direct);
SetCaret(npc->pNpc->x, npc->pNpc->y, 3, 0);
SetCaret(npc->pNpc->x, npc->pNpc->y, CARET_SHOOT, DIR_LEFT);
PlaySoundObject(117, SOUND_MODE_PLAY);
}
@ -767,7 +768,7 @@ void ActNpc331(NPCHAR *npc)
if (npc->flag & 8)
{
npc->cond = 0;
SetCaret(npc->x, npc->y, 2, 0);
SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
break;

View file

@ -1917,7 +1917,7 @@ void ActNpc357(NPCHAR *npc)
}
if (npc->act_wait % 8 == 1)
SetCaret(npc->x + (Random(-8, 8) * 0x200), npc->y + 0x1000, 13, 1);
SetCaret(npc->x + (Random(-8, 8) * 0x200), npc->y + 0x1000, CARET_TINY_PARTICLES, DIR_UP);
}
// Misery (stood in the wind during the credits)

View file

@ -5,6 +5,7 @@
#include "Back.h"
#include "Bullet.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "Flags.h"
#include "Game.h"
#include "Map.h"
@ -591,9 +592,9 @@ void HitNpCharBullet(void)
{
if (gNPC[n].shock < 14)
{
SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, 11, 0);
SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, 11, 0);
SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, 11, 0);
SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, CARET_HURT_PARTICLES, DIR_LEFT);
SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, CARET_HURT_PARTICLES, DIR_LEFT);
SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, CARET_HURT_PARTICLES, DIR_LEFT);
PlaySoundObject(gNPC[n].hit_voice, SOUND_MODE_PLAY);
gNPC[n].shock = 16;
}
@ -614,7 +615,7 @@ void HitNpCharBullet(void)
else if (!(gBul[b].bbits & 0x10))
{
// Hit invulnerable NPC
SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, 2, 2);
SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, CARET_PROJECTILE_DISSIPATION, DIR_RIGHT);
PlaySoundObject(31, SOUND_MODE_PLAY);
gBul[b].life = 0;
continue;

View file

@ -157,12 +157,12 @@ ATTRIBUTE_HOT BOOL MakePixelWaveData(const PIXTONEPARAMETER *ptp, unsigned char
+ 128;
if (gWaveModelTable[ptp->oPitch.model][b] < 0)
dMain = d1 - d1 * 0.5 * -gWaveModelTable[ptp->oPitch.model][b] * ptp->oPitch.top / 64.0 / 64.0 + dMain;
dMain += d1 - d1 * 0.5 * -gWaveModelTable[ptp->oPitch.model][b] * ptp->oPitch.top / 64.0 / 64.0;
else
dMain = d1 + d1 * 2.0 * gWaveModelTable[ptp->oPitch.model][b] * ptp->oPitch.top / 64.0 / 64.0 + dMain;
dMain += d1 + d1 * 2.0 * gWaveModelTable[ptp->oPitch.model][b] * ptp->oPitch.top / 64.0 / 64.0;
dPitch = dPitch + d2;
dVolume = dVolume + d3;
dPitch += d2;
dVolume += d3;
}
return TRUE;

View file

@ -42,7 +42,7 @@ BOOL IsProfile(void)
BOOL SaveProfile(const char *name)
{
FILE *fp;
PROFILE profile;
PROFILEDATA profile;
const char *FLAG = "FLAG";
std::string path;
@ -59,7 +59,7 @@ BOOL SaveProfile(const char *name)
return FALSE;
// Set up profile
memset(&profile, 0, sizeof(PROFILE));
memset(&profile, 0, sizeof(PROFILEDATA));
memcpy(profile.code, gProfileCode, sizeof(profile.code));
memcpy(profile.FLAG, FLAG, sizeof(profile.FLAG));
profile.stage = gStageNo;
@ -123,7 +123,7 @@ BOOL SaveProfile(const char *name)
BOOL LoadProfile(const char *name)
{
FILE *fp;
PROFILE profile;
PROFILEDATA profile;
std::string path;
// Get path
@ -149,7 +149,7 @@ BOOL LoadProfile(const char *name)
// Read data
fseek(fp, 0, SEEK_SET);
memset(&profile, 0, sizeof(PROFILE));
memset(&profile, 0, sizeof(PROFILEDATA));
fread(profile.code, 8, 1, fp);
profile.stage = File_ReadLE32(fp);
profile.music = (MusicID)File_ReadLE32(fp);

View file

@ -6,7 +6,7 @@
#include "SelStage.h"
#include "Stage.h"
typedef struct PROFILE
typedef struct PROFILEDATA
{
char code[8];
int stage;
@ -29,7 +29,7 @@ typedef struct PROFILE
signed char permit_mapping[0x80];
char FLAG[4];
unsigned char flags[1000];
} PROFILE;
} PROFILEDATA;
extern const char* const gDefaultName;
extern const char* const gProfileCode;

View file

@ -5,6 +5,7 @@
#include "ArmsItem.h"
#include "Bullet.h"
#include "Caret.h"
#include "CommonDefines.h"
#include "KeyControl.h"
#include "MyChar.h"
#include "MycParam.h"
@ -47,12 +48,12 @@ void ShootBullet_Frontia1(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y - (10 * 0x200), 1);
SetCaret(gMC.x - (3 * 0x200), gMC.y - (10 * 0x200), 3, 0);
SetCaret(gMC.x - (3 * 0x200), gMC.y - (10 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y - (10 * 0x200), 1);
SetCaret(gMC.x + (3 * 0x200), gMC.y - (10 * 0x200), 3, 0);
SetCaret(gMC.x + (3 * 0x200), gMC.y - (10 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@ -60,12 +61,12 @@ void ShootBullet_Frontia1(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y + (10 * 0x200), 3);
SetCaret(gMC.x - (3 * 0x200), gMC.y + (10 * 0x200), 3, 0);
SetCaret(gMC.x - (3 * 0x200), gMC.y + (10 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y + (10 * 0x200), 3);
SetCaret(gMC.x + (3 * 0x200), gMC.y + (10 * 0x200), 3, 0);
SetCaret(gMC.x + (3 * 0x200), gMC.y + (10 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@ -73,12 +74,12 @@ void ShootBullet_Frontia1(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (6 * 0x200), gMC.y + (2 * 0x200), 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (2 * 0x200), 3, 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (6 * 0x200), gMC.y + (2 * 0x200), 2);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (2 * 0x200), 3, 0);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
@ -122,12 +123,12 @@ void ShootBullet_PoleStar(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 1);
SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 1);
SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@ -135,12 +136,12 @@ void ShootBullet_PoleStar(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3);
SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3);
SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@ -148,12 +149,12 @@ void ShootBullet_PoleStar(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (6 * 0x200), gMC.y + (3 * 0x200), 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (6 * 0x200), gMC.y + (3 * 0x200), 2);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
@ -206,12 +207,12 @@ void ShootBullet_FireBall(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (4 * 0x200), gMC.y - (8 * 0x200), 1);
SetCaret(gMC.x - (4 * 0x200), gMC.y - (8 * 0x200), 3, 0);
SetCaret(gMC.x - (4 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (4 * 0x200), gMC.y - (8 * 0x200), 1);
SetCaret(gMC.x + (4 * 0x200), gMC.y - (8 * 0x200), 3, 0);
SetCaret(gMC.x + (4 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@ -219,12 +220,12 @@ void ShootBullet_FireBall(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (4 * 0x200), gMC.y + (8 * 0x200), 3);
SetCaret(gMC.x - (4 * 0x200), gMC.y + (8 * 0x200), 3, 0);
SetCaret(gMC.x - (4 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (4 * 0x200), gMC.y + (8 * 0x200), 3);
SetCaret(gMC.x + (4 * 0x200), gMC.y + (8 * 0x200), 3, 0);
SetCaret(gMC.x + (4 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@ -232,12 +233,12 @@ void ShootBullet_FireBall(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (6 * 0x200), gMC.y + (2 * 0x200), 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (2 * 0x200), 3, 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (6 * 0x200), gMC.y + (2 * 0x200), 2);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (2 * 0x200), 3, 0);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
@ -285,7 +286,7 @@ void ShootBullet_Machinegun1(int level)
if (empty == 0)
{
SetCaret(gMC.x, gMC.y, 16, 0);
SetCaret(gMC.x, gMC.y, CARET_EMPTY, DIR_LEFT);
empty = 50;
}
@ -300,12 +301,12 @@ void ShootBullet_Machinegun1(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y - (8 * 0x200), 1);
SetCaret(gMC.x - (3 * 0x200), gMC.y - (8 * 0x200), 3, 0);
SetCaret(gMC.x - (3 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y - (8 * 0x200), 1);
SetCaret(gMC.x + (3 * 0x200), gMC.y - (8 * 0x200), 3, 0);
SetCaret(gMC.x + (3 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@ -326,12 +327,12 @@ void ShootBullet_Machinegun1(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y + (8 * 0x200), 3);
SetCaret(gMC.x - (3 * 0x200), gMC.y + (8 * 0x200), 3, 0);
SetCaret(gMC.x - (3 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y + (8 * 0x200), 3);
SetCaret(gMC.x + (3 * 0x200), gMC.y + (8 * 0x200), 3, 0);
SetCaret(gMC.x + (3 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@ -339,12 +340,12 @@ void ShootBullet_Machinegun1(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), 2);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
@ -486,7 +487,7 @@ void ShootBullet_Missile(int level, BOOL bSuper)
if (empty == 0)
{
SetCaret(gMC.x, gMC.y, 16, 0);
SetCaret(gMC.x, gMC.y, CARET_EMPTY, DIR_LEFT);
empty = 50;
}
@ -498,12 +499,12 @@ void ShootBullet_Missile(int level, BOOL bSuper)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 1);
SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 1);
SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@ -511,12 +512,12 @@ void ShootBullet_Missile(int level, BOOL bSuper)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3);
SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3);
SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@ -524,12 +525,12 @@ void ShootBullet_Missile(int level, BOOL bSuper)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (6 * 0x200), gMC.y, 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y, 3, 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y, CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (6 * 0x200), gMC.y, 2);
SetCaret(gMC.x + (12 * 0x200), gMC.y, 3, 0);
SetCaret(gMC.x + (12 * 0x200), gMC.y, CARET_SHOOT, DIR_LEFT);
}
}
}
@ -541,7 +542,7 @@ void ShootBullet_Missile(int level, BOOL bSuper)
if (empty == 0)
{
SetCaret(gMC.x, gMC.y, 16, 0);
SetCaret(gMC.x, gMC.y, CARET_EMPTY, DIR_LEFT);
empty = 50;
}
@ -553,14 +554,14 @@ void ShootBullet_Missile(int level, BOOL bSuper)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 1);
SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y, 1);
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y, 1);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 1);
SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y, 1);
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y, 1);
}
@ -570,14 +571,14 @@ void ShootBullet_Missile(int level, BOOL bSuper)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3);
SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y, 3);
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y, 3);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3);
SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y, 3);
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y, 3);
}
@ -587,14 +588,14 @@ void ShootBullet_Missile(int level, BOOL bSuper)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (6 * 0x200), gMC.y + (1 * 0x200), 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (1 * 0x200), 3, 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (1 * 0x200), CARET_SHOOT, DIR_LEFT);
SetBullet(bul_no, gMC.x, gMC.y - (8 * 0x200), 0);
SetBullet(bul_no, gMC.x + (4 * 0x200), gMC.y - (1 * 0x200), 0);
}
else
{
SetBullet(bul_no, gMC.x + (6 * 0x200), gMC.y + (1 * 0x200), 2);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (1 * 0x200), 3, 0);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (1 * 0x200), CARET_SHOOT, DIR_LEFT);
SetBullet(bul_no, gMC.x, gMC.y - (8 * 0x200), 2);
SetBullet(bul_no, gMC.x - (4 * 0x200), gMC.y - (1 * 0x200), 2);
}
@ -620,7 +621,7 @@ void ShootBullet_Bubblin1(void)
if (empty == 0)
{
SetCaret(gMC.x, gMC.y, 16, 0);
SetCaret(gMC.x, gMC.y, CARET_EMPTY, DIR_LEFT);
empty = 50;
}
@ -632,12 +633,12 @@ void ShootBullet_Bubblin1(void)
if (gMC.direct == 0)
{
SetBullet(19, gMC.x - (1 * 0x200), gMC.y - (2 * 0x200), 1);
SetCaret(gMC.x - (1 * 0x200), gMC.y - (2 * 0x200), 3, 0);
SetCaret(gMC.x - (1 * 0x200), gMC.y - (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(19, gMC.x + (1 * 0x200), gMC.y - (2 * 0x200), 1);
SetCaret(gMC.x + (1 * 0x200), gMC.y - (2 * 0x200), 3, 0);
SetCaret(gMC.x + (1 * 0x200), gMC.y - (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@ -645,12 +646,12 @@ void ShootBullet_Bubblin1(void)
if (gMC.direct == 0)
{
SetBullet(19, gMC.x - (1 * 0x200), gMC.y + (2 * 0x200), 3);
SetCaret(gMC.x - (1 * 0x200), gMC.y + (2 * 0x200), 3, 0);
SetCaret(gMC.x - (1 * 0x200), gMC.y + (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(19, gMC.x + (1 * 0x200), gMC.y + (2 * 0x200), 3);
SetCaret(gMC.x + (1 * 0x200), gMC.y + (2 * 0x200), 3, 0);
SetCaret(gMC.x + (1 * 0x200), gMC.y + (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@ -658,12 +659,12 @@ void ShootBullet_Bubblin1(void)
if (gMC.direct == 0)
{
SetBullet(19, gMC.x - (6 * 0x200), gMC.y + (3 * 0x200), 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(19, gMC.x + (6 * 0x200), gMC.y + (3 * 0x200), 2);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
@ -701,7 +702,7 @@ void ShootBullet_Bubblin2(int level)
if (empty == 0)
{
SetCaret(gMC.x, gMC.y, 16, 0);
SetCaret(gMC.x, gMC.y, CARET_EMPTY, DIR_LEFT);
empty = 50;
}
@ -713,12 +714,12 @@ void ShootBullet_Bubblin2(int level)
if (gMC.direct == 0)
{
SetBullet(level, gMC.x - (3 * 0x200), gMC.y - (8 * 0x200), 1);
SetCaret(gMC.x - (3 * 0x200), gMC.y - (16 * 0x200), 3, 0);
SetCaret(gMC.x - (3 * 0x200), gMC.y - (16 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(level, gMC.x + (3 * 0x200), gMC.y - (8 * 0x200), 1);
SetCaret(gMC.x + (3 * 0x200), gMC.y - (16 * 0x200), 3, 0);
SetCaret(gMC.x + (3 * 0x200), gMC.y - (16 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@ -726,12 +727,12 @@ void ShootBullet_Bubblin2(int level)
if (gMC.direct == 0)
{
SetBullet(level, gMC.x - (3 * 0x200), gMC.y + (8 * 0x200), 3);
SetCaret(gMC.x - (3 * 0x200), gMC.y + (16 * 0x200), 3, 0);
SetCaret(gMC.x - (3 * 0x200), gMC.y + (16 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(level, gMC.x + (3 * 0x200), gMC.y + (8 * 0x200), 3);
SetCaret(gMC.x + (3 * 0x200), gMC.y + (16 * 0x200), 3, 0);
SetCaret(gMC.x + (3 * 0x200), gMC.y + (16 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@ -739,12 +740,12 @@ void ShootBullet_Bubblin2(int level)
if (gMC.direct == 0)
{
SetBullet(level, gMC.x - (6 * 0x200), gMC.y + (3 * 0x200), 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(level, gMC.x + (6 * 0x200), gMC.y + (3 * 0x200), 2);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
@ -842,12 +843,12 @@ void ShootBullet_Nemesis(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y - (12 * 0x200), 1);
SetCaret(gMC.x - (1 * 0x200), gMC.y - (12 * 0x200), 3, 0);
SetCaret(gMC.x - (1 * 0x200), gMC.y - (12 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y - (12 * 0x200), 1);
SetCaret(gMC.x + (1 * 0x200), gMC.y - (12 * 0x200), 3, 0);
SetCaret(gMC.x + (1 * 0x200), gMC.y - (12 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@ -855,12 +856,12 @@ void ShootBullet_Nemesis(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y + (12 * 0x200), 3);
SetCaret(gMC.x - (1 * 0x200), gMC.y + (12 * 0x200), 3, 0);
SetCaret(gMC.x - (1 * 0x200), gMC.y + (12 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y + (12 * 0x200), 3);
SetCaret(gMC.x + (1 * 0x200), gMC.y + (12 * 0x200), 3, 0);
SetCaret(gMC.x + (1 * 0x200), gMC.y + (12 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@ -868,12 +869,12 @@ void ShootBullet_Nemesis(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (22 * 0x200), gMC.y + (3 * 0x200), 0);
SetCaret(gMC.x - (16 * 0x200), gMC.y + (3 * 0x200), 3, 0);
SetCaret(gMC.x - (16 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (22 * 0x200), gMC.y + (3 * 0x200), 2);
SetCaret(gMC.x + (16 * 0x200), gMC.y + (3 * 0x200), 3, 0);
SetCaret(gMC.x + (16 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
@ -1000,12 +1001,12 @@ void ShootBullet_Spur(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 1);
SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 1);
SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@ -1013,12 +1014,12 @@ void ShootBullet_Spur(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3);
SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3);
SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@ -1026,12 +1027,12 @@ void ShootBullet_Spur(int level)
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (6 * 0x200), gMC.y + (3 * 0x200), 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (6 * 0x200), gMC.y + (3 * 0x200), 2);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}

View file

@ -18,7 +18,7 @@ enum SoundEffectNames
SND_SILLY_EXPLOSION = 25,
SND_LARGE_OBJECT_HIT_GROUND = 26,
// To be continued
SND_ENEMY_SHOOT_PROJETILE = 39,
SND_ENEMY_SHOOT_PROJECTILE = 39,
// To be continued
SND_BEHEMOTH_LARGE_HURT = 52,
// To be continued