Move the Dwarvish Miner unit to core

This also changes the tracking of what they're carrying to be a status instead of a role, which should be more portable to other use-cases.
This commit is contained in:
Celtic Minstrel 2021-06-20 21:42:56 -04:00
parent b649374b9f
commit cb3e6356dd
22 changed files with 31 additions and 72 deletions

View file

@ -813,11 +813,11 @@
type=Dwarvish Miner type=Dwarvish Miner
[not] [not]
role=has_coal status=has_coal
[/not] [/not]
[not] [not]
role=has_gold status=has_gold
[/not] [/not]
[/filter] [/filter]
@ -825,7 +825,7 @@
speaker=unit speaker=unit
message= _ "I have all the coal I can carry..." message= _ "I have all the coal I can carry..."
[/message] [/message]
{VARIABLE unit.role has_coal} {VARIABLE unit.status.has_coal yes}
[unstore_unit] [unstore_unit]
variable=unit variable=unit
find_vacant=no find_vacant=no
@ -852,11 +852,11 @@
type=Dwarvish Miner type=Dwarvish Miner
[not] [not]
role=has_coal status=has_coal
[/not] [/not]
[not] [not]
role=has_gold status=has_gold
[/not] [/not]
[/filter] [/filter]
@ -864,7 +864,7 @@
speaker=unit speaker=unit
message= _ "I have all the coal I can carry..." message= _ "I have all the coal I can carry..."
[/message] [/message]
{VARIABLE unit.role has_coal} {VARIABLE unit.status.has_coal yes}
[unstore_unit] [unstore_unit]
variable=unit variable=unit
find_vacant=no find_vacant=no
@ -911,11 +911,11 @@
type=Dwarvish Miner type=Dwarvish Miner
[not] [not]
role=has_coal status=has_coal
[/not] [/not]
[not] [not]
role=has_gold status=has_gold
[/not] [/not]
[/filter] [/filter]
@ -923,7 +923,7 @@
speaker=unit speaker=unit
message= _ "I have all the gold I can carry..." message= _ "I have all the gold I can carry..."
[/message] [/message]
{VARIABLE unit.role has_gold} {VARIABLE unit.status.has_gold yes}
[unstore_unit] [unstore_unit]
variable=unit variable=unit
find_vacant=no find_vacant=no
@ -950,7 +950,7 @@
[filter] [filter]
side=1 side=1
type=Dwarvish Miner type=Dwarvish Miner
role=has_coal status=has_coal
[/filter] [/filter]
[item] [item]
@ -970,11 +970,11 @@
type=Dwarvish Miner type=Dwarvish Miner
[not] [not]
role=has_coal status=has_coal
[/not] [/not]
[not] [not]
role=has_gold status=has_gold
[/not] [/not]
[/filter] [/filter]
@ -990,7 +990,7 @@
message= _ "I have all the coal I can carry..." message= _ "I have all the coal I can carry..."
[/message] [/message]
{VARIABLE unit.role has_coal} {VARIABLE unit.status.has_coal yes}
[unstore_unit] [unstore_unit]
variable=unit variable=unit
@ -1025,7 +1025,7 @@
[filter] [filter]
side=1 side=1
type=Dwarvish Miner type=Dwarvish Miner
role=has_gold status=has_gold
[/filter] [/filter]
[item] [item]
@ -1045,11 +1045,11 @@
type=Dwarvish Miner type=Dwarvish Miner
[not] [not]
role=has_coal status=has_coal
[/not] [/not]
[not] [not]
role=has_gold status=has_gold
[/not] [/not]
[/filter] [/filter]
@ -1065,7 +1065,7 @@
message= _ "I have all the gold I can carry..." message= _ "I have all the gold I can carry..."
[/message] [/message]
{VARIABLE unit.role has_gold} {VARIABLE unit.status.has_gold yes}
[unstore_unit] [unstore_unit]
variable=unit variable=unit
@ -1096,7 +1096,7 @@
first_time_only=no first_time_only=no
[filter] [filter]
type=Dwarvish Miner type=Dwarvish Miner
role=has_coal status=has_coal
[filter_location] [filter_location]
find_in=resource_return_locations find_in=resource_return_locations
@ -1107,7 +1107,7 @@
message= _ "My load of coal is delivered!" message= _ "My load of coal is delivered!"
[/message] [/message]
{CLEAR_VARIABLE unit.role} {VARIABLE unit.status.has_coal no}
[unstore_unit] [unstore_unit]
variable=unit variable=unit
@ -1161,7 +1161,7 @@
first_time_only=no first_time_only=no
[filter] [filter]
type=Dwarvish Miner type=Dwarvish Miner
role=has_gold status=has_gold
[filter_location] [filter_location]
find_in=resource_return_locations find_in=resource_return_locations
@ -1172,7 +1172,7 @@
message= _ "Heres the gold." message= _ "Heres the gold."
[/message] [/message]
{CLEAR_VARIABLE unit.role} {VARIABLE unit.status.has_gold no}
[unstore_unit] [unstore_unit]
variable=unit variable=unit

