Skip to content

Commit

Permalink
More gameplay related tweaks
Browse files Browse the repository at this point in the history
- Spawn protection no longer depends on weapon change and ammo fired.
Instead it'll count down twice as fast if player is holding fire or
sitting in supplier (can go down 4x as fast if both cases are true).
A weapon change substracts 2 seconds from counter.

- Adjustments to RU bounties per kill.
Base bounty is always 50 (42 if spawnkilled) and mid spawn camping is
even more heavily punished.
Sniper Camping (not moving, very safe location for killer) adds an extra
lmae point to the kill as well.
Firing a nuke substracts lamer points.

- Reduced code complexity in Suppliers
  • Loading branch information
CacoFFF committed Jul 9, 2016
1 parent 8bb747c commit 7105526
Show file tree
Hide file tree
Showing 11 changed files with 138 additions and 160 deletions.
2 changes: 1 addition & 1 deletion Classes/Mine.uc
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ simulated function FinishBuilding()
MyTrigger.SetCollisionSize( DetRadius, DetRadius);
MyTrigger.SetLocation( Location - vect(0,0,1) );
if ( OwnerPRI != none )
OwnerPRI.sgInfoSpreeCount += 2;
OwnerPRI.sgInfoSpreeCount += 3;
}

if ( Level.NetMode == NM_DedicatedServer )
Expand Down
41 changes: 23 additions & 18 deletions Classes/SiegeGI.uc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ var() config bool bUseDenied;
var() config bool bUseNukeDeco;
var() config bool bShareFingerPrints;
var() config bool bDisableIDropFix;
var() config bool bEffBasedRUKill;
var() config bool bBotCanCheat;
var() config bool bCore5AddsEnforcer;
var() config bool bPlayersRelevant;
Expand Down Expand Up @@ -1097,7 +1096,7 @@ function bool PickupQuery( Pawn Other, Inventory item )
&& Other != none
&& sgPRI(Other.PlayerReplicationInfo) != none )
{
sgPRI(Other.PlayerReplicationInfo).sgInfoSpreeCount += 4;
sgPRI(Other.PlayerReplicationInfo).sgInfoSpreeCount += 10;
}
return Result;
}
Expand Down Expand Up @@ -1179,11 +1178,12 @@ function Killed( pawn Killer, pawn Other, name damageType )

function ScoreKill(Pawn killer, Pawn other)
{
local string sWarhead;
local int FlameAmmo, NukeAmmo;
local int NukeAmmo;
local float RuMult;
local bool bTeamKill;
local sgPRI aVictim, aKiller;
local sgNukeLauncher Nuke;
local vector TStart;

if ( bRoundMode ) RuMult = RoundRuScale;
else RuMult = 1;
Expand Down Expand Up @@ -1213,7 +1213,7 @@ function ScoreKill(Pawn killer, Pawn other)
aKiller.Score += 1;
if ( (aKiller != none) && (aVictim != none) && aVictim.bReachedSupplier && (aVictim.SupplierTimer > 0) )
{
aKiller.sgInfoSpreeCount += 3;
aKiller.sgInfoSpreeCount += 5;
aKiller.AddRU( KillRUReward(none, true) * RuMult);
Cores[aKiller.Team].StoredRU -= aVictim.SupplierTimer + Teams[aKiller.Team].Size * 5 * Cores[aKiller.Team].Grade;
PenalizeTeamForKill( Other, aKiller.Team);
Expand All @@ -1225,6 +1225,14 @@ function ScoreKill(Pawn killer, Pawn other)
SharedReward( aKiller, aKiller.Team, KillRUReward( aVictim, false) * RuMult, 0.5);
aKiller.sgInfoSpreeCount += 1;
aVictim.sgInfoSpreeCount = 0;
//Camper
if ( SniperRifle(Killer.Weapon) != None && (VSize(Killer.Velocity) < Killer.GroundSpeed * 0.3) )
{
TStart = Killer.Location;
TStart.Z += Killer.BaseEyeHeight - Killer.CollisionHeight * 0.5;
if ( !FastTrace( Other.Location, TStart) && !FastTrace( Other.Location-vect(0,0,20), TStart) && !FastTrace( Other.Location+vect(0,0,20), TStart) )
aKiller.sgInfoSpreeCount += 1;
}
}
}
else
Expand All @@ -1242,32 +1250,30 @@ function ScoreKill(Pawn killer, Pawn other)
aVictim.AddRU(-10 * RuMult);
}


