Skip to content

feat(alchemy): alchemical tincture infusions, solvent bases, and toxicity meter engine - #202

Open
angelTomo9 wants to merge 2 commits into
Bitcoindefi:mainfrom
angelTomo9:feat-alchemy-tincture-1787868063145
Open

feat(alchemy): alchemical tincture infusions, solvent bases, and toxicity meter engine#202
angelTomo9 wants to merge 2 commits into
Bitcoindefi:mainfrom
angelTomo9:feat-alchemy-tincture-1787868063145

Conversation

@angelTomo9

Copy link
Copy Markdown

Summary

Implements an alchemical herb tincture infusion, solvent bases, and player toxicity meter engine for OpenAO MMORPG.

Features

  • Botanical herb reagents and solvent bases (Spring Water, Moonwell Dew, Volatile Spirits)
  • Steeping duration potency curves with over-steeping burn risks
  • Player bloodstream toxicity meter (0 to 100) with toxic shock thresholds
  • Herbal antidote toxicity cleansing and shock removal
  • Full unit test coverage under Vitest

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

gitar-bot Bot commented Aug 27, 2026

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

Implements alchemical tincture infusions with solvent bases, steeping mechanics, and a player toxicity meter engine. Toxicity clamping to 100 max, shock state tracking, and unique tincture ID suffixes have been addressed.

✅ 3 resolved
Edge Case: Toxicity meter can exceed documented 0–100 range

📄 api/src/lib/alchemyTinctureInfusion.ts:37-41 📄 api/src/lib/alchemyTinctureInfusion.ts:143
consumeTincture clamps currentToxicity to MAX_TOXICITY_THRESHOLD + 20 (120), but PlayerToxicityState documents the meter as "0 to 100". Downstream consumers reading currentToxicity may not expect values above 100, and the +20 headroom is an unexplained magic number. Consider clamping to MAX_TOXICITY_THRESHOLD or documenting/naming the overflow allowance explicitly.

Quality: applyAntidote reports shockCleared even when no shock existed

📄 api/src/lib/alchemyTinctureInfusion.ts:160-174
shockCleared returns !player.isToxicShock, so it is true whenever the player is below threshold — even if the player was never in toxic shock and the antidote cleared nothing. Callers relying on shockCleared as a signal that an actual shock was removed will get false positives. Track whether shock was set before the antidote and only report a true clear when it transitioned from true to false.

Quality: tinctureId uses Date.now() and can collide

📄 api/src/lib/alchemyTinctureInfusion.ts:116
tinctureId is built from tincture_${recipeId}_${Date.now()}. Two brews of the same recipe within the same millisecond produce identical IDs, which can cause collisions if these IDs are used as keys/inventory identifiers. Add a random/monotonic suffix or a UUID to guarantee uniqueness.

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 5 days — 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