@wayward/types 2.15.0-beta.dev.20251004.1 → 2.15.0-beta.dev.20251006.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/curse/Curse.d.ts +23 -18
- package/definitions/game/game/curse/CurseEvent.d.ts +36 -5
- package/definitions/game/game/curse/ICurse.d.ts +10 -1
- package/definitions/game/game/curse/event/CurseEventCraftingInspiration.d.ts +13 -0
- package/definitions/game/game/curse/event/CurseEventLucky.d.ts +13 -0
- package/definitions/game/game/curse/event/CurseEventShadows.d.ts +13 -0
- package/definitions/game/game/curse/event/CurseEventUnlucky.d.ts +13 -0
- package/definitions/game/game/entity/Human.d.ts +2 -0
- package/definitions/game/game/entity/action/actions/Invoke.d.ts +4 -0
- package/definitions/game/game/island/Island.d.ts +2 -0
- package/definitions/game/game/item/Items.d.ts +9 -1
- package/definitions/game/game/options/IGameOptions.d.ts +6 -0
- package/definitions/game/language/dictionary/Message.d.ts +793 -792
- package/definitions/utilities/math/Range.d.ts +8 -0
- package/definitions/utilities/random/Random.d.ts +8 -1
- package/package.json +1 -1
|
@@ -15,11 +15,12 @@ import type Human from "@wayward/game/game/entity/Human";
|
|
|
15
15
|
import { SkillType } from "@wayward/game/game/entity/IHuman";
|
|
16
16
|
import type Island from "@wayward/game/game/island/Island";
|
|
17
17
|
import type { IVector2 } from "@wayward/game/utilities/math/IVector";
|
|
18
|
-
import { IRange } from "@wayward/utilities/math/Range";
|
|
18
|
+
import { IRange, IRangeRange } from "@wayward/utilities/math/Range";
|
|
19
19
|
export declare const CURSE_WEIGHTS: PartialRecord<CurseComponent, number>;
|
|
20
20
|
export declare const CURSE_ATTACK_MAX = 50;
|
|
21
21
|
export declare const CURSE_DEFENSE_MAX = 100;
|
|
22
22
|
export declare const CURSE_CRAFTING_MAX = 100;
|
|
23
|
+
export declare const CURSE_KILLING_MAX = 100;
|
|
23
24
|
export declare const CURSE_SKILL_MAX = 100;
|
|
24
25
|
export declare const CURSE_COMPONENTS: Record<CurseComponent, (human: Human) => number>;
|
|
25
26
|
/**
|
|
@@ -54,15 +55,13 @@ export declare const CURSE_EVENTS_MAELSTROM_SPEED = 1;
|
|
|
54
55
|
* Additional opportunities before the top opportunity always use the max chance.
|
|
55
56
|
*/
|
|
56
57
|
export declare const CURSE_EVENTS_CHANCE: IRange;
|
|
57
|
-
export declare const
|
|
58
|
+
export declare const CURSE_EVENTS_DEFAULT_RADIUS = 25;
|
|
58
59
|
/**
|
|
59
|
-
*
|
|
60
|
-
* Interpolates between the minimum and maximum
|
|
60
|
+
* An IRangeRange for randomly selecting the cooldown time between curse event nights.
|
|
61
|
+
* Interpolates between the minimum and maximum ranges based on the player's curse.
|
|
61
62
|
*/
|
|
62
|
-
export declare const CURSE_EVENTS_COOLDOWN_RANGE:
|
|
63
|
-
|
|
64
|
-
maximum: IRange;
|
|
65
|
-
};
|
|
63
|
+
export declare const CURSE_EVENTS_COOLDOWN_RANGE: IRangeRange;
|
|
64
|
+
export declare const CURSE_EVENTS_FIRST_NIGHT = 3;
|
|
66
65
|
declare namespace Curse {
|
|
67
66
|
interface Helper {
|
|
68
67
|
context: CurseEventContext;
|
|
@@ -70,19 +69,35 @@ declare namespace Curse {
|
|
|
70
69
|
definition: CurseEvent;
|
|
71
70
|
}
|
|
72
71
|
function get(island?: Island, type?: CurseEventType): Helper | undefined;
|
|
72
|
+
function clearCooldown(island: Island): void;
|
|
73
73
|
function tickCurse(island: Island, humans: Human[]): void;
|
|
74
74
|
function reload(island: Island): void;
|
|
75
75
|
function spawnCurseEvents(island: Island, humans: Human[]): void;
|
|
76
76
|
function attemptCurseEventSpawn(category: CurseCategory, human: Human, curse: number, humans: Human[], events: CurseEventInstance[]): CurseEventInstance | undefined;
|
|
77
77
|
function attemptSpecificCurseEventSpawn(human: Human, type: CurseEventType, humans: Human[], curse?: number): CurseEventInstance | undefined;
|
|
78
|
+
function unload(island: Island): void;
|
|
78
79
|
function cleanup(island: Island, humans?: Human[]): void;
|
|
79
80
|
function createCurseEventContext(instance: CurseEventInstance, island: Island, humans?: Human[], cursebearer?: Human): CurseEventContext;
|
|
80
81
|
}
|
|
82
|
+
declare const SYMBOL_CURSE_EVENT_SUBSCRIBER_INSTANCES: unique symbol;
|
|
83
|
+
declare const SYMBOL_CURSE_EVENT_GLOBAL_SUBSCRIBER_INSTANCE: unique symbol;
|
|
81
84
|
interface Curse {
|
|
82
85
|
night?: true;
|
|
83
86
|
events?: CurseEventInstance[];
|
|
84
87
|
cooldown?: number;
|
|
85
88
|
warned?: true;
|
|
89
|
+
[SYMBOL_CURSE_EVENT_GLOBAL_SUBSCRIBER_INSTANCE]?: CurseEventSubscriber;
|
|
90
|
+
}
|
|
91
|
+
interface CurseEventInstance {
|
|
92
|
+
type: CurseEventType;
|
|
93
|
+
display: CurseEventDisplayMode;
|
|
94
|
+
cursebearerIdentifier: string;
|
|
95
|
+
curse: number;
|
|
96
|
+
point: IVector2;
|
|
97
|
+
creatures?: number[];
|
|
98
|
+
subscribers?: string[];
|
|
99
|
+
scriptProcesses?: ScriptProcessState[];
|
|
100
|
+
[SYMBOL_CURSE_EVENT_SUBSCRIBER_INSTANCES]?: Record<string, CurseEventSubscriber>;
|
|
86
101
|
}
|
|
87
102
|
interface ScriptProcessState {
|
|
88
103
|
/** The path of keys/indices from the root of the script to the step this process is currently on. */
|
|
@@ -94,14 +109,4 @@ interface ScriptProcessState {
|
|
|
94
109
|
/** The state of any child processes started by a "simultaneously" or "repeat" block. */
|
|
95
110
|
childProcesses?: ScriptProcessState[];
|
|
96
111
|
}
|
|
97
|
-
declare const SYMBOL_CURSE_EVENT_SUBSCRIBER_INSTANCES: unique symbol;
|
|
98
|
-
interface CurseEventInstance {
|
|
99
|
-
type: CurseEventType;
|
|
100
|
-
display: CurseEventDisplayMode;
|
|
101
|
-
cursebearerIdentifier: string;
|
|
102
|
-
point: IVector2;
|
|
103
|
-
subscribers?: string[];
|
|
104
|
-
scriptProcesses?: ScriptProcessState[];
|
|
105
|
-
[SYMBOL_CURSE_EVENT_SUBSCRIBER_INSTANCES]?: Record<string, CurseEventSubscriber>;
|
|
106
|
-
}
|
|
107
112
|
export default Curse;
|
|
@@ -9,21 +9,40 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import type { BiomeType } from "@wayward/game/game/biome/IBiome";
|
|
12
|
-
import type { CurseGroup, CurseEventDisplayMode, CurseEventType, CurseCategory } from "@wayward/game/game/curse/ICurse";
|
|
12
|
+
import type { CurseGroup, CurseEventDisplayMode, CurseEventType, CurseCategory, CursePosition } from "@wayward/game/game/curse/ICurse";
|
|
13
13
|
import type Human from "@wayward/game/game/entity/Human";
|
|
14
14
|
import type Island from "@wayward/game/game/island/Island";
|
|
15
15
|
import type { IGameOptionsPartial } from "@wayward/game/game/options/IGameOptions";
|
|
16
16
|
import type { TimeString } from "@wayward/game/game/time/ITimeManager";
|
|
17
17
|
import type { IVector2 } from "@wayward/game/utilities/math/IVector";
|
|
18
|
-
import
|
|
18
|
+
import { IRange } from "@wayward/utilities/math/Range";
|
|
19
|
+
import type Tile from "@wayward/game/game/tile/Tile";
|
|
20
|
+
import type Creature from "@wayward/game/game/entity/creature/Creature";
|
|
21
|
+
import type { CreatureType } from "@wayward/game/game/entity/creature/ICreature";
|
|
19
22
|
/** The API that curse events have access to */
|
|
20
23
|
export interface CurseEventContext {
|
|
21
24
|
readonly island: Island;
|
|
25
|
+
/** The epicenter of the curse, based on `CurseEvent.position` */
|
|
22
26
|
readonly point: IVector2;
|
|
23
27
|
/** A number 0-1 of how far through the night it currently is */
|
|
24
28
|
readonly fractionalTime: number;
|
|
29
|
+
/** The human that happened to get the event rolled on them */
|
|
25
30
|
readonly cursebearer: Human | undefined;
|
|
31
|
+
/** The cursebearer's curse at the time the event began */
|
|
32
|
+
readonly curse: number;
|
|
33
|
+
/** The creatures that the event has spawned */
|
|
34
|
+
readonly creatures: Creature[];
|
|
35
|
+
/** Whether the cursebearer is asleep */
|
|
36
|
+
readonly sleeping: boolean;
|
|
37
|
+
/** Get the players nearby the curse. This is based on `CurseEvent.position` and `CurseEvent.radius` */
|
|
26
38
|
getNearbyPlayers(): Human[];
|
|
39
|
+
/** Get a random tile within the curse event's radius. This is based on `CurseEvent.position` and `CurseEvent.radius` */
|
|
40
|
+
getRandomTile(radius?: number): Tile | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Spawn a creature at the given tile using the curse event spawning rules.
|
|
43
|
+
* @param evenWhenAsleep Disable the default functionality of preventing spawns if the cursebearer is asleep
|
|
44
|
+
*/
|
|
45
|
+
spawnCreature(type?: CreatureType, tile?: Tile, evenWhenAsleep?: true): Creature | undefined;
|
|
27
46
|
/**
|
|
28
47
|
* Inject a custom curse event subscriber class into the game.
|
|
29
48
|
* This class *must* be included in `CurseEvent.subscribers`.
|
|
@@ -37,6 +56,17 @@ export interface CurseEventContext {
|
|
|
37
56
|
export interface CurseEvent {
|
|
38
57
|
group: CurseGroup;
|
|
39
58
|
category: CurseCategory;
|
|
59
|
+
/**
|
|
60
|
+
* The chance that this curse event will spawn compared to other events.
|
|
61
|
+
* All curse events default to a weight of 1, so setting this to 0.5 would make it half as likely as any other event.
|
|
62
|
+
*/
|
|
63
|
+
weight?: number;
|
|
64
|
+
position?: CursePosition;
|
|
65
|
+
/**
|
|
66
|
+
* Controls the radius of the curse event. Defaults to the value of `CURSE_EVENTS_DEFAULT_RADIUS` (at time of writing, 25.)
|
|
67
|
+
* This is used for the `CurseEventContext.getRandomTile` and `CurseEventContext.getNearbyPlayers` methods.
|
|
68
|
+
*/
|
|
69
|
+
radius?: number;
|
|
40
70
|
/** A number 0-1 representing the curse level that the randomly selected player must have in order for this curse event to be chosen */
|
|
41
71
|
requiredCurseLevel?: number;
|
|
42
72
|
requiredBiomes?: {
|
|
@@ -50,7 +80,7 @@ export interface CurseEvent {
|
|
|
50
80
|
subscribers?: Array<Class<CurseEventSubscriber>>;
|
|
51
81
|
onStart?(context: CurseEventContext): void;
|
|
52
82
|
onEnd?(context: CurseEventContext): void;
|
|
53
|
-
script?: CurseEventScript;
|
|
83
|
+
script?: CurseEventScript | CurseEventScript.Repeat | CurseEventScript.Simultaneously;
|
|
54
84
|
}
|
|
55
85
|
export declare function CurseEvent(event: CurseEvent): CurseEvent;
|
|
56
86
|
export type CurseEventScript = CurseEventScript.Step[];
|
|
@@ -61,9 +91,9 @@ export declare namespace CurseEventScript {
|
|
|
61
91
|
}
|
|
62
92
|
export interface EndAfter extends CurseEventScriptNodeBase {
|
|
63
93
|
type: "end after";
|
|
64
|
-
ticks: number | IRange
|
|
94
|
+
ticks: SupplierOr<number | IRange, [CurseEventContext]>;
|
|
65
95
|
}
|
|
66
|
-
export function EndAfter(ticks: number | IRange): EndAfter;
|
|
96
|
+
export function EndAfter(ticks: SupplierOr<number | IRange, [CurseEventContext]>): EndAfter;
|
|
67
97
|
export interface EndAt extends CurseEventScriptNodeBase {
|
|
68
98
|
type: "end at";
|
|
69
99
|
time: TimeString;
|
|
@@ -79,6 +109,7 @@ export declare namespace CurseEventScript {
|
|
|
79
109
|
type: "wait";
|
|
80
110
|
end: EndCondition;
|
|
81
111
|
}
|
|
112
|
+
export function Wait(ticks: SupplierOr<number | IRange, [CurseEventContext]>): Wait;
|
|
82
113
|
export function Wait(end: EndCondition): Wait;
|
|
83
114
|
export interface Action extends CurseEventScriptNodeBase {
|
|
84
115
|
type: "action";
|
|
@@ -53,13 +53,22 @@ export declare enum CurseCategory {
|
|
|
53
53
|
*/
|
|
54
54
|
Dependent = 2
|
|
55
55
|
}
|
|
56
|
+
export declare enum CursePosition {
|
|
57
|
+
/** The default value for a curse event. `position` returns the island's center. */
|
|
58
|
+
None = 0,
|
|
59
|
+
/** The curse event spawns in a random location near the cursebearer. */
|
|
60
|
+
Random = 1,
|
|
61
|
+
/** The curse event's position is always directly on the cursebearer. */
|
|
62
|
+
Follow = 2
|
|
63
|
+
}
|
|
56
64
|
export declare enum CurseComponent {
|
|
57
65
|
Skill = 0,
|
|
58
66
|
HighestAttack = 1,
|
|
59
67
|
HighestDefense = 2,
|
|
60
68
|
CumulativeEvilCrafting = 3,
|
|
61
69
|
Equipment = 4,
|
|
62
|
-
Modifier = 5
|
|
70
|
+
Modifier = 5,
|
|
71
|
+
CumulativeKilling = 6
|
|
63
72
|
}
|
|
64
73
|
export declare enum CurseSystemDiscovery {
|
|
65
74
|
CurseFactors = 0,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2025 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 { CurseEvent } from "@wayward/game/game/curse/CurseEvent";
|
|
12
|
+
declare const _default: CurseEvent;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2025 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 { CurseEvent } from "@wayward/game/game/curse/CurseEvent";
|
|
12
|
+
declare const _default: CurseEvent;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2025 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 { CurseEvent } from "@wayward/game/game/curse/CurseEvent";
|
|
12
|
+
declare const _default: CurseEvent;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2025 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 { CurseEvent } from "@wayward/game/game/curse/CurseEvent";
|
|
12
|
+
declare const _default: CurseEvent;
|
|
13
|
+
export default _default;
|
|
@@ -130,6 +130,7 @@ export default abstract class Human<DescriptionType = unknown, TypeType extends
|
|
|
130
130
|
highestAttack?: number;
|
|
131
131
|
highestDefense?: number;
|
|
132
132
|
cumulativeEvilCrafting: number;
|
|
133
|
+
cumulativeKilling: number;
|
|
133
134
|
itemDiscovered: ItemType[];
|
|
134
135
|
/** @deprecated (use the entity itself) */
|
|
135
136
|
readonly inventory: IContainer;
|
|
@@ -255,6 +256,7 @@ export default abstract class Human<DescriptionType = unknown, TypeType extends
|
|
|
255
256
|
getEquippedItem(slot: EquipType, includeDisabled?: true): Item | undefined;
|
|
256
257
|
isOffHandDisabled(): boolean;
|
|
257
258
|
getEquipSlotForItem(item: Item, includeDisabled?: true): EquipType | undefined;
|
|
259
|
+
getFanaticism(deity: Deity): number;
|
|
258
260
|
getCurse(): number;
|
|
259
261
|
canSeePosition(type: CanASeeBType, islandId: IslandId, x: number, y: number, z: number, fieldOfView?: FieldOfView, customRadius?: number): boolean;
|
|
260
262
|
/**
|
|
@@ -8,13 +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 { DeityReal } from "@wayward/game/game/deity/Deity";
|
|
11
12
|
import { Action } from "@wayward/game/game/entity/action/Action";
|
|
12
13
|
import type { IActionUsable } from "@wayward/game/game/entity/action/IAction";
|
|
13
14
|
import { ActionArgument, ActionType } from "@wayward/game/game/entity/action/IAction";
|
|
14
15
|
import type { IInvokeUse } from "@wayward/game/game/item/IItem";
|
|
15
16
|
import type Item from "@wayward/game/game/item/Item";
|
|
17
|
+
import { Milestone } from "@wayward/game/game/milestones/IMilestone";
|
|
16
18
|
export interface IInvokeUsable extends IActionUsable, IInvokeUse {
|
|
17
19
|
rune: Item;
|
|
18
20
|
}
|
|
21
|
+
export declare const DEITY_INVOKE_MILESTONES: Record<DeityReal, Milestone>;
|
|
22
|
+
export declare const RUNE_USE_CHANCE = 1;
|
|
19
23
|
declare const _default: Action<[ActionArgument.Item], ActionType.Invoke, import("../../player/Player").default, void, IInvokeUsable, [Item]>;
|
|
20
24
|
export default _default;
|
|
@@ -174,9 +174,11 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
|
|
|
174
174
|
*/
|
|
175
175
|
private deactivate;
|
|
176
176
|
private gameOptionsCached?;
|
|
177
|
+
private gameOptionsWithoutModifiersCached?;
|
|
177
178
|
/** A game options modifier that always returns an empty array by default, to be injected into */
|
|
178
179
|
getAdditionalGameOptionsSources(): IGameOptionsPartial[];
|
|
179
180
|
getGameOptions(): ImmutableObject<IGameOptions>;
|
|
181
|
+
getGameOptionsWithoutModifiers(): ImmutableObject<IGameOptions>;
|
|
180
182
|
clearGameOptionsCache(): void;
|
|
181
183
|
rename(human: Human, newName: string): void;
|
|
182
184
|
private generatedName?;
|
|
@@ -8,4 +8,12 @@
|
|
|
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
|
-
|
|
11
|
+
import type { QualityNatural } from "@wayward/game/game/IObject";
|
|
12
|
+
import { Quality } from "@wayward/game/game/IObject";
|
|
13
|
+
import { ChaosEffect } from "@wayward/game/game/deity/Chaos";
|
|
14
|
+
import type { IRange } from "@wayward/utilities/math/Range";
|
|
15
|
+
export declare const RUNE_OF_EVIL_SPAWN_COUNT: Record<QualityNatural, IRange>;
|
|
16
|
+
export declare const RUNE_OF_EVIL_MAX_ATTEMPTS = 20;
|
|
17
|
+
export declare const RUNE_OF_GOOD_PACIFY_CHANCE: Record<QualityNatural, number>;
|
|
18
|
+
export declare const RUNE_OF_GOOD_PACIFY_TIME: Record<QualityNatural, IRange>;
|
|
19
|
+
export declare const RUNE_OF_CHAOS_EFFECT_MAP: PartialRecord<Quality, ChaosEffect>;
|
|
@@ -298,6 +298,12 @@ export interface IGameOptionsPlayer {
|
|
|
298
298
|
* TODO: Set to Map<RecipeLevel, number> when we can support maps in milestone modifier overrides?
|
|
299
299
|
*/
|
|
300
300
|
difficultyMultiplier: number;
|
|
301
|
+
/**
|
|
302
|
+
* A multiplier for the chance of magical properties being generated on crafted items.
|
|
303
|
+
*
|
|
304
|
+
* Multiplied with the island's chance for any item being generated with magical properties (which is per-quality.)
|
|
305
|
+
*/
|
|
306
|
+
magicChanceMultiplier: number;
|
|
301
307
|
/**
|
|
302
308
|
* Allow default crafting recipe discovery.
|
|
303
309
|
*/
|