Basic Dark Wizards (#89147)

## About The Pull Request

Simple animal Dark Wizard => Basic mob Dark Wizard.
This mob is I think used in literally one ruin, and very occasionally
spawned in deathmatch.
They don't really do anything except shoot you with slowing projectiles
and hit you with sticks.

I gave them a version of blink with a longer cooldown that they use when
attacked in melee range purely to make them very marginally more
wizard-like, and they will also now try to back away from you while
shooting you instead of running towards you.

They will also retaliate against anyone who attacks them including as a
response to friendly fire from other Dark Wizards, because I think it is
funny if they have very little loyalty to each other and that's a fun
thing to trigger when you are playing Doom.

Finally, we have a component called "revenge ability" which is mostly a
standin for AI responses to getting attacked. I made all existing uses
of it turn off if you're controlled by a sapient player who can hit
those buttons themselves, because they can choose when they want to use
those abilities themselves.

## Why It's Good For The Game

The march of progress is almost complete

## Changelog

🆑
refactor: refactored some code
balance: Dark Wizards now teleport when attacked, but are more likely to
turn on their allies
/🆑
This commit is contained in:
Jacquerel
2025-01-23 03:50:07 +00:00
committed by GitHub
parent 1d0bed4466
commit 2aeeed086f
11 changed files with 96 additions and 52 deletions
@@ -309,7 +309,7 @@
/turf/open/misc/asteroid/basalt/lava_land_surface,
/area/lavaland/surface/outdoors)
"K" = (
/mob/living/simple_animal/hostile/dark_wizard,
/mob/living/basic/dark_wizard,
/turf/open/misc/asteroid/basalt/lava_land_surface,
/area/lavaland/surface/outdoors)
+1 -1
View File
@@ -99,6 +99,7 @@ GLOBAL_LIST_INIT(phobia_mobs, list(
/mob/dead/observer,
/mob/living/basic/bat,
/mob/living/basic/construct,
/mob/living/basic/dark_wizard,
/mob/living/basic/demon,
/mob/living/basic/faithless,
/mob/living/basic/ghost,
@@ -109,7 +110,6 @@ GLOBAL_LIST_INIT(phobia_mobs, list(
/mob/living/basic/wizard,
/mob/living/basic/zombie,
/mob/living/simple_animal/bot/mulebot/paranormal,
/mob/living/simple_animal/hostile/dark_wizard,
)),
))
@@ -45,3 +45,6 @@
controller.ai_interact(target = target, combat_mode = TRUE)
return AI_BEHAVIOR_DELAY | AI_BEHAVIOR_SUCCEEDED
/datum/ai_planning_subtree/ranged_skirmish/no_minimum
min_range = 0
+6 -1
View File
@@ -15,8 +15,10 @@
var/max_range
/// Target the ability at ourself instead of at the offender
var/target_self
/// Should this behavoid continue if our mob is sapient?
var/activate_with_mind
/datum/component/revenge_ability/Initialize(datum/action/cooldown/ability, datum/targeting_strategy/targeting, min_range = 0, max_range = INFINITY, target_self = FALSE)
/datum/component/revenge_ability/Initialize(datum/action/cooldown/ability, datum/targeting_strategy/targeting, min_range = 0, max_range = INFINITY, target_self = FALSE, activate_with_mind = FALSE)
. = ..()
if (!isliving(parent))
return COMPONENT_INCOMPATIBLE
@@ -25,6 +27,7 @@
src.min_range = min_range
src.max_range = max_range
src.target_self = target_self
src.activate_with_mind = activate_with_mind
RegisterSignal(ability, COMSIG_QDELETING, PROC_REF(ability_destroyed))
@@ -41,6 +44,8 @@
/// If we were attacked, get revenge
/datum/component/revenge_ability/proc/on_attacked(mob/living/victim, atom/attacker)
SIGNAL_HANDLER
if (victim.mind && !activate_with_mind)
return // This is mostly a component for the use of AI
var/atom/ability_user = ability.owner
var/distance = get_dist(ability_user, attacker)
if (distance < min_range || distance > max_range)
@@ -388,6 +388,7 @@
contents = list(
/mob/living/basic/ant = 2,
/mob/living/basic/construct/proteon = 2,
/mob/living/basic/dark_wizard = 2,
/mob/living/basic/flesh_spider = 2,
/mob/living/basic/garden_gnome = 2,
/mob/living/basic/killer_tomato = 2,
@@ -403,7 +404,6 @@
/mob/living/basic/spider/giant/nurse/scrawny = 2,
/mob/living/basic/spider/giant/tarantula/scrawny = 2,
/mob/living/basic/spider/giant/hunter/scrawny = 2,
/mob/living/simple_animal/hostile/dark_wizard = 2,
/mob/living/simple_animal/hostile/retaliate/goose = 2,
/mob/living/simple_animal/hostile/ooze = 1,
)
@@ -0,0 +1,77 @@
/// Wizard-looking guy who basically just shoots you
/mob/living/basic/dark_wizard
name = "Dark Wizard"
desc = "Killing amateurs since the dawn of times."
icon = 'icons/mob/simple/simple_human.dmi'
icon_state = "dark_wizard"
icon_living = "dark_wizard"
maxHealth = 50
health = 50
melee_damage_lower = 5
melee_damage_upper = 5
obj_damage = 20
basic_mob_flags = DEL_ON_DEATH
attack_verb_continuous = "staves"
attack_verb_simple = "stave"
combat_mode = TRUE
speak_emote = list("chants")
attack_sound = 'sound/items/weapons/bladeslice.ogg'
mob_biotypes = MOB_ORGANIC|MOB_HUMANOID
sentience_type = SENTIENCE_HUMANOID
faction = list(ROLE_WIZARD)
unsuitable_atmos_damage = 0
unsuitable_cold_damage = 0
unsuitable_heat_damage = 0
ai_controller = /datum/ai_controller/basic_controller/dark_wizard
/mob/living/basic/dark_wizard/Initialize(mapload)
. = ..()
apply_dynamic_human_appearance(src, mob_spawn_path = /obj/effect/mob_spawn/corpse/human/wizard/dark, r_hand = /obj/item/staff)
add_traits(list(TRAIT_LAVA_IMMUNE, TRAIT_ASHSTORM_IMMUNE, TRAIT_SNOWSTORM_IMMUNE), INNATE_TRAIT)
var/corpse = string_list(list(/obj/effect/decal/remains/human))
AddElement(/datum/element/death_drops, corpse)
AddElement(/datum/element/footstep, FOOTSTEP_MOB_SHOE)
AddElement(/datum/element/ai_retaliate)
AddComponent(\
/datum/component/ranged_attacks,\
projectile_type = /obj/projectile/temp/earth_bolt,\
projectile_sound = 'sound/effects/magic/ethereal_enter.ogg',\
cooldown_time = 2 SECONDS,\
)
var/datum/action/cooldown/spell/teleport/radius_turf/blink/slow/escape_spell = new(src)
escape_spell.Grant(src)
AddComponent(\
/datum/component/revenge_ability,\
escape_spell,\
max_range = 3,\
target_self = TRUE,\
)
new /obj/item/clothing/head/wizard/hood(src) // Having this hat in our contents allows us to cast wizard spells
/datum/ai_controller/basic_controller/dark_wizard
blackboard = list(
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
)
ai_movement = /datum/ai_movement/basic_avoidance
idle_behavior = /datum/idle_behavior/idle_random_walk
planning_subtrees = list(
/datum/ai_planning_subtree/target_retaliate, // If you get them to shoot each other it will start a wiz-war
/datum/ai_planning_subtree/simple_find_target,
/datum/ai_planning_subtree/maintain_distance,
/datum/ai_planning_subtree/ranged_skirmish/no_minimum,
)
/// I don't know why an earth bolt freezes you but I guess it does
/obj/projectile/temp/earth_bolt
name = "earth bolt"
icon_state = "declone"
damage = 4
damage_type = BURN
armor_flag = ENERGY
temperature = -100
@@ -1,46 +0,0 @@
/mob/living/simple_animal/hostile/dark_wizard
name = "Dark Wizard"
desc = "Killing amateurs since the dawn of times."
icon = 'icons/mob/simple/simple_human.dmi'
icon_state = "dark_wizard"
icon_living = "dark_wizard"
move_to_delay = 10
projectiletype = /obj/projectile/temp/earth_bolt
projectilesound = 'sound/effects/magic/ethereal_enter.ogg'
ranged = TRUE
ranged_message = "earth bolts"
ranged_cooldown_time = 20
maxHealth = 50
health = 50
harm_intent_damage = 5
obj_damage = 20
melee_damage_lower = 5
melee_damage_upper = 5
attack_verb_continuous = "staves"
combat_mode = TRUE
speak_emote = list("chants")
attack_sound = 'sound/items/weapons/bladeslice.ogg'
aggro_vision_range = 9
turns_per_move = 5
mob_biotypes = MOB_ORGANIC|MOB_HUMANOID
sentience_type = SENTIENCE_HUMANOID
faction = list(ROLE_WIZARD)
footstep_type = FOOTSTEP_MOB_SHOE
weather_immunities = list(TRAIT_LAVA_IMMUNE, TRAIT_ASHSTORM_IMMUNE)
minbodytemp = 0
maxbodytemp = INFINITY
atmos_requirements = null
loot = list(/obj/effect/decal/remains/human)
del_on_death = TRUE
/mob/living/simple_animal/hostile/dark_wizard/Initialize(mapload)
. = ..()
apply_dynamic_human_appearance(src, mob_spawn_path = /obj/effect/mob_spawn/corpse/human/wizard/dark, r_hand = /obj/item/staff)
/obj/projectile/temp/earth_bolt
name = "earth bolt"
icon_state = "declone"
damage = 4
damage_type = BURN
armor_flag = ENERGY
temperature = -100 // closer to the old temp loss
@@ -17,3 +17,8 @@
outer_tele_radius = 6
post_teleport_sound = 'sound/effects/magic/blink.ogg'
/datum/action/cooldown/spell/teleport/radius_turf/blink/slow
name = "Minor Blink"
desc = "This spell randomly teleports you a short distance, you're still practising doing it quickly."
cooldown_time = 8 SECONDS
@@ -31,7 +31,6 @@
/mob/living/simple_animal/hostile/asteroid/elite/pandora,
/mob/living/simple_animal/hostile/asteroid/polarbear,
/mob/living/simple_animal/hostile/asteroid/polarbear/lesser,
/mob/living/simple_animal/hostile/dark_wizard,
/mob/living/simple_animal/hostile/illusion,
/mob/living/simple_animal/hostile/illusion/escape,
/mob/living/simple_animal/hostile/illusion/mirage,
+1 -1
View File
@@ -5068,6 +5068,7 @@
#include "code\modules\mob\living\basic\pets\pet_cult\pet_cult_abilities.dm"
#include "code\modules\mob\living\basic\pets\pet_cult\pet_cult_ai.dm"
#include "code\modules\mob\living\basic\ruin_defender\cybersun_aicore.dm"
#include "code\modules\mob\living\basic\ruin_defender\dark_wizard.dm"
#include "code\modules\mob\living\basic\ruin_defender\flesh.dm"
#include "code\modules\mob\living\basic\ruin_defender\living_floor.dm"
#include "code\modules\mob\living\basic\ruin_defender\mad_piano.dm"
@@ -5349,7 +5350,6 @@
#include "code\modules\mob\living\simple_animal\bot\mulebot.dm"
#include "code\modules\mob\living\simple_animal\bot\secbot.dm"
#include "code\modules\mob\living\simple_animal\bot\SuperBeepsky.dm"
#include "code\modules\mob\living\simple_animal\hostile\dark_wizard.dm"
#include "code\modules\mob\living\simple_animal\hostile\hostile.dm"
#include "code\modules\mob\living\simple_animal\hostile\illusion.dm"
#include "code\modules\mob\living\simple_animal\hostile\ooze.dm"
@@ -0,0 +1 @@
/mob/living/simple_animal/hostile/dark_wizard : /mob/living/basic/dark_wizard{@OLD}