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

high-risk items pinpointer #13519

Merged
merged 4 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
7 changes: 7 additions & 0 deletions code/datums/uplinks_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,13 @@
/datum/uplink_item/device_tools
category = "Devices and Tools"

/datum/uplink_item/device_tools/pinpointer
name = "Improved Pinpointer"
desc = "A artisanally modified pinpointer for searching for items that your employers are interested in."
item = /obj/item/weapon/pinpointer/highriskitems
cost = 2
uplink_types = list("traitor")

/datum/uplink_item/device_tools/disk
name = "Diskette With Virus"
desc = "A floppy disk containing a virus to sabotage R&D systems. Insert this diskette into the R&D Server Controller to destroy scientific data."
Expand Down
72 changes: 71 additions & 1 deletion code/game/gamemodes/modes_gameplays/nuclear/pinpointer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
mode = SEARCH_FOR_OBJECT
for (var/obj/machinery/nuclearbomb/N in poi_list)
if(N.nuketype == "Syndi")
target = locate(N)
target = N
simb11 marked this conversation as resolved.
Show resolved Hide resolved
to_chat(usr, "<span class='notice'>Nuclear Warhead Locator active.</span>")

playsound(src, 'sound/machines/twobeep.ogg', VOL_EFFECTS_MASTER)
Expand Down Expand Up @@ -245,5 +245,75 @@

return attack_self(usr)

/obj/item/weapon/pinpointer/highriskitems
desc = "A pinpointer designed and configured to search for specific items using a network of quantum signals."
origin_tech = "programming=5;bluespace=5"
item_action_types = list(/datum/action/item_action/hands_free/toggle_pinpointer_mode)

/datum/action/item_action/hands_free/toggle_pinpointer_mode
name = "Toggle pinpointer"

/datum/action/item_action/hands_free/toggle_pinpointer_mode/Activate()
var/obj/item/weapon/pinpointer/highriskitems/P = target
P.toggle_mode()

/obj/item/weapon/pinpointer/highriskitems/proc/toggle_mode()
reset_target()

var/datum/objective/steal/itemlist
itemlist = itemlist // To supress a 'variable defined but not used' error.
KIBORG04 marked this conversation as resolved.
Show resolved Hide resolved
var/targetitem = input("Select item to search for.", "Item Mode Select","") as null|anything in itemlist::possible_items
Copy link
Member

Choose a reason for hiding this comment

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

in itemlist::possible_items

это тут и ниже не должно работать, потому что possible_items - список, и до реальной инициализации объекта он не будет доступен. Списки просто особые и заполняются на скрытом шаге new объекта.

Можно те списки в глобалы переделать, и тут к глобальному списку просто обращаться.

Вместо possible_items_for_steal

#define ADD_TO_POIFS_LIST(type) ADD_TO_GLOBAL_LIST(type, possible_items_for_steal)
ADD_TO_POIFS_LIST(/obj/item/weapon/gun/energy/laser/selfcharging/captain)
ADD_TO_POIFS_LIST(/obj/item/weapon/hand_tele)
ADD_TO_POIFS_LIST(/obj/item/weapon/tank/jetpack/oxygen)
ADD_TO_POIFS_LIST(/obj/item/clothing/under/rank/captain)
ADD_TO_POIFS_LIST(/obj/item/device/aicard)
ADD_TO_POIFS_LIST(/obj/item/blueprints)
ADD_TO_POIFS_LIST(/obj/item/weapon/tank)
ADD_TO_POIFS_LIST(/obj/item/slime_extract)
ADD_TO_POIFS_LIST(/obj/item/weapon/reagent_containers/food/snacks/meat/corgi/ian)
ADD_TO_POIFS_LIST(/obj/item/clothing/under/rank/research_director)
ADD_TO_POIFS_LIST(/obj/item/clothing/under/rank/chief_engineer)
ADD_TO_POIFS_LIST(/obj/item/clothing/under/rank/chief_medical_officer)
ADD_TO_POIFS_LIST(/obj/item/clothing/under/rank/head_of_security)
ADD_TO_POIFS_LIST(/obj/item/clothing/under/rank/head_of_personnel)
ADD_TO_POIFS_LIST(/obj/item/weapon/reagent_containers/hypospray/cmo)
ADD_TO_POIFS_LIST(/obj/item/weapon/pinpointer)
ADD_TO_POIFS_LIST(/obj/item/weapon/reagent_containers/spray/extinguisher/golden)
ADD_TO_POIFS_LIST(/obj/item/weapon/gun/energy/gun/nuclear)
ADD_TO_POIFS_LIST(/obj/item/weapon/pickaxe/drill/diamond_drill)
ADD_TO_POIFS_LIST(/obj/item/weapon/storage/backpack/holding)
ADD_TO_POIFS_LIST(/obj/item/weapon/stock_parts/cell/hyper)
ADD_TO_POIFS_LIST(/obj/item/stack/sheet/mineral/diamond)
ADD_TO_POIFS_LIST(/obj/item/stack/sheet/mineral/gold)
ADD_TO_POIFS_LIST(/obj/item/stack/sheet/mineral/uranium)
#undef ADD_TO_POIFS_LIST

который не используется вообще и надо удалить

