Skip to content

Commit

Permalink
Stat balance 9.0c (#5078)
Browse files Browse the repository at this point in the history
* a vector of balance

* Update oddities.dm

* Update mob_stats.dm

* Update sanity_mob.dm

* Update sanity_mob.dm

* Update sanity_mob.dm

* finnally works

* Apply suggestions from code review

Co-authored-by: Spock <[email protected]>

* spelling is hard

---------

Co-authored-by: Spock <[email protected]>
  • Loading branch information
Trilbyspaceclone and SingingSpock authored Feb 29, 2024
1 parent edb5d63 commit 2c39b6c
Show file tree
Hide file tree
Showing 17 changed files with 186 additions and 43 deletions.
22 changes: 13 additions & 9 deletions code/__DEFINES/mob_stats.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define STAT_VALUE_DEFAULT 0
#define STAT_VALUE_MAXIMUM 150
#define STAT_VALUE_DEFAULT 0
#define STAT_VALUE_DEFAULT_MAXIMUM 150

#define STAT_MEC "Mechanical"
#define STAT_COG "Cognition"
Expand All @@ -15,13 +15,17 @@
#define ALL_STATS_FOR_DEFIBS list(STAT_MEC,STAT_COG,STAT_BIO,STAT_ROB,STAT_TGH,STAT_VIG) //Used for defibs (no ana/viv)
#define ALL_STATS_TO_IMPRINT list(STAT_MEC,STAT_COG,STAT_BIO,STAT_ROB,STAT_VIG) //So that people stop memeing the imprinter

#define STAT_LEVEL_NONE 0
#define STAT_LEVEL_NOVICE 7
#define STAT_LEVEL_BASIC 15
#define STAT_LEVEL_ADEPT 25
#define STAT_LEVEL_EXPERT 40
#define STAT_LEVEL_PROF 60
#define STAT_LEVEL_GODLIKE 80
#define STAT_LEVEL_NONE 0
#define STAT_LEVEL_NOVICE 7
#define STAT_LEVEL_BASIC 15
#define STAT_LEVEL_ADEPT 25
#define STAT_LEVEL_EXPERT 40
#define STAT_LEVEL_PROF 60
#define STAT_LEVEL_MASTER 80
#define STAT_LEVEL_HIGHER 100
#define STAT_LEVEL_COSMIC 120
#define STAT_LEVEL_UNIVERSAL 150
#define STAT_LEVEL_BYOND 200

#define STAT_LEVEL_MIN 0 // Min stat value selectable
#define STAT_LEVEL_MAX 60 // Max stat value selectable
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/perks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@

//Task Perks
#define PERK_FORCEFUL_REJECTION /datum/perk/forceful_rejection
//Bluecross perks
#define PERK_SKILL_CAP_ADDITION /datum/perk/skill_cap_addition
#define PERK_SKILL_CAP_EXPANDING /datum/perk/skill_cap_expanding

//////////////////
//Cooldown perks//
Expand Down
54 changes: 42 additions & 12 deletions code/datums/mob_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,26 @@
var/datum/stat/S = stat_list[statName]
S.setValue(Value)

/datum/stat_holder/proc/add_Stat_cap(statName, amount)
var/datum/stat/S = stat_list[statName]
S.add_stat_cap(amount)

/datum/stat_holder/proc/grab_Stat_cap(statName)
var/datum/stat/S = stat_list[statName]
var/number = S.grabbed_stat_cap()
return number

/datum/stat_holder/proc/getStat(statName, pure = FALSE, require_direct_value = TRUE)
if (!islist(statName))
var/datum/stat/S = stat_list[statName]
LEGACY_SEND_SIGNAL(holder, COMSIG_STAT, S.name, S.getValue(), S.getValue(TRUE))
var/stat_value = S ? S.getValue(pure) : 0
if(holder?.stats.getPerk(PERK_NO_OBSUCATION) || require_direct_value)
return stat_value
return stat_value
else
return statPointsToLevel(stat_value)
else
log_debug("passed list to getStat(), statName without a list: [statName]")
log_debug("passed list to getStat(), statName without a list: [statName]")

// Those are accept list of stats
// Compound stat checks.
Expand Down Expand Up @@ -179,6 +188,7 @@
var/desc = "Basic characteristic, you are not supposed to see this. Report to admins."
var/value = STAT_VALUE_DEFAULT
var/list/mods = list()
var/stat_cap = STAT_VALUE_DEFAULT_MAXIMUM

/datum/stat/proc/addModif(delay, affect, id)
for(var/elem in mods)
Expand Down Expand Up @@ -209,11 +219,11 @@
value = value + affect

/datum/stat/proc/changeValue_withcap(affect)
if(value > STAT_VALUE_MAXIMUM)
if(value > stat_cap)
return

if(value + affect > STAT_VALUE_MAXIMUM)
value = STAT_VALUE_MAXIMUM
if(value + affect > stat_cap)
value = stat_cap
else
value = value + affect

Expand All @@ -236,11 +246,17 @@

//Unused but might be good for later additions
/datum/stat/proc/setValue_withcap(value)
if(value > STAT_VALUE_MAXIMUM)
src.value = STAT_VALUE_MAXIMUM
if(value > stat_cap)
src.value = stat_cap
else
src.value = value

/datum/stat/proc/add_stat_cap(amount)
stat_cap += amount

/datum/stat/proc/grabbed_stat_cap()
return stat_cap

/datum/stat/productivity
name = STAT_MEC
desc = "The world hadn't ever had so many moving parts or so few labels. Character's ability in building and using various tools."
Expand Down Expand Up @@ -281,11 +297,15 @@

/proc/statPointsToLevel(var/points)
switch(points)
if (-1000 to -50)
if (-1000 to -100)
return "Hopeless"
if (-50 to -25)
if (-100 to -50)
return "Blundering"
if (-50 to -20)
return "Incompetent"
if (-20 to -15)
return "Inept"
if (-25 to -1)
if (-15 to -1)
return "Misinformed"
if (STAT_LEVEL_NONE to STAT_LEVEL_BASIC)
return "Untrained"
Expand All @@ -295,5 +315,15 @@
return "Adept"
if (STAT_LEVEL_EXPERT to STAT_LEVEL_PROF)
return "Expert"
if (STAT_LEVEL_PROF to INFINITY)
return "Master"
if (STAT_LEVEL_PROF to STAT_LEVEL_MASTER)
return "Proficient"
if (STAT_LEVEL_MASTER to STAT_LEVEL_HIGHER)
return "Mastery"
if (STAT_LEVEL_HIGHER to STAT_LEVEL_COSMIC)
return "Skill Mastery"
if (STAT_LEVEL_COSMIC to STAT_LEVEL_UNIVERSAL)
return "Grand Mastery"
if (STAT_LEVEL_UNIVERSAL to STAT_LEVEL_BYOND)
return "Theoretical Understanding"
if (STAT_LEVEL_BYOND to INFINITY)
return "Higher Understanding"
46 changes: 46 additions & 0 deletions code/datums/perks/special.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,49 @@
return ..()


///////////////////
//Bluecross Perks//
///////////////////

/datum/perk/skill_cap_expanding
name = "Celestial Gift"
desc = "The normal limit of the mind has been exspanded by 50%"
gain_text = "It came in a dream."
lose_text = "It was but a nightmare."
icon_state = "celestial"
var/statis_amount = 0
active = FALSE
passivePerk = FALSE

/datum/perk/skill_cap_expanding/assign(mob/living/carbon/human/H)
..()
for(var/stat in ALL_STATS)
var/gather_increase = holder.stats.grab_Stat_cap(stat)
gather_increase *= 0.5
statis_amount = gather_increase
holder.stats.add_Stat_cap(gather_increase)

/datum/perk/skill_cap_expanding/remove()
for(var/stat in ALL_STATS)
holder.stats.add_Stat_cap(-statis_amount)
..()

/datum/perk/skill_cap_addition
name = "Comsic Gazing"
desc = "The normal limit of the mind has been exspanded by 30"
gain_text = "Looking into the stars is starting to becoming productive!"
lose_text = "The void above is the same as below."
icon_state = "void_eye"
active = FALSE
passivePerk = FALSE

/datum/perk/skill_cap_addition/assign(mob/living/carbon/human/H)
..()
for(var/stat in ALL_STATS)
holder.stats.add_Stat_cap(30)

/datum/perk/skill_cap_addition/remove()
for(var/stat in ALL_STATS)
holder.stats.add_Stat_cap(-30)
..()

2 changes: 1 addition & 1 deletion code/game/machinery/autolathe/artist_bench.dm
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
return
flick("[initial(icon_state)]_work", src)
working = TRUE
if(!do_after(user, 15 * user.stats.getMult(STAT_MEC, STAT_LEVEL_GODLIKE), src))
if(!do_after(user, 15 * user.stats.getMult(STAT_MEC, STAT_LEVEL_MASTER), src))
error = "Lost artist."
working = FALSE
return
Expand Down
28 changes: 28 additions & 0 deletions code/game/objects/effects/decals/crayon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@
bees_spell(M, able_to_cast)
continue

if((spell.message == "Sky." || spell.message == "Above.") && candle_amount >= 1)
sun_spell(M, able_to_cast)
continue

if(spell.message == "Scribe." && candle_amount >= 7)
scribe_spell(M, able_to_cast)
continue
Expand Down Expand Up @@ -688,6 +692,30 @@
qdel(G)
return

// Sky: / Above:
// Converts a open omega book into a drawing of the sun, a oddity with a perk that exspands the skill cap by 30 points.
/obj/effect/decal/cleanable/crayon/proc/sun_spell(mob/living/carbon/human/M, able_to_cast = FALSE)
var/datum/reagent/organic/blood/B = M.get_blood()
if(!able_to_cast)
return

M.maxHealth -= 5
M.health -= 5
for(var/obj/item/oddity/common/book_omega/opened/BOOK in oview(3))

to_chat(M, "<span class='info'>A cold voice creeks. </span><span class='angelsay'> With this messy canvas, I can only provide you a glance of that.</span>")

if(!body_checks(M))
to_chat(M, "<span class='info'>A cold voice sighs. </span><span class='angelsay'> You will not do. Waste the others time.</span>")
bluespace_entropy(3, get_turf(src)) //Wasting an artists time is rather rude
return

to_chat(M, "<span class='info'>The pages of [BOOK.name] slowly turn into paint.</span>")
new /obj/item/oddity/rare/drawing_of_sun(BOOK.loc)
B.remove_self(140) //Base is 540
qdel(BOOK)
return

// Pouch: Spawns a pouch with a dimensional-linked shared storage. Every person holding one of these can access the same storage from anywhere.
// Works only if the pouch is opened, and accessed while being held in-hand
/obj/effect/decal/cleanable/crayon/proc/pouch_spell(mob/living/carbon/human/M, able_to_cast = FALSE)
Expand Down
29 changes: 29 additions & 0 deletions code/game/objects/items/oddities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,35 @@
price_tag = 2000 //Its a good tie for a collector
perk = PERK_SURE_STEP //Insainly rare and ok stats, but really its the perk. In Disco-E this perk would save you so much making this the perfect joke

/obj/item/oddity/rare/moon_fragment
name = "Fragment of Moon"
desc = "A glowing, white, glass like shard of the Amethyn Moon."
icon_state = "moon_fragment"
min_stats = 16
//Its 1 then done so we give quite a bit
oddity_stats = list(
STAT_COG = 18,
STAT_VIG = 18
)
price_tag = 2500 //Bluecross spawn
prob_perk = 0
kill_stats = TRUE
perk = PERK_SKILL_CAP_EXPANDING

/obj/item/oddity/rare/drawing_of_sun
name = "Drawing of a Unknown Sun"
desc = "A drawing of a type of sun no one has ever seen before done in crayon."
icon_state = "crayon_sun"
min_stats = 3
oddity_stats = list(
STAT_COG = 1,
STAT_VIG = 2
)
price_tag = 5
perk = PERK_SKILL_CAP_ADDITION
prob_perk = 0
kill_stats = TRUE

//Non-Spawn
//Odditys that are event only or spawned in on map gen
/obj/item/oddity/rare/golden_cup
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/random/oddities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
/obj/item/gun_upgrade/mechanism/brass_kit = 1,
//Misc - things that are not a "gun" but still good for this
/obj/item/oddity/nt/seal = 1,
/obj/item/soap/bluespase = 0.5))
/obj/item/soap/bluespase = 0.5,
/obj/item/oddity/rare/moon_fragment = 0.2))

/obj/random/uplink/low_chance
name = "really really really low chance random uplink"
Expand Down
4 changes: 3 additions & 1 deletion code/modules/hivemind/machines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,15 @@
/obj/item/reagent_containers/glass/beaker)
var/list/reward_oddity = list(
/obj/item/oddity/common/old_radio,
/obj/item/oddity/common/old_pda)
/obj/item/oddity/common/old_pda,
/obj/item/oddity/rare/eldritch_tie)

/obj/machinery/hivemind_machine/node/proc/gift()
var/gift = prob(GLOB.hive_data_float["core_oddity_drop_chance"]) ? pick(reward_oddity) : pick(reward_item)
new gift(get_turf(loc))
state("leaves behind an item!")

//Seems unused, added it to reward oddity
/obj/machinery/hivemind_machine/node/proc/core()
state("leaves behind a weird looking tie!")
new /obj/item/oddity/rare/eldritch_tie(get_turf(loc))
Expand Down
4 changes: 2 additions & 2 deletions code/modules/hydroponics/seed_machines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
var/stat_multiplier = 1
if(usr.stats)
// Uses best of BIO and COG
stat_multiplier = min(usr.stats.getMult(STAT_BIO, STAT_LEVEL_GODLIKE), usr.stats.getMult(STAT_COG, STAT_LEVEL_GODLIKE))
stat_multiplier = min(usr.stats.getMult(STAT_BIO, STAT_LEVEL_MASTER), usr.stats.getMult(STAT_COG, STAT_LEVEL_MASTER))

seed.modified += round(rand(30, 70) * stat_multiplier)
if(seed.modified >= 100)
Expand Down Expand Up @@ -268,7 +268,7 @@
var/stat_multiplier = 1
if(usr.stats)
// Uses best of BIO and COG
stat_multiplier = min(usr.stats.getMult(STAT_BIO, STAT_LEVEL_GODLIKE), usr.stats.getMult(STAT_COG, STAT_LEVEL_GODLIKE))
stat_multiplier = min(usr.stats.getMult(STAT_BIO, STAT_LEVEL_MASTER), usr.stats.getMult(STAT_COG, STAT_LEVEL_MASTER))

if(!isnull(plant_controller.seeds[seed.seed.name]))
seed.seed = seed.seed.diverge(1)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/mob_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,9 @@ proc/is_blind(A)
prob_evade += base_prob_evade
if(!stats)
return prob_evade
prob_evade += base_prob_evade * (stats.getStat(STAT_VIG)/STAT_LEVEL_GODLIKE - weight_coeff())
prob_evade += base_prob_evade * (stats.getStat(STAT_VIG)/STAT_LEVEL_MASTER - weight_coeff())
if(stats.getPerk(PERK_SURE_STEP))
prob_evade += base_prob_evade*30/STAT_LEVEL_GODLIKE
prob_evade += base_prob_evade*30/STAT_LEVEL_MASTER
//if(stats.getPerk(PERK_RAT))
// prob_evade += base_prob_evade/1.5
return prob_evade
Expand Down
4 changes: 2 additions & 2 deletions code/modules/projectiles/ammunition/ammo_kits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
material_points += 6
if(STAT_LEVEL_EXPERT to STAT_LEVEL_PROF)
material_points += 9
if(STAT_LEVEL_PROF to STAT_LEVEL_GODLIKE)
if(STAT_LEVEL_PROF to STAT_LEVEL_MASTER)
material_points += 12
if(STAT_LEVEL_GODLIKE to INFINITY)
if(STAT_LEVEL_MASTER to INFINITY)
material_points += 15

var/list/array = list(
Expand Down
6 changes: 3 additions & 3 deletions code/modules/sanity/inspiration_component.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//perk
var/datum/perk/perk
//If we after we are used set are stats to 0
var/kill_stats = FALSE
var/self_destroy = FALSE

/// Statistics can be a list (static) or a callback to a proc that returns a list (of the same format)
/datum/component/inspiration/Initialize(statistics, datum/perk/new_perk, kill_stats)
Expand All @@ -28,7 +28,7 @@
else
return COMPONENT_INCOMPATIBLE
if(kill_stats)
kill_stats = TRUE
self_destroy = TRUE
if(new_perk)
perk = new_perk
else
Expand Down Expand Up @@ -142,7 +142,7 @@
var/datum/perk/oddity/OD = GLOB.all_perks[perk]
to_chat(user, SPAN_NOTICE("Instinct tells you more about this anomaly: <span style='color:orange'>[OD]. [OD.desc]</span>"))

if(kill_stats)
if(self_destroy)
to_chat(user, SPAN_NOTICE("<span style='color:angelsay'>An unstable decaying aura radiates from this one. It seems this type will one be useable once...</span>"))


Expand Down
Loading

0 comments on commit 2c39b6c

Please sign in to comment.