Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exosuit DNA lock device #13190

Merged
merged 5 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/game/mecha/combat/gygax.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
max_temperature = 45000
overload_coeff = 1
wreckage = /obj/effect/decal/mecha_wreckage/gygax/dark
dna_lockable = TRUE
max_equip = 4
step_energy_drain = 5

Expand Down
1 change: 1 addition & 0 deletions code/game/mecha/combat/marauder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
var/datum/action/innate/mecha/mech_smoke/smoke_action = new
var/datum/action/innate/mecha/mech_zoom/zoom_action = new
operation_req_access = list(access_cent_specops)
dna_lockable = TRUE
wreckage = /obj/effect/decal/mecha_wreckage/marauder
add_req_access = 0
internal_damage_threshold = 25
Expand Down
1 change: 1 addition & 0 deletions code/game/mecha/combat/phazon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
wreckage = /obj/effect/decal/mecha_wreckage/phazon
add_req_access = 1
//operation_req_access = list()
dna_lockable = TRUE
internal_damage_threshold = 25
force = 15
var/phasing = FALSE
Expand Down
62 changes: 47 additions & 15 deletions code/game/mecha/mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
var/last_message = 0
var/add_req_access = 1
var/maint_access = 1
var/dna_lockable = FALSE
var/dna //dna-locking the mech
var/list/proc_res = list() //stores proc owners, like proc_res["functionname"] = owner reference
var/datum/effect/effect/system/spark_spread/spark_system = new
Expand Down Expand Up @@ -165,17 +166,10 @@
radio.icon_state = icon_state


/obj/mecha/proc/enter_after(delay, mob/user, numticks = 5)
var/delayfraction = delay/numticks

var/turf/T = user.loc

for(var/i = 0, i<numticks, i++)
sleep(delayfraction)
if(!src || !user || !user.canmove || !(user.loc == T))
return 0

return 1
/obj/mecha/proc/enter_after(delay, mob/user)
if(do_after(usr, delay, target = src))
return 1
return 0
AirBlack marked this conversation as resolved.
Show resolved Hide resolved

/obj/mecha/examine(mob/user)
..()
Expand Down Expand Up @@ -681,9 +675,39 @@
state = 4
to_chat(user, "You unscrew and pry out the powercell.")
log_message("Powercell removed")
else if(state==4 && src.cell)
state=3
to_chat(user, "You screw the cell in place")
else if(state==4)
if(src.cell)
state=3
to_chat(user, "You screw the cell in place")
else
var/list/actions = list()
var/obj/item/mecha_parts/mecha_tracking/tracking
if(dna_lockable)
actions += "Exosuit DNA Scanner"
for(var/obj/item/mecha_parts/mecha_tracking/found_tracking in src.contents)
actions += "Exosuit Tracker"
tracking = found_tracking
break
AirBlack marked this conversation as resolved.
Show resolved Hide resolved

if(actions.len > 0)
var/uloc = user.loc
var/mloc = src.loc
var/choice = tgui_input_list(user, "Pick what to unscrew.", "Unscrew part", actions, 5 SECONDS)
if(user.loc != uloc || src.loc != mloc)
return
AirBlack marked this conversation as resolved.
Show resolved Hide resolved
switch(choice)
if("Exosuit DNA Scanner")
if(dna_lockable)
to_chat(user, "You unscrew DNA scanner from [src.name]")
dna_lockable = FALSE
dna = null
new /obj/item/mecha_parts/dna_scanner(src.loc)
if("Exosuit Tracker")
if(tracking && tracking.loc == src)
to_chat(user, "You unscrew [tracking.name] from [src.name]")
tracking.forceMove(src.loc)
AirBlack marked this conversation as resolved.
Show resolved Hide resolved


diag_hud_set_mechcell()
return

Expand Down Expand Up @@ -721,6 +745,14 @@
W.forceMove(src)
user.visible_message("[user] attaches [W] to [src].", "You attach [W] to [src]")
return
else if(istype(W, /obj/item/mecha_parts/dna_scanner))
if(dna_lockable)
to_chat(user, "The [src.name] already has DNA scanner installed.")
AirBlack marked this conversation as resolved.
Show resolved Hide resolved
return

dna_lockable = TRUE
qdel(W)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А нельзя как-то внутри мехи хранить этот девайс? А то удалять и заново спавнить один и тот же объект звучит кринжово

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

За то не надо спавнить для раундстартовых. Такой принцип сейчас у плат в шлюзах.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не согласен хранить внутри, напишу отдельное хранение если только вешать логику на сам итем, а для этого надо еще тогда аналоги написать с другим поведением, типа допустим тот который может несколько хранить например и всякая такая фигня, но у меня идей нет так что пусть будет итемом

