Skip to content

Commit

Permalink
Merge pull request #595 from Just-Natsuki-Team/v1.1.0
Browse files Browse the repository at this point in the history
v1.1.0
  • Loading branch information
Blizzardsev committed Apr 8, 2023
2 parents 3c82001 + 3e351d7 commit 2b75ffe
Show file tree
Hide file tree
Showing 100 changed files with 2,541 additions and 104 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="https://justnatsuki.club/img/logos/jn_1-0-0_logo.png" height="300"/>
<img src="https://justnatsuki.club/img/logos/jn_1-1-0_logo.png" height="300"/>
</p>
<br>

Expand Down Expand Up @@ -204,6 +204,12 @@ Please refer to the full article on the wiki [here](https://github.com/Just-Nats

---

### Additional content

Visit the official JN extras repository [here](https://github.com/Just-Natsuki-Team/NatsukiModOutfits)!

---

### Community

Interested in taking part in a growing community of Natsuki fans just like you, or looking for a casual chat with some of the team?
Expand Down
55 changes: 49 additions & 6 deletions game/activity.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ init python in jn_activity:
- JNPlayerActivity type for the active window, or None
"""
if delay is not 0:
jnPause(delay, hard=True)
store.jnPause(delay, hard=True)

window_name = getCurrentWindowName()
if window_name is not None:
Expand Down Expand Up @@ -421,19 +421,62 @@ init python in jn_activity:
"""
return getCurrentWindowName() == store.config.window_title

def getCurrentWindowName():
def getCurrentWindowName(delay=0):
"""
Gets the title of the currently active window.
IN:
- delay - int amount of seconds to wait before checking window
OUT:
- str representing the title of the currently active window
"""
global ACTIVITY_SYSTEM_ENABLED
if ACTIVITY_SYSTEM_ENABLED:
if renpy.windows and pygetwindow.getActiveWindow():
return pygetwindow.getActiveWindow().title
if delay is not 0:
store.jnPause(delay, hard=True)

try:
if renpy.windows and pygetwindow.getActiveWindow():
return pygetwindow.getActiveWindow().title

elif renpy.linux:
# This is incredibly messy
focus = Xlib.display.Display().get_input_focus().focus

if not isinstance(focus, int):
# We have a window
wm_name = focus.get_wm_name()
wm_class = focus.get_wm_class()

if isinstance(wm_name, basestring) and wm_name != "":
# Window has a name, return it
return wm_name

elif wm_class is None and (wm_name is None or wm_name == ""):
# Try and get the parent of the window
focus = focus.query_tree().parent

if not isinstance(focus, int):
# Try and get the wm_name of the parent and return that instead
wm_name = focus.get_wm_name()
return wm_name if isinstance(wm_name, basestring) else ""

elif isinstance(wm_class, tuple):
# Just return the parent name
return str(wm_class[0])

# Fall through

except AttributeError as exception:
ACTIVITY_SYSTEM_ENABLED = False
jn_utils.log("Failed to identify activity: {0}; only x11 sessions are supported. Disabling activity system for session.".format(repr(exception)))
return ""

elif renpy.linux:
return Xlib.display.Display().get_input_focus().focus.get_wm_name()
except Exception as exception:
ACTIVITY_SYSTEM_ENABLED = False
jn_utils.log("Failed to identify activity: {0}. Disabling activity system for session.".format(repr(exception)))
return ""

return ""

Expand Down
28 changes: 27 additions & 1 deletion game/atmosphere.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ image sky day rain = "mod_assets/backgrounds/atmosphere/sky/sky_day_rain.png"
image sky day sunny = "mod_assets/backgrounds/atmosphere/sky/sky_day_sunny.png"
image sky day thunder = "mod_assets/backgrounds/atmosphere/sky/sky_day_thunder.png"
image sky day snow = "mod_assets/backgrounds/atmosphere/sky/sky_day_snow.png"
image sky day blossom = "mod_assets/backgrounds/atmosphere/sky/sky_day_blossom.png"

image sky night overcast = "mod_assets/backgrounds/atmosphere/sky/sky_night_overcast.png"
image sky night rain = "mod_assets/backgrounds/atmosphere/sky/sky_night_rain.png"
Expand Down Expand Up @@ -93,6 +94,14 @@ image particles snow:
"mod_assets/backgrounds/atmosphere/particles/snow.png"
snow_scroll

image particles cherry_blossom day:
"mod_assets/backgrounds/atmosphere/particles/cherry_blossom_day.png"
cherry_blossom_scroll

image particles cherry_blossom night:
"mod_assets/backgrounds/atmosphere/particles/cherry_blossom_night.png"
cherry_blossom_scroll

# Transforms
transform cloud_scroll:
# Clouds shift from left to right
Expand All @@ -119,6 +128,14 @@ transform rain_scroll:
linear 2 xoffset 220 yoffset 1280
repeat

transform cherry_blossom_scroll:
subpixel True
right
parallel:
xoffset 0 yoffset 0
linear 30 xoffset 220 yoffset 1280
repeat

# Transitions
define weather_change_transition = Dissolve(0.75)
define dim_change_transition = Dissolve(0.25)
Expand Down Expand Up @@ -159,6 +176,7 @@ init 0 python in jn_atmosphere:
thunder = 4
glitch = 5
snow = 6
cherry_blossom = 7

class JNWeather():
def __init__(
Expand Down Expand Up @@ -289,6 +307,14 @@ init 0 python in jn_atmosphere:
day_sky_image="sky glitch_fuzzy",
night_sky_image="sky glitch_fuzzy")

WEATHER_CHERRY_BLOSSOM = JNWeather(
weather_type=JNWeatherTypes.cherry_blossom,
day_sky_image="sky day blossom",
night_sky_image="sky night sunny",
day_particles_image="particles cherry_blossom day",
night_particles_image="particles cherry_blossom night"
)

# Weather code -> JNWeather map
# key: Regex matching the weather code as a string, allowing ranged captures (returned from OpenWeatherMap)
# value: JNWeather associated with the weather code range
Expand Down Expand Up @@ -533,7 +559,7 @@ init 0 python in jn_atmosphere:
return (response.json()["loc"].split(','))

except Exception as exception:
jn_utils.log("Failed to retrieve user latitude, longitude via IP address: {}".format(exception))
jn_utils.log("Failed to retrieve user latitude, longitude via IP address: {0}".format(exception))
return None

def isCurrentWeatherOvercast():
Expand Down
49 changes: 28 additions & 21 deletions game/custom-music.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,15 @@ image music_player playing = "mod_assets/props/music_player/music_player_play.pn
image music_player stopped = "mod_assets/props/music_player/music_player_stop.png"
image music_player paused = "mod_assets/props/music_player/music_player_pause.png"

transform music_player_fadein:
subpixel True
alpha 0
ease 0.5 alpha 1

transform music_player_fadeout:
subpixel True
alpha 1
ease 0.5 alpha 0

init python in jn_custom_music:
import os
import store
import store.jn_events as jn_events
import store.jn_utils as jn_utils

# Tracks must be placed here for Natsuki to find them
CUSTOM_MUSIC_DIRECTORY = os.path.join(renpy.config.basedir, "custom_music/").replace("\\", "/")
CUSTOM_MUSIC_FOLDER = "custom_music/"
CUSTOM_MUSIC_DIRECTORY = os.path.join(renpy.config.basedir, CUSTOM_MUSIC_FOLDER).replace("\\", "/")

# The file extensions we (Ren'Py) support
_VALID_FILE_EXTENSIONS = ["mp3", "ogg", "wav"]
Expand Down Expand Up @@ -97,7 +88,7 @@ init python in jn_custom_music:
"""
renpy.show(
name="music_player {0}".format(state),
at_list=[store.music_player_fadein],
at_list=[store.JN_TRANSFORM_FADE_IN],
zorder=store.JN_PROP_ZORDER
)
store.jnPause(0.5)
Expand All @@ -110,14 +101,26 @@ init python in jn_custom_music:
"""
renpy.show(
name="music_player",
at_list=[store.music_player_fadeout],
at_list=[store.JN_TRANSFORM_FADE_OUT],
zorder=store.JN_PROP_ZORDER
)
store.jnPause(0.5)
renpy.hide("music_player")
renpy.play(filename=store.audio.gift_close, channel="audio")
store.jnPause(0.5)

def getMusicFileRelativePath(file_name):
"""
Returns the relative file path for a music file.
IN:
- file_name - The name of the music file
OUT:
- str relative path of file
"""
return "../{0}{1}".format(CUSTOM_MUSIC_FOLDER, file_name)

label music_menu:
$ Natsuki.setInConversation(True)
$ music_title = "Error, this should have changed"
Expand Down Expand Up @@ -152,13 +155,17 @@ label music_menu:
# We failed to get the custom music, prompt player to correct
if not success:
show natsuki at jn_center
n 1kllunl "Uhmm..."
n 4knmunl "Hey...{w=0.3} [player]?"
n 4klrbgl "Something went wrong when I was trying look for your music..."
n 1kchbgl "Can you do me a favour and just check everything out real quick?"

n 4kllsssbr "Uhmm..."
n 4klrflsbr "Hey...{w=0.75}{nw}"
extend 4knmajsbr " [player]?"
n 4kslslsbr "Something {i}kinda{/i} went wrong when I was trying look for your music...{w=1}{nw}"
extend 4kslsssbr " can you just check everything out real quick?"
$ folder = jn_custom_music.CUSTOM_MUSIC_DIRECTORY
n 2knmbgl "If you forgot -{w=0.1} anything you want me to play needs to be in the {a=[folder]}custom_music{/a} folder."
n 2uwdaj "Oh!{w=0.2} Right!{w=0.2} And it also needs to be in {i}.mp3,{w=0.1} .ogg or .wav{/i} format -{w=0.1} just look for the letters after the period in the file name!"
n 2tlraj "As a reminder -{w=0.5}{nw}"
extend 2tnmsl " anything you want me to play needs to be in the {i}custom_music{/i} folder."
n 2fcsbgsbl "Just make sure it's all in {i}.mp3,{w=0.1} .ogg or .wav{/i} format!"

jump ch30_loop

elif preferences.get_volume("music") == 0:
Expand Down Expand Up @@ -256,7 +263,7 @@ label music_menu:
$ music_title = music_title_and_file[0]
play audio button_tap_c
show music_player playing
$ renpy.play(filename=music_title_and_file[1], channel="music", fadein=2)
$ renpy.play(filename=jn_custom_music.getMusicFileRelativePath(music_title), channel="music", fadein=2)
$ jnPause(2)

$ chosen_done_quip = renpy.substitute(random.choice(jn_custom_music._NATSUKI_PICK_MUSIC_DONE_QUIPS))
Expand All @@ -279,7 +286,7 @@ label music_menu:

play audio button_tap_c
show music_player playing
$ renpy.play(filename=_return, channel="music", fadein=2)
$ renpy.play(filename=jn_custom_music.getMusicFileRelativePath(music_title), channel="music", fadein=2)

$ chosen_done_quip = renpy.substitute(random.choice(jn_custom_music._NATSUKI_PICK_MUSIC_DONE_QUIPS))
n 2uchbgeme "[chosen_done_quip]{w=2}{nw}"
Expand Down
35 changes: 35 additions & 0 deletions game/definitions.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,27 @@ init -3 python:
global allow_dismiss
allow_dismiss = True

def jnClickToContinue(silent=True):
"""
Requires the player to click to advance the game for a given step.
IN:
- silent - If False, plays a notification sound on click. Defaults to True.
"""
global allow_dismiss
global _dismiss_pause
allow_dismiss = True
_dismiss_pause = True
renpy.pause()
_dismiss_pause = False

if not silent:
if jn_is_day():
renpy.play("mod_assets/buttons/sounds/button_click_day.ogg")

else:
renpy.play("mod_assets/buttons/sounds/button_click_night.ogg")

def jnIsNewYearsDay(input_date=None):
"""
Returns True if the input_date is New Year's Day; otherwise False
Expand Down Expand Up @@ -1827,6 +1848,9 @@ init -100 python in jn_utils:
# Save poem data
store.jn_poems.JNPoem.saveAll()

# Save joke data
store.jn_jokes.JNJoke.saveAll()

#Save topic data
store.Topic._save_topic_data()

Expand All @@ -1844,6 +1868,17 @@ init -100 python in jn_utils:
else:
store.persistent._jn_gs_aff = store.persistent.affinity

# Generic transforms/animations
transform JN_TRANSFORM_FADE_IN:
subpixel True
alpha 0
ease 0.5 alpha 1

transform JN_TRANSFORM_FADE_OUT:
subpixel True
alpha 1
ease 0.5 alpha 0

# Vanilla resources from base DDLC
define audio.t1 = "<loop 22.073>bgm/1.ogg" #Main theme (title)
define audio.t2 = "<loop 4.499>bgm/2.ogg" #Sayori theme
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified game/mod_assets/natsuki/arms/arms_crossed_body.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified game/mod_assets/natsuki/arms/arms_crossed_desk.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified game/mod_assets/natsuki/hair/jn_hair_bedhead/sitting/bangs.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified game/mod_assets/natsuki/hair/jn_hair_bun/sitting/bangs.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified game/mod_assets/natsuki/hair/jn_hair_down/sitting/bangs.png
Binary file modified game/mod_assets/natsuki/hair/jn_hair_down_long/sitting/bangs.png
Binary file modified game/mod_assets/natsuki/hair/jn_hair_high_hoops/sitting/bangs.png
Binary file modified game/mod_assets/natsuki/hair/jn_hair_low_bun/sitting/bangs.png
Binary file modified game/mod_assets/natsuki/hair/jn_hair_low_hoops/sitting/bangs.png
Binary file modified game/mod_assets/natsuki/hair/jn_hair_messy_bun/sitting/bangs.png
Binary file modified game/mod_assets/natsuki/hair/jn_hair_pigtails/sitting/bangs.png
Binary file modified game/mod_assets/natsuki/hair/jn_hair_pixie_cut/sitting/bangs.png
Binary file modified game/mod_assets/natsuki/hair/jn_hair_ponytail/sitting/bangs.png
Binary file modified game/mod_assets/natsuki/hair/jn_hair_twin_buns/sitting/bangs.png
Binary file modified game/mod_assets/natsuki/hair/jn_hair_twintails/sitting/bangs.png
Binary file added game/mod_assets/props/joke_book_held.png
Binary file modified game/mod_assets/props/parfait_manga_held.png
Binary file modified game/mod_assets/props/twitch/dead/wintendo_twitch_dead_a.png
Binary file modified game/mod_assets/props/twitch/dead/wintendo_twitch_dead_b.png
Binary file modified game/mod_assets/props/twitch/held/wintendo_twitch_held_free.png
Binary file modified game/mod_assets/sfx/drawer.ogg
Binary file not shown.
4 changes: 2 additions & 2 deletions game/natsuki.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ init 0 python:
"""
return Natsuki._outfit.hairstyle.reference_name == reference_name

#TODO: Adjust these functions in a proper acs system
@staticmethod
def isWearingAccessory(reference_name):
"""
Expand Down Expand Up @@ -320,7 +319,7 @@ init 0 python:
jn_utils.log("416666696e6974792d".decode("hex"))

@staticmethod
def checkResetDailyAffinityGain():
def checkResetDailies ():
"""
Resets the daily affinity cap, if 24 hours has elapsed.
"""
Expand All @@ -335,6 +334,7 @@ init 0 python:
persistent.affinity_daily_gain = 5 * jn_affinity.get_relationship_length_multiplier()
persistent.affinity_gain_reset_date = current_date
persistent._affinity_daily_bypasses = 5
persistent._jn_daily_joke_given = False
jn_utils.log("4461696c7920616666696e697479206361702072657365743b206e6577206361702069733a".decode("hex") + str(persistent.affinity_daily_gain))

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion game/options.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
##
## The _() surrounding the string marks it as eligible for translation.

define config.version = "1.0.3"
define config.version = "1.1.0"
define config.name = "Just Natsuki"
define config.window_title = _("Just Natsuki - {0}".format(config.version))

Expand Down

0 comments on commit 2b75ffe

Please sign in to comment.