Merge pull request #24342 from ChangelingRain/researchscanfix

You can now have multiple research scanners active at a time
This commit is contained in:
oranges
2017-02-24 09:44:53 +13:00
committed by GitHub
+10 -12
View File
@@ -330,32 +330,30 @@
/datum/action/item_action/hands_free/activate
name = "Activate"
/datum/action/item_action/hands_free/shift_nerves
name = "Shift Nerves"
/datum/action/item_action/toggle_research_scanner
name = "Toggle Research Scanner"
button_icon_state = "scan_mode"
var/active = FALSE
/datum/action/item_action/toggle_research_scanner/Trigger()
if(IsAvailable())
owner.research_scanner = !owner.research_scanner
owner << "<span class='notice'>Research analyzer is now [owner.research_scanner ? "active" : "deactivated"].</span>"
active = !active
if(active)
owner.research_scanner++
else
owner.research_scanner--
owner << "<span class='notice'>[target] research scanner has been [active ? "activated" : "deactivated"].</span>"
return 1
/datum/action/item_action/toggle_research_scanner/Remove(mob/M)
if(owner)
owner.research_scanner = 0
if(owner && active)
owner.research_scanner--
active = FALSE
..()
/datum/action/item_action/toggle_research_scanner/ApplyIcon(obj/screen/movable/action_button/current_button)
current_button.cut_overlays()
if(button_icon && button_icon_state)
var/image/img = image(button_icon, current_button, "scan_mode")
current_button.add_overlay(img)
/datum/action/item_action/organ_action
check_flags = AB_CHECK_CONSCIOUS