mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-25 01:22:58 +00:00
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: CHOMPStation2 <chompsation2@gmail.com> Co-authored-by: Raeschen <rycoop29@gmail.com> Co-authored-by: Changelogs <action@github.com> Co-authored-by: Aroliacue <96730930+Aroliacue@users.noreply.github.com> Co-authored-by: Eli <fracshun@gmail.com> Co-authored-by: tacoguy7765093 <karokaromaro@gmail.com> Co-authored-by: Nadyr <41974248+Darlantanis@users.noreply.github.com> Co-authored-by: TheGreatKitsune <88862343+TheGreatKitsune@users.noreply.github.com> Co-authored-by: Missile597 <150307788+Missile597@users.noreply.github.com>
303 lines
7.5 KiB
Plaintext
303 lines
7.5 KiB
Plaintext
// Interface for humans.
|
|
/obj/item/weapon/rig/verb/hardsuit_interface()
|
|
|
|
set name = "Open Hardsuit Interface"
|
|
set desc = "Open the hardsuit system interface."
|
|
set category = "Hardsuit"
|
|
set src = usr.contents
|
|
|
|
if(wearer && (wearer.back == src || wearer.belt == src))
|
|
tgui_interact(usr)
|
|
|
|
// So the UI button clicks come here
|
|
/obj/item/weapon/rig/ui_action_click()
|
|
if(usr == wearer && (wearer.back == src || wearer.belt == src))
|
|
tgui_interact(usr)
|
|
|
|
/obj/item/weapon/rig/verb/toggle_vision()
|
|
|
|
set name = "Toggle Visor"
|
|
set desc = "Turns your rig visor off or on."
|
|
set category = "Hardsuit"
|
|
set src = usr.contents
|
|
|
|
if(!istype(wearer) || (!wearer.back == src && !wearer.belt == src))
|
|
to_chat(usr, "<span class='warning'>The hardsuit is not being worn.</span>")
|
|
return
|
|
|
|
if(!check_power_cost(usr))
|
|
return
|
|
|
|
if(canremove)
|
|
to_chat(usr, "<span class='warning'>The suit is not active.</span>")
|
|
return
|
|
|
|
if(!check_suit_access(usr))
|
|
return
|
|
|
|
if(!visor)
|
|
to_chat(usr, "<span class='warning'>The hardsuit does not have a configurable visor.</span>")
|
|
return
|
|
|
|
if(!visor.active)
|
|
visor.activate()
|
|
else
|
|
visor.deactivate()
|
|
|
|
/obj/item/weapon/rig/proc/toggle_helmet()
|
|
|
|
set name = "Toggle Helmet"
|
|
set desc = "Deploys or retracts your helmet."
|
|
set category = "Hardsuit"
|
|
set src = usr.contents
|
|
|
|
if(!istype(wearer) || (!wearer.back == src && !wearer.belt == src))
|
|
to_chat(usr, "<span class='warning'>The hardsuit is not being worn.</span>")
|
|
return
|
|
|
|
if(!check_suit_access(usr))
|
|
return
|
|
|
|
toggle_piece("helmet",wearer)
|
|
|
|
/obj/item/weapon/rig/proc/toggle_chest()
|
|
|
|
set name = "Toggle Chestpiece"
|
|
set desc = "Deploys or retracts your chestpiece."
|
|
set category = "Hardsuit"
|
|
set src = usr.contents
|
|
|
|
if(!check_suit_access(usr))
|
|
return
|
|
|
|
toggle_piece("chest",wearer)
|
|
|
|
/obj/item/weapon/rig/proc/toggle_gauntlets()
|
|
|
|
set name = "Toggle Gauntlets"
|
|
set desc = "Deploys or retracts your gauntlets."
|
|
set category = "Hardsuit"
|
|
set src = usr.contents
|
|
|
|
if(!istype(wearer) || (!wearer.back == src && !wearer.belt == src))
|
|
to_chat(usr, "<span class='warning'>The hardsuit is not being worn.</span>")
|
|
return
|
|
|
|
if(!check_suit_access(usr))
|
|
return
|
|
|
|
toggle_piece("gauntlets",wearer)
|
|
|
|
/obj/item/weapon/rig/proc/toggle_boots()
|
|
|
|
set name = "Toggle Boots"
|
|
set desc = "Deploys or retracts your boots."
|
|
set category = "Hardsuit"
|
|
set src = usr.contents
|
|
|
|
if(!istype(wearer) || (!wearer.back == src && !wearer.belt == src))
|
|
to_chat(usr, "<span class='warning'>The hardsuit is not being worn.</span>")
|
|
return
|
|
|
|
if(!check_suit_access(usr))
|
|
return
|
|
|
|
toggle_piece("boots",wearer)
|
|
|
|
/obj/item/weapon/rig/verb/deploy_suit()
|
|
|
|
set name = "Deploy Hardsuit"
|
|
set desc = "Deploys helmet, gloves and boots."
|
|
set category = "Hardsuit"
|
|
set src = usr.contents
|
|
|
|
if(!istype(wearer) || (!wearer.back == src && !wearer.belt == src))
|
|
to_chat(usr, "<span class='warning'>The hardsuit is not being worn.</span>")
|
|
return
|
|
|
|
if(!check_suit_access(usr))
|
|
return
|
|
|
|
if(!check_power_cost(usr))
|
|
return
|
|
|
|
deploy(wearer)
|
|
|
|
/obj/item/weapon/rig/verb/toggle_seals_verb()
|
|
|
|
set name = "Toggle Hardsuit"
|
|
set desc = "Activates or deactivates your rig."
|
|
set category = "Hardsuit"
|
|
set src = usr.contents
|
|
|
|
if(!istype(wearer) || (!wearer.back == src && !wearer.belt == src))
|
|
to_chat(usr, "<span class='warning'>The hardsuit is not being worn.</span>")
|
|
return
|
|
|
|
if(!check_suit_access(usr))
|
|
return
|
|
|
|
toggle_seals(wearer)
|
|
|
|
/obj/item/weapon/rig/verb/switch_vision_mode()
|
|
|
|
set name = "Switch Vision Mode"
|
|
set desc = "Switches between available vision modes."
|
|
set category = "Hardsuit"
|
|
set src = usr.contents
|
|
|
|
if(malfunction_check(usr))
|
|
return
|
|
|
|
if(!check_power_cost(usr, 0, 0, 0, 0))
|
|
return
|
|
|
|
if(canremove)
|
|
to_chat(usr, "<span class='warning'>The suit is not active.</span>")
|
|
return
|
|
|
|
if(!visor)
|
|
to_chat(usr, "<span class='warning'>The hardsuit does not have a configurable visor.</span>")
|
|
return
|
|
|
|
if(!visor.active)
|
|
visor.activate()
|
|
|
|
if(!visor.active)
|
|
to_chat(usr, "<span class='warning'>The visor is suffering a hardware fault and cannot be configured.</span>")
|
|
return
|
|
|
|
visor.engage()
|
|
|
|
/obj/item/weapon/rig/verb/alter_voice()
|
|
|
|
set name = "Configure Voice Synthesiser"
|
|
set desc = "Toggles or configures your voice synthesizer."
|
|
set category = "Hardsuit"
|
|
set src = usr.contents
|
|
|
|
if(malfunction_check(usr))
|
|
return
|
|
|
|
if(canremove)
|
|
to_chat(usr, "<span class='warning'>The suit is not active.</span>")
|
|
return
|
|
|
|
if(!istype(wearer) || (!wearer.back == src && !wearer.belt == src))
|
|
to_chat(usr, "<span class='warning'>The hardsuit is not being worn.</span>")
|
|
return
|
|
|
|
if(!speech)
|
|
to_chat(usr, "<span class='warning'>The hardsuit does not have a speech synthesiser.</span>")
|
|
return
|
|
|
|
speech.engage()
|
|
|
|
/obj/item/weapon/rig/verb/select_module()
|
|
|
|
set name = "Select Module"
|
|
set desc = "Selects a module as your primary system."
|
|
set category = "Hardsuit"
|
|
set src = usr.contents
|
|
|
|
if(malfunction_check(usr))
|
|
return
|
|
|
|
if(!check_power_cost(usr, 0, 0, 0, 0))
|
|
return
|
|
|
|
if(canremove)
|
|
to_chat(usr, "<span class='warning'>The suit is not active.</span>")
|
|
return
|
|
|
|
if(!istype(wearer) || (!wearer.back == src && !wearer.belt == src))
|
|
to_chat(usr, "<span class='warning'>The hardsuit is not being worn.</span>")
|
|
return
|
|
|
|
var/list/selectable = list()
|
|
for(var/obj/item/rig_module/module in installed_modules)
|
|
if(module.selectable)
|
|
selectable |= module
|
|
|
|
var/obj/item/rig_module/module = tgui_input_list(usr, "Which module do you wish to select?", "Select Module", selectable)
|
|
|
|
if(!istype(module))
|
|
selected_module = null
|
|
to_chat(usr, span_blue("<b>Primary system is now: deselected.</b>"))
|
|
return
|
|
|
|
selected_module = module
|
|
to_chat(usr, span_blue("<b>Primary system is now: [selected_module.interface_name].</b>"))
|
|
|
|
/obj/item/weapon/rig/verb/toggle_module()
|
|
|
|
set name = "Toggle Module"
|
|
set desc = "Toggle a system module."
|
|
set category = "Hardsuit"
|
|
set src = usr.contents
|
|
|
|
if(malfunction_check(usr))
|
|
return
|
|
|
|
if(!check_power_cost(usr, 0, 0, 0, 0))
|
|
return
|
|
|
|
if(canremove)
|
|
to_chat(usr, "<span class='warning'>The suit is not active.</span>")
|
|
return
|
|
|
|
if(!istype(wearer) || (!wearer.back == src && !wearer.belt == src))
|
|
to_chat(usr, "<span class='warning'>The hardsuit is not being worn.</span>")
|
|
return
|
|
|
|
var/list/selectable = list()
|
|
for(var/obj/item/rig_module/module in installed_modules)
|
|
if(module.toggleable)
|
|
selectable |= module
|
|
|
|
var/obj/item/rig_module/module = tgui_input_list(usr, "Which module do you wish to toggle?", "Toggle Module", selectable)
|
|
|
|
if(!istype(module))
|
|
return
|
|
|
|
if(module.active)
|
|
to_chat(usr, span_blue("<b>You attempt to deactivate \the [module.interface_name].</b>"))
|
|
module.deactivate()
|
|
else
|
|
to_chat(usr, span_blue("<b>You attempt to activate \the [module.interface_name].</b>"))
|
|
module.activate()
|
|
|
|
/obj/item/weapon/rig/verb/engage_module()
|
|
|
|
set name = "Engage Module"
|
|
set desc = "Engages a system module."
|
|
set category = "Hardsuit"
|
|
set src = usr.contents
|
|
|
|
if(malfunction_check(usr))
|
|
return
|
|
|
|
if(canremove)
|
|
to_chat(usr, "<span class='warning'>The suit is not active.</span>")
|
|
return
|
|
|
|
if(!istype(wearer) || (!wearer.back == src && !wearer.belt == src))
|
|
to_chat(usr, "<span class='warning'>The hardsuit is not being worn.</span>")
|
|
return
|
|
|
|
if(!check_power_cost(usr, 0, 0, 0, 0))
|
|
return
|
|
|
|
var/list/selectable = list()
|
|
for(var/obj/item/rig_module/module in installed_modules)
|
|
if(module.usable)
|
|
selectable |= module
|
|
|
|
var/obj/item/rig_module/module = tgui_input_list(usr, "Which module do you wish to engage?", "Engage Module", selectable)
|
|
|
|
if(!istype(module))
|
|
return
|
|
|
|
to_chat(usr, span_blue("<b>You attempt to engage the [module.interface_name].</b>"))
|
|
module.engage()
|