mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-29 19:43:16 +00:00
TG: Bugfixes for NTSL. AIs can now use script consoles. Fixes crashes.
Buffs metroid magic. More core uses! Revision: r3334 Author: vageyenaman
This commit is contained in:
@@ -229,6 +229,8 @@
|
||||
return max(low,min(high,num))
|
||||
|
||||
/proc/dd_replacetext(text, search_string, replacement_string)
|
||||
if(!text || !istext(text) || !search_string || !istext(search_string) || !istext(replacement_string))
|
||||
return null
|
||||
var/textList = dd_text2list(text, search_string)
|
||||
return dd_list2text(textList, replacement_string)
|
||||
|
||||
@@ -1383,7 +1385,7 @@ proc/listclearnulls(list/list)
|
||||
var/y_pos = null
|
||||
var/z_pos = null
|
||||
|
||||
/area/proc/move_contents_to(var/area/A, var/turftoleave=null)
|
||||
/area/proc/move_contents_to(var/area/A, var/turftoleave=null, var/direction = null)
|
||||
//Takes: Area. Optional: turf type to leave behind.
|
||||
//Returns: Nothing.
|
||||
//Notes: Attempts to move the contents of one area to another area.
|
||||
@@ -1442,7 +1444,39 @@ proc/listclearnulls(list/list)
|
||||
X.icon_state = old_icon_state1
|
||||
X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi
|
||||
|
||||
/* Quick visual fix for some weird shuttle corner artefacts when on transit space tiles */
|
||||
if(direction && findtext(X.icon_state, "swall_s"))
|
||||
|
||||
// Spawn a new shuttle corner object
|
||||
var/obj/corner = new()
|
||||
corner.loc = X
|
||||
corner.density = 1
|
||||
corner.anchored = 1
|
||||
corner.icon = X.icon
|
||||
corner.icon_state = dd_replacetext(X.icon_state, "_s", "_f")
|
||||
corner.tag = "delete me"
|
||||
corner.name = "wall"
|
||||
|
||||
// Find a new turf to take on the property of
|
||||
var/turf/nextturf = get_step(corner, direction)
|
||||
if(!nextturf || !istype(nextturf, /turf/space))
|
||||
nextturf = get_step(corner, turn(direction, 180))
|
||||
|
||||
|
||||
// Take on the icon of a neighboring scrolling space icon
|
||||
X.icon = nextturf.icon
|
||||
X.icon_state = nextturf.icon_state
|
||||
|
||||
|
||||
for(var/obj/O in T)
|
||||
|
||||
// Reset the shuttle corners
|
||||
if(O.tag == "delete me")
|
||||
X.icon = 'shuttle.dmi'
|
||||
X.icon_state = dd_replacetext(O.icon_state, "_f", "_s") // revert the turf to the old icon_state
|
||||
X.name = "wall"
|
||||
del(O) // prevents multiple shuttle corners from stacking
|
||||
continue
|
||||
if(!istype(O,/obj)) continue
|
||||
O.loc = X
|
||||
for(var/mob/M in T)
|
||||
|
||||
@@ -90,19 +90,25 @@
|
||||
del(src)
|
||||
|
||||
|
||||
attack_ai(var/mob/user as mob)
|
||||
attack_hand(user)
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
|
||||
// You need a multitool to use this.
|
||||
if(user.equipped())
|
||||
if(!istype(user.equipped(), /obj/item/device/multitool))
|
||||
// You need a multitool to use this, or be silicon
|
||||
if(!issilicon(user))
|
||||
if(user.equipped())
|
||||
if(!istype(user.equipped(), /obj/item/device/multitool))
|
||||
return
|
||||
else
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
if(stat & (BROKEN|NOPOWER) || !on)
|
||||
return
|
||||
|
||||
var/obj/item/device/multitool/P = user.equipped()
|
||||
var/obj/item/device/multitool/P = null
|
||||
if(!issilicon(user))
|
||||
P = user.equipped()
|
||||
|
||||
user.machine = src
|
||||
var/dat
|
||||
@@ -138,10 +144,12 @@
|
||||
|
||||
dat += "<br> <a href='?src=\ref[src];input=freq'>\[Add Filter\]</a>"
|
||||
dat += "<hr>"
|
||||
if(P.buffer)
|
||||
dat += "<br><br>MULTITOOL BUFFER: [P.buffer] ([P.buffer.id]) <a href='?src=\ref[src];link=1'>\[Link\]</a> <a href='?src=\ref[src];flush=1'>\[Flush\]"
|
||||
else
|
||||
dat += "<br><br>MULTITOOL BUFFER: <a href='?src=\ref[src];buffer=1'>\[Add Machine\]</a>"
|
||||
|
||||
if(P)
|
||||
if(P.buffer)
|
||||
dat += "<br><br>MULTITOOL BUFFER: [P.buffer] ([P.buffer.id]) <a href='?src=\ref[src];link=1'>\[Link\]</a> <a href='?src=\ref[src];flush=1'>\[Flush\]"
|
||||
else
|
||||
dat += "<br><br>MULTITOOL BUFFER: <a href='?src=\ref[src];buffer=1'>\[Add Machine\]</a>"
|
||||
|
||||
dat += "</font>"
|
||||
temp = ""
|
||||
@@ -150,16 +158,19 @@
|
||||
|
||||
Topic(href, href_list)
|
||||
|
||||
if(usr.equipped())
|
||||
if(!istype(usr.equipped(), /obj/item/device/multitool))
|
||||
if(!issilicon(usr))
|
||||
if(usr.equipped())
|
||||
if(!istype(usr.equipped(), /obj/item/device/multitool))
|
||||
return
|
||||
else
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
if(stat & (BROKEN|NOPOWER) || !on)
|
||||
return
|
||||
|
||||
var/obj/item/device/multitool/P = usr.equipped()
|
||||
var/obj/item/device/multitool/P = null
|
||||
if(!issilicon(usr))
|
||||
P = usr.equipped()
|
||||
|
||||
if(href_list["input"])
|
||||
switch(href_list["input"])
|
||||
@@ -205,27 +216,30 @@
|
||||
|
||||
if(href_list["unlink"])
|
||||
|
||||
var/obj/machinery/telecomms/T = links[text2num(href_list["unlink"])]
|
||||
temp = "<font color = #666633>-% Removed \ref[T] [T.name] from linked entities. %-</font color>"
|
||||
if(text2num(href_list["unlink"]) <= length(links))
|
||||
var/obj/machinery/telecomms/T = links[text2num(href_list["unlink"])]
|
||||
temp = "<font color = #666633>-% Removed \ref[T] [T.name] from linked entities. %-</font color>"
|
||||
|
||||
// Remove link entries from both T and src.
|
||||
if(src in T.links)
|
||||
T.links.Remove(src)
|
||||
links.Remove(T)
|
||||
// Remove link entries from both T and src.
|
||||
if(src in T.links)
|
||||
T.links.Remove(src)
|
||||
links.Remove(T)
|
||||
|
||||
if(href_list["link"])
|
||||
|
||||
if(P.buffer)
|
||||
if(!(src in P.buffer.links))
|
||||
P.buffer.links.Add(src)
|
||||
if(P)
|
||||
|
||||
if(!(P.buffer in src.links))
|
||||
src.links.Add(P.buffer)
|
||||
if(P.buffer)
|
||||
if(!(src in P.buffer.links))
|
||||
P.buffer.links.Add(src)
|
||||
|
||||
temp = "<font color = #666633>-% Successfully linked with \ref[P.buffer] [P.buffer.name] %-</font color>"
|
||||
if(!(P.buffer in src.links))
|
||||
src.links.Add(P.buffer)
|
||||
|
||||
else
|
||||
temp = "<font color = #666633>-% Unable to acquire buffer %-</font color>"
|
||||
temp = "<font color = #666633>-% Successfully linked with \ref[P.buffer] [P.buffer.name] %-</font color>"
|
||||
|
||||
else
|
||||
temp = "<font color = #666633>-% Unable to acquire buffer %-</font color>"
|
||||
|
||||
if(href_list["buffer"])
|
||||
|
||||
@@ -244,3 +258,4 @@
|
||||
|
||||
updateUsrDialog()
|
||||
|
||||
|
||||
|
||||
@@ -169,6 +169,7 @@
|
||||
editingcode = usr
|
||||
winshow(editingcode, "Telecomms IDE", 1) // show the IDE
|
||||
winset(editingcode, "tcscode", "is-disabled=false")
|
||||
winset(editingcode, "tcscode", "text=\"\"")
|
||||
var/showcode = dd_replacetext(storedcode, "\\\"", "\\\\\"")
|
||||
showcode = dd_replacetext(storedcode, "\"", "\\\"")
|
||||
winset(editingcode, "tcscode", "text=\"[showcode]\"")
|
||||
|
||||
@@ -759,13 +759,14 @@ datum
|
||||
if(M:eyecheck() <= 0)
|
||||
flick("e_flash", M.flash)
|
||||
|
||||
for(var/i = 1, i <= created_volume, i++)
|
||||
for(var/i = 1, i <= created_volume + rand(1,2), i++)
|
||||
var/chosen = pick(borks)
|
||||
var/obj/B = new chosen
|
||||
B.loc = get_turf_loc(holder.my_atom)
|
||||
if(prob(50))
|
||||
for(var/j = 1, j <= rand(1, 3), j++)
|
||||
step(B, pick(NORTH,SOUTH,EAST,WEST))
|
||||
if(B)
|
||||
B.loc = get_turf_loc(holder.my_atom)
|
||||
if(prob(50))
|
||||
for(var/j = 1, j <= rand(1, 3), j++)
|
||||
step(B, pick(NORTH,SOUTH,EAST,WEST))
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user