From Gustavo6046, 2 Months ago, written in UnrealScript.
This paste is a reply to CoopMatch gametype from Gustavo6046 - go back
Embed
Viewing differences between CoopMatch gametype and CoopMatch indented
//=============================================================================
// CoopMatch.
//=============================================================================
class CoopMatch expands TeamGamePlus;

simulated function ScoreKill(Pawn Killer, Pawn Other)
{
            if ( ScriptedPawn(Killer) != None && Other.bIsPlayer )
                return;

        
        return;

    
if ( ScriptedPawn(Other) != None && Killer.bIsPlayer )
                        Super(DeathMatchPlus).ScoreKill(Killer, Other);
                
        else
                
        
    else
        
Super.ScoreKill(Killer, Other);
}

function byte AssessBotAttitude(Bot aBot, Pawn Other)
{
            if ( (Other.bIsPlayer && (aBot.PlayerReplicationInfo.Team == Other.PlayerReplicationInfo.Team))
                        || (Other.IsA('TeamCannon') 
                                    && (StationaryPawn(Other).SameTeamAs(aBot.PlayerReplicationInfo.Team))) ) 
                        return 5;
                
        
5;
        
    
else if ( ScriptedPawn(Other) != None && ScriptedPawn(Other).AttitudeTo(aBot) == 1 )
                        return 1;
        
        else
                
1;
    
    else
        
return Super.AssessBotAttitude(aBot, Other);
}

function bool SendBotToGoal(Bot aBot)
{
            local Teleporter Dest, T;
        
T;
    
local int i;
        
i;
    
local bool b;
        
        
b;
    
    
foreach AllActors(class'Teleporter', T)
        {
                
T)
    {
        
for ( i = 0; i < Len(T.URL); i++ )
                                    if ( mid(T.URL, i, 1) == "#" )
                                                b = True;
                                
                
True;
                
        
if ( !b )
                        continue;
        
                
)
            continue;
    
        
if ( ( Dest == None || VSize(aBot.Location - T.Location) < VSize(Dest.Location - aBot.Location) ) )
                                    Dest = T;
        }
                
        
T;
    }
        
    
if ( Dest != None )
                
)
        
aBot.MoveTarget = aBot.FindPathToward(Dest);
        
        
    
    
if ( aBot.MoveTarget == None )
        {
                
    {
        
aBot.bStayFreelance = true;
                        aBot.Orders = 'FreeLance';
                        if ( aBot.bVerbose && Dest != None )
                                    log(aBot.PlayerReplicationInfo.PlayerName$" freelance because no path to exit "$Dest$" from "$aBot.Location);
                        
                
            
        
return false;
        }
        
        else
        {
                SetAttractionStateFor(aBot);
                
false;
    }
    
    else
    {
        SetAttractionStateFor(aBot);
        
return true;
        
true;
    
}
}

defaultproperties
{
        bNoMonsters=false
        MapPrefix=""
        bCoopWeaponMode=true
        
    bNoMonsters=false
    MapPrefix=""
    bCoopWeaponMode=true
    
BeaconName="CPMT"
    GameName="Campaign Botmatch"
        MaxCommanders=2
        
    MaxCommanders=2
    
StartUpMessage="Work with your teammates against the monsters towards the exit."
        MaxTeams=1
        
    MaxTeams=1
    
MaxAllowedTeams=4
}