EBLAN_ENGINE/tests/integration_engine_checks.inc
Игорь Федосеев 527d92411d chore: integrate main before stage 2
Preserve stage-1 stability fixes alongside v5 lighting, IPC v2, weapons and studio updates. Fix barrel AOE pointer corruption and extend modal gameplay gating.

Verify 137 editor checks, 191 ASM checks, lighting bake and preview parity. Document stage-2 scope without implementing it.
2026-10-31 22:10:07 +03:00

85 lines
3.4 KiB
PHP

; Compatibility of stage-1 fixes with newer weapon/modal/lighting systems.
.code
RunIntegrationChecks PROC
call ResetCombatFixture
mov isGamePaused, 1
mov keyForward, 1
mov playerAttackCooldown, 4
call UpdatePlayer
call UpdateEntities
call UpdateCombat
CHECK playerX, 160 ; pause freezes player movement through production procedure
CHECK [spriteList].SpriteStruct.x, 288 ; pause freezes guard AI through production procedure
CHECK playerAttackCooldown, 4 ; pause freezes weapon cooldowns
CHECK playerAmmo, 50 ; pause preserves ammunition
mov isGamePaused, 0
mov keyForward, 0
call UpdatePlayer
mov gameDialogActive, 1
call UpdateEntities
call UpdateCombat
CHECK [spriteList].SpriteStruct.x, 288 ; modal dialogue freezes guards
CHECK playerAmmo, 50 ; modal dialogue cannot fire
mov gameDialogActive, 0
mov gameMode, GAME_MODE_ADVENTURE
call UpdateCombat
CHECK entityHealth, 100 ; peaceful adventure mode cannot damage targets
call ResetCombatFixture
mov isPlayerDead, 1
mov transitionCount, 1
mov [transitionList].LevelTransition.triggerCellX, 2
mov [transitionList].LevelTransition.triggerCellY, 2
mov [transitionList].LevelTransition.fadeEffect, 1
mov portalLatchCell, -1
call UpdatePlayer
CHECK fadeState, 0 ; dead player cannot activate a room transition
call ResetCombatFixture
mov playerWeapon, WEAPON_KNIFE
call UpdateCombat
CHECK entityHealth, 100 ; knife cannot hit beyond its world range
CHECK playerAmmo, 50 ; knife consumes no ammunition
mov playerAttackCooldown, 0
mov [spriteList].SpriteStruct.x, 208
call UpdateCombat
CHECK entityHealth, 70 ; knife retains its close-range damage after merge
call ResetCombatFixture
mov playerWeapon, WEAPON_SHOTGUN
mov [spriteList].SpriteStruct.y, 184
call UpdateCombat
CHECK entityHealth, 30 ; shotgun retains wider world-space hitbox and damage
CHECK playerAmmo, 48 ; shotgun consumes two rounds
mov eax, [lightSources+14*sizeof LightSource].LightSource.flags
and eax, LIGHT_FLAG_ACTIVE
CHECK eax, 1 ; shotgun spawns muzzle light in reserved slot
call ResetCombatFixture
mov [spriteList].SpriteStruct.textureId, 11
mov [spriteList].SpriteStruct.flags, 06026400h
call InitEntities
call UpdateCombat
CHECK [spriteList].SpriteStruct.textureId, 11 ; explicit Prop with barrel texture cannot explode
mov [spriteList].SpriteStruct.flags, 0
call InitEntities
CHECK entityType, ENTITY_TYPE_BARREL ; legacy barrel archetype matches editor fallback
; Real explosion with a nearby guard: CDQ must not destroy sprite pointer.
call ResetCombatFixture
mov [spriteList].SpriteStruct.textureId, 11
mov [spriteList].SpriteStruct.flags, ENTITY_TYPE_BARREL
mov spriteCount, 2
mov esi, OFFSET spriteList+sizeof SpriteStruct
mov [esi].SpriteStruct.x, 352
mov [esi].SpriteStruct.y, 160
mov [esi].SpriteStruct.textureId, 13
mov [esi].SpriteStruct.scale, FIXED_ONE
mov [esi].SpriteStruct.flags, 0
call InitEntities
call UpdateCombat
CHECK [spriteList].SpriteStruct.textureId, 0 ; explicit barrel still explodes on hitscan
CHECK entityHealth[4], 40 ; blast damages nearby guard without corrupting pointer
mov eax, [lightSources+15*sizeof LightSource].LightSource.flags
and eax, LIGHT_FLAG_ACTIVE
CHECK eax, 1 ; explosion spawns light in reserved slot
ret
RunIntegrationChecks ENDP