Add method to reset talk count master
authorMegaBrutal <code+git@megabrutal.com>
Wed, 3 Oct 2018 18:05:25 +0000 (20:05 +0200)
committerMegaBrutal <code+git@megabrutal.com>
Wed, 3 Oct 2018 18:05:25 +0000 (20:05 +0200)
GameNPC.resetTalk(), will be used later.

modified:   wgj58.js

wgj58.js

index 6ec551c..2c503f0 100644 (file)
--- 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!");