-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2.54_New_ZScript_ShortList.txt
653 lines (458 loc) · 20.1 KB
/
2.54_New_ZScript_ShortList.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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
// Beta 52
/////////////////
/// ZScript ///
/////////////////
The ZScript language now supports function pointers, using the AT_SIGN token (@) as a delimiter.
The ZScript language now supports C-Style comment blocks using the traditional syntax of:
/*
COMMENT BLOCK
*/
Arrays now support being declared with a formula:
int arr[10*4];
This is now the same as int arr[40];
Nesting array calls should now work properly. (e.g. arrA[ arrB[ arrC[ arrd[4] ] ] ] )
//////////////
// Global //
//////////////
void OverlayTile(int firsttile, int secondtile);
Overlay one tile onto another.
/************************************************************************************************************/
////////////
// Game //
////////////
int GetPointer(bool *ptr[]);
* Returns the pointer of a bool array as a float.
bool CappedFPS
* Check if the game is uncapped.
int Version;
* Returns the version of ZC being used.
int Build;
* Returns the Build ID of the version of ZC being used.
int Beta;
* Returns the Beta ID of the version of ZC being used. If the build is not a beta, this returns 0.
bool DisableActiveSubscreen;
* If set true, the active subscreen will not fall into view ehen the player presses Start.
/************************************************************************************************************/
/////////////
/// FFC ///
/////////////
int ID;
* The screen ref of the ffc. Used primarily for this->ID.
int GetPointer(ffc *ptr[]);
* Returns the pointer of a ffc array as a float.
ffc SetPointer(int value);
* Converts an int pointer to the ffc type, for assigning.
/************************************************************************************************************/
//////////////
/// Item ///
//////////////
float UID;
* Returns the UID of an item.
int GetPointer(item *ptr[]);
* Returns the pointer of a item array as a float.
item SetPointer(int value);
* Converts an int pointer to the item type, for assigning.
int AClock
* The clock used for the item's animation cycle.
/************************************************************************************************************/
/////////////////
/// LWeapon ///
/////////////////
int Range;
* The range of the weapon in pixels. At present, this only affects boomerange class lweapons.
/************************************************************************************************************/
/////////////////
/// *weapon ///
/////////////////
float UID;
* Returns the UID of an *weapon.
int GetPointer(lweapon *ptr[]);
* Returns the pointer of a *weapon array as a float.
lweapon SetPointer(int value);
* Converts an int pointer to the lweapon type, for assigning.
float Misc[32];
* Epanded fro a size of [16] to [32]. An array of 32 miscellaneous variables for you to use as you please.
/************************************************************************************************************/
/////////////
/// NPC ///
/////////////
int ScriptDefense[10];
* The npc's Script Weapon Defense values. This corresponds to the 'Defenses 3' tab in the Enemy Editor.
int InvFrames;
* Returns the number of remaining invincibility frames if the enemy is invincible, otherwise 0.
int Invincible;
* Returns if the enemy is invincible, because of ( superman variable ).
bool HasItem;
* Returns if the enemy is holding the screen item.
bool Ringleader;
* Returns if the enemy is a 'ringleader'.
/************************************************************************************************************/
//////////////
/// Link ///
//////////////
int Animation;
* Link;s Animation style, as set in Quest->Graphics->Sprites->Link
int WalkASpeed;
* Link's Walking Animation speed as set in Quest->Graphics->Sprites->Link
int SwimASpeed;
* Link's Swiming Animation speed as set in Quest->Graphics->Sprites->Link
int InvFrames;
* This returns how long Link will remain invincible, 0 if not invincible. Can be set.
bool InvFlicker;
* If set false, Link will neither flash, nor flicker when invincible.
int HurtSound;
* The sound that plays when Link is injured. By default this is '16', but you may change it at any time.
int HitHeight;
* link's Hitbox height in pixels starting from his 0x,0y (upper-left) corner, going down.
int HitWidth;
* Link's Hitbox width in pixels starting from his x0,y0 (upper-left) corner, going right.
int HitXOffset;
* The X offset of Link's hitbox, or collision rectangle.
int HitYOffset;
* The Y offset of Link's hitbox, or collision rectangle.
int Eaten;
* It returns 0 if Link is not eaten, otherwise it returns the duration of him being eaten.
int Equipment;
* Link->Equipment is now read-write, and needs testing.
int ItemA;
* Contains the item IDs of what is currently equiped to Link's A button.
int ItemB;
* Contains the item IDs of what is currently equiped to Link's B button.
int SetItemSlot(int itm_id, bool a_button, bool force);
* This allows you to set Link's button items without binary operation. Needs testing. , and to decide whether to
int Extend;
* Sets the extend value for all of Link's various actions.
int GetLinkExtend(int sprite, int dir);
* Gets the extend value for one of Link's various actions based on a direction.
void SetLinkExtend(int sprite, int dir, int extend);
* Sets the extend value for one of Link's various actions.
void SetLinkTile(int sprite, int tile, int dir)
* Sets the tile for Link's various actions. This is intended to work as OTile for Link. Unverified.
int GetLinkTile(int sprite, int dir)
* Returns the OTile for one of Link's various actions. Unverified.
int WalkTile, SwimTile, DiveTile, SlashTile, JumpTile, ChargeTile, StabTile, CastingTile, PoundTile, FloatTile
Hold1LandTile, Hold2LandTile, Hold1WaterTile, Hold2WaterTile;
* A series of fourteen individual setter/getter ints to set or return the tile for all of Link's various actions.
int WarpEffect;
* Sets a warp effect type prior to doing Screen->Warp
int WarpSound;
* Setting this to a value other than '0' will play that sound when Link warps.
bool SideWarpSounds;
* If you enable this setting, the warp sound will play in side warps.
bool PitWarpSounds;
* If you enable this setting, the warp sound will play in a pit warp, one time.
int UseWarpReturn;
* Setting this to a value between 0 and 3 will change the target return square for Link->Warp
int UsingItem;
* Returns the ID of an item used when Link uses an item. Returns -1 if Link is not using an item this frame.
int UsingItemA;
* Returns the ID of an item used when Link uses an item on button A. Returns -1 if Link is not using an item this frame.
int UsingItemB;
* Returns the ID of an item used when Link uses an item on button B. Returns -1 if Link is not using an item this frame.
bool Diagonal;
* This corresponds to whether 'Diagonal Movement' is enabled, or not.
bool BigHitbox;
* This corresponds to whether 'Big Hitbox' is enabled, or not.
float Misc[32];
* Expanded from [16] to [32]. An array of 32 miscellaneous variables for you to use as you please.
/************************************************************************************************************/
//////////////////
/// itemdata ///
//////////////////
int GetPointer(itemdata *ptr[]);
* Returns the pointer of a itemdata array as a float.
itemdata SetPointer(int value);
* Converts an int pointer to the itemdata type, for assigning.
int ID;
* Returns the item number of the item in question.
int Modifier;
* The Link Tile Modifier
int Tile;
* The tile used by the item.
int CSet;
* The CSet of the tile used by the item.
int Flash;
* The Flash value for the CSet
int AFrames;
* The number of animation frames in the item's tile animation.
int ASpeed;
* The speed of the item's animation.
int Delay;
* The Delay value, before the animation begins.
int Script;
* The Action Script for the item.
int PScript;
* The Pickup Script for the item.
int MagicCost;
* The item's maic (or rupees, if this is set) cost.
int MinHearts;
* The minimum number of hearts required to pick up the item.
int Attributes[10]
* An array of ten integers that correspond to the ten <Misc> text entries on the item editor Data tab.
int Sprites[10]
* An array of ten integers that correspond to the ten sprite pulldowns on the item editor Action tab.
bool Flags[5]
* An array of five boolean flags that correspond to the five flag tickboxes on the item editor Data tab.
int Misc1, Misc2, Misc3, Misc4, Misc5, Misc6, Misc7, Misc8, Misc9, Misc10;
* These correspond to the pull-down options in the item editor 'Data' tab.
int Attribute1, Attribute2, Attribute3, Attribute4, Attribute5, Attribute6,
Attribute7, Attribute8, Attribute9, Attribute10;
* These correspond to the pull-down options in the item editor 'Action' tab.
bool Combine;
* Corresponds to 'Upgrade when collected twice'.
bool Downgrade;
* Corresponds to the 'Remove When Used' option on the Action tab of the item editor.
bool KeepOld;
* Corresponds to 'Keep lower level items on the Pickup tab of the item editor.
bool RupeeCost;
* Corresponds to the 'Use Rupees Instead of Magic' option on the item editor 'Action' tab.
bool Edible;
* Corresponds to the 'Can be Eaten by Enemies' box on the Pickup tab of the item editor.
bool GainLower;
* Corresponds to the 'Gain All Lower Level Items' box on the Pickup tab of the item editor.
bool Flag1;
* This corresponds to the box directly below 'Equiment Item'. For swords, this is 'B.H. is Percent'.
bool Flag2;
* This corresponds to the box directly below 'Flag 1, or two boxes down from 'Equiment Item'.
* For swords, this is 'B.D. is Percent'.
bool Flag3;
* This corresponds to the box directly right of 'Equiment Item'. For swords, this is 'B. Penetrates Enemies'.
bool Flag4;
* This corresponds to the box directly right of 'Flag 2'. For swords, this is 'Can Slash'.
bool Flag5;
* This corresponds to the box directly below 'Flag 4'. For swords, this is '<Unused>', and greyed out.
bool Unused;
* ? - An extra script-only flag. It's a mystery to everyone.
/************************************************************************************************************/
////////////
/// npc ///
////////////
float UID;
* Returns the UID of an npc.
int GetPointer(npc *ptr[]);
* Returns the pointer of a item array as a float.
npc SetPointer(int value);
* Converts an int pointer to the npc type, for assigning.
int InvFrames;
* Returns if the enemy is temporarily invincible, from being hit, or otherwise.
int Invincible;
* Returns if the enemy is invincible, because of ( superman variable ).
bool Ringleader;
* Returns if the enemy is a 'ringleader'.
bool HasItem;
* Returns if the enemy is holding the screen item.
float Misc[32];
* Epanded fron a size of [16] to [32]. An array of 32 miscellaneous variables for you to use as you please.
/************************************************************************************************************/
////////////////
/// Screen ///
////////////////
void WavyIn();
* Replicates the warping screen wave effect (inbound) from a tile warp.
void WavyOut();
* Replicates the warping screen wave effect (outbound) from a tile warp.
void ZapIn();
* Replicates the warping screen zap effect (inbound) from a tile warp.
void ZapOut();
* Replicates the warping screen zap effect (outbound) from a tile warp.
void OpeningWipe();
* Replicates the opening wipe screen effect (using the quest rule for its type) from a tile warp.
void DrawBitmapEx ( int layer,
int bitmap_id,
int source_x, int source_y, int source_w, int source_h,
int dest_x, int dest_y, int dest_w, int dest_h,
float rotation, int cx, int cy, int mode, int lit, bool mask);
* As DrawBitmap(), except that it can do more things.
/************************************************************************************************************/
Game->DEBUGGING: These might find their way into namespace Debug-> instead of Game-> in the future.
/************************************************************************************************************/
int RefFFC; ZASM Instruction:
REFFFC
/**
* Returns the present ffc refrence from the stack. FOR DEBUGGING ONLY!
* THIS WILL BE DISABLED IN RELEASE BUILDS !
*/ Example Use:
/************************************************************************************************************/
int RefItem; ZASM Instruction:
REFITEM
/**
* Returns the present item refrence from the stack. FOR DEBUGGING ONLY!
* THIS WILL BE DISABLED IN RELEASE BUILDS !
*/ Example Use:
/************************************************************************************************************/
int RefItemdata; ZASM Instruction:
REFIDATA
/**
* Returns the present itemdata refrence from the stack. FOR DEBUGGING ONLY!
* THIS WILL BE DISABLED IN RELEASE BUILDS !
*/ Example Use:
/************************************************************************************************************/
int RefLWeapon; ZASM Instruction:
REFLWPN
/**
* Returns the present lweapon refrence from the stack. FOR DEBUGGING ONLY!
* THIS WILL BE DISABLED IN RELEASE BUILDS !
*/ Example Use:
/************************************************************************************************************/
int RefEWeapon; ZASM Instruction:
REFEWPN
/**
* Returns the present eweapon refrence from the stack. FOR DEBUGGING ONLY!
* THIS WILL BE DISABLED IN RELEASE BUILDS !
*/ Example Use:
/************************************************************************************************************/
int RefNPC; ZASM Instruction:
REFNPC
/**
* Returns the present npc refrence from the stack. FOR DEBUGGING ONLY!
* THIS WILL BE DISABLED IN RELEASE BUILDS !
*/ Example Use:
/************************************************************************************************************/
int SP; ZASM Instruction:
SP
/**
* Returns the value of the stack pointer. FOR DEBUGGING ONLY!
* THIS WILL BE DISABLED IN RELEASE BUILDS !
*/ Example Use:
////////////////////////
/// Not Implemented ///
////////////////////////
BitmapQuad
//sdci[1]=layer
//sdci[2]=x1
//sdci[3]=y1
//sdci[4]=x2
//sdci[5]=y2
//sdci[6]=x3
//sdci[7]=y3
//sdci[8]=x4
//sdci[9]=y4
//sdci[10]=sourcex
//sdci[11]=sourcey
//sdci[12]=sourcew
//sdci[13]=sourceh
//sdci[14]=width
//sdci[15]=height
//sdci[16]=tile/combo
//sdci[17]=polytype
void ComboArray ( int layer, int number_of_combos,
int combos[],
int x_positions[],
int y_positions[],
int csets[]);
ZASM: COMBOARRAY
/**
*
* Draws a number of combos specified by 'number_of_combos' to 'layer'.
* Specify the combos by populating an array with their IDs and passing the array ointer to 'combos'.
* Specify the X coordinate for each by passing an array with their x coordinates to 'x_positions'.
* Specify the Y coordinate for each by passing an array with their y coordinates to 'y_positions'.
* Specify the CSet for each by passing an array with their csets to 'csets'.
*
* This function counts as a single draw.
*
* Transparency is not yet imlemented, but you may draw to a bitmap and render it translucent.
*// Example:
int combos[4] = {16,19,31,20};
int cmbx[4]= {0, 16, 32, 48}:
int cmby[4]={8, 8, 8, 8);
int cmbc[4]={0,0,0,0};
Screen->ComboArray(6, 4, combos, cmbx, cmby, cmbc);
/************************************************************************************************************/
//! This new mode does not work as intended, and will likely be deprecated by Screen->SetRenderSource
void Quad ( int layer,
int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4,
int w, int h, int cset, int flip, int texture, int render_mode);
ZASM Instruction:
QUADR
/**
* Draws a quad on the specified layer with the corners x1,y1 through x4,y4.
* Corners are drawn in a counterclockwise order starting from x1,y1. ( So
* if you draw a "square" for example starting from the bottom-right corner
* instead of the usual top-left, the the image will be textured onto the
* quad so it appears upside-down. -yes, these are rotatable. )
*
* From there a single or block of tiles, combos **or a bitmap** is then texture mapped
* onto the quad using the arguments w, h, cset, flip, and render_mode.
* A positive vale in texture will draw the image from the tilesheet pages,
* whereas a negative value will be drawn from the combo page. 0 will draw combo number 0.
* Both w and h are undefined unless 1 <= blockh, blockw <= 16, and it is a power of
* two. ie: 1, 2 are acceptable, but 2, 15 are not.
*
* To specify a bitmap as a texture, sum 65520 with the bitmap ID, or use the constant TEX_BITMAP + Bitmap
* Example: Screen->Quad(6, 0, 0, 40, 25, 18, 50, 60, 110, 0, 0, 0, 0, TEX_BITMAP+RT_BITMAP0, PT_TEXTURE);
*
*
* Flip specifies how the tiles/combos should be flipped when drawn:
* 0: No flip
* 1: Horizontal flip
* 2: Vertical flip
* 3: Both (180 degree rotation)
* (!) See std.zh for a list of all available render_mode arguments.
*/ Example Use: !#!
void TileArray ( int layer, int number_of_tiles,
int tiles[],
int x_positions[],
int y_positions[],
int csets[]);
ZASM: TILEARRAY
/**
*
* Draws a number of tiles specified by 'number_of_tiles' to 'layer'.
* Specify the tiles by populating an array with their IDs and passing the array ointer to 'tiles'.
* Specify the X coordinate for each by passing an array with their x coordinates to 'x_positions'.
* Specify the Y coordinate for each by passing an array with their y coordinates to 'y_positions'.
* Specify the CSet for each by passing an array with their csets to 'csets'.
*
* This function counts as a single draw.
*
* Transparency is not yet imlemented, but you may draw to a bitmap and render it translucent.
*// Example:
int tiles[4] = {16,19,31,20};
int tilx[4]= {0, 16, 32, 48}:
int tily[4]={8, 8, 8, 8);
int tilc[4]={0,0,0,0};
Screen->TileArray(6, 4, tiles, tilx, tily, tilc);
/************************************************************************************************************/
void PixelArray ( int layer, int number_of_pixels,
int x_positions[],
int y_positions[],
int colours[]);
ZASM: PIXELARRAY
/**
*
* Draws a number of pixel, similar to PutPixel, specified by 'number_of_pixels' to 'layer'.
* Specify the X coordinate for each by passing an array with their x coordinates to 'x_positions'.
* Specify the Y coordinate for each by passing an array with their y coordinates to 'y_positions'.
* Specify the colour for each by passing an array with their csets to 'colours'.
*
* This function counts as a single draw.
*
* Transparency is not yet imlemented, but you may draw to a bitmap and render it translucent.
*// Example:
int pix[4] = {16,19,31,20};
int px[4]= {0, 16, 32, 48}:
int py[4]={8, 8, 8, 8);
int pc[4]={0x12,0xB0,0xDA,0x4F};
Screen->TileArray(6, 4, pix, px, py, pc);
/************************************************************************************************************/
CreateBitmap(int id, int xsize, int ysize)
* Min size 1, max 2048
/************************************************************************************************************/
SetRenderSource(int target, int x, int y, int w, int h)
/************************************************************************************************************/
void Polygon ( int layer, ... );
ZASM: POLYGON
* Adding to Beta 9 : Postponed -Z
/************************************************************************************************************/
// Game->
//! These do not yet work:
//Returns Screen->Door[index] for a given DMap and Screen
int GetDMapScreenDoor( int dmap, int screen, int index )
//Sets Screen->Door[index] for a given DMap and Screen to 'value'
void SetDMapScreenDoor( int dmap, int screen, int index, int value)
//Returns Screen->State[index] for a given DMap and Screen
bool GetDMapScreenState( int dmap, int screen, int index )
//Sets Screen->State[index] for a given DMap and Screen to 'value'
void SetDMapScreenState( int dmap, int screen, int index, bool value)
/************************************************************************************************************/