made halo for Elder Mage now align properly

This commit is contained in:
Dave White 2004-05-29 04:18:12 +00:00
parent a3aa1caac6
commit aea345486d
4 changed files with 30 additions and 17 deletions

View file

@ -16,7 +16,7 @@ alignment=neutral
advanceto=null
cost=35
usage=mixed fighter
unit_description="Oncegreat, Elder Mages have seen their power a little diminished from wearying years of battle. Nevertheless they remain feared on the battlefield on account of their powerful lightning bolts."
unit_description="Once great, Elder Mages have seen their power a little diminished from wearying years of battle. Nevertheless they remain feared on the battlefield on account of their powerful lightning bolts."
[attack]
name=staff
type=impact
@ -41,21 +41,21 @@ unit_description="Oncegreat, Elder Mages have seen their power a little diminish
end=0
image=elder-mage-attack.png
halo=halo/elder-mage-halo1.png,halo/elder-mage-halo2.png,halo/elder-mage-halo3.png,halo/elder-mage-halo4.png,halo/elder-mage-halo5.png,halo/elder-mage-halo6.png
halo_x,halo_y=23,-376
halo_x,halo_y=13,-376
[/frame]
[frame]
begin=0
end=50
image=elder-mage-attack.png
halo=halo/elder-mage-halo5.png
halo_x,halo_y=23,-376
halo_x,halo_y=13,-376
[/frame]
[frame]
begin=50
end=100
image=elder-mage.png
halo=halo/elder-mage-halo3.png
halo_x,halo_y=23,-376
halo_x,halo_y=13,-376
[/frame]
[sound]
time=-200

View file

@ -89,6 +89,8 @@ public:
//(from top tip to bottom tip or left edge to right edge)
int hex_size() const;
//function which returns the width of a pixel, up to where the next hex starts
//(i.e. not entirely from tip to tip -- use hex_size() to get the distance from tip to tip)
int hex_width() const;
enum SCROLL_TYPE { SCROLL, WARP };

View file

@ -590,26 +590,34 @@ bool do_replay(display& disp, const gamemap& map, const game_data& gameinfo,
//if we are expecting promotions here
if(advancing_units.empty() == false) {
if(cfg == NULL || (child = cfg->child("choose")) == NULL) {
if(cfg == NULL) {
std::cerr << "promotion expected, but none found\n";
throw replay::error();
}
const int val = lexical_cast_default<int>((*child)["value"]);
//if there is a promotion, we process it and go onto the next command
//but if this isn't a promotion, we just keep waiting for the promotion
//command -- it may have been mixed up with other commands such as messages
if((child = cfg->child("choose")) != NULL) {
const bool res = dialogs::animate_unit_advancement(gameinfo,units,advancing_units.front(),disp,val);
const int val = lexical_cast_default<int>((*child)["value"]);
advancing_units.pop_front();
const bool res = dialogs::animate_unit_advancement(gameinfo,units,advancing_units.front(),disp,val);
//if there are no more advancing units, then we check for victory,
//in case the battle that led to advancement caused the end of scenario
if(advancing_units.empty()) {
check_victory(units,teams);
advancing_units.pop_front();
//if there are no more advancing units, then we check for victory,
//in case the battle that led to advancement caused the end of scenario
if(advancing_units.empty()) {
check_victory(units,teams);
}
continue;
}
}
//if there is nothing more in the records
else if(cfg == NULL) {
if(cfg == NULL) {
replayer.set_skip(0);
return false;
}

View file

@ -118,7 +118,7 @@ void move_unit_between(display& disp, const gamemap& map, const gamemap::locatio
util::scoped_resource<int,halo::remover> halo_effect(0);
if(halo.empty() == false && !disp.fogged(b.x,b.y)) {
halo_effect.assign(halo::add(xpos+disp.hex_width()/2,ypos+disp.hex_size()/2,halo));
halo_effect.assign(halo::add(xpos+disp.hex_size()/2,ypos+disp.hex_size()/2,halo));
}
const int new_ticks = SDL_GetTicks();
@ -298,7 +298,10 @@ bool unit_attack_ranged(display& disp, unit_map& units, const gamemap& map,
unit_halo_y = new_halo_y;
if(unit_halo_image != NULL && !disp.fogged(a.x,a.y)) {
unit_halo_effect.assign(halo::add(disp.get_location_x(a)+disp.hex_width()/2 + unit_halo_x*disp.zoom(),disp.get_location_y(a)+disp.hex_size()/2 + unit_halo_y*disp.zoom(),*unit_halo_image));
const int halo_xpos = disp.get_location_x(a)+disp.hex_size()/2 + unit_halo_x*disp.zoom();
const int halo_ypos = disp.get_location_y(a)+disp.hex_size()/2 + unit_halo_y*disp.zoom();
unit_halo_effect.assign(halo::add(halo_xpos,halo_ypos,*unit_halo_image));
} else {
unit_halo_effect.assign(0);
}
@ -390,7 +393,7 @@ bool unit_attack_ranged(display& disp, unit_map& units, const gamemap& map,
disp.draw_unit(xpos,ypos,img,vflip);
}
const int halo_xpos = xpos+disp.hex_width()/2;
const int halo_xpos = xpos+disp.hex_size()/2;
const int halo_ypos = ypos+disp.hex_size()/2;
if(missile_halo_image != new_halo || missile_halo_x != new_halo_x || missile_halo_y != new_halo_y) {
@ -656,7 +659,7 @@ bool unit_attack(display& disp, unit_map& units, const gamemap& map,
const int posx = int(pos*xsrc + (1.0-pos)*xdst) + xoffset;
const int posy = int(pos*ysrc + (1.0-pos)*ydst);
const int halo_xpos = posx+disp.hex_width()/2;
const int halo_xpos = posx+disp.hex_size()/2;
const int halo_ypos = posy+disp.hex_size()/2;
if(new_halo_image != halo_image || new_halo_x != halo_x || new_halo_y != halo_y) {