Adapt for web, make CharacterState class

This commit is contained in:
Vladislav Khorev committed 2026-06-18 20:02:59 +03:00
1 parent c891161d69
commit 0eb9d0be25
88 files changed
+810 -102277

No files matched your search

+36 -5
View File
@@ -661,15 +661,25 @@ game_api.set_darklands_callbacks(
print(pz)
if (pz > 8.0) then
if (pz > 8.2) then
game_api.activate_interactive_object("Room_Cover_Corridor_001")
game_api.deactivate_interactive_object("Room_Cover_Main_Hall_001")
morning_can_open_door_index = 6
elseif (pz <= 8.0) and (pz > 0) and (px >= 1.5 + 0.1) then
elseif (pz <= 8.2) and (pz > 7.8) then
--Corridor near the hall
if (teacher_door_opened) then
game_api.deactivate_interactive_object("Room_Cover_South_3_001")
end
morning_can_open_door_index = 0
game_api.player_set_position(px, 0, 7.7)
elseif (pz <= 7.8) and (pz > 0) and (px >= 1.5 + 0.1) then
game_api.activate_interactive_object("Room_Cover_Corridor_001")
game_api.deactivate_interactive_object("Room_Cover_North_3_001")
morning_can_open_door_index = 5
elseif (pz <= 8.0) and (pz > 0) and (px <= -1.5 - 0.1) then
elseif (pz <= 7.8) and (pz > 0) and (px <= -1.5 - 0.1) then
if (teacher_door_opened) then
game_api.deactivate_interactive_object("Room_Cover_Corridor_001")
else
@@ -699,14 +709,14 @@ game_api.set_darklands_callbacks(
-- stick to 1.4
print("Edge case with px = ")
print (px)
game_api.player_set_position(1.35, 0, pz)
game_api.player_set_position(1.3, 0, pz)
end
if (px <=-1.4) and (px > -1.6) then
-- stick to -1.48
print("Edge case2 with px = ")
print (px)
game_api.player_set_position(-1.35, 0, pz)
game_api.player_set_position(-1.3, 0, pz)
end
end
@@ -974,6 +984,27 @@ game_api.set_enter_night_callback(
game_api.start_dialogue("dialog_video001")
setDay1NightSetup()
game_api.switch_navigation(16)
-- Fix player's position if the door is spawned near him:
if (pz <= 8.2) and (pz > 7.8) then
--Corridor near the hall
game_api.player_set_position(px, 0, 7.7)
elseif (pz <= 7.8) and (px>=-1.6) and (px<=1.6) then
--Player in doors, he should stick to the corridor
if (px >=1.4) and (px < 1.6) then
game_api.player_set_position(1.3, 0, pz)
end
if (px <=-1.4) and (px > -1.6) then
game_api.player_set_position(-1.3, 0, pz)
end
end
---------------
end
)