@wayward/types 2.13.2-beta.dev.20230605.3 → 2.13.2-beta.dev.20230607.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.
- package/definitions/game/game/biome/IBiome.d.ts +13 -0
- package/definitions/game/game/biome/arid/Arid.d.ts +16 -0
- package/definitions/game/game/biome/coastal/Coastal.d.ts +16 -0
- package/definitions/game/game/biome/iceCap/IceCap.d.ts +16 -0
- package/definitions/game/game/biome/volcanic/Volcanic.d.ts +16 -0
- package/definitions/game/game/biome/wetlands/Wetlands.d.ts +16 -0
- package/definitions/game/game/deity/IDeities.d.ts +58 -0
- package/definitions/game/game/entity/Entity.d.ts +2 -1
- package/definitions/game/game/entity/IEntity.d.ts +5 -5
- package/definitions/game/game/entity/IHuman.d.ts +12 -2
- package/definitions/game/game/entity/StatDescriptions.d.ts +38 -0
- package/definitions/game/game/entity/Stats.d.ts +2 -2
- package/definitions/game/game/entity/action/actions/UpdateDirection.d.ts +3 -1
- package/definitions/game/game/inspection/InfoProvider.d.ts +10 -10
- package/definitions/game/game/inspection/infoProviders/stat/AttackInfo.d.ts +2 -5
- package/definitions/game/game/inspection/infoProviders/stat/DefenseInfo.d.ts +2 -5
- package/definitions/game/game/inspection/infoProviders/stat/FerocityInfo.d.ts +18 -0
- package/definitions/game/game/inspection/infoProviders/stat/StatInfo.d.ts +10 -0
- package/definitions/game/game/inspection/inspections/StatInspection.d.ts +4 -2
- package/definitions/game/game/temperature/TemperatureManager.d.ts +1 -0
- package/definitions/game/language/Dictionary.d.ts +92 -91
- package/definitions/game/language/DictionaryMap.d.ts +181 -178
- package/definitions/game/language/dictionary/UiTranslation.d.ts +781 -785
- package/definitions/game/language/english/game/FerocityLevels.d.ts +13 -0
- package/definitions/game/mod/ModRegistry.d.ts +86 -45
- package/definitions/game/ui/input/Bindable.d.ts +12 -0
- package/definitions/game/ui/input/Bindables.d.ts +3 -1
- package/definitions/game/ui/screen/screens/game/static/stats/{Reputation.d.ts → Ferocity.d.ts} +5 -0
- package/definitions/game/ui/screen/screens/game/static/stats/IStatDisplayDescription.d.ts +2 -2
- package/definitions/game/ui/screen/screens/game/static/stats/component/Stat.d.ts +4 -4
- package/definitions/game/utilities/Version.d.ts +1 -0
- package/definitions/game/utilities/enum/IEnum.d.ts +2 -1
- package/definitions/game/utilities/math/Math2.d.ts +13 -2
- package/package.json +1 -1
|
@@ -8,6 +8,8 @@
|
|
|
8
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
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
|
+
import type { WorldZ } from "game/WorldZ";
|
|
12
|
+
import { type FerocityLevelThresholds } from "game/deity/IDeities";
|
|
11
13
|
import type { IBiomeMapGen, MapGenVersions } from "game/mapgen/IMapGen";
|
|
12
14
|
import type { IBiomeTemperature } from "game/temperature/ITemperature";
|
|
13
15
|
import type { TerrainType } from "game/tile/ITerrain";
|
|
@@ -21,6 +23,17 @@ export interface IBiomeDescription extends IModdable {
|
|
|
21
23
|
temperature?: IBiomeTemperature;
|
|
22
24
|
mapGen: MapGenVersions<IBiomeMapGen>;
|
|
23
25
|
fog?: IFogDescription;
|
|
26
|
+
/**
|
|
27
|
+
* A record defining maximum thresholds for each ferocity level.
|
|
28
|
+
*
|
|
29
|
+
* When a layer's ferocity thresholds are not set, thresholds for `WorldZ.Overworld` are used.
|
|
30
|
+
* When no thresholds are set *at all*, {@link DEFAULT_FEROCITY_LEVEL_THRESHOLDS} is used.
|
|
31
|
+
*
|
|
32
|
+
* The current ferocity level is equivalent to the level with the threshold *closest* to the current alignment value, without exceeding it.
|
|
33
|
+
*
|
|
34
|
+
* When no thresholds are applicable, `FerocityLevel.Minimal` is used.
|
|
35
|
+
*/
|
|
36
|
+
ferocity?: PartialRecord<WorldZ, FerocityLevelThresholds>;
|
|
24
37
|
}
|
|
25
38
|
export interface IFogDescription {
|
|
26
39
|
color: IRGB;
|
|
@@ -17,6 +17,22 @@ declare const _default: {
|
|
|
17
17
|
readonly fog: {
|
|
18
18
|
color: import("utilities/Color").IRGB;
|
|
19
19
|
};
|
|
20
|
+
readonly ferocity: {
|
|
21
|
+
1: {
|
|
22
|
+
1: number;
|
|
23
|
+
2: number;
|
|
24
|
+
3: number;
|
|
25
|
+
4: number;
|
|
26
|
+
5: number;
|
|
27
|
+
};
|
|
28
|
+
0: {
|
|
29
|
+
1: number;
|
|
30
|
+
2: number;
|
|
31
|
+
3: number;
|
|
32
|
+
4: number;
|
|
33
|
+
5: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
20
36
|
mapGen: BiomeMapGen;
|
|
21
37
|
temperature: IBiomeTemperature;
|
|
22
38
|
};
|
|
@@ -17,6 +17,22 @@ declare const _default: {
|
|
|
17
17
|
readonly fog: {
|
|
18
18
|
color: import("utilities/Color").IRGB;
|
|
19
19
|
};
|
|
20
|
+
readonly ferocity: {
|
|
21
|
+
1: {
|
|
22
|
+
1: number;
|
|
23
|
+
2: number;
|
|
24
|
+
3: number;
|
|
25
|
+
4: number;
|
|
26
|
+
5: number;
|
|
27
|
+
};
|
|
28
|
+
0: {
|
|
29
|
+
1: number;
|
|
30
|
+
2: number;
|
|
31
|
+
3: number;
|
|
32
|
+
4: number;
|
|
33
|
+
5: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
20
36
|
mapGen: BiomeMapGen;
|
|
21
37
|
temperature: IBiomeTemperature;
|
|
22
38
|
};
|
|
@@ -17,6 +17,22 @@ declare const _default: {
|
|
|
17
17
|
readonly fog: {
|
|
18
18
|
color: import("utilities/Color").IRGB;
|
|
19
19
|
};
|
|
20
|
+
readonly ferocity: {
|
|
21
|
+
1: {
|
|
22
|
+
1: number;
|
|
23
|
+
2: number;
|
|
24
|
+
3: number;
|
|
25
|
+
4: number;
|
|
26
|
+
5: number;
|
|
27
|
+
};
|
|
28
|
+
0: {
|
|
29
|
+
1: number;
|
|
30
|
+
2: number;
|
|
31
|
+
3: number;
|
|
32
|
+
4: number;
|
|
33
|
+
5: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
20
36
|
mapGen: BiomeMapGen;
|
|
21
37
|
temperature: IBiomeTemperature;
|
|
22
38
|
};
|
|
@@ -17,6 +17,22 @@ declare const _default: {
|
|
|
17
17
|
readonly fog: {
|
|
18
18
|
color: import("utilities/Color").IRGB;
|
|
19
19
|
};
|
|
20
|
+
readonly ferocity: {
|
|
21
|
+
1: {
|
|
22
|
+
1: number;
|
|
23
|
+
2: number;
|
|
24
|
+
3: number;
|
|
25
|
+
4: number;
|
|
26
|
+
5: number;
|
|
27
|
+
};
|
|
28
|
+
0: {
|
|
29
|
+
1: number;
|
|
30
|
+
2: number;
|
|
31
|
+
3: number;
|
|
32
|
+
4: number;
|
|
33
|
+
5: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
20
36
|
mapGen: BiomeMapGen;
|
|
21
37
|
temperature: IBiomeTemperature;
|
|
22
38
|
};
|
|
@@ -17,6 +17,22 @@ declare const _default: {
|
|
|
17
17
|
readonly fog: {
|
|
18
18
|
color: import("utilities/Color").IRGB;
|
|
19
19
|
};
|
|
20
|
+
readonly ferocity: {
|
|
21
|
+
1: {
|
|
22
|
+
1: number;
|
|
23
|
+
2: number;
|
|
24
|
+
3: number;
|
|
25
|
+
4: number;
|
|
26
|
+
5: number;
|
|
27
|
+
};
|
|
28
|
+
0: {
|
|
29
|
+
1: number;
|
|
30
|
+
2: number;
|
|
31
|
+
3: number;
|
|
32
|
+
4: number;
|
|
33
|
+
5: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
20
36
|
mapGen: BiomeMapGen;
|
|
21
37
|
temperature: IBiomeTemperature;
|
|
22
38
|
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare enum Deity {
|
|
2
|
+
Evil = 0,
|
|
3
|
+
Neutral = 1,
|
|
4
|
+
Good = 2
|
|
5
|
+
}
|
|
6
|
+
export type RuneChance = [alignment: Deity, chance: number];
|
|
7
|
+
/**
|
|
8
|
+
* The maximum chance of a rune dropping that can come from the base chance.
|
|
9
|
+
* IE, given a maxed chance (1.0), that results in an actual 30% chance of a rune dropping.
|
|
10
|
+
*
|
|
11
|
+
* The base chance is combined with the piety chance in the rune dropping calculation.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DEITY_RUNE_CHANCE_BASE_MAX = 0.3;
|
|
14
|
+
/**
|
|
15
|
+
* The maximum chance of a rune dropping that can come from the Piety skill.
|
|
16
|
+
* IE, if the skill is at 100%, that results in an actual 30% chance of a rune dropping.
|
|
17
|
+
*
|
|
18
|
+
* The piety chance is combined with the base chance in the rune dropping calculation.
|
|
19
|
+
*/
|
|
20
|
+
export declare const DEITY_RUNE_CHANCE_PIETY_MAX = 0.3;
|
|
21
|
+
/**
|
|
22
|
+
* The chance that a rune drop is replaced with a neutral rune drop.
|
|
23
|
+
*/
|
|
24
|
+
export declare const DEITY_RUNE_CHANCE_NEUTRAL = 0.1;
|
|
25
|
+
/**
|
|
26
|
+
* The range of evil alignment gained per night between at start and once it's ramped up.
|
|
27
|
+
*/
|
|
28
|
+
export declare const DEITY_ALIGNMENT_EVIL_NIGHTLY_RAMP_RANGE: import("utilities/math/Range").IRange;
|
|
29
|
+
/**
|
|
30
|
+
* The number of days it takes for nightly evil alignment to fully ramp up.
|
|
31
|
+
*/
|
|
32
|
+
export declare const DEITY_ALIGNMENT_EVIL_NIGHTLY_RAMP_TIME = 10;
|
|
33
|
+
export declare enum DeityAlignmentLevel {
|
|
34
|
+
Neutral = 0,
|
|
35
|
+
AlignedTo = 1,
|
|
36
|
+
ReverentTo = 2,
|
|
37
|
+
AcolyteOf = 3,
|
|
38
|
+
DevotedTo = 4,
|
|
39
|
+
ZealotOf = 5
|
|
40
|
+
}
|
|
41
|
+
export declare enum FerocityLevel {
|
|
42
|
+
Minimal = 0,
|
|
43
|
+
Low = 1,
|
|
44
|
+
Moderate = 2,
|
|
45
|
+
High = 3,
|
|
46
|
+
VeryHigh = 4,
|
|
47
|
+
Nightmare = 5
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* A record defining maximum thresholds for each alignment danger level.
|
|
52
|
+
*
|
|
53
|
+
* The current danger level is the first level above the current alignment value.
|
|
54
|
+
*
|
|
55
|
+
* When no thresholds are applicable, `AlignmentDangerLevel.Minimal` is used.
|
|
56
|
+
*/
|
|
57
|
+
export type FerocityLevelThresholds = Record<Exclude<FerocityLevel, FerocityLevel.Minimal>, number>;
|
|
58
|
+
export declare const DEFAULT_FEROCITY_LEVEL_THRESHOLDS: FerocityLevelThresholds;
|
|
@@ -12,6 +12,7 @@ import type { SfxType } from "audio/IAudio";
|
|
|
12
12
|
import EventEmitter from "event/EventEmitter";
|
|
13
13
|
import type { TileUpdateType } from "game/IGame";
|
|
14
14
|
import { FireType } from "game/IGame";
|
|
15
|
+
import type { WorldZ } from "game/WorldZ";
|
|
15
16
|
import type Doodad from "game/doodad/Doodad";
|
|
16
17
|
import type EntityMovable from "game/entity/EntityMovable";
|
|
17
18
|
import type EntityWithStats from "game/entity/EntityWithStats";
|
|
@@ -45,7 +46,7 @@ export default abstract class Entity<DescriptionType = unknown, TypeType extends
|
|
|
45
46
|
renamed?: string | ISerializedTranslation;
|
|
46
47
|
x: number;
|
|
47
48
|
y: number;
|
|
48
|
-
z:
|
|
49
|
+
z: WorldZ;
|
|
49
50
|
private _data?;
|
|
50
51
|
private _tags?;
|
|
51
52
|
islandId: IslandId;
|
|
@@ -61,17 +61,17 @@ export interface IStatChangeInfo<T = any> {
|
|
|
61
61
|
important?: boolean;
|
|
62
62
|
}
|
|
63
63
|
export declare module IStatChangeInfo {
|
|
64
|
-
/**
|
|
65
|
-
* Creates a stat change info object
|
|
66
|
-
* @param important Marked as "important" if true
|
|
67
|
-
*/
|
|
68
|
-
function get<T = any>(important: boolean): IStatChangeInfo<T>;
|
|
69
64
|
/**
|
|
70
65
|
* Creates a stat change info object
|
|
71
66
|
* @param reasonOrInfo A `StatChangeReason`, or an already created `IStatChangeInfo` object.
|
|
72
67
|
* @param important Whether this change should be marked as important
|
|
73
68
|
*/
|
|
74
69
|
function get<T = any>(reasonOrInfo: StatChangeReason | IStatChangeInfo, important?: boolean): IStatChangeInfo<T>;
|
|
70
|
+
/**
|
|
71
|
+
* Creates a stat change info object
|
|
72
|
+
* @param important Marked as "important" if true
|
|
73
|
+
*/
|
|
74
|
+
function get<T = any>(important: boolean): IStatChangeInfo<T>;
|
|
75
75
|
}
|
|
76
76
|
export declare enum StatusType {
|
|
77
77
|
Bleeding = 0,
|
|
@@ -311,11 +311,21 @@ export declare const EQUIP_SLOTS_FREE: EquipType[];
|
|
|
311
311
|
export declare const EQUIP_SLOT_ITEM_GROUPS: Record<EquipType, ItemTypeGroup | undefined>;
|
|
312
312
|
export declare const equipmentRenderOrder: EquipType[];
|
|
313
313
|
export type InsulationWeight = number | [number, "onlyWhenEquipped"];
|
|
314
|
-
export declare const equipSlotInsulationWeights: Record<TempType,
|
|
314
|
+
export declare const equipSlotInsulationWeights: Record<TempType, PartialRecord<EquipType, InsulationWeight>>;
|
|
315
315
|
export interface IExcludedWhenLowering {
|
|
316
316
|
excludeIfLowering: true;
|
|
317
317
|
}
|
|
318
|
-
|
|
318
|
+
/**
|
|
319
|
+
* @param weight The weight of this slot in the calculation. Compare this number to the weights of other slots.
|
|
320
|
+
* @param insulation The insulation value of the item in this slot.
|
|
321
|
+
* @param excluded Whether this slot's insulation should be excluded if it lowers the resulting insulation value.
|
|
322
|
+
*/
|
|
323
|
+
export type CalculatedEquipSlotInsulation = [
|
|
324
|
+
weight: number,
|
|
325
|
+
insulation: number,
|
|
326
|
+
excluded?: IExcludedWhenLowering
|
|
327
|
+
];
|
|
328
|
+
export declare function calculateEquipSlotInsulation(type: TempType, slot: EquipType, equipped?: Item): CalculatedEquipSlotInsulation;
|
|
319
329
|
export declare const insulationRangeWhenSwimming: Record<TempType, IRange>;
|
|
320
330
|
export declare enum HairColor {
|
|
321
331
|
"#e7c978" = 0,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2023 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 { Stat } from "game/entity/IStats";
|
|
13
|
+
export interface IStatGainInfo {
|
|
14
|
+
amount?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface IStatDescription {
|
|
17
|
+
/**
|
|
18
|
+
* A multiplier for stat gain
|
|
19
|
+
*/
|
|
20
|
+
gainMultiplier?: number;
|
|
21
|
+
/**
|
|
22
|
+
* When a human "gains" stat (ie from skill use), if this method is defined, it will be called.
|
|
23
|
+
* @param human The human that "gains" stat
|
|
24
|
+
* @param gainAmount The amount to gain. This will usually be 1. You should respect this if possible.
|
|
25
|
+
* @returns Whether the stat was truly gained
|
|
26
|
+
*
|
|
27
|
+
* **Note:** When implementing this, it is recommended to use
|
|
28
|
+
*/
|
|
29
|
+
gain?(human: Human, gainAmount: number): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* When a human performs an action that has a chance of raising a stat, the chance is `1 / getGainChanceOffset()`
|
|
32
|
+
*
|
|
33
|
+
* When `getGainChanceOffset` is not implemented, the stat max will be used instead.
|
|
34
|
+
* When the stat is not an `IStatMax`, the current value will be used instead.
|
|
35
|
+
*/
|
|
36
|
+
getGainChanceOffset?(human: Human, defaultGainChanceOffset: number): number;
|
|
37
|
+
}
|
|
38
|
+
export declare const statDescriptions: PartialRecord<Stat, IStatDescription>;
|
|
@@ -52,7 +52,7 @@ export default class Stats<T extends IStatHost> {
|
|
|
52
52
|
/**
|
|
53
53
|
* Returns the value of the given stat, or `undefined` if the stat does not exist. Stat bonus is *not* applied.
|
|
54
54
|
*/
|
|
55
|
-
getBaseValue(stat: Stat | IStat): number | undefined;
|
|
55
|
+
getBaseValue(stat: Stat | IStat, allowFailure?: boolean): number | undefined;
|
|
56
56
|
/**
|
|
57
57
|
* Sets the given `Stat`'s value to the given amount. Assumes the given value includes any bonus. Triggers `statChange`
|
|
58
58
|
* @param stat The `Stat` to set.
|
|
@@ -110,7 +110,7 @@ export default class Stats<T extends IStatHost> {
|
|
|
110
110
|
/**
|
|
111
111
|
* Returns the `max` of the given stat, or undefined if the stat isn't an `IStatMax`. Stat bonus is *not* applied.
|
|
112
112
|
*/
|
|
113
|
-
getBaseMax(stat: Stat | IStat): number | undefined;
|
|
113
|
+
getBaseMax(stat: Stat | IStat, allowFailure?: boolean): number | undefined;
|
|
114
114
|
/**
|
|
115
115
|
* Sets the given `Stat`'s `max` to the given amount. Triggers `statMaxChange`
|
|
116
116
|
* @param stat The `Stat` to set.
|
|
@@ -10,8 +10,10 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { Action } from "game/entity/action/Action";
|
|
12
12
|
import { ActionArgument } from "game/entity/action/IAction";
|
|
13
|
+
import type Human from "game/entity/Human";
|
|
13
14
|
import { Direction } from "utilities/math/Direction";
|
|
14
|
-
declare const _default: Action<[ActionArgument.Direction, [ActionArgument.Integer32, ActionArgument.Undefined]],
|
|
15
|
+
declare const _default: Action<[ActionArgument.Direction, [ActionArgument.Integer32, ActionArgument.Undefined]], Human<number>, void, {
|
|
15
16
|
usable: true;
|
|
16
17
|
}, [Direction.None | Direction.East | Direction.North | Direction.West | Direction.South, (number | undefined)?]>;
|
|
17
18
|
export default _default;
|
|
19
|
+
export declare function UpdateDirectionInternal(human: Human, direction: Direction.Cardinal): void;
|
|
@@ -78,10 +78,10 @@ export declare abstract class InfoProvider extends EventEmitter.Host<IInfoProvid
|
|
|
78
78
|
static create(...translations: TranslationGenerator[]): SimpleInfoProvider;
|
|
79
79
|
static dynamic<T>(observer: InfoProvider.Observer<T>, supplier: (value: T) => InfoProvider | undefined): SimpleInfoProvider;
|
|
80
80
|
static of(...classes: string[]): SimpleInfoProvider;
|
|
81
|
-
static title(...translations: Array<TranslationGenerator | undefined>): SimpleInfoProvider;
|
|
82
|
-
static subtitle(...translations: Array<TranslationGenerator | undefined>): SimpleInfoProvider;
|
|
83
|
-
static description(...translations: Array<TranslationGenerator | undefined>): SimpleInfoProvider;
|
|
84
|
-
static text(...translations: Array<TranslationGenerator | undefined>): SimpleInfoProvider;
|
|
81
|
+
static title(...translations: Array<InfoProvider | TranslationGenerator | undefined>): SimpleInfoProvider;
|
|
82
|
+
static subtitle(...translations: Array<InfoProvider | TranslationGenerator | undefined>): SimpleInfoProvider;
|
|
83
|
+
static description(...translations: Array<InfoProvider | TranslationGenerator | undefined>): SimpleInfoProvider;
|
|
84
|
+
static text(...translations: Array<InfoProvider | TranslationGenerator | undefined>): SimpleInfoProvider;
|
|
85
85
|
static list(...translations: Array<InfoProvider | TranslationGenerator | undefined>): SimpleInfoProvider;
|
|
86
86
|
static ofComponent(componentSupplier: () => Component): InfoProvider;
|
|
87
87
|
private displayLevel?;
|
|
@@ -109,21 +109,21 @@ export declare abstract class InfoProvider extends EventEmitter.Host<IInfoProvid
|
|
|
109
109
|
/**
|
|
110
110
|
* Marks this info provider as to subscribe refresh events to the given host.
|
|
111
111
|
* Note: Any existing initialized components will not be retroactively subscribed.
|
|
112
|
-
* @param predicate A predicate function for whether or not this info provider should actually refresh when the event is hit
|
|
113
112
|
*/
|
|
114
|
-
subscribeRefreshOn<E extends EmitterOrBus
|
|
113
|
+
subscribeRefreshOn<E extends EmitterOrBus>(emitterOrBus: E, ...events: Array<Event<E>>): this;
|
|
114
|
+
subscribeRefreshOn<E extends Emitter, K extends Event<E>>(emitter: WeakRef<E>, ...events: Array<Event<E>>): this;
|
|
115
115
|
/**
|
|
116
116
|
* Marks this info provider as to subscribe refresh events to the given host.
|
|
117
117
|
* Note: Any existing initialized components will not be retroactively subscribed.
|
|
118
|
-
* @param
|
|
118
|
+
* @param predicate A predicate function for whether or not this info provider should actually refresh when the event is hit
|
|
119
119
|
*/
|
|
120
|
-
subscribeRefreshOn<E extends EmitterOrBus, K extends Event<E>>(emitterOrBus: E, ...args: [...events: K[],
|
|
120
|
+
subscribeRefreshOn<E extends EmitterOrBus, K extends Event<E>>(emitterOrBus: E, ...args: [...events: K[], predicate: (...params: Parameters<Handler<E, K>>) => boolean]): this;
|
|
121
121
|
/**
|
|
122
122
|
* Marks this info provider as to subscribe refresh events to the given host.
|
|
123
123
|
* Note: Any existing initialized components will not be retroactively subscribed.
|
|
124
|
+
* @param observer An observer that will only trigger a refresh if the value has changed
|
|
124
125
|
*/
|
|
125
|
-
subscribeRefreshOn<E extends EmitterOrBus
|
|
126
|
-
subscribeRefreshOn<E extends Emitter, K extends Event<E>>(emitter: WeakRef<E>, ...events: K[]): this;
|
|
126
|
+
subscribeRefreshOn<E extends EmitterOrBus>(emitterOrBus: E, ...args: [...events: Array<Event<E>>, observer: InfoProvider.Observer<any>]): this;
|
|
127
127
|
/**
|
|
128
128
|
* Call when this info provider should be refreshed.
|
|
129
129
|
*/
|
|
@@ -8,12 +8,9 @@
|
|
|
8
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
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
|
-
import type Human from "game/entity/Human";
|
|
12
|
-
import { InfoProvider } from "game/inspection/InfoProvider";
|
|
13
11
|
import LabelledValue from "game/inspection/infoProviders/LabelledValue";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
constructor(human?: Human<number> | undefined);
|
|
12
|
+
import { StatInfo } from "game/inspection/infoProviders/stat/StatInfo";
|
|
13
|
+
export default class AttackInfo extends StatInfo {
|
|
17
14
|
getClass(): string[];
|
|
18
15
|
get(): (import("game/inspection/InfoProvider").SimpleInfoProvider | LabelledValue)[];
|
|
19
16
|
private getTactics;
|
|
@@ -8,12 +8,9 @@
|
|
|
8
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
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
|
-
import type Human from "game/entity/Human";
|
|
12
|
-
import { InfoProvider } from "game/inspection/InfoProvider";
|
|
13
11
|
import LabelledValue from "game/inspection/infoProviders/LabelledValue";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
constructor(human?: Human<number> | undefined);
|
|
12
|
+
import { StatInfo } from "game/inspection/infoProviders/stat/StatInfo";
|
|
13
|
+
export default class DefenseInfo extends StatInfo {
|
|
17
14
|
getClass(): string[];
|
|
18
15
|
get(): LabelledValue[];
|
|
19
16
|
private getInsulationSlots;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Stat } from "game/entity/IStats";
|
|
2
|
+
import type { SimpleInfoProvider } from "game/inspection/InfoProvider";
|
|
3
|
+
import { InfoProvider } from "game/inspection/InfoProvider";
|
|
4
|
+
import LabelledValue from "game/inspection/infoProviders/LabelledValue";
|
|
5
|
+
import { StatInfo } from "game/inspection/infoProviders/stat/StatInfo";
|
|
6
|
+
export default class FerocityInfo extends StatInfo {
|
|
7
|
+
readonly averageReputation: InfoProvider.Observer<number | undefined>;
|
|
8
|
+
readonly reputation: InfoProvider.Observer<number>;
|
|
9
|
+
readonly benignity: InfoProvider.Observer<number>;
|
|
10
|
+
readonly malignity: InfoProvider.Observer<number>;
|
|
11
|
+
readonly score: InfoProvider.Observer<number>;
|
|
12
|
+
readonly civilizationScore: InfoProvider.Observer<number>;
|
|
13
|
+
readonly turns: InfoProvider.Observer<number>;
|
|
14
|
+
readonly ticks: InfoProvider.Observer<number>;
|
|
15
|
+
getTitle(stat: Stat): SimpleInfoProvider;
|
|
16
|
+
getClass(): string[];
|
|
17
|
+
get(): (SimpleInfoProvider | LabelledValue)[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type Human from "game/entity/Human";
|
|
2
|
+
import type { Stat } from "game/entity/IStats";
|
|
3
|
+
import { InfoProvider } from "game/inspection/InfoProvider";
|
|
4
|
+
export declare abstract class StatInfo extends InfoProvider {
|
|
5
|
+
static getTitle(stat: Stat): import("game/inspection/InfoProvider").SimpleInfoProvider;
|
|
6
|
+
private readonly _human;
|
|
7
|
+
protected get human(): Human<number> | undefined;
|
|
8
|
+
constructor(human: Human);
|
|
9
|
+
getTitle(stat: Stat): import("game/inspection/InfoProvider").SimpleInfoProvider;
|
|
10
|
+
}
|
|
@@ -8,15 +8,17 @@
|
|
|
8
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
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
|
+
import type Human from "game/entity/Human";
|
|
11
12
|
import { Stat } from "game/entity/IStats";
|
|
12
13
|
import { InspectType } from "game/inspection/IInspection";
|
|
13
|
-
import { InfoProvider } from "game/inspection/InfoProvider";
|
|
14
|
+
import type { InfoProvider } from "game/inspection/InfoProvider";
|
|
14
15
|
import type { InfoProviderContext } from "game/inspection/InfoProviderContext";
|
|
15
16
|
import Inspection from "game/inspection/Inspection";
|
|
16
17
|
import type { TranslationGenerator } from "ui/component/IComponent";
|
|
17
18
|
export default class StatInspection extends Inspection<Stat> {
|
|
18
19
|
static handles: (type: InspectType, value: unknown, context?: InfoProviderContext | undefined) => boolean;
|
|
19
|
-
private readonly
|
|
20
|
+
private readonly _human?;
|
|
21
|
+
protected get human(): Human<number> | undefined;
|
|
20
22
|
constructor([, stat]: [any, Stat], context?: InfoProviderContext);
|
|
21
23
|
getId(): string;
|
|
22
24
|
getBorder(): string;
|
|
@@ -59,6 +59,7 @@ export default class TemperatureManager extends EventEmitter.Host<ITemperatureMa
|
|
|
59
59
|
private temperatureBoundaryMax;
|
|
60
60
|
temperatureBoundaryMaxVector: Vector2;
|
|
61
61
|
constructor(island: Island);
|
|
62
|
+
clearAll(): void;
|
|
62
63
|
/**
|
|
63
64
|
* Called after the island map size is configured
|
|
64
65
|
*/
|