Skip to content

Commit

Permalink
Fix to work with latest hard pat
Browse files Browse the repository at this point in the history
  • Loading branch information
Shtoyan committed May 1, 2023
1 parent 16d33cb commit d626b6f
Showing 1 changed file with 14 additions and 50 deletions.
64 changes: 14 additions & 50 deletions Classes/KFHardPatAddon.uc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ function Mutate(string MutateString, PlayerController Sender) {
local String command, mod;
local array<String> modArray;

super.Mutate(MutateString, Sender);

// ignore empty cmds and dont go further
Split(MutateString, " ", wordsArray);
if (wordsArray.Length == 0) {
Expand All @@ -41,60 +43,21 @@ function Mutate(string MutateString, PlayerController Sender) {
i++;
}

super.Mutate(MutateString, Sender);

if (mod ~= "VAMPIRE" || mod ~= "4") {
EventNum = 4;
ActivateTimer();
return;
}
}

// yeah i was super dumb, didn't make this modular...
// so enjoy yet another copy-paste job
function Timer() {
if (bUseCustomMC && KFGT.MonsterCollection == class'KFGameType'.default.MonsterCollection) {
KFGT.MonsterCollection = class'HPMonstersCollection';
log("Hard Patriarch: HPMonstersCollection is loaded!");
}

switch (EventNum) {
case 1:
strSeasonalPat = "KFHardPatF.HardPat_XMAS";
break;
case 2:
strSeasonalPat = "KFHardPatF.HardPat_CIRCUS";
break;
case 3:
strSeasonalPat = "KFHardPatF.HardPat_HALLOWEEN";
break;
case 4:
strSeasonalPat = "KFHardPatAddon.Vampriarch";
break;
default:
strSeasonalPat = "KFHardPatF.HardPat";
}
log("Hard Patriarch: " $strSeasonalPat$ " is selected!");

KFGT.EndGameBossClass = strSeasonalPat;

if (KFGT.MonsterCollection != none) {
KFGT.MonsterCollection.default.EndGameBossClass = strSeasonalPat;
}
if (command ~= "PAT") {
// allow only admins
if (!CheckAdmin(Sender)) {
SendMessage(Sender, "%wKFHardPatF requires %rADMIN %wprivileges!");
return;
}

if (!bBroadcast) {
return;
if (mod ~= "VAMPIRE" || mod ~= "4") {
EventNum = 4;
ActivateTimer();
return;
}
}

BroadcastText("%rHard Pat Mutator%w:");
BroadcastText("%b" $ strSeasonalPat $ " %wis activated!");
bBroadcast = false;

SetTimer(0.0, false);
// Destroy();
}


defaultproperties {
// same group so someone won't be able
// to activate both mods at the same time
Expand All @@ -103,4 +66,5 @@ defaultproperties {
Description="Adds Vampriarch, cut from KF in 2011."

bAddToServerPackages=true
SeasonalVariants(4)=(idx=4,variant=class'Vampriarch')
}

0 comments on commit d626b6f

Please sign in to comment.