- [NEW] Anbernics en el lloc i ja se poden recollir

- [CHG] Canviats uns pixels en les portes
- [NEW] Sequencia de final de joc acabada
- [NEW] Al pillar un booster fa sorollet
- Treballant en el prólogo
This commit is contained in:
2024-10-07 13:35:01 +02:00
parent f38d50e7f9
commit fa97ea79e8
30 changed files with 411 additions and 61 deletions

View File

@@ -650,6 +650,7 @@ namespace actor
if (act->name[0] == 'B')
{ // Es un booster
hero::collectBooster(&act->name[5], (act->name[2] - 48) * 10 + (act->name[3] - 48));
audio::playSound("snd_boost.wav", SOUND_BASIC);
}
else if (act->name[0] == 'S')
{ // Es un skill
@@ -669,6 +670,11 @@ namespace actor
return result;
}
}
else if (act->name[0] == 'A')
{
hero::pickAnbernic(act->name);
audio::playSound("snd_pick.wav", SOUND_BASIC);
}
else
{
SDL_assert(false);
@@ -727,7 +733,7 @@ namespace actor
act->push |= PUSH_XP;
}
}
else if (controller::down(KEY_UP)) //input::keyDown(SDL_SCANCODE_UP) || input::keyDown(config::getKey(KEY_UP)))
else if (controller::down(KEY_UP)) // input::keyDown(SDL_SCANCODE_UP) || input::keyDown(config::getKey(KEY_UP)))
{
hero::useBoostRun();
act->orient = PUSH_YN;
@@ -747,7 +753,7 @@ namespace actor
act->push |= PUSH_YN;
}
}
else if (controller::down(KEY_DOWN)) //input::keyDown(SDL_SCANCODE_DOWN) || input::keyDown(config::getKey(KEY_DOWN)))
else if (controller::down(KEY_DOWN)) // input::keyDown(SDL_SCANCODE_DOWN) || input::keyDown(config::getKey(KEY_DOWN)))
{
hero::useBoostRun();
act->orient = PUSH_YP;
@@ -767,7 +773,7 @@ namespace actor
act->push |= PUSH_YP;
}
}
//if ((input::keyPressed(SDL_SCANCODE_RETURN) || input::keyPressed(config::getKey(KEY_PICK))) && (hero::getSkills() & SKILL_PANTS))
// if ((input::keyPressed(SDL_SCANCODE_RETURN) || input::keyPressed(config::getKey(KEY_PICK))) && (hero::getSkills() & SKILL_PANTS))
if ((controller::pressed(KEY_PICK)) && (hero::getSkills() & SKILL_PANTS))
{
if (picked)
@@ -815,7 +821,7 @@ namespace actor
}
}
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) && (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)))
{
@@ -869,7 +875,8 @@ namespace actor
if (moving)
{
act->flags |= FLAG_ANIMATED;
if ((config::getSoundMode()==SOUND_ALL) && act->react_mask==0 && ( (act->below) || (act->pos.z==0) )) audio::resumeChannel(walk_channel);
if ((config::getSoundMode() == SOUND_ALL) && act->react_mask == 0 && ((act->below) || (act->pos.z == 0)))
audio::resumeChannel(walk_channel);
}
else
{
@@ -885,7 +892,7 @@ namespace actor
act->push |= act->mov_push;
}
void changeMoving(actor_t *act, const bool silent=false)
void changeMoving(actor_t *act, const bool silent = false)
{
if (!silent && !push_sound_already_playing)
{
@@ -1035,7 +1042,11 @@ namespace actor
act2->anim_frame = 2;
act->anim_wait = act2->anim_wait = 1;
actor_t *other = first;
while (other) { other->flags &= ~FLAG_MOVING; other = other->next; }
while (other)
{
other->flags &= ~FLAG_MOVING;
other = other->next;
}
actor::setDirty(act2);
room::cycleColor(4);
return;
@@ -1488,7 +1499,7 @@ namespace actor
draw::stencil::set(act->tag);
draw::draw(x, y, act->bmp_rect.w, act->bmp_rect.h, act->bmp_rect.x + ao, act->bmp_rect.y + oo, flip);
draw::swapcol(1, room::getColor(0)); // Tornem al color per defecte
if (act->flags & FLAG_SPECIAL)
if ((act->flags & FLAG_SPECIAL) && (act->name[0] != 'A'))
{
draw::setSource(brilli);
const int dx = (act->bmp_rect.w - 22) >> 1;
@@ -1898,6 +1909,7 @@ namespace actor
int skills = SKILL_NONE;
int parts = PART_NONE;
bool boosters_collected[100];
bool anbernics[10] = {false, false, false, false, false, false, false, false, false, false};
vec3_t first_pos = {0, 0, 0};
int first_orient = 0;
bool dead = false;
@@ -1917,10 +1929,13 @@ namespace actor
lives = 8;
skills = SKILL_NONE;
parts = PART_NONE;
for (int i = 0; i < 10; ++i)
anbernics[i] = false;
for (int i = 0; i < 100; ++i)
boosters_collected[i] = false;
brilli = draw::getSurface("objectes.gif");
if ( (config::getSoundMode()==SOUND_ALL) ) {
if ((config::getSoundMode() == SOUND_ALL))
{
walk_channel = audio::playSound("snd_walk.wav", SOUND_ALL, -1);
audio::pauseChannel(walk_channel);
}
@@ -2181,6 +2196,25 @@ namespace actor
return parts;
}
void pickAnbernic(char *name)
{
anbernics[name[8] - 48] = true;
}
bool wasAnbernicCollected(char *name)
{
return anbernics[name[8] - 48];
}
int getNumAmbernicsCollected()
{
int count = 0;
for (auto anbernic : anbernics)
if (anbernic)
count++;
return count;
}
void move(int *x, int *y, int *z)
{
actor_t *hero = actor::find("HERO");