Units - Dunefolk - Falconer branch of Skirmisher line (#4779)
* Units - Dunefolk - first draft at Falconer branch of skirmisher * Dunefolk - revision to Falconer line * Units - dunefolk - some progress on falconer standing animation * Units - dunefolk - attack animations for falconer * Units - dunefolk - defense and melee (partial) attack anims * units - dunefolk - WIP lvl3 falconer * units - dunefolk - revise falconer * units - dunefolk - animation work on Falconer line * units - dunefolk - falconer ability diversion revised to affect enemy chance-to-hit. Animation filter/trigger not yet resolved * units/abilities - dunefolk falconer diversion ability-related animations mechanism * units - dunefolk - sky_hunter animation frames * dunefolk/abilities - fix diversion animations to work on die event * abilities - schema validation induced correction * abilities - diversion animations - attempt to fix case of undo movement * units - dunefolk - finish some cosmetic issues for Falconer line * units - dunefolk - wmlindent * use on_undo over select in diversionability undoing can only change the 'diversion' state if the original action also did, so there is no reason to check it in all 'select' events. * fixup * minor clean-up Co-authored-by: gfgtdf <daniel.gfgtdf@gmail.com>
|
@ -7,6 +7,7 @@
|
|||
code=<<
|
||||
wesnoth.dofile 'lua/wml-tags.lua'
|
||||
wesnoth.dofile 'lua/feeding.lua'
|
||||
wesnoth.dofile 'lua/diversion.lua'
|
||||
wesnoth.dofile 'lua/backwards-compatibility.lua'
|
||||
>>
|
||||
[/lua]
|
||||
|
|
BIN
data/core/images/units/dunefolk/skirmisher/eagle-e.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/eagle-hover.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/eagle-hover1.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/eagle-hover2.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/eagle-hover3.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/eagle-n.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/eagle-rise.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falcon-dive.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falcon-e.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falcon-hover.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falcon-hover1.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falcon-hover2.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falcon-hover3.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falcon-n.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falcon-rise.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 5.2 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falconer-alone.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 5.5 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falconer-launch1.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falconer-launch2.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falconer-launch3.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falconer-launch4.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falconer-launch5.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falconer-move1.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/falconer.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 5.3 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/sky_hunter-alone.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 7 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 6 KiB |
After Width: | Height: | Size: 5.8 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/sky_hunter-move1.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
data/core/images/units/dunefolk/skirmisher/sky_hunter.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
|
@ -109,6 +109,59 @@ This ability will not cure an affected unit of poison, however, only delay its e
|
|||
[/resistance]
|
||||
#enddef
|
||||
|
||||
#define ABILITY_DIVERSION
|
||||
# Canned definition of the Distraction ability to be included in an [abilities]
|
||||
# clause.
|
||||
[chance_to_hit] # this is a weapon special, but as of 1.15.0, it is possible to use it this way in [abilities]
|
||||
id=diversion
|
||||
sub=15
|
||||
name= _ "diversion"
|
||||
female_name= _ "female^diversion"
|
||||
description= _ "The opposing unit is distracted with too many points of focus, and is much more likely to miss by 15%"
|
||||
description_inactive= _ "This is inactive for now."
|
||||
affect_self=no
|
||||
affect_allies=no
|
||||
affect_enemies=yes
|
||||
cumulative=yes
|
||||
[filter]
|
||||
[filter_adjacent]
|
||||
is_enemy=yes
|
||||
[/filter_adjacent]
|
||||
[/filter]
|
||||
# three of these tags, for (hex faces)/2, as we try for similar conditions to backstab
|
||||
[affect_adjacent]
|
||||
adjacent=n,s
|
||||
[filter]
|
||||
[filter_adjacent]
|
||||
is_enemy=yes
|
||||
count=2-6
|
||||
adjacent=n,s
|
||||
[/filter_adjacent]
|
||||
[/filter]
|
||||
[/affect_adjacent]
|
||||
[affect_adjacent]
|
||||
adjacent=se,nw
|
||||
[filter]
|
||||
[filter_adjacent]
|
||||
is_enemy=yes
|
||||
count=2-6
|
||||
adjacent=se,nw
|
||||
[/filter_adjacent]
|
||||
[/filter]
|
||||
[/affect_adjacent]
|
||||
[affect_adjacent]
|
||||
adjacent=ne,sw
|
||||
[filter]
|
||||
[filter_adjacent]
|
||||
is_enemy=yes
|
||||
count=2-6
|
||||
adjacent=ne,sw
|
||||
[/filter_adjacent]
|
||||
[/filter]
|
||||
[/affect_adjacent]
|
||||
[/chance_to_hit]
|
||||
#enddef
|
||||
|
||||
#define ABILITY_LEADERSHIP
|
||||
# Canned definition of the Leadership ability to be included in an
|
||||
# [abilities] clause.
|
||||
|
|
|
@ -295,6 +295,12 @@ _"This unit has a defense cap on certain terrain types — it cannot achieve a h
|
|||
[/special_note]
|
||||
#enddef
|
||||
|
||||
#define NOTE_DIVERSION
|
||||
[special_note]
|
||||
note=_"If there is an enemy of the target on the opposite side of the target while attacking it, this unit diverts the target's attention and reduces its chance to hit."
|
||||
[/special_note]
|
||||
#enddef
|
||||
|
||||
# Deprecated versions here
|
||||
|
||||
#define SPECIAL_NOTES_SPIRIT
|
||||
|
|
256
data/core/units/dunefolk/Falconer.cfg
Normal file
|
@ -0,0 +1,256 @@
|
|||
#textdomain wesnoth-units
|
||||
|
||||
#define PATH_TEMP
|
||||
units/dunefolk/skirmisher/#enddef
|
||||
|
||||
#define DIVERSION_ANIM_FILTER
|
||||
[filter]
|
||||
status=diversion
|
||||
# ability_type_active=resistance # this does not work, in this case. Only works if ability affects_self=yes
|
||||
[/filter]#enddef
|
||||
|
||||
[unit_type]
|
||||
id=Dune Falconer
|
||||
name= _ "female^Dune Falconer"
|
||||
race=dunefolk
|
||||
gender=female
|
||||
image="{PATH_TEMP}falconer.png"
|
||||
hitpoints=36
|
||||
movement_type=duneelusivefoot
|
||||
movement=6
|
||||
vision=8
|
||||
# This makes sense "physically", but might need adjustment for gameplay
|
||||
[vision_costs]
|
||||
cave=3
|
||||
shallow_water=1
|
||||
reef=1
|
||||
swamp_water=1
|
||||
sand=1
|
||||
deep_water=1
|
||||
[/vision_costs]
|
||||
experience=78
|
||||
level=2
|
||||
alignment=lawful
|
||||
advances_to=Dune Sky Hunter
|
||||
cost=23
|
||||
usage=mixed fighter
|
||||
description= _ "The power of any Dunefolk assault is inhibited by one major drawback: organized Dunefolk forces tend to be rather slow. Because of this, enemy forces often have the ability to regroup and call upon reinforcements, in which case a second assault becomes much more difficult. Dune Falconers, an advanced corps pulled the skirmisher auxiliaries, have trained young falcons to fly directly back to them if the bird sees any humanoid or larger creature. From the direction and flight time, the Falconer can estimate the direction and distance of any remote presence. While this intelligence has limitations, it can be quite valuable in many contexts.
|
||||
|
||||
The falcon also plays a role in combat, as the falconer can either direct it directly at a foe, or it can be sent higher into the air, to circle overhead and strike when the foe has shifted attention. Needless to say, this can be very distracting to any opponent."
|
||||
{NOTE_SKIRMISHER}
|
||||
{NOTE_DIVERSION}
|
||||
die_sound={SOUND_LIST:HUMAN_FEMALE_DIE}
|
||||
{DEFENSE_ANIM_FILTERED "{PATH_TEMP}falconer-falcon-defend2.png" "{PATH_TEMP}falconer-falcon-defend1.png" {SOUND_LIST:HUMAN_FEMALE_HIT} (
|
||||
)}
|
||||
[defend]
|
||||
start_time=-126
|
||||
falcon_start_time=-126
|
||||
{DIVERSION_ANIM_FILTER}
|
||||
[frame]
|
||||
image="{PATH_TEMP}falconer-alone-defend1.png:1,{PATH_TEMP}falconer-alone-defend2.png:250,{PATH_TEMP}falconer-alone-defend1.png:1"
|
||||
[/frame]
|
||||
[falcon_frame]
|
||||
image="{PATH_TEMP}falcon-hover[1,2,3,2,1].png:[1,80,90,80,1]"
|
||||
y=-38~-48:126,-48~-38:126
|
||||
offset=0~-0.3:126,-0.3~0:126
|
||||
auto_vflip=no
|
||||
[/falcon_frame]
|
||||
[if]
|
||||
hit_sound_start_time=-25
|
||||
hits=hit
|
||||
[hit_sound_frame]
|
||||
sound={SOUND_LIST:HUMAN_FEMALE_HIT}
|
||||
[/hit_sound_frame]
|
||||
[/if]
|
||||
[/defend]
|
||||
[abilities]
|
||||
{ABILITY_SKIRMISHER}
|
||||
{ABILITY_DIVERSION}
|
||||
[/abilities]
|
||||
[animation]
|
||||
apply_to=launching
|
||||
start_time=0
|
||||
falcon_start_time=0
|
||||
[frame]
|
||||
image="{PATH_TEMP}falconer-launch[1~5].png:[200,170,120,80,80]"
|
||||
[/frame]
|
||||
[falcon_frame]
|
||||
image="misc/blank-hex.png:490,{PATH_TEMP}falcon-rise.png:160"
|
||||
auto_vflip=no
|
||||
y=-45:490,-45~-40:160
|
||||
[/falcon_frame]
|
||||
[/animation]
|
||||
[animation] # for now just the reverse of launching
|
||||
apply_to=landing
|
||||
start_time=0
|
||||
falcon_start_time=0
|
||||
[frame]
|
||||
image="{PATH_TEMP}falconer-launch[5~1].png:[80,80,120,170,200]"
|
||||
[/frame]
|
||||
[falcon_frame]
|
||||
image="{PATH_TEMP}falcon-rise.png:160,misc/blank-hex.png:490"
|
||||
auto_vflip=no
|
||||
y=-45~-40:160,-45:490
|
||||
[/falcon_frame]
|
||||
[/animation]
|
||||
[standing_anim]
|
||||
start_time=0
|
||||
falcon_start_time=0
|
||||
[if]
|
||||
{DIVERSION_ANIM_FILTER}
|
||||
[frame]
|
||||
image="{PATH_TEMP}falconer-alone.png:1200"
|
||||
[/frame]
|
||||
[falcon_frame]
|
||||
image="{PATH_TEMP}falcon-hover[1,2,3,2].png:300"
|
||||
x=-0~5:300,5~-5:600,-5~0:300
|
||||
y=-40~-45:600,-45~-40:600
|
||||
auto_vflip=no
|
||||
[/falcon_frame]
|
||||
[/if]
|
||||
[else]
|
||||
[frame]
|
||||
image="{PATH_TEMP}falconer.png:200"
|
||||
[/frame]
|
||||
[/else]
|
||||
[/standing_anim]
|
||||
[movement_anim]
|
||||
start_time=0
|
||||
falcon_start_time=0
|
||||
[if]
|
||||
{DIVERSION_ANIM_FILTER}
|
||||
[frame]
|
||||
image="{PATH_TEMP}falconer-alone.png:200"
|
||||
[/frame]
|
||||
[falcon_frame]
|
||||
image="{PATH_TEMP}falcon-hover[1,2,3,2].png:[50,50,50,50]"
|
||||
y=-40~-46:100,-46~-40:100
|
||||
auto_vflip=no
|
||||
offset="0~1:200,0~1:200,0~1:200,0~1:200,0~1:200,0~1:200,0~1:200,0~1:200,0~1:200,0~1:200"
|
||||
[/falcon_frame]
|
||||
[/if]
|
||||
[else]
|
||||
[frame]
|
||||
image="{PATH_TEMP}falconer-move1.png:200"
|
||||
[/frame]
|
||||
[/else]
|
||||
[/movement_anim]
|
||||
|
||||
[attack]
|
||||
name=sword
|
||||
description= _ "short sword"
|
||||
type=blade
|
||||
range=melee
|
||||
damage=5
|
||||
number=4
|
||||
icon=attacks/sword-human-short.png
|
||||
[/attack]
|
||||
# Maybe the bird should have some "marksman" ability, since it actively corrects its flight.
|
||||
# But we also have to account for the defender not being able to hurt the bird.
|
||||
# So, we can say that the bird only strikes if it is safe, and a defender on favorable terrain can scare the bird off more often
|
||||
[attack]
|
||||
name=falcon
|
||||
description= _ "falcon"
|
||||
type=blade
|
||||
range=ranged
|
||||
damage=10
|
||||
number=2
|
||||
icon=attacks/claws.png
|
||||
[/attack]
|
||||
|
||||
[attack_anim]
|
||||
[filter_attack]
|
||||
name=sword
|
||||
[/filter_attack]
|
||||
start_time=-250
|
||||
falcon_start_time=-250
|
||||
[if]
|
||||
{DIVERSION_ANIM_FILTER}
|
||||
[frame]
|
||||
image="{PATH_TEMP}falconer-alone.png:300"
|
||||
[/frame]
|
||||
[falcon_frame]
|
||||
image="{PATH_TEMP}falcon-hover.png:300"
|
||||
auto_vflip=no
|
||||
y=-45~-40:300
|
||||
[/falcon_frame]
|
||||
[/if]
|
||||
[else]
|
||||
[frame]
|
||||
image="{PATH_TEMP}falconer.png:300"
|
||||
[/frame]
|
||||
[/else]
|
||||
{SOUND:HIT_AND_MISS {SOUND_LIST:SWORD_SWISH} {SOUND_LIST:MISS} -100}
|
||||
[/attack_anim]
|
||||
[attack_anim]
|
||||
[filter_attack]
|
||||
name=falcon
|
||||
[/filter_attack]
|
||||
start_time=-150
|
||||
missile_start_time=-150
|
||||
direction=nw,n,ne
|
||||
[if]
|
||||
hits=yes
|
||||
[missile_frame]
|
||||
image="{PATH_TEMP}falcon-n.png:300,{PATH_TEMP}falcon-n.png~FL(vert):400"
|
||||
image_diagonal="{PATH_TEMP}falcon-e.png:300,{PATH_TEMP}falcon-e.png~FL(horiz):400"
|
||||
y=-43~0:150,0~-43:150,-43:400
|
||||
offset=0~0.8:150,0.8~1.6:150,1.6~0:400
|
||||
[/missile_frame]
|
||||
[frame]
|
||||
image="{PATH_TEMP}falconer-alone.png:700"
|
||||
sound=gryphon-shriek-1.ogg
|
||||
[/frame]
|
||||
[/if]
|
||||
[else]
|
||||
hits=no
|
||||
[missile_frame]
|
||||
image="{PATH_TEMP}falcon-n.png:300,{PATH_TEMP}falcon-n.png~FL(vert):400"
|
||||
image_diagonal="{PATH_TEMP}falcon-e.png:300,{PATH_TEMP}falcon-e.png~FL(horiz):400"
|
||||
y=-43~-56:150,-56:150,-56~-43:400
|
||||
offset=0~0.8:150,0.8~1.6:150,1.6~0:400
|
||||
[/missile_frame]
|
||||
[frame]
|
||||
image="{PATH_TEMP}falconer-alone.png:700"
|
||||
sound=bat-flapping.wav
|
||||
[/frame]
|
||||
[/else]
|
||||
[/attack_anim]
|
||||
[attack_anim]
|
||||
[filter_attack]
|
||||
name=falcon
|
||||
[/filter_attack]
|
||||
start_time=-150
|
||||
missile_start_time=-150
|
||||
direction=sw,s,se
|
||||
[if]
|
||||
hits=yes
|
||||
[missile_frame]
|
||||
image="{PATH_TEMP}falcon-n.png~FL(vert):300,{PATH_TEMP}falcon-n.png:400"
|
||||
image_diagonal="{PATH_TEMP}falcon-e.png:300,{PATH_TEMP}falcon-e.png~FL(horiz):400"
|
||||
y=-43~0:150,0~-43:150,-43:400
|
||||
offset=0~0.8:150,0.8~1.6:150,1.6~0:400
|
||||
[/missile_frame]
|
||||
[frame]
|
||||
image="{PATH_TEMP}falconer-alone.png:700"
|
||||
sound=gryphon-shriek-1.ogg
|
||||
[/frame]
|
||||
[/if]
|
||||
[else]
|
||||
hits=no
|
||||
[missile_frame]
|
||||
image="{PATH_TEMP}falcon-n.png~FL(vert):300,{PATH_TEMP}falcon-n.png:400"
|
||||
image_diagonal="{PATH_TEMP}falcon-e.png:300,{PATH_TEMP}falcon-e.png~FL(horiz):400"
|
||||
y=-43~-56:150,-56:150,-56~-43:400
|
||||
offset=0~0.8:150,0.8~1.6:150,1.6~0:400
|
||||
[/missile_frame]
|
||||
[frame]
|
||||
image="{PATH_TEMP}falconer-alone.png:700"
|
||||
sound=bat-flapping.wav
|
||||
[/frame]
|
||||
[/else]
|
||||
[/attack_anim]
|
||||
[/unit_type]
|
||||
|
||||
#undef PATH_TEMP
|
||||
#undef DIVERSION_ANIM_FILTER
|
|
@ -144,7 +144,7 @@ units/dunefolk/burner/#enddef
|
|||
[/else]
|
||||
[/attack_anim]
|
||||
|
||||
# the '+female' sprite images may not be needed, really.
|
||||
# the '+female' sprite images may not be needed, really.
|
||||
[female]
|
||||
name= _ "female^Dune Firetrooper"
|
||||
gender=female
|
||||
|
|
|
@ -6,7 +6,6 @@ units/dunefolk/rider/#enddef
|
|||
#define TORCH_STATIC_IMAGE
|
||||
{PATH_TEMP}raider-torch-overlay.png~BLIT({PATH_TEMP}raider.png,0,0)#enddef
|
||||
|
||||
|
||||
[unit_type]
|
||||
id=Dune Raider
|
||||
name= _ "Dune Raider"
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#define PATH_TEMP
|
||||
units/dunefolk/skirmisher/#enddef
|
||||
|
||||
|
||||
[unit_type]
|
||||
id=Dune Skirmisher
|
||||
name= _ "female^Dune Skirmisher"
|
||||
|
@ -16,7 +15,7 @@ units/dunefolk/skirmisher/#enddef
|
|||
experience=34
|
||||
level=1
|
||||
alignment=lawful
|
||||
advances_to=Dune Strider
|
||||
advances_to=Dune Strider, Dune Falconer
|
||||
cost=16
|
||||
usage=fighter
|
||||
description= _ "Born and raised out on the open sands, skirmishers are accustomed to the harsh, arid desert heat and inhospitable terrain. Compared to even other Dunefolk, these nomads are unnaturally agile on the unstable dunes, allowing them to safeguard their herds and hunt the barrens with ease. When applied to battle, the same agility allows them to both slip through enemy lines and avoid all manner of attack. These skills make skirmishers effective saboteurs, capable of cutting off escape routes and supply lines, assassinating key units, or pincering an enemy formation into a disadvantageous position."
|
||||
|
|
259
data/core/units/dunefolk/Sky_Hunter.cfg
Normal file
|
@ -0,0 +1,259 @@
|
|||
#textdomain wesnoth-units
|
||||
|
||||
#define PATH_TEMP
|
||||
units/dunefolk/skirmisher/#enddef
|
||||
|
||||
#define DIVERSION_ANIM_FILTER
|
||||
[filter]
|
||||
status=diversion
|
||||
[/filter]#enddef
|
||||
|
||||
[unit_type]
|
||||
id=Dune Sky Hunter
|
||||
name= _ "female^Dune Sky Hunter"
|
||||
race=dunefolk
|
||||
gender=female
|
||||
image="{PATH_TEMP}sky_hunter.png"
|
||||
hitpoints=52
|
||||
movement_type=duneelusivefoot
|
||||
movement=6
|
||||
vision=10
|
||||
# This makes sense "physically", but might need adjustment for gameplay
|
||||
[vision_costs]
|
||||
cave=3
|
||||
shallow_water=1
|
||||
reef=1
|
||||
swamp_water=1
|
||||
sand=1
|
||||
deep_water=1
|
||||
[/vision_costs]
|
||||
experience=150
|
||||
level=3
|
||||
alignment=lawful
|
||||
advances_to=null
|
||||
{AMLA_DEFAULT}
|
||||
cost=45
|
||||
usage=mixed fighter
|
||||
description= _ "Handling birds of prey for use in a military role is something that takes great skill and training on the part of the handler, if not the bird. Dune Sky Hunters are the elite of the Falconers, and have moved beyong the smaller, more common falcon, and now work with a type of large eagle usually called a desert eagle, but often mistaken for a young Roc. In the wild, the eagles often feed on larger prey such as wolves, small horses, and, it is said, naughty young children.
|
||||
|
||||
Being larger and faster, the eagle can deliver a more powerful strike than the falcon can."
|
||||
{NOTE_SKIRMISHER}
|
||||
{NOTE_DIVERSION}
|
||||
die_sound={SOUND_LIST:HUMAN_FEMALE_DIE}
|
||||
{DEFENSE_ANIM_FILTERED "{PATH_TEMP}sky_hunter-eagle-defend2.png" "{PATH_TEMP}sky_hunter-eagle-defend1.png" {SOUND_LIST:HUMAN_FEMALE_HIT} (
|
||||
)}
|
||||
[defend]
|
||||
start_time=-126
|
||||
falcon_start_time=-126
|
||||
{DIVERSION_ANIM_FILTER}
|
||||
[frame]
|
||||
image="{PATH_TEMP}sky_hunter-alone-defend1.png:1,{PATH_TEMP}sky_hunter-alone-defend2.png:250,{PATH_TEMP}sky_hunter-alone-defend1.png:1"
|
||||
[/frame]
|
||||
[falcon_frame]
|
||||
image="{PATH_TEMP}eagle-hover[1,2,3,2,1].png:[1,80,90,80,1]"
|
||||
y=-38~-48:126,-48~-38:126
|
||||
offset=0~-0.3:126,-0.3~0:126
|
||||
auto_vflip=no
|
||||
[/falcon_frame]
|
||||
[if]
|
||||
hit_sound_start_time=-25
|
||||
hits=hit
|
||||
[hit_sound_frame]
|
||||
sound={SOUND_LIST:HUMAN_FEMALE_HIT}
|
||||
[/hit_sound_frame]
|
||||
[/if]
|
||||
[/defend]
|
||||
[abilities]
|
||||
{ABILITY_SKIRMISHER}
|
||||
{ABILITY_DIVERSION}
|
||||
[/abilities]
|
||||
[animation]
|
||||
apply_to=launching
|
||||
start_time=0
|
||||
falcon_start_time=0
|
||||
[frame]
|
||||
image="{PATH_TEMP}sky_hunter-launch[1~5].png:[200,170,120,80,80]"
|
||||
[/frame]
|
||||
[falcon_frame]
|
||||
image="misc/blank-hex.png:490,{PATH_TEMP}eagle-rise.png:160"
|
||||
auto_vflip=no
|
||||
y=-40:490,-40~-45:160
|
||||
[/falcon_frame]
|
||||
[/animation]
|
||||
[animation] # for now just the reverse of launching
|
||||
apply_to=landing
|
||||
start_time=0
|
||||
falcon_start_time=0
|
||||
[frame]
|
||||
image="{PATH_TEMP}sky_hunter-launch[5~1].png:[80,80,120,170,200]"
|
||||
[/frame]
|
||||
[falcon_frame]
|
||||
image="{PATH_TEMP}eagle-rise.png:160,misc/blank-hex.png:490"
|
||||
auto_vflip=no
|
||||
y=-45~-40:160,-40:490
|
||||
[/falcon_frame]
|
||||
[/animation]
|
||||
[standing_anim]
|
||||
start_time=0
|
||||
falcon_start_time=0
|
||||
[if]
|
||||
{DIVERSION_ANIM_FILTER}
|
||||
[frame]
|
||||
image="{PATH_TEMP}sky_hunter-alone.png:1200"
|
||||
[/frame]
|
||||
[falcon_frame]
|
||||
image="{PATH_TEMP}eagle-hover[1,2,3,2].png:300"
|
||||
x=-0~5:300,5~-5:600,-5~0:300
|
||||
y=-40~-45:600,-45~-40:600
|
||||
auto_vflip=no
|
||||
[/falcon_frame]
|
||||
[/if]
|
||||
[else]
|
||||
[frame]
|
||||
image="{PATH_TEMP}sky_hunter.png:200"
|
||||
[/frame]
|
||||
[/else]
|
||||
[/standing_anim]
|
||||
[movement_anim]
|
||||
start_time=0
|
||||
falcon_start_time=0
|
||||
[if]
|
||||
{DIVERSION_ANIM_FILTER}
|
||||
[frame]
|
||||
image="{PATH_TEMP}sky_hunter-alone.png:200"
|
||||
[/frame]
|
||||
[falcon_frame]
|
||||
image="{PATH_TEMP}eagle-hover[1,2,3,2].png:[50,50,50,50]"
|
||||
y=-40~-46:100,-46~-40:100
|
||||
auto_vflip=no
|
||||
offset="0~1:200,0~1:200,0~1:200,0~1:200,0~1:200,0~1:200,0~1:200,0~1:200,0~1:200,0~1:200"
|
||||
[/falcon_frame]
|
||||
[/if]
|
||||
[else]
|
||||
[frame]
|
||||
image="{PATH_TEMP}sky_hunter-move1.png:200"
|
||||
[/frame]
|
||||
[/else]
|
||||
[/movement_anim]
|
||||
|
||||
[attack]
|
||||
name=sword
|
||||
description= _ "short sword"
|
||||
type=blade
|
||||
range=melee
|
||||
damage=6
|
||||
number=4
|
||||
icon=attacks/sword-human-short.png
|
||||
[/attack]
|
||||
# Maybe the bird should have some "marksman" ability, since it actively corrects its flight.
|
||||
# But we also have to account for the defender not being able to hurt the bird.
|
||||
# So, we can say that the bird only strikes if it is safe, and a defender on favorable terrain can scare the bird off more often
|
||||
[attack]
|
||||
name=falcon
|
||||
description= _ "eagle"
|
||||
type=blade
|
||||
range=ranged
|
||||
damage=17
|
||||
number=2
|
||||
icon=attacks/claws.png
|
||||
[/attack]
|
||||
|
||||
[attack_anim]
|
||||
[filter_attack]
|
||||
name=sword
|
||||
[/filter_attack]
|
||||
start_time=-250
|
||||
falcon_start_time=-250
|
||||
[if]
|
||||
{DIVERSION_ANIM_FILTER}
|
||||
[frame]
|
||||
image="{PATH_TEMP}sky_hunter-alone.png:300"
|
||||
[/frame]
|
||||
[falcon_frame]
|
||||
image="{PATH_TEMP}eagle-hover.png:300"
|
||||
auto_vflip=no
|
||||
y=-45~-40:300
|
||||
[/falcon_frame]
|
||||
[/if]
|
||||
[else]
|
||||
[frame]
|
||||
image="{PATH_TEMP}sky_hunter.png:300"
|
||||
[/frame]
|
||||
[/else]
|
||||
{SOUND:HIT_AND_MISS {SOUND_LIST:SWORD_SWISH} {SOUND_LIST:MISS} -100}
|
||||
[/attack_anim]
|
||||
[attack_anim]
|
||||
[filter_attack]
|
||||
name=falcon
|
||||
[/filter_attack]
|
||||
start_time=-150
|
||||
missile_start_time=-150
|
||||
direction=nw,n,ne
|
||||
[if]
|
||||
hits=yes
|
||||
[missile_frame]
|
||||
image="{PATH_TEMP}eagle-n.png:300,{PATH_TEMP}eagle-n.png~FL(vert):400"
|
||||
image_diagonal="{PATH_TEMP}eagle-e.png:300,{PATH_TEMP}eagle-e.png~FL(horiz):400"
|
||||
y=-43~0:150,0~-43:150,-43:400
|
||||
auto_vflip=no
|
||||
offset=0~0.8:150,0.8~1.6:150,1.6~0:400
|
||||
[/missile_frame]
|
||||
[frame]
|
||||
image="{PATH_TEMP}sky_hunter-alone.png:700"
|
||||
sound=gryphon-shriek-1.ogg
|
||||
[/frame]
|
||||
[/if]
|
||||
[else]
|
||||
hits=no
|
||||
[missile_frame]
|
||||
image="{PATH_TEMP}falcon-n.png:300,{PATH_TEMP}eagle-n.png~FL(vert):400"
|
||||
image_diagonal="{PATH_TEMP}falcon-e.png:300,{PATH_TEMP}eagle-e.png~FL(horiz):400"
|
||||
auto_vflip=no
|
||||
y=-43~-56:150,-56:150,-56~-43:400
|
||||
offset=0~0.8:150,0.8~1.6:150,1.6~0:400
|
||||
[/missile_frame]
|
||||
[frame]
|
||||
image="{PATH_TEMP}sky_hunter-alone.png:700"
|
||||
sound=bat-flapping.wav
|
||||
[/frame]
|
||||
[/else]
|
||||
[/attack_anim]
|
||||
[attack_anim]
|
||||
[filter_attack]
|
||||
name=falcon
|
||||
[/filter_attack]
|
||||
start_time=-150
|
||||
missile_start_time=-150
|
||||
direction=sw,s,se
|
||||
[if]
|
||||
hits=yes
|
||||
[missile_frame]
|
||||
image="{PATH_TEMP}eagle-n.png~FL(vert):300,{PATH_TEMP}eagle-n.png:400"
|
||||
image_diagonal="{PATH_TEMP}eagle-e.png:300,{PATH_TEMP}eagle-e.png~FL(horiz):400"
|
||||
y=-43~0:150,0~-43:150,-43:400
|
||||
auto_vflip=no
|
||||
offset=0~0.8:150,0.8~1.6:150,1.6~0:400
|
||||
[/missile_frame]
|
||||
[frame]
|
||||
image="{PATH_TEMP}sky_hunter-alone.png:700"
|
||||
sound=gryphon-shriek-1.ogg
|
||||
[/frame]
|
||||
[/if]
|
||||
[else]
|
||||
hits=no
|
||||
[missile_frame]
|
||||
image="{PATH_TEMP}falcon-n.png~FL(vert):300,{PATH_TEMP}eagle-n.png:400"
|
||||
image_diagonal="{PATH_TEMP}falcon-e.png:300,{PATH_TEMP}eagle-e.png~FL(horiz):400"
|
||||
auto_vflip=no
|
||||
y=-43~-56:150,-56:150,-56~-43:400
|
||||
offset=0~0.8:150,0.8~1.6:150,1.6~0:400
|
||||
[/missile_frame]
|
||||
[frame]
|
||||
image="{PATH_TEMP}sky_hunter-alone.png:700"
|
||||
sound=bat-flapping.wav
|
||||
[/frame]
|
||||
[/else]
|
||||
[/attack_anim]
|
||||
[/unit_type]
|
||||
|
||||
#undef PATH_TEMP
|
107
data/lua/diversion.lua
Normal file
|
@ -0,0 +1,107 @@
|
|||
|
||||
local _ = wesnoth.textdomain 'wesnoth-help'
|
||||
local T = wml.tag
|
||||
local on_event = wesnoth.require("on_event")
|
||||
|
||||
local u_pos_filter = function(u_id)
|
||||
|
||||
local output = "initial"
|
||||
local hex_dirs = {"n", "ne", "se", "s", "sw", "nw"}
|
||||
local diversion_unit = wesnoth.units.get(u_id)
|
||||
if not diversion_unit then
|
||||
return nil
|
||||
end
|
||||
for i, dir in ipairs(hex_dirs) do
|
||||
if diversion_unit:matches {
|
||||
id = u_id,
|
||||
T.filter_adjacent {
|
||||
is_enemy = "yes",
|
||||
adjacent = dir,
|
||||
formula = "self.hitpoints > 0",
|
||||
T.filter_adjacent {
|
||||
is_enemy = "yes",
|
||||
adjacent = dir,
|
||||
formula = "self.hitpoints > 0"
|
||||
}
|
||||
}
|
||||
} then
|
||||
output = "diverter"
|
||||
break
|
||||
end
|
||||
end
|
||||
if output ~= "initial" then
|
||||
return output
|
||||
else
|
||||
-- either nothing passed filter, or there was an error
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local status_anim_update = function(is_undo)
|
||||
|
||||
local ec = wesnoth.current.event_context
|
||||
local changed_something = false
|
||||
|
||||
if not ec.x1 or not ec.y1 then
|
||||
return
|
||||
end
|
||||
|
||||
-- find all units on map with ability = diversion but not status.diversion = true
|
||||
local div_candidates = wesnoth.units.find_on_map({
|
||||
ability = "diversion",
|
||||
{"not", { status = "diversion" }}
|
||||
})
|
||||
-- for those that pass the filter now, change status and fire animation
|
||||
for index, ec_unit in ipairs(div_candidates) do
|
||||
local filter_result = u_pos_filter(ec_unit.id)
|
||||
if filter_result then
|
||||
changed_something = true
|
||||
ec_unit.status.diversion = true
|
||||
ec_unit:extract()
|
||||
ec_unit:to_map()
|
||||
wesnoth.wml_actions.animate_unit {
|
||||
flag = "launching",
|
||||
with_bars = true,
|
||||
T.filter { id = ec_unit.id }
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
-- find all units on map with ability = diversion and status.diversion = true
|
||||
local stop_candidates = wesnoth.units.find_on_map({
|
||||
ability = "diversion",
|
||||
status = "diversion"
|
||||
})
|
||||
-- for those that fail the filter now, change status and fire animation
|
||||
for index, ec_unit in ipairs(stop_candidates) do
|
||||
local filter_result = u_pos_filter(ec_unit.id)
|
||||
if not filter_result then
|
||||
changed_something = true
|
||||
ec_unit.status.diversion = false
|
||||
ec_unit:extract()
|
||||
ec_unit:to_map()
|
||||
wesnoth.wml_actions.animate_unit {
|
||||
flag = "landing",
|
||||
with_bars = true,
|
||||
T.filter { id = ec_unit.id }
|
||||
}
|
||||
end
|
||||
end
|
||||
if changed_something and not is_undo then
|
||||
wesnoth.wml_actions.on_undo {
|
||||
wml.tag.on_undo_diversion {
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function wesnoth.wml_actions.on_undo_diversion(cfg)
|
||||
status_anim_update(true)
|
||||
end
|
||||
|
||||
on_event("moveto, die", function()
|
||||
status_anim_update()
|
||||
|
||||
end)
|
||||
|