Ver Fonte

More flexibility

Reddo há 5 anos atrás
pai
commit
ab3ba0e9d7
1 ficheiros alterados com 2 adições e 2 exclusões
  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];