mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-21 07:32:02 +00:00
NTSL2++ sucessor to NTSL2+ (#9321)
This drastcly is meant to rework DM and Daemon code to allow further expansion and replacement of custom engine with JavaScript language based engine. Daemon PR - Aurorastation/ByondInterpretedLanguage#7 Forums topic for discussion - https://forums.aurorastation.org/topic/14570-ntsl2-and-its-future/ Superseeds #8817
This commit is contained in:
@@ -236,61 +236,5 @@ datum/signal
|
||||
S.memory[address] = value
|
||||
|
||||
|
||||
proc/tcombroadcast(var/message, var/freq, var/source, var/job, var/verb, var/language)
|
||||
|
||||
var/datum/signal/newsign = new
|
||||
var/obj/machinery/telecomms/server/S = data["server"]
|
||||
var/obj/item/device/radio/hradio = S.server_radio
|
||||
|
||||
if(!hradio)
|
||||
error("[src] has no radio.")
|
||||
return
|
||||
|
||||
if((!message || message == "") && message != 0)
|
||||
message = "*beep*"
|
||||
if(!source)
|
||||
source = "[html_encode(uppertext(S.id))]"
|
||||
hradio = new // sets the hradio as a radio intercom
|
||||
if(!freq)
|
||||
freq = PUB_FREQ
|
||||
if(findtext(num2text(freq), ".")) // if the frequency has been set as a decimal
|
||||
freq *= 10 // shift the decimal one place
|
||||
|
||||
if(!job)
|
||||
job = "?"
|
||||
|
||||
if(!language || language == "")
|
||||
language = LANGUAGE_TCB
|
||||
|
||||
var/datum/language/L = all_languages[language]
|
||||
if(!L || !(L.flags & TCOMSSIM))
|
||||
L = all_languages[LANGUAGE_TCB]
|
||||
|
||||
newsign.data["mob"] = null
|
||||
newsign.data["mobtype"] = /mob/living/carbon/human
|
||||
newsign.data["name"] = source
|
||||
newsign.data["realname"] = newsign.data["name"]
|
||||
newsign.data["job"] = job
|
||||
newsign.data["compression"] = 0
|
||||
newsign.data["message"] = message
|
||||
newsign.data["language"] = L
|
||||
newsign.data["type"] = 2 // artificial broadcast
|
||||
if(!isnum(freq))
|
||||
freq = text2num(freq)
|
||||
newsign.frequency = freq
|
||||
|
||||
var/datum/radio_frequency/connection = SSradio.return_frequency(freq)
|
||||
newsign.data["connection"] = connection
|
||||
|
||||
|
||||
newsign.data["radio"] = hradio
|
||||
newsign.data["vmessage"] = message
|
||||
newsign.data["vname"] = source
|
||||
newsign.data["vmask"] = 0
|
||||
newsign.data["level"] = list()
|
||||
newsign.data["verb"] = verb
|
||||
|
||||
var/pass = S.relay_information(newsign, "/obj/machinery/telecomms/hub")
|
||||
if(!pass)
|
||||
S.relay_information(newsign, "/obj/machinery/telecomms/broadcaster") // send this simple message to broadcasters
|
||||
|
||||
|
||||
@@ -213,37 +213,7 @@ proc/n_abs(var/num)
|
||||
if(isnum(num))
|
||||
return abs(num)
|
||||
|
||||
// Round down
|
||||
proc/n_floor(var/num)
|
||||
if(isnum(num))
|
||||
return round(num)
|
||||
|
||||
// Round up
|
||||
proc/n_ceil(var/num)
|
||||
if(isnum(num))
|
||||
return round(num)+1
|
||||
|
||||
// Round to nearest integer
|
||||
proc/n_round(var/num)
|
||||
if(isnum(num))
|
||||
if(num-round(num)<0.5)
|
||||
return round(num)
|
||||
return n_ceil(num)
|
||||
|
||||
// Clamps N between min and max
|
||||
proc/n_clamp(var/num, var/min=-1, var/max=1)
|
||||
if(isnum(num)&&isnum(min)&&isnum(max))
|
||||
if(num<=min)
|
||||
return min
|
||||
if(num>=max)
|
||||
return max
|
||||
return num
|
||||
|
||||
// Returns 1 if N is inbetween Min and Max
|
||||
proc/n_inrange(var/num, var/min=-1, var/max=1)
|
||||
if(isnum(num)&&isnum(min)&&isnum(max))
|
||||
return ((min <= num) && (num <= max))
|
||||
// END OF BY DONKIE :(
|
||||
|
||||
// Non-recursive
|
||||
// Imported from Mono string.ReplaceUnchecked
|
||||
|
||||
Reference in New Issue
Block a user