Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local base = piece 'base'
- local hull = piece 'hull'
- local emit_gun1 = piece 'emit_gun1'
- local emit_gun2 = piece 'emit_gun2'
- local emit_thrust1 = piece 'emit_thrust1'
- local emit_thrust2 = piece 'emit_thrust2'
- local gun
- local moving
- local GUNFLARE = 1024+0
- local EXPLOSION = 1025+0
- local SIG_AIM1 = 2
- local function SmokeUnit()
- while true do
- health = select(1, Spring.GetUnitHealth(unitID) ) / select(2, Spring.GetUnitHealth(unitID) )
- if health < 25 then
- EmitSfx( hull, SFXTYPE_BLACKSMOKE )
- end
- Sleep(1500)
- end
- end
- ------------------------ ACTIVATION
- function script.Create()
- gun = 1
- moving = false
- StartThread(SmokeUnit)
- end
- function script.Activate()
- moving = true
- end
- function script.StopMoving()
- moving = false
- end
- --weapon 1 -----------------------------------------------------------------
- function script.QueryWeapon1(piecenum)
- if gun <= 0 then
- piecenum = emit_gun1
- else
- piecenum = emit_gun2
- end
- endd
- function script.AimFromWeapon1 ()
- return hull end
- function script.AimWeapon1(heading, pitch)
- Signal(SIG_AIM1)
- SetSignalMask(SIG_AIM1)
- return true
- end
- function script.FireWeapon1()
- if gun>(-1) then
- EmitSfx( emit_groundflash_r, GROUNDFLASH )
- else
- EmitSfx( emit_groundflash_l, GROUNDFLASH )
- end
- gun = gun*(-1)
- return(1)
- end
- --------------------------------------------
- function script.Killed(recentDamage, maxHealth)
- return(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement