Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Skyrat-SS13/Skyrat-tg
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceLoveSs13 committed Aug 11, 2024
2 parents fad4fbb + ce4f3b3 commit 5c7c7aa
Show file tree
Hide file tree
Showing 11 changed files with 130 additions and 87 deletions.
2 changes: 1 addition & 1 deletion code/datums/ai/basic_mobs/basic_subtrees/flee_target.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/datum/ai_planning_subtree/flee_target/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick)
. = ..()
var/atom/flee_from = controller.blackboard[target_key]
if (controller.blackboard[BB_BASIC_MOB_STOP_FLEEING] || QDELETED(flee_from))
if(!should_flee(controller, flee_from))
return
if(!should_flee(controller, flee_from))
return
Expand Down
105 changes: 60 additions & 45 deletions code/game/machinery/scanner_gate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define SCANGATE_POD "pod"
#define SCANGATE_GOLEM "golem"
#define SCANGATE_ZOMBIE "zombie"
//SKYRAT EDIT BEGIN - MORE SCANNER GATE OPTIONS
//SKYRAT EDIT ADDITION BEGIN - MORE SCANNER GATE OPTIONS
#define SCANGATE_MAMMAL "mammal"
#define SCANGATE_VOX "vox"
#define SCANGATE_AQUATIC "aquatic"
Expand All @@ -30,9 +30,8 @@
#define SCANGATE_TESHARI "teshari"
#define SCANGATE_HEMOPHAGE "hemophage"
#define SCANGATE_SNAIL "snail"

#define SCANGATE_GENDER "Gender"
//SKYRAT EDIT END - MORE SCANNER GATE OPTIONS
//SKYRAT EDIT ADDITION END - MORE SCANNER GATE OPTIONS

/obj/machinery/scanner_gate
name = "scanner gate"
Expand Down Expand Up @@ -62,7 +61,7 @@
var/light_fail = FALSE
///Does the scanner ignore light_pass and light_fail for sending signals?
var/ignore_signals = FALSE
var/detect_gender = "male" //SKYRAT EDIT - MORE SCANNER GATE OPTIONS
var/detect_gender = "male" //SKYRAT EDIT ADDITION - MORE SCANNER GATE OPTIONS
///Modifier to the chance of scanner being false positive/negative
var/minus_false_beep = 0
///Base false positive/negative chance
Expand Down Expand Up @@ -113,13 +112,13 @@
return CONTEXTUAL_SCREENTIP_SET


/obj/machinery/scanner_gate/proc/on_entered(datum/source, atom/movable/AM)
/obj/machinery/scanner_gate/proc/on_entered(datum/source, atom/movable/thing)
SIGNAL_HANDLER
INVOKE_ASYNC(src, PROC_REF(auto_scan), AM)
INVOKE_ASYNC(src, PROC_REF(auto_scan), thing)

/obj/machinery/scanner_gate/proc/auto_scan(atom/movable/AM)
if(!(machine_stat & (BROKEN|NOPOWER)) && isliving(AM) & (!panel_open))
perform_scan(AM)
/obj/machinery/scanner_gate/proc/auto_scan(atom/movable/thing)
if(!(machine_stat & (BROKEN|NOPOWER)) && anchored && !panel_open)
perform_scan(thing)

/obj/machinery/scanner_gate/proc/set_scanline(type, duration)
cut_overlays()
Expand All @@ -141,25 +140,25 @@
return ITEM_INTERACT_SUCCESS
return NONE

