Skip to content

Commit

Permalink
loader
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsar-Salat committed Aug 18, 2024
1 parent a31e57b commit 6386955
Show file tree
Hide file tree
Showing 26 changed files with 359 additions and 55 deletions.
1 change: 1 addition & 0 deletions beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@
#include "code\__DEFINES\dcs\signals\signals_turf.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_attack.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movement.dm"
#include "code\__DEFINES\dcs\signals\signals_datum\signals_circuit.dm"
#include "code\__DEFINES\dcs\signals\signals_datum\signals_datum.dm"
#include "code\__DEFINES\dcs\signals\signals_datum\signals_moveloop.dm"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Atom movement signals. Format:
// When the signal is called: (signal arguments)
// All signals send the source datum of the signal as the first argument

///signal sent out by an atom when it is no longer being pulled by something else : (atom/puller)
#define COMSIG_ATOM_NO_LONGER_PULLED "movable_no_longer_pulled"
///signal sent out by an atom when it is no longer pulling something : (atom/pulling)
#define COMSIG_ATOM_NO_LONGER_PULLING "movable_no_longer_pulling"
24 changes: 24 additions & 0 deletions code/__HELPERS/turfs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,30 @@ Turf and target are separate in case you want to teleport some distance from a t

return locate(x,y,target_atom.z)

/**
* Get ranged target turf, but with direct targets as opposed to directions
*
* Starts at atom starting_atom and gets the exact angle between starting_atom and target
* Moves from starting_atom with that angle, Range amount of times, until it stops, bound to map size
* Arguments:
* * starting_atom - Initial Firer / Position
* * target - Target to aim towards
* * range - Distance of returned target turf from starting_atom
* * offset - Angle offset, 180 input would make the returned target turf be in the opposite direction
*/
/proc/get_ranged_target_turf_direct(atom/starting_atom, atom/target, range, offset)
var/angle = ATAN2(target.x - starting_atom.x, target.y - starting_atom.y)
if(offset)
angle += offset
var/turf/starting_turf = get_turf(starting_atom)
for(var/i in 1 to range)
var/turf/check = locate(starting_atom.x + cos(angle) * i, starting_atom.y + sin(angle) * i, starting_atom.z)
if(!check)
break
starting_turf = check

return starting_turf

/// returns turf relative to target_atom offset in dx and dy tiles, bound to map limits
/proc/get_offset_target_turf(atom/target_atom, dx, dy)
var/x = min(world.maxx, max(1, target_atom.x + dx))
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/shuttle_cling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

ADD_TRAIT(parent, TRAIT_HYPERSPACED, src)

RegisterSignals(parent, list(COMSIG_MOVABLE_MOVED, COMSIG_MOVABLE_UNBUCKLE, COMSIG_MOVABLE_NO_LONGER_PULLED, COMSIG_MOVABLE_POST_THROW), PROC_REF(update_state))
RegisterSignals(parent, list(COMSIG_MOVABLE_MOVED, COMSIG_MOVABLE_UNBUCKLE, COMSIG_ATOM_NO_LONGER_PULLED, COMSIG_MOVABLE_POST_THROW), PROC_REF(update_state))

//Items have this cool thing where they're first put on the floor if you grab them from storage, and then into your hand, which isn't caught by movement signals that well
if(isitem(parent))
Expand Down
24 changes: 13 additions & 11 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,18 @@
return TRUE

/atom/movable/proc/stop_pulling()
if(pulling)
if(ismob(pulling?.pulledby))
pulling.pulledby.log_message("has stopped pulling [key_name(pulling)]", LOG_ATTACK)
if(ismob(pulling))
pulling.log_message("has stopped being pulled by [key_name(pulling.pulledby)]", LOG_ATTACK)
pulling.set_pulledby(null)
var/mob/living/ex_pulled = pulling
setGrabState(GRAB_PASSIVE)
pulling = null
SEND_SIGNAL(ex_pulled, COMSIG_MOVABLE_NO_LONGER_PULLED)
if(!pulling)
return
if(ismob(pulling?.pulledby))
pulling.pulledby.log_message("has stopped pulling [key_name(pulling)]", LOG_ATTACK)
if(ismob(pulling))
pulling.log_message("has stopped being pulled by [key_name(pulling.pulledby)]", LOG_ATTACK)
pulling.set_pulledby(null)
setGrabState(GRAB_PASSIVE)
var/mob/living/old_pulling = pulling
pulling = null
SEND_SIGNAL(old_pulling, COMSIG_ATOM_NO_LONGER_PULLED, src)
SEND_SIGNAL(src, COMSIG_ATOM_NO_LONGER_PULLING, old_pulling)

