Utilized inherit= to greatly reduce code redundancy in the WC and Soulless

This commit is contained in:
Charles Dang 2015-04-20 02:21:55 +11:00
parent dc566e46b6
commit a701a2ec16
2 changed files with 165 additions and 219 deletions

View file

@ -1,43 +1,15 @@
#textdomain wesnoth-units
[unit_type]
#macro to define most of the non-graphical part of Walking Corpse
# Variant HP, MP, and MP types for the Soulless
#define UNIT_BODY_SOULLESS_STATS MOVETYPE_ID MOVES_NUMBER HP_AMOUNT
id=Soulless
name= _ "Soulless"
race=undead
{TRAIT_FEARLESS_MUSTHAVE}
hitpoints={HP_AMOUNT}
movement_type={MOVETYPE_ID}
movement={MOVES_NUMBER}
experience=50
level=1
alignment=chaotic
advances_to=null
{AMLA_DEFAULT}
cost=13
usage=fighter
description= _ "The technique of animating a dead body is unfortunately well-known in the dark arts; practitioners often use it to raise servants and soldiers from unwilling corpses. These shamblers are often numerous, but fragile; a touch of combat can waken them, though, making them far more formidable."+{SPECIAL_NOTES}+{SPECIAL_NOTES_PLAGUE}
[resistance]
arcane=140
[/resistance]
[attack]
name=touch
description=_"touch"
icon=attacks/touch-zombie.png
type=impact
range=melee
damage=7
number=3
[specials]
{WEAPON_SPECIAL_PLAGUE}
[/specials]
[/attack]
#enddef
#macro to define most of the graphical part of Walking Corpse
# Variant animations for the Soulless
#define UNIT_BODY_SOULLESS_GRAPHICS_NO_DEATH_ANIM BASE_NAME
image="units/undead/{BASE_NAME}.png"
{MAGENTA_IS_THE_TEAM_COLOR}
die_sound={SOUND_LIST:ZOMBIE_HIT}
{DEFENSE_ANIM "units/undead/{BASE_NAME}-defend.png" "units/undead/{BASE_NAME}.png" {SOUND_LIST:ZOMBIE_HIT} }
[death]
start_time=0
@ -79,12 +51,9 @@
[/frame]
[/attack_anim]
#enddef
#define UNIT_BODY_SOULLESS_GRAPHICS BASE_NAME DEATH_FRAMES_NUMBER
image="units/undead/{BASE_NAME}.png"
# No profile variations for now
profile=portraits/undead/walking-corpse.png
{MAGENTA_IS_THE_TEAM_COLOR}
die_sound={SOUND_LIST:ZOMBIE_HIT}
{DEFENSE_ANIM "units/undead/{BASE_NAME}-defend.png" "units/undead/{BASE_NAME}.png" {SOUND_LIST:ZOMBIE_HIT} }
[death]
start_time=0
@ -126,124 +95,150 @@
[/frame]
[/attack_anim]
#enddef
{UNIT_BODY_SOULLESS_STATS smallfoot 4 28}
{UNIT_BODY_SOULLESS_GRAPHICS soulless 4}
[unit_type]
id=Soulless
name= _ "Soulless"
# No profile variations for now
profile=portraits/undead/walking-corpse.png
{MAGENTA_IS_THE_TEAM_COLOR}
race=undead
{TRAIT_FEARLESS_MUSTHAVE}
experience=50
level=1
alignment=chaotic
advances_to=null
{AMLA_DEFAULT}
cost=13
usage=fighter
description= _ "The technique of animating a dead body is unfortunately well-known in the dark arts; practitioners often use it to raise servants and soldiers from unwilling corpses. These shamblers are often numerous, but fragile; a touch of combat can waken them, though, making them far more formidable."+{SPECIAL_NOTES}+{SPECIAL_NOTES_PLAGUE}
die_sound={SOUND_LIST:ZOMBIE_HIT}
[attack]
name=touch
description=_"touch"
icon=attacks/touch-zombie.png
type=impact
range=melee
damage=7
number=3
[specials]
{WEAPON_SPECIAL_PLAGUE}
[/specials]
[/attack]
[resistance]
arcane=140
[/resistance]
[movement_costs]
deep_water=4
[/movement_costs]
[defense]
deep_water=90
[/defense]
{UNIT_BODY_SOULLESS_STATS smallfoot 4 28}
{UNIT_BODY_SOULLESS_GRAPHICS soulless 4}
[variation]
variation_id=drake
variation_name= _ "wc_variation^Drake"
inherit=yes
{UNIT_BODY_SOULLESS_STATS drakefoot 4 36}
{UNIT_BODY_SOULLESS_GRAPHICS_NO_DEATH_ANIM soulless-drake}
[movement_costs]
deep_water=4
unwalkable=4
[/movement_costs]
[defense]
deep_water=90
unwalkable=90
[/defense]
[/variation]
[variation]
variation_id=dwarf
variation_name= _ "wc_variation^Dwarf"
{UNIT_BODY_SOULLESS_STATS dwarvishfoot 3 33}
inherit=yes
{UNIT_BODY_SOULLESS_STATS dwarvishfoot 3 33}
{UNIT_BODY_SOULLESS_GRAPHICS soulless-dwarf 4}
[movement_costs]
deep_water=3
[/movement_costs]
[defense]
deep_water=90
[/defense]
[/variation]
[variation]
variation_id=goblin
variation_name= _ "wc_variation^Goblin"
{UNIT_BODY_SOULLESS_STATS smallfoot 4 23}
inherit=yes
{UNIT_BODY_SOULLESS_STATS smallfoot 4 23}
{UNIT_BODY_SOULLESS_GRAPHICS soulless-goblin 4}
[movement_costs]
deep_water=4
[/movement_costs]
[defense]
deep_water=90
[/defense]
[/variation]
[variation]
variation_id=mounted
variation_name= _ "wc_variation^Mounted"
{UNIT_BODY_SOULLESS_STATS mounted 5 33}
inherit=yes
{UNIT_BODY_SOULLESS_STATS mounted 5 33}
{UNIT_BODY_SOULLESS_GRAPHICS soulless-mounted 4}
[movement_costs]
deep_water=4
[/movement_costs]
[defense]
deep_water=90
[/defense]
[/variation]
[variation]
variation_id=gryphon
variation_name= _ "wc_variation^Gryphon"
{UNIT_BODY_SOULLESS_STATS fly 5 33}
inherit=yes
{UNIT_BODY_SOULLESS_STATS fly 5 33}
{UNIT_BODY_SOULLESS_GRAPHICS soulless-drake 3}
[defense]
mountains=40
[/defense]
[/variation]
[variation]
variation_id=saurian
variation_name= _ "wc_variation^Saurian"
{UNIT_BODY_SOULLESS_STATS lizard 4 25}
inherit=yes
{UNIT_BODY_SOULLESS_STATS lizard 4 25}
{UNIT_BODY_SOULLESS_GRAPHICS soulless-saurian 4}
[movement_costs]
deep_water=4
[/movement_costs]
[defense]
deep_water=90
[/defense]
[/variation]
[variation]
variation_id=swimmer
variation_name= _ "wc_variation^Swimmer"
{UNIT_BODY_SOULLESS_STATS swimmer 4 28}
inherit=yes
{UNIT_BODY_SOULLESS_STATS swimmer 4 28}
{UNIT_BODY_SOULLESS_GRAPHICS soulless-swimmer 4}
[movement_costs]
forest=4
hills=4
[/movement_costs]
[/variation]
[variation]
variation_id=troll
variation_name= _ "wc_variation^Troll"
{UNIT_BODY_SOULLESS_STATS largefoot 4 33}
inherit=yes
{UNIT_BODY_SOULLESS_STATS largefoot 4 33}
{UNIT_BODY_SOULLESS_GRAPHICS soulless-troll 4}
[movement_costs]
deep_water=4
[/movement_costs]
[defense]
deep_water=90
[/defense]
[/variation]
[variation]
variation_id=wose
variation_name= _ "wc_variation^Wose"
{UNIT_BODY_SOULLESS_STATS treefolk 3 40}
inherit=yes
{UNIT_BODY_SOULLESS_STATS treefolk 3 40}
{UNIT_BODY_SOULLESS_GRAPHICS soulless-wose 4}
[movement_costs]
deep_water=3
[/movement_costs]
[defense]
deep_water=90
[/defense]
[/variation]
[variation]
variation_id=bat
variation_name= _ "wc_variation^Bat"
inherit=no
inherit=yes
image="units/undead/soulless-bat-se-3.png"
{UNIT_BODY_SOULLESS_STATS fly 5 24}
profile="" # Don't use default portrait
die_sound="bat-flapping.wav"
[movement_costs]
cave=1
fungus=1
@ -255,9 +250,12 @@
[resistance]
cold=70
[/resistance]
{MAGENTA_IS_THE_TEAM_COLOR}
image="units/undead/soulless-bat-se-3.png"
die_sound="bat-flapping.wav"
[death]
start_time=0
[frame]
image="units/undead/soulless-bat-die-[1~4].png:150,units/undead/soulless-die-[5~10].png:150"
[/frame]
[/death]
[defend]
direction=s,sw,se
[if]
@ -348,11 +346,5 @@
image="units/undead/soulless-bat-ne-[3,2,3].png:[50*2,40]"
[/frame]
[/attack_anim]
[death]
start_time=0
[frame]
image="units/undead/soulless-bat-die-[1~4].png:150,units/undead/soulless-die-[5~10].png:150"
[/frame]
[/death]
[/variation]
[/unit_type]

