zombie-escape 1.13.1__py3-none-any.whl → 1.14.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. zombie_escape/__about__.py +1 -1
  2. zombie_escape/colors.py +7 -21
  3. zombie_escape/entities.py +100 -191
  4. zombie_escape/export_images.py +39 -33
  5. zombie_escape/gameplay/ambient.py +2 -6
  6. zombie_escape/gameplay/footprints.py +8 -11
  7. zombie_escape/gameplay/interactions.py +17 -58
  8. zombie_escape/gameplay/layout.py +20 -46
  9. zombie_escape/gameplay/movement.py +7 -21
  10. zombie_escape/gameplay/spawn.py +12 -40
  11. zombie_escape/gameplay/state.py +1 -0
  12. zombie_escape/gameplay/survivors.py +5 -16
  13. zombie_escape/gameplay/utils.py +4 -13
  14. zombie_escape/input_utils.py +8 -31
  15. zombie_escape/level_blueprints.py +112 -69
  16. zombie_escape/level_constants.py +8 -0
  17. zombie_escape/locales/ui.en.json +12 -0
  18. zombie_escape/locales/ui.ja.json +12 -0
  19. zombie_escape/localization.py +3 -11
  20. zombie_escape/models.py +26 -9
  21. zombie_escape/render/__init__.py +30 -0
  22. zombie_escape/render/core.py +992 -0
  23. zombie_escape/render/hud.py +444 -0
  24. zombie_escape/render/overview.py +218 -0
  25. zombie_escape/render/shadows.py +343 -0
  26. zombie_escape/render_assets.py +11 -33
  27. zombie_escape/rng.py +4 -8
  28. zombie_escape/screens/__init__.py +14 -30
  29. zombie_escape/screens/game_over.py +43 -15
  30. zombie_escape/screens/gameplay.py +41 -104
  31. zombie_escape/screens/settings.py +19 -104
  32. zombie_escape/screens/title.py +36 -176
  33. zombie_escape/stage_constants.py +192 -67
  34. zombie_escape/zombie_escape.py +1 -1
  35. {zombie_escape-1.13.1.dist-info → zombie_escape-1.14.4.dist-info}/METADATA +100 -39
  36. zombie_escape-1.14.4.dist-info/RECORD +53 -0
  37. zombie_escape/render.py +0 -1746
  38. zombie_escape-1.13.1.dist-info/RECORD +0 -49
  39. {zombie_escape-1.13.1.dist-info → zombie_escape-1.14.4.dist-info}/WHEEL +0 -0
  40. {zombie_escape-1.13.1.dist-info → zombie_escape-1.14.4.dist-info}/entry_points.txt +0 -0
  41. {zombie_escape-1.13.1.dist-info → zombie_escape-1.14.4.dist-info}/licenses/LICENSE.txt +0 -0
@@ -133,6 +133,18 @@
133
133
  "stage16": {
134
134
  "name": "#16 Floor Collapse",
135
135
  "description": "Circumnavigate the collapsed floor panels and lure the zombies into the abyss."
136
+ },
137
+ "stage17": {
138
+ "name": "#17 Harder to Trap",
139
+ "description": "Zombies track your trail and are harder to lure into pitfalls."
140
+ },
141
+ "stage18": {
142
+ "name": "#18 Mold Factory",
143
+ "description": "Don’t get cornered at the edges."
144
+ },
145
+ "stage19": {
146
+ "name": "#19 Corridors",
147
+ "description": "A floor of narrow corridors."
136
148
  }
137
149
  },
138
150
  "status": {
@@ -133,6 +133,18 @@
133
133
  "stage16": {
134
134
  "name": "#16 奈落",
135
135
  "description": "崩落した床パネルを回り込んでゾンビを誘い込もう。"
136
+ },
137
+ "stage17": {
138
+ "name": "#17 落ちにくいゾンビ",
139
+ "description": "足跡を追うゾンビが現れる。落とし穴にはかかりにくい。"
140
+ },
141
+ "stage18": {
142
+ "name": "#18 金型工場",
143
+ "description": "フチに追い詰められるな。"
144
+ },
145
+ "stage19": {
146
+ "name": "#19 回廊",
147
+ "description": "細い通路が連なるフロア。"
136
148
  }
137
149
  },
138
150
  "status": {
@@ -117,9 +117,7 @@ def translate_list(key: str) -> list[Any]:
117
117
 
118
118
  def get_font_settings(*, name: str = "primary") -> FontSettings:
119
119
  _get_language_options() # ensure locale data is loaded
120
- locale_data = _LOCALE_DATA.get(_CURRENT_LANGUAGE) or _LOCALE_DATA.get(
121
- DEFAULT_LANGUAGE, {}
122
- )
120
+ locale_data = _LOCALE_DATA.get(_CURRENT_LANGUAGE) or _LOCALE_DATA.get(DEFAULT_LANGUAGE, {})
123
121
  fonts = locale_data.get("fonts", {}) if isinstance(locale_data, dict) else {}
124
122
  data = fonts.get(name, {}) if isinstance(fonts, dict) else {}
125
123
  resource = data.get("resource") or DEFAULT_FONT_RESOURCE
@@ -136,9 +134,7 @@ def _qualify_key(key: str) -> str:
136
134
 
137
135
 
138
136
  def _lookup_locale_value(key: str) -> Any:
139
- locale_data = _LOCALE_DATA.get(_CURRENT_LANGUAGE) or _LOCALE_DATA.get(
140
- DEFAULT_LANGUAGE, {}
141
- )
137
+ locale_data = _LOCALE_DATA.get(_CURRENT_LANGUAGE) or _LOCALE_DATA.get(DEFAULT_LANGUAGE, {})
142
138
  if not isinstance(locale_data, dict):
143
139
  return None
144
140
  qualified = _qualify_key(key)
@@ -184,11 +180,7 @@ def _get_language_options() -> tuple[LanguageOption, ...]:
184
180
  data = {}
185
181
  locale_data = data.get(code, {}) if isinstance(data, dict) else {}
186
182
  _LOCALE_DATA[code] = locale_data if isinstance(locale_data, dict) else {}
187
- lang_name = (
188
- locale_data.get("meta", {}).get("language_name")
189
- if isinstance(locale_data, dict)
190
- else None
191
- )
183
+ lang_name = locale_data.get("meta", {}).get("language_name") if isinstance(locale_data, dict) else None
192
184
  options.append(LanguageOption(code=code, name=lang_name or code))
193
185
 
194
186
  if not options:
zombie_escape/models.py CHANGED
@@ -66,8 +66,9 @@ class DustRing:
66
66
  class Footprint:
67
67
  """Tracked player footprint."""
68
68
 
69
- pos: tuple[float, float]
69
+ pos: tuple[int, int]
70
70
  time: int
71
+ visible: bool = True
71
72
 
72
73
 
73
74
  @dataclass
@@ -81,7 +82,8 @@ class ProgressState:
81
82
  scaled_overview: surface.Surface | None
82
83
  overview_created: bool
83
84
  footprints: list[Footprint]
84
- last_footprint_pos: tuple[float, float] | None
85
+ last_footprint_pos: tuple[int, int] | None
86
+ footprint_visible_toggle: bool
85
87
  elapsed_play_ms: int
86
88
  has_fuel: bool
87
89
  flashlight_count: int
@@ -147,37 +149,52 @@ class GameData:
147
149
 
148
150
  @dataclass(frozen=True)
149
151
  class Stage:
152
+ # Id, name, description
150
153
  id: str
151
154
  name_key: str
152
155
  description_key: str
153
156
  available: bool = True
157
+
158
+ # Map layout
154
159
  tile_size: int = 50
155
160
  grid_cols: int = DEFAULT_GRID_COLS
156
161
  grid_rows: int = DEFAULT_GRID_ROWS
162
+ wall_algorithm: str = "default"
163
+ wall_rubble_ratio: float = 0.0
164
+ fall_spawn_zones: list[tuple[int, int, int, int]] = field(default_factory=list)
165
+ fall_spawn_floor_ratio: float = 0.0
166
+ pitfall_density: float = 0.0
167
+ pitfall_zones: list[tuple[int, int, int, int]] = field(default_factory=list)
168
+
169
+ # Stage objective
157
170
  requires_fuel: bool = False
158
171
  buddy_required_count: int = 0
159
172
  rescue_stage: bool = False
160
173
  endurance_stage: bool = False
161
174
  endurance_goal_ms: int = 0
175
+
176
+ # Items
162
177
  fuel_spawn_count: int = 1
163
178
  initial_flashlight_count: int = DEFAULT_FLASHLIGHT_SPAWN_COUNT
164
179
  initial_shoes_count: int = DEFAULT_SHOES_SPAWN_COUNT
165
- survivor_spawn_rate: float = SURVIVOR_SPAWN_RATE
180
+ waiting_car_target_count: int = 1
181
+
182
+ # Zombie spawning/aging
183
+ # - initial_interior_spawn_rate: fraction of interior floor tiles to seed.
184
+ # - spawn weights: pick area by weight (normalized).
185
+ # - zombie ratios: pick variant by weight (normalized).
166
186
  spawn_interval_ms: int = ZOMBIE_SPAWN_DELAY_MS
167
187
  initial_interior_spawn_rate: float = 0.015
168
188
  exterior_spawn_weight: float = 1.0
169
189
  interior_spawn_weight: float = 0.0
170
190
  interior_fall_spawn_weight: float = 0.0
171
- fall_spawn_zones: list[tuple[int, int, int, int]] = field(default_factory=list)
172
- fall_spawn_floor_ratio: float = 0.0
173
- pitfall_density: float = 0.0
174
191
  zombie_tracker_ratio: float = 0.0
175
192
  zombie_wall_hugging_ratio: float = 0.0
176
193
  zombie_normal_ratio: float = 1.0
177
194
  zombie_aging_duration_frames: int = ZOMBIE_AGING_DURATION_FRAMES
178
- waiting_car_target_count: int = 1
179
- wall_algorithm: str = "default"
180
- wall_rubble_ratio: float = 0.0
195
+
196
+ # Survivor spawning
197
+ survivor_spawn_rate: float = SURVIVOR_SPAWN_RATE
181
198
 
182
199
  @property
183
200
  def name(self) -> str:
@@ -0,0 +1,30 @@
1
+ from __future__ import annotations
2
+
3
+ from ..render_assets import RenderAssets
4
+ from .core import (
5
+ blit_wrapped_text,
6
+ draw,
7
+ draw_pause_overlay,
8
+ prewarm_fog_overlays,
9
+ show_message,
10
+ show_message_wrapped,
11
+ wrap_text,
12
+ )
13
+ from .hud import _draw_status_bar, _get_fog_scale
14
+ from .overview import compute_floor_cells, draw_debug_overview, draw_level_overview
15
+
16
+ __all__ = [
17
+ "RenderAssets",
18
+ "blit_wrapped_text",
19
+ "compute_floor_cells",
20
+ "draw",
21
+ "draw_debug_overview",
22
+ "draw_level_overview",
23
+ "draw_pause_overlay",
24
+ "prewarm_fog_overlays",
25
+ "show_message",
26
+ "show_message_wrapped",
27
+ "wrap_text",
28
+ "_draw_status_bar",
29
+ "_get_fog_scale",
30
+ ]