Adds examine boxes. (#18370)

* Adds examine boxes.

* lint

* what kind of dreams did you dream?

* unlimited

* midgardsormr

* sdsd

* fixes

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2024-02-11 21:58:20 +00:00
committed by GitHub
co-authored by Matt Atlas
parent d57c5e7c43
commit 4423d03f2f
296 changed files with 1317 additions and 1257 deletions
+4 -4
View File
@@ -78,10 +78,10 @@
if(spent_icon && !BB)
icon_state = spent_icon
/obj/item/ammo_casing/examine(mob/user)
/obj/item/ammo_casing/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if (!BB)
to_chat(user, "This one is spent.")
. += "This one is spent."
//Gun loading types
#define SINGLE_CASING 1 //The gun only accepts ammo_casings. ammo_magazines should never have this as their mag_type.
@@ -181,9 +181,9 @@
else
recyclable = FALSE
/obj/item/ammo_magazine/examine(mob/user)
/obj/item/ammo_magazine/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
to_chat(user, "There [(stored_ammo.len == 1)? "is" : "are"] [stored_ammo.len] round\s left!")
. += "There [(stored_ammo.len == 1)? "is" : "are"] [stored_ammo.len] round\s left!"
//magazine icon state caching (caching lists are in SSicon_cache)
@@ -27,10 +27,10 @@
add_ammo(C)
addtimer(CALLBACK(src, PROC_REF(check_ammo)), 5) // if we don't have any ammo in 5 deciseconds, we're an empty pile, which is worthless, so self-delete
/obj/item/ammo_pile/examine(mob/user, distance, is_adjacent)
/obj/item/ammo_pile/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(is_adjacent)
to_chat(user, SPAN_NOTICE("It contains [length(ammo)] rounds."))
. += SPAN_NOTICE("It contains [length(ammo)] rounds.")
/obj/item/ammo_pile/attack()
return
+6 -7
View File
@@ -664,24 +664,23 @@
suppressor = null
update_icon()
/obj/item/gun/examine(mob/user, distance, is_adjacent)
/obj/item/gun/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(distance > 1)
return
if(markings)
to_chat(user, SPAN_NOTICE("It has [markings] [markings == 1 ? "notch" : "notches"] carved into the stock."))
. += SPAN_NOTICE("It has [markings] [markings == 1 ? "notch" : "notches"] carved into the stock.")
if(needspin)
if(pin)
to_chat(user, "\The [pin] is installed in the trigger mechanism.")
. += "\The [pin] is installed in the trigger mechanism."
pin.examine_info(user) // Allows people to check the current firemode of their wireless-control firing pin. Returns nothing if there's no wireless-control firing pin.
else
to_chat(user, "It doesn't have a firing pin installed, and won't fire.")
. += "It doesn't have a firing pin installed, and won't fire."
if(firemodes.len > 1)
var/datum/firemode/current_mode = firemodes[sel_mode]
to_chat(user, "The fire selector is set to [current_mode.name].")
. += "The fire selector is set to [current_mode.name]."
if(has_safety)
to_chat(user, "The safety is [safety() ? "on" : "off"].")
return TRUE
. += "The safety is [safety() ? "on" : "off"]."
/obj/item/gun/proc/switch_firemodes()
if(!firemodes.len)
+2 -2
View File
@@ -34,11 +34,11 @@
if (spikes < max_spikes)
addtimer(CALLBACK(src, PROC_REF(regen_spike)), spike_gen_time, TIMER_UNIQUE)
/obj/item/gun/launcher/spikethrower/examine(mob/user, distance, is_adjacent)
/obj/item/gun/launcher/spikethrower/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(distance > 1)
return
to_chat(user, "It has [spikes] spike\s remaining.")
. += "It has [spikes] spike\s remaining."
/obj/item/gun/launcher/spikethrower/update_icon()
icon_state = "spikethrower[spikes]"
+2 -3
View File
@@ -227,13 +227,12 @@
if(recharger)
disconnect()
/obj/item/gun/energy/examine(mob/user, distance, is_adjacent)
/obj/item/gun/energy/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(distance > 1)
return
var/shots_remaining = round(power_supply.charge / charge_cost)
to_chat(user, "Has [shots_remaining] shot\s remaining.")
return
. += "It has [shots_remaining] shot\s remaining."
/obj/item/gun/energy/update_icon()
if(charge_meter && power_supply && power_supply.maxcharge)
@@ -21,13 +21,13 @@
charge_cost = 666.66 // 15 shots on a high cap cell
needspin = FALSE
/obj/item/gun/energy/plasmacutter/examine(mob/user, distance, is_adjacent)
/obj/item/gun/energy/plasmacutter/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(is_adjacent)
if(power_supply)
to_chat(user, FONT_SMALL(SPAN_NOTICE("It has a <b>[capitalize_first_letters(power_supply.name)]</b> installed as its power supply.")))
. += FONT_SMALL(SPAN_NOTICE("It has a <b>[capitalize_first_letters(power_supply.name)]</b> installed as its power supply."))
else
to_chat(user, FONT_SMALL(SPAN_WARNING("It has no power supply installed.")))
. += FONT_SMALL(SPAN_WARNING("It has no power supply installed."))
/obj/item/gun/energy/plasmacutter/attackby(obj/item/I, mob/user)
if(I.isscrewdriver())
@@ -30,19 +30,19 @@
var/named = 0
var/described = 0
/obj/item/gun/energy/laser/prototype/examine(mob/user, distance, is_adjacent)
. = ..(user)
/obj/item/gun/energy/laser/prototype/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(distance > 1)
return
if(gun_mods.len)
for(var/obj/item/laser_components/modifier/modifier in gun_mods)
to_chat(user, "You can see \the [modifier] attached.")
. += "You can see \a [modifier] attached."
if(capacitor)
to_chat(user, "You can see \the [capacitor] attached.")
. += "You can see \a [capacitor] attached."
if(focusing_lens)
to_chat(user, "You can see \the [focusing_lens] attached.")
. += "You can see \a [focusing_lens] attached."
if(modulator)
to_chat(user, "You can see \the [modulator] attached.")
. += "You can see \a [modulator] attached."
/obj/item/gun/energy/laser/prototype/attackby(var/obj/item/D, var/mob/user)
if(!D.isscrewdriver())
@@ -219,14 +219,19 @@
/obj/item/crossbowframe/update_icon()
icon_state = "crossbowframe[buildstate]"
/obj/item/crossbowframe/examine(mob/user)
/obj/item/crossbowframe/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
switch(buildstate)
if(1) to_chat(user, "It has a loose rod frame in place.")
if(2) to_chat(user, "It has a steel backbone welded in place.")
if(3) to_chat(user, "It has a steel backbone and a cell mount installed.")
if(4) to_chat(user, "It has a steel backbone, plastic limbs and a cell mount installed.")
if(5) to_chat(user, "It has a steel cable loosely strung across the limbs.")
if(1)
. += "It has a loose rod frame in place."
if(2)
. += "It has a steel backbone welded in place."
if(3)
. += "It has a steel backbone and a cell mount installed."
if(4)
. += "It has a steel backbone, plastic limbs and a cell mount installed."
if(5)
. += "It has a steel cable loosely strung across the limbs."
/obj/item/crossbowframe/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/stack/rods))
@@ -368,6 +373,6 @@
else
icon_state = "rxb"
/obj/item/gun/launcher/crossbow/RFD/examine(var/user)
/obj/item/gun/launcher/crossbow/RFD/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
to_chat(user, "It currently holds <b>[stored_matter]/[max_stored_matter]</b> matter-units.")
. += "It currently holds <b>[stored_matter]/[max_stored_matter]</b> matter-units."
@@ -43,12 +43,12 @@
to_chat(M, SPAN_WARNING("You pump [src], but the magazine is empty."))
update_icon()
/obj/item/gun/launcher/grenade/examine(mob/user, distance, is_adjacent)
/obj/item/gun/launcher/grenade/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(is_adjacent)
to_chat(user, SPAN_NOTICE("It has [get_ammo()] grenade\s remaining."))
. += SPAN_NOTICE("It has [get_ammo()] grenade\s remaining.")
if(chambered)
to_chat(user, SPAN_NOTICE("\A [chambered] is chambered."))
. += SPAN_NOTICE("\A [chambered] is chambered.")
/obj/item/gun/launcher/grenade/proc/load(obj/item/grenade/G, mob/user)
if(!can_load_grenade_type(G, user))
@@ -100,15 +100,15 @@
item_storage.remove_from_storage(launched, src)
return launched
/obj/item/gun/launcher/pneumatic/examine(mob/user, distance, is_adjacent)
/obj/item/gun/launcher/pneumatic/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(distance > 2)
return
to_chat(user, "The valve is dialed to [pressure_setting]%.")
. += "The valve is dialed to [pressure_setting]%."
if(tank)
to_chat(user, "The tank dial reads [tank.air_contents.return_pressure()] kPa.")
. += "The tank dial reads [tank.air_contents.return_pressure()] kPa."
else
to_chat(user, "Nothing is attached to the tank valve!")
. += "Nothing is attached to the tank valve!"
/obj/item/gun/launcher/pneumatic/update_release_force(obj/item/projectile)
if(tank)
@@ -152,14 +152,19 @@
/obj/item/cannonframe/update_icon()
icon_state = "pneumatic[buildstate]"
/obj/item/cannonframe/examine(mob/user)
/obj/item/cannonframe/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
switch(buildstate)
if(1) to_chat(user, "It has a pipe segment installed.")
if(2) to_chat(user, "It has a pipe segment welded in place.")
if(3) to_chat(user, "It has an outer chassis installed.")
if(4) to_chat(user, "It has an outer chassis welded in place.")
if(5) to_chat(user, "It has a transfer valve installed.")
if(1)
. += "It has a pipe segment installed."
if(2)
. += "It has a pipe segment welded in place."
if(3)
. += "It has an outer chassis installed."
if(4)
. += "It has an outer chassis welded in place."
if(5)
. += "It has a transfer valve installed."
/obj/item/cannonframe/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/pipe))
@@ -19,10 +19,10 @@
var/max_rockets = 1
var/list/rockets = new/list()
/obj/item/gun/launcher/rocket/examine(mob/user, distance, is_adjacent)
/obj/item/gun/launcher/rocket/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(is_adjacent)
to_chat(user, "<span class='notice'>[rockets.len] / [max_rockets] rockets.</span>")
. += "<span class='notice'>[rockets.len] / [max_rockets] rockets.</span>"
/obj/item/gun/launcher/rocket/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/ammo_casing/rocket))
+5 -5
View File
@@ -288,17 +288,17 @@
ammo_magazine = null
update_icon() //make sure to do this after unsetting ammo_magazine
/obj/item/gun/projectile/examine(mob/user, distance, is_adjacent)
/obj/item/gun/projectile/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(distance > 1)
return
if(jam_num)
to_chat(user, "<span class='warning'>It looks jammed.</span>")
. += "<span class='warning'>It looks jammed.</span>"
if(ammo_magazine)
to_chat(user, "It has \a [ammo_magazine] loaded.")
. += "It has \a [ammo_magazine] loaded."
if(suppressed)
to_chat(user, "It has a suppressor attached.")
to_chat(user, "Has [get_ammo()] round\s remaining.")
. += "It has a suppressor attached."
. += "Has [get_ammo()] round\s remaining."
return
/obj/item/gun/projectile/get_ammo()
@@ -404,12 +404,12 @@
else
icon_state = "carbine-empty"
/obj/item/gun/projectile/automatic/rifle/z8/examine(mob/user)
/obj/item/gun/projectile/automatic/rifle/z8/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(launcher.chambered)
to_chat(user, "\The [launcher] has \a [launcher.chambered] loaded.")
. += "\The [launcher] has \a [launcher.chambered] loaded."
else
to_chat(user, "\The [launcher] is empty.")
. += "\The [launcher] is empty."
/obj/item/gun/projectile/automatic/rifle/jingya
name = "burst rifle"
@@ -97,14 +97,14 @@
if(istype(dart))
fill_dart(dart)
/obj/item/gun/projectile/dartgun/examine(mob/user)
/obj/item/gun/projectile/dartgun/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if (beakers.len)
to_chat(user, "<span class='notice'>[src] contains:</span>")
. += "<span class='notice'>[src] contains:</span>"
for(var/obj/item/reagent_containers/glass/beaker/B in beakers)
for(var/_R in B.reagents.reagent_volumes)
var/singleton/reagent/R = GET_SINGLETON(_R)
to_chat(user, "<span class='notice'>[B.reagents.reagent_volumes[_R]] units of [R.name]</span>")
. += "<span class='notice'>[B.reagents.reagent_volumes[_R]] units of [R.name]</span>"
/obj/item/gun/projectile/dartgun/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/reagent_containers/glass))
@@ -52,14 +52,19 @@
else
..()
/obj/item/gun/projectile/shotgun/improvised/examine(mob/user)
/obj/item/gun/projectile/shotgun/improvised/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
switch(fail_chance)
if(1) to_chat(user, "All craftsmanship is of the highest quality.")
if(2 to 25) to_chat(user, "All craftsmanship is of high quality.")
if(26 to 50) to_chat(user, "All craftsmanship is of average quality.")
if(51 to 75) to_chat(user, "All craftsmanship is of low quality.")
if(100) to_chat(user, "All craftsmanship is of the lowest quality.")
if(1)
. += "All craftsmanship is of the highest quality."
if(2 to 25)
. += "All craftsmanship is of high quality."
if(26 to 50)
. += "All craftsmanship is of average quality."
if(51 to 75)
. += "All craftsmanship is of low quality."
if(100)
. += "All craftsmanship is of the lowest quality."
/obj/item/gun/projectile/shotgun/improvised/sawn
name = "sawn-off improvised shotgun"
@@ -89,12 +94,15 @@
/obj/item/receivergun/update_icon()
icon_state = "ishotgun[buildstate]"
/obj/item/receivergun/examine(mob/user)
/obj/item/receivergun/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
switch(buildstate)
if(1) to_chat(user, "It has a pipe segment installed.")
if(2) to_chat(user, "It has a stock installed.")
if(3) to_chat(user, "Its pieces are held together by tape roll.")
if(1)
. += "It has a pipe segment installed."
if(2)
. += "It has a stock installed."
if(3)
. += "Its pieces are held together by tape roll."
/obj/item/receivergun/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/pipe))
@@ -155,24 +163,32 @@
/obj/item/gun/projectile/improvised_handgun/loaded
magazine_type = /obj/item/ammo_magazine/c45m
/obj/item/gun/projectile/improvised_handgun/examine(mob/user)
/obj/item/gun/projectile/improvised_handgun/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
switch(jam_chance)
if(1) to_chat(user, "All craftsmanship is of the highest quality.")
if(2 to 25) to_chat(user, "All craftsmanship is of high quality.")
if(26 to 50) to_chat(user, "All craftsmanship is of average quality.")
if(51 to 75) to_chat(user, "All craftsmanship is of low quality.")
if(100) to_chat(user, "All craftsmanship is of the lowest quality.")
if(1)
. += "All craftsmanship is of the highest quality."
if(2 to 25)
. += "All craftsmanship is of high quality."
if(26 to 50)
. += "All craftsmanship is of average quality."
if(51 to 75)
. += "All craftsmanship is of low quality."
if(100)
. += "All craftsmanship is of the lowest quality."
/obj/item/stock/update_icon()
icon_state = "ipistol[buildstate]"
/obj/item/stock/examine(mob/user)
/obj/item/stock/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
switch(buildstate)
if(1) to_chat(user, "It is carved in the shape of a pistol handle.")
if(2) to_chat(user, "It has a receiver installed.")
if(3) to_chat(user, "It has a pipe installed.")
if(1)
. += "It is carved in the shape of a pistol handle."
if(2)
. += "It has a receiver installed."
if(3)
. += "It has a pipe installed."
/obj/item/stock/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/material/hatchet))
@@ -248,15 +248,15 @@
if(rand(1,max_shells) > loaded.len)
chamber_offset = rand(0,max_shells - loaded.len)
/obj/item/gun/projectile/revolver/lemat/examine(mob/user)
/obj/item/gun/projectile/revolver/lemat/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(secondary_loaded)
var/to_print
for(var/round in secondary_loaded)
to_print += round
to_chat(user, "\The [src] has a secondary barrel loaded with \a [to_print]")
. += "\The [src] has a secondary barrel loaded with \a [to_print]."
else
to_chat(user, "\The [src] has a secondary barrel that is empty.")
. += "\The [src] has a secondary barrel that is empty."
/obj/item/gun/projectile/revolver/adhomian
name = "adhomian service revolver"
@@ -99,17 +99,17 @@
ammo_magazine.stored_ammo -= AC
chambered = AC
/obj/item/gun/projectile/shotgun/pump/rifle/pipegun/examine(mob/user)
/obj/item/gun/projectile/shotgun/pump/rifle/pipegun/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
switch(jam_chance)
if(10 to 20)
to_chat(user, SPAN_NOTICE("\The [src] is starting to accumulate fouling. Might want to grab a rag."))
. += SPAN_NOTICE("\The [src] is starting to accumulate fouling. Might want to grab a rag.")
if(20 to 40)
to_chat(user, SPAN_WARNING("\The [src] looks reasonably fouled up. Maybe you should clean it with a rag."))
. += SPAN_WARNING("\The [src] looks reasonably fouled up. Maybe you should clean it with a rag.")
if(40 to 80)
to_chat(user, SPAN_WARNING("\The [src] is starting to look quite gunked up. You should clean it with a rag."))
. += SPAN_WARNING("\The [src] is starting to look quite gunked up. You should clean it with a rag.")
if(80 to INFINITY)
to_chat(user, SPAN_DANGER("\The [src] is completely fouled. You're going to be extremely lucky to get a shot off. Clean it with a rag."))
. += SPAN_DANGER("\The [src] is completely fouled. You're going to be extremely lucky to get a shot off. Clean it with a rag.")
/obj/item/gun/projectile/shotgun/pump/rifle/pipegun/attackby(obj/item/A, mob/user)
if(istype(A, /obj/item/reagent_containers/glass/rag))
@@ -273,7 +273,7 @@
fire_sound = 'sound/weapons/gunshot/gunshot_pistol.ogg'
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 2, TECH_ILLEGAL = 2)
/obj/item/gun/projectile/shotgun/foldable/cameragun/examine(mob/user, distance, ...)
/obj/item/gun/projectile/shotgun/foldable/cameragun/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(distance <= 1)
to_chat(user, SPAN_NOTICE("Upon closer inspection, this is not a camera at all, but a 9mm firearm concealed inside the shell of one, which can be deployed by pressing a button."))
. += SPAN_NOTICE("Upon closer inspection, this is not a camera at all, but a 9mm firearm concealed inside the shell of one, which can be deployed by pressing a button.")
@@ -44,11 +44,11 @@
var/criticality
repair_item = /obj/item/weldingtool
/obj/item/laser_components/modifier/examine(mob/user, distance, is_adjacent)
/obj/item/laser_components/modifier/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(distance <= 1)
if(malus > base_malus)
to_chat(user, "<span class='warning'>\The [src] appears damaged.</span>")
. += "<span class='warning'>\The [src] appears damaged.</span>"
/obj/item/laser_components/modifier/degrade(var/increment = 1)
if(increment)
@@ -85,10 +85,10 @@
return 1
return 0
/obj/item/laser_components/capacitor/examine(mob/user, distance, is_adjacent)
/obj/item/laser_components/capacitor/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(distance <= 1 && condition > 0)
to_chat(user, "<span class='warning'>\The [src] appears damaged.</span>")
. += "<span class='warning'>\The [src] appears damaged.</span>"
/obj/item/laser_components/capacitor/proc/small_fail(var/mob/user, var/obj/item/gun/energy/laser/prototype/prototype)
return
@@ -118,10 +118,10 @@
return 1
return 0
/obj/item/laser_components/focusing_lens/examine(mob/user, distance, is_adjacent)
/obj/item/laser_components/focusing_lens/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
if(distance <= 1 && condition > 0)
to_chat(user, "<span class='warning'>\The [src] appears damaged.</span>")
. += "<span class='warning'>\The [src] appears damaged.</span>"
/obj/item/laser_components/modulator
name = "laser modulator"