Files
bbd547ec95 [MIRROR] Targeting Datums Renamed (and global) [MDB IGNORE] (#24885)
* Targeting Datums Renamed (and global) (#79513)

## About The Pull Request

[Implements the backend required to make targeting datums
global](https://github.com/tgstation/tgstation/commit/6901ead12e419530b7f646ea21094d4432d7385e)

It's inconsistent with the rest of basic ai for these to have a high
degree of state, plus like, such a waste yaknow?

[Implements
GET_TARGETING_STRATEGY](https://github.com/tgstation/tgstation/commit/d79c29134d03424a9f8bacd64c08cb41775fe8c0)

Regexes used:
new.*(/datum/targetting_datum[^,(]*)\(*\)* -> GET_TARGETING_STRATEGY($1)

Renamed all instances of targetting to targeting (also targetting datum
-> targeting strategy)

I've used GET_TARGETING_STRATEGY at the source where the keys are
actually used, rather then in the listing. This works out just fine.

## Why It's Good For The Game

Not a misspelled name through the whole codebase, very slightly less
memory load for basically no downside (slight cpu cost maybe but not a
significant one.

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>

* Targeting Datums Renamed (and global)

* Update dogs.dm

* Modular

* Modular

* Modular

* Merge skew?

* Revert "Merge skew?"

This reverts commit 0889389ab5.

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-11-09 16:37:48 -05:00

107 lines
4.1 KiB
Plaintext

/// A floating eyeball which keeps its distance and sometimes make you look away.
/mob/living/basic/mining/watcher
name = "watcher"
desc = "A levitating, monocular creature held aloft by wing-like veins. A sharp spine of crystal protrudes from its body."
icon = 'icons/mob/simple/lavaland/lavaland_monsters_wide.dmi'
icon_state = "watcher"
icon_living = "watcher"
icon_dead = "watcher_dead"
health_doll_icon = "watcher"
pixel_x = -12
base_pixel_x = -12
speak_emote = list("chimes")
speed = 3
maxHealth = 160
health = 160
attack_verb_continuous = "buffets"
attack_verb_simple = "buffet"
crusher_loot = /obj/item/crusher_trophy/watcher_wing
ai_controller = /datum/ai_controller/basic_controller/watcher
butcher_results = list(
/obj/item/stack/sheet/bone = 1,
/obj/item/stack/ore/diamond = 2,
/obj/item/stack/sheet/sinew = 2,
)
/// How often can we shoot?
var/ranged_cooldown = 3 SECONDS
/// What kind of beams we got?
var/projectile_type = /obj/projectile/temp/watcher
/// Icon state for our eye overlay
var/eye_glow = "ice_glow"
/// Sound to play when we shoot
var/shoot_sound = 'sound/weapons/pierce.ogg'
/// Typepath of our gaze ability
var/gaze_attack = /datum/action/cooldown/mob_cooldown/watcher_gaze
// We attract and eat these things for some reason
var/list/wanted_objects = list(
/obj/item/stack/sheet/mineral/diamond,
/obj/item/stack/ore/diamond,
/obj/item/pen/survival,
)
/mob/living/basic/mining/watcher/Initialize(mapload)
. = ..()
AddElement(/datum/element/ai_retaliate)
AddElement(/datum/element/simple_flying)
AddElement(/datum/element/content_barfer)
AddComponent(/datum/component/ai_target_timer)
AddComponent(/datum/component/basic_ranged_ready_overlay, overlay_state = eye_glow)
AddComponent(\
/datum/component/ranged_attacks,\
cooldown_time = ranged_cooldown,\
projectile_type = projectile_type,\
projectile_sound = shoot_sound,\
)
AddComponent(\
/datum/component/magnet,\
attracted_typecache = wanted_objects,\
on_contact = CALLBACK(src, PROC_REF(consume)),\
)
update_appearance(UPDATE_OVERLAYS)
var/datum/action/cooldown/mob_cooldown/watcher_gaze/gaze = new gaze_attack(src)
gaze.Grant(src)
ai_controller.set_blackboard_key(BB_GENERIC_ACTION, gaze)
AddComponent(/datum/component/revenge_ability, gaze, targeting = GET_TARGETING_STRATEGY(ai_controller.blackboard[BB_TARGETING_STRATEGY]))
/mob/living/basic/mining/watcher/update_overlays()
. = ..()
if (stat == DEAD)
return
. += emissive_appearance(icon, "watcher_emissive", src)
/// I love eating diamonds yum
/mob/living/basic/mining/watcher/proc/consume(atom/movable/thing)
visible_message(span_warning("[thing] seems to vanish into [src]'s body!"))
thing.forceMove(src)
/// More durable, burning projectiles
/mob/living/basic/mining/watcher/magmawing
name = "magmawing watcher"
desc = "Presented with extreme temperatures, adaptive watchers absorb heat through their circulatory wings and repurpose it as a weapon."
icon_state = "watcher_magmawing"
icon_living = "watcher_magmawing"
icon_dead = "watcher_magmawing_dead"
eye_glow = "fire_glow"
maxHealth = 175 //Compensate for the lack of slowdown on projectiles with a bit of extra health
health = 175
projectile_type = /obj/projectile/temp/watcher/magma_wing
gaze_attack = /datum/action/cooldown/mob_cooldown/watcher_gaze/fire
crusher_loot = /obj/item/crusher_trophy/blaster_tubes/magma_wing
crusher_drop_chance = 100 // There's only going to be one of these per round throw them a bone
/// Less durable, freezing projectiles
/mob/living/basic/mining/watcher/icewing
name = "icewing watcher"
desc = "Watchers which fail to absorb enough heat during their development become fragile, but share their internal chill with their enemies."
icon_state = "watcher_icewing"
icon_living = "watcher_icewing"
icon_dead = "watcher_icewing_dead"
maxHealth = 130
health = 130
projectile_type = /obj/projectile/temp/watcher/ice_wing
gaze_attack = /datum/action/cooldown/mob_cooldown/watcher_gaze/ice
butcher_results = list(/obj/item/stack/ore/diamond = 5, /obj/item/stack/sheet/bone = 1)
crusher_loot = /obj/item/crusher_trophy/watcher_wing/ice_wing
crusher_drop_chance = 100