default anmiations are now based on standing animations...

...instead of standing frames. Also removed anims in bats and ghost
caused by that bug (fix bug 10898)
This commit is contained in:
Jérémy Rosen 2008-02-02 14:53:37 +00:00
parent d1b7b257c6
commit 052b3a88b7
10 changed files with 284 additions and 707 deletions

View file

@ -20,6 +20,8 @@ Version 1.3.15+svn:
* More gcc 4.3 fixed
* Hide race sections having only units with "hide_help=true"
* Optimize roads placing of random map
* when a unit miss an animation, the engine will base the replacement on
the standing animation instead of the standing frame
Version 1.3.15:
* language and i18n:

View file

@ -166,78 +166,6 @@
image="units/undead/bloodbat-ne-4.png"
[/frame]
[/standing_anim]
[movement_anim]
direction=s,se,sw
start_time=0
[frame]
duration=50
image="units/undead/bloodbat-se-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-se-2.png"
[/frame]
[frame]
duration=80
image="units/undead/bloodbat-se-1.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-se-2.png"
[/frame]
[frame]
duration=50
image="units/undead/bloodbat-se-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-se-4.png"
[/frame]
[frame]
duration=80
image="units/undead/bloodbat-se-5.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-se-4.png"
[/frame]
[/movement_anim]
[movement_anim]
direction=n,ne,nw
start_time=0
[frame]
duration=50
image="units/undead/bloodbat-ne-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-ne-2.png"
[/frame]
[frame]
duration=80
image="units/undead/bloodbat-ne-1.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-ne-2.png"
[/frame]
[frame]
duration=50
image="units/undead/bloodbat-ne-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-ne-4.png"
[/frame]
[frame]
duration=80
image="units/undead/bloodbat-ne-5.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-ne-4.png"
[/frame]
[/movement_anim]
[attack]
name=fangs
@ -367,156 +295,4 @@
image="units/undead/bloodbat-ne-3.png"
[/frame]
[/attack_anim]
[recruit_anim]
alpha=0~1
direction=s,se,sw
start_time=0
[frame]
duration=50
image="units/undead/bloodbat-se-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-se-2.png"
[/frame]
[frame]
duration=80
image="units/undead/bloodbat-se-1.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-se-2.png"
[/frame]
[frame]
duration=50
image="units/undead/bloodbat-se-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-se-4.png"
[/frame]
[frame]
duration=80
image="units/undead/bloodbat-se-5.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-se-4.png"
[/frame]
[/recruit_anim]
[recruit_anim]
direction=n,ne,nw
start_time=0
alpha=0~1
[frame]
duration=50
image="units/undead/bloodbat-ne-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-ne-2.png"
[/frame]
[frame]
duration=80
image="units/undead/bloodbat-ne-1.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-ne-2.png"
[/frame]
[frame]
duration=50
image="units/undead/bloodbat-ne-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-ne-4.png"
[/frame]
[frame]
duration=80
image="units/undead/bloodbat-ne-5.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-ne-4.png"
[/frame]
[/recruit_anim]
[animation]
apply_to=selected
direction=s,se,sw
start_time=0
blend_color=255,255,255
blend_ratio="0.0~0.3:100,0.3~0.0:200,0.0"
[frame]
duration=50
image="units/undead/bloodbat-se-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-se-2.png"
[/frame]
[frame]
duration=80
image="units/undead/bloodbat-se-1.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-se-2.png"
[/frame]
[frame]
duration=50
image="units/undead/bloodbat-se-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-se-4.png"
[/frame]
[frame]
duration=80
image="units/undead/bloodbat-se-5.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-se-4.png"
[/frame]
[/animation]
[animation]
apply_to=selected
blend_color=255,255,255
blend_ratio="0.0~0.3:100,0.3~0.0:200,0.0"
direction=n,ne,nw
start_time=0
[frame]
duration=50
image="units/undead/bloodbat-ne-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-ne-2.png"
[/frame]
[frame]
duration=80
image="units/undead/bloodbat-ne-1.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-ne-2.png"
[/frame]
[frame]
duration=50
image="units/undead/bloodbat-ne-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-ne-4.png"
[/frame]
[frame]
duration=80
image="units/undead/bloodbat-ne-5.png"
[/frame]
[frame]
duration=60
image="units/undead/bloodbat-ne-4.png"
[/frame]
[/animation]
[/unit]

View file

@ -165,78 +165,6 @@
image="units/undead/bat-ne-4.png"
[/frame]
[/standing_anim]
[movement_anim]
direction=s,se,sw
start_time=0
[frame]
duration=50
image="units/undead/bat-se-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-se-2.png"
[/frame]
[frame]
duration=80
image="units/undead/bat-se-1.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-se-2.png"
[/frame]
[frame]
duration=50
image="units/undead/bat-se-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-se-4.png"
[/frame]
[frame]
duration=80
image="units/undead/bat-se-5.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-se-4.png"
[/frame]
[/movement_anim]
[movement_anim]
direction=n,ne,nw
start_time=0
[frame]
duration=50
image="units/undead/bat-ne-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-ne-2.png"
[/frame]
[frame]
duration=80
image="units/undead/bat-ne-1.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-ne-2.png"
[/frame]
[frame]
duration=50
image="units/undead/bat-ne-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-ne-4.png"
[/frame]
[frame]
duration=80
image="units/undead/bat-ne-5.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-ne-4.png"
[/frame]
[/movement_anim]
[attack]
name=fangs
@ -365,156 +293,4 @@
image="units/undead/bat-ne-3.png"
[/frame]
[/attack_anim]
[recruit_anim]
direction=s,se,sw
start_time=0
alpha=0~1
[frame]
duration=50
image="units/undead/bat-se-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-se-2.png"
[/frame]
[frame]
duration=80
image="units/undead/bat-se-1.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-se-2.png"
[/frame]
[frame]
duration=50
image="units/undead/bat-se-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-se-4.png"
[/frame]
[frame]
duration=80
image="units/undead/bat-se-5.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-se-4.png"
[/frame]
[/recruit_anim]
[recruit_anim]
direction=n,ne,nw
start_time=0
alpha=0~1
[frame]
duration=50
image="units/undead/bat-ne-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-ne-2.png"
[/frame]
[frame]
duration=80
image="units/undead/bat-ne-1.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-ne-2.png"
[/frame]
[frame]
duration=50
image="units/undead/bat-ne-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-ne-4.png"
[/frame]
[frame]
duration=80
image="units/undead/bat-ne-5.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-ne-4.png"
[/frame]
[/recruit_anim]
[animation]
apply_to=selected
blend_color=255,255,255
blend_ratio="0.0~0.3:100,0.3~0.0:200,0.0"
direction=s,se,sw
start_time=0
[frame]
duration=50
image="units/undead/bat-se-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-se-2.png"
[/frame]
[frame]
duration=80
image="units/undead/bat-se-1.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-se-2.png"
[/frame]
[frame]
duration=50
image="units/undead/bat-se-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-se-4.png"
[/frame]
[frame]
duration=80
image="units/undead/bat-se-5.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-se-4.png"
[/frame]
[/animation]
[animation]
apply_to=selected
blend_color=255,255,255
blend_ratio="0.0~0.3:100,0.3~0.0:200,0.0"
direction=n,ne,nw
start_time=0
[frame]
duration=50
image="units/undead/bat-ne-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-ne-2.png"
[/frame]
[frame]
duration=80
image="units/undead/bat-ne-1.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-ne-2.png"
[/frame]
[frame]
duration=50
image="units/undead/bat-ne-3.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-ne-4.png"
[/frame]
[frame]
duration=80
image="units/undead/bat-ne-5.png"
[/frame]
[frame]
duration=60
image="units/undead/bat-ne-4.png"
[/frame]
[/animation]
[/unit]

View file

@ -1,6 +1,6 @@
#textdomain wesnoth-units
[unit]
#macro to define most of Walking Corpse
#macro to define most of Walking Corpse
#define UNIT_BODY_SOULLESS BASE_IMAGE MOVETYPE MOVES HP
id=Soulless
name= _ "Soulless"

View file

@ -1,6 +1,6 @@
#textdomain wesnoth-units
[unit]
#macro to define most of Walking Corpse
#macro to define most of Walking Corpse
#define UNIT_BODY_WALKING_CORPSE BASE_IMAGE MOVETYPE MOVES HP
id=Walking Corpse
name= _ "Walking Corpse"

View file