View file

@ -1,89 +1,15 @@
#textdomain wesnoth-units
[unit_type]
#macro to define most of the non-graphical part of Walking Corpse
# Variant HP, MP, and MP types for the Walking Corpse
#define UNIT_BODY_WALKING_CORPSE_STATS MOVTYPE_NAME MOVES_NUMBER HP_AMOUNT
id=Walking Corpse
name= _ "Walking Corpse"
race=undead
{TRAIT_FEARLESS_MUSTHAVE}
hitpoints={HP_AMOUNT}
movement_type={MOVTYPE_NAME}
movement={MOVES_NUMBER}
level=0
experience=24
alignment=chaotic
advances_to=Soulless
cost=8
usage=fighter
description= _ "Walking Corpses are the bodies of the dead, re-animated by dark magic. Though not especially dangerous to a trained soldier, the sight of ones former comrades amongst their number is frightening to say the least."+{SPECIAL_NOTES}+{SPECIAL_NOTES_PLAGUE}
[resistance]
arcane=140
[/resistance]
[attack]
name=touch
description=_"touch"
icon=attacks/touch-zombie.png
type=impact
range=melee
damage=6
number=2
[specials]
{WEAPON_SPECIAL_PLAGUE}
[/specials]
[/attack]
#enddef
#macro to define most of the graphical part of Walking Corpse
#define UNIT_BODY_WALKING_CORPSE_GRAPHICS_NO_DEATH_ANIM BASE_IMAGE
image="units/undead/{BASE_IMAGE}.png"
{MAGENTA_IS_THE_TEAM_COLOR}
die_sound={SOUND_LIST:ZOMBIE_WEAK_HIT}
{DEFENSE_ANIM "units/undead/{BASE_IMAGE}-defend.png" "units/undead/{BASE_IMAGE}.png" {SOUND_LIST:ZOMBIE_WEAK_HIT} }
[death]
start_time=0
[frame]
image="units/undead/soulless-die-[4~10].png:150"
[/frame]
[/death]
[attack_anim]
[filter_attack]
name=touch
[/filter_attack]
direction=s
start_time=-200
[frame]
image="units/undead/{BASE_IMAGE}-attack-s.png:400"
sound=zombie-attack.wav
[/frame]
[/attack_anim]
[attack_anim]
[filter_attack]
name=touch
[/filter_attack]
direction=n
start_time=-200
[frame]
image="units/undead/{BASE_IMAGE}-attack-n.png:400"
sound=zombie-attack.wav
[/frame]
[/attack_anim]
[attack_anim]
[filter_attack]
name=touch
[/filter_attack]
direction=se,sw,ne,nw
start_time=-200
[frame]
image="units/undead/{BASE_IMAGE}-attack.png:400"
sound=zombie-attack.wav
[/frame]
[/attack_anim]
#enddef
# Variant animations for the Walking Corpse
#define UNIT_BODY_WALKING_CORPSE_GRAPHICS NBASE_NAME DEATH_FRAMES_NUMBER
image="units/undead/{NBASE_NAME}.png"
# No profile variations for now
profile=portraits/undead/walking-corpse.png
{MAGENTA_IS_THE_TEAM_COLOR}
die_sound={SOUND_LIST:ZOMBIE_WEAK_HIT}
{DEFENSE_ANIM "units/undead/{NBASE_NAME}-defend.png" "units/undead/{NBASE_NAME}.png" {SOUND_LIST:ZOMBIE_WEAK_HIT} }
[death]
start_time=0
@ -125,124 +51,153 @@
[/frame]
[/attack_anim]
#enddef
{UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie 4}
{UNIT_BODY_WALKING_CORPSE_STATS smallfoot 4 18}
[unit_type]
id=Walking Corpse
name= _ "Walking Corpse"
# No profile variations for now
profile=portraits/undead/walking-corpse.png
{MAGENTA_IS_THE_TEAM_COLOR}
race=undead
{TRAIT_FEARLESS_MUSTHAVE}
level=0
experience=24
alignment=chaotic
advances_to=Soulless
cost=8
usage=fighter
description= _ "Walking Corpses are the bodies of the dead, re-animated by dark magic. Though not especially dangerous to a trained soldier, the sight of ones former comrades amongst their number is frightening to say the least."+{SPECIAL_NOTES}+{SPECIAL_NOTES_PLAGUE}
die_sound={SOUND_LIST:ZOMBIE_WEAK_HIT}
[attack]
name=touch
description=_"touch"
icon=attacks/touch-zombie.png
type=impact
range=melee
damage=6
number=2
[specials]
{WEAPON_SPECIAL_PLAGUE}
[/specials]
[/attack]
[resistance]
arcane=140
[/resistance]
[movement_costs]
deep_water=4
[/movement_costs]
[defense]
deep_water=90
[/defense]
{UNIT_BODY_WALKING_CORPSE_STATS smallfoot 4 18}
{UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie 4}
[variation]
variation_id=drake
variation_name= _ "wc_variation^Drake"
inherit=yes
{UNIT_BODY_WALKING_CORPSE_STATS drakefoot 4 23}
{UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-drake 4}
{UNIT_BODY_WALKING_CORPSE_STATS drakefoot 4 23}
[movement_costs]
deep_water=4
unwalkable=4
[/movement_costs]
[defense]
deep_water=90
unwalkable=90
[/defense]
[/variation]
[variation]
variation_id=dwarf
variation_name= _ "wc_variation^Dwarf"
inherit=yes
{UNIT_BODY_WALKING_CORPSE_STATS dwarvishfoot 3 21}
{UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-dwarf 4}
{UNIT_BODY_WALKING_CORPSE_STATS dwarvishfoot 3 21}
[movement_costs]
deep_water=3
[/movement_costs]
[defense]
deep_water=90
[/defense]
[/variation]
[variation]
variation_id=goblin
variation_name= _ "wc_variation^Goblin"
inherit=yes
{UNIT_BODY_WALKING_CORPSE_STATS smallfoot 4 13}
{UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-goblin 4}
{UNIT_BODY_WALKING_CORPSE_STATS smallfoot 4 13}
[movement_costs]
deep_water=4
[/movement_costs]
[defense]
deep_water=90
[/defense]
[/variation]
[variation]
variation_id=gryphon
variation_name= _ "wc_variation^Gryphon"
inherit=yes
{UNIT_BODY_WALKING_CORPSE_STATS fly 5 21}
{UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-drake 4}
{UNIT_BODY_WALKING_CORPSE_STATS fly 5 21}
[defense]
mountains=40
[/defense]
[/variation]
[variation]
variation_id=mounted
variation_name= _ "wc_variation^Mounted"
inherit=yes
{UNIT_BODY_WALKING_CORPSE_STATS mounted 5 21}
{UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-mounted 4}
{UNIT_BODY_WALKING_CORPSE_STATS mounted 5 21}
[movement_costs]
deep_water=4
[/movement_costs]
[defense]
deep_water=90
[/defense]
[/variation]
[variation]
variation_id=saurian
variation_name= _ "wc_variation^Saurian"
inherit=yes
{UNIT_BODY_WALKING_CORPSE_STATS lizard 4 16}
{UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-saurian 4}
{UNIT_BODY_WALKING_CORPSE_STATS lizard 4 16}
[movement_costs]
deep_water=4
[/movement_costs]
[defense]
deep_water=90
[/defense]
[/variation]
[variation]
variation_id=swimmer
variation_name= _ "wc_variation^Swimmer"
inherit=yes
{UNIT_BODY_WALKING_CORPSE_STATS swimmer 4 18}
{UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-swimmer 4}
{UNIT_BODY_WALKING_CORPSE_STATS swimmer 4 18}
[movement_costs]
forest=4
hills=4
[/movement_costs]
[/variation]
[variation]
variation_id=troll
variation_name= _ "wc_variation^Troll"
inherit=yes
{UNIT_BODY_WALKING_CORPSE_STATS largefoot 4 21}
{UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-troll 4}
{UNIT_BODY_WALKING_CORPSE_STATS largefoot 4 21}
[movement_costs]
deep_water=4
[/movement_costs]
[defense]
deep_water=90
[/defense]
[/variation]
[variation]
variation_id=wose
variation_name= _ "wc_variation^Wose"
inherit=yes
{UNIT_BODY_WALKING_CORPSE_STATS treefolk 3 26}
{UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-wose 4}
{UNIT_BODY_WALKING_CORPSE_STATS treefolk 3 26}
[movement_costs]
deep_water=3
[/movement_costs]
[defense]
deep_water=90
[/defense]
[/variation]
[variation]
variation_id=bat
variation_name= _ "wc_variation^Bat"
inherit=no
inherit=yes
image="units/undead/zombie-bat-se-3.png"
{UNIT_BODY_WALKING_CORPSE_STATS fly 5 15}
profile="" # Don't use default portrait
die_sound="bat-flapping.wav"
[movement_costs]
cave=1
fungus=1
@ -254,9 +209,13 @@
[resistance]
cold=70
[/resistance]
{MAGENTA_IS_THE_TEAM_COLOR}
image="units/undead/zombie-bat-se-3.png"
die_sound="bat-flapping.wav"
[death]
start_time=0
[frame]
image="units/undead/zombie-bat-die-[1~4].png:150,units/undead/soulless-die-[5~10].png:150"
[/frame]
[/death]
[defend]
direction=s,sw,se
[if]
@ -347,13 +306,8 @@
image="units/undead/zombie-bat-ne-[3,2,3].png:[50*2,40]"
[/frame]
[/attack_anim]
[death]
start_time=0
[frame]
image="units/undead/zombie-bat-die-[1~4].png:150,units/undead/soulless-die-[5~10].png:150"
[/frame]
[/death]
[/variation]
[/unit_type]
#undef UNIT_BODY_WALKING_CORPSE_STATS
#undef UNIT_BODY_WALKING_CORPSE_GRAPHICS