Ports dash weapons to the dash datum
This commit is contained in:
committed by
CitadelStationBot
parent
aec96bbbbe
commit
4e648765db
@@ -307,7 +307,7 @@
|
||||
/obj/item/melee/supermatter_sword,
|
||||
/obj/item/shield/changeling,
|
||||
/obj/item/lava_staff,
|
||||
/obj/item/dash/energy_katana,
|
||||
/obj/item/energy_katana,
|
||||
/obj/item/hierophant_club,
|
||||
/obj/item/his_grace,
|
||||
/obj/item/gun/ballistic/minigun,
|
||||
|
||||
@@ -1,60 +1,4 @@
|
||||
/obj/item/dash
|
||||
name = "abstract dash weapon"
|
||||
var/max_charges = 3
|
||||
var/current_charges = 3
|
||||
var/charge_rate = 30 //In deciseconds
|
||||
var/dash_toggled = TRUE
|
||||
|
||||
var/bypass_density = FALSE //Can we beam past windows/airlocks/etc
|
||||
|
||||
var/start_effect_type = /obj/effect/temp_visual/dir_setting/ninja/phase/out
|
||||
var/end_effect_type = /obj/effect/temp_visual/dir_setting/ninja/phase
|
||||
var/beam_icon_state = "blur"
|
||||
var/dash_beam_type = /obj/effect/ebeam
|
||||
|
||||
/obj/item/dash/proc/charge()
|
||||
current_charges = Clamp(current_charges + 1, 0, max_charges)
|
||||
if(istype(loc, /mob/living))
|
||||
to_chat(loc, "<span class='notice'>[src] now has [current_charges]/[max_charges] charges.</span>")
|
||||
|
||||
/obj/item/dash/attack_self(mob/user)
|
||||
dash_toggled = !dash_toggled
|
||||
to_chat(user, "<span class='notice'>You [dash_toggled ? "enable" : "disable"] the dash function on [src].</span>")
|
||||
|
||||
/obj/item/dash/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
|
||||
if(dash_toggled)
|
||||
dash(user, target)
|
||||
return
|
||||
|
||||
/obj/item/dash/proc/dash(mob/user, atom/target)
|
||||
if(!current_charges)
|
||||
return
|
||||
|
||||
if(Adjacent(target))
|
||||
return
|
||||
|
||||
if(target.density)
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(target)
|
||||
|
||||
if(!bypass_density)
|
||||
for(var/turf/turf in getline(get_turf(user),T))
|
||||
for(var/atom/A in turf)
|
||||
if(A.density)
|
||||
return
|
||||
|
||||
if(target in view(user.client.view, get_turf(user)))
|
||||
var/obj/spot1 = new start_effect_type(T, user.dir)
|
||||
user.forceMove(T)
|
||||
playsound(T, 'sound/magic/blink.ogg', 25, 1)
|
||||
playsound(T, "sparks", 50, 1)
|
||||
var/obj/spot2 = new end_effect_type(get_turf(user), user.dir)
|
||||
spot1.Beam(spot2, beam_icon_state,time = 2, maxdistance = 20, beam_type = dash_beam_type)
|
||||
current_charges--
|
||||
addtimer(CALLBACK(src, .proc/charge), charge_rate)
|
||||
|
||||
/obj/item/dash/energy_katana
|
||||
/obj/item/energy_katana
|
||||
name = "energy katana"
|
||||
desc = "A katana infused with strong energy."
|
||||
icon_state = "energy_katana"
|
||||
@@ -73,23 +17,40 @@
|
||||
sharpness = IS_SHARP
|
||||
max_integrity = 200
|
||||
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
|
||||
bypass_density = TRUE
|
||||
var/datum/effect_system/spark_spread/spark_system
|
||||
var/datum/action/innate/dash/ninja/jaunt
|
||||
var/dash_toggled = TRUE
|
||||
|
||||
/obj/item/dash/energy_katana/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
|
||||
/obj/item/energy_katana/Initialize()
|
||||
. = ..()
|
||||
jaunt = new(src)
|
||||
spark_system = new /datum/effect_system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
|
||||
/obj/item/energy_katana/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
|
||||
if(dash_toggled)
|
||||
return ..()
|
||||
jaunt.Teleport(user, target)
|
||||
if(proximity_flag && (isobj(target) || issilicon(target)))
|
||||
spark_system.start()
|
||||
playsound(user, "sparks", 50, 1)
|
||||
playsound(user, 'sound/weapons/blade1.ogg', 50, 1)
|
||||
target.emag_act(user)
|
||||
|
||||
/obj/item/energy_katana/pickup(mob/living/user)
|
||||
. = ..()
|
||||
jaunt.Grant(user, src)
|
||||
user.update_icons()
|
||||
|
||||
/obj/item/energy_katana/dropped(mob/user)
|
||||
. = ..()
|
||||
jaunt.Remove(user)
|
||||
user.update_icons()
|
||||
|
||||
//If we hit the Ninja who owns this Katana, they catch it.
|
||||
//Works for if the Ninja throws it or it throws itself or someone tries
|
||||
//To throw it at the ninja
|
||||
/obj/item/dash/energy_katana/throw_impact(atom/hit_atom)
|
||||
/obj/item/energy_katana/throw_impact(atom/hit_atom)
|
||||
if(ishuman(hit_atom))
|
||||
var/mob/living/carbon/human/H = hit_atom
|
||||
if(istype(H.wear_suit, /obj/item/clothing/suit/space/space_ninja))
|
||||
@@ -100,7 +61,7 @@
|
||||
|
||||
..()
|
||||
|
||||
/obj/item/dash/energy_katana/proc/returnToOwner(mob/living/carbon/human/user, doSpark = 1, caught = 0)
|
||||
/obj/item/energy_katana/proc/returnToOwner(mob/living/carbon/human/user, doSpark = 1, caught = 0)
|
||||
if(!istype(user))
|
||||
return
|
||||
forceMove(get_turf(user))
|
||||
@@ -127,12 +88,15 @@
|
||||
if(msg)
|
||||
to_chat(user, "<span class='notice'>[msg]</span>")
|
||||
|
||||
/obj/item/dash/energy_katana/Initialize()
|
||||
. = ..()
|
||||
spark_system = new /datum/effect_system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
|
||||
/obj/item/dash/energy_katana/Destroy()
|
||||
/obj/item/energy_katana/Destroy()
|
||||
QDEL_NULL(spark_system)
|
||||
return ..()
|
||||
|
||||
/datum/action/innate/dash/ninja
|
||||
current_charges = 3
|
||||
max_charges = 3
|
||||
charge_rate = 30
|
||||
recharge_sound = null
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
l_pocket = /obj/item/grenade/plastic/x4
|
||||
r_pocket = /obj/item/tank/internals/emergency_oxygen
|
||||
internals_slot = slot_r_store
|
||||
belt = /obj/item/dash/energy_katana
|
||||
belt = /obj/item/energy_katana
|
||||
implants = list(/obj/item/implant/explosive)
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ Contents:
|
||||
var/datum/effect_system/spark_spread/spark_system
|
||||
var/list/stored_research = list()//For stealing station research.
|
||||
var/obj/item/disk/tech_disk/t_disk//To copy design onto disk.
|
||||
var/obj/item/dash/energy_katana/energyKatana //For teleporting the katana back to the ninja (It's an ability)
|
||||
var/obj/item/energy_katana/energyKatana //For teleporting the katana back to the ninja (It's an ability)
|
||||
|
||||
//Other articles of ninja gear worn together, used to easily reference them after initializing.
|
||||
var/obj/item/clothing/head/helmet/space/space_ninja/n_hood
|
||||
|
||||
Reference in New Issue
Block a user