Start adding parameters for fifth level
This commit is contained in:
parent
15757f13fd
commit
db68c72493
105
NS.py
105
NS.py
@ -199,23 +199,24 @@ class NS(Game, Animation):
|
||||
{
|
||||
"int": [
|
||||
"timer-max-time", "timer-start-level-1", "timer-start-level-2", "timer-start-level-3",
|
||||
"timer-start-level-4", "timer-addition-level-1", "timer-addition-level-2", "timer-addition-level-3",
|
||||
"timer-addition-level-4", "sword-delay", "attract-gif-length", "attract-board-length",
|
||||
"attract-reset-countdown", "level-select-reset-countdown", "level-select-press-length",
|
||||
"ending-timeout", "lizard-hurt-length", "adjust-timer-start-step", "adjust-timer-addition-step",
|
||||
"adjust-cooldown-step"
|
||||
"timer-start-level-4", "timer-start-level-5", "timer-addition-level-1", "timer-addition-level-2",
|
||||
"timer-addition-level-3", "timer-addition-level-4", "timer-addition-level-5", "sword-delay",
|
||||
"attract-gif-length", "attract-board-length", "attract-reset-countdown",
|
||||
"level-select-reset-countdown", "level-select-press-length", "ending-timeout", "lizard-hurt-length",
|
||||
"adjust-timer-start-step", "adjust-timer-addition-step", "adjust-cooldown-step"
|
||||
],
|
||||
"float": [
|
||||
"timer-warning-start-1", "timer-warning-start-2", "timer-warning-start-3", "timer-warning-start-4"]
|
||||
"timer-warning-start-1", "timer-warning-start-2", "timer-warning-start-3", "timer-warning-start-4",
|
||||
"timer-warning-start-5"]
|
||||
},
|
||||
"boss":
|
||||
{
|
||||
"float": [
|
||||
"damage-per-hit-level-1", "damage-per-hit-level-2", "damage-per-hit-level-3",
|
||||
"damage-per-hit-level-4"
|
||||
"damage-per-hit-level-4", "damage-per-hit-level-5"
|
||||
],
|
||||
"int": [
|
||||
"cooldown-level-1", "cooldown-level-2", "cooldown-level-3", "cooldown-level-4",
|
||||
"cooldown-level-1", "cooldown-level-2", "cooldown-level-3", "cooldown-level-4", "cooldown-level-5"
|
||||
"first-combo-delay"
|
||||
]
|
||||
},
|
||||
@ -257,7 +258,11 @@ class NS(Game, Animation):
|
||||
"list": "titles",
|
||||
"int": "font_size",
|
||||
"float": ["platform_scale", "preview_margin", "zoom_step"],
|
||||
"float-list": ["platform_0_xy", "platform_1_xy", "platform_2_xy", "platform_3_xy", "preview_size"]
|
||||
"float-list": [
|
||||
"platform_0_xy", "platform_1_xy", "platform_2_xy", "platform_3_xy", "platform_4_xy",
|
||||
"preview_size"
|
||||
],
|
||||
"bool": ["metal_enabled", "simon_enabled"]
|
||||
}
|
||||
})
|
||||
|
||||
@ -617,22 +622,23 @@ class NS(Game, Animation):
|
||||
| L| ;| Arrow keys can also be used.
|
||||
|___|___| (UP = top left pad, RIGHT = top right pad, DOWN = bottom left pad, LEFT = bottom right pad)
|
||||
|
||||
The Z key is a shortcut for reset (F8 also resets).
|
||||
- The [Z] key is a shortcut for reset (F8 also resets).
|
||||
|
||||
The A key force resets the connected Arduino (or does nothing if no Arduino is connected).
|
||||
- The [A] key force resets the connected Arduino (or does nothing if no Arduino is connected).
|
||||
|
||||
CTRL+N toggles the display of live network diagnostics.
|
||||
- [CTRL+N] toggles the display of live network diagnostics.
|
||||
|
||||
The following keys adjust level 4's timing parameters:
|
||||
The following key combinations adjust timing parameters. Press CTRL and the index of the level to edit together
|
||||
while pressing the key. The index goes from 1-5 (rather than starting from 0):
|
||||
|
||||
CTRL+T - timer down
|
||||
CTRL+Y - timer up
|
||||
- [CTRL+#+T] - timer down
|
||||
- [CTRL+#+Y] - timer up
|
||||
|
||||
CTRL+U - timer addition down
|
||||
CTRL+I - timer addition up
|
||||
- [CTRL+#+U] - timer addition down
|
||||
- [CTRL+#+I] - timer addition up
|
||||
|
||||
CTRL+O - cooldown down
|
||||
CTRL+P - cooldown up
|
||||
- [CTRL+#+O] - cooldown down
|
||||
- [CTRL+#+P] - cooldown up
|
||||
|
||||
@param event The Pygame event passed in automatically from pgfw.Delegate
|
||||
"""
|
||||
@ -668,25 +674,40 @@ class NS(Game, Animation):
|
||||
self.configuration.set("network", "diagnostics", not state)
|
||||
self.pop_up(f"Network diagnostics visible: {not state}")
|
||||
|
||||
# Adjust level 4 timing parameters and pop up a message with new value
|
||||
elif event.key in (K_t, K_y, K_u, K_i, K_o, K_p):
|
||||
level = 4
|
||||
if event.key in (K_t, K_y):
|
||||
option = f"timer-start-level-{level}"
|
||||
step = self.get_configuration("time", "adjust-timer-start-step")
|
||||
new = self.get_configuration("time", option) + (-step if event.key == K_t else step)
|
||||
self.configuration.set("time", option, str(new))
|
||||
elif event.key in (K_u, K_i):
|
||||
option = f"timer-addition-level-{level}"
|
||||
step = self.get_configuration("time", "adjust-timer-addition-step")
|
||||
new = self.get_configuration("time", option) + (-step if event.key == K_u else step)
|
||||
self.configuration.set("time", option, str(new))
|
||||
elif event.key in (K_o, K_p):
|
||||
option = f"cooldown-level-{level}"
|
||||
step = self.get_configuration("time", "adjust-cooldown-step")
|
||||
new = self.get_configuration("boss", option) + (-step if event.key == K_o else step)
|
||||
self.configuration.set("boss", option, str(new))
|
||||
self.pop_up(f"{option}: {new}", True)
|
||||
# Check if a level parameter is being edited
|
||||
else:
|
||||
# Check if a level is pressed
|
||||
pressed: list[bool] = pygame.key.get_pressed()
|
||||
level: int | None = None
|
||||
if pressed[K_1]:
|
||||
level = 1
|
||||
elif pressed[K_2]:
|
||||
level = 2
|
||||
elif pressed[K_3]:
|
||||
level = 3
|
||||
elif pressed[K_4]:
|
||||
level = 4
|
||||
elif pressed[K_5]:
|
||||
level = 5
|
||||
|
||||
# Adjust timing parameters and pop up a message with new value
|
||||
if level is not None and event.key in (K_t, K_y, K_u, K_i, K_o, K_p):
|
||||
if event.key in (K_t, K_y):
|
||||
option = f"timer-start-level-{level}"
|
||||
step = self.get_configuration("time", "adjust-timer-start-step")
|
||||
new = self.get_configuration("time", option) + (-step if event.key == K_t else step)
|
||||
self.configuration.set("time", option, str(new))
|
||||
elif event.key in (K_u, K_i):
|
||||
option = f"timer-addition-level-{level}"
|
||||
step = self.get_configuration("time", "adjust-timer-addition-step")
|
||||
new = self.get_configuration("time", option) + (-step if event.key == K_u else step)
|
||||
self.configuration.set("time", option, str(new))
|
||||
elif event.key in (K_o, K_p):
|
||||
option = f"cooldown-level-{level}"
|
||||
step = self.get_configuration("time", "adjust-cooldown-step")
|
||||
new = self.get_configuration("boss", option) + (-step if event.key == K_o else step)
|
||||
self.configuration.set("boss", option, str(new))
|
||||
self.pop_up(f"{option}: {new}", True)
|
||||
|
||||
# Save the time of the key press to limit the amount of presses per second
|
||||
self.last_press = get_ticks()
|
||||
@ -882,7 +903,7 @@ class LevelSelect(Animation):
|
||||
"""
|
||||
# Create new platforms, and center them at the configured locations
|
||||
self.platforms = []
|
||||
for platform_index in range(4):
|
||||
for platform_index in range(5):
|
||||
self.platforms.append(Platform(self, normal_to_pixel_coords(
|
||||
Vector(*self.get_configuration("select", f"platform_{platform_index}_xy")))))
|
||||
|
||||
@ -901,6 +922,7 @@ class LevelSelect(Animation):
|
||||
self.platforms[1].set_glowing((NS.LNW, NS.LSW))
|
||||
self.platforms[2].set_glowing((NS.LNW, NS.LNE))
|
||||
self.platforms[3].set_glowing((NS.LNE, NS.LSE))
|
||||
self.platforms[4].set_glowing((NS.LNE, NS.LSW))
|
||||
|
||||
def init_previews(self):
|
||||
"""
|
||||
@ -951,6 +973,7 @@ class LevelSelect(Animation):
|
||||
platform.activate()
|
||||
platform.view.get_current_frameset().reset()
|
||||
platform.view.play()
|
||||
platform.press_elapsed = 0
|
||||
for preview in self.previews:
|
||||
preview.get_current_frameset().reset()
|
||||
preview.play()
|
||||
@ -983,7 +1006,7 @@ class LevelSelect(Animation):
|
||||
"""
|
||||
level_index = None
|
||||
if pygame.key.get_mods() & pygame.KMOD_CTRL:
|
||||
if event.key in (pygame.K_1, pygame.K_2, pygame.K_3, pygame.K_4):
|
||||
if event.key in (pygame.K_1, pygame.K_2, pygame.K_3, pygame.K_4, pygame.K_5):
|
||||
self.launch(event.key - pygame.K_1)
|
||||
elif event.key == pygame.K_l:
|
||||
level_select_enabled = not self.get_configuration("system", "enable-level-select")
|
||||
@ -3753,6 +3776,8 @@ class Health(Meter):
|
||||
icon_index = 19
|
||||
elif level_index == 3:
|
||||
icon_index = 23
|
||||
elif level_index == 4:
|
||||
icon_index = 24
|
||||
Meter.setup(self, self.background, self.rect, 52, (255, 0, 255), 100, "scrapeIcons/scrapeIcons_%i.png" % icon_index)
|
||||
|
||||
def reset(self):
|
||||
|
11
config
11
config
@ -65,10 +65,12 @@ damage-per-hit-level-1 = 6.0
|
||||
damage-per-hit-level-2 = 2.5
|
||||
damage-per-hit-level-3 = 1.75
|
||||
damage-per-hit-level-4 = 0.277
|
||||
damage-per-hit-level-5 = 2.0
|
||||
cooldown-level-1 = 2500
|
||||
cooldown-level-2 = 2100
|
||||
cooldown-level-3 = 1300
|
||||
cooldown-level-4 = 2500
|
||||
cooldown-level-5 = 2000
|
||||
first-combo-delay = 1300
|
||||
|
||||
[mouse]
|
||||
@ -96,14 +98,17 @@ timer-start-level-1 = 9000
|
||||
timer-start-level-2 = 7000
|
||||
timer-start-level-3 = 6000
|
||||
timer-start-level-4 = 6000
|
||||
timer-start-level-5 = 7000
|
||||
timer-addition-level-1 = 1100
|
||||
timer-addition-level-2 = 700
|
||||
timer-addition-level-3 = 700
|
||||
timer-addition-level-4 = 600
|
||||
timer-addition-level-5 = 700
|
||||
timer-warning-start-1 = 0.4
|
||||
timer-warning-start-2 = 0.4
|
||||
timer-warning-start-3 = 0.4
|
||||
timer-warning-start-4 = 0.3
|
||||
timer-warning-start-5 = 0.4
|
||||
sword-delay = 300
|
||||
attract-gif-length = 10000
|
||||
attract-board-length = 3600
|
||||
@ -122,6 +127,7 @@ level_0 = bgm/level_0.ogg, .65
|
||||
level_1 = bgm/level_1.ogg, .65
|
||||
level_2 = bgm/level_2.ogg, .65
|
||||
level_3 = bgm/level_3.ogg, .65
|
||||
level_4 = bgm/level_4.ogg, .65
|
||||
end = bgm/end.ogg, .65
|
||||
|
||||
[pads]
|
||||
@ -139,13 +145,16 @@ sw_color = #E4B80C
|
||||
center_y = 376
|
||||
|
||||
[select]
|
||||
titles = 1 KOOL,2 ALIEN,3 GOTH,4 METAL
|
||||
titles = 1 KOOL,2 ALIEN,3 GOTH,4 METAL,5 SIMON
|
||||
font_size = 18
|
||||
platform_scale = 0.6
|
||||
platform_0_xy = -0.57, -0.4
|
||||
platform_1_xy = -0.075, 0.0
|
||||
platform_2_xy = 0.45, 0.0
|
||||
platform_3_xy = 0.93, -0.4
|
||||
platform_4_xy = 0.93, 0.4
|
||||
preview_size = 0.22, 0.28
|
||||
preview_margin = 0.05
|
||||
zoom_step = 0.07
|
||||
metal_enabled = True
|
||||
simon_enabled = True
|
||||
|
Loading…
Reference in New Issue
Block a user