Skip to content

Commit

Permalink
Merge pull request #733 from LikeLakers2/fix-timestop-guardian---copy
Browse files Browse the repository at this point in the history
Enable Timestop Guardian on all guardian creator items; Plus, Standard Guardian returns!
  • Loading branch information
dwasint authored Dec 19, 2023
2 parents 9402cd3 + 98ceb2a commit 94e0bd9
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 23 deletions.
24 changes: 23 additions & 1 deletion code/modules/mob/living/basic/guardian/guardian_creator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ GLOBAL_LIST_INIT(guardian_radial_images, setup_guardian_radial())
option.info = span_boldnotice(initial(guardian_path.creator_desc))
.[guardian_path] = option

//MONKESTATION EDIT START
// Hack to change Timestop Guardian's radial icon, since it's in a different DMI
var/datum/radial_menu_choice/timestop_opt = .[/mob/living/basic/guardian/standard/timestop]
timestop_opt.image = image(icon = 'monkestation/icons/bloodsuckers/timestop_guardian.dmi', icon_state = "timestop")
//MONKESTATION EDIT END

/// An item which grants you your very own soul buddy
/obj/item/guardian_creator
name = "enchanted deck of tarot cards"
Expand Down Expand Up @@ -51,6 +57,9 @@ GLOBAL_LIST_INIT(guardian_radial_images, setup_guardian_radial())
/mob/living/basic/guardian/ranged,
/mob/living/basic/guardian/standard,
/mob/living/basic/guardian/support,
//MONKESTATION EDIT START
/mob/living/basic/guardian/standard/timestop,
//MONKESTATION EDIT END
)

/obj/item/guardian_creator/Initialize(mapload)
Expand Down Expand Up @@ -142,6 +151,9 @@ GLOBAL_LIST_INIT(guardian_radial_images, setup_guardian_radial())
/mob/living/basic/guardian/protector,
/mob/living/basic/guardian/ranged,
/mob/living/basic/guardian/standard,
//MONKESTATION EDIT START
/mob/living/basic/guardian/standard/timestop,
//MONKESTATION EDIT END
)

/obj/item/guardian_creator/wizard/spawn_guardian(mob/living/user, mob/dead/candidate)
Expand Down Expand Up @@ -204,5 +216,15 @@ GLOBAL_LIST_INIT(guardian_radial_images, setup_guardian_radial())
/mob/living/basic/guardian/protector, // Bodyblocks projectiles for you
/mob/living/basic/guardian/ranged, // Shoots the bad guys
/mob/living/basic/guardian/standard, // Can mine walls
/mob/living/basic/guardian/support, // Heals and teleports you
//MONKESTATION REMOVAL START
/// The Support Power Miner is being made temporarily unavailable to the
/// Power Miner shard to limit frustration (and the number of ahelps),
/// as Support's heal is currently bugged, severely limiting its
/// usefulness. This removal will be undone when we figure out how to
/// fix such an issue.
// /mob/living/basic/guardian/support, // Heals and teleports you
//MONKESTATION REMOVAL END
//MONKESTATION EDIT START
/mob/living/basic/guardian/standard/timestop,
//MONKESTATION EDIT END
)
Original file line number Diff line number Diff line change
@@ -1,19 +1,51 @@
///Bloodsuckers spawning a Guardian will get the Bloodsucker one instead.
/obj/item/guardian_creator/spawn_guardian(mob/living/user, mob/dead/candidate)
/obj/item/guardian_creator/attack_self(mob/living/user)
// If this code looks odd, it's because I'm intentionally inserting a hack,
// as I'm trying to avoid touching `guardian_creator.dm` in a major way. The
// intent with this hack is to force Bloodsuckers to always get a Timestop
// Guardian, no matter the item that a Bloodsucker uses to get a guardian.
//
// There is plans to refactor/modularization guardians, which will hopefully
// allow this all to happen without as much of a hack.

// START COPIED CODE FROM guardian_creator.dm
if(isguardian(user) && !allow_guardian)
balloon_alert(user, "can't do that!")
return
var/list/guardians = user.get_all_linked_holoparasites()
if(length(guardians))
to_chat(user, span_holoparasite("You already have a [mob_name]!"))
used = FALSE
if(length(guardians) && !allow_multiple)
balloon_alert(user, "already have one!")
return
if(user.mind && user.mind.has_antag_datum(/datum/antagonist/changeling) && !allow_changeling)
to_chat(user, ling_failure)
return
if(IS_BLOODSUCKER(user))
var/mob/living/basic/guardian/standard/bloodsucker_guardian = new(user, GUARDIAN_THEME_MAGIC)

