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

UnrealShare.BotInfo


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
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
//=============================================================================
// BotInfo.
//=============================================================================
class BotInfo expands Info;

var() config bool   bAdjustSkill;
var() config bool   bRandomOrder;

var() config string[20] BotNames[32];
var() config int BotTeams[32];
var() config float BotSkills[32];
var() config float BotAccuracy[32];
var() config float CombatStyle[32]; 
var() config float Alertness[32];
var() config float Camping[32];
var() config class<Weapon> FavoriteWeapon[32];
var   byte ConfigUsed[32];
var() config string[32] BotClasses[32];
var() config string[64] BotSkins[32];
var string[32] AvailableClasses[32], NextBotClass;
var int NumClasses;

function PreBeginPlay()
{
    //DON'T Call parent prebeginplay
}

function PostBeginPlay()
{
    local string[32] NextBotClass;
    local int i;

    Super.PostBeginPlay();

    NextBotClass = GetNextInt("Bots", 0); 
    while ( (NextBotClass != "") && (NumClasses < 32) )
    {
        AvailableClasses[NumClasses] = NextBotClass;
        NumClasses++;
        NextBotClass = GetNextInt("Bots", NumClasses); 
    }
}

function String[32] GetAvailableClasses(int n)
{
    return AvailableClasses[n];
}

function int ChooseBotInfo()
{
    local int n, start;

    if ( bRandomOrder )
        n = Rand(16);
    else 
        n = 0;

    start = n;
    while ( (n < 32) && (ConfigUsed[n] == 1) )
        n++;

    if ( (n == 32) && bRandomOrder )
    {
        n = 0;
        while ( (n < start) && (ConfigUsed[n] == 1) )
            n++;
    }

    if ( n > 31 )
        n = 31;

    return n;
}

function class<bots> GetBotClass(int n)
{
    return class<bots>( DynamicLoadObject(GetBotClassName(n), class'Class') );
}

function Individualize(bots NewBot, int n, int NumBots)
{
    local texture NewSkin;

    // Set bot's skin
    if ( (n >= 0) && (n < 32) && (BotSkins[n] != "") && (BotSkins[n] != "None") )
    {
        NewSkin = texture(DynamicLoadObject(BotSkins[n], class'Texture'));
        if ( NewSkin != None )
            NewBot.Skin = NewSkin;
    }

    // Set bot's name.
    if ( (BotNames[n] == "") || (ConfigUsed[n] == 1) )
        BotNames[n] = "Bot";

    Level.Game.ChangeName( NewBot, BotNames[n], false );
    if ( BotNames[n] != NewBot.PlayerReplicationInfo.PlayerName )
        Level.Game.ChangeName( NewBot, ("Bot"$NumBots), false);

    ConfigUsed[n] = 1;

    // adjust bot skill
    NewBot.Skill = FClamp(NewBot.Skill + BotSkills[n], 0, 3);
    NewBot.ReSetSkill();
}

function SetBotClass(string[32] ClassName, int n)
{
    BotClasses[n] = ClassName;
}

function SetBotName(coerce string[20] NewName, int n)
{
    BotNames[n] = NewName;
}

function String[32] GetBotName(int n)
{
    return BotNames[n];
}

function int GetBotTeam(int num)
{
    return BotTeams[Num];
}

function SetBotTeam(int NewTeam, int n)
{
    BotTeams[n] = NewTeam;
}

function int GetBotIndex(coerce string[20] BotName)
{
    local int i;
    local bool found;

    found = false;
    for (i=0; i<ArrayCount(BotNames)-1; i++)
        if (BotNames[i] == BotName)
        {
            found = true;
            break;
        }

    if (!found)
        i = -1;

    return i;
}

function string[64] GetBotSkin(int num)
{
    return BotSkins[Num];
}

function SetBotSkin(coerce string[64] NewSkin, int n)
{
    BotSkins[n] = NewSkin;
}

function String[32] GetBotClassName(int n)
{
    if ( (n < 0) || (n > 31) )
        return AvailableClasses[Rand(NumClasses)];

    if ( BotClasses[n] == "" )
        BotClasses[n] = AvailableClasses[Rand(NumClasses)];

    return BotClasses[n];
}

defaultproperties
{
     BotNames(0)="Dante"
     BotNames(1)="Ash"
     BotNames(2)="Rhiannon"
     BotNames(3)="Kurgan"
     BotNames(4)="Sonja"
     BotNames(5)="Avatar"
     BotNames(6)="Dominator"
     BotNames(7)="Cholerae"
     BotNames(8)="Apocalypse"
     BotNames(9)="Bane"
     BotNames(10)="Hippolyta"
     BotNames(11)="Eradicator"
     BotNames(12)="Nikita"
     BotNames(13)="Arcturus"
     BotNames(14)="Shiva"
     BotNames(15)="Vindicator"
     BotTeams(0)=1
     BotTeams(2)=1
     BotTeams(4)=1
     BotTeams(6)=1
     BotTeams(8)=1
     BotTeams(10)=1
     BotTeams(12)=1
     BotTeams(14)=1
     BotClasses(0)="Unreali.MaleThreeBot"
     BotClasses(1)="Unreali.MaleTwoBot"
     BotClasses(2)="Unreali.FemaleOneBot"
     BotClasses(3)="Unreali.MaleOneBot"
     BotClasses(4)="Unreali.FemaleTwoBot"
     BotClasses(5)="Unreali.MaleThreeBot"
     BotClasses(6)="Unreali.SkaarjPlayerBot"
     BotClasses(7)="Unreali.FemaleOneBot"
     BotClasses(8)="Unreali.MaleThreeBot"
     BotClasses(9)="Unreali.MaleTwoBot"
     BotClasses(10)="Unreali.FemaleTwoBot"
     BotClasses(11)="Unreali.SkaarjPlayerBot"
     BotClasses(12)="Unreali.FemaleOneBot"
     BotClasses(13)="Unreali.MaleOneBot"
     BotClasses(14)="Unreali.MaleTwoBot"
     BotClasses(15)="Unreali.SkaarjPlayerBot"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Sun 21/2/2010 23:48:40.000 - Creation time: Sun 21/2/2010 23:49:51.259 - Created with UnCodeX