From 4d2391f1beff1a3168bc19d05ab2c5913b63d588 Mon Sep 17 00:00:00 2001 From: MegaBrutal Date: Wed, 3 Oct 2018 20:05:25 +0200 Subject: [PATCH 1/5] Add method to reset talk count GameNPC.resetTalk(), will be used later. modified: wgj58.js --- wgj58.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wgj58.js b/wgj58.js index 6ec551c..2c503f0 100644 --- a/wgj58.js +++ b/wgj58.js @@ -172,7 +172,7 @@ class GameNPC extends Phaser.Sprite { this.fullname = fullname; this.interaction_distance = interaction_distance; this.interactable = false; - this.talkcount = 0; + this.resetTalk(); this.happy = false; } @@ -218,6 +218,10 @@ class GameNPC extends Phaser.Sprite { return true; } + resetTalk() { + this.talkcount = 0; + } + makeHappy() { this.happy = true; console.log(this.shortname, "is happy!"); -- 2.34.1 From 843210d0ce09616cf01237228425aededacc419a Mon Sep 17 00:00:00 2001 From: MegaBrutal Date: Sat, 17 Nov 2018 04:15:00 +0100 Subject: [PATCH 2/5] Add Carlos afternoon dialogue modified: wgj58.js --- wgj58.js | 128 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 80 insertions(+), 48 deletions(-) diff --git a/wgj58.js b/wgj58.js index 2c503f0..c69dcbe 100644 --- a/wgj58.js +++ b/wgj58.js @@ -309,52 +309,78 @@ class NPC_Clara extends GameNPC { class NPC_Carlos extends GameNPC { actionTalk() { if (logic.clara.alive) { - switch (this.talkcount) { - case 0: - logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "Good morning, Carlos! What's up?" }, - { actor: this, text: "Hey, John! Not too much, I'm just trying to sell some shit to this new client." }, - { actor: logic.player, text: "And so? Is it hard to convince them?" }, - { actor: this, text: "Of course, they don't want to buy. It's shit." }, - { actor: this, text: "I mean, who would want to buy shit?" }, - { actor: logic.player, text: "Yeah. Relatable... But why are you trying to sell shit? I mean, why not one of our cutting edge technologies?" }, - { actor: this, text: "They couldn't afford it." }, - { actor: logic.player, text: "Then why are you trying to sell them... anything at all? They'd better off with a cheaper company." }, - { actor: this, text: "Company policies. Plus the management instructed me to sell to them, no matter what." }, - { actor: logic.player, text: "That sucks... Well... good luck!" }, - { actor: this, text: "Thanks..." } ] )); - logic.closeDoor("cutedoor"); - logic.openDoor("carlosdoor"); - break; - case 1: - logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "*Sigh.* I'll probably not work here for long, if I can't sell this shit to the customer." }, - { actor: this, text: "These layoffs are terrifying. They let go of anyone for even the slightest mistake." }, - { actor: logic.player, text: "But it's not a mistake when our client doesn't buy something they don't need." }, - { actor: this, text: "Tell this to my boss..." } ] )); - break; - case 2: - logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "You know, generally, I think it sucks being a child. One thing I miss though, if you're a child, you're allowed to be silly." }, - { actor: this, text: "..." }, - { actor: this, text: "For example, when my Dad told me that semen is the seed of animals, I theoretized, if I'd bury some pig semen in the garden, a pig would grow out of it..." }, - { actor: this, text: "I was totally fascinated by the thought, because I really wanted to have a pet pig, but Dad wouldn't let me have one." }, - { actor: this, text: "So I thought I could grow my own pig in the garden from pig seeds!" }, - { actor: logic.player, text: "Interesting. Where are you going with this?" }, - { actor: this, text: "I don't know... sometimes I feel like I'd rather sell pig semen to our clients, heh!" }, - { actor: this, text: "Uhm..." }, - { actor: this, text: "Totally don't tell this to Saiki!" } ] )); - this.pigsemen = true; - break; - case 3: - logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Weren't you heading to the IT department to the right?" }, - { actor: this, text: "You know... the green department which looks way better than blue!" }, - { actor: this, text: "..." }, - { actor: this, text: "Damn, why do I have to work in blue? I just feel... so blue about it." } ] )); - break; - case 4: - logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Weren't you heading to the conveniently green department to the right? I guess Saiki is waiting for you." }, - { actor: this, text: "You're so lucky that you can work with her every day!" } ] )); - break; - default: - logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Guess you'll stay here then. It's cool, you're great company anyway." } ] )); + if (logic.peter.talkcount == 0) { + switch (this.talkcount) { + case 0: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "Good morning, Carlos! What's up?" }, + { actor: this, text: "Hey, John! Not too much, I'm just trying to sell some shit to this new client." }, + { actor: logic.player, text: "And so? Is it hard to convince them?" }, + { actor: this, text: "Of course, they don't want to buy. It's shit." }, + { actor: this, text: "I mean, who would want to buy shit?" }, + { actor: logic.player, text: "Yeah. Relatable... But why are you trying to sell shit? I mean, why not one of our cutting edge technologies?" }, + { actor: this, text: "They couldn't afford it." }, + { actor: logic.player, text: "Then why are you trying to sell them... anything at all? They'd better off with a cheaper company." }, + { actor: this, text: "Company policies. Plus the management instructed me to sell to them, no matter what." }, + { actor: logic.player, text: "That sucks... Well... good luck!" }, + { actor: this, text: "Thanks..." } ] )); + logic.closeDoor("cutedoor"); + logic.openDoor("carlosdoor"); + break; + case 1: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "*Sigh.* I'll probably not work here for long, if I can't sell this shit to the customer." }, + { actor: this, text: "These layoffs are terrifying. They let go of anyone for even the slightest mistake." }, + { actor: logic.player, text: "But it's not a mistake when our client doesn't buy something they don't need." }, + { actor: this, text: "Tell this to my boss..." } ] )); + break; + case 2: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "You know, generally, I think it sucks being a child. One thing I miss though, if you're a child, you're allowed to be silly." }, + { actor: this, text: "..." }, + { actor: this, text: "For example, when my Dad told me that semen is the seed of animals, I theoretized, if I'd bury some pig semen in the garden, a pig would grow out of it..." }, + { actor: this, text: "I was totally fascinated by the thought, because I really wanted to have a pet pig, but Dad wouldn't let me have one." }, + { actor: this, text: "So I thought I could grow my own pig in the garden from pig seeds!" }, + { actor: logic.player, text: "Interesting. Where are you going with this?" }, + { actor: this, text: "I don't know... sometimes I feel like I'd rather sell pig semen to our clients, heh!" }, + { actor: this, text: "Uhm..." }, + { actor: this, text: "Totally don't tell this to Saiki!" } ] )); + this.pigsemen = true; + break; + case 3: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Weren't you heading to the IT department to the right?" }, + { actor: this, text: "You know... the green department which looks way better than blue!" }, + { actor: this, text: "..." }, + { actor: this, text: "Damn, why do I have to work in blue? I just feel... so blue about it." } ] )); + break; + case 4: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Weren't you heading to the conveniently green department to the right? I guess Saiki is waiting for you." }, + { actor: this, text: "You're so lucky that you can work with her every day!" } ] )); + break; + default: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Guess you'll stay here then. It's cool, you're great company anyway." } ] )); + } + } + else { + switch (this.talkcount) { + case 0: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Phew... long shift, I gotta go!" }, + { actor: this, text: "Why are you still here? I mean, you engineers stay here 'til late at night. Why don't you just go home at 4 pm?" }, + { actor: this, text: "This is why I can never ask out Saiki... She always works for so long..." }, + { actor: logic.player, text: "We tend to have lots of work with impossible deadlines..." }, + { actor: this, text: "I bet you get lots of money for the overtimes!" }, + { actor: logic.player, text: "No, we don't get paid for overtimes." }, + { actor: this, text: "... Then why do you stay beyond the office hours?" }, + { actor: logic.player, text: "Otherwise we're fired. That's the deal. Either we work 2 extra hours or we get replaced." }, + { actor: this, text: "Wow... and I thought we have a shortage on engineers..." } ] )); + break; + case 1: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "And how's the business going? Did you manage to shell the shit?" }, + { actor: this, text: "In a heartbeat! Now they're buying so much shit that I'm afraid we don't have enough assholes to produce that quantity." }, + { actor: this, text: "Be prepared for another month of overtimes. This deal will be huge!" }, + { actor: logic.player, text: "Well done, man!" } ] )); + break; + default: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "I really want to leave now." } ] )); + this.offscreenTeleportation(new Phaser.Point(0, 0), this.tpDone, this); + } } } else { @@ -391,7 +417,7 @@ class NPC_Carlos extends GameNPC { } actionLeave() { - if (logic.clara.alive) { + if ((logic.clara.alive) && (logic.peter.talkcount == 0)) { logic.gameinterface.dropNotice(this.shortname + ": Bye, John! Pass on my greetings to Saiki!"); } } @@ -403,7 +429,12 @@ class NPC_Carlos extends GameNPC { } endTalk() { - return (logic.clara.alive) || (this.talkcount < 3); + return ((logic.clara.alive) && (logic.peter.talkcount == 0)) || (this.talkcount < 3); + } + + tpDone(value) { + console.log("Woot-woot! Teleport complete:", value); + value.visible = false; } } @@ -545,6 +576,7 @@ class NPC_Peter extends GameNPC { logic.closeDoor("saikidoor"); logic.openDoor("peterdoor"); logic.openDoor("biancadoor"); + logic.carlos.resetTalk(); break; case 1: logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "See... Would you talk to Bianca? We don't understand each other pretty well. That's why I'd rather wouldn't make a shot." } ] )); -- 2.34.1 From 4ec2bf940a0f1f0ada6a93271ba3789a45e66e49 Mon Sep 17 00:00:00 2001 From: MegaBrutal Date: Sun, 18 Nov 2018 06:40:00 +0100 Subject: [PATCH 3/5] Let Carlos afternoon dialogue triggered by Saiki ... instead of Peter. modified: wgj58.js --- wgj58.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wgj58.js b/wgj58.js index c69dcbe..b98719d 100644 --- a/wgj58.js +++ b/wgj58.js @@ -309,7 +309,7 @@ class NPC_Clara extends GameNPC { class NPC_Carlos extends GameNPC { actionTalk() { if (logic.clara.alive) { - if (logic.peter.talkcount == 0) { + if (logic.saiki.talkcount == 0) { switch (this.talkcount) { case 0: logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "Good morning, Carlos! What's up?" }, @@ -417,7 +417,7 @@ class NPC_Carlos extends GameNPC { } actionLeave() { - if ((logic.clara.alive) && (logic.peter.talkcount == 0)) { + if ((logic.clara.alive) && (logic.saiki.talkcount == 0)) { logic.gameinterface.dropNotice(this.shortname + ": Bye, John! Pass on my greetings to Saiki!"); } } @@ -429,7 +429,7 @@ class NPC_Carlos extends GameNPC { } endTalk() { - return ((logic.clara.alive) && (logic.peter.talkcount == 0)) || (this.talkcount < 3); + return ((logic.clara.alive) && (logic.saiki.talkcount == 0)) || (this.talkcount < 3); } tpDone(value) { @@ -456,6 +456,7 @@ class NPC_Saiki extends GameNPC { logic.closeDoor("carlosdoor"); logic.openDoor("saikidoor"); logic.openDoor("peterdoor"); + logic.carlos.resetTalk(); break; case 1: logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Now that I think about it, there's still one thing. You could look into why the access control system is acting so funny today." }, @@ -576,7 +577,6 @@ class NPC_Peter extends GameNPC { logic.closeDoor("saikidoor"); logic.openDoor("peterdoor"); logic.openDoor("biancadoor"); - logic.carlos.resetTalk(); break; case 1: logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "See... Would you talk to Bianca? We don't understand each other pretty well. That's why I'd rather wouldn't make a shot." } ] )); -- 2.34.1 From f8842b60c0b3ede954647398a9989d51357ef90a Mon Sep 17 00:00:00 2001 From: MegaBrutal Date: Thu, 18 Feb 2021 03:15:15 +0100 Subject: [PATCH 4/5] Add Saiki & Carlos afternoon dialogue modified: wgj58.js --- wgj58.js | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/wgj58.js b/wgj58.js index b98719d..e07d397 100644 --- a/wgj58.js +++ b/wgj58.js @@ -440,6 +440,14 @@ class NPC_Carlos extends GameNPC { class NPC_Saiki extends GameNPC { actionTalk() { + /* If Saiki is happy, she's already teleported to Carlos. */ + if (!this.happy) + this.actionTalk_morning(); + else + this.actionTalk_afternoon(); + } + + actionTalk_morning() { if (logic.carlos.alive) { switch (this.talkcount) { case 0: @@ -535,6 +543,39 @@ class NPC_Saiki extends GameNPC { super.actionTalk(); } + actionTalk_afternoon() { + if (logic.peter.alive) { + switch (this.talkcount) { + case 0: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Oh, hi John!" }, + { actor: logic.carlos, text: "Hey John! Thanks for telling my secret to Saiki..." }, + { actor: logic.player, text: "Really sorry man, but it was so funny!" }, + { actor: logic.carlos, text: "Are you kidding me? It's the best thing you could have ever done!" }, + { actor: this, text: "Yeah, I couldn't resist to come over here to talk about it, haha!" }, + { actor: logic.carlos, text: "And we talked about lots of other stuff too..." }, + { actor: this, text: "WE ASKED EACH OTHER OUT ON A DATE!!!" }, + { actor: logic.carlos, text: "Yeah, Saiki finds gender equality so important that she had to take the role of the initiator, just in the right moment when I asked her out." }, + { actor: this, text: "Oh, shut up! xD" }, + { actor: logic.player, text: "Awesome, I'm so happy for you guys!" }, + { actor: logic.player, text: "... Don't mean to ruin the fun, but have you finished with your work?" }, + { actor: logic.carlos, text: "Who cares? It waits. I can totally sell the shit tomorrow." }, + { actor: this, text: "Yeah, I'll commit my patch tomorrow morning. We definitely deserve some fun!" }, + { actor: logic.player, text: "You say it right! Bye then." } ] )); + break; + default: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "Have a great evening, guys!" } ] )); + } + } + else { + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Oh... hi Peter!..." }, + { actor: this, text: "I wanted to talk to Carlos..." }, + { actor: this, text: "Where is he? I mean, he often leaves early, but..." }, + { actor: this, text: "I can't explain why, but somehow I have a very bad feeling about this. " }, + { actor: logic.player, text: "..." } ] )); + } + super.actionTalk(); + } + actionLeave() { if (logic.carlos.alive) { logic.gameinterface.dropNotice(this.shortname + ": It was nice talking to you!"); @@ -550,12 +591,13 @@ class NPC_Saiki extends GameNPC { } endTalk() { - return (logic.carlos.alive); + return (logic.carlos.alive) && (!this.happy); } tpDone(value) { console.log("Woot-woot! Teleport complete:", value); value.makeHappy(); + value.resetTalk(); logic.carlos.makeHappy(); // FIXME: Need to find a prettier way than this. logic.carlos.update = function() { }; // Disable Carlos' interaction. (Saiki will talk for him.) @@ -642,6 +684,8 @@ class NPC_Peter extends GameNPC { logic.closeDoor("saikidoor"); logic.openDoor("peterdoor"); logic.openDoor("biancadoor"); + logic.carlos.kill(); + if (logic.saiki.talkcount > 0) logic.saiki.kill(); return super.actionTake(); } -- 2.34.1 From 3ebef2cc572aa1f157216eb1b2d08e302e88cd8b Mon Sep 17 00:00:00 2001 From: MegaBrutal Date: Tue, 9 Mar 2021 03:45:00 +0100 Subject: [PATCH 5/5] Add Peter & Clara afternoon dialogue modified: wgj58.js --- wgj58.js | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/wgj58.js b/wgj58.js index e07d397..71b0484 100644 --- a/wgj58.js +++ b/wgj58.js @@ -606,6 +606,14 @@ class NPC_Saiki extends GameNPC { class NPC_Peter extends GameNPC { actionTalk() { + /* If Peter is happy, she's already teleported to Clara. */ + if (!this.happy) + this.actionTalk_morning(); + else + this.actionTalk_afternoon(); + } + + actionTalk_morning() { if (logic.saiki.alive) { switch (this.talkcount) { case 0: @@ -680,6 +688,49 @@ class NPC_Peter extends GameNPC { super.actionTalk(); } + actionTalk_afternoon () { + if (logic.bianca.alive) { + switch (this.talkcount) { + case 0: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Hey John!" }, + { actor: logic.player, text: "Hey, what's up?" }, + { actor: this, text: "I just asked Clara out on a date!" }, + { actor: logic.clara, text: "Shhhsh, don't brag about it! I'm a person, not a prize." }, + { actor: this, text: "Sorry..." }, + { actor: logic.clara, text: "It's OK... Uhm... Sorry, John... I always liked Peter... but when you asked me out, I felt intimidated and a little uncomfortable." } ] )); + break; + case 1: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "I'm sorry, Clara, I didn't mean to be inappropriate... situations like this are always so complicated..." }, + { actor: logic.clara, text: "Never mind, John. I didn't handle it properly either. Apology accepted." }, + { actor: this, text: "Everyone's happy, I guess." }, + { actor: logic.player, text: "Not really. Maybe I'm gonna be fired." }, + { actor: this, text: "Haha, you're a joker!" } ] )); + break; + case 2: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "*Whispers.* Khm, no offense, but it would be nice if you excused yourself and leave. You know how it is..." } ] )); + break; + case 3: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "Oh, time goes so fast... I have to go. Bye!" } ] )); + break; + default: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "..." } ] )); + } + } + else { + switch (this.talkcount) { + case 0: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "..." }, + { actor: logic.clara, text: "..." }, + { actor: logic.player, text: "Hey there!... Uhm... Don't you have anything better to do?" }, + { actor: this, text: "Yeah, I would totally have if you weren't been blocking the meeting room!" } ] )); + break; + default: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "Get back to work! Don't make me say it again!" } ] )); + } + } + super.actionTalk(); + } + actionTake() { logic.closeDoor("saikidoor"); logic.openDoor("peterdoor"); @@ -690,12 +741,13 @@ class NPC_Peter extends GameNPC { } endTalk() { - return (logic.saiki.alive) && (this.talkcount < 3); + return (logic.saiki.alive) && (this.talkcount < 3) && (!this.happy); } tpDone(value) { console.log("Woot-woot! Teleport complete:", value); value.makeHappy(); + value.resetTalk(); logic.clara.makeHappy(); // FIXME: Need to find a prettier way than this. logic.clara.update = function() { }; // Disable Clara's interaction. (Peter will talk for him.) -- 2.34.1