mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Conflicts: baystation12.dme code/datums/organs/organ_internal.dm code/datums/vote.dm code/defines/atom.dm code/defines/procs/gamehelpers.dm code/defines/turf.dm code/game/algorithm.dm code/game/cellautomata.dm code/game/gamemodes/cult/runes.dm code/game/gamemodes/events.dm code/game/gamemodes/events/ninja_equipment.dm code/game/gamemodes/events/space_ninja.dm code/game/gamemodes/wizard/rightandwrong.dm code/game/jobs/job/captain.dm code/game/machinery/computer/ai_core.dm code/game/machinery/computer/law.dm code/game/machinery/computer/pod.dm code/game/machinery/computer/syndicate_shuttle.dm code/game/machinery/doors/firedoor.dm code/game/machinery/teleporter.dm code/game/machinery/wishgranter.dm code/game/objects/items/devices/uplinks.dm code/game/objects/items/weapons/cigs_lighters.dm code/game/objects/structures/electricchair.dm code/game/turfs/turf.dm code/game/vote.dm code/hub.dm code/modules/admin/admin_verbs.dm code/modules/awaymissions/zlevel.dm code/modules/client/client defines.dm code/modules/food/food.dm code/modules/food/meat.dm code/modules/food/recipes_microwave.dm code/modules/mob/living/carbon/carbon_defines.dm code/modules/mob/living/carbon/human/hud.dm code/modules/mob/living/carbon/human/update_icons.dm code/modules/mob/living/login.dm code/modules/mob/living/simple_animal/life.dm code/modules/mob/mob_defines.dm code/modules/mob/new_player/login.dm code/modules/paperwork/filingcabinet.dm code/modules/paperwork/folders.dm code/modules/paperwork/photocopier.dm code/setup.dm icons/effects/genetics.dmi interface/interface.dm interface/skin.dmf maps/RandomZLevels/fileList.txt various misc mergefixes and todos Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
427 lines
11 KiB
Plaintext
427 lines
11 KiB
Plaintext
|
|
// fun if you want to typecast humans/monkeys/etc without writing long path-filled lines.
|
|
/proc/ishuman(A)
|
|
if(istype(A, /mob/living/carbon/human))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/ismonkey(A)
|
|
if(A && istype(A, /mob/living/carbon/monkey))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/isbrain(A)
|
|
if(A && istype(A, /mob/living/carbon/brain))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/isalien(A)
|
|
if(istype(A, /mob/living/carbon/alien))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/isalienadult(A)
|
|
if(istype(A, /mob/living/carbon/alien/humanoid))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/islarva(A)
|
|
if(istype(A, /mob/living/carbon/alien/larva))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/ismetroid(A)
|
|
if(istype(A, /mob/living/carbon/metroid))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/isrobot(A)
|
|
if(istype(A, /mob/living/silicon/robot))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/isanimal(A)
|
|
if(istype(A, /mob/living/simple_animal))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/iscorgi(A)
|
|
if(istype(A, /mob/living/simple_animal/corgi))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/iscrab(A)
|
|
if(istype(A, /mob/living/simple_animal/crab))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/iscat(A)
|
|
if(istype(A, /mob/living/simple_animal/cat))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/ismouse(A)
|
|
if(istype(A, /mob/living/simple_animal/mouse))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/isbear(A)
|
|
if(istype(A, /mob/living/simple_animal/bear))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/iscarp(A)
|
|
if(istype(A, /mob/living/simple_animal/carp))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/isclown(A)
|
|
if(istype(A, /mob/living/simple_animal/clown))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/isAI(A)
|
|
if(istype(A, /mob/living/silicon/ai))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/ispAI(A)
|
|
if(istype(A, /mob/living/silicon/pai))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/iscarbon(A)
|
|
if(istype(A, /mob/living/carbon))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/issilicon(A)
|
|
if(istype(A, /mob/living/silicon))
|
|
return 1
|
|
return 0
|
|
|
|
/proc/isliving(A)
|
|
if(istype(A, /mob/living))
|
|
return 1
|
|
return 0
|
|
|
|
proc/isobserver(A)
|
|
if(istype(A, /mob/dead/observer))
|
|
return 1
|
|
return 0
|
|
|
|
proc/isorgan(A)
|
|
if(istype(A, /datum/organ/external))
|
|
return 1
|
|
return 0
|
|
|
|
proc/hasorgans(A)
|
|
return (ishuman(A) || ismonkey(A))
|
|
|
|
/proc/hsl2rgb(h, s, l)
|
|
return
|
|
|
|
/proc/istajaran(A)
|
|
if(istype(A, /mob/living/carbon/human))
|
|
var/mob/living/carbon/human/M = A
|
|
if(M.dna.mutantrace == "tajaran")
|
|
return 1
|
|
return 0
|
|
|
|
/proc/issoghun(A)
|
|
if(istype(A, /mob/living/carbon/human))
|
|
var/mob/living/carbon/human/M = A
|
|
if(M.dna.mutantrace == "lizard")
|
|
return 1
|
|
return 0
|
|
|
|
/proc/isskrell(A)
|
|
if(istype(A, /mob/living/carbon/human))
|
|
var/mob/living/carbon/human/M = A
|
|
if(M.dna.mutantrace == "skrell")
|
|
return 1
|
|
return 0
|
|
|
|
|
|
/proc/check_zone(zone)
|
|
if(!zone)
|
|
return "chest"
|
|
switch(zone)
|
|
if("eyes")
|
|
zone = "head"
|
|
if("mouth")
|
|
zone = "head"
|
|
// if("groin")
|
|
// zone = "chest"
|
|
return zone
|
|
|
|
|
|
/proc/ran_zone(zone, probability)
|
|
zone = check_zone(zone)
|
|
if(!probability) probability = 90
|
|
if(probability == 100) return zone
|
|
|
|
if(zone == "chest")
|
|
if(prob(probability)) return "chest"
|
|
var/t = rand(1, 9)
|
|
switch(t)
|
|
if(1 to 3) return "head"
|
|
if(4 to 6) return "l_arm"
|
|
if(7 to 9) return "r_arm"
|
|
|
|
if(prob(probability * 0.75)) return zone
|
|
return "chest"
|
|
|
|
|
|
/proc/stars(n, pr)
|
|
if (pr == null)
|
|
pr = 25
|
|
if (pr <= 0)
|
|
return null
|
|
else
|
|
if (pr >= 100)
|
|
return n
|
|
var/te = html_decode(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))
|
|
else
|
|
t = text("[]*", t)
|
|
p++
|
|
return html_encode(t)
|
|
|
|
/*proc/NewStutter(phrase,stunned)
|
|
phrase = html_decode(phrase)
|
|
|
|
var/list/split_phrase = dd_text2list(phrase," ") //Split it up into words.
|
|
|
|
var/list/unstuttered_words = split_phrase.Copy()
|
|
var/i = rand(1,3)
|
|
if(stunned) i = split_phrase.len
|
|
for(,i > 0,i--) //Pick a few words to stutter on.
|
|
|
|
if (!unstuttered_words.len)
|
|
break
|
|
var/word = pick(unstuttered_words)
|
|
unstuttered_words -= word //Remove from unstuttered words so we don't stutter it again.
|
|
var/index = split_phrase.Find(word) //Find the word in the split phrase so we can replace it.
|
|
|
|
//Search for dipthongs (two letters that make one sound.)
|
|
var/first_sound = copytext(word,1,3)
|
|
var/first_letter = copytext(word,1,2)
|
|
if(lowertext(first_sound) in list("ch","th","sh"))
|
|
first_letter = first_sound
|
|
|
|
//Repeat the first letter to create a stutter.
|
|
var/rnum = rand(1,3)
|
|
switch(rnum)
|
|
if(1)
|
|
word = "[first_letter]-[word]"
|
|
if(2)
|
|
word = "[first_letter]-[first_letter]-[word]"
|
|
if(3)
|
|
word = "[first_letter]-[word]"
|
|
|
|
split_phrase[index] = word
|
|
|
|
return sanitize(dd_list2text(split_phrase," "))*/
|
|
|
|
|
|
proc/slur(phrase)
|
|
phrase = html_decode(phrase)
|
|
var/leng=lentext(phrase)
|
|
var/counter=lentext(phrase)
|
|
var/newphrase=""
|
|
var/newletter=""
|
|
while(counter>=1)
|
|
newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2)
|
|
if(rand(1,3)==3)
|
|
if(lowertext(newletter)=="o") newletter="u"
|
|
if(lowertext(newletter)=="s") newletter="ch"
|
|
if(lowertext(newletter)=="a") newletter="ah"
|
|
if(lowertext(newletter)=="c") newletter="k"
|
|
switch(rand(1,15))
|
|
if(1,3,5,8) newletter="[lowertext(newletter)]"
|
|
if(2,4,6,15) newletter="[uppertext(newletter)]"
|
|
if(7) newletter+="'"
|
|
if(9,10) newletter="<b>[newletter]</b>"
|
|
if(11,12) newletter="<big>[newletter]</big>"
|
|
if(13) newletter="<small>[newletter]</small>"
|
|
newphrase+="[newletter]";counter-=1
|
|
return newphrase
|
|
|
|
/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.
|
|
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)
|
|
|
|
|
|
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)
|
|
letter = ""
|
|
|
|
for(var/j = 1, j <= rand(0, 2), j++)
|
|
letter += pick("#","@","*","&","%","$","/", "<", ">", ";","*","*","*","*","*","*","*")
|
|
|
|
returntext += letter
|
|
|
|
return returntext
|
|
|
|
|
|
/proc/ninjaspeak(n)
|
|
/*
|
|
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)
|
|
if (prob(50))
|
|
if (prob(30))
|
|
n_letter = text("[n_letter]-[n_letter]-[n_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)
|
|
|
|
|
|
/proc/shake_camera(mob/M, duration, strength=1)
|
|
if(!M || !M.client || M.shakecamera)
|
|
return
|
|
spawn(1)
|
|
var/oldeye=M.client.eye
|
|
var/x
|
|
M.shakecamera = 1
|
|
for(x=0; x<duration, x++)
|
|
M.client.eye = locate(dd_range(1,M.loc.x+rand(-strength,strength),world.maxx),dd_range(1,M.loc.y+rand(-strength,strength),world.maxy),M.loc.z)
|
|
sleep(1)
|
|
M.shakecamera = 0
|
|
M.client.eye=oldeye
|
|
|
|
|
|
/proc/findname(msg)
|
|
for(var/mob/M in mob_list)
|
|
if (M.real_name == text("[msg]"))
|
|
return 1
|
|
return 0
|
|
|
|
|
|
/mob/proc/abiotic(var/full_body = 0)
|
|
if(full_body && ((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )) || (src.back || src.wear_mask)))
|
|
return 1
|
|
|
|
if((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )))
|
|
return 1
|
|
|
|
return 0
|
|
|
|
/mob/proc/abiotic2(var/full_body2 = 0)
|
|
if(full_body2 && ((l_hand && !( l_hand.abstract )) || (r_hand && !( r_hand.abstract )) || (back || wear_mask)))
|
|
return 1
|
|
|
|
if((l_hand && !( l_hand.abstract )) || (r_hand && !( r_hand.abstract )))
|
|
return 1
|
|
|
|
return 0
|
|
|
|
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
|
|
/mob/verb/button_pressed_F12()
|
|
set name = "F12"
|
|
set hidden = 1
|
|
|
|
if(hud_used)
|
|
if(ishuman(src))
|
|
if(!src.client) return
|
|
|
|
if(hud_used.hud_shown)
|
|
hud_used.hud_shown = 0
|
|
if(src.hud_used.adding)
|
|
src.client.screen -= src.hud_used.adding
|
|
if(src.hud_used.other)
|
|
src.client.screen -= src.hud_used.other
|
|
if(src.hud_used.hotkeybuttons)
|
|
src.client.screen -= src.hud_used.hotkeybuttons
|
|
if(src.hud_used.item_action_list)
|
|
src.client.screen -= src.hud_used.item_action_list
|
|
|
|
//Due to some poor coding some things need special treatment:
|
|
//These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay
|
|
src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible
|
|
src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible
|
|
src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
|
|
src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
|
|
|
|
//These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone.
|
|
src.client.screen -= src.zone_sel //zone_sel is a mob variable for some reason.
|
|
|
|
else
|
|
hud_used.hud_shown = 1
|
|
if(src.hud_used.adding)
|
|
src.client.screen += src.hud_used.adding
|
|
if(src.hud_used.other && src.hud_used.inventory_shown)
|
|
src.client.screen += src.hud_used.other
|
|
if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden)
|
|
src.client.screen += src.hud_used.hotkeybuttons
|
|
|
|
|
|
src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
|
|
src.client.screen += src.zone_sel //This one is a special snowflake
|
|
|
|
hud_used.hidden_inventory_update()
|
|
hud_used.persistant_inventory_update()
|
|
update_action_buttons()
|
|
else
|
|
usr << "\red Inventory hiding is currently only supported for human mobs, sorry."
|
|
else
|
|
usr << "\red This mob type does not use a HUD."
|
|
|
|
/mob/proc/is_player_active()
|
|
if(!src.client) return 0
|
|
if(src.client.inactivity > 10 * 60 * 10) return 0
|
|
if(src.stat == 2) return 0
|
|
|
|
return 1
|
|
|
|
/mob/proc/get_species()
|
|
return
|