|
@@ -11,7 +11,7 @@ enum RandomLootType {
|
|
|
|
|
|
interface FodderPossibility {
|
|
interface FodderPossibility {
|
|
name : string;
|
|
name : string;
|
|
- description : Say | string;
|
|
|
|
|
|
+ description : Say | string | (() => Say | string | (() => Say | string));
|
|
objects? : Array<Thing>; // Always has these objects
|
|
objects? : Array<Thing>; // Always has these objects
|
|
randomLootChance? : number; // 0 to 100, chance of having loot on top of the 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
|
|
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) {
|
|
public cloneInterface (pos : FodderPossibility) {
|
|
this.name = pos.name;
|
|
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) {
|
|
if (pos.objects != undefined) {
|
|
for (let i = 0; i < pos.objects.length; i++) {
|
|
for (let i = 0; i < pos.objects.length; i++) {
|
|
let object = pos.objects[i];
|
|
let object = pos.objects[i];
|