Conflicts:
	.travis.yml
	code/controllers/configuration.dm
	code/game/gamemodes/changeling/modularchangling.dm
	code/game/jobs/job/medical.dm
	code/game/jobs/job/security.dm
	code/game/machinery/Sleeper.dm
	code/game/machinery/computer/communications.dm
	code/game/machinery/cryopod.dm
	code/game/objects/items/weapons/RCD.dm
	code/game/objects/items/weapons/storage/boxes.dm
	code/game/turfs/simulated/floor.dm
	code/game/turfs/simulated/floor_types.dm
	code/global.dm
	code/modules/materials/materials.dm
	code/modules/mob/living/silicon/ai/ai.dm
	code/modules/projectiles/guns/projectile/automatic.dm
	polaris.dme
This commit is contained in:
Neerti
2015-08-23 01:30:46 -04:00
792 changed files with 19715 additions and 17049 deletions
+37 -18
View File
@@ -3,26 +3,45 @@
icon_state = "empty"
anchored = 1
var/cult = 0
New()
ChangeSign(pick("pinkflamingo", "magmasea", "limbo", "rustyaxe", "armokbar", "brokendrum", "meadbay", "thedamnwall", "thecavern", "cindikate", "theorchard", "thesaucyclown", "theclownshead", "whiskeyimplant", "carpecarp", "robustroadhouse", "greytide", "theredshirt","thebark","theharmbaton","theharmedbaton","thesingulo","thedrukcarp","thedrunkcarp", "scotch","officerbeersky","on"))
return
proc/ChangeSign(var/Text)
src.icon_state = "[Text]"
//on = 0
//brightness_on = 4 //uncomment these when the lighting fixes get in
return
/obj/structure/sign/double/barsign/proc/get_valid_states(initial=1)
. = icon_states(icon)
. -= "on"
. -= "narsiebistro"
. -= "empty"
if(initial)
. -= "Off"
/obj/structure/sign/double/barsign/examine(mob/user)
..()
switch(icon_state)
if("Off")
user << "It appears to be switched off."
if("narsiebistro")
user << "It shows a picture of a large black and red being. Spooky!"
if("on", "empty")
user << "The lights are on, but there's no picture."
else
user << "It says '[icon_state]'"
/obj/structure/sign/double/barsign/New()
..()
icon_state = pick(get_valid_states())
/obj/structure/sign/double/barsign/attackby(obj/item/I, mob/user)
if(cult)
return ..()
var/obj/item/weapon/card/id/card = I.GetID()
if(istype(card))
if(access_bar in card.GetAccess())
var/sign_type = input(user, "What would you like to change the barsign to?") as null|anything in get_valid_states(0)
if(!sign_type)
return
icon_state = sign_type
user << "<span class='notice'>You change the barsign.</span>"
else
user << "<span class='warning'>Access denied.</span>"
return
if(istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/card = I
if(access_bar in card.GetAccess())
var/sign_type = input(user, "What would you like to change the barsign to?") as null|anything in list("Off", "Pink Flamingo", "Magma Sea", "Limbo", "Rusty Axe", "Armok Bar", "Broken Drum", "Mead Bay", "The Damn Wall", "The Cavern", "Cindi Kate", "The Orchard", "The Saucy Clown", "The Clowns Head", "Whiskey Implant", "Carpe Carp", "Robust Roadhouse", "Greytide", "The Redshirt", "The Bark", "The Harm Baton", "The Harmed Baton", "The Singulo", "The Druk Carp", "The Drunk Carp", "Scotch", "Officer Beersky", "On")
if(sign_type == null)
return
else
sign_type = replacetext(lowertext(sign_type), " ", "") // lowercase, strip spaces - along with choices for user options, avoids huge if-else-else
src.ChangeSign(sign_type)
user << "You change the barsign."
return ..()
@@ -25,6 +25,16 @@ LINEN BINS
add_fingerprint(user)
return
/obj/item/weapon/bedsheet/attackby(obj/item/I, mob/user)
if(is_sharp(I))
user.visible_message("<span class='notice'>\The [user] begins cutting up [src] with [I].</span>", "<span class='notice'>You begin cutting up [src] with [I].</span>")
if(do_after(user, 50))
user << "<span class='notice'>You cut [src] into pieces!</span>"
for(var/i in 1 to rand(2,5))
new /obj/item/weapon/reagent_containers/glass/rag(src.loc)
qdel(src)
return
..()
/obj/item/weapon/bedsheet/blue
icon_state = "sheetblue"
@@ -53,11 +53,6 @@
else
user << "It is full."
/obj/structure/closet/alter_health()
return get_turf(src)
/obj/structure/closet/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0 || wall_mounted)) return 1
return (!density)
@@ -346,9 +341,12 @@
if(!req_breakout())
return
if(!escapee.canClick())
return
escapee.setClickCooldown(100)
//okay, so the closet is either welded or locked... resist!!!
escapee.next_move = world.time + 100
escapee.last_special = world.time + 100
escapee << "<span class='warning'>You lean on the back of \the [src] and start pushing the door open. (this will take about [breakout_time] minutes)</span>"
visible_message("<span class='danger'>The [src] begins to shake violently!</span>")
@@ -68,7 +68,7 @@
new /obj/item/weapon/cartridge/janitor(src)
new /obj/item/clothing/gloves/black(src)
new /obj/item/clothing/head/soft/purple(src)
new /obj/item/clothing/head/beret/jan(src)
new /obj/item/clothing/head/beret/purple(src)
new /obj/item/device/flashlight(src)
new /obj/item/weapon/caution(src)
new /obj/item/weapon/caution(src)
@@ -11,16 +11,16 @@
New()
..()
new /obj/item/weapon/reagent_containers/food/drinks/cans/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/cans/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/cans/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/cans/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/cans/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/cans/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/cans/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/cans/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/cans/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/cans/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer( src )
new /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer( src )
return
/obj/structure/closet/secure_closet/bar/update_icon()
@@ -122,7 +122,7 @@
new /obj/item/weapon/gun/energy/gun(src)
new /obj/item/clothing/accessory/holster/waist(src)
new /obj/item/weapon/melee/telebaton(src)
new /obj/item/clothing/head/beret/sec/hos(src)
new /obj/item/clothing/head/beret/sec/corporate/hos(src)
return
@@ -159,7 +159,7 @@
new /obj/item/weapon/melee/baton/loaded(src)
new /obj/item/weapon/gun/energy/gun(src)
new /obj/item/weapon/storage/box/holobadge(src)
new /obj/item/clothing/head/beret/sec/warden(src)
new /obj/item/clothing/head/beret/sec/corporate/warden(src)
return
@@ -309,7 +309,7 @@
/obj/structure/closet/secure_closet/courtroom
name = "courtroom locker"
req_access = list(access_court)
req_access = list(access_lawyer)
New()
..()
@@ -42,11 +42,11 @@
/obj/structure/closet/syndicate/nuclear/New()
..()
new /obj/item/ammo_magazine/a12mm(src)
new /obj/item/ammo_magazine/a12mm(src)
new /obj/item/ammo_magazine/a12mm(src)
new /obj/item/ammo_magazine/a12mm(src)
new /obj/item/ammo_magazine/a12mm(src)
new /obj/item/ammo_magazine/a10mm(src)
new /obj/item/ammo_magazine/a10mm(src)
new /obj/item/ammo_magazine/a10mm(src)
new /obj/item/ammo_magazine/a10mm(src)
new /obj/item/ammo_magazine/a10mm(src)
new /obj/item/weapon/storage/box/handcuffs(src)
new /obj/item/weapon/storage/box/flashbangs(src)
new /obj/item/weapon/gun/energy/gun(src)
@@ -1,6 +1,6 @@
/obj/structure/closet/wardrobe
name = "wardrobe"
desc = "It's a storage unit for standard-issue Nanotrasen attire."
desc = "It's a storage unit for standard-issue attire."
icon_state = "blue"
icon_closed = "blue"
@@ -26,9 +26,9 @@
new /obj/item/clothing/head/beret/sec(src)
new /obj/item/clothing/head/beret/sec(src)
new /obj/item/clothing/head/beret/sec(src)
new /obj/item/clothing/head/beret/sec/alt(src)
new /obj/item/clothing/head/beret/sec/alt(src)
new /obj/item/clothing/head/beret/sec/alt(src)
new /obj/item/clothing/head/beret/sec/corporate/officer(src)
new /obj/item/clothing/head/beret/sec/corporate/officer(src)
new /obj/item/clothing/head/beret/sec/corporate/officer(src)
return
@@ -71,7 +71,7 @@
/obj/structure/closet/wardrobe/chaplain_black
name = "chapel wardrobe"
desc = "It's a storage unit for Nanotrasen-approved religious attire."
desc = "It's a storage unit for approved religious attire."
icon_state = "black"
icon_closed = "black"
@@ -123,7 +123,7 @@
/obj/structure/closet/wardrobe/orange
name = "prison wardrobe"
desc = "It's a storage unit for Nanotrasen-regulation prisoner attire."
desc = "It's a storage unit for regulation prisoner attire."
icon_state = "orange"
icon_closed = "orange"
@@ -173,9 +173,9 @@
new /obj/item/clothing/head/hardhat/red(src)
new /obj/item/clothing/head/hardhat/red(src)
new /obj/item/clothing/head/hardhat/red(src)
new /obj/item/clothing/head/beret/eng(src)
new /obj/item/clothing/head/beret/eng(src)
new /obj/item/clothing/head/beret/eng(src)
new /obj/item/clothing/head/beret/engineering(src)
new /obj/item/clothing/head/beret/engineering(src)
new /obj/item/clothing/head/beret/engineering(src)
return
@@ -199,9 +199,9 @@
new /obj/item/clothing/head/hardhat(src)
new /obj/item/clothing/head/hardhat(src)
new /obj/item/clothing/head/hardhat(src)
new /obj/item/clothing/head/beret/eng(src)
new /obj/item/clothing/head/beret/eng(src)
new /obj/item/clothing/head/beret/eng(src)
new /obj/item/clothing/head/beret/engineering(src)
new /obj/item/clothing/head/beret/engineering(src)
new /obj/item/clothing/head/beret/engineering(src)
return
@@ -14,7 +14,7 @@
new /obj/item/stack/material/wood(src)
var/turf/T = get_turf(src)
for(var/atom/movable/AM in contents)
if(AM.simulated) AM.loc = T
if(AM.simulated) AM.forceMove(T)
user.visible_message("<span class='notice'>[user] pries \the [src] open.</span>", \
"<span class='notice'>You pry open \the [src].</span>", \
"<span class='notice'>You hear splitting wood.</span>")
+8
View File
@@ -44,6 +44,14 @@
color = "#B8F5E3"
alpha = 200
/obj/structure/curtain/open/bed
name = "bed curtain"
color = "#854636"
/obj/structure/curtain/open/privacy
name = "privacy curtain"
color = "#B8F5E3"
/obj/structure/curtain/open/shower
name = "shower curtain"
color = "#ACD1E9"
@@ -242,20 +242,20 @@
electronics = null
else if(istype(W, /obj/item/stack/material) && !glass)
var/obj/item/stack/material/S = W
var/obj/item/stack/S = W
var/material_name = S.get_material_name()
if (S)
if (S.get_amount() >= 1)
if(istype(S, /obj/item/stack/material/glass/reinforced))
if(material_name == "rglass")
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.")
if(do_after(user, 40) && !glass)
if (S.use(1))
user << "<span class='notice'>You installed reinforced glass windows into the airlock assembly.</span>"
glass = 1
else if(istype(S, /obj/item/stack/material) && S.default_type)
var/M = S.default_type
else if(material_name)
// Ugly hack, will suffice for now. Need to fix it upstream as well, may rewrite mineral walls. ~Z
if(M in list("mhydrogen","osmium","tritium","platinum","iron"))
if(!(material_name in list("gold", "silver", "diamond", "uranium", "phoron", "sandstone")))
user << "You cannot make an airlock out of that material."
return
if(S.get_amount() >= 2)
@@ -263,8 +263,8 @@
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.")
if(do_after(user, 40) && !glass)
if (S.use(2))
user << "<span class='notice'>You installed [M] plating into the airlock assembly.</span>"
glass = "[M]"
user << "<span class='notice'>You installed [material_display_name(material_name)] plating into the airlock assembly.</span>"
glass = material_name
else if(istype(W, /obj/item/weapon/screwdriver) && state == 2 )
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
+4 -3
View File
@@ -43,6 +43,7 @@
return
/obj/structure/girder/proc/reset_girder()
anchored = 1
cover = initial(cover)
health = min(health,initial(health))
state = 0
@@ -108,11 +109,11 @@
else if(istype(W, /obj/item/stack/material))
var/obj/item/stack/material/S = W
var/obj/item/stack/S = W
if(S.get_amount() < 2)
return ..()
var/material/M = name_to_material[S.default_type]
var/material/M = S.get_material()
if(!istype(M))
return ..()
@@ -183,7 +184,7 @@
user << "There is not enough material here to reinforce the girder."
return
var/material/M = name_to_material[S.default_type]
var/material/M = S.get_material()
if(!istype(M) || M.integrity < 50)
user << "You cannot reinforce \the [src] with that; it is too soft."
return
+3 -1
View File
@@ -30,6 +30,7 @@
/obj/structure/grille/attack_hand(mob/user as mob)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
user.do_attack_animation(src)
@@ -155,7 +156,8 @@
//window placing end
else if(!(W.flags & CONDUCT) || !shock(user, 70))
user.do_attack_animation(src)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(src)
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
switch(W.damtype)
if("fire")
+1 -1
View File
@@ -53,7 +53,7 @@
/obj/structure/lattice/attackby(obj/item/C as obj, mob/user as mob)
if (istype(C, /obj/item/stack/tile/steel))
if (istype(C, /obj/item/stack/tile/floor))
var/turf/T = get_turf(src)
T.attackby(C, user) //BubbleWrap - hand this off to the underlying turf instead
return
+2 -3
View File
@@ -75,13 +75,12 @@
/obj/structure/mirror/raider/attack_hand(var/mob/living/carbon/human/user)
if(istype(get_area(src),/area/syndicate_mothership))
if(istype(user) && user.mind && user.mind.special_role == "Raider" && user.species != "Vox" && is_alien_whitelisted(user, "Vox"))
var/choice = input("Do you wish to become a Vox? This is not reversible.") as null|anything in list("No","Yes")
if(istype(user) && user.mind && user.mind.special_role == "Raider" && user.species.name != "Vox" && is_alien_whitelisted(user, "Vox"))
var/choice = input("Do you wish to become a true Vox of the Shoal? This is not reversible.") as null|anything in list("No","Yes")
if(choice && choice == "Yes")
var/mob/living/carbon/human/vox/vox = new(get_turf(src),"Vox")
vox.gender = user.gender
raiders.equip(vox)
new /obj/item/organ/stack/vox(vox)
if(user.mind)
user.mind.transfer_to(vox)
spawn(1)
-6
View File
@@ -60,9 +60,6 @@
return
return
/obj/structure/morgue/alter_health()
return src.loc
/obj/structure/morgue/attack_hand(mob/user as mob)
if (src.connected)
for(var/atom/movable/A as mob|obj in src.connected.loc)
@@ -230,9 +227,6 @@
return
return
/obj/structure/crematorium/alter_health()
return src.loc
/obj/structure/crematorium/attack_hand(mob/user as mob)
// if (cremating) AWW MAN! THIS WOULD BE SO MUCH MORE FUN ... TO WATCH
// user.show_message("<span class='warning'>Uh-oh, that was a bad idea.</span>", 1)
+6 -3
View File
@@ -175,12 +175,15 @@ obj/structure/safe/ex_act(severity)
level = 1 //underfloor
layer = 2.5
/obj/structure/safe/floor/initialize()
..()
var/turf/T = loc
hide(T.intact)
if(istype(T) && !T.is_plating())
hide(1)
update_icon()
/obj/structure/safe/floor/hide(var/intact)
invisibility = intact ? 101 : 0
/obj/structure/safe/floor/hides_under_flooring()
return 1
@@ -44,6 +44,9 @@
update_nearby_tiles()
..()
/obj/structure/simple_door/get_material()
return material
/obj/structure/simple_door/Bumped(atom/user)
..()
if(!state)
@@ -33,6 +33,9 @@
padding_material = get_material_by_name(new_padding_material)
update_icon()
/obj/structure/bed/get_material()
return material
// Reuse the cache/code from stools, todo maybe unify.
/obj/structure/bed/update_icon()
// Prep icon.
@@ -8,7 +8,7 @@
/obj/structure/undies_wardrobe/attack_hand(mob/user as mob)
src.add_fingerprint(user)
var/mob/living/carbon/human/H = user
if(!ishuman(user) || (H.species && !(H.species.flags & HAS_UNDERWEAR)))
if(!ishuman(user) || (H.species && !(H.species.appearance_flags & HAS_UNDERWEAR)))
user << "<span class='warning'>Sadly there's nothing in here for you to wear.</span>"
return 0
+3 -3
View File
@@ -117,7 +117,7 @@
/obj/machinery/shower
name = "shower"
desc = "The HS-451. Installed in the 2550s by the Nanotrasen Hygiene Division."
desc = "The HS-451. Installed in the 2550s by the Hygiene Division."
icon = 'icons/obj/watercloset.dmi'
icon_state = "shower"
density = 0
@@ -395,7 +395,7 @@
if (istype(RG) && RG.is_open_container())
RG.reagents.add_reagent("water", min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
user.visible_message("<span class='notice'>[user] fills \the [RG] using \the [src].</span>","<span class='notice'>You fill \the [RG] using \the [src].</span>")
return
return 1
else if (istype(O, /obj/item/weapon/melee/baton))
var/obj/item/weapon/melee/baton/B = O
@@ -413,7 +413,7 @@
user.visible_message( \
"<span class='danger'>[user] was stunned by \his wet [O]!</span>", \
"<span class='userdanger'>[user] was stunned by \his wet [O]!</span>")
return
return 1
// Short of a rewrite, this is necessary to stop monkeycubes being washed.
else if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/monkeycube))
return
+35 -27
View File
@@ -171,6 +171,7 @@
playsound(loc, 'sound/effects/Glasshit.ogg', 50, 1)
/obj/structure/window/attack_hand(mob/user as mob)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(HULK in user.mutations)
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!"))
user.visible_message("<span class='danger'>[user] smashes through [src]!</span>")
@@ -198,6 +199,7 @@
return
/obj/structure/window/attack_generic(var/mob/user, var/damage)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(!damage)
return
if(damage >= 10)
@@ -239,6 +241,7 @@
if(istype(W, /obj/item/weapon/screwdriver))
if(reinf && state >= 1)
state = 3 - state
update_nearby_icons()
playsound(loc, 'sound/items/Screwdriver.ogg', 75, 1)
user << (state == 1 ? "<span class='notice'>You have unfastened the window from the frame.</span>" : "<span class='notice'>You have fastened the window to the frame.</span>")
else if(reinf && state == 0)
@@ -267,6 +270,7 @@
new glasstype(loc)
qdel(src)
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(W.damtype == BRUTE || W.damtype == BURN)
user.do_attack_animation(src)
hit(W.force)
@@ -290,6 +294,9 @@
set category = "Object"
set src in oview(1)
if(usr.incapacitated())
return 0
if(anchored)
usr << "It is fastened to the floor therefore you can't rotate it!"
return 0
@@ -306,6 +313,9 @@
set category = "Object"
set src in oview(1)
if(usr.incapacitated())
return 0
if(anchored)
usr << "It is fastened to the floor therefore you can't rotate it!"
return 0
@@ -337,7 +347,11 @@
/obj/structure/window/Destroy()
density = 0
update_nearby_tiles()
update_nearby_icons()
var/turf/location = loc
loc = null
for(var/obj/structure/window/W in orange(location, 1))
W.update_icon()
loc = location
..()
@@ -357,35 +371,31 @@
//This proc is used to update the icons of nearby windows. It should not be confused with update_nearby_tiles(), which is an atmos proc!
/obj/structure/window/proc/update_nearby_icons()
update_icon()
for(var/direction in cardinal)
for(var/obj/structure/window/W in get_step(src,direction) )
W.update_icon()
for(var/obj/structure/window/W in orange(src, 1))
W.update_icon()
//merges adjacent full-tile windows into one (blatant ripoff from game/smoothwall.dm)
/obj/structure/window/update_icon()
//A little cludge here, since I don't know how it will work with slim windows. Most likely VERY wrong.
//this way it will only update full-tile ones
//This spawn is here so windows get properly updated when one gets deleted.
spawn(2)
if(!src) return
if(!is_fulltile())
icon_state = "[basestate]"
return
var/junction = 0 //will be used to determine from which side the window is connected to other windows
if(anchored)
for(var/obj/structure/window/W in orange(src,1))
if(W.anchored && W.density && W.is_fulltile()) //Only counts anchored, not-destroyed fill-tile windows.
if(abs(x-W.x)-abs(y-W.y) ) //doesn't count windows, placed diagonally to src
junction |= get_dir(src,W)
if(opacity)
icon_state = "[basestate][junction]"
else
if(reinf)
icon_state = "[basestate][junction]"
else
icon_state = "[basestate][junction]"
overlays.Cut()
if(!is_fulltile())
icon_state = "[basestate]"
return
var/list/dirs = list()
if(anchored)
for(var/obj/structure/window/W in orange(src,1))
if(W.anchored && W.density && W.type == src.type && W.is_fulltile()) //Only counts anchored, not-destroyed fill-tile windows.
dirs += get_dir(src, W)
var/list/connections = dirs_to_corner_states(dirs)
icon_state = ""
for(var/i = 1 to 4)
var/image/I = image(icon, "[basestate][connections[i]]", dir = 1<<(i-1))
overlays += I
return
/obj/structure/window/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > T0C + 800)
@@ -466,11 +476,9 @@
basestate = "window"
maxhealth = 40
reinf = 1
basestate = "w"
dir = 5
update_icon() //icon_state has to be set manually
return
/obj/structure/window/reinforced/polarized
name = "electrochromic window"
desc = "Adjusts its tint with voltage. Might take a few good hits to shatter it."
@@ -0,0 +1,98 @@
// Ported from Haine and WrongEnd with much gratitude!
/* ._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._. */
/*-=-=-=-=-=-=-=-=-=-=-=-=-=WHAT-EVER=-=-=-=-=-=-=-=-=-=-=-=-=-*/
/* '~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~' */
/obj/effect/wingrille_spawn
name = "window grille spawner"
icon = 'icons/obj/structures.dmi'
icon_state = "wingrille"
density = 1
anchored = 1.0
pressure_resistance = 4*ONE_ATMOSPHERE
var/win_path = /obj/structure/window/basic
var/activated
/obj/effect/wingrille_spawn/attack_hand()
attack_generic()
/obj/effect/wingrille_spawn/attack_ghost()
attack_generic()
/obj/effect/wingrille_spawn/attack_generic()
activate()
/obj/effect/wingrille_spawn/initialize()
..()
if(!win_path)
return
if(ticker && ticker.current_state < GAME_STATE_PLAYING)
activate()
/obj/effect/wingrille_spawn/proc/activate()
if(activated) return
if (!locate(/obj/structure/grille) in get_turf(src))
var/obj/structure/grille/G = PoolOrNew(/obj/structure/grille, src.loc)
handle_grille_spawn(G)
var/list/neighbours = list()
for (var/dir in cardinal)
var/turf/T = get_step(src, dir)
var/obj/effect/wingrille_spawn/other = locate(/obj/effect/wingrille_spawn) in T
if(!other)
var/found_connection
if(locate(/obj/structure/grille) in T)
for(var/obj/structure/window/W in T)
if(W.type == win_path && W.dir == get_dir(T,src))
found_connection = 1
qdel(W)
if(!found_connection)
var/obj/structure/window/new_win = PoolOrNew(win_path, src.loc)
new_win.set_dir(dir)
handle_window_spawn(new_win)
else
neighbours |= other
activated = 1
for(var/obj/effect/wingrille_spawn/other in neighbours)
if(!other.activated) other.activate()
qdel(src)
/obj/effect/wingrille_spawn/proc/handle_window_spawn(var/obj/structure/window/W)
return
// Currently unused, could be useful for pre-wired electrified windows.
/obj/effect/wingrille_spawn/proc/handle_grille_spawn(var/obj/structure/grille/G)
return
/obj/effect/wingrille_spawn/reinforced
name = "reinforced window grille spawner"
icon_state = "r-wingrille"
win_path = /obj/structure/window/reinforced
/obj/effect/wingrille_spawn/reinforced/crescent
name = "Crescent window grille spawner"
icon_state = "r-wingrille"
win_path = /obj/structure/window/reinforced
/obj/effect/wingrille_spawn/reinforced/crescent/handle_window_spawn(var/obj/structure/window/W)
W.maxhealth = 1000000
W.health = 1000000
/obj/effect/wingrille_spawn/phoron
name = "phoron window grille spawner"
icon_state = "p-wingrille"
win_path = /obj/structure/window/phoronbasic
/obj/effect/wingrille_spawn/reinforced_phoron
name = "reinforced phoron window grille spawner"
icon_state = "pr-wingrille"
win_path = /obj/structure/window/phoronreinforced
/obj/effect/wingrille_spawn/reinforced/polarized
name = "polarized window grille spawner"
color = "#444444"
win_path = /obj/structure/window/reinforced/polarized
var/id
/obj/effect/wingrille_spawn/reinforced/polarized/handle_window_spawn(var/obj/structure/window/reinforced/polarized/P)
if(id)
P.id = id