Reference cleanup.

This commit is contained in:
Eric S. Raymond 2007-07-25 19:40:45 +00:00
parent ddd91eaccc
commit 32258c9530
8 changed files with 33 additions and 24 deletions

View file

@ -83,8 +83,8 @@
[/animation]
[/attack]
[attack]
name=missile
description= _ "missile"
name=magic-missile
description= _ "magic missile"
type=cold
range=ranged
[specials]

View file

@ -70,13 +70,13 @@
[/defend]
[attack]
name=astral blade
icon=attacks/sword-human.png # FIXME: we should do better than this
description= _ "astral blade"
type=blade
range=melee
[specials]
{WEAPON_SPECIAL_MAGICAL}
[/specials]
icon=attacks/astral-blade.png
damage=9
number=4
[animation]
@ -164,8 +164,8 @@
[missile_frame]
begin=-175
end=25
image=projectiles/shadowmissile-n.png
image_diagonal=projectiles/shadowmissile-ne.png
image=projectiles/darkmissile-n.png
image_diagonal=projectiles/darkmissile-ne.png
[/missile_frame]
[/animation]
[/attack]
@ -205,8 +205,8 @@
[missile_frame]
begin=-175
end=25
image=projectiles/shadowmissile-n.png
image_diagonal=projectiles/shadowmissile-ne.png
image=projectiles/darkmissile-n.png
image_diagonal=projectiles/darkmissile-ne.png
[/missile_frame]
[/animation]
[/attack]

View file

@ -54,7 +54,7 @@ ered across the Wesnoth countryside."
advanceto=Outlaw_Peasant
unit_description= _ "The scruffy-haired peasant youth are much like the young people living elsewhere in Wesnoth: reckless, cocky, and eager to explore."
[attack]
name=club
name=club # wmllint: no-icon
damage=4 # Down from 5 in your basic Footpad
[/attack]
[female]

View file

@ -14,11 +14,11 @@
movement=4
unit_description= _ "Cave Spiders roam deep under the earth, devouring many victims. They can bite at close range, thereby poisoning their enemies, and also can attack with a web at long range, slowing their foes down."
[attack]
name=fangs
name=fangs # wmllint: no-icon
damage=14
[/attack]
[attack]
name=web
name=web # wmllint: no-icon
damage=6
[/attack]
[/unit]

View file

@ -9,7 +9,7 @@
movement=2 # Down from 4
unit_description= _ "Giant Ants are common in almost any environment, from caverns deep under the earth to the tops of tall mountains. Though normally not hostile, they can bite at close range. When they don't have a Queen Ant to lead them, they can often become confused."
[attack]
name=fangs
name=fangs # wmllint: no-icon
damage=5 # Down from 6
[/attack]
[/unit]

View file

@ -2,16 +2,16 @@
[unit]
[base_unit]
id=DarkAssassin1
[base_unit]
[/base_unit]
id=Dark Assassin2
hitpoints=60 # +8 from Dark Assassin1
hide_help=true
[attack]
name=scythe
name=scythe # wmllint: no-icon
damage=10 # +1 from Dark Assassin1
[/attack]
[attack]
name=darts
name=darts # wmllint: no-icon
damage=7 # +1 from Dark Assassin1
[/attack]
[/unit]

View file

@ -3,16 +3,16 @@
[unit]
[base_unit]
id=DarkAssassin1
[base_unit]
[/base_unit]
id=Dark Assassin3
hitpoints=68 # +16 from Dark Assassin1
hide_help=true
[attack]
name=scythe
name=scythe # wmllint: no-icon
damage=10 # +1 from Dark Assassin1
[/attack]
[attack]
name=darts
name=darts # wmllint: no-icon
damage=7 # +1 from Dark Assassin1
[/attack]
[/unit]

View file

@ -28,6 +28,7 @@
#
# Note: You can shut wmllint up about custom terrains by having a comment
# on the same line that includes the string "wmllint: ignore".
# You can also prevent description insertions with "wmllint: no-icon".
import sys, os, re, getopt, string, copy, difflib, time
from wesnoth.wmltools import *
@ -470,15 +471,23 @@ def hack_syntax(filename, lines):
if not have_description:
j = i
while '[/attack]' not in lines[j]:
if lines[j].strip().startswith("name"):
description = lines[j].split("=")[1].strip()
fields = lines[j].strip().split('#')
syntactic = fields[0]
comment = ""
if len(fields) > 1:
comment = fields[1]
if syntactic.strip().startswith("name"):
description = syntactic.split("=")[1].strip()
if not description.startswith('"'):
description = '"' + description + '"\n'
leader = lines[j][:lines[j].find("name")]
new_line = leader + "description=_"+description
if verbose:
print 'wmllint: "%s", line %d: inserting %s' % (filename, i+1, `new_line`)
lines.insert(j+1, new_line)
leader = syntactic[:syntactic.find("name")]
# Skip the insertion if this is a dummy declaration
# or one modifying an attack inherited from a base unit.
if "no-icon" not in comment:
new_line = leader + "description=_"+description
if verbose:
print '"%s", line %d: inserting %s' % (filename, i+1, `new_line`)
lines.insert(j+1, new_line)
j += 1
modcount += 1
j += 1