-
-
Notifications
You must be signed in to change notification settings - Fork 992
/
unused.cfg
135 lines (122 loc) · 4.4 KB
/
unused.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Unused general macros that we want to preserve in case they become
# useful again.
#
# This macro isn't actually used in the scenario "The Scepter of Fire"
# because of the random location issue. We're keeping it here for
# posterity for the time being.
#
#define OBJ_SCEPTER_FIRE X Y ID
{PLACE_IMAGE items/sceptre-of-fire.png ({X}) ({Y})}
[event]
name=moveto
first_time_only=no
[filter]
side=1
x={X}
y={Y}
[/filter]
[object]
id={ID}
name= _ "Scepter of Fire"
image=items/sceptre-of-fire.png
duration=forever
description= _ "This ancient Scepter was forged by the Dwarves. A symbol of the kingship of Wesnoth, the Scepter has the power to shoot fireballs at enemies of the bearer!"
cannot_use_message= _ "This is the Scepter of Fire. Only a true successor to the throne can possibly dare to take this!"
[filter]
type=Princess,Battle Princess,Commander,Lord
x,y={X},{Y}
[/filter]
[then]
[removeitem]
x,y={X},{Y}
[/removeitem]
[/then]
[effect]
apply_to=variation
name=scepter
[/effect]
[/object]
[/event]
#enddef
#
# Originally from UtBS -- it now has a random-placement macro that
# is probably better than this.
#
#!***Macro to random place unit within area***
#define RANDOM_PLACEMENT X Y RADIUS_NUMBER UNIT_WML
[store_locations]
x,y={X},{Y}
radius={RADIUS_NUMBER}
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}
[+unit]
x,y=$random_placement_x,$random_placement_y
[/unit]
#enddef
#
# This was originally from Dark Forecast
#
#define RANDOM_SPAWN_ON_TURN TURN SIDE GOLD MAX_NUMBER
[event]
name=new turn
first_time_only=no
{VARIABLE trigger_turn $timed_spawn[$trigger_index].turn}
[if]
[variable]
name=turn_number
numerical_equals=$trigger_turn
[/variable]
[then]
{VARIABLE size $main_group}
{RANDOMIZE $size}
{VARIABLE group_id $random}
{VARIABLE size $main_spawns[$group_id].spawn_number}
{VARIABLE gold $timed_spawn[$trigger_index].gold}
{VARIABLE max_units $timed_spawn[$trigger_index].units}
[while]
[variable]
name=gold
greater_than=0
[/variable]
[variable]
name=max_units
greater_than=0
[/variable]
[do]
{RANDOMIZE $size}
[if]
[variable]
name=random
greater_than=0
[/variable]
[then]
{VARIABLE type $main_spawns[$group_id].spawn_type[$random].type}
{SPAWN_UNIT {SIDE} $type $random 1 $max_units}
[/then]
[else]
# fallback for invalid/cleared spawn groups
{VARIABLE gold 0}
[/else]
[/if]
[/do]
[/while]
{ADJUST_UNIT_LEVEL {SIDE} 1}
{ADJUST_UNIT_LEVEL {SIDE} 2}
{ADJUST_UNIT_LEVEL {SIDE} 3}
# spend remaining gold
#[while]
# {VARIABLE spawn_x $main_spawns[$group_id].x}
# {VARIABLE spawn_y $main_spawns[$group_id].y}
# {PLACE_SPAWN_GROUP $spawn_x $spawn_y}
# {REMOVE_SPAWN_GROUP $group_id}
# {VARIABLE_OP trigger_index add 1}
[/then]
[/if]
[/event]
#enddef