if(!targetitem)
return
var/obj/item/item_path = itemlist::possible_items[targetitem]
for(var/obj/item/I in global.possible_items_for_steal)
if(!istype(I, item_path))
continue
var/turf/T = get_turf(I)
if(is_centcom_level(T.z))
continue
target = I
break
if(!target)
to_chat(usr, "Failed to locate [targetitem]!")
return
to_chat(usr, "You set the pinpointer to locate [targetitem]")

return attack_self(usr)
simb11 marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/weapon/pinpointer/highriskitems/process()
if(!active)
return
if(!target && !mode)
target = locate(/obj/item/weapon/disk/nuclear)
if(!target)
icon_state = "pinonnull"
return
if(target)
var/turf/self_turf = get_turf(src)
var/turf/target_turf = get_turf(target)
if(target_turf.z != self_turf.z)
icon_state = "alterpinfaralert"
else if(target_turf == self_turf)
icon_state = "alterpindirect"
else
switch(get_dist(target_turf, self_turf))
if(1 to 10)
icon_state = "alterpin10"
if(11 to 25)
icon_state = "alterpin25"
if(26 to 50)
icon_state = "alterpin50"
if(51 to 75)
icon_state = "alterpin75"
if(76 to 100)
icon_state = "alterpin100"
if(101 to 150)
icon_state = "alterpin150"
if(151 to 200)
icon_state = "alterpin200"
if(201 to INFINITY)
icon_state = "pinonfar"

#undef SEARCH_FOR_DISK
#undef SEARCH_FOR_OBJECT
21 changes: 4 additions & 17 deletions code/game/gamemodes/objectives/steal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,14 @@ var/global/list/possible_items_for_steal = list()
ADD_TO_POIFS_LIST(/obj/item/weapon/gun/energy/laser/selfcharging/captain)
ADD_TO_POIFS_LIST(/obj/item/weapon/hand_tele)
ADD_TO_POIFS_LIST(/obj/item/weapon/tank/jetpack/oxygen)
ADD_TO_POIFS_LIST(/obj/item/clothing/under/rank/captain)
ADD_TO_POIFS_LIST(/obj/item/device/aicard)
ADD_TO_POIFS_LIST(/obj/item/blueprints)
ADD_TO_POIFS_LIST(/obj/item/weapon/tank)
ADD_TO_POIFS_LIST(/obj/item/slime_extract)
ADD_TO_POIFS_LIST(/obj/item/clothing/glasses/hud/hos_aug)
ADD_TO_POIFS_LIST(/obj/item/weapon/reagent_containers/food/snacks/meat/corgi/ian)
ADD_TO_POIFS_LIST(/obj/item/clothing/under/rank/research_director)
ADD_TO_POIFS_LIST(/obj/item/clothing/under/rank/chief_engineer)
ADD_TO_POIFS_LIST(/obj/item/clothing/under/rank/chief_medical_officer)
ADD_TO_POIFS_LIST(/obj/item/clothing/under/rank/head_of_security)
ADD_TO_POIFS_LIST(/obj/item/clothing/under/rank/head_of_personnel)
ADD_TO_POIFS_LIST(/obj/item/weapon/reagent_containers/hypospray/cmo)
ADD_TO_POIFS_LIST(/obj/item/weapon/pinpointer)
ADD_TO_POIFS_LIST(/obj/item/weapon/pinpointer/advpinpointer)
ADD_TO_POIFS_LIST(/obj/item/clothing/suit/armor/vest/reactive)
ADD_TO_POIFS_LIST(/obj/item/weapon/reagent_containers/spray/extinguisher/golden)
ADD_TO_POIFS_LIST(/obj/item/weapon/gun/energy/gun/nuclear)
ADD_TO_POIFS_LIST(/obj/item/weapon/pickaxe/drill/diamond_drill)
ADD_TO_POIFS_LIST(/obj/item/weapon/storage/backpack/holding)
ADD_TO_POIFS_LIST(/obj/item/weapon/stock_parts/cell/hyper)
ADD_TO_POIFS_LIST(/obj/item/stack/sheet/mineral/diamond)
ADD_TO_POIFS_LIST(/obj/item/stack/sheet/mineral/gold)
ADD_TO_POIFS_LIST(/obj/item/stack/sheet/mineral/uranium)
KIBORG04 marked this conversation as resolved.
Show resolved Hide resolved
#undef ADD_TO_POIFS_LIST

/datum/objective/steal
Expand All @@ -41,7 +28,7 @@ ADD_TO_POIFS_LIST(/obj/item/stack/sheet/mineral/uranium)
"a piece of Ian's meat" = /obj/item/weapon/reagent_containers/food/snacks/meat/corgi/ian,
"the hypospray" = /obj/item/weapon/reagent_containers/hypospray/cmo,
"a Research Director's teleport armor" = /obj/item/clothing/suit/armor/vest/reactive,
"the captain's pinpointer" = /obj/item/weapon/pinpointer,
"the captain's pinpointer" = /obj/item/weapon/pinpointer/advpinpointer,
"the golden fire extinguisher" = /obj/item/weapon/reagent_containers/spray/extinguisher/golden,
)

Expand Down
Binary file modified icons/obj/weapons.dmi
Binary file not shown.
Loading