diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Prefabs/RocketBall.sbc b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Prefabs/RocketBall.sbc new file mode 100644 index 000000000..88a166f42 --- /dev/null +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Prefabs/RocketBall.sbc @@ -0,0 +1,2345 @@ + + + + + + Aristeas + + + + 108055600967661582 + CastShadows InScene + 108055600967661582 + + + + + + 0.01681527 + -0.689737439 + 0.0471778736 + 0.722325265 + + + + + + + MyModStorageComponent + + + + + ba5bfb16-27fe-4f83-8e1b-9fe04ed919d8 + + + + + + + + + Large + + + LargeBlockSmallGenerator + 127494882478367085 + + Weldless + 144115188075855874 + + + + MyInventoryBase + + true + + 0 + 1 + 9223372036854.775807 + 2147483647 + + CanReceive + false + + + + MyTimerComponent + + true + 0 + 0 + false + false + Frame100 + 0 + 900 + false + + + + + false + true + true + true + 1 + true + 1 + + + LargeBlockBeacon + 117397356654221988 + + + + Weldless + 144115188075855874 + false + true + true + true + 1 + true + 200000 + THE BALL + + + LargeBlockCockpitSeat + 117809699502817722 + + + + 144115188075855874 + + + + MyInventoryBase + + true + + 0 + 1 + 9223372036854.775807 + 2147483647 + + CanReceive CanSend + false + + + + MyMultiTextPanelComponent + + + + 0 + + 1 + NONE + + 4294967295 + 255 + 255 + 255 + 255 + 255 + 255 + 255 + + + 4278190080 + 0 + 0 + 0 + 0 + 0 + 0 + 255 + + 0 + SCRIPT + TSS_ArtificialHorizon + 2 + true + + 4288108544 + 0 + 88 + 151 + 0 + 88 + 151 + 255 + + + 4294962611 + 179 + 237 + 255 + 179 + 237 + 255 + 255 + + + 0 + + + + 0 + + 1 + NONE + + 4294967295 + 255 + 255 + 255 + 255 + 255 + 255 + 255 + + + 4278190080 + 0 + 0 + 0 + 0 + 0 + 0 + 255 + + 0 + SCRIPT + TSS_EnergyHydrogen + 2 + true + + 4288108544 + 0 + 88 + 151 + 0 + 88 + 151 + 255 + + + 4294962611 + 179 + 237 + 255 + 179 + 237 + 255 + 255 + + + 0 + + + + 0 + + 1 + NONE + + 4294967295 + 255 + 255 + 255 + 255 + 255 + 255 + 255 + + + 4278190080 + 0 + 0 + 0 + 0 + 0 + 0 + 255 + + 0 + SCRIPT + TSS_Gravity + 2 + true + + 4288108544 + 0 + 88 + 151 + 0 + 88 + 151 + 255 + + + 4294962611 + 179 + 237 + 255 + 179 + 237 + 255 + 255 + + + 0 + + + + 0 + + 1 + NONE + + 4294967295 + 255 + 255 + 255 + 255 + 255 + 255 + 255 + + + 4278190080 + 0 + 0 + 0 + 0 + 0 + 0 + 255 + + 0 + + 2 + + 4288108544 + 0 + 88 + 151 + 0 + 88 + 151 + 255 + + + 4294962611 + 179 + 237 + 255 + 179 + 237 + 255 + 255 + + + 0 + + + + 0 + + 1 + NONE + + 4294967295 + 255 + 255 + 255 + 255 + 255 + 255 + 255 + + + 4278190080 + 0 + 0 + 0 + 0 + 0 + 0 + 255 + + 0 + SCRIPT + TSS_ClockAnalog + 2 + true + + 4288108544 + 0 + 88 + 151 + 0 + 88 + 151 + 255 + + + 4294962611 + 179 + 237 + 255 + 179 + 237 + 255 + 255 + + + 0 + + + + 0 + + 1 + NONE + + 4294967295 + 255 + 255 + 255 + 255 + 255 + 255 + 255 + + + 4278190080 + 0 + 0 + 0 + 0 + 0 + 0 + 255 + + 0 + + 2 + + 4288108544 + 0 + 88 + 151 + 0 + 88 + 151 + 255 + + + 4294962611 + 179 + 237 + 255 + 179 + 237 + 255 + 255 + + + 0 + + + + + + + + false + true + true + true + 1 + false + + Character + + + + + + + Character + + + + + + Character + + + + + + + + + + 0.322268754 + 0.740566134 + 0.339292675 + -0.4822708 + + + + false + 0 + + + 0 + false + 0 + + 954916 + + + LargeBlockGyro + 91430459503144092 + + + + 144115188075855874 + false + true + true + true + 1 + true + 0.01 + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + AQD_LG_IonThrusterS_Armored + 91904584980615575 + + + + Weldless + + + + MyTimerComponent + + true + 0 + 0 + true + false + Frame100 + 0 + 100 + false + + + + MyModStorageComponent + + + + + 74de02b3-27f9-4960-b1c4-27351f2b06d1 + [FlameColors] +0.27/0.41/0.65/0.75 +0.27/0.41/0.65/0.75 +False +Linked +True + + + + + + + + + false + true + true + true + 14 + true + + + AQD_LG_IonThrusterS_Armored + 131191130628960182 + + + + Weldless + + + + MyTimerComponent + + true + 0 + 0 + true + false + Frame100 + 0 + 100 + false + + + + MyModStorageComponent + + + + + 74de02b3-27f9-4960-b1c4-27351f2b06d1 + [FlameColors] +0.27/0.41/0.65/0.75 +0.27/0.41/0.65/0.75 +False +Linked +True + + + + + + + + + false + true + true + true + 13 + true + + + AQD_LG_IonThrusterS_Armored + 120284295702293143 + + + + Weldless + + + + MyTimerComponent + + true + 0 + 0 + true + false + Frame100 + 0 + 100 + false + + + + MyModStorageComponent + + + + + 74de02b3-27f9-4960-b1c4-27351f2b06d1 + [FlameColors] +0.27/0.41/0.65/0.75 +0.27/0.41/0.65/0.75 +False +Linked +True + + + + + + + + + false + true + true + true + 10 + true + + + AQD_LG_IonThrusterS_Armored + 97962770887056127 + + + + Weldless + + + + MyTimerComponent + + true + 0 + 0 + true + false + Frame100 + 0 + 100 + false + + + + MyModStorageComponent + + + + + 74de02b3-27f9-4960-b1c4-27351f2b06d1 + [FlameColors] +0.27/0.41/0.65/0.75 +0.27/0.41/0.65/0.75 +False +Linked +True + + + + + + + + + false + true + true + true + 9 + true + + + AQD_LG_IonThrusterS_Armored + 91747736122410389 + + + + Weldless + + + + MyTimerComponent + + true + 0 + 0 + true + false + Frame100 + 0 + 100 + false + + + + MyModStorageComponent + + + + + 74de02b3-27f9-4960-b1c4-27351f2b06d1 + [FlameColors] +0.27/0.41/0.65/0.75 +0.27/0.41/0.65/0.75 +False +Linked +True + + + + + + + + + false + true + true + true + 12 + true + + + AQD_LG_IonThrusterS_Armored + 112660050684883642 + + + + Weldless + + + + MyTimerComponent + + true + 0 + 0 + true + false + Frame100 + 0 + 100 + false + + + + MyModStorageComponent + + + + + 74de02b3-27f9-4960-b1c4-27351f2b06d1 + [FlameColors] +0.27/0.41/0.65/0.75 +0.27/0.41/0.65/0.75 +False +Linked +True + + + + + + + + + false + true + true + true + 11 + true + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorSlope2Base + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Base + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlopedCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorInvCorner2Tip + + + + Weldless + + + LargeBlockArmorCorner + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorCorner2Tip + + + + Neon_Colorable_Lights + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorBlock + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + LargeBlockArmorSlope2Tip + + + + Weldless + + + THE BALL + false + false + false + false + 0 + + + + + None + 0 + 76561198274566684 + 0 + + + \ No newline at end of file diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Prefabs/RocketBall.sbcB5 b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Prefabs/RocketBall.sbcB5 new file mode 100644 index 000000000..1fd0eaee0 Binary files /dev/null and b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Prefabs/RocketBall.sbcB5 differ diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/RocketCore/RocketCoreGamemode.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/RocketCore/RocketCoreGamemode.cs new file mode 100644 index 000000000..9b32138bf --- /dev/null +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/RocketCore/RocketCoreGamemode.cs @@ -0,0 +1,305 @@ +using SC.SUGMA.API; +using SC.SUGMA.GameState; +using System; +using System.Collections.Generic; +using System.Linq; +using RichHudFramework; +using VRage.Game.ModAPI; +using SC.SUGMA.Utilities; +using Sandbox.ModAPI; +using Sandbox.Game.Entities; +using Sandbox.Game; +using VRageMath; +using VRage.ModAPI; + +namespace SC.SUGMA.GameModes.RocketCore +{ + internal class RocketCoreGamemode : GamemodeBase + { + public static double MatchDuration = 20; + + /// + /// Lists currently tracked factions. + /// + public readonly List TrackedFactions = new List(); + public List InFactions { get; private set; } = new List(); + protected IMyFaction _winningFaction; + + public PointTracker PointTracker; + + protected ShareTrackApi ShareTrackApi => SUGMA_SessionComponent.I.ShareTrackApi; + public MatchTimer MatchTimer => SUGMA_SessionComponent.I.GetComponent("MatchTimer"); + public Dictionary FactionGoals = new Dictionary(); + private bool _waitingForBallSpawn = false; + public override string ReadableName { get; internal set; } = "RocketCore"; + + public IMyCubeGrid BallEntity = null; + + public override string Description { get; internal set; } = + "Score by pushing the ball into the enemy team's goal! Grids are made invincible."; + + public RocketCoreGamemode() + { + ArgumentParser += new ArgumentParser( + new ArgumentParser.ArgumentDefinition( + time => double.TryParse(time, out MatchDuration), + "t", + "match-time", + "Match time, in minutes.") + ); + } + + public override void Close() + { + StopRound(); + } + + public override void UpdateActive() + { + if (PointTracker == null || MatchTimer == null || + TrackedFactions == null) // ten billion nullchecks of aristeas + return; + + if (MatchTimer.IsMatchEnded && MyAPIGateway.Session.IsServer) + StopRound(); + + if (_waitingForBallSpawn) + return; + + foreach (var zoneSet in FactionGoals) + { + if (zoneSet.Value.ContainedGrids.Count <= 0) + continue; + // Goal was made + PointTracker.AddFactionPoints(zoneSet.Key, -1); + SUGMA_SessionComponent.I.GetComponent("rocHud")?.GoalScored(zoneSet.Key); + + if (_winningFaction != null) + break; + + SpawnBall(); + Log.Info($"Goal was scored against {zoneSet.Key.Name}! New points: {PointTracker.GetFactionPoints(zoneSet.Key)}"); + + _waitingForBallSpawn = true; + } + } + + public override void StartRound(string[] arguments = null) + { + _waitingForBallSpawn = false; + _winningFaction = null; + PointTracker = new PointTracker(3, 0); + PointTracker.OnFactionWin += OnFactionLose; + + SUGMA_SessionComponent.I.UnregisterComponent("ROCPointTracker"); + if (!MyAPIGateway.Utilities.IsDedicated) + SUGMA_SessionComponent.I.UnregisterComponent("rocHud"); + + foreach (var grid in ShareTrackApi.GetTrackedGrids()) + { + var faction = PlayerTracker.I.GetGridFaction(grid); + if (faction == null || !ShareTrackApi.IsGridAlive(grid)) + continue; + + if (!TrackedFactions.Contains(faction)) + TrackedFactions.Add(faction); + + List subGrids = new List(); + grid.GetGridGroup(GridLinkTypeEnum.Physical).GetGrids(subGrids); + foreach (var subGrid in subGrids) + { + ((MyCubeGrid)subGrid).Immune = true; + ((MyCubeGrid)subGrid).DestructibleBlocks = false; + } + } + + if (TrackedFactions.Count <= 1) + { + MyAPIGateway.Utilities.ShowNotification("There aren't any combatants, idiot!", 10000, "Red"); + StopRound(); + return; + } + + SUGMA_SessionComponent.I.RegisterComponent("ROCPointTracker", PointTracker); + + var factionNames = new List(); + var factionSpawns = SUtils.GetFactionSpawns(); + foreach (var faction in TrackedFactions) + { + factionNames.Add($"|{faction.Tag}|"); + foreach (var compareFaction in TrackedFactions) + { + if (faction == compareFaction) + continue; + + MyAPIGateway.Session.Factions.DeclareWar(faction.FactionId, compareFaction.FactionId); + //MyAPIGateway.Utilities.ShowMessage("ROC", $"Declared war between {factionKvp.Key.Name} and {faction.Name}"); + } + + if (factionSpawns.ContainsKey(faction)) + { + var zone = new SphereZone( + factionSpawns[faction].GetPosition() - factionSpawns[faction].GetPosition().Normalized() * 2500, + 750) + { + SphereDrawColor = faction.CustomColor.ColorMaskToRgb().SetAlphaPct(0.25f), + GridFilter = Array.Empty() + }; + FactionGoals[faction] = zone; + SUGMA_SessionComponent.I.RegisterComponent($"RocZone{faction.FactionId}", zone); + } + } + + InFactions = new List(TrackedFactions); + + base.StartRound(arguments); + MyAPIGateway.Utilities.ShowNotification("Combatants: " + string.Join(" vs ", factionNames), 10000, "Red"); + MatchTimer.Start(MatchDuration); + + if (!MyAPIGateway.Utilities.IsDedicated) + SUGMA_SessionComponent.I.RegisterComponent("rocHud", new RocketCoreHud(this)); + + SpawnBall(); + + Log.Info("Started a ROC match." + + $"\n- Combatants: {string.Join(" vs ", factionNames)}"); + } + + private void OnFactionLose(IMyFaction loser) + { + foreach (var grid in ShareTrackApi.GetTrackedGrids()) + { + var faction = PlayerTracker.I.GetGridFaction(grid); + if (faction == null || !ShareTrackApi.IsGridAlive(grid) || faction != loser) continue; + + List subGrids = new List(); + grid.GetGridGroup(GridLinkTypeEnum.Physical).GetGrids(subGrids); + foreach (var subGrid in subGrids) + { + ((MyCubeGrid)subGrid).Immune = false; + ((MyCubeGrid)subGrid).DestructibleBlocks = true; + } + + FactionGoals[loser].IsVisible = false; + InFactions.Remove(loser); + } + + if (InFactions.Count > 1) return; + + _winningFaction = InFactions[0]; + StopRound(); + } + + public override void StopRound() + { + BallEntity?.Close(); + bool setWinnerFromArgs = false; + foreach (var arg in Arguments) + { + if (arg.StartsWith("win")) + { + long factionId; + long.TryParse(arg.Remove(0, 3), out factionId); + + _winningFaction = MyAPIGateway.Session.Factions.TryGetFactionById(factionId); + setWinnerFromArgs = true; + Log.Info($"Winner in arguments found: {factionId} ({_winningFaction?.Name})"); + break; + } + } + + if (!setWinnerFromArgs && MyAPIGateway.Session.IsServer) + { + Arguments = Arguments.Concat(new[] { $"win{_winningFaction?.FactionId ?? -1}" }).ToArray(); + } + + SUGMA_SessionComponent.I.GetComponent("rocHud")?.MatchEnded(_winningFaction); + + foreach (var factionKvp in TrackedFactions) + { + foreach (var faction in TrackedFactions) + { + if (faction == factionKvp) + continue; + + MyAPIGateway.Session.Factions.SendPeaceRequest(factionKvp.FactionId, faction.FactionId); + MyAPIGateway.Session.Factions.AcceptPeace(faction.FactionId, factionKvp.FactionId); + } + } + + // Reset destructibility + foreach (var grid in ShareTrackApi.GetTrackedGrids()) + { + List subGrids = new List(); + grid.GetGridGroup(GridLinkTypeEnum.Physical).GetGrids(subGrids); + foreach (var subGrid in subGrids) + { + ((MyCubeGrid)subGrid).Immune = false; + ((MyCubeGrid)subGrid).DestructibleBlocks = true; + } + } + + foreach (var zone in FactionGoals) + SUGMA_SessionComponent.I.UnregisterComponent(zone.Value.ComponentId); + + MatchTimer?.Stop(); + SUGMA_SessionComponent.I.UnregisterComponent("PointTracker"); + + base.StopRound(); + InFactions.Clear(); + TrackedFactions.Clear(); + FactionGoals.Clear(); + PointTracker = null; + } + + protected void SpawnBall() + { + if (!MyAPIGateway.Session.IsServer) + return; + + BallEntity?.Close(); + MyVisualScriptLogicProvider.PrefabSpawned += PrefabSpawned; + MyVisualScriptLogicProvider.SpawnPrefab("THE BALL", SUtils.RandVector().Normalized() * 250, Vector3D.Forward, Vector3D.Up, entityName: "SugmaTheBall"); + } + + private void PrefabSpawned(string entityName) + { + try + { + IMyEntity ballEnt; + if (!MyAPIGateway.Entities.TryGetEntityByName(entityName, out ballEnt)) + throw new Exception("Could not find ball entity!"); + + BallEntity = (IMyCubeGrid) ballEnt; + SUGMA_SessionComponent.I.ShareTrackApi.TrackGrid(BallEntity); + + MyVisualScriptLogicProvider.PrefabSpawned -= PrefabSpawned; + Log.Info("RocketCoreGamemode spawned ball entity " + entityName + " at " + BallEntity.GetPosition()); + + var array = new[] + { + BallEntity + }; + + foreach (var zone in FactionGoals) + zone.Value.GridFilter = array; + _waitingForBallSpawn = false; + } + catch (Exception ex) + { + Log.Exception(ex, typeof(RocketCoreGamemode)); + } + } + + internal override void DisplayWinMessage() + { + if (_winningFaction == null) + { + MyAPIGateway.Utilities.ShowNotification("YOU ARE ALL LOSERS.", 10000, "Red"); + return; + } + + MyAPIGateway.Utilities.ShowNotification($"A WINNER IS [{_winningFaction?.Name}]!", 10000); + } + } +} diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/RocketCore/RocketCoreHud.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/RocketCore/RocketCoreHud.cs new file mode 100644 index 000000000..3b4270e2d --- /dev/null +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/RocketCore/RocketCoreHud.cs @@ -0,0 +1,172 @@ +using RichHudFramework.Client; +using RichHudFramework.UI; +using RichHudFramework.UI.Client; +using Sandbox.Game.Entities; +using SC.SUGMA.GameModes.Elimination; +using SC.SUGMA.GameState; +using SC.SUGMA.Utilities; +using System; +using System.Collections.Generic; +using Sandbox.ModAPI; +using VRage.Game.ModAPI; +using VRageMath; + +namespace SC.SUGMA.GameModes.RocketCore +{ + internal class RocketCoreHud : ComponentBase + { + private int _closeTime = -1; + private readonly RocketCoreGamemode _gamemode; + public RocHud_Window Window; + + public MySoundPair CaptureSound = new MySoundPair("SUGMA_CaptureSound_TF2"); + private List _zoneGpses = new List(); + + public RocketCoreHud(RocketCoreGamemode gamemode) + { + _gamemode = gamemode; + } + + public override void Init(string id) + { + base.Init(id); + + if (!RichHudClient.Registered) + throw new Exception("RichHudAPI was not initialized in time!"); + + Window = new RocHud_Window(HudMain.HighDpiRoot, _gamemode); + foreach (var zone in _gamemode.FactionGoals) + { + var gps = MyAPIGateway.Session.GPS.Create($"{zone.Key.Name} Goal", "", zone.Value.Sphere.Center, true, + false); + MyAPIGateway.Session.GPS.AddLocalGps(gps); + _zoneGpses.Add(gps); + } + } + + public override void Close() + { + HudMain.HighDpiRoot.RemoveChild(Window); + foreach (var gps in _zoneGpses) + MyAPIGateway.Session.GPS.RemoveLocalGps(gps); + } + + public override void UpdateTick() + { + Window.Update(); + if (_closeTime > 0) + _closeTime--; + + if (_closeTime == 0) SUGMA_SessionComponent.I.UnregisterComponent(ComponentId); + } + + public void MatchEnded(IMyFaction winner) + { + Window.MatchEnded(winner); + _closeTime = HudConstants.MatchResultsVisibleTicks; + } + + public void GoalScored(IMyFaction faction) + { + MyAPIGateway.Utilities.ShowNotification($"Goal was scored against {faction.Name}!", 10000); + SUtils.PlaySound(CaptureSound); + } + } + + internal class RocHud_Window : HudElementBase + { + private readonly RocketCoreGamemode _gamemode; + + private bool _matchEnded; + private readonly MatchTimer _timer; + private readonly LabelBox _timerLabel; + + private readonly Dictionary _factionLabels = new Dictionary(); + + public RocHud_Window(HudParentBase parent, RocketCoreGamemode gamemode) : base(parent) + { + _gamemode = gamemode; + _timer = gamemode.MatchTimer; + + if (_gamemode == null) + throw new Exception("Null gamemode!"); + if (_timer == null) + throw new Exception("Null match timer!"); + + Size = new Vector2(100, 24); + + Offset = new Vector2(0, 515); // Regardless of screen size, this is out of 1920x1080 + + _timerLabel = new LabelBox(this) + { + ParentAlignment = ParentAlignments.Inner | ParentAlignments.Top, + Height = 24, + DimAlignment = DimAlignments.Height, + Text = "20:00", + TextPadding = new Vector2(2.5f, 0), + FitToTextElement = false, + Color = HudConstants.HudBackgroundColor + }; + + var idx = 0; + foreach (var faction in _gamemode.TrackedFactions) + { + _factionLabels[faction] = new LabelBox(this) + { + Format = GlyphFormat.White.WithColor(faction.CustomColor.ColorMaskToRgb()).WithSize(2) + .WithAlignment(TextAlignment.Center), + ParentAlignment = + ParentAlignments.InnerV | + (idx % 2 == 0 ? ParentAlignments.Right : ParentAlignments.Left) | + ParentAlignments.Top, + Color = HudConstants.HudBackgroundColor, + Offset = new Vector2(0, (int)-Math.Floor(idx / 2f) * (24 + 5)), + Text = $"{_gamemode.PointTracker.StartingPoints} GOALS LEFT" + }; + idx++; + } + + _gamemode.PointTracker.OnPointsUpdated += OnPointsUpdated; + } + + private void OnPointsUpdated(IMyFaction faction, int points) + { + if (!_factionLabels.ContainsKey(faction)) + return; + + _factionLabels[faction].Text = $"{points} GOAL{(points == 1 ? "" : "S")} LEFT"; + } + + public void Update() + { + if (_matchEnded) + return; + + _timerLabel.Text = _timer.RemainingTimeString(); + } + + public void MatchEnded(IMyFaction winner) + { + _matchEnded = true; + var winnerPoints = 0; + + _timerLabel?.Unregister(); + foreach (var label in _factionLabels) + label.Value.Unregister(); + + var winnerLabel = new LabelBox(_timerLabel) + { + Text = winner != null + ? $"A WINNER IS {winner.Name}." + : "YOU ARE ALL LOSERS", + ParentAlignment = ParentAlignments.Bottom, + Height = EliminationHud_TeamBanner.BaseHeight, + TextPadding = new Vector2(2.5f, 0), + Color = HudConstants.HudBackgroundColor + }; + + winnerLabel.TextBoard.SetFormatting(GlyphFormat.White.WithColor(Color.Red).WithSize(3) + .WithAlignment(TextAlignment.Center)); + } + } +} diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/TeamDeathMatch/TeamDeathmatchGamemode.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/TeamDeathMatch/TeamDeathmatchGamemode.cs index 1c006051f..8ab8ffdbc 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/TeamDeathMatch/TeamDeathmatchGamemode.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/TeamDeathMatch/TeamDeathmatchGamemode.cs @@ -139,7 +139,7 @@ public override void StopRound() if (!setWinnerFromArgs && MyAPIGateway.Session.IsServer) { if (WinningFaction == null) - WinningFaction = PointTracker.FactionPoints.MaxBy(f => f.Value).Key; + WinningFaction = PointTracker.GetHighestPoints(); Arguments = Arguments.Concat(new[] { $"win{WinningFaction?.FactionId ?? -1}" }).ToArray(); } diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameState/PointTracker.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameState/PointTracker.cs index d20ed34a5..f984cf3bb 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameState/PointTracker.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameState/PointTracker.cs @@ -2,11 +2,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using Sandbox.Game.Multiplayer; using Sandbox.ModAPI; using SC.SUGMA.HeartNetworking; using SC.SUGMA.HeartNetworking.Custom; -using SC.SUGMA.Utilities; using VRage.Game.ModAPI; namespace SC.SUGMA.GameState @@ -14,10 +12,10 @@ namespace SC.SUGMA.GameState internal class PointTracker : ComponentBase { private bool _pointsUpdated; - public int StartingPoints; - public int VictoryPoints = 3; + public readonly int StartingPoints; + public readonly int VictoryPoints; - public Dictionary FactionPoints { get; internal set; } = new Dictionary(); + protected Dictionary FactionPoints = new Dictionary(); public Action OnPointsUpdated = null; private void OnFactionCreated(long factionId) @@ -49,7 +47,7 @@ public override void UpdateTick() { if (_pointsUpdated && MyAPIGateway.Session.IsServer) { - HeartNetwork.I.SendToEveryone(new PointsPacket(this)); + HeartNetwork.I.SendToEveryone((PointsPacket) this); _pointsUpdated = false; } } @@ -70,6 +68,11 @@ public int GetFactionPoints(long factionId) return GetFactionPoints(MyAPIGateway.Session.Factions.TryGetFactionById(factionId)); } + public IMyFaction GetHighestPoints() + { + return FactionPoints.MaxBy(f => f.Value).Key; + } + public void SetFactionPoints(IMyFaction faction, int value) { if (!MyAPIGateway.Session.IsServer || !FactionPoints.ContainsKey(faction)) @@ -137,5 +140,7 @@ public override string ToString() sb.Append($"{faction.Key.Name}: {faction.Value}pts\n"); return sb.ToString(); } + + public static explicit operator PointsPacket(PointTracker tracker) => new PointsPacket(tracker.ComponentId, tracker.FactionPoints); } } \ No newline at end of file diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/HeartNetworking/Custom/PointsPacket.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/HeartNetworking/Custom/PointsPacket.cs index 7e6c18d1d..d798e645d 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/HeartNetworking/Custom/PointsPacket.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/HeartNetworking/Custom/PointsPacket.cs @@ -17,11 +17,11 @@ private PointsPacket() { } - public PointsPacket(PointTracker pointTracker) + public PointsPacket(string componentId, Dictionary points) { - _senderObjectId = pointTracker.ComponentId; + _senderObjectId = componentId; _points = new Dictionary(); - foreach (var factionKvp in pointTracker.FactionPoints) + foreach (var factionKvp in points) _points.Add(factionKvp.Key.FactionId, factionKvp.Value); //string data = ""; diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/SUGMA_SessionComponent.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/SUGMA_SessionComponent.cs index e863fb505..24e477159 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/SUGMA_SessionComponent.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/SUGMA_SessionComponent.cs @@ -11,14 +11,11 @@ using SC.SUGMA.GameModes.Elimination; using SC.SUGMA.GameModes.TeamDeathmatch; using SC.SUGMA.GameModes.KOTH; +using SC.SUGMA.GameModes.RocketCore; using SC.SUGMA.GameState; using SC.SUGMA.HeartNetworking; using SC.SUGMA.HeartNetworking.Custom; -using SC.SUGMA.Utilities; using VRage.Game.Components; -using VRage.Scripting; -using Sandbox.Game; -using VRageMath; namespace SC.SUGMA { @@ -38,6 +35,7 @@ internal class SUGMA_SessionComponent : MySessionComponentBase ["dom"] = new DominationGamemode(), ["tdm"] = new TeamDeathmatchGamemode(), ["koth"] = new KOTHGamemode(), + ["roc"] = new RocketCoreGamemode(), }; /// diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs index aec9bd4a1..b19f1603b 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs @@ -43,6 +43,9 @@ public static void SetDamageEnabled(bool value) public static void SetWorldPermissionsForMatch(bool matchActive) { + if (MyAPIGateway.Session == null) + return; + MyAPIGateway.Utilities.ShowMessage("SUGMA", $"Match global permissions {(matchActive ? "enabled" : "disabled")}."); diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/StarCore SUGMA Gamemodes.csproj.DotSettings b/Gamemode Mods/StarCore SUGMA Gamemodes/StarCore SUGMA Gamemodes.csproj.DotSettings index 07eaf28c4..53b65eeda 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/StarCore SUGMA Gamemodes.csproj.DotSettings +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/StarCore SUGMA Gamemodes.csproj.DotSettings @@ -2,4 +2,4 @@ True True True - True \ No newline at end of file + False \ No newline at end of file diff --git a/Gamemode Mods/Starcore_Pointslist/Data/Scripts/Additions/PointAdditions.cs b/Gamemode Mods/Starcore_Pointslist/Data/Scripts/Additions/PointAdditions.cs index 116889d45..c2975c0ad 100644 --- a/Gamemode Mods/Starcore_Pointslist/Data/Scripts/Additions/PointAdditions.cs +++ b/Gamemode Mods/Starcore_Pointslist/Data/Scripts/Additions/PointAdditions.cs @@ -188,19 +188,19 @@ internal class PointAdditions : MySessionComponentBase ["LargeBlockSmallHydrogenThrustIndustrial"] = 10, ["HugeHydrogenThruster"] = 200, - ["LargeBlockLargeThrust"] = 10, - ["AQD_LG_IonThrusterL_ArmoredSlope"] = 10, - ["AQD_LG_IonThrusterL_Armored"] = 10, - ["LargeBlockLargeThrustSciFi"] = 10, - ["LargeBlockLargeModularThruster"] = 10, - ["LargeBlockSmallThrust"] = 2, - ["AQD_LG_IonThrusterS_Armored"] = 2, - ["AQD_LG_IonThrusterS_ArmoredSlope"] = 2, - ["LargeBlockSmallThrustSciFi"] = 2, - ["SmallThrustSciFi"] = 2, - ["LargeBlockSmallModularThruster"] = 2, - ["AWGFocusDrive"] = 50, - ["IonHeavyCovered"] = 50, + ["LargeBlockLargeThrust"] = 20, + ["AQD_LG_IonThrusterL_ArmoredSlope"] = 20, + ["AQD_LG_IonThrusterL_Armored"] = 20, + ["LargeBlockLargeThrustSciFi"] = 20, + ["LargeBlockLargeModularThruster"] = 20, + ["LargeBlockSmallThrust"] = 4, + ["AQD_LG_IonThrusterS_Armored"] = 4, + ["AQD_LG_IonThrusterS_ArmoredSlope"] = 4, + ["LargeBlockSmallThrustSciFi"] = 4, + ["SmallThrustSciFi"] = 4, + ["LargeBlockSmallModularThruster"] = 4, + ["AWGFocusDrive"] = 100, + ["IonHeavyCovered"] = 100, ["AWGGG"] = 150, ["AQD_LG_AtmoThrusterS_ArmoredSlopeRev"] = 3, @@ -763,7 +763,7 @@ internal class PointAdditions : MySessionComponentBase ["Caster_Accelerator_0"] = 10, ["Caster_Accelerator_90"] = 40, ["Caster_Feeder"] = 10, - ["Caster_FocusLens"] = 250, + ["Caster_FocusLens"] = 50, ["Caster_Reactor"] = 125, ["Heat_Heatsink"] = 10, ["Heat_FlatRadiator"] = 10, @@ -953,12 +953,12 @@ private static MyTuple ClimbingCostRename(string blockDisplayName case "Shield Controller": case "Shield Controller Table": blockDisplayName = "Shield Controller"; - costMultiplier = 50.00f; + costMultiplier = 9999999f; break; case "Structural Integrity Field Generator": case "[SI] Generator Core": blockDisplayName = "Defensive Generator"; - costMultiplier = 50.00f; + costMultiplier = 9999999f; break; case "[FAS] Neptune Torpedo": blockDisplayName = "[FAS] Neptune Torpedo"; diff --git a/Gamemode Mods/Starcore_Sharetrack/Data/Scripts/ShipPoints/BuildingBlockPoints.cs b/Gamemode Mods/Starcore_Sharetrack/Data/Scripts/ShipPoints/BuildingBlockPoints.cs index 4d9f0eb99..0cf0a2668 100644 --- a/Gamemode Mods/Starcore_Sharetrack/Data/Scripts/ShipPoints/BuildingBlockPoints.cs +++ b/Gamemode Mods/Starcore_Sharetrack/Data/Scripts/ShipPoints/BuildingBlockPoints.cs @@ -2,6 +2,7 @@ using Sandbox.Game.Gui; using Sandbox.ModAPI; using StarCore.ShareTrack.API; +using VRage.Input; using VRageMath; using VRageRender; @@ -19,14 +20,26 @@ public BuildingBlockPoints() _pointsMessage = new HudAPIv2.HUDMessage(scale: 1f, font: "BI_SEOutlined", Message: new StringBuilder(""), origin: new Vector2D(-0.969, 0.57), blend: MyBillboard.BlendTypeEnum.PostPP); }; + + } private int _ticks; public void Update() { + if (MyAPIGateway.Input.WasKeyPress(MyKeys.D0)) + UpdateHud(null); + if (_ticks++ % 10 != 0) return; + if (MyAPIGateway.Session.ControlledObject is IMyShipController) + { + UpdateHud(null); + LastHeldSubtype = null; + return; + } + if (LastHeldSubtype != MyHud.BlockInfo?.DefinitionId.SubtypeName) { LastHeldSubtype = MyHud.BlockInfo?.DefinitionId.SubtypeName; diff --git a/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/CoreSys_API/CoreSystemsApiBase.cs b/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/CoreSys_API/CoreSystemsApiBase.cs new file mode 100644 index 000000000..26123bc6e --- /dev/null +++ b/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/CoreSys_API/CoreSystemsApiBase.cs @@ -0,0 +1,848 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using Sandbox.ModAPI; +using VRage; +using VRage.Utils; +using VRage.Collections; +using VRage.Game; +using VRage.Game.Entity; +using VRage.Game.ModAPI; +using VRageMath; + +namespace CoreSystems.Api +{ + /// + /// https://github.com/sstixrud/CoreSystems/blob/master/BaseData/Scripts/CoreSystems/Api/CoreSystemsApiBase.cs + /// + public partial class WcApi + { + private bool _apiInit; + + private Action> _getAllWeaponDefinitions; + private Action> _getCoreWeapons; + private Action> _getNpcSafeWeapons; + private Action>>>> _getAllWeaponMagazines; + private Action>>>> _getAllNpcSafeWeaponMagazines; + + private Action> _getCoreStaticLaunchers; + private Action> _getCoreTurrets; + private Action> _getCorePhantoms; + private Action> _getCoreRifles; + private Action> _getCoreArmors; + + private Action>>>>> _registerDamageEvent; + private Func, bool> _targetFocusHandler; + private Func, bool> _hudHandler; + private Func, bool> _shootHandler; + private Action> _monitorEvents; + private Action> _unmonitorEvents; + private Action> _addProjectileMonitor; + private Action> _removeProjectileMonitor; + + private Func _shootRequest; + + private Func> _getProjectileState; + private Action> _setProjectileState; + + private Action>> _getSortedThreats; + private Action> _getObstructions; + private Func _getAiFocus; + private Func _setAiFocus; + private Func _releaseAiFocus; + private Func _hasAi; + private Func _hasCoreWeapon; + + private Func _toggoleInfiniteResources; + private Action _disableRequiredPower; + + private Func _getPlayerController; + private Func> _getProjectilesLockedOn; + private Action> _getProjectilesLockedOnPos; + private Func _getMaxPower; + + private Func _getOptimalDps; + private Func _getConstructEffectiveDps; + private Func> _isInRange; + + private Func> _getWeaponTarget; + private Action _setWeaponTarget; + private Action _fireWeaponOnce; + private Action _toggleWeaponFire; + private Func _isWeaponReadyToFire; + private Func _getMaxWeaponRange; + private Func, int, bool> _getTurretTargetTypes; + private Action, int> _setTurretTargetTypes; + private Action _setBlockTrackingRange; + private Func _isTargetAligned; + private Func> _isTargetAlignedExtended; + private Func _canShootTarget; + private Func _getPredictedTargetPos; + private Func _getHeatLevel; + private Func _currentPowerConsumption; + private Func _getActiveAmmo; + private Action _setActiveAmmo; + + private Func _getWeaponAzimuthMatrix; + private Func _getWeaponElevationMatrix; + private Func _isTargetValid; + private Func _isWeaponShooting; + private Func _getShotsFired; + private Action>> _getMuzzleInfo; + private Func> _getWeaponScope; + private Func> _getMagazineMap; + private Func _setMagazine; + private Func _forceReload; + + private Action _setRofMultiplier; + private Action _setBaseDmgMultiplier; + private Action _setAreaDmgMultiplier; + private Action _setAreaRadiusMultiplier; + private Action _setVelocityMultiplier; + private Action _setFiringAllowed; + + private Func _getRofMultiplier; + private Func _getBaseDmgMultiplier; + private Func _getAreaDmgMultiplier; + private Func _getAreaRadiusMultiplier; + private Func _getVelocityMultiplier; + private Func _getFiringAllowed; + + + /// + /// Multiplier for 's base Rate of Fire. + /// + /// + /// + public void SetRofMultiplier(MyEntity block, float rof) => + _setRofMultiplier?.Invoke(block, rof); + + /// + /// BaseDamage multiplier for all projectiles from . + /// + /// + /// + public void SetBaseDmgMultiplier(MyEntity block, float multiplier) => _setBaseDmgMultiplier?.Invoke(block, multiplier); + + /// + /// AreaDamage multiplier for all projectiles from . + /// + /// + /// + public void SetAreaDmgMultiplier(MyEntity block, float multiplier) => _setAreaDmgMultiplier?.Invoke(block, multiplier); + + /// + /// AreaRadius multiplier for all projectiles from . + /// + /// + /// + public void SetAreaRadiusMultiplier(MyEntity block, float multiplier) => _setAreaRadiusMultiplier?.Invoke(block, multiplier); + + /// + /// Velocity multiplier for all projectiles from . Avoid setting this to zero. + /// + /// + /// + public void SetVelocityMultiplier(MyEntity block, float multiplier) => _setVelocityMultiplier?.Invoke(block, multiplier); + + /// + /// Toggles whether is allowed to shoot. + /// + /// + /// + public void SetFiringAllowed(MyEntity block, bool isAllowed) => _setFiringAllowed?.Invoke(block, isAllowed); + + public void SetWeaponTarget(MyEntity weapon, MyEntity target, int weaponId = 0) => + _setWeaponTarget?.Invoke(weapon, target, weaponId); + + /// + /// Multiplier for 's base Rate of Fire. + /// + /// + public float GetRofMultiplier(MyEntity block) => _getRofMultiplier?.Invoke(block) ?? -2; + + /// + /// BaseDamage multiplier for all projectiles from . + /// + /// + /// + public float GetBaseDmgMultiplier(MyEntity block) => _getBaseDmgMultiplier?.Invoke(block) ?? -2; + + /// + /// AreaDamage multiplier for all projectiles from . + /// + /// + /// + public float GetAreaDmgMultiplier(MyEntity block) => _getAreaDmgMultiplier?.Invoke(block) ?? -2; + + /// + /// AreaDamage multiplier for all projectiles from . + /// + /// + /// + public float GetAreaRadiusMultiplier(MyEntity block) => _getAreaRadiusMultiplier?.Invoke(block) ?? -2; + + /// + /// Velocity multiplier for all projectiles from . Avoid setting this to zero. + /// + /// + /// + public float GetVelocityMultiplier(MyEntity block) => _getVelocityMultiplier?.Invoke(block) ?? -2; + + /// + /// Toggles whether is allowed to shoot. + /// + /// + /// + public bool GetFiringAllowed(MyEntity block) => _getFiringAllowed?.Invoke(block) ?? false; + + public void FireWeaponOnce(MyEntity weapon, bool allWeapons = true, int weaponId = 0) => + _fireWeaponOnce?.Invoke(weapon, allWeapons, weaponId); + + public void ToggleWeaponFire(MyEntity weapon, bool on, bool allWeapons, int weaponId = 0) => + _toggleWeaponFire?.Invoke(weapon, on, allWeapons, weaponId); + + public bool IsWeaponReadyToFire(MyEntity weapon, int weaponId = 0, bool anyWeaponReady = true, + bool shootReady = false) => + _isWeaponReadyToFire?.Invoke(weapon, weaponId, anyWeaponReady, shootReady) ?? false; + + public float GetMaxWeaponRange(MyEntity weapon, int weaponId) => + _getMaxWeaponRange?.Invoke(weapon, weaponId) ?? 0f; + + public bool GetTurretTargetTypes(MyEntity weapon, IList collection, int weaponId = 0) => + _getTurretTargetTypes?.Invoke(weapon, collection, weaponId) ?? false; + + public void SetTurretTargetTypes(MyEntity weapon, IList collection, int weaponId = 0) => + _setTurretTargetTypes?.Invoke(weapon, collection, weaponId); + + public void SetBlockTrackingRange(MyEntity weapon, float range) => + _setBlockTrackingRange?.Invoke(weapon, range); + + public bool IsTargetAligned(MyEntity weapon, MyEntity targetEnt, int weaponId) => + _isTargetAligned?.Invoke(weapon, targetEnt, weaponId) ?? false; + + public MyTuple IsTargetAlignedExtended(MyEntity weapon, MyEntity targetEnt, int weaponId) => + _isTargetAlignedExtended?.Invoke(weapon, targetEnt, weaponId) ?? new MyTuple(); + + public bool CanShootTarget(MyEntity weapon, MyEntity targetEnt, int weaponId) => + _canShootTarget?.Invoke(weapon, targetEnt, weaponId) ?? false; + + public Vector3D? GetPredictedTargetPosition(MyEntity weapon, MyEntity targetEnt, int weaponId) => + _getPredictedTargetPos?.Invoke(weapon, targetEnt, weaponId) ?? null; + + public float GetHeatLevel(MyEntity weapon) => _getHeatLevel?.Invoke(weapon) ?? 0f; + public float GetCurrentPower(MyEntity weapon) => _currentPowerConsumption?.Invoke(weapon) ?? 0f; + public void DisableRequiredPower(MyEntity weapon) => _disableRequiredPower?.Invoke(weapon); + public bool HasCoreWeapon(MyEntity weapon) => _hasCoreWeapon?.Invoke(weapon) ?? false; + + public string GetActiveAmmo(MyEntity weapon, int weaponId) => + _getActiveAmmo?.Invoke(weapon, weaponId) ?? null; + + public void SetActiveAmmo(MyEntity weapon, int weaponId, string ammoType) => + _setActiveAmmo?.Invoke(weapon, weaponId, ammoType); + + public long GetPlayerController(MyEntity weapon) => _getPlayerController?.Invoke(weapon) ?? -1; + + public Matrix GetWeaponAzimuthMatrix(MyEntity weapon, int weaponId) => + _getWeaponAzimuthMatrix?.Invoke(weapon, weaponId) ?? Matrix.Zero; + + public Matrix GetWeaponElevationMatrix(MyEntity weapon, int weaponId) => + _getWeaponElevationMatrix?.Invoke(weapon, weaponId) ?? Matrix.Zero; + + public bool IsTargetValid(MyEntity weapon, MyEntity target, bool onlyThreats, bool checkRelations) => + _isTargetValid?.Invoke(weapon, target, onlyThreats, checkRelations) ?? false; + + public void GetAllWeaponDefinitions(IList collection) => _getAllWeaponDefinitions?.Invoke(collection); + public void GetAllCoreWeapons(ICollection collection) => _getCoreWeapons?.Invoke(collection); + public void GetNpcSafeWeapons(ICollection collection) => _getNpcSafeWeapons?.Invoke(collection); + + public void GetAllCoreStaticLaunchers(ICollection collection) => _getCoreStaticLaunchers?.Invoke(collection); + public void GetAllWeaponMagazines(IDictionary>>> collection) => _getAllWeaponMagazines?.Invoke(collection); + public void GetAllNpcSafeWeaponMagazines(IDictionary>>> collection) => _getAllNpcSafeWeaponMagazines?.Invoke(collection); + + public void GetAllCoreTurrets(ICollection collection) => _getCoreTurrets?.Invoke(collection); + public void GetAllCorePhantoms(ICollection collection) => _getCorePhantoms?.Invoke(collection); + public void GetAllCoreRifles(ICollection collection) => _getCoreRifles?.Invoke(collection); + public void GetAllCoreArmors(IList collection) => _getCoreArmors?.Invoke(collection); + + public MyTuple GetProjectilesLockedOn(MyEntity victim) => + _getProjectilesLockedOn?.Invoke(victim) ?? new MyTuple(); + public void GetProjectilesLockedOnPos(MyEntity victim, ICollection collection) => + _getProjectilesLockedOnPos?.Invoke(victim, collection); + public void GetSortedThreats(MyEntity shooter, ICollection> collection) => + _getSortedThreats?.Invoke(shooter, collection); + public void GetObstructions(MyEntity shooter, ICollection collection) => + _getObstructions?.Invoke(shooter, collection); + public MyEntity GetAiFocus(MyEntity shooter, int priority = 0) => _getAiFocus?.Invoke(shooter, priority); + public bool SetAiFocus(MyEntity shooter, MyEntity target, int priority = 0) => + _setAiFocus?.Invoke(shooter, target, priority) ?? false; + public bool ReleaseAiFocus(MyEntity shooter, long playerId) => + _releaseAiFocus?.Invoke(shooter, playerId) ?? false; + public MyTuple GetWeaponTarget(MyEntity weapon, int weaponId = 0) => + _getWeaponTarget?.Invoke(weapon, weaponId) ?? new MyTuple(); + public float GetMaxPower(MyDefinitionId weaponDef) => _getMaxPower?.Invoke(weaponDef) ?? 0f; + public bool HasAi(MyEntity entity) => _hasAi?.Invoke(entity) ?? false; + public float GetOptimalDps(MyEntity entity) => _getOptimalDps?.Invoke(entity) ?? 0f; + public MyTuple GetProjectileState(ulong projectileId) => + _getProjectileState?.Invoke(projectileId) ?? new MyTuple(); + + public float GetConstructEffectiveDps(MyEntity entity) => _getConstructEffectiveDps?.Invoke(entity) ?? 0f; + public MyTuple GetWeaponScope(MyEntity weapon, int weaponId) => + _getWeaponScope?.Invoke(weapon, weaponId) ?? new MyTuple(); + + public void AddProjectileCallback(MyEntity entity, int weaponId, Action action) => + _addProjectileMonitor?.Invoke(entity, weaponId, action); + + public void RemoveProjectileCallback(MyEntity entity, int weaponId, Action action) => + _removeProjectileMonitor?.Invoke(entity, weaponId, action); + + + // block/grid/player, Threat, Other + public MyTuple IsInRange(MyEntity entity) => + _isInRange?.Invoke(entity) ?? new MyTuple(); + + /// + /// Set projectile values *Warning* be sure to pass in Vector3D.MinValue or float.MinValue to NOT set that value. + /// bool = EndNow + /// Vector3D Position + /// Vector3D Additive velocity + /// float BaseDamagePool + /// + /// + /// + public void SetProjectileState(ulong projectileId, MyTuple values) => + _setProjectileState?.Invoke(projectileId, values); + + /// + /// Gets whether the weapon is shooting, used by Hakerman's Beam Logic + /// Unexpected behavior may occur when using this method + /// + /// + /// + /// + internal bool IsWeaponShooting(MyEntity weaponBlock, int weaponId) => _isWeaponShooting?.Invoke(weaponBlock, weaponId) ?? false; + + /// + /// Gets how many shots the weapon fired, used by Hakerman's Beam Logic + /// Unexpected behavior may occur when using this method + /// + /// + /// + /// + internal int GetShotsFired(MyEntity weaponBlock, int weaponId) => _getShotsFired?.Invoke(weaponBlock, weaponId) ?? -1; + + /// + /// Gets the info of the weapon's all muzzles, used by Hakerman's Beam Logic + /// returns: A list that contains every muzzle's Position, LocalPosition, Direction, UpDirection, ParentMatrix, DummyMatrix + /// Unexpected behavior may occur when using this method + /// + /// + /// + /// + internal void GetMuzzleInfo(MyEntity weaponBlock, int weaponId, List> output) => + _getMuzzleInfo?.Invoke(weaponBlock, weaponId, output); + + /// + /// Entity can be a weapon or a grid/player (enables on all subgrids as well) + /// + /// + /// + public bool ToggleInfiniteResources(MyEntity entity) => + _toggoleInfiniteResources?.Invoke(entity) ?? false; + + /// + /// Monitor various kind of events, see WcApiDef.WeaponDefinition.AnimationDef.PartAnimationSetDef.EventTriggers for int mapping, bool is for active/inactive + /// + /// + /// + /// + /// + public void MonitorEvents(MyEntity entity, int partId, Action action) => + _monitorEvents?.Invoke(entity, partId, action); + + /// + /// Monitor various kind of events, see WcApiDef.WeaponDefinition.AnimationDef.PartAnimationSetDef.EventTriggers for int mapping, bool is for active/inactive + /// + /// + /// + /// + /// + public void UnMonitorEvents(MyEntity entity, int partId, Action action) => + _unmonitorEvents?.Invoke(entity, partId, action); + + /// + /// Monitor all weaponcore damage + /// + /// + /// 0 unregister, 1 register + /// object casts (ulong = projectileId, IMySlimBlock, MyFloatingObject, IMyCharacter, MyVoxelBase, MyPlanet, MyEntity Shield see next line) + /// You can detect the shield entity in a performant way by creating a hash check ShieldHash = MyStringHash.GetOrCompute("DefenseShield"); + /// then use it by Session.ShieldApiLoaded && Session.ShieldHash == ent.DefinitionId?.SubtypeId && ent.Render.Visible; Visible means shield online + public void RegisterDamageEvent(long modId, int type, Action>>>> callback) + { + _registerDamageEvent?.Invoke(modId, type, callback); + } + + /// + /// This allows you to determine when and if a player can modify the current target focus on a player/grid/phantonm. Use only on server + /// + /// is the player/grid/phantom you want to control the target focus for, applies to subgrids as well + /// be sure to unregister when you no longer want to receive callbacks + public void TargetFocushandler(long handledEntityId, bool unregister) + { + _targetFocusHandler(handledEntityId, unregister, TargetFocusCallback); + } + + /// + /// This callback fires whenever a player attempts to modify the target focus + /// + /// + /// + /// + /// + /// + private bool TargetFocusCallback(MyEntity target, IMyCharacter requestingCharacter, long handledEntityId, int modeCode) + { + var mode = (ChangeMode)modeCode; + + return true; + } + + public enum ChangeMode + { + Add, + Release, + Lock, + } + /// + /// Enables you to allow/deny hud draw requests. Do not use this on dedicated server. + /// + /// + /// + public void Hudhandler(long handledEntityId, bool unregister) + { + _hudHandler?.Invoke(handledEntityId, unregister, HudCallback); + } + + /// + /// This callback fires whenever the hud tries to update + /// + /// + /// + /// + /// + private bool HudCallback(IMyCharacter requestingCharacter, long handledEntityId, int modeCode) + { + var mode = (HudMode)modeCode; + + return true; + } + + internal enum HudMode + { + Selector, + Reload, + TargetInfo, + Lead, + Drone, + PainterMarks, + } + + /// + /// + /// + /// + /// MyEntity, ulong (projectile) or Vector3D + /// Most weapons have only id 0, but some are multi-weapon entities + /// + /// + public bool ShootRequest(MyEntity weaponEntity, object target, int weaponId = 0, double additionalDeviateShotAngle = 0) => _shootRequest?.Invoke(weaponEntity, target, weaponId, additionalDeviateShotAngle) ?? false; + + /// + /// Enables you to monitor and approve shoot requests for this weapon/construct/player/grid network + /// + /// + /// + /// + public void ShootRequestHandler(long handledEntityId, bool unregister, Func callback) + { + _shootHandler?.Invoke(handledEntityId, unregister, callback); // see example callback below + } + + /// + /// This callback fires whenever a shoot request is being evaluated for against a success criteria or is pending some action + /// + /// + /// + /// This is the state of your request, state 0 means proceeding as requested + /// This is false if wc thinks the target is occluded, you can choose to allow it to proceed anyway or not + /// valid objects to cast too are MyEntity, ulong (projectile ids) and target Vector3Ds + /// + /// + /// The number of times this callback will fire will depend on the relevant firing stages for this weapon/ammo and how far it gets + /// + private bool ShootCallBack(Vector3D scopePos, Vector3D scopeDirection, int requestState, bool hasLos, object target, int currentAmmo, int remainingMags, int requestStage) + { + var stage = (EventTriggers)requestStage; + var state = (ShootState)requestState; + var targetAsEntity = target as MyEntity; + var targetAsProjectileId = target as ulong? ?? 0; + var targetAsPosition = target as Vector3D? ?? Vector3D.Zero; + + return true; + } + + public enum ShootState + { + EventStart, + EventEnd, + Preceding, + Canceled, + } + + public enum EventTriggers + { + Reloading, + Firing, + Tracking, + Overheated, + TurnOn, + TurnOff, + BurstReload, + NoMagsToLoad, + PreFire, + EmptyOnGameLoad, + StopFiring, + StopTracking, + LockDelay, + Init, + Homing, + TargetAligned, + WhileOn, + TargetRanged100, + TargetRanged75, + TargetRanged50, + TargetRanged25, + } + + /// + /// Get active ammo Mag map from weapon + /// + /// + /// + /// Mag definitionId, mag name, ammoRound name, weapon must aim (not manual aim) true/false + public MyTuple GetMagazineMap(MyEntity weapon, int weaponId) + { + return _getMagazineMap?.Invoke(weapon, weaponId) ?? new MyTuple(); + } + + /// + /// Set the active ammo type via passing Mag DefinitionId + /// + /// + /// + /// + /// + /// + public bool SetMagazine(MyEntity weapon, int weaponId, MyDefinitionId id, bool forceReload) + { + return _setMagazine?.Invoke(weapon, weaponId, id, forceReload) ?? false; + + } + + /// + /// + /// + /// + /// + /// + public bool ForceReload(MyEntity weapon, int weaponId) + { + return _forceReload?.Invoke(weapon, weaponId) ?? false; + + } + + private const long Channel = 67549756549; + private bool _getWeaponDefinitions; + private bool _isRegistered; + private Action _readyCallback; + + /// + /// True if CoreSystems replied when got called. + /// + public bool IsReady { get; private set; } + + /// + /// Only filled if giving true to . + /// + public readonly List WeaponDefinitions = new List(); + + /// + /// Ask CoreSystems to send the API methods. + /// Throws an exception if it gets called more than once per session without . + /// + /// Method to be called when CoreSystems replies. + /// Set to true to fill . + public void Load(Action readyCallback = null, bool getWeaponDefinitions = false) + { + if (_isRegistered) + throw new Exception($"{GetType().Name}.Load() should not be called multiple times!"); + + _readyCallback = readyCallback; + _getWeaponDefinitions = getWeaponDefinitions; + _isRegistered = true; + MyAPIGateway.Utilities.RegisterMessageHandler(Channel, HandleMessage); + MyAPIGateway.Utilities.SendModMessage(Channel, "ApiEndpointRequest"); + } + + public void Unload() + { + MyAPIGateway.Utilities.UnregisterMessageHandler(Channel, HandleMessage); + + ApiAssign(null); + + _isRegistered = false; + _apiInit = false; + IsReady = false; + } + + private void HandleMessage(object obj) + { + if (_apiInit || obj is string + ) // the sent "ApiEndpointRequest" will also be received here, explicitly ignoring that + return; + + var dict = obj as IReadOnlyDictionary; + + if (dict == null) + return; + + ApiAssign(dict, _getWeaponDefinitions); + + IsReady = true; + _readyCallback?.Invoke(); + } + + public void ApiAssign(IReadOnlyDictionary delegates, bool getWeaponDefinitions = false) + { + _apiInit = (delegates != null); + /// base methods + try + { + AssignMethod(delegates, "SetRofMultiplier", ref _setRofMultiplier); + AssignMethod(delegates, "SetBaseDmgMultiplier", ref _setBaseDmgMultiplier); + AssignMethod(delegates, "SetAreaDmgMultiplier", ref _setAreaDmgMultiplier); + AssignMethod(delegates, "SetAreaRadiusMultiplier", ref _setAreaRadiusMultiplier); + AssignMethod(delegates, "SetVelocityMultiplier", ref _setVelocityMultiplier); + AssignMethod(delegates, "SetFiringAllowed", ref _setFiringAllowed); + + AssignMethod(delegates, "GetRofMultiplier", ref _getRofMultiplier); + AssignMethod(delegates, "GetBaseDmgMultiplier", ref _getBaseDmgMultiplier); + AssignMethod(delegates, "GetAreaDmgMultiplier", ref _getAreaDmgMultiplier); + AssignMethod(delegates, "GetAreaRadiusMultiplier", ref _getAreaRadiusMultiplier); + AssignMethod(delegates, "GetVelocityMultiplier", ref _getVelocityMultiplier); + AssignMethod(delegates, "GetFiringAllowed", ref _getFiringAllowed); + } + catch (Exception e) + { + MyLog.Default.WriteLineAndConsole($"{e}"); // write to game's log + } + + AssignMethod(delegates, "GetAllWeaponDefinitions", ref _getAllWeaponDefinitions); + AssignMethod(delegates, "GetCoreWeapons", ref _getCoreWeapons); + AssignMethod(delegates, "GetNpcSafeWeapons", ref _getNpcSafeWeapons); + + AssignMethod(delegates, "GetAllWeaponMagazines", ref _getAllWeaponMagazines); + AssignMethod(delegates, "GetAllNpcSafeWeaponMagazines", ref _getAllNpcSafeWeaponMagazines); + + AssignMethod(delegates, "GetCoreStaticLaunchers", ref _getCoreStaticLaunchers); + AssignMethod(delegates, "GetCoreTurrets", ref _getCoreTurrets); + AssignMethod(delegates, "GetCorePhantoms", ref _getCorePhantoms); + AssignMethod(delegates, "GetCoreRifles", ref _getCoreRifles); + AssignMethod(delegates, "GetCoreArmors", ref _getCoreArmors); + + AssignMethod(delegates, "GetBlockWeaponMap", ref _getBlockWeaponMap); + AssignMethod(delegates, "GetSortedThreatsBase", ref _getSortedThreats); + AssignMethod(delegates, "GetObstructionsBase", ref _getObstructions); + AssignMethod(delegates, "GetMaxPower", ref _getMaxPower); + AssignMethod(delegates, "GetProjectilesLockedOnBase", ref _getProjectilesLockedOn); + AssignMethod(delegates, "GetProjectilesLockedOnPos", ref _getProjectilesLockedOnPos); + AssignMethod(delegates, "GetAiFocusBase", ref _getAiFocus); + AssignMethod(delegates, "SetAiFocusBase", ref _setAiFocus); + AssignMethod(delegates, "ReleaseAiFocusBase", ref _releaseAiFocus); + AssignMethod(delegates, "HasGridAiBase", ref _hasAi); + AssignMethod(delegates, "GetOptimalDpsBase", ref _getOptimalDps); + AssignMethod(delegates, "GetConstructEffectiveDpsBase", ref _getConstructEffectiveDps); + AssignMethod(delegates, "IsInRangeBase", ref _isInRange); + AssignMethod(delegates, "GetProjectileState", ref _getProjectileState); + AssignMethod(delegates, "SetProjectileState", ref _setProjectileState); + + AssignMethod(delegates, "AddMonitorProjectile", ref _addProjectileMonitor); + AssignMethod(delegates, "RemoveMonitorProjectile", ref _removeProjectileMonitor); + + AssignMethod(delegates, "TargetFocusHandler", ref _targetFocusHandler); + AssignMethod(delegates, "HudHandler", ref _hudHandler); + AssignMethod(delegates, "ShootHandler", ref _shootHandler); + AssignMethod(delegates, "ShootRequest", ref _shootRequest); + + /// block methods + AssignMethod(delegates, "GetWeaponTargetBase", ref _getWeaponTarget); + AssignMethod(delegates, "SetWeaponTargetBase", ref _setWeaponTarget); + AssignMethod(delegates, "FireWeaponOnceBase", ref _fireWeaponOnce); + AssignMethod(delegates, "ToggleWeaponFireBase", ref _toggleWeaponFire); + AssignMethod(delegates, "IsWeaponReadyToFireBase", ref _isWeaponReadyToFire); + AssignMethod(delegates, "GetMaxWeaponRangeBase", ref _getMaxWeaponRange); + AssignMethod(delegates, "GetTurretTargetTypesBase", ref _getTurretTargetTypes); + AssignMethod(delegates, "SetTurretTargetTypesBase", ref _setTurretTargetTypes); + AssignMethod(delegates, "SetBlockTrackingRangeBase", ref _setBlockTrackingRange); + AssignMethod(delegates, "IsTargetAlignedBase", ref _isTargetAligned); + AssignMethod(delegates, "IsTargetAlignedExtendedBase", ref _isTargetAlignedExtended); + AssignMethod(delegates, "CanShootTargetBase", ref _canShootTarget); + AssignMethod(delegates, "GetPredictedTargetPositionBase", ref _getPredictedTargetPos); + AssignMethod(delegates, "GetHeatLevelBase", ref _getHeatLevel); + AssignMethod(delegates, "GetCurrentPowerBase", ref _currentPowerConsumption); + AssignMethod(delegates, "DisableRequiredPowerBase", ref _disableRequiredPower); + AssignMethod(delegates, "HasCoreWeaponBase", ref _hasCoreWeapon); + AssignMethod(delegates, "GetActiveAmmoBase", ref _getActiveAmmo); + AssignMethod(delegates, "SetActiveAmmoBase", ref _setActiveAmmo); + AssignMethod(delegates, "GetPlayerControllerBase", ref _getPlayerController); + AssignMethod(delegates, "GetWeaponAzimuthMatrixBase", ref _getWeaponAzimuthMatrix); + AssignMethod(delegates, "GetWeaponElevationMatrixBase", ref _getWeaponElevationMatrix); + AssignMethod(delegates, "IsTargetValidBase", ref _isTargetValid); + AssignMethod(delegates, "GetWeaponScopeBase", ref _getWeaponScope); + + //Hakerman's Beam Logic + AssignMethod(delegates, "IsWeaponShootingBase", ref _isWeaponShooting); + AssignMethod(delegates, "GetShotsFiredBase", ref _getShotsFired); + AssignMethod(delegates, "GetMuzzleInfoBase", ref _getMuzzleInfo); + AssignMethod(delegates, "ToggleInfiniteAmmoBase", ref _toggoleInfiniteResources); + AssignMethod(delegates, "RegisterEventMonitor", ref _monitorEvents); + AssignMethod(delegates, "UnRegisterEventMonitor", ref _unmonitorEvents); + AssignMethod(delegates, "GetMagazineMap", ref _getMagazineMap); + + AssignMethod(delegates, "SetMagazine", ref _setMagazine); + AssignMethod(delegates, "ForceReload", ref _forceReload); + + // Damage handler + AssignMethod(delegates, "DamageHandler", ref _registerDamageEvent); + + if (getWeaponDefinitions) + { + var byteArrays = new List(); + GetAllWeaponDefinitions(byteArrays); + foreach (var byteArray in byteArrays) + WeaponDefinitions.Add(MyAPIGateway.Utilities.SerializeFromBinary(byteArray)); + } + } + + private void AssignMethod(IReadOnlyDictionary delegates, string name, ref T field) + where T : class + { + if (delegates == null) + { + field = null; + return; + } + + Delegate del; + if (!delegates.TryGetValue(name, out del)) + throw new Exception($"{GetType().Name} :: Couldn't find {name} delegate of type {typeof(T)}"); + + field = del as T; + + if (field == null) + throw new Exception( + $"{GetType().Name} :: Delegate {name} is not type {typeof(T)}, instead it's: {del.GetType()}"); + } + + public class DamageHandlerHelper + { + public void YourCallBackFunction(List list) + { + // Your code goes here + // + // Once this function completes the data in the list will be deleted... if you need to use the data in this list + // after this function completes make a copy of it. + // + // This is setup to be easy to use. If you need more performance modify the Default Callback for your purposes and avoid + // copying callbacks into new lists with ProjectileDamageEvent structs. Note that the ListReader will remain usable for only 1 tick, then it will be cleared by wc. + // + } + + + /// Don't touch anything below this line + public void RegisterForDamage(long modId, EventType type) + { + _wcApi.RegisterDamageEvent(modId, (int)type, DefaultCallBack); + } + + private void DefaultCallBack(ListReader>>> listReader) + { + YourCallBackFunction(ProcessEvents(listReader)); + CleanUpEvents(); + } + + private readonly List _convertedObjects = new List(); + private readonly Stack> _hitPool = new Stack>(256); + + private List ProcessEvents(ListReader>>> projectiles) + { + foreach (var p in projectiles) + { + var hits = _hitPool.Count > 0 ? _hitPool.Pop() : new List(); + + foreach (var hitObj in p.Item6) + { + hits.Add(new ProjectileDamageEvent.ProHit { HitPosition = hitObj.Item1, ObjectHit = hitObj.Item2, Damage = hitObj.Item3 }); + } + _convertedObjects.Add(new ProjectileDamageEvent { ProId = p.Item1, PlayerId = p.Item2, WeaponId = p.Item3, WeaponEntity = p.Item4, WeaponParent = p.Item5, ObjectsHit = hits }); + } + + return _convertedObjects; + } + + private void CleanUpEvents() + { + foreach (var p in _convertedObjects) + { + p.ObjectsHit.Clear(); + _hitPool.Push(p.ObjectsHit); + } + _convertedObjects.Clear(); + } + + public struct ProjectileDamageEvent + { + public ulong ProId; + public long PlayerId; + public int WeaponId; + public MyEntity WeaponEntity; + public MyEntity WeaponParent; + public List ObjectsHit; + + public struct ProHit + { + public Vector3D HitPosition; // To == first hit, From = projectile start position this frame + public object ObjectHit; // block, player, etc... + public float Damage; + } + } + + + private readonly WcApi _wcApi; + public DamageHandlerHelper(WcApi wcApi) + { + _wcApi = wcApi; + } + + public enum EventType + { + Unregister, + SystemWideDamageEvents, + } + } + + } + +} \ No newline at end of file diff --git a/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/CoreSys_API/CoreSystemsApiBlocks.cs b/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/CoreSys_API/CoreSystemsApiBlocks.cs new file mode 100644 index 000000000..1de759988 --- /dev/null +++ b/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/CoreSys_API/CoreSystemsApiBlocks.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using Sandbox.ModAPI; + +namespace CoreSystems.Api +{ + /// + /// https://github.com/sstixrud/CoreSystems/blob/master/BaseData/Scripts/CoreSystems/Api/CoreSystemsApiBlocks.cs + /// + public partial class WcApi + { + private Func, bool> _getBlockWeaponMap; + + public bool GetBlockWeaponMap(IMyTerminalBlock weaponBlock, IDictionary collection) => + _getBlockWeaponMap?.Invoke(weaponBlock, collection) ?? false; + } +} diff --git a/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/CoreSys_API/CoreSystemsApiDefs.cs b/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/CoreSys_API/CoreSystemsApiDefs.cs new file mode 100644 index 000000000..1f639f6a2 --- /dev/null +++ b/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/CoreSys_API/CoreSystemsApiDefs.cs @@ -0,0 +1,1541 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using ProtoBuf; +using VRageMath; + +namespace CoreSystems.Api +{ + public static class WcApiDef + { + [ProtoContract] + public class ContainerDefinition + { + [ProtoMember(1)] internal WeaponDefinition[] WeaponDefs; + [ProtoMember(2)] internal ArmorDefinition[] ArmorDefs; + [ProtoMember(3)] internal UpgradeDefinition[] UpgradeDefs; + [ProtoMember(4)] internal SupportDefinition[] SupportDefs; + } + + [ProtoContract] + public class ConsumeableDef + { + [ProtoMember(1)] internal string ItemName; + [ProtoMember(2)] internal string InventoryItem; + [ProtoMember(3)] internal int ItemsNeeded; + [ProtoMember(4)] internal bool Hybrid; + [ProtoMember(5)] internal float EnergyCost; + [ProtoMember(6)] internal float Strength; + } + + [ProtoContract] + public class UpgradeDefinition + { + [ProtoMember(1)] internal ModelAssignmentsDef Assignments; + [ProtoMember(2)] internal HardPointDef HardPoint; + [ProtoMember(3)] internal WeaponDefinition.AnimationDef Animations; + [ProtoMember(4)] internal string ModPath; + [ProtoMember(5)] internal ConsumeableDef[] Consumable; + + [ProtoContract] + public struct ModelAssignmentsDef + { + [ProtoMember(1)] internal MountPointDef[] MountPoints; + + [ProtoContract] + public struct MountPointDef + { + [ProtoMember(1)] internal string SubtypeId; + [ProtoMember(2)] internal float DurabilityMod; + [ProtoMember(3)] internal string IconName; + } + } + + [ProtoContract] + public struct HardPointDef + { + [ProtoMember(1)] internal string PartName; + [ProtoMember(2)] internal HardwareDef HardWare; + [ProtoMember(3)] internal UiDef Ui; + [ProtoMember(4)] internal OtherDef Other; + + [ProtoContract] + public struct UiDef + { + [ProtoMember(1)] internal bool StrengthModifier; + } + + [ProtoContract] + public struct HardwareDef + { + public enum HardwareType + { + Default, + } + + [ProtoMember(1)] internal float InventorySize; + [ProtoMember(2)] internal HardwareType Type; + [ProtoMember(3)] internal int BlockDistance; + + } + + [ProtoContract] + public struct OtherDef + { + [ProtoMember(1)] internal int ConstructPartCap; + [ProtoMember(2)] internal int EnergyPriority; + [ProtoMember(3)] internal bool Debug; + [ProtoMember(4)] internal double RestrictionRadius; + [ProtoMember(5)] internal bool CheckInflatedBox; + [ProtoMember(6)] internal bool CheckForAnySupport; + [ProtoMember(7)] internal bool StayCharged; + } + } + } + + [ProtoContract] + public class SupportDefinition + { + [ProtoMember(1)] internal ModelAssignmentsDef Assignments; + [ProtoMember(2)] internal HardPointDef HardPoint; + [ProtoMember(3)] internal WeaponDefinition.AnimationDef Animations; + [ProtoMember(4)] internal string ModPath; + [ProtoMember(5)] internal ConsumeableDef[] Consumable; + [ProtoMember(6)] internal SupportEffect Effect; + + [ProtoContract] + public struct ModelAssignmentsDef + { + [ProtoMember(1)] internal MountPointDef[] MountPoints; + + [ProtoContract] + public struct MountPointDef + { + [ProtoMember(1)] internal string SubtypeId; + [ProtoMember(2)] internal float DurabilityMod; + [ProtoMember(3)] internal string IconName; + } + } + [ProtoContract] + public struct HardPointDef + { + [ProtoMember(1)] internal string PartName; + [ProtoMember(2)] internal HardwareDef HardWare; + [ProtoMember(3)] internal UiDef Ui; + [ProtoMember(4)] internal OtherDef Other; + + [ProtoContract] + public struct UiDef + { + [ProtoMember(1)] internal bool ProtectionControl; + } + + [ProtoContract] + public struct HardwareDef + { + [ProtoMember(1)] internal float InventorySize; + } + + [ProtoContract] + public struct OtherDef + { + [ProtoMember(1)] internal int ConstructPartCap; + [ProtoMember(2)] internal int EnergyPriority; + [ProtoMember(3)] internal bool Debug; + [ProtoMember(4)] internal double RestrictionRadius; + [ProtoMember(5)] internal bool CheckInflatedBox; + [ProtoMember(6)] internal bool CheckForAnySupport; + [ProtoMember(7)] internal bool StayCharged; + } + } + + [ProtoContract] + public struct SupportEffect + { + public enum AffectedBlocks + { + Armor, + ArmorPlus, + PlusFunctional, + All, + } + + public enum Protections + { + KineticProt, + EnergeticProt, + GenericProt, + Regenerate, + Structural, + } + + [ProtoMember(1)] internal Protections Protection; + [ProtoMember(2)] internal AffectedBlocks Affected; + [ProtoMember(3)] internal int BlockRange; + [ProtoMember(4)] internal int MaxPoints; + [ProtoMember(5)] internal int PointsPerCharge; + [ProtoMember(6)] internal int UsablePerSecond; + [ProtoMember(7)] internal int UsablePerMinute; + [ProtoMember(8)] internal float Overflow; + [ProtoMember(9)] internal float Effectiveness; + [ProtoMember(10)] internal float ProtectionMin; + [ProtoMember(11)] internal float ProtectionMax; + } + } + + [ProtoContract] + public class ArmorDefinition + { + internal enum ArmorType + { + Light, + Heavy, + NonArmor, + } + + [ProtoMember(1)] internal string[] SubtypeIds; + [ProtoMember(2)] internal ArmorType Kind; + [ProtoMember(3)] internal double KineticResistance; + [ProtoMember(4)] internal double EnergeticResistance; + } + + [ProtoContract] + public class WeaponDefinition + { + [ProtoMember(1)] internal ModelAssignmentsDef Assignments; + [ProtoMember(2)] internal TargetingDef Targeting; + [ProtoMember(3)] internal AnimationDef Animations; + [ProtoMember(4)] internal HardPointDef HardPoint; + [ProtoMember(5)] internal AmmoDef[] Ammos; + [ProtoMember(6)] internal string ModPath; + [ProtoMember(7)] internal Dictionary Upgrades; + + [ProtoContract] + public struct ModelAssignmentsDef + { + [ProtoMember(1)] internal MountPointDef[] MountPoints; + [ProtoMember(2)] internal string[] Muzzles; + [ProtoMember(3)] internal string Ejector; + [ProtoMember(4)] internal string Scope; + + [ProtoContract] + public struct MountPointDef + { + [ProtoMember(1)] internal string SubtypeId; + [ProtoMember(2)] internal string SpinPartId; + [ProtoMember(3)] internal string MuzzlePartId; + [ProtoMember(4)] internal string AzimuthPartId; + [ProtoMember(5)] internal string ElevationPartId; + [ProtoMember(6)] internal float DurabilityMod; + [ProtoMember(7)] internal string IconName; + } + } + + [ProtoContract] + public struct TargetingDef + { + public enum Threat + { + Projectiles, + Characters, + Grids, + Neutrals, + Meteors, + Other, + ScanNeutralGrid, + ScanFriendlyGrid, + ScanFriendlyCharacter, + ScanRoid, + ScanPlanet, + ScanEnemyCharacter, + ScanEnemyGrid, + ScanNeutralCharacter, + ScanUnOwnedGrid, + ScanOwnersGrid + } + + public enum BlockTypes + { + Any, + Offense, + Utility, + Power, + Production, + Thrust, + Jumping, + Steering + } + + [ProtoMember(1)] internal int TopTargets; + [ProtoMember(2)] internal int TopBlocks; + [ProtoMember(3)] internal double StopTrackingSpeed; + [ProtoMember(4)] internal float MinimumDiameter; + [ProtoMember(5)] internal float MaximumDiameter; + [ProtoMember(6)] internal bool ClosestFirst; + [ProtoMember(7)] internal BlockTypes[] SubSystems; + [ProtoMember(8)] internal Threat[] Threats; + [ProtoMember(9)] internal float MaxTargetDistance; + [ProtoMember(10)] internal float MinTargetDistance; + [ProtoMember(11)] internal bool IgnoreDumbProjectiles; + [ProtoMember(12)] internal bool LockedSmartOnly; + [ProtoMember(13)] internal bool UniqueTargetPerWeapon; + [ProtoMember(14)] internal int MaxTrackingTime; + [ProtoMember(15)] internal bool ShootBlanks; + [ProtoMember(19)] internal CommunicationDef Communications; + [ProtoMember(20)] internal bool FocusOnly; + [ProtoMember(21)] internal bool EvictUniqueTargets; + [ProtoMember(22)] internal int CycleTargets; + [ProtoMember(23)] internal int CycleBlocks; + + [ProtoContract] + public struct CommunicationDef + { + public enum Comms + { + NoComms, + BroadCast, + Relay, + Jamming, + RelayAndBroadCast, + } + + public enum SecurityMode + { + Public, + Private, + Secure, + } + + [ProtoMember(1)] internal bool StoreTargets; + [ProtoMember(2)] internal int StorageLimit; + [ProtoMember(3)] internal string StorageLocation; + [ProtoMember(4)] internal Comms Mode; + [ProtoMember(5)] internal SecurityMode Security; + [ProtoMember(6)] internal string BroadCastChannel; + [ProtoMember(7)] internal double BroadCastRange; + [ProtoMember(8)] internal double JammingStrength; + [ProtoMember(9)] internal string RelayChannel; + [ProtoMember(10)] internal double RelayRange; + [ProtoMember(11)] internal bool TargetPersists; + [ProtoMember(12)] internal bool StoreLimitPerBlock; + [ProtoMember(13)] internal int MaxConnections; + } + } + + + [ProtoContract] + public struct AnimationDef + { + [ProtoMember(1)] internal PartAnimationSetDef[] AnimationSets; + [ProtoMember(2)] internal PartEmissive[] Emissives; + [ProtoMember(3)] internal string[] HeatingEmissiveParts; + [ProtoMember(4)] internal Dictionary EventParticles; + + [ProtoContract(IgnoreListHandling = true)] + public struct PartAnimationSetDef + { + public enum EventTriggers + { + Reloading, + Firing, + Tracking, + Overheated, + TurnOn, + TurnOff, + BurstReload, + NoMagsToLoad, + PreFire, + EmptyOnGameLoad, + StopFiring, + StopTracking, + LockDelay, + } + + public enum ResetConditions + { + None, + Home, + Off, + On, + Reloaded + } + + [ProtoMember(1)] internal string[] SubpartId; + [ProtoMember(2)] internal string BarrelId; + [ProtoMember(3)] internal uint StartupFireDelay; + [ProtoMember(4)] internal Dictionary AnimationDelays; + [ProtoMember(5)] internal EventTriggers[] Reverse; + [ProtoMember(6)] internal EventTriggers[] Loop; + [ProtoMember(7)] internal Dictionary EventMoveSets; + [ProtoMember(8)] internal EventTriggers[] TriggerOnce; + [ProtoMember(9)] internal EventTriggers[] ResetEmissives; + [ProtoMember(10)] internal ResetConditions Resets; + + } + + [ProtoContract] + public struct PartEmissive + { + [ProtoMember(1)] internal string EmissiveName; + [ProtoMember(2)] internal string[] EmissivePartNames; + [ProtoMember(3)] internal bool CycleEmissivesParts; + [ProtoMember(4)] internal bool LeavePreviousOn; + [ProtoMember(5)] internal Vector4[] Colors; + [ProtoMember(6)] internal float[] IntensityRange; + } + [ProtoContract] + public struct EventParticle + { + [ProtoMember(1)] internal string[] EmptyNames; + [ProtoMember(2)] internal string[] MuzzleNames; + [ProtoMember(3)] internal ParticleDef Particle; + [ProtoMember(4)] internal uint StartDelay; + [ProtoMember(5)] internal uint LoopDelay; + [ProtoMember(6)] internal bool ForceStop; + } + [ProtoContract] + internal struct RelMove + { + public enum MoveType + { + Linear, + ExpoDecay, + ExpoGrowth, + Delay, + Show, //instant or fade + Hide, //instant or fade + } + + [ProtoMember(1)] internal MoveType MovementType; + [ProtoMember(2)] internal XYZ[] LinearPoints; + [ProtoMember(3)] internal XYZ Rotation; + [ProtoMember(4)] internal XYZ RotAroundCenter; + [ProtoMember(5)] internal uint TicksToMove; + [ProtoMember(6)] internal string CenterEmpty; + [ProtoMember(7)] internal bool Fade; + [ProtoMember(8)] internal string EmissiveName; + + [ProtoContract] + internal struct XYZ + { + [ProtoMember(1)] internal double x; + [ProtoMember(2)] internal double y; + [ProtoMember(3)] internal double z; + } + } + } + + [ProtoContract] + public struct UpgradeValues + { + [ProtoMember(1)] internal string[] Ammo; + [ProtoMember(2)] internal Dependency[] Dependencies; + [ProtoMember(3)] internal int RateOfFireMod; + [ProtoMember(4)] internal int BarrelsPerShotMod; + [ProtoMember(5)] internal int ReloadMod; + [ProtoMember(6)] internal int MaxHeatMod; + [ProtoMember(7)] internal int HeatSinkRateMod; + [ProtoMember(8)] internal int ShotsInBurstMod; + [ProtoMember(9)] internal int DelayAfterBurstMod; + [ProtoMember(10)] internal int AmmoPriority; + + [ProtoContract] + public struct Dependency + { + internal string SubtypeId; + internal int Quanity; + } + } + + [ProtoContract] + public struct HardPointDef + { + public enum Prediction + { + Off, + Basic, + Accurate, + Advanced, + } + + [ProtoMember(1)] internal string PartName; + [ProtoMember(2)] internal int DelayCeaseFire; + [ProtoMember(3)] internal float DeviateShotAngle; + [ProtoMember(4)] internal double AimingTolerance; + [ProtoMember(5)] internal Prediction AimLeadingPrediction; + [ProtoMember(6)] internal LoadingDef Loading; + [ProtoMember(7)] internal AiDef Ai; + [ProtoMember(8)] internal HardwareDef HardWare; + [ProtoMember(9)] internal UiDef Ui; + [ProtoMember(10)] internal HardPointAudioDef Audio; + [ProtoMember(11)] internal HardPointParticleDef Graphics; + [ProtoMember(12)] internal OtherDef Other; + [ProtoMember(13)] internal bool AddToleranceToTracking; + [ProtoMember(14)] internal bool CanShootSubmerged; + [ProtoMember(15)] internal bool NpcSafe; + [ProtoMember(16)] internal bool ScanTrackOnly; + + [ProtoContract] + public struct LoadingDef + { + [ProtoMember(1)] internal int ReloadTime; + [ProtoMember(2)] internal int RateOfFire; + [ProtoMember(3)] internal int BarrelsPerShot; + [ProtoMember(4)] internal int SkipBarrels; + [ProtoMember(5)] internal int TrajectilesPerBarrel; + [ProtoMember(6)] internal int HeatPerShot; + [ProtoMember(7)] internal int MaxHeat; + [ProtoMember(8)] internal int HeatSinkRate; + [ProtoMember(9)] internal float Cooldown; + [ProtoMember(10)] internal int DelayUntilFire; + [ProtoMember(11)] internal int ShotsInBurst; + [ProtoMember(12)] internal int DelayAfterBurst; + [ProtoMember(13)] internal bool DegradeRof; + [ProtoMember(14)] internal int BarrelSpinRate; + [ProtoMember(15)] internal bool FireFull; + [ProtoMember(16)] internal bool GiveUpAfter; + [ProtoMember(17)] internal bool DeterministicSpin; + [ProtoMember(18)] internal bool SpinFree; + [ProtoMember(19)] internal bool StayCharged; + [ProtoMember(20)] internal int MagsToLoad; + [ProtoMember(21)] internal int MaxActiveProjectiles; + [ProtoMember(22)] internal int MaxReloads; + [ProtoMember(23)] internal bool GoHomeToReload; + [ProtoMember(24)] internal bool DropTargetUntilLoaded; + } + + + [ProtoContract] + public struct UiDef + { + [ProtoMember(1)] internal bool RateOfFire; + [ProtoMember(2)] internal bool DamageModifier; + [ProtoMember(3)] internal bool ToggleGuidance; + [ProtoMember(4)] internal bool EnableOverload; + [ProtoMember(5)] internal bool AlternateUi; + [ProtoMember(6)] internal bool DisableStatus; + } + + + [ProtoContract] + public struct AiDef + { + [ProtoMember(1)] internal bool TrackTargets; + [ProtoMember(2)] internal bool TurretAttached; + [ProtoMember(3)] internal bool TurretController; + [ProtoMember(4)] internal bool PrimaryTracking; + [ProtoMember(5)] internal bool LockOnFocus; + [ProtoMember(6)] internal bool SuppressFire; + [ProtoMember(7)] internal bool OverrideLeads; + [ProtoMember(8)] internal int DefaultLeadGroup; + [ProtoMember(9)] internal bool TargetGridCenter; + } + + [ProtoContract] + public struct HardwareDef + { + public enum HardwareType + { + BlockWeapon = 0, + HandWeapon = 1, + Phantom = 6, + } + + [ProtoMember(1)] internal float RotateRate; + [ProtoMember(2)] internal float ElevateRate; + [ProtoMember(3)] internal Vector3D Offset; + [ProtoMember(4)] internal bool FixedOffset; + [ProtoMember(5)] internal int MaxAzimuth; + [ProtoMember(6)] internal int MinAzimuth; + [ProtoMember(7)] internal int MaxElevation; + [ProtoMember(8)] internal int MinElevation; + [ProtoMember(9)] internal float InventorySize; + [ProtoMember(10)] internal HardwareType Type; + [ProtoMember(11)] internal int HomeAzimuth; + [ProtoMember(12)] internal int HomeElevation; + [ProtoMember(13)] internal CriticalDef CriticalReaction; + [ProtoMember(14)] internal float IdlePower; + + [ProtoContract] + public struct CriticalDef + { + [ProtoMember(1)] internal bool Enable; + [ProtoMember(2)] internal int DefaultArmedTimer; + [ProtoMember(3)] internal bool PreArmed; + [ProtoMember(4)] internal bool TerminalControls; + [ProtoMember(5)] internal string AmmoRound; + } + } + + [ProtoContract] + public struct HardPointAudioDef + { + [ProtoMember(1)] internal string ReloadSound; + [ProtoMember(2)] internal string NoAmmoSound; + [ProtoMember(3)] internal string HardPointRotationSound; + [ProtoMember(4)] internal string BarrelRotationSound; + [ProtoMember(5)] internal string FiringSound; + [ProtoMember(6)] internal bool FiringSoundPerShot; + [ProtoMember(7)] internal string PreFiringSound; + [ProtoMember(8)] internal uint FireSoundEndDelay; + [ProtoMember(9)] internal bool FireSoundNoBurst; + } + + [ProtoContract] + public struct OtherDef + { + [ProtoMember(1)] internal int ConstructPartCap; + [ProtoMember(2)] internal int EnergyPriority; + [ProtoMember(3)] internal int RotateBarrelAxis; + [ProtoMember(4)] internal bool MuzzleCheck; + [ProtoMember(5)] internal bool Debug; + [ProtoMember(6)] internal double RestrictionRadius; + [ProtoMember(7)] internal bool CheckInflatedBox; + [ProtoMember(8)] internal bool CheckForAnyWeapon; + [ProtoMember(9)] internal bool DisableLosCheck; + [ProtoMember(10)] internal bool NoVoxelLosCheck; + } + + [ProtoContract] + public struct HardPointParticleDef + { + [ProtoMember(1)] internal ParticleDef Effect1; + [ProtoMember(2)] internal ParticleDef Effect2; + } + } + + [ProtoContract] + public class AmmoDef + { + [ProtoMember(1)] internal string AmmoMagazine; + [ProtoMember(2)] internal string AmmoRound; + [ProtoMember(3)] internal bool HybridRound; + [ProtoMember(4)] internal float EnergyCost; + [ProtoMember(5)] internal float BaseDamage; + [ProtoMember(6)] internal float Mass; + [ProtoMember(7)] internal float Health; + [ProtoMember(8)] internal float BackKickForce; + [ProtoMember(9)] internal DamageScaleDef DamageScales; + [ProtoMember(10)] internal ShapeDef Shape; + [ProtoMember(11)] internal ObjectsHitDef ObjectsHit; + [ProtoMember(12)] internal TrajectoryDef Trajectory; + [ProtoMember(13)] internal AreaDamageDef AreaEffect; + [ProtoMember(14)] internal BeamDef Beams; + [ProtoMember(15)] internal FragmentDef Fragment; + [ProtoMember(16)] internal GraphicDef AmmoGraphics; + [ProtoMember(17)] internal AmmoAudioDef AmmoAudio; + [ProtoMember(18)] internal bool HardPointUsable; + [ProtoMember(19)] internal PatternDef Pattern; + [ProtoMember(20)] internal int EnergyMagazineSize; + [ProtoMember(21)] internal float DecayPerShot; + [ProtoMember(22)] internal EjectionDef Ejection; + [ProtoMember(23)] internal bool IgnoreWater; + [ProtoMember(24)] internal AreaOfDamageDef AreaOfDamage; + [ProtoMember(25)] internal EwarDef Ewar; + [ProtoMember(26)] internal bool IgnoreVoxels; + [ProtoMember(27)] internal bool Synchronize; + [ProtoMember(28)] internal double HeatModifier; + [ProtoMember(29)] internal bool NpcSafe; + [ProtoMember(30)] internal SynchronizeDef Sync; + [ProtoMember(31)] internal bool NoGridOrArmorScaling; + + [ProtoContract] + public struct SynchronizeDef + { + [ProtoMember(1)] internal bool Full; + [ProtoMember(2)] internal bool PointDefense; + [ProtoMember(3)] internal bool OnHitDeath; + } + + [ProtoContract] + public struct DamageScaleDef + { + + [ProtoMember(1)] internal float MaxIntegrity; + [ProtoMember(2)] internal bool DamageVoxels; + [ProtoMember(3)] internal float Characters; + [ProtoMember(4)] internal bool SelfDamage; + [ProtoMember(5)] internal GridSizeDef Grids; + [ProtoMember(6)] internal ArmorDef Armor; + [ProtoMember(7)] internal CustomScalesDef Custom; + [ProtoMember(8)] internal ShieldDef Shields; + [ProtoMember(9)] internal FallOffDef FallOff; + [ProtoMember(10)] internal double HealthHitModifier; + [ProtoMember(11)] internal double VoxelHitModifier; + [ProtoMember(12)] internal DamageTypes DamageType; + [ProtoMember(13)] internal DeformDef Deform; + + [ProtoContract] + public struct FallOffDef + { + [ProtoMember(1)] internal float Distance; + [ProtoMember(2)] internal float MinMultipler; + } + + [ProtoContract] + public struct GridSizeDef + { + [ProtoMember(1)] internal float Large; + [ProtoMember(2)] internal float Small; + } + + [ProtoContract] + public struct ArmorDef + { + [ProtoMember(1)] internal float Armor; + [ProtoMember(2)] internal float Heavy; + [ProtoMember(3)] internal float Light; + [ProtoMember(4)] internal float NonArmor; + } + + [ProtoContract] + public struct CustomScalesDef + { + internal enum SkipMode + { + NoSkip, + Inclusive, + Exclusive, + } + + [ProtoMember(1)] internal CustomBlocksDef[] Types; + [ProtoMember(2)] internal bool IgnoreAllOthers; + [ProtoMember(3)] internal SkipMode SkipOthers; + } + + [ProtoContract] + public struct DamageTypes + { + internal enum Damage + { + Energy, + Kinetic, + } + + [ProtoMember(1)] internal Damage Base; + [ProtoMember(2)] internal Damage AreaEffect; + [ProtoMember(3)] internal Damage Detonation; + [ProtoMember(4)] internal Damage Shield; + } + + [ProtoContract] + public struct ShieldDef + { + internal enum ShieldType + { + Default, + Heal, + Bypass, + EmpRetired, + } + + [ProtoMember(1)] internal float Modifier; + [ProtoMember(2)] internal ShieldType Type; + [ProtoMember(3)] internal float BypassModifier; + [ProtoMember(4)] internal double HeatModifier; + } + + [ProtoContract] + public struct DeformDef + { + internal enum DeformTypes + { + HitBlock, + AllDamagedBlocks, + NoDeform, + } + + [ProtoMember(1)] internal DeformTypes DeformType; + [ProtoMember(2)] internal int DeformDelay; + } + } + + [ProtoContract] + public struct ShapeDef + { + public enum Shapes + { + LineShape, + SphereShape, + } + + [ProtoMember(1)] internal Shapes Shape; + [ProtoMember(2)] internal double Diameter; + } + + [ProtoContract] + public struct ObjectsHitDef + { + [ProtoMember(1)] internal int MaxObjectsHit; + [ProtoMember(2)] internal bool CountBlocks; + } + + + [ProtoContract] + public struct CustomBlocksDef + { + [ProtoMember(1)] internal string SubTypeId; + [ProtoMember(2)] internal float Modifier; + } + + [ProtoContract] + public struct GraphicDef + { + [ProtoMember(1)] internal bool ShieldHitDraw; + [ProtoMember(2)] internal float VisualProbability; + [ProtoMember(3)] internal string ModelName; + [ProtoMember(4)] internal AmmoParticleDef Particles; + [ProtoMember(5)] internal LineDef Lines; + [ProtoMember(6)] internal DecalDef Decals; + + [ProtoContract] + public struct AmmoParticleDef + { + [ProtoMember(1)] internal ParticleDef Ammo; + [ProtoMember(2)] internal ParticleDef Hit; + [ProtoMember(3)] internal ParticleDef Eject; + } + + [ProtoContract] + public struct LineDef + { + internal enum Texture + { + Normal, + Cycle, + Chaos, + Wave, + } + public enum FactionColor + { + DontUse, + Foreground, + Background, + } + + [ProtoMember(1)] internal TracerBaseDef Tracer; + [ProtoMember(2)] internal string TracerMaterial; + [ProtoMember(3)] internal Randomize ColorVariance; + [ProtoMember(4)] internal Randomize WidthVariance; + [ProtoMember(5)] internal TrailDef Trail; + [ProtoMember(6)] internal OffsetEffectDef OffsetEffect; + [ProtoMember(7)] internal bool DropParentVelocity; + + [ProtoContract] + public struct OffsetEffectDef + { + [ProtoMember(1)] internal double MaxOffset; + [ProtoMember(2)] internal double MinLength; + [ProtoMember(3)] internal double MaxLength; + } + + [ProtoContract] + public struct TracerBaseDef + { + [ProtoMember(1)] internal bool Enable; + [ProtoMember(2)] internal float Length; + [ProtoMember(3)] internal float Width; + [ProtoMember(4)] internal Vector4 Color; + [ProtoMember(5)] internal uint VisualFadeStart; + [ProtoMember(6)] internal uint VisualFadeEnd; + [ProtoMember(7)] internal SegmentDef Segmentation; + [ProtoMember(8)] internal string[] Textures; + [ProtoMember(9)] internal Texture TextureMode; + [ProtoMember(10)] internal bool AlwaysDraw; + [ProtoMember(11)] internal FactionColor FactionColor; + + [ProtoContract] + public struct SegmentDef + { + [ProtoMember(1)] internal string Material; //retired + [ProtoMember(2)] internal double SegmentLength; + [ProtoMember(3)] internal double SegmentGap; + [ProtoMember(4)] internal double Speed; + [ProtoMember(5)] internal Vector4 Color; + [ProtoMember(6)] internal double WidthMultiplier; + [ProtoMember(7)] internal bool Reverse; + [ProtoMember(8)] internal bool UseLineVariance; + [ProtoMember(9)] internal Randomize ColorVariance; + [ProtoMember(10)] internal Randomize WidthVariance; + [ProtoMember(11)] internal string[] Textures; + [ProtoMember(12)] internal bool Enable; + [ProtoMember(13)] internal FactionColor FactionColor; + } + } + + [ProtoContract] + public struct TrailDef + { + [ProtoMember(1)] internal bool Enable; + [ProtoMember(2)] internal string Material; + [ProtoMember(3)] internal int DecayTime; + [ProtoMember(4)] internal Vector4 Color; + [ProtoMember(5)] internal bool Back; + [ProtoMember(6)] internal float CustomWidth; + [ProtoMember(7)] internal bool UseWidthVariance; + [ProtoMember(8)] internal bool UseColorFade; + [ProtoMember(9)] internal string[] Textures; + [ProtoMember(10)] internal Texture TextureMode; + [ProtoMember(11)] internal bool AlwaysDraw; + [ProtoMember(12)] internal FactionColor FactionColor; + } + } + + [ProtoContract] + public struct DecalDef + { + + [ProtoMember(1)] internal int MaxAge; + [ProtoMember(2)] internal TextureMapDef[] Map; + + [ProtoContract] + public struct TextureMapDef + { + [ProtoMember(1)] internal string HitMaterial; + [ProtoMember(2)] internal string DecalMaterial; + } + } + } + + [ProtoContract] + public struct BeamDef + { + [ProtoMember(1)] internal bool Enable; + [ProtoMember(2)] internal bool ConvergeBeams; + [ProtoMember(3)] internal bool VirtualBeams; + [ProtoMember(4)] internal bool RotateRealBeam; + [ProtoMember(5)] internal bool OneParticle; + [ProtoMember(6)] internal bool FakeVoxelHits; + } + + [ProtoContract] + public struct FragmentDef + { + [ProtoMember(1)] internal string AmmoRound; + [ProtoMember(2)] internal int Fragments; + [ProtoMember(3)] internal float Radial; + [ProtoMember(4)] internal float BackwardDegrees; + [ProtoMember(5)] internal float Degrees; + [ProtoMember(6)] internal bool Reverse; + [ProtoMember(7)] internal bool IgnoreArming; + [ProtoMember(8)] internal bool DropVelocity; + [ProtoMember(9)] internal float Offset; + [ProtoMember(10)] internal int MaxChildren; + [ProtoMember(11)] internal TimedSpawnDef TimedSpawns; + [ProtoMember(12)] internal bool FireSound; + [ProtoMember(13)] internal Vector3D AdvOffset; + [ProtoMember(14)] internal bool ArmWhenHit; + + [ProtoContract] + public struct TimedSpawnDef + { + public enum PointTypes + { + Direct, + Lead, + Predict, + } + + [ProtoMember(1)] internal bool Enable; + [ProtoMember(2)] internal int Interval; + [ProtoMember(3)] internal int StartTime; + [ProtoMember(4)] internal int MaxSpawns; + [ProtoMember(5)] internal double Proximity; + [ProtoMember(6)] internal bool ParentDies; + [ProtoMember(7)] internal bool PointAtTarget; + [ProtoMember(8)] internal int GroupSize; + [ProtoMember(9)] internal int GroupDelay; + [ProtoMember(10)] internal PointTypes PointType; + } + } + + [ProtoContract] + public struct PatternDef + { + public enum PatternModes + { + Never, + Weapon, + Fragment, + Both, + } + + + [ProtoMember(1)] internal string[] Patterns; + [ProtoMember(2)] internal bool Enable; + [ProtoMember(3)] internal float TriggerChance; + [ProtoMember(4)] internal bool SkipParent; + [ProtoMember(5)] internal bool Random; + [ProtoMember(6)] internal int RandomMin; + [ProtoMember(7)] internal int RandomMax; + [ProtoMember(8)] internal int PatternSteps; + [ProtoMember(9)] internal PatternModes Mode; + } + + [ProtoContract] + public struct EjectionDef + { + public enum SpawnType + { + Item, + Particle, + } + [ProtoMember(1)] internal float Speed; + [ProtoMember(2)] internal float SpawnChance; + [ProtoMember(3)] internal SpawnType Type; + [ProtoMember(4)] internal ComponentDef CompDef; + + [ProtoContract] + public struct ComponentDef + { + [ProtoMember(1)] internal string ItemName; + [ProtoMember(2)] internal int ItemLifeTime; + [ProtoMember(3)] internal int Delay; + } + } + + [ProtoContract] + public struct AreaOfDamageDef + { + public enum Falloff + { + Legacy, + NoFalloff, + Linear, + Curve, + InvCurve, + Squeeze, + Pooled, + Exponential, + } + + public enum AoeShape + { + Round, + Diamond, + } + + [ProtoMember(1)] internal ByBlockHitDef ByBlockHit; + [ProtoMember(2)] internal EndOfLifeDef EndOfLife; + + [ProtoContract] + public struct ByBlockHitDef + { + [ProtoMember(1)] internal bool Enable; + [ProtoMember(2)] internal double Radius; + [ProtoMember(3)] internal float Damage; + [ProtoMember(4)] internal float Depth; + [ProtoMember(5)] internal float MaxAbsorb; + [ProtoMember(6)] internal Falloff Falloff; + [ProtoMember(7)] internal AoeShape Shape; + } + + [ProtoContract] + public struct EndOfLifeDef + { + [ProtoMember(1)] internal bool Enable; + [ProtoMember(2)] internal double Radius; + [ProtoMember(3)] internal float Damage; + [ProtoMember(4)] internal float Depth; + [ProtoMember(5)] internal float MaxAbsorb; + [ProtoMember(6)] internal Falloff Falloff; + [ProtoMember(7)] internal bool ArmOnlyOnHit; + [ProtoMember(8)] internal int MinArmingTime; + [ProtoMember(9)] internal bool NoVisuals; + [ProtoMember(10)] internal bool NoSound; + [ProtoMember(11)] internal float ParticleScale; + [ProtoMember(12)] internal string CustomParticle; + [ProtoMember(13)] internal string CustomSound; + [ProtoMember(14)] internal AoeShape Shape; + } + } + + [ProtoContract] + public struct EwarDef + { + public enum EwarType + { + AntiSmart, + JumpNull, + EnergySink, + Anchor, + Emp, + Offense, + Nav, + Dot, + Push, + Pull, + Tractor, + } + + public enum EwarMode + { + Effect, + Field, + } + + [ProtoMember(1)] internal bool Enable; + [ProtoMember(2)] internal EwarType Type; + [ProtoMember(3)] internal EwarMode Mode; + [ProtoMember(4)] internal float Strength; + [ProtoMember(5)] internal double Radius; + [ProtoMember(6)] internal int Duration; + [ProtoMember(7)] internal bool StackDuration; + [ProtoMember(8)] internal bool Depletable; + [ProtoMember(9)] internal int MaxStacks; + [ProtoMember(10)] internal bool NoHitParticle; + [ProtoMember(11)] internal PushPullDef Force; + [ProtoMember(12)] internal FieldDef Field; + + + [ProtoContract] + public struct FieldDef + { + [ProtoMember(1)] internal int Interval; + [ProtoMember(2)] internal int PulseChance; + [ProtoMember(3)] internal int GrowTime; + [ProtoMember(4)] internal bool HideModel; + [ProtoMember(5)] internal bool ShowParticle; + [ProtoMember(6)] internal double TriggerRange; + [ProtoMember(7)] internal ParticleDef Particle; + } + + [ProtoContract] + public struct PushPullDef + { + public enum Force + { + ProjectileLastPosition, + ProjectileOrigin, + HitPosition, + TargetCenter, + TargetCenterOfMass, + } + + [ProtoMember(1)] internal Force ForceFrom; + [ProtoMember(2)] internal Force ForceTo; + [ProtoMember(3)] internal Force Position; + [ProtoMember(4)] internal bool DisableRelativeMass; + [ProtoMember(5)] internal double TractorRange; + [ProtoMember(6)] internal bool ShooterFeelsForce; + } + } + + + [ProtoContract] + public struct AreaDamageDef + { + public enum AreaEffectType + { + Disabled, + Explosive, + Radiant, + AntiSmart, + JumpNullField, + EnergySinkField, + AnchorField, + EmpField, + OffenseField, + NavField, + DotField, + PushField, + PullField, + TractorField, + } + + [ProtoMember(1)] internal double AreaEffectRadius; + [ProtoMember(2)] internal float AreaEffectDamage; + [ProtoMember(3)] internal AreaEffectType AreaEffect; + [ProtoMember(4)] internal PulseDef Pulse; + [ProtoMember(5)] internal DetonateDef Detonation; + [ProtoMember(6)] internal ExplosionDef Explosions; + [ProtoMember(7)] internal EwarFieldsDef EwarFields; + [ProtoMember(8)] internal AreaInfluence Base; + + [ProtoContract] + public struct AreaInfluence + { + [ProtoMember(1)] internal double Radius; + [ProtoMember(2)] internal float EffectStrength; + } + + + [ProtoContract] + public struct PulseDef + { + [ProtoMember(1)] internal int Interval; + [ProtoMember(2)] internal int PulseChance; + [ProtoMember(3)] internal int GrowTime; + [ProtoMember(4)] internal bool HideModel; + [ProtoMember(5)] internal bool ShowParticle; + [ProtoMember(6)] internal ParticleDef Particle; + } + + [ProtoContract] + public struct EwarFieldsDef + { + [ProtoMember(1)] internal int Duration; + [ProtoMember(2)] internal bool StackDuration; + [ProtoMember(3)] internal bool Depletable; + [ProtoMember(4)] internal double TriggerRange; + [ProtoMember(5)] internal int MaxStacks; + [ProtoMember(6)] internal PushPullDef Force; + [ProtoMember(7)] internal bool DisableParticleEffect; + + [ProtoContract] + public struct PushPullDef + { + public enum Force + { + ProjectileLastPosition, + ProjectileOrigin, + HitPosition, + TargetCenter, + TargetCenterOfMass, + } + + [ProtoMember(1)] internal Force ForceFrom; + [ProtoMember(2)] internal Force ForceTo; + [ProtoMember(3)] internal Force Position; + [ProtoMember(4)] internal bool DisableRelativeMass; + [ProtoMember(5)] internal double TractorRange; + [ProtoMember(6)] internal bool ShooterFeelsForce; + } + } + + [ProtoContract] + public struct DetonateDef + { + [ProtoMember(1)] internal bool DetonateOnEnd; + [ProtoMember(2)] internal bool ArmOnlyOnHit; + [ProtoMember(3)] internal float DetonationRadius; + [ProtoMember(4)] internal float DetonationDamage; + [ProtoMember(5)] internal int MinArmingTime; + } + + [ProtoContract] + public struct ExplosionDef + { + [ProtoMember(1)] internal bool NoVisuals; + [ProtoMember(2)] internal bool NoSound; + [ProtoMember(3)] internal float Scale; + [ProtoMember(4)] internal string CustomParticle; + [ProtoMember(5)] internal string CustomSound; + [ProtoMember(6)] internal bool NoShrapnel; + [ProtoMember(7)] internal bool NoDeformation; + } + } + + [ProtoContract] + public struct AmmoAudioDef + { + [ProtoMember(1)] internal string TravelSound; + [ProtoMember(2)] internal string HitSound; + [ProtoMember(3)] internal float HitPlayChance; + [ProtoMember(4)] internal bool HitPlayShield; + [ProtoMember(5)] internal string VoxelHitSound; + [ProtoMember(6)] internal string PlayerHitSound; + [ProtoMember(7)] internal string FloatingHitSound; + [ProtoMember(8)] internal string ShieldHitSound; + [ProtoMember(9)] internal string ShotSound; + } + + [ProtoContract] + public struct TrajectoryDef + { + internal enum GuidanceType + { + None, + Remote, + TravelTo, + Smart, + DetectTravelTo, + DetectSmart, + DetectFixed, + DroneAdvanced, + } + + [ProtoMember(1)] internal float MaxTrajectory; + [ProtoMember(2)] internal float AccelPerSec; + [ProtoMember(3)] internal float DesiredSpeed; + [ProtoMember(4)] internal float TargetLossDegree; + [ProtoMember(5)] internal int TargetLossTime; + [ProtoMember(6)] internal int MaxLifeTime; + [ProtoMember(7)] internal int DeaccelTime; + [ProtoMember(8)] internal Randomize SpeedVariance; + [ProtoMember(9)] internal Randomize RangeVariance; + [ProtoMember(10)] internal GuidanceType Guidance; + [ProtoMember(11)] internal SmartsDef Smarts; + [ProtoMember(12)] internal MinesDef Mines; + [ProtoMember(13)] internal float GravityMultiplier; + [ProtoMember(14)] internal uint MaxTrajectoryTime; + [ProtoMember(15)] internal ApproachDef[] Approaches; + [ProtoMember(16)] internal double TotalAcceleration; + + [ProtoContract] + public struct SmartsDef + { + [ProtoMember(1)] internal double Inaccuracy; + [ProtoMember(2)] internal double Aggressiveness; + [ProtoMember(3)] internal double MaxLateralThrust; + [ProtoMember(4)] internal double TrackingDelay; + [ProtoMember(5)] internal int MaxChaseTime; + [ProtoMember(6)] internal bool OverideTarget; + [ProtoMember(7)] internal int MaxTargets; + [ProtoMember(8)] internal bool NoTargetExpire; + [ProtoMember(9)] internal bool Roam; + [ProtoMember(10)] internal bool KeepAliveAfterTargetLoss; + [ProtoMember(11)] internal float OffsetRatio; + [ProtoMember(12)] internal int OffsetTime; + [ProtoMember(13)] internal bool CheckFutureIntersection; + [ProtoMember(14)] internal double NavAcceleration; + [ProtoMember(15)] internal bool AccelClearance; + [ProtoMember(16)] internal double SteeringLimit; + [ProtoMember(17)] internal bool FocusOnly; + [ProtoMember(18)] internal double OffsetMinRange; + [ProtoMember(19)] internal bool FocusEviction; + [ProtoMember(20)] internal double ScanRange; + [ProtoMember(21)] internal bool NoSteering; + [ProtoMember(22)] internal double FutureIntersectionRange; + [ProtoMember(23)] internal double MinTurnSpeed; + [ProtoMember(24)] internal bool NoTargetApproach; + [ProtoMember(25)] internal bool AltNavigation; + } + + [ProtoContract] + public struct ApproachDef + { + public enum ReInitCondition + { + Wait, + MoveToPrevious, + MoveToNext, + ForceRestart, + } + + public enum Conditions + { + Ignore, + Spawn, + DistanceFromPositionC, + Lifetime, + DesiredElevation, + MinTravelRequired, + MaxTravelRequired, + Deadtime, + DistanceToPositionC, + NextTimedSpawn, + RelativeLifetime, + RelativeDeadtime, + SinceTimedSpawn, + RelativeSpawns, + EnemyTargetLoss, + RelativeHealthLost, + HealthRemaining, + DistanceFromPositionB, + DistanceToPositionB, + DistanceFromTarget, + DistanceToTarget, + DistanceFromEndTrajectory, + DistanceToEndTrajectory, + } + + public enum UpRelativeTo + { + UpRelativeToBlock, + UpRelativeToGravity, + UpTargetDirection, + UpTargetVelocity, + UpStoredStartDontUse, + UpStoredEndDontUse, + UpStoredStartPosition, + UpStoredEndPosition, + UpStoredStartLocalPosition, + UpStoredEndLocalPosition, + UpRelativeToShooter, + UpOriginDirection, + UpElevationDirection, + } + + public enum FwdRelativeTo + { + ForwardElevationDirection, + ForwardRelativeToBlock, + ForwardRelativeToGravity, + ForwardTargetDirection, + ForwardTargetVelocity, + ForwardStoredStartDontUse, + ForwardStoredEndDontUse, + ForwardStoredStartPosition, + ForwardStoredEndPosition, + ForwardStoredStartLocalPosition, + ForwardStoredEndLocalPosition, + ForwardRelativeToShooter, + ForwardOriginDirection, + } + + public enum RelativeTo + { + Origin, + Shooter, + Target, + Surface, + MidPoint, + PositionA, + Nothing, + StoredStartDontUse, + StoredEndDontUse, + StoredStartPosition, + StoredEndPosition, + StoredStartLocalPosition, + StoredEndLocalPosition, + } + + public enum ConditionOperators + { + StartEnd_And, + StartEnd_Or, + StartAnd_EndOr, + StartOr_EndAnd, + } + + public enum StageEvents + { + DoNothing, + EndProjectile, + EndProjectileOnRestart, + StoreDontUse, + StorePositionDontUse, + Refund, + StorePositionA, + StorePositionB, + StorePositionC, + } + + [ProtoContract] + public struct WeightedIdListDef + { + + [ProtoMember(1)] public int ApproachId; + [ProtoMember(2)] public Randomize Weight; + [ProtoMember(3)] public double End1WeightMod; + [ProtoMember(4)] public double End2WeightMod; + [ProtoMember(5)] public int MaxRuns; + [ProtoMember(6)] public double End3WeightMod; + } + + [ProtoMember(1)] internal ReInitCondition RestartCondition; + [ProtoMember(2)] internal Conditions StartCondition1; + [ProtoMember(3)] internal Conditions EndCondition1; + [ProtoMember(4)] internal UpRelativeTo Up; + [ProtoMember(5)] internal RelativeTo PositionB; + [ProtoMember(6)] internal double AngleOffset; + [ProtoMember(7)] internal double Start1Value; + [ProtoMember(8)] internal double End1Value; + [ProtoMember(9)] internal double LeadDistance; + [ProtoMember(10)] internal double DesiredElevation; + [ProtoMember(11)] internal double AccelMulti; + [ProtoMember(12)] internal double SpeedCapMulti; + [ProtoMember(13)] internal bool AdjustPositionC; + [ProtoMember(14)] internal bool CanExpireOnceStarted; + [ProtoMember(15)] internal ParticleDef AlternateParticle; + [ProtoMember(16)] internal string AlternateSound; + [ProtoMember(17)] internal string AlternateModel; + [ProtoMember(18)] internal int OnRestartRevertTo; + [ProtoMember(19)] internal ParticleDef StartParticle; + [ProtoMember(20)] internal bool AdjustPositionB; + [ProtoMember(21)] internal bool AdjustUp; + [ProtoMember(22)] internal bool PushLeadByTravelDistance; + [ProtoMember(23)] internal double TrackingDistance; + [ProtoMember(24)] internal Conditions StartCondition2; + [ProtoMember(25)] internal double Start2Value; + [ProtoMember(26)] internal Conditions EndCondition2; + [ProtoMember(27)] internal double End2Value; + [ProtoMember(28)] internal RelativeTo Elevation; + [ProtoMember(29)] internal double ElevationTolerance; + [ProtoMember(30)] internal ConditionOperators Operators; + [ProtoMember(31)] internal StageEvents StartEvent; + [ProtoMember(32)] internal StageEvents EndEvent; + [ProtoMember(33)] internal double TotalAccelMulti; + [ProtoMember(34)] internal double DeAccelMulti; + [ProtoMember(35)] internal bool Orbit; + [ProtoMember(36)] internal double OrbitRadius; + [ProtoMember(37)] internal int OffsetTime; + [ProtoMember(38)] internal double OffsetMinRadius; + [ProtoMember(39)] internal bool NoTimedSpawns; + [ProtoMember(40)] internal double OffsetMaxRadius; + [ProtoMember(41)] internal bool ForceRestart; + [ProtoMember(42)] internal RelativeTo PositionC; + [ProtoMember(43)] internal bool DisableAvoidance; + [ProtoMember(44)] internal int StoredStartId; + [ProtoMember(45)] internal int StoredEndId; + [ProtoMember(46)] internal WeightedIdListDef[] RestartList; + [ProtoMember(47)] internal RelativeTo StoredStartType; + [ProtoMember(48)] internal RelativeTo StoredEndType; + [ProtoMember(49)] internal bool LeadRotateElevatePositionB; + [ProtoMember(50)] internal bool LeadRotateElevatePositionC; + [ProtoMember(51)] internal bool NoElevationLead; + [ProtoMember(52)] internal bool IgnoreAntiSmart; + [ProtoMember(53)] internal double HeatRefund; + [ProtoMember(54)] internal Randomize AngleVariance; + [ProtoMember(55)] internal bool ReloadRefund; + [ProtoMember(56)] internal int ModelRotateTime; + [ProtoMember(57)] internal FwdRelativeTo Forward; + [ProtoMember(58)] internal bool AdjustForward; + [ProtoMember(59)] internal bool ToggleIngoreVoxels; + [ProtoMember(60)] internal bool SelfAvoidance; + [ProtoMember(61)] internal bool TargetAvoidance; + [ProtoMember(62)] internal bool SelfPhasing; + [ProtoMember(63)] internal bool TrajectoryRelativeToB; + [ProtoMember(64)] internal Conditions EndCondition3; + [ProtoMember(65)] internal double End3Value; + [ProtoMember(66)] internal bool SwapNavigationType; + [ProtoMember(67)] internal bool ElevationRelativeToC; + } + + [ProtoContract] + public struct MinesDef + { + [ProtoMember(1)] internal double DetectRadius; + [ProtoMember(2)] internal double DeCloakRadius; + [ProtoMember(3)] internal int FieldTime; + [ProtoMember(4)] internal bool Cloak; + [ProtoMember(5)] internal bool Persist; + } + } + + [ProtoContract] + public struct Randomize + { + [ProtoMember(1)] internal float Start; + [ProtoMember(2)] internal float End; + } + } + + [ProtoContract] + public struct ParticleOptionDef + { + [ProtoMember(1)] internal float Scale; + [ProtoMember(2)] internal float MaxDistance; + [ProtoMember(3)] internal float MaxDuration; + [ProtoMember(4)] internal bool Loop; + [ProtoMember(5)] internal bool Restart; + [ProtoMember(6)] internal float HitPlayChance; + } + + + [ProtoContract] + public struct ParticleDef + { + [ProtoMember(1)] internal string Name; + [ProtoMember(2)] internal Vector4 Color; + [ProtoMember(3)] internal Vector3D Offset; + [ProtoMember(4)] internal ParticleOptionDef Extras; + [ProtoMember(5)] internal bool ApplyToShield; + [ProtoMember(6)] internal bool DisableCameraCulling; + } + } + } + +} \ No newline at end of file diff --git a/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/RepairModule_Core.cs b/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/RepairModule_Core.cs index a35225b7b..c61fd93f6 100644 --- a/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/RepairModule_Core.cs +++ b/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/RepairModule_Core.cs @@ -9,6 +9,7 @@ using ProtoBuf; using VRage.Utils; using VRage.Game; +using VRage.Game.Entity; using VRage.Game.ModAPI; using VRage.Game.ModAPI.Network; using VRage.Sync; @@ -18,6 +19,7 @@ using VRage.ObjectBuilders; using VRageMath; using StarCore.RepairModule.Networking.Custom; +using StarCore.RepairModule.Session; namespace StarCore.RepairModule { @@ -647,7 +649,7 @@ private bool IsPriority(IMySlimBlock block) switch (subsystemPriority) { case RepairPriority.Offense: - return block.FatBlock is IMyConveyorSorter || + return (block.FatBlock is IMyConveyorSorter && RepairModuleSession.CoreSysAPI.HasCoreWeapon(block.FatBlock as MyEntity)) || block.FatBlock is IMyLargeTurretBase || block.FatBlock is IMySmallMissileLauncher || block.FatBlock is IMySmallMissileLauncherReload || diff --git a/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/RepairModule_Session.cs b/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/RepairModule_Session.cs index b2622637c..b70e356f8 100644 --- a/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/RepairModule_Session.cs +++ b/Utility Mods/BaRCore/Data/Scripts/SimplifiedBAR/HullRegenModule/RepairModule_Session.cs @@ -7,6 +7,7 @@ using VRage.Game.Components; using VRage.ModAPI; using StarCore.RepairModule.Networking; +using CoreSystems.Api; namespace StarCore.RepairModule.Session { @@ -14,15 +15,25 @@ namespace StarCore.RepairModule.Session internal class RepairModuleSession : MySessionComponentBase { public static HeartNetwork Networking = new HeartNetwork(); + public static WcApi CoreSysAPI; public override void LoadData() { Networking.Init("RepairModuleNetwork"); + + CoreSysAPI = new WcApi(); + CoreSysAPI.Load(); } protected override void UnloadData() { Networking.Close(); + + if (CoreSysAPI.IsReady) + { + CoreSysAPI.Unload(); + CoreSysAPI = null; + } } } } diff --git a/Utility Mods/MoA Fusion Systems/Data/CubeBlocks/Caster_FocusLens.sbc b/Utility Mods/MoA Fusion Systems/Data/CubeBlocks/Caster_FocusLens.sbc index a3e9a7f41..2c9907de0 100644 --- a/Utility Mods/MoA Fusion Systems/Data/CubeBlocks/Caster_FocusLens.sbc +++ b/Utility Mods/MoA Fusion Systems/Data/CubeBlocks/Caster_FocusLens.sbc @@ -35,7 +35,7 @@ Caster_FocusLens Thrust - 34560000 + 144000000 0.200 0.000002 1 diff --git a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionThruster/FusionThrusterLogic.cs b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionThruster/FusionThrusterLogic.cs index 10f34ad4f..9bc48d2c4 100644 --- a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionThruster/FusionThrusterLogic.cs +++ b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/FusionThruster/FusionThrusterLogic.cs @@ -31,7 +31,7 @@ public class FusionThrusterLogic : FusionPart internal static readonly Dictionary DriveSettings = new Dictionary { - ["Caster_FocusLens"] = new DriveSetting(4.00f, 1.5f, 34.56f*2*1000000), + ["Caster_FocusLens"] = new DriveSetting(1.00f, 1.5f, 144000000), }; public override void UpdatePower(float powerGeneration, float newtonsPerFusionPower, int numberThrusters) diff --git a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionSystem.cs b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionSystem.cs index f8329ae51..f949a9a41 100644 --- a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionSystem.cs +++ b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/FusionParts/S_FusionSystem.cs @@ -13,7 +13,7 @@ namespace Epstein_Fusion_DS. internal class SFusionSystem { public const float MegawattsPerFusionPower = 32; - public const float NewtonsPerFusionPower = 1500000; + public const float NewtonsPerFusionPower = 24000000; public const float HydrogenPerFusionPower = 42; public readonly IMyCubeGrid Grid; @@ -253,8 +253,10 @@ private void UpdatePower(bool updateReactors = false) PowerStored -= PowerConsumption; PowerStored += PowerGeneration; if (PowerStored > MaxPowerStored) PowerStored = MaxPowerStored; + if (float.IsNaN(PowerStored) || float.IsInfinity(PowerStored)) + PowerStored = 0; ModularApi.SetAssemblyProperty(PhysicalAssemblyId, "HeatGeneration", - PowerConsumption * MegawattsPerFusionPower); + PowerConsumption * MegawattsPerFusionPower * 2); } public void UpdateTick() diff --git a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/Definitions/HeatPartDefinitions.cs b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/Definitions/HeatPartDefinitions.cs index 52a0facf9..98126b302 100644 --- a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/Definitions/HeatPartDefinitions.cs +++ b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HeatParts/Definitions/HeatPartDefinitions.cs @@ -31,7 +31,7 @@ public static bool HasDefinition(string subtypeId) => new HeatPartDefinition { SubtypeId = "Heat_Heatsink", - HeatCapacity = 60, + HeatCapacity = 180, HeatDissipation = 0, LoSCheck = null }, @@ -89,7 +89,7 @@ public static bool HasDefinition(string subtypeId) => new HeatPartDefinition { SubtypeId = "ActiveRadiator", - HeatCapacity = 60, + HeatCapacity = 180, HeatDissipation = 150, LoSCheck = radiatorBlock => { @@ -114,11 +114,6 @@ public static bool HasDefinition(string subtypeId) => if (!CheckGridIntersect(radiatorBlock, pos, Vector3I.Up)) occlusionModifier += 1f / checkPositions.Length; - if (!CheckGridIntersect(radiatorBlock, Vector3I.Zero, Vector3I.Up)) - occlusionModifier += 1 / 2f; - if (!CheckGridIntersect(radiatorBlock, Vector3I.Right, Vector3I.Up)) - occlusionModifier += 1 / 2f; - return occlusionModifier; } } diff --git a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/S_FusionPlayerHud.cs b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/S_FusionPlayerHud.cs index 76f6d0a24..9b0e58c75 100644 --- a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/S_FusionPlayerHud.cs +++ b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/S_FusionPlayerHud.cs @@ -79,7 +79,7 @@ public override void UpdateAfterSimulation() MyVisualScriptLogicProvider.AddQuestlogDetailLocal( $"[({system.PhysicalAssemblyId})] Thrusters: {system.Thrusters.Count} | Reactors: {system.Reactors.Count} | Loops: {system.Arms.Count} | Heat: -{HeatManager.I.GetGridHeatDissipation(system.Grid):N0} +{HeatManager.I.GetGridHeatGeneration(system.Grid):N0} ({HeatManager.I.GetGridHeatLevel(system.Grid)*100:F1}%)\n" + - $" Stored: {system.PowerStored:N0}/{system.MaxPowerStored:N0} | Generation: {system.PowerGeneration:N1}/{system.MaxPowerGeneration:N1}", + $" Stored: {system.PowerStored:N0}/{system.MaxPowerStored:N0} | Generation: {system.PowerGeneration*60:N1}/{system.MaxPowerGeneration*60:N1}", false, false); displayedCount++; } diff --git a/Utility Mods/SCDefenseBlocks/Data/Scripts/OneFuckingFolderDeeper/FieldGenerator/FieldGenerator_Core.cs b/Utility Mods/SCDefenseBlocks/Data/Scripts/OneFuckingFolderDeeper/FieldGenerator/FieldGenerator_Core.cs index fa4f8d219..121d6d26a 100644 --- a/Utility Mods/SCDefenseBlocks/Data/Scripts/OneFuckingFolderDeeper/FieldGenerator/FieldGenerator_Core.cs +++ b/Utility Mods/SCDefenseBlocks/Data/Scripts/OneFuckingFolderDeeper/FieldGenerator/FieldGenerator_Core.cs @@ -29,6 +29,7 @@ public class FieldGenerator : MyGameLogicComponent, IMyEventProxy { private IMyCubeBlock Block; private readonly bool IsServer = MyAPIGateway.Session.IsServer; + private readonly bool IsDedicated = MyAPIGateway.Utilities.IsDedicated; public readonly Guid SettingsID = new Guid("7A7AC398-FAE3-44E5-ABD5-8AE49434DDF6"); private Generator_Settings Config = FieldGenerator_Config.Config; @@ -133,9 +134,10 @@ public override void UpdateOnceBeforeFrame() Stability.ValueChanged += Stability_ValueChanged; } - if (!IsServer) + if (!IsDedicated) { GridStopped.ValueChanged += OnGridStopValueChange; + Block.IsWorkingChanged += Block_IsWorkingChanged; } NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME; @@ -170,25 +172,22 @@ public override void UpdateAfterSimulation() SiegeEmergencyStop(); _stopTickCounter++; } + else + GridStopped.Value = true; } } - if (SiegeMode.Value && !GridStopped.Value) + if (!IsDedicated) { - if (!SlowdownActive.Value) + if (SiegeMode.Value && !GridStopped.Value && !SlowdownActive.Value && IsClientInShip()) { BlockSoundPair = new MySoundPair("FieldGen_Brake"); + BlockSoundEmitter.SetPosition(Block.Position); BlockSoundEmitter?.PlaySound(BlockSoundPair, false, false, true, true, false, null, true); SlowdownActive.Value = true; } } - if (_cachedState != Block.IsWorking) - { - _cachedState = Block.IsWorking; - Block_IsWorkingChanged(); - } - if (MyAPIGateway.Session.GameplayFrameCounter % 60 == 0) { if (Block.IsWorking) @@ -298,10 +297,11 @@ public override void Close() Stability.ValueChanged -= Stability_ValueChanged; } - if (!IsServer) + if (!IsDedicated) { GridStopped.ValueChanged -= OnGridStopValueChange; - } + Block.IsWorkingChanged -= Block_IsWorkingChanged; + } Block = null; } @@ -440,18 +440,25 @@ private void OnGridStopValueChange(MySync obj) Block.CubeGrid.Physics.LinearVelocity = Vector3.Zero; } - private void Block_IsWorkingChanged() - { - if (!Block.IsWorking) + private void Block_IsWorkingChanged(IMyCubeBlock block) + { + if (IsClientInShip()) { - BlockSoundPair = Block.IsFunctional ? BlockSoundPair = new MySoundPair("FieldGen_Offline") : BlockSoundPair = new MySoundPair("FieldGen_Damaged"); - BlockSoundEmitter?.PlaySound(BlockSoundPair, false, false, true, true, false, null, true); + if (!block.IsWorking) + { + BlockSoundPair = block.IsFunctional ? BlockSoundPair = new MySoundPair("FieldGen_Offline") : BlockSoundPair = new MySoundPair("FieldGen_Damaged"); + BlockSoundEmitter.SetPosition(Block.Position); + BlockSoundEmitter?.PlaySound(BlockSoundPair, false, false, true, true, false, null, true); + } + else + { + BlockSoundPair = block.SlimBlock.IsFullIntegrity ? BlockSoundPair = new MySoundPair("FieldGen_PowerRestored") : BlockSoundPair = new MySoundPair("FieldGen_DamagedRepaired"); + BlockSoundEmitter.SetPosition(block.Position); + BlockSoundEmitter?.PlaySound(BlockSoundPair, false, false, true, true, false, null, true); + } } else - { - BlockSoundPair = Block.SlimBlock.IsFullIntegrity ? BlockSoundPair = new MySoundPair("FieldGen_PowerRestored") : BlockSoundPair = new MySoundPair("FieldGen_DamagedRepaired"); - BlockSoundEmitter?.PlaySound(BlockSoundPair, false, false, true, true, false, null, true); - } + return; } #endregion @@ -526,32 +533,17 @@ private void SiegeEmergencyStop() if (Block.CubeGrid.Physics == null) return; + // Linear Drag float elapsed = _stopTickCounter / 60f; - float maxTime = 10f; - - float minForce = 1000000f; - float maxForce = 120000000f; - - float timeScale = MathHelper.Clamp(elapsed / maxTime, 0f, 1f); - float forceMagnitude = MathHelper.Lerp(minForce, maxForce, timeScale); + float timeScale = MathHelper.Clamp(elapsed / 10f, 0f, 1f); + float forceMagnitude = MathHelper.Lerp(1000000f, 120000000f, timeScale); Vector3 direction = Vector3.Normalize(Block.CubeGrid.Physics.LinearVelocity); Vector3 linearDrag = -direction * forceMagnitude; Block.CubeGrid.Physics.AddForce(MyPhysicsForceType.APPLY_WORLD_FORCE, linearDrag, null, null); - if (Block.CubeGrid.Physics.LinearVelocity.LengthSquared() < 25f || elapsed >= maxTime) // 5 m/s squared = 25 - { - Block.CubeGrid.Physics.LinearVelocity = Vector3D.Zero; - GridStopped.Value = true; - SlowdownActive.Value = false; - _stopTickCounter = -1; - angularAxis1 = null; - angularAxis2 = null; - return; - } - - // ----- ANGULAR DRAG ----- + // Angular Drag if (angularAxis1 == null) { angularAxis1 = GetRandomUnitVector(); @@ -566,15 +558,23 @@ private void SiegeEmergencyStop() angularAxis2 = candidate; } - float targetAngularAccel = 0.1f; - Vector3 torqueDirection = new Vector3(0,0,0); - + Vector3 torqueDirection = new Vector3(0, 0, 0); torqueDirection += angularAxis1.Value; torqueDirection += angularAxis2.Value; - Vector3 angularImpulse = torqueDirection * targetAngularAccel / 60f; + Block.CubeGrid.Physics.AngularVelocity += torqueDirection * 0.1f / 60f; - Block.CubeGrid.Physics.AngularVelocity += angularImpulse; + // Finish if under 5m/s + if (Block.CubeGrid.Physics.LinearVelocity.LengthSquared() < 25f || elapsed >= 10f) // 5 m/s squared = 25 + { + Block.CubeGrid.Physics.LinearVelocity = Vector3D.Zero; + GridStopped.Value = true; + SlowdownActive.Value = false; + _stopTickCounter = -1; + angularAxis1 = null; + angularAxis2 = null; + return; + } } Vector3 GetRandomUnitVector() @@ -731,11 +731,11 @@ public float CalculatePowerDraw() public float CheckPowerDraw(float fieldValue) { - float maxPossibleFieldPowerV = Config.PerModuleAmount * Config.MaxModuleCount; - float clampedFieldPowerV = MathHelper.Clamp(fieldValue, 0, maxPossibleFieldPowerV); - float tV = clampedFieldPowerV / maxPossibleFieldPowerV; + float maxPossibleFieldPower = Config.PerModuleAmount * Config.MaxModuleCount; + float clampedFieldPower = MathHelper.Clamp(fieldValue, 0, maxPossibleFieldPower); + float t = clampedFieldPower / maxPossibleFieldPower; - return Config.MinPowerDraw + tV * (Config.MaxPowerDraw - Config.MinPowerDraw); + return Config.MinPowerDraw + t * (Config.MaxPowerDraw - Config.MinPowerDraw); } public float CheckPowerGeneration() diff --git a/Utility Mods/StarCore Tournament Weapon Category/Data/BlockCategories_StarCoreCorporate.sbc b/Utility Mods/StarCore Tournament Weapon Category/Data/BlockCategories_StarCoreCorporate.sbc index 9acfa59a7..b8f12002b 100644 --- a/Utility Mods/StarCore Tournament Weapon Category/Data/BlockCategories_StarCoreCorporate.sbc +++ b/Utility Mods/StarCore Tournament Weapon Category/Data/BlockCategories_StarCoreCorporate.sbc @@ -257,6 +257,7 @@ NHI_Mk2_Cannon_Turret SC_Coil_Cannon NHI_Mk3_Cannon_Turret + NHI_Fixed_Autocannon @@ -313,6 +314,7 @@ K_SA_Launcher_VIV HAS_Avenger HAS_Esper + HAS_Nyx diff --git a/Weapon Mods/Anomaly_Solaris_Hypernautics/Data/SOL_CubeBlocks.sbc b/Weapon Mods/Anomaly_Solaris_Hypernautics/Data/SOL_CubeBlocks.sbc index e066e68b1..a37e8ee39 100644 --- a/Weapon Mods/Anomaly_Solaris_Hypernautics/Data/SOL_CubeBlocks.sbc +++ b/Weapon Mods/Anomaly_Solaris_Hypernautics/Data/SOL_CubeBlocks.sbc @@ -662,9 +662,9 @@ Hercules MAC [10km range, 5km effective range] - [Kinetic damage] - [3500 m/s] - Three shot magazine. 8s reload. + [Pen Kinetic damage] + [3600 m/s] + Three shot magazine. 24s reload. Textures\Icons\FixedCoilCannon.dds Large diff --git a/Weapon Mods/Anomaly_Solaris_Hypernautics/Data/Scripts/CoreParts/Heavy_MAC_Ammo.cs b/Weapon Mods/Anomaly_Solaris_Hypernautics/Data/Scripts/CoreParts/Heavy_MAC_Ammo.cs index a81918266..c7df8faf3 100644 --- a/Weapon Mods/Anomaly_Solaris_Hypernautics/Data/Scripts/CoreParts/Heavy_MAC_Ammo.cs +++ b/Weapon Mods/Anomaly_Solaris_Hypernautics/Data/Scripts/CoreParts/Heavy_MAC_Ammo.cs @@ -516,7 +516,7 @@ partial class Parts Armor = 2.5f, // 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 = -1.5f, // Multiplier for damage against every else. + NonArmor = 1.5f, // Multiplier for damage against every else. }, Shields = new ShieldDef { diff --git a/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin.mwm b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin.mwm index ce8a808ec..f1e63db3f 100644 Binary files a/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin.mwm and b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin.mwm differ diff --git a/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_BS1.mwm b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_BS1.mwm new file mode 100644 index 000000000..6827f2cc6 Binary files /dev/null and b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_BS1.mwm differ diff --git a/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_BS1_LOD1.mwm b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_BS1_LOD1.mwm index e51e1fcd6..8a3a34aa1 100644 Binary files a/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_BS1_LOD1.mwm and b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_BS1_LOD1.mwm differ diff --git a/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_BS2.mwm b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_BS2.mwm new file mode 100644 index 000000000..12fd386a6 Binary files /dev/null and b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_BS2.mwm differ diff --git a/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_BS3.mwm b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_BS3.mwm new file mode 100644 index 000000000..d67cd727c Binary files /dev/null and b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_BS3.mwm differ diff --git a/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_LOD1.mwm b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_LOD1.mwm index 142b55a3f..6b515c9f2 100644 Binary files a/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_LOD1.mwm and b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_LOD1.mwm differ diff --git a/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_LOD2.mwm b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_LOD2.mwm index 95b41cc11..380387308 100644 Binary files a/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_LOD2.mwm and b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_LOD2.mwm differ diff --git a/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_LOD3.mwm b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_LOD3.mwm index 1bc83a779..f086148ab 100644 Binary files a/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_LOD3.mwm and b/Weapon Mods/Anomaly_Solaris_Hypernautics/Models/Starcore/muzzled_coil_odin_LOD3.mwm differ diff --git a/Weapon Mods/Heavy-Assault-Systems/Data/Scripts/CoreParts/Nyx.cs b/Weapon Mods/Heavy-Assault-Systems/Data/Scripts/CoreParts/Nyx.cs index b107d336f..a287ad63d 100644 --- a/Weapon Mods/Heavy-Assault-Systems/Data/Scripts/CoreParts/Nyx.cs +++ b/Weapon Mods/Heavy-Assault-Systems/Data/Scripts/CoreParts/Nyx.cs @@ -56,7 +56,7 @@ partial class Parts { TopTargets = 8, // Maximum number of targets to randomize between; 0 = unlimited. CycleTargets = 0, // Number of targets to "cycle" per acquire attempt. TopBlocks = 8, // Maximum number of blocks to randomize between; 0 = unlimited. - CycleBlocks = 3, // Number of blocks to "cycle" per acquire attempt. + CycleBlocks = 0, // Number of blocks to "cycle" per acquire attempt. StopTrackingSpeed = 0, // Do not track threats traveling faster than this speed; 0 = unlimited. }, HardPoint = new HardPointDef @@ -185,7 +185,7 @@ partial class Parts { }, }, Ammos = new[] { - HAS_Nyx_Ammo, // Must list all primary, shrapnel, and pattern ammos. + HAS_Nyx_Ammo, HAS_Nyx_Ammo_Fake, // Must list all primary, shrapnel, and pattern ammos. }, //Animations = SA_HMI_ERGaussRF_Animation, //Upgrades = UpgradeModules, diff --git a/Weapon Mods/Heavy-Assault-Systems/Data/Scripts/CoreParts/Nyx_ammo.cs b/Weapon Mods/Heavy-Assault-Systems/Data/Scripts/CoreParts/Nyx_ammo.cs index 1b5758606..4ecc41acc 100644 --- a/Weapon Mods/Heavy-Assault-Systems/Data/Scripts/CoreParts/Nyx_ammo.cs +++ b/Weapon Mods/Heavy-Assault-Systems/Data/Scripts/CoreParts/Nyx_ammo.cs @@ -36,8 +36,8 @@ partial class Parts AmmoMagazine = "NyxAmmoMag", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo. AmmoRound = "Nyx Beam", // 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.125f, //100MW Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR. - BaseDamage = 1600f, // Direct damage; one steel plate is worth 100. + EnergyCost = 0.0125f, //100MW Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR. + BaseDamage = 16000f, // Direct damage; one steel plate is worth 100. Mass = 0f, // 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 = 0f, // Recoil. This is applied to the Parent Grid. @@ -51,7 +51,7 @@ partial class Parts 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 = 20, // Diameter is minimum length of LineShape or minimum diameter of SphereShape. + Diameter = 2, // Diameter is minimum length of LineShape or minimum diameter of SphereShape. }, ObjectsHit = new ObjectsHitDef { @@ -87,7 +87,7 @@ partial class Parts Pattern = new PatternDef { Patterns = new[] { // If enabled, set of multiple ammos to fire in order instead of the main ammo. - "", + "Nyx Beam Fake", "Nyx Beam Fake", "Nyx Beam Fake", "Nyx Beam Fake", "Nyx Beam Fake", "Nyx Beam Fake", "Nyx Beam Fake", "Nyx Beam Fake", "Nyx Beam Fake", }, Mode = Never, // Select when to activate this pattern, options: Never, Weapon, Fragment, Both TriggerChance = 1f, // This is % @@ -419,6 +419,395 @@ partial class Parts }, // Don't edit below this line }; + private AmmoDef HAS_Nyx_Ammo_Fake => new AmmoDef // Your ID, for slotting into the Weapon CS + { + AmmoMagazine = "", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo. + AmmoRound = "Nyx Beam Fake", // 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 = 0f, //100MW Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR. + BaseDamage = 0f, // Direct damage; one steel plate is worth 100. + Mass = 0f, // 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 = 0f, // Recoil. This is applied to the Parent Grid. + DecayPerShot = 0f, // Damage to the firing weapon itself. + HardPointUsable = false, // 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 + + 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 = 5, // 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 = Never, // 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. + 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. + }, + Deform = new DeformDef + { + DeformType = NoDeform, + DeformDelay = 30, + }, + DamageType = new DamageTypes // Damage type of each element of the projectile's damage; Kinetic, Energy + { + Base = Energy, // Base Damage uses this + AreaEffect = Energy, + Detonation = Energy, + Shield = Energy, // Damage against shields is currently all of one type per projectile. Shield Bypass Weapons, always Deal Energy regardless of this line + }, + 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 = 1f, // Radius of AOE effect, in meters. + Damage = 0f, + 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 = Exponential, //.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 = "particleName", // Particle SubtypeID, from your Particle SBC + CustomSound = "soundName", // 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). + 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 = 0f, // Degrees, Is pointed forward + TargetLossTime = 0, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). + MaxLifeTime = 0, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). 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 = 4000, // voxel phasing if you go above 5100 + MaxTrajectory = 4500f, // Max Distance the projectile or beam can Travel. + DeaccelTime = 0, // 0 is disabled, a value causes the projectile to come to rest, spawn a field and remain for a time (Measured in game ticks, 60 = 1 second) + GravityMultiplier = 20f, // 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 = 1f, // 0 is perfect, hit accuracy will be a random num of meters between 0 and this value. + Aggressiveness = 3f, // 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 = false, // 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 = true, + 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 = "", + 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: -10f, end: 10f), // 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 = true, + Length = 10f, // + Width = 0.25f, // + Color = Color(red: 3, green: 10, blue: 50f, 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 = true, + Textures = new[] { + "WeaponLaser", // Please always have this Line set, if this Section is enabled. + }, + TextureMode = Normal, + DecayTime = 12, // In Ticks. 1 = 1 Additional Tracer generated per motion, 33 is 33 lines drawn per projectile. Keep this number low. + Color = Color(red: 3, green: 10, blue: 50, alpha: 1), + Back = false, + CustomWidth = 0.25f, + UseWidthVariance = false, + UseColorFade = false, + }, + OffsetEffect = new OffsetEffectDef + { + MaxOffset = 0,// 0 offset value disables this effect + MinLength = 0.2f, + MaxLength = 3, + }, + }, + }, + AmmoAudio = new AmmoAudioDef + { + TravelSound = "", // SubtypeID for your Sound File. Travel, is sound generated around your Projectile in flight + HitSound = "", + 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 + }; + + } } diff --git a/Weapon Mods/Military Industrial Complex/Data/Scripts/CoreParts/MetalStorm.cs b/Weapon Mods/Military Industrial Complex/Data/Scripts/CoreParts/MetalStorm.cs index 913c37668..ca3edb9f5 100644 --- a/Weapon Mods/Military Industrial Complex/Data/Scripts/CoreParts/MetalStorm.cs +++ b/Weapon Mods/Military Industrial Complex/Data/Scripts/CoreParts/MetalStorm.cs @@ -88,8 +88,8 @@ partial class Parts { HardPoint = new HardPointDef { PartName = "Metal Storm", // 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 = 3f, // How many degrees off target a turret can fire at. 0 - 180 firing angle. + DeviateShotAngle = 0.085f, // Projectile inaccuracy in degrees. + AimingTolerance = 5f, // 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 - while a target is available. AddToleranceToTracking = false, // Allows turret to track to the edge of the AimingTolerance cone instead of dead centre. diff --git a/Weapon Mods/Military Industrial Complex/Data/Scripts/CoreParts/MetalStormAmmo.cs b/Weapon Mods/Military Industrial Complex/Data/Scripts/CoreParts/MetalStormAmmo.cs index 0fdcd81d9..2b204591a 100644 --- a/Weapon Mods/Military Industrial Complex/Data/Scripts/CoreParts/MetalStormAmmo.cs +++ b/Weapon Mods/Military Industrial Complex/Data/Scripts/CoreParts/MetalStormAmmo.cs @@ -135,7 +135,7 @@ partial class Parts MaxLifeTime = 0, // 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 = 3150, // Max Distance the projectile or beam can Travel. + MaxTrajectory = 3000, // 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. diff --git a/Weapon Mods/NorseHeavyIndustries/Data/Scripts/Coreparts/NHI_Fixed/NHI_Fixed_Autocannon_Ammo.cs b/Weapon Mods/NorseHeavyIndustries/Data/Scripts/Coreparts/NHI_Fixed/NHI_Fixed_Autocannon_Ammo.cs index 1a590a03e..61a400f59 100644 --- a/Weapon Mods/NorseHeavyIndustries/Data/Scripts/Coreparts/NHI_Fixed/NHI_Fixed_Autocannon_Ammo.cs +++ b/Weapon Mods/NorseHeavyIndustries/Data/Scripts/Coreparts/NHI_Fixed/NHI_Fixed_Autocannon_Ammo.cs @@ -121,7 +121,7 @@ partial class Parts Armor = 0.25f, // 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. + NonArmor = 0.125f, // Multiplier for damage against every else. }, Shields = new ShieldDef { @@ -507,7 +507,7 @@ partial class Parts Armor = 1f, // Multiplier for damage against all armor. This is multiplied with the specific armor type multiplier (light, heavy). Light = 0.25f, // Multiplier for damage against light armor. Heavy = 0.5f, // Multiplier for damage against heavy armor. - NonArmor = 0.125f, // Multiplier for damage against every else. + NonArmor = 1f, // Multiplier for damage against every else. }, Shields = new ShieldDef { diff --git a/Weapon Mods/NorseHeavyIndustries/Data/Scripts/Coreparts/NHI_Fixed/NHI_Fixed_Gatling_Laser_Ammo.cs b/Weapon Mods/NorseHeavyIndustries/Data/Scripts/Coreparts/NHI_Fixed/NHI_Fixed_Gatling_Laser_Ammo.cs index f91aa061e..053d39939 100644 --- a/Weapon Mods/NorseHeavyIndustries/Data/Scripts/Coreparts/NHI_Fixed/NHI_Fixed_Gatling_Laser_Ammo.cs +++ b/Weapon Mods/NorseHeavyIndustries/Data/Scripts/Coreparts/NHI_Fixed/NHI_Fixed_Gatling_Laser_Ammo.cs @@ -801,9 +801,5 @@ partial class Parts } }, // Don't edit below this line }; - - - - } } diff --git a/Weapon Mods/OnyxArmamentCo/Data/Scripts/CoreParts/DeimosPhobos_Ammo.cs b/Weapon Mods/OnyxArmamentCo/Data/Scripts/CoreParts/DeimosPhobos_Ammo.cs index d754c094d..33d3f2f8c 100644 --- a/Weapon Mods/OnyxArmamentCo/Data/Scripts/CoreParts/DeimosPhobos_Ammo.cs +++ b/Weapon Mods/OnyxArmamentCo/Data/Scripts/CoreParts/DeimosPhobos_Ammo.cs @@ -261,7 +261,7 @@ partial class Parts MaxLifeTime = 0, // 0 is disabled, Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). 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 = 8000, // voxel phasing if you go above 5100 - MaxTrajectory = 7000f, // Max Distance the projectile or beam can Travel. + MaxTrajectory = 15000f, // Max Distance the projectile or beam can Travel. //FieldTime = 0, // 0 is disabled, a value causes the projectile to come to rest, spawn a field and remain for a time (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. diff --git a/Weapon Mods/REEECore/Data/ERPPC_Audio.sbc b/Weapon Mods/REEECore/Data/ERPPC_Audio.sbc index 692107da3..1e521325a 100644 --- a/Weapon Mods/REEECore/Data/ERPPC_Audio.sbc +++ b/Weapon Mods/REEECore/Data/ERPPC_Audio.sbc @@ -205,16 +205,16 @@ ERPPCImpact WEP_EXPL - 5000 + 4000 - - - + + + 1 HeavyFight 3 - 1.5 + 1 false 10 @@ -230,11 +230,11 @@ ERPPCImpactDist1 WEP_EXPL - 5000 + 4000 10 HeavyFight 3 - 2 + 1 false 50 @@ -249,11 +249,11 @@ ERPPCImpactDist2 WEP_EXPL - 5000 + 4000 10 HeavyFight 3 - 2 + 1 false 50 @@ -268,11 +268,11 @@ ERPPCImpactDist3 WEP_EXPL - 5000 + 4000 10 HeavyFight 3 - 1.5 + 1 false 50 diff --git a/Weapon Mods/REEECore/Data/Scripts/CoreParts/ERPPC.cs b/Weapon Mods/REEECore/Data/Scripts/CoreParts/ERPPC.cs index 07c589d84..648c2cc4e 100644 --- a/Weapon Mods/REEECore/Data/Scripts/CoreParts/ERPPC.cs +++ b/Weapon Mods/REEECore/Data/Scripts/CoreParts/ERPPC.cs @@ -49,7 +49,7 @@ partial class Parts { 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 = 8000, // Maximum distance at which targets will be automatically shot at; 0 = unlimited. + MaxTargetDistance = 7000, // 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 = 8, // Maximum number of blocks to randomize between; 0 = unlimited. @@ -151,12 +151,12 @@ partial class Parts { 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 = 480, // Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). + 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 = 30, // Heat generated per shot. - MaxHeat = 50, // Max heat before weapon enters cooldown (70% of max heat). - Cooldown = 0f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95 + HeatPerShot = 50, // Heat generated per shot. + MaxHeat = 90, // Max heat before weapon enters cooldown (70% of max heat). + Cooldown = 10f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95 HeatSinkRate = 5, // Amount of heat lost per second. DegradeRof = false, // Progressively lower rate of fire when over 80% heat threshold (80% of max heat). ShotsInBurst = 1, // 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. diff --git a/Weapon Mods/REEECore/Data/Scripts/CoreParts/ERPPC_ammo.cs b/Weapon Mods/REEECore/Data/Scripts/CoreParts/ERPPC_ammo.cs index 6b1ae7a09..83de45c6d 100644 --- a/Weapon Mods/REEECore/Data/Scripts/CoreParts/ERPPC_ammo.cs +++ b/Weapon Mods/REEECore/Data/Scripts/CoreParts/ERPPC_ammo.cs @@ -34,7 +34,7 @@ partial class Parts AmmoMagazine = "ERPPCAmmo", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo. AmmoRound = "ERPPC Main", // Name of ammo in terminal, should be different for each ammo type used by the same weapon. HybridRound = true, // Use both a physical ammo magazine and energy per shot. - EnergyCost = 2f, // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR. + EnergyCost = 1.44f, // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR. BaseDamage = 5000f, // Direct damage; one steel plate is worth 100. Mass = 50f, // 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. @@ -105,7 +105,7 @@ partial class Parts // For the following modifier values: -1 = disabled (higher performance), 0 = no damage, 0.01f = 1% damage, 2 = 200% damage. FallOff = new FallOffDef { - Distance = 3000f, // Distance at which damage begins falling off. + Distance = 4000f, // Distance at which damage begins falling off. MinMultipler = 0.6f, // Value from 0.0001f to 1f where 0.1f would be a min damage of 10% of base damage. }, Grids = new GridSizeDef @@ -118,7 +118,7 @@ partial class Parts 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 = 0.75f, // Multiplier for damage against every else. + NonArmor = -1f, // Multiplier for damage against every else. }, Shields = new ShieldDef { @@ -173,7 +173,7 @@ partial class Parts Enable = true, Radius = 9f, // Radius of AOE effect, in meters. Damage = 30000f, - Depth = 3f, // Max depth of AOE effect, in meters. 0=disabled, and AOE effect will reach to a depth of the radius value + Depth = 4f, // 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 @@ -186,7 +186,7 @@ partial class Parts MinArmingTime = 0, // In ticks, before the Ammo is allowed to explode, detonate or similar; This affects shrapnel spawning. NoVisuals = false, NoSound = false, - ParticleScale = 0.33f, + ParticleScale = 0.3f, CustomParticle = "Starcore_PPC_WarpField", // Particle SubtypeID, from your Particle SBC CustomSound = "ERPPCImpact", // SubtypeID from your Audio SBC, not a filename Shape = Diamond, // Round or Diamond shape. Diamond is more performance friendly. @@ -204,7 +204,7 @@ partial class Parts //FieldTime = 0, // 0 is disabled, a value causes the projectile to come to rest, spawn a field and remain for a time (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 + RangeVariance = Random(start: 800, end: 900), //hehehe //subtracts value from MaxTrajectory MaxTrajectoryTime = 0, // How long the weapon must fire before it reaches MaxTrajectory. }, diff --git a/Weapon Mods/Starcore_Serpent_Arms_Heavy_Metal/Data/Scripts/CoreParts/Charon.cs b/Weapon Mods/Starcore_Serpent_Arms_Heavy_Metal/Data/Scripts/CoreParts/Charon.cs index 21f7fc219..67801cacd 100644 --- a/Weapon Mods/Starcore_Serpent_Arms_Heavy_Metal/Data/Scripts/CoreParts/Charon.cs +++ b/Weapon Mods/Starcore_Serpent_Arms_Heavy_Metal/Data/Scripts/CoreParts/Charon.cs @@ -135,9 +135,9 @@ partial class Parts { MagsToLoad = 1, // Number of physical magazines to consume on reload. DelayUntilFire = 90, // How long the weapon waits before shooting after being told to fire. Measured in game ticks (6 = 100ms, 60 = 1 seconds, etc..). HeatPerShot = 2, // Heat generated per shot. - MaxHeat = 480, // Max heat before weapon enters cooldown (70% of max heat). + MaxHeat = 240, // Max heat before weapon enters cooldown (70% of max heat). Cooldown = 0f, // Percentage of max heat to be under to start firing again after overheat; accepts 0 - 0.95 - HeatSinkRate = 8, // Amount of heat lost per second. + HeatSinkRate = 14, // 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..). diff --git a/Weapon Mods/Starcore_Serpent_Arms_Heavy_Metal/Data/Scripts/CoreParts/Hydra_12GA_Ammo.cs b/Weapon Mods/Starcore_Serpent_Arms_Heavy_Metal/Data/Scripts/CoreParts/Hydra_12GA_Ammo.cs index e3f4eff23..ac541e10e 100644 --- a/Weapon Mods/Starcore_Serpent_Arms_Heavy_Metal/Data/Scripts/CoreParts/Hydra_12GA_Ammo.cs +++ b/Weapon Mods/Starcore_Serpent_Arms_Heavy_Metal/Data/Scripts/CoreParts/Hydra_12GA_Ammo.cs @@ -693,7 +693,7 @@ partial class Parts }, AmmoGraphics = new GraphicDef { - ModelName = "K_SA_GaussProjectile", // Model Path goes here. "\\Models\\Ammo\\Starcore_Arrow_Missile_Large" + ModelName = "", // Model Path goes here. "\\Models\\Ammo\\Starcore_Arrow_Missile_Large" VisualProbability = 1f, // % ShieldHitDraw = false, Particles = new AmmoParticleDef @@ -709,7 +709,7 @@ partial class Parts }, Hit = new ParticleDef { - Name = "K_SA_GaussFire", + Name = "", ApplyToShield = true, Offset = Vector(x: 0, y: 0, z: 0), Extras = new ParticleOptionDef diff --git a/Weapon Mods/TIOStarcore/Data/Scripts/CoreParts/Plasma Weapons/X-4PlasAmmo.cs b/Weapon Mods/TIOStarcore/Data/Scripts/CoreParts/Plasma Weapons/X-4PlasAmmo.cs index d42e3b61a..1ee6a1ef0 100644 --- a/Weapon Mods/TIOStarcore/Data/Scripts/CoreParts/Plasma Weapons/X-4PlasAmmo.cs +++ b/Weapon Mods/TIOStarcore/Data/Scripts/CoreParts/Plasma Weapons/X-4PlasAmmo.cs @@ -42,7 +42,7 @@ partial class Parts AmmoMagazine = "PlasAmmo", // SubtypeId of physical ammo magazine. Use "Energy" for weapons without physical ammo. AmmoRound = "Plasma-X", // Name of ammo in terminal, should be different for each ammo type used by the same weapon. HybridRound = true, // Use both a physical ammo magazine and energy per shot. - EnergyCost = 0.823f, //120MW@0.823 //58MW@0.4 // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR. + EnergyCost = 0.4f, //120MW@0.823 //58MW@0.4 // Scaler for energy per shot (EnergyCost * BaseDamage * (RateOfFire / 3600) * BarrelsPerShot * TrajectilesPerBarrel). Uses EffectStrength instead of BaseDamage if EWAR. BaseDamage = 5000f, // 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.