Skip to content

feat(glaziery): ancient runic glass optical periscope, brass turret assembly, and reconnaissance engine - #289

Open
angelTomo9 wants to merge 2 commits into
Bitcoindefi:mainfrom
angelTomo9:feat-optical-periscope-1788152439015
Open

feat(glaziery): ancient runic glass optical periscope, brass turret assembly, and reconnaissance engine#289
angelTomo9 wants to merge 2 commits into
Bitcoindefi:mainfrom
angelTomo9:feat-optical-periscope-1788152439015

Conversation

@angelTomo9

Copy link
Copy Markdown

Summary

Implements an ancient runic glass optical periscope, brass turret assembly, and reconnaissance scope crafting system, periscope benches (Cedar Periscope Assembly Bench, Runic Brass Reconnaissance Gantry, Celestial Void Horizon Sanctum), raw silica reflection plates and armored brass casing blanks (Silica Prism Reflection Plate, Armored Brass Tube Blank, Celestial Void Omniscient Starlight Prism), arcane periscope recipes (Scout Horizon-Sight Periscope, Subterranean Trench-View Scope, Celestial Void Seraphic Omniscient Periscope), reconnaissance clarity ratings (scaled across catalog baselines ~14% to 100%), calibrated true vision reveal radius and stealth detection aura scaling, upfront material deduction on all attempts, consistent remainingProvidedPrisms shapes across all branches, extensionless test import, crypto-secure default gameplay rolls, and periscope bench maintenance for OpenAO MMORPG.

Features

  • Periscope bench catalog with power ratings, durability, and reconnaissance bonuses
  • Arcane periscope recipes with calibrated true vision reveal radius and stealth detection aura scaling
  • Independent reconnaissance clarity quality roll scaling
  • Upfront material deduction on all craft attempts to prevent zero-cost retries
  • Consistent remainingProvidedPrisms arrays returned on all early rejection branches
  • Cached static catalog maxima and table maintenance with durability threshold gating
  • Full unit test coverage under Vitest including mid-range clarity tests

Comment thread api/src/lib/ancientRunicGlassOpticalPeriscope.ts
@gitar-bot

gitar-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Implements a periscope crafting system for OpenAO with benches, recipes, and reconnaissance mechanics including clarity ratings, vision reveal radius, and stealth detection scaling. Also fixes generateSecureRoll fallback to strictly maintain half-open interval bounds. No issues found.

✅ 1 resolved
Edge Case: generateSecureRoll fallback can return exactly 1.0

📄 api/src/lib/ancientRunicGlassOpticalPeriscope.ts:89-94
The JSDoc states generateSecureRoll returns a float in [0, 1), and the primary path (crypto.randomInt(0,1000000)/1000000) honors that with a max of 0.999999. But the fallback crypto.randomBytes(4).readUInt32LE(0) / 0xffffffff is inclusive of 1.0 when all four bytes are 0xff, yielding a rollPercent of exactly 100. That guarantees a 'prism cracked' failure even on the 99% Celestial bench and violates the documented half-open range. Divide by 0x100000000 (2^32) instead of 0xffffffff to keep the result in [0, 1).

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Important

Your trial ends in 1 day — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.

Was this helpful? React with 👍 / 👎 | Gitar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant