diff --git a/game/scripts/interface/achievements.rpy b/game/scripts/interface/achievements.rpy index 2653815b..425eaa70 100644 --- a/game/scripts/interface/achievements.rpy +++ b/game/scripts/interface/achievements.rpy @@ -4,8 +4,7 @@ init -5 python: AchievementKind.title = AchievementKind.name define achievements_db = { - # id : (categoryname, title, description, icon, secret) - "unlockher": AchievementKind("progression", "Granger Danger", "Unlock Hermione Granger.", "interface/icons/head/hermione.webp", None, None), + "unlockher": AchievementKind("progression", "Granger Danger", "Unlocked Hermione Granger.", "interface/icons/head/hermione.webp", None, None), "unlockcho": AchievementKind("progression", "Chang Dynasty", "Unlocked Cho Chang.", "interface/icons/head/cho.webp", None, None), "unlocklun": AchievementKind("progression", "Looney Tunes", "Unlocked Luna Lovegood.", "interface/icons/head/luna.webp", None, None), "unlockast": AchievementKind("progression", "Green Peas", "Unlocked Astoria Greengrass.", "interface/icons/head/astoria.webp", None, None), @@ -13,7 +12,15 @@ define achievements_db = { "unlocksus": AchievementKind("progression", "Boner", "Unlocked Susan Bones.", "interface/icons/head/susan.webp", None, None), "unlocksna": AchievementKind("progression", "Strictly colleagues", "Unlocked Severus Snape.", "interface/icons/head/snape.webp", None, None), "overwhored": AchievementKind("progression", "Overwhored", "Fully corrupted one of the girls.", "interface/icons/head/hermione.webp", None, None), - "mirror": AchievementKind("events", "Mirror, mirror on the wall..", "Found the Room of Requirements.", "images/rooms/room_of_requirement/mirror_hover.webp", None, None), + "herstrip": AchievementKind("progression", "Dance lessons", "Allowed Hermione to dance naked in front of Snape.", "interface/icons/head/hermione.webp", None, None), + "herkiss": AchievementKind("progression", "First Kiss", "You made out with Hermione, or rather your cock did.", "interface/icons/head/hermione.webp", None, None), + "hertits": AchievementKind("progression", "Boobs Lover", "Stuck a dick between the valley of plenty.", "interface/icons/head/hermione.webp", None, None), + "headlib": AchievementKind("progression", "Head Librarian", "Had oral lessons with Hermione.", "interface/icons/head/hermione.webp", None, None), + "nerdgasm": AchievementKind("progression", "Nerdgasm", "Done the deed with Hermione.", "interface/icons/head/hermione.webp", None, None), + "start": AchievementKind("progression", "Welcome to Hogwarts!", "Finished the intro.", "interface/icon.webp", None, None), + "ending": AchievementKind("progression", "Bittersweet Farewell", "Reached the ending.", "interface/icons/silver.webp", None, None), + # GENERAL + "Credits": AchievementKind("general", "New game, who this?", "Watched the credits.", "interface/icons/silver_scroll.webp", None, None), "gold": AchievementKind("general", "Gold Digger", "Acquired 10,000 gold coins.", "interface/icons/gold.webp", "states.env.gold", 10000), "drunkard": AchievementKind("general", "Drunken Master", "Acquired 25 bottles of wine.", "interface/icons/wine.webp", "wine_ITEM.owned", 25), "workaholic": AchievementKind("general", "Workaholic", "Completed five full reports.", "interface/icons/generic_scroll.webp", "states.paperwork_reports_times", 5), @@ -23,23 +30,17 @@ define achievements_db = { "postman": AchievementKind("general", "Poster Boy", "Bought all posters from the store.", "interface/icons/agrabah_poster.webp", None, None), "hats": AchievementKind("general", "Mad Hatter", "Bought all hats from the store.", "interface/icons/icon_gambler_hat.webp", None, None), "daddy": AchievementKind("events", "Who's your daddy?", "Been called a daddy.", "interface/icons/head/hermione.webp", None, None), - "pantiesfap": AchievementKind("events", "I sneezed on them...", "Rubbed one out on someone's panties.", "characters/genie/chibis/jerk_off/02.webp", None, None), - "bros": AchievementKind("events", "Bros before hoes", "Became best pals with Snape.", "interface/icons/head/snape.webp", None, None), + "bros": AchievementKind("general", "Bros before hoes", "Became best pals with Snape.", "interface/icons/head/snape.webp", None, None), "knock": AchievementKind("events", "*Knock* *knock*", "Told Hermione to fuck off.", "images/rooms/main_room/door/door_idle.webp", None, None), "decorator": AchievementKind("general", "Decorator", "Applied a decoration.", "interface/icons/stag_trophy.webp", None, None), - "flashback": AchievementKind("events", "Flashback", "Rolled back to the future at the right moment...", "interface/icons/cards.webp", None, None), - "start": AchievementKind("progression", "Welcome to Hogwarts!", "Finished the intro.", "interface/icon.webp", None, None), - "Credits": AchievementKind("general", "New game, who this?", "Watched the credits.", "interface/icons/silver_scroll.webp", None, None), + # EVENTS + "pantiesfap": AchievementKind("events", "I sneezed on them...", "Rubbed one out on someone's panties.", "characters/genie/chibis/jerk_off/02.webp", None, None), "Cardwin": AchievementKind("events", "Time to duel", "Won a card game duel.", "interface/icons/cards.webp", None, None), - "puzzle": AchievementKind("general", "Down the hatch!", "Waste a bottle of rare phoenix tears.", "interface/icons/item_potion.webp", None, None), - "ending": AchievementKind("events", "Bittersweet Farewell", "Reached the ending.", "interface/icons/silver.webp", None, None), - #1.37 HG achievements + "mirror": AchievementKind("events", "Mirror, mirror on the wall..", "Found the Room of Requirements.", "images/rooms/room_of_requirement/mirror_hover.webp", None, None), "busted": AchievementKind("events", "BUSTED!", "Got busted for busting a nut.", "interface/icons/head/hermione.webp", None, None), - "herstrip": AchievementKind("progression", "Dance lessons", "Allowed Hermione to dance naked in front of Snape.", "interface/icons/head/hermione.webp", None, None), - "herkiss": AchievementKind("progression", "First Kiss", "You made out with Hermione, or rather your cock did.", "interface/icons/head/hermione.webp", None, None), - "hertits": AchievementKind("progression", "Boobs Lover", "Stuck a dick between the valley of plenty.", "interface/icons/head/hermione.webp", None, None), - "headlib": AchievementKind("progression", "Head Librarian", "Had oral lessons with Hermione.", "interface/icons/head/hermione.webp", None, None), - "nerdgasm": AchievementKind("progression", "Nerdgasm", "Done the deed with Hermione.", "interface/icons/head/hermione.webp", None, None) + # SECRETS + "puzzle": AchievementKind("secrets", "Brainiac", "Solved an incredibly complex sliding tiles puzzle...", "interface/icons/item_potion.webp", None, None), + "flashback": AchievementKind("secrets", "Flashback", "Rolled back to the future at the right moment...", "interface/icons/cards.webp", None, None), } init python hide: @@ -139,7 +140,7 @@ init python in achievements: def get_list(category=None): if category: - items = filter((lambda x: category==renpy.store.achievements_db[x].category.lower()), renpy.store.achievements_db) + items = filter((lambda x: category==renpy.store.achievements_db[x].category), renpy.store.achievements_db) else: items = renpy.store.achievements_db items = sorted(items, key=lambda x: renpy.store.natsort_key(renpy.store.achievements_db[x].title)) @@ -160,6 +161,15 @@ init python in achievements: def get_categories(): return set(item.category for item in renpy.store.achievements_db.values()) + def get_percentage(category=None): + if category: + items = list(filter((lambda x: category==renpy.store.achievements_db[x].category), renpy.store.achievements_db)) + else: + items = renpy.store.achievements_db + total_achievements = len(items) + unlocked_achievements = sum(1 for x in items if renpy.store.achievement.has(x)) + return round((unlocked_achievements / total_achievements) * 100) + label achievements: $ disable_game_menu() call screen achievements @@ -206,11 +216,14 @@ screen achievements(): frame: label _("Achievements") + text "([achievements.get_percentage()]%)" pos (108, -3) + # Add items viewport: ypos 32 scrollbars "vertical" mousewheel True + draggable "touch" vbox: for item in menu_items: $ item_unlocked = achievement.has(item) @@ -237,7 +250,7 @@ screen achievements(): style achievements_viewport is viewport: xalign 0.5 - ymaximum 392 + ymaximum 397 style achievements_vbox is frame_vbox: ypos 0 yspacing 0