@ -20,97 +20,97 @@
Enslaved within a shroud of enchantments, a trapped spirit may be likened to the wind in the sails of a ship. This damned vessel becomes an unfailing servant which can be bound to whatever task their master sees fit."+{SPECIAL_NOTES}+{SPECIAL_NOTES_DRAIN}+{SPECIAL_NOTES_SPIRIT}+{SPECIAL_NOTES_ARCANE}
die_sound=wail-long.wav
[defend]
direction=s,se,sw
direction=s,se,sw
start_time=-126
[if]
hits=hit,kill
offset=0.0~-0.05:126,-0.05~0.0:126
alpha=0.8~0.5:126,0.5~0.8:126
[frame]
duration=1
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=100
image="units/undead/ghost-s-attack-1.png"
[/frame]
offset=0.0~-0.05:126,-0.05~0.0:126
alpha=0.8~0.5:126,0.5~0.8:126
[frame]
duration=1
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=100
image="units/undead/ghost-s-attack-1.png"
[/frame]
[frame]
duration=150
image="units/undead/ghost-s-attack-1.png"
sound=wail-sml.wav
[/frame]
[frame]
duration=1
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=1
image="units/undead/ghost-s-2.png"
[/frame]
[/if]
[else]
hits=miss
offset=0.0~-0.1:126,-0.1~0.0:126
alpha=0.8~0.25:126,0.25~0.8:126
[frame]
duration=1
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=100
image="units/undead/ghost-s-attack-1.png"
[/frame]
offset=0.0~-0.1:126,-0.1~0.0:126
alpha=0.8~0.25:126,0.25~0.8:126
[frame]
duration=1
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=100
image="units/undead/ghost-s-attack-1.png"
[/frame]
[frame]
duration=150
image="units/undead/ghost-s-attack-1.png"
[/frame]
[frame]
duration=1
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=1
image="units/undead/ghost-s-2.png"
[/frame]
[/else]
[/defend]
[defend]
direction=n,ne,nw
direction=n,ne,nw
start_time=-126
[if]
hits=hit,kill
offset=0.0~-0.05:126,-0.05~0.0:126
alpha=0.8~0.5:126,0.5~0.8:126
[frame]
duration=1
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=100
image="units/undead/ghost-n-attack-1.png"
[/frame]
offset=0.0~-0.05:126,-0.05~0.0:126
alpha=0.8~0.5:126,0.5~0.8:126
[frame]
duration=1
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=100
image="units/undead/ghost-n-attack-1.png"
[/frame]
[frame]
duration=150
image="units/undead/ghost-n-attack-1.png"
sound=wail-sml.wav
[/frame]
[frame]
duration=1
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=1
image="units/undead/ghost-n-2.png"
[/frame]
[/if]
[else]
hits=miss
offset=0.0~-0.1:126,-0.1~0.0:126
alpha=0.8~0.25:126,0.25~0.8:126
[frame]
duration=1
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=100
image="units/undead/ghost-n-attack-1.png"
[/frame]
offset=0.0~-0.1:126,-0.1~0.0:126
alpha=0.8~0.25:126,0.25~0.8:126
[frame]
duration=1
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=100
image="units/undead/ghost-n-attack-1.png"
[/frame]
[frame]
duration=150
image="units/undead/ghost-n-attack-1.png"
[/frame]
[frame]
duration=1
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=1
image="units/undead/ghost-n-2.png"
[/frame]
[/else]
[/defend]
@ -141,53 +141,53 @@ Enslaved within a shroud of enchantments, a trapped spirit may be likened to the
{MISSILE_FRAME_WAIL}
start_time=-200
[if]
direction=s,se,sw
[frame]
duration=25
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=75
image="units/undead/ghost-s-attack-1.png"
[/frame]
[frame]
duration=150
image="units/undead/ghost-s-attack-2.png"
sound=wail-sml.wav
[/frame]
[frame]
duration=75
image="units/undead/ghost-s-attack-1.png"
[/frame]
[frame]
duration=25
image="units/undead/ghost-s-2.png"
[/frame]
[/if]
[else]
direction=n,ne,nw
[frame]
duration=25
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=75
image="units/undead/ghost-n-attack-1.png"
[/frame]
[frame]
duration=150
image="units/undead/ghost-n-attack-2.png"
sound=wail-sml.wav
[/frame]
[frame]
duration=75
image="units/undead/ghost-n-attack-1.png"
[/frame]
[frame]
duration=25
image="units/undead/ghost-n-2.png"
[/frame]
[if]
direction=s,se,sw
[frame]
duration=25
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=75
image="units/undead/ghost-s-attack-1.png"
[/frame]
[frame]
duration=150
image="units/undead/ghost-s-attack-2.png"
sound=wail-sml.wav
[/frame]
[frame]
duration=75
image="units/undead/ghost-s-attack-1.png"
[/frame]
[frame]
duration=25
image="units/undead/ghost-s-2.png"
[/frame]
[/if]
[else]
direction=n,ne,nw
[frame]
duration=25
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=75
image="units/undead/ghost-n-attack-1.png"
[/frame]
[frame]
duration=150
image="units/undead/ghost-n-attack-2.png"
sound=wail-sml.wav
[/frame]
[frame]
duration=75
image="units/undead/ghost-n-attack-1.png"
[/frame]
[frame]
duration=25
image="units/undead/ghost-n-2.png"
[/frame]
[/else]
[/attack_anim]
@ -195,38 +195,38 @@ Enslaved within a shroud of enchantments, a trapped spirit may be likened to the
[attack_filter]
name=touch
[/attack_filter]
start_time=-500
offset=0.0~1.0:425,0.0:225
alpha=0.8~0.0:425,0.0~0.8:225
direction=s,se,sw
start_time=-500
offset=0.0~1.0:425,0.0:225
alpha=0.8~0.0:425,0.0~0.8:225
direction=s,se,sw
[frame]
duration=25
duration=25
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=175
duration=175
image="units/undead/ghost-s-attack-1.png"
[/frame]
[frame]
duration=175
duration=175
image="units/undead/ghost-s-attack-2.png"
[/frame]
[frame]
duration=100
duration=100
image="units/undead/ghost-s-attack-3.png"
sound=wail-sml.wav
[/frame]
[frame]
duration=75
duration=75
image="units/undead/ghost-s-attack-2.png"
[/frame]
[frame]
duration=75
duration=75
image="units/undead/ghost-s-attack-1.png"
[/frame]
[frame]
duration=25
duration=25
image="units/undead/ghost-s-2.png"
[/frame]
[/attack_anim]
@ -234,253 +234,178 @@ Enslaved within a shroud of enchantments, a trapped spirit may be likened to the
[attack_filter]
name=touch
[/attack_filter]
start_time=-500
offset=0.0~1.0:425,0.0:225
alpha=0.8~0.0:425,0.0~0.8:225
direction=n,ne,nw
start_time=-500
offset=0.0~1.0:425,0.0:225
alpha=0.8~0.0:425,0.0~0.8:225
direction=n,ne,nw
[frame]
duration=25
duration=25
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=175
duration=175
image="units/undead/ghost-n-attack-1.png"
[/frame]
[frame]
duration=175
duration=175
image="units/undead/ghost-n-attack-2.png"
[/frame]
[frame]
duration=100
duration=100
image="units/undead/ghost-n-attack-3.png"
sound=wail-sml.wav
[/frame]
[frame]
duration=75
duration=75
image="units/undead/ghost-n-attack-2.png"
[/frame]
[frame]
duration=75
duration=75
image="units/undead/ghost-n-attack-1.png"
[/frame]
[frame]
duration=25
duration=25
image="units/undead/ghost-n-2.png"
[/frame]
[/attack_anim]
[movement_anim]
direction=s,se,sw
start_time=0
alpha=0.8~0.4:1400,0.4~0.6:600,0.6~0.4:600,0.4~0.8:1400
[frame]
duration=250
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=250
image="units/undead/ghost-s-1.png"
[/frame]
[frame]
duration=250
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=250
image="units/undead/ghost-s-3.png"
[/frame]
[frame]
duration=250
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=250
image="units/undead/ghost-s-1.png"
[/frame]
[frame]
duration=250
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=250
image="units/undead/ghost-s-3.png"
[/frame]
[/movement_anim]
[movement_anim]
direction=n,ne,nw
start_time=0
alpha=0.8~0.4:1400,0.4~0.6:600,0.6~0.4:600,0.4~0.8:1400
[frame]
duration=250
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=250
image="units/undead/ghost-n-1.png"
[/frame]
[frame]
duration=250
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=250
image="units/undead/ghost-n-3.png"
[/frame]
[frame]
duration=250
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=250
image="units/undead/ghost-n-1.png"
[/frame]
[frame]
duration=250
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=250
image="units/undead/ghost-n-3.png"
[/frame]
[/movement_anim]
[standing_anim]
direction=s,se,sw
direction=s,se,sw
start_time=0
alpha=0.8~0.4:1400,0.4~0.6:600,0.6~0.4:600,0.4~0.8:1400
[frame]
duration=250
duration=250
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-1.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-3.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-1.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-3.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-1.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-3.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-1.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-s-3.png"
[/frame]
[/standing_anim]
[standing_anim]
direction=n,ne,nw
direction=n,ne,nw
start_time=0
alpha=0.8~0.4:1400,0.4~0.6:600,0.6~0.4:600,0.4~0.8:1400
[frame]
duration=250
duration=250
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-1.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-3.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-1.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-3.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-1.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-3.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-1.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-2.png"
[/frame]
[frame]
duration=250
duration=250
image="units/undead/ghost-n-3.png"
[/frame]
[/standing_anim]

