KEMBAR78
Module Rpym | PDF
0% found this document useful (0 votes)
50 views1 page

Module Rpym

This Python module defines a Halloween2022Module class that handles Halloween-related events and quests. On initialization, it adds a Halloween 2022 quest and ghost character. On time and location change events, it checks if it is Halloween and the player's progress, jumping to different quest scenes if goals are met.

Uploaded by

ARMyLife Channel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views1 page

Module Rpym

This Python module defines a Halloween2022Module class that handles Halloween-related events and quests. On initialization, it adds a Halloween 2022 quest and ghost character. On time and location change events, it checks if it is Halloween and the player's progress, jumping to different quest scenes if goals are met.

Uploaded by

ARMyLife Channel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

init python:

import time as time_lib

class Halloween2022Module(Module):
id="halloween_2022"
subscribe_on_events=["time_update", "change_location"]

def is_halloween(self):
curr_date = time_lib.strftime("%d-%m")
return curr_date in ["30-10", "31-10", "1-11"]

def on_init(self):
Quests.addQuest(Quest.from_json("halloween_2022/quest.json"))

if not hasattr(store, "halloween_ghost"):


store.halloween_ghost = KTCharacter("halloween_ghost")

def on_event(self, event):


if event.type == "time_update":
if (
CurrentPlace['place'].id == "home" and
event.is_morning and
self.is_halloween() and
checkpoints["mod.halloween.2021"] and
not checkpoints["mod.halloween.2022"]
):
Quests.quest("Хэллоуин 2022").start()
checkpoints["mod.halloween.2022"] = True
renpy.jump("halloween_2022")
elif event.type == "change_location":
if Quests.quest("Хэллоуин 2022").isNextGoal("02. Ино"):
if event.new_location == place_flowers and game.time.is_morning
and gg_form == "def":
renpy.jump("halloween_2022_02")
elif Quests.quest("Хэллоуин 2022").isNextGoal("03. Сакура"):
if event.new_location == place_hospital and
game.time.is_morning and gg_form == "def":
renpy.jump("halloween_2022_03")
elif Quests.quest("Хэллоуин 2022").isNextGoal("04. Река"):
if event.new_location == place_river and game.time.is_evening
and gg_form == "def":
renpy.jump("halloween_2022_04")

You might also like