12/21 modernizations from TG live (#103)
* sync (#3) * shuttle auto call * Merge /vore into /master (#39) * progress * Compile errors fixed No idea if it's test worthy tho as conflicts with race overhaul and narky removal. * Update admins.txt * efforts continue Fuck grab code, seriously * grab code is cancer * Execute the Narkism Do not hesitate. Show no mercy. * holy shit grab code is awful * have I bitched about grab code My bitching, let me show you it * código de agarre es una mierda No really it is * yeah I don't even know anymore. * Lolnope. Fuck grab code * I'm not even sure what to fix anymore * Self eating is not an acceptable fate * Taste the void, son. * My code doesn't pass it's own sanity check. Maybe it's a sign of things to come. * uncommented and notes * It Works and I Don't Know Why (#38) * shuttle auto call * it works and I don't know why * Subsystem 12/21 Most Recent TG subsystem folder * globalvars 12/21 Tossed out the flavor_misc and parallax files * Onclick 12/21 as well as .dme updates * _defines 12/21 ommited old _MC.dm * _HELPERS 12/21 Preserved snowflake placement of furry sprites * _defeines/genetics reapplied narkism holdover for snowflake races. * Oops forgot mutant colors * modules porting 12/21 + Sounds/icons Admin, Client and most of mob life files ommitted * enviroment file * Admin optimizations ahelp log system kept * Mob ports 12/21 Flavor text preserved * datums ported 12/21 * Game ported 12/21 * batch of duplicate fixes/dogborg work Dogborgs need to be modernized to refractored borg standards. * moar fixes * Maps and futher compile fixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/obj/item/ammo_casing/proc/fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, params, distro, quiet, zone_override = "",spread)
|
||||
/obj/item/ammo_casing/proc/fire_casing(atom/target, mob/living/user, params, distro, quiet, zone_override, spread)
|
||||
distro += variance
|
||||
for (var/i = max(1, pellets), i > 0, i--)
|
||||
var/targloc = get_turf(target)
|
||||
@@ -20,7 +20,7 @@
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
/obj/item/ammo_casing/proc/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
|
||||
/obj/item/ammo_casing/proc/ready_proj(atom/target, mob/living/user, quiet, zone_override)
|
||||
if (!BB)
|
||||
return
|
||||
BB.original = target
|
||||
@@ -39,17 +39,20 @@
|
||||
var/turf/curloc = get_turf(user)
|
||||
if (!istype(targloc) || !istype(curloc) || !BB)
|
||||
return 0
|
||||
BB.ammo_casing = src
|
||||
if(targloc == curloc)
|
||||
if(target) //if the target is right on our location we go straight to bullet_act()
|
||||
target.bullet_act(BB, BB.def_zone)
|
||||
qdel(BB)
|
||||
BB = null
|
||||
return 1
|
||||
|
||||
BB.preparePixelProjectile(target, targloc, user, params, spread)
|
||||
if(BB)
|
||||
BB.fire()
|
||||
var/firing_dir
|
||||
if(BB.firer)
|
||||
firing_dir = BB.firer.dir
|
||||
if(!BB.suppressed && firing_effect_type)
|
||||
PoolOrNew(firing_effect_type, list(get_turf(src), firing_dir))
|
||||
|
||||
var/direct_target
|
||||
if(targloc == curloc)
|
||||
if(target) //if the target is right on our location we'll skip the travelling code in the proj's fire()
|
||||
direct_target = target
|
||||
if(!direct_target)
|
||||
BB.preparePixelProjectile(target, targloc, user, params, spread)
|
||||
BB.fire(null, direct_target)
|
||||
BB = null
|
||||
return 1
|
||||
|
||||
@@ -57,42 +60,3 @@
|
||||
var/dx = abs(target.x - current.x)
|
||||
var/dy = abs(target.y - current.y)
|
||||
return locate(target.x + round(gaussian(0, distro) * (dy+2)/8, 1), target.y + round(gaussian(0, distro) * (dx+2)/8, 1), target.z)
|
||||
|
||||
/obj/item/projectile/proc/preparePixelProjectile(atom/target, var/turf/targloc, mob/living/user, params, spread)
|
||||
var/turf/curloc = get_turf(user)
|
||||
src.loc = get_turf(user)
|
||||
src.starting = get_turf(user)
|
||||
src.current = curloc
|
||||
src.yo = targloc.y - curloc.y
|
||||
src.xo = targloc.x - curloc.x
|
||||
|
||||
if(params)
|
||||
var/list/mouse_control = params2list(params)
|
||||
if(mouse_control["icon-x"])
|
||||
src.p_x = text2num(mouse_control["icon-x"])
|
||||
if(mouse_control["icon-y"])
|
||||
src.p_y = text2num(mouse_control["icon-y"])
|
||||
if(mouse_control["screen-loc"])
|
||||
//Split screen-loc up into X+Pixel_X and Y+Pixel_Y
|
||||
var/list/screen_loc_params = splittext(mouse_control["screen-loc"], ",")
|
||||
|
||||
//Split X+Pixel_X up into list(X, Pixel_X)
|
||||
var/list/screen_loc_X = splittext(screen_loc_params[1],":")
|
||||
|
||||
//Split Y+Pixel_Y up into list(Y, Pixel_Y)
|
||||
var/list/screen_loc_Y = splittext(screen_loc_params[2],":")
|
||||
// world << "X: [screen_loc_X[1]] PixelX: [screen_loc_X[2]] / Y: [screen_loc_Y[1]] PixelY: [screen_loc_Y[2]]"
|
||||
var/x = text2num(screen_loc_X[1]) * 32 + text2num(screen_loc_X[2]) - 32
|
||||
var/y = text2num(screen_loc_Y[1]) * 32 + text2num(screen_loc_Y[2]) - 32
|
||||
|
||||
//Calculate the "resolution" of screen based on client's view and world's icon size. This will work if the user can view more tiles than average.
|
||||
var/screenview = (user.client.view * 2 + 1) * world.icon_size //Refer to http://www.byond.com/docs/ref/info.html#/client/var/view for mad maths
|
||||
|
||||
var/ox = round(screenview/2) //"origin" x
|
||||
var/oy = round(screenview/2) //"origin" y
|
||||
// world << "Pixel position: [x] [y]"
|
||||
var/angle = Atan2(y - oy, x - ox)
|
||||
// world << "Angle: [angle]"
|
||||
src.Angle = angle
|
||||
if(spread)
|
||||
src.Angle += spread
|
||||
Reference in New Issue
Block a user