Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions code/ATMOSPHERICS/_atmos_setup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
var/icon/pipe = new('icons/atmos/pipes.dmi')

for(var/state in pipe.IconStates())
if(!state || findtext(state, "map"))
if(!state || findtextEx(state, "map"))
continue

var/cache_name = state
Expand All @@ -112,13 +112,13 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_

pipe = new ('icons/atmos/heat.dmi')
for(var/state in pipe.IconStates())
if(!state || findtext(state, "map"))
if(!state || findtextEx(state, "map"))
continue
pipe_icons["hepipe" + state] = image('icons/atmos/heat.dmi', icon_state = state)

pipe = new ('icons/atmos/junction.dmi')
for(var/state in pipe.IconStates())
if(!state || findtext(state, "map"))
if(!state || findtextEx(state, "map"))
continue
pipe_icons["hejunction" + state] = image('icons/atmos/junction.dmi', icon_state = state)

Expand All @@ -130,12 +130,12 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
var/icon/pipe = new('icons/atmos/manifold.dmi')

for(var/state in pipe.IconStates())
if(findtext(state, "clamps"))
if(findtextEx(state, "clamps"))
var/image/I = image('icons/atmos/manifold.dmi', icon_state = state)
manifold_icons[state] = I
continue

if(findtext(state, "core") || findtext(state, "4way"))
if(findtextEx(state, "core") || findtextEx(state, "4way"))
var/image/I = image('icons/atmos/manifold.dmi', icon_state = state)
manifold_icons[state] = I
for(var/pipe_color in pipe_colors)
Expand All @@ -151,13 +151,13 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_

device = new('icons/atmos/vent_pump.dmi')
for(var/state in device.IconStates())
if(!state || findtext(state, "map"))
if(!state || findtextEx(state, "map"))
continue
device_icons["vent" + state] = image('icons/atmos/vent_pump.dmi', icon_state = state)

device = new('icons/atmos/vent_scrubber.dmi')
for(var/state in device.IconStates())
if(!state || findtext(state, "map"))
if(!state || findtextEx(state, "map"))
continue
device_icons["scrubber" + state] = image('icons/atmos/vent_scrubber.dmi', icon_state = state)

Expand All @@ -168,7 +168,7 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
var/icon/omni = new('icons/atmos/omni_devices.dmi')

for(var/state in omni.IconStates())
if(!state || findtext(state, "map"))
if(!state || findtextEx(state, "map"))
continue
omni_icons[state] = image('icons/atmos/omni_devices.dmi', icon_state = state)