bloodsucker_guardian.set_summoner(user, different_person = TRUE)
bloodsucker_guardian.key = candidate.key
user.log_message("has summoned [key_name(bloodsucker_guardian)], a [bloodsucker_guardian.creator_name] holoparasite.", LOG_GAME)
bloodsucker_guardian.log_message("was summoned as a [bloodsucker_guardian.creator_name] holoparasite.", LOG_GAME)
to_chat(user, replacetext(success_message, "%GUARDIAN", mob_name))
bloodsucker_guardian.client?.init_verbs()
if(used)
to_chat(user, used_message)
return
// END COPIED CODE FROM guardian_creator.dm

if (IS_BLOODSUCKER(user))
//var/mob/living/basic/guardian/standard/timestop/guardian_path = new(user, GUARDIAN_THEME_MAGIC)
var/mob/living/basic/guardian/guardian_path = /mob/living/basic/guardian/standard/timestop

// START COPIED CODE FROM guardian_creator.dm
used = TRUE
to_chat(user, use_message)
var/guardian_type_name = capitalize(initial(guardian_path.creator_name))
var/list/mob/dead/observer/candidates = poll_ghost_candidates(
"Do you want to play as [user.real_name]'s [guardian_type_name] [mob_name]?",
jobban_type = ROLE_PAI,
poll_time = 10 SECONDS,
ignore_category = POLL_IGNORE_HOLOPARASITE,
)
if(LAZYLEN(candidates))
var/mob/dead/observer/candidate = pick(candidates)
spawn_guardian(user, candidate, guardian_path)
else
to_chat(user, failure_message)
used = FALSE
// END COPIED CODE FROM guardian_creator.dm

return

// Call parent to deal with everyone else
Expand All @@ -22,21 +54,35 @@
/**
* The Guardian itself
*/
/mob/living/basic/guardian/standard
/mob/living/basic/guardian/standard/timestop
// Like Bloodsuckers do, you will take more damage to Burn and less to Brute
damage_coeff = list(BRUTE = 0.5, BURN = 2.5, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0)

creator_name = "Timestop"
creator_desc = "Devastating close combat attacks and high damage resistance. Can smash through weak walls and stop time."
creator_icon = "standard"
creator_icon = "timestop"

/mob/living/basic/guardian/standard/Initialize(mapload, theme)
/mob/living/basic/guardian/standard/timestop/Initialize(mapload, theme)
//Wizard Holoparasite theme, just to be more visibly stronger than regular ones
theme = GLOB.guardian_themes[GUARDIAN_THEME_TECH]
. = ..()
var/datum/action/cooldown/spell/timestop/guardian/timestop_ability = new()
timestop_ability.Grant(src)

/mob/living/basic/guardian/standard/timestop/set_summoner(mob/living/to_who, different_person = FALSE)
..()
for(var/action in actions)
var/datum/action/cooldown/spell/timestop/guardian/timestop_ability = action
if(istype(timestop_ability))
timestop_ability.grant_summoner_immunity()

/mob/living/basic/guardian/standard/timestop/cut_summoner(different_person = FALSE)
for(var/action in actions)
var/datum/action/cooldown/spell/timestop/guardian/timestop_ability = action
if(istype(timestop_ability))
timestop_ability.remove_summoner_immunity()
..()

///Guardian Timestop ability
/datum/action/cooldown/spell/timestop/guardian
name = "Guardian Timestop"
Expand All @@ -46,14 +92,12 @@
spell_requirements = NONE
invocation_type = INVOCATION_NONE

/datum/action/cooldown/spell/timestop/guardian/Grant(mob/grant_to)
. = ..()
var/mob/living/basic/guardian/standard/bloodsucker_guardian = owner
/datum/action/cooldown/spell/timestop/guardian/proc/grant_summoner_immunity()
var/mob/living/basic/guardian/standard/timestop/bloodsucker_guardian = owner
if(bloodsucker_guardian && istype(bloodsucker_guardian) && bloodsucker_guardian.summoner)
ADD_TRAIT(bloodsucker_guardian.summoner, TRAIT_TIME_STOP_IMMUNE, REF(src))

/datum/action/cooldown/spell/timestop/guardian/Remove(mob/remove_from)
var/mob/living/basic/guardian/standard/bloodsucker_guardian = owner
/datum/action/cooldown/spell/timestop/guardian/proc/remove_summoner_immunity()
var/mob/living/basic/guardian/standard/timestop/bloodsucker_guardian = owner
if(bloodsucker_guardian && istype(bloodsucker_guardian) && bloodsucker_guardian.summoner)
REMOVE_TRAIT(bloodsucker_guardian.summoner, TRAIT_TIME_STOP_IMMUNE, REF(src))
return ..()
Binary file not shown.

0 comments on commit 94e0bd9

Please sign in to comment.