mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Renamed the prisoner computer's file to prisoner and added a sanity check.
The singularity is now able to eat things like signs and chameleon projectors' projections. A few other misc runtime fixes. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2916 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -6,79 +6,69 @@ SHARDS
|
||||
|
||||
*/
|
||||
|
||||
/proc/construct_window(mob/usr as mob, obj/item/stack/sheet/src as obj)
|
||||
if (!( istype(usr.loc, /turf/simulated) ))
|
||||
return
|
||||
if ( ! (istype(usr, /mob/living/carbon/human) || \
|
||||
istype(usr, /mob/living/silicon) || \
|
||||
istype(usr, /mob/living/carbon/monkey) && ticker && ticker.mode.name == "monkey") )
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return 1
|
||||
/proc/construct_window(mob/user as mob, obj/item/stack/sheet/src as obj)//Why is this a general proc and not on the glass sheet?
|
||||
if(!user || !src) return 0
|
||||
if(!user.IsAdvancedToolUser())
|
||||
user << "\red You don't have the dexterity to do this!"
|
||||
return 0
|
||||
var/reinf = istype(src, /obj/item/stack/sheet/rglass)
|
||||
var/title = reinf?"Sheet Reinf. Glass":"Sheet-Glass"
|
||||
title += " ([src.amount] sheet\s left)"
|
||||
switch(alert(title, "Would you like full tile glass or one direction?", "one direct", "full (2 sheets)", "cancel", null))
|
||||
if("one direct")
|
||||
if (src.loc != usr)
|
||||
return 1
|
||||
if (src.amount < 1)
|
||||
return 1
|
||||
if(!src) return 1
|
||||
if(src.loc != user || !src.use(1)) return 1
|
||||
var/list/directions = new/list(cardinal)
|
||||
for (var/obj/structure/window/win in usr.loc)
|
||||
for (var/obj/structure/window/win in user.loc)
|
||||
directions-=win.dir
|
||||
if(!(win.ini_dir in cardinal))
|
||||
usr << "\red Can't let you do that."
|
||||
user << "\red Can't let you do that."
|
||||
return 1
|
||||
var/dir_to_set = 2
|
||||
//yes, this could probably be done better but hey... it works...
|
||||
for(var/obj/structure/window/WT in usr.loc)
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 4
|
||||
for(var/obj/structure/window/WT in usr.loc)
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 1
|
||||
for(var/obj/structure/window/WT in usr.loc)
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 8
|
||||
for(var/obj/structure/window/WT in usr.loc)
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 2
|
||||
var/obj/structure/window/W
|
||||
if(reinf)
|
||||
W = new /obj/structure/window/reinforced( usr.loc, reinf )
|
||||
W = new /obj/structure/window/reinforced( user.loc, reinf )
|
||||
W.state = 0
|
||||
else
|
||||
W = new /obj/structure/window/basic( usr.loc, reinf )
|
||||
W = new /obj/structure/window/basic( user.loc, reinf )
|
||||
W.dir = dir_to_set
|
||||
W.ini_dir = W.dir
|
||||
W.anchored = 0
|
||||
src.use(1)
|
||||
if("full (2 sheets)")
|
||||
if (src.loc != usr)
|
||||
return 1
|
||||
if (src.amount < 2)
|
||||
return 1
|
||||
if (locate(/obj/structure/window) in usr.loc)
|
||||
usr << "\red Can't let you do that."
|
||||
if(!src) return 1
|
||||
if(src.loc != user || !src.use(2)) return 1
|
||||
if(locate(/obj/structure/window) in user.loc)
|
||||
user << "\red There is a window in the way."
|
||||
return 1
|
||||
var/obj/structure/window/W
|
||||
if(reinf)
|
||||
W = new /obj/structure/window/reinforced( usr.loc, reinf )
|
||||
W = new /obj/structure/window/reinforced( user.loc, reinf )
|
||||
W.state = 0
|
||||
else
|
||||
W = new /obj/structure/window/basic( usr.loc, reinf )
|
||||
W = new /obj/structure/window/basic( user.loc, reinf )
|
||||
W.dir = SOUTHWEST
|
||||
W.ini_dir = SOUTHWEST
|
||||
W.anchored = 0
|
||||
src.use(2)
|
||||
else
|
||||
//do nothing
|
||||
return
|
||||
return 0
|
||||
|
||||
// GLASS
|
||||
|
||||
/obj/item/stack/sheet/glass/attack_self(mob/user as mob)
|
||||
construct_window(usr, src)
|
||||
construct_window(user, src)
|
||||
|
||||
/obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user)
|
||||
..()
|
||||
@@ -115,7 +105,7 @@ SHARDS
|
||||
// REINFORCED GLASS
|
||||
|
||||
/obj/item/stack/sheet/rglass/attack_self(mob/user as mob)
|
||||
construct_window(usr, src)
|
||||
construct_window(user, src)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user