if( sgNukeLauncher(other.FindInventoryType(class'sgNukeLauncher')) != None )
Nuke = sgNukeLauncher(other.FindInventoryType(class'sgNukeLauncher'));
if( (aVictim != none) && (Nuke != None) )
{
NukeAmmo = sgNukeLauncher(Other.FindInventoryType(class'sgNukeLauncher')).AmmoType.AmmoAmount;
NukeAmmo = Nuke.AmmoType.AmmoAmount;
if (NukeAmmo == 1)
{
sWarhead = ""$other.PlayerReplicationInfo.PlayerName@"was carrying a WARHEAD!!!";
if (killer != None && (aKiller != None) && killer != other)
{
aKiller.AddRU(500 * abs(int(bTeamKill)-1) );
aKiller.sgInfoWarheadKiller += abs(int(bTeamKill)-1);
killer.PlayerReplicationInfo.Score += 5 * abs(int(bTeamKill)-1);
}
AnnounceAll(sWarhead);
AnnounceAll( aVictim.PlayerName@"was carrying a WARHEAD!!!" );
}

if (NukeAmmo > 1)
{
sWarhead = ""$other.PlayerReplicationInfo.PlayerName@"was carrying "$NukeAmmo$" WARHEADS!!!";
if (killer != None && (aKiller != None) && killer != other)
{
aKiller.AddRU(1000 * abs(int(bTeamKill)-1) );
aKiller.sgInfoWarheadKiller += 2 * abs(int(bTeamKill)-1);
killer.PlayerReplicationInfo.Score += 10 * abs(int(bTeamKill)-1);
}
AnnounceAll(sWarhead);
AnnounceAll( aVictim.PlayerName@"was carrying "$NukeAmmo$" WARHEADS!!!" );
}
}

Expand Down Expand Up @@ -2298,18 +2304,18 @@ function PenalizeTeamForKill( Pawn Killed, byte aTeam)
function float KillRUReward( sgPRI Victim, bool bNegative)
{
local float Factor;
local float Factor, Eff2;
if ( bNegative )
Factor = -1;
else
Factor = 1;
if ( !bEffBasedRUKill || Victim == none )
if ( Victim == none )
return 50 * Factor;
if ( Victim.GetEff( true) > 85 && Victim.sgInfoKiller > 4)
Factor *= (Victim.GetEff(true) - 78) / 7;
return (35 + Victim.GetEff( true) * 0.25 + float(Victim.sgInfoSpreeCount)**1.4) * Factor;
Eff2 = Victim.GetEff2();
Factor *= fMax(1,(Eff2 - 60) / 20.f); //Eff 80 starts multiplying
return (42 + float(Victim.sgInfoSpreeCount)**1.3) * Factor;
}
function SharedReward( sgPRI Awarded, byte Team, float Award, optional float Waste)
Expand Down Expand Up @@ -2348,7 +2354,6 @@ defaultproperties
RoundRuScale=2
bUseNukeDeco=False
bCore5AddsEnforcer=True
bEffBasedRUKill=True
BaseMotion=70
TranslocBaseForce=800
TranslocLevelForce=120
Expand Down
18 changes: 13 additions & 5 deletions Classes/sgBaseCore.uc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ simulated function Timer()
local sgPRI a;
local float SetRU;
local float MaxRU;
local bool bRemoveFromStore;
local int TeamSize, MaxedOut;

