This is my first qustion in the forum
I am trying to create a progressive affection system which you need to gain the status of "Best Friend" before you can add points to Romance.
My code so far looks like so:
(NB: I rewrite the code on another project to specifically test this so if there's lines that sometimes out of the ordinary, chances are that line is copy-pasted from my main game)
Code: Select all
default plname = "Andrew"
define pl = Character("Advisor [plname]")
define pre = Character("President Rosellini")
define bestfriendstatus = False
Code: Select all
label start:
# scores
scene bg2
#president's
#affinity point to player
$presaffpts = 5
$presaffstate = ""
#romance point to player
$preslovpts = 0
$preslovstate = ""
#points tracking presidents popularity
$prespoppts = 0
$prespoppts = ""
#function for points
init python:
#function to determine president points limit
#affinity
def limit_pres_aff(presaffpts, minpts=0, maxpts=100):
return max(min(presaffpts, maxpts), minpts)
def pres_aff_calc():
if presaffpts < 9:
presaffstate = "Stranger"
if ((presaffpts >= 10)and(presaffpts < 25)):
presaffstate = "Acquaintance"
if ((presaffpts >=25 )and(presaffpts < 50)):
presaffstate = "Friend"
if((presaffpts >=50)and (presaffpts < 80)):
presaffstate = "Close Friend"
if ((presaffpts >=85 )and(presaffpts < 101)):
presaffstate = "Best Friend"
return presaffstate
#status check for continuing
def pres_aff_check():
if presaffstate == "Best Friend":
bestfriendstatus = True
else:
bestfriendstatus = False
return bestfriendstatus
#love
#TBD NEED TO FIGURE OUT
My question is:
Is there a good way for me to create a similar structure of functions for the Romance points that requires the game to check first whether the Best Friend Status is marked true or not before the player can add Romance Points? (e.g: The game need to see if you're a best friend or not, if not, Romance points cannot be added, if true it can)
Should I rework the code to a better way?
I can't for the love of myself figure out how to properly do it
Thank you beforehand and I would really appreciate any suggestion or help