@wayward/types 2.13.0-beta.dev.20230402.1 → 2.13.0-beta.dev.20230403.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.
@@ -55,6 +55,7 @@ export declare class Game extends EventEmitter.Host<IGameEvents> {
55
55
  private difficultyOptions;
56
56
  customMilestoneModifiersAllowed: boolean;
57
57
  difficulty: GameMode;
58
+ gameplayModifierData: Record<number, any>;
58
59
  replay: ReplayManager | undefined;
59
60
  saveVersion: string;
60
61
  shouldUpdateTablesAndWeight: boolean;
@@ -12,9 +12,10 @@ import type { IEventEmitter } from "event/EventEmitter";
12
12
  import Doodad from "game/doodad/Doodad";
13
13
  import type Creature from "game/entity/creature/Creature";
14
14
  import type { IDamageInfo } from "game/entity/creature/ICreature";
15
+ import { CreatureType } from "game/entity/creature/ICreature";
15
16
  import EntityWithStats from "game/entity/EntityWithStats";
16
17
  import type { IAttack, ICausesDamage, IEntityConstructorOptions } from "game/entity/IEntity";
17
- import { AttackType, IStatChangeInfo, StatusEffectChangeReason, StatusType } from "game/entity/IEntity";
18
+ import { AttackType, DamageType, IStatChangeInfo, StatusEffectChangeReason, StatusType } from "game/entity/IEntity";
18
19
  import type { ICheckUnderOptions, ICrafted, ICustomizations, IHumanEvents, ILoadOnIslandOptions, IRestData, IVoyageInfo } from "game/entity/IHuman";
19
20
  import { EquipType, RestCancelReason, SkillType } from "game/entity/IHuman";
20
21
  import type { IStat } from "game/entity/IStats";
@@ -115,7 +116,7 @@ export default abstract class Human<TypeType extends number = number> extends En
115
116
  * Flag that will prevent a humans vehicle from showing up until the movement finishews
116
117
  */
117
118
  isMovingSuppressVehicleClientside: boolean;
118
- protected readonly milestonesCollection: import("../options/modifiers/GameplayModifiersManager").GameplayModifiersCollection<import("../options/modifiers/milestone/MilestoneModifier").default, Milestone, import("../options/modifiers/milestone/MilestoneModifier").MilestoneModifierInstance, [(Human<number> | undefined)?]>;
119
+ protected readonly milestonesCollection: import("../options/modifiers/GameplayModifiersManager").GameplayModifiersCollection<import("../options/modifiers/milestone/MilestoneModifier").default, Milestone, import("../options/modifiers/milestone/MilestoneModifier").MilestoneModifierInstance<any>, [(Human<number> | undefined)?]>;
119
120
  protected gameOptionsCached?: IGameOptionsPlayer;
120
121
  protected cachedMovementPenalty?: number;
121
122
  constructor(entityOptions?: IEntityConstructorOptions<TypeType>);
@@ -123,7 +124,7 @@ export default abstract class Human<TypeType extends number = number> extends En
123
124
  abstract createNoteManager(): INoteManager;
124
125
  abstract createMessageManager(): IMessageManager;
125
126
  abstract createQuestManager(): IQuestManager;
126
- abstract addMilestone(milestone: Milestone, data?: number, update?: boolean): void;
127
+ abstract addMilestone(milestone: Milestone, data?: number | string, update?: boolean): void;
127
128
  createSkillManager(): SkillManager;
128
129
  isLocalPlayer(): boolean;
129
130
  getGameOptionsBeforeModifiers(): IGameOptionsPlayer;
@@ -384,6 +385,10 @@ export default abstract class Human<TypeType extends number = number> extends En
384
385
  * Gets this human's current carried weight, scaled down to what it would be without any weight bonuses applied
385
386
  */
386
387
  getScaledWeight(): number;
388
+ hasDiscoveredVulnOrResist(creatureType: CreatureType, damageType: DamageType): boolean;
389
+ discoverVulnOrResist(creatureType: CreatureType, damageType: DamageType): void;
390
+ getDiscoveredVulnsAndResists(): Map<CreatureType, Set<DamageType>>;
391
+ getDiscoveredVulnsAndResists(creatureType: CreatureType): Set<DamageType>;
387
392
  get asCorpse(): undefined;
388
393
  get asCreature(): undefined;
389
394
  get asDoodad(): undefined;
@@ -220,12 +220,16 @@ export declare enum DamageType {
220
220
  export declare module DamageType {
221
221
  function getAll(...damageTypes: DamageType[]): DamageType[];
222
222
  }
223
+ export declare const RESIST_IMMUNITY = 99;
224
+ export declare const RESIST_REGEN = 100;
223
225
  export declare class Defense {
224
226
  base: number;
225
227
  resist: Attributes;
226
228
  vulnerable: Attributes;
227
229
  constructor(base: number);
228
230
  setResistance(damageTypes: DamageType, amount: number): this;
231
+ setImmunity(damageTypes: DamageType): this;
232
+ setRegen(damageTypes: DamageType): this;
229
233
  setVulnerability(damageTypes: DamageType, amount: number): this;
230
234
  copy(): Defense;
231
235
  equals(defense: Defense): boolean;
@@ -239,7 +243,7 @@ declare class AttributesImpl {
239
243
  reset(amount?: number): void;
240
244
  all(): [DamageType, number][];
241
245
  types(): DamageType[];
242
- has(): boolean;
246
+ has(type?: DamageType): boolean;
243
247
  copy(): Attributes;
244
248
  equals(attrs: Attributes): boolean;
245
249
  }
@@ -11,10 +11,10 @@
11
11
  import type { Events } from "event/EventEmitter";
12
12
  import type Doodad from "game/doodad/Doodad";
13
13
  import type { ActionType } from "game/entity/action/IAction";
14
- import type { IDamageInfo } from "game/entity/creature/ICreature";
14
+ import type { CreatureType, IDamageInfo } from "game/entity/creature/ICreature";
15
15
  import type EntityWithStats from "game/entity/EntityWithStats";
16
16
  import type Human from "game/entity/Human";
17
- import type { AttackType } from "game/entity/IEntity";
17
+ import type { AttackType, DamageType } from "game/entity/IEntity";
18
18
  import type { IMovementIntent, WeightStatus } from "game/entity/player/IPlayer";
19
19
  import type { ISkillEvents } from "game/entity/skill/SkillManager";
20
20
  import type { IHasImagePath, Quality } from "game/IObject";
@@ -255,6 +255,9 @@ export interface IHumanEvents extends Events<EntityWithStats>, ISkillEvents {
255
255
  * @param tile Tile the human is now on
256
256
  */
257
257
  setPosition(tile: Tile): void;
258
+ discoverVulnOrResist(creatureType: CreatureType, damageType: DamageType): any;
259
+ hasDiscoveredVulnOrResist(creatureType: CreatureType, damageType: DamageType, defaultState: boolean): boolean | undefined;
260
+ getDiscoveredVulnsAndResists(): Map<CreatureType, Set<DamageType>>;
258
261
  }
259
262
  export interface IHairstyleDescription extends IModdable, IHasImagePath {
260
263
  name: string;
@@ -330,6 +330,7 @@ export interface IDamageOutcome {
330
330
  resistTypes: DamageType[];
331
331
  vulnerable: number;
332
332
  vulnerableTypes: DamageType[];
333
+ immunities: DamageType[];
333
334
  noDamage: boolean;
334
335
  regenerate: number[];
335
336
  soundEffect?: SfxType;
@@ -76,7 +76,7 @@ export declare abstract class InfoProvider extends EventEmitter.Host<IInfoProvid
76
76
  static subtitle(...translations: Array<TranslationGenerator | undefined>): SimpleInfoProvider;
77
77
  static description(...translations: Array<TranslationGenerator | undefined>): SimpleInfoProvider;
78
78
  static text(...translations: Array<TranslationGenerator | undefined>): SimpleInfoProvider;
79
- static list(...translations: Array<TranslationGenerator | undefined>): SimpleInfoProvider;
79
+ static list(...translations: Array<InfoProvider | TranslationGenerator | undefined>): SimpleInfoProvider;
80
80
  static ofComponent(componentSupplier: () => Component): InfoProvider;
81
81
  private displayLevel?;
82
82
  protected component?: Component;
@@ -9,15 +9,16 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import type Creature from "game/entity/creature/Creature";
12
- import type { IInspector } from "game/inspection/IInfoProvider";
12
+ import type { CreatureType } from "game/entity/creature/ICreature";
13
+ import type Human from "game/entity/Human";
13
14
  import { InfoDisplayLevel } from "game/inspection/IInfoProvider";
14
15
  import { InfoProvider } from "game/inspection/InfoProvider";
15
16
  import type { InfoProviderContext } from "game/inspection/InfoProviderContext";
16
- import Translation from "language/Translation";
17
17
  import type { TranslationGenerator } from "ui/component/IComponent";
18
18
  export default class ResistancesAndVulnerabilitiesInfoProvider extends InfoProvider {
19
19
  private readonly creature;
20
- static getTranslation(creature: Creature, inspector: IInspector | undefined, revealer?: Translation, creatureName?: import("../../../../language/impl/TranslationImpl").default): import("../../../../language/impl/TranslationImpl").default | undefined;
20
+ static get(creatureType: CreatureType, human?: Human): import("game/inspection/InfoProvider").SimpleInfoProvider;
21
+ private static translateVulnOrResist;
21
22
  constructor(creature: Creature);
22
23
  getClass(): string[];
23
24
  getDefaultDisplayLevel(): InfoDisplayLevel;
@@ -11,7 +11,9 @@
11
11
  import type { BiomeType } from "game/biome/IBiome";
12
12
  import type Doodad from "game/doodad/Doodad";
13
13
  import type Creature from "game/entity/creature/Creature";
14
+ import type { CreatureType, IDamageOutcome, IDamageOutcomeInput } from "game/entity/creature/ICreature";
14
15
  import type Human from "game/entity/Human";
16
+ import type { Defense } from "game/entity/IEntity";
15
17
  import type NPC from "game/entity/npc/NPC";
16
18
  import type { IIslandTemplate, TickFlag, TileUpdateType } from "game/IGame";
17
19
  import type { MultiplayerLoadingDescription } from "game/meta/Loading";
@@ -87,6 +89,8 @@ export interface IIslandEvents {
87
89
  * @param doodad Doodad that caused the change
88
90
  */
89
91
  portsChanged(doodad: Doodad): any;
92
+ getDefense(defense: Defense | undefined, target: Human | Creature | CreatureType): Defense | undefined;
93
+ calculateAttackOutcome(damageOutcome: IDamageOutcome, input: IDamageOutcomeInput, attackValue: number, defenseValue: number): IDamageOutcome | undefined;
90
94
  }
91
95
  export interface ILegacySeeds {
92
96
  type: SeedType.Legacy;
@@ -58,7 +58,8 @@ export declare enum Milestone {
58
58
  Rouseabout = 46,
59
59
  Murderer = 47,
60
60
  Retailer = 48,
61
- Masochist = 49
61
+ Masochist = 49,
62
+ Multidisciplined = 50
62
63
  }
63
64
  export type ExcludeInternalMilestones<MILESTONE extends Milestone> = PickValueKeys<typeof Milestone, MILESTONE> extends `Internal${string}` ? never : MILESTONE;
64
65
  export declare enum MilestoneVisibility {
@@ -9,6 +9,8 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import EventEmitter from "event/EventEmitter";
12
+ import type { CreatureType } from "game/entity/creature/ICreature";
13
+ import type { DamageType } from "game/entity/IEntity";
12
14
  import type { Game } from "game/Game";
13
15
  import { Milestone, MilestoneVisibility } from "game/milestones/IMilestone";
14
16
  type IMilestoneUpdate = [Milestone, (number | string)?];
@@ -48,6 +50,8 @@ export declare class MilestoneManager extends EventEmitter.Host<IMilestoneEvents
48
50
  isUnlockableInMode(milestone: Milestone, mode?: import("../options/IGameOptions").GameMode): boolean;
49
51
  reset(): void;
50
52
  getDiscovered(milestone: Milestone): (string | number)[] | undefined;
53
+ getDiscoveredResistsAndVulns(): Map<CreatureType, Set<DamageType>>;
54
+ getDiscoveredResistsAndVulns(creatureType: CreatureType): Set<DamageType>;
51
55
  getVisibility(milestone: Milestone): MilestoneVisibility;
52
56
  isDiscovered(milestone: Milestone, data: number | string): boolean;
53
57
  private updateMilestone;
@@ -14,7 +14,7 @@ import type Translation from "language/Translation";
14
14
  import { RandomInstance } from "utilities/random/IRandom";
15
15
  import type { Random } from "utilities/random/Random";
16
16
  import { RandomReference } from "utilities/random/RandomReference";
17
- export declare abstract class GameplayModifierInstance<ID extends number, INSTANCE_ARGS extends any[] = []> {
17
+ export declare abstract class GameplayModifierInstance<ID extends number, INSTANCE_ARGS extends any[] = [], DATA = any> {
18
18
  readonly id: ID;
19
19
  readonly random: Random;
20
20
  protected readonly args: INSTANCE_ARGS;
@@ -26,6 +26,9 @@ export declare abstract class GameplayModifierInstance<ID extends number, INSTAN
26
26
  getTitle(): import("../../../language/impl/TranslationImpl").default;
27
27
  protected abstract getDefaultTitle(): Translation;
28
28
  setTitle(initializer: (defaultTitle: Translation) => Translation): this;
29
+ getData(): DATA | undefined;
30
+ setData(data?: DATA): this;
31
+ clearData(): this;
29
32
  }
30
33
  export type GetModifierInstance<MODIFIER extends GameplayModifier<number, GameplayModifierInstance<number, any[]>, any[]>> = MODIFIER extends GameplayModifier<number, infer INSTANCE, any[]> ? INSTANCE : never;
31
34
  export type GetModifierId<MODIFIER extends GameplayModifier<number, GameplayModifierInstance<number, any[]>, any[]>> = MODIFIER extends GameplayModifier<infer ID, any, any[]> ? ID : never;
@@ -27,7 +27,7 @@ export declare enum MilestoneModifierGroup {
27
27
  Merchants = 10
28
28
  }
29
29
  export declare const milestoneGroupIcons: Record<MilestoneModifierGroup, string>;
30
- export declare class MilestoneModifierInstance extends GameplayModifierInstance<Milestone, [Human?]> {
30
+ export declare class MilestoneModifierInstance<DATA = any> extends GameplayModifierInstance<Milestone, [Human?], DATA> {
31
31
  protected get player(): Human<number> | undefined;
32
32
  isEnabledForPlayer(entity: Entity): boolean;
33
33
  protected getDefaultTitle(): import("../../../../language/impl/TranslationImpl").default;
@@ -45,6 +45,6 @@ export default abstract class MilestoneModifier extends GameplayModifier<Milesto
45
45
  constructor(id?: Milestone);
46
46
  instantiate(id: Milestone, human?: Human): MilestoneModifierInstance | undefined;
47
47
  abstract getOptions(): IGameOptionsPartial;
48
- initialize(instance: MilestoneModifierInstance): MilestoneModifierInstance;
48
+ initialize(instance: MilestoneModifierInstance): MilestoneModifierInstance<any>;
49
49
  abstract getGroup(): MilestoneModifierGroup;
50
50
  }
@@ -0,0 +1,32 @@
1
+ /*!
2
+ * Copyright 2011-2021 Unlok
3
+ * https://www.unlok.ca
4
+ *
5
+ * Credits & Thanks:
6
+ * https://www.unlok.ca/credits-thanks/
7
+ *
8
+ * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
9
+ * https://github.com/WaywardGame/types/wiki
10
+ */
11
+ import type Human from "game/entity/Human";
12
+ import { DamageType, Defense } from "game/entity/IEntity";
13
+ import type Creature from "game/entity/creature/Creature";
14
+ import type { CreatureType, IDamageOutcome, IDamageOutcomeInput } from "game/entity/creature/ICreature";
15
+ import type Player from "game/entity/player/Player";
16
+ import type Island from "game/island/Island";
17
+ import type { Milestone } from "game/milestones/IMilestone";
18
+ import type { IGameOptionsPartial } from "game/options/IGameOptions";
19
+ import MilestoneModifier, { MilestoneModifierGroup, MilestoneModifierInstance } from "game/options/modifiers/milestone/MilestoneModifier";
20
+ export default class Multidisciplined extends MilestoneModifier {
21
+ getOptions(): IGameOptionsPartial;
22
+ getGroup(): MilestoneModifierGroup;
23
+ instantiate(id: Milestone, player?: Player): MultidisciplinedMilestoneModifierInstance | undefined;
24
+ }
25
+ declare class MultidisciplinedMilestoneModifierInstance extends MilestoneModifierInstance<Record<string, Map<CreatureType, Set<DamageType>>>> {
26
+ protected getDefense(island: Island, defense: Defense | undefined, target: Human | Creature | CreatureType): Defense | undefined;
27
+ protected calculateAttackOutcome(island: Island, outcome: IDamageOutcome, input: IDamageOutcomeInput, attackValue: number, defenseValue: number): IDamageOutcome | undefined;
28
+ protected hasDiscoveredVulnOrResist(player: Player, creature: CreatureType, damageType: DamageType): boolean | undefined;
29
+ protected discoverVulnOrResist(player: Player, creature: CreatureType, damageType: DamageType): void;
30
+ protected getDiscoveredVulnsAndResists(player: Player): Map<CreatureType, Set<DamageType>>;
31
+ }
32
+ export {};
@@ -12,14 +12,12 @@ import type Player from "game/entity/player/Player";
12
12
  import type { Milestone } from "game/milestones/IMilestone";
13
13
  import type { IGameOptionsPartial } from "game/options/IGameOptions";
14
14
  import MilestoneModifier, { MilestoneModifierGroup, MilestoneModifierInstance } from "game/options/modifiers/milestone/MilestoneModifier";
15
- import type { Random } from "utilities/random/Random";
16
15
  export default class Retailer extends MilestoneModifier {
17
16
  getOptions(): IGameOptionsPartial;
18
17
  instantiate(id: Milestone, player?: Player): RetailerMilestoneModifierInstance | undefined;
19
18
  getGroup(): MilestoneModifierGroup;
20
19
  }
21
20
  declare class RetailerMilestoneModifierInstance extends MilestoneModifierInstance {
22
- constructor(id: Milestone, random: Random, player?: Player);
23
21
  onSpawnPlayer(player: Player): void;
24
22
  }
25
23
  export {};