Skip to content

Commit

Permalink
Merge pull request tgstation#18986 from ChangelingRain/slabomatic
Browse files Browse the repository at this point in the history
Clockwork Slabs now use an action button for communication
  • Loading branch information
Cheridan authored Jun 29, 2016
2 parents b598c03 + 83bc5c4 commit 4a89986
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 12 deletions.
10 changes: 10 additions & 0 deletions code/datums/action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@

/datum/action/item_action/toggle_flame
name = "Summon/Dismiss Ratvar's Flame"
background_icon_state = "bg_clock"

/datum/action/item_action/toggle_flame/IsAvailable()
if(!is_servant_of_ratvar(owner))
Expand All @@ -194,6 +195,15 @@
return 0
return ..()

/datum/action/item_action/hierophant
name = "Hierophant Network"
button_icon_state = "hierophant"
background_icon_state = "bg_clock"

/datum/action/item_action/hierophant/IsAvailable()
if(!is_servant_of_ratvar(owner))
return 0
return ..()

/datum/action/item_action/toggle_helmet_flashlight
name = "Toggle Helmet Flashlight"
Expand Down
6 changes: 4 additions & 2 deletions code/game/gamemodes/clock_cult/clock_cult.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ This file's folder contains:
M.languages_spoken |= RATVAR
M.languages_understood |= RATVAR
all_clockwork_mobs += M
M.update_action_buttons_icon() //because a few clockcult things are action buttons and we may be wearing/holding them for whatever reason, we need to update buttons
if(issilicon(M))
var/mob/living/silicon/S = M
if(isrobot(S))
Expand Down Expand Up @@ -126,6 +127,7 @@ This file's folder contains:
M.mind.special_role = null
M.languages_spoken &= ~RATVAR
M.languages_understood &= ~RATVAR
M.update_action_buttons_icon() //because a few clockcult things are action buttons and we may be wearing/holding them, we need to update buttons
for(var/datum/action/innate/function_call/F in M.actions) //Removes any bound Ratvarian spears
qdel(F)
if(issilicon(M))
Expand Down Expand Up @@ -249,8 +251,8 @@ This file's folder contains:
if(slot == "At your feet")
new/obj/item/clockwork/slab/starter(get_turf(L))
L << "<b>[slot] is a link to the halls of Reebe and your master. You may use it to perform many tasks, but also become oriented with the workings of Ratvar and how to best complete your \
tasks. This clockwork slab will be instrumental in your triumph. Remember: you can speak discreetly with your fellow servants by using Report in your slab's interface, and you can find a \
concise tutorial in Recollection.</b>"
tasks. This clockwork slab will be instrumental in your triumph. Remember: you can speak discreetly with your fellow servants by using the <span class='brass'>Hierophant Network</span> action button, \
and you can find a concise tutorial by using the slab in-hand and selecting Recollection.</b>"
L << "<i>Alternatively, check out the wiki page at </i><b>https://tgstation13.org/wiki/Clockwork_Cult</b><i>, which contains additional information.</i>"
return 1

Expand Down
31 changes: 21 additions & 10 deletions code/game/gamemodes/clock_cult/clock_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@
desc = "A strange metal tablet. A clock in the center turns around and around."
clockwork_desc = "A link between the Celestial Derelict and the mortal plane. Contains limitless knowledge, fabricates components, and outputs a stream of information that only a trained eye can detect."
icon_state = "dread_ipad"
w_class = 3
slot_flags = SLOT_BELT
w_class = 2
var/list/stored_components = list("belligerent_eye" = 0, "vanguard_cogwheel" = 0, "guvax_capacitor" = 0, "replicant_alloy" = 0, "hierophant_ansible" = 0)
var/busy //If the slab is currently being used by something
var/production_time = 0
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)

/obj/item/clockwork/slab/starter
stored_components = list("belligerent_eye" = 1, "vanguard_cogwheel" = 1, "guvax_capacitor" = 1, "replicant_alloy" = 1, "hierophant_ansible" = 1)
Expand Down Expand Up @@ -85,6 +87,9 @@
S.production_time = world.time + SLAB_PRODUCTION_TIME
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)

/obj/item/clockwork/slab/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/clockwork/component) && is_servant_of_ratvar(user))
var/obj/item/clockwork/component/C = I
Expand Down Expand Up @@ -124,19 +129,19 @@
/obj/item/clockwork/slab/proc/access_display(mob/living/user)
if(!is_servant_of_ratvar(user))
return 0
var/action = input(user, "Among the swathes of information, you see...", "[src]") as null|anything in list("Recital", "Records", "Recollection", "Report")
var/action = input(user, "Among the swathes of information, you see...", "[src]") as null|anything in list("Recital", "Records", "Recollection")
if(!action || !user.canUseTopic(src))
return 0
switch(action)
if("Recital")
if(user.get_active_hand() != src)
user << "<span class='warning'>You need to hold the slab to recite scripture!</span>"
return
recite_scripture(user)
if("Records")
show_stats(user)
if("Recollection")
show_guide(user)
if("Report")
show_hierophant(user)
access_display(user)
return 1

/obj/item/clockwork/slab/proc/recite_scripture(mob/living/user)
Expand Down Expand Up @@ -178,7 +183,7 @@
var/datum/clockwork_scripture/C = S
if("[initial(C.name)] ([initial(C.descname)])" == chosen_scripture)
scripture_to_recite = new C
if(!scripture_to_recite)
if(!scripture_to_recite || user.get_active_hand() != src)
return 0
scripture_to_recite.slab = src
scripture_to_recite.invoker = user
Expand Down Expand Up @@ -223,15 +228,15 @@
In addition to their ability to pull components, slabs also possess other functionalities...<br><br>\
\
The first functionality of the slab is Recital. This allows you to consume components either from your slab or from the global cache (more on that in the scripture list) to perform \
effects usually considered magical in nature. Effects vary considerably - you might drain the power of nearby APCs or break the will of those implanted by Nanotrasen. Nevertheless, scripture \
effects usually considered magical in nature. Effects vary considerably - you might drain the power of nearby APCs, cause mass confusion, or force people to walk. Nevertheless, scripture \
is extremely important to a successful takeover.<br><br>\
\
The second functionality of the clockwork slab is Records. The slab is not a one-way link and can also feed information into the stream that it draws from. Records will allow many \
important statistics to be displayed, such as the amount of people converted and total construction value. You should check it often.<br><br>\
\
The third functionality is Recollection, which will display this guide. Recollection will automatically be initiated if you have not used a slab before.<br><br>\
The third and final functionality is Recollection, which will display this guide. Recollection will automatically be initiated if you have not used a slab before.<br><br>\
\
The fourth and final functionality is Report, which allows you to discreetly communicate with all other servants.<br><br>\
Examine the slab for component amount information.<br><br>\
\
A complete list of scripture, its effects, and its requirements can be found below. <i>Note that anything above a driver always consumes the components listed unless otherwise \
specified.</i><br><br>"
Expand Down Expand Up @@ -344,6 +349,7 @@
/obj/item/clockwork/slab/examine(mob/user)
..()
if(is_servant_of_ratvar(user) || isobserver(user))
user << "Use the <span class='brass'>Hierophant Network</span> action button to communicate with other servants."
user << "Clockwork slabs will only generate components if held by a human or if inside a storage item held by a human, and when generating a component will prevent all other slabs held from generating components."
user << "<b>Stored components (with global cache):</b>"
user << "<span class='neovgre_small'><i>Belligerent Eyes:</i> [stored_components["belligerent_eye"]] ([stored_components["belligerent_eye"] + clockwork_component_cache["belligerent_eye"]])</span>"
Expand Down Expand Up @@ -430,6 +436,11 @@
var/obj/item/weapon/ratvars_flame/flame //The linked flame object
actions_types = list(/datum/action/item_action/toggle_flame)

/obj/item/clothing/glasses/judicial_visor/item_action_slot_check(slot, mob/user)
if(slot != slot_glasses)
return 0
return ..()

/obj/item/clothing/glasses/judicial_visor/equipped(mob/living/user, slot)
..()
if(slot != slot_glasses)
Expand Down Expand Up @@ -461,7 +472,7 @@
if(C.l_hand && C.r_hand)
C << "<span class='warning'>You require a free hand to utilize [src]'s power!</span>"
return 0
C.visible_message("<span class='warning'>[C]'s hand is enveloped in violet flames!<span>", "<span class='brass'><i>You harness [src]'s power. <b>Direct it at a tile</b> to unleash it, or use the action button again to dispel it.</i></span>")
C.visible_message("<span class='warning'>[C]'s hand is enveloped in violet flames!<span>", "<span class='brass'><i>You harness [src]'s power. <b>Direct it at a tile at any range</b> to unleash it, or use the action button again to dispel it.</i></span>")
var/obj/item/weapon/ratvars_flame/R = new(get_turf(C))
flame = R
C.put_in_hands(R)
Expand Down
1 change: 1 addition & 0 deletions code/game/gamemodes/clock_cult/clock_unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/datum/action/innate/function_call
name = "Function Call"
button_icon_state = "ratvarian_spear"
background_icon_state = "bg_clock"
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_CONSCIOUS

/datum/action/innate/function_call/IsAvailable()
Expand Down
Binary file modified icons/mob/actions.dmi
Binary file not shown.
Binary file modified icons/mob/belt.dmi
Binary file not shown.
Binary file modified icons/mob/belt_mirror.dmi
Binary file not shown.

0 comments on commit 4a89986

Please sign in to comment.