summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/units/soldier/body_aiming_ny_0.png (renamed from assets/units/human/body_aiming_ny_0.png)bin1415 -> 1415 bytes
-rw-r--r--assets/units/soldier/body_aiming_ny_1.png (renamed from assets/units/human/body_aiming_ny_1.png)bin1202 -> 1202 bytes
-rw-r--r--assets/units/soldier/body_aiming_x_0.png (renamed from assets/units/human/body_aiming_x_0.png)bin2180 -> 2180 bytes
-rw-r--r--assets/units/soldier/body_aiming_x_1.png (renamed from assets/units/human/body_aiming_x_1.png)bin2249 -> 2249 bytes
-rw-r--r--assets/units/soldier/body_aiming_y_0.png (renamed from assets/units/human/body_aiming_y_0.png)bin1933 -> 1933 bytes
-rw-r--r--assets/units/soldier/body_aiming_y_1.png (renamed from assets/units/human/body_aiming_y_1.png)bin1897 -> 1897 bytes
-rw-r--r--assets/units/soldier/body_firing_ny_0.png (renamed from assets/units/human/body_firing_ny_0.png)bin1249 -> 1249 bytes
-rw-r--r--assets/units/soldier/body_firing_ny_1.png (renamed from assets/units/human/body_firing_ny_1.png)bin1362 -> 1362 bytes
-rw-r--r--assets/units/soldier/body_firing_x_0.png (renamed from assets/units/human/body_firing_x_0.png)bin2235 -> 2235 bytes
-rw-r--r--assets/units/soldier/body_firing_x_1.png (renamed from assets/units/human/body_firing_x_1.png)bin2460 -> 2460 bytes
-rw-r--r--assets/units/soldier/body_firing_y_0.png (renamed from assets/units/human/body_firing_y_0.png)bin2605 -> 2605 bytes
-rw-r--r--assets/units/soldier/body_firing_y_1.png (renamed from assets/units/human/body_firing_y_1.png)bin2298 -> 2298 bytes
-rw-r--r--assets/units/soldier/body_idle_ny_0.png (renamed from assets/units/human/body_idle_ny_0.png)bin2049 -> 2049 bytes
-rw-r--r--assets/units/soldier/body_idle_ny_1.png (renamed from assets/units/human/body_idle_ny_1.png)bin1962 -> 1962 bytes
-rw-r--r--assets/units/soldier/body_idle_x_0.png (renamed from assets/units/human/body_idle_x_0.png)bin2861 -> 2861 bytes
-rw-r--r--assets/units/soldier/body_idle_x_1.png (renamed from assets/units/human/body_idle_x_1.png)bin2697 -> 2697 bytes
-rw-r--r--assets/units/soldier/body_idle_y_0.png (renamed from assets/units/human/body_idle_y_0.png)bin2414 -> 2414 bytes
-rw-r--r--assets/units/soldier/body_idle_y_1.png (renamed from assets/units/human/body_idle_y_1.png)bin2544 -> 2544 bytes
-rw-r--r--assets/units/soldier/dead_0.png (renamed from assets/units/human/dead_0.png)bin4431 -> 4431 bytes
-rw-r--r--assets/units/soldier/head_idle_ny_0.png (renamed from assets/units/human/head_idle_ny_0.png)bin1591 -> 1591 bytes
-rw-r--r--assets/units/soldier/head_idle_x_0.png (renamed from assets/units/human/head_idle_x_0.png)bin2045 -> 2045 bytes
-rw-r--r--assets/units/soldier/head_idle_y_0.png (renamed from assets/units/human/head_idle_y_0.png)bin1743 -> 1743 bytes
-rw-r--r--assets/units/soldier/legs_idle_x_0.png (renamed from assets/units/human/legs_idle_x_0.png)bin793 -> 793 bytes
-rw-r--r--assets/units/soldier/legs_idle_x_1.png (renamed from assets/units/human/legs_idle_x_1.png)bin848 -> 848 bytes
-rw-r--r--assets/units/soldier/legs_idle_y_0.png (renamed from assets/units/human/legs_idle_y_0.png)bin751 -> 751 bytes
-rw-r--r--assets/units/soldier/legs_idle_y_1.png (renamed from assets/units/human/legs_idle_y_1.png)bin655 -> 655 bytes
-rw-r--r--assets/units/soldier/legs_walking_x_0.png (renamed from assets/units/human/legs_walking_x_0.png)bin961 -> 961 bytes
-rw-r--r--assets/units/soldier/legs_walking_x_1.png (renamed from assets/units/human/legs_walking_x_1.png)bin964 -> 964 bytes
-rw-r--r--assets/units/soldier/legs_walking_y_0.png (renamed from assets/units/human/legs_walking_y_0.png)bin502 -> 502 bytes
-rw-r--r--assets/units/soldier/legs_walking_y_1.png (renamed from assets/units/human/legs_walking_y_1.png)bin587 -> 587 bytes
-rw-r--r--assets/units/spider/dead_0.png (renamed from assets/units/alien/dead_0.png)bin1822 -> 1822 bytes
-rw-r--r--assets/units/spider/idle_ny_0.png (renamed from assets/units/alien/idle_ny_0.png)bin1546 -> 1546 bytes
-rw-r--r--assets/units/spider/idle_ny_1.png (renamed from assets/units/alien/idle_ny_1.png)bin1505 -> 1505 bytes
-rw-r--r--assets/units/spider/idle_x_0.png (renamed from assets/units/alien/idle_x_0.png)bin1775 -> 1775 bytes
-rw-r--r--assets/units/spider/idle_x_1.png (renamed from assets/units/alien/idle_x_1.png)bin1562 -> 1562 bytes
-rw-r--r--assets/units/spider/idle_y_0.png (renamed from assets/units/alien/idle_y_0.png)bin1590 -> 1590 bytes
-rw-r--r--assets/units/spider/idle_y_1.png (renamed from assets/units/alien/idle_y_1.png)bin1555 -> 1555 bytes
-rw-r--r--assets/units/spider/walking_ny_0.png (renamed from assets/units/alien/walking_ny_0.png)bin1508 -> 1508 bytes
-rw-r--r--assets/units/spider/walking_ny_1.png (renamed from assets/units/alien/walking_ny_1.png)bin1470 -> 1470 bytes
-rw-r--r--assets/units/spider/walking_x_0.png (renamed from assets/units/alien/walking_x_0.png)bin1484 -> 1484 bytes
-rw-r--r--assets/units/spider/walking_x_1.png (renamed from assets/units/alien/walking_x_1.png)bin1460 -> 1460 bytes
-rw-r--r--assets/units/spider/walking_y_0.png (renamed from assets/units/alien/walking_y_0.png)bin1513 -> 1513 bytes
-rw-r--r--assets/units/spider/walking_y_1.png (renamed from assets/units/alien/walking_y_1.png)bin1578 -> 1578 bytes
-rw-r--r--src/common.hpp4
-rw-r--r--src/game/assets.cpp26
-rw-r--r--src/game/game.cpp30
-rw-r--r--src/game/game.hpp27
-rw-r--r--src/game/units.cpp50
-rw-r--r--src/text.cpp18
49 files changed, 80 insertions, 75 deletions
diff --git a/assets/units/human/body_aiming_ny_0.png b/assets/units/soldier/body_aiming_ny_0.png
index 6fb5791..6fb5791 100644
--- a/assets/units/human/body_aiming_ny_0.png
+++ b/assets/units/soldier/body_aiming_ny_0.png
Binary files differ
diff --git a/assets/units/human/body_aiming_ny_1.png b/assets/units/soldier/body_aiming_ny_1.png
index eec667a..eec667a 100644
--- a/assets/units/human/body_aiming_ny_1.png
+++ b/assets/units/soldier/body_aiming_ny_1.png
Binary files differ
diff --git a/assets/units/human/body_aiming_x_0.png b/assets/units/soldier/body_aiming_x_0.png
index ff9fab2..ff9fab2 100644
--- a/assets/units/human/body_aiming_x_0.png
+++ b/assets/units/soldier/body_aiming_x_0.png
Binary files differ
diff --git a/assets/units/human/body_aiming_x_1.png b/assets/units/soldier/body_aiming_x_1.png
index dcaba13..dcaba13 100644
--- a/assets/units/human/body_aiming_x_1.png
+++ b/assets/units/soldier/body_aiming_x_1.png
Binary files differ
diff --git a/assets/units/human/body_aiming_y_0.png b/assets/units/soldier/body_aiming_y_0.png
index 34d6d50..34d6d50 100644
--- a/assets/units/human/body_aiming_y_0.png
+++ b/assets/units/soldier/body_aiming_y_0.png
Binary files differ
diff --git a/assets/units/human/body_aiming_y_1.png b/assets/units/soldier/body_aiming_y_1.png
index d0689c1..d0689c1 100644
--- a/assets/units/human/body_aiming_y_1.png
+++ b/assets/units/soldier/body_aiming_y_1.png
Binary files differ
diff --git a/assets/units/human/body_firing_ny_0.png b/assets/units/soldier/body_firing_ny_0.png
index 214e5c4..214e5c4 100644
--- a/assets/units/human/body_firing_ny_0.png
+++ b/assets/units/soldier/body_firing_ny_0.png
Binary files differ
diff --git a/assets/units/human/body_firing_ny_1.png b/assets/units/soldier/body_firing_ny_1.png
index b0dedae..b0dedae 100644
--- a/assets/units/human/body_firing_ny_1.png
+++ b/assets/units/soldier/body_firing_ny_1.png
Binary files differ
diff --git a/assets/units/human/body_firing_x_0.png b/assets/units/soldier/body_firing_x_0.png
index 274bebc..274bebc 100644
--- a/assets/units/human/body_firing_x_0.png
+++ b/assets/units/soldier/body_firing_x_0.png
Binary files differ
diff --git a/assets/units/human/body_firing_x_1.png b/assets/units/soldier/body_firing_x_1.png
index 640f37d..640f37d 100644
--- a/assets/units/human/body_firing_x_1.png
+++ b/assets/units/soldier/body_firing_x_1.png
Binary files differ
diff --git a/assets/units/human/body_firing_y_0.png b/assets/units/soldier/body_firing_y_0.png
index 20363b0..20363b0 100644
--- a/assets/units/human/body_firing_y_0.png
+++ b/assets/units/soldier/body_firing_y_0.png
Binary files differ
diff --git a/assets/units/human/body_firing_y_1.png b/assets/units/soldier/body_firing_y_1.png
index d2ca534..d2ca534 100644
--- a/assets/units/human/body_firing_y_1.png
+++ b/assets/units/soldier/body_firing_y_1.png
Binary files differ
diff --git a/assets/units/human/body_idle_ny_0.png b/assets/units/soldier/body_idle_ny_0.png
index a4305fe..a4305fe 100644
--- a/assets/units/human/body_idle_ny_0.png
+++ b/assets/units/soldier/body_idle_ny_0.png
Binary files differ
diff --git a/assets/units/human/body_idle_ny_1.png b/assets/units/soldier/body_idle_ny_1.png
index ea99192..ea99192 100644
--- a/assets/units/human/body_idle_ny_1.png
+++ b/assets/units/soldier/body_idle_ny_1.png
Binary files differ
diff --git a/assets/units/human/body_idle_x_0.png b/assets/units/soldier/body_idle_x_0.png
index d998a21..d998a21 100644
--- a/assets/units/human/body_idle_x_0.png
+++ b/assets/units/soldier/body_idle_x_0.png
Binary files differ
diff --git a/assets/units/human/body_idle_x_1.png b/assets/units/soldier/body_idle_x_1.png
index 03907f0..03907f0 100644
--- a/assets/units/human/body_idle_x_1.png
+++ b/assets/units/soldier/body_idle_x_1.png
Binary files differ
diff --git a/assets/units/human/body_idle_y_0.png b/assets/units/soldier/body_idle_y_0.png
index 524ed6a..524ed6a 100644
--- a/assets/units/human/body_idle_y_0.png
+++ b/assets/units/soldier/body_idle_y_0.png
Binary files differ
diff --git a/assets/units/human/body_idle_y_1.png b/assets/units/soldier/body_idle_y_1.png
index 6714693..6714693 100644
--- a/assets/units/human/body_idle_y_1.png
+++ b/assets/units/soldier/body_idle_y_1.png
Binary files differ
diff --git a/assets/units/human/dead_0.png b/assets/units/soldier/dead_0.png
index a2accf3..a2accf3 100644
--- a/assets/units/human/dead_0.png
+++ b/assets/units/soldier/dead_0.png
Binary files differ
diff --git a/assets/units/human/head_idle_ny_0.png b/assets/units/soldier/head_idle_ny_0.png
index d46674a..d46674a 100644
--- a/assets/units/human/head_idle_ny_0.png
+++ b/assets/units/soldier/head_idle_ny_0.png
Binary files differ
diff --git a/assets/units/human/head_idle_x_0.png b/assets/units/soldier/head_idle_x_0.png
index 49c8d62..49c8d62 100644
--- a/assets/units/human/head_idle_x_0.png
+++ b/assets/units/soldier/head_idle_x_0.png
Binary files differ
diff --git a/assets/units/human/head_idle_y_0.png b/assets/units/soldier/head_idle_y_0.png
index 07f3e11..07f3e11 100644
--- a/assets/units/human/head_idle_y_0.png
+++ b/assets/units/soldier/head_idle_y_0.png
Binary files differ
diff --git a/assets/units/human/legs_idle_x_0.png b/assets/units/soldier/legs_idle_x_0.png
index eca9f71..eca9f71 100644
--- a/assets/units/human/legs_idle_x_0.png
+++ b/assets/units/soldier/legs_idle_x_0.png
Binary files differ
diff --git a/assets/units/human/legs_idle_x_1.png b/assets/units/soldier/legs_idle_x_1.png
index 4867503..4867503 100644
--- a/assets/units/human/legs_idle_x_1.png
+++ b/assets/units/soldier/legs_idle_x_1.png
Binary files differ
diff --git a/assets/units/human/legs_idle_y_0.png b/assets/units/soldier/legs_idle_y_0.png
index 89624f7..89624f7 100644
--- a/assets/units/human/legs_idle_y_0.png
+++ b/assets/units/soldier/legs_idle_y_0.png
Binary files differ
diff --git a/assets/units/human/legs_idle_y_1.png b/assets/units/soldier/legs_idle_y_1.png
index 47ec27e..47ec27e 100644
--- a/assets/units/human/legs_idle_y_1.png
+++ b/assets/units/soldier/legs_idle_y_1.png
Binary files differ
diff --git a/assets/units/human/legs_walking_x_0.png b/assets/units/soldier/legs_walking_x_0.png
index 680e47d..680e47d 100644
--- a/assets/units/human/legs_walking_x_0.png
+++ b/assets/units/soldier/legs_walking_x_0.png
Binary files differ
diff --git a/assets/units/human/legs_walking_x_1.png b/assets/units/soldier/legs_walking_x_1.png
index 694d71b..694d71b 100644
--- a/assets/units/human/legs_walking_x_1.png
+++ b/assets/units/soldier/legs_walking_x_1.png
Binary files differ
diff --git a/assets/units/human/legs_walking_y_0.png b/assets/units/soldier/legs_walking_y_0.png
index 9197a87..9197a87 100644
--- a/assets/units/human/legs_walking_y_0.png
+++ b/assets/units/soldier/legs_walking_y_0.png
Binary files differ
diff --git a/assets/units/human/legs_walking_y_1.png b/assets/units/soldier/legs_walking_y_1.png
index c4ac188..c4ac188 100644
--- a/assets/units/human/legs_walking_y_1.png
+++ b/assets/units/soldier/legs_walking_y_1.png
Binary files differ
diff --git a/assets/units/alien/dead_0.png b/assets/units/spider/dead_0.png
index bde771b..bde771b 100644
--- a/assets/units/alien/dead_0.png
+++ b/assets/units/spider/dead_0.png
Binary files differ
diff --git a/assets/units/alien/idle_ny_0.png b/assets/units/spider/idle_ny_0.png
index 20c622e..20c622e 100644
--- a/assets/units/alien/idle_ny_0.png
+++ b/assets/units/spider/idle_ny_0.png
Binary files differ
diff --git a/assets/units/alien/idle_ny_1.png b/assets/units/spider/idle_ny_1.png
index 6929178..6929178 100644
--- a/assets/units/alien/idle_ny_1.png
+++ b/assets/units/spider/idle_ny_1.png
Binary files differ
diff --git a/assets/units/alien/idle_x_0.png b/assets/units/spider/idle_x_0.png
index 7378357..7378357 100644
--- a/assets/units/alien/idle_x_0.png
+++ b/assets/units/spider/idle_x_0.png
Binary files differ
diff --git a/assets/units/alien/idle_x_1.png b/assets/units/spider/idle_x_1.png
index cc94179..cc94179 100644
--- a/assets/units/alien/idle_x_1.png
+++ b/assets/units/spider/idle_x_1.png
Binary files differ
diff --git a/assets/units/alien/idle_y_0.png b/assets/units/spider/idle_y_0.png
index 18a6598..18a6598 100644
--- a/assets/units/alien/idle_y_0.png
+++ b/assets/units/spider/idle_y_0.png
Binary files differ
diff --git a/assets/units/alien/idle_y_1.png b/assets/units/spider/idle_y_1.png
index 0af362e..0af362e 100644
--- a/assets/units/alien/idle_y_1.png
+++ b/assets/units/spider/idle_y_1.png
Binary files differ
diff --git a/assets/units/alien/walking_ny_0.png b/assets/units/spider/walking_ny_0.png
index 3b1a5df..3b1a5df 100644
--- a/assets/units/alien/walking_ny_0.png
+++ b/assets/units/spider/walking_ny_0.png
Binary files differ
diff --git a/assets/units/alien/walking_ny_1.png b/assets/units/spider/walking_ny_1.png
index 49b7b50..49b7b50 100644
--- a/assets/units/alien/walking_ny_1.png
+++ b/assets/units/spider/walking_ny_1.png
Binary files differ
diff --git a/assets/units/alien/walking_x_0.png b/assets/units/spider/walking_x_0.png
index 3b74409..3b74409 100644
--- a/assets/units/alien/walking_x_0.png
+++ b/assets/units/spider/walking_x_0.png
Binary files differ
diff --git a/assets/units/alien/walking_x_1.png b/assets/units/spider/walking_x_1.png
index b0bdf80..b0bdf80 100644
--- a/assets/units/alien/walking_x_1.png
+++ b/assets/units/spider/walking_x_1.png
Binary files differ
diff --git a/assets/units/alien/walking_y_0.png b/assets/units/spider/walking_y_0.png
index 8108c3f..8108c3f 100644
--- a/assets/units/alien/walking_y_0.png
+++ b/assets/units/spider/walking_y_0.png
Binary files differ
diff --git a/assets/units/alien/walking_y_1.png b/assets/units/spider/walking_y_1.png
index a9cdb8f..a9cdb8f 100644
--- a/assets/units/alien/walking_y_1.png
+++ b/assets/units/spider/walking_y_1.png
Binary files differ
diff --git a/src/common.hpp b/src/common.hpp
index 5a9dccc..f18f0b8 100644
--- a/src/common.hpp
+++ b/src/common.hpp
@@ -358,8 +358,8 @@ namespace text {
SAY_BLOCKED,
SAY_READY,
SAY_MOVING,
- UNIT_ALIEN,
- UNIT_HUMAN,
+ UNIT_NAME_SPIDER,
+ UNIT_NAME_SOLDIER,
UNIT_DEATH,
UNIT_ATTACK,
UNIT_MISS,
diff --git a/src/game/assets.cpp b/src/game/assets.cpp
index e5fee38..a4a03e5 100644
--- a/src/game/assets.cpp
+++ b/src/game/assets.cpp
@@ -2,24 +2,24 @@
namespace game::assets {
-human_assets_t human;
-alien_assets_t alien;
+soldier_assets_t soldier;
+spider_assets_t spider;
fx_assets_t fx;
deco_assets_t deco;
void load(void)
{
- human.head_idle.load("assets/units/human/head_idle", 1, 1, 1);
- human.body_idle.load("assets/units/human/body_idle", 2, 2, 2);
- human.body_aiming.load("assets/units/human/body_aiming", 2, 2, 2);
- human.body_firing.load("assets/units/human/body_firing", 2, 2, 2);
- human.legs_idle.load("assets/units/human/legs_idle", 2, 2);
- human.legs_walking.load("assets/units/human/legs_walking", 2, 2);
- human.dead.load("assets/units/human/dead_", 1);
-
- alien.idle.load("assets/units/alien/idle", 2, 2, 2);
- alien.walking.load("assets/units/alien/walking", 2, 2, 2);
- alien.dead.load("assets/units/alien/dead_", 1);
+ soldier.head_idle.load("assets/units/soldier/head_idle", 1, 1, 1);
+ soldier.body_idle.load("assets/units/soldier/body_idle", 2, 2, 2);
+ soldier.body_aiming.load("assets/units/soldier/body_aiming", 2, 2, 2);
+ soldier.body_firing.load("assets/units/soldier/body_firing", 2, 2, 2);
+ soldier.legs_idle.load("assets/units/soldier/legs_idle", 2, 2);
+ soldier.legs_walking.load("assets/units/soldier/legs_walking", 2, 2);
+ soldier.dead.load("assets/units/soldier/dead_", 1);
+
+ spider.idle.load("assets/units/spider/idle", 2, 2, 2);
+ spider.walking.load("assets/units/spider/walking", 2, 2, 2);
+ spider.dead.load("assets/units/spider/dead_", 1);
fx.blood.load("assets/units/blood_", 4);
diff --git a/src/game/game.cpp b/src/game/game.cpp
index 35d66ec..51dca09 100644
--- a/src/game/game.cpp
+++ b/src/game/game.cpp
@@ -63,25 +63,25 @@ void entity_t::sleep(void)
void state_t::start(void)
{
- human_t *human;
- alien_t *alien;
+ unit_soldier_t *soldier;
+ unit_spider_t *spider;
world.generator = worldgen;
world.generator_data = (void*)this;
- human = new human_t(this);
- human->place(&world, v2f_t(0.5, 0.5));
- human = new human_t(this);
- human->place(&world, v2f_t(1.5, 0.5));
- human = new human_t(this);
- human->place(&world, v2f_t(2.5, 0.5));
+ soldier = new unit_soldier_t(this);
+ soldier->place(&world, v2f_t(0.5, 0.5));
+ soldier = new unit_soldier_t(this);
+ soldier->place(&world, v2f_t(1.5, 0.5));
+ soldier = new unit_soldier_t(this);
+ soldier->place(&world, v2f_t(2.5, 0.5));
- alien = new alien_t(this);
- alien->place(&world, v2f_t(15.5, -2.5));
- alien = new alien_t(this);
- alien->place(&world, v2f_t(14.5, -2.5));
- alien = new alien_t(this);
- alien->place(&world, v2f_t(13.5, -2.5));
+ spider = new unit_spider_t(this);
+ spider->place(&world, v2f_t(15.5, -2.5));
+ spider = new unit_spider_t(this);
+ spider->place(&world, v2f_t(14.5, -2.5));
+ spider = new unit_spider_t(this);
+ spider->place(&world, v2f_t(13.5, -2.5));
}
void state_t::stop(void)
@@ -103,7 +103,7 @@ void state_t::select(rectf_t x)
unit = (unit_t*)ent;
- if (unit->type != unit_t::UNIT_HUMAN)
+ if (!unit->controllable)
continue;
if (!unit->dead && unit->selected != old_cookie)
diff --git a/src/game/game.hpp b/src/game/game.hpp
index c17de64..df027ce 100644
--- a/src/game/game.hpp
+++ b/src/game/game.hpp
@@ -32,12 +32,12 @@ namespace game {
render::oriented_sprite_4M_t body_aiming, body_firing;
render::oriented_sprite_4M2_t legs_idle, legs_walking;
render::animated_texture_t dead;
- } human_assets_t;
+ } soldier_assets_t;
typedef struct {
render::oriented_sprite_4M_t idle, walking;
render::animated_texture_t dead;
- } alien_assets_t;
+ } spider_assets_t;
typedef struct {
render::animated_texture_t blood;
@@ -47,8 +47,8 @@ namespace game {
render::animated_texture_t stone, eyething, nest;
} deco_assets_t;
- extern human_assets_t human;
- extern alien_assets_t alien;
+ extern soldier_assets_t soldier;
+ extern spider_assets_t spider;
extern fx_assets_t fx;
extern deco_assets_t deco;
@@ -88,8 +88,8 @@ namespace game {
size_t selected = 0;
typedef enum {
- UNIT_HUMAN,
- UNIT_ALIEN
+ UNIT_SOLDIER,
+ UNIT_SPIDER
} type_t;
type_t type;
@@ -97,6 +97,9 @@ namespace game {
unit_t(game::state_t *game_, type_t type_);
+ bool friendly = false;
+ bool controllable = false;
+
struct {
bool moving = false;
v2f_t dst;
@@ -134,13 +137,13 @@ namespace game {
};
- class human_t : public unit_t {
+ class unit_soldier_t : public unit_t {
double last_target_time = -INFINITY;
v2f_t last_target_x;
public:
- human_t(game::state_t *game_);
- ~human_t(void) {};
+ unit_soldier_t(game::state_t *game_);
+ ~unit_soldier_t(void) {};
void render_to(render::state_t *render);
void on_think(void);
@@ -149,10 +152,10 @@ namespace game {
void on_death(void);
};
- class alien_t : public unit_t {
+ class unit_spider_t : public unit_t {
public:
- alien_t(game::state_t *game_);
- ~alien_t(void) {};
+ unit_spider_t(game::state_t *game_);
+ ~unit_spider_t(void) {};
void render_to(render::state_t *render);
void on_think(void);
diff --git a/src/game/units.cpp b/src/game/units.cpp
index 8eb11c7..ee6ee9f 100644
--- a/src/game/units.cpp
+++ b/src/game/units.cpp
@@ -153,7 +153,7 @@ void unit_t::damage(int points, unit_t *attacker)
{
fx_blood_t *blood;
- blood = new fx_blood_t(game, x, type == UNIT_ALIEN);
+ blood = new fx_blood_t(game, x, type == UNIT_SPIDER);
blood->place(&game->world);
health -= points;
@@ -237,9 +237,11 @@ static unit_t *find_target(world::world_t *world, v2f_t x, float r,
return nearest;
}
-human_t::human_t(game::state_t *game) : unit_t(game, UNIT_HUMAN)
+unit_soldier_t::unit_soldier_t(game::state_t *game) : unit_t(game, UNIT_SOLDIER)
{
always_awake = true;
+ friendly = true;
+ controllable = true;
cmodel.cflags = CF_BODY;
health = max_health = 20;
@@ -247,14 +249,14 @@ human_t::human_t(game::state_t *game) : unit_t(game, UNIT_HUMAN)
size[1] = v2f_t(+0.4f, +0.4f);
render_size[0] = v2f_t(-0.5f, -1.0f);
render_size[1] = v2f_t(+0.5f, +0.5f);
- name = text::get(text::UNIT_HUMAN);
+ name = text::get(text::UNIT_NAME_SOLDIER);
cs.armor_class = 10;
cs.hit_roll = roll_params_t(20);
cs.damage_roll = roll_params_t(4);
}
-void human_t::on_think(void)
+void unit_soldier_t::on_think(void)
{
if (dead)
return;
@@ -264,7 +266,7 @@ void human_t::on_think(void)
if (game->now > next_targetting) {
unit_t *target;
- target = find_target(world, x, 10.0f, UNIT_ALIEN);
+ target = find_target(world, x, 10.0f, UNIT_SPIDER);
if (target) {
last_target_time = game->now;
last_target_x = target->x;
@@ -293,7 +295,7 @@ void human_t::on_think(void)
say(text::get(text::SAY_BLOCKED));
}
-void human_t::on_death(void)
+void unit_soldier_t::on_death(void)
{
render_size[0] = v2f_t(-0.75f, -0.5f);
render_size[1] = v2f_t(+0.75f, +0.5f);
@@ -302,40 +304,40 @@ void human_t::on_death(void)
place(world, x);
}
-void human_t::render_to(render::state_t *render)
+void unit_soldier_t::render_to(render::state_t *render)
{
if (!dead) {
render::oriented_sprite_t *legs, *body;
float body_angle;
if (move.moving && !move.blocked)
- legs = &assets::human.legs_walking;
+ legs = &assets::soldier.legs_walking;
else
- legs = &assets::human.legs_idle;
+ legs = &assets::soldier.legs_idle;
if (last_target_time + 3 > game->now) {
if (last_attack + 0.1 > game->now)
- body = &assets::human.body_firing;
+ body = &assets::soldier.body_firing;
else
- body = &assets::human.body_aiming;
+ body = &assets::soldier.body_aiming;
body_angle = (last_target_x - x).angle();
} else {
- body = &assets::human.body_idle;
+ body = &assets::soldier.body_idle;
body_angle = move.angle;
}
render->render(game->now * 10, legs, render_bounds, move.angle);
render->render(game->now * 10, body, render_bounds, body_angle);
- render->render(game->now * 10, &assets::human.head_idle, render_bounds, body_angle);
+ render->render(game->now * 10, &assets::soldier.head_idle, render_bounds, body_angle);
} else
- render->render(game->now * 10, &assets::human.dead, render_bounds);
+ render->render(game->now * 10, &assets::soldier.dead, render_bounds);
unit_t::render_to(render);
}
-alien_t::alien_t(game::state_t *game) : unit_t(game, UNIT_ALIEN)
+unit_spider_t::unit_spider_t(game::state_t *game) : unit_t(game, UNIT_SPIDER)
{
cmodel.cflags = CF_BODY_SMALL;
health = max_health = 4;
@@ -343,14 +345,14 @@ alien_t::alien_t(game::state_t *game) : unit_t(game, UNIT_ALIEN)
size[1] = v2f_t(+0.2f, +0.3f);
render_size[0] = v2f_t(-0.3f, -0.3f);
render_size[1] = v2f_t(+0.3f, +0.3f);
- name = text::get(text::UNIT_ALIEN);
+ name = text::get(text::UNIT_NAME_SPIDER);
cs.armor_class = 5;
cs.hit_roll = roll_params_t(20);
cs.damage_roll = roll_params_t(3, 6, 1);
}
-void alien_t::on_think(void)
+void unit_spider_t::on_think(void)
{
if (dead)
return;
@@ -358,7 +360,7 @@ void alien_t::on_think(void)
if (game->now > next_targetting) {
unit_t *target;
- target = find_target(world, x, 10.0f, UNIT_HUMAN);
+ target = find_target(world, x, 10.0f, UNIT_SOLDIER);
if (target) {
if (last_attack + 0.5 < game->now) {
world::trace_t trace;
@@ -381,28 +383,28 @@ void alien_t::on_think(void)
keep_moving(7.0);
}
-void alien_t::on_wake(void)
+void unit_spider_t::on_wake(void)
{
next_targetting = game->now;
}
-void alien_t::on_death(void)
+void unit_spider_t::on_death(void)
{
render_layer = -1;
cmodel.cflags = CF_BACKGROUND;
}
-void alien_t::render_to(render::state_t *render)
+void unit_spider_t::render_to(render::state_t *render)
{
bool moving;
moving = move.moving && !move.blocked;
if (!dead)
- render->render(game->now * 20, (moving ? &assets::alien.walking :
- &assets::alien.idle), render_bounds, move.angle);
+ render->render(game->now * 20, (moving ? &assets::spider.walking :
+ &assets::spider.idle), render_bounds, move.angle);
else
- render->render(game->now * 20, &assets::alien.dead, render_bounds);
+ render->render(game->now * 20, &assets::spider.dead, render_bounds);
unit_t::render_to(render);
}
diff --git a/src/text.cpp b/src/text.cpp
index 0959277..3204776 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -4,7 +4,7 @@ namespace text {
language_t language = LANG_ENGLISH;
-static const char *human_names[] = {
+static const char *soldier_names[] = {
"Kowalski", "Jackson", "Carter", "O'Neill", "Hammond", "Mitchell"
};
@@ -23,11 +23,11 @@ static std::string get_english(index_t index)
case SAY_MOVING:
return "On my way.";
- case UNIT_ALIEN:
- return "Alien";
+ case UNIT_NAME_SPIDER:
+ return "Spider";
- case UNIT_HUMAN:
- return human_names[rand() % count(human_names)];
+ case UNIT_NAME_SOLDIER:
+ return soldier_names[rand() % count(soldier_names)];
case UNIT_DEATH:
return "died";
@@ -67,11 +67,11 @@ static std::string get_polish(index_t index)
case SAY_MOVING:
return "Jestem w drodze.";
- case UNIT_ALIEN:
- return "Obcy";
+ case UNIT_NAME_SPIDER:
+ return "Pająk";
- case UNIT_HUMAN:
- return human_names[rand() % count(human_names)];
+ case UNIT_NAME_SOLDIER:
+ return soldier_names[rand() % count(soldier_names)];
case UNIT_DEATH:
return "nie żyje";