/obj/machinery/scanner_gate/attackby(obj/item/W, mob/user, params)
var/obj/item/card/id/card = W.GetID()
/obj/machinery/scanner_gate/attackby(obj/item/attacking_item, mob/user, params)
var/obj/item/card/id/card = attacking_item.GetID()
if(card)
if(locked)
if(allowed(user))
locked = FALSE
req_access = list()
to_chat(user, span_notice("You unlock [src]."))
else if(!(obj_flags & EMAGGED))
to_chat(user, span_notice("You lock [src] with [W]."))
var/list/access = W.GetAccess()
to_chat(user, span_notice("You lock [src] with [attacking_item]."))
var/list/access = attacking_item.GetAccess()
req_access = access
locked = TRUE
else
to_chat(user, span_warning("You try to lock [src] with [W], but nothing happens."))
to_chat(user, span_warning("You try to lock [src] with [attacking_item], but nothing happens."))
else
if(!locked && default_deconstruction_screwdriver(user, "[initial(icon_state)]_open", initial(icon_state), W))
if(!locked && default_deconstruction_screwdriver(user, "[initial(icon_state)]_open", initial(icon_state), attacking_item))
return
if(panel_open && is_wire_tool(W))
if(panel_open && is_wire_tool(attacking_item))
wires.interact(user)
return ..()

Expand Down Expand Up @@ -190,34 +189,36 @@
balloon_alert(user, "id checker disabled")
return TRUE

/obj/machinery/scanner_gate/proc/perform_scan(mob/living/M)
/obj/machinery/scanner_gate/proc/perform_scan(atom/movable/thing)
var/beep = FALSE
var/color = null
var/detected_thing = null
switch(scangate_mode)
if(SCANGATE_NONE)
return
if(SCANGATE_WANTED)
if(ishuman(M))
if(ishuman(thing))
detected_thing = "Warrant"
var/mob/living/carbon/human/H = M
var/perpname = H.get_face_name(H.get_id_name())
var/mob/living/carbon/human/scanned_human = thing
var/perpname = scanned_human.get_face_name(scanned_human.get_id_name())
var/datum/record/crew/target = find_record(perpname)
if(!target || (target.wanted_status == WANTED_ARREST))
beep = TRUE
if(SCANGATE_MINDSHIELD)
detected_thing = "Mindshield"
if(HAS_TRAIT(M, TRAIT_MINDSHIELD))
beep = TRUE
if(ishuman(thing))
var/mob/living/carbon/human/scanned_human = thing
if(HAS_TRAIT(scanned_human, TRAIT_MINDSHIELD))
beep = TRUE
if(SCANGATE_DISEASE)
detected_thing = "[disease_threshold] infection"
if(iscarbon(M))
var/mob/living/carbon/C = M
if(get_disease_severity_value(C.check_virus()) >= get_disease_severity_value(disease_threshold))
if(iscarbon(thing))
var/mob/living/carbon/scanned_carbon = thing
if(get_disease_severity_value(scanned_carbon.check_virus()) >= get_disease_severity_value(disease_threshold))
beep = TRUE
if(SCANGATE_SPECIES)
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(ishuman(thing))
var/mob/living/carbon/human/scanned_human = thing
var/datum/species/scan_species = /datum/species/human
switch(detect_species)
if(SCANGATE_LIZARD)
Expand Down Expand Up @@ -273,37 +274,51 @@
if(SCANGATE_SNAIL)
scan_species = /datum/species/snail
//SKYRAT EDIT END - MORE SCANNER GATE OPTIONS
if(is_species(H, scan_species))
if(is_species(scanned_human, scan_species))
beep = TRUE
if(detect_species == SCANGATE_ZOMBIE) //Can detect dormant zombies
detected_thing = "Romerol infection"
if(H.get_organ_slot(ORGAN_SLOT_ZOMBIE))
if(scanned_human.get_organ_slot(ORGAN_SLOT_ZOMBIE))
beep = TRUE
if(SCANGATE_GUNS)
for(var/I in M.get_contents())
detected_thing = "Weapons"
if(isgun(I))
beep = TRUE
break
detected_thing = "Weapons"
if(isgun(thing))
beep = TRUE
else if(ishuman(thing))
var/mob/living/carbon/human/scanned_human = thing
var/obj/item/card/id/idcard = scanned_human.get_idcard(hand_first = FALSE)
for(var/obj/item/scanned_item in scanned_human.get_all_contents_skipping_traits(TRAIT_CONTRABAND_BLOCKER))
if(isgun(scanned_item))
if((!HAS_TRAIT(scanned_human, TRAIT_MINDSHIELD)) && (isnull(idcard) || !(ACCESS_WEAPONS in idcard.access))) // mindshield or ID card with weapons access, like bartender
beep = TRUE
break
say("[detected_thing] detection bypassed.")
break
else
for(var/obj/item/content in thing.get_all_contents_skipping_traits(TRAIT_CONTRABAND_BLOCKER))
if(isgun(content))
beep = TRUE
break
if(SCANGATE_NUTRITION)
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.nutrition <= detect_nutrition && detect_nutrition == NUTRITION_LEVEL_STARVING)
if(ishuman(thing))
var/mob/living/carbon/human/scanned_human = thing
if(scanned_human.nutrition <= detect_nutrition && detect_nutrition == NUTRITION_LEVEL_STARVING)
beep = TRUE
detected_thing = "Starvation"
if(H.nutrition >= detect_nutrition && detect_nutrition == NUTRITION_LEVEL_FAT)
if(scanned_human.nutrition >= detect_nutrition && detect_nutrition == NUTRITION_LEVEL_FAT)
beep = TRUE
detected_thing = "Obesity"
//SKYRAT EDIT BEGIN - MORE SCANNER GATE OPTIONS
if(SCANGATE_GENDER)
if(ishuman(M))
var/mob/living/carbon/human/scanned_human = M
detected_thing = detect_gender
if(ishuman(thing))
var/mob/living/carbon/human/scanned_human = thing
if((scanned_human.gender in list("male", "female"))) //funny thing: nb people will always get by the scan B)
if(scanned_human.gender == detect_gender)
beep = TRUE
//SKYRAT EDIT END - MORE SCANNER GATE OPTIONS
if(SCANGATE_CONTRABAND)
for(var/obj/item/content in M.get_all_contents_skipping_traits(TRAIT_CONTRABAND_BLOCKER))
for(var/obj/item/content in thing.get_all_contents_skipping_traits(TRAIT_CONTRABAND_BLOCKER))
detected_thing = "Contraband"
if(content.is_contraband())
beep = TRUE
Expand All @@ -319,18 +334,18 @@

