Advertisement
Itchyboy

Arrow Wind/Gravity [Probably Never Going to Complete]

Feb 28th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. xml=''
  2. function dist(x1,y1,x2,y2)
  3. local d=math.sqrt((x2-x1)^2+(y2-y1)^2)
  4. return d/100
  5. end
  6. function eventSummoningEnd(name,id,x,y,angle,vx,vy)
  7. if id==0 then
  8. if angle<90 or angle>270 and angle~=0 then g=(dist(x,y,tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y))
  9. elseif angle>90 or angle<270 and angle~=0 then g=-(dist(x,y,tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y))
  10. elseif angle==0 then g=10*dist(x,y,tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y)
  11. end
  12. if angle>180 then w=math.tan(angle)*(dist(x,y,tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y))
  13. elseif angle<180 and angle>0 then w=-math.tan(angle)*dist(x,y,tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y)
  14. elseif angle==0 or angle==180 then w=0
  15. end
  16. tfm.exec.newGame(xml:gsub('/><Z>','G="'..w..','..g..'" /><Z>'))
  17. end
  18. end
  19. function eventNewGame()
  20. xml=tfm.get.room.xmlMapInfo.xml
  21. end
  22. tfm.exec.newGame('#0')
  23. tfm.exec.setShaman('Itchyboy')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement