Merge branch 'accurate' into portable
This commit is contained in:
commit
cc8e875cb1
10 changed files with 44 additions and 30 deletions
|
@ -337,7 +337,7 @@ static int ModeTitle(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
g_GameFlags = 0;
|
g_GameFlags = 0;
|
||||||
gMC.equip |= 0x100;
|
gMC.equip |= EQUIP_NIKUMARU_COUNTER; // Give the player the Nikumaru Counter so the timer appears on-screen
|
||||||
|
|
||||||
// Start loop
|
// Start loop
|
||||||
wait = 0;
|
wait = 0;
|
||||||
|
@ -619,7 +619,7 @@ static int ModeAction(void)
|
||||||
|
|
||||||
gMC.cond &= ~1;
|
gMC.cond &= ~1;
|
||||||
}
|
}
|
||||||
else if (gMC.equip & 2 && gKeyTrg & gKeyMap)
|
else if (gMC.equip & EQUIP_MAP && gKeyTrg & gKeyMap)
|
||||||
{
|
{
|
||||||
BackupSurface(SURFACE_ID_SCREEN_GRAB, &grcGame);
|
BackupSurface(SURFACE_ID_SCREEN_GRAB, &grcGame);
|
||||||
|
|
||||||
|
|
|
@ -217,7 +217,7 @@ void PutMyChar(int fx, int fy)
|
||||||
|
|
||||||
// Draw player
|
// Draw player
|
||||||
RECT rect = gMC.rect;
|
RECT rect = gMC.rect;
|
||||||
if (gMC.equip & 0x40)
|
if (gMC.equip & EQUIP_MIMIGA_MASK)
|
||||||
{
|
{
|
||||||
rect.top += 32;
|
rect.top += 32;
|
||||||
rect.bottom += 32;
|
rect.bottom += 32;
|
||||||
|
@ -232,7 +232,7 @@ void PutMyChar(int fx, int fy)
|
||||||
};
|
};
|
||||||
|
|
||||||
++gMC.bubble;
|
++gMC.bubble;
|
||||||
if (gMC.equip & 0x10 && gMC.flag & 0x100)
|
if (gMC.equip & EQUIP_AIR_TANK && gMC.flag & 0x100)
|
||||||
PutBitmap3(&grcGame, (gMC.x / 0x200) - 12 - (fx / 0x200), (gMC.y / 0x200) - 12 - (fy / 0x200), &rcBubble[gMC.bubble / 2 % 2], SURFACE_ID_CARET);
|
PutBitmap3(&grcGame, (gMC.x / 0x200) - 12 - (fx / 0x200), (gMC.y / 0x200) - 12 - (fy / 0x200), &rcBubble[gMC.bubble / 2 % 2], SURFACE_ID_CARET);
|
||||||
else if (gMC.unit == 1)
|
else if (gMC.unit == 1)
|
||||||
PutBitmap3(&grcGame, (gMC.x / 0x200) - 12 - (fx / 0x200), (gMC.y / 0x200) - 12 - (fy / 0x200), &rcBubble[gMC.bubble / 2 % 2], SURFACE_ID_CARET);
|
PutBitmap3(&grcGame, (gMC.x / 0x200) - 12 - (fx / 0x200), (gMC.y / 0x200) - 12 - (fy / 0x200), &rcBubble[gMC.bubble / 2 % 2], SURFACE_ID_CARET);
|
||||||
|
@ -291,11 +291,11 @@ void ActMyChar_Normal(BOOL bKey)
|
||||||
// Stop boosting and refuel
|
// Stop boosting and refuel
|
||||||
gMC.boost_sw = 0;
|
gMC.boost_sw = 0;
|
||||||
|
|
||||||
if (gMC.equip & 1)
|
if (gMC.equip & EQUIP_BOOSTER_0_8)
|
||||||
{
|
{
|
||||||
gMC.boost_cnt = 50;
|
gMC.boost_cnt = 50;
|
||||||
}
|
}
|
||||||
else if (gMC.equip & 0x20)
|
else if (gMC.equip & EQUIP_BOOSTER_2_0)
|
||||||
{
|
{
|
||||||
gMC.boost_cnt = 50;
|
gMC.boost_cnt = 50;
|
||||||
}
|
}
|
||||||
|
@ -354,10 +354,10 @@ void ActMyChar_Normal(BOOL bKey)
|
||||||
// Start boosting
|
// Start boosting
|
||||||
if (bKey)
|
if (bKey)
|
||||||
{
|
{
|
||||||
if (gMC.equip & 0x21 && gKeyTrg & gKeyJump && gMC.boost_cnt != 0)
|
if (gMC.equip & (EQUIP_BOOSTER_0_8 | EQUIP_BOOSTER_2_0) && gKeyTrg & gKeyJump && gMC.boost_cnt != 0)
|
||||||
{
|
{
|
||||||
// Booster 0.8
|
// Booster 0.8
|
||||||
if (gMC.equip & 1)
|
if (gMC.equip & EQUIP_BOOSTER_0_8)
|
||||||
{
|
{
|
||||||
gMC.boost_sw = 1;
|
gMC.boost_sw = 1;
|
||||||
|
|
||||||
|
@ -366,7 +366,7 @@ void ActMyChar_Normal(BOOL bKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Booster 2.0
|
// Booster 2.0
|
||||||
if (gMC.equip & 0x20)
|
if (gMC.equip & EQUIP_BOOSTER_2_0)
|
||||||
{
|
{
|
||||||
if (gKey & gKeyUp)
|
if (gKey & gKeyUp)
|
||||||
{
|
{
|
||||||
|
@ -414,7 +414,7 @@ void ActMyChar_Normal(BOOL bKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Slow down when stopped boosting (Booster 2.0)
|
// Slow down when stopped boosting (Booster 2.0)
|
||||||
if (gMC.equip & 0x20 && gMC.boost_sw != 0 && (!(gKey & gKeyJump) || gMC.boost_cnt == 0))
|
if (gMC.equip & EQUIP_BOOSTER_2_0 && gMC.boost_sw != 0 && (!(gKey & gKeyJump) || gMC.boost_cnt == 0))
|
||||||
{
|
{
|
||||||
if (gMC.boost_sw == 1)
|
if (gMC.boost_sw == 1)
|
||||||
gMC.xm /= 2;
|
gMC.xm /= 2;
|
||||||
|
@ -475,7 +475,7 @@ void ActMyChar_Normal(BOOL bKey)
|
||||||
gMC.ym += 0x55;
|
gMC.ym += 0x55;
|
||||||
|
|
||||||
// Booster 2.0 forces and effects
|
// Booster 2.0 forces and effects
|
||||||
if (gMC.equip & 0x20 && gMC.boost_sw != 0)
|
if (gMC.equip & EQUIP_BOOSTER_2_0 && gMC.boost_sw != 0)
|
||||||
{
|
{
|
||||||
if (gMC.boost_sw == 1)
|
if (gMC.boost_sw == 1)
|
||||||
{
|
{
|
||||||
|
@ -525,7 +525,7 @@ void ActMyChar_Normal(BOOL bKey)
|
||||||
gMC.ym += gravity1;
|
gMC.ym += gravity1;
|
||||||
}
|
}
|
||||||
// Booster 0.8
|
// Booster 0.8
|
||||||
else if (gMC.equip & 1 && gMC.boost_sw != 0 && gMC.ym > -0x400)
|
else if (gMC.equip & EQUIP_BOOSTER_0_8 && gMC.boost_sw != 0 && gMC.ym > -0x400)
|
||||||
{
|
{
|
||||||
// Upwards force
|
// Upwards force
|
||||||
gMC.ym -= 0x20;
|
gMC.ym -= 0x20;
|
||||||
|
@ -809,7 +809,7 @@ void ActMyChar_Stream(BOOL bKey)
|
||||||
|
|
||||||
void AirProcess(void)
|
void AirProcess(void)
|
||||||
{
|
{
|
||||||
if (gMC.equip & 0x10)
|
if (gMC.equip & EQUIP_AIR_TANK)
|
||||||
{
|
{
|
||||||
gMC.air = 1000;
|
gMC.air = 1000;
|
||||||
gMC.air_get = 0;
|
gMC.air_get = 0;
|
||||||
|
|
14
src/MyChar.h
14
src/MyChar.h
|
@ -5,6 +5,20 @@
|
||||||
// TODO - When I add bitmask constants for gMC.flags...
|
// TODO - When I add bitmask constants for gMC.flags...
|
||||||
// 0x100 is a 'player is underwater' flag
|
// 0x100 is a 'player is underwater' flag
|
||||||
|
|
||||||
|
// gMC.equip
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
EQUIP_BOOSTER_0_8 = 1,
|
||||||
|
EQUIP_MAP = 2,
|
||||||
|
EQUIP_ARMS_BARRIER = 4,
|
||||||
|
EQUIP_TURBOCHARGE = 8,
|
||||||
|
EQUIP_AIR_TANK = 0x10,
|
||||||
|
EQUIP_BOOSTER_2_0 = 0x20,
|
||||||
|
EQUIP_MIMIGA_MASK = 0x40,
|
||||||
|
EQUIP_WHIMSICAL_STAR = 0x80,
|
||||||
|
EQUIP_NIKUMARU_COUNTER = 0x100
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct MYCHAR
|
typedef struct MYCHAR
|
||||||
{
|
{
|
||||||
unsigned char cond;
|
unsigned char cond;
|
||||||
|
|
|
@ -48,7 +48,7 @@ void AddExpMyChar(int x)
|
||||||
{
|
{
|
||||||
gArmsData[gSelectedArms].exp = gArmsLevelTable[arms_code].exp[lv];
|
gArmsData[gSelectedArms].exp = gArmsLevelTable[arms_code].exp[lv];
|
||||||
|
|
||||||
if (gMC.equip & 0x80)
|
if (gMC.equip & EQUIP_WHIMSICAL_STAR)
|
||||||
{
|
{
|
||||||
if (gMC.star < 3)
|
if (gMC.star < 3)
|
||||||
++gMC.star;
|
++gMC.star;
|
||||||
|
@ -136,11 +136,11 @@ void DamageMyChar(int damage)
|
||||||
gMC.life -= (short)damage;
|
gMC.life -= (short)damage;
|
||||||
|
|
||||||
// Lose a whimsical star
|
// Lose a whimsical star
|
||||||
if (gMC.equip & 0x80 && gMC.star > 0)
|
if (gMC.equip & EQUIP_WHIMSICAL_STAR && gMC.star > 0)
|
||||||
gMC.star = (short)gMC.star - 1; // For some reason, this does a cast to short. Might not be accurate to the original source code (possibly, Pixel was just being careful about int size/conversion, or this is from some weird macro)
|
gMC.star = (short)gMC.star - 1; // For some reason, this does a cast to short. Might not be accurate to the original source code (possibly, Pixel was just being careful about int size/conversion, or this is from some weird macro)
|
||||||
|
|
||||||
// Lose experience
|
// Lose experience
|
||||||
if (gMC.equip & 4)
|
if (gMC.equip & EQUIP_ARMS_BARRIER)
|
||||||
gArmsData[gSelectedArms].exp -= damage;
|
gArmsData[gSelectedArms].exp -= damage;
|
||||||
else
|
else
|
||||||
gArmsData[gSelectedArms].exp -= damage * 2;
|
gArmsData[gSelectedArms].exp -= damage * 2;
|
||||||
|
@ -373,7 +373,7 @@ void PutMyAir(int x, int y)
|
||||||
{112, 80, 144, 88},
|
{112, 80, 144, 88},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (gMC.equip & 0x10)
|
if (gMC.equip & EQUIP_AIR_TANK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (gMC.air_get != 0)
|
if (gMC.air_get != 0)
|
||||||
|
@ -400,7 +400,7 @@ void PutTimeCounter(int x, int y)
|
||||||
{128, 104, 160, 112},
|
{128, 104, 160, 112},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (gMC.equip & 0x100)
|
if (gMC.equip & EQUIP_NIKUMARU_COUNTER)
|
||||||
{
|
{
|
||||||
// Draw clock and increase time
|
// Draw clock and increase time
|
||||||
if (g_GameFlags & 2)
|
if (g_GameFlags & 2)
|
||||||
|
@ -439,7 +439,7 @@ BOOL SaveTimeCounter(void)
|
||||||
char path[MAX_PATH];
|
char path[MAX_PATH];
|
||||||
|
|
||||||
// Quit if player doesn't have the Nikumaru Counter
|
// Quit if player doesn't have the Nikumaru Counter
|
||||||
if (!(gMC.equip & 0x100))
|
if (!(gMC.equip & EQUIP_NIKUMARU_COUNTER))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
// Get last time
|
// Get last time
|
||||||
|
|
|
@ -842,7 +842,7 @@ void ActNpc111(NPCHAR *npc)
|
||||||
npc->rect = rcRight[npc->ani_no];
|
npc->rect = rcRight[npc->ani_no];
|
||||||
|
|
||||||
// Use a different sprite if the player is wearing the Mimiga Mask
|
// Use a different sprite if the player is wearing the Mimiga Mask
|
||||||
if (gMC.equip & 0x40)
|
if (gMC.equip & EQUIP_MIMIGA_MASK)
|
||||||
{
|
{
|
||||||
npc->rect.top += 32;
|
npc->rect.top += 32;
|
||||||
npc->rect.bottom += 32;
|
npc->rect.bottom += 32;
|
||||||
|
@ -919,7 +919,7 @@ void ActNpc112(NPCHAR *npc)
|
||||||
npc->rect = rcRight[npc->ani_no];
|
npc->rect = rcRight[npc->ani_no];
|
||||||
|
|
||||||
// Use a different sprite if the player is wearing the Mimiga Mask
|
// Use a different sprite if the player is wearing the Mimiga Mask
|
||||||
if (gMC.equip & 0x40)
|
if (gMC.equip & EQUIP_MIMIGA_MASK)
|
||||||
{
|
{
|
||||||
npc->rect.top += 32;
|
npc->rect.top += 32;
|
||||||
npc->rect.bottom += 32;
|
npc->rect.bottom += 32;
|
||||||
|
|
|
@ -1277,7 +1277,7 @@ void ActNpc150(NPCHAR *npc)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use a different sprite if the player is wearing the Mimiga Mask
|
// Use a different sprite if the player is wearing the Mimiga Mask
|
||||||
if (gMC.equip & 0x40)
|
if (gMC.equip & EQUIP_MIMIGA_MASK)
|
||||||
{
|
{
|
||||||
npc->rect.top += 32;
|
npc->rect.top += 32;
|
||||||
npc->rect.bottom += 32;
|
npc->rect.bottom += 32;
|
||||||
|
|
|
@ -999,7 +999,7 @@ void ActNpc212(NPCHAR *npc)
|
||||||
npc->rect = rcRight[npc->ani_no];
|
npc->rect = rcRight[npc->ani_no];
|
||||||
|
|
||||||
// Use different sprite if player is wearing the Mimiga Mask
|
// Use different sprite if player is wearing the Mimiga Mask
|
||||||
if (gMC.equip & 0x40)
|
if (gMC.equip & EQUIP_MIMIGA_MASK)
|
||||||
{
|
{
|
||||||
if (npc->ani_no > 1)
|
if (npc->ani_no > 1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -443,7 +443,7 @@ void ActNpc283(NPCHAR *npc)
|
||||||
else
|
else
|
||||||
npc->ani_no = 5;
|
npc->ani_no = 5;
|
||||||
|
|
||||||
if (gMC.equip & 0x20)
|
if (gMC.equip & EQUIP_BOOSTER_2_0)
|
||||||
{
|
{
|
||||||
if (npc->act_wait % 10 == 1)
|
if (npc->act_wait % 10 == 1)
|
||||||
{
|
{
|
||||||
|
@ -1436,7 +1436,7 @@ void ActNpc294(NPCHAR *npc)
|
||||||
case 1:
|
case 1:
|
||||||
++npc->act_wait;
|
++npc->act_wait;
|
||||||
|
|
||||||
if (gMC.equip & 0x20)
|
if (gMC.equip & EQUIP_BOOSTER_2_0)
|
||||||
{
|
{
|
||||||
npc->x = gMC.x + (64 * 0x200);
|
npc->x = gMC.x + (64 * 0x200);
|
||||||
|
|
||||||
|
@ -1456,7 +1456,7 @@ void ActNpc294(NPCHAR *npc)
|
||||||
|
|
||||||
if (npc->act_wait > 24)
|
if (npc->act_wait > 24)
|
||||||
{
|
{
|
||||||
if (gMC.equip & 0x20)
|
if (gMC.equip & EQUIP_BOOSTER_2_0)
|
||||||
x = npc->x + (Random(-14, 14) * 0x200 * 0x10);
|
x = npc->x + (Random(-14, 14) * 0x200 * 0x10);
|
||||||
else
|
else
|
||||||
x = npc->x + (Random(-11, 11) * 0x200 * 0x10);
|
x = npc->x + (Random(-11, 11) * 0x200 * 0x10);
|
||||||
|
|
|
@ -357,7 +357,7 @@ void ShootBullet_Machinegun1(int level)
|
||||||
{
|
{
|
||||||
++wait;
|
++wait;
|
||||||
|
|
||||||
if (gMC.equip & 8)
|
if (gMC.equip & EQUIP_TURBOCHARGE)
|
||||||
{
|
{
|
||||||
if (wait > 1)
|
if (wait > 1)
|
||||||
{
|
{
|
||||||
|
@ -915,7 +915,7 @@ void ShootBullet_Spur(int level)
|
||||||
|
|
||||||
if (gKey & gKeyShot)
|
if (gKey & gKeyShot)
|
||||||
{
|
{
|
||||||
if (gMC.equip & 8)
|
if (gMC.equip & EQUIP_TURBOCHARGE)
|
||||||
AddExpMyChar(3);
|
AddExpMyChar(3);
|
||||||
else
|
else
|
||||||
AddExpMyChar(2);
|
AddExpMyChar(2);
|
||||||
|
|
|
@ -112,7 +112,7 @@ void ActStar(void)
|
||||||
star[i].x += star[i].xm;
|
star[i].x += star[i].xm;
|
||||||
star[i].y += star[i].ym;
|
star[i].y += star[i].ym;
|
||||||
|
|
||||||
if (i < gMC.star && (gMC.equip & 0x80) && (g_GameFlags & 2) && a == i)
|
if (i < gMC.star && (gMC.equip & EQUIP_WHIMSICAL_STAR) && (g_GameFlags & 2) && a == i)
|
||||||
SetBullet(45, star[a].x, star[a].y, 0);
|
SetBullet(45, star[a].x, star[a].y, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ void PutStar(int fx, int fy)
|
||||||
if (gMC.cond & 2)
|
if (gMC.cond & 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(gMC.equip & 0x80))
|
if (!(gMC.equip & EQUIP_WHIMSICAL_STAR))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i)
|
for (i = 0; i < 3; ++i)
|
||||||
|
|
Loading…
Add table
Reference in a new issue