Reddo 5 роки тому
батько
коміт
4b564416eb
2 змінених файлів з 7 додано та 4 видалено
  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);
+    }
 }