From 5a1f375ee8c7920b60a97a53e7f54699f621dc97 Mon Sep 17 00:00:00 2001
From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>
Date: Sun, 8 Nov 2020 15:43:28 -0500
Subject: [PATCH 1/5] Adds 2 new advanced blood rites
---
code/__DEFINES/cult.dm | 2 +
code/game/gamemodes/cult/blood_magic.dm | 119 +++++++++++++++++++++---
code/game/gamemodes/cult/cult_items.dm | 9 ++
3 files changed, 115 insertions(+), 15 deletions(-)
diff --git a/code/__DEFINES/cult.dm b/code/__DEFINES/cult.dm
index e9965b2c999..2eadb7e33f2 100644
--- a/code/__DEFINES/cult.dm
+++ b/code/__DEFINES/cult.dm
@@ -19,6 +19,8 @@
#define RUNELESS_MAX_BLOODCHARGE 1
#define BLOOD_SPEAR_COST 150
#define BLOOD_BARRAGE_COST 300
+#define BLOOD_ORB_COST 50
+#define BLOOD_RECHARGE_COST 75
#define BLOOD_BEAM_COST 500
#define METAL_TO_CONSTRUCT_SHELL_CONVERSION 50
diff --git a/code/game/gamemodes/cult/blood_magic.dm b/code/game/gamemodes/cult/blood_magic.dm
index 4eb889b38f7..1164180e091 100644
--- a/code/game/gamemodes/cult/blood_magic.dm
+++ b/code/game/gamemodes/cult/blood_magic.dm
@@ -358,29 +358,32 @@
throwforce = 0
throw_range = 0
throw_speed = 0
+ var/has_source = TRUE //Does it have a source, AKA bloody empowerment.
var/invocation
var/uses = 1
var/health_cost = 0 //The amount of health taken from the user when invoking the spell
var/datum/action/innate/cult/blood_spell/source
/obj/item/melee/blood_magic/New(loc, spell)
- source = spell
- uses = source.charges
- health_cost = source.health_cost
+ if(has_source)
+ source = spell
+ uses = source.charges
+ health_cost = source.health_cost
..()
/obj/item/melee/blood_magic/Destroy()
- if(!QDELETED(source))
- if(uses <= 0)
- source.hand_magic = null
- qdel(source)
- source = null
- else
- source.hand_magic = null
- source.charges = uses
- source.desc = source.base_desc
- source.desc += "
Has [uses] use\s remaining."
- source.UpdateButtonIcon()
+ if(has_source)
+ if(!QDELETED(source))
+ if(uses <= 0)
+ source.hand_magic = null
+ qdel(source)
+ source = null
+ else
+ source.hand_magic = null
+ source.charges = uses
+ source.desc = source.base_desc
+ source.desc += "
Has [uses] use\s remaining."
+ source.UpdateButtonIcon()
..()
/obj/item/melee/blood_magic/attack_self(mob/living/user)
@@ -644,6 +647,47 @@
C.put_in_hands(new /obj/item/restraints/legcuffs/bola/cult(user))
C.visible_message("Otherworldly [armour ? "armour" : "equipment"] suddenly appears on [C]!")
..()
+//Used by blood rite, to recharge things like viel shifter or the cultest shielded robes
+/obj/item/melee/blood_magic/empower
+ name = "Bloody empowerment"
+ desc = "Can be used on some cult items, to restore them to their previous state."
+ invocation = "Ditans Gut'ura Inpulsa!"
+ color = "#9c0651"
+ has_source = FALSE //special, only availible for a blood cost.
+
+/obj/item/melee/blood_magic/empower/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
+ if(proximity_flag)
+
+ //Shielded suit
+ if(istype(target, /obj/item/clothing/suit/hooded/cultrobes/cult_shield))
+ var/obj/item/clothing/suit/hooded/cultrobes/cult_shield/C = target
+ if(C.current_charges < 3)
+ uses--
+ to_chat(user, "You empower the [target.name] with blood, recharging its shields!")
+ playsound(user, 'sound/magic/cult_spell.ogg', 25, TRUE)
+ C.current_charges = 3
+ C.shield_state = "shield-cult"
+ user.update_inv_wear_suit() // The only way a suit can be clicked on is if its on the floor, in the users bag, or on the user, so we will play it safe if it is on the user.
+ else
+ to_chat(user, "The [target.name] is fully charged!!")
+ return
+
+ //Plasteel to runed metal
+ else if(istype(target, /obj/item/cult_shift))
+ var/obj/item/cult_shift/S = target
+ if(S.uses < 4)
+ uses--
+ to_chat(user, "You empower the [target.name] with blood, recharging its ability to shift!")
+ playsound(user, 'sound/magic/cult_spell.ogg', 25, TRUE)
+ S.uses = 4
+ S.icon_state = "shifter"
+ else
+ to_chat(user, "The [target.name] is fully charged!!")
+ return
+ else
+ to_chat(user, "The spell will not work on [target]!")
+ return
+ ..()
//Blood Rite: Absorb blood to heal cult members or summon weapons
/obj/item/melee/blood_magic/manipulator
@@ -654,6 +698,7 @@
/obj/item/melee/blood_magic/manipulator/examine(mob/user)
. = ..()
. += "Blood spear and blood barrage cost [BLOOD_SPEAR_COST] and [BLOOD_BARRAGE_COST] charges respectively."
+ . += "Blood orb and blood empower cost [BLOOD_ORB_COST] and [BLOOD_RECHARGE_COST] charges respectively."
. += "You have collected [uses] charge\s of blood."
// This should really be split into multiple procs
@@ -765,6 +810,14 @@
//Draining blood on the floor
if(istype(target, /obj/effect/decal/cleanable/blood) || istype(target, /obj/effect/decal/cleanable/trail_holder))
blood_draw(target, user)
+ if(istype(target, /obj/item/blood_orb))
+ var/obj/item/blood_orb/candidate = target
+ if(candidate.blood)
+ uses += candidate.blood
+ to_chat(user, "You obtain [candidate.blood] from the orb of blood!")
+ playsound(user, 'sound/misc/enter_blood.ogg', 50)
+ qdel(candidate)
+
..()
/obj/item/melee/blood_magic/manipulator/proc/blood_draw(atom/target, mob/living/carbon/human/user)
@@ -790,7 +843,7 @@
uses += max(1, temp)
/obj/item/melee/blood_magic/manipulator/attack_self(mob/living/user)
- var/list/options = list("Blood Spear (150)", "Blood Bolt Barrage (300)")
+ var/list/options = list("Blood Orb (50)", "Bloody Empowerment (75)", "Blood Spear (150)", "Blood Bolt Barrage (300)")
var/choice = input(user, "Choose a greater blood rite...", "Greater Blood Rites") as null|anything in options
switch(choice)
if("Blood Spear (150)")
@@ -825,3 +878,39 @@
to_chat(user, "You need a free hand for this rite!")
uses += BLOOD_BARRAGE_COST // Refund the charges
qdel(rite)
+
+ if("Blood Orb (50)")
+ if(uses < BLOOD_ORB_COST)
+ to_chat(user, "You need [BLOOD_ORB_COST] charges to perform this rite.")
+ else
+ var/ammount = input("How much blood would you like to transfer, you have [uses] blood.", "How much blood?", 50) as null|num
+ if(ammount <50) // No 1 blood orbs, 50 or more.
+ to_chat(user, "You need to give up at least 50 blood.")
+ return
+ if(ammount > uses) // No free blood either
+ to_chat(user, "You do not have that much blood to give!")
+ return
+ uses -= ammount
+ var/turf/T = get_turf(user)
+ qdel(src)
+ var/obj/item/blood_orb/rite =new(T)
+ rite.blood = ammount
+ if(user.put_in_hands(rite))
+ to_chat(user, "A [rite.name] appears in your hand!")
+ else
+ user.visible_message("A [rite.name] appears at [user]'s feet!", \
+ "A [rite.name] materializes at your feet.")
+
+ if("Bloody Empowerment (75)")
+ if(uses < BLOOD_RECHARGE_COST)
+ to_chat(user, "You need [BLOOD_RECHARGE_COST] charges to perform this rite.")
+ else
+ var/obj/rite = new /obj/item/melee/blood_magic/empower()
+ uses -= BLOOD_RECHARGE_COST
+ qdel(src)
+ if(user.put_in_hands(rite))
+ to_chat(user, "Your hand glows with power!")
+ else
+ to_chat(user, "You need a free hand for this rite!")
+ uses += BLOOD_RECHARGE_COST // Refund the charges
+ qdel(rite)
diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm
index 6aa0f896f8f..d07433601b3 100644
--- a/code/game/gamemodes/cult/cult_items.dm
+++ b/code/game/gamemodes/cult/cult_items.dm
@@ -649,3 +649,12 @@
M.adjustHealth(-5)
new /obj/effect/temp_visual/cult/sparks(target)
..()
+
+/obj/item/blood_orb
+ name = "orb of blood"
+ icon = 'icons/obj/cult.dmi'
+ icon_state = "summoning_orb"
+ item_state = "summoning_orb"
+ desc = "It's an orb of crystalized blood. Can be used to transfer blood between cultests."
+ var/blood = 50
+
From 10d21e164aff819091fa559743d75415baff44ba Mon Sep 17 00:00:00 2001
From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>
Date: Sun, 8 Nov 2020 15:53:23 -0500
Subject: [PATCH 2/5] Spelling and details
---
code/game/gamemodes/cult/blood_magic.dm | 2 +-
code/game/gamemodes/cult/cult_items.dm | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/code/game/gamemodes/cult/blood_magic.dm b/code/game/gamemodes/cult/blood_magic.dm
index 1164180e091..9bc8a236e57 100644
--- a/code/game/gamemodes/cult/blood_magic.dm
+++ b/code/game/gamemodes/cult/blood_magic.dm
@@ -337,7 +337,7 @@
/datum/action/innate/cult/blood_spell/manipulation
name = "Blood Rites"
desc = "Empowers your hand to manipulate blood. Use on blood or a noncultist to absorb blood to be used later, use on yourself or another cultist to heal them using absorbed blood. \
- \nUse the spell in-hand to cast advanced rites, such as summoning a magical blood spear or firing blood projectiles out of your hands."
+ \nUse the spell in-hand to cast advanced rites, such as summoning a magical blood spear or firing blood projectiles out of your hands, or more!."
invocation = "Fel'th Dol Ab'orod!"
button_icon_state = "manip"
charges = 5
diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm
index d07433601b3..cd2f7223d52 100644
--- a/code/game/gamemodes/cult/cult_items.dm
+++ b/code/game/gamemodes/cult/cult_items.dm
@@ -655,6 +655,6 @@
icon = 'icons/obj/cult.dmi'
icon_state = "summoning_orb"
item_state = "summoning_orb"
- desc = "It's an orb of crystalized blood. Can be used to transfer blood between cultests."
+ desc = "It's an orb of crystalized blood. Can be used to transfer blood between cultists."
var/blood = 50
From 562589fc996e5d1f3153af64ba22a53a3e69936e Mon Sep 17 00:00:00 2001
From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>
Date: Sun, 8 Nov 2020 16:00:59 -0500
Subject: [PATCH 3/5] Name change and spacing
---
code/game/gamemodes/cult/blood_magic.dm | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/code/game/gamemodes/cult/blood_magic.dm b/code/game/gamemodes/cult/blood_magic.dm
index 9bc8a236e57..2ecf98a0306 100644
--- a/code/game/gamemodes/cult/blood_magic.dm
+++ b/code/game/gamemodes/cult/blood_magic.dm
@@ -649,7 +649,7 @@
..()
//Used by blood rite, to recharge things like viel shifter or the cultest shielded robes
/obj/item/melee/blood_magic/empower
- name = "Bloody empowerment"
+ name = "Blood Recharge"
desc = "Can be used on some cult items, to restore them to their previous state."
invocation = "Ditans Gut'ura Inpulsa!"
color = "#9c0651"
@@ -843,7 +843,7 @@
uses += max(1, temp)
/obj/item/melee/blood_magic/manipulator/attack_self(mob/living/user)
- var/list/options = list("Blood Orb (50)", "Bloody Empowerment (75)", "Blood Spear (150)", "Blood Bolt Barrage (300)")
+ var/list/options = list("Blood Orb (50)", "Blood Recharge (75)", "Blood Spear (150)", "Blood Bolt Barrage (300)")
var/choice = input(user, "Choose a greater blood rite...", "Greater Blood Rites") as null|anything in options
switch(choice)
if("Blood Spear (150)")
@@ -884,7 +884,7 @@
to_chat(user, "You need [BLOOD_ORB_COST] charges to perform this rite.")
else
var/ammount = input("How much blood would you like to transfer, you have [uses] blood.", "How much blood?", 50) as null|num
- if(ammount <50) // No 1 blood orbs, 50 or more.
+ if(ammount < 50) // No 1 blood orbs, 50 or more.
to_chat(user, "You need to give up at least 50 blood.")
return
if(ammount > uses) // No free blood either
@@ -893,7 +893,7 @@
uses -= ammount
var/turf/T = get_turf(user)
qdel(src)
- var/obj/item/blood_orb/rite =new(T)
+ var/obj/item/blood_orb/rite = new(T)
rite.blood = ammount
if(user.put_in_hands(rite))
to_chat(user, "A [rite.name] appears in your hand!")
@@ -901,7 +901,7 @@
user.visible_message("A [rite.name] appears at [user]'s feet!", \
"A [rite.name] materializes at your feet.")
- if("Bloody Empowerment (75)")
+ if("Blood Recharge (75)")
if(uses < BLOOD_RECHARGE_COST)
to_chat(user, "You need [BLOOD_RECHARGE_COST] charges to perform this rite.")
else
From 9cc5fe1dd88834007131eb74bd1843bf52b4d0a8 Mon Sep 17 00:00:00 2001
From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>
Date: Sun, 8 Nov 2020 17:05:17 -0500
Subject: [PATCH 4/5] Apply suggestions from steels code review
Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
---
code/game/gamemodes/cult/blood_magic.dm | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/code/game/gamemodes/cult/blood_magic.dm b/code/game/gamemodes/cult/blood_magic.dm
index 2ecf98a0306..9c2760f3353 100644
--- a/code/game/gamemodes/cult/blood_magic.dm
+++ b/code/game/gamemodes/cult/blood_magic.dm
@@ -337,7 +337,7 @@
/datum/action/innate/cult/blood_spell/manipulation
name = "Blood Rites"
desc = "Empowers your hand to manipulate blood. Use on blood or a noncultist to absorb blood to be used later, use on yourself or another cultist to heal them using absorbed blood. \
- \nUse the spell in-hand to cast advanced rites, such as summoning a magical blood spear or firing blood projectiles out of your hands, or more!."
+ \nUse the spell in-hand to cast advanced rites, such as summoning a magical blood spear, firing blood projectiles out of your hands, and more!."
invocation = "Fel'th Dol Ab'orod!"
button_icon_state = "manip"
charges = 5
@@ -358,7 +358,8 @@
throwforce = 0
throw_range = 0
throw_speed = 0
- var/has_source = TRUE //Does it have a source, AKA bloody empowerment.
+ /// Does it have a source, AKA bloody empowerment.
+ var/has_source = TRUE
var/invocation
var/uses = 1
var/health_cost = 0 //The amount of health taken from the user when invoking the spell
@@ -372,8 +373,7 @@
..()
/obj/item/melee/blood_magic/Destroy()
- if(has_source)
- if(!QDELETED(source))
+ if(has_source && !QDELETED(source))
if(uses <= 0)
source.hand_magic = null
qdel(source)
@@ -663,13 +663,13 @@
var/obj/item/clothing/suit/hooded/cultrobes/cult_shield/C = target
if(C.current_charges < 3)
uses--
- to_chat(user, "You empower the [target.name] with blood, recharging its shields!")
+ to_chat(user, "You empower [target] with blood, recharging its shields!")
playsound(user, 'sound/magic/cult_spell.ogg', 25, TRUE)
C.current_charges = 3
C.shield_state = "shield-cult"
user.update_inv_wear_suit() // The only way a suit can be clicked on is if its on the floor, in the users bag, or on the user, so we will play it safe if it is on the user.
else
- to_chat(user, "The [target.name] is fully charged!!")
+ to_chat(user, "[target] is already at full charge!")
return
//Plasteel to runed metal
@@ -677,12 +677,12 @@
var/obj/item/cult_shift/S = target
if(S.uses < 4)
uses--
- to_chat(user, "You empower the [target.name] with blood, recharging its ability to shift!")
+ to_chat(user, "You empower [target] with blood, recharging its ability to shift!")
playsound(user, 'sound/magic/cult_spell.ogg', 25, TRUE)
S.uses = 4
S.icon_state = "shifter"
else
- to_chat(user, "The [target.name] is fully charged!!")
+ to_chat(user, "[target] is already at full charge!")
return
else
to_chat(user, "The spell will not work on [target]!")
@@ -814,7 +814,7 @@
var/obj/item/blood_orb/candidate = target
if(candidate.blood)
uses += candidate.blood
- to_chat(user, "You obtain [candidate.blood] from the orb of blood!")
+ to_chat(user, "You obtain [candidate.blood] blood from the orb of blood!")
playsound(user, 'sound/misc/enter_blood.ogg', 50)
qdel(candidate)
@@ -883,7 +883,7 @@
if(uses < BLOOD_ORB_COST)
to_chat(user, "You need [BLOOD_ORB_COST] charges to perform this rite.")
else
- var/ammount = input("How much blood would you like to transfer, you have [uses] blood.", "How much blood?", 50) as null|num
+ var/ammount = input("How much blood would you like to transfer? You have [uses] blood.", "How much blood?", 50) as null|num
if(ammount < 50) // No 1 blood orbs, 50 or more.
to_chat(user, "You need to give up at least 50 blood.")
return
From d47ab6021bbbac55e5db3384775e67d711a072ae Mon Sep 17 00:00:00 2001
From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>
Date: Sun, 8 Nov 2020 17:48:35 -0500
Subject: [PATCH 5/5] Tabbing, and an extra period.
---
code/game/gamemodes/cult/blood_magic.dm | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/code/game/gamemodes/cult/blood_magic.dm b/code/game/gamemodes/cult/blood_magic.dm
index 9c2760f3353..2583fd693d3 100644
--- a/code/game/gamemodes/cult/blood_magic.dm
+++ b/code/game/gamemodes/cult/blood_magic.dm
@@ -337,7 +337,7 @@
/datum/action/innate/cult/blood_spell/manipulation
name = "Blood Rites"
desc = "Empowers your hand to manipulate blood. Use on blood or a noncultist to absorb blood to be used later, use on yourself or another cultist to heal them using absorbed blood. \
- \nUse the spell in-hand to cast advanced rites, such as summoning a magical blood spear, firing blood projectiles out of your hands, and more!."
+ \nUse the spell in-hand to cast advanced rites, such as summoning a magical blood spear, firing blood projectiles out of your hands, and more!"
invocation = "Fel'th Dol Ab'orod!"
button_icon_state = "manip"
charges = 5
@@ -374,16 +374,16 @@
/obj/item/melee/blood_magic/Destroy()
if(has_source && !QDELETED(source))
- if(uses <= 0)
- source.hand_magic = null
- qdel(source)
- source = null
- else
- source.hand_magic = null
- source.charges = uses
- source.desc = source.base_desc
- source.desc += "
Has [uses] use\s remaining."
- source.UpdateButtonIcon()
+ if(uses <= 0)
+ source.hand_magic = null
+ qdel(source)
+ source = null
+ else
+ source.hand_magic = null
+ source.charges = uses
+ source.desc = source.base_desc
+ source.desc += "
Has [uses] use\s remaining."
+ source.UpdateButtonIcon()
..()
/obj/item/melee/blood_magic/attack_self(mob/living/user)