Binary file not shown.

Before

Width:  |  Height:  |  Size: 895 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 B

View file

@ -1,40 +0,0 @@
#textdomain wesnoth-sota
[unit_type]
id=Dwarvish Miner
name= _ "Dwarvish Miner"
race=dwarf
image=units/dwarves/miner.png
hitpoints=25
movement_type=dwarvishfoot
movement=4
level=1
alignment=neutral
advances_to=null
{AMLA_DEFAULT}
experience=50
cost=19
usage=fighter
description= _ "Dwarvish miners are the grunt workers of dwarvish society. They take the precious ores out of the ground, but do not ever take part in the crafting of weapons or artifacts. They have no military training, but they can still do some damage with their picks."
{DEFENSE_ANIM "units/dwarves/miner-defend-2.png" "units/dwarves/miner-defend-1.png" {SOUND_LIST:DWARF_HIT} }
die_sound={SOUND_LIST:DWARF_DIE}
[attack]
name=pick
description= _"pick"
type=pierce
range=melee
damage=4
number=2
icon=attacks/pick-axe.png
[/attack]
[attack_anim]
[filter_attack]
name=pick
[/filter_attack]
start_time=-350
offset=0.0~0.3,0.3~0.5,0.5~0.6,0.6~0.5,0.5~0.3,0.3~0.0
[frame]
image=units/dwarves/miner-attack-[1~6].png:100
[/frame]
{SOUND:HIT_AND_MISS axe.ogg {SOUND_LIST:MISS} -50}
[/attack_anim]
[/unit_type]

View file

Before

Width:  |  Height:  |  Size: 895 B

After

Width:  |  Height:  |  Size: 895 B

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 702 B

After

Width:  |  Height:  |  Size: 702 B

View file

Before

Width:  |  Height:  |  Size: 835 B

After

Width:  |  Height:  |  Size: 835 B

View file

Before

Width:  |  Height:  |  Size: 703 B

After

Width:  |  Height:  |  Size: 703 B

View file

Before

Width:  |  Height:  |  Size: 706 B

After

Width:  |  Height:  |  Size: 706 B

View file

@ -1,4 +1,4 @@
#textdomain wesnoth-sof #textdomain wesnoth-units
[unit_type] [unit_type]
id=Dwarvish Miner id=Dwarvish Miner
name= _ "Dwarvish Miner" name= _ "Dwarvish Miner"
@ -6,7 +6,7 @@
image=units/dwarves/miner.png image=units/dwarves/miner.png
hitpoints=25 hitpoints=25
movement_type=dwarvishfoot movement_type=dwarvishfoot
movement=5 movement=4
level=1 level=1
alignment=neutral alignment=neutral
advances_to=null advances_to=null
@ -14,7 +14,7 @@
experience=50 experience=50
cost=19 cost=19
usage=fighter usage=fighter
description= _ "Dwarvish miners are the grunt workers of dwarvish society. They take the precious ores out of the ground, but do not ever take part in the crafting of weapons or artifacts." description= _ "Dwarvish miners are the grunt workers of dwarvish society. They take the precious ores out of the ground, but do not ever take part in the crafting of weapons or artifacts. They have no military training, but they can still do some damage with their picks."
{DEFENSE_ANIM "units/dwarves/miner-defend-2.png" "units/dwarves/miner-defend-1.png" {SOUND_LIST:DWARF_HIT}} {DEFENSE_ANIM "units/dwarves/miner-defend-2.png" "units/dwarves/miner-defend-1.png" {SOUND_LIST:DWARF_HIT}}
die_sound={SOUND_LIST:DWARF_DIE} die_sound={SOUND_LIST:DWARF_DIE}
[attack] [attack]
@ -27,21 +27,20 @@
icon=attacks/pick-axe.png icon=attacks/pick-axe.png
[/attack] [/attack]
[standing_anim] [standing_anim]
start_time=0
[if] [if]
[filter] [filter]
role=loaded status=has_coal,has_gold
[or]
role=has_coal
[/or]
[or]
role=has_gold
[/or]
[/filter] [/filter]
start_time=0
[frame] [frame]
image=units/dwarves/miner-laden.png:1000 image=units/dwarves/miner-laden.png:1000
[/frame] [/frame]
[/if] [/if]
[else]
[frame]
image=units/dwarves/miner.png:1000
[/frame]
[/else]
[/standing_anim] [/standing_anim]
[attack_anim] [attack_anim]
[filter_attack] [filter_attack]