@falloutmp/types 0.2.0 → 0.2.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/generated/server-api.d.ts +87 -0
- package/package.json +1 -1
|
@@ -254,6 +254,27 @@ declare global {
|
|
|
254
254
|
/** Names of native events available in this scripting environment. */
|
|
255
255
|
type EventName = keyof EventMap;
|
|
256
256
|
|
|
257
|
+
/**
|
|
258
|
+
* The game this server runs, and the systems only some games have.
|
|
259
|
+
*/
|
|
260
|
+
const Game: {
|
|
261
|
+
/**
|
|
262
|
+
* The game, as server.json's `mod.game` names it.
|
|
263
|
+
*/
|
|
264
|
+
readonly id: "fo4" | "fo76";
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* The game's display name: "Fallout 4" or "Fallout 76".
|
|
268
|
+
*/
|
|
269
|
+
readonly name: string;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Whether this game has the system. Settlements, companions, the perk chart and the SPECIAL creation menu are Fallout 4's; C.A.M.P., perk cards, teams and mutations are Fallout 76's. Every other binding exists on both.
|
|
273
|
+
* @param feature A system only some games have.
|
|
274
|
+
*/
|
|
275
|
+
has(feature: "settlements" | "companions" | "perkChart" | "specialMenu" | "camp" | "perkCards" | "teams" | "mutations"): boolean;
|
|
276
|
+
};
|
|
277
|
+
|
|
257
278
|
/**
|
|
258
279
|
* Where a player is: the worldspace it stands in, or the interior cell, which has none.
|
|
259
280
|
*/
|
|
@@ -804,6 +825,40 @@ declare global {
|
|
|
804
825
|
*/
|
|
805
826
|
static xpForLevel(level: number): number;
|
|
806
827
|
|
|
828
|
+
/**
|
|
829
|
+
* The factions the server put the player in, each with its rank. The factions their character holds from the game's own data, such as PlayerFaction, are not listed.
|
|
830
|
+
* @returns One entry per faction, in the order they were joined; empty when the player is gone.
|
|
831
|
+
*/
|
|
832
|
+
getFactions(): { faction: number; rank: number }[];
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* The player's rank in a faction the server put them in.
|
|
836
|
+
* @param faction A TESFaction form ID, as a number or hex string.
|
|
837
|
+
* @returns The rank; null when the server did not put them in it.
|
|
838
|
+
*/
|
|
839
|
+
getFactionRank(faction: number | string): number | null;
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* Puts the player in a faction at a rank, or re-ranks them, as `Actor.SetFactionRank` does: their own game and every other player's give their character the membership, so the game's hostility follows it. NPCs of the faction and its allies treat them as one of their own; its enemies attack them. Up to 16 factions per player; whether a player's hits on another land stays `playerHit`'s say.
|
|
843
|
+
* @param faction A TESFaction form ID, as a number or hex string.
|
|
844
|
+
* @param rank 0 to 127; 0 when left out.
|
|
845
|
+
* @returns True when set; false when the player is gone or already in 16 factions.
|
|
846
|
+
*/
|
|
847
|
+
setFactionRank(faction: number | string, rank?: number): boolean;
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* Takes the player out of a faction the server put them in, as `Actor.RemoveFromFaction` does.
|
|
851
|
+
* @param faction A TESFaction form ID, as a number or hex string.
|
|
852
|
+
* @returns True when they were in it; false otherwise or when the player is gone.
|
|
853
|
+
*/
|
|
854
|
+
removeFromFaction(faction: number | string): boolean;
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* Takes the player out of every faction the server put them in. The factions their character holds from the game's own data stay.
|
|
858
|
+
* @returns True when sent; false when the player is gone.
|
|
859
|
+
*/
|
|
860
|
+
removeFromAllFactions(): boolean;
|
|
861
|
+
|
|
807
862
|
/**
|
|
808
863
|
* Every connected player.
|
|
809
864
|
* @returns One handle per player, in no particular order.
|
|
@@ -1052,6 +1107,38 @@ declare global {
|
|
|
1052
1107
|
inventory: { form: string; count: number }[];
|
|
1053
1108
|
}
|
|
1054
1109
|
|
|
1110
|
+
/**
|
|
1111
|
+
* How the game's factions react to each other, on every client. Combined with `Player.setFactionRank` it decides who the game treats as friend or foe: NPCs, turrets and companions alike.
|
|
1112
|
+
*/
|
|
1113
|
+
const Faction: {
|
|
1114
|
+
/**
|
|
1115
|
+
* How one faction reacts to another, where the server overrides it.
|
|
1116
|
+
* @param faction A TESFaction form ID, as a number or hex string.
|
|
1117
|
+
* @param other The faction it reacts to, as a number or hex string.
|
|
1118
|
+
* @returns The reaction; null when the game's data files decide.
|
|
1119
|
+
*/
|
|
1120
|
+
getReaction(faction: number | string, other: number | string): "neutral" | "enemy" | "ally" | "friend" | null;
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* Overrides how one faction reacts to another on every client, as `Faction.SetAlly` and `Faction.SetEnemy` do, until it is cleared or the server stops. A faction can be its own enemy. Up to 64 directions are overridden at once.
|
|
1124
|
+
* @param faction A TESFaction form ID, as a number or hex string.
|
|
1125
|
+
* @param other The faction it reacts to, as a number or hex string.
|
|
1126
|
+
* @param reaction Enemies fight on sight; allies and friends help each other, friends also in combat.
|
|
1127
|
+
* @param mutual Both directions, as `Faction.SetAlly` and `Faction.SetEnemy` do; true when left out.
|
|
1128
|
+
* @returns True when set; false when the table is full.
|
|
1129
|
+
*/
|
|
1130
|
+
setReaction(faction: number | string, other: number | string, reaction: "neutral" | "enemy" | "ally" | "friend", mutual?: boolean): boolean;
|
|
1131
|
+
|
|
1132
|
+
/**
|
|
1133
|
+
* Gives a reaction back to the game's data files on every client.
|
|
1134
|
+
* @param faction A TESFaction form ID, as a number or hex string.
|
|
1135
|
+
* @param other The faction it reacts to, as a number or hex string.
|
|
1136
|
+
* @param mutual Both directions, as `Faction.SetAlly` and `Faction.SetEnemy` do; true when left out.
|
|
1137
|
+
* @returns True when one was overridden.
|
|
1138
|
+
*/
|
|
1139
|
+
clearReaction(faction: number | string, other: number | string, mutual?: boolean): boolean;
|
|
1140
|
+
};
|
|
1141
|
+
|
|
1055
1142
|
/**
|
|
1056
1143
|
* An armed mine a player laid. Its owner's game holds the mine and sets it off; the server decides when. Once it goes off or is removed the handle reads nothing. Mines go with their owner when they leave.
|
|
1057
1144
|
*/
|
package/package.json
CHANGED