Skip to content

Commit

Permalink
Merge remote-tracking branch 'citrp/master' into rig_1
Browse files Browse the repository at this point in the history
  • Loading branch information
silicons committed Mar 13, 2024
2 parents 4c0f8fb + 3d39f78 commit 2cbcfeb
Show file tree
Hide file tree
Showing 67 changed files with 6,673 additions and 1,377 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define COMSIG_ATOM_THROW_IMPACTED "throw_impacted"
/// from base of /atom/movable/proc/throw_impact: (AM, thrownthing)
#define COMSIG_MOVABLE_THROW_IMPACT "throw_impact"
// This set of returns can sbe for both of the above!
// This set of returns can be for both of the above!
/// cancel further actions in this hit
#define COMPONENT_THROW_HIT_NEVERMIND (1<<0)
/// pierce through.
Expand Down
14 changes: 13 additions & 1 deletion code/controllers/subsystem/mapping/maps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

/datum/controller/subsystem/mapping/proc/read_next_map()
var/datum/map/station/next_map
var/datum/map/station/default = keyed_maps[keyed_maps[1]]
var/datum/map/station/default = get_default_map()
if(isnull(default))
stack_trace("no default map; world init is likely going to explode.")
#ifdef FORCE_MAP
Expand Down Expand Up @@ -238,6 +238,18 @@
load_map(instance)
return TRUE

/datum/controller/subsystem/mapping/proc/get_default_map()
var/list/datum/map/station/potential = list()
for(var/id in keyed_maps)
var/datum/map/station/checking = keyed_maps[id]
if(!istype(checking))
// not a station map
continue
if(!checking.allow_random_draw)
continue
potential += checking
return SAFEPICK(potential)

// todo: admin subsystems panel
// admin tooling for map swapping below

Expand Down
3 changes: 3 additions & 0 deletions code/controllers/subsystem/persistence/persistence.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ SUBSYSTEM_DEF(persistence)
var/static/world_saved_count = 0
/// world load in progress; block.
var/static/world_serialization_mutex = FALSE
/// world is non-canon; do not save world automatically
// todo: interface on subsystem panel
var/static/world_non_canon = FALSE

/datum/controller/subsystem/persistence/Initialize()
LoadPersistence()
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ SUBSYSTEM_DEF(ticker)

SSdbcore.SetRoundEnd()
SSpersistence.SavePersistence()
if(!SSpersistence.world_saved_count && CONFIG_GET(flag/persistence))
if(!SSpersistence.world_saved_count && CONFIG_GET(flag/persistence) && !SSpersistence.world_non_canon)
SSpersistence.save_the_world()


