Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TSCGameReplicationInfo extends TSCGameReplicationInfoBase;
- var byte OvertimeWaves; // number of Overtime waves
- var byte SudDeathWaves; // number of Sudden Death waves
- var float BaseRadiusSqr; // Base radius squared, set from TSCGameType
- var float MinBaseZ, MaxBaseZ; // min and max Z difference between player and base, set from TSCGameType
- replication
- {
- reliable if ( bNetInitial && Role==ROLE_Authority )
- OvertimeWaves, SudDeathWaves,
- BaseRadiusSqr, MinBaseZ, MaxBaseZ;
- }
- simulated function bool AtBase(Vector CheckLocation, Actor TeamBase)
- {
- local float ZDiff;
- if ( TSCBaseGuardian(TeamBase) == none || !TSCBaseGuardian(TeamBase).bActive )
- return false;
- ZDiff = CheckLocation.Z - TeamBase.Location.Z;
- return ZDiff >= MinBaseZ && ZDiff <= MaxBaseZ
- && VSizeSquared(CheckLocation - TeamBase.Location) < BaseRadiusSqr;
- }
- simulated function bool AtOwnBase(Pawn Player)
- {
- if ( Player.PlayerReplicationInfo == none || Player.PlayerReplicationInfo.Team == none )
- return false;
- return AtBase(Player.Location, Player.PlayerReplicationInfo.Team.HomeBase);
- }
- simulated function bool AtEnemyBase(Pawn Player)
- {
- local int TeamIndex;
- if ( Player.PlayerReplicationInfo == none || Player.PlayerReplicationInfo.Team == none )
- return false;
- TeamIndex = Player.PlayerReplicationInfo.Team.TeamIndex;
- if ( TeamIndex < 0 || TeamIndex > 1 )
- return false;
- return AtBase(Player.Location, Teams[1-TeamIndex].HomeBase);
- }
- defaultproperties
- {
- BaseRadiusSqr=1562500 // 25 m
- MinBaseZ=-60
- MaxBaseZ=200
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement