Skip to content

Commit

Permalink
Psionic fixes and tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Atlas committed Aug 1, 2023
1 parent 3612e03 commit 48df6ae
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 27 deletions.
4 changes: 2 additions & 2 deletions code/controllers/subsystems/processing/psi.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ var/global/list/psychic_ranks_to_strings = list("Psionically Sensitive", "Psioni
complete_nlom_time = world.time + 2 MINUTES
completing_nlom = TRUE
if(completing_nlom && world.time >= complete_nlom_time)
var/highest_emotion = "Happy"
var/highest_emotion = "Calm"
for(var/emotion in nlom_votes)
if(nlom_votes[highest_emotion] < nlom_votes[emotion])
if(nlom_votes[emotion] > nlom_votes[highest_emotion])
highest_emotion = emotion
for(var/datum/psi_complexus/PC in all_psi_complexes)
if(PC.psionic_rank >= PSI_RANK_SENSITIVE)
Expand Down
30 changes: 19 additions & 11 deletions code/game/gamemodes/technomancer/spell_objs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
if(force)
force *= 1.1
armor_penetration *= 1.1
RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(check_owner))

update_icon()

Expand All @@ -192,6 +193,11 @@
core = null
return ..()

/// Check if we're still being held. Otherwise... time to qdel.
/obj/item/spell/proc/check_owner()
if(!(loc == owner) && NOT_FLAG(cast_methods, CAST_THROW))
qdel_self()

// Proc: unref_spells()
// Parameters: 0
// Description: Nulls object references on specific mobs so it can qdel() cleanly.
Expand Down Expand Up @@ -299,13 +305,16 @@
if(cast_methods & CAST_RANGED) //Try to use a ranged method if a melee one doesn't exist.
on_ranged_cast(target, user)
if(cooldown)
var/effective_cooldown
if(aspect == ASPECT_PSIONIC)
effective_cooldown = cooldown
else
effective_cooldown = round(cooldown * core.cooldown_modifier, 5)
user.setClickCooldown(effective_cooldown)
flick("cooldown_[effective_cooldown]",src)
apply_cooldown(user)

/obj/item/spell/proc/apply_cooldown(mob/user)
var/effective_cooldown
if(aspect == ASPECT_PSIONIC)
effective_cooldown = cooldown
else
effective_cooldown = round(cooldown * core.cooldown_modifier, 5)
user.setClickCooldown(effective_cooldown)
flick("cooldown_[effective_cooldown]",src)

/obj/item/spell/apply_hit_effect(mob/living/target, mob/living/user, hit_zone)
. = ..()
Expand Down Expand Up @@ -358,9 +367,8 @@
// Description: Deletes the spell object immediately.
/obj/item/spell/dropped()
. = ..()
spawn(1)
if(src)
qdel(src)
qdel_self()


// Proc: throw_impact()
// Parameters: 1 (hit_atom - the atom that got hit by the spell as it was thrown)
Expand All @@ -372,7 +380,7 @@

// If we miss or hit an obstacle, we still want to delete the spell.
spawn(20)
if(src)
if(!QDELETED(src))
qdel(src)

/obj/item/spell/damage_flags()
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/effects/decals/cleanable.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/obj/effect/decal/cleanable
layer = ABOVE_CABLE_LAYER
mouse_opacity = MOUSE_OPACITY_ICON
var/list/random_icon_states
var/swept_away

