mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-06-06 05:54:36 +01:00
84dc5535dc
* These two are easy * !!!runlevel_flags the fact it was global.runlevel_flags.len has me a bit...iffy on this. * !!!json_cache Same as above. used global. * player_list & observer_mob_list * mechas_list * this wasn't even used * surgery_steps * event_triggers * landmarks_list * dead_mob_list * living_mob_list * ai_list * cable_list * cleanbot_reserved_turfs * listening_objects * silicon_mob_list * human_mob_list * Update global_lists.dm * joblist * mob_list * Update global_lists.dm * holomap_markers * mapping_units * mapping_beacons * hair_styles_list * facial_hair_styles_list * Update global_lists.dm * facial_hair_styles_male_list * facial_hair_styles_female_list * body_marking_styles_list * body_marking_nopersist_list * ear_styles_list * hair_styles_male_list * tail_styles_list * wing_styles_list * escape_list & rune_list & endgame_exits these were all really small * endgame_safespawns * stool_cache * emotes_by_key * random_maps & map_count * item_tf_spawnpoints * narsie_list * active_radio_jammers * unused * paikeys * pai_software_by_key & default_pai_software * plant_seed_sprites * magazine_icondata_keys & magazine_icondata_states * unused * ashtray_cache * light_type_cache * HOLIDAY!!! this one was annoying * faction stuff (red?!) * Update preferences_factions.dm * vs edit removal * backbaglist, pdachoicelist, exclude_jobs * item_digestion_blacklist, edible_tech, blacklisted_artifact_effect, selectable_footstep, hexNums, syndicate_access * string_slot_flags and hexdigits->hexNums * possible_changeling_IDs * vr_mob_tf_options * vr_mob_spawner_options * pipe_colors * vr_mob_spawner_options * common_tools * newscaster_standard_feeds * Update periodic_news.dm * changeling_fabricated_clothing * semirandom_mob_spawner_decisions * id_card_states * Update syndicate_ids.dm * overlay_cache & gear_distributed_to * more * radio_channels_by_freq * Update global_lists.dm * proper * default_medbay_channels & default_internal_channels default_internal_channels is weird as it has a mapbased proc() but that proc is never called... * valid_ringtones * move this * possible_plants * more * separate these moves xeno2chemlist from a hook to a new global list. * tube_dir_list * valid_bloodreagents & monitor_states * Junk * valid_bloodtypes * breach_burn_descriptors & burn * more!! appliance_available_recipes seems uber cursed, re-look at later * Appliance code is cursed * wide_chassis & flying_chassis * allows_eye_color * all_tooltip_styles * direction_table * gun_choices * severity_to_string * old event_viruses * description_icons * MOVE_KEY_MAPPINGS * more more * pai & robot modules * Update global_lists.dm * GEOSAMPLES Also swaps a .len to LAZYLEN() * shieldgens * reagent recipies * global ammo types * rad collector * old file and unused global * nif_look_messages * FESH * nifsoft * chamelion * the death of sortAtom * globulins * lazylen that * Update global_lists.dm * LAZY * Theese too * quick fix --------- Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
321 lines
7.9 KiB
Plaintext
321 lines
7.9 KiB
Plaintext
/obj/item/pinpointer
|
|
name = "pinpointer"
|
|
icon = 'icons/obj/device.dmi'
|
|
icon_state = "pinoff"
|
|
slot_flags = SLOT_BELT
|
|
w_class = ITEMSIZE_SMALL
|
|
item_state = "electronic"
|
|
throw_speed = 4
|
|
throw_range = 20
|
|
matter = list(MAT_STEEL = 500)
|
|
preserve_item = 1
|
|
var/obj/item/disk/nuclear/the_disk = null
|
|
var/active = 0
|
|
|
|
pickup_sound = 'sound/items/pickup/device.ogg'
|
|
drop_sound = 'sound/items/drop/device.ogg'
|
|
|
|
/obj/item/pinpointer/Destroy()
|
|
active = 0
|
|
STOP_PROCESSING(SSobj, src)
|
|
return ..()
|
|
|
|
/obj/item/pinpointer/attack_self()
|
|
if(!active)
|
|
active = 1
|
|
START_PROCESSING(SSobj, src)
|
|
to_chat(usr, span_notice("You activate the pinpointer"))
|
|
else
|
|
active = 0
|
|
STOP_PROCESSING(SSobj, src)
|
|
icon_state = "pinoff"
|
|
to_chat(usr, span_notice("You deactivate the pinpointer"))
|
|
|
|
/obj/item/pinpointer/process()
|
|
if(!active)
|
|
return PROCESS_KILL
|
|
|
|
if(!the_disk)
|
|
the_disk = locate()
|
|
if(!the_disk)
|
|
icon_state = "pinonnull"
|
|
return
|
|
|
|
set_dir(get_dir(src,the_disk))
|
|
|
|
switch(get_dist(src,the_disk))
|
|
if(0)
|
|
icon_state = "pinondirect"
|
|
if(1 to 8)
|
|
icon_state = "pinonclose"
|
|
if(9 to 16)
|
|
icon_state = "pinonmedium"
|
|
if(16 to INFINITY)
|
|
icon_state = "pinonfar"
|
|
|
|
/obj/item/pinpointer/examine(mob/user)
|
|
. = ..()
|
|
for(var/obj/machinery/nuclearbomb/bomb in GLOB.machines)
|
|
if(bomb.timing)
|
|
. += "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]"
|
|
|
|
|
|
|
|
/obj/item/pinpointer/advpinpointer
|
|
name = "Advanced Pinpointer"
|
|
icon = 'icons/obj/device.dmi'
|
|
desc = "A larger version of the normal pinpointer, this unit features a helpful quantum entanglement detection system to locate various objects that do not broadcast a locator signal."
|
|
var/mode = 0 // Mode 0 locates disk, mode 1 locates coordinates.
|
|
var/turf/location = null
|
|
var/obj/target = null
|
|
|
|
/obj/item/pinpointer/advpinpointer/process()
|
|
if(!active)
|
|
return PROCESS_KILL
|
|
if(mode == 0)
|
|
..()
|
|
if(mode == 1)
|
|
worklocation()
|
|
if(mode == 2)
|
|
workobj()
|
|
|
|
/obj/item/pinpointer/advpinpointer/proc/worklocation()
|
|
if(!location)
|
|
icon_state = "pinonnull"
|
|
return
|
|
|
|
set_dir(get_dir(src,location))
|
|
|
|
switch(get_dist(src,location))
|
|
if(0)
|
|
icon_state = "pinondirect"
|
|
if(1 to 8)
|
|
icon_state = "pinonclose"
|
|
if(9 to 16)
|
|
icon_state = "pinonmedium"
|
|
if(16 to INFINITY)
|
|
icon_state = "pinonfar"
|
|
|
|
/obj/item/pinpointer/advpinpointer/proc/workobj()
|
|
if(!target)
|
|
icon_state = "pinonnull"
|
|
return
|
|
|
|
set_dir(get_dir(src,target))
|
|
|
|
switch(get_dist(src,target))
|
|
if(0)
|
|
icon_state = "pinondirect"
|
|
if(1 to 8)
|
|
icon_state = "pinonclose"
|
|
if(9 to 16)
|
|
icon_state = "pinonmedium"
|
|
if(16 to INFINITY)
|
|
icon_state = "pinonfar"
|
|
|
|
/obj/item/pinpointer/advpinpointer/verb/toggle_mode()
|
|
set category = "Object"
|
|
set name = "Toggle Pinpointer Mode"
|
|
set src in view(1)
|
|
|
|
active = 0
|
|
icon_state = "pinoff"
|
|
target=null
|
|
location = null
|
|
|
|
switch(tgui_alert(usr, "Please select the mode you want to put the pinpointer in.", "Pinpointer Mode Select", list("Location", "Disk Recovery", "Other Signature")))
|
|
if("Location")
|
|
mode = 1
|
|
|
|
var/locationx = tgui_input_number(usr, "Please input the x coordinate to search for.", "Location?" , "")
|
|
if(!locationx || !(usr in view(1,src)))
|
|
return
|
|
var/locationy = tgui_input_number(usr, "Please input the y coordinate to search for.", "Location?" , "")
|
|
if(!locationy || !(usr in view(1,src)))
|
|
return
|
|
|
|
var/turf/Z = get_turf(src)
|
|
|
|
location = locate(locationx,locationy,Z.z)
|
|
|
|
to_chat(usr, "You set the pinpointer to locate [locationx],[locationy]")
|
|
|
|
return attack_self()
|
|
|
|
if("Disk Recovery")
|
|
mode = 0
|
|
return attack_self()
|
|
|
|
if("Other Signature")
|
|
mode = 2
|
|
switch(tgui_alert(usr, "Search for item signature or DNA fragment?", "Signature Mode Select", list("Item", "DNA")))
|
|
|
|
if("Item")
|
|
var/datum/objective/steal/itemlist
|
|
itemlist = itemlist
|
|
var/targetitem = tgui_input_list(usr, "Select item to search for.", "Item Mode Select", itemlist.possible_items)
|
|
if(!targetitem)
|
|
return
|
|
target=locate(itemlist.possible_items[targetitem])
|
|
if(!target)
|
|
to_chat(usr, "Failed to locate [targetitem]!")
|
|
return
|
|
to_chat(usr, "You set the pinpointer to locate [targetitem]")
|
|
|
|
if("DNA")
|
|
var/DNAstring = tgui_input_text(usr, "Input DNA string to search for." , "Please Enter String." , "")
|
|
if(!DNAstring)
|
|
return
|
|
for(var/mob/living/carbon/M in GLOB.mob_list)
|
|
if(!M.dna)
|
|
continue
|
|
if(M.dna.unique_enzymes == DNAstring)
|
|
target = M
|
|
break
|
|
|
|
return attack_self()
|
|
|
|
|
|
///////////////////////
|
|
//nuke op pinpointers//
|
|
///////////////////////
|
|
|
|
|
|
/obj/item/pinpointer/nukeop
|
|
var/mode = 0 //Mode 0 locates disk, mode 1 locates the shuttle
|
|
var/obj/machinery/computer/shuttle_control/multi/syndicate/home = null
|
|
|
|
/obj/item/pinpointer/nukeop/attack_self(mob/user as mob)
|
|
if(!active)
|
|
active = 1
|
|
START_PROCESSING(SSobj, src)
|
|
if(!mode)
|
|
workdisk()
|
|
to_chat(user, span_notice("Authentication Disk Locator active."))
|
|
else
|
|
worklocation()
|
|
to_chat(user, span_notice("Shuttle Locator active."))
|
|
else
|
|
active = 0
|
|
STOP_PROCESSING(SSobj, src)
|
|
icon_state = "pinoff"
|
|
to_chat(user, span_notice("You deactivate the pinpointer."))
|
|
|
|
/obj/item/pinpointer/nukeop/process()
|
|
if(!active)
|
|
return PROCESS_KILL
|
|
|
|
switch(mode)
|
|
if(0)
|
|
workdisk()
|
|
if(1)
|
|
worklocation()
|
|
|
|
/obj/item/pinpointer/nukeop/proc/workdisk()
|
|
if(GLOB.bomb_set) //If the bomb is set, lead to the shuttle
|
|
mode = 1 //Ensures worklocation() continues to work
|
|
playsound(src, 'sound/machines/twobeep.ogg', 50, 1) //Plays a beep
|
|
visible_message(span_notice("Shuttle Locator active.")) //Lets the mob holding it know that the mode has changed
|
|
return //Get outta here
|
|
|
|
if(!the_disk)
|
|
the_disk = locate()
|
|
if(!the_disk)
|
|
icon_state = "pinonnull"
|
|
return
|
|
|
|
set_dir(get_dir(src, the_disk))
|
|
|
|
switch(get_dist(src, the_disk))
|
|
if(0)
|
|
icon_state = "pinondirect"
|
|
if(1 to 8)
|
|
icon_state = "pinonclose"
|
|
if(9 to 16)
|
|
icon_state = "pinonmedium"
|
|
if(16 to INFINITY)
|
|
icon_state = "pinonfar"
|
|
|
|
/obj/item/pinpointer/nukeop/proc/worklocation()
|
|
if(!GLOB.bomb_set)
|
|
mode = 0
|
|
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
|
|
visible_message(span_notice("Authentication Disk Locator active."))
|
|
return
|
|
|
|
if(!home)
|
|
home = locate()
|
|
if(!home)
|
|
icon_state = "pinonnull"
|
|
return
|
|
|
|
if(loc.z != home.z) //If you are on a different z-level from the shuttle
|
|
icon_state = "pinonnull"
|
|
|
|
else
|
|
set_dir(get_dir(src, home))
|
|
|
|
switch(get_dist(src, home))
|
|
if(0)
|
|
icon_state = "pinondirect"
|
|
if(1 to 8)
|
|
icon_state = "pinonclose"
|
|
if(9 to 16)
|
|
icon_state = "pinonmedium"
|
|
if(16 to INFINITY)
|
|
icon_state = "pinonfar"
|
|
|
|
|
|
// This one only points to the ship. Useful if there is no nuking to occur today.
|
|
/obj/item/pinpointer/shuttle
|
|
var/shuttle_comp_id = null
|
|
var/obj/machinery/computer/shuttle_control/our_shuttle = null
|
|
|
|
/obj/item/pinpointer/shuttle/attack_self(mob/user as mob)
|
|
if(!active)
|
|
active = TRUE
|
|
START_PROCESSING(SSobj, src)
|
|
to_chat(user, span_notice("Shuttle Locator active."))
|
|
else
|
|
active = FALSE
|
|
STOP_PROCESSING(SSobj, src)
|
|
icon_state = "pinoff"
|
|
to_chat(user, span_notice("You deactivate the pinpointer."))
|
|
|
|
/obj/item/pinpointer/shuttle/process()
|
|
if(!active)
|
|
return PROCESS_KILL
|
|
|
|
if(!our_shuttle)
|
|
for(var/obj/machinery/computer/shuttle_control/S in GLOB.machines)
|
|
if(S.shuttle_tag == shuttle_comp_id) // Shuttle tags are used so that it will work if the computer path changes, as it does on the southern cross map.
|
|
our_shuttle = S
|
|
break
|
|
|
|
if(!our_shuttle)
|
|
icon_state = "pinonnull"
|
|
return
|
|
|
|
if(loc.z != our_shuttle.z) //If you are on a different z-level from the shuttle
|
|
icon_state = "pinonnull"
|
|
|
|
else
|
|
set_dir(get_dir(src, our_shuttle))
|
|
|
|
switch(get_dist(src, our_shuttle))
|
|
if(0)
|
|
icon_state = "pinondirect"
|
|
if(1 to 8)
|
|
icon_state = "pinonclose"
|
|
if(9 to 16)
|
|
icon_state = "pinonmedium"
|
|
if(16 to INFINITY)
|
|
icon_state = "pinonfar"
|
|
|
|
|
|
/obj/item/pinpointer/shuttle/merc
|
|
shuttle_comp_id = "Mercenary"
|
|
|
|
/obj/item/pinpointer/shuttle/heist
|
|
shuttle_comp_id = "Skipjack"
|