Skip to content

Commit

Permalink
yup thisll work
Browse files Browse the repository at this point in the history
  • Loading branch information
Erikafox committed Nov 8, 2023
1 parent 553d230 commit 4fc64b0
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 31 deletions.
8 changes: 4 additions & 4 deletions code/datums/mapgen/planetary/BeachGenerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
)
mob_spawn_chance = 1

feature_spawn_chance = 0.2
feature_spawn_chance = 1
feature_spawn_list = list(
/obj/effect/survey_point
)
Expand Down Expand Up @@ -163,8 +163,8 @@
/obj/structure/flora/rock/pile = 1,
/obj/structure/flora/ash/garden/seaweed = 1
)
flora_spawn_chance = 1
feature_spawn_chance = 0.2
flora_spawn_chance = 10
feature_spawn_chance = 1
feature_spawn_list = list(
/obj/effect/survey_point
)
Expand All @@ -182,7 +182,7 @@
/mob/living/simple_animal/hostile/bear/cave = 5,
/mob/living/simple_animal/hostile/asteroid/lobstrosity/beach = 1,
)
feature_spawn_chance = 0.2
feature_spawn_chance = 1
feature_spawn_list = list(
/obj/effect/survey_point
)
Expand Down
4 changes: 2 additions & 2 deletions code/datums/mapgen/planetary/JungleGenerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,6 @@
)
feature_spawn_chance = 2
feature_spawn_list = list(
/obj/item/rod_of_asclepius = 0.1,
/obj/effect/survey_point = 10
/obj/item/rod_of_asclepius = 1,
/obj/effect/survey_point = 100
)
20 changes: 10 additions & 10 deletions code/datums/mapgen/planetary/LavaGenerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@
/obj/structure/flora/ash/fireblossom = 1,
/obj/structure/flora/ash/puce = 5,
)
feature_spawn_chance = 0.6
feature_spawn_chance = 1
feature_spawn_list = list(
/obj/effect/survey_point = 3,
/obj/structure/flora/rock/hell = 5,
/obj/structure/elite_tumor = 1,
/obj/structure/geyser/random = 1,
/obj/effect/spawner/lootdrop/anomaly/lava = 0.5
/obj/effect/survey_point = 30,
/obj/structure/flora/rock/hell = 50,
/obj/structure/elite_tumor = 10,
/obj/structure/geyser/random = 10,
/obj/effect/spawner/lootdrop/anomaly/lava = 5

)
mob_spawn_chance = 4
Expand Down Expand Up @@ -160,10 +160,10 @@
)
feature_spawn_chance = 10
feature_spawn_list = list(
/obj/structure/flora/tree/dead/barren = 1,
/obj/structure/flora/tree/dead/tall/grey = 1,
/obj/effect/survey_point = 0.5,
/obj/effect/spawner/lootdrop/anomaly/lava = 0.1
/obj/structure/flora/tree/dead/barren = 10,
/obj/structure/flora/tree/dead/tall/grey = 10,
/obj/effect/survey_point = 5,
/obj/effect/spawner/lootdrop/anomaly/lava = 1
)

/datum/biome/lavaland/plains/dense/mixed
Expand Down
10 changes: 5 additions & 5 deletions code/datums/mapgen/planetary/RockGenerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@

feature_spawn_chance = 0.2
feature_spawn_list = list(
/obj/structure/geyser/random = 1,
/obj/structure/elite_tumor = 2,
/obj/effect/survey_point = 4,
/obj/effect/spawner/lootdrop/anomaly/rock = 1,
/obj/effect/spawner/lootdrop/anomaly/big = 0.1 //get out of here stalker
/obj/structure/geyser/random = 10,
/obj/structure/elite_tumor = 20,
/obj/effect/survey_point = 40,
/obj/effect/spawner/lootdrop/anomaly/rock = 10,
/obj/effect/spawner/lootdrop/anomaly/big = 1 //get out of here stalker
)

flora_spawn_chance = 5
Expand Down
14 changes: 7 additions & 7 deletions code/datums/mapgen/planetary/SnowGenerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,13 @@
feature_spawn_chance = 0.4
feature_spawn_list = list(
/obj/effect/survey_point = 4,
/obj/structure/spawner/ice_moon/demonic_portal/low_threat = 3,
/obj/structure/spawner/ice_moon/demonic_portal/medium_threat = 5,
/obj/structure/spawner/ice_moon/demonic_portal/high_threat = 0.6,
/obj/structure/spawner/ice_moon/demonic_portal/extreme_threat = 0.2,
/obj/structure/spawner/ice_moon = 3,
/obj/structure/spawner/ice_moon/polarbear = 3,
/obj/effect/spawner/lootdrop/anomaly/ice/cave = 1
/obj/structure/spawner/ice_moon/demonic_portal/low_threat = 30,
/obj/structure/spawner/ice_moon/demonic_portal/medium_threat = 50,
/obj/structure/spawner/ice_moon/demonic_portal/high_threat = 6,
/obj/structure/spawner/ice_moon/demonic_portal/extreme_threat = 2,
/obj/structure/spawner/ice_moon = 30,
/obj/structure/spawner/ice_moon/polarbear = 30,
/obj/effect/spawner/lootdrop/anomaly/ice/cave = 10
)

