fix(space): EVA asteroid mining obeys drill tiers, hardness and inventory space - #686
Merged
Merged
Conversation
…tory space (#685) A single bare-hand click popped any asteroid block during a spacewalk — titanium included — while the same block on a planet needs a tier-2 drill and several timed hits; with a full backpack the ore silently vanished. The EVA structure-mine path now mirrors the planet pipeline for asteroids: ToolCanMine gates by drill kind + tier, hardness accumulates per hit, and the new StructureMiningProgress message (NetCodec 188) drives the client aim marker from cyan to orange as the ore works toward breaking. The client mines hold-to-repeat at the on-foot drill pace instead of per click. Drops are capacity-checked BEFORE the cell clears (mirrors #600): a full inventory refuses the break losslessly and the banked progress finishes the job once there is room. Own-ship and station editing stays instant by design (construction UX, not resource gathering). closes #685 Co-Authored-By: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
During an EVA spacewalk, any asteroid block could be mined with a single bare-hand click — no drill, no hardness, titanium included — while the same block on a planet requires a tier-2 drill and several timed hits. With a full inventory the ore was silently lost (the cell was cleared before the drops were banked).
Closes #685.
Changes
Server (
GameServerSpaceStructure.cs)ToolCanMine(drill kind +MinToolTier) and per-cell hardness accumulation (progress += tool.MiningPoweruntilBlockDefinition.Hardness), tracked in a new_structureMiningProgressmap keyed by structure id + cell (same same-block guard as the world path).MaterialPool.CanFitbefore the cell clears (mirrors Mined drops are silently destroyed when inventory and cargo are full #600): a full inventory refuses the break with the standard@inventory_fullreject; banked progress survives, so the block falls on the next hit once there is room.Protocol (
Messages.cs,NetCodec.cs)StructureMiningProgressmessage (structure-local cell + fraction), registered as tag 188.Client (
NetworkClient.cs,SpaceView.cs)Balance result
Soft materials keep the light one-hit feel by their own hardness; titanium keeps its tier-2 progression gate.
Tests
EvaMine_TakesOreFromAVoxelAsteroidupdated (tier-2 drill, 4 hits).EvaAsteroidMine_NeedsSeveralHits_AndTheRightDrill(bare hand + t1 rejected, t2 holds for 3 hits, falls on the 4th) andEvaAsteroidMine_RefusedWhenTheDropsWouldNotFit(full personal + cargo → refused losslessly; freeing a slot finishes the break).EvaStructureEdit_*tests.🤖 Generated with Claude Code