Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:NebulaSS13/Nebula into devupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Jan 25, 2025
2 parents ddf2688 + ead9e47 commit 36e2640
Show file tree
Hide file tree
Showing 162 changed files with 727 additions and 735 deletions.
32 changes: 14 additions & 18 deletions code/__defines/ZAS.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,25 @@
}

#ifdef MULTIZAS

var/global/list/csrfz_check = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST, NORTHUP, EASTUP, WESTUP, SOUTHUP, NORTHDOWN, EASTDOWN, WESTDOWN, SOUTHDOWN)
var/global/list/gzn_check = list(NORTH, SOUTH, EAST, WEST, UP, DOWN)
#define ZAS_CSRFZ_CHECK global.cornerdirsz
#define ZAS_GZN_CHECK global.cardinalz

#define ATMOS_CANPASS_TURF(ret, A, B) \
if (A.blocks_air & AIR_BLOCKED || B.blocks_air & AIR_BLOCKED) { \
ret = BLOCKED; \
} \
else if (B.z != A.z) { \
if (B.z < A.z) { \
ret = (A.z_flags & ZM_ALLOW_ATMOS) ? ZONE_BLOCKED : BLOCKED; \
} \
else { \
ret = (B.z_flags & ZM_ALLOW_ATMOS) ? ZONE_BLOCKED : BLOCKED; \
} \
else if (B.z < A.z) { \
ret = (A.z_flags & ZM_ALLOW_ATMOS) ? ZONE_BLOCKED : BLOCKED; \
} \
else if (A.blocks_air & ZONE_BLOCKED || B.blocks_air & ZONE_BLOCKED) { \
ret = (A.z == B.z) ? ZONE_BLOCKED : AIR_BLOCKED; \
else if(B.z > A.z) { \
ret = (B.z_flags & ZM_ALLOW_ATMOS) ? ZONE_BLOCKED : BLOCKED; \
} \
else if (A.contents.len) { \
else if ((A.blocks_air & ZONE_BLOCKED) || (B.blocks_air & ZONE_BLOCKED)) { \
ret = ZONE_BLOCKED; \
} \
else if (length(A.contents)) { \
ret = 0;\
for (var/thing in A) { \
var/atom/movable/AM = thing; \
for (var/atom/movable/AM as anything in A) { \
ATMOS_CANPASS_MOVABLE(ret, AM, B); \
if (ret == BLOCKED) { \
break;\
Expand All @@ -88,8 +84,8 @@ var/global/list/gzn_check = list(NORTH, SOUTH, EAST, WEST, UP, DOWN)
}
#else

var/global/list/csrfz_check = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)
var/global/list/gzn_check = list(NORTH, SOUTH, EAST, WEST)
#define ZAS_CSRFZ_CHECK global.cornerdirs
#define ZAS_GZN_CHECK global.cardinal

#define ATMOS_CANPASS_TURF(ret, A, B) \
if (A.blocks_air & AIR_BLOCKED || B.blocks_air & AIR_BLOCKED) { \
Expand All @@ -98,7 +94,7 @@ var/global/list/gzn_check = list(NORTH, SOUTH, EAST, WEST)
else if (A.blocks_air & ZONE_BLOCKED || B.blocks_air & ZONE_BLOCKED) { \
ret = ZONE_BLOCKED; \
} \
else if (A.contents.len) { \
else if (length(A.contents)) { \
ret = 0;\
for (var/thing in A) { \
var/atom/movable/AM = thing; \
Expand Down
2 changes: 1 addition & 1 deletion code/_helpers/files.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//Sends resource files to client cache
/client/proc/getFiles()
for(var/file in args)
direct_output(src, browse_rsc(file))
send_rsc(src, file, null)

/client/proc/browse_files(root="data/logs/", max_iterations=10, list/valid_extensions=list(".txt",".log",".htm"))
var/path = root
Expand Down
2 changes: 1 addition & 1 deletion code/_helpers/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ mob
// Send the icon to src's local cache
send_rsc(src, getFlatIcon(src), iconName)
// Display the icon in their browser
direct_output(src, browse("<body bgcolor='#000000'><p><img src='[iconName]'></p></body>"))
show_browser(src, "<body bgcolor='#000000'><p><img src='[iconName]'></p></body>")
Output_Icon()
set name = "2. Output Icon"
Expand Down
2 changes: 1 addition & 1 deletion code/_helpers/logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var/global/log_end= world.system_type == UNIX ? ascii2text(13) : ""
to_world_log("## TESTING: [msg][log_end]")

/proc/game_log(category, text)
direct_output(diary, "\[[time_stamp()]] [game_id] [category]: [text][log_end]")
to_file(diary, "\[[time_stamp()]] [game_id] [category]: [text][log_end]")

/proc/log_admin(text)
global.admin_log.Add(text)
Expand Down
2 changes: 1 addition & 1 deletion code/_helpers/profiling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
lines += "[entry] => [num2text(data[STAT_ENTRY_TIME], 10)]ms ([data[STAT_ENTRY_COUNT]]) (avg:[num2text(data[STAT_ENTRY_TIME]/(data[STAT_ENTRY_COUNT] || 1), 99)])"

if (user)
direct_output(user, browse("<ol><li>[lines.Join("</li><li>")]</li></ol>", "window=[url_encode("stats:[ref(stats)]")]"))
show_browser(user, "<ol><li>[lines.Join("</li><li>")]</li></ol>", "window=[url_encode("stats:[ref(stats)]")]")

. = lines.Join("\n")

Expand Down
2 changes: 1 addition & 1 deletion code/_helpers/sorts/__main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ reverse a descending sequence without violating stability.
var/r = 0 //becomes 1 if any bits are shifted off
while(n >= MIN_MERGE)
r |= (n & 1)
n >>= 1
n = BITSHIFT_RIGHT(n, 1)
return n + r

//Examines the stack of runs waiting to be merged and merges adjacent runs until the stack invariants are reestablished:
Expand Down
3 changes: 3 additions & 0 deletions code/_macros.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,12 @@
#define show_image(target, image) target << (image)
#define send_rsc(target, rsc_content, rsc_name) target << browse_rsc(rsc_content, rsc_name)
#define open_link(target, url) target << link(url)
#define ftp_to(target, file_entry, suggested_name) target << ftp(file_entry, suggested_name)
#define open_file_for(target, file) target << run(file)
#define to_savefile(target, key, value) target[(key)] << (value)
#define from_savefile(target, key, value) target[(key)] >> (value)
#define to_output(target, output_content, output_args) target << output((output_content), (output_args))
// Avoid using this where possible, prefer the other helpers instead.
#define direct_output(target, value) target << (value)

/proc/html_icon(var/thing) // Proc instead of macro to avoid precompiler problems.
Expand Down
12 changes: 7 additions & 5 deletions code/_onclick/hud/screen/screen_credits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@
animate(src, transform = M, time = CREDIT_ROLL_SPEED)
target = M
animate(src, alpha = 255, time = CREDIT_EASE_DURATION, flags = ANIMATION_PARALLEL)
spawn(CREDIT_ROLL_SPEED - CREDIT_EASE_DURATION)
if(!QDELETED(src))
animate(src, alpha = 0, transform = target, time = CREDIT_EASE_DURATION)
sleep(CREDIT_EASE_DURATION)
qdel(src)
addtimer(CALLBACK(src, PROC_REF(ease_out)), CREDIT_ROLL_SPEED - CREDIT_EASE_DURATION)
var/mob/owner = owner_ref?.resolve()
if(istype(owner) && owner.client)
owner.client.screen += src

/obj/screen/credit/proc/ease_out()
if(QDELETED(src))
return
animate(src, alpha = 0, transform = target, time = CREDIT_EASE_DURATION)
QDEL_IN_CLIENT_TIME(src, CREDIT_EASE_DURATION)

/obj/screen/credit/Destroy()
var/client/P = parent
if(istype(P))
Expand Down
16 changes: 12 additions & 4 deletions code/controllers/subsystems/air.dm
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,13 @@ SUBSYSTEM_DEF(air)
if(!SHOULD_PARTICIPATE_IN_ZONES(T))
continue
simulated_turf_count++
// We also skip anything already queued, since it'll be settled when fire() runs anyway.
if(T.needs_air_update)
continue
T.update_air_properties()
// air state is necessarily globally incomplete during this
// so we can't do T.post_update_air_properties(), which needs
// connections to have been settled already.
CHECK_TICK

report_progress({"Total Simulated Turfs: [simulated_turf_count]
Expand Down Expand Up @@ -198,7 +204,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun

T.update_air_properties()
T.post_update_air_properties()
T.needs_air_update = 0
T.needs_air_update = FALSE
#ifdef ZASDBG
T.remove_vis_contents(zasdbgovl_mark)
#endif
Expand All @@ -214,7 +220,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun

T.update_air_properties()
T.post_update_air_properties()
T.needs_air_update = 0
T.needs_air_update = FALSE
#ifdef ZASDBG
T.remove_vis_contents(zasdbgovl_mark)
#endif
Expand Down Expand Up @@ -368,13 +374,15 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
#ifdef ZASDBG
ASSERT(isturf(T))
#endif
if(T.needs_air_update)
// don't queue us if we've already been queued
// and if SSair hasn't run, every turf in the world will get updated soon anyway
if(T.needs_air_update || !SSair.initialized)
return
tiles_to_update += T
#ifdef ZASDBG
T.add_vis_contents(zasdbgovl_mark)
#endif
T.needs_air_update = 1
T.needs_air_update = TRUE

/datum/controller/subsystem/air/proc/mark_zone_update(zone/Z)
#ifdef ZASDBG
Expand Down
6 changes: 3 additions & 3 deletions code/controllers/subsystems/garbage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,13 @@ SUBSYSTEM_DEF(garbage)
qdel(D, force)
#endif

// Should be treated as a replacement for the 'del' keyword.
// Datums passed to this will be given a chance to clean up references to allow the GC to collect them.
/// Should be treated as a replacement for the 'del' keyword.
/// Datums passed to this will be given a chance to clean up references to allow the GC to collect them.
/// Non-datums passed to this will be hard-deleted.
/proc/qdel(datum/D, force=FALSE)
if(isnull(D))
return
if(!istype(D))
PRINT_STACK_TRACE("qdel() can only handle /datum (sub)types, was passed: [log_info_line(D)]")
del(D)
return
var/datum/qdel_item/I = SSgarbage.items[D.type]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ SUBSYSTEM_DEF(character_info)
fdel(dump_file_name)
text2file(JOINTEXT(SScharacter_info.get_character_manifest_html(apply_striping = FALSE)), dump_file_name)
if(fexists(dump_file_name))
direct_output(usr, ftp(dump_file_name, "dump_manifest.html"))
ftp_to(usr, dump_file_name, "dump_manifest.html")
return TOPIC_HANDLED
catch(var/exception/E)
log_debug("Exception when dumping character relationship manifest: [E]")
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystems/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ SUBSYSTEM_DEF(mapping)
. = list()
for(var/template_type in subtypesof(/datum/map_template))
var/datum/map_template/template = template_type
if(!TYPE_IS_ABSTRACT(template) && initial(template.template_parent_type) != template_type && initial(template.name))
if(!TYPE_IS_ABSTRACT(template))
. += new template_type(type) // send name as a param to catch people doing illegal ad hoc creation

/datum/controller/subsystem/mapping/proc/get_template(var/template_name)
Expand Down
15 changes: 8 additions & 7 deletions code/controllers/subsystems/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,14 @@ SUBSYSTEM_DEF(shuttle)

/datum/controller/subsystem/shuttle/proc/initialize_shuttle(var/shuttle_type, var/map_hash, var/list/add_args)
var/datum/shuttle/shuttle = shuttle_type
if(initial(shuttle.category) != shuttle_type)
var/list/shuttle_args = list(map_hash)
if(length(add_args))
shuttle_args += add_args
shuttle = new shuttle(arglist(shuttle_args))
shuttle_areas |= shuttle.shuttle_area
return shuttle
if(TYPE_IS_ABSTRACT(shuttle))
return null
var/list/shuttle_args = list(map_hash)
if(length(add_args))
shuttle_args += add_args
shuttle = new shuttle(arglist(shuttle_args))
shuttle_areas |= shuttle.shuttle_area
return shuttle

/datum/controller/subsystem/shuttle/proc/hook_up_motherships(shuttles_list)
for(var/datum/shuttle/S in shuttles_list)
Expand Down
4 changes: 1 addition & 3 deletions code/datums/supplypacks/supplypack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ var/global/list/cargoprices = list()
cost = 0
for(var/entry in contains)
cost += atom_info_repository.get_combined_worth_for(entry) * max(1, contains[entry])
var/container_value = containertype ? atom_info_repository.get_single_worth_for(containertype) : 0
if(container_value)
cost += atom_info_repository.get_single_worth_for(containertype)
cost += containertype ? atom_info_repository.get_single_worth_for(containertype) : 0
cost = max(1, NONUNIT_CEILING((cost * WORTH_TO_SUPPLY_POINTS_CONSTANT * SSsupply.price_markup), WORTH_TO_SUPPLY_POINTS_ROUND_CONSTANT))
global.cargoprices[name] = cost

Expand Down
2 changes: 0 additions & 2 deletions code/datums/traits/maluses/amputations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
if(trait_type == type)
continue
var/decl/trait/malus/amputation/trait = check_traits[trait_type]
if(!trait.name)
continue // remove when abstract decl handling from dev is merged
for(var/limb in trait.apply_to_limbs)
if(limb in ban_traits_relating_to_limbs)
LAZYDISTINCTADD(incompatible_with, trait_type)
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 @@ -187,7 +187,7 @@
/obj/machinery/camera/physical_attack_hand(mob/living/human/user)
if(!istype(user))
return TRUE
if(user.species.can_shred(user))
if(user.can_shred())
user.do_attack_animation(src)
visible_message(SPAN_WARNING("\The [user] slashes at [src]!"))
playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1)
Expand Down
12 changes: 5 additions & 7 deletions code/game/machinery/doors/windowdoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,11 @@
return

/obj/machinery/door/window/physical_attack_hand(mob/user)
if(ishuman(user))
var/mob/living/human/H = user
if(H.species.can_shred(H))
playsound(loc, 'sound/effects/Glasshit.ogg', 75, 1)
visible_message("<span class='danger'>\The [user] smashes against \the [src].</span>", 1)
take_damage(25)
return TRUE
if(user.can_shred())
playsound(loc, 'sound/effects/Glasshit.ogg', 75, 1)
visible_message(SPAN_DANGER("\The [user] smashes against \the [src]."))
take_damage(25)
return TRUE
return ..()

/obj/machinery/door/window/emag_act(var/remaining_charges, var/mob/user)
Expand Down
3 changes: 1 addition & 2 deletions code/game/objects/effects/chem/water.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
break

sleep(delay)
sleep(10)
qdel(src)
QDEL_IN(src, 1 SECOND)

/obj/effect/effect/water/Move(turf/newloc)
if(newloc.density)
Expand Down
18 changes: 6 additions & 12 deletions code/game/objects/effects/mines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,14 @@
if(ismob(obj))
var/mob/mob = obj
mob.add_genetic_condition(pick(decls_repository.get_decls_of_type(/decl/genetic_condition/disability)))
spawn(0)
qdel(src)
qdel(src)

/obj/effect/mine/proc/triggerstun(obj)
if(ismob(obj))
var/mob/M = obj
SET_STATUS_MAX(M, STAT_STUN, 30)
spark_at(src, cardinal_only = TRUE)
spawn(0)
qdel(src)
qdel(src)

/obj/effect/mine/proc/triggern2o(obj)
//example: n2o triggerproc
Expand All @@ -53,30 +51,26 @@
if(target.simulated && !target.blocks_air)
target.assume_gas(/decl/material/gas/nitrous_oxide, 30)

spawn(0)
qdel(src)
qdel(src)

/obj/effect/mine/proc/triggerflame(obj)
for (var/turf/target in range(1,src))
if(target.simulated && !target.blocks_air)
target.assume_gas(/decl/material/gas/hydrogen, 30)
target.hotspot_expose(1000, CELL_VOLUME)

spawn(0)
qdel(src)
qdel(src)

/obj/effect/mine/proc/triggerkick(obj)
spark_at(src, cardinal_only = TRUE)
if(ismob(obj))
var/mob/victim = obj
qdel(victim.client)
spawn(0)
qdel(src)
qdel(src)

/obj/effect/mine/proc/explode(obj)
explosion(loc, 0, 1, 2, 3)
spawn(0)
qdel(src)
qdel(src)

/obj/effect/mine/dnascramble
name = "Radiation Mine"
Expand Down
10 changes: 8 additions & 2 deletions code/game/objects/effects/temporary.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
layer = ABOVE_HUMAN_LAYER
mouse_opacity = MOUSE_OPACITY_UNCLICKABLE
simulated = FALSE
var/duration = 10 //in deciseconds
var/duration = 1 SECOND //in deciseconds

/obj/effect/temp_visual/Initialize(mapload, set_dir)
if(set_dir)
Expand All @@ -17,9 +17,15 @@
icon = 'icons/effects/effects.dmi'
icon_state = "empdisable"

/obj/effect/temp_visual/emppulse
name = "electromagnetic pulse"
icon = 'icons/effects/effects.dmi'
icon_state = "emppulse"
duration = 2 SECONDS

/obj/effect/temp_visual/bloodsplatter
icon = 'icons/effects/bloodspatter.dmi'
duration = 5
duration = 0.5 SECONDS
layer = LYING_HUMAN_LAYER
var/splatter_type = "splatter"

Expand Down
Loading

0 comments on commit 36e2640

Please sign in to comment.