Files
Bubberstation/code/datums/elements/effect_trail.dm
SkyratBot ed294532c6 [MIRROR] transform the paper wizard from a simple to a basic [MDB IGNORE] (#22452)
* transform the paper wizard from a simple to a basic (#76688)

## About The Pull Request
i transfered paper wizard from simple to a basic and i also gaved him
new fetures he can go and do. now when he will go and walked when he
walks there will be a paper effects when he goes to walk. also he will
he will now go to look for paperes on the floor and then he will write
stuff inside the paper, so a player can maybe distracted the wizard with
a paper because the wizard will stop atacked him for a bit until he
finished writted stuff inside the paper. i follow the instrucions in the
learn-ai md to maked this to a new ai subtree behavier.

## Why It's Good For The Game
the paper wizard is now a basic so he is a better ai and he also have
more feture to gaved him depth mechanics

## Changelog
🆑
refactor: paper wizard have been refactored, please report any
bugs/unintended behavior
refactor: refacted the datum/elememt/trial to an bespoken element
add: paper wizard now have effects when he walking and he will now go
and look for paperes and write stuff in them
/🆑

* transform the paper wizard from a simple to a basic

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
2023-07-14 13:10:55 -04:00

29 lines
864 B
Plaintext

/*
* An element used for making a trail of effects appear behind a movable atom when it moves.
*/
/datum/element/effect_trail
element_flags = ELEMENT_BESPOKE
argument_hash_start_idx = 2
/// The effect used for the trail generation.
var/chosen_effect
/datum/element/effect_trail/Attach(datum/target, chosen_effect = /obj/effect/forcefield/cosmic_field)
. = ..()
if(!ismovable(target))
return ELEMENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(generate_effect))
src.chosen_effect = chosen_effect
/datum/element/effect_trail/Detach(datum/target)
. = ..()
UnregisterSignal(target, COMSIG_MOVABLE_MOVED)
/// Generates an effect
/datum/element/effect_trail/proc/generate_effect(atom/movable/target_object)
SIGNAL_HANDLER
var/turf/open/open_turf = get_turf(target_object)
if(istype(open_turf))
new chosen_effect(open_turf)