Merge branch 'master' of https://gitea.sustancia.synology.me/JailDoctor/thepool
This commit is contained in:
@@ -676,6 +676,36 @@ namespace actor
|
||||
hero::pickAnbernic(act->name);
|
||||
audio::playSound("snd_pick.wav", SOUND_BASIC);
|
||||
}
|
||||
else if (act->name[0] == 'X')
|
||||
{
|
||||
if (hero::isCarryingPrologoObject()) {
|
||||
audio::playSound("snd_push.wav", SOUND_BASIC);
|
||||
return result;
|
||||
} else {
|
||||
hero::pickPrologoObject(act->name[2]-48);
|
||||
audio::playSound("snd_pick.wav", SOUND_BASIC);
|
||||
}
|
||||
}
|
||||
else if (act->name[0] == 'Y')
|
||||
{
|
||||
const int which = act->name[2]-48;
|
||||
if (hero::getPrologoObjectState(which)==PROLOGO_OBJECT_PICKED)
|
||||
{
|
||||
hero::leavePrologoObject(which);
|
||||
audio::playSound("snd_pick.wav", SOUND_BASIC);
|
||||
act->name[0] = 'Z';
|
||||
room::cycleColor(1);
|
||||
return result;
|
||||
} else {
|
||||
audio::playSound("snd_push.wav", SOUND_BASIC);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
else if (act->name[0] == 'Z')
|
||||
{
|
||||
audio::playSound("snd_push.wav", SOUND_BASIC);
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
SDL_assert(false);
|
||||
@@ -1506,9 +1536,10 @@ namespace actor
|
||||
if (editor::isEditing() && (act == selected) && modules::game::getSection() == modules::game::SECTION_ACTOR)
|
||||
draw::swapcol(1, room::getColor(1)); // Si està seleccionat, que canvie de color
|
||||
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);
|
||||
if (!(act->flags & FLAG_SPECIAL) || !(act->name[0] == 'Y') || (brilli_brilli<4) )
|
||||
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) && (act->name[0] != 'A'))
|
||||
if ((act->flags & FLAG_SPECIAL) && (act->name[0] != 'A') && (act->name[0] != 'Z'))
|
||||
{
|
||||
draw::setSource(brilli);
|
||||
const int dx = (act->bmp_rect.w - 22) >> 1;
|
||||
@@ -1923,10 +1954,11 @@ namespace actor
|
||||
int first_orient = 0;
|
||||
bool dead = false;
|
||||
bool prologo = false;
|
||||
int prologo_objects[4] = {PROLOGO_OBJECT_INITIAL, PROLOGO_OBJECT_INITIAL, PROLOGO_OBJECT_INITIAL, PROLOGO_OBJECT_INITIAL};
|
||||
|
||||
void setPrologo()
|
||||
void setPrologo(const bool value)
|
||||
{
|
||||
prologo = true;
|
||||
prologo = value;
|
||||
}
|
||||
|
||||
const bool isPrologo()
|
||||
@@ -1957,6 +1989,7 @@ namespace actor
|
||||
lives = 8;
|
||||
skills = SKILL_NONE;
|
||||
if (prologo) skills &= SKILL_SHOES;
|
||||
for (int i=0;i<4;++i) prologo_objects[i] = PROLOGO_OBJECT_INITIAL;
|
||||
parts = PART_NONE;
|
||||
for (int i = 0; i < 10; ++i)
|
||||
anbernics[i] = false;
|
||||
@@ -2244,6 +2277,27 @@ namespace actor
|
||||
return count;
|
||||
}
|
||||
|
||||
void pickPrologoObject(int which)
|
||||
{
|
||||
prologo_objects[which] = PROLOGO_OBJECT_PICKED;
|
||||
}
|
||||
|
||||
void leavePrologoObject(int which)
|
||||
{
|
||||
prologo_objects[which] = PROLOGO_OBJECT_LEFT;
|
||||
}
|
||||
|
||||
const bool isCarryingPrologoObject()
|
||||
{
|
||||
for (auto object : prologo_objects) if (object==PROLOGO_OBJECT_PICKED) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
const int getPrologoObjectState(int which)
|
||||
{
|
||||
return prologo_objects[which];
|
||||
}
|
||||
|
||||
void move(int *x, int *y, int *z)
|
||||
{
|
||||
actor_t *hero = actor::find("HERO");
|
||||
|
||||
Reference in New Issue
Block a user