mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
[MIRROR] [Ready] MODsuits [MDB IGNORE] (#10244)
* [Ready] MODsuits * we dont need to add these people as codeowners, goodness gracious * have to remove this because upstream * part 1 of these fixes * EEEE * Update peacekeeper_clothing.dm * E * E * Auto stash before merge of "upstream-merge-59109" and "origin/upstream-merge-59109" * E * Update expeditionary_trooper.dm * more removal * nice * modsuti modstui modusuti * fixes * E * ITS MODsuit not HARDSUIT * more hardsuit references * MODSUIT NOT HARSUITEDSA * Maps * More ,map * oop * e * oo aa * 0 * ting tang * Update modsuit_tailsprites.dm * hi fikou * bs tech update Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com> Co-authored-by: jjpark-kb <55967837+jjpark-kb@users.noreply.github.com> Co-authored-by: Gandalf <jzo123@hotmail.com> Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
This commit is contained in:
co-authored by
Fikou
jjpark-kb
Gandalf
Tom
parent
0ae11fb638
commit
58f82b5161
@@ -1226,6 +1226,18 @@
|
||||
)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/mod_core
|
||||
name = "MOD core"
|
||||
result = /obj/item/mod/construction/core
|
||||
tool_behaviors = list(TOOL_SCREWDRIVER)
|
||||
time = 10 SECONDS
|
||||
reqs = list(/obj/item/stack/cable_coil = 5,
|
||||
/obj/item/stack/rods = 2,
|
||||
/obj/item/stack/sheet/glass = 1,
|
||||
/obj/item/organ/heart/ethereal = 1
|
||||
)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/alcohol_burner
|
||||
name = "Alcohol burner"
|
||||
result = /obj/item/burner
|
||||
|
||||
@@ -249,6 +249,7 @@
|
||||
RegisterSignal(new_holder, COMSIG_LIGHT_EATER_QUEUE, .proc/on_light_eater)
|
||||
if(directional)
|
||||
RegisterSignal(new_holder, COMSIG_ATOM_DIR_CHANGE, .proc/on_holder_dir_change)
|
||||
set_direction(new_holder.dir)
|
||||
if(overlay_lighting_flags & LIGHTING_ON)
|
||||
add_dynamic_lumi()
|
||||
make_luminosity_update()
|
||||
|
||||
@@ -40,12 +40,13 @@
|
||||
attach_circuit(starting_circuit)
|
||||
|
||||
/datum/component/shell/RegisterWithParent()
|
||||
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/on_attack_by)
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/on_examine)
|
||||
RegisterSignal(parent, COMSIG_ATOM_ATTACK_GHOST, .proc/on_attack_ghost)
|
||||
if(!(shell_flags & SHELL_FLAG_CIRCUIT_FIXED))
|
||||
RegisterSignal(parent, COMSIG_ATOM_TOOL_ACT(TOOL_SCREWDRIVER), .proc/on_screwdriver_act)
|
||||
if(!(shell_flags & SHELL_FLAG_CIRCUIT_UNMODIFIABLE))
|
||||
RegisterSignal(parent, COMSIG_ATOM_TOOL_ACT(TOOL_MULTITOOL), .proc/on_multitool_act)
|
||||
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/on_attack_by)
|
||||
if(!(shell_flags & SHELL_FLAG_CIRCUIT_UNREMOVABLE))
|
||||
RegisterSignal(parent, COMSIG_ATOM_TOOL_ACT(TOOL_SCREWDRIVER), .proc/on_screwdriver_act)
|
||||
RegisterSignal(parent, COMSIG_OBJ_DECONSTRUCT, .proc/on_object_deconstruct)
|
||||
if(shell_flags & SHELL_FLAG_REQUIRE_ANCHOR)
|
||||
RegisterSignal(parent, COMSIG_MOVABLE_SET_ANCHORED, .proc/on_set_anchored)
|
||||
@@ -110,7 +111,7 @@
|
||||
return
|
||||
if(attached_circuit.admin_only)
|
||||
return
|
||||
if(shell_flags & SHELL_FLAG_CIRCUIT_FIXED)
|
||||
if(shell_flags & SHELL_FLAG_CIRCUIT_UNREMOVABLE)
|
||||
return
|
||||
remove_circuit()
|
||||
|
||||
@@ -175,7 +176,7 @@
|
||||
if(attached_circuit)
|
||||
if(attached_circuit.owner_id && item == attached_circuit.owner_id.resolve())
|
||||
set_locked(!locked)
|
||||
source.balloon_alert(attacker, "[locked? "locked" : "unlocked"] [source]")
|
||||
source.balloon_alert(attacker, "[locked ? "locked" : "unlocked"] [source]")
|
||||
return COMPONENT_NO_AFTERATTACK
|
||||
|
||||
if(!attached_circuit.owner_id && istype(item, /obj/item/card/id))
|
||||
@@ -304,7 +305,7 @@
|
||||
return
|
||||
locked = FALSE
|
||||
attached_circuit = circuitboard
|
||||
if(!(shell_flags & SHELL_FLAG_CIRCUIT_FIXED) && !circuitboard.admin_only)
|
||||
if(!(shell_flags & SHELL_FLAG_CIRCUIT_UNREMOVABLE) && !circuitboard.admin_only)
|
||||
RegisterSignal(circuitboard, COMSIG_MOVABLE_MOVED, .proc/on_circuit_moved)
|
||||
if(shell_flags & SHELL_FLAG_REQUIRE_ANCHOR)
|
||||
RegisterSignal(circuitboard, COMSIG_CIRCUIT_PRE_POWER_USAGE, .proc/override_power_usage)
|
||||
@@ -320,7 +321,7 @@
|
||||
if(shell_flags & SHELL_FLAG_REQUIRE_ANCHOR)
|
||||
attached_circuit.on = parent_atom.anchored
|
||||
|
||||
if((shell_flags & SHELL_FLAG_CIRCUIT_FIXED) || circuitboard.admin_only)
|
||||
if((shell_flags & SHELL_FLAG_CIRCUIT_UNREMOVABLE) || circuitboard.admin_only)
|
||||
circuitboard.moveToNullspace()
|
||||
else if(circuitboard.loc != parent_atom)
|
||||
circuitboard.forceMove(parent_atom)
|
||||
@@ -364,7 +365,7 @@
|
||||
if(attached_circuit.locked)
|
||||
source.balloon_alert(user, "circuit is locked!")
|
||||
return COMSIG_CANCEL_USB_CABLE_ATTACK
|
||||
|
||||
|
||||
usb_cable.attached_circuit = attached_circuit
|
||||
return COMSIG_USB_CABLE_CONNECTED_TO_CIRCUIT
|
||||
|
||||
@@ -375,7 +376,7 @@
|
||||
* * user - The user to check if they are authorized
|
||||
*/
|
||||
/datum/component/shell/proc/is_authorized(mob/user)
|
||||
if(shell_flags & SHELL_FLAG_CIRCUIT_FIXED)
|
||||
if((shell_flags & SHELL_FLAG_CIRCUIT_UNREMOVABLE) && (shell_flags & SHELL_FLAG_CIRCUIT_UNMODIFIABLE))
|
||||
return FALSE
|
||||
|
||||
if(attached_circuit?.admin_only)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* The shielded component causes the parent item to nullify a certain number of attacks against the wearer, see: shielded hardsuits.
|
||||
* The shielded component causes the parent item to nullify a certain number of attacks against the wearer, see: shielded vests.
|
||||
*/
|
||||
|
||||
/datum/component/shielded
|
||||
@@ -23,6 +23,8 @@
|
||||
var/shield_inhand = FALSE
|
||||
/// Should the shield lose charges equal to the damage dealt by a hit?
|
||||
var/lose_multiple_charges = FALSE
|
||||
/// The item we use for recharging
|
||||
var/recharge_path
|
||||
/// The cooldown tracking when we were last hit
|
||||
COOLDOWN_DECLARE(recently_hit_cd)
|
||||
/// The cooldown tracking when we last replenished a charge
|
||||
@@ -30,7 +32,7 @@
|
||||
/// A callback for the sparks/message that play when a charge is used, see [/datum/component/shielded/proc/default_run_hit_callback]
|
||||
var/datum/callback/on_hit_effects
|
||||
|
||||
/datum/component/shielded/Initialize(max_charges = 3, recharge_start_delay = 20 SECONDS, charge_increment_delay = 1 SECONDS, charge_recovery = 1, lose_multiple_charges = FALSE, shield_icon_file = 'icons/effects/effects.dmi', shield_icon = "shield-old", shield_inhand = FALSE, run_hit_callback)
|
||||
/datum/component/shielded/Initialize(max_charges = 3, recharge_start_delay = 20 SECONDS, charge_increment_delay = 1 SECONDS, charge_recovery = 1, lose_multiple_charges = FALSE, recharge_path = null, starting_charges = null, shield_icon_file = 'icons/effects/effects.dmi', shield_icon = "shield-old", shield_inhand = FALSE, run_hit_callback)
|
||||
if(!isitem(parent) || max_charges <= 0)
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
@@ -39,12 +41,15 @@
|
||||
src.charge_increment_delay = charge_increment_delay
|
||||
src.charge_recovery = charge_recovery
|
||||
src.lose_multiple_charges = lose_multiple_charges
|
||||
src.recharge_path = recharge_path
|
||||
src.shield_icon_file = shield_icon_file
|
||||
src.shield_icon = shield_icon
|
||||
src.shield_inhand = shield_inhand
|
||||
src.on_hit_effects = run_hit_callback || CALLBACK(src, .proc/default_run_hit_callback)
|
||||
|
||||
current_charges = max_charges
|
||||
if(isnull(starting_charges))
|
||||
current_charges = max_charges
|
||||
else
|
||||
current_charges = starting_charges
|
||||
if(recharge_start_delay)
|
||||
START_PROCESSING(SSdcs, src)
|
||||
|
||||
@@ -62,9 +67,18 @@
|
||||
RegisterSignal(parent, COMSIG_ITEM_DROPPED, .proc/lost_wearer)
|
||||
RegisterSignal(parent, COMSIG_ITEM_HIT_REACT, .proc/on_hit_react)
|
||||
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/check_recharge_rune)
|
||||
var/atom/shield = parent
|
||||
if(ismob(shield.loc))
|
||||
var/mob/holder = shield.loc
|
||||
if(holder.is_holding(parent) && !shield_inhand)
|
||||
return
|
||||
set_wearer(holder)
|
||||
|
||||
/datum/component/shielded/UnregisterFromParent()
|
||||
UnregisterSignal(parent, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED, COMSIG_ITEM_HIT_REACT, COMSIG_PARENT_ATTACKBY))
|
||||
var/atom/shield = parent
|
||||
if(shield.loc == wearer)
|
||||
lost_wearer(src, wearer)
|
||||
|
||||
// Handle recharging, if we want to
|
||||
/datum/component/shielded/process(delta_time)
|
||||
@@ -96,12 +110,7 @@
|
||||
if(slot == ITEM_SLOT_HANDS && !shield_inhand)
|
||||
lost_wearer(source, user)
|
||||
return
|
||||
|
||||
wearer = user
|
||||
RegisterSignal(wearer, COMSIG_ATOM_UPDATE_OVERLAYS, .proc/on_update_overlays)
|
||||
RegisterSignal(wearer, COMSIG_PARENT_QDELETING, .proc/lost_wearer)
|
||||
if(current_charges)
|
||||
wearer.update_appearance(UPDATE_ICON)
|
||||
set_wearer(source, user)
|
||||
|
||||
/// Either we've been dropped or our wearer has been QDEL'd. Either way, they're no longer our problem
|
||||
/datum/component/shielded/proc/lost_wearer(datum/source, mob/user)
|
||||
@@ -112,6 +121,13 @@
|
||||
wearer.update_appearance(UPDATE_ICON)
|
||||
wearer = null
|
||||
|
||||
/datum/component/shielded/proc/set_wearer(mob/user)
|
||||
wearer = user
|
||||
RegisterSignal(wearer, COMSIG_ATOM_UPDATE_OVERLAYS, .proc/on_update_overlays)
|
||||
RegisterSignal(wearer, COMSIG_PARENT_QDELETING, .proc/lost_wearer)
|
||||
if(current_charges)
|
||||
wearer.update_appearance(UPDATE_ICON)
|
||||
|
||||
/// Used to draw the shield overlay on the wearer
|
||||
/datum/component/shielded/proc/on_update_overlays(atom/parent_atom, list/overlays)
|
||||
SIGNAL_HANDLER
|
||||
@@ -141,8 +157,6 @@
|
||||
INVOKE_ASYNC(src, .proc/actually_run_hit_callback, owner, attack_text, current_charges)
|
||||
|
||||
if(!recharge_start_delay) // if recharge_start_delay is 0, we don't recharge
|
||||
if(!current_charges) // obviously if someone ever adds a manual way to replenish charges, change this
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
START_PROCESSING(SSdcs, src) // if we DO recharge, start processing so we can do that
|
||||
@@ -158,16 +172,13 @@
|
||||
if(current_charges <= 0)
|
||||
owner.visible_message(span_warning("[owner]'s shield overloads!"))
|
||||
|
||||
/datum/component/shielded/proc/check_recharge_rune(datum/source, obj/item/wizard_armour_charge/recharge_rune, mob/living/user)
|
||||
/datum/component/shielded/proc/check_recharge_rune(datum/source, obj/item/recharge_rune, mob/living/user)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(!istype(recharge_rune))
|
||||
if(!istype(recharge_rune, recharge_path))
|
||||
return
|
||||
. = COMPONENT_NO_AFTERATTACK
|
||||
if(!istype(parent, /obj/item/clothing/suit/space/hardsuit/shielded/wizard))
|
||||
to_chat(user, span_warning("The rune can only be used on battlemage armour!"))
|
||||
return
|
||||
|
||||
current_charges += recharge_rune.restored_charges
|
||||
adjust_charge(charge_recovery)
|
||||
to_chat(user, span_notice("You charge \the [parent]. It can now absorb [current_charges] hits."))
|
||||
qdel(recharge_rune)
|
||||
|
||||
@@ -524,8 +524,8 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
|
||||
//Tries to dump content
|
||||
/datum/component/storage/proc/dump_content_at(atom/dest_object, mob/M)
|
||||
var/atom/A = parent
|
||||
var/atom/dump_destination = dest_object.get_dumping_location()
|
||||
if(A.Adjacent(M) && dump_destination && M.Adjacent(dump_destination))
|
||||
var/atom/dump_destination = get_dumping_location(dest_object)
|
||||
if(M.CanReach(A) && dump_destination && M.CanReach(dump_destination))
|
||||
if(locked)
|
||||
to_chat(M, span_warning("[parent] seems to be locked!"))
|
||||
return FALSE
|
||||
@@ -535,6 +535,12 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/component/storage/proc/get_dumping_location(atom/dest_object)
|
||||
var/datum/component/storage/storage = dest_object.GetComponent(/datum/component/storage)
|
||||
if(storage)
|
||||
return storage.real_location()
|
||||
return dest_object.get_dumping_location()
|
||||
|
||||
//This proc is called when you want to place an item into the storage item.
|
||||
/datum/component/storage/proc/attackby(datum/source, obj/item/I, mob/M, params)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -271,11 +271,10 @@
|
||||
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/T = target
|
||||
var/suit_slot = T.get_item_by_slot(ITEM_SLOT_OCLOTHING)
|
||||
|
||||
if(isnull(T.wear_suit) && isnull(T.w_uniform)) // who honestly puts all of their effort into tackling a naked guy?
|
||||
defense_mod += 2
|
||||
if(suit_slot && (istype(suit_slot,/obj/item/clothing/suit/space/hardsuit)))
|
||||
if(T.mob_negates_gravity())
|
||||
defense_mod += 1
|
||||
if(T.is_shove_knockdown_blocked()) // riot armor and such
|
||||
defense_mod += 5
|
||||
|
||||
Reference in New Issue
Block a user