- [NEW] Nou flag per a actors: al tocar-lo desapareix

- [FIX] Els blocs espentables han de rebre l'espenta cap avall encara que no se tinguen els guants
This commit is contained in:
2024-09-24 10:22:18 +02:00
parent eb86874244
commit 15ca066e9b
3 changed files with 11 additions and 2 deletions

View File

@@ -145,7 +145,7 @@ namespace actor
int value = 0; int value = 0;
while (str) while (str)
{ {
value |= util::stringToInt(str, { "none", "hero", "pushable", "reactive", "moving", "animated", "orientable", "deadly", "gravity", "pickable", "special", "noeditor", "inertia" },{ FLAG_NONE, FLAG_HERO, FLAG_PUSHABLE, FLAG_REACTIVE, FLAG_MOVING, FLAG_ANIMATED, FLAG_ORIENTABLE, FLAG_DEADLY, FLAG_GRAVITY, FLAG_PICKABLE, FLAG_SPECIAL, FLAG_NOEDITOR, FLAG_INERTIA }); value |= util::stringToInt(str, { "none", "hero", "pushable", "reactive", "moving", "animated", "orientable", "deadly", "gravity", "pickable", "special", "noeditor", "inertia", "disappear" },{ FLAG_NONE, FLAG_HERO, FLAG_PUSHABLE, FLAG_REACTIVE, FLAG_MOVING, FLAG_ANIMATED, FLAG_ORIENTABLE, FLAG_DEADLY, FLAG_GRAVITY, FLAG_PICKABLE, FLAG_SPECIAL, FLAG_NOEDITOR, FLAG_INERTIA, FLAG_DISAPPEAR });
str = file::readString(buffer, true); str = file::readString(buffer, true);
} }
t->flags = value; t->flags = value;
@@ -268,6 +268,7 @@ namespace actor
if (value & FLAG_GRAVITY) strcat(tmp, "GRAVITY "); if (value & FLAG_GRAVITY) strcat(tmp, "GRAVITY ");
if (value & FLAG_SPECIAL) strcat(tmp, "SPECIAL "); if (value & FLAG_SPECIAL) strcat(tmp, "SPECIAL ");
if (value & FLAG_INERTIA) strcat(tmp, "INERTIA "); if (value & FLAG_INERTIA) strcat(tmp, "INERTIA ");
if (value & FLAG_DISAPPEAR) strcat(tmp, "DISAPPEAR ");
return tmp; return tmp;
} }
@@ -515,7 +516,7 @@ namespace actor
uint8_t push(actor_t *source, actor_t *act, uint8_t push) uint8_t push(actor_t *source, actor_t *act, uint8_t push)
{ {
uint8_t result = 0; uint8_t result = 0;
if ( (act->flags & FLAG_PUSHABLE) && ( !(source->flags&FLAG_HERO) || (hero::getSkills()&SKILL_GLOVES) ) ) act->push |= push; 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_REACTIVE) && (act->react_mask & push) )
{ {
if (act->flags & FLAG_DEADLY) if (act->flags & FLAG_DEADLY)
@@ -523,6 +524,12 @@ namespace actor
else else
result = act->react_push; result = act->react_push;
} }
if (act->flags & FLAG_DISAPPEAR)
{
act = actor::replaceWithTemplate(act, "EXPLOSION");
act->name[0]='_';
}
if (source->flags & FLAG_DEADLY) { if (source->flags & FLAG_DEADLY) {
result |= PUSH_KILL; result |= PUSH_KILL;
} }

View File

@@ -19,6 +19,7 @@
#define FLAG_SPECIAL 512 // Especial (habilitats, poders temporals i parts de l'excavadora) #define FLAG_SPECIAL 512 // Especial (habilitats, poders temporals i parts de l'excavadora)
#define FLAG_NOEDITOR 1024 // No es seleccionable a l'editor (son les portes) #define FLAG_NOEDITOR 1024 // No es seleccionable a l'editor (son les portes)
#define FLAG_INERTIA 2048 // Al rebre una espenta, continua fins tropesar en algo #define FLAG_INERTIA 2048 // Al rebre una espenta, continua fins tropesar en algo
#define FLAG_DISAPPEAR 4096 // Al tocar-lo, desapareix
#define FLAG_SENSIBLE 6 // PUSHABLE or REACTIVE #define FLAG_SENSIBLE 6 // PUSHABLE or REACTIVE
#define FLAG_IGNORE 1025 // HERO or NOEDITOR #define FLAG_IGNORE 1025 // HERO or NOEDITOR

View File

@@ -781,6 +781,7 @@ namespace modules
line+=10; line+=10;
ui::label("FLAGS", 2, line, 96, 11, GRAY); ui::label("FLAGS", 2, line, 96, 11, GRAY);
changed |= btn_check(26, line, "DISA", act->flags, FLAG_DISAPPEAR);
changed |= btn_check(50, line, "INER", act->flags, FLAG_INERTIA); changed |= btn_check(50, line, "INER", act->flags, FLAG_INERTIA);
changed |= btn_check(74, line, "SPEC", act->flags, FLAG_SPECIAL); changed |= btn_check(74, line, "SPEC", act->flags, FLAG_SPECIAL);
line+=10; line+=10;