View file

@ -57,6 +57,7 @@ public:
int get_begin_time() const;
int get_end_time() const;
void set_begin_time(int new_begin_time);
int time_to_tick(int animation_time) const;
int tick_to_time(int animation_tick) const;

View file

@ -323,3 +323,13 @@ typename std::vector<frame>::iterator current_frame = frames_.begin();
}
template<typename T, typename T_void_value>
void animated<T,T_void_value>::set_begin_time(int new_begin_time)
{
const int variation = new_begin_time - starting_frame_time_;
starting_frame_time_ += variation;
for(typename std::vector<frame>::iterator itor = frames_.begin(); itor != frames_.end() ; itor++) {
itor->start_time_ += variation;
}
}

View file

@ -287,25 +287,99 @@ int unit_animation::matches(const game_display &disp,const gamemap::location& lo
void unit_animation::fill_initial_animations( std::vector<unit_animation> & animations, const config & cfg)
{
const image::locator default_image = image::locator(cfg["image"]);
animations.push_back(unit_animation(0,unit_frame(default_image,300),"",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(0,unit_frame(default_image,300,"","",display::rgb(255,255,255),"0.0~0.3:100,0.3~0.0:200"),"selected",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(0,unit_frame(default_image,150),"leading",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(0,unit_frame(default_image,600,"0~1:600"),"recruited",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(0,unit_frame(default_image,0),"standing",unit_animation::DEFAULT_ANIM));
// Idle anims can be empty
animations.push_back(unit_animation(0,unit_frame(default_image,600,"1.0","",display::rgb(255,255,255),"1~0:600"),"levelin",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(0,unit_frame(default_image,600,"1.0","",display::rgb(255,255,255),"0~1:600"),"levelout",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(0,unit_frame(default_image,500),"healing",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(0,unit_frame(default_image,240,"1.0","",display::rgb(255,255,255),"0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30","","","","","heal.wav"),"healed",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(0,unit_frame(default_image,240,"1.0","",display::rgb(0,255,0),"0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30","","","","","poison.ogg"),"poisoned",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(0,unit_frame(default_image,150,"","0~1:150"),"movement",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(-150,unit_frame(default_image,300),"defend",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(-150,unit_frame(default_image,300),"attack",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(0,unit_frame(default_image,600,"1~0:600"),"death",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(0,unit_frame(default_image,1),"victory",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(-150,unit_frame(default_image,150,"1~0"),"pre_teleport",unit_animation::DEFAULT_ANIM));
animations.push_back(unit_animation(0,unit_frame(default_image,150,"0~1"),"post_teleport",unit_animation::DEFAULT_ANIM));
add_anims(animations,cfg);
std::vector<unit_animation> animation_base;
std::vector<unit_animation>::const_iterator itor;
add_anims(animations,cfg);
for(itor = animations.begin(); itor != animations.end() ; itor++) {
if (std::find(itor->event_.begin(),itor->event_.end(),"_default_")!= itor->event_.end()) {
animation_base.push_back(*itor);
animation_base.back().base_score_ = unit_animation::DEFAULT_ANIM;
animation_base.back().event_.clear();
}
}
if(animation_base.empty()) {
#warning "restore correct default anim"
animation_base.push_back(unit_animation(0,unit_frame(default_image,1),"",unit_animation::DEFAULT_ANIM));
}
for(itor = animation_base.begin() ; itor != animation_base.end() ; itor++ ) {
unit_animation tmp_anim = *itor;
// provide all default anims
animations.push_back(*itor);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(0,"","0.0~0.3:100,0.3~0.0:200",display::rgb(255,255,255));
tmp_anim.event_ = utils::split("selected");
animations.push_back(tmp_anim);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(0,"","0~1:600");
tmp_anim.event_ = utils::split("recruited");
animations.push_back(tmp_anim);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(0,"","1~0:600",display::rgb(255,255,255));
tmp_anim.event_ = utils::split("levelin");
animations.push_back(tmp_anim);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(0,"","0~1:600",display::rgb(255,255,255));
tmp_anim.event_ = utils::split("levelout");
animations.push_back(tmp_anim);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(0,"","",0,"0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,");
tmp_anim.event_ = utils::split("movement");
animations.push_back(tmp_anim);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(0,"","",0,"0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,");
tmp_anim.event_ = utils::split("movement");
animations.push_back(tmp_anim);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(-150);
tmp_anim.event_ = utils::split("defend");
animations.push_back(tmp_anim);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(-150);
tmp_anim.event_ = utils::split("attack");
animations.push_back(tmp_anim);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(0,"","1~0:600");
tmp_anim.event_ = utils::split("death");
animations.push_back(tmp_anim);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(0,"","1~0:150");
tmp_anim.event_ = utils::split("pre_teleport");
animations.push_back(tmp_anim);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(0,"","0~1:150");
tmp_anim.event_ = utils::split("post_teleport");
animations.push_back(tmp_anim);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(0,"","0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30",display::rgb(255,255,255));
tmp_anim.event_ = utils::split("healed");
animations.push_back(tmp_anim);
animations.back().sub_anims_["_healed_sound"] = crude_animation();
animations.back().sub_anims_["_healed_sound"].add_frame(1,unit_frame());
animations.back().sub_anims_["_healed_sound"].add_frame(1,unit_frame(image::locator(),1,"","",0,"","","","","","heal.wav"),true);
tmp_anim = *itor;
tmp_anim.unit_anim_.override(0,"","0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30",display::rgb(0,255,0));
tmp_anim.event_ = utils::split("poisoned");
animations.push_back(tmp_anim);
animations.back().sub_anims_["_poison_sound"] = crude_animation();
animations.back().sub_anims_["_poison_sound"].add_frame(1,unit_frame());
animations.back().sub_anims_["_poison_sound"].add_frame(1,unit_frame(image::locator(),1,"","",0,"","","","","","poison.ogg"),true);
}
}
void unit_animation::add_anims( std::vector<unit_animation> & animations, const config & cfg)
{
@ -334,7 +408,7 @@ void unit_animation::add_anims( std::vector<unit_animation> & animations, const
expanded_cfg = unit_animation::prepare_animation(cfg,"standing_anim");
const config::child_list& standing_anims = expanded_cfg.get_children("standing_anim");
for(anim_itor = standing_anims.begin(); anim_itor != standing_anims.end(); ++anim_itor) {
(**anim_itor)["apply_to"] ="standing";
(**anim_itor)["apply_to"] ="standing,_default_";
animations.push_back(unit_animation(**anim_itor));
}
expanded_cfg = unit_animation::prepare_animation(cfg,"idle_anim");
@ -473,6 +547,18 @@ void unit_animation::add_anims( std::vector<unit_animation> & animations, const
}
void unit_animation::crude_animation::override( int start_time,const std::string highlight,const std::string blend_ratio ,Uint32 blend_color ,const std::string offset)
{
set_begin_time(start_time);
if(!highlight.empty()) highlight_ratio_ = progressive_double(highlight,get_animation_duration());
if(!offset.empty()) offset_ = progressive_double(offset,get_animation_duration());
if(!blend_ratio.empty()) {
blend_ratio_ = progressive_double(blend_ratio,get_animation_duration());
blend_with_ = blend_color;
}
}
const std::string &unit_animation::crude_animation::halo(const std::string&default_val ) const
{
return get_current_frame().halo(get_current_frame_time(),halo_.get_current_element(get_animation_time() - get_begin_time(),default_val));

View file

@ -93,6 +93,7 @@ class unit_animation
explicit crude_animation(const config& cfg,const std::string frame_string ="frame");
virtual ~crude_animation();
bool need_update() const;
void override(int start_time,const std::string highlight="", const std::string blend_ratio ="",Uint32 blend_color = 0,const std::string offset="");
const std::string &halo(const std::string&default_val ="") const;
int halo_x(const int default_val = 0) const;
int halo_y(const int default_val = 0) const;