Fix a few SVN properties

This commit is contained in:
Benoît Timbert 2008-04-03 22:43:34 +00:00
parent fd559eff8f
commit 36e0ee2823
5 changed files with 1928 additions and 1928 deletions

View file

@ -1,79 +1,79 @@
#textdomain wesnoth-did
# This file contains all death sequences
#define MALIN_DEATH
[event]
name=die
[filter]
id=Malin Keshar
[/filter]
[message]
speaker=unit
message=_ "I'm not ready to die..."
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
#enddef
#define VOLK_DEATH
[event]
name=die
[filter]
id=Darken Volk
[/filter]
[message]
speaker=unit
message=_ "Fool boy! You have allowed my death, and now none in this world will aid you."
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
#enddef
#define VOLK_DEATH2
[event]
name=die
[filter]
id=Darken Volk
[/filter]
[message]
speaker=unit
message=_ "No! I will not fall this close to achieving the goal of so many years!"
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
#enddef
#define TIME_OUT_LOSE
[event]
name=time over
[message]
speaker=Darken Volk
message=_ "Your incompetence at this simple task is appalling. You will never grow strong enough to be of use to me."
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
#enddef
#define MAL_DEATH
[event]
name=die
[filter]
id=Mal Keshar
[/filter]
[message]
speaker=unit
message=_ "Then my battle against the orcs is lost!"
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
#enddef
#textdomain wesnoth-did
# This file contains all death sequences
#define MALIN_DEATH
[event]
name=die
[filter]
id=Malin Keshar
[/filter]
[message]
speaker=unit
message=_ "I'm not ready to die..."
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
#enddef
#define VOLK_DEATH
[event]
name=die
[filter]
id=Darken Volk
[/filter]
[message]
speaker=unit
message=_ "Fool boy! You have allowed my death, and now none in this world will aid you."
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
#enddef
#define VOLK_DEATH2
[event]
name=die
[filter]
id=Darken Volk
[/filter]
[message]
speaker=unit
message=_ "No! I will not fall this close to achieving the goal of so many years!"
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
#enddef
#define TIME_OUT_LOSE
[event]
name=time over
[message]
speaker=Darken Volk
message=_ "Your incompetence at this simple task is appalling. You will never grow strong enough to be of use to me."
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
#enddef
#define MAL_DEATH
[event]
name=die
[filter]
id=Mal Keshar
[/filter]
[message]
speaker=unit
message=_ "Then my battle against the orcs is lost!"
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
#enddef

File diff suppressed because it is too large Load diff

View file