Super.Timer();
Expand Down Expand Up @@ -127,21 +128,28 @@ simulated function Timer()
else
{
if ( StoredRU > SetRU*TeamSize*2 )
{
bRemoveFromStore = true;

/* {
StoredRU -= SetRU*TeamSize*2;
SetRU *= 3;
}
}*/
ForEach AllActors(class'sgPRI', a)
{ if( a.Team == Team )
{
if( a.Team == Team )
{
if ( a.RU >= MaxRU )
MaxedOut++;
else
a.AddRU( SetRU, true);
a.AddRU( SetRU * (1+2*int(bRemoveFromStore)), true);
}
}

if ( MaxedOut > 0 )
StoredRU += SetRU * 0.5 * MaxedOut;
StoredRU += SetRU * 0.5 * MaxedOut; //Those maxed out give half their RU to core
if ( bRemoveFromStore )
StoredRU -= SetRU*2*(TeamSize-MaxedOut); //Those not maxed out have substracted additional RU from store

}
}
NO_INCREASE:
Expand Down
27 changes: 24 additions & 3 deletions Classes/sgEquipmentSupplier.uc
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,31 @@ function Pawn FindTarget()
return QueuerList.POwner;
}

function Supply(Pawn target)
function sgArmor SpawnArmor( Pawn Other)
{
if ( bProtected && sgPRI(target.PlayerReplicationInfo) != none )
sgPRI( target.PlayerReplicationInfo).bReachedSupplier = True;
local sgArmor theArmor;
local sgPRI PRI;

theArmor = Spawn( class'sgArmor');
if ( theArmor == none )
return None;
theArmor.GiveTo( Other);
theArmor.Charge = 1;
PRI = sgPRI(Other.PlayerReplicationInfo);
if ( PRI != none ) //If you go back to heal, you get lamer points
PRI.sgInfoSpreeCount = Max( 5, PRI.sgInfoSpreeCount+2);
return theArmor;
}

function Supply(Pawn Other)
{
if ( sgPRI(Other.PlayerReplicationInfo) != none )
{
if ( bProtected )
sgPRI( Other.PlayerReplicationInfo).bReachedSupplier = True;
if ( sgPRI( Other.PlayerReplicationInfo).ProtectCount > 0 )
sgPRI( Other.PlayerReplicationInfo).ProtTimer( 0.1);
}
}

simulated event TakeDamage( int damage, Pawn instigatedBy, Vector hitLocation,
Expand Down
12 changes: 3 additions & 9 deletions Classes/sgHealthPod.uc
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,15 @@ function Supply(Pawn target)

inv = target.FindInventoryType(class'sgArmor');
if ( inv == None )
{
inv = Spawn(class'sgArmor', target);
if ( inv != None )
inv.GiveTo(target);
}
if ( inv != None && FRand() < 0.1 + (Grade/15) && inv.Charge < 25 +
Grade*25 )
SpawnArmor(target);
else if ( FRand() < 0.1 + (Grade/15) && inv.Charge < 25 + Grade*25 )
inv.Charge = FMin(inv.Charge + 1, 25 + grade * 25 );

if ( FRand() < 0.3 + (Grade/40) && Target.Health < 60 + (grade*15) )
Target.Health++;

if ( FRand() < 0.2 )
Target.PlaySound(sound'sgMedia.sgStockUp', SLOT_Misc,
Target.SoundDampening*2.5);
Target.PlaySound(sound'sgMedia.sgStockUp', SLOT_Misc, Target.SoundDampening*2.5);
}

defaultproperties
Expand Down
8 changes: 2 additions & 6 deletions Classes/sgHealthPodXXL.uc
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,8 @@ function Supply(Pawn target)

