forked from ArmageddonGames/Spirit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDocumentation.txt
323 lines (210 loc) · 12.2 KB
/
Documentation.txt
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
SPIRIT WEAPON FOR ZELDA QUEST AETERNAL
DOCUMENTATION
=================== HEADER INFORMATION ===================
NAME: Spirit Weapon
AUTHOR: Orithan Fox
VERSION: Alpha 1
ZELDA QUEST VERSION: Zelda Quest AEternal (v2.55) Alpha 29 and up
WARNING! THIS IS IN ALPHA STATE. FEATURES MAY BE CHANGED OR REMOVED WITHOUT PRIOR WARNING. SOME FEATURES ARE INCOMPLETE OR NONFUNCTIONAL. YOU HAVE BEEN WARNED.
=================== SCRIPTS ===================
The list of scripts that come with the header. They are located in Scripts.zh
These are all currently scripts that are used for testing.
ALL OF THESE ARE PLACEHOLDERS AND WILL BE CHANGE OR REMOVED
+---------------------------------------+
item script TestBounceLoader
+---------------------------------------+
Loads up the TestBounce LWeapon script.
+---------------------------------------+
item script PauseWeapons
+---------------------------------------+
Toggles the Header Suspension off or on
+---------------------------------------+
lweapon script TestBounce
+---------------------------------------+
A test script. It causes the LWeapon to bounce.
Currently being planned to be included with the header are a multitude of weapons, many of which come official Zelda games. These include but are not limited to:
Z3 Accurate Sword (A Link to the Past)
Cane of Somaria (A Link to the Past)
Biggoron's Sword (The Oracle of Ages/Seasons)
Cane of Pacci (The Minish Cap)
Tornado Rod (A Link Between Worlds)
Spear (Breath of the Wild)
Pocket Weapon - Pockets an EWeapon and can send it back later at twice the power
Arc Bow - The bow's trajectory can arc upwards.
Splitting Bombs - A bomb that splits into four more bombs... which each split into four more bombs. A great party trick!
Baby Octorok - A baby Octorok that approaches enemy NPCs and fires rocks at them.
=================== GLOBAL FUNCTIONS ===================
Place these in the Global script
There are no global functions included as of now
=================== LWEAPON FUNCTIONS ===================
These set up and manage things related to LWeapons and LWeapon data
+---------------------------------------+
lweapon Spirit_CreateWeapon(int type, int wscript, int weaponD, int parent, int x, int y, int damage, int step, int angle, int sprite, int sfx, int flags);
Args:
type: The type of weapon to create
wscript: The weapon script to assign to the script
weaponD: The weapon script's D args. Pass an array into this arg.
parent: The ID of the weapon's parent item. Set to -1 if not using a parent item.
x: X position to create at.
y: position to create at.
damage: Weapon's Damage.
step: How fast the weapon moves, in 100ths of a pixel per frame.
angle: The weapon's movement angle.
sprite: The sprite the weapon uses.
sfx: The SFX played when the weapon is created
flags: The weapon's flags.
Currently, none are set
+---------------------------------------+
Creates and sets up a Spirited LWeapon with basic movement properties.
Additional properties are set through the appropriate actions.
+---------------------------------------+
void Spirit_Suspend();
+---------------------------------------+
Suspends all SpiritWeapon activity.
Call this whenever you would want the header's activity to be suspended; including at any time you wish to freeze the screen.
It is highly recommended that you insert this function call into any functions that freeze the screen.
+---------------------------------------+
void Spirit_Resume();
+---------------------------------------+
Resumes all SpiritWeapon activity.
Call this whenever you would want the header's activity to resume; including at any time you wish to unfreeze the screen.
It is highly recommended that you insert this function call into any functions that unfreeze the screen.
+---------------------------------------+
void Spirit_ToggleSuspend();
+---------------------------------------+
Toggles the suspension setting on and off.
+---------------------------------------+
bool Spirit_IsSuspended();
+---------------------------------------+
Returns true if the header is suspended.
+---------------------------------------+
bool Spirit_IsAlive(lweapon weapon);
weapon = LWeapon passed
+---------------------------------------+
Returns true if the Spirit Weapon is alive or not.
+---------------------------------------+
void Spirit_Kill(lweapon weapon);
weapon = LWeapon passed
+---------------------------------------+
Kills a scripted weapon
+---------------------------------------+
void Spirit_Revive(lweapon weapon);
weapon = LWeapon passed
+---------------------------------------+
Revives a dead scripted weapon
+---------------------------------------+
bool IsSpiritLWeapon(lweapon weapon);
weapon = LWeapon passed
+---------------------------------------+
Returns wherever weapon is a weapon controlled by SpiritWeapon.zh
+---------------------------------------+
!Temporary; until it arrives in std.zh!
lweapon RunLWeaponScript(int ID, int scriptNum, untyped args);
Args:
ID: The ID of the weapon to create
scriptNum: The number of the LWeapon script to assign to the weapon
args: An array containing the args to apply to the weapon script's D vars.
+---------------------------------------+
Creates an LWeapon and assigns a script and its D args to it.
Called internally by Spirit_CreateWeapon();
+---------------------------------------+
!Temporary; until it arrives in std.zh!
bool FixedCollision(lweapon weapon, npc target);
FixedCollision(npc target, lweapon weapon);
FixedCollision(lweapon weapon, eweapon target);
FixedCollision(eweapon target, lweapon weapon);
weapon = LWeapon passed. Must be one of the two args
target = Targeted pointer. Must one of the args and it currently must be be either an NPC or an EWeapon
+---------------------------------------+
Exactly the same as the existing FixedCollision Function.
Note: This doesn't actually check to see if a Spirited LWeapon has been passed. You can freely use this function in non-SpiritLWeapon scripts if you so wish to, but you are probably better off using a version of this function with a more all-purpose name outside of SpiritLWeapon scripts in case this function changes.
-=-=-=-=-=-=-=- ANIMATION -=-=-=-=-=-=-=-
The following functions set up special animations for the weapons
There are currently no animation functions as of yet. There are planned to be though
-=-=-=-=-=-=-=- MOVEMENT -=-=-=-=-=-=-=-
The following functions grant the Spirited weapon movement types.
In order to use these functions, you must first supply an array of at least the specified size into the work argument. This array contains the variables the function uses for working the movement and provides you a way to read these vars from outside the function and, eventually, communicate with other scripts.
+---------------------------------------+
void Spirit_Move_Veer(lweapon spirit, float work[3], float acc, int angle);
spirit: LWeapon passed.
work[3]: An array containing the variables the movement type needs to work. You must supply an array of at least size 3 here.
0: Current acceleration level, in 100ths of a pixel per frame.
1: Working variable that is applied to the weapon's X movement.
2: Ditto, but for the weapon's Y movement.
acc: Step Speed at which the weapon accelerates in. 100 = 1 pixel per frame (you probably don't want it this high unless you know what you are doing)
angle: The direction in which the weapon accelerates in, in degrees.
+---------------------------------------+
Causes the weapon to accelerate at an angle.
+---------------------------------------+
void Spirit_Move_Drift(lweapon spirit, float work[2], float step, int angle);
spirit: LWeapon passed.
work[2]: An array containing the variables the movement type needs to work. You must supply an array of at least size 2 here.
0: Working variable that is applied to the weapon's X movement.
1: Ditto, but for the weapon's Y movement.
step: Step Speed at which the weapon drifts at. 100 = 1 pixel per frame.
angle: The direction in which it is drifting in, in degrees.
+---------------------------------------+
Causes the weapon to drift at an angle.
+---------------------------------------+
void Spirit_Move_Sine(lweapon spirit, float work[3], float amp, float initangle, float angle);
spirit: LWeapon passed.
work[3]: An array containing the variables the movement type needs to work. You must supply an array of at least size 3 here.
0: The current angle.
1: Working variable that is applied to the weapon's X movement.
2: Ditto, but for the weapon's Y movement.
amp: The overall amplitude the sine wave moves at
initangle: The initial angle. Set to 90 to produce a Cosine wave.
angle: The angular frequency, in degrees, per frame.
+---------------------------------------+
Causes the weapon to move in a sine wave.
Orithan's note: I have no idea how to Sine Wave x.x . I had to lift the functional components for this out of Ghost.zh and I have no idea how to get it to play properly with other movement types. Maybe I will get it eventually
+---------------------------------------+
!INCOMPLETE!
void Spirit_Move_Bounce(lweapon spirit, float work[3 or 4], float initjump, float jumpdecay, float stepdecay);
spirit: LWeapon passed.
work[3 or 4]: An array containing the variables the movement type needs to work. You must supply an array of at least size 3 if not using the Fake Z Axis setting or 4 if you are using it.
0: The weapon's current Jump factor. This is applied to the weapon's Z position (or Y if Fake Z is used) and then decremented by gravity every frame.
1: The stored upward velocity, adjusted each time the weapon bounces.
2: The current bounce number. This does nothing in the weapon itself beyond the first bounce - it is an easy way for the user to read the number of bounces the weapon has made.
Only if you use the Fake Z Axis setting:
3: The weapon's fake Z value.
initjump: The weapon's initial vertical velocity
jumpdecay: The amount taken from the weapon's initial vertical velocity each bounce.
stepdecay: The amount of step speed taken from the weapon each bounce.
+---------------------------------------+
Causes the weapon to bounce in a line. This is currently functional but incomplete. I advise against using this movement type until a later build when its functionality is completed.
+---------------------------------------+
!NON-FUNCTIONAL!
void Spirit_Move_Orbit(lweapon spirit, float work[3], int orbit, int increment);
spirit: LWeapon passed.
work[3]: An array containing the variables the movement type needs to work. You must supply an array of at least size 3 here.
0: The current angle.
1: Working variable that is applied to the weapon's X movement.
2: Ditto, but for the weapon's Y movement.
amp: The overall amplitude the sine wave moves at
initangle: The initial angle. Set to 90 to produce a Cosine wave.
angle: The angular frequency, in degrees, per frame.
+---------------------------------------+
Causes the weapon to orbit around a given point. This is currently non-functional as of now - it's just a function call at this point.
-=-=-=-=-=-=-=- DEATH -=-=-=-=-=-=-=-
The following functions produce special death effects, which are played when the weapon dies.
There are currently no death functions as of yet.
=================== DEBUG FUNCTIONS AND SCRIPTS ===================
These run debugging stuff. These can slow the script right down, so you should probably use them only when debugging.
Enable these by setting SPIRITLW_SETTING_PRINTERRORS to 1.
No functions of the type are implemented as of yet
-----------------------------------------
MISCELLANEOUS FUNCTIONS
A catch all collection of functions that don't fit anywhere else
----------------------------------------
int DirAngle8(int Dir);
Args:
Dir: One of the 8 orthogonal directions (use the DIR_ constants)
Takes one of the 8 orthogonal direction and returns the angle it corresponds to. The angle returned is in degrees.
----------------------------------------
-----------------------------------------
INTERNAL STUFF (This goes in a different file)
A library of internal functions that handle the behind the scenes stuff. Use these with caution and do not mess with them unless you know what you are doing.
These may be changed or removed in future versions without warning. You have been warned.
No functions of this type are defined
-----------------------------------------