Skip to content

Commit

Permalink
Merge pull request #92 from MistakeNot4892/fork/pyrelight
Browse files Browse the repository at this point in the history
Updating from Neb dev.
  • Loading branch information
MistakeNot4892 authored Sep 22, 2024
2 parents 7bd52d9 + c4a5cae commit b2aefd2
Show file tree
Hide file tree
Showing 210 changed files with 992 additions and 532 deletions.
3 changes: 3 additions & 0 deletions SpacemanDMM.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ override_precedes_definition = "error"
hide_invisible = [
"/obj/effect/step_trigger",
"/obj/abstract",
"/turf/unsimulated/mask",
"/obj/effect/shuttle_landmark",
"/obj/effect/overmap",
]

[map_renderer.render_passes]
Expand Down
3 changes: 2 additions & 1 deletion code/__defines/research.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
#define HOLLOW_OBJECT_MATTER_MULTIPLIER 0.05
#define BASE_OBJECT_MATTER_MULTPLIER 0.25

#define GENERIC_SMELTING_HEAT_POINT 1000 CELSIUS
#define GENERIC_SMELTING_HEAT_POINT 1350 CELSIUS
#define HIGH_SMELTING_HEAT_POINT 4000 CELSIUS // must be at least 4074K (3800 C) to melt graphite

#define TECH_MATERIAL "materials"
#define TECH_ENGINEERING "engineering"
#define TECH_EXOTIC_MATTER "exoticmatter"
Expand Down
31 changes: 15 additions & 16 deletions code/_helpers/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -630,15 +630,15 @@ The _flatIcons list is a cache for generated icon files.
*/

// Creates a single icon from a given /atom or /image. Only the first argument is required.
/proc/getFlatIcon(image/A, defdir=2, deficon=null, defstate="", defblend=BLEND_DEFAULT, always_use_defdir = 0)
/proc/getFlatIcon(image/A, defdir = SOUTH, deficon = null, defstate = "", defblend = BLEND_DEFAULT, always_use_defdir = FALSE)
// We start with a blank canvas, otherwise some icon procs crash silently
var/icon/flat = icon('icons/effects/effects.dmi', "icon_state"="nothing") // Final flattened icon
if(!A || A.alpha <= 0)
return flat

var/curicon = A.icon || deficon
var/curstate = A.icon_state || defstate
var/curdir = (A.dir != SOUTH && !always_use_defdir) ? A.dir : defdir
var/curdir = (A.dir != defdir && !always_use_defdir) ? A.dir : defdir
var/curblend = (A.blend_mode == BLEND_DEFAULT) ? defblend : A.blend_mode

if(curicon && !check_state_in_icon(curstate, curicon))
Expand Down Expand Up @@ -719,7 +719,7 @@ The _flatIcons list is a cache for generated icon files.
add = icon(I.icon, I.icon_state, I.dir)
// This checks for a silent failure mode of the icon routine. If the requested dir
// doesn't exist in this icon state it returns a 32x32 icon with 0 alpha.
if (I.dir != SOUTH && add.Width() == 32 && add.Height() == 32)
if (I.dir != defdir && add.Width() == 32 && add.Height() == 32)
// Check every pixel for blank (computationally expensive, but the process is limited
// by the amount of film on the station, only happens when we hit something that's
// turned, and bails at the very first pixel it sees.
Expand All @@ -735,19 +735,18 @@ The _flatIcons list is a cache for generated icon files.
if (blankpixel)
// Pull the default direction.
add = icon(I.icon, I.icon_state)
else // 'I' is an appearance object.
if(istype(A,/obj/machinery/atmospherics) && (I in A.underlays))
add = getFlatIcon(new /image(I), I.dir, curicon, null, curblend, 1)
else
/*
The state var is null so that it uses the appearance's state, not ours or the default
Falling back to our state if state is null would be incorrect overlay logic (overlay with null state does not inherit it from parent to which it is attached)
If icon is null on an overlay it will inherit the icon from the attached parent, so we _do_ pass curicon ...
but it does not do so if its icon_state is ""/null, so we check beforehand to exclude this
*/
var/icon_to_pass = (!I.icon_state && !I.icon) ? null : curicon
add = getFlatIcon(new/image(I), curdir, icon_to_pass, null, curblend, always_use_defdir)
// 'I' is an appearance object.
else if(istype(A,/obj/machinery/atmospherics) && (I in A.underlays))
add = getFlatIcon(new /image(I), I.dir, curicon, null, curblend, 1)
else
/*
The state var is null so that it uses the appearance's state, not ours or the default
Falling back to our state if state is null would be incorrect overlay logic (overlay with null state does not inherit it from parent to which it is attached)
If icon is null on an overlay it will inherit the icon from the attached parent, so we _do_ pass curicon ...
but it does not do so if its icon_state is ""/null, so we check beforehand to exclude this
*/
add = getFlatIcon(new/image(I), curdir, (!I.icon_state && !I.icon) ? null : curicon, null, curblend, always_use_defdir)

// Find the new dimensions of the flat icon to fit the added overlay
addX1 = min(flatX1, I.pixel_x + 1)
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/cyborg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
if(is_component_functioning("camera"))
silicon_camera.captureimage(A, usr)
else
to_chat(src, "<span class='userdanger'>Your camera isn't functional.</span>")
to_chat(src, "<span class='danger'>Your camera isn't functional.</span>")
return

/*
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/hud/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ var/global/obj/screen/robot_inventory
R.active_storage.close(R) //Closes the inventory ui.

if(!R.module)
to_chat(usr, "<span class='danger'>No module selected</span>")
to_chat(usr, SPAN_WARNING("No module selected."))
return

if(!R.module.equipment)
to_chat(usr, "<span class='danger'>Selected module has no modules to select</span>")
to_chat(usr, SPAN_WARNING("Selected module has no equipment available."))
return

if(!R.robot_modules_background)
Expand Down
9 changes: 5 additions & 4 deletions code/controllers/subsystems/initialization/character_info.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ SUBSYSTEM_DEF(character_info)
search_for = ckey(lowertext(trim(search_for)))
for(var/id in _comment_holders_by_id)
var/datum/character_information/comments = _comment_holders_by_id[id]
for(var/checkstring in list(comments.name, comments.ckey, comments.record_id))
if(findtext(ckey(lowertext(trim(checkstring))), search_for) > 0)
LAZYADD(., comments)
break
if(istype(comments))
for(var/checkstring in list(comments.name, comments.ckey, comments.record_id))
if(findtext(ckey(lowertext(trim(checkstring))), search_for) > 0)
LAZYADD(., comments)
break

/datum/controller/subsystem/character_info/Topic(href, href_list)
. = ..()
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystems/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ SUBSYSTEM_DEF(ticker)

if(!length(global.admins))
send2adminirc("Round has started with no admins online.")
SSwebhooks.send(WEBHOOK_AHELP_SENT, list("name" = "Round Started (Game ID: [game_id])", "body" = "Round has started with no admins online."))

/datum/controller/subsystem/ticker/proc/playing_tick()
mode.process()
Expand Down
8 changes: 4 additions & 4 deletions code/datums/extensions/abilities/abilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,31 @@
/datum/extension/abilities/proc/do_self_invocation()
if(isliving(holder) && LAZYLEN(ability_handlers))
for(var/datum/ability_handler/handler in ability_handlers)
if(handler.do_self_invocation(holder))
if(handler.can_do_self_invocation(holder) && handler.do_self_invocation(holder))
return TRUE
return FALSE

/// Clicking a grab on the currently grabbed mob.
/datum/extension/abilities/proc/do_grabbed_invocation(atom/target)
if(isliving(holder) && istype(target) && LAZYLEN(ability_handlers))
for(var/datum/ability_handler/handler in ability_handlers)
if(handler.do_grabbed_invocation(holder, target))
if(handler.can_do_grabbed_invocation(holder, target) && handler.do_grabbed_invocation(holder, target))
return TRUE
return FALSE

/// Clicking an adjacent target (UnarmedAttack())
/datum/extension/abilities/proc/do_melee_invocation(atom/target)
if(isliving(holder) && istype(target) && LAZYLEN(ability_handlers))
for(var/datum/ability_handler/handler in ability_handlers)
if(handler.do_melee_invocation(holder, target))
if(handler.can_do_melee_invocation(holder, target) && handler.do_melee_invocation(holder, target))
return TRUE
return FALSE

/// Clicking a distant target (RangedAttack())
/datum/extension/abilities/proc/do_ranged_invocation(atom/target)
if(isliving(holder) && istype(target) && LAZYLEN(ability_handlers))
for(var/datum/ability_handler/handler in ability_handlers)
if(handler.do_ranged_invocation(holder, target))
if(handler.can_do_ranged_invocation(holder, target) && handler.do_ranged_invocation(holder, target))
return TRUE
return FALSE

Expand Down
59 changes: 59 additions & 0 deletions code/datums/extensions/abilities/abilities_predator.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/datum/ability_handler/predator
var/max_dismember_size = MOB_SIZE_SMALL

/datum/ability_handler/predator/can_do_melee_invocation(mob/user, atom/target)
return istype(user) && !user.incapacitated() && isatom(target) && target.Adjacent(user)

/datum/ability_handler/predator/do_melee_invocation(mob/user, atom/target)
// Nibbles
if(user.a_intent == I_HURT)
if(isliving(target))
return handle_dismemberment(user, target)
if(istype(target, /obj/item/organ))
return handle_organ_destruction(user, target)
return FALSE

/datum/ability_handler/predator/proc/handle_organ_destruction(mob/user, obj/item/organ/chewtoy)
if(!chewtoy.is_internal())
user.visible_message(SPAN_DANGER("\The [user] tears apart \the [chewtoy]."))
chewtoy.physically_destroyed()
else if(BP_IS_PROSTHETIC(chewtoy))
to_chat(user, SPAN_WARNING("\The [chewtoy] seems to be inedible."))
else
user.visible_message(SPAN_DANGER("\The [user] nibbles on \the [chewtoy]."))
chewtoy.convert_to_food(user)
return TRUE

/datum/ability_handler/predator/proc/handle_dismemberment(mob/user, mob/living/victim)

if(victim.stat != DEAD || !victim.current_posture?.prone)
return FALSE

if(!victim.butchery_data)
to_chat(user, SPAN_WARNING("\The [victim] appears to be inedible."))
return TRUE

if(victim.get_object_size() > max_dismember_size)
to_chat(user, SPAN_WARNING("\The [victim] is too big for you to dismember."))
return TRUE

to_chat(user, SPAN_NOTICE("You dig into \the [victim], hunting for something edible."))
if(!do_after(user, max(2 SECONDS, victim.get_object_size() * 5), victim) || QDELETED(victim) || !victim.butchery_data || victim.stat != DEAD)
return TRUE

var/list/external_organs = victim.get_external_organs()
if(length(external_organs) <= 1)
user.visible_message(SPAN_DANGER("\The [user] tears \the [victim] apart!"))
victim.gib()
return TRUE

var/obj/item/organ/external/limb = victim.get_organ(user.get_target_zone())
if(!limb)
to_chat(user, SPAN_WARNING("\The [victim] is missing that limb!"))
return TRUE

user.visible_message(SPAN_DANGER("\The [user] tears \the [limb] from \the [victim]!"))
limb.dismember(FALSE, DISMEMBER_METHOD_EDGE, silent = TRUE)
if(!QDELETED(limb))
user.put_in_hands(limb)
return TRUE
12 changes: 12 additions & 0 deletions code/datums/extensions/abilities/ability_handler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,26 @@
/datum/ability_handler/proc/refresh_login()
return

/datum/ability_handler/proc/can_do_self_invocation(mob/user)
return FALSE

/datum/ability_handler/proc/do_self_invocation(mob/user)
return FALSE

/datum/ability_handler/proc/can_do_grabbed_invocation(mob/user, atom/target)
return FALSE

/datum/ability_handler/proc/do_grabbed_invocation(mob/user, atom/target)
return FALSE

/datum/ability_handler/proc/can_do_melee_invocation(mob/user, atom/target)
return FALSE

/datum/ability_handler/proc/do_melee_invocation(mob/user, atom/target)
return FALSE

/datum/ability_handler/proc/can_do_ranged_invocation(mob/user, atom/target)
return FALSE

/datum/ability_handler/proc/do_ranged_invocation(mob/user, atom/target)
return FALSE
1 change: 1 addition & 0 deletions code/datums/extensions/storage/subtypes_wallet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
max_storage_space = 8
can_hold = list(
/obj/item/cash,
/obj/item/charge_stick,
/obj/item/card,
/obj/item/clothing/mask/smokable,
/obj/item/cosmetics,
Expand Down
3 changes: 3 additions & 0 deletions code/datums/traits/prosthetics/prosthetic_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
if(. && pref.species && pref.bodytype)

var/decl/species/mob_species = pref.get_species_decl()
if(!istype(mob_species) || isnull(mob_species.base_internal_prosthetics_model))
return FALSE

var/decl/bodytype/mob_bodytype = pref.get_bodytype_decl()

if(!istype(mob_bodytype))
Expand Down
4 changes: 4 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -988,3 +988,7 @@

/atom/proc/take_vaporized_reagent(reagent, amount)
return

/atom/proc/is_watertight()
return ATOM_IS_OPEN_CONTAINER(src)

2 changes: 1 addition & 1 deletion code/game/atoms_fluids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/atom/proc/fluid_act(var/datum/reagents/fluids)
SHOULD_CALL_PARENT(TRUE)
if(reagents && reagents != fluids && fluids?.total_volume >= FLUID_SHALLOW && ATOM_IS_OPEN_CONTAINER(src))
if(reagents && reagents != fluids && fluids?.total_volume >= FLUID_SHALLOW && !is_watertight())
reagents.trans_to_holder(fluids, reagents.total_volume)
fluids.trans_to_holder(reagents, min(fluids.total_volume, reagents.maximum_volume))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
/obj/item/stock_parts/item_holder/card_reader/attackby(obj/item/W, mob/user)
if(IS_SCREWDRIVER(W) && !istype(loc, /obj/machinery)) //Only if not in the machine, to prevent hijacking tool interactions with the machine
should_swipe = !should_swipe
to_chat(user, SPAN_NOTICE("You toggle \the [src] into [should_swipe? "swipe" : "insert"] card mode"))
to_chat(user, SPAN_NOTICE("You toggle \the [src] into [should_swipe? "swipe" : "insert"] card mode."))
return TRUE
. = ..()

Expand Down
16 changes: 8 additions & 8 deletions code/game/machinery/camera/tracking.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@

camera_loc = sanitize(camera_loc)
if(!camera_loc)
to_chat(src, "<span class='warning'>Must supply a location name</span>")
to_chat(src, SPAN_WARNING("Must supply a location name."))
return

if(stored_locations.len >= max_locations)
to_chat(src, "<span class='warning'>Cannot store additional locations. Remove one first</span>")
to_chat(src, SPAN_WARNING("Cannot store additional locations, remove one first."))
return

if(camera_loc in stored_locations)
to_chat(src, "<span class='warning'>There is already a stored location by this name</span>")
to_chat(src, SPAN_WARNING("There is already a stored location by that name."))
return

var/L = src.eyeobj.getLoc()
if (InvalidPlayerTurf(get_turf(L)))
to_chat(src, "<span class='warning'>Unable to store this location</span>")
to_chat(src, SPAN_WARNING("Unable to store this location."))
return

stored_locations[camera_loc] = L
Expand All @@ -71,7 +71,7 @@
set desc = "Returns to the selected camera location"

if (!(loc in stored_locations))
to_chat(src, "<span class='warning'>Location [loc] not found</span>")
to_chat(src, SPAN_WARNING("Location [loc] not found."))
return

var/L = stored_locations[loc]
Expand All @@ -83,7 +83,7 @@
set desc = "Deletes the selected camera location"

if (!(loc in stored_locations))
to_chat(src, "<span class='warning'>Location [loc] not found</span>")
to_chat(src, SPAN_WARNING("Location [loc] not found."))
return

stored_locations.Remove(loc)
Expand Down Expand Up @@ -240,14 +240,14 @@
/mob/living/silicon/robot/tracking_initiated()
tracking_entities++
if(tracking_entities == 1 && has_zeroth_law())
to_chat(src, "<span class='warning'>Internal camera is currently being accessed.</span>")
to_chat(src, SPAN_WARNING("Internal camera is currently being accessed."))

/mob/living/proc/tracking_cancelled()

/mob/living/silicon/robot/tracking_cancelled()
tracking_entities--
if(!tracking_entities && has_zeroth_law())
to_chat(src, "<span class='notice'>Internal camera is no longer being accessed.</span>")
to_chat(src, SPAN_NOTICE("Internal camera is no longer being accessed."))


#undef TRACKING_POSSIBLE
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/cell_charger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
return

anchored = !anchored
to_chat(user, "You [anchored ? "attach" : "detach"] the cell charger [anchored ? "to" : "from"] the ground")
to_chat(user, "You [anchored ? "attach" : "detach"] \the [src] [anchored ? "to" : "from"] the ground.")
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
return

Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/doors/firedoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
var/panel_file = 'icons/obj/doors/hazard/panel.dmi'
var/welded_file = 'icons/obj/doors/hazard/welded.dmi'
icon_state = "open"
icon_state_open = "open"
icon_state_closed = "closed"
begins_closed = FALSE
initial_access = list(list(access_atmospherics, access_engine_equip))
autoset_access = FALSE
opacity = FALSE
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 @@ -5,7 +5,7 @@
icon_state = "left"
min_force = 4
hitsound = 'sound/effects/Glasshit.ogg'
max_health = 150 //If you change this, consiter changing ../door/window/brigdoor/ health at the bottom of this .dm file
max_health = 150 //If you change this, consider changing ../door/window/brigdoor/ health at the bottom of this .dm file
current_health = 150
visible = 0.0
use_power = POWER_USE_OFF
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/kitchen/gibber.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

/obj/machinery/gibber/examine(mob/user)
. = ..()
to_chat(user, "The safety guard is [emagged ? "<span class='danger'>disabled</span>" : "enabled"].")
to_chat(user, "The safety guard is [emagged ? SPAN_DANGER("disabled") : "enabled"].")

/obj/machinery/gibber/emag_act(var/remaining_charges, var/mob/user)
emagged = !emagged
Expand Down
Loading

0 comments on commit b2aefd2

Please sign in to comment.