Files
Bubberstation/code/datums/brain_damage/special.dm
Qustinnus 707fc287b4 Replaces intents with combat mode (#56601)
About The Pull Request

This PR removes intents and replaces them with a combat mode. An explanation of what this means can be found below
Major changes:

    Disarm and Grab intents have been removed.
    Harm/Help is now combat mode, toggled by F or 4 by default
    The context/verb/popup menu now only works when you do shift+right-click
    Right click is now disarm, both in and out of combat mode.
    Grabbing is now on ctrl-click.
    If you're in combat mode, and are currently grabbing/pulling someone, and ctrl-click somewhere else, it will not release the grab (To prevent misclicks)

Minor interaction changes:

Right click to dissasemble tables, racks, filing cabinets (When holding the right tool to do so)
Left click to stunbaton, right click to harmbaton
Right click to tip cows
Right click to malpractice surgery
Right click to hold people at gunpoint (if youre holding a gun)
Why It's Good For The Game

Intents heavily cripple both the code and the UI design of interactions. While I understand that a lot of people will dislike this PR as they are used to intents, they are one of our weakest links in terms of explaining to players how to do specific things, and require a lot more keypresses to do compared to this.

As an example, martial arts can now be done without having to juggle 1 2 3 and 4 to switch intents quickly.

As some of you who saw the first combat mode PR, the context menu used to be disabled in combat mode. In this version it is instead on shift-right click ensuring that you can always use it in the same way.

In this version, combat mode also no longer prevents you from attacking with items when you would so before, as this was something that was commonly complained about.

The full intention of this shift in control scheme is that right click will become "secondary interaction" for items, which prevents some of the awkward juggling we have now with item modes etcetera.
Changelog

cl Qustinnus
add: Intents have been replaced with a combat mode. For more info find the PR here: #56601
/cl
2021-02-04 16:37:32 +13:00

387 lines
14 KiB
Plaintext

//Brain traumas that are rare and/or somewhat beneficial;
//they are the easiest to cure, which means that if you want
//to keep them, you can't cure your other traumas
/datum/brain_trauma/special
/datum/brain_trauma/special/godwoken
name = "Godwoken Syndrome"
desc = "Patient occasionally and uncontrollably channels an eldritch god when speaking."
scan_desc = "god delusion"
gain_text = "<span class='notice'>You feel a higher power inside your mind...</span>"
lose_text = "<span class='warning'>The divine presence leaves your head, no longer interested.</span>"
/datum/brain_trauma/special/godwoken/on_life()
..()
if(prob(4))
if(prob(33) && (owner.IsStun() || owner.IsParalyzed() || owner.IsUnconscious()))
speak("unstun", TRUE)
else if(prob(60) && owner.health <= owner.crit_threshold)
speak("heal", TRUE)
else if(prob(30) && owner.combat_mode)
speak("aggressive")
else
speak("neutral", prob(25))
/datum/brain_trauma/special/godwoken/on_gain()
ADD_TRAIT(owner, TRAIT_HOLY, TRAUMA_TRAIT)
..()
/datum/brain_trauma/special/godwoken/on_lose()
REMOVE_TRAIT(owner, TRAIT_HOLY, TRAUMA_TRAIT)
..()
/datum/brain_trauma/special/godwoken/proc/speak(type, include_owner = FALSE)
var/message
switch(type)
if("unstun")
message = pick_list_replacements(BRAIN_DAMAGE_FILE, "god_unstun")
if("heal")
message = pick_list_replacements(BRAIN_DAMAGE_FILE, "god_heal")
if("neutral")
message = pick_list_replacements(BRAIN_DAMAGE_FILE, "god_neutral")
if("aggressive")
message = pick_list_replacements(BRAIN_DAMAGE_FILE, "god_aggressive")
else
message = pick_list_replacements(BRAIN_DAMAGE_FILE, "god_neutral")
playsound(get_turf(owner), 'sound/magic/clockwork/invoke_general.ogg', 200, TRUE, 5)
voice_of_god(message, owner, list("colossus","yell"), 2.5, include_owner, FALSE)
/datum/brain_trauma/special/bluespace_prophet
name = "Bluespace Prophecy"
desc = "Patient can sense the bob and weave of bluespace around them, showing them passageways no one else can see."
scan_desc = "bluespace attunement"
gain_text = "<span class='notice'>You feel the bluespace pulsing around you...</span>"
lose_text = "<span class='warning'>The faint pulsing of bluespace fades into silence.</span>"
var/next_portal = 0
/datum/brain_trauma/special/bluespace_prophet/on_life()
if(world.time > next_portal)
next_portal = world.time + 100
var/list/turf/possible_turfs = list()
for(var/turf/T in range(owner, 8))
if(!T.density)
var/clear = TRUE
for(var/obj/O in T)
if(O.density)
clear = FALSE
break
if(clear)
possible_turfs += T
if(!LAZYLEN(possible_turfs))
return
var/turf/first_turf = pick(possible_turfs)
if(!first_turf)
return
possible_turfs -= (possible_turfs & range(first_turf, 3))
var/turf/second_turf = pick(possible_turfs)
if(!second_turf)
return
var/obj/effect/hallucination/simple/bluespace_stream/first = new(first_turf, owner)
var/obj/effect/hallucination/simple/bluespace_stream/second = new(second_turf, owner)
first.linked_to = second
second.linked_to = first
first.seer = owner
second.seer = owner
/obj/effect/hallucination/simple/bluespace_stream
name = "bluespace stream"
desc = "You see a hidden pathway through bluespace..."
image_icon = 'icons/effects/effects.dmi'
image_state = "bluestream"
image_layer = ABOVE_MOB_LAYER
var/obj/effect/hallucination/simple/bluespace_stream/linked_to
var/mob/living/carbon/seer
/obj/effect/hallucination/simple/bluespace_stream/Initialize()
. = ..()
QDEL_IN(src, 300)
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/effect/hallucination/simple/bluespace_stream/attack_hand(mob/user)
if(user != seer || !linked_to)
return
var/slip_in_message = pick("slides sideways in an odd way, and disappears", "jumps into an unseen dimension",\
"sticks one leg straight out, wiggles [user.p_their()] foot, and is suddenly gone", "stops, then blinks out of reality", \
"is pulled into an invisible vortex, vanishing from sight")
var/slip_out_message = pick("silently fades in", "leaps out of thin air","appears", "walks out of an invisible doorway",\
"slides out of a fold in spacetime")
to_chat(user, "<span class='notice'>You try to align with the bluespace stream...</span>")
if(do_after(user, 20, target = src))
new /obj/effect/temp_visual/bluespace_fissure(get_turf(src))
new /obj/effect/temp_visual/bluespace_fissure(get_turf(linked_to))
user.forceMove(get_turf(linked_to))
user.visible_message("<span class='warning'>[user] [slip_in_message].</span>", null, null, null, user)
user.visible_message("<span class='warning'>[user] [slip_out_message].</span>", "<span class='notice'>...and find your way to the other side.</span>")
/datum/brain_trauma/special/quantum_alignment
name = "Quantum Alignment"
desc = "Patient is prone to frequent spontaneous quantum entanglement, against all odds, causing spatial anomalies."
scan_desc = "quantum alignment"
gain_text = "<span class='notice'>You feel faintly connected to everything around you...</span>"
lose_text = "<span class='warning'>You no longer feel connected to your surroundings.</span>"
var/atom/linked_target = null
var/linked = FALSE
var/returning = FALSE
var/snapback_time = 0
/datum/brain_trauma/special/quantum_alignment/on_life()
if(linked)
if(QDELETED(linked_target))
linked_target = null
linked = FALSE
else if(!returning && world.time > snapback_time)
start_snapback()
return
if(prob(4))
try_entangle()
/datum/brain_trauma/special/quantum_alignment/proc/try_entangle()
//Check for pulled mobs
if(ismob(owner.pulling))
entangle(owner.pulling)
return
//Check for adjacent mobs
for(var/mob/living/L in oview(1, owner))
if(owner.Adjacent(L))
entangle(L)
return
//Check for pulled objects
if(isobj(owner.pulling))
entangle(owner.pulling)
return
//Check main hand
var/obj/item/held_item = owner.get_active_held_item()
if(held_item && !(HAS_TRAIT(held_item, TRAIT_NODROP)))
entangle(held_item)
return
//Check off hand
held_item = owner.get_inactive_held_item()
if(held_item && !(HAS_TRAIT(held_item, TRAIT_NODROP)))
entangle(held_item)
return
//Just entangle with the turf
entangle(get_turf(owner))
/datum/brain_trauma/special/quantum_alignment/proc/entangle(atom/target)
to_chat(owner, "<span class='notice'>You start feeling a strong sense of connection to [target].</span>")
linked_target = target
linked = TRUE
snapback_time = world.time + rand(450, 6000)
/datum/brain_trauma/special/quantum_alignment/proc/start_snapback()
if(QDELETED(linked_target))
linked_target = null
linked = FALSE
return
to_chat(owner, "<span class='warning'>Your connection to [linked_target] suddenly feels extremely strong... you can feel it pulling you!</span>")
owner.playsound_local(owner, 'sound/magic/lightning_chargeup.ogg', 75, FALSE)
returning = TRUE
addtimer(CALLBACK(src, .proc/snapback), 100)
/datum/brain_trauma/special/quantum_alignment/proc/snapback()
returning = FALSE
if(QDELETED(linked_target))
to_chat(owner, "<span class='notice'>The connection fades abruptly, and the pull with it.</span>")
linked_target = null
linked = FALSE
return
to_chat(owner, "<span class='warning'>You're pulled through spacetime!</span>")
do_teleport(owner, get_turf(linked_target), null, TRUE, channel = TELEPORT_CHANNEL_QUANTUM)
owner.playsound_local(owner, 'sound/magic/repulse.ogg', 100, FALSE)
linked_target = null
linked = FALSE
/datum/brain_trauma/special/psychotic_brawling
name = "Violent Psychosis"
desc = "Patient fights in unpredictable ways, ranging from helping his target to hitting them with brutal strength."
scan_desc = "violent psychosis"
gain_text = "<span class='warning'>You feel unhinged...</span>"
lose_text = "<span class='notice'>You feel more balanced.</span>"
var/datum/martial_art/psychotic_brawling/psychotic_brawling
/datum/brain_trauma/special/psychotic_brawling/on_gain()
..()
psychotic_brawling = new(null)
if(!psychotic_brawling.teach(owner, TRUE))
to_chat(owner, "<span class='notice'>But your martial knowledge keeps you grounded.</span>")
qdel(src)
/datum/brain_trauma/special/psychotic_brawling/on_lose()
..()
psychotic_brawling.remove(owner)
QDEL_NULL(psychotic_brawling)
/datum/brain_trauma/special/psychotic_brawling/bath_salts
name = "Chemical Violent Psychosis"
/datum/brain_trauma/special/tenacity
name = "Tenacity"
desc = "Patient is psychologically unaffected by pain and injuries, and can remain standing far longer than a normal person."
scan_desc = "traumatic neuropathy"
gain_text = "<span class='warning'>You suddenly stop feeling pain.</span>"
lose_text = "<span class='warning'>You realize you can feel pain again.</span>"
/datum/brain_trauma/special/tenacity/on_gain()
ADD_TRAIT(owner, TRAIT_NOSOFTCRIT, TRAUMA_TRAIT)
ADD_TRAIT(owner, TRAIT_NOHARDCRIT, TRAUMA_TRAIT)
..()
/datum/brain_trauma/special/tenacity/on_lose()
REMOVE_TRAIT(owner, TRAIT_NOSOFTCRIT, TRAUMA_TRAIT)
REMOVE_TRAIT(owner, TRAIT_NOHARDCRIT, TRAUMA_TRAIT)
..()
/datum/brain_trauma/special/death_whispers
name = "Functional Cerebral Necrosis"
desc = "Patient's brain is stuck in a functional near-death state, causing occasional moments of lucid hallucinations, which are often interpreted as the voices of the dead."
scan_desc = "chronic functional necrosis"
gain_text = "<span class='warning'>You feel dead inside.</span>"
lose_text = "<span class='notice'>You feel alive again.</span>"
var/active = FALSE
/datum/brain_trauma/special/death_whispers/on_life()
..()
if(!active && prob(2))
whispering()
/datum/brain_trauma/special/death_whispers/on_lose()
if(active)
cease_whispering()
..()
/datum/brain_trauma/special/death_whispers/proc/whispering()
ADD_TRAIT(owner, TRAIT_SIXTHSENSE, TRAUMA_TRAIT)
active = TRUE
addtimer(CALLBACK(src, .proc/cease_whispering), rand(50, 300))
/datum/brain_trauma/special/death_whispers/proc/cease_whispering()
REMOVE_TRAIT(owner, TRAIT_SIXTHSENSE, TRAUMA_TRAIT)
active = FALSE
/datum/brain_trauma/special/existential_crisis
name = "Existential Crisis"
desc = "Patient's hold on reality becomes faint, causing occasional bouts of non-existence."
scan_desc = "existential crisis"
gain_text = "<span class='notice'>You feel less real.</span>"
lose_text = "<span class='warning'>You feel more substantial again.</span>"
var/obj/effect/abstract/sync_holder/veil/veil
var/next_crisis = 0
/datum/brain_trauma/special/existential_crisis/on_life()
..()
if(!veil && world.time > next_crisis && prob(3))
if(isturf(owner.loc))
fade_out()
/datum/brain_trauma/special/existential_crisis/on_lose()
if(veil)
fade_in()
..()
/datum/brain_trauma/special/existential_crisis/proc/fade_out()
if(veil)
return
var/duration = rand(50, 450)
veil = new(owner.drop_location())
to_chat(owner, "<span class='warning'>[pick("You stop thinking for a moment. Therefore you are not.",\
"To be or not to be...",\
"Why exist?",\
"You stop keeping it real.",\
"Your grip on existence slips.",\
"Do you even exist?",\
"You simply fade away.")]</span>")
owner.forceMove(veil)
SEND_SIGNAL(owner, COMSIG_MOVABLE_SECLUDED_LOCATION)
for(var/thing in owner)
var/atom/movable/AM = thing
SEND_SIGNAL(AM, COMSIG_MOVABLE_SECLUDED_LOCATION)
next_crisis = world.time + 600
addtimer(CALLBACK(src, .proc/fade_in), duration)
/datum/brain_trauma/special/existential_crisis/proc/fade_in()
QDEL_NULL(veil)
to_chat(owner, "<span class='notice'>You fade back into reality.</span>")
next_crisis = world.time + 600
//base sync holder is in desynchronizer.dm
/obj/effect/abstract/sync_holder/veil
name = "non-existence"
desc = "Existence is just a state of mind."
/datum/brain_trauma/special/beepsky
name = "Criminal"
desc = "Patient seems to be a criminal."
scan_desc = "criminal mind"
gain_text = "<span class='warning'>Justice is coming for you.</span>"
lose_text = "<span class='notice'>You were absolved for your crimes.</span>"
random_gain = FALSE
var/obj/effect/hallucination/simple/securitron/beepsky
/datum/brain_trauma/special/beepsky/on_gain()
create_securitron()
..()
/datum/brain_trauma/special/beepsky/proc/create_securitron()
var/turf/where = locate(owner.x + pick(-12, 12), owner.y + pick(-12, 12), owner.z)
beepsky = new(where, owner)
beepsky.victim = owner
/datum/brain_trauma/special/beepsky/on_lose()
QDEL_NULL(beepsky)
..()
/datum/brain_trauma/special/beepsky/on_life()
if(QDELETED(beepsky) || !beepsky.loc || beepsky.z != owner.z)
QDEL_NULL(beepsky)
if(prob(30))
create_securitron()
else
return
if(get_dist(owner, beepsky) >= 10 && prob(20))
QDEL_NULL(beepsky)
create_securitron()
if(owner.stat != CONSCIOUS)
if(prob(20))
owner.playsound_local(beepsky, 'sound/voice/beepsky/iamthelaw.ogg', 50)
return
if(get_dist(owner, beepsky) <= 1)
owner.playsound_local(owner, 'sound/weapons/egloves.ogg', 50)
owner.visible_message("<span class='warning'>[owner]'s body jerks as if it was shocked.</span>", "<span class='userdanger'>You feel the fist of the LAW.</span>")
owner.take_bodypart_damage(0,0,rand(40, 70))
QDEL_NULL(beepsky)
if(prob(20) && get_dist(owner, beepsky) <= 8)
owner.playsound_local(beepsky, 'sound/voice/beepsky/criminal.ogg', 40)
..()
/obj/effect/hallucination/simple/securitron
name = "Securitron"
desc = "The LAW is coming."
image_icon = 'icons/mob/aibots.dmi'
image_state = "secbot-c"
var/victim
/obj/effect/hallucination/simple/securitron/New()
name = pick ( "officer Beepsky", "officer Johnson", "officer Pingsky")
START_PROCESSING(SSfastprocess,src)
..()
/obj/effect/hallucination/simple/securitron/process()
if(prob(60))
forceMove(get_step_towards(src, victim))
if(prob(5))
to_chat(victim, "<span class='name'>[name]</span> exclaims, \"<span class='robotic'>Level 10 infraction alert!\"</span>")
/obj/effect/hallucination/simple/securitron/Destroy()
STOP_PROCESSING(SSfastprocess,src)
return ..()