Expand Down
5 changes: 3 additions & 2 deletions code/datums/recipe/stack_recipe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@
while(amount)
if(!--safety)
CRASH("safety hit")
var/obj/item/stack/creating = new result_type(where, min(amount, max_amount))
amount -= creating.amount
var/making_amount = min(amount, max_amount)
var/obj/item/stack/creating = new result_type(where, making_amount)
amount -= making_amount
created += creating
else
for(var/i in 1 to min(amount, 50))
Expand Down
2 changes: 1 addition & 1 deletion code/datums/soundbytes/effects/sparks.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/datum/soundbyte/grouped/sparks
name = "Explosion"
alias = SFX_ALIAS_EXPLOSION
alias = SFX_ALIAS_SPARKS
is_sfx = TRUE
path = list(
'sound/soundbytes/effects/sparks/sparks1.ogg',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"Energy Blade Slice" = 'sound/weapons/blade1.ogg',
"Explosions" = SFX_ALIAS_EXPLOSION,
"Distant Explosion" = 'sound/soundbytes/effects/explosion/explosionfar.ogg',
"Sparks" = "sparks",
"Sparks" = /datum/soundbyte/grouped/sparks,
"Punches" = "punch",
"Glass Shattering" = "shatter",
"Grille Damage" = 'sound/effects/grillehit.ogg',
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/camera/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ CREATE_WALL_MOUNTING_TYPES(/obj/machinery/camera)
var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread()
spark_system.set_up(5, 0, loc)
spark_system.start()
playsound(loc, "sparks", 50, 1)
playsound(loc, /datum/soundbyte/grouped/sparks, 50, 1)

/obj/machinery/camera/proc/set_status(var/newstatus)
if (status != newstatus)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/door_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
if(LAZYLEN(req_access) || LAZYLEN(req_one_access.len))
req_access = req_access ? list() : null
req_one_access = req_one_access ? list() : null // if it's not set keep it not set
playsound(src.loc, "sparks", 100, TRUE)
playsound(src.loc, /datum/soundbyte/grouped/sparks, 100, TRUE)
return 1

/obj/machinery/button/remote/attack_hand(mob/user, list/params)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/windowdoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread()
spark_system.set_up(5, 0, src.loc)
spark_system.start()
playsound(src.loc, "sparks", 50, 1)
playsound(src.loc, /datum/soundbyte/grouped/sparks, 50, 1)
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
visible_message("<span class='warning'>The glass door was sliced open by [user]!</span>")
return 1
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/suit_storage/suit_storage_unit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
protected = 1
if(!protected)
playsound(src.loc, "sparks", 75, 1, -1)
playsound(src.loc, /datum/soundbyte/grouped/sparks, 75, 1, -1)
to_chat(user, "<font color='red'>You try to touch the controls but you get zapped. There must be a short circuit somewhere.</font>")
return*/
else //welp, the guy is protected, we can continue
Expand All @@ -210,7 +210,7 @@
protected = 1
if(!protected)
playsound(src.loc, "sparks", 75, 1, -1)
playsound(src.loc, /datum/soundbyte/grouped/sparks, 75, 1, -1)
to_chat(user, "<font color='red'>You try to touch the controls but you get zapped. There must be a short circuit somewhere.</font>")
return*/
else
Expand Down
10 changes: 3 additions & 7 deletions code/game/mecha/combat/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
src.visible_message("[src] pushes [T] out of the way.")

melee_can_hit = 0
if(do_after(melee_cooldown))
spawn(melee_cooldown)
melee_can_hit = 1
return

Expand All @@ -121,15 +121,11 @@
src.occupant_message("You hit [T].")
src.visible_message("<font color='red'><b>[src.name] hits [T]</b></font>")
playsound(src, 'sound/weapons/heavysmash.ogg', 50, 1)

if(istype(T, /obj/structure/girder))
T:take_damage_legacy(force * 3) //Girders have 200 integrity by default. Steel, non-reinforced walls take four punches, girders take (with this value-mod) two, girders took five without.
else
T:take_damage_legacy(force)
T.inflict_atom_damage(force, MELEE_TIER_HEAVY, ARMOR_MELEE, weapon = src)

melee_can_hit = 0

if(do_after(melee_cooldown))
spawn(melee_cooldown)
melee_can_hit = 1
return

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/effects/effect_system.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ steam.start() -- spawns the effect

/obj/effect/particle_effect/sparks/Initialize(mapload)
. = ..()
playsound(src, "sparks", 100, 1)
playsound(src, /datum/soundbyte/grouped/sparks, 100, 1)
var/turf/T = src.loc
if (istype(T, /turf))
T.hotspot_expose(1000,100)
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/effects/map_effects/beam_point.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ GLOBAL_LIST_EMPTY(all_beam_points)
beam_icon_state = "nzcrentrs_power"
beam_type = /obj/effect/ebeam/reactive/electric
beam_creation_sound = 'sound/effects/lightningshock.ogg'
beam_destruction_sound = "sparks"
beam_destruction_sound = /datum/soundbyte/grouped/sparks

// Turns on and off on a timer.
/obj/effect/map_effect/beam_point/timer
Expand All @@ -179,7 +179,7 @@ GLOBAL_LIST_EMPTY(all_beam_points)
beam_icon_state = "nzcrentrs_power"
beam_type = /obj/effect/ebeam/reactive/electric
beam_creation_sound = 'sound/effects/lightningshock.ogg'
beam_destruction_sound = "sparks"
beam_destruction_sound = /datum/soundbyte/grouped/sparks
seek_range = 3

// Is only a target for other beams to connect to.
Expand Down
17 changes: 12 additions & 5 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,14 @@
return

var/old_loc = src.loc

throwing?.terminate()

var/obj/item/actually_picked_up = src
if(item_flags & ITEM_IN_STORAGE)
var/has_to_drop_to_ground_on_fail = FALSE

if(isturf(old_loc))
// if picking up from floor
throwing?.terminate()
else if(item_flags & ITEM_IN_STORAGE)
// trying to take out of backpack
var/datum/object_system/storage/resolved
if(istype(loc, /atom/movable/storage_indirection))
var/atom/movable/storage_indirection/holder = loc
Expand All @@ -368,13 +371,17 @@
item_flags &= ~ITEM_IN_STORAGE
CRASH("in storage at [loc] ([REF(loc)]) ([loc?.type || "NULL"]) but cannot resolve storage system")
actually_picked_up = resolved.try_remove(src, user, new /datum/event_args/actor(user))
// they're in user, but not equipped now. this is so it doesn't touch the ground first.
has_to_drop_to_ground_on_fail = TRUE

if(isnull(actually_picked_up))
to_chat(user, SPAN_WARNING("[src] somehow slips through your grasp. What just happened?"))
return
if(!user.put_in_hands(actually_picked_up))
actually_picked_up.forceMove(user.drop_location())
if(has_to_drop_to_ground_on_fail)
actually_picked_up.forceMove(user.drop_location())
return
// success
if(isturf(old_loc))
var/obj/effect/temporary_effect/item_pickup_ghost/ghost = new(old_loc)
ghost.assumeform(actually_picked_up)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/lightreplacer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@

/obj/item/lightreplacer/emag_act(var/remaining_charges, var/mob/user)
emagged = !emagged
playsound(src.loc, "sparks", 100, 1)
playsound(src.loc, /datum/soundbyte/grouped/sparks, 100, 1)
update_icon()
return 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@
tape.language_lookup["[LANGUAGE_ID_COMMON]"] = common_index
for(var/i in 1 to reel.len)
var/read = reel[i]
if(isnum(read) && read > 0)
var/mdstr = metadata[read]
if(isnum(read) && read < 0)
var/mdstr = metadata[-read]
if(mdstr == common_str)
translating = FALSE
continue
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/storage/lockbox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
spark_system.set_up(5, 0, src.loc)
spark_system.start()
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
playsound(src.loc, "sparks", 50, 1)
playsound(src.loc, /datum/soundbyte/grouped/sparks, 50, 1)
if(!locked)
..()
else
Expand Down
8 changes: 5 additions & 3 deletions code/game/objects/items/storage/misc_legacy/fancy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
icon_type = "cigarette"
starts_with = list(/obj/item/clothing/mask/smokable/cigarette = 6)
var/brand = "\improper Trans-Stellar Duty-free"
var/overlay_amount = 6

/obj/item/storage/fancy/cigarettes/Initialize(mapload)
. = ..()
Expand All @@ -251,9 +252,10 @@
C.brand = brand
C.desc += " This one is \a [brand]."

/obj/item/storage/fancy/cigarettes/update_icon()
icon_state = "[initial(icon_state)][contents.len]"
return
/obj/item/storage/fancy/cigarettes/update_icon_state()
if(overlay_amount)
icon_state = "[initial(icon_state)][min(length(contents), overlay_amount)]"
return ..()

/obj/item/storage/fancy/cigarettes/Exited(atom/movable/AM, atom/newLoc)
. = ..()
Expand Down
12 changes: 12 additions & 0 deletions code/game/objects/items/storage/misc_legacy/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
. = ..()
update_icon()

/obj/item/storage/box/donut/initialize_storage()
. = ..()
obj_storage.update_icon_on_item_change = TRUE

/obj/item/storage/box/donut/update_icon()
cut_overlays()
var/i = 0
Expand Down Expand Up @@ -42,6 +46,10 @@
. = ..()
update_icon()

/obj/item/storage/box/wormcan/initialize_storage()
. = ..()
obj_storage.update_icon_on_item_change = TRUE

/obj/item/storage/box/wormcan/update_icon(var/itemremoved = 0)
if (contents.len == 0)
icon_state = "wormcan_empty"
Expand Down Expand Up @@ -113,6 +121,10 @@
"SmileyFace" = image(icon = src.icon, icon_state = "paperbag_SmileyFace")
))