@ -1,165 +1,165 @@
#textdomain wesnoth-anl
#define ANL_RETURN_TO_MENU
[option]
message= _ "Return to menu"
[command]
[/command]
[/option]
#enddef
#define ANL_HELP_PEASANTS
[message]
speaker=narrator
caption=Peasants
image=units/human-peasants/peasant.png~TC(1,magenta)
message= _ "Peasants are your workers. Depending on the terrain, right-clicking on a peasant allows you to terraform the landscape and/or build castles, mines, farms, villages and universities."
{ANL_RETURN_TO_MENU}
[/message]
#enddef
#define ANL_HELP_MAGES
[message]
speaker=narrator
caption=Mages
image=units/human-magi/mage.png~TC(1,magenta)
message= _ "Mages are your wise men. They can study at universities, pursuing advances in mining, farming and recruitment."
{ANL_RETURN_TO_MENU}
[/message]
#enddef
#define ANL_HELP_FARMS
[message]
speaker=narrator
caption=Farms
image="items/flower4.png"
message= _ "Farms can only be planted on grassland. Move a peasant onto a farm and he will begin to automatically harvest the cash crop."
{ANL_RETURN_TO_MENU}
[/message]
#enddef
#define ANL_HELP_VILLAGES
[message]
speaker=narrator
caption=Villages
image="terrain/village/human-tile.png"
message= _ "Villages can only be built on grassland. They provide income and healing as usual. Right-click on a peasant in a village and you can establish a university."
{ANL_RETURN_TO_MENU}
[/message]
#enddef
#define ANL_HELP_MINES
[message]
speaker=narrator
caption=Mines
image="terrain/village/human-hills-tile.png"
message= _ "Mines can be built on hills or mountains. A peasant on a mine will automatically dig for gold at the start of your turn."
{ANL_RETURN_TO_MENU}
[/message]
#enddef
#define ANL_HELP_UNIVERSITIES
[message]
speaker=narrator
caption=Universities
image="terrain/village/elven-tile.png"
message= _ "Any of the 'Elven' style villages represent universities. At the start of your turn, Mages in universities automatically add to the study progress of your chosen research target. Right-click on a mage in a university to change research target."
{ANL_RETURN_TO_MENU}
[/message]
#enddef
#define ANL_HELP_DIPLOMACY
[message]
speaker=narrator
caption=Diplomacy
image="terrain/village/elven-tile.png"
message= _ "Right-clicking on your leader when in a univerity allows you to select special diplomatic options."
{ANL_RETURN_TO_MENU}
[/message]
#enddef
#define ANL_HELP
[set_menu_item]
id=anl_help
description="Help"
[show_if]
[have_unit]
side=$side_number
x,y=$x1,$y1
canrecruit=yes
[/have_unit]
[/show_if]
[command]
{VARIABLE finished_help no}
[while]
{CONDITION finished_help equals no}
[do]
[message]
speaker=narrator
image=wesnoth-icon.png
caption="A New Land - Help"
message= _ "Select a topic."
[option]
message= _ "Done"
[command]
{VARIABLE finished_help yes}
[/command]
[/option]
[option]
message= _ "@Peasants"
[command]
{ANL_HELP_PEASANTS}
[/command]
[/option]
[option]
message= _ "@Mages"
[command]
{ANL_HELP_MAGES}
[/command]
[/option]
[option]
message= _ "@Farms"
[command]
{ANL_HELP_FARMS}
[/command]
[/option]
[option]
message= _ "@Villages"
[command]
{ANL_HELP_VILLAGES}
[/command]
[/option]
[option]
message= _ "@Mines"
[command]
{ANL_HELP_MINES}
[/command]
[/option]
[option]
message= _ "@Universities"
[command]
{ANL_HELP_UNIVERSITIES}
[/command]
[/option]
[option]
message= _ "@Diplomacy"
[command]
{ANL_HELP_DIPLOMACY}
[/command]
[/option]
[/message]
[/do]
[/while]
[/command]
[/set_menu_item]
#enddef
#textdomain wesnoth-anl
#define ANL_RETURN_TO_MENU
[option]
message= _ "Return to menu"
[command]
[/command]
[/option]
#enddef
#define ANL_HELP_PEASANTS
[message]
speaker=narrator
caption=Peasants
image=units/human-peasants/peasant.png~TC(1,magenta)
message= _ "Peasants are your workers. Depending on the terrain, right-clicking on a peasant allows you to terraform the landscape and/or build castles, mines, farms, villages and universities."
{ANL_RETURN_TO_MENU}
[/message]
#enddef
#define ANL_HELP_MAGES
[message]
speaker=narrator
caption=Mages
image=units/human-magi/mage.png~TC(1,magenta)
message= _ "Mages are your wise men. They can study at universities, pursuing advances in mining, farming and recruitment."
{ANL_RETURN_TO_MENU}
[/message]
#enddef
#define ANL_HELP_FARMS
[message]
speaker=narrator
caption=Farms
image="items/flower4.png"
message= _ "Farms can only be planted on grassland. Move a peasant onto a farm and he will begin to automatically harvest the cash crop."
{ANL_RETURN_TO_MENU}
[/message]
#enddef
#define ANL_HELP_VILLAGES
[message]
speaker=narrator
caption=Villages
image="terrain/village/human-tile.png"
message= _ "Villages can only be built on grassland. They provide income and healing as usual. Right-click on a peasant in a village and you can establish a university."
{ANL_RETURN_TO_MENU}
[/message]
#enddef
#define ANL_HELP_MINES
[message]
speaker=narrator
caption=Mines
image="terrain/village/human-hills-tile.png"
message= _ "Mines can be built on hills or mountains. A peasant on a mine will automatically dig for gold at the start of your turn."
{ANL_RETURN_TO_MENU}
[/message]
#enddef
#define ANL_HELP_UNIVERSITIES
[message]
speaker=narrator
caption=Universities
image="terrain/village/elven-tile.png"
message= _ "Any of the 'Elven' style villages represent universities. At the start of your turn, Mages in universities automatically add to the study progress of your chosen research target. Right-click on a mage in a university to change research target."
{ANL_RETURN_TO_MENU}
[/message]
#enddef
#define ANL_HELP_DIPLOMACY
[message]
speaker=narrator
caption=Diplomacy
image="terrain/village/elven-tile.png"
message= _ "Right-clicking on your leader when in a univerity allows you to select special diplomatic options."
{ANL_RETURN_TO_MENU}
[/message]
#enddef
#define ANL_HELP
[set_menu_item]
id=anl_help
description="Help"
[show_if]
[have_unit]
side=$side_number
x,y=$x1,$y1
canrecruit=yes
[/have_unit]
[/show_if]
[command]
{VARIABLE finished_help no}
[while]
{CONDITION finished_help equals no}
[do]
[message]
speaker=narrator
image=wesnoth-icon.png
caption="A New Land - Help"
message= _ "Select a topic."
[option]
message= _ "Done"
[command]
{VARIABLE finished_help yes}
[/command]
[/option]
[option]
message= _ "@Peasants"
[command]
{ANL_HELP_PEASANTS}
[/command]
[/option]
[option]
message= _ "@Mages"
[command]
{ANL_HELP_MAGES}
[/command]
[/option]
[option]
message= _ "@Farms"
[command]
{ANL_HELP_FARMS}
[/command]
[/option]
[option]
message= _ "@Villages"
[command]
{ANL_HELP_VILLAGES}
[/command]
[/option]
[option]
message= _ "@Mines"
[command]
{ANL_HELP_MINES}
[/command]
[/option]
[option]
message= _ "@Universities"
[command]
{ANL_HELP_UNIVERSITIES}
[/command]
[/option]
[option]
message= _ "@Diplomacy"
[command]
{ANL_HELP_DIPLOMACY}
[/command]
[/option]
[/message]
[/do]
[/while]
[/command]
[/set_menu_item]
#enddef

View file

