Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions code/main/constants.rpy
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
define TMLP_MOD_NAME = "tmlp"
define TMLP_PREFIX = TMLP_MOD_NAME + "_"

define TMLP_TIMEOFDAY_DAY = "day"
define TMLP_TIMEOFDAY_NIGHT = "night"
define TMLP_TIMEOFDAY_SUNSET = "sunset"
define TMLP_TIMEOFDAY_PROLOGUE = "prologue"

define TMLP_GUI_PATH = "tmlp/images/gui/"

define TMLP_SCREENS = [
"main_menu",
"quit",
"say",
"nvl",
"game_menu_selector",
"yesno_prompt",
"choice",
"help",
]

define TMLP_SOUND_CHANNELS = [
"ambience",
"music",
"sound",
"sound_loop",
]
207 changes: 117 additions & 90 deletions code/main/resources.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,32 @@
from random import Random
from os import path

tmlp_mod_name = "tmlp"
tmlp_prefix = tmlp_mod_name + "_"

for file_name in renpy.list_files():
if tmlp_mod_name in file_name:
if TMLP_MOD_NAME in file_name:
file_path = path.splitext(path.basename(file_name))[0]

if file_name.startswith(tmlp_mod_name + "/images/bg/"):
bg_name = "bg " + tmlp_prefix + file_path
if file_name.startswith(TMLP_MOD_NAME + "/images/bg/"):
bg_name = "bg " + TMLP_PREFIX + file_path

if file_name.endswith(".ogv"):
renpy.image(bg_name, Movie(fps=45, play=file_name))

else:
renpy.image(bg_name, file_name)

elif file_name.startswith(tmlp_mod_name + "/images/sprites/"):
elif file_name.startswith(TMLP_MOD_NAME + "/images/sprites/"):
renpy.image(
tmlp_prefix + file_path,
TMLP_PREFIX + file_path,
ConditionSwitch(
"persistent.sprite_time == 'sunset'", im.MatrixColor(file_name, im.matrix.tint(0.94, 0.82, 1.0)),
"persistent.sprite_time == 'night'", im.MatrixColor(file_name, im.matrix.tint(0.63, 0.78, 0.82)),
True, file_name
)
)

elif file_name.startswith(tmlp_mod_name + "/sounds/"):
globals()[tmlp_prefix + file_path] = file_name
elif file_name.startswith(TMLP_MOD_NAME + "/sounds/"):
globals()[TMLP_PREFIX + file_path] = file_name

tmlp_std_set_for_preview = {}
tmlp_std_set = {}
store.tmlp_colors = {}
store.tmlp_names = {}
store.tmlp_names_list = []
Expand Down Expand Up @@ -70,49 +65,74 @@
tmlp_names["tmlp_sl"] = "Славяна"
store.tmlp_names_list.append("tmlp_sl")

def tmlp_char_define(x, is_nvl=False):
def tmlp_char_define(character_name, is_nvl=False):
global DynamicCharacter
global nvl
global tmlp_store
global tmlp_speaker_color
tmlp_gl = globals()

if x == "tmlp_narrator":
if character_name == "tmlp_narrator":
if is_nvl:
tmlp_gl["tmlp_narrator"] = Character(None, kind=nvl, what_style="tmlp_text_style", ctc="none", ctc_position="fixed")
tmlp_gl["tmlp_narrator"] = Character(
None,
kind=nvl,
what_style="tmlp_text_style"
)

else:
tmlp_gl["tmlp_narrator"] = Character(None, what_style="tmlp_text_style", ctc="none", ctc_position="fixed")
tmlp_gl["tmlp_narrator"] = Character(
None,
what_style="tmlp_text_style"
)

return

if x == "tmlp_th":
if character_name == "tmlp_th":
if is_nvl:
tmlp_gl["tmlp_th"] = Character(None, kind=nvl, what_style="tmlp_text_style", what_prefix="~ ", what_suffix=" ~", ctc="none", ctc_position="fixed")
tmlp_gl["tmlp_th"] = Character(
None,
kind=nvl,
what_style="tmlp_text_style",
what_prefix="~ ",
what_suffix=" ~"
)

else:
tmlp_gl["tmlp_th"] = Character(None, what_style="tmlp_text_style", what_prefix="~ ", what_suffix=" ~", ctc="none", ctc_position="fixed")
tmlp_gl["tmlp_th"] = Character(
None,
what_style="tmlp_text_style",
what_prefix="~ ",
what_suffix=" ~"
)

