Files
Bubberstation/code/modules/mod/modules/modules_service.dm
Fikou 0f26f6e9ee modsuit given traits use refs + fixes their deletion not working right + need boot out for ai to move (#87726)
## About The Pull Request
so there is a problem of:
if 2 modsuit modules were to apply the same trait and 1 were removed,
shit would break
so now all instances of mod_trait applied to the modsuit wearer are refs
instead, with mod_trait used for stuff added to items as that isnt
likely to have the same thing
also qdeleted modsuits delete their parts apparently accidentally
removed at some point. the previous time they did it caused qdel loops
but this time it doesnt
makes boots need to be out for an ai to move someone in a modsuit
improves the ui, non-standard cores now have unique colors for the
charging bar, and you can extend/retract things from ui, also adds a
configurable button to config menu so that the tether doesnt repurpose
the pin function made for circuits
redoes modsuit balloon alerts to use simpler language
makes the weapon recall module make you pick up the weapon if its on
your tile as throws dont work on same tile

![image](https://github.com/user-attachments/assets/97a0eb85-8127-4297-b679-3e5488ce73be)


## Why It's Good For The Game
futureproofing (also technically presentproofing, if you wear something
like infiltrator and normal back modsuit and both have ai control they
both will give you a trait)
also ai movement doesnt have any checks currently, i think it makes
sense that it would require your boots to be out so that the ai has
something to move
fix stuff change break boom wack
2024-11-13 12:29:35 -06:00

94 lines
4.1 KiB
Plaintext

//Service modules for MODsuits
///Bike Horn - Plays a bike horn sound.
/obj/item/mod/module/bikehorn
name = "MOD bike horn module"
desc = "A shoulder-mounted piece of heavy sonic artillery, this module uses the finest femto-manipulator technology to \
precisely deliver an almost lethal squeeze to... a bike horn, producing a significantly memorable sound."
icon_state = "bikehorn"
module_type = MODULE_USABLE
complexity = 1
use_energy_cost = DEFAULT_CHARGE_DRAIN
incompatible_modules = list(/obj/item/mod/module/bikehorn)
cooldown_time = 1 SECONDS
/obj/item/mod/module/bikehorn/on_use()
playsound(src, 'sound/items/bikehorn.ogg', 100, FALSE)
drain_power(use_energy_cost)
///Advanced Balloon Blower - Blows a long balloon.
/obj/item/mod/module/balloon/advanced
name = "MOD advanced balloon blower module"
desc = "A relatively new piece of technology developed by finest clown engineers to make long balloons and balloon animals \
at party-appropriate rate."
cooldown_time = 20 SECONDS
balloon_path = /obj/item/toy/balloon/long
blowing_time = 15 SECONDS
///Microwave Beam - Microwaves items instantly.
/obj/item/mod/module/microwave_beam
name = "MOD microwave beam module"
desc = "An oddly domestic device, this module is installed into the user's palm, \
hooking up with culinary scanners located in the helmet to blast food with precise microwave radiation, \
allowing them to cook food from a distance, with the greatest of ease. Not recommended for use against grapes."
icon_state = "microwave_beam"
module_type = MODULE_ACTIVE
complexity = 1
use_energy_cost = DEFAULT_CHARGE_DRAIN * 5
incompatible_modules = list(/obj/item/mod/module/microwave_beam, /obj/item/mod/module/organizer)
cooldown_time = 4 SECONDS
required_slots = list(ITEM_SLOT_GLOVES)
/obj/item/mod/module/microwave_beam/on_select_use(atom/target)
. = ..()
if(!.)
return
if(!isitem(target))
return
if(!isturf(target.loc))
balloon_alert(mod.wearer, "not in storage!")
return
var/obj/item/microwave_target = target
var/datum/effect_system/spark_spread/spark_effect = new()
spark_effect.set_up(2, 1, mod.wearer)
spark_effect.start()
mod.wearer.Beam(target,icon_state="lightning[rand(1,12)]", time = 5)
if(microwave_target.microwave_act(microwaver = mod.wearer) & COMPONENT_MICROWAVE_SUCCESS)
playsound(src, 'sound/machines/microwave/microwave-end.ogg', 50, FALSE)
else
balloon_alert(mod.wearer, "can't be microwaved!")
var/datum/effect_system/spark_spread/spark_effect_two = new()
spark_effect_two.set_up(2, 1, microwave_target)
spark_effect_two.start()
drain_power(use_energy_cost)
//Waddle - Makes you waddle and squeak.
/obj/item/mod/module/waddle
name = "MOD waddle module"
desc = "Some of the most primitive technology in use by Honk Co. This module works off an automatic intention system, \
utilizing its sensitivity to the pilot's often-limited brainwaves to directly read their next step, \
affecting the boots they're installed in. Employing a twin-linked gravitonic drive to create \
miniaturized etheric blasts of space-time beneath the user's feet, this enables them to... \
to waddle around, bouncing to and fro with a pep in their step."
icon_state = "waddle"
complexity = 1
idle_power_cost = DEFAULT_CHARGE_DRAIN * 0.2
incompatible_modules = list(/obj/item/mod/module/waddle)
required_slots = list(ITEM_SLOT_FEET)
/obj/item/mod/module/waddle/on_part_activation()
var/obj/item/shoes = mod.get_part_from_slot(ITEM_SLOT_FEET)
if(shoes)
shoes.AddComponent(/datum/component/squeak, list('sound/effects/footstep/clownstep1.ogg'=1,'sound/effects/footstep/clownstep2.ogg'=1), 50, falloff_exponent = 20) //die off quick please
mod.wearer.AddElementTrait(TRAIT_WADDLING, REF(src), /datum/element/waddling)
if(is_clown_job(mod.wearer.mind?.assigned_role))
mod.wearer.add_mood_event("clownshoes", /datum/mood_event/clownshoes)
/obj/item/mod/module/waddle/on_part_deactivation(deleting = FALSE)
var/obj/item/shoes = mod.get_part_from_slot(ITEM_SLOT_FEET)
if(shoes && !deleting)
qdel(shoes.GetComponent(/datum/component/squeak))
REMOVE_TRAIT(mod.wearer, TRAIT_WADDLING, REF(src))
if(is_clown_job(mod.wearer.mind?.assigned_role))
mod.wearer.clear_mood_event("clownshoes")