فهرست منبع

More flexibility

Reddo 5 سال پیش
والد
کامیت
ab3ba0e9d7
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      app/World/Classes/RandomDungeons/RoomRandomFodder.ts

+ 2 - 2
app/World/Classes/RandomDungeons/RoomRandomFodder.ts

@@ -11,7 +11,7 @@ enum RandomLootType {
 
 interface FodderPossibility {
     name : string;
-    description : Say | string;
+    description : Say | string | (() => Say | string | (() => Say | string));
     objects? : Array<Thing>; // Always has these objects
     randomLootChance? : number; // 0 to 100, chance of having loot on top of the objects
     randomLootType? : RandomLootType; // if randomLootChance succeeds, this will be the type of loot in the room
@@ -26,7 +26,7 @@ class RoomRandomFodder extends RoomRandom {
 
     public cloneInterface (pos : FodderPossibility) {
         this.name = pos.name;
-        this.description = typeof pos.description == "string" ? new Say(pos.description) : pos.description;
+        this.description = !(pos.description instanceof Say)? new Say(pos.description) : pos.description;
         if (pos.objects != undefined) {
             for (let i = 0; i < pos.objects.length; i++) {
                 let object = pos.objects[i];