mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
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:
@@ -117,6 +117,49 @@
|
||||
for(var/mob/O in oviewers())
|
||||
O << text("\red [user] [src.anchored ? "fastens" : "unfastens"] the grille.")
|
||||
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))
|
||||
src.health -= W.force * 0.1
|
||||
else if(!shock(user, 70))
|
||||
|
||||
@@ -253,11 +253,6 @@
|
||||
del(src)
|
||||
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
|
||||
/mob/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
if (cx > mx)
|
||||
cx = tx
|
||||
cy--
|
||||
//Foreach goto(56)
|
||||
src.closer.screen_loc = text("[],[]", mx, my)
|
||||
return
|
||||
|
||||
@@ -94,7 +95,7 @@
|
||||
|
||||
/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))
|
||||
var/obj/item/weapon/card/emag/E = W
|
||||
if(E.uses)
|
||||
@@ -260,7 +261,3 @@
|
||||
src.orient_objs(7, 8, 10, 7)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/screen/storage/attackby(W, mob/user as mob)
|
||||
src.master.attackby(W, user)
|
||||
return
|
||||
|
||||
@@ -244,9 +244,6 @@
|
||||
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
|
||||
/obj/item/weapon/storage/attack_self(mob/user as mob)
|
||||
if ( contents.len )
|
||||
|
||||
@@ -315,6 +315,8 @@
|
||||
health = 40
|
||||
if(opacity)
|
||||
icon_state = "twindow"
|
||||
else
|
||||
icon_state = "window"
|
||||
|
||||
update_nearby_tiles(need_rebuild=1)
|
||||
relativewindow()
|
||||
|
||||
@@ -11,6 +11,11 @@
|
||||
name = "close"
|
||||
master = null
|
||||
|
||||
/obj/screen/close/DblClick()
|
||||
if (src.master)
|
||||
src.master:close(usr)
|
||||
return
|
||||
|
||||
/obj/screen/grab
|
||||
name = "grab"
|
||||
master = null
|
||||
@@ -19,6 +24,10 @@
|
||||
name = "storage"
|
||||
master = null
|
||||
|
||||
/obj/screen/storage/attackby(W, mob/user as mob)
|
||||
src.master.attackby(W, user)
|
||||
return
|
||||
|
||||
/obj/screen/zone_sel
|
||||
name = "Damage Zone"
|
||||
icon = 'zone_sel.dmi'
|
||||
|
||||
Reference in New Issue
Block a user