Code: Select all
label newday:
show screen DayDisplay
call statlock
if energy == 3:
call morning
elif energy == 2:
call day
elif energy == 1:
call night
else:
if extra_rest == True:
$ energy = 3
$ extra_rest = False
call monthchange
call daychange
elif extra_rest == False:
$ energy = 2
call monthchange
call daychange
label morning:
if location == house_street:
jump house_street
elif location == house_yard:
jump house_yard
else:
scene room_morning
menu:
"caridor":
jump caridor
"mirror":
jump mirror
"school":
jump school
"relex":
$ energy -= 1
return
label day:
if location == house_street:
jump house_street
elif location == house_yard:
jump house_yard
else:
scene room_day
menu:
"caridor":
jump caridor
"mirror":
jump mirror
"work":
jump work_supermarket
"relex":
$ energy -= 1
return
return
label night:
scene room_night
if location == house_street:
jump house_street
elif location == house_yard:
jump house_yard
else:
menu:
"caridor":
jump caridor
"Mirror":
jump mirror
"Relax":
$ energy -= 1
"Sleep":
$ energy -= 1
$ extra_rest = True
"You zzz-zz-z-zzzz-z"
return
How to make a good location memory system out of this, so that when resting at another location, energy is taken away and the character stays in the same place without teleporting home?
I tried writing:
$ location = 0
$ house = 1
$ yard = 1
If you came, for example, to the house, it worked there:
$ location = house
"Go to the yard":
$ location = 0 or $house = 0
$ location = yard
"Go home"
$ location = 0 or $ yard = 0
But for some reason, when switching to a new cycle, if I am not in the house, I am thrown into it, although it is indicated that when leaving the house it turns off, I do not understand how to make a system that will allow me to have dozens of locations and not bug.