Merge pull request #12255 from Fox-McCloud/shards-glass-lights

Refactors Shards, Improved Light Replacer, Adds Plasmaspear
This commit is contained in:
variableundefined
2019-09-11 10:10:18 -04:00
committed by GitHub
9 changed files with 199 additions and 186 deletions
+53 -62
View File
@@ -1,27 +1,30 @@
// Glass shards
/obj/item/shard
name = "glass shard"
name = "shard"
desc = "A nasty looking shard of glass."
icon = 'icons/obj/shards.dmi'
icon_state = "large"
sharp = TRUE
desc = "Could probably be used as ... a throwing weapon?"
w_class = WEIGHT_CLASS_TINY
force = 5
throwforce = 10
item_state = "shard-glass"
materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
materials = list(MAT_GLASS = MINERAL_MATERIAL_AMOUNT)
attack_verb = list("stabbed", "slashed", "sliced", "cut")
hitsound = 'sound/weapons/bladeslice.ogg'
armor = list("melee" = 100, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0)
sharp = TRUE
var/cooldown = 0
var/icon_prefix
var/obj/item/stack/sheet/welded_type = /obj/item/stack/sheet/glass
/obj/item/shard/suicide_act(mob/user)
to_chat(viewers(user), pick("<span class='danger'>[user] is slitting [user.p_their()] wrists with [src]! It looks like [user.p_theyre()] trying to commit suicide.</span>",
"<span class='danger'>[user] is slitting [user.p_their()] throat with [src]! It looks like [user.p_theyre()] trying to commit suicide.</span>"))
return BRUTELOSS
/obj/item/shard/New()
..()
/obj/item/shard/Initialize(mapload)
. = ..()
icon_state = pick("large", "medium", "small")
switch(icon_state)
if("small")
@@ -33,6 +36,8 @@
if("large")
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
if(icon_prefix)
icon_state = "[icon_prefix][icon_state]"
/obj/item/shard/afterattack(atom/movable/AM, mob/user, proximity)
if(!proximity || !(src in user))
@@ -48,15 +53,17 @@
if(affecting.is_robotic())
return
to_chat(H, "<span class='warning'>[src] cuts into your hand!</span>")
if(affecting.receive_damage(force*0.5))
if(affecting.receive_damage(force * 0.5))
H.UpdateDamageIcon()
/obj/item/shard/attackby(obj/item/I, mob/user, params)
if(iswelder(I))
var/obj/item/weldingtool/WT = I
if(WT.remove_fuel(0, user))
var/obj/item/stack/sheet/glass/NG = new (user.loc)
for(var/obj/item/stack/sheet/glass/G in user.loc)
var/obj/item/stack/sheet/NG = new welded_type(user.loc)
for(var/obj/item/stack/sheet/G in user.loc)
if(!istype(G, welded_type))
continue
if(G == NG)
continue
if(G.amount >= G.max_amount)
@@ -64,64 +71,48 @@
G.attackby(NG, user)
to_chat(user, "<span class='notice'>You add the newly-formed glass to the stack. It now contains [NG.amount] sheet\s.</span>")
qdel(src)
else
return ..()
return
if(istype(I, /obj/item/lightreplacer))
I.attackby(src, user)
return
return ..()
/obj/item/shard/Crossed(AM as mob|obj, oldloc)
if(isliving(AM))
var/mob/living/M = AM
if(M.incorporeal_move || M.flying || M.throwing)//you are incorporal or flying or being thrown ..no shard stepping!
/obj/item/shard/Crossed(mob/living/L, oldloc)
if(istype(L) && has_gravity(loc))
if(L.incorporeal_move || L.flying)
return
to_chat(M, "<span class='danger'>You step on \the [src]!</span>")
playsound(loc, 'sound/effects/glass_step.ogg', 50, 1) // not sure how to handle metal shards with sounds
if(ishuman(M))
var/mob/living/carbon/human/H = M
playsound(loc, 'sound/effects/glass_step.ogg', 50, TRUE)
if(ishuman(L))
var/mob/living/carbon/human/H = L
var/obj/item/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot"))
if(!affecting)
return
if(affecting.is_robotic())
return
var/feetCover = (H.wear_suit && H.wear_suit.body_parts_covered & FEET) || (H.w_uniform && H.w_uniform.body_parts_covered & FEET)
if(H.shoes || feetCover || H.buckled)
return
if(affecting.receive_damage(force, 0))
H.UpdateDamageIcon()
if( !H.shoes && ( !H.wear_suit || !(H.wear_suit.body_parts_covered & FEET) ) )
var/obj/item/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot"))
if(!affecting)
return
if(affecting.is_robotic())
return
H.Weaken(3)
if(affecting.receive_damage(5, 0))
H.UpdateDamageIcon()
..()
if(cooldown < world.time - 10) //cooldown to avoid message spam.
if(!H.incapacitated(ignore_restraints = TRUE))
H.visible_message("<span class='danger'>[H] steps on [src]!</span>", \
"<span class='userdanger'>You step on [src]!</span>")
else
H.visible_message("<span class='danger'>[H] slides on [src]!</span>", \
"<span class='userdanger'>You slide on [src]!</span>")
cooldown = world.time
H.Weaken(3)
return ..()
/obj/item/shard/plasma
name = "plasma shard"
desc = "A shard of plasma glass. Considerably tougher then normal glass shards. Apparently not tough enough to be a window."
force = 8
throwforce = 15
force = 6
throwforce = 11
icon_state = "plasmalarge"
sharp = TRUE
/obj/item/shard/plasma/New()
..()
icon_state = pick("plasmalarge", "plasmamedium", "plasmasmall")
switch(icon_state)
if("plasmasmall")
pixel_x = rand(-12, 12)
pixel_y = rand(-12, 12)
if("plasmamedium")
pixel_x = rand(-8, 8)
pixel_y = rand(-8, 8)
if("plasmalarge")
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
/obj/item/shard/plasma/attackby(obj/item/W, mob/user, params)
if(iswelder(W))
var/obj/item/weldingtool/WT = W
if(WT.remove_fuel(0, user))
var/obj/item/stack/sheet/plasmaglass/NG = new (user.loc)
for(var/obj/item/stack/sheet/plasmaglass/G in user.loc)
if(G == NG)
continue
if(G.amount >= G.max_amount)
continue
G.attackby(NG, user, params)
to_chat(usr, "You add the newly-formed plasma glass to the stack. It now contains [NG.amount] sheets.")
qdel(src)
else
return ..()
materials = list(MAT_PLASMA = MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS = MINERAL_MATERIAL_AMOUNT)
icon_prefix = "plasma"
welded_type = /obj/item/stack/sheet/plasmaglass
+14 -7
View File
@@ -337,14 +337,23 @@
sharp = TRUE
no_spin_thrown = TRUE
var/obj/item/grenade/explosive = null
var/icon_prefix = "spearglass"
/obj/item/twohanded/spear/update_icon()
if(explosive)
icon_state = "spearbomb[wielded]"
else
icon_state = "spearglass[wielded]"
icon_state = "[icon_prefix][wielded]"
/obj/item/twohanded/spear/CheckParts(list/parts_list)
var/obj/item/shard/tip = locate() in parts_list
if(istype(tip, /obj/item/shard/plasma))
force_wielded = 19
force_unwielded = 11
throwforce = 21
icon_prefix = "spearplasma"
update_icon()
qdel(tip)
..()
/obj/item/twohanded/spear/afterattack(atom/movable/AM, mob/user, proximity)
if(!proximity)
return
@@ -370,9 +379,7 @@
force_wielded = 20 //I have no idea how to balance
throwforce = 22
armour_penetration = 15 //Enhanced armor piercing
/obj/item/twohanded/spear/bonespear/update_icon()
icon_state = "bone_spear[wielded]"
icon_prefix = "bone_spear"
//GREY TIDE
/obj/item/twohanded/spear/grey_tide
+6 -1
View File
@@ -105,7 +105,12 @@
..()
if(istype(I, /obj/item/shard))
var/obj/item/twohanded/spear/S = new /obj/item/twohanded/spear
if(istype(I, /obj/item/shard/plasma))
S.force_wielded = 19
S.force_unwielded = 11
S.throwforce = 21
S.icon_prefix = "spearplasma"
S.update_icon()
if(!remove_item_from_storage(user))
user.unEquip(src)
user.unEquip(I)