mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
- Moved passability flags from atom/var/flags to atom/var/pass_flags.
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
This commit is contained in:
@@ -93,6 +93,12 @@ datum
|
||||
return total_moles()*R_IDEAL_GAS_EQUATION*temperature/volume
|
||||
return 0
|
||||
|
||||
return_temperature()
|
||||
return temperature
|
||||
|
||||
return_volume()
|
||||
return max(0, volume)
|
||||
|
||||
thermal_energy()
|
||||
return temperature*heat_capacity()
|
||||
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
icon_state = "full"
|
||||
density = 0
|
||||
mouse_opacity = 0
|
||||
|
||||
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
|
||||
flags = TABLEPASS
|
||||
|
||||
var/wavelength // the (vaccuum) wavelength of the beam
|
||||
var/width = 1 // 1=thin, 2=medium, 3=wide
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
if(istype(used_atom, text2path(L["key"])))
|
||||
if(custom_action(i, used_atom, user))
|
||||
steps[i]=null;//stupid byond list from list removal...
|
||||
clear_nulls(steps);
|
||||
listclearnulls(steps);
|
||||
if(!steps.len)
|
||||
spawn_result()
|
||||
return 1
|
||||
@@ -64,11 +64,6 @@
|
||||
del holder
|
||||
return
|
||||
|
||||
proc/clear_nulls(list/L)
|
||||
while(null in L)
|
||||
L -= null
|
||||
return
|
||||
|
||||
proc/set_desc(index as num)
|
||||
var/list/step = steps[index]
|
||||
holder.desc = step["desc"]
|
||||
|
||||
@@ -71,8 +71,7 @@ Data storage vars:
|
||||
while(src && control_switch)
|
||||
last_exec = world.timeofday
|
||||
if(check_for_null && has_null_args())
|
||||
spawn(-1) //don't wait for state_check() in stop()
|
||||
stop()
|
||||
stop()
|
||||
return 0
|
||||
result = process(arglist(arg_list))
|
||||
for(var/sleep_time=delay;sleep_time>0;sleep_time--) //uhh, this is ugly. But I see no other way to terminate sleeping proc. Such disgrace.
|
||||
@@ -98,10 +97,8 @@ Data storage vars:
|
||||
if(!active())
|
||||
return
|
||||
control_switch = 0
|
||||
/* //always fails if called inside process()
|
||||
if(!state_check())
|
||||
return
|
||||
*/
|
||||
spawn(-1) //report termination error but don't wait for state_check().
|
||||
state_check()
|
||||
return 1
|
||||
|
||||
proc/state_check()
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
var/blood_DNA = null
|
||||
var/blood_type = null
|
||||
var/last_bumped = 0
|
||||
var/pass_flags = 0
|
||||
|
||||
///Chemistry.
|
||||
var/datum/reagents/reagents = null
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
name = "beam"
|
||||
unacidable = 1//Just to be sure.
|
||||
var/def_zone
|
||||
pass_flags = PASSTABLE
|
||||
|
||||
/obj/beam/i_beam
|
||||
name = "i beam"
|
||||
@@ -304,6 +305,7 @@
|
||||
var/force_unwielded = 0
|
||||
var/force_wielded = 0
|
||||
flags = FPRINT | TABLEPASS
|
||||
pass_flags = PASSTABLE
|
||||
pressure_resistance = 50
|
||||
var/obj/item/master = null
|
||||
|
||||
|
||||
@@ -117,47 +117,32 @@
|
||||
K += item
|
||||
return K
|
||||
|
||||
/proc/sanitize(var/t)
|
||||
var/index = findtext(t, "\n")
|
||||
while(index)
|
||||
t = copytext(t, 1, index) + "#" + copytext(t, index+1)
|
||||
index = findtext(t, "\n")
|
||||
/proc/sanitize_simple(var/t,var/list/repl_chars = list("\n"="#","\t"="#","<22>"="<22>"))
|
||||
for(var/char in repl_chars)
|
||||
var/index = findtext(t, char)
|
||||
while(index)
|
||||
t = copytext(t, 1, index) + repl_chars[char] + copytext(t, index+1)
|
||||
index = findtext(t, char)
|
||||
return t
|
||||
|
||||
index = findtext(t, "\t")
|
||||
while(index)
|
||||
t = copytext(t, 1, index) + "#" + copytext(t, index+1)
|
||||
index = findtext(t, "\t")
|
||||
/proc/strip_html_simple(var/t,var/limit=MAX_MESSAGE_LEN)
|
||||
var/list/strip_chars = list("<",">")
|
||||
t = copytext(t,1,limit)
|
||||
for(var/char in strip_chars)
|
||||
var/index = findtext(t, char)
|
||||
while(index)
|
||||
t = copytext(t, 1, index) + copytext(t, index+1)
|
||||
index = findtext(t, char)
|
||||
return t
|
||||
|
||||
index = findtext(t, "<22>")
|
||||
while(index)
|
||||
t = copytext(t, 1, index) + "<22>" + copytext(t, index+1)
|
||||
index = findtext(t, "<22>")
|
||||
|
||||
return html_encode(t)
|
||||
/proc/sanitize(var/t,var/list/repl_chars = null)
|
||||
return html_encode(sanitize_simple(t,repl_chars))
|
||||
|
||||
/proc/strip_html(var/t,var/limit=MAX_MESSAGE_LEN)
|
||||
t = copytext(t,1,limit)
|
||||
var/index = findtext(t, "<")
|
||||
while(index)
|
||||
t = copytext(t, 1, index) + copytext(t, index+1)
|
||||
index = findtext(t, "<")
|
||||
index = findtext(t, ">")
|
||||
while(index)
|
||||
t = copytext(t, 1, index) + copytext(t, index+1)
|
||||
index = findtext(t, ">")
|
||||
return sanitize(t)
|
||||
return sanitize(strip_html_simple(t))
|
||||
|
||||
/proc/adminscrub(var/t,var/limit=MAX_MESSAGE_LEN)
|
||||
t = copytext(t,1,limit)
|
||||
var/index = findtext(t, "<")
|
||||
while(index)
|
||||
t = copytext(t, 1, index) + copytext(t, index+1)
|
||||
index = findtext(t, "<")
|
||||
index = findtext(t, ">")
|
||||
while(index)
|
||||
t = copytext(t, 1, index) + copytext(t, index+1)
|
||||
index = findtext(t, ">")
|
||||
return html_encode(t)
|
||||
return html_encode(strip_html_simple(t))
|
||||
|
||||
/proc/add_zero(t, u)
|
||||
while (length(t) < u)
|
||||
@@ -310,6 +295,57 @@
|
||||
count++
|
||||
return newText
|
||||
|
||||
//slower then dd_list2text, but correctly processes associative lists.
|
||||
proc/tg_list2text(list/list, glue=",")
|
||||
if(!istype(list) || !list.len)
|
||||
return
|
||||
var/output
|
||||
for(var/i=1 to list.len)
|
||||
output += (i!=1? glue : null)+(!isnull(list["[list[i]]"])?"[list["[list[i]]"]]":"[list[i]]")
|
||||
return output
|
||||
|
||||
|
||||
//tg_text2list is faster then dd_text2list
|
||||
//not case sensitive version
|
||||
proc/tg_text2list(string, separator=",")
|
||||
if(!string)
|
||||
return
|
||||
var/list/output = new
|
||||
var/seplength = length(separator)
|
||||
var/strlength = length(string)
|
||||
var/prev = 1
|
||||
var/index
|
||||
do
|
||||
index = findtext(string, separator, prev, 0)
|
||||
output += copytext(string, prev, index)
|
||||
if(!index)
|
||||
break
|
||||
prev = index+seplength
|
||||
if(prev>strlength)
|
||||
break
|
||||
while(index)
|
||||
return output
|
||||
|
||||
//case sensitive version
|
||||
proc/tg_extext2list(string, separator=",")
|
||||
if(!string)
|
||||
return
|
||||
var/list/output = new
|
||||
var/seplength = length(separator)
|
||||
var/strlength = length(string)
|
||||
var/prev = 1
|
||||
var/index
|
||||
do
|
||||
index = findtextEx(string, separator, prev, 0)
|
||||
output += copytext(string, prev, index)
|
||||
if(!index)
|
||||
break
|
||||
prev = index+seplength
|
||||
if(prev>strlength)
|
||||
break
|
||||
while(index)
|
||||
return output
|
||||
|
||||
/proc/english_list(var/list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "," )
|
||||
var/total = input.len
|
||||
if (!total)
|
||||
@@ -1021,7 +1057,7 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
|
||||
proc/listgetindex(var/list/list,index)
|
||||
if(istype(list) && list.len)
|
||||
if(isnum(index))
|
||||
if(index>0 && index<=list.len)
|
||||
if(InRange(index,1,list.len))
|
||||
return list[index]
|
||||
else if(index in list)
|
||||
return list[index]
|
||||
@@ -1042,6 +1078,12 @@ proc/clearlist(list/list)
|
||||
list.len = 0
|
||||
return
|
||||
|
||||
proc/listclearnulls(list/list)
|
||||
if(istype(list))
|
||||
while(null in list)
|
||||
list -= null
|
||||
return
|
||||
|
||||
/atom/proc/GetAllContents(searchDepth = 5)
|
||||
var/list/toReturn = list()
|
||||
|
||||
@@ -1050,4 +1092,48 @@ proc/clearlist(list/list)
|
||||
if(part.contents.len && searchDepth)
|
||||
toReturn += part.GetAllContents(searchDepth - 1)
|
||||
|
||||
return toReturn
|
||||
return toReturn
|
||||
|
||||
|
||||
//WIP
|
||||
|
||||
/*
|
||||
* Returns list containing all the entries present in both lists
|
||||
* If either of arguments is not a list, returns null
|
||||
*/
|
||||
/proc/intersectlist(var/list/first, var/list/second)
|
||||
if(!islist(first) || !islist(second))
|
||||
return
|
||||
return first & second
|
||||
|
||||
/*
|
||||
* Returns list containing all the entries from first list that are not present in second.
|
||||
* If skiprep = 1, repeated elements are treated as one.
|
||||
* If either of arguments is not a list, returns null
|
||||
*/
|
||||
/proc/difflist(var/list/first, var/list/second, var/skiprep=0)
|
||||
if(!islist(first) || !islist(second))
|
||||
return
|
||||
var/list/result = new
|
||||
if(skiprep)
|
||||
for(var/e in first)
|
||||
if(!(e in result) && !(e in second))
|
||||
result += e
|
||||
else
|
||||
result = first - second
|
||||
return result
|
||||
|
||||
/*
|
||||
* Returns list containing entries that are in either list but not both.
|
||||
* If skipref = 1, repeated elements are treated as one.
|
||||
* If either of arguments is not a list, returns null
|
||||
*/
|
||||
/proc/uniquemergelist(var/list/first, var/list/second, var/skiprep=0)
|
||||
if(!islist(first) || !islist(second))
|
||||
return
|
||||
var/list/result = new
|
||||
if(skiprep)
|
||||
result = difflist(first, second, skiprep)+difflist(second, first, skiprep)
|
||||
else
|
||||
result = first ^ second
|
||||
return result
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
proc/spawn_asteroid(var/atom/start_loc,var/type,var/size,var/richness)//type: 0 or null - random, 1 - nothing, 2 - iron, 3 - silicon
|
||||
proc/spawn_asteroid(var/turf/start_loc,var/type,var/size,var/richness)//type: 0 or null - random, 1 - nothing, 2 - iron, 3 - silicon
|
||||
if(!size)
|
||||
size = pick(100;2,50;3,35;4,25;6,10;12)
|
||||
if(start_loc.x - size < 5 || start_loc.x + size >= world.maxx - 5 || start_loc.y - size < 5 || start_loc.y + size > world.maxy -5)
|
||||
@@ -9,6 +9,8 @@ proc/spawn_asteroid(var/atom/start_loc,var/type,var/size,var/richness)//type: 0
|
||||
richness = rand(10,40)
|
||||
// world << "Asteroid size: [size]; Asteroid type: [type]"
|
||||
var/list/turfs = circlerangeturfs(start_loc,size)
|
||||
if(!islist(turfs) || isemptylist(turfs))
|
||||
return 0
|
||||
var/area/asteroid/AstAr = new
|
||||
AstAr.name = "Asteroid #[start_loc.x][start_loc.y][start_loc.z]"
|
||||
for(var/turf/T in turfs)
|
||||
@@ -45,7 +47,7 @@ proc/spawn_asteroid(var/atom/start_loc,var/type,var/size,var/richness)//type: 0
|
||||
var/y = rand(1,world.maxy)
|
||||
// world << "Asteroid coords: [x], [y], [z]"
|
||||
var/start_loc = locate(x,y,z)
|
||||
if(spawn_asteroid(start_loc))
|
||||
if(start_loc && spawn_asteroid(start_loc))
|
||||
density--
|
||||
return
|
||||
|
||||
|
||||
@@ -404,7 +404,7 @@
|
||||
|
||||
|
||||
/atom/proc/get_global_map_pos()
|
||||
if(!global_map.len) return
|
||||
if(!islist(global_map) || isemptylist(global_map)) return
|
||||
var/cur_x = null
|
||||
var/cur_y = null
|
||||
var/list/y_arr = null
|
||||
@@ -417,4 +417,7 @@
|
||||
if(cur_x && cur_y)
|
||||
return list("x"=cur_x,"y"=cur_y)
|
||||
else
|
||||
return 0
|
||||
return 0
|
||||
|
||||
/atom/proc/checkpass(passflag)
|
||||
return pass_flags&passflag
|
||||
@@ -88,10 +88,12 @@
|
||||
anchored = 1.0
|
||||
var/hits = 1
|
||||
var/dest
|
||||
pass_flags = PASSTABLE
|
||||
|
||||
/obj/meteor/small
|
||||
name = "small meteor"
|
||||
icon_state = "smallf"
|
||||
pass_flags = PASSTABLE | PASSGRILLE
|
||||
|
||||
/obj/meteor/Move()
|
||||
var/turf/T = src.loc
|
||||
|
||||
@@ -63,13 +63,7 @@
|
||||
|
||||
|
||||
/obj/machinery/optable/CanPass(atom/movable/O as mob|obj, target as turf)
|
||||
if(!O)
|
||||
return 0
|
||||
if ((O.flags & 2 || istype(O, /obj/meteor)))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
return
|
||||
return (istype(O) && O.checkpass(PASSTABLE))
|
||||
|
||||
/obj/machinery/optable/MouseDrop_T(obj/O as obj, mob/user as mob)
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ for reference:
|
||||
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)//So bullets will fly over and stuff.
|
||||
if(air_group || (height==0))
|
||||
return 1
|
||||
if (mover.flags & 2)
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
@@ -269,7 +269,7 @@ These should not block bullets/N */
|
||||
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)//So bullets will fly over and stuff.
|
||||
if(air_group || (height==0))
|
||||
return 1
|
||||
if (mover.flags & 2)
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
/obj/machinery/door/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group) return 0
|
||||
if(istype(mover, /obj/beam))
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
return !opacity
|
||||
return !density
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
return
|
||||
|
||||
/obj/machinery/door/window/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(istype(mover, /obj/beam))
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
return 1
|
||||
if(get_dir(loc, target) == dir) //Make sure looking at appropriate border
|
||||
if(air_group) return 0
|
||||
@@ -68,7 +68,7 @@
|
||||
return 1
|
||||
|
||||
/obj/machinery/door/window/CheckExit(atom/movable/mover as mob|obj, turf/target as turf)
|
||||
if(istype(mover, /obj/beam))
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
return 1
|
||||
if(get_dir(loc, target) == dir)
|
||||
return !density
|
||||
|
||||
@@ -526,7 +526,7 @@
|
||||
/obj/machinery/shieldwall/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
|
||||
if ((istype(mover, /obj/item/weapon/dummy) || istype(mover, /obj/beam)))
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
return prob(20)
|
||||
else
|
||||
if (istype(mover, /obj/item/projectile))
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
var/overload = 0
|
||||
wreckage = "/obj/decal/mecha_wreckage/gygax"
|
||||
internal_damage_threshold = 35
|
||||
max_equip = 3
|
||||
max_equip = 4
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -11,10 +11,12 @@
|
||||
operation_req_access = list(access_clown)
|
||||
add_req_access = 0
|
||||
max_equip = 3
|
||||
var/squeak = 0
|
||||
|
||||
/*
|
||||
/obj/mecha/combat/honker/New()
|
||||
..()
|
||||
/*
|
||||
|
||||
weapons += new /datum/mecha_weapon/honker(src)
|
||||
weapons += new /datum/mecha_weapon/missile_rack/banana_mortar(src)
|
||||
weapons += new /datum/mecha_weapon/missile_rack/mousetrap_mortar(src)
|
||||
@@ -38,6 +40,7 @@
|
||||
[internal_damage&MECHA_INT_CONTROL_LOST?"<font color='red'><b>HONK-A-DOODLE</b></font> - <a href='?src=\ref[src];repair_int_control_lost=1'>Recalibrate</a><br>":null]
|
||||
<b>IntegriHONK: </b> [health/initial(health)*100] %) <br>
|
||||
<b>PowerHONK charge: </b>[isnull(cell_charge)?"Someone HONKed powerHonk!!!":"[cell.percent()]%"])<br>
|
||||
<b>Air source: </b>[use_internal_tank?"Internal AirHONK":"EnvironHONK"]<br>
|
||||
<b>AirHONK pressure: </b>[src.return_pressure()]HoNKs<br>
|
||||
<b>Internal HONKature: </b> [src.return_temperature()]°honK|[src.return_temperature() - T0C]°honCk<br>
|
||||
<b>Lights: </b>[lights?"on":"off"]<br>
|
||||
@@ -120,9 +123,13 @@
|
||||
|
||||
|
||||
/obj/mecha/combat/honker/relaymove(mob/user,direction)
|
||||
var/result = ..(user,direction)
|
||||
var/result = ..()
|
||||
if(result)
|
||||
playsound(src, "clownstep", 70, 1)
|
||||
if(!squeak)
|
||||
playsound(src, "clownstep", 70, 1)
|
||||
squeak = 1
|
||||
else
|
||||
squeak = 0
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster,
|
||||
/obj/item/mecha_parts/mecha_equipment/repair_droid,
|
||||
/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay
|
||||
),
|
||||
),
|
||||
|
||||
"Misc"=list(/obj/item/mecha_tracking)
|
||||
|
||||
@@ -105,10 +105,12 @@
|
||||
for(var/part_set in part_sets)
|
||||
convert_part_set(part_set)
|
||||
files = new /datum/research(src) //Setup the research data holder.
|
||||
/*
|
||||
if(!id)
|
||||
for(var/obj/machinery/r_n_d/server/centcom/S in world)
|
||||
S.initialize()
|
||||
break
|
||||
*/
|
||||
return
|
||||
|
||||
Del()
|
||||
@@ -251,8 +253,9 @@
|
||||
proc/add_part_set_to_queue(set_name)
|
||||
if(set_name in part_sets)
|
||||
var/list/part_set = part_sets[set_name]
|
||||
for(var/part in part_set)
|
||||
add_to_queue(part)
|
||||
if(islist(part_set))
|
||||
for(var/part in part_set)
|
||||
add_to_queue(part)
|
||||
return
|
||||
|
||||
proc/add_to_queue(part)
|
||||
@@ -332,7 +335,7 @@
|
||||
if(!silent)
|
||||
temp = "Updating local R&D database..."
|
||||
src.updateUsrDialog()
|
||||
sleep(30)
|
||||
sleep(30) //only sleep if called by user
|
||||
for(var/obj/machinery/computer/rdconsole/RDC in get_area(src))
|
||||
if(!RDC.sync)
|
||||
continue
|
||||
@@ -448,9 +451,10 @@
|
||||
if(href_list["process_queue"])
|
||||
if(processing_queue || being_built)
|
||||
return 0
|
||||
processing_queue = 1
|
||||
process_queue()
|
||||
processing_queue = 0
|
||||
spawn(-1) //don't wait for process_queue() to finish
|
||||
processing_queue = 1
|
||||
process_queue()
|
||||
processing_queue = 0
|
||||
/*
|
||||
if(href_list["list_queue"])
|
||||
list_queue()
|
||||
@@ -463,7 +467,7 @@
|
||||
var/index = text2num(href_list["index"])
|
||||
var/new_index = index + text2num(href_list["queue_move"])
|
||||
if(isnum(index) && isnum(new_index))
|
||||
if(new_index>0&&new_index<=queue.len)
|
||||
if(InRange(new_index,1,queue.len))
|
||||
queue.Swap(index,new_index)
|
||||
return update_queue_on_page()
|
||||
if(href_list["clear_queue"])
|
||||
@@ -487,7 +491,8 @@
|
||||
if (stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(sync)
|
||||
src.sync(1)
|
||||
spawn(-1)
|
||||
sync(1)
|
||||
return
|
||||
|
||||
attackby(obj/item/stack/sheet/W as obj, mob/user as mob)
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
var/list/equipment = new
|
||||
var/obj/item/mecha_parts/mecha_equipment/selected
|
||||
var/max_equip = 2
|
||||
var/max_equip = 3
|
||||
|
||||
/obj/mecha/New()
|
||||
..()
|
||||
@@ -418,31 +418,33 @@
|
||||
|
||||
/obj/mecha/proc/destroy()
|
||||
spawn()
|
||||
go_out()
|
||||
var/turf/T = get_turf(src)
|
||||
tag = "\ref[src]" //better safe then sorry
|
||||
loc.Exited(src)
|
||||
loc = null
|
||||
if(prob(40))
|
||||
explosion(T, 0, 0, 1, 3)
|
||||
if(wreckage)
|
||||
var/obj/decal/mecha_wreckage/WR = new wreckage(T)
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/E in equipment)
|
||||
if(prob(30))
|
||||
WR.crowbar_salvage += E
|
||||
E.loc = WR
|
||||
E.equip_ready = 1
|
||||
E.reliability = rand(30,100)
|
||||
else
|
||||
E.loc = T
|
||||
E.destroy()
|
||||
if(cell)
|
||||
WR.crowbar_salvage += cell
|
||||
cell.loc = WR
|
||||
cell.charge = rand(0, cell.charge)
|
||||
if(internal_tank)
|
||||
WR.crowbar_salvage += internal_tank
|
||||
internal_tank.loc = WR
|
||||
del(src)
|
||||
if(T)
|
||||
if(prob(40))
|
||||
explosion(T, 0, 0, 1, 3)
|
||||
if(wreckage)
|
||||
var/obj/decal/mecha_wreckage/WR = new wreckage(T)
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/E in equipment)
|
||||
if(prob(30))
|
||||
WR.crowbar_salvage += E
|
||||
E.loc = WR
|
||||
E.equip_ready = 1
|
||||
E.reliability = rand(30,100)
|
||||
else
|
||||
E.loc = T
|
||||
E.destroy()
|
||||
if(cell)
|
||||
WR.crowbar_salvage += cell
|
||||
cell.loc = WR
|
||||
cell.charge = rand(0, cell.charge)
|
||||
if(internal_tank)
|
||||
WR.crowbar_salvage += internal_tank
|
||||
internal_tank.loc = WR
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/mecha/ex_act(severity)
|
||||
@@ -1161,7 +1163,7 @@
|
||||
onclose(occupant, "exosuit_log")
|
||||
return
|
||||
if (href_list["change_name"])
|
||||
name = input(occupant,"Choose new exosuit name","Rename exosuit",initial(name))
|
||||
name = strip_html_simple(input(occupant,"Choose new exosuit name","Rename exosuit",initial(name)))
|
||||
return
|
||||
if (href_list["repair_int_control_lost"])
|
||||
src.occupant_message("Recalibrating coordination system.")
|
||||
@@ -1362,5 +1364,8 @@
|
||||
if(mecha.internal_damage & MECHA_INT_TANK_BREACH) //remove some air from internal tank
|
||||
if(int_tank_air)
|
||||
var/datum/gas_mixture/leaked_gas = int_tank_air.remove_ratio(0.25)
|
||||
mecha.loc.assume_air(leaked_gas)
|
||||
if(mecha.loc && hascall(mecha.loc,"assume_air"))
|
||||
mecha.loc.assume_air(leaked_gas)
|
||||
else
|
||||
del(leaked_gas)
|
||||
return
|
||||
|
||||
@@ -75,8 +75,7 @@
|
||||
|
||||
/obj/grille/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
|
||||
if ((istype(mover, /obj/effects) || istype(mover, /obj/item/weapon/dummy) || istype(mover, /obj/beam) || istype(mover, /obj/meteor/small)))
|
||||
if(istype(mover) && mover.checkpass(PASSGRILLE))
|
||||
return 1
|
||||
else
|
||||
if (istype(mover, /obj/item/projectile))
|
||||
|
||||
@@ -36,6 +36,7 @@ var/const/PROJECTILE_DART = 8
|
||||
name = "laser"
|
||||
damage_type = PROJECTILE_LASER
|
||||
icon_state = "laser"
|
||||
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
|
||||
|
||||
pulse
|
||||
name = "pulse"
|
||||
|
||||
@@ -94,7 +94,7 @@ TABLE AND RACK OBJECT INTERATIONS
|
||||
/obj/table/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
|
||||
if ((mover.flags & 2 || istype(mover, /obj/meteor)) )
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
@@ -293,8 +293,7 @@ TABLE AND RACK OBJECT INTERATIONS
|
||||
|
||||
/obj/rack/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
|
||||
if (mover.flags & 2)
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -43,20 +43,19 @@
|
||||
del(src)
|
||||
|
||||
/obj/window/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(istype(mover, /obj/beam) || istype(mover, /obj/item/projectile/beam))
|
||||
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, /obj/beam) || istype(O, /obj/item/projectile/beam))
|
||||
if(istype(O) && O.checkpass(PASSGLASS))
|
||||
return 1
|
||||
if (get_dir(O.loc, target) == src.dir)
|
||||
if (get_dir(O.loc, target) == dir)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
@@ -45,7 +45,9 @@ var/ordernum=0
|
||||
layer = 4
|
||||
|
||||
/obj/plasticflaps/CanPass(atom/A, turf/T)
|
||||
if (istype(A, /mob/living)) // You Shall Not Pass!
|
||||
if(istype(A) && A.checkpass(PASSGLASS))
|
||||
return prob(60)
|
||||
else if(istype(A, /mob/living)) // You Shall Not Pass!
|
||||
var/mob/living/M = A
|
||||
if(!M.lying) // unless you're lying down
|
||||
return 0
|
||||
|
||||
@@ -113,6 +113,11 @@
|
||||
|
||||
#define NOREACT 16384 //Reagents dont' react inside this container.
|
||||
|
||||
//flags for pass_flags
|
||||
#define PASSTABLE 1
|
||||
#define PASSGLASS 2
|
||||
#define PASSGRILLE 4
|
||||
|
||||
|
||||
// bitflags for clothing parts
|
||||
#define HEAD 1
|
||||
|
||||
Reference in New Issue
Block a user