HELO I AM PLASWINDOW I DO NOT CONFORM TO YOUR RULES

This commit is contained in:
Rob Nelson
2013-11-02 19:31:00 -07:00
parent 17c07bf8e9
commit ecd7783732
5 changed files with 172 additions and 15 deletions

View File

@@ -2,6 +2,8 @@
* Contains: * Contains:
* Glass sheets * Glass sheets
* Reinforced glass sheets * Reinforced glass sheets
* Plasma Glass Sheets
* Reinforced Plasma Glass Sheets (AKA Holy fuck strong windows)
* Glass shards - TODO: Move this into code/game/object/item/weapons * Glass shards - TODO: Move this into code/game/object/item/weapons
*/ */
@@ -15,6 +17,7 @@
icon_state = "sheet-glass" icon_state = "sheet-glass"
g_amt = 3750 g_amt = 3750
origin_tech = "materials=1" origin_tech = "materials=1"
var/created_window = /obj/structure/window/basic
/obj/item/stack/sheet/glass/attack_self(mob/user as mob) /obj/item/stack/sheet/glass/attack_self(mob/user as mob)
@@ -55,7 +58,8 @@
if(!user.IsAdvancedToolUser()) if(!user.IsAdvancedToolUser())
user << "\red You don't have the dexterity to do this!" user << "\red You don't have the dexterity to do this!"
return 0 return 0
var/title = "Sheet-Glass ([src.amount] sheet\s left)" var/title = "Sheet-Glass"
title += " ([src.amount] sheet\s left)"
switch(alert(title, "Would you like full tile glass or one direction?", "One Direction", "Full Window", "Cancel", null)) switch(alert(title, "Would you like full tile glass or one direction?", "One Direction", "Full Window", "Cancel", null))
if("One Direction") if("One Direction")
if(!src) return 1 if(!src) return 1
@@ -83,9 +87,8 @@
if(!found) if(!found)
dir_to_set = direction dir_to_set = direction
break break
var/obj/structure/window/W var/obj/structure/window/W
W = new /obj/structure/window/basic( user.loc, 0 ) W = new created_window( user.loc, 0 )
W.dir = dir_to_set W.dir = dir_to_set
W.ini_dir = W.dir W.ini_dir = W.dir
W.anchored = 0 W.anchored = 0
@@ -100,7 +103,7 @@
user << "\red There is a window in the way." user << "\red There is a window in the way."
return 1 return 1
var/obj/structure/window/W var/obj/structure/window/W
W = new /obj/structure/window/basic( user.loc, 0 ) W = new created_window( user.loc, 0 )
W.dir = SOUTHWEST W.dir = SOUTHWEST
W.ini_dir = SOUTHWEST W.ini_dir = SOUTHWEST
W.anchored = 0 W.anchored = 0
@@ -137,7 +140,8 @@
if(!user.IsAdvancedToolUser()) if(!user.IsAdvancedToolUser())
user << "\red You don't have the dexterity to do this!" user << "\red You don't have the dexterity to do this!"
return 0 return 0
var/title = "Sheet Reinf. Glass ([src.amount] sheet\s left)" var/title = "Sheet Reinf. Glass"
title += " ([src.amount] sheet\s left)"
switch(input(title, "Would you like full tile glass a one direction glass pane or a windoor?") in list("One Direction", "Full Window", "Windoor", "Cancel")) switch(input(title, "Would you like full tile glass a one direction glass pane or a windoor?") in list("One Direction", "Full Window", "Windoor", "Cancel"))
if("One Direction") if("One Direction")
if(!src) return 1 if(!src) return 1
@@ -284,7 +288,7 @@
playsound(src.loc, 'sound/effects/glass_step.ogg', 50, 1) playsound(src.loc, 'sound/effects/glass_step.ogg', 50, 1)
if(ishuman(M)) if(ishuman(M))
var/mob/living/carbon/human/H = M var/mob/living/carbon/human/H = M
if(!H.shoes) if(!H.shoes && !(H.wear_suit.body_parts_covered & FEET))
var/datum/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot")) var/datum/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot"))
if(affecting.status & (ORGAN_ROBOT|ORGAN_PEG)) if(affecting.status & (ORGAN_ROBOT|ORGAN_PEG))
return return
@@ -294,3 +298,54 @@
H.UpdateDamageIcon() H.UpdateDamageIcon()
H.updatehealth() H.updatehealth()
..() ..()
/*
* Plasma Glass sheets
*/
/obj/item/stack/sheet/glass/plasmaglass
name = "plasma glass"
desc = "A very strong and very resistant sheet of a plasma-glass alloy."
singular_name = "glass sheet"
icon_state = "sheet-plasmaglass"
g_amt = 7500
origin_tech = "materials=3;plasma=2"
created_window = /obj/structure/window/plasmabasic
/obj/item/stack/sheet/glass/plasmaglass/attack_self(mob/user as mob)
construct_window(user)
/obj/item/stack/sheet/glass/plasmaglass/attackby(obj/item/W, mob/user)
..()
if( istype(W, /obj/item/stack/rods) )
var/obj/item/stack/rods/V = W
var/obj/item/stack/sheet/glass/plasmarglass/RG = new (user.loc)
RG.add_fingerprint(user)
RG.add_to_stacks(user)
V.use(1)
var/obj/item/stack/sheet/glass/G = src
src = null
var/replace = (user.get_inactive_hand()==G)
G.use(1)
if (!G && !RG && replace)
user.put_in_hands(RG)
else
return ..()
/*
* Reinforced plasma glass sheets
*/
/obj/item/stack/sheet/glass/plasmarglass
name = "reinforced plasma glass"
desc = "Plasma glass which seems to have rods or something stuck in them."
singular_name = "reinforced plasma glass sheet"
icon_state = "sheet-plasmarglass"
g_amt = 7500
m_amt = 1875
origin_tech = "materials=4;plasma=2"
created_window = /obj/structure/window/plasmareinforced
/obj/item/stack/sheet/glass/plasmarglass/attack_self(mob/user as mob)
construct_window(user)