///Reports the event of the change in value of the pulledby variable.
/atom/movable/proc/set_pulledby(new_pulledby)
Expand Down Expand Up @@ -680,7 +682,7 @@
/atom/movable/proc/Process_Spacemove(movement_dir = 0)
if(SEND_SIGNAL(src, COMSIG_MOVABLE_SPACEMOVE, movement_dir) & COMSIG_MOVABLE_STOP_SPACEMOVE)
return TRUE

if(has_gravity(src))
return 1

Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/suit_storage_unit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
/// How fast it charges cells in a suit
var/charge_rate = 250

/obj/machinery/suit_storage_unit/industrial/loader
mod_type = /obj/item/mod/control/pre_equipped/loader

/obj/machinery/suit_storage_unit/Initialize(mapload)
. = ..()
interaction_flags_machine |= INTERACT_MACHINE_OFFLINE
Expand Down
14 changes: 8 additions & 6 deletions code/game/objects/effects/spawners/random/mod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@
/obj/effect/spawner/random/mod/maint
name = "maint MOD module spawner"
loot = list(
/obj/item/mod/module/springlock,
/obj/item/mod/module/visor/rave,
/obj/item/mod/module/tanner,
/obj/item/mod/module/balloon,
/obj/item/mod/module/paper_dispenser,
/obj/item/mod/module/springlock = 2,
/obj/item/mod/module/visor/rave = 2,
/obj/item/mod/module/tanner = 1,
/obj/item/mod/module/balloon = 1,
/obj/item/mod/module/paper_dispenser = 1,
/obj/item/mod/module/hat_stabilizer = 2,
/obj/item/mod/module/stamp = 1
)
/obj/effect/spawner/random/mod/maint/Initialize(mapload)
if(SSmapping.level_trait(z, ZTRAIT_UP) || SSmapping.level_trait(z, ZTRAIT_DOWN))
loot += /obj/item/mod/module/atrocinator
loot += list(/obj/item/mod/module/atrocinator = 3)
return ..()
*/
5 changes: 4 additions & 1 deletion code/game/objects/structures/crates_lockers/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
var/opened = FALSE
var/welded = FALSE
var/locked = FALSE
var/divable = TRUE //controls whether someone with skittish trait can enter the closet with CtrlShiftClick
/// Whether a skittish person can dive inside this closet. Disable if opening the closet causes "bad things" to happen or that it leads to a logical inconsistency.
var/divable = TRUE
/// true whenever someone with the strong pull component (or magnet modsuit module) is dragging this, preventing opening
var/strong_grab = FALSE
var/large = TRUE
var/wall_mounted = 0 //never solid (You can always pass over it)
var/breakout_time = 1200
Expand Down
4 changes: 4 additions & 0 deletions code/modules/jobs/job_types/cargo_technician.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@
uniform = /obj/item/clothing/under/rank/cargo/tech
l_hand = /obj/item/export_scanner

/datum/outfit/job/cargo_tech/mod
name = "Cargo Technician (MODsuit)"

back = /obj/item/mod/control/pre_equipped/loader
1 change: 0 additions & 1 deletion code/modules/jobs/job_types/research_director.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,4 @@
back = /obj/item/mod/control/pre_equipped/research
suit = null
mask = /obj/item/clothing/mask/breath
l_hand = null
internals_slot = ITEM_SLOT_SUITSTORE
2 changes: 1 addition & 1 deletion code/modules/mod/mod_activation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
for(var/obj/item/mod/module/module as anything in modules)
if(!module.active)
continue
module.on_deactivation()
module.on_deactivation(display_message = FALSE)
activating = TRUE
to_chat(wearer, "<span class='notice'>MODsuit [active ? "shutting down" : "starting up"].</span>")
if(do_after(wearer, activation_step_time, wearer, MOD_ACTIVATION_STEP_FLAGS))
Expand Down
6 changes: 3 additions & 3 deletions code/modules/mod/mod_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
update_charge_alert()
for(var/obj/item/mod/module/module as anything in modules)
if(malfunctioning && module.active && DT_PROB(5, delta_time))
module.on_deactivation()
module.on_deactivation(display_message = TRUE)
module.on_process(delta_time)

