Name | Type | is_array | initial_value |
Backstab | timer | No | |
Battle_Effect | effect | Yes | |
Battle_Effect_Point | location | Yes | |
Bleeding_Effect_Off | timer | No | |
Bleeding_Effect_On | timer | No | |
Blink | timer | No | |
Circle_Fire_Real | real | Yes | |
Dash_Dodge | timer | No | |
Dummy_Assault | timer | No | |
Instant_Frost | timer | No | |
Integer | integer | No | |
JumpHeight | real | No | |
JumpLocation | location | No | |
JumpSpeed | real | No | |
JumpUnit | unit | No | |
Knockback_Angle | real | No | |
Knockback_Effect | effect | No | |
Knockback_Friction | real | No | |
Knockback_MaxDistance | real | No | |
Knockback_Speed | real | No | |
Knockback_TempDistance | real | No | |
Knockback_Victim | unit | No | |
Masamune_Ultimate | timer | No | |
Move | timer | No | |
Murasame_Knockback | timer | No | |
Murasame_Ultimate | timer | No | |
NextTrigger | timer | No | |
Point | location | Yes | |
Potrait_Effect | timer | No | |
Rapid_Slash | timer | No | |
Slow_Motion | timer | No | |
Slow_Slash | timer | No | |
Special_Effect | effect | Yes | |
TempLocation | location | No | |
TempLocation2 | location | No | |
Tornado_Assault | timer | No | |
Trigger | trigger | No | |
Unit_Group_Remove | group | No |
//TESH.scrollpos=4
//TESH.alwaysfold=0
library Jump
globals
private real smoothness = 0.02 // How smooth the system will run, 0.03 should be fine.
private integer crow = 'Amrf' // The crow form ability, generally not changed.
endglobals
private struct dat
unit u
real z
real s
real x
real y
real startx
real starty
boolean b
static method create takes unit u, real s, real x, real y returns dat
local dat d = dat.allocate()
set d.u = u
set d.s = s
set d.x = x
set d.y = y
set d.b = false
set d.startx = GetUnitX(u)
set d.starty = GetUnitY(u)
return d
endmethod
endstruct
globals
private timer t = CreateTimer()
private integer instances = 0
endglobals
private constant function Parabola takes real d, real h, real x returns real
return ( 4 * h / d ) * ( d - x ) * ( x / d )
endfunction
private function move takes nothing returns nothing
local real x
local real y
local real x1
local real y1
local real dx
local real dy
local real d2
local real dx2
local real dy2
local real p
local real v
local integer i = 1
local dat d = 1
loop
exitwhen i > instances
if d.u != null then
set x1 = GetUnitX(d.u)
set y1 = GetUnitY(d.u)
set dx = d.x - x1
set dy = d.y - y1
set d2 = SquareRoot(dx * dx + dy * dy)
set x = x1 + d.s * dx / d2
set y = y1 + d.s * dy / d2
call SetUnitX(d.u, x)
call SetUnitY(d.u, y)
set dx2 = x - d.x
set dy2 = y - d.y
set p = SquareRoot(dx2 * dx2 + dy2 * dy2)
if p <= 20 then
call PauseUnit(d.u, false)
call SetUnitFlyHeight(d.u, 0, 1000)
call UnitRemoveAbility(d.u, crow)
call SetUnitAnimation(d.u, "stand")
set d.u = null
if i == instances then
set instances = instances - 1
endif
call d.destroy()
set i = i - 1
endif
set dx2 = d.startx - d.x
set dy2 = d.starty - d.y
set v = SquareRoot(dx2 * dx2 + dy2 * dy2)
call SetUnitFlyHeight( d.u, Parabola( v, v * 0.4, p ), 0 )
endif
set i = i + 1
set d = i
endloop
endfunction
function UnitJump takes unit u, real speed, real x, real y returns nothing
local dat d = dat.create(u,speed,x,y)
set instances = instances + 1
call IssueImmediateOrder(u, "stop")
call UnitAddAbility(u, crow)
call SetUnitFlyHeight(u, 1000000, speed*50)
call PauseUnit(u, true)
if instances == 1 then
call TimerStart(t, smoothness, true, function move)
endif
endfunction
function UnitJumpLoc takes unit u, real speed, location l returns nothing
call UnitJump(u, speed, GetLocationX(l), GetLocationY(l))
endfunction
endlibrary