user.visible_message("[user] attaches [W] to [src].", "You attach [W] to [src]")

else if(istype(W, /obj/item/weapon/melee/changeling_hammer))
var/obj/item/weapon/melee/changeling_hammer/hammer = W
Expand Down Expand Up @@ -896,7 +928,7 @@
return

var/passed
if(src.dna)
if(dna_lockable && dna)
if(usr.dna.unique_enzymes==src.dna)
passed = 1
else if(operation_allowed(usr))
Expand Down
8 changes: 8 additions & 0 deletions code/game/mecha/mecha_parts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
/obj/item/mecha_parts/chassis/attack_hand()
return


/obj/item/mecha_parts/dna_scanner
name = "Exosuit DNA scanner"
desc = "Device that allows locking exosuits by DNA."
icon = 'icons/obj/device.dmi'
icon_state = "motion2"
origin_tech = "programming=3;biotech=3"

/////////// Ripley

/obj/item/mecha_parts/chassis/ripley
Expand Down
4 changes: 3 additions & 1 deletion code/game/mecha/mecha_topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<div class='links'>
<a href='?src=\ref[src];toggle_id_upload=1'><span id='t_id_upload'>[add_req_access?"L":"Unl"]ock ID upload panel</span></a><br>
<a href='?src=\ref[src];toggle_maint_access=1'><span id='t_maint_access'>[maint_access?"Forbid":"Permit"] maintenance protocols</span></a><br>
<a href='?src=\ref[src];dna_lock=1'>DNA-lock</a><br>
[dna_lockable?"<a href='?src=\ref[src];dna_lock=1'>DNA-lock</a><br>":null]
<a href='?src=\ref[src];view_log=1'>View internal log</a><br>
<a href='?src=\ref[src];change_name=1'>Change exosuit name</a><br>
</div>
Expand Down Expand Up @@ -405,6 +405,8 @@
if(href_list["dna_lock"])
if(usr != src.occupant)
return
if(!dna_lockable)
return
if(isbrain(occupant))
occupant_message("You are a brain. No.")
occupant.playsound_local(null, 'sound/mecha/UI_SCI-FI_Tone_Deep_Wet_15_error.ogg', VOL_EFFECTS_MASTER, null, FALSE)
Expand Down
3 changes: 3 additions & 0 deletions code/game/mecha/working/ripley.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@

/obj/mecha/working/ripley/recycle_ripley
name = "APLU \"Recycler\""
add_req_access = 0
maint_access = 0
operation_req_access = list(access_recycler)

/obj/mecha/working/ripley/recycle_ripley/atom_init()
. = ..()
Expand Down
1 change: 1 addition & 0 deletions code/game/mecha/working/working.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/obj/mecha/working
internal_damage_threshold = 60
dna_lockable = FALSE

/obj/mecha/working/atom_init()
. = ..()
Expand Down
12 changes: 11 additions & 1 deletion code/modules/research/designs/mechfabricator_designs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,17 @@
name = "Exosuit Tracking Beacon"
id = "mecha_tracking"
build_type = MECHFAB
build_path =/obj/item/mecha_parts/mecha_tracking
build_path = /obj/item/mecha_parts/mecha_tracking
materials = list(MAT_METAL=500)
construction_time = 50
starts_unlocked = TRUE
category = list("Misc")

/datum/design/dna_scanner
name = "Exosuit DNA Scanner"
id = "mecha_dnascanner"
build_type = MECHFAB
build_path = /obj/item/mecha_parts/dna_scanner
materials = list(MAT_METAL=500)
construction_time = 50
starts_unlocked = TRUE
Expand Down
12 changes: 9 additions & 3 deletions maps/centcom/centcom.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -20941,7 +20941,9 @@
},
/area/space)
"bav" = (
/obj/mecha/combat/gygax/ultra,
/obj/mecha/combat/gygax/ultra{
AirBlack marked this conversation as resolved.
Show resolved Hide resolved
dna_lockable = 1
},
/obj/effect/decal/turf_decal{
icon_state = "recharge_floor"
},
Expand Down Expand Up @@ -21236,7 +21238,9 @@
},
/area/custom/syndicate_mothership/droppod_garage)
"bbc" = (
/obj/mecha/working/ripley/firefighter,
/obj/mecha/working/ripley/firefighter{
dna_lockable = 1
},
/obj/effect/decal/turf_decal{
icon_state = "recharge_floor"
},
Expand Down Expand Up @@ -21286,7 +21290,9 @@
},
/area/custom/wizard_station)
"bbi" = (
/obj/mecha/medical/odysseus,
/obj/mecha/medical/odysseus{
dna_lockable = 1
},
/obj/machinery/light,
/obj/effect/decal/turf_decal{
icon_state = "recharge_floor"
Expand Down
Loading