diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/assets.cpp | 16 | ||||
-rw-r--r-- | src/game/game.cpp | 58 | ||||
-rw-r--r-- | src/game/game.hpp | 12 | ||||
-rw-r--r-- | src/game/interface.cpp | 4 | ||||
-rw-r--r-- | src/game/unit_builder.cpp | 6 | ||||
-rw-r--r-- | src/game/unit_teleporter.cpp (renamed from src/game/unit_repl.cpp) | 20 |
6 files changed, 58 insertions, 58 deletions
diff --git a/src/game/assets.cpp b/src/game/assets.cpp index 22cd88f..35e9880 100644 --- a/src/game/assets.cpp +++ b/src/game/assets.cpp @@ -24,7 +24,7 @@ scientist_assets_t scientist; builder_assets_t builder; spider_assets_t spider; nest_assets_t nest; -repl_assets_t repl; +teleporter_assets_t teleporter; fx_assets_t fx; deco_assets_t deco; audio::ambient_t ambients[AMBIENT_COUNT]; @@ -95,13 +95,13 @@ void load(void) nest.pain.load("assets/units/nest/pain.ogg"); nest.death.load("assets/units/nest/death.ogg"); - repl.idle.load("assets/units/repl/idle_", 4); - repl.unfinished.load("assets/units/repl/unfinished_", 1); - repl.avatar.load("assets/units/repl/avatar_", 1); - repl.sound.load("assets/units/repl/sound.ogg"); - repl.damage.load("assets/units/repl/damage1.ogg"); - repl.damage.load("assets/units/repl/damage2.ogg"); - repl.damage.load("assets/units/repl/damage3.ogg"); + teleporter.idle.load("assets/units/teleporter/idle_", 4); + teleporter.unfinished.load("assets/units/teleporter/unfinished_", 1); + teleporter.avatar.load("assets/units/teleporter/avatar_", 1); + teleporter.sound.load("assets/units/teleporter/sound.ogg"); + teleporter.damage.load("assets/units/teleporter/damage1.ogg"); + teleporter.damage.load("assets/units/teleporter/damage2.ogg"); + teleporter.damage.load("assets/units/teleporter/damage3.ogg"); fx.blood.load("assets/units/blood_", 4); fx.flash.load("assets/units/flash_", 1); diff --git a/src/game/game.cpp b/src/game/game.cpp index 2ad7f05..2e15024 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -80,16 +80,16 @@ void entity_t::sleep(void) void state_t::start(void) { - unit_repl_t *repl; + unit_teleporter_t *teleporter; world.generator = worldgen; world.generator_data = (void*)this; - repl = new unit_repl_t(this); - repl->place(&world, v2f_t(5.3, 4.2)); - repl->constructed = true; - repl->health = repl->max_health; - select_unit(repl, SELECT_NEW); + teleporter = new unit_teleporter_t(this); + teleporter->place(&world, v2f_t(5.3, 4.2)); + teleporter->constructed = true; + teleporter->health = teleporter->max_health; + select_unit(teleporter, SELECT_NEW); resume(); } @@ -183,19 +183,19 @@ enum { COMMAND_THROW_GRENADE, COMMAND_STOP, - COMMAND_REPL_SOLDIER, - COMMAND_REPL_SCIENTIST, - COMMAND_REPL_BUILDER, + COMMAND_HIRE_SOLDIER, + COMMAND_HIRE_SCIENTIST, + COMMAND_HIRE_BUILDER, COMMAND_GATHER, COMMAND_REPAIR, - COMMAND_BUILD_REPL + COMMAND_BUILD_TELEPORTER }; bool state_t::populate_pie_menu(std::vector<interface::pie_item_t> &items) { - bool soldiers = false, repls = false, grenades = false, + bool soldiers = false, teleporters = false, grenades = false, scientists = false, builders = false; items.clear(); @@ -222,8 +222,8 @@ bool state_t::populate_pie_menu(std::vector<interface::pie_item_t> &items) builders = true; break; - case unit_t::UNIT_REPL: - repls = true; + case unit_t::UNIT_TELEPORTER: + teleporters = true; break; default:; @@ -246,13 +246,13 @@ bool state_t::populate_pie_menu(std::vector<interface::pie_item_t> &items) if (builders) { items.push_back((interface::pie_item_t){"Repair", COMMAND_REPAIR}); - items.push_back((interface::pie_item_t){"Build a replicator", COMMAND_BUILD_REPL}); + items.push_back((interface::pie_item_t){"Build a teleporter", COMMAND_BUILD_TELEPORTER}); } - if (repls) { - items.push_back((interface::pie_item_t){"Spawn a soldier", COMMAND_REPL_SOLDIER}); - items.push_back((interface::pie_item_t){"Spawn a scientist", COMMAND_REPL_SCIENTIST}); - items.push_back((interface::pie_item_t){"Spawn a builder", COMMAND_REPL_BUILDER}); + if (teleporters) { + items.push_back((interface::pie_item_t){"Hire a soldier", COMMAND_HIRE_SOLDIER}); + items.push_back((interface::pie_item_t){"Hire a scientist", COMMAND_HIRE_SCIENTIST}); + items.push_back((interface::pie_item_t){"Hire a builder", COMMAND_HIRE_BUILDER}); } return true; @@ -336,25 +336,25 @@ static void command_builder(unit_builder_t *builder, v2f_t x, int number) builder->command_repair(x); break; - case COMMAND_BUILD_REPL: - builder->command_build(x, unit_t::UNIT_REPL); + case COMMAND_BUILD_TELEPORTER: + builder->command_build(x, unit_t::UNIT_TELEPORTER); break; } } -static void command_repl(unit_repl_t *repl, v2f_t x, int number) +static void command_teleporter(unit_teleporter_t *teleporter, v2f_t x, int number) { switch (number) { - case COMMAND_REPL_SOLDIER: - repl->activate(unit_t::UNIT_SOLDIER); + case COMMAND_HIRE_SOLDIER: + teleporter->activate(unit_t::UNIT_SOLDIER); break; - case COMMAND_REPL_SCIENTIST: - repl->activate(unit_t::UNIT_SCIENTIST); + case COMMAND_HIRE_SCIENTIST: + teleporter->activate(unit_t::UNIT_SCIENTIST); break; - case COMMAND_REPL_BUILDER: - repl->activate(unit_t::UNIT_BUILDER); + case COMMAND_HIRE_BUILDER: + teleporter->activate(unit_t::UNIT_BUILDER); break; } } @@ -392,8 +392,8 @@ void state_t::command(v2f_t x, int number) x, number); break; - case unit_t::UNIT_REPL: - command_repl(dynamic_cast<unit_repl_t*>(unit), + case unit_t::UNIT_TELEPORTER: + command_teleporter(dynamic_cast<unit_teleporter_t*>(unit), x, number); break; diff --git a/src/game/game.hpp b/src/game/game.hpp index 19fda52..f630c54 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -236,7 +236,7 @@ namespace game { typedef struct { render::animated_texture_t idle, unfinished, avatar; audio::sound_t sound, damage; - } repl_assets_t; + } teleporter_assets_t; typedef struct { render::animated_texture_t blood, flash, explosion, ricochet, water_splash; @@ -264,7 +264,7 @@ namespace game { extern builder_assets_t builder; extern spider_assets_t spider; extern nest_assets_t nest; - extern repl_assets_t repl; + extern teleporter_assets_t teleporter; extern fx_assets_t fx; extern deco_assets_t deco; extern audio::ambient_t ambients[AMBIENT_COUNT]; @@ -324,7 +324,7 @@ namespace game { UNIT_BUILDER, UNIT_SPIDER, UNIT_NEST, - UNIT_REPL + UNIT_TELEPORTER } type_t; game::state_t *game; @@ -502,10 +502,10 @@ namespace game { void on_death(void); }; - class unit_repl_t : public unit_t { + class unit_teleporter_t : public unit_t { public: - unit_repl_t(game::state_t *game_); - ~unit_repl_t(void) {}; + unit_teleporter_t(game::state_t *game_); + ~unit_teleporter_t(void) {}; void render_to(render::state_t *render); void render_late_to(render::state_t *render) {}; diff --git a/src/game/interface.cpp b/src/game/interface.cpp index 1c2d7b5..6375a3c 100644 --- a/src/game/interface.cpp +++ b/src/game/interface.cpp @@ -389,8 +389,8 @@ static void render_avatar(render::state_t *render, game::unit_t *unit, v2f_t at, image = &assets::builder.avatar; break; - case game::unit_t::UNIT_REPL: - image = &assets::repl.avatar; + case game::unit_t::UNIT_TELEPORTER: + image = &assets::teleporter.avatar; break; default: diff --git a/src/game/unit_builder.cpp b/src/game/unit_builder.cpp index d35a1fc..0deae3c 100644 --- a/src/game/unit_builder.cpp +++ b/src/game/unit_builder.cpp @@ -90,8 +90,8 @@ void unit_builder_t::command_build(v2f_t where, type_t what) } switch (what) { - case UNIT_REPL: - built = new unit_repl_t(game); + case UNIT_TELEPORTER: + built = new unit_teleporter_t(game); price = 250; break; @@ -147,7 +147,7 @@ void unit_builder_t::repair(void) } unit = dynamic_cast<unit_t*>(trace.ent); - if (unit->type != UNIT_REPL || unit->health >= unit->max_health) { + if (unit->type != UNIT_TELEPORTER || unit->health >= unit->max_health) { repairing = false; return; } diff --git a/src/game/unit_repl.cpp b/src/game/unit_teleporter.cpp index 2e0c3fd..fd73ab6 100644 --- a/src/game/unit_repl.cpp +++ b/src/game/unit_teleporter.cpp @@ -19,7 +19,7 @@ along with Minitrem. If not, see <http://www.gnu.org/licenses/>. namespace game { -unit_repl_t::unit_repl_t(game::state_t *game_) : unit_t(game_, UNIT_REPL) +unit_teleporter_t::unit_teleporter_t(game::state_t *game_) : unit_t(game_, UNIT_TELEPORTER) { size[0] = {-0.4f, -0.2f}; size[1] = {+0.4f, +0.4f}; @@ -27,7 +27,7 @@ unit_repl_t::unit_repl_t(game::state_t *game_) : unit_t(game_, UNIT_REPL) render_layer = render::LAYER_FLAT; cmodel.cflags = CF_SURFACE2; - name = "Replicator"; + name = "Teleporter"; ignore_waking = false; max_health = 35; health = 5; @@ -37,28 +37,28 @@ unit_repl_t::unit_repl_t(game::state_t *game_) : unit_t(game_, UNIT_REPL) constructed = false; } -void unit_repl_t::on_damage(unit_t *attacker) +void unit_teleporter_t::on_damage(unit_t *attacker) { - assets::repl.damage.play_3d(x); + assets::teleporter.damage.play_3d(x); } -void unit_repl_t::on_death(void) +void unit_teleporter_t::on_death(void) { game->explosion(x); game->deletion_list.insert(this); } -void unit_repl_t::render_to(render::state_t *render) +void unit_teleporter_t::render_to(render::state_t *render) { if (constructed) - render->render(game->now, &assets::repl.idle, render_bounds); + render->render(game->now, &assets::teleporter.idle, render_bounds); else - render->render(game->now, &assets::repl.unfinished, render_bounds); + render->render(game->now, &assets::teleporter.unfinished, render_bounds); unit_t::render_to(render); } -void unit_repl_t::activate(unit_t::type_t type) +void unit_teleporter_t::activate(unit_t::type_t type) { size_t price; world::cmodel_t cmodel; @@ -112,7 +112,7 @@ void unit_repl_t::activate(unit_t::type_t type) other->damage(200, NULL); } - assets::repl.sound.play_3d(x); + assets::teleporter.sound.play_3d(x); } } |