Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an option to force the game over message #302

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/engine/game/common/data/partymember.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
---@field menu_icon_offset [number, number]?
---
---@field gameover_message string[]?
---@field force_gameover_message boolean[]?
---
---@field flags table<string, any>
---
Expand Down Expand Up @@ -182,6 +183,8 @@ function PartyMember:init()

-- Message shown on gameover (optional)
self.gameover_message = nil
-- Message will show even if the member is the soul character
self.force_gameover_message = false

-- Character flags (saved to the save file)
self.flags = {}
Expand Down Expand Up @@ -363,6 +366,7 @@ function PartyMember:getHeadIconOffset() return unpack(self.head_icon_offset or
function PartyMember:getMenuIconOffset() return unpack(self.menu_icon_offset or {0, 0}) end

function PartyMember:getGameOverMessage() return self.gameover_message end
function PartyMember:getForceGameOverMessage() return self.force_gameover_message end

-- Functions / Getters & Setters

Expand Down
16 changes: 9 additions & 7 deletions src/engine/game/gameover.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ function GameOver:update()
local options = {}
local main_chara = Game:getSoulPartyMember()
for _, member in ipairs(Game.party) do
if member ~= main_chara and member:getGameOverMessage(main_chara) then
if (member ~= main_chara or member:getForceGameOverMessage()) and member:getGameOverMessage(main_chara) then
table.insert(options, member)
end
end
if Game:getConfig("oldGameOver") and not Game:isLight() then
if Game.died_once then
self.current_stage = 6
else
self.dialogue = DialogueText("[speed:0.5][spacing:8][voice:none]IT APPEARS YOU\nHAVE REACHED[wait:30]\n\n AN END.", 160, 160, {style = "GONER", line_offset = 14})
self.dialogue = DialogueText("[speed:0.5][spacing:8][voice:none]IT APPEARS YOU\nHAVE REACHED[wait:30]\n\n AN END.", 164, 160, {style = "GONER", line_offset = 12})
self.dialogue.skip_speed = true
self:addChild(self.dialogue)
self.current_stage = 6
Expand All @@ -141,7 +141,7 @@ function GameOver:update()
end
else
local member = Utils.pick(options)
local voice = member:getActor().voice or "default"
local voice = member:getActor():getVoice() or "default"
self.lines = {}
for _,dialogue in ipairs(member:getGameOverMessage(main_chara)) do
local spacing = Game:isLight() and 6 or 8
Expand Down Expand Up @@ -192,12 +192,12 @@ function GameOver:update()
end
else
self.dialogue:setText("[speed:0.5][spacing:8][voice:none]WILL YOU TRY AGAIN?")
self.dialogue.x = 100
self.dialogue.x = 104
self.current_stage = 7
end
end
if Game:getConfig("oldGameOver") and self.current_stage == 6 and Game.died_once then
self.dialogue = DialogueText("[speed:0.5][spacing:8][voice:none]WILL YOU PERSIST?", 120, 160, {style = "GONER", line_offset = 14})
self.dialogue = DialogueText("[speed:0.5][spacing:8][voice:none]WILL YOU PERSIST?", 104, 160, {style = "GONER", line_offset = 12})
self:addChild(self.dialogue)
self.current_stage = 7
end
Expand Down Expand Up @@ -229,13 +229,14 @@ function GameOver:update()
self.timer = 0
else
self.current_stage = 20
local world_ended_text = "[noskip][speed:0.5][spacing:8][voice:none] THEN THE WORLD[wait:30] \n WAS COVERED[wait:30] \n IN DARKNESS."
if not Game:getConfig("oldGameOver") then
self.text:remove()

self.dialogue = DialogueText("[noskip][speed:0.5][spacing:8][voice:none] THEN THE WORLD[wait:30] \n WAS COVERED[wait:30] \n IN DARKNESS.", 120, 160, {style = "GONER", line_offset = 14})
self.dialogue = DialogueText(world_ended_text, 120, 160, {style = "GONER", line_offset = 12})
self:addChild(self.dialogue)
else
self.dialogue:setText("[noskip][speed:0.5][spacing:8][voice:none] THEN THE WORLD[wait:30] \n WAS COVERED[wait:30] \n IN DARKNESS.")
self.dialogue:setText(world_ended_text)
self.dialogue.x = 120
end
end
Expand All @@ -244,6 +245,7 @@ function GameOver:update()

if (self.current_stage == 9) then
if Game:getConfig("oldGameOver") then
self.dialogue.x = 99
if Game.died_once then
self.dialogue:setText("")
else
Expand Down