/datum/biome/cave/volcanic/lava
Expand Down
12 changes: 9 additions & 3 deletions code/game/objects/effects/survey_points.dm
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
GLOBAL_LIST_EMPTY(active_survey_points)

/obj/effect/survey_point //sure effects shouldn't be attackable, sue me.
name = "Survey Point"
desc = "A location of particular survey value."
icon = 'icons/effects/landmarks_static.dmi'
icon_state = "x"
alpha = 0
var/research_value

/obj/effect/survey_point/Initialize()
. = ..()
GLOB.active_survey_points += src
research_value = rand(750, 1500)

/obj/effect/survey_point/examine(mob/user)
Expand All @@ -22,16 +26,14 @@

var/turf/user_turf = get_turf(user)



if(!scangler.pack.powered)
to_chat(user, "Insufficient power to scan [src]")
return

to_chat(user, "<span class='notice'>You begin to scan [src] with [scangler].</span>")
scangler.active = TRUE

if(do_after(user, scangler.survey_delay, TRUE))
if(do_after(user, scangler.survey_delay, TRUE)) //note to self: refactor this into 3 procs - an attack by, do_scan, and drop_reward
flick(icon_state + "-print", item)
playsound(src, 'sound/machines/whirr_beep.ogg', 20)
user_turf.visible_message("<span class='notice'>Data recorded and enscribed to research packet.</span>")
Expand Down Expand Up @@ -67,3 +69,7 @@
var/obj/item/research_notes/research = user.get_inactive_held_item()
research.merge(result)
return

/obj/effect/survey_point/Destroy()
. = ..()
GLOB.active_survey_points -= src
54 changes: 54 additions & 0 deletions code/game/objects/items/pinpointer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,60 @@
size = "small"
return "pinondirect[size]"

//this makes me feel dirty.
/obj/item/pinpointer/survey_data
name = "survey pinpointer"
desc = "A small electronic handheld tuned to detect planetary irregularities"

/obj/item/pinpointer/survey_data/proc/trackable(mob/living/user)
var/turf/here = get_turf(src)
if((user.z == 0 || user.virtual_z() == here.virtual_z()))
var/turf/there = get_turf(user)
return (user.z != 0 || (there && ((there.virtual_z() == here.virtual_z()))))
return FALSE

/obj/item/pinpointer/survey_data/attack_self(mob/living/user)
var/list/possible_targets
if(active)
toggle_on()
user.visible_message("<span class='notice'>[user] deactivates [user.p_their()] pinpointer.</span>", "<span class='notice'>You deactivate your pinpointer.</span>")
return
for(var/i in GLOB.active_survey_points)
var/obj/effect/survey_point/my_target = i
if(!trackable(my_target))
continue
possible_targets += my_target
if(!possible_targets.len)
user.visible_message("<span class='notice'>[user]'s pinpointer fails to detect a signal.</span>", "<span class='notice'>Your pinpointer fails to detect a signal.</span>")
return

target = get_closest_target(possible_targets)
toggle_on()
user.visible_message("<span class='notice'>[user] activates [user.p_their()] pinpointer.</span>", "<span class='notice'>You activate your pinpointer.</span>")

/obj/item/pinpointer/survey_data/proc/get_closest_target(var/list/targets)
var/final_target
for(var/obj/effect/survey_point/targetee in targets)
if(targetee)
if(get_dist(src,targetee) < get_dist(src,final_target))
final_target = targetee
return final_target

/obj/item/pinpointer/survey_data/get_direction_icon(here, there)
var/size = ""
if(here == there)
size = "small"
else
switch(get_dist(here, there))
if(1 to 4)
size = "xtrlarge"
if(5 to 16)
size = "large"
//17 through 28 use the normal pinion, "pinondirect"
if(29 to INFINITY)
size = "small"
return "pinondirect[size]"

/obj/item/pinpointer/pair
name = "pair pinpointer"
desc = "A handheld tracking device that locks onto its other half of the matching pair."
Expand Down
7 changes: 7 additions & 0 deletions code/game/objects/items/survery_handheld.dm
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@
. += "<span class='notice'>Alt-click [src] to activate the barometer function.</span>"

/obj/item/attachment/survey_scanner/attack_self(mob/user)
playsound(src, 'sound/effects/ping.ogg', 75)
for(var/obj/effect/survey_point/revealed in range(2, src))
revealed.alpha = 255 //could use an effect but I'm lazy
src.pack.deductcharge(usecost / 2)


/obj/item/attachment/survey_scanner/AltClick(mob/living/user)
add_fingerprint(user)

if (user.stat || user.is_blind())
Expand Down

0 comments on commit 4fc64b0

Please sign in to comment.