mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Moved all shard code to one file. Fixed #5992
This commit is contained in:
@@ -212,29 +212,6 @@
|
|||||||
flags = FPRINT | TABLEPASS| CONDUCT
|
flags = FPRINT | TABLEPASS| CONDUCT
|
||||||
matter = list("metal" = 3750)
|
matter = list("metal" = 3750)
|
||||||
|
|
||||||
/obj/item/weapon/shard
|
|
||||||
name = "shard"
|
|
||||||
icon = 'icons/obj/shards.dmi'
|
|
||||||
icon_state = "large"
|
|
||||||
sharp = 1
|
|
||||||
edge = 1
|
|
||||||
desc = "Could probably be used as ... a throwing weapon?"
|
|
||||||
w_class = 2.0
|
|
||||||
force = 5.0
|
|
||||||
throwforce = 8.0
|
|
||||||
item_state = "shard-glass"
|
|
||||||
matter = list("glass" = 3750)
|
|
||||||
attack_verb = list("stabbed", "slashed", "sliced", "cut")
|
|
||||||
|
|
||||||
suicide_act(mob/user)
|
|
||||||
viewers(user) << pick("\red <b>[user] is slitting \his wrists with the shard of glass! It looks like \he's trying to commit suicide.</b>", \
|
|
||||||
"\red <b>[user] is slitting \his throat with the shard of glass! It looks like \he's trying to commit suicide.</b>")
|
|
||||||
return (BRUTELOSS)
|
|
||||||
|
|
||||||
/obj/item/weapon/shard/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
|
||||||
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
|
|
||||||
return ..()
|
|
||||||
|
|
||||||
/*/obj/item/weapon/syndicate_uplink
|
/*/obj/item/weapon/syndicate_uplink
|
||||||
name = "station bounced radio"
|
name = "station bounced radio"
|
||||||
desc = "Remain silent about this..."
|
desc = "Remain silent about this..."
|
||||||
@@ -254,28 +231,6 @@
|
|||||||
matter = list("metal" = 100
|
matter = list("metal" = 100
|
||||||
origin_tech = "magnets=2;syndicate=3"*/
|
origin_tech = "magnets=2;syndicate=3"*/
|
||||||
|
|
||||||
/obj/item/weapon/shard/shrapnel
|
|
||||||
name = "shrapnel"
|
|
||||||
icon = 'icons/obj/shards.dmi'
|
|
||||||
icon_state = "shrapnellarge"
|
|
||||||
desc = "A bunch of tiny bits of shattered metal."
|
|
||||||
|
|
||||||
/obj/item/weapon/shard/shrapnel/New()
|
|
||||||
|
|
||||||
src.icon_state = pick("shrapnellarge", "shrapnelmedium", "shrapnelsmall")
|
|
||||||
switch(src.icon_state)
|
|
||||||
if("shrapnelsmall")
|
|
||||||
src.pixel_x = rand(-12, 12)
|
|
||||||
src.pixel_y = rand(-12, 12)
|
|
||||||
if("shrapnelmedium")
|
|
||||||
src.pixel_x = rand(-8, 8)
|
|
||||||
src.pixel_y = rand(-8, 8)
|
|
||||||
if("shrapnellarge")
|
|
||||||
src.pixel_x = rand(-5, 5)
|
|
||||||
src.pixel_y = rand(-5, 5)
|
|
||||||
else
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/weapon/SWF_uplink
|
/obj/item/weapon/SWF_uplink
|
||||||
name = "station-bounced radio"
|
name = "station-bounced radio"
|
||||||
desc = "used to comunicate it appears."
|
desc = "used to comunicate it appears."
|
||||||
|
|||||||
@@ -236,77 +236,6 @@
|
|||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
/*
|
|
||||||
* Glass shards - TODO: Move this into code/game/object/item/weapons
|
|
||||||
*/
|
|
||||||
/obj/item/weapon/shard/Bump()
|
|
||||||
|
|
||||||
spawn( 0 )
|
|
||||||
if (prob(20))
|
|
||||||
src.force = 15
|
|
||||||
else
|
|
||||||
src.force = 4
|
|
||||||
..()
|
|
||||||
return
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/weapon/shard/New()
|
|
||||||
|
|
||||||
src.icon_state = pick("large", "medium", "small")
|
|
||||||
switch(src.icon_state)
|
|
||||||
if("small")
|
|
||||||
src.pixel_x = rand(-12, 12)
|
|
||||||
src.pixel_y = rand(-12, 12)
|
|
||||||
if("medium")
|
|
||||||
src.pixel_x = rand(-8, 8)
|
|
||||||
src.pixel_y = rand(-8, 8)
|
|
||||||
if("large")
|
|
||||||
src.pixel_x = rand(-5, 5)
|
|
||||||
src.pixel_y = rand(-5, 5)
|
|
||||||
else
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/weapon/shard/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
||||||
..()
|
|
||||||
if ( istype(W, /obj/item/weapon/weldingtool))
|
|
||||||
var/obj/item/weapon/weldingtool/WT = W
|
|
||||||
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)
|
|
||||||
if(G==NG)
|
|
||||||
continue
|
|
||||||
if(G.amount>=G.max_amount)
|
|
||||||
continue
|
|
||||||
G.attackby(NG, user)
|
|
||||||
usr << "You add the newly-formed glass to the stack. It now contains [NG.amount] sheets."
|
|
||||||
//SN src = null
|
|
||||||
del(src)
|
|
||||||
return
|
|
||||||
return ..()
|
|
||||||
|
|
||||||
/obj/item/weapon/shard/HasEntered(AM as mob|obj)
|
|
||||||
if(ismob(AM))
|
|
||||||
var/mob/M = AM
|
|
||||||
M << "\red <B>You step in the broken glass!</B>"
|
|
||||||
playsound(src.loc, 'sound/effects/glass_step.ogg', 50, 1)
|
|
||||||
if(ishuman(M))
|
|
||||||
var/mob/living/carbon/human/H = M
|
|
||||||
|
|
||||||
if(H.species.flags & IS_SYNTHETIC)
|
|
||||||
return
|
|
||||||
|
|
||||||
if( !H.shoes && ( !H.wear_suit || !(H.wear_suit.body_parts_covered & FEET) ) )
|
|
||||||
var/datum/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot"))
|
|
||||||
if(affecting.status & ORGAN_ROBOT)
|
|
||||||
return
|
|
||||||
H.Weaken(3)
|
|
||||||
if(affecting.take_damage(5, 0))
|
|
||||||
H.UpdateDamageIcon()
|
|
||||||
H.updatehealth()
|
|
||||||
..()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Phoron Glass sheets
|
* Phoron Glass sheets
|
||||||
|
|||||||
114
code/game/objects/items/weapons/shards.dm
Normal file
114
code/game/objects/items/weapons/shards.dm
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
// Glass shards
|
||||||
|
|
||||||
|
/obj/item/weapon/shard
|
||||||
|
name = "glass shard"
|
||||||
|
icon = 'icons/obj/shards.dmi'
|
||||||
|
icon_state = "large"
|
||||||
|
sharp = 1
|
||||||
|
edge = 1
|
||||||
|
desc = "Could probably be used as ... a throwing weapon?"
|
||||||
|
w_class = 2.0
|
||||||
|
force = 5.0
|
||||||
|
throwforce = 8.0
|
||||||
|
item_state = "shard-glass"
|
||||||
|
matter = list("glass" = 3750)
|
||||||
|
attack_verb = list("stabbed", "slashed", "sliced", "cut")
|
||||||
|
|
||||||
|
suicide_act(mob/user)
|
||||||
|
viewers(user) << pick("\red <b>[user] is slitting \his wrists with the [src]! It looks like \he's trying to commit suicide.</b>", \
|
||||||
|
"\red <b>[user] is slitting \his throat with the [src]! It looks like \he's trying to commit suicide.</b>")
|
||||||
|
return (BRUTELOSS)
|
||||||
|
|
||||||
|
/obj/item/weapon/shard/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||||
|
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
|
||||||
|
return ..()
|
||||||
|
|
||||||
|
/obj/item/weapon/shard/Bump()
|
||||||
|
|
||||||
|
spawn( 0 )
|
||||||
|
if (prob(20))
|
||||||
|
src.force = 15
|
||||||
|
else
|
||||||
|
src.force = 4
|
||||||
|
..()
|
||||||
|
return
|
||||||
|
return
|
||||||
|
|
||||||
|
/obj/item/weapon/shard/New()
|
||||||
|
|
||||||
|
src.icon_state = pick("large", "medium", "small")
|
||||||
|
switch(src.icon_state)
|
||||||
|
if("small")
|
||||||
|
src.pixel_x = rand(-12, 12)
|
||||||
|
src.pixel_y = rand(-12, 12)
|
||||||
|
if("medium")
|
||||||
|
src.pixel_x = rand(-8, 8)
|
||||||
|
src.pixel_y = rand(-8, 8)
|
||||||
|
if("large")
|
||||||
|
src.pixel_x = rand(-5, 5)
|
||||||
|
src.pixel_y = rand(-5, 5)
|
||||||
|
else
|
||||||
|
return
|
||||||
|
|
||||||
|
/obj/item/weapon/shard/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||||
|
..()
|
||||||
|
if ( istype(W, /obj/item/weapon/weldingtool))
|
||||||
|
var/obj/item/weapon/weldingtool/WT = W
|
||||||
|
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)
|
||||||
|
if(G==NG)
|
||||||
|
continue
|
||||||
|
if(G.amount>=G.max_amount)
|
||||||
|
continue
|
||||||
|
G.attackby(NG, user)
|
||||||
|
usr << "You add the newly-formed glass to the stack. It now contains [NG.amount] sheets."
|
||||||
|
//SN src = null
|
||||||
|
del(src)
|
||||||
|
return
|
||||||
|
return ..()
|
||||||
|
|
||||||
|
/obj/item/weapon/shard/HasEntered(AM as mob|obj)
|
||||||
|
if(ismob(AM))
|
||||||
|
var/mob/M = AM
|
||||||
|
M << "\red <B>You step on the [src]!</B>"
|
||||||
|
playsound(src.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
|
||||||
|
|
||||||
|
if(H.species.flags & IS_SYNTHETIC)
|
||||||
|
return
|
||||||
|
|
||||||
|
if( !H.shoes && ( !H.wear_suit || !(H.wear_suit.body_parts_covered & FEET) ) )
|
||||||
|
var/datum/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot"))
|
||||||
|
if(affecting.status & ORGAN_ROBOT)
|
||||||
|
return
|
||||||
|
H.Weaken(3)
|
||||||
|
if(affecting.take_damage(5, 0))
|
||||||
|
H.UpdateDamageIcon()
|
||||||
|
H.updatehealth()
|
||||||
|
..()
|
||||||
|
|
||||||
|
// Shrapnel
|
||||||
|
|
||||||
|
/obj/item/weapon/shard/shrapnel
|
||||||
|
name = "shrapnel"
|
||||||
|
icon = 'icons/obj/shards.dmi'
|
||||||
|
icon_state = "shrapnellarge"
|
||||||
|
desc = "A bunch of tiny bits of shattered metal."
|
||||||
|
|
||||||
|
/obj/item/weapon/shard/shrapnel/New()
|
||||||
|
|
||||||
|
src.icon_state = pick("shrapnellarge", "shrapnelmedium", "shrapnelsmall")
|
||||||
|
switch(src.icon_state)
|
||||||
|
if("shrapnelsmall")
|
||||||
|
src.pixel_x = rand(-12, 12)
|
||||||
|
src.pixel_y = rand(-12, 12)
|
||||||
|
if("shrapnelmedium")
|
||||||
|
src.pixel_x = rand(-8, 8)
|
||||||
|
src.pixel_y = rand(-8, 8)
|
||||||
|
if("shrapnellarge")
|
||||||
|
src.pixel_x = rand(-5, 5)
|
||||||
|
src.pixel_y = rand(-5, 5)
|
||||||
|
else
|
||||||
|
return
|
||||||
Reference in New Issue
Block a user