TG: - Moved three (well two, one was doubled for some reason) screen/attackby()

procs to appear AFTER the screen object is defined. They were in a random file
instead of where the objects are. If you double-click and 'screen' object in the
object browser it now takes you to the definition instead of some random file.

- Clicking a grille with a glass or r-glass sheet in your hand, when the grille
is in one of your cardinal directions (North, south, east or west) will make you
start building a window. It takes 2s to build the window, which spawns
unfastened (same as when you create one.) This should make fixing damaged
grille-window combinations easier. If you are standing on a grille and click it
with a glass / r-glass sheet in your hand, the window will face the direction
you're currently facing.

Screenshot:
http://www.kamletos.si/placing%20windows%20on%20grilles.PNG
Revision: r3081
Author: 	 baloh.matevz
This commit is contained in:
Ren Erthilo
2012-04-22 19:22:02 +01:00
parent 464cfd49f7
commit bc02dbff87
6 changed files with 56 additions and 13 deletions

View File

@@ -117,6 +117,49 @@
for(var/mob/O in oviewers()) for(var/mob/O in oviewers())
O << text("\red [user] [src.anchored ? "fastens" : "unfastens"] the grille.") O << text("\red [user] [src.anchored ? "fastens" : "unfastens"] the grille.")
return return
else if( istype(W,/obj/item/stack/sheet/rglass) || istype(W,/obj/item/stack/sheet/glass) )
var/dir_to_set = 1
if(src.loc == usr.loc)
dir_to_set = usr.dir
else
if( ( src.x == usr.x ) || (src.y == usr.y) ) //Only supposed to work for cardinal directions.
if( src.x == usr.x )
if( src.y > usr.y )
dir_to_set = 2
else
dir_to_set = 1
else if( src.y == usr.y )
if( src.x > usr.x )
dir_to_set = 8
else
dir_to_set = 4
else
usr << "\red You can't reach there.."
return //Only works for cardinal direcitons, diagonals aren't supposed to work like this.
for(var/obj/structure/window/WINDOW in src.loc)
if(WINDOW.dir == dir_to_set)
usr << "\red There is already a window facing this way there."
return
usr << "\blue You start placing the window"
if(do_after(user,20))
if(!src) return //Grille destroyed while waiting
for(var/obj/structure/window/WINDOW in src.loc)
if(WINDOW.dir == dir_to_set)//checking this for a 2nd time to check if a window was made while we were waiting.
usr << "\red There is already a window facing this way there."
return
var/obj/structure/window/WD
if(istype(W,/obj/item/stack/sheet/rglass))
WD = new/obj/structure/window(src.loc,1) //reinforced window
else
WD = new/obj/structure/window(src.loc,0) //normal window
WD.dir = dir_to_set
WD.ini_dir = dir_to_set
WD.anchored = 0
WD.state = 0
var/obj/item/stack/ST = W
ST.use(1)
usr << "\blue You place the [WD] on the [src]"
return
else if(istype(W, /obj/item/weapon/shard)) else if(istype(W, /obj/item/weapon/shard))
src.health -= W.force * 0.1 src.health -= W.force * 0.1
else if(!shock(user, 70)) else if(!shock(user, 70))

View File

@@ -253,11 +253,6 @@
del(src) del(src)
return return
/obj/screen/close/DblClick()
if (src.master)
src.master:close(usr)
return
//What the fuck is this code Looks to be the parrying code. If you're grabbing someone, it might hit them instead... or something.--SkyMarshal //What the fuck is this code Looks to be the parrying code. If you're grabbing someone, it might hit them instead... or something.--SkyMarshal
/mob/attackby(obj/item/weapon/W as obj, mob/user as mob) /mob/attackby(obj/item/weapon/W as obj, mob/user as mob)

View File

@@ -75,6 +75,7 @@
if (cx > mx) if (cx > mx)
cx = tx cx = tx
cy-- cy--
//Foreach goto(56)
src.closer.screen_loc = text("[],[]", mx, my) src.closer.screen_loc = text("[],[]", mx, my)
return return
@@ -94,7 +95,7 @@
/obj/item/weapon/secstorage/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/item/weapon/secstorage/attackby(obj/item/weapon/W as obj, mob/user as mob)
..() ..()
if ((istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && (src.locked == 1) && (!src.emagged)) if ( (istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && (src.locked == 1) && (!src.emagged))
if(istype(W, /obj/item/weapon/card/emag)) if(istype(W, /obj/item/weapon/card/emag))
var/obj/item/weapon/card/emag/E = W var/obj/item/weapon/card/emag/E = W
if(E.uses) if(E.uses)
@@ -260,7 +261,3 @@
src.orient_objs(7, 8, 10, 7) src.orient_objs(7, 8, 10, 7)
return return
return return
/obj/screen/storage/attackby(W, mob/user as mob)
src.master.attackby(W, user)
return

View File

@@ -244,9 +244,6 @@
O.emp_act(severity) O.emp_act(severity)
..() ..()
/obj/screen/storage/attackby(W, mob/user as mob)
src.master.attackby(W, user)
return
// BubbleWrap - A box can be folded up to make card // BubbleWrap - A box can be folded up to make card
/obj/item/weapon/storage/attack_self(mob/user as mob) /obj/item/weapon/storage/attack_self(mob/user as mob)
if ( contents.len ) if ( contents.len )

View File

@@ -315,6 +315,8 @@
health = 40 health = 40
if(opacity) if(opacity)
icon_state = "twindow" icon_state = "twindow"
else
icon_state = "window"
update_nearby_tiles(need_rebuild=1) update_nearby_tiles(need_rebuild=1)
relativewindow() relativewindow()

View File

@@ -11,6 +11,11 @@
name = "close" name = "close"
master = null master = null
/obj/screen/close/DblClick()
if (src.master)
src.master:close(usr)
return
/obj/screen/grab /obj/screen/grab
name = "grab" name = "grab"
master = null master = null
@@ -19,6 +24,10 @@
name = "storage" name = "storage"
master = null master = null
/obj/screen/storage/attackby(W, mob/user as mob)
src.master.attackby(W, user)
return
/obj/screen/zone_sel /obj/screen/zone_sel
name = "Damage Zone" name = "Damage Zone"
icon = 'zone_sel.dmi' icon = 'zone_sel.dmi'