Browse Source

Making sure correct changes are coming through for penguins changes

master
Mathew Antich 4 months 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
{ "Unused", "MAP01", "\c[LightBlue](Single)"}, // 191
{ "Unused", "MAP01", "\c[LightBlue](Single)"}, // 192
};

/////////////////////
// vote manager
/////////////////////
@@ -239,12 +240,6 @@ strict namespace
int state = STATE_INIT; // state of the voting system
int state_clock; // custom timer

<<<<<<< HEAD
global int 2:votechosen; // the winner
global int 3:sucktime; // the sucktime of the previous level
=======
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.
/////////////////////
// hud
/////////////////////
@@ -271,15 +266,6 @@ strict namespace
int levelstarted = 0;
int clock = 0;
int countstart = 0;
<<<<<<< HEAD
/////////////////////
// debug
/////////////////////
global int 0:godmode;
global int 1:instakiller;
=======
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.

// stuff that runs during any level
script "SV_Level" open
@@ -287,92 +273,82 @@ strict namespace
if(GetLevelInfo(LEVELINFO_LEVELNUM) == 99)
{
// we have come back from a completed mapset
<<<<<<< HEAD
if(sucktime == 1337)
=======
if(GetCVar("lexicon_global_sucktime") == 1337)
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.
{
ACS_NamedExecute("Fireworks", 0);
}
terminate;
}
<<<<<<< HEAD
sucktime = GetLevelInfo(LEVELINFO_SUCK_TIME);
=======
SetCVar("lexicon_global_sucktime", GetLevelInfo(LEVELINFO_SUCK_TIME));
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.
levelstarted = 0;
clock = GetCvar("lexicon_timer_reset");

while(1)
if(GetCvar("lexicon_timer_reset_enabled") == 1)
{
// if the level has started and the countdown is not started
if(levelstarted == 1 && countstart == 0)
{
// if the playercount goes back to 0
if(playercount() == 0)
{
countstart = 1;
}
}
// if nobody has joined yet
else
{
// wait for someone to join
if(playercount() > 0)
{
//the level has been started
levelstarted = 1;
}
}
// countdown has started
if(countstart == 1)
while(1)
{
// countdown
clock--;
if(countstart == 1)
// if the level has started and the countdown is not started
if(levelstarted == 1 && countstart == 0)
{
// these hudmessages were in the cl_lexicon_hud script
// it had to be moved here as zandronum terminates player scripts when they spectate
// resulting in these hudmessages not showing
HudSetup(0, 0);
SetFont("HUDFONT");
if(clock > 7)
// if the playercount goes back to 0
if(playercount() == 0)
{
hudmessagebold(s:"\c[Green]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
countstart = 1;
}
else if(clock <= 7 && clock > 4)
}
// if nobody has joined yet
else
{
// wait for someone to join
if(playercount() > 0)
{
hudmessagebold(s:"\c[Yellow]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
//the level has been started
levelstarted = 1;
}
else if(clock <= 4 && clock > 1)
}
// countdown has started
if(countstart == 1)
{
// countdown
clock--;
if(countstart == 1)
{
hudmessagebold(s:"\c[Orange]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
// these hudmessages were in the cl_lexicon_hud script
// it had to be moved here as zandronum terminates player scripts when they spectate
// resulting in these hudmessages not showing
HudSetup(0, 0);
SetFont("HUDFONT");
if(clock > 7)
{
hudmessagebold(s:"\c[Green]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
}
else if(clock <= 7 && clock > 4)
{
hudmessagebold(s:"\c[Yellow]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
}
else if(clock <= 4 && clock > 1)
{
hudmessagebold(s:"\c[Orange]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
}
else if(clock <= 1 && clock >= 0)
{
hudmessagebold(s:"\c[Red]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
}
}
else if(clock <= 1 && clock >= 0)
// when time is up
if(clock < 0)
{
<<<<<<< HEAD
hudmessagebold(s:"\c[Red]Going back to the lexicon in: ", i:clock; 0, 9998, 0, hud_width_half, 112.0, 1.1);
=======
// go back to hub
SetCVar("lexicon_global_sucktime", 0);
ChangeLevel("VR", 0, 0, -1);
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.
}
delay(34);
}
// when time is up
if(clock < 0)
{
// go back to hub
sucktime = 0;
ChangeLevel("VR", 0, 0, -1);
}
delay(34);
delay(1);
}
delay(1);
}
}

@@ -383,11 +359,6 @@ strict namespace
{
Thing_ChangeTID(0, playernumber()+PLAYER_TID);

<<<<<<< HEAD
ACS_Execute(568, 0, votechosen);

=======
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.
// we have entered the VR map
if(GetLevelInfo(LEVELINFO_LEVELNUM) == 99)
{
@@ -400,8 +371,12 @@ strict namespace
ACS_ExecuteAlways(570, 0, state);
// give player the votegun
ClearInventory();
if(GetCVar("lexicon_clear_inventory") == 1)
{
ClearInventory();
}
GiveInventory("Lexicon_VoteGun", 1);
SetWeapon("Lexicon_VoteGun");

}
}
@@ -431,11 +406,7 @@ strict namespace
// mapset/mapname/creds
HudSetup(0, 0);
setfont("hudfont");
<<<<<<< HEAD
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);
=======
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);
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.
}
//////////////////////////
@@ -448,15 +419,9 @@ strict namespace
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);
// we have come back from a completed mapset
<<<<<<< HEAD
if(sucktime == 1337)
{
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);
=======
if(GetCVar("lexicon_global_sucktime") == 1337)
{
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);
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.
}


@@ -494,11 +459,7 @@ strict namespace
//////////////////////////
if(GetCVar("lexicon_debug_mode") == 1)
{
<<<<<<< HEAD
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);
=======
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);
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.
}