View File

@@ -11,6 +11,8 @@
var/ini_dir = null var/ini_dir = null
var/state = 0 var/state = 0
var/reinf = 0 var/reinf = 0
var/basestate
var/shardtype = /obj/item/weapon/shard
// var/silicate = 0 // number of units of silicate // var/silicate = 0 // number of units of silicate
// var/icon/silicateIcon = null // the silicated icon // var/icon/silicateIcon = null // the silicated icon
@@ -259,11 +261,11 @@
var/index = null var/index = null
index = 0 index = 0
while(index < 2) while(index < 2)
new /obj/item/weapon/shard(loc) new shardtype(loc)
if(reinf) new /obj/item/stack/rods(loc) if(reinf) new /obj/item/stack/rods(loc)
index++ index++
else else
new /obj/item/weapon/shard(loc) new shardtype(loc)
if(reinf) new /obj/item/stack/rods(loc) if(reinf) new /obj/item/stack/rods(loc)
var/pdiff=performWallPressureCheck(src.loc) var/pdiff=performWallPressureCheck(src.loc)
if(pdiff>0) if(pdiff>0)
@@ -409,12 +411,12 @@
if(abs(x-W.x)-abs(y-W.y) ) //doesn't count windows, placed diagonally to src if(abs(x-W.x)-abs(y-W.y) ) //doesn't count windows, placed diagonally to src
junction |= get_dir(src,W) junction |= get_dir(src,W)
if(opacity) if(opacity)
icon_state = "twindow[junction]" icon_state = "[basestate][junction]"
else else
if(reinf) if(reinf)
icon_state = "rwindow[junction]" icon_state = "[basestate][junction]"
else else
icon_state = "window[junction]" icon_state = "[basestate][junction]"
return return
@@ -426,18 +428,53 @@
/obj/structure/window/basic /obj/structure/window/basic
desc = "It looks thin and flimsy. A few knocks with... anything, really should shatter it."
icon_state = "window" icon_state = "window"
basestate = "window"
/obj/structure/window/plasmabasic
name = "plasma window"
desc = "A plasma-glass alloy window. It looks insanely tough to break. It appears it's also insanely tough to burn through."
basestate = "plasmawindow"
icon_state = "plasmawindow"
shardtype = /obj/item/weapon/shard/plasma
health = 120
/obj/structure/window/plasmabasic/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > T0C + 32000)
hit(round(exposed_volume / 1000), 0)
..()
/obj/structure/window/plasmareinforced
name = "reinforced plasma window"
desc = "A plasma-glass alloy window, with rods supporting it. It looks hopelessly tough to break. It also looks completely fireproof, considering how basic plasma windows are insanely fireproof."
basestate = "plasmarwindow"
icon_state = "plasmarwindow"
shardtype = /obj/item/weapon/shard/plasma
reinf = 1
health = 160
/obj/structure/window/plasmareinforced/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return
/obj/structure/window/reinforced /obj/structure/window/reinforced
name = "reinforced window" name = "reinforced window"
desc = "It looks rather strong. Might take a few good hits to shatter it."
icon_state = "rwindow" icon_state = "rwindow"
basestate = "rwindow"
health = 40
reinf = 1 reinf = 1
/obj/structure/window/reinforced/tinted /obj/structure/window/reinforced/tinted
name = "tinted window" name = "tinted window"
desc = "It looks rather strong and opaque. Might take a few good hits to shatter it."
icon_state = "twindow" icon_state = "twindow"
basestate = "twindow"
opacity = 1 opacity = 1
/obj/structure/window/reinforced/tinted/frosted /obj/structure/window/reinforced/tinted/frosted
name = "frosted window" name = "frosted window"
desc = "It looks rather strong and frosted over. Looks like it might take a few less hits then a normal reinforced window."
icon_state = "fwindow" icon_state = "fwindow"
basestate = "fwindow"
health = 30

