@wayward/types 2.14.0-beta.dev.20240325.1 → 2.14.0-beta.dev.20240327.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.
@@ -1,3 +1,13 @@
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
+ */
1
11
  import type Human from "@wayward/game/game/entity/Human";
2
12
  import { SkillType } from "@wayward/game/game/entity/IHuman";
3
13
  export declare enum CurseComponent {
@@ -389,7 +389,7 @@ export default abstract class Human<TypeType extends number = number, EntityRefe
389
389
  getBarteringBonus(baseCredits: number): number;
390
390
  getProducedTemperature(): number | undefined;
391
391
  getInsulation(type: TempType): number;
392
- resetStatTimers(type?: StatChangeCurrentTimerStrategy): void;
392
+ resetStatTimers(type?: StatChangeCurrentTimerStrategy, isNPC?: boolean): void;
393
393
  resetChangeTimers(): void;
394
394
  private getBaseStatBonuses;
395
395
  protected getApplicableStatusEffects(): Set<StatusType> | undefined;
@@ -54,7 +54,8 @@ export declare enum Stat {
54
54
  Happiness = 14,
55
55
  Tamed = 15,
56
56
  Petting = 16,
57
- Waste = 17
57
+ Waste = 17,
58
+ Petted = 18
58
59
  }
59
60
  export type IStats = {
60
61
  [key in keyof typeof Stat]: IStat;
@@ -18,6 +18,7 @@ import type Human from "@wayward/game/game/entity/Human";
18
18
  import type { IEntityConstructorOptions, IStatChangeInfo } from "@wayward/game/game/entity/IEntity";
19
19
  import { AiType, Defense, EntityType, MoveType } from "@wayward/game/game/entity/IEntity";
20
20
  import type { IStat } from "@wayward/game/game/entity/IStats";
21
+ import { ActionType } from "@wayward/game/game/entity/action/IAction";
21
22
  import type { CreatureAttackOutcome, CreatureType, ICreatureAttackOutcomeAttack, ICreatureCheckMoveOptions, ICreatureDescription, ICreatureEvents, IDamageInfo, IHitch } from "@wayward/game/game/entity/creature/ICreature";
22
23
  import type Corpse from "@wayward/game/game/entity/creature/corpse/Corpse";
23
24
  import type NPC from "@wayward/game/game/entity/npc/NPC";
@@ -93,7 +94,15 @@ export default class Creature extends EntityWithStats<ICreatureDescription, Crea
93
94
  checkForBurn(moveType?: MoveType): boolean;
94
95
  private setOwner;
95
96
  tame(human: Human, bonus?: number): boolean;
97
+ /**
98
+ * Increases the creature's maximum health in the event of offering/re-taming and petting (to a lesser extent)
99
+ */
100
+ increaseMaxHealth(action: ActionType): void;
96
101
  increaseTamedCount(): void;
102
+ /**
103
+ * Increases the number of times the creature has been petted.
104
+ */
105
+ increasePettedCount(): void;
97
106
  release(remainTamed?: boolean): boolean;
98
107
  unhitch(): void;
99
108
  animateSpawn(): void;
@@ -163,6 +172,11 @@ export default class Creature extends EntityWithStats<ICreatureDescription, Crea
163
172
  * @returns number if the creature has been tamed (0 if it has never been tamed).
164
173
  */
165
174
  get timesTamed(): number;
175
+ /**
176
+ * Returns the times a creature has been petted.
177
+ * @returns number if the creature has been petted (0 if it has never been petted).
178
+ */
179
+ get timesPetted(): number;
166
180
  private findHumansWithinRadius;
167
181
  private shouldSpecialAttack;
168
182
  private specialAttack;
@@ -450,6 +450,9 @@ export declare const CREATURE_FLEE_DISTANCE_SQ: number;
450
450
  export declare const TAMED_CREATURE_FOLLOW_CLOSE_DISTANCE = 1;
451
451
  export declare const TAMED_CREATURE_FOLLOW_FAR_DISTANCE = 6;
452
452
  export declare const settableAiTypes: Set<AiType>;
453
+ export declare const CREATURE_MAX_HEALTH_BONUS_TAME = 1.1;
454
+ export declare const CREATURE_MAX_HEALTH_BONUS_OFFER = 1.05;
455
+ export declare const CREATURE_MAX_HEALTH_BONUS_PET = 1.01;
453
456
  export interface ICreatureAttackOutcomeBase {
454
457
  enemy?: Human | Creature;
455
458
  willAttack: boolean;
@@ -90,7 +90,7 @@ export default abstract class NPC extends Human<NPCType, ReferenceType.NPC> {
90
90
  * @returns True if an npc can move / attack / do other things while not in anyones field of view
91
91
  */
92
92
  protected canUpdateOutsideFov(): boolean;
93
- protected runCommonProcesses(inventoryItems: Item[]): boolean;
93
+ protected runCommonProcesses(inventoryItems: Item[]): number | undefined;
94
94
  kill(): boolean;
95
95
  isHostile(): boolean;
96
96
  isWaiting(): boolean;
@@ -84,7 +84,7 @@ export interface IGameOptions {
84
84
  */
85
85
  spawnRateMultiplier: number;
86
86
  /**
87
- * Multiplier for how much max/min HP bonus is given on each tame
87
+ * Multiplier for how much max/min HP bonus is given on each tame/offer/pet
88
88
  */
89
89
  tameHealthMultiplier: number;
90
90
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wayward/types",
3
3
  "description": "TypeScript declarations for Wayward, used for modding.",
4
- "version": "2.14.0-beta.dev.20240325.1",
4
+ "version": "2.14.0-beta.dev.20240327.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",