diff --git a/Audio/ARC/WEP/ArcWepShipGatlingShot3d01.wav b/Audio/ARC/WEP/ArcWepShipGatlingShot3d01.wav
new file mode 100644
index 00000000..9e4cada5
Binary files /dev/null and b/Audio/ARC/WEP/ArcWepShipGatlingShot3d01.wav differ
diff --git a/Audio/ARC/WEP/ArcWepShipGatlingShot3d02.wav b/Audio/ARC/WEP/ArcWepShipGatlingShot3d02.wav
new file mode 100644
index 00000000..f4fc9e0a
Binary files /dev/null and b/Audio/ARC/WEP/ArcWepShipGatlingShot3d02.wav differ
diff --git a/Audio/ARC/WEP/ArcWepShipGatlingShot3d03.wav b/Audio/ARC/WEP/ArcWepShipGatlingShot3d03.wav
new file mode 100644
index 00000000..01486b29
Binary files /dev/null and b/Audio/ARC/WEP/ArcWepShipGatlingShot3d03.wav differ
diff --git a/Audio/ARC/WEP/ArcWepShipGatlingShot3d04.wav b/Audio/ARC/WEP/ArcWepShipGatlingShot3d04.wav
new file mode 100644
index 00000000..2a261ba0
Binary files /dev/null and b/Audio/ARC/WEP/ArcWepShipGatlingShot3d04.wav differ
diff --git a/Audio/ARC/WEP/ArcWepShipGatlingShot3d05.wav b/Audio/ARC/WEP/ArcWepShipGatlingShot3d05.wav
new file mode 100644
index 00000000..f7c33ed2
Binary files /dev/null and b/Audio/ARC/WEP/ArcWepShipGatlingShot3d05.wav differ
diff --git a/Audio/ARC/WEP/ArcWepShipGatlingShot3d06.wav b/Audio/ARC/WEP/ArcWepShipGatlingShot3d06.wav
new file mode 100644
index 00000000..c54ee9f4
Binary files /dev/null and b/Audio/ARC/WEP/ArcWepShipGatlingShot3d06.wav differ
diff --git a/Audio/ARC/WEP/ArcWepShipGatlingShot3d07.wav b/Audio/ARC/WEP/ArcWepShipGatlingShot3d07.wav
new file mode 100644
index 00000000..7accbbd4
Binary files /dev/null and b/Audio/ARC/WEP/ArcWepShipGatlingShot3d07.wav differ
diff --git a/CoreSystems.csproj b/CoreSystems.csproj
index 4c21e724..32408fad 100644
--- a/CoreSystems.csproj
+++ b/CoreSystems.csproj
@@ -21,7 +21,7 @@
4
false
6
- WeaponCore.ruleset
+ AllRules.ruleset
pdbonly
@@ -32,7 +32,8 @@
4
false
7
- WeaponCore.ruleset
+
+
WeaponCore
@@ -40,6 +41,24 @@
false
+
+ true
+ bin\x64\Debug\
+ full
+ x64
+ 6
+ prompt
+ AllRules.ruleset
+
+
+ bin\x64\Release\
+ TRACE
+ true
+ pdbonly
+ x64
+ 7
+ prompt
+
@@ -118,7 +137,6 @@
PreserveNewest
-
@@ -430,9 +448,6 @@
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
@@ -532,9 +547,6 @@
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
@@ -687,9 +699,6 @@
False
-
-
-
PreserveNewest
diff --git a/CoreSystems.ruleset b/CoreSystems.ruleset
deleted file mode 100644
index 3e717fad..00000000
--- a/CoreSystems.ruleset
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/CoreSystems.sln b/CoreSystems.sln
index 8b421450..b636bcb5 100644
--- a/CoreSystems.sln
+++ b/CoreSystems.sln
@@ -1,20 +1,26 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.31112.23
+# Visual Studio Version 17
+VisualStudioVersion = 17.13.35806.99 d17.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreSystems", "CoreSystems.csproj", "{A02FF223-D75F-45ED-84F4-63ED89AFCCE9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A02FF223-D75F-45ED-84F4-63ED89AFCCE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A02FF223-D75F-45ED-84F4-63ED89AFCCE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A02FF223-D75F-45ED-84F4-63ED89AFCCE9}.Debug|x64.ActiveCfg = Debug|x64
+ {A02FF223-D75F-45ED-84F4-63ED89AFCCE9}.Debug|x64.Build.0 = Debug|x64
{A02FF223-D75F-45ED-84F4-63ED89AFCCE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A02FF223-D75F-45ED-84F4-63ED89AFCCE9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A02FF223-D75F-45ED-84F4-63ED89AFCCE9}.Release|x64.ActiveCfg = Release|x64
+ {A02FF223-D75F-45ED-84F4-63ED89AFCCE9}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Data/Audio.sbc b/Data/Audio.sbc
new file mode 100644
index 00000000..c2a316d8
--- /dev/null
+++ b/Data/Audio.sbc
@@ -0,0 +1,43 @@
+
+
+
+
+
+ MyObjectBuilder_AudioDefinition
+ ArcWepShipGatlingShot
+
+ SHOT
+ 200
+ 0
+ HeavyFight
+ 3
+
+
+
+ 0.7
+
+
+ Audio\ARC\WEP\ArcWepShipGatlingShot3d01.wav
+
+
+ Audio\ARC\WEP\ArcWepShipGatlingShot3d02.wav
+
+
+ Audio\ARC\WEP\ArcWepShipGatlingShot3d03.wav
+
+
+ Audio\ARC\WEP\ArcWepShipGatlingShot3d04.wav
+
+
+ Audio\ARC\WEP\ArcWepShipGatlingShot3d05.wav
+
+
+ Audio\ARC\WEP\ArcWepShipGatlingShot3d06.wav
+
+
+ Audio\ARC\WEP\ArcWepShipGatlingShot3d07.wav
+
+
+
+
+
diff --git a/Data/BlockVariantGroups.sbc b/Data/BlockVariantGroups.sbc
index 304d4813..824a4998 100644
--- a/Data/BlockVariantGroups.sbc
+++ b/Data/BlockVariantGroups.sbc
@@ -19,6 +19,8 @@
+
+
@@ -30,8 +32,12 @@
+
+
+
+
diff --git a/Data/Scripts/CoreSystems/Ai/AiComp/AiCompRun.cs b/Data/Scripts/CoreSystems/Ai/AiComp/AiCompRun.cs
index 0e6bcea3..99fead1d 100644
--- a/Data/Scripts/CoreSystems/Ai/AiComp/AiCompRun.cs
+++ b/Data/Scripts/CoreSystems/Ai/AiComp/AiCompRun.cs
@@ -1,5 +1,4 @@
-using System;
-using VRage.Game.Components;
+using VRage.Game.Components;
namespace CoreSystems.Support
{
diff --git a/Data/Scripts/CoreSystems/Ai/AiConstruct.cs b/Data/Scripts/CoreSystems/Ai/AiConstruct.cs
index a7489ce4..ef5edeab 100644
--- a/Data/Scripts/CoreSystems/Ai/AiConstruct.cs
+++ b/Data/Scripts/CoreSystems/Ai/AiConstruct.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Linq;
using CoreSystems.Platform;
using CoreSystems.Projectiles;
using Sandbox.Game.Entities;
@@ -441,6 +440,19 @@ internal static void CombatBlockUpdates(Ai cAi)//Obligatory comment to annoy com
double rangeToTarg = double.MaxValue;
var currentAim = aFB.LookAtPosition == null ? Vector3D.Zero : (Vector3D)aFB.LookAtPosition;
var hasTarg = aCB.SearchEnemyComponent.FoundEnemy != null;
+
+ if (aCB.IsWorking && aFB.IsWorking && Session.I.IsServer)
+ {
+ if (hasTarg)
+ {
+ var targTopmost = aCB.SearchEnemyComponent.FoundEnemy.GetTopMostParent();
+ if (checkAi.Construct.Data.Repo.FocusData.Target != targTopmost.EntityId)
+ checkAi.Construct.Focus.ServerChangeFocus((MyEntity)targTopmost, checkAi, 0, Focus.ChangeMode.Add, true);
+ }
+ else if (checkAi.Construct.Data.Repo.FocusData.Target != 0)
+ checkAi.Construct.Focus.ServerChangeFocus(null, checkAi, 0, Focus.ChangeMode.Release, true);
+ }
+
var targSphere = new BoundingSphereD(hasTarg ? aCB.SearchEnemyComponent.FoundEnemy.PositionComp.WorldAABB.Center : Vector3D.Zero, 1); //Does the radius really matter here? use actual enemy or lead position?
if (currentAim != Vector3D.Zero && !stopFiring)
@@ -453,9 +465,17 @@ internal static void CombatBlockUpdates(Ai cAi)//Obligatory comment to annoy com
{
foreach (var comp in ais[x].WeaponComps)
{
- if (comp.HasTurret || comp.HasScanTrackOnly) continue;
+ if (comp.HasTurret || comp.HasScanTrackOnly || comp.PrimaryWeapon.System.RadioType != WeaponCore.Data.Scripts.CoreSystems.Comms.Radio.RadioTypes.Slave) continue;
- if (comp.HasGuidance)
+ if (comp.PrimaryWeapon.System.RadioType == WeaponCore.Data.Scripts.CoreSystems.Comms.Radio.RadioTypes.Slave)
+ {
+ var shoot = comp.PrimaryWeapon.Target.HasTarget;
+ if (shoot && comp.Data.Repo.Values.State.Trigger == CoreComponent.Trigger.Off)
+ comp.ShootManager.RequestShootSync(0, ShootManager.RequestType.On);
+ else if ((stopFiring || !shoot) && comp.Data.Repo.Values.State.Trigger == CoreComponent.Trigger.On)
+ comp.ShootManager.RequestShootSync(0, ShootManager.RequestType.Off);
+ }
+ else if (comp.HasGuidance)
{
bool shoot = hasTarg ? rangeToTarg <= comp.PrimaryWeapon.MaxTargetDistance && MathFuncs.TargetSphereInCone(ref targSphere, ref comp.PrimaryWeapon.AimCone) : false;
if (shoot && comp.Data.Repo.Values.State.Trigger == CoreComponent.Trigger.Off)
@@ -477,8 +497,8 @@ internal static void CombatBlockUpdates(Ai cAi)//Obligatory comment to annoy com
}
}
}
- if (aCB.MarkedForClose) checkAi.Construct.ActiveCombatBlock = null;
- if (aFB.MarkedForClose) checkAi.Construct.ActiveFlightBlock = null; //Placed these removals here so we can flip triggers "off" the last time the method runs
+ if (aCB.MarkedForClose || !aCB.IsWorking) checkAi.Construct.ActiveCombatBlock = null;
+ if (aFB.MarkedForClose || !aFB.IsWorking) checkAi.Construct.ActiveFlightBlock = null; //Placed these removals here so we can flip triggers "off" the last time the method runs
}
}
@@ -855,13 +875,9 @@ internal void Clean()
{
if (TotalEffect > 0)
{
- try
- {
- PlayerMap player;
- var playerName = Session.I.Players.TryGetValue(Ai.AiOwner, out player) ? player.Player.DisplayName ?? string.Empty : string.Empty;
- Log.Stats($"{Ai.TopEntity?.DisplayName}, {playerName}, {(long)TotalEffect}, {TotalPrimaryEffect}, {TotalAoeEffect}, {TotalShieldEffect}, {TotalProjectileEffect}", "griddmgstats");
- }
- catch (Exception ex) { Log.Line($"Exception in ConstructClean: {ex}", null, true); }
+ PlayerMap player;
+ var playerName = Session.I.Players.TryGetValue(Ai.AiOwner, out player) ? player.Player.DisplayName ?? string.Empty : string.Empty;
+ Log.Stats($"{Ai.TopEntity?.DisplayName}, {playerName}, {(long)TotalEffect}, {TotalPrimaryEffect}, {TotalAoeEffect}, {TotalShieldEffect}, {TotalProjectileEffect}", "griddmgstats");
}
if (WeaponGroups.Count > 0)
diff --git a/Data/Scripts/CoreSystems/Ai/AiData.cs b/Data/Scripts/CoreSystems/Ai/AiData.cs
index 19d2625b..4d305235 100644
--- a/Data/Scripts/CoreSystems/Ai/AiData.cs
+++ b/Data/Scripts/CoreSystems/Ai/AiData.cs
@@ -5,8 +5,6 @@
namespace CoreSystems
{
- using static Session;
-
public class AiData
{
public Ai Ai;
diff --git a/Data/Scripts/CoreSystems/Ai/AiDatabase.cs b/Data/Scripts/CoreSystems/Ai/AiDatabase.cs
index 722ea21f..a7db422a 100644
--- a/Data/Scripts/CoreSystems/Ai/AiDatabase.cs
+++ b/Data/Scripts/CoreSystems/Ai/AiDatabase.cs
@@ -1,6 +1,4 @@
-using System;
-using CoreSystems.Platform;
-using Sandbox.Common.ObjectBuilders;
+using Sandbox.Common.ObjectBuilders;
using Sandbox.Game.Entities;
using Sandbox.ModAPI;
using VRage.Game;
@@ -42,7 +40,10 @@ internal void RequestDbUpdate()
internal void Scan()
{
- MyGamePruningStructure.GetAllTopMostEntitiesInSphere(ref ScanVolume, _possibleTargets);
+ if (Session.I.ScanTargetsAction == null)
+ MyGamePruningStructure.GetAllTopMostEntitiesInSphere(ref ScanVolume, _possibleTargets);
+ else
+ Session.I.ScanTargetsAction.Invoke(GridEntity, ScanVolume, _possibleTargets);
NearByEntitiesTmp = _possibleTargets.Count;
for (int i = 0; i < NearByEntitiesTmp; i++)
@@ -362,80 +363,75 @@ private bool TouchingSafeZone(MySafeZone safeZone)
internal bool CreateEntInfo(MyEntity entity, long gridOwner, out Sandbox.ModAPI.Ingame.MyDetectedEntityInfo entInfo)
{
-
- try
+ MyRelationsBetweenPlayerAndBlock relationship = MyRelationsBetweenPlayerAndBlock.Neutral;
+ if (entity == null)
+ {
+ entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo();
+ return false;
+ }
+ var grid = entity.GetTopMostParent() as MyCubeGrid;
+ if (grid != null)
{
- MyRelationsBetweenPlayerAndBlock relationship = MyRelationsBetweenPlayerAndBlock.Neutral;
- if (entity == null)
+ if (!grid.DestructibleBlocks || grid.Immune || grid.GridGeneralDamageModifier <= 0)
{
entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo();
return false;
}
- var grid = entity.GetTopMostParent() as MyCubeGrid;
- if (grid != null)
- {
- if (!grid.DestructibleBlocks || grid.Immune || grid.GridGeneralDamageModifier <= 0)
- {
- entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo();
- return false;
- }
- var bigOwners = grid.BigOwners;
- var topOwner = bigOwners.Count > 0 ? bigOwners[0] : long.MaxValue;
+ var bigOwners = grid.BigOwners;
+ var topOwner = bigOwners.Count > 0 ? bigOwners[0] : long.MaxValue;
- relationship = topOwner != long.MaxValue ? MyIDModule.GetRelationPlayerBlock(gridOwner, topOwner, MyOwnershipShareModeEnum.Faction) : MyRelationsBetweenPlayerAndBlock.NoOwnership;
- var type = grid.GridSizeEnum != MyCubeSize.Small ? Sandbox.ModAPI.Ingame.MyDetectedEntityType.LargeGrid : Sandbox.ModAPI.Ingame.MyDetectedEntityType.SmallGrid;
- entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo(grid.EntityId, string.Empty, type, null, MatrixD.Zero, Vector3.Zero, relationship, new BoundingBoxD(), Session.I.Tick);
- return true;
- }
+ relationship = topOwner != long.MaxValue ? MyIDModule.GetRelationPlayerBlock(gridOwner, topOwner, MyOwnershipShareModeEnum.Faction) : MyRelationsBetweenPlayerAndBlock.NoOwnership;
+ var type = grid.GridSizeEnum != MyCubeSize.Small ? Sandbox.ModAPI.Ingame.MyDetectedEntityType.LargeGrid : Sandbox.ModAPI.Ingame.MyDetectedEntityType.SmallGrid;
+ entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo(grid.EntityId, string.Empty, type, null, MatrixD.Zero, Vector3.Zero, relationship, new BoundingBoxD(), Session.I.Tick);
+ return true;
+ }
- var myCharacter = entity as IMyCharacter;
- if (myCharacter != null)
- {
- var type = !myCharacter.IsPlayer ? Sandbox.ModAPI.Ingame.MyDetectedEntityType.CharacterOther : Sandbox.ModAPI.Ingame.MyDetectedEntityType.CharacterHuman;
+ var myCharacter = entity as IMyCharacter;
+ if (myCharacter != null)
+ {
+ var type = !myCharacter.IsPlayer ? Sandbox.ModAPI.Ingame.MyDetectedEntityType.CharacterOther : Sandbox.ModAPI.Ingame.MyDetectedEntityType.CharacterHuman;
- var getComponentOwner = entity as IMyComponentOwner;
+ var getComponentOwner = entity as IMyComponentOwner;
- long playerId;
- MyIDModule targetIdModule;
- if (getComponentOwner != null && getComponentOwner.GetComponent(out targetIdModule))
- playerId = targetIdModule.Owner;
- else {
- var controllingId = myCharacter.ControllerInfo?.ControllingIdentityId;
- playerId = controllingId ?? 0;
- }
+ long playerId;
+ MyIDModule targetIdModule;
+ if (getComponentOwner != null && getComponentOwner.GetComponent(out targetIdModule))
+ playerId = targetIdModule.Owner;
+ else {
+ var controllingId = myCharacter.ControllerInfo?.ControllingIdentityId;
+ playerId = controllingId ?? 0;
+ }
- relationship = MyIDModule.GetRelationPlayerBlock(gridOwner, playerId, MyOwnershipShareModeEnum.Faction);
- entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo(entity.EntityId, string.Empty, type, null, MatrixD.Zero, Vector3.Zero, relationship, new BoundingBoxD(), Session.I.Tick);
+ relationship = MyIDModule.GetRelationPlayerBlock(gridOwner, playerId, MyOwnershipShareModeEnum.Faction);
+ entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo(entity.EntityId, string.Empty, type, null, MatrixD.Zero, Vector3.Zero, relationship, new BoundingBoxD(), Session.I.Tick);
- return !myCharacter.IsDead && myCharacter.Integrity > 0;
- }
+ return !myCharacter.IsDead && myCharacter.Integrity > 0;
+ }
- var myPlanet = entity as MyPlanet;
+ var myPlanet = entity as MyPlanet;
- if (myPlanet != null)
- {
- const Sandbox.ModAPI.Ingame.MyDetectedEntityType type = Sandbox.ModAPI.Ingame.MyDetectedEntityType.Planet;
- entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo(entity.EntityId, string.Empty, type, null, MatrixD.Zero, Vector3.Zero, relationship, new BoundingBoxD(), Session.I.Tick);
- return true;
- }
- if (entity is MyVoxelMap)
- {
- const Sandbox.ModAPI.Ingame.MyDetectedEntityType type = Sandbox.ModAPI.Ingame.MyDetectedEntityType.Asteroid;
- entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo(entity.EntityId, string.Empty, type, null, MatrixD.Zero, Vector3.Zero, relationship, new BoundingBoxD(), Session.I.Tick);
- return true;
- }
- if (entity is MyMeteor)
- {
- const Sandbox.ModAPI.Ingame.MyDetectedEntityType type = Sandbox.ModAPI.Ingame.MyDetectedEntityType.Meteor;
- entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo(entity.EntityId, string.Empty, type, null, MatrixD.Zero, Vector3.Zero, MyRelationsBetweenPlayerAndBlock.Enemies, new BoundingBoxD(), Session.I.Tick);
- return true;
- }
+ if (myPlanet != null)
+ {
+ const Sandbox.ModAPI.Ingame.MyDetectedEntityType type = Sandbox.ModAPI.Ingame.MyDetectedEntityType.Planet;
+ entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo(entity.EntityId, string.Empty, type, null, MatrixD.Zero, Vector3.Zero, relationship, new BoundingBoxD(), Session.I.Tick);
+ return true;
+ }
+ if (entity is MyVoxelMap)
+ {
+ const Sandbox.ModAPI.Ingame.MyDetectedEntityType type = Sandbox.ModAPI.Ingame.MyDetectedEntityType.Asteroid;
+ entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo(entity.EntityId, string.Empty, type, null, MatrixD.Zero, Vector3.Zero, relationship, new BoundingBoxD(), Session.I.Tick);
+ return true;
+ }
+ if (entity is MyMeteor)
+ {
+ const Sandbox.ModAPI.Ingame.MyDetectedEntityType type = Sandbox.ModAPI.Ingame.MyDetectedEntityType.Meteor;
+ entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo(entity.EntityId, string.Empty, type, null, MatrixD.Zero, Vector3.Zero, MyRelationsBetweenPlayerAndBlock.Enemies, new BoundingBoxD(), Session.I.Tick);
+ return true;
}
- catch (Exception ex) { Log.Line($"Exception in CreateEntInfo: {ex}", null, true); }
- entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo();
- return false;
+ entInfo = new Sandbox.ModAPI.Ingame.MyDetectedEntityInfo();
+ return false;
}
}
}
diff --git a/Data/Scripts/CoreSystems/Ai/AiEvents.cs b/Data/Scripts/CoreSystems/Ai/AiEvents.cs
index 4b6d57b9..a808a82f 100644
--- a/Data/Scripts/CoreSystems/Ai/AiEvents.cs
+++ b/Data/Scripts/CoreSystems/Ai/AiEvents.cs
@@ -2,13 +2,11 @@
using System.Collections.Generic;
using Sandbox.Game;
using Sandbox.Game.Entities;
-using Sandbox.Game.Entities.Interfaces;
using Sandbox.ModAPI;
using VRage;
using VRage.Collections;
using VRage.Game.Entity;
using VRage.Game.ModAPI;
-using VRage.Utils;
using VRageMath;
namespace CoreSystems.Support
@@ -185,10 +183,7 @@ internal void FatBlockAdded(MyCubeBlock cube)
if (!ModOverride && Session.I.IsPartAreaRestricted(cube.BlockDefinition.Id.SubtypeId, blockBox, cube.CubeGrid, cube.EntityId, null, out b, out s))
{
if (Session.I.IsServer)
- {
Session.I.FutureEvents.Schedule(QueuedBlockRemoval, cube, 10);
- //cube.CubeGrid.RemoveBlock(cube.SlimBlock, true);
- }
}
//Projected block ammo removal
diff --git a/Data/Scripts/CoreSystems/Ai/AiFields.cs b/Data/Scripts/CoreSystems/Ai/AiFields.cs
index 230bf5a9..6c1fe363 100644
--- a/Data/Scripts/CoreSystems/Ai/AiFields.cs
+++ b/Data/Scripts/CoreSystems/Ai/AiFields.cs
@@ -1,5 +1,4 @@
-using System;
-using System.Collections.Concurrent;
+using System.Collections.Concurrent;
using System.Collections.Generic;
using CoreSystems.Platform;
using CoreSystems.Projectiles;
diff --git a/Data/Scripts/CoreSystems/Ai/AiSupport.cs b/Data/Scripts/CoreSystems/Ai/AiSupport.cs
index 6fa1ae08..a49b6e5f 100644
--- a/Data/Scripts/CoreSystems/Ai/AiSupport.cs
+++ b/Data/Scripts/CoreSystems/Ai/AiSupport.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Linq;
using CoreSystems.Platform;
using CoreSystems.Projectiles;
using Sandbox.Game.EntityComponents;
@@ -68,7 +67,7 @@ internal void CompChange(bool add, CoreComponent comp)
WeaponIdx[WeaponComps[weaponIdx]] = weaponIdx;
WeaponIdx.Remove(wComp);
- if (wCompMaxWepRange >= (MaxTargetingRange - TopEntity.PositionComp.LocalVolume.Radius) * 0.95) //Filter so that only the longest ranged weps force a recalc
+ if (wCompMaxWepRange >= (MaxTargetingRange - TopEntity.PositionComp.LocalVolume.Radius) * 0.95)
UpdateMaxTargetingRange();
if (wComp.Data.Repo.Values.Set.Overrides.WeaponGroupId > 0)
diff --git a/Data/Scripts/CoreSystems/Ai/AiTargeting.cs b/Data/Scripts/CoreSystems/Ai/AiTargeting.cs
index 7a7a52ae..d9ade1aa 100644
--- a/Data/Scripts/CoreSystems/Ai/AiTargeting.cs
+++ b/Data/Scripts/CoreSystems/Ai/AiTargeting.cs
@@ -1,6 +1,5 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
-using System.Xml;
using CoreSystems.Platform;
using CoreSystems.Projectiles;
using Sandbox.Game.Entities;
@@ -133,9 +132,10 @@ private static bool AcquireTopMostEntity(Weapon w, ProtoWeaponOverrides overRide
var movingMode = moveMode == ProtoWeaponOverrides.MoveModes.Moving;
var fireOnStation = moveMode == ProtoWeaponOverrides.MoveModes.Any || moveMode == ProtoWeaponOverrides.MoveModes.Moored;
var stationOnly = moveMode == ProtoWeaponOverrides.MoveModes.Moored;
+ var shipOnly = moveMode == ProtoWeaponOverrides.MoveModes.ShipAny;
BoundingSphereD waterSphere = new BoundingSphereD(Vector3D.Zero, 1f);
WaterData water = null;
- if (session.WaterApiLoaded && !ammoDef.IgnoreWater && ai.InPlanetGravity && ai.MyPlanet != null && session.WaterMap.TryGetValue(ai.MyPlanet.EntityId, out water))
+ if (session.WaterApiLoaded && !(ammoDef.IgnoreWater || comp.TargetSubmerged) && ai.InPlanetGravity && ai.MyPlanet != null && session.WaterMap.TryGetValue(ai.MyPlanet.EntityId, out water))
waterSphere = new BoundingSphereD(ai.MyPlanet.PositionComp.WorldAABB.Center, water.MinRadius);
var rootConstruct = ai.Construct.RootAi.Construct;
@@ -223,7 +223,7 @@ private static bool AcquireTopMostEntity(Weapon w, ProtoWeaponOverrides overRide
if (w.System.ScanTrackOnly && !ValidScanEntity(w, info.EntInfo, info.Target, true))
continue;
- if (movingMode && info.VelLenSqr < 1 || !fireOnStation && info.IsStatic || stationOnly && !info.IsStatic)
+ if (movingMode && info.VelLenSqr < 1 || !fireOnStation && info.IsStatic || stationOnly && !info.IsStatic || shipOnly && info.IsStatic)
continue;
var character = info.Target as IMyCharacter;
@@ -246,9 +246,15 @@ private static bool AcquireTopMostEntity(Weapon w, ProtoWeaponOverrides overRide
Vector3D targetAccel = accelPrediction ? info.Target.Physics?.LinearAcceleration ?? Vector3D.Zero : Vector3.Zero;
Vector3D predictedPos;
+ // WcApi turret target validation
+ if (Session.I.ValidateWeaponTargetFunc != null &&
+ !Session.I.ValidateWeaponTargetFunc.Invoke(w.Comp.TerminalBlock, w.PartId, info.Target))
+ continue;
+
if (info.IsGrid)
{
- if (!s.TrackGrids || !overRides.Grids || (!overRides.LargeGrid && info.LargeGrid) || (!overRides.SmallGrid && !info.LargeGrid) || !focusTarget && info.FatCount < 2) continue;
+ if (!s.TrackGrids || !overRides.Grids || ((s.TrackProhibitLG || !overRides.LargeGrid) && info.LargeGrid) || ((s.TrackProhibitSG || !overRides.SmallGrid) && !info.LargeGrid) || !focusTarget && info.FatCount < 2) continue;
+
if (w.System.TargetGridCenter)
{
if (!Weapon.CanShootTarget(w, ref targetCenter, targetLinVel, targetAccel, out predictedPos, false, null, MathFuncs.DebugCaller.CanShootTarget2)) continue;
@@ -451,7 +457,7 @@ private static bool AcquireObstruction(Weapon w, ProtoWeaponOverrides overRides)
if (grid != null)
{
- if (!overRides.Grids || (!overRides.LargeGrid && info.LargeGrid) || (!overRides.SmallGrid && !info.LargeGrid) || grid.CubeBlocks.Count == 0) continue;
+ if (!overRides.Grids || ((s.TrackProhibitLG || !overRides.LargeGrid) && info.LargeGrid) || ((s.TrackProhibitSG || !overRides.SmallGrid) && !info.LargeGrid) || grid.CubeBlocks.Count == 0) continue;
session.CanShoot++;
Vector3D newCenter;
@@ -518,7 +524,7 @@ internal static bool AcquireProjectile(Weapon w, ulong id = ulong.MaxValue)
var aConst = w.ActiveAmmoDef.AmmoDef.Const;
BoundingSphereD waterSphere = new BoundingSphereD(Vector3D.Zero, 1f);
WaterData water = null;
- if (Session.I.WaterApiLoaded && !w.ActiveAmmoDef.AmmoDef.IgnoreWater && ai.InPlanetGravity && ai.MyPlanet != null && Session.I.WaterMap.TryGetValue(ai.MyPlanet.EntityId, out water))
+ if (Session.I.WaterApiLoaded && !(w.ActiveAmmoDef.AmmoDef.IgnoreWater || w.Comp.TargetSubmerged) && ai.InPlanetGravity && ai.MyPlanet != null && Session.I.WaterMap.TryGetValue(ai.MyPlanet.EntityId, out water))
waterSphere = new BoundingSphereD(ai.MyPlanet.PositionComp.WorldAABB.Center, water.MinRadius);
var wepAiOwnerFactionId = w.Comp.MasterAi.AiOwnerFactionId;
@@ -735,7 +741,7 @@ internal static bool ReacquireTarget(Projectile p)
var previousEntity = info.AcquiredEntity;
BoundingSphereD waterSphere = new BoundingSphereD(Vector3D.Zero, 1f);
WaterData water = null;
- if (Session.I.WaterApiLoaded && !info.AmmoDef.IgnoreWater && ai.InPlanetGravity && ai.MyPlanet != null && Session.I.WaterMap.TryGetValue(ai.MyPlanet.EntityId, out water))
+ if (Session.I.WaterApiLoaded && !(info.AmmoDef.IgnoreWater || w.Comp.TargetSubmerged) && ai.InPlanetGravity && ai.MyPlanet != null && Session.I.WaterMap.TryGetValue(ai.MyPlanet.EntityId, out water))
waterSphere = new BoundingSphereD(ai.MyPlanet.PositionComp.WorldAABB.Center, water.MinRadius);
TargetInfo alphaInfo = null;
int offset = 0;
@@ -821,7 +827,7 @@ internal static bool ReacquireTarget(Projectile p)
if (tInfo.IsGrid)
{
- if (!s.TrackGrids || !overRides.Grids || !focusTarget && tInfo.FatCount < 2 || !aConst.CheckFutureIntersection && Obstruction(ref tInfo, ref targetPos, p) || (!overRides.LargeGrid && tInfo.LargeGrid) || (!overRides.SmallGrid && !tInfo.LargeGrid)) continue;
+ if (!s.TrackGrids || !overRides.Grids || !focusTarget && tInfo.FatCount < 2 || !aConst.CheckFutureIntersection && Obstruction(ref tInfo, ref targetPos, p) || ((s.TrackProhibitLG || !overRides.LargeGrid) && tInfo.LargeGrid) || ((s.TrackProhibitSG || !overRides.SmallGrid) && !tInfo.LargeGrid)) continue;
if (!AcquireBlock(w, target, tInfo, ref waterSphere, ref info.Random, p, focusTarget)) continue;
acquired = true;
@@ -1129,7 +1135,8 @@ private static bool FindRandomBlock(Weapon w, Target target, TargetInfo info, Co
w.AcquiredBlock = true;
var targetDirNorm = Vector3D.Normalize(blockPos - w.BarrelOrigin);
- var testPos = w.BarrelOrigin + (targetDirNorm * w.MuzzleDistToBarrelCenter);
+ var ctcCam = w.RotorTurretTracking && w.Comp.Ai.ControlComp?.Controller.Camera != null;
+ var testPos = ctcCam ? w.Comp.Ai.ControlComp.Controller.Camera.GetPosition() : w.BarrelOrigin + (targetDirNorm * w.MuzzleDistToBarrelCenter);
var targetDist = Vector3D.Distance(testPos, blockPos);
var fakeCheck = w.System.NoVoxelLosCheck;
@@ -1145,50 +1152,53 @@ private static bool FindRandomBlock(Weapon w, Target target, TargetInfo info, Co
var lowFiVoxels = distSqr > oneHalfKmSqr && (ai.PlanetSurfaceInRange || ai.ClosestVoxelSqr <= oneHalfKmSqr);
var filter = lowFiVoxels ? CollisionLayers.DefaultCollisionLayer : CollisionLayers.VoxelLod1CollisionLayer;
- physics.CastRay(testPos, blockPos, hitTmpList, filter);
- for (int j = 0; j < hitTmpList.Count; j++)
+ IHitInfo iHitInfo;
+ MyCubeGrid rayGrid = null;
+ if (ai.AiType == AiTypes.Grid && physics.CastRay(testPos, blockPos, out iHitInfo, CollisionLayers.NoVoxelCollisionLayer))
+ {
+ rayGrid = iHitInfo.HitEntity?.GetTopMostParent() as MyCubeGrid;
+ if (rayGrid != null && rayGrid.IsSameConstructAs(ai.GridEntity))
+ continue;
+ }
+ if (rayGrid != null && block.CubeGrid == rayGrid)
{
- var hitInfo = hitTmpList[j];
+ acquire = true;
+ }
+ else
+ {
+ physics.CastRay(testPos, blockPos, hitTmpList, filter);
+ for (int j = 0; j < hitTmpList.Count; j++)
+ {
+ var hitInfo = hitTmpList[j];
- var entity = hitInfo.HitEntity as MyEntity;
- var hitGrid = entity as MyCubeGrid;
- var voxel = entity as MyVoxelBase;
- var character = entity as IMyCharacter;
- var dist = hitInfo.Fraction * targetDist;
+ var entity = hitInfo.HitEntity as MyEntity;
+ var hitGrid = entity as MyCubeGrid;
+ var voxel = entity as MyVoxelBase;
+ var character = entity as IMyCharacter;
+ var dist = hitInfo.Fraction * targetDist;
- if (character == null && hitGrid == null && voxel == null || dist >= closest || hitGrid != null && (hitGrid.MarkedForClose || hitGrid.Physics == null || hitGrid.IsPreview))
- continue;
+ if (character == null && hitGrid == null && voxel == null || dist >= closest || hitGrid != null && (hitGrid.MarkedForClose || hitGrid.Physics == null || hitGrid.IsPreview))
+ continue;
- TargetInfo otherInfo;
- var knownTarget = ai.Targets.TryGetValue(entity, out otherInfo) && (otherInfo.EntInfo.Relationship == MyRelationsBetweenPlayerAndBlock.Enemies || otherInfo.EntInfo.Relationship == MyRelationsBetweenPlayerAndBlock.Neutral || otherInfo.EntInfo.Relationship == MyRelationsBetweenPlayerAndBlock.NoOwnership);
+ TargetInfo otherInfo;
+ var knownTarget = ai.Targets.TryGetValue(entity, out otherInfo) && (otherInfo.EntInfo.Relationship == MyRelationsBetweenPlayerAndBlock.Enemies || otherInfo.EntInfo.Relationship == MyRelationsBetweenPlayerAndBlock.Neutral || otherInfo.EntInfo.Relationship == MyRelationsBetweenPlayerAndBlock.NoOwnership);
- var enemyCharacter = character != null && knownTarget;
+ var enemyCharacter = character != null && knownTarget;
- if (character != null && !enemyCharacter)
- {
- if (dist < closest)
+ if (character != null && !enemyCharacter && dist < closest)
{
closest = dist;
acquire = false;
}
- }
- if (voxel != null)
- {
- if (dist < closest)
+ else if (voxel != null && dist < closest)
{
closest = dist;
acquire = false;
}
- }
- else if (hitGrid != null)
- {
- var bigOwners = hitGrid.BigOwners;
- var noOwner = bigOwners.Count == 0;
- var validTarget = noOwner || knownTarget;
-
- if (dist < closest)
+ else if (hitGrid != null && dist < closest)
{
+ var validTarget = hitGrid.BigOwners.Count == 0 || knownTarget;
closest = dist;
acquire = validTarget;
}
@@ -1198,17 +1208,29 @@ private static bool FindRandomBlock(Weapon w, Target target, TargetInfo info, Co
else
{
IHitInfo iHitInfo;
+ MyCubeGrid rayGrid = null;
if (ai.AiType == AiTypes.Grid && physics.CastRay(testPos, testPos + (targetDirNorm * (ai.TopEntityVolume.Radius * 2)), out iHitInfo, CollisionLayers.NoVoxelCollisionLayer))
{
- var rayGrid = iHitInfo.HitEntity?.GetTopMostParent() as MyCubeGrid;
+ rayGrid = iHitInfo.HitEntity?.GetTopMostParent() as MyCubeGrid;
if (rayGrid != null && rayGrid.IsSameConstructAs(ai.GridEntity))
continue;
}
- var checkLine = new LineD(testPos, testPos + (targetDirNorm * w.MaxTargetDistance), w.MaxTargetDistance);
+
s.OverlapResultTmp.Clear();
- var queryType = ai.StaticEntityInRange ? MyEntityQueryType.Both : MyEntityQueryType.Dynamic;
- MyGamePruningStructure.GetTopmostEntitiesOverlappingRay(ref checkLine, s.OverlapResultTmp, queryType);
+ var checkLine = new LineD(testPos, testPos + (targetDirNorm * targetDist), targetDist);
+
+ if (rayGrid != null && block.CubeGrid == rayGrid)
+ {
+ var hit = new MyLineSegmentOverlapResult() {Element = rayGrid};
+ s.OverlapResultTmp.Add(hit);
+ }
+ else
+ {
+ var queryType = ai.StaticEntityInRange ? MyEntityQueryType.Both : MyEntityQueryType.Dynamic;
+ MyGamePruningStructure.GetTopmostEntitiesOverlappingRay(ref checkLine, s.OverlapResultTmp, queryType);
+ }
+
for (int j = 0; j < s.OverlapResultTmp.Count; j++)
{
var entity = s.OverlapResultTmp[j].Element;
@@ -1751,7 +1773,7 @@ internal static bool SwitchToDrone(Weapon w)
var stationOnly = moveMode == ProtoWeaponOverrides.MoveModes.Moored;
BoundingSphereD waterSphere = new BoundingSphereD(Vector3D.Zero, 1f);
WaterData water = null;
- if (session.WaterApiLoaded && !ammoDef.IgnoreWater && ai.InPlanetGravity && ai.MyPlanet != null && session.WaterMap.TryGetValue(ai.MyPlanet.EntityId, out water))
+ if (session.WaterApiLoaded && !(ammoDef.IgnoreWater || w.Comp.TargetSubmerged) && ai.InPlanetGravity && ai.MyPlanet != null && session.WaterMap.TryGetValue(ai.MyPlanet.EntityId, out water))
waterSphere = new BoundingSphereD(ai.MyPlanet.PositionComp.WorldAABB.Center, water.MinRadius);
var numOfTargets = ai.SortedTargets.Count;
@@ -1801,7 +1823,7 @@ internal static bool SwitchToDrone(Weapon w)
if (info.IsGrid)
{
- if (!s.TrackGrids || !overRides.Grids || info.FatCount < 2 || (!overRides.LargeGrid && info.LargeGrid) || (!overRides.SmallGrid && !info.LargeGrid)) continue;
+ if (!s.TrackGrids || !overRides.Grids || info.FatCount < 2 || ((s.TrackProhibitLG || !overRides.LargeGrid) && info.LargeGrid) || ((s.TrackProhibitSG || !overRides.SmallGrid) && !info.LargeGrid)) continue;
session.CanShoot++;
Vector3D newCenter;
if (!w.TurretController)
diff --git a/Data/Scripts/CoreSystems/Ai/AiTypes.cs b/Data/Scripts/CoreSystems/Ai/AiTypes.cs
index 874af0d1..e05287fa 100644
--- a/Data/Scripts/CoreSystems/Ai/AiTypes.cs
+++ b/Data/Scripts/CoreSystems/Ai/AiTypes.cs
@@ -1,10 +1,7 @@
-using System;
-using System.Collections.Concurrent;
+using System.Collections.Concurrent;
using System.Collections.Generic;
using CoreSystems.Platform;
using Sandbox.Game.Entities;
-using Sandbox.Game.World;
-using Sandbox.ModAPI;
using Sandbox.ModAPI.Ingame;
using VRage.Collections;
using VRage.Game;
@@ -12,7 +9,6 @@
using VRage.Game.ModAPI;
using VRage.Utils;
using VRageMath;
-using CollisionLayers = Sandbox.Engine.Physics.MyPhysics.CollisionLayers;
namespace CoreSystems.Support
{
public partial class Ai
@@ -366,7 +362,7 @@ internal void Clean(Ai ai)
DroneCount = 0;
var rootConstruct = ai.Construct.RootAi.Construct;
- if (rootConstruct.DroneCount != 0 && Session.I.Tick - rootConstruct.LastDroneTick > 30) //Was 200, dropped for faster updates on current threats
+ if (rootConstruct.DroneCount != 0 && Session.I.Tick - rootConstruct.LastDroneTick > 30)
rootConstruct.DroneCleanup();
}
}
diff --git a/Data/Scripts/CoreSystems/Api/ApiBackend.cs b/Data/Scripts/CoreSystems/Api/ApiBackend.cs
index 97457462..9b0a8a00 100644
--- a/Data/Scripts/CoreSystems/Api/ApiBackend.cs
+++ b/Data/Scripts/CoreSystems/Api/ApiBackend.cs
@@ -141,6 +141,9 @@ internal ApiBackend()
["IsInRange"] = new Func>(IsInRangeLegacy),
["GetConstructEffectiveDpsBase"] = new Func(GetConstructEffectiveDps),
["GetConstructEffectiveDps"] = new Func(GetConstructEffectiveDpsLegacy),
+ ["AddScanTargetsAction"] = new Action>>(AddScanTargetsAction),
+ ["RemoveScanTargetsAction"] = new Action>>(RemoveScanTargetsAction),
+ ["SetValidateWeaponTargetFunc"] = new Action>(SetValidateWeaponTargetFunc),
// Phantoms
["GetTargetAssessment"] = new Func>(GetPhantomTargetAssessment),
@@ -190,6 +193,7 @@ internal ApiBackend()
["HasGridAi"] = new Func(PbHasGridAi),
["HasCoreWeapon"] = new Func(PbHasCoreWeapon),
["GetOptimalDps"] = new Func(PbGetOptimalDps),
+ ["GetAmmoCount"] = new Func(PbGetAmmoCount),
["GetActiveAmmo"] = new Func(PbGetActiveAmmo),
["SetActiveAmmo"] = new Action(PbSetActiveAmmo),
["RegisterProjectileAdded"] = new Action>(RegisterProjectileAddedCallback),
@@ -264,6 +268,15 @@ private void PbSetActiveAmmo(object arg1, int arg2, string arg3)
SetActiveAmmo((MyEntity) arg1, arg2, arg3);
}
+ private int PbGetAmmoCount(object arg1, int arg2)
+ {
+ var weaponBlock = (MyEntity)arg1;
+ var comp = weaponBlock.Components.Get() as Weapon.WeaponComponent;
+ if (comp?.Platform != null && comp.Platform.State == Ready && comp.Platform.Weapons.Count > arg2)
+ return comp.Platform.Weapons[arg2].ProtoWeaponAmmo.CurrentAmmo;
+ return -1;
+ }
+
private string PbGetActiveAmmo(object arg1, int arg2)
{
return GetActiveAmmo((MyEntity) arg1, arg2);
@@ -1509,6 +1522,23 @@ private MyTuple IsInRange(MyEntity entity)
}
return new MyTuple();
}
+
+ private void AddScanTargetsAction(Action> action)
+ {
+ Session.I.ScanTargetsAction += action;
+ }
+
+ private void RemoveScanTargetsAction(Action> action)
+ {
+ Session.I.ScanTargetsAction -= action;
+ }
+
+ private void SetValidateWeaponTargetFunc(Func func)
+ {
+ Session.I.ValidateWeaponTargetFunc = func;
+ }
+
+
///
/// Phantoms
///
diff --git a/Data/Scripts/CoreSystems/Api/CoreSystemsApiBase.cs b/Data/Scripts/CoreSystems/Api/CoreSystemsApiBase.cs
index 94222dbe..69c0f195 100644
--- a/Data/Scripts/CoreSystems/Api/CoreSystemsApiBase.cs
+++ b/Data/Scripts/CoreSystems/Api/CoreSystemsApiBase.cs
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
-using CoreSystems.Platform;
+using Sandbox.Game.Entities;
using Sandbox.ModAPI;
using VRage;
using VRage.Collections;
@@ -12,7 +12,7 @@
namespace CoreSystems.Api
{
///
- /// https://github.com/sstixrud/CoreSystems/blob/master/BaseData/Scripts/CoreSystems/Api/CoreSystemsApiBase.cs
+ /// https://github.com/Ash-LikeSnow/WeaponCore/blob/master/Data/Scripts/CoreSystems/Api/CoreSystemsApiBase.cs
///
public partial class WcApi
{
@@ -92,6 +92,9 @@ public partial class WcApi
private Func> _getMagazineMap;
private Func _setMagazine;
private Func _forceReload;
+ private Action>> _addScanTargetsAction;
+ private Action>> _removeScanTargetsAction;
+ private Action> _setValidateWeaponTargetFunc;
public void SetWeaponTarget(MyEntity weapon, MyEntity target, int weaponId = 0) =>
_setWeaponTarget?.Invoke(weapon, target, weaponId);
@@ -468,6 +471,25 @@ public bool ForceReload(MyEntity weapon, int weaponId)
}
+ ///
+ /// Registers an action that tells a given grid's AI available target entities in a given sphere. NOT NETWORKED - make sure this is synced in your mod.
+ ///
+ ///
+ public void AddScanTargetsAction(Action> action) => _addScanTargetsAction?.Invoke(action);
+
+ ///
+ /// Unregisters an action that tells a given grid's AI available target entities in a given sphere. NOT NETWORKED - make sure this is synced in your mod.
+ ///
+ ///
+ public void RemoveScanTargetsAction(Action> action) => _removeScanTargetsAction?.Invoke(action);
+
+ ///
+ /// Assigns a function that determines if a given weapon can target a given entity. NOT NETWORKED - make sure this is synced in your mod.
+ ///
+ /// Block, PartId, target
+ public void SetValidateWeaponTargetFunc(Func func) =>
+ _setValidateWeaponTargetFunc?.Invoke(func);
+
private const long Channel = 67549756549;
private bool _getWeaponDefinitions;
private bool _isRegistered;
@@ -618,6 +640,10 @@ public void ApiAssign(IReadOnlyDictionary delegates, bool getW
AssignMethod(delegates, "SetMagazine", ref _setMagazine);
AssignMethod(delegates, "ForceReload", ref _forceReload);
+ AssignMethod(delegates, "AddScanTargetsAction", ref _addScanTargetsAction);
+ AssignMethod(delegates, "RemoveScanTargetsAction", ref _removeScanTargetsAction);
+ AssignMethod(delegates, "SetValidateWeaponTargetFunc", ref _setValidateWeaponTargetFunc);
+
// Damage handler
AssignMethod(delegates, "DamageHandler", ref _registerDamageEvent);
diff --git a/Data/Scripts/CoreSystems/Api/CoreSystemsApiBlocks.cs b/Data/Scripts/CoreSystems/Api/CoreSystemsApiBlocks.cs
index ac20ccce..ba582a31 100644
--- a/Data/Scripts/CoreSystems/Api/CoreSystemsApiBlocks.cs
+++ b/Data/Scripts/CoreSystems/Api/CoreSystemsApiBlocks.cs
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using Sandbox.ModAPI;
-using VRage;
-using VRage.Game.Entity;
-using VRage.ModAPI;
-using VRageMath;
namespace CoreSystems.Api
{
diff --git a/Data/Scripts/CoreSystems/Api/CoreSystemsApiDefs.cs b/Data/Scripts/CoreSystems/Api/CoreSystemsApiDefs.cs
index c8328ac2..e0a169bf 100644
--- a/Data/Scripts/CoreSystems/Api/CoreSystemsApiDefs.cs
+++ b/Data/Scripts/CoreSystems/Api/CoreSystemsApiDefs.cs
@@ -1,9 +1,6 @@
using System.Collections.Generic;
using ProtoBuf;
using VRageMath;
-using static CoreSystems.Support.WeaponDefinition.AmmoDef.GraphicDef.LineDef;
-using static CoreSystems.Support.WeaponDefinition.AmmoDef.TrajectoryDef.ApproachDef;
-using static CoreSystems.Support.WeaponDefinition.AnimationDef.PartAnimationSetDef;
namespace CoreSystems.Api
{
diff --git a/Data/Scripts/CoreSystems/Api/CoreSystemsPbApi.cs b/Data/Scripts/CoreSystems/Api/CoreSystemsPbApi.cs
index 7cf8ee10..8a414678 100644
--- a/Data/Scripts/CoreSystems/Api/CoreSystemsPbApi.cs
+++ b/Data/Scripts/CoreSystems/Api/CoreSystemsPbApi.cs
@@ -8,6 +8,8 @@
namespace CoreSystems.Api
{
+ // WC PB API USERS: Copy the class below into your script
+
///
/// https://github.com/Ash-LikeSnow/WeaponCore/blob/master/Data/Scripts/CoreSystems/Api/CoreSystemsPbApi.cs
///
@@ -44,6 +46,7 @@ public class WcPbApi
private Func _hasCoreWeapon;
private Func _getOptimalDps;
private Func _getActiveAmmo;
+ private Func _getAmmoCount;
private Action _setActiveAmmo;
private Action> _monitorProjectile;
private Action> _unMonitorProjectile;
@@ -120,6 +123,7 @@ public bool ApiAssign(IReadOnlyDictionary delegates)
AssignMethod(delegates, "HasGridAi", ref _hasGridAi);
AssignMethod(delegates, "HasCoreWeapon", ref _hasCoreWeapon);
AssignMethod(delegates, "GetOptimalDps", ref _getOptimalDps);
+ AssignMethod(delegates, "GetAmmoCount", ref _getAmmoCount);
AssignMethod(delegates, "GetActiveAmmo", ref _getActiveAmmo);
AssignMethod(delegates, "SetActiveAmmo", ref _setActiveAmmo);
AssignMethod(delegates, "MonitorProjectile", ref _monitorProjectile);
@@ -502,6 +506,15 @@ public bool CanShootTarget(Sandbox.ModAPI.Ingame.IMyTerminalBlock weapon, long t
public string GetActiveAmmo(Sandbox.ModAPI.Ingame.IMyTerminalBlock weapon, int weaponId) =>
_getActiveAmmo?.Invoke(weapon, weaponId) ?? null;
+ ///
+ /// Returns the current amount of ammo the weapon has internally (loaded, not inventory) on .
+ ///
+ ///
+ ///
+ /// Current ammo
+ public string GetAmmoCount(Sandbox.ModAPI.Ingame.IMyTerminalBlock weapon, int weaponId) =>
+ _getActiveAmmo?.Invoke(weapon, weaponId) ?? null;
+
///
/// Sets the active ammo name of on to .
///
diff --git a/Data/Scripts/CoreSystems/AudioVisual/AvShot.cs b/Data/Scripts/CoreSystems/AudioVisual/AvShot.cs
index 1085c15d..19765163 100644
--- a/Data/Scripts/CoreSystems/AudioVisual/AvShot.cs
+++ b/Data/Scripts/CoreSystems/AudioVisual/AvShot.cs
@@ -58,6 +58,9 @@ public AvShot(Session session)
internal bool LastHitShield;
internal bool ForceHitParticle;
internal bool HitParticleActive;
+ internal bool ShieldHitParticleActive;
+ internal bool VoxelHitParticleActive;
+ internal bool WaterHitParticleActive;
internal bool MarkForClose;
internal bool ProEnded;
internal bool AccelClearance;
@@ -104,6 +107,7 @@ public AvShot(Session session)
internal Vector3D ShootVelStep;
internal Vector3D TracerFront;
internal Vector3D TracerBack;
+ internal Vector3D ShieldHitAngle;
internal Vector4 Color;
internal Vector4 SegmentColor;
internal Vector4 FgFactionColor;
@@ -127,6 +131,9 @@ internal enum ParticleState
{
None,
Custom,
+ Shield,
+ Water,
+ Voxel,
Dirty,
}
@@ -385,7 +392,10 @@ internal static void DeferedAvStateUpdates()
var lineOnScreen = a.OnScreen > (Screen)2;
- if (!a.Active && (a.OnScreen != Screen.None || a.HitSoundInitted || a.TravelSound || aConst.AmmoParticleNoCull || saveHit && aConst.HitParticleNoCull || aConst.FieldParticle && aConst.FieldParticleNoCull)) {
+ var anyHitParticleNoCull = saveHit && (aConst.HitParticleNoCull || aConst.ShieldHitParticleNoCull || aConst.VoxelHitParticleNoCull || aConst.WaterHitParticleNoCull);
+
+ if (!a.Active && (a.OnScreen != Screen.None || a.HitSoundInitted || a.TravelSound || aConst.AmmoParticleNoCull || anyHitParticleNoCull || aConst.FieldParticle && aConst.FieldParticleNoCull))
+ {
a.Active = true;
s.Av.AvShots.Add(a);
}
@@ -397,19 +407,23 @@ internal static void DeferedAvStateUpdates()
{
if (a.Tracer == TracerState.Shrink && !a.ShrinkInited)
a.Shrink();
- else if (aConst.IsBeamWeapon && aConst.HitParticle && !(a.MuzzleId != 0 && (aConst.ConvergeBeams || aConst.OneHitParticle)))
+ else if (aConst.IsBeamWeapon && !(a.MuzzleId != 0 && (aConst.ConvergeBeams || aConst.OneHitParticle)))
{
- MyParticleEffect effect;
- if (a.Hitting)
- {
- ContainmentType containment;
- s.CameraFrustrum.Contains(ref a.Hit.SurfaceHit, out containment);
- if (containment != ContainmentType.Disjoint) a.RunBeam();
- }
- else if (s.Av.BeamEffects.TryGetValue(a.UniqueMuzzleId, out effect))
+ var shieldHit = a.Hit.EventType == HitEntity.Type.Shield && aConst.ShieldHitParticle;
+ if (shieldHit && a.ShieldHitParticleActive || (!shieldHit && aConst.HitParticle && a.HitParticleActive))
{
- effect.Stop();
- s.Av.BeamEffects.Remove(a.UniqueMuzzleId);
+ MyParticleEffect effect;
+ if (a.Hitting)
+ {
+ ContainmentType containment;
+ s.CameraFrustrum.Contains(ref a.Hit.SurfaceHit, out containment);
+ if (containment != ContainmentType.Disjoint) a.RunBeam(shieldHit && a.ShieldHitParticleActive);
+ }
+ else if (s.Av.BeamEffects.TryGetValue(a.UniqueMuzzleId, out effect))
+ {
+ effect.Stop();
+ s.Av.BeamEffects.Remove(a.UniqueMuzzleId);
+ }
}
}
@@ -957,53 +971,47 @@ internal void HitEffects(bool force = false)
double distToCameraSqr;
Vector3D.DistanceSquared(ref Hit.SurfaceHit, ref Session.CameraPos, out distToCameraSqr);
- if (Hit.EventType == HitEntity.Type.Water)
- {
- HitParticleActive = true;//FML... didn't know there was rand for impacts.
- }
+ if (Hit.EventType == HitEntity.Type.Water && !AmmoDef.Const.WaterHitParticle)
+ HitParticleActive = true;
- if (OnScreen == Screen.Tracer || AmmoDef.Const.HitParticleNoCull || distToCameraSqr < 360000) {
- if (HitParticleActive && AmmoDef.Const.HitParticle && !(LastHitShield && !AmmoDef.AmmoGraphics.Particles.Hit.ApplyToShield))
- HitParticle = ParticleState.Custom;
+ if (OnScreen != Screen.None)
+ {
+ if (LastHitShield && ShieldHitParticleActive && AmmoDef.Const.ShieldHitParticle && (AmmoDef.Const.ShieldHitParticleNoCull || distToCameraSqr < 360000))
+ HitParticle = ParticleState.Shield;
+ else if (WaterHitParticleActive && Hit.EventType == HitEntity.Type.Water && (AmmoDef.Const.WaterHitParticleNoCull || distToCameraSqr < 360000))
+ HitParticle = ParticleState.Water;
+ else if (VoxelHitParticleActive && Hit.EventType == HitEntity.Type.Voxel && (AmmoDef.Const.VoxelHitParticleNoCull || distToCameraSqr < 360000))
+ HitParticle = ParticleState.Voxel;
+ else if (HitParticleActive && AmmoDef.Const.HitParticle && !(LastHitShield && !AmmoDef.AmmoGraphics.Particles.Hit.ApplyToShield) && (AmmoDef.Const.HitParticleNoCull || distToCameraSqr < 360000))
+ HitParticle = ParticleState.Custom;
}
-
var hitSound = AmmoDef.Const.HitSound && HitSoundActive && distToCameraSqr < AmmoDef.Const.HitSoundDistSqr && (!LastHitShield || AmmoDef.AmmoAudio.HitPlayShield);
- if (hitSound) {
-
+ if (hitSound)
+ {
MySoundPair pair = null;
- var shield = Hit.Entity as IMyUpgradeModule;
- var voxel = Hit.Entity as MyVoxelBase;
- var player = Hit.Entity as IMyCharacter;
- var floating = Hit.Entity as MyFloatingObject;
- if (voxel != null && AmmoDef.Const.VoxelSound) {
+ if (AmmoDef.Const.VoxelSound && Hit.EventType == HitEntity.Type.Voxel)
pair = AmmoDef.Const.VoxelSoundPair;
- }
- else if (player != null && AmmoDef.Const.PlayerSound) {
+ else if (AmmoDef.Const.PlayerSound && Hit.Entity is IMyCharacter)
pair = AmmoDef.Const.PlayerSoundPair;
- }
- else if (floating != null && AmmoDef.Const.FloatingSound) {
+ else if (AmmoDef.Const.FloatingSound && Hit.Entity is MyFloatingObject)
pair = AmmoDef.Const.FloatingSoundPair;
- }
- else if (shield != null && AmmoDef.Const.ShieldSound) {
+ else if (AmmoDef.Const.ShieldSound && LastHitShield)
pair = AmmoDef.Const.ShieldSoundPair;
- }
- else if (AmmoDef.Const.HitSound) {
+ else if (AmmoDef.Const.WaterSound && Hit.EventType == HitEntity.Type.Water)
+ pair = AmmoDef.Const.WaterSoundPair;
+ else if (AmmoDef.Const.HitSound)
pair = AmmoDef.Const.HitSoundPair;
- }
-
- if (pair != null) {
+ if (pair != null)
+ {
var hitEmitter = Session.Av.PersistentEmitters.Count > 0 ? Session.Av.PersistentEmitters.Pop() : new MyEntity3DSoundEmitter(null);
-
var pos = Session.Tick - Hit.HitTick <= 1 && !MyUtils.IsZero(Hit.SurfaceHit) ? Hit.SurfaceHit : TracerFront;
hitEmitter.Entity = Hit.Entity;
hitEmitter.SetPosition(pos);
hitEmitter.PlaySound(pair);
-
Session.SoundsToClean.Add(new Session.CleanSound { DelayedReturn = true, Emitter = hitEmitter, Pair = pair, EmitterPool = Session.I.Av.PersistentEmitters, SpawnTick = Session.I.Tick });
-
HitSoundInitted = true;
}
}
@@ -1051,8 +1059,8 @@ internal void SetupSounds(double distanceFromCameraSqr)
}
catch (Exception e)
{
- MyLog.Default.Error($"Sound error with ammo: {AmmoDef.AmmoRound} from {Weapon.Comp.TerminalBlock.DisplayName} soundID {AmmoDef.Const.ShotSoundPair.SoundId} cuename {AmmoDef.Const.ShotSoundPair.GetCueName()}" +
- $"FireEmitter.Entity null? {FireEmitter?.Entity == null} \n Origin: {Origin}");
+ MyLog.Default.Error($"Sound error with ammo: {AmmoDef.AmmoRound} from {Weapon.Comp.TerminalBlock.CustomName} soundID {AmmoDef.Const.ShotSoundPair.SoundId} cuename {AmmoDef.Const.ShotSoundPair.GetCueName()}" +
+ $"\n FireEmitter.Entity null? {FireEmitter?.Entity == null} \n Origin: {Origin} \n Marked for Close? {Weapon.Comp.FunctionalBlock.MarkedForClose}");
throw e;
}
}
@@ -1187,22 +1195,24 @@ private void StageChange(int newStageIdx, bool createdPrimeEntity)
}
- internal void RunBeam()
- {
+ internal void RunBeam(bool shieldHit)
+ {
+ var p = AmmoDef.AmmoGraphics.Particles;
MyParticleEffect effect;
MatrixD matrix;
var vel = HitVelocity;
if (!Session.Av.BeamEffects.TryGetValue(UniqueMuzzleId, out effect)) {
-
- MatrixD.CreateTranslation(ref TracerFront, out matrix);
- if (!MyParticlesManager.TryCreateParticleEffect(AmmoDef.AmmoGraphics.Particles.Hit.Name, ref matrix, ref TracerFront, uint.MaxValue, out effect)) {
+ if (shieldHit)
+ matrix = MatrixD.CreateWorld(TracerFront, ShieldHitAngle, Vector3D.CalculatePerpendicularVector(ShieldHitAngle));
+ else
+ MatrixD.CreateTranslation(ref TracerFront, out matrix);
+ if (!MyParticlesManager.TryCreateParticleEffect(shieldHit ? p.ShieldHit.Name : p.Hit.Name, ref matrix, ref TracerFront, uint.MaxValue, out effect))
return;
- }
if (effect.Loop || effect.DurationMax <= 0)
Session.Av.BeamEffects[UniqueMuzzleId] = effect;
- effect.UserScale = AmmoDef.AmmoGraphics.Particles.Hit.Extras.Scale;
+ effect.UserScale = shieldHit ? p.ShieldHit.Extras.Scale : p.Hit.Extras.Scale;
Vector3D.ClampToSphere(ref vel, (float)MaxSpeed);
}
@@ -1221,6 +1231,8 @@ internal static void UpdateVirtualBeams(Projectile p, ProInfo info, HitEntity hi
for (int v = 0; v < p.VrPros.Count; v++)
{
+ if (p.State == ProjectileState.Dead)
+ break;
var vp = p.VrPros[v];
var vs = vp.AvShot;
@@ -1308,11 +1320,10 @@ internal void AvClose()
{
var particle = AmmoDef.AmmoGraphics.Particles.Hit;
- var keenStrikesAgain = particle.Offset == Vector3D.MaxValue;
MatrixD matrix = MatrixD.CreateTranslation(pos);
- if(keenStrikesAgain)
+ if (particle.Offset == Vector3D.MaxValue)
{
- matrix = MatrixD.CreateWorld(pos, VisualDir, OriginUp);
+ matrix = MatrixD.CreateWorld(pos, VisualDir, Vector3D.CalculatePerpendicularVector(VisualDir));
}
else if (particle.Offset == Vector3D.MinValue)
{
@@ -1410,7 +1421,6 @@ internal void UpdateCache(AvInfoCache avInfoCache)
internal void Close()
{
- // Reset only vars that are not always set
Hit = new Hit();
EndState = new AvClose();
@@ -1482,6 +1492,7 @@ internal void Close()
Session.Av.OffSetLists.Push(Offsets);
}
+ ShieldHitAngle = Vector3D.Zero;
HitVelocity = Vector3D.Zero;
TracerBack = Vector3D.Zero;
TracerFront = Vector3D.Zero;
diff --git a/Data/Scripts/CoreSystems/AudioVisual/RunAv.cs b/Data/Scripts/CoreSystems/AudioVisual/RunAv.cs
index 85aa356a..81691626 100644
--- a/Data/Scripts/CoreSystems/AudioVisual/RunAv.cs
+++ b/Data/Scripts/CoreSystems/AudioVisual/RunAv.cs
@@ -11,6 +11,7 @@
using VRageRender;
using static VRageRender.MyBillboard;
using static CoreSystems.Support.WeaponDefinition.AmmoDef.GraphicDef.LineDef;
+using static CoreSystems.Support.WeaponDefinition;
namespace CoreSystems.Support
{
class RunAv
@@ -138,42 +139,78 @@ internal void End()
else av.TravelEmitter.SetPosition(av.TracerFront);
}
- if (av.HitParticle == AvShot.ParticleState.Custom)
+ if (!(av.HitParticle == AvShot.ParticleState.Dirty || av.HitParticle == AvShot.ParticleState.None))
{
- av.HitParticle = AvShot.ParticleState.Dirty;
if (av.OnScreen != AvShot.Screen.None)
{
var pos = Session.I.Tick - av.Hit.HitTick <= 1 && !MyUtils.IsZero(av.Hit.SurfaceHit) ? av.Hit.SurfaceHit : av.TracerFront;
- var particle = av.AmmoDef.AmmoGraphics.Particles.Hit;
- var keenStrikesAgain = particle.Offset == Vector3D.MaxValue;
+ ParticleDef particle;
+ bool gravPerp = false;
MatrixD matrix = MatrixD.CreateTranslation(pos);
- if (keenStrikesAgain)
+ switch (av.HitParticle)
{
- matrix = MatrixD.CreateWorld(pos, av.VisualDir, av.OriginUp);
+ case AvShot.ParticleState.Shield:
+ particle = av.AmmoDef.AmmoGraphics.Particles.ShieldHit;
+ if (av.ShieldHitAngle == Vector3D.Zero)
+ {
+ var grid = av.Hit.Entity.GetTopMostParent() as IMyCubeGrid;
+ var lineToShield = pos - grid.PositionComp.WorldAABB.Center;
+ lineToShield.Normalize();
+ matrix = MatrixD.CreateWorld(pos, lineToShield, Vector3D.CalculatePerpendicularVector(lineToShield));
+ }
+ else
+ matrix = MatrixD.CreateWorld(pos, av.ShieldHitAngle, Vector3D.CalculatePerpendicularVector(av.ShieldHitAngle));
+ break;
+ case AvShot.ParticleState.Water:
+ particle = av.AmmoDef.AmmoGraphics.Particles.WaterHit;
+ gravPerp = true;
+ break;
+ case AvShot.ParticleState.Voxel:
+ particle = av.AmmoDef.AmmoGraphics.Particles.VoxelHit;
+ gravPerp = true;
+ break;
+ case AvShot.ParticleState.Custom:
+ default:
+ particle = av.AmmoDef.AmmoGraphics.Particles.Hit;
+ if (particle.Offset == Vector3D.MaxValue)
+ matrix = MatrixD.CreateWorld(pos, av.VisualDir, Vector3D.CalculatePerpendicularVector(av.VisualDir));
+ else if (particle.Offset == Vector3D.MinValue)
+ gravPerp = true;
+ break;
}
- else if (particle.Offset == Vector3D.MinValue)
+
+ if (gravPerp)
{
- float interference;
- Vector3D localGrav = Session.I.Physics.CalculateNaturalGravityAt(pos, out interference);
- localGrav.Normalize();
- if (localGrav != Vector3D.Zero)
- matrix = MatrixD.CreateWorld(pos, Vector3D.CalculatePerpendicularVector(localGrav), -localGrav);
+ if (av.Weapon?.Comp?.Ai?.MyPlanet != null)
+ {
+ var planetDir = pos - av.Weapon.Comp.Ai.MyPlanet.PositionComp.WorldAABB.Center;
+ planetDir.Normalize();
+ matrix = MatrixD.CreateWorld(pos, Vector3D.CalculatePerpendicularVector(planetDir), -planetDir);
+ }
+ else
+ {
+ float interference;
+ Vector3D localGrav = Session.I.Physics.CalculateNaturalGravityAt(pos, out interference);
+ localGrav.Normalize();
+ if (localGrav != Vector3D.Zero)
+ matrix = MatrixD.CreateWorld(pos, Vector3D.CalculatePerpendicularVector(localGrav), -localGrav);
+ }
}
MyParticleEffect hitEffect;
- if (MyParticlesManager.TryCreateParticleEffect(av.AmmoDef.Const.HitParticleStr, ref matrix, ref pos, uint.MaxValue, out hitEffect))
+ if (MyParticlesManager.TryCreateParticleEffect(particle.Name, ref matrix, ref pos, uint.MaxValue, out hitEffect))
{
- hitEffect.UserScale = av.AmmoDef.AmmoGraphics.Particles.Hit.Extras.Scale;
+ hitEffect.UserScale = particle.Extras.Scale;
var tickVelo = av.Hit.HitVelocity / 60;
HitParticles.Add(new HitParticleEvent(hitEffect, tickVelo));
if (hitEffect.Loop)
hitEffect.Stop();
}
}
+ av.HitParticle = AvShot.ParticleState.Dirty;
}
if (av.Hit.Entity != null && av.AmmoDef.AmmoGraphics.Decals.MaxAge > 0 && !Vector3D.IsZero(av.Hit.SurfaceHit) && av.AmmoDef.Const.TextureHitMap.Count > 0 && !av.Hit.Entity.MarkedForClose && av.Hit.Entity.InScene)
{
- //Starcore bug report on decals, parent "not found" and world position goes to NaN
var shield = av.Hit.Entity as IMyUpgradeModule;
var floating = av.Hit.Entity as MyFloatingObject;
if (shield == null && floating == null)
@@ -201,26 +238,11 @@ internal void End()
Position = av.Hit.SurfaceHit + (av.Direction * 0.01),
Normal = av.Direction,
};
-
-
- //Log.Line($"Decal: {av.Hit.Entity.DebugName} mat{materialType} closed?{av.Hit.Entity.Closed} posCompNull?{av.Hit.Entity.PositionComp != null}");
-
MyDecals.HandleAddDecal(av.Hit.Entity, hitInfo, Vector3.Zero, materialType, projectileMaterial, null, -1, voxelMaterial, false, MyDecalFlags.IgnoreOffScreenDeletion, MyAPIGateway.Session.GameplayFrameCounter + av.AmmoDef.AmmoGraphics.Decals.MaxAge);
}
}
}
- if (av.Hit.EventType == HitEntity.Type.Water)
- {
- var splashHit = av.Hit.SurfaceHit;//Hopefully we can get a more precise surface intercept or correction?
- var ammoInfo = av.AmmoDef;
- var radius = ammoInfo.Const.CollisionSize > ammoInfo.Const.LargestHitSize ? (float)ammoInfo.Const.CollisionSize : (float)ammoInfo.Const.LargestHitSize;
- if (radius < 3)
- radius = 3;
-
- WaterModAPI.CreateSplash(splashHit, radius, true);
- }
-
if (av.Model != AvShot.ModelState.None)
{
if (av.AmmoEffect != null && av.AmmoDef.Const.AmmoParticle && av.AmmoDef.Const.PrimeModel)
diff --git a/Data/Scripts/CoreSystems/Comms/Spectrum.cs b/Data/Scripts/CoreSystems/Comms/Spectrum.cs
index 8b8c8e0c..c01d3dfc 100644
--- a/Data/Scripts/CoreSystems/Comms/Spectrum.cs
+++ b/Data/Scripts/CoreSystems/Comms/Spectrum.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using CoreSystems;
using VRage.Utils;
using WeaponCore.Data.Scripts.CoreSystems.Support;
diff --git a/Data/Scripts/CoreSystems/Coreparts/Definitions/AmmoTypes.cs b/Data/Scripts/CoreSystems/Coreparts/Definitions/AmmoTypes.cs
index 6591afe3..3fafc203 100644
--- a/Data/Scripts/CoreSystems/Coreparts/Definitions/AmmoTypes.cs
+++ b/Data/Scripts/CoreSystems/Coreparts/Definitions/AmmoTypes.cs
@@ -1,16 +1,9 @@
using static CoreSystems.Support.WeaponDefinition;
using static CoreSystems.Support.WeaponDefinition.AmmoDef;
-using static CoreSystems.Support.WeaponDefinition.AmmoDef.EjectionDef;
-using static CoreSystems.Support.WeaponDefinition.AmmoDef.EjectionDef.SpawnType;
using static CoreSystems.Support.WeaponDefinition.AmmoDef.ShapeDef.Shapes;
using static CoreSystems.Support.WeaponDefinition.AmmoDef.DamageScaleDef.CustomScalesDef.SkipMode;
using static CoreSystems.Support.WeaponDefinition.AmmoDef.GraphicDef;
using static CoreSystems.Support.WeaponDefinition.AmmoDef.GraphicDef.DecalDef;
-
-using static CoreSystems.Support.WeaponDefinition.AmmoDef.FragmentDef;
-using static CoreSystems.Support.WeaponDefinition.AmmoDef.PatternDef.PatternModes;
-using static CoreSystems.Support.WeaponDefinition.AmmoDef.FragmentDef.TimedSpawnDef.PointTypes;
-using static CoreSystems.Support.WeaponDefinition.AmmoDef.TrajectoryDef;
using static CoreSystems.Support.WeaponDefinition.AmmoDef.TrajectoryDef.GuidanceType;
using static CoreSystems.Support.WeaponDefinition.AmmoDef.DamageScaleDef;
using static CoreSystems.Support.WeaponDefinition.AmmoDef.DamageScaleDef.ShieldDef.ShieldType;
@@ -18,12 +11,7 @@
using static CoreSystems.Support.WeaponDefinition.AmmoDef.AreaOfDamageDef;
using static CoreSystems.Support.WeaponDefinition.AmmoDef.AreaOfDamageDef.Falloff;
using static CoreSystems.Support.WeaponDefinition.AmmoDef.AreaOfDamageDef.AoeShape;
-using static CoreSystems.Support.WeaponDefinition.AmmoDef.EwarDef;
-using static CoreSystems.Support.WeaponDefinition.AmmoDef.EwarDef.EwarMode;
-using static CoreSystems.Support.WeaponDefinition.AmmoDef.EwarDef.EwarType;
-using static CoreSystems.Support.WeaponDefinition.AmmoDef.EwarDef.PushPullDef.Force;
using static CoreSystems.Support.WeaponDefinition.AmmoDef.GraphicDef.LineDef;
-using static CoreSystems.Support.WeaponDefinition.AmmoDef.GraphicDef.LineDef.TracerBaseDef;
using static CoreSystems.Support.WeaponDefinition.AmmoDef.GraphicDef.LineDef.Texture;
using static CoreSystems.Support.WeaponDefinition.AmmoDef.DamageScaleDef.DamageTypes.Damage;
namespace Scripts
@@ -36,6 +24,7 @@ partial class Parts
AmmoRound = "SpotLight",
BaseDamage = 0,
NoGridOrArmorScaling = true,
+ EnergyMagazineSize = 1,
Trajectory = new TrajectoryDef
{
MaxLifeTime = 3600,
@@ -47,82 +36,15 @@ partial class Parts
{
AmmoMagazine = "NATO_25x184mm", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo.
AmmoRound = "25mm NATO", // Name of ammo in terminal, should be different for each ammo type used by the same weapon. Is used by Shrapnel.
- HybridRound = false, // Use both a physical ammo magazine and energy per shot.
- EnergyCost = 0.1f, // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR.
BaseDamage = 90f, // Direct damage; one steel plate is worth 100.
Mass = 1f, // In kilograms; how much force the impact will apply to the target.
- Health = 0, // How much damage the projectile can take from other projectiles (base of 1 per hit) before dying; 0 disables this and makes the projectile untargetable.
BackKickForce = 200f, // Recoil. This is applied to the Parent Grid.
- DecayPerShot = 0f, // Damage to the firing weapon itself.
- HardPointUsable = true, // Whether this is a primary ammo type fired directly by the turret. Set to false if this is a shrapnel ammoType and you don't want the turret to be able to select it directly.
- EnergyMagazineSize = 0, // For energy weapons, how many shots to fire before reloading.
- IgnoreWater = false, // Whether the projectile should be able to penetrate water when using WaterMod.
- IgnoreVoxels = false, // Whether the projectile should be able to penetrate voxels.
- Synchronize = false, // For future use
- HeatModifier = -1f, // Allows this ammo to modify the amount of heat the weapon produces per shot.
- Shape = new ShapeDef // Defines the collision shape of the projectile, defaults to LineShape and uses the visual Line Length if set to 0.
- {
- Shape = LineShape, // LineShape or SphereShape. Do not use SphereShape for fast moving projectiles if you care about precision.
- Diameter = 0, // Diameter is minimum length of LineShape or minimum diameter of SphereShape.
- },
- ObjectsHit = new ObjectsHitDef
- {
- MaxObjectsHit = 0, // Limits the number of entities (grids, players, projectiles) the projectile can penetrate; 0 = unlimited.
- CountBlocks = false, // Counts individual blocks, not just entities hit.
- },
- Fragment = new FragmentDef // Formerly known as Shrapnel. Spawns specified ammo fragments on projectile death (via hit or detonation).
- {
- AmmoRound = "", // AmmoRound field of the ammo to spawn.
- Fragments = 0, // Number of projectiles to spawn.
- Degrees = 0, // Cone in which to randomize direction of spawned projectiles.
- Reverse = false, // Spawn projectiles backward instead of forward.
- DropVelocity = false, // fragments will not inherit velocity from parent.
- Offset = 0f, // Offsets the fragment spawn by this amount, in meters (positive forward, negative for backwards), value is read from parent ammo type.
- Radial = 0f, // Determines starting angle for Degrees of spread above. IE, 0 degrees and 90 radial goes perpendicular to travel path
- MaxChildren = 0, // number of maximum branches for fragments from the roots point of view, 0 is unlimited
- IgnoreArming = true, // If true, ignore ArmOnHit or MinArmingTime in EndOfLife definitions
- AdvOffset = Vector(x: 0, y: 0, z: 0), // advanced offsets the fragment by xyz coordinates relative to parent, value is read from fragment ammo type.
- TimedSpawns = new TimedSpawnDef // disables FragOnEnd in favor of info specified below
- {
- Enable = false, // Enables TimedSpawns mechanism
- Interval = 0, // Time between spawning fragments, in ticks, 0 means every tick, 1 means every other
- StartTime = 0, // Time delay to start spawning fragments, in ticks, of total projectile life
- MaxSpawns = 1, // Max number of fragment children to spawn
- Proximity = 1000, // Starting distance from target bounding sphere to start spawning fragments, 0 disables this feature. No spawning outside this distance
- ParentDies = true, // Parent dies once after it spawns its last child.
- PointAtTarget = true, // Start fragment direction pointing at Target
- PointType = Predict, // Point accuracy, Direct, Lead (always fire), Predict (only fire if it can hit)
- GroupSize = 5, // Number of spawns in each group
- GroupDelay = 120, // Delay between each group.
- },
- },
- Pattern = new PatternDef
- {
- Patterns = new[] { // If enabled, set of multiple ammos to fire in order instead of the main ammo.
- "",
- },
- Mode = Fragment, // Select when to activate this pattern, options: Never, Weapon, Fragment, Both
- TriggerChance = 1f, // This is %
- Random = false, // This randomizes the number spawned at once, NOT the list order.
- RandomMin = 1,
- RandomMax = 1,
- SkipParent = false, // Skip the Ammo itself, in the list
- PatternSteps = 1, // Number of Ammos activated per round, will progress in order and loop. Ignored if Random = true.
- },
+ HardPointUsable = true, // Whether this is a primary ammo type fired directly by the turret. Set to false if this is a shrapnel ammoType and you don't want the turret to be able to select it directly.
DamageScales = new DamageScaleDef
{
- MaxIntegrity = 0f, // Blocks with integrity higher than this value will be immune to damage from this projectile; 0 = disabled.
- DamageVoxels = false, // Whether to damage voxels.
- SelfDamage = false, // Whether to damage the weapon's own grid.
HealthHitModifier = 1, // How much Health to subtract from another projectile on hit; defaults to 1 if zero or less.
VoxelHitModifier = 1, // Voxel damage multiplier; defaults to 1 if zero or less.
Characters = 0.33f, // Character damage multiplier; defaults to 1 if zero or less.
- // For the following modifier values: -1 = disabled (higher performance), 0 = no damage, 0.01f = 1% damage, 2 = 200% damage.
- FallOff = new FallOffDef
- {
- Distance = 1000f, // Distance at which damage begins falling off.
- MinMultipler = -1f, // Value from 0.0001f to 1f where 0.1f would be a min damage of 10% of base damage.
- },
Grids = new GridSizeDef
{
Large = -1f, // Multiplier for damage against large grids.
@@ -153,164 +75,15 @@ partial class Parts
DeformType = HitBlock,
DeformDelay = 30,
},
- Custom = new CustomScalesDef
- {
- SkipOthers = NoSkip, // Controls how projectile interacts with other blocks in relation to those defined here, NoSkip, Exclusive, Inclusive.
- Types = new[] // List of blocks to apply custom damage multipliers to.
- {
- new CustomBlocksDef
- {
- SubTypeId = "Test1",
- Modifier = -1f,
- },
- new CustomBlocksDef
- {
- SubTypeId = "Test2",
- Modifier = -1f,
- },
- },
- },
- },
- AreaOfDamage = new AreaOfDamageDef
- {
- ByBlockHit = new ByBlockHitDef
- {
- Enable = false,
- Radius = 5f, // Meters
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Pooled, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- EndOfLife = new EndOfLifeDef
- {
- Enable = false,
- Radius = 5f, // Radius of AOE effect, in meters.
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Squeeze, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- ArmOnlyOnHit = false, // Detonation only is available, After it hits something, when this is true. IE, if shot down, it won't explode.
- MinArmingTime = 100, // In ticks, before the Ammo is allowed to explode, detonate or similar; This affects shrapnel spawning.
- NoVisuals = false,
- NoSound = false,
- ParticleScale = 1,
- CustomParticle = "", // Particle SubtypeID, from your Particle SBC
- CustomSound = "", // SubtypeID from your Audio SBC, not a filename
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- },
- Ewar = new EwarDef
- {
- Enable = false, // Enables EWAR effects AND DISABLES BASE DAMAGE AND AOE DAMAGE!!
- Type = EnergySink, // EnergySink, Emp, Offense, Nav, Dot, AntiSmart, JumpNull, Anchor, Tractor, Pull, Push,
- Mode = Effect, // Effect , Field
- Strength = 100f,
- Radius = 5f, // Meters
- Duration = 100, // In Ticks
- StackDuration = true, // Combined Durations
- Depletable = true,
- MaxStacks = 10, // Max Debuffs at once
- NoHitParticle = false,
- /*
- EnergySink : Targets & Shutdowns Power Supplies, such as Batteries & Reactor
- Emp : Targets & Shutdown any Block capable of being powered
- Offense : Targets & Shutdowns Weaponry
- Nav : Targets & Shutdown Gyros or Locks them down
- Dot : Deals Damage to Blocks in radius
- AntiSmart : Effects & Scrambles the Targeting List of Affected Missiles
- JumpNull : Shutdown & Stops any Active Jumps, or JumpDrive Units in radius
- Tractor : Affects target with Physics
- Pull : Affects target with Physics
- Push : Affects target with Physics
- Anchor : Targets & Shutdowns Thrusters
-
- */
- Force = new PushPullDef
- {
- ForceFrom = ProjectileLastPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- ForceTo = HitPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- Position = TargetCenterOfMass, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- DisableRelativeMass = false,
- TractorRange = 0,
- ShooterFeelsForce = false,
- },
- Field = new FieldDef
- {
- Interval = 0, // Time between each pulse, in game ticks (60 == 1 second), starts at 0 (59 == tick 60).
- PulseChance = 0, // Chance from 0 - 100 that an entity in the field will be hit by any given pulse.
- GrowTime = 0, // How many ticks it should take the field to grow to full size.
- HideModel = false, // Hide the default bubble, or other model if specified.
- ShowParticle = true, // Show Block damage effect.
- TriggerRange = 250f, //range at which fields are triggered
- Particle = new ParticleDef // Particle effect to generate at the field's position.
- {
- Name = "", // SubtypeId of field particle effect.
- Extras = new ParticleOptionDef
- {
- Scale = 1, // Scale of effect.
- },
- },
- },
- },
- Beams = new BeamDef
- {
- Enable = false, // Enable beam behaviour. Please have 3600 RPM, when this Setting is enabled. Please do not fire Beams into Voxels.
- VirtualBeams = false, // Only one damaging beam, but with the effectiveness of the visual beams combined (better performance).
- ConvergeBeams = false, // When using virtual beams, converge the visual beams to the location of the real beam.
- RotateRealBeam = false, // The real beam is rotated between all visual beams, instead of centered between them.
- OneParticle = false, // Only spawn one particle hit per beam weapon.
},
Trajectory = new TrajectoryDef
{
Guidance = None, // None, Remote, TravelTo, Smart, DetectTravelTo, DetectSmart, DetectFixed
TargetLossDegree = 180f, // Degrees, Is pointed forward
- TargetLossTime = 0, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MaxLifeTime = 300, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). time begins at 0 and time must EXCEED this value to trigger "time > maxValue". Please have a value for this, It stops Bad things.
- AccelPerSec = 0f, // Meters Per Second. This is the spawning Speed of the Projectile, and used by turning.
DesiredSpeed = 400, // voxel phasing if you go above 5100
MaxTrajectory = 800f, // Max Distance the projectile or beam can Travel.
- DeaccelTime = 0, // 0 is disabled, a value causes the projectile to come to rest overtime, (Measured in game ticks, 60 = 1 second)
- GravityMultiplier = 0f, // Gravity multiplier, influences the trajectory of the projectile, value greater than 0 to enable. Natural Gravity Only.
SpeedVariance = Random(start: -5, end: 5), // subtracts value from DesiredSpeed. Be warned, you can make your projectile go backwards.
- RangeVariance = Random(start: 0, end: 0), // subtracts value from MaxTrajectory
- MaxTrajectoryTime = 0, // How long the weapon must fire before it reaches MaxTrajectory.
- Smarts = new SmartsDef
- {
- Inaccuracy = 0f, // 0 is perfect, hit accuracy will be a random num of meters between 0 and this value.
- Aggressiveness = 1f, // controls how responsive tracking is.
- MaxLateralThrust = 0.5, // controls how sharp the trajectile may turn
- TrackingDelay = 0, // Measured in Shape diameter units traveled.
- MaxChaseTime = 0, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- OverideTarget = true, // when set to true ammo picks its own target, does not use hardpoint's.
- MaxTargets = 0, // Number of targets allowed before ending, 0 = unlimited
- NoTargetExpire = false, // Expire without ever having a target at TargetLossTime
- Roam = false, // Roam current area after target loss
- KeepAliveAfterTargetLoss = false, // Whether to stop early death of projectile on target loss
- OffsetRatio = 0.05f, // The ratio to offset the random direction (0 to 1)
- OffsetTime = 60, // how often to offset degree, measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..)
- },
- Mines = new MinesDef // Note: This is being investigated. Please report to Github, any issues.
- {
- DetectRadius = 0,
- DeCloakRadius = 0,
- FieldTime = 0,
- Cloak = false,
- Persist = false,
- },
},
AmmoGraphics = new GraphicDef
{
@@ -336,15 +109,6 @@ partial class Parts
},
Particles = new AmmoParticleDef
{
- Ammo = new ParticleDef
- {
- Name = "", //ShipWelderArc
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- },
- },
Hit = new ParticleDef
{
Name = "MaterialHit_Metal_GatlingGun",
@@ -356,17 +120,6 @@ partial class Parts
HitPlayChance = 0.5f,
},
},
- Eject = new ParticleDef
- {
- Name = "",
- ApplyToShield = true,
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- HitPlayChance = 1f,
- },
- },
},
Lines = new LineDef
{
@@ -384,36 +137,6 @@ partial class Parts
"ProjectileTrailLine", // Please always have this Line set, if this Section is enabled.
},
TextureMode = Normal, // Normal, Cycle, Chaos, Wave
- Segmentation = new SegmentDef
- {
- Enable = false, // If true Tracer TextureMode is ignored
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- SegmentLength = 0f, // Uses the values below.
- SegmentGap = 0f, // Uses Tracer textures and values
- Speed = 1f, // meters per second
- Color = Color(red: 1, green: 2, blue: 2.5f, alpha: 1),
- WidthMultiplier = 1f,
- Reverse = false,
- UseLineVariance = true,
- WidthVariance = Random(start: 0f, end: 0f),
- ColorVariance = Random(start: 0f, end: 0f)
- }
- },
- Trail = new TrailDef
- {
- Enable = false,
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- TextureMode = Normal,
- DecayTime = 3, // In Ticks. 1 = 1 Additional Tracer generated per motion, 33 is 33 lines drawn per projectile. Keep this number low.
- Color = Color(red: 0, green: 0, blue: 1, alpha: 1),
- Back = false,
- CustomWidth = 0,
- UseWidthVariance = false,
- UseColorFade = true,
},
OffsetEffect = new OffsetEffectDef
{
@@ -425,110 +148,27 @@ partial class Parts
},
AmmoAudio = new AmmoAudioDef
{
- TravelSound = "", // SubtypeID for your Sound File. Travel, is sound generated around your Projectile in flight
HitSound = "ImpMetalMetalCat0",
- ShotSound = "",
- ShieldHitSound = "",
- PlayerHitSound = "",
VoxelHitSound = "ImpMetalRockCat0",
- FloatingHitSound = "",
HitPlayChance = 0.5f,
HitPlayShield = true,
},
- Ejection = new EjectionDef // Optional Component, allows generation of Particle or Item (Typically magazine), on firing, to simulate Tank shell ejection
- {
- Type = Particle, // Particle or Item (Inventory Component)
- Speed = 100f, // Speed inventory is ejected from in dummy direction
- SpawnChance = 0.5f, // chance of triggering effect (0 - 1)
- CompDef = new ComponentDef
- {
- ItemName = "", //InventoryComponent name
- ItemLifeTime = 0, // how long item should exist in world
- Delay = 0, // delay in ticks after shot before ejected
- }
- }, // Don't edit below this line
};
private AmmoDef InteriorAmmo => new AmmoDef // Your ID, for slotting into the Weapon CS
{
AmmoMagazine = "RapidFireAutomaticRifleGun_Mag_50rd", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo.
AmmoRound = "MR-50A", // Name of ammo in terminal, should be different for each ammo type used by the same weapon. Is used by Shrapnel.
- HybridRound = false, // Use both a physical ammo magazine and energy per shot.
EnergyCost = 0.1f, // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR.
BaseDamage = 30f, // Direct damage; one steel plate is worth 100.
Mass = 0.1f, // In kilograms; how much force the impact will apply to the target.
- Health = 0, // How much damage the projectile can take from other projectiles (base of 1 per hit) before dying; 0 disables this and makes the projectile untargetable.
BackKickForce = 1f, // Recoil. This is applied to the Parent Grid.
- DecayPerShot = 0f, // Damage to the firing weapon itself.
HardPointUsable = true, // Whether this is a primary ammo type fired directly by the turret. Set to false if this is a shrapnel ammoType and you don't want the turret to be able to select it directly.
- EnergyMagazineSize = 0, // For energy weapons, how many shots to fire before reloading.
- IgnoreWater = false, // Whether the projectile should be able to penetrate water when using WaterMod.
- IgnoreVoxels = false, // Whether the projectile should be able to penetrate voxels.
- Synchronize = false, // For future use
- HeatModifier = -1f, // Allows this ammo to modify the amount of heat the weapon produces per shot.
- Shape = new ShapeDef // Defines the collision shape of the projectile, defaults to LineShape and uses the visual Line Length if set to 0.
- {
- Shape = LineShape, // LineShape or SphereShape. Do not use SphereShape for fast moving projectiles if you care about precision.
- Diameter = 0, // Diameter is minimum length of LineShape or minimum diameter of SphereShape.
- },
- ObjectsHit = new ObjectsHitDef
- {
- MaxObjectsHit = 0, // Limits the number of entities (grids, players, projectiles) the projectile can penetrate; 0 = unlimited.
- CountBlocks = false, // Counts individual blocks, not just entities hit.
- },
- Fragment = new FragmentDef // Formerly known as Shrapnel. Spawns specified ammo fragments on projectile death (via hit or detonation).
- {
- AmmoRound = "", // AmmoRound field of the ammo to spawn.
- Fragments = 0, // Number of projectiles to spawn.
- Degrees = 0, // Cone in which to randomize direction of spawned projectiles.
- Reverse = false, // Spawn projectiles backward instead of forward.
- DropVelocity = false, // fragments will not inherit velocity from parent.
- Offset = 0f, // Offsets the fragment spawn by this amount, in meters (positive forward, negative for backwards), value is read from parent ammo type.
- Radial = 0f, // Determines starting angle for Degrees of spread above. IE, 0 degrees and 90 radial goes perpendicular to travel path
- MaxChildren = 0, // number of maximum branches for fragments from the roots point of view, 0 is unlimited
- IgnoreArming = true, // If true, ignore ArmOnHit or MinArmingTime in EndOfLife definitions
- AdvOffset = Vector(x: 0, y: 0, z: 0), // advanced offsets the fragment by xyz coordinates relative to parent, value is read from fragment ammo type.
- TimedSpawns = new TimedSpawnDef // disables FragOnEnd in favor of info specified below
- {
- Enable = false, // Enables TimedSpawns mechanism
- Interval = 0, // Time between spawning fragments, in ticks, 0 means every tick, 1 means every other
- StartTime = 0, // Time delay to start spawning fragments, in ticks, of total projectile life
- MaxSpawns = 1, // Max number of fragment children to spawn
- Proximity = 1000, // Starting distance from target bounding sphere to start spawning fragments, 0 disables this feature. No spawning outside this distance
- ParentDies = true, // Parent dies once after it spawns its last child.
- PointAtTarget = true, // Start fragment direction pointing at Target
- PointType = Predict, // Point accuracy, Direct, Lead (always fire), Predict (only fire if it can hit)
- GroupSize = 5, // Number of spawns in each group
- GroupDelay = 120, // Delay between each group.
- },
- },
- Pattern = new PatternDef
- {
- Patterns = new[] { // If enabled, set of multiple ammos to fire in order instead of the main ammo.
- "",
- },
- Mode = Fragment, // Select when to activate this pattern, options: Never, Weapon, Fragment, Both
- TriggerChance = 1f, // This is %
- Random = false, // This randomizes the number spawned at once, NOT the list order.
- RandomMin = 1,
- RandomMax = 1,
- SkipParent = false, // Skip the Ammo itself, in the list
- PatternSteps = 1, // Number of Ammos activated per round, will progress in order and loop. Ignored if Random = true.
- },
DamageScales = new DamageScaleDef
{
- MaxIntegrity = 0f, // Blocks with integrity higher than this value will be immune to damage from this projectile; 0 = disabled.
- DamageVoxels = false, // Whether to damage voxels.
- SelfDamage = false, // Whether to damage the weapon's own grid.
HealthHitModifier = 0.5, // How much Health to subtract from another projectile on hit; defaults to 1 if zero or less.
VoxelHitModifier = 1, // Voxel damage multiplier; defaults to 1 if zero or less.
Characters = -1f, // Character damage multiplier; defaults to 1 if zero or less.
- // For the following modifier values: -1 = disabled (higher performance), 0 = no damage, 0.01f = 1% damage, 2 = 200% damage.
- FallOff = new FallOffDef
- {
- Distance = 0f, // Distance at which damage begins falling off.
- MinMultipler = 1f, // Value from 0.0001f to 1f where 0.1f would be a min damage of 10% of base damage.
- },
Grids = new GridSizeDef
{
Large = -1f, // Multiplier for damage against large grids.
@@ -559,168 +199,15 @@ partial class Parts
DeformType = HitBlock,
DeformDelay = 30,
},
- Custom = new CustomScalesDef
- {
- SkipOthers = NoSkip, // Controls how projectile interacts with other blocks in relation to those defined here, NoSkip, Exclusive, Inclusive.
- Types = new[] // List of blocks to apply custom damage multipliers to.
- {
- new CustomBlocksDef
- {
- SubTypeId = "Test1",
- Modifier = -1f,
- },
- new CustomBlocksDef
- {
- SubTypeId = "Test2",
- Modifier = -1f,
- },
- },
- },
- },
- AreaOfDamage = new AreaOfDamageDef
- {
- ByBlockHit = new ByBlockHitDef
- {
- Enable = false,
- Radius = 5f, // Meters
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Pooled, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- EndOfLife = new EndOfLifeDef
- {
- Enable = false,
- Radius = 5f, // Radius of AOE effect, in meters.
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Squeeze, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- ArmOnlyOnHit = false, // Detonation only is available, After it hits something, when this is true. IE, if shot down, it won't explode.
- MinArmingTime = 100, // In ticks, before the Ammo is allowed to explode, detonate or similar; This affects shrapnel spawning.
- NoVisuals = false,
- NoSound = false,
- ParticleScale = 1,
- CustomParticle = "", // Particle SubtypeID, from your Particle SBC
- CustomSound = "", // SubtypeID from your Audio SBC, not a filename
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- },
- Ewar = new EwarDef
- {
- Enable = false, // Enables EWAR effects AND DISABLES BASE DAMAGE AND AOE DAMAGE!!
- Type = EnergySink, // EnergySink, Emp, Offense, Nav, Dot, AntiSmart, JumpNull, Anchor, Tractor, Pull, Push,
- Mode = Effect, // Effect , Field
- Strength = 100f,
- Radius = 5f, // Meters
- Duration = 100, // In Ticks
- StackDuration = true, // Combined Durations
- Depletable = true,
- MaxStacks = 10, // Max Debuffs at once
- NoHitParticle = false,
- /*
- EnergySink : Targets & Shutdowns Power Supplies, such as Batteries & Reactor
- Emp : Targets & Shutdown any Block capable of being powered
- Offense : Targets & Shutdowns Weaponry
- Nav : Targets & Shutdown Gyros or Locks them down
- Dot : Deals Damage to Blocks in radius
- AntiSmart : Effects & Scrambles the Targeting List of Affected Missiles
- JumpNull : Shutdown & Stops any Active Jumps, or JumpDrive Units in radius
- Tractor : Affects target with Physics
- Pull : Affects target with Physics
- Push : Affects target with Physics
- Anchor : Targets & Shutdowns Thrusters
-
- */
- Force = new PushPullDef
- {
- ForceFrom = ProjectileLastPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- ForceTo = HitPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- Position = TargetCenterOfMass, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- DisableRelativeMass = false,
- TractorRange = 0,
- ShooterFeelsForce = false,
- },
- Field = new FieldDef
- {
- Interval = 0, // Time between each pulse, in game ticks (60 == 1 second), starts at 0 (59 == tick 60).
- PulseChance = 0, // Chance from 0 - 100 that an entity in the field will be hit by any given pulse.
- GrowTime = 0, // How many ticks it should take the field to grow to full size.
- HideModel = false, // Hide the default bubble, or other model if specified.
- ShowParticle = true, // Show Block damage effect.
- TriggerRange = 250f, //range at which fields are triggered
- Particle = new ParticleDef // Particle effect to generate at the field's position.
- {
- Name = "", // SubtypeId of field particle effect.
- Extras = new ParticleOptionDef
- {
- Scale = 1, // Scale of effect.
- },
- },
- },
- },
- Beams = new BeamDef
- {
- Enable = false, // Enable beam behaviour. Please have 3600 RPM, when this Setting is enabled. Please do not fire Beams into Voxels.
- VirtualBeams = false, // Only one damaging beam, but with the effectiveness of the visual beams combined (better performance).
- ConvergeBeams = false, // When using virtual beams, converge the visual beams to the location of the real beam.
- RotateRealBeam = false, // The real beam is rotated between all visual beams, instead of centered between them.
- OneParticle = false, // Only spawn one particle hit per beam weapon.
},
Trajectory = new TrajectoryDef
{
- Guidance = None, // None, Remote, TravelTo, Smart, DetectTravelTo, DetectSmart, DetectFixed
- TargetLossDegree = 180f, // Degrees, Is pointed forward
- TargetLossTime = 0, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MaxLifeTime = 100, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). time begins at 0 and time must EXCEED this value to trigger "time > maxValue". Please have a value for this, It stops Bad things.
- AccelPerSec = 0f, // Meters Per Second. This is the spawning Speed of the Projectile, and used by turning.
DesiredSpeed = 600, // voxel phasing if you go above 5100
MaxTrajectory = 400f, // Max Distance the projectile or beam can Travel.
- DeaccelTime = 0, // 0 is disabled, a value causes the projectile to come to rest overtime, (Measured in game ticks, 60 = 1 second)
- GravityMultiplier = 0f, // Gravity multiplier, influences the trajectory of the projectile, value greater than 0 to enable. Natural Gravity Only.
- SpeedVariance = Random(start: 0, end: 0), // subtracts value from DesiredSpeed. Be warned, you can make your projectile go backwards.
- RangeVariance = Random(start: 0, end: 0), // subtracts value from MaxTrajectory
- MaxTrajectoryTime = 0, // How long the weapon must fire before it reaches MaxTrajectory.
- Smarts = new SmartsDef
- {
- Inaccuracy = 0f, // 0 is perfect, hit accuracy will be a random num of meters between 0 and this value.
- Aggressiveness = 1f, // controls how responsive tracking is.
- MaxLateralThrust = 0.5, // controls how sharp the trajectile may turn
- TrackingDelay = 0, // Measured in Shape diameter units traveled.
- MaxChaseTime = 0, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- OverideTarget = true, // when set to true ammo picks its own target, does not use hardpoint's.
- MaxTargets = 0, // Number of targets allowed before ending, 0 = unlimited
- NoTargetExpire = false, // Expire without ever having a target at TargetLossTime
- Roam = false, // Roam current area after target loss
- KeepAliveAfterTargetLoss = false, // Whether to stop early death of projectile on target loss
- OffsetRatio = 0.05f, // The ratio to offset the random direction (0 to 1)
- OffsetTime = 60, // how often to offset degree, measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..)
- },
- Mines = new MinesDef // Note: This is being investigated. Please report to Github, any issues.
- {
- DetectRadius = 0,
- DeCloakRadius = 0,
- FieldTime = 0,
- Cloak = false,
- Persist = false,
- },
},
AmmoGraphics = new GraphicDef
{
- ModelName = "", // Model Path goes here. "\\Models\\Ammo\\Starcore_Arrow_Missile_Large"
VisualProbability = 1f, // %
ShieldHitDraw = false,
Decals = new DecalDef
@@ -742,15 +229,6 @@ partial class Parts
},
Particles = new AmmoParticleDef
{
- Ammo = new ParticleDef
- {
- Name = "", //ShipWelderArc
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- },
- },
Hit = new ParticleDef
{
Name = "MaterialHit_Metal",
@@ -762,17 +240,6 @@ partial class Parts
HitPlayChance = 0.5f,
},
},
- Eject = new ParticleDef
- {
- Name = "",
- ApplyToShield = true,
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- HitPlayChance = 1f,
- },
- },
},
Lines = new LineDef
{
@@ -790,36 +257,6 @@ partial class Parts
"ProjectileTrailLine", // Please always have this Line set, if this Section is enabled.
},
TextureMode = Normal, // Normal, Cycle, Chaos, Wave
- Segmentation = new SegmentDef
- {
- Enable = false, // If true Tracer TextureMode is ignored
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- SegmentLength = 0f, // Uses the values below.
- SegmentGap = 0f, // Uses Tracer textures and values
- Speed = 1f, // meters per second
- Color = Color(red: 1, green: 2, blue: 2.5f, alpha: 1),
- WidthMultiplier = 1f,
- Reverse = false,
- UseLineVariance = true,
- WidthVariance = Random(start: 0f, end: 0f),
- ColorVariance = Random(start: 0f, end: 0f)
- }
- },
- Trail = new TrailDef
- {
- Enable = false,
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- TextureMode = Normal,
- DecayTime = 3, // In Ticks. 1 = 1 Additional Tracer generated per motion, 33 is 33 lines drawn per projectile. Keep this number low.
- Color = Color(red: 0, green: 0, blue: 1, alpha: 1),
- Back = false,
- CustomWidth = 0,
- UseWidthVariance = false,
- UseColorFade = true,
},
OffsetEffect = new OffsetEffectDef
{
@@ -831,96 +268,21 @@ partial class Parts
},
AmmoAudio = new AmmoAudioDef
{
- TravelSound = "", // SubtypeID for your Sound File. Travel, is sound generated around your Projectile in flight
HitSound = "ImpMetalMetalCat0",
- ShotSound = "",
- ShieldHitSound = "",
- PlayerHitSound = "",
VoxelHitSound = "ImpMetalRockCat0",
- FloatingHitSound = "",
HitPlayChance = 0.5f,
HitPlayShield = true,
},
- Ejection = new EjectionDef // Optional Component, allows generation of Particle or Item (Typically magazine), on firing, to simulate Tank shell ejection
- {
- Type = Particle, // Particle or Item (Inventory Component)
- Speed = 100f, // Speed inventory is ejected from in dummy direction
- SpawnChance = 0.5f, // chance of triggering effect (0 - 1)
- CompDef = new ComponentDef
- {
- ItemName = "", //InventoryComponent name
- ItemLifeTime = 0, // how long item should exist in world
- Delay = 0, // delay in ticks after shot before ejected
- }
- }, // Don't edit below this line
};
private AmmoDef InteriorAmmoOld => new AmmoDef // Your ID, for slotting into the Weapon CS
{
AmmoMagazine = "NATO_5p56x45mm", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo.
AmmoRound = "5.56x45mm", // Name of ammo in terminal, should be different for each ammo type used by the same weapon. Is used by Shrapnel.
- HybridRound = false, // Use both a physical ammo magazine and energy per shot.
- EnergyCost = 0.1f, // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR.
BaseDamage = 30f, // Direct damage; one steel plate is worth 100.
Mass = 0.1f, // In kilograms; how much force the impact will apply to the target.
- Health = 0, // How much damage the projectile can take from other projectiles (base of 1 per hit) before dying; 0 disables this and makes the projectile untargetable.
BackKickForce = 1f, // Recoil. This is applied to the Parent Grid.
- DecayPerShot = 0f, // Damage to the firing weapon itself.
HardPointUsable = true, // Whether this is a primary ammo type fired directly by the turret. Set to false if this is a shrapnel ammoType and you don't want the turret to be able to select it directly.
- EnergyMagazineSize = 0, // For energy weapons, how many shots to fire before reloading.
- IgnoreWater = false, // Whether the projectile should be able to penetrate water when using WaterMod.
- IgnoreVoxels = false, // Whether the projectile should be able to penetrate voxels.
- Synchronize = false, // For future use
- HeatModifier = -1f, // Allows this ammo to modify the amount of heat the weapon produces per shot.
- Shape = new ShapeDef // Defines the collision shape of the projectile, defaults to LineShape and uses the visual Line Length if set to 0.
- {
- Shape = LineShape, // LineShape or SphereShape. Do not use SphereShape for fast moving projectiles if you care about precision.
- Diameter = 0, // Diameter is minimum length of LineShape or minimum diameter of SphereShape.
- },
- ObjectsHit = new ObjectsHitDef
- {
- MaxObjectsHit = 0, // Limits the number of entities (grids, players, projectiles) the projectile can penetrate; 0 = unlimited.
- CountBlocks = false, // Counts individual blocks, not just entities hit.
- },
- Fragment = new FragmentDef // Formerly known as Shrapnel. Spawns specified ammo fragments on projectile death (via hit or detonation).
- {
- AmmoRound = "", // AmmoRound field of the ammo to spawn.
- Fragments = 0, // Number of projectiles to spawn.
- Degrees = 0, // Cone in which to randomize direction of spawned projectiles.
- Reverse = false, // Spawn projectiles backward instead of forward.
- DropVelocity = false, // fragments will not inherit velocity from parent.
- Offset = 0f, // Offsets the fragment spawn by this amount, in meters (positive forward, negative for backwards), value is read from parent ammo type.
- Radial = 0f, // Determines starting angle for Degrees of spread above. IE, 0 degrees and 90 radial goes perpendicular to travel path
- MaxChildren = 0, // number of maximum branches for fragments from the roots point of view, 0 is unlimited
- IgnoreArming = true, // If true, ignore ArmOnHit or MinArmingTime in EndOfLife definitions
- AdvOffset = Vector(x: 0, y: 0, z: 0), // advanced offsets the fragment by xyz coordinates relative to parent, value is read from fragment ammo type.
- TimedSpawns = new TimedSpawnDef // disables FragOnEnd in favor of info specified below
- {
- Enable = false, // Enables TimedSpawns mechanism
- Interval = 0, // Time between spawning fragments, in ticks, 0 means every tick, 1 means every other
- StartTime = 0, // Time delay to start spawning fragments, in ticks, of total projectile life
- MaxSpawns = 1, // Max number of fragment children to spawn
- Proximity = 1000, // Starting distance from target bounding sphere to start spawning fragments, 0 disables this feature. No spawning outside this distance
- ParentDies = true, // Parent dies once after it spawns its last child.
- PointAtTarget = true, // Start fragment direction pointing at Target
- PointType = Predict, // Point accuracy, Direct, Lead (always fire), Predict (only fire if it can hit)
- GroupSize = 5, // Number of spawns in each group
- GroupDelay = 120, // Delay between each group.
- },
- },
- Pattern = new PatternDef
- {
- Patterns = new[] { // If enabled, set of multiple ammos to fire in order instead of the main ammo.
- "",
- },
- Mode = Fragment, // Select when to activate this pattern, options: Never, Weapon, Fragment, Both
- TriggerChance = 1f, // This is %
- Random = false, // This randomizes the number spawned at once, NOT the list order.
- RandomMin = 1,
- RandomMax = 1,
- SkipParent = false, // Skip the Ammo itself, in the list
- PatternSteps = 1, // Number of Ammos activated per round, will progress in order and loop. Ignored if Random = true.
- },
DamageScales = new DamageScaleDef
{
MaxIntegrity = 0f, // Blocks with integrity higher than this value will be immune to damage from this projectile; 0 = disabled.
@@ -929,12 +291,6 @@ partial class Parts
HealthHitModifier = 0.5, // How much Health to subtract from another projectile on hit; defaults to 1 if zero or less.
VoxelHitModifier = 1, // Voxel damage multiplier; defaults to 1 if zero or less.
Characters = -1f, // Character damage multiplier; defaults to 1 if zero or less.
- // For the following modifier values: -1 = disabled (higher performance), 0 = no damage, 0.01f = 1% damage, 2 = 200% damage.
- FallOff = new FallOffDef
- {
- Distance = 0f, // Distance at which damage begins falling off.
- MinMultipler = 1f, // Value from 0.0001f to 1f where 0.1f would be a min damage of 10% of base damage.
- },
Grids = new GridSizeDef
{
Large = -1f, // Multiplier for damage against large grids.
@@ -965,181 +321,27 @@ partial class Parts
DeformType = HitBlock,
DeformDelay = 30,
},
- Custom = new CustomScalesDef
+ },
+ Trajectory = new TrajectoryDef
+ {
+ MaxLifeTime = 100, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). time begins at 0 and time must EXCEED this value to trigger "time > maxValue". Please have a value for this, It stops Bad things.
+ DesiredSpeed = 600, // voxel phasing if you go above 5100
+ MaxTrajectory = 400f, // Max Distance the projectile or beam can Travel.
+ },
+ AmmoGraphics = new GraphicDef
+ {
+ VisualProbability = 1f, // %
+ Decals = new DecalDef
{
- SkipOthers = NoSkip, // Controls how projectile interacts with other blocks in relation to those defined here, NoSkip, Exclusive, Inclusive.
- Types = new[] // List of blocks to apply custom damage multipliers to.
+ MaxAge = 3600,
+ Map = new[]
{
- new CustomBlocksDef
+ new TextureMapDef
{
- SubTypeId = "Test1",
- Modifier = -1f,
+ HitMaterial = "Metal",
+ DecalMaterial = "GunBullet",
},
- new CustomBlocksDef
- {
- SubTypeId = "Test2",
- Modifier = -1f,
- },
- },
- },
- },
- AreaOfDamage = new AreaOfDamageDef
- {
- ByBlockHit = new ByBlockHitDef
- {
- Enable = false,
- Radius = 5f, // Meters
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Pooled, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- EndOfLife = new EndOfLifeDef
- {
- Enable = false,
- Radius = 5f, // Radius of AOE effect, in meters.
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Squeeze, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- ArmOnlyOnHit = false, // Detonation only is available, After it hits something, when this is true. IE, if shot down, it won't explode.
- MinArmingTime = 100, // In ticks, before the Ammo is allowed to explode, detonate or similar; This affects shrapnel spawning.
- NoVisuals = false,
- NoSound = false,
- ParticleScale = 1,
- CustomParticle = "", // Particle SubtypeID, from your Particle SBC
- CustomSound = "", // SubtypeID from your Audio SBC, not a filename
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- },
- Ewar = new EwarDef
- {
- Enable = false, // Enables EWAR effects AND DISABLES BASE DAMAGE AND AOE DAMAGE!!
- Type = EnergySink, // EnergySink, Emp, Offense, Nav, Dot, AntiSmart, JumpNull, Anchor, Tractor, Pull, Push,
- Mode = Effect, // Effect , Field
- Strength = 100f,
- Radius = 5f, // Meters
- Duration = 100, // In Ticks
- StackDuration = true, // Combined Durations
- Depletable = true,
- MaxStacks = 10, // Max Debuffs at once
- NoHitParticle = false,
- /*
- EnergySink : Targets & Shutdowns Power Supplies, such as Batteries & Reactor
- Emp : Targets & Shutdown any Block capable of being powered
- Offense : Targets & Shutdowns Weaponry
- Nav : Targets & Shutdown Gyros or Locks them down
- Dot : Deals Damage to Blocks in radius
- AntiSmart : Effects & Scrambles the Targeting List of Affected Missiles
- JumpNull : Shutdown & Stops any Active Jumps, or JumpDrive Units in radius
- Tractor : Affects target with Physics
- Pull : Affects target with Physics
- Push : Affects target with Physics
- Anchor : Targets & Shutdowns Thrusters
-
- */
- Force = new PushPullDef
- {
- ForceFrom = ProjectileLastPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- ForceTo = HitPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- Position = TargetCenterOfMass, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- DisableRelativeMass = false,
- TractorRange = 0,
- ShooterFeelsForce = false,
- },
- Field = new FieldDef
- {
- Interval = 0, // Time between each pulse, in game ticks (60 == 1 second), starts at 0 (59 == tick 60).
- PulseChance = 0, // Chance from 0 - 100 that an entity in the field will be hit by any given pulse.
- GrowTime = 0, // How many ticks it should take the field to grow to full size.
- HideModel = false, // Hide the default bubble, or other model if specified.
- ShowParticle = true, // Show Block damage effect.
- TriggerRange = 250f, //range at which fields are triggered
- Particle = new ParticleDef // Particle effect to generate at the field's position.
- {
- Name = "", // SubtypeId of field particle effect.
- Extras = new ParticleOptionDef
- {
- Scale = 1, // Scale of effect.
- },
- },
- },
- },
- Beams = new BeamDef
- {
- Enable = false, // Enable beam behaviour. Please have 3600 RPM, when this Setting is enabled. Please do not fire Beams into Voxels.
- VirtualBeams = false, // Only one damaging beam, but with the effectiveness of the visual beams combined (better performance).
- ConvergeBeams = false, // When using virtual beams, converge the visual beams to the location of the real beam.
- RotateRealBeam = false, // The real beam is rotated between all visual beams, instead of centered between them.
- OneParticle = false, // Only spawn one particle hit per beam weapon.
- },
- Trajectory = new TrajectoryDef
- {
- Guidance = None, // None, Remote, TravelTo, Smart, DetectTravelTo, DetectSmart, DetectFixed
- TargetLossDegree = 180f, // Degrees, Is pointed forward
- TargetLossTime = 0, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- MaxLifeTime = 100, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). time begins at 0 and time must EXCEED this value to trigger "time > maxValue". Please have a value for this, It stops Bad things.
- AccelPerSec = 0f, // Meters Per Second. This is the spawning Speed of the Projectile, and used by turning.
- DesiredSpeed = 600, // voxel phasing if you go above 5100
- MaxTrajectory = 400f, // Max Distance the projectile or beam can Travel.
- DeaccelTime = 0, // 0 is disabled, a value causes the projectile to come to rest overtime, (Measured in game ticks, 60 = 1 second)
- GravityMultiplier = 0f, // Gravity multiplier, influences the trajectory of the projectile, value greater than 0 to enable. Natural Gravity Only.
- SpeedVariance = Random(start: 0, end: 0), // subtracts value from DesiredSpeed. Be warned, you can make your projectile go backwards.
- RangeVariance = Random(start: 0, end: 0), // subtracts value from MaxTrajectory
- MaxTrajectoryTime = 0, // How long the weapon must fire before it reaches MaxTrajectory.
- Smarts = new SmartsDef
- {
- Inaccuracy = 0.5f, // 0 is perfect, hit accuracy will be a random num of meters between 0 and this value.
- Aggressiveness = 1f, // controls how responsive tracking is.
- MaxLateralThrust = 0.5, // controls how sharp the trajectile may turn
- TrackingDelay = 0, // Measured in Shape diameter units traveled.
- MaxChaseTime = 0, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- OverideTarget = true, // when set to true ammo picks its own target, does not use hardpoint's.
- MaxTargets = 0, // Number of targets allowed before ending, 0 = unlimited
- NoTargetExpire = false, // Expire without ever having a target at TargetLossTime
- Roam = false, // Roam current area after target loss
- KeepAliveAfterTargetLoss = false, // Whether to stop early death of projectile on target loss
- OffsetRatio = 0.05f, // The ratio to offset the random direction (0 to 1)
- OffsetTime = 60, // how often to offset degree, measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..)
- },
- Mines = new MinesDef // Note: This is being investigated. Please report to Github, any issues.
- {
- DetectRadius = 0,
- DeCloakRadius = 0,
- FieldTime = 0,
- Cloak = false,
- Persist = false,
- },
- },
- AmmoGraphics = new GraphicDef
- {
- ModelName = "", // Model Path goes here. "\\Models\\Ammo\\Starcore_Arrow_Missile_Large"
- VisualProbability = 1f, // %
- ShieldHitDraw = false,
- Decals = new DecalDef
- {
- MaxAge = 3600,
- Map = new[]
- {
- new TextureMapDef
- {
- HitMaterial = "Metal",
- DecalMaterial = "GunBullet",
- },
- new TextureMapDef
+ new TextureMapDef
{
HitMaterial = "Glass",
DecalMaterial = "GunBullet",
@@ -1148,15 +350,6 @@ partial class Parts
},
Particles = new AmmoParticleDef
{
- Ammo = new ParticleDef
- {
- Name = "", //ShipWelderArc
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- },
- },
Hit = new ParticleDef
{
Name = "MaterialHit_Metal",
@@ -1168,17 +361,6 @@ partial class Parts
HitPlayChance = 0.5f,
},
},
- Eject = new ParticleDef
- {
- Name = "",
- ApplyToShield = true,
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- HitPlayChance = 1f,
- },
- },
},
Lines = new LineDef
{
@@ -1196,36 +378,6 @@ partial class Parts
"ProjectileTrailLine", // Please always have this Line set, if this Section is enabled.
},
TextureMode = Normal, // Normal, Cycle, Chaos, Wave
- Segmentation = new SegmentDef
- {
- Enable = false, // If true Tracer TextureMode is ignored
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- SegmentLength = 0f, // Uses the values below.
- SegmentGap = 0f, // Uses Tracer textures and values
- Speed = 1f, // meters per second
- Color = Color(red: 1, green: 2, blue: 2.5f, alpha: 1),
- WidthMultiplier = 1f,
- Reverse = false,
- UseLineVariance = true,
- WidthVariance = Random(start: 0f, end: 0f),
- ColorVariance = Random(start: 0f, end: 0f)
- }
- },
- Trail = new TrailDef
- {
- Enable = false,
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- TextureMode = Normal,
- DecayTime = 3, // In Ticks. 1 = 1 Additional Tracer generated per motion, 33 is 33 lines drawn per projectile. Keep this number low.
- Color = Color(red: 0, green: 0, blue: 1, alpha: 1),
- Back = false,
- CustomWidth = 0,
- UseWidthVariance = false,
- UseColorFade = true,
},
OffsetEffect = new OffsetEffectDef
{
@@ -1237,28 +389,11 @@ partial class Parts
},
AmmoAudio = new AmmoAudioDef
{
- TravelSound = "", // SubtypeID for your Sound File. Travel, is sound generated around your Projectile in flight
HitSound = "ImpMetalMetalCat0",
- ShotSound = "",
- ShieldHitSound = "",
- PlayerHitSound = "",
VoxelHitSound = "ImpMetalRockCat0",
- FloatingHitSound = "",
HitPlayChance = 0.5f,
HitPlayShield = true,
},
- Ejection = new EjectionDef // Optional Component, allows generation of Particle or Item (Typically magazine), on firing, to simulate Tank shell ejection
- {
- Type = Particle, // Particle or Item (Inventory Component)
- Speed = 100f, // Speed inventory is ejected from in dummy direction
- SpawnChance = 0.5f, // chance of triggering effect (0 - 1)
- CompDef = new ComponentDef
- {
- ItemName = "", //InventoryComponent name
- ItemLifeTime = 0, // how long item should exist in world
- Delay = 0, // delay in ticks after shot before ejected
- }
- }, // Don't edit below this line
};
private AmmoDef MissileAmmo => new AmmoDef // Your ID, for slotting into the Weapon CS
@@ -1266,67 +401,15 @@ partial class Parts
AmmoMagazine = "Missile200mm", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo.
AmmoRound = "200mm Missile", // Name of ammo in terminal, should be different for each ammo type used by the same weapon. Is used by Shrapnel.
HybridRound = false, // Use both a physical ammo magazine and energy per shot.
- EnergyCost = 0.1f, // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR.
BaseDamage = 1f, // Direct damage; one steel plate is worth 100.
Mass = 45f, // In kilograms; how much force the impact will apply to the target.
Health = 2, // How much damage the projectile can take from other projectiles (base of 1 per hit) before dying; 0 disables this and makes the projectile untargetable.
- BackKickForce = 0f, // Recoil. This is applied to the Parent Grid.
- DecayPerShot = 0f, // Damage to the firing weapon itself.
HardPointUsable = true, // Whether this is a primary ammo type fired directly by the turret. Set to false if this is a shrapnel ammoType and you don't want the turret to be able to select it directly.
- EnergyMagazineSize = 0, // For energy weapons, how many shots to fire before reloading.
- IgnoreWater = false, // Whether the projectile should be able to penetrate water when using WaterMod.
- IgnoreVoxels = false, // Whether the projectile should be able to penetrate voxels.
- Synchronize = false, // For future use
- HeatModifier = -1f, // Allows this ammo to modify the amount of heat the weapon produces per shot.
Shape = new ShapeDef // Defines the collision shape of the projectile, defaults to LineShape and uses the visual Line Length if set to 0.
{
Shape = LineShape, // LineShape or SphereShape. Do not use SphereShape for fast moving projectiles if you care about precision.
Diameter = 1, // Diameter is minimum length of LineShape or minimum diameter of SphereShape.
},
- ObjectsHit = new ObjectsHitDef
- {
- MaxObjectsHit = 0, // Limits the number of entities (grids, players, projectiles) the projectile can penetrate; 0 = unlimited.
- CountBlocks = false, // Counts individual blocks, not just entities hit.
- },
- Fragment = new FragmentDef // Formerly known as Shrapnel. Spawns specified ammo fragments on projectile death (via hit or detonation).
- {
- AmmoRound = "", // AmmoRound field of the ammo to spawn.
- Fragments = 0, // Number of projectiles to spawn.
- Degrees = 0, // Cone in which to randomize direction of spawned projectiles.
- Reverse = false, // Spawn projectiles backward instead of forward.
- DropVelocity = false, // fragments will not inherit velocity from parent.
- Offset = 0f, // Offsets the fragment spawn by this amount, in meters (positive forward, negative for backwards), value is read from parent ammo type.
- Radial = 0f, // Determines starting angle for Degrees of spread above. IE, 0 degrees and 90 radial goes perpendicular to travel path
- MaxChildren = 0, // number of maximum branches for fragments from the roots point of view, 0 is unlimited
- IgnoreArming = true, // If true, ignore ArmOnHit or MinArmingTime in EndOfLife definitions
- AdvOffset = Vector(x: 0, y: 0, z: 0), // advanced offsets the fragment by xyz coordinates relative to parent, value is read from fragment ammo type.
- TimedSpawns = new TimedSpawnDef // disables FragOnEnd in favor of info specified below
- {
- Enable = false, // Enables TimedSpawns mechanism
- Interval = 0, // Time between spawning fragments, in ticks, 0 means every tick, 1 means every other
- StartTime = 0, // Time delay to start spawning fragments, in ticks, of total projectile life
- MaxSpawns = 1, // Max number of fragment children to spawn
- Proximity = 1000, // Starting distance from target bounding sphere to start spawning fragments, 0 disables this feature. No spawning outside this distance
- ParentDies = true, // Parent dies once after it spawns its last child.
- PointAtTarget = true, // Start fragment direction pointing at Target
- PointType = Predict, // Point accuracy, Direct, Lead (always fire), Predict (only fire if it can hit)
- GroupSize = 5, // Number of spawns in each group
- GroupDelay = 120, // Delay between each group.
- },
- },
- Pattern = new PatternDef
- {
- Patterns = new[] { // If enabled, set of multiple ammos to fire in order instead of the main ammo.
- "",
- },
- Mode = Fragment, // Select when to activate this pattern, options: Never, Weapon, Fragment, Both
- TriggerChance = 1f, // This is %
- Random = false, // This randomizes the number spawned at once, NOT the list order.
- RandomMin = 1,
- RandomMax = 1,
- SkipParent = false, // Skip the Ammo itself, in the list
- PatternSteps = 1, // Number of Ammos activated per round, will progress in order and loop. Ignored if Random = true.
- },
DamageScales = new DamageScaleDef
{
MaxIntegrity = 0f, // Blocks with integrity higher than this value will be immune to damage from this projectile; 0 = disabled.
@@ -1391,22 +474,6 @@ partial class Parts
},
AreaOfDamage = new AreaOfDamageDef
{
- ByBlockHit = new ByBlockHitDef
- {
- Enable = false,
- Radius = 5f, // Meters
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Pooled, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
EndOfLife = new EndOfLifeDef
{
Enable = true,
@@ -1415,143 +482,25 @@ partial class Parts
Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
Falloff = Linear, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- ArmOnlyOnHit = false, // Detonation only is available, After it hits something, when this is true. IE, if shot down, it won't explode.
MinArmingTime = 1, // In ticks, before the Ammo is allowed to explode, detonate or similar; This affects shrapnel spawning.
- NoVisuals = false,
- NoSound = false,
ParticleScale = 1,
- CustomParticle = "", // Particle SubtypeID, from your Particle SBC
- CustomSound = "", // SubtypeID from your Audio SBC, not a filename
Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
},
},
- Ewar = new EwarDef
- {
- Enable = false, // Enables EWAR effects AND DISABLES BASE DAMAGE AND AOE DAMAGE!!
- Type = EnergySink, // EnergySink, Emp, Offense, Nav, Dot, AntiSmart, JumpNull, Anchor, Tractor, Pull, Push,
- Mode = Effect, // Effect , Field
- Strength = 100f,
- Radius = 5f, // Meters
- Duration = 100, // In Ticks
- StackDuration = true, // Combined Durations
- Depletable = true,
- MaxStacks = 10, // Max Debuffs at once
- NoHitParticle = false,
- /*
- EnergySink : Targets & Shutdowns Power Supplies, such as Batteries & Reactor
- Emp : Targets & Shutdown any Block capable of being powered
- Offense : Targets & Shutdowns Weaponry
- Nav : Targets & Shutdown Gyros or Locks them down
- Dot : Deals Damage to Blocks in radius
- AntiSmart : Effects & Scrambles the Targeting List of Affected Missiles
- JumpNull : Shutdown & Stops any Active Jumps, or JumpDrive Units in radius
- Tractor : Affects target with Physics
- Pull : Affects target with Physics
- Push : Affects target with Physics
- Anchor : Targets & Shutdowns Thrusters
-
- */
- Force = new PushPullDef
- {
- ForceFrom = ProjectileLastPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- ForceTo = HitPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- Position = TargetCenterOfMass, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- DisableRelativeMass = false,
- TractorRange = 0,
- ShooterFeelsForce = false,
- },
- Field = new FieldDef
- {
- Interval = 0, // Time between each pulse, in game ticks (60 == 1 second), starts at 0 (59 == tick 60).
- PulseChance = 0, // Chance from 0 - 100 that an entity in the field will be hit by any given pulse.
- GrowTime = 0, // How many ticks it should take the field to grow to full size.
- HideModel = false, // Hide the default bubble, or other model if specified.
- ShowParticle = true, // Show Block damage effect.
- TriggerRange = 250f, //range at which fields are triggered
- Particle = new ParticleDef // Particle effect to generate at the field's position.
- {
- Name = "", // SubtypeId of field particle effect.
- Extras = new ParticleOptionDef
- {
- Scale = 1, // Scale of effect.
- },
- },
- },
- },
- Beams = new BeamDef
- {
- Enable = false, // Enable beam behaviour. Please have 3600 RPM, when this Setting is enabled. Please do not fire Beams into Voxels.
- VirtualBeams = false, // Only one damaging beam, but with the effectiveness of the visual beams combined (better performance).
- ConvergeBeams = false, // When using virtual beams, converge the visual beams to the location of the real beam.
- RotateRealBeam = false, // The real beam is rotated between all visual beams, instead of centered between them.
- OneParticle = false, // Only spawn one particle hit per beam weapon.
- },
Trajectory = new TrajectoryDef
{
Guidance = None, // None, Remote, TravelTo, Smart, DetectTravelTo, DetectSmart, DetectFixed
TargetLossDegree = 15, // Degrees, Is pointed forward
- TargetLossTime = 0, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MaxLifeTime = 1200, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). time begins at 0 and time must EXCEED this value to trigger "time > maxValue". Please have a value for this, It stops Bad things.
AccelPerSec = 600, // Meters Per Second. This is the spawning Speed of the Projectile, and used by turning.
DesiredSpeed = 200, // voxel phasing if you go above 5100
MaxTrajectory = 800f, // Max Distance the projectile or beam can Travel.
- DeaccelTime = 0, // 0 is disabled, a value causes the projectile to come to rest overtime, (Measured in game ticks, 60 = 1 second)
- GravityMultiplier = 0f, // Gravity multiplier, influences the trajectory of the projectile, value greater than 0 to enable. Natural Gravity Only.
- SpeedVariance = Random(start: 0, end: 0), // subtracts value from DesiredSpeed. Be warned, you can make your projectile go backwards.
- RangeVariance = Random(start: 0, end: 0), // subtracts value from MaxTrajectory
- MaxTrajectoryTime = 0, // How long the weapon must fire before it reaches MaxTrajectory.
- Smarts = new SmartsDef
- {
- Inaccuracy = 2.5f, // 0 is perfect, hit accuracy will be a random num of meters between 0 and this value.
- Aggressiveness = 1, // controls how responsive tracking is.
- MaxLateralThrust = 0.2f, // controls how sharp the trajectile may turn
- TrackingDelay = 0, // Measured in Shape diameter units traveled.
- MaxChaseTime = 0, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- OverideTarget = false, // when set to true ammo picks its own target, does not use hardpoint's.
- MaxTargets = 1, // Number of targets allowed before ending, 0 = unlimited
- NoTargetExpire = false, // Expire without ever having a target at TargetLossTime
- Roam = false, // Roam current area after target loss
- KeepAliveAfterTargetLoss = false, // Whether to stop early death of projectile on target loss
- OffsetRatio = 0.0025f, // The ratio to offset the random direction (0 to 1)
- OffsetTime = 120, // how often to offset degree, measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..)
- },
- Mines = new MinesDef // Note: This is being investigated. Please report to Github, any issues.
- {
- DetectRadius = 0,
- DeCloakRadius = 0,
- FieldTime = 0,
- Cloak = false,
- Persist = false,
- },
},
AmmoGraphics = new GraphicDef
{
- ModelName = "Models\\Weapons\\Projectile_Missile.mwm", // Model Path goes here. "\\Models\\Ammo\\Starcore_Arrow_Missile_Large"
+ ModelName = "Models\\Weapons\\Projectile_Missile.mwm", // Model Path goes here.
VisualProbability = 1f, // %
ShieldHitDraw = true,
- Decals = new DecalDef
- {
- MaxAge = 3600,
- Map = new[]
- {
- new TextureMapDef
- {
- HitMaterial = "Metal",
- DecalMaterial = "Missile",
- },
- new TextureMapDef
- {
- HitMaterial = "Glass",
- DecalMaterial = "Missile",
- },
- },
- },
Particles = new AmmoParticleDef
{
Ammo = new ParticleDef
@@ -1563,176 +512,22 @@ partial class Parts
Scale = 1,
},
},
- Hit = new ParticleDef
- {
- Name = "",
- ApplyToShield = true,
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- HitPlayChance = 1f,
- },
- },
- Eject = new ParticleDef
- {
- Name = "",
- ApplyToShield = true,
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- HitPlayChance = 1f,
- },
- },
- },
- Lines = new LineDef
- {
- ColorVariance = Random(start: 0.8f, end: 1.2f), // multiply the color by random values within range.
- WidthVariance = Random(start: 0f, end: 0f), // adds random value to default width (negatives shrinks width)
- Tracer = new TracerBaseDef
- {
- Enable = false,
- Length = 5f, //
- Width = 0.1f, //
- Color = Color(red: 3, green: 2, blue: 1f, alpha: 1), // RBG 255 is Neon Glowing, 100 is Quite Bright.
- VisualFadeStart = 0, // Number of ticks the weapon has been firing before projectiles begin to fade their color
- VisualFadeEnd = 0, // How many ticks after fade began before it will be invisible.
- Textures = new[] {// WeaponLaser, ProjectileTrailLine, WarpBubble, etc..
- "WeaponLaser", // Please always have this Line set, if this Section is enabled.
- },
- TextureMode = Normal, // Normal, Cycle, Chaos, Wave
- Segmentation = new SegmentDef
- {
- Enable = false, // If true Tracer TextureMode is ignored
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- SegmentLength = 0f, // Uses the values below.
- SegmentGap = 0f, // Uses Tracer textures and values
- Speed = 1f, // meters per second
- Color = Color(red: 1, green: 2, blue: 2.5f, alpha: 1),
- WidthMultiplier = 1f,
- Reverse = false,
- UseLineVariance = true,
- WidthVariance = Random(start: 0f, end: 0f),
- ColorVariance = Random(start: 0f, end: 0f)
- }
- },
- Trail = new TrailDef
- {
- Enable = false,
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- TextureMode = Normal,
- DecayTime = 3, // In Ticks. 1 = 1 Additional Tracer generated per motion, 33 is 33 lines drawn per projectile. Keep this number low.
- Color = Color(red: 0, green: 0, blue: 1, alpha: 1),
- Back = false,
- CustomWidth = 0,
- UseWidthVariance = false,
- UseColorFade = true,
- },
- OffsetEffect = new OffsetEffectDef
- {
- MaxOffset = 0,// 0 offset value disables this effect
- MinLength = 0.2f,
- MaxLength = 3,
- },
},
},
AmmoAudio = new AmmoAudioDef
{
TravelSound = "MissileFlightSound", // SubtypeID for your Sound File. Travel, is sound generated around your Projectile in flight
- HitSound = "",
- ShotSound = "",
- ShieldHitSound = "",
- PlayerHitSound = "",
- VoxelHitSound = "",
- FloatingHitSound = "",
- HitPlayChance = 0.5f,
- HitPlayShield = true,
},
- Ejection = new EjectionDef // Optional Component, allows generation of Particle or Item (Typically magazine), on firing, to simulate Tank shell ejection
- {
- Type = Particle, // Particle or Item (Inventory Component)
- Speed = 100f, // Speed inventory is ejected from in dummy direction
- SpawnChance = 0.5f, // chance of triggering effect (0 - 1)
- CompDef = new ComponentDef
- {
- ItemName = "", //InventoryComponent name
- ItemLifeTime = 0, // how long item should exist in world
- Delay = 0, // delay in ticks after shot before ejected
- }
- }, // Don't edit below this line
};
private AmmoDef AutocannonShell => new AmmoDef // Your ID, for slotting into the Weapon CS
{
AmmoMagazine = "AutocannonClip", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo.
AmmoRound = "Autocannon Shell", // Name of ammo in terminal, should be different for each ammo type used by the same weapon. Is used by Shrapnel.
- HybridRound = false, // Use both a physical ammo magazine and energy per shot.
- EnergyCost = 0.1f, // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR.
BaseDamage = 500f, // Direct damage; one steel plate is worth 100.
Mass = 3f, // In kilograms; how much force the impact will apply to the target.
- Health = 0, // How much damage the projectile can take from other projectiles (base of 1 per hit) before dying; 0 disables this and makes the projectile untargetable.
BackKickForce = 250f, // Recoil. This is applied to the Parent Grid.
- DecayPerShot = 0f, // Damage to the firing weapon itself.
HardPointUsable = true, // Whether this is a primary ammo type fired directly by the turret. Set to false if this is a shrapnel ammoType and you don't want the turret to be able to select it directly.
- EnergyMagazineSize = 0, // For energy weapons, how many shots to fire before reloading.
- IgnoreWater = false, // Whether the projectile should be able to penetrate water when using WaterMod.
- IgnoreVoxels = false, // Whether the projectile should be able to penetrate voxels.
- Synchronize = false, // For future use
- HeatModifier = -1f, // Allows this ammo to modify the amount of heat the weapon produces per shot.
- Shape = new ShapeDef // Defines the collision shape of the projectile, defaults to LineShape and uses the visual Line Length if set to 0.
- {
- Shape = LineShape, // LineShape or SphereShape. Do not use SphereShape for fast moving projectiles if you care about precision.
- Diameter = 0, // Diameter is minimum length of LineShape or minimum diameter of SphereShape.
- },
- ObjectsHit = new ObjectsHitDef
- {
- MaxObjectsHit = 0, // Limits the number of entities (grids, players, projectiles) the projectile can penetrate; 0 = unlimited.
- CountBlocks = false, // Counts individual blocks, not just entities hit.
- },
- Fragment = new FragmentDef // Formerly known as Shrapnel. Spawns specified ammo fragments on projectile death (via hit or detonation).
- {
- AmmoRound = "", // AmmoRound field of the ammo to spawn.
- Fragments = 0, // Number of projectiles to spawn.
- Degrees = 0, // Cone in which to randomize direction of spawned projectiles.
- Reverse = false, // Spawn projectiles backward instead of forward.
- DropVelocity = false, // fragments will not inherit velocity from parent.
- Offset = 0f, // Offsets the fragment spawn by this amount, in meters (positive forward, negative for backwards), value is read from parent ammo type.
- Radial = 0f, // Determines starting angle for Degrees of spread above. IE, 0 degrees and 90 radial goes perpendicular to travel path
- MaxChildren = 0, // number of maximum branches for fragments from the roots point of view, 0 is unlimited
- IgnoreArming = true, // If true, ignore ArmOnHit or MinArmingTime in EndOfLife definitions
- AdvOffset = Vector(x: 0, y: 0, z: 0), // advanced offsets the fragment by xyz coordinates relative to parent, value is read from fragment ammo type.
- TimedSpawns = new TimedSpawnDef // disables FragOnEnd in favor of info specified below
- {
- Enable = false, // Enables TimedSpawns mechanism
- Interval = 0, // Time between spawning fragments, in ticks, 0 means every tick, 1 means every other
- StartTime = 0, // Time delay to start spawning fragments, in ticks, of total projectile life
- MaxSpawns = 1, // Max number of fragment children to spawn
- Proximity = 1000, // Starting distance from target bounding sphere to start spawning fragments, 0 disables this feature. No spawning outside this distance
- ParentDies = true, // Parent dies once after it spawns its last child.
- PointAtTarget = true, // Start fragment direction pointing at Target
- PointType = Predict, // Point accuracy, Direct, Lead (always fire), Predict (only fire if it can hit)
- GroupSize = 5, // Number of spawns in each group
- GroupDelay = 120, // Delay between each group.
- },
- },
- Pattern = new PatternDef
- {
- Patterns = new[] { // If enabled, set of multiple ammos to fire in order instead of the main ammo.
- "",
- },
- Mode = Fragment, // Select when to activate this pattern, options: Never, Weapon, Fragment, Both
- TriggerChance = 1f, // This is %
- Random = false, // This randomizes the number spawned at once, NOT the list order.
- RandomMin = 1,
- RandomMax = 1,
- SkipParent = false, // Skip the Ammo itself, in the list
- PatternSteps = 1, // Number of Ammos activated per round, will progress in order and loop. Ignored if Random = true.
- },
DamageScales = new DamageScaleDef
{
MaxIntegrity = 0f, // Blocks with integrity higher than this value will be immune to damage from this projectile; 0 = disabled.
@@ -1741,12 +536,6 @@ partial class Parts
HealthHitModifier = 2, // How much Health to subtract from another projectile on hit; defaults to 1 if zero or less.
VoxelHitModifier = 1, // Voxel damage multiplier; defaults to 1 if zero or less.
Characters = 0.2f, // Character damage multiplier; defaults to 1 if zero or less.
- // For the following modifier values: -1 = disabled (higher performance), 0 = no damage, 0.01f = 1% damage, 2 = 200% damage.
- FallOff = new FallOffDef
- {
- Distance = 1500f, // Distance at which damage begins falling off.
- MinMultipler = -1f, // Value from 0.0001f to 1f where 0.1f would be a min damage of 10% of base damage.
- },
Grids = new GridSizeDef
{
Large = -1f, // Multiplier for damage against large grids.
@@ -1795,152 +584,18 @@ partial class Parts
},
},
},
- AreaOfDamage = new AreaOfDamageDef
- {
- ByBlockHit = new ByBlockHitDef
- {
- Enable = false,
- Radius = 5f, // Meters
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Pooled, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- EndOfLife = new EndOfLifeDef
- {
- Enable = false,
- Radius = 5f, // Radius of AOE effect, in meters.
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Squeeze, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- ArmOnlyOnHit = false, // Detonation only is available, After it hits something, when this is true. IE, if shot down, it won't explode.
- MinArmingTime = 100, // In ticks, before the Ammo is allowed to explode, detonate or similar; This affects shrapnel spawning.
- NoVisuals = false,
- NoSound = false,
- ParticleScale = 1,
- CustomParticle = "", // Particle SubtypeID, from your Particle SBC
- CustomSound = "", // SubtypeID from your Audio SBC, not a filename
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- },
- Ewar = new EwarDef
- {
- Enable = false, // Enables EWAR effects AND DISABLES BASE DAMAGE AND AOE DAMAGE!!
- Type = EnergySink, // EnergySink, Emp, Offense, Nav, Dot, AntiSmart, JumpNull, Anchor, Tractor, Pull, Push,
- Mode = Effect, // Effect , Field
- Strength = 100f,
- Radius = 5f, // Meters
- Duration = 100, // In Ticks
- StackDuration = true, // Combined Durations
- Depletable = true,
- MaxStacks = 10, // Max Debuffs at once
- NoHitParticle = false,
- /*
- EnergySink : Targets & Shutdowns Power Supplies, such as Batteries & Reactor
- Emp : Targets & Shutdown any Block capable of being powered
- Offense : Targets & Shutdowns Weaponry
- Nav : Targets & Shutdown Gyros or Locks them down
- Dot : Deals Damage to Blocks in radius
- AntiSmart : Effects & Scrambles the Targeting List of Affected Missiles
- JumpNull : Shutdown & Stops any Active Jumps, or JumpDrive Units in radius
- Tractor : Affects target with Physics
- Pull : Affects target with Physics
- Push : Affects target with Physics
- Anchor : Targets & Shutdowns Thrusters
-
- */
- Force = new PushPullDef
- {
- ForceFrom = ProjectileLastPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- ForceTo = HitPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- Position = TargetCenterOfMass, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- DisableRelativeMass = false,
- TractorRange = 0,
- ShooterFeelsForce = false,
- },
- Field = new FieldDef
- {
- Interval = 0, // Time between each pulse, in game ticks (60 == 1 second), starts at 0 (59 == tick 60).
- PulseChance = 0, // Chance from 0 - 100 that an entity in the field will be hit by any given pulse.
- GrowTime = 0, // How many ticks it should take the field to grow to full size.
- HideModel = false, // Hide the default bubble, or other model if specified.
- ShowParticle = true, // Show Block damage effect.
- TriggerRange = 250f, //range at which fields are triggered
- Particle = new ParticleDef // Particle effect to generate at the field's position.
- {
- Name = "", // SubtypeId of field particle effect.
- Extras = new ParticleOptionDef
- {
- Scale = 1, // Scale of effect.
- },
- },
- },
- },
- Beams = new BeamDef
- {
- Enable = false, // Enable beam behaviour. Please have 3600 RPM, when this Setting is enabled. Please do not fire Beams into Voxels.
- VirtualBeams = false, // Only one damaging beam, but with the effectiveness of the visual beams combined (better performance).
- ConvergeBeams = false, // When using virtual beams, converge the visual beams to the location of the real beam.
- RotateRealBeam = false, // The real beam is rotated between all visual beams, instead of centered between them.
- OneParticle = false, // Only spawn one particle hit per beam weapon.
- },
Trajectory = new TrajectoryDef
{
Guidance = None, // None, Remote, TravelTo, Smart, DetectTravelTo, DetectSmart, DetectFixed
- TargetLossDegree = 180f, // Degrees, Is pointed forward
- TargetLossTime = 0, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MaxLifeTime = 420, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). time begins at 0 and time must EXCEED this value to trigger "time > maxValue". Please have a value for this, It stops Bad things.
- AccelPerSec = 0f, // Meters Per Second. This is the spawning Speed of the Projectile, and used by turning.
DesiredSpeed = 400, // voxel phasing if you go above 5100
MaxTrajectory = 800f, // Max Distance the projectile or beam can Travel.
- DeaccelTime = 0, // 0 is disabled, a value causes the projectile to come to rest overtime, (Measured in game ticks, 60 = 1 second)
- GravityMultiplier = 0f, // Gravity multiplier, influences the trajectory of the projectile, value greater than 0 to enable. Natural Gravity Only.
SpeedVariance = Random(start: -5, end: 5), // subtracts value from DesiredSpeed. Be warned, you can make your projectile go backwards.
RangeVariance = Random(start: 0, end: 0), // subtracts value from MaxTrajectory
- MaxTrajectoryTime = 0, // How long the weapon must fire before it reaches MaxTrajectory.
- Smarts = new SmartsDef
- {
- Inaccuracy = 0f, // 0 is perfect, hit accuracy will be a random num of meters between 0 and this value.
- Aggressiveness = 1f, // controls how responsive tracking is.
- MaxLateralThrust = 0.5, // controls how sharp the trajectile may turn
- TrackingDelay = 0, // Measured in Shape diameter units traveled.
- MaxChaseTime = 0, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- OverideTarget = true, // when set to true ammo picks its own target, does not use hardpoint's.
- MaxTargets = 0, // Number of targets allowed before ending, 0 = unlimited
- NoTargetExpire = false, // Expire without ever having a target at TargetLossTime
- Roam = false, // Roam current area after target loss
- KeepAliveAfterTargetLoss = false, // Whether to stop early death of projectile on target loss
- OffsetRatio = 0.05f, // The ratio to offset the random direction (0 to 1)
- OffsetTime = 60, // how often to offset degree, measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..)
- },
- Mines = new MinesDef // Note: This is being investigated. Please report to Github, any issues.
- {
- DetectRadius = 0,
- DeCloakRadius = 0,
- FieldTime = 0,
- Cloak = false,
- Persist = false,
- },
- },
+ },
AmmoGraphics = new GraphicDef
{
- ModelName = "", // Model Path goes here. "\\Models\\Ammo\\Starcore_Arrow_Missile_Large"
VisualProbability = 1f, // %
- ShieldHitDraw = false,
Decals = new DecalDef
{
MaxAge = 3600,
@@ -1960,16 +615,7 @@ partial class Parts
},
Particles = new AmmoParticleDef
{
- Ammo = new ParticleDef
- {
- Name = "", //ShipWelderArc
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- },
- },
- Hit = new ParticleDef
+ Hit = new ParticleDef
{
Name = "MaterialHit_Metal_GatlingGun",
ApplyToShield = true,
@@ -1980,17 +626,6 @@ partial class Parts
HitPlayChance = 0.5f,
},
},
- Eject = new ParticleDef
- {
- Name = "",
- ApplyToShield = true,
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- HitPlayChance = 1f,
- },
- },
},
Lines = new LineDef
{
@@ -2008,36 +643,6 @@ partial class Parts
"ProjectileTrailLine", // Please always have this Line set, if this Section is enabled.
},
TextureMode = Normal, // Normal, Cycle, Chaos, Wave
- Segmentation = new SegmentDef
- {
- Enable = false, // If true Tracer TextureMode is ignored
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- SegmentLength = 0f, // Uses the values below.
- SegmentGap = 0f, // Uses Tracer textures and values
- Speed = 1f, // meters per second
- Color = Color(red: 1, green: 2, blue: 2.5f, alpha: 1),
- WidthMultiplier = 1f,
- Reverse = false,
- UseLineVariance = true,
- WidthVariance = Random(start: 0f, end: 0f),
- ColorVariance = Random(start: 0f, end: 0f)
- }
- },
- Trail = new TrailDef
- {
- Enable = false,
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- TextureMode = Normal,
- DecayTime = 3, // In Ticks. 1 = 1 Additional Tracer generated per motion, 33 is 33 lines drawn per projectile. Keep this number low.
- Color = Color(red: 0, green: 0, blue: 1, alpha: 1),
- Back = false,
- CustomWidth = 0,
- UseWidthVariance = false,
- UseColorFade = true,
},
OffsetEffect = new OffsetEffectDef
{
@@ -2049,304 +654,35 @@ partial class Parts
},
AmmoAudio = new AmmoAudioDef
{
- TravelSound = "", // SubtypeID for your Sound File. Travel, is sound generated around your Projectile in flight
HitSound = "ImpMetalMetalCat0",
- ShotSound = "",
- ShieldHitSound = "",
- PlayerHitSound = "",
VoxelHitSound = "ImpMetalRockCat0",
- FloatingHitSound = "",
HitPlayChance = 1f,
HitPlayShield = true,
},
- Ejection = new EjectionDef // Optional Component, allows generation of Particle or Item (Typically magazine), on firing, to simulate Tank shell ejection
- {
- Type = Particle, // Particle or Item (Inventory Component)
- Speed = 100f, // Speed inventory is ejected from in dummy direction
- SpawnChance = 0.5f, // chance of triggering effect (0 - 1)
- CompDef = new ComponentDef
- {
- ItemName = "", //InventoryComponent name
- ItemLifeTime = 0, // how long item should exist in world
- Delay = 0, // delay in ticks after shot before ejected
- }
- }, // Don't edit below this line
};
private AmmoDef AssaultCannonShell => new AmmoDef // Your ID, for slotting into the Weapon CS
{
AmmoMagazine = "MediumCalibreAmmo", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo.
AmmoRound = "Assault Cannon Shell", // Name of ammo in terminal, should be different for each ammo type used by the same weapon. Is used by Shrapnel.
- HybridRound = false, // Use both a physical ammo magazine and energy per shot.
- EnergyCost = 0.1f, // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR.
BaseDamage = 4000f, // Direct damage; one steel plate is worth 100.
Mass = 300f, // In kilograms; how much force the impact will apply to the target.
- Health = 0, // How much damage the projectile can take from other projectiles (base of 1 per hit) before dying; 0 disables this and makes the projectile untargetable.
BackKickForce = 10000f, // Recoil. This is applied to the Parent Grid.
- DecayPerShot = 0f, // Damage to the firing weapon itself.
HardPointUsable = true, // Whether this is a primary ammo type fired directly by the turret. Set to false if this is a shrapnel ammoType and you don't want the turret to be able to select it directly.
- EnergyMagazineSize = 0, // For energy weapons, how many shots to fire before reloading.
- IgnoreWater = false, // Whether the projectile should be able to penetrate water when using WaterMod.
- IgnoreVoxels = false, // Whether the projectile should be able to penetrate voxels.
- Synchronize = false, // For future use
- HeatModifier = -1f, // Allows this ammo to modify the amount of heat the weapon produces per shot.
- Shape = new ShapeDef // Defines the collision shape of the projectile, defaults to LineShape and uses the visual Line Length if set to 0.
- {
- Shape = LineShape, // LineShape or SphereShape. Do not use SphereShape for fast moving projectiles if you care about precision.
- Diameter = 0, // Diameter is minimum length of LineShape or minimum diameter of SphereShape.
- },
- ObjectsHit = new ObjectsHitDef
- {
- MaxObjectsHit = 0, // Limits the number of entities (grids, players, projectiles) the projectile can penetrate; 0 = unlimited.
- CountBlocks = false, // Counts individual blocks, not just entities hit.
- },
- Fragment = new FragmentDef // Formerly known as Shrapnel. Spawns specified ammo fragments on projectile death (via hit or detonation).
- {
- AmmoRound = "", // AmmoRound field of the ammo to spawn.
- Fragments = 0, // Number of projectiles to spawn.
- Degrees = 0, // Cone in which to randomize direction of spawned projectiles.
- Reverse = false, // Spawn projectiles backward instead of forward.
- DropVelocity = false, // fragments will not inherit velocity from parent.
- Offset = 0f, // Offsets the fragment spawn by this amount, in meters (positive forward, negative for backwards), value is read from parent ammo type.
- Radial = 0f, // Determines starting angle for Degrees of spread above. IE, 0 degrees and 90 radial goes perpendicular to travel path
- MaxChildren = 0, // number of maximum branches for fragments from the roots point of view, 0 is unlimited
- IgnoreArming = true, // If true, ignore ArmOnHit or MinArmingTime in EndOfLife definitions
- AdvOffset = Vector(x: 0, y: 0, z: 0), // advanced offsets the fragment by xyz coordinates relative to parent, value is read from fragment ammo type.
- TimedSpawns = new TimedSpawnDef // disables FragOnEnd in favor of info specified below
- {
- Enable = false, // Enables TimedSpawns mechanism
- Interval = 0, // Time between spawning fragments, in ticks, 0 means every tick, 1 means every other
- StartTime = 0, // Time delay to start spawning fragments, in ticks, of total projectile life
- MaxSpawns = 1, // Max number of fragment children to spawn
- Proximity = 1000, // Starting distance from target bounding sphere to start spawning fragments, 0 disables this feature. No spawning outside this distance
- ParentDies = true, // Parent dies once after it spawns its last child.
- PointAtTarget = true, // Start fragment direction pointing at Target
- PointType = Predict, // Point accuracy, Direct, Lead (always fire), Predict (only fire if it can hit)
- GroupSize = 5, // Number of spawns in each group
- GroupDelay = 120, // Delay between each group.
- },
- },
- Pattern = new PatternDef
- {
- Patterns = new[] { // If enabled, set of multiple ammos to fire in order instead of the main ammo.
- "",
- },
- Mode = Fragment, // Select when to activate this pattern, options: Never, Weapon, Fragment, Both
- TriggerChance = 1f, // This is %
- Random = false, // This randomizes the number spawned at once, NOT the list order.
- RandomMin = 1,
- RandomMax = 1,
- SkipParent = false, // Skip the Ammo itself, in the list
- PatternSteps = 1, // Number of Ammos activated per round, will progress in order and loop. Ignored if Random = true.
- },
- DamageScales = new DamageScaleDef
- {
- MaxIntegrity = 0f, // Blocks with integrity higher than this value will be immune to damage from this projectile; 0 = disabled.
- DamageVoxels = false, // Whether to damage voxels.
- SelfDamage = false, // Whether to damage the weapon's own grid.
- HealthHitModifier = 3, // How much Health to subtract from another projectile on hit; defaults to 1 if zero or less.
- VoxelHitModifier = 1, // Voxel damage multiplier; defaults to 1 if zero or less.
- Characters = 1f, // Character damage multiplier; defaults to 1 if zero or less.
- // For the following modifier values: -1 = disabled (higher performance), 0 = no damage, 0.01f = 1% damage, 2 = 200% damage.
- FallOff = new FallOffDef
- {
- Distance = 2000f, // Distance at which damage begins falling off.
- MinMultipler = -1f, // Value from 0.0001f to 1f where 0.1f would be a min damage of 10% of base damage.
- },
- Grids = new GridSizeDef
- {
- Large = -1f, // Multiplier for damage against large grids.
- Small = -1f, // Multiplier for damage against small grids.
- },
- Armor = new ArmorDef
- {
- Armor = -1f, // Multiplier for damage against all armor. This is multiplied with the specific armor type multiplier (light, heavy).
- Light = -1f, // Multiplier for damage against light armor.
- Heavy = -1f, // Multiplier for damage against heavy armor.
- NonArmor = -1f, // Multiplier for damage against every else.
- },
- Shields = new ShieldDef
- {
- Modifier = -1f, // Multiplier for damage against shields.
- Type = Default, // Damage vs healing against shields; Default, Heal
- BypassModifier = -1f, // If greater than zero, the percentage of damage that will penetrate the shield.
- },
- DamageType = new DamageTypes // Damage type of each element of the projectile's damage; Kinetic, Energy
- {
- Base = Kinetic, // Base Damage uses this
- AreaEffect = Kinetic,
- Detonation = Kinetic,
- Shield = Kinetic, // Damage against shields is currently all of one type per projectile. Shield Bypass Weapons, always Deal Energy regardless of this line
- },
- Deform = new DeformDef
- {
- DeformType = HitBlock,
- DeformDelay = 30,
- },
- Custom = new CustomScalesDef
- {
- SkipOthers = NoSkip, // Controls how projectile interacts with other blocks in relation to those defined here, NoSkip, Exclusive, Inclusive.
- Types = new[] // List of blocks to apply custom damage multipliers to.
- {
- new CustomBlocksDef
- {
- SubTypeId = "Test1",
- Modifier = -1f,
- },
- new CustomBlocksDef
- {
- SubTypeId = "Test2",
- Modifier = -1f,
- },
- },
- },
- },
- AreaOfDamage = new AreaOfDamageDef
- {
- ByBlockHit = new ByBlockHitDef
- {
- Enable = false,
- Radius = 5f, // Meters
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Pooled, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- EndOfLife = new EndOfLifeDef
- {
- Enable = false,
- Radius = 5f, // Radius of AOE effect, in meters.
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Squeeze, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- ArmOnlyOnHit = false, // Detonation only is available, After it hits something, when this is true. IE, if shot down, it won't explode.
- MinArmingTime = 100, // In ticks, before the Ammo is allowed to explode, detonate or similar; This affects shrapnel spawning.
- NoVisuals = false,
- NoSound = false,
- ParticleScale = 1,
- CustomParticle = "", // Particle SubtypeID, from your Particle SBC
- CustomSound = "", // SubtypeID from your Audio SBC, not a filename
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- },
- Ewar = new EwarDef
- {
- Enable = false, // Enables EWAR effects AND DISABLES BASE DAMAGE AND AOE DAMAGE!!
- Type = EnergySink, // EnergySink, Emp, Offense, Nav, Dot, AntiSmart, JumpNull, Anchor, Tractor, Pull, Push,
- Mode = Effect, // Effect , Field
- Strength = 100f,
- Radius = 5f, // Meters
- Duration = 100, // In Ticks
- StackDuration = true, // Combined Durations
- Depletable = true,
- MaxStacks = 10, // Max Debuffs at once
- NoHitParticle = false,
- /*
- EnergySink : Targets & Shutdowns Power Supplies, such as Batteries & Reactor
- Emp : Targets & Shutdown any Block capable of being powered
- Offense : Targets & Shutdowns Weaponry
- Nav : Targets & Shutdown Gyros or Locks them down
- Dot : Deals Damage to Blocks in radius
- AntiSmart : Effects & Scrambles the Targeting List of Affected Missiles
- JumpNull : Shutdown & Stops any Active Jumps, or JumpDrive Units in radius
- Tractor : Affects target with Physics
- Pull : Affects target with Physics
- Push : Affects target with Physics
- Anchor : Targets & Shutdowns Thrusters
-
- */
- Force = new PushPullDef
- {
- ForceFrom = ProjectileLastPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- ForceTo = HitPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- Position = TargetCenterOfMass, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- DisableRelativeMass = false,
- TractorRange = 0,
- ShooterFeelsForce = false,
- },
- Field = new FieldDef
- {
- Interval = 0, // Time between each pulse, in game ticks (60 == 1 second), starts at 0 (59 == tick 60).
- PulseChance = 0, // Chance from 0 - 100 that an entity in the field will be hit by any given pulse.
- GrowTime = 0, // How many ticks it should take the field to grow to full size.
- HideModel = false, // Hide the default bubble, or other model if specified.
- ShowParticle = true, // Show Block damage effect.
- TriggerRange = 250f, //range at which fields are triggered
- Particle = new ParticleDef // Particle effect to generate at the field's position.
- {
- Name = "", // SubtypeId of field particle effect.
- Extras = new ParticleOptionDef
- {
- Scale = 1, // Scale of effect.
- },
- },
- },
- },
- Beams = new BeamDef
- {
- Enable = false, // Enable beam behaviour. Please have 3600 RPM, when this Setting is enabled. Please do not fire Beams into Voxels.
- VirtualBeams = false, // Only one damaging beam, but with the effectiveness of the visual beams combined (better performance).
- ConvergeBeams = false, // When using virtual beams, converge the visual beams to the location of the real beam.
- RotateRealBeam = false, // The real beam is rotated between all visual beams, instead of centered between them.
- OneParticle = false, // Only spawn one particle hit per beam weapon.
- },
+ NoGridOrArmorScaling = true,
Trajectory = new TrajectoryDef
{
Guidance = None, // None, Remote, TravelTo, Smart, DetectTravelTo, DetectSmart, DetectFixed
TargetLossDegree = 180f, // Degrees, Is pointed forward
- TargetLossTime = 0, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MaxLifeTime = 480, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). time begins at 0 and time must EXCEED this value to trigger "time > maxValue". Please have a value for this, It stops Bad things.
- AccelPerSec = 0f, // Meters Per Second. This is the spawning Speed of the Projectile, and used by turning.
DesiredSpeed = 500, // voxel phasing if you go above 5100
MaxTrajectory = 1400f, // Max Distance the projectile or beam can Travel.
- DeaccelTime = 0, // 0 is disabled, a value causes the projectile to come to rest overtime, (Measured in game ticks, 60 = 1 second)
GravityMultiplier = 1f, // Gravity multiplier, influences the trajectory of the projectile, value greater than 0 to enable. Natural Gravity Only.
- SpeedVariance = Random(start: 0, end: 0), // subtracts value from DesiredSpeed. Be warned, you can make your projectile go backwards.
- RangeVariance = Random(start: 0, end: 0), // subtracts value from MaxTrajectory
- MaxTrajectoryTime = 0, // How long the weapon must fire before it reaches MaxTrajectory.
- Smarts = new SmartsDef
- {
- Inaccuracy = 0f, // 0 is perfect, hit accuracy will be a random num of meters between 0 and this value.
- Aggressiveness = 1f, // controls how responsive tracking is.
- MaxLateralThrust = 0.5, // controls how sharp the trajectile may turn
- TrackingDelay = 0, // Measured in Shape diameter units traveled.
- MaxChaseTime = 0, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- OverideTarget = true, // when set to true ammo picks its own target, does not use hardpoint's.
- MaxTargets = 0, // Number of targets allowed before ending, 0 = unlimited
- NoTargetExpire = false, // Expire without ever having a target at TargetLossTime
- Roam = false, // Roam current area after target loss
- KeepAliveAfterTargetLoss = false, // Whether to stop early death of projectile on target loss
- OffsetRatio = 0.05f, // The ratio to offset the random direction (0 to 1)
- OffsetTime = 60, // how often to offset degree, measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..)
- },
- Mines = new MinesDef // Note: This is being investigated. Please report to Github, any issues.
- {
- DetectRadius = 0,
- DeCloakRadius = 0,
- FieldTime = 0,
- Cloak = false,
- Persist = false,
- },
},
AmmoGraphics = new GraphicDef
{
ModelName = "Models\\Weapons\\MediumCalibreShell.mwm", // Model Path goes here. "\\Models\\Ammo\\Starcore_Arrow_Missile_Large"
VisualProbability = 1f, // %
- ShieldHitDraw = false,
Decals = new DecalDef
{
MaxAge = 3600,
@@ -2354,809 +690,68 @@ partial class Parts
{
new TextureMapDef
{
- HitMaterial = "Metal",
- DecalMaterial = "GunBullet",
- },
- new TextureMapDef
- {
- HitMaterial = "Glass",
- DecalMaterial = "GunBullet",
- },
- },
- },
- Particles = new AmmoParticleDef
- {
- Ammo = new ParticleDef
- {
- Name = "MediumCalibreGun_Tracer", //ShipWelderArc
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- },
- },
- Hit = new ParticleDef
- {
- Name = "MaterialHit_Metal_GatlingGun",
- ApplyToShield = true,
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- HitPlayChance = 1f,
- },
- },
- Eject = new ParticleDef
- {
- Name = "",
- ApplyToShield = true,
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- HitPlayChance = 1f,
- },
- },
- },
- Lines = new LineDef
- {
- ColorVariance = Random(start: 0.5f, end: 2.5f), // multiply the color by random values within range.
- WidthVariance = Random(start: 0f, end: 0.05f), // adds random value to default width (negatives shrinks width)
- Tracer = new TracerBaseDef
- {
- Enable = false,
- Length = 5f, //
- Width = 0.2f, //
- Color = Color(red: 2.5f, green: 2, blue: 1f, alpha: 1), // RBG 255 is Neon Glowing, 100 is Quite Bright.
- VisualFadeStart = 0, // Number of ticks the weapon has been firing before projectiles begin to fade their color
- VisualFadeEnd = 240, // How many ticks after fade began before it will be invisible.
- Textures = new[] {// WeaponLaser, ProjectileTrailLine, WarpBubble, etc..
- "ProjectileTrailLine", // Please always have this Line set, if this Section is enabled.
- },
- TextureMode = Normal, // Normal, Cycle, Chaos, Wave
- Segmentation = new SegmentDef
- {
- Enable = false, // If true Tracer TextureMode is ignored
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- SegmentLength = 0f, // Uses the values below.
- SegmentGap = 0f, // Uses Tracer textures and values
- Speed = 1f, // meters per second
- Color = Color(red: 1, green: 2, blue: 2.5f, alpha: 1),
- WidthMultiplier = 1f,
- Reverse = false,
- UseLineVariance = true,
- WidthVariance = Random(start: 0f, end: 0f),
- ColorVariance = Random(start: 0f, end: 0f)
- }
- },
- Trail = new TrailDef
- {
- Enable = false,
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- TextureMode = Normal,
- DecayTime = 3, // In Ticks. 1 = 1 Additional Tracer generated per motion, 33 is 33 lines drawn per projectile. Keep this number low.
- Color = Color(red: 0, green: 0, blue: 1, alpha: 1),
- Back = false,
- CustomWidth = 0,
- UseWidthVariance = false,
- UseColorFade = true,
- },
- OffsetEffect = new OffsetEffectDef
- {
- MaxOffset = 0,// 0 offset value disables this effect
- MinLength = 0.2f,
- MaxLength = 3,
- },
- },
- },
- AmmoAudio = new AmmoAudioDef
- {
- TravelSound = "MediumShellFlightSound", // SubtypeID for your Sound File. Travel, is sound generated around your Projectile in flight
- HitSound = "ImpMetalMetalCat0",
- ShotSound = "",
- ShieldHitSound = "",
- PlayerHitSound = "",
- VoxelHitSound = "ImpMetalRockCat0",
- FloatingHitSound = "",
- HitPlayChance = 1f,
- HitPlayShield = true,
- },
- Ejection = new EjectionDef // Optional Component, allows generation of Particle or Item (Typically magazine), on firing, to simulate Tank shell ejection
- {
- Type = Particle, // Particle or Item (Inventory Component)
- Speed = 100f, // Speed inventory is ejected from in dummy direction
- SpawnChance = 0.5f, // chance of triggering effect (0 - 1)
- CompDef = new ComponentDef
- {
- ItemName = "", //InventoryComponent name
- ItemLifeTime = 0, // how long item should exist in world
- Delay = 0, // delay in ticks after shot before ejected
- }
- }, // Don't edit below this line
- };
-
- private AmmoDef ArtilleryShell => new AmmoDef // Your ID, for slotting into the Weapon CS
- {
- AmmoMagazine = "LargeCalibreAmmo", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo.
- AmmoRound = "Artillery Shell", // Name of ammo in terminal, should be different for each ammo type used by the same weapon. Is used by Shrapnel.
- HybridRound = false, // Use both a physical ammo magazine and energy per shot.
- EnergyCost = 0.1f, // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR.
- BaseDamage = 17000f, // Direct damage; one steel plate is worth 100.
- Mass = 800f, // In kilograms; how much force the impact will apply to the target.
- Health = 0, // How much damage the projectile can take from other projectiles (base of 1 per hit) before dying; 0 disables this and makes the projectile untargetable.
- BackKickForce = 30000f, // Recoil. This is applied to the Parent Grid.
- DecayPerShot = 0f, // Damage to the firing weapon itself.
- HardPointUsable = true, // Whether this is a primary ammo type fired directly by the turret. Set to false if this is a shrapnel ammoType and you don't want the turret to be able to select it directly.
- EnergyMagazineSize = 0, // For energy weapons, how many shots to fire before reloading.
- IgnoreWater = false, // Whether the projectile should be able to penetrate water when using WaterMod.
- IgnoreVoxels = false, // Whether the projectile should be able to penetrate voxels.
- Synchronize = false, // For future use
- HeatModifier = -1f, // Allows this ammo to modify the amount of heat the weapon produces per shot.
- Shape = new ShapeDef // Defines the collision shape of the projectile, defaults to LineShape and uses the visual Line Length if set to 0.
- {
- Shape = LineShape, // LineShape or SphereShape. Do not use SphereShape for fast moving projectiles if you care about precision.
- Diameter = 0, // Diameter is minimum length of LineShape or minimum diameter of SphereShape.
- },
- ObjectsHit = new ObjectsHitDef
- {
- MaxObjectsHit = 0, // Limits the number of entities (grids, players, projectiles) the projectile can penetrate; 0 = unlimited.
- CountBlocks = false, // Counts individual blocks, not just entities hit.
- },
- Fragment = new FragmentDef // Formerly known as Shrapnel. Spawns specified ammo fragments on projectile death (via hit or detonation).
- {
- AmmoRound = "", // AmmoRound field of the ammo to spawn.
- Fragments = 0, // Number of projectiles to spawn.
- Degrees = 0, // Cone in which to randomize direction of spawned projectiles.
- Reverse = false, // Spawn projectiles backward instead of forward.
- DropVelocity = false, // fragments will not inherit velocity from parent.
- Offset = 0f, // Offsets the fragment spawn by this amount, in meters (positive forward, negative for backwards), value is read from parent ammo type.
- Radial = 0f, // Determines starting angle for Degrees of spread above. IE, 0 degrees and 90 radial goes perpendicular to travel path
- MaxChildren = 0, // number of maximum branches for fragments from the roots point of view, 0 is unlimited
- IgnoreArming = true, // If true, ignore ArmOnHit or MinArmingTime in EndOfLife definitions
- AdvOffset = Vector(x: 0, y: 0, z: 0), // advanced offsets the fragment by xyz coordinates relative to parent, value is read from fragment ammo type.
- TimedSpawns = new TimedSpawnDef // disables FragOnEnd in favor of info specified below
- {
- Enable = false, // Enables TimedSpawns mechanism
- Interval = 0, // Time between spawning fragments, in ticks, 0 means every tick, 1 means every other
- StartTime = 0, // Time delay to start spawning fragments, in ticks, of total projectile life
- MaxSpawns = 1, // Max number of fragment children to spawn
- Proximity = 1000, // Starting distance from target bounding sphere to start spawning fragments, 0 disables this feature. No spawning outside this distance
- ParentDies = true, // Parent dies once after it spawns its last child.
- PointAtTarget = true, // Start fragment direction pointing at Target
- PointType = Predict, // Point accuracy, Direct, Lead (always fire), Predict (only fire if it can hit)
- GroupSize = 5, // Number of spawns in each group
- GroupDelay = 120, // Delay between each group.
- },
- },
- Pattern = new PatternDef
- {
- Patterns = new[] { // If enabled, set of multiple ammos to fire in order instead of the main ammo.
- "",
- },
- Mode = Fragment, // Select when to activate this pattern, options: Never, Weapon, Fragment, Both
- TriggerChance = 1f, // This is %
- Random = false, // This randomizes the number spawned at once, NOT the list order.
- RandomMin = 1,
- RandomMax = 1,
- SkipParent = false, // Skip the Ammo itself, in the list
- PatternSteps = 1, // Number of Ammos activated per round, will progress in order and loop. Ignored if Random = true.
- },
- DamageScales = new DamageScaleDef
- {
- MaxIntegrity = 0f, // Blocks with integrity higher than this value will be immune to damage from this projectile; 0 = disabled.
- DamageVoxels = false, // Whether to damage voxels.
- SelfDamage = false, // Whether to damage the weapon's own grid.
- HealthHitModifier = 4, // How much Health to subtract from another projectile on hit; defaults to 1 if zero or less.
- VoxelHitModifier = 1, // Voxel damage multiplier; defaults to 1 if zero or less.
- Characters = 1f, // Character damage multiplier; defaults to 1 if zero or less.
- // For the following modifier values: -1 = disabled (higher performance), 0 = no damage, 0.01f = 1% damage, 2 = 200% damage.
- FallOff = new FallOffDef
- {
- Distance = 2500f, // Distance at which damage begins falling off.
- MinMultipler = -1f, // Value from 0.0001f to 1f where 0.1f would be a min damage of 10% of base damage.
- },
- Grids = new GridSizeDef
- {
- Large = -1f, // Multiplier for damage against large grids.
- Small = -1f, // Multiplier for damage against small grids.
- },
- Armor = new ArmorDef
- {
- Armor = -1f, // Multiplier for damage against all armor. This is multiplied with the specific armor type multiplier (light, heavy).
- Light = -1f, // Multiplier for damage against light armor.
- Heavy = -1f, // Multiplier for damage against heavy armor.
- NonArmor = -1f, // Multiplier for damage against every else.
- },
- Shields = new ShieldDef
- {
- Modifier = -1f, // Multiplier for damage against shields.
- Type = Default, // Damage vs healing against shields; Default, Heal
- BypassModifier = -1f, // If greater than zero, the percentage of damage that will penetrate the shield.
- },
- DamageType = new DamageTypes // Damage type of each element of the projectile's damage; Kinetic, Energy
- {
- Base = Kinetic, // Base Damage uses this
- AreaEffect = Kinetic,
- Detonation = Kinetic,
- Shield = Kinetic, // Damage against shields is currently all of one type per projectile. Shield Bypass Weapons, always Deal Energy regardless of this line
- },
- Deform = new DeformDef
- {
- DeformType = HitBlock,
- DeformDelay = 30,
- },
- Custom = new CustomScalesDef
- {
- SkipOthers = NoSkip, // Controls how projectile interacts with other blocks in relation to those defined here, NoSkip, Exclusive, Inclusive.
- Types = new[] // List of blocks to apply custom damage multipliers to.
- {
- new CustomBlocksDef
- {
- SubTypeId = "Test1",
- Modifier = -1f,
- },
- new CustomBlocksDef
- {
- SubTypeId = "Test2",
- Modifier = -1f,
- },
- },
- },
- },
- AreaOfDamage = new AreaOfDamageDef
- {
- ByBlockHit = new ByBlockHitDef
- {
- Enable = false,
- Radius = 5f, // Meters
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Pooled, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- EndOfLife = new EndOfLifeDef
- {
- Enable = false,
- Radius = 5f, // Radius of AOE effect, in meters.
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Squeeze, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- ArmOnlyOnHit = false, // Detonation only is available, After it hits something, when this is true. IE, if shot down, it won't explode.
- MinArmingTime = 100, // In ticks, before the Ammo is allowed to explode, detonate or similar; This affects shrapnel spawning.
- NoVisuals = false,
- NoSound = false,
- ParticleScale = 1,
- CustomParticle = "", // Particle SubtypeID, from your Particle SBC
- CustomSound = "", // SubtypeID from your Audio SBC, not a filename
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- },
- Ewar = new EwarDef
- {
- Enable = false, // Enables EWAR effects AND DISABLES BASE DAMAGE AND AOE DAMAGE!!
- Type = EnergySink, // EnergySink, Emp, Offense, Nav, Dot, AntiSmart, JumpNull, Anchor, Tractor, Pull, Push,
- Mode = Effect, // Effect , Field
- Strength = 100f,
- Radius = 5f, // Meters
- Duration = 100, // In Ticks
- StackDuration = true, // Combined Durations
- Depletable = true,
- MaxStacks = 10, // Max Debuffs at once
- NoHitParticle = false,
- /*
- EnergySink : Targets & Shutdowns Power Supplies, such as Batteries & Reactor
- Emp : Targets & Shutdown any Block capable of being powered
- Offense : Targets & Shutdowns Weaponry
- Nav : Targets & Shutdown Gyros or Locks them down
- Dot : Deals Damage to Blocks in radius
- AntiSmart : Effects & Scrambles the Targeting List of Affected Missiles
- JumpNull : Shutdown & Stops any Active Jumps, or JumpDrive Units in radius
- Tractor : Affects target with Physics
- Pull : Affects target with Physics
- Push : Affects target with Physics
- Anchor : Targets & Shutdowns Thrusters
-
- */
- Force = new PushPullDef
- {
- ForceFrom = ProjectileLastPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- ForceTo = HitPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- Position = TargetCenterOfMass, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- DisableRelativeMass = false,
- TractorRange = 0,
- ShooterFeelsForce = false,
- },
- Field = new FieldDef
- {
- Interval = 0, // Time between each pulse, in game ticks (60 == 1 second), starts at 0 (59 == tick 60).
- PulseChance = 0, // Chance from 0 - 100 that an entity in the field will be hit by any given pulse.
- GrowTime = 0, // How many ticks it should take the field to grow to full size.
- HideModel = false, // Hide the default bubble, or other model if specified.
- ShowParticle = true, // Show Block damage effect.
- TriggerRange = 250f, //range at which fields are triggered
- Particle = new ParticleDef // Particle effect to generate at the field's position.
- {
- Name = "", // SubtypeId of field particle effect.
- Extras = new ParticleOptionDef
- {
- Scale = 1, // Scale of effect.
- },
- },
- },
- },
- Beams = new BeamDef
- {
- Enable = false, // Enable beam behaviour. Please have 3600 RPM, when this Setting is enabled. Please do not fire Beams into Voxels.
- VirtualBeams = false, // Only one damaging beam, but with the effectiveness of the visual beams combined (better performance).
- ConvergeBeams = false, // When using virtual beams, converge the visual beams to the location of the real beam.
- RotateRealBeam = false, // The real beam is rotated between all visual beams, instead of centered between them.
- OneParticle = false, // Only spawn one particle hit per beam weapon.
- },
- Trajectory = new TrajectoryDef
- {
- Guidance = None, // None, Remote, TravelTo, Smart, DetectTravelTo, DetectSmart, DetectFixed
- TargetLossDegree = 180f, // Degrees, Is pointed forward
- TargetLossTime = 0, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- MaxLifeTime = 600, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). time begins at 0 and time must EXCEED this value to trigger "time > maxValue". Please have a value for this, It stops Bad things.
- AccelPerSec = 0f, // Meters Per Second. This is the spawning Speed of the Projectile, and used by turning.
- DesiredSpeed = 500, // voxel phasing if you go above 5100
- MaxTrajectory = 2000f, // Max Distance the projectile or beam can Travel.
- DeaccelTime = 0, // 0 is disabled, a value causes the projectile to come to rest overtime, (Measured in game ticks, 60 = 1 second)
- GravityMultiplier = 0.5f, // Gravity multiplier, influences the trajectory of the projectile, value greater than 0 to enable. Natural Gravity Only.
- SpeedVariance = Random(start: 0, end: 0), // subtracts value from DesiredSpeed. Be warned, you can make your projectile go backwards.
- RangeVariance = Random(start: 0, end: 0), // subtracts value from MaxTrajectory
- MaxTrajectoryTime = 0, // How long the weapon must fire before it reaches MaxTrajectory.
- Smarts = new SmartsDef
- {
- Inaccuracy = 0f, // 0 is perfect, hit accuracy will be a random num of meters between 0 and this value.
- Aggressiveness = 1f, // controls how responsive tracking is.
- MaxLateralThrust = 0.5, // controls how sharp the trajectile may turn
- TrackingDelay = 0, // Measured in Shape diameter units traveled.
- MaxChaseTime = 0, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- OverideTarget = true, // when set to true ammo picks its own target, does not use hardpoint's.
- MaxTargets = 0, // Number of targets allowed before ending, 0 = unlimited
- NoTargetExpire = false, // Expire without ever having a target at TargetLossTime
- Roam = false, // Roam current area after target loss
- KeepAliveAfterTargetLoss = false, // Whether to stop early death of projectile on target loss
- OffsetRatio = 0.05f, // The ratio to offset the random direction (0 to 1)
- OffsetTime = 60, // how often to offset degree, measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..)
- },
- Mines = new MinesDef // Note: This is being investigated. Please report to Github, any issues.
- {
- DetectRadius = 0,
- DeCloakRadius = 0,
- FieldTime = 0,
- Cloak = false,
- Persist = false,
- },
- },
- AmmoGraphics = new GraphicDef
- {
- ModelName = "Models\\Weapons\\LargeCalibreShell.mwm", // Model Path goes here. "\\Models\\Ammo\\Starcore_Arrow_Missile_Large"
- VisualProbability = 1f, // %
- ShieldHitDraw = false,
- Decals = new DecalDef
- {
- MaxAge = 3600,
- Map = new[]
- {
- new TextureMapDef
- {
- HitMaterial = "Metal",
- DecalMaterial = "LargeShell",
- },
- new TextureMapDef
- {
- HitMaterial = "Glass",
- DecalMaterial = "LargeShell",
- },
- },
- },
- Particles = new AmmoParticleDef
- {
- Ammo = new ParticleDef
- {
- Name = "LargeCalibreGun_Tracer", //ShipWelderArc
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- },
- },
- Hit = new ParticleDef
- {
- Name = "MaterialHit_Metal_GatlingGun",
- ApplyToShield = true,
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- HitPlayChance = 1f,
- },
- },
- Eject = new ParticleDef
- {
- Name = "",
- ApplyToShield = true,
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- HitPlayChance = 1f,
- },
- },
- },
- Lines = new LineDef
- {
- ColorVariance = Random(start: 0.5f, end: 2.5f), // multiply the color by random values within range.
- WidthVariance = Random(start: 0f, end: 0.05f), // adds random value to default width (negatives shrinks width)
- Tracer = new TracerBaseDef
- {
- Enable = false,
- Length = 5f, //
- Width = 0.2f, //
- Color = Color(red: 2.5f, green: 2, blue: 1f, alpha: 1), // RBG 255 is Neon Glowing, 100 is Quite Bright.
- VisualFadeStart = 0, // Number of ticks the weapon has been firing before projectiles begin to fade their color
- VisualFadeEnd = 240, // How many ticks after fade began before it will be invisible.
- Textures = new[] {// WeaponLaser, ProjectileTrailLine, WarpBubble, etc..
- "ProjectileTrailLine", // Please always have this Line set, if this Section is enabled.
- },
- TextureMode = Normal, // Normal, Cycle, Chaos, Wave
- Segmentation = new SegmentDef
- {
- Enable = false, // If true Tracer TextureMode is ignored
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- SegmentLength = 0f, // Uses the values below.
- SegmentGap = 0f, // Uses Tracer textures and values
- Speed = 1f, // meters per second
- Color = Color(red: 1, green: 2, blue: 2.5f, alpha: 1),
- WidthMultiplier = 1f,
- Reverse = false,
- UseLineVariance = true,
- WidthVariance = Random(start: 0f, end: 0f),
- ColorVariance = Random(start: 0f, end: 0f)
- }
- },
- Trail = new TrailDef
- {
- Enable = false,
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- TextureMode = Normal,
- DecayTime = 3, // In Ticks. 1 = 1 Additional Tracer generated per motion, 33 is 33 lines drawn per projectile. Keep this number low.
- Color = Color(red: 0, green: 0, blue: 1, alpha: 1),
- Back = false,
- CustomWidth = 0,
- UseWidthVariance = false,
- UseColorFade = true,
- },
- OffsetEffect = new OffsetEffectDef
- {
- MaxOffset = 0,// 0 offset value disables this effect
- MinLength = 0.2f,
- MaxLength = 3,
- },
- },
- },
- AmmoAudio = new AmmoAudioDef
- {
- TravelSound = "HeavyShellFlightSound", // SubtypeID for your Sound File. Travel, is sound generated around your Projectile in flight
- HitSound = "ImpMetalMetalCat0",
- ShotSound = "",
- ShieldHitSound = "",
- PlayerHitSound = "",
- VoxelHitSound = "ImpMetalRockCat0",
- FloatingHitSound = "",
- HitPlayChance = 1f,
- HitPlayShield = true,
- },
- Ejection = new EjectionDef // Optional Component, allows generation of Particle or Item (Typically magazine), on firing, to simulate Tank shell ejection
- {
- Type = Particle, // Particle or Item (Inventory Component)
- Speed = 100f, // Speed inventory is ejected from in dummy direction
- SpawnChance = 0.5f, // chance of triggering effect (0 - 1)
- CompDef = new ComponentDef
- {
- ItemName = "", //InventoryComponent name
- ItemLifeTime = 0, // how long item should exist in world
- Delay = 0, // delay in ticks after shot before ejected
- }
- }, // Don't edit below this line
- };
-
- private AmmoDef LargeRailgunSabot => new AmmoDef // Your ID, for slotting into the Weapon CS
- {
- AmmoMagazine = "LargeRailgunAmmo", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo.
- AmmoRound = "Large Railgun Slug", // Name of ammo in terminal, should be different for each ammo type used by the same weapon. Is used by Shrapnel.
- HybridRound = true, // Use both a physical ammo magazine and energy per shot.
- EnergyCost = 0.1368f, // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR.
- BaseDamage = 50000f, // Direct damage; one steel plate is worth 100.
- Mass = 100f, // In kilograms; how much force the impact will apply to the target.
- Health = 0, // How much damage the projectile can take from other projectiles (base of 1 per hit) before dying; 0 disables this and makes the projectile untargetable.
- BackKickForce = 120000f, // Recoil. This is applied to the Parent Grid.
- DecayPerShot = 0f, // Damage to the firing weapon itself.
- HardPointUsable = true, // Whether this is a primary ammo type fired directly by the turret. Set to false if this is a shrapnel ammoType and you don't want the turret to be able to select it directly.
- EnergyMagazineSize = 0, // For energy weapons, how many shots to fire before reloading.
- IgnoreWater = false, // Whether the projectile should be able to penetrate water when using WaterMod.
- IgnoreVoxels = false, // Whether the projectile should be able to penetrate voxels.
- Synchronize = false, // For future use
- HeatModifier = -1f, // Allows this ammo to modify the amount of heat the weapon produces per shot.
- Shape = new ShapeDef // Defines the collision shape of the projectile, defaults to LineShape and uses the visual Line Length if set to 0.
- {
- Shape = LineShape, // LineShape or SphereShape. Do not use SphereShape for fast moving projectiles if you care about precision.
- Diameter = 0, // Diameter is minimum length of LineShape or minimum diameter of SphereShape.
- },
- ObjectsHit = new ObjectsHitDef
- {
- MaxObjectsHit = 0, // Limits the number of entities (grids, players, projectiles) the projectile can penetrate; 0 = unlimited.
- CountBlocks = false, // Counts individual blocks, not just entities hit.
- },
- Fragment = new FragmentDef // Formerly known as Shrapnel. Spawns specified ammo fragments on projectile death (via hit or detonation).
- {
- AmmoRound = "", // AmmoRound field of the ammo to spawn.
- Fragments = 0, // Number of projectiles to spawn.
- Degrees = 0, // Cone in which to randomize direction of spawned projectiles.
- Reverse = false, // Spawn projectiles backward instead of forward.
- DropVelocity = false, // fragments will not inherit velocity from parent.
- Offset = 0f, // Offsets the fragment spawn by this amount, in meters (positive forward, negative for backwards), value is read from parent ammo type.
- Radial = 0f, // Determines starting angle for Degrees of spread above. IE, 0 degrees and 90 radial goes perpendicular to travel path
- MaxChildren = 0, // number of maximum branches for fragments from the roots point of view, 0 is unlimited
- IgnoreArming = true, // If true, ignore ArmOnHit or MinArmingTime in EndOfLife definitions
- AdvOffset = Vector(x: 0, y: 0, z: 0), // advanced offsets the fragment by xyz coordinates relative to parent, value is read from fragment ammo type.
- TimedSpawns = new TimedSpawnDef // disables FragOnEnd in favor of info specified below
- {
- Enable = false, // Enables TimedSpawns mechanism
- Interval = 0, // Time between spawning fragments, in ticks, 0 means every tick, 1 means every other
- StartTime = 0, // Time delay to start spawning fragments, in ticks, of total projectile life
- MaxSpawns = 1, // Max number of fragment children to spawn
- Proximity = 1000, // Starting distance from target bounding sphere to start spawning fragments, 0 disables this feature. No spawning outside this distance
- ParentDies = true, // Parent dies once after it spawns its last child.
- PointAtTarget = true, // Start fragment direction pointing at Target
- PointType = Predict, // Point accuracy, Direct, Lead (always fire), Predict (only fire if it can hit)
- GroupSize = 5, // Number of spawns in each group
- GroupDelay = 120, // Delay between each group.
- },
- },
- Pattern = new PatternDef
- {
- Patterns = new[] { // If enabled, set of multiple ammos to fire in order instead of the main ammo.
- "",
- },
- Mode = Fragment, // Select when to activate this pattern, options: Never, Weapon, Fragment, Both
- TriggerChance = 1f, // This is %
- Random = false, // This randomizes the number spawned at once, NOT the list order.
- RandomMin = 1,
- RandomMax = 1,
- SkipParent = false, // Skip the Ammo itself, in the list
- PatternSteps = 1, // Number of Ammos activated per round, will progress in order and loop. Ignored if Random = true.
- },
- DamageScales = new DamageScaleDef
- {
- MaxIntegrity = 0f, // Blocks with integrity higher than this value will be immune to damage from this projectile; 0 = disabled.
- DamageVoxels = false, // Whether to damage voxels.
- SelfDamage = false, // Whether to damage the weapon's own grid.
- HealthHitModifier = 10, // How much Health to subtract from another projectile on hit; defaults to 1 if zero or less.
- VoxelHitModifier = 1, // Voxel damage multiplier; defaults to 1 if zero or less.
- Characters = 1f, // Character damage multiplier; defaults to 1 if zero or less.
- // For the following modifier values: -1 = disabled (higher performance), 0 = no damage, 0.01f = 1% damage, 2 = 200% damage.
- FallOff = new FallOffDef
- {
- Distance = 3500f, // Distance at which damage begins falling off.
- MinMultipler = -1f, // Value from 0.0001f to 1f where 0.1f would be a min damage of 10% of base damage.
- },
- Grids = new GridSizeDef
- {
- Large = -1f, // Multiplier for damage against large grids.
- Small = -1f, // Multiplier for damage against small grids.
- },
- Armor = new ArmorDef
- {
- Armor = -1f, // Multiplier for damage against all armor. This is multiplied with the specific armor type multiplier (light, heavy).
- Light = -1f, // Multiplier for damage against light armor.
- Heavy = -1f, // Multiplier for damage against heavy armor.
- NonArmor = -1f, // Multiplier for damage against every else.
- },
- Shields = new ShieldDef
- {
- Modifier = -1f, // Multiplier for damage against shields.
- Type = Default, // Damage vs healing against shields; Default, Heal
- BypassModifier = -1f, // If greater than zero, the percentage of damage that will penetrate the shield.
- },
- DamageType = new DamageTypes // Damage type of each element of the projectile's damage; Kinetic, Energy
- {
- Base = Kinetic, // Base Damage uses this
- AreaEffect = Kinetic,
- Detonation = Kinetic,
- Shield = Kinetic, // Damage against shields is currently all of one type per projectile. Shield Bypass Weapons, always Deal Energy regardless of this line
- },
- Deform = new DeformDef
- {
- DeformType = HitBlock,
- DeformDelay = 30,
- },
- Custom = new CustomScalesDef
- {
- SkipOthers = NoSkip, // Controls how projectile interacts with other blocks in relation to those defined here, NoSkip, Exclusive, Inclusive.
- Types = new[] // List of blocks to apply custom damage multipliers to.
- {
- new CustomBlocksDef
- {
- SubTypeId = "Test1",
- Modifier = -1f,
- },
- new CustomBlocksDef
- {
- SubTypeId = "Test2",
- Modifier = -1f,
- },
- },
- },
- },
- AreaOfDamage = new AreaOfDamageDef
- {
- ByBlockHit = new ByBlockHitDef
- {
- Enable = false,
- Radius = 5f, // Meters
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Pooled, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- EndOfLife = new EndOfLifeDef
- {
- Enable = false,
- Radius = 5f, // Radius of AOE effect, in meters.
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Squeeze, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- ArmOnlyOnHit = false, // Detonation only is available, After it hits something, when this is true. IE, if shot down, it won't explode.
- MinArmingTime = 100, // In ticks, before the Ammo is allowed to explode, detonate or similar; This affects shrapnel spawning.
- NoVisuals = false,
- NoSound = false,
- ParticleScale = 1,
- CustomParticle = "", // Particle SubtypeID, from your Particle SBC
- CustomSound = "", // SubtypeID from your Audio SBC, not a filename
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- },
- Ewar = new EwarDef
- {
- Enable = false, // Enables EWAR effects AND DISABLES BASE DAMAGE AND AOE DAMAGE!!
- Type = EnergySink, // EnergySink, Emp, Offense, Nav, Dot, AntiSmart, JumpNull, Anchor, Tractor, Pull, Push,
- Mode = Effect, // Effect , Field
- Strength = 100f,
- Radius = 5f, // Meters
- Duration = 100, // In Ticks
- StackDuration = true, // Combined Durations
- Depletable = true,
- MaxStacks = 10, // Max Debuffs at once
- NoHitParticle = false,
- /*
- EnergySink : Targets & Shutdowns Power Supplies, such as Batteries & Reactor
- Emp : Targets & Shutdown any Block capable of being powered
- Offense : Targets & Shutdowns Weaponry
- Nav : Targets & Shutdown Gyros or Locks them down
- Dot : Deals Damage to Blocks in radius
- AntiSmart : Effects & Scrambles the Targeting List of Affected Missiles
- JumpNull : Shutdown & Stops any Active Jumps, or JumpDrive Units in radius
- Tractor : Affects target with Physics
- Pull : Affects target with Physics
- Push : Affects target with Physics
- Anchor : Targets & Shutdowns Thrusters
-
- */
- Force = new PushPullDef
- {
- ForceFrom = ProjectileLastPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- ForceTo = HitPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- Position = TargetCenterOfMass, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- DisableRelativeMass = false,
- TractorRange = 0,
- ShooterFeelsForce = false,
+ HitMaterial = "Metal",
+ DecalMaterial = "GunBullet",
+ },
+ new TextureMapDef
+ {
+ HitMaterial = "Glass",
+ DecalMaterial = "GunBullet",
+ },
+ },
},
- Field = new FieldDef
+ Particles = new AmmoParticleDef
{
- Interval = 0, // Time between each pulse, in game ticks (60 == 1 second), starts at 0 (59 == tick 60).
- PulseChance = 0, // Chance from 0 - 100 that an entity in the field will be hit by any given pulse.
- GrowTime = 0, // How many ticks it should take the field to grow to full size.
- HideModel = false, // Hide the default bubble, or other model if specified.
- ShowParticle = true, // Show Block damage effect.
- TriggerRange = 250f, //range at which fields are triggered
- Particle = new ParticleDef // Particle effect to generate at the field's position.
+ Ammo = new ParticleDef
+ {
+ Name = "MediumCalibreGun_Tracer", //ShipWelderArc
+ Extras = new ParticleOptionDef
+ {
+ Scale = 1,
+ },
+ },
+ Hit = new ParticleDef
{
- Name = "", // SubtypeId of field particle effect.
+ Name = "MaterialHit_Metal_GatlingGun",
+ ApplyToShield = true,
Extras = new ParticleOptionDef
{
- Scale = 1, // Scale of effect.
+ Scale = 1,
+ HitPlayChance = 1f,
},
},
},
},
- Beams = new BeamDef
+ AmmoAudio = new AmmoAudioDef
{
- Enable = false, // Enable beam behaviour. Please have 3600 RPM, when this Setting is enabled. Please do not fire Beams into Voxels.
- VirtualBeams = false, // Only one damaging beam, but with the effectiveness of the visual beams combined (better performance).
- ConvergeBeams = false, // When using virtual beams, converge the visual beams to the location of the real beam.
- RotateRealBeam = false, // The real beam is rotated between all visual beams, instead of centered between them.
- OneParticle = false, // Only spawn one particle hit per beam weapon.
+ TravelSound = "MediumShellFlightSound", // SubtypeID for your Sound File. Travel, is sound generated around your Projectile in flight
+ HitSound = "ImpMetalMetalCat0",
+ VoxelHitSound = "ImpMetalRockCat0",
+ HitPlayChance = 1f,
+ HitPlayShield = true,
},
+ };
+
+ private AmmoDef ArtilleryShell => new AmmoDef // Your ID, for slotting into the Weapon CS
+ {
+ AmmoMagazine = "LargeCalibreAmmo", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo.
+ AmmoRound = "Artillery Shell", // Name of ammo in terminal, should be different for each ammo type used by the same weapon. Is used by Shrapnel.
+ BaseDamage = 17000f, // Direct damage; one steel plate is worth 100.
+ Mass = 800f, // In kilograms; how much force the impact will apply to the target.
+ BackKickForce = 30000f, // Recoil. This is applied to the Parent Grid.
+ HardPointUsable = true, // Whether this is a primary ammo type fired directly by the turret. Set to false if this is a shrapnel ammoType and you don't want the turret to be able to select it directly.
+ NoGridOrArmorScaling = true,
Trajectory = new TrajectoryDef
{
Guidance = None, // None, Remote, TravelTo, Smart, DetectTravelTo, DetectSmart, DetectFixed
- TargetLossDegree = 180f, // Degrees, Is pointed forward
- TargetLossTime = 0, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- MaxLifeTime = 300, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). time begins at 0 and time must EXCEED this value to trigger "time > maxValue". Please have a value for this, It stops Bad things.
- AccelPerSec = 0f, // Meters Per Second. This is the spawning Speed of the Projectile, and used by turning.
- DesiredSpeed = 2000, // voxel phasing if you go above 5100
+ MaxLifeTime = 600, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). time begins at 0 and time must EXCEED this value to trigger "time > maxValue". Please have a value for this, It stops Bad things.
+ DesiredSpeed = 500, // voxel phasing if you go above 5100
MaxTrajectory = 2000f, // Max Distance the projectile or beam can Travel.
- DeaccelTime = 0, // 0 is disabled, a value causes the projectile to come to rest overtime, (Measured in game ticks, 60 = 1 second)
- GravityMultiplier = 1f, // Gravity multiplier, influences the trajectory of the projectile, value greater than 0 to enable. Natural Gravity Only.
- SpeedVariance = Random(start: 0, end: 0), // subtracts value from DesiredSpeed. Be warned, you can make your projectile go backwards.
- RangeVariance = Random(start: 0, end: 0), // subtracts value from MaxTrajectory
- MaxTrajectoryTime = 0, // How long the weapon must fire before it reaches MaxTrajectory.
- Smarts = new SmartsDef
- {
- Inaccuracy = 0f, // 0 is perfect, hit accuracy will be a random num of meters between 0 and this value.
- Aggressiveness = 1f, // controls how responsive tracking is.
- MaxLateralThrust = 0.5, // controls how sharp the trajectile may turn
- TrackingDelay = 0, // Measured in Shape diameter units traveled.
- MaxChaseTime = 0, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- OverideTarget = true, // when set to true ammo picks its own target, does not use hardpoint's.
- MaxTargets = 0, // Number of targets allowed before ending, 0 = unlimited
- NoTargetExpire = false, // Expire without ever having a target at TargetLossTime
- Roam = false, // Roam current area after target loss
- KeepAliveAfterTargetLoss = false, // Whether to stop early death of projectile on target loss
- OffsetRatio = 0.05f, // The ratio to offset the random direction (0 to 1)
- OffsetTime = 60, // how often to offset degree, measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..)
- },
- Mines = new MinesDef // Note: This is being investigated. Please report to Github, any issues.
- {
- DetectRadius = 0,
- DeCloakRadius = 0,
- FieldTime = 0,
- Cloak = false,
- Persist = false,
- },
+ GravityMultiplier = 0.5f, // Gravity multiplier, influences the trajectory of the projectile, value greater than 0 to enable. Natural Gravity Only.
},
AmmoGraphics = new GraphicDef
{
- ModelName = "Models\\Weapons\\RailgunAmmoLarge.mwm", // Model Path goes here. "\\Models\\Ammo\\Starcore_Arrow_Missile_Large"
+ ModelName = "Models\\Weapons\\LargeCalibreShell.mwm", // Model Path goes here. "\\Models\\Ammo\\Starcore_Arrow_Missile_Large"
VisualProbability = 1f, // %
ShieldHitDraw = false,
Decals = new DecalDef
@@ -3166,12 +761,12 @@ partial class Parts
{
new TextureMapDef
{
- HitMaterial = "Glass",
+ HitMaterial = "Metal",
DecalMaterial = "LargeShell",
},
new TextureMapDef
{
- HitMaterial = "Metal",
+ HitMaterial = "Glass",
DecalMaterial = "LargeShell",
},
},
@@ -3180,7 +775,7 @@ partial class Parts
{
Ammo = new ParticleDef
{
- Name = "", //ShipWelderArc
+ Name = "LargeCalibreGun_Tracer", //ShipWelderArc
Offset = Vector(x: 0, y: 0, z: 0),
Extras = new ParticleOptionDef
{
@@ -3198,11 +793,65 @@ partial class Parts
HitPlayChance = 1f,
},
},
- Eject = new ParticleDef
+ },
+ },
+ AmmoAudio = new AmmoAudioDef
+ {
+ TravelSound = "HeavyShellFlightSound", // SubtypeID for your Sound File. Travel, is sound generated around your Projectile in flight
+ HitSound = "ImpMetalMetalCat0",
+ VoxelHitSound = "ImpMetalRockCat0",
+ HitPlayChance = 1f,
+ HitPlayShield = true,
+ },
+ };
+
+ private AmmoDef LargeRailgunSabot => new AmmoDef // Your ID, for slotting into the Weapon CS
+ {
+ AmmoMagazine = "LargeRailgunAmmo", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo.
+ AmmoRound = "Large Railgun Slug", // Name of ammo in terminal, should be different for each ammo type used by the same weapon. Is used by Shrapnel.
+ HybridRound = true, // Use both a physical ammo magazine and energy per shot.
+ EnergyCost = 0.1368f, // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR.
+ BaseDamage = 50000f, // Direct damage; one steel plate is worth 100.
+ Mass = 100f, // In kilograms; how much force the impact will apply to the target.
+ BackKickForce = 120000f, // Recoil. This is applied to the Parent Grid.
+ HardPointUsable = true, // Whether this is a primary ammo type fired directly by the turret. Set to false if this is a shrapnel ammoType and you don't want the turret to be able to select it directly.
+ NoGridOrArmorScaling = true,
+ Trajectory = new TrajectoryDef
+ {
+ MaxLifeTime = 300, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). time begins at 0 and time must EXCEED this value to trigger "time > maxValue". Please have a value for this, It stops Bad things.
+ DesiredSpeed = 2000, // voxel phasing if you go above 5100
+ MaxTrajectory = 2000f, // Max Distance the projectile or beam can Travel.
+ SpeedVariance = Random(start: 0, end: 0), // subtracts value from DesiredSpeed. Be warned, you can make your projectile go backwards.
+ RangeVariance = Random(start: 0, end: 0), // subtracts value from MaxTrajectory
+ MaxTrajectoryTime = 0, // How long the weapon must fire before it reaches MaxTrajectory.
+ },
+ AmmoGraphics = new GraphicDef
+ {
+ ModelName = "Models\\Weapons\\RailgunAmmoLarge.mwm", // Model Path goes here. "\\Models\\Ammo\\Starcore_Arrow_Missile_Large"
+ VisualProbability = 1f, // %
+ Decals = new DecalDef
+ {
+ MaxAge = 3600,
+ Map = new[]
+ {
+ new TextureMapDef
+ {
+ HitMaterial = "Glass",
+ DecalMaterial = "LargeShell",
+ },
+ new TextureMapDef
+ {
+ HitMaterial = "Metal",
+ DecalMaterial = "LargeShell",
+ },
+ },
+ },
+ Particles = new AmmoParticleDef
+ {
+ Hit = new ParticleDef
{
- Name = "",
+ Name = "MaterialHit_Metal_GatlingGun",
ApplyToShield = true,
- Offset = Vector(x: 0, y: 0, z: 0),
Extras = new ParticleOptionDef
{
Scale = 1,
@@ -3220,28 +869,11 @@ partial class Parts
Length = 80f, //
Width = 0.3f, //
Color = Color(red: 20f, green: 20f, blue: 40f, alpha: 1f), // RBG 255 is Neon Glowing, 100 is Quite Bright.
- VisualFadeStart = 0, // Number of ticks the weapon has been firing before projectiles begin to fade their color
VisualFadeEnd = 240, // How many ticks after fade began before it will be invisible.
Textures = new[] {// WeaponLaser, ProjectileTrailLine, WarpBubble, etc..
"WeaponLaser", // Please always have this Line set, if this Section is enabled.
},
TextureMode = Normal, // Normal, Cycle, Chaos, Wave
- Segmentation = new SegmentDef
- {
- Enable = false, // If true Tracer TextureMode is ignored
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- SegmentLength = 0f, // Uses the values below.
- SegmentGap = 0f, // Uses Tracer textures and values
- Speed = 1f, // meters per second
- Color = Color(red: 1, green: 2, blue: 2.5f, alpha: 1),
- WidthMultiplier = 1f,
- Reverse = false,
- UseLineVariance = true,
- WidthVariance = Random(start: 0f, end: 0f),
- ColorVariance = Random(start: 0f, end: 0f)
- }
},
Trail = new TrailDef
{
@@ -3252,9 +884,7 @@ partial class Parts
TextureMode = Normal,
DecayTime = 30, // In Ticks. 1 = 1 Additional Tracer generated per motion, 33 is 33 lines drawn per projectile. Keep this number low.
Color = Color(red: 15f, green: 15f, blue: 30f, alpha: 1f),
- Back = false,
CustomWidth = 0.3f,
- UseWidthVariance = false,
UseColorFade = true,
},
OffsetEffect = new OffsetEffectDef
@@ -3269,26 +899,10 @@ partial class Parts
{
TravelSound = "HeavyShellFlightSound", // SubtypeID for your Sound File. Travel, is sound generated around your Projectile in flight
HitSound = "ImpMetalMetalCat0",
- ShotSound = "",
- ShieldHitSound = "",
- PlayerHitSound = "",
VoxelHitSound = "ImpMetalRockCat0",
- FloatingHitSound = "",
HitPlayChance = 1f,
HitPlayShield = true,
},
- Ejection = new EjectionDef // Optional Component, allows generation of Particle or Item (Typically magazine), on firing, to simulate Tank shell ejection
- {
- Type = Particle, // Particle or Item (Inventory Component)
- Speed = 100f, // Speed inventory is ejected from in dummy direction
- SpawnChance = 0.5f, // chance of triggering effect (0 - 1)
- CompDef = new ComponentDef
- {
- ItemName = "", //InventoryComponent name
- ItemLifeTime = 0, // how long item should exist in world
- Delay = 0, // delay in ticks after shot before ejected
- }
- }, // Don't edit below this line
};
private AmmoDef SmallRailgunSabot => new AmmoDef // Your ID, for slotting into the Weapon CS
@@ -3299,266 +913,14 @@ partial class Parts
EnergyCost = 0.081f, // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR.
BaseDamage = 8000f, // Direct damage; one steel plate is worth 100.
Mass = 25f, // In kilograms; how much force the impact will apply to the target.
- Health = 0, // How much damage the projectile can take from other projectiles (base of 1 per hit) before dying; 0 disables this and makes the projectile untargetable.
BackKickForce = 30000f, // Recoil. This is applied to the Parent Grid.
- DecayPerShot = 0f, // Damage to the firing weapon itself.
HardPointUsable = true, // Whether this is a primary ammo type fired directly by the turret. Set to false if this is a shrapnel ammoType and you don't want the turret to be able to select it directly.
- EnergyMagazineSize = 0, // For energy weapons, how many shots to fire before reloading.
- IgnoreWater = false, // Whether the projectile should be able to penetrate water when using WaterMod.
- IgnoreVoxels = false, // Whether the projectile should be able to penetrate voxels.
- Synchronize = false, // For future use
- HeatModifier = -1f, // Allows this ammo to modify the amount of heat the weapon produces per shot.
- Shape = new ShapeDef // Defines the collision shape of the projectile, defaults to LineShape and uses the visual Line Length if set to 0.
- {
- Shape = LineShape, // LineShape or SphereShape. Do not use SphereShape for fast moving projectiles if you care about precision.
- Diameter = 0, // Diameter is minimum length of LineShape or minimum diameter of SphereShape.
- },
- ObjectsHit = new ObjectsHitDef
- {
- MaxObjectsHit = 0, // Limits the number of entities (grids, players, projectiles) the projectile can penetrate; 0 = unlimited.
- CountBlocks = false, // Counts individual blocks, not just entities hit.
- },
- Fragment = new FragmentDef // Formerly known as Shrapnel. Spawns specified ammo fragments on projectile death (via hit or detonation).
- {
- AmmoRound = "", // AmmoRound field of the ammo to spawn.
- Fragments = 0, // Number of projectiles to spawn.
- Degrees = 0, // Cone in which to randomize direction of spawned projectiles.
- Reverse = false, // Spawn projectiles backward instead of forward.
- DropVelocity = false, // fragments will not inherit velocity from parent.
- Offset = 0f, // Offsets the fragment spawn by this amount, in meters (positive forward, negative for backwards), value is read from parent ammo type.
- Radial = 0f, // Determines starting angle for Degrees of spread above. IE, 0 degrees and 90 radial goes perpendicular to travel path
- MaxChildren = 0, // number of maximum branches for fragments from the roots point of view, 0 is unlimited
- IgnoreArming = true, // If true, ignore ArmOnHit or MinArmingTime in EndOfLife definitions
- AdvOffset = Vector(x: 0, y: 0, z: 0), // advanced offsets the fragment by xyz coordinates relative to parent, value is read from fragment ammo type.
- TimedSpawns = new TimedSpawnDef // disables FragOnEnd in favor of info specified below
- {
- Enable = false, // Enables TimedSpawns mechanism
- Interval = 0, // Time between spawning fragments, in ticks, 0 means every tick, 1 means every other
- StartTime = 0, // Time delay to start spawning fragments, in ticks, of total projectile life
- MaxSpawns = 1, // Max number of fragment children to spawn
- Proximity = 1000, // Starting distance from target bounding sphere to start spawning fragments, 0 disables this feature. No spawning outside this distance
- ParentDies = true, // Parent dies once after it spawns its last child.
- PointAtTarget = true, // Start fragment direction pointing at Target
- PointType = Predict, // Point accuracy, Direct, Lead (always fire), Predict (only fire if it can hit)
- GroupSize = 5, // Number of spawns in each group
- GroupDelay = 120, // Delay between each group.
- },
- },
- Pattern = new PatternDef
- {
- Patterns = new[] { // If enabled, set of multiple ammos to fire in order instead of the main ammo.
- "",
- },
- Mode = Fragment, // Select when to activate this pattern, options: Never, Weapon, Fragment, Both
- TriggerChance = 1f, // This is %
- Random = false, // This randomizes the number spawned at once, NOT the list order.
- RandomMin = 1,
- RandomMax = 1,
- SkipParent = false, // Skip the Ammo itself, in the list
- PatternSteps = 1, // Number of Ammos activated per round, will progress in order and loop. Ignored if Random = true.
- },
- DamageScales = new DamageScaleDef
- {
- MaxIntegrity = 0f, // Blocks with integrity higher than this value will be immune to damage from this projectile; 0 = disabled.
- DamageVoxels = false, // Whether to damage voxels.
- SelfDamage = false, // Whether to damage the weapon's own grid.
- HealthHitModifier = 2.5, // How much Health to subtract from another projectile on hit; defaults to 1 if zero or less.
- VoxelHitModifier = 1, // Voxel damage multiplier; defaults to 1 if zero or less.
- Characters = 1f, // Character damage multiplier; defaults to 1 if zero or less.
- // For the following modifier values: -1 = disabled (higher performance), 0 = no damage, 0.01f = 1% damage, 2 = 200% damage.
- FallOff = new FallOffDef
- {
- Distance = 2500f, // Distance at which damage begins falling off.
- MinMultipler = -1f, // Value from 0.0001f to 1f where 0.1f would be a min damage of 10% of base damage.
- },
- Grids = new GridSizeDef
- {
- Large = -1f, // Multiplier for damage against large grids.
- Small = -1f, // Multiplier for damage against small grids.
- },
- Armor = new ArmorDef
- {
- Armor = -1f, // Multiplier for damage against all armor. This is multiplied with the specific armor type multiplier (light, heavy).
- Light = -1f, // Multiplier for damage against light armor.
- Heavy = -1f, // Multiplier for damage against heavy armor.
- NonArmor = -1f, // Multiplier for damage against every else.
- },
- Shields = new ShieldDef
- {
- Modifier = -1f, // Multiplier for damage against shields.
- Type = Default, // Damage vs healing against shields; Default, Heal
- BypassModifier = -1f, // If greater than zero, the percentage of damage that will penetrate the shield.
- },
- DamageType = new DamageTypes // Damage type of each element of the projectile's damage; Kinetic, Energy
- {
- Base = Kinetic, // Base Damage uses this
- AreaEffect = Kinetic,
- Detonation = Kinetic,
- Shield = Kinetic, // Damage against shields is currently all of one type per projectile. Shield Bypass Weapons, always Deal Energy regardless of this line
- },
- Deform = new DeformDef
- {
- DeformType = HitBlock,
- DeformDelay = 30,
- },
- Custom = new CustomScalesDef
- {
- SkipOthers = NoSkip, // Controls how projectile interacts with other blocks in relation to those defined here, NoSkip, Exclusive, Inclusive.
- Types = new[] // List of blocks to apply custom damage multipliers to.
- {
- new CustomBlocksDef
- {
- SubTypeId = "Test1",
- Modifier = -1f,
- },
- new CustomBlocksDef
- {
- SubTypeId = "Test2",
- Modifier = -1f,
- },
- },
- },
- },
- AreaOfDamage = new AreaOfDamageDef
- {
- ByBlockHit = new ByBlockHitDef
- {
- Enable = false,
- Radius = 5f, // Meters
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Pooled, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- EndOfLife = new EndOfLifeDef
- {
- Enable = false,
- Radius = 5f, // Radius of AOE effect, in meters.
- Damage = 5f,
- Depth = 1f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value
- MaxAbsorb = 0f, // Soft cutoff for damage, except for pooled falloff. If pooled falloff, limits max damage per block.
- Falloff = Squeeze, //.NoFalloff applies the same damage to all blocks in radius
- //.Linear drops evenly by distance from center out to max radius
- //.Curve drops off damage sharply as it approaches the max radius
- //.InvCurve drops off sharply from the middle and tapers to max radius
- //.Squeeze does little damage to the middle, but rapidly increases damage toward max radius
- //.Pooled damage behaves in a pooled manner that once exhausted damage ceases.
- //.Exponential drops off exponentially. Does not scale to max radius
- ArmOnlyOnHit = false, // Detonation only is available, After it hits something, when this is true. IE, if shot down, it won't explode.
- MinArmingTime = 100, // In ticks, before the Ammo is allowed to explode, detonate or similar; This affects shrapnel spawning.
- NoVisuals = false,
- NoSound = false,
- ParticleScale = 1,
- CustomParticle = "", // Particle SubtypeID, from your Particle SBC
- CustomSound = "", // SubtypeID from your Audio SBC, not a filename
- Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly.
- },
- },
- Ewar = new EwarDef
- {
- Enable = false, // Enables EWAR effects AND DISABLES BASE DAMAGE AND AOE DAMAGE!!
- Type = EnergySink, // EnergySink, Emp, Offense, Nav, Dot, AntiSmart, JumpNull, Anchor, Tractor, Pull, Push,
- Mode = Effect, // Effect , Field
- Strength = 100f,
- Radius = 5f, // Meters
- Duration = 100, // In Ticks
- StackDuration = true, // Combined Durations
- Depletable = true,
- MaxStacks = 10, // Max Debuffs at once
- NoHitParticle = false,
- /*
- EnergySink : Targets & Shutdowns Power Supplies, such as Batteries & Reactor
- Emp : Targets & Shutdown any Block capable of being powered
- Offense : Targets & Shutdowns Weaponry
- Nav : Targets & Shutdown Gyros or Locks them down
- Dot : Deals Damage to Blocks in radius
- AntiSmart : Effects & Scrambles the Targeting List of Affected Missiles
- JumpNull : Shutdown & Stops any Active Jumps, or JumpDrive Units in radius
- Tractor : Affects target with Physics
- Pull : Affects target with Physics
- Push : Affects target with Physics
- Anchor : Targets & Shutdowns Thrusters
-
- */
- Force = new PushPullDef
- {
- ForceFrom = ProjectileLastPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- ForceTo = HitPosition, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- Position = TargetCenterOfMass, // ProjectileLastPosition, ProjectileOrigin, HitPosition, TargetCenter, TargetCenterOfMass
- DisableRelativeMass = false,
- TractorRange = 0,
- ShooterFeelsForce = false,
- },
- Field = new FieldDef
- {
- Interval = 0, // Time between each pulse, in game ticks (60 == 1 second), starts at 0 (59 == tick 60).
- PulseChance = 0, // Chance from 0 - 100 that an entity in the field will be hit by any given pulse.
- GrowTime = 0, // How many ticks it should take the field to grow to full size.
- HideModel = false, // Hide the default bubble, or other model if specified.
- ShowParticle = true, // Show Block damage effect.
- TriggerRange = 250f, //range at which fields are triggered
- Particle = new ParticleDef // Particle effect to generate at the field's position.
- {
- Name = "", // SubtypeId of field particle effect.
- Extras = new ParticleOptionDef
- {
- Scale = 1, // Scale of effect.
- },
- },
- },
- },
- Beams = new BeamDef
- {
- Enable = false, // Enable beam behaviour. Please have 3600 RPM, when this Setting is enabled. Please do not fire Beams into Voxels.
- VirtualBeams = false, // Only one damaging beam, but with the effectiveness of the visual beams combined (better performance).
- ConvergeBeams = false, // When using virtual beams, converge the visual beams to the location of the real beam.
- RotateRealBeam = false, // The real beam is rotated between all visual beams, instead of centered between them.
- OneParticle = false, // Only spawn one particle hit per beam weapon.
- },
+ NoGridOrArmorScaling = true,
Trajectory = new TrajectoryDef
{
- Guidance = None, // None, Remote, TravelTo, Smart, DetectTravelTo, DetectSmart, DetectFixed
- TargetLossDegree = 180f, // Degrees, Is pointed forward
- TargetLossTime = 0, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MaxLifeTime = 300, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). time begins at 0 and time must EXCEED this value to trigger "time > maxValue". Please have a value for this, It stops Bad things.
- AccelPerSec = 0f, // Meters Per Second. This is the spawning Speed of the Projectile, and used by turning.
DesiredSpeed = 1000, // voxel phasing if you go above 5100
MaxTrajectory = 1400f, // Max Distance the projectile or beam can Travel.
- DeaccelTime = 0, // 0 is disabled, a value causes the projectile to come to rest overtime, (Measured in game ticks, 60 = 1 second)
- GravityMultiplier = 1f, // Gravity multiplier, influences the trajectory of the projectile, value greater than 0 to enable. Natural Gravity Only.
- SpeedVariance = Random(start: 0, end: 0), // subtracts value from DesiredSpeed. Be warned, you can make your projectile go backwards.
- RangeVariance = Random(start: 0, end: 0), // subtracts value from MaxTrajectory
- MaxTrajectoryTime = 0, // How long the weapon must fire before it reaches MaxTrajectory.
- Smarts = new SmartsDef
- {
- Inaccuracy = 0f, // 0 is perfect, hit accuracy will be a random num of meters between 0 and this value.
- Aggressiveness = 1f, // controls how responsive tracking is.
- MaxLateralThrust = 0.5, // controls how sharp the trajectile may turn
- TrackingDelay = 0, // Measured in Shape diameter units traveled.
- MaxChaseTime = 0, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- OverideTarget = true, // when set to true ammo picks its own target, does not use hardpoint's.
- MaxTargets = 0, // Number of targets allowed before ending, 0 = unlimited
- NoTargetExpire = false, // Expire without ever having a target at TargetLossTime
- Roam = false, // Roam current area after target loss
- KeepAliveAfterTargetLoss = false, // Whether to stop early death of projectile on target loss
- OffsetRatio = 0.05f, // The ratio to offset the random direction (0 to 1)
- OffsetTime = 60, // how often to offset degree, measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..)
- },
- Mines = new MinesDef // Note: This is being investigated. Please report to Github, any issues.
- {
- DetectRadius = 0,
- DeCloakRadius = 0,
- FieldTime = 0,
- Cloak = false,
- Persist = false,
- },
},
AmmoGraphics = new GraphicDef
{
@@ -3584,15 +946,6 @@ partial class Parts
},
Particles = new AmmoParticleDef
{
- Ammo = new ParticleDef
- {
- Name = "", //ShipWelderArc
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- },
- },
Hit = new ParticleDef
{
Name = "MaterialHit_Metal_GatlingGun",
@@ -3604,17 +957,6 @@ partial class Parts
HitPlayChance = 1f,
},
},
- Eject = new ParticleDef
- {
- Name = "",
- ApplyToShield = true,
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Scale = 1,
- HitPlayChance = 1f,
- },
- },
},
Lines = new LineDef
{
@@ -3632,22 +974,6 @@ partial class Parts
"WeaponLaser", // Please always have this Line set, if this Section is enabled.
},
TextureMode = Normal, // Normal, Cycle, Chaos, Wave
- Segmentation = new SegmentDef
- {
- Enable = false, // If true Tracer TextureMode is ignored
- Textures = new[] {
- "", // Please always have this Line set, if this Section is enabled.
- },
- SegmentLength = 0f, // Uses the values below.
- SegmentGap = 0f, // Uses Tracer textures and values
- Speed = 1f, // meters per second
- Color = Color(red: 1, green: 2, blue: 2.5f, alpha: 1),
- WidthMultiplier = 1f,
- Reverse = false,
- UseLineVariance = true,
- WidthVariance = Random(start: 0f, end: 0f),
- ColorVariance = Random(start: 0f, end: 0f)
- }
},
Trail = new TrailDef
{
@@ -3675,26 +1001,10 @@ partial class Parts
{
TravelSound = "MediumShellFlightSound", // SubtypeID for your Sound File. Travel, is sound generated around your Projectile in flight
HitSound = "ImpMetalMetalCat0",
- ShotSound = "",
- ShieldHitSound = "",
- PlayerHitSound = "",
VoxelHitSound = "ImpMetalRockCat0",
- FloatingHitSound = "",
HitPlayChance = 1f,
HitPlayShield = true,
},
- Ejection = new EjectionDef // Optional Component, allows generation of Particle or Item (Typically magazine), on firing, to simulate Tank shell ejection
- {
- Type = Particle, // Particle or Item (Inventory Component)
- Speed = 100f, // Speed inventory is ejected from in dummy direction
- SpawnChance = 0.5f, // chance of triggering effect (0 - 1)
- CompDef = new ComponentDef
- {
- ItemName = "", //InventoryComponent name
- ItemLifeTime = 0, // how long item should exist in world
- Delay = 0, // delay in ticks after shot before ejected
- }
- }, // Don't edit below this line
};
}
}
diff --git a/Data/Scripts/CoreSystems/Coreparts/Definitions/Artillery.cs b/Data/Scripts/CoreSystems/Coreparts/Definitions/Artillery.cs
index 4f420456..3a56215a 100644
--- a/Data/Scripts/CoreSystems/Coreparts/Definitions/Artillery.cs
+++ b/Data/Scripts/CoreSystems/Coreparts/Definitions/Artillery.cs
@@ -5,7 +5,6 @@
using static CoreSystems.Support.WeaponDefinition.HardPointDef.Prediction;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.BlockTypes;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.Threat;
-using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef;
using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef.HardwareType;
namespace Scripts {
@@ -30,7 +29,6 @@ partial class Parts {
Muzzles = new[] {
"muzzle_missile_001", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "muzzle_missile_001", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -41,13 +39,6 @@ partial class Parts {
SubSystems = new[] {
Power, Utility, Offense, Thrust, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 2, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 500, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -57,96 +48,26 @@ partial class Parts {
PartName = "Artillery", // Name of the weapon in terminal, should be unique for each weapon definition that shares a SubtypeId (i.e. multiweapons).
DeviateShotAngle = 0.15f, // Projectile inaccuracy in degrees.
AimingTolerance = 2f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
- AimLeadingPrediction = Off, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 0, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
- Ai = new AiDef
- {
- TrackTargets = false, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
- TurretAttached = false, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
- TurretController = false, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
- PrimaryTracking = false, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
- },
HardWare = new HardwareDef
{
- RotateRate = 0f, // Max traversal speed of azimuth subpart in radians per tick (0.1 is approximately 360 degrees per second).
- ElevateRate = 0f, // Max traversal speed of elevation subpart in radians per tick.
- MinAzimuth = 0,
- MaxAzimuth = 0,
- MinElevation = 0,
- MaxElevation = 0,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.3f, // Inventory capacity in kL.
IdlePower = 0.0025f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 80, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 720, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 1, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepLargeCalibreShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
- HardPointRotationSound = "", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 0, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
Graphics = new HardPointParticleDef
@@ -154,34 +75,16 @@ partial class Parts {
Effect1 = new ParticleDef
{
Name = "Muzzle_Flash_LargeCalibre", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
Extras = new ParticleOptionDef
{
- Loop = false, // Set this to the same as in the particle sbc!
- Restart = false, // Whether to end a looping effect instantly when firing stops.
Scale = 1f, // Scale of effect.
},
},
- Effect2 = new ParticleDef
- {
- Name = "",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
- Scale = 1f,
- },
- },
},
},
Ammos = new[] {
ArtilleryShell, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
WeaponDefinition LargeBlockArtilleryTurret => new WeaponDefinition
@@ -204,7 +107,6 @@ partial class Parts {
"muzzle_missile_001", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
"muzzle_missile_002",
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "camera", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -215,13 +117,6 @@ partial class Parts {
SubSystems = new[] {
Power, Utility, Offense, Thrust, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 2, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 500, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -232,26 +127,12 @@ partial class Parts {
DeviateShotAngle = 0.3f, // Projectile inaccuracy in degrees.
AimingTolerance = 2f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
AimLeadingPrediction = Advanced, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 0, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
Ai = new AiDef
{
TrackTargets = true, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
TurretAttached = true, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
TurretController = true, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
PrimaryTracking = true, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
},
HardWare = new HardwareDef
{
@@ -261,66 +142,24 @@ partial class Parts {
MaxAzimuth = 180,
MinElevation = -15,
MaxElevation = 60,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.6f, // Inventory capacity in kL.
IdlePower = 0.02f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 80, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 720, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 2, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepLargeCalibreShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
HardPointRotationSound = "WepTurretGatlingRotate", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 0, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
Graphics = new HardPointParticleDef
@@ -328,34 +167,16 @@ partial class Parts {
Effect1 = new ParticleDef
{
Name = "Muzzle_Flash_LargeCalibre", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
Extras = new ParticleOptionDef
{
- Loop = false, // Set this to the same as in the particle sbc!
- Restart = false, // Whether to end a looping effect instantly when firing stops.
Scale = 1f, // Scale of effect.
},
},
- Effect2 = new ParticleDef
- {
- Name = "",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
- Scale = 1f,
- },
- },
},
},
Ammos = new[] {
ArtilleryShell, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
// Don't edit below this line.
diff --git a/Data/Scripts/CoreSystems/Coreparts/Definitions/Assault Cannons.cs b/Data/Scripts/CoreSystems/Coreparts/Definitions/Assault Cannons.cs
index e9c78fcb..8851e0bf 100644
--- a/Data/Scripts/CoreSystems/Coreparts/Definitions/Assault Cannons.cs
+++ b/Data/Scripts/CoreSystems/Coreparts/Definitions/Assault Cannons.cs
@@ -5,7 +5,6 @@
using static CoreSystems.Support.WeaponDefinition.HardPointDef.Prediction;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.BlockTypes;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.Threat;
-using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef;
using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef.HardwareType;
namespace Scripts {
@@ -31,7 +30,6 @@ partial class Parts {
"Muzzle_Missile_Left", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
"Muzzle_Missile_Right",
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "Muzzle_Missile_Left", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -42,13 +40,6 @@ partial class Parts {
SubSystems = new[] {
Utility, Offense, Thrust, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 1000, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -59,26 +50,12 @@ partial class Parts {
DeviateShotAngle = 0.35f, // Projectile inaccuracy in degrees.
AimingTolerance = 2f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
AimLeadingPrediction = Advanced, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 0, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
Ai = new AiDef
{
TrackTargets = true, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
TurretAttached = true, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
TurretController = true, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
PrimaryTracking = true, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
},
HardWare = new HardwareDef
{
@@ -88,66 +65,24 @@ partial class Parts {
MaxAzimuth = 180,
MinElevation = -20,
MaxElevation = 75,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.18f, // Inventory capacity in kL.
IdlePower = 0.01f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 180, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 360, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 2, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepMediumCalibreShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
HardPointRotationSound = "WepTurretGatlingRotate", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 0, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
Graphics = new HardPointParticleDef
@@ -155,34 +90,16 @@ partial class Parts {
Effect1 = new ParticleDef
{
Name = "Muzzle_Flash_MediumCalibre", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
Extras = new ParticleOptionDef
{
- Loop = false, // Set this to the same as in the particle sbc!
- Restart = false, // Whether to end a looping effect instantly when firing stops.
Scale = 1f, // Scale of effect.
},
},
- Effect2 = new ParticleDef
- {
- Name = "",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
- Scale = 1f,
- },
- },
},
},
Ammos = new[] {
AssaultCannonShell, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
WeaponDefinition SmallBlockAssaultCannon => new WeaponDefinition
@@ -204,7 +121,6 @@ partial class Parts {
Muzzles = new[] {
"Muzzle_Missile", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "Muzzle_Missile", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -215,13 +131,6 @@ partial class Parts {
SubSystems = new[] {
Utility, Offense, Thrust, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 1000, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -231,96 +140,25 @@ partial class Parts {
PartName = "Assault Cannon", // Name of the weapon in terminal, should be unique for each weapon definition that shares a SubtypeId (i.e. multiweapons).
DeviateShotAngle = 0.2f, // Projectile inaccuracy in degrees.
AimingTolerance = 2f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
- AimLeadingPrediction = Off, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 0, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
- Ai = new AiDef
- {
- TrackTargets = false, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
- TurretAttached = false, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
- TurretController = false, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
- PrimaryTracking = false, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
- },
HardWare = new HardwareDef
{
- RotateRate = 0f, // Max traversal speed of azimuth subpart in radians per tick (0.1 is approximately 360 degrees per second).
- ElevateRate = 0f, // Max traversal speed of elevation subpart in radians per tick.
- MinAzimuth = 0,
- MaxAzimuth = 0,
- MinElevation = 0,
- MaxElevation = 0,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.09f, // Inventory capacity in kL.
IdlePower = 0.001f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 200, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 360, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 1, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepMediumCalibreShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
- HardPointRotationSound = "", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 0, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
Graphics = new HardPointParticleDef
@@ -328,34 +166,16 @@ partial class Parts {
Effect1 = new ParticleDef
{
Name = "Muzzle_Flash_MediumCalibre", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
Extras = new ParticleOptionDef
{
- Loop = false, // Set this to the same as in the particle sbc!
- Restart = false, // Whether to end a looping effect instantly when firing stops.
Scale = 1f, // Scale of effect.
},
},
- Effect2 = new ParticleDef
- {
- Name = "",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
- Scale = 1f,
- },
- },
},
},
Ammos = new[] {
AssaultCannonShell, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
WeaponDefinition SmallBlockAssaultCannonTurret => new WeaponDefinition
@@ -377,7 +197,6 @@ partial class Parts {
Muzzles = new[] {
"Muzzle_Missile", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "Muzzle_Missile", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -388,13 +207,6 @@ partial class Parts {
SubSystems = new[] {
Utility, Offense, Thrust, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 1000, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -405,26 +217,12 @@ partial class Parts {
DeviateShotAngle = 0.5f, // Projectile inaccuracy in degrees.
AimingTolerance = 2f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
AimLeadingPrediction = Advanced, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 0, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
Ai = new AiDef
{
TrackTargets = true, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
TurretAttached = true, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
TurretController = true, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
PrimaryTracking = true, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
},
HardWare = new HardwareDef
{
@@ -434,66 +232,24 @@ partial class Parts {
MaxAzimuth = 180,
MinElevation = -10,
MaxElevation = 50,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.09f, // Inventory capacity in kL.
IdlePower = 0.005f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 200, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 360, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 1, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepMediumCalibreShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
HardPointRotationSound = "WepTurretGatlingRotate", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 0, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
Graphics = new HardPointParticleDef
@@ -501,25 +257,9 @@ partial class Parts {
Effect1 = new ParticleDef
{
Name = "Muzzle_Flash_MediumCalibre", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
Extras = new ParticleOptionDef
{
- Loop = false, // Set this to the same as in the particle sbc!
Restart = false, // Whether to end a looping effect instantly when firing stops.
- Scale = 1f, // Scale of effect.
- },
- },
- Effect2 = new ParticleDef
- {
- Name = "",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
- Scale = 1f,
},
},
},
@@ -527,8 +267,6 @@ partial class Parts {
Ammos = new[] {
AssaultCannonShell, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
// Don't edit below this line.
}
diff --git a/Data/Scripts/CoreSystems/Coreparts/Definitions/Autocannons.cs b/Data/Scripts/CoreSystems/Coreparts/Definitions/Autocannons.cs
index 5d017910..4b6b2484 100644
--- a/Data/Scripts/CoreSystems/Coreparts/Definitions/Autocannons.cs
+++ b/Data/Scripts/CoreSystems/Coreparts/Definitions/Autocannons.cs
@@ -5,7 +5,6 @@
using static CoreSystems.Support.WeaponDefinition.HardPointDef.Prediction;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.BlockTypes;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.Threat;
-using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef;
using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef.HardwareType;
namespace Scripts {
@@ -30,7 +29,6 @@ partial class Parts {
Muzzles = new[] {
"muzzle_projectile", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "muzzle_projectile", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -41,13 +39,6 @@ partial class Parts {
SubSystems = new[] {
Thrust, Utility, Offense, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 500, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -57,95 +48,25 @@ partial class Parts {
PartName = "Autocannon", // Name of the weapon in terminal, should be unique for each weapon definition that shares a SubtypeId (i.e. multiweapons).
DeviateShotAngle = 0.15f, // Projectile inaccuracy in degrees.
AimingTolerance = 2f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
- AimLeadingPrediction = Off, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 0, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
- Ai = new AiDef
- {
- TrackTargets = false, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
- TurretAttached = false, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
- TurretController = false, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
- PrimaryTracking = false, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
- },
HardWare = new HardwareDef
{
- RotateRate = 0f, // Max traversal speed of azimuth subpart in radians per tick (0.1 is approximately 360 degrees per second).
- ElevateRate = 0f, // Max traversal speed of elevation subpart in radians per tick.
- MinAzimuth = 0,
- MaxAzimuth = 0,
- MinElevation = 0,
- MaxElevation = 0,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.072f, // Inventory capacity in kL.
IdlePower = 0.001f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 200, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 1, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 1, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepShipAutocannonShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
- HardPointRotationSound = "", // Audio played when turret is moving.
- BarrelRotationSound = "",
FireSoundEndDelay = 0, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
@@ -154,24 +75,18 @@ partial class Parts {
Effect1 = new ParticleDef
{
Name = "Muzzle_Flash_Autocannon", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
Extras = new ParticleOptionDef
{
Loop = true, // Set this to the same as in the particle sbc!
- Restart = false, // Whether to end a looping effect instantly when firing stops.
Scale = 1f, // Scale of effect.
},
},
Effect2 = new ParticleDef
{
Name = "Smoke_Autocannon",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
Extras = new ParticleOptionDef
{
Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
Scale = 1f,
},
},
@@ -203,8 +118,6 @@ partial class Parts {
Muzzles = new[] {
"muzzle_missile_01", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
- Scope = "", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
{
@@ -214,13 +127,6 @@ partial class Parts {
SubSystems = new[] {
Utility, Offense, Thrust, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 1000, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -231,26 +137,12 @@ partial class Parts {
DeviateShotAngle = 0.25f, // Projectile inaccuracy in degrees.
AimingTolerance = 2f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
AimLeadingPrediction = Accurate, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 0, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
Ai = new AiDef
{
TrackTargets = true, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
TurretAttached = true, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
TurretController = true, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
PrimaryTracking = true, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
},
HardWare = new HardwareDef
{
@@ -260,66 +152,25 @@ partial class Parts {
MaxAzimuth = 180,
MinElevation = -10,
MaxElevation = 90,
- HomeAzimuth = 0, // Default resting rotation angle
HomeElevation = 1, // Default resting elevation
InventorySize = 0.072f, // Inventory capacity in kL.
IdlePower = 0.005f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 200, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 360, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 1, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepShipAutocannonShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
HardPointRotationSound = "WepTurretGatlingRotate", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 0, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
Graphics = new HardPointParticleDef
@@ -327,24 +178,18 @@ partial class Parts {
Effect1 = new ParticleDef
{
Name = "Muzzle_Flash_Autocannon", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
Extras = new ParticleOptionDef
{
Loop = true, // Set this to the same as in the particle sbc!
- Restart = false, // Whether to end a looping effect instantly when firing stops.
Scale = 1f, // Scale of effect.
},
},
Effect2 = new ParticleDef
{
Name = "Smoke_Autocannon",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
Extras = new ParticleOptionDef
{
Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
Scale = 1f,
},
},
@@ -353,8 +198,6 @@ partial class Parts {
Ammos = new[] {
AutocannonShell, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
// Don't edit below this line.
}
diff --git a/Data/Scripts/CoreSystems/Coreparts/Definitions/Gatlings.cs b/Data/Scripts/CoreSystems/Coreparts/Definitions/Gatlings.cs
index ecea09c1..ae203a13 100644
--- a/Data/Scripts/CoreSystems/Coreparts/Definitions/Gatlings.cs
+++ b/Data/Scripts/CoreSystems/Coreparts/Definitions/Gatlings.cs
@@ -5,7 +5,6 @@
using static CoreSystems.Support.WeaponDefinition.HardPointDef.Prediction;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.BlockTypes;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.Threat;
-using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef;
using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef.HardwareType;
namespace Scripts {
@@ -30,7 +29,6 @@ partial class Parts {
Muzzles = new[] {
"muzzle_projectile_001", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "muzzle_projectile_001", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -41,13 +39,6 @@ partial class Parts {
SubSystems = new[] {
Offense, Thrust, Utility, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 1000, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -59,25 +50,12 @@ partial class Parts {
AimingTolerance = 4f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
AimLeadingPrediction = Accurate, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
DelayCeaseFire = 10, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
Ai = new AiDef
{
TrackTargets = true, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
TurretAttached = true, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
TurretController = true, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
PrimaryTracking = true, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
},
HardWare = new HardwareDef
{
@@ -87,62 +65,27 @@ partial class Parts {
MaxAzimuth = 180,
MinElevation = -40,
MaxElevation = 90,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.658f, // Inventory capacity in kL.
IdlePower = 0.01f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
},
Other = new OtherDef
{
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
RotateBarrelAxis = 3, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 700, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 240, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 1, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
SpinFree = true, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepShipGatlingShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
HardPointRotationSound = "WepTurretGatlingRotate", // Audio played when turret is moving.
BarrelRotationSound = "WepShipGatlingRotation",
@@ -154,8 +97,6 @@ partial class Parts {
Effect1 = new ParticleDef
{
Name = "Muzzle_Flash_Large", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
Extras = new ParticleOptionDef
{
Loop = true, // Set this to the same as in the particle sbc!
@@ -166,12 +107,9 @@ partial class Parts {
Effect2 = new ParticleDef
{
Name = "Smoke_LargeGunShot_WC",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
Extras = new ParticleOptionDef
{
Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
Scale = 1f,
},
},
@@ -180,8 +118,6 @@ partial class Parts {
Ammos = new[] {
GatlingAmmo, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
WeaponDefinition SmallGatlingGun => new WeaponDefinition
@@ -212,7 +148,6 @@ partial class Parts {
Muzzles = new[] {
"muzzle_projectile", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "muzzle_projectile", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -223,13 +158,6 @@ partial class Parts {
SubSystems = new[] {
Offense, Thrust, Utility, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 1000, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -239,94 +167,31 @@ partial class Parts {
PartName = "Small Gatling Gun", // Name of the weapon in terminal, should be unique for each weapon definition that shares a SubtypeId (i.e. multiweapons).
DeviateShotAngle = 0.3f, // Projectile inaccuracy in degrees.
AimingTolerance = 4f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
- AimLeadingPrediction = Off, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
DelayCeaseFire = 10, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
- Ai = new AiDef
- {
- TrackTargets = false, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
- TurretAttached = false, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
- TurretController = false, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
- PrimaryTracking = false, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
- },
HardWare = new HardwareDef
{
- RotateRate = 0f, // Max traversal speed of azimuth subpart in radians per tick (0.1 is approximately 360 degrees per second).
- ElevateRate = 0f, // Max traversal speed of elevation subpart in radians per tick.
- MinAzimuth = 0,
- MaxAzimuth = 0,
- MinElevation = 0,
- MaxElevation = 0,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.064f, // Inventory capacity in kL.
IdlePower = 0.001f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
},
Other = new OtherDef
{
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
RotateBarrelAxis = 3, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 700, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 1, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 1, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
SpinFree = true, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepShipGatlingShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
- HardPointRotationSound = "", // Audio played when turret is moving.
BarrelRotationSound = "WepShipGatlingRotation",
FireSoundEndDelay = 10, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
@@ -336,8 +201,6 @@ partial class Parts {
Effect1 = new ParticleDef
{
Name = "Muzzle_Flash_Large", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
Extras = new ParticleOptionDef
{
Loop = true, // Set this to the same as in the particle sbc!
@@ -348,12 +211,9 @@ partial class Parts {
Effect2 = new ParticleDef
{
Name = "Smoke_LargeGunShot_WC",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
Extras = new ParticleOptionDef
{
Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
Scale = 1f,
},
},
@@ -362,8 +222,6 @@ partial class Parts {
Ammos = new[] {
GatlingAmmo, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
WeaponDefinition SmallGatlingTurret => new WeaponDefinition
@@ -396,13 +254,6 @@ partial class Parts {
SubSystems = new[] {
Offense, Thrust, Utility, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 1000, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -414,25 +265,12 @@ partial class Parts {
AimingTolerance = 4f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
AimLeadingPrediction = Accurate, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
DelayCeaseFire = 10, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
Ai = new AiDef
{
TrackTargets = true, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
TurretAttached = true, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
TurretController = true, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
PrimaryTracking = true, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
},
HardWare = new HardwareDef
{
@@ -442,62 +280,27 @@ partial class Parts {
MaxAzimuth = 180,
MinElevation = -10,
MaxElevation = 90,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.36f, // Inventory capacity in kL.
IdlePower = 0.005f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
},
Other = new OtherDef
{
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
RotateBarrelAxis = 3, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 700, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 360, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 1, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
SpinFree = true, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepShipGatlingShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
HardPointRotationSound = "WepTurretGatlingRotate", // Audio played when turret is moving.
BarrelRotationSound = "WepShipGatlingRotation",
@@ -509,8 +312,6 @@ partial class Parts {
Effect1 = new ParticleDef
{
Name = "Muzzle_Flash_Large", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
Extras = new ParticleOptionDef
{
Loop = true, // Set this to the same as in the particle sbc!
@@ -521,12 +322,9 @@ partial class Parts {
Effect2 = new ParticleDef
{
Name = "Smoke_LargeGunShot_WC",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
Extras = new ParticleOptionDef
{
Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
Scale = 1f,
},
},
@@ -535,8 +333,6 @@ partial class Parts {
Ammos = new[] {
GatlingAmmo, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
WeaponDefinition LargeGatlingTurretReskin => new WeaponDefinition
@@ -558,7 +354,6 @@ partial class Parts {
Muzzles = new[] {
"muzzle_projectile_001", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "muzzle_projectile_001", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -569,13 +364,6 @@ partial class Parts {
SubSystems = new[] {
Offense, Thrust, Utility, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 1000, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -602,21 +390,9 @@ partial class Parts {
MaxAzimuth = 180,
MinElevation = -40,
MaxElevation = 90,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.658f, // Inventory capacity in kL.
IdlePower = 0.01f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
},
Loading = new LoadingDef
{
@@ -628,10 +404,8 @@ partial class Parts {
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepShipGatlingShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
HardPointRotationSound = "WepTurretGatlingRotate", // Audio played when turret is moving.
BarrelRotationSound = "WepShipGatlingRotation",
@@ -643,7 +417,6 @@ partial class Parts {
Effect1 = new ParticleDef
{
Name = "Muzzle_Flash_Large", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
Offset = Vector(x: 0, y: 0, z: -1.1f), // Offsets the effect from the muzzle empty.
Extras = new ParticleOptionDef
{
@@ -655,12 +428,9 @@ partial class Parts {
Effect2 = new ParticleDef
{
Name = "Smoke_LargeGunShot_WC",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
Extras = new ParticleOptionDef
{
Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
Scale = 1f,
},
},
@@ -669,11 +439,8 @@ partial class Parts {
Ammos = new[] {
GatlingAmmo, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
-
WeaponDefinition SmallGatlingTurretReskin => new WeaponDefinition
{
Assignments = new ModelAssignmentsDef
@@ -693,7 +460,6 @@ partial class Parts {
Muzzles = new[] {
"muzzle_projectile", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "muzzle_projectile", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -730,21 +496,9 @@ partial class Parts {
MaxAzimuth = 180,
MinElevation = -10,
MaxElevation = 90,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.36f, // Inventory capacity in kL.
IdlePower = 0.005f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
},
Loading = new LoadingDef
{
@@ -756,10 +510,8 @@ partial class Parts {
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepShipGatlingShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
HardPointRotationSound = "WepTurretGatlingRotate", // Audio played when turret is moving.
BarrelRotationSound = "WepShipGatlingRotation",
@@ -771,7 +523,6 @@ partial class Parts {
Effect1 = new ParticleDef
{
Name = "Muzzle_Flash_Large", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
Offset = Vector(x: 0, y: 0, z: 0.3f), // Offsets the effect from the muzzle empty.
Extras = new ParticleOptionDef
{
@@ -783,12 +534,9 @@ partial class Parts {
Effect2 = new ParticleDef
{
Name = "Smoke_LargeGunShot_WC",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
Extras = new ParticleOptionDef
{
Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
Scale = 1f,
},
},
@@ -797,10 +545,6 @@ partial class Parts {
Ammos = new[] {
GatlingAmmo, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
-
- // Don't edit below this line.
}
}
diff --git a/Data/Scripts/CoreSystems/Coreparts/Definitions/InteriorTurret.cs b/Data/Scripts/CoreSystems/Coreparts/Definitions/InteriorTurret.cs
index 24224bd6..cfd72ecb 100644
--- a/Data/Scripts/CoreSystems/Coreparts/Definitions/InteriorTurret.cs
+++ b/Data/Scripts/CoreSystems/Coreparts/Definitions/InteriorTurret.cs
@@ -5,7 +5,6 @@
using static CoreSystems.Support.WeaponDefinition.HardPointDef.Prediction;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.BlockTypes;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.Threat;
-using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef;
using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef.HardwareType;
namespace Scripts {
@@ -30,7 +29,6 @@ partial class Parts {
Muzzles = new[] {
"muzzle_projectile", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "muzzle_projectile", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -42,12 +40,6 @@ partial class Parts {
Thrust, Utility, Offense, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
ClosestFirst = true, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 500, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -59,25 +51,12 @@ partial class Parts {
AimingTolerance = 1f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
AimLeadingPrediction = Accurate, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
DelayCeaseFire = 10, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
Ai = new AiDef
{
TrackTargets = true, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
TurretAttached = true, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
TurretController = true, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
PrimaryTracking = true, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
},
HardWare = new HardwareDef
{
@@ -87,65 +66,23 @@ partial class Parts {
MaxAzimuth = 180,
MinElevation = -76,
MaxElevation = 90,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.08f, // Inventory capacity in kL.
IdlePower = 0.01f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 600, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 180, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 1, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepTurretInteriorFire", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
- NoAmmoSound = "",
HardPointRotationSound = "WepTurretGatlingRotate", // Audio played when turret is moving.
- BarrelRotationSound = "",
FireSoundEndDelay = 10, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
@@ -154,8 +91,6 @@ partial class Parts {
Effect1 = new ParticleDef
{
Name = "Muzzle_Flash", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
Extras = new ParticleOptionDef
{
Loop = true, // Set this to the same as in the particle sbc!
@@ -163,26 +98,12 @@ partial class Parts {
Scale = 3f, // Scale of effect.
},
},
- Effect2 = new ParticleDef
- {
- Name = "",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
- Scale = 3f,
- },
- },
},
},
Ammos = new[] {
InteriorAmmo,
InteriorAmmoOld // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
// Don't edit below this line.
diff --git a/Data/Scripts/CoreSystems/Coreparts/Definitions/MasterConfig.cs b/Data/Scripts/CoreSystems/Coreparts/Definitions/MasterConfig.cs
index 2b4b5d23..4cfe0b1f 100644
--- a/Data/Scripts/CoreSystems/Coreparts/Definitions/MasterConfig.cs
+++ b/Data/Scripts/CoreSystems/Coreparts/Definitions/MasterConfig.cs
@@ -5,11 +5,6 @@ partial class Parts
{
internal Parts()
{
- // naming convention: WeaponDefinition Name
- //
- // Enable your definitions using the follow syntax:
- // PartDefinitions(Your1stDefinition, Your2ndDefinition, Your3rdDefinition);
- // PartDefinitions includes both weapons and phantoms
PartDefinitions(LargeGatlingTurret,
SmallGatlingGun,
SmallGatlingTurret,
diff --git a/Data/Scripts/CoreSystems/Coreparts/Definitions/Missiles.cs b/Data/Scripts/CoreSystems/Coreparts/Definitions/Missiles.cs
index 75d92d89..0c8ae9d2 100644
--- a/Data/Scripts/CoreSystems/Coreparts/Definitions/Missiles.cs
+++ b/Data/Scripts/CoreSystems/Coreparts/Definitions/Missiles.cs
@@ -5,7 +5,6 @@
using static CoreSystems.Support.WeaponDefinition.HardPointDef.Prediction;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.BlockTypes;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.Threat;
-using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef;
using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef.HardwareType;
namespace Scripts {
@@ -48,7 +47,6 @@ partial class Parts {
"muzzle_missile_018",
"muzzle_missile_019",
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "muzzle_missile_010", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -59,13 +57,6 @@ partial class Parts {
SubSystems = new[] {
Thrust, Utility, Offense, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 1000, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -75,131 +66,32 @@ partial class Parts {
PartName = "Large Missile Launcher", // Name of the weapon in terminal, should be unique for each weapon definition that shares a SubtypeId (i.e. multiweapons).
DeviateShotAngle = 0.1f, // Projectile inaccuracy in degrees.
AimingTolerance = 4f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
- AimLeadingPrediction = Off, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 0, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = true, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
- Ai = new AiDef
- {
- TrackTargets = false, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
- TurretAttached = false, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
- TurretController = false, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
- PrimaryTracking = false, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
- },
HardWare = new HardwareDef
{
- RotateRate = 0f, // Max traversal speed of azimuth subpart in radians per tick (0.1 is approximately 360 degrees per second).
- ElevateRate = 0f, // Max traversal speed of elevation subpart in radians per tick.
- MinAzimuth = 0,
- MaxAzimuth = 0,
- MinElevation = 0,
- MaxElevation = 0,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 1.14f, // Inventory capacity in kL.
IdlePower = 0.001f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 120, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 240, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 19, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepShipSmallMissileShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
HardPointRotationSound = "WepTurretGatlingRotate", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 0, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
- Graphics = new HardPointParticleDef
- {
- Effect1 = new ParticleDef
- {
- Name = "", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = true, // Whether to end a looping effect instantly when firing stops.
- Scale = 1f, // Scale of effect.
- },
- },
- Effect2 = new ParticleDef
- {
- Name = "",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
- Scale = 1f,
- },
- },
- },
},
Ammos = new[] {
MissileAmmo, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
WeaponDefinition LargeMissileTurret => new WeaponDefinition
@@ -235,7 +127,6 @@ partial class Parts {
"muzzle_missile_005",
"muzzle_missile_006",
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "muzzle_missile_001", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -246,13 +137,6 @@ partial class Parts {
SubSystems = new[] {
Thrust, Utility, Offense, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 1000, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -263,26 +147,12 @@ partial class Parts {
DeviateShotAngle = 0.5f, // Projectile inaccuracy in degrees.
AimingTolerance = 4f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
AimLeadingPrediction = Accurate, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 0, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = true, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
Ai = new AiDef
{
TrackTargets = true, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
TurretAttached = true, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
TurretController = true, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
PrimaryTracking = true, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
},
HardWare = new HardwareDef
{
@@ -292,101 +162,30 @@ partial class Parts {
MaxAzimuth = 180,
MinElevation = -58,
MaxElevation = 90,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.768f, // Inventory capacity in kL.
IdlePower = 0.01f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 90, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 240, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 6, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepTurretMissileShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
HardPointRotationSound = "WepTurretGatlingRotate", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 0, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
- Graphics = new HardPointParticleDef
- {
- Effect1 = new ParticleDef
- {
- Name = "", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = true, // Whether to end a looping effect instantly when firing stops.
- Scale = 1f, // Scale of effect.
- },
- },
- Effect2 = new ParticleDef
- {
- Name = "",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
- Scale = 1f,
- },
- },
- },
},
Ammos = new[] {
MissileAmmo, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
WeaponDefinition SmallMissileLauncher => new WeaponDefinition
@@ -419,7 +218,6 @@ partial class Parts {
"muzzle_missile_003",
"muzzle_missile_004",
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "muzzle_missile_001", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -430,13 +228,6 @@ partial class Parts {
SubSystems = new[] {
Thrust, Utility, Offense, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 1000, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -446,131 +237,32 @@ partial class Parts {
PartName = "Small Missile Launcher", // Name of the weapon in terminal, should be unique for each weapon definition that shares a SubtypeId (i.e. multiweapons).
DeviateShotAngle = 0.1f, // Projectile inaccuracy in degrees.
AimingTolerance = 4f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
- AimLeadingPrediction = Off, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 0, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = true, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
- Ai = new AiDef
- {
- TrackTargets = false, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
- TurretAttached = false, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
- TurretController = false, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
- PrimaryTracking = false, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
- },
HardWare = new HardwareDef
{
- RotateRate = 0f, // Max traversal speed of azimuth subpart in radians per tick (0.1 is approximately 360 degrees per second).
- ElevateRate = 0f, // Max traversal speed of elevation subpart in radians per tick.
- MinAzimuth = 0,
- MaxAzimuth = 0,
- MinElevation = 0,
- MaxElevation = 0,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.24f, // Inventory capacity in kL.
IdlePower = 0.001f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 60, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 60, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 4, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepShipSmallMissileShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
HardPointRotationSound = "WepTurretGatlingRotate", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 0, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
- Graphics = new HardPointParticleDef
- {
- Effect1 = new ParticleDef
- {
- Name = "", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = true, // Whether to end a looping effect instantly when firing stops.
- Scale = 1f, // Scale of effect.
- },
- },
- Effect2 = new ParticleDef
- {
- Name = "",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
- Scale = 1f,
- },
- },
- },
},
Ammos = new[] {
MissileAmmo, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
WeaponDefinition SmallRocketLauncherReload => new WeaponDefinition
@@ -595,7 +287,6 @@ partial class Parts {
"muzzle_missile_003",
"muzzle_missile_004",
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "muzzle_missile_002", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -606,13 +297,6 @@ partial class Parts {
SubSystems = new[] {
Thrust, Utility, Offense, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 1000, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -622,131 +306,32 @@ partial class Parts {
PartName = "Reloadable Missile Launcher", // Name of the weapon in terminal, should be unique for each weapon definition that shares a SubtypeId (i.e. multiweapons).
DeviateShotAngle = 0.1f, // Projectile inaccuracy in degrees.
AimingTolerance = 4f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
- AimLeadingPrediction = Off, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 0, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = true, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
- Ai = new AiDef
- {
- TrackTargets = false, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
- TurretAttached = false, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
- TurretController = false, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
- PrimaryTracking = false, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
- },
HardWare = new HardwareDef
{
- RotateRate = 0f, // Max traversal speed of azimuth subpart in radians per tick (0.1 is approximately 360 degrees per second).
- ElevateRate = 0f, // Max traversal speed of elevation subpart in radians per tick.
- MinAzimuth = 0,
- MaxAzimuth = 0,
- MinElevation = 0,
- MaxElevation = 0,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.245f, // Inventory capacity in kL.
IdlePower = 0.001f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 60, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 60, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 4, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepShipSmallMissileShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
HardPointRotationSound = "WepTurretGatlingRotate", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 0, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
- Graphics = new HardPointParticleDef
- {
- Effect1 = new ParticleDef
- {
- Name = "", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = true, // Whether to end a looping effect instantly when firing stops.
- Scale = 1f, // Scale of effect.
- },
- },
- Effect2 = new ParticleDef
- {
- Name = "",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
- Scale = 1f,
- },
- },
- },
},
Ammos = new[] {
MissileAmmo, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
WeaponDefinition SmallMissileTurret => new WeaponDefinition
@@ -789,13 +374,6 @@ partial class Parts {
SubSystems = new[] {
Thrust, Utility, Offense, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 1000, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -806,26 +384,12 @@ partial class Parts {
DeviateShotAngle = 0.5f, // Projectile inaccuracy in degrees.
AimingTolerance = 4f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
AimLeadingPrediction = Accurate, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 0, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = true, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
Ai = new AiDef
{
TrackTargets = true, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
TurretAttached = true, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
TurretController = true, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
PrimaryTracking = true, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
},
HardWare = new HardwareDef
{
@@ -835,101 +399,30 @@ partial class Parts {
MaxAzimuth = 180,
MinElevation = -8,
MaxElevation = 90,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.36f, // Inventory capacity in kL.
IdlePower = 0.005f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 90, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 360, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 2, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
- PreFiringSound = "", // Audio for warmup effect.
FiringSound = "WepTurretMissileShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
HardPointRotationSound = "WepTurretGatlingRotate", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 0, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
- Graphics = new HardPointParticleDef
- {
- Effect1 = new ParticleDef
- {
- Name = "", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = true, // Whether to end a looping effect instantly when firing stops.
- Scale = 1f, // Scale of effect.
- },
- },
- Effect2 = new ParticleDef
- {
- Name = "",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
- Scale = 1f,
- },
- },
- },
},
Ammos = new[] {
MissileAmmo, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
// Don't edit below this line.
}
diff --git a/Data/Scripts/CoreSystems/Coreparts/Definitions/RailgunAnimations.cs b/Data/Scripts/CoreSystems/Coreparts/Definitions/RailgunAnimations.cs
index fde06b65..09b323a9 100644
--- a/Data/Scripts/CoreSystems/Coreparts/Definitions/RailgunAnimations.cs
+++ b/Data/Scripts/CoreSystems/Coreparts/Definitions/RailgunAnimations.cs
@@ -2,8 +2,6 @@
using static CoreSystems.Support.WeaponDefinition;
using static CoreSystems.Support.WeaponDefinition.AnimationDef;
using static CoreSystems.Support.WeaponDefinition.AnimationDef.PartAnimationSetDef.EventTriggers;
-using static CoreSystems.Support.WeaponDefinition.AnimationDef.RelMove.MoveType;
-using static CoreSystems.Support.WeaponDefinition.AnimationDef.RelMove;
namespace Scripts
{ // Don't edit above this line
partial class Parts
diff --git a/Data/Scripts/CoreSystems/Coreparts/Definitions/Railguns.cs b/Data/Scripts/CoreSystems/Coreparts/Definitions/Railguns.cs
index 8359ef3e..d839f6b2 100644
--- a/Data/Scripts/CoreSystems/Coreparts/Definitions/Railguns.cs
+++ b/Data/Scripts/CoreSystems/Coreparts/Definitions/Railguns.cs
@@ -2,10 +2,8 @@
using static CoreSystems.Support.WeaponDefinition;
using static CoreSystems.Support.WeaponDefinition.ModelAssignmentsDef;
using static CoreSystems.Support.WeaponDefinition.HardPointDef;
-using static CoreSystems.Support.WeaponDefinition.HardPointDef.Prediction;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.BlockTypes;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.Threat;
-using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef;
using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef.HardwareType;
namespace Scripts {
@@ -30,7 +28,6 @@ partial class Parts {
Muzzles = new[] {
"barrel_001", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "barrel_001", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -41,13 +38,6 @@ partial class Parts {
SubSystems = new[] {
Power, Utility, Offense, Thrust, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 2, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 500, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -57,84 +47,20 @@ partial class Parts {
PartName = "Large Railgun", // Name of the weapon in terminal, should be unique for each weapon definition that shares a SubtypeId (i.e. multiweapons).
DeviateShotAngle = 0f, // Projectile inaccuracy in degrees.
AimingTolerance = 2f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
- AimLeadingPrediction = Off, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 0, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
- Ai = new AiDef
- {
- TrackTargets = false, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
- TurretAttached = false, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
- TurretController = false, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
- PrimaryTracking = false, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
- },
HardWare = new HardwareDef
{
- RotateRate = 0f, // Max traversal speed of azimuth subpart in radians per tick (0.1 is approximately 360 degrees per second).
- ElevateRate = 0f, // Max traversal speed of elevation subpart in radians per tick.
- MinAzimuth = 0,
- MaxAzimuth = 0,
- MinElevation = 0,
- MaxElevation = 0,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.24f, // Inventory capacity in kL.
IdlePower = 0.001f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 20, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 3600, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 1, // Number of physical magazines to consume on reload.
DelayUntilFire = 120, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
StayCharged = true, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
@@ -142,46 +68,14 @@ partial class Parts {
PreFiringSound = "WepRailgunLargeCharge", // Audio for warmup effect.
FiringSound = "WepRailgunLargeShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
- HardPointRotationSound = "", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 0, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
- Graphics = new HardPointParticleDef
- {
- Effect1 = new ParticleDef
- {
- Name = "", // SubtypeId of muzzle particle effect.
- Color = Color(red: 1, green: 1, blue: 1, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
- Extras = new ParticleOptionDef
- {
- Loop = false, // Set this to the same as in the particle sbc!
- Restart = false, // Whether to end a looping effect instantly when firing stops.
- Scale = 1f, // Scale of effect.
- },
- },
- Effect2 = new ParticleDef
- {
- Name = "",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
- Scale = 1f,
- },
- },
- },
},
Ammos = new[] {
LargeRailgunSabot, // Must list all primary, shrapnel, and pattern ammos.
},
Animations = LargeRailgunAnimation,
- //Upgrades = UpgradeModules,
};
WeaponDefinition SmallBlockRailgun => new WeaponDefinition
@@ -203,7 +97,6 @@ partial class Parts {
Muzzles = new[] {
"barrel_001", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "barrel_001", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -214,13 +107,6 @@ partial class Parts {
SubSystems = new[] {
Power, Utility, Offense, Thrust, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
- ClosestFirst = false, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
- MaxTargetDistance = 0, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 2, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
StopTrackingSpeed = 500, // Do not track threats traveling faster than this speed; 0 = unlimited.
@@ -230,133 +116,36 @@ partial class Parts {
PartName = "Small Railgun", // Name of the weapon in terminal, should be unique for each weapon definition that shares a SubtypeId (i.e. multiweapons).
DeviateShotAngle = 0f, // Projectile inaccuracy in degrees.
AimingTolerance = 2f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
- AimLeadingPrediction = Off, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 0, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
- Ui = new UiDef
- {
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
- },
- Ai = new AiDef
- {
- TrackTargets = false, // Whether this weapon tracks its own targets, or (for multiweapons) relies on the weapon with PrimaryTracking enabled for target designation. Turrets Need this set to True.
- TurretAttached = false, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
- TurretController = false, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
- PrimaryTracking = false, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
- },
HardWare = new HardwareDef
{
- RotateRate = 0f, // Max traversal speed of azimuth subpart in radians per tick (0.1 is approximately 360 degrees per second).
- ElevateRate = 0f, // Max traversal speed of elevation subpart in radians per tick.
- MinAzimuth = 0,
- MaxAzimuth = 0,
- MinElevation = 0,
- MaxElevation = 0,
- HomeAzimuth = 0, // Default resting rotation angle
- HomeElevation = 0, // Default resting elevation
InventorySize = 0.048f, // Inventory capacity in kL.
IdlePower = 0.0001f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
- CriticalReaction = new CriticalDef
- {
- Enable = false, // Enables Warhead behaviour.
- DefaultArmedTimer = 120, // Sets default countdown duration.
- PreArmed = false, // Whether the warhead is armed by default when placed. Best left as false.
- TerminalControls = true, // Whether the warhead should have terminal controls for arming and detonation.
- AmmoRound = "", // Optional. If specified, the warhead will always use this ammo on detonation rather than the currently selected ammo.
- },
- },
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
},
Loading = new LoadingDef
{
RateOfFire = 20, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
TrajectilesPerBarrel = 1, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
ReloadTime = 1200, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
MagsToLoad = 1, // Number of physical magazines to consume on reload.
DelayUntilFire = 30, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
+ StayCharged = true, // Will start recharging whenever power cap is not full.
},
Audio = new HardPointAudioDef
{
PreFiringSound = "WepRailgunSmallCharge", // Audio for warmup effect.
FiringSound = "WepRailgunSmallShot", // Audio for firing.
FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
NoAmmoSound = "WepShipGatlingNoAmmo",
- HardPointRotationSound = "", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 0, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
- Graphics = new HardPointParticleDef
- {
- Effect1 = new ParticleDef
- {
- Name = "", // SubtypeId of muzzle particle effect.
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1), // Deprecated, set color in particle sbc.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the effect from the muzzle empty.
- Extras = new ParticleOptionDef
- {
- Loop = false, // Set this to the same as in the particle sbc!
- Restart = false, // Whether to end a looping effect instantly when firing stops.
- Scale = 1f, // Scale of effect.
- },
- },
- Effect2 = new ParticleDef
- {
- Name = "",
- Color = Color(red: 0, green: 0, blue: 0, alpha: 1),
- Offset = Vector(x: 0, y: 0, z: 0),
- Extras = new ParticleOptionDef
- {
- Loop = true, // Set this to the same as in the particle sbc!
- Restart = false,
- Scale = 1f,
- },
- },
- },
},
Ammos = new[] {
SmallRailgunSabot, // Must list all primary, shrapnel, and pattern ammos.
},
Animations = SmallRailgunAnimation,
- //Upgrades = UpgradeModules,
};
-
// Don't edit below this line.
}
}
diff --git a/Data/Scripts/CoreSystems/Coreparts/Definitions/SearchLight.cs b/Data/Scripts/CoreSystems/Coreparts/Definitions/SearchLight.cs
index 26cf8f82..4ffbe471 100644
--- a/Data/Scripts/CoreSystems/Coreparts/Definitions/SearchLight.cs
+++ b/Data/Scripts/CoreSystems/Coreparts/Definitions/SearchLight.cs
@@ -2,10 +2,8 @@
using static CoreSystems.Support.WeaponDefinition;
using static CoreSystems.Support.WeaponDefinition.ModelAssignmentsDef;
using static CoreSystems.Support.WeaponDefinition.HardPointDef;
-using static CoreSystems.Support.WeaponDefinition.HardPointDef.Prediction;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.BlockTypes;
using static CoreSystems.Support.WeaponDefinition.TargetingDef.Threat;
-using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef;
using static CoreSystems.Support.WeaponDefinition.HardPointDef.HardwareDef.HardwareType;
namespace Scripts {
@@ -30,7 +28,6 @@ partial class Parts {
Muzzles = new[] {
"spotlight", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "spotlight", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -42,12 +39,7 @@ partial class Parts {
Thrust, Utility, Offense, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
ClosestFirst = true, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
MaxTargetDistance = 2500, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
ShootBlanks = true,
@@ -57,17 +49,8 @@ partial class Parts {
PartName = "Searchlight", // Name of the weapon in terminal, should be unique for each weapon definition that shares a SubtypeId (i.e. multiweapons).
DeviateShotAngle = 0.1f, // Projectile inaccuracy in degrees.
AimingTolerance = 1f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
- AimLeadingPrediction = Accurate, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 10, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
Ui = new UiDef
{
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
DisableStatus = true, // Do not display weapon status NoTarget, Reloading, NoAmmo, etc..
},
Ai = new AiDef
@@ -76,9 +59,6 @@ partial class Parts {
TurretAttached = true, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
TurretController = true, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
PrimaryTracking = true, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
TargetGridCenter = true, // Does not target blocks, instead it targets grid center.
},
HardWare = new HardwareDef
@@ -87,68 +67,20 @@ partial class Parts {
ElevateRate = 0.04f, // Max traversal speed of elevation subpart in radians per tick.
MinAzimuth = -180,
MaxAzimuth = 180,
- MinElevation = 0,
MaxElevation = 90,
- HomeAzimuth = 0, // Default resting rotation angle
HomeElevation = 45, // Default resting elevation
- InventorySize = 0, // Inventory capacity in kL.
IdlePower = 0.01f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
},
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
- },
Loading = new LoadingDef
{
RateOfFire = 600, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
- TrajectilesPerBarrel = 0, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
- ReloadTime = 0, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- MagsToLoad = 0, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
- },
- Audio = new HardPointAudioDef
- {
- PreFiringSound = "", // Audio for warmup effect.
- FiringSound = "", // Audio for firing.
- FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
- NoAmmoSound = "",
- HardPointRotationSound = "", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 10, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
- FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
},
Ammos = new[] {
SpotLight, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
WeaponDefinition SmallSearchlight => new WeaponDefinition
{
@@ -169,7 +101,6 @@ partial class Parts {
Muzzles = new[] {
"spotlight", // Where your Projectiles spawn. Use numbers not Letters. IE Muzzle_01 not Muzzle_A
},
- Ejector = "", // Optional; empty from which to eject "shells" if specified.
Scope = "spotlight", // Where line of sight checks are performed from. Must be clear of block collision.
},
Targeting = new TargetingDef
@@ -181,12 +112,7 @@ partial class Parts {
Thrust, Utility, Offense, Power, Production, Any, // Subsystem targeting priority: Offense, Utility, Power, Production, Thrust, Jumping, Steering, Any
},
ClosestFirst = true, // Tries to pick closest targets first (blocks on grids, projectiles, etc...).
- IgnoreDumbProjectiles = false, // Don't fire at non-smart projectiles.
- LockedSmartOnly = false, // Only fire at smart projectiles that are locked on to parent grid.
- MinimumDiameter = 0, // Minimum radius of threat to engage.
- MaximumDiameter = 0, // Maximum radius of threat to engage; 0 = unlimited.
MaxTargetDistance = 1500, // Maximum distance at which targets will be automatically shot at; 0 = unlimited.
- MinTargetDistance = 0, // Minimum distance at which targets will be automatically shot at.
TopTargets = 4, // Maximum number of targets to randomize between; 0 = unlimited.
TopBlocks = 4, // Maximum number of blocks to randomize between; 0 = unlimited.
ShootBlanks = true,
@@ -196,17 +122,8 @@ partial class Parts {
PartName = "Searchlight", // Name of the weapon in terminal, should be unique for each weapon definition that shares a SubtypeId (i.e. multiweapons).
DeviateShotAngle = 0.1f, // Projectile inaccuracy in degrees.
AimingTolerance = 1f, // How many degrees off target a turret can fire at. 0 - 180 firing angle.
- AimLeadingPrediction = Accurate, // Level of turret aim prediction; Off, Basic, Accurate, Advanced
- DelayCeaseFire = 10, // Measured in game ticks (6 = 100ms, 60 = 1 second, etc..). Length of time the weapon continues firing after trigger is released.
- AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre.
- CanShootSubmerged = false, // Whether the weapon can be fired underwater when using WaterMod.
-
Ui = new UiDef
{
- RateOfFire = false, // Enables terminal slider for changing rate of fire.
- DamageModifier = false, // Enables terminal slider for changing damage per shot.
- ToggleGuidance = false, // Enables terminal option to disable smart projectile guidance.
- EnableOverload = false, // Enables terminal option to turn on Overload; this allows energy weapons to double damage per shot, at the cost of quadrupled power draw and heat gain, and 2% self damage on overheat.
DisableStatus = true, // Do not display weapon status NoTarget, Reloading, NoAmmo, etc..
},
Ai = new AiDef
@@ -215,9 +132,6 @@ partial class Parts {
TurretAttached = true, // Whether this weapon is a turret and should have the UI and API options for such. Turrets Need this set to True.
TurretController = true, // Whether this weapon can physically control the turret's movement. Turrets Need this set to True.
PrimaryTracking = true, // For multiweapons: whether this weapon should designate targets for other weapons on the platform without their own tracking.
- LockOnFocus = false, // If enabled, weapon will only fire at targets that have been HUD selected AND locked onto by pressing Numpad 0.
- SuppressFire = false, // If enabled, weapon can only be fired manually.
- OverrideLeads = false, // Disable target leading on fixed weapons, or allow it for turrets.
TargetGridCenter = true, // Does not target blocks, instead it targets grid center.
},
HardWare = new HardwareDef
@@ -226,68 +140,20 @@ partial class Parts {
ElevateRate = 0.04f, // Max traversal speed of elevation subpart in radians per tick.
MinAzimuth = -180,
MaxAzimuth = 180,
- MinElevation = 0,
MaxElevation = 90,
- HomeAzimuth = 0, // Default resting rotation angle
HomeElevation = 45, // Default resting elevation
- InventorySize = 0, // Inventory capacity in kL.
IdlePower = 0.01f, // Constant base power draw in MW.
- FixedOffset = false, // Deprecated.
- Offset = Vector(x: 0, y: 0, z: 0), // Offsets the aiming/firing line of the weapon, in metres.
Type = BlockWeapon, // What type of weapon this is; BlockWeapon, HandWeapon, Phantom
},
- Other = new OtherDef
- {
- ConstructPartCap = 0, // Maximum number of blocks with this weapon on a grid; 0 = unlimited.
- RotateBarrelAxis = 0, // For spinning barrels, which axis to spin the barrel around; 0 = none.
- EnergyPriority = 0, // Deprecated.
- MuzzleCheck = false, // Whether the weapon should check LOS from each individual muzzle in addition to the scope.
- Debug = false, // Force enables debug mode.
- RestrictionRadius = 0, // Prevents other blocks of this type from being placed within this distance of the centre of the block.
- CheckInflatedBox = false, // If true, the above distance check is performed from the edge of the block instead of the centre.
- CheckForAnyWeapon = false, // If true, the check will fail if ANY weapon is present, not just weapons of the same subtype.
- },
Loading = new LoadingDef
{
RateOfFire = 600, // Set this to 3600 for beam weapons. This is how fast your Gun fires.
BarrelsPerShot = 1, // How many muzzles will fire a projectile per fire event.
- TrajectilesPerBarrel = 0, // Number of projectiles per muzzle per fire event.
- SkipBarrels = 0, // Number of muzzles to skip after each fire event.
- ReloadTime = 0, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- MagsToLoad = 0, // Number of physical magazines to consume on reload.
- DelayUntilFire = 0, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- HeatPerShot = 0, // Heat generated per shot.
- MaxHeat = 100, // Max heat before weapon enters cooldown (70% of max heat).
- Cooldown = .95f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95
- HeatSinkRate = 0, // Amount of heat lost per second.
- DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat).
- ShotsInBurst = 0, // Use this if you don't want the weapon to fire an entire physical magazine in one go. Should not be more than your magazine capacity.
- DelayAfterBurst = 0, // How long to spend "reloading" after each burst. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..).
- FireFull = false, // Whether the weapon should fire the full magazine (or the full burst instead if ShotsInBurst > 0), even if the target is lost or the player stops firing prematurely.
- GiveUpAfter = false, // Whether the weapon should drop its current target and reacquire a new target after finishing its magazine or burst.
- BarrelSpinRate = 0, // Visual only, 0 disables and uses RateOfFire.
- DeterministicSpin = false, // Spin barrel position will always be relative to initial / starting positions (spin will not be as smooth).
- SpinFree = false, // Spin barrel while not firing.
- StayCharged = false, // Will start recharging whenever power cap is not full.
- },
- Audio = new HardPointAudioDef
- {
- PreFiringSound = "", // Audio for warmup effect.
- FiringSound = "", // Audio for firing.
- FiringSoundPerShot = true, // Whether to replay the sound for each shot, or just loop over the entire track while firing.
- ReloadSound = "", // Sound SubtypeID, for when your Weapon is in a reloading state
- NoAmmoSound = "",
- HardPointRotationSound = "", // Audio played when turret is moving.
- BarrelRotationSound = "",
- FireSoundEndDelay = 10, // How long the firing audio should keep playing after firing stops. Measured in game ticks(6 = 100ms, 60 = 1 seconds, etc..).
- FireSoundNoBurst = true, // Don't stop firing sound from looping when delaying after burst.
},
},
Ammos = new[] {
SpotLight, // Must list all primary, shrapnel, and pattern ammos.
},
- //Animations = Weapon75_Animation,
- //Upgrades = UpgradeModules,
};
// Don't edit below this line.
diff --git a/Data/Scripts/CoreSystems/Definitions/CoreDefinitions.cs b/Data/Scripts/CoreSystems/Definitions/CoreDefinitions.cs
index 4281815e..e52e8e23 100644
--- a/Data/Scripts/CoreSystems/Definitions/CoreDefinitions.cs
+++ b/Data/Scripts/CoreSystems/Definitions/CoreDefinitions.cs
@@ -486,6 +486,7 @@ public enum Prediction
[ProtoMember(14)] internal bool CanShootSubmerged;
[ProtoMember(15)] internal bool NpcSafe;
[ProtoMember(16)] internal bool ScanTrackOnly;
+ [ProtoMember(17)] internal bool CanTargetSubmerged;
[ProtoContract]
public struct LoadingDef
@@ -615,6 +616,9 @@ public struct OtherDef
[ProtoMember(8)] internal bool CheckForAnyWeapon;
[ProtoMember(9)] internal bool DisableLosCheck;
[ProtoMember(10)] internal bool NoVoxelLosCheck;
+ [ProtoMember(11)] internal bool AllowScopeOutsideObb;
+ [ProtoMember(12)] internal bool ProhibitLGTargeting;
+ [ProtoMember(13)] internal bool ProhibitSGTargeting;
}
[ProtoContract]
@@ -821,6 +825,9 @@ public struct AmmoParticleDef
[ProtoMember(2)] internal ParticleDef Hit;
[ProtoMember(3)] internal ParticleDef Eject;
[ProtoMember(4)] internal ParticleDef WeaponEffect1Override;
+ [ProtoMember(5)] internal ParticleDef ShieldHit;
+ [ProtoMember(6)] internal ParticleDef VoxelHit;
+ [ProtoMember(7)] internal ParticleDef WaterHit;
}
[ProtoContract]
@@ -1273,6 +1280,7 @@ public struct AmmoAudioDef
[ProtoMember(7)] internal string FloatingHitSound;
[ProtoMember(8)] internal string ShieldHitSound;
[ProtoMember(9)] internal string ShotSound;
+ [ProtoMember(10)] internal string WaterHitSound;
}
[ProtoContract]
@@ -1306,7 +1314,7 @@ internal enum GuidanceType
[ProtoMember(14)] internal uint MaxTrajectoryTime;
[ProtoMember(15)] internal ApproachDef[] Approaches;
[ProtoMember(16)] internal double TotalAcceleration;
- [ProtoMember(17)] internal OnHitDef OnHit;
+ [ProtoMember(17)] internal OnHitDef OnHit; //Deprecated
[ProtoMember(18)] internal float DragPerSecond;
[ProtoMember(19)] internal float DragMinSpeed;
@@ -1338,6 +1346,7 @@ public struct SmartsDef
[ProtoMember(23)] internal double MinTurnSpeed;
[ProtoMember(24)] internal bool NoTargetApproach;
[ProtoMember(25)] internal bool AltNavigation;
+ [ProtoMember(26)] internal bool IgnoreAntiSmarts;
}
[ProtoContract]
@@ -1544,6 +1553,7 @@ public struct MinesDef
[ProtoContract]
public struct OnHitDef
{
+ /*
[ProtoMember(1)] internal int Duration;
[ProtoMember(2)] internal int ProcInterval;
[ProtoMember(3)] internal double ProcAmount;
@@ -1552,6 +1562,7 @@ public struct OnHitDef
[ProtoMember(6)] internal bool DieOnEnd;
[ProtoMember(7)] internal bool StickOnHit;
[ProtoMember(8)] internal bool AlignFragtoImpactAngle;
+ */
}
}
diff --git a/Data/Scripts/CoreSystems/Definitions/CoreSystems.cs b/Data/Scripts/CoreSystems/Definitions/CoreSystems.cs
index 5826a78f..a9f49211 100644
--- a/Data/Scripts/CoreSystems/Definitions/CoreSystems.cs
+++ b/Data/Scripts/CoreSystems/Definitions/CoreSystems.cs
@@ -190,6 +190,8 @@ public AmmoType(AmmoDef ammoDef, MyDefinitionId ammoDefinitionId, MyDefinitionId
public readonly bool TrackGrids;
public readonly bool TrackCharacters;
public readonly bool TrackMeteors;
+ public readonly bool TrackProhibitLG;
+ public readonly bool TrackProhibitSG;
public readonly bool UniqueTargetPerWeapon;
public readonly bool TrackNeutrals;
public readonly bool DisableLosCheck;
@@ -222,6 +224,7 @@ public AmmoType(AmmoDef ammoDef, MyDefinitionId ammoDefinitionId, MyDefinitionId
public readonly bool GoHomeToReload;
public readonly bool DropTargetUntilLoaded;
public readonly bool NoVoxelLosCheck;
+ public readonly bool AllowScopeOutsideObb;
public readonly double MaxTargetSpeed;
public readonly double AzStep;
public readonly double ElStep;
@@ -301,6 +304,7 @@ public WeaponSystem(WeaponStructure structure, MyStringHash partNameIdHash, MySt
GoHomeToReload = Values.HardPoint.Loading.GoHomeToReload;
DropTargetUntilLoaded = Values.HardPoint.Loading.DropTargetUntilLoaded;
NoVoxelLosCheck = Values.HardPoint.Other.NoVoxelLosCheck;
+ AllowScopeOutsideObb = Values.HardPoint.Other.AllowScopeOutsideObb;
TopTargets = Values.Targeting.TopTargets;
CycleTargets = Values.Targeting.CycleTargets;
@@ -372,7 +376,8 @@ public WeaponSystem(WeaponStructure structure, MyStringHash partNameIdHash, MySt
SubSystems(out TargetSubSystems, out OnlySubSystems);
ValidTargetSize(out MinTargetRadius, out MaxTargetRadius);
Session.CreateAnimationSets(Values.Animations, this, out WeaponAnimationSet, out PartEmissiveSet, out PartLinearMoveSet, out AnimationIdLookup, out PartAnimationLengths, out HeatingSubparts, out ParticleEvents, out EmissiveLookup);
-
+ TrackProhibitLG = Values.HardPoint.Other.ProhibitLGTargeting;
+ TrackProhibitSG = Values.HardPoint.Other.ProhibitSGTargeting;
// CheckForBadAnimations();
ApproximatePeakPower = WConst.IdlePower;
@@ -779,22 +784,10 @@ internal WeaponConstants(WeaponDefinition values)
if (wO.MinTargetDistance.HasValue) MinTargetDistance = Math.Max(wO.MinTargetDistance.Value, 0f);
if (wO.RateOfFire.HasValue) RateOfFire = Math.Max(wO.RateOfFire.Value, 0);
if (wO.ReloadTime.HasValue) ReloadTime = Math.Max(wO.ReloadTime.Value, 0);
-
if (wO.DeviateShotAngle.HasValue) DeviateShotAngleRads = MathHelper.ToRadians(Math.Max(wO.DeviateShotAngle.Value, 0f));
if (wO.AimingTolerance.HasValue) AimingToleranceRads = MathHelperD.ToRadians(wO.AimingTolerance.Value <= 0 ? 180 : wO.AimingTolerance.Value);
- //if (wO.InventorySize.HasValue)
-
if (wO.HeatPerShot.HasValue) HeatPerShot = Math.Max(wO.HeatPerShot.Value, 0);
- //if (wO.MaxHeat.HasValue)
if (wO.HeatSinkRate.HasValue) HeatSinkRate = Math.Max(wO.HeatSinkRate.Value, 0);
- //if (wO.Cooldown.HasValue)
-
- //if (wO.ConstructPartCap.HasValue)
- //if (wO.RestrictionRadius.HasValue)
- //if (wO.CheckInflatedBox.HasValue)
- //if (wO.CheckForAnyWeapon.HasValue)
- //if (wO.MuzzleCheck.HasValue)
-
if (wO.IdlePower.HasValue) IdlePower = Math.Max(wO.IdlePower.Value, 0.001f);
}
}
diff --git a/Data/Scripts/CoreSystems/Definitions/PartAnimation.cs b/Data/Scripts/CoreSystems/Definitions/PartAnimation.cs
index 193b3fcc..b390cda7 100644
--- a/Data/Scripts/CoreSystems/Definitions/PartAnimation.cs
+++ b/Data/Scripts/CoreSystems/Definitions/PartAnimation.cs
@@ -61,7 +61,6 @@ public struct EmissiveState
internal bool Running;
internal bool Triggered;
internal bool CanPlay;
- //internal bool Paused;
internal uint StartTick;
internal List PlayTicks;
diff --git a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/AiValues.cs b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/AiValues.cs
index 97c3dad6..17a905d8 100644
--- a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/AiValues.cs
+++ b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/AiValues.cs
@@ -1,5 +1,4 @@
-using System.Collections.Generic;
-using ProtoBuf;
+using ProtoBuf;
namespace CoreSystems
{
diff --git a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/AmmoConstants.cs b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/AmmoConstants.cs
index 9ce41767..8e631e7a 100644
--- a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/AmmoConstants.cs
+++ b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/AmmoConstants.cs
@@ -49,6 +49,7 @@ public enum Texture
public readonly MySoundPair VoxelSoundPair;
public readonly MySoundPair PlayerSoundPair;
public readonly MySoundPair FloatingSoundPair;
+ public readonly MySoundPair WaterSoundPair;
public readonly MyAmmoMagazineDefinition MagazineDef;
public readonly ApproachConstants[] Approaches;
public readonly AmmoDef[] AmmoPattern;
@@ -76,7 +77,6 @@ public enum Texture
public readonly Vector4 LinearSegmentColorEnd;
public readonly Vector4 LinearTrailColor;
public readonly string ModelPath;
- public readonly string HitParticleStr;
public readonly string DetParticleStr;
public readonly string DetSoundStr;
public readonly string ShotSoundStr;
@@ -108,8 +108,6 @@ public enum Texture
public readonly int FragGroupDelay;
public readonly int DeformDelay;
public readonly int OffsetTime;
- public readonly uint OnHitProcInterval;
- public readonly uint OnHitDuration;
public readonly uint FakeVoxelHitTicks;
public readonly bool HasApproaches;
public readonly bool KeepAliveAfterTargetLoss;
@@ -136,6 +134,9 @@ public enum Texture
public readonly bool IsField;
public readonly bool AmmoParticle;
public readonly bool HitParticle;
+ public readonly bool ShieldHitParticle;
+ public readonly bool VoxelHitParticle;
+ public readonly bool WaterHitParticle;
public readonly bool CustomDetParticle;
public readonly bool FieldParticle;
public readonly bool AmmoSkipAccel;
@@ -161,6 +162,9 @@ public enum Texture
public readonly bool AmmoParticleNoCull;
public readonly bool FieldParticleNoCull;
public readonly bool HitParticleNoCull;
+ public readonly bool ShieldHitParticleNoCull;
+ public readonly bool WaterHitParticleNoCull;
+ public readonly bool VoxelHitParticleNoCull;
public readonly bool DrawLine;
public readonly bool Ewar;
public readonly bool NonAntiSmartEwar;
@@ -230,6 +234,7 @@ public enum Texture
public readonly bool PlayerSound;
public readonly bool FloatingSound;
public readonly bool ShieldSound;
+ public readonly bool WaterSound;
public readonly bool IsDrone;
public readonly bool IsSmart;
public readonly bool AccelClearance;
@@ -244,8 +249,8 @@ public enum Texture
public readonly bool EwarFieldTrigger;
public readonly bool ZeroEffortNav;
public readonly bool ProjectilesFirst;
- public readonly bool OnHit;
public readonly bool OverrideWeaponEffect;
+ public readonly bool IgnoreAntiSmarts;
public readonly float LargeGridDmgScale;
public readonly float SmallGridDmgScale;
public readonly float OffsetRatio;
@@ -402,7 +407,7 @@ internal AmmoConstants(WeaponSystem.AmmoType ammo, WeaponDefinition wDef, Weapon
ComputeSmarts(ammo, out IsSmart, out Roam, out NoTargetApproach, out AccelClearance, out OverrideTarget, out TargetOffSet,
out FocusOnly, out FocusEviction, out NoSteering, out AdvancedSmartSteering, out KeepAliveAfterTargetLoss, out NoTargetExpire, out ZeroEffortNav, out ScanRange, out OffsetMinRangeSqr,
- out Aggressiveness, out NavAcceleration, out MinTurnSpeedSqr, out OffsetRatio, out MaxChaseTime, out MaxTargets, out OffsetTime);
+ out Aggressiveness, out NavAcceleration, out MinTurnSpeedSqr, out OffsetRatio, out MaxChaseTime, out MaxTargets, out OffsetTime, out IgnoreAntiSmarts);
IsGuided = TravelTo || IsMine || IsDrone || IsSmart;
@@ -411,11 +416,17 @@ internal AmmoConstants(WeaponSystem.AmmoType ammo, WeaponDefinition wDef, Weapon
AmmoParticleNoCull = ammo.AmmoDef.AmmoGraphics.Particles.Ammo.DisableCameraCulling;
HitParticleNoCull = ammo.AmmoDef.AmmoGraphics.Particles.Hit.DisableCameraCulling;
+ ShieldHitParticleNoCull = ammo.AmmoDef.AmmoGraphics.Particles.ShieldHit.DisableCameraCulling;
+ VoxelHitParticleNoCull = ammo.AmmoDef.AmmoGraphics.Particles.VoxelHit.DisableCameraCulling;
+ WaterHitParticleNoCull = ammo.AmmoDef.AmmoGraphics.Particles.WaterHit.DisableCameraCulling;
FieldParticleNoCull = ammo.AmmoDef.Ewar.Field.Particle.DisableCameraCulling;
AmmoParticle = !string.IsNullOrEmpty(ammo.AmmoDef.AmmoGraphics.Particles.Ammo.Name);
HitParticle = !string.IsNullOrEmpty(ammo.AmmoDef.AmmoGraphics.Particles.Hit.Name);
- HitParticleStr = ammo.AmmoDef.AmmoGraphics.Particles.Hit.Name;
+ ShieldHitParticle = !string.IsNullOrEmpty(ammo.AmmoDef.AmmoGraphics.Particles.ShieldHit.Name);
+ VoxelHitParticle = !string.IsNullOrEmpty(ammo.AmmoDef.AmmoGraphics.Particles.VoxelHit.Name);
+ WaterHitParticle = !string.IsNullOrEmpty(ammo.AmmoDef.AmmoGraphics.Particles.WaterHit.Name);
+
EndOfLifeAv = !ammo.AmmoDef.AreaOfDamage.EndOfLife.NoVisuals && ammo.AmmoDef.AreaOfDamage.EndOfLife.Enable;
OverrideWeaponEffect = !string.IsNullOrEmpty(ammo.AmmoDef.AmmoGraphics.Particles.WeaponEffect1Override.Name);
@@ -493,12 +504,12 @@ internal AmmoConstants(WeaponSystem.AmmoType ammo, WeaponDefinition wDef, Weapon
Energy(ammo, system, wDef, out EnergyAmmo, out MustCharge, out Reloadable, out EnergyCost, out EnergyMagSize, out ChargSize, out BurstMode, out HasShotReloadDelay, out PowerPerTick);
Sound(ammo, system,out HitSound, out HitSoundPair, out AmmoTravelSound, out TravelSoundPair, out ShotSound, out ShotSoundPair, out DetonationSound, out DetSoundPair, out HitSoundDistSqr, out AmmoTravelSoundDistSqr, out AmmoSoundMaxDistSqr,
- out ShotSoundDistSqr, out DetonationSoundDistSqr, out ShotSoundStr, out VoxelSound, out VoxelSoundPair, out FloatingSound, out FloatingSoundPair, out PlayerSound, out PlayerSoundPair, out ShieldSound, out ShieldSoundPair);
+ out ShotSoundDistSqr, out DetonationSoundDistSqr, out ShotSoundStr, out VoxelSound, out VoxelSoundPair, out FloatingSound, out FloatingSoundPair, out PlayerSound, out PlayerSoundPair, out ShieldSound, out ShieldSoundPair, out WaterSound, out WaterSoundPair);
MagazineSize = EnergyAmmo ? EnergyMagSize : MagazineDef.Capacity;
- if (EnergyAmmo && MagazineSize == 0)
- Log.Line($"{ammo.AmmoDef.AmmoRound} has a magazine capacity of zero, Girax error detected! Check your magazine sbc entry for a tag");
+ if (EnergyAmmo && MagazineSize == 0 && ammo.AmmoDef.HardPointUsable)
+ Log.Line($"{ammo.AmmoDef.AmmoRound} has a magazine capacity of zero, Girax error detected! Check your magazine sbc entry for a tag or ammo for EnergyMagazineSize");
MagsToLoad = wDef.HardPoint.Loading.MagsToLoad > 0 ? wDef.HardPoint.Loading.MagsToLoad : 1;
MaxAmmo = MagsToLoad * MagazineSize;
@@ -552,9 +563,6 @@ internal AmmoConstants(WeaponSystem.AmmoType ammo, WeaponDefinition wDef, Weapon
ProjectilesFirst = system.ProjectilesFirst;
PreComputedMath = new PreComputedMath(ammo, this);
-
- OnHit = false;
- OnHitProcInterval = 0;
}
internal void Purge()
@@ -591,7 +599,7 @@ internal void Purge()
private void ComputeSmarts(WeaponSystem.AmmoType ammo, out bool isSmart, out bool roam, out bool noTargetApproach, out bool accelClearance, out bool overrideTarget, out bool targetOffSet,
out bool focusOnly, out bool focusEviction, out bool noSteering, out bool advancedSmartSteering, out bool keepAliveAfterTargetLoss, out bool noTargetExpire, out bool zeroEffortNav, out double scanRange, out double offsetMinRangeSqr,
- out double aggressiveness, out double navAcceleration, out double minTurnSpeedSqr, out float offsetRatio, out int maxChaseTime, out int maxTargets, out int offsetTime)
+ out double aggressiveness, out double navAcceleration, out double minTurnSpeedSqr, out float offsetRatio, out int maxChaseTime, out int maxTargets, out int offsetTime, out bool ignoreAntiSmarts)
{
isSmart = ammo.AmmoDef.Trajectory.Guidance == TrajectoryDef.GuidanceType.Smart || ammo.AmmoDef.Trajectory.Guidance == TrajectoryDef.GuidanceType.DetectSmart;
@@ -626,6 +634,7 @@ private void ComputeSmarts(WeaponSystem.AmmoType ammo, out bool isSmart, out boo
offsetTime = ammo.AmmoDef.Trajectory.Smarts.OffsetTime;
noTargetApproach = ammo.AmmoDef.Trajectory.Smarts.NoTargetApproach;
zeroEffortNav = ammo.AmmoDef.Trajectory.Smarts.AltNavigation;
+ ignoreAntiSmarts = ammo.AmmoDef.Trajectory.Smarts.IgnoreAntiSmarts;
}
@@ -1094,7 +1103,8 @@ private void Energy(WeaponSystem.AmmoType ammoPair, WeaponSystem system, WeaponD
private void Sound(WeaponSystem.AmmoType ammo, WeaponSystem system, out bool hitSound, out MySoundPair hitSoundPair, out bool ammoTravelSound, out MySoundPair travelSoundPair, out bool shotSound, out MySoundPair shotSoundPair,
out bool detSound, out MySoundPair detSoundPair, out float hitSoundDistSqr, out float ammoTravelSoundDistSqr, out float ammoSoundMaxDistSqr, out float shotSoundDistSqr, out float detSoundDistSqr, out string rawShotSoundStr,
- out bool voxelSound, out MySoundPair voxelSoundPair, out bool floatingSound, out MySoundPair floatingSoundPair, out bool playerSound, out MySoundPair playerSoundPair, out bool shieldSound, out MySoundPair shieldSoundPair)
+ out bool voxelSound, out MySoundPair voxelSoundPair, out bool floatingSound, out MySoundPair floatingSoundPair, out bool playerSound, out MySoundPair playerSoundPair, out bool shieldSound, out MySoundPair shieldSoundPair,
+ out bool waterSound, out MySoundPair waterSoundPair)
{
var ammoDef = ammo.AmmoDef;
var weaponShotSound = !string.IsNullOrEmpty(system.Values.HardPoint.Audio.FiringSound);
@@ -1138,19 +1148,19 @@ private void Sound(WeaponSystem.AmmoType ammo, WeaponSystem system, out bool hit
if (ob != null) hitSoundDistSqr = ob.MaxDistance * ob.MaxDistance;
if (hitSoundDistSqr > ammoSoundMaxDistSqr) ammoSoundMaxDistSqr = hitSoundDistSqr;
}
- else if (ammoTravelSound && (id == travelSoundStr || id == ammoDef.AmmoAudio.TravelSound))
+ if (ammoTravelSound && (id == travelSoundStr || id == ammoDef.AmmoAudio.TravelSound))
{
var ob = def.GetObjectBuilder() as MyObjectBuilder_AudioDefinition;
if (ob != null) ammoTravelSoundDistSqr = ob.MaxDistance * ob.MaxDistance;
if (ammoTravelSoundDistSqr > ammoSoundMaxDistSqr) ammoSoundMaxDistSqr = ammoTravelSoundDistSqr;
}
- else if (shotSound && (id == shotSoundStr || id == rawShotSoundStr))
+ if (shotSound && (id == shotSoundStr || id == rawShotSoundStr))
{
var ob = def.GetObjectBuilder() as MyObjectBuilder_AudioDefinition;
if (ob != null) shotSoundDistSqr = ob.MaxDistance * ob.MaxDistance;
if (shotSoundDistSqr > ammoSoundMaxDistSqr) ammoSoundMaxDistSqr = shotSoundDistSqr;
}
- else if (detSound && (id == detSoundStr || id == DetSoundStr))
+ if (detSound && (id == detSoundStr || id == DetSoundStr))
{
var ob = def.GetObjectBuilder() as MyObjectBuilder_AudioDefinition;
if (ob != null) detSoundDistSqr = ob.MaxDistance * ob.MaxDistance;
@@ -1169,6 +1179,9 @@ private void Sound(WeaponSystem.AmmoType ammo, WeaponSystem system, out bool hit
shieldSound = !string.IsNullOrEmpty(ammoDef.AmmoAudio.ShieldHitSound);
shieldSoundPair = shieldSound ? new MySoundPair(ammoDef.AmmoAudio.ShieldHitSound, false) : hitSound ? new MySoundPair(ammoDef.AmmoAudio.HitSound, false) : null;
+
+ waterSound = !string.IsNullOrEmpty(ammoDef.AmmoAudio.WaterHitSound);
+ waterSoundPair = waterSound ? new MySoundPair(ammoDef.AmmoAudio.WaterHitSound, false) : null;
}
private MyEntity PrimeEntityActivator()
@@ -1244,34 +1257,6 @@ private void LoadModifiers(AmmoDef ammoDef, out AmmoOverride overrides, out bool
}
- //private void GetModifiableValues(AmmoDef ammoDef, out float baseDamage, out float health, out float gravityMultiplier, out float maxTrajectory, out float maxTrajectorySqr, out bool energyBaseDmg, out bool energyAreaDmg, out bool energyDetDmg, out bool energyShieldDmg, out double shieldModifier, out float fallOffDistance, out float fallOffMinMult, out float mass, out float shieldBypassRaw)
- //{
- // baseDamage = AmmoModsFound && _modifierMap[BaseDmgStr].HasData() ? _modifierMap[BaseDmgStr].GetAsFloat : ammoDef.BaseDamage;
-
- // if (baseDamage < 0.000001)
- // baseDamage = 0.000001f;
-
- // health = AmmoModsFound && _modifierMap[HealthStr].HasData() ? _modifierMap[HealthStr].GetAsFloat : ammoDef.Health;
- // gravityMultiplier = AmmoModsFound && _modifierMap[GravityStr].HasData() ? _modifierMap[GravityStr].GetAsFloat : ammoDef.Trajectory.GravityMultiplier;
- // maxTrajectory = AmmoModsFound && _modifierMap[MaxTrajStr].HasData() ? _modifierMap[MaxTrajStr].GetAsFloat : ammoDef.Trajectory.MaxTrajectory;
- // maxTrajectorySqr = maxTrajectory * maxTrajectory;
- // energyBaseDmg = AmmoModsFound && _modifierMap[EnergyBaseDmgStr].HasData() ? _modifierMap[EnergyBaseDmgStr].GetAsBool : ammoDef.DamageScales.DamageType.Base != DamageTypes.Damage.Kinetic;
- // energyAreaDmg = AmmoModsFound && _modifierMap[EnergyAreaDmgStr].HasData() ? _modifierMap[EnergyAreaDmgStr].GetAsBool : ammoDef.DamageScales.DamageType.AreaEffect != DamageTypes.Damage.Kinetic;
- // energyDetDmg = AmmoModsFound && _modifierMap[EnergyDetDmgStr].HasData() ? _modifierMap[EnergyDetDmgStr].GetAsBool : ammoDef.DamageScales.DamageType.Detonation != DamageTypes.Damage.Kinetic;
- // energyShieldDmg = AmmoModsFound && _modifierMap[EnergyShieldDmgStr].HasData() ? _modifierMap[EnergyShieldDmgStr].GetAsBool : ammoDef.DamageScales.DamageType.Shield != DamageTypes.Damage.Kinetic;
-
- // var givenShieldModifier = AmmoModsFound && _modifierMap[ShieldModStr].HasData() ? _modifierMap[ShieldModStr].GetAsDouble : ammoDef.DamageScales.Shields.Modifier;
- // shieldModifier = givenShieldModifier < 0 ? 1 : givenShieldModifier;
-
- // fallOffDistance = AmmoModsFound && _modifierMap[FallOffDistanceStr].HasData() ? _modifierMap[FallOffDistanceStr].GetAsFloat : ammoDef.DamageScales.FallOff.Distance;
- // fallOffMinMult = AmmoModsFound && _modifierMap[FallOffMinMultStr].HasData() ? _modifierMap[FallOffMinMultStr].GetAsFloat : ammoDef.DamageScales.FallOff.MinMultipler;
-
- // mass = AmmoModsFound && _modifierMap[MassStr].HasData() ? _modifierMap[MassStr].GetAsFloat : ammoDef.Mass;
-
- // shieldBypassRaw = AmmoModsFound && _modifierMap[ShieldBypassStr].HasData() ? _modifierMap[ShieldBypassStr].GetAsFloat : ammoDef.DamageScales.Shields.BypassModifier;
- //}
-
-
private int mexLogLevel = 0;
private void GetPeakDps(WeaponSystem.AmmoType ammoDef, WeaponSystem system, WeaponDefinition wDef, out float peakDps, out float effectiveDps, out float dpsWoInaccuracy, out float shotsPerSec, out float realShotsPerSec, out float baseDps, out float areaDps, out float detDps, out float realShotsPerMin)
{
diff --git a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/ConstructValues.cs b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/ConstructValues.cs
index 7c94db5d..17d56e20 100644
--- a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/ConstructValues.cs
+++ b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/ConstructValues.cs
@@ -6,7 +6,6 @@ namespace CoreSystems
[ProtoContract]
public class ConstructDataValues
{
- //[ProtoMember(1)] public int Version = Session.VersionControl;
[ProtoMember(2)] public FocusData FocusData;
public bool Sync(Constructs construct, ConstructDataValues sync, bool localCall = false)
diff --git a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Control/ProtoControl.cs b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Control/ProtoControl.cs
index 17dcccf4..d9243301 100644
--- a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Control/ProtoControl.cs
+++ b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Control/ProtoControl.cs
@@ -1,11 +1,8 @@
using CoreSystems.Platform;
using CoreSystems.Support;
using ProtoBuf;
-using Sandbox.ModAPI;
-using System;
using System.ComponentModel;
using static CoreSystems.Support.CoreComponent;
-using static CoreSystems.Support.WeaponDefinition.TargetingDef;
namespace CoreSystems
{
diff --git a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/CoreSettings.cs b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/CoreSettings.cs
index 58fa3e15..b7bbac47 100644
--- a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/CoreSettings.cs
+++ b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/CoreSettings.cs
@@ -211,6 +211,8 @@ public class ArmorOverride
[ProtoMember(22)] public Overrides DefinitionOverrides;
[ProtoMember(23)] public float LargeGridDamageMultiplier = 1;
[ProtoMember(24)] public float SmallGridDamageMultiplier = 1;
+ [ProtoMember(25)] public bool ProhibitHUDPainter = false;
+
}
[ProtoContract]
diff --git a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Misc.cs b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Misc.cs
index b7e817ac..010108ad 100644
--- a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Misc.cs
+++ b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Misc.cs
@@ -1,9 +1,7 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
using CoreSystems.Platform;
using CoreSystems.Support;
using ProtoBuf;
-using static VRage.Game.ObjectBuilders.Definitions.MyObjectBuilder_GameDefinition;
namespace CoreSystems
{
@@ -63,9 +61,6 @@ internal class PlayerMouseData
[ProtoContract]
public class WeaponRandomGenerator
{
- //[ProtoMember(1)] public int TurretCurrentCounter;
- //[ProtoMember(2)] public int ClientProjectileCurrentCounter;
- //[ProtoMember(3)] public int AcquireCurrentCounter;
[ProtoMember(4)] public int CurrentSeed;
public XorShiftRandomStruct TurretRandom;
public XorShiftRandomStruct AcquireRandom;
diff --git a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/PacketTypes.cs b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/PacketTypes.cs
index 68461593..1bb080ef 100644
--- a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/PacketTypes.cs
+++ b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/PacketTypes.cs
@@ -1,8 +1,6 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.ComponentModel;
using CoreSystems.Settings;
-using CoreSystems.Support;
using ProtoBuf;
using VRageMath;
using static CoreSystems.Support.CoreComponent;
@@ -106,7 +104,7 @@ public enum PacketType
[ProtoInclude(40, typeof(ControlStatePacket))]
[ProtoInclude(41, typeof(BlackListPacket))]
[ProtoInclude(42, typeof(DronePacket))]
- [ProtoInclude(43, typeof(HandWeaponDebugPacket))]
+ //[ProtoInclude(43, typeof(HandWeaponDebugPacket))]
[ProtoInclude(44, typeof(PingPacket))]
[ProtoInclude(45, typeof(ProjectileSyncTargetPacket))]
@@ -155,22 +153,6 @@ public override void CleanUp()
}
}
- [ProtoContract]
- public class HandWeaponDebugPacket : Packet
- {
- [ProtoMember(1)] internal uint LastHitTick = uint.MaxValue;
- [ProtoMember(2)] internal uint LastShootTick = uint.MaxValue;
- [ProtoMember(3)] internal Vector3D ShootStart;
- [ProtoMember(4)] internal Vector3D ShootEnd;
- [ProtoMember(5)] internal Vector3D HitStart;
- [ProtoMember(6)] internal Vector3D HitEnd;
-
- public override void CleanUp()
- {
- base.CleanUp();
- }
- }
-
[ProtoContract]
public class ProjectileSyncPositionPacket : Packet
{
diff --git a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Upgrade/ProtoUpgrade.cs b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Upgrade/ProtoUpgrade.cs
index 0ac7037a..627141bf 100644
--- a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Upgrade/ProtoUpgrade.cs
+++ b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Upgrade/ProtoUpgrade.cs
@@ -1,7 +1,6 @@
using System;
using System.ComponentModel;
using CoreSystems.Platform;
-using CoreSystems.Support;
using ProtoBuf;
using static CoreSystems.Support.WeaponDefinition.TargetingDef;
using static CoreSystems.Support.CoreComponent;
diff --git a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Weapon/ProtoWeapon.cs b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Weapon/ProtoWeapon.cs
index 1cf29cbe..5bd3015f 100644
--- a/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Weapon/ProtoWeapon.cs
+++ b/Data/Scripts/CoreSystems/Definitions/SerializedConfigs/Weapon/ProtoWeapon.cs
@@ -597,6 +597,7 @@ public enum MoveModes
Moving,
Mobile,
Moored,
+ ShipAny
}
public enum ControlModes
diff --git a/Data/Scripts/CoreSystems/EntityComp/Controls/Control/ControlActions.cs b/Data/Scripts/CoreSystems/EntityComp/Controls/Control/ControlActions.cs
index a655ac6f..a6d50366 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Controls/Control/ControlActions.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Controls/Control/ControlActions.cs
@@ -1,10 +1,7 @@
-using System;
-using System.Text;
+using System.Text;
using CoreSystems.Platform;
using CoreSystems.Support;
using Sandbox.ModAPI;
-using VRageMath;
-using static CoreSystems.Support.CoreComponent.Trigger;
namespace CoreSystems.Control
{
@@ -47,16 +44,6 @@ internal static void TerminActionCycleShootModeControl(IMyTerminalBlock blk)
ControlSys.ControlComponent.RequestSetValue(comp, "ShootMode", value, Session.I.PlayerId);
}
- internal static void ShootModeWriterControl(IMyTerminalBlock blk, StringBuilder sb)
- {
- var comp = blk.Components.Get() as ControlSys.ControlComponent;
- if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
-
- var altAiControlName = !comp.HasAim && comp.Data.Repo.Values.Set.Overrides.ShootMode == Weapon.ShootManager.ShootModes.AiShoot ? InActive : comp.Data.Repo.Values.Set.Overrides.ShootMode.ToString();
- sb.Append(altAiControlName);
- }
-
-
internal static void TerminalActionMovementModeControl(IMyTerminalBlock blk)
{
@@ -65,7 +52,7 @@ internal static void TerminalActionMovementModeControl(IMyTerminalBlock blk)
return;
var numValue = (int)comp.Data.Repo.Values.Set.Overrides.MoveMode;
- var value = numValue + 1 <= 3 ? numValue + 1 : 0;
+ var value = numValue + 1 <= 4 ? numValue + 1 : 0;
ControlSys.ControlComponent.RequestSetValue(comp, "MovementModes", value, Session.I.PlayerId);
}
@@ -301,6 +288,14 @@ internal static void TerminalActionToggleSmallGridControl(IMyTerminalBlock blk)
#endregion
#region Writters
+ internal static void ShootModeWriterControl(IMyTerminalBlock blk, StringBuilder sb)
+ {
+ var comp = blk.Components.Get() as ControlSys.ControlComponent;
+ if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
+
+ var altAiControlName = !comp.HasAim && comp.Data.Repo.Values.Set.Overrides.ShootMode == Weapon.ShootManager.ShootModes.AiShoot ? Localization.GetText("ControlsInactive") : Localization.GetText("Shoot" + comp.Data.Repo.Values.Set.Overrides.ShootMode);
+ sb.Append(altAiControlName);
+ }
internal static void ShareFireControlWriterControl(IMyTerminalBlock blk, StringBuilder sb)
{
@@ -439,7 +434,7 @@ internal static void ControlStateWriterControl(IMyTerminalBlock blk, StringBuild
{
var comp = blk.Components.Get() as ControlSys.ControlComponent;
if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
- sb.Append(comp.Data.Repo.Values.Set.Overrides.Control);
+ sb.Append(Localization.GetText("Control" + comp.Data.Repo.Values.Set.Overrides.Control));
}
internal static void MovementModeWriterControl(IMyTerminalBlock blk, StringBuilder sb)
@@ -447,7 +442,7 @@ internal static void MovementModeWriterControl(IMyTerminalBlock blk, StringBuild
var comp = blk.Components.Get() as ControlSys.ControlComponent;
if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
- sb.Append(comp.Data.Repo.Values.Set.Overrides.MoveMode);
+ sb.Append(Localization.GetText("Move" + comp.Data.Repo.Values.Set.Overrides.MoveMode));
}
internal static void SubSystemWriterControl(IMyTerminalBlock blk, StringBuilder sb)
@@ -455,7 +450,7 @@ internal static void SubSystemWriterControl(IMyTerminalBlock blk, StringBuilder
var comp = blk.Components.Get() as ControlSys.ControlComponent;
if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
- sb.Append(comp.Data.Repo.Values.Set.Overrides.SubSystem);
+ sb.Append(Localization.GetText("Subtype" + comp.Data.Repo.Values.Set.Overrides.SubSystem));
}
internal static void RepelWriterControl(IMyTerminalBlock blk, StringBuilder sb)
diff --git a/Data/Scripts/CoreSystems/EntityComp/Controls/Control/ControlUi.cs b/Data/Scripts/CoreSystems/EntityComp/Controls/Control/ControlUi.cs
index 8e98baea..fe404444 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Controls/Control/ControlUi.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Controls/Control/ControlUi.cs
@@ -4,11 +4,9 @@
using CoreSystems.Support;
using Sandbox.Game.Entities;
using Sandbox.ModAPI;
-using VRage.Game;
using VRage.Game.Entity;
using VRage.ModAPI;
using VRage.Utils;
-using VRageMath;
namespace CoreSystems
{
diff --git a/Data/Scripts/CoreSystems/EntityComp/Controls/CreateCustomActions.cs b/Data/Scripts/CoreSystems/EntityComp/Controls/CreateCustomActions.cs
index 9a1a4682..40863467 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Controls/CreateCustomActions.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Controls/CreateCustomActions.cs
@@ -374,10 +374,10 @@ public static void CreateLargeGrid(Session session)
{
var action = MyAPIGateway.TerminalControls.CreateAction("LargeGrid");
action.Icon = @"Textures\GUI\Icons\Actions\Toggle.dds";
- action.Name = new StringBuilder("Target Large Grids");
+ action.Name = new StringBuilder(Localization.GetText("ActionTargetLargeGrids"));
action.Action = CustomActions.TerminalActionToggleLargeGrid;
action.Writer = CustomActions.LargeGridWriter;
- action.Enabled = TerminalHelpers.HasTracking;
+ action.Enabled = TerminalHelpers.HasTrackingNoSizeProhibition;
action.ValidForGroups = true;
MyAPIGateway.TerminalControls.AddAction(action);
@@ -388,10 +388,10 @@ public static void CreateSmallGrid(Session session)
{
var action = MyAPIGateway.TerminalControls.CreateAction("SmallGrid");
action.Icon = @"Textures\GUI\Icons\Actions\Toggle.dds";
- action.Name = new StringBuilder("Target Small Grids");
+ action.Name = new StringBuilder(Localization.GetText("ActionTargetSmallGrids"));
action.Action = CustomActions.TerminalActionToggleSmallGrid;
action.Writer = CustomActions.SmallGridWriter;
- action.Enabled = TerminalHelpers.HasTracking;
+ action.Enabled = TerminalHelpers.HasTrackingNoSizeProhibition;
action.ValidForGroups = true;
MyAPIGateway.TerminalControls.AddAction(action);
@@ -401,7 +401,7 @@ public static void CreateAngularTracking(Session session)
{
var action = MyAPIGateway.TerminalControls.CreateAction("AngularTracking");
action.Icon = @"Textures\GUI\Icons\Actions\Toggle.dds";
- action.Name = new StringBuilder("Predict Targets Angular Motion");
+ action.Name = new StringBuilder(Localization.GetText("TrackAngular"));
action.Action = CustomActions.TerminalActionToggleAngularTracking;
action.Writer = CustomActions.AngularTrackingWriter;
action.Enabled = TerminalHelpers.HasTracking;
@@ -415,7 +415,7 @@ internal static void CreateObjectiveMode(Session session)
{
var action = MyAPIGateway.TerminalControls.CreateAction("ObjectiveMode");
action.Icon = @"Textures\GUI\Icons\Actions\Toggle.dds";
- action.Name = new StringBuilder("Cycle Objective Mode");//Need localization input
+ action.Name = new StringBuilder(Localization.GetText("ActionCycleObjective"));
action.Action = CustomActions.TerminActionCycleObjectiveMode;
action.Writer = CustomActions.ObjectiveModeWriter;
action.Enabled = TerminalHelpers.HasTracking;
@@ -433,7 +433,7 @@ public static void CreateFocusTargets(Session session)
action.Name = new StringBuilder(Localization.GetText("ActionFocusTargets"));
action.Action = CustomActions.TerminalActionToggleFocusTargets;
action.Writer = CustomActions.FocusTargetsWriter;
- action.Enabled = TerminalHelpers.HasTracking;
+ action.Enabled = TerminalHelpers.HasTrackingExceptCommSlave;
action.ValidForGroups = true;
MyAPIGateway.TerminalControls.AddAction(action);
@@ -504,6 +504,31 @@ public static void CreateMinSize(Session session)
session.CustomActions.Add(action1);
}
+ public static void CreateMaxRange(Session session)
+ {
+ var action0 = MyAPIGateway.TerminalControls.CreateAction("MaxRange Increase");
+ action0.Icon = @"Textures\GUI\Icons\Actions\Increase.dds";
+ action0.Name = new StringBuilder(Localization.GetText("ActionMaxRangeIncrease"));
+ action0.Action = CustomActions.TerminalActionMaxRangeIncrease;
+ action0.Writer = CustomActions.MaxRangeWriter;
+ action0.Enabled = TerminalHelpers.HasTracking;
+ action0.ValidForGroups = true;
+
+ MyAPIGateway.TerminalControls.AddAction(action0);
+ session.CustomActions.Add(action0);
+
+ var action1 = MyAPIGateway.TerminalControls.CreateAction("MaxRange Decrease");
+ action1.Icon = @"Textures\GUI\Icons\Actions\Decrease.dds";
+ action1.Name = new StringBuilder(Localization.GetText("ActionMaxRangeDecrease"));
+ action1.Action = CustomActions.TerminalActionMaxRangeDecrease;
+ action1.Writer = CustomActions.MaxRangeWriter;
+ action1.Enabled = TerminalHelpers.HasTracking;
+ action1.ValidForGroups = true;
+
+ MyAPIGateway.TerminalControls.AddAction(action1);
+ session.CustomActions.Add(action1);
+ }
+
public static void CreateMovementState(Session session)
{
var action = MyAPIGateway.TerminalControls.CreateAction("TrackingMode");
@@ -609,43 +634,6 @@ public static void CreateDecoy(Session session)
session.CustomActions.Add(action);
}
- internal static void CreateOnOffActionSet(Session session, IMyTerminalControlOnOffSwitch tc, string name, Func enabler, bool group = false)
- {
- var action0 = MyAPIGateway.TerminalControls.CreateAction($"WC_{name}_Toggle");
- action0.Icon = @"Textures\GUI\Icons\Actions\Toggle.dds";
- action0.Name = new StringBuilder(Localization.GetTextWithoutFallback($"{name} Toggle On/Off"));
- action0.Action = b => tc.Setter(b, !tc.Getter(b));
- action0.Writer = (b, t) => t.Append(tc.Getter(b) ? tc.OnText : tc.OffText);
- action0.Enabled = enabler;
- action0.ValidForGroups = group;
-
- MyAPIGateway.TerminalControls.AddAction(action0);
- session.CustomActions.Add(action0);
-
- var action1 = MyAPIGateway.TerminalControls.CreateAction($"WC_{name}_Toggle_On");
- action1.Icon = @"Textures\GUI\Icons\Actions\SwitchOn.dds";
- action1.Name = new StringBuilder(Localization.GetTextWithoutFallback($"{name} On"));
- action1.Action = b => tc.Setter(b, true);
- action1.Writer = (b, t) => t.Append(tc.Getter(b) ? tc.OnText : tc.OffText);
- action1.Enabled = enabler;
- action1.ValidForGroups = group;
-
- MyAPIGateway.TerminalControls.AddAction(action1);
- session.CustomActions.Add(action1);
-
- var action2 = MyAPIGateway.TerminalControls.CreateAction($"WC_{name}_Toggle_Off");
- action2.Icon = @"Textures\GUI\Icons\Actions\SwitchOff.dds";
- action2.Name = new StringBuilder(Localization.GetTextWithoutFallback($"{name} Off"));
- action2.Action = b => tc.Setter(b, true);
- action2.Writer = (b, t) => t.Append(tc.Getter(b) ? tc.OnText : tc.OffText);
- action2.Enabled = enabler;
- action2.ValidForGroups = group;
-
- MyAPIGateway.TerminalControls.AddAction(action2);
- session.CustomActions.Add(action2);
-
- }
-
internal static void CreateOnOffActionSet(Session session, IMyTerminalControlCheckbox tc, string name, Func enabler, bool group = false)
{
var action0 = MyAPIGateway.TerminalControls.CreateAction($"WC_{name}_Toggle");
diff --git a/Data/Scripts/CoreSystems/EntityComp/Controls/TerminalHelpers.cs b/Data/Scripts/CoreSystems/EntityComp/Controls/TerminalHelpers.cs
index 1b5e294a..0c4a2dae 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Controls/TerminalHelpers.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Controls/TerminalHelpers.cs
@@ -6,10 +6,8 @@
using Sandbox.ModAPI;
using Sandbox.ModAPI.Interfaces.Terminal;
using SpaceEngineers.Game.ModAPI;
-using VRage.Game.Entity;
using VRage.ModAPI;
using VRage.Utils;
-using VRageMath;
namespace CoreSystems.Control
{
@@ -17,15 +15,9 @@ public static class TerminalHelpers
{
internal static void AddUiControls(Session session) where T : IMyTerminalBlock
{
-
- //AddComboboxNoAction(session, "Shoot Mode", Localization.GetText("TerminalShootModeTitle"), Localization.GetText("TerminalShootModeTooltip"), BlockUi.GetShootModes, BlockUi.RequestShootModes, BlockUi.ListShootModesNoBurst, Istrue);
AddComboboxNoAction(session, "Shoot Mode", Localization.GetText("TerminalShootModeTitle"), Localization.GetText("TerminalShootModeTooltip"), BlockUi.GetShootModes, BlockUi.RequestShootModes, BlockUi.ListShootModes, IsNotBomb);
-
AddSliderRof(session, "Weapon ROF", Localization.GetText("TerminalWeaponROFTitle"), Localization.GetText("TerminalWeaponROFTooltip"), BlockUi.GetRof, BlockUi.RequestSetRof, UiRofSlider, BlockUi.GetMinRof, BlockUi.GetMaxRof);
-
AddCheckbox(session, "Overload", Localization.GetText("TerminalOverloadTitle"), Localization.GetText("TerminalOverloadTooltip"), BlockUi.GetOverload, BlockUi.RequestSetOverload, true, UiOverLoad);
-
-
AddWeaponCrticalTimeSliderRange(session, "Detonation", Localization.GetText("TerminalDetonationTitle"), Localization.GetText("TerminalDetonationTooltip"), BlockUi.GetArmedTimer, BlockUi.RequestSetArmedTimer, NotCounting, CanBeArmed, BlockUi.GetMinCriticalTime, BlockUi.GetMaxCriticalTime, true);
AddButtonNoAction(session, "StartCount", Localization.GetText("TerminalStartCountTitle"), Localization.GetText("TerminalStartCountTooltip"), BlockUi.StartCountDown, NotCounting, CanBeArmed);
AddButtonNoAction(session, "StopCount", Localization.GetText("TerminalStopCountTitle"), Localization.GetText("TerminalStopCountTooltip"), BlockUi.StopCountDown, IsCounting, CanBeArmed);
@@ -37,48 +29,30 @@ internal static void AddUiControls(Session session) where T : IMyTerminalBloc
internal static void AddTurretOrTrackingControls(Session session) where T : IMyTerminalBlock
{
AddComboboxNoAction(session, "ControlModes", Localization.GetText("TerminalControlModesTitle"), Localization.GetText("TerminalControlModesTooltip"), BlockUi.GetControlMode, BlockUi.RequestControlMode, BlockUi.ListControlModes, TurretOrGuidedAmmo);
-
- AddComboboxNoAction(session, "ObjectiveMode", "Objective Mode", "Select when to cease firing at a block", BlockUi.GetObjectiveMode, BlockUi.RequestObjectiveMode, BlockUi.ListObjectiveModes, HasTracking);
-
- AddComboboxNoAction(session, "PickAmmo", Localization.GetText("TerminalPickAmmoTitle"), Localization.GetText("TerminalPickAmmoTooltip"), BlockUi.GetAmmos, BlockUi.RequestSetAmmo, BlockUi.ListAmmos, AmmoSelection);
-
- AddComboboxNoAction(session, "PickSubSystem", Localization.GetText("TerminalPickSubSystemTitle"), Localization.GetText("TerminalPickSubSystemTooltip"), BlockUi.GetSubSystem, BlockUi.RequestSubSystem, BlockUi.ListSubSystems, HasTracking);
-
+ AddComboboxNoAction(session, "ObjectiveMode", Localization.GetText("TerminalObjectiveTitle"), Localization.GetText("TerminalObjectiveTooltip"), BlockUi.GetObjectiveMode, BlockUi.RequestObjectiveMode, BlockUi.ListObjectiveModes, HasTracking);
AddComboboxNoAction(session, "TrackingMode", Localization.GetText("TerminalTrackingModeTitle"), Localization.GetText("TerminalTrackingModeTooltip"), BlockUi.GetMovementMode, BlockUi.RequestMovementMode, BlockUi.ListMovementModes, HasTracking);
-
+ AddComboboxNoAction(session, "PickAmmo", Localization.GetText("TerminalPickAmmoTitle"), Localization.GetText("TerminalPickAmmoTooltip"), BlockUi.GetAmmos, BlockUi.RequestSetAmmo, BlockUi.ListAmmos, AmmoSelection);
+ AddButtonNoAction(session, "ForceReload", Localization.GetText("ForceReload"), Localization.GetText("TerminalForceReloadTooltip"), BlockUi.ForceReload, EnableForceReload, AmmoSelection);
AddWeaponRangeSliderNoAction(session, "Weapon Range", Localization.GetText("TerminalWeaponRangeTitle"), Localization.GetText("TerminalWeaponRangeTooltip"), BlockUi.GetRange, BlockUi.RequestSetRange, BlockUi.ShowRange, BlockUi.GetMinRange, BlockUi.GetMaxRange, true, false);
Separator(session, "WC_sep2", HasTracking);
- AddOnOffSwitchNoAction(session, "ReportTarget", Localization.GetText("TerminalReportTargetTitle"), Localization.GetText("TerminalReportTargetTooltip"), BlockUi.GetReportTarget, BlockUi.RequestSetReportTarget, true, UiReportTarget);
+ AddOnOffSwitchNoAction(session, "SubSystems", Localization.GetText("TerminalSubSystemsTitle"), Localization.GetText("TerminalSubSystemsTooltip"), BlockUi.GetSubSystems, BlockUi.RequestSetSubSystems, true, HasTracking);
+ AddComboboxNoAction(session, "PickSubSystem", Localization.GetText("TerminalPickSubSystemTitle"), Localization.GetText("TerminalPickSubSystemTooltip"), BlockUi.GetSubSystem, BlockUi.RequestSubSystem, BlockUi.ListSubSystems, HasTracking);
- AddOnOffSwitchNoAction(session, "Neutrals", Localization.GetText("TerminalNeutralsTitle"), Localization.GetText("TerminalNeutralsTooltip"), BlockUi.GetNeutrals, BlockUi.RequestSetNeutrals, true, HasTrackingNeutrals);
+ AddOnOffSwitchNoAction(session, "FocusFire", Localization.GetText("TerminalFocusFireTitle"), Localization.GetText("TerminalFocusFireTooltip"), BlockUi.GetFocusFire, BlockUi.RequestSetFocusFire, true, HasTrackingExceptCommSlave);
+ AddOnOffSwitchNoAction(session, "Repel", Localization.GetText("TerminalRepelTitle"), Localization.GetText("TerminalRepelTooltip"), BlockUi.GetRepel, BlockUi.RequestSetRepel, true, HasTracking);
+ AddOnOffSwitchNoAction(session, "Neutrals", Localization.GetText("TerminalNeutralsTitle"), Localization.GetText("TerminalNeutralsTooltip"), BlockUi.GetNeutrals, BlockUi.RequestSetNeutrals, true, HasTrackingNeutrals);
AddOnOffSwitchNoAction(session, "Unowned", Localization.GetText("TerminalUnownedTitle"), Localization.GetText("TerminalUnownedTooltip"), BlockUi.GetUnowned, BlockUi.RequestSetUnowned, true, HasTrackingUnowned);
-
- //AddOnOffSwitchNoAction(session, "Friendly", Localization.GetText("TerminalFriendlyTitle"), Localization.GetText("TerminalFriendlyTooltip"), BlockUi.GetFriendly, BlockUi.RequestSetFriendly, true, HasTrackingAndTrackFriendly);
-
+ AddOnOffSwitchNoAction(session, "Grids", Localization.GetText("TerminalGridsTitle"), Localization.GetText("TerminalGridsTooltip"), BlockUi.GetGrids, BlockUi.RequestSetGrids, true, TrackGrids);
+ AddOnOffSwitchNoAction(session, "LargeGrid", Localization.GetText("TerminalLGTitle"), Localization.GetText("TerminalLGTooltip"), BlockUi.GetLargeGrid, BlockUi.RequestSetLargeGrid, true, HasTrackingNoSizeProhibition);
+ AddOnOffSwitchNoAction(session, "SmallGrid", Localization.GetText("TerminalSGTitle"), Localization.GetText("TerminalSGTooltip"), BlockUi.GetSmallGrid, BlockUi.RequestSetSmallGrid, true, HasTrackingNoSizeProhibition);
AddOnOffSwitchNoAction(session, "Biologicals", Localization.GetText("TerminalBiologicalsTitle"), Localization.GetText("TerminalBiologicalsTooltip"), BlockUi.GetBiologicals, BlockUi.RequestSetBiologicals, true, TrackBiologicals);
-
- AddOnOffSwitchNoAction(session, "Projectiles", Localization.GetText("TerminalProjectilesTitle"), Localization.GetText("TerminalProjectilesTooltip"), BlockUi.GetProjectiles, BlockUi.RequestSetProjectiles, true, TrackProjectiles);
-
+ AddOnOffSwitchNoAction(session, "Projectiles", Localization.GetText("TerminalProjectilesTitle"), Localization.GetText("TerminalProjectilesTooltip"), BlockUi.GetProjectiles, BlockUi.RequestSetProjectiles, true, TrackProjectiles);
AddOnOffSwitchNoAction(session, "Supporting PD", Localization.GetText("TerminalSupportingPDTitle"), Localization.GetText("TerminalSupportingPDTooltip"), BlockUi.GetSupportingPD, BlockUi.RequestSetSupportingPD, true, UiDisableSupportingPD);
-
AddOnOffSwitchNoAction(session, "Meteors", Localization.GetText("TerminalMeteorsTitle"), Localization.GetText("TerminalMeteorsTooltip"), BlockUi.GetMeteors, BlockUi.RequestSetMeteors, true, TrackMeteors);
- AddOnOffSwitchNoAction(session, "Grids", Localization.GetText("TerminalGridsTitle"), Localization.GetText("TerminalGridsTooltip"), BlockUi.GetGrids, BlockUi.RequestSetGrids, true, TrackGrids);
-
- AddOnOffSwitchNoAction(session, "FocusFire", Localization.GetText("TerminalFocusFireTitle"), Localization.GetText("TerminalFocusFireTooltip"), BlockUi.GetFocusFire, BlockUi.RequestSetFocusFire, true, HasTracking);
-
- AddOnOffSwitchNoAction(session, "SubSystems", Localization.GetText("TerminalSubSystemsTitle"), Localization.GetText("TerminalSubSystemsTooltip"), BlockUi.GetSubSystems, BlockUi.RequestSetSubSystems, true, HasTracking);
-
- AddOnOffSwitchNoAction(session, "Repel", Localization.GetText("TerminalRepelTitle"), Localization.GetText("TerminalRepelTooltip"), BlockUi.GetRepel, BlockUi.RequestSetRepel, true, HasTracking);
-
- AddOnOffSwitchNoAction(session, "LargeGrid", "Large Grid", "Target large grids", BlockUi.GetLargeGrid, BlockUi.RequestSetLargeGrid, true, HasTracking);
-
- AddOnOffSwitchNoAction(session, "SmallGrid", "Small Grid", "Target small grids", BlockUi.GetSmallGrid, BlockUi.RequestSetSmallGrid, true, HasTracking);
-
-
Separator(session, "WC_sep3", IsTrue);
AddWeaponBurstCountSliderRange(session, "Burst Count", Localization.GetText("TerminalBurstShotsTitle"), Localization.GetText("TerminalBurstShotsTooltip"), BlockUi.GetBurstCount, BlockUi.RequestSetBurstCount, CanBurstIsNotBomb, BlockUi.GetMinBurstCount, BlockUi.GetMaxBurstCount, true);
@@ -90,70 +64,40 @@ internal static void AddTurretOrTrackingControls(Session session) where T : I
AddLeadGroupSliderRange(session, "Target Group", Localization.GetText("TerminalTargetGroupTitle"), Localization.GetText("TerminalTargetGroupTooltip"), BlockUi.GetLeadGroup, BlockUi.RequestSetLeadGroup, TargetLead, BlockUi.GetMinLeadGroup, BlockUi.GetMaxLeadGroup, true);
AddWeaponCameraSliderRange(session, "Camera Channel", Localization.GetText("TerminalCameraChannelTitle"), Localization.GetText("TerminalCameraChannelTooltip"), BlockUi.GetWeaponCamera, BlockUi.RequestSetBlockCamera, HasTracking, BlockUi.GetMinCameraChannel, BlockUi.GetMaxCameraChannel, true);
-
AddListBoxNoAction(session, "Friend", "Friend", "Friend list", BlockUi.FriendFill, BlockUi.FriendSelect, IsDrone, 1, true, true);
AddListBoxNoAction(session, "Enemy", "Enemy", "Enemy list", BlockUi.EnemyFill, BlockUi.EnemySelect, IsDrone, 1, true, true);
- //AddListBoxNoAction(session, "Position", "Position", "Position list", BlockUi.PositionFill, BlockUi.PositionSelect, IsDrone, 1, true, true); Suppressed for now as it's inop
-
-
- Separator(session, "WC_sep5", HasTracking);
+ AddOnOffSwitchNoAction(session, "ReportTarget", Localization.GetText("TerminalReportTargetTitle"), Localization.GetText("TerminalReportTargetTooltip"), BlockUi.GetReportTarget, BlockUi.RequestSetReportTarget, true, UiReportTarget);
}
internal static void AddTurretControlBlockControls(Session session) where T : IMyTerminalBlock
{
CtcAddListBoxNoAction(session, "ToolsAndWeapons", "Available tools and weapons", "Auto populated by weaponcore", BlockUi.ToolWeaponFill, BlockUi.ToolWeaponSelect, CtcIsReady, 4, true);
-
CtcAddCheckboxNoAction(session, "Advanced", Localization.GetText("TerminalAdvancedTitle"), Localization.GetText("TerminalAdvancedTooltip"), BlockUi.GetAdvancedControl, BlockUi.RequestAdvancedControl, true, CtcIsReady);
CtcAddOnOffSwitchNoAction(session, "ShareFireControlEnabled", Localization.GetText("TerminalShareFireControlTitle"), Localization.GetText("TerminalShareFireControlTooltip"), BlockUi.GetShareFireControlControl, BlockUi.RequestShareFireControlControl, true, CtcIsReady);
-
CtcAddOnOffSwitchNoAction(session, "WCAiEnabled", Localization.GetText("TerminalAiEnabledTitle"), Localization.GetText("TerminalAiEnabledTooltip"), BlockUi.GetAiEnabledControl, BlockUi.RequestSetAiEnabledControl, true, CtcIsReady);
+ CtcAddComboboxNoAction(session, "ControlModes", Localization.GetText("TerminalControlModesTitle"), Localization.GetText("TerminalControlModesTooltip"), BlockUi.GetControlModeControl, BlockUi.RequestControlModeControl, BlockUi.ListControlModes, CtcIsReady);
+ CtcAddComboboxNoAction(session, "TrackingMode", Localization.GetText("TerminalTrackingModeTitle"), Localization.GetText("TerminalTrackingModeTooltip"), BlockUi.GetMovementModeControl, BlockUi.RequestMovementModeControl, BlockUi.ListMovementModes, CtcIsReady);
+ AddWeaponCtcRangeSliderNoAction(session, "Weapon Range", Localization.GetText("TerminalWeaponRangeTitle"), Localization.GetText("TerminalWeaponRangeTooltip"), BlockUi.GetRangeControl, BlockUi.RequestSetRangeControl, CtcIsReady, BlockUi.GetMinRangeControl, BlockUi.GetMaxRangeControl, true, false);
Separator(session, "WC_sep2", IsTrue);
- AddWeaponCtcRangeSliderNoAction(session, "Weapon Range", Localization.GetText("TerminalWeaponRangeTitle"), Localization.GetText("TerminalWeaponRangeTooltip"), BlockUi.GetRangeControl, BlockUi.RequestSetRangeControl, CtcIsReady, BlockUi.GetMinRangeControl, BlockUi.GetMaxRangeControl, true, false);
+ CtcAddOnOffSwitchNoAction(session, "SubSystems", Localization.GetText("TerminalSubSystemsTitle"), Localization.GetText("TerminalSubSystemsTooltip"), BlockUi.GetSubSystemsControl, BlockUi.RequestSetSubSystemsControl, true, CtcIsReady);
+ CtcAddComboboxNoAction(session, "PickSubSystem", Localization.GetText("TerminalPickSubSystemTitle"), Localization.GetText("TerminalPickSubSystemTooltip"), BlockUi.GetSubSystemControl, BlockUi.RequestSubSystemControl, BlockUi.ListSubSystems, CtcIsReady);
- CtcAddOnOffSwitchNoAction(session, "ReportTarget", Localization.GetText("TerminalReportTargetTitle"), Localization.GetText("TerminalReportTargetTooltip"), BlockUi.GetReportTargetControl, BlockUi.RequestSetReportTargetControl, true, CtcIsReady);
+ CtcAddOnOffSwitchNoAction(session, "FocusFire", Localization.GetText("TerminalFocusFireTitle"), Localization.GetText("TerminalFocusFireTooltip"), BlockUi.GetFocusFireControl, BlockUi.RequestSetFocusFireControl, true, CtcIsReady);
+ CtcAddOnOffSwitchNoAction(session, "Repel", Localization.GetText("TerminalRepelTitle"), Localization.GetText("TerminalRepelTooltip"), BlockUi.GetRepelControl, BlockUi.RequestSetRepelControl, true, CtcIsReady);
CtcAddOnOffSwitchNoAction(session, "Neutrals", Localization.GetText("TerminalNeutralsTitle"), Localization.GetText("TerminalNeutralsTooltip"), BlockUi.GetNeutralsControl, BlockUi.RequestSetNeutralsControl, true, CtcIsReady);
-
CtcAddOnOffSwitchNoAction(session, "Unowned", Localization.GetText("TerminalUnownedTitle"), Localization.GetText("TerminalUnownedTooltip"), BlockUi.GetUnownedControl, BlockUi.RequestSetUnownedControl, true, CtcIsReady);
-
+ CtcAddOnOffSwitchNoAction(session, "Grids", Localization.GetText("TerminalGridsTitle"), Localization.GetText("TerminalGridsTooltip"), BlockUi.GetGridsControl, BlockUi.RequestSetGridsControl, true, CtcIsReady);
+ CtcAddOnOffSwitchNoAction(session, "LargeGrid", Localization.GetText("TerminalLGTitle"), Localization.GetText("TerminalLGTooltip"), BlockUi.GetLargeGridControl, BlockUi.RequestSetLargeGridControl, true, CtcIsReady);
+ CtcAddOnOffSwitchNoAction(session, "SmallGrid", Localization.GetText("TerminalSGTitle"), Localization.GetText("TerminalSGTooltip"), BlockUi.GetSmallGridControl, BlockUi.RequestSetSmallGridControl, true, CtcIsReady);
CtcAddOnOffSwitchNoAction(session, "Biologicals", Localization.GetText("TerminalBiologicalsTitle"), Localization.GetText("TerminalBiologicalsTooltip"), BlockUi.GetBiologicalsControl, BlockUi.RequestSetBiologicalsControl, true, CtcIsReady);
-
CtcAddOnOffSwitchNoAction(session, "Projectiles", Localization.GetText("TerminalProjectilesTitle"), Localization.GetText("TerminalProjectilesTooltip"), BlockUi.GetProjectilesControl, BlockUi.RequestSetProjectilesControl, true, CtcIsReady);
-
CtcAddOnOffSwitchNoAction(session, "Supporting PD", Localization.GetText("TerminalSupportingPDTitle"), Localization.GetText("TerminalSupportingPDTooltip"), BlockUi.GetSupportingPDControl, BlockUi.RequestSetSupportingPDControl, true, CtcIsReady);
-
CtcAddOnOffSwitchNoAction(session, "Meteors", Localization.GetText("TerminalMeteorsTitle"), Localization.GetText("TerminalMeteorsTooltip"), BlockUi.GetMeteorsControl, BlockUi.RequestSetMeteorsControl, true, CtcIsReady);
-
- CtcAddOnOffSwitchNoAction(session, "Grids", Localization.GetText("TerminalGridsTitle"), Localization.GetText("TerminalGridsTooltip"), BlockUi.GetGridsControl, BlockUi.RequestSetGridsControl, true, CtcIsReady);
-
- CtcAddOnOffSwitchNoAction(session, "FocusFire", Localization.GetText("TerminalFocusFireTitle"), Localization.GetText("TerminalFocusFireTooltip"), BlockUi.GetFocusFireControl, BlockUi.RequestSetFocusFireControl, true, CtcIsReady);
-
- CtcAddOnOffSwitchNoAction(session, "SubSystems", Localization.GetText("TerminalSubSystemsTitle"), Localization.GetText("TerminalSubSystemsTooltip"), BlockUi.GetSubSystemsControl, BlockUi.RequestSetSubSystemsControl, true, CtcIsReady);
-
- CtcAddOnOffSwitchNoAction(session, "Repel", Localization.GetText("TerminalRepelTitle"), Localization.GetText("TerminalRepelTooltip"), BlockUi.GetRepelControl, BlockUi.RequestSetRepelControl, true, CtcIsReady);
-
- CtcAddOnOffSwitchNoAction(session, "LargeGrid", "Large Grid", "Target large grids", BlockUi.GetLargeGridControl, BlockUi.RequestSetLargeGridControl, true, CtcIsReady);
-
- CtcAddOnOffSwitchNoAction(session, "SmallGrid", "Small Grid", "Target small grids", BlockUi.GetSmallGridControl, BlockUi.RequestSetSmallGridControl, true, CtcIsReady);
-
- Separator(session, "WC_sep3", IsTrue);
-
- CtcAddComboboxNoAction(session, "PickSubSystem", Localization.GetText("TerminalPickSubSystemTitle"), Localization.GetText("TerminalPickSubSystemTooltip"), BlockUi.GetSubSystemControl, BlockUi.RequestSubSystemControl, BlockUi.ListSubSystems, CtcIsReady);
-
- CtcAddComboboxNoAction(session, "TrackingMode", Localization.GetText("TerminalTrackingModeTitle"), Localization.GetText("TerminalTrackingModeTooltip"), BlockUi.GetMovementModeControl, BlockUi.RequestMovementModeControl, BlockUi.ListMovementModes, CtcIsReady);
-
- //CtcAddComboboxNoAction(session, "Shoot Mode", Localization.GetText("TerminalShootModeTitle"), Localization.GetText("TerminalShootModeTooltip"), BlockUi.CtcGetShootModes, BlockUi.CtcRequestShootModes, BlockUi.CtcListShootModes, CtcIsReady);
-
- CtcAddComboboxNoAction(session, "ControlModes", Localization.GetText("TerminalControlModesTitle"), Localization.GetText("TerminalControlModesTooltip"), BlockUi.GetControlModeControl, BlockUi.RequestControlModeControl, BlockUi.ListControlModes, CtcIsReady);
-
- //AddWeaponCameraSliderRange(session, "Camera Channel", Localization.GetText("TerminalCameraChannelTitle"), Localization.GetText("TerminalCameraChannelTooltip"), BlockUi.GetWeaponCamera, BlockUi.RequestSetBlockCamera, HasTracking, BlockUi.GetMinCameraChannel, BlockUi.GetMaxCameraChannel, true);
-
- //AddLeadGroupSliderRange(session, "Target Group", Localization.GetText("TerminalTargetGroupTitle"), Localization.GetText("TerminalTargetGroupTooltip"), BlockUi.GetLeadGroup, BlockUi.RequestSetLeadGroup, TargetLead, BlockUi.GetMinLeadGroup, BlockUi.GetMaxLeadGroup, true);
-
- Separator(session, "WC_sep4", IsTrue);
+ CtcAddOnOffSwitchNoAction(session, "ReportTarget", Localization.GetText("TerminalReportTargetTitle"), Localization.GetText("TerminalReportTargetTooltip"), BlockUi.GetReportTargetControl, BlockUi.RequestSetReportTargetControl, true, CtcIsReady);
}
internal static void AddSearchlightControls(Session session) where T : IMyTerminalBlock
@@ -161,27 +105,15 @@ internal static void AddSearchlightControls(Session session) where T : IMyTer
Separator(session, "WC_sep2", HasTracking);
AddWeaponRangeSliderNoAction(session, "Weapon Range", Localization.GetText("TerminalWeaponRangeTitle"), Localization.GetText("TerminalWeaponRangeTooltip"), BlockUi.GetRange, BlockUi.RequestSetRange, BlockUi.ShowRange, BlockUi.GetMinRange, BlockUi.GetMaxRange, true, false);
-
AddOnOffSwitchNoAction(session, "Neutrals", Localization.GetText("TerminalNeutralsTitle"), Localization.GetText("TerminalNeutralsTooltip"), BlockUi.GetNeutrals, BlockUi.RequestSetNeutrals, true, HasTrackingNeutrals);
-
AddOnOffSwitchNoAction(session, "Unowned", Localization.GetText("TerminalUnownedTitle"), Localization.GetText("TerminalUnownedTooltip"), BlockUi.GetUnowned, BlockUi.RequestSetUnowned, true, HasTrackingUnowned);
-
- //AddOnOffSwitchNoAction(session, "Friendly", Localization.GetText("TerminalFriendlyTitle"), Localization.GetText("TerminalFriendlyTooltip"), BlockUi.GetFriendly, BlockUi.RequestSetFriendly, true, HasTrackingAndTrackFriendly);
-
+ AddOnOffSwitchNoAction(session, "Grids", Localization.GetText("TerminalGridsTitle"), Localization.GetText("TerminalGridsTooltip"), BlockUi.GetGrids, BlockUi.RequestSetGrids, true, TrackGrids);
+ AddOnOffSwitchNoAction(session, "LargeGrid", Localization.GetText("TerminalLGTitle"), Localization.GetText("TerminalLGTooltip"), BlockUi.GetLargeGrid, BlockUi.RequestSetLargeGrid, true, HasTrackingNoSizeProhibition);
+ AddOnOffSwitchNoAction(session, "SmallGrid", Localization.GetText("TerminalSGTitle"), Localization.GetText("TerminalSGTooltip"), BlockUi.GetSmallGrid, BlockUi.RequestSetSmallGrid, true, HasTrackingNoSizeProhibition);
AddOnOffSwitchNoAction(session, "Biologicals", Localization.GetText("TerminalBiologicalsTitle"), Localization.GetText("TerminalBiologicalsTooltip"), BlockUi.GetBiologicals, BlockUi.RequestSetBiologicals, true, TrackBiologicals);
-
AddOnOffSwitchNoAction(session, "Projectiles", Localization.GetText("TerminalProjectilesTitle"), Localization.GetText("TerminalProjectilesTooltip"), BlockUi.GetProjectiles, BlockUi.RequestSetProjectiles, true, TrackProjectiles);
-
AddOnOffSwitchNoAction(session, "Meteors", Localization.GetText("TerminalMeteorsTitle"), Localization.GetText("TerminalMeteorsTooltip"), BlockUi.GetMeteors, BlockUi.RequestSetMeteors, true, TrackMeteors);
-
- AddOnOffSwitchNoAction(session, "Grids", Localization.GetText("TerminalGridsTitle"), Localization.GetText("TerminalGridsTooltip"), BlockUi.GetGrids, BlockUi.RequestSetGrids, true, TrackGrids);
-
- AddOnOffSwitchNoAction(session, "LargeGrid", "Large Grid", "Target large grids", BlockUi.GetLargeGrid, BlockUi.RequestSetLargeGrid, true, HasTracking);
-
- AddOnOffSwitchNoAction(session, "SmallGrid", "Small Grid", "Target small grids", BlockUi.GetSmallGrid, BlockUi.RequestSetSmallGrid, true, HasTracking);
-
AddWeaponCameraSliderRange(session, "Camera Channel", Localization.GetText("TerminalCameraChannelTitle"), Localization.GetText("TerminalCameraChannelTooltip"), BlockUi.GetWeaponCamera, BlockUi.RequestSetBlockCamera, HasTracking, BlockUi.GetMinCameraChannel, BlockUi.GetMaxCameraChannel, true);
-
}
internal static void AddDecoyControls(Session session) where T : IMyTerminalBlock
{
@@ -207,9 +139,9 @@ internal static void CreateGenericControls(Session session) where T : IMyTerm
Separator(session, "WC_sep4", IsTrue);
AddOnOffSwitchNoAction(session, "ShareFireControlEnabled", Localization.GetText("TerminalShareFireControlTitle"), Localization.GetText("TerminalShareFireControlTooltip"), BlockUi.GetShareFireControl, BlockUi.RequestShareFireControl, true, HasTracking);
- AddOnOffSwitchNoAction(session, "Shoot", Localization.GetText("TerminalShootTitle"), Localization.GetText("TerminalShootTooltip"), BlockUi.GetShoot, BlockUi.RequestSetShoot, true, IsNotBomb);
+ AddOnOffSwitchNoAction(session, "Shoot", Localization.GetText("TerminalShootTitle"), Localization.GetText("TerminalShootTooltip"), BlockUi.GetShoot, BlockUi.RequestSetShoot, true, IsNotBomb);
AddOnOffSwitchNoAction(session, "Override", Localization.GetText("TerminalOverrideTitle"), Localization.GetText("TerminalOverrideTooltip"), BlockUi.GetOverride, BlockUi.RequestOverride, true, OverrideTarget);
- AddOnOffSwitchNoAction(session, "AngularTracking", Localization.GetText("TerminalAngularTitle"), Localization.GetText("TerminalAngularTooltip"), BlockUi.GetAngularTracking, BlockUi.RequestAngularTracking, true, IsNotBomb);
+ AddOnOffSwitchNoAction(session, "AngularTracking", Localization.GetText("TerminalAngularTitle"), Localization.GetText("TerminalAngularTooltip"), BlockUi.GetAngularTracking, BlockUi.RequestAngularTracking, true, HasTracking);
}
internal static void CreateGenericArmor(Session session) where T : IMyTerminalBlock
@@ -313,6 +245,24 @@ internal static bool AmmoSelection(IMyTerminalBlock block)
return comp.ConsumableSelectionPartIds.Count > 0;
}
+ internal static bool EnableForceReload(IMyTerminalBlock block)
+ {
+ var comp = block?.Components?.Get() as Weapon.WeaponComponent;
+ var valid = comp != null && comp.Platform.State == CorePlatform.PlatformState.Ready && comp.Type == CoreComponent.CompType.Weapon && comp.Data?.Repo != null;
+ if (!valid || Session.I.PlayerId != comp.Data.Repo.Values.State.PlayerId && !comp.TakeOwnerShip())
+ return false;
+ bool enable = false;
+ for (int i = 0; i < comp.Collection.Count; i++)
+ {
+ var wep = comp.Collection[i];
+ if (!wep.System.HasAmmoSelection)
+ continue;
+ if (wep.DelayedCycleId != -1 && wep.ActiveAmmoDef != wep.System.AmmoTypes[wep.DelayedCycleId])
+ enable = true;
+ }
+ return enable;
+ }
+
internal static bool CanBurst(IMyTerminalBlock block)
{
var comp = block?.Components?.Get() as Weapon.WeaponComponent;
@@ -460,8 +410,19 @@ internal static bool HasTracking(IMyTerminalBlock block)
return (comp.HasTracking || comp.HasGuidance) && !comp.HasAlternateUi;
}
+ internal static bool HasTrackingNoSizeProhibition(IMyTerminalBlock block)
+ {
+ var comp = block?.Components?.Get() as Weapon.WeaponComponent;
- internal static bool HasTrackingUnowned(IMyTerminalBlock block)
+ var valid = comp != null && comp.Platform.State == CorePlatform.PlatformState.Ready && comp.Data?.Repo != null;
+
+ if (!valid || Session.I.PlayerId != comp.Data.Repo.Values.State.PlayerId && !comp.TakeOwnerShip() || comp.PrimaryWeapon.System.TrackProhibitLG || comp.PrimaryWeapon.System.TrackProhibitSG)
+ return false;
+
+ return (comp.HasTracking || comp.HasGuidance) && !comp.HasAlternateUi;
+ }
+
+ internal static bool HasTrackingExceptCommSlave(IMyTerminalBlock block)
{
var comp = block?.Components?.Get() as Weapon.WeaponComponent;
@@ -470,10 +431,10 @@ internal static bool HasTrackingUnowned(IMyTerminalBlock block)
if (!valid || Session.I.PlayerId != comp.Data.Repo.Values.State.PlayerId && !comp.TakeOwnerShip())
return false;
- return (comp.HasTracking || comp.HasGuidance) && !comp.HasAlternateUi;
+ return !comp.PrimaryWeapon.System.TargetSlaving && (comp.HasTracking || comp.HasGuidance) && !comp.HasAlternateUi;
}
- internal static bool HasTrackingNeutrals(IMyTerminalBlock block)
+ internal static bool HasTrackingUnowned(IMyTerminalBlock block)
{
var comp = block?.Components?.Get() as Weapon.WeaponComponent;
@@ -484,7 +445,8 @@ internal static bool HasTrackingNeutrals(IMyTerminalBlock block)
return (comp.HasTracking || comp.HasGuidance) && !comp.HasAlternateUi;
}
- internal static bool HasTrackingAndTrackFriendly(IMyTerminalBlock block)
+
+ internal static bool HasTrackingNeutrals(IMyTerminalBlock block)
{
var comp = block?.Components?.Get() as Weapon.WeaponComponent;
@@ -493,7 +455,7 @@ internal static bool HasTrackingAndTrackFriendly(IMyTerminalBlock block)
if (!valid || Session.I.PlayerId != comp.Data.Repo.Values.State.PlayerId && !comp.TakeOwnerShip())
return false;
- return (comp.HasTracking || comp.HasGuidance || comp.HasAlternateUi);
+ return (comp.HasTracking || comp.HasGuidance) && !comp.HasAlternateUi;
}
internal static bool IsArmed(IMyTerminalBlock block)
@@ -868,26 +830,6 @@ internal static IMyTerminalControlSlider AddLeadGroupSliderRange(Session sess
return c;
}
- internal static IMyTerminalControlOnOffSwitch AddWeaponOnOff(Session session, string name, string title, string tooltip, string onText, string offText, Func getter, Action setter, Func visibleGetter) where T : IMyTerminalBlock
- {
- var c = MyAPIGateway.TerminalControls.CreateControl($"WC_Enable");
-
- c.Title = MyStringId.GetOrCompute(title);
- c.Tooltip = MyStringId.GetOrCompute(tooltip);
- c.OnText = MyStringId.GetOrCompute(onText);
- c.OffText = MyStringId.GetOrCompute(offText);
- c.Enabled = IsReady;
- c.Visible = visibleGetter;
- c.Getter = IsReady;
- c.Setter = setter;
- MyAPIGateway.TerminalControls.AddControl(c);
- session.CustomControls.Add(c);
-
- CreateCustomActions.CreateOnOffActionSet(session, c, name, visibleGetter);
-
- return c;
- }
-
internal static IMyTerminalControlSeparator Separator(Session session, string name, Func visibleGettter) where T : IMyTerminalBlock
{
var c = MyAPIGateway.TerminalControls.CreateControl(name);
diff --git a/Data/Scripts/CoreSystems/EntityComp/Controls/Weapon/WeaponActions.cs b/Data/Scripts/CoreSystems/EntityComp/Controls/Weapon/WeaponActions.cs
index d066249f..fdf228d2 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Controls/Weapon/WeaponActions.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Controls/Weapon/WeaponActions.cs
@@ -3,6 +3,7 @@
using CoreSystems.Platform;
using CoreSystems.Support;
using Sandbox.ModAPI;
+using VRage.Utils;
using VRageMath;
using static CoreSystems.Support.CoreComponent.Trigger;
@@ -115,6 +116,8 @@ internal static void TerminalActionKeyShoot(IMyTerminalBlock blk)
var mode = comp.Data.Repo.Values.Set.Overrides.ShootMode;
if (mode == Weapon.ShootManager.ShootModes.KeyToggle || mode == Weapon.ShootManager.ShootModes.KeyFire)
{
+ if (!comp.Data.Repo.Values.Set.Overrides.Override && comp.HasRequireTarget && comp.PrimaryWeapon.Target.CurrentState != Target.States.Acquired)
+ return;
var keyToggle = mode == Weapon.ShootManager.ShootModes.KeyToggle;
var signal = keyToggle ? Weapon.ShootManager.Signals.KeyToggle : Weapon.ShootManager.Signals.Once;
var on = comp.Data.Repo.Values.State.Trigger == On;
@@ -150,7 +153,7 @@ internal static void TerminalActionMovementMode(IMyTerminalBlock blk)
return;
var numValue = (int)comp.Data.Repo.Values.Set.Overrides.MoveMode;
- var value = numValue + 1 <= 3 ? numValue + 1 : 0;
+ var value = numValue + 1 <= 4 ? numValue + 1 : 0;
Weapon.WeaponComponent.RequestSetValue(comp, "MovementModes", value, Session.I.PlayerId);
}
@@ -406,6 +409,90 @@ internal static void TerminalActionMinSizeDecrease(IMyTerminalBlock blk)
Weapon.WeaponComponent.RequestSetValue(comp, "MinSize", newValue, Session.I.PlayerId);
}
+ internal static void TerminalActionMaxRangeIncrease(IMyTerminalBlock block)
+ {
+ var comp = block?.Components?.Get() as Weapon.WeaponComponent;
+ if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
+
+ var curRange = comp.Data.Repo.Values.Set.Range;
+ var maxRange = 0f;
+ for (int i = 0; i < comp.Collection.Count; i++)
+ {
+ var w = comp.Collection[i];
+ var curMax = w.GetMaxWeaponRange();
+ if (curMax > maxRange)
+ maxRange = (float)curMax;
+ }
+
+ var delta = maxRange * 0.1f;
+ if (curRange == maxRange)
+ return;
+ else if (curRange + delta > maxRange)
+ curRange = maxRange;
+ else
+ curRange += delta;
+
+ if (!MyUtils.IsEqual(curRange, comp.Data.Repo.Values.Set.Range))
+ {
+ if (Session.I.IsServer)
+ {
+ comp.Data.Repo.Values.Set.Range = curRange;
+ Weapon.WeaponComponent.SetRange(comp);
+ if (Session.I.MpActive)
+ Session.I.SendComp(comp);
+ }
+ else
+ Session.I.SendSetCompFloatRequest(comp, curRange, PacketType.RequestSetRange);
+ }
+ }
+
+ internal static void TerminalActionMaxRangeDecrease(IMyTerminalBlock block)
+ {
+ var comp = block?.Components?.Get() as Weapon.WeaponComponent;
+ if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
+
+ var curRange = comp.Data.Repo.Values.Set.Range;
+
+ var minRange = float.MaxValue;
+ for (int i = 0; i < comp.Collection.Count; i++)
+ {
+ var w = comp.Collection[i];
+ var curMin = w.System.WConst.MinTargetDistance;
+ if (curMin < minRange)
+ minRange = (float)curMin;
+ }
+
+ var maxRange = 0f;
+ for (int i = 0; i < comp.Collection.Count; i++)
+ {
+ var w = comp.Collection[i];
+ var curMax = w.GetMaxWeaponRange();
+ if (curMax > maxRange)
+ maxRange = (float)curMax;
+ }
+
+ var delta = maxRange * 0.1f;
+ if (curRange == minRange)
+ return;
+ else if (curRange - delta < minRange)
+ curRange = minRange;
+ else
+ curRange -= delta;
+
+ if (!MyUtils.IsEqual(curRange, comp.Data.Repo.Values.Set.Range))
+ {
+ if (Session.I.IsServer)
+ {
+ comp.Data.Repo.Values.Set.Range = curRange;
+ Weapon.WeaponComponent.SetRange(comp);
+ if (Session.I.MpActive)
+ Session.I.SendComp(comp);
+ }
+ else
+ Session.I.SendSetCompFloatRequest(comp, curRange, PacketType.RequestSetRange);
+ }
+ }
+
internal static void TerminalActionCycleAmmo(IMyTerminalBlock block)
{
var comp = block?.Components?.Get() as Weapon.WeaponComponent;
@@ -506,9 +593,9 @@ internal static void ArmWriter(IMyTerminalBlock blk, StringBuilder sb)
var comp = blk.Components.Get() as Weapon.WeaponComponent;
if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
if (comp.Data.Repo.Values.Set.Overrides.Armed)
- sb.Append("Armed");
+ sb.Append(Localization.GetText("BombArmed"));
else
- sb.Append("Disarmed");
+ sb.Append(Localization.GetText("BombDisarmed"));
}
internal static void ShootStateWriter(IMyTerminalBlock blk, StringBuilder sb)
@@ -653,21 +740,27 @@ internal static void MaxSizeWriter(IMyTerminalBlock blk, StringBuilder sb)
{
var comp = blk.Components.Get() as Weapon.WeaponComponent;
if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
- sb.Append(comp.Data.Repo.Values.Set.Overrides.MaxSize);
+ sb.Append($"Mx:{comp.Data.Repo.Values.Set.Overrides.MaxSize}");
}
internal static void MinSizeWriter(IMyTerminalBlock blk, StringBuilder sb)
{
var comp = blk.Components.Get() as Weapon.WeaponComponent;
if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
- sb.Append(comp.Data.Repo.Values.Set.Overrides.MinSize);
+ sb.Append($"Mn:{comp.Data.Repo.Values.Set.Overrides.MinSize}");
+ }
+ internal static void MaxRangeWriter(IMyTerminalBlock blk, StringBuilder sb)
+ {
+ var comp = blk.Components.Get() as Weapon.WeaponComponent;
+ if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
+ sb.Append($"{comp.Data.Repo.Values.Set.Range}m");
}
internal static void ControlStateWriter(IMyTerminalBlock blk, StringBuilder sb)
{
var comp = blk.Components.Get() as Weapon.WeaponComponent;
if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
- sb.Append(comp.Data.Repo.Values.Set.Overrides.Control);
+ sb.Append(Localization.GetText("Control" + comp.Data.Repo.Values.Set.Overrides.Control));
}
internal static void MovementModeWriter(IMyTerminalBlock blk, StringBuilder sb)
@@ -675,7 +768,7 @@ internal static void MovementModeWriter(IMyTerminalBlock blk, StringBuilder sb)
var comp = blk.Components.Get() as Weapon.WeaponComponent;
if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
- sb.Append(comp.Data.Repo.Values.Set.Overrides.MoveMode);
+ sb.Append(Localization.GetText("Move" + comp.Data.Repo.Values.Set.Overrides.MoveMode));
}
internal static void SubSystemWriter(IMyTerminalBlock blk, StringBuilder sb)
@@ -683,7 +776,7 @@ internal static void SubSystemWriter(IMyTerminalBlock blk, StringBuilder sb)
var comp = blk.Components.Get() as Weapon.WeaponComponent;
if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
- sb.Append(comp.Data.Repo.Values.Set.Overrides.SubSystem);
+ sb.Append(Localization.GetText("Subtype" + comp.Data.Repo.Values.Set.Overrides.SubSystem));
}
internal static void ShootModeWriter(IMyTerminalBlock blk, StringBuilder sb)
@@ -691,7 +784,7 @@ internal static void ShootModeWriter(IMyTerminalBlock blk, StringBuilder sb)
var comp = blk.Components.Get() as Weapon.WeaponComponent;
if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
- var altAiControlName = !comp.HasAim && comp.Data.Repo.Values.Set.Overrides.ShootMode == Weapon.ShootManager.ShootModes.AiShoot ? InActive : comp.Data.Repo.Values.Set.Overrides.ShootMode.ToString();
+ var altAiControlName = !comp.HasAim && comp.Data.Repo.Values.Set.Overrides.ShootMode == Weapon.ShootManager.ShootModes.AiShoot ? Localization.GetText("ControlsInactive") : Localization.GetText("Shoot" + comp.Data.Repo.Values.Set.Overrides.ShootMode);
sb.Append(altAiControlName);
}
@@ -700,16 +793,15 @@ internal static void ObjectiveModeWriter(IMyTerminalBlock blk, StringBuilder sb)
var comp = blk.Components.Get() as Weapon.WeaponComponent;
if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
- sb.Append(comp.Data.Repo.Values.Set.Overrides.ObjectiveMode);
+ sb.Append(Localization.GetText("Obj" + comp.Data.Repo.Values.Set.Overrides.ObjectiveMode));
}
- private const string InActive = "Inactive";
internal static void MouseToggleWriter(IMyTerminalBlock blk, StringBuilder sb)
{
var comp = blk.Components.Get() as Weapon.WeaponComponent;
if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
- var message = comp.Data.Repo.Values.Set.Overrides.ShootMode == Weapon.ShootManager.ShootModes.MouseControl ? comp.Data.Repo.Values.Set.Overrides.ShootMode.ToString() : InActive;
+ var message = comp.Data.Repo.Values.Set.Overrides.ShootMode == Weapon.ShootManager.ShootModes.MouseControl ? Localization.GetText("ShootMouse") : Localization.GetText("ControlsInactive");
sb.Append(message);
}
@@ -719,7 +811,7 @@ internal static void DecoyWriter(IMyTerminalBlock blk, StringBuilder sb)
long value;
if (long.TryParse(blk.CustomData, out value))
{
- sb.Append(((WeaponDefinition.TargetingDef.BlockTypes)value).ToString());
+ sb.Append(Localization.GetText("Subtype" + (WeaponDefinition.TargetingDef.BlockTypes)value));
}
}
@@ -728,7 +820,7 @@ internal static void CameraWriter(IMyTerminalBlock blk, StringBuilder sb)
long value;
if (long.TryParse(blk.CustomData, out value))
{
- var group = $"Camera Channel {value}";
+ var group = $"{Localization.GetText("TerminalCameraCameraChannelTitle")} {value}";
sb.Append(group);
}
}
diff --git a/Data/Scripts/CoreSystems/EntityComp/Controls/Weapon/WeaponUi.cs b/Data/Scripts/CoreSystems/EntityComp/Controls/Weapon/WeaponUi.cs
index 8cae6999..71618102 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Controls/Weapon/WeaponUi.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Controls/Weapon/WeaponUi.cs
@@ -9,8 +9,6 @@
using VRage.ModAPI;
using VRage.Utils;
using VRageMath;
-using WeaponCore.Data.Scripts.CoreSystems.Ui.Targeting;
-using static VRage.Game.ObjectBuilders.Definitions.MyObjectBuilder_GameDefinition;
namespace CoreSystems
{
@@ -587,6 +585,17 @@ internal static void RequestSetAmmo(IMyTerminalBlock block, long newValue)
wep.QueueAmmoChange((int)newValue);
}
+ block.ShowInToolbarConfig = !block.ShowInToolbarConfig; //#keen
+ block.ShowInToolbarConfig = !block.ShowInToolbarConfig;
+ }
+
+ internal static void ForceReload(IMyTerminalBlock block)
+ {
+ var comp = block?.Components?.Get() as Weapon.WeaponComponent;
+ if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return;
+ comp.RequestForceReload();
+ block.ShowInToolbarConfig = !block.ShowInToolbarConfig; //#keen
+ block.ShowInToolbarConfig = !block.ShowInToolbarConfig;
}
@@ -621,10 +630,10 @@ internal static void ListShootModes(List shootMod
private static readonly List ShootModeList = new List
{
- new MyTerminalControlComboBoxItem { Key = 0, Value = MyStringId.GetOrCompute($"{(Weapon.ShootManager.ShootModes)0}") },
- new MyTerminalControlComboBoxItem { Key = 1, Value = MyStringId.GetOrCompute($"{(Weapon.ShootManager.ShootModes)1}") },
- new MyTerminalControlComboBoxItem { Key = 2, Value = MyStringId.GetOrCompute($"{(Weapon.ShootManager.ShootModes)2}") },
- new MyTerminalControlComboBoxItem { Key = 3, Value = MyStringId.GetOrCompute($"{(Weapon.ShootManager.ShootModes)3}") },
+ new MyTerminalControlComboBoxItem { Key = 0, Value = MyStringId.GetOrCompute(Localization.GetText("ShootAiShoot")) },
+ new MyTerminalControlComboBoxItem { Key = 1, Value = MyStringId.GetOrCompute(Localization.GetText("ShootMouse")) },
+ new MyTerminalControlComboBoxItem { Key = 2, Value = MyStringId.GetOrCompute(Localization.GetText("ShootKeyToggle")) },
+ new MyTerminalControlComboBoxItem { Key = 3, Value = MyStringId.GetOrCompute(Localization.GetText("ShootKey")) },
};
internal static long GetSubSystem(IMyTerminalBlock block)
@@ -649,14 +658,14 @@ internal static void ListSubSystems(List subSyste
private static readonly List SubList = new List
{
- new MyTerminalControlComboBoxItem { Key = 0, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)0}") },
- new MyTerminalControlComboBoxItem { Key = 1, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)1}") },
- new MyTerminalControlComboBoxItem { Key = 2, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)2}") },
- new MyTerminalControlComboBoxItem { Key = 3, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)3}") },
- new MyTerminalControlComboBoxItem { Key = 4, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)4}") },
- new MyTerminalControlComboBoxItem { Key = 5, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)5}") },
- new MyTerminalControlComboBoxItem { Key = 6, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)6}") },
- new MyTerminalControlComboBoxItem { Key = 7, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)7}") },
+ new MyTerminalControlComboBoxItem { Key = 0, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypeAny")) },
+ new MyTerminalControlComboBoxItem { Key = 1, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypeOffense")) },
+ new MyTerminalControlComboBoxItem { Key = 2, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypeUtility")) },
+ new MyTerminalControlComboBoxItem { Key = 3, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypePower")) },
+ new MyTerminalControlComboBoxItem { Key = 4, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypeProduction")) },
+ new MyTerminalControlComboBoxItem { Key = 5, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypeThrust")) },
+ new MyTerminalControlComboBoxItem { Key = 6, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypeJumping")) },
+ new MyTerminalControlComboBoxItem { Key = 7, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypeSteering")) },
};
internal static long GetMovementMode(IMyTerminalBlock block)
@@ -681,10 +690,12 @@ internal static void ListMovementModes(List moveL
private static readonly List MoveList = new List
{
- new MyTerminalControlComboBoxItem { Key = 0, Value = MyStringId.GetOrCompute($"{(ProtoWeaponOverrides.MoveModes)0}") },
- new MyTerminalControlComboBoxItem { Key = 1, Value = MyStringId.GetOrCompute($"{(ProtoWeaponOverrides.MoveModes)1}") },
- new MyTerminalControlComboBoxItem { Key = 2, Value = MyStringId.GetOrCompute($"{(ProtoWeaponOverrides.MoveModes)2}") },
- new MyTerminalControlComboBoxItem { Key = 3, Value = MyStringId.GetOrCompute($"{(ProtoWeaponOverrides.MoveModes)3}") },
+ new MyTerminalControlComboBoxItem { Key = 0, Value = MyStringId.GetOrCompute(Localization.GetText("MoveAny")) },
+ new MyTerminalControlComboBoxItem { Key = 1, Value = MyStringId.GetOrCompute(Localization.GetText("MoveMoving")) },
+ new MyTerminalControlComboBoxItem { Key = 2, Value = MyStringId.GetOrCompute(Localization.GetText("MoveMobile")) },
+ new MyTerminalControlComboBoxItem { Key = 3, Value = MyStringId.GetOrCompute(Localization.GetText("MoveMoored")) },
+ new MyTerminalControlComboBoxItem { Key = 4, Value = MyStringId.GetOrCompute(Localization.GetText("MoveShipAny")) },
+
};
internal static long GetObjectiveMode(IMyTerminalBlock block)
@@ -709,9 +720,9 @@ internal static void ListObjectiveModes(List move
private static readonly List ObjectiveList = new List
{
- new MyTerminalControlComboBoxItem { Key = 0, Value = MyStringId.GetOrCompute($"{(ProtoWeaponOverrides.ObjectiveModes)0}") },
- new MyTerminalControlComboBoxItem { Key = 1, Value = MyStringId.GetOrCompute($"{(ProtoWeaponOverrides.ObjectiveModes)1}") },
- new MyTerminalControlComboBoxItem { Key = 2, Value = MyStringId.GetOrCompute($"{(ProtoWeaponOverrides.ObjectiveModes)2}") },
+ new MyTerminalControlComboBoxItem { Key = 0, Value = MyStringId.GetOrCompute(Localization.GetText("ObjDefault")) },
+ new MyTerminalControlComboBoxItem { Key = 1, Value = MyStringId.GetOrCompute(Localization.GetText("ObjDisabled")) },
+ new MyTerminalControlComboBoxItem { Key = 2, Value = MyStringId.GetOrCompute(Localization.GetText("ObjDestroyed")) },
};
internal static long GetControlMode(IMyTerminalBlock block)
@@ -1027,7 +1038,8 @@ internal static float GetMaxBurstDelay(IMyTerminalBlock block)
var comp = block?.Components?.Get() as Weapon.WeaponComponent;
if (comp == null || comp.Platform.State != CorePlatform.PlatformState.Ready) return 0;
- return 300;
+ var priReload = comp.Collection[0].System.WConst.ReloadTime * 3;
+ return priReload < 600 ? 600 : priReload;
}
internal static float GetMinSequenceId(IMyTerminalBlock block)
@@ -1131,9 +1143,9 @@ internal static void ListControlModes(List contro
private static readonly List ControlList = new List
{
- new MyTerminalControlComboBoxItem { Key = 0, Value = MyStringId.GetOrCompute($"{(ProtoWeaponOverrides.ControlModes)0}") },
- new MyTerminalControlComboBoxItem { Key = 1, Value = MyStringId.GetOrCompute($"{(ProtoWeaponOverrides.ControlModes)1}") },
- new MyTerminalControlComboBoxItem { Key = 2, Value = MyStringId.GetOrCompute($"{(ProtoWeaponOverrides.ControlModes)2}") },
+ new MyTerminalControlComboBoxItem { Key = 0, Value = MyStringId.GetOrCompute(Localization.GetText("ControlAuto")) },
+ new MyTerminalControlComboBoxItem { Key = 1, Value = MyStringId.GetOrCompute(Localization.GetText("ControlManual")) },
+ new MyTerminalControlComboBoxItem { Key = 2, Value = MyStringId.GetOrCompute(Localization.GetText("ControlPainter")) },
};
internal static void ListDecoySubSystems(List subSystemList)
@@ -1143,13 +1155,13 @@ internal static void ListDecoySubSystems(List sub
private static readonly List DecoySubList = new List()
{
- new MyTerminalControlComboBoxItem() { Key = 1, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)1}") },
- new MyTerminalControlComboBoxItem() { Key = 2, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)2}") },
- new MyTerminalControlComboBoxItem() { Key = 3, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)3}") },
- new MyTerminalControlComboBoxItem() { Key = 4, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)4}") },
- new MyTerminalControlComboBoxItem() { Key = 5, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)5}") },
- new MyTerminalControlComboBoxItem() { Key = 6, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)6}") },
- new MyTerminalControlComboBoxItem() { Key = 7, Value = MyStringId.GetOrCompute($"{(WeaponDefinition.TargetingDef.BlockTypes)7}") },
+ new MyTerminalControlComboBoxItem { Key = 1, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypeOffense")) },
+ new MyTerminalControlComboBoxItem { Key = 2, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypeUtility")) },
+ new MyTerminalControlComboBoxItem { Key = 3, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypePower")) },
+ new MyTerminalControlComboBoxItem { Key = 4, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypeProduction")) },
+ new MyTerminalControlComboBoxItem { Key = 5, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypeThrust")) },
+ new MyTerminalControlComboBoxItem { Key = 6, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypeJumping")) },
+ new MyTerminalControlComboBoxItem { Key = 7, Value = MyStringId.GetOrCompute(Localization.GetText("SubtypeSteering")) },
};
}
}
diff --git a/Data/Scripts/CoreSystems/EntityComp/EntityEvents.cs b/Data/Scripts/CoreSystems/EntityComp/EntityEvents.cs
index c48bc659..69f36974 100644
--- a/Data/Scripts/CoreSystems/EntityComp/EntityEvents.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/EntityEvents.cs
@@ -2,7 +2,6 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Text;
-using CoreSystems.Control;
using CoreSystems.Platform;
using CoreSystems.Projectiles;
using Sandbox.Game.Entities;
@@ -12,10 +11,8 @@
using VRage.Game;
using VRage.Game.Entity;
using VRage.Game.ModAPI;
-using VRageMath;
using static CoreSystems.Platform.CorePlatform;
using static CoreSystems.Session;
-using static VRage.Game.ObjectBuilders.Definitions.MyObjectBuilder_GameDefinition;
namespace CoreSystems.Support
{
@@ -146,12 +143,6 @@ private void OnContentsChanged(MyInventoryBase inv, MyPhysicalInventoryItem item
}
}
- private static void OnMarkForClose(MyEntity myEntity)
- {
-
- }
-
-
private void IsWorkingChanged(MyCubeBlock myCubeBlock)
{
var wasFunctional = IsFunctional;
@@ -221,227 +212,117 @@ internal string GetSystemStatus()
private void AppendingCustomInfoWeapon(IMyTerminalBlock block, StringBuilder stringBuilder)
{
- try
+ var comp = ((Weapon.WeaponComponent)this);
+ /*
+ var r = "[color=#DDFF0000]"; //ARGB in hex values
+ var y = "[color=#DDFFFF00]";
+ var g = "[color=#DD00FF00]";
+ var e = "[/color]";
+ stringBuilder.Append($"{r}Red{e} {y}Yellow{e} {g}Green{e}");
+ */
+
+ var collection = comp.HasAlternateUi ? SortAndGetTargetTypes() : TypeSpecific != CompTypeSpecific.Phantom ? Platform.Weapons : Platform.Phantoms;
+ var debug = Debug || comp.Data.Repo.Values.Set.Overrides.Debug;
+ var advanced = (I.Settings.ClientConfig.AdvancedMode || debug) && !comp.HasAlternateUi;
+ if (HasServerOverrides)
+ stringBuilder.Append($"\n{Localization.GetText("WeaponInfoServerModdedLine1")}\n")
+ .Append($"\n{Localization.GetText("WeaponInfoServerModdedLine2")}");
+
+ if (comp.PrimaryWeapon.System.TrackProhibitLG)
+ stringBuilder.Append($"\nCannot target large grids!");
+
+ if (comp.PrimaryWeapon.System.TrackProhibitSG)
+ stringBuilder.Append($"\nCannot target small grids!");
+
+ //Start of new formatting
+ if (IdlePower > 0.01)
+ stringBuilder.Append($"\n{Localization.GetText("WeaponInfoIdlePower")}: {IdlePower:0.00} {Localization.GetText("WeaponInfoMWLabel")}");
+
+ for (int i = 0; i < collection.Count; i++)
{
- var comp = ((Weapon.WeaponComponent)this);
- /*
- var r = "[color=#DDFF0000]"; //ARGB in hex values
- var y = "[color=#DDFFFF00]";
- var g = "[color=#DD00FF00]";
- var e = "[/color]";
- stringBuilder.Append($"{r}Red{e} {y}Yellow{e} {g}Green{e}");
- */
-
- var collection = comp.HasAlternateUi ? SortAndGetTargetTypes() : TypeSpecific != CompTypeSpecific.Phantom ? Platform.Weapons : Platform.Phantoms;
- var debug = Debug || comp.Data.Repo.Values.Set.Overrides.Debug;
- var advanced = (I.Settings.ClientConfig.AdvancedMode || debug) && !comp.HasAlternateUi;
- if (HasServerOverrides)
- stringBuilder.Append($"\nWeapon modified by server!\n")
- .Append($"Report issues to server admins.\n");
-
- //Start of new formatting
- if (IdlePower > 0.01)
- stringBuilder.Append($"\nIdle Power: " + IdlePower.ToString("0.00") + " MW");
-
- for (int i = 0; i < collection.Count; i++)
+ var w = collection[i];
+ string shots = "";
+ if ((w.ActiveAmmoDef.AmmoDef.Const.EnergyAmmo || w.ActiveAmmoDef.AmmoDef.Const.IsHybrid) && !comp.HasAlternateUi)
{
- var w = collection[i];
- string shots = "";
- if ((w.ActiveAmmoDef.AmmoDef.Const.EnergyAmmo || w.ActiveAmmoDef.AmmoDef.Const.IsHybrid) && !comp.HasAlternateUi)
- {
- var chargeTime = w.AssignedPower > 0 ? (int)((w.MaxCharge - w.ProtoWeaponAmmo.CurrentCharge) / w.AssignedPower * MyEngineConstants.PHYSICS_STEP_SIZE_IN_SECONDS) : 0;
- shots += "\nDraw/Max: " + (SinkPower - IdlePower).ToString("0.00") + "/" + w.ActiveAmmoDef.AmmoDef.Const.PowerPerTick.ToString("0.00") + " MW" +
- $"\n{(chargeTime == 0 ? "Power: Charged" : "Power: Charged in " + chargeTime + "s")}";
- }
-
- var endReturn = i + 1 != collection.Count ? "\n" : string.Empty;
- var timeToLoad = (int)(w.ReloadEndTick - Session.I.Tick) / 60;
- var showName = w.ActiveAmmoDef.AmmoDef.Const.TerminalName != w.ActiveAmmoDef.AmmoDef.Const.MagazineDef.DisplayNameText;
- var displayName = showName ? w.ActiveAmmoDef.AmmoDef.Const.TerminalName + " (" + w.ActiveAmmoDef.AmmoDef.Const.MagazineDef.DisplayNameText + ")" : w.ActiveAmmoDef.AmmoDef.Const.TerminalName;
- stringBuilder.Append($"\n\n" + w.System.PartName +
- shots +
- $" {(w.ActiveAmmoDef.AmmoDef.Const.EnergyAmmo ? string.Empty : "\nAmmo: " + (w.Loading ? timeToLoad < 0 ? "Waiting on charge" : "Loaded in " + timeToLoad + "s": w.ProtoWeaponAmmo.CurrentAmmo > 0 ? "Loaded " + w.ProtoWeaponAmmo.CurrentAmmo + "x " + displayName : "No Ammo"))}" +
- $" {(w.ActiveAmmoDef.AmmoDef.Const.RequiresTarget ? "\n" + Localization.GetText("WeaponInfoHasTarget") + ": " + w.Target.HasTarget : string.Empty)}" +
- $" {(w.ActiveAmmoDef.AmmoDef.Const.RequiresTarget ? "\n" + Localization.GetText("WeaponInfoLoS") + ": " + (w.Target.HasTarget ? "" + !w.PauseShoot : "No Target") : string.Empty)}" +
- endReturn);
+ var chargeTime = w.AssignedPower > 0 ? (int)((w.MaxCharge - w.ProtoWeaponAmmo.CurrentCharge) / w.AssignedPower * MyEngineConstants.PHYSICS_STEP_SIZE_IN_SECONDS) : 0;
+ shots += $"\n{Localization.GetText("WeaponInfoDrawOverMax")}: {SinkPower - IdlePower:0.00}/ {w.ActiveAmmoDef.AmmoDef.Const.PowerPerTick:0.00} {Localization.GetText("WeaponInfoMWLabel")}" +
+ $"\n{(chargeTime == 0 ? Localization.GetText("WeaponInfoPowerCharged") : Localization.GetText("WeaponInfoPowerChargedIn") + " " + chargeTime + Localization.GetText("WeaponInfoSeconds"))}";
}
+
+ var endReturn = i + 1 != collection.Count ? "\n" : string.Empty;
+ var timeToLoad = (int)(w.ReloadEndTick - Session.I.Tick) / 60;
+ var showName = w.ActiveAmmoDef.AmmoDef.Const.TerminalName != w.ActiveAmmoDef.AmmoDef.Const.MagazineDef.DisplayNameText;
+ var displayName = showName ? w.ActiveAmmoDef.AmmoDef.Const.TerminalName + " (" + w.ActiveAmmoDef.AmmoDef.Const.MagazineDef.DisplayNameText + ")" : w.ActiveAmmoDef.AmmoDef.Const.TerminalName;
+ stringBuilder.Append($"\n\n" + w.System.PartName +
+ shots +
+ $" {(w.ActiveAmmoDef.AmmoDef.Const.EnergyAmmo ? string.Empty : $"\n{Localization.GetText("WeaponInfoAmmoLabel")}: " + (w.Loading ? timeToLoad < 0 ? Localization.GetText("WeaponInfoWaitingCharge") : Localization.GetText("WeaponInfoLoadedIn") + " " + timeToLoad + Localization.GetText("WeaponInfoSeconds") : w.ProtoWeaponAmmo.CurrentAmmo > 0 ? Localization.GetText("WeaponInfoLoaded") + " " + w.ProtoWeaponAmmo.CurrentAmmo + "x " + displayName : w.Comp.CurrentInventoryVolume > 0 ? Localization.GetText("WeaponInfoCheckAmmoType") : Localization.GetText("WeaponInfoNoammo")))}" +
+ $" {(w.ActiveAmmoDef.AmmoDef.Const.RequiresTarget ? "\n" + Localization.GetText("WeaponInfoHasTarget") + ": " + (w.Target.HasTarget ? Localization.GetText("WeaponTargTrue") : w.Comp.MasterAi.DetectionInfo.SomethingInRange && (w.Target.CurrentState == Target.States.NotSet || w.Target.CurrentState == Target.States.Expired) ? Localization.GetText("WeaponTargNeedSelection") : w.MinTargetDistanceSqr > 0 && (comp.MasterAi.DetectionInfo.OtherRangeSqr < w.MinTargetDistanceSqr || comp.MasterAi.DetectionInfo.PriorityRangeSqr < w.MinTargetDistanceSqr) ? Localization.GetText("WeaponTargTooClose") : w.BaseComp.MasterAi.DetectionInfo.SomethingInRange ? Localization.GetText("WeaponTargRange") : Localization.GetText("WeaponTargFalse")) : string.Empty)}" +
+ $" {(w.ActiveAmmoDef.AmmoDef.Const.RequiresTarget ? "\n" + Localization.GetText("WeaponInfoLoS") + ": " + (w.Target.HasTarget ? "" + !w.PauseShoot : Localization.GetText("WeaponInfoNoTarget")) : string.Empty)}" +
+ endReturn);
+ }
- if (HeatPerSecond > 0)
- stringBuilder.Append($"\nHeat per Sec/Max: {HeatPerSecond}/{MaxHeat}" +
- $"\n{Localization.GetText("WeaponInfoCurrentHeat")}: {CurrentHeat:0.} W ({(CurrentHeat / MaxHeat):P})");
+ if (HeatPerSecond > 0)
+ stringBuilder.Append($"\n{Localization.GetText("WeaponInfoHeatPerSecOverMax")}: {HeatPerSecond}/{MaxHeat}" +
+ $"\n{Localization.GetText("WeaponInfoCurrentHeat")}: {CurrentHeat:0.} W ({(CurrentHeat / MaxHeat):P})");
- if (advanced)
+ if (advanced)
+ {
+ stringBuilder.Append($"\n\n{Localization.GetText("WeaponInfoStatsHeader")}" +
+ $"\n{Localization.GetText("WeaponInfoDPSLabel")}: {comp.PeakDps:0.}");
+ for (int i = 0; i < collection.Count; i++)
{
- stringBuilder.Append($"\n\n--- Stats ---" +
- $"\nDPS: {comp.PeakDps:0.}");
- for (int i = 0; i < collection.Count; i++)
+ var w = collection[i];
+ stringBuilder.Append($" {(collection.Count > 1 ? "\n{w.FriendlyName}" : string.Empty)}" +
+ $"{(w.MinTargetDistance > 0 ? $"\n{Localization.GetText("WeaponInfoMinRange")}: {w.MinTargetDistance}{Localization.GetText("WeaponInfoMeter")}" : string.Empty)}" +
+ $"\n{Localization.GetText("WeaponInfoMaxRange")}: {w.MaxTargetDistance}{Localization.GetText("WeaponInfoMeter")}" +
+ $"\n{Localization.GetText("WeaponInfoROF")}: {w.ActiveAmmoDef.AmmoDef.Const.RealShotsPerMin:0.}{Localization.GetText("WeaponInfoPerMin")}");
+ if(w.ActiveAmmoDef.AmmoDef.Const.RequiresTarget)
{
- var w = collection[i];
- stringBuilder.Append($" {(collection.Count > 1 ? "\n{w.FriendlyName}" : string.Empty)}" +
- $"{(w.MinTargetDistance > 0 ? "\nMin Range: " + w.MinTargetDistance + "m" : string.Empty)}" +
- $"\nMax Range: {w.MaxTargetDistance}m" +
- $"\nRoF: {w.ActiveAmmoDef.AmmoDef.Const.RealShotsPerMin}/min");
- if(w.ActiveAmmoDef.AmmoDef.Const.RequiresTarget)
+ var targ = $"{Localization.GetText("WeaponInfoTargetLabel")}: ";
+ if (w.Target.HasTarget && w.Target.TargetObject != null)
{
- var targ = "Target: ";
- if (w.Target.HasTarget && w.Target.TargetObject != null)
+ var pTarg = w.Target.TargetObject as Projectile;
+ var eTarg = w.Target.TargetObject as MyEntity;
+ if(pTarg != null)
{
- var pTarg = w.Target.TargetObject as Projectile;
- var eTarg = w.Target.TargetObject as MyEntity;
- if(pTarg != null)
- {
- targ += "Projectile";
- }
- else if (eTarg != null)
- {
- var topEnt = eTarg.GetTopMostParent();
- var grid = topEnt as MyCubeGrid;
- var suit = eTarg as IMyCharacter;
- if (grid != null)
- targ += topEnt.DisplayName;
- else if (suit != null)
- targ += suit.DisplayName;
- }
+ targ += Localization.GetText("WeaponInfoProjectileLabel");
}
- else
- targ += "none";
- stringBuilder.Append($"\n{targ}");
- }
-
- string otherAmmo = null;
- if (!comp.HasAlternateUi)
- {
- for (int j = 0; j < w.System.AmmoTypes.Length; j++)
+ else if (eTarg != null)
{
- var ammo = w.System.AmmoTypes[j];
- if (!ammo.AmmoDef.Const.IsTurretSelectable || string.IsNullOrEmpty(ammo.AmmoDef.AmmoRound) || ammo.AmmoDef.AmmoRound == "Energy")
- continue;
-
- if (otherAmmo == null)
- otherAmmo = "\n\nAmmo Types (Mag if different):";
- var showName = ammo.AmmoDef.Const.TerminalName != ammo.AmmoDef.Const.MagazineDef.DisplayNameText && ammo.AmmoDef.Const.MagazineDef.DisplayNameText != "Energy";
- otherAmmo += $"\n{ammo.AmmoDef.Const.TerminalName} {(showName ? "(" + ammo.AmmoDef.Const.MagazineDef.DisplayNameText + ")" : "")}";
+ var topEnt = eTarg.GetTopMostParent();
+ var grid = topEnt as MyCubeGrid;
+ var suit = eTarg as IMyCharacter;
+ if (grid != null)
+ targ += topEnt.DisplayName;
+ else if (suit != null)
+ targ += suit.DisplayName;
}
-
- if (otherAmmo != null)
- stringBuilder.Append(otherAmmo);
}
+ else
+ targ += Localization.GetText("WeaponInfoNoneTarget");
+ stringBuilder.Append($"\n{targ}");
}
- }
- ///////
-
- /* OLD STUFF
-
- if (advanced)
- {
- stringBuilder.Append($"\n{Localization.GetText("WeaponInfoConstructDPS")}: " + Ai.EffectiveDps.ToString("e2"))
- .Append($"\n{Localization.GetText("WeaponInfoPeakDps")}: " + comp.PeakDps.ToString("0.0"))
- .Append($"\n{Localization.GetText("WeaponInfoBaseDps")}: " + comp.BaseDps.ToString("0.0"))
- .Append($"\n{Localization.GetText("WeaponInfoAreaDps")}: " + comp.AreaDps.ToString("0.0"))
- .Append($"\n{Localization.GetText("WeaponInfoExplode")}: " + comp.DetDps.ToString("0.0"))
- .Append("\n")
- .Append($"\n{Localization.GetText("WeaponTotalEffect")}: " + comp.TotalEffect.ToString("e2"))
- .Append($"\n " + Ai.Construct.RootAi?.Construct.TotalEffect.ToString("e2"))
- .Append($"\n{Localization.GetText("WeaponTotalEffectAvgDps")}: " + comp.AverageEffect.ToString("N0") + " - (" + comp.AddEffect.ToString("N0") + ")")
- .Append($"\n " + Ai.Construct.RootAi?.Construct.AverageEffect.ToString("N0") + " - (" + Ai.Construct.RootAi?.Construct.AddEffect.ToString("N0") + ")");
- }
- else
- {
- if (!comp.HasAlternateUi)
- stringBuilder.Append($"\n{Localization.GetText("WeaponInfoPeakDps")}: " + comp.PeakDps.ToString("0.0"));
- }
-
-
- if (HeatPerSecond > 0 && advanced)
- stringBuilder.Append("\n__________________________________" )
- .Append($"\n{Localization.GetText("WeaponInfoHeatGenerated")}: {HeatPerSecond:0.0} W ({(HeatPerSecond / MaxHeat) :P}/s)")
- .Append($"\n{Localization.GetText("WeaponInfoHeatDissipated")}: {HeatSinkRate:0.0} W ({(HeatSinkRate / MaxHeat):P}/s)")
- .Append($"\n{Localization.GetText("WeaponInfoCurrentHeat")}: {CurrentHeat:0.0} J ({(CurrentHeat / MaxHeat):P})");
-
- if (!comp.HasAlternateUi && advanced)
- {
- stringBuilder.Append(advanced ? "\n__________________________________\n" : string.Empty)
- .Append($"\n{Localization.GetText("WeaponInfoShotsPerSec")}: " + comp.RealShotsPerSec.ToString("0.00"));//+ " (" + comp.ShotsPerSec.ToString("0.00") + ")")
-
- if(SinkPower > 0.01)
- stringBuilder.Append($"\n{Localization.GetText("WeaponInfoCurrentDraw")}: " + SinkPower.ToString("0.00") + " MW");
- }
-
- if (comp.HasEnergyWeapon && advanced)
- stringBuilder.Append($"\n{Localization.GetText("WeaponInfoRequiredPower")}: " + Platform.Structure.ActualPeakPowerCombined.ToString("0.00") + " MW");
+ string otherAmmo = null;
if (!comp.HasAlternateUi)
- stringBuilder.Append($"\n\n{Localization.GetText("WeaponInfoDividerLineWeapon")}");
-
- for (int i = 0; i < collection.Count; i++)
{
- var w = collection[i];
- string shots;
- if ((w.ActiveAmmoDef.AmmoDef.Const.EnergyAmmo || w.ActiveAmmoDef.AmmoDef.Const.IsHybrid) && !comp.HasAlternateUi)
+ for (int j = 0; j < w.System.AmmoTypes.Length; j++)
{
- var chargeTime = w.AssignedPower > 0 ? (int)((w.MaxCharge - w.ProtoWeaponAmmo.CurrentCharge) / w.AssignedPower * MyEngineConstants.PHYSICS_STEP_SIZE_IN_SECONDS) : 0;
-
- shots = $"\nCharge: {(chargeTime == 0 ? "Charged" : "" + chargeTime + " s remaining" )}"; //(w.Comp.ModOverride ? "NPC Override" : w.Charging.ToString()) + (chargeTime == 0f ? " Charged" : " ("+ chargeTime+")");
- shots += "\nCurrent/Max(MW): " + (SinkPower - IdlePower).ToString("0.00") + "/" + w.ActiveAmmoDef.AmmoDef.Const.PowerPerTick.ToString("0.00");
-
- if (w.ActiveAmmoDef.AmmoDef.Const.IsHybrid) shots += "\n" + w.ActiveAmmoDef.AmmoDef.AmmoRound + ": " + w.ProtoWeaponAmmo.CurrentAmmo;
+ var ammo = w.System.AmmoTypes[j];
+ if (!ammo.AmmoDef.Const.IsTurretSelectable || string.IsNullOrEmpty(ammo.AmmoDef.AmmoRound) || ammo.AmmoDef.AmmoRound == "Energy")
+ continue;
+
+ if (otherAmmo == null)
+ otherAmmo = $"\n\n{Localization.GetText("WeaponInfoAmmoType")}:";
+ var showName = ammo.AmmoDef.Const.TerminalName != ammo.AmmoDef.Const.MagazineDef.DisplayNameText && ammo.AmmoDef.Const.MagazineDef.DisplayNameText != "Energy";
+ otherAmmo += $"\n{ammo.AmmoDef.Const.TerminalName} {(showName ? "(" + ammo.AmmoDef.Const.MagazineDef.DisplayNameText + ")" : "")}";
}
- else shots = "\n" + w.ActiveAmmoDef.AmmoDef.AmmoRound + ": " + w.ProtoWeaponAmmo.CurrentAmmo;
-
- var burst = advanced && w.ActiveAmmoDef.AmmoDef.Const.BurstMode && w.System.ShotsPerBurst > 1 && !comp.HasAlternateUi ? $"\nShootMode: " + w.ShotsFired + "(" + w.System.ShotsPerBurst + $") - {Localization.GetText("WeaponInfoDelay")}: " + w .System.Values.HardPoint.Loading.DelayAfterBurst : string.Empty;
-
- var endReturn = i + 1 != collection.Count ? "\n" : string.Empty;
-
- if (!comp.HasAlternateUi)
- stringBuilder.Append($"\n{Localization.GetText("WeaponInfoName")}: " + w.System.PartName + shots + burst +
- $" {(w.ActiveAmmoDef.AmmoDef.Const.RequiresTarget ? "\n" + Localization.GetText("WeaponInfoHasTarget") + ": " + w.Target.HasTarget.ToString() : "")}" + // \n{Localization.GetText("WeaponInfoHasTarget")}: " + (w.ActiveAmmoDef.AmmoDef.Const.RequiresTarget ? w.Target.HasTarget.ToString() : "n/a") +
- $"\n{Localization.GetText("WeaponInfoReloading")}: " + w.Loading +
- $" {(w.ActiveAmmoDef.AmmoDef.Const.RequiresTarget ? "\n" + Localization.GetText("WeaponInfoLoS") + ": " + !w.PauseShoot : "")}" +
- endReturn);
- else
- stringBuilder.Append($"\n{Localization.GetText("WeaponInfoName")}: " + w.System.PartName + (w.Target.HasTarget ? $"\n{Localization.GetText("WeaponInfoTargetState")}: " + w.Target.CurrentState : string.Empty));
-
- string otherAmmo = null;
- if (!comp.HasAlternateUi)
- {
- for (int j = 0; j < w.System.AmmoTypes.Length; j++)
- {
- var ammo = w.System.AmmoTypes[j];
- if (ammo == w.ActiveAmmoDef || !ammo.AmmoDef.Const.IsTurretSelectable || string.IsNullOrEmpty(ammo.AmmoDef.AmmoRound) || ammo.AmmoDef.AmmoRound == "Energy")
- continue;
-
- if (otherAmmo == null)
- otherAmmo = "\n\nAlternate Magazines:";
-
- otherAmmo += $"\n{ammo.AmmoDef.AmmoRound}";
- }
-
- if (otherAmmo != null)
- stringBuilder.Append(otherAmmo);
- }
+ if (otherAmmo != null)
+ stringBuilder.Append(otherAmmo);
}
-
- if (advanced)
- {
- foreach (var weapon in collection)
- {
- var chargeTime = weapon.AssignedPower > 0 ? (int)((weapon.MaxCharge - weapon.ProtoWeaponAmmo.CurrentCharge) / weapon.AssignedPower * MyEngineConstants.PHYSICS_STEP_SIZE_IN_SECONDS) : 0;
- stringBuilder.Append($"\n\nWeapon: {weapon.System.PartName} - Enabled: {IsWorking}");
- stringBuilder.Append($"\nTargetState: {weapon.Target.CurrentState} - Manual: {weapon.BaseComp.UserControlled || weapon.Target.TargetState == Target.TargetStates.IsFake}");
- stringBuilder.Append($"\nEvent: {weapon.LastEvent} - ProtoWeaponAmmo :{!weapon.NoMagsToLoad}");
- stringBuilder.Append($"\nOverHeat: {weapon.PartState.Overheated} - Shooting: {weapon.IsShooting}");
- stringBuilder.Append($"\nisAligned: {weapon.Target.IsAligned}");
- stringBuilder.Append($"\nCanShoot: {weapon.ShotReady} - Charging: {weapon.Charging}");
- stringBuilder.Append($"\nAiShooting: {weapon.AiShooting}");
- stringBuilder.Append($"\n{(weapon.ActiveAmmoDef.AmmoDef.Const.EnergyAmmo ? "ChargeSize: " + weapon.ActiveAmmoDef.AmmoDef.Const.ChargSize : "MagSize: " + weapon.ActiveAmmoDef.AmmoDef.Const.MagazineSize)} ({weapon.ProtoWeaponAmmo.CurrentCharge})");
- stringBuilder.Append($"\nChargeTime: {chargeTime}");
- stringBuilder.Append($"\nCharging: {weapon.Charging}({weapon.ActiveAmmoDef.AmmoDef.Const.MustCharge})");
- }
- }
- */
+ }
}
- catch (Exception ex) { Log.Line($"Exception in Weapon AppendingCustomInfo: {ex}", null, true); }
}
private List SortAndGetTargetTypes()
diff --git a/Data/Scripts/CoreSystems/EntityComp/EntityInit.cs b/Data/Scripts/CoreSystems/EntityComp/EntityInit.cs
index 34807914..0bb1d80b 100644
--- a/Data/Scripts/CoreSystems/EntityComp/EntityInit.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/EntityInit.cs
@@ -1,10 +1,6 @@
-using System;
-using CoreSystems.Platform;
+using CoreSystems.Platform;
using Sandbox.Game;
-using Sandbox.Game.Entities;
using Sandbox.ModAPI;
-using VRage;
-using VRage.Game.ModAPI;
using static CoreSystems.CompData;
namespace CoreSystems.Support
{
diff --git a/Data/Scripts/CoreSystems/EntityComp/EntityRun.cs b/Data/Scripts/CoreSystems/EntityComp/EntityRun.cs
index 35b6641b..8aca676d 100644
--- a/Data/Scripts/CoreSystems/EntityComp/EntityRun.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/EntityRun.cs
@@ -1,5 +1,4 @@
-using System;
-using CoreSystems.Platform;
+using CoreSystems.Platform;
using Sandbox.Game.Entities;
using Sandbox.ModAPI;
using VRage.Game.Components;
@@ -227,7 +226,10 @@ internal void OnAddedToSceneTasks(bool firstRun)
foreach (var weapon in Platform.Weapons)
{
var scopeInfo = weapon.GetScope.Info;
- if (!obb.Contains(ref scopeInfo.Position))
+
+ if (weapon.Comp.PrimaryWeapon.System.AllowScopeOutsideObb)
+ weapon.ScopeDistToCheckPos = 0;
+ else if (!obb.Contains(ref scopeInfo.Position))
{
var rayBack = new RayD(scopeInfo.Position, -scopeInfo.Direction);
weapon.ScopeDistToCheckPos = obb.Intersects(ref rayBack) ?? 0;
diff --git a/Data/Scripts/CoreSystems/EntityComp/EntityState.cs b/Data/Scripts/CoreSystems/EntityComp/EntityState.cs
index 53a417f6..d43248c7 100644
--- a/Data/Scripts/CoreSystems/EntityComp/EntityState.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/EntityState.cs
@@ -1,9 +1,7 @@
-using System;
-using CoreSystems.Platform;
+using CoreSystems.Platform;
using Sandbox.Game.Entities;
using VRage.Game.Entity;
using static CoreSystems.Support.WeaponDefinition.AnimationDef.PartAnimationSetDef;
-using static VRage.Game.ObjectBuilders.Definitions.MyObjectBuilder_GameDefinition;
namespace CoreSystems.Support
{
@@ -59,47 +57,42 @@ internal void WakeupComp()
internal void SubpartClosed(MyEntity ent)
{
- try
+ if (ent == null)
{
- if (ent == null)
- {
- Log.Line($"SubpartClosed had null entity");
- return;
- }
+ Log.Line($"SubpartClosed had null entity");
+ return;
+ }
- using (CoreEntity.Pin())
+ using (CoreEntity.Pin())
+ {
+ ent.OnClose -= SubpartClosed;
+ if (!CoreEntity.MarkedForClose && Platform.State == CorePlatform.PlatformState.Ready)
{
- ent.OnClose -= SubpartClosed;
- if (!CoreEntity.MarkedForClose && Platform.State == CorePlatform.PlatformState.Ready)
+ if (Type == CompType.Weapon)
+ Platform.ResetParts();
+ Status = Start.Started;
+
+ foreach (var w in Platform.Weapons)
{
- if (Type == CompType.Weapon)
- Platform.ResetParts();
- Status = Start.Started;
+ w.Azimuth = 0;
+ w.Elevation = 0;
+ w.Elevation = 0;
+
+ if (w.ActiveAmmoDef.AmmoDef.Const.MustCharge)
+ w.ExitCharger = true;
- foreach (var w in Platform.Weapons)
+ if (!FunctionalBlock.Enabled)
+ w.EventTriggerStateChanged(EventTriggers.TurnOff, true);
+ else if (w.AnimationsSet.ContainsKey(EventTriggers.TurnOn))
+ Session.I.FutureEvents.Schedule(w.TurnOnAV, null, 100);
+
+ if (w.ProtoWeaponAmmo.CurrentAmmo == 0)
{
- w.Azimuth = 0;
- w.Elevation = 0;
- w.Elevation = 0;
-
- if (w.ActiveAmmoDef.AmmoDef.Const.MustCharge)
- w.ExitCharger = true;
-
- if (!FunctionalBlock.Enabled)
- w.EventTriggerStateChanged(EventTriggers.TurnOff, true);
- else if (w.AnimationsSet.ContainsKey(EventTriggers.TurnOn))
- Session.I.FutureEvents.Schedule(w.TurnOnAV, null, 100);
-
- if (w.ProtoWeaponAmmo.CurrentAmmo == 0)
- {
- w.EventTriggerStateChanged(EventTriggers.EmptyOnGameLoad, true);
- }
+ w.EventTriggerStateChanged(EventTriggers.EmptyOnGameLoad, true);
}
}
}
}
- catch (Exception ex) { Log.Line($"Exception in SubpartClosed: {ex}", null, true);
- }
}
internal void ForceClose(object o)
diff --git a/Data/Scripts/CoreSystems/EntityComp/EntitySupport.cs b/Data/Scripts/CoreSystems/EntityComp/EntitySupport.cs
index d5e2a4c6..f44f2830 100644
--- a/Data/Scripts/CoreSystems/EntityComp/EntitySupport.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/EntitySupport.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections.ObjectModel;
using CoreSystems.Platform;
using Sandbox.Game.Entities;
using Sandbox.ModAPI.Weapons;
diff --git a/Data/Scripts/CoreSystems/EntityComp/ModelSupport/RecursiveSubparts.cs b/Data/Scripts/CoreSystems/EntityComp/ModelSupport/RecursiveSubparts.cs
index b60a690f..6367f1cf 100644
--- a/Data/Scripts/CoreSystems/EntityComp/ModelSupport/RecursiveSubparts.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/ModelSupport/RecursiveSubparts.cs
@@ -5,7 +5,6 @@
using VRage.Game.Entity;
using VRage.Game.ModAPI;
using VRage.ModAPI;
-using VRage.Utils;
using VRageMath;
namespace CoreSystems.Support
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlComp.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlComp.cs
index 99ef6403..cda70389 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlComp.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlComp.cs
@@ -7,7 +7,6 @@
using VRage.Game.Entity;
using VRage.Utils;
using VRageMath;
-using static VRage.Game.ObjectBuilders.Definitions.MyObjectBuilder_GameDefinition;
namespace CoreSystems.Platform
{
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlData.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlData.cs
index 7f3bc9f9..3c4e489a 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlData.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlData.cs
@@ -2,7 +2,6 @@
using CoreSystems.Support;
using Sandbox.ModAPI;
using VRageMath;
-using static VRage.Game.ObjectBuilders.Definitions.MyObjectBuilder_GameDefinition;
namespace CoreSystems.Platform
{
@@ -91,7 +90,7 @@ internal bool ValidFakeTargetInfo(long playerId, out Ai.FakeTarget.FakeWorldTarg
if (Session.I.PlayerDummyTargets.TryGetValue(playerId, out fakeTargets))
{
var validManual = Comp.Data.Repo.Values.Set.Overrides.Control == ProtoWeaponOverrides.ControlModes.Manual && Comp.Data.Repo.Values.State.TrackingReticle && fakeTargets.ManualTarget.FakeInfo.WorldPosition != Vector3D.Zero;
- var validPainter = Comp.Data.Repo.Values.Set.Overrides.Control == ProtoWeaponOverrides.ControlModes.Painter && fakeTargets.PaintedTarget.LocalPosition != Vector3D.Zero;
+ var validPainter = !Session.I.Settings.Enforcement.ProhibitHUDPainter && Comp.Data.Repo.Values.Set.Overrides.Control == ProtoWeaponOverrides.ControlModes.Painter && fakeTargets.PaintedTarget.LocalPosition != Vector3D.Zero;
var fakeTarget = validPainter && preferPainted ? fakeTargets.PaintedTarget : validManual ? fakeTargets.ManualTarget : null;
if (fakeTarget == null)
return false;
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlFields.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlFields.cs
index 66a55d8e..4cb86b71 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlFields.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlFields.cs
@@ -1,6 +1,5 @@
using CoreSystems.Support;
using Sandbox.ModAPI;
-using System.Runtime.Remoting.Metadata.W3cXsd2001;
using VRage.Utils;
using VRageMath;
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlTracking.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlTracking.cs
index b20d8583..93ad2e3a 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlTracking.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Control/ControlTracking.cs
@@ -64,7 +64,13 @@ internal static bool TrajectoryEstimation(ControlSys control, out Vector3D targe
var maxRangeSqr = fakeTargetInfo != null && topAi.Construct.RootAi != null ? topAi.Construct.RootAi.MaxTargetingRangeSqr : cValues.Set.Range * cValues.Set.Range;
bool valid;
- topAi.RotorTargetPosition = Weapon.TrajectoryEstimation(weapon, targetCenter, targetVel, targetAcc, shooterPos, out valid, false, cValues.Set.Overrides.AngularTracking);
+ if (weapon.ActiveAmmoDef.AmmoDef.Const.IsBeamWeapon)
+ {
+ valid = true;
+ topAi.RotorTargetPosition = targetCenter;
+ }
+ else
+ topAi.RotorTargetPosition = Weapon.TrajectoryEstimation(weapon, targetCenter, targetVel, targetAcc, shooterPos, out valid, false, cValues.Set.Overrides.AngularTracking);
targetDirection = Vector3D.Normalize(topAi.RotorTargetPosition - shooterPos);
return valid && Vector3D.DistanceSquared(topAi.RotorTargetPosition, shooterPos) < maxRangeSqr;
}
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/PartFields.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/PartFields.cs
index 4daf36ff..4641041e 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/PartFields.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/PartFields.cs
@@ -1,14 +1,9 @@
-using System;
-using System.Collections.Generic;
-using CoreSystems.Support;
-using VRageMath;
+using CoreSystems.Support;
namespace CoreSystems.Platform
{
public partial class Part
{
- //internal readonly List> Monitors = new List>();
-
internal CoreComponent BaseComp;
internal CoreSystem CoreSystem;
internal PartAcquire Acquire;
@@ -40,8 +35,6 @@ internal void Init(CoreComponent comp, CoreSystem system, int partId)
Acquire = new PartAcquire(this);
UniquePartId = Session.I.UniquePartId;
ShortLoadId = Session.I.ShortLoadAssigner();
- //for (int i = 0; i < BaseComp.Monitors[PartId].Count; i++)
- // Monitors.Add(BaseComp.Monitors[PartId][i]);
}
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Support/SupportCharge.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Support/SupportCharge.cs
index 99cadf0c..af5bd09c 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Support/SupportCharge.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Support/SupportCharge.cs
@@ -1,6 +1,4 @@
-using Sandbox.Game.Entities;
-
-namespace CoreSystems.Platform
+namespace CoreSystems.Platform
{
public partial class SupportSys
{
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Support/SupportComp.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Support/SupportComp.cs
index ff6d30a3..158e3362 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Support/SupportComp.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Support/SupportComp.cs
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using CoreSystems.Support;
-using Sandbox.Game.Entities;
using VRage.Game;
using VRage.Game.Entity;
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Support/SupportMisc.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Support/SupportMisc.cs
index 89d33059..114dcaed 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Support/SupportMisc.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Support/SupportMisc.cs
@@ -1,5 +1,4 @@
using System.Collections.Concurrent;
-using Sandbox.Game.Entities;
using VRage.Game.ModAPI;
using static CoreSystems.Support.SupportDefinition.SupportEffect.Protections;
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Upgrade/UpgradeComp.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Upgrade/UpgradeComp.cs
index 27ffb003..818049ee 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Upgrade/UpgradeComp.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Upgrade/UpgradeComp.cs
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using CoreSystems.Support;
-using Sandbox.Game.Entities;
using VRage.Game;
using VRage.Game.Entity;
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponAv.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponAv.cs
index 8da79651..f1ca7056 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponAv.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponAv.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using CoreSystems.Support;
-using Sandbox.ModAPI;
using VRage.Game;
using VRageMath;
using static CoreSystems.Support.PartAnimation;
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponComp.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponComp.cs
index 857d9c9b..a0a2bb6a 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponComp.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponComp.cs
@@ -9,7 +9,6 @@
using Sandbox.ModAPI.Weapons;
using VRage.Game;
using VRage.Game.Entity;
-using VRage.Game.ModAPI;
using VRage.ModAPI;
using VRage.ObjectBuilders;
using VRage.Utils;
@@ -59,6 +58,7 @@ public partial class WeaponComponent : CoreComponent
internal bool HasDisabledBurst;
internal bool HasRofSlider;
internal bool ShootSubmerged;
+ internal bool TargetSubmerged;
internal bool HasTracking;
internal bool HasRequireTarget;
internal bool HasDrone;
@@ -425,7 +425,6 @@ internal void DetectStateChanges(bool masterChange)
Ai.DetectOtherSignals = true;
var wasAsleep = IsAsleep;
IsAsleep = false;
- //IsDisabled = Ai.TouchingWater && !ShootSubmerged && Ai.WaterVolume.Contains(CoreEntity.PositionComp.WorldAABB.Center) != ContainmentType.Disjoint; //submerged wep check
if (Ai.TouchingWater && !ShootSubmerged)
{
var projectedPos = CoreEntity.PositionComp.WorldAABB.Center + (Vector3D.Normalize(CoreEntity.PositionComp.WorldVolume.Center- Ai.ClosestPlanetCenter) * CoreEntity.PositionComp.WorldVolume.Radius);
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponController.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponController.cs
index ca7a7fb5..d1692ff5 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponController.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponController.cs
@@ -1,11 +1,9 @@
using System;
using CoreSystems.Support;
-using VRage.Game.Entity;
using VRage.Utils;
using VRageMath;
using static CoreSystems.Support.WeaponDefinition.AnimationDef.PartAnimationSetDef;
using static CoreSystems.Support.CoreComponent;
-using static VRage.Game.ObjectBuilders.Definitions.MyObjectBuilder_GameDefinition;
namespace CoreSystems.Platform
{
@@ -257,79 +255,75 @@ internal void UpdatePivotPos()
internal void UpdateWeaponHeat(object o = null)
{
- try
+ if (!System.ProhibitCoolingWhenOff || System.ProhibitCoolingWhenOff && Comp.Cube.IsWorking)
{
- if (!System.ProhibitCoolingWhenOff || System.ProhibitCoolingWhenOff && Comp.Cube.IsWorking)
- {
- var hsRateMod = HsRate + (float)Comp.HeatLoss;
- Comp.CurrentHeat = Comp.CurrentHeat >= hsRateMod ? Comp.CurrentHeat - hsRateMod : 0;
- PartState.Heat = PartState.Heat >= hsRateMod ? PartState.Heat - hsRateMod : 0;
- Comp.HeatLoss = 0;
- }
-
- var set = PartState.Heat - LastHeat > 0.001 || PartState.Heat - LastHeat < 0.001;
-
- LastHeatUpdateTick = Session.I.Tick;
+ var hsRateMod = HsRate + (float)Comp.HeatLoss;
+ Comp.CurrentHeat = Comp.CurrentHeat >= hsRateMod ? Comp.CurrentHeat - hsRateMod : 0;
+ PartState.Heat = PartState.Heat >= hsRateMod ? PartState.Heat - hsRateMod : 0;
+ Comp.HeatLoss = 0;
+ }
- if (!Session.I.DedicatedServer)
- {
- var heatOffset = HeatPerc = PartState.Heat / System.MaxHeat;
+ var set = PartState.Heat - LastHeat > 0.001 || PartState.Heat - LastHeat < 0.001;
- if (set && heatOffset > .33)
- {
- if (heatOffset > 1) heatOffset = 1;
+ LastHeatUpdateTick = Session.I.Tick;
- heatOffset -= .33f;
+ if (!Session.I.DedicatedServer)
+ {
+ var heatOffset = HeatPerc = PartState.Heat / System.MaxHeat;
- var intensity = .7f * heatOffset;
+ if (set && heatOffset > .33)
+ {
+ if (heatOffset > 1) heatOffset = 1;
- var color = Session.I.HeatEmissives[(int)(heatOffset * 100)];
+ heatOffset -= .33f;
- for(int i = 0; i < HeatingParts.Count; i++)
- HeatingParts[i]?.SetEmissiveParts("Heating", color, intensity);
- }
- else if (set)
- for(int i = 0; i < HeatingParts.Count; i++)
- HeatingParts[i]?.SetEmissiveParts("Heating", Color.Transparent, 0);
+ var intensity = .7f * heatOffset;
- LastHeat = PartState.Heat;
- }
+ var color = Session.I.HeatEmissives[(int)(heatOffset * 100)];
- if (set && System.DegRof && PartState.Heat >= (System.MaxHeat * .8))
- {
- CurrentlyDegrading = true;
- UpdateRof();
+ for(int i = 0; i < HeatingParts.Count; i++)
+ HeatingParts[i]?.SetEmissiveParts("Heating", color, intensity);
}
- else if (set && CurrentlyDegrading)
- {
- if (PartState.Heat <= (System.MaxHeat * .4))
- CurrentlyDegrading = false;
+ else if (set)
+ for(int i = 0; i < HeatingParts.Count; i++)
+ HeatingParts[i]?.SetEmissiveParts("Heating", Color.Transparent, 0);
- UpdateRof();
- }
+ LastHeat = PartState.Heat;
+ }
- if (PartState.Overheated && PartState.Heat <= (System.MaxHeat * System.WepCoolDown))
- {
- EventTriggerStateChanged(EventTriggers.Overheated, false);
- if (Session.I.IsServer)
- {
- PartState.Overheated = false;
- OverHeatCountDown = 0;
- if (Session.I.MpActive)
- Session.I.SendState(Comp);
- }
+ if (set && System.DegRof && PartState.Heat >= (System.MaxHeat * .8))
+ {
+ CurrentlyDegrading = true;
+ UpdateRof();
+ }
+ else if (set && CurrentlyDegrading)
+ {
+ if (PartState.Heat <= (System.MaxHeat * .4))
+ CurrentlyDegrading = false;
- }
+ UpdateRof();
+ }
- if (PartState.Heat > 0)
- Session.I.FutureEvents.Schedule(UpdateWeaponHeat, null, 20);
- else
+ if (PartState.Overheated && PartState.Heat <= (System.MaxHeat * System.WepCoolDown))
+ {
+ EventTriggerStateChanged(EventTriggers.Overheated, false);
+ if (Session.I.IsServer)
{
- HeatLoopRunning = false;
- LastHeatUpdateTick = 0;
+ PartState.Overheated = false;
+ OverHeatCountDown = 0;
+ if (Session.I.MpActive)
+ Session.I.SendState(Comp);
}
+
+ }
+
+ if (PartState.Heat > 0)
+ Session.I.FutureEvents.Schedule(UpdateWeaponHeat, null, 20);
+ else
+ {
+ HeatLoopRunning = false;
+ LastHeatUpdateTick = 0;
}
- catch (Exception ex) { Log.Line($"Exception in UpdateWeaponHeat: {ex} - {System == null}- BaseComp:{Comp == null} - ProtoRepo:{Comp?.Data.Repo == null} - Weapons:{Comp.Data.Repo?.Values.State.Weapons[PartId] == null}", null, true); }
}
internal void UpdateRof()
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponData.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponData.cs
index 69b10782..09846e84 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponData.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponData.cs
@@ -137,7 +137,20 @@ internal void Load()
ProtoRepoBase = Repo;
if (Comp.TypeSpecific == CoreComponent.CompTypeSpecific.Rifle)
Comp.AmmoStorage(true);
-
+ else if (Comp.TypeSpecific != CoreComponent.CompTypeSpecific.Phantom && Comp.Cube != null && Session.I.IsServer && !Session.I.IsCreative && Comp.Cube.BlockDefinition.Id.SubtypeName == "LargeInteriorTurret") //"NPCLargeInteriorTurret"
+ {
+ var wep = collection[0];
+ if (wep.System.AmmoTypes.Length == 2)
+ foreach (var item in wep.BaseComp.CoreInventory.GetItems())
+ {
+ if (wep.System.AmmoTypes[wep.Reload.AmmoTypeId].AmmoDef.AmmoMagazine == item.Content.SubtypeName)
+ break;
+ else if (item.Content.SubtypeName == "NATO_5p56x45mm")
+ wep.ProposedAmmoId = 1;
+ else if (item.Content.SubtypeName == "RapidFireAutomaticRifleGun_Mag_50rd")
+ wep.ProposedAmmoId = 0;
+ }
+ }
}
internal void Change(DataState state)
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponFields.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponFields.cs
index c90215cc..4c2bad87 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponFields.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponFields.cs
@@ -2,25 +2,19 @@
using System.Collections.Generic;
using CoreSystems.Projectiles;
using CoreSystems.Support;
-using Sandbox.Definitions;
using Sandbox.Game.Entities;
-using Sandbox.Game.Lights;
using VRage.Game;
using VRage.Game.Entity;
using VRage.Game.ModAPI;
-using VRage.ObjectBuilders;
using VRage.Utils;
using VRageMath;
-using VRageRender.Lights;
using static CoreSystems.Session;
using static CoreSystems.Support.WeaponDefinition.AnimationDef.PartAnimationSetDef;
-using static VRage.Game.ObjectBuilders.Definitions.MyObjectBuilder_GameDefinition;
namespace CoreSystems.Platform
{
public partial class Weapon : Part
{
- internal volatile bool Casting;
private readonly int _numOfMuzzles;
private readonly int _numModelBarrels;
private readonly HashSet _muzzlesToFire = new HashSet();
@@ -120,9 +114,6 @@ public partial class Weapon : Part
internal Matrix[] BarrelRotationPerShot = new Matrix[10];
internal string FriendlyName = string.Empty;
- internal string FriendlyNameNoAmmo = string.Empty;
- internal string FriendlyNameNoTarget = string.Empty;
- internal string FriendlyNameNoSubsystem = string.Empty;
internal string AmmoName = "";
internal string AmmoNameTerminal = "";
@@ -235,6 +226,7 @@ public partial class Weapon : Part
internal bool PlayingHardPointSound;
internal bool VanillaTracking;
internal bool RotorTurretTracking;
+ internal bool RotorTurretSlaving;
internal bool ShotReady
{
@@ -274,6 +266,7 @@ internal Weapon(MyEntity entity, WeaponSystem system, int partId, WeaponComponen
if (c.MustCharge) CanUseChargeAmmo = true;
if (c.IsBeamWeapon) CanUseBeams = true;
if (c.HitParticle) hitParticle = true;
+ if (c.ShieldHitParticle) hitParticle = true;
}
comp.HasEnergyWeapon = comp.HasEnergyWeapon || CanUseEnergyAmmo || CanUseHybridAmmo;
@@ -437,88 +430,8 @@ internal Weapon(MyEntity entity, WeaponSystem system, int partId, WeaponComponen
if (System.HasAntiSmart)
Session.I.AntiSmartActive = true;
-
- if (Session.I.HandlesInput && Comp.IsBlock)
- {
- //InitLight(Color.Red, 99, 1, out Light);
- }
- }
-
- private void InitLight(Vector4 color, float radius, float falloff, out MyLight light)
- {
- var cube = Comp.Cube;
-
- light = new MyLight();
- light.Start(color, cube.CubeGrid.GridScale * radius, cube.DisplayNameText);
- light.ReflectorOn = true;
- light.LightType = MyLightType.SPOTLIGHT;
- light.ReflectorTexture = @"Textures\Lights\reflector_large.dds"; ;
- light.Falloff = 0.3f;
- light.GlossFactor = 0.0f;
- light.ReflectorGlossFactor = 1f;
- light.ReflectorFalloff = 0.5f;
- light.GlareOn = light.LightOn;
- light.GlareQuerySize = GlareQuerySizeDef;
- light.GlareType = MyGlareTypeEnum.Directional;
- light.GlareSize = _flare.Size;
- light.SubGlares = _flare.SubGlares;
-
- //light.ReflectorIntensity = 10f;
- //light.ReflectorRange = 100; // how far the projected light goes
- //light.ReflectorConeDegrees = 90; // projected light angle in degrees, max 179.
- //light.CastShadows = true;
-
-
- cube.Render.NeedsDrawFromParent = true;
- light.Position = Scope.Info.Position + (Scope.Info.Direction * 1);
- light.UpdateLight();
-
- //light.GlareSize = new Vector2(1, 1); // glare size in X and Y.
- //light.GlareIntensity = 2;
- //light.GlareMaxDistance = 50;
- //light.SubGlares = GetFlareDefinition("InteriorLight").SubGlares; // subtype name from flares.sbc
- //light.GlareType = MyGlareTypeEnum.Normal; // usable values: MyGlareTypeEnum.Normal, MyGlareTypeEnum.Distant, MyGlareTypeEnum.Directional
- //light.GlareQuerySize = 0.5f; // glare "box" size, affects occlusion and fade occlussion
- //light.GlareQueryShift = 1f; // no idea
- //light.ParentID = cube.Render.GetRenderObjectID();
- //this.UpdateIntensity();
}
-
- public static MyFlareDefinition GetFlareDefinition(string flareSubtypeId)
- {
- if (string.IsNullOrEmpty(flareSubtypeId))
- throw new ArgumentException("flareSubtypeId must not be null or empty!");
- var flareDefId = new MyDefinitionId(typeof(MyObjectBuilder_FlareDefinition), flareSubtypeId);
- var flareDef = MyDefinitionManager.Static.GetDefinition(flareDefId) as MyFlareDefinition;
-
- if (flareDef == null)
- throw new Exception($"Couldn't find flare subtype {flareSubtypeId}");
-
- return flareDef;
- }
-
- private readonly MyFlareDefinition _flare = new MyFlareDefinition() ;
- private float GlareQuerySizeDef => Comp.Cube.CubeGrid.GridScale * (true ? 0.5f : 0.1f);
-
- /*
- private void UpdateIntensity()
- {
- float num1 = this.m_lightingLogic.CurrentLightPower * this.m_lightingLogic.Intensity;
- foreach (MyLight light in this.m_lightingLogic.Lights)
- {
- light.ReflectorIntensity = num1 * 8f;
- light.Intensity = num1 * 0.3f;
- float num2 = num1 / this.m_lightingLogic.IntensityBounds.Max;
- float num3 = this.m_flare.Intensity * num1;
- if (num3 < (double)this.m_flare.Intensity)
- num3 = this.m_flare.Intensity;
- light.GlareIntensity = num3;
- light.GlareSize = this.m_flare.Size * (float)((double)num2 / 2.0 + 0.5);
- this.m_lightingLogic.BulbColor = this.m_lightingLogic.ComputeBulbColor();
- }
- }
- */
private void FuckMyLife()
{
var azPartMatrix = AzimuthPart.Entity.PositionComp.LocalMatrixRef;
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponHand.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponHand.cs
index 6b835fd1..22dcc127 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponHand.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponHand.cs
@@ -1,5 +1,4 @@
-using CoreSystems.Projectiles;
-using CoreSystems.Support;
+using CoreSystems.Support;
using Sandbox.Common.ObjectBuilders;
using Sandbox.Game.Entities;
using Sandbox.Game.Entities.Character.Components;
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponReload.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponReload.cs
index f6daf7f2..d4e45f06 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponReload.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponReload.cs
@@ -1,5 +1,6 @@
using System;
using CoreSystems.Support;
+using VRage.Game.Entity;
using VRage.Utils;
using static CoreSystems.Support.CoreComponent;
using static CoreSystems.Support.WeaponDefinition.AnimationDef.PartAnimationSetDef;
@@ -255,35 +256,31 @@ internal bool ServerReload()
++ClientStartId;
++Reload.LifetimeLoads;
- if (!ActiveAmmoDef.AmmoDef.Const.EnergyAmmo) {
-
+ if (!ActiveAmmoDef.AmmoDef.Const.EnergyAmmo)
+ {
var isPhantom = Comp.TypeSpecific == CompTypeSpecific.Phantom;
Reload.MagsLoaded = ActiveAmmoDef.AmmoDef.Const.MagsToLoad <= Reload.CurrentMags || Session.I.IsCreative ? ActiveAmmoDef.AmmoDef.Const.MagsToLoad : Reload.CurrentMags;
-
- if (!Session.I.IsCreative)
+
+ if (!Session.I.IsCreative && !isPhantom)
{
- if (!isPhantom && Comp.CoreInventory.ItemsCanBeRemoved(Reload.MagsLoaded, ActiveAmmoDef.AmmoDef.Const.AmmoItem))
+ if (Comp.CoreInventory.ItemsCanBeRemoved(Reload.MagsLoaded, ActiveAmmoDef.AmmoDef.Const.AmmoItem))
{
- if (System.HasAmmoSelection) {
- var magItem = Comp.CoreInventory.FindItem(ActiveAmmoDef.AmmoDefinitionId) ?? ActiveAmmoDef.AmmoDef.Const.AmmoItem;
- Comp.CoreInventory.RemoveItems(magItem.ItemId, Reload.MagsLoaded);
- }
+ MyPhysicalInventoryItem magItem;
+ if (System.HasAmmoSelection)
+ magItem = Comp.CoreInventory.FindItem(ActiveAmmoDef.AmmoDefinitionId) ?? ActiveAmmoDef.AmmoDef.Const.AmmoItem;
else
- {
- var magItem = Comp.TypeSpecific == CompTypeSpecific.Rifle ? Comp.CoreInventory.FindItem(ActiveAmmoDef.AmmoDefinitionId) ?? ActiveAmmoDef.AmmoDef.Const.AmmoItem : ActiveAmmoDef.AmmoDef.Const.AmmoItem;
- Comp.CoreInventory.RemoveItems(magItem.ItemId, Reload.MagsLoaded);
- }
+ magItem = Comp.TypeSpecific == CompTypeSpecific.Rifle ? Comp.CoreInventory.FindItem(ActiveAmmoDef.AmmoDefinitionId) ?? ActiveAmmoDef.AmmoDef.Const.AmmoItem : ActiveAmmoDef.AmmoDef.Const.AmmoItem;
+ Comp.CoreInventory.RemoveItems(magItem.ItemId, Reload.MagsLoaded);
}
- else if (!isPhantom && Comp.CoreInventory.ItemCount > 0 && Comp.CoreInventory.ContainItems(Reload.MagsLoaded, ActiveAmmoDef.AmmoDef.Const.AmmoItem.Content))
- {
+ else if (Comp.CoreInventory.ItemCount > 0 && Comp.CoreInventory.ContainItems(Reload.MagsLoaded, ActiveAmmoDef.AmmoDef.Const.AmmoItem.Content))
Comp.CoreInventory.Remove(ActiveAmmoDef.AmmoDef.Const.AmmoItem, Reload.MagsLoaded);
- }
}
-
Reload.CurrentMags = !isPhantom ? Comp.CoreInventory.GetItemAmount(ActiveAmmoDef.AmmoDefinitionId).ToIntSafe() : Reload.CurrentMags - Reload.MagsLoaded;
if (Reload.CurrentMags == 0)
CheckInventorySystem = true;
}
+ else
+ Reload.MagsLoaded = ActiveAmmoDef.AmmoDef.Const.MagsToLoad;
StartReload();
return true;
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponShoot.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponShoot.cs
index f3acec35..f89020c1 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponShoot.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponShoot.cs
@@ -360,7 +360,7 @@ private void GiveUpTarget()
private void OverHeat()
{
- if (!Session.I.IsClient && Comp.Data.Repo.Values.Set.Overload > 1)
+ if (Session.I.IsServer && Comp.Data.Repo.Values.Set.Overload > 1)
{
var dmg = .02f * Comp.MaxIntegrity;
Comp.Slim.DoDamage(dmg, MyDamageType.Environment, true, null, Comp.TopEntity.EntityId);
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponState.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponState.cs
index b8263607..d3e884b0 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponState.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponState.cs
@@ -1,5 +1,4 @@
using System;
-using CoreSystems.Projectiles;
using System.Collections.Generic;
using CoreSystems.Support;
using Sandbox.Game.Entities;
@@ -53,7 +52,7 @@ internal bool ValidFakeTargetInfo(long playerId, out Ai.FakeTarget.FakeWorldTarg
if (Session.I.PlayerDummyTargets.TryGetValue(playerId, out fakeTargets))
{
var validManual = Comp.Data.Repo.Values.Set.Overrides.Control == ProtoWeaponOverrides.ControlModes.Manual && Comp.Data.Repo.Values.State.TrackingReticle && fakeTargets.ManualTarget.FakeInfo.WorldPosition != Vector3D.Zero;
- var validPainter = Comp.Data.Repo.Values.Set.Overrides.Control == ProtoWeaponOverrides.ControlModes.Painter && fakeTargets.PaintedTarget.LocalPosition != Vector3D.Zero;
+ var validPainter = !Session.I.Settings.Enforcement.ProhibitHUDPainter && Comp.Data.Repo.Values.Set.Overrides.Control == ProtoWeaponOverrides.ControlModes.Painter && fakeTargets.PaintedTarget.LocalPosition != Vector3D.Zero;
var fakeTarget = validPainter && preferPainted ? fakeTargets.PaintedTarget : validManual ? fakeTargets.ManualTarget : null;
if (fakeTarget == null)
{
@@ -461,15 +460,7 @@ internal Vector3D PbRandomizePredictedPosition(Vector3D predictedPos)
return predictedPos + _cachedPredictedOffset;
}
- internal enum FriendlyNames
- {
- Normal,
- NoAmmo,
- NoSubSystems,
- NoTarget,
- }
-
- internal string UpdateAndGetFriendlyName(FriendlyNames type)
+ internal void UpdateAndGetFriendlyName()
{
string weaponName;
@@ -482,28 +473,12 @@ internal string UpdateAndGetFriendlyName(FriendlyNames type)
update = !weaponName.Equals(FriendlyName);
}
else
- {
weaponName = System.ShortName;
- }
if (update)
{
- FriendlyName = weaponName;
- FriendlyNameNoTarget = weaponName + Hud.NoTargetStr;
- FriendlyNameNoAmmo = weaponName + Hud.NoAmmoStr;
- FriendlyNameNoSubsystem = weaponName + Hud.NoSubSystemStr;
- }
-
- switch (type)
- {
- case FriendlyNames.NoAmmo:
- return FriendlyNameNoAmmo;
- case FriendlyNames.NoTarget:
- return FriendlyNameNoTarget;
- case FriendlyNames.NoSubSystems:
- return FriendlyNameNoSubsystem;
- default:
- return FriendlyName;
+ var nameLen = weaponName.Length;
+ FriendlyName = nameLen > 30 ? weaponName.Remove(30, nameLen - 30) : weaponName;
}
}
}
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponTracking.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponTracking.cs
index de611a88..590f9580 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponTracking.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponTracking.cs
@@ -14,7 +14,6 @@
using static CoreSystems.Support.WeaponDefinition.AnimationDef.PartAnimationSetDef;
using CollisionLayers = Sandbox.Engine.Physics.MyPhysics.CollisionLayers;
using static CoreSystems.Support.MathFuncs;
-using VRage.Game.ObjectBuilders.Components;
namespace CoreSystems.Platform
{
@@ -128,20 +127,9 @@ internal static void LeadTarget(Weapon weapon, MyEntity target, out Vector3D tar
obb.Center = targetPos;
weapon.TargetBox = obb;
-
- //var obbAbsMax = obb.HalfExtent.AbsMax();
- //var maxRangeSqr = obbAbsMax + weapon.MaxTargetDistance;
- //var minRangeSqr = obbAbsMax + weapon.MinTargetDistance;
-
- //maxRangeSqr *= maxRangeSqr;
- //minRangeSqr *= minRangeSqr;
- //double rangeToTarget;
- //Vector3D.DistanceSquared(ref targetPos, ref weapon.MyPivotPos, out rangeToTarget);
- //couldHit = validEstimate && rangeToTarget <= maxRangeSqr && rangeToTarget >= minRangeSqr;
couldHit = validEstimate;
bool canTrack = false;
- //if (validEstimate && rangeToTarget <= maxRangeSqr && rangeToTarget >= minRangeSqr)
if (validEstimate)
{
var targetDir = targetPos - weapon.MyPivotPos;
@@ -171,6 +159,7 @@ internal static void LeadTarget(Weapon weapon, MyEntity target, out Vector3D tar
canTrack = IsDotProductWithinTolerance(ref weapon.MyPivotFwd, ref targetDir, weapon.AimingTolerance);
}
willHit = canTrack;
+ weapon.Target.ValidEstimate = willHit;
}
internal static bool CanShootTargetObb(Weapon weapon, MyEntity entity, Vector3D targetLinVel, Vector3D targetAccel, out Vector3D targetPos)
@@ -368,6 +357,7 @@ internal static bool TrackingTarget(Weapon w, Target target, out bool targetLock
if (Vector3D.IsZero(targetAccel, 5E-03)) targetAccel = Vector3.Zero;
targetPos = TrajectoryEstimation(w, targetCenter, targetLinVel, targetAccel, w.MyPivotPos, out validEstimate, false, baseData.Set.Overrides.AngularTracking);
+ w.Target.ValidEstimate = validEstimate;
}
else
targetPos = targetCenter;
@@ -448,7 +438,7 @@ internal static bool TrackingTarget(Weapon w, Target target, out bool targetLock
if (baseData.State.Control == ProtoWeaponState.ControlMode.Camera || w.Comp.FakeMode || session.IsServer && baseData.Set.Overrides.Repel && ai.DetectionInfo.DroneInRange && target.IsDrone && (session.AwakeCount == w.Acquire.SlotId || ai.Construct.RootAi.Construct.LastDroneTick == session.Tick) && Ai.SwitchToDrone(w))
return true;
- var rayCheckTest = isTracking && (isAligned || locked) && baseData.State.Control != ProtoWeaponState.ControlMode.Camera && (w.ActiveAmmoDef.AmmoDef.Trajectory.Guidance != TrajectoryDef.GuidanceType.Smart && w.ActiveAmmoDef.AmmoDef.Trajectory.Guidance != TrajectoryDef.GuidanceType.DroneAdvanced) && !w.System.DisableLosCheck && (!w.Casting && session.Tick - w.Comp.LastRayCastTick > 29 || w.System.Values.HardPoint.Other.MuzzleCheck && session.Tick - w.LastMuzzleCheck > 29);
+ var rayCheckTest = isTracking && (isAligned || locked) && baseData.State.Control != ProtoWeaponState.ControlMode.Camera && (w.ActiveAmmoDef.AmmoDef.Trajectory.Guidance != TrajectoryDef.GuidanceType.Smart && w.ActiveAmmoDef.AmmoDef.Trajectory.Guidance != TrajectoryDef.GuidanceType.DroneAdvanced) && !w.System.DisableLosCheck && (session.Tick - w.Comp.LastRayCastTick > 29 || w.System.Values.HardPoint.Other.MuzzleCheck && session.Tick - w.LastMuzzleCheck > 29);
var trackingTimeLimit = w.System.MaxTrackingTime && session.Tick - w.Target.ChangeTick > w.System.MaxTrackingTicks;
if (session.IsServer && (rayCheckTest && !w.RayCheckTest(rangeToTargetSqr) || trackingTimeLimit))
@@ -608,269 +598,6 @@ internal void SmartLosDebug()
DsDebugDraw.DrawLine(line, hit ? Color.Red : Color.Blue, 0.05f);
}
}
-
- internal static Vector3D TrajectoryEstimationOld(Weapon weapon, Vector3D targetPos, Vector3D targetVel, Vector3D targetAcc, Vector3D shooterPos, bool trackAngular, out bool valid, bool overrideMode = false, bool setAdvOverride = false, bool skipAccel = false)
- {
- valid = true;
- var comp = weapon.Comp;
- var ai = comp.Ai;
- var session = Session.I;
- var ammoDef = weapon.ActiveAmmoDef.AmmoDef;
- var origTargetPos = targetPos; //Need these original values for debug draws later
- var origTargetVel = targetVel;
-
- if (ai.VelocityUpdateTick != session.Tick)
- {
- ai.TopEntityVolume.Center = comp.TopEntity.PositionComp.WorldVolume.Center;
- ai.TopEntityVel = comp.TopEntity.Physics?.LinearVelocity ?? Vector3D.Zero;
- ai.IsStatic = comp.TopEntity.Physics?.IsStatic ?? false;
- ai.VelocityUpdateTick = session.Tick;
- }
-
- var updateGravity = ammoDef.Const.FeelsGravity && ai.InPlanetGravity;
-
- if (updateGravity && session.Tick - weapon.GravityTick > 119)
- {
- weapon.GravityTick = session.Tick;
- float interference;
- weapon.GravityPoint = session.Physics.CalculateNaturalGravityAt(weapon.MyPivotPos, out interference);
- weapon.GravityUnitDir = weapon.GravityPoint;
- weapon.GravityLength = weapon.GravityUnitDir.Normalize();
- }
- else if (!updateGravity)
- weapon.GravityPoint = Vector3D.Zero;
-
- var gravityMultiplier = ammoDef.Const.FeelsGravity && !MyUtils.IsZero(weapon.GravityPoint) ? ammoDef.Const.GravityMultiplier : 0f;
- bool hasGravity = gravityMultiplier > 1e-6 && !MyUtils.IsZero(weapon.GravityPoint);
-
- var targetMaxSpeed = Session.I.MaxEntitySpeed;
- shooterPos = MyUtils.IsZero(shooterPos) ? weapon.MyPivotPos : shooterPos;
-
- var shooterVel = (Vector3D)weapon.Comp.Ai.TopEntityVel;
- var projectileMaxSpeed = ammoDef.Const.DesiredProjectileSpeed;
- var projectileInitSpeed = ammoDef.Trajectory.AccelPerSec * MyEngineConstants.UPDATE_STEP_SIZE_IN_SECONDS;
- var projectileAccMag = ammoDef.Trajectory.AccelPerSec;
- var basic = weapon.System.Prediction != Prediction.Advanced && !overrideMode || overrideMode && !setAdvOverride;
-
- if (basic && weapon.System.Prediction == Prediction.Accurate && hasGravity && ai.InPlanetGravity)
- {
- basic = false;
- skipAccel = true;
- }
-
- Vector3D deltaPos = targetPos - shooterPos;
- Vector3D deltaVel = targetVel - shooterVel;
- Vector3D deltaPosNorm;
- double deltaLength = 0;
- if (Vector3D.IsZero(deltaPos))
- {
- deltaPosNorm = Vector3D.Zero;
- }
- else if (Vector3D.IsUnit(ref deltaPos))
- {
- deltaPosNorm = deltaPos;
- deltaLength = 1;
- }
- else
- {
- deltaPosNorm = deltaPos;
- deltaLength = deltaPosNorm.Normalize();
- }
-
- double closingSpeed;
- Vector3D.Dot(ref deltaVel, ref deltaPosNorm, out closingSpeed);
-
- Vector3D closingVel = closingSpeed * deltaPosNorm;
- Vector3D lateralVel = deltaVel - closingVel;
- double projectileMaxSpeedSqr = projectileMaxSpeed * projectileMaxSpeed;
- double ttiDiff = projectileMaxSpeedSqr - lateralVel.LengthSquared();
-
- if (ttiDiff < 0)
- {
- valid = false;
- return targetPos;
- }
-
- double projectileClosingSpeed = Math.Sqrt(ttiDiff) - closingSpeed;
-
- double closingDistance;
- Vector3D.Dot(ref deltaPos, ref deltaPosNorm, out closingDistance);
-
- double timeToIntercept = ttiDiff < 0 ? 0 : closingDistance / projectileClosingSpeed;
-
- if (timeToIntercept < 0)
- {
- valid = false;
- return targetPos;
- }
-
- double maxSpeedSqr = targetMaxSpeed * targetMaxSpeed;
- double shooterVelScaleFactor = 1;
- bool projectileAccelerates = projectileAccMag > 1e-6;
-
- if (!basic && projectileAccelerates)
- shooterVelScaleFactor = Math.Min(1, (projectileMaxSpeed - projectileInitSpeed) / projectileAccMag);
-
- Vector3D estimatedImpactPoint = targetPos + timeToIntercept * (targetVel - shooterVel * shooterVelScaleFactor);
-
- if (basic)
- return estimatedImpactPoint;
-
- Vector3D aimDirection = estimatedImpactPoint - shooterPos;
-
- Vector3D projectileVel = shooterVel;
- Vector3D projectilePos = shooterPos;
-
- Vector3D aimDirectionNorm;
- if (projectileAccelerates)
- {
-
- if (Vector3D.IsZero(deltaPos)) aimDirectionNorm = Vector3D.Zero;
- else if (Vector3D.IsUnit(ref deltaPos)) aimDirectionNorm = aimDirection;
- else aimDirectionNorm = Vector3D.Normalize(aimDirection);
- projectileVel += aimDirectionNorm * projectileInitSpeed;
- }
- else
- {
-
- if (targetAcc.LengthSquared() < 1 && !hasGravity)
- return estimatedImpactPoint;
-
- if (Vector3D.IsZero(deltaPos)) aimDirectionNorm = Vector3D.Zero;
- else if (Vector3D.IsUnit(ref deltaPos)) aimDirectionNorm = aimDirection;
- else Vector3D.Normalize(ref aimDirection, out aimDirectionNorm);
- projectileVel += aimDirectionNorm * projectileMaxSpeed;
- }
-
- var deepSim = projectileAccelerates || hasGravity;
- var count = deepSim ? 320 : 60;
-
- double dt = Math.Max(MyEngineConstants.UPDATE_STEP_SIZE_IN_SECONDS, timeToIntercept / count); // This can be a const somewhere
- double dtSqr = dt * dt;
- Vector3D targetAccStep = targetAcc * dt;
- Vector3D projectileAccStep = aimDirectionNorm * projectileAccMag * dt;
-
- Vector3D aimOffset = Vector3D.Zero;
-
- //BD Todo: Clamp this for projectiles OR targets that don't accelerate
- if (!skipAccel && (projectileAccelerates || targetVel.LengthSquared() >= 0.01))
- {
- for (int i = 0; i < count; ++i)
- {
-
- targetVel += targetAccStep;
-
- if (targetVel.LengthSquared() > maxSpeedSqr)
- {
- Vector3D targetNormVel;
- Vector3D.Normalize(ref targetVel, out targetNormVel);
- targetVel = targetNormVel * targetMaxSpeed;
- }
-
- targetPos += targetVel * dt;
- if (projectileAccelerates)
- {
-
- projectileVel += projectileAccStep;
- if (projectileVel.LengthSquared() > projectileMaxSpeedSqr)
- {
- Vector3D pNormVel;
- Vector3D.Normalize(ref projectileVel, out pNormVel);
- projectileVel = pNormVel * projectileMaxSpeed;
- }
- }
-
- projectilePos += projectileVel * dt;
- Vector3D diff = (targetPos - projectilePos);
- double diffLenSq = diff.LengthSquared();
- aimOffset = diff;
- if (diffLenSq < projectileMaxSpeedSqr * dtSqr || Vector3D.Dot(diff, aimDirectionNorm) < 0)
- break;
- }
- }
-
- Vector3D perpendicularAimOffset = !skipAccel ? aimOffset - Vector3D.Dot(aimOffset, aimDirectionNorm) * aimDirectionNorm : Vector3D.Zero;
-
- Vector3D gravityOffset = Vector3D.Zero;
- //gravity nonsense for differing elevations
- if (hasGravity && ai.InPlanetGravity)
- {
- var targetAngle = Math.Acos(Vector3D.Dot(weapon.GravityPoint, deltaPos) / (weapon.GravityLength * deltaLength));
- double elevationDifference;
- if (targetAngle >= 1.5708) //Target is above weapon
- {
- targetAngle -= 1.5708; //angle-90
- elevationDifference = -Math.Sin(targetAngle) * deltaLength;
- }
- else //Target is below weapon
- {
- targetAngle = 1.5708 - targetAngle; //90-angle
- elevationDifference = -Math.Sin(targetAngle) * deltaLength;
- }
- var horizontalDistance = Math.Sqrt(deltaLength * deltaLength - elevationDifference * elevationDifference);
-
- //Minimized for my sanity
- var g = -(weapon.GravityLength * gravityMultiplier);
- var v = projectileMaxSpeed;
- var h = elevationDifference;
- var d = horizontalDistance;
-
- var angleCheck = (v * v * v * v) - 2 * (v * v) * -h * g - (g * g) * (d * d);
-
- if (angleCheck <= 0)
- {
- valid = false;
- return estimatedImpactPoint + perpendicularAimOffset + gravityOffset;
-
- }
-
- //lord help me
- var angleSqrt = Math.Sqrt(angleCheck);
- var angle1 = -Math.Atan((v * v + angleSqrt) / (g * d));//Higher angle
- var angle2 = -Math.Atan((v * v - angleSqrt) / (g * d));//Lower angle //Try angle 2 first (the lower one)
-
- var verticalDistance = Math.Tan(angle2) * horizontalDistance; //without below-the-horizon modifier
- gravityOffset = new Vector3D((verticalDistance + Math.Abs(elevationDifference)) * -weapon.GravityUnitDir);
- if (angle1 > 1.57)
- {
- return estimatedImpactPoint + perpendicularAimOffset + gravityOffset;
- }
-
- var targetAimPoint = estimatedImpactPoint + perpendicularAimOffset + gravityOffset;
- var targetDirection = targetAimPoint - shooterPos;
-
- bool isTracking;
- if (!weapon.RotorTurretTracking && weapon.TurretController && !WeaponLookAt(weapon, ref targetDirection, deltaLength * deltaLength, false, true, DebugCaller.TrajectoryEstimation, out isTracking)) //Angle 2 obscured, switch to angle 1
- {
- verticalDistance = Math.Tan(angle1) * horizontalDistance;
- gravityOffset = new Vector3D((verticalDistance + Math.Abs(elevationDifference)) * -weapon.GravityUnitDir);
- }
- else if (weapon.RotorTurretTracking && weapon.Comp.Ai.ControlComp != null && !RotorTurretLookAt(weapon.Comp.Ai.ControlComp.Platform.Control, ref targetDirection, deltaLength * deltaLength))
- {
- verticalDistance = Math.Tan(angle1) * horizontalDistance;
- gravityOffset = new Vector3D((verticalDistance + Math.Abs(elevationDifference)) * -weapon.GravityUnitDir);
- }
- }
-
- if (false)
- {
- //OldAdvanced
- DsDebugDraw.DrawLine(new LineD(origTargetPos, estimatedImpactPoint + perpendicularAimOffset + gravityOffset), Color.Yellow, 2f);
-
- //OldBasic
- Vector3D estimatedImpactPointbasicOld = origTargetPos + (ttiDiff < 0 ? 0 : closingDistance / projectileClosingSpeed) * (origTargetVel - shooterVel);
- DsDebugDraw.DrawLine(new LineD(origTargetPos, estimatedImpactPointbasicOld), Color.Green, 2f);
-
- //New algo
- var tempCoord = TrajectoryEstimation(weapon, origTargetPos, origTargetVel, targetAcc, shooterPos, out valid, false, trackAngular);
- DsDebugDraw.DrawLine(new LineD(origTargetPos, tempCoord), Color.Red, 2);
- return tempCoord;
- }
- MyAPIGateway.Utilities.ShowNotification($"Old Mode: {(basic ? " basic" : " advanced")} {(updateGravity ? " w/ grav" : " no grav")} {(skipAccel ? "" : " w/ proj accel")} ", 16);
-
- return estimatedImpactPoint + perpendicularAimOffset + gravityOffset;
- }
-
public static bool QuarticSolver(ref double timeToIntercept, Vector3D relativePosition, Vector3D relativeVelocity, Vector3D acceleration, double projectileSpeed, double[] coefficients, double tolerance = 1e-3, int maxIterations = 10)
{
var oneOverSpeedSq = projectileSpeed > 0 ? 1.0 / (projectileSpeed * projectileSpeed) : 0;
@@ -1056,10 +783,6 @@ internal static Vector3D TrajectoryEstimation(Weapon weapon, Vector3D targetPos,
}
}
}
-
- //DsDebugDraw.DrawLine(new LineD(targetPos, aimPoint + gravityOffset), Color.Red, 1);
- //MyAPIGateway.Utilities.ShowNotification($"New Mode: {(useSimple ? "Simple" : "Advanced")} {(updateGravity ? " w/ grav" : " no grav")} {(ammoDef.Const.AmmoSkipAccel ? " no proj accel" : "w/ proj accel")}",16);
-
return aimPoint + gravityOffset;
}
@@ -1125,7 +848,6 @@ private static bool ComputeAngular(MyCubeGrid grid, Ai ai, WeaponDefinition.Ammo
public void ManualShootRayCallBack(IHitInfo hitInfo)
{
- Casting = false;
var masterWeapon = System.TrackTargets ? this : Comp.PrimaryWeapon;
var grid = hitInfo.HitEntity as MyCubeGrid;
@@ -1244,8 +966,9 @@ private bool RayCheckTest(double rangeToTargetSqr)
if (Target.TargetState == Target.TargetStates.IsFake)
{
- Casting = true;
- Session.I.Physics.CastRayParallel(ref trackingCheckPosition, ref Target.TargetPos, filter, ManualShootRayCallBack);
+ IHitInfo fakeHitInfo;
+ Session.I.Physics.CastRay(trackingCheckPosition, Target.TargetPos, out fakeHitInfo, filter);
+ ManualShootRayCallBack(fakeHitInfo);
return true;
}
@@ -1301,14 +1024,14 @@ private bool RayCheckTest(double rangeToTargetSqr)
var targetPos = pTarget?.Position ?? eTarget?.PositionComp.WorldAABB.Center ?? Vector3D.Zero;
var distToTargetSqr = Vector3D.DistanceSquared(targetPos, trackingCheckPosition);
- if (distToTargetSqr > MaxTargetDistanceSqr && distToTargetSqr < MinTargetDistanceSqr)
+ if (distToTargetSqr > MaxTargetDistanceSqr || distToTargetSqr < MinTargetDistanceSqr) //TODO this was &&, will that ever trip for a wep with min and max range?
{
masterWeapon.Target.Reset(Session.I.Tick, Target.States.RayCheckDistExceeded);
if (masterWeapon != this) Target.Reset(Session.I.Tick, Target.States.RayCheckDistExceeded);
return false;
}
WaterData water = null;
- if (Session.I.WaterApiLoaded && !ActiveAmmoDef.AmmoDef.IgnoreWater && Comp.Ai.InPlanetGravity && Comp.Ai.MyPlanet != null && Session.I.WaterMap.TryGetValue(Comp.Ai.MyPlanet.EntityId, out water))
+ if (Session.I.WaterApiLoaded && !(ActiveAmmoDef.AmmoDef.IgnoreWater || Comp.TargetSubmerged) && Comp.Ai.InPlanetGravity && Comp.Ai.MyPlanet != null && Session.I.WaterMap.TryGetValue(Comp.Ai.MyPlanet.EntityId, out water))
{
var waterSphere = new BoundingSphereD(Comp.Ai.MyPlanet.PositionComp.WorldAABB.Center, water.MinRadius);
if (waterSphere.Contains(targetPos) != ContainmentType.Disjoint)
@@ -1318,8 +1041,11 @@ private bool RayCheckTest(double rangeToTargetSqr)
return false;
}
}
- Casting = true;
- Session.I.Physics.CastRayParallel(ref trackingCheckPosition, ref targetPos, filter, RayCallBack.NormalShootRayCallBack);
+ IHitInfo rayHitInfo;
+ Session.I.Physics.CastRay(trackingCheckPosition, targetPos, out rayHitInfo);
+
+ RayCallBack.NormalShootRayCallBack(rayHitInfo);
+
return true;
}
diff --git a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponTypes.cs b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponTypes.cs
index 4e1c91f3..261ea475 100644
--- a/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponTypes.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/Parts/Weapon/WeaponTypes.cs
@@ -1,6 +1,4 @@
-using System;
-using System.Collections.Generic;
-using CoreSystems.Projectiles;
+using CoreSystems.Projectiles;
using CoreSystems.Support;
using Sandbox.Game.Entities;
using VRage.Game.Entity;
@@ -26,17 +24,14 @@ public void NormalShootRayCallBack(IHitInfo hitInfo)
var eTarget = Weapon.Target.TargetObject as MyEntity;
if (pTarget == null && eTarget == null)
return;
-
- Weapon.Casting = false;
Weapon.PauseShoot = false;
var masterWeapon = Weapon.System.TrackTargets ? Weapon : Weapon.Comp.PrimaryWeapon;
- var ignoreTargets = Weapon.Target.TargetState == Target.TargetStates.IsProjectile || Weapon.Target.TargetObject is IMyCharacter;
+ var ignoreTargets = Weapon.Target.TargetState == Target.TargetStates.IsProjectile || (eTarget != null && Weapon.Target.TargetObject is IMyCharacter);
var scope = Weapon.GetScope;
var trackingCheckPosition = scope.CachedPos;
double rayDist = 0;
-
- if (Session.I.DebugLos)
+ if (Session.I.DebugLos && hitInfo != null)
{
var hitPos = hitInfo.Position;
if (rayDist <= 0) Vector3D.Distance(ref trackingCheckPosition, ref hitPos, out rayDist);
@@ -44,16 +39,15 @@ public void NormalShootRayCallBack(IHitInfo hitInfo)
Session.I.AddLosCheck(new Session.LosDebug { Part = Weapon, HitTick = Session.I.Tick, Line = new LineD(trackingCheckPosition, hitPos) });
}
-
if (Weapon.Comp.Ai.ShieldNear)
{
-
- var targetPos = pTarget?.Position ?? eTarget.PositionComp.WorldMatrixRef.Translation;
+ var targetPos = pTarget?.Position ?? eTarget.PositionComp.WorldVolume.Center;
var targetDir = targetPos - trackingCheckPosition;
if (Weapon.HitFriendlyShield(trackingCheckPosition, targetPos, targetDir))
{
masterWeapon.Target.Reset(Session.I.Tick, Target.States.RayCheckFriendly);
if (masterWeapon != Weapon) Weapon.Target.Reset(Session.I.Tick, Target.States.RayCheckFriendly);
+ Weapon.PauseShoot = true;
return;
}
}
@@ -61,11 +55,17 @@ public void NormalShootRayCallBack(IHitInfo hitInfo)
var hitTopEnt = (MyEntity)hitInfo?.HitEntity?.GetTopMostParent();
if (hitTopEnt == null)
{
- if (ignoreTargets)
+ if (Weapon.System.TargetGridCenter && eTarget != null)
+ hitTopEnt = eTarget;
+ else
+ {
+ if (ignoreTargets)
+ return;
+ masterWeapon.Target.Reset(Session.I.Tick, Target.States.RayCheckMiss);
+ if (masterWeapon != Weapon) Weapon.Target.Reset(Session.I.Tick, Target.States.RayCheckMiss);
+ Weapon.PauseShoot = true;
return;
- masterWeapon.Target.Reset(Session.I.Tick, Target.States.RayCheckMiss);
- if (masterWeapon != Weapon) Weapon.Target.Reset(Session.I.Tick, Target.States.RayCheckMiss);
- return;
+ }
}
var targetTopEnt = eTarget?.GetTopMostParent();
@@ -77,10 +77,12 @@ public void NormalShootRayCallBack(IHitInfo hitInfo)
if (unexpectedHit)
{
+
if (hitTopEnt is MyVoxelBase && !Weapon.System.ScanNonThreats)
{
masterWeapon.Target.Reset(Session.I.Tick, Target.States.RayCheckVoxel);
if (masterWeapon != Weapon) Weapon.Target.Reset(Session.I.Tick, Target.States.RayCheckVoxel);
+ Weapon.PauseShoot = true;
return;
}
@@ -97,9 +99,11 @@ public void NormalShootRayCallBack(IHitInfo hitInfo)
{
masterWeapon.Target.Reset(Session.I.Tick, Target.States.RayCheckFriendly);
if (masterWeapon != Weapon) Weapon.Target.Reset(Session.I.Tick, Target.States.RayCheckFriendly);
+ Weapon.PauseShoot = true;
return;
}
return;
+
}
if (Weapon.System.ClosestFirst && topAsGrid != null && topAsGrid == targetTopEnt)
{
@@ -108,11 +112,9 @@ public void NormalShootRayCallBack(IHitInfo hitInfo)
var maxChange = halfExtMin > minSize ? halfExtMin : minSize;
var targetPos = eTarget.PositionComp.WorldAABB.Center;
var weaponPos = trackingCheckPosition;
-
if (rayDist <= 0) Vector3D.Distance(ref weaponPos, ref targetPos, out rayDist);
- var newHitShortDist = rayDist * (1 - hitInfo.Fraction);
- var distanceToTarget = rayDist * hitInfo.Fraction;
-
+ var newHitShortDist = hitInfo == null ? rayDist : rayDist * (1 - hitInfo.Fraction);
+ var distanceToTarget = hitInfo == null ? rayDist : rayDist * hitInfo.Fraction;
var shortDistExceed = newHitShortDist - Weapon.Target.HitShortDist > maxChange;
var escapeDistExceed = distanceToTarget - Weapon.Target.OrigDistance > Weapon.Target.OrigDistance;
if (shortDistExceed || escapeDistExceed)
@@ -121,6 +123,7 @@ public void NormalShootRayCallBack(IHitInfo hitInfo)
if (masterWeapon != Weapon) Weapon.Target.Reset(Session.I.Tick, Target.States.RayCheckDistOffset);
}
}
+
}
}
diff --git a/Data/Scripts/CoreSystems/EntityComp/PlatformInit.cs b/Data/Scripts/CoreSystems/EntityComp/PlatformInit.cs
index b04cfa49..65363621 100644
--- a/Data/Scripts/CoreSystems/EntityComp/PlatformInit.cs
+++ b/Data/Scripts/CoreSystems/EntityComp/PlatformInit.cs
@@ -8,7 +8,6 @@
using static CoreSystems.Support.CoreComponent.Start;
using static CoreSystems.Support.CoreComponent.CompTypeSpecific;
using static CoreSystems.Support.WeaponDefinition.AnimationDef.PartAnimationSetDef;
-using Sandbox.Game.World;
namespace CoreSystems.Platform
{
@@ -717,13 +716,14 @@ internal void SetupWeaponUi(Weapon w)
w.Comp.HasDelayToFire = w.Comp.HasDelayToFire || w.System.DelayToFire > 0;
w.Comp.ShootSubmerged = w.Comp.ShootSubmerged || w.System.Values.HardPoint.CanShootSubmerged;
+ w.Comp.TargetSubmerged = w.Comp.TargetSubmerged || w.System.Values.HardPoint.CanTargetSubmerged;
w.Comp.HasDisabledBurst = w.Comp.Structure.MultiParts || w.System.MaxAmmoCount <= 1;
w.BaseComp.HasServerOverrides = w.BaseComp.HasServerOverrides || w.System.WConst.HasServerOverrides;
if (w.System.MaxAmmoCount > w.Comp.MaxAmmoCount)
w.Comp.MaxAmmoCount = w.System.MaxAmmoCount;
- if (ui.EnableOverload || ui.RateOfFire || ui.ToggleGuidance) // removed ui.DamageModifier explit
+ if (ui.EnableOverload || ui.RateOfFire || ui.ToggleGuidance)
w.BaseComp.UiEnabled = true;
if (w.System.HasAmmoSelection)
diff --git a/Data/Scripts/CoreSystems/Projectiles/Dtree.cs b/Data/Scripts/CoreSystems/Projectiles/Dtree.cs
index e23edac5..d46e64f6 100644
--- a/Data/Scripts/CoreSystems/Projectiles/Dtree.cs
+++ b/Data/Scripts/CoreSystems/Projectiles/Dtree.cs
@@ -26,17 +26,6 @@ internal static void UnregisterProjectile(Projectile projectile)
s.ProjectileTree.RemoveProxy(projectile.PruningProxyId);
projectile.PruningProxyId = -1;
}
-
- internal static void OnProjectileMoved(Projectile projectile, ref Vector3D velocity)
- {
- if (projectile.PruningProxyId == -1)
- return;
- BoundingSphereD sphere = new BoundingSphereD(projectile.Position, projectile.Info.AmmoDef.Const.LargestHitSize);
- BoundingBoxD result;
- BoundingBoxD.CreateFromSphere(ref sphere, out result);
- Session.I.ProjectileTree.MoveProxy(projectile.PruningProxyId, ref result, velocity);
- }
-
internal static void GetAllProjectilesInSphere(Session session, ref BoundingSphereD sphere, List result, bool clearList = true)
{
session.ProjectileTree.OverlapAllBoundingSphere(ref sphere, result, clearList);
diff --git a/Data/Scripts/CoreSystems/Projectiles/Projectile.cs b/Data/Scripts/CoreSystems/Projectiles/Projectile.cs
index 310fa68a..32f7ef7e 100644
--- a/Data/Scripts/CoreSystems/Projectiles/Projectile.cs
+++ b/Data/Scripts/CoreSystems/Projectiles/Projectile.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Diagnostics;
using CoreSystems.Support;
using Jakaria.API;
using Sandbox.Game.Entities;
@@ -304,11 +303,26 @@ internal void Start()
Info.AvShot = session.Av.AvShotPool.Count > 0 ? session.Av.AvShotPool.Pop() : new AvShot(session);
Info.AvShot.Init(Info, (aConst.DeltaVelocityPerTick * Session.I.DeltaTimeRatio), MaxSpeed, ref Direction);
Info.AvShot.SetupSounds(distanceFromCameraSqr); //Pool initted sounds per Projectile type... this is expensive
- if (aConst.HitParticle && !aConst.IsBeamWeapon || aConst.EndOfLifeAoe && !ammoDef.AreaOfDamage.EndOfLife.NoVisuals)
+ if (aConst.HitParticle || aConst.EndOfLifeAoe && !ammoDef.AreaOfDamage.EndOfLife.NoVisuals)
{
var hitPlayChance = Info.AmmoDef.AmmoGraphics.Particles.Hit.Extras.HitPlayChance;
Info.AvShot.HitParticleActive = hitPlayChance >= 1 || hitPlayChance >= MyUtils.GetRandomDouble(0.0f, 1f);
}
+ if (aConst.ShieldHitParticle || aConst.EndOfLifeAoe && !ammoDef.AreaOfDamage.EndOfLife.NoVisuals)
+ {
+ var hitPlayChance = Info.AmmoDef.AmmoGraphics.Particles.ShieldHit.Extras.HitPlayChance;
+ Info.AvShot.ShieldHitParticleActive = hitPlayChance >= 1 || hitPlayChance >= MyUtils.GetRandomDouble(0.0f, 1f);
+ }
+ if (aConst.VoxelHitParticle || aConst.EndOfLifeAoe && !ammoDef.AreaOfDamage.EndOfLife.NoVisuals)
+ {
+ var hitPlayChance = Info.AmmoDef.AmmoGraphics.Particles.VoxelHit.Extras.HitPlayChance;
+ Info.AvShot.VoxelHitParticleActive = hitPlayChance >= 1 || hitPlayChance >= MyUtils.GetRandomDouble(0.0f, 1f);
+ }
+ if (aConst.WaterHitParticle || aConst.EndOfLifeAoe && !ammoDef.AreaOfDamage.EndOfLife.NoVisuals)
+ {
+ var hitPlayChance = Info.AmmoDef.AmmoGraphics.Particles.WaterHit.Extras.HitPlayChance;
+ Info.AvShot.WaterHitParticleActive = hitPlayChance >= 1 || hitPlayChance >= MyUtils.GetRandomDouble(0.0f, 1f);
+ }
if (aConst.PrimeModel || aConst.TriggerModel)
{
@@ -3395,11 +3409,11 @@ internal void EwarEffects()
var nStorage = netted.Info.Storage;
var nAconst = netted.Info.AmmoDef.Const;
- if (nStorage.RequestedStage >= 0 && nStorage.RequestedStage < nAconst.ApproachesCount && nAconst.Approaches[nStorage.RequestedStage].IgnoreAntiSmart)
+ if (nAconst.IgnoreAntiSmarts || (nStorage.RequestedStage >= 0 && nStorage.RequestedStage < nAconst.ApproachesCount && nAconst.Approaches[nStorage.RequestedStage].IgnoreAntiSmart))
continue;
if (Info.Random.NextDouble() * 100f < aConst.PulseChance || !aConst.EwarField)
{
- Info.BaseEwarPool -= (float)netted.Info.AmmoDef.Const.HealthHitModifier;
+ Info.BaseEwarPool -= (float)nAconst.HealthHitModifier;
if (Info.BaseEwarPool <= 0 && Info.BaseHealthPool-- > 0)
{
Info.EwarActive = true;
@@ -3428,13 +3442,13 @@ internal void EwarEffects()
var nStorage = netted.Info.Storage;
var nAconst = netted.Info.AmmoDef.Const;
- if (nStorage.RequestedStage >= 0 && nStorage.RequestedStage < nAconst.ApproachesCount && nAconst.Approaches[nStorage.RequestedStage].IgnoreAntiSmart)
+ if (nAconst.IgnoreAntiSmarts || (nStorage.RequestedStage >= 0 && nStorage.RequestedStage < nAconst.ApproachesCount && nAconst.Approaches[nStorage.RequestedStage].IgnoreAntiSmart))
continue;
if (Info.Random.NextDouble() * 100f < aConst.PulseChance || !aConst.EwarField)
{
- if (Info.BaseEwarPool - netted.Info.AmmoDef.Const.Health >= 0)
+ if (Info.BaseEwarPool - nAconst.Health >= 0)
{
- Info.BaseEwarPool -= netted.Info.AmmoDef.Const.Health;
+ Info.BaseEwarPool -= nAconst.Health;
Info.EwarActive = true;
netted.Info.Target.TargetObject = this;
netted.Info.Target.TargetState = Target.TargetStates.IsProjectile;
diff --git a/Data/Scripts/CoreSystems/Projectiles/ProjectileGen.cs b/Data/Scripts/CoreSystems/Projectiles/ProjectileGen.cs
index 2f6f8703..6b596f7b 100644
--- a/Data/Scripts/CoreSystems/Projectiles/ProjectileGen.cs
+++ b/Data/Scripts/CoreSystems/Projectiles/ProjectileGen.cs
@@ -1,6 +1,5 @@
using CoreSystems.Support;
using Sandbox.Game.Entities;
-using System;
using VRage.Game.Entity;
using VRageMath;
using static CoreSystems.Support.NewProjectile;
diff --git a/Data/Scripts/CoreSystems/Projectiles/ProjectileHits.cs b/Data/Scripts/CoreSystems/Projectiles/ProjectileHits.cs
index 89f06d5e..bba5a838 100644
--- a/Data/Scripts/CoreSystems/Projectiles/ProjectileHits.cs
+++ b/Data/Scripts/CoreSystems/Projectiles/ProjectileHits.cs
@@ -5,7 +5,6 @@
using Sandbox.Game.Entities;
using Sandbox.ModAPI;
using VRage;
-using VRage.Game.Components;
using VRage.Game.Entity;
using VRage.Game.ModAPI;
using VRage.Game.ModAPI.Interfaces;
@@ -18,7 +17,6 @@
using Jakaria.API;
using static CoreSystems.Projectiles.Projectile;
using static CoreSystems.Support.VoxelIntersect;
-using System.Runtime.CompilerServices;
namespace CoreSystems.Projectiles
{
@@ -163,7 +161,6 @@ internal void InitialHitCheck(Projectile p, bool lineCheck)
var shrapnelSpawn = p.Info.IsFragment && p.Info.PrevRelativeAge <= -1;
if (Vector3D.Transform(!shrapnelSpawn ? info.Origin : coreEntity.PositionComp.WorldMatrixRef.Translation, shieldInfo.Value.Item3.Item1).LengthSquared() > 1)
{
-
var dist = MathFuncs.IntersectEllipsoid(shieldInfo.Value.Item3.Item1, shieldInfo.Value.Item3.Item2, new RayD(beamFrom, direction));
if (target.TargetState == Target.TargetStates.IsProjectile && Vector3D.Transform(((Projectile)target.TargetObject).Position, shieldInfo.Value.Item3.Item1).LengthSquared() <= 1)
projetileInShield = true;
@@ -177,9 +174,9 @@ internal void InitialHitCheck(Projectile p, bool lineCheck)
hitEntity.EventType = Shield;
var hitPos = beamFrom + (direction * dist.Value);
- hitEntity.HitPos = beamFrom + (direction * dist.Value);
+ hitEntity.HitPos = hitPos;
hitEntity.HitDist = dist;
-
+ hitEntity.ShieldHitAngle = MathFuncs.ShieldHitAngle(shieldInfo.Value.Item3.Item1, shieldInfo.Value.Item3.Item2, new RayD(beamFrom, direction));
var weakendShield = shieldInfo.Value.Item4.Item2 || shieldInfo.Value.Item4.Item3 < shieldInfo.Value.Item4.Item4;
if (weakendShield || shieldInfo.Value.Item2.Item2)
@@ -216,7 +213,7 @@ internal void InitialHitCheck(Projectile p, bool lineCheck)
{
//if (((MyCubeGrid)shieldInfo.Value.Item1.CubeGrid).DebugName.Contains("test"))
// Log.Line($"resist: RNG:{normalized} <= penChance:{threshold} - ammo:{info.AmmoDef.AmmoRound} - sPerc:{shieldInfo.Value.Item2.Item5} - heat:{shieldInfo.Value.Item2.Item6} - threshold:{shieldInfo.Value.Item2.Item5 / (1 + (shieldInfo.Value.Item2.Item6 * 0.01))}");
-
+
p.Info.ShieldBypassMod = 1f;
}
@@ -230,7 +227,8 @@ internal void InitialHitCheck(Projectile p, bool lineCheck)
info.ShieldBypassMod = aConst.ShieldDamageBypassMod;
}
}
- else continue;
+ else
+ continue;
}
}
else
@@ -379,15 +377,7 @@ internal void InitialHitCheck(Projectile p, bool lineCheck)
hitEntity.EventType = info.FirstWaterHitTick != tick ? Voxel : Water;
}
else if (voxelState == VoxelIntersectBranch.DeferedMissUpdate || voxelState == VoxelIntersectBranch.DeferFullCheck)
- {
FullVoxelCheck(p, voxel, voxelState, lineCheck);
- /*
- lock (DeferedVoxels)
- {
- DeferedVoxels.Add(new DeferedVoxels { Projectile = p, Branch = voxelState, Voxel = voxel, LineCheck = lineCheck});
- }
- */
- }
}
else if (ent.Physics != null && !ent.Physics.IsPhantom && !ent.IsPreview && grid != null)
{
@@ -491,6 +481,9 @@ internal void InitialHitCheck(Projectile p, bool lineCheck)
if (hitEntity != null)
{
+ if (info.ShieldBypassed && hitEntity.EventType != Shield)
+ info.ShieldBypassedHitOther = true;
+
var hitEnt = hitEntity.EventType != Shield ? ent : (MyEntity)shieldInfo.Value.Item1;
if (hitEnt != null)
{
@@ -633,133 +626,139 @@ internal void ProjectileHit(Projectile p, Projectile target, bool lineCheck, ref
internal bool GenerateHitInfo(Projectile p)
{
- try
+ var info = p.Info;
+ var count = info.HitList.Count;
+ if (count > 1)
{
- var info = p.Info;
- var count = info.HitList.Count;
- if (count > 1)
- {
- try { info.HitList.Sort((x, y) => GetEntityCompareDist(x, y, info)); } // Unable to sort because the IComparer.Compare() method returns inconsistent results
- catch (Exception ex) { Log.Line($"p.Info.HitList.Sort failed: {ex} - weapon:{info.Weapon.System.PartName} - ammo:{info.AmmoDef.AmmoRound} - hitCount:{info.HitList.Count}", null, true); }
- }
- else GetEntityCompareDist(info.HitList[0], null, info);
+ try { info.HitList.Sort((x, y) => GetEntityCompareDist(x, y, info)); } // Unable to sort because the IComparer.Compare() method returns inconsistent results
+ catch (Exception ex) { Log.Line($"p.Info.HitList.Sort failed: {ex} - weapon:{info.Weapon.System.PartName} - ammo:{info.AmmoDef.AmmoRound} - hitCount:{info.HitList.Count}", null, true); }
+ }
+ else GetEntityCompareDist(info.HitList[0], null, info);
- try
- {
- var pulseTrigger = false;
- var voxelFound = false;
- for (int i = info.HitList.Count - 1; i >= 0; i--)
- {
- var ent = info.HitList[i];
- if (ent.EventType == Voxel)
- voxelFound = true;
-
- if (!ent.Hit) {
- if (ent.PulseTrigger) pulseTrigger = true;
- info.HitList.RemoveAtFast(i);
- ent.Clean();
- }
- else break;
- }
- if (pulseTrigger)
- {
+ var pulseTrigger = false;
+ var voxelFound = false;
+ for (int i = info.HitList.Count - 1; i >= 0; i--)
+ {
+ var ent = info.HitList[i];
+ if (ent.EventType == Voxel)
+ voxelFound = true;
+
+ if (!ent.Hit) {
+ if (ent.PulseTrigger) pulseTrigger = true;
+ info.HitList.RemoveAtFast(i);
+ ent.Clean();
+ }
+ else break;
+ }
- info.ExpandingEwarField = true;
- p.DistanceToTravelSqr = info.DistanceTraveled * info.DistanceTraveled;
- p.PrevVelocity = p.Velocity;
- p.Velocity = Vector3D.Zero;
- info.ProHit.LastHit = p.Position;
- info.HitList.Clear();
- return false;
- }
+ if (pulseTrigger)
+ {
- var finalCount = info.HitList.Count;
- try
- {
- if (finalCount > 0)
- {
- var aConst = info.AmmoDef.Const;
- try
- {
- if (voxelFound && info.HitList[0].EventType != Voxel && aConst.IsBeamWeapon)
- info.VoxelCache.HitRefreshed = 0;
- }
- catch (Exception ex) { Log.Line($"Exception in HitRefreshed finalCount: {ex}", null, true); }
+ info.ExpandingEwarField = true;
+ p.DistanceToTravelSqr = info.DistanceTraveled * info.DistanceTraveled;
+ p.PrevVelocity = p.Velocity;
+ p.Velocity = Vector3D.Zero;
+ info.ProHit.LastHit = p.Position;
+ info.HitList.Clear();
+ return false;
+ }
- var checkHit = (!aConst.IsBeamWeapon || !info.ShieldBypassed || finalCount > 1);
+ var finalCount = info.HitList.Count;
- var blockingEnt = !info.ShieldBypassed || finalCount == 1 ? 0 : 1;
- var hitEntity = info.HitList[blockingEnt];
- if (hitEntity == null)
- {
- Log.Line($"null hitEntity");
- return false;
- }
+ if (finalCount > 0)
+ {
+ var aConst = info.AmmoDef.Const;
+ if (voxelFound && info.HitList[0].EventType != Voxel && aConst.IsBeamWeapon)
+ info.VoxelCache.HitRefreshed = 0;
- if (!checkHit)
- hitEntity.HitPos = p.Beam.To;
+ var checkHit = (!aConst.IsBeamWeapon || !info.ShieldBypassed || finalCount > 1);
- info.ProHit.Entity = hitEntity.Entity;
- info.ProHit.LastHit = hitEntity.HitPos ?? p.Beam.To;
+ var blockingEnt = !info.ShieldBypassed || finalCount == 1 ? 0 : 1;
+ var hitEntity = info.HitList[blockingEnt];
+ if (hitEntity == null)
+ {
+ Log.Line($"null hitEntity");
+ return false;
+ }
- if (aConst.OnHit && Session.I.Tick >= info.ProHit.EndTick)
- {
- info.ProHit.EndTick = Session.I.Tick + aConst.OnHitDuration;
- }
+ if (!checkHit)
+ hitEntity.HitPos = p.Beam.To;
- if (p.EnableAv || aConst.VirtualBeams)
- {
- Vector3D lastHitVel = Vector3D.Zero;
- if (hitEntity.EventType == Shield)
- {
- var cube = hitEntity.Entity as MyCubeBlock;
- if (cube?.CubeGrid?.Physics != null)
- lastHitVel = cube.CubeGrid.Physics.LinearVelocity;
- }
- else if (hitEntity.Projectile != null)
- lastHitVel = hitEntity.Projectile?.Velocity ?? Vector3D.Zero;
- else if (hitEntity.Entity?.Physics != null)
- lastHitVel = hitEntity.Entity?.Physics.LinearVelocity ?? Vector3D.Zero;
- else lastHitVel = Vector3D.Zero;
-
- Vector3D visualHitPos;
- if (hitEntity.Entity is MyCubeGrid)
- {
- IHitInfo hitInfo = null;
- if (Session.I.HandlesInput && hitEntity.HitPos.HasValue && Vector3D.DistanceSquared(hitEntity.HitPos.Value, Session.I.CameraPos) < 22500 && Session.I.CameraFrustrum.Contains(hitEntity.HitPos.Value) != ContainmentType.Disjoint)
- {
- var entSphere = hitEntity.Entity.PositionComp.WorldVolume;
- var from = hitEntity.Intersection.From + (hitEntity.Intersection.Direction * MyUtils.GetSmallestDistanceToSphereAlwaysPositive(ref hitEntity.Intersection.From, ref entSphere));
- var to = hitEntity.HitPos.Value + (hitEntity.Intersection.Direction * 3f);
- Session.I.Physics.CastRay(from, to, out hitInfo, CollisionLayers.NoVoxelCollisionLayer);
- }
- visualHitPos = hitInfo?.HitEntity != null ? hitInfo.Position : hitEntity.HitPos ?? p.Beam.To;
- }
- else visualHitPos = hitEntity.HitPos ?? p.Beam.To;
-
- if (p.EnableAv) {
- info.AvShot.LastHitShield = hitEntity.EventType == Shield;
- info.AvShot.Hit = new Hit { Entity = hitEntity.Entity, EventType = hitEntity.EventType, HitTick = Session.I.Tick, HitVelocity = lastHitVel, LastHit = visualHitPos, SurfaceHit = visualHitPos };
- }
- else if (aConst.VirtualBeams)
- AvShot.UpdateVirtualBeams(p, info, hitEntity, visualHitPos, lastHitVel, true);
+ info.ProHit.Entity = hitEntity.Entity;
+ info.ProHit.LastHit = hitEntity.HitPos ?? p.Beam.To;
- if (info.AimedShot && Session.I.TrackingAi != null && Session.I.TargetUi.HitIncrease < 0.1d && info.Ai.ControlComp == null && (aConst.FixedFireAmmo || info.Weapon.Comp.Data.Repo.Values.Set.Overrides.Control != ProtoWeaponOverrides.ControlModes.Auto))
- Session.I.TargetUi.SetHit(info);
- }
+ if (p.EnableAv || aConst.VirtualBeams)
+ {
+ Vector3D lastHitVel = Vector3D.Zero;
+ if (hitEntity.EventType == Shield)
+ {
+ var cube = hitEntity.Entity as MyCubeBlock;
+ if (cube?.CubeGrid?.Physics != null)
+ lastHitVel = cube.CubeGrid.Physics.LinearVelocity;
+ }
+ else if (hitEntity.Projectile != null)
+ lastHitVel = hitEntity.Projectile?.Velocity ?? Vector3D.Zero;
+ else if (hitEntity.Entity?.Physics != null)
+ lastHitVel = hitEntity.Entity?.Physics.LinearVelocity ?? Vector3D.Zero;
+ else lastHitVel = Vector3D.Zero;
+
+ Vector3D visualHitPos;
+ if (hitEntity.Entity is MyCubeGrid)
+ {
+ IHitInfo hitInfo = null;
+ if (Session.I.HandlesInput && hitEntity.HitPos.HasValue && Vector3D.DistanceSquared(hitEntity.HitPos.Value, Session.I.CameraPos) < 22500 && Session.I.CameraFrustrum.Contains(hitEntity.HitPos.Value) != ContainmentType.Disjoint)
+ {
+ var entSphere = hitEntity.Entity.PositionComp.WorldVolume;
+ var from = hitEntity.Intersection.From + (hitEntity.Intersection.Direction * MyUtils.GetSmallestDistanceToSphereAlwaysPositive(ref hitEntity.Intersection.From, ref entSphere));
+ var to = hitEntity.HitPos.Value + (hitEntity.Intersection.Direction * 3f);
+ Session.I.Physics.CastRay(from, to, out hitInfo, CollisionLayers.NoVoxelCollisionLayer);
+ }
+ visualHitPos = hitInfo?.HitEntity != null ? hitInfo.Position : hitEntity.HitPos ?? p.Beam.To;
+ }
+ else visualHitPos = hitEntity.HitPos ?? p.Beam.To;
+ if (p.EnableAv)
+ {
+ info.AvShot.LastHitShield = hitEntity.EventType == Shield;
+ info.AvShot.ShieldHitAngle = hitEntity.ShieldHitAngle;
+ info.AvShot.Hit = new Hit { Entity = hitEntity.Entity, EventType = hitEntity.EventType, HitTick = Session.I.Tick, HitVelocity = lastHitVel, LastHit = visualHitPos, SurfaceHit = visualHitPos};
+ }
+ else if (aConst.VirtualBeams)
+ AvShot.UpdateVirtualBeams(p, info, hitEntity, visualHitPos, lastHitVel, true);
+ if (info.AimedShot && Session.I.TrackingAi != null && Session.I.TargetUi.HitIncrease < 0.1d && info.Ai.ControlComp == null && (aConst.FixedFireAmmo || info.Weapon.Comp.Data.Repo.Values.Set.Overrides.Control != ProtoWeaponOverrides.ControlModes.Auto))
+ Session.I.TargetUi.SetHit(info);
+ }
- return true;
+ if (info.HitList.Count > 1 && info.BlockList.Count > 1)
+ {
+ //Sort list of blocks hit by dist in KVP
+ info.BlockList.SortNoAlloc((b, a) => b.Value.CompareTo(a.Value));
+ /*
+ //Determine order of grids hit, incl repeats
+ var gridList = new List();
+ for (int i = 0; i < info.BlockList.Count; i++)
+ {
+ if (i == 0)
+ {
+ gridList.Add(info.BlockList[i].Key.CubeGrid);
+ continue;
}
-
+ if (info.BlockList[i - 1].Key.CubeGrid != info.BlockList[i].Key.CubeGrid)
+ gridList.Add(info.BlockList[i].Key.CubeGrid);
}
- catch (Exception ex) { Log.Line($"Exception in GenerateHitInfo1: {ex}", null, true); }
- }
- catch (Exception ex) { Log.Line($"Exception in GenerateHitInfo2: {ex}", null, true); }
+ //Logging readout only
+ Log.Line("Grids hit:");
+ for (int i = 0; i < gridList.Count; i++)
+ Log.Line($"{gridList[i].DisplayName}");
+ Log.Line("Blocks hit:");
+ for (int i = 0; i < info.BlockList.Count; i++)
+ Log.Line($"Blk: {info.BlockList[i].Key.BlockDefinition.DisplayNameText} {info.BlockList[i].Value} {info.BlockList[i].Key.CubeGrid.DisplayName}");
+ */
+ }
+ return true;
}
- catch (Exception ex) { Log.Line($"Exception in GenerateHitInfo3: {ex}", null, true); }
return false;
}
@@ -831,6 +830,19 @@ internal int GetEntityCompareDist(HitEntity x, HitEntity y, ProInfo info)
if (hitEnt.SelfHit && (Vector3D.DistanceSquared(hitPos, hitEnt.Info.Origin) <= grid.GridSize * grid.GridSize) && hitEnt.EventType != Field)
continue;
+ IMySlimBlock lastBlockHit = null;
+ var ewarWeaponDamage = info.EwarActive && aConst.SelfDamage && hitEnt.EventType == Effect;
+ for (int j = 0; j < hitEnt.Vector3ICache.Count; j++)
+ {
+ var posI = hitEnt.Vector3ICache[j];
+ var firstBlock = grid.GetCubeBlock(posI) as IMySlimBlock;
+ if (firstBlock != null && firstBlock != lastBlockHit && !firstBlock.IsDestroyed && (hitEnt.Info.Ai.AiType != Ai.AiTypes.Grid || firstBlock != hitEnt.Info.Weapon.Comp.Cube?.SlimBlock || ewarWeaponDamage && firstBlock == hitEnt.Info.Weapon.Comp.Cube?.SlimBlock))
+ {
+ var blockDist = Vector3D.DistanceSquared(grid.GridIntegerToWorld(posI), beam.From);
+ info.BlockList.Add(new KeyValuePair(firstBlock, blockDist));
+ }
+ }
+
if (!ewarActive)
GetAndSortBlocksInSphere(hitEnt.Info.AmmoDef, hitEnt.Info.Weapon.System, grid, hitEnt.PruneSphere, false, hitEnt.Blocks);
@@ -856,6 +868,10 @@ internal int GetEntityCompareDist(HitEntity x, HitEntity y, ProInfo info)
{
lastBlockHit = firstBlock;
hitEnt.Blocks.Add(new HitEntity.RootBlocks {Block = firstBlock, QueryPos = posI});
+ var blockDist = Vector3D.DistanceSquared(grid.GridIntegerToWorld(posI), beam.From);
+ info.BlockList.Add(new KeyValuePair(firstBlock, blockDist));
+
+
if (closestBlockFound) continue;
MyOrientedBoundingBoxD obb;
var fat = firstBlock.FatBlock;
@@ -914,6 +930,9 @@ internal int GetEntityCompareDist(HitEntity x, HitEntity y, ProInfo info)
hitEnt.Miss = !closestBlockFound;
}
}
+
+ if (hitEnt.HitPos != null && info.ShieldBypassedHitOther && info.AvShot?.HitParticle == AvShot.ParticleState.Dirty)
+ info.AvShot.HitParticle = AvShot.ParticleState.Custom;
}
else if (voxel != null)
{
@@ -1102,8 +1121,6 @@ internal static void GetAndSortBlocksInSphere(WeaponDefinition.AmmoDef ammoDef,
}
else
{
- //usage:
- //var dict = (Dictionary)GetHackDict((IMySlimBlock) null);
var tmpList = Session.I.SlimPool.Get();
Session.GetBlocksInsideSphereFast(grid, ref sphere, true, tmpList);
@@ -1123,7 +1140,5 @@ internal static void GetAndSortBlocksInSphere(WeaponDefinition.AmmoDef ammoDef,
return Vector3D.DistanceSquared(aPos, hitPos).CompareTo(Vector3D.DistanceSquared(bPos, hitPos));
});
}
- public static object GetHackDict