View File

@@ -316,6 +316,21 @@
else else
on = 0 on = 0
continue continue
if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_phazon == 0)
if (ore_glass > 0 && ore_plasma > 0)
ore_glass--;
ore_plasma--;
new /obj/item/stack/sheet/glass/plasmaglass(output.loc)
else
on = 0
if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_phazon == 0)
if (ore_glass > 0 && ore_plasma > 0 && ore_iron > 0)
ore_glass--;
ore_iron--;
ore_plasma--;
new /obj/item/stack/sheet/glass/plasmarglass(output.loc)
else
on = 0
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_phazon == 1) if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_phazon == 1)
if (ore_phazon > 0) if (ore_phazon > 0)
ore_phazon--; ore_phazon--;
@@ -409,38 +424,47 @@
if (O) if (O)
if (istype(O,/obj/item/weapon/ore/iron)) if (istype(O,/obj/item/weapon/ore/iron))
ore_iron++; ore_iron++;
O.loc = null
del(O) del(O)
continue continue
if (istype(O,/obj/item/weapon/ore/glass)) if (istype(O,/obj/item/weapon/ore/glass))
ore_glass++; ore_glass++;
O.loc = null
del(O) del(O)
continue continue
if (istype(O,/obj/item/weapon/ore/diamond)) if (istype(O,/obj/item/weapon/ore/diamond))
ore_diamond++; ore_diamond++;
O.loc = null
del(O) del(O)
continue continue
if (istype(O,/obj/item/weapon/ore/plasma)) if (istype(O,/obj/item/weapon/ore/plasma))
ore_plasma++ ore_plasma++
O.loc = null
del(O) del(O)
continue continue
if (istype(O,/obj/item/weapon/ore/gold)) if (istype(O,/obj/item/weapon/ore/gold))
ore_gold++ ore_gold++
O.loc = null
del(O) del(O)
continue continue
if (istype(O,/obj/item/weapon/ore/silver)) if (istype(O,/obj/item/weapon/ore/silver))
ore_silver++ ore_silver++
O.loc = null
del(O) del(O)
continue continue
if (istype(O,/obj/item/weapon/ore/uranium)) if (istype(O,/obj/item/weapon/ore/uranium))
ore_uranium++ ore_uranium++
O.loc = null
del(O) del(O)
continue continue
if (istype(O,/obj/item/weapon/ore/clown)) if (istype(O,/obj/item/weapon/ore/clown))
ore_clown++ ore_clown++
O.loc = null
del(O) del(O)
continue continue
if (istype(O,/obj/item/weapon/ore/phazon)) if (istype(O,/obj/item/weapon/ore/phazon))
ore_phazon++ ore_phazon++
O.loc = null
del(O) del(O)
continue continue
O.loc = src.output.loc O.loc = src.output.loc

View File

@@ -42,6 +42,10 @@
dat += text("Reinforced Glass: [machine.ore_rglass] <A href='?src=\ref[src];release=rglass'>Release</A><br>") dat += text("Reinforced Glass: [machine.ore_rglass] <A href='?src=\ref[src];release=rglass'>Release</A><br>")
if(machine.ore_plasma) if(machine.ore_plasma)
dat += text("Plasma: [machine.ore_plasma] <A href='?src=\ref[src];release=plasma'>Release</A><br>") dat += text("Plasma: [machine.ore_plasma] <A href='?src=\ref[src];release=plasma'>Release</A><br>")
if(machine.ore_plasmaglass)
dat += text("Plasma Glass: [machine.ore_plasmaglass] <A href='?src=\ref[src];release=plasmaglass'>Release</A><br>")
if(machine.ore_plasmarglass)
dat += text("Reinforced Plasma Glass: [machine.ore_plasmarglass] <A href='?src=\ref[src];release=plasmarglass'>Release</A><br>")
if(machine.ore_gold) if(machine.ore_gold)
dat += text("Gold: [machine.ore_gold] <A href='?src=\ref[src];release=gold'>Release</A><br>") dat += text("Gold: [machine.ore_gold] <A href='?src=\ref[src];release=gold'>Release</A><br>")
if(machine.ore_silver) if(machine.ore_silver)
@@ -85,6 +89,18 @@
G.amount = machine.ore_plasma G.amount = machine.ore_plasma
G.loc = machine.output.loc G.loc = machine.output.loc
machine.ore_plasma = 0 machine.ore_plasma = 0
if ("plasmaglass")
if (machine.ore_plasmaglass > 0)
var/obj/item/stack/sheet/glass/plasmaglass/G = new /obj/item/stack/sheet/glass/plasmaglass
G.amount = machine.ore_plasmaglass
G.loc = machine.output.loc
machine.ore_plasmaglass = 0
if ("plasmarglass")
if (machine.ore_plasmarglass > 0)
var/obj/item/stack/sheet/glass/plasmarglass/G = new /obj/item/stack/sheet/glass/plasmarglass
G.amount = machine.ore_plasmarglass
G.loc = machine.output.loc
machine.ore_plasmarglass = 0
if ("uranium") if ("uranium")
if (machine.ore_uranium > 0) if (machine.ore_uranium > 0)
var/obj/item/stack/sheet/mineral/uranium/G = new /obj/item/stack/sheet/mineral/uranium var/obj/item/stack/sheet/mineral/uranium/G = new /obj/item/stack/sheet/mineral/uranium
@@ -203,6 +219,8 @@
var/ore_silver = 0; var/ore_silver = 0;
var/ore_diamond = 0; var/ore_diamond = 0;
var/ore_plasma = 0; var/ore_plasma = 0;
var/ore_plasmaglass = 0;
var/ore_plasmarglass = 0;
var/ore_iron = 0; var/ore_iron = 0;
var/ore_uranium = 0; var/ore_uranium = 0;
var/ore_clown = 0; var/ore_clown = 0;
@@ -272,6 +290,14 @@
ore_rglass+= O:amount ore_rglass+= O:amount
del(O) del(O)
continue continue
if (istype(O,/obj/item/stack/sheet/glass/plasmaglass))
ore_plasmaglass+= O:amount
del(O)
continue
if (istype(O,/obj/item/stack/sheet/glass/plasmarglass))
ore_plasmarglass+= O:amount
del(O)
continue
if (istype(O,/obj/item/stack/sheet/plasteel)) if (istype(O,/obj/item/stack/sheet/plasteel))
ore_plasteel+= O:amount ore_plasteel+= O:amount
del(O) del(O)
@@ -362,6 +388,18 @@
G.loc = output.loc G.loc = output.loc
ore_rglass -= stack_amt ore_rglass -= stack_amt
return return
if (ore_plasmaglass >= stack_amt)
var/obj/item/stack/sheet/glass/plasmaglass/G = new /obj/item/stack/sheet/glass/plasmaglass
G.amount = stack_amt
G.loc = output.loc
ore_plasmaglass -= stack_amt
return
if (ore_plasmarglass >= stack_amt)
var/obj/item/stack/sheet/glass/plasmarglass/G = new /obj/item/stack/sheet/glass/plasmarglass
G.amount = stack_amt
G.loc = output.loc
ore_plasmarglass -= stack_amt
return
if (ore_plasteel >= stack_amt) if (ore_plasteel >= stack_amt)
var/obj/item/stack/sheet/plasteel/G = new /obj/item/stack/sheet/plasteel var/obj/item/stack/sheet/plasteel/G = new /obj/item/stack/sheet/plasteel
G.amount = stack_amt G.amount = stack_amt

View File

@@ -1,6 +1,9 @@
/obj/item/weapon/shard/plasma /obj/item/weapon/shard/plasma
name = "plasma shard" 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.0
throwforce = 15.0
icon_state = "plasmalarge" icon_state = "plasmalarge"
/obj/item/weapon/shard/plasma/New() /obj/item/weapon/shard/plasma/New()
@@ -24,14 +27,14 @@
if ( istype(W, /obj/item/weapon/weldingtool)) if ( istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0, user)) if(WT.remove_fuel(0, user))
var/obj/item/stack/sheet/mineral/plasma/NG = new (user.loc) var/obj/item/stack/sheet/glass/plasmaglass/NG = new (user.loc)
for (var/obj/item/stack/sheet/mineral/plasma/G in user.loc) for (var/obj/item/stack/sheet/glass/plasmaglass/G in user.loc)
if(G==NG) if(G==NG)
continue continue
if(G.amount>=G.max_amount) if(G.amount>=G.max_amount)
continue continue
G.attackby(NG, user) G.attackby(NG, user)
usr << "You add the newly-formed plasma to the stack. It now contains [NG.amount] sheets." usr << "You add the newly-formed plasma glass to the stack. It now contains [NG.amount] sheets."
//SN src = null //SN src = null
del(src) del(src)
return return