Major refactoring for game objects
This commit is contained in:
1 parent
efb85f7328
commit
2cae9998a0
18 files changed
+547
-716
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
lection_is_over = false
|
||||
|
||||
player_hold_book = false
|
||||
|
||||
function lection_hall_zone001_enter_callback()
|
||||
--game_api.start_dialogue("")
|
||||
@@ -37,13 +38,35 @@ game_api.set_trigger_zone_callbacks("knife_dialog_zone001",
|
||||
|
||||
function on_knife_pickup()
|
||||
game_api.pickup_item("knife")
|
||||
game_api.deactivate_interactive_object("Knife001")
|
||||
end
|
||||
|
||||
|
||||
function on_book_pickup()
|
||||
game_api.pickup_item("book")
|
||||
if not player_hold_book then
|
||||
game_api.pickup_item("book")
|
||||
game_api.deactivate_interactive_object("Book001")
|
||||
player_hold_book = true
|
||||
else
|
||||
game_api.remove_item("book")
|
||||
game_api.activate_interactive_object("Book001")
|
||||
player_hold_book = false
|
||||
end
|
||||
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
|
||||
else
|
||||
game_api.remove_item("book")
|
||||
game_api.activate_interactive_object("Book001")
|
||||
player_hold_book = false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
function on_npc_interact(npc_index)
|
||||
print("[Lua] NPC interaction! Index: " .. tostring(npc_index))
|
||||
if npc_index == 1 then
|
||||
|
||||
Reference in new issue
Block a user