-
Notifications
You must be signed in to change notification settings - Fork 0
/
DuelZone.oww
2644 lines (2388 loc) · 83.9 KB
/
DuelZone.oww
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
settings
{
main
{
Description: "Giacomand's Duel Zones v0.2.7 - Quick easy random 1v1s with a small built in MMR! Latest code at: https://workshop.codes/duel-zones"
}
lobby
{
Allow Players Who Are In Queue: Yes
Match Voice Chat: Enabled
Return To Lobby: Never
}
modes
{
Deathmatch
{
Game Length In Minutes: 15
Score To Win: 50
enabled maps
{
Havana
}
}
General
{
Allow Hero Switching: Off
Game Mode Start: Immediately
Hero Limit: Off
Spawn Health Packs: Disabled
}
}
heroes
{
General
{
Ultimate Ability: Off
Baptiste
{
Immortality Field: Off
}
Lúcio
{
Healing Received: 50%
}
Mei
{
Primary Fire: Off
}
Sombra
{
Stealth: Off
}
Torbjörn
{
Deploy Turret: Off
}
disabled heroes
{
Bastion
Brigitte
D.Va
Echo
Mercy
Moira
Orisa
Reaper
Reinhardt
Roadhog
Sigma
Symmetra
Winston
Wrecking Ball
Zarya
}
}
}
}
variables
{
global:
0: DEBUG
1: DEBUG_ZonePosition
2: DEBUG_ZoneRadius
3: DEBUG_TempFacingDir
4: DuelZonePositionList
5: DuelZoneRadiusList
6: DuelZoneSpawnList
7: LobbyPosition
8: TempWaitingPlayersList
9: TempPlayerOne
10: TempPlayerTwo
11: TempAvailableDuelZones
12: ConfigScoreToWin
13: ConfigMatchmakerTimer
14: MatchmakerTicker
15: LobbySignPosition
16: BarrierPositionList
17: BarrierRadiusList
19: TempOrphanPlayers
22: HeroPoolArray
23: TempHeroPool
25: ZDebug
player:
0: ActiveDuelZone
1: PlayerState
2: MatchLosses
4: PlayerNumberOffset
5: EnemyPlayerNumberOffset
6: MatchScore
7: TempOpponent
8: TimeSpentWaiting
11: LastOpponent
12: RepeatedOpponentCounter
13: CurrentOpponent
14: Spectating
}
disabled rule("DEBUG: Enable this for Debug Mode")
{
event
{
Ongoing - Global;
}
actions
{
Global.DEBUG = True;
}
}
rule("DEBUG: Is Not Enabled")
{
event
{
Ongoing - Global;
}
conditions
{
Global.DEBUG == False;
}
actions
{
Disable Inspector Recording;
}
}
rule("DEBUG: Init Player Debug")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Global.DEBUG == True;
}
actions
{
Create HUD Text(Event Player, Position Of(Event Player), Null, Null, Left, 0, White, White, White, Visible To and String,
Default Visibility);
Create HUD Text(Event Player, Facing Direction Of(Event Player), Null, Null, Left, 0, White, White, White, Visible To and String,
Default Visibility);
}
}
rule("DEBUG: Init Global Debug")
{
event
{
Ongoing - Global;
}
conditions
{
Global.DEBUG == True;
}
actions
{
disabled Create HUD Text(All Players(All Teams), Null, Null, Custom String("DEBUG INFO"), Left, -1, White, White, Red,
Visible To and String, Default Visibility);
disabled Create HUD Text(All Players(All Teams), Null, Global.DEBUG_ZonePosition, Null, Left, 0, White, White, White, Visible To and String,
Default Visibility);
disabled Create HUD Text(All Players(All Teams), Null, Global.DEBUG_ZoneRadius, Null, Left, 0, White, White, White, Visible To and String,
Default Visibility);
disabled Create Effect(All Players(All Teams), Sphere, Red, Global.DEBUG_ZonePosition, Global.DEBUG_ZoneRadius,
Visible To Position and Radius);
disabled Abort;
Wait(4, Ignore Condition);
Create Dummy Bot(Hero(McCree), All Teams, -1, Vector(0, 0, 0), Vector(0, 0, 0));
Create Dummy Bot(Hero(Ashe), All Teams, -1, Vector(0, 0, 0), Vector(0, 0, 0));
Create Dummy Bot(Hero(Baptiste), All Teams, -1, Vector(0, 0, 0), Vector(0, 0, 0));
Create Dummy Bot(Hero(Genji), All Teams, -1, Vector(0, 0, 0), Vector(0, 0, 0));
Create Dummy Bot(Hero(Hanzo), All Teams, -1, Vector(0, 0, 0), Vector(0, 0, 0));
Create Dummy Bot(Hero(Junkrat), All Teams, -1, Vector(0, 0, 0), Vector(0, 0, 0));
Create Dummy Bot(Hero(Tracer), All Teams, -1, Vector(0, 0, 0), Vector(0, 0, 0));
Create Dummy Bot(Hero(Doomfist), All Teams, -1, Vector(0, 0, 0), Vector(0, 0, 0));
Create Dummy Bot(Hero(Bastion), All Teams, -1, Vector(0, 0, 0), Vector(0, 0, 0));
Create Dummy Bot(Hero(Lúcio), All Teams, -1, Vector(0, 0, 0), Vector(0, 0, 0));
Create Dummy Bot(Hero(Zenyatta), All Teams, -1, Vector(0, 0, 0), Vector(0, 0, 0));
}
}
rule("DEBUG: Not invulnerable in spawn")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Global.DEBUG == True;
(Event Player.PlayerState == 2 || Event Player.PlayerState == -4) == True;
Has Status(Event Player, Phased Out) == False;
}
actions
{
Big Message(All Players(All Teams), Custom String("DEBUG: {0} NOT PHASED OUT", Event Player));
}
}
disabled rule("DEBUG: Set Map Duel Zone Position")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Global.DEBUG == True;
Is Button Held(Event Player, Primary Fire) == True;
}
actions
{
Global.DEBUG_ZonePosition = Ray Cast Hit Position(Eye Position(Event Player), Facing Direction Of(Event Player)
* 1000 + Eye Position(Event Player), All Players(All Teams), Event Player, True);
}
}
disabled rule("DEBUG: Set Duel Zone Radius")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Global.DEBUG == True;
(Is Button Held(Event Player, Jump) || Is Button Held(Event Player, Crouch)) == True;
}
actions
{
Skip If(Is Button Held(Event Player, Jump), 2);
Global.DEBUG_ZoneRadius += 5;
Abort;
Global.DEBUG_ZoneRadius -= 5;
}
}
rule("DEBUG: Kill Player #2")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Global.DEBUG == True;
Is Communicating(Event Player, Hello) == True;
}
actions
{
Kill(Players In Slot(1, All Teams), Null);
}
}
rule("DEBUG: Destroy Dummy Player #2")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Global.DEBUG == True;
Is Communicating(Event Player, Thanks) == True;
}
actions
{
Destroy Dummy Bot(All Teams, 1);
Wait(5, Ignore Condition);
Create Dummy Bot(Hero(McCree), All Teams, 1, Vector(0, 0, 0), Vector(0, 0, 0));
}
}
rule("DEBUG: No Clip")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Global.DEBUG == True;
Is Button Held(Event Player, Interact) == True;
}
actions
{
Global.DEBUG_TempFacingDir = Facing Direction Of(Event Player);
Teleport(Event Player, Facing Direction Of(Event Player) * 10 + Eye Position(Event Player));
Set Facing(Event Player, Global.DEBUG_TempFacingDir, To World);
Apply Impulse(Event Player, Vector(0, 1, 0), 5, To World, Cancel Contrary Motion);
}
}
rule("MAP: Havana")
{
event
{
Ongoing - Global;
}
conditions
{
Current Map == Map(Havana);
}
actions
{
Global.LobbyPosition = Vector(-102.513, 6, -73.331);
Global.LobbySignPosition = Vector(-94.040, 6.556, -69.077);
Global.DuelZonePositionList = Empty Array;
Global.DuelZoneRadiusList = Empty Array;
Global.DuelZoneSpawnList = Empty Array;
Global.BarrierPositionList = Empty Array;
Global.BarrierRadiusList = Empty Array;
Modify Global Variable(DuelZonePositionList, Append To Array, Vector(-96.249, 4, -68.923));
Modify Global Variable(DuelZoneRadiusList, Append To Array, 35);
Modify Global Variable(DuelZoneSpawnList, Append To Array, Vector(-108.678, 5.199, -53.831));
Modify Global Variable(DuelZoneSpawnList, Append To Array, Vector(-83.129, 5.348, -78.313));
Modify Global Variable(DuelZonePositionList, Append To Array, Vector(31.100, 6.199, -83.700));
Modify Global Variable(DuelZoneRadiusList, Append To Array, 54);
Modify Global Variable(DuelZoneSpawnList, Append To Array, Vector(-2.441, 7.177, -95.874));
Modify Global Variable(DuelZoneSpawnList, Append To Array, Vector(18.313, 7.174, -51.988));
Modify Global Variable(DuelZonePositionList, Append To Array, Vector(33.053, 17.395, -77.519));
Modify Global Variable(DuelZoneRadiusList, Append To Array, 75);
Modify Global Variable(DuelZoneSpawnList, Append To Array, Vector(28.513, 11.551, -95.304));
Modify Global Variable(DuelZoneSpawnList, Append To Array, Vector(56.393, 13.551, -68.741));
Modify Global Variable(DuelZonePositionList, Append To Array, Vector(66.423, 6.317, -94.950));
Modify Global Variable(DuelZoneRadiusList, Append To Array, 50);
Modify Global Variable(DuelZoneSpawnList, Append To Array, Vector(76.863, 8.341, -72.242));
Modify Global Variable(DuelZoneSpawnList, Append To Array, Vector(102.236, 3.310, -72.689));
Modify Global Variable(DuelZonePositionList, Append To Array, Vector(149.344, 12.273, -46.853));
Modify Global Variable(DuelZoneRadiusList, Append To Array, 30);
Modify Global Variable(DuelZoneSpawnList, Append To Array, Vector(150.411, 10.427, -63.278));
Modify Global Variable(DuelZoneSpawnList, Append To Array, Vector(151.415, 10.352, -29.396));
Modify Global Variable(DuelZonePositionList, Append To Array, Vector(209.334, 27.500, -40.314));
Modify Global Variable(DuelZoneRadiusList, Append To Array, 30);
Modify Global Variable(DuelZoneSpawnList, Append To Array, Vector(214.653, 28.849, -29.623));
Modify Global Variable(DuelZoneSpawnList, Append To Array, Vector(214.674, 28.848, -50.187));
Modify Global Variable(BarrierPositionList, Append To Array, Vector(176.452, 11, -46.671));
Modify Global Variable(BarrierRadiusList, Append To Array, 15);
Modify Global Variable(BarrierPositionList, Append To Array, Vector(182.679, 25.659, -45.952));
Modify Global Variable(BarrierRadiusList, Append To Array, 19);
}
}
rule("CONFIG: Setup Config (ConfigScoreToWin is broken atm)")
{
event
{
Ongoing - Global;
}
actions
{
Global.ConfigScoreToWin = 3;
Global.ConfigMatchmakerTimer = 15;
}
}
rule("INIT: Pre-Assemble Heroes")
{
event
{
Ongoing - Global;
}
actions
{
Set Match Time(2);
Disable Built-In Game Mode Announcer;
Disable Built-In Game Mode Scoring;
}
}
rule("INIT: Post-Assemble Heroes")
{
event
{
Ongoing - Global;
}
conditions
{
Is Game In Progress == True;
}
actions
{
Set Match Time(3590);
}
}
rule("INIT: Setup Random 5 * 6 Sized Hero Pool")
{
event
{
Ongoing - Global;
}
actions
{
Global.HeroPoolArray = Empty Array;
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
Modify Global Variable(HeroPoolArray, Append To Array, Hero(Brigitte));
}
}
rule("INIT: Global HUD and Signs")
{
event
{
Ongoing - Global;
}
actions
{
Create HUD Text(All Players(All Teams), Null, Custom String("Giacomand's Duel Zones"), Custom String(
"Server Load - {0}% - {1}% avg - {2}% peak", Server Load, Server Load Average, Server Load Peak), Left, -10, White, Yellow,
White, Visible To and String, Default Visibility);
disabled Create HUD Text(All Players(All Teams), Null, Null, Custom String("Score to win is {0}", Global.ConfigScoreToWin), Right, 0, White,
White, White, Visible To and String, Default Visibility);
disabled Create HUD Text(All Players(All Teams), Null, Null, Custom String("Matchmaker Timer is {0} sec(s)", Global.ConfigMatchmakerTimer),
Right, 0, White, White, White, Visible To and String, Default Visibility);
disabled Create HUD Text(All Players(All Teams), Null, Custom String("Server Load - {0}% - {1}% avg - {2}% peak", Server Load,
Server Load Average, Server Load Peak), Null, Right, 1, White, White, White, Visible To and String, Default Visibility);
disabled Create HUD Text(Filtered Array(All Players(All Teams), Current Array Element.PlayerState == 2), Null, Null, Custom String(
"Searching for opponent.."), Left, -1, White, White, White, Visible To and String, Default Visibility);
disabled Create HUD Text(Filtered Array(All Players(All Teams), Current Array Element.PlayerState == 2), Null, Null, Custom String(
"Matches will be created in {0} sec(s)", Global.MatchmakerTicker), Left, 0, White, White, White, Visible To and String,
Default Visibility);
Create HUD Text(All Players(All Teams), Null, String(""), String("----------"), Left, 0, White, Yellow, White,
Visible To and String, Default Visibility);
Create In-World Text(All Players(All Teams), Custom String("Waiting Room"), Global.LobbySignPosition + Vector(0, 2, 0), 2,
Clip Against Surfaces, Visible To and String, Yellow, Default Visibility);
Create In-World Text(All Players(All Teams), Custom String("Score to win is {0}", Global.ConfigScoreToWin),
Global.LobbySignPosition + Vector(0, 1.500, 0), 1.500, Clip Against Surfaces, Visible To and String, White,
Default Visibility);
Create In-World Text(All Players(All Teams), Custom String("Matches will be created in {0} sec(s)..", Global.MatchmakerTicker),
Global.LobbySignPosition + Vector(0, 1, 0), 1.500, Clip Against Surfaces, Visible To and String, White, Default Visibility);
Create In-World Text(All Players(All Teams), Custom String("AFK ROOM"), Vector(-92.680, 5.500, -63.203), 1.500,
Clip Against Surfaces, Visible To and String, White, Default Visibility);
}
}
rule("INIT: Player HUD")
{
event
{
Ongoing - Each Player;
All;
All;
}
actions
{
disabled Create HUD Text(Filtered Array(Event Player, Current Array Element.PlayerState > 2), Hero Icon String(Hero Of(Filtered Array(
All Players(All Teams),
Event Player.ActiveDuelZone == Current Array Element.ActiveDuelZone && Event Player != Current Array Element))),
Filtered Array(All Players(All Teams),
Event Player.ActiveDuelZone == Current Array Element.ActiveDuelZone && Event Player != Current Array Element), String(
"{0} - {1}", Event Player.MatchScore, Filtered Array(All Players(All Teams),
Event Player.ActiveDuelZone == Current Array Element.ActiveDuelZone && Event Player != Current Array Element).MatchScore),
Left, 1, Team 2, Team 2, White, Visible To and String, Default Visibility);
Create HUD Text(Filtered Array(Event Player, Current Array Element.PlayerState > 2), Hero Icon String(
Global.HeroPoolArray[5 * Event Player.ActiveDuelZone + 0 + Event Player.CurrentOpponent.MatchLosses]),
Event Player.CurrentOpponent, String("{0} - {1}", Event Player.MatchScore, Event Player.CurrentOpponent.MatchScore), Left, 1,
Team 2, Team 2, White, Visible To and String, Default Visibility);
Create HUD Text(Filtered Array(Event Player,
Current Array Element.PlayerState > 2 && Event Player.CurrentOpponent.MatchLosses < 2), Hero Icon String(
Global.HeroPoolArray[5 * Event Player.ActiveDuelZone + Event Player.CurrentOpponent.MatchLosses + 1]), Null, Null, Left, 2,
Team 2, Team 2, White, Visible To and String, Default Visibility);
Create HUD Text(Filtered Array(Event Player,
Current Array Element.PlayerState > 2 && Event Player.CurrentOpponent.MatchLosses < 1), Hero Icon String(
Global.HeroPoolArray[5 * Event Player.ActiveDuelZone + Event Player.CurrentOpponent.MatchLosses + 2]), Null, Null, Left, 3,
Team 2, Team 2, White, Visible To and String, Default Visibility);
}
}
rule("INIT: Setup Duel Zone")
{
event
{
Ongoing - Global;
}
conditions
{
Is Game In Progress == True;
}
actions
{
Create Effect(Filtered Array(All Living Players(All Teams), Current Array Element.ActiveDuelZone == 0), Sphere, Yellow,
Global.DuelZonePositionList[0], Global.DuelZoneRadiusList[0], Visible To Position and Radius);
Create Effect(Filtered Array(All Living Players(All Teams), Current Array Element.ActiveDuelZone == 1), Sphere, Yellow,
Global.DuelZonePositionList[1], Global.DuelZoneRadiusList[1], Visible To Position and Radius);
Create Effect(Filtered Array(All Living Players(All Teams), Current Array Element.ActiveDuelZone == 2), Sphere, Yellow,
Global.DuelZonePositionList[2], Global.DuelZoneRadiusList[2], Visible To Position and Radius);
Create Effect(Filtered Array(All Living Players(All Teams), Current Array Element.ActiveDuelZone == 3), Sphere, Yellow,
Global.DuelZonePositionList[3], Global.DuelZoneRadiusList[3], Visible To Position and Radius);
Create Effect(Filtered Array(All Living Players(All Teams), Current Array Element.ActiveDuelZone == 4), Sphere, Yellow,
Global.DuelZonePositionList[4], Global.DuelZoneRadiusList[4], Visible To Position and Radius);
Create Effect(Filtered Array(All Living Players(All Teams), Current Array Element.ActiveDuelZone == 5), Sphere, Yellow,
Global.DuelZonePositionList[5], Global.DuelZoneRadiusList[5], Visible To Position and Radius);
}
}
rule("INIT: Create Barriers")
{
event
{
Ongoing - Global;
}
actions
{
Create Effect(All Players(All Teams), Sphere, Red, Global.BarrierPositionList[0], Global.BarrierRadiusList[0], Visible To);
Abort If(Count Of(Global.BarrierPositionList) < 1);
Create Effect(All Players(All Teams), Sphere, Red, Global.BarrierPositionList[1], Global.BarrierRadiusList[1], Visible To);
Abort If(Count Of(Global.BarrierPositionList) < 2);
Create Effect(All Players(All Teams), Sphere, Red, Global.BarrierPositionList[2], Global.BarrierRadiusList[2], Visible To);
Abort If(Count Of(Global.BarrierPositionList) < 3);
}
}
rule("INIT PLAYER: Setup Data")
{
event
{
Ongoing - Each Player;
All;
All;
}
actions
{
Event Player.ActiveDuelZone = -1;
disabled Disable Built-In Game Mode Respawning(Event Player);
Preload Hero(Event Player, Hero(Brigitte));
}
}
rule("ON STATE 1: Teleport Player To Lobby")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Event Player.PlayerState == 1;
Is Alive(Event Player) == True;
}
actions
{
Teleport(Event Player, Global.LobbyPosition + Vector(Random Real(-3, 3), 0, Random Real(-3, 3)));
Wait(0.100, Abort When False);
Event Player.ActiveDuelZone = -1;
Event Player.MatchLosses = 0;
Event Player.MatchScore = 0;
Event Player.PlayerState = 2;
Event Player.TimeSpentWaiting = 0;
Chase Player Variable At Rate(Event Player, TimeSpentWaiting, 9999, 1, None);
Set Status(Event Player, Null, Phased Out, 9999);
If(Hero Of(Event Player) == Hero(Tracer));
Disallow Button(Event Player, Ability 2);
End;
disabled Global.ZDebug = Filtered Array(All Living Players(All Teams),
Current Array Element.PlayerState == 2 && Event Player != Current Array Element);
If(Count Of(Filtered Array(All Living Players(All Teams),
Current Array Element.PlayerState == 2 && Event Player != Current Array Element)) <= 1);
Global.MatchmakerTicker = Global.ConfigMatchmakerTimer;
End;
}
}
rule("ON STATE 3: Teleport / Reset Player For Match")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Event Player.PlayerState == 3;
}
actions
{
Teleport(Event Player, Global.LobbyPosition + Vector(Random Real(-3, 3), 100, Random Real(-3, 3)));
Preload Hero(Event Player, Hero(Brigitte));
Wait(0.250, Ignore Condition);
Start Forcing Player To Be Hero(Event Player, Hero(Brigitte));
Wait(0.016, Ignore Condition);
Start Forcing Player To Be Hero(Event Player, Global.HeroPoolArray[5 * Event Player.ActiveDuelZone + Event Player.MatchLosses]);
Stop Forcing Player To Be Hero(Event Player);
Disallow Button(Event Player, Primary Fire);
Disallow Button(Event Player, Secondary Fire);
Disallow Button(Event Player, Ability 1);
Disallow Button(Event Player, Ability 2);
Teleport(Event Player, Global.DuelZoneSpawnList[Event Player.ActiveDuelZone * 2 + Event Player.PlayerNumberOffset]);
Wait(0.100, Ignore Condition);
Set Facing(Event Player, Direction Towards(Eye Position(Event Player),
Global.DuelZoneSpawnList[Event Player.ActiveDuelZone * 2 + Event Player.EnemyPlayerNumberOffset]), To World);
Event Player.PlayerState = 4;
Play Effect(Event Player, Buff Explosion Sound, White, Event Player, 50);
Small Message(Event Player, 3);
Wait(1, Ignore Condition);
Play Effect(Event Player, Buff Explosion Sound, White, Event Player, 50);
Small Message(Event Player, 2);
Wait(1, Ignore Condition);
Play Effect(Event Player, Buff Explosion Sound, White, Event Player, 50);
Small Message(Event Player, 1);
Wait(1, Ignore Condition);
Play Effect(Event Player, Ring Explosion Sound, White, Event Player, 86);
Small Message(Event Player, Custom String("FIGHT!"));
Allow Button(Event Player, Primary Fire);
Allow Button(Event Player, Secondary Fire);
Allow Button(Event Player, Ability 1);
Allow Button(Event Player, Ability 2);
Set Status(Event Player, Null, Phased Out, 0);
}
}
rule("ON STATE 4: Player In Match Dies")
{
event
{
Player Died;
All;
All;
}
conditions
{
Is Game In Progress == True;
Event Player.PlayerState == 4;
}
actions
{
Event Player.MatchLosses += 1;
Event Player.TempOpponent = Filtered Array(All Players(All Teams),
Event Player.ActiveDuelZone == Current Array Element.ActiveDuelZone && Event Player != Current Array Element);
Event Player.TempOpponent = First Of(Event Player.TempOpponent);
Event Player.TempOpponent.MatchScore += 1;
If(Event Player.TempOpponent.MatchScore < Global.ConfigScoreToWin);
Play Effect(Event Player.TempOpponent, Explosion Sound, White, Event Player.TempOpponent, 80);
Event Player.PlayerState = 5;
Disable Built-In Game Mode Respawning(Event Player.TempOpponent);
Event Player.TempOpponent.PlayerState = 7;
"Match isn't over, abort running the rest of the code"
Abort;
End;
Set Player Score(Event Player, Max(Min(Score Of(Event Player) + -1, 5), 0));
Set Player Score(Event Player.TempOpponent, Max(Min(Score Of(Event Player.TempOpponent) + 1, 5), 0));
Big Message(Event Player.TempOpponent, Custom String("YOU WON!"));
Wait(1, Ignore Condition);
Event Player.PlayerState = 1;
"Check if the opponent hasn't left"
Abort If(!Entity Exists(Event Player.TempOpponent));
Event Player.TempOpponent.PlayerState = 1;
If(Event Player.LastOpponent == Event Player.TempOpponent);
Event Player.RepeatedOpponentCounter += 1;
Else;
Event Player.RepeatedOpponentCounter = 0;
Event Player.LastOpponent = Event Player.TempOpponent;
End;
"Check if the opponent's opponent hasn't left or become invalid somehow"
Abort If(!Entity Exists(Event Player.TempOpponent.TempOpponent));
If(Event Player.TempOpponent.LastOpponent != Event Player);
Event Player.TempOpponent.RepeatedOpponentCounter = 0;
Event Player.TempOpponent.LastOpponent = Event Player;
End;
Global.DEBUG = 0;
}
}
rule("ON STATE 5: Wait For Loser to Spawn")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Game In Progress == True;
Event Player.PlayerState == 5;
Is Dead(Event Player) == False;
Is Alive(Event Player) == True;
}
actions
{
Event Player.PlayerState = 6;
}
}
rule("ON STATE 5: Loser Won't Spawn")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Game In Progress == True;
Event Player.PlayerState == 5;
}
actions
{
Wait(10, Abort When False);
Event Player.PlayerState = 6;
}
}
rule("ON STATE 6: Loser Spawned")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Game In Progress == True;
Event Player.PlayerState == 6;
Is Alive(Event Player) == True;
}
actions
{
Event Player.TempOpponent = Filtered Array(All Players(All Teams),
Event Player.ActiveDuelZone == Current Array Element.ActiveDuelZone && Event Player != Current Array Element);
Event Player.TempOpponent = First Of(Event Player.TempOpponent);
Enable Built-In Game Mode Respawning(Event Player.TempOpponent);
Event Player.PlayerState = 3;
Resurrect(Event Player.TempOpponent);
Event Player.TempOpponent.PlayerState = 3;
}
}
rule("ON: Lobby Player Dies")
{
event
{
Player Died;
All;
All;
}
conditions
{
Event Player.PlayerState <= 2;
}
actions
{
Event Player.PlayerState = 0;
Event Player.PlayerState = 1;
}
}
rule("ON: Player Spawns")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Has Spawned(Event Player) == True;
}
actions
{
Event Player.PlayerState = 1;
}
}
rule("ON: Run Matchmaker When Clock is 0")
{
event
{
Ongoing - Global;
}
conditions
{
Global.MatchmakerTicker == 0;
}
actions
{
Wait(1, Ignore Condition);
Global.TempWaitingPlayersList = Filtered Array(All Living Players(All Teams), Current Array Element.PlayerState == 2);
Abort If(Count Of(Global.TempWaitingPlayersList) < 2);
Global.TempWaitingPlayersList = Randomized Array(Global.TempWaitingPlayersList);
Global.TempWaitingPlayersList = Sorted Array(Global.TempWaitingPlayersList, (Score Of(Current Array Element) * 25 + (
Current Array Element.TimeSpentWaiting - Current Array Element.RepeatedOpponentCounter * 25)) * -1);
If(Random Real(0, 1000) > 500);
Global.TempPlayerOne = Global.TempWaitingPlayersList[0];
Global.TempPlayerTwo = Global.TempWaitingPlayersList[1];
Else;
Global.TempPlayerOne = Global.TempWaitingPlayersList[1];
Global.TempPlayerTwo = Global.TempWaitingPlayersList[0];
End;
Global.TempAvailableDuelZones = Empty Array;
Skip If(Count Of(Filtered Array(All Players(All Teams), Current Array Element.ActiveDuelZone == 0)) != 0, 1);
Modify Global Variable(TempAvailableDuelZones, Append To Array, 0);
Skip If(Count Of(Filtered Array(All Players(All Teams), Current Array Element.ActiveDuelZone == 1)) != 0, 1);
Modify Global Variable(TempAvailableDuelZones, Append To Array, 1);
Skip If(Count Of(Filtered Array(All Players(All Teams), Current Array Element.ActiveDuelZone == 2)) != 0, 1);
Modify Global Variable(TempAvailableDuelZones, Append To Array, 2);
Skip If(Count Of(Filtered Array(All Players(All Teams), Current Array Element.ActiveDuelZone == 3)) != 0, 1);
Modify Global Variable(TempAvailableDuelZones, Append To Array, 3);
Skip If(Count Of(Filtered Array(All Players(All Teams), Current Array Element.ActiveDuelZone == 4)) != 0, 1);
Modify Global Variable(TempAvailableDuelZones, Append To Array, 4);
Skip If(Count Of(Filtered Array(All Players(All Teams), Current Array Element.ActiveDuelZone == 5)) != 0, 1);
Modify Global Variable(TempAvailableDuelZones, Append To Array, 5);
Global.TempAvailableDuelZones = Random Value In Array(Global.TempAvailableDuelZones);
Global.TempPlayerOne.ActiveDuelZone = Global.TempAvailableDuelZones;
Global.TempPlayerTwo.ActiveDuelZone = Global.TempAvailableDuelZones;
Global.TempPlayerOne.PlayerState = 3;
Global.TempPlayerTwo.PlayerState = 3;
Global.TempPlayerOne.PlayerNumberOffset = 0;
Global.TempPlayerTwo.PlayerNumberOffset = 1;
Global.TempPlayerOne.EnemyPlayerNumberOffset = 1;
Global.TempPlayerTwo.EnemyPlayerNumberOffset = 0;
Global.TempHeroPool = Randomized Array(Allowed Heroes(Global.TempPlayerOne));
Global.HeroPoolArray[5 * Global.TempAvailableDuelZones + 0] = Global.TempHeroPool[0];
Global.HeroPoolArray[5 * Global.TempAvailableDuelZones + 1] = Global.TempHeroPool[1];
Global.HeroPoolArray[5 * Global.TempAvailableDuelZones + 2] = Global.TempHeroPool[2];
Global.HeroPoolArray[5 * Global.TempAvailableDuelZones + 3] = Global.TempHeroPool[3];
Global.HeroPoolArray[5 * Global.TempAvailableDuelZones + 4] = Global.TempHeroPool[4];
Global.TempPlayerOne.CurrentOpponent = Global.TempPlayerTwo;
Global.TempPlayerTwo.CurrentOpponent = Global.TempPlayerOne;
Loop If(Count Of(Global.TempWaitingPlayersList) >= 2);
}
}
rule("LOOP: Matchmaker Clock")
{
event
{
Ongoing - Global;
}
conditions
{
Global.MatchmakerTicker == 0;
}
actions
{
Global.MatchmakerTicker = Global.ConfigMatchmakerTimer;
Chase Global Variable At Rate(MatchmakerTicker, 0, 1, None);
}
}
rule("ON: Damaging Non-Opponent During Match")
{
event
{
Player Dealt Damage;
All;
All;
}
conditions
{
Victim.PlayerState > 2;
Victim != Event Player;
Event Player.ActiveDuelZone != Victim.ActiveDuelZone;
}
actions
{
Kill(Event Player, Null);
Big Message(Event Player, Custom String("NO GRIEFING"));
Modify Player Score(Event Player, -10);
}
}
rule("COLLIDE: Outside of Duel Zone")
{
event
{