/
base.txt
806 lines (715 loc) · 22.9 KB
/
base.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
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
struct _ native // These are the global variables, the struct is only here to avoid extending the parser for this.
{
native readonly Array<class<Actor> > AllActorClasses;
native readonly Array<@PlayerClass> PlayerClasses;
native readonly Array<@PlayerSkin> PlayerSkins;
native readonly Array<@Team> Teams;
native int validcount;
native readonly bool multiplayer;
native play @LevelLocals level;
native @KeyBindings Bindings;
native @KeyBindings AutomapBindings;
native play @DehInfo deh;
native readonly @GameInfoStruct gameinfo;
native play @PlayerInfo players[MAXPLAYERS];
native readonly bool playeringame[MAXPLAYERS];
native readonly bool automapactive;
native play uint gameaction;
native readonly int gamestate;
native readonly TextureID skyflatnum;
native readonly uint8 globalfreeze;
native readonly int consoleplayer;
native readonly Font smallfont;
native readonly Font smallfont2;
native readonly Font bigfont;
native readonly Font confont;
native readonly Font intermissionfont;
native readonly int CleanXFac;
native readonly int CleanYFac;
native readonly int CleanWidth;
native readonly int CleanHeight;
native readonly int CleanXFac_1;
native readonly int CleanYFac_1;
native readonly int CleanWidth_1;
native readonly int CleanHeight_1;
native ui int menuactive;
native readonly @FOptionMenuSettings OptionMenuSettings;
native readonly int gametic;
native readonly bool demoplayback;
native ui int BackbuttonTime;
native ui float BackbuttonAlpha;
native readonly int Net_Arbitrator;
native ui BaseStatusBar StatusBar;
native readonly Weapon WP_NOCHANGE;
native int LocalViewPitch;
}
struct TexMan
{
enum EUseTypes
{
Type_Any,
Type_Wall,
Type_Flat,
Type_Sprite,
Type_WallPatch,
Type_Build,
Type_SkinSprite,
Type_Decal,
Type_MiscPatch,
Type_FontChar,
Type_Override, // For patches between TX_START/TX_END
Type_Autopage, // Automap background - used to enable the use of FAutomapTexture
Type_SkinGraphic,
Type_Null,
Type_FirstDefined,
};
enum EFlags
{
TryAny = 1,
Overridable = 2,
ReturnFirst = 4,
AllowSkins = 8,
ShortNameOnly = 16,
DontCreate = 32
};
enum ETexReplaceFlags
{
NOT_BOTTOM = 1,
NOT_MIDDLE = 2,
NOT_TOP = 4,
NOT_FLOOR = 8,
NOT_CEILING = 16,
NOT_WALL = 7,
NOT_FLAT = 24
};
native static TextureID CheckForTexture(String name, int usetype, int flags = TryAny);
native static void ReplaceTextures(String from, String to, int flags);
native static int, int GetSize(TextureID tex);
native static Vector2 GetScaledSize(TextureID tex);
native static Vector2 GetScaledOffset(TextureID tex);
native static int CheckRealHeight(TextureID tex);
native static void SetCameraToTexture(Actor viewpoint, String texture, double fov);
}
enum DrawTextureTags
{
TAG_USER = (1<<30),
DTA_Base = TAG_USER + 5000,
DTA_DestWidth, // width of area to draw to
DTA_DestHeight, // height of area to draw to
DTA_Alpha, // alpha value for translucency
DTA_FillColor, // color to stencil onto the destination (RGB is the color for truecolor drawers, A is the palette index for paletted drawers)
DTA_TranslationIndex, // translation table to recolor the source
DTA_AlphaChannel, // bool: the source is an alpha channel; used with DTA_FillColor
DTA_Clean, // bool: scale texture size and position by CleanXfac and CleanYfac
DTA_320x200, // bool: scale texture size and position to fit on a virtual 320x200 screen
DTA_Bottom320x200, // bool: same as DTA_320x200 but centers virtual screen on bottom for 1280x1024 targets
DTA_CleanNoMove, // bool: like DTA_Clean but does not reposition output position
DTA_CleanNoMove_1, // bool: like DTA_CleanNoMove, but uses Clean[XY]fac_1 instead
DTA_FlipX, // bool: flip image horizontally //FIXME: Does not work with DTA_Window(Left|Right)
DTA_ShadowColor, // color of shadow
DTA_ShadowAlpha, // alpha of shadow
DTA_Shadow, // set shadow color and alphas to defaults
DTA_VirtualWidth, // pretend the canvas is this wide
DTA_VirtualHeight, // pretend the canvas is this tall
DTA_TopOffset, // override texture's top offset
DTA_LeftOffset, // override texture's left offset
DTA_CenterOffset, // bool: override texture's left and top offsets and set them for the texture's middle
DTA_CenterBottomOffset,// bool: override texture's left and top offsets and set them for the texture's bottom middle
DTA_WindowLeft, // don't draw anything left of this column (on source, not dest)
DTA_WindowRight, // don't draw anything at or to the right of this column (on source, not dest)
DTA_ClipTop, // don't draw anything above this row (on dest, not source)
DTA_ClipBottom, // don't draw anything at or below this row (on dest, not source)
DTA_ClipLeft, // don't draw anything to the left of this column (on dest, not source)
DTA_ClipRight, // don't draw anything at or to the right of this column (on dest, not source)
DTA_Masked, // true(default)=use masks from texture, false=ignore masks
DTA_HUDRules, // use fullscreen HUD rules to position and size textures
DTA_HUDRulesC, // only used internally for marking HUD_HorizCenter
DTA_KeepRatio, // doesn't adjust screen size for DTA_Virtual* if the aspect ratio is not 4:3
DTA_RenderStyle, // same as render style for actors
DTA_ColorOverlay, // DWORD: ARGB to overlay on top of image; limited to black for software
DTA_Internal1,
DTA_Internal2,
DTA_Internal3,
DTA_Fullscreen, // Draw image fullscreen (same as DTA_VirtualWidth/Height with graphics size.)
// floating point duplicates of some of the above:
DTA_DestWidthF,
DTA_DestHeightF,
DTA_TopOffsetF,
DTA_LeftOffsetF,
DTA_VirtualWidthF,
DTA_VirtualHeightF,
DTA_WindowLeftF,
DTA_WindowRightF,
// For DrawText calls only:
DTA_TextLen, // stop after this many characters, even if \0 not hit
DTA_CellX, // horizontal size of character cell
DTA_CellY, // vertical size of character cell
};
struct Screen native
{
native static Color PaletteColor(int index);
native static int GetWidth();
native static int GetHeight();
native static void Clear(int left, int top, int right, int bottom, Color color, int palcolor = -1);
native static void Dim(Color col, double amount, int x, int y, int w, int h);
native static vararg void DrawTexture(TextureID tex, bool animate, double x, double y, ...);
native static vararg void DrawChar(Font font, int normalcolor, double x, double y, int character, ...);
native static vararg void DrawText(Font font, int normalcolor, double x, double y, String text, ...);
native static void DrawFrame(int x, int y, int w, int h);
native static Vector2, Vector2 VirtualToRealCoords(Vector2 pos, Vector2 size, Vector2 vsize, bool vbottom=false, bool handleaspect=true);
native static double GetAspectRatio();
native static void SetClipRect(int x, int y, int w, int h);
native static void ClearClipRect();
native static int, int, int, int GetClipRect();
// This is a leftover of the abandoned Inventory.DrawPowerup method.
deprecated("2.5") static ui void DrawHUDTexture(TextureID tex, double x, double y)
{
statusBar.DrawTexture(tex, (x, y), BaseStatusBar.DI_SCREEN_RIGHT_TOP, 1., (32, 32));
}
}
struct Font native
{
enum EColorRange
{
CR_UNDEFINED = -1,
CR_BRICK,
CR_TAN,
CR_GRAY,
CR_GREY = CR_GRAY,
CR_GREEN,
CR_BROWN,
CR_GOLD,
CR_RED,
CR_BLUE,
CR_ORANGE,
CR_WHITE,
CR_YELLOW,
CR_UNTRANSLATED,
CR_BLACK,
CR_LIGHTBLUE,
CR_CREAM,
CR_OLIVE,
CR_DARKGREEN,
CR_DARKRED,
CR_DARKBROWN,
CR_PURPLE,
CR_DARKGRAY,
CR_CYAN,
CR_ICE,
CR_FIRE,
CR_SAPPHIRE,
CR_TEAL,
NUM_TEXT_COLORS
};
const TEXTCOLOR_BRICK = "\034A";
const TEXTCOLOR_TAN = "\034B";
const TEXTCOLOR_GRAY = "\034C";
const TEXTCOLOR_GREY = "\034C";
const TEXTCOLOR_GREEN = "\034D";
const TEXTCOLOR_BROWN = "\034E";
const TEXTCOLOR_GOLD = "\034F";
const TEXTCOLOR_RED = "\034G";
const TEXTCOLOR_BLUE = "\034H";
const TEXTCOLOR_ORANGE = "\034I";
const TEXTCOLOR_WHITE = "\034J";
const TEXTCOLOR_YELLOW = "\034K";
const TEXTCOLOR_UNTRANSLATED = "\034L";
const TEXTCOLOR_BLACK = "\034M";
const TEXTCOLOR_LIGHTBLUE = "\034N";
const TEXTCOLOR_CREAM = "\034O";
const TEXTCOLOR_OLIVE = "\034P";
const TEXTCOLOR_DARKGREEN = "\034Q";
const TEXTCOLOR_DARKRED = "\034R";
const TEXTCOLOR_DARKBROWN = "\034S";
const TEXTCOLOR_PURPLE = "\034T";
const TEXTCOLOR_DARKGRAY = "\034U";
const TEXTCOLOR_CYAN = "\034V";
const TEXTCOLOR_ICE = "\034W";
const TEXTCOLOR_FIRE = "\034X";
const TEXTCOLOR_SAPPHIRE = "\034Y";
const TEXTCOLOR_TEAL = "\034Z";
const TEXTCOLOR_NORMAL = "\034-";
const TEXTCOLOR_BOLD = "\034+";
const TEXTCOLOR_CHAT = "\034*";
const TEXTCOLOR_TEAMCHAT = "\034!";
native int GetCharWidth(int code);
native int StringWidth(String code);
native int GetHeight();
native String GetCursor();
native static int FindFontColor(Name color);
native static Font FindFont(Name fontname);
native static Font GetFont(Name fontname);
native BrokenLines BreakLines(String text, int maxlen);
}
struct Translation version("2.4")
{
Color colors[256];
native int AddTranslation();
native static bool SetPlayerTranslation(int group, int num, int plrnum, PlayerClass pclass);
native static int GetID(Name transname);
static int MakeID(int group, int num)
{
return (group << 16) + num;
}
}
struct Console native
{
native static void HideConsole();
native static void MidPrint(Font fontname, string textlabel, bool bold = false);
native static vararg void Printf(string fmt, ...);
}
struct DamageTypeDefinition native
{
native static bool IgnoreArmor(Name type);
}
struct CVar native
{
enum ECVarType
{
CVAR_Bool,
CVAR_Int,
CVAR_Float,
CVAR_String,
CVAR_Color,
};
native static CVar FindCVar(Name name);
native static CVar GetCVar(Name name, PlayerInfo player = null);
native bool GetBool();
native int GetInt();
native double GetFloat();
native String GetString();
native void SetBool(bool b);
native void SetInt(int v);
native void SetFloat(double v);
native void SetString(String s);
native int GetRealType();
native int ResetToDefault();
}
struct GIFont version("2.4")
{
Name fontname;
Name color;
};
struct GameInfoStruct native
{
// will be extended as needed.
native Name backpacktype;
native double Armor2Percent;
native String ArmorIcon1;
native String ArmorIcon2;
native int gametype;
native bool norandomplayerclass;
native Array<Name> infoPages;
native String mBackButton;
native GIFont mStatscreenMapNameFont;
native GIFont mStatscreenEnteringFont;
native GIFont mStatscreenFinishedFont;
native double gibfactor;
native bool intermissioncounter;
native Name mSliderColor;
}
class Object native
{
native bool bDestroyed;
// These really should be global functions...
native static String G_SkillName();
native static int G_SkillPropertyInt(int p);
native static double G_SkillPropertyFloat(int p);
native static vector3, int G_PickDeathmatchStart();
native static vector3, int G_PickPlayerStart(int pnum, int flags = 0);
native static void S_Sound (Sound sound_id, int channel, float volume = 1, float attenuation = ATTN_NORM);
native static void S_PauseSound (bool notmusic, bool notsfx);
native static void S_ResumeSound (bool notsfx);
native static bool S_ChangeMusic(String music_name, int order = 0, bool looping = true, bool force = false);
native static uint BAM(double angle);
native static void SetMusicVolume(float vol);
native static uint MSTime();
native vararg static void ThrowAbortException(String fmt, ...);
native virtualscope void Destroy();
// This does not call into the native method of the same name to avoid problems with objects that get garbage collected late on shutdown.
virtual virtualscope void OnDestroy() {}
}
class BrokenLines : Object native version("2.4")
{
native int Count();
native int StringWidth(int line);
native String StringAt(int line);
}
class Thinker : Object native play
{
enum EStatnums
{
// Thinkers that don't actually think
STAT_INFO, // An info queue
STAT_DECAL, // A decal
STAT_AUTODECAL, // A decal that can be automatically deleted
STAT_CORPSEPOINTER, // An entry in Hexen's corpse queue
STAT_TRAVELLING, // An actor temporarily travelling to a new map
STAT_STATIC,
// Thinkers that do think
STAT_FIRST_THINKING=32,
STAT_SCROLLER=STAT_FIRST_THINKING, // A DScroller thinker
STAT_PLAYER, // A player actor
STAT_BOSSTARGET, // A boss brain target
STAT_LIGHTNING, // The lightning thinker
STAT_DECALTHINKER, // An object that thinks for a decal
STAT_INVENTORY, // An inventory item
STAT_LIGHT, // A sector light effect
STAT_LIGHTTRANSFER, // A sector light transfer. These must be ticked after the light effects.
STAT_EARTHQUAKE, // Earthquake actors
STAT_MAPMARKER, // Map marker actors
STAT_DLIGHT, // Dynamic lights
STAT_USER = 70,
STAT_USER_MAX = 90,
STAT_DEFAULT = 100, // Thinkers go here unless specified otherwise.
STAT_SECTOREFFECT, // All sector effects that cause floor and ceiling movement
STAT_ACTORMOVER, // actor movers
STAT_SCRIPTS, // The ACS thinker. This is to ensure that it can't tick before all actors called PostBeginPlay
STAT_BOT, // Bot thinker
MAX_STATNUM = 127
}
const TICRATE = 35;
virtual native void Tick();
virtual native void PostBeginPlay();
virtual native void ChangeStatNum(int stat);
static clearscope int Tics2Seconds(int tics)
{
// This compensates for one tic being slightly less than 1/35 of a second.
return int(tics * (0.98 / TICRATE));
}
}
class ThinkerIterator : Object native
{
native static ThinkerIterator Create(class<Object> type = "Actor", int statnum=Thinker.MAX_STATNUM+1);
native Thinker Next(bool exact = false);
native void Reinit();
}
class ActorIterator : Object native
{
native static ActorIterator Create(int tid, class<Actor> type = "Actor");
native Actor Next();
native void Reinit();
}
class BlockThingsIterator : Object native
{
native Actor thing;
native Vector3 position;
native int portalflags;
native static BlockThingsIterator Create(Actor origin, double checkradius = -1, bool ignorerestricted = false);
native static BlockThingsIterator CreateFromPos(double checkx, double checky, double checkz, double checkh, double checkradius, bool ignorerestricted);
native bool Next();
}
class BlockLinesIterator : Object native
{
native Line CurLine;
native Vector3 position;
native int portalflags;
native static BlockLinesIterator Create(Actor origin, double checkradius = -1);
native static BlockLinesIterator CreateFromPos(Vector3 pos, double checkh, double checkradius, Sector sec = null);
native bool Next();
}
struct DropItem native
{
native readonly DropItem Next;
native readonly name Name;
native readonly int Probability;
native readonly int Amount;
}
class SpotState : Object native
{
native static SpotState GetSpotState();
native SpecialSpot GetNextInList(class<Actor> type, int skipcounter);
native SpecialSpot GetSpotWithMinMaxDistance(Class<Actor> type, double x, double y, double mindist, double maxdist);
}
struct LevelLocals native
{
enum EUDMF
{
UDMF_Line,
UDMF_Side,
UDMF_Sector,
//UDMF_Thing // not implemented
};
native Array<@Sector> Sectors;
native Array<@Line> Lines;
native Array<@Side> Sides;
native readonly Array<@Vertex> Vertexes;
native Array<@SectorPortal> SectorPortals;
native readonly int time;
native readonly int maptime;
native readonly int totaltime;
native readonly int starttime;
native readonly int partime;
native readonly int sucktime;
native readonly int cluster;
native readonly int clusterflags;
native readonly int levelnum;
native readonly String LevelName;
native readonly String MapName;
native String NextMap;
native String NextSecretMap;
native String F1Pic;
native readonly int maptype;
native readonly String Music;
native readonly int musicorder;
native int total_secrets;
native int found_secrets;
native int total_items;
native int found_items;
native int total_monsters;
native int killed_monsters;
native play double gravity;
native play double aircontrol;
native play double airfriction;
native play int airsupply;
native readonly double teamdamage;
native readonly bool noinventorybar;
native readonly bool monsterstelefrag;
native readonly bool actownspecial;
native readonly bool sndseqtotalctrl;
native bool allmap;
native readonly bool missilesactivateimpact;
native readonly bool monsterfallingdamage;
native readonly bool checkswitchrange;
native readonly bool polygrind;
native readonly bool nomonsters;
native readonly bool allowrespawn;
native bool frozen;
native readonly bool infinite_flight;
native readonly bool no_dlg_freeze;
native readonly int fogdensity;
native readonly int outsidefogdensity;
native readonly int skyfog;
// level_info_t *info cannot be done yet.
native String GetUDMFString(int type, int index, Name key);
native int GetUDMFInt(int type, int index, Name key);
native double GetUDMFFloat(int type, int index, Name key);
native bool ExecuteSpecial(int special, Actor activator, line linedef, bool lineside, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0, int arg5 = 0);
native static void GiveSecret(Actor activator, bool printmsg = true, bool playsound = true);
native static void StartSlideshow(Name whichone = 'none');
native static void WorldDone();
native static void RemoveAllBots(bool fromlist);
native void SetInterMusic(String nextmap);
native String FormatMapName(int mapnamecolor);
native bool IsJumpingAllowed() const;
native bool IsCrouchingAllowed() const;
native bool IsFreelookAllowed() const;
String TimeFormatted(bool totals = false)
{
int sec = Thinker.Tics2Seconds(totals? totaltime : time);
return String.Format("%02d:%02d:%02d", sec / 3600, (sec % 3600) / 60, sec % 60);
}
}
struct StringTable native
{
native static String Localize(String val, bool prefixed = true);
}
// a few values of this need to be readable by the play code.
// Most are handled at load time and are omitted here.
struct DehInfo native
{
native int MaxSoulsphere;
native uint8 ExplosionStyle;
native double ExplosionAlpha;
native int NoAutofreeze;
native int BFGCells;
native int BlueAC;
}
struct State native
{
native State NextState;
native int sprite;
native int16 Tics;
native uint16 TicRange;
native uint8 Frame;
native uint8 UseFlags;
native int Misc1;
native int Misc2;
native uint16 bSlow;
native uint16 bFast;
native bool bFullbright;
native bool bNoDelay;
native bool bSameFrame;
native bool bCanRaise;
native bool bDehacked;
native int DistanceTo(state other);
native bool ValidateSpriteFrame();
native TextureID, bool, Vector2 GetSpriteTexture(int rotation, int skin = 0, Vector2 scale = (0,0));
}
struct F3DFloor native
{
}
struct Wads
{
enum WadNamespace
{
ns_hidden = -1,
ns_global = 0,
ns_sprites,
ns_flats,
ns_colormaps,
ns_acslibrary,
ns_newtextures,
ns_bloodraw,
ns_bloodsfx,
ns_bloodmisc,
ns_strifevoices,
ns_hires,
ns_voxels,
ns_specialzipdirectory,
ns_sounds,
ns_patches,
ns_graphics,
ns_music,
ns_firstskin,
}
native static int CheckNumForName(string name, int ns, int wadnum = -1, bool exact = false);
}
struct TerrainDef native
{
native Name TerrainName;
native int Splash;
native int DamageAmount;
native Name DamageMOD;
native int DamageTimeMask;
native double FootClip;
native float StepVolume;
native int WalkStepTics;
native int RunStepTics;
native Sound LeftStepSound;
native Sound RightStepSound;
native bool IsLiquid;
native bool AllowProtection;
native double Friction;
native double MoveFactor;
};
enum EPickStart
{
PPS_FORCERANDOM = 1,
PPS_NOBLOCKINGCHECK = 2,
}
// Although String is a builtin type, this is a convenient way to attach methods to it.
struct StringStruct native
{
native static vararg String Format(String fmt, ...);
native vararg void AppendFormat(String fmt, ...);
native void Replace(String pattern, String replacement);
native String Left(int len) const;
native String Mid(int pos = 0, int len = 2147483647) const;
native void Truncate(int newlen);
native String CharAt(int pos) const;
native int CharCodeAt(int pos) const;
native String Filter();
native int IndexOf(String substr, int startIndex = 0) const;
native int LastIndexOf(String substr) const;
native void ToUpper();
native void ToLower();
native int ToInt(int base = 0) const;
native double ToDouble() const;
}
class SectorEffect : Thinker native
{
native protected Sector m_Sector;
}
class Mover : SectorEffect native
{}
class MovingFloor : Mover native
{}
class MovingCeiling : Mover native
{}
class Floor : MovingFloor native
{
// only here so that some constants and functions can be added. Not directly usable yet.
enum EFloor
{
floorLowerToLowest,
floorLowerToNearest,
floorLowerToHighest,
floorLowerByValue,
floorRaiseByValue,
floorRaiseToHighest,
floorRaiseToNearest,
floorRaiseAndCrush,
floorRaiseAndCrushDoom,
floorCrushStop,
floorLowerInstant,
floorRaiseInstant,
floorMoveToValue,
floorRaiseToLowestCeiling,
floorRaiseByTexture,
floorLowerAndChange,
floorRaiseAndChange,
floorRaiseToLowest,
floorRaiseToCeiling,
floorLowerToLowestCeiling,
floorLowerByTexture,
floorLowerToCeiling,
donutRaise,
buildStair,
waitStair,
resetStair,
// Not to be used as parameters to DoFloor()
genFloorChg0,
genFloorChgT,
genFloorChg
};
native static bool CreateFloor(sector sec, EFloor floortype, line ln, double speed, double height = 0, int crush = -1, int change = 0, bool crushmode = false, bool hereticlower = false);
}
class Ceiling : MovingCeiling native
{
enum ECeiling
{
ceilLowerByValue,
ceilRaiseByValue,
ceilMoveToValue,
ceilLowerToHighestFloor,
ceilLowerInstant,
ceilRaiseInstant,
ceilCrushAndRaise,
ceilLowerAndCrush,
ceil_placeholder,
ceilCrushRaiseAndStay,
ceilRaiseToNearest,
ceilLowerToLowest,
ceilLowerToFloor,
// The following are only used by Generic_Ceiling
ceilRaiseToHighest,
ceilLowerToHighest,
ceilRaiseToLowest,
ceilLowerToNearest,
ceilRaiseToHighestFloor,
ceilRaiseToFloor,
ceilRaiseByTexture,
ceilLowerByTexture,
genCeilingChg0,
genCeilingChgT,
genCeilingChg
}
enum ECrushMode
{
crushDoom = 0,
crushHexen = 1,
crushSlowdown = 2
}
native bool CreateCeiling(sector sec, int type, line ln, double speed, double speed2, double height = 0, int crush = -1, int silent = 0, int change = 0, int crushmode = crushDoom);
}
struct LookExParams
{
double Fov;
double minDist;
double maxDist;
double maxHeardist;
int flags;
State seestate;
};
class Lighting : SectorEffect native
{
}
struct Shader native
{
native clearscope static void SetEnabled(PlayerInfo player, string shaderName, bool enable);
native clearscope static void SetUniform1f(PlayerInfo player, string shaderName, string uniformName, float value);
native clearscope static void SetUniform2f(PlayerInfo player, string shaderName, string uniformName, vector2 value);
native clearscope static void SetUniform3f(PlayerInfo player, string shaderName, string uniformName, vector3 value);
native clearscope static void SetUniform1i(PlayerInfo player, string shaderName, string uniformName, int value);
}