From 2ef9be35d9c38656272e12b85bf089c985d39fbd Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Sat, 19 Apr 2025 14:13:12 -0400 Subject: [PATCH] Constructs now have their respective factions (#90690) ## About The Pull Request Holy constructs are now part of a new Holy faction, that all Chaplains get once they choose a sect. Wizard constructs are now part of the Wizard faction Juggernaut's Gaunlet Echo spell now respects factions (so ignores cult as cult, wizards as wizard, and their creator as holy) https://github.com/user-attachments/assets/e56f958d-fffa-4534-8b39-a95f9d160865 ## Why It's Good For The Game Makes constructs less likely to friendly fire and makes holy constructs able to use their spells to fight Cult. ## Changelog :cl: Ezel/Improvedname, JohnFulpWillard fix: Constructs now have their proper factions, so Wizard constructs can't hit Wizard Apprentices. fix: Juggernaut's Gauntlet echo spell now respects factions. /:cl: --- code/__DEFINES/mobfactions.dm | 2 ++ code/modules/mob/living/basic/cult/constructs/artificer.dm | 2 ++ code/modules/mob/living/basic/cult/constructs/juggernaut.dm | 2 ++ code/modules/mob/living/basic/cult/constructs/wraith.dm | 2 ++ code/modules/projectiles/projectile/magic.dm | 1 - code/modules/religion/religion_sects.dm | 2 ++ .../spells/spell_types/projectile/_basic_projectile.dm | 1 + code/modules/spells/spell_types/projectile/juggernaut.dm | 5 +++++ 8 files changed, 16 insertions(+), 1 deletion(-) diff --git a/code/__DEFINES/mobfactions.dm b/code/__DEFINES/mobfactions.dm index cb934a28f5c..9f6362999ab 100644 --- a/code/__DEFINES/mobfactions.dm +++ b/code/__DEFINES/mobfactions.dm @@ -85,6 +85,8 @@ #define FACTION_VINES "vines" ///raptor factions #define FACTION_RAPTOR "raptor" +///holy faction, for anything part of the church +#define FACTION_HOLY "holy" // Antagonist factions /// Cultists and their constructs diff --git a/code/modules/mob/living/basic/cult/constructs/artificer.dm b/code/modules/mob/living/basic/cult/constructs/artificer.dm index 1d66f193ebc..0e65e8ae5ef 100644 --- a/code/modules/mob/living/basic/cult/constructs/artificer.dm +++ b/code/modules/mob/living/basic/cult/constructs/artificer.dm @@ -48,6 +48,7 @@ // Alternate artificer themes /mob/living/basic/construct/artificer/angelic desc = "A bulbous construct dedicated to building and maintaining holy armies." + faction = list(FACTION_HOLY) theme = THEME_HOLY construct_spells = list( /datum/action/cooldown/spell/conjure/soulstone/purified, @@ -61,6 +62,7 @@ ADD_TRAIT(src, TRAIT_ANGELIC, INNATE_TRAIT) /mob/living/basic/construct/artificer/mystic + faction = list(ROLE_WIZARD) theme = THEME_WIZARD construct_spells = list( /datum/action/cooldown/spell/conjure/cult_floor, diff --git a/code/modules/mob/living/basic/cult/constructs/juggernaut.dm b/code/modules/mob/living/basic/cult/constructs/juggernaut.dm index 696cb4db853..0b6e434558e 100644 --- a/code/modules/mob/living/basic/cult/constructs/juggernaut.dm +++ b/code/modules/mob/living/basic/cult/constructs/juggernaut.dm @@ -54,6 +54,7 @@ // Alternate juggernaut themes /mob/living/basic/construct/juggernaut/angelic + faction = list(FACTION_HOLY) theme = THEME_HOLY /mob/living/basic/construct/juggernaut/angelic/Initialize(mapload) @@ -61,4 +62,5 @@ ADD_TRAIT(src, TRAIT_ANGELIC, INNATE_TRAIT) /mob/living/basic/construct/juggernaut/mystic + faction = list(ROLE_WIZARD) theme = THEME_WIZARD diff --git a/code/modules/mob/living/basic/cult/constructs/wraith.dm b/code/modules/mob/living/basic/cult/constructs/wraith.dm index 4a41bc1cc2a..e73718d4fe3 100644 --- a/code/modules/mob/living/basic/cult/constructs/wraith.dm +++ b/code/modules/mob/living/basic/cult/constructs/wraith.dm @@ -32,6 +32,7 @@ // Alternate wraith themes /mob/living/basic/construct/wraith/angelic + faction = list(FACTION_HOLY) theme = THEME_HOLY construct_spells = list( /datum/action/cooldown/spell/jaunt/ethereal_jaunt/shift/angelic, @@ -43,6 +44,7 @@ ADD_TRAIT(src, TRAIT_ANGELIC, INNATE_TRAIT) /mob/living/basic/construct/wraith/mystic + faction = list(ROLE_WIZARD) theme = THEME_WIZARD construct_spells = list( /datum/action/cooldown/spell/jaunt/ethereal_jaunt/shift/mystic, diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index 02238021e33..a71e72e2938 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -533,7 +533,6 @@ hitsound = 'sound/items/weapons/punch3.ogg' trigger_range = 0 antimagic_flags = MAGIC_RESISTANCE_HOLY - ignored_factions = list(FACTION_CULT) range = 105 speed = 0.15 diff --git a/code/modules/religion/religion_sects.dm b/code/modules/religion/religion_sects.dm index 503d1f850c0..aa5de910cf5 100644 --- a/code/modules/religion/religion_sects.dm +++ b/code/modules/religion/religion_sects.dm @@ -59,6 +59,7 @@ SHOULD_CALL_PARENT(TRUE) to_chat(chap, span_boldnotice("\"[quote]\"")) to_chat(chap, span_notice("[desc]")) + chap.faction |= FACTION_HOLY /// Activates if religious sect is reset by admins, should clean up anything you added on conversion. /datum/religion_sect/proc/on_deconversion(mob/living/chap) @@ -66,6 +67,7 @@ to_chat(chap, span_boldnotice("You have lost the approval of \the [name].")) if(chap.mind.holy_role == HOLY_ROLE_HIGHPRIEST) to_chat(chap, span_notice("Return to an altar to reform your sect.")) + chap.faction -= FACTION_HOLY /// Returns TRUE if the item can be sacrificed. Can be modified to fit item being tested as well as person offering. Returning TRUE will stop the attackby sequence and proceed to on_sacrifice. /datum/religion_sect/proc/can_sacrifice(obj/item/sacrifice, mob/living/chap) diff --git a/code/modules/spells/spell_types/projectile/_basic_projectile.dm b/code/modules/spells/spell_types/projectile/_basic_projectile.dm index bcab5633ecc..243994af49d 100644 --- a/code/modules/spells/spell_types/projectile/_basic_projectile.dm +++ b/code/modules/spells/spell_types/projectile/_basic_projectile.dm @@ -28,3 +28,4 @@ to_fire.aim_projectile(target, caster) SEND_SIGNAL(caster, COMSIG_MOB_SPELL_PROJECTILE, src, target, to_fire) to_fire.fire() + return to_fire diff --git a/code/modules/spells/spell_types/projectile/juggernaut.dm b/code/modules/spells/spell_types/projectile/juggernaut.dm index 8d339298a37..4bfb1dd728e 100644 --- a/code/modules/spells/spell_types/projectile/juggernaut.dm +++ b/code/modules/spells/spell_types/projectile/juggernaut.dm @@ -12,3 +12,8 @@ spell_requirements = NONE projectile_type = /obj/projectile/magic/aoe/juggernaut + +/datum/action/cooldown/spell/basic_projectile/juggernaut/fire_projectile(atom/target, mob/caster) + var/obj/projectile/magic/aoe/juggernaut/to_fire = ..() + to_fire.ignored_factions = caster.faction + return to_fire