crimsonland 0.1.0.dev8__tar.gz → 0.1.0.dev11__tar.gz
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.
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/PKG-INFO +1 -1
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/pyproject.toml +1 -1
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/demo.py +77 -35
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/gameplay.py +7 -5
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/render/world_renderer.py +12 -16
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/assets_fetch.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/atlas.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/audio_router.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/bonuses.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/camera.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/cli.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/creatures/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/creatures/ai.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/creatures/anim.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/creatures/damage.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/creatures/runtime.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/creatures/spawn.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/debug.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/demo_trial.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/effects.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/effects_atlas.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/frontend/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/frontend/assets.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/frontend/boot.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/frontend/menu.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/frontend/panels/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/frontend/panels/base.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/frontend/panels/controls.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/frontend/panels/mods.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/frontend/panels/options.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/frontend/panels/play_game.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/frontend/panels/stats.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/frontend/transitions.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/game.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/game_modes.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/game_world.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/input_codes.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/modes/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/modes/base_gameplay_mode.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/modes/quest_mode.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/modes/rush_mode.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/modes/survival_mode.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/modes/tutorial_mode.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/modes/typo_mode.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/paths.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/perks.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/persistence/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/persistence/highscores.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/persistence/save_status.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/player_damage.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/projectiles.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/quests/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/quests/helpers.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/quests/registry.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/quests/results.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/quests/runtime.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/quests/tier1.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/quests/tier2.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/quests/tier3.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/quests/tier4.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/quests/tier5.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/quests/timeline.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/quests/types.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/render/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/render/terrain_fx.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/sim/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/sim/world_defs.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/sim/world_state.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/terrain_assets.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/tutorial/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/tutorial/timeline.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/typo/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/typo/names.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/typo/player.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/typo/spawns.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/typo/typing.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/ui/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/ui/cursor.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/ui/demo_trial_overlay.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/ui/game_over.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/ui/hud.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/ui/perk_menu.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/aim_debug.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/animations.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/arsenal_debug.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/audio_bootstrap.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/bonuses.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/camera_debug.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/camera_shake.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/corpse_stamp_debug.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/decals_debug.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/empty.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/fonts.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/game_over.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/ground.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/lighting_debug.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/particles.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/perk_menu_debug.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/perks.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/player.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/player_sprite_debug.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/projectile_fx.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/projectile_render_debug.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/projectiles.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/quest_title_overlay.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/registry.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/rush.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/small_font_debug.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/spawn_plan.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/sprites.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/survival.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/terrain.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/ui.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/wicons.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/weapon_sfx.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/weapons.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/app.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/assets.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/audio.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/config.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/console.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/fonts/__init__.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/fonts/grim_mono.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/fonts/small.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/input.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/jaz.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/math.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/music.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/paq.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/rand.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/sfx.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/sfx_map.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/terrain_render.py +0 -0
- {crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/grim/view.py +0 -0
|
@@ -475,6 +475,9 @@ class DemoView:
|
|
|
475
475
|
player = self._world.players[idx]
|
|
476
476
|
player.pos_x = float(x)
|
|
477
477
|
player.pos_y = float(y)
|
|
478
|
+
# Keep aim anchored to the spawn position so demo aim starts stable.
|
|
479
|
+
player.aim_x = float(x)
|
|
480
|
+
player.aim_y = float(y)
|
|
478
481
|
weapon_assign_player(player, int(weapon_id))
|
|
479
482
|
self._demo_targets = [None] * len(self._world.players)
|
|
480
483
|
|
|
@@ -549,7 +552,8 @@ class DemoView:
|
|
|
549
552
|
|
|
550
553
|
def _setup_variant_0(self) -> None:
|
|
551
554
|
self._demo_time_limit_ms = 4000
|
|
552
|
-
weapon_id
|
|
555
|
+
# demo_setup_variant_0 uses weapon_id=0x0B.
|
|
556
|
+
weapon_id = 11
|
|
553
557
|
self._setup_world_players(
|
|
554
558
|
[
|
|
555
559
|
(448.0, 384.0, weapon_id),
|
|
@@ -567,7 +571,8 @@ class DemoView:
|
|
|
567
571
|
|
|
568
572
|
def _setup_variant_1(self) -> None:
|
|
569
573
|
self._demo_time_limit_ms = 5000
|
|
570
|
-
weapon_id
|
|
574
|
+
# demo_setup_variant_1 uses weapon_id=0x05.
|
|
575
|
+
weapon_id = 5
|
|
571
576
|
self._setup_world_players(
|
|
572
577
|
[
|
|
573
578
|
(490.0, 448.0, weapon_id),
|
|
@@ -586,7 +591,8 @@ class DemoView:
|
|
|
586
591
|
|
|
587
592
|
def _setup_variant_2(self) -> None:
|
|
588
593
|
self._demo_time_limit_ms = 5000
|
|
589
|
-
weapon_id
|
|
594
|
+
# demo_setup_variant_2 uses weapon_id=0x15.
|
|
595
|
+
weapon_id = 21
|
|
590
596
|
self._setup_world_players([(512.0, 512.0, weapon_id)])
|
|
591
597
|
y = 128
|
|
592
598
|
i = 0
|
|
@@ -601,7 +607,8 @@ class DemoView:
|
|
|
601
607
|
|
|
602
608
|
def _setup_variant_3(self) -> None:
|
|
603
609
|
self._demo_time_limit_ms = 4000
|
|
604
|
-
weapon_id
|
|
610
|
+
# demo_setup_variant_3 uses weapon_id=0x12.
|
|
611
|
+
weapon_id = 18
|
|
605
612
|
self._setup_world_players([(512.0, 512.0, weapon_id)])
|
|
606
613
|
for idx in range(20):
|
|
607
614
|
x = float(self._crand_mod(200) + 32)
|
|
@@ -881,10 +888,10 @@ class DemoView:
|
|
|
881
888
|
def _update_world(self, dt: float) -> None:
|
|
882
889
|
if not self._world.players:
|
|
883
890
|
return
|
|
884
|
-
inputs = self._build_demo_inputs()
|
|
891
|
+
inputs = self._build_demo_inputs(dt)
|
|
885
892
|
self._world.update(dt, inputs=inputs, auto_pick_perks=False, game_mode=0, perk_progression_enabled=False)
|
|
886
893
|
|
|
887
|
-
def _build_demo_inputs(self) -> list[PlayerInput]:
|
|
894
|
+
def _build_demo_inputs(self, dt: float) -> list[PlayerInput]:
|
|
888
895
|
players = self._world.players
|
|
889
896
|
creatures = self._world.creatures.entries
|
|
890
897
|
if len(self._demo_targets) != len(players):
|
|
@@ -892,42 +899,77 @@ class DemoView:
|
|
|
892
899
|
center_x = float(self._world.world_size) * 0.5
|
|
893
900
|
center_y = float(self._world.world_size) * 0.5
|
|
894
901
|
|
|
902
|
+
dt = float(dt)
|
|
903
|
+
|
|
904
|
+
def _turn_towards_heading(cur: float, target: float) -> tuple[float, float]:
|
|
905
|
+
cur = cur % math.tau
|
|
906
|
+
target = target % math.tau
|
|
907
|
+
delta = (target - cur + math.pi) % math.tau - math.pi
|
|
908
|
+
diff = abs(delta)
|
|
909
|
+
if diff <= 1e-9:
|
|
910
|
+
return cur, 0.0
|
|
911
|
+
step = dt * diff * 5.0
|
|
912
|
+
cur = (cur + step) % math.tau if delta > 0.0 else (cur - step) % math.tau
|
|
913
|
+
return cur, diff
|
|
914
|
+
|
|
895
915
|
inputs: list[PlayerInput] = []
|
|
896
916
|
for idx, player in enumerate(players):
|
|
897
917
|
target_idx = self._select_demo_target(idx, player, creatures)
|
|
898
|
-
aim_x = center_x
|
|
899
|
-
aim_y = center_y
|
|
900
918
|
target = None
|
|
901
919
|
if target_idx is not None and 0 <= target_idx < len(creatures):
|
|
902
920
|
candidate = creatures[target_idx]
|
|
903
|
-
if candidate.hp > 0.0:
|
|
921
|
+
if candidate.active and candidate.hp > 0.0:
|
|
904
922
|
target = candidate
|
|
905
|
-
aim_x = candidate.x
|
|
906
|
-
aim_y = candidate.y
|
|
907
|
-
|
|
908
|
-
move_x, move_y = 0.0, 0.0
|
|
909
|
-
to_cx = center_x - player.pos_x
|
|
910
|
-
to_cy = center_y - player.pos_y
|
|
911
|
-
nx, ny, d = _normalize(to_cx, to_cy)
|
|
912
|
-
if d > 120.0:
|
|
913
|
-
move_x += nx
|
|
914
|
-
move_y += ny
|
|
915
923
|
|
|
924
|
+
# Aim: ease the aim point toward the target.
|
|
925
|
+
aim_x = float(player.aim_x)
|
|
926
|
+
aim_y = float(player.aim_y)
|
|
927
|
+
auto_fire = False
|
|
916
928
|
if target is not None:
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
if
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
929
|
+
aim_dx = float(target.x) - aim_x
|
|
930
|
+
aim_dy = float(target.y) - aim_y
|
|
931
|
+
aim_dir_x, aim_dir_y, aim_dist = _normalize(aim_dx, aim_dy)
|
|
932
|
+
if aim_dist >= 4.0:
|
|
933
|
+
step = aim_dist * 6.0 * dt
|
|
934
|
+
aim_x += aim_dir_x * step
|
|
935
|
+
aim_y += aim_dir_y * step
|
|
936
|
+
else:
|
|
937
|
+
aim_x = float(target.x)
|
|
938
|
+
aim_y = float(target.y)
|
|
939
|
+
auto_fire = aim_dist < 128.0
|
|
940
|
+
else:
|
|
941
|
+
ax, ay, amag = _normalize(float(player.pos_x) - center_x, float(player.pos_y) - center_y)
|
|
942
|
+
if amag <= 1e-6:
|
|
943
|
+
ax, ay = 0.0, -1.0
|
|
944
|
+
aim_x = float(player.pos_x) + ax * 60.0
|
|
945
|
+
aim_y = float(player.pos_y) + ay * 60.0
|
|
946
|
+
|
|
947
|
+
# Movement:
|
|
948
|
+
# - orbit center if no target
|
|
949
|
+
# - chase target when near center
|
|
950
|
+
# - return to center when too far
|
|
951
|
+
if target is None:
|
|
952
|
+
move_dx = -(float(player.pos_y) - center_y)
|
|
953
|
+
move_dy = float(player.pos_x) - center_x
|
|
954
|
+
else:
|
|
955
|
+
center_dist = math.hypot(float(player.pos_x) - center_x, float(player.pos_y) - center_y)
|
|
956
|
+
if center_dist <= 300.0:
|
|
957
|
+
move_dx = float(target.x) - float(player.pos_x)
|
|
958
|
+
move_dy = float(target.y) - float(player.pos_y)
|
|
959
|
+
else:
|
|
960
|
+
move_dx = center_x - float(player.pos_x)
|
|
961
|
+
move_dy = center_y - float(player.pos_y)
|
|
962
|
+
|
|
963
|
+
desired_x, desired_y, desired_mag = _normalize(move_dx, move_dy)
|
|
964
|
+
if desired_mag <= 1e-6:
|
|
965
|
+
move_x = 0.0
|
|
966
|
+
move_y = 0.0
|
|
967
|
+
else:
|
|
968
|
+
desired_heading = math.atan2(desired_y, desired_x) + math.pi / 2.0
|
|
969
|
+
smoothed_heading, angle_diff = _turn_towards_heading(float(player.heading), desired_heading)
|
|
970
|
+
move_mag = max(0.001, (math.pi - angle_diff) / math.pi)
|
|
971
|
+
move_x = math.cos(smoothed_heading - math.pi / 2.0) * move_mag
|
|
972
|
+
move_y = math.sin(smoothed_heading - math.pi / 2.0) * move_mag
|
|
931
973
|
|
|
932
974
|
inputs.append(
|
|
933
975
|
PlayerInput(
|
|
@@ -935,8 +977,8 @@ class DemoView:
|
|
|
935
977
|
move_y=move_y,
|
|
936
978
|
aim_x=aim_x,
|
|
937
979
|
aim_y=aim_y,
|
|
938
|
-
fire_down=
|
|
939
|
-
fire_pressed=
|
|
980
|
+
fire_down=auto_fire,
|
|
981
|
+
fire_pressed=auto_fire,
|
|
940
982
|
reload_pressed=False,
|
|
941
983
|
)
|
|
942
984
|
)
|
|
@@ -472,7 +472,7 @@ class BonusPool:
|
|
|
472
472
|
player,
|
|
473
473
|
BonusId(entry.bonus_id),
|
|
474
474
|
amount=entry.amount,
|
|
475
|
-
origin=
|
|
475
|
+
origin=entry,
|
|
476
476
|
creatures=creatures,
|
|
477
477
|
players=players,
|
|
478
478
|
apply_creature_damage=apply_creature_damage,
|
|
@@ -974,8 +974,8 @@ def perk_apply(
|
|
|
974
974
|
weapon_id = int(current)
|
|
975
975
|
for _ in range(100):
|
|
976
976
|
candidate = int(weapon_pick_random_available(state))
|
|
977
|
-
|
|
978
|
-
|
|
977
|
+
weapon_id = candidate
|
|
978
|
+
if candidate != int(WeaponId.PISTOL) and candidate != current:
|
|
979
979
|
break
|
|
980
980
|
weapon_assign_player(owner, weapon_id, state=state)
|
|
981
981
|
return
|
|
@@ -1929,7 +1929,9 @@ def player_update(player: PlayerState, input_state: PlayerInput, dt: float, stat
|
|
|
1929
1929
|
raw_move_x = float(input_state.move_x)
|
|
1930
1930
|
raw_move_y = float(input_state.move_y)
|
|
1931
1931
|
raw_mag = math.hypot(raw_move_x, raw_move_y)
|
|
1932
|
-
|
|
1932
|
+
# Demo/autoplay uses very small analog magnitudes to represent turn-in-place and
|
|
1933
|
+
# heading alignment slowdown; don't apply a deadzone there.
|
|
1934
|
+
moving_input = raw_mag > (0.0 if state.demo_mode_active else 0.2)
|
|
1933
1935
|
|
|
1934
1936
|
if moving_input:
|
|
1935
1937
|
inv = 1.0 / raw_mag if raw_mag > 1e-9 else 0.0
|
|
@@ -2456,7 +2458,7 @@ def bonus_telekinetic_update(
|
|
|
2456
2458
|
player,
|
|
2457
2459
|
BonusId(int(entry.bonus_id)),
|
|
2458
2460
|
amount=int(entry.amount),
|
|
2459
|
-
origin=
|
|
2461
|
+
origin=entry,
|
|
2460
2462
|
creatures=creatures,
|
|
2461
2463
|
players=players,
|
|
2462
2464
|
apply_creature_damage=apply_creature_damage,
|
|
@@ -939,24 +939,20 @@ class WorldRenderer:
|
|
|
939
939
|
# Native: chain reach is derived from the streak scale (`fVar29 * perk_scale * 40.0`).
|
|
940
940
|
radius = effect_scale * perk_scale * 40.0
|
|
941
941
|
|
|
942
|
-
#
|
|
943
|
-
|
|
944
|
-
for creature in self.creatures.entries:
|
|
945
|
-
if not creature.active
|
|
942
|
+
# Native iterates via creature_find_in_radius(pos, radius, start_index) in pool order.
|
|
943
|
+
targets: list[object] = []
|
|
944
|
+
for creature in self.creatures.entries[1:]:
|
|
945
|
+
if not creature.active:
|
|
946
946
|
continue
|
|
947
|
-
if float(getattr(creature, "hitbox_size", 0.0))
|
|
947
|
+
if float(getattr(creature, "hitbox_size", 0.0)) <= 5.0:
|
|
948
948
|
continue
|
|
949
949
|
d = math.hypot(float(creature.x) - pos_x, float(creature.y) - pos_y)
|
|
950
950
|
threshold = float(creature.size) * 0.142857149 + 3.0
|
|
951
|
-
if d
|
|
952
|
-
|
|
953
|
-
candidates.append((d, creature))
|
|
954
|
-
|
|
955
|
-
candidates.sort(key=lambda item: item[0])
|
|
956
|
-
targets = [creature for _d, creature in candidates[:8]]
|
|
951
|
+
if d - radius < threshold:
|
|
952
|
+
targets.append(creature)
|
|
957
953
|
|
|
958
|
-
|
|
959
|
-
|
|
954
|
+
inner_half = 10.0 * perk_scale * scale
|
|
955
|
+
outer_half = 14.0 * perk_scale * scale
|
|
960
956
|
u = 0.625
|
|
961
957
|
v0 = 0.0
|
|
962
958
|
v1 = 0.25
|
|
@@ -980,7 +976,7 @@ class WorldRenderer:
|
|
|
980
976
|
py = nx
|
|
981
977
|
|
|
982
978
|
# Outer strip (softer).
|
|
983
|
-
half =
|
|
979
|
+
half = outer_half
|
|
984
980
|
off_x = px * half
|
|
985
981
|
off_y = py * half
|
|
986
982
|
x0 = sx - off_x
|
|
@@ -992,7 +988,7 @@ class WorldRenderer:
|
|
|
992
988
|
x3 = tx - off_x
|
|
993
989
|
y3 = ty - off_y
|
|
994
990
|
|
|
995
|
-
outer_tint = self._color_from_rgba((0.5, 0.6, 1.0, base_alpha
|
|
991
|
+
outer_tint = self._color_from_rgba((0.5, 0.6, 1.0, base_alpha))
|
|
996
992
|
rl.rl_color4ub(outer_tint.r, outer_tint.g, outer_tint.b, outer_tint.a)
|
|
997
993
|
rl.rl_tex_coord2f(u, v0)
|
|
998
994
|
rl.rl_vertex2f(x0, y0)
|
|
@@ -1004,7 +1000,7 @@ class WorldRenderer:
|
|
|
1004
1000
|
rl.rl_vertex2f(x3, y3)
|
|
1005
1001
|
|
|
1006
1002
|
# Inner strip (brighter).
|
|
1007
|
-
half =
|
|
1003
|
+
half = inner_half
|
|
1008
1004
|
off_x = px * half
|
|
1009
1005
|
off_y = py * half
|
|
1010
1006
|
x0 = sx - off_x
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{crimsonland-0.1.0.dev8 → crimsonland-0.1.0.dev11}/src/crimson/views/projectile_render_debug.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|