Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ENT.Type = "anim"
- ENT.Base = "brts_base_unit"
- ENT.PrintName = "Artillery"
- ENT.Purpose = ""
- ENT.Instructions = ""
- --important
- ENT.UnitType = "TURRET"
- ENT.RepairTypes = {"ALL"}
- ENT.BuildTypes = {"ALL"}
- ENT.AttackTypes = {"ALL"}
- ENT.Model = "models/Roller_Spikes.mdl"
- ENT.LockAngles = true --doesnt propably work yet
- ENT.HealthAmount = 400
- ENT.RegenRate = 2
- ENT.MoveSpeed = 0
- ENT.SelfBuildRate = 0
- ENT.BuildRate = 0
- ENT.BuildDrain = ENT.BuildRate
- ENT.RegenDrain = ENT.RegenRate
- ENT.SelfBuildDrain = ENT.SelfBuildRate
- ENT.ResourceStorage = 0
- ENT.ResourceBalance = 0
- ENT.LoopSound = "npc/scanner/combat_scan_loop2.wav"
- ENT.LoopSoundVolume = 155
- ENT.LoopSoundPitch = 50
- ENT.SpotRange = 256
- ENT.ShootRadius = 1024 --this is distance from boundarybox
- ENT.ShootDelay = 9
- ENT.ShootAccuracy = 100 --how precise shots are 1-100
- ENT.ChaseDistance = ENT.ShootRadius*1.3 --this is distance from boundarybox
- ENT.AllowChase = true
- ENT.BulletNumber = 3 --for multiple shots like shotgun does
- ENT.BulletSpread = 0.01 --basic spread of shots
- ENT.BulletForce = 100
- ENT.BulletDamage = 180
- ENT.BulletEffect = "ToolTracer"
- ENT.BulletSound = "weapons/smg1/smg1_fire1.wav"
- ENT.BulletSoundVolume = 100
- ENT.BulletSoundPitch = 100
- ENT.MovingUnit = false
- ENT.AttackingUnit = true
- ENT.EngineeringUnit = false
- ENT.HoveringUnit = true
- function ENT:BulletShootAction(tr,dmginfo,hitpos)
- end
- function ENT:BulletHitUnit(tr,dmginfo,hitpos)
- end
- function ENT:OrderThink(currentorder)
- end
- function ENT:ShootOverride(enemy)
- local pitch = 60
- local gravity = GRAVITY or 700
- local entpos = self:GetPos()
- local tgtpos = enemy:GetPos()
- local differ0 = tgtpos-entpos
- local differ = differ0+self:Variation(differ0:Length())
- local verticaldiffer = Vector(0,0,differ.z)
- local horisontaldiffer = Vector(differ.x,differ.y,0)
- local RANGE = horisontaldiffer:Length()
- local HEIGHT = verticaldiffer:Length()
- local VECTOR0 = horisontaldiffer:Normalize()
- local VECTOR = (VECTOR0*math.cos(pitch)+Vector(0,0,1)*math.sin(pitch)):Normalize()
- --VECTOR:Rotate(Angle(0,pitch,0))
- --local ANGLE = VECTOR:Angle()
- local ent = ents.Create("shell")
- ent:SetModel("models/dav0r/hoverball.mdl")
- ent:Spawn()
- ent.Radius = self.BulletDamage*2
- ent.Damage = self.BulletDamage
- --print(VECTOR)
- local fix = Vector(0,0,1)*(self:BoundingRadius()+ent:BoundingRadius())
- ent:SetPos(entpos+fix)
- local velocity = math.sqrt(-gravity*RANGE*RANGE/(2*(HEIGHT-math.tan(pitch)*RANGE)*math.cos(pitch)*math.cos(pitch)))
- local entphys = ent:GetPhysicsObject();
- if entphys:IsValid() then
- entphys:Wake();
- entphys:SetVelocity(VECTOR*velocity*-1)
- end
- return true --return true to override
- end
- function ENT:PatrollingFriendlyUnit(friend)
- return true -- returning false will stop unit from chasing enemies closeby
- end
- ENT.HitEffect = "explosion"
- ENT.HitEffectScale = ENT.BulletDamage
- --[[FUNCTIONS:
- CleanUnit(ENT) --basically removes owner by making unit neutral and resets other control things from unit
- SetEntOwner(ENT,UserID) --change units owner
- ENT:GetPhysicsObject():EnableGravity(true) --this is fun, looks like unit is paralyzed :3
- VARIABLES:
- ENT.OwnerID == UserID of owner, think of this as a team
- HITEFFECTS:
- explosion
- implosion
- select
- TRACERS: --not sure if these even work :p
- AirboatGunHeavyTracer
- AirboatGunTracer
- AR2Tracer
- GaussTracer
- GunshipTracer
- StriderTracer
- HelicopterTracer
- ToolTracer
- LaserTracer
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement