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

BotsCombos.MutBotsCombos


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
/* The mutator class for BotsCombos.  This is where all combo replacement
 * starts.  Some code here does not apply to dedicated server environs.  It's
 * kept in the hope that if someone really really really wanted to try it in
 * a Non-DS situation, it might still work. */
class MutBotsCombos extends Mutator
    config(BotsCombos);

var config string newComboString[16];
var config class<Combo> newComboClass[16];


function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
    local xPlayer xpl;
    local int c;

    bSuperRelevant = 0;

    if(Bot(Other) != None)
    {
        for(c = 0; c < ArrayCount(Bot(Other).ComboNames); c++ )
        {
            Bot(Other).ComboNames[c] = newComboString[c];
        }
    }
// I'm not sure this has to be here - I know if the similar code in
// ModifyPlayer wasn't there, things don't work 100% as desired.
// NoInvis had a similar stanza but not one in ModifyPlayer ...
// Perhaps this is for non-dedicated situations?
    else if(xPlayer(Other) != None && Level.NetMode != NM_DedicatedServer)
    {
        Warn("Check replacment run:"@Other);
        Warn("Level.NetMode:"@Level.NetMode);
        xpl = xPlayer(Other);
        for (c = 0; c < ArrayCount(xpl.ComboList); c++)
        {
            if(newComboString[c] != "")
            {
                xpl.ComboNameList[c] = newComboString[c];
                xpl.ComboList[c] = class<Combo>( DynamicLoadObject(newComboString[c], class'Class' ) );
            }else
            {
                xpl.ComboNameList[c] = "";
                xpl.ComboList[c] = None;
            }
        }
    }
    return true;
}

/* Don't ask me why - this gets called twice it seems, resulting in the
 * replication occurring twice at least for the first guy.
 * It could be a problem, I don't know yet. */
function ModifyPlayer(Pawn Other)
{
    local xPawn xp;
    local xPlayer xpl;
    local int c;
    local BotsCombosReplication BCRep;

    Super.ModifyPlayer(Other);

    if(BCRep == None)
        BCRep = spawn(class'BotsCombosReplication',Other,,,rot(0,0,0));
    if(BCRep == None)
        Warn("No BCRep found - UNSAFE TO CONTINUE!");
    BCRep.BCMut = self;
    BCRep.Initialize();
    xp = xPawn(Other);
    if (xp == None)
        return;
    xpl = xPlayer(xp.Controller);
    if(xpl == None)
        return;
    for (c = 0; c < ArrayCount(xpl.ComboList); c++)
    {
        if(newComboString[c] != "")
        {
            xpl.ComboNameList[c] = newComboString[c];
            xpl.ComboList[c] = class<Combo>( DynamicLoadObject(newComboString[c], class'Class' ) );      
        }else
        {
            xpl.ComboNameList[c] = "";
            xpl.ComboList[c] = None;
        }
    }
}

defaultproperties
{
    GroupName="BotsCombos"
    FriendlyName="Bot's Combos"
    Description="Bot's Combo Replacement Mod"
    newComboString(0)="BotsCombos.BotComboDefensive"
    newComboString(1)="BotsCombos.BotComboBerserk"
    newComboString(2)="XGame.ComboSpeed"
    newComboString(3)="XGame.ComboInvis"
    newComboString(4)=""
    newComboString(5)=""
    newComboString(6)=""
    newComboString(7)=""
    newComboString(8)=""
    newComboString(9)=""
    newComboString(10)=""
    newComboString(11)=""
    newComboString(12)=""
    newComboString(13)=""
    newComboString(14)=""
    newComboString(15)=""
    newComboClass(0)=class'BotsCombos.BotComboDefensive'
    newComboClass(1)=class'BotsCombos.BotComboBerserk'
    newComboClass(2)=class'XGame.ComboSpeed'
    newComboClass(3)=class'XGame.ComboInvis'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Sat 28/10/2006 13:57:26.000 - Creation time: Wed 7/2/2007 19:16:44.890 - Created with UnCodeX