diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-08-31 23:14:58 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-08-31 23:14:58 +0100 |
commit | 9a96d0bff56f1969c68bb52a2f33296095bdc67d (patch) | |
tree | 4175928e488632705692e3cccafa1a38dd854615 /Northstar.CustomServers/scripts/vscripts/gamemodes/_riff_floor_is_lava.nut | |
parent | 27bd240871b7c0f2f49fef137718b2e3c208e3b4 (diff) | |
download | NorthstarMods-9a96d0bff56f1969c68bb52a2f33296095bdc67d.tar.gz NorthstarMods-9a96d0bff56f1969c68bb52a2f33296095bdc67d.zip |
move to new mod format
Diffstat (limited to 'Northstar.CustomServers/scripts/vscripts/gamemodes/_riff_floor_is_lava.nut')
-rw-r--r-- | Northstar.CustomServers/scripts/vscripts/gamemodes/_riff_floor_is_lava.nut | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/Northstar.CustomServers/scripts/vscripts/gamemodes/_riff_floor_is_lava.nut b/Northstar.CustomServers/scripts/vscripts/gamemodes/_riff_floor_is_lava.nut deleted file mode 100644 index b660e89ff..000000000 --- a/Northstar.CustomServers/scripts/vscripts/gamemodes/_riff_floor_is_lava.nut +++ /dev/null @@ -1,102 +0,0 @@ -global function RiffFloorIsLava_Init - -void function RiffFloorIsLava_Init() -{ - AddCallback_OnPlayerRespawned( FloorIsLava_PlayerRespawned ) - - AddSpawnCallback( "env_fog_controller", InitLavaFogController ) - AddCallback_EntitiesDidLoad( CreateCustomSpawns ) -} - -void function InitLavaFogController( entity fogController ) -{ - fogController.kv.fogztop = GetVisibleFogTop() - fogController.kv.fogzbottom = GetVisibleFogBottom() - fogController.kv.foghalfdisttop = "60000" - fogController.kv.foghalfdistbottom = "200" - fogController.kv.fogdistoffset = "0" - fogController.kv.fogdensity = ".85" - - fogController.kv.forceontosky = true - //fogController.kv.foghalfdisttop = "10000" -} - -void function CreateCustomSpawns() -{ - thread CreateCustomSpawns_Threaded() -} - -void function CreateCustomSpawns_Threaded() -{ - WaitEndFrame() // wait for spawns to clear - - float raycastTop = GetLethalFogTop() + 2500.0 - array< vector > raycastPositions - foreach ( entity hardpoint in GetEntArrayByClass_Expensive( "info_hardpoint" ) ) - { - if ( !hardpoint.HasKey( "hardpointGroup" ) ) - continue - - //if ( hardpoint.kv.hardpointGroup != "A" && hardpoint.kv.hardpointGroup != "B" && hardpoint.kv.hardpointGroup != "C" ) - if ( hardpoint.kv.hardpointGroup != "B" ) // roughly map center - continue - - vector pos = hardpoint.GetOrigin() - for ( int x = -2000; x < 2000; x += 200 ) - for ( int y = -2000; y < 2000; y += 200 ) - raycastPositions.append( < x, y, raycastTop > ) - } - - int validSpawnsCreated = 0 - foreach ( vector raycastPos in raycastPositions ) - { - //vector hardpoint = validHardpoints[ RandomInt( validHardpoints.len() ) ].GetOrigin() - //float a = RandomFloat( 1 ) * 2 * PI - //float r = 1000.0 * sqrt( RandomFloat( 1 ) ) - // - //vector castStart = < hardpoint.x + r * cos( a ), hardpoint.y + r * sin( a ), > - //vector castEnd = < hardpoint.x + r * cos( a ), hardpoint.y + r * sin( a ), GetLethalFogBottom() > - - TraceResults trace = TraceLine( raycastPos, < raycastPos.x, raycastPos.y, GetLethalFogBottom() >, [], TRACE_MASK_SOLID, TRACE_COLLISION_GROUP_NONE ) // should only hit world - print( "raycast: " + trace.endPos ) - if ( trace.endPos.z >= GetLethalFogTop() ) - { - print( "creating floor is lava spawn at " + trace.endPos ) - validSpawnsCreated++ - - // valid spot, create a spawn - entity spawnpoint = CreateEntity( "info_spawnpoint_human" ) - spawnpoint.SetOrigin( trace.endPos ) - spawnpoint.kv.ignoreGamemode = 1 - DispatchSpawn( spawnpoint ) - } - } -} - -void function FloorIsLava_PlayerRespawned( entity player ) -{ - thread FloorIsLava_ThinkForPlayer( player ) -} - -void function FloorIsLava_ThinkForPlayer( entity player ) -{ - player.EndSignal( "OnDestroy" ) - player.EndSignal( "OnDeath" ) - - while ( true ) - { - WaitFrame() - - if ( player.GetOrigin().z < GetLethalFogTop() ) - { - // do damage - float damageMultiplier = 0.08 - if ( player.IsTitan() ) - damageMultiplier *= 0.05 - - player.TakeDamage( player.GetMaxHealth() * damageMultiplier, null, null, { damageSourceId = eDamageSourceId.floor_is_lava } ) - - wait 0.1 - } - } -}
\ No newline at end of file |