Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove and condense unnecessary side-overrides in core code #4678

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions code/_helpers/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -719,11 +719,8 @@ Turf and target are seperate in case you want to teleport some distance from a t
/obj/item/weldingtool/can_puncture()
return 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should return isOn() I suspect.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking, just a note.


/obj/item/screwdriver/can_puncture()
return 1

/obj/item/clothing/mask/smokable/cigarette/can_puncture()
return src.lit
return ..() || lit // in case someone has a sharp cigarette for some reason

/*
Checks if that loc and dir has a item on the wall
Expand Down
7 changes: 0 additions & 7 deletions code/datums/datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,3 @@
*/
/datum/proc/PopulateClone(var/datum/clone)
return clone

/////////////////////////////////////////////////////////////
//Common implementations
/////////////////////////////////////////////////////////////

/image/GetCloneArgs()
return list(icon, loc, icon_state, layer, dir)
7 changes: 2 additions & 5 deletions code/game/machinery/_machines_base/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ Class Procs:
/obj/machinery/CouldUseTopic(var/mob/user)
..()
user.set_machine(src)
if(clicksound && isliving(user))
playsound(src, clicksound, clickvol)

/obj/machinery/CouldNotUseTopic(var/mob/user)
user.unset_machine()
Expand Down Expand Up @@ -391,11 +393,6 @@ Class Procs:
/datum/proc/remove_visual(mob/M)
return

/obj/machinery/CouldUseTopic(var/mob/user)
..()
if(clicksound && isliving(user))
playsound(src, clicksound, clickvol)

/obj/machinery/proc/display_parts(mob/user)
to_chat(user, "<span class='notice'>Following parts detected in the machine:</span>")
for(var/obj/item/C in component_parts)
Expand Down
3 changes: 0 additions & 3 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@ About the new airlock wires panel:
return
..(user)

/obj/machinery/door/airlock/bumpopen(mob/living/simple_animal/user)
..(user)

/obj/machinery/door/airlock/proc/isElectrified()
if(src.electrified_until != 0)
return 1
Expand Down
10 changes: 3 additions & 7 deletions code/game/machinery/hologram.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ var/global/list/holopads = list()

/obj/machinery/hologram/holopad/Destroy()
global.listening_objects -= src
global.holopads -= src
for (var/mob/living/master in masters)
clear_holo(master)
return ..()

/obj/machinery/hologram/holopad/interface_interact(var/mob/living/human/user) //Carn: Hologram requests.
Expand Down Expand Up @@ -387,13 +390,6 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
idle_power_usage = 5
active_power_usage = 100

//Destruction procs.
/obj/machinery/hologram/holopad/Destroy()
global.holopads -= src
for (var/mob/living/master in masters)
clear_holo(master)
return ..()

/*
* Other Stuff: Is this even used?
*/
Expand Down
5 changes: 0 additions & 5 deletions code/game/machinery/vending/_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,6 @@
. = ..()
SSnano.update_uis(src)

/obj/machinery/vending/receive_mouse_drop(atom/dropping, mob/user, params)
. = ..()
if(!. && dropping.loc == user && attempt_to_stock(dropping, user))
return TRUE

/obj/machinery/vending/proc/attempt_to_stock(var/obj/item/I, var/mob/user)
for(var/datum/stored_items/vending_products/R in product_records)
if(I.type == R.item_path)
Expand Down
5 changes: 1 addition & 4 deletions code/game/objects/items/__item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
return ..(user, distance, "", jointext(desc_comp, "<br/>"))

/obj/item/check_mousedrop_adjacency(var/atom/over, var/mob/user)
. = (loc == user && istype(over, /obj/screen/inventory)) || ..()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think /inventory might be correct, there's no need to drag and drop over other elements that I can think of.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/obj/item/organ/internal/augment/active/cyberbrain/handle_mouse_drop(atom/over, mob/user, params)
	if(!istype(over, /obj/screen))
		attack_self(user)
		return TRUE
	. = ..()

dunno, but it's not the only place that checks for specifically screen as opposed to inventory. was just going for what current code did, since by checking both with || we're defaulting to the less-specific one

. = (loc == user && istype(over, /obj/screen)) || ..()

/obj/item/handle_mouse_drop(atom/over, mob/user, params)

Expand Down Expand Up @@ -1115,9 +1115,6 @@ modules/mob/living/human/life.dm if you die, you will be zoomed out.
step_towards(src,S)
else ..()

/obj/item/check_mousedrop_adjacency(var/atom/over, var/mob/user)
. = (loc == user && istype(over, /obj/screen)) || ..()

// Supplied during loadout gear tweaking.
/obj/item/proc/set_custom_name(var/new_name)
base_name = new_name
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/devices/tvcamera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
update_held_icon()

/* Assembly by a roboticist */
// TODO: Make this slapcrafting or remove tvcamera/tvassembly entirely
/obj/item/robot_parts/head/attackby(var/obj/item/assembly/S, mob/user)
if (!istype(S, /obj/item/assembly/infra))
return ..()
Expand Down
5 changes: 1 addition & 4 deletions code/game/objects/items/flame/flame_torch.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
var/head_material = /decl/material/solid/organic/cloth
var/burnt = FALSE

/obj/item/flame/torch/Initialize()
. = ..()
set_color(null) // clear our scent color

/obj/item/flame/torch/get_available_scents()
var/static/list/available_scents = list(
/decl/scent_type/woodsmoke
Expand All @@ -34,6 +30,7 @@

/obj/item/flame/torch/Initialize(var/ml, var/material_key, var/_head_material)
. = ..()
set_color(null) // clear our scent color. TODO: allow flame items to disable scent color setting in the first place

if(_head_material)
head_material = _head_material
Expand Down
7 changes: 2 additions & 5 deletions code/game/objects/items/trash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@
var/age = 0

/obj/item/trash/Initialize(mapload, var/_age)
if(!mapload)
SSpersistence.track_value(src, /decl/persistence_handler/filth/trash)
. = ..(mapload)
if(!isnull(_age))
age = _age

/obj/item/trash/Initialize(var/ml)
if(!ml)
SSpersistence.track_value(src, /decl/persistence_handler/filth/trash)
. = ..()

/obj/item/trash/Destroy()
SSpersistence.forget_value(src, /decl/persistence_handler/filth/trash)
. = ..()
Expand Down
5 changes: 1 addition & 4 deletions code/game/objects/items/weapons/RCD.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
var/decl/hierarchy/h = GET_DECL(/decl/hierarchy/rcd_mode)
work_modes = h.children
work_mode = work_modes[1]
update_icon() //Initializes the ammo counter

/obj/item/rcd/use_on_mob(mob/living/target, mob/living/user, animate = TRUE)
return FALSE
Expand All @@ -45,10 +46,6 @@
to_chat(user, "The current mode is '[work_mode]'.")
to_chat(user, "It currently holds [stored_matter]/[max_stored_matter] matter-units.")

/obj/item/rcd/Initialize()
. = ..()
update_icon() //Initializes the ammo counter

/obj/item/rcd/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/rcd_ammo))
var/obj/item/rcd_ammo/cartridge = W
Expand Down
7 changes: 2 additions & 5 deletions code/game/objects/items/weapons/material/shards.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
. = ..()
// 1-(1-x)^2, so that glass shards with 0.3 opacity end up somewhat visible at 0.51 opacity
alpha = 255 * (material ? (1 - (1 - material.opacity)**2) : 1)
if(has_handle)
add_overlay(overlay_image(icon, "handle", has_handle, RESET_COLOR))

/obj/item/shard/attackby(obj/item/W, mob/user)
if(IS_WELDER(W) && material.shard_can_repair)
Expand Down Expand Up @@ -80,11 +82,6 @@
return TRUE
return ..()

/obj/item/shard/on_update_icon()
. = ..()
if(has_handle)
add_overlay(overlay_image(icon, "handle", has_handle, RESET_COLOR))

/obj/item/shard/Crossed(atom/movable/AM)
..()
if(!isliving(AM))
Expand Down
3 changes: 0 additions & 3 deletions code/game/objects/items/weapons/melee/energy_sword.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
if(!lighting_color)
lighting_color = blade_color
. = ..()

/obj/item/energy_blade/sword/Initialize()
. = ..()
set_extension(src, /datum/extension/demolisher/energy)

/obj/item/energy_blade/sword/is_special_cutting_tool(var/high_power)
Expand Down
7 changes: 2 additions & 5 deletions code/game/objects/items/weapons/storage/backpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@
/obj/item/backpack/can_contaminate()
return FALSE

/obj/item/backpack/equipped()
if(!has_extension(src, /datum/extension/appearance))
set_extension(src, /datum/extension/appearance/cardborg)
..()

/obj/item/backpack/attackby(obj/item/W, mob/user)
if (storage?.use_sound)
playsound(src.loc, storage.use_sound, 50, 1, -5)
return ..()

/obj/item/backpack/equipped(var/mob/user, var/slot)
if(!has_extension(src, /datum/extension/appearance))
set_extension(src, /datum/extension/appearance/cardborg)
if (slot == slot_back_str && storage?.use_sound)
playsound(loc, storage.use_sound, 50, 1, -5)
return ..(user, slot)
Expand Down
16 changes: 0 additions & 16 deletions code/game/objects/random/subtypes/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -238,19 +238,3 @@
/obj/item/clothing/suit/space/void/medical/alt
)
return spawnable_choices

/obj/random/hardsuit
name = "Random Hardsuit"
desc = "This is a random hardsuit control module."
icon = 'icons/obj/rig_modules.dmi'
icon_state = "generic"

/obj/random/hardsuit/spawn_choices()
var/static/list/spawnable_choices = list(
/obj/item/rig/industrial,
/obj/item/rig/eva,
/obj/item/rig/light/hacker,
/obj/item/rig/light/stealth,
/obj/item/rig/light
)
return spawnable_choices
10 changes: 0 additions & 10 deletions code/game/objects/random/subtypes/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -465,16 +465,6 @@
)
return spawnable_choices

/obj/random/crayon
name = "random crayon"
desc = "This is a random crayon."
icon = 'icons/obj/items/crayons.dmi'
icon_state = "crayonred"

/obj/random/crayon/spawn_choices()
var/static/list/spawnable_choices = subtypesof(/obj/item/pen/crayon)
return spawnable_choices

/obj/random/umbrella
name = "Random Umbrella"
desc = "This is a random umbrella."
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/random/subtypes/paperwork.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
icon_state = "crayonred"

/obj/random/crayon/spawn_choices()
return subtypesof(/obj/item/pen/crayon)
var/static/list/spawnable_choices = subtypesof(/obj/item/pen/crayon)
return spawnable_choices

/obj/random/clipboard
name = "random clipboard"
Expand Down
5 changes: 1 addition & 4 deletions code/game/objects/structures/fires.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,6 @@
/obj/structure/fire_source/isflamesource()
return (lit == FIRE_LIT)

/obj/structure/fire_source/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
return ..() || (istype(mover) && mover.checkpass(PASS_FLAG_TABLE))

/obj/structure/fire_source/proc/burn_material(var/decl/material/mat, var/amount)
var/effective_burn_temperature = get_effective_burn_temperature()
. = mat.get_burn_products(amount, effective_burn_temperature)
Expand Down Expand Up @@ -492,7 +489,7 @@
try_light(1000)

/obj/structure/fire_source/CanPass(atom/movable/mover, turf/target, height, air_group)
. = ..()
. = ..() || mover?.checkpass(PASS_FLAG_TABLE)
if(. && lit && ismob(mover))
var/mob/M = mover
if(!MOVING_QUICKLY(M))
Expand Down
11 changes: 4 additions & 7 deletions code/game/objects/structures/girders.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@
set_extension(src, /datum/extension/penetration/simple, 100)
. = ..()

/obj/structure/girder/can_unanchor(var/mob/user)
. = ..()
var/turf/T = loc
if(!anchored && . && (!istype(T) || T.is_open()))
to_chat(user, SPAN_WARNING("You can only secure \the [src] to solid ground."))
return FALSE

/obj/structure/girder/handle_default_screwdriver_attackby(var/mob/user, var/obj/item/screwdriver)

if(reinf_material)
Expand Down Expand Up @@ -88,6 +81,10 @@
to_chat(user, SPAN_WARNING("You must remove the support rods before you can dislodge \the [src]."))
return FALSE
. = ..()
var/turf/T = loc
if(!anchored && . && (!istype(T) || T.is_open()))
to_chat(user, SPAN_WARNING("You can only secure \the [src] to solid ground."))
return FALSE

/obj/structure/girder/can_dismantle(var/mob/user)
if(reinf_material)
Expand Down
7 changes: 2 additions & 5 deletions code/game/objects/structures/target_stake.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
dummy = null
. = ..()

/obj/structure/target_stake/attackby(obj/item/used_item, mob/user)
if(dummy?.repair_target_dummy(used_item, user))
return TRUE
return ..()

/obj/structure/target_stake/take_damage(damage, damage_type, damage_flags, inflicter, armor_pen, silent, do_update_health)
if(dummy)
. = dummy.take_damage(damage, damage_type, damage_flags, inflicter, armor_pen, silent, do_update_health)
Expand All @@ -42,6 +37,8 @@
return ..()

/obj/structure/target_stake/attackby(obj/item/used_item, mob/user)
if(dummy?.repair_target_dummy(used_item, user))
return TRUE
if(istype(used_item, /obj/item/training_dummy) && can_hold_dummy(user, used_item))
if(dummy)
to_chat(user, SPAN_WARNING("\The [src] is already holding \the [dummy]."))
Expand Down
38 changes: 17 additions & 21 deletions code/game/objects/structures/watercloset.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@ var/global/list/hygiene_props = list()
if(clogged <= 0)
unclog()
return TRUE
//toilet paper interaction for clogging toilets and other facilities
if (istype(thing, /obj/item/stack/tape_roll/barricade_tape/toilet))
if (clogged == -1)
to_chat(user, SPAN_WARNING("Try as you might, you can not clog \the [src] with \the [thing]."))
return TRUE
if (clogged)
to_chat(user, SPAN_WARNING("\The [src] is already clogged."))
return TRUE
if (!do_after(user, 3 SECONDS, src))
to_chat(user, SPAN_WARNING("You must stay still to clog \the [src]."))
return TRUE
if (clogged || QDELETED(thing) || !user.try_unequip(thing))
return TRUE
to_chat(user, SPAN_NOTICE("You unceremoniously jam \the [src] with \the [thing]. What a rebel."))
clog(1)
qdel(thing)
return TRUE
. = ..()

/obj/structure/hygiene/examine(mob/user)
Expand Down Expand Up @@ -474,27 +491,6 @@ var/global/list/hygiene_props = list()
. = ..()
icon_state = "puddle"

//toilet paper interaction for clogging toilets and other facilities

/obj/structure/hygiene/attackby(obj/item/I, mob/user)
if (!istype(I, /obj/item/stack/tape_roll/barricade_tape/toilet))
return ..()
if (clogged == -1)
to_chat(user, SPAN_WARNING("Try as you might, you can not clog \the [src] with \the [I]."))
return TRUE
if (clogged)
to_chat(user, SPAN_WARNING("\The [src] is already clogged."))
return TRUE
if (!do_after(user, 3 SECONDS, src))
to_chat(user, SPAN_WARNING("You must stay still to clog \the [src]."))
return TRUE
if (clogged || QDELETED(I) || !user.try_unequip(I))
return TRUE
to_chat(user, SPAN_NOTICE("You unceremoniously jam \the [src] with \the [I]. What a rebel."))
clog(1)
qdel(I)
return TRUE

////////////////////////////////////////////////////
// Toilet Paper Roll
////////////////////////////////////////////////////
Expand Down
Loading
Loading