ref: b7decf07f26dfa31dabfa8b8c91f9fc82936008c
parent: 66e96f47b7063835eb145156a2587d002518a58d
author: cuckydev <cuckydev@users.noreply.github.com>
date: Sat Feb 2 17:27:27 EST 2019
missile man bad
--- a/src/Bullet.cpp
+++ b/src/Bullet.cpp
@@ -2,6 +2,8 @@
#include "Draw.h"
#include "Caret.h"
#include "NpChar.h"
+#include "MyChar.h"
+#include "Sound.h"
#include "Game.h"
BULLET_TABLE gBulTbl[46] =
@@ -266,6 +268,141 @@
}
}
+void ActBullet_FireBall(BULLET *bul, int level)
+{
+ if (++bul->count1 <= bul->life_count)
+ {
+ bool bBreak = false;
+ if (bul->flag & 2 && bul->flag & 8)
+ bBreak = true;
+ if (bul->flag & 1 && bul->flag & 4)
+ bBreak = true;
+
+ if (!bul->direct && bul->flag & 1)
+ bul->direct = 2;
+ if (bul->direct == 2 && bul->flag & 4)
+ bul->direct = 0;
+
+ if (bBreak)
+ {
+ bul->cond = 0;
+ SetCaret(bul->x, bul->y, 2, 0);
+ PlaySoundObject(28, 1);
+ }
+ else
+ {
+ if (bul->act_no)
+ {
+ if (bul->flag & 8)
+ bul->ym = -0x400;
+ else if (bul->flag & 1)
+ bul->xm = 0x400;
+ else if (bul->flag & 4)
+ bul->xm = -0x400;
+
+ bul->ym += 85;
+ if (bul->ym >= 0x400)
+ bul->ym = 0x400;
+
+ bul->x += bul->xm;
+ bul->y += bul->ym;
+
+ if (bul->flag & 0xD)
+ PlaySoundObject(34, 1);
+ }
+ else
+ {
+ bul->act_no = 1;
+
+ switch (bul->direct)
+ {
+ case 0:
+ bul->xm = -0x400;
+ break;
+ case 1:
+ bul->xm = gMC.xm;
+
+ if (gMC.xm >= 0)
+ bul->direct = 2;
+ else
+ bul->direct = 0;
+
+ if (gMC.direct)
+ bul->xm += 0x80;
+ else
+ bul->xm -= 0x80;
+
+ bul->ym = -0x5FF;
+ break;
+ case 2:
+ bul->xm = 0x400;
+ break;
+ case 3:
+ bul->xm = gMC.xm;
+ if (gMC.xm >= 0)
+ bul->direct = 2;
+ else
+ bul->direct = 0;
+ bul->ym = 0x5FF;
+ break;
+ }
+ }
+
+ RECT rect_left1[4];
+ RECT rect_right1[4];
+ RECT rect_left2[3];
+ RECT rect_right2[3];
+ rect_left1[0] = {128, 0, 144, 16};
+ rect_left1[1] = {144, 0, 160, 16};
+ rect_left1[2] = {160, 0, 176, 16};
+ rect_left1[3] = {176, 0, 192, 16};
+ rect_right1[0] = {128, 16, 144, 32};
+ rect_right1[1] = {144, 16, 160, 32};
+ rect_right1[2] = {160, 16, 176, 32};
+ rect_right1[3] = {176, 16, 192, 32};
+ rect_left2[0] = {192, 16, 208, 32};
+ rect_left2[1] = {208, 16, 224, 32};
+ rect_left2[2] = {224, 16, 240, 32};
+ rect_right2[0] = {224, 16, 240, 32};
+ rect_right2[1] = {208, 16, 224, 32};
+ rect_right2[2] = {192, 16, 208, 32};
+
+ bul->ani_no++;
+
+ if (level == 1)
+ {
+ if (bul->ani_no > 3)
+ bul->ani_no = 0;
+
+ if (bul->direct)
+ bul->rect = rect_right1[bul->ani_no];
+ else
+ bul->rect = rect_left1[bul->ani_no];
+ }
+ else
+ {
+ if (bul->ani_no > 2)
+ bul->ani_no = 0;
+
+ if (bul->direct)
+ bul->rect = rect_right2[bul->ani_no];
+ else
+ bul->rect = rect_left2[bul->ani_no];
+
+ if (level == 2)
+ SetNpChar(129, bul->x, bul->y, 0, -0x200, bul->ani_no, 0, 0x100);
+ else
+ SetNpChar(129, bul->x, bul->y, 0, -0x200, bul->ani_no + 3, 0, 0x100);
+ }
+ }
+ }
+ else
+ {
+ bul->cond = 0;
+ SetCaret(bul->x, bul->y, 3, 0);
+ }
+}
+
void ActBullet_MachineGun(BULLET *bul, int level)
{
RECT rect1[4];
@@ -356,6 +493,100 @@
}
}
+void ActBullet_Missile(BULLET *bul, int level)
+{
+ if (++bul->count1 > bul->life_count)
+ {
+ bul->cond = 0;
+ SetCaret(bul->x, bul->y, 3, 0);
+ return;
+ }
+
+ bool bHit = false;
+ if (bul->life != 10)
+ bHit = true;
+ if (!bul->direct && bul->flag & 1)
+ bHit = true;
+ if (bul->direct == 2 && bul->flag & 4)
+ bHit = true;
+ if (bul->direct == 1 && bul->flag & 2)
+ bHit = true;
+ if (bul->direct == 3 && bul->flag & 8)
+ bHit = true;
+ if (bul->direct == 0 && bul->flag & 0x80)
+ bHit = true;
+ if (bul->direct == 0 && bul->flag & 0x20)
+ bHit = true;
+ if (bul->direct == 2 && bul->flag & 0x40)
+ bHit = true;
+ if (bul->direct == 2 && bul->flag & 0x10)
+ bHit = true;
+
+ if (bHit)
+ {
+ SetBullet(15 + level, bul->x, bul->y, 0);
+ bul->cond = 0;
+ }
+
+ switch (bul->act_no)
+ {
+ case 0:
+ bul->act_no = 1;
+
+ switch (bul->direct)
+ {
+
+ }
+
+ }
+}
+
+void ActBullet_Bom(BULLET *bul, int level)
+{
+ switch (bul->act_no)
+ {
+ case 0:
+ bul->act_no = 1;
+
+ switch ( level )
+ {
+ case 2:
+ bul->act_wait = 15;
+ break;
+ case 3:
+ bul->act_wait = 5;
+ break;
+ case 1:
+ bul->act_wait = 10;
+ break;
+ }
+
+ PlaySoundObject(44, 1);
+
+ case 1:
+ if (level == 1)
+ {
+ if (!(bul->act_wait % 3))
+ SetDestroyNpCharUp(bul->x + (Random(-16, 16) << 9), bul->y + (Random(-16, 16) << 9), bul->enemyXL, 2);
+ }
+ else if (level == 2)
+ {
+ if (!(bul->act_wait % 3))
+ SetDestroyNpCharUp(bul->x + (Random(-32, 32) << 9), bul->y + (Random(-32, 32) << 9), bul->enemyXL, 2);
+ }
+ else if (level == 3)
+ {
+ if (!(bul->act_wait % 3))
+ SetDestroyNpCharUp(bul->x + (Random(-40, 40) << 9), bul->y + (Random(-40, 40) << 9), bul->enemyXL, 2);
+ }
+
+ if (--bul->act_wait < 0)
+ bul->cond = 0;
+ break;
+ }
+
+}
+
void ActBullet()
{
for (int i = 0; i < BULLET_MAX; i++)
@@ -375,6 +606,15 @@
case 6:
ActBullet_PoleStar(&gBul[i], 3);
break;
+ case 7:
+ ActBullet_FireBall(&gBul[i], 1);
+ break;
+ case 8:
+ ActBullet_FireBall(&gBul[i], 2);
+ break;
+ case 9:
+ ActBullet_FireBall(&gBul[i], 3);
+ break;
case 10:
ActBullet_MachineGun(&gBul[i], 1);
break;
@@ -383,6 +623,24 @@
break;
case 12:
ActBullet_MachineGun(&gBul[i], 3);
+ break;
+ case 13:
+ ActBullet_Missile(&gBul[i], 1);
+ break;
+ case 14:
+ ActBullet_Missile(&gBul[i], 2);
+ break;
+ case 15:
+ ActBullet_Missile(&gBul[i], 3);
+ break;
+ case 16:
+ ActBullet_Bom(&gBul[i], 1);
+ break;
+ case 17:
+ ActBullet_Bom(&gBul[i], 2);
+ break;
+ case 18:
+ ActBullet_Bom(&gBul[i], 3);
break;
}
}
--- a/src/MycHit.cpp
+++ b/src/MycHit.cpp
@@ -436,7 +436,7 @@
break;
//Spikes
- case 0x42u:
+ case 0x42:
gMC.flag |= JudgeHitMyCharDamage(x + offx[i], y + offy[i]);
break;
--- a/src/NpcAct.h
+++ b/src/NpcAct.h
@@ -93,6 +93,7 @@
void ActNpc127(NPCHAR *npc);
void ActNpc128(NPCHAR *npc);
+void ActNpc129(NPCHAR *npc);
void ActNpc145(NPCHAR *npc);
--- a/src/NpcAct120.cpp
+++ b/src/NpcAct120.cpp
@@ -124,4 +124,39 @@
npc->rect = rcDown[npc->ani_no];
break;
}
-}
\ No newline at end of file
+}
+
+//Fireball trail (Level 2 & 3)
+void ActNpc129(NPCHAR *npc)
+{
+ RECT rect[18];
+ rect[0] = {0x80, 0x30, 0x90, 0x40};
+ rect[1] = {0x90, 0x30, 0xA0, 0x40};
+ rect[2] = {0xA0, 0x30, 0xB0, 0x40};
+ rect[3] = {0x80, 0x40, 0x90, 0x50};
+ rect[4] = {0x90, 0x40, 0xA0, 0x50};
+ rect[5] = {0xA0, 0x40, 0xB0, 0x50};
+ rect[6] = {0x80, 0x50, 0x90, 0x60};
+ rect[7] = {0x90, 0x50, 0xA0, 0x60};
+ rect[8] = {0xA0, 0x50, 0xB0, 0x60};
+ rect[9] = {0xB0, 0x30, 0xC0, 0x40};
+ rect[10] = {0xC0, 0x30, 0xD0, 0x40};
+ rect[11] = {0xD0, 0x30, 0xE0, 0x40};
+ rect[12] = {0xB0, 0x40, 0xC0, 0x50};
+ rect[13] = {0xC0, 0x40, 0xD0, 0x50};
+ rect[14] = {0xD0, 0x40, 0xE0, 0x50};
+ rect[15] = {0xB0, 0x50, 0xC0, 0x60};
+ rect[16] = {0xC0, 0x50, 0xD0, 0x60};
+ rect[17] = {0xD0, 0x50, 0xE0, 0x60};
+
+ if (++npc->ani_wait > 1)
+ {
+ npc->ani_wait = 0;
+ if (++npc->ani_no > 2)
+ npc->cond = 0;
+ }
+
+ npc->y += npc->ym;
+
+ npc->rect = rect[npc->ani_no + 3 * npc->direct];
+}
--- a/src/NpcTbl.cpp
+++ b/src/NpcTbl.cpp
@@ -185,7 +185,7 @@
nullptr,
ActNpc127,
ActNpc128,
- nullptr,
+ ActNpc129,
nullptr,
nullptr,
nullptr,
--- a/src/Shoot.cpp
+++ b/src/Shoot.cpp
@@ -82,6 +82,82 @@
}
}
+void ShootBullet_FireBall(int level)
+{
+ int bul_no;
+
+ switch (level)
+ {
+ case 1:
+ if (CountArmsBullet(3) >= 2)
+ return;
+ bul_no = 7;
+ break;
+ case 2:
+ if (CountArmsBullet(3) >= 3)
+ return;
+ bul_no = 8;
+ break;
+ case 3:
+ if (CountArmsBullet(3) >= 4)
+ return;
+ bul_no = 9;
+ break;
+ }
+
+ if (gKeyTrg & gKeyShot)
+ {
+ if (!UseArmsEnergy(1))
+ {
+ ChangeToFirstArms();
+ }
+ else
+ {
+ if (gMC.up)
+ {
+ if (gMC.direct)
+ {
+ SetBullet(bul_no, gMC.x + 0x800, gMC.y - 0x1000, 1);
+ SetCaret(gMC.x + 0x800, gMC.y - 0x1000, 3, 0);
+ }
+ else
+ {
+ SetBullet(bul_no, gMC.x - 0x800, gMC.y - 0x1000, 1);
+ SetCaret(gMC.x - 0x800, gMC.y - 0x1000, 3, 0);
+ }
+ }
+ else if (gMC.down)
+ {
+ if (gMC.direct)
+ {
+ SetBullet(bul_no, gMC.x + 0x800, gMC.y + 0x1000, 3);
+ SetCaret(gMC.x + 0x800, gMC.y + 0x1000, 3, 0);
+ }
+ else
+ {
+ SetBullet(bul_no, gMC.x - 0x800, gMC.y + 0x1000, 3);
+ SetCaret(gMC.x - 0x800, gMC.y + 0x1000, 3, 0);
+ }
+ }
+ else
+ {
+ if (gMC.direct)
+ {
+ SetBullet(bul_no, gMC.x + 0xC00, gMC.y + 0x400, 2);
+ SetCaret(gMC.x + 0x1800, gMC.y + 0x400, 3, 0);
+ }
+ else
+ {
+ SetBullet(bul_no, gMC.x - 0xC00, gMC.y + 0x400, 0);
+ SetCaret(gMC.x - 0x1800, gMC.y + 0x400, 3, 0);
+ }
+ }
+
+ PlaySoundObject(34, 1);
+ }
+ }
+}
+
void ShootBullet_Machinegun1(int level)
{
if (CountArmsBullet(4) < 5)
@@ -208,6 +284,189 @@
}
}
+void __cdecl ShootBullet_Missile(int level, bool bSuper)
+{
+ int bul_no;
+
+ if (bSuper)
+ {
+ switch (level)
+ {
+ case 1:
+ bul_no = 28;
+ break;
+ case 2:
+ bul_no = 29;
+ break;
+ case 3:
+ bul_no = 30;
+ break;
+ }
+
+ if (level == 1)
+ {
+ if (CountArmsBullet(10) >= 1 || CountArmsBullet(11) >= 1)
+ return;
+ }
+ else if (level == 2)
+ {
+ if (CountArmsBullet(10) >= 2 || CountArmsBullet(11) >= 2)
+ return;
+ }
+ else if (level == 3)
+ {
+ if (CountArmsBullet(10) >= 4 || CountArmsBullet(11) >= 4)
+ return;
+ }
+
+ }
+ else
+ {
+ switch (level)
+ {
+ case 2:
+ bul_no = 14;
+ break;
+ case 3:
+ bul_no = 15;
+ break;
+ case 1:
+ bul_no = 13;
+ break;
+ }
+
+ if (level == 1)
+ {
+ if (CountArmsBullet(5) >= 1 || CountArmsBullet(6) >= 1)
+ return;
+ }
+ else if (level == 2)
+ {
+ if (CountArmsBullet(5) >= 2 || CountArmsBullet(6) >= 2)
+ return;
+ }
+ else if ( level == 3 )
+ {
+ if (CountArmsBullet(5) >= 4 || CountArmsBullet(6) >= 4)
+ return;
+ }
+ }
+
+ if (!(gKeyTrg & gKeyShot))
+ return;
+
+ if (!UseArmsEnergy(1))
+ {
+ PlaySoundObject(37, 1);
+ if (!empty)
+ {
+ SetCaret(gMC.x, gMC.y, 16, 0);
+ empty = 50;
+ }
+ return;
+ }
+ else
+ {
+ if (level < 3)
+ {
+ if (gMC.up)
+ {
+ if (gMC.direct)
+ {
+ SetBullet(bul_no, gMC.x + 0x200, gMC.y - 0x1000, 1);
+ SetCaret(gMC.x + 0x200, gMC.y - 0x1000, 3, 0);
+ }
+ else
+ {
+ SetBullet(bul_no, gMC.x - 0x200, gMC.y - 0x1000, 1);
+ SetCaret(gMC.x - 0x200, gMC.y - 0x1000, 3, 0);
+ }
+ }
+ else if (gMC.down)
+ {
+ if (gMC.direct)
+ {
+ SetBullet(bul_no, gMC.x + 0x200, gMC.y + 0x1000, 3);
+ SetCaret(gMC.x + 0x200, gMC.y + 0x1000, 3, 0);
+ }
+ else
+ {
+ SetBullet(bul_no, gMC.x - 0x200, gMC.y + 0x1000, 3);
+ SetCaret(gMC.x - 0x200, gMC.y + 0x1000, 3, 0);
+ }
+ }
+ else
+ {
+ if (gMC.direct)
+ {
+ SetBullet(bul_no, gMC.x + 0xC00, gMC.y, 2);
+ SetCaret(gMC.x + 0x1800, gMC.y, 3, 0);
+ }
+ else
+ {
+ SetBullet(bul_no, gMC.x - 0xC00, gMC.y, 0);
+ SetCaret(gMC.x - 0x1800, gMC.y, 3, 0);
+ }
+ }
+ }
+ else
+ {
+ if (gMC.up)
+ {
+ if (gMC.direct)
+ {
+ SetBullet(bul_no, gMC.x + 0x200, gMC.y - 0x1000, 1);
+ SetCaret(gMC.x + 0x200, gMC.y - 0x1000, 3, 0);
+ }
+ else
+ {
+ SetBullet(bul_no, gMC.x - 0x200, gMC.y - 0x1000, 1);
+ SetCaret(gMC.x - 0x200, gMC.y - 0x1000, 3, 0);
+ }
+
+ SetBullet(bul_no, gMC.x + 0x600, gMC.y, 1);
+ SetBullet(bul_no, gMC.x - 0x600, gMC.y, 1);
+ }
+ else if (gMC.down)
+ {
+ if (gMC.direct)
+ {
+ SetBullet(bul_no, gMC.x + 0x200, gMC.y + 0x1000, 3);
+ SetCaret(gMC.x + 0x200, gMC.y + 0x1000, 3, 0);
+ SetBullet(bul_no, gMC.x - 0x600, gMC.y, 3);
+ SetBullet(bul_no, gMC.x + 0x600, gMC.y, 3);
+ }
+ else
+ {
+ SetBullet(bul_no, gMC.x - 0x200, gMC.y + 0x1000, 3);
+ SetCaret(gMC.x - 0x200, gMC.y + 0x1000, 3, 0);
+ SetBullet(bul_no, gMC.x + 0x600, gMC.y, 3);
+ SetBullet(bul_no, gMC.x - 0x600, gMC.y, 3);
+ }
+ }
+ else
+ {
+ if (gMC.direct)
+ {
+ SetBullet(bul_no, gMC.x + 0xC00, gMC.y + 0x200, 2);
+ SetCaret(gMC.x + 0x1800, gMC.y + 0x200, 3, 0);
+ SetBullet(bul_no, gMC.x, gMC.y - 0x1000, 2);
+ SetBullet(bul_no, gMC.x - 0x800, gMC.y - 0x200, 2);
+ }
+ else
+ {
+ SetBullet(bul_no, gMC.x - 0xC00, gMC.y + 0x200, 0);
+ SetCaret(gMC.x - 0x1800, gMC.y + 0x200, 3, 0);
+ SetBullet(bul_no, gMC.x, gMC.y - 0x1000, 0);
+ SetBullet(bul_no, gMC.x + 0x800, gMC.y - 0x200, 0);
+ }
+ }
+ }
+
+ PlaySoundObject(32, 1);
+ }
+}
+
void ShootBullet()
{
if (empty)
@@ -233,9 +492,21 @@
case 2:
ShootBullet_PoleStar(gArmsData[gSelectedArms].level);
break;
+ case 3:
+ ShootBullet_FireBall(gArmsData[gSelectedArms].level);
+ break;
case 4:
ShootBullet_Machinegun1(gArmsData[gSelectedArms].level);
break;
+ case 5:
+ ShootBullet_Missile(gArmsData[gSelectedArms].level, false);
+ break;
+ case 10:
+ ShootBullet_Missile(gArmsData[gSelectedArms].level, true);
+ break;
}
+
+ if (!(gKeyTrg & gKeyShot))
+ return;
}
}