Expand Down
1 change: 1 addition & 0 deletions code/game/objects/effects/spiders.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
anchored = 0
layer = 2.7
health = 3
mouse_opacity = MOUSE_OPACITY_ICON
var/last_itch = 0
var/amount_grown = -1
var/growth_rate = 1
Expand Down
5 changes: 3 additions & 2 deletions code/modules/mob/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,9 @@ var/list/slot_equipment_priority = list( \
return TRUE //Something is stopping us. Takes off throw mode.

if(unEquip(I))
make_item_drop_sound(I)
I.forceMove(T)
if(!QDELETED(I))
make_item_drop_sound(I)
I.forceMove(T)
return TRUE

if(!unEquip(item) && !ismob(item)) //ismob override is here for grab throwing mobs
Expand Down
1 change: 1 addition & 0 deletions code/modules/overmap/overmap_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
icon = 'icons/obj/overmap/overmap_effects.dmi'
icon_state = "object"
color = "#fffffe"
mouse_opacity = MOUSE_OPACITY_ICON

//RP fluff details to appear on scan readouts for any object we want to include these details with
var/scanimage = "no_data.png"
Expand Down
22 changes: 13 additions & 9 deletions code/modules/psionics/abilities/grip.dm
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
/singleton/psionic_power/grip
name = "Grip"
desc = "Grip a victim with psionic energy. You can squeeze your grip to crush them."
desc = "Grip a victim with psionic energy. You can squeeze your grip to crush them. Drop your spell to undo the stasis."
icon_state = "ling_bioelectrogenesis"
point_cost = 3
ability_flags = PSI_FLAG_ANTAG
spell_path = /obj/item/spell/grip

/obj/item/spell/grip
name = "stasis"
name = "grip"
desc = "General Kenobi..."
icon_state = "blink"
cast_methods = CAST_RANGED|CAST_USE
aspect = ASPECT_PSIONIC
cooldown = 15
psi_cost = 5
cooldown = 20
psi_cost = 10
var/next_squeeze_time = 0
var/mob/living/victim

/obj/item/spell/grip/Destroy()
victim.captured = FALSE
victim.SetStunned(0)
victim.update_canmove()
victim = null
return ..()
Expand All @@ -26,12 +27,17 @@
if(!victim)
to_chat(user, SPAN_WARNING("You need to grip someone first!"))
return
if(world.time < next_squeeze_time)
return
. = ..()
if(!.)
return
user.visible_message(SPAN_WARNING("[user] squeezes [user.get_pronoun("his")] hand!"), SPAN_WARNING("You squeeze your hand to tighten the psionic force around [victim]."))
to_chat(victim, SPAN_DANGER(FONT_HUGE("You are crushed by an invisible force!")))
victim.apply_damage(30, DAMAGE_BRUTE, armor_pen = 30, damage_flags = DAMAGE_FLAG_DISPERSED)
victim.apply_damage(20, DAMAGE_BRUTE, armor_pen = 15, def_zone = BP_HEAD)
victim.SetStunned(2)
apply_cooldown(user)
next_squeeze_time = world.time + 2 SECONDS

/obj/item/spell/grip/on_ranged_cast(atom/hit_atom, mob/user, bypass_psi_check)
if(!isliving(hit_atom))
Expand All @@ -45,7 +51,5 @@
var/mob/living/M = hit_atom
user.visible_message(SPAN_DANGER("[user] extends [user.get_pronoun("his")] arm and makes a grab motion towards [M]!"),
SPAN_DANGER("You extend your arm and grab [M] with your psionic energy!"))
to_chat(M, SPAN_DANGER(FONT_HUGE("You feel an invisible force tighten around you!")))
M.captured = TRUE
M.update_canmove()
to_chat(M, SPAN_DANGER("You feel an invisible force tighten around you!"))
victim = M
10 changes: 7 additions & 3 deletions code/modules/psionics/interface/ui_hub.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
var/psionic_path = text2path(params["buy"])
if(ispath(psionic_path))
var/singleton/psionic_power/P = GET_SINGLETON(psionic_path)
P.apply(owner)
to_chat(owner, SPAN_NOTICE("You are now capable of using [P.name]."))
return TRUE
if(P.point_cost > owner.psi.psi_points)
to_chat(owner, SPAN_WARNING("You can't afford that!"))
return
if(P.apply(owner))
to_chat(owner, SPAN_NOTICE("You are now capable of using [P.name]."))
owner.psi.psi_points = max(owner.psi.psi_points - P.point_cost, 0)
return TRUE
47 changes: 47 additions & 0 deletions html/changelogs/mattatlas-goneblind.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################

# Your name.
author: MattAtlas

# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True

# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "Effects such as spiderlings and overmap objects can once again be clicked."
- bugfix: "Psi points are now actually deducted when using the shop."
- bugfix: "Spell objects should delete more reliably."
- bugfix: "Nlom Awareness should function correctly."
- tweak: "Psionic Grip now only freezes the victim for a short amount of time when activated."
- tweak: "Psionic Grip now only does damage to the head when activated."
- bugfix: "Psionic Grip now actually has a cooldown on activation."

0 comments on commit 48df6ae

Please sign in to comment.