inv = target.FindInventoryType(class'sgArmor');
if ( inv == None )
{
inv = Spawn(class'sgArmor', target);
if ( inv != None )
inv.GiveTo(target);
}
if ( inv != None && inv.Charge < 50 + Grade*20 )
SpawnArmor(Target);
else if ( inv.Charge < 50 + Grade*20 )
{
inv.Charge = FMin(inv.Charge + 1, 50 + grade * 20 );
if ( FRand() < (Grade/7.5) )
Expand Down
21 changes: 14 additions & 7 deletions Classes/sgNukeLauncher.uc
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,22 @@ function float SuggestAttackStyle()

simulated function PlayFiring()
{
local pawn p;

for ( p = Level.PawnList; p != None; p = p.nextPawn )
if ( p.IsA('TournamentPlayer' ) && p.PlayerReplicationInfo.Team !=
Pawn(Owner).PlayerReplicationInfo.Team)
TournamentPlayer(P).ReceiveLocalizedMessage(Class'sgNukeLaunchMsg');

local TournamentPlayer TP;
local PlayerReplicationInfo PRI;

PlayAnim( 'Fire', 0.3 );
PlayOwnedSound(FireSound, SLOT_None,4.0*Pawn(Owner).SoundDampening);

if ( Pawn(Owner) == none )
return;

PRI = Pawn(Owner).PlayerReplicationInfo;
if ( sgPRI(PRI) != none )
sgPRI(PRI).sgInfoSpreeCount = Max( 5, sgPRI(PRI).sgInfoSpreeCount-2);

ForEach AllActors (class'TournamentPlayer', TP)
if ( (TP.PlayerReplicationInfo != none) && (TP.PlayerReplicationInfo.Team != PRI.Team) )
TP.ReceiveLocalizedMessage(Class'sgNukeLaunchMsg');
}

function setHand(float Hand)
Expand Down
57 changes: 23 additions & 34 deletions Classes/sgPRI.uc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ var bool bReplicateRU; //Native c++ only
//Spawn protection
var float ProtectCount;
var Weapon WhosGun;
var int WhosAmmoCount;

var string VisibleMessage; //Always sHistory[0], for external mods
var int VisibleMessageNum;
Expand Down Expand Up @@ -384,12 +383,7 @@ function Tick(float deltaTime)
RU = fMax( RU, 0.f);
if ( ProtectCount > 0 )
{
if ( (ProtectCount -= DeltaTime) <= 0 )
ClearProt();
else
ProtTimer();
}
ProtTimer( DeltaTime);
if ( bIpToCountry )
{
Expand Down Expand Up @@ -419,43 +413,30 @@ function Tick(float deltaTime)

}

function ProtTimer()
function ProtTimer( float DeltaTime)
{
local Pawn P;

P = Pawn(Owner);
if ( sgConstructor(P.Weapon) != none )
return;
if ( WhosGun == None )
WhosGun = P.Weapon;
else if ( P.Weapon != WhosGun ) //Weapon changed
{
ProtectCount -= 2;
WhosGun = P.Weapon;
if ( (WhosGun != none) && (WhosGun.AmmoType != none) )
WhosAmmoCount = P.Weapon.AmmoType.AmmoAmount;
return;
}
if ( P.Weapon != WhosGun ) //Weapon changed
ClearProt();
else if ( WhosGun.AmmoType != none )

ProtectCount -= DeltaTime;
if ( P.bFire + P.bAltFire > 0 ) //Disallow firing from suppliers
ProtectCount -= DeltaTime;

if ( ProtectCount <= 0 )
{
if ( P.Weapon.AmmoType.AmmoAmount < WhosAmmoCount ) //Ammo was fired
ClearProt();
else if ( P.Weapon.AmmoType.AmmoAmount > WhosAmmoCount ) //Ammo was gained
{
WhosAmmoCount = P.Weapon.AmmoType.AmmoAmount;
if ( P.bFire + P.bAltFire > 0 ) //Disallow firing from suppliers
ClearProt();
}
WhosGun = none;
Pawn(Owner).ClientMessage("Siege spawn protection off");
}
}

function ClearProt()
{
WhosGun = none;
WhosAmmoCount = 0;
ProtectCount = 0;
Pawn(Owner).ClientMessage("Siege spawn protection off");
}

static final function string SelElem(string Str, int Elem)
{
local int pos;
Expand All @@ -467,9 +448,17 @@ static final function string SelElem(string Str, int Elem)
return Str;
}

simulated final function float GetEff( optional bool bJustKilled)
simulated final function float GetEff()
{
return float(sgInfoKiller) / fMax(sgInfoKiller + Deaths, 1) * 100;
}

//Used for RU rewards
simulated final function float GetEff2()
{
return float(sgInfoKiller) / Max(sgInfoKiller + Deaths - int(bJustKilled), 1) * 100;
local float f;
f = Max(sgInfoKiller + Deaths - 1, 1); //Max deviation
return Clamp( 100 * sgInfoKiller / f, 50-2*f, 50+2*f);
}

simulated final function float MaxRU()
Expand Down

0 comments on commit 7105526

Please sign in to comment.