fixes for cling aug vision and general action buttons

This commit is contained in:
Arkatos1
2019-05-20 15:42:20 +02:00
parent c6777cbceb
commit 72abc2665e
2 changed files with 20 additions and 10 deletions
+6 -2
View File
@@ -167,6 +167,8 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
if("holdervar")
adjust_var(user, holder_var_type, holder_var_amount)
if(action)
action.UpdateButtonIcon()
return 1
/obj/effect/proc_holder/spell/proc/invocation(mob/user = usr) //spelling the spell out and setting it on recharge/reducing charges amount
@@ -235,6 +237,8 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
else
cast(targets, user = user)
after_cast(targets)
if(action)
action.UpdateButtonIcon()
/obj/effect/proc_holder/spell/proc/before_cast(list/targets)
if(overlay)
@@ -291,8 +295,8 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
charge_counter++
if("holdervar")
adjust_var(user, holder_var_type, -holder_var_amount)
return
if(action)
action.UpdateButtonIcon()
/obj/effect/proc_holder/spell/proc/updateButtonIcon()
if(action)
@@ -8,18 +8,25 @@
button_icon_state = "augmented_eyesight"
chemical_cost = 0
dna_cost = 2 //Would be 1 without thermal vision
active = FALSE
/datum/action/changeling/augmented_eyesight/sting_action(mob/living/carbon/human/user)
/datum/action/changeling/augmented_eyesight/on_purchase(mob/user) //The ability starts inactive, so we should be protected from flashes.
..()
var/obj/item/organ/internal/cyberimp/eyes/O = new /obj/item/organ/internal/cyberimp/eyes/shield/ling()
O.insert(user)
active = FALSE
/datum/action/changeling/augmented_eyesight/sting_action(mob/living/carbon/user)
if(!istype(user))
return
if(user.get_int_organ(/obj/item/organ/internal/cyberimp/eyes/thermals/ling))
var/obj/item/organ/internal/cyberimp/eyes/O = new /obj/item/organ/internal/cyberimp/eyes/shield/ling()
O.insert(user)
else
if(!active)
var/obj/item/organ/internal/cyberimp/eyes/O = new /obj/item/organ/internal/cyberimp/eyes/thermals/ling()
O.insert(user)
active = TRUE
else
var/obj/item/organ/internal/cyberimp/eyes/O = new /obj/item/organ/internal/cyberimp/eyes/shield/ling()
O.insert(user)
active = FALSE
return 1
/datum/action/changeling/augmented_eyesight/Remove(mob/user)
@@ -50,7 +57,6 @@
S.reagents.add_reagent("oculine", 15)
return S
/obj/item/organ/internal/cyberimp/eyes/thermals/ling
name = "heat receptors"
desc = "These heat receptors dramatically increases eyes light sensing ability."