added new attack sounds for some units

This commit is contained in:
uid68803 2003-12-24 15:50:11 +00:00
parent f2d6c80910
commit e72286e28b
25 changed files with 86 additions and 4 deletions

View File

@ -24,6 +24,10 @@ get_hit_sound=groan.wav
range=short
damage=7
number=2
[sound]
time=-100
sound=staff.wav
[/sound]
[/attack]
[attack]
name=fireball

View File

@ -40,5 +40,9 @@ get_hit_sound=groan.wav
image=missiledagger-n.png
image_diagonal=missiledagger-ne.png
[/missile_frame]
[sound]
time=-100
sound=knife.wav
[/sound]
[/attack]
[/unit]

View File

@ -30,7 +30,7 @@ get_hit_sound=groan.wav
number=4
[/attack]
[attack]
name=throwing knife
name=knife
type=blade
range=long
damage=6
@ -41,5 +41,9 @@ get_hit_sound=groan.wav
image=missiledagger-n.png
image_diagonal=missiledagger-ne.png
[/missile_frame]
[sound]
time=-100
sound=knife.wav
[/sound]
[/attack]
[/unit]

View File

@ -23,6 +23,10 @@ unit_description="A once-great mage, the Elder Mage still holds much of his powe
range=short
damage=8
number=2
[sound]
time=-100
sound=staff.wav
[/sound]
[/attack]
[attack]
name=lightning

View File

@ -21,6 +21,10 @@ get_hit_sound=groan.wav
damage=4
number=2
range=short
[sound]
time=-100
sound=staff.wav
[/sound]
[/attack]
[attack]

View File

@ -29,6 +29,10 @@ get_hit_sound=groan.wav
end=100
image=elvish-shaman-attack.png
[/frame]
[sound]
time=-100
sound=staff.wav
[/sound]
[/attack]
[attack]

View File

@ -25,6 +25,10 @@ get_hit_sound=groan.wav
end=100
image=undead-necromancer-attack.png
[/frame]
[sound]
time=-100
sound=staff.wav
[/sound]
[/attack]
[attack]
name=magic

View File

@ -43,5 +43,9 @@ get_hit_sound=groan.wav
end=0
image=web.png
[/missile_frame]
[sound]
time=-100
sound=net.wav
[/sound]
[/attack]
[/unit]

View File

@ -23,6 +23,10 @@ get_hit_sound=groan.wav
range=short
damage=10
number=2
[sound]
time=-100
sound=staff.wav
[/sound]
[/attack]
[attack]
name=fireball

View File

@ -19,5 +19,9 @@ usage=fighter
range=short
damage=12
number=2
[sound]
time=-100
sound=mace.wav
[/sound]
[/attack]
[/unit]

View File

@ -25,6 +25,10 @@ get_hit_sound=groan.wav
end=100
image=undead-necromancer-attack.png
[/frame]
[sound]
time=-100
sound=staff.wav
[/sound]
[/attack]
[attack]
name=magic

View File

@ -35,5 +35,9 @@ get_hit_sound=groan.wav
image=missiledagger-n.png
image_diagonal=missiledagger-ne.png
[/missile_frame]
[sound]
time=-100
sound=knife.wav
[/sound]
[/attack]
[/unit]

View File

@ -19,5 +19,9 @@ usage=fighter
range=short
damage=20
number=2
[sound]
time=-100
sound=mace.wav
[/sound]
[/attack]
[/unit]

View File

@ -32,6 +32,10 @@ get_hit_sound=groan.wav
range=long
damage=7
number=1
[sound]
time=-100
sound=spear.wav
[/sound]
[frame]
begin=-100
end=100

View File

@ -25,5 +25,9 @@ get_hit_sound=groan.wav
end=100
image=troll-warrior-attack.png
[/frame]
[sound]
time=-100
sound=mace.wav
[/sound]
[/attack]
[/unit]

BIN
sounds/knife.wav Normal file

Binary file not shown.

BIN
sounds/mace.wav Normal file

Binary file not shown.

BIN
sounds/net.wav Normal file

Binary file not shown.

BIN
sounds/spear.wav Normal file

Binary file not shown.

BIN
sounds/staff.wav Normal file

Binary file not shown.

View File

@ -22,6 +22,7 @@
#include "config.hpp"
#include "filesystem.hpp"
#include "game_config.hpp"
#include "game_events.hpp"
#include "log.hpp"
#include "scoped_resource.hpp"
@ -642,6 +643,11 @@ const std::string& config::operator[](const std::string& key) const
{
const string_map::const_iterator i = values.find(key);
if(i != values.end()) {
//see if the value is a variable
if(i->second[0] == '$') {
return game_events::get_variable(std::string(i->second.begin()+1,i->second.end()));
}
return i->second;
} else {
static const std::string empty_string;

View File

@ -926,8 +926,8 @@ void display::draw_tile(int x, int y, SDL_Surface* unit_image_override,
image_type = image::GREYED;
}
if(loc == mouseoverHex_ || loc == selectedHex_ &&
units_.count(gamemap::location(x,y)) == 1) {
if(loc == mouseoverHex_ && map_.on_board(mouseoverHex_) ||
loc == selectedHex_ && units_.count(gamemap::location(x,y)) == 1) {
image_type = image::BRIGHTENED;
}

View File

@ -900,6 +900,20 @@ bool process_event(event_handler& handler, const queued_event& ev)
namespace game_events {
const std::string& get_variable(const std::string& key)
{
static const std::string empty_string;
if(state_of_game != NULL) {
const string_map::const_iterator i = state_of_game->variables.find(key);
if(i != state_of_game->variables.end())
return i->second;
else
return empty_string;
} else {
return empty_string;
}
}
manager::manager(config& cfg, display& gui_, gamemap& map_,
std::map<gamemap::location,unit>& units_,
std::vector<team>& teams_,

View File

@ -34,6 +34,8 @@
namespace game_events
{
const std::string& get_variable(const std::string& varname);
//the game event manager loads the scenario configuration object, and
//ensures that events are handled according to the scenario configuration
//for its lifetime.

View File

@ -612,7 +612,7 @@ void turn_info::show_menu()
}
static const std::string create_unit_debug = "Create Unit (debug)";
if(game_config::debug) {
if(game_config::debug && map_.on_board(last_hex_)) {
menu.push_back(create_unit_debug);
}