Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def start_time_cycle():
- gametime.schedule(begin_time, repeat=False, hour=0, min=0, sec=0)
- def begin_time():
- change_time = gametime.schedule(time_cycle, repeat=True, min=20, sec=0)
- change_time.attributes.add('day', True)
- change_time.attributes.add('phase', 6)
- change_time.key = 'time_cycle'
- def time_cycle():
- change_time = search_script('change_time')
- day = change_time.db.day
- phase = change_time.db.phase
- # Check if it's the end of the final phase of night.
- # Strings are placeholders until better alternatives can be writ.
- if not day and phase == 6:
- change_time.db.day = True
- change_time.db.phase = 1
- string = "The sun rises above the eastern horizon."
- elif day and phase == 1:
- change_time.db.phase = 2
- string = "It's now mid-morning."
- elif day and phase == 2:
- change_time.db.phase = 3
- string = "It's now early-noon."
- elif day and phase == 3:
- change_time.db.phase = 4
- string = "It's now high-noon."
- elif day and phase == 4:
- change_time.db.phase = 5
- string = "It's now mid-afternoon."
- elif day and phase == 5:
- change_time.db.phase = 6
- string = "It's now dusk."
- elif day and phase == 6:
- change_time.db.day = False
- change_time.db.phase = 1
- string = "The sun has set and the moon begins to glow."
- elif not day and phase == 1:
- change_time.db.phase = 2
- string = "It's now early-evening."
- elif not day and phase == 2:
- change_time.db.phase = 3
- string = "It's now late-evening."
- elif not day and phase == 3:
- change_time.db.phase = 4
- string = "It's now midnight."
- elif not day and phase == 4:
- change_time.db.phase = 5
- string = "It's now early-morning."
- elif not day and phase == 5:
- change_time.db.phase = 6
- string = "The break of dawn approaches."
- for room in Room.objects.all():
- room.msg_contents(string)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement