Merge branch 'master' of https://github.com/tgstation/tgstation into upstream-sync

This commit is contained in:
xPokee
2025-10-03 07:05:54 -04:00
517 changed files with 24339 additions and 21253 deletions
+3
View File
@@ -132,11 +132,14 @@
/obj/item/mod/module/orebag,
/obj/item/mod/module/clamp,
/obj/item/mod/module/drill,
/obj/item/mod/module/magnetic_harness,
/obj/item/mod/module/mouthhole,
)
default_pins = list(
/obj/item/mod/module/gps,
/obj/item/mod/module/drill,
/obj/item/mod/module/clamp,
/obj/item/mod/module/orebag,
/obj/item/mod/module/sphere_transform,
)
+2
View File
@@ -179,6 +179,7 @@
balloon_alert(mod.wearer, "[src] activated, [used_button]-click to use") // As of now, only wearers can "use" mods
active = TRUE
SEND_SIGNAL(src, COMSIG_MODULE_ACTIVATED)
SEND_SIGNAL(mod, COMSIG_MOD_MODULE_ACTIVATED, src)
on_activation(activator)
update_clothing_slots()
return TRUE
@@ -198,6 +199,7 @@
UnregisterSignal(mod.wearer, used_signal)
used_signal = null
SEND_SIGNAL(src, COMSIG_MODULE_DEACTIVATED, mod.wearer)
SEND_SIGNAL(mod, COMSIG_MOD_MODULE_DEACTIVATED, src)
on_deactivation(activator, display_message = TRUE, deleting = FALSE)
update_clothing_slots()
return TRUE
+1 -1
View File
@@ -386,7 +386,7 @@
var/datum/storage/holding_storage = mod.loc.atom_storage
if(!holding_storage || holding_storage.max_specific_storage >= mod.w_class)
return
mod.forceMove(drop_location())
mod.forceMove(mod.drop_location())
/obj/item/mod/module/demoralizer
name = "MOD psi-echo demoralizer module"
+14 -19
View File
@@ -840,11 +840,6 @@
)
/// Materials that will be extracted.
var/list/accepted_mats
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_obj_entered),
COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON = PROC_REF(on_atom_initialized_on),
)
var/datum/component/connect_loc_behalf/connector
var/datum/component/material_container/container
/obj/item/mod/module/recycler/Initialize(mapload)
@@ -859,7 +854,7 @@
50 * SHEET_MATERIAL_AMOUNT, \
MATCONTAINER_EXAMINE | MATCONTAINER_NO_INSERT, \
container_signals = list( \
COMSIG_MATCONTAINER_SHEETS_RETRIEVED = TYPE_PROC_REF(/obj/item/mod/module/recycler, InsertSheets) \
COMSIG_MATCONTAINER_STACK_RETRIEVED = TYPE_PROC_REF(/obj/item/mod/module/recycler, InsertSheets) \
) \
)
@@ -868,16 +863,20 @@
return ..()
/obj/item/mod/module/recycler/on_activation(mob/activator)
connector = AddComponent(/datum/component/connect_loc_behalf, mod.wearer, loc_connections)
RegisterSignal(mod.wearer, COMSIG_MOVABLE_MOVED, PROC_REF(on_wearer_moved))
/obj/item/mod/module/recycler/on_deactivation(mob/activator, display_message, deleting = FALSE)
QDEL_NULL(connector)
UnregisterSignal(mod.wearer, COMSIG_MOVABLE_MOVED, PROC_REF(on_wearer_moved))
UnregisterSignal(mod.wearer, COMSIG_MOVABLE_MOVED)
if(mod.wearer.loc)
UnregisterSignal(mod.wearer.loc, list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON))
/obj/item/mod/module/recycler/proc/on_wearer_moved(datum/source, atom/old_loc, dir, forced)
SIGNAL_HANDLER
if(old_loc)
UnregisterSignal(mod.wearer.loc, list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON))
if(mod.wearer.loc)
RegisterSignal(mod.wearer.loc, COMSIG_ATOM_ENTERED, PROC_REF(on_obj_entered))
RegisterSignal(mod.wearer.loc, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON, PROC_REF(on_atom_initialized_on))
for(var/obj/item/item in mod.wearer.loc)
if(!is_type_in_list(item, allowed_item_types))
return
@@ -885,18 +884,14 @@
/obj/item/mod/module/recycler/proc/on_obj_entered(atom/new_loc, atom/movable/arrived, atom/old_loc)
SIGNAL_HANDLER
if(!is_type_in_list(arrived, allowed_item_types))
return
insert_trash(arrived)
if(is_type_in_list(arrived, allowed_item_types))
insert_trash(arrived)
/obj/item/mod/module/recycler/proc/on_atom_initialized_on(atom/loc, atom/new_atom)
SIGNAL_HANDLER
if(!is_type_in_list(new_atom, allowed_item_types))
return
//Give the new atom the time to fully initialize and maybe live if the wearer moves away.
addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/item/mod/module/recycler, insert_trash_if_nearby), new_atom), 0.5 SECONDS)
// Give the new atom the time to fully initialize and maybe live if the wearer moves away.
if(is_type_in_list(new_atom, allowed_item_types))
addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/item/mod/module/recycler, insert_trash_if_nearby), new_atom), 0.5 SECONDS)
/obj/item/mod/module/recycler/proc/insert_trash_if_nearby(atom/new_atom)
if(new_atom && mod?.wearer && new_atom.loc == mod.wearer.loc)
+25
View File
@@ -317,10 +317,16 @@
var/you_fucked_up = FALSE
/obj/item/mod/module/atrocinator/on_activation(mob/activator)
// Auto-unbuckle anyone being carried to avoid lag issues
if(length(mod.wearer.buckled_mobs))
mod.wearer.visible_message("As [mod.wearer] flips, [mod.wearer.buckled_mobs[1]] flies off of [mod.wearer.p_their()] back!")
mod.wearer.unbuckle_all_mobs()
playsound(src, 'sound/effects/curse/curseattack.ogg', 50)
mod.wearer.AddElement(/datum/element/forced_gravity, NEGATIVE_GRAVITY)
RegisterSignal(mod.wearer, COMSIG_MOVABLE_MOVED, PROC_REF(check_upstairs))
RegisterSignal(mod.wearer, COMSIG_MOB_SAY, PROC_REF(on_talk))
RegisterSignal(mod.wearer, COMSIG_MOVABLE_PREBUCKLE, PROC_REF(on_someone_buckled))
ADD_TRAIT(mod.wearer, TRAIT_SILENT_FOOTSTEPS, REF(src))
passtable_on(mod.wearer, REF(src))
check_upstairs() //todo at some point flip your screen around
@@ -337,6 +343,7 @@
qdel(mod.wearer.RemoveElement(/datum/element/forced_gravity, NEGATIVE_GRAVITY))
UnregisterSignal(mod.wearer, COMSIG_MOVABLE_MOVED)
UnregisterSignal(mod.wearer, COMSIG_MOB_SAY)
UnregisterSignal(mod.wearer, COMSIG_MOVABLE_PREBUCKLE)
step_count = 0
REMOVE_TRAIT(mod.wearer, TRAIT_SILENT_FOOTSTEPS, REF(src))
passtable_off(mod.wearer, REF(src))
@@ -350,6 +357,16 @@
if(you_fucked_up || mod.wearer.has_gravity() > NEGATIVE_GRAVITY)
return
// Prevent infinite loops when being fireman carried - Stack trace if it does
if(mod.wearer.buckled)
stack_trace("Atrocinator user is buckled despite protections - this shouldn't happen!")
return
// Prevent infinite loops when carrying someone - Stack trace if it does
if(length(mod.wearer.buckled_mobs))
stack_trace("Atrocinator user is carrying someone despite protections - this shouldn't happen!")
return
var/turf/open/current_turf = get_turf(mod.wearer)
var/turf/open/openspace/turf_above = get_step_multiz(mod.wearer, UP)
if(current_turf && istype(turf_above))
@@ -384,6 +401,14 @@
SIGNAL_HANDLER
speech_args[SPEECH_SPANS] |= "upside_down"
/// Prevent someone from being buckled to the wearer while atrocinator is active
/obj/item/mod/module/atrocinator/proc/on_someone_buckled(datum/source, mob/living/buckled_mob, mob/living/buckler)
SIGNAL_HANDLER
balloon_alert(buckler, "[buckler == mod.wearer ? "you're" : "they're"] upside down!")
return COMPONENT_BLOCK_BUCKLE
/obj/item/mod/module/recycler/donk/safe
name = "MOD foam dart recycler module"
desc = "A mod module that collects and repackages fired foam darts into half-sized ammo boxes. \
+10 -3
View File
@@ -10,7 +10,7 @@
incompatible_modules = list(/obj/item/mod/module/magnetic_harness)
required_slots = list(ITEM_SLOT_OCLOTHING)
/// Time before we activate the magnet.
var/magnet_delay = 0.8 SECONDS
var/magnet_delay = 0.5 SECONDS
/// The typecache of all guns we allow.
var/static/list/guns_typecache
/// The guns already allowed by the modsuit chestplate.
@@ -19,7 +19,14 @@
/obj/item/mod/module/magnetic_harness/Initialize(mapload)
. = ..()
if(!guns_typecache)
guns_typecache = typecacheof(list(/obj/item/gun/ballistic, /obj/item/gun/energy, /obj/item/gun/grenadelauncher, /obj/item/gun/chem, /obj/item/gun/syringe))
guns_typecache = typecacheof(list(
/obj/item/gun/ballistic,
/obj/item/gun/energy,
/obj/item/gun/grenadelauncher,
/obj/item/gun/chem,
/obj/item/gun/syringe,
/obj/item/kinetic_crusher,
))
/obj/item/mod/module/magnetic_harness/on_install()
. = ..()
@@ -139,7 +146,7 @@
/obj/item/mod/module/holster/on_uninstall(deleting = FALSE)
. = ..()
if(holstered)
holstered.forceMove(drop_location())
holstered.forceMove(mod.drop_location())
/obj/item/mod/module/holster/Exited(atom/movable/gone, direction)
if(gone == holstered)
+218 -97
View File
@@ -47,7 +47,6 @@
/// The crates stored in the module.
var/list/stored_crates = list()
/obj/item/mod/module/clamp/Initialize(mapload)
. = ..()
accepted_items = typecacheof(list(
@@ -125,55 +124,110 @@
///Drill - Lets you dig through rock and basalt.
/obj/item/mod/module/drill
name = "MOD drill module"
desc = "An integrated drill, typically extending over the user's hand. While useful for drilling through rock, \
your drill is surely the one that both pierces and creates the heavens."
desc = "An arm-mounted drill, typically extending over the user's hand. While useful for drilling through rock, \
your drill is surely the one that both pierces and creates the heavens. Integrates with mining MODs' sphere \
transformation module, changing it from a mere traversal tool to high-powered excavation unit."
icon_state = "drill"
module_type = MODULE_ACTIVE
complexity = 1
use_energy_cost = DEFAULT_CHARGE_DRAIN
incompatible_modules = list(/obj/item/mod/module/drill)
cooldown_time = 0.5 SECONDS
cooldown_time = 0.2 SECONDS
overlay_state_active = "module_drill"
required_slots = list(ITEM_SLOT_GLOVES)
toolspeed = 0.25
/// Are we currently in passive sphere mode?
var/ballin = FALSE
/// Last tick when we bumpmined. Prevents diagonal bumpnining being thrice as fast as normal
var/last_bumpmine_tick = -1
/// Mining skill experience multiplier for bumpmining
var/exp_multiplier = 1
/// Cooldown on gibtonite detonation warnings
COOLDOWN_DECLARE(gibtonite_warning_cd)
/obj/item/mod/module/drill/on_install()
. = ..()
RegisterSignal(mod, COMSIG_MOD_MODULE_ACTIVATED, PROC_REF(on_module_activated))
RegisterSignal(mod, COMSIG_MOD_MODULE_DEACTIVATED, PROC_REF(on_module_deactivated))
/obj/item/mod/module/drill/on_uninstall(deleting)
. = ..()
UnregisterSignal(mod, list(COMSIG_MOD_MODULE_ACTIVATED, COMSIG_MOD_MODULE_DEACTIVATED))
toolspeed = initial(toolspeed)
use_energy_cost = initial(use_energy_cost)
exp_multiplier = initial(exp_multiplier)
ballin = FALSE
/obj/item/mod/module/drill/on_activation(mob/activator)
if (ballin)
return
tool_behaviour = TOOL_MINING
RegisterSignal(mod.wearer, COMSIG_MOVABLE_BUMP, PROC_REF(bump_mine))
/obj/item/mod/module/drill/on_deactivation(mob/activator, display_message = TRUE, deleting = FALSE)
if (ballin)
return
tool_behaviour = NONE
UnregisterSignal(mod.wearer, COMSIG_MOVABLE_BUMP)
/obj/item/mod/module/drill/on_select_use(atom/target)
. = ..()
if(!.)
if(!. || !mod.wearer.Adjacent(target))
return
if(!mod.wearer.Adjacent(target))
if(!ismineralturf(target) || !isasteroidturf(target))
return
if(ismineralturf(target))
var/turf/closed/mineral/mineral_turf = target
mineral_turf.gets_drilled(mod.wearer)
drain_power(use_energy_cost)
else if(isasteroidturf(target))
var/turf/open/misc/asteroid/sand_turf = target
if(!sand_turf.can_dig(mod.wearer))
return
sand_turf.getDug()
drain_power(use_energy_cost)
if(drain_power(use_energy_cost))
target.attackby(src, mod.wearer)
/obj/item/mod/module/drill/proc/bump_mine(mob/living/carbon/human/bumper, atom/bumped_into, proximity)
SIGNAL_HANDLER
if(!ismineralturf(bumped_into) || !drain_power(use_energy_cost))
return
var/turf/closed/mineral/mineral_turf = bumped_into
var/turf/closed/mineral/gibtonite/giberal_turf = mineral_turf
if(istype(giberal_turf) && giberal_turf.stage != GIBTONITE_UNSTRUCK)
playsound(bumper, 'sound/machines/scanner/scanbuzz.ogg', 25, TRUE, SILENCED_SOUND_EXTRARANGE)
to_chat(bumper, span_warning("[icon2html(src, bumper)] Unstable gibtonite ore deposit detected! Drills disabled."))
on_deactivation()
return
mineral_turf.gets_drilled(mod.wearer)
return COMPONENT_CANCEL_ATTACK_CHAIN
///Ore Bag - Lets you pick up ores and drop them from the suit.
if (world.time == last_bumpmine_tick)
return
if (!ismineralturf(bumped_into) || !drain_power(use_energy_cost))
return
var/turf/closed/mineral/gibtonite/giberal_turf = bumped_into
if (!istype(giberal_turf) || giberal_turf.stage != GIBTONITE_UNSTRUCK)
last_bumpmine_tick = world.time
var/turf/closed/mineral/rock = bumped_into
INVOKE_ASYNC(rock, TYPE_PROC_REF(/atom, attackby), src, bumper, null, null, exp_multiplier)
return
if (!COOLDOWN_FINISHED(src, gibtonite_warning_cd))
return
COOLDOWN_START(src, gibtonite_warning_cd, 3 SECONDS)
playsound(bumper, 'sound/machines/scanner/scanbuzz.ogg', 25, TRUE, SILENCED_SOUND_EXTRARANGE)
to_chat(bumper, span_warning("[icon2html(src, bumper)] Unstable gibtonite ore deposit detected!"))
/obj/item/mod/module/drill/proc/on_module_activated(datum/source, obj/item/mod/module/module)
SIGNAL_HANDLER
if (!istype(module, /obj/item/mod/module/sphere_transform))
return
// In sphere mode we get instamine and halved power drain
toolspeed = 0
use_energy_cost *= 0.5
exp_multiplier *= 0.2
if (!active)
on_activation()
ballin = TRUE
/obj/item/mod/module/drill/proc/on_module_deactivated(datum/source, obj/item/mod/module/module)
SIGNAL_HANDLER
if (!istype(module, /obj/item/mod/module/sphere_transform))
return
toolspeed = initial(toolspeed)
use_energy_cost *= 2
exp_multiplier /= 2
ballin = FALSE
if (!active)
on_deactivation()
/// Ore Bag - Lets you pick up ores and drop them from the suit.
/obj/item/mod/module/orebag
name = "MOD ore bag module"
desc = "An integrated ore storage system installed into the suit, \
@@ -187,39 +241,65 @@
cooldown_time = 0.5 SECONDS
allow_flags = MODULE_ALLOW_INACTIVE
required_slots = list(ITEM_SLOT_BACK)
/// The ores stored in the bag.
var/list/ores = list()
/// Are we currently dropping off ores? Used to prevent the bag from instantly picking up ores after dropping them
var/dropping_ores = FALSE
/obj/item/mod/module/orebag/on_equip()
RegisterSignal(mod.wearer, COMSIG_MOVABLE_MOVED, PROC_REF(ore_pickup))
RegisterSignal(mod.wearer, COMSIG_MOVABLE_MOVED, PROC_REF(on_wearer_moved))
if (mod.wearer.loc)
RegisterSignal(mod.wearer.loc, COMSIG_ATOM_ENTERED, PROC_REF(on_obj_entered))
RegisterSignal(mod.wearer.loc, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON, PROC_REF(on_atom_initialized_on))
/obj/item/mod/module/orebag/on_unequip()
UnregisterSignal(mod.wearer, COMSIG_MOVABLE_MOVED)
if (mod.wearer.loc)
UnregisterSignal(mod.wearer.loc, list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON))
/obj/item/mod/module/orebag/proc/ore_pickup(atom/movable/source, atom/old_loc, dir, forced)
/obj/item/mod/module/orebag/proc/on_wearer_moved(atom/movable/source, atom/old_loc, dir, forced)
SIGNAL_HANDLER
if(old_loc)
UnregisterSignal(old_loc, list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON))
if(mod.wearer.loc)
RegisterSignal(mod.wearer.loc, COMSIG_ATOM_ENTERED, PROC_REF(on_obj_entered))
RegisterSignal(mod.wearer.loc, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON, PROC_REF(on_atom_initialized_on))
var/ore_found = FALSE
for(var/obj/item/stack/ore/ore in get_turf(mod.wearer))
ore_found = TRUE
INVOKE_ASYNC(src, PROC_REF(move_ore), ore)
playsound(src, SFX_RUSTLE, 50, TRUE)
if (ore_found)
playsound(mod.wearer, SFX_RUSTLE, 50, TRUE)
/obj/item/mod/module/orebag/proc/move_ore(obj/item/stack/ore)
for(var/obj/item/stack/stored_ore as anything in ores)
for(var/obj/item/stack/ore/stored_ore as anything in src)
if(!ore.can_merge(stored_ore))
continue
ore.merge(stored_ore)
if(QDELETED(ore))
return
break
ore.forceMove(src)
ores += ore
/obj/item/mod/module/orebag/on_use(mob/activator)
for(var/obj/item/ore as anything in ores)
ore.forceMove(drop_location())
ores -= ore
dropping_ores = TRUE
for(var/obj/item/ore as anything in src)
ore.forceMove(mod.drop_location())
dropping_ores = FALSE
drain_power(use_energy_cost)
/obj/item/mod/module/orebag/proc/on_obj_entered(atom/new_loc, atom/movable/arrived, atom/old_loc)
SIGNAL_HANDLER
if(istype(arrived, /obj/item/stack/ore) && !dropping_ores)
INVOKE_ASYNC(src, PROC_REF(move_ore), arrived)
playsound(mod.wearer, SFX_RUSTLE, 50, TRUE)
/obj/item/mod/module/orebag/proc/on_atom_initialized_on(atom/loc, atom/new_atom)
SIGNAL_HANDLER
if(is_type_in_list(new_atom, /obj/item/stack/ore))
INVOKE_ASYNC(src, PROC_REF(move_ore), new_atom)
playsound(mod.wearer, SFX_RUSTLE, 50, TRUE)
/obj/item/mod/module/hydraulic
name = "MOD loader hydraulic arms module"
desc = "A pair of powerful hydraulic arms installed in a MODsuit."
@@ -381,18 +461,18 @@
/// Armor values per tile.
var/datum/armor/armor_mod = /datum/armor/mod_ash_accretion
/// Speed added when you're fully covered in ash.
var/speed_added = -0.75
var/speed_added = -0.5
/// Turfs that let us accrete ash.
var/static/list/accretion_turfs
/// Turfs that let us keep ash.
var/static/list/keep_turfs
/datum/armor/mod_ash_accretion
melee = 4
melee = 3 // 50 armor when fully covered in ash, equal to two plates on an explorer suit
bullet = 1
laser = 2
energy = 2
bomb = 4
bomb = 3
/obj/item/mod/module/ash_accretion/Initialize(mapload)
. = ..()
@@ -446,32 +526,44 @@
/obj/item/mod/module/ash_accretion/proc/on_move(atom/source, atom/oldloc, dir, forced)
if(!isturf(mod.wearer.loc)) //dont lose ash from going in a locker
return
if(traveled_tiles) //leave ash every tile
new /obj/effect/temp_visual/light_ash(get_turf(src))
if(is_type_in_typecache(mod.wearer.loc, accretion_turfs))
if(traveled_tiles >= max_traveled_tiles)
return
traveled_tiles++
for(var/obj/item/part as anything in mod.get_parts(all = TRUE))
part.set_armor(part.get_armor().add_other_armor(armor_mod))
if(traveled_tiles >= max_traveled_tiles)
balloon_alert(mod.wearer, "fully ash covered")
mod.wearer.color = list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,3) //make them super light
animate(mod.wearer, 1 SECONDS, color = null, flags = ANIMATION_PARALLEL)
playsound(src, 'sound/effects/sparks/sparks1.ogg', 100, TRUE)
mod.update_speed()
else if(is_type_in_typecache(mod.wearer.loc, keep_turfs))
return
else
if(traveled_tiles <= 0)
if(traveled_tiles < max_traveled_tiles)
return
traveled_tiles--
if(traveled_tiles == max_traveled_tiles - 1) // Just lost our speed buff
mod.update_speed()
for(var/obj/item/part as anything in mod.get_parts(all = TRUE))
part.set_armor(part.get_armor().subtract_other_armor(armor_mod))
if(traveled_tiles <= 0)
balloon_alert(mod.wearer, "ran out of ash!")
balloon_alert(mod.wearer, "fully ash covered")
var/cur_color = mod.wearer.color
mod.wearer.color = list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,3) // Make them super light
animate(mod.wearer, 1 SECONDS, color = cur_color, flags = ANIMATION_PARALLEL)
playsound(src, 'sound/effects/sparks/sparks1.ogg', 100, TRUE)
mod.update_speed()
return
if(is_type_in_typecache(mod.wearer.loc, keep_turfs))
return
if(traveled_tiles) //leave ash every tile
new /obj/effect/temp_visual/light_ash(get_turf(src))
if(traveled_tiles <= 0)
return
traveled_tiles--
if(traveled_tiles == max_traveled_tiles - 1) // Just lost our speed buff
mod.update_speed()
for(var/obj/item/part as anything in mod.get_parts(all = TRUE))
part.set_armor(part.get_armor().subtract_other_armor(armor_mod))
if(traveled_tiles <= 0)
balloon_alert(mod.wearer, "ran out of ash!")
/obj/item/mod/module/sphere_transform
name = "MOD sphere transform module"
@@ -483,17 +575,60 @@
active_power_cost = DEFAULT_CHARGE_DRAIN * 0.5
use_energy_cost = DEFAULT_CHARGE_DRAIN * 3
incompatible_modules = list(/obj/item/mod/module/sphere_transform)
cooldown_time = 1.25 SECONDS
cooldown_time = 1 SECONDS
required_slots = list(ITEM_SLOT_HEAD|ITEM_SLOT_MASK, ITEM_SLOT_OCLOTHING|ITEM_SLOT_ICLOTHING, ITEM_SLOT_GLOVES, ITEM_SLOT_FEET)
/// Time it takes us to complete the animation.
var/animate_time = 0.25 SECONDS
/// Armor values when active
var/datum/armor/armor_mod = /datum/armor/mod_sphere_transform
/// List of traits to add/remove from our subject as needed.
var/static/list/user_traits = list(
var/list/user_traits = list(
TRAIT_FORCED_STANDING,
TRAIT_HANDS_BLOCKED,
TRAIT_LAVA_IMMUNE,
TRAIT_NO_SLIP_ALL,
)
/// Has the module been upgraded with bileworm hide plating?
var/hide_upgrade = FALSE
/// How much hide is required to reinforce the MOD
var/hide_amount = 2 // These are rather rare as of now, should be increased later once other methods of crossing lava are removed
/datum/armor/mod_sphere_transform
melee = 20 // Can get up to 70 armor when ash covered and ballin, which is as good as a HECK suit... but you can't really attack anymore
bomb = 20
/obj/item/mod/module/sphere_transform/on_install()
. = ..()
RegisterSignal(mod, COMSIG_ATOM_ITEM_INTERACTION, PROC_REF(on_item_interaction))
// Isn't supposed to happen outside of deletion but just in case
/obj/item/mod/module/sphere_transform/on_uninstall(deleting)
. = ..()
// No need to drop the hide as we're supposed to be inbuilt and unremovable
UnregisterSignal(mod, COMSIG_ATOM_ITEM_INTERACTION)
/obj/item/mod/module/sphere_transform/proc/on_item_interaction(atom/movable/source, mob/living/user, obj/item/item, modifiers)
SIGNAL_HANDLER
if(!istype(item, /obj/item/stack/sheet/animalhide/bileworm))
return NONE
if (hide_upgrade)
to_chat(user, span_warning("[mod] is already reinforced with bileworm skin!"))
return ITEM_INTERACT_BLOCKING
var/obj/item/stack/sheet/animalhide/bileworm/hide = item
if (!hide.use(hide_amount))
to_chat(user, span_warning("You need more hide to fully reinforce [mod]!"))
return ITEM_INTERACT_BLOCKING
hide_upgrade = TRUE
overlay_state_inactive = "module_bileworm_bracing"
user_traits += TRAIT_LAVA_IMMUNE
mod.balloon_alert(user, "plating reinforced!")
if (active)
ADD_TRAIT(mod.wearer, TRAIT_LAVA_IMMUNE, REF(src))
update_clothing_slots()
return ITEM_INTERACT_SUCCESS
/obj/item/mod/module/sphere_transform/activate(mob/activator)
if(!mod.wearer.has_gravity())
@@ -507,13 +642,15 @@
mod.wearer.add_filter("mod_blur", 2, angular_blur_filter(size = 15))
mod.wearer.add_filter("mod_outline", 3, outline_filter(color = "#000000AA"))
mod.wearer.add_offsets(REF(src), y_add = -4)
mod.wearer.SpinAnimation(1.5)
mod.wearer.SpinAnimation(1.5, tag = "sphere_transform")
mod.wearer.add_traits(user_traits, REF(src))
mod.wearer.RemoveElement(/datum/element/footstep, FOOTSTEP_MOB_HUMAN, 1, -6)
mod.wearer.AddElement(/datum/element/footstep, FOOTSTEP_OBJ_ROBOT, 1, -6, sound_vary = TRUE)
mod.wearer.add_movespeed_mod_immunities(REF(src), /datum/movespeed_modifier/damage_slowdown)
mod.wearer.add_movespeed_modifier(/datum/movespeed_modifier/sphere)
RegisterSignal(mod.wearer, COMSIG_MOB_STATCHANGE, PROC_REF(on_statchange))
for(var/obj/item/part as anything in mod.get_parts(all = TRUE))
part.set_armor(part.get_armor().add_other_armor(armor_mod))
/obj/item/mod/module/sphere_transform/on_deactivation(mob/activator, display_message = TRUE, deleting = FALSE)
if(!deleting)
@@ -522,11 +659,13 @@
addtimer(CALLBACK(mod.wearer, TYPE_PROC_REF(/datum, remove_filter), list("mod_ball", "mod_blur", "mod_outline")), animate_time)
mod.wearer.remove_traits(user_traits, REF(src))
mod.wearer.remove_movespeed_mod_immunities(REF(src), /datum/movespeed_modifier/damage_slowdown)
animate(mod.wearer, time = 0)
animate(mod.wearer, tag = "sphere_transform")
mod.wearer.RemoveElement(/datum/element/footstep, FOOTSTEP_OBJ_ROBOT, 1, -6, sound_vary = TRUE)
mod.wearer.AddElement(/datum/element/footstep, FOOTSTEP_MOB_HUMAN, 1, -6)
mod.wearer.remove_movespeed_modifier(/datum/movespeed_modifier/sphere)
UnregisterSignal(mod.wearer, COMSIG_MOB_STATCHANGE)
for(var/obj/item/part as anything in mod.get_parts(all = TRUE))
part.set_armor(part.get_armor().subtract_other_armor(armor_mod))
/obj/item/mod/module/sphere_transform/used(mob/activator)
if(!lavaland_equipment_pressure_check(get_turf(src)))
@@ -539,7 +678,7 @@
. = ..()
if(!.)
return
var/obj/projectile/bomb = new /obj/projectile/bullet/mining_bomb(mod.wearer.loc)
var/obj/projectile/bullet/mining_bomb/bomb = new(mod.wearer.loc)
bomb.aim_projectile(target, mod.wearer)
bomb.firer = mod.wearer
playsound(src, 'sound/items/weapons/gun/general/grenade_launch.ogg', 75, TRUE)
@@ -547,17 +686,13 @@
drain_power(use_energy_cost)
/obj/item/mod/module/sphere_transform/on_active_process(seconds_per_tick)
animate(mod.wearer) //stop the animation
mod.wearer.SpinAnimation(1.5) //start it back again
if(!mod.wearer.has_gravity())
deactivate() //deactivate in no grav
/obj/item/mod/module/sphere_transform/proc/on_statchange(datum/source)
SIGNAL_HANDLER
if(!mod.wearer.stat)
return
deactivate()
if(mod.wearer.stat)
deactivate()
/obj/projectile/bullet/mining_bomb
name = "mining bomb"
@@ -596,46 +731,32 @@
light_power = 1
light_color = COLOR_LIGHT_ORANGE
/// Time to prime the explosion
var/prime_time = 0.5 SECONDS
var/prime_time = 0.1 SECONDS
/// Time to explode from the priming
var/explosion_time = 1 SECONDS
var/explosion_time = 0.9 SECONDS // Roughly this much until the blast part of the explosion animation
/// Damage done on explosion.
var/damage = 12
var/damage = 7
/// Damage multiplier on hostile fauna.
var/fauna_boost = 4
/// Image overlaid on explosion.
var/static/image/explosion_image
/obj/structure/mining_bomb/Initialize(mapload, atom/movable/firer)
. = ..()
generate_image()
/obj/structure/mining_bomb/on_changed_z_level(turf/old_turf, turf/new_turf, same_z_layer, notify_contents)
if(same_z_layer)
return ..()
explosion_image = null
generate_image()
return ..()
/obj/structure/mining_bomb/proc/generate_image()
explosion_image = image('icons/effects/96x96.dmi', "judicial_explosion")
explosion_image.pixel_w = -32
explosion_image.pixel_z = -32
SET_PLANE_EXPLICIT(explosion_image, ABOVE_GAME_PLANE, src)
/obj/structure/mining_bomb/proc/prime(atom/movable/firer)
add_overlay(explosion_image)
var/mutable_appearance/explosion_image = mutable_appearance('icons/effects/96x96.dmi', "judicial_explosion", FLOAT_LAYER, src, ABOVE_GAME_PLANE)
explosion_image.pixel_w = -32
explosion_image.pixel_z = -32
var/turf/our_loc = get_turf(src)
our_loc.flick_overlay_view(explosion_image, 1.35 SECONDS)
addtimer(CALLBACK(src, PROC_REF(boom), firer), explosion_time)
/obj/structure/mining_bomb/proc/boom(atom/movable/firer)
visible_message(span_danger("[src] explodes!"))
playsound(src, 'sound/effects/magic/magic_missile.ogg', 200, vary = TRUE)
for(var/turf/closed/mineral/rock in circle_range_turfs(src, 2))
for(var/turf/closed/mineral/rock in circle_range_turfs(src, 1))
rock.gets_drilled()
for(var/mob/living/victim in range(1, src))
if(HAS_TRAIT(victim, TRAIT_MINING_AOE_IMMUNE))
continue
victim.apply_damage(damage * (ismining(victim) ? fauna_boost : 1), BRUTE, spread_damage = TRUE)
to_chat(victim, span_userdanger("You are hit by a mining bomb explosion!"))
if(!firer)
continue
if(ishostile(victim))