aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


commit 825fe72223e02fb8cbf8980c273c4b7b5392a73c
parent 05a6132162a75f800a3fa9cc912fca8fb5200a47
Author: anon <anon@example.com>
Date:   Sun, 25 Oct 2026 22:36:28 +0000

Apply native nano range modifiers through shared casting rules

Use signed equipment/nano stat381, native integer percentage arithmetic and
the40 cap for both cast admission and completion. Match the complete native
spatial call chain, including its final float32 distance check.

Admit ten complete range programs and crystals without program-specific
dispatch. Preserve all companions, expanding the signed cost census to14.
Keep33 special profession contracts and incomplete implants rejected whole.

Verify complete original records, strict boundaries, refresh/expiry, cold
restore, completion refunds and SQL/COMMIT rollback. Two GPU WASM clients
verify stacking, real boundary rejection, exact37 refund and preserved items.

All9189 server checks and18 game-data checks pass;113 focused boundary checks,
286 checks across two race repetitions, build and vet also pass. Owned clients
and fixtures are cleaned up, with one default-port LAN preview left available.

Diffstat:
MTODO.md | 21++++++++++++++++++---
Mdocs/combat-client-stats.md | 4++++
Mdocs/nano-cost.md | 22+++++++++++++---------
Mdocs/nano-damage.md | 7++++---
Adocs/nano-range.md | 152+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mserver/nano_buffs.go | 2+-
Mserver/nano_casting.go | 15++++++++++++---
Mserver/nano_cost_test.go | 12+++++++++---
Aserver/nano_range_catalog_test.go | 183+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aserver/nano_range_test.go | 292+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mserver/stat_buff_catalog_test.go | 10++++++++--
Mserver/testdata/nano-cost-nanos.json | 7++++++-
Aserver/testdata/nano-range-nanos.json | 12++++++++++++
13 files changed, 714 insertions(+), 25 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -143,7 +143,7 @@ unverified mass/deletion/reclaim policies are in [backpacks](docs/backpacks.md). implants with other unsupported effects still reject as whole items. - [ ] Complete the remaining 6,256 implant contracts before admitting them. Implement consumers for absorption226/227/228/229/230/231/233/234 and stats - 277/381/383; establish each original rule before naming unknown + 277/383 and complete range381 admission; establish each original rule before naming unknown stats. Support conditional OnWear130263, Notum Splice204649's complete usable effect, and the unclassified sections of six additional dungeon implants. Do not grant partial effects. Complete records and rejected fixtures are in @@ -745,8 +745,23 @@ introduction and starting-item gameplay remain open below. ## Nanos and effects -- [x] Verify generic NanoCostModifier318 consumption and nine complete ordinary - cost-reduction programs/crystals. Check signed tank/CPU/nano contributions, +- [x] Verify shared NanoRange381 consumption and the ten complete ordinary + range programs/crystals, including three CrunchCom cost companions and two + positive cost penalties. Check signed percentage arithmetic, the40 cap, + complete 3D distance gates, device/nano stacking, recipient independence, completion refunds, + lifecycle/SQL failures, both WASM replicas and cold restore. See + [nano range](docs/nano-range.md). +- [ ] Admit and verify the708 complete range381 implant contracts after their + shared consumer is verified. Preserve every companion and keep the148 other + range-bearing implants rejected until their complete effects are supported. + Cover all four authored qualities, all slots, strict requirements, delayed + surgery, rollback, item conservation and native/cold recovery. Original + complete records are in `local/nano-range-research/records.json` and + `implant-followup-fixtures.json` in that directory. There are177 complete + contracts per quality, across right arm36, left arm38 and left hand44; + the remaining148 need defense277 or absorption consumers. +- [x] Verify generic NanoCostModifier318 consumption and fourteen complete ordinary + cost-modifier programs/crystals. Check signed tank/CPU/nano contributions, exact affordability, zero-cost casts, modifier changes during execution, atomic failures, native recipient/observer state and cold restore. See [nano cost modifiers](docs/nano-cost.md). diff --git a/docs/combat-client-stats.md b/docs/combat-client-stats.md @@ -289,6 +289,10 @@ for every model needs the spatial construction trace; a flat four-meter center-distance rule is only an approximation. The exported optimum-range getter uses half the unmodified item range for its selected weapon. Further target and line-of-sight checks are in the state-machine report. +Nano admission10064af8..10064b19 first truncates its 3D distance, then invokes +10066310, whose second gate compares a binary32 distance directly against the +signed range result. [Nano range](nano-range.md) records the complete shared +consumer, percentage boundaries and server-policy limits. ## Health, nano and regeneration diff --git a/docs/nano-cost.md b/docs/nano-cost.md @@ -36,8 +36,8 @@ The original server's charge time and refund policy remain unverified. ## Complete program contracts -The shared Skill/Modify predicate admits nine complete programs and their nine -ordinary crystals. Each contains only one unconditional selected-recipient +The shared Skill/Modify predicate admits fourteen complete cost-modifier +programs and their ordinary crystals. Nine cost-only programs each contain one unconditional selected-recipient Skill53012 effect for stat318, with one tick, zero interval and a zero third argument. They all share strain148 and use the existing NCU/replacement rules. @@ -55,19 +55,23 @@ argument. They all share strain148 and use the existing NCU/replacement rules. Crystal and cast admission retain every strict skill and visual-profession criterion. MP and NT cost programs replace one another within the same strain. -The three CrunchCom programs with range381 companions, hostile cost programs, -profession-changing programs and mixed periodic contracts remain unsupported -as whole programs. Complete stat318 implants use the same consumer under +Three complete CrunchCom programs also extend range, while Nano Cloud +Supplement and Notum Overload extend range and add positive cost penalties. +Their complete companions and lifecycle share [range handling](nano-range.md). +Hostile cost programs, profession-changing programs and mixed periodic +contracts remain unsupported as whole programs. Complete stat318 implants use the same consumer under [implant admission and surgery rules](implants.md#nano-cost-modifiers). -Ordinary buff admission is457 programs and455 crystals. +Ordinary buff admission is467 programs and465 crystals. ## Evidence and verification The complete original resource audit reparsed989 records:937 stat318 producers and52 linked uploader records. Program/equipment profiles retain all companions, -conditions, selectors, framing and metadata. The deterministic nine-program +conditions, selectors, framing and metadata. The deterministic fourteen-program fixture is [nano-cost-nanos.json](../server/testdata/nano-cost-nanos.json), SHA-256 -`d6e2bddd2148b07c3531e2266dd8e50c7a63483128891ce1841c5e55ed21c1c9`. +`48cdfb9bb1313280d2842359b3e4d88d76a4ec4693c3cb2ae601cc4d4d8a1e51`. +The five complete range/cost contracts and their original uploaders are also +independently verified in `local/nano-range-research/program-contract-ledger.json`. The source index SHA-256 is `46e5dc54af9358cc9bff05f4358e86af630e497bc677f361c133c88073b84d71`. Complete records, before/after predicates, hashes and limits are retained in @@ -83,7 +87,7 @@ original KKR SHA-256 the precise observation/inference limits in `local/nano-cost-research/native/README.md`. -Automated tests cover the exact nine-program/crystal census, complete framing +Automated tests cover the exact fourteen-program/crystal census, complete framing and criteria, upload/cast skill boundaries, exact affordability, signed worn contributions, removal/expiry during a reservation, cancellation, completion, restart refunds and SQLite error/ignored-write/commit rollback with retry. diff --git a/docs/nano-damage.md b/docs/nano-damage.md @@ -78,9 +78,10 @@ excludes swimming, falling and flight. The supported server checks forward, strafe and turn state, posture, driving and pending equipment. Movement commands 1/3/5/7/13 or a changed position cancel a pending cast. Orientation-only updates do not infer an interruption rule. -The native range predicate uses direct three-dimensional distance without -creature extents; the server checks the 25-metre boundary at admission and -completion. Active casts defer an existing or newly started weapon attack; +The full native range path checks direct binary32 three-dimensional distance +against the caster's stat381-adjusted integer range, capped at40, without creature extents. +The server applies that shared rule at admission and completion; see +[nano range](nano-range.md). Active casts defer an existing or newly started weapon attack; remaining weapon recharge is suspended rather than spent by casting. Casts can interrupt weapon windup; nano recharge still permits ordinary attacks. See [shared weapon/nano timing](nano-weapon-timing.md) for the phase rules, verification diff --git a/docs/nano-range.md b/docs/nano-range.md @@ -0,0 +1,152 @@ +# Nano range modifiers + +Casting uses the caster's signed equipment and active-program stat381 through +one range calculation. Target admission and completion share the same rule; +the recipient's range bonuses do not extend an incoming cast. + +```text +base = signed NanoItem NFRange287, default20 +modifier = equipment381 + nano381 +product = signed_int32(base * modifier) +range = min(40, trunc(base + product * float32(.01))) +distance = float32(sqrt(dx*dx + dy*dy + dz*dz)) +admitted = distance <= range +``` + +The full cast path has two spatial gates. The first truncates distance, then +calls a second gate for another actor. That gate subtracts the global binary32 +coordinates in the wider intermediate, computes the square root, stores the +distance as binary32, and compares it directly with the integer range. The +server uses this final predicate. The percentage is the +binary32 value0.009999999776482582. For example, base12 with+50 gives17 after +truncation, not18. There is no minimum-range clamp. Zero range accepts only +zero distance after the binary32 store; negative range rejects even the caster +at the first gate. The40-metre cap does not grant a fractional-metre allowance. +No creature extents are added. + +The two original Computer Deck Range Increasers95516/95517 contribute110/150 +through the ordinary equipment path. Belt/deck requirements, exact qualities, +the authored10-second equip delay and removal remain unchanged. Complete +range implants still need their separate admission and lifecycle verification; +an implemented consumer alone does not admit an incomplete item. + +## Complete programs + +Ten ordinary programs and ten single-program crystal uploaders qualify. Every +authored modifier is applied; no program identity dispatches range behavior. + +| Program | Crystal | Range381 | Cost318 | Strain / NCU | +| --- | --- | ---: | ---: | --- | +|CrunchCom Code Sieve95407|95427|5|-6|148 / 4| +|CrunchCom Nano Compressor Pro95412|95423|20|-18|148 / 38| +|CrunchCom Nano Compressor95415|95422|13|-11|148 / 15| +|Nano Cloud Supplement95442|95450|86|2|181 / 46| +|Notum Overload95443|95451|104|4|181 / 54| +|Coherent Nano Pathway95444|95454|50|0|181 / 13| +|Cohesion Amplifier95445|95449|57|0|181 / 20| +|Superior Nano Command95446|95455|67|0|181 / 29| +|Enhance Nano Cohesion95447|95453|42|0|181 / 7| +|Enhance Nano Communication95448|95452|36|0|181 / 2| + +The two strains stack; replacement within each strain removes exactly that +program's complete contribution. Nano Cloud Supplement and Notum Overload +increase casting costs. The three CrunchCom programs reduce costs while also +extending range. All fourteen complete cost-modifier programs are covered by +the [shared signed cost tests](nano-cost.md). + +The full original search has43 stat381 programs. The other33 are special +False/Mimic/Assume Profession contracts and remain rejected as whole programs. +A raw integer search also finds Glacial Cloak55748's HP amount381; that is not +a range selector, and its unimplemented absorption companions keep it rejected. +The47 candidate uploaders include bulk/special contracts, of which only the +ten complete ordinary uploaders qualify here. All44 raw programs and47 item +payloads are hash-checked and independently reparsed from the original resources. + +## Evidence and policy boundaries + +Original `kkr.dll` SHA-256 is +`a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0`. +Range helper10098c10 and initial spatial admission100646a0/10064af8..10064b19 are +retained under evidence IDs +`ev_9081c9ee969a3f64c9cfb5aec6a5d90477aa638090d6ed38e5791a3d0d58eeda` +and `ev_b222a29a2449ed800e75228fac8a9ad597f8c73dce740b461b7fae780389796b`. +Maintained instruction sources are +`client/game/kkr.dll/lifted-0046.c::sub_36098C10` and +`client/game/kkr.dll/lifted-0030.c::sub_360646A0`. +The connected call10064b72 enters +`client/game/kkr.dll/lifted-0030.c::sub_36066310`, with the second comparison at +10066328..10066390. Its body is present in the maintained instruction source; +the bounded retained-report search contains its caller reference only. +Actual WASM casting rejected a selected recipient at12.736 metres for a +12-metre program before any cast19 request, corroborating that second gate. +The signed default/getter pipeline, coefficient bytes, input hashes and exact +instruction findings are in `local/nano-range-research/native/ledger.md`. + +The server deliberately mirrors the complete inspected client predicate. This does not +establish the historical server's tolerance, completion revalidation or +line-of-sight policy. Original runtime x87 control-word/CRT details and the +stat381 trickle-table entry remain unverified in this retained evidence scope. +There is no new binary analysis/export session in this investigation. + +The [range fixtures](../server/testdata/nano-range-nanos.json) retain exact +metadata, complete functions, criteria, getter and attack dictionaries, and +uploader contracts. SHA-256 is +`2a2f16fff6273f3ec57bd68fa9729aa282ec46cea9fd6566412b9ca8ba0ac80e`. +Original source/record hashes are in +`local/nano-range-research/program-contract-ledger.json`. + +## Verification + +Automated checks pin every complete original program and uploader, all33 +special-program rejections, and the raw-search false positive. All ten ordinary +programs exercise upload, refresh without stacking, complete companions, +unchanged trained values, cold load and exact expiry. Casting checks cover +both device qualities, independent strains, signed/zero/negative ranges, +three dimensions, binary32 distance storage and the40 cap. Completion rechecks +the caster's current effects; removal, expiry and target movement cancel and +refund once. The recipient's own range bonus cannot extend an incoming cast. +Failed/ignored SQL and failed COMMIT preserve the old complete effect and +resources; retry replaces both range and cost companions together. + +Two actual GPU WASM clients use owned level200 NT control-panel profiles, +with abilities1300, trained nano skills1000 and NanoInit5. All five chosen +crystals upload through native inventory use. Source range/cost getters agree +on both replicas:36/100,41/94 after CrunchCom,55/94 after Coherent replaces the +weaker strain181 program, and259/83 with Notum Overload, CrunchCom, the QL200 +range device and a CPU. Weaker replacement rejects without a cast request. +The QL50 device adds exactly110 and its removal clears exactly110; QL200 adds150. + +Native GUI casts establish the complete distance boundary:12.736 metres +rejects with the base12 range and succeeds after a range buff. The cap rejects +41.64 metres even when the uncapped result is43, while36.89 succeeds. The CPU +changes that cast's reservation to37. Coherent alone gives a17-metre result: +17.05 rejects and15.95 succeeds, verifying the percentage truncation boundary. + +At full defense, removing Notum Overload during a pending cast drops effective +range below the selected target's distance. Both replicas remove the effect; +the server emits action108 without a result107. Nano points go7107->7070 for +the37 reservation, then7077 after one7-point regeneration visit, then7114 for +the exact37 refund. Recomputing cost after modifier removal would yield35 and +would be incorrect. + +Snapshots, frame/SQLite observations and executable assertions are retained in +`local/nano-range-smoke/`; gameplay uses GUI actions, with read-only heap, wire +and database observations. No runtime gameplay calls or heap writes are injected. + +Cold restarts preserve both program strains at55/94, then the worn QL200 +range device, CPU and Coherent at200/85. Owner inventory proxies retain exact +identities, qualities and endpoints, with the same seven unconsumed instances. +A post-restart Strength Boost reserves38. Removing the owned effects and both +devices returns the source to range0/cost100 without losing an item. Both +browser contexts close without recorded errors. Fixture cleanup removes only +the two owned players and seven items; all unrelated rows are unchanged and +SQLite foreign-key/integrity checks pass. The single preview remains on its +default LAN HTTPS8443 port. + +The full tracked suite passes9,189 server checks and18 game-data checks in +1528.555 server seconds. The focused complete-predicate suite passes113 checks +in19.651 seconds; two race repetitions pass286 checks in139.604 seconds. +Build and vet pass. Final terminals, source hashes and verification reports are +retained in `local/nano-range-research/verification.json`. The initial incomplete +predicate's interrupted run and separate diagnostic failures remain recorded +under their own filenames; they are excluded from these passing results. diff --git a/server/nano_buffs.go b/server/nano_buffs.go @@ -122,7 +122,7 @@ func statBuffNano(program uint32) bool { if value <= 0 { return false } - case 318, 382: + case 318, 381, 382: default: if stat < 100 || stat > 168 || value <= 0 { return false diff --git a/server/nano_casting.go b/server/nano_casting.go @@ -6,6 +6,7 @@ import ( "fmt" "log" "maps" + "math" "math/rand/v2" "slices" "time" @@ -62,6 +63,13 @@ func (player *character) nanoCost(program uint32) int32 { return int32(float64(int32(nanoStat(program, 407))) * float64(modifier) * float64(float32(0.01))) } +func (player *character) nanoRange(program uint32) int32 { + // kkr.dll 10098c10 multiplies signed integers before applying float32 .01. + distance := int32(nanoStat(program, 287)) + modifier := player.equipmentBonus(381) + player.nanoBonus(381) + return min(40, int32(float64(distance*modifier)*float64(float32(0.01))+float64(distance))) +} + func (player *character) nanoCastDelay(program uint32) time.Duration { // kkr.dll 100651b4..1006526b stores initiative reduction before the final duration. stats := player.baseStats() @@ -99,9 +107,10 @@ func (server *server) nanoTarget_locked(player, target *character, client *world second = predictedPosition_locked(target, recipient, now) } first := predictedPosition_locked(player, client, now) - x, y, z := first[0]-second[0], first[1]-second[1], first[2]-second[2] - distance := float32(nanoStat(program, 287)) - return x*x+y*y+z*z <= distance*distance + x, y, z := float64(first[0])-float64(second[0]), float64(first[1])-float64(second[1]), float64(first[2])-float64(second[2]) + // kkr.dll 10066328..10066390 checks the float32 3D distance after its integer gate. + distance := float32(math.Sqrt(x*x + y*y + z*z)) + return distance <= float32(player.nanoRange(program)) } func (server *server) handleNanoCast(client *worldClient, body []byte) error { diff --git a/server/nano_cost_test.go b/server/nano_cost_test.go @@ -72,7 +72,7 @@ func TestNanoCostCatalogMatchesCompleteOriginalContracts(t *testing.T) { slices.Sort(values) } - if len(programs) != 9 || len(crystals) != 9 || !slices.Equal(programs, expectedPrograms) || !slices.Equal(crystals, expectedCrystals) { + if len(programs) != 14 || len(crystals) != 14 || !slices.Equal(programs, expectedPrograms) || !slices.Equal(crystals, expectedCrystals) { t.Fatal("cost admission differs from the independent whole-contract census", programs, crystals) } for _, fixture := range fixtures { @@ -135,9 +135,15 @@ func TestNanoCostProgramsUploadCastRestoreAndRemoveTheirContribution(t *testing. } completed := castTestBuff(t, world, 1, 1, fixture.Program) cold := newTestInventoryServer(t).characters[1] + var costBonus int32 + for _, modifier := range fixture.Modifiers { + if modifier[0] == 318 { + costBonus = modifier[1] + } + } if player.nano != 50000-fixture.Debit || cold.nano != player.nano || player.nanoReserved != 0 || - player.nanoBonus(318) != fixture.Modifiers[0][1] || cold.nanoBonus(318) != fixture.Modifiers[0][1] || + player.nanoBonus(318) != costBonus || cold.nanoBonus(318) != costBonus || player.usedNCU() != fixture.NCU || cold.usedNCU() != fixture.NCU || player.baseStats() != trained || cold.baseStats() != trained || !slices.Equal(cold.inventory.LearnedNanos, []uint32{fixture.Program}) || slices.ContainsFunc(cold.inventory.Items, func(item ownedItem) bool { return item.Template == fixture.Crystal }) || player.activeNanos[0].expiresAt.Sub(completed) != time.Duration(fixture.Duration)*10*time.Millisecond { @@ -164,7 +170,7 @@ func TestNanoCostAffordabilityUsesTheCompleteActiveProgram(t *testing.T) { player.inventory.LearnedNanos = []uint32{fixture.Program, 27169} castTestBuff(t, world, 1, 1, fixture.Program) player.nanoRechargeUntil = time.Time{} - debit := map[uint32]uint32{29307: 36, 95408: 39, 95409: 34, 95410: 41, 95411: 38, 95413: 35, 95414: 39, 95416: 40, 95417: 32}[fixture.Program] + debit := map[uint32]uint32{29307: 36, 95407: 42, 95408: 39, 95409: 34, 95410: 41, 95411: 38, 95412: 36, 95413: 35, 95414: 39, 95415: 40, 95416: 40, 95417: 32, 95442: 45, 95443: 46}[fixture.Program] player.nano = debit if !enough { player.nano-- diff --git a/server/nano_range_catalog_test.go b/server/nano_range_catalog_test.go @@ -0,0 +1,183 @@ +package main + +import ( + "ao/server/gamedata" + _ "embed" + "encoding/json" + "reflect" + "slices" + "testing" +) + +//go:embed testdata/nano-range-nanos.json +var nanoRangeData []byte + +type nanoRangeFixture struct { + combatNanoFixture + Stats [][2]uint32 + Functions []gamedata.ItemFunction + CrystalStats [][2]uint32 `json:"crystal_stats"` + CrystalFunctions []gamedata.ItemFunction `json:"crystal_functions"` +} + +func nanoRangeFixtures(t *testing.T) []nanoRangeFixture { + t.Helper() + var fixtures []nanoRangeFixture + if err := json.Unmarshal(nanoRangeData, &fixtures); err != nil { + t.Fatal(err) + } + return fixtures +} + +func TestNanoRangeCatalogMatchesCompleteOriginalContracts(t *testing.T) { + fixtures := nanoRangeFixtures(t) + + if len(fixtures) != 10 { + t.Fatal("incomplete independent range program census", len(fixtures)) + } + for _, fixture := range fixtures { + if !statBuffNano(fixture.Program) || nanoCrystalProgram(fixture.Crystal) != fixture.Program { + t.Fatal("complete original range contract or uploader rejected", fixture.Program, fixture.Crystal) + } + for _, field := range [][2]uint32{{0, fixture.Flags}, {30, fixture.Can}, {8, fixture.Duration}, {54, fixture.NCU}, {75, fixture.Strain}, + {210, fixture.RechargeDelay}, {287, fixture.Range}, {294, fixture.AttackDelay}, {407, fixture.NanoCost}} { + if nanoStat(fixture.Program, field[0]) != field[1] { + t.Fatal("original range casting metadata changed", fixture.Program, field) + } + } + definition := gamedata.NanoTemplates[fixture.Program] + var actions []gamedata.ItemAction + var weights []gamedata.ItemEntry + var getter [][2]uint32 + var functions []gamedata.ItemFunction + var modifiers [][2]int32 + for _, section := range definition.Sections { + if section.Actions != nil { + actions = append(actions, *section.Actions...) + } + if section.Entries != nil { + weights = append(weights, *section.Entries...) + } + if section.Stats != nil { + getter = append(getter, *section.Stats...) + } + if section.Functions != nil { + functions = append(functions, *section.Functions...) + for _, function := range *section.Functions { + modifiers = append(modifiers, [2]int32{*function.Arguments[0].Integer, *function.Arguments[1].Integer}) + } + } + } + if !slices.Equal(definition.Stats, fixture.Stats) || !slices.Equal(modifiers, fixture.Modifiers) || + !reflect.DeepEqual(functions, fixture.Functions) || !reflect.DeepEqual(actions, fixture.Actions) || + !reflect.DeepEqual(weights, fixture.Weights) || !slices.Equal(getter, fixture.Getter) { + t.Fatal("complete original range stats, effects or casting dictionaries changed", fixture.Program) + } + crystal := gamedata.ItemTemplates[fixture.Crystal] + var crystalActions []gamedata.ItemAction + var crystalFunctions []gamedata.ItemFunction + for _, section := range crystal.Sections { + if section.Actions != nil { + crystalActions = append(crystalActions, *section.Actions...) + } + if section.Functions != nil { + crystalFunctions = append(crystalFunctions, *section.Functions...) + } + } + if *crystal.Quality != fixture.Quality || !slices.Equal(crystal.Stats, fixture.CrystalStats) || + !reflect.DeepEqual(crystalActions, fixture.CrystalActions) || !reflect.DeepEqual(crystalFunctions, fixture.CrystalFunctions) { + t.Fatal("complete original range uploader stats, criteria or functions changed", fixture.Crystal) + } + } +} + +func TestNanoRangeCatalogPreservesOriginalSearchAndRejectionBoundaries(t *testing.T) { + expectedRawPrograms := []uint32{32030, 32032, 32033, 32034, 32035, 32036, 32037, 32038, 32039, 32040, 32041, 55748, + 95407, 95412, 95415, 95442, 95443, 95444, 95445, 95446, 95447, 95448, + 117207, 117208, 117209, 117210, 117211, 117212, 117213, 117214, 117215, 117216, 117217, + 117218, 117219, 117220, 117221, 117222, 117223, 117224, 117225, 117226, 117227, 117228} + expectedRawCrystals := []uint32{32071, 32073, 32074, 32075, 32076, 32077, 32078, 32079, 32080, 32081, 32082, + 38512, 38515, 38520, 55756, 95422, 95423, 95427, 95449, 95450, 95451, 95452, 95453, 95454, 95455, + 117231, 117232, 117233, 117234, 117235, 117236, 117237, 117238, 117239, 117240, 117241, + 117242, 117243, 117244, 117245, 117246, 117247, 117248, 117249, 117250, 117251, 117252} + var rawPrograms, rangePrograms, programs, rawCrystals, crystals []uint32 + var expectedPrograms, expectedCrystals []uint32 + for _, fixture := range nanoRangeFixtures(t) { + expectedPrograms = append(expectedPrograms, fixture.Program) + expectedCrystals = append(expectedCrystals, fixture.Crystal) + } + + for program, definition := range gamedata.NanoTemplates { + var rawCandidate, rangeCandidate bool + for _, section := range definition.Sections { + if section.Functions == nil { + continue + } + for _, function := range *section.Functions { + for _, argument := range function.Arguments { + if argument.Integer != nil && *argument.Integer == 381 { + rawCandidate = true + } + } + if (function.ID == 53012 || function.ID == 53045) && len(function.Arguments) > 0 && + function.Arguments[0].Integer != nil && *function.Arguments[0].Integer == 381 { + rangeCandidate = true + } + } + } + if rawCandidate { + rawPrograms = append(rawPrograms, program) + } + if rangeCandidate { + rangePrograms = append(rangePrograms, program) + if statBuffNano(program) { + programs = append(programs, program) + } + } + } + for crystal, definition := range gamedata.ItemTemplates { + candidate := false + for _, section := range definition.Sections { + if section.Functions == nil { + continue + } + for _, function := range *section.Functions { + if function.ID == 53019 && len(function.Arguments) > 0 && function.Arguments[0].Integer != nil && + slices.Contains(rawPrograms, uint32(*function.Arguments[0].Integer)) { + candidate = true + } + } + } + if candidate { + rawCrystals = append(rawCrystals, crystal) + if slices.Contains(programs, nanoCrystalProgram(crystal)) { + crystals = append(crystals, crystal) + } + } + } + for _, values := range [][]uint32{rawPrograms, rangePrograms, programs, rawCrystals, crystals, expectedPrograms, expectedCrystals} { + slices.Sort(values) + } + + if len(rawPrograms) != 44 || !slices.Equal(rawPrograms, expectedRawPrograms) || len(rawCrystals) != 47 || !slices.Equal(rawCrystals, expectedRawCrystals) { + t.Fatal("original integer-381 record or uploader search boundary changed", rawPrograms, rawCrystals) + } + if len(rangePrograms) != 43 || len(programs) != 10 || len(crystals) != 10 || + !slices.Equal(programs, expectedPrograms) || !slices.Equal(crystals, expectedCrystals) { + t.Fatal("range admission differs from complete original program and uploader census", rangePrograms, programs, crystals) + } + // Glacial Cloak's HP amount 381 is a search hit, with no range modifier. + if slices.Contains(rangePrograms, 55748) || statBuffNano(55748) || nanoCrystalProgram(55756) != 0 { + t.Fatal("HP amount 381 was confused with a range stat selector") + } + for _, program := range rangePrograms { + if !slices.Contains(expectedPrograms, program) && statBuffNano(program) { + t.Fatal("a special profession contract admitted a partial range effect", program) + } + } + for _, crystal := range rawCrystals { + if !slices.Contains(expectedCrystals, crystal) && crystal != 55756 && nanoCrystalProgram(crystal) != 0 { + t.Fatal("a special profession or bulk uploader admitted a partial contract", crystal) + } + } +} diff --git a/server/nano_range_test.go b/server/nano_range_test.go @@ -0,0 +1,292 @@ +package main + +import ( + "ao/server/gamedata" + "fmt" + "reflect" + "slices" + "testing" + "time" +) + +func TestNanoRangeSignedModifiersDoNotInventAMinimumOrSelfBypass(t *testing.T) { + for _, fixture := range []struct { + modifier int32 + inside, outside float32 + accepted bool + }{ + {-50, 6, 6.001, true}, {-100, 0, 0.001, true}, {-110, 0, 0, false}, + } { + for _, inside := range []bool{false, true} { + t.Run(fmt.Sprintf("%d/%t", fixture.modifier, inside), func(t *testing.T) { + original := gamedata.NanoTemplates[95448] + definition := *original + definition.Sections = slices.Clone(original.Sections) + for index, section := range definition.Sections { + if section.Functions != nil { + functions := slices.Clone(*section.Functions) + for index := range functions { + functions[index].Arguments = slices.Clone(functions[index].Arguments) + functions[index].Arguments[1].Integer = new(fixture.modifier) + } + definition.Sections[index].Functions = &functions + } + } + gamedata.NanoTemplates[95448] = &definition + t.Cleanup(func() { gamedata.NanoTemplates[95448] = original }) + world, _ := newNanoRangeWorld(t) + player, client, recipient := world.characters[1], world.clients[1], world.characters[2] + castTestBuff(t, world, 1, 1, 95448) + player.nanoRechargeUntil = time.Time{} + recipient.position[0] = fixture.outside + if inside { + recipient.position[0] = fixture.inside + } + before := player.nano + + err := world.handleNanoCast(client, characterActionPacket(1, [5]uint32{19, 50000, 2, 53019, 27169})[20:]) + admitted := client.nanoCast != nil + if admitted { + world.advanceNanos(client.nanoCast.readyAt.Add(time.Nanosecond)) + } + + if err != nil || admitted != (inside && fixture.accepted) || admitted != (len(recipient.activeNanos) == 1) || + !admitted && player.nano != before || player.nanoReserved != 0 { + t.Fatal("signed range was clamped or negative self-distance was bypassed", fixture.modifier, recipient.position, admitted, err) + } + if !fixture.accepted { + if err := world.handleNanoCast(client, characterActionPacket(1, [5]uint32{19, 50000, 1, 53019, 27169})[20:]); err != nil || client.nanoCast != nil || player.nano != before { + t.Fatal("negative range incorrectly bypassed distance validation for the caster", err) + } + } + }) + } + } +} + +func TestNanoRangeReplacementFailuresKeepBothCompanionsAtomic(t *testing.T) { + for _, phase := range []string{"admission", "outcome"} { + for _, failure := range []string{"error", "ignore", "commit"} { + t.Run(phase+"/"+failure, func(t *testing.T) { + world, _ := newNanoRangeWorld(t) + player, client := world.characters[1], world.clients[1] + player.inventory.LearnedNanos = append(player.inventory.LearnedNanos, 95442) + castTestBuff(t, world, 1, 1, 95448) + player.nanoRechargeUntil = time.Time{} + before := player.nano + request := characterActionPacket(1, [5]uint32{19, 50000, 1, 53019, 95442})[20:] + if phase == "outcome" { + if err := world.handleNanoCast(client, request); err != nil || client.nanoCast == nil { + t.Fatal(err) + } + } + event, condition := "UPDATE OF nano_reserved ON characters", "NEW.nano_reserved!=0" + if phase == "outcome" { + event, condition = "INSERT ON active_nanos", "NEW.program_id=95442" + } + statement := "CREATE TRIGGER fail_range BEFORE " + event + " WHEN " + condition + " BEGIN SELECT RAISE(FAIL,'test range'); END" + if failure == "ignore" { + statement = "CREATE TRIGGER fail_range BEFORE " + event + " WHEN " + condition + " BEGIN SELECT RAISE(IGNORE); END" + } else if failure == "commit" { + statement = "CREATE TABLE pending_range (player_id INTEGER REFERENCES players(id) DEFERRABLE INITIALLY DEFERRED); CREATE TRIGGER fail_range AFTER " + event + " WHEN " + condition + " BEGIN INSERT INTO pending_range VALUES(999999); END" + } + if _, err := world.db.Exec(statement); err != nil { + t.Fatal(err) + } + + if phase == "admission" { + if err := world.handleNanoCast(client, request); err == nil { + t.Fatal("failed range reservation returned success") + } + } else { + world.advanceNanos(client.nanoCast.readyAt.Add(time.Nanosecond)) + } + cold := newTestInventoryServer(t).characters[1] + + if player.nano != before || cold.nano != before || player.nanoReserved != 0 || cold.nanoReserved != 0 || client.nanoCast != nil || + player.nanoBonus(381) != 36 || cold.nanoBonus(381) != 36 || player.nanoBonus(318) != 0 || cold.nanoBonus(318) != 0 || + len(player.activeNanos) != 1 || len(cold.activeNanos) != 1 { + t.Fatal("failed replacement changed its range/cost companions or durable debit") + } + if _, err := world.db.Exec("DROP TRIGGER fail_range"); err != nil { + t.Fatal(err) + } + castTestBuff(t, world, 1, 1, 95442) + cold = newTestInventoryServer(t).characters[1] + if player.nano != before-248 || cold.nano != player.nano || player.nanoBonus(381) != 86 || cold.nanoBonus(381) != 86 || + player.nanoBonus(318) != 2 || cold.nanoBonus(318) != 2 || len(player.activeNanos) != 1 || len(cold.activeNanos) != 1 { + t.Fatal("retry failed to replace the whole mixed contract exactly once") + } + }) + } + } +} + +func TestNanoRangeProgramsUploadRefreshRestoreAndExpireCompleteEffects(t *testing.T) { + for _, fixture := range nanoRangeFixtures(t) { + t.Run(fmt.Sprint(fixture.Program), func(t *testing.T) { + world, _ := newNanoCostWorld(t, nanoCostFixture{combatNanoFixture: fixture.combatNanoFixture}) + player, client := world.characters[1], world.clients[1] + trained := player.baseStats() + + if err := world.handleOwnedItemUse(client, backpackUseRequest(1, 64, 1)[20:]); err != nil { + t.Fatal(err) + } + castTestBuff(t, world, 1, 1, fixture.Program) + player.nanoRechargeUntil = time.Time{} + refreshed := castTestBuff(t, world, 1, 1, fixture.Program) + cold := newTestInventoryServer(t).characters[1] + + if len(player.activeNanos) != 1 || len(cold.activeNanos) != 1 || player.usedNCU() != fixture.NCU || cold.usedNCU() != fixture.NCU || + player.baseStats() != trained || cold.baseStats() != trained || player.nanoReserved != 0 || cold.nano != player.nano || + !slices.Equal(cold.inventory.LearnedNanos, []uint32{fixture.Program}) || + player.activeNanos[0].expiresAt.Sub(refreshed) != time.Duration(fixture.Duration)*10*time.Millisecond { + t.Fatal("range refresh stacked, lost its upload, changed training or failed to persist") + } + for _, modifier := range fixture.Modifiers { + if player.nanoBonus(uint32(modifier[0])) != modifier[1] || cold.nanoBonus(uint32(modifier[0])) != modifier[1] { + t.Fatal("range contract omitted or duplicated its companion", fixture.Program, modifier) + } + } + items := slices.Clone(player.inventory.Items) + world.advanceNanos(player.activeNanos[0].expiresAt) + cold = newTestInventoryServer(t).characters[1] + if len(player.activeNanos) != 0 || len(cold.activeNanos) != 0 || player.usedNCU() != 0 || cold.usedNCU() != 0 || + !reflect.DeepEqual(player.inventory.Items, items) || !reflect.DeepEqual(cold.inventory.Items, items) { + t.Fatal("range expiration retained an effect or changed owned equipment") + } + for _, modifier := range fixture.Modifiers { + if player.nanoBonus(uint32(modifier[0])) != 0 || cold.nanoBonus(uint32(modifier[0])) != 0 { + t.Fatal("range expiration left a companion", fixture.Program, modifier) + } + } + }) + } +} + +func newNanoRangeWorld(t *testing.T) (*server, *combatTestConn) { + t.Helper() + world, conn := newNanoCostWorld(t, nanoCostFixture{combatNanoFixture: combatNanoFixture{Profession: 11}}) + player := world.characters[1] + player.inventory.LearnedNanos = []uint32{27169, 95407, 95443, 95444, 95448} + recipient := *player + recipient.id, recipient.name = 2, "Range recipient" + recipient.inventory, recipient.activeNanos = playerInventory{}, nil + world.characters[2], world.nextCharacter = &recipient, 2 + world.clients[2] = &worldClient{id: 2, conn: &combatTestConn{}, ready: true, target: true} + if err := world.saveUser_locked(&recipient); err != nil { + t.Fatal(err) + } + if err := world.saveInventory_locked(player, player.inventory); err != nil { + t.Fatal(err) + } + return world, conn +} + +func equipNanoRangeDevice(t *testing.T, world *server, template uint32) { + t.Helper() + player, client := world.characters[1], world.clients[1] + for _, fixture := range []struct{ template, slot uint32 }{{204601, 7}, {template, 11}} { + if granted, err := world.grantItem_locked(player, fixture.template); err != nil || !granted { + t.Fatal(granted, err) + } + item := player.inventory.Items[len(player.inventory.Items)-1] + if err := world.handleInventory(client, inventoryMovePacket(1, item.Slot, fixture.slot)[20:]); err != nil || client.equipment == nil { + t.Fatal("range device or its belt could not begin installation", fixture.template, err) + } + world.advanceEquipment(client.equipment.readyAt) + } +} + +func TestNanoRangeUsesCasterModifiersAndCompleteNativeDistanceChecks(t *testing.T) { + for _, fixture := range []struct { + name string + programs []uint32 + device uint32 + inside, outside [3]float32 + }{ + {"base", nil, 0, [3]float32{12, 0, 0}, [3]float32{12.736, 0, 0}}, + {"distance float32 store", nil, 0, [3]float32{0.001, 0, 12}, [3]float32{0.01, 0, 12}}, + {"three dimensions", nil, 0, [3]float32{3, 4, 10}, [3]float32{3, 4, 11}}, + {"range buff", []uint32{95448}, 0, [3]float32{16, 0, 0}, [3]float32{16.001, 0, 0}}, + {"percentage truncation", []uint32{95444}, 0, [3]float32{17, 0, 0}, [3]float32{17.001, 0, 0}}, + {"independent strains", []uint32{95407, 95448}, 0, [3]float32{16, 0, 0}, [3]float32{16.001, 0, 0}}, + {"QL50 device", nil, 95516, [3]float32{25, 0, 0}, [3]float32{25.001, 0, 0}}, + {"QL200 device", nil, 95517, [3]float32{29, 0, 0}, [3]float32{29.001, 0, 0}}, + {"device plus nano", []uint32{95448}, 95516, [3]float32{29, 0, 0}, [3]float32{29.001, 0, 0}}, + {"upper cap", []uint32{95443}, 95517, [3]float32{40, 0, 0}, [3]float32{40.001, 0, 0}}, + } { + for _, accepted := range []bool{false, true} { + t.Run(fmt.Sprintf("%s/%t", fixture.name, accepted), func(t *testing.T) { + world, _ := newNanoRangeWorld(t) + player, client, recipient := world.characters[1], world.clients[1], world.characters[2] + if fixture.device != 0 { + equipNanoRangeDevice(t, world, fixture.device) + } + for _, program := range fixture.programs { + castTestBuff(t, world, 1, 1, program) + player.nanoRechargeUntil = time.Time{} + } + recipient.position = fixture.outside + if accepted { + recipient.position = fixture.inside + } + before := player.nano + + err := world.handleNanoCast(client, characterActionPacket(1, [5]uint32{19, 50000, 2, 53019, 27169})[20:]) + if client.nanoCast != nil { + world.advanceNanos(client.nanoCast.readyAt.Add(time.Nanosecond)) + } + + if err != nil || (len(recipient.activeNanos) == 1) != accepted || client.nanoCast != nil || player.nanoReserved != 0 || + accepted && player.nano >= before || !accepted && player.nano != before { + t.Fatal("range ignored caster effects, the complete distance check, signed percentage or cap", err, recipient.position, player.nano, before) + } + }) + } + } +} + +func TestNanoRangeCompletionRechecksCurrentCasterEffectsAndRefundsOnce(t *testing.T) { + for _, scenario := range []string{"buff removed", "buff expires", "target moves", "recipient range only"} { + t.Run(scenario, func(t *testing.T) { + world, _ := newNanoRangeWorld(t) + player, client, recipient := world.characters[1], world.clients[1], world.characters[2] + if scenario == "recipient range only" { + castTestBuff(t, world, 1, 2, 95448) + } else { + castTestBuff(t, world, 1, 1, 95448) + } + player.nanoRechargeUntil = time.Time{} + recipient.position = [3]float32{16, 0, 0} + before := player.nano + + if err := world.handleNanoCast(client, characterActionPacket(1, [5]uint32{19, 50000, 2, 53019, 27169})[20:]); err != nil { + t.Fatal(err) + } + if scenario != "recipient range only" { + if client.nanoCast == nil { + t.Fatal("extended-range cast was rejected") + } + deadline := client.nanoCast.readyAt + switch scenario { + case "buff removed": + if err := world.handleNanoRemoval(client, characterActionPacket(1, [5]uint32{65, 0, 0, 53019, 95448})[20:]); err != nil { + t.Fatal(err) + } + case "buff expires": + player.activeNanos[0].expiresAt = deadline + case "target moves": + recipient.position[0] = 17 + } + world.advanceNanos(deadline.Add(time.Nanosecond)) + world.advanceNanos(deadline.Add(time.Second)) + } + + if player.nano != before || player.nanoReserved != 0 || client.nanoCast != nil || !player.nanoRechargeUntil.IsZero() || + slices.ContainsFunc(recipient.activeNanos, func(effect activeNano) bool { return effect.program == 27169 }) { + t.Fatal("invalidated range spent a reservation or delivered the program", player.nano, before) + } + }) + } +} diff --git a/server/stat_buff_catalog_test.go b/server/stat_buff_catalog_test.go @@ -69,6 +69,12 @@ func TestStatBuffCatalogAdmitsOnlyCompleteOrdinaryContracts(t *testing.T) { expectedPrograms = append(expectedPrograms, fixture.Program) expectedCrystals = append(expectedCrystals, fixture.Crystal) } + for _, fixture := range nanoRangeFixtures(t) { + if !slices.Contains(expectedPrograms, fixture.Program) { + expectedPrograms = append(expectedPrograms, fixture.Program) + expectedCrystals = append(expectedCrystals, fixture.Crystal) + } + } slices.Sort(expectedPrograms) slices.Sort(expectedCrystals) @@ -86,10 +92,10 @@ func TestStatBuffCatalogAdmitsOnlyCompleteOrdinaryContracts(t *testing.T) { slices.Sort(crystals) // Exact IDs come from the independent complete-original-record catalog audit. - if len(programs) != 457 || !slices.Equal(programs, expectedPrograms) { + if len(programs) != 467 || !slices.Equal(programs, expectedPrograms) { t.Fatal("buff admission differs from the complete effect/metadata audit", programs) } - if len(crystals) != 455 || !slices.Equal(crystals, expectedCrystals) { + if len(crystals) != 465 || !slices.Equal(crystals, expectedCrystals) { t.Fatal("crystal admission differs from the complete upload audit", crystals) } } diff --git a/server/testdata/nano-cost-nanos.json b/server/testdata/nano-cost-nanos.json @@ -7,5 +7,10 @@ {"program": 95413, "name": "Jobe Nano Libraries", "crystal": 95419, "quality": 152, "profession": 11, "modifiers": [[318, -22]], "ncu": 47, "duration": 420000, "strain": 148, "flags": 65536, "can": 0, "target": 3, "debit": 373, "nano_cost": 374, "attack_delay": 328, "recharge_delay": 411, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 122, "value": 707, "operator": 2}, {"stat": 127, "value": 707, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 707, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 122, "value": 707, "operator": 2}, {"stat": 127, "value": 707, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 707, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [129, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": -22}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16303], [183, 16446], [287, 20], [405, 2], [54, 47], [407, 374], [294, 328], [210, 411], [8, 420000], [413, 1030], [428, 46145], [366, 49999], [361, 43029], [419, 17700], [75, 148], [269, 900287342], [272, 3333774743], [270, 3290658829]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 152], [74, 738182], [2, 100], [79, 42448], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95413}]}]}, {"program": 95414, "name": "On-The-Fly Compression", "crystal": 95420, "quality": 73, "profession": 11, "modifiers": [[318, -13]], "ncu": 23, "duration": 360000, "strain": 148, "flags": 65536, "can": 0, "target": 3, "debit": 192, "nano_cost": 193, "attack_delay": 313, "recharge_delay": 353, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 122, "value": 349, "operator": 2}, {"stat": 127, "value": 349, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 349, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 122, "value": 349, "operator": 2}, {"stat": 127, "value": 349, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 349, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [129, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": -13}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16303], [183, 16446], [287, 20], [405, 2], [54, 23], [407, 193], [294, 313], [210, 353], [8, 360000], [413, 1030], [428, 46126], [366, 49999], [361, 43029], [419, 17700], [75, 148], [269, 900320893], [272, 3333774743], [270, 2495313925]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 73], [74, 94842], [2, 100], [79, 12256], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95414}]}]}, {"program": 95416, "name": "Run-Time Recompiler", "crystal": 95421, "quality": 33, "profession": 11, "modifiers": [[318, -9]], "ncu": 11, "duration": 360000, "strain": 148, "flags": 65536, "can": 0, "target": 3, "debit": 90, "nano_cost": 91, "attack_delay": 306, "recharge_delay": 324, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 122, "value": 162, "operator": 2}, {"stat": 127, "value": 162, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 162, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 122, "value": 162, "operator": 2}, {"stat": 127, "value": 162, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 162, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [129, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": -9}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16303], [183, 16446], [287, 20], [405, 2], [54, 11], [407, 91], [294, 306], [210, 324], [8, 360000], [413, 1030], [428, 46107], [366, 49999], [361, 43029], [419, 17700], [75, 148], [269, 900320893], [272, 3333774743], [270, 2495313925]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 33], [74, 14233], [2, 100], [79, 12228], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95416}]}]}, - {"program": 95417, "name": "Izgimmer's Obfuscated Recompiler", "crystal": 95424, "quality": 179, "profession": 11, "modifiers": [[318, -28]], "ncu": 55, "duration": 420000, "strain": 148, "flags": 65536, "can": 0, "target": 3, "debit": 446, "nano_cost": 447, "attack_delay": 337, "recharge_delay": 447, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 122, "value": 826, "operator": 2}, {"stat": 127, "value": 826, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 826, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 122, "value": 826, "operator": 2}, {"stat": 127, "value": 826, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 826, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [129, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": -28}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16303], [183, 16446], [287, 20], [405, 2], [54, 55], [407, 447], [294, 337], [210, 447], [8, 420000], [413, 1030], [428, 46145], [366, 49999], [361, 43029], [419, 17700], [75, 148], [269, 900648301], [272, 3333774743], [270, 2755360885]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 179], [74, 1180958], [2, 100], [79, 42448], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95417}]}]} + {"program": 95417, "name": "Izgimmer's Obfuscated Recompiler", "crystal": 95424, "quality": 179, "profession": 11, "modifiers": [[318, -28]], "ncu": 55, "duration": 420000, "strain": 148, "flags": 65536, "can": 0, "target": 3, "debit": 446, "nano_cost": 447, "attack_delay": 337, "recharge_delay": 447, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 122, "value": 826, "operator": 2}, {"stat": 127, "value": 826, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 826, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 122, "value": 826, "operator": 2}, {"stat": 127, "value": 826, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 826, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [129, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": -28}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16303], [183, 16446], [287, 20], [405, 2], [54, 55], [407, 447], [294, 337], [210, 447], [8, 420000], [413, 1030], [428, 46145], [366, 49999], [361, 43029], [419, 17700], [75, 148], [269, 900648301], [272, 3333774743], [270, 2755360885]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 179], [74, 1180958], [2, 100], [79, 42448], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95417}]}]}, + {"program": 95407, "name": "CrunchCom Code Sieve", "crystal": 95427, "quality": 10, "profession": 11, "modifiers": [[381, 5], [318, -6]], "ncu": 4, "duration": 360000, "strain": 148, "flags": 65536, "can": 0, "target": 3, "debit": 49, "nano_cost": 50, "attack_delay": 302, "recharge_delay": 308, "range": 15, "actions": [{"type": 3, "requirements": [{"stat": 122, "value": 63, "operator": 2}, {"stat": 127, "value": 63, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 63, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 122, "value": 63, "operator": 2}, {"stat": 127, "value": 63, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 63, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [129, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 5}, {"bytes_hex": "00000000"}]}, {"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": -6}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16303], [183, 16446], [287, 15], [405, 2], [407, 50], [294, 302], [210, 308], [8, 360000], [413, 1030], [54, 4], [428, 46107], [366, 49999], [361, 43029], [419, 17200], [75, 148], [269, 900320893], [272, 3333774743], [270, 2495313925]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 10], [74, 2277], [2, 100], [79, 12228], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95407}]}]}, + {"program": 95412, "name": "CrunchCom Nano Compressor Pro", "crystal": 95423, "quality": 123, "profession": 11, "modifiers": [[381, 20], [318, -18]], "ncu": 38, "duration": 420000, "strain": 148, "flags": 65536, "can": 0, "target": 3, "debit": 364, "nano_cost": 365, "attack_delay": 321, "recharge_delay": 386, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 122, "value": 566, "operator": 2}, {"stat": 127, "value": 566, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 566, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 122, "value": 566, "operator": 2}, {"stat": 127, "value": 566, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 566, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [129, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 20}, {"bytes_hex": "00000000"}]}, {"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": -18}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16303], [183, 16446], [287, 20], [405, 2], [54, 38], [407, 365], [294, 321], [210, 386], [8, 420000], [413, 1030], [428, 46126], [366, 49999], [361, 43029], [419, 17200], [75, 148], [269, 900287342], [272, 3333774743], [270, 3290658829]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 123], [74, 395115], [2, 100], [79, 42448], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95412}]}]}, + {"program": 95415, "name": "CrunchCom Nano Compressor", "crystal": 95422, "quality": 47, "profession": 11, "modifiers": [[381, 13], [318, -11]], "ncu": 15, "duration": 360000, "strain": 148, "flags": 65536, "can": 0, "target": 3, "debit": 171, "nano_cost": 172, "attack_delay": 309, "recharge_delay": 338, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 122, "value": 232, "operator": 2}, {"stat": 127, "value": 232, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 232, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 122, "value": 232, "operator": 2}, {"stat": 127, "value": 232, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 232, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [129, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 13}, {"bytes_hex": "00000000"}]}, {"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": -11}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16303], [183, 16446], [287, 20], [405, 2], [54, 15], [407, 172], [294, 309], [210, 338], [8, 360000], [413, 1030], [428, 46126], [366, 49999], [361, 43029], [419, 17200], [75, 148], [269, 900320893], [272, 3333774743], [270, 2495313925]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 47], [74, 31575], [2, 100], [79, 12228], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95415}]}]}, + {"program": 95442, "name": "Nano Cloud Supplement", "crystal": 95450, "quality": 149, "profession": 11, "modifiers": [[318, 2], [381, 86]], "ncu": 46, "duration": 360000, "strain": 181, "flags": 65536, "can": 0, "target": 3, "debit": 248, "nano_cost": 249, "attack_delay": 327, "recharge_delay": 407, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 131, "value": 697, "operator": 2}, {"stat": 127, "value": 697, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 697, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 131, "value": 697, "operator": 2}, {"stat": 127, "value": 697, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 697, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [131, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": 2}, {"bytes_hex": "00000000"}]}, {"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 86}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16202], [183, 16365], [287, 20], [405, 5], [54, 46], [407, 249], [294, 327], [210, 407], [8, 360000], [413, 1010], [428, 46107], [366, 49999], [361, 43029], [419, 17200], [75, 181], [269, 900287342], [272, 3333774743], [270, 3290658829]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 149], [74, 698392], [2, 100], [79, 42450], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95442}]}]}, + {"program": 95443, "name": "Notum Overload", "crystal": 95451, "quality": 175, "profession": 11, "modifiers": [[318, 4], [381, 104]], "ncu": 54, "duration": 420000, "strain": 181, "flags": 65536, "can": 0, "target": 3, "debit": 297, "nano_cost": 298, "attack_delay": 336, "recharge_delay": 444, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 131, "value": 815, "operator": 2}, {"stat": 127, "value": 815, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 815, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 131, "value": 815, "operator": 2}, {"stat": 127, "value": 815, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 815, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [131, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": 4}, {"bytes_hex": "00000000"}]}, {"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 104}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16202], [183, 16365], [287, 20], [405, 5], [54, 54], [407, 298], [294, 336], [210, 444], [8, 420000], [413, 1010], [428, 46107], [366, 49999], [361, 43029], [419, 17200], [75, 181], [269, 900648301], [272, 3333774743], [270, 2755360885]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 175], [74, 1116298], [2, 100], [79, 42450], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95443}]}]} ] diff --git a/server/testdata/nano-range-nanos.json b/server/testdata/nano-range-nanos.json @@ -0,0 +1,12 @@ +[ + {"program": 95407, "name": "CrunchCom Code Sieve", "crystal": 95427, "quality": 10, "profession": 11, "modifiers": [[381, 5], [318, -6]], "ncu": 4, "duration": 360000, "strain": 148, "flags": 65536, "can": 0, "target": 3, "debit": 49, "nano_cost": 50, "attack_delay": 302, "recharge_delay": 308, "range": 15, "actions": [{"type": 3, "requirements": [{"stat": 122, "value": 63, "operator": 2}, {"stat": 127, "value": 63, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 63, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 122, "value": 63, "operator": 2}, {"stat": 127, "value": 63, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 63, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [129, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 5}, {"bytes_hex": "00000000"}]}, {"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": -6}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16303], [183, 16446], [287, 15], [405, 2], [407, 50], [294, 302], [210, 308], [8, 360000], [413, 1030], [54, 4], [428, 46107], [366, 49999], [361, 43029], [419, 17200], [75, 148], [269, 900320893], [272, 3333774743], [270, 2495313925]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 10], [74, 2277], [2, 100], [79, 12228], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95407}]}]}, + {"program": 95412, "name": "CrunchCom Nano Compressor Pro", "crystal": 95423, "quality": 123, "profession": 11, "modifiers": [[381, 20], [318, -18]], "ncu": 38, "duration": 420000, "strain": 148, "flags": 65536, "can": 0, "target": 3, "debit": 364, "nano_cost": 365, "attack_delay": 321, "recharge_delay": 386, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 122, "value": 566, "operator": 2}, {"stat": 127, "value": 566, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 566, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 122, "value": 566, "operator": 2}, {"stat": 127, "value": 566, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 566, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [129, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 20}, {"bytes_hex": "00000000"}]}, {"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": -18}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16303], [183, 16446], [287, 20], [405, 2], [54, 38], [407, 365], [294, 321], [210, 386], [8, 420000], [413, 1030], [428, 46126], [366, 49999], [361, 43029], [419, 17200], [75, 148], [269, 900287342], [272, 3333774743], [270, 3290658829]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 123], [74, 395115], [2, 100], [79, 42448], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95412}]}]}, + {"program": 95415, "name": "CrunchCom Nano Compressor", "crystal": 95422, "quality": 47, "profession": 11, "modifiers": [[381, 13], [318, -11]], "ncu": 15, "duration": 360000, "strain": 148, "flags": 65536, "can": 0, "target": 3, "debit": 171, "nano_cost": 172, "attack_delay": 309, "recharge_delay": 338, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 122, "value": 232, "operator": 2}, {"stat": 127, "value": 232, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 232, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 122, "value": 232, "operator": 2}, {"stat": 127, "value": 232, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 129, "value": 232, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [129, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 13}, {"bytes_hex": "00000000"}]}, {"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": -11}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16303], [183, 16446], [287, 20], [405, 2], [54, 15], [407, 172], [294, 309], [210, 338], [8, 360000], [413, 1030], [428, 46126], [366, 49999], [361, 43029], [419, 17200], [75, 148], [269, 900320893], [272, 3333774743], [270, 2495313925]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 47], [74, 31575], [2, 100], [79, 12228], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95415}]}]}, + {"program": 95442, "name": "Nano Cloud Supplement", "crystal": 95450, "quality": 149, "profession": 11, "modifiers": [[318, 2], [381, 86]], "ncu": 46, "duration": 360000, "strain": 181, "flags": 65536, "can": 0, "target": 3, "debit": 248, "nano_cost": 249, "attack_delay": 327, "recharge_delay": 407, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 131, "value": 697, "operator": 2}, {"stat": 127, "value": 697, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 697, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 131, "value": 697, "operator": 2}, {"stat": 127, "value": 697, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 697, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [131, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": 2}, {"bytes_hex": "00000000"}]}, {"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 86}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16202], [183, 16365], [287, 20], [405, 5], [54, 46], [407, 249], [294, 327], [210, 407], [8, 360000], [413, 1010], [428, 46107], [366, 49999], [361, 43029], [419, 17200], [75, 181], [269, 900287342], [272, 3333774743], [270, 3290658829]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 149], [74, 698392], [2, 100], [79, 42450], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95442}]}]}, + {"program": 95443, "name": "Notum Overload", "crystal": 95451, "quality": 175, "profession": 11, "modifiers": [[318, 4], [381, 104]], "ncu": 54, "duration": 420000, "strain": 181, "flags": 65536, "can": 0, "target": 3, "debit": 297, "nano_cost": 298, "attack_delay": 336, "recharge_delay": 444, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 131, "value": 815, "operator": 2}, {"stat": 127, "value": 815, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 815, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 131, "value": 815, "operator": 2}, {"stat": 127, "value": 815, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 815, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [131, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 318}, {"integer": 4}, {"bytes_hex": "00000000"}]}, {"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 104}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16202], [183, 16365], [287, 20], [405, 5], [54, 54], [407, 298], [294, 336], [210, 444], [8, 420000], [413, 1010], [428, 46107], [366, 49999], [361, 43029], [419, 17200], [75, 181], [269, 900648301], [272, 3333774743], [270, 2755360885]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 175], [74, 1116298], [2, 100], [79, 42450], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95443}]}]}, + {"program": 95444, "name": "Coherent Nano Pathway", "crystal": 95454, "quality": 40, "profession": 11, "modifiers": [[381, 50]], "ncu": 13, "duration": 270000, "strain": 181, "flags": 65536, "can": 0, "target": 3, "debit": 84, "nano_cost": 85, "attack_delay": 308, "recharge_delay": 332, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 131, "value": 202, "operator": 2}, {"stat": 127, "value": 202, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 202, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 131, "value": 202, "operator": 2}, {"stat": 127, "value": 202, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 202, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [131, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 50}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16202], [183, 16365], [287, 20], [405, 5], [54, 13], [407, 85], [294, 308], [210, 332], [8, 270000], [413, 1010], [428, 46183], [366, 49999], [361, 43029], [419, 17200], [75, 181], [269, 900320893], [272, 3333774743], [270, 2495313925]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 40], [74, 21985], [2, 100], [79, 12225], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95444}]}]}, + {"program": 95445, "name": "Cohesion Amplifier", "crystal": 95449, "quality": 63, "profession": 11, "modifiers": [[381, 57]], "ncu": 20, "duration": 300000, "strain": 181, "flags": 65536, "can": 0, "target": 3, "debit": 123, "nano_cost": 124, "attack_delay": 312, "recharge_delay": 347, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 131, "value": 303, "operator": 2}, {"stat": 127, "value": 303, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 303, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 131, "value": 303, "operator": 2}, {"stat": 127, "value": 303, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 303, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [131, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 57}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16202], [183, 16365], [287, 20], [405, 5], [54, 20], [407, 124], [294, 312], [210, 347], [8, 300000], [413, 1010], [428, 46202], [366, 49999], [361, 43029], [419, 17200], [75, 181], [269, 900320893], [272, 3333774743], [270, 2495313925]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 63], [74, 64808], [2, 100], [79, 12258], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95445}]}]}, + {"program": 95446, "name": "Superior Nano Command", "crystal": 95455, "quality": 93, "profession": 11, "modifiers": [[381, 67]], "ncu": 29, "duration": 300000, "strain": 181, "flags": 65536, "can": 0, "target": 3, "debit": 178, "nano_cost": 179, "attack_delay": 317, "recharge_delay": 368, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 131, "value": 439, "operator": 2}, {"stat": 127, "value": 439, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 439, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 131, "value": 439, "operator": 2}, {"stat": 127, "value": 439, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 439, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [131, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 67}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16202], [183, 16365], [287, 20], [405, 5], [54, 29], [407, 179], [294, 317], [210, 368], [8, 300000], [413, 1010], [428, 46221], [366, 49999], [361, 43029], [419, 17200], [75, 181], [269, 900287342], [272, 3333774743], [270, 3290658829]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 93], [74, 183264], [2, 100], [79, 12258], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95446}]}]}, + {"program": 95447, "name": "Enhance Nano Cohesion", "crystal": 95453, "quality": 20, "profession": 11, "modifiers": [[381, 42]], "ncu": 7, "duration": 240000, "strain": 181, "flags": 65536, "can": 0, "target": 3, "debit": 43, "nano_cost": 44, "attack_delay": 304, "recharge_delay": 315, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 131, "value": 108, "operator": 2}, {"stat": 127, "value": 108, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 108, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 131, "value": 108, "operator": 2}, {"stat": 127, "value": 108, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 108, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [131, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 42}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16202], [183, 16365], [287, 20], [405, 5], [54, 7], [407, 44], [294, 304], [210, 315], [8, 240000], [413, 1010], [428, 46164], [366, 49999], [361, 43029], [419, 17200], [75, 181], [269, 900320893], [272, 3333774743], [270, 2495313925]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 20], [74, 5869], [2, 100], [79, 12225], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95447}]}]}, + {"program": 95448, "name": "Enhance Nano Communication", "crystal": 95452, "quality": 4, "profession": 11, "modifiers": [[381, 36]], "ncu": 2, "duration": 210000, "strain": 181, "flags": 65536, "can": 0, "target": 3, "debit": 11, "nano_cost": 12, "attack_delay": 301, "recharge_delay": 303, "range": 20, "actions": [{"type": 3, "requirements": [{"stat": 131, "value": 29, "operator": 2}, {"stat": 127, "value": 29, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 29, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "crystal_actions": [{"type": 3, "requirements": [{"stat": 131, "value": 29, "operator": 2}, {"stat": 127, "value": 29, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 122, "value": 29, "operator": 2}, {"stat": 0, "value": 0, "operator": 4}, {"stat": 368, "value": 11, "operator": 0}, {"stat": 0, "value": 0, "operator": 4}]}], "weights": [{"type": 12, "stats": [[127, 34], [131, 33], [122, 33]]}], "getter": [[12, 0]], "functions": [{"id": 53012, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 3, "argument_header": 9, "arguments": [{"integer": 381}, {"integer": 36}, {"bytes_hex": "00000000"}]}], "stats": [[76, 0], [30, 0], [0, 65536], [298, 0], [88, 0], [79, 16202], [183, 16365], [287, 20], [405, 5], [54, 2], [407, 12], [294, 301], [210, 303], [8, 210000], [413, 1010], [428, 46164], [366, 49999], [361, 43029], [419, 17200], [75, 181], [269, 900320893], [272, 3333774743], [270, 2495313925]], "crystal_stats": [[76, 0], [30, 41], [0, 4194819], [298, 0], [88, 0], [54, 4], [74, 819], [2, 100], [79, 12225], [12, 26160], [26, 1]], "crystal_functions": [{"id": 53019, "header_words": [0, 4], "requirements": [], "tick_count": 1, "tick_interval": 0, "target": 2, "argument_header": 9, "arguments": [{"integer": 95448}]}]} +]