mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-29 19:52:12 +00:00
This commit adds baystation's rigsuit system on top of our own hardsuits; Our own hardsuits still function fine and are around, but these are available to admins. Next commit will contain balancing and player implementation stuff.
85 lines
2.3 KiB
Plaintext
85 lines
2.3 KiB
Plaintext
|
|
#define MIDDLE_CLICK 0
|
|
#define ALT_CLICK 1
|
|
#define CTRL_CLICK 2
|
|
#define MAX_HARDSUIT_CLICK_MODE 2
|
|
|
|
/client
|
|
var/hardsuit_click_mode = MIDDLE_CLICK
|
|
|
|
/client/verb/toggle_hardsuit_mode()
|
|
set name = "Toggle Hardsuit Activation Mode"
|
|
set desc = "Switch between hardsuit activation modes."
|
|
set category = "OOC"
|
|
|
|
hardsuit_click_mode++
|
|
if(hardsuit_click_mode > MAX_HARDSUIT_CLICK_MODE)
|
|
hardsuit_click_mode = 0
|
|
|
|
switch(hardsuit_click_mode)
|
|
if(MIDDLE_CLICK)
|
|
src << "Hardsuit activation mode set to middle-click."
|
|
if(ALT_CLICK)
|
|
src << "Hardsuit activation mode set to alt-click."
|
|
if(CTRL_CLICK)
|
|
src << "Hardsuit activation mode set to control-click."
|
|
else
|
|
// should never get here, but just in case:
|
|
log_debug("Bad hardsuit click mode: [hardsuit_click_mode] - expected 0 to [MAX_HARDSUIT_CLICK_MODE]")
|
|
src << "Somehow you bugged the system. Setting your hardsuit mode to middle-click."
|
|
hardsuit_click_mode = MIDDLE_CLICK
|
|
|
|
/mob/living/MiddleClickOn(atom/A)
|
|
if(client && client.hardsuit_click_mode == MIDDLE_CLICK)
|
|
if(HardsuitClickOn(A))
|
|
return
|
|
..()
|
|
|
|
/mob/living/AltClickOn(atom/A)
|
|
if(client && client.hardsuit_click_mode == ALT_CLICK)
|
|
if(HardsuitClickOn(A))
|
|
return
|
|
..()
|
|
|
|
/mob/living/CtrlClickOn(atom/A)
|
|
if(client && client.hardsuit_click_mode == CTRL_CLICK)
|
|
if(HardsuitClickOn(A))
|
|
return
|
|
..()
|
|
|
|
/mob/living/proc/can_use_rig()
|
|
return 0
|
|
|
|
/mob/living/carbon/human/can_use_rig()
|
|
return 1
|
|
|
|
/mob/living/carbon/brain/can_use_rig()
|
|
return istype(loc, /obj/item/device/mmi)
|
|
|
|
/mob/living/silicon/ai/can_use_rig()
|
|
return istype(loc, /obj/item/device/aicard)
|
|
|
|
/mob/living/silicon/pai/can_use_rig()
|
|
return loc == card
|
|
|
|
/mob/living/proc/HardsuitClickOn(var/atom/A, var/alert_ai = 0)
|
|
if(!can_use_rig() || (next_move > world.time))
|
|
return 0
|
|
var/obj/item/weapon/rig/rig = get_rig()
|
|
if(istype(rig) && !rig.offline && rig.selected_module)
|
|
if(src != rig.wearer)
|
|
if(rig.ai_can_move_suit(src, check_user_module = 1))
|
|
message_admins("[key_name_admin(src, include_name = 1)] is trying to force \the [key_name_admin(rig.wearer, include_name = 1)] to use a hardsuit module.")
|
|
else
|
|
return 0
|
|
rig.selected_module.engage(A, alert_ai)
|
|
if(ismob(A)) // No instant mob attacking - though modules have their own cooldowns
|
|
changeNext_move(CLICK_CD_MELEE)
|
|
return 1
|
|
return 0
|
|
|
|
#undef MIDDLE_CLICK
|
|
#undef ALT_CLICK
|
|
#undef CTRL_CLICK
|
|
#undef MAX_HARDSUIT_CLICK_MODE
|