This commit is contained in:
cuckydev 2019-02-03 13:26:43 -05:00
parent b4bceb4faf
commit 42f7bb55c0
5 changed files with 139 additions and 6 deletions

View file

@ -91,6 +91,7 @@ SOURCES = \
Shoot \ Shoot \
Sound \ Sound \
Stage \ Stage \
Star \
SelStage \ SelStage \
TextScr \ TextScr \
Triangle \ Triangle \

View file

@ -17,6 +17,7 @@
#include "Bullet.h" #include "Bullet.h"
#include "BulHit.h" #include "BulHit.h"
#include "Shoot.h" #include "Shoot.h"
#include "Star.h"
#include "Fade.h" #include "Fade.h"
#include "Frame.h" #include "Frame.h"
#include "Flags.h" #include "Flags.h"
@ -103,7 +104,7 @@ int ModeOpening()
{ {
InitNpChar(); InitNpChar();
InitCaret(); InitCaret();
//InitStar(); InitStar();
InitFade(); InitFade();
InitFlash(); InitFlash();
InitBossLife(); InitBossLife();
@ -245,7 +246,7 @@ int ModeTitle()
//Reset everything //Reset everything
InitCaret(); InitCaret();
//InitStar(); InitStar();
CutNoise(); CutNoise();
//Create variables //Create variables
@ -436,7 +437,7 @@ int ModeAction()
InitNpChar(); InitNpChar();
InitBullet(); InitBullet();
InitCaret(); InitCaret();
//InitStar(); InitStar();
InitFade(); InitFade();
InitFlash(); InitFlash();
ClearArmsData(); ClearArmsData();
@ -470,7 +471,7 @@ int ModeAction()
else else
ActMyChar(false); ActMyChar(false);
//ActStar(); ActStar();
ActNpChar(); ActNpChar();
ActBossChar(); ActBossChar();
ActValueView(); ActValueView();
@ -513,7 +514,7 @@ int ModeAction()
PutNpChar(frame_x, frame_y); PutNpChar(frame_x, frame_y);
PutBullet(frame_x, frame_y); PutBullet(frame_x, frame_y);
PutMyChar(frame_x, frame_y); PutMyChar(frame_x, frame_y);
//PutStar(frame_x, frame_y); PutStar(frame_x, frame_y);
PutMapDataVector(frame_x, frame_y); PutMapDataVector(frame_x, frame_y);
PutStage_Front(frame_x, frame_y); PutStage_Front(frame_x, frame_y);
PutFront(frame_x, frame_y); PutFront(frame_x, frame_y);

View file

@ -11,6 +11,7 @@
#include "Flags.h" #include "Flags.h"
#include "MiniMap.h" #include "MiniMap.h"
#include "MyChar.h" #include "MyChar.h"
#include "Star.h"
#include "NpChar.h" #include "NpChar.h"
#include "Frame.h" #include "Frame.h"
#include "SelStage.h" #include "SelStage.h"
@ -215,7 +216,7 @@ bool LoadProfile(char *name)
SetFrameTargetMyChar(16); SetFrameTargetMyChar(16);
InitBossLife(); InitBossLife();
CutNoise(); CutNoise();
//InitStar(); InitStar();
ClearValueView(); ClearValueView();
gCurlyShoot_wait = 0; gCurlyShoot_wait = 0;
return true; return true;

126
src/Star.cpp Normal file
View file

@ -0,0 +1,126 @@
#include <string.h>
#include "WindowsWrapper.h"
#include "MyChar.h"
#include "Draw.h"
#include "Bullet.h"
#include "Game.h"
static struct
{
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;
} star[3];
void InitStar()
{
//Clear stars
memset(star, 0, sizeof(star));
//Position
star[0].x = gMC.x;
star[0].y = gMC.y;
star[1].x = gMC.x;
star[1].y = gMC.y;
star[2].x = gMC.x;
star[2].y = gMC.y;
//Speed
star[0].xm = 0x400;
star[0].ym = -0x200;
star[1].xm = -0x200;
star[1].ym = 0x400;
star[2].xm = 0x200;
star[2].ym = 0x200;
}
void ActStar()
{
static int a;
a++;
a %= 3;
for (int i = 0; i < 3; i++)
{
if (i)
{
if (star[i - 1].x >= star[i].x)
star[i].xm += 0x80;
else
star[i].xm -= 0x80;
if (star[i - 1].y >= star[i].y)
star[i].ym += 0xAA;
else
star[i].ym -= 0xAA;
}
else
{
if (gMC.x >= star[0].x)
star[0].xm += 0x80;
else
star[0].xm -= 0x80;
if (gMC.y >= star[0].y)
star[0].ym += 0xAA;
else
star[0].ym -= 0xAA;
}
if (star[i].xm > 0xA00)
star[i].xm = 0xA00;
if (star[i].xm < -0xA00)
star[i].xm = -0xA00;
if (star[i].ym > 0xA00)
star[i].ym = 0xA00;
if (star[i].ym < -0xA00)
star[i].ym = -0xA00;
if (star[i].xm > 0xA00)
star[i].xm = 0xA00;
if (star[i].xm < -0xA00)
star[i].xm = -0xA00;
if (star[i].ym > 0xA00)
star[i].ym = 0xA00;
if (star[i].ym < -0xA00)
star[i].ym = -0xA00;
star[i].x += star[i].xm;
star[i].y += star[i].ym;
if (gMC.star > i && (gMC.equip & 0x80) && (g_GameFlags & 2) && a == i)
SetBullet(45, star[a].x, star[a].y, 0);
}
}
void __cdecl PutStar(int fx, int fy)
{
RECT rc[3];
rc[0] = {192, 0, 200, 8};
rc[1] = {192, 8, 200, 16};
rc[2] = {192, 16, 200, 24};
if (!(gMC.cond & 2) && (gMC.equip & 0x80))
{
for (int i = 0; i < 3; i++)
{
if (gMC.star > i)
PutBitmap3(&grcGame, star[i].x / 0x200 - fx / 0x200 - 4, star[i].y / 0x200 - fy / 0x200 - 4, &rc[i], 16);
}
}
}

4
src/Star.h Normal file
View file

@ -0,0 +1,4 @@
#pragma once
void InitStar();
void ActStar();
void PutStar(int fx, int fy);