forked from yogstation13/Yogstation
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from MrCastmer/teleporter-issue
Teleporter issue and devices tweak
- Loading branch information
Showing
4 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
135 changes: 135 additions & 0 deletions
135
modular_dripstation/code/game/objects/items/devices/advpinpointer.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>") |
3 changes: 3 additions & 0 deletions
3
modular_dripstation/code/game/objects/items/devices/laserpointer.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
12
modular_dripstation/code/game/objects/items/teleportation.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]!")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters