makes beams better (plus small kinesis tweaks) (#71768)

## About The Pull Request
kinesis now waits for its first inputs to be given before firing, it
should no longer pull the item to the center of the screen
the kinesis overlay now is emissive
beam emissivity now works (emissive appearances no longer reset
transform)
beams now have a variable whether or not they should be emissive,
because of stuff like vines or chains from the meat hook
fixes https://github.com/tgstation/tgstation/issues/71640

## Why It's Good For The Game
neat visual stuff

## Changelog
🆑
fix: fixes beam glow in the dark effects
fix: kinesis now doesnt pull the item to the centre of the screen when
first used
fix: physical beams (like vines or meat hook chain) no longer glow in
the dark
/🆑
This commit is contained in:
Fikou
2022-12-09 21:58:58 +01:00
committed by GitHub
parent a9bd23d337
commit f9445e027f
7 changed files with 27 additions and 20 deletions
+9 -9
View File
@@ -66,8 +66,9 @@
var/mob/living/grabbed_mob = grabbed_atom
grabbed_mob.Stun(mob_stun_time)
playsound(grabbed_atom, 'sound/effects/contractorbatonhit.ogg', 75, TRUE)
kinesis_icon = mutable_appearance(icon='icons/effects/effects.dmi', icon_state="kinesis", layer=grabbed_atom.layer-0.1)
kinesis_icon = mutable_appearance(icon = 'icons/effects/effects.dmi', icon_state = "kinesis", layer = grabbed_atom.layer - 0.1)
kinesis_icon.appearance_flags = RESET_ALPHA|RESET_COLOR|RESET_TRANSFORM
kinesis_icon.overlays += emissive_appearance(icon = 'icons/effects/effects.dmi', icon_state = "kinesis", offset_spokesman = grabbed_atom)
grabbed_atom.add_overlay(kinesis_icon)
kinesis_beam = mod.wearer.Beam(grabbed_atom, "kinesis")
kinesis_catcher = mod.wearer.overlay_fullscreen("kinesis", /atom/movable/screen/fullscreen/kinesis, 0)
@@ -93,13 +94,12 @@
balloon_alert(mod.wearer, "out of range!")
clear_grab()
return
kinesis_catcher.calculate_params()
if(!kinesis_catcher.given_turf)
clear_grab()
return
drain_power(use_power_cost/10)
if(kinesis_catcher.mouse_params)
kinesis_catcher.calculate_params()
if(!kinesis_catcher.given_turf)
return
mod.wearer.setDir(get_dir(mod.wearer, grabbed_atom))
grabbed_atom.set_glide_size()
if(grabbed_atom.loc == kinesis_catcher.given_turf)
if(grabbed_atom.pixel_x == kinesis_catcher.given_x - world.icon_size/2 && grabbed_atom.pixel_y == kinesis_catcher.given_y - world.icon_size/2)
return //spare us redrawing if we are standing still
@@ -109,7 +109,7 @@
animate(grabbed_atom, 0.2 SECONDS, pixel_x = grabbed_atom.base_pixel_x + kinesis_catcher.given_x - world.icon_size/2, pixel_y = grabbed_atom.base_pixel_y + kinesis_catcher.given_y - world.icon_size/2)
kinesis_beam.redrawing()
var/turf/next_turf = get_step_towards(grabbed_atom, kinesis_catcher.given_turf)
if(grabbed_atom.Move(next_turf))
if(grabbed_atom.Move(next_turf, get_dir(grabbed_atom, next_turf), 8))
if(isitem(grabbed_atom) && (mod.wearer in next_turf))
var/obj/item/grabbed_item = grabbed_atom
clear_grab()
@@ -265,8 +265,8 @@
/atom/movable/screen/fullscreen/kinesis/proc/calculate_params()
var/list/modifiers = params2list(mouse_params)
var/icon_x = text2num(LAZYACCESS(modifiers, VIS_X)) || view_list[1]*world.icon_size/2
var/icon_y = text2num(LAZYACCESS(modifiers, VIS_Y)) || view_list[2]*world.icon_size/2
var/icon_x = text2num(LAZYACCESS(modifiers, VIS_X))
var/icon_y = text2num(LAZYACCESS(modifiers, VIS_Y))
var/our_x = round(icon_x / world.icon_size)
var/our_y = round(icon_y / world.icon_size)
given_turf = locate(kinesis_user.x+our_x-round(view_list[1]/2),kinesis_user.y+our_y-round(view_list[2]/2),kinesis_user.z)
@@ -126,7 +126,7 @@
/obj/projectile/tether/fire(setAngle)
if(firer)
line = firer.Beam(src, "line", 'icons/obj/clothing/modsuit/mod_modules.dmi')
line = firer.Beam(src, "line", 'icons/obj/clothing/modsuit/mod_modules.dmi', emissive = FALSE)
..()
/obj/projectile/tether/on_hit(atom/target)