mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-31 00:49:06 +01:00
Split examine verb and function, and improve it (#17251)
* Split examine verb and function, and include adjacency and distance checking in examine function * Fix various issues * Update code/modules/mob/examinations.dm Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com> * Add required define vars * Update code/game/objects/items/stacks/wrap.dm Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com> --------- Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com>
This commit is contained in:
co-authored by
SleepyGemmy
parent
39228d3a2c
commit
ce5ac79e3c
@@ -62,7 +62,7 @@
|
||||
return (user.Adjacent(T) && user.get_active_hand() == src && !user.stat && !user.restrained())
|
||||
|
||||
/obj/item/rfd/examine(var/mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(loc == user)
|
||||
to_chat(user, "It currently holds [stored_matter]/30 matter units.")
|
||||
|
||||
@@ -539,7 +539,7 @@
|
||||
return
|
||||
|
||||
/obj/item/rfd/transformer/examine(var/mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(loc == user)
|
||||
if(malftransformermade)
|
||||
to_chat(user, "There is already a transformer machine made!")
|
||||
|
||||
@@ -127,8 +127,9 @@ var/const/NO_EMAG_ACT = -50
|
||||
/obj/item/card/id/Destroy()
|
||||
return ..()
|
||||
|
||||
/obj/item/card/id/examine(mob/user)
|
||||
if (..(user, 1))
|
||||
/obj/item/card/id/examine(mob/user, distance)
|
||||
. = ..()
|
||||
if (distance <= 1)
|
||||
show(user)
|
||||
|
||||
/obj/item/card/id/on_slotmove(var/mob/living/user, slot)
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
unset_registered_user(registered_user)
|
||||
return ..()
|
||||
|
||||
/obj/item/card/id/syndicate/examine(mob/user)
|
||||
..()
|
||||
if(Adjacent(user))
|
||||
/obj/item/card/id/syndicate/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if(is_adjacent)
|
||||
if(user == registered_user)
|
||||
to_chat(user, FONT_SMALL(SPAN_NOTICE("It is at [charge]/[initial(charge)] charge.")))
|
||||
|
||||
|
||||
@@ -994,7 +994,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
|
||||
/obj/item/clothing/mask/smokable/cigarette/rolled/examine(mob/user)
|
||||
. = ..()
|
||||
if(. && filter)
|
||||
if(filter)
|
||||
to_chat(user, "Capped off one end with a filter.")
|
||||
|
||||
/obj/item/clothing/mask/smokable/cigarette/rolled/update_icon()
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
var/contain_parts = 1
|
||||
|
||||
/obj/item/circuitboard/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(build_path)
|
||||
var/obj/machine = new build_path // instantiate to get the name and desc
|
||||
to_chat(user, FONT_SMALL(SPAN_NOTICE("This circuitboard will build a <b>[capitalize_first_letters(machine.name)]</b>: [machine.desc]")))
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
return
|
||||
|
||||
/obj/item/circuitboard/unary_atmos/examine()
|
||||
..()
|
||||
. = ..()
|
||||
to_chat(usr, "The jumper is connecting the [dir2text(machine_dir)] pins.")
|
||||
|
||||
/obj/item/circuitboard/unary_atmos/construct(var/obj/machinery/atmospherics/unary/U)
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
..()
|
||||
|
||||
/obj/item/cloaking_device/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if (!cell)
|
||||
to_chat(user, "It needs a power cell to function.")
|
||||
else
|
||||
|
||||
@@ -55,8 +55,9 @@
|
||||
to_chat(user,"<span class='notice'>\The reagents inside [src] are already secured!</span>")
|
||||
return
|
||||
|
||||
/obj/item/reagent_containers/extinguisher_refill/examine(var/mob/user) //Copied from inhalers.
|
||||
if(!..(user, 2))
|
||||
/obj/item/reagent_containers/extinguisher_refill/examine(mob/user, distance) //Copied from inhalers.
|
||||
. = ..()
|
||||
if(!distance <= 2)
|
||||
return
|
||||
|
||||
if(is_open_container())
|
||||
@@ -126,8 +127,9 @@
|
||||
reagents.add_reagent(/singleton/reagent/toxin/fertilizer/monoammoniumphosphate, max_water)
|
||||
..()
|
||||
|
||||
/obj/item/extinguisher/examine(mob/user)
|
||||
if(..(user, 0))
|
||||
/obj/item/extinguisher/examine(mob/user, distance)
|
||||
. = ..()
|
||||
if(distance <= 0)
|
||||
to_chat(user,"\The [src] contains [src.reagents.total_volume] units of reagents.")
|
||||
to_chat(user,"The safety is [safety ? "on" : "off"].")
|
||||
return
|
||||
|
||||
@@ -35,9 +35,9 @@
|
||||
welding_tool.forceMove(src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/flamethrower/examine(mob/user)
|
||||
..()
|
||||
if(Adjacent(user))
|
||||
/obj/item/flamethrower/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if(is_adjacent)
|
||||
if(gas_tank)
|
||||
to_chat(user, SPAN_NOTICE("Release pressure is set to [throw_amount] kPa. The tank has about [round(gas_tank.air_contents.return_pressure(), 10)] kPa left in it."))
|
||||
else
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
to_chat(user, "<span class='warning'>\The [W] is empty.</span>")
|
||||
|
||||
/obj/item/grenade/chem_grenade/examine(mob/user)
|
||||
..(user)
|
||||
. = ..()
|
||||
if(detonator)
|
||||
to_chat(user, "With attached [detonator.name]")
|
||||
|
||||
|
||||
@@ -30,8 +30,9 @@
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/item/grenade/examine(mob/user)
|
||||
if(..(user, 0))
|
||||
/obj/item/grenade/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if(distance <= 0)
|
||||
if(det_time > 1)
|
||||
to_chat(user, "The timer is set to [det_time/10] seconds.")
|
||||
return
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/obj/item/implant/integrated_circuit/emp_act(severity)
|
||||
IC.emp_act(severity)
|
||||
|
||||
/obj/item/implant/integrated_circuit/examine(mob/user)
|
||||
IC.examine(user)
|
||||
/obj/item/implant/integrated_circuit/examine(mob/user, distance, is_adjacent)
|
||||
IC.examine(user, distance, is_adjacent)
|
||||
|
||||
/obj/item/implant/integrated_circuit/attackby(var/obj/item/O, var/mob/user)
|
||||
if(O.iscrowbar() || istype(O, /obj/item/device/integrated_electronics) || istype(O, /obj/item/integrated_circuit) || O.isscrewdriver() || istype(O, /obj/item/cell/device) )
|
||||
|
||||
@@ -264,7 +264,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/material/twohanded/spear/examine(mob/user)
|
||||
..(user)
|
||||
. = ..()
|
||||
if(explosive)
|
||||
to_chat(user, "It has \the [explosive] strapped to it.")
|
||||
|
||||
@@ -472,8 +472,9 @@
|
||||
|
||||
RemoveFuel(FuelToRemove)
|
||||
|
||||
/obj/item/material/twohanded/chainsaw/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
/obj/item/material/twohanded/chainsaw/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if(distance <= 1)
|
||||
to_chat(user, "A heavy-duty chainsaw meant for cutting wood. Contains <b>[round(REAGENT_VOLUME(reagents, fuel_type))]</b> unit\s of fuel.")
|
||||
if(powered)
|
||||
to_chat(user, SPAN_NOTICE("It is currently powered on."))
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
reagents.add_reagent(refill_reagent, refill_rate)
|
||||
|
||||
/obj/item/mop/advanced/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
to_chat(user, SPAN_NOTICE("\The condenser switch is set to <b>[refill_enabled ? "ON" : "OFF"]</b>."))
|
||||
|
||||
/obj/item/mop/advanced/Destroy()
|
||||
|
||||
@@ -31,9 +31,9 @@ var/list/tape_roll_applications = list()
|
||||
var/crumpled = 0
|
||||
var/icon_base
|
||||
|
||||
/obj/item/tape/examine(mob/user, distance)
|
||||
/obj/item/tape/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if(LAZYLEN(crumplers) && Adjacent(user))
|
||||
if(LAZYLEN(crumplers) && is_adjacent)
|
||||
to_chat(user, SPAN_WARNING("\The [initial(name)] has been crumpled by [english_list(crumplers)]."))
|
||||
|
||||
/obj/item/taperoll/police
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
..()
|
||||
|
||||
/obj/item/storage/box/examine(var/mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if (health < maxHealth)
|
||||
if (health >= (maxHealth * 0.5))
|
||||
to_chat(user, SPAN_WARNING("It is slightly torn."))
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
. = ..()
|
||||
|
||||
/obj/item/storage/box/fancy/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(!icon_type || !storage_type)
|
||||
return
|
||||
if(contents.len <= 0)
|
||||
|
||||
@@ -28,8 +28,9 @@
|
||||
max_storage_space = 16
|
||||
use_sound = 'sound/items/storage/briefcase.ogg'
|
||||
|
||||
/obj/item/storage/secure/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
/obj/item/storage/secure/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if(distance <= 1)
|
||||
to_chat(user, text("The service panel is [src.open ? "open" : "closed"]."))
|
||||
|
||||
/obj/item/storage/secure/attackby(obj/item/W as obj, mob/user as mob)
|
||||
|
||||
@@ -116,10 +116,10 @@
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/wallet/examine(mob/user)
|
||||
/obj/item/storage/wallet/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
var/obj/item/card/id/id = GetID()
|
||||
if(istype(id) && Adjacent(user))
|
||||
if(istype(id) && is_adjacent)
|
||||
id.show(user)
|
||||
|
||||
/obj/item/storage/wallet/random/fill()
|
||||
|
||||
@@ -59,10 +59,10 @@
|
||||
else
|
||||
set_light(0)
|
||||
|
||||
/obj/item/melee/baton/examine(mob/user)
|
||||
if(!..(user, 1))
|
||||
/obj/item/melee/baton/examine(mob/user, distance)
|
||||
. = ..()
|
||||
if(!distance <= 1)
|
||||
return
|
||||
|
||||
if(bcell)
|
||||
to_chat(user, "<span class='notice'>The baton is [round(bcell.percent())]% charged.</span>")
|
||||
else
|
||||
|
||||
@@ -75,8 +75,8 @@
|
||||
/obj/item/tank/air/adjust_initial_gas()
|
||||
air_contents.adjust_multi(GAS_OXYGEN, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD, GAS_NITROGEN, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD)
|
||||
|
||||
/obj/item/tank/air/examine(mob/user)
|
||||
if(..(user, 0) && air_contents.gas[GAS_OXYGEN] < 1 && loc==user)
|
||||
/obj/item/tank/air/examine(mob/user, distance, is_adjacent)
|
||||
if((distance <= 0) && air_contents.gas[GAS_OXYGEN] < 1 && loc==user)
|
||||
to_chat(user, "<span class='danger'>The meter on the [src.name] indicates you are almost out of air!</span>")
|
||||
|
||||
/*
|
||||
@@ -146,8 +146,8 @@
|
||||
/obj/item/tank/emergency_oxygen/adjust_initial_gas()
|
||||
air_contents.adjust_gas(GAS_OXYGEN, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||
|
||||
/obj/item/tank/emergency_oxygen/examine(mob/user)
|
||||
if(..(user, 0) && air_contents.gas[GAS_OXYGEN] < 0.2 && loc==user)
|
||||
/obj/item/tank/emergency_oxygen/examine(mob/user, distance, is_adjacent)
|
||||
if((distance <= 0) && air_contents.gas[GAS_OXYGEN] < 0.2 && loc==user)
|
||||
to_chat(user, text("<span class='danger'>The meter on the [src.name] indicates you are almost out of air!</span>"))
|
||||
|
||||
/obj/item/tank/emergency_oxygen/engi
|
||||
@@ -161,4 +161,4 @@
|
||||
icon_state = "emergency_double"
|
||||
item_state = "emergency_engi"
|
||||
gauge_icon = "indicator_emergency_double"
|
||||
volume = 10
|
||||
volume = 10
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/tank/examine(mob/user)
|
||||
. = ..(user, 0)
|
||||
if(.)
|
||||
/obj/item/tank/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if(distance <= 0)
|
||||
var/celsius_temperature = air_contents.temperature - T0C
|
||||
var/descriptive
|
||||
switch(celsius_temperature)
|
||||
|
||||
@@ -335,8 +335,9 @@
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
return ..()
|
||||
|
||||
/obj/item/weldingtool/examine(mob/user)
|
||||
if(..(user, 0))
|
||||
/obj/item/weldingtool/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if(distance <= 0)
|
||||
to_chat(user, text("[icon2html(src, user)] [] contains []/[] units of fuel!", src.name, get_fuel(),src.max_fuel ))
|
||||
|
||||
/obj/item/weldingtool/attackby(obj/item/W, mob/user)
|
||||
@@ -791,7 +792,7 @@
|
||||
|
||||
/obj/item/combitool/examine(var/mob/user)
|
||||
. = ..()
|
||||
if(. && tools.len)
|
||||
if(tools.len)
|
||||
to_chat(user, "It has the following fittings: <b>[english_list(tools)]</b>.")
|
||||
|
||||
/obj/item/combitool/iswrench()
|
||||
@@ -850,7 +851,7 @@
|
||||
|
||||
/obj/item/powerdrill/examine(var/mob/user)
|
||||
. = ..()
|
||||
if(. && tools.len)
|
||||
if(tools.len)
|
||||
to_chat(user, "It has the following fittings:")
|
||||
for(var/tool in tools)
|
||||
to_chat(user, "- [tool][tools[current_tool] == tool ? " (selected)" : ""]")
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
icon_state = "[icon_base][deployed]"
|
||||
|
||||
/obj/item/trap/animal/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(captured)
|
||||
var/datum/L = captured.resolve()
|
||||
if (L)
|
||||
|
||||
Reference in New Issue
Block a user