Code: Select all
init python:
class Cast:
def __init__(self, name, location, pl, pp, ip):
self.name = name
self.location = location
self.pl = pl
self.pp = 0
self.ip = 0
def role(self, text):
self.role = text
# The game starts here.
label start:
menu:
"Load the characters, please.":
jump cast
label cast:
"We're creating nine characters for now. We'll add more later."
python:
sm = Cast("Shrine Maiden", "Shrine", 2, 0, 0)
gs = Cast("Girl Student", "School", 3, 0, 0)
bs = Cast("Boy Student", "School", 2, 0, 0)
ow = Cast("Office Worker", "City", 2, 0, 0)
po = Cast("Police Officer", "City", 3, 0, 0)
do = Cast("Doctor", "Hospital", 3, 0, 0)
rg = Cast("Rich Girl", "School", 1, 0, 0)
pa = Cast("Patient", "Hospital", 2, 0, 0)
ib = Cast("Information Broker", "City", 2, 0, 0)
"Check to see if it worked."
menu:
"Check":
"[sm.name] has been born in [sm.location.] with a Paranoia Limit of [sm.pl]. It has [sm.pp] Paranoia Points and [sm.ip] Intrigue Points."
jump check2
"Shrine Maiden has been born in Shrine with a Paranoia Limit of 2. It has 0 Paranoia Points and 0 Intrigue Points."
"Girl Student has been born in School with a Paranoia Limit of 3. It has 0 Paranoia Points and 0 Intrigue Points."
...and so on until I've described all the characters.
I know the obvious solution is to do the following:
Code: Select all
"[sm.name] has been born in [sm.location.] with a Paranoia Limit of [sm.pl]. It has [sm.pp] Paranoia Points and [sm.ip] Intrigue Points."
"[gs.name] has been born in [gs.location.] with a Paranoia Limit of [gs.pl]. It has [gs.pp] Paranoia Points and [gs.ip] Intrigue Points."
But is there at all a better way to do this? For example, if I want to add about 100 different instances of the Cast class, it would be a huge pain to manually copy and paste and then change all the variables.