Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

KFStoryGame.KF_StorySquadDesigner


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
/*
	--------------------------------------------------------------
	KF_StorySquadDesigner
	--------------------------------------------------------------

	This actor provides level designers with a method of settings up
	pre-defined squads of Monsters for story missions.  Squads can be
    referenced in either KF_StoryZombeVolumes or KF_StoryWaveDesigners.

	Author :  Alex Quick

	--------------------------------------------------------------
*/

class KF_StorySquadDesigner extends Info
dependson(KFStoryGameInfo)
hidecategories(Collision,Force,Karma,Lighting,LightColor,Sound,Events,Movement)
placeable;


var()  array<KFStoryGameInfo.SZEDSquadType>   Squads;
var  bool                                   bUseDefaultSquads;


/* In case we want to just use whatever is in the KF Gametype instead of having to set up custom monster squads */
function FillSquadsFromGameType()
{
    local int i,idx;
    local KFGameType KFGI;
    local string SquadString;
    local array<string> ZEDTypes;
    local string NewZEDType;
    local int SplitSize;
    local string LeftHalf;
    local int Squadidx;
    local bool bExistsAlready;

    KFGI = KFGameType(Level.Game);
    if(KFGI == none)
    {
       return;
    }

    SplitSize = 2;

    for(i = 0 ; i < KFGI.MonsterSquad.length ; i ++)
    {
        Squads.length = Squads.length + 1;
        Squads[Squads.length-1].Squad_Name = KFGI.MonsterSquad[i] ;
        SquadString = Squads[Squads.length-1].Squad_Name ;

        while(Len(SquadString) >= SplitSize)
        {
            NewZEDType =  Left(SquadString,SplitSize);
            ZEDTypes[ZEDTypes.length] = NewZEDType;
            Divide(SquadString,NewZEDType,LeftHalf,SquadString);
        }

        for(idx = 0 ; idx < ZEDTypes.length ; idx ++)
        {
            bExistsAlready = false;
            for(Squadidx = 0 ; SquadIdx < Squads[Squads.length-1].Squad_ZEDS.length ; SquadIdx ++)
            {
                if(string(Squads[Squads.length-1].Squad_ZEDs[SquadIdx].ZEDClass) == ZEDTypes[idx])
                {
                    bExistsAlready = true;
                    break;
                }
            }

            if(bExistsAlready)
            {
                continue;
            }
            else
            {
                Squads[Squads.length-1].Squad_ZEDs.length = Squads[Squads.length-1].Squad_ZEDs.length + 1;
                Squads[Squads.length-1].Squad_ZEDs[Squads[Squads.length-1].Squad_ZEDs.length -1].ZEDClass = GetAssociatedZEDClass(Right(ZEDTypes[idx],1)) ;
                Squads[Squads.length-1].Squad_ZEDs[Squads[Squads.length-1].Squad_ZEDs.length -1].NumToSpawn = int(Left(ZEDTypes[idx],1)) ;
            }
        }

        ZEDTypes.length = 0;
    }
}


/* Returns the class of the ZED associated with the supplied letter ...

a result of the delightfully overblown Monster Squad system from UT2k4s invasion gametype
where a Monster Class is a letter! and a Squad is a bunch of letters! And a Wave is a bunch of
bits that represent a bunch of binary which represents a bunch of letters which represent a bunch of Monsters! HERPdeDERPaHURRRRDURRRR !

*/
function  class<KFMonster> GetAssociatedZEDClass( string Letter)
{
    local KFGameType KFGI;
    local int i;
    local class<KFMonster> ZEDClassType;
    local string MonsterID;

    KFGI = KFGameType(Level.Game);
    if(KFGI == none)
    {
       return none;
    }

    for(i = 0 ; i < KFGI.MonsterCollection.default.StandardMonsterClasses.length ; i ++)
    {
        MonsterID = KFGI.MonsterCollection.default.StandardMonsterClasses[i].MID ;
        if(MonsterID  == Letter)
        {
            ZEDClassType = class<KFMonster>(DynamicLoadObject(KFGI.MonsterCollection.default.StandardMonsterClasses[i].MClassName, class'Class')) ;
         //   log(" The Monster class associated with the letter : "@Letter@"is : "@ZEDClassType.default.menuname,'Story_Debug');
            return ZEDClassType;
        }
    }
}

defaultproperties
{
     Texture=Texture'KFStoryGame_Tex.Editor.KF_StorySquads_Ico'
     DrawScale=0.500000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fri 13-10-2023 03:17:28.000 - Creation time: Fri 13-10-2023 03:19:04.671 - Created with UnCodeX