Ninja Balance (#30409)

This commit is contained in:
Kurfursten
2021-09-03 13:04:01 -05:00
committed by GitHub
parent 65fe9a9e0c
commit 845bc3948b

View File

@@ -15,6 +15,8 @@
stat_datum_type = /datum/stat/role/ninja
var/last_star_throw = 0
/datum/role/ninja/OnPostSetup(var/laterole = FALSE)
. =..()
if(!.)
@@ -100,6 +102,7 @@
**** ****
**********************************/
var/list/valid_ninja_suits = list(/obj/item/clothing/suit/space/ninja,/obj/item/clothing/suit/kimono/ronin)
/obj/item/stack/shuriken
name = "3D printed shuriken"
@@ -123,17 +126,21 @@
var/mob/living/carbon/human/H = usr
var/datum/role/ninja/N = H.mind.GetRole(NINJA)
if(N)
var/suited = is_type_in_list(H.wear_suit,valid_ninja_suits) ? TRUE : FALSE
if(N.last_star_throw > world.time + (10-8*suited)) //10 deciseconds if unsuited, 2 otherwise
to_chat(H, "<span class='danger'>You can't throw \the [src] until you finish throwing the last one.</span>")
return
if(amount>1)
use(1)
var/obj/item/stack/shuriken/S = new(loc)
S.throw_at(A,throw_range,throw_speed*2)
S.throw_at(A,throw_range,throw_speed*(1+suited)) //double speed if suited
H.put_in_hands(src)
//statistics collection: ninja shuriken thrown
if(istype(N.stat_datum, /datum/stat/role/ninja))
var/datum/stat/role/ninja/ND = N.stat_datum
ND.shuriken_thrown++
else
..(A,throw_range,throw_speed*2)
..(A,throw_range,throw_speed*(1+suited)) //double speed if suited
else
to_chat(usr,"<span class='warning'>You fumble with \the [src]!</span>")
//It drops to the ground in throwcode already
@@ -169,7 +176,11 @@
var/activate_message = "Too slow."
/obj/item/weapon/substitutionhologram/IsShield()
var/mob/living/carbon/human/H = loc
if(istype(H))
if(is_type_in_list(H.wear_suit, valid_ninja_suits))
return SHIELD_ADVANCED
return FALSE
/obj/item/weapon/substitutionhologram/on_block(damage, atom/blocked)
if(ishuman(loc))
@@ -657,6 +668,12 @@ Suit and assorted
/obj/item/clothing/suit/space/ninja/get_cell()
return cell
/obj/item/clothing/suit/space/ninja/unequipped(mob/living/carbon/human/H, var/from_slot = null)
..()
if(isninja(H))
to_chat(H,"SpiderOS: <span class='sinister'>[src] reflex booster disengaged. Hologram projectors inactive.</span>")
/obj/item/clothing/suit/space/ninja/apprentice
name = "ninja suit"
desc = "A rare suit of nano-enhanced armor designed for Spider Clan assassins."
@@ -680,15 +697,8 @@ Suit and assorted
to_chat(H, "<span class='danger'>\The [src] lets out a hiss. It's no longer pressurized!</span>")
/obj/item/clothing/suit/space/ninja/equipped(mob/living/carbon/human/H, equipped_slot)
/*if(!isninja(H))
if(equipped_slot != slot_wear_suit)
to_chat(H, "<span class='danger'>\The [src] beeps menacingly.</span>")
else
src.visible_message("<span class='danger'>\The [src] suddenly explodes as [H] tries to put it on!</span>")
explosion(H.loc, 0, 0, 1)
H.u_equip(src, 1)
qdel(src)*/
//else //Maybe when there's more functionality to warrant the suit exploding.
if(isninja(H))
to_chat(H,"SpiderOS: <span class='sinister'>[src] reflex booster engaged. Hologram projectors active.</span>")
if(equipped_slot == slot_wear_suit)
icon_state = H.gender==FEMALE ? "s-ninjaf" : "s-ninja"
H.update_inv_wear_suit()