Skip to content

Commit

Permalink
fix(necromancer): removes various bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Filatelele authored Dec 12, 2023
1 parent c92dae7 commit 8c398df
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 35 deletions.
2 changes: 1 addition & 1 deletion code/__defines/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@
/datum/reagent/mindbreaker,\
/datum/reagent/psilocybin)

#define SPELL_NOREMORSE_GHOST_DAMAGE 2 ///How much damage the ghosts do when attacking mobs during no remorse spell
#define SPELL_NOREMORSE_GHOST_DAMAGE 1 ///How much damage the ghosts do when attacking mobs during no remorse spell

/proc/human_height_text(x)
switch(x)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/wizard/undead/undead_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
my_mob.add_spell(new /datum/spell/toggled/lich_form)
my_mob.add_spell(new /datum/spell/aoe_turf/knock)
my_mob.add_spell(new /datum/spell/targeted/projectile/magic_missile)
my_mob.add_spell(new /datum/spell/hand/marsh_of_the_dead)
my_mob.add_spell(new /datum/spell/hand/charges/marsh_of_the_dead)
my_mob.add_spell(new /datum/spell/toggled/immaterial_form)

/datum/wizard/undead/Destroy()
Expand Down
27 changes: 24 additions & 3 deletions code/modules/ghosttrap/trap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,38 @@ var/list/ghost_traps
/datum/ghosttrap/undead/request_player(mob/target, request_string, request_timeout, mob/living/caster, should_lichify = FALSE)
necromancer = caster
lichify = should_lichify
return ..()

if(request_timeout)
request_timeouts[target] = world.time + request_timeout
register_signal(target, SIGNAL_QDELETING, /datum/ghosttrap/proc/unregister_target, override = TRUE)
else
unregister_target(target)

for(var/mob/observer/ghost/O in GLOB.player_list)
if(!O.client)
continue

if(pref_check && !O.client.wishes_to_be_role(pref_check))
continue

INVOKE_ASYNC(src, nameof(.proc/send_request), target, O, request_timeout)

/datum/ghosttrap/undead/proc/send_request(mob/target, mob/observer/ghost, request_timeout)
var/player_choice = tgui_alert(ghost, "A necromancer is requesting a soul to animate an undead body.", "Would you like to become undead?", list("Yes", "No"), request_timeout)
if(player_choice == "Yes")
if(target.key)
to_chat(ghost, SPAN_WARNING("Target is already occupied!"))
return

transfer_personality(ghost, target)

/datum/ghosttrap/undead/transfer_personality(mob/candidate, mob/target)
report_progress("Transfering personality")
target.ckey = candidate.ckey
if(target.mind)
target.mind.assigned_role = "[ghost_trap_role]"
announce_ghost_joinleave(candidate, 0, "[ghost_trap_message]")

target.mind = candidate.mind
target.mind.current.reload_fullscreen()

welcome_candidate(target)

Expand Down
1 change: 1 addition & 0 deletions code/modules/spells/artifacts/ghost_gramophone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ GLOBAL_LIST_EMPTY(ghost_gramophones)
active = TRUE
last_activated = world.time
visible_message(SPAN_NOTICE("The gramophone starts spinning its record with a squeak."))
notify_ghosts("A ghost gramophone is channeling words said nearby it!", null, src, action = NOTIFY_JUMP, posses_mob = FALSE)
set_next_think(world.time + GRAMOPHONE_ACTIVE_TIME)
else
to_chat(user, SPAN_NOTICE("You try to turn on the [src], but to no avail! Maybe you should try again later?"))
Expand Down
17 changes: 4 additions & 13 deletions code/modules/spells/artifacts/plague_bell.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,14 @@

var/damage_delivered = 0 //The necromancer will be healed by a percentage of the total damage delivered this tick.

for(var/atom/A in hearers(6, get_turf(loc))) // Here we will actually damage mobs in range
if(A == master)
for(var/mob/living/M in GLOB.living_mob_list_) // Here we will actually damage mobs in range
if(get_dist(master, get_turf(M)) > world.view)
continue

var/mob/living/M = A
if(!istype(M))
continue
else if(istype(A,/obj/mecha))
var/obj/mecha/mecha = A
if(!mecha.occupant)
continue

M = mecha.occupant
else
if(M == master)
continue

if(M.is_ic_dead() || M.isSynthetic() || isundead(M))
if(M.isSynthetic() || isundead(M))
continue

