wmlmove can do unit deletions in campaign directories now.

This commit is contained in:
Eric S. Raymond 2007-05-19 20:41:08 +00:00
parent 022d3ede66
commit d4e80ae569
10 changed files with 16 additions and 228 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -1,213 +0,0 @@
#textdomain wesnoth-trow
[unit]
id=Fire Dragon
name= _ "Fire Dragon"
race=monster
image="units/fire-dragon.png"
{DEFENSE_ANIM "units/fire-dragon-defend.png" "units/fire-dragon.png" {SOUND_LIST:DRAKE_HIT} }
[abilities]
{ABILITY_LEADERSHIP_LEVEL_5}
[/abilities]
hitpoints=101
movement_type=drakefly
movement=8
experience=100
level=5
alignment=chaotic
advanceto=null
{AMLA_TOUGH 3}
cost=100
usage=archer
unit_description= _ "A fire dragon is an ancient and horrifying being that normally lives only in hushed rumor and fantastic stories. It is normal for centuries to pass without a dragon being seen in Wesnoth, and usually it is only as a shadowy form flying in the distance. Legends are very specific about the ravages of fire dragons: hideously swift in flight, leathery wings spread over one hundred feet in width, they swoop in and blast their prey with inferno jets of flame. Anything escaping the dragon's fire breath must beware its ferocious bite and crushing tail. Fire dragons are cunning and cruel and often take underlings whom they lead to victory."
die_sound=drake-die.ogg
[attack]
name=bite
description= _"bite"
icon=attacks/fangs-animal.png
type=blade
range=melee
damage=21
number=2
[animation]
[frame]
begin=-300
end=-250
image="units/fire-dragon.png"
[/frame]
[frame]
begin=-250
end=-100
image="units/fire-dragon-attack-bite1.png"
[/frame]
[if]
hits=no
[frame]
begin=-100
end=50
image="units/fire-dragon-attack-bite2.png"
sound={SOUND_LIST:MISS}
[/frame]
[/if]
[else]
hits=yes
[frame]
begin=-100
end=50
image="units/fire-dragon-attack-bite2.png"
sound=bite.ogg
[/frame]
[/else]
[frame]
begin=-50
end=150
image="units/fire-dragon-attack-bite3.png"
[/frame]
[frame]
begin=150
end=200
image="units/fire-dragon.png"
[/frame]
[/animation]
[/attack]
[attack]
name=tail
description= _"tail"
#Solicit an Icon
icon=attacks/sting.png
type=impact
range=melee
damage=24
number=1
[animation]
[if]
hits=no
[frame]
begin=-250
end=-150
image="units/fire-dragon.png"
sound={SOUND_LIST:MISS}
[/frame]
[/if]
[else]
hits=yes
[frame]
begin=-250
end=-150
image="units/fire-dragon.png"
sound=tail.ogg
[/frame]
[/else]
[frame]
begin=-150
end=100
image="units/fire-dragon-attack-tail.png"
[/frame]
[frame]
begin=100
end=200
image="units/fire-dragon.png"
[/frame]
[/animation]
[/attack]
[attack]
name=fire breath
description= _"fire breath"
icon=attacks/fire-breath-drake.png
type=fire
[specials]
{WEAPON_SPECIAL_MARKSMAN}
[/specials]
range=ranged
damage=14
number=4
[animation]
[if]
direction=n
[missile_frame]
begin=-400
end=100
halo=projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80
halo_x,halo_y=20,-34
[/missile_frame]
[/if]
[else]
direction=s
[missile_frame]
begin=-400
end=100
halo=projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80
halo_x,halo_y=22,12
[/missile_frame]
[/else]
[else]
direction=ne,nw
[missile_frame]
begin=-400
end=100
halo=projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80
halo_x,halo_y=35,-22
[/missile_frame]
[/else]
[else]
direction=se,sw
[missile_frame]
begin=-400
end=100
halo=projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80
halo_x,halo_y=37,14
[/missile_frame]
[/else]
[frame]
begin=-500
end=-450
image="units/fire-dragon.png"
[/frame]
[frame]
begin=-450
end=-350
image="units/fire-dragon-attack-bite1.png"
[/frame]
[if]
hits=no
[frame]
begin=-350
end=-200
image="units/fire-dragon-attack-breath.png"
sound=flame-big-miss.ogg
[/frame]
[/if]
[else]
hits=yes
[frame]
begin=-350
end=-200
image="units/fire-dragon-attack-breath.png"
sound=flame-big.ogg
[/frame]
[/else]
[frame]
begin=-200
end=-125
image="units/fire-dragon-attack-bite2.png"
[/frame]
[frame]
begin=-125
end=-50
image="units/fire-dragon-attack-bite3.png"
[/frame]
[frame]
begin=-50
end=100
image="units/fire-dragon.png"
[/frame]
[/animation]
[/attack]
[/unit]

View file

@ -63,15 +63,13 @@ if __name__ == "__main__":
sys.stderr.write("wmlmove: at least one path to a unit is required.\n")
sys.stderr.write(__doc__)
sys.exit(1)
else:
src = os.path.normpath(arguments[0])
if not delete:
if len(arguments) == 1:
sys.stderr.write("wmlmove: a campaign name or 'core' is required.\n")
sys.stderr.write(__doc__)
sys.exit(1)
else:
dst = arguments[1]
dst = arguments.pop()
# First, pop upward to the top-level directory.
upwards = os.getcwd().split(os.sep)
@ -88,7 +86,7 @@ if __name__ == "__main__":
# Locate the unit .cfgs to be moved.
srclist = []
for src in arguments[:-1]:
for src in arguments:
try:
(namespace, resource) = src.split("::")
except ValueError:
@ -106,9 +104,9 @@ if __name__ == "__main__":
# Validate the destination.
if not delete:
dstdir = wmltools.namespace_directory(arguments[-1])
dstdir = wmltools.namespace_directory(arguments[dst])
if dstdir == None:
sys.stderr.write("wmlmove: invalid namespace %s\n" % dst)
sys.stderr.write("wmlmove: invalid namespace %s\n" % dstdir)
sys.exit(1)
# Cross-reference all files.
@ -170,10 +168,13 @@ overwrite()
if delete:
print "# Image deletions:"
for (name, defloc) in srcrefs.fileref.items():
if revert:
print wmltools.vcundelete(name)
else:
print wmltools.vcdelete(name)
for namespace in map(wmltools.directory_namespace, srclist):
if wmltools.namespace_member(name, namespace):
if revert:
print wmltools.vcundelete(name)
else:
print wmltools.vcdelete(name)
break
print ""
print "# .cfg deletions"
for filename in srclist:

View file

@ -343,21 +343,21 @@ def vcunmove(src, dst):
else:
return "mv %s %s" % (dst, src)
def vcdelete(src, dst):
def vcdelete(src):
"Delete a file under version control."
(dir, base) = os.path.split(src)
if os.path.exists(os.path.join(dir, ".svn")):
return "svn rm %s %s" % (src, dst)
return "svn rm %s" % src
else:
return "rm %s %s" % (src, dst)
return "rm %s" % src
def vcundelete(src, dst):
def vcundelete(src):
"Revert the result of a previous delete (before commit)."
(dir, base) = os.path.split(src)
if os.path.exists(os.path.join(dir, ".svn")):
return "svn revert %s" % src # Revert the deletion
else:
return "mv %s %s" % (dst, src)
return "echo 'can't undelete %s, not under version control'" % src
#
## Version-control hooks end here