diff options
Diffstat (limited to 'src/game/decos.cpp')
-rw-r--r-- | src/game/decos.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/game/decos.cpp b/src/game/decos.cpp index ebd8bb8..bbb1cee 100644 --- a/src/game/decos.cpp +++ b/src/game/decos.cpp @@ -32,6 +32,11 @@ static const struct { {-0.4f, -0.4f}, {+0.4f, +0.4f}, 0.0 }, { + &assets::deco.stone_cracked, + {-0.4f, +0.1f}, {+0.4f, +0.4f}, CF_SOLID, + {-0.4f, -0.4f}, {+0.4f, +0.4f}, 0.0 + }, + { &assets::deco.stone, {-0.2f, +0.1f}, {+0.2f, +0.2f}, 0, {-0.2f, -0.2f}, {+0.2f, +0.2f}, 0.0 @@ -42,11 +47,21 @@ static const struct { {-0.4f, -1.2f}, {+0.4f, +0.4f}, 0.3 }, { + &assets::deco.eyething_dead, + {-0.4f, -0.4f}, {+0.4f, +0.4f}, 0, + {-0.4f, -1.2f}, {+0.4f, +0.4f}, 0.3 + }, + { &assets::deco.spike, {-0.4f, -0.4f}, {+0.4f, +0.4f}, CF_SOLID, {-0.4f, -1.2f}, {+0.4f, +0.4f}, 0.0 }, { + &assets::deco.spike_broken, + {-0.4f, -0.4f}, {+0.4f, +0.4f}, 0, + {-0.4f, -1.2f}, {+0.4f, +0.4f}, 0.0 + }, + { &assets::deco.spike_small, {-0.2f, +0.1f}, {+0.2f, +0.2f}, 0, {-0.2f, -0.6f}, {+0.2f, +0.2f}, 0.0 @@ -75,4 +90,26 @@ void deco_t::render_to(render::state_t *render) decos[type].texture, render_bounds, sf::Color::White); } +void deco_t::damage(int points, unit_t *attacker) +{ + switch (type) { + case DECO_STONE: + type = DECO_STONE_CRACKED; + break; + + case DECO_EYETHING: + type = DECO_EYETHING_DEAD; + break; + + case DECO_SPIKE: + type = DECO_SPIKE_BROKEN; + break; + + default: + break; + } + + cmodel.cflags = decos[type].cflags; +} + } // namespace game |