M.adjustBruteLoss(DAMAGE_PER_TICK)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/spells/classes/necromancer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
spells = list(
SPELL_DATA(/datum/spell/targeted/raiseundead, 1),
SPELL_DATA(/datum/spell/targeted/raiseundead/lichify, 3),
SPELL_DATA(/datum/spell/hand/marsh_of_the_dead, 1),
SPELL_DATA(/datum/spell/hand/charges/marsh_of_the_dead, 1),
SPELL_DATA(/datum/spell/toggled/immaterial_form, 1),
SPELL_DATA(/datum/spell/targeted/noremorse, 1),
SPELL_DATA(/datum/spell/aoe_turf/conjure/tombstone, 1),
Expand Down
11 changes: 6 additions & 5 deletions code/modules/spells/hand/marsh_of_the_dead.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define MARSH_MAX_UNBUCKLE_TIME 40 SECONDS
#define MARSH_DAMAGE_PER_UPGRADE 10

/datum/spell/hand/marsh_of_the_dead
/datum/spell/hand/charges/marsh_of_the_dead
name = "Marsh of the dead"
desc = "This spell creates a puddle of vile pus, staggering any mortal."
school = "necromancy"
Expand All @@ -12,20 +12,21 @@
spell_flags = 0
invocation_type = SPI_NONE
show_message = "snaps their fingers."
spell_delay = 50
spell_delay = 2 SECONDS
icon_state = "wiz_marsh"
level_max = list(SP_TOTAL = 3, SP_SPEED = 1, SP_POWER = 2)
var/damage = 0
override_base = "const"
charge_max = 600
cooldown_min = 300
max_casts = 3

/datum/spell/hand/marsh_of_the_dead/cast_hand(atom/a, mob/user)
/datum/spell/hand/charges/marsh_of_the_dead/cast_hand(atom/a, mob/user)
for(var/turf/simulated/T in view(1,a))
new /obj/effect/deadhands(T, damage)
return ..()

/datum/spell/hand/marsh_of_the_dead/empower_spell()
/datum/spell/hand/charges/marsh_of_the_dead/empower_spell()
. = ..()
if(!.)
return FALSE
Expand Down Expand Up @@ -80,7 +81,7 @@
if(H.species.species_flags & SPECIES_FLAG_NO_TANGLE)
return

victim.visible_message(SPAN_DANGER("You're stuck in \the [src]!"))
to_chat(victim, SPAN_DANGER("You're stuck in \the [src]!"))

victim.forceMove(loc)

Expand Down
8 changes: 4 additions & 4 deletions code/modules/spells/targeted/no_remorse.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/datum/spell/targeted/noremorse
name = "No remorse"
desc = ""
feedback = ""
desc = "Designate a mortal who will be attacked by beings from the Realm Of The Dead. Those beings however may choose not to obey your will."
feedback = "NR"
school = "necromancy"

invocation = "Facite vindictam!"
Expand All @@ -28,7 +28,7 @@

ADD_TRAIT(victim, TRAIT_GHOSTATTACKABLE)

notify_ghosts("A powerful necromancer has allowed you to exact revenge on [victim]! Click on him to unleash your fury!", null, victim, action = NOTIFY_JUMP, posses_mob = FALSE)
notify_ghosts("A powerful necromancer has allowed you to exact revenge on [victim]! Click on him to unleash your fury!", null, victim, action = NOTIFY_ATTACK, posses_mob = FALSE)

/datum/modifier/status_effect/ghostattackable
duration = 15 SECONDS
duration = 10 SECONDS
13 changes: 6 additions & 7 deletions code/modules/spells/targeted/raiseundead.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
invocation = "De sepulchro suscitate et servite mihi!"
invocation_type = SPI_SHOUT
max_targets = 1
charge_max = 6000
cooldown_min = 3000
cooldown_reduc = 1000
charge_max = 3600
cooldown_min = 1800
cooldown_reduc = 600
level_max = list(SP_TOTAL = 3, SP_SPEED = 3, SP_POWER = 0)
compatible_mobs = list(/mob/living/carbon/human)
icon_state = "wiz_raiseundead"
Expand Down Expand Up @@ -42,9 +42,9 @@
if(should_lichify && (target.mind?.wizard in user.mind.wizard.thralls)) // Lichifying him without further ado
target.make_undead(user, should_lichify)

if(!target.client || target.mind)
if(!target.client && target.mind)
for(var/mob/observer/ghost/ghost in GLOB.ghost_mob_list)
if(ghost.mind?.key != target.mind.key)
if(ghost.mind?.key != target.mind?.key)
continue

ghost.can_reenter_corpse = TRUE
Expand Down Expand Up @@ -103,7 +103,7 @@
if(!mind)
return

if(mind.wizard && !istype(mind.wizard, /datum/wizard/undead))
if(!istype(mind.wizard, /datum/wizard/undead))
GLOB.wizards.add_antagonist_mind(mind, TRUE, "undead", "<b>You are undead! Your job is to serve your master!</b>")
mind.wizard = new /datum/wizard/undead(src, necromancer)

Expand Down Expand Up @@ -132,7 +132,6 @@
to_chat(src, SPAN_DANGER("<font size=6>You are now a lich serving as an apprentice to your master, \the [necromancer].</font>"))
else
to_chat(necromancer, SPAN_DANGER("You feel a soul answering your call. You now have a new thrall."))
to_chat(src, SPAN_DANGER("<font size=6>Your consciousness awakens in a cold body. You are alive, but at what cost?</font>"))
to_chat(src, SPAN_DANGER("<font size=6>Raised as undead, stripped of free will you now have one task - obey your master, \the [necromancer].</font>"))

#undef RAISE_UNDEAD_TIMEOUT

0 comments on commit 8c398df

Please sign in to comment.