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

Teleporter issue and devices tweak #3

Merged
merged 5 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
135 changes: 135 additions & 0 deletions modular_dripstation/code/game/objects/items/devices/advpinpointer.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
#define SETTING_DISK 0
#define SETTING_OBJECT 1
#define SETTING_PERSON 2
GLOBAL_LIST_INIT(HIGHRISK, typecacheof(list(/obj/item/disk/nuclear,
/obj/item/gun/energy/laser/captain,
/obj/item/hand_tele,
/obj/item/clothing/accessory/medal/gold/captain,
/obj/item/melee/sabre,
/obj/item/gun/energy/e_gun/hos,
/obj/item/card/id/captains_spare,
/obj/item/tank/jetpack/oxygen/captain,
/obj/item/aicard,
/obj/item/hypospray/deluxe/cmo,
/obj/item/clothing/suit/armor/reactive/teleport,
/obj/item/clothing/suit/armor/laserproof,
/obj/item/blackbox,
/obj/item/holotool,
/obj/item/areaeditor/blueprints)))
///obj/item/clothing/gloves/krav_maga/sec,
///obj/item/cargo_teleporter,
/obj/item/pinpointer/adv
var/modelocked = FALSE // If true, user cannot change mode.
var/obj/item/highrisk_rem = null
var/remember_target = null
var/setting = SETTING_DISK

/obj/item/pinpointer/adv/examine(mob/user)
. = ..()
var/msg = "Its tracking indicator reads "
if(is_syndicate(user))
switch(setting)
if(SETTING_DISK)
msg += "\"nuclear_disk\"."
if(SETTING_OBJECT)
msg += "\"target\"."
if(SETTING_PERSON)
msg += "\"person\"."
else
msg = "Its tracking indicator is blank."
else
msg += "\"nuclear_disk\"."
. += msg

/obj/item/pinpointer/adv/toggle_on()
active = !active
playsound(src, 'sound/items/screwdriver2.ogg', 50, 1)
if(active)
if(!is_syndicate(usr))
setting = SETTING_DISK
START_PROCESSING(SSfastprocess, src)
else
target = null
highrisk_rem = null
remember_target = null
setting = SETTING_DISK
STOP_PROCESSING(SSfastprocess, src)
update_appearance(UPDATE_ICON)

/obj/item/pinpointer/adv/scan_for_target()
target = null
switch(setting)
if(SETTING_DISK)
var/obj/item/disk/nuclear/N = locate() in GLOB.poi_list
target = N
if(SETTING_OBJECT)
if(!highrisk_rem)
setting = SETTING_DISK
playsound(src, 'sound/machines/triple_beep.ogg', 50, 1)
return
var/obj/item/H = highrisk_rem
target = H
if(SETTING_PERSON)
if(!remember_target)
setting = SETTING_DISK
playsound(src, 'sound/machines/triple_beep.ogg', 50, 1)
return
target = remember_target
..()

/obj/item/pinpointer/adv/AltClick(mob/user)
if(isliving(user))
if(is_syndicate(user))
if(!user.is_holding(src))
to_chat(user, span_notice("You should be able to press the change mode button to interact with interface."))
return
var/mob/living/L = user
to_chat(L, span_danger("Your [name] beeps as it reconfigures it's tracking algorithms."))
playsound(src, 'sound/machines/boop.ogg', 50, 1)
switch_mode_to(user)
else
setting = SETTING_DISK

/obj/item/pinpointer/adv/proc/switch_mode_to(mob/user)
switch(alert("Please select the mode you want to put the pinpointer in.", "Pinpointer Mode Select", "Disk Recovery", "High Risk", "DNA RSS"))
if("Disk Recovery")
setting = SETTING_DISK
if("High Risk")
setting = SETTING_OBJECT
var/list/item_names[0]
var/list/item_paths[0]
for(var/objective in GLOB.HIGHRISK)
var/obj/item/I = objective
var/name = initial(I.name)
item_names += name
item_paths[name] = objective
var/targetitem = input("Select item to search for.", "Item Mode Select","") as null|anything in item_names
if(!targetitem)
return
var/list/target_candidates = get_all_of_type(item_paths[targetitem], subtypes = TRUE)
for(var/obj/item/candidate in target_candidates)
if(!is_centcom_level((get_turf(candidate)).z))
highrisk_rem = candidate
playsound(src, get_sfx("terminal_type"), 25, 1)
to_chat(user, "<span class='notice'>You set the pinpointer to locate [targetitem].</span>")
return
if(!highrisk_rem)
to_chat(user, "<span class='warning'>Failed to locate [targetitem]!</span>")
return

if("DNA RSS")
setting = SETTING_PERSON
var/DNAstring = input("Input DNA string to search for." , "Please Enter String." , "")
if(!DNAstring)
return
for(var/mob/living/carbon/C in GLOB.mob_list)
if(!C.dna)
continue
if(C.dna.unique_enzymes == DNAstring)
if(!is_centcom_level((get_turf(C)).z))
remember_target = C
playsound(src, get_sfx("terminal_type"), 25, 1)
to_chat(user, "<span class='notice'>You set the pinpointer to locate somebody.</span>")
else
playsound(src, 'sound/machines/triple_beep.ogg', 50, 1)
to_chat(user, "<span class='warning'>Malfunction detected.</span>")
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/obj/item/laser_pointer/RefreshParts()
///The rate at which the laser regenerates charge. Clamped between 20 seconds and basically instantly just in case of weirdness. Knock off 5 seconds per diode rating
recharge_rate = clamp((20 SECONDS - (5 SECONDS * diode.rating)), 1, 20 SECONDS)
12 changes: 12 additions & 0 deletions modular_dripstation/code/game/objects/items/teleportation.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
/obj/item/hand_tele
icon = 'modular_dripstation/icons/obj/device.dmi'

/obj/item/hand_tele/try_dispel_portal(atom/target, mob/user)
if(is_parent_of_portal(target)) //dispel me from this horrid realm
var/dispel_time = 2 - (manipulator.rating/2)
if(dispel_time == 0)
qdel(target)
to_chat(user, span_notice("You dispel [target] with \the [src]!"))
return
balloon_alert(user, "Dispelling portal...")
if(do_after(user, dispel_time SECONDS, target))
qdel(target)
to_chat(user, span_notice("You dispel [target] with \the [src]!"))
2 changes: 2 additions & 0 deletions modular_dripstation/includes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
#include "code\game\objects\items\devices\radio\encryptionkey.dm"
#include "code\game\objects\items\devices\radio\radio.dm"
#include "code\game\objects\items\devices\powersink.dm"
#include "code\game\objects\items\devices\laserpointer.dm"
#include "code\game\objects\items\devices\advpinpointer.dm"
#include "code\game\objects\items\stacks\cash.dm"
#include "code\game\objects\items\implants\implant.dm"
#include "code\game\objects\items\implants\implanter.dm"
Expand Down
Loading