cave-story-md
cave-story-md copied to clipboard
Room-specific hearts and missiles
Y'know those hearts and missiles not unlike those found in the Egg Observatory? I think the amounts of missile ammo and HP they give out aren't accurate. One missile in the PC version equates to exactly one missile, but in the MD version, that's not the case. I think the hearts are only supposed to replenish 2 HP, not 5.
Apparently my check for OPTION2 flag isn't right... NXEngine seems to treat them as 4 objects instead of 2, so I'll have to figure that out.
Of course it isn't that easy...
So in the original game it is 2 objects like I'm doing it. Something else about my logic is flawed then...
Hmm...
I looked at CSE2.
The amount gained is based on the exp value of the object. (MycHit.cpp)
if (hit != 0 && gNPC[i].code_char == 86)
{
PlaySoundObject(42, SOUND_MODE_PLAY);
AddBulletMyChar(gNPC[i].code_event, gNPC[i].exp);
gNPC[i].cond = 0;
}
if (hit != 0 && gNPC[i].code_char == 87)
{
PlaySoundObject(20, SOUND_MODE_PLAY);
AddLifeMyChar(gNPC[i].exp);
gNPC[i].cond = 0;
}
The exp of the missile pickup can be 1 or 3. (ActNpc086)
switch (npc->exp)
{
case 1:
npc->rect = rect1[npc->ani_no];
break;
case 3:
npc->rect = rect3[npc->ani_no];
break;
}
The exp of the heart pickup can be 2 or 6. (ActNpc087)
switch (npc->exp)
{
case 2:
npc->rect = rect2[npc->ani_no];
break;
case 6:
npc->rect = rect6[npc->ani_no];
break;
}
But then the hidden items... set exp to 2 for both. (ActNpc125)
if (npc->life < 990)
{
SetDestroyNpChar(npc->x, npc->y, npc->view.back, 8);
PlaySoundObject(70, SOUND_MODE_PLAY);
if (npc->direct == 0)
SetNpChar(87, npc->x, npc->y, 0, 0, 2, NULL, 0);
else
SetNpChar(86, npc->x, npc->y, 0, 0, 2, NULL, 0);
npc->cond = 0;
}