if(beep)
alarm_beep(detected_thing)
SEND_SIGNAL(src, COMSIG_SCANGATE_PASS_TRIGGER, M)
SEND_SIGNAL(src, COMSIG_SCANGATE_PASS_TRIGGER, thing)
if(!ignore_signals)
color = wires.get_color_of_wire(WIRE_ACCEPT)
var/obj/item/assembly/assembly = wires.get_attached(color)
assembly?.activate()
else
SEND_SIGNAL(src, COMSIG_SCANGATE_PASS_NO_TRIGGER, M)
SEND_SIGNAL(src, COMSIG_SCANGATE_PASS_NO_TRIGGER, thing)
if(!ignore_signals)
color = wires.get_color_of_wire(WIRE_DENY)
var/obj/item/assembly/assembly = wires.get_attached(color)
assembly?.activate()
set_scanline("scanning", 10)
set_scanline("scanning", 1 SECONDS)

use_energy(active_power_usage)

Expand All @@ -342,7 +357,7 @@
say("[detected_thing][reverse ? " not " : " "]detected!!")

COOLDOWN_START(src, next_beep, 2 SECONDS)
playsound(src, 'sound/machines/scanbuzz.ogg', 100, FALSE)
playsound(source = src, soundin = 'sound/machines/scanbuzz.ogg', vol = 30, vary = FALSE, extrarange = MEDIUM_RANGE_SOUND_EXTRARANGE, falloff_distance = 4)
set_scanline("alarm", 2 SECONDS)

