Files
GhomandGitHub 6eb2d1674a Implementing materials checks for techweb designs. (#96257)
## 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.
/🆑
2026-07-06 00:13:02 -07:00

174 lines
6.6 KiB
Plaintext

/mob/living/basic/bot/secbot/ed209
name = "\improper ED-209 Security Robot"
desc = "A security robot. He looks less than thrilled."
icon_state = "ed209"
base_icon_state = "ed209"
light_color = "#f84e4e"
density = TRUE
health = 100
maxHealth = 100
obj_damage = 60
environment_smash = ENVIRONMENT_SMASH_WALLS //Walls can't stop THE LAW
mob_size = MOB_SIZE_LARGE
ai_controller = /datum/ai_controller/basic_controller/bot/ed209
bot_type = ADVANCED_SEC_BOT
hackables = "combat inhibitors"
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 20.3, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 2.1)
///sound of the projectiles we shoot
var/projectile_sound = 'sound/items/weapons/laser.ogg'
///what projectiles we shoot
var/projectile_type = /obj/projectile/beam/disabler
///what projectiles we shoot when emagged
var/emagged_projectile_type = /obj/projectile/beam
///sound of emagged projectile
var/emagged_projectile_sound = 'sound/items/weapons/laser.ogg'
///special hats that change our personality :mistake:
var/static/list/sherrif_hats = typecacheof(list(
/obj/item/clothing/head/cowboy,
))
var/datum/action/cooldown/mob_cooldown/ed209_charge/bot_charge
///our riding component
var/ride_component = /datum/component/riding/creature/ed_bot
///have we become a sheriff
var/sheriffized = FALSE
///timer till we yell out our war cry again
COOLDOWN_DECLARE(shoot_cry)
/mob/living/basic/bot/secbot/ed209/Initialize(mapload)
. = ..()
set_weapon()
bot_charge = new(src)
var/static/list/hat_offset = list(2, 0)
AddElement(/datum/element/hat_wearer,\
offsets = hat_offset,\
)
AddComponent(/datum/component/defaceable, \
icon = 'icons/mob/silicon/aibot_faces.dmi', \
icon_states = list("ed209" = FALSE, "ed209_highlight" = TRUE), \
drawing_of = "a face", \
)
AddComponent(/datum/component/stun_n_cuff,\
stun_sound = 'sound/items/weapons/egloves.ogg',\
handcuff_type = /obj/item/restraints/handcuffs/cable/zipties,\
)
AddElement(/datum/element/ridable, ride_component)
RegisterSignal(src, COMSIG_BASICMOB_POST_ATTACK_RANGED, PROC_REF(post_ranged_attack))
/mob/living/basic/bot/secbot/ed209/Entered(atom/movable/arrived, atom/old_loc, list/atom/old_locs)
. = ..()
sheriffized = (is_type_in_typecache(arrived, sherrif_hats)) //yeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeehawwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
/mob/living/basic/bot/secbot/ed209/proc/post_ranged_attack()
SIGNAL_HANDLER
if(!sheriffized || !COOLDOWN_FINISHED(src, shoot_cry))
return
COOLDOWN_START(src, shoot_cry, 30 SECONDS)
INVOKE_ASYNC(src, TYPE_PROC_REF(/atom/movable, say), "YIPPIE-KI-YAY!")
/mob/living/basic/bot/secbot/ed209/Exited(atom/movable/gone, direction)
. = ..()
sheriffized = (is_type_in_typecache(gone, sherrif_hats))
/mob/living/basic/bot/secbot/ed209/examine(mob/user)
. = ..()
if(sheriffized)
. += span_notice("Fastest hand in the west.")
/mob/living/basic/bot/secbot/ed209/bot_reset(bypass_ai_reset = FALSE)
. = ..()
if(bot_access_flags & BOT_COVER_EMAGGED && isnull(bot_charge.owner))
bot_charge.Grant(src)
if(!(bot_access_flags & BOT_COVER_EMAGGED) && !isnull(bot_charge.owner))
bot_charge.Remove(src)
set_weapon()
/mob/living/basic/bot/secbot/ed209/emag_act(mob/user, obj/item/card/emag/emag_card)
. = ..()
icon_state = "ed209[bot_mode_flags & BOT_MODE_ON]"
set_weapon()
balloon_alert(user, "safeties disabled")
audible_message(span_bolddanger("[src] buzzes menacingly!"))
return TRUE
/mob/living/basic/bot/secbot/ed209/proc/set_weapon()
qdel(GetComponent(/datum/component/ranged_attacks))
var/projectile = (bot_access_flags & BOT_COVER_EMAGGED) ? emagged_projectile_type : projectile_type
var/final_projectile_sound = (bot_access_flags & BOT_COVER_EMAGGED) ? emagged_projectile_sound : projectile_sound
AddComponent(\
/datum/component/ranged_attacks,\
projectile_type = projectile,\
projectile_sound = final_projectile_sound,\
)
/mob/living/basic/bot/secbot/ed209/ui_data(mob/user)
var/list/data = ..()
if(!(bot_access_flags & BOT_COVER_LOCKED) || HAS_SILICON_ACCESS(user))
data["custom_controls"]["handcuff"] = security_mode_flags & SECBOT_HANDCUFF_TARGET
data["custom_controls"]["check_ids"] = security_mode_flags & SECBOT_CHECK_IDS
data["custom_controls"]["check_records"] = security_mode_flags & SECBOT_CHECK_RECORDS
return data
/mob/living/basic/bot/secbot/ed209/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
var/mob/user = ui.user
if(. || !isliving(user) || (bot_access_flags & BOT_COVER_LOCKED) && !HAS_SILICON_ACCESS(user))
return
switch(action)
if("handcuff")
security_mode_flags ^= SECBOT_HANDCUFF_TARGET
if("check_ids")
security_mode_flags ^= SECBOT_CHECK_IDS
if("check_records")
security_mode_flags ^= SECBOT_CHECK_RECORDS
/mob/living/basic/bot/secbot/ed209/retrieve_secbot_drops(atom/drop_location)
var/obj/item/bot_assembly/ed209/ed_assembly = new(drop_location)
ed_assembly.build_step = ASSEMBLY_FIRST_STEP
ed_assembly.add_overlay("hs_hole")
ed_assembly.created_name = name
new /obj/item/assembly/prox_sensor(drop_location)
var/obj/item/gun/energy/disabler/disabler_gun = new(drop_location)
disabler_gun.cell.charge = 0
disabler_gun.update_appearance()
if(prob(50))
new /obj/item/bodypart/leg/left/robot(drop_location)
if(prob(25))
new /obj/item/bodypart/leg/right/robot(drop_location)
if(prob(75))
return
if(prob(50)) // either helmet or vest
new /obj/item/clothing/head/helmet(drop_location)
else
new /obj/item/clothing/suit/armor/vest(drop_location)
/mob/living/basic/bot/secbot/ed209/Destroy()
. = ..()
QDEL_NULL(bot_charge)
/mob/living/basic/bot/secbot/ed209/nukie
name = "\improper ED-209(+1) Syndicate Robot"
desc = "Wait this one's red? This cannot be good... right??"
icon_state = "red209"
light_color = "#5c0909"
faction = list(ROLE_SYNDICATE)
health = 250
maxHealth = 250
obj_damage = 60
req_one_access = list(ACCESS_SYNDICATE)
bot_mode_flags = parent_type::bot_mode_flags & ~BOT_MODE_REMOTE_ENABLED
radio_key = /obj/item/encryptionkey/syndicate
additional_access = /datum/id_trim/syndicom/crew
radio_channel = RADIO_CHANNEL_SYNDICATE
ai_controller = /datum/ai_controller/basic_controller/bot/ed209/syndicate
bot_type = ADVANCED_SEC_BOT
hackables = "combat inhibitors"
projectile_sound = 'sound/items/weapons/gun/l6/shot.ogg'
projectile_type = /obj/projectile/bullet/a7mm
emagged_projectile_sound = 'sound/items/weapons/minebot_rocket.ogg'
emagged_projectile_type = /obj/projectile/bullet/rocket/weak //lord have mercy
ride_component = /datum/component/riding/creature/ed_bot/nukie //ride at ur own risk. especially if its emagged. warranty void