Files
GS13NG/code/game/objects/items/stacks/sheets/glass.dm
T
Poojawa 0bca862419 Overhauls and 2/28 sync (#244)
* map tweaks/shuttle engines

* helpers and defines

* global/onclick

* controllers and datums

* mapping

* game folder

* some other stuff

* some modules

* modules that aren't mobs

* some mob stuff

* new player stuff

* mob living

* silicon stuff

* simple animal things

* carbon/ayylmao

* update_icons

* carbon/human

* sounds and tools

* icons and stuff

* hippie grinder changes + tgui

* kitchen.dmi

* compile issues fixed

* mapfix

* Mapfixes 2.0

* mapedit2.0

* mapmerger pls

* Revert "mapedit2.0"

This reverts commit 74139a3cacea10df7aafca06c0a10bd3daf3a481.

* clean up vore folder + 2 hotfixes

* admin ticket refinement

* Blob tweaks and LAZYADD

* LAZYADD IS LAZY

* Magic strings purged

* DEFINES NEED HIGHER PRIORITIES

* Only a sleepless idiot deals in absolute TRUE|FALSE

* u h g

* progress bar fix

* reverts ticket logs

* there's always that one guy

* fixes and stuff

* 2/27 fixes

* game folder stuff

* stats

* some modules again

* clothing stuff

gets vg clothing out of the main files

* everything not mobs again

* mob stuff

* maps, tgui, sql stuff

* icons

* additional fixes and compile errors

* don't need this anymore

* Oh right this isn't needed anymore

* maint bar re-added

* that doesn't need to be here

* stupid events

* wtfeven

* probably makes Travis happy

* don't care to fix the grinder atm

* fixes vending sprites, changes turret

* lethal, not lethals

* overylays are finicky creatures

* lazy fix for bleeding edgy (#252)

* map tweaks/shuttle engines

* helpers and defines

* global/onclick

* controllers and datums

* mapping

* game folder

* some other stuff

* some modules

* modules that aren't mobs

* some mob stuff

* new player stuff

* mob living

* silicon stuff

* simple animal things

* carbon/ayylmao

* update_icons

* carbon/human

* sounds and tools

* icons and stuff

* hippie grinder changes + tgui

* kitchen.dmi

* compile issues fixed

* mapfix

* Mapfixes 2.0

* mapedit2.0

* mapmerger pls

* Revert "mapedit2.0"

This reverts commit 74139a3cacea10df7aafca06c0a10bd3daf3a481.

* clean up vore folder + 2 hotfixes

* admin ticket refinement

* Blob tweaks and LAZYADD

* LAZYADD IS LAZY

* Magic strings purged

* DEFINES NEED HIGHER PRIORITIES

* Only a sleepless idiot deals in absolute TRUE|FALSE

* u h g

* progress bar fix

* reverts ticket logs

* there's always that one guy

* fixes and stuff

* 2/27 fixes

* game folder stuff

* stats

* some modules again

* clothing stuff

gets vg clothing out of the main files

* everything not mobs again

* mob stuff

* maps, tgui, sql stuff

* icons

* additional fixes and compile errors

* don't need this anymore

* Oh right this isn't needed anymore

* maint bar re-added

* that doesn't need to be here

* stupid events

* wtfeven

* probably makes Travis happy

* don't care to fix the grinder atm

* fixes vending sprites, changes turret

* lethal, not lethals

* overylays are finicky creatures
2017-02-28 09:30:49 -06:00

213 lines
7.3 KiB
Plaintext

/* Glass stack types
* Contains:
* Glass sheets
* Reinforced glass sheets
* Glass shards - TODO: Move this into code/game/object/item/weapons
*/
/*
* Glass sheets
*/
var/global/list/datum/stack_recipe/glass_recipes = list ( \
new/datum/stack_recipe("directional window", /obj/structure/window/unanchored, time = 0, on_floor = TRUE, window_checks = TRUE), \
new/datum/stack_recipe("fulltile window", /obj/structure/window/fulltile/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \
)
/obj/item/stack/sheet/glass
name = "glass"
desc = "HOLY SHEET! That is a lot of glass."
singular_name = "glass sheet"
icon_state = "sheet-glass"
materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
origin_tech = "materials=1"
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/glass
/obj/item/stack/sheet/glass/cyborg
materials = list()
is_cyborg = 1
cost = 500
/obj/item/stack/sheet/glass/fifty
amount = 50
/obj/item/stack/sheet/glass/New(loc, amount)
recipes = glass_recipes
..()
/obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/CC = W
if (get_amount() < 1 || CC.get_amount() < 5)
user << "<span class='warning>You need five lengths of coil and one sheet of glass to make wired glass!</span>"
return
CC.use(5)
use(1)
user << "<span class='notice'>You attach wire to the [name].</span>"
var/obj/item/stack/light_w/new_tile = new(user.loc)
new_tile.add_fingerprint(user)
else if(istype(W, /obj/item/stack/rods))
var/obj/item/stack/rods/V = W
if (V.get_amount() >= 1 && src.get_amount() >= 1)
var/obj/item/stack/sheet/rglass/RG = new (user.loc)
RG.add_fingerprint(user)
var/obj/item/stack/sheet/glass/G = src
src = null
var/replace = (user.get_inactive_held_item()==G)
V.use(1)
G.use(1)
if (!G && replace)
user.put_in_hands(RG)
else
user << "<span class='warning'>You need one rod and one sheet of glass to make reinforced glass!</span>"
return
else
return ..()
/*
* Reinforced glass sheets
*/
var/global/list/datum/stack_recipe/reinforced_glass_recipes = list ( \
new/datum/stack_recipe("windoor frame", /obj/structure/windoor_assembly, 5, time = 0, on_floor = TRUE, window_checks = TRUE), \
null, \
new/datum/stack_recipe("directional reinforced window", /obj/structure/window/reinforced/unanchored, time = 0, on_floor = TRUE, window_checks = TRUE), \
new/datum/stack_recipe("fulltile reinforced window", /obj/structure/window/reinforced/fulltile/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \
)
/obj/item/stack/sheet/rglass
name = "reinforced glass"
desc = "Glass which seems to have rods or something stuck in them."
singular_name = "reinforced glass sheet"
icon_state = "sheet-rglass"
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT/2, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
origin_tech = "materials=2"
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 70, acid = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/rglass
/obj/item/stack/sheet/rglass/cyborg
materials = list()
var/datum/robot_energy_storage/glasource
var/metcost = 250
var/glacost = 500
/obj/item/stack/sheet/rglass/cyborg/get_amount()
return min(round(source.energy / metcost), round(glasource.energy / glacost))
/obj/item/stack/sheet/rglass/cyborg/use(amount) // Requires special checks, because it uses two storages
source.use_charge(amount * metcost)
glasource.use_charge(amount * glacost)
/obj/item/stack/sheet/rglass/cyborg/add(amount)
source.add_charge(amount * metcost)
glasource.add_charge(amount * glacost)
/obj/item/stack/sheet/rglass/New(loc, amount)
recipes = reinforced_glass_recipes
..()
/obj/item/weapon/shard
name = "shard"
desc = "A nasty looking shard of glass."
icon = 'icons/obj/shards.dmi'
icon_state = "large"
w_class = WEIGHT_CLASS_TINY
force = 5
throwforce = 10
item_state = "shard-glass"
materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
attack_verb = list("stabbed", "slashed", "sliced", "cut")
hitsound = 'sound/weapons/bladeslice.ogg'
resistance_flags = ACID_PROOF
armor = list(melee = 100, bullet = 0, laser = 0, energy = 100, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 100)
obj_integrity = 40
max_integrity = 40
var/cooldown = 0
sharpness = IS_SHARP
/obj/item/weapon/shard/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is slitting [user.p_their()] [pick("wrists", "throat")] with the shard of glass! It looks like [user.p_theyre()] trying to commit suicide.</span>")
return (BRUTELOSS)
/obj/item/weapon/shard/New()
icon_state = pick("large", "medium", "small")
switch(icon_state)
if("small")
pixel_x = rand(-12, 12)
pixel_y = rand(-12, 12)
if("medium")
pixel_x = rand(-8, 8)
pixel_y = rand(-8, 8)
if("large")
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
/obj/item/weapon/shard/afterattack(atom/A as mob|obj, mob/user, proximity)
if(!proximity || !(src in user))
return
if(isturf(A))
return
if(istype(A, /obj/item/weapon/storage))
return
var/hit_hand = ((user.active_hand_index % 2 == 0) ? "r_" : "l_") + "arm"
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(!H.gloves && !(PIERCEIMMUNE in H.dna.species.species_traits)) // golems, etc
H << "<span class='warning'>[src] cuts into your hand!</span>"
H.apply_damage(force*0.5, BRUTE, hit_hand)
else if(ismonkey(user))
var/mob/living/carbon/monkey/M = user
M << "<span class='warning'>[src] cuts into your hand!</span>"
M.apply_damage(force*0.5, BRUTE, hit_hand)
/obj/item/weapon/shard/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/device/lightreplacer))
I.attackby(src, user)
else if(istype(I, /obj/item/weapon/weldingtool))
var/obj/item/weapon/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)
if(G == NG)
continue
if(G.amount >= G.max_amount)
continue
G.attackby(NG, user)
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 ..()
/obj/item/weapon/shard/Crossed(mob/AM)
if(istype(AM) && has_gravity(loc))
playsound(loc, 'sound/effects/glass_step.ogg', 50, 1)
if(ishuman(AM))
var/mob/living/carbon/human/H = AM
if(PIERCEIMMUNE in H.dna.species.species_traits)
return
var/picked_def_zone = pick("l_leg", "r_leg")
var/obj/item/bodypart/O = H.get_bodypart(picked_def_zone)
if(!istype(O))
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.movement_type & FLYING || H.buckled)
return
H.apply_damage(5, BRUTE, picked_def_zone)
if(cooldown < world.time - 10) //cooldown to avoid message spam.
if(!H.incapacitated())
H.visible_message("<span class='danger'>[H] steps in the broken glass!</span>", \
"<span class='userdanger'>You step in the broken glass!</span>")
else
H.visible_message("<span class='danger'>[H] slides on the broken glass!</span>", \
"<span class='userdanger'>You slide on the broken glass!</span>")
cooldown = world.time
H.Weaken(3)