Charged Shot

slows movement for 100 steps, then releases a quick long range high damage attack

fire4Count=1

function fireD_OnStart(level)
if fire4Count < 1 then
release()
else
setHeadSync(false)
fire_interval=0
uid=createBullet( -131 , getHeading(iSelf()) , 0 , 1 , "fireD1")
addMoverTo(uid,100,0,MOVER_VANISH)
addMoverTo(uid,0,0,MOVER_SETIMMORTALTIME,100)
addMoverTo(uid,0,0,MOVER_SETZOOM,0.2,0.2)
fire4Count=fire4Count-1
end
end
function fireD_OnStep()
fire_interval=fire_interval+1
setSpeed(getSpeed()/5)
if fire_interval==100 then
setHeadSync(true)
release()
end
end
function fireD1_OnStart()
setv(0,0)
setv(1,10)
setv(2,getAngle(iSelf()))
setPower(0)
end
function fireD1_OnStep()
local cnt = getv(0)
setv(0,cnt+1)
setPos( getX(iMaster())+getv(1)*math.cos(math.rad(getv(2))) , getY(iMaster())+getv(1)*math.sin(math.rad(getv(2))) )
if cnt == 90 then
uid=createBullet( -141 , getv(2) , 7, 0, "fireD2")
addMoverTo(uid,0,0,MOVER_SETPOSITION,getX(iSelf()),getY(iSelf()))
addMoverTo(uid,25,0,MOVER_VANISH)
addMoverTo(uid,0,24,MOVER_ADDZOOM,0.2,0)
playSound(25)
end
if math.mod(cnt,12)==0 then
addMover(0,0,MOVER_ADDZOOM,0.08,0.08)
end
end
function fireD1_OnVanish(cause)
fire4Count=fire4Count+1
end
function fireD2_OnStart()
setPower(6.5)
end
function fireD2_OnStep()
end
function fireD2_OnVanish()
end
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.