This commit is contained in:
SandPoot
2023-01-31 16:40:17 -03:00
parent 2d5e163916
commit ed06e686e1
29 changed files with 759 additions and 14 deletions

View File

@@ -91,6 +91,11 @@ GENETICS SCANNER
var/scanmode = SCANMODE_HEALTH
var/advanced = FALSE
/obj/item/healthanalyzer/Initialize(mapload)
. = ..()
register_item_context()
/obj/item/healthanalyzer/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins to analyze [user.p_them()]self with [src]! The display shows that [user.p_theyre()] dead!</span>")
return BRUTELOSS
@@ -130,6 +135,24 @@ GENETICS SCANNER
add_fingerprint(user)
/obj/item/healthanalyzer/add_item_context(
obj/item/source,
list/context,
atom/target,
)
if (!isliving(target))
return NONE
switch (scanmode)
if (SCANMODE_HEALTH)
context[SCREENTIP_CONTEXT_LMB] = "Scan health"
if (SCANMODE_CHEMICAL)
context[SCREENTIP_CONTEXT_LMB] = "Scan chemicals"
if (SCANMODE_WOUND)
context[SCREENTIP_CONTEXT_LMB] = "Scan wounds"
return CONTEXTUAL_SCREENTIP_SET
// Used by the PDA medical scanner too
/proc/healthscan(mob/user, mob/living/M, mode = 1, advanced = FALSE)
if(isliving(user) && (user.incapacitated() || user.eye_blind))

View File

@@ -122,6 +122,21 @@
breakouttime = 300 //Deciseconds = 30s
cuffsound = 'sound/weapons/cablecuff.ogg'
/obj/item/restraints/handcuffs/cable/Initialize(mapload)
. = ..()
var/static/list/hovering_item_typechecks = list(
/obj/item/stack/rods = list(
SCREENTIP_CONTEXT_LMB = "Craft wired rod",
),
/obj/item/stack/sheet/metal = list(
SCREENTIP_CONTEXT_LMB = "Craft bola",
),
)
AddElement(/datum/element/contextual_screentip_item_typechecks, hovering_item_typechecks)
/obj/item/restraints/handcuffs/cable/attack_self(mob/user)
to_chat(user, "<span class='notice'>You start unwinding the cable restraints back into coil</span>")
if(!do_after(user, 25, TRUE, user))

View File

@@ -30,6 +30,24 @@
var/status_duration = 3 SECONDS //how long our status effects last for otherwise
COOLDOWN_DECLARE(shove_cooldown)
/// The context to show when the baton is active and targetting a living thing
var/context_living_target_active = "Stun"
/// The context to show when the baton is active and targetting a living thing in combat mode
var/context_living_target_active_combat_mode = "Stun"
/// The context to show when the baton is inactive and targetting a living thing
var/context_living_target_inactive = "Prod"
/// The context to show when the baton is inactive and targetting a living thing in combat mode
var/context_living_target_inactive_combat_mode = "Attack"
/// The RMB context to show when the baton is active and targetting a living thing
var/context_living_rmb_active = "Attack"
/// The RMB context to show when the baton is inactive and targetting a living thing
var/context_living_rmb_inactive = "Attack"
/obj/item/melee/baton/examine(mob/user)
. = ..()
. += "<span class='notice'>Right click attack while in combat mode to knockdown, but only once per [cooldown_duration / 10] seconds.</span>"
@@ -54,6 +72,8 @@
cell = new preload_cell_type(src)
update_icon()
register_item_context()
/obj/item/melee/baton/DoRevenantThrowEffects(atom/target)
switch_status()
@@ -155,6 +175,30 @@
if(!interrupt)
return ..()
/obj/item/melee/baton/add_item_context(datum/source, list/context, atom/target, mob/living/user)
if (isturf(target))
return NONE
if (isobj(target))
context[SCREENTIP_CONTEXT_LMB] = "Attack"
else
if (turned_on)
context[SCREENTIP_CONTEXT_RMB] = context_living_rmb_active
if (user.a_intent == INTENT_HARM)
context[SCREENTIP_CONTEXT_LMB] = context_living_target_active_combat_mode
else
context[SCREENTIP_CONTEXT_LMB] = context_living_target_active
else
context[SCREENTIP_CONTEXT_RMB] = context_living_rmb_inactive
if (user.a_intent == INTENT_HARM)
context[SCREENTIP_CONTEXT_LMB] = context_living_target_inactive_combat_mode
else
context[SCREENTIP_CONTEXT_LMB] = context_living_target_inactive
return CONTEXTUAL_SCREENTIP_SET
/obj/item/melee/baton/alt_pre_attack(atom/A, mob/living/user, params)
if(!user.CheckActionCooldown(CLICK_CD_MELEE))
return

View File

@@ -583,6 +583,21 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
attack_verb = list("hit", "bludgeoned", "whacked", "bonked")
wound_bonus = -10
/obj/item/wirerod/Initialize(mapload)
. = ..()
var/static/list/hovering_item_typechecks = list(
/obj/item/shard = list(
SCREENTIP_CONTEXT_LMB = "Craft spear",
),
/obj/item/assembly/igniter = list(
SCREENTIP_CONTEXT_LMB = "Craft stunprod",
),
)
AddElement(/datum/element/contextual_screentip_item_typechecks, hovering_item_typechecks)
/obj/item/wirerod/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/shard))
var/obj/item/spear/S = new /obj/item/spear

View File

@@ -490,6 +490,19 @@
// the sprites in the editor to see why.
icon = smooth_icon
if (!(flags_1 & NODECONSTRUCT_1))
var/static/list/tool_behaviors = list(
TOOL_SCREWDRIVER = list(
SCREENTIP_CONTEXT_RMB = "Disassemble",
),
TOOL_WRENCH = list(
SCREENTIP_CONTEXT_RMB = "Deconstruct",
),
)
AddElement(/datum/element/contextual_screentip_tools, tool_behaviors)
/obj/structure/table/wood/fancy/black
icon_state = "fancy_table_black"
buildstack = /obj/item/stack/tile/carpet/black
@@ -704,7 +717,7 @@
. = !density
if(istype(caller))
. = . || (caller.pass_flags & PASSTABLE)
/obj/structure/rack/MouseDrop_T(obj/O, mob/user)
. = ..()
if ((!( istype(O, /obj/item) ) || user.get_active_held_item() != O))