Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/wesnoth/wesnoth
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed Oct 22, 2014
2 parents 4bb5814 + 9a01964 commit a7daa39
Show file tree
Hide file tree
Showing 21 changed files with 2,099 additions and 2,053 deletions.
1 change: 1 addition & 0 deletions changelog
Expand Up @@ -178,6 +178,7 @@ Version 1.13.0-dev:
between random and non-random music play (bug #19653)
* Fixed a bug that prevented [animate_unit] from displaying death or victory
animations for those units that filter them based on weapon (eg. Wose)
* New WML tags: [full_heal] and [put_to_recall_list].
* Miscellaneous and bug fixes:
* replace 'fight_on_without_leader'=yes/no with defeat_condition=no_leader/
no_units/always/never which allows the wml developer to decide when a side
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Expand Up @@ -593,6 +593,7 @@

{VARIABLE factor $unit.max_experience}
{VARIABLE_OP factor multiply 0.5}
{VARIABLE_OP factor round 0}
{RANDOM $factor..$unit.max_experience}
{VARIABLE unit.experience $random}
[unstore_unit]
Expand Down
Expand Up @@ -4,7 +4,7 @@
id=Desert Archer
name= _ "Desert Archer"
race=elf
gender=male
gender=male,female
image=units/elves-desert/archer.png
{MAGENTA_IS_THE_TEAM_COLOR}
hitpoints=29
Expand Down
@@ -1,17 +1,18 @@
#textdomain wesnoth-utbs

[unit_type]
id=Skeleton Rider
name= _ "Skeleton Rider"
race=undead
image=units/undead/skeletonrider.png
image="units/undead-skeletal/rider.png"
{MAGENTA_IS_THE_TEAM_COLOR}
{DEFENSE_ANIM "units/undead-skeletal/rider-defend.png" "units/undead-skeletal/rider.png" {SOUND_LIST:SKELETON_HIT} }
[movement_anim]
start_time=0
[frame]
begin=0
end=150
image="units/undead/skeletonrider-moving.png"
image="units/undead-skeletal/rider-moving.png:150"
[/frame]
[/movement_anim]
{DEFENSE_ANIM "units/undead/skeletonrider-defend.png" units/undead/skeletonrider.png {SOUND_LIST:SKELETON_HIT} }
hitpoints=36
movement_type=mounted
movement=7
Expand Down Expand Up @@ -48,10 +49,24 @@
[filter_attack]
name=axe
[/filter_attack]
start_time=-100

start_time=-250
horse_sound_start_time=-250

[frame]
image=units/undead/skeletonrider-attack[1~2].png:100
image="units/undead-skeletal/rider-moving.png:150"
[/frame]
{SOUND:HIT_AND_MISS axe.ogg {SOUND_LIST:MISS} -200}
[frame]
image="units/undead-skeletal/rider-attack.png:200"
[/frame]
[frame]
image="units/undead-skeletal/rider-moving.png:50"
[/frame]

[horse_sound_frame]
sound=horse-canter.wav
[/horse_sound_frame]

{SOUND:HIT_AND_MISS axe.ogg {SOUND_LIST:MISS} -75}
[/attack_anim]
[/unit_type]
2 changes: 1 addition & 1 deletion data/campaigns/Under_the_Burning_Suns/units/units.cfg
Expand Up @@ -55,7 +55,7 @@
name=desert_float
flies=true
[movement_costs]
deep_water=100
deep_water={UNREACHABLE}
shallow_water=1
reef=1
swamp_water=1
Expand Down
46 changes: 6 additions & 40 deletions data/core/macros/utils.cfg
Expand Up @@ -365,26 +365,9 @@
#enddef

#define FULL_HEAL FILTER
# This heals the specified unit(s) to full health.
[store_unit]
[filter]
{FILTER}
[/filter]
variable=FULL_HEAL_temp
[/store_unit]

{FOREACH FULL_HEAL_temp FULL_HEAL_i}
[set_variable]
name=FULL_HEAL_temp[$FULL_HEAL_i].hitpoints
value=$FULL_HEAL_temp[$FULL_HEAL_i].max_hitpoints
[/set_variable]
[unstore_unit]
find_vacant=no
variable=FULL_HEAL_temp[$FULL_HEAL_i]
[/unstore_unit]
{NEXT FULL_HEAL_i}

{CLEAR_VARIABLE FULL_HEAL_temp,FULL_HEAL_i}
[full_heal]
{FILTER}
[/full_heal]
#enddef

#define PUT_TO_RECALL_LIST FILTER
Expand All @@ -405,26 +388,9 @@
#!
#! {PUT_TO_RECALL_LIST x,y=20,38}
#! [/event]
[store_unit]
[filter]
{FILTER}
[/filter]

variable=PUT_TO_RECALL_LIST_temp
kill=yes
[/store_unit]

{FOREACH PUT_TO_RECALL_LIST_temp PUT_TO_RECALL_LIST_i}
{VARIABLE PUT_TO_RECALL_LIST_temp[$PUT_TO_RECALL_LIST_i].x "recall"}
{VARIABLE PUT_TO_RECALL_LIST_temp[$PUT_TO_RECALL_LIST_i].y "recall"}

[unstore_unit]
variable=PUT_TO_RECALL_LIST_temp[$PUT_TO_RECALL_LIST_i]
find_vacant=no
[/unstore_unit]
{NEXT PUT_TO_RECALL_LIST_i}

{CLEAR_VARIABLE PUT_TO_RECALL_LIST_temp,PUT_TO_RECALL_LIST_i}
[put_to_recall_list]
{FILTER}
[/put_to_recall_list]
#enddef

# FIXME: Documentation for these is needed.
Expand Down
33 changes: 33 additions & 0 deletions data/lua/wml-tags.lua
Expand Up @@ -1275,3 +1275,36 @@ function wml_actions.store_villages( cfg )
)
end
end

function wml_actions.put_to_recall_list(cfg)
local units = wesnoth.get_units(cfg)

for i, unit in ipairs(units) do
if cfg.heal then
unit.hitpoints = unit.max_hitpoints
unit.moves = unit.max_moves
unit.attacks_left = unit.max_attacks
unit.status.poisoned = false
unit.status.slowed = false
end
wesnoth.put_recall_unit(unit, unit.side)
wesnoth.put_unit(unit.x, unit.y)
end
end

function wml_actions.full_heal(cfg)
local units = wesnoth.get_units(cfg)

for i, unit in ipairs(units) do
if (not unit.status.unhealable) or cfg.ignore_status then
unit.hitpoints = unit.max_hitpoints
if cfg.cures then
unit.status.poisoned = false
unit.status.slowed = false
end
if cfg.animate then
wesnoth.fire( "animate_unit", { flag = "healed" , with_bars = "yes" , { "filter" , { id = unit.id } } })
end
end
end
end

0 comments on commit a7daa39

Please sign in to comment.