Datumizes spells (#24242)

* datumized spells

* finished

* last changes

* conflict

* Update code/datums/spells/alien_spells/transfer_plasma.dm

* conflicts

* shitty runtime fix until i get to this tomorrow

* Update code/datums/spell.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/datums/spell_handler/alien_spell_handler.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/datums/spells/alien_spells/regurgitate.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/datums/spells/alien_spells/regurgitate.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/datums/spells/bloodcrawl.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/datums/spells/bloodcrawl.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/antagonists/vampire/vampire_powers/hemomancer_powers.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/antagonists/vampire/vampire_powers/vampire_powers.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/awaymissions/mission_code/ruins/wizardcrash.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/research/xenobiology/xenobiology.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/mob/living/carbon/superheroes.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/datums/spells/conjure.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/datums/spells/ethereal_jaunt.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/datums/spells/emplosion.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/datums/spells/turf_teleport.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/datums/spells/wizard_spells.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/datums/spells/wizard_spells.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/dna/mutations/mutation_powers.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/datums/spells/wizard_spells.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/datums/spells/wizard_spells.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/dna/mutations/mutation_powers.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/gamemodes/miniantags/revenant/revenant_abilities.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* guess who just rework the entire malf ai actionsf ai

* gc better

---------

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
GDN
2024-04-01 02:42:21 -05:00
committed by GitHub
parent d52535a041
commit eee8878024
149 changed files with 1358 additions and 1536 deletions
@@ -8,24 +8,24 @@ This was also the case with the verb implementation, it's just much more obvious
/// Amount of plasma required to use this ability
var/plasma_cost = 0
/datum/spell_handler/alien/can_cast(mob/living/carbon/user, charge_check, show_message, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/alien/can_cast(mob/living/carbon/user, charge_check, show_message, datum/spell/spell)
var/obj/item/organ/internal/alien/plasmavessel/vessel = user.get_int_organ(/obj/item/organ/internal/alien/plasmavessel)
if(!vessel)
return 0
return FALSE
if(vessel.stored_plasma < plasma_cost)
if(show_message)
to_chat(user, "<span class='warning'>You require at least [plasma_cost] plasma to use this ability!</span>")
return FALSE
return TRUE
/datum/spell_handler/alien/spend_spell_cost(mob/living/carbon/user, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/alien/spend_spell_cost(mob/living/carbon/user, datum/spell/spell)
user.use_plasma_spell(plasma_cost, user)
/datum/spell_handler/alien/before_cast(list/targets, mob/living/carbon/user, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/alien/before_cast(list/targets, mob/living/carbon/user, datum/spell/spell)
to_chat(user, "<span class='boldnotice'>You have [user.get_plasma()] plasma left to use.</span>")
user.update_plasma_display(user)
/datum/spell_handler/alien/revert_cast(mob/living/carbon/user, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/alien/revert_cast(mob/living/carbon/user, datum/spell/spell)
user.add_plasma(plasma_cost, user)
to_chat(user, "<span class='boldnotice'>You have [user.get_plasma()] plasma left to use.</span>")
user.update_plasma_display(user)
@@ -2,7 +2,7 @@
/// How much food it costs the morph to use this
var/hunger_cost = 0
/datum/spell_handler/morph/can_cast(mob/living/simple_animal/hostile/morph/user, charge_check, show_message, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/morph/can_cast(mob/living/simple_animal/hostile/morph/user, charge_check, show_message, datum/spell/spell)
if(!istype(user))
if(show_message)
to_chat(user, "<span class='warning'>You should not be able to use this abilty! Report this as a bug on github please.</span>")
@@ -15,13 +15,13 @@
return TRUE
/datum/spell_handler/morph/spend_spell_cost(mob/living/simple_animal/hostile/morph/user, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/morph/spend_spell_cost(mob/living/simple_animal/hostile/morph/user, datum/spell/spell)
user.use_food(hunger_cost)
/datum/spell_handler/morph/before_cast(list/targets, mob/living/simple_animal/hostile/morph/user, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/morph/before_cast(list/targets, mob/living/simple_animal/hostile/morph/user, datum/spell/spell)
if(hunger_cost)
to_chat(user, "<span class='boldnotice'>You have [user.gathered_food] left to use.</span>")
/datum/spell_handler/morph/revert_cast(mob/living/simple_animal/hostile/morph/user, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/morph/revert_cast(mob/living/simple_animal/hostile/morph/user, datum/spell/spell)
user.add_food(hunger_cost)
to_chat(user, "<span class='boldnotice'>You have [user.gathered_food] left to use.</span>")
+5 -5
View File
@@ -6,17 +6,17 @@
/datum/spell_handler
/datum/spell_handler/proc/can_cast(mob/user, charge_check, show_message, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/proc/can_cast(mob/user, charge_check, show_message, datum/spell/spell)
return TRUE
/datum/spell_handler/proc/spend_spell_cost(mob/user, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/proc/spend_spell_cost(mob/user, datum/spell/spell)
return
/datum/spell_handler/proc/revert_cast(mob/user, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/proc/revert_cast(mob/user, datum/spell/spell)
return
/datum/spell_handler/proc/before_cast(list/targets, mob/user, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/proc/before_cast(list/targets, mob/user, datum/spell/spell)
return
/datum/spell_handler/proc/after_cast(list/targets, mob/user, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/proc/after_cast(list/targets, mob/user, datum/spell/spell)
return
+3 -3
View File
@@ -3,7 +3,7 @@
/// If the blood cost should be handled by this handler. Or if the spell will handle it itself
var/deduct_blood_on_cast = TRUE
/datum/spell_handler/vampire/can_cast(mob/user, charge_check, show_message, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/vampire/can_cast(mob/user, charge_check, show_message, datum/spell/spell)
var/datum/antagonist/vampire/vampire = user.mind.has_antag_datum(/datum/antagonist/vampire)
if(!vampire)
@@ -31,7 +31,7 @@
return FALSE
return TRUE
/datum/spell_handler/vampire/spend_spell_cost(mob/user, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/vampire/spend_spell_cost(mob/user, datum/spell/spell)
if(!required_blood || !deduct_blood_on_cast) //don't take the blood yet if this is false!
return
@@ -44,7 +44,7 @@
var/blood_cost = round(required_blood * blood_cost_modifier)
return blood_cost
/datum/spell_handler/vampire/after_cast(list/targets, mob/user, obj/effect/proc_holder/spell/spell)
/datum/spell_handler/vampire/after_cast(list/targets, mob/user, datum/spell/spell)
if(!spell.should_recharge_after_cast)
return
if(!required_blood)