Autolathes can now be EMAG'd + Adds Illegal Ammo Design Disk (#18559)

* autolathes can now be emagged

* fixes dumb dumb linter issues

* Update code/datums/wires/autolathe.dm

Co-authored-by: tattax <71668564+tattax@users.noreply.github.com>

* illegal ammo disk

* makes it so you don't lose disk designs if unhacked

---------

Co-authored-by: tattax <71668564+tattax@users.noreply.github.com>
This commit is contained in:
Skrem_7
2023-04-18 22:11:50 -05:00
committed by GitHub
parent b270f3b180
commit 15c64aff1a
5 changed files with 169 additions and 6 deletions

View File

@@ -19,15 +19,19 @@
var/obj/machinery/autolathe/A = holder
var/list/status = list()
status += "The red light is [A.disabled ? "on" : "off"]."
status += "The blue light is [A.hacked ? "on" : "off"]."
if(A.obj_flags & EMAGGED)
status += "The blue light is flickering rapidly."
else
status += "The blue light is [A.hacked ? "on" : "off"]."
return status
/datum/wires/autolathe/on_pulse(wire)
var/obj/machinery/autolathe/A = holder
switch(wire)
if(WIRE_HACK)
A.adjust_hacked(!A.hacked)
addtimer(CALLBACK(A, /obj/machinery/autolathe.proc/reset, wire), 60)
if(!(A.obj_flags & EMAGGED))
A.adjust_hacked(!A.hacked)
addtimer(CALLBACK(A, TYPE_PROC_REF(/obj/machinery/autolathe, reset), wire), 6 SECONDS)
if(WIRE_SHOCK)
A.shocked = !A.shocked
addtimer(CALLBACK(A, /obj/machinery/autolathe.proc/reset, wire), 60)
@@ -39,10 +43,11 @@
var/obj/machinery/autolathe/A = holder
switch(wire)
if(WIRE_HACK)
A.adjust_hacked(!mend)
if(!(A.obj_flags & EMAGGED))
A.adjust_hacked(!mend)
if(WIRE_HACK)
A.shocked = !mend
if(WIRE_DISABLE)
A.disabled = !mend
if(WIRE_ZAP)
A.shock(usr, 50)
A.shock(usr, 50)

View File

@@ -275,7 +275,8 @@
switch(wire)
if(WIRE_HACK)
if(!wires.is_cut(wire))
adjust_hacked(FALSE)
if(!(obj_flags & EMAGGED))
adjust_hacked(FALSE)
if(WIRE_SHOCK)
if(!wires.is_cut(wire))
shocked = FALSE
@@ -310,6 +311,15 @@
. = ..()
adjust_hacked(TRUE)
/obj/machinery/autolathe/emag_act(mob/user)
if(obj_flags & EMAGGED)
return
obj_flags |= EMAGGED
if(!hacked)
adjust_hacked(TRUE)
playsound(src, "sparks", 75, TRUE, -1)
to_chat(user, span_notice("You use the cryptographic sequencer on [src]."))
//Called when the object is constructed by an autolathe
//Has a reference to the autolathe so you can do !!FUN!! things with hacked lathes
/obj/item/proc/autolathe_crafted(obj/machinery/autolathe/A)

View File

@@ -14,6 +14,26 @@
ammo_type = /obj/item/ammo_casing/a357
max_ammo = 20
/obj/item/ammo_box/no_direct/a357/ironfeather
name = "ammo box (.357 Ironfeather)"
ammo_type = /obj/item/ammo_casing/a357/ironfeather
/obj/item/ammo_box/no_direct/a357/nutcracker
name = "ammo box (.357 Nutcracker)"
ammo_type = /obj/item/ammo_casing/a357/nutcracker
/obj/item/ammo_box/no_direct/a357/metalshock
name = "ammo box (.357 Metalshock)"
ammo_type = /obj/item/ammo_casing/a357/metalshock
/obj/item/ammo_box/no_direct/a357/heartpiercer
name = "ammo box (.357 Heartpiercer)"
ammo_type = /obj/item/ammo_casing/a357/heartpiercer
/obj/item/ammo_box/no_direct/a357/wallstake
name = "ammo box (.357 Wallstake)"
ammo_type = /obj/item/ammo_casing/a357/wallstake
/obj/item/ammo_box/no_direct/n762
name = "ammo box (7.62x38mmR)"
icon_state = "10mmbox"
@@ -111,6 +131,26 @@
caliber = "10mm"
max_ammo = 20
/obj/item/ammo_box/c10mm/sp
name = "ammo box (10mm soporific)"
ammo_type = /obj/item/ammo_casing/c10mm/sp
/obj/item/ammo_box/c10mm/ap
name = "ammo box (10mm armor-piercing)"
ammo_type = /obj/item/ammo_casing/c10mm/ap
/obj/item/ammo_box/c10mm/hp
name = "ammo box (10mm hollow-point)"
ammo_type = /obj/item/ammo_casing/c10mm/hp
/obj/item/ammo_box/c10mm/inc
name = "ammo box (10mm incendiary)"
ammo_type = /obj/item/ammo_casing/c10mm/inc
/obj/item/ammo_box/c10mm/emp
name = "ammo box (10mm EMP)"
ammo_type = /obj/item/ammo_casing/c10mm/emp
/obj/item/ammo_box/c45
name = "ammo box (.45)"
icon_state = "45box"