//////////////////////////
@@ -555,11 +516,7 @@ strict namespace
else if(state == STATE_RESULTS)
{
setfont("hudfont");
<<<<<<< HEAD
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);
=======
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);
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.

// confetti :D
for(int c = 0; c < 128; c++)
@@ -682,28 +639,17 @@ strict namespace
{
if(GetLevelInfo(LEVELINFO_LEVELNUM) == 99)
{
<<<<<<< HEAD
godmode = 0;
instakiller = 0;
}
if(godmode)
=======
SetCVar("lexicon_global_godmode", 0);
SetCVar("lexicon_global_instakiller", 0);
}
if(GetCVar("lexicon_global_godmode") == 1)
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.
{
for(int i = 0; i < 63; i++)
{
GiveActorInventory(PLAYER_TID+i, "Lexicon_GodMode", 1);
}
}
<<<<<<< HEAD
if(instakiller)
=======
if(GetCVar("lexicon_global_instakiller") == 1)
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.
{
for(int i = 0; i < 63; i++)
{
@@ -720,18 +666,6 @@ strict namespace
switch(id)
{
case 0:
<<<<<<< HEAD
if(godmode == 0) { godmode = 1; break; }
if(godmode == 1) { godmode = 0; break; }
break;
case 2:
if(instakiller == 0) { instakiller = 1; break; }
if(instakiller == 1) { instakiller = 0; break; }
break;
}
ACS_ExecuteAlways(572, 0, godmode);
ACS_ExecuteAlways(573, 0, instakiller);
=======
if(GetCVar("lexicon_global_godmode") == 0) { SetCVar("lexicon_global_godmode", 1); break; }
if(GetCVar("lexicon_global_godmode") == 1) { SetCVar("lexicon_global_godmode", 0); break; }
break;
@@ -740,7 +674,6 @@ strict namespace
if(GetCVar("lexicon_global_instakiller") == 1) { SetCVar("lexicon_global_instakiller", 0); break; }
break;
}
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.
}
}

@@ -752,10 +685,10 @@ strict namespace
}

// sync voted choice
script 568 (int v) clientside
/*script 568 (int v) clientside
{
votechosen = v;
}
}*/

// sync timer
script 569 (int time) clientside
@@ -774,21 +707,6 @@ strict namespace
{
players[pnum] = id;
}
<<<<<<< HEAD

// sync debug godmode
script 572 (int v) clientside
{
godmode = v;
}
// sync debug instakiller
script 573 (int v) clientside
{
instakiller = v;
}
=======
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.

function void state_init(void)
{
@@ -880,27 +798,14 @@ strict namespace
if(tiecount > 0)
{
// randomly choose a wad
<<<<<<< HEAD
votechosen = votessorted[random(0, tiecount)][1];
=======
SetCVar("lexicon_global_votechosen", votessorted[random(0, tiecount)][1]);
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.
}
else
{
// otherwise just choose the winner
<<<<<<< HEAD
votechosen = votessorted[0][1];
}

// sync the clients
ACS_Execute(568, 0, votechosen);

=======
SetCVar("lexicon_global_votechosen", votessorted[0][1]);
}

>>>>>>> 9bf8684d... Rewritten from user function to built-in function.
// set the system to the results state
state = STATE_RESULTS;

@@ -922,9 +827,6 @@ strict namespace
if(state_clock > 5*35)
{
// go to chosen level
<<<<<<< HEAD
ChangeLevel(votenames[votechosen][1], 0, CHANGELEVEL_RESETHEALTH|CHANGELEVEL_RESETINVENTORY|CHANGELEVEL_NOINTERMISSION, -1);
=======
if(GetCVar("lexicon_clear_inventory") == 1)
{
ChangeLevel(votenames[GetCVar("lexicon_global_votechosen")][1], 0, CHANGELEVEL_RESETHEALTH | CHANGELEVEL_RESETINVENTORY | CHANGELEVEL_NOINTERMISSION, -1);
@@ -934,7 +836,6 @@ strict namespace
TakeInventory("Lexicon_VoteGun", 0x7FFFFFFF);
ChangeLevel(votenames[GetCVar("lexicon_global_votechosen")][1], 0, CHANGELEVEL_NOINTERMISSION, -1);
}
>>>>>>> 9bf8684d... Rewritten from user function to built-in function.
}
}

@@ -1030,6 +931,5 @@ strict namespace







+ 2
- 0
pk3/CVARINFO.txt View File

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

// used as global vars
server noarchive int lexicon_global_godmode = 0;

Loading…
Cancel
Save