6 Commits
v1.3 ... v1.5

Author SHA1 Message Date
6c30e6aeec - [NEW] Numero de versió en la pantalla inicial 2024-10-31 13:48:44 +01:00
dbac3eb3ee [FIX] [#7] Es pot botar damunt de les peces a arreplegar 2024-10-31 13:18:03 +01:00
3946ea749b - [FIX] [#6] En l'habitacio de baix la piscina, botant per damunt les bambolles es pot passar per damunt d'una porta
- [FIX] [#10] Avistat problema de enganzar-se en la porta YP de l'habitacio 58
2024-10-31 12:26:46 +01:00
0ab4ca06e3 - [FIX] [#2] Quan et donen una cat's life, ja no torna la música del joc
- [FIX] [#3] Quan entres a la habitació de la depuradora ...
- [FIX] [#4] ficar anbernics recopilades en el game over i altres pantalles de resum
- [FIX] [#5] que al acabar el joc la seuquencia acabe amb els stats, com el game over
2024-10-31 12:08:10 +01:00
a8892f4f8c - [FIX] Els enemics podien ser botats per damunt sense morir
- [FIX] Els precipicis podien ser evitats mantenint el bot pulsat.
2024-10-11 19:22:48 +02:00
4d1739d8e1 - [FIX] Quan te tocava una cat's life, petava el mame 2024-10-11 19:06:50 +02:00
6 changed files with 135 additions and 93 deletions

View File

@@ -643,34 +643,7 @@ namespace actor
} }
} }
uint8_t push(actor_t *source, actor_t *act, uint8_t push) uint8_t PickSpecial(actor_t *act, uint8_t result = 0)
{
uint8_t result = 0;
if ((act->flags & FLAG_PUSHABLE) && (!(source->flags & FLAG_HERO) || (hero::getSkills() & SKILL_GLOVES) || (push == PUSH_ZN)))
act->push |= push;
if ((act->flags & FLAG_REACTIVE) && (act->react_mask & push))
{
if (act->flags & FLAG_DEADLY)
source->push |= PUSH_KILL;
else
result = act->react_push;
}
if ((source->flags & FLAG_HERO) && (act->flags & FLAG_DISAPPEAR))
{
audio::playSound("snd_disappear.wav", SOUND_BASIC);
act = actor::replaceWithTemplate(act, "EXPLOSION");
act->name[0] = '_';
return PUSH_NONE;
}
if (source->flags & FLAG_DEADLY)
{
act->push |= PUSH_KILL;
}
if (source->flags & FLAG_HERO)
{
if (act->flags & FLAG_SPECIAL)
{ {
if (act->name[0] == 'B') if (act->name[0] == 'B')
{ // Es un booster { // Es un booster
@@ -739,6 +712,38 @@ namespace actor
room::cycleColor(1); room::cycleColor(1);
return PUSH_NONE; return PUSH_NONE;
} }
uint8_t push(actor_t *source, actor_t *act, uint8_t push)
{
uint8_t result = 0;
if ((act->flags & FLAG_PUSHABLE) && (!(source->flags & FLAG_HERO) || (hero::getSkills() & SKILL_GLOVES) || (push == PUSH_ZN)))
act->push |= push;
if ((act->flags & FLAG_REACTIVE) && (act->react_mask & push))
{
if (act->flags & FLAG_DEADLY)
source->push |= PUSH_KILL;
else
result = act->react_push;
}
if ((source->flags & FLAG_HERO) && (act->flags & FLAG_DISAPPEAR))
{
audio::playSound("snd_disappear.wav", SOUND_BASIC);
act = actor::replaceWithTemplate(act, "EXPLOSION");
act->name[0] = '_';
return PUSH_NONE;
}
if (source->flags & FLAG_DEADLY)
{
act->push |= PUSH_KILL;
}
if (source->flags & FLAG_HERO)
{
if (act->flags & FLAG_SPECIAL)
{
return PickSpecial(act, result);
}
} }
return result; return result;
} }
@@ -780,7 +785,11 @@ namespace actor
{ {
hero::useBoostRun(); hero::useBoostRun();
act->orient = PUSH_XP; act->orient = PUSH_XP;
if (((act->pos.x + act->size.x) < max.x && act->pos.y >= min.y && (act->pos.y + act->size.y) <= max.y) || ((room::getDoors() & DOOR_XP) && (act->pos.y >= 24) && (act->pos.y <= 32))) if (
( ((act->pos.x + act->size.x) < max.x) && (act->pos.y >= min.y) && ((act->pos.y + act->size.y) <= max.y) )
||
( (room::getDoors() & DOOR_XP) && (act->pos.y >= 24) && (act->pos.y <= 32) )
)
{ {
moving = true; moving = true;
// Si està en les vores d'una porta, espenta cap a centrar-lo // Si està en les vores d'una porta, espenta cap a centrar-lo
@@ -911,10 +920,23 @@ namespace actor
actor::actor_t *future_below = any_below_me(act); actor::actor_t *future_below = any_below_me(act);
// if ((input::keyDown(SDL_SCANCODE_SPACE) || input::keyDown(config::getKey(KEY_JUMP))) && // if ((input::keyDown(SDL_SCANCODE_SPACE) || input::keyDown(config::getKey(KEY_JUMP))) &&
if ((controller::down(KEY_JUMP)) && ((hero::getSkills() & SKILL_SHOES) || actor::hero::isPrologo()) if ((controller::down(KEY_JUMP)) && ((hero::getSkills() & SKILL_SHOES) || actor::hero::isPrologo())
&& (act->pos.y + act->size.y) <= max.y && act->pos.y >= min.y && (act->pos.x + act->size.x) <= max.x && act->pos.x >= min.x && act->react_mask == 0 && ((act->pos.z == 0 && room::getFloor() != 11) || (act->below || future_below))) && (act->pos.y + act->size.y) <= max.y && act->pos.y >= min.y &&
(act->pos.x + act->size.x) <= max.x && act->pos.x >= min.x &&
act->react_mask == 0 &&
( (act->pos.z == 0 && room::getFloor() != 11 && room::getExit(ZN)==-1) || (act->below || future_below) )
)
{ {
audio::pauseChannel(walk_channel); audio::pauseChannel(walk_channel);
audio::playSound("snd_jump.wav", SOUND_BASIC); audio::playSound("snd_jump.wav", SOUND_BASIC);
// [RZC 31/10/2024] Hack per a que al aterrar sobre els especials els pille
if (!act->below && future_below && future_below->flags & FLAG_SPECIAL)
{
act->push |= PickSpecial(future_below);
}
// [RZC 11/10/2024] Hack per a que al aterrar sobre els que maten, te maten
if (!act->below && future_below && future_below->flags & FLAG_DEADLY)
act->push |= PUSH_KILL;
// [RZC 01/10/2024] Hack per a que al aterrar sobre els que desapareixen puga botar sobre ells, i a més ells desapareguen // [RZC 01/10/2024] Hack per a que al aterrar sobre els que desapareixen puga botar sobre ells, i a més ells desapareguen
if (!act->below && future_below && future_below->flags & FLAG_DISAPPEAR) if (!act->below && future_below && future_below->flags & FLAG_DISAPPEAR)
actor::push(act, future_below, PUSH_ZN); actor::push(act, future_below, PUSH_ZN);
@@ -1261,7 +1283,7 @@ namespace actor
{ {
act->pos.x += vel; act->pos.x += vel;
actor::actor_t *other = actor::get_collision(act); actor::actor_t *other = actor::get_collision(act);
if (other || ((act->pos.x + act->size.x) > max.x && (!(room::getDoors() & DOOR_XP) || (act->pos.y != 28) || !(act->flags & FLAG_HERO)))) if (other || ((act->pos.x + act->size.x) > max.x && (!(room::getDoors() & DOOR_XP) || (act->pos.y != 28) || (act->pos.z != room::getDoor(XP) * 4) || !(act->flags & FLAG_HERO))))
{ {
if (other) { if (other) {
uint8_t push_value = push(act, other, PUSH_XP); uint8_t push_value = push(act, other, PUSH_XP);
@@ -1342,7 +1364,7 @@ namespace actor
{ {
act->pos.y += vel; act->pos.y += vel;
actor::actor_t *other = actor::get_collision(act); actor::actor_t *other = actor::get_collision(act);
if (other || ((act->pos.y + act->size.y) > max.y && (!(room::getDoors() & DOOR_YP) || (act->pos.x != 28) || !(act->flags & FLAG_HERO)))) if (other || ((act->pos.y + act->size.y) > max.y && (!(room::getDoors() & DOOR_YP) || (act->pos.x != 28) || (act->pos.z != room::getDoor(YP) * 4) || !(act->flags & FLAG_HERO))))
{ {
if (other) { if (other) {
uint8_t push_value = push(act, other, PUSH_YP); uint8_t push_value = push(act, other, PUSH_YP);
@@ -2077,6 +2099,7 @@ namespace actor
brilli = draw::getSurface("objectes.gif"); brilli = draw::getSurface("objectes.gif");
if ((config::getSoundMode() == SOUND_ALL)) if ((config::getSoundMode() == SOUND_ALL))
{ {
if (walk_channel != -1) audio::stopChannel(walk_channel);
walk_channel = audio::playSound("snd_walk.wav", SOUND_ALL, -1); walk_channel = audio::playSound("snd_walk.wav", SOUND_ALL, -1);
audio::pauseChannel(walk_channel); audio::pauseChannel(walk_channel);
} }
@@ -2222,6 +2245,8 @@ namespace actor
const int getSkillFromString(char *skill) const int getSkillFromString(char *skill)
{ {
if ( (strcmp(skill, "ALL")==0) || (strcmp(skill, "SKILLS")==0) ) return SKILL_SHOES | SKILL_GLOVES | SKILL_PANTS | SKILL_BAG;
static const char *skillset_name[4] = {"SHOES", "GLOVES", "PANTS", "BAG"}; static const char *skillset_name[4] = {"SHOES", "GLOVES", "PANTS", "BAG"};
for (int i = 0; i < 4; ++i) for (int i = 0; i < 4; ++i)
{ {
@@ -2259,10 +2284,10 @@ namespace actor
bool giveSkill(char *skill) bool giveSkill(char *skill)
{ {
const int skill_number = getSkillFromString(skill); const int skill_number = getSkillFromString(skill);
if (skill_number==SKILL_SHOES) modules::game::setMissatge(" JA TENS LES SABATES!- ARA JA POTS BOTAR!"); if (skill_number | SKILL_SHOES) modules::game::setMissatge(" JA TENS LES SABATES!- ARA JA POTS BOTAR!");
else if (skill_number==SKILL_GLOVES) modules::game::setMissatge(" JA TENS ELS GUANTS!- ARA JA POTS ESPENTAR!"); else if (skill_number | SKILL_GLOVES) modules::game::setMissatge(" JA TENS ELS GUANTS!- ARA JA POTS ESPENTAR!");
else if (skill_number==SKILL_PANTS) modules::game::setMissatge(" JA TENS ELS PANTALONS!- JA POTS AGAFAR COSES!"); else if (skill_number | SKILL_PANTS) modules::game::setMissatge(" JA TENS ELS PANTALONS!- JA POTS AGAFAR COSES!");
else if (skill_number==SKILL_BAG) modules::game::setMissatge(" JA TENS LA MOTXILLA!- A ARREPLEGAR PECES!"); else if (skill_number | SKILL_BAG) modules::game::setMissatge(" JA TENS LA MOTXILLA!- A ARREPLEGAR PECES!");
return giveSkill(skill_number); return giveSkill(skill_number);
} }
@@ -2289,6 +2314,8 @@ namespace actor
const int getPartFromString(char *part) const int getPartFromString(char *part)
{ {
if ( (strcmp(part, "ALL")==0) || (strcmp(part, "PARTS")==0) ) return 0x3f;
static const char *partset_name[6] = {"FILTER", "PUMP", "TIMER", "SALT", "PIPE", "ELBOW"}; static const char *partset_name[6] = {"FILTER", "PUMP", "TIMER", "SALT", "PIPE", "ELBOW"};
for (int i = 0; i < 6; ++i) for (int i = 0; i < 6; ++i)
{ {

View File

@@ -72,6 +72,7 @@ int main(int argc, char *argv[])
if (SDL_GetTicks()-current_ticks >= game::ticks_per_frame) if (SDL_GetTicks()-current_ticks >= game::ticks_per_frame)
{ {
current_ticks = SDL_GetTicks();
if (!game::loop()) game::should_exit = true; if (!game::loop()) game::should_exit = true;
input::updateKey(SDL_SCANCODE_UNKNOWN); input::updateKey(SDL_SCANCODE_UNKNOWN);
input::updateKeypressed(SDL_SCANCODE_UNKNOWN); input::updateKeypressed(SDL_SCANCODE_UNKNOWN);
@@ -79,7 +80,6 @@ int main(int argc, char *argv[])
input::updateWheel(0); input::updateWheel(0);
input::updatePadBtn(SDL_CONTROLLER_BUTTON_INVALID); input::updatePadBtn(SDL_CONTROLLER_BUTTON_INVALID);
input::updatePadBtnPressed(SDL_CONTROLLER_BUTTON_INVALID); input::updatePadBtnPressed(SDL_CONTROLLER_BUTTON_INVALID);
current_ticks = SDL_GetTicks();
} }
} }

View File

@@ -16,8 +16,8 @@ namespace modules
void init() void init()
{ {
audio::playMusic("mus_gameover.ogg", 0); if (audio::getCurrentMusic() != "mus_gameover.ogg") audio::playMusic("mus_gameover.ogg", 0);
gat = actor::createFromTemplate("GAT-NEGRE"); gat = actor::createFromTemplate("GAT-BATMAN");
} }
bool loop() bool loop()
@@ -26,6 +26,7 @@ namespace modules
{ {
if (gat) actor::remove(gat); if (gat) actor::remove(gat);
gat = nullptr; gat = nullptr;
audio::playMusic("mus_ingame.ogg");
return false; return false;
} }

View File

@@ -21,6 +21,7 @@ namespace modules
void init(bool go_direct_to_credits) void init(bool go_direct_to_credits)
{ {
audio::stopAllChannel();
stage = go_direct_to_credits ? 2 : 0; stage = go_direct_to_credits ? 2 : 0;
time = SDL_GetTicks(); time = SDL_GetTicks();
if (go_direct_to_credits) time += 5000; if (go_direct_to_credits) time += 5000;
@@ -55,7 +56,7 @@ namespace modules
const bool shouldGoToNext() const bool shouldGoToNext()
{ {
if (SDL_GetTicks()-time < 1000) return false; if (SDL_GetTicks()-time < 1000) return false;
return (SDL_GetTicks()-time > (stage==15||stage==16?10000:5000)) || return ( (stage<16) && (SDL_GetTicks()-time > (stage==15?10000:5000)) ) ||
(controller::pressed(KEY_JUMP)) || (controller::pressed(KEY_PICK)) || (controller::pressed(KEY_JUMP)) || (controller::pressed(KEY_PICK)) ||
(input::keyPressed(SDL_SCANCODE_SPACE)) || (input::keyPressed(SDL_SCANCODE_RETURN)); (input::keyPressed(SDL_SCANCODE_SPACE)) || (input::keyPressed(SDL_SCANCODE_RETURN));
} }
@@ -147,13 +148,19 @@ namespace modules
draw::print2("GRACIES PER JUGAR!", 11, 9, PURPLE, FONT_ZOOM_VERTICAL); draw::print2("GRACIES PER JUGAR!", 11, 9, PURPLE, FONT_ZOOM_VERTICAL);
draw::print2(actor::stats::getRoomsVisited(), 2, 8, 14, TEAL, FONT_ZOOM_NONE); draw::print2(actor::stats::getRoomsVisited(), 2, 8, 14, TEAL, FONT_ZOOM_NONE);
draw::print2("HABITACIONS VISITADES", 11, 14, GREEN, FONT_ZOOM_NONE); draw::print2("HABITACIONS VISITADES", 13, 14, GREEN, FONT_ZOOM_NONE);
draw::print2(actor::stats::getLivesLost(), 2, 11, 16, TEAL, FONT_ZOOM_NONE); draw::print2(actor::stats::getLivesLost(), 2, 8, 16, TEAL, FONT_ZOOM_NONE);
draw::print2("VIDES PERDUDES", 14, 16, GREEN, FONT_ZOOM_NONE); draw::print2("VIDES PERDUDES", 13, 16, GREEN, FONT_ZOOM_NONE);
draw::print2(time_text, 11, 18, TEAL, FONT_ZOOM_NONE); draw::print2(time_text, 4, 18, TEAL, FONT_ZOOM_NONE);
draw::print2("TEMPS TOTAL", 18, 18, GREEN, FONT_ZOOM_NONE); draw::print2("TEMPS TOTAL", 13, 18, GREEN, FONT_ZOOM_NONE);
if (actor::hero::getNumAmbernicsCollected()>0)
{
draw::print2(actor::hero::getNumAmbernicsCollected(), 2, 8, 20, TEAL, FONT_ZOOM_NONE);
draw::print2("ANBERNICS ARREPLEGADES", 13, 20, GREEN, FONT_ZOOM_NONE);
}
break; break;

View File

@@ -53,7 +53,7 @@ namespace modules
draw::color(1); draw::color(1);
draw::swapcol(1, WHITE); draw::swapcol(1, WHITE);
actor::update(heroi, false); actor::update(heroi, false);
actor::drawAt(heroi, 150, 160); actor::drawAt(heroi, 150, 176);
draw::print2("THE POOL", 16, 3, TEAL, FONT_ZOOM_VERTICAL); draw::print2("THE POOL", 16, 3, TEAL, FONT_ZOOM_VERTICAL);
@@ -63,21 +63,27 @@ namespace modules
{ {
int num_objectes = 0; int num_objectes = 0;
for (int i=0;i<4;++i) if (actor::hero::getPrologoObjectState(i)==PROLOGO_OBJECT_LEFT) num_objectes++; for (int i=0;i<4;++i) if (actor::hero::getPrologoObjectState(i)==PROLOGO_OBJECT_LEFT) num_objectes++;
draw::print2(num_objectes, 2, 11, 12, TEAL, FONT_ZOOM_NONE); draw::print2(num_objectes, 2, 8, 12, TEAL, FONT_ZOOM_NONE);
draw::print2("OBJECTES DEJATS", 14, 12, GREEN, FONT_ZOOM_NONE); draw::print2("OBJECTES DEJATS", 13, 12, GREEN, FONT_ZOOM_NONE);
} else { } else {
draw::print2(actor::stats::getNumPartsCollected(), 2, 11, 12, TEAL, FONT_ZOOM_NONE); draw::print2(actor::stats::getNumPartsCollected(), 2, 8, 12, TEAL, FONT_ZOOM_NONE);
draw::print2("PARTS TROBADES", 14, 12, GREEN, FONT_ZOOM_NONE); draw::print2("PARTS TROBADES", 13, 12, GREEN, FONT_ZOOM_NONE);
} }
draw::print2(actor::stats::getRoomsVisited(), 2, 8, 14, TEAL, FONT_ZOOM_NONE); draw::print2(actor::stats::getRoomsVisited(), 2, 8, 14, TEAL, FONT_ZOOM_NONE);
draw::print2("HABITACIONS VISITADES", 11, 14, GREEN, FONT_ZOOM_NONE); draw::print2("HABITACIONS VISITADES", 13, 14, GREEN, FONT_ZOOM_NONE);
draw::print2(actor::stats::getLivesLost(), 2, 11, 16, TEAL, FONT_ZOOM_NONE); draw::print2(actor::stats::getLivesLost(), 2, 8, 16, TEAL, FONT_ZOOM_NONE);
draw::print2("VIDES PERDUDES", 14, 16, GREEN, FONT_ZOOM_NONE); draw::print2("VIDES PERDUDES", 13, 16, GREEN, FONT_ZOOM_NONE);
draw::print2(time_text, 11, 18, TEAL, FONT_ZOOM_NONE); draw::print2(time_text, 4, 18, TEAL, FONT_ZOOM_NONE);
draw::print2("TEMPS TOTAL", 18, 18, GREEN, FONT_ZOOM_NONE); draw::print2("TEMPS TOTAL", 13, 18, GREEN, FONT_ZOOM_NONE);
if (actor::hero::getNumAmbernicsCollected()>0)
{
draw::print2(actor::hero::getNumAmbernicsCollected(), 2, 8, 20, TEAL, FONT_ZOOM_NONE);
draw::print2("ANBERNICS ARREPLEGADES", 13, 20, GREEN, FONT_ZOOM_NONE);
}
draw::print2("(C) JAILDOCTOR 2024", 11, 28, TEAL, FONT_ZOOM_NONE); draw::print2("(C) JAILDOCTOR 2024", 11, 28, TEAL, FONT_ZOOM_NONE);

View File

@@ -120,6 +120,7 @@ namespace modules
//draw::print2(input::getPadBtnPressed(), 3, 0, 24, RED, FONT_ZOOM_NONE); //draw::print2(input::getPadBtnPressed(), 3, 0, 24, RED, FONT_ZOOM_NONE);
draw::print2("(C) JAILDOCTOR 2024", 11, 28, TEAL, FONT_ZOOM_NONE); draw::print2("(C) JAILDOCTOR 2024", 11, 28, TEAL, FONT_ZOOM_NONE);
draw::print2("v1.5", 36, 28, WHITE, FONT_ZOOM_NONE);
draw::render(); draw::render();
return OPTION_NONE; return OPTION_NONE;