Skip to content

Commit

Permalink
Ports (#4711)
Browse files Browse the repository at this point in the history
Port of https://github.com/Liberty-Landing/Liberty-Station-13/pull/467

Credit to Trilby

does *not* map in the new machines because frankly, I don't know who's managing the map these days.

Also ports a few of their perk icons because for some reason our entire perk icon .dmi was missing and I'll be honest, I couldn't be bothered to sort out their perks from the old ones that we actually need to fix out perk icons being all blank. Credit to Liberty for those as well. Perk icons are still, at time of writing all commented out so I'll see about re-enabling them either later on in this PR or in another PR.
  • Loading branch information
cdb-is-not-good authored Jul 22, 2023
1 parent caf2c6a commit 9fa3a73
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/perks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
#define PERK_PROSPECTOR_CONDITIONING /datum/perk/job/prospector_conditioning
#define PERK_BLACKSHIELD_CONDITIONING /datum/perk/job/blackshield_conditioning
#define PERK_BARTENDER /datum/perk/bartender

#define PERK_NO_OBSUCATION /datum/perk/no_obsucation //isekai perk?

#define PERK_REZ_SICKNESS /datum/perk/rezsickness
#define PERK_REZ_SICKNESS_SEVERE /datum/perk/rezsickness/severe
Expand Down
6 changes: 6 additions & 0 deletions code/datums/mob_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@

/proc/statPointsToLevel(var/points)
switch(points)
if (-1000 to -50)
return "Hopeless"
if (-50 to -25)
return "Inept"
if (-25 to -1)
return "Misinformed"
if (STAT_LEVEL_NONE to STAT_LEVEL_BASIC)
return "Untrained"
if (STAT_LEVEL_BASIC to STAT_LEVEL_ADEPT)
Expand Down
7 changes: 7 additions & 0 deletions code/datums/perks/backgrounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,10 @@ This is NOT for racial-specific perks, but rather specifically for general backg
holder.metabolism_effects.nsa_bonus -= 20
holder.metabolism_effects.calculate_nsa()
..()

/datum/perk/no_obsucation
name = "Exact Values"
desc = "Unlike most people you can fully visualize your own stats, owing to your greater grasp of the concepts. \
This is in addition to knowing exactly how likely you were to fail after failing some tasks. \
This ability does not extend to medical matters, wounds or similar. "
icon_state = "obsucation_ranking"
12 changes: 12 additions & 0 deletions code/datums/setup_option/backgrounds/origin_upbringing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,15 @@
STAT_MEC = 0,
STAT_COG = 0
)

/datum/category_item/setup_option/background/bckgrnd/true_data
name = "Introspective"
desc = "Do to being more in-tune with what you are and whats around you things that were once hidden behind probability or guessing are shown to you as factual odds."
perks = list(PERK_NO_OBSUCATION)

stat_modifiers = list(
STAT_VIG = 5,
STAT_MEC = -5,
STAT_COG = 5,
STAT_VIV = -5
)
53 changes: 52 additions & 1 deletion code/game/machinery/gym.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
var/stat_used = STAT_VIG //STAT_TGH, STAT_ROB, STAT_VIG, STAT_COG, STAT_MEC, STAT_BIO
var/mob/living/carbon/human/occupant
var/unlocked = FALSE
var/last_stats = 0

density = TRUE
anchored = TRUE
Expand All @@ -17,6 +18,10 @@
idle_power_usage = 60
active_power_usage = 400

/obj/machinery/gym/examine(mob/user)
..()
to_chat(user, "<span class='info'>Last User Score Was: [last_stats]</span>")

/obj/machinery/gym/robustness
name = "Interim Resistive Exercise Device"
desc = "This device uses a system of vacuum tubes and flywheel cables to simulate the process of free weight exercises that increase your strength. Are those barbells decorative...?"
Expand All @@ -31,6 +36,24 @@

stat_used = STAT_TGH

/obj/machinery/gym/cognition
name = "Crazy Jakes Puzzel Box"
desc = "A 4D puzzel box designed to test your mind in every way known to humanity, shockingly it's party mode has been made into party games for decades."
icon_state = "cognition"
stat_used = STAT_COG

/obj/machinery/gym/bio
name = "Dr. Terry Advanced Advenctures"
desc = "A seemingly endless quest of medical misshaps and common to avdanced misstakes, well its boring for a lot of people, it has a cult following leading to it being rather successful in most locations."
icon_state = "bio"
stat_used = STAT_BIO

/obj/machinery/gym/mec
name = "Shapers Of Atoms"
desc = "An informational game found in many schools teaching things from welding to fine crafting of delicate items with rare materals. Shockingly this collection of knowlage is still update and maintained making it a invaulable resource for any up and coming crafter"
icon_state = "mec"
stat_used = STAT_MEC

/obj/machinery/gym/power_change()
..()
if(stat & BROKEN || stat & NOPOWER)
Expand Down Expand Up @@ -65,9 +88,10 @@

else
to_chat(occupant, SPAN_NOTICE("You did become stronger, you think... But not permanently. Perhaps you need to rest first?"))
occupant.stats.addTempStat(stat_used, 15, 10 MINUTES, "Improved Guns[generate_gun_serial(pick(3,4,5,6,7,8))]") //This is so that we properly add are temp stats - reuses gun serial code for easy, and the joke
occupant.stats.addTempStat(stat_used, 15, 10 MINUTES)
occupant.learnt_tasks.attempt_add_task_mastery(/datum/task_master/task/gym_goer, "GYM_GOER", skill_gained = 1, learner = occupant)

last_stats = occupant.stats.getStat(stat_used,pure = TRUE)

occupant.stats.addPerk(PERK_COOLDOWN_EXERTION)
unlocked = FALSE
Expand Down Expand Up @@ -135,6 +159,33 @@
add_overlay (occupant_image)
icon_state = "vigilance_active"

/obj/machinery/gym/cognition/update_icon() // Vigilance animation
cut_overlays()
icon_state = (stat & (NOPOWER|BROKEN)) ? "cognition_off" : "cognition"
if(occupant)
var/image/occupant_image = image(occupant.icon, loc, occupant.icon_state, 4, NORTH)
occupant_image.overlays = occupant.overlays
add_overlay (occupant_image)
icon_state = "cognition_active"

/obj/machinery/gym/bio/update_icon() // Vigilance animation
cut_overlays()
icon_state = (stat & (NOPOWER|BROKEN)) ? "bio_off" : "bio"
if(occupant)
var/image/occupant_image = image(occupant.icon, loc, occupant.icon_state, 4, NORTH)
occupant_image.overlays = occupant.overlays
add_overlay (occupant_image)
icon_state = "bio_active"

/obj/machinery/gym/mec/update_icon() // Vigilance animation
cut_overlays()
icon_state = (stat & (NOPOWER|BROKEN)) ? "mec_off" : "mec"
if(occupant)
var/image/occupant_image = image(occupant.icon, loc, occupant.icon_state, 4, NORTH)
occupant_image.overlays = occupant.overlays
add_overlay (occupant_image)
icon_state = "mec_active"

/obj/machinery/gym/toughness/update_icon() // Toughness animation
cut_overlays()
icon_state = (stat & (NOPOWER|BROKEN)) ? "toughness_off" : "toughness"
Expand Down
9 changes: 9 additions & 0 deletions code/game/objects/items/weapons/tools/_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@
fail_chance = 0

if(fail_chance >= 100)
if(!user.stats.getPerk(PERK_NO_OBSUCATION))
to_chat(user, SPAN_WARNING("You failed to finish your task with [src.name]! Considering your skills and this tool, it is impossible."))
else
to_chat(user, SPAN_WARNING("You failed to finish your task with [src.name]! The odds of succes are [fail_chance], this is infact impossible."))
to_chat(user, SPAN_WARNING("You failed to finish your task with [src.name]! Considering your skills and this tool, it is impossible."))
return TOOL_USE_FAIL
if(prob(fail_chance))
Expand All @@ -494,6 +498,11 @@
chanceMessage = "small"
else if(fail_chance < 95)
chanceMessage = "tiny"

if(!user.stats.getPerk(PERK_NO_OBSUCATION))
to_chat(user, SPAN_WARNING("You failed to finish your task with [src.name]! There was a [chanceMessage] chance to succeed."))
else
to_chat(user, SPAN_WARNING("You failed to finish your task with [src.name]! There was a [fail_chance]% chance to fail."))
to_chat(user, SPAN_WARNING("You failed to finish your task with [src.name]! There was a [chanceMessage] chance to succeed."))
return TOOL_USE_FAIL

Expand Down
12 changes: 12 additions & 0 deletions code/game/objects/items/weapons/traps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,19 @@ Freeing yourself is much harder than freeing someone else. Calling for help is a

playsound(src, 'sound/effects/impacts/beartrap_shut.ogg', 10, 1,-2,-2)//Fairly quiet snapping sound

if (user == buckled_mob)
to_chat(user, SPAN_NOTICE("Freeing yourself is very difficult. Perhaps you should call for help?"))

if (difficulty)
if(ishuman(user))
var/mob/living/carbon/human/H
if(!H.stats.getPerk(PERK_NO_OBSUCATION))
to_chat(H, SPAN_NOTICE("You failed to release the trap. There was a [round(100 - difficulty)]% chance of success"))
else
to_chat(H, SPAN_NOTICE("You failed to release the trap. There was a [difficulty]% chance of failer"))
else
to_chat(user, SPAN_NOTICE("You failed to release the trap. There was a [round(100 - difficulty)]% chance of success"))

to_chat(user, SPAN_NOTICE("You failed to release the trap. There was a [round(100 - difficulty)]% chance of success"))
if (user == buckled_mob)
to_chat(user, SPAN_NOTICE("Freeing yourself is very difficult. Perhaps you should call for help?"))
Expand Down
7 changes: 6 additions & 1 deletion code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,12 @@ mob/proc/yank_out_object()
var/table_header = "<th>Stat Name<th>Stat Value"
var/list/S = list()
for(var/TS in ALL_STATS)
S += "<td>[TS]<td>[getStatStats(TS)]"
var/points = user.stats.getStat(TS,pure = TRUE)
if(!user.stats.getPerk(PERK_NO_OBSUCATION))
S += "<td>[TS]<td> [statPointsToLevel(points)]"
else
S += "<td>[TS]<td> [points] ([statPointsToLevel(points)])"

var/data = {"
[additionalcss]
[user == src ? "Your stats:" : "[name]'s stats"]<br>
Expand Down
Binary file added icons/effects/perks.dmi
Binary file not shown.
Binary file modified icons/obj/machines/gym.dmi
Binary file not shown.

0 comments on commit 9fa3a73

Please sign in to comment.