@ -1,418 +1,418 @@
#textdomain wesnoth-anl
#define WORKER_OPTIONS TYPES
[set_menu_item]
id=anl_get_to_work
description="Get to Work!"
[show_if]
[have_unit]
side=$side_number
x,y=$x1,$y1
type={TYPES}
[not]
[wml_filter]
moves=0
[/wml_filter]
[/not]
[/have_unit]
[/show_if]
[command]
[store_side]
side=$side_number
variable=worker
[/store_side]
[store_unit]
[filter]
x=$x1
y=$y1
[/filter]
variable=unit
[/store_unit]
{VARIABLE finished no}
[while]
{CONDITION finished equals no}
[do]
# wmlindent: start ignoring
[message]
speaker=unit
#wmllint: display on
message= _ "What shall I do my liege?
"
#wmllint: display off
[option]
message= _ "Nothing"
[command]
{VARIABLE finished yes}
[/command]
[/option]
# ----------------------------------------------
# FARMLAND
# Convert to grassland
[option]
message= {MENU_IMG_TXT2 "terrain/flat/grass-r8.png" _"@Convert to Grassland" _"`Cost: 0g"}
{ANL_SHOW_IF ("Peasant") "Re"}
[command]
{COMPLETE_ACTION 0}
{MODIFY_TERRAIN Gg $x1 $y1}
{PLAY_SOUND ("dagger-swish.wav")}
[/command]
[/option]
# ----------------------------------------------
# GRASSLAND
# Plant Farm
[option]
message= {MENU_IMG_TXT2 "terrain/flat/farm-veg-spring-icon.png" _"@Plant Farm" _"`Cost: 0g"}
{ANL_SHOW_IF ("Peasant") "Gg,Gs,Ggf"}
[command]
{COMPLETE_ACTION 0}
{MODIFY_TERRAIN Re $x1 $y1}
{PLAY_SOUND ("entangle.wav")}
[/command]
[/option]
# Build Village
[option]
message= {MENU_IMG_TXT2 "terrain/village/human-tile.png" _"@Build Village" _"`Cost: 15g"}
{ANL_SHOW_IF ("Peasant") "Gg,Gs,Ggf"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 15}
[then]
{COMPLETE_ACTION (-15)}
{MODIFY_TERRAIN "Gg^Vh" $x1 $y1}
{CAPTURE_VILLAGE}
{BUILD_SOUND_1}
[/then]
[/if]
[/command]
[/option]
# Build Castle
[option]
message= {MENU_IMG_TXT2 "terrain/castle/castle-tile.png" _"@Build Castle" _"`Cost: 6g"}
{ANL_SHOW_IF ("Peasant") "Gg,Gs,Ggf"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 6}
[then]
{COMPLETE_ACTION (-6)}
{MODIFY_TERRAIN "Ch" $x1 $y1}
{BUILD_SOUND_2}
[/then]
[/if]
[/command]
[/option]
# Flood
[option]
message= {MENU_IMG_TXT2 "terrain/water/coast.png" _"@Flood the Field" _"`Cost: 4g"}
{ANL_SHOW_IF ("Peasant") "Gg,Gs,Ggf"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 4}
[then]
{COMPLETE_ACTION -4}
{MODIFY_TERRAIN "Ww" $x1 $y1}
{PLAY_SOUND ("water-blast.wav")}
[/then]
[/if]
[/command]
[/option]
# Plant Saplings
[option]
message= {MENU_IMG_TXT2 "terrain/forest/pine-tile.png" _"@Plant Saplings" _"`Cost: 1g"}
{ANL_SHOW_IF ("Peasant") "Gg,Gs,Ggf"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 1}
[then]
{COMPLETE_ACTION -1}
{MODIFY_TERRAIN "Gs^Fp" $x1 $y1}
{PLAY_SOUND ("entangle.wav")}
[/then]
[/if]
[/command]
[/option]
# ----------------------------------------------
# FOREST
# Chop Down Forest
[option]
message= {MENU_IMG_TXT2 "terrain/flat/grass-r8.png" _"@Chop Down Forest" _"`Earns: 1g"}
{ANL_SHOW_IF ("Peasant") "Gs^Fp,Gs^Ft,Aa^Fpa,Gg^Fet"}
[command]
{VARIABLE finished yes}
{VARIABLE_OP unit.moves format 0}
{ADD_GOLD $side_number 1}
{PLAY_SOUND ("dagger-swish.wav")}
{DELAY 250}
{PLAY_SOUND ("axe.ogg")}
{DELAY 150}
{PLAY_SOUND ("wose-die.ogg")}
{MODIFY_TERRAIN "Gg" $x1 $y1}
[unstore_unit]
variable=unit
text=1
red,green,blue=204,204,51
[/unstore_unit]
[/command]
[/option]
# ----------------------------------------------
# HILLS
# Build Gold Mine
[option]
message= {MENU_IMG_TXT2 "terrain/village/human-hills-tile.png" _"@Build Mine" _"`Cost: 25g"}
{ANL_SHOW_IF ("Peasant") "Hh"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 25}
[then]
{COMPLETE_ACTION (-25)}
{MODIFY_TERRAIN "Hh^Vhh" $x1 $y1}
{CAPTURE_VILLAGE}
{BUILD_SOUND_1}
[/then]
[/if]
[/command]
[/option]
# ----------------------------------------------
# MOUNTAINS
# Build Gold Mine
[option]
message= {MENU_IMG_TXT2 "terrain/village/human-mountain-tile.png" _"@Build Mine" _"`Cost: 25g"}
{ANL_SHOW_IF ("Peasant") "Mm"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 25}
[then]
{COMPLETE_ACTION (-25)}
{MODIFY_TERRAIN "Mm^Vhh" $x1 $y1}
{CAPTURE_VILLAGE}
{BUILD_SOUND_1}
[/then]
[/if]
[/command]
[/option]
# ----------------------------------------------
# WATER
# Make a Ford
[option]
message= {MENU_IMG_TXT2 "terrain/water/ford.png" _"@Make a Ford" _"`Cost: 3g"}
{ANL_SHOW_IF ("Peasant") "Ww"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 3}
[then]
{COMPLETE_ACTION (-3)}
{DELAY 200}
{PLAY_SOUND ("dagger-swish.wav")}
{MODIFY_TERRAIN "Wwf" $x1 $y1}
[/then]
[/if]
[/command]
[/option]
# Landfill
[option]
message= {MENU_IMG_TXT2 "terrain/flat/grass-r8.png" _"@Landfill" _"`Cost: 5g"}
{ANL_SHOW_IF ("Peasant") "Ww"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 5}
[then]
{COMPLETE_ACTION (-5)}
{DELAY 200}
{PLAY_SOUND ("claws.ogg")}
{MODIFY_TERRAIN "Gg" $x1 $y1}
[/then]
[/if]
[/command]
[/option]
# ----------------------------------------------
# FORD
# Destroy the Ford
[option]
message= {MENU_IMG_TXT2 "terrain/water/coast.png" _"@Destroy the Ford" _"`Cost: 0g"}
{ANL_SHOW_IF ("Peasant") "Wwf"}
[command]
{COMPLETE_ACTION 0}
{DELAY 200}
{MODIFY_TERRAIN "Ww" $x1 $y1}
{PLAY_SOUND ("pincers.ogg")}
{DELAY 200}
{PLAY_SOUND ("water-blast.wav")}
[/command]
[/option]
# Landfill
[option]
message= {MENU_IMG_TXT2 "terrain/flat/grass-r8.png" _"@Landfill" _"`Cost: 1g"}
{ANL_SHOW_IF ("Peasant") "Wwf"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 1}
[then]
{COMPLETE_ACTION (-1)}
{DELAY 200}
{PLAY_SOUND ("claws.ogg")}
{MODIFY_TERRAIN "Gg" $x1 $y1}
[/then]
[/if]
[/command]
[/option]
# ----------------------------------------------
# CAVE
# Break Up Cave
[option]
message= {MENU_IMG_TXT2 "terrain/flat/grass-r8.png" _"@Smash Cave Floor" _"`Cost: 2g"}
{ANL_SHOW_IF ("Peasant") "Uu,Uu^Ii"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 2}
[then]
{COMPLETE_ACTION (-2)}
{PLAY_SOUND ("claws.ogg")}
{MODIFY_TERRAIN "Gg" $x1 $y1}
[/then]
[/if]
[/command]
[/option]
# Convert Cave To Hills
[option]
message= {MENU_IMG_TXT2 "terrain/hills-variation2.png" _"@Smash Cave Floor" _"`Cost: 3g"}
{ANL_SHOW_IF ("Peasant") "Uh,Uh^Ii"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 3}
[then]
{COMPLETE_ACTION (-3)}
{PLAY_SOUND ("claws.ogg")}
{MODIFY_TERRAIN "Hh" $x1 $y1}
[/then]
[/if]
[/command]
[/option]
# Harvest Cave Mushrooms
[option]
message= {MENU_IMG_TXT2 "terrain/cave/floor1.png" _"@Harvest Mushrooms" _"`Earns: 3g"}
{ANL_SHOW_IF ("Peasant") "Uu^Uf"}
[command]
{VARIABLE finished yes}
{VARIABLE_OP unit.moves format 0}
{ADD_GOLD $side_number 3}
{PLAY_SOUND ("dagger-swish.wav")}
{DELAY 250}
{PLAY_SOUND ("axe.ogg")}
{MODIFY_TERRAIN "Uu" $x1 $y1}
[unstore_unit]
variable=unit
text=3
red,green,blue=204,204,51
[/unstore_unit]
[/command]
[/option]
# ----------------------------------------------
# CASTLE
# Build Keep
[option]
message= {MENU_IMG_TXT2 "terrain/castle/keep-tile.png" _"@Build a Keep" _"`Cost: 6g"}
{ANL_SHOW_IF ("Peasant") "Ch,Ce,Cv,Cud,Chr,Chw,Chs"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 6}
[then]
{COMPLETE_ACTION (-6)}
{MODIFY_TERRAIN "Kh" $x1 $y1}
{BUILD_SOUND_2}
[/then]
[/if]
[/command]
[/option]
# ----------------------------------------------
# VILLAGE
# Establish Univeristy
[option]
message= {MENU_IMG_TXT2 "terrain/village/elven-tile.png" _"@Establish Univeristy" _"`Cost: 7g"}
{ANL_SHOW_IF ("Peasant") "Gg^Vh,Aa^Vha"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 7}
[then]
{COMPLETE_ACTION (-7)}
{MODIFY_TERRAIN "Gg^Ve" $x1 $y1}
{CAPTURE_VILLAGE}
{BUILD_SOUND_2}
[/then]
[/if]
[/command]
[/option]
# ----------------------------------------------
# RUBBLE
# Clear Rubble
[option]
message= {MENU_IMG_TXT2 "terrain/flat/grass-r8.png" _"@Clear the Ground" _"`Cost: 0g"}
{ANL_SHOW_IF ("Peasant") "Rd"}
[command]
{COMPLETE_ACTION (-0)}
{DELAY 200}
{PLAY_SOUND ("claws.ogg")}
{MODIFY_TERRAIN "Gg" $x1 $y1}
{REMOVE_ITEM $x1 $y1}
[/command]
[/option]
[/message]
[/do]
[/while]
[/command]
[/set_menu_item]
#enddef
# wmlindent: stop ignoring
#textdomain wesnoth-anl
#define WORKER_OPTIONS TYPES
[set_menu_item]
id=anl_get_to_work
description="Get to Work!"
[show_if]
[have_unit]
side=$side_number
x,y=$x1,$y1
type={TYPES}
[not]
[wml_filter]
moves=0
[/wml_filter]
[/not]
[/have_unit]
[/show_if]
[command]
[store_side]
side=$side_number
variable=worker
[/store_side]
[store_unit]
[filter]
x=$x1
y=$y1
[/filter]
variable=unit
[/store_unit]
{VARIABLE finished no}
[while]
{CONDITION finished equals no}
[do]
# wmlindent: start ignoring
[message]
speaker=unit
#wmllint: display on
message= _ "What shall I do my liege?
"
#wmllint: display off
[option]
message= _ "Nothing"
[command]
{VARIABLE finished yes}
[/command]
[/option]
# ----------------------------------------------
# FARMLAND
# Convert to grassland
[option]
message= {MENU_IMG_TXT2 "terrain/flat/grass-r8.png" _"@Convert to Grassland" _"`Cost: 0g"}
{ANL_SHOW_IF ("Peasant") "Re"}
[command]
{COMPLETE_ACTION 0}
{MODIFY_TERRAIN Gg $x1 $y1}
{PLAY_SOUND ("dagger-swish.wav")}
[/command]
[/option]
# ----------------------------------------------
# GRASSLAND
# Plant Farm
[option]
message= {MENU_IMG_TXT2 "terrain/flat/farm-veg-spring-icon.png" _"@Plant Farm" _"`Cost: 0g"}
{ANL_SHOW_IF ("Peasant") "Gg,Gs,Ggf"}
[command]
{COMPLETE_ACTION 0}
{MODIFY_TERRAIN Re $x1 $y1}
{PLAY_SOUND ("entangle.wav")}
[/command]
[/option]
# Build Village
[option]
message= {MENU_IMG_TXT2 "terrain/village/human-tile.png" _"@Build Village" _"`Cost: 15g"}
{ANL_SHOW_IF ("Peasant") "Gg,Gs,Ggf"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 15}
[then]
{COMPLETE_ACTION (-15)}
{MODIFY_TERRAIN "Gg^Vh" $x1 $y1}
{CAPTURE_VILLAGE}
{BUILD_SOUND_1}
[/then]
[/if]
[/command]
[/option]
# Build Castle
[option]
message= {MENU_IMG_TXT2 "terrain/castle/castle-tile.png" _"@Build Castle" _"`Cost: 6g"}
{ANL_SHOW_IF ("Peasant") "Gg,Gs,Ggf"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 6}
[then]
{COMPLETE_ACTION (-6)}
{MODIFY_TERRAIN "Ch" $x1 $y1}
{BUILD_SOUND_2}
[/then]
[/if]
[/command]
[/option]
# Flood
[option]
message= {MENU_IMG_TXT2 "terrain/water/coast.png" _"@Flood the Field" _"`Cost: 4g"}
{ANL_SHOW_IF ("Peasant") "Gg,Gs,Ggf"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 4}
[then]
{COMPLETE_ACTION -4}
{MODIFY_TERRAIN "Ww" $x1 $y1}
{PLAY_SOUND ("water-blast.wav")}
[/then]
[/if]
[/command]
[/option]
# Plant Saplings
[option]
message= {MENU_IMG_TXT2 "terrain/forest/pine-tile.png" _"@Plant Saplings" _"`Cost: 1g"}
{ANL_SHOW_IF ("Peasant") "Gg,Gs,Ggf"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 1}
[then]
{COMPLETE_ACTION -1}
{MODIFY_TERRAIN "Gs^Fp" $x1 $y1}
{PLAY_SOUND ("entangle.wav")}
[/then]
[/if]
[/command]
[/option]
# ----------------------------------------------
# FOREST
# Chop Down Forest
[option]
message= {MENU_IMG_TXT2 "terrain/flat/grass-r8.png" _"@Chop Down Forest" _"`Earns: 1g"}
{ANL_SHOW_IF ("Peasant") "Gs^Fp,Gs^Ft,Aa^Fpa,Gg^Fet"}
[command]
{VARIABLE finished yes}
{VARIABLE_OP unit.moves format 0}
{ADD_GOLD $side_number 1}
{PLAY_SOUND ("dagger-swish.wav")}
{DELAY 250}
{PLAY_SOUND ("axe.ogg")}
{DELAY 150}
{PLAY_SOUND ("wose-die.ogg")}
{MODIFY_TERRAIN "Gg" $x1 $y1}
[unstore_unit]
variable=unit
text=1
red,green,blue=204,204,51
[/unstore_unit]
[/command]
[/option]
# ----------------------------------------------
# HILLS
# Build Gold Mine
[option]
message= {MENU_IMG_TXT2 "terrain/village/human-hills-tile.png" _"@Build Mine" _"`Cost: 25g"}
{ANL_SHOW_IF ("Peasant") "Hh"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 25}
[then]
{COMPLETE_ACTION (-25)}
{MODIFY_TERRAIN "Hh^Vhh" $x1 $y1}
{CAPTURE_VILLAGE}
{BUILD_SOUND_1}
[/then]
[/if]
[/command]
[/option]
# ----------------------------------------------
# MOUNTAINS
# Build Gold Mine
[option]
message= {MENU_IMG_TXT2 "terrain/village/human-mountain-tile.png" _"@Build Mine" _"`Cost: 25g"}
{ANL_SHOW_IF ("Peasant") "Mm"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 25}
[then]
{COMPLETE_ACTION (-25)}
{MODIFY_TERRAIN "Mm^Vhh" $x1 $y1}
{CAPTURE_VILLAGE}
{BUILD_SOUND_1}
[/then]
[/if]
[/command]
[/option]
# ----------------------------------------------
# WATER
# Make a Ford
[option]
message= {MENU_IMG_TXT2 "terrain/water/ford.png" _"@Make a Ford" _"`Cost: 3g"}
{ANL_SHOW_IF ("Peasant") "Ww"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 3}
[then]
{COMPLETE_ACTION (-3)}
{DELAY 200}
{PLAY_SOUND ("dagger-swish.wav")}
{MODIFY_TERRAIN "Wwf" $x1 $y1}
[/then]
[/if]
[/command]
[/option]
# Landfill
[option]
message= {MENU_IMG_TXT2 "terrain/flat/grass-r8.png" _"@Landfill" _"`Cost: 5g"}
{ANL_SHOW_IF ("Peasant") "Ww"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 5}
[then]
{COMPLETE_ACTION (-5)}
{DELAY 200}
{PLAY_SOUND ("claws.ogg")}
{MODIFY_TERRAIN "Gg" $x1 $y1}
[/then]
[/if]
[/command]
[/option]
# ----------------------------------------------
# FORD
# Destroy the Ford
[option]
message= {MENU_IMG_TXT2 "terrain/water/coast.png" _"@Destroy the Ford" _"`Cost: 0g"}
{ANL_SHOW_IF ("Peasant") "Wwf"}
[command]
{COMPLETE_ACTION 0}
{DELAY 200}
{MODIFY_TERRAIN "Ww" $x1 $y1}
{PLAY_SOUND ("pincers.ogg")}
{DELAY 200}
{PLAY_SOUND ("water-blast.wav")}
[/command]
[/option]
# Landfill
[option]
message= {MENU_IMG_TXT2 "terrain/flat/grass-r8.png" _"@Landfill" _"`Cost: 1g"}
{ANL_SHOW_IF ("Peasant") "Wwf"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 1}
[then]
{COMPLETE_ACTION (-1)}
{DELAY 200}
{PLAY_SOUND ("claws.ogg")}
{MODIFY_TERRAIN "Gg" $x1 $y1}
[/then]
[/if]
[/command]
[/option]
# ----------------------------------------------
# CAVE
# Break Up Cave
[option]
message= {MENU_IMG_TXT2 "terrain/flat/grass-r8.png" _"@Smash Cave Floor" _"`Cost: 2g"}
{ANL_SHOW_IF ("Peasant") "Uu,Uu^Ii"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 2}
[then]
{COMPLETE_ACTION (-2)}
{PLAY_SOUND ("claws.ogg")}
{MODIFY_TERRAIN "Gg" $x1 $y1}
[/then]
[/if]
[/command]
[/option]
# Convert Cave To Hills
[option]
message= {MENU_IMG_TXT2 "terrain/hills-variation2.png" _"@Smash Cave Floor" _"`Cost: 3g"}
{ANL_SHOW_IF ("Peasant") "Uh,Uh^Ii"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 3}
[then]
{COMPLETE_ACTION (-3)}
{PLAY_SOUND ("claws.ogg")}
{MODIFY_TERRAIN "Hh" $x1 $y1}
[/then]
[/if]
[/command]
[/option]
# Harvest Cave Mushrooms
[option]
message= {MENU_IMG_TXT2 "terrain/cave/floor1.png" _"@Harvest Mushrooms" _"`Earns: 3g"}
{ANL_SHOW_IF ("Peasant") "Uu^Uf"}
[command]
{VARIABLE finished yes}
{VARIABLE_OP unit.moves format 0}
{ADD_GOLD $side_number 3}
{PLAY_SOUND ("dagger-swish.wav")}
{DELAY 250}
{PLAY_SOUND ("axe.ogg")}
{MODIFY_TERRAIN "Uu" $x1 $y1}
[unstore_unit]
variable=unit
text=3
red,green,blue=204,204,51
[/unstore_unit]
[/command]
[/option]
# ----------------------------------------------
# CASTLE
# Build Keep
[option]
message= {MENU_IMG_TXT2 "terrain/castle/keep-tile.png" _"@Build a Keep" _"`Cost: 6g"}
{ANL_SHOW_IF ("Peasant") "Ch,Ce,Cv,Cud,Chr,Chw,Chs"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 6}
[then]
{COMPLETE_ACTION (-6)}
{MODIFY_TERRAIN "Kh" $x1 $y1}
{BUILD_SOUND_2}
[/then]
[/if]
[/command]
[/option]
# ----------------------------------------------
# VILLAGE
# Establish Univeristy
[option]
message= {MENU_IMG_TXT2 "terrain/village/elven-tile.png" _"@Establish Univeristy" _"`Cost: 7g"}
{ANL_SHOW_IF ("Peasant") "Gg^Vh,Aa^Vha"}
[command]
[if]
{CONDITION worker.gold greater_than_equal_to 7}
[then]
{COMPLETE_ACTION (-7)}
{MODIFY_TERRAIN "Gg^Ve" $x1 $y1}
{CAPTURE_VILLAGE}
{BUILD_SOUND_2}
[/then]
[/if]
[/command]
[/option]
# ----------------------------------------------
# RUBBLE
# Clear Rubble
[option]
message= {MENU_IMG_TXT2 "terrain/flat/grass-r8.png" _"@Clear the Ground" _"`Cost: 0g"}
{ANL_SHOW_IF ("Peasant") "Rd"}
[command]
{COMPLETE_ACTION (-0)}
{DELAY 200}
{PLAY_SOUND ("claws.ogg")}
{MODIFY_TERRAIN "Gg" $x1 $y1}
{REMOVE_ITEM $x1 $y1}
[/command]
[/option]
[/message]
[/do]
[/while]
[/command]
[/set_menu_item]
#enddef
# wmlindent: stop ignoring

View file

@ -1,146 +1,146 @@
#include <string>
#include <iostream>
#include "md5.hpp"
#include <string.h>
#include <mysql++.h>
namespace forum_auth {
// This class holds the result of authorisation against forum table for user_name
// and password given. That result can be allways accesed by is_authorised() method.
// Class throws an exception error (std::string) on :
// * Failure to obtain database connection data
// * Failure to connect to database
// * Failure to find entry coresponding to username
// * Two cases of invalid hash
class forum_auth
{
private :
// The class will only hold data provided by the user and the result of their validation
// It's not required or desirable to remember data pulled out from the forum tables.
std::string user_name;
std::string user_password;
bool authorised;
bool validate(void);
public :
// Constructor - sets the data and evaluates them
forum_auth(std::string name, std::string password);
// Destructor is empty
~forum_auth(void);
// Function to return authorisation status
bool is_authorised(void);
};
// Destructor
forum_auth::~forum_auth(void)
{
}
// Constructor
forum_auth::forum_auth(std::string name, std::string password)
{
user_name = name;
user_password = password;
authorised = validate();
}
// Validation function
bool forum_auth::validate(void)
{
// Set an alphabet-like string for use in encrytpion algorithm
std::string itoa64("./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
std::string hash, db_name, db_host, db_user, db_password;
// Get the database acces details
std::fstream db_access_file("db_auth_data.cfg", std::fstream::out);
if(!db_access_file.is_open())
{
std::string error("Forum auth : No file with access data\n");
throw &error;
}
db_access_file >> db_name;
db_access_file >> db_host;
db_access_file >> db_user;
db_access_file >> db_password;
// Connect to the database
mysqlpp::Connection db_interface(false);
if (!db_interface.connect(db_name, db_host, db_user, db_password))
{
std::string error("Forum auth : Connection to the databese failed\n");
throw &error;
}
// Retrive users' password as hash
std::string sql("SELECT hash FROM phpbb3_wesnothd WHERE username='");
sql.append(user_name);
sql.append("'");
mysqlpp::Query query = db_interface.query(sql);
if(!(mysqlpp::StoreQueryReult sql_res = query.store()))
{
std::string error("Forum auth : User not found");
throw &error;
}
hash = sql_res[0][0];
// Check hash prefix, if different than $H$ hash is invalid
if(hash.substr(0,3) != "$H$")
return false;
// Start of the encryption, get the position of first nonidentifier character in extended alphabet
int hash_seed = itoa64.find_first_of(hash[3]);
// If position is lower than 8 or higher than 32 hash is also invalid
if(hash_seed < 7 || hash_seed > 30)
return false;
// Set the number of encryption passes as 2^position
hash_seed = 1 << hash_seed;
// Create salt for mixing with the hash
std::string salt=hash.substr(4,8);
// Start the MD5 hashing
salt.append(user_password);
MD5 md5_worker;
md5_worker.update((unsigned char *)salt.c_str(),salt.length());
md5_worker.finalize();
unsigned char * output = (unsigned char *) malloc (sizeof(unsigned char) * 16);
output = md5_worker.raw_digest();
std::string temp_hash;
do
{
temp_hash = std::string((char *) output, (char *) output + 16);
temp_hash.append(user_password);
md5_worker.~MD5();
MD5 md5_worker;
md5_worker.update((unsigned char *)temp_hash.c_str(),temp_hash.length());
md5_worker.finalize();
output = md5_worker.raw_digest();
} while (--hash_seed);
temp_hash = std::string((char *) output, (char *) output + 16);
// Now encode the resulting mix
std::string encoded_hash;
unsigned int i = 0, value;
do
{
value = output[i++];
encoded_hash.append(itoa64.substr(value & 0x3f,1));
if(i < 16)
value |= (int)output[i] << 8;
encoded_hash.append(itoa64.substr((value >> 6) & 0x3f,1));
if(i++ >= 16)
break;
if(i < 16)
value |= (int)output[i] << 16;
encoded_hash.append(itoa64.substr((value >> 12) & 0x3f,1));
if(i++ >= 16)
break;
encoded_hash.append(itoa64.substr((value >> 18) & 0x3f,1));
} while (i < 16);
free (output);
// Get the first 12 characters from correct hash
std::string result = hash.substr(0,12);
// Append encoded results to the end of it
result.append(encoded_hash);
// Check if reult of above matches the original hash
if( result != hash)
return false;
return true;
}
// Function returning status
bool forum_auth::is_authorised(void)
{
return authorised;
}
} // End of forum_auth namespace
#include <string>
#include <iostream>
#include "md5.hpp"
#include <string.h>
#include <mysql++.h>
namespace forum_auth {
// This class holds the result of authorisation against forum table for user_name
// and password given. That result can be allways accesed by is_authorised() method.
// Class throws an exception error (std::string) on :
// * Failure to obtain database connection data
// * Failure to connect to database
// * Failure to find entry coresponding to username
// * Two cases of invalid hash
class forum_auth
{
private :
// The class will only hold data provided by the user and the result of their validation
// It's not required or desirable to remember data pulled out from the forum tables.
std::string user_name;
std::string user_password;
bool authorised;
bool validate(void);
public :
// Constructor - sets the data and evaluates them
forum_auth(std::string name, std::string password);
// Destructor is empty
~forum_auth(void);
// Function to return authorisation status
bool is_authorised(void);
};
// Destructor
forum_auth::~forum_auth(void)
{
}
// Constructor
forum_auth::forum_auth(std::string name, std::string password)
{
user_name = name;
user_password = password;
authorised = validate();
}
// Validation function
bool forum_auth::validate(void)
{
// Set an alphabet-like string for use in encrytpion algorithm
std::string itoa64("./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
std::string hash, db_name, db_host, db_user, db_password;
// Get the database acces details
std::fstream db_access_file("db_auth_data.cfg", std::fstream::out);
if(!db_access_file.is_open())
{
std::string error("Forum auth : No file with access data\n");
throw &error;
}
db_access_file >> db_name;
db_access_file >> db_host;
db_access_file >> db_user;
db_access_file >> db_password;
// Connect to the database
mysqlpp::Connection db_interface(false);
if (!db_interface.connect(db_name, db_host, db_user, db_password))
{
std::string error("Forum auth : Connection to the databese failed\n");
throw &error;
}
// Retrive users' password as hash
std::string sql("SELECT hash FROM phpbb3_wesnothd WHERE username='");
sql.append(user_name);
sql.append("'");
mysqlpp::Query query = db_interface.query(sql);
if(!(mysqlpp::StoreQueryReult sql_res = query.store()))
{
std::string error("Forum auth : User not found");
throw &error;
}
hash = sql_res[0][0];
// Check hash prefix, if different than $H$ hash is invalid
if(hash.substr(0,3) != "$H$")
return false;
// Start of the encryption, get the position of first nonidentifier character in extended alphabet
int hash_seed = itoa64.find_first_of(hash[3]);
// If position is lower than 8 or higher than 32 hash is also invalid
if(hash_seed < 7 || hash_seed > 30)
return false;
// Set the number of encryption passes as 2^position
hash_seed = 1 << hash_seed;
// Create salt for mixing with the hash
std::string salt=hash.substr(4,8);
// Start the MD5 hashing
salt.append(user_password);
MD5 md5_worker;
md5_worker.update((unsigned char *)salt.c_str(),salt.length());
md5_worker.finalize();
unsigned char * output = (unsigned char *) malloc (sizeof(unsigned char) * 16);
output = md5_worker.raw_digest();
std::string temp_hash;
do
{
temp_hash = std::string((char *) output, (char *) output + 16);
temp_hash.append(user_password);
md5_worker.~MD5();
MD5 md5_worker;
md5_worker.update((unsigned char *)temp_hash.c_str(),temp_hash.length());
md5_worker.finalize();
output = md5_worker.raw_digest();
} while (--hash_seed);
temp_hash = std::string((char *) output, (char *) output + 16);
// Now encode the resulting mix
std::string encoded_hash;
unsigned int i = 0, value;
do
{
value = output[i++];
encoded_hash.append(itoa64.substr(value & 0x3f,1));
if(i < 16)
value |= (int)output[i] << 8;
encoded_hash.append(itoa64.substr((value >> 6) & 0x3f,1));
if(i++ >= 16)
break;
if(i < 16)
value |= (int)output[i] << 16;
encoded_hash.append(itoa64.substr((value >> 12) & 0x3f,1));
if(i++ >= 16)
break;
encoded_hash.append(itoa64.substr((value >> 18) & 0x3f,1));
} while (i < 16);
free (output);
// Get the first 12 characters from correct hash
std::string result = hash.substr(0,12);
// Append encoded results to the end of it
result.append(encoded_hash);
// Check if reult of above matches the original hash
if( result != hash)
return false;
return true;
}
// Function returning status
bool forum_auth::is_authorised(void)
{
return authorised;
}
} // End of forum_auth namespace