@paintswap/estfor-definitions 0.1.5 → 0.1.6

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.
@@ -0,0 +1,3 @@
1
+ export { default as NONE } from './constants';
2
+ export * as EstforTypes from './types';
3
+ export * as EstforConstants from './constants';
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ exports.__esModule = true;
14
+ exports.EstforConstants = exports.EstforTypes = exports.NONE = void 0;
15
+ var constants_1 = require("./constants");
16
+ __createBinding(exports, constants_1, "default", "NONE");
17
+ exports.EstforTypes = require("./types");
18
+ exports.EstforConstants = require("./constants");
@@ -0,0 +1,192 @@
1
+ export declare enum BoostType {
2
+ NONE = 0,
3
+ ANY_XP = 1,
4
+ COMBAT_XP = 2,
5
+ NON_COMBAT_XP = 3,
6
+ GATHERING = 4,
7
+ ABSENCE = 5
8
+ }
9
+ export declare enum Skill {
10
+ NONE = 0,
11
+ COMBAT = 1,
12
+ ATTACK = 2,
13
+ RANGE = 3,
14
+ MAGIC = 4,
15
+ DEFENCE = 5,
16
+ HEALTH = 6,
17
+ MINING = 7,
18
+ WOODCUTTING = 8,
19
+ FISHING = 9,
20
+ SMITHING = 10,
21
+ THIEVING = 11,
22
+ CRAFTING = 12,
23
+ COOKING = 13,
24
+ FIREMAKING = 14
25
+ }
26
+ export declare enum EquipPosition {
27
+ NONE = 0,
28
+ HEAD = 1,
29
+ NECK = 2,
30
+ BODY = 3,
31
+ ARMS = 4,
32
+ LEGS = 5,
33
+ BOOTS = 6,
34
+ SPARE1 = 7,
35
+ SPARE2 = 8,
36
+ LEFT_HAND = 9,
37
+ RIGHT_HAND = 10,
38
+ BOTH_HANDS = 11,
39
+ ARROW_SATCHEL = 12,
40
+ MAGIC_BAG = 13,
41
+ FOOD = 14,
42
+ AUX = 15,
43
+ BOOST_VIAL = 16,
44
+ NO_POSITION = 17
45
+ }
46
+ export type Attire = {
47
+ helmet: number;
48
+ amulet: number;
49
+ armor: number;
50
+ gauntlets: number;
51
+ tassets: number;
52
+ boots: number;
53
+ ring: number;
54
+ reserved1: number;
55
+ queueId: number;
56
+ };
57
+ export declare enum ActionQueueStatus {
58
+ NONE = 0,
59
+ APPEND = 1,
60
+ KEEP_LAST_IN_PROGRESS = 2
61
+ }
62
+ export declare enum CombatStyle {
63
+ NONE = 0,
64
+ MELEE = 1,
65
+ RANGE = 2,
66
+ MAGIC = 3,
67
+ MELEE_DEFENCE = 4,
68
+ RANGE_DEFENCE = 5,
69
+ MAGIC_DEFENCE = 6
70
+ }
71
+ export type Equipment = {
72
+ itemTokenId: number;
73
+ amount: number;
74
+ };
75
+ export type QueuedAction = {
76
+ attire: Attire;
77
+ actionId: number;
78
+ regenerateId: number;
79
+ choiceId: number;
80
+ choiceId1: number;
81
+ choiceId2: number;
82
+ combatStyle: CombatStyle;
83
+ timespan: number;
84
+ rightHandEquipmentTokenId: number;
85
+ leftHandEquipmentTokenId: number;
86
+ startTime: string;
87
+ isValid: boolean;
88
+ };
89
+ export type ActionInfo = {
90
+ skill: Skill;
91
+ isAvailable: boolean;
92
+ isDynamic: boolean;
93
+ actionChoiceRequired: boolean;
94
+ xpPerHour: number;
95
+ numSpawn: number;
96
+ minSkillPoints: number;
97
+ handItemTokenIdRangeMin: number;
98
+ handItemTokenIdRangeMax: number;
99
+ };
100
+ export type ActionReward = {
101
+ itemTokenId: number;
102
+ rate: number;
103
+ };
104
+ export type Action = {
105
+ actionId: number;
106
+ info: ActionInfo;
107
+ guaranteedRewards: ActionReward[];
108
+ randomRewards: ActionReward[];
109
+ combatStats: CombatStats;
110
+ };
111
+ export type ActionChoice = {
112
+ skill: Skill;
113
+ diff: number;
114
+ rate: number;
115
+ xpPerHour: number;
116
+ minSkillPoints: number;
117
+ inputTokenId1: number;
118
+ num1: number;
119
+ inputTokenId2: number;
120
+ num2: number;
121
+ inputTokenId3: number;
122
+ num3: number;
123
+ outputTokenId: number;
124
+ outputNum: number;
125
+ };
126
+ export type InputItem = {
127
+ combatStats: CombatStats;
128
+ nonCombatStats: NonCombatStats;
129
+ tokenId: number;
130
+ equipPosition: EquipPosition;
131
+ isTransferable: boolean;
132
+ skill: Skill;
133
+ minSkillPoints: number;
134
+ healthRestored: number;
135
+ boostType: BoostType;
136
+ boostValue: number;
137
+ boostDuration: number;
138
+ metadataURI: string;
139
+ };
140
+ export type CombatStats = {
141
+ melee: number;
142
+ magic: number;
143
+ range: number;
144
+ meleeDefence: number;
145
+ magicDefence: number;
146
+ rangeDefence: number;
147
+ health: number;
148
+ };
149
+ export type NonCombatStats = {
150
+ skill: Skill;
151
+ diff: number;
152
+ };
153
+ export declare const emptyCombatStats: CombatStats;
154
+ export declare const emptyNonCombatStats: NonCombatStats;
155
+ export declare const defaultInputItem: {
156
+ combatStats: CombatStats;
157
+ nonCombatStats: NonCombatStats;
158
+ isTransferable: boolean;
159
+ skill: Skill;
160
+ minSkillPoints: number;
161
+ healthRestored: number;
162
+ boostType: BoostType;
163
+ boostValue: number;
164
+ boostDuration: number;
165
+ };
166
+ export declare const noAttire: {
167
+ helmet: number;
168
+ amulet: number;
169
+ armor: number;
170
+ gauntlets: number;
171
+ tassets: number;
172
+ boots: number;
173
+ ring: number;
174
+ reserved1: number;
175
+ queueId: number;
176
+ };
177
+ export type PendingOutput = {
178
+ consumed: Equipment[];
179
+ produced: Equipment[];
180
+ producedPastRandomRewards: Equipment[];
181
+ producedXPRewards: Equipment[];
182
+ died: boolean;
183
+ };
184
+ export type PendingFlags = {
185
+ includeLoot: boolean;
186
+ includePastRandomRewards: boolean;
187
+ includeXPRewards: boolean;
188
+ };
189
+ export type XPThresholdReward = {
190
+ xpThreshold: number;
191
+ equipments: Equipment[];
192
+ };
package/dist/types.js ADDED
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.noAttire = exports.defaultInputItem = exports.emptyNonCombatStats = exports.emptyCombatStats = exports.CombatStyle = exports.ActionQueueStatus = exports.EquipPosition = exports.Skill = exports.BoostType = void 0;
4
+ var BoostType;
5
+ (function (BoostType) {
6
+ BoostType[BoostType["NONE"] = 0] = "NONE";
7
+ BoostType[BoostType["ANY_XP"] = 1] = "ANY_XP";
8
+ BoostType[BoostType["COMBAT_XP"] = 2] = "COMBAT_XP";
9
+ BoostType[BoostType["NON_COMBAT_XP"] = 3] = "NON_COMBAT_XP";
10
+ BoostType[BoostType["GATHERING"] = 4] = "GATHERING";
11
+ BoostType[BoostType["ABSENCE"] = 5] = "ABSENCE";
12
+ })(BoostType = exports.BoostType || (exports.BoostType = {}));
13
+ var Skill;
14
+ (function (Skill) {
15
+ Skill[Skill["NONE"] = 0] = "NONE";
16
+ Skill[Skill["COMBAT"] = 1] = "COMBAT";
17
+ Skill[Skill["ATTACK"] = 2] = "ATTACK";
18
+ Skill[Skill["RANGE"] = 3] = "RANGE";
19
+ Skill[Skill["MAGIC"] = 4] = "MAGIC";
20
+ Skill[Skill["DEFENCE"] = 5] = "DEFENCE";
21
+ Skill[Skill["HEALTH"] = 6] = "HEALTH";
22
+ Skill[Skill["MINING"] = 7] = "MINING";
23
+ Skill[Skill["WOODCUTTING"] = 8] = "WOODCUTTING";
24
+ Skill[Skill["FISHING"] = 9] = "FISHING";
25
+ Skill[Skill["SMITHING"] = 10] = "SMITHING";
26
+ Skill[Skill["THIEVING"] = 11] = "THIEVING";
27
+ Skill[Skill["CRAFTING"] = 12] = "CRAFTING";
28
+ Skill[Skill["COOKING"] = 13] = "COOKING";
29
+ Skill[Skill["FIREMAKING"] = 14] = "FIREMAKING";
30
+ })(Skill = exports.Skill || (exports.Skill = {}));
31
+ var EquipPosition;
32
+ (function (EquipPosition) {
33
+ EquipPosition[EquipPosition["NONE"] = 0] = "NONE";
34
+ EquipPosition[EquipPosition["HEAD"] = 1] = "HEAD";
35
+ EquipPosition[EquipPosition["NECK"] = 2] = "NECK";
36
+ EquipPosition[EquipPosition["BODY"] = 3] = "BODY";
37
+ EquipPosition[EquipPosition["ARMS"] = 4] = "ARMS";
38
+ EquipPosition[EquipPosition["LEGS"] = 5] = "LEGS";
39
+ EquipPosition[EquipPosition["BOOTS"] = 6] = "BOOTS";
40
+ EquipPosition[EquipPosition["SPARE1"] = 7] = "SPARE1";
41
+ EquipPosition[EquipPosition["SPARE2"] = 8] = "SPARE2";
42
+ EquipPosition[EquipPosition["LEFT_HAND"] = 9] = "LEFT_HAND";
43
+ EquipPosition[EquipPosition["RIGHT_HAND"] = 10] = "RIGHT_HAND";
44
+ EquipPosition[EquipPosition["BOTH_HANDS"] = 11] = "BOTH_HANDS";
45
+ EquipPosition[EquipPosition["ARROW_SATCHEL"] = 12] = "ARROW_SATCHEL";
46
+ EquipPosition[EquipPosition["MAGIC_BAG"] = 13] = "MAGIC_BAG";
47
+ EquipPosition[EquipPosition["FOOD"] = 14] = "FOOD";
48
+ EquipPosition[EquipPosition["AUX"] = 15] = "AUX";
49
+ EquipPosition[EquipPosition["BOOST_VIAL"] = 16] = "BOOST_VIAL";
50
+ EquipPosition[EquipPosition["NO_POSITION"] = 17] = "NO_POSITION";
51
+ })(EquipPosition = exports.EquipPosition || (exports.EquipPosition = {}));
52
+ var ActionQueueStatus;
53
+ (function (ActionQueueStatus) {
54
+ ActionQueueStatus[ActionQueueStatus["NONE"] = 0] = "NONE";
55
+ ActionQueueStatus[ActionQueueStatus["APPEND"] = 1] = "APPEND";
56
+ ActionQueueStatus[ActionQueueStatus["KEEP_LAST_IN_PROGRESS"] = 2] = "KEEP_LAST_IN_PROGRESS";
57
+ })(ActionQueueStatus = exports.ActionQueueStatus || (exports.ActionQueueStatus = {}));
58
+ var CombatStyle;
59
+ (function (CombatStyle) {
60
+ CombatStyle[CombatStyle["NONE"] = 0] = "NONE";
61
+ CombatStyle[CombatStyle["MELEE"] = 1] = "MELEE";
62
+ CombatStyle[CombatStyle["RANGE"] = 2] = "RANGE";
63
+ CombatStyle[CombatStyle["MAGIC"] = 3] = "MAGIC";
64
+ CombatStyle[CombatStyle["MELEE_DEFENCE"] = 4] = "MELEE_DEFENCE";
65
+ CombatStyle[CombatStyle["RANGE_DEFENCE"] = 5] = "RANGE_DEFENCE";
66
+ CombatStyle[CombatStyle["MAGIC_DEFENCE"] = 6] = "MAGIC_DEFENCE";
67
+ })(CombatStyle = exports.CombatStyle || (exports.CombatStyle = {}));
68
+ exports.emptyCombatStats = {
69
+ melee: 0,
70
+ magic: 0,
71
+ range: 0,
72
+ meleeDefence: 0,
73
+ magicDefence: 0,
74
+ rangeDefence: 0,
75
+ health: 0
76
+ };
77
+ exports.emptyNonCombatStats = {
78
+ skill: Skill.NONE,
79
+ diff: 0
80
+ };
81
+ exports.defaultInputItem = {
82
+ combatStats: exports.emptyCombatStats,
83
+ nonCombatStats: exports.emptyNonCombatStats,
84
+ isTransferable: true,
85
+ skill: Skill.NONE,
86
+ minSkillPoints: 0,
87
+ healthRestored: 0,
88
+ boostType: BoostType.NONE,
89
+ boostValue: 0,
90
+ boostDuration: 0
91
+ };
92
+ exports.noAttire = {
93
+ helmet: 0,
94
+ amulet: 0,
95
+ armor: 0,
96
+ gauntlets: 0,
97
+ tassets: 0,
98
+ boots: 0,
99
+ ring: 0,
100
+ reserved1: 0,
101
+ queueId: 0
102
+ };
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@paintswap/estfor-definitions",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Types and constants for Estfor",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/PaintSwap/estfor-definitions.git"
8
8
  },
9
+ "main": "dist/index.js",
10
+ "types": "dist/index.d.ts",
9
11
  "keywords": [
10
12
  "estfor",
11
13
  "paintswap",
@@ -13,14 +15,15 @@
13
15
  "web3",
14
16
  "ts",
15
17
  "js",
16
- "as",
17
18
  "library"
18
19
  ],
19
- "main": "index.ts",
20
- "module": "index.ts",
21
- "types": "index.ts",
20
+ "files": [
21
+ "dist/*"
22
+ ],
22
23
  "scripts": {
23
- "build": "asc --explicitStart --exportRuntime --runtime stub index.ts --lib estfor-definitions -b index.wasm",
24
+ "build": "run-script-os",
25
+ "build:windows": "(IF exist dist rd /s/q dist) && tsc",
26
+ "build:default": "rm -rf ./dist/* && tsc",
24
27
  "prepare": "yarn build",
25
28
  "version": "git add -A src",
26
29
  "postversion": "git push && git push --tags"
@@ -34,9 +37,5 @@
34
37
  "devDependencies": {
35
38
  "run-script-os": "^1.1.6",
36
39
  "typescript": "^4.9.5"
37
- },
38
- "dependencies": {
39
- "assemblyscript": "0.19.10"
40
- },
41
- "ascMain": "index.ts"
40
+ }
42
41
  }
package/.eslintrc.json DELETED
@@ -1,28 +0,0 @@
1
- {
2
- "settings": {
3
- "import/resolver": {
4
- "node": {
5
- "paths": ["./src"]
6
- }
7
- }
8
- },
9
- "env": {
10
- "es6": true,
11
- "browser": true,
12
- "jest": true
13
- },
14
- "parser": "@typescript-eslint/parser",
15
- "parserOptions": {
16
- "ecmaVersion": 13,
17
- "sourceType": "module"
18
- },
19
- "plugins": [
20
- "@typescript-eslint"
21
- ],
22
- "rules": {
23
- "no-console": ["warn", { "allow": ["info", "warn", "error"] }],
24
- "no-plusplus": 0,
25
- "prefer-destructuring": ["warn", { "object": true, "array": false }],
26
- "no-underscore-dangle": 0
27
- }
28
- }
package/.prettierrc DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "trailingComma": "all",
3
- "semi": false,
4
- "singleQuote": true,
5
- "printWidth": 120,
6
- "tabWidth": 2
7
- }
package/index.ts DELETED
@@ -1,4 +0,0 @@
1
- export { default as NONE } from './src/lib/estforConstants'
2
- import * as EstforTypes from './src/lib/estforTypes'
3
- import * as EstforConstants from './src/lib/estforConstants'
4
- export { EstforTypes, EstforConstants }