Aetheric Drive
Added Aetheric Drive hardpoint and item behavior Added Drive RPM UI to HUD Fixed death not disabling continue option Disabling global input when dialog is visible Fixed loadout generator failure when zero price item present Replaced fixed top speed with drag coefficients
This commit is contained in:
parent
b171b940dc
commit
11bfc739fe
65 changed files with 2312 additions and 320 deletions
|
|
@ -252,6 +252,7 @@
|
|||
<Compile Include="Assets\Scripts\ServerShared\NIH\LinqFaster\SequenceEqual.cs" />
|
||||
<Compile Include="Assets\Scripts\ServerShared\NIH\LinqFaster\Skip.cs" />
|
||||
<Compile Include="Assets\Scripts\ServerShared\ItemManager.cs" />
|
||||
<Compile Include="Assets\Scripts\ServerShared\Behaviors\AetherDrive.cs" />
|
||||
<None Include="Assets\Scripts\ServerShared\NIH\LinqFaster\readme.txt" />
|
||||
<None Include="Assets\Scripts\ServerShared\Aetheria.Shared.Unity.asmdef" />
|
||||
<Reference Include="System.Threading.Tasks.Extensions">
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ Material:
|
|||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _Scale: 1.441227
|
||||
- _Scale: 0.5
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
|
|
|
|||
|
|
@ -184,9 +184,9 @@ RectTransform:
|
|||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 8, y: -4}
|
||||
m_SizeDelta: {x: 128, y: 18.64}
|
||||
m_SizeDelta: {x: -16, y: 18.64}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!222 &7248497949783907356
|
||||
CanvasRenderer:
|
||||
|
|
@ -495,9 +495,9 @@ RectTransform:
|
|||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 4}
|
||||
m_SizeDelta: {x: -4, y: -8}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 9}
|
||||
m_SizeDelta: {x: -4, y: 1.5}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5150349052900313155
|
||||
CanvasRenderer:
|
||||
|
|
@ -520,14 +520,14 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.85, g: 0.95199996, b: 1, a: 0.32156864}
|
||||
m_Color: {r: 0.85, g: 0.95199996, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 51c246761190b2349b69b5f87681c62a, type: 3}
|
||||
m_Sprite: {fileID: 21300000, guid: ea8a1213adadb5a4fba6b1785033a34b, type: 3}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
|
|
@ -916,7 +916,7 @@ MonoBehaviour:
|
|||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 7c96f826a29855143bed2f0c15b198e6, type: 3}
|
||||
m_Sprite: {fileID: 21300000, guid: e0e5557671b85144099aa4c15740eca5, type: 3}
|
||||
m_improveResolution: 0
|
||||
m_Resolution: 0.03439772
|
||||
m_useNativeSize: 1
|
||||
|
|
|
|||
|
|
@ -1111,13 +1111,21 @@
|
|||
"id": "2e2023b8-ce3b-4cb3-a12a-ff4ac610f11b",
|
||||
"actions": [
|
||||
{
|
||||
"name": "Map Toggle",
|
||||
"name": "Zone Map",
|
||||
"type": "Button",
|
||||
"id": "e43f020b-dec0-43d2-a83b-1390d45819be",
|
||||
"expectedControlType": "Button",
|
||||
"processors": "",
|
||||
"interactions": ""
|
||||
},
|
||||
{
|
||||
"name": "Galaxy Map",
|
||||
"type": "Button",
|
||||
"id": "d198f18c-8c55-4a31-a694-4959c763f664",
|
||||
"expectedControlType": "Button",
|
||||
"processors": "",
|
||||
"interactions": ""
|
||||
},
|
||||
{
|
||||
"name": "Inventory",
|
||||
"type": "Button",
|
||||
|
|
@ -1151,7 +1159,7 @@
|
|||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "Keyboard&Mouse",
|
||||
"action": "Map Toggle",
|
||||
"action": "Zone Map",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
|
|
@ -1187,6 +1195,17 @@
|
|||
"action": "MainMenu",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "f90929d5-d8d1-40dc-acc7-7ae294971d12",
|
||||
"path": "<Keyboard>/m",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "Keyboard&Mouse",
|
||||
"action": "Galaxy Map",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
BIN
Assets/Resources/Settings.asset
(Stored with Git LFS)
BIN
Assets/Resources/Settings.asset
(Stored with Git LFS)
Binary file not shown.
|
|
@ -74,6 +74,8 @@ capacitor by Giovanny
|
|||
Mine by Creaticca Creative Agency
|
||||
pattern by Andrejs Kirma
|
||||
edit by The Icon Z
|
||||
Resize by Markus
|
||||
Rotate by Rohith M
|
||||
|
||||
Other
|
||||
|
||||
|
|
|
|||
BIN
Assets/Resources/Sprites/Icons/Resize1.png
(Stored with Git LFS)
Normal file
BIN
Assets/Resources/Sprites/Icons/Resize1.png
(Stored with Git LFS)
Normal file
Binary file not shown.
108
Assets/Resources/Sprites/Icons/Resize1.png.meta
Normal file
108
Assets/Resources/Sprites/Icons/Resize1.png.meta
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 55bed7a5ff978bf4c8cbda9971585df0
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 32
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 32
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Resources/Sprites/Icons/Rotate.png
(Stored with Git LFS)
Normal file
BIN
Assets/Resources/Sprites/Icons/Rotate.png
(Stored with Git LFS)
Normal file
Binary file not shown.
108
Assets/Resources/Sprites/Icons/Rotate.png.meta
Normal file
108
Assets/Resources/Sprites/Icons/Rotate.png.meta
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4b33557baae0da54a96c0aa97bf752ee
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 32
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 32
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Resources/Sprites/line-basic.png
(Stored with Git LFS)
Normal file
BIN
Assets/Resources/Sprites/line-basic.png
(Stored with Git LFS)
Normal file
Binary file not shown.
108
Assets/Resources/Sprites/line-basic.png.meta
Normal file
108
Assets/Resources/Sprites/line-basic.png.meta
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e0e5557671b85144099aa4c15740eca5
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -802,8 +802,8 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 741153267}
|
||||
m_LocalRotation: {x: 0.015506903, y: 0.9502416, z: -0.30741313, w: 0.04793323}
|
||||
m_LocalPosition: {x: -117.51999, y: -77.08743, z: 149.09026}
|
||||
m_LocalRotation: {x: 0.015506932, y: 0.9502416, z: -0.30741316, w: 0.04793331}
|
||||
m_LocalPosition: {x: -117.520035, y: -77.087425, z: 149.09027}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 412917866}
|
||||
|
|
@ -1234,8 +1234,8 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 965376321}
|
||||
m_LocalRotation: {x: 0.015506903, y: 0.9502416, z: -0.30741313, w: 0.04793323}
|
||||
m_LocalPosition: {x: -117.51999, y: -77.08743, z: 149.09026}
|
||||
m_LocalRotation: {x: 0.015506932, y: 0.9502416, z: -0.30741316, w: 0.04793331}
|
||||
m_LocalPosition: {x: -117.520035, y: -77.087425, z: 149.09027}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
|
|
|
|||
|
|
@ -1124,13 +1124,21 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
|
|||
""id"": ""2e2023b8-ce3b-4cb3-a12a-ff4ac610f11b"",
|
||||
""actions"": [
|
||||
{
|
||||
""name"": ""Map Toggle"",
|
||||
""name"": ""Zone Map"",
|
||||
""type"": ""Button"",
|
||||
""id"": ""e43f020b-dec0-43d2-a83b-1390d45819be"",
|
||||
""expectedControlType"": ""Button"",
|
||||
""processors"": """",
|
||||
""interactions"": """"
|
||||
},
|
||||
{
|
||||
""name"": ""Galaxy Map"",
|
||||
""type"": ""Button"",
|
||||
""id"": ""d198f18c-8c55-4a31-a694-4959c763f664"",
|
||||
""expectedControlType"": ""Button"",
|
||||
""processors"": """",
|
||||
""interactions"": """"
|
||||
},
|
||||
{
|
||||
""name"": ""Inventory"",
|
||||
""type"": ""Button"",
|
||||
|
|
@ -1164,7 +1172,7 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
|
|||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""Keyboard&Mouse"",
|
||||
""action"": ""Map Toggle"",
|
||||
""action"": ""Zone Map"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
|
|
@ -1200,6 +1208,17 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
|
|||
""action"": ""MainMenu"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""f90929d5-d8d1-40dc-acc7-7ae294971d12"",
|
||||
""path"": ""<Keyboard>/m"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""Keyboard&Mouse"",
|
||||
""action"": ""Galaxy Map"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1284,7 +1303,8 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
|
|||
m_UI_Drag = m_UI.FindAction("Drag", throwIfNotFound: true);
|
||||
// Global
|
||||
m_Global = asset.FindActionMap("Global", throwIfNotFound: true);
|
||||
m_Global_MapToggle = m_Global.FindAction("Map Toggle", throwIfNotFound: true);
|
||||
m_Global_ZoneMap = m_Global.FindAction("Zone Map", throwIfNotFound: true);
|
||||
m_Global_GalaxyMap = m_Global.FindAction("Galaxy Map", throwIfNotFound: true);
|
||||
m_Global_Inventory = m_Global.FindAction("Inventory", throwIfNotFound: true);
|
||||
m_Global_Dock = m_Global.FindAction("Dock", throwIfNotFound: true);
|
||||
m_Global_MainMenu = m_Global.FindAction("MainMenu", throwIfNotFound: true);
|
||||
|
|
@ -1651,7 +1671,8 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
|
|||
// Global
|
||||
private readonly InputActionMap m_Global;
|
||||
private IGlobalActions m_GlobalActionsCallbackInterface;
|
||||
private readonly InputAction m_Global_MapToggle;
|
||||
private readonly InputAction m_Global_ZoneMap;
|
||||
private readonly InputAction m_Global_GalaxyMap;
|
||||
private readonly InputAction m_Global_Inventory;
|
||||
private readonly InputAction m_Global_Dock;
|
||||
private readonly InputAction m_Global_MainMenu;
|
||||
|
|
@ -1659,7 +1680,8 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
|
|||
{
|
||||
private @AetheriaInput m_Wrapper;
|
||||
public GlobalActions(@AetheriaInput wrapper) { m_Wrapper = wrapper; }
|
||||
public InputAction @MapToggle => m_Wrapper.m_Global_MapToggle;
|
||||
public InputAction @ZoneMap => m_Wrapper.m_Global_ZoneMap;
|
||||
public InputAction @GalaxyMap => m_Wrapper.m_Global_GalaxyMap;
|
||||
public InputAction @Inventory => m_Wrapper.m_Global_Inventory;
|
||||
public InputAction @Dock => m_Wrapper.m_Global_Dock;
|
||||
public InputAction @MainMenu => m_Wrapper.m_Global_MainMenu;
|
||||
|
|
@ -1672,9 +1694,12 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
|
|||
{
|
||||
if (m_Wrapper.m_GlobalActionsCallbackInterface != null)
|
||||
{
|
||||
@MapToggle.started -= m_Wrapper.m_GlobalActionsCallbackInterface.OnMapToggle;
|
||||
@MapToggle.performed -= m_Wrapper.m_GlobalActionsCallbackInterface.OnMapToggle;
|
||||
@MapToggle.canceled -= m_Wrapper.m_GlobalActionsCallbackInterface.OnMapToggle;
|
||||
@ZoneMap.started -= m_Wrapper.m_GlobalActionsCallbackInterface.OnZoneMap;
|
||||
@ZoneMap.performed -= m_Wrapper.m_GlobalActionsCallbackInterface.OnZoneMap;
|
||||
@ZoneMap.canceled -= m_Wrapper.m_GlobalActionsCallbackInterface.OnZoneMap;
|
||||
@GalaxyMap.started -= m_Wrapper.m_GlobalActionsCallbackInterface.OnGalaxyMap;
|
||||
@GalaxyMap.performed -= m_Wrapper.m_GlobalActionsCallbackInterface.OnGalaxyMap;
|
||||
@GalaxyMap.canceled -= m_Wrapper.m_GlobalActionsCallbackInterface.OnGalaxyMap;
|
||||
@Inventory.started -= m_Wrapper.m_GlobalActionsCallbackInterface.OnInventory;
|
||||
@Inventory.performed -= m_Wrapper.m_GlobalActionsCallbackInterface.OnInventory;
|
||||
@Inventory.canceled -= m_Wrapper.m_GlobalActionsCallbackInterface.OnInventory;
|
||||
|
|
@ -1688,9 +1713,12 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
|
|||
m_Wrapper.m_GlobalActionsCallbackInterface = instance;
|
||||
if (instance != null)
|
||||
{
|
||||
@MapToggle.started += instance.OnMapToggle;
|
||||
@MapToggle.performed += instance.OnMapToggle;
|
||||
@MapToggle.canceled += instance.OnMapToggle;
|
||||
@ZoneMap.started += instance.OnZoneMap;
|
||||
@ZoneMap.performed += instance.OnZoneMap;
|
||||
@ZoneMap.canceled += instance.OnZoneMap;
|
||||
@GalaxyMap.started += instance.OnGalaxyMap;
|
||||
@GalaxyMap.performed += instance.OnGalaxyMap;
|
||||
@GalaxyMap.canceled += instance.OnGalaxyMap;
|
||||
@Inventory.started += instance.OnInventory;
|
||||
@Inventory.performed += instance.OnInventory;
|
||||
@Inventory.canceled += instance.OnInventory;
|
||||
|
|
@ -1772,7 +1800,8 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
|
|||
}
|
||||
public interface IGlobalActions
|
||||
{
|
||||
void OnMapToggle(InputAction.CallbackContext context);
|
||||
void OnZoneMap(InputAction.CallbackContext context);
|
||||
void OnGalaxyMap(InputAction.CallbackContext context);
|
||||
void OnInventory(InputAction.CallbackContext context);
|
||||
void OnDock(InputAction.CallbackContext context);
|
||||
void OnMainMenu(InputAction.CallbackContext context);
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
public static Sector CurrentSector;
|
||||
|
||||
|
||||
|
||||
public GameSettings Settings;
|
||||
//public string StarterShipTemplate = "Longinus";
|
||||
public float2 Sensitivity;
|
||||
|
|
@ -104,6 +106,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
public InventoryPanel ShipPanel;
|
||||
public InventoryPanel TargetShipPanel;
|
||||
public ConfirmationDialog Dialog;
|
||||
public ContextMenu Context;
|
||||
public DropdownMenu Dropdown;
|
||||
|
||||
public float IntroDuration;
|
||||
|
||||
|
|
@ -160,17 +164,11 @@ public class ActionGameManager : MonoBehaviour
|
|||
File.WriteAllBytes(Path.Combine(_loadoutPath.FullName, $"{pack.Name}.loadout"), MessagePackSerializer.Serialize(pack));
|
||||
}
|
||||
|
||||
private void OnApplicationQuit()
|
||||
{
|
||||
if(CurrentSector!=null)
|
||||
{
|
||||
SaveState();
|
||||
}
|
||||
}
|
||||
private void OnApplicationQuit() => SaveState();
|
||||
|
||||
public void SaveState()
|
||||
{
|
||||
PlayerSettings.CurrentRun = new SavedGame(CurrentSector, Zone, DockedEntity??CurrentEntity);
|
||||
PlayerSettings.SavedRun = CurrentSector == null ? null : new SavedGame(CurrentSector, Zone, DockedEntity ?? CurrentEntity);
|
||||
SavePlayerSettings();
|
||||
}
|
||||
|
||||
|
|
@ -208,57 +206,15 @@ public class ActionGameManager : MonoBehaviour
|
|||
ZoneRenderer.MinimapDistance = Settings.MinimapZoomLevels[_zoomLevelIndex];
|
||||
};
|
||||
|
||||
Input.Global.MapToggle.performed += context =>
|
||||
Input.Global.ZoneMap.performed += context =>
|
||||
{
|
||||
if (EventSystem.current.currentSelectedGameObject?.GetComponent<TMP_InputField>() != null) return;
|
||||
if (MainMenu.gameObject.activeSelf) return;
|
||||
if (Menu.gameObject.activeSelf && Menu.CurrentTab == MenuTab.Map)
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
Menu.gameObject.SetActive(false);
|
||||
if (CurrentEntity != null && CurrentEntity.Parent == null)
|
||||
{
|
||||
Input.Player.Enable();
|
||||
GameplayUI.gameObject.SetActive(true);
|
||||
|
||||
SchematicDisplay.ShowShip(CurrentEntity);
|
||||
ShipPanel.Display(CurrentEntity, true);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
Input.Player.Disable();
|
||||
GameplayUI.gameObject.SetActive(false);
|
||||
Menu.ShowTab(MenuTab.Map);
|
||||
ToggleMenuTab(MenuTab.Map);
|
||||
MenuMap.Position = CurrentEntity.Position.xz;
|
||||
};
|
||||
|
||||
Input.Global.Inventory.performed += context =>
|
||||
{
|
||||
if (EventSystem.current.currentSelectedGameObject?.GetComponent<TMP_InputField>() != null) return;
|
||||
if (MainMenu.gameObject.activeSelf) return;
|
||||
if (Menu.gameObject.activeSelf && Menu.CurrentTab == MenuTab.Inventory)
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
Menu.gameObject.SetActive(false);
|
||||
if (CurrentEntity != null && CurrentEntity.Parent == null)
|
||||
{
|
||||
Input.Player.Enable();
|
||||
GameplayUI.gameObject.SetActive(true);
|
||||
|
||||
SchematicDisplay.ShowShip(CurrentEntity);
|
||||
ShipPanel.Display(CurrentEntity, true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
Input.Global.Inventory.performed += context => ToggleMenuTab(MenuTab.Inventory);
|
||||
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
Input.Player.Disable();
|
||||
Menu.ShowTab(MenuTab.Inventory);
|
||||
GameplayUI.gameObject.SetActive(false);
|
||||
};
|
||||
Input.Global.GalaxyMap.performed += context => ToggleMenuTab(MenuTab.Galaxy);
|
||||
|
||||
Input.Global.Dock.performed += context =>
|
||||
{
|
||||
|
|
@ -317,33 +273,10 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
Input.Player.EnterWormhole.performed += context =>
|
||||
{
|
||||
if(CurrentEntity is Ship ship)
|
||||
foreach (var wormhole in ZoneRenderer.WormholeInstances.Keys)
|
||||
{
|
||||
foreach (var wormhole in ZoneRenderer.WormholeInstances.Keys)
|
||||
{
|
||||
if (length(wormhole.Position - CurrentEntity.Position.xz) < Settings.GameplaySettings.WormholeExitRadius)
|
||||
{
|
||||
var oldZone = Zone;
|
||||
// var wormholeCameraFollow = new GameObject("Wormhole Camera Follow").transform;
|
||||
// wormholeCameraFollow.position = new Vector3(wormhole.Position.x, -50, wormhole.Position.y);
|
||||
// wormholeCameraFollow.rotation = Quaternion.LookRotation(Vector3.down, ship.LookDirection);
|
||||
// WormholeCamera.enabled = true;
|
||||
// WormholeCamera.Follow = wormholeCameraFollow;
|
||||
// FollowCamera.enabled = false;
|
||||
ship.EnterWormhole(wormhole.Position);
|
||||
ship.OnEnteredWormhole += () =>
|
||||
{
|
||||
PopulateLevel(wormhole.Target);
|
||||
foreach(var zone in wormhole.Target.AdjacentZones)
|
||||
CurrentSector.DiscoveredZones.Add(zone);
|
||||
SectorMap.QueueZoneReveal(wormhole.Target.AdjacentZones);
|
||||
ship.ExitWormhole(ZoneRenderer.WormholeInstances.Keys.First(w=>w.Target==oldZone.SectorZone).Position,
|
||||
Settings.GameplaySettings.WormholeExitVelocity * ItemManager.Random.NextFloat2Direction());
|
||||
CurrentEntity.Zone = Zone;
|
||||
SaveState();
|
||||
};
|
||||
}
|
||||
}
|
||||
if (!(length(wormhole.Position - CurrentEntity.Position.xz) < Settings.GameplaySettings.WormholeExitRadius)) continue;
|
||||
EnterWormhole(wormhole);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -625,6 +558,30 @@ public class ActionGameManager : MonoBehaviour
|
|||
});
|
||||
}
|
||||
|
||||
private void EnterWormhole(Wormhole wormhole)
|
||||
{
|
||||
if (!(CurrentEntity is Ship ship)) return;
|
||||
// var wormholeCameraFollow = new GameObject("Wormhole Camera Follow").transform;
|
||||
// wormholeCameraFollow.position = new Vector3(wormhole.Position.x, -50, wormhole.Position.y);
|
||||
// wormholeCameraFollow.rotation = Quaternion.LookRotation(Vector3.down, ship.LookDirection);
|
||||
// WormholeCamera.enabled = true;
|
||||
// WormholeCamera.Follow = wormholeCameraFollow;
|
||||
// FollowCamera.enabled = false;
|
||||
ship.EnterWormhole(wormhole.Position);
|
||||
ship.OnEnteredWormhole += () =>
|
||||
{
|
||||
var oldZone = Zone;
|
||||
PopulateLevel(wormhole.Target);
|
||||
foreach (var zone in wormhole.Target.AdjacentZones)
|
||||
CurrentSector.DiscoveredZones.Add(zone);
|
||||
SectorMap.QueueZoneReveal(wormhole.Target.AdjacentZones);
|
||||
ship.ExitWormhole(ZoneRenderer.WormholeInstances.Keys.First(w => w.Target == oldZone.SectorZone).Position,
|
||||
Settings.GameplaySettings.WormholeExitVelocity * ItemManager.Random.NextFloat2Direction());
|
||||
CurrentEntity.Zone = Zone;
|
||||
SaveState();
|
||||
};
|
||||
}
|
||||
|
||||
public void PopulateLevel(SectorZone sectorZone)
|
||||
{
|
||||
if (sectorZone == null) throw new ArgumentNullException(nameof(sectorZone));
|
||||
|
|
@ -661,11 +618,36 @@ public class ActionGameManager : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
private void ToggleMenuTab(MenuTab tab)
|
||||
{
|
||||
if (EventSystem.current.currentSelectedGameObject?.GetComponent<TMP_InputField>() != null) return;
|
||||
if (MainMenu.gameObject.activeSelf) return;
|
||||
if (Menu.gameObject.activeSelf && Menu.CurrentTab == tab)
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
Menu.gameObject.SetActive(false);
|
||||
if (CurrentEntity != null && CurrentEntity.Parent == null)
|
||||
{
|
||||
Input.Player.Enable();
|
||||
GameplayUI.gameObject.SetActive(true);
|
||||
|
||||
SchematicDisplay.ShowShip(CurrentEntity);
|
||||
ShipPanel.Display(CurrentEntity, true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
Input.Player.Disable();
|
||||
Menu.ShowTab(tab);
|
||||
GameplayUI.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
private void StartGame()
|
||||
{
|
||||
if (CurrentSector != null)
|
||||
{
|
||||
if (PlayerSettings.CurrentRun == null)
|
||||
if (PlayerSettings.SavedRun == null)
|
||||
{
|
||||
SectorMap.QueueZoneReveal(CurrentSector.Entrance.AdjacentZones.Prepend(CurrentSector.Entrance));
|
||||
PopulateLevel(CurrentSector.Entrance);
|
||||
|
|
@ -688,8 +670,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
foreach(var group in CurrentSector.DiscoveredZones
|
||||
.GroupBy(dz=>dz.Distance[CurrentSector.Entrance]))
|
||||
SectorMap.QueueZoneReveal(group);
|
||||
PopulateLevel(CurrentSector.Zones[PlayerSettings.CurrentRun.CurrentZone]);
|
||||
var targetEntity = Zone.Entities[PlayerSettings.CurrentRun.CurrentZoneEntity];
|
||||
PopulateLevel(CurrentSector.Zones[PlayerSettings.SavedRun.CurrentZone]);
|
||||
var targetEntity = Zone.Entities[PlayerSettings.SavedRun.CurrentZoneEntity];
|
||||
if (targetEntity is OrbitalEntity orbitalEntity)
|
||||
{
|
||||
CurrentEntity = targetEntity.Children.First(c => c is Ship {IsPlayerShip: true});
|
||||
|
|
@ -913,42 +895,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
_visibleHostileIndicators.Remove(removeEvent.Value);
|
||||
}));
|
||||
|
||||
_shipSubscriptions.Add(CurrentEntity.Death.Subscribe(cause =>
|
||||
{
|
||||
var deathTime = Time.time;
|
||||
UnbindEntity();
|
||||
CurrentEntity = null;
|
||||
VolumeRenderer.EnableDepth = false;
|
||||
MainMenu.gameObject.SetActive(true);
|
||||
Menu.gameObject.SetActive(false);
|
||||
PlayerSettings.CurrentRun = null;
|
||||
SavePlayerSettings();
|
||||
Observable.EveryUpdate()
|
||||
.Where(_ => Time.time - deathTime < DeathPPTransitionTime)
|
||||
.Subscribe(_ =>
|
||||
{
|
||||
var t = (Time.time - deathTime) / DeathPPTransitionTime;
|
||||
if(cause==CauseOfDeath.Heatstroke)
|
||||
{
|
||||
HeatstrokePP.weight = 1 - t;
|
||||
SevereHeatstrokePP.weight = 1 - t;
|
||||
}
|
||||
else if (cause == CauseOfDeath.Hypothermia)
|
||||
{
|
||||
HypothermiaPP.weight = 1 - t;
|
||||
SevereHypothermiaPP.weight = 1 - t;
|
||||
}
|
||||
DeathPP.weight = t;
|
||||
},
|
||||
() =>
|
||||
{
|
||||
HeatstrokePP.weight = 0;
|
||||
SevereHeatstrokePP.weight = 0;
|
||||
HypothermiaPP.weight = 0;
|
||||
SevereHypothermiaPP.weight = 0;
|
||||
DeathPP.weight = 1;
|
||||
});
|
||||
}));
|
||||
_shipSubscriptions.Add(CurrentEntity.Death.Subscribe(Die));
|
||||
|
||||
_lockingIndicators = CurrentEntity.GetBehaviors<LockWeapon>()
|
||||
.Select(x =>
|
||||
|
|
@ -958,6 +905,43 @@ public class ActionGameManager : MonoBehaviour
|
|||
}).ToArray();
|
||||
}
|
||||
|
||||
private void Die(CauseOfDeath cause)
|
||||
{
|
||||
var deathTime = Time.time;
|
||||
UnbindEntity();
|
||||
CurrentEntity = null;
|
||||
VolumeRenderer.EnableDepth = false;
|
||||
MainMenu.gameObject.SetActive(true);
|
||||
Menu.gameObject.SetActive(false);
|
||||
CurrentSector = null;
|
||||
SavePlayerSettings();
|
||||
Observable.EveryUpdate()
|
||||
.Where(_ => Time.time - deathTime < DeathPPTransitionTime)
|
||||
.Subscribe(_ =>
|
||||
{
|
||||
var t = (Time.time - deathTime) / DeathPPTransitionTime;
|
||||
if(cause==CauseOfDeath.Heatstroke)
|
||||
{
|
||||
HeatstrokePP.weight = 1 - t;
|
||||
SevereHeatstrokePP.weight = 1 - t;
|
||||
}
|
||||
else if (cause == CauseOfDeath.Hypothermia)
|
||||
{
|
||||
HypothermiaPP.weight = 1 - t;
|
||||
SevereHypothermiaPP.weight = 1 - t;
|
||||
}
|
||||
DeathPP.weight = t;
|
||||
},
|
||||
() =>
|
||||
{
|
||||
HeatstrokePP.weight = 0;
|
||||
SevereHeatstrokePP.weight = 0;
|
||||
HypothermiaPP.weight = 0;
|
||||
SevereHypothermiaPP.weight = 0;
|
||||
DeathPP.weight = 1;
|
||||
});
|
||||
}
|
||||
|
||||
public void SaveZone(string name) => File.WriteAllBytes(
|
||||
Path.Combine(_gameDataDirectory.FullName, $"{name}.zone"), MessagePackSerializer.Serialize(Zone.PackZone()));
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,16 @@ public static class AetheriaMath
|
|||
{
|
||||
return source * exp(-lambda * dt);
|
||||
}
|
||||
|
||||
public static float3 Decay(float3 source, float lambda, float dt)
|
||||
{
|
||||
return source * exp(-lambda * dt);
|
||||
}
|
||||
|
||||
public static float3 Decay(float3 source, float3 lambda, float dt)
|
||||
{
|
||||
return source * exp(-lambda * dt);
|
||||
}
|
||||
|
||||
public static float Damp(float a, float b, float lambda, float dt)
|
||||
{
|
||||
|
|
|
|||
121
Assets/Scripts/ServerShared/Behaviors/AetherDrive.cs
Normal file
121
Assets/Scripts/ServerShared/Behaviors/AetherDrive.cs
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
using MessagePack;
|
||||
using Newtonsoft.Json;
|
||||
using Unity.Mathematics;
|
||||
using static Unity.Mathematics.math;
|
||||
|
||||
[Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn), EntityTypeRestriction(HullType.Ship), RuntimeInspectable]
|
||||
public class AetherDriveData : BehaviorData
|
||||
{
|
||||
[Inspectable, JsonProperty("diameters"), Key(1)]
|
||||
public float3 RotorDiameter;
|
||||
|
||||
[Inspectable, JsonProperty("masses"), Key(2)]
|
||||
public float3 RotorMass;
|
||||
|
||||
[Inspectable, JsonProperty("rpm"), Key(3), RuntimeInspectable]
|
||||
public PerformanceStat MaximumRpm;
|
||||
|
||||
[Inspectable, JsonProperty("couplingLambdas"), Key(4)]
|
||||
public float3 CouplingLambda;
|
||||
|
||||
[Inspectable, JsonProperty("couplingEfficiency"), Key(5), RuntimeInspectable]
|
||||
public PerformanceStat CouplingEfficiency;
|
||||
|
||||
[Inspectable, JsonProperty("torque"), Key(6), RuntimeInspectable]
|
||||
public PerformanceStat Torque;
|
||||
|
||||
[Inspectable, JsonProperty("torqueProfile"), Key(7), RuntimeInspectable]
|
||||
public BezierCurve TorqueProfile;
|
||||
|
||||
[Inspectable, JsonProperty("draw"), Key(8), RuntimeInspectable]
|
||||
public PerformanceStat EnergyDraw;
|
||||
|
||||
[Inspectable, JsonProperty("passiveCoupling"), Key(9), RuntimeInspectable]
|
||||
public PerformanceStat PassiveCoupling;
|
||||
|
||||
public override IBehavior CreateInstance(EquippedItem item)
|
||||
{
|
||||
return new AetherDrive(this, item);
|
||||
}
|
||||
}
|
||||
|
||||
public class AetherDrive : IBehavior
|
||||
{
|
||||
private AetherDriveData _data;
|
||||
private float3 _axis;
|
||||
|
||||
public EquippedItem Item { get; }
|
||||
public float3 Thrust { get; private set; }
|
||||
public float3 Rpm { get; private set; }
|
||||
public float MaximumRpm { get; private set; }
|
||||
|
||||
public BehaviorData Data => _data;
|
||||
public AetherDriveData DriveData => _data;
|
||||
|
||||
public float3 Axis
|
||||
{
|
||||
get => _axis;
|
||||
set => _axis = clamp(value, -1, 1);
|
||||
}
|
||||
|
||||
public AetherDrive(AetherDriveData data, EquippedItem item)
|
||||
{
|
||||
_data = data;
|
||||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
var rotorSpeed = Rpm * _data.RotorDiameter / 100;
|
||||
|
||||
var forward = normalize(Item.Entity.Direction);
|
||||
var right = forward.Rotate(ItemRotation.Clockwise);
|
||||
|
||||
var speed = float2(dot(Item.Entity.Velocity, forward), dot(Item.Entity.Velocity, right));
|
||||
var couplingEfficiency = Item.Evaluate(_data.CouplingEfficiency);
|
||||
var efficiency = float3(saturate(1 - speed / max(rotorSpeed.xy, 1) * sign(_axis.xy)) * couplingEfficiency, 1);
|
||||
|
||||
Thrust = (Rpm - AetheriaMath.Decay(Rpm, _data.CouplingLambda, dt)) * _data.RotorMass * efficiency;
|
||||
|
||||
var couplingLambda = _data.CouplingLambda * max(abs(_axis), Item.Evaluate(_data.PassiveCoupling));
|
||||
var previousRpm = Rpm;
|
||||
Rpm = AetheriaMath.Decay(Rpm, couplingLambda, dt);
|
||||
var rpmLoss = previousRpm - Rpm;
|
||||
var force = rpmLoss * _data.RotorMass * efficiency;
|
||||
|
||||
var heat = rpmLoss * _data.RotorMass * (1 - couplingEfficiency);
|
||||
Item.AddHeat((heat.x + heat.y + heat.z)*Item.ItemManager.GameplaySettings.AetherHeatMultiplier);
|
||||
|
||||
Item.Entity.Velocity += forward * (_axis.x * force.x / Item.Entity.Mass);
|
||||
Item.Entity.Velocity += right * (_axis.y * force.y / Item.Entity.Mass);
|
||||
Item.Entity.Direction = mul(Item.Entity.Direction,
|
||||
Unity.Mathematics.float2x2.Rotate(force.z * _axis.z * Item.ItemManager.GameplaySettings.AetherTorqueMultiplier / Item.Entity.Mass));
|
||||
|
||||
if(float.IsNaN(Item.Entity.Velocity.x))
|
||||
Item.ItemManager.Log("FUCK FUCK FUCK FUCK");
|
||||
|
||||
MaximumRpm = Item.Evaluate(_data.MaximumRpm);
|
||||
var torqueProfile = float3(
|
||||
_data.TorqueProfile.Evaluate(Rpm.x / MaximumRpm),
|
||||
_data.TorqueProfile.Evaluate(Rpm.y / MaximumRpm),
|
||||
_data.TorqueProfile.Evaluate(Rpm.z / MaximumRpm));
|
||||
var potentialTorque = Item.Evaluate(_data.Torque) * torqueProfile;
|
||||
var potentialRpmDelta = potentialTorque / length(_data.RotorMass) * dt;
|
||||
var actualRpmDelta = min(MaximumRpm - Rpm, potentialRpmDelta);
|
||||
var torqueRatio = actualRpmDelta / potentialRpmDelta;
|
||||
var draw = torqueRatio * Item.Evaluate(_data.EnergyDraw) / 3;
|
||||
|
||||
if (Item.Entity.TryConsumeEnergy((draw.x + draw.y + draw.z)*dt))
|
||||
{
|
||||
Rpm += actualRpmDelta;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2022c838bbc64a0d86cfbd477e6a379c
|
||||
timeCreated: 1618332827
|
||||
|
|
@ -22,11 +22,11 @@ public class AutoWeapon : InstantWeapon
|
|||
{
|
||||
}
|
||||
|
||||
public override bool Execute(float delta)
|
||||
public override bool Execute(float dt)
|
||||
{
|
||||
if(_firing && _burstRemaining == 0 && _cooldown < 0)
|
||||
Trigger();
|
||||
return base.Execute(delta);
|
||||
return base.Execute(dt);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ using static Unity.Mathematics.noise;
|
|||
|
||||
public interface IBehavior
|
||||
{
|
||||
bool Execute(float delta);
|
||||
bool Execute(float dt);
|
||||
BehaviorData Data { get; }
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ public abstract class PersistentBehaviorData
|
|||
Union(9, typeof(WearData)),
|
||||
Union(10, typeof(VelocityConversionData)),
|
||||
Union(11, typeof(VelocityLimitData)),
|
||||
// Union(13, typeof(PatrolControllerData)),
|
||||
Union(12, typeof(AetherDriveData)),
|
||||
// Union(14, typeof(TowingControllerData)),
|
||||
Union(15, typeof(CooldownData)),
|
||||
Union(16, typeof(HeatData)),
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class Capacitor : IBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
Capacity = Item.Evaluate(_data.Capacity);
|
||||
Efficiency = Item.Evaluate(_data.Efficiency);
|
||||
|
|
|
|||
|
|
@ -112,14 +112,14 @@ public class ChargedWeapon : InstantWeapon, IEventBehavior
|
|||
Velocity *= lerp(1, _data.ChargeFiringVelocityMultiplier, saturate(_charge));
|
||||
}
|
||||
|
||||
public override bool Execute(float delta)
|
||||
public override bool Execute(float dt)
|
||||
{
|
||||
if (_charging)
|
||||
{
|
||||
_charge += delta / ChargeTime;
|
||||
_charge += dt / ChargeTime;
|
||||
if (!_charged)
|
||||
{
|
||||
Item.AddHeat(ChargeHeat * (delta / ChargeTime));
|
||||
Item.AddHeat(ChargeHeat * (dt / ChargeTime));
|
||||
if(_charge > 1)
|
||||
{
|
||||
_charged = true;
|
||||
|
|
@ -136,7 +136,7 @@ public class ChargedWeapon : InstantWeapon, IEventBehavior
|
|||
Item.EquippableItem.Durability -= _data.FailureDamage;
|
||||
}
|
||||
}
|
||||
return base.Execute(delta);
|
||||
return base.Execute(dt);
|
||||
}
|
||||
|
||||
public override void Activate()
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class Cockpit : IBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,12 +62,12 @@ public class ConstantWeapon : Weapon, IProgressBehavior, IEventBehavior
|
|||
_data = data;
|
||||
}
|
||||
|
||||
public override bool Execute(float delta)
|
||||
public override bool Execute(float dt)
|
||||
{
|
||||
base.Execute(delta);
|
||||
base.Execute(dt);
|
||||
if (_firing)
|
||||
{
|
||||
if (!Item.Entity.TryConsumeEnergy(Item.Evaluate(_data.Energy) * delta))
|
||||
if (!Item.Entity.TryConsumeEnergy(Item.Evaluate(_data.Energy) * dt))
|
||||
{
|
||||
_firing = false;
|
||||
OnStopFiring?.Invoke();
|
||||
|
|
@ -77,7 +77,7 @@ public class ConstantWeapon : Weapon, IProgressBehavior, IEventBehavior
|
|||
{
|
||||
if (_reloading)
|
||||
{
|
||||
_reload -= delta / _data.ReloadTime;
|
||||
_reload -= dt / _data.ReloadTime;
|
||||
if (_reload < 0)
|
||||
{
|
||||
_reloading = false;
|
||||
|
|
@ -86,7 +86,7 @@ public class ConstantWeapon : Weapon, IProgressBehavior, IEventBehavior
|
|||
return false;
|
||||
}
|
||||
|
||||
_ammoInterval -= delta / _data.AmmoInterval;
|
||||
_ammoInterval -= dt / _data.AmmoInterval;
|
||||
if (_ammoInterval < 0)
|
||||
{
|
||||
_ammoInterval = 1;
|
||||
|
|
@ -115,10 +115,10 @@ public class ConstantWeapon : Weapon, IProgressBehavior, IEventBehavior
|
|||
}
|
||||
}
|
||||
|
||||
var dmg = Item.Wear * delta;
|
||||
var dmg = Item.Wear * dt;
|
||||
Item.EquippableItem.Durability -= dmg;
|
||||
Item.Entity.ItemDamage.OnNext((Item, dmg));
|
||||
Item.AddHeat(Item.Evaluate(_data.Heat) * delta);
|
||||
Item.AddHeat(Item.Evaluate(_data.Heat) * dt);
|
||||
Item.Entity.VisibilitySources[this] = Item.Evaluate(_data.Visibility);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class Cooldown : IBehavior, IAlwaysUpdatedBehavior, IProgressBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
if (_cooldown < 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ public class EnergyDraw : IBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
return Item.Entity.TryConsumeEnergy(Item.Evaluate(_data.EnergyDraw) * (_data.PerSecond ? delta : 1));
|
||||
return Item.Entity.TryConsumeEnergy(Item.Evaluate(_data.EnergyDraw) * (_data.PerSecond ? dt : 1));
|
||||
}
|
||||
}
|
||||
|
|
@ -36,9 +36,9 @@ public class Heat : IBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
Item.AddHeat(Item.Evaluate(_data.Heat) * (_data.PerSecond ? delta : 1));
|
||||
Item.AddHeat(Item.Evaluate(_data.Heat) * (_data.PerSecond ? dt : 1));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public class HeatStorage : IBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,12 +136,12 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior
|
|||
|
||||
}
|
||||
|
||||
public override bool Execute(float delta)
|
||||
public override bool Execute(float dt)
|
||||
{
|
||||
base.Execute(delta);
|
||||
base.Execute(dt);
|
||||
if (_coolingDown)
|
||||
{
|
||||
_cooldown -= delta / (_data.MagazineSize > 0 && _ammo == 0 ? _data.ReloadTime : Cooldown);
|
||||
_cooldown -= dt / (_data.MagazineSize > 0 && _ammo == 0 ? _data.ReloadTime : Cooldown);
|
||||
if (_cooldown < 0)
|
||||
{
|
||||
_coolingDown = false;
|
||||
|
|
@ -155,7 +155,7 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior
|
|||
}
|
||||
}
|
||||
|
||||
_burstTimer += delta;
|
||||
_burstTimer += dt;
|
||||
while (_burstRemaining > 0 && _burstTimer > 0)
|
||||
{
|
||||
// If multiple ammo is consumed per burst, perform ammo and energy consumption here
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class ItemUsage : IBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
var cargo = Item.Entity.FindItemInCargo(_data.Item);
|
||||
if (cargo == null) return false;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class LockWeapon : InstantWeapon
|
|||
_data = data;
|
||||
}
|
||||
|
||||
public override bool Execute(float delta)
|
||||
public override bool Execute(float dt)
|
||||
{
|
||||
if (_target != Item.Entity.Target.Value)
|
||||
{
|
||||
|
|
@ -81,12 +81,12 @@ public class LockWeapon : InstantWeapon
|
|||
if (degrees < LockAngle)
|
||||
{
|
||||
var lerp = 1 - unlerp(0, 90, degrees);
|
||||
_lock = saturate(_lock + pow(lerp, DirectionImpact) * delta * LockSpeed * pow(Item.Entity.EntityInfoGathered[Item.Entity.Target.Value], SensorImpact));
|
||||
_lock = saturate(_lock + pow(lerp, DirectionImpact) * dt * LockSpeed * pow(Item.Entity.EntityInfoGathered[Item.Entity.Target.Value], SensorImpact));
|
||||
}
|
||||
else _lock = saturate(_lock - delta * Decay);
|
||||
else _lock = saturate(_lock - dt * Decay);
|
||||
}
|
||||
|
||||
return base.Execute(delta);
|
||||
return base.Execute(dt);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class MiningTool : IBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
Range = Item.Evaluate(_data.Range);
|
||||
var belt = Item.Entity.Zone.AsteroidBelts[AsteroidBelt];
|
||||
|
|
@ -60,7 +60,7 @@ public class MiningTool : IBehavior
|
|||
Item.Entity,
|
||||
AsteroidBelt,
|
||||
Asteroid,
|
||||
Item.Evaluate(_data.DamagePerSecond) * delta,
|
||||
Item.Evaluate(_data.DamagePerSecond) * dt,
|
||||
Item.Evaluate(_data.Efficiency),
|
||||
Item.Evaluate(_data.Penetration));
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class Radiator : IBehavior, IAlwaysUpdatedBehavior, IInitializableBehavio
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
PumpedHeat = Item.Evaluate(_data.PumpedHeat);
|
||||
WasteHeat = Item.Evaluate(_data.WasteHeat);
|
||||
|
|
@ -63,7 +63,7 @@ public class Radiator : IBehavior, IAlwaysUpdatedBehavior, IInitializableBehavio
|
|||
// Temperature ratio would cause more waste heat than pump capacity, stop executing
|
||||
if (tempRatio > PumpedHeat / WasteHeat) return true;
|
||||
|
||||
if (!Item.Entity.TryConsumeEnergy(EnergyUsage * tempRatio * delta)) return false;
|
||||
if (!Item.Entity.TryConsumeEnergy(EnergyUsage * tempRatio * dt)) return false;
|
||||
|
||||
var pumpedHeat = PumpedHeat * max(itemTemperature - _data.TemperatureFloor, 0);
|
||||
|
||||
|
|
@ -72,8 +72,8 @@ public class Radiator : IBehavior, IAlwaysUpdatedBehavior, IInitializableBehavio
|
|||
|
||||
var wasteHeat = WasteHeat * tempRatio;
|
||||
|
||||
Item.AddHeat((wasteHeat - pumpedHeat) * delta);
|
||||
Temperature += pumpedHeat / Item.ItemManager.GetThermalMass(Item.EquippableItem) * delta;
|
||||
Item.AddHeat((wasteHeat - pumpedHeat) * dt);
|
||||
Temperature += pumpedHeat / Item.ItemManager.GetThermalMass(Item.EquippableItem) * dt;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,9 +71,9 @@ public class Reactor : IBehavior, IOrderedBehavior
|
|||
Draw += energy;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
var charge = Item.Evaluate(_data.Charge) * delta;
|
||||
var charge = Item.Evaluate(_data.Charge) * dt;
|
||||
var efficiency = Item.Evaluate(_data.Efficiency);
|
||||
|
||||
// This behavior executes last, so any components drawing power have already done so
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class Reflector : IBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
Item.Entity.VisibilitySources[this] = Item.Evaluate(_data.CrossSection) * Item.Entity.Zone.GetLight(Item.Entity.Position.xz);
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class ResourceScanner : IBehavior, IAlwaysUpdatedBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
var planetData = Item.Entity.Zone.Planets[ScanTarget];
|
||||
if (planetData != null)
|
||||
|
|
@ -72,7 +72,7 @@ public class ResourceScanner : IBehavior, IAlwaysUpdatedBehavior
|
|||
Asteroid < beltData.Asteroids.Length &&
|
||||
length(Item.Entity.Position.xz - Item.Entity.Zone.AsteroidBelts[ScanTarget].Positions[Asteroid].xz) < Range)
|
||||
{
|
||||
_scanTime += delta;
|
||||
_scanTime += dt;
|
||||
if (_scanTime > ScanDuration)
|
||||
{
|
||||
// TODO: Implement Scanning!
|
||||
|
|
@ -86,7 +86,7 @@ public class ResourceScanner : IBehavior, IAlwaysUpdatedBehavior
|
|||
{
|
||||
if(length(Item.Entity.Position.xz - Item.Entity.Zone.GetOrbitPosition(planetData.Orbit)) < Range)
|
||||
{
|
||||
_scanTime += delta;
|
||||
_scanTime += dt;
|
||||
if (_scanTime > ScanDuration)
|
||||
{
|
||||
//Context.ItemData.Get<Corporation>(Entity.Corporation).PlanetSurveyFloor[ScanTarget] = MinimumDensity;
|
||||
|
|
|
|||
|
|
@ -99,11 +99,11 @@ public class Sensor : IBehavior, IEventBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
if (_pinging)
|
||||
{
|
||||
_pingLerp += delta / _data.PingDuration;
|
||||
_pingLerp += dt / _data.PingDuration;
|
||||
_pingRadius = lerp(0, Item.Evaluate(_data.PingRange), pow(_pingLerp, _data.PingRadiusExponent));
|
||||
if (_pingLerp > 1)
|
||||
{
|
||||
|
|
@ -112,7 +112,7 @@ public class Sensor : IBehavior, IEventBehavior
|
|||
}
|
||||
}
|
||||
|
||||
_pingCooldown -= delta / Item.Evaluate(_data.PingCooldown);
|
||||
_pingCooldown -= dt / Item.Evaluate(_data.PingCooldown);
|
||||
|
||||
// TODO: Handle Active Detection / Visibility From Reflected Radiance
|
||||
var hardpoint = Item.Entity.Hardpoints[Item.Position.x, Item.Position.y];
|
||||
|
|
@ -145,9 +145,9 @@ public class Sensor : IBehavior, IEventBehavior
|
|||
entity.Visibility *
|
||||
Item.Evaluate(_data.Sensitivity) *
|
||||
_data.SensitivityCurve.Evaluate(angle / PI) *
|
||||
delta / dist);
|
||||
dt / dist);
|
||||
}
|
||||
next *= 1 - Item.ItemManager.GameplaySettings.TargetInfoDecay * delta;
|
||||
next *= 1 - Item.ItemManager.GameplaySettings.TargetInfoDecay * dt;
|
||||
//Context.Log($"{entity.Name} visibility {(int)(previous * 100)}% -> {(int)(next * 100)}%");
|
||||
Item.Entity.EntityInfoGathered[entity] = next;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class Shield : IBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
Efficiency = Item.Evaluate(_data.Efficiency);
|
||||
EnergyUsage = Item.Evaluate(_data.EnergyUsage);
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class StatModifier : IBehavior, IInitializableBehavior, IDisposableBehavi
|
|||
}
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
foreach (var stat in _stats)
|
||||
(_data.Type == StatModifierType.Constant
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class Switch : IBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
return Activated;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class Thermotoggle : IBehavior
|
|||
TargetTemperature = data.TargetTemperature;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
return Item.Temperature < TargetTemperature ^ _data.HighPass;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,15 +63,15 @@ public class Thruster : IAnalogBehavior
|
|||
Thrust = Item.Evaluate(_data.Thrust);
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
if(_input > .01f && Item.Entity.TryConsumeEnergy(_input * Item.Evaluate(_data.EnergyUsage)))
|
||||
{
|
||||
Thrust = Item.Evaluate(_data.Thrust);
|
||||
Item.Entity.Velocity -= Item.Entity.Direction.Rotate(Item.EquippableItem.Rotation) * _input * Thrust / Item.Entity.Mass * delta;
|
||||
Item.Entity.Velocity -= Item.Entity.Direction.Rotate(Item.EquippableItem.Rotation) * _input * Thrust / Item.Entity.Mass * dt;
|
||||
Item.Entity.Direction = mul(Item.Entity.Direction,
|
||||
Unity.Mathematics.float2x2.Rotate(_input * Torque * Thrust * Item.ItemManager.GameplaySettings.TorqueMultiplier / Item.Entity.Mass * delta));
|
||||
Item.AddHeat(_input * Item.Evaluate(_data.Heat) * delta);
|
||||
Unity.Mathematics.float2x2.Rotate(_input * Torque * Thrust * Item.ItemManager.GameplaySettings.TorqueMultiplier / Item.Entity.Mass * dt));
|
||||
Item.AddHeat(_input * Item.Evaluate(_data.Heat) * dt);
|
||||
var vis = _input * Item.Evaluate(_data.Visibility);
|
||||
if (!Item.Entity.VisibilitySources.ContainsKey(this) || vis > Item.Entity.VisibilitySources[this])
|
||||
Item.Entity.VisibilitySources[this] = vis;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class Trigger : IBehavior, IActivatedBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
if (_pulled)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class TurretController : IBehavior
|
|||
}
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
if (Item.Entity.Target.Value != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class VelocityConversion : IBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class VelocityLimit : IBehavior
|
|||
Limit = Item.Evaluate(_data.TopSpeed);
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
Limit = Item.Evaluate(_data.TopSpeed);
|
||||
if (length(Item.Entity.Velocity) > Limit)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class Visibility : IBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
Item.Entity.VisibilitySources[this] = Item.Evaluate(_data.Visibility);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ public abstract class Weapon : IActivatedBehavior
|
|||
Velocity = Item.Evaluate(_data.Velocity);
|
||||
}
|
||||
|
||||
public virtual bool Execute(float delta)
|
||||
public virtual bool Execute(float dt)
|
||||
{
|
||||
UpdateStats();
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@ public class Wear : IBehavior
|
|||
Item = item;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
public bool Execute(float dt)
|
||||
{
|
||||
if (_data.PerSecond)
|
||||
{
|
||||
var dmg = Item.Wear * delta;
|
||||
var dmg = Item.Wear * dt;
|
||||
Item.EquippableItem.Durability -= dmg;
|
||||
Item.Entity.ItemDamage.OnNext((Item, dmg));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public enum HardpointType
|
|||
Tool,
|
||||
Thermal,
|
||||
Thruster,
|
||||
WarpThruster,
|
||||
WarpDrive,
|
||||
Reactor,
|
||||
Radiator,
|
||||
Shield,
|
||||
|
|
@ -49,7 +49,8 @@ public enum HardpointType
|
|||
Energy,
|
||||
Ballistic,
|
||||
Launcher,
|
||||
ControlModule
|
||||
ControlModule,
|
||||
AetherDrive
|
||||
}
|
||||
|
||||
public enum WeaponType
|
||||
|
|
|
|||
|
|
@ -430,6 +430,9 @@ public class HullData : EquippableItemData
|
|||
[Inspectable, JsonProperty("armor"), Key(24)]
|
||||
public float Armor;
|
||||
|
||||
[Inspectable, JsonProperty("drag"), Key(25)]
|
||||
public float Drag;
|
||||
|
||||
[IgnoreMember]
|
||||
public Shape InteriorCells
|
||||
{
|
||||
|
|
|
|||
|
|
@ -70,8 +70,9 @@ public class LoadoutGenerator
|
|||
}
|
||||
|
||||
var cargo = entity.CargoBays.First();
|
||||
var inventory = RandomItems<EquippableItemData>(16, 1,
|
||||
data => !(data is HullData hull && hull.HullType != HullType.Ship) && !(data is CargoBayData))
|
||||
IEnumerable<EquippableItemData> inventory = RandomItems<EquippableItemData>(16, 1,
|
||||
data => !(data is HullData hull && hull.HullType != HullType.Ship) && !(data is CargoBayData));
|
||||
inventory = inventory
|
||||
.OrderByDescending(item=>item.Shape.Coordinates.Length);
|
||||
foreach (var item in inventory)
|
||||
{
|
||||
|
|
@ -86,6 +87,7 @@ public class LoadoutGenerator
|
|||
{
|
||||
return ItemManager.ItemData.GetAll<HullData>()
|
||||
.Where(item =>
|
||||
item.Price > 0 &&
|
||||
(hullFilter?.Invoke(item) ?? true) &&
|
||||
item.HullType == type &&
|
||||
(Faction == null || item.Manufacturer == Faction.ID || Faction.Allegiance.ContainsKey(item.Manufacturer)))
|
||||
|
|
@ -101,9 +103,11 @@ public class LoadoutGenerator
|
|||
public T[] RandomItems<T>(int count, float sizeExponent, Predicate<T> filter = null) where T : EquippableItemData
|
||||
{
|
||||
return ItemManager.ItemData.GetAll<T>()
|
||||
.Where(item => Sector.ContainsFaction(item.Manufacturer) &&
|
||||
(Faction == null || Faction.Allegiance.ContainsKey(item.Manufacturer)) &&
|
||||
(filter?.Invoke(item) ?? true))
|
||||
.Where(item =>
|
||||
item.Price > 0 &&
|
||||
Sector.ContainsFaction(item.Manufacturer) &&
|
||||
(Faction == null || Faction.Allegiance.ContainsKey(item.Manufacturer)) &&
|
||||
(filter?.Invoke(item) ?? true))
|
||||
.WeightedRandomElements(ref Random, item =>
|
||||
(Faction == null || item.Manufacturer == Faction.ID ? 1 : Faction.Allegiance[item.Manufacturer]) * // Prioritize items from allied manufacturers
|
||||
pow(item.Shape.Coordinates.Length, sizeExponent) / // Prioritize larger items
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ using MessagePack;
|
|||
public class PlayerSettings
|
||||
{
|
||||
[Key(0)] public string Name = "Anonymous";
|
||||
[Key(1)] public SavedGame CurrentRun;
|
||||
[Key(1)] public SavedGame SavedRun;
|
||||
[Key(2)] public TemperatureUnit TemperatureUnit = TemperatureUnit.Celsius;
|
||||
[Key(3)] public int SignificantDigits = 3;
|
||||
|
||||
|
|
|
|||
|
|
@ -176,6 +176,8 @@ public class GameplaySettings
|
|||
public ExponentialLerp LockSpinSpeed;
|
||||
public float TorqueFloor;
|
||||
public float TorqueMultiplier;
|
||||
public float AetherTorqueMultiplier;
|
||||
public float AetherHeatMultiplier;
|
||||
public float VisibilityDecay;
|
||||
public float TargetInfoDecay;
|
||||
public float TargetDetectionInfoThreshold;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ public class Ship : Entity
|
|||
private HashSet<Thruster> _leftThrusters;
|
||||
private HashSet<Thruster> _clockwiseThrusters;
|
||||
private HashSet<Thruster> _counterClockwiseThrusters;
|
||||
private HashSet<EquippedItem> _aetherDriveItems;
|
||||
private HashSet<AetherDrive> _aetherDrives;
|
||||
|
||||
private bool _exitingWormhole = false;
|
||||
private bool _enteringWormhole = false;
|
||||
|
|
@ -51,9 +53,9 @@ public class Ship : Entity
|
|||
public float ClockwiseTorque { get; private set; }
|
||||
public float CounterClockwiseTorque { get; private set; }
|
||||
public float LeftStrafeTotalTorque { get; private set; }
|
||||
private Thruster[] LeftStrafeTorqueThrusters;
|
||||
private List<Thruster> LeftStrafeTorqueThrusters = new List<Thruster>();
|
||||
public float RightStrafeTotalTorque { get; private set; }
|
||||
private Thruster[] RightStrafeTorqueThrusters;
|
||||
private List<Thruster> RightStrafeTorqueThrusters = new List<Thruster>();
|
||||
|
||||
public float TurnTime(float2 direction)
|
||||
{
|
||||
|
|
@ -89,91 +91,90 @@ public class Ship : Entity
|
|||
public override void Activate()
|
||||
{
|
||||
base.Activate();
|
||||
|
||||
_aetherDrives = new HashSet<AetherDrive>(GetBehaviors<AetherDrive>());
|
||||
_aetherDriveItems = new HashSet<EquippedItem>(_aetherDrives.Select(x => x.Item));
|
||||
|
||||
_allThrusters = GetBehaviors<Thruster>().ToArray();
|
||||
_thrusterItems = new HashSet<EquippedItem>(_allThrusters.Select(x=>x.Item));
|
||||
|
||||
_forwardThrusters = new HashSet<Thruster>(_allThrusters
|
||||
.Where(x => x.Item.EquippableItem.Rotation == ItemRotation.Reversed));
|
||||
RecalculateForwardThrust();
|
||||
foreach (var thruster in _forwardThrusters)
|
||||
thruster.Item.Online.Skip(1).Subscribe(b => RecalculateForwardThrust());
|
||||
|
||||
_reverseThrusters = new HashSet<Thruster>(_allThrusters
|
||||
.Where(x => x.Item.EquippableItem.Rotation == ItemRotation.None));
|
||||
RecalculateReverseThrust();
|
||||
foreach (var thruster in _reverseThrusters)
|
||||
thruster.Item.Online.Skip(1).Subscribe(b => RecalculateReverseThrust());
|
||||
|
||||
_rightThrusters = new HashSet<Thruster>(_allThrusters
|
||||
.Where(x => x.Item.EquippableItem.Rotation == ItemRotation.CounterClockwise));
|
||||
RecalculateRightStrafeThrust();
|
||||
foreach (var thruster in _rightThrusters)
|
||||
thruster.Item.Online.Skip(1).Subscribe(b => RecalculateRightStrafeThrust());
|
||||
|
||||
_leftThrusters = new HashSet<Thruster>(_allThrusters
|
||||
.Where(x => x.Item.EquippableItem.Rotation == ItemRotation.Clockwise));
|
||||
RecalculateLeftStrafeThrust();
|
||||
foreach (var thruster in _leftThrusters)
|
||||
thruster.Item.Online.Skip(1).Subscribe(b => RecalculateLeftStrafeThrust());
|
||||
|
||||
_counterClockwiseThrusters = new HashSet<Thruster>(_allThrusters
|
||||
.Where(x => x.Torque < -ItemManager.GameplaySettings.TorqueFloor));
|
||||
RecalculateCounterClockwiseTorque();
|
||||
foreach (var thruster in _counterClockwiseThrusters)
|
||||
thruster.Item.Online.Skip(1).Subscribe(b => RecalculateCounterClockwiseTorque());
|
||||
|
||||
_clockwiseThrusters = new HashSet<Thruster>(_allThrusters
|
||||
.Where(x => x.Torque > ItemManager.GameplaySettings.TorqueFloor));
|
||||
RecalculateClockwiseTorque();
|
||||
foreach (var thruster in _clockwiseThrusters)
|
||||
thruster.Item.Online.Skip(1).Subscribe(b => RecalculateClockwiseTorque());
|
||||
}
|
||||
|
||||
public Ship(ItemManager itemManager, Zone zone, EquippableItem hull, EntitySettings settings) : base(itemManager, zone, hull, settings)
|
||||
{
|
||||
void CheckForThruster(EquippedItem item)
|
||||
{
|
||||
if (_thrusterItems.Contains(item))
|
||||
{
|
||||
foreach (var behavior in item.Behaviors)
|
||||
{
|
||||
if (behavior is Thruster thruster)
|
||||
{
|
||||
if (_forwardThrusters.Contains(thruster)) RecalculateForwardThrust();
|
||||
if (_reverseThrusters.Contains(thruster)) RecalculateReverseThrust();
|
||||
if (_rightThrusters.Contains(thruster)) RecalculateRightStrafeThrust();
|
||||
if (_leftThrusters.Contains(thruster)) RecalculateLeftStrafeThrust();
|
||||
if (_clockwiseThrusters.Contains(thruster)) RecalculateClockwiseTorque();
|
||||
if (_counterClockwiseThrusters.Contains(thruster)) RecalculateCounterClockwiseTorque();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ItemDestroyed.Where(item=>_thrusterItems.Contains(item)).Subscribe(RemoveThruster);
|
||||
ItemDestroyed.Where(item=>_aetherDriveItems.Contains(item)).Subscribe(RemoveAetherDrive);
|
||||
}
|
||||
|
||||
ItemDamage.Select(x => x.item).Subscribe(CheckForThruster);
|
||||
private void RemoveAetherDrive(EquippedItem item)
|
||||
{
|
||||
_aetherDriveItems.Remove(item);
|
||||
_aetherDrives.Remove(item.GetBehavior<AetherDrive>());
|
||||
}
|
||||
|
||||
private void RemoveThruster(EquippedItem item)
|
||||
{
|
||||
_thrusterItems.Remove(item);
|
||||
var thruster = item.GetBehavior<Thruster>();
|
||||
if (_forwardThrusters.Contains(thruster)) _forwardThrusters.Remove(thruster);
|
||||
if (_reverseThrusters.Contains(thruster)) _reverseThrusters.Remove(thruster);
|
||||
if (_rightThrusters.Contains(thruster)) _rightThrusters.Remove(thruster);
|
||||
if (_leftThrusters.Contains(thruster)) _leftThrusters.Remove(thruster);
|
||||
if (_clockwiseThrusters.Contains(thruster)) _clockwiseThrusters.Remove(thruster);
|
||||
if (_counterClockwiseThrusters.Contains(thruster)) _counterClockwiseThrusters.Remove(thruster);
|
||||
}
|
||||
|
||||
#region ThrustCalculation
|
||||
|
||||
private void RecalculateThrust()
|
||||
{
|
||||
RecalculateForwardThrust();
|
||||
RecalculateReverseThrust();
|
||||
RecalculateLeftStrafeThrust();
|
||||
RecalculateRightStrafeThrust();
|
||||
RecalculateClockwiseTorque();
|
||||
RecalculateCounterClockwiseTorque();
|
||||
}
|
||||
|
||||
private void RecalculateForwardThrust()
|
||||
{
|
||||
ForwardThrust = 0;
|
||||
foreach (var thruster in _forwardThrusters)
|
||||
{
|
||||
if(thruster.Item.Active.Value)
|
||||
if (thruster.Item.Active.Value)
|
||||
ForwardThrust += thruster.Thrust;
|
||||
}
|
||||
|
||||
foreach (var drive in _aetherDrives)
|
||||
if (drive.Item.Active.Value)
|
||||
ForwardThrust += drive.Thrust.x;
|
||||
}
|
||||
|
||||
private void RecalculateReverseThrust()
|
||||
{
|
||||
ReverseThrust = 0;
|
||||
foreach (var thruster in _reverseThrusters)
|
||||
{
|
||||
if(thruster.Item.Active.Value)
|
||||
if (thruster.Item.Active.Value)
|
||||
ReverseThrust += thruster.Thrust;
|
||||
}
|
||||
|
||||
foreach (var drive in _aetherDrives)
|
||||
if (drive.Item.Active.Value)
|
||||
ReverseThrust += drive.Thrust.x;
|
||||
}
|
||||
|
||||
private void RecalculateLeftStrafeThrust()
|
||||
|
|
@ -188,9 +189,14 @@ public class Ship : Entity
|
|||
LeftStrafeTotalTorque += thruster.Torque * thruster.Thrust;
|
||||
}
|
||||
}
|
||||
LeftStrafeTorqueThrusters = _leftThrusters
|
||||
.Where(x => abs(sign(x.Torque) - sign(LeftStrafeTotalTorque)) < .01f)
|
||||
.ToArray();
|
||||
LeftStrafeTorqueThrusters.Clear();
|
||||
foreach(var thruster in _leftThrusters)
|
||||
if (abs(sign(thruster.Torque) - sign(LeftStrafeTotalTorque)) < .01f)
|
||||
LeftStrafeTorqueThrusters.Add(thruster);
|
||||
|
||||
foreach (var drive in _aetherDrives)
|
||||
if (drive.Item.Active.Value)
|
||||
LeftStrafeThrust += drive.Thrust.y;
|
||||
}
|
||||
|
||||
private void RecalculateRightStrafeThrust()
|
||||
|
|
@ -205,29 +211,38 @@ public class Ship : Entity
|
|||
RightStrafeTotalTorque += thruster.Torque * thruster.Thrust;
|
||||
}
|
||||
}
|
||||
RightStrafeTorqueThrusters = _rightThrusters
|
||||
.Where(x => abs(sign(x.Torque) - sign(RightStrafeTotalTorque)) < .01f)
|
||||
.ToArray();
|
||||
RightStrafeTorqueThrusters.Clear();
|
||||
foreach(var thruster in _rightThrusters)
|
||||
if (abs(sign(thruster.Torque) - sign(RightStrafeTotalTorque)) < .01f)
|
||||
RightStrafeTorqueThrusters.Add(thruster);
|
||||
|
||||
foreach (var drive in _aetherDrives)
|
||||
if (drive.Item.Active.Value)
|
||||
RightStrafeThrust += drive.Thrust.y;
|
||||
}
|
||||
|
||||
private void RecalculateClockwiseTorque()
|
||||
{
|
||||
ClockwiseTorque = 0;
|
||||
foreach (var thruster in _clockwiseThrusters)
|
||||
{
|
||||
if(thruster.Item.Active.Value)
|
||||
if (thruster.Item.Active.Value)
|
||||
ClockwiseTorque += thruster.Torque;
|
||||
}
|
||||
|
||||
foreach (var drive in _aetherDrives)
|
||||
if (drive.Item.Active.Value)
|
||||
ClockwiseTorque += drive.Thrust.z;
|
||||
}
|
||||
|
||||
private void RecalculateCounterClockwiseTorque()
|
||||
{
|
||||
CounterClockwiseTorque = 0;
|
||||
foreach (var thruster in _counterClockwiseThrusters)
|
||||
{
|
||||
if(thruster.Item.Active.Value)
|
||||
if (thruster.Item.Active.Value)
|
||||
CounterClockwiseTorque -= thruster.Torque;
|
||||
}
|
||||
|
||||
foreach (var drive in _aetherDrives)
|
||||
if (drive.Item.Active.Value)
|
||||
CounterClockwiseTorque += drive.Thrust.z;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
@ -236,8 +251,9 @@ public class Ship : Entity
|
|||
{
|
||||
if (_active && !_exitingWormhole && !_enteringWormhole)
|
||||
{
|
||||
RecalculateThrust();
|
||||
foreach (var thruster in _allThrusters) thruster.Axis = 0;
|
||||
var rightThrusterTorqueCompensation = abs(RightStrafeTotalTorque) / RightStrafeTorqueThrusters.Length;
|
||||
var rightThrusterTorqueCompensation = abs(RightStrafeTotalTorque) / RightStrafeTorqueThrusters.Count;
|
||||
foreach (var thruster in _rightThrusters)
|
||||
{
|
||||
var thrust = 0f;
|
||||
|
|
@ -246,7 +262,7 @@ public class Ship : Entity
|
|||
thrust -= MovementDirection.x * (rightThrusterTorqueCompensation / (abs(thruster.Torque) * thruster.Thrust));
|
||||
thruster.Axis = thrust;
|
||||
}
|
||||
var leftThrusterTorqueCompensation = abs(LeftStrafeTotalTorque) / LeftStrafeTorqueThrusters.Length;
|
||||
var leftThrusterTorqueCompensation = abs(LeftStrafeTotalTorque) / LeftStrafeTorqueThrusters.Count;
|
||||
foreach (var thruster in _leftThrusters)
|
||||
{
|
||||
var thrust = 0f;
|
||||
|
|
@ -269,7 +285,14 @@ public class Ship : Entity
|
|||
|
||||
foreach (var thruster in _clockwiseThrusters) thruster.Axis += deltaRot;
|
||||
foreach (var thruster in _counterClockwiseThrusters) thruster.Axis += -deltaRot;
|
||||
|
||||
foreach (var drive in _aetherDrives)
|
||||
drive.Axis = float3(MovementDirection.y, MovementDirection.x, deltaRot);
|
||||
}
|
||||
|
||||
var velocityMagnitude = length(Velocity);
|
||||
if(velocityMagnitude > .01f)
|
||||
Velocity = normalize(Velocity) * AetheriaMath.Decay(velocityMagnitude, HullData.Drag, delta);
|
||||
|
||||
Position.xz += Velocity * delta;
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ public class ConfirmationDialog : PropertiesPanel
|
|||
else _onCancel?.Invoke();
|
||||
CancelClickCatcher?.gameObject.SetActive(false);
|
||||
gameObject.SetActive(false);
|
||||
ActionGameManager.Instance?.Input.Global.Enable();
|
||||
}
|
||||
|
||||
public void MoveToCursor()
|
||||
|
|
@ -71,5 +72,6 @@ public class ConfirmationDialog : PropertiesPanel
|
|||
ButtonGroup.SetActive(onConfirm!=null || onCancel!=null);
|
||||
|
||||
CancelClickCatcher?.gameObject.SetActive(true);
|
||||
ActionGameManager.Instance?.Input.Global.Disable();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,11 @@ public class ConsoleView : MonoBehaviour {
|
|||
LogTextArea.text = string.Join("\n", newLog);
|
||||
// if (AcceptingInput)
|
||||
// LogTextArea.text += "\n\n> " + _inputString;
|
||||
Observable.NextFrame().Subscribe(_ => Scroll.verticalNormalizedPosition = 0);
|
||||
Observable.NextFrame().Subscribe(_ =>
|
||||
{
|
||||
if(Scroll)
|
||||
Scroll.verticalNormalizedPosition = 0;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ public class ContextMenu : MonoBehaviour
|
|||
Destroy(_dropdown);
|
||||
CancelClickCatcher.gameObject.SetActive(false);
|
||||
gameObject.SetActive(false);
|
||||
ActionGameManager.Instance?.Input.Global.Enable();
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
|
|
@ -128,5 +129,6 @@ public class ContextMenu : MonoBehaviour
|
|||
rect.position = (Parent != null ? ForcePosition : (Vector3) mousePosition) + Vector3.up * deltaY;
|
||||
if (Parent==null)
|
||||
CancelClickCatcher.gameObject.SetActive(true);
|
||||
ActionGameManager.Instance?.Input.Global.Disable();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ public class DropdownMenu : MonoBehaviour
|
|||
{
|
||||
CancelClickCatcher.gameObject.SetActive(false);
|
||||
gameObject.SetActive(false);
|
||||
ActionGameManager.Instance?.Input.Global.Enable();
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
|
|
@ -74,5 +75,6 @@ public class DropdownMenu : MonoBehaviour
|
|||
rect.sizeDelta = parent.sizeDelta;
|
||||
rect.position = pivotTop ? corners[0] : corners[1];
|
||||
CancelClickCatcher.gameObject.SetActive(true);
|
||||
ActionGameManager.Instance?.Input.Global.Disable();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,11 +92,11 @@ public class MainMenu : MonoBehaviour
|
|||
_nextMenu.panel.Title.text = TitleSubtitle("aetheria", "terminus");
|
||||
if (!InGame)
|
||||
{
|
||||
if(ActionGameManager.PlayerSettings.CurrentRun != null)
|
||||
if(ActionGameManager.PlayerSettings.SavedRun != null)
|
||||
_nextMenu.panel.AddButton("Continue",
|
||||
() =>
|
||||
{
|
||||
ActionGameManager.CurrentSector = new Sector(ActionGameManager.CultCache, ActionGameManager.PlayerSettings.CurrentRun);
|
||||
ActionGameManager.CurrentSector = new Sector(ActionGameManager.CultCache, ActionGameManager.PlayerSettings.SavedRun);
|
||||
SceneManager.LoadScene("ARPG");
|
||||
});
|
||||
else
|
||||
|
|
@ -119,7 +119,7 @@ public class MainMenu : MonoBehaviour
|
|||
var task = Task.Run(() => new Sector(Settings.SectorGenerationSettings, ActionGameManager.CultCache, 0, setState));
|
||||
task.ContinueWith(task => Observable.NextFrame().Subscribe(_ =>
|
||||
{
|
||||
ActionGameManager.PlayerSettings.CurrentRun = null;
|
||||
ActionGameManager.PlayerSettings.SavedRun = null;
|
||||
ActionGameManager.CurrentSector = task.Result;
|
||||
SceneManager.LoadScene("ARPG");
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -23,14 +23,20 @@ public class SchematicDisplay : MonoBehaviour
|
|||
public GameObject ShieldIcon;
|
||||
public Image HeatsinkBackground;
|
||||
|
||||
public GameObject AetherDriveUi;
|
||||
public GameObject AetherDriveUiSpacer;
|
||||
|
||||
public TextMeshProUGUI EnergyLabel;
|
||||
public TextMeshProUGUI CockpitTemperatureLabel;
|
||||
public TextMeshProUGUI RadiatorTemperatureLabel;
|
||||
[FormerlySerializedAs("HeatsinkTemperatureLabel")] public TextMeshProUGUI HeatStorageTemperatureLabel;
|
||||
public TextMeshProUGUI HeatStorageTemperatureLabel;
|
||||
public TextMeshProUGUI CargoTemperatureLabel;
|
||||
public TextMeshProUGUI VisibilityLabel;
|
||||
public TextMeshProUGUI HullDurabilityLabel;
|
||||
public TextMeshProUGUI DistanceLabel;
|
||||
public TextMeshProUGUI ForwardRPMLabel;
|
||||
public TextMeshProUGUI StrafeRPMLabel;
|
||||
public TextMeshProUGUI TurnRPMLabel;
|
||||
|
||||
public RectTransform SensorCooldownFill;
|
||||
public RectTransform EnergyFill;
|
||||
|
|
@ -38,6 +44,9 @@ public class SchematicDisplay : MonoBehaviour
|
|||
public RectTransform HeatstrokeMeterFill;
|
||||
public RectTransform HypothermiaMeterFill;
|
||||
public RectTransform HeatstrokeLimitFill;
|
||||
public RectTransform ForwardRPMFill;
|
||||
public RectTransform StrafeRPMFill;
|
||||
public RectTransform TurnRPMFill;
|
||||
|
||||
public CanvasGroup TriggerGroups;
|
||||
public float TriggerGroupsFadeDuration = .5f;
|
||||
|
|
@ -55,6 +64,7 @@ public class SchematicDisplay : MonoBehaviour
|
|||
private EquippedCargoBay[] _cargoBays;
|
||||
private SchematicDisplayItem[] _schematicItems;
|
||||
private Graphic[] _groupGraphics;
|
||||
private AetherDrive _aetherDrive;
|
||||
|
||||
private int _selectedGroupIndex;
|
||||
private int _selectedItemIndex;
|
||||
|
|
@ -116,6 +126,9 @@ public class SchematicDisplay : MonoBehaviour
|
|||
_cockpit = entity.GetBehavior<Cockpit>();
|
||||
_reactor = entity.GetBehavior<Reactor>();
|
||||
_capacitors = entity.GetBehaviors<Capacitor>().ToArray();
|
||||
_aetherDrive = entity.GetBehavior<AetherDrive>();
|
||||
AetherDriveUi.SetActive(_aetherDrive != null);
|
||||
AetherDriveUiSpacer.SetActive(_aetherDrive != null);
|
||||
|
||||
_radiators = entity.GetBehaviors<Radiator>().ToArray();
|
||||
if (_radiators.Length == 0)
|
||||
|
|
@ -268,6 +281,18 @@ public class SchematicDisplay : MonoBehaviour
|
|||
EnergyFill.anchorMax = new Vector2(charge / maxCharge, 1);
|
||||
EnergyLabel.text = $"{((int)charge).ToString()}/{((int)maxCharge).ToString()} + ({((int)_reactor.Draw).ToString()})";
|
||||
}
|
||||
|
||||
if (_aetherDrive != null)
|
||||
{
|
||||
ForwardRPMLabel.text = ActionGameManager.PlayerSettings.Format(_aetherDrive.Rpm.x);
|
||||
ForwardRPMFill.anchorMax = new Vector2(_aetherDrive.Rpm.x / _aetherDrive.MaximumRpm, 1);
|
||||
|
||||
StrafeRPMLabel.text = ActionGameManager.PlayerSettings.Format(_aetherDrive.Rpm.y);
|
||||
StrafeRPMFill.anchorMax = new Vector2(_aetherDrive.Rpm.y / _aetherDrive.MaximumRpm, 1);
|
||||
|
||||
TurnRPMLabel.text = ActionGameManager.PlayerSettings.Format(_aetherDrive.Rpm.z);
|
||||
TurnRPMFill.anchorMax = new Vector2(_aetherDrive.Rpm.z / _aetherDrive.MaximumRpm, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
BIN
GameData/AetherDB.msgpack
(Stored with Git LFS)
BIN
GameData/AetherDB.msgpack
(Stored with Git LFS)
Binary file not shown.
BIN
GameData/PlayerSettings.msgpack
(Stored with Git LFS)
BIN
GameData/PlayerSettings.msgpack
(Stored with Git LFS)
Binary file not shown.
|
|
@ -249,8 +249,8 @@
|
|||
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb\RethinkDb.Driver\Generated\Ast\Var.cs" />
|
||||
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb\RethinkDb.Driver\Generated\Ast\Lt.cs" />
|
||||
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb\RethinkDb.Driver\Generated\Model\Unit.cs" />
|
||||
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb\RethinkDb.Driver\Model\Profile.cs" />
|
||||
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb\RethinkDb.Driver\Generated\Ast\IndexCreate.cs" />
|
||||
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb\RethinkDb.Driver\Model\Profile.cs" />
|
||||
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb\RethinkDb.Driver\Ast\Poco.cs" />
|
||||
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb\RethinkDb.Driver\Generated\Ast\Delete.cs" />
|
||||
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb\RethinkDb.Driver\Generated\Ast\Min.cs" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue