diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-04-27 15:13:50 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-04-27 15:13:50 +0000 |
commit | 112fd2142d3b50c7baeb028d216046859af9fa18 (patch) | |
tree | 5b16164ee856dccb062da5a7342951a449499877 | |
parent | 023141f20381f4aa9aaa4f572e61141e56f7323e (diff) | |
download | NorthstarMods-112fd2142d3b50c7baeb028d216046859af9fa18.tar.gz NorthstarMods-112fd2142d3b50c7baeb028d216046859af9fa18.zip |
more dodgy maths
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut index f72573d6..8fdf6d9c 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut @@ -76,6 +76,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 angleBetweenFlags = atan2( ourFlag.GetOrigin().y - theirFlag.GetOrigin().y, ourFlag.GetOrigin().x - theirFlag.GetOrigin().y ) * ( 180 / PI ) foreach ( entity spawnpoint in spawnpoints ) { @@ -90,12 +91,11 @@ void function RateSpawnpoints_CTF( int checkClass, array<entity> spawnpoints, in // determine the angles of the lines we need to be within to be rated here // magic number gives roughly ~8deg from right mid to base on glitch float ratingAnglePos = flagDist * 0.0026 - float ratingAngleNeg = flagDist * -0.0026 - ratingAngleNeg = ( ( ( ratingAngleNeg % 360 ) + 360 ) % 360 ) // this is probably shit i just copied a negative modulo func + float ratingAngleNeg = -ratingAnglePos // calc angle between our spawnpoint and frontline, check if it's within the previous 2 angles - float angle = atan2( spawnpoint.GetOrigin().y - frontline.origin.y, spawnpoint.GetOrigin().x - frontline.origin.x ) * ( 180 / PI ) - if ( angle <= ratingAnglePos && angle <= ratingAngleNeg ) + float angle = ( atan2( spawnpoint.GetOrigin().y - frontline.origin.y, spawnpoint.GetOrigin().x - frontline.origin.x ) * ( 180 / PI ) ) - angleBetweenFlags + if ( angle <= ratingAnglePos && angle >= ratingAngleNeg ) // max out at flagDist rating = ( ( 1 - ( dist / flagDist ) ) * 50 ) } |