Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introspective and Anomaly Hunter gives exact stats and perks on oddity #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions code/datums/mob_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@
if(path)
return locate(path) in perks

/datum/stat_holder/proc/getHasOneOfPerks(perkArray)
for(var/perkType in perkArray)
var/hasPerk = getPerk(perkType)
if(hasPerk)
return TRUE
return FALSE

/// The main, public proc to add a perk to a mob. Accepts a path or a stringified path.
/datum/stat_holder/proc/addPerk(perkType)
. = FALSE
Expand Down
19 changes: 10 additions & 9 deletions code/modules/sanity/inspiration_component.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
RegisterSignal(parent, COMSIG_EXAMINE, PROC_REF(on_examine))

/datum/component/inspiration/proc/on_examine(mob/user)
for(var/stat in stats)
for(var/stat in stats)
var/aspect
var/stat_noun
var/stat_adjective
Expand Down Expand Up @@ -120,7 +120,9 @@
aspect = pick(adjectives_weak)
else
continue
if(aspect_noun_or_adjective == "noun")
if(usr.stats?.getHasOneOfPerks(list(PERK_STALKER, PERK_NO_OBFUSCATION)))
message = "It would increase your [stat] by [stats[stat]]."
else if(aspect_noun_or_adjective == "noun")
message = pick(\
"This item has [a_or_an] [stat_color][aspect]</span> aspect of [stat_noun]",\
"Aura of [stat_color][aspect]</span> [stat_noun] pertains to it")
Expand All @@ -131,14 +133,13 @@
"It [stat_color][aspect]</span> reminds you of [stat_noun]", \
"It makes you feel [stat_color][aspect]</span> [stat_adjective]", \
"This feels like it might make you [stat_color][aspect]</span> [stat_adjective]", \
//"[stat_color][aspect]</span> [stat_adjective]."
)
if(message)
to_chat(user, SPAN_NOTICE(message))

if(perk)
to_chat(user, SPAN_NOTICE("<span style='color:orange'>A strange aura comes from this oddity, it is more than just a curio, its an anomaly...</span>"))
if(usr.stats?.getPerk(PERK_STALKER))
if(usr.stats?.getHasOneOfPerks(list(PERK_STALKER, PERK_NO_OBFUSCATION)))
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>"))

Expand All @@ -149,15 +150,15 @@
var/strength
switch(get_power())
if(1)
strength = "a weak mechanical catalyst power"
strength = "a weak mechanical catalyst power."
if(2)
strength = "a normal mechanical catalyst power"
strength = "a normal mechanical catalyst power."
if(3)
strength = "a medium mechanical catalyst power"
strength = "a medium mechanical catalyst power."
if(4)
strength = "a strong mechanical catalyst power"
strength = "a strong mechanical catalyst power."
else
strength = "no catalyst power"
strength = "no catalyst power."
to_chat(user, SPAN_NOTICE("This item has [strength]"))

/// Returns stats if defined, otherwise it returns the return value of get_stats
Expand Down
Loading