Allow some entities to be crushed, to prevent them blocking lifts, etc.
This commit is contained in:
parent
95a4131a99
commit
934dd431aa
|
@ -142,6 +142,7 @@ enum
|
|||
#define EF_NO_TELEPORT (2 << 17)
|
||||
#define EF_NO_OBSERVE (2 << 18)
|
||||
#define EF_BULLET_HIT (2 << 19)
|
||||
#define EF_CRUSHABLE (2 << 20)
|
||||
|
||||
#define GRAVITY_POWER 0.5f
|
||||
#define FRICTION 0.75f
|
||||
|
|
|
@ -34,7 +34,7 @@ void initDebris(Decoration *d)
|
|||
|
||||
d->spriteFrame = 0;
|
||||
|
||||
d->flags |= EF_BOUNCES | EF_IGNORE_BULLETS | EF_KILL_OFFSCREEN | EF_NO_TELEPORT;
|
||||
d->flags |= EF_BOUNCES | EF_IGNORE_BULLETS | EF_KILL_OFFSCREEN | EF_NO_TELEPORT | EF_CRUSHABLE;
|
||||
|
||||
d->tick = tick;
|
||||
d->action = action;
|
||||
|
|
|
@ -30,7 +30,7 @@ void initFleshChunk(Decoration *d)
|
|||
|
||||
d->type = ET_DECORATION;
|
||||
|
||||
d->flags |= EF_BOUNCES | EF_IGNORE_BULLETS | EF_KILL_OFFSCREEN | EF_NO_TELEPORT;
|
||||
d->flags |= EF_BOUNCES | EF_IGNORE_BULLETS | EF_KILL_OFFSCREEN | EF_NO_TELEPORT | EF_CRUSHABLE;
|
||||
|
||||
d->bleedTime = FPS * 3;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ Item *initConsumable(void)
|
|||
|
||||
i->type = ET_CONSUMABLE;
|
||||
|
||||
i->flags |= EF_IGNORE_BULLETS;
|
||||
i->flags |= EF_IGNORE_BULLETS | EF_CRUSHABLE;
|
||||
|
||||
i->health = FPS * 10;
|
||||
|
||||
|
|
|
@ -257,6 +257,11 @@ void doEntities(void)
|
|||
if (!pushEntity(e, 0, e->riding->dy))
|
||||
{
|
||||
e->riding->y -= e->riding->dy;
|
||||
|
||||
if (e->flags & EF_CRUSHABLE)
|
||||
{
|
||||
e->health--;
|
||||
}
|
||||
}
|
||||
|
||||
e->y = e->riding->y - e->h;
|
||||
|
|
Loading…
Reference in New Issue