yeehaw it's done
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
/datum/notificationpanel/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.observer_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "notificationpanel", "Notification Preferences", 700, 700, master_ui, state)
|
||||
ui = new(user, src, ui_key, "notificationpanel", "Notification Preferences", 270, 360, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/datum/notificationpanel/ui_data(mob/user)
|
||||
|
||||
@@ -232,14 +232,16 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
var/b_val
|
||||
var/g_val
|
||||
var/color_format = length(input_color)
|
||||
if(color_format != length_char(input_color))
|
||||
return 0
|
||||
if(color_format == 3)
|
||||
r_val = hex2num(copytext(input_color, 1, 2))*16
|
||||
g_val = hex2num(copytext(input_color, 2, 3))*16
|
||||
b_val = hex2num(copytext(input_color, 3, 0))*16
|
||||
r_val = hex2num(copytext(input_color, 1, 2)) * 16
|
||||
g_val = hex2num(copytext(input_color, 2, 3)) * 16
|
||||
b_val = hex2num(copytext(input_color, 3, 0)) * 16
|
||||
else if(color_format == 6)
|
||||
r_val = hex2num(copytext(input_color, 1, 3))
|
||||
g_val = hex2num(copytext(input_color, 3, 5))
|
||||
b_val = hex2num(copytext(input_color, 5, 0))
|
||||
b_val = hex2num(copytext(input_color, 5, 7))
|
||||
else
|
||||
return 0 //If the color format is not 3 or 6, you're using an unexpected way to represent a color.
|
||||
|
||||
@@ -253,7 +255,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
if(b_val > 255)
|
||||
b_val = 255
|
||||
|
||||
return num2hex(r_val, 2) + num2hex(g_val, 2) + num2hex(b_val, 2)
|
||||
return copytext(rgb(r_val, g_val, b_val), 2)
|
||||
|
||||
/*
|
||||
Transfer_mind is there to check if mob is being deleted/not going to have a body.
|
||||
@@ -263,7 +265,7 @@ Works together with spawning an observer, noted above.
|
||||
/mob/proc/ghostize(can_reenter_corpse = TRUE, special = FALSE, penalize = FALSE, voluntary = FALSE)
|
||||
penalize = suiciding || penalize // suicide squad.
|
||||
voluntary_ghosted = voluntary
|
||||
if(!key || cmptext(copytext(key,1,2),"@") || (SEND_SIGNAL(src, COMSIG_MOB_GHOSTIZE, can_reenter_corpse, special, penalize) & COMPONENT_BLOCK_GHOSTING))
|
||||
if(!key || key[1] == "@" || (SEND_SIGNAL(src, COMSIG_MOB_GHOSTIZE, can_reenter_corpse, special, penalize) & COMPONENT_BLOCK_GHOSTING))
|
||||
return //mob has no key, is an aghost or some component hijacked.
|
||||
stop_sound_channel(CHANNEL_HEARTBEAT) //Stop heartbeat sounds because You Are A Ghost Now
|
||||
var/mob/dead/observer/ghost = new(src) // Transfer safety to observer spawning proc.
|
||||
@@ -365,7 +367,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(!can_reenter_corpse)
|
||||
to_chat(src, "<span class='warning'>You cannot re-enter your body.</span>")
|
||||
return
|
||||
if(mind.current.key && copytext(mind.current.key,1,2)!="@") //makes sure we don't accidentally kick any clients
|
||||
if(mind.current.key && mind.current.key[1] != "@") //makes sure we don't accidentally kick any clients
|
||||
to_chat(usr, "<span class='warning'>Another consciousness is in your body...It is resisting you.</span>")
|
||||
return
|
||||
client.change_view(CONFIG_GET(string/default_view))
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
/mob/dead/observer/say(message, bubble_type, var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
message = trim(copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
if (!message)
|
||||
return
|
||||
|
||||
var/message_mode = get_message_mode(message)
|
||||
if(client && (message_mode == MODE_ADMIN || message_mode == MODE_DEADMIN))
|
||||
message = copytext(message, 3)
|
||||
if(findtext(message, " ", 1, 2))
|
||||
message = copytext(message, 2)
|
||||
message = copytext_char(message, 3)
|
||||
message = trim_left(message)
|
||||
|
||||
if(message_mode == MODE_ADMIN)
|
||||
client.cmd_admin_say(message)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
var/param = message
|
||||
var/custom_param = findchar(act, " ")
|
||||
if(custom_param)
|
||||
param = copytext(act, custom_param + 1, length(act) + 1)
|
||||
param = copytext(act, custom_param + length(act[custom_param]))
|
||||
act = copytext(act, 1, custom_param)
|
||||
|
||||
var/datum/emote/E
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
bleed_rate = 0
|
||||
return
|
||||
|
||||
if(bleed_rate <= 0)
|
||||
if(bleed_rate < 0)
|
||||
bleed_rate = 0
|
||||
|
||||
if(HAS_TRAIT(src, TRAIT_NOMARROW)) //Bloodsuckers don't need to be here.
|
||||
@@ -94,12 +94,12 @@
|
||||
|
||||
//We want an accurate reading of .len
|
||||
listclearnulls(BP.embedded_objects)
|
||||
temp_bleed += 0.5*BP.embedded_objects.len
|
||||
temp_bleed += 0.5 * BP.embedded_objects.len
|
||||
|
||||
if(brutedamage >= 20)
|
||||
temp_bleed += (brutedamage * 0.013)
|
||||
|
||||
bleed_rate = max(bleed_rate - 0.50, temp_bleed)//if no wounds, other bleed effects (heparin) naturally decreases
|
||||
bleed_rate = max(bleed_rate - 0.5, temp_bleed)//if no wounds, other bleed effects (heparin) naturally decreases
|
||||
|
||||
if(bleed_rate && !bleedsuppress && !(HAS_TRAIT(src, TRAIT_FAKEDEATH)))
|
||||
bleed(bleed_rate)
|
||||
@@ -185,7 +185,7 @@
|
||||
var/datum/disease/D = thing
|
||||
blood_data["viruses"] += D.Copy()
|
||||
|
||||
blood_data["blood_DNA"] = copytext(dna.unique_enzymes,1,0)
|
||||
blood_data["blood_DNA"] = dna.unique_enzymes
|
||||
blood_data["bloodcolor"] = bloodtype_to_color(dna.blood_type)
|
||||
if(disease_resistances && disease_resistances.len)
|
||||
blood_data["resistances"] = disease_resistances.Copy()
|
||||
@@ -204,7 +204,7 @@
|
||||
|
||||
if(!suiciding)
|
||||
blood_data["cloneable"] = 1
|
||||
blood_data["blood_type"] = copytext(dna.blood_type,1,0)
|
||||
blood_data["blood_type"] = dna.blood_type
|
||||
blood_data["gender"] = gender
|
||||
blood_data["real_name"] = real_name
|
||||
blood_data["features"] = dna.features
|
||||
@@ -289,8 +289,7 @@
|
||||
drop.update_icon()
|
||||
return
|
||||
else
|
||||
temp_blood_DNA = list()
|
||||
temp_blood_DNA |= drop.blood_DNA.Copy() //we transfer the dna from the drip to the splatter
|
||||
temp_blood_DNA = drop.blood_DNA.Copy() //transfer dna from drip to splatter.
|
||||
qdel(drop)//the drip is replaced by a bigger splatter
|
||||
else
|
||||
drop = new(T, get_static_viruses())
|
||||
|
||||
@@ -120,7 +120,8 @@ Des: Removes all infected images from the alien.
|
||||
/mob/living/carbon/alien/proc/RemoveInfectionImages()
|
||||
if (client)
|
||||
for(var/image/I in client.images)
|
||||
if(dd_hasprefix_case(I.icon_state, "infected"))
|
||||
var/searchfor = "infected"
|
||||
if(findtext(I.icon_state, searchfor, 1, length(searchfor) + 1))
|
||||
qdel(I)
|
||||
return
|
||||
|
||||
|
||||
@@ -135,5 +135,6 @@ Des: Removes all images from the mob infected by this embryo
|
||||
for(var/mob/living/carbon/alien/alien in GLOB.player_list)
|
||||
if(alien.client)
|
||||
for(var/image/I in alien.client.images)
|
||||
if(dd_hasprefix_case(I.icon_state, "infected") && I.loc == C)
|
||||
var/searchfor = "infected"
|
||||
if(I.loc == owner && findtext(I.icon_state, searchfor, 1, length(searchfor) + 1))
|
||||
qdel(I)
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
//Gets filled up in create_bodyparts()
|
||||
|
||||
var/list/hand_bodyparts = list() //a collection of arms (or actually whatever the fug /bodyparts you monsters use to wreck my systems)
|
||||
var/list/leg_bodyparts = list()
|
||||
|
||||
var/icon_render_key = ""
|
||||
var/static/list/limb_icon_cache = list()
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
. += SOFTCRIT_ADD_SLOWDOWN
|
||||
|
||||
/mob/living/carbon/slip(knockdown_amount, obj/O, lube)
|
||||
if(movement_type & FLYING)
|
||||
return 0
|
||||
if(movement_type & FLYING && !(lube & FLYING_DOESNT_HELP))
|
||||
return FALSE
|
||||
if(!(lube&SLIDE_ICE))
|
||||
log_combat(src, (O ? O : get_turf(src)), "slipped on the", null, ((lube & SLIDE) ? "(LUBE)" : null))
|
||||
return loc.handle_slip(src, knockdown_amount, O, lube)
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
if(!forced && HAS_TRAIT(src, TRAIT_TOXINLOVER)) //damage becomes healing and healing becomes damage
|
||||
amount = -amount
|
||||
if(amount > 0)
|
||||
blood_volume -= 3*amount // x5 is too much, x3 should be still penalizing enough.
|
||||
blood_volume -= 3 * amount //5x was too much, this is punishing enough.
|
||||
else
|
||||
blood_volume -= amount
|
||||
return ..()
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
. += "<span class='warning'><B>[t_His] eyes are glowing an unnatural red!</B></span>"
|
||||
else if(HAS_TRAIT(src, TRAIT_HIJACKER))
|
||||
var/obj/item/implant/hijack/H = user.getImplant(/obj/item/implant/hijack)
|
||||
if (H && !H.stealthmode)
|
||||
if (H && !H.stealthmode && H.toggled)
|
||||
. += "<b><font color=orange>[t_His] eyes are flickering a bright yellow!</font></b>"
|
||||
|
||||
//ears
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
var/obj/item/clothing/suit/space/space_ninja/SN = wear_suit
|
||||
if(statpanel("SpiderOS"))
|
||||
stat("SpiderOS Status:","[SN.s_initialized ? "Initialized" : "Disabled"]")
|
||||
stat("Current Time:", "[STATION_TIME_TIMESTAMP("hh:mm:ss")]")
|
||||
stat("Current Time:", "[STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)]")
|
||||
if(SN.s_initialized)
|
||||
//Suit gear
|
||||
stat("Energy Charge:", "[round(SN.cell.charge/100)]%")
|
||||
@@ -434,7 +434,7 @@
|
||||
return
|
||||
else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/security))
|
||||
return
|
||||
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, STATION_TIME_TIMESTAMP("hh:mm:ss"))
|
||||
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, STATION_TIME_TIMESTAMP("hh:mm:ss", world.time))
|
||||
GLOB.data_core.addMinorCrime(R.fields["id"], crime)
|
||||
investigate_log("New Minor Crime: <strong>[t1]</strong>: [t2] | Added to [R.fields["name"]] by [key_name(usr)]", INVESTIGATE_RECORDS)
|
||||
to_chat(usr, "<span class='notice'>Successfully added a minor crime.</span>")
|
||||
@@ -450,7 +450,7 @@
|
||||
return
|
||||
else if (!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/security))
|
||||
return
|
||||
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, STATION_TIME_TIMESTAMP("hh:mm:ss"))
|
||||
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, STATION_TIME_TIMESTAMP("hh:mm:ss", world.time))
|
||||
GLOB.data_core.addMajorCrime(R.fields["id"], crime)
|
||||
investigate_log("New Major Crime: <strong>[t1]</strong>: [t2] | Added to [R.fields["name"]] by [key_name(usr)]", INVESTIGATE_RECORDS)
|
||||
to_chat(usr, "<span class='notice'>Successfully added a major crime.</span>")
|
||||
@@ -483,7 +483,7 @@
|
||||
var/counter = 1
|
||||
while(R.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
R.fields[text("com_[]", counter)] = text("Made by [] on [] [], []<BR>[]", allowed_access, STATION_TIME_TIMESTAMP("hh:mm:ss"), time2text(world.realtime, "MMM DD"), GLOB.year_integer, t1)
|
||||
R.fields["com_[counter]"] = "Made by [allowed_access] on [STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)] [time2text(world.realtime, "MMM DD")], [GLOB.year_integer]<BR>[t1]"
|
||||
to_chat(usr, "<span class='notice'>Successfully added comment.</span>")
|
||||
return
|
||||
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
var/obj/effect/decal/cleanable/blood/footprints/oldFP = locate(/obj/effect/decal/cleanable/blood/footprints) in T
|
||||
if(oldFP && (oldFP.blood_state == S.blood_state && oldFP.color == bloodtype_to_color(S.last_bloodtype)))
|
||||
return
|
||||
S.bloody_shoes[S.blood_state] = max(0, S.bloody_shoes[S.blood_state]-BLOOD_LOSS_PER_STEP)
|
||||
S.bloody_shoes[S.blood_state] = max(0, S.bloody_shoes[S.blood_state] - BLOOD_LOSS_PER_STEP)
|
||||
var/obj/effect/decal/cleanable/blood/footprints/FP = new /obj/effect/decal/cleanable/blood/footprints(T)
|
||||
FP.blood_state = S.blood_state
|
||||
FP.entered_dirs |= dir
|
||||
|
||||
@@ -87,30 +87,22 @@
|
||||
/mob/living/carbon/human/proc/forcesay(list/append) //this proc is at the bottom of the file because quote fuckery makes notepad++ cri
|
||||
if(stat == CONSCIOUS)
|
||||
if(client)
|
||||
var/virgin = 1 //has the text been modified yet?
|
||||
var/temp = winget(client, "input", "text")
|
||||
if(findtextEx(temp, "Say \"", 1, 7) && length(temp) > 5) //"case sensitive means
|
||||
var/say_starter = "Say \"" //"
|
||||
if(findtextEx(temp, say_starter, 1, length(say_starter) + 1) && length(temp) > length(say_starter)) //case sensitive means
|
||||
|
||||
temp = replacetext(temp, ";", "") //general radio
|
||||
temp = trim_left(copytext(temp, length(say_starter + 1)))
|
||||
temp = replacetext(temp, ";", "", 1, 2) //general radio
|
||||
while(trim_left(temp)[1] == ":") //dept radio again (necessary)
|
||||
temp = copytext_char(trim_left(temp), 3)
|
||||
|
||||
if(findtext(trim_left(temp), ":", 6, 7)) //dept radio
|
||||
temp = copytext(trim_left(temp), 8)
|
||||
virgin = 0
|
||||
|
||||
if(virgin)
|
||||
temp = copytext(trim_left(temp), 6) //normal speech
|
||||
virgin = 0
|
||||
|
||||
while(findtext(trim_left(temp), ":", 1, 2)) //dept radio again (necessary)
|
||||
temp = copytext(trim_left(temp), 3)
|
||||
|
||||
if(findtext(temp, "*", 1, 2)) //emotes
|
||||
if(temp[1] == "*") //emotes
|
||||
return
|
||||
|
||||
var/trimmed = trim_left(temp)
|
||||
if(length(trimmed))
|
||||
if(append)
|
||||
temp += pick(append)
|
||||
trimmed += pick(append)
|
||||
|
||||
say(temp)
|
||||
say(trimmed)
|
||||
winset(client, "input", "text=[null]")
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
stat = DEAD
|
||||
unset_machine()
|
||||
timeofdeath = world.time
|
||||
tod = STATION_TIME_TIMESTAMP("hh:mm:ss")
|
||||
tod = STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)
|
||||
for(var/obj/item/I in contents)
|
||||
I.on_mob_death(src, gibbed)
|
||||
if(mind)
|
||||
|
||||
@@ -426,17 +426,10 @@
|
||||
message = null
|
||||
|
||||
/datum/emote/living/custom/proc/check_invalid(mob/user, input)
|
||||
. = TRUE
|
||||
if(copytext(input,1,5) == "says")
|
||||
if(stop_bad_mime.Find(input, 1, 1))
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,9) == "exclaims")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,6) == "yells")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,5) == "asks")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else
|
||||
. = FALSE
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/emote/living/custom/run_emote(mob/user, params, type_override = null)
|
||||
if(jobban_isbanned(user, "emote"))
|
||||
@@ -448,7 +441,7 @@
|
||||
to_chat(user, "You cannot send IC messages (muted).")
|
||||
return FALSE
|
||||
else if(!params)
|
||||
var/custom_emote = copytext(sanitize(input("Choose an emote to display.") as message|null), 1, MAX_MESSAGE_LEN) //CIT CHANGE - expands emote textbox
|
||||
var/custom_emote = stripped_multiline_input("Choose an emote to display.", "Custom Emote", null, MAX_MESSAGE_LEN)
|
||||
if(custom_emote && !check_invalid(user, custom_emote))
|
||||
var/type = input("Is this a visible or hearable emote?") as null|anything in list("Visible", "Hearable")
|
||||
switch(type)
|
||||
|
||||
@@ -89,7 +89,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
var/static/list/one_character_prefix = list(MODE_HEADSET = TRUE, MODE_ROBOT = TRUE, MODE_WHISPER = TRUE)
|
||||
|
||||
if(sanitize)
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
message = trim(copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
if(!message || message == "")
|
||||
return
|
||||
|
||||
@@ -99,11 +99,10 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
var/in_critical = InCritical()
|
||||
|
||||
if(one_character_prefix[message_mode])
|
||||
message = copytext(message, 2)
|
||||
message = copytext_char(message, 2)
|
||||
else if(message_mode || saymode)
|
||||
message = copytext(message, 3)
|
||||
if(findtext(message, " ", 1, 2))
|
||||
message = copytext(message, 2)
|
||||
message = copytext_char(message, 3)
|
||||
message = trim_left(message)
|
||||
|
||||
if(message_mode == MODE_ADMIN)
|
||||
if(client)
|
||||
@@ -135,11 +134,10 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
// No, you cannot speak in xenocommon just because you know the key
|
||||
if(can_speak_in_language(message_language))
|
||||
language = message_language
|
||||
message = copytext(message, 3)
|
||||
message = copytext_char(message, 3)
|
||||
|
||||
// Trim the space if they said ",0 I LOVE LANGUAGES"
|
||||
if(findtext(message, " ", 1, 2))
|
||||
message = copytext(message, 2)
|
||||
message = trim_left(message)
|
||||
|
||||
if(!language)
|
||||
language = get_default_language()
|
||||
@@ -167,8 +165,8 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
if(fullcrit)
|
||||
var/health_diff = round(-HEALTH_THRESHOLD_DEAD + health)
|
||||
// If we cut our message short, abruptly end it with a-..
|
||||
var/message_len = length(message)
|
||||
message = copytext(message, 1, health_diff) + "[message_len > health_diff ? "-.." : "..."]"
|
||||
var/message_len = length_char(message)
|
||||
message = copytext_char(message, 1, health_diff) + "[message_len > health_diff ? "-.." : "..."]"
|
||||
message = Ellipsis(message, 10, 1)
|
||||
message_mode = MODE_WHISPER_CRIT
|
||||
succumbed = TRUE
|
||||
@@ -326,13 +324,13 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
return 1
|
||||
|
||||
/mob/living/proc/get_key(message)
|
||||
var/key = copytext(message, 1, 2)
|
||||
var/key = message[1]
|
||||
if(key in GLOB.department_radio_prefixes)
|
||||
return lowertext(copytext(message, 2, 3))
|
||||
return lowertext(message[1 + length(key)])
|
||||
|
||||
/mob/living/proc/get_message_language(message)
|
||||
if(copytext(message, 1, 2) == ",")
|
||||
var/key = copytext(message, 2, 3)
|
||||
if(message[1] == ",")
|
||||
var/key = message[1 + length(message[1])]
|
||||
for(var/ld in GLOB.all_languages)
|
||||
var/datum/language/LD = ld
|
||||
if(initial(LD.key) == key)
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
..()
|
||||
|
||||
/mob/living/silicon/ai/get_message_mode(message)
|
||||
if(copytext(message, 1, 3) in list(":h", ":H", ".h", ".H", "#h", "#H"))
|
||||
var/static/regex/holopad_finder = regex(@"[:.#][hH]")
|
||||
if(holopad_finder.Find(message, 1, 1))
|
||||
return MODE_HOLOPAD
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
/datum/paiCandidate/proc/savefile_path(mob/user)
|
||||
return "data/player_saves/[copytext(user.ckey, 1, 2)]/[user.ckey]/pai.sav"
|
||||
return "data/player_saves/[user.ckey[1]]/[user.ckey]/pai.sav"
|
||||
|
||||
/datum/paiCandidate/proc/savefile_save(mob/user)
|
||||
if(IsGuestKey(user.key))
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
icon_state = "mulebot0"
|
||||
density = TRUE
|
||||
move_resist = MOVE_FORCE_STRONG
|
||||
animate_movement = 1
|
||||
animate_movement = FORWARD_STEPS
|
||||
health = 50
|
||||
maxHealth = 50
|
||||
damage_coeff = list(BRUTE = 0.5, BURN = 0.7, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0)
|
||||
@@ -29,10 +29,14 @@
|
||||
model = "MULE"
|
||||
bot_core_type = /obj/machinery/bot_core/mulebot
|
||||
|
||||
var/ui_x = 350
|
||||
var/ui_y = 425
|
||||
|
||||
var/id
|
||||
|
||||
path_image_color = "#7F5200"
|
||||
|
||||
var/base_icon = "mulebot"
|
||||
var/atom/movable/load = null
|
||||
var/mob/living/passenger = null
|
||||
var/turf/target // this is turf to navigate to (location of beacon)
|
||||
@@ -74,16 +78,16 @@
|
||||
/mob/living/simple_animal/bot/mulebot/proc/set_id(new_id)
|
||||
id = new_id
|
||||
if(paicard)
|
||||
bot_name = "\improper MULEbot ([new_id])"
|
||||
bot_name = "[initial(name)] ([new_id])"
|
||||
else
|
||||
name = "\improper MULEbot ([new_id])"
|
||||
name = "[initial(name)] ([new_id])"
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/bot_reset()
|
||||
..()
|
||||
reached_target = 0
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/screwdriver))
|
||||
if(I.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
..()
|
||||
if(open)
|
||||
on = FALSE
|
||||
@@ -91,13 +95,13 @@
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
cell = I
|
||||
visible_message("[user] inserts a cell into [src].",
|
||||
visible_message("<span class='notice'>[user] inserts a cell into [src].</span>",
|
||||
"<span class='notice'>You insert the new cell into [src].</span>")
|
||||
else if(istype(I, /obj/item/crowbar) && open && cell)
|
||||
else if(I.tool_behaviour == TOOL_CROWBAR && open && cell)
|
||||
cell.add_fingerprint(usr)
|
||||
cell.forceMove(loc)
|
||||
cell = null
|
||||
visible_message("[user] crowbars out the power cell from [src].",
|
||||
visible_message("<span class='notice'>[user] crowbars out the power cell from [src].</span>",
|
||||
"<span class='notice'>You pry the powercell out of [src].</span>")
|
||||
else if(is_wire_tool(I) && open)
|
||||
return attack_hand(user)
|
||||
@@ -115,21 +119,19 @@
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/emag_act(mob/user)
|
||||
. = SEND_SIGNAL(src, COMSIG_ATOM_EMAG_ACT)
|
||||
if(emagged < 1)
|
||||
emagged = TRUE
|
||||
if(!open)
|
||||
locked = !locked
|
||||
to_chat(user, "<span class='notice'>You [locked ? "lock" : "unlock"] [src]'s controls!</span>")
|
||||
flick("mulebot-emagged", src)
|
||||
playsound(src, "sparks", 100, 0)
|
||||
return TRUE
|
||||
playsound(src, "sparks", 100, FALSE)
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/update_icon()
|
||||
if(open)
|
||||
icon_state="mulebot-hatch"
|
||||
icon_state="[base_icon]-hatch"
|
||||
else
|
||||
icon_state = "mulebot[wires.is_cut(WIRE_AVOIDANCE)]"
|
||||
icon_state = "[base_icon][wires.is_cut(WIRE_AVOIDANCE)]"
|
||||
cut_overlays()
|
||||
if(load && !ismob(load))//buckling handles the mob offsets
|
||||
load.pixel_y = initial(load.pixel_y) + 9
|
||||
@@ -152,7 +154,7 @@
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/bullet_act(obj/item/projectile/Proj)
|
||||
. = ..()
|
||||
if(. == BULLET_ACT_HIT && !QDELETED(src)) //Got hit and not blown up yet.)
|
||||
if(. && !QDELETED(src)) //Got hit and not blown up yet.
|
||||
if(prob(50) && !isnull(load))
|
||||
unload(0)
|
||||
if(prob(25))
|
||||
@@ -171,7 +173,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "mulebot", name, 600, 375, master_ui, state)
|
||||
ui = new(user, src, ui_key, "mulebot", name, ui_x, ui_y, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/ui_data(mob/user)
|
||||
@@ -191,12 +193,15 @@
|
||||
else
|
||||
data["load"] = load ? load.name : null
|
||||
data["destination"] = destination ? destination : null
|
||||
data["home"] = home_destination
|
||||
data["destinations"] = GLOB.deliverybeacontags
|
||||
data["cell"] = cell ? TRUE : FALSE
|
||||
data["cellPercent"] = cell ? cell.percent() : null
|
||||
data["autoReturn"] = auto_return
|
||||
data["autoPickup"] = auto_pickup
|
||||
data["reportDelivery"] = report_delivery
|
||||
data["haspai"] = paicard ? TRUE : FALSE
|
||||
data["id"] = id
|
||||
return data
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/ui_act(action, params)
|
||||
@@ -216,10 +221,10 @@
|
||||
return
|
||||
. = TRUE
|
||||
else
|
||||
bot_control(action, usr) // Kill this later.
|
||||
bot_control(action, usr, params) // Kill this later.
|
||||
. = TRUE
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/bot_control(command, mob/user, pda = FALSE)
|
||||
/mob/living/simple_animal/bot/mulebot/bot_control(command, mob/user, list/params = list(), pda = FALSE)
|
||||
if(pda && wires.is_cut(WIRE_RX)) // MULE wireless is controlled by wires.
|
||||
return
|
||||
|
||||
@@ -234,15 +239,27 @@
|
||||
if(mode == BOT_IDLE || mode == BOT_DELIVER)
|
||||
start_home()
|
||||
if("destination")
|
||||
var/new_dest = input(user, "Enter Destination:", name, destination) as null|anything in GLOB.deliverybeacontags
|
||||
var/new_dest
|
||||
if(pda)
|
||||
new_dest = input(user, "Enter Destination:", name, destination) as null|anything in GLOB.deliverybeacontags
|
||||
else
|
||||
new_dest = params["value"]
|
||||
if(new_dest)
|
||||
set_destination(new_dest)
|
||||
if("setid")
|
||||
var/new_id = stripped_input(user, "Enter ID:", name, id, MAX_NAME_LEN)
|
||||
var/new_id
|
||||
if(pda)
|
||||
new_id = stripped_input(user, "Enter ID:", name, id, MAX_NAME_LEN)
|
||||
else
|
||||
new_id = params["value"]
|
||||
if(new_id)
|
||||
set_id(new_id)
|
||||
if("sethome")
|
||||
var/new_home = input(user, "Enter Home:", name, home_destination) as null|anything in GLOB.deliverybeacontags
|
||||
var/new_home
|
||||
if(pda)
|
||||
new_home = input(user, "Enter Home:", name, home_destination) as null|anything in GLOB.deliverybeacontags
|
||||
else
|
||||
new_home = params["value"]
|
||||
if(new_home)
|
||||
home_destination = new_home
|
||||
if("unload")
|
||||
@@ -317,26 +334,28 @@
|
||||
/mob/living/simple_animal/bot/mulebot/proc/buzz(type)
|
||||
switch(type)
|
||||
if(SIGH)
|
||||
audible_message("[src] makes a sighing buzz.", "<span class='italics'>You hear an electronic buzzing sound.</span>")
|
||||
playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
|
||||
audible_message("<span class='hear'>[src] makes a sighing buzz.</span>")
|
||||
playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, FALSE)
|
||||
if(ANNOYED)
|
||||
audible_message("[src] makes an annoyed buzzing sound.", "<span class='italics'>You hear an electronic buzzing sound.</span>")
|
||||
playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0)
|
||||
audible_message("<span class='hear'>[src] makes an annoyed buzzing sound.</span>")
|
||||
playsound(loc, 'sound/machines/buzz-two.ogg', 50, FALSE)
|
||||
if(DELIGHT)
|
||||
audible_message("[src] makes a delighted ping!", "<span class='italics'>You hear a ping.</span>")
|
||||
playsound(loc, 'sound/machines/ping.ogg', 50, 0)
|
||||
audible_message("<span class='hear'>[src] makes a delighted ping!</span>")
|
||||
playsound(loc, 'sound/machines/ping.ogg', 50, FALSE)
|
||||
|
||||
|
||||
// mousedrop a crate to load the bot
|
||||
// can load anything if hacked
|
||||
/mob/living/simple_animal/bot/mulebot/MouseDrop_T(atom/movable/AM, mob/user)
|
||||
|
||||
if(user.incapacitated() || user.lying)
|
||||
return
|
||||
|
||||
if(!istype(AM))
|
||||
return
|
||||
|
||||
if(!istype(AM) || isdead(AM) || iscameramob(AM) || istype(AM, /obj/effect/dummy/phased_mob))
|
||||
return
|
||||
|
||||
load(AM)
|
||||
|
||||
// called to load a crate
|
||||
@@ -449,10 +468,8 @@
|
||||
process_bot()
|
||||
num_steps--
|
||||
if(mode != BOT_IDLE)
|
||||
spawn(0)
|
||||
for(var/i=num_steps,i>0,i--)
|
||||
sleep(2)
|
||||
process_bot()
|
||||
var/process_timer = addtimer(CALLBACK(src, .proc/process_bot), 2, TIMER_LOOP|TIMER_STOPPABLE)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, /proc/deltimer, process_timer), (num_steps*2) + 1)
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/proc/process_bot()
|
||||
if(!on || client)
|
||||
@@ -477,7 +494,7 @@
|
||||
if(isturf(next))
|
||||
if(bloodiness)
|
||||
var/obj/effect/decal/cleanable/blood/tracks/B = new(loc)
|
||||
if(blood_DNA && blood_DNA.len)
|
||||
if(length(blood_DNA))
|
||||
B.blood_DNA |= blood_DNA.Copy()
|
||||
var/newdir = get_dir(next, loc)
|
||||
if(newdir == dir)
|
||||
@@ -491,6 +508,7 @@
|
||||
B.setDir(newdir)
|
||||
bloodiness--
|
||||
|
||||
|
||||
var/oldloc = loc
|
||||
var/moved = step_towards(src, next) // attempt to move
|
||||
if(cell)
|
||||
@@ -516,11 +534,7 @@
|
||||
buzz(SIGH)
|
||||
mode = BOT_WAIT_FOR_NAV
|
||||
blockcount = 0
|
||||
spawn(20)
|
||||
calc_path(avoid=next)
|
||||
if(path.len > 0)
|
||||
buzz(DELIGHT)
|
||||
mode = BOT_BLOCKED
|
||||
addtimer(CALLBACK(src, .proc/process_blocked, next), 2 SECONDS)
|
||||
return
|
||||
return
|
||||
else
|
||||
@@ -533,18 +547,26 @@
|
||||
|
||||
if(BOT_NAV) // calculate new path
|
||||
mode = BOT_WAIT_FOR_NAV
|
||||
spawn(0)
|
||||
calc_path()
|
||||
INVOKE_ASYNC(src, .proc/process_nav)
|
||||
|
||||
if(path.len > 0)
|
||||
blockcount = 0
|
||||
mode = BOT_BLOCKED
|
||||
buzz(DELIGHT)
|
||||
/mob/living/simple_animal/bot/mulebot/proc/process_blocked(turf/next)
|
||||
calc_path(avoid=next)
|
||||
if(path.len > 0)
|
||||
buzz(DELIGHT)
|
||||
mode = BOT_BLOCKED
|
||||
|
||||
else
|
||||
buzz(SIGH)
|
||||
/mob/living/simple_animal/bot/mulebot/proc/process_nav()
|
||||
calc_path()
|
||||
|
||||
mode = BOT_NO_ROUTE
|
||||
if(path.len > 0)
|
||||
blockcount = 0
|
||||
mode = BOT_BLOCKED
|
||||
buzz(DELIGHT)
|
||||
|
||||
else
|
||||
buzz(SIGH)
|
||||
|
||||
mode = BOT_NO_ROUTE
|
||||
|
||||
// calculates a path to the current destination
|
||||
// given an optional turf to avoid
|
||||
@@ -574,26 +596,28 @@
|
||||
/mob/living/simple_animal/bot/mulebot/proc/start_home()
|
||||
if(!on)
|
||||
return
|
||||
spawn(0)
|
||||
set_destination(home_destination)
|
||||
mode = BOT_BLOCKED
|
||||
INVOKE_ASYNC(src, .proc/do_start_home)
|
||||
update_icon()
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/proc/do_start_home()
|
||||
set_destination(home_destination)
|
||||
mode = BOT_BLOCKED
|
||||
|
||||
// called when bot reaches current target
|
||||
/mob/living/simple_animal/bot/mulebot/proc/at_target()
|
||||
if(!reached_target)
|
||||
radio_channel = "Supply" //Supply channel
|
||||
audible_message("[src] makes a chiming sound!", "<span class='italics'>You hear a chime.</span>")
|
||||
playsound(loc, 'sound/machines/chime.ogg', 50, 0)
|
||||
radio_channel = RADIO_CHANNEL_SUPPLY //Supply channel
|
||||
audible_message("<span class='hear'>[src] makes a chiming sound!</span>")
|
||||
playsound(loc, 'sound/machines/chime.ogg', 50, FALSE)
|
||||
reached_target = 1
|
||||
|
||||
if(pathset) //The AI called us here, so notify it of our arrival.
|
||||
loaddir = dir //The MULE will attempt to load a crate in whatever direction the MULE is "facing".
|
||||
if(calling_ai)
|
||||
to_chat(calling_ai, "<span class='notice'>[icon2html(src, calling_ai)] [src] wirelessly plays a chiming sound!</span>")
|
||||
playsound(calling_ai, 'sound/machines/chime.ogg',40, 0)
|
||||
playsound(calling_ai, 'sound/machines/chime.ogg',40, FALSE)
|
||||
calling_ai = null
|
||||
radio_channel = "AI Private" //Report on AI Private instead if the AI is controlling us.
|
||||
radio_channel = RADIO_CHANNEL_AI_PRIVATE //Report on AI Private instead if the AI is controlling us.
|
||||
|
||||
if(load) // if loaded, unload at target
|
||||
if(report_delivery)
|
||||
@@ -645,7 +669,7 @@
|
||||
log_combat(src, H, "run over", null, "(DAMTYPE: [uppertext(BRUTE)])")
|
||||
H.visible_message("<span class='danger'>[src] drives over [H]!</span>", \
|
||||
"<span class='userdanger'>[src] drives over you!</span>")
|
||||
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
|
||||
playsound(loc, 'sound/effects/splat.ogg', 50, TRUE)
|
||||
|
||||
var/damage = rand(5,15)
|
||||
H.apply_damage(2*damage, BRUTE, BODY_ZONE_HEAD, run_armor_check(BODY_ZONE_HEAD, "melee"))
|
||||
@@ -734,7 +758,7 @@
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/insertpai(mob/user, obj/item/paicard/card)
|
||||
if(..())
|
||||
visible_message("[src] safeties are locked on.")
|
||||
visible_message("<span class='notice'>[src] safeties are locked on.</span>")
|
||||
|
||||
#undef SIGH
|
||||
#undef ANNOYED
|
||||
@@ -742,3 +766,4 @@
|
||||
|
||||
/obj/machinery/bot_core/mulebot
|
||||
req_access = list(ACCESS_CARGO)
|
||||
|
||||
@@ -130,10 +130,6 @@
|
||||
hacked = TRUE
|
||||
visualAppearence = CLOCKDRONE
|
||||
can_be_held = FALSE
|
||||
mouse_opacity = MOUSE_OPACITY_OPAQUE
|
||||
flavortext = "<b><span class='nezbere'>You are a cogscarab,</span> a tiny building construct of Ratvar. While you're weak and can't recite scripture, \
|
||||
you have a set of quick tools, as well as a replica fabricator that can create brass and convert objects.<br><br>Work with the servants of Ratvar \
|
||||
to construct and maintain defenses at the City of Cogs. If there are no servants, use this time to experiment with base designs!"
|
||||
|
||||
/mob/living/simple_animal/drone/cogscarab/ratvar //a subtype for spawning when ratvar is alive, has a slab that it can use and a normal fabricator
|
||||
default_storage = /obj/item/storage/toolbox/brass/prefilled/ratvar
|
||||
|
||||
@@ -208,8 +208,8 @@
|
||||
ears.forceMove(drop_location())
|
||||
ears = null
|
||||
for(var/possible_phrase in speak)
|
||||
if(copytext(possible_phrase,1,3) in GLOB.department_radio_keys)
|
||||
possible_phrase = copytext(possible_phrase,3)
|
||||
if(copytext_char(possible_phrase, 2, 3) in GLOB.department_radio_keys)
|
||||
possible_phrase = copytext_char(possible_phrase, 3)
|
||||
|
||||
//Adding things to inventory
|
||||
else if(href_list["add_inv"])
|
||||
@@ -332,8 +332,8 @@
|
||||
speak_chance *= 1.27 // 20 crackers to go from 1% to 100%
|
||||
speech_shuffle_rate += 10
|
||||
to_chat(user, "<span class='notice'>[src] eagerly devours the cracker.</span>")
|
||||
..()
|
||||
return
|
||||
return // the cracker was deleted
|
||||
return ..()
|
||||
|
||||
//Bullets
|
||||
/mob/living/simple_animal/parrot/bullet_act(obj/item/projectile/Proj)
|
||||
@@ -419,8 +419,8 @@
|
||||
if(prob(50))
|
||||
useradio = 1
|
||||
|
||||
if((copytext(possible_phrase,1,2) in GLOB.department_radio_prefixes) && (copytext(possible_phrase,2,3) in GLOB.department_radio_keys))
|
||||
possible_phrase = "[useradio?pick(available_channels):""][copytext(possible_phrase,3)]" //crop out the channel prefix
|
||||
if((possible_phrase[1] in GLOB.department_radio_prefixes) && (copytext_char(possible_phrase, 2, 3) in GLOB.department_radio_keys))
|
||||
possible_phrase = "[useradio?pick(available_channels):""][copytext_char(possible_phrase, 3)]" //crop out the channel prefix
|
||||
else
|
||||
possible_phrase = "[useradio?pick(available_channels):""][possible_phrase]"
|
||||
|
||||
@@ -428,8 +428,8 @@
|
||||
|
||||
else //If we have no headset or channels to use, dont try to use any!
|
||||
for(var/possible_phrase in speak)
|
||||
if((copytext(possible_phrase,1,2) in GLOB.department_radio_prefixes) && (copytext(possible_phrase,2,3) in GLOB.department_radio_keys))
|
||||
possible_phrase = copytext(possible_phrase,3) //crop out the channel prefix
|
||||
if((possible_phrase[1] in GLOB.department_radio_prefixes) && (copytext_char(possible_phrase, 2, 3) in GLOB.department_radio_keys))
|
||||
possible_phrase = copytext_char(possible_phrase, 3) //crop out the channel prefix
|
||||
newspeak.Add(possible_phrase)
|
||||
speak = newspeak
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
emote("deathgasp")
|
||||
ADD_TRAIT(src, TRAIT_FAKEDEATH, source)
|
||||
ADD_TRAIT(src, TRAIT_DEATHCOMA, source)
|
||||
tod = STATION_TIME_TIMESTAMP("hh:mm:ss")
|
||||
tod = STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)
|
||||
update_stat()
|
||||
|
||||
/mob/living/proc/unignore_slowdown(list/sources)
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
if(!client)
|
||||
return
|
||||
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = copytext_char(msg, 1, MAX_MESSAGE_LEN)
|
||||
|
||||
if(type)
|
||||
if(type & MSG_VISUAL && eye_blind )//Vision related
|
||||
@@ -414,7 +414,7 @@ mob/visible_message(message, self_message, blind_message, vision_distance = DEFA
|
||||
set name = "Add Note"
|
||||
set category = "IC"
|
||||
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = copytext_char(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = sanitize(msg)
|
||||
|
||||
if(mind)
|
||||
|
||||
+141
-148
@@ -42,128 +42,131 @@
|
||||
else
|
||||
return 0
|
||||
|
||||
/proc/stars(n, pr)
|
||||
n = html_encode(n)
|
||||
if (pr == null)
|
||||
pr = 25
|
||||
if (pr <= 0)
|
||||
return null
|
||||
else
|
||||
if (pr >= 100)
|
||||
return n
|
||||
var/te = n
|
||||
var/t = ""
|
||||
n = length(n)
|
||||
var/p = null
|
||||
p = 1
|
||||
while(p <= n)
|
||||
if ((copytext(te, p, p + 1) == " " || prob(pr)))
|
||||
t = text("[][]", t, copytext(te, p, p + 1))
|
||||
/**
|
||||
* Convert random parts of a passed in message to stars
|
||||
*
|
||||
* * phrase - the string to convert
|
||||
* * probability - probability any character gets changed
|
||||
*
|
||||
* This proc is dangerously laggy, avoid it or die
|
||||
*/
|
||||
/proc/stars(phrase, probability = 25)
|
||||
if(probability <= 0)
|
||||
return phrase
|
||||
phrase = html_decode(phrase)
|
||||
var/leng = length(phrase)
|
||||
. = ""
|
||||
var/char = ""
|
||||
for(var/i = 1, i <= leng, i += length(char))
|
||||
char = phrase[i]
|
||||
if(char == " " || !prob(probability))
|
||||
. += char
|
||||
else
|
||||
t = text("[]*", t)
|
||||
p++
|
||||
return sanitize(t)
|
||||
. += "*"
|
||||
return sanitize(.)
|
||||
|
||||
/proc/slur(n,var/strength=50)
|
||||
strength = min(strength,50)
|
||||
var/phrase = html_decode(n)
|
||||
/**
|
||||
* Makes you speak like you're drunk
|
||||
*/
|
||||
/proc/slur(phrase, strength = 50)
|
||||
strength = min(50, strength)
|
||||
phrase = html_decode(phrase)
|
||||
var/leng = length(phrase)
|
||||
var/counter=length(phrase)
|
||||
var/newphrase=""
|
||||
var/newletter=""
|
||||
while(counter>=1)
|
||||
newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2)
|
||||
if(rand(1,100)<=strength*0.5)
|
||||
if(lowertext(newletter)=="o")
|
||||
newletter="u"
|
||||
if(lowertext(newletter)=="s")
|
||||
newletter="ch"
|
||||
if(lowertext(newletter)=="a")
|
||||
newletter="ah"
|
||||
if(lowertext(newletter)=="u")
|
||||
newletter="oo"
|
||||
if(lowertext(newletter)=="c")
|
||||
newletter="k"
|
||||
if(rand(1,100) <= strength*0.25)
|
||||
if(newletter==" ")
|
||||
newletter="...huuuhhh..."
|
||||
if(newletter==".")
|
||||
newletter=" BURP!"
|
||||
if(rand(1,100) <= strength*0.5)
|
||||
if(rand(1,5) == 1)
|
||||
newletter+="'"
|
||||
if(rand(1,5) == 1)
|
||||
newletter+="[newletter]"
|
||||
if(rand(1,5) == 1)
|
||||
newletter+="[newletter][newletter]"
|
||||
newphrase+="[newletter]";counter-=1
|
||||
return newphrase
|
||||
|
||||
|
||||
/proc/cultslur(n) // Inflicted on victims of a stun talisman
|
||||
var/phrase = html_decode(n)
|
||||
var/leng = length(phrase)
|
||||
var/counter=length(phrase)
|
||||
var/newphrase=""
|
||||
var/newletter=""
|
||||
while(counter>=1)
|
||||
newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2)
|
||||
if(rand(1,2)==2)
|
||||
if(lowertext(newletter)=="o")
|
||||
newletter="u"
|
||||
if(lowertext(newletter)=="t")
|
||||
newletter="ch"
|
||||
if(lowertext(newletter)=="a")
|
||||
newletter="ah"
|
||||
if(lowertext(newletter)=="u")
|
||||
newletter="oo"
|
||||
if(lowertext(newletter)=="c")
|
||||
newletter=" NAR "
|
||||
if(lowertext(newletter)=="s")
|
||||
newletter=" SIE "
|
||||
if(rand(1,4)==4)
|
||||
if(newletter==" ")
|
||||
newletter=" no hope... "
|
||||
if(newletter=="H")
|
||||
newletter=" IT COMES... "
|
||||
|
||||
switch(rand(1,15))
|
||||
. = ""
|
||||
var/newletter = ""
|
||||
var/rawchar = ""
|
||||
for(var/i = 1, i <= leng, i += length(rawchar))
|
||||
rawchar = newletter = phrase[i]
|
||||
if(rand(1,100)<=strength * 0.5)
|
||||
var/lowerletter = lowertext(newletter)
|
||||
if(lowerletter == "o")
|
||||
newletter = "u"
|
||||
else if(lowerletter == "s")
|
||||
newletter = "ch"
|
||||
else if(lowerletter == "a")
|
||||
newletter = "ah"
|
||||
else if(lowerletter == "u")
|
||||
newletter = "oo"
|
||||
else if(lowerletter == "c")
|
||||
newletter = "k"
|
||||
if(rand(1,100) <= strength * 0.25)
|
||||
if(newletter == " ")
|
||||
newletter = "...huuuhhh..."
|
||||
else if(newletter == ".")
|
||||
newletter = " *BURP*."
|
||||
switch(rand(1,100) <= strength * 0.5)
|
||||
if(1)
|
||||
newletter="'"
|
||||
newletter += "'"
|
||||
if(10)
|
||||
newletter += "[newletter]"
|
||||
if(20)
|
||||
newletter += "[newletter][newletter]"
|
||||
. += "[newletter]"
|
||||
return sanitize(.)
|
||||
|
||||
/// Makes you talk like you got cult stunned, which is slurring but with some dark messages
|
||||
/proc/cultslur(phrase) // Inflicted on victims of a stun talisman
|
||||
phrase = html_decode(phrase)
|
||||
var/leng = length(phrase)
|
||||
. = ""
|
||||
var/newletter = ""
|
||||
var/rawchar = ""
|
||||
for(var/i = 1, i <= leng, i += length(rawchar))
|
||||
rawchar = newletter = phrase[i]
|
||||
if(rand(1, 2) == 2)
|
||||
var/lowerletter = lowertext(newletter)
|
||||
if(lowerletter == "o")
|
||||
newletter = "u"
|
||||
else if(lowerletter == "t")
|
||||
newletter = "ch"
|
||||
else if(lowerletter == "a")
|
||||
newletter = "ah"
|
||||
else if(lowerletter == "u")
|
||||
newletter = "oo"
|
||||
else if(lowerletter == "c")
|
||||
newletter = " NAR "
|
||||
else if(lowerletter == "s")
|
||||
newletter = " SIE "
|
||||
if(rand(1, 4) == 4)
|
||||
if(newletter == " ")
|
||||
newletter = " no hope... "
|
||||
else if(newletter == "H")
|
||||
newletter = " IT COMES... "
|
||||
|
||||
switch(rand(1, 15))
|
||||
if(1)
|
||||
newletter = "'"
|
||||
if(2)
|
||||
newletter+="agn"
|
||||
newletter += "agn"
|
||||
if(3)
|
||||
newletter="fth"
|
||||
newletter = "fth"
|
||||
if(4)
|
||||
newletter="nglu"
|
||||
newletter = "nglu"
|
||||
if(5)
|
||||
newletter="glor"
|
||||
newphrase+="[newletter]";counter-=1
|
||||
return newphrase
|
||||
newletter = "glor"
|
||||
. += newletter
|
||||
return sanitize(.)
|
||||
|
||||
|
||||
/proc/stutter(n)
|
||||
var/te = html_decode(n)
|
||||
var/t = ""//placed before the message. Not really sure what it's for.
|
||||
n = length(n)//length of the entire word
|
||||
var/p = null
|
||||
p = 1//1 is the start of any word
|
||||
while(p <= n)//while P, which starts at 1 is less or equal to N which is the length.
|
||||
var/n_letter = copytext(te, p, p + 1)//copies text from a certain distance. In this case, only one letter at a time.
|
||||
if (prob(80) && (ckey(n_letter) in list("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z")))
|
||||
if (prob(10))
|
||||
n_letter = text("[n_letter]-[n_letter]-[n_letter]-[n_letter]")//replaces the current letter with this instead.
|
||||
///Adds stuttering to the message passed in
|
||||
/proc/stutter(phrase)
|
||||
phrase = html_decode(phrase)
|
||||
var/leng = length(phrase)
|
||||
. = ""
|
||||
var/newletter = ""
|
||||
var/rawchar
|
||||
for(var/i = 1, i <= leng, i += length(rawchar))
|
||||
rawchar = newletter = phrase[i]
|
||||
if(prob(80) && !(lowertext(newletter) in list("a", "e", "i", "o", "u", " ")))
|
||||
if(prob(10))
|
||||
newletter = "[newletter]-[newletter]-[newletter]-[newletter]"
|
||||
else if(prob(20))
|
||||
newletter = "[newletter]-[newletter]-[newletter]"
|
||||
else if (prob(5))
|
||||
newletter = ""
|
||||
else
|
||||
if (prob(20))
|
||||
n_letter = text("[n_letter]-[n_letter]-[n_letter]")
|
||||
else
|
||||
if (prob(5))
|
||||
n_letter = null
|
||||
else
|
||||
n_letter = text("[n_letter]-[n_letter]")
|
||||
t = text("[t][n_letter]")//since the above is ran through for each letter, the text just adds up back to the original word.
|
||||
p++//for each letter p is increased to find where the next letter will be.
|
||||
return copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
newletter = "[newletter]-[newletter]"
|
||||
. += newletter
|
||||
return sanitize(.)
|
||||
|
||||
/proc/derpspeech(message, stuttering)
|
||||
message = replacetext(message, " am ", " ")
|
||||
@@ -183,52 +186,42 @@
|
||||
return message
|
||||
|
||||
|
||||
/proc/Gibberish(t, p)//t is the inputted message, and any value higher than 70 for p will cause letters to be replaced instead of added
|
||||
/* Turn text into complete gibberish! */
|
||||
var/returntext = ""
|
||||
for(var/i = 1, i <= length(t), i++)
|
||||
|
||||
var/letter = copytext(t, i, i+1)
|
||||
if(prob(50))
|
||||
if(p >= 70)
|
||||
/proc/Gibberish(text, replace_characters = FALSE, chance = 50)
|
||||
text = html_decode(text)
|
||||
. = ""
|
||||
var/rawchar = ""
|
||||
var/letter = ""
|
||||
var/lentext = length(text)
|
||||
for(var/i = 1, i <= lentext, i += length(rawchar))
|
||||
rawchar = letter = text[i]
|
||||
if(prob(chance))
|
||||
if(replace_characters)
|
||||
letter = ""
|
||||
for(var/j in 1 to rand(0, 2))
|
||||
letter += pick("#", "@", "*", "&", "%", "$", "/", "<", ">", ";", "*", "*", "*", "*", "*", "*", "*")
|
||||
. += letter
|
||||
return sanitize(.)
|
||||
|
||||
for(var/j = 1, j <= rand(0, 2), j++)
|
||||
letter += pick("#","@","*","&","%","$","/", "<", ">", ";","*","*","*","*","*","*","*")
|
||||
|
||||
returntext += letter
|
||||
|
||||
return returntext
|
||||
|
||||
|
||||
/proc/ninjaspeak(n) //NINJACODE
|
||||
/*
|
||||
The difference with stutter is that this proc can stutter more than 1 letter
|
||||
The issue here is that anything that does not have a space is treated as one word (in many instances). For instance, "LOOKING," is a word, including the comma.
|
||||
It's fairly easy to fix if dealing with single letters but not so much with compounds of letters./N
|
||||
*/
|
||||
var/te = html_decode(n)
|
||||
var/t = ""
|
||||
n = length(n)
|
||||
var/p = 1
|
||||
while(p <= n)
|
||||
var/n_letter
|
||||
var/n_mod = rand(1,4)
|
||||
if(p+n_mod>n+1)
|
||||
n_letter = copytext(te, p, n+1)
|
||||
else
|
||||
n_letter = copytext(te, p, p+n_mod)
|
||||
/proc/ninjaspeak(phrase) //NINJACODE
|
||||
. = ""
|
||||
var/lentext = length_char(phrase)
|
||||
var/rawchars = ""
|
||||
var/letter = ""
|
||||
for(var/i = 1, i <= lentext, i += length_char(rawchars))
|
||||
var/end = i + rand(1,4)
|
||||
letter = rawchars = copytext_char(phrase, i, end > lentext ? 0 : end)
|
||||
if (prob(50))
|
||||
if (prob(30))
|
||||
n_letter = text("[n_letter]-[n_letter]-[n_letter]")
|
||||
letter = "[letter]-[letter]-[letter]"
|
||||
else
|
||||
n_letter = text("[n_letter]-[n_letter]")
|
||||
else
|
||||
n_letter = text("[n_letter]")
|
||||
t = text("[t][n_letter]")
|
||||
p=p+n_mod
|
||||
return copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
|
||||
letter = "[letter]-[letter]"
|
||||
. += letter
|
||||
return copytext_char(sanitize(.),1,MAX_MESSAGE_LEN)
|
||||
|
||||
/proc/shake_camera(mob/M, duration, strength=1)
|
||||
if(!M || !M.client || duration < 1)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
var/customsayverb = findtext(input, "*")
|
||||
if(customsayverb && message_mode != MODE_WHISPER_CRIT)
|
||||
message_mode = MODE_CUSTOM_SAY
|
||||
return lowertext(copytext(input, 1, customsayverb))
|
||||
return lowertext(copytext_char(input, 1, customsayverb))
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
|
||||
return
|
||||
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
message = trim(copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
|
||||
usr.emote("me",1,message,TRUE)
|
||||
|
||||
@@ -83,9 +83,9 @@
|
||||
deadchat_broadcast(rendered, follow_target = src, speaker_key = key)
|
||||
|
||||
/mob/proc/check_emote(message)
|
||||
if(copytext(message, 1, 2) == "*")
|
||||
emote(copytext(message, 2), intentional = TRUE)
|
||||
return 1
|
||||
if(message[1] == "*")
|
||||
emote(copytext(message, length(message[1]) + 1), intentional = TRUE)
|
||||
return TRUE
|
||||
|
||||
/mob/proc/hivecheck()
|
||||
return 0
|
||||
@@ -94,11 +94,11 @@
|
||||
return LINGHIVE_NONE
|
||||
|
||||
/mob/proc/get_message_mode(message)
|
||||
var/key = copytext(message, 1, 2)
|
||||
var/key = message[1]
|
||||
if(key == "#")
|
||||
return MODE_WHISPER
|
||||
else if(key == ";")
|
||||
return MODE_HEADSET
|
||||
else if(length(message) > 2 && (key in GLOB.department_radio_prefixes))
|
||||
var/key_symbol = lowertext(copytext(message, 2, 3))
|
||||
else if((length(message) > (length(key) + 1)) && (key in GLOB.department_radio_prefixes))
|
||||
var/key_symbol = lowertext(message[length(key) + 1])
|
||||
return GLOB.department_radio_keys[key_symbol]
|
||||
|
||||
+18
-38
@@ -9,25 +9,19 @@
|
||||
set src in usr
|
||||
if(usr != src)
|
||||
to_chat(usr, "No.")
|
||||
var/msg = stripped_multiline_input(usr, "Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!", "Flavor Text", html_decode(flavor_text), MAX_MESSAGE_LEN*2, TRUE)
|
||||
var/msg = stripped_multiline_input(usr, "Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!", "Flavor Text", html_decode(flavor_text), MAX_MESSAGE_LEN, TRUE)
|
||||
|
||||
if(!isnull(msg))
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
|
||||
flavor_text = msg
|
||||
if(msg)
|
||||
flavor_text = html_encode(msg)
|
||||
|
||||
/mob/proc/update_flavor_text_2()
|
||||
set src in usr
|
||||
if(usr != src)
|
||||
to_chat(usr, "No.")
|
||||
var/msg = stripped_multiline_input(usr, "Set the temporary flavor text in your 'examine' verb. This should be used only for things pertaining to the current round!", "Short-Term Flavor Text", html_decode(flavor_text_2), MAX_MESSAGE_LEN*2, TRUE)
|
||||
var/msg = stripped_multiline_input(usr, "Set the temporary flavor text in your 'examine' verb. This should be used only for things pertaining to the current round!", "Short-Term Flavor Text", html_decode(flavor_text_2), MAX_MESSAGE_LEN, TRUE)
|
||||
|
||||
if(!isnull(msg))
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
|
||||
flavor_text_2 = msg
|
||||
if(msg)
|
||||
flavor_text_2 = html_encode(msg)
|
||||
|
||||
|
||||
/mob/proc/warn_flavor_changed()
|
||||
@@ -39,19 +33,19 @@
|
||||
if(flavor_text && flavor_text != "")
|
||||
// We are decoding and then encoding to not only get correct amount of characters, but also to prevent partial escaping characters being shown.
|
||||
var/msg = html_decode(replacetext(flavor_text, "\n", " "))
|
||||
if(length(msg) <= 40)
|
||||
if(length_char(msg) <= 40)
|
||||
return "<span class='notice'>[html_encode(msg)]</span>"
|
||||
else
|
||||
return "<span class='notice'>[html_encode(copytext(msg, 1, 37))]... <a href='?src=[REF(src)];flavor_more=1'>More...</span></a>"
|
||||
return "<span class='notice'>[html_encode(copytext_char(msg, 1, 37))]... <a href='?src=[REF(src)];flavor_more=1'>More...</span></a>"
|
||||
|
||||
/mob/proc/print_flavor_text_2()
|
||||
if(flavor_text && flavor_text != "")
|
||||
// We are decoding and then encoding to not only get correct amount of characters, but also to prevent partial escaping characters being shown.
|
||||
var/msg = html_decode(replacetext(flavor_text_2, "\n", " "))
|
||||
if(length(msg) <= 40)
|
||||
if(length_char(msg) <= 40)
|
||||
return "<span class='notice'>[html_encode(msg)]</span>"
|
||||
else
|
||||
return "<span class='notice'>[html_encode(copytext(msg, 1, 37))]... <a href='?src=[REF(src)];flavor2_more=1'>More...</span></a>"
|
||||
return "<span class='notice'>[html_encode(copytext_char(msg, 1, 37))]... <a href='?src=[REF(src)];flavor2_more=1'>More...</span></a>"
|
||||
|
||||
|
||||
/mob/proc/get_top_level_mob()
|
||||
@@ -80,17 +74,10 @@ proc/get_top_level_mob(var/mob/S)
|
||||
|
||||
|
||||
/datum/emote/living/subtle/proc/check_invalid(mob/user, input)
|
||||
. = TRUE
|
||||
if(copytext(input,1,5) == "says")
|
||||
if(stop_bad_mime.Find(input, 1, 1))
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,9) == "exclaims")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,6) == "yells")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,5) == "asks")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else
|
||||
. = FALSE
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/emote/living/subtle/run_emote(mob/user, params, type_override = null)
|
||||
if(jobban_isbanned(user, "emote"))
|
||||
@@ -100,7 +87,7 @@ proc/get_top_level_mob(var/mob/S)
|
||||
to_chat(user, "You cannot send IC messages (muted).")
|
||||
return FALSE
|
||||
else if(!params)
|
||||
var/subtle_emote = copytext(sanitize(input("Choose an emote to display.") as message|null), 1, MAX_MESSAGE_LEN)
|
||||
var/subtle_emote = stripped_multiline_input("Choose an emote to display.", "Subtle", null, MAX_MESSAGE_LEN)
|
||||
if(subtle_emote && !check_invalid(user, subtle_emote))
|
||||
var/type = input("Is this a visible or hearable emote?") as null|anything in list("Visible", "Hearable")
|
||||
switch(type)
|
||||
@@ -151,17 +138,10 @@ proc/get_top_level_mob(var/mob/S)
|
||||
|
||||
|
||||
/datum/emote/living/subtler/proc/check_invalid(mob/user, input)
|
||||
. = TRUE
|
||||
if(copytext(input,1,5) == "says")
|
||||
if(stop_bad_mime.Find(input, 1, 1))
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,9) == "exclaims")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,6) == "yells")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,5) == "asks")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else
|
||||
. = FALSE
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/emote/living/subtler/run_emote(mob/user, params, type_override = null)
|
||||
if(jobban_isbanned(user, "emote"))
|
||||
@@ -171,7 +151,7 @@ proc/get_top_level_mob(var/mob/S)
|
||||
to_chat(user, "You cannot send IC messages (muted).")
|
||||
return FALSE
|
||||
else if(!params)
|
||||
var/subtle_emote = copytext(sanitize(input("Choose an emote to display.") as message|null), 1, MAX_MESSAGE_LEN)
|
||||
var/subtle_emote = stripped_multiline_input(user, "Choose an emote to display.", "Subtler" , null, MAX_MESSAGE_LEN)
|
||||
if(subtle_emote && !check_invalid(user, subtle_emote))
|
||||
var/type = input("Is this a visible or hearable emote?") as null|anything in list("Visible", "Hearable")
|
||||
switch(type)
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
|
||||
// hash the original name?
|
||||
if(tr_flags & TR_HASHNAME)
|
||||
O.name = "monkey ([copytext(md5(real_name), 2, 6)])"
|
||||
O.real_name = "monkey ([copytext(md5(real_name), 2, 6)])"
|
||||
O.name = "monkey ([copytext_char(md5(real_name), 2, 6)])"
|
||||
O.real_name = "monkey ([copytext_char(md5(real_name), 2, 6)])"
|
||||
|
||||
//handle DNA and other attributes
|
||||
dna.transfer_identity(O)
|
||||
@@ -202,7 +202,7 @@
|
||||
dna.transfer_identity(O)
|
||||
O.updateappearance(mutcolor_update=1)
|
||||
|
||||
if(cmptext("monkey",copytext(O.dna.real_name,1,7)))
|
||||
if(findtext(O.dna.real_name, "monkey", 1, 7)) //7 == length("monkey") + 1
|
||||
O.real_name = random_unique_name(O.gender)
|
||||
O.dna.generate_unique_enzymes(O)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user