Browse Source

Making sure correct changes are coming through for penguins changes

master
Mathew Antich 1 month ago
parent
commit
a3e8ce389c
2 changed files with 58 additions and 156 deletions
  1. 56
    156
      pk3/Acs/Lexicon.c
  2. 2
    0
      pk3/CVARINFO.txt

+ 56
- 156
pk3/Acs/Lexicon.c View File

@@ -224,6 +224,7 @@ strict namespace
224 224
         { "Unused",			                "MAP01",            "\c[LightBlue](Single)"}, // 191
225 225
         { "Unused",			                "MAP01",            "\c[LightBlue](Single)"}, // 192
226 226
     };
227
+
227 228
     /////////////////////
228 229
     // vote manager
229 230
     /////////////////////
@@ -239,12 +240,6 @@ strict namespace
239 240
     int state = STATE_INIT;             // state of the voting system
240 241
     int state_clock;                    // custom timer
241 242
 
242
-<<<<<<< HEAD
243
-    global int 2:votechosen;            // the winner
244
-    global int 3:sucktime;              // the sucktime of the previous level
245
-    
246
-=======
247
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
248 243
     /////////////////////
249 244
     // hud
250 245
     /////////////////////
@@ -271,15 +266,6 @@ strict namespace
271 266
     int levelstarted = 0;
272 267
     int clock = 0;
273 268
     int countstart = 0;
274
-<<<<<<< HEAD
275
-    
276
-    /////////////////////
277
-    // debug
278
-    /////////////////////
279
-    global int  0:godmode;
280
-    global int  1:instakiller;
281
-=======
282
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
283 269
 
284 270
     // stuff that runs during any level
285 271
     script "SV_Level" open
@@ -287,92 +273,82 @@ strict namespace
287 273
         if(GetLevelInfo(LEVELINFO_LEVELNUM) == 99) 
288 274
         { 
289 275
             // we have come back from a completed mapset
290
-<<<<<<< HEAD
291
-            if(sucktime == 1337)
292
-=======
293 276
             if(GetCVar("lexicon_global_sucktime") == 1337)
294
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
295 277
             {
296 278
                 ACS_NamedExecute("Fireworks", 0);
297 279
             }
298 280
             terminate; 
299 281
         }
300 282
         
301
-<<<<<<< HEAD
302
-        sucktime = GetLevelInfo(LEVELINFO_SUCK_TIME);
303
-=======
304 283
         SetCVar("lexicon_global_sucktime", GetLevelInfo(LEVELINFO_SUCK_TIME));
305
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
306 284
         levelstarted = 0;
307 285
         clock = GetCvar("lexicon_timer_reset");
308 286
 
