- [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;
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);
}
t->flags = value;
@@ -268,6 +268,7 @@ namespace actor
if (value & FLAG_GRAVITY) strcat(tmp, "GRAVITY ");
if (value & FLAG_SPECIAL) strcat(tmp, "SPECIAL ");
if (value & FLAG_INERTIA) strcat(tmp, "INERTIA ");
if (value & FLAG_DISAPPEAR) strcat(tmp, "DISAPPEAR ");
return tmp;
}
@@ -515,7 +516,7 @@ namespace actor
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) ) ) 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_DEADLY)
@@ -523,6 +524,12 @@ namespace actor
else
result = act->react_push;
}
if (act->flags & FLAG_DISAPPEAR)
{
act = actor::replaceWithTemplate(act, "EXPLOSION");
act->name[0]='_';
}
if (source->flags & FLAG_DEADLY) {
result |= PUSH_KILL;
}