mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Porting much of Aryn's stuff
-Sounds -Detective Work -Hallucinations Tweaked server air alarm Tweaked gibs Working on de-derping surgery Ported some BS12 stuff (stunned radio and adminwho) Player's mind datum now holds their antagonist preferences.
This commit is contained in:
25
code/modules/flufftext/Dreaming.dm
Normal file
25
code/modules/flufftext/Dreaming.dm
Normal file
@@ -0,0 +1,25 @@
|
||||
mob/living/carbon/proc/dream()
|
||||
dreaming = 1
|
||||
var/list/dreams = list(
|
||||
"an ID card","a bottle","a familiar face","a crewmember","a toolbox","a security officer","the captain",
|
||||
"voices from all around","deep space","a doctor","the engine","a traitor","an ally","darkness",
|
||||
"light","a scientist","a monkey","a catastrophe","a loved one","a gun","warmth","freezing","the sun",
|
||||
"a hat","the Luna","a ruined station","a planet","plasma","air","the medical bay","the bridge","blinking lights",
|
||||
"a blue light","an abandoned laboratory","Nanotrasen","The Syndicate","blood","healing","power","respect",
|
||||
"riches","space","a crash","happiness","pride","a fall","water","flames","ice","melons","flying"
|
||||
)
|
||||
for(var/i = rand(1,4),i > 0, i--)
|
||||
var/dream_image = pick(dreams)
|
||||
dreams -= dream_image
|
||||
src << "\blue <i>... [dream_image] ...</i>"
|
||||
sleep(rand(40,70))
|
||||
if(paralysis <= 0)
|
||||
dreaming = 0
|
||||
return 0
|
||||
dreaming = 0
|
||||
return 1
|
||||
|
||||
mob/living/carbon/proc/handle_dreams()
|
||||
if(prob(5) && !dreaming) dream()
|
||||
|
||||
mob/living/carbon/var/dreaming = 0
|
||||
175
code/modules/flufftext/Hallucination.dm
Normal file
175
code/modules/flufftext/Hallucination.dm
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
Ideas for the subtle effects of hallucination:
|
||||
|
||||
Light up oxygen/plasma indicators (done)
|
||||
Cause health to look critical/dead, even when standing (done)
|
||||
Characters silently watching you
|
||||
Brief flashes of fire/space/bombs/c4/dangerous shit (done)
|
||||
Items that are rare/traitorous/don't exist appearing in your inventory slots (done)
|
||||
Strange audio (should be rare) (done)
|
||||
Gunshots/explosions/opening doors/less rare audio (done)
|
||||
|
||||
*/
|
||||
|
||||
mob/living/carbon/var
|
||||
image/halimage
|
||||
obj/halitem
|
||||
hal_screwyhud = 0 //1 - critical, 2 - dead, 3 - oxygen indicator, 4 - toxin indicator
|
||||
handling_hal = 0
|
||||
|
||||
mob/living/carbon/proc/handle_hallucinations()
|
||||
if(handling_hal) return
|
||||
handling_hal = 1
|
||||
while(hallucination > 20)
|
||||
sleep(rand(200,500))
|
||||
var/halpick = rand(1,100)
|
||||
switch(halpick)
|
||||
if(0 to 15)
|
||||
//Screwy HUD
|
||||
//src << "Screwy HUD"
|
||||
hal_screwyhud = pick(1,2,3,3,4,4)
|
||||
spawn(rand(100,250))
|
||||
hal_screwyhud = 0
|
||||
if(16 to 25)
|
||||
//Strange items
|
||||
//src << "Traitor Items"
|
||||
halitem = new
|
||||
var/list/slots_free = list("1,1","3,1")
|
||||
if(l_hand) slots_free -= "1,1"
|
||||
if(r_hand) slots_free -= "3,1"
|
||||
if(istype(src,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = src
|
||||
if(!H.belt) slots_free += "3,0"
|
||||
if(!H.l_store) slots_free += "4,0"
|
||||
if(!H.r_store) slots_free += "5,0"
|
||||
if(slots_free.len)
|
||||
halitem.screen_loc = pick(slots_free)
|
||||
halitem.layer = 50
|
||||
switch(rand(1,6))
|
||||
if(1) //revolver
|
||||
halitem.icon = 'gun.dmi'
|
||||
halitem.icon_state = "revolver"
|
||||
halitem.name = "Revolver"
|
||||
if(2) //c4
|
||||
halitem.icon = 'syndieweapons.dmi'
|
||||
halitem.icon_state = "c4small_0"
|
||||
halitem.name = "Mysterious Package"
|
||||
if(prob(25))
|
||||
halitem.icon_state = "c4small_1"
|
||||
if(3) //sword
|
||||
halitem.icon = 'weapons.dmi'
|
||||
halitem.icon_state = "sword1"
|
||||
halitem.name = "Sword"
|
||||
if(4) //stun baton
|
||||
halitem.icon = 'weapons.dmi'
|
||||
halitem.icon_state = "stunbaton"
|
||||
halitem.name = "Stun Baton"
|
||||
if(5) //emag
|
||||
halitem.icon = 'card.dmi'
|
||||
halitem.icon_state = "emag"
|
||||
halitem.name = "Cryptographic Sequencer"
|
||||
if(6) //flashbang
|
||||
halitem.icon = 'grenade.dmi'
|
||||
halitem.icon_state = "flashbang1"
|
||||
halitem.name = "Flashbang"
|
||||
if(client) client.screen += halitem
|
||||
spawn(rand(100,250))
|
||||
del halitem
|
||||
if(26 to 40)
|
||||
//Flashes of danger
|
||||
//src << "Danger Flash"
|
||||
var/possible_points = list()
|
||||
for(var/turf/simulated/floor/F in view(src,world.view))
|
||||
possible_points += F
|
||||
var/turf/simulated/floor/target = pick(possible_points)
|
||||
|
||||
switch(rand(1,3))
|
||||
if(1)
|
||||
//src << "Space"
|
||||
halimage = image('space.dmi',target,"[rand(1,25)]",TURF_LAYER)
|
||||
if(2)
|
||||
//src << "Fire"
|
||||
halimage = image('fire.dmi',target,"1",TURF_LAYER)
|
||||
if(3)
|
||||
//src << "C4"
|
||||
halimage = image('syndieweapons.dmi',target,"c4small_1",OBJ_LAYER+0.01)
|
||||
|
||||
|
||||
if(client) client.images += halimage
|
||||
spawn(rand(10,50)) //Only seen for a brief moment.
|
||||
if(client) client.images -= halimage
|
||||
halimage = null
|
||||
|
||||
|
||||
if(41 to 65)
|
||||
//Strange audio
|
||||
src << "Strange Audio"
|
||||
switch(rand(1,12))
|
||||
if(1) src << 'airlock.ogg'
|
||||
if(2)
|
||||
if(prob(50))src << 'Explosion1.ogg'
|
||||
else src << 'Explosion2.ogg'
|
||||
if(3) src << 'explosionfar.ogg'
|
||||
if(4) src << 'Glassbr1.ogg'
|
||||
if(5) src << 'Glassbr2.ogg'
|
||||
if(6) src << 'Glassbr3.ogg'
|
||||
if(7) src << 'twobeep.ogg'
|
||||
if(8) src << 'windowdoor.ogg'
|
||||
if(9)
|
||||
//To make it more realistic, I added two gunshots (enough to kill)
|
||||
src << 'Gunshot.ogg'
|
||||
spawn(rand(10,30))
|
||||
src << 'Gunshot.ogg'
|
||||
if(10) src << 'smash.ogg'
|
||||
if(11)
|
||||
//Same as above, but with tasers.
|
||||
src << 'Taser.ogg'
|
||||
spawn(rand(10,30))
|
||||
src << 'Taser.ogg'
|
||||
//Rare audio
|
||||
if(12)
|
||||
switch(rand(1,4))
|
||||
if(1) src << 'ghost.ogg'
|
||||
if(2) src << 'ghost2.ogg'
|
||||
if(3) src << 'Heart Beat.ogg'
|
||||
if(4) src << 'screech.ogg'
|
||||
handling_hal = 0
|
||||
|
||||
|
||||
|
||||
|
||||
/*obj/machinery/proc/mockpanel(list/buttons,start_txt,end_txt,list/mid_txts)
|
||||
|
||||
if(!mocktxt)
|
||||
|
||||
mocktxt = ""
|
||||
|
||||
var/possible_txt = list("Launch Escape Pods","Self-Destruct Sequence","\[Swipe ID\]","De-Monkify",\
|
||||
"Reticulate Splines","Plasma","Open Valve","Lockdown","Nerf Airflow","Kill Traitor","Nihilism",\
|
||||
"OBJECTION!","Arrest Stephen Bowman","Engage Anti-Trenna Defenses","Increase Captain IQ","Retrieve Arms",\
|
||||
"Play Charades","Oxygen","Inject BeAcOs","Ninja Lizards","Limit Break","Build Sentry")
|
||||
|
||||
if(mid_txts)
|
||||
while(mid_txts.len)
|
||||
var/mid_txt = pick(mid_txts)
|
||||
mocktxt += mid_txt
|
||||
mid_txts -= mid_txt
|
||||
|
||||
while(buttons.len)
|
||||
|
||||
var/button = pick(buttons)
|
||||
|
||||
var/button_txt = pick(possible_txt)
|
||||
|
||||
mocktxt += "<a href='?src=\ref[src];[button]'>[button_txt]</a><br>"
|
||||
|
||||
buttons -= button
|
||||
possible_txt -= button_txt
|
||||
|
||||
return start_txt + mocktxt + end_txt + "</TT></BODY></HTML>"
|
||||
|
||||
proc/check_panel(mob/M)
|
||||
if (istype(M, /mob/living/carbon/human) || istype(M, /mob/living/silicon/ai))
|
||||
if(M.hallucination < 15)
|
||||
return 1
|
||||
return 0*/
|
||||
81
code/modules/flufftext/TextFilters.dm
Normal file
81
code/modules/flufftext/TextFilters.dm
Normal file
@@ -0,0 +1,81 @@
|
||||
proc/Intoxicated(phrase)
|
||||
phrase = html_decode(phrase)
|
||||
var
|
||||
leng=lentext(phrase)
|
||||
counter=lentext(phrase)
|
||||
newphrase="";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,7))
|
||||
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/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/Stagger(mob/M,d) //Technically not a filter, but it relates to drunkenness.
|
||||
step(M, pick(d,turn(d,90),turn(d,-90)))
|
||||
|
||||
proc/Ellipsis(original_msg, chance = 50)
|
||||
if(chance <= 0) return "..."
|
||||
if(chance >= 100) return original_msg
|
||||
|
||||
var/list
|
||||
words = dd_text2list(original_msg," ")
|
||||
new_words = list()
|
||||
|
||||
var/new_msg = ""
|
||||
|
||||
for(var/w in words)
|
||||
if(prob(chance))
|
||||
new_words += "..."
|
||||
else
|
||||
new_words += w
|
||||
|
||||
new_msg = dd_list2text(new_words," ")
|
||||
|
||||
return new_msg
|
||||
Reference in New Issue
Block a user