Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additions to the island event #9689

Merged
merged 49 commits into from
Oct 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e9cf589
wip island update
Booplicate Oct 5, 2022
c8e4f83
add the hack for tablechair
Booplicate Oct 5, 2022
2d0720f
add room sprites + accessor + new flt
Booplicate Oct 5, 2022
c004878
add lit room sprites
Booplicate Oct 5, 2022
1e2b05c
add the new bg
Booplicate Oct 5, 2022
d5819b3
consistent names
Booplicate Oct 5, 2022
1e452d0
better encoding
Booplicate Oct 5, 2022
a73df5f
more consistency
Booplicate Oct 5, 2022
899716c
help renpy load images properly
Booplicate Oct 5, 2022
8cc3718
unlocks adjustments
Booplicate Oct 5, 2022
9f33b05
define the lit version, improve code
Booplicate Oct 5, 2022
def648b
implement lock/unlock funcs in bg framework
Booplicate Oct 5, 2022
8b4dd37
typos
Booplicate Oct 5, 2022
c489b12
better exception
Booplicate Oct 5, 2022
70e0c03
better better exception
Booplicate Oct 5, 2022
42905a7
improve dynamic background definition
Booplicate Oct 5, 2022
8a5d950
some cleanup and optimisation
Booplicate Oct 8, 2022
c2380cf
cleanup some old code
Booplicate Oct 8, 2022
4c48c5d
fix typo
Booplicate Oct 10, 2022
d0aeea8
add `MASAudioData`
Booplicate Oct 10, 2022
a0e5531
add music, fix logs, fix old type in type name
Booplicate Oct 10, 2022
183edab
update script
Booplicate Oct 10, 2022
2aec7b1
safe flt img gen
Booplicate Oct 10, 2022
e420ecc
add the new transforms
Booplicate Oct 10, 2022
c13a2da
`play_song` > `mas_play_song`
Booplicate Oct 10, 2022
923da41
remove deprecated funcs
Booplicate Oct 10, 2022
db5f6b1
add `play_music`/`stop_music`
Booplicate Oct 10, 2022
f496fd4
wip: add the final event
Booplicate Oct 11, 2022
38686f3
typo
Booplicate Oct 18, 2022
254f550
cleanup bg selector
Booplicate Oct 18, 2022
e0f755f
fix typo in object name
Booplicate Oct 26, 2022
ce8c4a6
`IslandsImageDefinition` > `IslandsDataDefinition`
Booplicate Oct 26, 2022
b0b134d
add `_build_ifwd`
Booplicate Oct 26, 2022
c4e6195
add new decals, fix old
Booplicate Oct 26, 2022
7d5a319
fix 2yo typo
Booplicate Oct 26, 2022
2c2d144
adjust parallax disp params
Booplicate Oct 26, 2022
87949f8
cleanup
Booplicate Oct 26, 2022
4eee263
remove debug code
Booplicate Oct 26, 2022
3cf197d
add haunted tree
Booplicate Oct 26, 2022
ace52ff
add new unlocks and update script
Booplicate Oct 26, 2022
fe5b9da
vignette
Booplicate Oct 27, 2022
74c35a2
more cleanup
Booplicate Oct 27, 2022
74292c3
new on click events
Booplicate Oct 27, 2022
c18f82f
update the package
Booplicate Oct 27, 2022
5b958c3
remove unused code
Booplicate Oct 27, 2022
4d2427c
invert condition
Booplicate Oct 27, 2022
5a97544
add warning
Booplicate Oct 27, 2022
92fb0fc
dlg edits
jmwall24 Oct 27, 2022
5acfb92
edits
jmwall24 Oct 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
166 changes: 166 additions & 0 deletions Monika After Story/game/definitions.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,172 @@ python early:
f = io.BytesIO(self.data)
return renpy.display.pgrender.load_image(f, self.filename)

class MASAudioData(unicode):
"""
NOTE: This is temporal plaster-fix to renpy, use on your own risk,
this class and all support for it will be completely gone with r8
NOTE: This DOES NOT support saving in persistent (pickling),
and it might be unsafe to do so.

This loads audio from binary data
"""

def __new__(cls, data, filename):
rv = unicode.__new__(cls, filename)
rv.data = data
return rv

def __init__(self, data, filename):
self.filename = filename

def __reduce__(self):
# Pickle as a str is safer
return (str, (self.filename, ))

def __mas_periodic_override(self):
"""
This is the periodic call that causes this channel to load new stuff
into its queues, if necessary.
"""

# Update the channel volume.
vol = self.chan_volume * renpy.game.preferences.volumes[self.mixer]

if vol != self.actual_volume:
renpy.audio.renpysound.set_volume(self.number, vol)
self.actual_volume = vol

# This should be set from something that checks to see if our
# mixer is muted.
force_stop = self.context.force_stop or (renpy.game.preferences.mute[self.mixer] and self.stop_on_mute)

if self.playing and force_stop:
renpy.audio.renpysound.stop(self.number)
self.playing = False
self.wait_stop = False

if force_stop:
if self.loop:
self.queue = self.queue[-len(self.loop):]
else:
self.queue = [ ]
return

# Should we do the callback?
do_callback = False

topq = None

# This has been modified so we only queue a single sound file
# per call, to prevent memory leaks with really short sound
# files. So this loop will only execute once, in practice.
while True:

depth = renpy.audio.renpysound.queue_depth(self.number)

if depth == 0:
self.wait_stop = False
self.playing = False

# Need to check this, so we don't do pointless work.
if not self.queue:
break

# If the pcm_queue is full, then we can't queue
# anything, regardless of if it is midi or pcm.
if depth >= 2:
break

# If we can't buffer things, and we're playing something
# give up here.
if not self.buffer_queue and depth >= 1:
break

# We can't queue anything if the depth is > 0 and we're
# waiting for a synchro_start.
if self.synchro_start and depth:
break

# If the queue is full, return.
if renpy.audio.renpysound.queue_depth(self.number) >= 2:
break

# Otherwise, we might be able to enqueue something.
topq = self.queue.pop(0)

# Blacklist of old file formats we used to support, but we now
# ignore.
lfn = topq.filename.lower() + self.file_suffix.lower()
for i in (".mod", ".xm", ".mid", ".midi"):
if lfn.endswith(i):
topq = None

if not topq:
continue

try:
filename, start, end = self.split_filename(topq.filename, topq.loop)

if (end >= 0) and ((end - start) <= 0) and self.queue:
continue

if isinstance(topq.filename, MASAudioData):
topf = io.BytesIO(topq.filename.data)
else:
topf = renpy.audio.audio.load(self.file_prefix + filename + self.file_suffix)

renpy.audio.renpysound.set_video(self.number, self.movie)

if depth == 0:
renpy.audio.renpysound.play(self.number, topf, topq.filename, paused=self.synchro_start, fadein=topq.fadein, tight=topq.tight, start=start, end=end)
else:
renpy.audio.renpysound.queue(self.number, topf, topq.filename, fadein=topq.fadein, tight=topq.tight, start=start, end=end)

self.playing = True

except:

# If playing failed, remove topq.filename from self.loop
# so we don't keep trying.
while topq.filename in self.loop:
self.loop.remove(topq.filename)

if renpy.config.debug_sound and not renpy.game.after_rollback:
raise
else:
return

break

if self.loop and not self.queue:
for i in self.loop:
if topq is not None:
newq = renpy.audio.audio.QueueEntry(i, 0, topq.tight, True)
else:
newq = renpy.audio.audio.QueueEntry(i, 0, False, True)

self.queue.append(newq)
else:
do_callback = True

# Queue empty callback.
if do_callback and self.callback:
self.callback() # E1102

# global global_pause
want_pause = self.context.pause or renpy.audio.audio.global_pause

if self.paused != want_pause:

if want_pause:
self.pause()
else:
self.unpause()

self.paused = want_pause

renpy.audio.audio.Channel.periodic = __mas_periodic_override

# uncomment this if you want syntax highlighting support on vim
# init -1 python:

Expand Down
2 changes: 1 addition & 1 deletion Monika After Story/game/dev/dev_islands.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ label dev_test_islands_progress:
data = data_slow_rate

while progress < store.mas_island_event.MAX_PROGRESS_LOVE:
progress = store.mas_island_event._calcProgress(curr_lvl, start_lvl)
progress = store.mas_island_event._calc_progress(curr_lvl, start_lvl)
data[progress].append(curr_lvl)
curr_lvl += 1

Expand Down
26 changes: 13 additions & 13 deletions Monika After Story/game/dev/dev_pg_topics.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ label zz_mas_poemgame_actone:
call mas_poem_minigame_actone(show_monika=True,trans_fast=True) from _call_mpg_one
$ testvalues = _return
$ HKBShowButtons()
$ play_song(store.songs.current_track)
$ mas_play_song(store.songs.current_track)
$ store.songs.enabled = True
call spaceroom(scene_change=True)
m "Hi [player]!"
Expand All @@ -37,7 +37,7 @@ label zz_mas_poemgame_acttwo:
call mas_poem_minigame_acttwo(show_monika=True,trans_fast=True) from _call_mpg_two
$ testvalues = _return
$ HKBShowButtons()
$ play_song(store.songs.current_track)
$ mas_play_song(store.songs.current_track)
$ store.songs.enabled = True
call spaceroom(scene_change=True)
m "Hi [player]!"
Expand All @@ -61,7 +61,7 @@ label zz_mas_poemgame_actthr:
call mas_poem_minigame_actthree(trans_fast=True) from _call_mpg_three
$ testvalues = _return
$ HKBShowButtons()
$ play_song(store.songs.current_track)
$ mas_play_song(store.songs.current_track)
$ store.songs.enabled = True
call spaceroom(scene_change=True)

Expand All @@ -79,7 +79,7 @@ label zz_mas_poemgame_actthrm:
call mas_poem_minigame_actthree(trans_fast=True,hop_monika=True,gather_words=True) from _call_mpg_threem
$ testvalues = _return
$ HKBShowButtons()
$ play_song(store.songs.current_track)
$ mas_play_song(store.songs.current_track)
$ store.songs.enabled = True
$ _sel_words = testvalues
call spaceroom(scene_change=True)
Expand Down Expand Up @@ -112,7 +112,7 @@ label zz_mas_poemgame_actonept:
call mas_poem_minigame_actone(trans_fast=True,gather_words=True) from _call_mpg_onept
$ testvalues = _return
$ HKBShowButtons()
$ play_song(store.songs.current_track)
$ mas_play_song(store.songs.current_track)
$ store.songs.enabled = True
$ _sel_words = testvalues.pop("words")
call spaceroom(scene_change=True)
Expand Down Expand Up @@ -167,7 +167,7 @@ label zz_mas_poemgame_dg:

$ testvalues = _return
$ HKBShowButtons()
$ play_song(store.songs.current_track)
$ mas_play_song(store.songs.current_track)
$ store.songs.enabled = True
$ _sel_words = testvalues
call spaceroom(scene_change=True)
Expand Down Expand Up @@ -220,7 +220,7 @@ label zz_mas_poemgame_bgm:

$ testvalues = _return
$ HKBShowButtons()
# $ play_song(store.songs.current_track)
# $ mas_play_song(store.songs.current_track)
$ store.songs.enabled = True
$ _winner = testvalues[0]
$ _pts = testvalues[1]
Expand Down Expand Up @@ -273,7 +273,7 @@ label zz_mas_poemgame_oneg:

$ testvalues = _return
$ HKBShowButtons()
$ play_song(store.songs.current_track)
$ mas_play_song(store.songs.current_track)
$ store.songs.enabled = True
call spaceroom(scene_change=True)
m "Hi [player]!"
Expand Down Expand Up @@ -318,7 +318,7 @@ label zz_mas_poemgame_oc:

$ testvalues = _return
$ HKBShowButtons()
$ play_song(store.songs.current_track)
$ mas_play_song(store.songs.current_track)
$ store.songs.enabled = True
$ _sel_words = testvalues.pop("words")
call spaceroom(scene_change=True)
Expand Down Expand Up @@ -364,7 +364,7 @@ label zz_mas_pg_tb_grid_t1:
"three",
"four"
]

# area/positiong of grid
xywh = (640, 10, 600, 400)
row_info = (4, None)
Expand All @@ -388,7 +388,7 @@ label zz_mas_pg_tb_grid_t1:
m 1a "You picked '[picked]'"
show monika at t11
return

# this label tests out the grid with bg
label zz_mas_pg_tb_grid_t2:
show monika at t22
Expand All @@ -414,7 +414,7 @@ label zz_mas_pg_tb_grid_t2:
xywh = (10, 10, 400, 500)

# using NOne for spacing should auto calc the spacing
row_info = (6, 50)
row_info = (6, 50)
col_info = (2, 250)

# generate the word:returnvalue tuples
Expand All @@ -436,4 +436,4 @@ label zz_mas_pg_tb_grid_t2:
$ picked = _return
m 1a "You picked '[picked]'"
show monika at t11
return
return

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Monika After Story/game/script-ch30.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ init 999 python in mas_reset:
Runs reset code for islands
"""
# Did Monika make any progress on the islands?
mas_island_event.advanceProgression()
mas_island_event.advance_progression()


@ch30_reset(-580)
Expand Down Expand Up @@ -2398,7 +2398,7 @@ label ch30_day:
persistent._mas_d25_started_upset = True

# Once per day Monika does stuff on the islands
store.mas_island_event.advanceProgression()
store.mas_island_event.advance_progression()

# Give the bonus
mas_affection._withdraw_aff()
Expand Down
8 changes: 4 additions & 4 deletions Monika After Story/game/script-easter-eggs.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ label sayori_name_scare:
python:
from store.songs import FP_SAYO_NARA, initMusicChoices
initMusicChoices(sayori=True)
play_song(FP_SAYO_NARA, set_per=True)
mas_play_song(FP_SAYO_NARA, set_per=True)
store.mas_globals.show_sayori_lightning = True
return

Expand Down Expand Up @@ -61,7 +61,7 @@ label natsuki_name_scare(playing_okayev=False):
$ renpy.music.play(adjusted_t5c, fadein=2.0, tight=True)
else:
stop music
$ play_song("<from 11>" + scary_t5c)
$ mas_play_song("<from 11>" + scary_t5c)

# play with me scene setup
scene black
Expand Down Expand Up @@ -122,7 +122,7 @@ label natsuki_name_scare(playing_okayev=False):
$ renpy.music.play(adjusted_okayev, fadein=2.0, tight=True)
else:
stop music
$ play_song(store.songs.current_track)
$ mas_play_song(store.songs.current_track)

return

Expand Down Expand Up @@ -240,7 +240,7 @@ label mas_ghost_monika:

python:
#plays music from ghost menu.
play_song(audio.ghostmenu)
mas_play_song(audio.ghostmenu)

show noise zorder 11:
alpha 0.5
Expand Down
2 changes: 1 addition & 1 deletion Monika After Story/game/script-greetings.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -3464,7 +3464,7 @@ init 5 python:

label greeting_ourreality:
# Unlock islands
$ store.mas_island_event.startProgression()
$ store.mas_island_event.start_progression()

m 1hub "Hi, [player]!"
m 1hua "Ehehe~"
Expand Down
8 changes: 4 additions & 4 deletions Monika After Story/game/script-holidays.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ label mas_o31_lingerie:
#Cut the music for the blackout
python:
curr_song = songs.current_track
play_song(None)
mas_play_song(None)
mas_display_notif("M̷̢͘ô̴͎ṇ̵͐i̴͎͂k̸̗̂ả̴̫", ["C̸̳̓ą̵́n̷̳̎ ̸̖̊y̴̦͝õ̷̯ų̷͌ ̴̼͘h̷̭̚e̴̪͝a̴̙̐ŕ̵̖ ̴̠́m̸̰̂ě̵̬?̷̮̐"], "Topic Alerts")

scene black
Expand Down Expand Up @@ -1303,9 +1303,9 @@ label mas_o31_lingerie_end:

# restart song/sounds that were playing before event
if globals().get("curr_song", -1) is not -1 and curr_song != store.songs.FP_MONIKA_LULLABY:
play_song(curr_song, 1.0)
mas_play_song(curr_song, 1.0)
else:
play_song(None, 1.0)
mas_play_song(None, 1.0)

return "no_unlock"

Expand Down Expand Up @@ -3327,7 +3327,7 @@ label monika_aiwfc_song:

call mas_timed_text_events_prep

$ play_song("mod_assets/bgm/aiwfc.ogg",loop=False)
$ mas_play_song("mod_assets/bgm/aiwfc.ogg",loop=False)
m 1eub "{i}{cps=9}I don't want{/cps}{cps=20} a lot{/cps}{cps=11} for Christmas{w=0.09}{/cps}{/i}{nw}"
m 3eka "{i}{cps=11}There {/cps}{cps=20}is just{/cps}{cps=8} one thing I need{/cps}{/i}{nw}"
m 3hub "{i}{cps=8}I don't care{/cps}{cps=15} about{/cps}{cps=10} the presents{/cps}{/i}{nw}"
Expand Down
2 changes: 1 addition & 1 deletion Monika After Story/game/script-introduction.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ label introduction:
if persistent.monika_kill is None:
$ persistent.monika_kill = False

$ play_song(store.songs.FP_JUST_MONIKA, set_per=True)
$ mas_play_song(store.songs.FP_JUST_MONIKA, set_per=True)
if persistent.monika_kill:
m 6dsc "..."
m 6dfc "[player]..."
Expand Down