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

Makes wayfinding great again #56055

Merged
merged 23 commits into from Jan 16, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions code/game/atoms.dm
Expand Up @@ -1769,3 +1769,27 @@
/atom/proc/InitializeAIController()
if(ai_controller)
ai_controller = new ai_controller(src)

/**
* Point at an atom
*
* Moved from pointed() verb in mob.dm
cacogen marked this conversation as resolved.
Show resolved Hide resolved
*
* Intended to enable and standardise the pointing animation for all atoms
*
* Not intended as a replacement for the mob verb
*/
/atom/proc/pointat(atom/A as mob|obj|turf in view())
cacogen marked this conversation as resolved.
Show resolved Hide resolved
if(!src || !isturf(src.loc))
cacogen marked this conversation as resolved.
Show resolved Hide resolved
return FALSE

var/turf/tile = get_turf(A)
if (!tile)
return FALSE

var/turf/our_tile = get_turf(src)
var/obj/visual = new /obj/effect/temp_visual/point(our_tile, invisibility)

animate(visual, pixel_x = (tile.x - our_tile.x) * world.icon_size + A.pixel_x, pixel_y = (tile.y - our_tile.y) * world.icon_size + A.pixel_y, time = 1.7, easing = EASE_OUT)

return TRUE
28 changes: 14 additions & 14 deletions code/game/objects/items/wayfinding.dm
Expand Up @@ -13,14 +13,14 @@
var/spawn_cooldown = 2 MINUTES
///Time per person for subsequent interactions.
var/interact_cooldown = 4 SECONDS
///How much money the dispenser starts with to cover wayfinder refunds.
///How many credits the dispenser account starts with to cover wayfinder refunds.
var/start_bal = 200
///How much money recycling a pinpointer rewards you.
///How many credits recycling a pinpointer rewards you.
var/refund_amt = 40
cacogen marked this conversation as resolved.
Show resolved Hide resolved
var/datum/bank_account/synth_acc = new /datum/bank_account/remote
var/ppt_cost = 0 //Jan 9 '21: 2560 had its difficulties for NT as well
var/expression_timer
///Jokes are behind this probability to avoid being tedious.
///Avoid being Reddit.
var/funnyprob = 5

/obj/machinery/pinpointer_dispenser/Initialize(mapload)
Expand All @@ -33,26 +33,26 @@

desc += " [ppt_cost ? "Only [ppt_cost] credits! " : ""]It also synthesises costumes for some reason."

set_expression("happy") //actual first law of robotics it needs to be friendly in an insincere way
set_expression("happy") //actual first law of robotics it needs to be friendly in a mindless way

/obj/machinery/pinpointer_dispenser/attack_hand(mob/living/user)
if(world.time < user_interact_cooldowns[user.real_name])
to_chat(user, "<span class='notice'>It doesn't respond. Give it a few seconds!</span>")
to_chat(user, "<span class='notice'>It just grins at you. Maybe you should give it a few seconds?</span>")
set_expression("veryhappy", 2 SECONDS)
cacogen marked this conversation as resolved.
Show resolved Hide resolved
return

user_interact_cooldowns[user.real_name] = world.time + interact_cooldown

for(var/obj/item/pinpointer/wayfinding/WP in user.GetAllContents())
set_expression("happy", 2 SECONDS)
set_expression("veryhappy", 2 SECONDS)
say("<span class='robot'>You already have a pinpointer!</span>")
return

var/msg
var/dispense = TRUE
var/obj/item/pinpointer/wayfinding/pointat
for(var/obj/item/pinpointer/wayfinding/WP in range(7, user))
set_expression("happy", 2 SECONDS)
set_expression("veryhappy", 2 SECONDS)
say("<span class='robot'>[WP.owner == user.real_name ? "Your" : "A"] pinpointer is there!</span>")
pointat(WP)
return
Expand Down Expand Up @@ -89,7 +89,7 @@
if(istype(I, /obj/item/pinpointer/wayfinding))
var/obj/item/pinpointer/wayfinding/WP = I
to_chat(user, "<span class='notice'>You put \the [WP] in the return slot.</span>")
var/money = TRUE
var/refundiscredits = TRUE
if(synth_acc.has_money(refund_amt) && !WP.roundstart && WP.owner != user.real_name) //exploiters bring a friend
synth_acc._adjust_money(-refund_amt)
var/obj/item/holochip/HC = new /obj/item/holochip(loc)
Expand All @@ -99,17 +99,18 @@
var/mob/living/carbon/human/H = user
H.put_in_hands(HC)
else
money = FALSE
refundiscredits = FALSE
var/costume = pick(subtypesof(/obj/effect/spawner/bundle/costume))
new costume(user.loc)
qdel(WP)
set_expression("veryhappy", 2 SECONDS)
var/refund = "some credits."
var/whatyoudid = "recycling"
if(!money)
if(!refundiscredits)
refund = "freshly synthesised costume!"
if(prob(funnyprob))
refund = "pulse rifle! Just kidding it's a costume."
else if(prob(funnyprob))
whatyoudid = "feeding me"
say("<span class='robot'>Thank you for [whatyoudid], [user.first_name()]! Here is a [refund]</span>")

Expand All @@ -120,10 +121,9 @@
if(duration)
expression_timer = addtimer(CALLBACK(src, .proc/set_expression, "happy"), duration, TIMER_STOPPABLE)

///A glib facsimile of actual pointing
/obj/machinery/pinpointer_dispenser/proc/pointat(atom)
visible_message("<span class='name'>[src]</span> points at [atom].")
new /obj/effect/temp_visual/point(atom,invisibility)
/obj/machinery/pinpointer_dispenser/pointat(A)
. = ..()
visible_message("<span class='name'>[src]</span> points at [A].")

//Pinpointer itself
/obj/item/pinpointer/wayfinding //Help players new to a station find their way around
Expand Down
10 changes: 1 addition & 9 deletions code/modules/mob/mob.dm
Expand Up @@ -571,20 +571,12 @@
set name = "Point To"
set category = "Object"

if(!src || !isturf(src.loc))
return FALSE
if(client && !(A in view(client.view, src)))
return FALSE
if(istype(A, /obj/effect/temp_visual/point))
return FALSE

var/turf/tile = get_turf(A)
if (!tile)
return FALSE

var/turf/our_tile = get_turf(src)
var/obj/visual = new /obj/effect/temp_visual/point(our_tile, invisibility)
animate(visual, pixel_x = (tile.x - our_tile.x) * world.icon_size + A.pixel_x, pixel_y = (tile.y - our_tile.y) * world.icon_size + A.pixel_y, time = 1.7, easing = EASE_OUT)
pointat(A)

return TRUE

Expand Down