2026-08-10 14:57:50 +01:00
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2020-12-22 03:13:43 +00:00
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
2026-08-10 14:57:50 +01:00
|
|
|
|
using MessagePack;
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
|
|
[Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn), RuntimeInspectable]
|
|
|
|
|
|
public class ResourceScannerData : BehaviorData
|
|
|
|
|
|
{
|
|
|
|
|
|
[Inspectable, JsonProperty("range"), Key(1), RuntimeInspectable]
|
|
|
|
|
|
public PerformanceStat Range = new PerformanceStat();
|
|
|
|
|
|
|
|
|
|
|
|
[Inspectable, JsonProperty("minDensity"), Key(2), RuntimeInspectable]
|
|
|
|
|
|
public PerformanceStat MinimumDensity = new PerformanceStat();
|
|
|
|
|
|
|
|
|
|
|
|
[Inspectable, JsonProperty("scanDuration"), Key(3), RuntimeInspectable]
|
|
|
|
|
|
public PerformanceStat ScanDuration = new PerformanceStat();
|
|
|
|
|
|
|
|
|
|
|
|
public override Behavior CreateInstance(EquippedItem item)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new ResourceScanner(this, item);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override Behavior CreateInstance(ConsumableItemEffect item)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new ResourceScanner(this, item);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-05-21 01:53:06 +01:00
|
|
|
|
|
Cut 2: the dead mining path goes, and chunks get one owner
MiningTool (its Execute range-checked against nothing, since no writer ever
set AsteroidBelt/Asteroid) and Zone.MineAsteroid (mints nothing; the
SimpleCommodity drop was commented out) are deleted, per Q1=A: "Bring back
the drill, indeed." Union tag 26 is retired, not reused. ResourceScanner's
dead survey Execute and its scan-target fields go too; its authored Range/
MinimumDensity/ScanDuration stay pending Q2. PlanetSettings.MiningDifficulty
had one reader, now gone.
Chunk wear (damage, broken-until) moves off AsteroidBelt's three per-belt
dictionaries and onto Zone as the one owner (Q3=A): Zone.Wear is the only
writer, ChunkExists/ChunkRadius are the readers, and respawn is a lazy
comparison against zone time, never a per-tick loop. ChunkId is
(CultRecordKey Field, int Index) -- "Field", not "Belt", because chunks are
meant to generalize past asteroid belts to other debris fields later.
Persisted in ZonePack's new key 6 (List<ChunkWearPack>, nullable so an older
record with no key 6 loads with no wear instead of throwing), pruned of
healed, non-broken entries at pack.
The break threshold stays strictly greater-than, matching today's behaviour:
damage exactly equal to hitpoints does not yet break the chunk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 11:30:44 +02:00
|
|
|
|
// Cut 2 (docs/mining-cut.md, Q1=A): the dead survey Execute and its scan-target fields are gone
|
|
|
|
|
|
// (ScanTarget/Asteroid/_scanTime/_scanTarget, and the always-false-until-scanned PlanetSurveyFloor write it
|
2026-09-30 12:57:04 +02:00
|
|
|
|
// worked toward). Mining Cut 3 (docs/mining-cut-refresh.md): chunks are detected by reflected light, not by a
|
|
|
|
|
|
// scanner, so the per-tick evaluation of three stats nothing read is gone too. The behavior is parked: its data
|
|
|
|
|
|
// stays authored, and it does nothing.
|
|
|
|
|
|
public class ResourceScanner : Behavior
|
2020-05-21 01:53:06 +01:00
|
|
|
|
{
|
2026-08-10 14:57:50 +01:00
|
|
|
|
public ResourceScanner(ResourceScannerData data, EquippedItem item) : base(data, item)
|
2021-04-18 05:13:20 +01:00
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-08-10 14:57:50 +01:00
|
|
|
|
public ResourceScanner(ResourceScannerData data, ConsumableItemEffect item) : base(data, item)
|
2020-05-21 01:53:06 +01:00
|
|
|
|
{
|
|
|
|
|
|
}
|
2026-08-10 14:57:50 +01:00
|
|
|
|
}
|