aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/_harvester.gnut
blob: e5e60bf243979eb38f56a69e79d05cfb48a2ef98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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)
    SetTeam(harvester,team)
    DispatchSpawn( harvester )
    
    SetGlobalNetEnt("FD_activeHarvester",harvester)
    
    // entity blackbox = CreatePropDynamic(MODEL_HARVESTER_TOWER_COLLISION,info_target.GetOrigin(),info_target.GetAngles(),6)
    // blackbox.Hide()
    // 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
    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
}