Finished missiles maybe?

This commit is contained in:
Clownacy 2019-02-03 17:24:31 +00:00
parent b7decf07f2
commit 0b59c55fa9
2 changed files with 278 additions and 104 deletions

View file

@ -503,9 +503,10 @@ void ActBullet_Missile(BULLET *bul, int level)
}
bool bHit = false;
if (bul->life != 10)
bHit = true;
if (!bul->direct && bul->flag & 1)
if (bul->direct == 0 && bul->flag & 1)
bHit = true;
if (bul->direct == 2 && bul->flag & 4)
bHit = true;
@ -524,7 +525,7 @@ void ActBullet_Missile(BULLET *bul, int level)
if (bHit)
{
SetBullet(15 + level, bul->x, bul->y, 0);
SetBullet(level + 15, bul->x, bul->y, 0);
bul->cond = 0;
}
@ -535,9 +536,168 @@ void ActBullet_Missile(BULLET *bul, int level)
switch (bul->direct)
{
case 0:
case 2:
bul->tgt_y = bul->y;
break;
case 1:
case 3:
bul->tgt_x = bul->x;
break;
}
if (level == 3)
{
switch (bul->direct)
{
case 0:
case 2:
if (gMC.y < bul->y)
bul->ym = 0x100;
else
bul->ym = -0x100;
bul->xm = Random(-0x200, 0x200);
break;
case 1:
case 3:
if (gMC.x < bul->x)
bul->xm = 0x100;
else
bul->xm = -0x100;
bul->ym = Random(-0x200, 0x200);
break;
}
unsigned int inc;
switch (++inc % 3u)
{
case 0:
bul->ani_no = 0x80;
break;
case 1:
bul->ani_no = 0x40;
break;
case 2:
bul->ani_no = 0x33;
break;
}
}
else
{
bul->ani_no = 0x80;
}
// Fallthrough
case 1:
switch (bul->direct)
{
case 0:
bul->xm -= bul->ani_no;
break;
case 1:
bul->ym -= bul->ani_no;
break;
case 2:
bul->xm += bul->ani_no;
break;
case 3:
bul->ym += bul->ani_no;
break;
}
if (level == 3)
{
switch (bul->direct)
{
case 0:
case 2:
if (bul->tgt_y > bul->y)
bul->ym += 0x20;
else
bul->ym -= 0x20;
break;
case 1:
case 3:
if (bul->tgt_x > bul->x)
bul->xm += 0x20;
else
bul->xm -= 0x20;
break;
}
}
if (bul->xm < -0xA00)
bul->xm = -0xA00;
if (bul->xm > 0xA00)
bul->xm = 0xA00;
if (bul->ym < -0xA00)
bul->ym = -0xA00;
if (bul->ym > 0xA00)
bul->ym = 0xA00;
bul->x += bul->xm;
bul->y += bul->ym;
break;
}
if (++bul->count2 > 2)
{
bul->count2 = 0;
switch (bul->direct)
{
case 0:
SetCaret(bul->x + 0x1000, bul->y, 7, 2);
break;
case 1:
SetCaret(bul->x, bul->y + 0x1000, 7, 3);
break;
case 2:
SetCaret(bul->x - 0x1000, bul->y, 7, 0);
break;
case 3:
SetCaret(bul->x, bul->y - 0x1000, 7, 1);
break;
}
}
RECT rect1[4];
RECT rect2[4];
RECT rect3[4];
rect1[0] = {0, 0, 16, 16};
rect1[1] = {16, 0, 32, 16};
rect1[2] = {32, 0, 48, 16};
rect1[3] = {48, 0, 64, 16};
rect2[0] = {0, 16, 16, 32};
rect2[1] = {16, 16, 32, 32};
rect2[2] = {32, 16, 48, 32};
rect2[3] = {48, 16, 64, 32};
rect3[0] = {0, 32, 16, 48};
rect3[1] = {16, 32, 32, 48};
rect3[2] = {32, 32, 48, 48};
rect3[3] = {48, 32, 64, 48};
switch (level)
{
case 1:
bul->rect = rect1[bul->direct];
break;
case 2:
bul->rect = rect2[bul->direct];
break;
case 3:
bul->rect = rect3[bul->direct];
break;
}
}

View file

@ -284,7 +284,7 @@ void ShootBullet_Machinegun1(int level)
}
}
void __cdecl ShootBullet_Missile(int level, bool bSuper)
void ShootBullet_Missile(int level, bool bSuper)
{
int bul_no;
@ -324,15 +324,15 @@ void __cdecl ShootBullet_Missile(int level, bool bSuper)
{
switch (level)
{
case 1:
bul_no = 13;
break;
case 2:
bul_no = 14;
break;
case 3:
bul_no = 15;
break;
case 1:
bul_no = 13;
break;
}
if (level == 1)
@ -355,116 +355,130 @@ void __cdecl ShootBullet_Missile(int level, bool bSuper)
if (!(gKeyTrg & gKeyShot))
return;
if (!UseArmsEnergy(1))
if (level < 3)
{
PlaySoundObject(37, 1);
if (!empty)
if (!UseArmsEnergy(1))
{
SetCaret(gMC.x, gMC.y, 16, 0);
empty = 50;
}
return;
}
else
{
if (level < 3)
{
if (gMC.up)
PlaySoundObject(37, 1);
if (!empty)
{
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);
}
SetCaret(gMC.x, gMC.y, 16, 0);
empty = 50;
}
else if (gMC.down)
return;
}
if (gMC.up)
{
if (gMC.direct)
{
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);
}
SetBullet(bul_no, gMC.x + 0x200, gMC.y - 0x1000, 1);
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);
}
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.up)
if (gMC.direct)
{
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);
}
SetBullet(bul_no, gMC.x + 0xC00, gMC.y, 2);
SetCaret(gMC.x + 0x1800, gMC.y, 3, 0);
}
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);
}
SetBullet(bul_no, gMC.x - 0xC00, gMC.y, 0);
SetCaret(gMC.x - 0x1800, gMC.y, 3, 0);
}
}
PlaySoundObject(32, 1);
}
else
{
if (!UseArmsEnergy(1))
{
PlaySoundObject(37, 1);
if (!empty)
{
SetCaret(gMC.x, gMC.y, 16, 0);
empty = 50;
}
return;
}
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);
SetBullet(bul_no, gMC.x + 0x600, gMC.y, 1);
SetBullet(bul_no, gMC.x - 0x600, gMC.y, 1);
}
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()