Skip to content

Commit

Permalink
Merge Upstream 06.11.2024 (#1643)
Browse files Browse the repository at this point in the history
## Changelog

:cl: ParadiseSS13
fix: Возможный фикс лагов при спаме в чате.
/:cl:
  • Loading branch information
dj-34 authored Nov 7, 2024
2 parents ac63803 + eb11f98 commit 0e947d8
Show file tree
Hide file tree
Showing 37 changed files with 234 additions and 202 deletions.
4 changes: 2 additions & 2 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@

/atom/proc/in_contents_of(container)//can take class or object instance as argument
if(ispath(container))
if(istype(src.loc, container))
if(istype(loc, container))
return TRUE
else if(src in container)
return TRUE
Expand Down Expand Up @@ -388,7 +388,7 @@
/atom/proc/build_base_description(infix = "", suffix = "")
//This reformat names to get a/an properly working on item descriptions when they are bloody
var/f_name = "\a [src][infix]."
if(src.blood_DNA && !istype(src, /obj/effect/decal))
if(src.blood_DNA)
if(gender == PLURAL)
f_name = "some "
else
Expand Down
21 changes: 13 additions & 8 deletions code/game/gamemodes/cult/runes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,9 @@ To draw a rune, use a ritual dagger.

/obj/effect/rune/attackby(obj/I, mob/user, params)
if(istype(I, /obj/item/melee/cultblade/dagger) && IS_CULTIST(user))
// Telerunes with portals open
if(istype(src, /obj/effect/rune/teleport))
var/obj/effect/rune/teleport/T = src // Can't erase telerunes if they have a portal open
if(T.inner_portal || T.outer_portal)
to_chat(user, "<span class='warning'>The portal needs to close first!</span>")
return

// Everything else
if(!can_dagger_erase_rune(user))
return

var/obj/item/melee/cultblade/dagger/D = I
user.visible_message("<span class='warning'>[user] begins to erase [src] with [I].</span>")
if(do_after(user, initial(scribe_delay) * D.scribe_multiplier, target = src))
Expand All @@ -102,6 +97,9 @@ To draw a rune, use a ritual dagger.
return
return ..()

/obj/effect/rune/proc/can_dagger_erase_rune(mob/user)
return TRUE

/obj/effect/rune/attack_hand(mob/living/user)
user.Move_Pulled(src) // So that you can still drag things onto runes
if(!IS_CULTIST(user))
Expand Down Expand Up @@ -453,6 +451,13 @@ structure_check() searches for nearby cultist structures required for the invoca
QDEL_NULL(outer_portal)
return ..()

/obj/effect/rune/teleport/can_dagger_erase_rune(mob/user)
// Can't erase telerunes if they have a portal open
if(inner_portal || outer_portal)
to_chat(user, "<span class='warning'>The portal needs to close first!</span>")
return FALSE
return TRUE

/obj/effect/rune/teleport/invoke(list/invokers)
var/mob/living/user = invokers[1] //the first invoker is always the user
var/list/potential_runes = list()
Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/guestpass.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
var/expiration_time = 0
var/reason = "NOT SPECIFIED"

/obj/item/card/id/guest/attach_guest_pass(/obj/item/card/id/guest/G, mob/user)
return

/obj/item/card/id/guest/GetAccess()
if(world.time > expiration_time)
return access
Expand Down
4 changes: 3 additions & 1 deletion code/game/machinery/recharger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

var/obj/item/charging = null // The item that is being charged
var/using_power = FALSE // Whether the recharger is actually transferring power or not, used for icon
var/anchor_toggleable = TRUE

/obj/machinery/recharger/Initialize(mapload)
. = ..()
Expand Down Expand Up @@ -91,7 +92,7 @@

/obj/machinery/recharger/wrench_act(mob/user, obj/item/I)
. = TRUE
if(istype(src, /obj/machinery/recharger/wallcharger)) // Unwrenching wall rechargers and dragging them off all kinds of cursed.
if(!anchor_toggleable) // Unwrenching wall rechargers and dragging them off all kinds of cursed.
return
if(panel_open)
to_chat(user, "<span class='warning'>Close the maintenance panel first!</span>")
Expand Down Expand Up @@ -258,6 +259,7 @@
name = "wall recharger"
icon_state = "wrecharger0"
base_icon_state = "wrecharger"
anchor_toggleable = FALSE

/obj/machinery/recharger/wallcharger/upgraded/Initialize(mapload)
. = ..()
Expand Down
8 changes: 4 additions & 4 deletions code/game/mecha/equipment/mecha_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
if(chassis)
chassis.occupant_message("<span class='danger'>[src] is destroyed!</span>")
chassis.log_append_to_last("[src] is destroyed.",1)
if(istype(src, /obj/item/mecha_parts/mecha_equipment/weapon))
SEND_SOUND(chassis.occupant, sound(chassis.weapdestrsound, volume = 50))
else
SEND_SOUND(chassis.occupant, sound(chassis.critdestrsound, volume = 50))
SEND_SOUND(chassis.occupant, sound(get_destroy_sound(), volume = 50))
detach(chassis)
return ..()


/obj/item/mecha_parts/mecha_equipment/proc/get_destroy_sound()
return chassis.critdestrsound

/obj/item/mecha_parts/mecha_equipment/proc/get_equip_info()
if(!chassis)
return
Expand Down
3 changes: 3 additions & 0 deletions code/game/mecha/equipment/weapons/weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
/obj/item/mecha_parts/mecha_equipment/weapon/proc/get_shot_amount()
return projectiles_per_shot

/obj/item/mecha_parts/mecha_equipment/weapon/get_destroy_sound()
return chassis.weapdestrsound

/obj/item/mecha_parts/mecha_equipment/weapon/action(target, params)
if(!action_checks(target))
return
Expand Down
6 changes: 5 additions & 1 deletion code/game/objects/effects/decals/Cleanable/humans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
var/turf/T = get_turf(src)
check_gravity(T)

if(!istype(src, /obj/effect/decal/cleanable/blood/footprints) && ((T && (T.density)) || !gravity_check || locate(/obj/structure/window/full) in T || locate(/obj/structure/grille/) in T))
if(should_be_off_floor())
off_floor = TRUE
layer = ABOVE_MOB_LAYER
plane = GAME_PLANE
Expand Down Expand Up @@ -85,6 +85,10 @@
overlays.Cut()
..()

/obj/effect/decal/cleanable/blood/proc/should_be_off_floor()
var/turf/T = get_turf(src)
return ((T && T.density) || !gravity_check || (locate(/obj/structure/window/full) in T) || (locate(/obj/structure/grille) in T))

/obj/effect/decal/cleanable/blood/proc/dry()
name = dryname
desc = drydesc
Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/effects/decals/Cleanable/tracks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ GLOBAL_LIST_EMPTY(fluidtrack_cache)

alpha = base_alpha + bloodiness

/obj/effect/decal/cleanable/blood/footprints/should_be_off_floor()
return FALSE

/proc/createFootprintsFrom(atom/movable/A, dir, turf/T)
var/obj/effect/decal/cleanable/blood/footprints/FP = new /obj/effect/decal/cleanable/blood/footprints(T)
if(ishuman(A))
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/effects/effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@
create_reagents(100)
reagents.add_reagent_list(scoop_reagents)

/obj/effect/decal/build_base_description(infix, suffix) // overriding this is a sin but it fixes a worse sin
. = list("[bicon(src)] That's \a [src][infix]. [suffix]")
if(desc)
. += desc

/obj/effect/decal/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/reagent_containers/glass) || istype(I, /obj/item/reagent_containers/drinks))
scoop(I, user)
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
attack_hand(A)

