Files
Yogstation/code/datums/dash_weapon.dm
tattax 4e5f8a27f3 adds antagonists to the game (#18514)
* commit 1 - get me out

* she lives

* adds wizards

* thing

* surprise end hits take 1

* s

* d

* surprise end hits take 2

* montreal

* REAl

* strangelight

* guilford fall

* natural disasters

* envelope

* h

* lady elect

* test 321

* test 123

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>

* hot toes test

* ss

* redundancy

* s

* test 2

* s²

* s³

* s²³

* a pray!

* life and limb

* epic problem

* hmm

* update

* fixes something

* fixes something²

* adds slaughter demons to the game

* rend it

* hmm

* restores something

* adds clockwork cult into the game

* adds changelings to the game

* cassevetes

* test 101

* :)

* against

* shut the door

* adds darkspawn to the game

* sad

* cashout

* adds vampires to the game

* 2

* summer freeze

* pink frosty

* test111

* adds game to the game

* 2

* syndrome

* test

* test 2

* test 3

* test 4

* adds replay to the game?

* maybe?

* slo

* hrn

* test II

* test III

* test IV

* new technique

* ahm hum

* d

* sensible

* c

* ss13

* a

* v

* f

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
2023-05-25 19:54:14 -05:00

55 lines
1.8 KiB
Plaintext

/datum/action/innate/dash
name = "Dash"
desc = "Teleport to the targeted location."
button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "jetboot"
var/current_charges = 1
var/max_charges = 1
var/charge_rate = 250
var/mob/living/carbon/human/holder
var/obj/item/dashing_item
var/dash_sound = 'sound/magic/blink.ogg'
var/recharge_sound = 'sound/magic/charge.ogg'
var/beam_effect = "blur"
var/phasein = /obj/effect/temp_visual/dir_setting/ninja/phase
var/phaseout = /obj/effect/temp_visual/dir_setting/ninja/phase/out
/datum/action/innate/dash/Grant(mob/user, obj/dasher)
. = ..()
dashing_item = dasher
holder = user
/datum/action/innate/dash/IsAvailable(feedback = FALSE)
if(current_charges > 0)
return TRUE
else
return FALSE
/datum/action/innate/dash/Activate()
dashing_item.attack_self(holder) //Used to toggle dash behavior in the dashing item
/datum/action/innate/dash/proc/Teleport(mob/user, atom/target)
if(!IsAvailable(feedback = FALSE))
return FALSE
var/turf/T = get_turf(target)
var/area/AU = get_area(user)
var/area/AT = get_area(T)
if(AT.noteleport || AU.noteleport)
return
if(target in view(user.client.view, get_turf(user)))
var/obj/spot1 = new phaseout(get_turf(user), user.dir)
user.forceMove(T)
playsound(T, dash_sound, 25, 1)
var/obj/spot2 = new phasein(get_turf(user), user.dir)
spot1.Beam(spot2,beam_effect,time=20)
current_charges--
holder.update_mob_action_buttons()
addtimer(CALLBACK(src, PROC_REF(charge)), charge_rate)
/datum/action/innate/dash/proc/charge()
current_charges = clamp(current_charges + 1, 0, max_charges)
holder.update_mob_action_buttons()
if(recharge_sound)
playsound(dashing_item, recharge_sound, 50, 1)
to_chat(holder, span_notice("[src] now has [current_charges]/[max_charges] charges."))