commit b730deb368981b2a58154f3ff2112f0f883de19c
parent 66b87639b143d5245c2e3a492bcd4e895f7188c4
Author: anon <anon@example.com>
Date: Thu, 5 Nov 2026 21:40:14 +0000
Stock early Gripo rifles and Kerans SMGs in basic shops
Diffstat:
7 files changed, 136 insertions(+), 66 deletions(-)
diff --git a/TODO.md b/TODO.md
@@ -113,19 +113,18 @@ research separately. More screenshots and test cases do not count as new gamepla
recovery/ammunition packages under an explicit provisional stock policy;
all four pass native buy/sell, cancel, recovery use, bullet reload, reconnect
and cold recovery checks. The three basic weapon terminals now add QL5/10
- M-10 pistols, E-Beamers, Vektors and Sledgehammers alongside ammunition.
- All three pass native purchase, equip,
+ M-10 pistols, E-Beamers, Vektors, Sledgehammers, Gripo rifles and Kerans SMGs
+ alongside ammunition. All three pass native purchase, equip,
reload/attack, cancellation, reconnect and cold recovery for these families.
Thirty-six crystal terminals now carry 19 original early nanos with complete
supported contracts; all 36 pass native buy/sell, cancel, upload/cast and
reconnect/cold recovery, with every row covered by server regressions.
123 placements remain empty. Meta-Physicist combat nanos and pet attacks,
- Engineer robots and other unfinished profession essentials
- remain open alongside rifle/SMG upgrades, visible specialty-terminal
- limitations and ordinary-reward affordability. Funded fixtures do not establish
- affordability; the stock ledger also records unfinished weapon specials
- rather than claiming complete combat
- support from a successful ordinary attack.
+ Engineer robots and other unfinished profession essentials remain open,
+ alongside visible specialty-terminal limitations and ordinary-reward
+ affordability. Funded fixtures do not establish affordability; the stock
+ ledger also records unfinished weapon specials rather than claiming complete
+ combat support from a successful ordinary attack.
## P0: playable and releasable
diff --git a/docs/early-shop-stock.md b/docs/early-shop-stock.md
@@ -11,7 +11,7 @@ browse/buy/use behavior.
Baseline: 163 placements had no catalog rows, including all four training-ground
terminals. The training terminals now each carry seven recovery/ammunition rows,
leaving 159 empty placements before nano stock. The three basic weapon terminals
-contain four ammunition packages and eight weapon rows. Thirty-six profession and
+contain four ammunition packages and twelve weapon rows. Thirty-six profession and
general crystal terminals now stock an early subset, leaving 123 empty placements.
The three Meta-Physicist terminals still lack usable early combat stock.
@@ -68,7 +68,7 @@ check is claimed by this change. A5 remains open.
## Basic weapon upgrades
The Omni, Clan and Neutral basic weapon terminals share a fixed QL5/10 subset
-of four reviewed original families. Membership and fixed qualities are explicit
+of six reviewed original families. Membership and fixed qualities are explicit
alpha policy, not recovered historical stock or rotation. The four existing
ammunition rows stay first; Budget ammunition terminals retain their separate
four-row catalog. Original requirements, quality interpolation, package sizes,
@@ -84,16 +84,22 @@ buy/sale modifiers and empty finite-weapon magazines are preserved.
| Vektor ND Shotgun | 124258 | 10 | 2948 | 3095 | Energy |
| Cracked Sledgehammer | 129026 | 5 | 1256 | 1318 | None |
| Cracked Sledgehammer | 129026 | 10 | 1653 | 1735 | None |
+| Gripo-Com AKR1K20 | 123976 | 5 | 4913 | 5158 | Bullets |
+| Gripo-Com AKR1K20 | 123976 | 10 | 6145 | 6452 | Bullets |
+| Cheap OT Kerans Automatic Grinner | 160476 | 5 | 3106 | 3261 | Bullets |
+| Cheap OT Kerans Automatic Grinner | 160476 | 10 | 4049 | 4251 | Bullets |
Prices precede Computer Literacy discounts. Original family audits and consumer
coverage are in [M-10 pistols](catalog-weapons.md), [E-Beamers](e-beamer.md),
-[Vektors](vektor-shotguns.md) and [Sledgehammers](sledgehammer.md). All four support
-ordinary attacks. M-10/E-Beamer Fling uses the existing handler. Sledgehammer
-Brawl/Dimach remain unimplemented shared actions; stock does not complete them.
-Rifle/SMG upgrades and unfinished profession essentials remain outstanding. These funded checks
-do not establish that ordinary early rewards can pay the listed prices.
+[Vektors](vektor-shotguns.md), [Sledgehammers](sledgehammer.md),
+[Gripo rifles](gripo-rifles.md) and [Kerans SMGs](kerans.md). All six support ordinary
+attacks. M-10/E-Beamer Fling uses the existing handler. Sledgehammer Brawl/Dimach,
+Gripo Aimed Shot and Kerans Burst remain unimplemented shared actions; stock does
+not complete them. The Kerans also applies its original +2 Sense wear bonus.
+Unfinished profession essentials remain outstanding. These funded checks do not
+establish that ordinary early rewards can pay the listed prices.
-### Weapon verification, November 5
+### Initial four-family verification, November 5
The new production-stock regression first failed for all 24 faction/family/quality
combinations. All now pass purchase, exact price and identity, repeated Accept,
@@ -131,6 +137,41 @@ intermittently intercepted camera drag. The passing runs retain the full
purchase/use/recovery assertions. These checks close the missing stock for this
four-family subset, not A5's remaining content, specialty labels or affordability.
+### Rifle/SMG extension and six-family verification, November 5
+
+The Gripo and Kerans rows complete this early rifle/SMG stock subset. Their
+original family handlers already support ordinary attacks and bullet reloads;
+this change adds shop membership rather than new weapon behavior. The expanded
+`TestBasicShopWeaponsPurchaseWearAndRecover` passes all 36 faction/family/quality
+cases, including exact prices, repeated Accept, wear and cold recovery. The
+level-ten checkpoint uses raw Rifle/Aimed Shot 36/17 and SMG/Burst 40/30, each
+within its native training cap. All seven focused regression roots pass, covering
+stock admission, ammunition packages, partial reloads and transaction retry.
+
+The existing browser scenario now passes all three shops with all 16 catalog
+rows observed through real scrolling. It buys all six QL10 families, two bullet
+packages and one energy package, sells the axe and cancels a QL5 rifle basket.
+Every weapon equips and deals an ordinary hit to the visibly picked Leet; both
+native damage and magazine counts agree with the server. Kerans loads 100 rounds
+from one package, waits for reload cooldown, then fills to 120 from the other.
+Final gun magazines are 19/19/39/7/119, with 52 carried Bullets and 40 Energy
+rounds; the exhausted second bullet package is removed. Exact identities,
+qualities, slots, magazines and credits survive page and cold recovery. Final
+cash is 28,293 Omni or 26,932 Clan/Neutral from the controlled 50,000-credit fund.
+
+The harness identifies the catalog separately from the purchase basket, which
+uses the same native item identities. It uses the browser's existing world-wheel
+camera control to frame the target, and waits for observed reload cooldowns
+between ammunition transfers. Catalog and combat captures were inspected.
+
+Passing artifacts are `local/alpha-weapons/20261105-133418/` with placement
+subdirectories `c005049f`, `c026049c` and `c01204a2`. The three-shop run took
+299.48 seconds. Logs are `local/alpha-rifle-smg/browser-final.log` and
+`regressions.log`. `go vet ./server`, JavaScript syntax and diff checks also pass
+(`vet.log`). Test servers and Chromium processes were closed. The remaining
+A5 work is profession essentials, visible unsupported-terminal limitations and
+ordinary-reward affordability; Aimed Shot/Burst are still explicit combat gaps.
+
## Basic nano crystals
The eleven stocked profession categories each supply one useful original early
@@ -260,7 +301,7 @@ labels are still part of A5's outstanding specialty/unsupported UI work.
| 1180 | `0xc023049c` | 99513 | Clan Basic Augmentations | 0 | 194.07, 4.61, 181.14 |
| 1180 | `0xc024049c` | 99508 | Clan Basic Medic Supplies | 3 | 191.89, 4.61, 163.94 |
| 1180 | `0xc025049c` | 99527 | Clan Basic Tools | 2 | 207.15, 4.61, 162.87 |
-| 1180 | `0xc026049c` | 99505 | Clan Basic Weapons | 12 | 209.83, 4.61, 163.72 |
+| 1180 | `0xc026049c` | 99505 | Clan Basic Weapons | 16 | 209.83, 4.61, 163.72 |
| 1180 | `0xc027049c` | 99526 | Clan Clothes | 0 | 191.44, 4.61, 180.06 |
| 1180 | `0xc028049c` | 117749 | Clan Maps | 5 | 190.87, 4.61, 177.60 |
| 1180 | `0xc029049c` | 155602 | Clan Basic Devices | 1 | 190.89, 4.61, 166.80 |
@@ -282,7 +323,7 @@ labels are still part of A5's outstanding specialty/unsupported UI work.
| 1183 | `0xc002049f` | 99484 | OT Basic Augmentations | 0 | 182.00, 5.00, 131.60 |
| 1183 | `0xc003049f` | 99481 | OT Basic Medical Supplies | 3 | 182.00, 5.00, 135.60 |
| 1183 | `0xc004049f` | 99491 | OT Basic Tools | 2 | 192.00, 5.00, 135.50 |
-| 1183 | `0xc005049f` | 99478 | OT Basic Weapons | 12 | 192.00, 5.00, 127.50 |
+| 1183 | `0xc005049f` | 99478 | OT Basic Weapons | 16 | 192.00, 5.00, 127.50 |
| 1183 | `0xc006049f` | 99490 | OT Clothes | 7 | 182.00, 5.00, 139.60 |
| 1183 | `0xc007049f` | 117649 | OT Maps | 5 | 196.70, 5.00, 129.00 |
| 1183 | `0xc008049f` | 155599 | Basic Bookstore | 0 | 192.00, 5.00, 131.00 |
@@ -371,7 +412,7 @@ labels are still part of A5's outstanding specialty/unsupported UI work.
| 1186 | `0xc00f04a2` | 99598 | Basic Augmentations | 0 | 166.67, 5.00, 119.51 |
| 1186 | `0xc01004a2` | 99574 | Basic Medic Supplies | 3 | 166.62, 5.00, 129.14 |
| 1186 | `0xc01104a2` | 99601 | Basic Tools | 2 | 183.31, 5.00, 129.35 |
-| 1186 | `0xc01204a2` | 99572 | Basic Weapons | 12 | 183.24, 5.00, 121.60 |
+| 1186 | `0xc01204a2` | 99572 | Basic Weapons | 16 | 183.24, 5.00, 121.60 |
| 1186 | `0xc01304a2` | 99637 | Clothes | 0 | 171.16, 5.00, 133.32 |
| 1186 | `0xc01404a2` | 118050 | Maps | 5 | 179.03, 5.00, 133.33 |
| 1186 | `0xc01504a2` | 155599 | Basic Bookstore | 0 | 180.75, 5.00, 116.68 |
diff --git a/docs/gripo-rifles.md b/docs/gripo-rifles.md
@@ -48,7 +48,10 @@ Bounded period searches did not establish14.9.1 acquisition. The local Fandom
FTS has no Gripo match. A later first-person
[2008 player guide](https://gamefaqs.gamespot.com/pc/913777-anarchy-online/faqs/46197)
discusses the Gripo series, but does not establish target-era stock or loot
-membership. Production shop, mission and creature selections are unchanged.
+membership. The alpha now stocks fixed QL5/10 Gripo-Com AKR1K20 rows in all three
+basic weapon shops under an explicit provisional policy; see
+[early shop stock](early-shop-stock.md). This does not establish historical
+acquisition or rotation.
## Focused verification
diff --git a/docs/kerans.md b/docs/kerans.md
@@ -49,7 +49,9 @@ Raw bytes and the full independent audit are under `local/kerans/original/`.
Bounded web searches supplied no period acquisition evidence. The local Fandom
`Fixer:Weapons` guide, touched June2015, mentions OT vendors and mission rolling;
this later guide does not establish 14.9.1 membership or distributions. Original
-acquisition remains open and production stock, missions and drops are unchanged.
+acquisition remains open. The alpha now stocks fixed QL5/10 Cheap OT Kerans rows
+in all three basic weapon shops under an explicit provisional policy; see
+[early shop stock](early-shop-stock.md).
## Focused verification
diff --git a/server/basic_shop_weapons_test.go b/server/basic_shop_weapons_test.go
@@ -15,10 +15,12 @@ func trainBasicShopWeaponFixture(t *testing.T, player *character) {
player.stats.Abilities = characterAbilitiesStats{36, 36, 36, 36, 36, 36}
player.stats.Ranged.Pistol, player.stats.Ranged.Shotgun, player.stats.Ranged.RangedEnergy = 40, 40, 40
player.stats.Ranged.AssaultRifle, player.stats.Ranged.FlingShot = 25, 22
+ player.stats.Ranged.Rifle, player.stats.Ranged.AimedShot = 36, 17
+ player.stats.Ranged.SubmachineGun, player.stats.Ranged.Burst = 40, 30
player.stats.Melee.TwoHandBlunt, player.stats.Body.Brawling, player.stats.Body.Dimach = 34, 20, 10
player.stats.TradeRepair.ComputerLiteracy = 0
for stat, raw := range map[uint32]uint16{16: 36, 17: 36, 18: 36, 19: 36, 20: 36, 21: 36,
- 112: 40, 115: 40, 133: 40, 116: 25, 150: 22, 107: 34, 142: 20, 144: 10} {
+ 112: 40, 115: 40, 133: 40, 116: 25, 150: 22, 107: 34, 142: 20, 144: 10, 113: 36, 151: 17, 114: 40, 148: 30} {
if uint32(raw) > player.trainingMaximum(stat) {
t.Fatal("controlled level-ten skill exceeds native training cap", stat, raw, player.trainingMaximum(stat))
}
@@ -32,6 +34,8 @@ func TestBasicShopWeaponsPurchaseWearAndRecover(t *testing.T) {
{Template: 122121, Quality: 5}, {Template: 122121, Quality: 10},
{Template: 124258, Quality: 5}, {Template: 124258, Quality: 10},
{Template: 129026, Quality: 5}, {Template: 129026, Quality: 10},
+ {Template: 123976, Quality: 5}, {Template: 123976, Quality: 10},
+ {Template: 160476, Quality: 5}, {Template: 160476, Quality: 10},
} {
t.Run(fmt.Sprintf("%x/%d/QL%d", machineID, row.Template, row.Quality), func(t *testing.T) {
world, _ := newPurchaseWorld(t)
@@ -53,7 +57,7 @@ func TestBasicShopWeaponsPurchaseWearAndRecover(t *testing.T) {
if err := world.handleShopUse(client, request); err != nil {
t.Fatal(err)
}
- if client.shop == nil || len(client.shop.stock) != 12 || client.shop.stock[index+4] != row {
+ if client.shop == nil || len(client.shop.stock) != 16 || client.shop.stock[index+4] != row {
t.Fatal("basic weapon terminal lacks its early upgrade row")
}
if err := world.handleTrade(client, shopTradePacket([2]uint32{50000, 1}, 4, [2]uint32{51035, machineID}, [2]uint32{111, uint32(index + 4)})[20:]); err != nil {
@@ -73,9 +77,9 @@ func TestBasicShopWeaponsPurchaseWearAndRecover(t *testing.T) {
}
world.advanceEquipment(client.equipment.readyAt)
cold := newTestInventoryServer(t).characters[1]
- prices := []uint32{2525, 3354, 3181, 4185, 2610, 2948, 1256, 1653}
+ prices := []uint32{2525, 3354, 3181, 4185, 2610, 2948, 1256, 1653, 4913, 6145, 3106, 4049}
if machine.Playfield != 1183 {
- prices = []uint32{2651, 3521, 3340, 4394, 2740, 3095, 1318, 1735}
+ prices = []uint32{2651, 3521, 3340, 4394, 2740, 3095, 1318, 1735, 5158, 6452, 3261, 4251}
}
if cold.inventory.Credits != 10000-prices[index] || cold.inventory.Items[1].Slot != 6 || cold.attackWeapon() == nil || *cold.attackWeapon().Quality != row.Quality ||
diff --git a/server/gamedata/shop_stock.yaml b/server/gamedata/shop_stock.yaml
@@ -66,6 +66,10 @@
- {template: 124258, quality: 10}
- {template: 129026, quality: 5}
- {template: 129026, quality: 10}
+ - {template: 123976, quality: 5}
+ - {template: 123976, quality: 10}
+ - {template: 160476, quality: 5}
+ - {template: 160476, quality: 10}
99505: *basic_weapons
99572: *basic_weapons
diff --git a/tools/client/test_basic_shop_weapons.mjs b/tools/client/test_basic_shop_weapons.mjs
@@ -28,83 +28,97 @@ try {
if (!game.state.camera.firstPerson) await game.key('F8');
await game.key('KeyI');
evidence.before = await server();
+ const seenCatalog = new Set();
+ const catalogGrid = state => state.grids.find(grid => grid.rows === 4 && grid.cells.some(cell => cell.identity[0] === 111));
+ const catalogRow = async index => {
+ while (!catalogGrid(game.state).cells.some(cell => cell.identity[0] === 111 && cell.identity[1] === index && !cell.dummy)) {
+ const grid = catalogGrid(game.state);
+ const source = grid.cells[0];
+ const point = await game.point((source.bounds[0] + source.bounds[2]) / 2, (source.bounds[1] + source.bounds[3]) / 2);
+ await page.mouse.move(point.x, point.y);
+ await page.mouse.wheel(0, index < grid.firstRow * 3 ? -120 : 120);
+ await game.wait('weapon catalog scrolls', state => catalogGrid(state)?.firstRow !== grid.firstRow);
+ }
+ for (const source of catalogGrid(game.state).cells) {
+ if (source.identity[0] === 111 && !source.dummy) seenCatalog.add(source.identity[1]);
+ }
+ return catalogGrid(game.state).cells.find(cell => cell.identity[0] === 111 && cell.identity[1] === index && !cell.dummy);
+ };
const open = async keyboard => {
await game.click(...await game.pick(51035, evidence.before.machine), keyboard ? 'left' : 'right');
if (keyboard) await game.key('KeyE');
- await game.wait('twelve basic weapon catalog rows', () =>
- Array.from({length: 12}, (_, index) => cell(111, index)).every(Boolean));
+ await game.wait('basic weapon catalog opens', catalogGrid);
+ await catalogRow(0);
assert((await server()).open);
};
await open(false);
await game.save(output + '/catalog');
- // Buy each QL10 family with both required ammunition packages, selling loot.
- for (const [count, index] of [0, 1, 5, 7, 9, 11].entries()) {
- await click(cell(111, index));
+ // Buy all six QL10 families, two bullet packages and energy ammo, selling loot.
+ for (const [count, index] of [0, 0, 1, 5, 7, 9, 11, 13, 15].entries()) {
+ await click(await catalogRow(index));
await waitServer('purchase row selected', state => state.purchases === count + 1);
}
+ assert.equal(seenCatalog.size, 16);
+ evidence.catalogRows = [...seenCatalog].sort((a, b) => a - b);
+ await game.save(output + '/catalog-bottom');
await click(cell(104, 48));
await game.wait('sale loot picked', state => state.dragged[0] === 104);
await game.click(860, 412);
await waitServer('loot offered', state => state.sales === 1);
await game.save(output + '/basket');
await game.click(873, 475);
- await waitServer('weapons committed', state => !state.open && state.inventory.Items.length === 6);
+ await waitServer('weapons committed', state => !state.open && state.inventory.Items.length === 9);
evidence.purchased = await server();
- assert.equal(evidence.purchased.inventory.Credits, evidence.before.playfield === 1183 ? 38512 : 37661);
+ assert.equal(evidence.purchased.inventory.Credits, evidence.before.playfield === 1183 ? 28293 : 26932);
assert.deepEqual(evidence.purchased.inventory.Items.map(item => [item.ID, item.Template, item.Quality, item.Count, item.Ammo]), [
- [2, 21605, 1, 100, 0], [3, 21609, 1, 100, 0], [4, 123742, 10, 1, 0],
- [5, 122121, 10, 1, 0], [6, 124258, 10, 1, 0], [7, 129026, 10, 1, 0],
+ [2, 21605, 1, 100, 0], [3, 21605, 1, 100, 0], [4, 21609, 1, 100, 0],
+ [5, 123742, 10, 1, 0], [6, 122121, 10, 1, 0], [7, 124258, 10, 1, 0],
+ [8, 129026, 10, 1, 0], [9, 123976, 10, 1, 0], [10, 160476, 10, 1, 0],
]);
// A cancelled QL5 basket leaves the completed transaction untouched.
await open(true);
- await click(cell(111, 4));
+ await click(await catalogRow(12));
await waitServer('cancel draft selected', state => state.purchases === 1);
await game.click(945, 475);
await waitServer('draft cancelled', state => !state.open);
assert.deepEqual((await server()).inventory, evidence.purchased.inventory);
await page.keyboard.press('Control+1');
- // Look down at the nearby Leet so the attack uses visible native picking.
+ // Use the browser's world-wheel camera control to frame the nearby Leet.
const cameraPoint = await game.point(400, 200);
- let mouseY = cameraPoint.y, sequence = game.sequence;
- await page.mouse.move(cameraPoint.x, mouseY);
- await game.snapshot();
- sequence = game.sequence;
- await page.mouse.down({button: 'right'});
- try {
- await game.waitInput(sequence, 1025);
- const deadline = Date.now() + 10000;
- for (;;) {
- await game.snapshot();
- const y = game.state.actors.find(actor => actor.type === 50000 && actor.id === evidence.before.target).screenPosition[1];
- if (y >= 500 && y <= 600) break;
- assert(Date.now() < deadline, 'Camera did not frame the controlled Leet');
- mouseY += y > 600 ? 20 : -20;
- await page.mouse.move(cameraPoint.x, mouseY, {steps: 2});
- }
- } finally {
- sequence = game.sequence;
- await page.mouse.up({button: 'right'});
+ await page.mouse.move(cameraPoint.x, cameraPoint.y);
+ const deadline = Date.now() + 10000;
+ for (;;) {
+ await game.snapshot();
+ const y = game.state.actors.find(actor => actor.type === 50000 && actor.id === evidence.before.target).screenPosition[1];
+ if (y >= 500 && y <= 600) break;
+ assert(Date.now() < deadline, 'Camera did not frame the controlled Leet');
+ const angles = game.state.camera.angles;
+ await page.mouse.wheel(0, y > 600 ? 40 : -40);
+ await game.wait('world wheel changes the camera', state =>
+ state.camera.angles.some((angle, index) => angle !== angles[index]));
}
- await game.wait('mouse look released', () => game.events.some(event =>
- event.sequence > sequence && event.kind === 'input' && event.stage === 'consumed' && event.type === 1026));
evidence.used = [];
- for (const [id, ammoSlot, clip] of [[4, 48, 20], [5, 49, 20], [6, 49, 40], [7, null, null]]) {
+ for (const [id, reloads] of [
+ [5, [[48, 20]]], [6, [[50, 20]]], [7, [[50, 40]]], [8, []],
+ [9, [[48, 8]]], [10, [[49, 100], [48, 120]]],
+ ]) {
await waitServer('previous weapon recharge finished', state => !state.recharging && state.fighting === 0);
await click(cell(104, game.local().inventory.find(item => item.id === id).slot), 'right');
await game.wait('purchased weapon equipped', state =>
game.local(state).inventory.some(item => item.id === id && item.slot === 6), 15000);
await waitServer('server agrees on equipped identity', state => state.inventory.Items.find(item => item.ID === id).Slot === 6);
- if (ammoSlot !== null) {
+ for (const [ammoSlot, clip] of reloads) {
await click(cell(104, ammoSlot));
await game.wait('ammunition picked', state => state.dragged[0] === 104 && state.dragged[1] === ammoSlot);
await game.click(867, 206, 'right');
await waitServer('purchased weapon loaded', state => state.inventory.Items.find(item => item.ID === id).Ammo === clip);
await game.wait('native loaded clip agrees', state => game.local(state).weapons.some(weapon => weapon.slot === 6 && weapon.loadedAmmo === clip));
await game.wait('native reload action finished', state => !game.local(state).actions.includes(6));
+ await waitServer('reload cooldown finished', state => !state.recharging);
}
// One ordinary attack must damage the controlled target and consume one round.
@@ -115,24 +129,27 @@ try {
await game.key('KeyQ');
await waitServer('attack stopped', state => state.fighting === 0);
const used = await server();
- assert.equal(used.inventory.Items.find(item => item.ID === id).Ammo, clip === null ? 0 : clip - 1);
- await game.wait('native target damage agrees', state =>
- state.actors.find(actor => actor.type === 50000 && actor.id === used.target)?.stats[27] === used.targetHealth);
+ const expectedAmmo = reloads.length ? reloads.at(-1)[1] - 1 : 0;
+ assert.equal(used.inventory.Items.find(item => item.ID === id).Ammo, expectedAmmo);
+ await game.wait('native target damage and magazine agree', state =>
+ state.actors.find(actor => actor.type === 50000 && actor.id === used.target)?.stats[27] === used.targetHealth &&
+ (!reloads.length || game.local(state).weapons.some(weapon => weapon.slot === 6 && weapon.loadedAmmo === expectedAmmo)));
evidence.used.push(used);
await game.save(output + '/used-' + id);
}
const final = await server();
- assert.equal(final.inventory.Items.find(item => item.ID === 2).Count, 80);
- assert.equal(final.inventory.Items.find(item => item.ID === 3).Count, 40);
+ assert.equal(final.inventory.Items.find(item => item.ID === 2).Count, 52);
+ assert.equal(final.inventory.Items.find(item => item.ID === 4).Count, 40);
+ assert(!final.inventory.Items.some(item => item.ID === 3));
await page.reload();
await game.ready();
evidence.reconnected = await server();
assert.deepEqual(evidence.reconnected.inventory, final.inventory);
- for (const [id, slot] of [[4, 51], [5, 52], [6, 53], [7, 6]]) {
+ for (const [id, slot] of [[5, 52], [6, 53], [7, 54], [8, 55], [9, 56], [10, 6]]) {
assert(game.local().inventory.some(item => item.id === id && item.slot === slot && item.quality === 10));
}
assert.deepEqual(game.errors, []);
- console.log('PASS:', evidence.before.machine, 'QL5/10 catalog, four purchased QL10 weapons used, buy/sell, E/cancel and reconnect');
+ console.log('PASS:', evidence.before.machine, 'QL5/10 catalog, six purchased QL10 weapons used, buy/sell, E/cancel and reconnect');
} finally {
try {
await fs.mkdir(output, {recursive: true});