/obj/machinery/scanner_gate/can_interact(mob/user)
Expand Down
16 changes: 12 additions & 4 deletions code/game/objects/items/tools/weldingtool.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,30 @@
if(user.combat_mode)
return NONE

return try_heal_loop(interacting_with, user)

/obj/item/weldingtool/proc/try_heal_loop(atom/interacting_with, mob/living/user, repeating = FALSE)
var/mob/living/carbon/human/attacked_humanoid = interacting_with
var/obj/item/bodypart/affecting = attacked_humanoid.get_bodypart(check_zone(user.zone_selected))
if(isnull(affecting) || !IS_ROBOTIC_LIMB(affecting))
return NONE

var/use_delay = 1 SECONDS // SKYRAT EDIT: ORIGINAL 0
if (!affecting.get_damage())
return

user.visible_message(span_notice("[user] starts to fix some of the dents on [attacked_humanoid == user ? user.p_their() : "[attacked_humanoid]'s"] [affecting.name]."),
span_notice("You start fixing some of the dents on [attacked_humanoid == user ? "your" : "[attacked_humanoid]'s"] [affecting.name]."))
var/use_delay = 1 SECONDS // SKYRAT EDIT - original repeating ? 1 SECONDS : 0
if(user == attacked_humanoid)
user.visible_message(span_notice("[user] starts to fix some of the dents on [attacked_humanoid]'s [affecting.name]."),
span_notice("You start fixing some of the dents on [attacked_humanoid == user ? "your" : "[attacked_humanoid]'s"] [affecting.name]."))
use_delay = 5 SECONDS

if(!use_tool(attacked_humanoid, user, use_delay, volume=50, amount=1))
return ITEM_INTERACT_BLOCKING

attacked_humanoid.item_heal(user, brute_heal = 15, burn_heal = 0, heal_message_brute = "dents", heal_message_burn = "burnt wires", required_bodytype = BODYTYPE_ROBOTIC)
if (!attacked_humanoid.item_heal(user, brute_heal = 15, burn_heal = 0, heal_message_brute = "dents", heal_message_burn = "burnt wires", required_bodytype = BODYTYPE_ROBOTIC))
return ITEM_INTERACT_BLOCKING

INVOKE_ASYNC(src, PROC_REF(try_heal_loop), interacting_with, user, TRUE)
return ITEM_INTERACT_SUCCESS

/obj/item/weldingtool/afterattack(atom/target, mob/user, click_parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@

/datum/ai_planning_subtree/make_carp_rift/aggressive_teleport/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick)
var/atom/movable/target = controller.blackboard[BB_BASIC_MOB_CURRENT_TARGET]
if(QDELETED(target) || !controller.blackboard[BB_CARPS_FEAR_FISHERMAN] || !HAS_TRAIT(target, TRAIT_SCARY_FISHERMAN))
return ..()
if (controller.blackboard[BB_BASIC_MOB_STOP_FLEEING])
if(!QDELETED(target) && controller.blackboard[BB_CARPS_FEAR_FISHERMAN] && HAS_TRAIT(target, TRAIT_SCARY_FISHERMAN))
return
return ..()

Expand Down
56 changes: 36 additions & 20 deletions code/modules/power/cable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -565,28 +565,44 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri
// General procedures
///////////////////////////////////
//you can use wires to heal robotics
/obj/item/stack/cable_coil/attack(mob/living/carbon/human/H, mob/user)
if(!istype(H))
return ..()

var/obj/item/bodypart/affecting = H.get_bodypart(check_zone(user.zone_selected))
if(affecting && IS_ROBOTIC_LIMB(affecting))
if(user == H)
user.visible_message(span_notice("[user] starts to fix some of the wires in [H]'s [affecting.name]."), span_notice("You start fixing some of the wires in [H == user ? "your" : "[H]'s"] [affecting.name]."))
/* SKYRAT EDIT START - ORIGINAL:
if(!do_after(user, 5 SECONDS, H))
return
*/
// SKYRAT EDIT CHANGE START
if(!do_after(user, (user == H ? self_delay : other_delay)))
return
// SKYRAT EDIT CHANGE END
if(H.item_heal(user, 0, 15, "dents", "burnt wires", BODYTYPE_ROBOTIC))
user.visible_message(span_green("[user] fixes some of the wires in to [H]'s [affecting.name]."), span_green("You fix some of the wires in [H == user ? "your" : "[H]'s"] [affecting.name].")) // SKYRAT EDIT ADD
use(1)
/obj/item/stack/cable_coil/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
if(!ishuman(interacting_with))
return NONE

if(user.combat_mode)
return NONE

return try_heal_loop(interacting_with, user)

/obj/item/stack/cable_coil/proc/try_heal_loop(atom/interacting_with, mob/living/user, repeating = FALSE)
var/mob/living/carbon/human/attacked_humanoid = interacting_with
var/obj/item/bodypart/affecting = attacked_humanoid.get_bodypart(check_zone(user.zone_selected))
if(isnull(affecting) || !IS_ROBOTIC_LIMB(affecting))
return NONE

if (!affecting.get_damage())
return

user.visible_message(span_notice("[user] starts to fix some of the wires in [attacked_humanoid == user ? user.p_their() : "[attacked_humanoid]'s"] [affecting.name]."),
span_notice("You start fixing some of the wires in [attacked_humanoid == user ? "your" : "[attacked_humanoid]'s"] [affecting.name]."))

var/use_delay = repeating ? 1 SECONDS : 0
if(user == attacked_humanoid)
use_delay = self_delay // SKYRAT EDIT CHANGE - ORIGINAL: use_delay = 5 SECONDS
// SKYRAT EDIT ADDITION START
else
return ..()
use_delay = other_delay
// SKYRAT EDIT ADDITION END

if(!do_after(user, use_delay, attacked_humanoid))
return ITEM_INTERACT_BLOCKING

if (!attacked_humanoid.item_heal(user, brute_heal = 0, burn_heal = 15, heal_message_brute = "dents", heal_message_burn = "burnt wires", required_bodytype = BODYTYPE_ROBOTIC))
return ITEM_INTERACT_BLOCKING

if (use(1) && amount > 0)
INVOKE_ASYNC(src, PROC_REF(try_heal_loop), interacting_with, user, TRUE)

///////////////////////////////////////////////
// Cable laying procedures
Expand All @@ -605,7 +621,7 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri
to_chat(user, span_warning("There is no cable left!"))
return

if(get_dist(T,user) > 1) // Too far
if(get_dist(T,user) > 1)
to_chat(user, span_warning("You can't lay cable at a place that far away!"))
return

Expand Down
7 changes: 7 additions & 0 deletions html/changelogs/AutoChangeLog-pr-29154.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
author: "LT3"
delete-after: True
changes:
- bugfix: "Scanner gate now detects items thrown through it"
- bugfix: "Scanner gate does not alarm for guns on players with mindshield"
- bugfix: "Scanner gate does not alarm for guns on players with weapons ID card access"
- sound: "Reduced volume of scanner gate alarm"
5 changes: 5 additions & 0 deletions html/changelogs/AutoChangeLog-pr-29200.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
author: "SkyratBot"
delete-after: True
changes:
- qol: "Cable coil and welding tool healing now loops similarly to sutures/meshes"
- bugfix: "Fixed cable coil/welding tool heal message not displaying when healing someone else"
5 changes: 0 additions & 5 deletions html/changelogs/AutoChangeLog-pr-29242.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-29249.yml

This file was deleted.

5 changes: 0 additions & 5 deletions html/changelogs/AutoChangeLog-pr-29250.yml

This file was deleted.

Loading

0 comments on commit 5c7c7aa

Please sign in to comment.