/obj/item/mod/control/equipped(mob/user, slot)
Expand Down Expand Up @@ -411,7 +411,7 @@
to_chat(wearer, "<span class='notice'>[severity > 1 ? "Light" : "Strong"] electromagnetic pulse detected!</span>")
if(. & EMP_PROTECT_CONTENTS)
return
selected_module?.on_deactivation()
selected_module?.on_deactivation(display_message = TRUE)
wearer.apply_damage(10 / severity, BURN)
to_chat(wearer, "<span class='danger'>You feel [src] heat up from the EMP, burning you slightly.</span>")
if(wearer.stat < UNCONSCIOUS && prob(10))
Expand Down Expand Up @@ -589,7 +589,7 @@
if(active)
old_module.on_suit_deactivation()
if(old_module.active)
old_module.on_deactivation()
old_module.on_deactivation(display_message = TRUE)
if(wearer)
old_module.on_unequip()
var/datum/action/item_action/mod/pinned_module/action = old_module.pinned_to[wearer]
Expand Down
43 changes: 43 additions & 0 deletions code/modules/mod/mod_theme.dm
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,49 @@
),
)

/datum/mod_theme/loader
name = "loader"
desc = "An experimental powered harness manufactured by Scarborough Arms for quick and efficient munition supplies."
extended_desc = "This powered suit is an experimental spinoff of in-atmosphere Engineering suits. \
This fully articulated titanium exoskeleton is Scarborough Arms' suit of choice for their munition delivery men, \
and what it lacks in EVA protection, it makes up for in strength and flexibility. The primary feature of \
this suit are the two manipulator arms, carefully synchronized with the user's thoughts and \
duplicating their motions almost exactly. These are driven by myomer, an artificial analog of muscles, \
requiring large amounts of voltage to function; occasionally sparking under load with the sheer power of a \
suit capable of lifting 250 tons. Even the legs in the suit have been tuned to incredible capacity, \
the user being able to run at greater speeds for much longer distances and times than an unsuited equivalent. \
A lot of people would say loading cargo is a dull job. You could not disagree more."
default_skin = "loader"
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 10, BIO = 10, FIRE = 25, ACID = 25, WOUND = 5)
max_heat_protection_temperature = ARMOR_MAX_TEMP_PROTECT
min_cold_protection_temperature = ARMOR_MIN_TEMP_PROTECT
permeability_coefficient = 0.5
siemens_coefficient = 0.25
complexity_max = DEFAULT_MAX_COMPLEXITY - 5
slowdown_inactive = 0.5
slowdown_active = 0
inbuilt_modules = list(/obj/item/mod/module/hydraulic, /obj/item/mod/module/clamp/loader, /obj/item/mod/module/magnet)
skins = list(
"loader" = list(
HELMET_LAYER = null,
HELMET_FLAGS = list(
UNSEALED_CLOTHING = SNUG_FIT|THICKMATERIAL,
UNSEALED_INVISIBILITY = HIDEEARS|HIDEHAIR,
SEALED_INVISIBILITY = HIDEFACIALHAIR|HIDEMASK|HIDEEYES|HIDEFACE|HIDESNOUT,
SEALED_COVER = HEADCOVERSMOUTH|HEADCOVERSEYES,
),
CHESTPLATE_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
),
GAUNTLETS_FLAGS = list(
SEALED_CLOTHING = THICKMATERIAL,
),
BOOTS_FLAGS = list(
SEALED_CLOTHING = THICKMATERIAL,
),
),
)

/datum/mod_theme/medical
name = "medical"
desc = "A lightweight suit by DeForest Medical Corporation, allows for easier movement."
Expand Down
10 changes: 10 additions & 0 deletions code/modules/mod/mod_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@
/obj/item/mod/module/jetpack,
)

/obj/item/mod/control/pre_equipped/loader
theme = /datum/mod_theme/loader
applied_cell = /obj/item/stock_parts/cell/high/plus
initial_modules = list(
/obj/item/mod/module/storage/large_capacity,
/obj/item/mod/module/flashlight,
/obj/item/mod/module/paper_dispenser,
/obj/item/mod/module/stamp,
)