309
-        while(1)
287
+        if(GetCvar("lexicon_timer_reset_enabled") == 1)
310 288
         {
311
-            // if the level has started and the countdown is not started
312
-            if(levelstarted == 1 && countstart == 0)
313
-            {
314
-                // if the playercount goes back to 0
315
-                if(playercount() == 0)
316
-                {
317
-                    countstart = 1;
318
-                }
319
-            }
320
-            // if nobody has joined yet
321
-            else
322
-            {
323
-                // wait for someone to join
324
-                if(playercount() > 0)
325
-                {
326
-                    //the level has been started
327
-                    levelstarted = 1;
328
-                }
329
-            }
330 289
             
331
-            // countdown has started
332
-            if(countstart == 1)
290
+            while(1)
333 291
             {
334
-                // countdown
335
-                clock--;
336
-                if(countstart == 1)
292
+                // if the level has started and the countdown is not started
293
+                if(levelstarted == 1 && countstart == 0)
337 294
                 {
338
-                    // these hudmessages were in the cl_lexicon_hud script
339
-                    // it had to be moved here as zandronum terminates player scripts when they spectate
340
-                    // resulting in these hudmessages not showing
341
-                    HudSetup(0, 0);
342
-                    SetFont("HUDFONT");
343
-                    if(clock > 7)
295
+                    // if the playercount goes back to 0
296
+                    if(playercount() == 0)
344 297
                     {
345
-                        hudmessagebold(s:"\c[Green]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
298
+                        countstart = 1;
346 299
                     }
347
-                    else if(clock <= 7 && clock > 4)
300
+                }
301
+                // if nobody has joined yet
302
+                else
303
+                {
304
+                    // wait for someone to join
305
+                    if(playercount() > 0)
348 306
                     {
349
-                        hudmessagebold(s:"\c[Yellow]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
307
+                        //the level has been started
308
+                        levelstarted = 1;
350 309
                     }
351
-                    else if(clock <= 4 && clock > 1)
310
+                }
311
+                
312
+                // countdown has started
313
+                if(countstart == 1)
314
+                {
315
+                    // countdown
316
+                    clock--;
317
+                    if(countstart == 1)
352 318
                     {
353
-                        hudmessagebold(s:"\c[Orange]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
319
+                        // these hudmessages were in the cl_lexicon_hud script
320
+                        // it had to be moved here as zandronum terminates player scripts when they spectate
321
+                        // resulting in these hudmessages not showing
322
+                        HudSetup(0, 0);
323
+                        SetFont("HUDFONT");
324
+                        if(clock > 7)
325
+                        {
326
+                            hudmessagebold(s:"\c[Green]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
327
+                        }
328
+                        else if(clock <= 7 && clock > 4)
329
+                        {
330
+                            hudmessagebold(s:"\c[Yellow]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
331
+                        }
332
+                        else if(clock <= 4 && clock > 1)
333
+                        {
334
+                            hudmessagebold(s:"\c[Orange]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
335
+                        }
336
+                        else if(clock <= 1 && clock >= 0)
337
+                        {
338
+                            hudmessagebold(s:"\c[Red]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
339
+                        }
354 340
                     }
355
-                    else if(clock <= 1 && clock >= 0)
341
+                     // when time is up
342
+                    if(clock < 0)
356 343
                     {
357
-<<<<<<< HEAD
358
-                        hudmessagebold(s:"\c[Red]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
359
-=======
360 344
                         // go back to hub
361 345
                         SetCVar("lexicon_global_sucktime", 0);
362 346
                         ChangeLevel("VR", 0, 0, -1);
363
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
364 347
                     }
348
+                    delay(34);
365 349
                 }
366
-                 // when time is up
367
-                if(clock < 0)
368
-                {
369
-                    // go back to hub
370
-                    sucktime = 0;
371
-                    ChangeLevel("VR", 0, 0, -1);
372
-                }
373
-                delay(34);
350
+                delay(1);
374 351
             }
375
-            delay(1);
376 352
         }
377 353
     }
378 354
 
@@ -383,11 +359,6 @@ strict namespace
383 359
     {
384 360
         Thing_ChangeTID(0, playernumber()+PLAYER_TID);
385 361
 
386
-<<<<<<< HEAD
387
-        ACS_Execute(568, 0, votechosen);
388
-
389
-=======
390
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
391 362
         // we have entered the VR map
392 363
         if(GetLevelInfo(LEVELINFO_LEVELNUM) == 99) 
393 364
         { 
@@ -400,8 +371,12 @@ strict namespace
400 371
             ACS_ExecuteAlways(570, 0, state);
401 372
             
402 373
             // give player the votegun
403
-            ClearInventory();
374
+            if(GetCVar("lexicon_clear_inventory") == 1)
375
+            {
376
+                ClearInventory();
377
+            }
404 378
             GiveInventory("Lexicon_VoteGun", 1);
379
+            SetWeapon("Lexicon_VoteGun");
405 380
 
406 381
         }
407 382
     }
@@ -431,11 +406,7 @@ strict namespace
431 406
             // mapset/mapname/creds
432 407
             HudSetup(0, 0);
433 408
             setfont("hudfont");
434
-<<<<<<< HEAD
435
-            Hudmessage(s:"\c[White]Mapset:\c[Cyan]", s:votenames[votechosen][0], s:"\n\c[White]Level:\c[Cyan]", n:PRINTNAME_LEVELNAME, s:"\n\c[White]Credits:\c[Cyan]", s:credits; HUDMSG_FADEINOUT, 8562, 0, hud_width + 0.2, hud_height - 160.0, 5.0, 1.0, 1.0);
436
-=======
437 409
             Hudmessage(s:"\c[White]Mapset:\c[Cyan]", s:votenames[GetCVar("lexicon_global_votechosen")][0], s:"\n\c[White]Level:\c[Cyan]", n:PRINTNAME_LEVELNAME, s:"\n\c[White]Credits:\c[Cyan]", s:credits; HUDMSG_FADEINOUT, 8562, 0, hud_width + 0.2, hud_height - 160.0, 5.0, 1.0, 1.0);
438
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
439 410
         }
440 411
         
441 412
         //////////////////////////
@@ -448,15 +419,9 @@ strict namespace
448 419
             hudmessagebold(s:"\c[White]Welcome to the Lexicon\n\n\c[White]-=Alpha version=-\n\n\c[White]Please report any problems you have to our discord via\n\c[Cyan]https://discord.gg/qj9GASW"; HUDMSG_LOG, 9997, 0, hud_width_half + 0.4, 80.0, 10.0);
449 420
                         
450 421
             // we have come back from a completed mapset
451
-<<<<<<< HEAD
452
-            if(sucktime == 1337)
453
-            {
454
-                hudmessagebold(s:"\c[White]Congratulations!\n\n\c[White]You and your team have completed\n\c[Gold]", s:votenames[votechosen][0], s:"!"; 0, 9997, 0, hud_width_half + 0.4, 64.0, 30.0);
455
-=======
456 422
             if(GetCVar("lexicon_global_sucktime") == 1337)
457 423
             {
458 424
                 hudmessagebold(s:"\c[White]Congratulations!\n\n\c[White]You and your team have completed\n\c[Gold]", s:votenames[GetCVar("lexicon_global_votechosen")][0], s:"!"; 0, 9997, 0, hud_width_half + 0.4, 64.0, 30.0);
459
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
460 425
             }
461 426
 
462 427
 
@@ -494,11 +459,7 @@ strict namespace
494 459
             //////////////////////////
495 460
             if(GetCVar("lexicon_debug_mode") == 1)
496 461
             {
497
-<<<<<<< HEAD
498
-                hudmessage(s:"\c[Gold]debug mode:", s:" I:", i:instakiller, s:" G:", i:godmode; 0, 9600, 0, hud_width - 160.0, hud_height - 151.0, 0.1);
499
-=======
500 462
                 hudmessage(s:"\c[Gold]debug mode:", s:" I:", i:GetCVar("lexicon_global_instakiller"), s:" G:", i:GetCVar("lexicon_global_godmode"); 0, 9600, 0, hud_width - 160.0, hud_height - 151.0, 0.1);
501
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
502 463
             }
503 464
 
504 465
             //////////////////////////
@@ -555,11 +516,7 @@ strict namespace
555 516
                 else if(state == STATE_RESULTS)
556 517
                 {
557 518
                     setfont("hudfont");
558
-<<<<<<< HEAD
559
-                    hudmessagebold(s:"\c[Green]", s:"Winner: \c[Gold]", s:votenames[votechosen][0]; 0, 9998, 0, hud_width_half, hud_height_half-128.0, 0.1);
560
-=======
561 519
                     hudmessagebold(s:"\c[Green]", s:"Winner: \c[Gold]", s:votenames[GetCVar("lexicon_global_votechosen")][0]; 0, 9998, 0, hud_width_half, hud_height_half-128.0, 0.1);
562
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
563 520
 
564 521
                     // confetti :D
565 522
                     for(int c = 0; c < 128; c++)
@@ -682,28 +639,17 @@ strict namespace
682 639
     {
683 640
         if(GetLevelInfo(LEVELINFO_LEVELNUM) == 99)
684 641
         {
685
-<<<<<<< HEAD
686
-            godmode = 0;
687
-            instakiller = 0;
688
-        }
689
-        if(godmode)
690
-=======
691 642
             SetCVar("lexicon_global_godmode", 0);
692 643
             SetCVar("lexicon_global_instakiller", 0);
693 644
         }
694 645
         if(GetCVar("lexicon_global_godmode") == 1)
695
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
696 646
         {
697 647
             for(int i = 0; i < 63; i++)
698 648
             {
699 649
                 GiveActorInventory(PLAYER_TID+i, "Lexicon_GodMode", 1);
700 650
             }
701 651
         }
702
-<<<<<<< HEAD
703
-        if(instakiller)
704
-=======
705 652
         if(GetCVar("lexicon_global_instakiller") == 1)
706
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
707 653
         {
708 654
             for(int i = 0; i < 63; i++)
709 655
             {
@@ -720,18 +666,6 @@ strict namespace
720 666
             switch(id)
721 667
             {
722 668
                 case 0: 
723
-<<<<<<< HEAD
724
-                    if(godmode == 0) { godmode = 1; break; }
725
-                    if(godmode == 1) { godmode = 0; break; }
726
-                    break;
727
-                case 2: 
728
-                    if(instakiller == 0) { instakiller = 1; break; }
729
-                    if(instakiller == 1) { instakiller = 0; break; }
730
-                    break;
731
-            }
732
-            ACS_ExecuteAlways(572, 0, godmode);
733
-            ACS_ExecuteAlways(573, 0, instakiller);
734
-=======
735 669
                     if(GetCVar("lexicon_global_godmode") == 0) { SetCVar("lexicon_global_godmode", 1); break; }
736 670
                     if(GetCVar("lexicon_global_godmode") == 1) { SetCVar("lexicon_global_godmode", 0); break; }
737 671
                     break;
@@ -740,7 +674,6 @@ strict namespace
740 674
                     if(GetCVar("lexicon_global_instakiller") == 1) { SetCVar("lexicon_global_instakiller", 0); break; }
741 675
                     break;
742 676
             }
743
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
744 677
         }
745 678
     }
746 679
 
@@ -752,10 +685,10 @@ strict namespace
752 685
     }
753 686
 
754 687
     // sync voted choice
755
-    script 568 (int v) clientside
688
+    /*script 568 (int v) clientside
756 689
     {
757 690
         votechosen = v;
758
-    }
691
+    }*/
759 692
 
760 693
     // sync timer
761 694
     script 569 (int time) clientside
@@ -774,21 +707,6 @@ strict namespace
774 707
     {
775 708
         players[pnum] = id;
776 709
     }
777
-<<<<<<< HEAD
778
-
779
-    // sync debug godmode
780
-    script 572 (int v) clientside
781
-    {
782
-        godmode = v;
783
-    }
784
-    
785
-    // sync debug instakiller
786
-    script 573 (int v) clientside
787
-    {
788
-        instakiller = v;
789
-    }
790
-=======
791
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
792 710
 
793 711
     function void state_init(void)
794 712
     {
@@ -880,27 +798,14 @@ strict namespace
880 798
         if(tiecount > 0)
881 799
         {
882 800
             // randomly choose a wad
883
-<<<<<<< HEAD
884
-            votechosen = votessorted[random(0, tiecount)][1];
885
-=======
886 801
             SetCVar("lexicon_global_votechosen", votessorted[random(0, tiecount)][1]);
887
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
888 802
         }
889 803
         else
890 804
         {
891 805
             // otherwise just choose the winner
892
-<<<<<<< HEAD
893
-            votechosen = votessorted[0][1];
894
-        }
895
-
896
-        // sync the clients
897
-        ACS_Execute(568, 0, votechosen);
898
-
899
-=======
900 806
             SetCVar("lexicon_global_votechosen", votessorted[0][1]);
901 807
         }
902 808
 
903
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
904 809
         // set the system to the results state
905 810
         state = STATE_RESULTS;
906 811
 
@@ -922,9 +827,6 @@ strict namespace
922 827
         if(state_clock > 5*35)
923 828
         {
924 829
             // go to chosen level
925
-<<<<<<< HEAD
926
-            ChangeLevel(votenames[votechosen][1], 0, CHANGELEVEL_RESETHEALTH|CHANGELEVEL_RESETINVENTORY|CHANGELEVEL_NOINTERMISSION, -1);
927
-=======
928 830
             if(GetCVar("lexicon_clear_inventory") == 1)
929 831
             {
930 832
                 ChangeLevel(votenames[GetCVar("lexicon_global_votechosen")][1], 0, CHANGELEVEL_RESETHEALTH | CHANGELEVEL_RESETINVENTORY | CHANGELEVEL_NOINTERMISSION, -1);
@@ -934,7 +836,6 @@ strict namespace
934 836
                 TakeInventory("Lexicon_VoteGun", 0x7FFFFFFF);
935 837
                 ChangeLevel(votenames[GetCVar("lexicon_global_votechosen")][1], 0, CHANGELEVEL_NOINTERMISSION, -1);
936 838
             }
937
->>>>>>> 9bf8684d... Rewritten from user function to built-in function.
938 839
         }
939 840
     }
940 841
 
@@ -1030,6 +931,5 @@ strict namespace
1030 931
 
1031 932
 
1032 933
 
1033
-
1034 934
 
1035 935
 

+ 2
- 0
pk3/CVARINFO.txt View File

@@ -4,7 +4,9 @@ server int lexicon_timer_yellow = 15;       // vote timer when it goes yellow
4 4
 server int lexicon_timer_orange = 10;       // vote timer when it goes orange
5 5
 server int lexicon_timer_red = 5;           // vote timer when it goes red
6 6
 server int lexicon_timer_reset = 10;        // lexicon reset timer(when no players are left in a level)
7
+server int lexicon_timer_reset_enabled = 1; // lexicon reset timer toggle
7 8
 server int lexicon_timer_1p_ignore = 1;     // if true, the voting system will ignore timer if only 1 player is playing
9
+server int lexicon_clear_inventory = 0;     // if true, clear inventory when entering VR and when change map from VR
8 10
 
9 11
 // used as global vars
10 12
 server noarchive int lexicon_global_godmode = 0;

Loading…
Cancel
Save