summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LICENSE6
-rw-r--r--assets/units/nest/death.oggbin0 -> 19293 bytes
-rw-r--r--assets/units/nest/pain.oggbin0 -> 7172 bytes
-rw-r--r--assets/units/nest/spawn.oggbin0 -> 7886 bytes
-rw-r--r--assets/units/repl/damage1.oggbin0 -> 10481 bytes
-rw-r--r--assets/units/repl/damage2.oggbin0 -> 8742 bytes
-rw-r--r--assets/units/repl/damage3.oggbin0 -> 10214 bytes
-rw-r--r--assets/units/soldier/death1.oggbin0 -> 14193 bytes
-rw-r--r--assets/units/soldier/death2.oggbin0 -> 10072 bytes
-rw-r--r--assets/units/soldier/pain.oggbin0 -> 8216 bytes
-rw-r--r--assets/units/spider/bite.oggbin0 -> 5774 bytes
-rw-r--r--assets/units/spider/sound1.oggbin0 -> 7420 bytes
-rw-r--r--assets/units/spider/sound2.oggbin0 -> 8805 bytes
-rw-r--r--assets/units/spider/sound3.oggbin0 -> 8802 bytes
-rw-r--r--assets/units/spider/sound4.oggbin0 -> 7541 bytes
-rw-r--r--assets/units/spider/sound5.oggbin0 -> 7151 bytes
-rw-r--r--assets/units/spider/sound6.oggbin0 -> 5323 bytes
-rw-r--r--assets/units/spider/sound7.oggbin0 -> 7694 bytes
-rw-r--r--src/game/assets.cpp17
-rw-r--r--src/game/game.cpp1
-rw-r--r--src/game/game.hpp19
-rw-r--r--src/game/unit_nest.cpp10
-rw-r--r--src/game/unit_repl.cpp7
-rw-r--r--src/game/unit_soldier.cpp6
-rw-r--r--src/game/unit_spider.cpp9
25 files changed, 60 insertions, 15 deletions
diff --git a/LICENSE b/LICENSE
index 569d81f..ed7c749 100644
--- a/LICENSE
+++ b/LICENSE
@@ -22,8 +22,12 @@ The following assets are from Tremulous and are licensed under CC-BY-SA:
FILE
assets/ambience/wind.ogg
-assets/units/repl/sound.ogg
+assets/units/nest/*.ogg
+assets/units/repl/*.ogg
+assets/units/soldier/death*.ogg
assets/units/soldier/gibbing.ogg
+assets/units/soldier/pain.ogg
+assets/units/spider/*.ogg
The following assets were made by various other authors:
diff --git a/assets/units/nest/death.ogg b/assets/units/nest/death.ogg
new file mode 100644
index 0000000..6e2e3f8
--- /dev/null
+++ b/assets/units/nest/death.ogg
Binary files differ
diff --git a/assets/units/nest/pain.ogg b/assets/units/nest/pain.ogg
new file mode 100644
index 0000000..7392e89
--- /dev/null
+++ b/assets/units/nest/pain.ogg
Binary files differ
diff --git a/assets/units/nest/spawn.ogg b/assets/units/nest/spawn.ogg
new file mode 100644
index 0000000..5e82300
--- /dev/null
+++ b/assets/units/nest/spawn.ogg
Binary files differ
diff --git a/assets/units/repl/damage1.ogg b/assets/units/repl/damage1.ogg
new file mode 100644
index 0000000..8ce13c1
--- /dev/null
+++ b/assets/units/repl/damage1.ogg
Binary files differ
diff --git a/assets/units/repl/damage2.ogg b/assets/units/repl/damage2.ogg
new file mode 100644
index 0000000..b529119
--- /dev/null
+++ b/assets/units/repl/damage2.ogg
Binary files differ
diff --git a/assets/units/repl/damage3.ogg b/assets/units/repl/damage3.ogg
new file mode 100644
index 0000000..0150fc4
--- /dev/null
+++ b/assets/units/repl/damage3.ogg
Binary files differ
diff --git a/assets/units/soldier/death1.ogg b/assets/units/soldier/death1.ogg
new file mode 100644
index 0000000..5b5e095
--- /dev/null
+++ b/assets/units/soldier/death1.ogg
Binary files differ
diff --git a/assets/units/soldier/death2.ogg b/assets/units/soldier/death2.ogg
new file mode 100644
index 0000000..a5f5be8
--- /dev/null
+++ b/assets/units/soldier/death2.ogg
Binary files differ
diff --git a/assets/units/soldier/pain.ogg b/assets/units/soldier/pain.ogg
new file mode 100644
index 0000000..89225ac
--- /dev/null
+++ b/assets/units/soldier/pain.ogg
Binary files differ
diff --git a/assets/units/spider/bite.ogg b/assets/units/spider/bite.ogg
new file mode 100644
index 0000000..dbfd909
--- /dev/null
+++ b/assets/units/spider/bite.ogg
Binary files differ
diff --git a/assets/units/spider/sound1.ogg b/assets/units/spider/sound1.ogg
new file mode 100644
index 0000000..1ff7c2f
--- /dev/null
+++ b/assets/units/spider/sound1.ogg
Binary files differ
diff --git a/assets/units/spider/sound2.ogg b/assets/units/spider/sound2.ogg
new file mode 100644
index 0000000..0c124b0
--- /dev/null
+++ b/assets/units/spider/sound2.ogg
Binary files differ
diff --git a/assets/units/spider/sound3.ogg b/assets/units/spider/sound3.ogg
new file mode 100644
index 0000000..6efa96a
--- /dev/null
+++ b/assets/units/spider/sound3.ogg
Binary files differ
diff --git a/assets/units/spider/sound4.ogg b/assets/units/spider/sound4.ogg
new file mode 100644
index 0000000..b64d79d
--- /dev/null
+++ b/assets/units/spider/sound4.ogg
Binary files differ
diff --git a/assets/units/spider/sound5.ogg b/assets/units/spider/sound5.ogg
new file mode 100644
index 0000000..96fe8bb
--- /dev/null
+++ b/assets/units/spider/sound5.ogg
Binary files differ
diff --git a/assets/units/spider/sound6.ogg b/assets/units/spider/sound6.ogg
new file mode 100644
index 0000000..734e24f
--- /dev/null
+++ b/assets/units/spider/sound6.ogg
Binary files differ
diff --git a/assets/units/spider/sound7.ogg b/assets/units/spider/sound7.ogg
new file mode 100644
index 0000000..b388f8a
--- /dev/null
+++ b/assets/units/spider/sound7.ogg
Binary files differ
diff --git a/src/game/assets.cpp b/src/game/assets.cpp
index 2009672..59cf89a 100644
--- a/src/game/assets.cpp
+++ b/src/game/assets.cpp
@@ -44,6 +44,9 @@ void load(void)
soldier.fire.load("assets/units/soldier/fire.ogg");
soldier.fire.volume = 4.0f;
+ soldier.pain.load("assets/units/soldier/pain.ogg");
+ soldier.death.load("assets/units/soldier/death1.ogg");
+ soldier.death.load("assets/units/soldier/death2.ogg");
soldier.gib_sound.load("assets/units/soldier/gibbing.ogg");
soldier.step_stone.load("assets/units/soldier/step_stone_1.ogg");
@@ -56,13 +59,27 @@ void load(void)
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);
+ spider.sounds.load("assets/units/spider/sound1.ogg");
+ spider.sounds.load("assets/units/spider/sound2.ogg");
+ spider.sounds.load("assets/units/spider/sound3.ogg");
+ spider.sounds.load("assets/units/spider/sound4.ogg");
+ spider.sounds.load("assets/units/spider/sound5.ogg");
+ spider.sounds.load("assets/units/spider/sound6.ogg");
+ spider.sounds.load("assets/units/spider/sound7.ogg");
+ spider.bite.load("assets/units/spider/bite.ogg");
nest.idle.load("assets/units/nest/idle_", 5);
nest.dead.load("assets/units/nest/dead_", 1);
+ nest.spawn.load("assets/units/nest/spawn.ogg");
+ nest.pain.load("assets/units/nest/pain.ogg");
+ nest.death.load("assets/units/nest/death.ogg");
repl.idle.load("assets/units/repl/idle_", 1);
repl.dead.load("assets/units/repl/dead_", 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");
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 6e8ea78..bf9ec97 100644
--- a/src/game/game.cpp
+++ b/src/game/game.cpp
@@ -417,7 +417,6 @@ void state_t::explosion(v2f_t x)
continue;
damage = pow(1 - trace.frac, 2.0f) * 40.0f;
- printf("frac=%f, damage=%i\n", trace.frac, damage);
unit->damage(damage, nullptr);
}
}
diff --git a/src/game/game.hpp b/src/game/game.hpp
index 6c71736..27faf46 100644
--- a/src/game/game.hpp
+++ b/src/game/game.hpp
@@ -62,21 +62,24 @@ namespace game {
render::oriented_sprite_4M2_t legs_idle, legs_walking;
render::animated_texture_t dead, gibbing;
- audio::sound_t fire, step_stone, step_dirt, gib_sound;
+ audio::sound_t fire, step_stone, step_dirt, pain, death, gib_sound;
} soldier_assets_t;
typedef struct {
render::oriented_sprite_4M_t idle, walking;
render::animated_texture_t dead;
+
+ audio::sound_t sounds, bite;
} spider_assets_t;
typedef struct {
render::animated_texture_t idle, dead;
+ audio::sound_t spawn, pain, death;
} nest_assets_t;
typedef struct {
render::animated_texture_t idle, dead;
- audio::sound_t sound;
+ audio::sound_t sound, damage;
} repl_assets_t;
typedef struct {
@@ -252,7 +255,7 @@ namespace game {
void on_think(void);
void on_spawn(void) {};
void on_wake(void) {};
- void on_damage(unit_t *attacker) {};
+ void on_damage(unit_t *attacker);
void on_death(void);
};
@@ -267,7 +270,7 @@ namespace game {
void on_think(void);
void on_spawn(void) {};
- void on_wake(void) {};
+ void on_wake(void);
void on_damage(unit_t *attacker);
void on_death(void);
};
@@ -284,7 +287,7 @@ namespace game {
void on_think(void);
void on_spawn(void);
void on_wake(void) {};
- void on_damage(unit_t *attacker) {};
+ void on_damage(unit_t *attacker);
void on_death(void);
};
@@ -295,10 +298,10 @@ namespace game {
void render_to(render::state_t *render);
void render_late_to(render::state_t *render) {};
- void on_think(void);
- void on_spawn(void);
+ void on_think(void) {};
+ void on_spawn(void) {};
void on_wake(void) {};
- void on_damage(unit_t *attacker) {};
+ void on_damage(unit_t *attacker);
void on_death(void);
void activate(void);
diff --git a/src/game/unit_nest.cpp b/src/game/unit_nest.cpp
index cae98f5..5890d34 100644
--- a/src/game/unit_nest.cpp
+++ b/src/game/unit_nest.cpp
@@ -68,6 +68,7 @@ void unit_nest_t::on_think(void)
return;
spawn_spider(game, x);
+ assets::nest.spawn.play_3d(x);
next_spawning = game->now + game->prng.next_float() * 10 + 5;
}
@@ -78,10 +79,19 @@ void unit_nest_t::on_spawn(void)
spawn_spider(game, x);
}
+void unit_nest_t::on_damage(unit_t *attacker)
+{
+ if (attacker)
+ hivemind_attack(this, attacker->x);
+
+ assets::nest.pain.play_3d(x);
+}
+
void unit_nest_t::on_death(void)
{
render_layer = render::LAYER_FLAT;
cmodel.cflags = CF_BACKGROUND;
+ assets::nest.death.play_3d(x);
}
void unit_nest_t::render_to(render::state_t *render)
diff --git a/src/game/unit_repl.cpp b/src/game/unit_repl.cpp
index e11d204..11f49ae 100644
--- a/src/game/unit_repl.cpp
+++ b/src/game/unit_repl.cpp
@@ -35,12 +35,9 @@ unit_repl_t::unit_repl_t(game::state_t *game_) : unit_t(game_, UNIT_REPL)
controllable = true;
}
-void unit_repl_t::on_think(void)
-{
-}
-
-void unit_repl_t::on_spawn(void)
+void unit_repl_t::on_damage(unit_t *attacker)
{
+ assets::repl.damage.play_3d(x);
}
void unit_repl_t::on_death(void)
diff --git a/src/game/unit_soldier.cpp b/src/game/unit_soldier.cpp
index e49c25a..f4432bf 100644
--- a/src/game/unit_soldier.cpp
+++ b/src/game/unit_soldier.cpp
@@ -163,11 +163,17 @@ void unit_soldier_t::on_think(void)
}
}
+void unit_soldier_t::on_damage(unit_t *attacker)
+{
+ assets::soldier.pain.play_3d(x);
+}
+
void unit_soldier_t::on_death(void)
{
if (health >= -10) {
render_size[0] = v2f_t(-0.75f, -0.5f);
render_size[1] = v2f_t(+0.75f, +0.5f);
+ assets::soldier.death.play_3d(x);
} else {
assets::soldier.gib_sound.play_3d(x);
}
diff --git a/src/game/unit_spider.cpp b/src/game/unit_spider.cpp
index df9073c..32ae178 100644
--- a/src/game/unit_spider.cpp
+++ b/src/game/unit_spider.cpp
@@ -68,6 +68,12 @@ void unit_spider_t::target_and_attack(void)
last_attack = game->now;
target->damage(15, this);
+ assets::spider.bite.play_3d(x);
+}
+
+void unit_spider_t::on_wake(void)
+{
+ assets::spider.sounds.play_3d(x);
}
void unit_spider_t::on_think(void)
@@ -85,6 +91,8 @@ void unit_spider_t::on_think(void)
void unit_spider_t::on_damage(unit_t *attacker)
{
+ assets::spider.sounds.play_3d(x);
+
if (!attacker)
return;
@@ -101,6 +109,7 @@ void unit_spider_t::on_death(void)
render_layer = render::LAYER_FLAT;
cmodel.cflags = CF_BACKGROUND;
+ assets::spider.sounds.play_3d(x);
}
void unit_spider_t::render_to(render::state_t *render)