Compare commits

...

13 Commits
gouv-5 ... main

Author SHA1 Message Date
8b127a25b4 Merge branch 'refs/heads/dev' 2024-04-08 15:53:40 +01:00
e295fbb791 PixelateMask Shader 2024-04-08 15:48:23 +01:00
5c4ce667a5 Replace unneccesary eval 2024-04-03 12:38:48 +01:00
0dc071261b Unlock Luna's favours in developer skip 2024-04-02 16:31:14 +01:00
61da56b6c8 Partially revert #7ca17b7 (Breaks dev debug) 2024-04-02 16:21:13 +01:00
9aff807593 Bug fixes
* Fixed inconsistent spacing
* Fixed inconsistent state var access
2024-04-02 16:18:18 +01:00
908beae5d3 Maintain access convention within save compat 2024-04-02 14:19:59 +01:00
d8751d73b9 Remove nonsense calls of getattr
(cherry picked from commit 7ca17b7ba7)
2024-04-02 13:53:55 +01:00
224194754f Avoid using unnecessary screens 2024-04-02 13:44:04 +01:00
e3c5fb609d Avoid python statement
(cherry picked from commit 22348f0901)
2024-04-02 13:41:44 +01:00
e04fd221dd Flag unreachable code
(cherry picked from commit 25820e002a)
2024-04-02 13:37:20 +01:00
ef97c273db Linting dynamic
(cherry picked from commit 60244e258a)
2024-04-02 13:36:59 +01:00
01126edc4e Update README 2023-08-02 22:00:18 +01:00
17 changed files with 164 additions and 85 deletions

View File

@ -1,5 +1,14 @@
python early hide:
import inspect
try:
from renpy.lint import python_builtins, renpy_builtins
except ImportError:
import builtins
python_builtins = set(dir(builtins))
del builtins
renpy_builtins = set()
__register_params = frozenset(inspect.signature(renpy.register_statement).parameters).difference({"name", "parse"})
def register_decorator(cls):
"""
@ -54,6 +63,12 @@ python early hide:
evaled = {n: eval(e) for n, e in self.items()}
renpy.dynamic(**evaled)
def lint(self):
for domain, st in (("Python", python_builtins), ("Ren'Py", renpy_builtins)):
inter = st.intersection(self)
if inter:
renpy.error(f"Dynamic statement redefines one or several {domain} builtins: {', '.join(map(repr, inter))}")
@register_decorator
class chibi:
@staticmethod

View File

@ -95,6 +95,7 @@ label update_lun_tier:
# T5 NOT AVAILABLE
return
# unreachable
# Requirement: Tier 4 - Blow me T4 E3
$ lun_level_up = 4
return

View File

@ -211,11 +211,9 @@ init 5 python:
self.set_pose(pose or self.walk)
# Note: Warper names and their count can change over time,
# so it's easier to just evaluate the input.
# List of available warpers:
# https://www.renpy.org/doc/html/atl.html?#warpers
warper = eval(f"_warper.{warper}")
warper = getattr(_warper, warper, _warper.linear)
distances = []
times = []

View File

@ -145,6 +145,7 @@ label day_start:
# Start Quests
jump quests
# unreachable
$ renpy.choice_for_skipping()
call screen room_menu
@ -239,6 +240,7 @@ label night_start:
# Start Quests
jump quests
# unreachable
$ renpy.choice_for_skipping()
call screen room_menu

View File

@ -142,18 +142,24 @@ label teleport(position=None,effect=True,poof_label=None):
with d1
hide screen blkfade
show screen heal_animation
show heal_ani onlayer screens zorder teleport_zorder:
anchor (0.5, 1.0)
pos teleport_pos
zoom 0.5
with d3
#stop music fadeout 1
hide screen heal_animation
hide heal_animation onlayer screens
if poof_label is not None:
$ renpy.call(poof_label)
show screen teleport_animation
call expression poof_label
show teleport_ani onlayer screens zorder teleport_zorder:
anchor (0.5, 0.7)
pos teleport_pos
zoom 0.5
with d5
hide screen teleport_animation
hide teleport_animation onlayer screens
with d5
if effect == True:
@ -161,14 +167,6 @@ label teleport(position=None,effect=True,poof_label=None):
return
screen teleport_animation():
add "teleport_ani" anchor (0.5, 0.7) xpos teleport_xpos ypos teleport_ypos zoom 0.5
zorder teleport_zorder
screen heal_animation():
add "heal_ani" anchor (0.5, 1.0) xpos teleport_xpos ypos teleport_ypos zoom 0.5
zorder teleport_zorder
# Dummy labels. To prevent crashes. # TODO: Remove later.
default hermione_action = None

View File

@ -3,7 +3,7 @@ init -999:
import json
import os
if not getattr(persistent, "mods_enabled"):
if not persistent.mods_enabled:
persistent.mods_enabled = _set()
mods_list = _dict()

View File

@ -75,12 +75,20 @@ label start_dev:
states.cho.ev.intro.e1_complete = True
states.cho.ev.intro.e2_complete = True
states.cho.ev.intro.e4_complete = True
states.sna.ev.hangouts.cho_e1 = True
states.paperwork_unlocked = True
store.states.lun.ev.intro.e1_complete = True
store.states.lun.ev.intro.e2_complete = True
states.lun.ev.intro.e1_complete = True
states.lun.ev.intro.e2_complete = True
states.lun.ev.quibbler.stocked = True
thequibbler_ITEM.used = True
states.lun.ev.spectrespecs.e1_complete = True
states.lun.ev.spectrespecs.e2_complete = True
states.lun.ev.spectrespecs.e3_complete = True
states.lun.ev.spectrespecs.e4_complete = True
states.lun.favors_unlocked = True
for i in mirror.items:
i.unlocked = True

View File

@ -34,6 +34,63 @@ init python:
gl_FragColor = vec4(mix(gl_FragColor.xyz, gl_FragColor.xyz * ctemp2rgb(ctemp), u_strength), 1.0);
""")
renpy.register_shader("pixelatemaskshader", variables="""
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform vec2 res0;
uniform float u_step;
uniform float u_lod_bias;
attribute vec2 a_tex_coord;
varying vec2 v_tex_coord;
""", vertex_600="""
v_tex_coord = a_tex_coord;
""", fragment_functions="""
vec2 CalculateNewUV(vec2 uv, vec2 size, float step) {
float dx = (step / size.x);
float dy = (step / size.y);
return vec2(dx*(floor(uv.x/dx) + 0.5), dy*(floor(uv.y/dy) + 0.5));
}
vec4 PixelateMask(sampler2D source, float alpha, vec2 size, vec2 uv, float step, float lod) {
if (alpha > 0.0) {
vec2 new_uv = CalculateNewUV(uv, size, step);
vec4 old = vec4(texture2D(source, uv, lod).rgb, 1.0);
vec4 new = vec4(texture2D(source, new_uv, lod).rgb, 1.0);
return mix(old, new, alpha);
}
return texture2D(source, uv, lod);
}
""", fragment_600="""
float alpha = texture2D(tex1, v_tex_coord).a;
gl_FragColor = PixelateMask(tex0, alpha, res0, v_tex_coord, u_step, u_lod_bias);
""")
class PixelateMask(renpy.Displayable, NoRollback):
def __init__(self, child, mask, step=1.0, **kwargs):
super().__init__(**kwargs)
self.child = renpy.displayable(child)
self.mask = renpy.displayable(mask)
self.step = step
def render(self, width, height, st, at):
child = renpy.display.render.render(self.child, width, height, st, at)
mask = renpy.display.render.render(self.mask, width, height, st, at)
rv = renpy.display.render.Render(width, height)
if renpy.display.render.models:
rv.mesh = True
rv.add_shader("pixelatemaskshader")
rv.add_uniform("u_step", self.step)
rv.blit(child, (0, 0))
rv.blit(mask, (0, 0))
renpy.redraw(self, 0)
return rv
transform color_temperature(factor=1.0, strength=1.0):
mesh True
shader "color_temperature_shader"

File diff suppressed because it is too large Load Diff