Skip to content

Commit

Permalink
removes an unused proc, fixes the do-after for meditate, buffs medita…
Browse files Browse the repository at this point in the history
…tes do-after time
  • Loading branch information
Wollywoger committed Nov 21, 2024
1 parent 612c7a5 commit 2b70a57
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 36 deletions.
7 changes: 0 additions & 7 deletions maplestation_modules/code/modules/magic/mana/mana.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@

var/mana_overloaded = FALSE

/* /atom/movable/Destroy(force, ...)
QDEL_NULL(mana_pool) // why was this after set_mana_pool. it should never ever be
set_mana_pool(null)
return ..() */

// creates the mana pool for use.
// mostly called on atom_init.
/atom/movable/proc/initialize_mana_pool()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define COMSIG_SPELL_TOUCH_CAN_HIT "spell_touch_can_hit"

/**
* A preset component for touch spells that use mana
Expand Down Expand Up @@ -26,28 +25,6 @@
if (!istype(parent, /datum/action/cooldown/spell/touch))
return COMPONENT_INCOMPATIBLE



/datum/component/uses_mana/touch_spell/RegisterWithParent()
..()
RegisterSignal(parent, COMSIG_SPELL_TOUCH_CAN_HIT, PROC_REF(can_touch))

/datum/component/uses_mana/touch_spell/UnregisterFromParent()
..()
UnregisterSignal(parent, COMSIG_SPELL_TOUCH_CAN_HIT)

/datum/component/uses_mana/touch_spell/proc/can_touch(
datum/action/cooldown/spell/touch/source,
atom/victim,
mob/living/carbon/caster,
)
SIGNAL_HANDLER

if(source.attached_hand)
return NONE // de-activating, so don't block it

return

// Override to send a signal we can react to
/datum/action/cooldown/spell/touch/can_hit_with_hand(atom/victim, mob/caster)
. = ..()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@

invocation = "AS'P'RE"
invocation_type = INVOCATION_WHISPER
var/channel_time = 7 SECONDS

/datum/action/cooldown/spell/leyline_charge/cast(mob/living/cast_on)

/datum/action/cooldown/spell/leyline_charge/before_cast(atom/cast_on)
. = ..()
if (!cast_on.mana_pool)

Check failure on line 21 in maplestation_modules/code/modules/magic/story_spells/mana_charge.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined field: "mana_pool" on /atom
cast_on.balloon_alert(cast_on, "no mana pool!")
return
do_after(cast_on, 7 SECONDS) // don't want this mid combat.
..()
if(!do_after(cast_on, channel_time)) // don't want this casted mid combat
return . | SPELL_CANCEL_CAST

/datum/action/cooldown/spell/leyline_charge/cast(mob/living/cast_on)

Check failure on line 27 in maplestation_modules/code/modules/magic/story_spells/mana_charge.dm

View workflow job for this annotation

GitHub Actions / Run Linters

proc never calls parent, required by /datum/action/cooldown/spell/proc/cast
var/randy_value = rand(0,25) // generate a random number, which will be-
var/mana_to_gain = randy_value + 20 // added to the base amount, to get a semi-inconsistent regen amount
var/list/datum/mana_pool/leyline/accessable_leylines = list(get_accessable_leylines())
Expand All @@ -44,14 +49,18 @@

invocation = "Focus...."
invocation_type = INVOCATION_WHISPER
var/channel_time = 12 SECONDS

/datum/action/cooldown/spell/meditate/cast(mob/living/cast_on)
/datum/action/cooldown/spell/meditate/before_cast(atom/cast_on)
. = ..()
if (!cast_on.mana_pool)

Check failure on line 56 in maplestation_modules/code/modules/magic/story_spells/mana_charge.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined field: "mana_pool" on /atom
cast_on.balloon_alert(cast_on, "no mana pool!")
return
to_chat(cast_on, span_alert("You begin focusing your mind on manipulating ambient mana."))
do_after(cast_on, 20 SECONDS) // don't want this mid combat.
..()
if(!do_after(cast_on, channel_time)) // don't want this casted mid combat
return . | SPELL_CANCEL_CAST

/datum/action/cooldown/spell/meditate/cast(mob/living/cast_on)

Check failure on line 63 in maplestation_modules/code/modules/magic/story_spells/mana_charge.dm

View workflow job for this annotation

GitHub Actions / Run Linters

proc never calls parent, required by /datum/action/cooldown/spell/proc/cast
var/randy_value = rand(0,25)
var/mana_to_gain = randy_value + 40
cast_on.mana_pool.adjust_mana(mana_to_gain)

0 comments on commit 2b70a57

Please sign in to comment.