Reddo hace 5 años
padre
commit
4b564416eb
Se han modificado 2 ficheros con 7 adiciones y 4 borrados
  1. 3 4
      app/World/Classes/AI.ts
  2. 4 0
      app/World/Classes/Things/Person.ts

+ 3 - 4
app/World/Classes/AI.ts

@@ -15,7 +15,7 @@ interface AIOptions {
 }
 
 class AI {
-    public actor : Thing;
+    public actor : Person;
     public wanderer = true;
     public wandersOn : Region;
     public wanderChance = 50;
@@ -171,12 +171,11 @@ class AI {
         }
     }
 
-    // TODO: Make this a rulebook. This happens every time an aggressive action is done.
-    public async getPoked (action : Action) {
+    public getPoked (action : Action) {
         this.reactingTo = action;
         if (this.actor instanceof Person) {
             //AIRules.getPoked(this.actor, action);
-            await AI.reacttoRules.execute({
+            return AI.reacttoRules.execute({
                 noun : this.actor
             }, ...this.extraReacttoRules);
         }

+ 4 - 0
app/World/Classes/Things/Person.ts

@@ -198,4 +198,8 @@ class Person extends Thing implements AttributeBearer, SkillBearer {
         this.getRoom().place(corpse);
         OutOfPlay.removeFromPlay(this);
     }
+
+    public getPoked (action : Action) {
+        return this.AI.getPoked(action);
+    }
 }