First cut at random-feature-placement macro.

This commit is contained in:
Eric S. Raymond 2008-02-15 03:32:53 +00:00
parent c40271e5ee
commit 96177d84bf

View file

@ -72,6 +72,34 @@
[event]
name="prestart"
#define RANDOM_FEATURE_PLACEMENT X_SPAN Y_SPAN TERRAIN_PATTERN IMAGE MOD_WML
[store_locations]
x={X_SPAN}
y={Y_SPAN}
terrain={TERRAIN_PATTERN}
variable=random_placement_locations
[/store_locations]
{VARIABLE_OP random_string format "0..$random_placement_locations.length"}
{RANDOM $random_string}
{VARIABLE_OP random_placement_x format "$random_placement_locations[$random].x"}
{VARIABLE_OP random_placement_y format "$random_placement_locations[$random].y"}
{CLEAR_VARIABLE random_placement_locations}
{UNIT_WML}
[item]
image={IMAGE}
x,y=$random_placement_x,$random_placement_y
{MOD_WML}
[/item]
#enddef
{RANDOM_FEATURE_PLACEMENT 1-44 1-30 Gg scenery/pine1.png ()}
[unit]
type=Gryphon Rider
description=Pelmathidrol
@ -117,8 +145,6 @@
[event]
name="start"
{PLACE_IMAGE "scenery/oak-leaning.png" 33 21}
[message]
description="Aiglondur"
message=_"Up axes! We will be the Northern Alliance's arm today,