Adds Guvax and Vanguard action buttons to the clockwork slab (#19345)

This commit is contained in:
Joan Lung
2016-07-18 15:49:43 +12:00
committed by oranges
parent 7feb2e1546
commit 6aad68bca9
4 changed files with 49 additions and 13 deletions
+25 -9
View File
@@ -6,6 +6,7 @@
/datum/action
var/name = "Generic Action"
var/desc = null
var/obj/target = null
var/check_flags = 0
var/processing = 0
@@ -22,6 +23,8 @@
button = new
button.linked_action = src
button.name = name
if(desc)
button.desc = desc
/datum/action/Destroy()
if(owner)
@@ -184,11 +187,19 @@
/datum/action/item_action/toggle_helmet_light
name = "Toggle Helmet Light"
/datum/action/item_action/toggle_flame
name = "Summon/Dismiss Ratvar's Flame"
/datum/action/item_action/clock
background_icon_state = "bg_clock"
/datum/action/item_action/toggle_flame/IsAvailable()
/datum/action/item_action/clock/IsAvailable()
if(!is_servant_of_ratvar(owner))
return 0
return ..()
/datum/action/item_action/clock/toggle_flame
name = "Summon/Dismiss Ratvar's Flame"
desc = "Allows you to summon a flame that can create stunning zones at any range."
/datum/action/item_action/clock/toggle_flame/IsAvailable()
if(!is_servant_of_ratvar(owner))
return 0
if(istype(target, /obj/item/clothing/glasses/judicial_visor))
@@ -197,15 +208,20 @@
return 0
return ..()
/datum/action/item_action/hierophant
/datum/action/item_action/clock/hierophant
name = "Hierophant Network"
desc = "Allows you to communicate with other Servants."
button_icon_state = "hierophant_slab"
background_icon_state = "bg_clock"
/datum/action/item_action/hierophant/IsAvailable()
if(!is_servant_of_ratvar(owner))
return 0
return ..()
/datum/action/item_action/clock/guvax
name = "Guvax"
desc = "Allows you to convert adjacent nonservants while holding the slab."
button_icon_state = "guvax_capacitor"
/datum/action/item_action/clock/vanguard
name = "Vanguard"
desc = "Allows you to temporarily absorb stuns. All stuns absorbed will affect you when disabled."
button_icon_state = "vanguard_cogwheel"
/datum/action/item_action/toggle_helmet_flashlight
name = "Toggle Helmet Flashlight"
+22 -4
View File
@@ -33,7 +33,7 @@
var/no_cost = FALSE //If the slab is admin-only and needs no components and has no scripture locks
var/nonhuman_usable = FALSE //if the slab can be used by nonhumans, defaults to off
var/produces_components = TRUE //if it produces components at all
actions_types = list(/datum/action/item_action/hierophant)
actions_types = list(/datum/action/item_action/clock/hierophant, /datum/action/item_action/clock/guvax, /datum/action/item_action/clock/vanguard)
/obj/item/clockwork/slab/starter
stored_components = list("belligerent_eye" = 1, "vanguard_cogwheel" = 1, "guvax_capacitor" = 1, "replicant_alloy" = 1, "hierophant_ansible" = 1)
@@ -96,7 +96,25 @@
L << "<span class='warning'>Your slab clunks as it produces a new component.</span>"
/obj/item/clockwork/slab/ui_action_click(mob/user, actiontype)
show_hierophant(user)
switch(actiontype)
if(/datum/action/item_action/clock/hierophant)
show_hierophant(user)
if(/datum/action/item_action/clock/guvax)
if(src == user.get_active_hand())
var/datum/clockwork_scripture/guvax/convert = new
convert.slab = src
convert.invoker = user
convert.run_scripture()
else
user << "<span class='warning'>You need to hold the slab in your active hand to recite scripture!</span>"
if(/datum/action/item_action/clock/vanguard)
if(src == user.get_active_hand())
var/datum/clockwork_scripture/vanguard/antistun = new
antistun.slab = src
antistun.invoker = user
antistun.run_scripture()
else
user << "<span class='warning'>You need to hold the slab in your active hand to recite scripture!</span>"
/obj/item/clockwork/slab/attack(mob/living/target, mob/living/carbon/human/user)
if(is_servant_of_ratvar(user) && is_servant_of_ratvar(target))
@@ -173,7 +191,7 @@
switch(action)
if("Recital")
if(user.get_active_hand() != src)
user << "<span class='warning'>You need to hold the slab to recite scripture!</span>"
user << "<span class='warning'>You need to hold the slab in your active hand to recite scripture!</span>"
return
recite_scripture(user)
if("Records")
@@ -482,7 +500,7 @@
var/recharging = FALSE //If the visor is currently recharging
var/obj/item/weapon/ratvars_flame/flame //The linked flame object
var/recharge_cooldown = 300 //divided by 10 if ratvar is alive
actions_types = list(/datum/action/item_action/toggle_flame)
actions_types = list(/datum/action/item_action/clock/toggle_flame)
/obj/item/clothing/glasses/judicial_visor/item_action_slot_check(slot, mob/user)
if(slot != slot_glasses)
@@ -23,6 +23,7 @@
//Hierophant Network action, allows a servant with it to communicate
/datum/action/innate/hierophant
name = "Hierophant Network"
desc = "Allows you to communicate with other Servants."
button_icon_state = "hierophant"
background_icon_state = "bg_clock"
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_CONSCIOUS
@@ -43,6 +44,7 @@
//Function Call action: Calls forth a Ratvarian spear once every 5 minutes
/datum/action/innate/function_call
name = "Function Call"
desc = "Allows you to summon a Ratvarian spear to fight enemies."
button_icon_state = "ratvarian_spear"
background_icon_state = "bg_clock"
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_CONSCIOUS
Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 80 KiB