From 411f2853d9a619185ca5d7cdac63e82f0c56415c Mon Sep 17 00:00:00 2001 From: MegaBrutal Date: Sun, 16 Sep 2018 04:40:40 +0200 Subject: [PATCH] Happy value For NPCs, this indicates whether the character's special needs are met. modified: wgj58.js --- wgj58.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wgj58.js b/wgj58.js index 78cd42b..a50e494 100644 --- a/wgj58.js +++ b/wgj58.js @@ -172,11 +172,13 @@ class GameNPC extends Phaser.Sprite { this.interaction_distance = interaction_distance; this.interactable = false; this.talkcount = 0; + this.happy = false; } kill() { super.kill(); this.exists = false; + this.happy = false; // Dead people are not happy. } update() { @@ -215,6 +217,11 @@ class GameNPC extends Phaser.Sprite { return true; } + makeHappy() { + this.happy = true; + console.log(this.shortname, "is happy!"); + } + offscreenTeleportation(newPosition, callback, callbackValue) { this.teleport_instructions = { newPosition: newPosition, callback: callback, callbackValue: callbackValue }; console.log("Offscreen teleport request registered:", this.teleport_instructions); @@ -508,6 +515,8 @@ class NPC_Saiki extends GameNPC { tpDone(value) { console.log("Woot-woot! Teleport complete:", value); + value.makeHappy(); + logic.carlos.makeHappy(); } } -- 2.34.1