Expand Down
4 changes: 2 additions & 2 deletions code/ATMOSPHERICS/_atmospherics_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
//transfer_moles - Limits the amount of moles to transfer. The actual amount of gas moved may also be limited by available_power, if given.
//available_power - the maximum amount of power that may be used when moving gas. If null then the transfer is not limited by power.
/proc/pump_gas(var/obj/machinery/M, var/datum/gas_mixture/source, var/datum/gas_mixture/sink, var/transfer_moles = null, var/available_power = null)
if (source.total_moles < MINUMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
if (source.total_moles < MINIMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
return -1

//var/source_moles_initial = source.total_moles
Expand All @@ -40,7 +40,7 @@
if (!isnull(available_power) && specific_power > 0)
transfer_moles = min(transfer_moles, available_power / specific_power)

if (transfer_moles < MINUMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
if (transfer_moles < MINIMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
return -1

//Update flow rate meter
Expand Down
20 changes: 10 additions & 10 deletions code/ATMOSPHERICS/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Pipelines + Other Objects -> Pipe network

*/

obj/machinery/atmospherics
/obj/machinery/atmospherics
anchored = 1
idle_power_usage = 0
active_power_usage = 0
Expand All @@ -19,39 +19,39 @@ obj/machinery/atmospherics



obj/machinery/atmospherics/var/initialize_directions = 0
/obj/machinery/atmospherics/var/initialize_directions = 0
obj/machinery/atmospherics/var/pipe_color

obj/machinery/atmospherics/process()
/obj/machinery/atmospherics/process()
build_network()

obj/machinery/atmospherics/proc/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
/obj/machinery/atmospherics/proc/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
// Check to see if should be added to network. Add self if so and adjust variables appropriately.
// Note don't forget to have neighbors look as well!

return null

obj/machinery/atmospherics/proc/build_network()
/obj/machinery/atmospherics/proc/build_network()
// Called to build a network from this node

return null

obj/machinery/atmospherics/proc/return_network(obj/machinery/atmospherics/reference)
/obj/machinery/atmospherics/proc/return_network(obj/machinery/atmospherics/reference)
// Returns pipe_network associated with connection to reference
// Notes: should create network if necessary
// Should never return null

return null

obj/machinery/atmospherics/proc/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
/obj/machinery/atmospherics/proc/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
// Used when two pipe_networks are combining

obj/machinery/atmospherics/proc/return_network_air(datum)
/obj/machinery/atmospherics/proc/return_network_air(datum)
// Return a list of gas_mixture(s) in the object
// associated with reference pipe_network for use in rebuilding the networks gases list
// Is permitted to return null

obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
/obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)

obj/machinery/atmospherics/update_icon()
/obj/machinery/atmospherics/update_icon()
return null
1 change: 1 addition & 0 deletions code/ATMOSPHERICS/components/omni_devices/omni_base.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@
if(P.node || P.mode == 0)
continue
for(var/obj/machinery/atmospherics/target in get_step(src, P.dir))
target.init_dir()
if(target.initialize_directions & get_dir(target,src))
var/c = check_connect_types(target,src)
if (c)
Expand Down
14 changes: 7 additions & 7 deletions code/WorkInProgress/AI_Visibility/_old_AI_Visibility.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@
var/list/par = params2list(params)
var/screen_loc = par["screen-loc"]

if(findtext(screen_loc, "minimap:") != 1)
if(findtextEx(screen_loc, "minimap:") != 1)
return

screen_loc = copytext(screen_loc, length("minimap:") + 1)

var/x_text = copytext(screen_loc, 1, findtext(screen_loc, ","))
var/y_text = copytext(screen_loc, findtext(screen_loc, ",") + 1)
var/x_text = copytext(screen_loc, 1, findtextEx(screen_loc, ","))
var/y_text = copytext(screen_loc, findtextEx(screen_loc, ",") + 1)

var/x = (text2num(copytext(x_text, 1, findtext(x_text, ":"))) - 1) * 16
x += round((text2num(copytext(x_text, findtext(x_text, ":") + 1)) + 1) / 2)
var/x = (text2num(copytext(x_text, 1, findtextEx(x_text, ":"))) - 1) * 16
x += round((text2num(copytext(x_text, findtextEx(x_text, ":") + 1)) + 1) / 2)

var/y = (text2num(copytext(y_text, 1, findtext(y_text, ":"))) - 1) * 16
y += round((text2num(copytext(y_text, findtext(y_text, ":") + 1)) + 1) / 2)
var/y = (text2num(copytext(y_text, 1, findtextEx(y_text, ":"))) - 1) * 16
y += round((text2num(copytext(y_text, findtextEx(y_text, ":") + 1)) + 1) / 2)

if(istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
Expand Down
10 changes: 5 additions & 5 deletions code/WorkInProgress/AI_Visibility/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
var/list/par = params2list(params)
var/screen_loc = par["screen-loc"]

if(findtext(screen_loc, "minimap:") != 1)
if(findtextEx(screen_loc, "minimap:") != 1)
return

screen_loc = copytext(screen_loc, length("minimap:") + 1)

var/x_text = copytext(screen_loc, 1, findtext(screen_loc, ","))
var/y_text = copytext(screen_loc, findtext(screen_loc, ",") + 1)
var/x_text = copytext(screen_loc, 1, findtextEx(screen_loc, ","))
var/y_text = copytext(screen_loc, findtextEx(screen_loc, ",") + 1)

var/x = chunk.x
x += round((text2num(copytext(x_text, findtext(x_text, ":") + 1)) + 1) / 2)
x += round((text2num(copytext(x_text, findtextEx(x_text, ":") + 1)) + 1) / 2)

var/y = chunk.y
y += round((text2num(copytext(y_text, findtext(y_text, ":") + 1)) + 1) / 2)
y += round((text2num(copytext(y_text, findtextEx(y_text, ":") + 1)) + 1) / 2)

if(istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
Expand Down
2 changes: 1 addition & 1 deletion code/WorkInProgress/Guap6512/laptops/security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ What a mess.*/
for(var/datum/data/record/R in data_core.general)
var/temptext = R.fields["name"] + " " + R.fields["id"] + " " + R.fields["fingerprint"] + " " + R.fields["rank"]
for(var/i = 1, i<=components.len, i++)
if(findtext(temptext,components[i]))
if(findtextEx(temptext,components[i]))
var/prelist = new/list(2)
prelist[1] = R
Perp += prelist
Expand Down
4 changes: 2 additions & 2 deletions code/WorkInProgress/SkyMarshal/Ultralight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ turf/proc/ul_UpdateLight()
if(!isarea(CurrentArea) || !CurrentArea.ul_Lighting)
return

var/LightingTag = copytext(CurrentArea.tag, 1, findtext(CurrentArea.tag, ":UL")) + ":UL[ul_GetRed()]_[ul_GetGreen()]_[ul_GetBlue()]"
var/LightingTag = copytext(CurrentArea.tag, 1, findtextEx(CurrentArea.tag, ":UL")) + ":UL[ul_GetRed()]_[ul_GetGreen()]_[ul_GetBlue()]"

if(CurrentArea.tag != LightingTag)
var/area/NewArea = locate(LightingTag)
Expand Down Expand Up @@ -351,7 +351,7 @@ area/proc/ul_Prep()
if(!tag)
tag = "[type]"
if(ul_Lighting)
if(!findtext(tag,":UL"))
if(!findtextEx(tag,":UL"))
ul_Light()
//world.log << tag

Expand Down
48 changes: 24 additions & 24 deletions code/WorkInProgress/Tastyfish/Eliza.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
// pad so we can detect initial and final words correctly
input_line = " " + src.input_line + " "
// remove apostrophes
for(var/i = -1, i != 0, i = findtext(input_line, "'"))
for(var/i = -1, i != 0, i = findtextEx(input_line, "'"))
if(i == -1)
continue
input_line = copytext(input_line, 1, i) + copytext(input_line, i + 1, 0)

// did user insult us? (i don't really want cursing in the source code,
// so keep it the simple original check from the 70's code :p)
if(findtext(input_line, "shut"))
if(findtextEx(input_line, "shut"))
// sssh
return

Expand All @@ -48,7 +48,7 @@
for(var/i = 1, i <= keywords.len, i++)
keyword = keywords[i]
for(var/j = 1, j <= keyword.phrases.len, j++)
keypos = findtext(input_line, " " + keyword.phrases[j])
keypos = findtextEx(input_line, " " + keyword.phrases[j])
if(keypos != 0)
// found it!
keyphrase = keyword.phrases[j]
Expand All @@ -66,44 +66,44 @@
// otherwise, business as usual

// let's conjugate this mess
conjugated = copytext(input_line, 1 + keypos + lentext(keyphrase))
conjugated = copytext(input_line, 1 + keypos + length(keyphrase))

// go ahead and strip punctuation
if(lentext(conjugated) > 0 && copytext(conjugated, lentext(conjugated)) == " ")
conjugated = copytext(conjugated, 1, lentext(conjugated))
if(lentext(conjugated) > 0)
var/final_punc = copytext(conjugated, lentext(conjugated))
if(length(conjugated) > 0 && copytext(conjugated, length(conjugated)) == " ")
conjugated = copytext(conjugated, 1, length(conjugated))
if(length(conjugated) > 0)
var/final_punc = copytext(conjugated, length(conjugated))
if(final_punc == "." || final_punc == "?" || final_punc == "!")
conjugated = copytext(conjugated, 1, lentext(conjugated))
conjugated = copytext(conjugated, 1, length(conjugated))

conjugated += " "

if(keyword.conjugate)
// now run through conjugation pairs
for(var/i = 1, i <= lentext(conjugated), i++)
for(var/i = 1, i <= length(conjugated), i++)
for(var/x = 1, x <= conjugs.len, x += 2)
var/cx = conjugs[x]
var/cxa = conjugs[x + 1]
if(i + lentext(cx) <= lentext(conjugated) + 1 && cmptext(cx, copytext(conjugated, i, i + lentext(cx))))
if(i + length(cx) <= length(conjugated) + 1 && cmptext(cx, copytext(conjugated, i, i + length(cx))))
// world << cx

conjugated = copytext(conjugated, 1, i) + cxa + copytext(conjugated, i + lentext(cx))
i = i + lentext(cx)
conjugated = copytext(conjugated, 1, i) + cxa + copytext(conjugated, i + length(cx))
i = i + length(cx)
// don't count right padding
if(copytext(cx, lentext(cx)) == " ")
if(copytext(cx, length(cx)) == " ")
i--
break
else if(i + lentext(cxa) <= lentext(conjugated) + 1 && cmptext(cxa, copytext(conjugated, i, i + lentext(cxa))))
else if(i + length(cxa) <= length(conjugated) + 1 && cmptext(cxa, copytext(conjugated, i, i + length(cxa))))
// world << cxa

conjugated = copytext(conjugated, 1, i) + cx + copytext(conjugated, i + lentext(cxa))
i = i + lentext(cxa)
conjugated = copytext(conjugated, 1, i) + cx + copytext(conjugated, i + length(cxa))
i = i + length(cxa)
// don't count right padding
if(copytext(cxa, lentext(cxa)) == " ")
if(copytext(cxa, length(cxa)) == " ")
i--
break

conjugated = copytext(conjugated, 1, lentext(conjugated))
conjugated = copytext(conjugated, 1, length(conjugated))

//world << "Conj: " + conjugated

Expand All @@ -127,21 +127,21 @@
eliza.yesno_state = ""
eliza.yesno_param = ""
var/reply = pick(replies)
if(copytext(reply, lentext(reply)) == "*")
if(copytext(reply, length(reply)) == "*")
// add object of statement (hopefully not actually mess :p)
if(object == "")
object = pick(generic_objects)
// possibly add name or just ?
if(eliza.username != "" && rand(3) == 0)
object += ", " + eliza.username
return copytext(reply, 1, lentext(reply)) + object + "?"
return copytext(reply, 1, length(reply)) + object + "?"
else
// get punct
var/final_punc = ""
if(lentext(reply) > 0)
final_punc = copytext(reply, lentext(reply))
if(length(reply) > 0)
final_punc = copytext(reply, length(reply))
if(final_punc == "." || final_punc == "?" || final_punc == "!")
reply = copytext(reply, 1, lentext(reply))
reply = copytext(reply, 1, length(reply))
else
final_punc = ""

Expand Down
Loading
Loading