View File

@@ -912,6 +912,11 @@
build_path = /obj/item/ammo_casing/a357
category = list("hacked", "Security")
/datum/design/a357/ironfeather
name = ".357 Ironfeather Bullet"
id = "a357_ironfeather"
build_path = /obj/item/ammo_casing/a357/ironfeather
/datum/design/c10mm
name = "Ammo Box (10mm)"
id = "c10mm"
@@ -920,6 +925,61 @@
build_path = /obj/item/ammo_box/c10mm
category = list("hacked", "Security")
/datum/design/c10mm/disk
id = "c10mm_disk"
category = list("Security")
/datum/design/c10mm/sp
name = "Ammo Box (10mm soporific)"
id = "c10mm_sp"
build_path = /obj/item/ammo_box/c10mm/sp
/datum/design/c10mm/sp/disk
id = "c10mm_sp_disk"
category = list("Security")
/obj/item/disk/design_disk/illegal_ammo
name = "Illegal Ammo Design Disk"
desc = "A disk containing designs for both standard and non-standard 10mm and .357 bullet designs."
icon_state = "datadisk1"
var/list/ammo_types = list(/datum/design/c10mm/disk, /datum/design/c10mm/sp/disk, /datum/design/c10mm/ap, /datum/design/c10mm/hp, /datum/design/c10mm/inc, /datum/design/c10mm/emp,
/datum/design/box_a357/disk, /datum/design/box_a357/ironfeather/disk, /datum/design/box_a357/nutcracker, /datum/design/box_a357/metalshock, /datum/design/box_a357/heartpiercer, /datum/design/box_a357/wallstake)
/obj/item/disk/design_disk/illegal_ammo/Initialize()
. = ..()
max_blueprints = ammo_types.len
for(var/design in ammo_types)
var/datum/design/new_design = design
blueprints += new new_design
/datum/design/c10mm/ap
name = "Ammo Box (10mm armor-piercing)"
id = "c10mm_ap"
materials = list(/datum/material/iron = 45000)
build_path = /obj/item/ammo_box/c10mm/ap
category = list("Security")
/datum/design/c10mm/hp
name = "Ammo Box (10mm hollow-point)"
id = "c10mm_hp"
materials = list(/datum/material/iron = 45000)
build_path = /obj/item/ammo_box/c10mm/hp
category = list("Security")
/datum/design/c10mm/inc
name = "Ammo Box (10mm incendiary)"
id = "c10mm_inc"
materials = list(/datum/material/iron = 45000)
build_path = /obj/item/ammo_box/c10mm/inc
category = list("Security")
/datum/design/c10mm/emp
name = "Ammo Box (10mm EMP)"
id = "c10mm_emp"
materials = list(/datum/material/iron = 45000)
build_path = /obj/item/ammo_box/c10mm/emp
category = list("Security")
/datum/design/c45
name = "Ammo Box (.45)"
id = "c45"
@@ -944,6 +1004,47 @@
build_path = /obj/item/ammo_box/no_direct/a357
category = list("hacked", "Security")
/datum/design/box_a357/disk
id = "box_a357_disk"
category = list("Security")
/datum/design/box_a357/ironfeather
name = "Ammo Box (.357 Ironfeather)"
id = "box_a357_ironfeather"
build_path = /obj/item/ammo_box/no_direct/a357/ironfeather
/datum/design/box_a357/ironfeather/disk
id = "box_a357_ironfeather_disk"
category = list("Security")
/datum/design/box_a357/nutcracker
name = "Ammo Box (.357 Nutcracker)"
id = "box_a357_nutcracker"
materials = list (/datum/material/iron = 60000)
build_path = /obj/item/ammo_box/no_direct/a357/nutcracker
category = list ("Security")
/datum/design/box_a357/metalshock
name = "Ammo Box (.357 Metalshock)"
id = "box_a357_metalshock"
materials = list (/datum/material/iron = 60000)
build_path = /obj/item/ammo_box/no_direct/a357/metalshock
category = list ("Security")
/datum/design/box_a357/heartpiercer
name = "Ammo Box (.357 Heartpiercer)"
id = "box_a357_heartpiercer"
materials = list (/datum/material/iron = 60000)
build_path = /obj/item/ammo_box/no_direct/a357/heartpiercer
category = list ("Security")
/datum/design/box_a357/wallstake
name = "Ammo Box (.357 Wallstake)"
id = "box_a357_wallstake"
materials = list (/datum/material/iron = 60000)
build_path = /obj/item/ammo_box/no_direct/a357/wallstake
category = list ("Security")
/datum/design/cleaver
name = "Butcher's Cleaver"
id = "cleaver"

View File

@@ -1734,6 +1734,13 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
cost = 7
manufacturer = /datum/corporation/traitor/cybersun
/datum/uplink_item/device_tools/illegal_ammo_disk
name = "Illegal Ammo Design Disk"
desc = "A design disk for an autolathe that permits it to print all types of 10mm and .357 ammunition."
item = /obj/item/disk/design_disk/illegal_ammo
cost = 4
exclude_modes = list(/datum/game_mode/nuclear) //Buy your own ammo you lazy sods
/datum/uplink_item/device_tools/medgun
name = "Medbeam Gun"
desc = "A wonder of Syndicate engineering, the Medbeam gun, or Medi-Gun enables a medic to keep his fellow \