Timestop Spell Port and Sepia Slimes

This commit is contained in:
Fox-McCloud
2016-01-06 03:30:08 -05:00
parent 14ac5f25f3
commit ebdd9d3897
8 changed files with 198 additions and 75 deletions
+77 -74
View File
@@ -31,6 +31,7 @@
var/atom/original = null // the original target clicked
var/turf/starting = null // the projectile's starting turf
var/list/permutated = list() // we've passed through these atoms, don't try to hit them again
var/paused = FALSE //for suspending the projectile midair
var/p_x = 16
var/p_y = 16 // the pixel location of the tile that the player clicked. Default is the center
@@ -202,73 +203,74 @@
if(kill_count < 1)
del(src)
return
kill_count--
if((!( current ) || loc == current))
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
if(!paused)
kill_count--
if((!( current ) || loc == current))
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
if(!Angle)
Angle=round(Get_Angle(src,current))
//world << "[Angle] angle"
//overlays.Cut()
//var/icon/I=new(initial(icon),icon_state) //using initial(icon) makes sure that the angle for that is reset as well
//I.Turn(Angle)
//I.DrawBox(rgb(255,0,0,50),1,1,32,32)
//icon = I
if(spread) //Chaotic spread
Angle += (rand() - 0.5) * spread
var/matrix/M = new//matrix(transform)
M.Turn(Angle)
transform = M
if(!Angle)
Angle=round(Get_Angle(src,current))
//world << "[Angle] angle"
//overlays.Cut()
//var/icon/I=new(initial(icon),icon_state) //using initial(icon) makes sure that the angle for that is reset as well
//I.Turn(Angle)
//I.DrawBox(rgb(255,0,0,50),1,1,32,32)
//icon = I
if(spread) //Chaotic spread
Angle += (rand() - 0.5) * spread
var/matrix/M = new//matrix(transform)
M.Turn(Angle)
transform = M
var/Pixel_x=round(sin(Angle)+16*sin(Angle)*2)
var/Pixel_y=round(cos(Angle)+16*cos(Angle)*2)
var/pixel_x_offset = pixel_x + Pixel_x
var/pixel_y_offset = pixel_y + Pixel_y
var/new_x = x
var/new_y = y
//Not sure if using whiles for this is good
while(pixel_x_offset > 16)
//world << "Pre-adjust coords (x++): xy [pixel_x] xy offset [pixel_x_offset]"
pixel_x_offset -= 32
pixel_x -= 32
new_x++// x++
while(pixel_x_offset < -16)
//world << "Pre-adjust coords (x--): xy [pixel_x] xy offset [pixel_x_offset]"
pixel_x_offset += 32
pixel_x += 32
new_x--
var/Pixel_x=round(sin(Angle)+16*sin(Angle)*2)
var/Pixel_y=round(cos(Angle)+16*cos(Angle)*2)
var/pixel_x_offset = pixel_x + Pixel_x
var/pixel_y_offset = pixel_y + Pixel_y
var/new_x = x
var/new_y = y
//Not sure if using whiles for this is good
while(pixel_x_offset > 16)
//world << "Pre-adjust coords (x++): xy [pixel_x] xy offset [pixel_x_offset]"
pixel_x_offset -= 32
pixel_x -= 32
new_x++// x++
while(pixel_x_offset < -16)
//world << "Pre-adjust coords (x--): xy [pixel_x] xy offset [pixel_x_offset]"
pixel_x_offset += 32
pixel_x += 32
new_x--
while(pixel_y_offset > 16)
//world << "Pre-adjust coords (y++): py [pixel_y] py offset [pixel_y_offset]"
pixel_y_offset -= 32
pixel_y -= 32
new_y++
while(pixel_y_offset < -16)
//world << "Pre-adjust coords (y--): py [pixel_y] py offset [pixel_y_offset]"
pixel_y_offset += 32
pixel_y += 32
new_y--
while(pixel_y_offset > 16)
//world << "Pre-adjust coords (y++): py [pixel_y] py offset [pixel_y_offset]"
pixel_y_offset -= 32
pixel_y -= 32
new_y++
while(pixel_y_offset < -16)
//world << "Pre-adjust coords (y--): py [pixel_y] py offset [pixel_y_offset]"
pixel_y_offset += 32
pixel_y += 32
new_y--
speed = round(speed) //Just in case.
step_towards(src, locate(new_x, new_y, z)) //Original projectiles stepped towards 'current'
if(speed <= 1) //We should really only animate at speed 2
pixel_x = pixel_x_offset
pixel_y = pixel_y_offset
else
animate(src, pixel_x = pixel_x_offset, pixel_y = pixel_y_offset, time = max(1, (speed <= 3 ? speed - 1 : speed)))
speed = round(speed) //Just in case.
step_towards(src, locate(new_x, new_y, z)) //Original projectiles stepped towards 'current'
if(speed <= 1) //We should really only animate at speed 2
pixel_x = pixel_x_offset
pixel_y = pixel_y_offset
else
animate(src, pixel_x = pixel_x_offset, pixel_y = pixel_y_offset, time = max(1, (speed <= 3 ? speed - 1 : speed)))
/*
var/turf/T = get_turf(src)
if(T)
T.color = "#6666FF"
spawn(10)
T.color = initial(T.color)
*/
/*
var/turf/T = get_turf(src)
if(T)
T.color = "#6666FF"
spawn(10)
T.color = initial(T.color)
*/
if(!bumped && ((original && original.layer>=2.75) || ismob(original)))
if(loc == get_turf(original))
if(!(original in permutated))
Bump(original)
if(!bumped && ((original && original.layer>=2.75) || ismob(original)))
if(loc == get_turf(original))
if(!(original in permutated))
Bump(original)
Range()
sleep(max(1, speed))
else
@@ -277,19 +279,20 @@
if(kill_count < 1)
del(src)
return
kill_count--
if((!( current ) || loc == current))
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
if(!Angle)
Angle=round(Get_Angle(src,current))
var/matrix/M = new//matrix(transform)
M.Turn(Angle)
transform = M //So there's no need to give icons directions again
step_towards(src, current)
if(!bumped && ((original && original.layer>=2.75) || ismob(original)))
if(loc == get_turf(original))
if(!(original in permutated))
Bump(original)
if(!paused)
kill_count--
if((!( current ) || loc == current))
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
if(!Angle)
Angle=round(Get_Angle(src,current))
var/matrix/M = new//matrix(transform)
M.Turn(Angle)
transform = M //So there's no need to give icons directions again
step_towards(src, current)
if(!bumped && ((original && original.layer>=2.75) || ismob(original)))
if(loc == get_turf(original))
if(!(original in permutated))
Bump(original)
Range()
sleep(1)