Repository navigation
Expand file tree
/
Copy pathplugin.cpp
More file actions
5147 lines (5027 loc) · 276 KB
/
Copy pathplugin.cpp
File metadata and controls
5147 lines (5027 loc) · 276 KB
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
#include "plugin.h"
#include "chat_hints.h"
#include "kill_voice_hashes.h"
#include "round_start_voice_hashes.h"
#include "mvp_music_hashes.h"
#include <irecipientfilter.h>
#include <eiface.h>
#include <interfaces/interfaces.h>
#include <schemasystem/schemasystem.h>
#include <engine/igameeventsystem.h>
#include <entity2/entityinstance.h>
#include <networksystem/inetworkmessages.h>
#include <networksystem/netmessage.h>
#include "gameevents.pb.h"
#include "usermessages.pb.h"
#include "cstrike15_usermessages.pb.h"
#include "cs_usercmd.pb.h"
#include <tier1/convar.h>
#include <const.h>
#include <in_buttons.h>
#include <algorithm>
#include <cmath>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <filesystem>
#include <fstream>
#include <sstream>
ShroudfirePlugin g_shroudfire_plugin;
PLUGIN_EXPOSE(ShroudfirePlugin, g_shroudfire_plugin);
namespace {
#ifdef _WIN32
constexpr size_t kPlayerRunCommandIndex = 25;
#else
constexpr size_t kPlayerRunCommandIndex = 26;
#endif
constexpr char kChatDefault = '\x01';
constexpr char kChatValue = '\x06';
constexpr char kChatBlue = '\x0B';
constexpr char kChatRed = '\x07';
constexpr char kChatGold = '\x09';
constexpr char kChatPrefix[] = " \x04[Shroudfire]\x01 ";
bool stock_kill_voice_name(const std::string &name) {
return name.find("i_killed") != std::string::npos ||
name.find("sees_enemy_killed") != std::string::npos ||
name.find("sees_friend_killed") != std::string::npos ||
name.find("sees_sniper_killed") != std::string::npos ||
name.find("enemydown") != std::string::npos ||
name.find("sniperkilled") != std::string::npos ||
name.find("killedfriend") != std::string::npos ||
name.find("radiobotkill") != std::string::npos ||
name.find("radiobotcheer") != std::string::npos ||
name.find("brag") != std::string::npos ||
name.find("clearedarea") != std::string::npos ||
name.find("round_won") != std::string::npos ||
name.find("round_winning") != std::string::npos ||
name.find("round_lost") != std::string::npos ||
name.find("round_losing") != std::string::npos ||
name.find("victory") != std::string::npos ||
name.find("radio.clear") != std::string::npos ||
name.find(".clear") != std::string::npos ||
name.find(".cheer") != std::string::npos ||
name.find(".taunt") != std::string::npos ||
(name.find("vo/agents/") != std::string::npos &&
(name.find("cheer") != std::string::npos ||
name.find("taunt") != std::string::npos));
}
std::string escape_player_name(const std::string &name) {
std::string escaped;
for (unsigned char c : name) {
if (c == '&') escaped += "&";
else if (c == '<') escaped += "<";
else if (c == '>') escaped += ">";
else if (c >= ' ') escaped += static_cast<char>(c);
}
return escaped.empty() ? "player" : escaped;
}
constexpr char kGuideJoinHint[] = " \x04[Shroudfire]\x01 New? Type "
"\x09" "help\x01 to learn the game";
constexpr char kCheatChatHint[] = " \x04[Shroudfire]\x01 Type "
"\x09" "cheat\x01 to learn why cheating is impossible";
constexpr char kAudioChatHint[] = " \x04[Shroudfire]\x01 Type "
"\x09" "audio\x01 to toggle voice lines on or off";
constexpr char kUpgradeChatHint[] = " \x04[Shroudfire]\x01 Type "
"\x09" "upgrade\x01 to learn about them";
constexpr char kBugsChatHint[] = " \x04[Shroudfire]\x01 Type "
"\x09" "bugs\x01 to learn about footsteps and reloads";
constexpr char kMenuChatHint[] = " \x04[Shroudfire]\x01 Type "
"\x09" "menu\x01 to choose your upgrades";
constexpr char kResetChatHint[] = " \x04[Shroudfire]\x01 Type "
"\x09" "reset\x01 to reset your upgrades";
constexpr char kRankChatHint[] = " \x04[Shroudfire]\x01 Type "
"\x09" "rank\x01 to see your rank";
constexpr std::array<const char *, 6> kArmitiveRoundStartSounds {{
"sounds/shroudfire/face_the_invisant_fear_nothing.vsnd",
"sounds/shroudfire/the_invisant_wants_blood_spill_its_own.vsnd",
"sounds/shroudfire/the_invisant_thinks_its_safe_prove_it_wrong.vsnd",
"sounds/shroudfire/the_invisant_can_bleed_make_it.vsnd",
"sounds/shroudfire/the_invisant_needs_an_opening_give_it_none.vsnd",
"sounds/shroudfire/the_invisant_is_closing_in_stand_your_ground.vsnd"
}};
constexpr std::array<const char *, 6> kInvisantRoundStartSounds {{
"sounds/shroudfire/find_the_gap_take_the_kill.vsnd",
"sounds/shroudfire/they_cannot_see_you_make_them_afraid.vsnd",
"sounds/shroudfire/the_hunt_begins_leave_no_surviors.vsnd",
"sounds/shroudfire/get_close_strike_fast.vsnd",
"sounds/shroudfire/they_are_armed_they_are_afraid.vsnd",
"sounds/shroudfire/choose_one_leave_none.vsnd"
}};
constexpr std::array<const char *, 5> kInvisantRevealWarningSounds {{
"sounds/shroudfire/time_is_running_out_strike.vsnd",
"sounds/shroudfire/your_invisibility_is_failing_end_this.vsnd",
"sounds/shroudfire/the_veil_is_breaking_finish_the_hunt.vsnd",
"sounds/shroudfire/the_shroud_is_fading_kill_them_now.vsnd",
"sounds/shroudfire/your_advantage_is_fading_waste_no_time.vsnd"
}};
constexpr std::array<const char *, 5> kInvisantStarvationSounds {{
"sounds/shroudfire/the_hunger_is_here_find_them.vsnd",
"sounds/shroudfire/your_strength_is_fading_hunt.vsnd",
"sounds/shroudfire/the_shroud_demands_blood_take_it.vsnd",
"sounds/shroudfire/you_are_starving_make_the_next_strike_count.vsnd",
"sounds/shroudfire/every_second_weakens_you_strike.vsnd"
}};
constexpr std::array<const char *, 5> kAfkWarningSounds {{
"sounds/shroudfire/wake_up_take_a_step.vsnd",
"sounds/shroudfire/breaks_over_come_back.vsnd",
"sounds/shroudfire/eyes_up_youre_still_in_the_game.vsnd",
"sounds/shroudfire/the_fight_continues_with_or_without_you.vsnd",
"sounds/shroudfire/still_there_not_for_much_longer.vsnd"
}};
constexpr std::array<const char *, 5> kArmitiveCampingSounds {{
"sounds/shroudfire/you_have_stayed_here_too_long_move.vsnd",
"sounds/shroudfire/stay_there_and_this_place_becomes_your_grave.vsnd",
"sounds/shroudfire/move_now_or_be_removed.vsnd",
"sounds/shroudfire/keep_moving_death_is_closing_in.vsnd",
"sounds/shroudfire/you_have_lingered_long_enough_go.vsnd"
}};
constexpr std::array<const char *, 10> kKillStreakSounds {{
"sounds/shroudfire/first_blood.vsnd",
"sounds/shroudfire/double_kill.vsnd",
"sounds/shroudfire/killing_spree.vsnd",
"sounds/shroudfire/ultra_kill.vsnd",
"sounds/shroudfire/rampage.vsnd",
"sounds/shroudfire/dominating.vsnd",
"sounds/shroudfire/unstoppable.vsnd",
"sounds/shroudfire/monster_kill.vsnd",
"sounds/shroudfire/godlike.vsnd",
"sounds/shroudfire/holy_shit.vsnd"
}};
constexpr std::array<const char *, 3> kArmitiveWinSounds {{
"sounds/shroudfire/armitive_win.vsnd",
"sounds/shroudfire/armitive_win2.vsnd",
"sounds/shroudfire/armitive_win3.vsnd"
}};
constexpr std::array<const char *, 3> kInvisantWinSounds {{
"sounds/shroudfire/invisant_win.vsnd",
"sounds/shroudfire/invisant_win2.vsnd",
"sounds/shroudfire/invisant_win3.vsnd"
}};
constexpr std::array<const char *, 3> kRoundDrawSounds {{
"sounds/shroudfire/round_draw.vsnd",
"sounds/shroudfire/round_draw2.vsnd",
"sounds/shroudfire/round_draw3.vsnd"
}};
constexpr std::array<const char *, 16> kUpgradeNames {{
"Lightweight", "Momentum", "Resilience", "Reforging", "Vampirism", "Bloodlust",
"Mobility", "Surge", "Fortitude", "Recovery", "Overload", "Stockpile",
"Barrage", "Control", "Dexterity", "Ward"
}};
constexpr std::array<const char *, 3> kLocalMovementBlockerEvents {{
"shroudfire.silence_movement_steps",
"shroudfire.silence_movement_jump",
"shroudfire.silence_movement_land"
}};
constexpr std::array<const char *, 13> kHelpPages {{
"<font color='#7fa7ff'><b>INVISANT</b></font><br>"
"<font color='#7fa7ff'>Invis</font><font color='#ffb900'>ible assail</font><font color='#7fa7ff'>ant</font><font color='#ffb900'>.</font><br>"
"<font color='#e07a6a'>Armitive</font><font color='#ffb900'> cannot hear your</font><br>"
"<font color='#ffb900'>footsteps. Kill all </font><font color='#e07a6a'>Armitive</font><font color='#ffb900'> to</font><br>"
"<font color='#ffb900'>win. Track living </font><font color='#e07a6a'>Armitive</font><br>"
"<font color='#ffb900'>through walls. No fall damage.</font>",
"<font color='#7fa7ff'><b>INVISANT</b></font><br>"
"<font color='#ffb900'>Knife-only. </font><font color='#93c47d'>{KNIFE_CONE}</font><font color='#ffb900'> deg cone.</font><br>"
"<font color='#93c47d'>{KNIFE_RANGE}</font><font color='#ffb900'> units of reach.</font><br>"
"<font color='#93c47d'>{KNIFE_DAMAGE_MIN}-{KNIFE_DAMAGE_MAX}</font><font color='#ffb900'> damage per hit.</font><br>"
"<font color='#ffb900'>No backstab bonus. Attacks at</font><br>"
"<font color='#93c47d'>{KNIFE_SPEED}%</font><font color='#ffb900'> of normal speed.</font>",
"<font color='#7fa7ff'><b>INVISANT</b></font><br>"
"<font color='#ffb900'>After </font><font color='#93c47d'>{STARVATION_ROUND_DELAY}s</font><font color='#ffb900'> of live play, </font><font color='#93c47d'>{STARVATION_COMBAT_DELAY}s</font><br>"
"<font color='#ffb900'>without dealing or taking</font><br>"
"<font color='#ffb900'>damage starts </font><font color='#b9a176'>Starvation</font><font color='#ffb900'>.</font><br>"
"<font color='#93c47d'>{STARVATION_DAMAGE}</font><font color='#ffb900'> HP / </font><font color='#93c47d'>{STARVATION_INTERVAL}s</font><font color='#ffb900'>; after </font><font color='#93c47d'>{STARVATION_ACCELERATION_DELAY}s</font><font color='#ffb900'>:</font><br>"
"<font color='#93c47d'>{STARVATION_ACCELERATED_DAMAGE}</font><font color='#ffb900'> HP / </font><font color='#93c47d'>{STARVATION_ACCELERATED_INTERVAL}s</font><font color='#ffb900'> until combat.</font>",
"<font color='#e07a6a'><b>ARMITIVE</b></font><br>"
"<font color='#e07a6a'>Arm</font><font color='#ffb900'>ed fug</font><font color='#e07a6a'>itive</font><font color='#ffb900'>. Find the</font><br>"
"<font color='#7fa7ff'>Invisant</font><font color='#ffb900'> with firearms, blood,</font><br>"
"<font color='#ffb900'>and contact. Buy weapons</font><br>"
"<font color='#ffb900'>permitted by this server.</font><br>"
"<font color='#ffb900'>Win if any survive the timer.</font>",
"<font color='#e07a6a'><b>ARMITIVE</b></font><br>"
"<font color='#ffb900'>Headshot damage to </font><font color='#7fa7ff'>Invisant</font><font color='#ffb900'> is</font><br>"
"<font color='#ffb900'>halved and capped at </font><font color='#93c47d'>90</font><font color='#ffb900'>. One</font><br>"
"<font color='#ffb900'>headshot cannot kill a</font><br>"
"<font color='#ffb900'>full-health </font><font color='#7fa7ff'>Invisant</font><font color='#ffb900'>.</font><br>"
"<font color='#ffb900'>Timer ends: </font><font color='#7fa7ff'>Invisant</font><font color='#ffb900'> {TIMEOUT_RESULT}</font>",
"<font color='#93c47d'><b>ROUND END</b></font><br>"
"<font color='#ffb900'>The round result is final.</font><br>"
"<font color='#ffb900'>Kills after round end give no</font><br>"
"<font color='#ffb900'>XP, rank, or </font><font color='#7fa7ff'>Invisant</font><font color='#ffb900'> priority.</font><br>"
"<font color='#ffb900'>Keep earned priority and wait</font><br>"
"<font color='#ffb900'>for the next round.</font>",
"<font color='#93c47d'><b>ROTATION</b></font><br>"
"<font color='#ffb900'>Roles rotate each round. A</font><br>"
"<font color='#e07a6a'>Armitive</font><font color='#ffb900'> who kills an </font><font color='#7fa7ff'>Invisant</font><br>"
"<font color='#ffb900'>gets priority to become </font><font color='#7fa7ff'>Invisant</font><br>"
"<font color='#ffb900'>next round.</font>",
"<font color='#93c47d'><b>ROTATION</b></font><br>"
"<font color='#ffb900'>Otherwise, the longest-waiting</font><br>"
"<font color='#ffb900'>eligible player becomes</font><br>"
"<font color='#7fa7ff'>Invisant</font><font color='#ffb900'>. Suicide forfeits</font><br>"
"<font color='#ffb900'>next-round eligibility.</font>",
"<font color='#93c47d'><b>RANKINGS</b></font><br>"
"<font color='#ffb900'>Type </font><font color='#b9a176'>rank</font><font color='#ffb900'> in chat to see your</font><br>"
"<font color='#7fa7ff'>Invisant</font><font color='#ffb900'> and </font><font color='#e07a6a'>Armitive</font><font color='#ffb900'> ranks.</font><br>"
"<font color='#ffb900'>Kills and assists raise ratings;</font><br>"
"<font color='#ffb900'>deaths lower them. More combat</font><br>"
"<font color='#ffb900'>makes your record count more.</font>",
"<font color='#93c47d'><b>PROGRESSION</b></font><br>"
"<font color='#ffb900'>Kills, qualifying damage</font><br>"
"<font color='#ffb900'>assists, and completed-round</font><br>"
"<font color='#ffb900'>wins grant separate </font><font color='#7fa7ff'>Invisant</font><font color='#ffb900'> and</font><br>"
"<font color='#e07a6a'>Armitive</font><font color='#ffb900'> XP.</font>",
"<font color='#93c47d'><b>PROGRESSION</b></font><br>"
"<font color='#ffb900'>As </font><font color='#e07a6a'>Armitive</font><font color='#ffb900'>, knife kills earn </font><font color='#93c47d'>{KNIFE_XP}%</font><br>"
"<font color='#ffb900'>kill XP; pistol kills, </font><font color='#93c47d'>{PISTOL_XP}%</font><font color='#ffb900'>.</font><br>"
"<font color='#ffb900'>Levels grant upgrade points. In</font><br>"
"<font color='#ffb900'>chat, type </font><font color='#b9a176'>upgrade</font><font color='#ffb900'> for effects;</font><br>"
"<font color='#b9a176'>menu</font><font color='#ffb900'> to spend or reset points.</font>",
"<font color='#93c47d'><b>KILL STREAKS</b></font><br>"
"<font color='#ffb900'>In 2v2+ rounds, the first enemy</font><br>"
"<font color='#ffb900'>kill earns </font><font color='#b9a176'>First Blood</font><font color='#ffb900'>: </font><font color='#93c47d'>125%</font><br>"
"<font color='#ffb900'>kill XP. Your second kill within</font><br>"
"<font color='#93c47d'>10s</font><font color='#ffb900'> of the last earns </font><font color='#93c47d'>120%</font><font color='#ffb900'>.</font>",
"<font color='#93c47d'><b>KILL STREAKS</b></font><br>"
"<font color='#ffb900'>Each later kill within </font><font color='#93c47d'>10s</font><font color='#ffb900'> of</font><br>"
"<font color='#ffb900'>your last adds </font><font color='#93c47d'>10%</font><font color='#ffb900'> kill XP, up</font><br>"
"<font color='#ffb900'>to </font><font color='#93c47d'>200%</font><font color='#ffb900'> on your tenth kill. Only</font><br>"
"<font color='#ffb900'>you hear the sounds.</font><br>"
"<font color='#ffb900'>Type </font><font color='#b9a176'>help</font><font color='#ffb900'> to reopen this panel.</font>"
}};
constexpr std::array<const char *, 3> kCheatPages {{
"<font color='#93c47d'><b>ESP AND WALLHACKS</b></font><br>"
"<font color='#7fa7ff'>Invisant</font><font color='#ffb900'> are not made</font><br>"
"<font color='#ffb900'>transparent. The server does not</font><br>"
"<font color='#ffb900'>send </font><font color='#7fa7ff'>Invisant</font><font color='#ffb900'> players, or their</font><br>"
"<font color='#ffb900'>weapon and movement sounds, to</font><br>"
"<font color='#e07a6a'>Armitive</font><font color='#ffb900'> computers.</font>",
"<font color='#93c47d'><b>ESP AND WALLHACKS</b></font><br>"
"<font color='#ffb900'>ESP and wallhacks can only show</font><br>"
"<font color='#ffb900'>data a computer receives. With</font><br>"
"<font color='#ffb900'>no </font><font color='#7fa7ff'>Invisant</font><font color='#ffb900'> player data, they</font><br>"
"<font color='#ffb900'>cannot reveal or track an</font><br>"
"<font color='#7fa7ff'>Invisant</font><font color='#ffb900'>.</font>",
"<font color='#93c47d'><b>ESP AND WALLHACKS</b></font><br>"
"<font color='#e07a6a'>Armitive</font><font color='#ffb900'> still see blood and</font><br>"
"<font color='#ffb900'>bullet impacts, and hear damage</font><br>"
"<font color='#ffb900'>sounds. </font><font color='#d6b86a'>Report suspicious</font><br>"
"<font color='#d6b86a'>behavior to an administrator.</font>"
}};
constexpr std::array<const char *, 2> kKnownBugPages {{
"<font color='#78b9ff'><b>INVISANT AUDIO</b></font><br>"
"<font color='#ffb900'>You still hear your footsteps,</font><br>"
"<font color='#ffb900'>jumps and landings. CS2 plays</font><br>"
"<font color='#ffb900'>these locally. The server filters</font><br>"
"<font color='#ffb900'>them before sending to Armitive.</font>",
"<font color='#ff7169'><b>DEXTERITY ANIMATIONS</b></font><br>"
"<font color='#ffb900'>Reload and weapon switch</font><br>"
"<font color='#ffb900'>animations may look unchanged.</font><br>"
"<font color='#ffb900'>Dexterity still makes ammo ready</font><br>"
"<font color='#ffb900'>and lets you fire sooner.</font>"
}};
constexpr std::array<const char *, 9> kUpgradePages {{
"<font color='#ffb900'>Normal stages unlock at role</font><br>"
"<font color='#ffb900'>levels </font><font color='#93c47d'>{N1}</font><font color='#ffb900'>, </font><font color='#93c47d'>{N2}</font><font color='#ffb900'>, </font><font color='#93c47d'>{N3}</font><font color='#ffb900'>, </font><font color='#93c47d'>{N4}</font><font color='#ffb900'> and </font><font color='#93c47d'>{N5}</font><br>"
"<font color='#ffb900'>Ultimate stages unlock at role</font><br>"
"<font color='#ffb900'>levels </font><font color='#93c47d'>{U1}</font><font color='#ffb900'>, </font><font color='#93c47d'>{U2}</font><font color='#ffb900'>, </font><font color='#93c47d'>{U3}</font><font color='#ffb900'>, </font><font color='#93c47d'>{U4}</font><font color='#ffb900'> and </font><font color='#93c47d'>{U5}</font><br>"
"<font color='#ffb900'>Type </font><font color='#b9a176'>menu</font><font color='#ffb900'> to spend/reset points</font>",
"<font color='#e07a6a'><b>ARMITIVE</b></font><br>"
"<font color='#e07a6a'>Fortitude</font><font color='#ffb900'> - Gain </font><font color='#93c47d'>{FORTITUDE}</font><font color='#ffb900'> maximum</font><br>"
"<font color='#ffb900'>health per stage</font><br>"
"<font color='#e07a6a'>Recovery</font><font color='#ffb900'> - Restore </font><font color='#93c47d'>{RECOVERY}</font><font color='#ffb900'> health</font><br>"
"<font color='#ffb900'>per stage every </font><font color='#93c47d'>{RECOVERY_INTERVAL}</font><font color='#ffb900'> seconds</font>",
"<font color='#e07a6a'><b>ARMITIVE</b></font><br>"
"<font color='#e07a6a'>Overload</font><font color='#ffb900'> - Gain </font><font color='#93c47d'>{OVERLOAD}%</font><font color='#ffb900'> extra</font><br>"
"<font color='#ffb900'>magazine capacity per stage</font><br>"
"<font color='#e07a6a'>Stockpile</font><font color='#ffb900'> - Gain </font><font color='#93c47d'>{STOCKPILE}</font><font color='#ffb900'> extra</font><br>"
"<font color='#ffb900'>reserve ammo clip per stage</font>",
"<font color='#e07a6a'><b>ARMITIVE</b></font><br>"
"<font color='#e07a6a'>Barrage</font><font color='#ffb900'> - Gain </font><font color='#93c47d'>{BARRAGE}%</font><font color='#ffb900'> faster</font><br>"
"<font color='#ffb900'>weapon fire rate per stage</font><br>"
"<font color='#e07a6a'>Control</font><font color='#ffb900'> - Gain </font><font color='#93c47d'>{CONTROL}%</font><font color='#ffb900'> less recoil</font><br>"
"<font color='#ffb900'>and bullet spread per stage</font>",
"<font color='#e07a6a'><b>ARMITIVE</b></font><br>"
"<font color='#e07a6a'>Dexterity</font><font color='#ffb900'> - Gain </font><font color='#93c47d'>{DEXTERITY}%</font><font color='#ffb900'> faster</font><br>"
"<font color='#ffb900'>weapon switch and reload</font><br>"
"<font color='#e07a6a'>Ultimate: Ward</font><font color='#ffb900'> - Press </font><font color='#93c47d'>E</font><font color='#ffb900'> for</font><br>"
"<font color='#93c47d'>{WARD_BASE}</font><font color='#ffb900'> seconds of immunity at </font><font color='#93c47d'>1</font><font color='#ffb900'>/</font><font color='#93c47d'>5</font><font color='#ffb900'>,</font><br>"
"<font color='#ffb900'>plus </font><font color='#93c47d'>{WARD_STEP}</font><font color='#ffb900'> seconds per stage</font>",
"<font color='#7fa7ff'><b>INVISANT</b></font><br>"
"<font color='#7fa7ff'>Lightweight</font><font color='#ffb900'> - Gain </font><font color='#93c47d'>{LIGHTWEIGHT}%</font><font color='#ffb900'> less</font><br>"
"<font color='#ffb900'>gravity per stage</font><br>"
"<font color='#7fa7ff'>Momentum</font><font color='#ffb900'> - Gain </font><font color='#93c47d'>{MOMENTUM}%</font><font color='#ffb900'> faster</font><br>"
"<font color='#ffb900'>run speed per stage</font>",
"<font color='#7fa7ff'><b>INVISANT</b></font><br>"
"<font color='#7fa7ff'>Resilience</font><font color='#ffb900'> - Gain </font><font color='#93c47d'>{RESILIENCE}</font><font color='#ffb900'> armor</font><br>"
"<font color='#ffb900'>per stage and helmet at </font><font color='#ffb900'>{HELMET_STAGE}/5</font><br>"
"<font color='#7fa7ff'>Reforging</font><font color='#ffb900'> - Gain </font><font color='#93c47d'>{REFORGING}</font><font color='#ffb900'> armor per</font><br>"
"<font color='#ffb900'>stage every </font><font color='#93c47d'>{REFORGING_INTERVAL}</font><font color='#ffb900'> seconds</font>",
"<font color='#7fa7ff'><b>INVISANT</b></font><br>"
"<font color='#7fa7ff'>Vampirism</font><font color='#ffb900'> - Gain </font><font color='#93c47d'>{VAMPIRISM}</font><font color='#ffb900'> health per</font><br>"
"<font color='#ffb900'>stage when dealing damage</font><br>"
"<font color='#7fa7ff'>Bloodlust</font><font color='#ffb900'> - Gain </font><font color='#93c47d'>{BLOODLUST}</font><font color='#ffb900'> health per</font><br>"
"<font color='#ffb900'>stage when killing an enemy</font>",
"<font color='#7fa7ff'><b>INVISANT</b></font><br>"
"<font color='#7fa7ff'>Mobility</font><font color='#ffb900'> - Gain </font><font color='#93c47d'>{MOBILITY}%</font><font color='#ffb900'> faster</font><br>"
"<font color='#ffb900'>crouching speed per stage</font><br>"
"<font color='#7fa7ff'>Ultimate: Surge</font><font color='#ffb900'> - Press </font><font color='#93c47d'>E</font><font color='#ffb900'> for a</font><br>"
"<font color='#93c47d'>{SURGE_BASE}</font><font color='#ffb900'> unit speed boost at </font><font color='#93c47d'>1</font><font color='#ffb900'>/</font><font color='#93c47d'>5</font><font color='#ffb900'>,</font><br>"
"<font color='#ffb900'>increased by </font><font color='#93c47d'>{SURGE_STEP}</font><font color='#ffb900'> per stage</font>"
}};
struct SoundRecipientsRestore {
IRecipientFilter *filter;
uint64_t removed;
};
thread_local std::vector<SoundRecipientsRestore> sound_recipients_restore;
struct MovementFrameRestore { CGlobalVars *globals; float frametime; };
thread_local std::vector<MovementFrameRestore> movement_frametimes_restore;
struct ServerUserCommandBase {
virtual ~ServerUserCommandBase();
int command_number;
uint8_t unknown[4];
};
struct ServerUserCommand : ServerUserCommandBase, CSGOUserCmdPB {
void *button_vtable;
uint64_t button_states[3];
uint32_t unknown;
uint32_t flags;
void *unknown_command;
void *parent_command;
};
#ifndef _WIN32
static_assert(sizeof(ServerUserCommand) == 144, "CS2 user command layout changed");
#endif
}
static CConVar<int> sf_normal_stage1_level("sf_normal_stage1_level", FCVAR_NONE,
"Role level required for normal upgrade stage 1.", 1, true, 1, true, 40);
static CConVar<int> sf_normal_stage2_level("sf_normal_stage2_level", FCVAR_NONE,
"Role level required for normal upgrade stage 2.", 5, true, 1, true, 40);
static CConVar<int> sf_normal_stage3_level("sf_normal_stage3_level", FCVAR_NONE,
"Role level required for normal upgrade stage 3.", 10, true, 1, true, 40);
static CConVar<int> sf_normal_stage4_level("sf_normal_stage4_level", FCVAR_NONE,
"Role level required for normal upgrade stage 4.", 15, true, 1, true, 40);
static CConVar<int> sf_normal_stage5_level("sf_normal_stage5_level", FCVAR_NONE,
"Role level required for normal upgrade stage 5.", 20, true, 1, true, 40);
static CConVar<int> sf_ultimate_stage1_level("sf_ultimate_stage1_level", FCVAR_NONE,
"Role level required for ultimate upgrade stage 1.", 8, true, 1, true, 40);
static CConVar<int> sf_ultimate_stage2_level("sf_ultimate_stage2_level", FCVAR_NONE,
"Role level required for ultimate upgrade stage 2.", 16, true, 1, true, 40);
static CConVar<int> sf_ultimate_stage3_level("sf_ultimate_stage3_level", FCVAR_NONE,
"Role level required for ultimate upgrade stage 3.", 24, true, 1, true, 40);
static CConVar<int> sf_ultimate_stage4_level("sf_ultimate_stage4_level", FCVAR_NONE,
"Role level required for ultimate upgrade stage 4.", 32, true, 1, true, 40);
static CConVar<int> sf_ultimate_stage5_level("sf_ultimate_stage5_level", FCVAR_NONE,
"Role level required for ultimate upgrade stage 5.", 40, true, 1, true, 40);
static CConVar<int> sf_invisant_base_armor("sf_invisant_base_armor", FCVAR_NONE,
"Invisant armor before Resilience.", 25, true, 0, true, 200);
static CConVar<int> sf_knife_damage_min("sf_knife_damage_min", FCVAR_NONE,
"Minimum Invisant knife damage per hit, inclusive.", 50, true, 1, true, 1000);
static CConVar<int> sf_knife_damage_max("sf_knife_damage_max", FCVAR_NONE,
"Maximum Invisant knife damage per hit, inclusive.", 75, true, 1, true, 1000);
static CConVar<CUtlString> sf_armitive_blocked_weapons("sf_armitive_blocked_weapons", FCVAR_NONE,
"Comma-separated weapons Armitive cannot buy; empty allows all weapons.", CUtlString("m249"));
static CConVar<float> sf_knife_range("sf_knife_range", FCVAR_NONE,
"Maximum Invisant knife reach in units; 0 disables extended hits.",
72.0f, true, 0.0f, true, 16384.0f);
static CConVar<float> sf_knife_cone("sf_knife_cone", FCVAR_NONE,
"Full Invisant knife cone width in degrees; 360 covers every direction.",
60.0f, true, 0.0f, true, 360.0f);
static CConVar<int> sf_knife_attack_speed_percent("sf_knife_attack_speed_percent", FCVAR_NONE,
"Invisant knife attack speed as a percent of normal; 100 restores the normal rate.",
66, true, 1, true, 100);
static CConVar<int> sf_knife_miss_sound("sf_knife_miss_sound", FCVAR_NONE,
"Replay Invisant knife air-miss sounds spatially to Armitive players.",
1, true, 0, true, 1);
static CConVar<int> sf_knife_world_hit_sound("sf_knife_world_hit_sound", FCVAR_NONE,
"Replay Invisant knife wall and ground impact sounds spatially to Armitive players.",
1, true, 0, true, 1);
static CConVar<int> sf_lightweight_gravity_percent("sf_lightweight_gravity_percent", FCVAR_NONE,
"Gravity reduction percent per Lightweight stage.", 10, true, 0, true, 20);
static CConVar<int> sf_momentum_run_percent("sf_momentum_run_percent", FCVAR_NONE,
"Run speed increase percent per Momentum stage.", 3, true, 0, true, 100);
static CConVar<int> sf_resilience_armor_per_stage("sf_resilience_armor_per_stage", FCVAR_NONE,
"Maximum armor gained per Resilience stage.", 15, true, 0, true, 100);
static CConVar<int> sf_resilience_helmet_stage("sf_resilience_helmet_stage", FCVAR_NONE,
"Resilience stage that grants a helmet.", 5, true, 1, true, 5);
static CConVar<int> sf_reforging_armor_per_stage("sf_reforging_armor_per_stage", FCVAR_NONE,
"Armor regenerated per Reforging stage each interval.", 1, true, 0, true, 100);
static CConVar<int> sf_reforging_interval("sf_reforging_interval", FCVAR_NONE,
"Seconds between Reforging armor ticks and after damage.", 3, true, 1, true, 60);
static CConVar<int> sf_vampirism_health_per_stage("sf_vampirism_health_per_stage", FCVAR_NONE,
"Health restored per Vampirism stage on a damaging hit.", 3, true, 0, true, 100);
static CConVar<int> sf_bloodlust_health_per_stage("sf_bloodlust_health_per_stage", FCVAR_NONE,
"Health restored per Bloodlust stage on a kill.", 6, true, 0, true, 100);
static CConVar<int> sf_mobility_crouch_percent("sf_mobility_crouch_percent", FCVAR_NONE,
"Crouch speed increase percent per Mobility stage.", 15, true, 0, true, 100);
static CConVar<int> sf_surge_base_speed("sf_surge_base_speed", FCVAR_NONE,
"Surge speed boost at stage 1. Default: 480.", 480, true, 0, true, 2000);
static CConVar<int> sf_surge_speed_per_stage("sf_surge_speed_per_stage", FCVAR_NONE,
"Additional Surge speed boost for each stage after stage 1. Default: 30.", 30, true, 0, true, 1000);
static CConVar<int> sf_surge_add_momentum("sf_surge_add_momentum", FCVAR_NONE,
"Whether Surge adds to current velocity (1) or replaces it (0). Default: 0.", 0, true, 0, true, 1);
static CConVar<int> sf_surge_cooldown("sf_surge_cooldown", FCVAR_NONE,
"Seconds until Surge is ready after use.", 20, true, 0, true, 300);
static CConVar<int> sf_armitive_base_health("sf_armitive_base_health", FCVAR_NONE,
"Armitive health before Fortitude.", 100, true, 1, true, 500);
static CConVar<int> sf_fortitude_health_per_stage("sf_fortitude_health_per_stage", FCVAR_NONE,
"Maximum health gained per Fortitude stage.", 10, true, 0, true, 100);
static CConVar<int> sf_recovery_health_per_stage("sf_recovery_health_per_stage", FCVAR_NONE,
"Health regenerated per Recovery stage each interval.", 1, true, 0, true, 100);
static CConVar<int> sf_recovery_interval("sf_recovery_interval", FCVAR_NONE,
"Seconds between Recovery health ticks and after damage.", 3, true, 1, true, 60);
static CConVar<int> sf_overload_magazine_percent("sf_overload_magazine_percent", FCVAR_NONE,
"Magazine capacity increase percent per Overload stage.", 10, true, 0, true, 50);
static CConVar<int> sf_stockpile_clips_per_stage("sf_stockpile_clips_per_stage", FCVAR_NONE,
"Extra reserve clips per Stockpile stage.", 1, true, 0, true, 5);
static CConVar<int> sf_barrage_fire_rate_percent("sf_barrage_fire_rate_percent", FCVAR_NONE,
"Weapon fire rate increase percent per Barrage stage.", 7, true, 0, true, 100);
static CConVar<int> sf_control_reduction_percent("sf_control_reduction_percent", FCVAR_NONE,
"Recoil and spread reduction percent per Control stage.", 10, true, 0, true, 20);
static CConVar<int> sf_dexterity_speed_percent("sf_dexterity_speed_percent", FCVAR_NONE,
"Reload and weapon switch time reduction percent per Dexterity stage.", 12, true, 0, true, 19);
static CConVar<float> sf_ward_base_seconds("sf_ward_base_seconds", FCVAR_NONE,
"Ward immunity duration at stage 1 in seconds.", 2.0f, true, 0.1f, true, 30.0f);
static CConVar<float> sf_ward_seconds_per_stage("sf_ward_seconds_per_stage", FCVAR_NONE,
"Additional Ward seconds for each stage after stage 1.", 0.5f, true, 0.0f, true, 10.0f);
static CConVar<int> sf_ward_cooldown("sf_ward_cooldown", FCVAR_NONE,
"Seconds until Ward is ready after it ends.", 30, true, 0, true, 300);
static CConVar<int> sf_upgrade_purchase_window("sf_upgrade_purchase_window", FCVAR_NONE,
"Seconds from round start when purchased or reset upgrades apply immediately.",
20, true, 0, true, 120);
static CConVar<int> sf_enable("sf_enable", FCVAR_NONE,
"Enables Shroudfire.", 0, true, 0, true, 1);
static CConVar<int> sf_invisant_team("sf_invisant_team", FCVAR_NONE,
"Selects the Invisant team: 2 for Terrorists or 3 for Counter-Terrorists.", 3, true, 2, true, 3);
static CConVar<int> sf_visible_per_invisant("sf_visible_per_invisant", FCVAR_NONE,
"Maximum number of Armitive players per Invisant player.", 4, true, 2, true, 32);
static CConVar<int> sf_round_time("sf_round_time", FCVAR_NONE,
"Seconds before an unfinished round ends with an Armitive win.", 120, true, 30, true, 3600);
static CConVar<int> sf_map_max_rounds("sf_map_max_rounds", FCVAR_NONE,
"Completed rounds per map before changing maps; 0 disables the round limit.",
20, true, 0, true, 1000);
static CConVar<float> sf_map_time_limit("sf_map_time_limit", FCVAR_NONE,
"Minutes per map with at least two active human players before changing maps; 0 disables the time limit.",
30.0f, true, 0.0f, true, 1440.0f);
static CConVar<CUtlString> sf_map_rotation("sf_map_rotation", FCVAR_NONE,
"Comma-separated map rotation; unavailable maps are skipped.",
CUtlString("de_dust2,de_mirage,de_inferno,de_nuke"));
static CConVar<int> sf_timeout_kill_invisant("sf_timeout_kill_invisant", FCVAR_NONE,
"Kill surviving Invisant at timeout; 0 reveals them during the 10-second round transition instead.", 0, true, 0, true, 1);
static CConVar<float> sf_timeout_reveal_seconds("sf_timeout_reveal_seconds", FCVAR_NONE,
"Seconds for surviving Invisant to fade from invisible to visible after timeout; 0 reveals instantly.", 2.0f, true, 0.0f, true, 10.0f);
static CConVar<int> sf_map_join_grace("sf_map_join_grace", FCVAR_NONE,
"Seconds after map start in which joining players can respawn as Armitive.", 30, true, 0, true, 120);
static CConVar<int> sf_afk_seconds("sf_afk_seconds", FCVAR_NONE,
"Seconds of inactivity after freeze time before a player is killed; 0 disables AFK deaths.",
30, true, 0, true, 600);
static CConVar<int> sf_afk_warning_seconds("sf_afk_warning_seconds", FCVAR_NONE,
"Seconds before AFK death to start the HTML countdown and warning sounds; 0 disables the warnings.",
10, true, 0, true, 600);
static CConVar<int> sf_afk_limit("sf_afk_limit", FCVAR_NONE,
"Consecutive deaths without live-round movement before a player is kicked; 0 disables kicks.",
5, true, 0, true, 100);
static CConVar<float> sf_starvation_round_delay("sf_starvation_round_delay", FCVAR_NONE,
"Seconds of live play after freeze time before Invisant starvation can begin.",
60.0f, true, 0.0f, true, 3600.0f);
static CConVar<float> sf_starvation_combat_delay("sf_starvation_combat_delay", FCVAR_NONE,
"Seconds without dealing or taking damage before Invisant starvation begins.",
45.0f, true, 0.0f, true, 3600.0f);
static CConVar<int> sf_starvation_damage("sf_starvation_damage", FCVAR_NONE,
"Health an Invisant loses per starvation tick before acceleration.",
1, true, 1, true, 500);
static CConVar<float> sf_starvation_interval("sf_starvation_interval", FCVAR_NONE,
"Seconds between Invisant starvation ticks before acceleration.",
1.0f, true, 0.1f, true, 60.0f);
static CConVar<float> sf_starvation_acceleration_delay("sf_starvation_acceleration_delay", FCVAR_NONE,
"Seconds of uninterrupted starvation before accelerated ticks begin; 0 accelerates immediately.",
20.0f, true, 0.0f, true, 3600.0f);
static CConVar<float> sf_starvation_accelerated_interval("sf_starvation_accelerated_interval", FCVAR_NONE,
"Seconds between Invisant starvation ticks after acceleration.",
1.0f, true, 0.1f, true, 60.0f);
static CConVar<int> sf_starvation_accelerated_damage("sf_starvation_accelerated_damage", FCVAR_NONE,
"Health an Invisant loses per starvation tick after acceleration.",
3, true, 1, true, 500);
static CConVar<float> sf_camping_distance("sf_camping_distance", FCVAR_NONE,
"Distance in units an Armitive must move from the tracked position before the camping timer resets; 0 disables anti-camping.",
256.0f, true, 0.0f, true, 4096.0f);
static CConVar<float> sf_camping_warning_seconds("sf_camping_warning_seconds", FCVAR_NONE,
"Seconds an Armitive may remain within the camping distance before the HTML and voice warning.",
20.0f, true, 0.0f, true, 600.0f);
static CConVar<float> sf_camping_damage_delay("sf_camping_damage_delay", FCVAR_NONE,
"Seconds from the Armitive camping warning until health loss begins.",
10.0f, true, 0.0f, true, 600.0f);
static CConVar<int> sf_camping_damage("sf_camping_damage", FCVAR_NONE,
"Health an Armitive loses per second while camping.", 10, true, 1, true, 500);
static CConVar<int> sf_queue_reconnect_grace("sf_queue_reconnect_grace", FCVAR_NONE,
"Seconds a reconnecting player retains queue age; 0 is unlimited.", 600, true, 0, true, 86400);
static CConVar<int> sf_xp_kill_invisant("sf_xp_kill_invisant", FCVAR_NONE,
"XP for an Invisant killing an Armitive player.", 50, true, 0, true, 10000);
static CConVar<int> sf_xp_kill_armitive("sf_xp_kill_armitive", FCVAR_NONE,
"XP for an Armitive player killing an Invisant.", 100, true, 0, true, 10000);
static CConVar<int> sf_xp_round_win_invisant("sf_xp_round_win_invisant", FCVAR_NONE,
"XP for an Invisant participant on a completed win.", 70, true, 0, true, 10000);
static CConVar<int> sf_xp_round_win_armitive("sf_xp_round_win_armitive", FCVAR_NONE,
"XP for an Armitive participant on a completed win.", 35, true, 0, true, 10000);
static CConVar<int> sf_xp_armitive_pistol_percent("sf_xp_armitive_pistol_percent", FCVAR_NONE,
"Armitive pistol kill XP as a percent of Armitive base kill XP; 100 removes the bonus.", 125, true, 0, true, 1000);
static CConVar<int> sf_xp_armitive_knife_percent("sf_xp_armitive_knife_percent", FCVAR_NONE,
"Armitive knife kill XP as a percent of Armitive base kill XP; 100 removes the bonus.", 150, true, 0, true, 1000);
static CConVar<int> sf_xp_level_base("sf_xp_level_base", FCVAR_NONE,
"Base XP for the level curve.", 100, true, 1, true, 1000000);
static CConVar<float> sf_kill_streak_window("sf_kill_streak_window", FCVAR_NONE,
"Maximum seconds between a player's consecutive opponent kills for a kill streak.",
10.0f, true, 1.0f, true, 60.0f);
static CConVar<float> sf_xp_assist_fraction("sf_xp_assist_fraction", FCVAR_NONE,
"Fraction of the current role's kill XP awarded for a qualifying assist. Set to 0 to disable assist XP.",
0.25f, true, 0.0f, true, 1.0f);
static CConVar<float> sf_xp_assist_damage_share("sf_xp_assist_damage_share", FCVAR_NONE,
"Minimum share of a victim's opposing-player damage required for assist XP. 0.25 means 25 percent.",
0.25f, true, 0.0f, true, 1.0f);
static CConVar<int> sf_xp_first_blood_percent("sf_xp_first_blood_percent", FCVAR_NONE,
"Kill XP percent for First Blood; multiplies the Armitive knife or pistol bonus when applicable.", 125, true, 0, true, 1000);
static CConVar<int> sf_xp_double_kill_percent("sf_xp_double_kill_percent", FCVAR_NONE,
"Kill XP percent for Double Kill; multiplies the Armitive knife or pistol bonus when applicable.", 120, true, 0, true, 1000);
static CConVar<int> sf_xp_killing_spree_percent("sf_xp_killing_spree_percent", FCVAR_NONE,
"Kill XP percent for Killing Spree; multiplies the Armitive knife or pistol bonus when applicable.", 130, true, 0, true, 1000);
static CConVar<int> sf_xp_ultra_kill_percent("sf_xp_ultra_kill_percent", FCVAR_NONE,
"Kill XP percent for Ultra Kill; multiplies the Armitive knife or pistol bonus when applicable.", 140, true, 0, true, 1000);
static CConVar<int> sf_xp_rampage_percent("sf_xp_rampage_percent", FCVAR_NONE,
"Kill XP percent for Rampage; multiplies the Armitive knife or pistol bonus when applicable.", 150, true, 0, true, 1000);
static CConVar<int> sf_xp_dominating_percent("sf_xp_dominating_percent", FCVAR_NONE,
"Kill XP percent for Dominating; multiplies the Armitive knife or pistol bonus when applicable.", 160, true, 0, true, 1000);
static CConVar<int> sf_xp_unstoppable_percent("sf_xp_unstoppable_percent", FCVAR_NONE,
"Kill XP percent for Unstoppable; multiplies the Armitive knife or pistol bonus when applicable.", 170, true, 0, true, 1000);
static CConVar<int> sf_xp_monster_kill_percent("sf_xp_monster_kill_percent", FCVAR_NONE,
"Kill XP percent for Monster Kill; multiplies the Armitive knife or pistol bonus when applicable.", 180, true, 0, true, 1000);
static CConVar<int> sf_xp_godlike_percent("sf_xp_godlike_percent", FCVAR_NONE,
"Kill XP percent for Godlike; multiplies the Armitive knife or pistol bonus when applicable.", 190, true, 0, true, 1000);
static CConVar<int> sf_xp_holy_shit_percent("sf_xp_holy_shit_percent", FCVAR_NONE,
"Kill XP percent for Holy Shit; multiplies the Armitive knife or pistol bonus when applicable.", 200, true, 0, true, 1000);
static CConVar<int> sf_invisant_see_teammates(
"sf_invisant_see_teammates", FCVAR_NONE,
"Allow Invisant players to see and spectate Invisant teammates.", 1, true, 0, true, 1);
static CConVar<CUtlString> sf_discord_link("sf_discord_link", FCVAR_NONE,
"Discord server invite link in chat messages; empty disables the messages.",
CUtlString("https://discord.gg/TMV2DEPhqT"));
static CConVar<int> sf_discord_message("sf_discord_message", FCVAR_NONE,
"Enables Discord invite messages in chat.", 1, true, 0, true, 1);
static CConVar<int> sf_discord_interval("sf_discord_interval", FCVAR_NONE,
"Seconds between recurring Discord invite messages.", 1200, true, 1, true, 86400);
static CConVar<int> sf_audio_hint("sf_audio_hint", FCVAR_NONE,
"Enables the automatic audio chat hint.", 1, true, 0, true, 1);
static CConVar<int> sf_audio_hint_cooldown("sf_audio_hint_cooldown", FCVAR_NONE,
"Seconds before the automatic audio chat hint can trigger again.", 60, true, 0, true, 86400);
static CConVar<int> sf_cheat_hint("sf_cheat_hint", FCVAR_NONE,
"Enables the automatic cheat chat hint.", 1, true, 0, true, 1);
static CConVar<int> sf_cheat_hint_cooldown("sf_cheat_hint_cooldown", FCVAR_NONE,
"Seconds before the automatic cheat chat hint can trigger again.", 60, true, 0, true, 86400);
static CConVar<int> sf_upgrade_hint("sf_upgrade_hint", FCVAR_NONE,
"Enables the automatic upgrade chat hint.", 1, true, 0, true, 1);
static CConVar<int> sf_upgrade_hint_cooldown("sf_upgrade_hint_cooldown", FCVAR_NONE,
"Seconds before the automatic upgrade chat hint can trigger again.", 60, true, 0, true, 86400);
static CConVar<int> sf_bugs_hint("sf_bugs_hint", FCVAR_NONE,
"Enables the automatic known-bugs chat hint.", 1, true, 0, true, 1);
static CConVar<int> sf_bugs_hint_cooldown("sf_bugs_hint_cooldown", FCVAR_NONE,
"Seconds before the automatic known-bugs chat hint can trigger again.", 60, true, 0, true, 86400);
static CConVar<int> sf_menu_hint("sf_menu_hint", FCVAR_NONE,
"Enables the automatic upgrade-menu chat hint.", 1, true, 0, true, 1);
static CConVar<int> sf_menu_hint_cooldown("sf_menu_hint_cooldown", FCVAR_NONE,
"Seconds before the automatic upgrade-menu chat hint can trigger again.", 60, true, 0, true, 86400);
static CConVar<int> sf_reset_hint("sf_reset_hint", FCVAR_NONE,
"Enables the automatic upgrade-reset chat hint.", 1, true, 0, true, 1);
static CConVar<int> sf_reset_hint_cooldown("sf_reset_hint_cooldown", FCVAR_NONE,
"Seconds before the automatic upgrade-reset chat hint can trigger again.", 60, true, 0, true, 86400);
static CConVar<int> sf_rank_hint("sf_rank_hint", FCVAR_NONE,
"Enables the automatic rank chat hint.", 1, true, 0, true, 1);
static CConVar<int> sf_rank_hint_cooldown("sf_rank_hint_cooldown", FCVAR_NONE,
"Seconds before the automatic rank chat hint can trigger again.", 60, true, 0, true, 86400);
static CConVar<int> sf_hud("sf_hud", FCVAR_NONE,
"Show role, level, XP and queue position in the round-start center panel.",
1, true, 0, true, 1);
static CConVar<int> sf_round_info_seconds("sf_round_info_seconds", FCVAR_NONE,
"Seconds to show the round-start role, level, XP and queue panel. Set to 0 to disable.",
10, true, 0, true, 120);
static CConVar<float> sf_hud_kill_seconds("sf_hud_kill_seconds", FCVAR_NONE,
"Seconds to show each kill XP line, including post-round kills; 0 hides these lines.", 5.0f, true, 0.0f, true, 120.0f);
static CConVar<float> sf_hud_assist_seconds("sf_hud_assist_seconds", FCVAR_NONE,
"Seconds to show each assist XP line; 0 hides these lines without changing XP awards.", 5.0f, true, 0.0f, true, 120.0f);
static CConVar<float> sf_hud_round_result_seconds("sf_hud_round_result_seconds", FCVAR_NONE,
"Seconds to show the round win or draw title; 0 hides the title.", 10.0f, true, 0.0f, true, 120.0f);
static CConVar<float> sf_hud_round_win_xp_seconds("sf_hud_round_win_xp_seconds", FCVAR_NONE,
"Seconds to show round-win XP; 0 hides this line without changing XP awards.", 10.0f, true, 0.0f, true, 120.0f);
static CConVar<float> sf_hud_levelup_seconds("sf_hud_levelup_seconds", FCVAR_NONE,
"Seconds to show a level-up line; 0 hides these lines.", 5.0f, true, 0.0f, true, 120.0f);
static CConVar<float> sf_hud_priority_seconds("sf_hud_priority_seconds", FCVAR_NONE,
"Seconds to show earned Invisant queue priority; 0 hides this line without changing priority.", 5.0f, true, 0.0f, true, 120.0f);
static CConVar<float> sf_hud_no_rewards_seconds("sf_hud_no_rewards_seconds", FCVAR_NONE,
"Seconds to show No rewards after round end following a post-round kill; 0 hides this line.", 5.0f, true, 0.0f, true, 120.0f);
static CConVar<int> sf_timeout_warning_seconds("sf_timeout_warning_seconds", FCVAR_NONE,
"Seconds before timeout when the Invisant fade warning and reveal voice begin; 0 disables both.", 10, true, 0, true, 120);
static CConVar<int> sf_wallhack("sf_wallhack", FCVAR_NONE,
"Show living Armitive with through-wall outlines to living Invisant players.",
1, true, 0, true, 1);
static CConVar<int> sf_ward_screen_tint(
"sf_ward_screen_tint", FCVAR_NONE,
"Green screen tint strength while Ward is active. Set to 0 to disable; 255 is maximum.",
85, true, 0, true, 255);
static CConVar<int> sf_extra_spawns("sf_extra_spawns", FCVAR_NONE,
"Create validated additional team spawns on Windows and Linux when the map does not have enough for the maximum roster.",
1, true, 0, true, 1);
static CConVar<int> sf_blood_amount("sf_blood_amount", FCVAR_NONE,
"Number of additional blood-splatter bursts when an Armitive damages an Invisant or an Invisant knife damages an Armitive. Set to 0 for normal blood only.",
4, true, 0, true, 6);
static CConVar<float> sf_tonemap_exposure("sf_tonemap_exposure", FCVAR_NONE,
"Attempts to set HDR exposure on the map's tonemap controller. Stock de_dust2 lighting is baked and unaffected.",
0.40f, true, 0.05f, true, 1.0f);
static CConVar<int> sf_admin_spectate("sf_admin_spectate", FCVAR_NONE,
"Allow administrators with the generic flag to observe players or use a spectator free camera.",
1, true, 0, true, 1);
static CConVar<int> sf_custom_sounds("sf_custom_sounds", FCVAR_NONE,
"Play Shroudfire voice clips when its CS2 Workshop sound pack is mounted for clients.",
0, true, 0, true, 1);
static CConVar<int> sf_silent_local_movement("sf_silent_local_movement", FCVAR_NONE,
"Experimentally block an Invisant's own footsteps, jumps, and landings using the updated Workshop pack.",
0, true, 0, true, 1);
static CConVar<float> sf_round_win_sound_delay("sf_round_win_sound_delay", FCVAR_NONE,
"Delay in seconds before playing an Armitive win, Invisant win, or round draw voice clip.",
0.5f, true, 0.0f, true, 10.0f);
CON_COMMAND_F(sf_level, "Displays your Invisant and Armitive XP and levels.", FCVAR_NONE) {
const CPlayerSlot slot = context.GetPlayerSlot();
if (slot.IsValid()) g_shroudfire_plugin.show_level(slot.Get() + 1);
}
CON_COMMAND_F(sf_status,
"Displays Shroudfire state, map rotation, teams, queue, AFK players, and spawn capacity.", FCVAR_NONE) {
const CPlayerSlot slot = context.GetPlayerSlot();
g_shroudfire_plugin.command_status(slot.IsValid() ? slot.Get() + 1 : 0);
}
CON_COMMAND_F(sf_update_notice,
"Announces an upcoming CS2 update restart in chat. Server console only.", FCVAR_NONE) {
const CPlayerSlot slot = context.GetPlayerSlot();
g_shroudfire_plugin.command_update_notice(slot.IsValid() ? slot.Get() + 1 : 0, args);
}
CON_COMMAND_F(sf_cvar,
"Reads or sets a server cvar from the console. Requires the generic admin flag.", FCVAR_NONE) {
const CPlayerSlot slot = context.GetPlayerSlot();
g_shroudfire_plugin.command_cvar(slot.IsValid() ? slot.Get() + 1 : 0, args);
}
CON_COMMAND_F(sf_setlevel,
"Sets an online player's Invisant or Armitive level to its starting XP, resets that role's purchased upgrades, and recalculates its available upgrade points for the assigned level.", FCVAR_NONE) {
const CPlayerSlot slot = context.GetPlayerSlot();
g_shroudfire_plugin.command_setlevel(slot.IsValid() ? slot.Get() + 1 : 0, args);
}
CON_COMMAND_F(sf_restart,
"Restarts the current round without advancing the Invisant roster, including with one active player. Requires the generic admin flag.", FCVAR_NONE) {
const CPlayerSlot slot = context.GetPlayerSlot();
g_shroudfire_plugin.command_restart(slot.IsValid() ? slot.Get() + 1 : 0);
}
CON_COMMAND_F(sf_nextmap,
"Displays or sets the next map; use reset to follow the configured rotation.", FCVAR_NONE) {
const CPlayerSlot slot = context.GetPlayerSlot();
g_shroudfire_plugin.command_nextmap(slot.IsValid() ? slot.Get() + 1 : 0, args);
}
CON_COMMAND_F(sf_invisant,
"Moves you to the Invisant team and respawns you at its spawn.", FCVAR_NONE) {
const CPlayerSlot slot = context.GetPlayerSlot();
g_shroudfire_plugin.command_invisant(slot.IsValid() ? slot.Get() + 1 : 0);
}
CON_COMMAND_F(sf_armitive,
"Moves you to the Armitive team and respawns you at its spawn.", FCVAR_NONE) {
const CPlayerSlot slot = context.GetPlayerSlot();
g_shroudfire_plugin.command_armitive(slot.IsValid() ? slot.Get() + 1 : 0);
}
CON_COMMAND_F(sf_observe,
"Moves you to Spectator to watch a living player or use a free camera.", FCVAR_NONE) {
const CPlayerSlot slot = context.GetPlayerSlot();
g_shroudfire_plugin.command_observe(slot.IsValid() ? slot.Get() + 1 : 0, args);
}
namespace {
GameEventKeySymbol_t event_key(const char *name) {
return {CUtlStringToken(MurmurHash2LowerCase(name, STRINGTOKEN_MURMURHASH_SEED)), name};
}
bool pistol_weapon(const char *name) {
static const char *pistols[] = {"glock", "hkp2000", "usp_silencer", "p250", "deagle",
"elite", "fiveseven", "tec9", "cz75a", "revolver"};
if (std::strncmp(name, "weapon_", 7) == 0) name += 7;
for (const char *pistol : pistols) if (std::strcmp(name, pistol) == 0) return true;
return false;
}
} // namespace
ShroudfirePlugin::ShroudfirePlugin()
: game_frame_(&IServerGameDLL::GameFrame, this, &ShroudfirePlugin::Hook_GameFramePre,
&ShroudfirePlugin::Hook_GameFrame),
post_sound_event_(static_cast<void (IGameEventSystem::*)(CSplitScreenSlot, bool,
int, const uint64 *, INetworkMessageInternal *, const CNetMessage *,
unsigned long, NetChannelBufType_t)>(&IGameEventSystem::PostEventAbstract),
this, &ShroudfirePlugin::Hook_PostSoundEvent, nullptr),
game_event_fire_(&IGameEventManager2::FireEvent, this,
&ShroudfirePlugin::Hook_FireGameEvent, nullptr),
client_active_(&IServerGameClients::ClientActive, this, nullptr, &ShroudfirePlugin::Hook_ClientActive),
client_disconnect_(&IServerGameClients::ClientDisconnect, this, nullptr,
&ShroudfirePlugin::Hook_ClientDisconnect),
client_connected_(&IServerGameClients::OnClientConnected, this,
&ShroudfirePlugin::Hook_OnClientConnected, nullptr),
client_command_(&IServerGameClients::ClientCommand, this,
&ShroudfirePlugin::Hook_ClientCommand, nullptr),
cvar_command_(&ICvar::DispatchConCommand, this,
&ShroudfirePlugin::Hook_DispatchConCommand, nullptr),
check_transmit_(&ISource2GameEntities::CheckTransmit, this, nullptr,
&ShroudfirePlugin::Hook_CheckTransmit) {}
bool ShroudfirePlugin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late) {
PLUGIN_SAVEVARS();
for (auto &target : admin_observe_target_) target.store(0, std::memory_order_relaxed);
GET_V_IFACE_CURRENT(GetEngineFactory, engine_, IVEngineServer2,
SOURCE2ENGINETOSERVER_INTERFACE_VERSION);
GET_V_IFACE_CURRENT(GetEngineFactory, cvar_, ICvar, CVAR_INTERFACE_VERSION);
GET_V_IFACE_ANY(GetServerFactory, server_, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
GET_V_IFACE_ANY(GetServerFactory, game_clients_, IServerGameClients,
INTERFACEVERSION_SERVERGAMECLIENTS);
GET_V_IFACE_ANY(GetEngineFactory, network_service_, INetworkServerService,
NETWORKSERVERSERVICE_INTERFACE_VERSION);
game_resources_ = static_cast<IGameResourceService *>(ismm->VInterfaceMatch(
ismm->GetEngineFactory(), GAMERESOURCESERVICESERVER_INTERFACE_VERSION));
ISchemaSystem *schema = static_cast<ISchemaSystem *>(ismm->VInterfaceMatch(
ismm->GetEngineFactory(), SCHEMASYSTEM_INTERFACE_VERSION));
game_entities_ = static_cast<ISource2GameEntities *>(ismm->VInterfaceMatch(
ismm->GetServerFactory(), SOURCE2GAMEENTITIES_INTERFACE_VERSION));
std::string engine_error;
auto *network_messages = static_cast<INetworkMessages *>(ismm->VInterfaceMatch(
ismm->GetEngineFactory(), NETWORKMESSAGES_INTERFACE_VERSION));
auto *event_system = static_cast<IGameEventSystem *>(ismm->VInterfaceMatch(
ismm->GetEngineFactory(), GAMEEVENTSYSTEM_INTERFACE_VERSION));
if (!engine_adapter_.initialize(game_resources_, schema, server_, network_messages,
event_system, engine_error))
META_CONPRINTF("[Shroudfire] %s\n", engine_error.c_str());
if (engine_adapter_.ready()) {
damage_hook_ = std::make_unique<KHook::Function<int64_t, void *, void *, void *>>(
this, &ShroudfirePlugin::Hook_TakeDamage, nullptr);
damage_hook_->Configure(engine_adapter_.damage_function());
weapon_can_use_hook_ = std::make_unique<KHook::Function<bool, void *, void *>>(
this, &ShroudfirePlugin::Hook_WeaponCanUse, nullptr);
weapon_can_use_hook_->Configure(engine_adapter_.weapon_can_use_function());
can_acquire_hook_ = std::make_unique<KHook::Function<int, void *, void *, int, uint64_t>>(
this, &ShroudfirePlugin::Hook_CanAcquire, nullptr);
can_acquire_hook_->Configure(engine_adapter_.can_acquire_function());
increment_mvp_hook_ = std::make_unique<KHook::Function<void, void *, int>>(
this, &ShroudfirePlugin::Hook_IncrementNumMVPs, nullptr);
increment_mvp_hook_->Configure(engine_adapter_.increment_mvp_function());
if (engine_adapter_.sound_filter_function()) {
sound_filter_hook_ = std::make_unique<KHook::Function<SoundEventResult,
IRecipientFilter &, int, const void *>>(
this, &ShroudfirePlugin::Hook_EmitSoundFilter,
&ShroudfirePlugin::Hook_EmitSoundFilterPost);
sound_filter_hook_->Configure(engine_adapter_.sound_filter_function());
}
if (engine_adapter_.process_movement_function()) {
process_movement_hook_ = std::make_unique<KHook::Function<void, void *, void *>>(
this, &ShroudfirePlugin::Hook_ProcessMovement,
&ShroudfirePlugin::Hook_ProcessMovementPost);
process_movement_hook_->Configure(engine_adapter_.process_movement_function());
} else META_CONPRINTF("[Shroudfire] Movement hook unavailable; Invisant knife remap disabled.\n");
game_event_init_hook_ = std::make_unique<KHook::Function<void, IGameEventManager2 *>>(
this, &ShroudfirePlugin::Hook_GameEventManagerInit,
&ShroudfirePlugin::Hook_GameEventManagerInitialized);
game_event_init_hook_->Configure(engine_adapter_.game_event_manager_init_function());
host_say_hook_ = std::make_unique<KHook::Function<void, CEntityInstance *, CCommand &,
bool, int, const char *>>(this, &ShroudfirePlugin::Hook_HostSay,
&ShroudfirePlugin::Hook_HostSayPost);
host_say_hook_->Configure(engine_adapter_.host_say_function());
}
g_pCVar = cvar_;
META_CONVAR_REGISTER(FCVAR_RELEASE | FCVAR_CLIENT_CAN_EXECUTE | FCVAR_GAMEDLL);
profiles_.emplace(std::filesystem::path(ismm->GetBaseDir()) / "addons" / "shroudfire" / "data");
rankings_ = {};
for (const auto &profile : profiles_->load_all()) rankings_.update(profile);
admins_.clear();
{
std::ifstream admins_file(std::filesystem::path(ismm->GetBaseDir()) /
"addons" / "shroudfire" / "admins.txt");
std::string line;
while (std::getline(admins_file, line)) {
std::istringstream input(line);
std::string steam_id, access;
if (!(input >> steam_id >> access) || steam_id.front() == '#') continue;
char *end = nullptr;
const uint64_t id = std::strtoull(steam_id.c_str(), &end, 10);
if (end && *end == '\0' && id > 0 && (access == "generic" || access == "root"))
admins_[id] = access == "root" ? 2 : 1;
}
}
game_frame_.Add(server_);
if (event_system) post_sound_event_.Add(event_system);
client_active_.Add(game_clients_);
client_disconnect_.Add(game_clients_);
client_connected_.Add(game_clients_);
client_command_.Add(game_clients_);
cvar_command_.Add(cvar_);
if (game_entities_) check_transmit_.Add(game_entities_);
g_SMAPI->AddListener(this, this);
if (late) {
mode_.map_start(game_time());
INetworkGameServer *game = network_service_ ? network_service_->GetIGameServer() : nullptr;
if (game && game->GetMapName()) map_rotation_.current = game->GetMapName();
map_rotation_.last_time = game_time();
}
META_CONPRINTF("[Shroudfire] CS2 development build loaded; engine adapter %s.\n",
engine_adapter_.ready() ? "ready for this server build" : "disabled");
META_CONPRINTF("[Shroudfire] Armitive outline adapter %s.\n",
engine_adapter_.glow_ready() ? "ready" : "unavailable");
return true;
}
bool ShroudfirePlugin::Unload(char *error, size_t maximum) {
// The map resource system retains this plugin's callback until engine shutdown.
// MetaMod can unload us safely only after a full server restart.
if (engine_adapter_.ready()) {
if (error && maximum)
std::snprintf(error, maximum,
"Shroudfire registered a CS2 game system; restart the server to unload it");
return false;
}
invisant_transmit_mask_.store(0, std::memory_order_release);
clear_armitive_glows();
damage_hook_.reset();
weapon_can_use_hook_.reset();
can_acquire_hook_.reset();
sound_filter_hook_.reset();
increment_mvp_hook_.reset();
player_run_command_hook_.reset();
player_run_command_target_ = nullptr;
observer_run_command_hook_.reset();
observer_run_command_target_ = nullptr;
process_movement_hook_.reset();
game_event_init_hook_.reset();
host_say_hook_.reset();
pending_observers_.clear();
for (int viewer = 1; viewer <= shroudfire::kMaxPlayers; ++viewer)
end_observation(viewer, "plugin unloaded");
for (int slot = 1; slot <= shroudfire::kMaxPlayers; ++slot)
if (guide_open_[slot]) close_guide(slot);
restore_shields();
engine_adapter_.remove_fade_entity();
engine_adapter_.remove_blood_entity();
engine_adapter_.remove_claw_entity();
engine_adapter_.remove_extra_spawns();
engine_adapter_.restore_tonemap();
restore_game_cvars();
if (game_events_) game_event_fire_.Remove(game_events_);
for (int slot = 1; slot <= shroudfire::kMaxPlayers; ++slot) {
if (profiles_ && mode_.player(slot).connected && !mode_.player(slot).bot)
profiles_->save(mode_.profile(slot, static_cast<int>(std::time(nullptr))));
}
game_frame_.Remove(server_);
client_active_.Remove(game_clients_);
client_disconnect_.Remove(game_clients_);
client_connected_.Remove(game_clients_);
client_command_.Remove(game_clients_);
cvar_command_.Remove(cvar_);
if (game_entities_) check_transmit_.Remove(game_entities_);
ConVar_Unregister();
return true;
}
void ShroudfirePlugin::AllPluginsLoaded() {}
float ShroudfirePlugin::game_time() const {
INetworkGameServer *game = network_service_ ? network_service_->GetIGameServer() : nullptr;
return game ? game->GetTime() : 0.0f;
}
void ShroudfirePlugin::OnLevelInit(const char *map, const char *, const char *, const char *, bool, bool) {
map_rotation_ = {};
if (map) map_rotation_.current = map;
map_rotation_.last_time = game_time();
local_movement_next_refresh_at_.fill(0.0f);
engine_adapter_.restore_reveal_rendering();
timeout_reveal_ready_mask_ = 0;
timeout_reveal_last_alpha_.fill(-1);
if (engine_) engine_->PrecacheGeneric(
"particles/blood_impact/blood_impact_mist1.vpcf");
mode_.map_start(game_time());
clear_armitive_glows();
last_glow_refresh_ = 0.0f;
last_mode_tick_ = 0.0f;
last_profile_save_ = 0.0f;
pending_initial_restart_ = 0.0f;
solo_rejoin_freeze_pending_ = false;
solo_rejoin_freeze_until_ = 0.0f;
initial_restart_attempts_ = 0;
engine_adapter_.clear_weapon_tracking();
engine_adapter_.clear_tonemap_tracking();
engine_adapter_.clear_fade_tracking();
engine_adapter_.clear_blood_tracking();
engine_adapter_.clear_claw_entity_tracking();
engine_adapter_.clear_extra_spawn_tracking();
engine_adapter_.clear_win_layout_tracking();
engine_adapter_.clear_round_ui_tracking();
pending_claw_hits_.fill({});
last_native_claw_hit_tick_.fill(0);
claw_extended_applying_.fill(false);
last_extended_claw_hit_tick_.fill(0);
spawn_config_ = -1;
guide_open_.fill(false);
guide_last_html_.fill({});
guide_last_sent_at_.fill(0.0f);
guide_first_send_at_.fill(0.0f);
guide_hint_due_.fill(0.0f);
cheat_hint_pending_at_ = 0.0f;
audio_hint_pending_at_ = 0.0f;
upgrade_hint_pending_at_ = 0.0f;
bugs_hint_pending_at_ = 0.0f;
menu_hint_pending_at_ = 0.0f;
reset_hint_pending_at_ = 0.0f;
rank_hint_pending_at_ = 0.0f;
discord_hint_pending_at_ = 0.0f;
center_notices_.fill({});
auto_hud_visible_.fill(false);
round_info_until_ = 0.0f;
pending_round_end_at_ = 0.0f;
pending_round_winner_ = 0;
round_timeout_requested_ = false;
round_win_voice_at_ = 0.0f;
round_win_voice_role_ = shroudfire::Role::spectator;
last_observer_check_ = 0.0f;
objectives_removed_ = false;
tonemap_reported_ = false;
}
void ShroudfirePlugin::OnLevelShutdown() {
map_rotation_ = {};
local_movement_next_refresh_at_.fill(0.0f);
engine_adapter_.restore_reveal_rendering();