/obj/item/attack_ai(mob/user as mob)
if(istype(src.loc, /obj/item/robot_module))
if(istype(loc, /obj/item/robot_module))
// If the item is part of a cyborg module, equip it
if(!isrobot(user))
return
Expand Down Expand Up @@ -1030,7 +1030,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
return FALSE

// Only matches and cigars can light fancy smokables.
if(cig.fancy && !istype(src, /obj/item/match) && !istype(src, /obj/item/lighter/zippo))
if(length(cig.fancy_lighters) && !is_type_in_list(src, cig.fancy_lighters))
to_chat(user, "<span class='danger'>[cig] straight out REFUSES to be lit by such uncivilized means!</span>")
return FALSE

Expand Down
32 changes: 16 additions & 16 deletions code/game/objects/items/weapons/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,21 @@
return access
return access | guest_pass.GetAccess()

/obj/item/card/id/proc/attach_guest_pass(obj/item/card/id/guest/G, mob/user)
if(world.time > G.expiration_time)
to_chat(user, "There's no point, the guest pass has expired.")
return
if(guest_pass)
to_chat(user, "There's already a guest pass attached to this ID.")
return
if(G.registered_name != registered_name && G.registered_name != "NOT SPECIFIED")
to_chat(user, "The guest pass cannot be attached to this ID.")
return
if(!user.unEquip(G))
return
G.loc = src
guest_pass = G

