Files
fulpstation/code/__HELPERS/unused.dm
kevinz000 ca10fa6d7a Spell Cards (#36147)
Adds spell cards. They're a wizard spell that shoots a burst of 5 semi-accurate homing cards.
Projectiles now have a homing framework, complete with some variant of simulated inaccuracy.
The said wizard spell will make use of a new mob component, that allows that mob to select targets by moving their cursor near them. It will give a visual and lock onto the nearest mob to the cursor, allowing the homing projectiles to target on the locked on mob/object.
Removes colliding variable from projectiles - We never used it after Bump was refactored to Collide.
Images soon when I get the lockon datum-components to work.
2018-03-23 09:39:26 +13:00

40 lines
1.0 KiB
Plaintext

/datum/projectile_data
var/src_x
var/src_y
var/time
var/distance
var/power_x
var/power_y
var/dest_x
var/dest_y
/datum/projectile_data/New(var/src_x, var/src_y, var/time, var/distance, \
var/power_x, var/power_y, var/dest_x, var/dest_y)
src.src_x = src_x
src.src_y = src_y
src.time = time
src.distance = distance
src.power_x = power_x
src.power_y = power_y
src.dest_x = dest_x
src.dest_y = dest_y
/proc/projectile_trajectory(src_x, src_y, rotation, angle, power)
// returns the destination (Vx,y) that a projectile shot at [src_x], [src_y], with an angle of [angle],
// rotated at [rotation] and with the power of [power]
// Thanks to VistaPOWA for this function
var/power_x = power * cos(angle)
var/power_y = power * sin(angle)
var/time = 2* power_y / 10 //10 = g
var/distance = time * power_x
var/dest_x = src_x + distance*sin(rotation);
var/dest_y = src_y + distance*cos(rotation);
return new /datum/projectile_data(src_x, src_y, time, distance, power_x, power_y, dest_x, dest_y)