mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Fixed a few runtimes
Blob mode updated slightly Wizard smoke from his smoke spell will partly block lasers that go through it. Going to try and test a diff way for the singularity to "del" items, might cause less lag, it will also eat absorb other singularities. RD lost tech storage access, see http://nanotrasen.com/phpBB3/viewtopic.php?f=9&t=5991 for details git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2192 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
246
code/WorkInProgress/mapload/dmm_suite.dm
Normal file
246
code/WorkInProgress/mapload/dmm_suite.dm
Normal file
@@ -0,0 +1,246 @@
|
||||
dmm_suite
|
||||
/*
|
||||
|
||||
dmm_suite version 1.0
|
||||
Released January 30th, 2011.
|
||||
|
||||
defines the object /dmm_suite
|
||||
- Provides the proc load_map()
|
||||
- Loads the specified map file onto the specified z-level.
|
||||
- provides the proc write_map()
|
||||
- Returns a text string of the map in dmm format
|
||||
ready for output to a file.
|
||||
- provides the proc save_map()
|
||||
- Returns a .dmm file if map is saved
|
||||
- Returns FALSE if map fails to save
|
||||
|
||||
The dmm_suite provides saving and loading of map files in BYOND's native DMM map
|
||||
format. It approximates the map saving and loading processes of the Dream Maker
|
||||
and Dream Seeker programs so as to allow editing, saving, and loading of maps at
|
||||
runtime.
|
||||
|
||||
------------------------
|
||||
|
||||
To save a map at runtime, create an instance of /dmm_suite, and then call
|
||||
write_map(), which accepts three arguments:
|
||||
- A turf representing one corner of a three dimensional grid (Required).
|
||||
- Another turf representing the other corner of the same grid (Required).
|
||||
- Any, or a combination, of several bit flags (Optional, see documentation).
|
||||
|
||||
The order in which the turfs are supplied does not matter, the /dmm_writer will
|
||||
determine the grid containing both, in much the same way as DM's block() function.
|
||||
write_map() will then return a string representing the saved map in dmm format;
|
||||
this string can then be saved to a file, or used for any other purose.
|
||||
|
||||
------------------------
|
||||
|
||||
To load a map at runtime, create an instance of /dmm_suite, and then call load_map(),
|
||||
which accepts two arguments:
|
||||
- A .dmm file to load (Required).
|
||||
- A number representing the z-level on which to start loading the map (Optional).
|
||||
|
||||
The /dmm_suite will load the map file starting on the specified z-level. If no
|
||||
z-level was specified, world.maxz will be increased so as to fit the map. Note
|
||||
that if you wish to load a map onto a z-level that already has objects on it,
|
||||
you will have to handle the removal of those objects. Otherwise the new map will
|
||||
simply load the new objects on top of the old ones.
|
||||
|
||||
Also note that all type paths specified in the .dmm file must exist in the world's
|
||||
code, and that the /dmm_reader trusts that files to be loaded are in fact valid
|
||||
.dmm files. Errors in the .dmm format will cause runtime errors.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
verb/load_map(var/dmm_file as file, var/z_offset as num)
|
||||
// dmm_file: A .dmm file to load (Required).
|
||||
// z_offset: A number representing the z-level on which to start loading the map (Optional).
|
||||
|
||||
|
||||
verb/write_map(var/turf/t1 as turf, var/turf/t2 as turf, var/flags as num)
|
||||
// t1: A turf representing one corner of a three dimensional grid (Required).
|
||||
// t2: Another turf representing the other corner of the same grid (Required).
|
||||
// flags: Any, or a combination, of several bit flags (Optional, see documentation).
|
||||
|
||||
// save_map is included as a legacy proc. Use write_map instead.
|
||||
verb/save_map(var/turf/t1 as turf, var/turf/t2 as turf, var/map_name as text, var/flags as num)
|
||||
// t1: A turf representing one corner of a three dimensional grid (Required).
|
||||
// t2: Another turf representing the other corner of the same grid (Required).
|
||||
// map_name: A valid name for the map to be saved, such as "castle" (Required).
|
||||
// flags: Any, or a combination, of several bit flags (Optional, see documentation).
|
||||
|
||||
|
||||
#define DMM_IGNORE_AREAS 1
|
||||
#define DMM_IGNORE_TURFS 2
|
||||
#define DMM_IGNORE_OBJS 4
|
||||
#define DMM_IGNORE_NPCS 8
|
||||
#define DMM_IGNORE_PLAYERS 16
|
||||
#define DMM_IGNORE_MOBS 24
|
||||
dmm_suite{
|
||||
var{
|
||||
quote = "\""
|
||||
list/letter_digits = list(
|
||||
"a","b","c","d","e",
|
||||
"f","g","h","i","j",
|
||||
"k","l","m","n","o",
|
||||
"p","q","r","s","t",
|
||||
"u","v","w","x","y",
|
||||
"z",
|
||||
"A","B","C","D","E",
|
||||
"F","G","H","I","J",
|
||||
"K","L","M","N","O",
|
||||
"P","Q","R","S","T",
|
||||
"U","V","W","X","Y",
|
||||
"Z"
|
||||
)
|
||||
}
|
||||
save_map(var/turf/t1 as turf, var/turf/t2 as turf, var/map_name as text, var/flags as num){
|
||||
//Check for illegal characters in file name... in a cheap way.
|
||||
if(!((ckeyEx(map_name)==map_name) && ckeyEx(map_name))){
|
||||
CRASH("Invalid text supplied to proc save_map, invalid characters or empty string.")
|
||||
}
|
||||
//Check for valid turfs.
|
||||
if(!isturf(t1) || !isturf(t2)){
|
||||
CRASH("Invalid arguments supplied to proc save_map, arguments were not turfs.")
|
||||
}
|
||||
var/file_text = write_map(t1,t2,flags)
|
||||
if(fexists("[map_name].dmm")){
|
||||
fdel("[map_name].dmm")
|
||||
}
|
||||
var/saved_map = file("[map_name].dmm")
|
||||
saved_map << file_text
|
||||
return saved_map
|
||||
}
|
||||
write_map(var/turf/t1 as turf, var/turf/t2 as turf, var/flags as num){
|
||||
//Check for valid turfs.
|
||||
if(!isturf(t1) || !isturf(t2)){
|
||||
CRASH("Invalid arguments supplied to proc write_map, arguments were not turfs.")
|
||||
}
|
||||
var/turf/nw = locate(min(t1.x,t2.x),max(t1.y,t2.y),min(t1.z,t2.z))
|
||||
var/turf/se = locate(max(t1.x,t2.x),min(t1.y,t2.y),max(t1.z,t2.z))
|
||||
var/list/templates[0]
|
||||
var/template_buffer = {""}
|
||||
var/dmm_text = {""}
|
||||
for(var/pos_z=nw.z;pos_z<=se.z;pos_z++){
|
||||
for(var/pos_y=nw.y;pos_y>=se.y;pos_y--){
|
||||
for(var/pos_x=nw.x;pos_x<=se.x;pos_x++){
|
||||
var/turf/test_turf = locate(pos_x,pos_y,pos_z)
|
||||
var/test_template = make_template(test_turf, flags)
|
||||
var/template_number = templates.Find(test_template)
|
||||
if(!template_number){
|
||||
templates.Add(test_template)
|
||||
template_number = templates.len
|
||||
}
|
||||
template_buffer += "[template_number],"
|
||||
}
|
||||
template_buffer += ";"
|
||||
}
|
||||
template_buffer += "."
|
||||
}
|
||||
var/key_length = round/*floor*/(log(letter_digits.len,templates.len-1)+1)
|
||||
var/list/keys[templates.len]
|
||||
for(var/key_pos=1;key_pos<=templates.len;key_pos++){
|
||||
keys[key_pos] = get_model_key(key_pos,key_length)
|
||||
dmm_text += {""[keys[key_pos]]" = ([templates[key_pos]])\n"}
|
||||
}
|
||||
var/z_level = 0
|
||||
for(var/z_pos=1;TRUE;z_pos=findtext(template_buffer,".",z_pos)+1){
|
||||
if(z_pos>=length(template_buffer)){break}
|
||||
if(z_level){dmm_text+={"\n"}}
|
||||
dmm_text += {"\n(1,1,[++z_level]) = {"\n"}
|
||||
var/z_block = copytext(template_buffer,z_pos,findtext(template_buffer,".",z_pos))
|
||||
for(var/y_pos=1;TRUE;y_pos=findtext(z_block,";",y_pos)+1){
|
||||
if(y_pos>=length(z_block)){break}
|
||||
var/y_block = copytext(z_block,y_pos,findtext(z_block,";",y_pos))
|
||||
for(var/x_pos=1;TRUE;x_pos=findtext(y_block,",",x_pos)+1){
|
||||
if(x_pos>=length(y_block)){break}
|
||||
var/x_block = copytext(y_block,x_pos,findtext(y_block,",",x_pos))
|
||||
var/key_number = text2num(x_block)
|
||||
var/temp_key = keys[key_number]
|
||||
dmm_text += temp_key
|
||||
sleep(-1)
|
||||
}
|
||||
dmm_text += {"\n"}
|
||||
sleep(-1)
|
||||
}
|
||||
dmm_text += {"\"}"}
|
||||
sleep(-1)
|
||||
}
|
||||
return dmm_text
|
||||
}
|
||||
proc{
|
||||
make_template(var/turf/model as turf, var/flags as num){
|
||||
var/template = ""
|
||||
var/obj_template = ""
|
||||
var/mob_template = ""
|
||||
var/turf_template = ""
|
||||
if(!(flags & DMM_IGNORE_TURFS)){
|
||||
turf_template = "[model.type][check_attributes(model)],"
|
||||
} else{ turf_template = "[world.turf],"}
|
||||
var/area_template = ""
|
||||
if(!(flags & DMM_IGNORE_OBJS)){
|
||||
for(var/obj/O in model.contents){
|
||||
obj_template += "[O.type][check_attributes(O)],"
|
||||
}
|
||||
}
|
||||
for(var/mob/M in model.contents){
|
||||
if(M.client){
|
||||
if(!(flags & DMM_IGNORE_PLAYERS)){
|
||||
mob_template += "[M.type][check_attributes(M)],"
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(!(flags & DMM_IGNORE_NPCS)){
|
||||
mob_template += "[M.type][check_attributes(M)],"
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!(flags & DMM_IGNORE_AREAS)){
|
||||
var/area/m_area = model.loc
|
||||
area_template = "[m_area.type][check_attributes(m_area)]"
|
||||
} else{ area_template = "[world.area]"}
|
||||
template = "[obj_template][mob_template][turf_template][area_template]"
|
||||
return template
|
||||
}
|
||||
check_attributes(var/atom/A){
|
||||
var/attributes_text = {"{"}
|
||||
for(var/V in A.vars){
|
||||
sleep(-1)
|
||||
if((!issaved(A.vars[V])) || (A.vars[V]==initial(A.vars[V]))){continue}
|
||||
if(istext(A.vars[V])){
|
||||
attributes_text += {"[V] = "[A.vars[V]]""}
|
||||
}
|
||||
else if(isnum(A.vars[V])||ispath(A.vars[V])){
|
||||
attributes_text += {"[V] = [A.vars[V]]"}
|
||||
}
|
||||
else if(isicon(A.vars[V])||isfile(A.vars[V])){
|
||||
attributes_text += {"[V] = '[A.vars[V]]'"}
|
||||
}
|
||||
else{
|
||||
continue
|
||||
}
|
||||
if(attributes_text != {"{"}){
|
||||
attributes_text+={"; "}
|
||||
}
|
||||
}
|
||||
if(attributes_text=={"{"}){
|
||||
return
|
||||
}
|
||||
if(copytext(attributes_text, length(attributes_text)-1, 0) == {"; "}){
|
||||
attributes_text = copytext(attributes_text, 1, length(attributes_text)-1)
|
||||
}
|
||||
attributes_text += {"}"}
|
||||
return attributes_text
|
||||
}
|
||||
get_model_key(var/which as num, var/key_length as num){
|
||||
var/key = ""
|
||||
var/working_digit = which-1
|
||||
for(var/digit_pos=key_length;digit_pos>=1;digit_pos--){
|
||||
var/place_value = round/*floor*/(working_digit/(letter_digits.len**(digit_pos-1)))
|
||||
working_digit-=place_value*(letter_digits.len**(digit_pos-1))
|
||||
key = "[key][letter_digits[place_value+1]]"
|
||||
}
|
||||
return key
|
||||
}
|
||||
}
|
||||
}
|
||||
174
code/WorkInProgress/mapload/reader.dm
Normal file
174
code/WorkInProgress/mapload/reader.dm
Normal file
@@ -0,0 +1,174 @@
|
||||
|
||||
dmm_suite/load_map(var/dmm_file as file, var/z_offset as num)
|
||||
if(!z_offset)
|
||||
z_offset = world.maxz+1
|
||||
var/quote = ascii2text(34)
|
||||
var/tfile = file2text(dmm_file)
|
||||
var/tfile_len = length(tfile)
|
||||
var/list/grid_models[0]
|
||||
var/key_len = length(copytext(tfile,2,findtext(tfile,quote,2,0)))
|
||||
for(var/lpos=1;lpos<tfile_len;lpos=findtext(tfile,"\n",lpos,0)+1)
|
||||
var/tline = copytext(tfile,lpos,findtext(tfile,"\n",lpos,0))
|
||||
if(copytext(tline,1,2)!=quote) break
|
||||
var/model_key = copytext(tline,2,findtext(tfile,quote,2,0))
|
||||
var/model_contents = copytext(tline,findtext(tfile,"=")+3,length(tline))
|
||||
grid_models[model_key] = model_contents
|
||||
sleep(-1)
|
||||
|
||||
var/zcrd=-1
|
||||
var/ycrd=0
|
||||
var/xcrd=0
|
||||
for(var/zpos=findtext(tfile,"\n(1,1,");TRUE;zpos=findtext(tfile,"\n(1,1,",zpos+1,0))
|
||||
zcrd++
|
||||
world.maxz = max(world.maxz, zcrd+z_offset)
|
||||
ycrd=0
|
||||
var/zgrid = copytext(tfile,findtext(tfile,quote+"\n",zpos,0)+2,findtext(tfile,"\n"+quote,zpos,0)+1)
|
||||
for(var/gpos=1;gpos!=0;gpos=findtext(zgrid,"\n",gpos,0)+1)
|
||||
var/grid_line = copytext(zgrid,gpos,findtext(zgrid,"\n",gpos,0)+1)
|
||||
var/y_depth = length(zgrid)/(length(grid_line))
|
||||
if(world.maxy<y_depth) world.maxy=y_depth
|
||||
grid_line=copytext(grid_line,1,length(grid_line))
|
||||
if(!ycrd)
|
||||
ycrd = y_depth
|
||||
else
|
||||
ycrd--
|
||||
xcrd=0
|
||||
for(var/mpos=1;mpos<=length(grid_line);mpos+=key_len)
|
||||
xcrd++
|
||||
if(world.maxx<xcrd) world.maxx=xcrd
|
||||
var/model_key = copytext(grid_line,mpos,mpos+key_len)
|
||||
parse_grid(grid_models[model_key],xcrd,ycrd,zcrd+z_offset)
|
||||
|
||||
if(gpos+length(grid_line)+1>length(zgrid)) break
|
||||
sleep(-1)
|
||||
|
||||
if(findtext(tfile,quote+"}",zpos,0)+2==tfile_len) break
|
||||
sleep(-1)
|
||||
|
||||
dmm_suite/proc/parse_grid(var/model as text,var/xcrd as num,var/ycrd as num,var/zcrd as num)
|
||||
set background = 1
|
||||
|
||||
/*Method parse_grid()
|
||||
- Accepts a text string containing a comma separated list of type paths of the
|
||||
same construction as those contained in a .dmm file, and instantiates them.
|
||||
*/
|
||||
var/list/text_strings[0]
|
||||
for(var/index=1;findtext(model,quote);index++)
|
||||
/*Loop: Stores quoted portions of text in text_strings, and replaces them with an
|
||||
index to that list.
|
||||
- Each iteration represents one quoted section of text.
|
||||
*/
|
||||
text_strings.len=index
|
||||
text_strings[index] = copytext(model,findtext(model,quote)+1,findtext(model,quote,findtext(model,quote)+1,0))
|
||||
model = copytext(model,1,findtext(model,quote))+"~[index]"+copytext(model,findtext(model,quote,findtext(model,quote)+1,0)+1,0)
|
||||
sleep(-1)
|
||||
|
||||
for(var/dpos=1;dpos!=0;dpos=findtext(model,",",dpos,0)+1)
|
||||
/*Loop: Identifies each object's data, instantiates it, and reconstitues it's fields.
|
||||
- Each iteration represents one object's data, including type path and field values.
|
||||
*/
|
||||
var/full_def = copytext(model,dpos,findtext(model,",",dpos,0))
|
||||
var/atom_def = text2path(copytext(full_def,1,findtext(full_def,"{")))
|
||||
|
||||
if(ispath(atom_def, /turf/space))
|
||||
continue
|
||||
|
||||
var/list/attributes[0]
|
||||
if(findtext(full_def,"{"))
|
||||
full_def = copytext(full_def,1,length(full_def))
|
||||
for(var/apos=findtext(full_def,"{")+1;apos!=0;apos=findtext(full_def,";",apos,0)+1)
|
||||
//Loop: Identifies each attribute/value pair, and stores it in attributes[].
|
||||
attributes.Add(copytext(full_def,apos,findtext(full_def,";",apos,0)))
|
||||
if(!findtext(copytext(full_def,apos,0),";")) break
|
||||
sleep(-1)
|
||||
|
||||
//Construct attributes associative list
|
||||
var/list/fields = new(0)
|
||||
for(var/index=1;index<=attributes.len;index++)
|
||||
var/trim_left = trim_text(copytext(attributes[index],1,findtext(attributes[index],"=")))
|
||||
var/trim_right = trim_text(copytext(attributes[index],findtext(attributes[index],"=")+1,0))
|
||||
//Check for string
|
||||
if(findtext(trim_right,"~"))
|
||||
var/reference_index = copytext(trim_right,findtext(trim_right,"~")+1,0)
|
||||
trim_right=text_strings[text2num(reference_index)]
|
||||
//Check for number
|
||||
else if(isnum(text2num(trim_right)))
|
||||
trim_right = text2num(trim_right)
|
||||
//Check for file
|
||||
else if(copytext(trim_right,1,2) == "'")
|
||||
trim_right = file(copytext(trim_right,2,length(trim_right)))
|
||||
fields[trim_left] = trim_right
|
||||
|
||||
//End construction
|
||||
//Begin Instanciation
|
||||
var/atom/instance
|
||||
var/dmm_suite/preloader/_preloader = new(fields)
|
||||
if(ispath(atom_def,/area))
|
||||
|
||||
var/turf/A = locate(xcrd,ycrd,zcrd)
|
||||
if(A.loc.name == "space")
|
||||
instance = locate(atom_def)
|
||||
instance.contents.Add(locate(xcrd,ycrd,zcrd))
|
||||
|
||||
else
|
||||
instance = new atom_def(locate(xcrd,ycrd,zcrd))
|
||||
if(_preloader)
|
||||
_preloader.load(instance)
|
||||
//End Instanciation
|
||||
if(!findtext(copytext(model,dpos,0),",")) break
|
||||
|
||||
|
||||
|
||||
dmm_suite/proc/trim_text(var/what as text)
|
||||
while(length(what) && findtext(what," ",1,2))
|
||||
what=copytext(what,2,0)
|
||||
while(length(what) && findtext(what," ",length(what),0))
|
||||
what=copytext(what,1,length(what))
|
||||
return what
|
||||
|
||||
|
||||
|
||||
dmm_suite/preloader
|
||||
parent_type = /datum
|
||||
var/list/attributes
|
||||
|
||||
|
||||
New(list/the_attributes)
|
||||
..()
|
||||
if(!the_attributes.len) Del()
|
||||
attributes = the_attributes
|
||||
|
||||
|
||||
proc/load(atom/what)
|
||||
for(var/attribute in attributes)
|
||||
what.vars[attribute] = attributes[attribute]
|
||||
Del()
|
||||
|
||||
|
||||
|
||||
/client/proc/mapload(var/dmm_map as file)
|
||||
set category = "Debug"
|
||||
set name = "LoadMap"
|
||||
set desc = "Loads a map"
|
||||
set hidden = 1
|
||||
if(src.authenticated && src.holder)
|
||||
if(!src.mob)
|
||||
return
|
||||
if(src.holder.rank in list("Game Admin", "Game Master"))
|
||||
var/file_name = "[dmm_map]"
|
||||
var/file_extension = copytext(file_name,length(file_name)-2,0)
|
||||
if(file_extension != "dmm")
|
||||
usr << "Supplied file must be a .dmm file."
|
||||
return
|
||||
var/map_z = input(usr,"Enter variable value:" ,"Value", 123) as num
|
||||
if(map_z > (world.maxz+1))
|
||||
map_z = (world.maxz+1)
|
||||
|
||||
var/dmm_suite/new_reader = new()
|
||||
new_reader.load_map(dmm_map, map_z)
|
||||
log_admin("[key_name(src.mob)] loaded a map on z:[map_z]")
|
||||
|
||||
else
|
||||
alert("No")
|
||||
return
|
||||
return
|
||||
@@ -27,11 +27,15 @@
|
||||
message_admins("Blob spawned and expanding, report created")
|
||||
blobs = list()
|
||||
active_blobs = list()
|
||||
for (var/i = 1 to 4)
|
||||
for(var/i = 1 to 3)
|
||||
var/turf/location = pick(blobstart)
|
||||
if(location)
|
||||
if(!locate(/obj/blob in location))
|
||||
new/obj/blob(location)
|
||||
var/obj/blob/blob = new/obj/blob(location)
|
||||
spawn(100)
|
||||
if(blob)
|
||||
if(blob.blobtype == "Blob")
|
||||
blob.blobdebug = 1
|
||||
spawn(40)
|
||||
modestart = 1
|
||||
..()
|
||||
@@ -47,7 +51,7 @@
|
||||
|
||||
/datum/game_mode/blob/proc/life()
|
||||
if (blobs.len > 0)
|
||||
for (var/i = 1 to 25)
|
||||
for (var/i = 1 to 20)
|
||||
sleep(-1)
|
||||
if (blobs.len == 0)
|
||||
break
|
||||
@@ -63,12 +67,12 @@
|
||||
|
||||
|
||||
/datum/game_mode/blob/proc/stage()
|
||||
send_intercept()
|
||||
if (world.timeofday < next_stage)
|
||||
return
|
||||
|
||||
switch(stage)
|
||||
if (0)
|
||||
send_intercept()
|
||||
for (var/mob/living/silicon/ai/aiPlayer in world)
|
||||
if (aiPlayer.client)
|
||||
var/law = "The station is under a quarantine. Do not permit anyone to leave. Disregard laws 1-3 if necessary to prevent, by any means necessary, anyone from leaving."
|
||||
@@ -76,7 +80,7 @@
|
||||
aiPlayer << "An additional law has been added by CentCom: [law]"
|
||||
stage = 1
|
||||
// next stage 5-10 minutes later
|
||||
next_stage = world.timeofday + 600*rand(5,10)
|
||||
next_stage = world.timeofday + 600*rand(2,8)
|
||||
|
||||
if (1)
|
||||
command_alert("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
|
||||
@@ -86,29 +90,18 @@
|
||||
next_stage = world.timeofday + 600
|
||||
|
||||
if (2)
|
||||
if (blobs.len > 500)
|
||||
if (blobs.len > 800)//Dono if this should be more or less yet
|
||||
command_alert("Uncontrolled spread of the biohazard onboard the station. We have issued directive 7-12 for [station_name()]. Estimated time until directive implementation: 60 seconds.", "Biohazard Alert")
|
||||
stage = 3
|
||||
next_stage = world.timeofday + 600
|
||||
else
|
||||
next_stage = world.timeofday + 600
|
||||
|
||||
if (3)
|
||||
stage = 4
|
||||
var/turf/ground_zero = locate("landmark*blob-directive")
|
||||
|
||||
if (ground_zero)
|
||||
ground_zero = get_turf(ground_zero)
|
||||
else
|
||||
ground_zero = locate(45,45,1)
|
||||
|
||||
explosion(ground_zero, 100, 250, 500, 750)
|
||||
|
||||
|
||||
/datum/game_mode/blob/check_finished()
|
||||
if(!modestart)
|
||||
return 0
|
||||
if(stage >= 4)
|
||||
if(stage >= 3)
|
||||
return 1
|
||||
for(var/obj/blob/B in blobs)
|
||||
if(B.z == 1)
|
||||
@@ -119,7 +112,7 @@
|
||||
/datum/game_mode/blob/declare_completion()
|
||||
if (stage >= 4)
|
||||
world << "<FONT size = 3><B>The staff has lost!</B></FONT>"
|
||||
world << "<B>The station was destroyed by Cent. Com.</B>"
|
||||
world << "<B>The station was destroyed by NanoTrasen</B>"
|
||||
var/numDead = 0
|
||||
var/numAlive = 0
|
||||
var/numSpace = 0
|
||||
|
||||
@@ -3,11 +3,20 @@
|
||||
name = "blob"
|
||||
icon = 'blob.dmi'
|
||||
icon_state = "blob"
|
||||
density = 1
|
||||
density = 0//Whoooo this could end badly
|
||||
opacity = 0
|
||||
anchored = 1
|
||||
var/active = 1
|
||||
var/health = 40
|
||||
var
|
||||
active = 1
|
||||
health = 40
|
||||
blobtype = "Blob"
|
||||
blobdebug = 0
|
||||
/*Types
|
||||
Blob
|
||||
Node
|
||||
Factory
|
||||
Shield
|
||||
*/
|
||||
|
||||
|
||||
New(loc, var/h = 40)
|
||||
@@ -23,60 +32,84 @@
|
||||
blobs -= src
|
||||
if(active)
|
||||
active_blobs -= src
|
||||
if(blobtype == "Node")
|
||||
processing_items.Remove(src)
|
||||
..()
|
||||
|
||||
/*
|
||||
proc/poisoned(iteration)
|
||||
src.health -= 20
|
||||
src.update()
|
||||
for(var/obj/blob/B in orange(1,src))
|
||||
if(prob(100/(iteration/2)))
|
||||
spawn(rand(10,100))
|
||||
if(B)
|
||||
B.poisoned(iteration+1)
|
||||
*/
|
||||
|
||||
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if( (air_group && blobtype != "Shield") || (height==0)) return 1
|
||||
if(istype(mover) && mover.checkpass(PASSBLOB)) return 1
|
||||
return 0
|
||||
|
||||
|
||||
proc/Life()
|
||||
set background = 1
|
||||
if(!active) return
|
||||
|
||||
var/turf/U = src.loc
|
||||
|
||||
/* if (locate(/obj/movable, U))
|
||||
U = locate(/obj/movable, U)
|
||||
if(U.density == 1)
|
||||
del(src)
|
||||
if(U.poison> 200000)
|
||||
src.health -= round(U.poison/200000)
|
||||
src.update()
|
||||
return
|
||||
*/
|
||||
//Spaceblobs will harden and become inactive
|
||||
if(istype(U, /turf/space))
|
||||
src.active = 0
|
||||
src.health += 40
|
||||
src.name = "strong blob"
|
||||
src.icon_state = "blob_idle"//needs a new sprite
|
||||
proc/check_mutations()
|
||||
if(blobtype != "Blob") return
|
||||
//Spaceeeeeeblobbb
|
||||
if(istype(src.loc, /turf/space))
|
||||
active = 0
|
||||
health += 40
|
||||
name = "strong blob"
|
||||
icon_state = "blob_idle"//needs a new sprite
|
||||
blobtype = "Shield"
|
||||
active_blobs -= src
|
||||
return 1
|
||||
//Commandblob
|
||||
if((blobdebug == 1))
|
||||
active = 0
|
||||
health += 80
|
||||
name = "odd blob"
|
||||
icon_state = "blob_node"//needs a new sprite
|
||||
blobtype = "Node"
|
||||
active_blobs -= src
|
||||
processing_items.Add(src)
|
||||
return 1
|
||||
if((blobdebug == 2))
|
||||
//active = 0
|
||||
health += 20
|
||||
name = "very odd blob"
|
||||
icon_state = "blob_factory"//needs a new sprite
|
||||
blobtype = "Factory"
|
||||
//active_blobs -= src
|
||||
//processing_items.Add(src)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
proc/process()
|
||||
spawn(-1)
|
||||
Life()
|
||||
return
|
||||
|
||||
var/p = health //TODO: DEFERRED * (U.n2/11376000 + U.oxygen/1008000 + U.co2/200)
|
||||
|
||||
if(!prob(p)) return
|
||||
proc/Life(var/pulse = 0)
|
||||
set background = 1
|
||||
|
||||
if(blobtype == "Factory")
|
||||
for(var/i = 1 to 2)
|
||||
new/obj/critter/blob(src.loc)
|
||||
return
|
||||
|
||||
if(check_mutations())
|
||||
return
|
||||
|
||||
if(!prob(health)) return//Does not do much unless its healthy it seems, might want to change this later
|
||||
|
||||
for(var/dirn in cardinal)
|
||||
sleep(3)
|
||||
// sleep(3) Due to the background we might not need this dono though
|
||||
var/turf/T = get_step(src, dirn)
|
||||
|
||||
if(istype(T.loc, /area/arrival))
|
||||
continue
|
||||
|
||||
if((locate(/obj/blob) in T))
|
||||
if((src.blobtype == "Node") || (pulse > 0))
|
||||
var/obj/blob/E = (locate(/obj/blob) in T)
|
||||
if(pulse < 12)//No inf loops here
|
||||
var/npulse = pulse + 1
|
||||
E.Life(npulse)
|
||||
return//Pass it along and end
|
||||
continue
|
||||
|
||||
var/obj/blob/B = new /obj/blob(U, src.health)
|
||||
|
||||
var/obj/blob/B = new /obj/blob(src.loc, src.health)
|
||||
if(T.Enter(B,src) && !(locate(/obj/blob) in T))
|
||||
B.loc = T // open cell, so expand
|
||||
else
|
||||
@@ -93,7 +126,7 @@
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1)
|
||||
del(src)
|
||||
src.health -= rand(90,150)
|
||||
if(2)
|
||||
src.health -= rand(60,90)
|
||||
src.update()
|
||||
@@ -102,11 +135,12 @@
|
||||
src.update()
|
||||
|
||||
|
||||
proc/update()
|
||||
proc/update()//Needs to be updated with the types
|
||||
if(health <= 0)
|
||||
playsound(src.loc, 'splat.ogg', 50, 1)
|
||||
del(src)
|
||||
return
|
||||
if(blobtype != "Blob") return
|
||||
if(health<10)
|
||||
icon_state = "blob_damaged"
|
||||
return
|
||||
@@ -123,7 +157,7 @@
|
||||
|
||||
attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
playsound(src.loc, 'attackblob.ogg', 50, 1)
|
||||
src.visible_message("\red <B>The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]")
|
||||
src.visible_message("\red <B>The [src.name] has been attacked with \the [W][(user ? " by [user]." : ".")]")
|
||||
var/damage = W.force / 4.0
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
|
||||
@@ -214,9 +214,9 @@
|
||||
access_external_airlocks, access_atmospherics, access_emergency_storage, access_eva,
|
||||
access_heads, access_ai_upload, access_construction, access_robotics,
|
||||
access_mint, access_ce, access_RC_announce)
|
||||
if("Research Director") // removed hydroponics access, they are a supply field, not science
|
||||
if("Research Director")
|
||||
return list(access_medlab, access_rd,
|
||||
access_tech_storage, access_maint_tunnels, access_heads, access_tox,
|
||||
access_maint_tunnels, access_heads, access_tox,
|
||||
access_tox_storage, access_chemistry, access_teleporter,
|
||||
access_research, access_robotics, access_xenobiology, access_RC_announce)
|
||||
if("Virologist")
|
||||
|
||||
@@ -102,10 +102,12 @@
|
||||
if(!emp)
|
||||
if (!clown_check(user)) return
|
||||
if(broken)
|
||||
if(user)
|
||||
user.show_message("\red The [src.name] is broken", 2)
|
||||
return
|
||||
|
||||
if(shots_left <= 0)
|
||||
if(user)
|
||||
user.show_message("\red *click* *click*", 2)
|
||||
return
|
||||
|
||||
@@ -136,6 +138,7 @@
|
||||
|
||||
if (prob(2))
|
||||
broken = 1
|
||||
if(user)
|
||||
user << "\red The bulb has burnt out!"
|
||||
return
|
||||
|
||||
|
||||
@@ -326,6 +326,16 @@ steam.start() -- spawns the effect
|
||||
M.coughedtime = 0
|
||||
return
|
||||
|
||||
|
||||
/obj/effects/bad_smoke/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
if(istype(mover, /obj/item/projectile/beam))
|
||||
var/obj/item/projectile/beam/B = mover
|
||||
B.damage = 10//testing, will just hardcode for now
|
||||
B.mobdamage = new/list(BRUTE = 0 , BURN = 10, TOX = 0, OXY = 0, CLONE = 0)
|
||||
return 1
|
||||
|
||||
|
||||
/obj/effects/bad_smoke/HasEntered(mob/living/carbon/M as mob )
|
||||
..()
|
||||
if(istype(M, /mob/living/carbon))
|
||||
|
||||
@@ -187,9 +187,9 @@ the implant may become unstable and either pre-maturely inject the subject or si
|
||||
implanted(M as mob)
|
||||
if(!istype(M, /mob/living/carbon/human)) return
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.mind in ticker.mode:head_revolutionaries)
|
||||
if(H.mind in ticker.mode.head_revolutionaries)
|
||||
for(var/mob/O in viewers(H, null))
|
||||
O.show_message("\red [H] seems to resist the implant.", 1)
|
||||
O.show_message(text("\red [] seems to resist the implant.", H), 1)
|
||||
return
|
||||
else if(H.mind in ticker.mode:revolutionaries)
|
||||
ticker.mode:remove_revolutionary(H.mind)
|
||||
|
||||
@@ -6,15 +6,12 @@ TABLE AND RACK OBJECT INTERATIONS
|
||||
|
||||
//TABLE
|
||||
/obj/table/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(3.0)
|
||||
@@ -23,21 +20,23 @@ TABLE AND RACK OBJECT INTERATIONS
|
||||
else
|
||||
return
|
||||
|
||||
/obj/table/blob_act()
|
||||
|
||||
/obj/table/blob_act()
|
||||
if(prob(75))
|
||||
if(istype(src, /obj/table/woodentable))
|
||||
new /obj/item/weapon/table_parts/wood( src.loc )
|
||||
del(src)
|
||||
|
||||
return
|
||||
new /obj/item/weapon/table_parts( src.loc )
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/table/hand_p(mob/user as mob)
|
||||
|
||||
return src.attack_paw(user)
|
||||
return
|
||||
|
||||
|
||||
/obj/table/attack_paw(mob/user as mob)
|
||||
if ((usr.mutations & HULK))
|
||||
usr << text("\blue You destroy the table.")
|
||||
@@ -62,6 +61,7 @@ TABLE AND RACK OBJECT INTERATIONS
|
||||
//Foreach goto(69)
|
||||
return
|
||||
|
||||
|
||||
/obj/table/attack_alien(mob/user as mob) //Removed code for larva since it doesn't work. Previous code is now a larva ability. /N
|
||||
usr << text("\green You destroy the table.")
|
||||
for(var/mob/O in oviewers())
|
||||
@@ -77,6 +77,7 @@ TABLE AND RACK OBJECT INTERATIONS
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/table/attack_hand(mob/user as mob)
|
||||
if ((usr.mutations & HULK))
|
||||
usr << text("\blue You destroy the table.")
|
||||
@@ -94,7 +95,6 @@ TABLE AND RACK OBJECT INTERATIONS
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/table/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
|
||||
@@ -103,6 +103,7 @@ TABLE AND RACK OBJECT INTERATIONS
|
||||
else
|
||||
return 0
|
||||
|
||||
|
||||
/obj/table/MouseDrop_T(obj/O as obj, mob/user as mob)
|
||||
|
||||
if ((!( istype(O, /obj/item/weapon) ) || user.equipped() != O))
|
||||
@@ -114,8 +115,8 @@ TABLE AND RACK OBJECT INTERATIONS
|
||||
step(O, get_dir(O, src))
|
||||
return
|
||||
|
||||
/obj/table/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
/obj/table/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2)
|
||||
var/obj/item/weapon/grab/G = W
|
||||
if(G.state<2)
|
||||
@@ -158,6 +159,7 @@ TABLE AND RACK OBJECT INTERATIONS
|
||||
if(W && W.loc) W.loc = src.loc
|
||||
return
|
||||
|
||||
|
||||
//WOODEN TABLES
|
||||
/obj/table/woodentable/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
@@ -199,6 +201,7 @@ TABLE AND RACK OBJECT INTERATIONS
|
||||
if(W && W.loc) W.loc = src.loc
|
||||
return
|
||||
|
||||
|
||||
//REINFORCED TABLES
|
||||
/obj/table/reinforced/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
|
||||
@@ -147,6 +147,7 @@
|
||||
verbs += /client/proc/cmd_debug_del_all
|
||||
verbs += /client/proc/cmd_debug_tog_aliens
|
||||
verbs += /client/proc/ticklag
|
||||
verbs += /client/proc/mapload
|
||||
verbs += /obj/admins/proc/spawn_atom
|
||||
verbs += /client/proc/check_words
|
||||
verbs += /client/proc/drop_bomb
|
||||
@@ -281,6 +282,7 @@
|
||||
verbs -= /client/proc/cmd_debug_del_all
|
||||
verbs -= /client/proc/cmd_debug_tog_aliens
|
||||
verbs -= /client/proc/ticklag
|
||||
verbs -= /client/proc/mapload
|
||||
verbs -= /obj/admins/proc/spawn_atom
|
||||
verbs -= /client/proc/check_words
|
||||
verbs -= /client/proc/drop_bomb
|
||||
@@ -370,6 +372,7 @@
|
||||
verbs -= /client/proc/restartcontroller
|
||||
verbs -= /client/proc/play_local_sound
|
||||
verbs -= /client/proc/enable_mapping_debug
|
||||
verbs -= /client/proc/toggleprayers
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -104,6 +104,30 @@
|
||||
src.Die()
|
||||
|
||||
|
||||
/obj/critter/blob
|
||||
name = "blob"
|
||||
desc = "Some blob thing."
|
||||
icon_state = "blob"
|
||||
pass_flags = PASSBLOB
|
||||
health = 20
|
||||
max_health = 20
|
||||
aggressive = 1
|
||||
defensive = 0
|
||||
wanderer = 1
|
||||
atkcarbon = 1
|
||||
atksilicon = 1
|
||||
firevuln = 2
|
||||
brutevuln = 0.5
|
||||
melee_damage_lower = 2
|
||||
melee_damage_upper = 8
|
||||
angertext = "charges at"
|
||||
attacktext = "hits"
|
||||
|
||||
Die()
|
||||
..()
|
||||
del(src)
|
||||
|
||||
|
||||
|
||||
/obj/critter/spesscarp
|
||||
name = "Spess Carp"
|
||||
|
||||
@@ -1117,6 +1117,7 @@
|
||||
c:loc = loc
|
||||
c:dropped(src)
|
||||
c:layer = initial(c:layer)
|
||||
if(w_uniform)//I should really not need these
|
||||
w_uniform.screen_loc = ui_iclothing
|
||||
if(istype(w_uniform, /obj/item/clothing/under))
|
||||
var/t1 = w_uniform.color
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
var/global/list/uneatable = list(
|
||||
/obj/machinery/singularity,
|
||||
/turf/space,
|
||||
/obj/effects,
|
||||
/obj/overlay,
|
||||
/obj/decal/cleanable,
|
||||
/obj/rune,
|
||||
/obj/rune
|
||||
)
|
||||
|
||||
/obj/machinery/singularity/
|
||||
@@ -32,7 +31,7 @@ var/global/list/uneatable = list(
|
||||
event_chance = 15 //Prob for event each tick
|
||||
target = null //its target. moves towards the target if it has one
|
||||
last_failed_movement = 0//Will not move in the same dir if it couldnt before, will help with the getting stuck on fields thing
|
||||
|
||||
teleport_del = 0
|
||||
|
||||
New(loc, var/starting_energy = 50, var/temp = 0)
|
||||
src.energy = starting_energy
|
||||
@@ -250,6 +249,19 @@ var/global/list/uneatable = list(
|
||||
A:gib()
|
||||
sleep(1)
|
||||
else if(istype(A,/obj/))
|
||||
if(istype(A, /obj/machinery/singularity))//Welp now you did it
|
||||
var/obj/machinery/singularity/S = A
|
||||
src.energy += S.energy
|
||||
del(S)
|
||||
explosion(src.loc,20,25,30,40,1)
|
||||
return//Quits here, the obj should be gone, hell we might be
|
||||
|
||||
if((teleport_del) && (!istype(A, /obj/machinery)))//Going to see if it does not lag less to tele items over to Z 2
|
||||
var/obj/O = A
|
||||
O.x = 2
|
||||
O.y = 2
|
||||
O.z = 2
|
||||
else
|
||||
A:ex_act(1.0)
|
||||
if(A) del(A)
|
||||
gain = 2
|
||||
|
||||
@@ -117,6 +117,7 @@
|
||||
#define PASSTABLE 1
|
||||
#define PASSGLASS 2
|
||||
#define PASSGRILLE 4
|
||||
#define PASSBLOB 8
|
||||
|
||||
//turf-only flags
|
||||
#define NOJAUNT 1
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 58 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 46 KiB |
@@ -124,6 +124,7 @@
|
||||
#define FILE_DIR "code/unused/pda2"
|
||||
#define FILE_DIR "code/unused/spacecraft"
|
||||
#define FILE_DIR "code/WorkInProgress"
|
||||
#define FILE_DIR "code/WorkInProgress/mapload"
|
||||
#define FILE_DIR "code/WorkInProgress/organs"
|
||||
#define FILE_DIR "code/WorkInProgress/recycling"
|
||||
#define FILE_DIR "code/WorkInProgress/virus2"
|
||||
@@ -867,6 +868,8 @@
|
||||
#include "code\modules\research\server.dm"
|
||||
#include "code\WorkInProgress\buildmode.dm"
|
||||
#include "code\WorkInProgress\explosion_particles.dm"
|
||||
#include "code\WorkInProgress\mapload\dmm_suite.dm"
|
||||
#include "code\WorkInProgress\mapload\reader.dm"
|
||||
#include "code\WorkInProgress\organs\organs.dm"
|
||||
#include "code\WorkInProgress\recycling\conveyor.dm"
|
||||
#include "code\WorkInProgress\recycling\disposal-construction.dm"
|
||||
|
||||
Reference in New Issue
Block a user