Add Peter & Clara happiness conditions
authorMegaBrutal <code+git@megabrutal.com>
Tue, 25 Sep 2018 13:30:40 +0000 (15:30 +0200)
committerMegaBrutal <code+git@megabrutal.com>
Tue, 25 Sep 2018 13:30:40 +0000 (15:30 +0200)
modified:   wgj58.js

wgj58.js

index 4810116a51023e074e355e27fcfa641d990459d4..66344a869c6aef49a03cbf89359ecd4ac78b4e37 100644 (file)
--- a/wgj58.js
+++ b/wgj58.js
@@ -281,8 +281,6 @@ class NPC_Clara extends GameNPC {
                                        { actor: logic.player, text: "Would you go out on a date with me?" },
                                        { actor: this, text: "..." },
                                        { actor: this, text: "No." } ] ));
                                        { actor: logic.player, text: "Would you go out on a date with me?" },
                                        { actor: this, text: "..." },
                                        { actor: this, text: "No." } ] ));
-                               // FIXME: Clara should have another happy condition.
-                               this.makeHappy();
                                break;
                        default:
                                logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "..." } ] ));
                                break;
                        default:
                                logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "..." } ] ));
@@ -560,6 +558,7 @@ class NPC_Peter extends GameNPC {
                                                        { actor: this, text: "You should know it's against the company etiquette..." },
                                                        { actor: this, text: "Regardless, I don't think she's really mad. You're a cool guy." },
                                                        { actor: logic.player, text: "I hope this will be sorted out... I totally accept her answer, but I wouldn't like her to have negative feelings towards me." } ] ));
                                                        { actor: this, text: "You should know it's against the company etiquette..." },
                                                        { actor: this, text: "Regardless, I don't think she's really mad. You're a cool guy." },
                                                        { actor: logic.player, text: "I hope this will be sorted out... I totally accept her answer, but I wouldn't like her to have negative feelings towards me." } ] ));
+                                               this.offscreenTeleportation(new Phaser.Point(logic.clara.x - 160, logic.clara.y), this.tpDone, this);
                                        }
                                        else {
                                                logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "I'm kind of busy, man." } ] ));
                                        }
                                        else {
                                                logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "I'm kind of busy, man." } ] ));
@@ -613,6 +612,14 @@ class NPC_Peter extends GameNPC {
        endTalk() {
                return (logic.saiki.alive) && (this.talkcount < 3);
        }
        endTalk() {
                return (logic.saiki.alive) && (this.talkcount < 3);
        }
+
+       tpDone(value) {
+               console.log("Woot-woot! Teleport complete:", value);
+               value.makeHappy();
+               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.)
+       }
 }
 
 class NPC_Bianca extends GameNPC {
 }
 
 class NPC_Bianca extends GameNPC {