From d7148f5bc0114ca40092ccf26b95a74840b5daeb Mon Sep 17 00:00:00 2001 From: destrucktoid <39823128+destrucktoid@users.noreply.github.com> Date: Tue, 30 Apr 2024 11:12:55 +0100 Subject: [PATCH] Bloodsucker additional levelling system. (#1140) ## About The Pull Request This system adds a new way for bloodsuckers to level in addition to their ordinary one, thus rewarding bloodsuckers for actually engaging in combat and doing antagonistic behaviours rather than playing extremely passive. Bloodsuckers that drink blood from creatures with a mind (has been or is controlled by a player) get that blood tracked and added to a new system, this blood can be used to purchase level ups. The blood consumed is taken out of your actual blood volume, meaning that you still need to spend your blood for this level up. Furthermore, whilst the blood per level starts at 30% of your max blood, it increases by 5% per level you gain with this feature, capping out at 90%. Before you ask, no you can't farm vassals for unlimited levels. I've set the points you get towards a level to be quartered from drinking from a vassal and if you remember, you cannot (currently) drink past your blood cap. Thus if i drink myself from 0 blood to 1000 blood on vassals alone, that's not enough for a single level. Furthermore, the usual blood drinking penalties apply (dead, non-human, mindless) No, you can't drink a bunch of blood, buy levels with the points (because it's theoretically cheaper to buy them whilst you are a lower level bloodsucker) and then spend them. The system is designed to auto spend normal levels first before later offering you the ability to buy a level in your coffin. ## Why It's Good For The Game Bloodsucker right now is an antagonist that is played extremely passively due to all clans except tremere and ventrue having no way to scale that involves combat. Thus you are better to just sit on your laurels and do nothing, waiting for levels to come to you rather than actually doing antagonist things ## Proof Of Testing Tested with @Arturlang, the code works as intended. https://www.youtube.com/watch?v=RWxp5fozlvc ## Changelog :cl: add: Added a new way for bloodsuckers to earn levels removed: Blood sucker passive levels no longer cost blood to attain. /:cl: --------- Co-authored-by: projectkepler-RU <99981766+projectkepler-ru@users.noreply.github.com> Co-authored-by: Swift --- .../code/__DEFINES/bloodsucker_defines.dm | 4 +++- .../bloodsucker/bloodsuckers/bloodsucker.dm | 4 ++++ .../bloodsucker/bloodsuckers/integration.dm | 1 + .../bloodsucker/bloodsuckers/life.dm | 5 +++++ .../bloodsucker/bloodsuckers/procs.dm | 18 ++++++++++++++++++ .../antagonists/bloodsucker/clans/clan.dm | 2 +- .../bloodsucker/structures/coffin.dm | 7 ++++--- 7 files changed, 36 insertions(+), 5 deletions(-) diff --git a/modular_zubbers/code/__DEFINES/bloodsucker_defines.dm b/modular_zubbers/code/__DEFINES/bloodsucker_defines.dm index 772b23c4951..0d80094d70a 100644 --- a/modular_zubbers/code/__DEFINES/bloodsucker_defines.dm +++ b/modular_zubbers/code/__DEFINES/bloodsucker_defines.dm @@ -26,7 +26,9 @@ #define HUMANITY_LOST_MAXIMUM 50 /// Level up blood cost define, max_blood * this = blood cost -#define BLOODSUCKER_LEVELUP_PERCENTAGE 0.15 +#define BLOODSUCKER_LEVELUP_PERCENTAGE 0 +/// Upper bound for Blood cost increase; used for blood thickening +#define BLOOD_LEVEL_GAIN_MAX 0.9 ///The level when at a bloodsucker becomes snobby about who they drink from and gain their non-fledling reputation #define BLOODSUCKER_HIGH_LEVEL 4 diff --git a/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/bloodsucker.dm b/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/bloodsucker.dm index 19eef3c0106..781a7495680 100644 --- a/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/bloodsucker.dm +++ b/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/bloodsucker.dm @@ -65,6 +65,10 @@ var/obj/structure/closet/crate/coffin var/total_blood_drank = 0 + /// Used for Bloodsuckers gaining levels from drinking blood + var/blood_level_gain = 0 + var/blood_level_gain_amount = 0 + ///Blood display HUD var/atom/movable/screen/bloodsucker/blood_counter/blood_display ///Vampire level display HUD diff --git a/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/integration.dm b/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/integration.dm index 9510c87df81..e50e1d3cbce 100644 --- a/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/integration.dm +++ b/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/integration.dm @@ -58,6 +58,7 @@ . += "" . += "Blood Drank: [bloodsuckerdatum.total_blood_drank]" . += "Maximum blood: [bloodsuckerdatum.max_blood_volume]" + . += "Blood Thickening: [bloodsuckerdatum.blood_level_gain] / [bloodsuckerdatum.get_level_cost()]" if(bloodsuckerdatum.frenzied) . += "Frenzy exit blood threshold: [bloodsuckerdatum.frenzy_exit_threshold()]" else diff --git a/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/life.dm b/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/life.dm index 3dcaf90a1dc..fdcf0f666f5 100644 --- a/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/life.dm +++ b/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/life.dm @@ -102,6 +102,11 @@ target.reagents.trans_to(owner.current, INGEST, 1) // Run transfer of 1 unit of reagent from them to me. owner.current.playsound_local(null, 'sound/effects/singlebeat.ogg', 40, 1) // Play THIS sound for user only. The "null" is where turf would go if a location was needed. Null puts it right in their head. total_blood_drank += blood_taken + if(target.mind) // Checks if the target has a mind + if(IS_VASSAL(target)) // Checks if the target is a vassal + blood_level_gain += blood_taken / 4 + else + blood_level_gain += blood_taken return blood_taken /** diff --git a/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/procs.dm b/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/procs.dm index bdcd7accda2..ee421120e0f 100644 --- a/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/procs.dm +++ b/modular_zubbers/code/modules/antagonists/bloodsucker/bloodsuckers/procs.dm @@ -165,6 +165,24 @@ //returnString += "\n" Don't need spacers. Using . += "" in examine.dm does this on its own. return returnIcon + returnString +// Blood level gain is used to give Bloodsuckers more levels if they are being agressive and drinking from real, sentient people. +// The maximum blood that counts towards this +/datum/antagonist/bloodsucker/proc/blood_level_gain() + var/level_cost = get_level_cost() + if(blood_level_gain >= level_cost && bloodsucker_blood_volume >= level_cost) // Checks if we have drunk enough blood from the living to allow us to gain a level up as well as checking if we have enough blood to actually use on the level up + switch(tgui_alert(owner.current, "You have drunk enough blood from the living to thicken your blood, this will cost you [level_cost] blood and give you another level", "Thicken your blood?.", list("Yes", "No"))) //asks user if they want to spend their blood on a level + if("Yes") + AdjustUnspentRank(1) // gives level + blood_level_gain -= level_cost // Subtracts the cost from the pool of drunk blood + AdjustBloodVolume(-level_cost) // Subtracts the cost from the bloodsucker's actual blood + blood_level_gain_amount += 1 // Increments the variable that makes future levels more expensive + +/datum/antagonist/bloodsucker/proc/get_level_cost() + var/level_cost = (0.3 + (0.05 * blood_level_gain_amount)) + level_cost = min(level_cost, BLOOD_LEVEL_GAIN_MAX) + level_cost = max_blood_volume * level_cost + return level_cost + /datum/antagonist/bloodsucker/proc/max_vassals() return bloodsucker_level diff --git a/modular_zubbers/code/modules/antagonists/bloodsucker/clans/clan.dm b/modular_zubbers/code/modules/antagonists/bloodsucker/clans/clan.dm index ccea8d18934..04358033844 100644 --- a/modular_zubbers/code/modules/antagonists/bloodsucker/clans/clan.dm +++ b/modular_zubbers/code/modules/antagonists/bloodsucker/clans/clan.dm @@ -157,7 +157,7 @@ to_chat(bloodsuckerdatum.owner.current, span_notice("You grow more ancient by the night!")) else // Give them the UI to purchase a power. - var/choice = tgui_input_list(human_user, "You have the opportunity to grow more ancient. Spend [round(blood_cost, 1)] blood to advance your rank", "Your Blood Thickens...", options) + var/choice = tgui_input_list(human_user, "You have the opportunity to grow more ancient.[blood_cost > 0 ? " Spend [round(blood_cost, 1)] blood to advance your rank" : ""]", "Your Blood Thickens...", options) // Prevent Bloodsuckers from closing/reopning their coffin to spam Levels. if(cost_rank && bloodsuckerdatum.GetUnspentRank() <= 0) return diff --git a/modular_zubbers/code/modules/antagonists/bloodsucker/structures/coffin.dm b/modular_zubbers/code/modules/antagonists/bloodsucker/structures/coffin.dm index e7b5b5b3cdc..12d4251b786 100644 --- a/modular_zubbers/code/modules/antagonists/bloodsucker/structures/coffin.dm +++ b/modular_zubbers/code/modules/antagonists/bloodsucker/structures/coffin.dm @@ -221,10 +221,11 @@ if(!bloodsuckerdatum.my_clan) user.balloon_alert("enter a clan!") to_chat(user, span_notice("You must enter a Clan to rank up. Do it in the antag menu, which you can see by pressing the action button in the top left.")) - else + else if(!bloodsuckerdatum.frenzied) + if(bloodsuckerdatum.GetUnspentRank() < 1) + bloodsuckerdatum.blood_level_gain() // Level ups cost 30% of your max blood volume, which scales with your rank. - if(!bloodsuckerdatum.frenzied) - bloodsuckerdatum.SpendRank(blood_cost = bloodsuckerdatum.max_blood_volume * BLOODSUCKER_LEVELUP_PERCENTAGE) + bloodsuckerdatum.SpendRank(blood_cost = bloodsuckerdatum.max_blood_volume * BLOODSUCKER_LEVELUP_PERCENTAGE) bloodsuckerdatum.check_begin_torpor(TORPOR_SKIP_CHECK_DAMAGE) return TRUE