correct everything and some intention based checks

This commit is contained in:
SandPoot
2023-02-08 02:17:57 -03:00
parent ed06e686e1
commit 1b1154260c
10 changed files with 79 additions and 60 deletions
+4
View File
@@ -700,6 +700,10 @@
/obj/machinery/door/airlock/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
. = ..()
if(istype(held_item, /obj/item/stack/sheet/plasteel))
context[SCREENTIP_CONTEXT_LMB] = "Reinforce"
return CONTEXTUAL_SCREENTIP_SET
switch (held_item?.tool_behaviour)
if (TOOL_CROWBAR)
if (panel_open)
+1 -1
View File
@@ -58,7 +58,7 @@
/obj/machinery/door/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
. = ..()
if (isnull(held_item))
if (isnull(held_item) && !istype(src, /obj/machinery/door/firedoor)) // You cannot open/close with your hands
context[SCREENTIP_CONTEXT_LMB] = density ? "Open" : "Close"
return CONTEXTUAL_SCREENTIP_SET
+5 -15
View File
@@ -51,25 +51,16 @@
if (isnull(held_item))
if (density)
// This should be LMB/RMB one day
if (user.a_intent == INTENT_HARM)
context[SCREENTIP_CONTEXT_LMB] = "Knock"
else
context[SCREENTIP_CONTEXT_LMB] = "Bash"
context[SCREENTIP_CONTEXT_LMB] = "Knock"
return CONTEXTUAL_SCREENTIP_SET
else
return .
switch (held_item.tool_behaviour)
if (TOOL_CROWBAR)
if (density)
context[SCREENTIP_CONTEXT_LMB] = "Close"
else if (!welded)
context[SCREENTIP_CONTEXT_LMB] = "Hold open"
context[SCREENTIP_CONTEXT_RMB] = "Open permanently"
return CONTEXTUAL_SCREENTIP_SET
if(!welded)
context[SCREENTIP_CONTEXT_LMB] = density ? "Open" : "Close"
return CONTEXTUAL_SCREENTIP_SET
if (TOOL_WELDER)
context[SCREENTIP_CONTEXT_LMB] = welded ? "Unweld shut" : "Weld shut"
return CONTEXTUAL_SCREENTIP_SET
@@ -79,9 +70,8 @@
return CONTEXTUAL_SCREENTIP_SET
if (TOOL_SCREWDRIVER)
if (welded)
context[SCREENTIP_CONTEXT_LMB] = "Unlock bolts"
context[SCREENTIP_CONTEXT_LMB] = boltslocked ? "Unlock bolts" : "Lock bolts"
return CONTEXTUAL_SCREENTIP_SET
return .
/obj/machinery/door/firedoor/proc/CalculateAffectingAreas()
+6 -5
View File
@@ -51,11 +51,12 @@
myarea = get_base_area(src)
LAZYADD(myarea.firealarms, src)
AddElement( \
/datum/element/contextual_screentip_bare_hands, \
lmb_text = "Turn on", \
rmb_text = "Turn off", \
)
/obj/machinery/firealarm/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
. = ..()
if(isnull(held_item))
context[SCREENTIP_CONTEXT_LMB] = triggered ? "Turn off" : "Turn on"
return CONTEXTUAL_SCREENTIP_SET
/obj/machinery/firealarm/Destroy()
myarea.firereset(src)
@@ -572,6 +572,7 @@ GENETICS SCANNER
name = "first aid analyzer"
icon_state = "adv_spectrometer"
desc = "A prototype MeLo-Tech medical scanner used to diagnose injuries and recommend treatment for serious wounds, but offers no further insight into the patient's health. You hope the final version is less annoying to read!"
scanmode = SCANMODE_WOUND // Forces context to give correct tip.
var/next_encouragement
var/greedy
+6 -24
View File
@@ -30,24 +30,6 @@
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>"
@@ -183,19 +165,19 @@
context[SCREENTIP_CONTEXT_LMB] = "Attack"
else
if (turned_on)
context[SCREENTIP_CONTEXT_RMB] = context_living_rmb_active
context[SCREENTIP_CONTEXT_RMB] = "Knockdown"
if (user.a_intent == INTENT_HARM)
context[SCREENTIP_CONTEXT_LMB] = context_living_target_active_combat_mode
context[SCREENTIP_CONTEXT_LMB] = "Harmful stun"
else
context[SCREENTIP_CONTEXT_LMB] = context_living_target_active
context[SCREENTIP_CONTEXT_LMB] = "Stun"
else
context[SCREENTIP_CONTEXT_RMB] = context_living_rmb_inactive
context[SCREENTIP_CONTEXT_RMB] = "Knockdown" // DON'T TELL EM, PRANKED.
if (user.a_intent == INTENT_HARM)
context[SCREENTIP_CONTEXT_LMB] = context_living_target_inactive_combat_mode
context[SCREENTIP_CONTEXT_LMB] = "Attack" // It's fine i guess...?
else
context[SCREENTIP_CONTEXT_LMB] = context_living_target_inactive
context[SCREENTIP_CONTEXT_LMB] = "Stun" // STILL DO NOT DARE TELLING THEM
return CONTEXTUAL_SCREENTIP_SET
+12 -2
View File
@@ -37,6 +37,16 @@
smooth = SMOOTH_TRUE
canSmoothWith = list(/obj/structure/table, /obj/structure/table/reinforced, /obj/structure/table/greyscale)
/obj/structure/table/Initialize(mapload)
. = ..()
var/static/list/barehanded_interactions = list(
INTENT_HELP = "Slap",
INTENT_HARM = "Slam"
)
AddElement(/datum/element/contextual_screentip_bare_hands, rmb_text_combat_mode = barehanded_interactions)
/obj/structure/table/examine(mob/user)
. = ..()
. += deconstruction_hints(user)
@@ -493,11 +503,11 @@
if (!(flags_1 & NODECONSTRUCT_1))
var/static/list/tool_behaviors = list(
TOOL_SCREWDRIVER = list(
SCREENTIP_CONTEXT_RMB = "Disassemble",
SCREENTIP_CONTEXT_LMB = "Disassemble",
),
TOOL_WRENCH = list(
SCREENTIP_CONTEXT_RMB = "Deconstruct",
SCREENTIP_CONTEXT_LMB = "Deconstruct",
),
)