Remove weapon effect zone handles
This commit is contained in:
parent
d7fc9d29eb
commit
f02a73269f
5 changed files with 27 additions and 6 deletions
|
|
@ -8781,8 +8781,10 @@ static void RequireUnityPhysicsIsNotGameplayAuthority(string root)
|
|||
|
||||
var ymirBridgePath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "Physics", "AetheriaYmirPhysicsBridge.cs");
|
||||
var projectilePath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "Weapons", "Projectile.cs");
|
||||
var projectileManagerPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "Weapons", "ProjectileManager.cs");
|
||||
var guidedProjectilePath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "Weapons", "GuidedProjectile.cs");
|
||||
var hitscanPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "Weapons", "HitscanEffect.cs");
|
||||
var hitscanManagerPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "Weapons", "HitscanManager.cs");
|
||||
var clickRaycasterPath = Path.Combine(root, "Assets", "Scripts", "UI", "ClickRaycaster.cs");
|
||||
|
||||
var requiredSymbols = new Dictionary<string, string[]>
|
||||
|
|
@ -8834,6 +8836,31 @@ static void RequireUnityPhysicsIsNotGameplayAuthority(string root)
|
|||
"Ymir gameplay query bridge is incomplete: " +
|
||||
string.Join("; ", missingSymbols));
|
||||
}
|
||||
|
||||
var forbiddenWeaponZoneHandles = new Dictionary<string, string[]>
|
||||
{
|
||||
[projectilePath] = new[] { "public Zone Zone", "Zone { get; set; }" },
|
||||
[projectileManagerPath] = new[] { "p.Zone =", "source.Entity.Zone" },
|
||||
[hitscanPath] = new[] { "public Zone Zone", "Zone { get; set; }" },
|
||||
[hitscanManagerPath] = new[] { "p.Zone =", "source.Entity.Zone" }
|
||||
};
|
||||
var weaponZoneHandleHits = forbiddenWeaponZoneHandles
|
||||
.Where(pair => File.Exists(pair.Key))
|
||||
.SelectMany(pair =>
|
||||
{
|
||||
var text = File.ReadAllText(pair.Key);
|
||||
return pair.Value
|
||||
.Where(symbol => text.Contains(symbol, StringComparison.Ordinal))
|
||||
.Select(symbol => $"{Path.GetRelativePath(root, pair.Key)}: {symbol}");
|
||||
})
|
||||
.ToArray();
|
||||
|
||||
if (weaponZoneHandleHits.Length > 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Unity weapon effects must query Ymir/renderer state directly instead of carrying renderer-local Zone handles: " +
|
||||
string.Join("; ", weaponZoneHandleHits));
|
||||
}
|
||||
}
|
||||
|
||||
static void RequireDeadPropertiesPanelShellDeleted(string root)
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ public class HitscanEffect : MonoBehaviour
|
|||
public ParticleSystem LineEffect;
|
||||
public Prototype HitEffect;
|
||||
|
||||
public Zone Zone { get; set; }
|
||||
|
||||
public float Damage { get; set; }
|
||||
public float Penetration { get; set; }
|
||||
public float Spread { get; set; }
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ public class HitscanManager : InstantWeaponEffectManager
|
|||
p.Penetration = weapon.Penetration;
|
||||
p.Spread = weapon.DamageSpread;
|
||||
p.DamageType = weapon.DamageType;
|
||||
p.Zone = source.Entity.Zone;
|
||||
p.Fire();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ public class Projectile : MonoBehaviour
|
|||
|
||||
private bool _alive;
|
||||
|
||||
public Zone Zone { get; set; }
|
||||
|
||||
public Vector3 StartPosition { get; set; }
|
||||
public Vector3 Velocity { get; set; }
|
||||
public float Damage { get; set; }
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ public class ProjectileManager : InstantWeaponEffectManager
|
|||
p.Penetration = weapon.Penetration;
|
||||
p.Spread = weapon.DamageSpread;
|
||||
p.DamageType = weapon.DamageType;
|
||||
p.Zone = source.Entity.Zone;
|
||||
p.AirburstDistance = target != null
|
||||
? CultMath.math.length(source.Entity.CultPosition - target.Entity.CultPosition)
|
||||
: (weapon.Range * .75f);
|
||||
|
|
|
|||
Loading…
Reference in a new issue