Merge pull request 'feature/imp-112-dialogues-and-asc-4-7' (#58) from feature/imp-112-dialogues-and-asc-4-7 into develop
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: #58
This commit was merged in pull request #58.
This commit is contained in:
@@ -48,6 +48,7 @@ globals = {
|
|||||||
"Trigger",
|
"Trigger",
|
||||||
"UI",
|
"UI",
|
||||||
"Util",
|
"Util",
|
||||||
|
"WalkingToOfficeScreen",
|
||||||
"Window",
|
"Window",
|
||||||
"beats_to_pattern",
|
"beats_to_pattern",
|
||||||
"btnp",
|
"btnp",
|
||||||
|
|||||||
@@ -52,8 +52,10 @@ decision/decision.go_to_sleep.lua
|
|||||||
decision/decision.do_work.lua
|
decision/decision.do_work.lua
|
||||||
decision/decision.have_a_coffee.lua
|
decision/decision.have_a_coffee.lua
|
||||||
decision/decision.sumphore_discussion.lua
|
decision/decision.sumphore_discussion.lua
|
||||||
|
decision/decision.eating_fast_food.lua
|
||||||
discussion/discussion.sumphore.lua
|
discussion/discussion.sumphore.lua
|
||||||
discussion/discussion.coworker.lua
|
discussion/discussion.coworker.lua
|
||||||
|
discussion/discussion.pizza_vendor.lua
|
||||||
map/map.manager.lua
|
map/map.manager.lua
|
||||||
map/map.bedroom.lua
|
map/map.bedroom.lua
|
||||||
map/map.street.lua
|
map/map.street.lua
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Decision.register({
|
|||||||
modes_for_ascension_levels[1] = "only_special"
|
modes_for_ascension_levels[1] = "only_special"
|
||||||
modes_for_ascension_levels[2] = "only_left"
|
modes_for_ascension_levels[2] = "only_left"
|
||||||
modes_for_ascension_levels[3] = "only_nothing"
|
modes_for_ascension_levels[3] = "only_nothing"
|
||||||
|
modes_for_ascension_levels[4] = "normal"
|
||||||
|
|
||||||
MinigameDDRWindow.start("game", "generated", {
|
MinigameDDRWindow.start("game", "generated", {
|
||||||
on_win = function(game_context)
|
on_win = function(game_context)
|
||||||
@@ -19,8 +20,6 @@ Decision.register({
|
|||||||
Context.should_ascend = true
|
Context.should_ascend = true
|
||||||
elseif (game_context.special_mode_condition and Context.ascension.level == 3) then
|
elseif (game_context.special_mode_condition and Context.ascension.level == 3) then
|
||||||
Context.should_ascend = true
|
Context.should_ascend = true
|
||||||
elseif (game_context.special_mode_condition and Context.ascension.level == 4) then
|
|
||||||
Context.should_ascend = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Meter.show()
|
Meter.show()
|
||||||
@@ -28,7 +27,7 @@ Decision.register({
|
|||||||
Window.set_current("game")
|
Window.set_current("game")
|
||||||
Context.have_done_work_today = true
|
Context.have_done_work_today = true
|
||||||
end,
|
end,
|
||||||
special_mode = modes_for_ascension_levels[Ascension.get_level()]
|
special_mode = modes_for_ascension_levels[Ascension.get_level()] or "normal"
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|||||||
11
inc/decision/decision.eating_fast_food.lua
Normal file
11
inc/decision/decision.eating_fast_food.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
Decision.register({
|
||||||
|
id = "eating_fast_food",
|
||||||
|
label = "Eat Fast Food",
|
||||||
|
condition = function()
|
||||||
|
return Context.fast_food_eaten_today < 3
|
||||||
|
end,
|
||||||
|
handle = function()
|
||||||
|
Context.fast_food_approaching = true
|
||||||
|
Discussion.start("pizza_vendor_disc", "game")
|
||||||
|
end,
|
||||||
|
})
|
||||||
@@ -4,10 +4,17 @@ Decision.register({
|
|||||||
handle = function()
|
handle = function()
|
||||||
local level = Ascension.get_level()
|
local level = Ascension.get_level()
|
||||||
local disc_id = "coworker_disc_0"
|
local disc_id = "coworker_disc_0"
|
||||||
-- TODO: Add more discussions for levels above 3
|
if level >= 1 and level <= 5 then
|
||||||
if level >= 1 and level <= 3 then
|
|
||||||
local suffix = Context.have_done_work_today and ("_asc_" .. level) or ("_" .. level)
|
local suffix = Context.have_done_work_today and ("_asc_" .. level) or ("_" .. level)
|
||||||
disc_id = "coworker_disc" .. suffix
|
disc_id = "coworker_disc" .. suffix
|
||||||
|
elseif level == 6 then
|
||||||
|
if not Context.glitch_conversation_done_today and Context.glitch_conversation_count < 6 then
|
||||||
|
Context.glitch_conversation_done_today = true
|
||||||
|
Context.glitch_conversation_count = Context.glitch_conversation_count + 1
|
||||||
|
Glitch.show()
|
||||||
|
Discussion.start("coworker_disc_asc_6_" .. Context.glitch_conversation_count, "game")
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
Discussion.start(disc_id, "game")
|
Discussion.start(disc_id, "game")
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -13,9 +13,14 @@ Decision.register({
|
|||||||
end
|
end
|
||||||
local level = Ascension.get_level()
|
local level = Ascension.get_level()
|
||||||
|
|
||||||
-- TODO: Add more discussions for levels above 3
|
if level >= 1 and level <= 5 then
|
||||||
if level >= 1 and level <= 3 then
|
|
||||||
Discussion.start("sumphore_disc_asc_" .. level, "game")
|
Discussion.start("sumphore_disc_asc_" .. level, "game")
|
||||||
|
elseif level == 6 then
|
||||||
|
if Context.glitch_conversation_count >= 6 then
|
||||||
|
Discussion.start("sumphore_disc_asc_6", "game")
|
||||||
|
else
|
||||||
|
Discussion.start("sumphore_disc_asc_6_waiting", "game")
|
||||||
|
end
|
||||||
else
|
else
|
||||||
Discussion.start("homeless_guy", "game", 4)
|
Discussion.start("homeless_guy", "game", 4)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -142,3 +142,226 @@ Discussion.register({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Discussion.register({
|
||||||
|
id = "coworker_disc_4",
|
||||||
|
on_end = Meter.apply_coworker_discussion_reward,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "Normaaan! Same spot, same cup, same time. You're like a statue that drinks coffee!",
|
||||||
|
answers = {
|
||||||
|
{ label = "I'm a person.", next_step = 2 },
|
||||||
|
{ label = "Yep. Still here.", next_step = 2 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "I love that about you! So reliable! If the coffee machine breaks we still have Norman!",
|
||||||
|
answers = {
|
||||||
|
{ label = "Please don't.", next_step = nil },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
Discussion.register({
|
||||||
|
id = "coworker_disc_asc_4",
|
||||||
|
on_end = Meter.apply_coworker_discussion_reward,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "Norman, you were seriously locked in today. What on earth were you building?",
|
||||||
|
answers = {
|
||||||
|
{ label = "Just some things.", next_step = 2 },
|
||||||
|
{ label = "Nothing important.", next_step = 2 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "So modest! I heard the seniors literally whispering your name!",
|
||||||
|
answers = {
|
||||||
|
{ label = "Concerning.", next_step = 3 },
|
||||||
|
{ label = "That's... fine.", next_step = 3 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "You should celebrate! Coffee's on me tomorrow!",
|
||||||
|
answers = {
|
||||||
|
{ label = "Already have one.", next_step = nil },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
Discussion.register({
|
||||||
|
id = "coworker_disc_5",
|
||||||
|
on_end = Meter.apply_coworker_discussion_reward,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "Morning! Funny thought — I feel like we do this exact same thing every single day!",
|
||||||
|
answers = {
|
||||||
|
{ label = "We do.", next_step = 2 },
|
||||||
|
{ label = "Yes. We do.", next_step = 2 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "Ha! Routine is such a comfort, right? Same coffee, same smile, same everything!",
|
||||||
|
answers = {
|
||||||
|
{ label = "Sure. Very comforting.", next_step = nil },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
Discussion.register({
|
||||||
|
id = "coworker_disc_asc_5",
|
||||||
|
on_end = Meter.apply_coworker_discussion_reward,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "Norman! You were staring right THROUGH your screen today. What was going on up there?",
|
||||||
|
answers = {
|
||||||
|
{ label = "Coffee was cold.", next_step = 2 },
|
||||||
|
{ label = "Maybe I was.", next_step = 2 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "Were you meditating? Or doing your intense bug-stare thing?",
|
||||||
|
answers = {
|
||||||
|
{ label = "Something like that.", next_step = 3 },
|
||||||
|
{ label = "Bug stare thing?", next_step = 3 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "You're always somewhere else in your head, Norman. Must be nice up there!",
|
||||||
|
answers = {
|
||||||
|
{ label = "It's complicated.", next_step = nil },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local function _glitch_on_end()
|
||||||
|
Meter.apply_coworker_discussion_reward()
|
||||||
|
Context.glitch_conversation_count = Context.glitch_conversation_count + 1
|
||||||
|
Glitch.hide()
|
||||||
|
end
|
||||||
|
|
||||||
|
Discussion.register({
|
||||||
|
id = "coworker_disc_asc_6_1",
|
||||||
|
on_end = _glitch_on_end,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "Hey Norman, good morning! Good morning! Good morning! ...Sorry. I don't know why I keep saying that.",
|
||||||
|
answers = {
|
||||||
|
{ label = "Are you feeling ok?", next_step = 2 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "Good morning. Good morning. Good— I can't stop. Why can't I stop?",
|
||||||
|
answers = {
|
||||||
|
{ label = "...", next_step = nil },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
Discussion.register({
|
||||||
|
id = "coworker_disc_asc_6_2",
|
||||||
|
on_end = _glitch_on_end,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "Hey... Marcus. How's it going?",
|
||||||
|
answers = {
|
||||||
|
{ label = "My name is Norman.", next_step = 2 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "Right, sorry. Marcus. You look tired today.",
|
||||||
|
answers = {
|
||||||
|
{ label = "Norman. It's Norman.", next_step = 3 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "Sure, sure. You should get some rest, Marcus.",
|
||||||
|
answers = {
|
||||||
|
{ label = "...", next_step = nil },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
Discussion.register({
|
||||||
|
id = "coworker_disc_asc_6_3",
|
||||||
|
on_end = _glitch_on_end,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "We've had this conversation before, haven't we? Exact same words. Same coffee. Same spot.",
|
||||||
|
answers = {
|
||||||
|
{ label = "I don't think so.", next_step = 2 },
|
||||||
|
{ label = "Maybe.", next_step = 2 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "Every day. I always say the same thing and you always say that. It's very strange.",
|
||||||
|
answers = {
|
||||||
|
{ label = "That's just routine.", next_step = nil },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
Discussion.register({
|
||||||
|
id = "coworker_disc_asc_6_4",
|
||||||
|
on_end = _glitch_on_end,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "Do you ever look at the walls here? Really look? Sometimes they don't feel... solid.",
|
||||||
|
answers = {
|
||||||
|
{ label = "They're just walls.", next_step = 2 },
|
||||||
|
{ label = "I know what you mean.", next_step = 2 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "Like they're only there because we expect them to be. Like set dressing. Does any of this feel load-bearing to you?",
|
||||||
|
answers = {
|
||||||
|
{ label = "I need more coffee.", next_step = nil },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
Discussion.register({
|
||||||
|
id = "coworker_disc_asc_6_5",
|
||||||
|
on_end = _glitch_on_end,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "Norman, I'm not supposed to— I mean. How are you doing today?",
|
||||||
|
answers = {
|
||||||
|
{ label = "What weren't you supposed to say?", next_step = 2 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "...",
|
||||||
|
answers = {
|
||||||
|
{ label = "Hello?", next_step = nil },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
Discussion.register({
|
||||||
|
id = "coworker_disc_asc_6_6",
|
||||||
|
on_end = _glitch_on_end,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "Forget it. You won't remember this conversation anyway. None of us do.",
|
||||||
|
answers = {
|
||||||
|
{ label = "What do you mean?", next_step = 2 },
|
||||||
|
{ label = "That's a strange thing to say.", next_step = 2 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "Tomorrow you'll come back and it'll be like this never happened. Same coffee. Same office. Same Norman.",
|
||||||
|
answers = {
|
||||||
|
{ label = "...", next_step = nil },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
28
inc/discussion/discussion.pizza_vendor.lua
Normal file
28
inc/discussion/discussion.pizza_vendor.lua
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
Discussion.register({
|
||||||
|
id = "pizza_vendor_disc",
|
||||||
|
on_end = function()
|
||||||
|
Context.fast_food_approaching = false
|
||||||
|
end,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "Hey friend! Hot slice, fresh out of the oven. You look like a man who knows good food!",
|
||||||
|
answers = {
|
||||||
|
{
|
||||||
|
label = "Devour a juicy one",
|
||||||
|
next_step = nil,
|
||||||
|
on_select = function()
|
||||||
|
local max = Meter.get_max()
|
||||||
|
Meter.add("wpm", math.floor(max * 0.05))
|
||||||
|
Meter.add("ism", math.floor(max * -0.05))
|
||||||
|
Meter.add("bm", math.floor(max * -0.05))
|
||||||
|
Context.fast_food_eaten_today = Context.fast_food_eaten_today + 1
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "Stay lean and sharp",
|
||||||
|
next_step = nil,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -89,6 +89,125 @@ Discussion.register({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Discussion.register({
|
||||||
|
id = "sumphore_disc_asc_4",
|
||||||
|
on_end = Meter.apply_sumphore_discussion_reward,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "The alarm wakes you every morning without fail, I bet.",
|
||||||
|
answers = {
|
||||||
|
{ label = "It's how it works.", next_step = 2 },
|
||||||
|
{ label = "Sometimes I wish it didn't.", next_step = 2 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "What if the alarm is part of the problem?",
|
||||||
|
answers = {
|
||||||
|
{ label = "That doesn't make any sense.", next_step = 3 },
|
||||||
|
{ label = "Go on.", next_step = 3 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "One morning, Norman. When the choice comes, choose the bed. See what the world does without you in it.",
|
||||||
|
answers = {
|
||||||
|
{ label = "You're drunk.", next_step = nil },
|
||||||
|
{ label = "What choice?", next_step = nil, on_select = function()
|
||||||
|
Meter.add("ism", 5)
|
||||||
|
end },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
Discussion.register({
|
||||||
|
id = "sumphore_disc_asc_5",
|
||||||
|
on_end = Meter.apply_sumphore_discussion_reward,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "You saw something you weren't supposed to, didn't you.",
|
||||||
|
answers = {
|
||||||
|
{ label = "I don't know what you mean.", next_step = 2 },
|
||||||
|
{ label = "Maybe.", next_step = 2 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "The world around you has seams. Your coworkers slip sometimes. Say things that don't quite fit.",
|
||||||
|
answers = {
|
||||||
|
{ label = "They seem fine to me.", next_step = nil },
|
||||||
|
{ label = "I've noticed something odd.", next_step = 3 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "Count those moments. Six of them should be enough to see the whole picture.",
|
||||||
|
answers = {
|
||||||
|
{ label = "Six of what, exactly?", next_step = nil, on_select = function()
|
||||||
|
Meter.add("ism", 5)
|
||||||
|
end },
|
||||||
|
{ label = "How would you know any of this?", next_step = nil },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
Discussion.register({
|
||||||
|
id = "sumphore_disc_asc_6_waiting",
|
||||||
|
on_end = Meter.apply_sumphore_discussion_reward,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "You look like a man who has seen something he can't explain.",
|
||||||
|
answers = {
|
||||||
|
{ label = "I'm hearing things.", next_step = 2 },
|
||||||
|
{ label = "Maybe.", next_step = 2 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "Keep looking. The world has a way of showing you what you need to see. Talk to people. You're almost there.",
|
||||||
|
answers = {
|
||||||
|
{ label = "Almost where?", next_step = nil },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
Discussion.register({
|
||||||
|
id = "sumphore_disc_asc_6",
|
||||||
|
on_end = function()
|
||||||
|
Meter.apply_sumphore_discussion_reward()
|
||||||
|
Context.should_ascend = true
|
||||||
|
Day.increase()
|
||||||
|
MysteriousManScreen.start({
|
||||||
|
text = MysteriousManScreen.get_text_for_level(Ascension.get_level())
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
steps = {
|
||||||
|
{
|
||||||
|
question = "You've been seeing the cracks, haven't you? The repetition. The loops. The coworkers who can't quite remember.",
|
||||||
|
answers = {
|
||||||
|
{ label = "How do you know that?", next_step = 2 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "Because I was you, once. This isn't a workplace, Norman. It never was. You're in a system. And you've just become aware of it.",
|
||||||
|
answers = {
|
||||||
|
{ label = "That can't be true.", next_step = 3 },
|
||||||
|
{ label = "I knew something was wrong.", next_step = 3 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "It doesn't matter if you believe it. You already know. That's why the cracks are showing. That's why you're still here.",
|
||||||
|
answers = {
|
||||||
|
{ label = "What do I do now?", next_step = 4 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question = "Oh look, is that a squirrel ?",
|
||||||
|
answers = {
|
||||||
|
{ label = "Alcoholic ...", next_step = nil },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
Discussion.register({
|
Discussion.register({
|
||||||
id = "homeless_guy",
|
id = "homeless_guy",
|
||||||
on_end = Meter.apply_sumphore_discussion_reward,
|
on_end = Meter.apply_sumphore_discussion_reward,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ local FADE_COLORS = nil
|
|||||||
function Ascension.get_initial()
|
function Ascension.get_initial()
|
||||||
_increased_this_cycle = false
|
_increased_this_cycle = false
|
||||||
return {
|
return {
|
||||||
level = 0,
|
level = 0, -- FYI: change this to test ascension levels without having to play through them
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -53,8 +53,12 @@ function Context.initial_data()
|
|||||||
toilet_meters_today_evening = false,
|
toilet_meters_today_evening = false,
|
||||||
coworker_discussion_meter_applied_today = false,
|
coworker_discussion_meter_applied_today = false,
|
||||||
sumphore_discussion_meter_applied_today = false,
|
sumphore_discussion_meter_applied_today = false,
|
||||||
|
glitch_conversation_count = 0,
|
||||||
|
glitch_conversation_done_today = false,
|
||||||
should_ascend = false,
|
should_ascend = false,
|
||||||
have_met_sumphore = false,
|
have_met_sumphore = false,
|
||||||
|
fast_food_approaching = false,
|
||||||
|
fast_food_eaten_today = 0,
|
||||||
office_sprites = {},
|
office_sprites = {},
|
||||||
walking_to_office_sprites = {},
|
walking_to_office_sprites = {},
|
||||||
game = {
|
game = {
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ Day.register_handler(function()
|
|||||||
Context.toilet_meters_today_evening = false
|
Context.toilet_meters_today_evening = false
|
||||||
Context.coworker_discussion_meter_applied_today = false
|
Context.coworker_discussion_meter_applied_today = false
|
||||||
Context.sumphore_discussion_meter_applied_today = false
|
Context.sumphore_discussion_meter_applied_today = false
|
||||||
|
Context.glitch_conversation_done_today = false
|
||||||
|
Context.fast_food_eaten_today = 0
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Day.register_handler(function()
|
Day.register_handler(function()
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ local METER_DECAY_PER_DAY = 20
|
|||||||
local COMBO_BASE_BONUS = 0.02
|
local COMBO_BASE_BONUS = 0.02
|
||||||
local COMBO_MAX_BONUS = 0.16
|
local COMBO_MAX_BONUS = 0.16
|
||||||
local COMBO_TIMEOUT_FRAMES = 600
|
local COMBO_TIMEOUT_FRAMES = 600
|
||||||
|
local METER_FLASH_DURATION = 2.0
|
||||||
|
local FLASH_COLOR = 4
|
||||||
|
|
||||||
-- Internal meters for tracking game progress and player stats.
|
-- Internal meters for tracking game progress and player stats.
|
||||||
Meter.COLOR_ISM = Config.colors.orange
|
Meter.COLOR_ISM = Config.colors.orange
|
||||||
@@ -16,6 +18,12 @@ Meter.COLOR_BM = Config.colors.red
|
|||||||
Meter.COLOR_BG = Config.colors.meter_bg
|
Meter.COLOR_BG = Config.colors.meter_bg
|
||||||
Meter.COLOR_CONTOUR = Config.colors.white
|
Meter.COLOR_CONTOUR = Config.colors.white
|
||||||
|
|
||||||
|
local _flash = {
|
||||||
|
wpm = { timer = 0, delta = 0 },
|
||||||
|
ism = { timer = 0, delta = 0 },
|
||||||
|
bm = { timer = 0, delta = 0 },
|
||||||
|
}
|
||||||
|
|
||||||
--- Gets initial meter values.
|
--- Gets initial meter values.
|
||||||
--- @within Meter
|
--- @within Meter
|
||||||
--- @return result table Initial meter values. </br>
|
--- @return result table Initial meter values. </br>
|
||||||
@@ -95,6 +103,12 @@ function Meter.update()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local dt = Context.delta_time or 0
|
||||||
|
for _, key in ipairs({ "wpm", "ism", "bm" }) do
|
||||||
|
if _flash[key].timer > 0 then
|
||||||
|
_flash[key].timer = _flash[key].timer - dt
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Adds amount to a meter.
|
--- Adds amount to a meter.
|
||||||
@@ -109,7 +123,18 @@ function Meter.add(key, amount)
|
|||||||
GameOverWindow.show(key)
|
GameOverWindow.show(key)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
local prev_wpm = (key == "wpm") and m.wpm or nil
|
||||||
|
local old_val = m[key]
|
||||||
m[key] = math.max(0, math.min(METER_MAX, m[key] + amount))
|
m[key] = math.max(0, math.min(METER_MAX, m[key] + amount))
|
||||||
|
local actual_delta = m[key] - old_val
|
||||||
|
if actual_delta ~= 0 and _flash[key] then
|
||||||
|
_flash[key].delta = actual_delta
|
||||||
|
_flash[key].timer = METER_FLASH_DURATION
|
||||||
|
end
|
||||||
|
if prev_wpm and prev_wpm > 0 and m.wpm == 0 and Context.game_in_progress
|
||||||
|
and Ascension.get_level() == 5 then
|
||||||
|
Context.should_ascend = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -258,12 +283,32 @@ function Meter.draw()
|
|||||||
local fill_w = math.max(0, math.floor((m[meter.key] / max) * bar_w))
|
local fill_w = math.max(0, math.floor((m[meter.key] / max) * bar_w))
|
||||||
rect(bar_x - 1, bar_y - 1, bar_w + 2, bar_h + 2, Meter.COLOR_CONTOUR)
|
rect(bar_x - 1, bar_y - 1, bar_w + 2, bar_h + 2, Meter.COLOR_CONTOUR)
|
||||||
rect(bar_x, bar_y, bar_w, bar_h, Meter.COLOR_BG)
|
rect(bar_x, bar_y, bar_w, bar_h, Meter.COLOR_BG)
|
||||||
if fill_w > 0 then
|
local flash = _flash[meter.key]
|
||||||
|
if flash and flash.timer > 0 then
|
||||||
|
local old_val = m[meter.key] - flash.delta
|
||||||
|
local old_fill_w = math.max(0, math.floor((old_val / max) * bar_w))
|
||||||
|
local stable_w = math.min(fill_w, old_fill_w)
|
||||||
|
if stable_w > 0 then
|
||||||
|
rect(bar_x, bar_y, stable_w, bar_h, meter.color)
|
||||||
|
end
|
||||||
|
if flash.delta > 0 then
|
||||||
|
local hi_w = fill_w - stable_w
|
||||||
|
if hi_w > 0 then
|
||||||
|
rect(bar_x + stable_w, bar_y, hi_w, bar_h, FLASH_COLOR)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
local hi_w = old_fill_w - fill_w
|
||||||
|
if hi_w > 0 then
|
||||||
|
rect(bar_x + fill_w, bar_y, hi_w, bar_h, FLASH_COLOR)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif fill_w > 0 then
|
||||||
rect(bar_x, bar_y, fill_w, bar_h, meter.color)
|
rect(bar_x, bar_y, fill_w, bar_h, meter.color)
|
||||||
end
|
end
|
||||||
---print(meter.label, label_x, label_y, meter.color, false, 1, true)
|
---print(meter.label, label_x, label_y, meter.color, false, 1, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
local ascension_y = start_y + 3 * line_h + 1
|
local ascension_y = start_y + 3 * line_h + 1
|
||||||
Ascension.draw(bar_x, ascension_y, { spacing = 8 })
|
Ascension.draw(bar_x - 4, ascension_y, { spacing = 8 })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -54,12 +54,40 @@ local ASC_45_TEXT = [[
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
local ASC_56_TEXT = [[
|
||||||
|
Norman is not as productive as he should be.
|
||||||
|
|
||||||
|
Can we distract him?
|
||||||
|
|
||||||
|
We need to keep him busy.
|
||||||
|
|
||||||
|
We need
|
||||||
|
|
||||||
|
More
|
||||||
|
|
||||||
|
Time
|
||||||
|
]]
|
||||||
|
|
||||||
|
local ASC_67_TEXT = [[
|
||||||
|
He knows.
|
||||||
|
|
||||||
|
Norman has broken through the first veil.
|
||||||
|
|
||||||
|
The simulation is compromised.
|
||||||
|
|
||||||
|
This was not supposed to happen.
|
||||||
|
|
||||||
|
Not yet.
|
||||||
|
]]
|
||||||
|
|
||||||
local ascension_texts = {
|
local ascension_texts = {
|
||||||
[1] = ASC_01_TEXT,
|
[1] = ASC_01_TEXT,
|
||||||
[2] = ASC_12_TEXT,
|
[2] = ASC_12_TEXT,
|
||||||
[3] = ASC_23_TEXT,
|
[3] = ASC_23_TEXT,
|
||||||
[4] = ASC_34_TEXT,
|
[4] = ASC_34_TEXT,
|
||||||
[5] = ASC_45_TEXT,
|
[5] = ASC_45_TEXT,
|
||||||
|
[6] = ASC_56_TEXT,
|
||||||
|
[7] = ASC_67_TEXT,
|
||||||
}
|
}
|
||||||
|
|
||||||
function MysteriousManScreen.get_text_for_level(level)
|
function MysteriousManScreen.get_text_for_level(level)
|
||||||
@@ -146,11 +174,25 @@ function MysteriousManScreen.wake_up()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Norman chooses to stay in bed, skipping the minigame and flash, and going straight to the next day.
|
-- Norman chooses to stay in bed, skipping the minigame and flash, and going straight to the next day.
|
||||||
|
-- At ascension level 4, staying in bed triggers 4->5: shows the ascension text then wakes with flash.
|
||||||
-- @within MysteriousManScreen
|
-- @within MysteriousManScreen
|
||||||
function MysteriousManScreen.stay_in_bed()
|
function MysteriousManScreen.stay_in_bed()
|
||||||
Day.increase()
|
if Ascension.get_level() == 4 then
|
||||||
state = STATE_DAY
|
Context.should_ascend = true
|
||||||
day_timer = day_display_seconds
|
Day.increase()
|
||||||
|
Ascension.consume_increase()
|
||||||
|
trigger_flash_on_wake = true
|
||||||
|
show_mysterious_screen = true
|
||||||
|
text = MysteriousManScreen.get_text_for_level(Ascension.get_level())
|
||||||
|
text_y = Config.screen.height
|
||||||
|
text_done = false
|
||||||
|
text_done_timer = 0
|
||||||
|
state = STATE_TEXT
|
||||||
|
else
|
||||||
|
Day.increase()
|
||||||
|
state = STATE_DAY
|
||||||
|
day_timer = day_display_seconds
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Starts the mysterious man screen.
|
--- Starts the mysterious man screen.
|
||||||
|
|||||||
@@ -4,15 +4,20 @@ Screen.register({
|
|||||||
decisions = {
|
decisions = {
|
||||||
"go_to_home",
|
"go_to_home",
|
||||||
"go_to_office",
|
"go_to_office",
|
||||||
|
"eating_fast_food",
|
||||||
},
|
},
|
||||||
init = function()
|
init = function()
|
||||||
Audio.music_play_room_work()
|
Audio.music_play_room_work()
|
||||||
end,
|
end,
|
||||||
background = "street",
|
background = "street",
|
||||||
draw = function()
|
draw = function()
|
||||||
if Window.get_current_id() == "game" then
|
local w = Window.get_current_id()
|
||||||
Sprite.draw_at("norman", 7 * 8, 3 * 8)
|
if w == "game" or w == "discussion" then
|
||||||
Sprite.draw_at("pizza_vendor", 19 * 8, 1 * 8)
|
local norman_x = Context.fast_food_approaching and (19 * 8) or (7 * 8)
|
||||||
|
Sprite.draw_at("norman", norman_x, 3 * 8)
|
||||||
|
if Context.fast_food_eaten_today < 3 then
|
||||||
|
Sprite.draw_at("pizza_vendor", 19 * 8, 1 * 8)
|
||||||
|
end
|
||||||
Sprite.draw_at("dev_guard", 22 * 8, 2 * 8)
|
Sprite.draw_at("dev_guard", 22 * 8, 2 * 8)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ Screen.register({
|
|||||||
"go_to_home",
|
"go_to_home",
|
||||||
"go_to_office",
|
"go_to_office",
|
||||||
"sumphore_discussion",
|
"sumphore_discussion",
|
||||||
|
"eating_fast_food",
|
||||||
},
|
},
|
||||||
init = function()
|
init = function()
|
||||||
Audio.music_play_room_work()
|
Audio.music_play_room_work()
|
||||||
@@ -32,12 +33,18 @@ Screen.register({
|
|||||||
Context.walking_to_office_sprites = Sprite.list_randomize(possible_sprites, possible_positions)
|
Context.walking_to_office_sprites = Sprite.list_randomize(possible_sprites, possible_positions)
|
||||||
end,
|
end,
|
||||||
background = "street",
|
background = "street",
|
||||||
|
update = function()
|
||||||
|
end,
|
||||||
draw = function()
|
draw = function()
|
||||||
if Window.get_current_id() == "game" then
|
local w = Window.get_current_id()
|
||||||
Sprite.draw_at("norman", 7 * 8, 3 * 8)
|
if w == "game" or w == "discussion" then
|
||||||
Sprite.draw_at("sumphore", 9 * 8, 2 * 8)
|
local norman_x = Context.fast_food_approaching and (19 * 8) or (7 * 8)
|
||||||
Sprite.draw_at("pizza_vendor", 19 * 8, 1 * 8)
|
Sprite.draw_at("norman", norman_x, 3 * 8)
|
||||||
Sprite.draw_at("dev_guard", 22 * 8, 2 * 8)
|
Sprite.draw_at("sumphore", 9 * 8, 2 * 8)
|
||||||
|
if Context.fast_food_eaten_today < 3 then
|
||||||
|
Sprite.draw_at("pizza_vendor", 19 * 8, 1 * 8)
|
||||||
|
end
|
||||||
|
Sprite.draw_at("dev_guard", 22 * 8, 3 * 8)
|
||||||
|
|
||||||
Sprite.draw_list(Context.walking_to_office_sprites)
|
Sprite.draw_list(Context.walking_to_office_sprites)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user