aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers
diff options
context:
space:
mode:
authorMaya <11448698+RoyalBlue1@users.noreply.github.com>2023-01-02 14:22:54 +0100
committerGitHub <noreply@github.com>2023-01-02 14:22:54 +0100
commit952b4605040de305e38cd32d647c08b8cd63091e (patch)
treef77880798a6f0145ef917d9bb0dcd18a1c77105f /Northstar.CustomServers
parent52de846403d600e5f30c0a50d2c2ea24db2274b9 (diff)
downloadNorthstarMods-952b4605040de305e38cd32d647c08b8cd63091e.tar.gz
NorthstarMods-952b4605040de305e38cd32d647c08b8cd63091e.zip
Add Harvester File (#546)
Moved out of the fd branch because it was needed for fw
Diffstat (limited to 'Northstar.CustomServers')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/_harvester.gnut68
1 files changed, 67 insertions, 1 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_harvester.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_harvester.gnut
index 37b89169..f2776bda 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/_harvester.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/_harvester.gnut
@@ -1 +1,67 @@
-//fuck \ No newline at end of file
+global function SpawnHarvester
+global function generateBeamFX
+global function generateShieldFX
+
+global struct HarvesterStruct {
+ entity harvester
+ entity particleBeam
+ entity particleShield
+ entity rings
+ float lastDamage
+ bool shieldBoost
+
+}
+
+HarvesterStruct function SpawnHarvester( vector origin, vector angles, int health, int shieldHealth, int team )
+{
+ entity harvester = CreateEntity( "prop_script" )
+ harvester.SetValueForModelKey( $"models/props/generator_coop/generator_coop.mdl" )
+ harvester.SetOrigin( origin )
+ harvester.SetAngles( angles )
+ harvester.kv.solid = SOLID_VPHYSICS
+
+ harvester.SetMaxHealth( health )
+ harvester.SetHealth( health )
+ harvester.SetShieldHealthMax( shieldHealth )
+ harvester.SetShieldHealth( shieldHealth )
+ harvester.EnableAttackableByAI( 30, 0, AI_AP_FLAG_NONE )
+ SetObjectCanBeMeleed( harvester, false )
+ SetTeam(harvester,team)
+
+ DispatchSpawn( harvester )
+
+
+ entity blackbox = CreatePropDynamic( MODEL_HARVESTER_TOWER_COLLISION, origin, angles, 0 )
+ blackbox.Hide()
+ blackbox.Solid()
+ // blackbox.kv.CollisionGroup = TRACE_COLLISION_GROUP_PLAYER
+
+ entity rings = CreatePropDynamic( MODEL_HARVESTER_TOWER_RINGS, origin, angles, 6 )
+ thread PlayAnim( rings, "generator_cycle_fast" )
+
+
+
+ HarvesterStruct ret
+ ret.harvester = harvester
+ ret.lastDamage = Time()
+ ret.rings = rings
+
+ return ret
+}
+
+HarvesterStruct function generateBeamFX( HarvesterStruct harvester )
+{
+ entity Harvester_Beam = StartParticleEffectOnEntity_ReturnEntity( harvester.harvester, GetParticleSystemIndex( FX_HARVESTER_BEAM ), FX_PATTACH_ABSORIGIN_FOLLOW ,0 )
+ EffectSetControlPointVector( Harvester_Beam, 1, GetShieldTriLerpColor( 0.0 ) )
+ harvester.particleBeam = Harvester_Beam
+ Harvester_Beam.DisableHibernation()
+ return harvester
+}
+
+HarvesterStruct function generateShieldFX( HarvesterStruct harvester )
+{
+ entity Harvester_Shield = StartParticleEffectOnEntity_ReturnEntity( harvester.harvester, GetParticleSystemIndex( FX_HARVESTER_OVERSHIELD ), FX_PATTACH_ABSORIGIN_FOLLOW, 0 )
+ EffectSetControlPointVector( Harvester_Shield, 1, GetShieldTriLerpColor( 0.0 ) )
+ harvester.particleShield = Harvester_Shield
+ return harvester
+} \ No newline at end of file