Sfoglia il codice sorgente

Merge branch 'v0.1.10' of gitlab.com:Isleward/isleward into v0.1.10

tags/v0.1.10^2
Big Bad Waffle 6 anni fa
parent
commit
e5de00d573
1 ha cambiato i file con 12 aggiunte e 0 eliminazioni
  1. +12
    -0
      src/server/components/mob.js

+ 12
- 0
src/server/components/mob.js Vedi File

@@ -35,6 +35,13 @@ define([
if (obj.aggro)
target = obj.aggro.getHighest();

//Have we reached home?
if (this.goHome) {
var distanceFromHome = Math.max(Math.abs(this.originX - obj.x), Math.abs(this.originY - obj.y));
if (distanceFromHome < this.walkDistance)
this.goHome = false;
}

//Are we too far from home?
if ((!this.goHome) && (!obj.follower) && (target)) {
if (!this.canChase(target)) {
@@ -97,6 +104,11 @@ define([
}
});
}

//We use goHometo force followers to follow us around but they should never stay in that state
// since it messes with combat
if (obj.follower)
this.goHome = false;
},
fight: function (target) {
if (this.target != target) {


Caricamento…
Annulla
Salva