/obj/item/mod/control/pre_equipped/mining
theme = /datum/mod_theme/mining
applied_cell = /obj/item/stock_parts/cell/high/plus
Expand Down
14 changes: 7 additions & 7 deletions code/modules/mod/modules/_module.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
return
if(module_type != MODULE_USABLE)
if(active)
on_deactivation()
on_deactivation(display_message = TRUE)
else
on_activation()
else
Expand All @@ -120,7 +120,7 @@
if(SEND_SIGNAL(src, COMSIG_MODULE_TRIGGERED) & MOD_ABORT_USE)
return FALSE
if(module_type == MODULE_ACTIVE)
if(mod.selected_module && !mod.selected_module.on_deactivation())
if(mod.selected_module && !mod.selected_module.on_deactivation(display_message = FALSE))
return
mod.selected_module = src
if(device)
Expand All @@ -142,16 +142,16 @@
return TRUE

/// Called when the module is deactivated
/obj/item/mod/module/proc/on_deactivation()
/obj/item/mod/module/proc/on_deactivation(display_message = TRUE)
active = FALSE
if(module_type == MODULE_ACTIVE)
mod.selected_module = null
if(display_message)
balloon_alert(mod.wearer, device ? "[device] retracted" : "[src] deactivated")
if(device)
mod.wearer.transferItemToLoc(device, src, force = TRUE)
balloon_alert(mod.wearer, "[device] retracted")
UnregisterSignal(mod.wearer, COMSIG_ATOM_EXITED)
else
balloon_alert(mod.wearer, "[src] deactivated")
UnregisterSignal(mod.wearer, used_signal)
used_signal = null
mod.wearer.update_inv_back()
Expand Down Expand Up @@ -195,7 +195,7 @@
/obj/item/mod/module/proc/on_process(delta_time)
if(active)
if(!drain_power(active_power_cost * delta_time))
on_deactivation()
on_deactivation(display_message = TRUE)
return FALSE
on_active_process(delta_time)
else
Expand Down Expand Up @@ -247,7 +247,7 @@
if(part.loc == mod.wearer)
return
if(part == device)
on_deactivation()
on_deactivation(display_message = TRUE)

/// Called when the device gets deleted on active modules
/obj/item/mod/module/proc/on_device_deletion(datum/source)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mod/modules/module_kinesis.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
kinesis_catcher.RegisterSignal(mod.wearer, COMSIG_MOVABLE_MOVED, TYPE_PROC_REF(/atom/movable/screen/fullscreen/kinesis, on_move))
soundloop.start()

/obj/item/mod/module/anomaly_locked/kinesis/on_deactivation()
/obj/item/mod/module/anomaly_locked/kinesis/on_deactivation(display_message = TRUE)
. = ..()
if(!.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mod/modules/modules_antag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
clothing_part.clothing_flags &= ~STOPSPRESSUREDAMAGE
spaceproofed[clothing_part] = TRUE

/obj/item/mod/module/armor_booster/on_deactivation()
/obj/item/mod/module/armor_booster/on_deactivation(display_message = TRUE)
. = ..()
if(!.)
return
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mod/modules/modules_engineering.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
mod.wearer.update_gravity(mod.wearer.has_gravity())
mod.wearer.update_equipment_speed_mods()

/obj/item/mod/module/magboot/on_deactivation()
/obj/item/mod/module/magboot/on_deactivation(display_message = TRUE)
. = ..()
if(!.)
return
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mod/modules/modules_general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
if(full_speed)
mod.wearer.add_movespeed_modifier(/datum/movespeed_modifier/jetpack/fullspeed)

/obj/item/mod/module/jetpack/on_deactivation(mob/user)
/obj/item/mod/module/jetpack/on_deactivation(display_message = TRUE)
. = ..()
if(!.)
return
Expand Down Expand Up @@ -259,7 +259,7 @@
set_light_on(active)
active_power_cost = base_power * light_range

/obj/item/mod/module/flashlight/on_deactivation()
/obj/item/mod/module/flashlight/on_deactivation(display_message = TRUE)
. = ..()
if(!.)
return
Expand Down
Loading

0 comments on commit 6386955

Please sign in to comment.