/obj/item/card/id/GetID()
return src

Expand Down Expand Up @@ -266,22 +281,7 @@
to_chat(user, "This ID has already been stamped!")

else if(istype(W, /obj/item/card/id/guest))
if(istype(src, /obj/item/card/id/guest))
return
var/obj/item/card/id/guest/G = W
if(world.time > G.expiration_time)
to_chat(user, "There's no point, the guest pass has expired.")
return
if(guest_pass)
to_chat(user, "There's already a guest pass attached to this ID.")
return
if(G.registered_name != registered_name && G.registered_name != "NOT SPECIFIED")
to_chat(user, "The guest pass cannot be attached to this ID")
return
if(!user.unEquip(G))
return
G.loc = src
guest_pass = G
attach_guest_pass(W, user)

/obj/item/card/id/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
Expand Down
12 changes: 6 additions & 6 deletions code/game/objects/items/weapons/cigs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ LIGHTERS ARE IN LIGHTERS.DM
var/icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi
/// Unlit cigarette sprite.
var/icon_off = "cigoff"
/// Are we an extra-classy smokable?
var/fancy = FALSE
/// Do we require special items to be lit?
var/list/fancy_lighters = list()
/// What trash item the cigarette makes when it burns out.
var/type_butt = /obj/item/cigbutt
/// How long does the cigarette last before going out? Decrements by 1 every cycle.
Expand Down Expand Up @@ -108,7 +108,7 @@ LIGHTERS ARE IN LIGHTERS.DM
else
to_chat(user, "<span class='notice'>You put [src] into your mouth.</span>")
return TRUE

// If they DO have a cig, try to light it with your own cig.
if(!cigarette_lighter_act(user, M))
return ..()
Expand Down Expand Up @@ -417,7 +417,7 @@ LIGHTERS ARE IN LIGHTERS.DM
icon_on = "cigaron"
icon_off = "cigaroff"
throw_speed = 0.5
fancy = TRUE
fancy_lighters = list(/obj/item/match, /obj/item/lighter/zippo)
type_butt = /obj/item/cigbutt/cigarbutt
smoketime = 300
chem_volume = 120
Expand Down Expand Up @@ -523,7 +523,7 @@ LIGHTERS ARE IN LIGHTERS.DM
item_state = "pipeoff"
icon_on = "pipeon" //Note - these are in masks.dmi
icon_off = "pipeoff"
fancy = TRUE
fancy_lighters = list(/obj/item/match, /obj/item/lighter/zippo)
smoketime = 500
chem_volume = 200
list_reagents = list("nicotine" = 200)
Expand Down Expand Up @@ -583,7 +583,7 @@ LIGHTERS ARE IN LIGHTERS.DM
else
to_chat(user, "<span class='warning'>You need to dry this first!</span>")
return

return ..()

