mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
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:
@@ -4,7 +4,7 @@
|
||||
/datum/spell_targeting/alive_mob_list
|
||||
allowed_type = /mob/living
|
||||
|
||||
/datum/spell_targeting/alive_mob_list/choose_targets(mob/user, obj/effect/proc_holder/spell/spell, params, atom/clicked_atom)
|
||||
/datum/spell_targeting/alive_mob_list/choose_targets(mob/user, datum/spell/spell, params, atom/clicked_atom)
|
||||
var/list/possible_targets = list()
|
||||
for(var/mob/living/possible_target as anything in GLOB.alive_mob_list)
|
||||
if(valid_target(possible_target, user, spell, FALSE))
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/// The radius of turfs not being affected. -1 is inactive
|
||||
var/inner_radius = -1
|
||||
|
||||
/datum/spell_targeting/aoe/choose_targets(mob/user, obj/effect/proc_holder/spell/spell, params, atom/clicked_atom)
|
||||
/datum/spell_targeting/aoe/choose_targets(mob/user, datum/spell/spell, params, atom/clicked_atom)
|
||||
var/list/targets = list()
|
||||
var/spell_center = use_turf_of_user ? get_turf(user) : user
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
var/random_target_priority = SPELL_TARGET_CLOSEST
|
||||
|
||||
|
||||
/datum/spell_targeting/click/choose_targets(mob/user, obj/effect/proc_holder/spell/spell, params, atom/clicked_atom)
|
||||
/datum/spell_targeting/click/choose_targets(mob/user, datum/spell/spell, params, atom/clicked_atom)
|
||||
var/list/targets = list()
|
||||
if(valid_target(clicked_atom, user, spell))
|
||||
targets.Add(clicked_atom)
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
/datum/spell_targeting/clicked_atom
|
||||
use_intercept_click = TRUE
|
||||
|
||||
/datum/spell_targeting/clicked_atom/choose_targets(mob/user, obj/effect/proc_holder/spell/spell, params, atom/clicked_atom)
|
||||
/datum/spell_targeting/clicked_atom/choose_targets(mob/user, datum/spell/spell, params, atom/clicked_atom)
|
||||
if(clicked_atom)
|
||||
return list(clicked_atom)
|
||||
|
||||
/datum/spell_targeting/clicked_atom/external/choose_targets(mob/user, obj/effect/proc_holder/spell/spell, params, atom/clicked_atom)
|
||||
/datum/spell_targeting/clicked_atom/external/choose_targets(mob/user, datum/spell/spell, params, atom/clicked_atom)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return list()
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
/obj/item/bio_chip
|
||||
)
|
||||
|
||||
/datum/spell_targeting/matter_eater/choose_targets(mob/user, obj/effect/proc_holder/spell/spell, params, atom/clicked_atom)
|
||||
/datum/spell_targeting/matter_eater/choose_targets(mob/user, datum/spell/spell, params, atom/clicked_atom)
|
||||
var/list/possible_targets = list()
|
||||
|
||||
for(var/atom/movable/O in view_or_range(range, user, selection_type))
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
/datum/spell_targeting/reachable_turfs
|
||||
|
||||
/datum/spell_targeting/reachable_turfs/choose_targets(mob/user, obj/effect/proc_holder/spell/spell, params, atom/clicked_atom)
|
||||
/datum/spell_targeting/reachable_turfs/choose_targets(mob/user, datum/spell/spell, params, atom/clicked_atom)
|
||||
var/list/turf/locs = list()
|
||||
for(var/direction in GLOB.alldirs)
|
||||
if(length(locs) == max_targets) //we found 2 locations and thats all we need
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
/datum/spell_targeting/remoteview
|
||||
|
||||
/datum/spell_targeting/remoteview/choose_targets(mob/user, obj/effect/proc_holder/spell/spell, params, atom/clicked_atom)
|
||||
/datum/spell_targeting/remoteview/choose_targets(mob/user, datum/spell/spell, params, atom/clicked_atom)
|
||||
var/list/remoteviewers = list()
|
||||
for(var/mob/M in GLOB.alive_mob_list)
|
||||
if(M == user)
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
*/
|
||||
/datum/spell_targeting/self
|
||||
|
||||
/datum/spell_targeting/self/choose_targets(mob/user, obj/effect/proc_holder/spell/spell, params, atom/clicked_atom)
|
||||
/datum/spell_targeting/self/choose_targets(mob/user, datum/spell/spell, params, atom/clicked_atom)
|
||||
return list(user) // That's how simple it is
|
||||
|
||||
@@ -34,14 +34,14 @@
|
||||
* * params - Params given by the intercept click. Only available if use_intercept_click is TRUE
|
||||
* * clicked_atom - The atom clicked on. Only available if use_intercept_click is TRUE
|
||||
*/
|
||||
/datum/spell_targeting/proc/choose_targets(mob/user, obj/effect/proc_holder/spell/spell, params, atom/clicked_atom)
|
||||
/datum/spell_targeting/proc/choose_targets(mob/user, datum/spell/spell, params, atom/clicked_atom)
|
||||
RETURN_TYPE(/list)
|
||||
return
|
||||
|
||||
/**
|
||||
* Will attempt to auto target the spell. Only works with 1 target currently
|
||||
*/
|
||||
/datum/spell_targeting/proc/attempt_auto_target(mob/user, obj/effect/proc_holder/spell/spell)
|
||||
/datum/spell_targeting/proc/attempt_auto_target(mob/user, datum/spell/spell)
|
||||
var/atom/target
|
||||
for(var/atom/A in view_or_range(range, use_turf_of_user ? get_turf(user) : user, selection_type))
|
||||
if(valid_target(A, user, spell, FALSE))
|
||||
@@ -64,7 +64,7 @@
|
||||
* * A - Atom the user clicked on
|
||||
* * spell - The spell being cast
|
||||
*/
|
||||
/datum/spell_targeting/proc/InterceptClickOn(mob/user, params, atom/A, obj/effect/proc_holder/spell/spell)
|
||||
/datum/spell_targeting/proc/InterceptClickOn(mob/user, params, atom/A, datum/spell/spell)
|
||||
var/list/targets = choose_targets(user, spell, params, A)
|
||||
spell.try_perform(targets, user)
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
* * spell - The spell being cast
|
||||
* * check_if_in_range - If a view/range check has to be done to see if the target is valid
|
||||
*/
|
||||
/datum/spell_targeting/proc/valid_target(target, user, obj/effect/proc_holder/spell/spell, check_if_in_range = TRUE)
|
||||
/datum/spell_targeting/proc/valid_target(target, user, datum/spell/spell, check_if_in_range = TRUE)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
return istype(target, allowed_type) && (include_user || target != user) && \
|
||||
spell.valid_target(target, user) && (!check_if_in_range || (target in view_or_range(range, use_turf_of_user ? get_turf(user) : user, selection_type))) \
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/// Who to target when too many targets are found. Only matters when max_targets = 1
|
||||
var/target_priority = SPELL_TARGET_CLOSEST
|
||||
|
||||
/datum/spell_targeting/targeted/choose_targets(mob/user, obj/effect/proc_holder/spell/spell, params, atom/clicked_atom)
|
||||
/datum/spell_targeting/targeted/choose_targets(mob/user, datum/spell/spell, params, atom/clicked_atom)
|
||||
var/list/targets = list()
|
||||
var/list/possible_targets = list()
|
||||
var/atom/spell_location = use_turf_of_user ? get_turf(user) : user
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
/datum/spell_targeting/telepathic
|
||||
|
||||
/datum/spell_targeting/telepathic/choose_targets(mob/user, obj/effect/proc_holder/spell/spell, params, atom/clicked_atom)
|
||||
/datum/spell_targeting/telepathic/choose_targets(mob/user, datum/spell/spell, params, atom/clicked_atom)
|
||||
var/list/valid_targets = list()
|
||||
var/turf/T = get_turf(user)
|
||||
var/list/mobs_in_view = user.get_visible_mobs()
|
||||
|
||||
Reference in New Issue
Block a user