return

if is_nvl:
tmlp_gl[x] = DynamicCharacter("%s_name" % x, color=store.tmlp_colors[x][tmlp_speaker_color], kind=nvl, what_style="tmlp_text_style", who_suffix=":", ctc="none", ctc_position="fixed")
tmlp_gl["%s_name" % x] = store.tmlp_names[x]
tmlp_gl[character_name] = DynamicCharacter(
"%s_name" % character_name,
color=store.tmlp_colors[character_name][tmlp_speaker_color],
kind=nvl,
what_style="tmlp_text_style",
who_suffix=":"
)
tmlp_gl["%s_name" % character_name] = store.tmlp_names[character_name]

else:
tmlp_gl[x] = DynamicCharacter("%s_name" % x, color=store.tmlp_colors[x][tmlp_speaker_color], what_style="tmlp_text_style", ctc="none", ctc_position="fixed")
tmlp_gl["%s_name" % x] = store.tmlp_names[x]
tmlp_gl[character_name] = DynamicCharacter(
"%s_name" % character_name,
color=store.tmlp_colors[character_name][tmlp_speaker_color],
what_style="tmlp_text_style"
)
tmlp_gl["%s_name" % character_name] = store.tmlp_names[character_name]

def tmlp_set_mode_adv():
nvl_clear()

global menu
menu = renpy.display_menu

global tmlp_store

for x in store.tmlp_names_list:
tmlp_char_define(x)
for character_name in store.tmlp_names_list:
tmlp_char_define(character_name)

def tmlp_set_mode_nvl():
nvl_clear()
Expand All @@ -122,49 +142,30 @@

global tmlp_narrator
global tmlp_th

tmlp_narrator_nvl = tmlp_narrator
th_nvl = tmlp_th

global tmlp_store

for x in store.tmlp_names_list:
tmlp_char_define(x, True)
for character_name in store.tmlp_names_list:
tmlp_char_define(character_name, True)

def tmlp_reload_names():
global tmlp_store

for x in store.tmlp_names_list:
tmlp_char_define(x)

tmlp_reload_names()

def tmlp_day_intro(day_numeral, tmlp_save_name, text_output = "adv", tmlp_part = "one"):
global save_name

tmlp_part_one_introes_path = tmlp_gui_path + "part_one_introes/part_one_day_"
tmlp_part_two_intro_path = tmlp_gui_path + "part_two_intro/part_two.webm"
tmlp_part_three_intro_path = tmlp_gui_path + "part_three_intro/part_three.webm"

save_name = tmlp_save_name

renpy.pause(1, hard = True)
for character_name in store.tmlp_names_list:
tmlp_char_define(character_name)

if tmlp_part == "one":
renpy.movie_cutscene(tmlp_part_one_introes_path + str(day_numeral) + ".webm")
def tmlp_frame_animation(image_name, frames_quantity, retention, loop, transition, start=1, **properties):
anim_args = []

elif tmlp_part == "two":
renpy.movie_cutscene(tmlp_part_two_intro_path)
for i in range(start, start + frames_quantity):
anim_args.append(renpy.display.im.image(image_name + "_" + str(i) + ".png"))

elif tmlp_part == "three":
renpy.movie_cutscene(tmlp_part_three_intro_path)

renpy.pause(1, hard = True)

if text_output == "adv":
tmlp_set_mode_adv()
if loop:
anim_args.append(retention)
anim_args.append(transition)

else:
tmlp_set_mode_nvl()
return anim.TransitionAnimation(*anim_args, **properties)

def tmlp_blink(blink_pause):
renpy.show("blink")
Expand All @@ -177,19 +178,36 @@
renpy.show("unblink")
renpy.pause(unblink_pause, hard=True)

def tmlp_frame_animation(image_name, frames_quantity, retention, loop, transition, start=1, **properties):
if image_name:
anim_args = []
def tmlp_onload(type):
global tmlp_lock_quit
global tmlp_lock_quick_menu

if type == "lock":
renpy.config.skipping = None
tmlp_lock_quit = True
tmlp_lock_quick_menu = True
config.allow_skipping = False

elif type == "unlock":
tmlp_lock_quit = False
tmlp_lock_quick_menu = False
config.allow_skipping = True

def tmlp_set_timeofday_cursor():
config.mouse_displayable = MouseDisplayable(TMLP_GUI_PATH + "cursors/" + persistent.timeofday + "/cursor.png", 0, 0)

for i in range(start, start + frames_quantity):
anim_args.append(renpy.display.im.image(image_name + "_" + str(i) + ".png"))
def tmlp_set_dynamic_cursor(state):
if tmlp_set_timeofday_cursor in config.overlay_functions:
config.overlay_functions.remove(tmlp_set_timeofday_cursor)

if loop:
anim_args.append(retention)
anim_args.append(transition)
if state == "timeofday":
config.overlay_functions.append(tmlp_set_timeofday_cursor)

return anim.TransitionAnimation(*anim_args, **properties)
return None
elif state == "main_menu":
config.mouse_displayable = MouseDisplayable(TMLP_GUI_PATH + "cursors/main_menu/cursor.png", 0, 0)

elif state == "null":
config.mouse_displayable = MouseDisplayable(Null(0, 0), 0, 0)

def tmlp_set_time(timeofday, sprite_time=None):
if sprite_time is None:
Expand All @@ -199,30 +217,39 @@
persistent.timeofday = timeofday
persistent.sprite_time = sprite_time

init:
image tmlp_part_one_main_menu = Movie(fps = 45, play = tmlp_gui_path + "main_menu_part_one/tmlp_part_one_main_menu.webm")

image tmlp_part_one_main_menu_1of3 = tmlp_frame_animation(tmlp_gui_path + "main_menu_part_one/1of3_frame_animation/1of3", 20, 1, True, dissolve)
image tmlp_stars_anim = tmlp_frame_animation("tmlp/images/bg/anim_bg/tmlp_stars/stars", 2, 1.5, True, Dissolve(1.5))
image bg tmlp_int_catacombs_living_celling_blurred = im.Blur("tmlp/images/bg/part1/tmlp_int_catacombs_living_celling.png", 2)

# image tmlp_part_one_main_menu_1of3_glitch = tmlp_glitches(tmlp_gui_path + "main_menu/part1/1of3_static.png", 1)
# image tmlp_text = tmlp_glitches(tmlp_gui_path + "main_menu_part_one/tmlp_text.png")
def tmlp_random_menu_theme():
current_theme = renpy.random.choice(tmlp_menu_themes)

$ tmlp_transition = ImageDissolve(tmlp_gui_path + "transitions/glitch.png", 2, 50, reverse = False)
$ tmlp_glitch_transition = MultipleTransition([True, Dissolve(0.5), "tmlp/images/gui/transitions/glitch/1.png", Pause(1.0), "tmlp/images/gui/transitions/glitch/2.png", dissolve, True])
persistent.tmlp_theme_number = current_theme["theme_number"]
persistent.tmlp_main_menu_background = current_theme["main_menu_background"]
persistent.tmlp_main_menu_music = current_theme["main_menu_music"]

if persistent.tmlp_firstrun == None:
$ persistent.tmlp_firstrun = False
init:
$ tmlp_reload_names()

if persistent.tmlp_part_one_completed == None:
$ persistent.tmlp_part_one_completed = False
image tmlp_main_menu_bg_theme_1 = TMLP_GUI_PATH + "main_menu/theme_1.png"
image tmlp_main_menu_bg_theme_2 = TMLP_GUI_PATH + "main_menu/theme_2.png"
image tmlp_main_menu_bg_theme_3 = Movie(fps=45, play=TMLP_GUI_PATH + "main_menu/theme_3.webm")

if persistent.tmlp_part_two_completed == None:
$ persistent.tmlp_part_two_completed = False
image tmlp_stars_anim = tmlp_frame_animation("tmlp/images/bg/anim_bg/tmlp_stars/stars", 2, 1.5, True, Dissolve(1.5))

$ tmlp_pyan_contempt = 0
$ tmlp_diary_active = False
$ tmlp_menu_themes = [
{
"theme_number": "1",
"main_menu_background": "tmlp_main_menu_bg_theme_1",
"main_menu_music": tmlp_mega_drive_narc,
},
{
"theme_number": "2",
"main_menu_background": "tmlp_main_menu_bg_theme_2",
"main_menu_music": tmlp_mega_drive_narcs,
},
{
"theme_number": "3",
"main_menu_background": "tmlp_main_menu_bg_theme_3",
"main_menu_music": tmlp_mega_drive_narc3,
}
]

transform tmlp_bus_moving():
subpixel True
Expand All @@ -240,4 +267,4 @@ init:
linear 0.2 yoffset -1
linear 0.25 yoffset 2
linear 0.2 yoffset -1
repeat
repeat
Loading