I have the following code, modifying some stats based on randomness, for the most part.
Code: Select all
label w_mc():
if not backpack.has_item(toolbox_item):
if toolbox_added:
$ backpack.add_item(toolbox_item)
$ toolbox_added = False
if current_hour[:2] == '06':
$ maxcount = 1
elif current_hour[:2] > '14' and current_hour[:2] < '22':
$ maxcount = 2
label repeat_event:
if current_hour[:2] == '06' and day_week <= 4:
$ choice_1 = "Hm... I have at least an hour. Maybe I can get a bit done before going to school"
$ choice_2 = "Or, I could just leave early, give myself a bit of extra time"
$ event = 1
elif current_hour[:2] == '06':
$ choice_1 = "Hm... I have at least an hour before anyone else is up. I can probably get a bit done before breakfast"
$ choice_2 = "Or... I could probably just go get breakfast first, then come back here later"
$ event = 2
elif '14' < current_hour[:2] < '22':
$ choice_1 = "I can probably do at least a couple hours of bike repair today"
$ choice_2 = "Or I could go back into the house, relax on the couch for a bit..."
$ event = 3
else:
$ choice_1 = "Hm. I have the entire day off. Maybe I should spend some time on the bike, see if I can get some traction on the rebuild"
$ choice_2 = "Or, I could just slack off today, and work on the bike another day..."
$ event = 4
menu:
"[choice_1]":
$ goto = 1
"[choice_2]":
$ goto = 2
# if goto == 1:
# if event == 1:
# call addtime(1, False)
# $ count = 3
# elif event == 2:
# $ count = 1
# elif goto == 2:
if goto == 2:
if event == 2:
jump breakfast_interaction
else:
jump front_door
if count <= maxcount:
$ count += 1
call addtime(1,False) from _call_addtime_27
if count == 1:
$ sc = str(count) + " hour"
else:
$ sc = str(count) + " hours"
"I've already worked on this bike for [sc] today"
if count >= maxcount:
if debug:
"count vs maxcount"
if int(current_hour[:2]) == int('07') and day_week <= 4:
fP "I should get ready for school"
jump after_fS_mad_morning
elif int(current_hour[:2]) == int('07'):
fP "I should go get some breakfast"
jump breakfast_interaction
else:
fP "It's late, and probably time to call it a day second"
label end_bike_repair_daily:
$ end_bike_repair = True
jump front_door
else:
jump update_stat
else:
fP "It's late, and probably time to call it a day third"
jump front_door
label update_stat:
$ c = 0
$ mcI = False
if mc_b >= 40 and mc_b < 100:
$ c = .35
elif mc_b >= 100 and mc_b <= 150:
$ c = .25
else:
$ c = .5
if renpy.random.random() > c:
if mc_b <= 40:
$ mcI = 1
if backpack.has_item(toolbox_item):
$ mcI = 2
elif mc_b <= 75:
$ mcI = .5
if backpack.has_item(toolbox_item):
$ mcI = 1
else:
$ mcI = .25
if backpack.has_item(toolbox_item):
$ mcI = .5
if mcI:
$ statschangeNotify("mc_b",mcI)
call addtime(1,False) from _call_addtime_28
jump repeat_event
else:
$ renpy.notify("This time, you didn't manage to improve the status of your bike")
call addtime(1,False) from _call_addtime_29
jump repeat_event
return
count = 0
maxcount = 1
(seen in shift+d as starting points for the variables)
The first if triggers without problem, the
Code: Select all
if count <= maxcount:
But, when it reaches this:
Code: Select all
if count >= maxcount:
What happens now, instead of going into the inner if, it just continues, starts over (loops), and end up on the "else" of the menu-choices in the beginning.