/obj/item/clothing/mask/cigarette/pipe/cobpipe
Expand Down
18 changes: 12 additions & 6 deletions code/game/objects/items/weapons/handcuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,7 @@
materials = list()
trashtype = /obj/item/restraints/handcuffs/cable/zipties/used

/obj/item/restraints/handcuffs/cable/zipties/cyborg/attack(mob/living/carbon/C, mob/user)
if(isrobot(user))
cuff(C, user, FALSE)


/obj/item/restraints/handcuffs/cable/zipties/used
desc = "A pair of broken zipties."
Expand Down Expand Up @@ -268,10 +266,10 @@
//////////////////////////////
/obj/item/restraints/handcuffs/cable/attackby(obj/item/I, mob/user, params)
..()
// Don't allow borgs to send their their ziptie module to the shadow realm.
if(istype(src, /obj/item/restraints/handcuffs/cable/zipties/cyborg))
return

handle_attack_construction(I, user)

/obj/item/restraints/handcuffs/cable/proc/handle_attack_construction(obj/item/I, mob/user)
if(istype(I, /obj/item/stack/rods))
var/obj/item/stack/rods/R = I
if(!R.use(1))
Expand Down Expand Up @@ -306,3 +304,11 @@
if(istype(I, /obj/item/toy/crayon))
var/obj/item/toy/crayon/C = I
cable_color(C.dye_color)

/obj/item/restraints/handcuffs/cable/zipties/cyborg/attack(mob/living/carbon/C, mob/user)
if(isrobot(user))
cuff(C, user, FALSE)

/obj/item/restraints/handcuffs/cable/zipties/cyborg/handle_attack_construction(obj/item/I, mob/user)
// Don't allow borgs to send their their ziptie module to the shadow realm.
return
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/lighters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
lit = TRUE
w_class = WEIGHT_CLASS_BULKY //to prevent it going to pockets
is_unathi_fire = TRUE

/obj/item/match/unathi/cigarette_lighter_act(mob/living/target, mob/living/user, obj/item/direct_attackby_item)
var/obj/item/clothing/mask/cigarette/cig = ..()
if(!cig)
Expand Down
7 changes: 7 additions & 0 deletions code/game/objects/items/weapons/storage/fancy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
else
. += "There are [length(contents)] [icon_type]s in the box."

/obj/item/storage/fancy/remove_from_storage(obj/item/I, atom/new_location)
if(!istype(I))
return FALSE

update_icon()
return ..()

/*
* Donut Box
*/
Expand Down
4 changes: 0 additions & 4 deletions code/game/objects/items/weapons/storage/storage_base.dm
Original file line number Diff line number Diff line change
Expand Up @@ -503,10 +503,6 @@
if(!istype(I))
return FALSE

if(istype(src, /obj/item/storage/fancy))
var/obj/item/storage/fancy/F = src
F.update_icon()

for(var/_M in mobs_viewing)
var/mob/M = _M
if((M.s_active == src) && M.client)
Expand Down
6 changes: 5 additions & 1 deletion code/game/objects/structures/signs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
flags_2 = RAD_PROTECT_CONTENTS_2 | RAD_NO_CONTAMINATE_2
blocks_emissive = EMISSIVE_BLOCK_GENERIC
var/does_emissive = FALSE
var/removable = TRUE

/obj/structure/sign/Initialize(mapload)
. = ..()
Expand Down Expand Up @@ -36,7 +37,7 @@
playsound(loc, 'sound/items/welder.ogg', 80, TRUE)

/obj/structure/sign/screwdriver_act(mob/user, obj/item/I)
if(istype(src, /obj/structure/sign/double))
if(!removable)
return
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
Expand Down Expand Up @@ -85,6 +86,9 @@
to_chat(user, "<span class='notice'>You fasten [S] with your [I].</span>")
qdel(src)

/obj/structure/sign/double
removable = FALSE

/obj/structure/sign/double/map
name = "station map"
desc = "A framed picture of the station."
Expand Down
Loading

0 comments on commit 0e947d8

Please sign in to comment.