Fixes dogborg offsets and gun layering (#5668)

* Fixes dogborg offsets.

* Fixes Dogborg laser overlays

* comment fix.
This commit is contained in:
Poojawa
2018-02-22 23:48:24 -06:00
committed by GitHub
parent dab8c061d9
commit 743b1239bb
3 changed files with 32 additions and 7 deletions
+9 -6
View File
@@ -530,8 +530,8 @@
/atom/movable/proc/relay_container_resist(mob/living/user, obj/O)
return
/atom/movable/proc/do_attack_animation(atom/A, visual_effect_icon, obj/item/used_item, no_effect, end_pixel_y)
// CITADEL CHANGE - adds final_pixel_y and final_pixel_x to do_attack_animation args
/atom/movable/proc/do_attack_animation(atom/A, visual_effect_icon, obj/item/used_item, no_effect, end_pixel_y, final_pixel_y, final_pixel_x)
if(!no_effect && (visual_effect_icon || used_item))
do_item_attack_animation(A, visual_effect_icon, used_item)
@@ -539,9 +539,11 @@
return //don't do an animation if attacking self
var/pixel_x_diff = 0
var/pixel_y_diff = 0
var/final_pixel_y = initial(pixel_y)
if(end_pixel_y)
final_pixel_y = end_pixel_y
if(!final_pixel_y)// CITADEL CHANGE DOGBORG OFFSET
final_pixel_y = initial(pixel_y)
if(!final_pixel_x)
final_pixel_x = initial(pixel_x) //lol copypasta
var/direction = get_dir(src, A)
if(direction & NORTH)
@@ -555,7 +557,8 @@
pixel_x_diff = -8
animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff, time = 2)
animate(pixel_x = initial(pixel_x), pixel_y = final_pixel_y, time = 2)
//animate(pixel_x = initial(pixel_x), pixel_y = final_pixel_y, time = 2) //CITADEL CHANGE, DOGBORG OFFSET
animate(pixel_x = pixel_x - pixel_x_diff, pixel_y = final_pixel_y, time = 2)
/atom/movable/proc/do_item_attack_animation(atom/A, visual_effect_icon, obj/item/used_item)
var/image/I
@@ -18,6 +18,20 @@
else if(istype(O, /obj/item/storage/bag/tray/))
var/obj/item/storage/bag/tray/T = O
T.do_quick_empty()
//CITADEL EDIT reee proc, Dogborg modules
if(istype(O,/obj/item/gun/energy/laser/cyborg))
laser = FALSE
update_icons()
else if(istype(O,/obj/item/gun/energy/disabler/cyborg))
disabler = FALSE
update_icons() //PUT THE GUN AWAY
else if(istype(O,/obj/item/device/dogborg/sleeper))
sleeper_g = FALSE
sleeper_r = FALSE
update_icons()
var/obj/item/device/dogborg/sleeper/S = O
S.go_out() //this should stop edgecase deletions
//END CITADEL EDIT
if(client)
client.screen -= O
observer_screen_update(O,FALSE)
@@ -46,6 +60,14 @@
. = FALSE
if(!(O in module.modules))
return
//CITADEL EDIT Dogborg lasers
if(istype(O,/obj/item/gun/energy/laser/cyborg))
laser = TRUE
update_icons() //REEEEEEACH FOR THE SKY
if(istype(O,/obj/item/gun/energy/disabler/cyborg))
disabler = TRUE
update_icons()
//END CITADEL EDIT
if(activated(O))
to_chat(src, "<span class='warning'>That module is already activated.</span>")
return
@@ -594,7 +594,7 @@
icon = (module.cyborg_icon_override ? module.cyborg_icon_override : initial(icon))
if(laser)
add_overlay("laser")//Is this even used???
add_overlay("module.laser")//Is this even used??? - Yes modular_citadel/borg/inventory.dm
if(disabler)
add_overlay("disabler")//ditto