fixes to the theme.
Fixed poison healing bug, and made it so that poisoned units are shown with a green hue
This commit is contained in:
parent
558cff8bd6
commit
f48cd4f5d9
11 changed files with 66 additions and 34 deletions
|
@ -652,7 +652,7 @@ Defeat:
|
|||
[/message]
|
||||
[message]
|
||||
id=msg6_38
|
||||
speaker=Delfador
|
||||
description=Delfador
|
||||
message=With Kalenz slain, it is hopeless. We are defeated.
|
||||
[/message]
|
||||
[endlevel]
|
||||
|
|
|
@ -11,6 +11,15 @@ height=600
|
|||
yanchor=top
|
||||
[/main_map]
|
||||
|
||||
[menu]
|
||||
title=main_menu
|
||||
image=lite
|
||||
items=objectives,unitlist,recruit,recall,statustable,endturn,quit
|
||||
rect=4,2
|
||||
xanchor=fixed
|
||||
yanchor=fixed
|
||||
[/menu]
|
||||
|
||||
[menu]
|
||||
is_context_menu=true
|
||||
items=objectives,recruit,recall,preferences,statustable,unitlist,undo,redo,createunit,save,endturn,describeunit,speak
|
||||
|
@ -124,18 +133,18 @@ height=600
|
|||
xanchor=proportional
|
||||
yanchor=fixed
|
||||
[/label]
|
||||
# income icon
|
||||
[label]
|
||||
icon=misc/income.png
|
||||
text=income
|
||||
rect=580,3,612,19
|
||||
xanchor=proportional
|
||||
yanchor=fixed
|
||||
[/label]
|
||||
# upkeep icon
|
||||
[label]
|
||||
icon=misc/upkeep.png
|
||||
text=upkeep
|
||||
rect=580,3,612,19
|
||||
xanchor=proportional
|
||||
yanchor=fixed
|
||||
[/label]
|
||||
# income icon
|
||||
[label]
|
||||
icon=misc/income.png
|
||||
text=income
|
||||
rect=685,3,717,19
|
||||
xanchor=proportional
|
||||
yanchor=fixed
|
||||
|
@ -182,22 +191,22 @@ height=600
|
|||
prefix=
|
||||
prefix_literal=""
|
||||
[/num_units]
|
||||
[income]
|
||||
[upkeep]
|
||||
font_size=12
|
||||
rect=617,4,670,20
|
||||
xanchor=proportional
|
||||
yanchor=fixed
|
||||
prefix=
|
||||
prefix_literal=""
|
||||
[/income]
|
||||
[upkeep]
|
||||
[/upkeep]
|
||||
[income]
|
||||
font_size=12
|
||||
rect=722,4,775,20
|
||||
xanchor=proportional
|
||||
yanchor=fixed
|
||||
prefix=
|
||||
prefix_literal=""
|
||||
[/upkeep]
|
||||
[/income]
|
||||
[terrain]
|
||||
font_size=12
|
||||
rect=790,4,890,20
|
||||
|
|
|
@ -187,6 +187,7 @@ your_turn="It is now your turn"
|
|||
leader="Leader"
|
||||
|
||||
#buttons
|
||||
main_menu="Menu"
|
||||
ok_button="Ok"
|
||||
cancel_button="Cancel"
|
||||
yes_button="Yes"
|
||||
|
@ -218,6 +219,7 @@ campaign_button="Campaign"
|
|||
load_button="Load"
|
||||
multiplayer_button="Multiplayer"
|
||||
quit_button="Quit"
|
||||
quit="Quit Game"
|
||||
language_button="Language"
|
||||
|
||||
configure_sides="Configure Sides:"
|
||||
|
|
|
@ -800,12 +800,6 @@ void calculate_healing(display& disp, const gamemap& map,
|
|||
|
||||
unit& u = units.find(loc)->second;
|
||||
|
||||
if(h->second > 0 && h->second > u.max_hitpoints()-u.hitpoints()) {
|
||||
h->second = u.max_hitpoints()-u.hitpoints();
|
||||
if(h->second <= 0)
|
||||
continue;
|
||||
}
|
||||
|
||||
if(show_healing) {
|
||||
disp.scroll_to_tile(loc.x,loc.y,display::WARP);
|
||||
disp.select_hex(loc);
|
||||
|
@ -814,6 +808,8 @@ void calculate_healing(display& disp, const gamemap& map,
|
|||
|
||||
const int DelayAmount = 50;
|
||||
|
||||
std::cerr << "unit is poisoned? " << (u.has_flag("poisoned") ? "yes" : "no") << "," << h->second << "," << max_healing[h->first] << "\n";
|
||||
|
||||
if(u.has_flag("poisoned") && h->second > 0) {
|
||||
|
||||
//poison is purged only if we are on a village or next to a curer
|
||||
|
@ -838,6 +834,12 @@ void calculate_healing(display& disp, const gamemap& map,
|
|||
sound::play_sound("heal.wav");
|
||||
}
|
||||
|
||||
if(h->second > 0 && h->second > u.max_hitpoints()-u.hitpoints()) {
|
||||
h->second = u.max_hitpoints()-u.hitpoints();
|
||||
if(h->second <= 0)
|
||||
continue;
|
||||
}
|
||||
|
||||
while(h->second > 0) {
|
||||
const display::Pixel heal_colour = disp.rgb(0,0,200);
|
||||
u.heal(1);
|
||||
|
|
|
@ -856,7 +856,7 @@ std::string& config::escape(std::string& str)
|
|||
std::string::size_type pos = 0;
|
||||
|
||||
do {
|
||||
pos=str.find_first_of("#@{}+-,\\*",pos);
|
||||
pos = str.find_first_of("#@{}+-,\\*",pos);
|
||||
if(pos != std::string::npos) {
|
||||
str.insert(pos,1,'\\');
|
||||
pos += 2;
|
||||
|
@ -874,7 +874,7 @@ std::string& config::unescape(std::string& str)
|
|||
pos = str.find('\\',pos);
|
||||
if(pos != std::string::npos) {
|
||||
str.erase(pos,1);
|
||||
pos++;
|
||||
++pos;
|
||||
}
|
||||
} while(pos < str.size() && pos != std::string::npos);
|
||||
return str;
|
||||
|
|
|
@ -1311,19 +1311,24 @@ void display::draw_tile(int x, int y, SDL_Surface* unit_image_override,
|
|||
(teams_[currentTeam_].is_enemy(it->second.side()) &&
|
||||
it->second.invisible(map_.underlying_terrain(map_[x][y]),
|
||||
status_.get_time_of_day().lawful_bonus,loc,
|
||||
units_,teams_)))
|
||||
units_,teams_))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(loc != hiddenUnit_) {
|
||||
if(draw_hit) {
|
||||
blend_with = hit_colour;
|
||||
highlight_ratio = 0.7;
|
||||
} else if(loc == advancingUnit_ && it != units_.end()) {
|
||||
//set the advancing colour to white if it's a non-chaotic unit,
|
||||
//otherwise black
|
||||
//the unit is advancing - set the advancing colour to white if it's a
|
||||
//non-chaotic unit, otherwise black
|
||||
blend_with = it->second.type().alignment() == unit_type::CHAOTIC ?
|
||||
0x0001 : 0xFFFF;
|
||||
highlight_ratio = advancingAmount_;
|
||||
} else if(it->second.poisoned()) {
|
||||
//the unit is poisoned - draw with a green hue
|
||||
blend_with = SDL_MapRGB(dst->format,0,255,0);
|
||||
highlight_ratio = 0.75;
|
||||
}
|
||||
|
||||
const int height_adjust = it->second.is_flying() ? 0 : int(map_.get_terrain_info(terrain).unit_height_adjust()*(zoom_/DefaultZoom));
|
||||
|
@ -1473,16 +1478,15 @@ void display::draw_footstep(const gamemap::location& loc, int xloc, int yloc)
|
|||
if(show_time && route_.move_left > 0 && route_.move_left < 10) {
|
||||
//draw number in yellow if terrain is light, else draw in black
|
||||
gamemap::TERRAIN terrain = map_.get_terrain(loc);
|
||||
bool tile_is_light = map_.get_terrain_info (terrain).is_light ();;
|
||||
const bool tile_is_light = map_.get_terrain_info(terrain).is_light();
|
||||
SDL_Color text_colour = tile_is_light ? font::DARK_COLOUR : font::YELLOW_COLOUR;
|
||||
|
||||
const SDL_Rect& rect = map_area();
|
||||
static std::string str(1,'x');
|
||||
str[0] = '0' + route_.move_left + 1;
|
||||
const SDL_Rect& text_area = font::draw_text(NULL,map_area(),18,text_colour,str,0,0);
|
||||
const std::string str(1,'1' + route_.move_left);
|
||||
const SDL_Rect& text_area = font::draw_text(NULL,rect,18,text_colour,str,0,0);
|
||||
const int x = xloc + int(zoom_/2.0) - text_area.w/2;
|
||||
const int y = yloc + int(zoom_/2.0) - text_area.h/2;
|
||||
font::draw_text(this,map_area(),18,text_colour,str,x,y);
|
||||
font::draw_text(this,rect,18,text_colour,str,x,y);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -715,6 +715,7 @@ bool turn_info::can_execute_command(hotkey::HOTKEY_COMMAND command) const
|
|||
case hotkey::HOTKEY_PREFERENCES:
|
||||
case hotkey::HOTKEY_OBJECTIVES:
|
||||
case hotkey::HOTKEY_UNIT_LIST:
|
||||
case hotkey::HOTKEY_QUIT_GAME:
|
||||
return true;
|
||||
|
||||
case hotkey::HOTKEY_SPEAK:
|
||||
|
|
|
@ -221,7 +221,7 @@ int show_dialog(display& disp, SDL_Surface* image,
|
|||
const std::vector<unit>* units_ptr,
|
||||
const std::string& text_widget_label,
|
||||
std::string* text_widget_text,
|
||||
dialog_action* action, std::vector<check_item>* options)
|
||||
dialog_action* action, std::vector<check_item>* options, int xloc, int yloc)
|
||||
{
|
||||
if(disp.update_locked())
|
||||
return -1;
|
||||
|
@ -385,8 +385,10 @@ int show_dialog(display& disp, SDL_Surface* image,
|
|||
padding_height + button_heights + menu_.height() +
|
||||
text_widget_height + check_button_height;
|
||||
|
||||
int xloc = scr->w/2 - total_width/2;
|
||||
int yloc = scr->h/2 - total_height/2;
|
||||
if(xloc == -1 || yloc == -1) {
|
||||
xloc = scr->w/2 - total_width/2;
|
||||
yloc = scr->h/2 - total_height/2;
|
||||
}
|
||||
|
||||
int unitx = 0;
|
||||
int unity = 0;
|
||||
|
@ -688,7 +690,7 @@ network::connection network_data_dialog(display& disp, const std::string& msg, c
|
|||
}
|
||||
|
||||
dialog_action_receive_network receiver(connection_num,cfg,stats);
|
||||
const int res = gui::show_dialog(disp,NULL,"",str.str(),CANCEL_ONLY,NULL,NULL,"",NULL,&receiver);
|
||||
const int res = show_dialog(disp,NULL,"",str.str(),CANCEL_ONLY,NULL,NULL,"",NULL,&receiver);
|
||||
if(res != int(dialog_action_receive_network::CONNECTION_CONTINUING)) {
|
||||
return receiver.result();
|
||||
}
|
||||
|
@ -698,6 +700,11 @@ network::connection network_data_dialog(display& disp, const std::string& msg, c
|
|||
void fade_logo(display& screen, int xpos, int ypos)
|
||||
{
|
||||
const scoped_sdl_surface logo_unscaled(image::get_image(game_config::game_logo,image::UNSCALED));
|
||||
if(logo_unscaled == NULL) {
|
||||
std::cerr << "Could not find game logo\n";
|
||||
return;
|
||||
}
|
||||
|
||||
const scoped_sdl_surface logo(scale_surface(logo_unscaled,(logo_unscaled->w*screen.x())/1024,(logo_unscaled->h*screen.y())/768));
|
||||
if(logo == NULL) {
|
||||
std::cerr << "Could not find game logo\n";
|
||||
|
|
|
@ -80,7 +80,7 @@ int show_dialog(display& screen, SDL_Surface* image,
|
|||
const std::string& text_widget_label="",
|
||||
std::string* text_widget_text=NULL,
|
||||
dialog_action* action=NULL,
|
||||
std::vector<check_item>* options=NULL
|
||||
std::vector<check_item>* options=NULL, int xloc=-1, int yloc=-1
|
||||
);
|
||||
|
||||
network::connection network_data_dialog(display& disp, const std::string& msg, config& cfg, network::connection connection_num=0);
|
||||
|
|
|
@ -348,6 +348,12 @@ bool unit::invisible(gamemap::TERRAIN terrain, int lawful_bonus,
|
|||
return false;
|
||||
}
|
||||
|
||||
bool unit::poisoned() const
|
||||
{
|
||||
static const std::string poisoned_str("poisoned");
|
||||
return has_flag(poisoned_str);
|
||||
}
|
||||
|
||||
bool unit::matches_filter(const config& cfg) const
|
||||
{
|
||||
const std::string& description = cfg["description"];
|
||||
|
|
|
@ -70,6 +70,7 @@ public:
|
|||
bool invisible(gamemap::TERRAIN terrain, int lawful_bonus,
|
||||
const gamemap::location loc,
|
||||
const unit_map& units,const std::vector<team>& teams) const;
|
||||
bool poisoned() const;
|
||||
|
||||
bool matches_filter(const config& cfg) const;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue