Fixing dialogues and cutscenes, minor bug fixing
This commit is contained in:
1 parent
2b32fce5e0
commit
fff5a9d4aa
18 files changed
+4010
-2208
No files matched your search
+177
-105
@@ -1,6 +1,6 @@
|
||||
hall_door_opened = false
|
||||
teacher_door_opened = false
|
||||
lection_is_over = false
|
||||
--lection_is_over = false
|
||||
|
||||
player_hold_book = false
|
||||
player_hold_knife = false
|
||||
@@ -35,13 +35,25 @@ function dialog_aiperi_give_key()
|
||||
game_api.quest_unlock("aiperi_knife")
|
||||
game_api.quest_set_objective_completed("aiperi_knife", "aiperi_knife_keys")
|
||||
player_hold_key = true
|
||||
|
||||
print("dialog_aiperi_give_key, player_hold_key set to")
|
||||
print(player_hold_key)
|
||||
|
||||
local aiperi_chat_opened = game_api.getIntValue("aiperi_chat_opened")
|
||||
|
||||
if (aiperi_chat_opened == 0) then
|
||||
game_api.set_chat_unread(0, false, "(пусто)")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function lection_hall_zone001_enter_callback()
|
||||
--game_api.start_dialogue("")
|
||||
--Start cutscene
|
||||
if (lection_is_over == false) then
|
||||
local lection_is_over = game_api.getIntValue("lection_is_over")
|
||||
|
||||
|
||||
if (lection_is_over == 0) then
|
||||
game_api.player_stop()
|
||||
game_api.start_cutscene("lection_cutscene001")
|
||||
game_api.quest_set_objective_completed("study_beginning", "study_beginning_lecture")
|
||||
@@ -59,7 +71,8 @@ function knife_dialog_zone001_enter_callback()
|
||||
|
||||
if (day == 0) then
|
||||
if (player_hold_knife == false) then
|
||||
if lection_is_over then
|
||||
local lection_is_over = game_api.getIntValue("lection_is_over")
|
||||
if lection_is_over == 1 then
|
||||
if (player_hold_key) then
|
||||
game_api.start_dialogue("knife_dialog002")
|
||||
else
|
||||
@@ -69,7 +82,10 @@ function knife_dialog_zone001_enter_callback()
|
||||
end
|
||||
else
|
||||
if (game_api.is_night() == false) then
|
||||
game_api.start_dialogue("knife_dialog_second001")
|
||||
local aiperi_talked_after_knife = game_api.getIntValue("aiperi_talked_after_knife")
|
||||
if (aiperi_talked_after_knife == 0) then
|
||||
game_api.start_dialogue("knife_dialog_second001")
|
||||
end
|
||||
game_api.set_trigger_zone_enabled(1, false)
|
||||
end
|
||||
end
|
||||
@@ -81,7 +97,8 @@ function knife_dialog_zone001_exit_callback()
|
||||
|
||||
if (day == 0) then
|
||||
print("knife_dialog_zone001_exit_callback--!")
|
||||
if (lection_is_over) then
|
||||
local lection_is_over = game_api.getIntValue("lection_is_over")
|
||||
if (lection_is_over == 1) then
|
||||
if (teacher_door_opened) then
|
||||
game_api.switch_navigation(3)
|
||||
else
|
||||
@@ -137,17 +154,6 @@ function on_book_pickup()
|
||||
end
|
||||
|
||||
function on_bookshelf_clicked()
|
||||
--[[if not player_hold_book then
|
||||
game_api.pickup_item("book")
|
||||
game_api.deactivate_interactive_object("Book001")
|
||||
player_hold_book = true
|
||||
game_api.set_trigger_zone_enabled(3, true)
|
||||
else
|
||||
game_api.remove_item("book")
|
||||
game_api.activate_interactive_object("Book001")
|
||||
player_hold_book = false
|
||||
game_api.set_trigger_zone_enabled(3, false)
|
||||
end]]
|
||||
on_book_pickup()
|
||||
end
|
||||
|
||||
@@ -157,6 +163,16 @@ function on_npc_interact(npc_index)
|
||||
if npc_index == 1 then
|
||||
local day = game_api.getIntValue("day")
|
||||
|
||||
if (game_api.is_dawn()) or (day > 0) then
|
||||
game_api.start_dialogue("dialog_aiperi_morning001")
|
||||
else
|
||||
if (player_hold_key) then
|
||||
game_api.start_dialogue("knife_dialog002")
|
||||
else
|
||||
game_api.start_dialogue("knife_dialog001")
|
||||
end
|
||||
end
|
||||
--[[
|
||||
if (day == 0) then
|
||||
if (player_hold_key) then
|
||||
game_api.start_dialogue("knife_dialog002")
|
||||
@@ -165,7 +181,7 @@ function on_npc_interact(npc_index)
|
||||
end
|
||||
else
|
||||
game_api.start_dialogue("dialog_aiperi_morning001")
|
||||
end
|
||||
end]]
|
||||
end
|
||||
if npc_index == 0 then
|
||||
if (player_ghost_aware == 1) then
|
||||
@@ -210,13 +226,6 @@ function on_quest_over()
|
||||
game_api.start_cutscene("game_complete_cutscene001")
|
||||
end
|
||||
|
||||
--[[
|
||||
function on_first_ghost_dialog_over()
|
||||
print("on_first_ghost_dialog_over")
|
||||
player_ghost_aware = true
|
||||
game_api.quest_unlock("ghost_lore")
|
||||
end]]
|
||||
|
||||
function on_darklands_over()
|
||||
game_api.set_player_hp(10)
|
||||
game_api.resetPlayerAfterDeath()
|
||||
@@ -232,12 +241,15 @@ end
|
||||
function on_library_door_click()
|
||||
print("on_library_door_click---")
|
||||
local day = game_api.getIntValue("day")
|
||||
local lection_is_over = game_api.getIntValue("lection_is_over")
|
||||
|
||||
if (day == 0) then
|
||||
if (game_api.is_night()) then
|
||||
if game_api.is_dawn() then
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
elseif game_api.is_night() then
|
||||
game_api.start_dialogue("door_night_dialog001")
|
||||
else
|
||||
if (not lection_is_over) then
|
||||
if (lection_is_over == 0) then
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
end
|
||||
end
|
||||
@@ -404,25 +416,6 @@ function on_s1_door_click()
|
||||
else
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
end
|
||||
--[[
|
||||
if (morning_can_open_door_index == 1) then
|
||||
if (morning_did_open_door_index == 0) then
|
||||
morning_did_open_door_index = 1
|
||||
game_api.start_dialogue("door_unlock_dialog001")
|
||||
|
||||
game_api.rotate_object("Room_S_0_Leaf001", 90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Corridor_001")
|
||||
end)
|
||||
game_api.switch_navigation(8)
|
||||
end
|
||||
else
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
end
|
||||
]]
|
||||
--else
|
||||
-- game_api.start_dialogue("door_dialog001")
|
||||
--end
|
||||
end
|
||||
|
||||
function on_s2_door_click()
|
||||
@@ -435,28 +428,9 @@ function on_s2_door_click()
|
||||
else
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
end
|
||||
|
||||
--[[
|
||||
if (morning_can_open_door_index == 2) then
|
||||
if (morning_did_open_door_index == 0) then
|
||||
morning_did_open_door_index = 2
|
||||
game_api.start_dialogue("door_unlock_dialog001")
|
||||
|
||||
game_api.rotate_object("Room_S_1_Leaf001", 90, 0.5, nil)
|
||||
game_api.fade_object("Room_Cover_Corridor_001", 0, 0.5, function()
|
||||
game_api.deactivate_interactive_object("Room_Cover_Corridor_001")
|
||||
end)
|
||||
game_api.switch_navigation(9)
|
||||
end
|
||||
else
|
||||
game_api.start_dialogue("door_dialog001")
|
||||
end
|
||||
]]
|
||||
end
|
||||
|
||||
function on_n2_door_click()
|
||||
--print("player_left_darklands")
|
||||
--print(player_left_darklands)
|
||||
print("morning_can_open_door_index")
|
||||
print(morning_can_open_door_index)
|
||||
print("morning_did_open_door_index")
|
||||
@@ -505,33 +479,33 @@ end
|
||||
function on_computer_clicked()
|
||||
print("on_computer_clicked--")
|
||||
local day = game_api.getIntValue("day")
|
||||
|
||||
|
||||
if game_api.is_darklands() then
|
||||
game_api.start_dialogue("computer_dialog004")
|
||||
game_api.start_dialogue("computer_dialog004")
|
||||
elseif (day >= 1) or game_api.is_dawn() then
|
||||
print("on_computer_clicked--1")
|
||||
game_api.start_dialogue("computer_dialog003")
|
||||
else
|
||||
if teacher_told_about_book then
|
||||
print("on_computer_clicked--2")
|
||||
if (game_api.is_night() == false) then
|
||||
print("on_computer_clicked--3")
|
||||
if (player_hold_book) then
|
||||
print("on_computer_clicked--4")
|
||||
game_api.quest_set_objective_completed("study_project", "study_project_write")
|
||||
game_api.start_cutscene("computer_cutscene001")
|
||||
else
|
||||
print("on_computer_clicked--5")
|
||||
game_api.start_dialogue("book_dialog002")
|
||||
end
|
||||
if teacher_told_about_book then
|
||||
print("on_computer_clicked--2")
|
||||
if (game_api.is_night() == false) then
|
||||
print("on_computer_clicked--3")
|
||||
if (player_hold_book) then
|
||||
print("on_computer_clicked--4")
|
||||
game_api.quest_set_objective_completed("study_project", "study_project_write")
|
||||
game_api.start_cutscene("computer_cutscene001")
|
||||
else
|
||||
print("on_computer_clicked--6")
|
||||
game_api.start_dialogue("computer_dialog002")
|
||||
print("on_computer_clicked--5")
|
||||
game_api.start_dialogue("book_dialog002")
|
||||
end
|
||||
else
|
||||
print("on_computer_clicked--7")
|
||||
game_api.start_dialogue("computer_dialog001")
|
||||
print("on_computer_clicked--6")
|
||||
game_api.start_dialogue("computer_dialog002")
|
||||
end
|
||||
else
|
||||
print("on_computer_clicked--7")
|
||||
game_api.start_dialogue("computer_dialog001")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -558,7 +532,6 @@ function on_sleep_cutscene()
|
||||
game_api.set_object_alpha("Room_Cover_North_1_001", 1)
|
||||
game_api.set_object_alpha("Room_Cover_Main_Hall_001", 1)
|
||||
game_api.activate_interactive_object("Note001")
|
||||
|
||||
teacher_door_opened = false
|
||||
end
|
||||
|
||||
@@ -574,9 +547,16 @@ end
|
||||
|
||||
game_api.set_cutscene_callback("lection_cutscene001", function()
|
||||
print("Cutscene done!")
|
||||
lection_is_over = true
|
||||
game_api.setIntValue("lection_is_over", 1)
|
||||
|
||||
game_api.set_npc_enabled(1, true)
|
||||
game_api.npc_walk_to(0, 0.758123, 0, 6.50063, on_teacher_arrived_intermediate)
|
||||
|
||||
local aiperi_knife_aware = game_api.getIntValue("aiperi_knife_aware")
|
||||
|
||||
if (aiperi_knife_aware == 0) then
|
||||
game_api.set_chat_unread(0, true, "Бекзат, ты где? Я жду...")
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
@@ -590,7 +570,7 @@ function on_report_card_pickup()
|
||||
local player_ghost_aware = game_api.getIntValue("ghost_aware")
|
||||
if player_ghost_aware == 1 then
|
||||
local player_has_report_card = game_api.getIntValue("player_has_report_card")
|
||||
local report_card_signed = game_api.getIntValue("report_card_signed")
|
||||
--local report_card_signed = game_api.getIntValue("report_card_signed")
|
||||
|
||||
if (player_has_report_card == 1) then
|
||||
game_api.start_dialogue("dialog_report_card003") -- Еще рано возвращать зачетку обратно в шкаф
|
||||
@@ -612,8 +592,6 @@ end
|
||||
|
||||
first_time_darklands = true
|
||||
|
||||
|
||||
|
||||
game_api.set_darklands_callbacks(
|
||||
function()
|
||||
if (first_time_darklands) then
|
||||
@@ -706,12 +684,12 @@ game_api.set_darklands_callbacks(
|
||||
|
||||
if (morning_can_open_door_index == 0) or (morning_can_open_door_index == 3) then
|
||||
game_api.setIntValue("morning_player_can_leave", 1)
|
||||
game_api.getIntValue("morning_aiperi_save_again", 0)
|
||||
game_api.setIntValue("morning_aiperi_save_again", 0)
|
||||
else
|
||||
game_api.setIntValue("morning_player_can_leave", 0)
|
||||
local morning_aiperi_talked = game_api.getIntValue("morning_aiperi_talked")
|
||||
if (morning_aiperi_talked == 1) then
|
||||
game_api.getIntValue("morning_aiperi_save_again", 1)
|
||||
game_api.setIntValue("morning_aiperi_save_again", 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -883,7 +861,6 @@ function setDay1MorningSetup()
|
||||
end
|
||||
|
||||
function setDay1NightSetup()
|
||||
|
||||
teacher_door_opened = false
|
||||
|
||||
print("setDay1NightSetup")
|
||||
@@ -971,7 +948,7 @@ game_api.set_enter_night_callback(
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
--[[
|
||||
game_api.set_chat_callbacks(
|
||||
function()
|
||||
if (game_api.is_night()) then
|
||||
@@ -992,10 +969,107 @@ game_api.set_chat_callbacks(
|
||||
nil,
|
||||
nil
|
||||
)
|
||||
]]
|
||||
|
||||
|
||||
game_api.set_chat_callbacks(
|
||||
function()
|
||||
if (game_api.is_night()) then
|
||||
if (game_api.is_dawn()) then
|
||||
local morning_player_can_leave = game_api.getIntValue("morning_player_can_leave")
|
||||
|
||||
if morning_player_can_leave == 0 then
|
||||
game_api.start_dialogue("phone_morning_aiperi001")
|
||||
else
|
||||
game_api.start_dialogue("cancel_phone_morning_aiperi001")
|
||||
end
|
||||
else
|
||||
local day = game_api.getIntValue("day")
|
||||
local asked_help_locked = game_api.getIntValue("asked_help_locked")
|
||||
|
||||
if (day == 0) then
|
||||
if (asked_help_locked == 0) then
|
||||
game_api.start_dialogue("phone_night_aiperi001")
|
||||
end
|
||||
else
|
||||
game_api.start_dialogue("cancel_phone_night_aiperi001")
|
||||
end
|
||||
end
|
||||
game_api.setIntValue("aiperi_talked_after_knife", 1)
|
||||
game_api.setIntValue("aiperi_chat_opened", 1)
|
||||
else
|
||||
|
||||
local aiperi_chat_opened = game_api.getIntValue("aiperi_chat_opened")
|
||||
local aiperi_knife_aware = game_api.getIntValue("aiperi_knife_aware")
|
||||
local aiperi_talked_after_knife = game_api.getIntValue("aiperi_talked_after_knife")
|
||||
local lection_is_over = game_api.getIntValue("lection_is_over")
|
||||
|
||||
|
||||
|
||||
print("dialogx step 1")
|
||||
|
||||
if (player_hold_knife) and (aiperi_talked_after_knife == 0) then
|
||||
game_api.start_dialogue("dialog_chat_aiperi003")
|
||||
game_api.setIntValue("aiperi_talked_after_knife", 1)
|
||||
else
|
||||
print("dialogx step 2")
|
||||
if aiperi_chat_opened == 0 then
|
||||
print("dialogx step 3")
|
||||
game_api.setIntValue("aiperi_chat_opened", 1)
|
||||
if aiperi_knife_aware == 0 then
|
||||
print("dialogx step 4")
|
||||
if (lection_is_over == 1) then
|
||||
print("dialogx step 5")
|
||||
print("player_hold_key")
|
||||
print(player_hold_key)
|
||||
if (player_hold_key == false) then
|
||||
print("dialogx step 6")
|
||||
game_api.start_dialogue("dialog_chat_aiperi002")
|
||||
end
|
||||
else
|
||||
game_api.start_dialogue("dialog_chat_aiperi001")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--[[
|
||||
if aiperi_chat_opened == 0 then
|
||||
game_api.setIntValue("aiperi_chat_opened", 1)
|
||||
|
||||
if (player_hold_knife) and (aiperi_talked_after_knife == 0) then
|
||||
game_api.start_dialogue("dialog_chat_aiperi003")
|
||||
game_api.setIntValue("aiperi_talked_after_knife", 1)
|
||||
else
|
||||
if aiperi_knife_aware == 0 then
|
||||
local lection_is_over = game_api.getIntValue("lection_is_over")
|
||||
if (lection_is_over == 1) then
|
||||
game_api.start_dialogue("dialog_chat_aiperi002")
|
||||
else
|
||||
game_api.start_dialogue("dialog_chat_aiperi001")
|
||||
end
|
||||
end
|
||||
end
|
||||
end]]
|
||||
end
|
||||
end,
|
||||
function()
|
||||
local parents_chat_opened = game_api.getIntValue("parents_chat_opened")
|
||||
if parents_chat_opened == 0 then
|
||||
game_api.setIntValue("parents_chat_opened", 1)
|
||||
game_api.start_dialogue("dialog_chat_parents001")
|
||||
end
|
||||
end,
|
||||
function()
|
||||
local news_chat_opened = game_api.getIntValue("news_chat_opened")
|
||||
if news_chat_opened == 0 then
|
||||
game_api.setIntValue("news_chat_opened", 1)
|
||||
game_api.start_dialogue("dialog_chat_news001")
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
--[[function on_aiperi_give_keys()
|
||||
game_api.pickup_item("all_keys")
|
||||
end]]
|
||||
|
||||
function on_aiperi_opens_door()
|
||||
print("on_aiperi_opens_door")
|
||||
@@ -1148,7 +1222,7 @@ game_api.set_location_callbacks(
|
||||
|
||||
print("day is:")
|
||||
print(day)
|
||||
|
||||
|
||||
local resetState = false
|
||||
if not (day == was_day_when_player_left) then
|
||||
resetState = true
|
||||
@@ -1161,9 +1235,8 @@ game_api.set_location_callbacks(
|
||||
elseif (was_state_when_player_left == 4) and (game_api.is_night() or game_api.is_darklands()) then
|
||||
resetState = true
|
||||
end
|
||||
|
||||
|
||||
if (day > 0) and resetState then
|
||||
|
||||
if (game_api.is_darklands()) then
|
||||
--Currently not possible
|
||||
print("Entered darklands setup")
|
||||
@@ -1180,8 +1253,8 @@ game_api.set_location_callbacks(
|
||||
game_api.switch_navigation(3)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
--[[
|
||||
local day = game_api.getIntValue("day")
|
||||
if (day == 0)then
|
||||
@@ -1207,7 +1280,7 @@ game_api.set_location_callbacks(
|
||||
arrive in night
|
||||
|
||||
]]
|
||||
|
||||
|
||||
|
||||
|
||||
if (day > 0) and (game_api.is_night() == false) then
|
||||
@@ -1223,15 +1296,14 @@ game_api.set_location_callbacks(
|
||||
print("setDay1MorningSetup entered-")
|
||||
setDay1MorningSetup()
|
||||
end
|
||||
|
||||
end,
|
||||
function()
|
||||
print("Exit location uni interior")
|
||||
--player_left_darklands = false
|
||||
local hp = game_api.get_player_hp()
|
||||
game_api.setFloatValue("player_hp", hp)
|
||||
|
||||
|
||||
|
||||
|
||||
--[[
|
||||
0 - day0
|
||||
1 - darklands
|
||||
@@ -1242,9 +1314,9 @@ game_api.set_location_callbacks(
|
||||
]]
|
||||
|
||||
local day = game_api.getIntValue("day")
|
||||
|
||||
|
||||
was_day_when_player_left = day
|
||||
if (day == 0)then
|
||||
if (day == 0) then
|
||||
was_state_when_player_left = 0
|
||||
elseif game_api.is_darklands() then
|
||||
was_state_when_player_left = 1
|
||||
|
||||
Reference in new issue
Block a user