/*
Custom monster balance mutator
(c) PooSH, 2012
Contact via Steam: [ScrN]PooSH
Edited by FluX for FluXiPerks
*/
class MutCustomMonsters extends Mutator
config (FluXiPerks);
var const string MonsterGroup;
var() config string ShiverPkgName;
var() config string ShiversBroPkgName;
var() config string HellfirePkgName;
var() config bool bAddShivers;
var() config bool bAddShiversBro;
var() config bool bAddHellfire;
var KFGameType KF;
/*function GetServerDetails( out GameInfo.ServerResponseLine ServerState )
{
// append the mutator name.
local int i;
super.GetServerDetails(ServerState);
i = ServerState.ServerInfo.Length;
ServerState.ServerInfo.insert(i, 1);
ServerState.ServerInfo[i].Key = "ScrnMonsters Version";
ServerState.ServerInfo[i++].Value = String(VERSION);
}*/
static function FillPlayInfo(PlayInfo PlayInfo)
{
Super.FillPlayInfo(PlayInfo);
PlayInfo.AddSetting(default.MonsterGroup,"bAddShivers","Add Shivers to the game",1,0, "Check");
PlayInfo.AddSetting(default.MonsterGroup,"bAddShiversBro","Add Shivers Brother to the game",1,0, "Check");
PlayInfo.AddSetting(default.MonsterGroup,"bAddHellfire","Add Hellfires to the game",1,0, "Check");
PlayInfo.AddSetting(default.MonsterGroup, "ShiverPkgName", "Shiver package name", 0, 0, "text");
PlayInfo.AddSetting(default.MonsterGroup, "ShiverBroPkgName", "Shivers Brother package name", 0, 0, "text");
PlayInfo.AddSetting(default.MonsterGroup, "HellfirePkgName", "Hellfire package name", 0, 0, "text");
}
static event string GetDescriptionText(string PropName)
{
switch (PropName)
{
case "bAddShivers": return "Add Shivers to the game, starting from wave 2";
case "bAddShiversBro": return "Add Shivers Brother to the game, starting from wave 6";
case "bAddHellfire": return "Add Hellfires to the game, starting from wave 6";
case "ShiverPkgName": return "Name of the package (.u file), which contains Shiver's code";
case "ShiverBroPkgName": return "Name of the package (.u file), which contains Shiver's Brother code";
case "HellfirePkgName": return "Name of the package (.u file), which contains Hellfire's code";
}
return Super.GetDescriptionText(PropName);
}
function PostBeginPlay()
{
KF = KFGameType(Level.Game);
if (KF == none) {
Log("ERROR: Wrong GameType (requires KFGameType)", Class.Outer.Name);
Destroy();
return;
}
KF.StandardMonsterClasses.Length = 0; //fill MonstersCollection instead
if (bAddShivers)
AddShivers();
if (bAddShiversBro)
AddShiversBro();
if (bAddHellfire)
AddHellfire();
//if (bHardPat && GetItemName(GetEndGameBoss()) ~= "ZombieBoss")
// SetEndGameBoss(string(Class'ScrnMonstersMut.HardPat'));
}
/*function SetEndGameBoss(string BossClassName)
{
KF.EndGameBossClass = BossClassName;
KF.MonsterCollection.default.EndGameBossClass = BossClassName;
}
function string GetEndGameBoss()
{
return KF.MonsterCollection.default.EndGameBossClass;
}*/
// Original code taken from MutAddShivers (c) [WPC]
function ReplaceMonsterInSquad(int SquadID, string SpecToReplace, int AmountToReplace, string NewMonsterID)
{
if (SpecToReplace != "")
KF.StandardMonsterSquads[SquadID] = AmountToReplace $ NewMonsterID
$ RemoveFromSquad(KF.StandardMonsterSquads[SquadID], SpecToReplace, AmountToReplace);
else
KF.StandardMonsterSquads[SquadID] = AmountToReplace $ NewMonsterID
$ KF.StandardMonsterSquads[SquadID];
}
// copy-pasted from MutAddShvers (c) [WPC]
function string RemoveFromSquad(string SquadStr, string ID, int NumToRemove)
{
local int x;
local int OldNum;
// Locate said specimen
for (x = 0; x < Len(SquadStr); x += 2)
if (Mid(SquadStr, x + 1, 1) == ID)
break;
if (x == Len(SquadStr))
return SquadStr;
OldNum = int(Mid(SquadStr, x, 1));
// If we are removing all, remove completely
if (OldNum - NumToRemove <= 0)
return Left(SquadStr, x) $ Right(SquadStr, Len(SquadStr) - x - 2);
return Left(SquadStr, x) $ (OldNum - NumToRemove) $ ID $ Right(SquadStr, Len(SquadStr) - x - 2);
}
/**
* Adds specimen to a special squad.
* @param SpecialSquad : KF.ShortSpecialSquads[x], KF.NormalSpecialSquads[x] or KF.LongSpecialSquads[x],
* where x is a wave number starting with 0 (pass 9 for wave 10)
* @param ZedClass : Zed class to add, e.g. ScrnMonstersMut.ZombieBruteSE
* @param NumZeds : Zed count to spawn in a squad
*
* @author PooSH
**/
function AddToSpecialSquadGT(KFGameType.SpecialSquad SpecialSquad, string ZedClass, int NumZeds)
{
SpecialSquad.ZedClass.insert(0, 1);
SpecialSquad.NumZeds.insert(0, 1);
SpecialSquad.ZedClass[0] = ZedClass;
SpecialSquad.NumZeds[0] = NumZeds;
}
function AddToSpecialSquadMC(KFMonstersCollection.SpecialSquad SpecialSquad, string ZedClass, int NumZeds)
{
SpecialSquad.ZedClass.insert(0, 1);
SpecialSquad.NumZeds.insert(0, 1);
SpecialSquad.ZedClass[0] = ZedClass;
SpecialSquad.NumZeds[0] = NumZeds;
}
// ShortIndex - aray index in ShortSpecialSquads, pass -1 to skip adding to squad
function AddToSpecialSquad(string ZedClass, int NumZeds, int ShortIndex, int NormalIndex, int LongIndex)
{
if ( ShortIndex >= 0) {
//AddToSpecialSquadGT(KF.ShortSpecialSquads[ShortIndex], ZedClass, NumZeds);
AddToSpecialSquadMC(KF.MonsterCollection.default.ShortSpecialSquads[ShortIndex], ZedClass, NumZeds);
}
if ( NormalIndex >= 0) {
//AddToSpecialSquadGT(KF.NormalSpecialSquads[NormalIndex], ZedClass, NumZeds);
AddToSpecialSquadMC(KF.MonsterCollection.default.NormalSpecialSquads[NormalIndex], ZedClass, NumZeds);
}
if ( LongIndex >= 0) {
//AddToSpecialSquadGT(KF.LongSpecialSquads[LongIndex], ZedClass, NumZeds);
AddToSpecialSquadMC(KF.MonsterCollection.default.LongSpecialSquads[LongIndex], ZedClass, NumZeds);
}
}
function int AddMonsterClass(String MonsterClass, out string MonsterID)
{
local int MonsterSlot;
// Get new slot in monster list
MonsterSlot = KF.MonsterCollection.default.MonsterClasses.Length;
KF.MonsterCollection.default.MonsterClasses.Length = MonsterSlot + 1;
MonsterID = Chr(65 + MonsterSlot);
// Add monster to monster list
KF.MonsterCollection.default.MonsterClasses[MonsterSlot].MClassName = MonsterClass;
KF.MonsterCollection.default.MonsterClasses[MonsterSlot].MID = MonsterID;
KF.MonsterCollection.default.StandardMonsterClasses[MonsterSlot] = KF.MonsterCollection.default.MonsterClasses[MonsterSlot];
return MonsterSlot;
}
function AddShivers()
{
local string MonsterID;
AddMonsterClass("FluXiPerksV9.ZombieShiverEx", MonsterID);
ReplaceMonsterInSquad(4, "A", 1/*2*/, MonsterID); // Clot
ReplaceMonsterInSquad(6, "A", 1/*2*/, MonsterID); // Clot
ReplaceMonsterInSquad(9, "C", 1, MonsterID); // Gorefast
ReplaceMonsterInSquad(10, "A", 1, MonsterID); // Clot
ReplaceMonsterInSquad(19, "C", 2, MonsterID); // Gorefast
}
function AddShiversBro()
{
local string MonsterID;
AddMonsterClass("FluXiPerksV9.ZombieShiverBro", MonsterID);
ReplaceMonsterInSquad(12, "A", 1, MonsterID); // Clot
ReplaceMonsterInSquad(14, "C", 1, MonsterID); // Gorefast
}
function AddHellfire()
{
local string MonsterID;
AddMonsterClass("FluXiPerksV9.ZombieHellFire", MonsterID);
ReplaceMonsterInSquad(26, "", 1, MonsterID); // With two Husks
ReplaceMonsterInSquad(12, "", 1, MonsterID); // Adds to wave 6+
ReplaceMonsterInSquad(13, "", 1, MonsterID); // Adds to wave 6+
AddToSpecialSquad("FluXiPerksV9.ZombieHellFire", 6, -1, -1, 2); // Add with the Flesh Pound
}
/*
function ReplaceMonsterInSquad(int SquadID, string SpecToReplace, int AmountToReplace, string NewMonsterID)
{
if (SpecToReplace != "")
KF.StandardMonsterSquads[SquadID] = AmountToReplace $ NewMonsterID
$ RemoveFromSquad(KF.StandardMonsterSquads[SquadID], SpecToReplace, AmountToReplace);
else
KF.StandardMonsterSquads[SquadID] = AmountToReplace $ NewMonsterID
$ KF.StandardMonsterSquads[SquadID];
}
function string RemoveFromSquad(string SquadStr, string ID, int NumToRemove)
{
local int x;
local int OldNum;
// Locate said specimen
for (x = 0; x < Len(SquadStr); x += 2)
if (Mid(SquadStr, x + 1, 1) == ID)
break;
if (x == Len(SquadStr))
return SquadStr;
OldNum = int(Mid(SquadStr, x, 1));
// If we are removing all, remove completely
if (OldNum - NumToRemove <= 0)
return Left(SquadStr, x) $ Right(SquadStr, Len(SquadStr) - x - 2);
return Left(SquadStr, x) $ (OldNum - NumToRemove) $ ID $ Right(SquadStr, Len(SquadStr) - x - 2);
}
function AddToSpecialSquad(KFGameType.SpecialSquad SpecialSquad, string ZedClass, int NumZeds)
{
SpecialSquad.ZedClass.insert(0, 1);
SpecialSquad.NumZeds.insert(0, 1);
SpecialSquad.ZedClass[0] = ZedClass;
SpecialSquad.NumZeds[0] = NumZeds;
}
*/
defaultproperties
{
MonsterGroup="Monsters"
ShiverPkgName="FluXiPerksV9"
ShiversBroPkgName="FluXiPerksV9"
HellfirePkgName="FluXiPerksV9"
bAddShivers=True
bAddShiversBro=True
bAddHellfire=True
GroupName="KF-FluXiCustomMonsters"
FriendlyName="[Fs] Custom Monster Spawn"
Description="Spawning system for the custom specimens with or without changes to them."
bAlwaysRelevant=True
RemoteRole=ROLE_SimulatedProxy
}