aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-04-29 22:41:57 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-04-29 22:41:57 +0000
commitb1d09f8dd539e62e61ad794fafc82385e75db982 (patch)
tree5125b6dfd3d739eb8eade5fa5446ad48e0092442
parent46cc6f165091800615c29657993bf37222068f1f (diff)
downloadNorthstarMods-b1d09f8dd539e62e61ad794fafc82385e75db982.tar.gz
NorthstarMods-b1d09f8dd539e62e61ad794fafc82385e75db982.zip
small rating changes to ensure proper functionality and do better debug draw stuff
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut14
1 files changed, 8 insertions, 6 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut
index 3626c075..0d7640ba 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut
@@ -80,7 +80,7 @@ void function RateSpawnpoints_CTF( int checkClass, array<entity> spawnpoints, in
// dividing dist between flags by 3ish gives a good radius for the initial circle
// should this be based on the distance to the frontline? unsure, it probably should be based more on map size than spawn pos anyway
- float initialRatingRad = flagDist / 2.75 / 2
+ float initialRatingRad = flagDist / 3.25 / 2
foreach ( entity spawnpoint in spawnpoints )
{
@@ -90,7 +90,7 @@ void function RateSpawnpoints_CTF( int checkClass, array<entity> spawnpoints, in
float dist = Distance2D( spawnpoint.GetOrigin(), frontline.origin )
if ( dist <= initialRatingRad )
{
- rating = 50 + ( ( 1 - ( dist / initialRatingRad ) ) * 100 )
+ rating = 50 + ( dist / initialRatingRad ) * 100
#if CTF_SPAWN_DEBUG
DebugDrawSphere( spawnpoint.GetOrigin(), 50, 255, 0, 0, false, 30.0, 16 )
#endif
@@ -102,12 +102,14 @@ void function RateSpawnpoints_CTF( int checkClass, array<entity> spawnpoints, in
// if it's <=1/3 of the distance between frontline and spawn, ensure it's within 65deg
// otherwise, just make sure its on the same side of the map
- if ( ( angle <= 65 && angle >= -65 ) || ( angle <= 140 && angle >= -140 && Distance2D( spawnpoint.GetOrigin(), frontline.origin ) <= frontlineDist / 3 ) )
+ float frontlineSpawnDist = Distance2D( spawnpoint.GetOrigin(), frontline.origin )
+
+ if ( ( angle <= 45 && angle >= -45 ) || ( angle <= 110 && angle >= -110 && frontlineSpawnDist <= frontlineDist / 3 ) && frontlineSpawnDist < frontlineDist )
{
- // max out at flagDist
- rating = ( ( 1 - ( Distance2D( spawnpoint.GetOrigin(), ourFlag.GetOrigin() ) / flagDist ) ) * 50 )
+ // max out at flagDist, rate better as we get closer
+ rating = ( ( 1 - ( Distance2D( spawnpoint.GetOrigin(), frontline.origin ) / frontlineDist ) ) * 50 )
#if CTF_SPAWN_DEBUG
- DebugDrawSphere( spawnpoint.GetOrigin(), 50, 255, 200, 0, false, 30.0, 16 )
+ DebugDrawSphere( spawnpoint.GetOrigin(), 50, 255, 200, 255 - int( ( rating / 50 ) * 255 ), false, 30.0, 16 )
#endif
}
}