azeroth-shell 0.1.2 → 0.3.0
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/README.md +362 -85
- package/bin/azsh.mjs +35 -19
- package/package.json +12 -1
- package/src/autopilot/plan.ts +8 -11
- package/src/autopilot/view.ts +12 -11
- package/src/cli/combatLogFormat.ts +22 -0
- package/src/cli/gzLoader.mjs +47 -6
- package/src/cli/hdArt.mjs +81 -0
- package/src/cli/iconArt.mjs +145 -0
- package/src/cli/iconGrid.mjs +100 -0
- package/src/cli/modelArt.mjs +298 -0
- package/src/cli/oocPrep.mjs +32 -0
- package/src/cli/paperdoll.mjs +76 -0
- package/src/cli/perfCheck.mjs +56 -0
- package/src/cli/repl.mjs +48 -7
- package/src/cli/rotationText.mjs +6 -6
- package/src/cli/sixel.mjs +319 -0
- package/src/cli/term.mjs +106 -12
- package/src/cli/text.mjs +21 -3
- package/src/cli/tui.mjs +262 -102
- package/src/cli/tuiAutopilot.mjs +356 -0
- package/src/cli/tuiBags.mjs +37 -4
- package/src/cli/tuiBg.mjs +370 -41
- package/src/cli/tuiCheck.mjs +633 -37
- package/src/cli/tuiCity.mjs +146 -41
- package/src/cli/tuiCompanionKit.mjs +6 -6
- package/src/cli/tuiCompanions.mjs +211 -41
- package/src/cli/tuiCreate.mjs +230 -0
- package/src/cli/tuiDungeon.mjs +57 -21
- package/src/cli/tuiFight.mjs +467 -88
- package/src/cli/tuiFightPanes.mjs +42 -14
- package/src/cli/tuiFloor.mjs +21 -9
- package/src/cli/tuiGear.mjs +17 -14
- package/src/cli/tuiLoot.mjs +6 -6
- package/src/cli/tuiMap.mjs +214 -0
- package/src/cli/tuiPaperdoll.mjs +108 -0
- package/src/cli/tuiPartyStage.mjs +206 -0
- package/src/cli/tuiPet.mjs +16 -8
- package/src/cli/tuiProfessions.mjs +27 -25
- package/src/cli/tuiRotationCond.mjs +390 -0
- package/src/cli/tuiSaves.mjs +24 -1
- package/src/cli/tuiSearch.mjs +79 -27
- package/src/cli/tuiSettings.mjs +3 -4
- package/src/cli/tuiStage.mjs +360 -0
- package/src/cli/tuiTalentTree.mjs +124 -0
- package/src/cli/tuiTalents.mjs +3 -4
- package/src/cli/tuiViews.mjs +633 -172
- package/src/cli/tuiWiki.mjs +2 -3
- package/src/cli/tuiWorld.mjs +90 -7
- package/src/data/gear-art.bin.br +0 -0
- package/src/data/hd-art.json +114 -0
- package/src/data/icon-art.bin.gz +0 -0
- package/src/data/model-art-worn.bin.br +0 -0
- package/src/data/model-art.bin.gz +0 -0
- package/src/data/rotations/pve/paladin/retribution.json +2 -2
- package/src/data/tables/creatures.json.gz +0 -0
- package/src/data/world-map-sixel.bin.br +0 -0
- package/src/data/world-map.bin.gz +0 -0
- package/src/domain/bg/match.ts +85 -24
- package/src/domain/bg/strategies.ts +144 -29
- package/src/domain/bg/types.ts +2 -0
- package/src/domain/bg/wsg.ts +35 -20
- package/src/domain/character/character.ts +6 -0
- package/src/domain/pet/pet.ts +31 -0
- package/src/domain/quests/doQuest.ts +24 -6
- package/src/domain/rotation/build.ts +3031 -3031
- package/src/domain/rotation/classes/paladin.ts +16 -11
- package/src/domain/rotation/evaluate.ts +3 -0
- package/src/engine/combat/applySpell.ts +20 -9
- package/src/engine/combat/applySpellLate.ts +16 -12
- package/src/engine/combat/areaAura.ts +284 -283
- package/src/engine/combat/fighterFactory.ts +1 -1
- package/src/engine/combat/pickAction.ts +3494 -3449
- package/src/engine/combat/procsDamage.ts +31 -1
- package/src/engine/combat/sessionChase.ts +19 -2
- package/src/engine/combat/sessionMotionKit.ts +40 -2
- package/src/engine/game/loadReconcile.ts +21 -1
- package/src/engine/game/pets.ts +33 -1
- package/src/engine/game/types.ts +4 -0
- package/src/quests/quests.ts +60 -0
package/README.md
CHANGED
|
@@ -1,29 +1,56 @@
|
|
|
1
1
|
# azsh
|
|
2
2
|
|
|
3
|
-
Azeroth shell. A WoW Classic 1.12 text RPG that runs in the terminal, built on
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Azeroth shell. A WoW Classic 1.12 text RPG that runs in the terminal, built on CMaNGOS Classic
|
|
4
|
+
data. The engine comes from another project of mine that is not released; this is its terminal
|
|
5
|
+
front end. No graphics, no browser, no build step.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
> Personal, non-commercial fan project. World of Warcraft names, models, textures, icons and data are
|
|
8
|
+
> trademarks and copyrights of Blizzard Entertainment or its licensors. Classic-DB is part of the
|
|
9
|
+
> CMaNGOS Project; neither it nor this project is affiliated with or endorsed by Blizzard.
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
- [Install](#install)
|
|
14
|
+
- [Keys](#keys)
|
|
15
|
+
- [Playing](#playing): [character](#new-character) · [world and autopilot](#world-and-the-autopilot) ·
|
|
16
|
+
[fights](#fights) · [rotation](#rotation) · [gear](#character-and-bags) · [vendors, trainers, talents](#vendors-trainers-talents) ·
|
|
17
|
+
[professions](#professions) · [companions](#companions) · [dungeons](#dungeons) · [city services](#city-services)
|
|
18
|
+
- [Art and terminals](#art-and-terminals)
|
|
19
|
+
- [Line mode and saves](#line-mode-and-saves)
|
|
20
|
+
- [Where it comes from](#where-it-comes-from)
|
|
21
|
+
- [Development](#development)
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
npx azeroth-shell # run it straight from npm
|
|
9
27
|
npm install -g azeroth-shell # or install it once, then:
|
|
10
|
-
azeroth-shell
|
|
28
|
+
azeroth-shell # or just azsh
|
|
29
|
+
azeroth-shell --art # optional: fetch the full-size art (179 MB) now instead of when asked
|
|
11
30
|
```
|
|
12
31
|
|
|
32
|
+
The package is the whole game. The one extra download is the full-size art, which only terminals
|
|
33
|
+
that draw sixel images use. It never comes down on its own: on such a terminal azsh asks first,
|
|
34
|
+
showing the size and the folder, or you fetch it with `--art` (that also works through
|
|
35
|
+
`npx azeroth-shell --art`). It comes from this repo's `art-1` GitHub release, and every file is
|
|
36
|
+
checked against the sha256 in `src/data/hd-art.json` before it is used. You don't need to know
|
|
37
|
+
beforehand whether your terminal draws sixel, because azsh checks that itself.
|
|
38
|
+
|
|
13
39
|
From a checkout: `npm install -g .` or `node bin/azsh.mjs`.
|
|
14
40
|
|
|
15
41
|
Needs Node 22.18 or newer (it strips TypeScript types natively). No dependencies. The tree is
|
|
16
|
-
about
|
|
42
|
+
about 41 MB: 15 MB of gzipped game data, 12 MB of model art (creatures, and every item on every
|
|
43
|
+
body) and 13 MB of engine source.
|
|
17
44
|
|
|
18
|
-
##
|
|
45
|
+
## Keys
|
|
19
46
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
47
|
+
`azsh` opens the windowed game: a header with your pools and gold, eleven tabs, a cursor-driven
|
|
48
|
+
list with a detail pane beside it, and a scrolling log underneath. Nothing scrolls off the top;
|
|
49
|
+
every screen redraws in place.
|
|
23
50
|
|
|
24
51
|
| Key | Does |
|
|
25
52
|
| --- | --- |
|
|
26
|
-
| `1`-`9` `0`, `Tab`, `Left` `Right` | World, Quests, Bags,
|
|
53
|
+
| `1`-`9` `0`, `Tab`, `Left` `Right` | World, Quests, Bags, Character, Spells, Rotation, Talents, Travel, Professions, Companions; Settings is the last tab (`Tab`/`Left`) |
|
|
27
54
|
| `Up` `Down` `j` `k` | move the cursor; the right pane describes the row |
|
|
28
55
|
| `Enter` | act on the row: fight, open a quest, talk to a vendor or trainer, equip, cast, travel |
|
|
29
56
|
| `Esc` | close the window on top; on a tab, back to World |
|
|
@@ -33,107 +60,357 @@ off the top; every screen redraws in place.
|
|
|
33
60
|
| `:` | the command line: every verb of the line game (`:rest 120`, `:auto 50 farm kobold`, `:help`) |
|
|
34
61
|
| `?` | the key list |
|
|
35
62
|
|
|
63
|
+
Each screen below has its own keys; they are listed with it.
|
|
64
|
+
|
|
65
|
+

|
|
66
|
+
|
|
67
|
+
## Playing
|
|
68
|
+
|
|
69
|
+
### New character
|
|
70
|
+
|
|
71
|
+
**New character** is one form: Race, Class, Gender, Name, then the body's own looks (skin, face,
|
|
72
|
+
hair style and colour, facial hair; horns and tusks where the race has them). The hero stands
|
|
73
|
+
beside the form in the starting gear as you change them, and under the form a card says what the
|
|
74
|
+
race and the class are and what a level 1 starts with: pools, attributes, racials, spells and gear.
|
|
75
|
+
|
|
76
|
+
| Key | Does |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| `Left` `Right` | change the row under the cursor |
|
|
79
|
+
| `Enter` on Race or Class | open the list with each choice drawn |
|
|
80
|
+
| `Enter` on Name | type a name |
|
|
81
|
+
| `n` | roll a name from the world's name pool |
|
|
82
|
+
| `r` | roll a look |
|
|
83
|
+
| `Esc` | back to the character list |
|
|
84
|
+
|
|
85
|
+
**Random character** rolls a world bot instead, at its own level, geared and named.
|
|
86
|
+
|
|
87
|
+

|
|
88
|
+
|
|
89
|
+
### World and the autopilot
|
|
90
|
+
|
|
36
91
|
**World** lists the quests on offer (`!` when you can take one, `?` when one is ready to hand in),
|
|
37
92
|
the people here, the exits and every creature you can hunt, coloured by level like the client.
|
|
38
|
-
|
|
93
|
+
|
|
94
|
+
| Key | Does |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `Enter` on a creature | start a live fight |
|
|
97
|
+
| `f` | resolve the fight instantly |
|
|
98
|
+
| `a` | start the autopilot |
|
|
99
|
+
|
|
39
100
|
The autopilot accepts quests, picks targets, rests and hands in on its own, one planner step every
|
|
40
|
-
third of a second
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
101
|
+
third of a second. Every fight it picks plays out live on screen with the same frames and combat
|
|
102
|
+
log as a fight you started yourself. Between fights it keeps its own panel (your frame and what it
|
|
103
|
+
is doing) instead of flashing back to the tabs.
|
|
104
|
+
|
|
105
|
+
| Key while the autopilot runs | Does |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| `1`-`9` | look at a tab |
|
|
108
|
+
| `w` | back to watching; in a fight, take the keys so `1`-`0` press the action bar (`w` or `Esc` hands them back) |
|
|
109
|
+
| `Esc` | stop it; during one of its fights, run away and stop it |
|
|
110
|
+
|
|
111
|
+

|
|
44
112
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
113
|
+
### Fights
|
|
114
|
+
|
|
115
|
+
Fights run on the engine's real-time session, ticking every 100 ms, on a stage: your sprite down
|
|
116
|
+
the left, the foe down the right (its size says its rank). Each has a plate under its feet (name,
|
|
117
|
+
level, class or rank, health, power), its cast or crowd control under that and its aura icons under
|
|
118
|
+
that. The foe stands at its real distance (the engine keeps positions in yards): a melee foe closes
|
|
119
|
+
in, a caster stays at range.
|
|
120
|
+
|
|
121
|
+
Hits rise from the chest, an auto-attack swing lunges the sprite, and a missile (a Fireball, an
|
|
122
|
+
arrow; never a strike) crosses the gap as a glyph. Your cast bar sits centred under the floor and
|
|
123
|
+
the keyed ability bar closes the scene; its slots never move, a cooldown or the cast in progress is
|
|
124
|
+
all they say, and the slot of a spell just used flashes. The 1.12 combat log streams into the log pane.
|
|
125
|
+
|
|
126
|
+
A party fight (companions along, a dungeon pull) is the same stage with every body small: the
|
|
127
|
+
party down the left (you in your gear, the companions in theirs, the pets a size under), the pack
|
|
128
|
+
down the right, and a narrow plate under each sprite with its role letter and name, its health as
|
|
129
|
+
a percent, its power, and under that its cast bar, crowd control or "dead". Each column stands by
|
|
130
|
+
its real distance to the other side, from the far edge to the lane at melee contact, and the
|
|
131
|
+
closing goes to whoever walked it: the healer hangs back, a mage walks into range, the tank runs
|
|
132
|
+
in, and a mob that runs onto the healer crosses the lane while the healer stays put. The sprites
|
|
133
|
+
take the widest box the terminal affords and shrink with the crowd; past the smallest the floor
|
|
134
|
+
counts who is out of frame. Terminals under 90 columns keep the list of unit frames.
|
|
135
|
+
|
|
136
|
+
Your rotation plays by default.
|
|
137
|
+
|
|
138
|
+
| Key | Does |
|
|
139
|
+
| --- | --- |
|
|
140
|
+
| `1`-`0` | fire that ability over the rotation |
|
|
141
|
+
| `a` | take full control |
|
|
142
|
+
| `Space` | pause |
|
|
143
|
+
| `+` `-` | run the fight faster or slower |
|
|
144
|
+
| `t` | (party fight) pause and give a companion an order: attack a target, cast an ability, hold ground |
|
|
145
|
+
| `p` | (dungeon) pull the next trash pack in too |
|
|
146
|
+
| `Esc` | run away |
|
|
147
|
+
|
|
148
|
+
### Rotation
|
|
49
149
|
|
|
50
150
|
**Rotation** is what auto-play casts for you: the same rule list the web editor edits, phase by
|
|
51
151
|
phase, every rule as a sentence. Rules are read top to bottom each tick and the first one whose
|
|
52
|
-
conditions hold fires.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
152
|
+
conditions hold fires.
|
|
153
|
+
|
|
154
|
+
| Key | Does |
|
|
155
|
+
| --- | --- |
|
|
156
|
+
| `Enter` on a rule | its menu: turn on or off, change when it fires, move, delete |
|
|
157
|
+
| `Enter` on `+ Add a rule` | pick a spell or combat item |
|
|
158
|
+
| Settings rows (bottom) | pick a spec or rebuild the recommended list |
|
|
159
|
+
| `K` `J` | move the rule up or down |
|
|
160
|
+
| `a`, `c`, `d` | add a rule, edit the condition, delete |
|
|
161
|
+
| `s`, `r` | pick a spec, rebuild the recommended list |
|
|
162
|
+
| `w` | whose rotation: yours or a companion's |
|
|
163
|
+
| `p` | rotation profiles: select, add, rename, delete |
|
|
164
|
+
| `D` | target dummy: run the rotation against a dummy |
|
|
165
|
+
| `A` | autopilot settings |
|
|
166
|
+
|
|
167
|
+
### Character and Bags
|
|
168
|
+
|
|
169
|
+
**Character** shows every slot with what you wear, and your health, power, experience, money,
|
|
170
|
+
attributes and combat ratings under the item tooltip; `s` opens the rest (weapon skills,
|
|
171
|
+
professions, auras, home, pet, honor, reputation). `Enter` on a slot lists everything in your bags (and
|
|
172
|
+
in the bank, in a bank town) that fits it, with the stat, armor and damage difference in the detail
|
|
173
|
+
pane; `Enter` there puts it on. The engine's equipment helper scores your bags against what you
|
|
174
|
+
wear: upgrades are listed at the top of the tab and marked `▲` in Bags. From 160 columns the tab is
|
|
175
|
+
a character sheet: you in your gear in the middle, the worn pieces' icons down both sides, Shift+arrows
|
|
176
|
+
walking the slots.
|
|
56
177
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
178
|
+

|
|
179
|
+
|
|
180
|
+
| Key | Does |
|
|
181
|
+
| --- | --- |
|
|
182
|
+
| `Enter` on a slot | list what fits, then `Enter` to equip |
|
|
183
|
+
| `s` | your stats, skills, auras, pet, honor and reputation |
|
|
184
|
+
| `u` (Character or Bags) | put on every upgrade at once |
|
|
185
|
+
| `x` | take a piece off |
|
|
186
|
+
| `b` (Bags) | open the bank, in a bank town |
|
|
187
|
+
| `g` (Bags) | open Send goods (see [Professions](#professions)) |
|
|
188
|
+
|
|
189
|
+
### Vendors, trainers, talents
|
|
190
|
+
|
|
191
|
+
**Vendors** open in a buy list with prices, stock and why a line is unavailable. A reagent your
|
|
192
|
+
party crafts with is flagged.
|
|
193
|
+
|
|
194
|
+
| Key | Does |
|
|
195
|
+
| --- | --- |
|
|
196
|
+
| `Tab` | flip to selling your bags |
|
|
197
|
+
| `j` | sell greys |
|
|
198
|
+
| `r` | repair |
|
|
199
|
+
|
|
200
|
+
**Trainers** show what you can learn now and what is coming up at which level.
|
|
201
|
+
**Talents** spend and refund points per tree. From 160 columns the tab draws the three trees side by
|
|
202
|
+
side as icon grids with their prerequisite arrows, Shift+arrows walking the tiers.
|
|
203
|
+
|
|
204
|
+

|
|
205
|
+
|
|
206
|
+
### Professions
|
|
61
207
|
|
|
62
208
|
**Professions** lists your trade skills and your companions', the profession trainers in the zone
|
|
63
209
|
and any Plans or Patterns in your bags. `Enter` on a profession opens its recipe book, coloured by
|
|
64
|
-
difficulty (orange always raises the skill, gray never)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
210
|
+
difficulty (orange always raises the skill, gray never). Short vendor reagents such as thread,
|
|
211
|
+
vials and flux are bought from your purse as you craft, the cost shown on the row.
|
|
212
|
+
|
|
213
|
+
| Key in a recipe book | Does |
|
|
214
|
+
| --- | --- |
|
|
215
|
+
| `Enter` | make one |
|
|
216
|
+
| `A` | make all you can |
|
|
217
|
+
| `N` | ask how many |
|
|
218
|
+
| `h` | show only what you can make |
|
|
219
|
+
| `/` | search |
|
|
220
|
+
| `c` | hand the book to a companion who knows the craft (they craft from the whole party's bags and banks) |
|
|
221
|
+
|
|
222
|
+

|
|
223
|
+
|
|
224
|
+
- **Enchanting** opens a bench instead: formulas apply to your gear or a party member's, and
|
|
225
|
+
green-or-better bag items can be disenchanted.
|
|
226
|
+
- **Mining, Herbalism, Skinning and Fishing** list the zone's nodes (also on the World tab) with
|
|
227
|
+
`Enter` to gather.
|
|
228
|
+
- **Everything the party can make** is one book across every crafter.
|
|
229
|
+
- **Send goods** (`g` here, in Bags or in Companions): trade goods go to the companions whose
|
|
230
|
+
recipes use them and upgrades go on whoever gains, after you review it.
|
|
231
|
+
|
|
232
|
+
### Companions
|
|
73
233
|
|
|
74
234
|
**Companions** shows your party (up to four) and bench. At an inn, *Hire a companion* lists the
|
|
75
|
-
adventurers for hire with their gear and price.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
235
|
+
adventurers for hire with their gear and price.
|
|
236
|
+
|
|
237
|
+
Each companion's page sets their role, seats or benches them, gears them (`Enter` on a slot picks
|
|
238
|
+
from their bags and yours), gives and takes items, teaches them a profession and opens their recipe
|
|
239
|
+
book, or sends them on a gathering trip that pays out while you play.
|
|
240
|
+
|
|
241
|
+
The *Fights* row (`m`, or `:squad solo|elites|party`) says who comes along: Solo, companions only
|
|
242
|
+
against elites, or the whole party on every pull. That rule covers live fights, `f`, `:fight` and
|
|
243
|
+
the autopilot. Party frames show each companion's role, target and cast, and `t` in a fight pauses
|
|
244
|
+
it to give one of them an order.
|
|
245
|
+
|
|
246
|
+
### Dungeons
|
|
82
247
|
|
|
83
248
|
**Dungeons** sit under *Dungeons* on the World tab of the zone that holds their door (and on the
|
|
84
|
-
Travel tab), with any held run or raid lockout on the row. `Enter` opens the card before the door:
|
|
85
|
-
(Bosses or Full), party or raid, who walks in (`f` fills from every companion you own to what
|
|
86
|
-
instance wants), the 10/20/40-man raid group, the paladins' Blessings, and food and water for
|
|
87
|
-
short of it.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
`
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
249
|
+
Travel tab), with any held run or raid lockout on the row. `Enter` opens the card before the door:
|
|
250
|
+
route (Bosses or Full), party or raid, who walks in (`f` fills from every companion you own to what
|
|
251
|
+
the instance wants), the 10/20/40-man raid group, the paladins' Blessings, and food and water for
|
|
252
|
+
everyone short of it.
|
|
253
|
+
|
|
254
|
+
Inside, the run window lists the rooms in route order with their stops (`B` boss, `T` trash,
|
|
255
|
+
`R` rare), the doors, levers and chests nearest each stop, and the NPCs with quests. Locked stops
|
|
256
|
+
say what opens them.
|
|
257
|
+
|
|
258
|
+
| Key | Does |
|
|
259
|
+
| --- | --- |
|
|
260
|
+
| `Enter` on an open stop | pull it live with the party (`p` in the fight pulls the next trash pack in too) |
|
|
261
|
+
| `Enter` on a gate / chest | use it / open it |
|
|
262
|
+
| `z` | rest and eat between pulls |
|
|
263
|
+
| `F` | run every remaining stop without watching; ends on a run report (damage, healing, loot, wipes) |
|
|
264
|
+
| `P` | open the Blessings board |
|
|
265
|
+
| `L` | leave (a 5-man is held for 30 minutes) |
|
|
266
|
+
| `R` | reset |
|
|
267
|
+
|
|
268
|
+
### City services
|
|
269
|
+
|
|
270
|
+
**City services** appear under *Services* on the World tab, above the people. `:bank`, `:ah` and
|
|
271
|
+
`:mail` open them from the command line.
|
|
272
|
+
|
|
273
|
+
**Bank**, in the six capitals and the goblin banker towns (`b` in Bags opens it too):
|
|
274
|
+
|
|
275
|
+
| Key | Does |
|
|
276
|
+
| --- | --- |
|
|
277
|
+
| `Tab` | flip between depositing and withdrawing |
|
|
278
|
+
| `n` | move part of a stack |
|
|
279
|
+
| `+` | buy a bank bag slot |
|
|
280
|
+
| `B` | slot a bag |
|
|
281
|
+
|
|
282
|
+
**Auction House**, in the capitals:
|
|
283
|
+
|
|
284
|
+
| Key | Does |
|
|
285
|
+
| --- | --- |
|
|
286
|
+
| `Tab` | cycle browse, sell and your own auctions |
|
|
287
|
+
| `Enter` | buy out |
|
|
288
|
+
| `b` | bid |
|
|
289
|
+
| `s` | search by name |
|
|
290
|
+
|
|
291
|
+
Selling asks quantity, bid, buyout and duration.
|
|
292
|
+
|
|
293
|
+
**Mailbox**, by every inn, where sales, refunds and overflow loot arrive:
|
|
294
|
+
|
|
295
|
+
| Key | Does |
|
|
296
|
+
| --- | --- |
|
|
297
|
+
| `Enter` | take a letter's money and items |
|
|
298
|
+
| `A` | empty the box |
|
|
299
|
+
| `d` | delete |
|
|
300
|
+
|
|
301
|
+
## Art and terminals
|
|
302
|
+
|
|
303
|
+
The colours are plain ANSI, so your terminal's theme sets the palette. For a CRT look turn on the
|
|
304
|
+
terminal's own retro effect (Windows Terminal: `"experimental.retroTerminalEffect": true` on the
|
|
305
|
+
profile; cool-retro-term elsewhere).
|
|
306
|
+
|
|
307
|
+
At 90 columns or wider the creature you face is drawn beside the fight frames and under its detail
|
|
308
|
+
on the World tab. Your own character, in the gear you wear, stands on the Character tab and its stats page, on the
|
|
309
|
+
character picker, at creation and (from 130 columns) on the other side of the fight, and a
|
|
310
|
+
companion's page shows them the same way. It is truecolour half-block art baked from the game's
|
|
311
|
+
models; a terminal without 24-bit colour shows it in the nearest colours it has.
|
|
312
|
+
|
|
313
|
+
A terminal that draws sixel images (Windows Terminal 1.22+, WezTerm, foot, iTerm2; VS Code with
|
|
314
|
+
`terminal.integrated.enableImages`) can draw every creature, every character in their gear and every
|
|
315
|
+
icon in real pixels instead. azsh asks the terminal at start.
|
|
316
|
+
|
|
317
|
+
The Travel tab has the world map under whatever you point at: both continents, a gold pin where you
|
|
318
|
+
stand, a cyan one on the zone under the cursor and the planned route dotted between them, legs by
|
|
319
|
+
sea and air included; on the road the pin walks its leg. It is the same terrain map the browser game
|
|
320
|
+
pans around, as half-block cells or, on a sixel terminal, as pixels. Both of its packs are small enough
|
|
321
|
+
to ship, so the map needs no download. The pane is short on a short terminal, and so is the map:
|
|
322
|
+
give the window forty rows or more and it grows into them.
|
|
323
|
+
|
|
324
|
+
The full-size art for that is not in the npm package: it is about 179 MB, too much to ship to every
|
|
325
|
+
terminal that cannot draw it. When azsh finds a sixel terminal without it, it offers to download it
|
|
326
|
+
from the project's GitHub release into `~/.azsh/art/`. Each file is checked against a sha256 the
|
|
327
|
+
package carries. Answer "Not now" and it asks again next run; "Never ask" stops the prompt. `azsh --art` fetches it
|
|
328
|
+
from the shell without starting the game. Until the
|
|
329
|
+
art is there, the half-block art stays.
|
|
330
|
+
|
|
331
|
+
| Command | Does |
|
|
332
|
+
| --- | --- |
|
|
333
|
+
| `:art` | say whether this terminal draws sixel and whether the full-size art is here |
|
|
334
|
+
| `:art download` | fetch the full-size art now (progress on the hint row, the screen redraws when done) |
|
|
335
|
+
|
|
336
|
+

|
|
337
|
+
|
|
338
|
+
| Variable | Does |
|
|
339
|
+
| --- | --- |
|
|
340
|
+
| `AZSH_SIXEL=0` | keep the half-block art |
|
|
341
|
+
| `AZSH_SIXEL=1` | turn sixel on for a terminal that does not say |
|
|
342
|
+
| `AZSH_ART_DIR` | read the full-size art from (and download it to) this folder instead |
|
|
343
|
+
| `AZSH_HOME` | move the save folder (default `~/.azsh`) |
|
|
344
|
+
|
|
345
|
+
## Line mode and saves
|
|
108
346
|
|
|
109
347
|
Piped input, or `azsh --repl`, gives the line game instead: type `help` for its commands.
|
|
110
|
-
`azsh --tui` forces the windowed game even without a terminal, which is how it is driven through
|
|
111
|
-
in tests. Keys are decoded from the raw byte stream, so a lone `Esc` acts at once.
|
|
348
|
+
`azsh --tui` forces the windowed game even without a terminal, which is how it is driven through
|
|
349
|
+
pipes in tests. Keys are decoded from the raw byte stream, so a lone `Esc` acts at once.
|
|
112
350
|
|
|
113
351
|
Saves live in `~/.azsh/saves/`, one JSON file per character. `AZSH_HOME` moves that folder.
|
|
114
352
|
|
|
115
353
|
## Where it comes from
|
|
116
354
|
|
|
117
|
-
The engine, rules, world, quests, autopilot and data are taken as-is from a larger, unreleased
|
|
118
|
-
of mine that runs the same game with a graphical front end. The data is the CMaNGOS Classic
|
|
119
|
-
database plus a DBC bake, every table gzipped on disk (`src/cli/gzLoader.mjs` serves the
|
|
120
|
-
imports).
|
|
121
|
-
|
|
122
|
-
`tuiFight.mjs` (live fight, autopilot) and `repl.mjs` (line game and the shared verb table). A few
|
|
123
|
-
small UI modules (combat log wording, rotation sentences, dungeon floor scripts) are ported from the
|
|
124
|
-
same project.
|
|
355
|
+
The engine, rules, world, quests, autopilot and data are taken as-is from a larger, unreleased
|
|
356
|
+
project of mine that runs the same game with a graphical front end. The data is the CMaNGOS Classic
|
|
357
|
+
world database plus a DBC bake, every table gzipped on disk (`src/cli/gzLoader.mjs` serves the
|
|
358
|
+
static imports). Everything the player reads traces to a CMaNGOS row or a 1.12 client string.
|
|
359
|
+
Nothing here is invented.
|
|
125
360
|
|
|
126
|
-
|
|
127
|
-
invented.
|
|
361
|
+
What is new here is the terminal front end in `src/cli/`:
|
|
128
362
|
|
|
129
|
-
|
|
363
|
+
| Module | Holds |
|
|
364
|
+
| --- | --- |
|
|
365
|
+
| `tui.mjs` | frame, input, dialogs |
|
|
366
|
+
| `tuiViews.mjs` | tabs |
|
|
367
|
+
| `tuiProfessions.mjs`, `tuiCompanions.mjs` | crafting, companions |
|
|
368
|
+
| `tuiFight.mjs` | live fight, autopilot |
|
|
369
|
+
| `repl.mjs` | line game and the shared verb table |
|
|
130
370
|
|
|
131
|
-
|
|
371
|
+
A few small UI modules (combat log wording, rotation sentences, dungeon floor scripts) are ported
|
|
372
|
+
from the same project.
|
|
373
|
+
|
|
374
|
+
The art is Blizzard's too. The icons are the 1.12 client's own icon textures; the creature sprites
|
|
375
|
+
and the geared character bodies are renders of the client's models. The packs in `src/data` are
|
|
376
|
+
small half-block reductions of them, and the full-size packs a sixel terminal downloads (the
|
|
377
|
+
`art-*` GitHub releases) are the same pictures at their native size. They are here for a
|
|
378
|
+
non-commercial fan project, nothing is sold or will be, and they come down on request.
|
|
379
|
+
|
|
380
|
+
What is not ported, and why, is the "Not porting" list in `PORT-PLAN.md`.
|
|
381
|
+
|
|
382
|
+
## Development
|
|
383
|
+
|
|
384
|
+
Checks:
|
|
385
|
+
|
|
386
|
+
```sh
|
|
132
387
|
npm run check # boot the store, fight ten kobolds, save and reload
|
|
133
|
-
npm run check:tui # drive the windowed game headlessly: tabs, quest, vendor, trainer, gear, bank,
|
|
388
|
+
npm run check:tui # drive the windowed game headlessly: tabs, quest, vendor, trainer, gear, bank,
|
|
389
|
+
# auction house, live fight, autopilot, crafting, hiring, send goods
|
|
134
390
|
npm run check:pipe # the real terminal path through pipes: raw key bytes in, ANSI frames out, Esc, paging, quit
|
|
135
391
|
npm run check:all # all three; add --frames to check:tui to print every screen
|
|
392
|
+
npm run check:perf # timings, not pass/fail: module import, boot stages, heap, a repaint on every tab, a fight tick by tick
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
Data and art bakes:
|
|
396
|
+
|
|
397
|
+
```sh
|
|
136
398
|
npm run data:pack # gzip the bake after a data refresh; data:unpack reverses it
|
|
399
|
+
npm run art:bake # rebuild src/data/model-art.bin.gz from phonecraft's creature renders (needs ffmpeg)
|
|
400
|
+
npm run art:gear # rebuild src/data/gear-art.bin.gz from phonecraft's paperdoll bake (needs Python with Pillow)
|
|
401
|
+
npm run art:icons # rebuild src/data/icon-art.bin.gz from phonecraft's spell and item icons (needs ffmpeg)
|
|
402
|
+
npm run art:map # rebuild the Travel tab's world map, src/data/world-map.bin.gz and world-map-sixel.bin.br,
|
|
403
|
+
# from phonecraft's combined Azeroth terrain map (needs ffmpeg)
|
|
404
|
+
npm run art:hd # rebuild the full-size art sixel draws: model-art-hd.bin.br, icon-art-hd.bin.br and
|
|
405
|
+
# gear-art-hd/<body>.bin.br (needs ffmpeg, and Python with Pillow for the gear)
|
|
137
406
|
```
|
|
138
407
|
|
|
139
|
-
|
|
408
|
+
The pictures in this file are played, not drawn: `scripts/demo-record.mjs` runs the game on pipes with
|
|
409
|
+
a scripted player and logs every byte it writes with the time, and `scripts/demo-render.py` replays
|
|
410
|
+
the log through a small terminal emulator (cells, colours, sixel) and hands the frames to ffmpeg.
|
|
411
|
+
|
|
412
|
+
```sh
|
|
413
|
+
node scripts/demo-record.mjs new media/rec/new.jsonl --cols 160 --rows 48 # scenes: new, bot, art
|
|
414
|
+
python scripts/demo-render.py media/rec/new.jsonl --marks # the clips in a recording
|
|
415
|
+
python scripts/demo-render.py media/rec/new.jsonl --clip fight --gif media/fight.gif [--mp4 media/fight.mp4]
|
|
416
|
+
```
|
package/bin/azsh.mjs
CHANGED
|
@@ -1,19 +1,35 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// azsh: Azeroth shell. Node 22.18+ strips TypeScript types natively, so the engine loads as-is.
|
|
3
|
-
// A terminal gets the windowed game; piped input (or --repl) gets the line game.
|
|
4
|
-
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
5
|
-
if (major < 22 || (major === 22 && minor < 18)) {
|
|
6
|
-
console.error(`azsh needs Node 22.18 or newer (found ${process.versions.node}).`);
|
|
7
|
-
process.exit(1);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
await
|
|
18
|
-
|
|
19
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// azsh: Azeroth shell. Node 22.18+ strips TypeScript types natively, so the engine loads as-is.
|
|
3
|
+
// A terminal gets the windowed game; piped input (or --repl) gets the line game.
|
|
4
|
+
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
5
|
+
if (major < 22 || (major === 22 && minor < 18)) {
|
|
6
|
+
console.error(`azsh needs Node 22.18 or newer (found ${process.versions.node}).`);
|
|
7
|
+
process.exit(1);
|
|
8
|
+
}
|
|
9
|
+
const argv = process.argv.slice(2);
|
|
10
|
+
if (argv.includes('--art')) {
|
|
11
|
+
// Fetch the full-size art up front instead of waiting for the in-game offer; says what and from where first.
|
|
12
|
+
const { hdManifest, missingHdBytes, downloadHdArt, downloadDir } = await import('../src/cli/hdArt.mjs');
|
|
13
|
+
const m = hdManifest(), bytes = missingHdBytes();
|
|
14
|
+
if (!m) { console.error('This build has no art manifest.'); process.exit(1); }
|
|
15
|
+
if (!bytes) { console.log(`The full-size art is all here (${downloadDir()}).`); process.exit(0); }
|
|
16
|
+
console.log(`Fetching ${Math.round(bytes / 1e6)} MB of full-size art (${m.files.length} files, sha256-checked)\n from ${m.base}\n into ${downloadDir()}`);
|
|
17
|
+
const res = await downloadHdArt((done, total) => {
|
|
18
|
+
if (process.stdout.isTTY) process.stdout.write(`\r ${Math.round(done / 1e6)} of ${Math.round(total / 1e6)} MB`);
|
|
19
|
+
});
|
|
20
|
+
if (process.stdout.isTTY) process.stdout.write('\n');
|
|
21
|
+
console.log(res.ok ? 'Done. A sixel terminal now draws creatures, characters and icons in real pixels.' : `Stopped: ${res.reason}`);
|
|
22
|
+
process.exit(res.ok ? 0 : 1);
|
|
23
|
+
}
|
|
24
|
+
await import('../src/cli/register.mjs');
|
|
25
|
+
const wantRepl = argv.includes('--repl') || (!argv.includes('--tui') && (!process.stdin.isTTY || !process.stdout.isTTY));
|
|
26
|
+
if (wantRepl) {
|
|
27
|
+
const { main } = await import('../src/cli/repl.mjs');
|
|
28
|
+
await main(argv.filter((a) => a !== '--repl' && a !== '--tui'));
|
|
29
|
+
} else {
|
|
30
|
+
// Loading the engine takes a moment (longer on the first run, which fills the stripped-JS cache); say so.
|
|
31
|
+
process.stdout.write('azsh: loading...\n');
|
|
32
|
+
const { runTui } = await import('../src/cli/tui.mjs');
|
|
33
|
+
await runTui({ argv });
|
|
34
|
+
process.exit(0); // the save is written before the screen closes; a piped stdin would otherwise hold the loop open
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "azeroth-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Azeroth shell. A WoW Classic 1.12 text RPG for the terminal, built on CMaNGOS data.",
|
|
6
6
|
"keywords": [
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
"files": [
|
|
29
29
|
"bin/",
|
|
30
30
|
"src/",
|
|
31
|
+
"!src/data/*-hd.bin.br",
|
|
32
|
+
"!src/data/gear-art-hd/",
|
|
33
|
+
"!src/data/*.only.bin.br",
|
|
34
|
+
"!src/data/gear-art-hd.only/",
|
|
31
35
|
"docs/"
|
|
32
36
|
],
|
|
33
37
|
"engines": {
|
|
@@ -39,9 +43,16 @@
|
|
|
39
43
|
"check": "node --import ./src/cli/register.mjs src/cli/bootCheck.mjs",
|
|
40
44
|
"data:pack": "node scripts/pack-data.mjs",
|
|
41
45
|
"data:unpack": "node scripts/pack-data.mjs --unpack",
|
|
46
|
+
"art:bake": "node scripts/bake-model-art.mjs && node scripts/bake-model-art.mjs --worn",
|
|
47
|
+
"art:gear": "python scripts/bake-gear-art.py",
|
|
48
|
+
"art:icons": "node scripts/bake-icon-art.mjs",
|
|
49
|
+
"art:map": "node scripts/bake-world-map.mjs && node scripts/bake-world-map.mjs --sixel",
|
|
50
|
+
"art:hd": "node scripts/bake-model-art.mjs --hd && node scripts/bake-icon-art.mjs --hd && python scripts/bake-gear-art.py --hd",
|
|
51
|
+
"art:publish": "node scripts/publish-hd-art.mjs",
|
|
42
52
|
"build:exe": "node scripts/build-exe.mjs",
|
|
43
53
|
"check:tui": "node --import ./src/cli/register.mjs src/cli/tuiCheck.mjs",
|
|
44
54
|
"check:pipe": "node scripts/tui-pipe-check.mjs",
|
|
55
|
+
"check:perf": "node --import ./src/cli/register.mjs src/cli/perfCheck.mjs",
|
|
45
56
|
"check:all": "npm run check && npm run check:tui && npm run check:pipe"
|
|
46
57
|
}
|
|
47
58
|
}
|
package/src/autopilot/plan.ts
CHANGED
|
@@ -46,6 +46,8 @@ import {
|
|
|
46
46
|
prereqMet,
|
|
47
47
|
dropperNoiseFloorFor,
|
|
48
48
|
compareQuestDroppers,
|
|
49
|
+
pickQuestDropper,
|
|
50
|
+
dropperPickSalt,
|
|
49
51
|
} from '../quests/quests.ts';
|
|
50
52
|
import { ownedInventory } from '../domain/items/keyring.ts';
|
|
51
53
|
import { mailboxAsInventory } from '../domain/economy/mail.ts';
|
|
@@ -1502,17 +1504,12 @@ function planStepCore(
|
|
|
1502
1504
|
});
|
|
1503
1505
|
if (candidates.length > 0) {
|
|
1504
1506
|
// Kill objectives first, then a normal dropper over an elite, then closer, then highest drop.
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
{ level: b.level, chance: itemChance.get(b.entry) ?? 0, rank: b.rank ?? 0 },
|
|
1512
|
-
state.char.level,
|
|
1513
|
-
);
|
|
1514
|
-
return cmp <= 0 ? a : b;
|
|
1515
|
-
});
|
|
1507
|
+
// One of the near-equal pool, rotated per fight — not the same template every pull.
|
|
1508
|
+
const kills = candidates.filter((h) => killNeed.has(h.entry));
|
|
1509
|
+
const ranked = (kills.length > 0 ? kills : candidates)
|
|
1510
|
+
.map((h) => ({ h, level: h.level, chance: itemChance.get(h.entry) ?? 0, rank: h.rank ?? 0 }))
|
|
1511
|
+
.sort((a, b) => compareQuestDroppers(a, b, state.char.level) || a.h.entry - b.h.entry);
|
|
1512
|
+
const target = pickQuestDropper(ranked, state.char.level, dropperPickSalt(state))!.h;
|
|
1516
1513
|
questFight = { creatureEntry: target.entry, questEntry: local.entry };
|
|
1517
1514
|
}
|
|
1518
1515
|
}
|