Skip to content

Commit

Permalink
[MIRROR] Adds support for different achievement dmis (#1997)
Browse files Browse the repository at this point in the history
* Adds support for different achievement dmis (#81471)

## About The Pull Request

I am back to pushing my code improvements upstream, sorry in advance.
As the title says, this adds support for achievement icons to be in
different dmi files than the default, pretty much the exact same way
that Language icons (for chat assets) do.

## Why It's Good For The Game

It is one of the few things in game (the only other thing i can think of
that does this rn is barsigns) that cannot have their icon changed when
trying to make a subtype, this is very limiting and very annoying,
especially since dmi conflicts are one of the worst types to deal with,
this would make my life a lot easier.

## Changelog

No player-facing changes.

* Adds support for different achievement dmis

---------

Co-authored-by: NovaBot <[email protected]>
Co-authored-by: John Willard <[email protected]>
  • Loading branch information
3 people authored Feb 19, 2024
1 parent b8508a7 commit 0888f59
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 95 deletions.
2 changes: 1 addition & 1 deletion code/datums/achievements/_achievement_data.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"name" = award.name,
"desc" = award.desc,
"category" = award.category,
"icon_class" = assets.icon_class_name(award.icon),
"icon_class" = assets.icon_class_name("achievement-[award.icon_state]"),
"value" = data[achievement_type],
)
award_data += award.get_ui_data(user.ckey)
Expand Down
10 changes: 6 additions & 4 deletions code/datums/achievements/_awards.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
///Name of the achievement, If null it won't show up in the achievement browser. (Handy for inheritance trees)
var/name
var/desc = "You did it."
///The icon state for this award. The icon file is found in ui_icons/achievements.
var/icon = "default"
///The dmi icon file that holds the award's icon state.
var/icon = ACHIEVEMENTS_SET
///The icon state for this award.
var/icon_state = "default"

var/category = "Normal"

Expand Down Expand Up @@ -80,7 +82,7 @@
///Achievements are one-off awards for usually doing cool things.
/datum/award/achievement
desc = "Achievement for epic people"
icon = "" // This should warn contributors that do not declare an icon when contributing new achievements.
icon_state = "" // This should warn contributors that do not declare an icon when contributing new achievements.
///How many players have earned this achievement
var/times_achieved = 0

Expand Down Expand Up @@ -171,7 +173,7 @@
/datum/award/score/achievements_score
name = "Achievements Unlocked"
desc = "Don't worry, metagaming is all that matters."
icon = "elephant" //Obey the reference
icon_state = "elephant" //Obey the reference
database_id = ACHIEVEMENTS_SCORE

/datum/award/score/achievements_score/get_ui_data(key)
Expand Down
40 changes: 20 additions & 20 deletions code/datums/achievements/boss_achievements.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,119 +5,119 @@
name = "Tendril Exterminator"
desc = "Watch your step"
database_id = BOSS_MEDAL_TENDRIL
icon = "tendril"
icon_state = "tendril"

/datum/award/achievement/boss/boss_killer
name = "Boss Killer"
desc = "You've come a long ways from asking how to switch hands."
database_id = "Boss Killer"
icon = "firstboss"
icon_state = "firstboss"

/datum/award/achievement/boss/blood_miner_kill
name = "Blood-Drunk Miner Killer"
desc = "I guess he couldn't handle his drink that well."
database_id = BOSS_MEDAL_MINER
icon = "miner"
icon_state = "miner"

/datum/award/achievement/boss/demonic_miner_kill
name = "Demonic-Frost Miner Killer"
desc = "Definitely harder than the Blood-Drunk Miner."
database_id = BOSS_MEDAL_FROSTMINER
icon = "frostminer"
icon_state = "frostminer"

/datum/award/achievement/boss/bubblegum_kill
name = "Bubblegum Killer"
desc = "I guess he wasn't made of candy after all"
database_id = BOSS_MEDAL_BUBBLEGUM
icon = "bbgum"
icon_state = "bbgum"

/datum/award/achievement/boss/colossus_kill
name = "Colossus Killer"
desc = "The bigger they are... the better the loot"
database_id = BOSS_MEDAL_COLOSSUS
icon = "colossus"
icon_state = "colossus"

/datum/award/achievement/boss/drake_kill
name = "Drake Killer"
desc = "Now I can wear Rune Platebodies!"
database_id = BOSS_MEDAL_DRAKE
icon = "drake"
icon_state = "drake"

/datum/award/achievement/boss/hierophant_kill
name = "Hierophant Killer"
desc = "Hierophant, but not triumphant."
database_id = BOSS_MEDAL_HIEROPHANT
icon = "hierophant"
icon_state = "hierophant"

/datum/award/achievement/boss/legion_kill
name = "Legion Killer"
desc = "We were many..now we are none."
database_id = BOSS_MEDAL_LEGION
icon = "legion"
icon_state = "legion"

/datum/award/achievement/boss/wendigo_kill
name = "Wendigo Killer"
desc = "You've now ruined years of mythical storytelling."
database_id = BOSS_MEDAL_WENDIGO
icon = "wendigo"
icon_state = "wendigo"

/datum/award/achievement/boss/blood_miner_crusher
name = "Blood-Drunk Miner Crusher"
desc = "I guess he couldn't handle his drink that well."
database_id = BOSS_MEDAL_MINER_CRUSHER
icon = "miner"
icon_state = "miner"

/datum/award/achievement/boss/demonic_miner_crusher
name = "Demonic-Frost Miner Crusher"
desc = "Definitely harder than the Blood-Drunk Miner."
database_id = BOSS_MEDAL_FROSTMINER_CRUSHER
icon = "frostminer"
icon_state = "frostminer"

/datum/award/achievement/boss/bubblegum_crusher
name = "Bubblegum Crusher"
desc = "I guess he wasn't made of candy after all"
database_id = BOSS_MEDAL_BUBBLEGUM_CRUSHER
icon = "bbgum"
icon_state = "bbgum"

/datum/award/achievement/boss/colossus_crusher
name = "Colossus Crusher"
desc = "The bigger they are... the better the loot"
database_id = BOSS_MEDAL_COLOSSUS_CRUSHER
icon = "colossus"
icon_state = "colossus"

/datum/award/achievement/boss/drake_crusher
name = "Drake Crusher"
desc = "Now I can wear Rune Platebodies!"
database_id = BOSS_MEDAL_DRAKE_CRUSHER
icon = "drake"
icon_state = "drake"

/datum/award/achievement/boss/hierophant_crusher
name = "Hierophant Crusher"
desc = "Hierophant, but not triumphant."
database_id = BOSS_MEDAL_HIEROPHANT_CRUSHER
icon = "hierophant"
icon_state = "hierophant"

/datum/award/achievement/boss/legion_crusher
name = "Legion Crusher"
desc = "We were many... now we are none."
database_id = BOSS_MEDAL_LEGION_CRUSHER
icon = "legion"
icon_state = "legion"

/datum/award/achievement/boss/wendigo_crusher
name = "Wendigo Crusher"
desc = "You've now ruined years of mythical storytelling."
database_id = BOSS_MEDAL_WENDIGO_CRUSHER
icon = "wendigo"
icon_state = "wendigo"

//should be removed soon
/datum/award/achievement/boss/king_goat_kill
name = "King Goat Killer"
desc = "The king is dead, long live the king!"
database_id = BOSS_MEDAL_KINGGOAT
icon = "goatboss"
icon_state = "goatboss"

/datum/award/achievement/boss/king_goat_crusher
name = "King Goat Crusher"
desc = "The king is dead, long live the king!"
database_id = BOSS_MEDAL_KINGGOAT_CRUSHER
icon = "goatboss"
icon_state = "goatboss"
18 changes: 9 additions & 9 deletions code/datums/achievements/job_achievements.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,62 +8,62 @@
name = "All Within Theoretical Limits"
desc = "I never thought I'd see a resonance cascade, let alone prevent one..."
database_id = MEDAL_THEORETICAL_LIMITS
icon = "theoreticallimits"
icon_state = "theoreticallimits"

//medical

/datum/award/achievement/jobs/sandman
name = "Mister Sandman"
desc = "Mechanically speaking, there's no real benefit to being unconscious during surgery. Weird how insistent this doctor is about using the N2O anyway though, huh?"
database_id = MEDAL_SANDMAN
icon = "basemisc"
icon_state = "basemisc"

/datum/award/achievement/jobs/helbitaljanken
name = "Helbitaljanken"
desc = "You janked hard"
database_id = MEDAL_HELBITALJANKEN
icon = "helbital"
icon_state = "helbital"

//mining

/datum/award/achievement/jobs/frenching
name = "Frenching"
desc = "Just a taste, for science!"
database_id = MEDAL_FRENCHING
icon = "frenchingthebubble"
icon_state = "frenchingthebubble"

//science

/datum/award/achievement/jobs/feat_of_strength
name = "Feat of Strength"
desc = "If the rod is immovable, is it passing you or are you passing it?"
database_id = MEDAL_RODSUPLEX
icon = "featofstrength"
icon_state = "featofstrength"

/datum/award/achievement/jobs/snail
name = "KKKiiilll mmmeee"
desc = "You were a little too ambitious, but hey, I guess you're still alive?"
database_id = MEDAL_SNAIL
icon = "snail"
icon_state = "snail"

//all of service! hip hip!

/datum/award/achievement/jobs/service_bad
name = "Centcom Grade: Shitty Service"
desc = "Well, you at least tried. How about trying harder?"
database_id = MEDAL_BAD_SERVICE
icon = "service_bad"
icon_state = "service_bad"

/datum/award/achievement/jobs/service_okay
name = "Centcom Grade: Acceptable Service"
desc = "Well, it'll do! You and your department did just fine."
database_id = MEDAL_OKAY_SERVICE
icon = "service_okay"
icon_state = "service_okay"

/datum/award/achievement/jobs/service_good
name = "Centcom Grade: Exemplary Service"
desc = "Centcom is very impressed with your department!"
database_id = MEDAL_GOOD_SERVICE
icon = "service_good"
icon_state = "service_good"

//civilian achievies! while not recognized by the code, it is recognized by our hearts
36 changes: 18 additions & 18 deletions code/datums/achievements/mafia_achievements.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,108 +7,108 @@
name = "Assistant Victory"
desc = "If you got killed instead of someone more important, you just flexed the true strength of your \"\"\"\"role\"\"\"\"."
database_id = MAFIA_MEDAL_ASSISTANT
icon = "town"
icon_state = "town"

/datum/award/achievement/mafia/detective
name = "Detective Victory"
desc = "If you did this with a Medical Doctor in the game, i'm not really that impressed."
database_id = MAFIA_MEDAL_DETECTIVE
icon = "town"
icon_state = "town"

/datum/award/achievement/mafia/psychologist
name = "Psychologist Victory"
desc = "You learned how to not reveal someone random night one! Or... maybe you're just a lucky bastard."
database_id = MAFIA_MEDAL_PSYCHOLOGIST
icon = "town"
icon_state = "town"

/datum/award/achievement/mafia/chaplain
name = "Chaplain Victory"
desc = "Useless... until the one night the thoughtfeeder confidently claims themselves as detective. Mafia's true bullshit detector."
database_id = MAFIA_MEDAL_CHAPLAIN
icon = "town"
icon_state = "town"

/datum/award/achievement/mafia/md
name = "Medical Doctor Victory"
desc = "Congratulations on learning how to not talk!"
database_id = MAFIA_MEDAL_MD
icon = "town"
icon_state = "town"

/datum/award/achievement/mafia/officer
name = "Security Officer Victory"
desc = "Don't worry, you can win this if you're dead! You... did use your ability to become dead, right?"
database_id = MAFIA_MEDAL_OFFICER
icon = "town"
icon_state = "town"

/datum/award/achievement/mafia/lawyer
name = "Lawyer Victory"
desc = "Oh don't mind me, i'm just the worst rol- Oops, I just instantly ended the game."
database_id = MAFIA_MEDAL_LAWYER
icon = "town"
icon_state = "town"

/datum/award/achievement/mafia/hop
name = "Head of Personnel Victory"
desc = "King of Assistants, waster of a single mafia's night, thrower of games."
database_id = MAFIA_MEDAL_HOP
icon = "town"
icon_state = "town"

/datum/award/achievement/mafia/warden
name = "Warden Victory"
desc = "Make changelings think you're detective, go on lockdown, actual detective investigates you and dies. Cha cha real smooth!"
database_id = MAFIA_MEDAL_WARDEN
icon = "town"
icon_state = "town"

/datum/award/achievement/mafia/hos
name = "Head of Security Victory"
desc = "Certified not shitcurity."
database_id = MAFIA_MEDAL_HOS
icon = "town"
icon_state = "town"

/datum/award/achievement/mafia/changeling
name = "Changeling Victory"
desc = "I think the changelings are metacomming."
database_id = MAFIA_MEDAL_CHANGELING
icon = "mafia"
icon_state = "mafia"

/datum/award/achievement/mafia/thoughtfeeder
name = "Thoughtfeeder Victory"
desc = "Clown's best friend. And Obsessed. And fugitive? Whose side are you on?!"
database_id = MAFIA_MEDAL_THOUGHTFEEDER
icon = "mafia"
icon_state = "mafia"

/datum/award/achievement/mafia/traitor
name = "Traitor Victory"
desc = "Guys, we still have two more changelings to ki-!! TRAITOR VICTORY !!"
database_id = MAFIA_MEDAL_TRAITOR
icon = "neutral"
icon_state = "neutral"

/datum/award/achievement/mafia/nightmare
name = "Nightmare Victory"
desc = "DID YOUR LIGHT FLICKER?!"
database_id = MAFIA_MEDAL_NIGHTMARE
icon = "neutral"
icon_state = "neutral"

/datum/award/achievement/mafia/fugitive
name = "Fugitive Victory"
desc = "I'm just the description on an achievement, but if you end up having to choose between town and changelings, go changelings."
database_id = MAFIA_MEDAL_FUGITIVE
icon = "neutral"
icon_state = "neutral"

/datum/award/achievement/mafia/obsessed
name = "Obsessed Victory"
desc = "You got your target lynched, so instead of being spiteful and annoying, you're just smug and annoying."
database_id = MAFIA_MEDAL_OBSESSED
icon = "neutral"
icon_state = "neutral"

/datum/award/achievement/mafia/clown
name = "Clown Victory"
desc = "Did you know this works on traitors, despite their immunity? If you hit the jackpot and manage to kill one, they'll salt into the next dimension. Clown tips!"
database_id = MAFIA_MEDAL_CLOWN
icon = "neutral"
icon_state = "neutral"

///ALL THE ACHIEVEMENTS FOR MISC MAFIA ODDITIES///

/datum/award/achievement/mafia/universally_hated
name = "Universally Hated"
desc = "Managed to get more than 12 votes when put up on trial, jesus christ."
database_id = MAFIA_MEDAL_HATED
icon = "hated"
icon_state = "hated"
Loading

0 comments on commit 0888f59

Please sign in to comment.