Merge pull request 'Redo chapter select and minor clean up of code base' (#247) from chapter_select_and_misc_fixes into master

Reviewed-on: https://git.cavemanon.xyz/Cavemanon/SnootGame/pulls/247
Reviewed-by: Nutbuster <nutbuster@cock.li>
Reviewed-by: Legalo <legalo@noreply.git.cavemanon.xyz>
This commit is contained in:
Mappening 2024-10-03 03:19:00 +00:00
commit 267634783d
11 changed files with 414 additions and 489 deletions

View file

@ -359,7 +359,7 @@ screen navigation():
textbutton _("Load") activate_sound "audio/ui/uiClick.wav" action ShowMenu("load")
textbutton _("Delete") activate_sound "audio/ui/uiClick.wav" action ShowMenu("delete")
if config.developer and persistent.enable_chapter_select:
if config.developer or persistent.enable_chapter_select:
textbutton _("Chapter Select") activate_sound "audio/ui/uiClick.wav" action Start("chapter_select")
textbutton _("Options") activate_sound "audio/ui/uiClick.wav" action ShowMenu("preferences")

View file

@ -21,36 +21,26 @@ init -1 python:
mod_menu_access = []
init python:
import webbrowser # This is for the ch2 "look the link up" choice
import random
import webbrowser
#function for insult layers
def showCG():
files = ["text1", "text2", "text3", "text4", "text5", "text6", "text7", "text8", "text9"]
length = len(files)
picked = random.randint(0,length - 1)
fileName = files[picked]
renpy.show(fileName, at_list=[randPosition])
# extra music channel so we can do crossfade instead of fadeout followed by fadein
# TODO: function for stopping both channels with optional fadeout so we don't have to keep track of which channel is playing
renpy.music.register_channel("music1","music",True,tight=True)
renpy.music.register_channel("music2","music",True,tight=True)
# allows playing looped ambience alongside music
renpy.music.register_channel("ambient","sfx",True,tight=True)
renpy.music.register_channel("ambient1","sfx",True,tight=True)
renpy.music.register_channel("ambient2","sfx",True,tight=True)
renpy.music.register_channel("ambient3","sfx",True,tight=True)
# No idea what this does
if persistent.scroll == True:
config.keymap['dismiss'].append('mousedown_4')
elif persistent.scroll == None:
persistent.scroll = False
if persistent.lewd == None:
persistent.lewd = False
if persistent.autoup == None:
persistent.autoup = False
# Set vars for bonus chapter completion
if persistent.bonus_chapters == None:
if renpy.seen_image("big ending"): #for returning players
persistent.bonus_chapters = 0b111111111
@ -59,6 +49,7 @@ init python:
persistent.bonus_chapters = 0b0
persistent.old_bonus_chapters = 0b0
# Randomizes the placement of choice boxes when a choice menu appears
def randomize_choices(choices):
# fine for size of 2
if (renpy.random.randint(0, 1)):
@ -67,258 +58,8 @@ init python:
pass
transform randPosition:
alpha 0.0
xalign random.uniform(0.2,0.8)
yalign random.uniform(0.2,0.8)
linear 0.6 alpha 1.0
linear 1.0 alpha 0.0
#python:
# def Walking( name ):
# show name:
# xalign 0.2 yalign 0.25
# ease 1.0 yalign 0.0
# ease 1.0 yalign 0.25
# repeat
#layeredimage aquariumexhibit:
#group animals:
# attribute babyTurtle:
# attribute octo:
# attribute
# attribute
# attribute
# attribute
#layeredimage aquarium
#group kids:
# attribute wkids:
# "smolpatrol.webp"
#layeredimage anon:
# group face:
# attribute neutralFace default:
# "anonb1f1.webp"
# attribute happyFace:
# "anonhappyface.webp"
# attribute flipNeutralFace:
# "flipanonb1f1.webp"
# attribute flipHappyFace:
# "flipanonhappyface.webp"
# group body:
# attribute neutralBody default:
# "anonspriteneutral.webp"
# attribute thumbsUp:
# "anonspritethumbsup.webp"
# attribute flipThumbsUp:
# "flipanonspritethumbsup.webp"
# attribute:
# "flipanonspriteneutral.webp"
# attribute monkey:
# "monkeyanon.webp"
# group holding:
# attribute guitar:
# "guitar.webp"
# Click-to-continue icons / animations
# TODO: settle on a position/animation that people like
#Raw Image & kwargs for long textboxes
define long_textbox_img = Image("gui/textbox_long.png", xalign=0.5, yalign=1.0)
define long_textbox = { "window_background": long_textbox_img, 'namebox_style': "namebox_large" }
#Characters
define base = Character (ctc="ctc_end_marker", ctc_pause="ctc_mid_marker", ctc_timedpause=Null(), ctc_position="nestled") # try to remember some of the basics of CTC
define narrator = Character(kind=base)
define A = Character (_('Anon'), base, color="#36E12D", who_outlines=[(gui.name_text_thickness, '#0C300A')]) # Light Green
define F = Character (_('Fang'), base, color="#B4D4CE", who_outlines=[(gui.name_text_thickness, '#0F3930')]) # Light Cyan
define Lucy = Character (_('Lucy'), base, color="#B4D4CE", who_outlines=[(gui.name_text_thickness, '#0F3930')]) # Light Cyan
define Ro = Character (_('Rosa'), base, color="#FE712B", who_outlines=[(gui.name_text_thickness, '#54230F')]) # Red-Orange
define St = Character (_('Stella'), base, color="#D5FFAE", who_outlines=[(gui.name_text_thickness, '#294211')]) # Light Green
define N = Character (_('Naomi'), base, color="#FDD2C1", who_outlines=[(gui.name_text_thickness, '#462628')]) # Peach
define Nas = Character (_('Naser'), base, color="#FFB561", who_outlines=[(gui.name_text_thickness, '#512322')]) # Orange
define T = Character (_('Trish'), base, color="#B675E6", who_outlines=[(gui.name_text_thickness, '#3A0C5D')]) # Purple
define Attendant = Character (_('Attendant'), base, color="#5BF0F8", who_outlines=[(gui.name_text_thickness, '#121C68')]) # Aqua
define Sp = Character (_('Spears'), base, color="#C7C7C7", who_outlines=[(gui.name_text_thickness, '#272727')]) # Light Grey
define Re = Character (_('Reed'), base, color="#ED4C5B", who_outlines=[(gui.name_text_thickness, '#421014')]) # Bright Red
define D = Character (_('Driver'), base, color="#FFECBC", who_outlines=[(gui.name_text_thickness, '#563010')]) # Yellow-Orange
define FM = Character (_("Fang's Mom"), base, color="#FFD8F6", who_outlines=[(gui.name_text_thickness, '#521947')]) # Bright Pink
define FD = Character (_("Fang's Dad"), base, color="#D8A09A", who_outlines=[(gui.name_text_thickness, '#461B1F')]) # Desaturated Orange
define LM = Character (_("Lucy's Mom"), base, color="#FFD8F6", who_outlines=[(gui.name_text_thickness, '#521947')]) # Bright Pink
define LD = Character (_("Lucy's Dad"), base, color="#D8A09A", who_outlines=[(gui.name_text_thickness, '#461B1F')]) # Desaturated Orange
define Tsuki = Character (_('Mr. Tsuki'), base, color="#A7F2A2", who_outlines=[(gui.name_text_thickness, '#471054')]) # Pear Green
define unknown = Character (_('(???)'), base, color="#FFF", who_outlines=[(gui.name_text_thickness, '#000')]) # White
define jingo = Character (_('Mr. Jingo'), base, color="#CD8283", who_outlines=[(gui.name_text_thickness, '#0F0D49')]) # Desaturated Red
define MaitD = Character (_('Maitre D'), base, color="#AF9EFF", who_outlines=[(gui.name_text_thickness, '#241630')]) # Cobalt Blue
define Moe = Character(_('Moe'), base, color="#A5BEED", who_outlines=[(gui.name_text_thickness, '#1F253B')]) # Desaturated Blue
define Vince = Character (_('Vince'), base, color="#FFECBC", who_outlines=[(gui.name_text_thickness, '#563010')]) # Yellow-Orange
define Waitress = Character (_('Waitress'), base, color="#F691C8", who_outlines=[(gui.name_text_thickness, '#512040')]) # Pink
define Riley = Character (_('Riley'), base, color="#B675E6", who_outlines=[(gui.name_text_thickness, '#1F0632')]) # TODO
define Tana = Character (_('Tana'), base, color="#B675E6", who_outlines=[(gui.name_text_thickness, '#1F0632')]) # TODO
define Trevor = Character (_('Trevor'), base, color="#B675E6", who_outlines=[(gui.name_text_thickness, '#1F0632')]) # TODO
#long TB chars
define AnonAndFang = Character(_('Anon and Fang'), base, color="72DFA8", who_outlines=[(gui.name_text_thickness, '#113623')]) # Cyan
define SV = Character (_('Street Vendor'), base, color="#F8E120", who_outlines=[(gui.name_text_thickness, '#58260C')]) # Yellow
define carl = Character ('Mr. Carldewskii', base, color="#EECB99", who_outlines=[(gui.name_text_thickness, '#082337')]) #Puke Orange
define Drf = Character ('Dr. Fernsworth', base, color="#DCEEF5", who_outlines=[(gui.name_text_thickness, '#253354')]) #Yellow-Orange
define FRT = Character (_('Fang Reed & Trish'), base, color="#DCBBF7", who_outlines=[(gui.name_text_thickness, '#191C78')]) #Light Purple
define FangAndTrish = Character(_('Fang and Trish'), base, color="#42DFA8", who_outlines=[(gui.name_text_thickness, '#183623')])
define NaserAndNaomi = Character(_('Naser and Naomi'), base, color="#22DFA8", who_outlines=[(gui.name_text_thickness, '#2036B3')])
define TeamMember = Character(_('Team member'), base, color="#D32552", who_outlines=[(gui.name_text_thickness, '#445F42')])
define Everyone = Character(_('Everyone'), base, color="#A45489", who_outline=[(gui.name_text_thickness, '#4F5F81')])
define Chet = Character(_('Chet'), base, color="#B45411", who_outline=[(gui.name_text_thickness, '#BF5F81')])
#Custom Vars for positions
transform scenter:
xalign 0.5 yalign 0.0
transform sleft:
xalign 0.0 yalign 0.0
transform sright:
xalign 1.0 yalign 0.0
#Stella
transform stcenter:
xalign 0.5 yalign 0.1
transform stleft:
xalign 0.0 yalign 0.1
transform stright:
xalign 1.0 yalign 0.1
#Anon
transform acenter:
xalign 0.5 yalign 0.1
transform aleft:
xalign 0.0 yalign 0.1
transform aright:
xalign 1.0 yalign 0.1
#Naser
transform ncenter:
xalign 0.6 yalign 0.1
transform nleft:
xalign -0.2 yalign 0.1
transform nright:
xalign 1.9 yalign 0.1
#Fangs mom
transform fmcenter:
xalign 0.5 yalign 0.1
transform fmleft:
xalign 0.0 yalign 0.1
transform fmright:
xalign 1.0 yalign 0.1
#Trish
transform tcenter:
xalign 0.5 yalign 0.1
transform tleft:
xalign 0.0 yalign 0.1
transform tright:
xalign 1.0 yalign 0.1
#Reed and other long tailed dinos
transform rcenter:
xalign 1.2 yalign 0.1
transform rleft:
xalign -0.2 yalign 0.1
transform rright:
xalign 1.7 yalign 0.1
#misc transforms
transform shudder:
subpixel True
around (.5, .5) alignaround (.5, .5) xalign .5 yalign .5
rotate 0
linear 0.0 rotate -0.75
block:
linear 0.04 rotate 0.75
linear 0.05 rotate -0.75
linear 0.07 rotate 0
transform turnaround:
linear 0.1 xzoom -1.0
transform wiggle:
subpixel True
block:
xpos 0.5 ypos 1.0 xanchor 0.5 yanchor 1.0 zoom 1.02
alignaround (.5, .5)
linear 10.0 yalign 1.0 clockwise circles 1
repeat
transform raymbatransform:
xcenter 0.6 ycenter 0.385 zoom 0.5
# PHONE SCROLLING
transform cursortransform:
block:
yalign 0.2 xalign 0.60
pause .25
easein_cubic 1 yalign 0.75 xalign 0.54
pause .5
repeat
screen prompt():
fixed:
add "cursor"
screen mousedetect():
transform: # thanks based nutbuster
zoom 0.8
rotate 12.5
mousearea:
ypos -75
area(432, 0, 795, 1100)
# xalign 0.5 yanchor 0 ypos 0
hovered Hide("prompt" )
unhovered Show("prompt")
screen textscroll():
timer 2.0 action(Show("mousedetect"), Show("prompt"))
add Solid("FFF")
transform:
zoom 0.8
rotate 12.5
viewport:
xalign 0.51 yanchor 0 ypos -75 xysize(795, 1150)
child_size(795, 7650)
draggable True
arrowkeys True
# edgescroll(400, 800)
yinitial 1.0
imagebutton auto "fangbutton%s" xalign 0.53 yalign 0.5:
ypos 65+(int(107/2))
xsize 284
ysize 107
action (Hide("mousedetect"), Hide("prompt"), Hide("textscroll", transition=Dissolve(1.0)), Return())
add "texts"
add "fang phone"
# Naser's position when helping Anon get up
transform nmidright:
xalign 1.5 yalign 0.08
# Naomi's position when handing the brochure to Anon
transform scloserleft:
xalign 0.1 yalign 0.0
default persistent.lewd = False
default persistent.autoup = False
label start:

View file

@ -447,10 +447,11 @@ label chapter_11:
#Naser Drama
#THIS SECTION IS SCORE DEPENDENT
# Doomer ending skips this segment
$ ending_score = get_ending()
# Determine ending and set up ending chapters
$ setup_ending(get_ending())
if ending_score == 2:
# Doomer ending skips this segment
if ending_route_number == 2:
stop music fadeout 3
pause 2
jump lPromAnnouncement
@ -586,9 +587,9 @@ label chapter_11:
Nas "Dont take it the wrong way, but my mind just screamed at me worst case scenario."
pause .5
if ending_score == 4: # Golden
if ending_route_number == 4: # Golden
jump lSortingThings
elif ending_score == 3: # tradwife
elif ending_route_number == 3: # tradwife
jump lMendingThings
else:
jump lBreakingThings # All else fails, go to shooter.
@ -5212,7 +5213,7 @@ label chapter_11:
pause .5
if ending_score == 3: # tradwife
if ending_route_number == 3: # tradwife
"Things are going pretty well. When we discount Trishs weekly attempt to talk with Fang."
@ -5467,7 +5468,7 @@ label chapter_11:
"{cps=*.1}...{/cps}"
# skip this segment if we're doing ending 1
if ending_score == 1: #shooter
if ending_route_number == 1: #shooter
$ next_story_chapter()
# the following segment makes sense in the context of 11B+11C+11D

View file

@ -1,85 +1,94 @@
define chapter_tuple_1 = [
("1. Anon meets Fang.", "chapter_1"),
("2. Fourth day of school.", "chapter_2"),
("3. Showing up at band practice.", "chapter_3"),
("4. Anon needs help during music period.", "chapter_4"),
("5. Fang and Anon cut class to talk on the roof.", "chapter_5"),
("6. Anon helps Fang find a venue for the band.", "chapter_6")
]
define chapter_tuple_2 = [
("7. Concert day.", "chapter_7"),
("8. Anon and Fang study together.", "chapter_8"),
("9. Trish ridicules Anon in front of the school.", "chapter_9"),
("10. Fang goes to Anon's apartment.", "chapter_10"),
("11. School assignment and route lock.", "chapter_11")
define chapter_tuple = [
("1. First Day of School", "chapter_1"),
("2. Meeting the Band", "chapter_2"),
("3. Band Practice", "chapter_3"),
("4. Music Class", "chapter_4"),
("5. Gardening Club / Heart to Heart", "chapter_5"), # This is supposed to be split in 2 chapters, but maybe making tons of save files stop working would be too much to ask
("6. Not a Date", "chapter_6"),
("7. Concert Day", "chapter_7"),
("8. Study Session", "chapter_8"),
("9. VVURM DRAMA", "chapter_9"),
("10. Confession", "chapter_10"),
("11. Naser drama", "chapter_11")
]
define ending_1_tuple = [
("11A. ", "chapter_11A"),
("12A. ", "chapter_12A"),
("12_5D. ", "chapter_12_5D"),
("13A. ", "chapter_13A"),
("14A. ", "chapter_14A")
("11.5. Announcing a Plan", "lPromAnnouncement"), # this is supposed to be ch 12 (13, accounting for ch 5), but it somehow got counted as part of 11 internally
("12. Let's all go to the Museum", "chapter_12A"),
("13. Prom is Complicated", "chapter_12_5D"),
("14. Bowling for Volcano High", "chapter_14A")
]
define ending_2_tuple = [
("11B. ", "chapter_11B"),
("12B. ", "chapter_12B"),
("13B. ", "chapter_13B"),
("14B. ", "chapter_14B")
("11.5. Announcing Nothing Important", "lPromAnnouncement"),
("12. Let's all go to a Concert", "chapter_12B"),
("13. Prom is For Suckers", "chapter_13B"),
("14. Anon and the Infinite Sadness", "chapter_14B")
]
define ending_3_tuple = [
("11C. ", "chapter_11C"),
("12C. ", "chapter_12C"),
("12_5C. ", "chapter_12_5C"),
("13C. ", "chapter_13C"),
("14C. ", "chapter_14C")
("11.5. Announcing a Date", "lPromAnnouncement"),
("12. Let's all go Camping", "chapter_12C"),
("13. Prom is Suprising", "chapter_12_5C"),
("14. Volcano Highschool Musical", "chapter_14C")
]
define ending_4_tuple = [
("11D. ", "chapter_11D"),
("12D. ", "chapter_12D"),
("12_5D. ", "chapter_12_5D"),
("13D. ", "chapter_13D"),
("14D. ", "chapter_14D")
("11.5. Announcing a Show.", "lPromAnnouncement"),
("12. Let's all go to the Aquarium", "chapter_12D"),
("13. Prom is Memorable", "chapter_12_5D"),
("14. Fast Times at Volcano High", "chapter_14D")
]
default tuples_index = [
("Chapters 1 to 6", chapter_tuple_1),
("Chapters 7 to 11", chapter_tuple_2)
]
label chapter_select:
$ quick_menu = False # Hides bottom quick menu UI
$ anonscore = 0
$ fangscore = 0
camera:
yanchor 0.0 xanchor 0.0 rotate None zoom 1.0
matrixcolor None
stop ambient
stop ambient1
stop ambient2
stop ambient3
stop sound
stop music
stop music1
stop music2
scene black
with Dissolve(0.25)
jump chapter_select_go_back # Technically we don't need to explicitly jump to the label just below here, but doing so anyway for clarity
label chapter_select_go_back:
menu:
"What ending do you want to lock to?"
"Ending 1":
$ ending_route_number = 1
"Ending 2":
$ ending_route_number = 2
"Ending 3":
$ ending_route_number = 3
"Ending 4":
$ ending_route_number = 4
"Exit to main menu":
scene black with Dissolve(0.25)
return
window hide
$ select_chapter()
init python:
def select_chapter():
global current_chapter, quick_menu
selected_tuple = ()
while True:
selected_tuple = display_tuple_menu(tuples_index)
if selected_tuple == "go_back":
renpy.jump("chapter_select")
current_chapter = display_tuple_menu(selected_tuple)
if current_chapter == "go_back":
continue
else:
find_chapter_in_array(current_chapter)
break
toggle_debug()
quick_menu = True # Restores the bottom quick menu UI
renpy.call(current_chapter)
def add_ending_tuple(ending_number):
global tuples_index
global current_chapter, quick_menu, ending_route_number, chapter_list_index, chapter_list, ending_chapters_determined, chapter_list_length
ending_tuples = {
1: ending_1_tuple,
@ -88,85 +97,62 @@ init python:
4: ending_4_tuple
}
if ending_number in ending_tuples:
description = f"Ending {ending_number} chapters"
tuples_index.append((description, ending_tuples[ending_number]))
# Chapter list to select from
chapter_tuples = chapter_tuple + ending_tuples[ending_route_number]
# Vars for displaying the choices
chapters_per_page = 6
current_page = 0
def display_tuple_menu(options):
return renpy.display_menu(options + [("Go Back", "go_back")])
start_index = 0
end_index = chapters_per_page
# The loop that displays the chapter choices
while True:
# Displays the choices
selected_tuple = renpy.display_menu(chapter_tuples[start_index:end_index] + [("Next Page", "chapter_select_next_page"), ("Go Back", "chapter_select_go_back")])
def set_scores(anon_score, fang_score):
global anonscore, fangscore
if selected_tuple == "chapter_select_next_page":
# If we're at the last page, wrap around to the first
current_page = 0 if end_index == len(chapter_tuples) else (current_page + 1)
anonscore = anon_score
fangscore = fang_score
start_index = chapters_per_page * current_page
end_index = min(start_index + chapters_per_page, len(chapter_tuples))
elif selected_tuple == "chapter_select_go_back":
renpy.jump("chapter_select_go_back")
def find_chapter_in_array(chapter):
global chapter_list_index
else:
break # We've selected a chapter
setup_ending(ending_route_number)
store._window_auto = True
# Find the index position of the selected chapter
try:
chapter_list_index = chapter_list.index(chapter)
chapter_list_index = chapter_list.index(selected_tuple)
except ValueError: # This crashes the game otherwise since it wouldn't find the correct chapter
MainMenu(confirm=False) () # Exits to the main menu
# Make an exception for the 11A/B/C/D chapters, since we're technically supposed to start at the PromAnnouncement label
# Stank as fuck
if selected_tuple == "lPromAnnouncement":
chapter_list_index = 10
current_chapter = "chapter_11"
label reset_chapter_list:
$ chapter_list = [
"chapter_1", "chapter_2", "chapter_3", "chapter_4", "chapter_5",
"chapter_6", "chapter_7", "chapter_8", "chapter_9", "chapter_10", "chapter_11"
]
toggle_debug()
quick_menu = True
renpy._window_auto = True
$ tuples_index = [
("Chapters 1 to 6", chapter_tuple_1),
("Chapters 7 to 11", chapter_tuple_2)
]
renpy.jump("lPromAnnouncement")
else:
print("No such chapter exists!")
MainMenu(confirm=False) () # Exits to the main menu
return
label chapter_select:
$ quick_menu = False # Hides bottom quick menu UI
call reset_chapter_list from _call_reset_chapter_list # Reset every time the tool is called
$ anon_points = 0
$ fang_points = 0
stop sound
stop music fadeout 2
scene black with dissolve
menu:
"Initialize scores:"
"Ending 1":
pass # Since points are already initialized at 0
"Ending 2":
# anon 0
$ fang_points = 4
"Ending 3":
$ anon_points = 4
# fang 0
"Ending 4":
$ anon_points = 4
$ fang_points = 4
$ wingStory = True
"Exit to main menu":
scene black with dissolve
return
$ set_scores(anon_points, fang_points)
$ ending_route_number = get_ending()
$ add_ending_chapters(ending_route_number)
$ add_ending_tuple(ending_route_number)
$ update_ending_variables() # Updates variables for newly extended 'chapter_list' with ending chapters
window hide
$ select_chapter()
current_chapter = selected_tuple
# Start playing the game
toggle_debug()
quick_menu = True # Restores the bottom quick menu UI
renpy.call(current_chapter)

View file

@ -11,6 +11,8 @@ define ending_routes = {
1: ["chapter_11A", "chapter_12A", "chapter_12_5D", "chapter_13A", "chapter_14A"]
}
# Default vars reset when a new game starts, so no biggie.
# Anon/Fang
default anonscore = 0
default fangscore = 0
@ -21,6 +23,6 @@ default chapter_list_length = get_chapter_list_length()
default chapter_list_index = 0 # Index number for the current position of the chapter_list array
default current_chapter = chapter_list[chapter_list_index] # Store the name of the label as a string
# Ending variables
default ending_route_number = None
default is_end_reached = False
# What ending we're on
default ending_route_number = None # A value of None signals to get_ending() to determine the value based off anon/fang scores when it is called
default ending_chapters_determined = False

View file

@ -241,8 +241,7 @@ image d_credits_text = Composite(
label lending:
$ cached_ending = get_ending()
if cached_ending == 4:
if ending_route_number == 4:
pause 0.5
show snootgame_big with dissolve: # Renpy not allowing you to grab images from the gui folder is serious bullshit
subpixel True
@ -272,7 +271,7 @@ label lending:
pause 50
queue music 'audio/OST/amberlight brillance live end.ogg'
queue music "<silence 1.0>" loop
elif cached_ending == 3:
elif ending_route_number == 3:
play music "audio/OST/Dino Destiny Reader.ogg"
pause 0.5
show c_credits_text:
@ -304,12 +303,12 @@ label lending:
stop music fadeout 5
scene black with Dissolve(3)
pause 2
if cached_ending == 3:
if ending_route_number == 3:
scene c10 with Dissolve(1.5)
pause 20
scene black with Dissolve(2)
pause 1
elif cached_ending == 4:
elif ending_route_number == 4:
scene golden ending with Dissolve(1.5)
pause 20
scene black with Dissolve(2)

View file

@ -0,0 +1,209 @@
init python:
# function for insult layers
import random
def showCG():
files = ["text1", "text2", "text3", "text4", "text5", "text6", "text7", "text8", "text9"]
length = len(files)
picked = random.randint(0,length - 1)
fileName = files[picked]
renpy.show(fileName, at_list=[randPosition])
transform randPosition:
alpha 0.0
xalign random.uniform(0.2,0.8)
yalign random.uniform(0.2,0.8)
linear 0.6 alpha 1.0
linear 1.0 alpha 0.0
#Raw Image & kwargs for long textboxes
define long_textbox_img = Image("gui/textbox_long.png", xalign=0.5, yalign=1.0)
define long_textbox = { "window_background": long_textbox_img, 'namebox_style': "namebox_large" }
#Characters
define base = Character (ctc="ctc_end_marker", ctc_pause="ctc_mid_marker", ctc_timedpause=Null(), ctc_position="nestled") # try to remember some of the basics of CTC
define narrator = Character(kind=base)
define A = Character (_('Anon'), base, color="#36E12D", who_outlines=[(gui.name_text_thickness, '#0C300A')]) # Light Green
define F = Character (_('Fang'), base, color="#B4D4CE", who_outlines=[(gui.name_text_thickness, '#0F3930')]) # Light Cyan
define Lucy = Character (_('Lucy'), base, color="#B4D4CE", who_outlines=[(gui.name_text_thickness, '#0F3930')]) # Light Cyan
define Ro = Character (_('Rosa'), base, color="#FE712B", who_outlines=[(gui.name_text_thickness, '#54230F')]) # Red-Orange
define St = Character (_('Stella'), base, color="#D5FFAE", who_outlines=[(gui.name_text_thickness, '#294211')]) # Light Green
define N = Character (_('Naomi'), base, color="#FDD2C1", who_outlines=[(gui.name_text_thickness, '#462628')]) # Peach
define Nas = Character (_('Naser'), base, color="#FFB561", who_outlines=[(gui.name_text_thickness, '#512322')]) # Orange
define T = Character (_('Trish'), base, color="#B675E6", who_outlines=[(gui.name_text_thickness, '#3A0C5D')]) # Purple
define Attendant = Character (_('Attendant'), base, color="#5BF0F8", who_outlines=[(gui.name_text_thickness, '#121C68')]) # Aqua
define Sp = Character (_('Spears'), base, color="#C7C7C7", who_outlines=[(gui.name_text_thickness, '#272727')]) # Light Grey
define Re = Character (_('Reed'), base, color="#ED4C5B", who_outlines=[(gui.name_text_thickness, '#421014')]) # Bright Red
define D = Character (_('Driver'), base, color="#FFECBC", who_outlines=[(gui.name_text_thickness, '#563010')]) # Yellow-Orange
define FM = Character (_("Fang's Mom"), base, color="#FFD8F6", who_outlines=[(gui.name_text_thickness, '#521947')]) # Bright Pink
define FD = Character (_("Fang's Dad"), base, color="#D8A09A", who_outlines=[(gui.name_text_thickness, '#461B1F')]) # Desaturated Orange
define LM = Character (_("Lucy's Mom"), base, color="#FFD8F6", who_outlines=[(gui.name_text_thickness, '#521947')]) # Bright Pink
define LD = Character (_("Lucy's Dad"), base, color="#D8A09A", who_outlines=[(gui.name_text_thickness, '#461B1F')]) # Desaturated Orange
define Tsuki = Character (_('Mr. Tsuki'), base, color="#A7F2A2", who_outlines=[(gui.name_text_thickness, '#471054')]) # Pear Green
define unknown = Character (_('(???)'), base, color="#FFF", who_outlines=[(gui.name_text_thickness, '#000')]) # White
define jingo = Character (_('Mr. Jingo'), base, color="#CD8283", who_outlines=[(gui.name_text_thickness, '#0F0D49')]) # Desaturated Red
define MaitD = Character (_('Maitre D'), base, color="#AF9EFF", who_outlines=[(gui.name_text_thickness, '#241630')]) # Cobalt Blue
define Moe = Character(_('Moe'), base, color="#A5BEED", who_outlines=[(gui.name_text_thickness, '#1F253B')]) # Desaturated Blue
define Vince = Character (_('Vince'), base, color="#FFECBC", who_outlines=[(gui.name_text_thickness, '#563010')]) # Yellow-Orange
define Waitress = Character (_('Waitress'), base, color="#F691C8", who_outlines=[(gui.name_text_thickness, '#512040')]) # Pink
define Riley = Character (_('Riley'), base, color="#B675E6", who_outlines=[(gui.name_text_thickness, '#1F0632')]) # TODO
define Tana = Character (_('Tana'), base, color="#B675E6", who_outlines=[(gui.name_text_thickness, '#1F0632')]) # TODO
define Trevor = Character (_('Trevor'), base, color="#B675E6", who_outlines=[(gui.name_text_thickness, '#1F0632')]) # TODO
#long TB chars
define AnonAndFang = Character(_('Anon and Fang'), base, color="72DFA8", who_outlines=[(gui.name_text_thickness, '#113623')]) # Cyan
define SV = Character (_('Street Vendor'), base, color="#F8E120", who_outlines=[(gui.name_text_thickness, '#58260C')]) # Yellow
define carl = Character ('Mr. Carldewskii', base, color="#EECB99", who_outlines=[(gui.name_text_thickness, '#082337')]) #Puke Orange
define Drf = Character ('Dr. Fernsworth', base, color="#DCEEF5", who_outlines=[(gui.name_text_thickness, '#253354')]) #Yellow-Orange
define FRT = Character (_('Fang Reed & Trish'), base, color="#DCBBF7", who_outlines=[(gui.name_text_thickness, '#191C78')]) #Light Purple
define FangAndTrish = Character(_('Fang and Trish'), base, color="#42DFA8", who_outlines=[(gui.name_text_thickness, '#183623')])
define NaserAndNaomi = Character(_('Naser and Naomi'), base, color="#22DFA8", who_outlines=[(gui.name_text_thickness, '#2036B3')])
define TeamMember = Character(_('Team member'), base, color="#D32552", who_outlines=[(gui.name_text_thickness, '#445F42')])
define Everyone = Character(_('Everyone'), base, color="#A45489", who_outline=[(gui.name_text_thickness, '#4F5F81')])
define Chet = Character(_('Chet'), base, color="#B45411", who_outline=[(gui.name_text_thickness, '#BF5F81')])
#Custom Vars for positions
transform scenter:
xalign 0.5 yalign 0.0
transform sleft:
xalign 0.0 yalign 0.0
transform sright:
xalign 1.0 yalign 0.0
#Stella
transform stcenter:
xalign 0.5 yalign 0.1
transform stleft:
xalign 0.0 yalign 0.1
transform stright:
xalign 1.0 yalign 0.1
#Anon
transform acenter:
xalign 0.5 yalign 0.1
transform aleft:
xalign 0.0 yalign 0.1
transform aright:
xalign 1.0 yalign 0.1
#Naser
transform ncenter:
xalign 0.6 yalign 0.1
transform nleft:
xalign -0.2 yalign 0.1
transform nright:
xalign 1.9 yalign 0.1
#Fangs mom
transform fmcenter:
xalign 0.5 yalign 0.1
transform fmleft:
xalign 0.0 yalign 0.1
transform fmright:
xalign 1.0 yalign 0.1
#Trish
transform tcenter:
xalign 0.5 yalign 0.1
transform tleft:
xalign 0.0 yalign 0.1
transform tright:
xalign 1.0 yalign 0.1
#Reed and other long tailed dinos
transform rcenter:
xalign 1.2 yalign 0.1
transform rleft:
xalign -0.2 yalign 0.1
transform rright:
xalign 1.7 yalign 0.1
#misc transforms
transform shudder:
subpixel True
around (.5, .5) alignaround (.5, .5) xalign .5 yalign .5
rotate 0
linear 0.0 rotate -0.75
block:
linear 0.04 rotate 0.75
linear 0.05 rotate -0.75
linear 0.07 rotate 0
transform turnaround:
linear 0.1 xzoom -1.0
transform wiggle:
subpixel True
block:
xpos 0.5 ypos 1.0 xanchor 0.5 yanchor 1.0 zoom 1.02
alignaround (.5, .5)
linear 10.0 yalign 1.0 clockwise circles 1
repeat
transform raymbatransform:
xcenter 0.6 ycenter 0.385 zoom 0.5
# PHONE SCROLLING
transform cursortransform:
block:
yalign 0.2 xalign 0.60
pause .25
easein_cubic 1 yalign 0.75 xalign 0.54
pause .5
repeat
screen prompt():
fixed:
add "cursor"
screen mousedetect():
transform: # thanks based nutbuster
zoom 0.8
rotate 12.5
mousearea:
ypos -75
area(432, 0, 795, 1100)
# xalign 0.5 yanchor 0 ypos 0
hovered Hide("prompt" )
unhovered Show("prompt")
screen textscroll():
timer 2.0 action(Show("mousedetect"), Show("prompt"))
add Solid("FFF")
transform:
zoom 0.8
rotate 12.5
viewport:
xalign 0.51 yanchor 0 ypos -75 xysize(795, 1150)
child_size(795, 7650)
draggable True
arrowkeys True
# edgescroll(400, 800)
yinitial 1.0
imagebutton auto "fangbutton%s" xalign 0.53 yalign 0.5:
ypos 65+(int(107/2))
xsize 284
ysize 107
action (Hide("mousedetect"), Hide("prompt"), Hide("textscroll", transition=Dissolve(1.0)), Return())
add "texts"
add "fang phone"
# Naser's position when helping Anon get up
transform nmidright:
xalign 1.5 yalign 0.08
# Naomi's position when handing the brochure to Anon
transform scloserleft:
xalign 0.1 yalign 0.0

50
game/src/storyline.rpy Normal file
View file

@ -0,0 +1,50 @@
init -1 python:
def ending_image():
#0b0000, DCBA, flash the bits with |=, check with &
endings = 0b0000
_e = 0b1
for i in range(1, 5):
fn = "e"+str(i)+"of4"
endings |= (_e * renpy.seen_image(fn))
_e = _e << 0b1
persistent.old_endings = persistent.endings
persistent.endings = endings
init python:
def next_story_chapter():
global chapter_list_index, current_chapter, chapter_list, ending_route_number, chapter_list_length, ending_chapters_determined
if chapter_list_index < chapter_list_length:
chapter_list_index += 1
current_chapter = chapter_list[chapter_list_index]
renpy.call(current_chapter)
# Safeguard if setup_ending wasn't called somehow
elif not ending_chapters_determined:
setup_ending(get_ending())
# We're at an ending
else:
ending_image()
if ending_route_number == 1:
renpy.quit()
else:
renpy.call("lending")
def setup_ending(ending):
global ending_route_number, chapter_list, chapter_list_length, ending_chapters_determined
if not ending_chapters_determined:
ending_route_number = ending
# Add ending chapters
chapter_list.extend(ending_routes[ending_route_number])
chapter_list_length = get_chapter_list_length() # chapter_list_length is updated to reflect the addition to the chapter_list array
ending_chapters_determined = True
def get_chapter_list_length():
global chapter_list
return len(chapter_list) - 1

View file

@ -2,14 +2,17 @@
init python:
def get_ending():
if anonscore >= 4 and fangscore >= 4 and wingStory:
return 4 # Golden
elif anonscore >= 3 and fangscore <= 4:
return 3 # Tradwife
elif anonscore <= 3 and fangscore >= 3:
return 2 # Doomer
if ending_route_number == None:
if anonscore >= 4 and fangscore >= 4 and wingStory:
return 4 # Golden
elif anonscore >= 3 and fangscore <= 4:
return 3 # Tradwife
elif anonscore <= 3 and fangscore >= 3:
return 2 # Doomer
else:
return 1 # Shooter
else:
return 1 # Shooter
return ending_route_number
def debug_story_variables(toggle=True):
@ -20,7 +23,7 @@ init python:
"chapter_list_length",
"chapter_list_index",
"ending_route_number",
"is_end_reached"
"ending_chapters_determined"
]
for item in var_list:

View file

@ -1,66 +0,0 @@
init -1 python:
def ending_image():
#0b0000, DCBA, flash the bits with |=, check with &
endings = 0b0000
_e = 0b1
for i in range(1, 5):
fn = "e"+str(i)+"of4"
endings |= (_e * renpy.seen_image(fn))
_e = _e << 0b1
persistent.old_endings = persistent.endings
persistent.endings = endings
init python:
def next_story_chapter():
global chapter_list_index, current_chapter
# Add check "is_end_reached" to have this if statement be executed only once when finishing the general chapters
if not is_end_reached and chapter_list_index >= chapter_list_length:
process_ending()
if chapter_list_index < chapter_list_length:
chapter_list_index += 1
current_chapter = chapter_list[chapter_list_index]
renpy.call(current_chapter)
else:
end_story()
def process_ending():
global ending_route_number
ending_route_number = get_ending()
add_ending_chapters(ending_route_number)
update_ending_variables() # Updates variables for newly extended 'chapter_list' with ending chapters
def add_ending_chapters(route_number):
global chapter_list
if route_number in ending_routes:
chapter_list.extend(ending_routes[route_number])
def update_ending_variables():
global chapter_list_length
global is_end_reached
# chapter_list_length is updated to reflect the addition to the chapter_list array
chapter_list_length = get_chapter_list_length()
is_end_reached = True
def get_chapter_list_length():
return len(chapter_list) - 1
def end_story():
ending_image()
if ending_route_number == 1:
renpy.quit()
else:
renpy.call("lending")