This repository has been archived by the owner on Jul 9, 2023. It is now read-only.
forked from ImaginaryVillain/community_lights
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Community_Lighting_MZ.js
4213 lines (3971 loc) · 172 KB
/
Community_Lighting_MZ.js
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
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//=============================================================================
// Community Plugins - MZ Lighting system
// Community_Lighting.js
/*=============================================================================
Forked from Terrax Lighting
=============================================================================*/
if (typeof require !== "undefined" && typeof module != "undefined") {
var {
Game_Player,
Game_Interpreter,
Game_Event,
Game_Variables,
Game_Map,
} = require("../rmmz_objects");
var {
PluginManager,
ConfigManager,
} = require("../rmmz_managers");
var { Window_Selectable, Window_Options } = require("../rmmz_windows");
var { Spriteset_Map, Spriteset_Battle } = require("../rmmz_sprites");
var { Scene_Map } = require("../rmmz_scenes");
var { Bitmap, Tilemap} = require("../rmmz_core");
}
var Community = Community || {};
Community.Lighting = Community.Lighting || {};
Community.Lighting.name = "Community_Lighting_MZ";
Community.Lighting.parameters = PluginManager.parameters(Community.Lighting.name);
Community.Lighting.version = 5.0;
var Imported = Imported || {};
Imported[Community.Lighting.name] = true;
/*:
* @target MZ
* @plugindesc v4.6 Creates an extra layer that darkens a map and adds lightsources! Released under the MIT license!
* @author Terrax, iVillain, Aesica, Eliaquim, Alexandre, Nekohime1989
*
* @param ---General Settings---
* @default
*
* @param Options Menu Entry
* @parent ---General Settings---
* @desc Adds an option to disable this plugin's lighting effects to the options menu (leave blank to omit)
* @default Lighting Effects
*
* @param Use smoother lights
* @parent ---General Settings---
* @desc Instead of looking like spotlights, the lights get blended further. Does not work on old browsers.
* @type boolean
* @default false
*
* @param Light event required
* @parent ---General Settings---
* @desc At least one light event on the current is needed to make the plugin active (as in original TerraxLighting)
* @type boolean
* @default false
*
* @param Triangular flashlight
* @parent ---General Settings---
* @desc Alternative triangular flashlight beam
* @type boolean
* @default false
*
* @param Shift lights with events
* @parent ---General Settings---
* @desc Should a light be shifted 6 pixel up if its associated event does?
* @type boolean
* @default false
*
* @param Lights Active Radius
* @parent ---Offset and Sizes---
* @desc The number of grid spaces away from the player that lights are turned on. (0 to not use this functionality)
* Default: 0
* @default 0
*
* @param Daynight Cycle
* @parent ---General Settings---
* @desc Should the tint change over time. Must also be enabled in individual maps.
* @type boolean
* @default true
*
* @param Reset Lights
* @parent ---General Settings---
* @desc Resets the conditional lights on map change
* @type boolean
* @default false
*
* @param Kill Switch
* @parent ---General Settings---
* @desc Possible values A,B,C,D. If Selfswitch X is switched ON, the event's lightsource will be disabled.
* @type select
* @option None
* @option A
* @option B
* @option C
* @option D
* @default None
*
* @param Kill Switch Auto
* @parent ---General Settings---
* @desc If a conditional light is OFF(ON), lock the Kill Switch to ON(OFF)?
* @type boolean
* @default false
*
* @param Note Tag Key
* @parent ---General Settings---
* @desc Specify a key (<Key: Light 25 ...>) to be used with all note tags or leave blank for Terrax compatibility (Light 25 ...)
* @default cl
*
* @param ---DayNight Settings---
* @default
*
* @param Daynight Initial Speed
* @parent ---DayNight Settings---
* @desc What is the initial speed of the DayNight cycle?
* @type number
* @min 0
* @default 10
*
* @param Save DaynightHours
* @parent ---DayNight Settings---
* @desc Game variable the time of day (0-23) can be stored in. Disable: 0
* @type number
* @min 0
* @default 0
*
* @param Save DaynightMinutes
* @parent ---DayNight Settings---
* @desc Game variable the time of day (0-59) can be stored in. Disable: 0
* @type number
* @min 0
* @default 0
*
* @param Save DaynightSeconds
* @parent ---DayNight Settings---
* @desc Game variable the time of day (0-59) can be stored in. Disable: 0
* @type number
* @min 0
* @default 0
*
* @param Save Night Switch
* @parent ---DayNight Settings---
* @desc Game switch to set as ON during night and OFF during day. Disable: 0
* @type number
* @min 0
* @default 0
*
* @param No Autoshadow During Night
* @parent ---DayNight Settings---
* @desc Hide autoshadow during night?
* @type number
* @type boolean
* @default false
*
* @param Night Hours
* @parent ---DayNight Settings---
* @desc Comma-separated list of night hours. Not used/relevant if Save Night Switch set to 0.
* @default 0, 1, 2, 3, 4, 5, 6, 19, 20, 21, 22, 23
*
* @param DayNight Colors
* @parent ---DayNight Settings---
* @desc Set DayNight colors. Each color represents 1 hour of the day
* @default ["#6666ff","#6666ff","#6666ff","#6666ff","#6666ff","#6666ff","#9999ff","#ccccff","#ffffff","#ffffff","#ffffff","#ffffff","#ffffff","#ffffff","#ffffff","#ffffff","#ffffff","#ffffff","#ffcc88","#9999ff","#6666ff","#6666ff","#6666ff","#6666ff"]
* @type text[]
*
* @param Daynight Initial Hour
* @parent ---DayNight Settings---
* @desc What is the initial hour?
* @type number
* @min 0
* @default 0
*
* @param ---Offset and Sizes---
* @default
*
* @param Player radius
* @parent ---Offset and Sizes---
* @desc Adjust the light radius around the player
* Default: 300
* @type number
* @min 0
* @default 300
*
* @param Flashlight offset
* @parent ---Offset and Sizes---
* @desc Increase this setting to move up the flashlight for double height characters.
* Default: 0
* @type number
* @min -100
* @max 100
* @default 0
*
* @param Flashlight X offset
* @parent ---Offset and Sizes---
* @desc Use this setting for characters larger than one space.
* Default: 0
* @type number
* @min -100
* @max 100
* @default 0
*
* @param Screensize X
* @parent ---Offset and Sizes---
* @desc Increase if your using a higher screen resolution then the default
* Default : 816
* @default 816
* @type number
* @min 0
*
* @param Screensize Y
* @parent ---Offset and Sizes---
* @desc Increase if your using a higher screen resolution then the default
* Default : 624
* @default 624
* @type number
* @min 0
*
* @param Lightmask Padding
* @parent ---Offset and Sizes---
* @desc Offscreen x-padding size for the light mask
* @type number
* @min 0
* @default 32
*
* @param ---Battle Settings---
* @default
*
* @param Battle Tinting
* @parent ---Battle Settings---
* @desc Add a tint layer to the battle screen? If set to false, no light effect will occur during battles.
* @type boolean
* @default true
*
* @param Light Mask Position
* @parent ---Battle Settings---
* @desc Place the light mask above the battlers, or between the battleground and the battlers?
* @type select
* @option Above Battlers
* @value Above Background and Battler
* @option Between Background and Battlers
* @value Between
* @default Above
*
* @----------------------------
*
* @command masterSwitch
* @text Plugin On/Off
* @desc Enable or disable all lighting effects from this plugin
*
* @arg enabled
* @text Enabled
* @type boolean
* @on Enable
* @off Disable
* @default true
*
* @----------------------------
*
* @command daynightEnable
* @text Daynight Tint On/Off
* @desc Enable or disable daynight cycle tinting for the current map. Warning: this will be overridden by map notes.
*
* @arg enabled
* @text Enabled
* @desc If set to "off" then the other command parameters will be ignored
* @type boolean
* @on On
* @off Off
* @default true
*
* @arg fade
* @text Fade tint over hour
* @desc If set to "on" the tint will gradually transition to that of the next hour.
* @type boolean
* @on On
* @off Off
* @default false
*
* @----------------------------
*
* @command resetLightSwitches
* @text Reset Light Switches
* @desc Reset all light switches
*
* @----------------------------
*
* @command activateById
* @text Activate Light By ID
* @desc Turn an event's light on or off on the current map.
*
* @arg id
* @text Event ID
* @desc This is an ID you assigned via note tag, as in <cl: light 150 #fff myIdHere> not an event's id number
* @type text
*
* @arg enabled
* @text Active
* @type boolean
* @on On
* @off Off
* @default true
*
* @----------------------------
*
* @command condLight
* @text Set Conditional Lighting
* @desc Supports transition & pause durations, on & off, color, angle, brightness, x offset, y offset, radius, beam length & width.
*
* @arg id
* @text Event ID
* @desc This is an ID you assigned via note tag, as in <cl: light 150 #fff myIdHere> not an event's id number
* @type text
*
* @arg properties
* @text Properties
* @desc fmt: [tN] [pN] [<#|#a>hex] [eN] [<a|+a|-a>N] [bN] [xN] [yN] [rN] [lN] [wN] where N is a number or range (N:N).
* @type text
* @default t5 #ffffff e1 -a90 b0 x0 y0 r150 l12 w12
*
* @arg wait
* @text Wait
* @desc Wait for the light to finish both transitioning and pausing before continuing the event script.
* @type boolean
* @on On
* @off Off
* @default false
*
* @----------------------------
*
* @command condLightWait
* @text Wait on Conditional Lighting
* @desc Wait for the conditional light to finish both transitioning and pausing before continuing the event script.
*
* @arg id
* @text Event ID
* @desc This is an ID you assigned via note tag, as in <cl: light 150 #fff myIdHere> not an event's id number
* @type text
*
* @----------------------------
*
* @command lightColor
* @text Light Color By ID
* @desc Change an event's light color on the current map.
*
* @arg id
* @text Event ID
* @desc This is an ID you assigned via note tag, as in <cl: light 150 #fff myIdHere> not an event's id number
* @type text
*
* @arg color
* @text Color
* @desc Light color in #RRGGBB format. Use 'defaultcolor' to choose the event's original light color.
* @type text
* @default #ffffff
*
* @----------------------------
*
* @command playerLightRadius
* @text Player Light Radius
* @desc Change the player's light radius
*
* @arg radius
* @text Radius
* @type number
* @min 0
* @default 0
*
* @arg color
* @text Color
* @type text
* @default #ffffff
*
* @arg brightness
* @text Brightness
* @type number
* @min 0
* @default 0
*
* @arg fadeSpeed
* @text fadeSpeed
* @desc Light fade speed (0 = instant)
* @type number
* @default 0
*
* @----------------------------
*
* @command setFire
* @text Set Fire Flicker
* @desc Alters the flickering of "Fire" type lights
*
* @arg radiusShift
* @text Flicker Radius
* @type number
* @min 0
* @default 0
*
* @arg redYellowShift
* @text Color Shift Intensity
* @type number
* @min 0
* @default 0
*
* @----------------------------
*
* @command flashlight
* @text Player Flashlight
* @desc Turn the player's flashlight on or off
*
* @arg enabled
* @text On/Off
* @desc If set to "off" then the other command parameters will be ignored
* @type boolean
* @on On
* @off Off
* @default false
*
* @arg beamLength
* @text Beam Length
* @type number
* @min 0
* @default 8
*
* @arg beamWidth
* @text Beam Width
* @type number
* @min 0
* @default 12
*
* @arg color
* @text Beam Color
* @type text
* @default #ffffff
*
* @arg density
* @text Beam Density
* @type number
* @min 0
* @default 3
*
* @----------------------------
*
* @command setTimeSpeed
* @text Time Speed
* @desc Sets the speed of the day/night cycle
*
* @arg speed
* @text Speed
* @type number
* @desc Set to 0 to stop time, or enter a number between 1-4999, with lower being faster.
* @min 0
* @max 4999
* @default 0
*
* @----------------------------
*
* @command setTime
* @text Time Set (HH:MM)
* @desc Adjusts the current time of day
*
* @arg hours
* @text Hours
* @type text
* @desc A value between 0 and (numberOfDays - 1). This value is processed as an eval. Variable shortcut: v[1], v[2], etc
* @default 0
*
* @arg minutes
* @text Minutes
* @type text
* @desc A value between 0 and 59. This value is processed as an eval. Variable shortcut: v[1], v[2], etc
* @min 0
* @default 0
*
* @arg mode
* @text Mode
* @desc Set, add, or subtract time
* @type select
* @option Set
* @value set
* @option Add
* @value add
* @option Subtract
* @value subtract
* @default set
*
* @arg fade
* @text Fade tint over hour
* @desc If set to "on" the tint will gradually transition to that of the next hour.
* @type boolean
* @on On
* @off Off
* @default false
*
* @----------------------------
*
* @command setHourColor
* @text Set Color For Hour
* @desc Assigns the specified color in #RRGGBB format to the specified hour
*
* @arg hour
* @text Hour
* @type number
* @min 0
* @default 0
*
* @arg color
* @text Color
* @type text
* @default #ffffff
*
* @arg fade
* @text Fade tint over hour
* @desc If set to "on" the tint will gradually transition to that of the next hour.
* @type boolean
* @on On
* @off Off
* @default false
*
* @----------------------------
*
* @command setHoursInDay
* @text Set Hours In Day
* @desc Sets the current number of hours in a day
*
* @arg hours
* @text Hours
* @type number
* @min 0
* @default 24
*
* @arg fade
* @text Fade tint over hour
* @desc If set to "on" the tint will gradually transition to that of the next hour.
* @type boolean
* @on On
* @off Off
* @default false
*
* @----------------------------
*
* @command showTime
* @text Show Time
* @desc Displays the current time in the upper right corner of the map screen
*
* @arg enabled
* @text Enabled
* @desc Show/hide the time
* @type boolean
* @on Show
* @off Hide
* @default false
*
* @arg showSeconds
* @text Show Seconds
* @desc Show/hide the seconds digit
* @type boolean
* @on Show
* @off Hide
* @default false
*
* @----------------------------
*
* @command setTint
* @text Set Tint
* @desc Sets the current map tint, or battle tint if in battle
*
* @arg color
* @text Tint Color
* @desc #RRGGBB format or leave blank to set the tint based on the current time of day
* @type text
* @default #888888
*
* @arg fadeSpeed
* @text Fade Speed or Cycles
* @desc Speed or cycles in which the tint transitions. For speed, 0=instant, 20=very slow.
* @type number
* @min 0
* @default 0
*
* @arg cycles
* @text uses cycles
* @desc If set to "on" the tint will gradually transition over the specified cycle count
* @type boolean
* @on On
* @off Off
* @default false
*
* @arg wait
* @text Wait
* @desc Wait for the tint to finish transitioning before continuing the event script.
* @type boolean
* @on On
* @off Off
* @default false
*
* @----------------------------
*
* @command resetTint
* @text Reset Tint
* @desc Reset the current map tint to the next hour color, or the battle tint to its original color if in battle
*
* @arg fadeSpeed
* @text Fade Speed
* @desc Speed or cycles in which the tint transitions. For speed, 0=instant, 20=very slow.
* @type number
* @min 0
* @max 20
* @default 0
*
* @arg cycles
* @text uses cycles
* @desc If set to "on" the tint will gradually transition over the specified cycle count
* @type boolean
* @on On
* @off Off
* @default false
*
* @arg wait
* @text Wait
* @desc Wait for the tint to finish transitioning before continuing the event script.
* @type boolean
* @on On
* @off Off
* @default false
*
* @----------------------------
*
* @command waitTint
* @text Wait on Tint
* @desc Wait for the tint to finish transitioning before continuing the event script.
*
* @----------------------------
*
* @command tileLight
* @text Tile-Based Lighting
* @desc Assigns lighting to a particular region or terrain ID
*
* @arg tileType
* @text Tile ID Type
* @type select
* @option Terrain
* @value terrain
* @option Region
* @value region
* @default region
*
* @arg lightType
* @text Light Type
* @type select
* @option Light
* @value light
* @option Fire
* @value fire
* @option Glow
* @value glow
* @default light
*
* @arg id
* @text ID
* @desc Region ID (1-255) or Terrain Tag ID (1-7)
* @type number
* @min 1
* @max 255
* @default 1
*
* @arg enabled
* @text On/Off
* @desc Turn this tile's light on or off
* @type boolean
* @on On
* @off Off
* @default true
*
* @arg color
* @text Color
* @desc Color in #RRGGBB format
* Note: "Block" will filter all light at #000000 or allow specified colors through otherwise
* @type text
* @default #ffffff
* @arg radius
* @text Light Radius
* @desc Radius of tile light
* @type number
* @min 0
* @max 999999
* @default 0
*
* @arg brightness
* @text Brightness
* @desc Brightness of tile light
* @type number
* @min 0
* @default 0
*
* @----------------------------
*
* @command tileBlock
* @text Tile-Based Light Blocking
* @desc Assigns light blocking effect to a particular region or terrain ID
*
* @arg tileType
* @text Tile ID Type
* @type select
* @option Terrain
* @value terrain
* @option Region
* @value region
* @default region
*
* @arg id
* @text ID
* @desc Region ID (1-255) or Terrain Tag ID (1-7)
* @type number
* @min 1
* @max 255
* @default 1
*
* @arg enabled
* @text On/Off
* @desc Turn this tile's light on or off
* @type boolean
* @on On
* @off Off
* @default true
*
* @arg color
* @text Color
* @desc Color in #RRGGBB format
* Note: "Block" will filter all light at #000000 or allow specified colors through otherwise
* @type text
* @default #000000
* @arg shape
* @text Shape
* @desc Shape of blocking effect
* @type select
* @option Full
* @value 0
* @option Square
* @value 1
* @option Oval
* @value 2
* @default 0
*
* @arg xOffset
* @text X Offset
* @type number
* @min -99999
* @max 99999
* @default 0
* @arg yOffset
* @text Y Offset
* @type number
* @min -99999
* @max 99999
* @default 0
*
* @arg blockWidth
* @text Width
* @type number
* @min -99999
* @max 99999
* @default 48
*
* @arg blockHeight
* @text Height
* @type number
* @min -99999
* @max 99999
* @default 48
*
* @----------------------------
*
* @help
*
* --------------------------------------------------------------------------
* Important info about note tags and the note tag key plugin parameter:
*
* 1. This plugin features an optional note tag key that lets this plugin's
* note tags work alongside those of other plugins--a feature not found in the
* original Terrax Lighting plugin. If a note tag key is set in the plugin
* parameters, all of these commands must be enclosed in a note tag with that
* particular key in in order to be recognized.
*
* This note tag key applies to anything this plugin would have placed inside
* a note box, such as "DayNight" on a map or "Light/Fire/etc on an event.
*
* Examples:
*
* With the default note tag key, "CL" (not case sensitive):
* <cl: light 250 #ffffff>
* <cl: daynight>
* ...etc
*
* Without a note tag key set:
* light 250 #ffffff
* daynight
* ...etc
*
* Using a note tag key is recommended since it allows for other things
* (plugins, or even your own personal notes) to make use of the note box
* without breaking things. Omitting the key is intended primarily as legacy
* support, allowing this plugin to be used with older projects that have
* been upgraded from Terrax Lighting so you don't have to go back and
* change a bunch of event and map notes.
*
* 2. New with version 4.2+ is the option to place the lighting note tag
* anywhere in an event page's comment field instead of the note box, as
* long as the comment field is the first thing on the page. This allows
* for more advanced lighting tricks to be done on a per-page basis. Page
* Comment note tags will be prioritized over general note tags, allowing
* tags in the general note box to serve as a default that 1 or more pages
* can override.
*
* It's important to note that active lighting events are only updated
* periodically to avoid needlessly looping through events on the map
* that have nothing to do with lighting. As such, if your event's note
* box is empty and page 1 has no lighting tag set, but page 2 does, there
* will be a brief delay before the light comes on when you switch to page
* 2. You can get around this by setting a default empty light note tag
* <cl: light 0 #000> in the general note box.
*
* Finally, this feature isn't available in Terrax compatibility mode (when
* there's no note tag key set). This is to avoid conflicts when a comment
* appears at the top of a page that has nothing to do with this plugin.
*
* --------------------------------------------------------------------------
* List of Note Tags
* --------------------------------------------------------------------------
*
* Notation legend:
* [] These values are optional (the brightness parameter in light, etc)
* | Select the value from the specified list (on|off, etc)
*
* Do not include these in the actual note tags or plugin commands.
*
* --------------------------------------------------------------------------
* Events
* --------------------------------------------------------------------------
* Light radius color [enable] [day|night] [brightness] [direction] [anglerange] [x] [y] [id]
* Light radius cycle <color [pauseDuration]>... [enable] [day|night] [brightness] [direction] [anglerange] [x] [y] [id]
* Light [radius] [color] [{CycleProps}...] [enable] [day|night] [brightness] [direction] [anglerange] [x] [y] [id]
* - Light
* - radius For a circular radius this can be any number, optionally preceded by "R" or
* "r", so 100, R100, r100, etc. For an elliptical radius, must be any number
* preceded by xr or XR, and yr or YR, so "xr100 yr150", "XR100 yr150", etc.
* - cycle Allows any number of color + duration pairs to follow that will be cycled
* through before repeating from the beginning. See the examples below for usage.
* In Terrax Lighting, there was a hard limit of 4, but now there is no limit.
* To cycle any light property or for fade transitions, use the cycleProps
* format instead. [optional]
* - cycleProps Cyclic conditional lighting properties can be specified within {} brackets.
* The can be used to create transitioning light patterns See the Conditional
* Lighting section for more details. * Any non-cyclic properties are inherited
* unless overridden by the first cyclic properties [Optional]
* - color #ffffff, #ff0000, etc
* - enable Initial state: off, on (default). May optionally use 'E1|e1|E0|e0' syntax
* where 1 is on, and 0 is off. Ignored if day|night passed [optional]
* - day Causes the light to only come on during the day [optional]
* - night Causes the light to only come on during the night [optional]
* - brightness B50, B25, etc [optional]
* - direction D1: n.wall, D2: e.wall, D3: s.wall, D4: w.wall
* D5 n.+e. walls, D6 s.+e. walls, D7 s.+w. walls,
* D8 n.+w. walls, D9 n.-e. corner, D10 s.-e. corner
* D11 s.-w. corner, D12 n.-w. corner [optional]
* - anglerange Forced direction range in degrees in the format of aN:M where N is the start
* angle and M Is the end angle. Must be preceded by "A" or "a". If omitted,
* direction is used. [optional]
* - x x offset [optional] (0.5: half tile, 1 = full tile, etc)
* - y y offset [optional]
* - id 1, 2, potato, etc. An id (alphanumeric) for plugin commands [optional]
* These should not be in the format of '<a|b|d|e|l|w|x|y|A|B|D|E|L|W|X|Y>N'
* where N is a number following any supported optional parameter prefix
* otherwise it will be mistaken for one of the previous optional parameters.
* Generally, it is adviseable to avoid any single letter followed by a number.
*
* Fire ...params
* - Same as Light params above, but adds a subtle flicker
*
* Flashlight bl bw color [enable] [day|night] [sdir|angle] [x] [y] [id]
* Flashlight bl bw cycle <color [pauseDuration]>... [enable] [day|night] [sdir|angle] [x] [y] [id]
* Flashlight [bl] [bw] [{CycleProps}...] [enable] [day|night] [sdir|angle] [x] [y] [id]
* - Sets the light as a flashlight with beam length (bl) beam width (bw) color (c),
* 0|1 (onoff), and 1=up, 2=right, 3=down, 4=left for static direction (sdir)
* - bl: Beam length: Any number, optionally preceded by "L" or "l", so 8, L8, l8, etc.
* - bw: Beam width: Any number, optionally preceded by "W", or 'w', so 12, W12, w12, etc.
* - cycle Allows any number of color + duration pairs to follow that will be cycled
* through before repeating from the beginning. See the examples below for usage.
* In Terrax Lighting, there was a hard limit of 4, but now there is no limit.
* To cycle any light property or for fade transitions, use the cycleProps
* format instead. [optional]
* - cycleProps Cyclic conditional lighting properties can be specified within {} brackets.
* The can be used to create transitioning light patterns See the Conditional
* Lighting section for more details. * Any non-cyclic properties are inherited
* unless overridden by the first cyclic properties [Optional]
* - color #ffffff, #ff0000, etc
* - enable Initial state: off, on (default). May optionally use 'E1|e1|E0|e0' syntax
* where 1 is on, and 0 is off. Ignored if day|night passed [optional]
* - day Sets the event's light to only show during the day [optional]
* - night Sets the event's light to only show during night time [optional]
* - sdir Forced direction: 0:auto, 1:up, 2:right, 3:down, 4:left [optional]
* Can be preceded by "D" or "d", so D4, d4, etc. If omitted, defaults to 0
* - angle Forced direction in degrees. Must be preceded by "A" or "a". If
* omitted, sdir is used. [optional]
* - x x[offset] Work the same as regular light [optional]
* - y y[offset] [optional]
* - id 1, 2, potato, etc. An id (alphanumeric) for plugin commands [optional]
* These should not be in the format of '<a|b|d|e|l|w|x|y|A|B|D|E|L|W|X|Y>N'
* where N is a number following any supported optional parameter prefix
* otherwise it will be mistaken for one of the previous optional parameters.
* Generally, it is adviseable to avoid any single letter followed by a number.
*
* Example note tags:
*
* <cl: light 250 #ffffff>
* <cl: light r250 #ffffff>
* Creates a basic light
*
* <cl: light xr250 yr300 #ffffff>
* Creates a basic elliptical light
*
* <cl: light r250 a180:360 #ffffff>
* Creates a basic light that displays from 180 degrees to 360 degrees (north facing).
*
* <cl: light 300 cycle #ff0000 15 #ffff00 15 #00ff00 15 #00ffff 15 #0000ff 15>
* <cl: light r300 {#ff0000 p15} {#ffff00} {#00ff00} {#00ffff} {#0000ff}>
* Creates a cycling light that rotates every 15 frames. Great for parties!
*
* <cl: light r300 {#ff0000 t30 p60} {#ffff00} {#00ff00} {#00ffff}>
* Creates a cycling light that stays on for 30 frames and transitions to the next color over 60 frames.
*
* <cl: light {#ff0000 t30 p60 r250} {#ffff00 r300} {#00ff00 r250} {#00ffff r300}>
* Creates a cycling light that grows and shrink between radius sizes of 250 and 300, stays on for 30 frames,
* and transitions to the next color and size over 60 frames.
*
* <cl: fire 150 #ff8800 b15 night>
* Creates a fire that only lights up at night.
*
* <cl: Flashlight l8 w12 #ff0000 on asdf>
* Creates a flashlight beam with id asdf which can be turned on or off via
* plugin commands.
*
* <cl: Flashlight l8 w12 #ff0000 on asdf>
* Creates a flashlight beam with id asdf which can be turned on or off via
* plugin commands.
*
* <cl: Flashlight l8 w12 cycle #f00 15 #ff0 15 #0f0 15>
* <cl: Flashlight l8 w12 {#f00 p15} {#ff0} {#0f0}>
* Creates a flashlight beam that rotates every 15 frames.
*
* --------------------------------------------------------------------------
* Additive Lighting Effects
* --------------------------------------------------------------------------
* Additive lighting gives lights a volumetric appearance. To enable, put 'a' or 'A'
* in front of any color light color.
*
* Example note tags:
*
* <cl: light r300 {a#990000 t15} {a#999900} {a#009900} {a#009999} {a#000099}>
* Creates a cycling volumetric light that rotates every 15 frames.
*
* <cl: Flashlight l8 w12 a#660000 on asdf>
* Creates a red volumetric flashlight beam with id asdf which can be turned on or off
* via plugin commands.
*
* --------------------------------------------------------------------------
* Conditional Lighting
* --------------------------------------------------------------------------
* Conditional Lighting allows light properties to be changed either cyclically or
* dynamically over time via properties that consist of a prefix followed by a property
* value. This is useful for creating any number of transitional lighting effects.
* Properties will hold their given value until a change or reset (including pause and
* transition durations).
*
* The properties are supported in light tags or via the 'light cond' command. Light tags
* support any number of light properties wrapped in {} brackets See the example note tags
* above.
*
* The 'light cond' command allows for conditional lights to be dynamically changed on demand.
* See the Plugin Commands section for more details.
*
* Ranges can be used if random values are desired. Cycle tags are statically generated at map
* load. If dynamic random property values are desired, use the 'light cond' command instead in
* combination with the 'light wait' command.
* See the table below for property specific formatting.
*
* The following table shows supported properties:
* ---------------------------------------------------------------------------------------------------------------------
* | Property | Prefix | Format*† | Examples | Description |
* |-------------|-----------|-------------------------|----------------------|----------------------------------------|
* | pause | p | p<N|N:N> | p0, p1, p20, | time period in cycles to pause after |
* | duration | | | p0:20, p1:20 | transitioning for cycling lights |
* |-------------|-----------|-------------------------|----------------------|----------------------------------------|
* | transition | t | t<N|N:N> | t0, t1, t30 | time period to transition the |
* | duration | | | t0:30, t1:30 | specified properties over |
* |-------------|-----------|-------------------------|----------------------|----------------------------------------|
* | color | #, #a | <#|#a><hex|hex:hex> | #, #FFEEDD, #ffeedd, | color or additive color |
* | | | | a#000000:a#ffffff | |
* |-------------|-----------|-------------------------|----------------------|----------------------------------------|
* | enable | e | e<0|1|0:1> | e0, e1, e0:1 | turns light on or off instantly |