Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --PLEASE DO NOT COMMENT ABOUT EFFICIENCY UNLESS THERE'S SOMETHING THAT'LL LAG PLAYERS TO THE POINT OF UNPLAYABILITY!
- project=doublearray(32,4096,0)
- curproject=initArray2(32,1)
- projectpos=doublearray(32,4096,{0,0})
- function projectileShoot(id,proj,rot,w)
- project[curproject[id]]=image(proj,player(id,"x"),player(id,"y"),3)
- projectpos[id][curproject[id]][1]=player(id,"x")
- projectpos[id][curproject[id]][2]=player(id,"y")
- imagepos(project[curproject[id]],projectpos[id][curproject[id]][1],projectpos[id][curproject[id]][2],rot)
- local prid=curproject[id]
- projectileFly(id,proj,rot,w,prid)
- curproject[id]=curproject[id]+1
- end
- function projectileFly(id,proj,rot,w,prid)
- local dx,dy=csconvert(rot,projectpos[id][prid][1],projectpos[id][prid][2],equipment[w].projspeed)
- imagepos(project[prid],dx,dy,rot)
- projectpos[id][prid][1],projectpos[id][prid][2]=dx,dy
- msg("In flight")
- for pid=1,32 do
- if (player(pid,"exists") and pid~=id) then
- if (math.floor(dx/32)~=player(pid,"tilex") and math.floor(dy/32)~=player(pid,"tiley") and tile(math.floor(dx/32),math.floor(dy/32),"frame")==0) then
- timer(1,"parse","lua projectileFly("..id..",".."\""..proj.."\","..rot..","..w..","..prid..")")
- msg("In flight timer")
- else
- if (shield[pid]>=equipment[w].projsdmg) then
- shield[pid]=shield[pid]-equipment[w].projsdmg
- else
- parse("sethealth "..pid.." "..player(pid,"health")-equipment[w].projhdmg)
- end
- msg("Found target")
- end
- msg("LOLWUT")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement