Retire the Unity mine: Mine, MineManager, the Mine Launcher prefab and ShieldManager's mine branch

Operator ruling mines-back-in-sim-asap: delete now, return as a simulation body.
Mesh, materials and BigExplosion stay for the sim-mines presenter. GridObject
stays for the pickups until loot-1 r2. Comments in FireControl.Detonate and
HullCollider drop the deleted callers. Builds not yet verified at this commit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-07 15:01:39 +02:00
commit 17f5eb7d8c
9 changed files with 4 additions and 500 deletions

View file

@ -2,11 +2,10 @@ using UnityEngine;
using CultMath.UnityBridge;
// Cut 4 (docs/fire-control-cut.md): Hit, Splash, SendHit and SendSplash are deleted -- their last callers
// (ConstantLaser, ConstantLightning, ConstantParticleWeapon, HitscanEffect, Mine) are gone too (see those
// (ConstantLaser, ConstantLightning, ConstantParticleWeapon, HitscanEffect) are gone too (see those
// files and FireControl.Detonate, 12.4(b)'s renamed Splash). Nothing decides or applies damage through a Unity
// collider any more (R8):
// this component is now purely a physics surface for ship-on-ship collision impulse and Mine's own proximity
// arming query (Q7), neither of which is hit detection.
// this component is now purely a physics surface for ship-on-ship collision impulse, not hit detection.
public class HullCollider : MonoBehaviour
{
public Entity Entity { get; set; }

View file

@ -38,7 +38,6 @@ public class ShieldManager : MonoBehaviour
if (gridObject)
{
var itemPickup = other.collider.GetComponent<ItemPickup>();
var mine = other.collider.GetComponent<Mine>();
if (itemPickup)
{
if (Entity.CargoBays.Any(c => c.TryStore(itemPickup.Item)))
@ -54,13 +53,9 @@ public class ShieldManager : MonoBehaviour
Debug.Log("Attempted item pickup, but no space in cargo bay!");
}
}
else if (mine)
{
mine.Explode();
}
else
{
Debug.Log("Shield collision occurred with grid object, but other collider isn't a mine or an item pickup!");
Debug.Log("Shield collision occurred with grid object, but other collider isn't an item pickup!");
}
}
else

View file

@ -1,106 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using CultMath;
using CultMath.UnityBridge;
using static CultMath.math;
using UnityEngine;
using Random = UnityEngine.Random;
public class Mine : MonoBehaviour
{
public GridObject GridObject;
public MeshRenderer MeshRenderer;
public int EmissionSubmesh;
public AnimationCurve EmissionCurve;
public float ActiveCycleDuration;
public float ArmedCycleDuration;
public float ActiveEmission;
public float ArmedEmission;
public Prototype HitEffect;
public float Lifetime;
public float ActivationDelay;
public float BlastRange;
public float BlastDelay;
private float _startTime;
private float _blastTime;
private bool _blastCountdown;
private bool _active;
private Material _material;
private float _pulseLerp;
private float _emission;
public float Damage { get; set; }
public DamageType DamageType { get; set; }
public EntityInstance Source { get; set; }
public float Range { get; set; }
private void Start()
{
_material = MeshRenderer.materials[EmissionSubmesh];
}
private void OnEnable()
{
_startTime = Time.time;
_blastCountdown = false;
_active = false;
_emission = 0;
}
// Update is called once per frame
void Update()
{
var position = transform.position;
if (Time.time - _startTime > ActivationDelay && !_active)
{
_active = true;
}
if(_active)
{
_emission = lerp(_emission, _blastCountdown ? ArmedEmission : ActiveEmission, Time.deltaTime * 10);
_pulseLerp += Time.deltaTime / (_blastCountdown ? ArmedCycleDuration : ActiveCycleDuration);
_pulseLerp %= 1;
if(!_blastCountdown)
{
foreach (var collider in Physics.OverlapSphere(position, BlastRange, 1))
{
var hull = collider.GetComponent<HullCollider>();
if (hull)
{
_blastCountdown = true;
_blastTime = Time.time + BlastDelay;
}
}
}
if ((position - Source.transform.position).magnitude > Range ||
Time.time - _startTime > Lifetime ||
_blastCountdown && Time.time > _blastTime)
{
Explode();
}
}
_material.SetFloat("_Emission", _emission * EmissionCurve.Evaluate(_pulseLerp));
}
// Cut 4 (docs/fire-control-cut.md, Q7): the arming OverlapSphere above stays -- that is contact detection,
// not hit detection. Blast damage is not: it goes through the same FireControl.Detonate every blast-shaped
// weapon uses now (12.4(b) renamed Splash), over the zone's own planar entities, not a Unity collider
// query. Presentation (ShowHit) goes with the query it depended on -- nothing here decides who was hit any
// more, so nothing here can point a hit effect at them; a future pass can rebuild that off
// FireControl-published state if the mine ever ships (R9 keeps it regardless). F12-6: BlastRange stays a
// presentation-side input -- Mine has no catalog weapon record carrying Fuse/BlastRadius.
public void Explode()
{
var position = transform.position;
FireControl.Detonate(Source.Entity.Zone, position.ToCultMath().xz, BlastRange, Damage, DamageType);
var ht = HitEffect.Instantiate<Transform>();
ht.position = position;
GetComponent<Prototype>().ReturnToPool();
}
}

View file

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: f190191fe8c8419f85767868c50cde5f
timeCreated: 1612545564

View file

@ -1,34 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using CultMath;
using static CultMath.math;
using Random = UnityEngine.Random;
public class MineManager : InstantWeaponEffectManager
{
public Prototype ProjectilePrototype;
public bool InheritVelocity;
public override void Fire(InstantWeapon weapon, EquippedItem item, EntityInstance source, EntityInstance target, int shotId)
{
var p = ProjectilePrototype.Instantiate<Mine>();
var hp = item.Hardpoint;
var barrel = source.GetBarrel(hp);
var angle = weapon.Spread / 2;
p.Source = source;
p.transform.position = barrel.position;
p.GridObject.Velocity = Quaternion.Euler(
Random.Range(-angle, angle),
Random.Range(-angle, angle),
Random.Range(-angle, angle)) *
barrel.forward *
weapon.Velocity;
if(InheritVelocity)
p.GridObject.Velocity += new Vector3(source.Entity.Velocity.x, 0, source.Entity.Velocity.y);
p.Damage = weapon.Damage;
p.Range = weapon.Range;
p.DamageType = weapon.WeaponData.DamageType;
p.GridObject.Zone = source.Entity.Zone;
}
}

View file

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 6e048d9c74a84343befd496907ee2126
timeCreated: 1612545538

View file

@ -1322,8 +1322,7 @@ public static class FireControl
// Cut 12.4(b) (docs/fire-control-cut.md, "Area, per entity"): the one owner of blast damage -- a blast is
// an area, not a bundle of rays (Q12-7 dissolved the ray model's remainder question along with the rays
// themselves). Splash's signature with the point made planar (R7). Callers: Apply's three fuse branches and
// Mine.Explode. Nothing draws: every candidate entity in radius takes its share, unconditionally.
// themselves). Splash's signature with the point made planar (R7). Callers: Apply's three fuse branches. Nothing draws: every candidate entity in radius takes its share, unconditionally.
//
// For each candidate (an entity whose centre lies within radius plus half its own hull diagonal --
// CandidatesIncludeHullsWhoseCentreIsOutsideTheRadius, which Splash's centre-distance cull could not pass):