mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
## About The Pull Request In similar fashion to what was done with crafting recipes last year, this year it's time for techweb designs and printed items to be audited. This is mostly just about consistency, we've a lot of items that can be printed by protolathes, autolathes, circuit printers and techfab etc. However they almost all (except most stacks, mainly) have custom materials that do not match in one way or another with the materials used by the design, which is what this PR is for. "But items printed from lathes etc. already get the mats used to make them." Yes, they do, however that isn't the case for items of the same type that were spawned in some other way (cargo shuttle, space/maints loot, mapped, admins), this create a subtle discrepancy. It isn't a huge deal (in spite of the size of this PR, ton of designs), but given that I have done something similar with crafting recipes before, I may as well give it a second arc of some sort and bring things to completion. And fix a few possible oversights. TL;DR consistency and stuff ## Why It's Good For The Game Consistency, unit test checks to make it harder not to be consistent in the future. Still has a few TODOs like: - [x] Fixed newly printed, fully charged RCDs costing less than the RCD cartridges required to fully charge one. EDIT: I had to tweak the newly added RDD as well because it suffered from the same fundamental issue. - [x] Fixed plates being made of iron and yet shattering like ceramic ones. A new subtype for metallic ones has been made. ## Changelog 🆑 refactor: Refactored a few things with techweb designs (the ones for autolathes, protolathes, circuit printers, mechfabs etc.) to make sure that the materials of items that can be made from these designs more closely match the materials used to make them. fix: Lizard fries no longer need a plate to be made, like all other treats that used to require plates in a distant past. balance: Tweaked the materials cost of RCD, RDD and RCD cartridges. image: Oven trays now have a more metallic hue. balance: Plates printed printed from lathes won't shatter like ceramic ones, in virtue of them being made out of iron instead. /🆑
111 lines
3.6 KiB
Plaintext
111 lines
3.6 KiB
Plaintext
/// Max number of atoms a broom can sweep at once
|
|
#define BROOM_PUSH_LIMIT 20
|
|
|
|
/obj/item/pushbroom
|
|
name = "push broom"
|
|
desc = "This is my BROOMSTICK! It can be used manually or braced with two hands to sweep items as you move. It has a telescopic handle for compact storage."
|
|
icon = 'icons/obj/service/janitor.dmi'
|
|
icon_state = "broom0"
|
|
base_icon_state = "broom"
|
|
icon_angle = 135
|
|
lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi'
|
|
force = 8
|
|
throwforce = 10
|
|
throw_speed = 3
|
|
throw_range = 7
|
|
w_class = WEIGHT_CLASS_NORMAL
|
|
attack_verb_continuous = list("sweeps", "brushes off", "bludgeons", "whacks")
|
|
attack_verb_simple = list("sweep", "brush off", "bludgeon", "whack")
|
|
resistance_flags = FLAMMABLE
|
|
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT)
|
|
|
|
/obj/item/pushbroom/Initialize(mapload)
|
|
. = ..()
|
|
AddComponent(/datum/component/jousting, damage_boost_per_tile = 1)
|
|
AddComponent(/datum/component/two_handed, \
|
|
force_unwielded = 8, \
|
|
force_wielded = 12, \
|
|
icon_wielded = "[base_icon_state]1", \
|
|
wield_callback = CALLBACK(src, PROC_REF(on_wield)), \
|
|
unwield_callback = CALLBACK(src, PROC_REF(on_unwield)), \
|
|
)
|
|
AddComponent(/datum/component/walking_aid)
|
|
|
|
/obj/item/pushbroom/update_icon_state()
|
|
icon_state = "[base_icon_state]0"
|
|
return ..()
|
|
|
|
/**
|
|
* Handles registering the sweep proc when the broom is wielded
|
|
*
|
|
* Arguments:
|
|
* * source - The source of the on_wield proc call
|
|
* * user - The user which is wielding the broom
|
|
*/
|
|
/obj/item/pushbroom/proc/on_wield(obj/item/source, mob/user)
|
|
to_chat(user, span_notice("You brace the [src] against the ground in a firm sweeping stance."))
|
|
RegisterSignal(user, COMSIG_MOVABLE_PRE_MOVE, PROC_REF(sweep))
|
|
|
|
/**
|
|
* Handles unregistering the sweep proc when the broom is unwielded
|
|
*
|
|
* Arguments:
|
|
* * source - The source of the on_unwield proc call
|
|
* * user - The user which is unwielding the broom
|
|
*/
|
|
/obj/item/pushbroom/proc/on_unwield(obj/item/source, mob/user)
|
|
UnregisterSignal(user, COMSIG_MOVABLE_PRE_MOVE)
|
|
|
|
/obj/item/pushbroom/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
|
|
sweep(user, interacting_with)
|
|
return NONE // I guess
|
|
|
|
/**
|
|
* Attempts to push up to BROOM_PUSH_LIMIT atoms from a given location the user's faced direction
|
|
*
|
|
* Arguments:
|
|
* * user - The user of the pushbroom
|
|
* * A - The atom which is located at the location to push atoms from
|
|
*/
|
|
/obj/item/pushbroom/proc/sweep(mob/user, atom/atom)
|
|
SIGNAL_HANDLER
|
|
|
|
do_sweep(src, user, atom, user.dir)
|
|
|
|
/**
|
|
* Sweep objects in the direction we're facing towards our direction
|
|
* Arguments
|
|
* * broomer - The object being used for brooming
|
|
* * user - The person who is brooming
|
|
* * target - The object or tile that's target of a broom click or being moved into
|
|
* * sweep_dir - The directions in which we sweep objects
|
|
*/
|
|
/proc/do_sweep(obj/broomer, mob/user, atom/target, sweep_dir)
|
|
var/turf/current_item_loc = isturf(target) ? target : target.loc
|
|
if (!isturf(current_item_loc))
|
|
return
|
|
var/turf/new_item_loc = get_step(current_item_loc, sweep_dir)
|
|
|
|
var/list/items_to_sweep = list()
|
|
var/i = 1
|
|
for (var/obj/item/garbage in current_item_loc.contents)
|
|
if(garbage.anchored)
|
|
continue
|
|
items_to_sweep += garbage
|
|
i++
|
|
if(i > BROOM_PUSH_LIMIT)
|
|
break
|
|
|
|
SEND_SIGNAL(new_item_loc, COMSIG_TURF_RECEIVE_SWEEPED_ITEMS, broomer, user, items_to_sweep)
|
|
|
|
if(!length(items_to_sweep))
|
|
return
|
|
|
|
for (var/obj/item/garbage in items_to_sweep)
|
|
garbage.Move(new_item_loc, sweep_dir)
|
|
|
|
playsound(current_item_loc, 'sound/items/weapons/thudswoosh.ogg', 30, TRUE, -1)
|
|
|
|
#undef BROOM_PUSH_LIMIT
|