Code: Select all
transform achievement_transform:
on show:
xalign .98
yalign -.3
linear 0.4 xalign .98 yalign .02
on hide:
linear 0.4 xalign 1.9 yalign .02
screen scr_achievement_get(title, a_text, icon, trans=achievement_transform):
timer 4.0 action Hide("scr_achievement_get")
window:
at trans
background "#333333cc"
xalign .98
yalign .02
xysize (450, 100)
hbox:
vbox:
spacing 10
image icon
vbox:
xoffset 10
xsize 330
text title:
size 22
id title
text a_text:
size 14
id a_text
screen scr_achievement_update(title, a_text, icon, cur_prog, max_prog, trans=achievement_transform):
timer 4.0 action Hide("scr_achievement_update")
window:
at trans
background "#333333cc"
xalign .98
yalign .02
xysize (450, 100)
#
hbox:
vbox:
spacing 10
image icon
text "{0}/{1}".format(cur_prog, max_prog):
xcenter 0.5
ycenter 0.2
vbox:
xoffset 10
xsize 330
text title:
size 22
id title
text a_text:
size 14
id a_text
init python:
def get_achievement(ach_id, trans=achievement_transform):
ach = persistent.achievements_dict[ach_id]
achievement.grant(ach_id)
renpy.show_screen(_screen_name='scr_achievement_get', title=ach['title'],
a_text=ach['text'], icon=ach['icon'], trans=trans)
def update_achievement(ach_id, to_add=1, trans=achievement_transform):
persistent.achievements_dict[ach_id]["cur_prog"] += to_add
ach = persistent.achievements_dict[ach_id]
achievement.progress(ach_id, to_add)
if ach['cur_prog'] > ach['max_prog']:
persistent.achievements_dict[ach_id]["cur_prog"] = ach['max_prog']
ach = persistent.achievements_dict[ach_id]
renpy.show_screen(_screen_name='scr_achievement_update', title=ach['title'], a_text=ach['text'],
icon=ach['icon'], cur_prog=ach['cur_prog'], max_prog=ach['max_prog'], trans=trans)
# Define your achievements here
if not persistent.achievements_dict:
persistent.achievements_dict = {"General_Practitioner": {"type": 0, # One time achievent
"title": "General Practitioner", # Also neame for steam
"text": "You've been assigned a clinic of your own!", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Rita_Completed": {"type": 0, # One time achievent
"title": "Job Certification", # Also neame for steam
"text": "You completed Rita's exam!", # description
"icon": "images/achi/rita.png" # 96x96 image
},
"Clara_Completed": {"type": 0, # One time achievent
"title": "Gaining her trust", # Also neame for steam
"text": "You completed Clara's exam!", # description
"icon": "images/achi/clara.png" # 96x96 image
},
"Anne_Completed": {"type": 0, # One time achievent
"title": "Emergency Situation", # Also neame for steam
"text": "You completed Anne's exam!", # description
"icon": "images/achi/anne.png" # 96x96 image
},
"Paul_Completed": {"type": 0, # One time achievent
"title": "Apprehensive Parent", # Also neame for steam
"text": "You completed Paul's exam!", # description
"icon": "images/achi/paul.png" # 96x96 image
},
"Robyn_Completed": {"type": 0, # One time achievent
"title": "Troublesome Brother", # Also neame for steam
"text": "You completed Robyn's exam!", # description
"icon": "images/achi/paul.png" # 96x96 image
},
"Monique_Completed": {"type": 0, # One time achievent
"title": "Red eye", # Also neame for steam
"text": "You completed Monique's exam!", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Karen_Completed": {"type": 0, # One time achievent
"title": "Sawbones", # Also neame for steam
"text": "You completed Karen's exam!", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"TIC": {"type": 0, # One time achievent
"title": "Two's a couple", # Also neame for steam
"text": "You found a girlfriend!", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Voyeur": {"type": 0, # One time achievent
"title": "Voyeur", # Also neame for steam
"text": "You spied on your relative.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Cruel": {"type": 0, # One time achievent
"title": "Cruel", # Also neame for steam
"text": "You broke your niece's heart.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Uncle": {"type": 0, # One time achievent
"title": "Uncle", # Also neame for steam
"text": "You encouraged your niece to be a singer.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Athletic": {"type": 0, # One time achievent
"title": "Athletic", # Also neame for steam
"text": "You visited the pool/gym.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Devout": {"type": 0, # One time achievent
"title": "Devout", # Also neame for steam
"text": "You visited the church.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Workaholic": {"type": 0, # One time achievent
"title": "Workaholic", # Also neame for steam
"text": "You accepted Dr. Richard's offer.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"TTS": {"type": 0, # One time achievent
"title": "Trip to Seattle", # Also neame for steam
"text": "You attended the medical symposium in Seattle.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Family_Time": {"type": 0, # One time achievent
"title": "Family Time", # Also neame for steam
"text": "You completed your [rel_typemin] visit storyline.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Rocco": {"type": 0, # One time achievent
"title": "Rocco", # Also neame for steam
"text": "You had sex.", # description
"icon": "images/achi/rocco.png" # 96x96 image
},
"NCPD": {"type": 0, # One time achievent
"title": "Non c'è cosa più divina...", # Also neame for steam
"text": "You had sex with your cousin.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Kingslayer": {"type": 0, # One time achievent
"title": "Kingslayer", # Also neame for steam
"text": "You had sex with your sister.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Entrepreneur": {"type": 0, # One time achievent
"title": "Entrepreneur", # Also neame for steam
"text": "You hired a new staff member.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Shopping_Time!": {"type": 0, # One time achievent
"title": "Shopping Time!", # Also neame for steam
"text": "You bought a new item for the clinic!", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"ISWTT": {"type": 0, # One time achievent
"title": "In step with the times", # Also neame for steam
"text": "You made an app available to patients.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Indebted": {"type": 0, # One time achievent
"title": "Indebted", # Also neame for steam
"text": "You took a loan.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"IADNAP": {"type": 0, # One time achievent
"title": "I'm a doctor, not a photographer!", # Also neame for steam
"text": "You took pictures for Dr. Kirkman.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Turn_Around": {"type": 0, # One time achievent
"title": "Turn Around", # Also neame for steam
"text": "You had a massage.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"UmbHernia": {"type": 0, # One time achievent
"title": "Umbilical Hernia", # Also neame for steam
"text": "You completed Nolan's examination.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"KikoCompleted": {"type": 0, # One time achievent
"title": "Boarding schooler", # Also neame for steam
"text": "You completed Kiko's examination.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"KikoBlackmail": {"type": 0, # One time achievent
"title": "Blackmailer", # Also neame for steam
"text": "You blackmailed someone.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"TooYoung": {"type": 0, # One time achievent
"title": "Too Young!", # Also neame for steam
"text": "You completed Fanny's examination.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"Harassed": {"type": 0, # One time achievent
"title": "I fell from the stairs!", # Also neame for steam
"text": "You completed Bridget's examination.", # description
"icon": "images/achi/gp.png" # 96x96 image
},
"*Famous*": {"type": 1, # Progress achievent
"title": "Famous",
"text": "Your clinics reached 50 fame!",
"icon": "images/steth.png",
"cur_prog": 0, # current progress
"max_prog": 50 # maximal progress
}
}
for i, a in persistent.achievements_dict.items():
if a['type'] == 0:
achievement.register(i, steam=a['title'])
if a['type'] == 1:
achievement.register(i, steam=a['title'], stat_max=a['max_prog'])