@wayward/types 2.14.4-beta.dev.20250330.1 → 2.14.4-beta.dev.20250405.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,4 +13,5 @@ export interface ILootItem {
13
13
  type: ItemType;
14
14
  chance?: number;
15
15
  chanceOutOf?: number;
16
+ difficulty?: number;
16
17
  }
@@ -253,7 +253,7 @@ export default class Doodad extends EntityMovable<IDoodadDescription, DoodadType
253
253
  setOffTrap(human?: Human, withMessage?: boolean, damage?: boolean): void;
254
254
  getGrowthParticles(): IRGB | undefined;
255
255
  /**
256
- * Increased the fertility (spread) of a plant/growing doodad.
256
+ * Increased the fertility (spread) of a plant/growing doodad when its ripening.
257
257
  * @param bypassChange Set to true if you just want to check if fertility can be increased.
258
258
  * @returns True or false depending on if it increased in fertility or not.
259
259
  */
@@ -24,7 +24,10 @@ export interface IEntityCanCreateOptions {
24
24
  allowOverDooadsAndTileEvents?: boolean;
25
25
  blockOnScarecrow?: boolean;
26
26
  }
27
- export default abstract class EntityManager<T extends Entity, IRemoveOptions = undefined> extends ObjectManager<T, IEntityManagerEvents<T>> implements IEntityManager<T> {
27
+ export interface IEntityRemoveOptions {
28
+ keepMarker?: boolean;
29
+ }
30
+ export default abstract class EntityManager<T extends Entity, RemoveOptions extends IEntityRemoveOptions = IEntityRemoveOptions> extends ObjectManager<T, IEntityManagerEvents<T>> implements IEntityManager<T> {
28
31
  /**
29
32
  * Indicates if objects should be re-registered to the memory leak detector after loading
30
33
  */
@@ -34,10 +37,14 @@ export default abstract class EntityManager<T extends Entity, IRemoveOptions = u
34
37
  * @param entity Entity to remove
35
38
  * @returns Return true if this method handled tile updates
36
39
  */
37
- protected abstract onRemove(entity: T, options?: IRemoveOptions): boolean;
40
+ protected abstract onRemove(entity: T, options?: RemoveOptions & IEntityRemoveOptions): boolean;
38
41
  protected abstract loadEntity?(entity: T): void;
39
42
  load(): void;
40
- remove(entity: T, options?: IRemoveOptions): void;
43
+ /**
44
+ * Restores a previous removed entity
45
+ */
46
+ restore(entity: T): void;
47
+ remove(entity: T, options?: RemoveOptions): void;
41
48
  updateFov(humanBounds: IHumanBound[]): void;
42
49
  /**
43
50
  * Checks if the target position is a good spot for a new entity
@@ -12,6 +12,7 @@ import CombatStrengthManager from "@wayward/game/game/entity/CombatStrengthManag
12
12
  import Creature from "@wayward/game/game/entity/creature/Creature";
13
13
  import type { ICreatureCheckMoveOptions } from "@wayward/game/game/entity/creature/ICreature";
14
14
  import { CreatureType, TileGroup } from "@wayward/game/game/entity/creature/ICreature";
15
+ import type { IEntityRemoveOptions } from "@wayward/game/game/entity/EntityManager";
15
16
  import EntityManager from "@wayward/game/game/entity/EntityManager";
16
17
  import type Human from "@wayward/game/game/entity/Human";
17
18
  import { MoveType } from "@wayward/game/game/entity/IEntity";
@@ -30,7 +31,7 @@ export interface ICreatureManagerEvents extends Events<EntityManager<Creature>>
30
31
  */
31
32
  canSpawn(type: CreatureType, tile: Tile, aberrant: boolean): boolean | undefined;
32
33
  }
33
- export default class CreatureManager extends EntityManager<Creature, {
34
+ export default class CreatureManager extends EntityManager<Creature, IEntityRemoveOptions & {
34
35
  remainTamed?: boolean;
35
36
  }> {
36
37
  protected readonly name = "CreatureManager";
@@ -12,6 +12,7 @@ import type { Quality } from "@wayward/game/game/IObject";
12
12
  import type Doodad from "@wayward/game/game/doodad/Doodad";
13
13
  import type DoodadManager from "@wayward/game/game/doodad/DoodadManager";
14
14
  import type { DoodadType, DoodadTypeGroup } from "@wayward/game/game/doodad/IDoodad";
15
+ import type { IEntityRemoveOptions } from "@wayward/game/game/entity/EntityManager";
15
16
  import type { ActionType, IActionNotUsable } from "@wayward/game/game/entity/action/IAction";
16
17
  import type ActionContext from "@wayward/game/game/entity/action/IActionContext";
17
18
  import type { DropAllowProtected } from "@wayward/game/game/entity/action/actions/Drop";
@@ -28,7 +29,7 @@ import type { Direction } from "@wayward/game/utilities/math/Direction";
28
29
  /**
29
30
  * Options when removing an item
30
31
  */
31
- export interface IItemRemoveOptions {
32
+ export interface IItemRemoveOptions extends IEntityRemoveOptions {
32
33
  /**
33
34
  * Defaults to false
34
35
  */