mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Currently there are three - PASSTABLE, PASSGLASS and PASSGRILLE. PASSTABLE - same as TABLEPASS, PASSGRILLE - can this atom pass through grilles and PASSGLASS - can this atom pass through windows, glass doors, etc. Most can_pass() procs were updated. Added checkpass atom proc to check if this atom has certain pass_flag set. - Added proc/sanitize_simple() and proc/strip_html_simple(). sanitize_simple does not html_encode the string and strip_html_simple does not sanitize it. Additionally, sanitize_simple and sanitize can take associative list of key-val chars as second argument, where key is char to searh for and val is replacement. - Added datum/gas_mixture/proc/return_volume() and datum/gas_mixture/proc/return_temperature(). - Added proc/tg_text2list() and proc/tg_list2text(). tg_list2text is slower then dd_list2text, but processes associative lists differently (it adds not the keys, but associated values). tg_text2list is somewhat faster then dd_text2list. - Added proc/listclearnulls(), proc/difflist(), proc/intersectlist() and proc/uniquemergelist(). Check the code comments for more info. - Mechs can hold 3 equipment pieces. Gygax can hold 4. - Tweaked global_iterator CRASH report. - Fixed mech pilot ejection if mecha was destroyed. - Fixed mech fabricator process() waiting for sync() to finish. - Fixed mech fabricator Topic() waiting for process_queue() to finish. - Some bugixes related to global map and random sectors. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1722 316c924e-a436-60f5-8080-3fe189b3f50e
289 lines
7.2 KiB
Plaintext
289 lines
7.2 KiB
Plaintext
/obj/window/bullet_act(flag)
|
|
if (flag == PROJECTILE_BULLET)
|
|
if(!reinf)
|
|
new /obj/item/weapon/shard( src.loc )
|
|
//SN src = null
|
|
src.density = 0
|
|
|
|
del(src)
|
|
else
|
|
health -= 35
|
|
if(health <=0)
|
|
new /obj/item/weapon/shard( src.loc )
|
|
new /obj/item/stack/rods( src.loc )
|
|
src.density = 0
|
|
del(src)
|
|
|
|
return
|
|
return
|
|
|
|
/obj/window/ex_act(severity)
|
|
switch(severity)
|
|
if(1.0)
|
|
del(src)
|
|
return
|
|
if(2.0)
|
|
new /obj/item/weapon/shard( src.loc )
|
|
if(reinf) new /obj/item/stack/rods( src.loc)
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
if(3.0)
|
|
if (prob(50))
|
|
new /obj/item/weapon/shard( src.loc )
|
|
if(reinf) new /obj/item/stack/rods( src.loc)
|
|
|
|
del(src)
|
|
return
|
|
return
|
|
|
|
/obj/window/blob_act()
|
|
if(reinf) new /obj/item/stack/rods( src.loc)
|
|
density = 0
|
|
del(src)
|
|
|
|
/obj/window/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
|
if(istype(mover) && mover.checkpass(PASSGLASS))
|
|
return 1
|
|
if (src.dir == SOUTHWEST || src.dir == SOUTHEAST || src.dir == NORTHWEST || src.dir == NORTHEAST)
|
|
return 0 //full tile window, you can't move into it!
|
|
if(get_dir(loc, target) == dir)
|
|
return !density
|
|
else
|
|
return 1
|
|
|
|
/obj/window/CheckExit(atom/movable/O as mob|obj, target as turf)
|
|
if(istype(O) && O.checkpass(PASSGLASS))
|
|
return 1
|
|
if (get_dir(O.loc, target) == dir)
|
|
return 0
|
|
return 1
|
|
|
|
/obj/window/meteorhit()
|
|
|
|
//*****RM
|
|
//world << "glass at [x],[y],[z] Mhit"
|
|
src.health = 0
|
|
new /obj/item/weapon/shard( src.loc )
|
|
if(reinf) new /obj/item/stack/rods( src.loc)
|
|
src.density = 0
|
|
|
|
|
|
del(src)
|
|
return
|
|
|
|
|
|
/obj/window/hitby(AM as mob|obj)
|
|
|
|
..()
|
|
for(var/mob/O in viewers(src, null))
|
|
O.show_message(text("\red <B>[src] was hit by [AM].</B>"), 1)
|
|
var/tforce = 0
|
|
if(ismob(AM))
|
|
tforce = 40
|
|
else
|
|
tforce = AM:throwforce
|
|
if(reinf) tforce /= 4.0
|
|
playsound(src.loc, 'Glasshit.ogg', 100, 1)
|
|
src.health = max(0, src.health - tforce)
|
|
if (src.health <= 7 && !reinf)
|
|
src.anchored = 0
|
|
step(src, get_dir(AM, src))
|
|
if (src.health <= 0)
|
|
new /obj/item/weapon/shard( src.loc )
|
|
if(reinf) new /obj/item/stack/rods( src.loc)
|
|
src.density = 0
|
|
del(src)
|
|
return
|
|
..()
|
|
return
|
|
|
|
/obj/window/attack_hand()
|
|
if ((usr.mutations & HULK))
|
|
usr << text("\blue You smash through the window.")
|
|
for(var/mob/O in oviewers())
|
|
if ((O.client && !( O.blinded )))
|
|
O << text("\red [] smashes through the window!", usr)
|
|
src.health = 0
|
|
new /obj/item/weapon/shard( src.loc )
|
|
if(reinf) new /obj/item/stack/rods( src.loc)
|
|
src.density = 0
|
|
del(src)
|
|
return
|
|
|
|
/obj/window/attack_paw()
|
|
if ((usr.mutations & HULK))
|
|
usr << text("\blue You smash through the window.")
|
|
for(var/mob/O in oviewers())
|
|
if ((O.client && !( O.blinded )))
|
|
O << text("\red [] smashes through the window!", usr)
|
|
src.health = 0
|
|
new /obj/item/weapon/shard( src.loc )
|
|
if(reinf) new /obj/item/stack/rods( src.loc)
|
|
src.density = 0
|
|
del(src)
|
|
return
|
|
|
|
/obj/window/attack_alien()
|
|
if (istype(usr, /mob/living/carbon/alien/larva))//Safety check for larva. /N
|
|
return
|
|
usr << text("\green You smash against the window.")
|
|
for(var/mob/O in oviewers())
|
|
if ((O.client && !( O.blinded )))
|
|
O << text("\red [] smashes against the window.", usr)
|
|
playsound(src.loc, 'Glasshit.ogg', 100, 1)
|
|
src.health -= 15
|
|
if(src.health <= 0)
|
|
usr << text("\green You smash through the window.")
|
|
for(var/mob/O in oviewers())
|
|
if ((O.client && !( O.blinded )))
|
|
O << text("\red [] smashes through the window!", usr)
|
|
src.health = 0
|
|
new /obj/item/weapon/shard(src.loc)
|
|
if(reinf)
|
|
new /obj/item/stack/rods(src.loc)
|
|
src.density = 0
|
|
del(src)
|
|
return
|
|
return
|
|
|
|
/obj/window/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
if (istype(W, /obj/item/weapon/screwdriver))
|
|
if(reinf && state >= 1)
|
|
state = 3 - state
|
|
playsound(src.loc, 'Screwdriver.ogg', 75, 1)
|
|
usr << ( state==1? "You have unfastened the window from the frame." : "You have fastened the window to the frame." )
|
|
else if(reinf && state == 0)
|
|
anchored = !anchored
|
|
playsound(src.loc, 'Screwdriver.ogg', 75, 1)
|
|
user << (src.anchored ? "You have fastened the frame to the floor." : "You have unfastened the frame from the floor.")
|
|
else if(!reinf)
|
|
src.anchored = !( src.anchored )
|
|
playsound(src.loc, 'Screwdriver.ogg', 75, 1)
|
|
user << (src.anchored ? "You have fastened the window to the floor." : "You have unfastened the window.")
|
|
else if(istype(W, /obj/item/weapon/crowbar) && reinf)
|
|
if(state <=1)
|
|
state = 1-state;
|
|
playsound(src.loc, 'Crowbar.ogg', 75, 1)
|
|
user << (state ? "You have pried the window into the frame." : "You have pried the window out of the frame.")
|
|
else
|
|
var/aforce = W.force
|
|
if(reinf) aforce /= 2.0
|
|
src.health = max(0, src.health - aforce)
|
|
playsound(src.loc, 'Glasshit.ogg', 75, 1)
|
|
if (src.health <= 7)
|
|
src.anchored = 0
|
|
step(src, get_dir(user, src))
|
|
if (src.health <= 0)
|
|
if (src.dir == SOUTHWEST)
|
|
var/index = null
|
|
index = 0
|
|
while(index < 2)
|
|
new /obj/item/weapon/shard( src.loc )
|
|
if(reinf) new /obj/item/stack/rods( src.loc)
|
|
index++
|
|
else
|
|
new /obj/item/weapon/shard( src.loc )
|
|
if(reinf) new /obj/item/stack/rods( src.loc)
|
|
src.density = 0
|
|
del(src)
|
|
return
|
|
..()
|
|
return
|
|
|
|
|
|
/obj/window/verb/rotate()
|
|
set name = "Rotate Window Counter-Clockwise"
|
|
set category = "Object"
|
|
set src in oview(1)
|
|
|
|
if (src.anchored)
|
|
usr << "It is fastened to the floor; therefore, you can't rotate it!"
|
|
return 0
|
|
|
|
update_nearby_tiles(need_rebuild=1) //Compel updates before
|
|
|
|
src.dir = turn(src.dir, 90)
|
|
|
|
update_nearby_tiles(need_rebuild=1)
|
|
|
|
src.ini_dir = src.dir
|
|
return
|
|
|
|
/obj/window/verb/revrotate()
|
|
set name = "Rotate Window Clockwise"
|
|
set category = "Object"
|
|
set src in oview(1)
|
|
|
|
if (src.anchored)
|
|
usr << "It is fastened to the floor; therefore, you can't rotate it!"
|
|
return 0
|
|
|
|
update_nearby_tiles(need_rebuild=1) //Compel updates before
|
|
|
|
src.dir = turn(src.dir, 270)
|
|
|
|
update_nearby_tiles(need_rebuild=1)
|
|
|
|
src.ini_dir = src.dir
|
|
return
|
|
|
|
/obj/window/New(Loc,re=0)
|
|
..()
|
|
|
|
if(re) reinf = re
|
|
|
|
src.ini_dir = src.dir
|
|
if(reinf)
|
|
icon_state = "rwindow"
|
|
desc = "A reinforced window."
|
|
name = "reinforced window"
|
|
state = 2*anchored
|
|
health = 40
|
|
if(opacity)
|
|
icon_state = "twindow"
|
|
|
|
update_nearby_tiles(need_rebuild=1)
|
|
|
|
return
|
|
|
|
/obj/window/Del()
|
|
density = 0
|
|
|
|
update_nearby_tiles()
|
|
|
|
playsound(src, "shatter", 70, 1)
|
|
..()
|
|
|
|
/obj/window/Move()
|
|
update_nearby_tiles(need_rebuild=1)
|
|
|
|
..()
|
|
|
|
src.dir = src.ini_dir
|
|
update_nearby_tiles(need_rebuild=1)
|
|
|
|
return
|
|
|
|
/obj/window/proc/update_nearby_tiles(need_rebuild)
|
|
if(!air_master) return 0
|
|
|
|
var/turf/simulated/source = loc
|
|
var/turf/simulated/target = get_step(source,dir)
|
|
|
|
if(need_rebuild)
|
|
if(istype(source)) //Rebuild/update nearby group geometry
|
|
if(source.parent)
|
|
air_master.groups_to_rebuild += source.parent
|
|
else
|
|
air_master.tiles_to_update += source
|
|
if(istype(target))
|
|
if(target.parent)
|
|
air_master.groups_to_rebuild += target.parent
|
|
else
|
|
air_master.tiles_to_update += target
|
|
else
|
|
if(istype(source)) air_master.tiles_to_update += source
|
|
if(istype(target)) air_master.tiles_to_update += target
|
|
|
|
return 1 |