/obj/item/storage/box/papersack/initialize_storage()
. = ..()
obj_storage.update_icon_on_item_change = TRUE

/obj/item/storage/box/papersack/update_icon_state()
. = ..()
if(contents.len == 0)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/storage/secure.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
spark_system.set_up(5, 0, src.loc)
spark_system.start()
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
playsound(src.loc, "sparks", 50, 1)
playsound(src.loc, /datum/soundbyte/grouped/sparks, 50, 1)
return
if (W.is_screwdriver())
if (do_after(user, 20 * W.tool_speed))
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/melee/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@
G.stun_effect_act(10 , 50, BP_TORSO, src)
G.take_random_targeted_damage(brute = 10)
G.afflict_unconscious(20 * 20)
playsound(src.loc, "sparks", 50, 1)
playsound(src.loc, /datum/soundbyte/grouped/sparks, 50, 1)
return
*/

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/shields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
if(obj_integrity == 0)
if(ismob(loc))
var/mob/living/L = loc
playsound(src, "sparks", 100, TRUE)
playsound(src, /datum/soundbyte/grouped/sparks, 100, TRUE)
L.visible_message("<span class='boldwarning'>[src] overloads from the damage sustained!</span>")
L.dropItemToGround(src) //implant component catch hook will grab it.
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/stunbaton.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
if(bcell && bcell.charge > hitcost)
status = !status
to_chat(user, "<span class='notice'>[src] is now [status ? "on" : "off"].</span>")
playsound(loc, "sparks", 75, 1, -1)
playsound(loc, /datum/soundbyte/grouped/sparks, 75, 1, -1)
update_icon()
else
status = 0
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/crates_lockers/__closet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
spark_system.set_up(5, 0, loc)
spark_system.start()
playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
playsound(src, "sparks", 50, 1)
playsound(src, /datum/soundbyte/grouped/sparks, 50, 1)

else if(I.is_wrench())
if(sealed)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
spark_system.set_up(5, 0, loc)
spark_system.start()
playsound(loc, 'sound/weapons/blade1.ogg', 50, 1)
playsound(loc, "sparks", 50, 1)
playsound(loc, /datum/soundbyte/grouped/sparks, 50, 1)
else
to_chat(user, "<span class='warning'>Access Denied</span>")
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/crates_lockers/crates.dm
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
spawn(6)
cut_overlay(sparks) //Tried lots of stuff but nothing works right. so i have to use this *sadface*
compile_overlays()
playsound(src.loc, "sparks", 60, 1)
playsound(src.loc, /datum/soundbyte/grouped/sparks, 60, 1)
locked = 0
broken = 1
to_chat(user, "<span class='notice'>You unlock \the [src].</span>")
Expand Down
13 changes: 8 additions & 5 deletions code/game/turfs/initialization/maintenance.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

if(prob(2))
var/type = junk()
new type(T)
var/obj/junk = new type(T)
junk.obj_persist_status |= OBJ_PERSIST_STATUS_NO_THANK_YOU
if(prob(2))
new /obj/effect/debris/cleanable/blood/oil(T)
var/obj/effect/debris/cleanable/blood/oil/oil = new(T)
oil.obj_persist_status |= OBJ_PERSIST_STATUS_NO_THANK_YOU
if(prob(25)) // Keep in mind that only "corners" get any sort of web
attempt_web(T, cardinal_turfs)

Expand Down Expand Up @@ -55,7 +57,8 @@ var/global/list/random_junk
var/turf/neighbour = get_step(T, dir)
if(neighbour && neighbour.density)
if(dir == WEST)
new /obj/effect/debris/cleanable/cobweb(T)
var/obj/effect/debris/cleanable/cobweb/w1 = new(T)
w1.obj_persist_status |= OBJ_PERSIST_STATUS_NO_THANK_YOU
if(dir == EAST)
new /obj/effect/debris/cleanable/cobweb2(T)
return
var/obj/effect/debris/cleanable/cobweb2/w2 = new(T)
w2.obj_persist_status |= OBJ_PERSIST_STATUS_NO_THANK_YOU
Loading

0 comments on commit 2cbcfeb

Please sign in to comment.