Merge pull request #10242 from Ghommie/Ghommie-cit483

Ports "Refactors can_see_reagents"
This commit is contained in:
Lin
2019-12-25 19:03:42 +00:00
committed by GitHub
11 changed files with 43 additions and 29 deletions
-1
View File
@@ -22,7 +22,6 @@
var/cooldown = 0
var/obj/item/flashlight/F = null
var/can_flashlight = 0
var/scan_reagents = 0 //Can the wearer see reagents while it's equipped?
var/blocks_shove_knockdown = FALSE //Whether wearing the clothing item blocks the ability for shove to knock down.
+3 -3
View File
@@ -99,7 +99,7 @@
desc = "A pair of snazzy goggles used to protect against chemical spills. Fitted with an analyzer for scanning items and reagents."
icon_state = "purple"
item_state = "glasses"
scan_reagents = TRUE //You can see reagents while wearing science goggles
clothing_flags = SCAN_REAGENTS //You can see reagents while wearing science goggles
actions_types = list(/datum/action/item_action/toggle_research_scanner)
glass_colour_type = /datum/client_colour/glass_colour/purple
resistance_flags = ACID_PROOF
@@ -203,7 +203,7 @@
/obj/item/clothing/glasses/sunglasses/reagent
name = "beer goggles"
desc = "A pair of sunglasses outfitted with apparatus to scan reagents."
scan_reagents = TRUE
clothing_flags = SCAN_REAGENTS
/obj/item/clothing/glasses/sunglasses/garb
name = "black gar glasses"
@@ -405,7 +405,7 @@
item_state = "godeye"
vision_flags = SEE_TURFS|SEE_MOBS|SEE_OBJS
darkness_view = 8
scan_reagents = TRUE
clothing_flags = SCAN_REAGENTS
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
resistance_flags = LAVA_PROOF | FIRE_PROOF
+3 -3
View File
@@ -445,7 +445,7 @@
flash_protect = 0
armor = list("melee" = 30, "bullet" = 5, "laser" = 10, "energy" = 5, "bomb" = 10, "bio" = 100, "rad" = 60, "fire" = 60, "acid" = 75)
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR
scan_reagents = TRUE
clothing_flags = STOPSPRESSUREDAMAGE | THICKMATERIAL | BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS | SCAN_REAGENTS
/obj/item/clothing/suit/space/hardsuit/medical
icon_state = "hardsuit-medical"
@@ -467,7 +467,7 @@
max_heat_protection_temperature = FIRE_SUIT_MAX_TEMP_PROTECT
armor = list("melee" = 30, "bullet" = 5, "laser" = 10, "energy" = 5, "bomb" = 100, "bio" = 100, "rad" = 60, "fire" = 60, "acid" = 80)
var/obj/machinery/doppler_array/integrated/bomb_radar
scan_reagents = TRUE
clothing_flags = STOPSPRESSUREDAMAGE | THICKMATERIAL | BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS | SCAN_REAGENTS
actions_types = list(/datum/action/item_action/toggle_helmet_light, /datum/action/item_action/toggle_research_scanner)
/obj/item/clothing/head/helmet/space/hardsuit/rd/Initialize()
@@ -638,7 +638,7 @@
armor = list("melee" = 20, "bullet" = 15, "laser" = 15, "energy" = 45, "bomb" = 100, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 100)
item_color = "ancient"
brightness_on = 16
scan_reagents = TRUE
clothing_flags = STOPSPRESSUREDAMAGE | THICKMATERIAL | BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS | SCAN_REAGENTS
flash_protect = 5 //We will not be flash by bombs
tint = 1
var/obj/machinery/doppler_array/integrated/bomb_radar
+11
View File
@@ -977,3 +977,14 @@
if(combatmode)
toggle_combat_mode(TRUE, TRUE)
return ..()
/mob/living/carbon/can_see_reagents()
. = ..()
if(.) //No need to run through all of this if it's already true.
return
if(isclothing(head))
var/obj/item/clothing/H = head
if(H.clothing_flags & SCAN_REAGENTS)
return TRUE
if(isclothing(wear_mask) && (wear_mask.clothing_flags & SCAN_REAGENTS))
return TRUE
@@ -117,7 +117,8 @@
/mob/living/carbon/human/can_use_guns(obj/item/G)
. = ..()
if(!.)
return
if(G.trigger_guard == TRIGGER_GUARD_NORMAL)
if(HAS_TRAIT(src, TRAIT_CHUNKYFINGERS))
to_chat(src, "<span class='warning'>Your meaty finger is much too large for the trigger guard!</span>")
@@ -126,7 +127,13 @@
to_chat(src, "<span class='warning'>Your fingers don't fit in the trigger guard!</span>")
return FALSE
return .
/mob/living/carbon/human/can_see_reagents()
. = ..()
if(.) //No need to run through all of this if it's already true.
return
if(isclothing(glasses) && (glasses.clothing_flags & SCAN_REAGENTS))
return TRUE
/*
/mob/living/carbon/human/transfer_blood_dna(list/blood_dna)
..()
@@ -275,6 +275,15 @@
/mob/living/simple_animal/drone/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0, illusion = 0, stun = TRUE)
return 0 //So they don't die trying to fix wiring
/mob/living/simple_animal/drone/can_see_reagents()
. = ..()
if(.)
return
if(isclothing(head))
var/obj/item/clothing/H = head
if(H.clothing_flags & SCAN_REAGENTS)
return TRUE
/mob/living/simple_animal/drone/generate_mob_holder()
var/obj/item/clothing/head/mob_holder/holder = new(get_turf(src), src, "[visualAppearence]_hat", null, null, null, TRUE)
return holder
-20
View File
@@ -811,26 +811,6 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
/mob/proc/can_interact_with(atom/A)
return IsAdminGhost(src) || Adjacent(A)
//Can the mob see reagents inside of containers?
/mob/proc/can_see_reagents()
if(stat == DEAD) //Ghosts and such can always see reagents
return 1
if(has_unlimited_silicon_privilege) //Silicons can automatically view reagents
return 1
if(ishuman(src))
var/mob/living/carbon/human/H = src
if(H.head && istype(H.head, /obj/item/clothing))
var/obj/item/clothing/CL = H.head
if(CL.scan_reagents)
return 1
if(H.wear_mask && H.wear_mask.scan_reagents)
return 1
if(H.glasses && istype(H.glasses, /obj/item/clothing))
var/obj/item/clothing/CL = H.glasses
if(CL.scan_reagents)
return 1
return 0
//Can the mob use Topic to interact with machines
/mob/proc/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
return
+4
View File
@@ -532,3 +532,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
if(!held_item)
return
return held_item.GetID()
//Can the mob see reagents inside of containers?
/mob/proc/can_see_reagents()
return stat == DEAD || has_unlimited_silicon_privilege //Dead guys and silicons can always see reagents