function ScoreKill(pawn Killer, pawn Other)
{
local ScriptedPawn S;
if ( (Killer == None) || (Killer == Other) || !Other.bIsPlayer
|| (Killer.PlayerReplicationInfo.Team != Other.PlayerReplicationInfo.Team) )
Super.ScoreKill(Killer, Other);
MonstersTotal = 0;
foreach AllActors(class'ScriptedPawn', S)
{
if (S.Health >= 1)
MonstersTotal ++;
if (S.Shadow == None)
SetPawnDifficulty(MonsterSkill, S);
}
MonsterReplicationInfo(GameReplicationInfo).Monsters = MonstersTotal;
if (Other.bIsPlayer && MonsterReplicationInfo(GameReplicationInfo).bUseLives)
Other.PlayerReplicationInfo.Deaths -= 1;
if(!Other.IsA('ScriptedPawn')) return;
if(Killer!=None)
{
BroadcastMessage(Killer.GetHumanName()@"killed"$Other.GetHumanName());
}
// =========================================================================
// Score depending on which monster type the player kills
if ( (Killer.bIsPlayer) && ( (Other.IsA('Titan')) || (Other.IsA('Queen')) || (Other.IsA('WarLord')) ) )
Killer.PlayerReplicationInfo.Score += 4;
if ( (Killer.bIsPlayer) && ( (Other.IsA('GiantGasBag')) || (Other.IsA('GiantManta')) ) )
Killer.PlayerReplicationInfo.Score += 3;
if ( (Killer.bIsPlayer) && ( (Other.IsA('SkaarjWarrior')) || (Other.IsA('MercenaryElite')) || (Other.IsA('Brute')) ) )
Killer.PlayerReplicationInfo.Score += 2;
if ( (Killer.bIsPlayer) && ( (Other.IsA('SkaarjTrooper')) || ( (Other.IsA('Mercenary')) && (!Other.IsA('MercenaryElite')) ) || (Other.IsA('Krall')) || (Other.IsA('Slith')) || ( (Other.IsA('GasBag')) && (!Other.IsA('GiantGasBag')) ) ) )
Killer.PlayerReplicationInfo.Score += 1;
// Lose points for killing innocent creatures. Shame ;-)
if ( (Killer.bIsPlayer) && ( (Other.IsA('Nali')) || (Other.IsA('Cow')) || (Other.IsA('NaliRabbit')) ) )
Killer.PlayerReplicationInfo.Score -= 6;
// Get 10 extra points for killing the boss!!
if (Other.IsA('ScriptedPawn'))
S = ScriptedPawn(Other);
if ( (Killer.bIsPlayer) && ( S.bIsBoss ) )
Killer.PlayerReplicationInfo.Score += 9;
}
function AddToTeam( int num, Pawn Other )
{
local teaminfo aTeam;
local Pawn P;
local bool bSuccess;
local string SkinName, FaceName;
if ( Other != None )
{
aTeam = Teams[0];
aTeam.Size++;
Other.PlayerReplicationInfo.Team = 0;
Other.PlayerReplicationInfo.TeamName = aTeam.TeamName;
bSuccess = false;
if ( Other.IsA('PlayerPawn') )
{
Other.PlayerReplicationInfo.TeamID = 0;
PlayerPawn(Other).ClientChangeTeam(Other.PlayerReplicationInfo.Team);
}
else
Other.PlayerReplicationInfo.TeamID = 1;
while ( !bSuccess )
{
bSuccess = true;
for ( P=Level.PawnList; P!=None; P=P.nextPawn )
if ( P.bIsPlayer && (P != Other)
&& (P.PlayerReplicationInfo.Team == Other.PlayerReplicationInfo.Team)
&& (P.PlayerReplicationInfo.TeamId == Other.PlayerReplicationInfo.TeamId) )
{
Other.PlayerReplicationInfo.TeamID++;
bSuccess = False;
}
}
if (MonsterReplicationInfo(GameReplicationInfo).bUseLives)
Other.PlayerReplicationInfo.Deaths = MonsterReplicationInfo(GameReplicationInfo).Lives;
if (MonsterReplicationInfo(GameReplicationInfo).bUseTeamSkins)
{
Other.static.GetMultiSkin(Other, SkinName, FaceName);
Other.static.SetMultiSkin(Other, SkinName, FaceName, 0);
}
}
}
function ScoreKill(pawn Killer, pawn Other)
{
local ScriptedPawn S;
if ( (Killer == None) || (Killer == Other) || !Other.bIsPlayer
|| (Killer.PlayerReplicationInfo.Team != Other.PlayerReplicationInfo.Team) )
Super.ScoreKill(Killer, Other);
function ScoreKill(pawn Killer, pawn Other)
{
Other.DieCount++;
if( (killer == Other) || (killer == None) )
Other.PlayerReplicationInfo.Score -= 1;
else if ( killer != None )
{
killer.killCount++;
if ( killer.PlayerReplicationInfo != None )
killer.PlayerReplicationInfo.Score += 1;
}
BaseMutator.ScoreKill(Killer, Other);
}
function PostBeginPlay()
{
Level.Game.RegisterDamageMutator( Self ); // In order to receive damage calls, we need to register ourself as a DamageMutator.
}
function MutatorTakeDamage( out int ActualDamage, Pawn Victim, Pawn InstigatedBy, out Vector HitLocation,
out Vector Momentum, name DamageType)
{
if(InstigatedBy!=none) BroadcastMessage("Killer:"@InstigatedBy.PlayerReplicationInfo.Playername@InstigatedBy.bIsPlayer);
if(Victim!=none) BroadcastMessage("Died:"@Victim.PlayerReplicationInfo.Playername@Victim.bIsPlayer);
if(InstigatedBy!=none && InstigatedBy==Victim && Victim.PlayerReplicationInfo.Health <= 0) BroadcastMessage("A suicide!");
if ( NextDamageMutator != None )
NextDamageMutator.MutatorTakeDamage( ActualDamage, Victim, InstigatedBy, HitLocation, Momentum, DamageType );
}