|
1 | | -using System.Collections.Generic; |
2 | | -using System.ComponentModel; |
3 | | -using VRageMath; |
4 | | -using static Scripts.Structure; |
5 | | -using static Scripts.Structure.WeaponDefinition.AmmoDef; |
6 | | -using static Scripts.Structure.WeaponDefinition.AnimationDef.RelMove; |
7 | | -using static Scripts.Structure.WeaponDefinition.AnimationDef.PartAnimationSetDef; |
8 | | -using static Scripts.Structure.WeaponDefinition.AnimationDef; |
9 | | -using static Scripts.Structure.WeaponDefinition.AnimationDef.PartAnimationSetDef.EventTriggers; |
10 | | -using static Scripts.Structure.ArmorDefinition.ArmorType; |
11 | | - |
12 | | -namespace Scripts |
13 | | -{ |
14 | | - partial class Parts |
15 | | - { |
16 | | - internal ContainerDefinition Container = new ContainerDefinition(); |
17 | | - internal void PartDefinitions(params WeaponDefinition[] defs) |
18 | | - { |
19 | | - Container.WeaponDefs = defs; |
20 | | - } |
21 | | - |
22 | | - internal void ArmorDefinitions(params ArmorDefinition[] defs) |
23 | | - { |
24 | | - Container.ArmorDefs = defs; |
25 | | - } |
26 | | - |
27 | | - internal void SupportDefinitions(params SupportDefinition[] defs) |
28 | | - { |
29 | | - Container.SupportDefs = defs; |
30 | | - } |
31 | | - |
32 | | - internal void UpgradeDefinitions(params UpgradeDefinition[] defs) |
33 | | - { |
34 | | - Container.UpgradeDefs = defs; |
35 | | - } |
36 | | - |
37 | | - internal static void GetBaseDefinitions(out ContainerDefinition baseDefs) |
38 | | - { |
39 | | - baseDefs = new Parts().Container; |
40 | | - } |
41 | | - |
42 | | - internal static void SetModPath(ContainerDefinition baseDefs, string modContext) |
43 | | - { |
44 | | - if (baseDefs.WeaponDefs != null) |
45 | | - for (int i = 0; i < baseDefs.WeaponDefs.Length; i++) |
46 | | - baseDefs.WeaponDefs[i].ModPath = modContext; |
47 | | - |
48 | | - if (baseDefs.SupportDefs != null) |
49 | | - for (int i = 0; i < baseDefs.SupportDefs.Length; i++) |
50 | | - baseDefs.SupportDefs[i].ModPath = modContext; |
51 | | - |
52 | | - if (baseDefs.UpgradeDefs != null) |
53 | | - for (int i = 0; i < baseDefs.UpgradeDefs.Length; i++) |
54 | | - baseDefs.UpgradeDefs[i].ModPath = modContext; |
55 | | - } |
56 | | - |
57 | | - internal Randomize Random(float start, float end) |
58 | | - { |
59 | | - return new Randomize { Start = start, End = end }; |
60 | | - } |
61 | | - |
62 | | - internal Vector4 Color(float red, float green, float blue, float alpha) |
63 | | - { |
64 | | - return new Vector4(red, green, blue, alpha); |
65 | | - } |
66 | | - |
67 | | - internal Vector3D Vector(double x, double y, double z) |
68 | | - { |
69 | | - return new Vector3D(x, y, z); |
70 | | - } |
71 | | - |
72 | | - internal XYZ Transformation(double X, double Y, double Z) |
73 | | - { |
74 | | - return new XYZ { x = X, y = Y, z = Z }; |
75 | | - } |
76 | | - |
77 | | - internal Dictionary<EventTriggers, uint> Delays(uint FiringDelay = 0, uint ReloadingDelay = 0, uint OverheatedDelay = 0, uint TrackingDelay = 0, uint LockedDelay = 0, uint OnDelay = 0, uint OffDelay = 0, uint BurstReloadDelay = 0, uint OutOfAmmoDelay = 0, uint PreFireDelay = 0, uint StopFiringDelay = 0, uint StopTrackingDelay = 0, uint InitDelay = 0, uint HomingDelay = 0, uint TargetAlignedDelay = 0, uint WhileOnDelay = 0, uint TargetRanged100Delay = 0, uint TargetRanged75Delay = 0, uint TargetRanged50Delay = 0, uint TargetRanged25Delay = 0) |
78 | | - { |
79 | | - return new Dictionary<EventTriggers, uint> |
80 | | - { |
81 | | - [Firing] = FiringDelay, |
82 | | - [Reloading] = ReloadingDelay, |
83 | | - [Overheated] = OverheatedDelay, |
84 | | - [Tracking] = TrackingDelay, |
85 | | - [TurnOn] = OnDelay, |
86 | | - [TurnOff] = OffDelay, |
87 | | - [BurstReload] = BurstReloadDelay, |
88 | | - [NoMagsToLoad] = OutOfAmmoDelay, |
89 | | - [PreFire] = PreFireDelay, |
90 | | - [EmptyOnGameLoad] = 0, |
91 | | - [StopFiring] = StopFiringDelay, |
92 | | - [StopTracking] = StopTrackingDelay, |
93 | | - [LockDelay] = LockedDelay, |
94 | | - [Init] = InitDelay, |
95 | | - [Homing] = HomingDelay, |
96 | | - [TargetAligned] = TargetAlignedDelay, |
97 | | - [WhileOn] = WhileOnDelay, |
98 | | - [TargetRanged100] = TargetRanged100Delay, |
99 | | - [TargetRanged75] = TargetRanged75Delay, |
100 | | - [TargetRanged50] = TargetRanged50Delay, |
101 | | - [TargetRanged25] = TargetRanged25Delay, |
102 | | - }; |
103 | | - } |
104 | | - |
105 | | - internal PartEmissive Emissive(string EmissiveName, bool CycleEmissiveParts, bool LeavePreviousOn, Vector4[] Colors, float IntensityFrom, float IntensityTo, string[] EmissivePartNames) |
106 | | - { |
107 | | - return new PartEmissive |
108 | | - { |
109 | | - EmissiveName = EmissiveName, |
110 | | - Colors = Colors, |
111 | | - CycleEmissivesParts = CycleEmissiveParts, |
112 | | - LeavePreviousOn = LeavePreviousOn, |
113 | | - EmissivePartNames = EmissivePartNames, |
114 | | - IntensityRange = new[]{ IntensityFrom, IntensityTo } |
115 | | - }; |
116 | | - } |
117 | | - |
118 | | - internal EventTriggers[] Events(params EventTriggers[] events) |
119 | | - { |
120 | | - return events; |
121 | | - } |
122 | | - |
123 | | - internal string[] Names(params string[] names) |
124 | | - { |
125 | | - return names; |
126 | | - } |
127 | | - |
128 | | - internal string[] AmmoRounds(params string[] names) |
129 | | - { |
130 | | - return names; |
131 | | - } |
132 | | - } |
133 | | -} |
| 1 | +using System.Collections.Generic; |
| 2 | +using System.ComponentModel; |
| 3 | +using VRageMath; |
| 4 | +using static Scripts.Structure; |
| 5 | +using static Scripts.Structure.WeaponDefinition.AmmoDef; |
| 6 | +using static Scripts.Structure.WeaponDefinition.AnimationDef.RelMove; |
| 7 | +using static Scripts.Structure.WeaponDefinition.AnimationDef.PartAnimationSetDef; |
| 8 | +using static Scripts.Structure.WeaponDefinition.AnimationDef; |
| 9 | +using static Scripts.Structure.WeaponDefinition.AnimationDef.PartAnimationSetDef.EventTriggers; |
| 10 | +using static Scripts.Structure.ArmorDefinition.ArmorType; |
| 11 | + |
| 12 | +namespace Scripts |
| 13 | +{ |
| 14 | + partial class Parts |
| 15 | + { |
| 16 | + internal ContainerDefinition Container = new ContainerDefinition(); |
| 17 | + internal void PartDefinitions(params WeaponDefinition[] defs) |
| 18 | + { |
| 19 | + Container.WeaponDefs = defs; |
| 20 | + } |
| 21 | + |
| 22 | + internal void ArmorDefinitions(params ArmorDefinition[] defs) |
| 23 | + { |
| 24 | + Container.ArmorDefs = defs; |
| 25 | + } |
| 26 | + |
| 27 | + internal void SupportDefinitions(params SupportDefinition[] defs) |
| 28 | + { |
| 29 | + Container.SupportDefs = defs; |
| 30 | + } |
| 31 | + |
| 32 | + internal void UpgradeDefinitions(params UpgradeDefinition[] defs) |
| 33 | + { |
| 34 | + Container.UpgradeDefs = defs; |
| 35 | + } |
| 36 | + |
| 37 | + internal static void GetBaseDefinitions(out ContainerDefinition baseDefs) |
| 38 | + { |
| 39 | + baseDefs = new Parts().Container; |
| 40 | + } |
| 41 | + |
| 42 | + internal static void SetModPath(ContainerDefinition baseDefs, string modContext) |
| 43 | + { |
| 44 | + if (baseDefs.WeaponDefs != null) |
| 45 | + for (int i = 0; i < baseDefs.WeaponDefs.Length; i++) |
| 46 | + baseDefs.WeaponDefs[i].ModPath = modContext; |
| 47 | + |
| 48 | + if (baseDefs.SupportDefs != null) |
| 49 | + for (int i = 0; i < baseDefs.SupportDefs.Length; i++) |
| 50 | + baseDefs.SupportDefs[i].ModPath = modContext; |
| 51 | + |
| 52 | + if (baseDefs.UpgradeDefs != null) |
| 53 | + for (int i = 0; i < baseDefs.UpgradeDefs.Length; i++) |
| 54 | + baseDefs.UpgradeDefs[i].ModPath = modContext; |
| 55 | + } |
| 56 | + |
| 57 | + internal Randomize Random(float start, float end) |
| 58 | + { |
| 59 | + return new Randomize { Start = start, End = end }; |
| 60 | + } |
| 61 | + |
| 62 | + internal Vector4 Color(float red, float green, float blue, float alpha) |
| 63 | + { |
| 64 | + return new Vector4(red, green, blue, alpha); |
| 65 | + } |
| 66 | + |
| 67 | + internal Vector3D Vector(double x, double y, double z) |
| 68 | + { |
| 69 | + return new Vector3D(x, y, z); |
| 70 | + } |
| 71 | + |
| 72 | + internal XYZ Transformation(double X, double Y, double Z) |
| 73 | + { |
| 74 | + return new XYZ { x = X, y = Y, z = Z }; |
| 75 | + } |
| 76 | + |
| 77 | + internal Dictionary<EventTriggers, uint> Delays(uint FiringDelay = 0, uint ReloadingDelay = 0, uint OverheatedDelay = 0, uint TrackingDelay = 0, uint LockedDelay = 0, uint OnDelay = 0, uint OffDelay = 0, uint BurstReloadDelay = 0, uint OutOfAmmoDelay = 0, uint PreFireDelay = 0, uint StopFiringDelay = 0, uint StopTrackingDelay = 0, uint InitDelay = 0, uint HomingDelay = 0, uint TargetAlignedDelay = 0, uint WhileOnDelay = 0, uint TargetRanged100Delay = 0, uint TargetRanged75Delay = 0, uint TargetRanged50Delay = 0, uint TargetRanged25Delay = 0) |
| 78 | + { |
| 79 | + return new Dictionary<EventTriggers, uint> |
| 80 | + { |
| 81 | + [Firing] = FiringDelay, |
| 82 | + [Reloading] = ReloadingDelay, |
| 83 | + [Overheated] = OverheatedDelay, |
| 84 | + [Tracking] = TrackingDelay, |
| 85 | + [TurnOn] = OnDelay, |
| 86 | + [TurnOff] = OffDelay, |
| 87 | + [BurstReload] = BurstReloadDelay, |
| 88 | + [NoMagsToLoad] = OutOfAmmoDelay, |
| 89 | + [PreFire] = PreFireDelay, |
| 90 | + [EmptyOnGameLoad] = 0, |
| 91 | + [StopFiring] = StopFiringDelay, |
| 92 | + [StopTracking] = StopTrackingDelay, |
| 93 | + [LockDelay] = LockedDelay, |
| 94 | + [Init] = InitDelay, |
| 95 | + [Homing] = HomingDelay, |
| 96 | + [TargetAligned] = TargetAlignedDelay, |
| 97 | + [WhileOn] = WhileOnDelay, |
| 98 | + [TargetRanged100] = TargetRanged100Delay, |
| 99 | + [TargetRanged75] = TargetRanged75Delay, |
| 100 | + [TargetRanged50] = TargetRanged50Delay, |
| 101 | + [TargetRanged25] = TargetRanged25Delay, |
| 102 | + }; |
| 103 | + } |
| 104 | + |
| 105 | + internal PartEmissive Emissive(string EmissiveName, bool CycleEmissiveParts, bool LeavePreviousOn, Vector4[] Colors, float IntensityFrom, float IntensityTo, string[] EmissivePartNames) |
| 106 | + { |
| 107 | + return new PartEmissive |
| 108 | + { |
| 109 | + EmissiveName = EmissiveName, |
| 110 | + Colors = Colors, |
| 111 | + CycleEmissivesParts = CycleEmissiveParts, |
| 112 | + LeavePreviousOn = LeavePreviousOn, |
| 113 | + EmissivePartNames = EmissivePartNames, |
| 114 | + IntensityRange = new[]{ IntensityFrom, IntensityTo } |
| 115 | + }; |
| 116 | + } |
| 117 | + |
| 118 | + internal EventTriggers[] Events(params EventTriggers[] events) |
| 119 | + { |
| 120 | + return events; |
| 121 | + } |
| 122 | + |
| 123 | + internal string[] Names(params string[] names) |
| 124 | + { |
| 125 | + return names; |
| 126 | + } |
| 127 | + |
| 128 | + internal string[] AmmoRounds(params string[] names) |
| 129 | + { |
| 130 | + return names; |
| 131 | + } |
| 132 | + } |
| 133 | +} |
0 commit comments