summaryrefslogtreecommitdiff
path: root/Thronefall_v1.57
diff options
context:
space:
mode:
authorchai <215380520@qq.com>2024-05-20 22:36:58 +0800
committerchai <215380520@qq.com>2024-05-20 22:36:58 +0800
commita22c505984697881f5f911a165ee022087b69e09 (patch)
treed3c030aef1ae9b8a01c889dd2902bb1e3324e72b /Thronefall_v1.57
parent4a4cc82d069b26bc4d4532e73860f86b211ca239 (diff)
*renameHEADmaster
Diffstat (limited to 'Thronefall_v1.57')
-rw-r--r--Thronefall_v1.57/.gitignore1
-rw-r--r--Thronefall_v1.57/Thronefall/.gitignore399
-rw-r--r--Thronefall_v1.57/Thronefall/Ara/AraTrail.cs947
-rw-r--r--Thronefall_v1.57/Thronefall/Ara/ColorFromSpeed.cs40
-rw-r--r--Thronefall_v1.57/Thronefall/Ara/ElasticArray.cs160
-rw-r--r--Thronefall_v1.57/Thronefall/Ara/ElectricalArc.cs57
-rw-r--r--Thronefall_v1.57/Thronefall/Ara/TireTrack.cs50
-rw-r--r--Thronefall_v1.57/Thronefall/Ara/TrailSection.cs57
-rw-r--r--Thronefall_v1.57/Thronefall/FlatKit/BlitTexturePass.cs80
-rw-r--r--Thronefall_v1.57/Thronefall/FlatKit/Buoyancy.cs105
-rw-r--r--Thronefall_v1.57/Thronefall/FlatKit/FlatKitFog.cs175
-rw-r--r--Thronefall_v1.57/Thronefall/FlatKit/FlatKitOutline.cs139
-rw-r--r--Thronefall_v1.57/Thronefall/FlatKit/FogSettings.cs59
-rw-r--r--Thronefall_v1.57/Thronefall/FlatKit/OutlineSettings.cs61
-rw-r--r--Thronefall_v1.57/Thronefall/FlatKit/UvScroller.cs34
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSON.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONArray.cs127
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONBinaryTag.cs12
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONClass.cs171
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONData.cs92
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONLazyCreator.cs193
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONNode.cs526
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/ArabicMapping.cs14
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/ArabicTable.cs80
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/AutoChangeCultureInfo.cs11
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/BaseSpecializationManager.cs52
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/CallbackNotification.cs15
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/CoroutineManager.cs40
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/CustomLocalizeCallback.cs26
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/EventCallback.cs29
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/Example_ChangeLanguage.cs29
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/Example_LocalizedString.cs31
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/GeneralArabicLetters.cs46
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/GlobalParametersExample.cs17
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/GoogleLanguages.cs2873
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/GoogleTranslation.cs575
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/HindiFixer.cs83
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/I2BasePersistentStorage.cs197
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/I2CustomPersistentStorage.cs5
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/I2Utils.cs301
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/ILanguageSource.cs6
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/ILocalizationParamsManager.cs6
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/ILocalizeTarget.cs22
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/ILocalizeTargetDescriptor.cs16
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/IResourceManager_Bundles.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/IsolatedArabicLetters.cs46
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LanguageData.cs67
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LanguageSource.cs145
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LanguageSourceAsset.cs21
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LanguageSourceData.cs1661
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizationManager.cs1056
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizationParamsManager.cs97
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizationReader.cs195
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/Localize.cs464
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeDropdown.cs100
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget.cs25
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc.cs17
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc_Child.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc_Prefab.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc_Type.cs23
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_TextMeshPro_Label.cs257
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_TextMeshPro_UGUI.cs116
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_AudioSource.cs68
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_Child.cs76
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_MeshRenderer.cs89
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_Prefab.cs108
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_SpriteRenderer.cs62
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_TextMesh.cs92
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_VideoPlayer.cs63
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityUI_Image.cs70
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityUI_RawImage.cs62
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityUI_Text.cs156
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/LocalizedString.cs45
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/PersistentStorage.cs104
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/RTLFixer.cs79
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/RTLFixerTool.cs404
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/RealTimeTranslation.cs118
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/RegisterBundlesManager.cs25
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/RegisterCallback_AllowSyncFromGoogle.cs26
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/RegisterGlobalParameters.cs25
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/ResourceManager.cs160
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/SetLanguage.cs22
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/SetLanguageDropdown.cs39
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/SpecializationManager.cs156
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/StringObfucator.cs64
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/TashkeelLocation.cs14
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/TermData.cs123
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/TermsPopup.cs13
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/ToggleLanguage.cs27
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/TranslationFlag.cs7
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob.cs24
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_GET.cs72
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_Main.cs96
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_POST.cs51
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_WEB.cs154
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_WWW.cs17
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/TranslationQuery.cs16
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/eLanguageDataFlags.cs8
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/ePluralType.cs11
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/eSpreadsheetUpdateMode.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/I2.Loc/eTermType.cs17
-rw-r--r--Thronefall_v1.57/Thronefall/MoreMountains.Feedbacks/OneShotAudioTrigger.cs18
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/AfterCombineAction.cs8
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BinaryTree.cs156
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BinaryTreeDrawer.cs22
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BinaryTreeNode.cs48
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BoundsHelper.cs39
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineErrorStrategy.cs7
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineMethod.cs6
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineSource.cs92
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineTree.cs112
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineTreeNode.cs45
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedLODGroup.cs265
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedLODGroupMatcher.cs20
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedLODGroupPart.cs49
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMesh.cs86
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshData.cs17
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshDataInternal.cs124
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshFactory.cs43
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshPart.cs26
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshPartInternal.cs16
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedObject.cs209
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedObjectMatcher.cs10
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedObjectPart.cs35
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombineSource.cs70
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObject.cs155
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObjectMatcher.cs39
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObjectPart.cs44
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObjectPartInternal.cs61
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicMeshFusionSource.cs130
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicObjectsCombiner.cs42
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IAsyncCombinedMeshMover.cs10
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IBinaryTreeNode.cs20
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombineSource.cs25
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedMeshFactory.cs8
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedMeshMover.cs10
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedObject.cs16
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedObjectPart.cs18
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMeshCombiner.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMeshCutter.cs11
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMeshToolsFactory.cs8
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMovableCombinedMeshFactory.cs6
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ISourceTrackingStrategy.cs6
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMeshMoverLW.cs139
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMeshMoverSTD.cs144
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMovableMeshLWFactory.cs18
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMovableMeshSTDFactory.cs18
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODGroupCombineSource.cs106
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODGroupSettings.cs63
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODGroupsCombiner.cs34
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODMeshFusionSource.cs141
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LightweightVertex.cs95
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MatrixHelper.cs18
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombineInfo.cs43
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombinerBase.cs44
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombinerSimpleLW.cs29
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombinerSimpleSTD.cs42
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCutterSimpleLW.cs66
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCutterSimpleSTD.cs138
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCuttingInfo.cs20
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshDataListsSTD.cs83
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshDataNativeArraysLW.cs131
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshDataNativeArraysSTD.cs104
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshFusionSource.cs333
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshSeparatorSimple.cs130
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshType.cs7
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MoveMethod.cs7
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ObjectsCombiner.cs155
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/PartMoveInfo.cs16
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RendererHelper.cs20
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RendererSettings.cs43
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RigidbodyTrackingStrategy.cs62
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RuntimeMeshFusion.cs197
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleMeshMoverSTD.cs62
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleMovableMeshSTDFactory.cs18
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleToolsLWFactory.cs14
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleToolsSTDFactory.cs14
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SourceCombineStatus.cs10
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SourceTracker.cs161
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/StaticCombinedObjectMatcher.cs39
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/StaticMeshFusionSource.cs131
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/StaticObjectsCombiner.cs42
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/TrackingTarget.cs7
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/TransformTrackingStrategy.cs30
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/UniversalObjectsCombiner.cs102
-rw-r--r--Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/VertexBufferUtil.cs124
-rw-r--r--Thronefall_v1.57/Thronefall/Properties/AssemblyInfo.cs5
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Data/UserDataStore_PlayerPrefs.cs1358
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos.GamepadTemplateUI/ControllerUIEffect.cs57
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos.GamepadTemplateUI/ControllerUIElement.cs186
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos.GamepadTemplateUI/GamepadTemplateUI.cs417
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/Bullet.cs30
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/ControlRemappingDemo1.cs1797
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/CustomControllerDemo.cs144
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/CustomControllerDemo_Player.cs58
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/CustomControllersTiltDemo.cs47
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/DualShock4SpecialFeaturesExample.cs219
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/EightPlayersExample_Player.cs71
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/FallbackJoystickIdentificationDemo.cs114
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/PlayerMouseSpriteExample.cs116
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/PlayerPointerEventHandlerExample.cs138
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/PressAnyButtonToJoinExample_Assigner.cs57
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/PressAnyButtonToJoinExample_GamePlayer.cs67
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/PressStartToJoinExample_Assigner.cs87
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/PressStartToJoinExample_GamePlayer.cs57
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/SimpleCombinedKeyboardMouseRemapping.cs225
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/SimpleControlRemapping.cs257
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/TouchButtonExample.cs52
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/TouchJoystickExample.cs110
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Demos/UIPointer.cs98
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/PlayerPointerEventData.cs41
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/PointerEventType.cs7
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/RewiredEventSystem.cs49
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/RewiredPointerInputModule.cs781
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/RewiredStandaloneInputModule.cs1415
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Internal/ControllerTemplateFactory.cs59
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired.Utils/ExternalTools.cs171
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired/FlightPedalsTemplate.cs25
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired/FlightYokeTemplate.cs265
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired/GamepadTemplate.cs149
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired/HOTASTemplate.cs525
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired/IFlightPedalsTemplate.cs10
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired/IFlightYokeTemplate.cs102
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired/IGamepadTemplate.cs62
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired/IHOTASTemplate.cs180
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired/IRacingWheelTemplate.cs88
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired/ISixDofControllerTemplate.cs86
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired/InputManager.cs81
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired/RacingWheelTemplate.cs189
-rw-r--r--Thronefall_v1.57/Thronefall/Rewired/SixDofControllerTemplate.cs229
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AchievementManager.cs158
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AdditionalWeaponEffectScript.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AfterMatchUIManager.cs251
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AimbotProjectile.cs192
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AncientShrinePerk.cs29
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AnimateSizeAndDestroy.cs30
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ApplyHeroUnitPerks.cs20
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ApplyUpgradeIndicatorColor.cs15
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AttackCooldownAnimation.cs50
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AudioDayNightFader.cs91
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AudioSet.cs453
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AutoAttack.cs138
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AutoAttackHighestHealth.cs15
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AutoAttackLowestHealth.cs17
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AutoAttackLowestInRangeMulti.cs61
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AutoAttackRandom.cs15
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AutoAttackTower.cs180
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AutoAttackTwoTargets.cs40
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AutoAttackWithWarning.cs86
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AutoDayNight.cs17
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AutoRevive.cs112
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/AutoUpgradeBuildingOnStart.cs37
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BackToTitlescreenUIHelper.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BackupAudioListener.cs24
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BakeTrail.cs38
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BalancingParameter.cs47
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BalancingParameters.cs7
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BarricadeDamage.cs73
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BeforeGamePopUp.cs15
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BillboardAlign.cs18
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BlacksmithUpgrade.cs161
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BlacksmithUpgrades.cs43
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BlockProjectiles.cs53
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BoatAnimation.cs37
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BonusLevelInteractor.cs192
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BuildSlot.cs830
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BuildingDestructionHandler.cs62
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BuildingFXProcessor.cs65
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BuildingInteractor.cs500
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BuildingMeshTracker.cs60
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BuildingMeshesTracker.cs57
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/BuildingRangeIndicator.cs161
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/CameraBounds.cs135
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/CameraController.cs56
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/CameraRig.cs120
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/CancelOrOpenPauseMenu.cs30
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Checkbox.cs29
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Choice.cs40
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ChoiceManager.cs83
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ChoiceUI.cs52
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ChoiceUIFrameHelper.cs116
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Coin.cs137
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/CoinSpawner.cs63
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Coinslot.cs76
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ColorAndLightManager.cs340
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Colorscheme.cs106
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/CommandUnits.cs414
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ControlConfig.cs41
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ControlConfigSaveLoad.cs110
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ControlMapButton.cs193
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ControllerPicker.cs12
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/CostDisplay.cs257
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/CurseBlastMA.cs78
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/CurseEffect.cs13
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/CustomPostProcess.cs62
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DamageModifyer.cs42
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DamagePlayerWhenEnteringRange.cs94
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DayCountdownUI.cs33
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DayNightCycle.cs283
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DaytimeDisplay.cs15
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DaytimeSensitiveActivation.cs53
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DaytimeSensitiveLight.cs87
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DebugBuildingDestroyer.cs33
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DebugCoinDisplay.cs19
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DebugController.cs138
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DemoQuitSwitch.cs11
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DestroyAfter.cs15
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DestroyOrDisableOnEnable.cs27
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DisableButtonInWaveZero.cs25
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DisableOnStart.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/DynamicLayoutGroupSpacing.cs49
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ETChoicePickScreen.cs294
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ETMapChoiceDisplay.cs124
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EconomySimulator.cs137
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EliteTowers.cs79
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EnableAllChildren.cs12
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EndOfMatchScoreUIHelper.cs728
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EndOfMatchUI.cs39
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EndscreenRetryHelper.cs31
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EnemyScreenMarkerUIHelper.cs89
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EnemySpawnLine.cs34
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EnemySpawnManager.cs19
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EnemySpawner.cs539
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EnumSelector.cs163
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EnumSelectorButtonAnimation.cs14
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Equippable.cs15
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EquippableBuildingUpgrade.cs6
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EquippableMutation.cs8
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EquippablePerk.cs6
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EquippableWeapon.cs6
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EternalTrialEnemy.cs97
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EternalTrialEnemySet.cs47
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsDefeatUI.cs516
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsHighscorePreview.cs66
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsInteractor.cs37
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsLoadoutScreenHelper.cs11
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsMapPreview.cs36
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsRun.cs124
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsRunManager.cs214
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsSelectScreen.cs67
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsStageCountDisplay.cs27
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsVictoryUI.cs246
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/EternalWaveGenerator.cs17
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/FakeChildTo.cs40
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/FakeTransorm.cs41
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/FireArcherBurn.cs83
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/FishingHarbour.cs97
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/FishingHarbourUpgrade.cs15
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/FollowTransform.cs14
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ForceCameraPosOnEnable.cs27
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/FreezePositionOnEnable.cs25
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/FromToAnimation.cs45
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/GPUInstanced.cs80
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/GPUInstancingManager.cs119
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/GateOpener.cs172
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/GlobalAudioListener.cs48
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/GlobalHealing.cs78
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/GraphDrawer.cs125
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/HealBoostMA.cs69
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/HealthStealWeaponEffect.cs14
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Healthbar.cs172
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/HealthbarMulti.cs46
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/HighscorePreviewUI.cs66
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/HighscoreTable.cs132
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/HotOilTower.cs106
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Hp.cs463
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ISaveLoad.cs10
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/IUIAnimationSequence.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/InGamePopUp.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/InGamePopUpHelper.cs56
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/InGameResignUIHelper.cs18
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/InMatchResignHelper.cs45
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/IncomeModifyer.cs17
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/IncreaseAttackSpeedOverTime.cs56
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/IncreaseIncomeDaily.cs56
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/InteractorBase.cs27
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Invulnerable.cs16
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/KeepRelativeRotationTo.cs59
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/KeyRebinder.cs444
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/KeyframedBoss.cs180
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LaunchableDefenseMechanismInteractor.cs87
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LaunchableProjectile.cs66
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LevelAudio.cs69
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LevelBorder.cs191
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LevelData.cs46
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LevelInfo.cs93
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LevelInteractor.cs231
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LevelNameDisplay.cs32
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LevelProgressManager.cs129
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LevelSelectManager.cs95
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LevelSelectUIFrameHelper.cs53
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LevelUpScreenAnimation.cs29
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LightningStriker.cs87
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LightningWandMA.cs70
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LimitDeltaTime.cs11
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LimitedLifetime.cs11
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LoadSceneOnTop.cs25
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LoadoutUIHelper.cs552
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LocalGamestate.cs171
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LocalMatchSaveLoad.cs137
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/LvlSelectTabButton.cs51
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ManualAttack.cs306
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/MapAchievements.cs17
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/MapChoice.cs74
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/MatchSave.cs190
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/MatchSaveLoadHandler.cs136
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/MaterialFlasherFX.cs77
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/MetaLevel.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/MillRotor.cs44
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Mill_ImprovedPlow.cs26
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Mill_ImprovementExplosiveTrap.cs87
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Mill_ImprovementWindSpirits.cs119
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Mill_Improvement_Scarecrows.cs26
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/MineShaft.cs216
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ModeRulesDisplay.cs31
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Moleman.cs168
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/MusicManager.cs163
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/NavmeshBakeHelper.cs19
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/NightCall.cs144
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/NightLight.cs106
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/NightPreviewElement.cs42
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Nighthorn.cs172
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/NightscoreUI.cs294
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/OnDamageFeedbackHandler.cs28
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/OneShotAnimationBase.cs6
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PathMesher.cs339
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PathfindMovement.cs15
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PathfindMovementEnemy.cs300
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PathfindMovementPlayerunit.cs405
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PaulsWaveGenerator.cs238
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PauseBackToMenuHelper.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PauseUILoadoutHelper.cs235
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PeriodicallyEnableAndDisableDuringEnemySpawn.cs29
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkCooldownModifyer.cs21
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkCostModifyer.cs26
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkDamageAutoAttackModifyer.cs23
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkDamageModifyerPlayerunitAuto.cs54
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkDestroyGameObjectModifyer.cs47
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkHpModifyer.cs74
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkIncomeModifyer.cs54
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkIndestructible.cs20
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkManager.cs403
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkPlayerHealthRegen.cs46
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkPoint.cs6
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkRangeModifyer.cs31
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkSelectionGroup.cs165
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkSelectionItem.cs80
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkSelectionTooltipHelper.cs187
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkSpeedModifyer.cs20
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PerkWeaponModifyer.cs19
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PhysicalCoinAnimator.cs26
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayLevelButton.cs40
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayMusicOnStart.cs31
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayOneShotAfterSeconds.cs22
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayerAttack.cs33
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayerAttackAnimator.cs27
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayerAttackTargetFacer.cs66
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayerBallMovement.cs115
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayerCharacterAudio.cs94
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayerHpRegen.cs64
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayerInteraction.cs254
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayerManager.cs68
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayerMovement.cs218
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayerScept.cs89
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayerUpgradeManager.cs133
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayerWeaponAudio.cs63
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PlayerWeaponVisuals.cs35
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PositionAnimation.cs42
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PowerTowerPerk.cs56
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PracticeTargetCoinDrop.cs33
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PriorityAudioListener.cs27
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ProductionBar.cs23
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ProjectileAudio.cs37
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ProjectileImpactParticles.cs22
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ProjectileSpawnAudio.cs11
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/PushPlayer2D.cs28
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Quest.cs126
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/QuestConditionEquippable.cs33
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/QuestEntry.cs88
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/QuestMenu.cs21
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/QuestOverallProgressDisplay.cs15
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/QuestTagUI.cs107
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/QuickslingBarrelRotator.cs40
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/RacerRoll.cs16
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/RandomizeExtensionsForLists.cs18
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/RangeIndicatorHandler.cs207
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ReduceChildrensBuildRequirementIfPerk.cs23
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ResetAudioSettings.cs13
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ResetControlsHelper.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ResolutionExtensions.cs13
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/RevivePanel.cs29
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/RidingDamager.cs81
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/RiverScroller.cs18
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/RotateForwardToRVOVelocity.cs64
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/RoyalForgeUpgrade.cs203
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/RoyalForgeUpgrades.cs27
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SaveLoadEntity.cs63
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SaveLoadManager.cs238
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ScaleAnimation.cs42
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ScalePulse.cs18
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SceneNameToLevelData.cs6
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SceneTransitionManager.cs276
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ScoreManager.cs209
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ScoreTag.cs21
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ScreenMarker.cs212
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ScreenMarkerCanvasHelper.cs19
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ScreenMarkerIcon.cs12
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ScreenMarkerManager.cs284
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ScrollArea.cs119
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ScrollElementID.cs6
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SeasonTwoWaveGen.cs389
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SelectUnitUI.cs28
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SelfDestructWhenInRangeOf.cs33
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SetStateWhenMacOSX.cs13
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SetWidthToTarget.cs29
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsAntiAliasing.cs26
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsAudioVolume.cs26
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsFullscreen.cs19
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsLanguage.cs32
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsLanguageReset.cs14
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsManager.cs443
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsPostProcessing.cs19
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsPostProcessingHelper.cs18
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsRenderScale.cs24
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsResetUnitsMorning.cs19
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsResetVideo.cs13
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsResolution.cs41
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsShadowResolution.cs26
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsUIHelper.cs122
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsUseLargeUI.cs22
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsVsync.cs19
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SettingsWinterMode.cs19
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ShapeGroupFader.cs31
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SharpCornerMidigator.cs46
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ShieldOnFirstDamaged.cs86
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Shrine.cs208
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SimpleRotator.cs23
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SimpleUIScaler.cs43
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SimpleWalk.cs55
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SizeRectangleToMeshBounds.cs20
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SlowEffect.cs17
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Spawn.cs265
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SpawnAttackAfter.cs67
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SpawnMA.cs15
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SpinAnimation.cs45
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SplashDamageArea.cs51
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/StabMA.cs92
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SteamManager.cs209
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/StringFloatSerializableDictionary.cs6
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SuperSimpleOceanAnimation.cs47
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SuperWaveGen.cs1508
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/SuspendPlayerCollisionUntilNoOverlap.cs98
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUIAudioHelper.cs53
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUIBlockoutElement.cs44
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUICheckboxMouseCatcher.cs43
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUIEnemy.cs250
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUIEnumMouseCatcher.cs51
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUIEnumSelectorButton.cs40
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUIEquippable.cs375
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUIFocusCatcher.cs26
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUIIncomeDisplay.cs92
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUIPerklike.cs161
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUIScrollBar.cs51
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUISlider.cs141
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUISliderDragArea.cs127
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUITextButton.cs206
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TFUIUpgradeChoice.cs207
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TagManager.cs299
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TaggedObject.cs102
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TargetPriority.cs247
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TelePlayer.cs66
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TextBackgroundFitter.cs24
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TextMirror.cs14
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TextTranslator.cs41
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ThronefallAudioManager.cs348
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/ThronefallUIElement.cs168
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TieBreaker.cs111
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TimesensitiveLight.cs72
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TitleScreenPopUpHelper.cs50
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TitleScreenUIHelper.cs32
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Tooltip.cs63
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TooltipManager.cs102
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TowerUpgrade.cs114
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TransitionToSelectedLevelHelper.cs19
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TreasureChestUIHelper.cs39
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TreasuryUI.cs218
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/TutorialManager.cs662
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UIBonusLevelSelect.cs109
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UIFrame.cs343
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UIFrameManager.cs406
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UIParentResizer.cs40
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UIScaleHandler.cs45
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UnitAttackAnimator.cs31
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UnitAudio.cs395
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UnitCommandRadiusAnimation.cs68
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UnitDashJump.cs137
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UnitProductionSelector.cs114
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UnitRespawnerForBuildings.cs113
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UnitSpawnAppear.cs36
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UnitySerializedDictionary.cs35
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UnparentAndDestroyDelayedOnDeath.cs19
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UnparentOnStart.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UpgradeAssassinsTraining.cs36
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UpgradeBuildersGuild.cs82
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UpgradeCastleUp.cs76
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UpgradeCommander.cs39
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UpgradeGodlyCurse.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UpgradeMagicArmor.cs19
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UpgradePlayerDmg.cs12
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UpgradePlayerHp.cs22
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/UpgradeUnitsOnEnable.cs30
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/VersionNumberDisplay.cs12
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/VirtualBuilding.cs113
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Wave.cs153
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/WaveCountPopUp.cs81
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/WaveDescriptionUI.cs30
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/WaveDraft.cs28
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/WaveEnemyInfo.cs16
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/WaveGenUtility.cs39
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/WaveInfo.cs38
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Weapon.cs249
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/WeaponDamageDealer.cs18
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/WeaponEquipper.cs37
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/Wiggler.cs46
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/WigglerAnimatedVelocity.cs45
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/WigglerAnimationState.cs6
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/WigglerVelocity.cs40
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/WishlistButton.cs9
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall/__JobReflectionRegistrationOutput__296523972.cs29
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall_1_57.csproj377
-rw-r--r--Thronefall_v1.57/Thronefall/Thronefall_1_57.sln25
-rw-r--r--Thronefall_v1.57/Thronefall/UnitySourceGeneratedAssemblyMonoScriptTypes_v1.cs5653
632 files changed, 75738 insertions, 0 deletions
diff --git a/Thronefall_v1.57/.gitignore b/Thronefall_v1.57/.gitignore
new file mode 100644
index 0000000..3f7077b
--- /dev/null
+++ b/Thronefall_v1.57/.gitignore
@@ -0,0 +1 @@
+/Game \ No newline at end of file
diff --git a/Thronefall_v1.57/Thronefall/.gitignore b/Thronefall_v1.57/Thronefall/.gitignore
new file mode 100644
index 0000000..a4da27a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/.gitignore
@@ -0,0 +1,399 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.tlog
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio 6 auto-generated project file (contains which files were open etc.)
+*.vbp
+
+# Visual Studio 6 workspace and project file (working project files containing files to include in project)
+*.dsw
+*.dsp
+
+# Visual Studio 6 technical files
+*.ncb
+*.aps
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# Visual Studio History (VSHistory) files
+.vshistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
+
+# VS Code files for those working on multiple tools
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+*.code-workspace
+
+# Local History for Visual Studio Code
+.history/
+
+# Windows Installer files from build outputs
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
+
+# JetBrains Rider
+*.sln.iml
+.vs
diff --git a/Thronefall_v1.57/Thronefall/Ara/AraTrail.cs b/Thronefall_v1.57/Thronefall/Ara/AraTrail.cs
new file mode 100644
index 0000000..e5ade61
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Ara/AraTrail.cs
@@ -0,0 +1,947 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Rendering;
+using UnityEngine.Serialization;
+
+namespace Ara;
+
+[ExecuteInEditMode]
+public class AraTrail : MonoBehaviour
+{
+ public enum TrailAlignment
+ {
+ View,
+ Velocity,
+ Local
+ }
+
+ public enum TrailSpace
+ {
+ World,
+ Self,
+ Custom
+ }
+
+ public enum TrailSorting
+ {
+ OlderOnTop,
+ NewerOnTop
+ }
+
+ public enum Timescale
+ {
+ Normal,
+ Unscaled
+ }
+
+ public enum TextureMode
+ {
+ Stretch,
+ Tile,
+ WorldTile
+ }
+
+ public struct CurveFrame
+ {
+ public Vector3 position;
+
+ public Vector3 normal;
+
+ public Vector3 bitangent;
+
+ public Vector3 tangent;
+
+ public CurveFrame(Vector3 position, Vector3 normal, Vector3 bitangent, Vector3 tangent)
+ {
+ this.position = position;
+ this.normal = normal;
+ this.bitangent = bitangent;
+ this.tangent = tangent;
+ }
+
+ public Vector3 Transport(Vector3 newTangent, Vector3 newPosition)
+ {
+ Vector3 vector = newPosition - position;
+ float num = Vector3.Dot(vector, vector);
+ Vector3 vector2 = normal - 2f / (num + 1E-05f) * Vector3.Dot(vector, normal) * vector;
+ Vector3 vector3 = tangent - 2f / (num + 1E-05f) * Vector3.Dot(vector, tangent) * vector;
+ Vector3 vector4 = newTangent - vector3;
+ float num2 = Vector3.Dot(vector4, vector4);
+ Vector3 rhs = vector2 - 2f / (num2 + 1E-05f) * Vector3.Dot(vector4, vector2) * vector4;
+ Vector3 vector5 = Vector3.Cross(newTangent, rhs);
+ normal = rhs;
+ bitangent = vector5;
+ tangent = newTangent;
+ position = newPosition;
+ return normal;
+ }
+ }
+
+ public struct Point
+ {
+ public Vector3 position;
+
+ public Vector3 velocity;
+
+ public Vector3 tangent;
+
+ public Vector3 normal;
+
+ public Color color;
+
+ public float thickness;
+
+ public float life;
+
+ public float texcoord;
+
+ public bool discontinuous;
+
+ public Point(Vector3 position, Vector3 velocity, Vector3 tangent, Vector3 normal, Color color, float thickness, float texcoord, float lifetime)
+ {
+ this.position = position;
+ this.velocity = velocity;
+ this.tangent = tangent;
+ this.normal = normal;
+ this.color = color;
+ this.thickness = thickness;
+ life = lifetime;
+ this.texcoord = texcoord;
+ discontinuous = false;
+ }
+
+ public static float CatmullRom(float p0, float p1, float p2, float p3, float t)
+ {
+ float num = t * t;
+ return 0.5f * (2f * p1 + (0f - p0 + p2) * t + (2f * p0 - 5f * p1 + 4f * p2 - p3) * num + (0f - p0 + 3f * p1 - 3f * p2 + p3) * num * t);
+ }
+
+ public static Point operator +(Point p1, Point p2)
+ {
+ return new Point(p1.position + p2.position, p1.velocity + p2.velocity, p1.tangent + p2.tangent, p1.normal + p2.normal, p1.color + p2.color, p1.thickness + p2.thickness, p1.texcoord + p2.texcoord, p1.life + p2.life);
+ }
+
+ public static Point operator -(Point p1, Point p2)
+ {
+ return new Point(p1.position - p2.position, p1.velocity - p2.velocity, p1.tangent - p2.tangent, p1.normal - p2.normal, p1.color - p2.color, p1.thickness - p2.thickness, p1.texcoord - p2.texcoord, p1.life - p2.life);
+ }
+ }
+
+ public const float epsilon = 1E-05f;
+
+ [Header("Overall")]
+ [Tooltip("Trail cross-section asset, determines the shape of the emitted trail. If no asset is specified, the trail will be a simple strip.")]
+ public TrailSection section;
+
+ [Tooltip("Whether to use world or local space to generate and simulate the trail.")]
+ public TrailSpace space;
+
+ [Tooltip("Custom space to use when generating and simulating the trail")]
+ public Transform customSpace;
+
+ [Tooltip("Whether to use regular time.")]
+ public Timescale timescale;
+
+ [Tooltip("How to align the trail geometry: facing the camera (view) of using the transform's rotation (local).")]
+ public TrailAlignment alignment;
+
+ [Tooltip("Determines the order in which trail points will be rendered.")]
+ public TrailSorting sorting;
+
+ [Tooltip("Thickness multiplier, in meters.")]
+ public float thickness = 0.1f;
+
+ [Tooltip("Amount of smoothing iterations applied to the trail shape.")]
+ [Range(1f, 8f)]
+ public int smoothness = 1;
+
+ [Tooltip("Calculate accurate thickness at sharp corners.")]
+ public bool highQualityCorners;
+
+ [Range(0f, 12f)]
+ public int cornerRoundness = 5;
+
+ [Header("Length")]
+ [Tooltip("How should the thickness of the curve evolve over its lenght. The horizontal axis is normalized lenght (in the [0,1] range) and the vertical axis is a thickness multiplier.")]
+ [FormerlySerializedAs("thicknessOverLenght")]
+ public AnimationCurve thicknessOverLength = AnimationCurve.Linear(0f, 1f, 0f, 1f);
+
+ [Tooltip("How should vertex color evolve over the trail's length.")]
+ [FormerlySerializedAs("colorOverLenght")]
+ public Gradient colorOverLength = new Gradient();
+
+ [Header("Time")]
+ [Tooltip("How should the thickness of the curve evolve with its lifetime. The horizontal axis is normalized lifetime (in the [0,1] range) and the vertical axis is a thickness multiplier.")]
+ public AnimationCurve thicknessOverTime = AnimationCurve.Linear(0f, 1f, 0f, 1f);
+
+ [Tooltip("How should vertex color evolve over the trail's lifetime.")]
+ public Gradient colorOverTime = new Gradient();
+
+ [Header("Emission")]
+ public bool emit = true;
+
+ [Tooltip("Initial thickness of trail points when they are first spawned.")]
+ public float initialThickness = 1f;
+
+ [Tooltip("Initial color of trail points when they are first spawned.")]
+ public Color initialColor = Color.white;
+
+ [Tooltip("Initial velocity of trail points when they are first spawned.")]
+ public Vector3 initialVelocity = Vector3.zero;
+
+ [Tooltip("Minimum amount of time (in seconds) that must pass before spawning a new point.")]
+ public float timeInterval = 0.025f;
+
+ [Tooltip("Minimum distance (in meters) that must be left between consecutive points in the trail.")]
+ public float minDistance = 0.025f;
+
+ [Tooltip("Duration of the trail (in seconds).")]
+ public float time = 2f;
+
+ [Header("Physics")]
+ [Tooltip("Toggles trail physics.")]
+ public bool enablePhysics;
+
+ [Tooltip("Amount of seconds pre-simulated before the trail appears. Useful when you want a trail to be already simulating when the game starts.")]
+ public float warmup;
+
+ [Tooltip("Gravity affecting the trail.")]
+ public Vector3 gravity = Vector3.zero;
+
+ [Tooltip("Amount of speed transferred from the transform to the trail. 0 means no velocity is transferred, 1 means 100% of the velocity is transferred.")]
+ [Range(0f, 1f)]
+ public float inertia;
+
+ [Tooltip("Amount of temporal smoothing applied to the velocity transferred from the transform to the trail.")]
+ [Range(0f, 1f)]
+ public float velocitySmoothing = 0.75f;
+
+ [Tooltip("Amount of damping applied to the trail's velocity. Larger values will slow down the trail more as time passes.")]
+ [Range(0f, 1f)]
+ public float damping = 0.75f;
+
+ [Header("Rendering")]
+ public Material[] materials = new Material[1];
+
+ public ShadowCastingMode castShadows = ShadowCastingMode.On;
+
+ public bool receiveShadows = true;
+
+ public bool useLightProbes = true;
+
+ [Header("Texture")]
+ [Tooltip("Quad mapping will send the shader an extra coordinate for each vertex, that can be used to correct UV distortion using tex2Dproj.")]
+ public bool quadMapping;
+
+ [Tooltip("How to apply the texture over the trail: stretch it all over its lenght, or tile it.")]
+ public TextureMode textureMode;
+
+ [Tooltip("Defines how many times are U coords repeated across the length of the trail.")]
+ public float uvFactor = 1f;
+
+ [Tooltip("Defines how many times are V coords repeated trough the width of the trail.")]
+ public float uvWidthFactor = 1f;
+
+ [Tooltip("When the texture mode is set to 'Tile', defines where to begin tiling from: 0 means the start of the trail, 1 means the end.")]
+ [Range(0f, 1f)]
+ public float tileAnchor = 1f;
+
+ [HideInInspector]
+ public ElasticArray<Point> points = new ElasticArray<Point>();
+
+ private ElasticArray<Point> renderablePoints = new ElasticArray<Point>();
+
+ private List<int> discontinuities = new List<int>();
+
+ private Mesh mesh_;
+
+ private Vector3 velocity = Vector3.zero;
+
+ private Vector3 prevPosition;
+
+ private float accumTime;
+
+ private List<Vector3> vertices = new List<Vector3>();
+
+ private List<Vector3> normals = new List<Vector3>();
+
+ private List<Vector4> tangents = new List<Vector4>();
+
+ private List<Vector4> uvs = new List<Vector4>();
+
+ private List<Color> vertColors = new List<Color>();
+
+ private List<int> tris = new List<int>();
+
+ private Vector3 nextV = Vector3.zero;
+
+ private Vector3 prevV = Vector3.zero;
+
+ private Vector3 vertex = Vector3.zero;
+
+ private Vector3 normal = Vector3.zero;
+
+ private Vector3 bitangent = Vector3.zero;
+
+ private Vector4 tangent = new Vector4(0f, 0f, 0f, 1f);
+
+ private Vector4 texTangent = Vector4.zero;
+
+ private Vector4 uv = Vector4.zero;
+
+ private Color color;
+
+ private Action<ScriptableRenderContext, Camera> renderCallback;
+
+ public Vector3 Velocity => velocity;
+
+ private float DeltaTime
+ {
+ get
+ {
+ if (timescale != Timescale.Unscaled)
+ {
+ return Time.deltaTime;
+ }
+ return Time.unscaledDeltaTime;
+ }
+ }
+
+ private float FixedDeltaTime
+ {
+ get
+ {
+ if (timescale != Timescale.Unscaled)
+ {
+ return Time.fixedDeltaTime;
+ }
+ return Time.fixedUnscaledDeltaTime;
+ }
+ }
+
+ public Mesh mesh => mesh_;
+
+ public Matrix4x4 worldToTrail
+ {
+ get
+ {
+ switch (space)
+ {
+ case TrailSpace.World:
+ return Matrix4x4.identity;
+ case TrailSpace.Self:
+ return base.transform.worldToLocalMatrix;
+ case TrailSpace.Custom:
+ if (!(customSpace != null))
+ {
+ return Matrix4x4.identity;
+ }
+ return customSpace.worldToLocalMatrix;
+ default:
+ return Matrix4x4.identity;
+ }
+ }
+ }
+
+ public event Action onUpdatePoints;
+
+ public void OnValidate()
+ {
+ time = Mathf.Max(time, 1E-05f);
+ warmup = Mathf.Max(0f, warmup);
+ }
+
+ public void Awake()
+ {
+ Warmup();
+ }
+
+ private void OnEnable()
+ {
+ prevPosition = base.transform.position;
+ velocity = Vector3.zero;
+ mesh_ = new Mesh();
+ mesh_.name = "ara_trail_mesh";
+ mesh_.MarkDynamic();
+ AttachToCameraRendering();
+ }
+
+ private void OnDisable()
+ {
+ UnityEngine.Object.DestroyImmediate(mesh_);
+ DetachFromCameraRendering();
+ }
+
+ private void AttachToCameraRendering()
+ {
+ renderCallback = delegate(ScriptableRenderContext cntxt, Camera cam)
+ {
+ UpdateTrailMesh(cam);
+ };
+ RenderPipelineManager.beginCameraRendering += renderCallback;
+ Camera.onPreCull = (Camera.CameraCallback)Delegate.Combine(Camera.onPreCull, new Camera.CameraCallback(UpdateTrailMesh));
+ }
+
+ private void DetachFromCameraRendering()
+ {
+ RenderPipelineManager.beginCameraRendering -= renderCallback;
+ Camera.onPreCull = (Camera.CameraCallback)Delegate.Remove(Camera.onPreCull, new Camera.CameraCallback(UpdateTrailMesh));
+ }
+
+ public void Clear()
+ {
+ points.Clear();
+ }
+
+ private void UpdateVelocity()
+ {
+ if (DeltaTime > 0f)
+ {
+ velocity = Vector3.Lerp((base.transform.position - prevPosition) / DeltaTime, velocity, velocitySmoothing);
+ }
+ prevPosition = base.transform.position;
+ }
+
+ private void LateUpdate()
+ {
+ UpdateVelocity();
+ EmissionStep(DeltaTime);
+ SnapLastPointToTransform();
+ UpdatePointsLifecycle();
+ if (this.onUpdatePoints != null)
+ {
+ this.onUpdatePoints();
+ }
+ }
+
+ private void EmissionStep(float time)
+ {
+ accumTime += time;
+ if (accumTime >= timeInterval && emit)
+ {
+ Vector3 vector = worldToTrail.MultiplyPoint3x4(base.transform.position);
+ if (points.Count <= 1 || Vector3.Distance(vector, points[points.Count - 2].position) >= minDistance)
+ {
+ EmitPoint(vector);
+ accumTime = 0f;
+ }
+ }
+ }
+
+ private void Warmup()
+ {
+ if (!Application.isPlaying || !enablePhysics)
+ {
+ return;
+ }
+ for (float num = warmup; num > FixedDeltaTime; num -= FixedDeltaTime)
+ {
+ PhysicsStep(FixedDeltaTime);
+ EmissionStep(FixedDeltaTime);
+ SnapLastPointToTransform();
+ UpdatePointsLifecycle();
+ if (this.onUpdatePoints != null)
+ {
+ this.onUpdatePoints();
+ }
+ }
+ }
+
+ private void PhysicsStep(float timestep)
+ {
+ float num = Mathf.Pow(1f - Mathf.Clamp01(damping), timestep);
+ for (int i = 0; i < points.Count; i++)
+ {
+ Point value = points[i];
+ value.velocity += gravity * timestep;
+ value.velocity *= num;
+ value.position += value.velocity * timestep;
+ points[i] = value;
+ }
+ }
+
+ private void FixedUpdate()
+ {
+ if (enablePhysics)
+ {
+ PhysicsStep(FixedDeltaTime);
+ }
+ }
+
+ public void EmitPoint(Vector3 position)
+ {
+ float texcoord = 0f;
+ if (points.Count > 0)
+ {
+ texcoord = points[points.Count - 1].texcoord + Vector3.Distance(position, points[points.Count - 1].position);
+ }
+ points.Add(new Point(position, initialVelocity + velocity * inertia, base.transform.right, base.transform.forward, initialColor, initialThickness, texcoord, time));
+ }
+
+ private void SnapLastPointToTransform()
+ {
+ if (points.Count <= 0)
+ {
+ return;
+ }
+ Point value = points[points.Count - 1];
+ if (!emit)
+ {
+ value.discontinuous = true;
+ }
+ if (!value.discontinuous)
+ {
+ value.position = worldToTrail.MultiplyPoint3x4(base.transform.position);
+ value.normal = base.transform.forward;
+ value.tangent = base.transform.right;
+ if (points.Count > 1)
+ {
+ value.texcoord = points[points.Count - 2].texcoord + Vector3.Distance(value.position, points[points.Count - 2].position);
+ }
+ }
+ points[points.Count - 1] = value;
+ }
+
+ private void UpdatePointsLifecycle()
+ {
+ for (int num = points.Count - 1; num >= 0; num--)
+ {
+ Point value = points[num];
+ value.life -= DeltaTime;
+ points[num] = value;
+ if (value.life <= 0f)
+ {
+ if (smoothness <= 1)
+ {
+ points.RemoveAt(num);
+ }
+ else if (points[Mathf.Min(num + 1, points.Count - 1)].life <= 0f && points[Mathf.Min(num + 2, points.Count - 1)].life <= 0f)
+ {
+ points.RemoveAt(num);
+ }
+ }
+ }
+ }
+
+ private void ClearMeshData()
+ {
+ mesh_.Clear();
+ vertices.Clear();
+ normals.Clear();
+ tangents.Clear();
+ uvs.Clear();
+ vertColors.Clear();
+ tris.Clear();
+ }
+
+ private void CommitMeshData()
+ {
+ mesh_.SetVertices(vertices);
+ mesh_.SetNormals(normals);
+ mesh_.SetTangents(tangents);
+ mesh_.SetColors(vertColors);
+ mesh_.SetUVs(0, uvs);
+ mesh_.SetTriangles(tris, 0, calculateBounds: true);
+ }
+
+ private void RenderMesh(Camera cam)
+ {
+ Matrix4x4 inverse = worldToTrail.inverse;
+ for (int i = 0; i < materials.Length; i++)
+ {
+ Graphics.DrawMesh(mesh_, inverse, materials[i], base.gameObject.layer, cam, 0, null, castShadows, receiveShadows, null, useLightProbes);
+ }
+ }
+
+ public float GetLenght(ElasticArray<Point> input)
+ {
+ float num = 0f;
+ for (int i = 0; i < input.Count - 1; i++)
+ {
+ num += Vector3.Distance(input[i].position, input[i + 1].position);
+ }
+ return num;
+ }
+
+ private ElasticArray<Point> GetRenderablePoints(int start, int end)
+ {
+ renderablePoints.Clear();
+ if (smoothness <= 1)
+ {
+ for (int i = start; i <= end; i++)
+ {
+ renderablePoints.Add(points[i]);
+ }
+ return renderablePoints;
+ }
+ Point[] data = points.Data;
+ float num = 1f / (float)smoothness;
+ Point item = new Point(Vector3.zero, Vector3.zero, Vector3.zero, Vector3.zero, Color.white, 0f, 0f, 0f);
+ for (int j = start; j < end; j++)
+ {
+ int num2 = ((j == start) ? start : (j - 1));
+ int num3 = ((j == end - 1) ? end : (j + 2));
+ int num4 = j + 1;
+ float p = data[num2].position[0];
+ float p2 = data[num2].position[1];
+ float p3 = data[num2].position[2];
+ float p4 = data[num2].velocity[0];
+ float p5 = data[num2].velocity[1];
+ float p6 = data[num2].velocity[2];
+ float p7 = data[num2].tangent[0];
+ float p8 = data[num2].tangent[1];
+ float p9 = data[num2].tangent[2];
+ float p10 = data[num2].normal[0];
+ float p11 = data[num2].normal[1];
+ float p12 = data[num2].normal[2];
+ float p13 = data[num2].color[0];
+ float p14 = data[num2].color[1];
+ float p15 = data[num2].color[2];
+ float p16 = data[num2].color[3];
+ float p17 = data[j].position[0];
+ float p18 = data[j].position[1];
+ float p19 = data[j].position[2];
+ float p20 = data[j].velocity[0];
+ float p21 = data[j].velocity[1];
+ float p22 = data[j].velocity[2];
+ float p23 = data[j].tangent[0];
+ float p24 = data[j].tangent[1];
+ float p25 = data[j].tangent[2];
+ float p26 = data[j].normal[0];
+ float p27 = data[j].normal[1];
+ float p28 = data[j].normal[2];
+ float p29 = data[j].color[0];
+ float p30 = data[j].color[1];
+ float p31 = data[j].color[2];
+ float p32 = data[j].color[3];
+ float p33 = data[num4].position[0];
+ float p34 = data[num4].position[1];
+ float p35 = data[num4].position[2];
+ float p36 = data[num4].velocity[0];
+ float p37 = data[num4].velocity[1];
+ float p38 = data[num4].velocity[2];
+ float p39 = data[num4].tangent[0];
+ float p40 = data[num4].tangent[1];
+ float p41 = data[num4].tangent[2];
+ float p42 = data[num4].normal[0];
+ float p43 = data[num4].normal[1];
+ float p44 = data[num4].normal[2];
+ float p45 = data[num4].color[0];
+ float p46 = data[num4].color[1];
+ float p47 = data[num4].color[2];
+ float p48 = data[num4].color[3];
+ float p49 = data[num3].position[0];
+ float p50 = data[num3].position[1];
+ float p51 = data[num3].position[2];
+ float p52 = data[num3].velocity[0];
+ float p53 = data[num3].velocity[1];
+ float p54 = data[num3].velocity[2];
+ float p55 = data[num3].tangent[0];
+ float p56 = data[num3].tangent[1];
+ float p57 = data[num3].tangent[2];
+ float p58 = data[num3].normal[0];
+ float p59 = data[num3].normal[1];
+ float p60 = data[num3].normal[2];
+ float p61 = data[num3].color[0];
+ float p62 = data[num3].color[1];
+ float p63 = data[num3].color[2];
+ float p64 = data[num3].color[3];
+ for (int k = 0; k < smoothness; k++)
+ {
+ float t = (float)k * num;
+ item.life = Point.CatmullRom(data[num2].life, data[j].life, data[num4].life, data[num3].life, t);
+ if (item.life > 0f)
+ {
+ item.position.x = Point.CatmullRom(p, p17, p33, p49, t);
+ item.position.y = Point.CatmullRom(p2, p18, p34, p50, t);
+ item.position.z = Point.CatmullRom(p3, p19, p35, p51, t);
+ item.velocity.x = Point.CatmullRom(p4, p20, p36, p52, t);
+ item.velocity.y = Point.CatmullRom(p5, p21, p37, p53, t);
+ item.velocity.z = Point.CatmullRom(p6, p22, p38, p54, t);
+ item.tangent.x = Point.CatmullRom(p7, p23, p39, p55, t);
+ item.tangent.y = Point.CatmullRom(p8, p24, p40, p56, t);
+ item.tangent.z = Point.CatmullRom(p9, p25, p41, p57, t);
+ item.normal.x = Point.CatmullRom(p10, p26, p42, p58, t);
+ item.normal.y = Point.CatmullRom(p11, p27, p43, p59, t);
+ item.normal.z = Point.CatmullRom(p12, p28, p44, p60, t);
+ item.color.r = Point.CatmullRom(p13, p29, p45, p61, t);
+ item.color.g = Point.CatmullRom(p14, p30, p46, p62, t);
+ item.color.b = Point.CatmullRom(p15, p31, p47, p63, t);
+ item.color.a = Point.CatmullRom(p16, p32, p48, p64, t);
+ item.thickness = Point.CatmullRom(data[num2].thickness, data[j].thickness, data[num4].thickness, data[num3].thickness, t);
+ item.texcoord = Point.CatmullRom(data[num2].texcoord, data[j].texcoord, data[num4].texcoord, data[num3].texcoord, t);
+ renderablePoints.Add(item);
+ }
+ }
+ }
+ if (points[end].life > 0f)
+ {
+ renderablePoints.Add(points[end]);
+ }
+ return renderablePoints;
+ }
+
+ private CurveFrame InitializeCurveFrame(Vector3 point, Vector3 nextPoint)
+ {
+ Vector3 vector = nextPoint - point;
+ if (Mathf.Approximately(Mathf.Abs(Vector3.Dot(vector.normalized, base.transform.forward)), 1f))
+ {
+ vector += base.transform.right * 0.01f;
+ }
+ return new CurveFrame(point, base.transform.forward, base.transform.up, vector);
+ }
+
+ private void UpdateTrailMesh(Camera cam)
+ {
+ if ((cam.cullingMask & (1 << base.gameObject.layer)) == 0)
+ {
+ return;
+ }
+ ClearMeshData();
+ if (points.Count <= 1)
+ {
+ return;
+ }
+ Vector3 localCamPosition = worldToTrail.MultiplyPoint3x4(cam.transform.position);
+ discontinuities.Clear();
+ for (int i = 0; i < points.Count; i++)
+ {
+ if (points[i].discontinuous || i == points.Count - 1)
+ {
+ discontinuities.Add(i);
+ }
+ }
+ int start = 0;
+ for (int j = 0; j < discontinuities.Count; j++)
+ {
+ UpdateSegmentMesh(start, discontinuities[j], localCamPosition);
+ start = discontinuities[j] + 1;
+ }
+ CommitMeshData();
+ RenderMesh(cam);
+ }
+
+ private void UpdateSegmentMesh(int start, int end, Vector3 localCamPosition)
+ {
+ ElasticArray<Point> elasticArray = GetRenderablePoints(start, end);
+ if (sorting == TrailSorting.NewerOnTop)
+ {
+ elasticArray.Reverse();
+ }
+ Point[] data = elasticArray.Data;
+ if (elasticArray.Count <= 1)
+ {
+ return;
+ }
+ float num = Mathf.Max(GetLenght(elasticArray), 1E-05f);
+ float num2 = 0f;
+ float num3 = ((textureMode == TextureMode.Stretch) ? 0f : ((0f - uvFactor) * num * tileAnchor));
+ if (sorting == TrailSorting.NewerOnTop)
+ {
+ num3 = 1f - num3;
+ }
+ CurveFrame frame = InitializeCurveFrame(data[elasticArray.Count - 1].position, data[elasticArray.Count - 2].position);
+ int va = 1;
+ int vb = 0;
+ for (int num4 = elasticArray.Count - 1; num4 >= 0; num4--)
+ {
+ int num5 = Mathf.Max(num4 - 1, 0);
+ int num6 = Mathf.Min(num4 + 1, elasticArray.Count - 1);
+ nextV.x = data[num5].position.x - data[num4].position.x;
+ nextV.y = data[num5].position.y - data[num4].position.y;
+ nextV.z = data[num5].position.z - data[num4].position.z;
+ prevV.x = data[num4].position.x - data[num6].position.x;
+ prevV.y = data[num4].position.y - data[num6].position.y;
+ prevV.z = data[num4].position.z - data[num6].position.z;
+ float num7 = ((num5 == num4) ? prevV.magnitude : nextV.magnitude);
+ nextV.Normalize();
+ prevV.Normalize();
+ if (alignment == TrailAlignment.Local)
+ {
+ tangent = data[num4].tangent.normalized;
+ }
+ else
+ {
+ tangent.x = (nextV.x + prevV.x) * 0.5f;
+ tangent.y = (nextV.y + prevV.y) * 0.5f;
+ tangent.z = (nextV.z + prevV.z) * 0.5f;
+ }
+ normal = data[num4].normal;
+ if (alignment != TrailAlignment.Local)
+ {
+ normal = ((alignment == TrailAlignment.View) ? (localCamPosition - data[num4].position) : frame.Transport(tangent, data[num4].position));
+ }
+ normal.Normalize();
+ if (alignment == TrailAlignment.Velocity)
+ {
+ bitangent = frame.bitangent;
+ }
+ else
+ {
+ bitangent.x = tangent.y * normal.z - tangent.z * normal.y;
+ bitangent.y = tangent.z * normal.x - tangent.x * normal.z;
+ bitangent.z = tangent.x * normal.y - tangent.y * normal.x;
+ }
+ bitangent.Normalize();
+ float num8 = ((sorting == TrailSorting.OlderOnTop) ? (num2 / num) : ((num - num2) / num));
+ float num9 = Mathf.Clamp01(1f - data[num4].life / time);
+ num2 += num7;
+ color = data[num4].color * colorOverTime.Evaluate(num9) * colorOverLength.Evaluate(num8);
+ float sectionThickness = thickness * data[num4].thickness * thicknessOverTime.Evaluate(num9) * thicknessOverLength.Evaluate(num8);
+ if (textureMode == TextureMode.WorldTile)
+ {
+ num3 = tileAnchor + data[num4].texcoord * uvFactor;
+ }
+ if (section != null)
+ {
+ AppendSection(data, ref frame, num4, elasticArray.Count, sectionThickness, num3);
+ }
+ else
+ {
+ AppendFlatTrail(data, ref frame, num4, elasticArray.Count, sectionThickness, num3, ref va, ref vb);
+ }
+ float num10 = ((textureMode == TextureMode.Stretch) ? (num7 / num) : num7);
+ num3 += uvFactor * ((sorting == TrailSorting.NewerOnTop) ? (0f - num10) : num10);
+ }
+ }
+
+ private void AppendSection(Point[] data, ref CurveFrame frame, int i, int count, float sectionThickness, float vCoord)
+ {
+ int segments = section.Segments;
+ int num = segments + 1;
+ for (int j = 0; j <= segments; j++)
+ {
+ normal.x = (section.vertices[j].x * bitangent.x + section.vertices[j].y * tangent.x) * sectionThickness;
+ normal.y = (section.vertices[j].x * bitangent.y + section.vertices[j].y * tangent.y) * sectionThickness;
+ normal.z = (section.vertices[j].x * bitangent.z + section.vertices[j].y * tangent.z) * sectionThickness;
+ vertex.x = data[i].position.x + normal.x;
+ vertex.y = data[i].position.y + normal.y;
+ vertex.z = data[i].position.z + normal.z;
+ texTangent.x = 0f - (normal.y * frame.tangent.z - normal.z * frame.tangent.y);
+ texTangent.y = 0f - (normal.z * frame.tangent.x - normal.x * frame.tangent.z);
+ texTangent.z = 0f - (normal.x * frame.tangent.y - normal.y * frame.tangent.x);
+ texTangent.w = 1f;
+ uv.x = (float)j / (float)segments * uvWidthFactor;
+ uv.y = vCoord;
+ uv.z = 0f;
+ uv.w = 1f;
+ vertices.Add(vertex);
+ normals.Add(normal);
+ tangents.Add(texTangent);
+ uvs.Add(uv);
+ vertColors.Add(color);
+ if (j < segments && i < count - 1)
+ {
+ tris.Add(i * num + j);
+ tris.Add(i * num + (j + 1));
+ tris.Add((i + 1) * num + j);
+ tris.Add(i * num + (j + 1));
+ tris.Add((i + 1) * num + (j + 1));
+ tris.Add((i + 1) * num + j);
+ }
+ }
+ }
+
+ private void AppendFlatTrail(Point[] data, ref CurveFrame frame, int i, int count, float sectionThickness, float vCoord, ref int va, ref int vb)
+ {
+ bool num = highQualityCorners && alignment != TrailAlignment.Local;
+ Quaternion quaternion = Quaternion.identity;
+ Vector3 vector = Vector3.zero;
+ float num2 = 0f;
+ float num3 = sectionThickness;
+ Vector3 vector2 = bitangent;
+ if (num)
+ {
+ Vector3 vector3 = ((i == 0) ? bitangent : Vector3.Cross(nextV, Vector3.Cross(bitangent, tangent)).normalized);
+ if (cornerRoundness > 0)
+ {
+ vector2 = ((i == count - 1) ? (-bitangent) : Vector3.Cross(prevV, Vector3.Cross(bitangent, tangent)).normalized);
+ num2 = ((i == 0 || i == count - 1) ? 1f : Mathf.Sign(Vector3.Dot(nextV, -vector2)));
+ float num4 = ((i == 0 || i == count - 1) ? MathF.PI : Mathf.Acos(Mathf.Clamp(Vector3.Dot(vector3, vector2), -1f, 1f)));
+ quaternion = Quaternion.AngleAxis(57.29578f * num4 / (float)cornerRoundness, normal * num2);
+ vector = vector2 * sectionThickness * num2;
+ }
+ if (vector3.sqrMagnitude > 0.1f)
+ {
+ num3 = sectionThickness / Mathf.Max(Vector3.Dot(bitangent, vector3), 0.15f);
+ }
+ }
+ if (num && cornerRoundness > 0)
+ {
+ if (num2 > 0f)
+ {
+ vertices.Add(data[i].position + vector2 * sectionThickness);
+ vertices.Add(data[i].position - bitangent * num3);
+ }
+ else
+ {
+ vertices.Add(data[i].position + bitangent * num3);
+ vertices.Add(data[i].position - vector2 * sectionThickness);
+ }
+ }
+ else
+ {
+ vertices.Add(data[i].position + bitangent * num3);
+ vertices.Add(data[i].position - bitangent * num3);
+ }
+ normals.Add(normal);
+ normals.Add(normal);
+ tangents.Add(tangent);
+ tangents.Add(tangent);
+ vertColors.Add(color);
+ vertColors.Add(color);
+ if (quadMapping)
+ {
+ uv.Set(vCoord * sectionThickness, (sorting == TrailSorting.NewerOnTop) ? (uvWidthFactor * sectionThickness) : 0f, 0f, sectionThickness);
+ uvs.Add(uv);
+ uv.Set(vCoord * sectionThickness, (sorting == TrailSorting.NewerOnTop) ? 0f : (uvWidthFactor * sectionThickness), 0f, sectionThickness);
+ uvs.Add(uv);
+ }
+ else
+ {
+ uv.Set(vCoord, (sorting == TrailSorting.NewerOnTop) ? uvWidthFactor : 0f, 0f, 1f);
+ uvs.Add(uv);
+ uv.Set(vCoord, (sorting == TrailSorting.NewerOnTop) ? 0f : uvWidthFactor, 0f, 1f);
+ uvs.Add(uv);
+ }
+ if (i < count - 1)
+ {
+ int num5 = vertices.Count - 1;
+ tris.Add(num5);
+ tris.Add(va);
+ tris.Add(vb);
+ tris.Add(vb);
+ tris.Add(num5 - 1);
+ tris.Add(num5);
+ }
+ va = vertices.Count - 1;
+ vb = vertices.Count - 2;
+ if (!num || cornerRoundness <= 0)
+ {
+ return;
+ }
+ for (int j = 0; j <= cornerRoundness; j++)
+ {
+ vertices.Add(data[i].position + vector);
+ normals.Add(normal);
+ tangents.Add(tangent);
+ vertColors.Add(color);
+ uv.Set(vCoord, (!(num2 > 0f)) ? 1 : 0, 0f, 1f);
+ uvs.Add(uv);
+ int num6 = vertices.Count - 1;
+ tris.Add(num6);
+ tris.Add(va);
+ tris.Add(vb);
+ if (num2 > 0f)
+ {
+ vb = num6;
+ }
+ else
+ {
+ va = num6;
+ }
+ vector = quaternion * vector;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Ara/ColorFromSpeed.cs b/Thronefall_v1.57/Thronefall/Ara/ColorFromSpeed.cs
new file mode 100644
index 0000000..a73fb92
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Ara/ColorFromSpeed.cs
@@ -0,0 +1,40 @@
+using UnityEngine;
+
+namespace Ara;
+
+[RequireComponent(typeof(AraTrail))]
+public class ColorFromSpeed : MonoBehaviour
+{
+ private AraTrail trail;
+
+ [Tooltip("Maps trail speed to color. Control how much speed is transferred to the trail by setting inertia > 0. The trail will be colorized even if physics are disabled. ")]
+ public Gradient colorFromSpeed = new Gradient();
+
+ [Tooltip("Min speed used to map speed to color.")]
+ public float minSpeed;
+
+ [Tooltip("Max speed used to map speed to color.")]
+ public float maxSpeed = 5f;
+
+ private void OnEnable()
+ {
+ trail = GetComponent<AraTrail>();
+ trail.onUpdatePoints += SetColorFromSpeed;
+ }
+
+ private void OnDisable()
+ {
+ trail.onUpdatePoints -= SetColorFromSpeed;
+ }
+
+ private void SetColorFromSpeed()
+ {
+ float num = Mathf.Max(1E-05f, maxSpeed - minSpeed);
+ for (int i = 0; i < trail.points.Count; i++)
+ {
+ AraTrail.Point value = trail.points[i];
+ value.color = colorFromSpeed.Evaluate((value.velocity.magnitude - minSpeed) / num);
+ trail.points[i] = value;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Ara/ElasticArray.cs b/Thronefall_v1.57/Thronefall/Ara/ElasticArray.cs
new file mode 100644
index 0000000..038435c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Ara/ElasticArray.cs
@@ -0,0 +1,160 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Ara;
+
+public class ElasticArray<T> : IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable
+{
+ private T[] data = new T[16];
+
+ private int count;
+
+ public int Count => count;
+
+ public bool IsReadOnly => false;
+
+ public T this[int index]
+ {
+ get
+ {
+ return data[index];
+ }
+ set
+ {
+ data[index] = value;
+ }
+ }
+
+ public T[] Data => data;
+
+ public IEnumerator<T> GetEnumerator()
+ {
+ int i = 0;
+ while (i < count)
+ {
+ yield return data[i];
+ int num = i + 1;
+ i = num;
+ }
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+
+ public void Add(T item)
+ {
+ EnsureCapacity(count + 1);
+ data[count++] = item;
+ }
+
+ public void Clear()
+ {
+ count = 0;
+ }
+
+ public bool Contains(T item)
+ {
+ for (int i = 0; i < count; i++)
+ {
+ if (data[i].Equals(item))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void CopyTo(T[] array, int arrayIndex)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException();
+ }
+ if (array.Length - arrayIndex < count)
+ {
+ throw new ArgumentException();
+ }
+ Array.Copy(data, 0, array, arrayIndex, count);
+ }
+
+ public bool Remove(T item)
+ {
+ bool flag = false;
+ for (int i = 0; i < count; i++)
+ {
+ if (!flag && data[i].Equals(item))
+ {
+ flag = true;
+ }
+ if (flag && i < count - 1)
+ {
+ data[i] = data[i + 1];
+ }
+ }
+ if (flag)
+ {
+ count--;
+ }
+ return flag;
+ }
+
+ public int IndexOf(T item)
+ {
+ return Array.IndexOf(data, item);
+ }
+
+ public void Insert(int index, T item)
+ {
+ if (index < 0 || index > count)
+ {
+ throw new ArgumentOutOfRangeException();
+ }
+ EnsureCapacity(++count);
+ for (int i = count - 1; i > index; i++)
+ {
+ data[i] = data[i - 1];
+ }
+ data[index] = item;
+ }
+
+ public void RemoveAt(int index)
+ {
+ for (int i = index; i < count; i++)
+ {
+ if (i < count - 1)
+ {
+ data[i] = data[i + 1];
+ }
+ }
+ count--;
+ }
+
+ public void SetCount(int count)
+ {
+ EnsureCapacity(count);
+ this.count = count;
+ }
+
+ public void EnsureCapacity(int capacity)
+ {
+ if (capacity >= data.Length)
+ {
+ Array.Resize(ref data, capacity * 2);
+ }
+ }
+
+ public void Reverse()
+ {
+ int num = 0;
+ int num2 = count - 1;
+ while (num < num2)
+ {
+ T val = data[num];
+ data[num++] = data[num2];
+ data[num2--] = val;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Ara/ElectricalArc.cs b/Thronefall_v1.57/Thronefall/Ara/ElectricalArc.cs
new file mode 100644
index 0000000..14ff239
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Ara/ElectricalArc.cs
@@ -0,0 +1,57 @@
+using System;
+using UnityEngine;
+
+namespace Ara;
+
+[RequireComponent(typeof(AraTrail))]
+public class ElectricalArc : MonoBehaviour
+{
+ private AraTrail trail;
+
+ public Transform source;
+
+ public Transform target;
+
+ public int points = 20;
+
+ public float burstInterval = 0.5f;
+
+ public float burstRandom = 0.2f;
+
+ public float speedRandom = 2f;
+
+ public float positionRandom = 0.1f;
+
+ private float accum;
+
+ private void OnEnable()
+ {
+ trail = GetComponent<AraTrail>();
+ trail.emit = false;
+ }
+
+ private void Update()
+ {
+ accum += Time.deltaTime;
+ if (accum >= burstInterval)
+ {
+ ChangeArc();
+ accum = (0f - burstInterval) * UnityEngine.Random.value * burstRandom;
+ }
+ }
+
+ private void ChangeArc()
+ {
+ trail.points.Clear();
+ if (source != null && target != null)
+ {
+ for (int i = 0; i < points; i++)
+ {
+ float num = (float)i / (float)(points - 1);
+ float num2 = Mathf.Sin(num * MathF.PI);
+ Vector3 vector = Vector3.Lerp(source.position, target.position, num);
+ trail.points.Add(new AraTrail.Point(vector + UnityEngine.Random.onUnitSphere * positionRandom * num2, UnityEngine.Random.onUnitSphere * speedRandom * num2, Vector3.up, Vector3.forward, Color.white, 1f, 0f, burstInterval * 2f));
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Ara/TireTrack.cs b/Thronefall_v1.57/Thronefall/Ara/TireTrack.cs
new file mode 100644
index 0000000..845bee2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Ara/TireTrack.cs
@@ -0,0 +1,50 @@
+using UnityEngine;
+
+namespace Ara;
+
+[RequireComponent(typeof(AraTrail))]
+public class TireTrack : MonoBehaviour
+{
+ private AraTrail trail;
+
+ public float offset = 0.05f;
+
+ public float maxDist = 0.1f;
+
+ private void OnEnable()
+ {
+ trail = GetComponent<AraTrail>();
+ trail.onUpdatePoints += ProjectToGround;
+ }
+
+ private void OnDisable()
+ {
+ trail.onUpdatePoints -= ProjectToGround;
+ }
+
+ private void ProjectToGround()
+ {
+ if (Physics.Raycast(new Ray(base.transform.position, -Vector3.up), out var hitInfo, maxDist))
+ {
+ if (trail.emit && trail.points.Count > 0)
+ {
+ AraTrail.Point value = trail.points[trail.points.Count - 1];
+ if (!value.discontinuous)
+ {
+ value.normal = hitInfo.normal;
+ value.position = hitInfo.point + hitInfo.normal * offset;
+ trail.points[trail.points.Count - 1] = value;
+ }
+ }
+ trail.emit = true;
+ }
+ else if (trail.emit)
+ {
+ trail.emit = false;
+ if (trail.points.Count > 0)
+ {
+ trail.points.RemoveAt(trail.points.Count - 1);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Ara/TrailSection.cs b/Thronefall_v1.57/Thronefall/Ara/TrailSection.cs
new file mode 100644
index 0000000..f530aef
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Ara/TrailSection.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Ara;
+
+[CreateAssetMenu(menuName = "Ara Trails/Trail Section")]
+public class TrailSection : ScriptableObject
+{
+ [HideInInspector]
+ public List<Vector2> vertices;
+
+ public int snapX;
+
+ public int snapY;
+
+ public int Segments => vertices.Count - 1;
+
+ public void OnEnable()
+ {
+ if (vertices == null)
+ {
+ vertices = new List<Vector2>();
+ CirclePreset(8);
+ }
+ }
+
+ public void CirclePreset(int segments)
+ {
+ vertices.Clear();
+ for (int i = 0; i <= segments; i++)
+ {
+ float f = MathF.PI * 2f / (float)segments * (float)i;
+ vertices.Add(Mathf.Cos(f) * Vector2.right + Mathf.Sin(f) * Vector2.up);
+ }
+ }
+
+ public static int SnapTo(float val, int snapInterval, int threshold)
+ {
+ int num = (int)val;
+ if (snapInterval <= 0)
+ {
+ return num;
+ }
+ int num2 = Mathf.FloorToInt(val / (float)snapInterval) * snapInterval;
+ int num3 = num2 + snapInterval;
+ if (num - num2 < threshold)
+ {
+ return num2;
+ }
+ if (num3 - num < threshold)
+ {
+ return num3;
+ }
+ return num;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/FlatKit/BlitTexturePass.cs b/Thronefall_v1.57/Thronefall/FlatKit/BlitTexturePass.cs
new file mode 100644
index 0000000..5b9e754
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/FlatKit/BlitTexturePass.cs
@@ -0,0 +1,80 @@
+using UnityEngine;
+using UnityEngine.Rendering;
+using UnityEngine.Rendering.Universal;
+
+namespace FlatKit;
+
+internal class BlitTexturePass : ScriptableRenderPass
+{
+ public static readonly string CopyEffectShaderName = "Hidden/FlatKit/CopyTexture";
+
+ private ProfilingSampler _profilingSampler;
+
+ private Material _effectMaterial;
+
+ private Material _copyMaterial;
+
+ private RenderTargetHandle _temporaryColorTexture;
+
+ public void Setup(Material effectMaterial, bool useDepth, bool useNormals, bool useColor)
+ {
+ _effectMaterial = effectMaterial;
+ string text = effectMaterial.name.Substring(effectMaterial.name.LastIndexOf('/') + 1);
+ _profilingSampler = new ProfilingSampler("Blit " + text);
+ _copyMaterial = CoreUtils.CreateEngineMaterial(CopyEffectShaderName);
+ ConfigureInput((useColor ? ScriptableRenderPassInput.Color : ScriptableRenderPassInput.None) | (useDepth ? ScriptableRenderPassInput.Depth : ScriptableRenderPassInput.None) | (useNormals ? ScriptableRenderPassInput.Normal : ScriptableRenderPassInput.None));
+ }
+
+ public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData)
+ {
+ ConfigureTarget(new RenderTargetIdentifier(renderingData.cameraData.renderer.cameraColorTarget, 0, CubemapFace.Unknown, -1));
+ }
+
+ public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
+ {
+ if (_effectMaterial == null || renderingData.cameraData.camera.cameraType != CameraType.Game)
+ {
+ return;
+ }
+ _temporaryColorTexture = default(RenderTargetHandle);
+ CommandBuffer commandBuffer = CommandBufferPool.Get();
+ using (new ProfilingScope(commandBuffer, _profilingSampler))
+ {
+ RenderTextureDescriptor cameraTargetDescriptor = renderingData.cameraData.cameraTargetDescriptor;
+ cameraTargetDescriptor.depthBufferBits = 0;
+ SetSourceSize(commandBuffer, cameraTargetDescriptor);
+ RTHandle cameraColorTargetHandle = renderingData.cameraData.renderer.cameraColorTargetHandle;
+ commandBuffer.GetTemporaryRT(_temporaryColorTexture.id, cameraTargetDescriptor);
+ if (renderingData.cameraData.xrRendering)
+ {
+ _effectMaterial.EnableKeyword("_USE_DRAW_PROCEDURAL");
+ commandBuffer.SetRenderTarget(_temporaryColorTexture.Identifier());
+ commandBuffer.DrawMesh(RenderingUtils.fullscreenMesh, Matrix4x4.identity, _effectMaterial, 0, 0);
+ commandBuffer.SetGlobalTexture("_EffectTexture", _temporaryColorTexture.Identifier());
+ commandBuffer.SetRenderTarget(new RenderTargetIdentifier(cameraColorTargetHandle, 0, CubemapFace.Unknown, -1));
+ commandBuffer.DrawMesh(RenderingUtils.fullscreenMesh, Matrix4x4.identity, _copyMaterial, 0, 0);
+ }
+ else
+ {
+ _effectMaterial.DisableKeyword("_USE_DRAW_PROCEDURAL");
+ commandBuffer.Blit(cameraColorTargetHandle, _temporaryColorTexture.Identifier(), _effectMaterial, 0);
+ commandBuffer.Blit(_temporaryColorTexture.Identifier(), cameraColorTargetHandle);
+ }
+ }
+ context.ExecuteCommandBuffer(commandBuffer);
+ commandBuffer.Clear();
+ CommandBufferPool.Release(commandBuffer);
+ }
+
+ private static void SetSourceSize(CommandBuffer cmd, RenderTextureDescriptor desc)
+ {
+ float num = desc.width;
+ float num2 = desc.height;
+ if (desc.useDynamicScale)
+ {
+ num *= ScalableBufferManager.widthScaleFactor;
+ num2 *= ScalableBufferManager.heightScaleFactor;
+ }
+ cmd.SetGlobalVector("_SourceSize", new Vector4(num, num2, 1f / num, 1f / num2));
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/FlatKit/Buoyancy.cs b/Thronefall_v1.57/Thronefall/FlatKit/Buoyancy.cs
new file mode 100644
index 0000000..9e876ab
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/FlatKit/Buoyancy.cs
@@ -0,0 +1,105 @@
+using UnityEngine;
+
+namespace FlatKit;
+
+public class Buoyancy : MonoBehaviour
+{
+ [Tooltip("The object that contains a Water material.")]
+ public Transform water;
+
+ [Space]
+ [Tooltip("Range of probing wave height for buoyancy rotation.")]
+ public float size = 1f;
+
+ [Tooltip("Max height of buoyancy going up and down.")]
+ public float amplitude = 1f;
+
+ [Space]
+ [Tooltip("Optionally provide a separate material to get the wave parameters.")]
+ public Material overrideWaterMaterial;
+
+ private Material _material;
+
+ private float _speed;
+
+ private float _amplitude;
+
+ private float _frequency;
+
+ private float _direction;
+
+ private Vector3 _originalPosition;
+
+ private void Start()
+ {
+ Renderer component = water.GetComponent<Renderer>();
+ _material = ((overrideWaterMaterial != null) ? overrideWaterMaterial : component.sharedMaterial);
+ _speed = _material.GetFloat("_WaveSpeed");
+ _amplitude = _material.GetFloat("_WaveAmplitude");
+ _frequency = _material.GetFloat("_WaveFrequency");
+ _direction = _material.GetFloat("_WaveDirection");
+ Transform transform = base.transform;
+ _originalPosition = transform.position;
+ }
+
+ private void Update()
+ {
+ Vector3 position = base.transform.position;
+ Vector3 positionOS = water.InverseTransformPoint(position);
+ position.y = GetHeightOS(positionOS) + _originalPosition.y;
+ base.transform.position = position;
+ base.transform.up = GetNormalWS(positionOS);
+ }
+
+ private Vector2 GradientNoiseDir(Vector2 p)
+ {
+ p = new Vector2(p.x % 289f, p.y % 289f);
+ float num = (34f * p.x + 1f) * p.x % 289f + p.y;
+ num = (34f * num + 1f) * num % 289f;
+ num = num / 41f % 1f * 2f - 1f;
+ return new Vector2(num - Mathf.Floor(num + 0.5f), Mathf.Abs(num) - 0.5f).normalized;
+ }
+
+ private float GradientNoise(Vector2 p)
+ {
+ Vector2 vector = new Vector2(Mathf.Floor(p.x), Mathf.Floor(p.y));
+ Vector2 vector2 = new Vector2(p.x % 1f, p.y % 1f);
+ float a = Vector3.Dot(GradientNoiseDir(vector), vector2);
+ float b = Vector3.Dot(GradientNoiseDir(vector + Vector2.up), vector2 - Vector2.up);
+ float a2 = Vector3.Dot(GradientNoiseDir(vector + Vector2.right), vector2 - Vector2.right);
+ float b2 = Vector3.Dot(GradientNoiseDir(vector + Vector2.one), vector2 - Vector2.one);
+ vector2 = vector2 * vector2 * vector2 * (vector2 * (vector2 * 6f - Vector2.one * 15f) + Vector2.one * 10f);
+ return Mathf.Lerp(Mathf.Lerp(a, b, vector2.y), Mathf.Lerp(a2, b2, vector2.y), vector2.x);
+ }
+
+ private Vector3 GetNormalWS(Vector3 positionOS)
+ {
+ Vector3 vector = positionOS + Vector3.forward * size;
+ vector.y = GetHeightOS(vector);
+ Vector3 vector2 = positionOS + Vector3.right * size;
+ vector2.y = GetHeightOS(vector);
+ Vector3 normalized = Vector3.Cross(vector - positionOS, vector2 - positionOS).normalized;
+ return water.TransformDirection(normalized);
+ }
+
+ private float SineWave(Vector3 positionOS, float offset)
+ {
+ float num = Time.timeSinceLevelLoad * 2f;
+ float num2 = Mathf.Sin(offset + num * _speed + (positionOS.x * Mathf.Sin(offset + _direction) + positionOS.z * Mathf.Cos(offset + _direction)) * _frequency);
+ if (_material.IsKeywordEnabled("_WAVEMODE_POINTY"))
+ {
+ num2 = 1f - Mathf.Abs(num2);
+ }
+ return num2 * _amplitude;
+ }
+
+ private float GetHeightOS(Vector3 positionOS)
+ {
+ float num = SineWave(positionOS, 0f);
+ if (_material.IsKeywordEnabled("_WAVEMODE_GRID"))
+ {
+ num *= SineWave(positionOS, 1.57f);
+ }
+ return num * amplitude;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/FlatKit/FlatKitFog.cs b/Thronefall_v1.57/Thronefall/FlatKit/FlatKitFog.cs
new file mode 100644
index 0000000..6991bf9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/FlatKit/FlatKitFog.cs
@@ -0,0 +1,175 @@
+using UnityEngine;
+using UnityEngine.Rendering;
+using UnityEngine.Rendering.Universal;
+
+namespace FlatKit;
+
+public class FlatKitFog : ScriptableRendererFeature
+{
+ [Tooltip("To create new settings use 'Create > FlatKit > Fog Settings'.")]
+ public FogSettings settings;
+
+ [SerializeField]
+ [HideInInspector]
+ private Material _effectMaterial;
+
+ private BlitTexturePass _blitTexturePass;
+
+ private RenderTargetHandle _fogTexture;
+
+ private Texture2D _lutDepth;
+
+ private Texture2D _lutHeight;
+
+ private static readonly string FogShaderName = "Hidden/FlatKit/FogFilter";
+
+ private static readonly int DistanceLut = Shader.PropertyToID("_DistanceLUT");
+
+ private static readonly int Near = Shader.PropertyToID("_Near");
+
+ private static readonly int Far = Shader.PropertyToID("_Far");
+
+ private static readonly int UseDistanceFog = Shader.PropertyToID("_UseDistanceFog");
+
+ private static readonly int UseDistanceFogOnSky = Shader.PropertyToID("_UseDistanceFogOnSky");
+
+ private static readonly int DistanceFogIntensity = Shader.PropertyToID("_DistanceFogIntensity");
+
+ private static readonly int HeightLut = Shader.PropertyToID("_HeightLUT");
+
+ private static readonly int LowWorldY = Shader.PropertyToID("_LowWorldY");
+
+ private static readonly int HighWorldY = Shader.PropertyToID("_HighWorldY");
+
+ private static readonly int UseHeightFog = Shader.PropertyToID("_UseHeightFog");
+
+ private static readonly int UseHeightFogOnSky = Shader.PropertyToID("_UseHeightFogOnSky");
+
+ private static readonly int HeightFogIntensity = Shader.PropertyToID("_HeightFogIntensity");
+
+ private static readonly int DistanceHeightBlend = Shader.PropertyToID("_DistanceHeightBlend");
+
+ public override void Create()
+ {
+ if (settings == null)
+ {
+ Debug.LogWarning("[FlatKit] Missing Fog Settings");
+ return;
+ }
+ _blitTexturePass = new BlitTexturePass
+ {
+ renderPassEvent = settings.renderEvent
+ };
+ _fogTexture.Init("_EffectTexture");
+ }
+
+ public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
+ {
+ if (settings == null)
+ {
+ Debug.LogWarning("[FlatKit] Missing Fog Settings");
+ }
+ else if (CreateMaterials())
+ {
+ SetMaterialProperties();
+ _blitTexturePass.Setup(_effectMaterial, useDepth: true, useNormals: false, useColor: false);
+ renderer.EnqueuePass(_blitTexturePass);
+ }
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ CoreUtils.Destroy(_effectMaterial);
+ }
+
+ private bool CreateMaterials()
+ {
+ if (_effectMaterial == null)
+ {
+ Shader shader = Shader.Find(FogShaderName);
+ Shader shader2 = Shader.Find(BlitTexturePass.CopyEffectShaderName);
+ if (shader == null || shader2 == null)
+ {
+ return false;
+ }
+ _effectMaterial = CoreUtils.CreateEngineMaterial(shader);
+ }
+ return true;
+ }
+
+ private void SetMaterialProperties()
+ {
+ if (!(_effectMaterial == null))
+ {
+ UpdateDistanceLut();
+ _effectMaterial.SetTexture(DistanceLut, _lutDepth);
+ _effectMaterial.SetFloat(Near, settings.near);
+ _effectMaterial.SetFloat(Far, settings.far);
+ _effectMaterial.SetFloat(UseDistanceFog, settings.useDistance ? 1f : 0f);
+ _effectMaterial.SetFloat(UseDistanceFogOnSky, settings.useDistanceFogOnSky ? 1f : 0f);
+ _effectMaterial.SetFloat(DistanceFogIntensity, settings.distanceFogIntensity);
+ UpdateHeightLut();
+ _effectMaterial.SetTexture(HeightLut, _lutHeight);
+ _effectMaterial.SetFloat(LowWorldY, settings.low);
+ _effectMaterial.SetFloat(HighWorldY, settings.high);
+ _effectMaterial.SetFloat(UseHeightFog, settings.useHeight ? 1f : 0f);
+ _effectMaterial.SetFloat(UseHeightFogOnSky, settings.useHeightFogOnSky ? 1f : 0f);
+ _effectMaterial.SetFloat(HeightFogIntensity, settings.heightFogIntensity);
+ _effectMaterial.SetFloat(DistanceHeightBlend, settings.distanceHeightBlend);
+ }
+ }
+
+ private void UpdateDistanceLut()
+ {
+ if (settings.distanceGradient == null)
+ {
+ return;
+ }
+ if (_lutDepth != null)
+ {
+ Object.DestroyImmediate(_lutDepth);
+ }
+ _lutDepth = new Texture2D(256, 1, TextureFormat.RGBA32, mipChain: false)
+ {
+ wrapMode = TextureWrapMode.Clamp,
+ hideFlags = HideFlags.HideAndDontSave,
+ filterMode = FilterMode.Bilinear
+ };
+ for (float num = 0f; num < 256f; num += 1f)
+ {
+ Color color = settings.distanceGradient.Evaluate(num / 255f);
+ for (float num2 = 0f; num2 < 1f; num2 += 1f)
+ {
+ _lutDepth.SetPixel(Mathf.CeilToInt(num), Mathf.CeilToInt(num2), color);
+ }
+ }
+ _lutDepth.Apply();
+ }
+
+ private void UpdateHeightLut()
+ {
+ if (settings.heightGradient == null)
+ {
+ return;
+ }
+ if (_lutHeight != null)
+ {
+ Object.DestroyImmediate(_lutHeight);
+ }
+ _lutHeight = new Texture2D(256, 1, TextureFormat.RGBA32, mipChain: false)
+ {
+ wrapMode = TextureWrapMode.Clamp,
+ hideFlags = HideFlags.HideAndDontSave,
+ filterMode = FilterMode.Bilinear
+ };
+ for (float num = 0f; num < 256f; num += 1f)
+ {
+ Color color = settings.heightGradient.Evaluate(num / 255f);
+ for (float num2 = 0f; num2 < 1f; num2 += 1f)
+ {
+ _lutHeight.SetPixel(Mathf.CeilToInt(num), Mathf.CeilToInt(num2), color);
+ }
+ }
+ _lutHeight.Apply();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/FlatKit/FlatKitOutline.cs b/Thronefall_v1.57/Thronefall/FlatKit/FlatKitOutline.cs
new file mode 100644
index 0000000..aefc75d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/FlatKit/FlatKitOutline.cs
@@ -0,0 +1,139 @@
+using UnityEngine;
+using UnityEngine.Rendering;
+using UnityEngine.Rendering.Universal;
+
+namespace FlatKit;
+
+public class FlatKitOutline : ScriptableRendererFeature
+{
+ [Tooltip("To create new settings use 'Create > FlatKit > Outline Settings'.")]
+ public OutlineSettings settings;
+
+ [SerializeField]
+ [HideInInspector]
+ private Material _effectMaterial;
+
+ private BlitTexturePass _blitTexturePass;
+
+ private static readonly string OutlineShaderName = "Hidden/FlatKit/OutlineFilter";
+
+ private static readonly int EdgeColor = Shader.PropertyToID("_EdgeColor");
+
+ private static readonly int Thickness = Shader.PropertyToID("_Thickness");
+
+ private static readonly int DepthThresholdMin = Shader.PropertyToID("_DepthThresholdMin");
+
+ private static readonly int DepthThresholdMax = Shader.PropertyToID("_DepthThresholdMax");
+
+ private static readonly int NormalThresholdMin = Shader.PropertyToID("_NormalThresholdMin");
+
+ private static readonly int NormalThresholdMax = Shader.PropertyToID("_NormalThresholdMax");
+
+ private static readonly int ColorThresholdMin = Shader.PropertyToID("_ColorThresholdMin");
+
+ private static readonly int ColorThresholdMax = Shader.PropertyToID("_ColorThresholdMax");
+
+ public override void Create()
+ {
+ if (settings == null)
+ {
+ Debug.LogWarning("[FlatKit] Missing Outline Settings");
+ }
+ else if (_blitTexturePass == null)
+ {
+ _blitTexturePass = new BlitTexturePass
+ {
+ renderPassEvent = settings.renderEvent
+ };
+ }
+ }
+
+ public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
+ {
+ if (settings == null)
+ {
+ Debug.LogWarning("[FlatKit] Missing Outline Settings");
+ }
+ else if (CreateMaterials())
+ {
+ SetMaterialProperties();
+ _blitTexturePass.Setup(_effectMaterial, settings.useDepth, settings.useNormals, useColor: true);
+ renderer.EnqueuePass(_blitTexturePass);
+ }
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ CoreUtils.Destroy(_effectMaterial);
+ }
+
+ private bool CreateMaterials()
+ {
+ if (_effectMaterial == null)
+ {
+ Shader shader = Shader.Find(OutlineShaderName);
+ Shader shader2 = Shader.Find(BlitTexturePass.CopyEffectShaderName);
+ if (shader == null || shader2 == null)
+ {
+ return false;
+ }
+ _effectMaterial = CoreUtils.CreateEngineMaterial(shader);
+ }
+ return true;
+ }
+
+ private void SetMaterialProperties()
+ {
+ if (!(_effectMaterial == null))
+ {
+ if (settings.useDepth)
+ {
+ _effectMaterial.EnableKeyword("OUTLINE_USE_DEPTH");
+ }
+ else
+ {
+ _effectMaterial.DisableKeyword("OUTLINE_USE_DEPTH");
+ }
+ if (settings.useNormals)
+ {
+ _effectMaterial.EnableKeyword("OUTLINE_USE_NORMALS");
+ }
+ else
+ {
+ _effectMaterial.DisableKeyword("OUTLINE_USE_NORMALS");
+ }
+ if (settings.useColor)
+ {
+ _effectMaterial.EnableKeyword("OUTLINE_USE_COLOR");
+ }
+ else
+ {
+ _effectMaterial.DisableKeyword("OUTLINE_USE_COLOR");
+ }
+ if (settings.outlineOnly)
+ {
+ _effectMaterial.EnableKeyword("OUTLINE_ONLY");
+ }
+ else
+ {
+ _effectMaterial.DisableKeyword("OUTLINE_ONLY");
+ }
+ if (settings.resolutionInvariant)
+ {
+ _effectMaterial.EnableKeyword("RESOLUTION_INVARIANT_THICKNESS");
+ }
+ else
+ {
+ _effectMaterial.DisableKeyword("RESOLUTION_INVARIANT_THICKNESS");
+ }
+ _effectMaterial.SetColor(EdgeColor, settings.edgeColor);
+ _effectMaterial.SetFloat(Thickness, settings.thickness);
+ _effectMaterial.SetFloat(DepthThresholdMin, settings.minDepthThreshold);
+ _effectMaterial.SetFloat(DepthThresholdMax, settings.maxDepthThreshold);
+ _effectMaterial.SetFloat(NormalThresholdMin, settings.minNormalsThreshold);
+ _effectMaterial.SetFloat(NormalThresholdMax, settings.maxNormalsThreshold);
+ _effectMaterial.SetFloat(ColorThresholdMin, settings.minColorThreshold);
+ _effectMaterial.SetFloat(ColorThresholdMax, settings.maxColorThreshold);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/FlatKit/FogSettings.cs b/Thronefall_v1.57/Thronefall/FlatKit/FogSettings.cs
new file mode 100644
index 0000000..60e5eb0
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/FlatKit/FogSettings.cs
@@ -0,0 +1,59 @@
+using UnityEngine;
+using UnityEngine.Rendering.Universal;
+
+namespace FlatKit;
+
+[CreateAssetMenu(fileName = "FogSettings", menuName = "FlatKit/Fog Settings")]
+public class FogSettings : ScriptableObject
+{
+ [Header("Distance Fog")]
+ public bool useDistance = true;
+
+ public Gradient distanceGradient;
+
+ public float near;
+
+ public float far = 100f;
+
+ [Range(0f, 1f)]
+ public float distanceFogIntensity = 1f;
+
+ public bool useDistanceFogOnSky;
+
+ [Header("Height Fog")]
+ [Space]
+ public bool useHeight;
+
+ public Gradient heightGradient;
+
+ public float low;
+
+ public float high = 10f;
+
+ [Range(0f, 1f)]
+ public float heightFogIntensity = 1f;
+
+ public bool useHeightFogOnSky;
+
+ [Header("Blending")]
+ [Space]
+ [Range(0f, 1f)]
+ public float distanceHeightBlend = 0.5f;
+
+ [Header("Advanced settings")]
+ [Space]
+ [Tooltip("The render stage at which the effect is applied. To exclude transparent objects, like water or UI elements, set this to \"Before Transparent\".")]
+ public RenderPassEvent renderEvent = RenderPassEvent.BeforeRenderingPostProcessing;
+
+ private void OnValidate()
+ {
+ if (low > high)
+ {
+ Debug.LogWarning("[FlatKit] Fog Height configuration error: 'Low' must not be greater than 'High'");
+ }
+ if (near > far)
+ {
+ Debug.LogWarning("[FlatKit] Fog Distance configuration error: 'Near' must not be greater than 'Far'");
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/FlatKit/OutlineSettings.cs b/Thronefall_v1.57/Thronefall/FlatKit/OutlineSettings.cs
new file mode 100644
index 0000000..47a6b97
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/FlatKit/OutlineSettings.cs
@@ -0,0 +1,61 @@
+using UnityEngine;
+using UnityEngine.Rendering.Universal;
+
+namespace FlatKit;
+
+[CreateAssetMenu(fileName = "OutlineSettings", menuName = "FlatKit/Outline Settings")]
+public class OutlineSettings : ScriptableObject
+{
+ public Color edgeColor = Color.white;
+
+ [Range(0f, 5f)]
+ public int thickness = 1;
+
+ [Tooltip("If enabled, the line width will stay constant regardless of the rendering resolution. However, some of the lines may appear blurry.")]
+ public bool resolutionInvariant;
+
+ [Space]
+ public bool useDepth = true;
+
+ public bool useNormals;
+
+ public bool useColor;
+
+ [Header("Advanced settings")]
+ public float minDepthThreshold;
+
+ public float maxDepthThreshold = 0.25f;
+
+ [Space]
+ public float minNormalsThreshold;
+
+ public float maxNormalsThreshold = 0.25f;
+
+ [Space]
+ public float minColorThreshold;
+
+ public float maxColorThreshold = 0.25f;
+
+ [Space]
+ [Tooltip("The render stage at which the effect is applied. To exclude transparent objects, like water or UI elements, set this to \"Before Transparent\".")]
+ public RenderPassEvent renderEvent = RenderPassEvent.BeforeRenderingPostProcessing;
+
+ [Space]
+ public bool outlineOnly;
+
+ private void OnValidate()
+ {
+ if (minDepthThreshold > maxDepthThreshold)
+ {
+ Debug.LogWarning("[FlatKit] Outline configuration error: 'Min Depth Threshold' must not be greater than 'Max Depth Threshold'");
+ }
+ if (minNormalsThreshold > maxNormalsThreshold)
+ {
+ Debug.LogWarning("[FlatKit] Outline configuration error: 'Min Normals Threshold' must not be greater than 'Max Normals Threshold'");
+ }
+ if (minColorThreshold > maxColorThreshold)
+ {
+ Debug.LogWarning("[FlatKit] Outline configuration error: 'Min Color Threshold' must not be greater than 'Max Color Threshold'");
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/FlatKit/UvScroller.cs b/Thronefall_v1.57/Thronefall/FlatKit/UvScroller.cs
new file mode 100644
index 0000000..e3ab4a3
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/FlatKit/UvScroller.cs
@@ -0,0 +1,34 @@
+using UnityEngine;
+
+namespace FlatKit;
+
+public class UvScroller : MonoBehaviour
+{
+ public Material targetMaterial;
+
+ public float speedX;
+
+ public float speedY;
+
+ private Vector2 offset;
+
+ private Vector2 initOffset;
+
+ private void Start()
+ {
+ offset = targetMaterial.mainTextureOffset;
+ initOffset = targetMaterial.mainTextureOffset;
+ }
+
+ private void OnDisable()
+ {
+ targetMaterial.mainTextureOffset = initOffset;
+ }
+
+ private void Update()
+ {
+ offset.x += speedX * Time.deltaTime;
+ offset.y += speedY * Time.deltaTime;
+ targetMaterial.mainTextureOffset = offset;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSON.cs b/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSON.cs
new file mode 100644
index 0000000..de135ed
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSON.cs
@@ -0,0 +1,9 @@
+namespace I2.Loc.SimpleJSON;
+
+public static class JSON
+{
+ public static JSONNode Parse(string aJSON)
+ {
+ return JSONNode.Parse(aJSON);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONArray.cs b/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONArray.cs
new file mode 100644
index 0000000..e2cbcef
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONArray.cs
@@ -0,0 +1,127 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+
+namespace I2.Loc.SimpleJSON;
+
+public class JSONArray : JSONNode, IEnumerable
+{
+ private List<JSONNode> m_List = new List<JSONNode>();
+
+ public override JSONNode this[int aIndex]
+ {
+ get
+ {
+ if (aIndex < 0 || aIndex >= m_List.Count)
+ {
+ return new JSONLazyCreator(this);
+ }
+ return m_List[aIndex];
+ }
+ set
+ {
+ if (aIndex < 0 || aIndex >= m_List.Count)
+ {
+ m_List.Add(value);
+ }
+ else
+ {
+ m_List[aIndex] = value;
+ }
+ }
+ }
+
+ public override JSONNode this[string aKey]
+ {
+ get
+ {
+ return new JSONLazyCreator(this);
+ }
+ set
+ {
+ m_List.Add(value);
+ }
+ }
+
+ public override int Count => m_List.Count;
+
+ public override IEnumerable<JSONNode> Childs
+ {
+ get
+ {
+ foreach (JSONNode item in m_List)
+ {
+ yield return item;
+ }
+ }
+ }
+
+ public override void Add(string aKey, JSONNode aItem)
+ {
+ m_List.Add(aItem);
+ }
+
+ public override JSONNode Remove(int aIndex)
+ {
+ if (aIndex < 0 || aIndex >= m_List.Count)
+ {
+ return null;
+ }
+ JSONNode result = m_List[aIndex];
+ m_List.RemoveAt(aIndex);
+ return result;
+ }
+
+ public override JSONNode Remove(JSONNode aNode)
+ {
+ m_List.Remove(aNode);
+ return aNode;
+ }
+
+ public IEnumerator GetEnumerator()
+ {
+ foreach (JSONNode item in m_List)
+ {
+ yield return item;
+ }
+ }
+
+ public override string ToString()
+ {
+ string text = "[ ";
+ foreach (JSONNode item in m_List)
+ {
+ if (text.Length > 2)
+ {
+ text += ", ";
+ }
+ text += item.ToString();
+ }
+ return text + " ]";
+ }
+
+ public override string ToString(string aPrefix)
+ {
+ string text = "[ ";
+ foreach (JSONNode item in m_List)
+ {
+ if (text.Length > 3)
+ {
+ text += ", ";
+ }
+ text = text + "\n" + aPrefix + " ";
+ text += item.ToString(aPrefix + " ");
+ }
+ return text + "\n" + aPrefix + "]";
+ }
+
+ public override void Serialize(BinaryWriter aWriter)
+ {
+ aWriter.Write((byte)1);
+ aWriter.Write(m_List.Count);
+ for (int i = 0; i < m_List.Count; i++)
+ {
+ m_List[i].Serialize(aWriter);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONBinaryTag.cs b/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONBinaryTag.cs
new file mode 100644
index 0000000..53df430
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONBinaryTag.cs
@@ -0,0 +1,12 @@
+namespace I2.Loc.SimpleJSON;
+
+public enum JSONBinaryTag
+{
+ Array = 1,
+ Class,
+ Value,
+ IntValue,
+ DoubleValue,
+ BoolValue,
+ FloatValue
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONClass.cs b/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONClass.cs
new file mode 100644
index 0000000..da9c432
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONClass.cs
@@ -0,0 +1,171 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+
+namespace I2.Loc.SimpleJSON;
+
+public class JSONClass : JSONNode, IEnumerable
+{
+ private Dictionary<string, JSONNode> m_Dict = new Dictionary<string, JSONNode>(StringComparer.Ordinal);
+
+ public override JSONNode this[string aKey]
+ {
+ get
+ {
+ if (m_Dict.ContainsKey(aKey))
+ {
+ return m_Dict[aKey];
+ }
+ return new JSONLazyCreator(this, aKey);
+ }
+ set
+ {
+ if (m_Dict.ContainsKey(aKey))
+ {
+ m_Dict[aKey] = value;
+ }
+ else
+ {
+ m_Dict.Add(aKey, value);
+ }
+ }
+ }
+
+ public override JSONNode this[int aIndex]
+ {
+ get
+ {
+ if (aIndex < 0 || aIndex >= m_Dict.Count)
+ {
+ return null;
+ }
+ return m_Dict.ElementAt(aIndex).Value;
+ }
+ set
+ {
+ if (aIndex >= 0 && aIndex < m_Dict.Count)
+ {
+ string key = m_Dict.ElementAt(aIndex).Key;
+ m_Dict[key] = value;
+ }
+ }
+ }
+
+ public override int Count => m_Dict.Count;
+
+ public override IEnumerable<JSONNode> Childs
+ {
+ get
+ {
+ foreach (KeyValuePair<string, JSONNode> item in m_Dict)
+ {
+ yield return item.Value;
+ }
+ }
+ }
+
+ public override void Add(string aKey, JSONNode aItem)
+ {
+ if (!string.IsNullOrEmpty(aKey))
+ {
+ if (m_Dict.ContainsKey(aKey))
+ {
+ m_Dict[aKey] = aItem;
+ }
+ else
+ {
+ m_Dict.Add(aKey, aItem);
+ }
+ }
+ else
+ {
+ m_Dict.Add(Guid.NewGuid().ToString(), aItem);
+ }
+ }
+
+ public override JSONNode Remove(string aKey)
+ {
+ if (!m_Dict.ContainsKey(aKey))
+ {
+ return null;
+ }
+ JSONNode result = m_Dict[aKey];
+ m_Dict.Remove(aKey);
+ return result;
+ }
+
+ public override JSONNode Remove(int aIndex)
+ {
+ if (aIndex < 0 || aIndex >= m_Dict.Count)
+ {
+ return null;
+ }
+ KeyValuePair<string, JSONNode> keyValuePair = m_Dict.ElementAt(aIndex);
+ m_Dict.Remove(keyValuePair.Key);
+ return keyValuePair.Value;
+ }
+
+ public override JSONNode Remove(JSONNode aNode)
+ {
+ try
+ {
+ KeyValuePair<string, JSONNode> keyValuePair = m_Dict.Where((KeyValuePair<string, JSONNode> k) => k.Value == aNode).First();
+ m_Dict.Remove(keyValuePair.Key);
+ return aNode;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ public IEnumerator GetEnumerator()
+ {
+ foreach (KeyValuePair<string, JSONNode> item in m_Dict)
+ {
+ yield return item;
+ }
+ }
+
+ public override string ToString()
+ {
+ string text = "{";
+ foreach (KeyValuePair<string, JSONNode> item in m_Dict)
+ {
+ if (text.Length > 2)
+ {
+ text += ", ";
+ }
+ text = text + "\"" + JSONNode.Escape(item.Key) + "\":" + item.Value;
+ }
+ return text + "}";
+ }
+
+ public override string ToString(string aPrefix)
+ {
+ string text = "{ ";
+ foreach (KeyValuePair<string, JSONNode> item in m_Dict)
+ {
+ if (text.Length > 3)
+ {
+ text += ", ";
+ }
+ text = text + "\n" + aPrefix + " ";
+ text = text + "\"" + JSONNode.Escape(item.Key) + "\" : " + item.Value.ToString(aPrefix + " ");
+ }
+ return text + "\n" + aPrefix + "}";
+ }
+
+ public override void Serialize(BinaryWriter aWriter)
+ {
+ aWriter.Write((byte)2);
+ aWriter.Write(m_Dict.Count);
+ foreach (string key in m_Dict.Keys)
+ {
+ aWriter.Write(key);
+ m_Dict[key].Serialize(aWriter);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONData.cs b/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONData.cs
new file mode 100644
index 0000000..a4c7160
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONData.cs
@@ -0,0 +1,92 @@
+using System.IO;
+
+namespace I2.Loc.SimpleJSON;
+
+public class JSONData : JSONNode
+{
+ private string m_Data;
+
+ public override string Value
+ {
+ get
+ {
+ return m_Data;
+ }
+ set
+ {
+ m_Data = value;
+ }
+ }
+
+ public JSONData(string aData)
+ {
+ m_Data = aData;
+ }
+
+ public JSONData(float aData)
+ {
+ AsFloat = aData;
+ }
+
+ public JSONData(double aData)
+ {
+ AsDouble = aData;
+ }
+
+ public JSONData(bool aData)
+ {
+ AsBool = aData;
+ }
+
+ public JSONData(int aData)
+ {
+ AsInt = aData;
+ }
+
+ public override string ToString()
+ {
+ return "\"" + JSONNode.Escape(m_Data) + "\"";
+ }
+
+ public override string ToString(string aPrefix)
+ {
+ return "\"" + JSONNode.Escape(m_Data) + "\"";
+ }
+
+ public override void Serialize(BinaryWriter aWriter)
+ {
+ JSONData jSONData = new JSONData("");
+ jSONData.AsInt = AsInt;
+ if (jSONData.m_Data == m_Data)
+ {
+ aWriter.Write((byte)4);
+ aWriter.Write(AsInt);
+ return;
+ }
+ jSONData.AsFloat = AsFloat;
+ if (jSONData.m_Data == m_Data)
+ {
+ aWriter.Write((byte)7);
+ aWriter.Write(AsFloat);
+ return;
+ }
+ jSONData.AsDouble = AsDouble;
+ if (jSONData.m_Data == m_Data)
+ {
+ aWriter.Write((byte)5);
+ aWriter.Write(AsDouble);
+ return;
+ }
+ jSONData.AsBool = AsBool;
+ if (jSONData.m_Data == m_Data)
+ {
+ aWriter.Write((byte)6);
+ aWriter.Write(AsBool);
+ }
+ else
+ {
+ aWriter.Write((byte)3);
+ aWriter.Write(m_Data);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONLazyCreator.cs b/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONLazyCreator.cs
new file mode 100644
index 0000000..28e23df
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONLazyCreator.cs
@@ -0,0 +1,193 @@
+namespace I2.Loc.SimpleJSON;
+
+internal class JSONLazyCreator : JSONNode
+{
+ private JSONNode m_Node;
+
+ private string m_Key;
+
+ public override JSONNode this[int aIndex]
+ {
+ get
+ {
+ return new JSONLazyCreator(this);
+ }
+ set
+ {
+ JSONArray jSONArray = new JSONArray();
+ jSONArray.Add(value);
+ Set(jSONArray);
+ }
+ }
+
+ public override JSONNode this[string aKey]
+ {
+ get
+ {
+ return new JSONLazyCreator(this, aKey);
+ }
+ set
+ {
+ JSONClass jSONClass = new JSONClass();
+ jSONClass.Add(aKey, value);
+ Set(jSONClass);
+ }
+ }
+
+ public override int AsInt
+ {
+ get
+ {
+ JSONData aVal = new JSONData(0);
+ Set(aVal);
+ return 0;
+ }
+ set
+ {
+ JSONData aVal = new JSONData(value);
+ Set(aVal);
+ }
+ }
+
+ public override float AsFloat
+ {
+ get
+ {
+ JSONData aVal = new JSONData(0f);
+ Set(aVal);
+ return 0f;
+ }
+ set
+ {
+ JSONData aVal = new JSONData(value);
+ Set(aVal);
+ }
+ }
+
+ public override double AsDouble
+ {
+ get
+ {
+ JSONData aVal = new JSONData(0.0);
+ Set(aVal);
+ return 0.0;
+ }
+ set
+ {
+ JSONData aVal = new JSONData(value);
+ Set(aVal);
+ }
+ }
+
+ public override bool AsBool
+ {
+ get
+ {
+ JSONData aVal = new JSONData(aData: false);
+ Set(aVal);
+ return false;
+ }
+ set
+ {
+ JSONData aVal = new JSONData(value);
+ Set(aVal);
+ }
+ }
+
+ public override JSONArray AsArray
+ {
+ get
+ {
+ JSONArray jSONArray = new JSONArray();
+ Set(jSONArray);
+ return jSONArray;
+ }
+ }
+
+ public override JSONClass AsObject
+ {
+ get
+ {
+ JSONClass jSONClass = new JSONClass();
+ Set(jSONClass);
+ return jSONClass;
+ }
+ }
+
+ public JSONLazyCreator(JSONNode aNode)
+ {
+ m_Node = aNode;
+ m_Key = null;
+ }
+
+ public JSONLazyCreator(JSONNode aNode, string aKey)
+ {
+ m_Node = aNode;
+ m_Key = aKey;
+ }
+
+ private void Set(JSONNode aVal)
+ {
+ if (m_Key == null)
+ {
+ m_Node.Add(aVal);
+ }
+ else
+ {
+ m_Node.Add(m_Key, aVal);
+ }
+ m_Node = null;
+ }
+
+ public override void Add(JSONNode aItem)
+ {
+ JSONArray jSONArray = new JSONArray();
+ jSONArray.Add(aItem);
+ Set(jSONArray);
+ }
+
+ public override void Add(string aKey, JSONNode aItem)
+ {
+ JSONClass jSONClass = new JSONClass();
+ jSONClass.Add(aKey, aItem);
+ Set(jSONClass);
+ }
+
+ public static bool operator ==(JSONLazyCreator a, object b)
+ {
+ if (b == null)
+ {
+ return true;
+ }
+ return (object)a == b;
+ }
+
+ public static bool operator !=(JSONLazyCreator a, object b)
+ {
+ return !(a == b);
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (obj == null)
+ {
+ return true;
+ }
+ return (object)this == obj;
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ public override string ToString()
+ {
+ return "";
+ }
+
+ public override string ToString(string aPrefix)
+ {
+ return "";
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONNode.cs b/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONNode.cs
new file mode 100644
index 0000000..a655045
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc.SimpleJSON/JSONNode.cs
@@ -0,0 +1,526 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+
+namespace I2.Loc.SimpleJSON;
+
+public class JSONNode
+{
+ public virtual JSONNode this[int aIndex]
+ {
+ get
+ {
+ return null;
+ }
+ set
+ {
+ }
+ }
+
+ public virtual JSONNode this[string aKey]
+ {
+ get
+ {
+ return null;
+ }
+ set
+ {
+ }
+ }
+
+ public virtual string Value
+ {
+ get
+ {
+ return "";
+ }
+ set
+ {
+ }
+ }
+
+ public virtual int Count => 0;
+
+ public virtual IEnumerable<JSONNode> Childs
+ {
+ get
+ {
+ yield break;
+ }
+ }
+
+ public IEnumerable<JSONNode> DeepChilds
+ {
+ get
+ {
+ foreach (JSONNode child in Childs)
+ {
+ foreach (JSONNode deepChild in child.DeepChilds)
+ {
+ yield return deepChild;
+ }
+ }
+ }
+ }
+
+ public virtual int AsInt
+ {
+ get
+ {
+ int result = 0;
+ if (int.TryParse(Value, out result))
+ {
+ return result;
+ }
+ return 0;
+ }
+ set
+ {
+ Value = value.ToString();
+ }
+ }
+
+ public virtual float AsFloat
+ {
+ get
+ {
+ float result = 0f;
+ if (float.TryParse(Value, out result))
+ {
+ return result;
+ }
+ return 0f;
+ }
+ set
+ {
+ Value = value.ToString();
+ }
+ }
+
+ public virtual double AsDouble
+ {
+ get
+ {
+ double result = 0.0;
+ if (double.TryParse(Value, out result))
+ {
+ return result;
+ }
+ return 0.0;
+ }
+ set
+ {
+ Value = value.ToString();
+ }
+ }
+
+ public virtual bool AsBool
+ {
+ get
+ {
+ bool result = false;
+ if (bool.TryParse(Value, out result))
+ {
+ return result;
+ }
+ return !string.IsNullOrEmpty(Value);
+ }
+ set
+ {
+ Value = (value ? "true" : "false");
+ }
+ }
+
+ public virtual JSONArray AsArray => this as JSONArray;
+
+ public virtual JSONClass AsObject => this as JSONClass;
+
+ public virtual void Add(string aKey, JSONNode aItem)
+ {
+ }
+
+ public virtual void Add(JSONNode aItem)
+ {
+ Add("", aItem);
+ }
+
+ public virtual JSONNode Remove(string aKey)
+ {
+ return null;
+ }
+
+ public virtual JSONNode Remove(int aIndex)
+ {
+ return null;
+ }
+
+ public virtual JSONNode Remove(JSONNode aNode)
+ {
+ return aNode;
+ }
+
+ public override string ToString()
+ {
+ return "JSONNode";
+ }
+
+ public virtual string ToString(string aPrefix)
+ {
+ return "JSONNode";
+ }
+
+ public static implicit operator JSONNode(string s)
+ {
+ return new JSONData(s);
+ }
+
+ public static implicit operator string(JSONNode d)
+ {
+ if (!(d == null))
+ {
+ return d.Value;
+ }
+ return null;
+ }
+
+ public static bool operator ==(JSONNode a, object b)
+ {
+ if (b == null && a is JSONLazyCreator)
+ {
+ return true;
+ }
+ return (object)a == b;
+ }
+
+ public static bool operator !=(JSONNode a, object b)
+ {
+ return !(a == b);
+ }
+
+ public override bool Equals(object obj)
+ {
+ return (object)this == obj;
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ internal static string Escape(string aText)
+ {
+ string text = "";
+ for (int i = 0; i < aText.Length; i++)
+ {
+ char c = aText[i];
+ text = c switch
+ {
+ '\\' => text + "\\\\",
+ '"' => text + "\\\"",
+ '\n' => text + "\\n",
+ '\r' => text + "\\r",
+ '\t' => text + "\\t",
+ '\b' => text + "\\b",
+ '\f' => text + "\\f",
+ _ => text + c,
+ };
+ }
+ return text;
+ }
+
+ public static JSONNode Parse(string aJSON)
+ {
+ Stack<JSONNode> stack = new Stack<JSONNode>();
+ JSONNode jSONNode = null;
+ int i = 0;
+ string text = "";
+ string text2 = "";
+ bool flag = false;
+ for (; i < aJSON.Length; i++)
+ {
+ switch (aJSON[i])
+ {
+ case '{':
+ if (flag)
+ {
+ text += aJSON[i];
+ break;
+ }
+ stack.Push(new JSONClass());
+ if (jSONNode != null)
+ {
+ text2 = text2.Trim();
+ if (jSONNode is JSONArray)
+ {
+ jSONNode.Add(stack.Peek());
+ }
+ else if (text2 != "")
+ {
+ jSONNode.Add(text2, stack.Peek());
+ }
+ }
+ text2 = "";
+ text = "";
+ jSONNode = stack.Peek();
+ break;
+ case '[':
+ if (flag)
+ {
+ text += aJSON[i];
+ break;
+ }
+ stack.Push(new JSONArray());
+ if (jSONNode != null)
+ {
+ text2 = text2.Trim();
+ if (jSONNode is JSONArray)
+ {
+ jSONNode.Add(stack.Peek());
+ }
+ else if (text2 != "")
+ {
+ jSONNode.Add(text2, stack.Peek());
+ }
+ }
+ text2 = "";
+ text = "";
+ jSONNode = stack.Peek();
+ break;
+ case ']':
+ case '}':
+ if (flag)
+ {
+ text += aJSON[i];
+ break;
+ }
+ if (stack.Count == 0)
+ {
+ throw new Exception("JSON Parse: Too many closing brackets");
+ }
+ stack.Pop();
+ if (text != "")
+ {
+ text2 = text2.Trim();
+ if (jSONNode is JSONArray)
+ {
+ jSONNode.Add(text);
+ }
+ else if (text2 != "")
+ {
+ jSONNode.Add(text2, text);
+ }
+ }
+ text2 = "";
+ text = "";
+ if (stack.Count > 0)
+ {
+ jSONNode = stack.Peek();
+ }
+ break;
+ case ':':
+ if (flag)
+ {
+ text += aJSON[i];
+ break;
+ }
+ text2 = text;
+ text = "";
+ break;
+ case '"':
+ flag = !flag;
+ break;
+ case ',':
+ if (flag)
+ {
+ text += aJSON[i];
+ break;
+ }
+ if (text != "")
+ {
+ if (jSONNode is JSONArray)
+ {
+ jSONNode.Add(text);
+ }
+ else if (text2 != "")
+ {
+ jSONNode.Add(text2, text);
+ }
+ }
+ text2 = "";
+ text = "";
+ break;
+ case '\t':
+ case ' ':
+ if (flag)
+ {
+ text += aJSON[i];
+ }
+ break;
+ case '\\':
+ i++;
+ if (flag)
+ {
+ char c = aJSON[i];
+ switch (c)
+ {
+ case 't':
+ text += "\t";
+ break;
+ case 'r':
+ text += "\r";
+ break;
+ case 'n':
+ text += "\n";
+ break;
+ case 'b':
+ text += "\b";
+ break;
+ case 'f':
+ text += "\f";
+ break;
+ case 'u':
+ {
+ string s = aJSON.Substring(i + 1, 4);
+ text += (char)int.Parse(s, NumberStyles.AllowHexSpecifier);
+ i += 4;
+ break;
+ }
+ default:
+ text += c;
+ break;
+ }
+ }
+ break;
+ default:
+ text += aJSON[i];
+ break;
+ case '\n':
+ case '\r':
+ break;
+ }
+ }
+ if (flag)
+ {
+ throw new Exception("JSON Parse: Quotation marks seems to be messed up.");
+ }
+ return jSONNode;
+ }
+
+ public virtual void Serialize(BinaryWriter aWriter)
+ {
+ }
+
+ public void SaveToStream(Stream aData)
+ {
+ BinaryWriter aWriter = new BinaryWriter(aData);
+ Serialize(aWriter);
+ }
+
+ public void SaveToCompressedStream(Stream aData)
+ {
+ throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
+ }
+
+ public void SaveToCompressedFile(string aFileName)
+ {
+ throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
+ }
+
+ public string SaveToCompressedBase64()
+ {
+ throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
+ }
+
+ public void SaveToFile(string aFileName)
+ {
+ Directory.CreateDirectory(new FileInfo(aFileName).Directory.FullName);
+ using FileStream aData = File.OpenWrite(aFileName);
+ SaveToStream(aData);
+ }
+
+ public string SaveToBase64()
+ {
+ using MemoryStream memoryStream = new MemoryStream();
+ SaveToStream(memoryStream);
+ memoryStream.Position = 0L;
+ return Convert.ToBase64String(memoryStream.ToArray());
+ }
+
+ public static JSONNode Deserialize(BinaryReader aReader)
+ {
+ JSONBinaryTag jSONBinaryTag = (JSONBinaryTag)aReader.ReadByte();
+ switch (jSONBinaryTag)
+ {
+ case JSONBinaryTag.Array:
+ {
+ int num2 = aReader.ReadInt32();
+ JSONArray jSONArray = new JSONArray();
+ for (int j = 0; j < num2; j++)
+ {
+ jSONArray.Add(Deserialize(aReader));
+ }
+ return jSONArray;
+ }
+ case JSONBinaryTag.Class:
+ {
+ int num = aReader.ReadInt32();
+ JSONClass jSONClass = new JSONClass();
+ for (int i = 0; i < num; i++)
+ {
+ string aKey = aReader.ReadString();
+ JSONNode aItem = Deserialize(aReader);
+ jSONClass.Add(aKey, aItem);
+ }
+ return jSONClass;
+ }
+ case JSONBinaryTag.Value:
+ return new JSONData(aReader.ReadString());
+ case JSONBinaryTag.IntValue:
+ return new JSONData(aReader.ReadInt32());
+ case JSONBinaryTag.DoubleValue:
+ return new JSONData(aReader.ReadDouble());
+ case JSONBinaryTag.BoolValue:
+ return new JSONData(aReader.ReadBoolean());
+ case JSONBinaryTag.FloatValue:
+ return new JSONData(aReader.ReadSingle());
+ default:
+ throw new Exception("Error deserializing JSON. Unknown tag: " + jSONBinaryTag);
+ }
+ }
+
+ public static JSONNode LoadFromCompressedFile(string aFileName)
+ {
+ throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
+ }
+
+ public static JSONNode LoadFromCompressedStream(Stream aData)
+ {
+ throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
+ }
+
+ public static JSONNode LoadFromCompressedBase64(string aBase64)
+ {
+ throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
+ }
+
+ public static JSONNode LoadFromStream(Stream aData)
+ {
+ using BinaryReader aReader = new BinaryReader(aData);
+ return Deserialize(aReader);
+ }
+
+ public static JSONNode LoadFromFile(string aFileName)
+ {
+ using FileStream aData = File.OpenRead(aFileName);
+ return LoadFromStream(aData);
+ }
+
+ public static JSONNode LoadFromBase64(string aBase64)
+ {
+ return LoadFromStream(new MemoryStream(Convert.FromBase64String(aBase64))
+ {
+ Position = 0L
+ });
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/ArabicMapping.cs b/Thronefall_v1.57/Thronefall/I2.Loc/ArabicMapping.cs
new file mode 100644
index 0000000..70b399e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/ArabicMapping.cs
@@ -0,0 +1,14 @@
+namespace I2.Loc;
+
+internal class ArabicMapping
+{
+ public int from;
+
+ public int to;
+
+ public ArabicMapping(int from, int to)
+ {
+ this.from = from;
+ this.to = to;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/ArabicTable.cs b/Thronefall_v1.57/Thronefall/I2.Loc/ArabicTable.cs
new file mode 100644
index 0000000..18db6a9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/ArabicTable.cs
@@ -0,0 +1,80 @@
+using System.Collections.Generic;
+
+namespace I2.Loc;
+
+internal class ArabicTable
+{
+ private static List<ArabicMapping> mapList;
+
+ private static ArabicTable arabicMapper;
+
+ internal static ArabicTable ArabicMapper
+ {
+ get
+ {
+ if (arabicMapper == null)
+ {
+ arabicMapper = new ArabicTable();
+ }
+ return arabicMapper;
+ }
+ }
+
+ private ArabicTable()
+ {
+ mapList = new List<ArabicMapping>();
+ mapList.Add(new ArabicMapping(1569, 65152));
+ mapList.Add(new ArabicMapping(1575, 65165));
+ mapList.Add(new ArabicMapping(1571, 65155));
+ mapList.Add(new ArabicMapping(1572, 65157));
+ mapList.Add(new ArabicMapping(1573, 65159));
+ mapList.Add(new ArabicMapping(1609, 64508));
+ mapList.Add(new ArabicMapping(1574, 65161));
+ mapList.Add(new ArabicMapping(1576, 65167));
+ mapList.Add(new ArabicMapping(1578, 65173));
+ mapList.Add(new ArabicMapping(1579, 65177));
+ mapList.Add(new ArabicMapping(1580, 65181));
+ mapList.Add(new ArabicMapping(1581, 65185));
+ mapList.Add(new ArabicMapping(1582, 65189));
+ mapList.Add(new ArabicMapping(1583, 65193));
+ mapList.Add(new ArabicMapping(1584, 65195));
+ mapList.Add(new ArabicMapping(1585, 65197));
+ mapList.Add(new ArabicMapping(1586, 65199));
+ mapList.Add(new ArabicMapping(1587, 65201));
+ mapList.Add(new ArabicMapping(1588, 65205));
+ mapList.Add(new ArabicMapping(1589, 65209));
+ mapList.Add(new ArabicMapping(1590, 65213));
+ mapList.Add(new ArabicMapping(1591, 65217));
+ mapList.Add(new ArabicMapping(1592, 65221));
+ mapList.Add(new ArabicMapping(1593, 65225));
+ mapList.Add(new ArabicMapping(1594, 65229));
+ mapList.Add(new ArabicMapping(1601, 65233));
+ mapList.Add(new ArabicMapping(1602, 65237));
+ mapList.Add(new ArabicMapping(1603, 65241));
+ mapList.Add(new ArabicMapping(1604, 65245));
+ mapList.Add(new ArabicMapping(1605, 65249));
+ mapList.Add(new ArabicMapping(1606, 65253));
+ mapList.Add(new ArabicMapping(1607, 65257));
+ mapList.Add(new ArabicMapping(1608, 65261));
+ mapList.Add(new ArabicMapping(1610, 65265));
+ mapList.Add(new ArabicMapping(1570, 65153));
+ mapList.Add(new ArabicMapping(1577, 65171));
+ mapList.Add(new ArabicMapping(1662, 64342));
+ mapList.Add(new ArabicMapping(1670, 64378));
+ mapList.Add(new ArabicMapping(1688, 64394));
+ mapList.Add(new ArabicMapping(1711, 64402));
+ mapList.Add(new ArabicMapping(1705, 64398));
+ }
+
+ internal int Convert(int toBeConverted)
+ {
+ foreach (ArabicMapping map in mapList)
+ {
+ if (map.from == toBeConverted)
+ {
+ return map.to;
+ }
+ }
+ return toBeConverted;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/AutoChangeCultureInfo.cs b/Thronefall_v1.57/Thronefall/I2.Loc/AutoChangeCultureInfo.cs
new file mode 100644
index 0000000..569f62e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/AutoChangeCultureInfo.cs
@@ -0,0 +1,11 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class AutoChangeCultureInfo : MonoBehaviour
+{
+ public void Start()
+ {
+ LocalizationManager.EnableChangingCultureInfo(bEnable: true);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/BaseSpecializationManager.cs b/Thronefall_v1.57/Thronefall/I2.Loc/BaseSpecializationManager.cs
new file mode 100644
index 0000000..bb91640
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/BaseSpecializationManager.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+
+namespace I2.Loc;
+
+public class BaseSpecializationManager
+{
+ public string[] mSpecializations;
+
+ public Dictionary<string, string> mSpecializationsFallbacks;
+
+ public virtual void InitializeSpecializations()
+ {
+ mSpecializations = new string[12]
+ {
+ "Any", "PC", "Touch", "Controller", "VR", "XBox", "PS4", "OculusVR", "ViveVR", "GearVR",
+ "Android", "IOS"
+ };
+ mSpecializationsFallbacks = new Dictionary<string, string>(StringComparer.Ordinal)
+ {
+ { "XBox", "Controller" },
+ { "PS4", "Controller" },
+ { "OculusVR", "VR" },
+ { "ViveVR", "VR" },
+ { "GearVR", "VR" },
+ { "Android", "Touch" },
+ { "IOS", "Touch" }
+ };
+ }
+
+ public virtual string GetCurrentSpecialization()
+ {
+ if (mSpecializations == null)
+ {
+ InitializeSpecializations();
+ }
+ return "PC";
+ }
+
+ public virtual string GetFallbackSpecialization(string specialization)
+ {
+ if (mSpecializationsFallbacks == null)
+ {
+ InitializeSpecializations();
+ }
+ if (mSpecializationsFallbacks.TryGetValue(specialization, out var value))
+ {
+ return value;
+ }
+ return "Any";
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/CallbackNotification.cs b/Thronefall_v1.57/Thronefall/I2.Loc/CallbackNotification.cs
new file mode 100644
index 0000000..7060292
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/CallbackNotification.cs
@@ -0,0 +1,15 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class CallbackNotification : MonoBehaviour
+{
+ public void OnModifyLocalization()
+ {
+ if (!string.IsNullOrEmpty(Localize.MainTranslation))
+ {
+ string newValue = TextTranslator.Translate("Color/Red");
+ Localize.MainTranslation = Localize.MainTranslation.Replace("{PLAYER_COLOR}", newValue);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/CoroutineManager.cs b/Thronefall_v1.57/Thronefall/I2.Loc/CoroutineManager.cs
new file mode 100644
index 0000000..fa93b47
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/CoroutineManager.cs
@@ -0,0 +1,40 @@
+using System.Collections;
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class CoroutineManager : MonoBehaviour
+{
+ private static CoroutineManager mInstance;
+
+ private static CoroutineManager pInstance
+ {
+ get
+ {
+ if (mInstance == null)
+ {
+ GameObject gameObject = new GameObject("_Coroutiner");
+ gameObject.hideFlags = HideFlags.HideAndDontSave;
+ mInstance = gameObject.AddComponent<CoroutineManager>();
+ if (Application.isPlaying)
+ {
+ Object.DontDestroyOnLoad(gameObject);
+ }
+ }
+ return mInstance;
+ }
+ }
+
+ private void Awake()
+ {
+ if (Application.isPlaying)
+ {
+ Object.DontDestroyOnLoad(base.gameObject);
+ }
+ }
+
+ public static Coroutine Start(IEnumerator coroutine)
+ {
+ return pInstance.StartCoroutine(coroutine);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/CustomLocalizeCallback.cs b/Thronefall_v1.57/Thronefall/I2.Loc/CustomLocalizeCallback.cs
new file mode 100644
index 0000000..d308920
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/CustomLocalizeCallback.cs
@@ -0,0 +1,26 @@
+using UnityEngine;
+using UnityEngine.Events;
+
+namespace I2.Loc;
+
+[AddComponentMenu("I2/Localization/I2 Localize Callback")]
+public class CustomLocalizeCallback : MonoBehaviour
+{
+ public UnityEvent _OnLocalize = new UnityEvent();
+
+ public void OnEnable()
+ {
+ LocalizationManager.OnLocalizeEvent -= OnLocalize;
+ LocalizationManager.OnLocalizeEvent += OnLocalize;
+ }
+
+ public void OnDisable()
+ {
+ LocalizationManager.OnLocalizeEvent -= OnLocalize;
+ }
+
+ public void OnLocalize()
+ {
+ _OnLocalize.Invoke();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/EventCallback.cs b/Thronefall_v1.57/Thronefall/I2.Loc/EventCallback.cs
new file mode 100644
index 0000000..e0d63c6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/EventCallback.cs
@@ -0,0 +1,29 @@
+using System;
+using UnityEngine;
+
+namespace I2.Loc;
+
+[Serializable]
+public class EventCallback
+{
+ public MonoBehaviour Target;
+
+ public string MethodName = string.Empty;
+
+ public void Execute(UnityEngine.Object Sender = null)
+ {
+ if (HasCallback() && Application.isPlaying)
+ {
+ Target.gameObject.SendMessage(MethodName, Sender, SendMessageOptions.DontRequireReceiver);
+ }
+ }
+
+ public bool HasCallback()
+ {
+ if (Target != null)
+ {
+ return !string.IsNullOrEmpty(MethodName);
+ }
+ return false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/Example_ChangeLanguage.cs b/Thronefall_v1.57/Thronefall/I2.Loc/Example_ChangeLanguage.cs
new file mode 100644
index 0000000..69819ad
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/Example_ChangeLanguage.cs
@@ -0,0 +1,29 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class Example_ChangeLanguage : MonoBehaviour
+{
+ public void SetLanguage_English()
+ {
+ SetLanguage("English");
+ }
+
+ public void SetLanguage_French()
+ {
+ SetLanguage("French");
+ }
+
+ public void SetLanguage_Spanish()
+ {
+ SetLanguage("Spanish");
+ }
+
+ public void SetLanguage(string LangName)
+ {
+ if (LocalizationManager.HasLanguage(LangName))
+ {
+ LocalizationManager.CurrentLanguage = LangName;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/Example_LocalizedString.cs b/Thronefall_v1.57/Thronefall/I2.Loc/Example_LocalizedString.cs
new file mode 100644
index 0000000..bd19bbb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/Example_LocalizedString.cs
@@ -0,0 +1,31 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class Example_LocalizedString : MonoBehaviour
+{
+ public LocalizedString _MyLocalizedString;
+
+ public string _NormalString;
+
+ [TermsPopup("")]
+ public string _StringWithTermPopup;
+
+ public void Start()
+ {
+ Debug.Log(_MyLocalizedString);
+ Debug.Log(TextTranslator.Translate(_NormalString));
+ Debug.Log(TextTranslator.Translate(_StringWithTermPopup));
+ Debug.Log((string)(LocalizedString)"Term2");
+ Debug.Log(_MyLocalizedString);
+ Debug.Log((LocalizedString)"Term3");
+ LocalizedString localizedString = "Term3";
+ localizedString.mRTL_IgnoreArabicFix = true;
+ Debug.Log(localizedString);
+ LocalizedString localizedString2 = "Term3";
+ localizedString2.mRTL_ConvertNumbers = true;
+ localizedString2.mRTL_MaxLineLength = 20;
+ Debug.Log(localizedString2);
+ Debug.Log(localizedString2);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/GeneralArabicLetters.cs b/Thronefall_v1.57/Thronefall/I2.Loc/GeneralArabicLetters.cs
new file mode 100644
index 0000000..c6fecdd
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/GeneralArabicLetters.cs
@@ -0,0 +1,46 @@
+namespace I2.Loc;
+
+internal enum GeneralArabicLetters
+{
+ Hamza = 1569,
+ Alef = 1575,
+ AlefHamza = 1571,
+ WawHamza = 1572,
+ AlefMaksoor = 1573,
+ AlefMagsora = 1609,
+ HamzaNabera = 1574,
+ Ba = 1576,
+ Ta = 1578,
+ Tha2 = 1579,
+ Jeem = 1580,
+ H7aa = 1581,
+ Khaa2 = 1582,
+ Dal = 1583,
+ Thal = 1584,
+ Ra2 = 1585,
+ Zeen = 1586,
+ Seen = 1587,
+ Sheen = 1588,
+ S9a = 1589,
+ Dha = 1590,
+ T6a = 1591,
+ T6ha = 1592,
+ Ain = 1593,
+ Gain = 1594,
+ Fa = 1601,
+ Gaf = 1602,
+ Kaf = 1603,
+ Lam = 1604,
+ Meem = 1605,
+ Noon = 1606,
+ Ha = 1607,
+ Waw = 1608,
+ Ya = 1610,
+ AlefMad = 1570,
+ TaMarboota = 1577,
+ PersianPe = 1662,
+ PersianChe = 1670,
+ PersianZe = 1688,
+ PersianGaf = 1711,
+ PersianGaf2 = 1705
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/GlobalParametersExample.cs b/Thronefall_v1.57/Thronefall/I2.Loc/GlobalParametersExample.cs
new file mode 100644
index 0000000..5b5a66c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/GlobalParametersExample.cs
@@ -0,0 +1,17 @@
+namespace I2.Loc;
+
+public class GlobalParametersExample : RegisterGlobalParameters
+{
+ public override string GetParameterValue(string ParamName)
+ {
+ if (ParamName == "WINNER")
+ {
+ return "Javier";
+ }
+ if (ParamName == "NUM PLAYERS")
+ {
+ return 5.ToString();
+ }
+ return null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/GoogleLanguages.cs b/Thronefall_v1.57/Thronefall/I2.Loc/GoogleLanguages.cs
new file mode 100644
index 0000000..3157d04
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/GoogleLanguages.cs
@@ -0,0 +1,2873 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace I2.Loc;
+
+public static class GoogleLanguages
+{
+ public struct LanguageCodeDef
+ {
+ public string Code;
+
+ public string GoogleCode;
+
+ public bool HasJoinedWords;
+
+ public int PluralRule;
+ }
+
+ public static Dictionary<string, LanguageCodeDef> mLanguageDef = new Dictionary<string, LanguageCodeDef>(StringComparer.Ordinal)
+ {
+ {
+ "Abkhazian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ab",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Afar",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "aa",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Afrikaans",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "af"
+ }
+ },
+ {
+ "Akan",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ak",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Albanian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "sq"
+ }
+ },
+ {
+ "Amharic",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "am"
+ }
+ },
+ {
+ "Arabic",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar"
+ }
+ },
+ {
+ "Arabic/Algeria",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-DZ",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/Bahrain",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-BH",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/Egypt",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-EG",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/Iraq",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-IQ",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/Jordan",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-JO",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/Kuwait",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-KW",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/Lebanon",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-LB",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/Libya",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-LY",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/Morocco",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-MA",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/Oman",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-OM",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/Qatar",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-QA",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/Saudi Arabia",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-SA",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/Syria",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-SY",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/Tunisia",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-TN",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/U.A.E.",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-AE",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Arabic/Yemen",
+ new LanguageCodeDef
+ {
+ PluralRule = 11,
+ Code = "ar-YE",
+ GoogleCode = "ar"
+ }
+ },
+ {
+ "Aragonese",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "an",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Armenian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "hy"
+ }
+ },
+ {
+ "Assamese",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "as",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Avaric",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "av",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Avestan",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ae",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Aymara",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ay",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Azerbaijani",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "az"
+ }
+ },
+ {
+ "Bambara",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "bm",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Bashkir",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ba",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Basque",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "eu"
+ }
+ },
+ {
+ "Basque/Spain",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "eu-ES",
+ GoogleCode = "eu"
+ }
+ },
+ {
+ "Belarusian",
+ new LanguageCodeDef
+ {
+ PluralRule = 6,
+ Code = "be"
+ }
+ },
+ {
+ "Bengali",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "bn"
+ }
+ },
+ {
+ "Bihari",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "bh",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Bislama",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "bi",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Bosnian",
+ new LanguageCodeDef
+ {
+ PluralRule = 6,
+ Code = "bs"
+ }
+ },
+ {
+ "Breton",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "br",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Bulgariaa",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "bg"
+ }
+ },
+ {
+ "Burmese",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "my"
+ }
+ },
+ {
+ "Catalan",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ca"
+ }
+ },
+ {
+ "Chamorro",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ch",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Chechen",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ce",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Chichewa",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ny"
+ }
+ },
+ {
+ "Chinese",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "zh",
+ GoogleCode = "zh-CN",
+ HasJoinedWords = true
+ }
+ },
+ {
+ "Chinese/Hong Kong",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "zh-HK",
+ GoogleCode = "zh-TW",
+ HasJoinedWords = true
+ }
+ },
+ {
+ "Chinese/Macau",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "zh-MO",
+ GoogleCode = "zh-CN",
+ HasJoinedWords = true
+ }
+ },
+ {
+ "Chinese/PRC",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "zh-CN",
+ GoogleCode = "zh-CN",
+ HasJoinedWords = true
+ }
+ },
+ {
+ "Chinese/Simplified",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "zh-CN",
+ GoogleCode = "zh-CN",
+ HasJoinedWords = true
+ }
+ },
+ {
+ "Chinese/Singapore",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "zh-SG",
+ GoogleCode = "zh-CN",
+ HasJoinedWords = true
+ }
+ },
+ {
+ "Chinese/Taiwan",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "zh-TW",
+ GoogleCode = "zh-TW",
+ HasJoinedWords = true
+ }
+ },
+ {
+ "Chinese/Traditional",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "zh-TW",
+ GoogleCode = "zh-TW",
+ HasJoinedWords = true
+ }
+ },
+ {
+ "Chuvash",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "cv",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Cornish",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "kw",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Corsican",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "co"
+ }
+ },
+ {
+ "Cree",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "cr",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Croatian",
+ new LanguageCodeDef
+ {
+ PluralRule = 6,
+ Code = "hr"
+ }
+ },
+ {
+ "Croatian/Bosnia and Herzegovina",
+ new LanguageCodeDef
+ {
+ PluralRule = 5,
+ Code = "hr-BA",
+ GoogleCode = "hr"
+ }
+ },
+ {
+ "Czech",
+ new LanguageCodeDef
+ {
+ PluralRule = 7,
+ Code = "cs"
+ }
+ },
+ {
+ "Danish",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "da"
+ }
+ },
+ {
+ "Divehi",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "dv",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Dutch",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "nl"
+ }
+ },
+ {
+ "Dutch/Belgium",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "nl-BE",
+ GoogleCode = "nl"
+ }
+ },
+ {
+ "Dutch/Netherlands",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "nl-NL",
+ GoogleCode = "nl"
+ }
+ },
+ {
+ "Dzongkha",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "dz",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "English",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "en"
+ }
+ },
+ {
+ "English/Australia",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "en-AU",
+ GoogleCode = "en"
+ }
+ },
+ {
+ "English/Belize",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "en-BZ",
+ GoogleCode = "en"
+ }
+ },
+ {
+ "English/Canada",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "en-CA",
+ GoogleCode = "en"
+ }
+ },
+ {
+ "English/Caribbean",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "en-CB",
+ GoogleCode = "en"
+ }
+ },
+ {
+ "English/Ireland",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "en-IE",
+ GoogleCode = "en"
+ }
+ },
+ {
+ "English/Jamaica",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "en-JM",
+ GoogleCode = "en"
+ }
+ },
+ {
+ "English/New Zealand",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "en-NZ",
+ GoogleCode = "en"
+ }
+ },
+ {
+ "English/Republic of the Philippines",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "en-PH",
+ GoogleCode = "en"
+ }
+ },
+ {
+ "English/South Africa",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "en-ZA",
+ GoogleCode = "en"
+ }
+ },
+ {
+ "English/Trinidad",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "en-TT",
+ GoogleCode = "en"
+ }
+ },
+ {
+ "English/United Kingdom",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "en-GB",
+ GoogleCode = "en"
+ }
+ },
+ {
+ "English/United States",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "en-US",
+ GoogleCode = "en"
+ }
+ },
+ {
+ "English/Zimbabwe",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "en-ZW",
+ GoogleCode = "en"
+ }
+ },
+ {
+ "Esperanto",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "eo"
+ }
+ },
+ {
+ "Estonian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "et"
+ }
+ },
+ {
+ "Ewe",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ee",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Faeroese",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "fo",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Fijian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "fj",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Finnish",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "fi"
+ }
+ },
+ {
+ "French",
+ new LanguageCodeDef
+ {
+ PluralRule = 2,
+ Code = "fr"
+ }
+ },
+ {
+ "French/Belgium",
+ new LanguageCodeDef
+ {
+ PluralRule = 2,
+ Code = "fr-BE",
+ GoogleCode = "fr"
+ }
+ },
+ {
+ "French/Canada",
+ new LanguageCodeDef
+ {
+ PluralRule = 2,
+ Code = "fr-CA",
+ GoogleCode = "fr"
+ }
+ },
+ {
+ "French/France",
+ new LanguageCodeDef
+ {
+ PluralRule = 2,
+ Code = "fr-FR",
+ GoogleCode = "fr"
+ }
+ },
+ {
+ "French/Luxembourg",
+ new LanguageCodeDef
+ {
+ PluralRule = 2,
+ Code = "fr-LU",
+ GoogleCode = "fr"
+ }
+ },
+ {
+ "French/Principality of Monaco",
+ new LanguageCodeDef
+ {
+ PluralRule = 2,
+ Code = "fr-MC",
+ GoogleCode = "fr"
+ }
+ },
+ {
+ "French/Switzerland",
+ new LanguageCodeDef
+ {
+ PluralRule = 2,
+ Code = "fr-CH",
+ GoogleCode = "fr"
+ }
+ },
+ {
+ "Fulah",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ff",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Galician",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "gl"
+ }
+ },
+ {
+ "Galician/Spain",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "gl-ES",
+ GoogleCode = "gl"
+ }
+ },
+ {
+ "Georgian",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "ka"
+ }
+ },
+ {
+ "German",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "de"
+ }
+ },
+ {
+ "German/Austria",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "de-AT",
+ GoogleCode = "de"
+ }
+ },
+ {
+ "German/Germany",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "de-DE",
+ GoogleCode = "de"
+ }
+ },
+ {
+ "German/Liechtenstein",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "de-LI",
+ GoogleCode = "de"
+ }
+ },
+ {
+ "German/Luxembourg",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "de-LU",
+ GoogleCode = "de"
+ }
+ },
+ {
+ "German/Switzerland",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "de-CH",
+ GoogleCode = "de"
+ }
+ },
+ {
+ "Greek",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "el"
+ }
+ },
+ {
+ "Guaraní",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "gn",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Gujarati",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "gu"
+ }
+ },
+ {
+ "Haitian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ht"
+ }
+ },
+ {
+ "Hausa",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ha"
+ }
+ },
+ {
+ "Hebrew",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "he",
+ GoogleCode = "iw"
+ }
+ },
+ {
+ "Herero",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "hz",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Hindi",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "hi"
+ }
+ },
+ {
+ "Hiri Motu",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ho",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Hungarian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "hu"
+ }
+ },
+ {
+ "Interlingua",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ia",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Indonesian",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "id"
+ }
+ },
+ {
+ "Interlingue",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ie",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Irish",
+ new LanguageCodeDef
+ {
+ PluralRule = 10,
+ Code = "ga"
+ }
+ },
+ {
+ "Igbo",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ig"
+ }
+ },
+ {
+ "Inupiaq",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ik",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Ido",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "io",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Icelandic",
+ new LanguageCodeDef
+ {
+ PluralRule = 14,
+ Code = "is"
+ }
+ },
+ {
+ "Italian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "it"
+ }
+ },
+ {
+ "Italian/Italy",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "it-IT",
+ GoogleCode = "it"
+ }
+ },
+ {
+ "Italian/Switzerland",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "it-CH",
+ GoogleCode = "it"
+ }
+ },
+ {
+ "Inuktitut",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "iu",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Japanese",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "ja",
+ HasJoinedWords = true
+ }
+ },
+ {
+ "Javanese",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "jv"
+ }
+ },
+ {
+ "Kalaallisut",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "kl",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Kannada",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "kn"
+ }
+ },
+ {
+ "Kanuri",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "kr",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Kashmiri",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ks",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Kazakh",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "kk"
+ }
+ },
+ {
+ "Central Khmer",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "km"
+ }
+ },
+ {
+ "Kikuyu",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ki",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Kinyarwanda",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "rw",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Kirghiz",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ky"
+ }
+ },
+ {
+ "Komi",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "kv",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Kongo",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "kg",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Korean",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "ko"
+ }
+ },
+ {
+ "Kurdish",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ku"
+ }
+ },
+ {
+ "Kuanyama",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "kj",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Latin",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "la"
+ }
+ },
+ {
+ "Luxembourgish",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "lb"
+ }
+ },
+ {
+ "Ganda",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "lg",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Limburgan",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "li",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Lingala",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ln",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Lao",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "lo"
+ }
+ },
+ {
+ "Latvian",
+ new LanguageCodeDef
+ {
+ PluralRule = 5,
+ Code = "lv"
+ }
+ },
+ {
+ "Luba-Katanga",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "lu",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Lithuanian",
+ new LanguageCodeDef
+ {
+ PluralRule = 5,
+ Code = "lt"
+ }
+ },
+ {
+ "Manx",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "gv",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Macedonian",
+ new LanguageCodeDef
+ {
+ PluralRule = 13,
+ Code = "mk"
+ }
+ },
+ {
+ "Malagasy",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "mg"
+ }
+ },
+ {
+ "Malay",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "ms"
+ }
+ },
+ {
+ "Malay/Brunei Darussalam",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "ms-BN",
+ GoogleCode = "ms"
+ }
+ },
+ {
+ "Malay/Malaysia",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "ms-MY",
+ GoogleCode = "ms"
+ }
+ },
+ {
+ "Malayalam",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ml"
+ }
+ },
+ {
+ "Maltese",
+ new LanguageCodeDef
+ {
+ PluralRule = 12,
+ Code = "mt"
+ }
+ },
+ {
+ "Maori",
+ new LanguageCodeDef
+ {
+ PluralRule = 2,
+ Code = "mi"
+ }
+ },
+ {
+ "Marathi",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "mr"
+ }
+ },
+ {
+ "Marshallese",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "mh",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Mongolian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "mn"
+ }
+ },
+ {
+ "Nauru",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "na",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Navajo",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "nv",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "North Ndebele",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "nd",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Nepali",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ne"
+ }
+ },
+ {
+ "Ndonga",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ng",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Northern Sotho",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ns",
+ GoogleCode = "st"
+ }
+ },
+ {
+ "Norwegian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "nb",
+ GoogleCode = "no"
+ }
+ },
+ {
+ "Norwegian/Nynorsk",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "nn",
+ GoogleCode = "no"
+ }
+ },
+ {
+ "Sichuan Yi",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ii",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "South Ndebele",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "nr",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Occitan",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "oc",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Ojibwa",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "oj",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Church\u00a0Slavic",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "cu",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Oromo",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "om",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Oriya",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "or",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Ossetian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "os",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Pali",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "pi",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Pashto",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ps"
+ }
+ },
+ {
+ "Persian",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "fa"
+ }
+ },
+ {
+ "Polish",
+ new LanguageCodeDef
+ {
+ PluralRule = 8,
+ Code = "pl"
+ }
+ },
+ {
+ "Portuguese",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "pt"
+ }
+ },
+ {
+ "Portuguese/Brazil",
+ new LanguageCodeDef
+ {
+ PluralRule = 2,
+ Code = "pt-BR",
+ GoogleCode = "pt"
+ }
+ },
+ {
+ "Portuguese/Portugal",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "pt-PT",
+ GoogleCode = "pt"
+ }
+ },
+ {
+ "Punjabi",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "pa"
+ }
+ },
+ {
+ "Quechua",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "qu",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Quechua/Bolivia",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "qu-BO",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Quechua/Ecuador",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "qu-EC",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Quechua/Peru",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "qu-PE",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Rhaeto-Romanic",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "rm",
+ GoogleCode = "ro"
+ }
+ },
+ {
+ "Romanian",
+ new LanguageCodeDef
+ {
+ PluralRule = 4,
+ Code = "ro"
+ }
+ },
+ {
+ "Rundi",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "rn",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Russian",
+ new LanguageCodeDef
+ {
+ PluralRule = 6,
+ Code = "ru"
+ }
+ },
+ {
+ "Russian/Republic of Moldova",
+ new LanguageCodeDef
+ {
+ PluralRule = 6,
+ Code = "ru-MO",
+ GoogleCode = "ru"
+ }
+ },
+ {
+ "Sanskrit",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "sa",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Sardinian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "sc",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Sindhi",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "sd"
+ }
+ },
+ {
+ "Northern Sami",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "se",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Samoan",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "sm"
+ }
+ },
+ {
+ "Sango",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "sg",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Serbian",
+ new LanguageCodeDef
+ {
+ PluralRule = 6,
+ Code = "sr"
+ }
+ },
+ {
+ "Serbian/Bosnia and Herzegovina",
+ new LanguageCodeDef
+ {
+ PluralRule = 5,
+ Code = "sr-BA",
+ GoogleCode = "sr"
+ }
+ },
+ {
+ "Serbian/Serbia and Montenegro",
+ new LanguageCodeDef
+ {
+ PluralRule = 5,
+ Code = "sr-SP",
+ GoogleCode = "sr"
+ }
+ },
+ {
+ "Scottish Gaelic",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "gd"
+ }
+ },
+ {
+ "Shona",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "sn"
+ }
+ },
+ {
+ "Sinhala",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "si"
+ }
+ },
+ {
+ "Slovak",
+ new LanguageCodeDef
+ {
+ PluralRule = 7,
+ Code = "sk"
+ }
+ },
+ {
+ "Slovenian",
+ new LanguageCodeDef
+ {
+ PluralRule = 9,
+ Code = "sl"
+ }
+ },
+ {
+ "Somali",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "so"
+ }
+ },
+ {
+ "Southern Sotho",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "st"
+ }
+ },
+ {
+ "Spanish",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es"
+ }
+ },
+ {
+ "Spanish/Argentina",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-AR",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Bolivia",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-BO",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Castilian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-ES",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Chile",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-CL",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Colombia",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-CO",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Costa Rica",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-CR",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Dominican Republic",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-DO",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Ecuador",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-EC",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/El Salvador",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-SV",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Guatemala",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-GT",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Honduras",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-HN",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Mexico",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-MX",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Nicaragua",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-NI",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Panama",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-PA",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Paraguay",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-PY",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Peru",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-PE",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Puerto Rico",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-PR",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Spain",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-ES",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Uruguay",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-UY",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Venezuela",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-VE",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Spanish/Latin Americas",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "es-US",
+ GoogleCode = "es"
+ }
+ },
+ {
+ "Sundanese",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "su"
+ }
+ },
+ {
+ "Swahili",
+ new LanguageCodeDef
+ {
+ Code = "sw"
+ }
+ },
+ {
+ "Swati",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ss",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Swedish",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "sv"
+ }
+ },
+ {
+ "Swedish/Finland",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "sv-FI",
+ GoogleCode = "sv"
+ }
+ },
+ {
+ "Swedish/Sweden",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "sv-SE",
+ GoogleCode = "sv"
+ }
+ },
+ {
+ "Tamil",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ta"
+ }
+ },
+ {
+ "Tatar",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "tt",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Telugu",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "te"
+ }
+ },
+ {
+ "Tajik",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "tg"
+ }
+ },
+ {
+ "Thai",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "th",
+ HasJoinedWords = true
+ }
+ },
+ {
+ "Tigrinya",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ti",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Tibetan",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "bo",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Turkmen",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "tk",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Tagalog",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "tl"
+ }
+ },
+ {
+ "Tswana",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "tn",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Tonga",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "to",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Turkish",
+ new LanguageCodeDef
+ {
+ PluralRule = 0,
+ Code = "tr"
+ }
+ },
+ {
+ "Tsonga",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ts",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Twi",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "tw",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Tahitian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ty",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Uighur",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ug",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Ukrainian",
+ new LanguageCodeDef
+ {
+ PluralRule = 6,
+ Code = "uk"
+ }
+ },
+ {
+ "Urdu",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ur"
+ }
+ },
+ {
+ "Uzbek",
+ new LanguageCodeDef
+ {
+ PluralRule = 2,
+ Code = "uz"
+ }
+ },
+ {
+ "Venda",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "ve",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Vietnamese",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "vi"
+ }
+ },
+ {
+ "Volapük",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "vo",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Walloon",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "wa",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Welsh",
+ new LanguageCodeDef
+ {
+ PluralRule = 16,
+ Code = "cy"
+ }
+ },
+ {
+ "Wolof",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "wo",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Frisian",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "fy"
+ }
+ },
+ {
+ "Xhosa",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "xh"
+ }
+ },
+ {
+ "Yiddish",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "yi"
+ }
+ },
+ {
+ "Yoruba",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "yo"
+ }
+ },
+ {
+ "Zhuang",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "za",
+ GoogleCode = "-"
+ }
+ },
+ {
+ "Zulu",
+ new LanguageCodeDef
+ {
+ PluralRule = 1,
+ Code = "zu"
+ }
+ }
+ };
+
+ public static string GetLanguageCode(string Filter, bool ShowWarnings = false)
+ {
+ if (string.IsNullOrEmpty(Filter))
+ {
+ return string.Empty;
+ }
+ string[] filters = Filter.ToLowerInvariant().Split(" /(),".ToCharArray());
+ foreach (KeyValuePair<string, LanguageCodeDef> item in mLanguageDef)
+ {
+ if (LanguageMatchesFilter(item.Key, filters))
+ {
+ return item.Value.Code;
+ }
+ }
+ if (ShowWarnings)
+ {
+ Debug.Log("Language '" + Filter + "' not recognized. Please, add the language code to GoogleTranslation.cs");
+ }
+ return string.Empty;
+ }
+
+ public static List<string> GetLanguagesForDropdown(string Filter, string CodesToExclude)
+ {
+ string[] filters = Filter.ToLowerInvariant().Split(" /(),".ToCharArray());
+ List<string> list = new List<string>();
+ foreach (KeyValuePair<string, LanguageCodeDef> item in mLanguageDef)
+ {
+ if (string.IsNullOrEmpty(Filter) || LanguageMatchesFilter(item.Key, filters))
+ {
+ string text = string.Concat("[" + item.Value.Code + "]");
+ if (!CodesToExclude.Contains(text))
+ {
+ list.Add(item.Key + " " + text);
+ }
+ }
+ }
+ for (int num = list.Count - 2; num >= 0; num--)
+ {
+ string text2 = list[num].Substring(0, list[num].IndexOf(" ["));
+ if (list[num + 1].StartsWith(text2, StringComparison.Ordinal))
+ {
+ list[num] = text2 + "/" + list[num];
+ list.Insert(num + 1, text2 + "/");
+ }
+ }
+ return list;
+ }
+
+ private static bool LanguageMatchesFilter(string Language, string[] Filters)
+ {
+ Language = Language.ToLowerInvariant();
+ int i = 0;
+ for (int num = Filters.Length; i < num; i++)
+ {
+ if (Filters[i] != "")
+ {
+ if (!Language.Contains(Filters[i].ToLower()))
+ {
+ return false;
+ }
+ Language = Language.Remove(Language.IndexOf(Filters[i], StringComparison.Ordinal), Filters[i].Length);
+ }
+ }
+ return true;
+ }
+
+ public static string GetFormatedLanguageName(string Language)
+ {
+ string empty = string.Empty;
+ int num = Language.IndexOf(" [", StringComparison.Ordinal);
+ if (num > 0)
+ {
+ Language = Language.Substring(0, num);
+ }
+ num = Language.IndexOf('/');
+ if (num > 0)
+ {
+ empty = Language.Substring(0, num);
+ if (Language == empty + "/" + empty)
+ {
+ return empty;
+ }
+ Language = Language.Replace("/", " (") + ")";
+ }
+ return Language;
+ }
+
+ public static string GetCodedLanguage(string Language, string code)
+ {
+ string languageCode = GetLanguageCode(Language);
+ if (string.Compare(code, languageCode, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return Language;
+ }
+ return Language + " [" + code + "]";
+ }
+
+ public static void UnPackCodeFromLanguageName(string CodedLanguage, out string Language, out string code)
+ {
+ if (string.IsNullOrEmpty(CodedLanguage))
+ {
+ Language = string.Empty;
+ code = string.Empty;
+ return;
+ }
+ int num = CodedLanguage.IndexOf("[", StringComparison.Ordinal);
+ if (num < 0)
+ {
+ Language = CodedLanguage;
+ code = GetLanguageCode(Language);
+ }
+ else
+ {
+ Language = CodedLanguage.Substring(0, num).Trim();
+ code = CodedLanguage.Substring(num + 1, CodedLanguage.IndexOf("]", num, StringComparison.Ordinal) - num - 1);
+ }
+ }
+
+ public static string GetGoogleLanguageCode(string InternationalCode)
+ {
+ foreach (KeyValuePair<string, LanguageCodeDef> item in mLanguageDef)
+ {
+ if (InternationalCode == item.Value.Code)
+ {
+ if (item.Value.GoogleCode == "-")
+ {
+ return null;
+ }
+ return (!string.IsNullOrEmpty(item.Value.GoogleCode)) ? item.Value.GoogleCode : InternationalCode;
+ }
+ }
+ return InternationalCode;
+ }
+
+ public static string GetLanguageName(string code, bool useParenthesesForRegion = false, bool allowDiscardRegion = true)
+ {
+ foreach (KeyValuePair<string, LanguageCodeDef> item in mLanguageDef)
+ {
+ if (!(code == item.Value.Code))
+ {
+ continue;
+ }
+ string text = item.Key;
+ if (useParenthesesForRegion)
+ {
+ int num = text.IndexOf('/');
+ if (num > 0)
+ {
+ text = text.Substring(0, num) + " (" + text.Substring(num + 1) + ")";
+ }
+ }
+ return text;
+ }
+ if (allowDiscardRegion)
+ {
+ int num2 = code.IndexOf("-", StringComparison.Ordinal);
+ if (num2 > 0)
+ {
+ return GetLanguageName(code.Substring(0, num2), useParenthesesForRegion, allowDiscardRegion: false);
+ }
+ }
+ return null;
+ }
+
+ public static List<string> GetAllInternationalCodes()
+ {
+ HashSet<string> hashSet = new HashSet<string>(StringComparer.Ordinal);
+ foreach (KeyValuePair<string, LanguageCodeDef> item in mLanguageDef)
+ {
+ hashSet.Add(item.Value.Code);
+ }
+ return new List<string>(hashSet);
+ }
+
+ public static bool LanguageCode_HasJoinedWord(string languageCode)
+ {
+ foreach (KeyValuePair<string, LanguageCodeDef> item in mLanguageDef)
+ {
+ if (languageCode == item.Value.GoogleCode || languageCode == item.Value.Code)
+ {
+ return item.Value.HasJoinedWords;
+ }
+ }
+ return false;
+ }
+
+ private static int GetPluralRule(string langCode)
+ {
+ if (langCode.Length > 2)
+ {
+ langCode = langCode.Substring(0, 2);
+ }
+ langCode = langCode.ToLower();
+ foreach (KeyValuePair<string, LanguageCodeDef> item in mLanguageDef)
+ {
+ if (item.Value.Code == langCode)
+ {
+ return item.Value.PluralRule;
+ }
+ }
+ return 0;
+ }
+
+ public static bool LanguageHasPluralType(string langCode, string pluralType)
+ {
+ switch (pluralType)
+ {
+ case "Plural":
+ case "Zero":
+ case "One":
+ return true;
+ default:
+ switch (GetPluralRule(langCode))
+ {
+ case 3:
+ if (!(pluralType == "Two"))
+ {
+ return pluralType == "Few";
+ }
+ return true;
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ return pluralType == "Few";
+ case 9:
+ if (!(pluralType == "Two"))
+ {
+ return pluralType == "Few";
+ }
+ return true;
+ case 10:
+ case 11:
+ case 15:
+ case 16:
+ if (!(pluralType == "Two") && !(pluralType == "Few"))
+ {
+ return pluralType == "Many";
+ }
+ return true;
+ case 12:
+ if (!(pluralType == "Few"))
+ {
+ return pluralType == "Many";
+ }
+ return true;
+ case 13:
+ return pluralType == "Two";
+ default:
+ return false;
+ }
+ }
+ }
+
+ public static ePluralType GetPluralType(string langCode, int n)
+ {
+ switch (n)
+ {
+ case 0:
+ return ePluralType.Zero;
+ case 1:
+ return ePluralType.One;
+ default:
+ switch (GetPluralRule(langCode))
+ {
+ case 0:
+ return ePluralType.Plural;
+ case 1:
+ if (n != 1)
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.One;
+ case 2:
+ if (n > 1)
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.One;
+ case 3:
+ switch (n)
+ {
+ default:
+ if (!inRange(n, 3, 10) && !inRange(n, 13, 19))
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.Few;
+ case 2:
+ case 12:
+ return ePluralType.Two;
+ case 1:
+ case 11:
+ return ePluralType.One;
+ }
+ case 4:
+ if (n != 1)
+ {
+ if (!inRange(n % 100, 1, 19))
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.Few;
+ }
+ return ePluralType.One;
+ case 5:
+ if (n % 10 != 1 || n % 100 == 11)
+ {
+ if (n % 10 < 2 || (n % 100 >= 10 && n % 100 < 20))
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.Few;
+ }
+ return ePluralType.One;
+ case 6:
+ if (n % 10 != 1 || n % 100 == 11)
+ {
+ if (!inRange(n % 10, 2, 4) || inRange(n % 100, 12, 14))
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.Few;
+ }
+ return ePluralType.One;
+ case 7:
+ if (n != 1)
+ {
+ if (!inRange(n, 2, 4))
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.Few;
+ }
+ return ePluralType.One;
+ case 8:
+ if (n != 1)
+ {
+ if (!inRange(n % 10, 2, 4) || inRange(n % 100, 12, 14))
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.Few;
+ }
+ return ePluralType.One;
+ case 9:
+ if (n % 100 != 1)
+ {
+ if (n % 100 != 2)
+ {
+ if (!inRange(n % 100, 3, 4))
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.Few;
+ }
+ return ePluralType.Two;
+ }
+ return ePluralType.One;
+ case 10:
+ switch (n)
+ {
+ default:
+ if (!inRange(n, 3, 6))
+ {
+ if (!inRange(n, 7, 10))
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.Many;
+ }
+ return ePluralType.Few;
+ case 2:
+ return ePluralType.Two;
+ case 1:
+ return ePluralType.One;
+ }
+ case 11:
+ switch (n)
+ {
+ default:
+ if (!inRange(n % 100, 3, 10))
+ {
+ if (n % 100 < 11)
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.Many;
+ }
+ return ePluralType.Few;
+ case 2:
+ return ePluralType.Two;
+ case 1:
+ return ePluralType.One;
+ case 0:
+ return ePluralType.Zero;
+ }
+ case 12:
+ if (n != 1)
+ {
+ if (!inRange(n % 100, 1, 10))
+ {
+ if (!inRange(n % 100, 11, 19))
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.Many;
+ }
+ return ePluralType.Few;
+ }
+ return ePluralType.One;
+ case 13:
+ if (n % 10 != 1)
+ {
+ if (n % 10 != 2)
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.Two;
+ }
+ return ePluralType.One;
+ case 14:
+ if (n % 10 != 1 || n % 100 == 11)
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.One;
+ case 15:
+ if (n % 10 != 1 || n % 100 == 11 || n % 100 == 71 || n % 100 == 91)
+ {
+ if (n % 10 != 2 || n % 100 == 12 || n % 100 == 72 || n % 100 == 92)
+ {
+ if ((n % 10 != 3 && n % 10 != 4 && n % 10 != 9) || n % 100 == 13 || n % 100 == 14 || n % 100 == 19 || n % 100 == 73 || n % 100 == 74 || n % 100 == 79 || n % 100 == 93 || n % 100 == 94 || n % 100 == 99)
+ {
+ if (n % 1000000 != 0)
+ {
+ return ePluralType.Plural;
+ }
+ return ePluralType.Many;
+ }
+ return ePluralType.Few;
+ }
+ return ePluralType.Two;
+ }
+ return ePluralType.One;
+ case 16:
+ return n switch
+ {
+ 6 => ePluralType.Many,
+ 3 => ePluralType.Few,
+ 2 => ePluralType.Two,
+ 1 => ePluralType.One,
+ 0 => ePluralType.Zero,
+ _ => ePluralType.Plural,
+ };
+ default:
+ return ePluralType.Plural;
+ }
+ }
+ }
+
+ public static int GetPluralTestNumber(string langCode, ePluralType pluralType)
+ {
+ switch (pluralType)
+ {
+ case ePluralType.Zero:
+ return 0;
+ case ePluralType.One:
+ return 1;
+ case ePluralType.Few:
+ return 3;
+ case ePluralType.Many:
+ switch (GetPluralRule(langCode))
+ {
+ case 10:
+ return 8;
+ case 11:
+ case 12:
+ return 13;
+ case 15:
+ return 1000000;
+ default:
+ return 6;
+ }
+ default:
+ return 936;
+ }
+ }
+
+ private static bool inRange(int amount, int min, int max)
+ {
+ if (amount >= min)
+ {
+ return amount <= max;
+ }
+ return false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/GoogleTranslation.cs b/Thronefall_v1.57/Thronefall/I2.Loc/GoogleTranslation.cs
new file mode 100644
index 0000000..94f3869
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/GoogleTranslation.cs
@@ -0,0 +1,575 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using UnityEngine.Networking;
+
+namespace I2.Loc;
+
+public static class GoogleTranslation
+{
+ public delegate void fnOnTranslated(string Translation, string Error);
+
+ public delegate void fnOnTranslationReady(Dictionary<string, TranslationQuery> dict, string error);
+
+ private static List<UnityWebRequest> mCurrentTranslations = new List<UnityWebRequest>();
+
+ private static List<TranslationJob> mTranslationJobs = new List<TranslationJob>();
+
+ public static bool CanTranslate()
+ {
+ if (LocalizationManager.Sources.Count > 0)
+ {
+ return !string.IsNullOrEmpty(LocalizationManager.GetWebServiceURL());
+ }
+ return false;
+ }
+
+ public static void Translate(string text, string LanguageCodeFrom, string LanguageCodeTo, fnOnTranslated OnTranslationReady)
+ {
+ LocalizationManager.InitializeIfNeeded();
+ if (!CanTranslate())
+ {
+ OnTranslationReady(null, "WebService is not set correctly or needs to be reinstalled");
+ return;
+ }
+ if (LanguageCodeTo == LanguageCodeFrom)
+ {
+ OnTranslationReady(text, null);
+ return;
+ }
+ Dictionary<string, TranslationQuery> queries = new Dictionary<string, TranslationQuery>(StringComparer.Ordinal);
+ if (string.IsNullOrEmpty(LanguageCodeTo))
+ {
+ OnTranslationReady(string.Empty, null);
+ return;
+ }
+ CreateQueries(text, LanguageCodeFrom, LanguageCodeTo, queries);
+ Translate(queries, delegate(Dictionary<string, TranslationQuery> results, string error)
+ {
+ if (!string.IsNullOrEmpty(error) || results.Count == 0)
+ {
+ OnTranslationReady(null, error);
+ }
+ else
+ {
+ string translation = RebuildTranslation(text, queries, LanguageCodeTo);
+ OnTranslationReady(translation, null);
+ }
+ });
+ }
+
+ public static string ForceTranslate(string text, string LanguageCodeFrom, string LanguageCodeTo)
+ {
+ Dictionary<string, TranslationQuery> dictionary = new Dictionary<string, TranslationQuery>(StringComparer.Ordinal);
+ AddQuery(text, LanguageCodeFrom, LanguageCodeTo, dictionary);
+ TranslationJob_Main translationJob_Main = new TranslationJob_Main(dictionary, null);
+ while (true)
+ {
+ switch (translationJob_Main.GetState())
+ {
+ case TranslationJob.eJobState.Running:
+ break;
+ case TranslationJob.eJobState.Failed:
+ return null;
+ default:
+ return GetQueryResult(text, "", dictionary);
+ }
+ }
+ }
+
+ public static void Translate(Dictionary<string, TranslationQuery> requests, fnOnTranslationReady OnTranslationReady, bool usePOST = true)
+ {
+ AddTranslationJob(new TranslationJob_Main(requests, OnTranslationReady));
+ }
+
+ public static bool ForceTranslate(Dictionary<string, TranslationQuery> requests, bool usePOST = true)
+ {
+ TranslationJob_Main translationJob_Main = new TranslationJob_Main(requests, null);
+ while (true)
+ {
+ switch (translationJob_Main.GetState())
+ {
+ case TranslationJob.eJobState.Running:
+ break;
+ case TranslationJob.eJobState.Failed:
+ return false;
+ default:
+ return true;
+ }
+ }
+ }
+
+ public static List<string> ConvertTranslationRequest(Dictionary<string, TranslationQuery> requests, bool encodeGET)
+ {
+ List<string> list = new List<string>();
+ StringBuilder stringBuilder = new StringBuilder();
+ foreach (KeyValuePair<string, TranslationQuery> request in requests)
+ {
+ TranslationQuery value = request.Value;
+ if (stringBuilder.Length > 0)
+ {
+ stringBuilder.Append("<I2Loc>");
+ }
+ stringBuilder.Append(GoogleLanguages.GetGoogleLanguageCode(value.LanguageCode));
+ stringBuilder.Append(":");
+ for (int i = 0; i < value.TargetLanguagesCode.Length; i++)
+ {
+ if (i != 0)
+ {
+ stringBuilder.Append(",");
+ }
+ stringBuilder.Append(GoogleLanguages.GetGoogleLanguageCode(value.TargetLanguagesCode[i]));
+ }
+ stringBuilder.Append("=");
+ string text = ((TitleCase(value.Text) == value.Text) ? value.Text.ToLowerInvariant() : value.Text);
+ if (!encodeGET)
+ {
+ stringBuilder.Append(text);
+ continue;
+ }
+ stringBuilder.Append(Uri.EscapeDataString(text));
+ if (stringBuilder.Length > 4000)
+ {
+ list.Add(stringBuilder.ToString());
+ stringBuilder.Length = 0;
+ }
+ }
+ list.Add(stringBuilder.ToString());
+ return list;
+ }
+
+ private static void AddTranslationJob(TranslationJob job)
+ {
+ mTranslationJobs.Add(job);
+ if (mTranslationJobs.Count == 1)
+ {
+ CoroutineManager.Start(WaitForTranslations());
+ }
+ }
+
+ private static IEnumerator WaitForTranslations()
+ {
+ while (mTranslationJobs.Count > 0)
+ {
+ TranslationJob[] array = mTranslationJobs.ToArray();
+ foreach (TranslationJob translationJob in array)
+ {
+ if (translationJob.GetState() != 0)
+ {
+ mTranslationJobs.Remove(translationJob);
+ }
+ }
+ yield return null;
+ }
+ }
+
+ public static string ParseTranslationResult(string html, Dictionary<string, TranslationQuery> requests)
+ {
+ if (html.StartsWith("<!DOCTYPE html>") || html.StartsWith("<HTML>"))
+ {
+ if (html.Contains("The script completed but did not return anything"))
+ {
+ return "The current Google WebService is not supported.\nPlease, delete the WebService from the Google Drive and Install the latest version.";
+ }
+ if (html.Contains("Service invoked too many times in a short time"))
+ {
+ return "";
+ }
+ return "There was a problem contacting the WebService. Please try again later\n" + html;
+ }
+ string[] array = html.Split(new string[1] { "<I2Loc>" }, StringSplitOptions.None);
+ string[] separator = new string[1] { "<i2>" };
+ int num = 0;
+ string[] array2 = requests.Keys.ToArray();
+ foreach (string text in array2)
+ {
+ TranslationQuery value = FindQueryFromOrigText(text, requests);
+ string text2 = array[num++];
+ if (value.Tags != null)
+ {
+ for (int num2 = value.Tags.Length - 1; num2 >= 0; num2--)
+ {
+ text2 = text2.Replace(GetGoogleNoTranslateTag(num2), value.Tags[num2]);
+ }
+ }
+ value.Results = text2.Split(separator, StringSplitOptions.None);
+ if (TitleCase(text) == text)
+ {
+ for (int j = 0; j < value.Results.Length; j++)
+ {
+ value.Results[j] = TitleCase(value.Results[j]);
+ }
+ }
+ requests[value.OrigText] = value;
+ }
+ return null;
+ }
+
+ public static bool IsTranslating()
+ {
+ if (mCurrentTranslations.Count <= 0)
+ {
+ return mTranslationJobs.Count > 0;
+ }
+ return true;
+ }
+
+ public static void CancelCurrentGoogleTranslations()
+ {
+ mCurrentTranslations.Clear();
+ foreach (TranslationJob mTranslationJob in mTranslationJobs)
+ {
+ mTranslationJob.Dispose();
+ }
+ mTranslationJobs.Clear();
+ }
+
+ public static void CreateQueries(string text, string LanguageCodeFrom, string LanguageCodeTo, Dictionary<string, TranslationQuery> dict)
+ {
+ if (!text.Contains("[i2s_"))
+ {
+ CreateQueries_Plurals(text, LanguageCodeFrom, LanguageCodeTo, dict);
+ return;
+ }
+ foreach (KeyValuePair<string, string> specialization in SpecializationManager.GetSpecializations(text))
+ {
+ CreateQueries_Plurals(specialization.Value, LanguageCodeFrom, LanguageCodeTo, dict);
+ }
+ }
+
+ private static void CreateQueries_Plurals(string text, string LanguageCodeFrom, string LanguageCodeTo, Dictionary<string, TranslationQuery> dict)
+ {
+ bool flag = text.Contains("{[#");
+ bool flag2 = text.Contains("[i2p_");
+ if (!HasParameters(text) || (!flag && !flag2))
+ {
+ AddQuery(text, LanguageCodeFrom, LanguageCodeTo, dict);
+ return;
+ }
+ bool forceTag = flag;
+ for (ePluralType ePluralType2 = ePluralType.Zero; ePluralType2 <= ePluralType.Plural; ePluralType2++)
+ {
+ string pluralType = ePluralType2.ToString();
+ if (GoogleLanguages.LanguageHasPluralType(LanguageCodeTo, pluralType))
+ {
+ string text2 = GetPluralText(text, pluralType);
+ int pluralTestNumber = GoogleLanguages.GetPluralTestNumber(LanguageCodeTo, ePluralType2);
+ string pluralParameter = GetPluralParameter(text2, forceTag);
+ if (!string.IsNullOrEmpty(pluralParameter))
+ {
+ text2 = text2.Replace(pluralParameter, pluralTestNumber.ToString());
+ }
+ AddQuery(text2, LanguageCodeFrom, LanguageCodeTo, dict);
+ }
+ }
+ }
+
+ public static void AddQuery(string text, string LanguageCodeFrom, string LanguageCodeTo, Dictionary<string, TranslationQuery> dict)
+ {
+ if (string.IsNullOrEmpty(text))
+ {
+ return;
+ }
+ if (!dict.ContainsKey(text))
+ {
+ TranslationQuery translationQuery = default(TranslationQuery);
+ translationQuery.OrigText = text;
+ translationQuery.LanguageCode = LanguageCodeFrom;
+ translationQuery.TargetLanguagesCode = new string[1] { LanguageCodeTo };
+ TranslationQuery query = translationQuery;
+ query.Text = text;
+ ParseNonTranslatableElements(ref query);
+ dict[text] = query;
+ }
+ else
+ {
+ TranslationQuery value = dict[text];
+ if (Array.IndexOf(value.TargetLanguagesCode, LanguageCodeTo) < 0)
+ {
+ value.TargetLanguagesCode = value.TargetLanguagesCode.Concat(new string[1] { LanguageCodeTo }).Distinct().ToArray();
+ }
+ dict[text] = value;
+ }
+ }
+
+ private static string GetTranslation(string text, string LanguageCodeTo, Dictionary<string, TranslationQuery> dict)
+ {
+ if (!dict.ContainsKey(text))
+ {
+ return null;
+ }
+ TranslationQuery translationQuery = dict[text];
+ int num = Array.IndexOf(translationQuery.TargetLanguagesCode, LanguageCodeTo);
+ if (num < 0)
+ {
+ return "";
+ }
+ if (translationQuery.Results == null)
+ {
+ return "";
+ }
+ return translationQuery.Results[num];
+ }
+
+ private static TranslationQuery FindQueryFromOrigText(string origText, Dictionary<string, TranslationQuery> dict)
+ {
+ foreach (KeyValuePair<string, TranslationQuery> item in dict)
+ {
+ if (item.Value.OrigText == origText)
+ {
+ return item.Value;
+ }
+ }
+ return default(TranslationQuery);
+ }
+
+ public static bool HasParameters(string text)
+ {
+ int num = text.IndexOf("{[", StringComparison.Ordinal);
+ if (num < 0)
+ {
+ return false;
+ }
+ return text.IndexOf("]}", num, StringComparison.Ordinal) > 0;
+ }
+
+ public static string GetPluralParameter(string text, bool forceTag)
+ {
+ int num = text.IndexOf("{[#", StringComparison.Ordinal);
+ if (num < 0)
+ {
+ if (forceTag)
+ {
+ return null;
+ }
+ num = text.IndexOf("{[", StringComparison.Ordinal);
+ }
+ if (num < 0)
+ {
+ return null;
+ }
+ int num2 = text.IndexOf("]}", num + 2, StringComparison.Ordinal);
+ if (num2 < 0)
+ {
+ return null;
+ }
+ return text.Substring(num, num2 - num + 2);
+ }
+
+ public static string GetPluralText(string text, string pluralType)
+ {
+ pluralType = "[i2p_" + pluralType + "]";
+ int num = text.IndexOf(pluralType, StringComparison.Ordinal);
+ if (num >= 0)
+ {
+ num += pluralType.Length;
+ int num2 = text.IndexOf("[i2p_", num, StringComparison.Ordinal);
+ if (num2 < 0)
+ {
+ num2 = text.Length;
+ }
+ return text.Substring(num, num2 - num);
+ }
+ num = text.IndexOf("[i2p_", StringComparison.Ordinal);
+ if (num < 0)
+ {
+ return text;
+ }
+ if (num > 0)
+ {
+ return text.Substring(0, num);
+ }
+ num = text.IndexOf("]", StringComparison.Ordinal);
+ if (num < 0)
+ {
+ return text;
+ }
+ num++;
+ int num3 = text.IndexOf("[i2p_", num, StringComparison.Ordinal);
+ if (num3 < 0)
+ {
+ num3 = text.Length;
+ }
+ return text.Substring(num, num3 - num);
+ }
+
+ private static int FindClosingTag(string tag, MatchCollection matches, int startIndex)
+ {
+ int i = startIndex;
+ for (int count = matches.Count; i < count; i++)
+ {
+ string captureMatch = I2Utils.GetCaptureMatch(matches[i]);
+ if (captureMatch[0] == '/' && tag.StartsWith(captureMatch.Substring(1), StringComparison.Ordinal))
+ {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ private static string GetGoogleNoTranslateTag(int tagNumber)
+ {
+ if (tagNumber < 70)
+ {
+ return "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++".Substring(0, tagNumber + 1);
+ }
+ string text = "";
+ for (int i = -1; i < tagNumber; i++)
+ {
+ text += "+";
+ }
+ return text;
+ }
+
+ private static void ParseNonTranslatableElements(ref TranslationQuery query)
+ {
+ MatchCollection matchCollection = Regex.Matches(query.Text, "\\{\\[(.*?)]}|\\[(.*?)]|\\<(.*?)>");
+ if (matchCollection == null || matchCollection.Count == 0)
+ {
+ return;
+ }
+ string text = query.Text;
+ List<string> list = new List<string>();
+ int i = 0;
+ for (int count = matchCollection.Count; i < count; i++)
+ {
+ string captureMatch = I2Utils.GetCaptureMatch(matchCollection[i]);
+ int num = FindClosingTag(captureMatch, matchCollection, i);
+ if (num < 0)
+ {
+ string text2 = matchCollection[i].ToString();
+ if (text2.StartsWith("{[", StringComparison.Ordinal) && text2.EndsWith("]}", StringComparison.Ordinal))
+ {
+ text = text.Replace(text2, GetGoogleNoTranslateTag(list.Count) + " ");
+ list.Add(text2);
+ }
+ }
+ else if (captureMatch == "i2nt")
+ {
+ string text3 = query.Text.Substring(matchCollection[i].Index, matchCollection[num].Index - matchCollection[i].Index + matchCollection[num].Length);
+ text = text.Replace(text3, GetGoogleNoTranslateTag(list.Count) + " ");
+ list.Add(text3);
+ }
+ else
+ {
+ string text4 = matchCollection[i].ToString();
+ text = text.Replace(text4, GetGoogleNoTranslateTag(list.Count) + " ");
+ list.Add(text4);
+ string text5 = matchCollection[num].ToString();
+ text = text.Replace(text5, GetGoogleNoTranslateTag(list.Count) + " ");
+ list.Add(text5);
+ }
+ }
+ query.Text = text;
+ query.Tags = list.ToArray();
+ }
+
+ public static string GetQueryResult(string text, string LanguageCodeTo, Dictionary<string, TranslationQuery> dict)
+ {
+ if (!dict.ContainsKey(text))
+ {
+ return null;
+ }
+ TranslationQuery translationQuery = dict[text];
+ if (translationQuery.Results == null || translationQuery.Results.Length < 0)
+ {
+ return null;
+ }
+ if (string.IsNullOrEmpty(LanguageCodeTo))
+ {
+ return translationQuery.Results[0];
+ }
+ int num = Array.IndexOf(translationQuery.TargetLanguagesCode, LanguageCodeTo);
+ if (num < 0)
+ {
+ return null;
+ }
+ return translationQuery.Results[num];
+ }
+
+ public static string RebuildTranslation(string text, Dictionary<string, TranslationQuery> dict, string LanguageCodeTo)
+ {
+ if (!text.Contains("[i2s_"))
+ {
+ return RebuildTranslation_Plural(text, dict, LanguageCodeTo);
+ }
+ Dictionary<string, string> specializations = SpecializationManager.GetSpecializations(text);
+ Dictionary<string, string> dictionary = new Dictionary<string, string>(StringComparer.Ordinal);
+ foreach (KeyValuePair<string, string> item in specializations)
+ {
+ dictionary[item.Key] = RebuildTranslation_Plural(item.Value, dict, LanguageCodeTo);
+ }
+ return SpecializationManager.SetSpecializedText(dictionary);
+ }
+
+ private static string RebuildTranslation_Plural(string text, Dictionary<string, TranslationQuery> dict, string LanguageCodeTo)
+ {
+ bool flag = text.Contains("{[#");
+ bool flag2 = text.Contains("[i2p_");
+ if (!HasParameters(text) || (!flag && !flag2))
+ {
+ return GetTranslation(text, LanguageCodeTo, dict);
+ }
+ StringBuilder stringBuilder = new StringBuilder();
+ string text2 = null;
+ bool forceTag = flag;
+ for (ePluralType ePluralType2 = ePluralType.Plural; ePluralType2 >= ePluralType.Zero; ePluralType2--)
+ {
+ string text3 = ePluralType2.ToString();
+ if (!GoogleLanguages.LanguageHasPluralType(LanguageCodeTo, text3))
+ {
+ continue;
+ }
+ string text4 = GetPluralText(text, text3);
+ int pluralTestNumber = GoogleLanguages.GetPluralTestNumber(LanguageCodeTo, ePluralType2);
+ string pluralParameter = GetPluralParameter(text4, forceTag);
+ if (!string.IsNullOrEmpty(pluralParameter))
+ {
+ text4 = text4.Replace(pluralParameter, pluralTestNumber.ToString());
+ }
+ string text5 = GetTranslation(text4, LanguageCodeTo, dict);
+ if (!string.IsNullOrEmpty(pluralParameter))
+ {
+ text5 = text5.Replace(pluralTestNumber.ToString(), pluralParameter);
+ }
+ if (ePluralType2 == ePluralType.Plural)
+ {
+ text2 = text5;
+ }
+ else
+ {
+ if (text5 == text2)
+ {
+ continue;
+ }
+ stringBuilder.AppendFormat("[i2p_{0}]", text3);
+ }
+ stringBuilder.Append(text5);
+ }
+ return stringBuilder.ToString();
+ }
+
+ public static string UppercaseFirst(string s)
+ {
+ if (string.IsNullOrEmpty(s))
+ {
+ return string.Empty;
+ }
+ char[] array = s.ToLower().ToCharArray();
+ array[0] = char.ToUpper(array[0]);
+ return new string(array);
+ }
+
+ public static string TitleCase(string s)
+ {
+ if (string.IsNullOrEmpty(s))
+ {
+ return string.Empty;
+ }
+ return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(s);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/HindiFixer.cs b/Thronefall_v1.57/Thronefall/I2.Loc/HindiFixer.cs
new file mode 100644
index 0000000..41e3740
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/HindiFixer.cs
@@ -0,0 +1,83 @@
+using System.Linq;
+
+namespace I2.Loc;
+
+public class HindiFixer
+{
+ internal static string Fix(string text)
+ {
+ char[] array = text.ToCharArray();
+ bool flag = false;
+ for (int i = 0; i < array.Length; i++)
+ {
+ if (array[i] == '\u093f' && !char.IsWhiteSpace(array[i - 1]) && array[i - 1] != 0)
+ {
+ array[i] = array[i - 1];
+ array[i - 1] = '\u093f';
+ flag = true;
+ }
+ if (i != array.Length - 1)
+ {
+ if (array[i] == 'इ' && array[i + 1] == '\u093c')
+ {
+ array[i] = 'ऌ';
+ array[i + 1] = '\0';
+ flag = true;
+ }
+ if (array[i] == '\u0943' && array[i + 1] == '\u093c')
+ {
+ array[i] = '\u0944';
+ array[i + 1] = '\0';
+ flag = true;
+ }
+ if (array[i] == '\u0901' && array[i + 1] == '\u093c')
+ {
+ array[i] = 'ॐ';
+ array[i + 1] = '\0';
+ flag = true;
+ }
+ if (array[i] == 'ऋ' && array[i + 1] == '\u093c')
+ {
+ array[i] = 'ॠ';
+ array[i + 1] = '\0';
+ flag = true;
+ }
+ if (array[i] == 'ई' && array[i + 1] == '\u093c')
+ {
+ array[i] = 'ॡ';
+ array[i + 1] = '\0';
+ flag = true;
+ }
+ if (array[i] == '\u093f' && array[i + 1] == '\u093c')
+ {
+ array[i] = '\u0962';
+ array[i + 1] = '\0';
+ flag = true;
+ }
+ if (array[i] == '\u0940' && array[i + 1] == '\u093c')
+ {
+ array[i] = '\u0963';
+ array[i + 1] = '\0';
+ flag = true;
+ }
+ if (array[i] == '।' && array[i + 1] == '\u093c')
+ {
+ array[i] = 'ऽ';
+ array[i + 1] = '\0';
+ flag = true;
+ }
+ }
+ }
+ if (!flag)
+ {
+ return text;
+ }
+ string text2 = new string(array.Where((char x) => x != '\0').ToArray());
+ if (text2 == text)
+ {
+ return text2;
+ }
+ text = text2;
+ return text;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/I2BasePersistentStorage.cs b/Thronefall_v1.57/Thronefall/I2.Loc/I2BasePersistentStorage.cs
new file mode 100644
index 0000000..bd4a52c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/I2BasePersistentStorage.cs
@@ -0,0 +1,197 @@
+using System;
+using System.Globalization;
+using System.IO;
+using System.Text;
+using UnityEngine;
+
+namespace I2.Loc;
+
+public abstract class I2BasePersistentStorage
+{
+ public virtual void SetSetting_String(string key, string value)
+ {
+ try
+ {
+ int length = value.Length;
+ int num = 8000;
+ if (length <= num)
+ {
+ PlayerPrefs.SetString(key, value);
+ return;
+ }
+ int num2 = Mathf.CeilToInt((float)length / (float)num);
+ for (int i = 0; i < num2; i++)
+ {
+ int num3 = num * i;
+ PlayerPrefs.SetString($"[I2split]{i}{key}", value.Substring(num3, Mathf.Min(num, length - num3)));
+ }
+ PlayerPrefs.SetString(key, "[$I2#@div$]" + num2);
+ }
+ catch (Exception)
+ {
+ Debug.LogError("Error saving PlayerPrefs " + key);
+ }
+ }
+
+ public virtual string GetSetting_String(string key, string defaultValue)
+ {
+ try
+ {
+ string text = PlayerPrefs.GetString(key, defaultValue);
+ if (!string.IsNullOrEmpty(text) && text.StartsWith("[I2split]", StringComparison.Ordinal))
+ {
+ int num = int.Parse(text.Substring("[I2split]".Length), CultureInfo.InvariantCulture);
+ text = "";
+ for (int i = 0; i < num; i++)
+ {
+ text += PlayerPrefs.GetString($"[I2split]{i}{key}", "");
+ }
+ }
+ return text;
+ }
+ catch (Exception)
+ {
+ Debug.LogError("Error loading PlayerPrefs " + key);
+ return defaultValue;
+ }
+ }
+
+ public virtual void DeleteSetting(string key)
+ {
+ try
+ {
+ string @string = PlayerPrefs.GetString(key, null);
+ if (!string.IsNullOrEmpty(@string) && @string.StartsWith("[I2split]", StringComparison.Ordinal))
+ {
+ int num = int.Parse(@string.Substring("[I2split]".Length), CultureInfo.InvariantCulture);
+ for (int i = 0; i < num; i++)
+ {
+ PlayerPrefs.DeleteKey($"[I2split]{i}{key}");
+ }
+ }
+ PlayerPrefs.DeleteKey(key);
+ }
+ catch (Exception)
+ {
+ Debug.LogError("Error deleting PlayerPrefs " + key);
+ }
+ }
+
+ public virtual void ForceSaveSettings()
+ {
+ PlayerPrefs.Save();
+ }
+
+ public virtual bool HasSetting(string key)
+ {
+ return PlayerPrefs.HasKey(key);
+ }
+
+ public virtual bool CanAccessFiles()
+ {
+ return true;
+ }
+
+ private string UpdateFilename(PersistentStorage.eFileType fileType, string fileName)
+ {
+ switch (fileType)
+ {
+ case PersistentStorage.eFileType.Persistent:
+ fileName = Application.persistentDataPath + "/" + fileName;
+ break;
+ case PersistentStorage.eFileType.Temporal:
+ fileName = Application.temporaryCachePath + "/" + fileName;
+ break;
+ case PersistentStorage.eFileType.Streaming:
+ fileName = Application.streamingAssetsPath + "/" + fileName;
+ break;
+ }
+ return fileName;
+ }
+
+ public virtual bool SaveFile(PersistentStorage.eFileType fileType, string fileName, string data, bool logExceptions = true)
+ {
+ if (!CanAccessFiles())
+ {
+ return false;
+ }
+ try
+ {
+ fileName = UpdateFilename(fileType, fileName);
+ File.WriteAllText(fileName, data, Encoding.UTF8);
+ return true;
+ }
+ catch (Exception ex)
+ {
+ if (logExceptions)
+ {
+ Debug.LogError("Error saving file '" + fileName + "'\n" + ex);
+ }
+ return false;
+ }
+ }
+
+ public virtual string LoadFile(PersistentStorage.eFileType fileType, string fileName, bool logExceptions = true)
+ {
+ if (!CanAccessFiles())
+ {
+ return null;
+ }
+ try
+ {
+ fileName = UpdateFilename(fileType, fileName);
+ return File.ReadAllText(fileName, Encoding.UTF8);
+ }
+ catch (Exception ex)
+ {
+ if (logExceptions)
+ {
+ Debug.LogError("Error loading file '" + fileName + "'\n" + ex);
+ }
+ return null;
+ }
+ }
+
+ public virtual bool DeleteFile(PersistentStorage.eFileType fileType, string fileName, bool logExceptions = true)
+ {
+ if (!CanAccessFiles())
+ {
+ return false;
+ }
+ try
+ {
+ fileName = UpdateFilename(fileType, fileName);
+ File.Delete(fileName);
+ return true;
+ }
+ catch (Exception ex)
+ {
+ if (logExceptions)
+ {
+ Debug.LogError("Error deleting file '" + fileName + "'\n" + ex);
+ }
+ return false;
+ }
+ }
+
+ public virtual bool HasFile(PersistentStorage.eFileType fileType, string fileName, bool logExceptions = true)
+ {
+ if (!CanAccessFiles())
+ {
+ return false;
+ }
+ try
+ {
+ fileName = UpdateFilename(fileType, fileName);
+ return File.Exists(fileName);
+ }
+ catch (Exception ex)
+ {
+ if (logExceptions)
+ {
+ Debug.LogError("Error requesting file '" + fileName + "'\n" + ex);
+ }
+ return false;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/I2CustomPersistentStorage.cs b/Thronefall_v1.57/Thronefall/I2.Loc/I2CustomPersistentStorage.cs
new file mode 100644
index 0000000..f518316
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/I2CustomPersistentStorage.cs
@@ -0,0 +1,5 @@
+namespace I2.Loc;
+
+public class I2CustomPersistentStorage : I2BasePersistentStorage
+{
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/I2Utils.cs b/Thronefall_v1.57/Thronefall/I2.Loc/I2Utils.cs
new file mode 100644
index 0000000..a60bb8e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/I2Utils.cs
@@ -0,0 +1,301 @@
+using System;
+using System.IO;
+using System.Linq;
+using System.Text.RegularExpressions;
+using UnityEngine;
+using UnityEngine.Networking;
+using UnityEngine.SceneManagement;
+
+namespace I2.Loc;
+
+public static class I2Utils
+{
+ public const string ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
+
+ public const string NumberChars = "0123456789";
+
+ public const string ValidNameSymbols = ".-_$#@*()[]{}+:?!&',^=<>~`";
+
+ public static string ReverseText(string source)
+ {
+ int length = source.Length;
+ char[] output = new char[length];
+ char[] anyOf = new char[2] { '\r', '\n' };
+ int i = 0;
+ while (i < length)
+ {
+ int num = source.IndexOfAny(anyOf, i);
+ if (num < 0)
+ {
+ num = length;
+ }
+ Reverse(i, num - 1);
+ for (i = num; i < length && (source[i] == '\r' || source[i] == '\n'); i++)
+ {
+ output[i] = source[i];
+ }
+ }
+ return new string(output);
+ void Reverse(int start, int end)
+ {
+ for (int j = 0; j <= end - start; j++)
+ {
+ output[end - j] = source[start + j];
+ }
+ }
+ }
+
+ public static string RemoveNonASCII(string text, bool allowCategory = false)
+ {
+ if (string.IsNullOrEmpty(text))
+ {
+ return text;
+ }
+ int num = 0;
+ char[] array = new char[text.Length];
+ bool flag = false;
+ string text2 = text.Trim();
+ foreach (char c in text2)
+ {
+ char c2 = ' ';
+ if ((allowCategory && (c == '\\' || c == '"' || c == '/')) || char.IsLetterOrDigit(c) || ".-_$#@*()[]{}+:?!&',^=<>~`".IndexOf(c) >= 0)
+ {
+ c2 = c;
+ }
+ if (char.IsWhiteSpace(c2))
+ {
+ if (!flag)
+ {
+ if (num > 0)
+ {
+ array[num++] = ' ';
+ }
+ flag = true;
+ }
+ }
+ else
+ {
+ flag = false;
+ array[num++] = c2;
+ }
+ }
+ return new string(array, 0, num);
+ }
+
+ public static string GetValidTermName(string text, bool allowCategory = false)
+ {
+ if (text == null)
+ {
+ return null;
+ }
+ text = RemoveTags(text);
+ return RemoveNonASCII(text, allowCategory);
+ }
+
+ public static string SplitLine(string line, int maxCharacters)
+ {
+ if (maxCharacters <= 0 || line.Length < maxCharacters)
+ {
+ return line;
+ }
+ char[] array = line.ToCharArray();
+ bool flag = true;
+ bool flag2 = false;
+ int i = 0;
+ int num = 0;
+ for (; i < array.Length; i++)
+ {
+ if (flag)
+ {
+ num++;
+ if (array[i] == '\n')
+ {
+ num = 0;
+ }
+ if (num >= maxCharacters && char.IsWhiteSpace(array[i]))
+ {
+ array[i] = '\n';
+ flag = false;
+ flag2 = false;
+ }
+ }
+ else if (!char.IsWhiteSpace(array[i]))
+ {
+ flag = true;
+ num = 0;
+ }
+ else if (array[i] != '\n')
+ {
+ array[i] = '\0';
+ }
+ else
+ {
+ if (!flag2)
+ {
+ array[i] = '\0';
+ }
+ flag2 = true;
+ }
+ }
+ return new string(array.Where((char c) => c != '\0').ToArray());
+ }
+
+ public static bool FindNextTag(string line, int iStart, out int tagStart, out int tagEnd)
+ {
+ tagStart = -1;
+ tagEnd = -1;
+ int length = line.Length;
+ tagStart = iStart;
+ while (tagStart < length && line[tagStart] != '[' && line[tagStart] != '(' && line[tagStart] != '{' && line[tagStart] != '<')
+ {
+ tagStart++;
+ }
+ if (tagStart == length)
+ {
+ return false;
+ }
+ bool flag = false;
+ for (tagEnd = tagStart + 1; tagEnd < length; tagEnd++)
+ {
+ char c = line[tagEnd];
+ if (c == ']' || c == ')' || c == '}' || c == '>')
+ {
+ if (flag)
+ {
+ return FindNextTag(line, tagEnd + 1, out tagStart, out tagEnd);
+ }
+ return true;
+ }
+ if (c > 'ÿ')
+ {
+ flag = true;
+ }
+ }
+ return false;
+ }
+
+ public static string RemoveTags(string text)
+ {
+ return Regex.Replace(text, "\\{\\[(.*?)]}|\\[(.*?)]|\\<(.*?)>", "");
+ }
+
+ public static bool RemoveResourcesPath(ref string sPath)
+ {
+ int num = sPath.IndexOf("\\Resources\\", StringComparison.Ordinal);
+ int num2 = sPath.IndexOf("\\Resources/", StringComparison.Ordinal);
+ int num3 = sPath.IndexOf("/Resources\\", StringComparison.Ordinal);
+ int num4 = sPath.IndexOf("/Resources/", StringComparison.Ordinal);
+ int num5 = Mathf.Max(num, num2, num3, num4);
+ bool result = false;
+ if (num5 >= 0)
+ {
+ sPath = sPath.Substring(num5 + 11);
+ result = true;
+ }
+ else
+ {
+ num5 = sPath.LastIndexOfAny(LanguageSourceData.CategorySeparators);
+ if (num5 > 0)
+ {
+ sPath = sPath.Substring(num5 + 1);
+ }
+ }
+ string extension = Path.GetExtension(sPath);
+ if (!string.IsNullOrEmpty(extension))
+ {
+ sPath = sPath.Substring(0, sPath.Length - extension.Length);
+ }
+ return result;
+ }
+
+ public static bool IsPlaying()
+ {
+ if (Application.isPlaying)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ public static string GetPath(this Transform tr)
+ {
+ Transform parent = tr.parent;
+ if (tr == null)
+ {
+ return tr.name;
+ }
+ return parent.GetPath() + "/" + tr.name;
+ }
+
+ public static Transform FindObject(string objectPath)
+ {
+ return FindObject(SceneManager.GetActiveScene(), objectPath);
+ }
+
+ public static Transform FindObject(Scene scene, string objectPath)
+ {
+ GameObject[] rootGameObjects = scene.GetRootGameObjects();
+ for (int i = 0; i < rootGameObjects.Length; i++)
+ {
+ Transform transform = rootGameObjects[i].transform;
+ if (transform.name == objectPath)
+ {
+ return transform;
+ }
+ if (objectPath.StartsWith(transform.name + "/", StringComparison.Ordinal))
+ {
+ return FindObject(transform, objectPath.Substring(transform.name.Length + 1));
+ }
+ }
+ return null;
+ }
+
+ public static Transform FindObject(Transform root, string objectPath)
+ {
+ for (int i = 0; i < root.childCount; i++)
+ {
+ Transform child = root.GetChild(i);
+ if (child.name == objectPath)
+ {
+ return child;
+ }
+ if (objectPath.StartsWith(child.name + "/", StringComparison.Ordinal))
+ {
+ return FindObject(child, objectPath.Substring(child.name.Length + 1));
+ }
+ }
+ return null;
+ }
+
+ public static H FindInParents<H>(Transform tr) where H : Component
+ {
+ if (!tr)
+ {
+ return null;
+ }
+ H component = tr.GetComponent<H>();
+ while (!(UnityEngine.Object)component && (bool)tr)
+ {
+ component = tr.GetComponent<H>();
+ tr = tr.parent;
+ }
+ return component;
+ }
+
+ public static string GetCaptureMatch(Match match)
+ {
+ for (int num = match.Groups.Count - 1; num >= 0; num--)
+ {
+ if (match.Groups[num].Success)
+ {
+ return match.Groups[num].ToString();
+ }
+ }
+ return match.ToString();
+ }
+
+ public static void SendWebRequest(UnityWebRequest www)
+ {
+ www.SendWebRequest();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/ILanguageSource.cs b/Thronefall_v1.57/Thronefall/I2.Loc/ILanguageSource.cs
new file mode 100644
index 0000000..7717e4d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/ILanguageSource.cs
@@ -0,0 +1,6 @@
+namespace I2.Loc;
+
+public interface ILanguageSource
+{
+ LanguageSourceData SourceData { get; set; }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/ILocalizationParamsManager.cs b/Thronefall_v1.57/Thronefall/I2.Loc/ILocalizationParamsManager.cs
new file mode 100644
index 0000000..c96bd20
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/ILocalizationParamsManager.cs
@@ -0,0 +1,6 @@
+namespace I2.Loc;
+
+public interface ILocalizationParamsManager
+{
+ string GetParameterValue(string Param);
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/ILocalizeTarget.cs b/Thronefall_v1.57/Thronefall/I2.Loc/ILocalizeTarget.cs
new file mode 100644
index 0000000..2d8c155
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/ILocalizeTarget.cs
@@ -0,0 +1,22 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public abstract class ILocalizeTarget : ScriptableObject
+{
+ public abstract bool IsValid(Localize cmp);
+
+ public abstract void GetFinalTerms(Localize cmp, string Main, string Secondary, out string primaryTerm, out string secondaryTerm);
+
+ public abstract void DoLocalize(Localize cmp, string mainTranslation, string secondaryTranslation);
+
+ public abstract bool CanUseSecondaryTerm();
+
+ public abstract bool AllowMainTermToBeRTL();
+
+ public abstract bool AllowSecondTermToBeRTL();
+
+ public abstract eTermType GetPrimaryTermType(Localize cmp);
+
+ public abstract eTermType GetSecondaryTermType(Localize cmp);
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/ILocalizeTargetDescriptor.cs b/Thronefall_v1.57/Thronefall/I2.Loc/ILocalizeTargetDescriptor.cs
new file mode 100644
index 0000000..0b807cd
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/ILocalizeTargetDescriptor.cs
@@ -0,0 +1,16 @@
+using System;
+
+namespace I2.Loc;
+
+public abstract class ILocalizeTargetDescriptor
+{
+ public string Name;
+
+ public int Priority;
+
+ public abstract bool CanLocalize(Localize cmp);
+
+ public abstract ILocalizeTarget CreateTarget(Localize cmp);
+
+ public abstract Type GetTargetType();
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/IResourceManager_Bundles.cs b/Thronefall_v1.57/Thronefall/I2.Loc/IResourceManager_Bundles.cs
new file mode 100644
index 0000000..1ba81a2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/IResourceManager_Bundles.cs
@@ -0,0 +1,9 @@
+using System;
+using UnityEngine;
+
+namespace I2.Loc;
+
+public interface IResourceManager_Bundles
+{
+ UnityEngine.Object LoadFromBundle(string path, Type assetType);
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/IsolatedArabicLetters.cs b/Thronefall_v1.57/Thronefall/I2.Loc/IsolatedArabicLetters.cs
new file mode 100644
index 0000000..93a8938
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/IsolatedArabicLetters.cs
@@ -0,0 +1,46 @@
+namespace I2.Loc;
+
+internal enum IsolatedArabicLetters
+{
+ Hamza = 65152,
+ Alef = 65165,
+ AlefHamza = 65155,
+ WawHamza = 65157,
+ AlefMaksoor = 65159,
+ AlefMaksora = 64508,
+ HamzaNabera = 65161,
+ Ba = 65167,
+ Ta = 65173,
+ Tha2 = 65177,
+ Jeem = 65181,
+ H7aa = 65185,
+ Khaa2 = 65189,
+ Dal = 65193,
+ Thal = 65195,
+ Ra2 = 65197,
+ Zeen = 65199,
+ Seen = 65201,
+ Sheen = 65205,
+ S9a = 65209,
+ Dha = 65213,
+ T6a = 65217,
+ T6ha = 65221,
+ Ain = 65225,
+ Gain = 65229,
+ Fa = 65233,
+ Gaf = 65237,
+ Kaf = 65241,
+ Lam = 65245,
+ Meem = 65249,
+ Noon = 65253,
+ Ha = 65257,
+ Waw = 65261,
+ Ya = 65265,
+ AlefMad = 65153,
+ TaMarboota = 65171,
+ PersianPe = 64342,
+ PersianChe = 64378,
+ PersianZe = 64394,
+ PersianGaf = 64402,
+ PersianGaf2 = 64398
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LanguageData.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LanguageData.cs
new file mode 100644
index 0000000..566d28a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LanguageData.cs
@@ -0,0 +1,67 @@
+using System;
+
+namespace I2.Loc;
+
+[Serializable]
+public class LanguageData
+{
+ public string Name;
+
+ public string Code;
+
+ public byte Flags;
+
+ [NonSerialized]
+ public bool Compressed;
+
+ public bool IsEnabled()
+ {
+ return (Flags & 1) == 0;
+ }
+
+ public void SetEnabled(bool bEnabled)
+ {
+ if (bEnabled)
+ {
+ Flags = (byte)(Flags & 0xFFFFFFFEu);
+ }
+ else
+ {
+ Flags |= 1;
+ }
+ }
+
+ public bool IsLoaded()
+ {
+ return (Flags & 4) == 0;
+ }
+
+ public bool CanBeUnloaded()
+ {
+ return (Flags & 2) == 0;
+ }
+
+ public void SetLoaded(bool loaded)
+ {
+ if (loaded)
+ {
+ Flags = (byte)(Flags & 0xFFFFFFFBu);
+ }
+ else
+ {
+ Flags |= 4;
+ }
+ }
+
+ public void SetCanBeUnLoaded(bool allowUnloading)
+ {
+ if (allowUnloading)
+ {
+ Flags = (byte)(Flags & 0xFFFFFFFDu);
+ }
+ else
+ {
+ Flags |= 2;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LanguageSource.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LanguageSource.cs
new file mode 100644
index 0000000..15023e7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LanguageSource.cs
@@ -0,0 +1,145 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace I2.Loc;
+
+[AddComponentMenu("I2/Localization/Source")]
+[ExecuteInEditMode]
+public class LanguageSource : MonoBehaviour, ISerializationCallbackReceiver, ILanguageSource
+{
+ public delegate void fnOnSourceUpdated(LanguageSourceData source, bool ReceivedNewData, string errorMsg);
+
+ public LanguageSourceData mSource = new LanguageSourceData();
+
+ public int version;
+
+ public bool NeverDestroy;
+
+ public bool UserAgreesToHaveItOnTheScene;
+
+ public bool UserAgreesToHaveItInsideThePluginsFolder;
+
+ public bool GoogleLiveSyncIsUptoDate = true;
+
+ public List<Object> Assets = new List<Object>();
+
+ public string Google_WebServiceURL;
+
+ public string Google_SpreadsheetKey;
+
+ public string Google_SpreadsheetName;
+
+ public string Google_LastUpdatedVersion;
+
+ public LanguageSourceData.eGoogleUpdateFrequency GoogleUpdateFrequency = LanguageSourceData.eGoogleUpdateFrequency.Weekly;
+
+ public float GoogleUpdateDelay = 5f;
+
+ public List<LanguageData> mLanguages = new List<LanguageData>();
+
+ public bool IgnoreDeviceLanguage;
+
+ public LanguageSourceData.eAllowUnloadLanguages _AllowUnloadingLanguages;
+
+ public List<TermData> mTerms = new List<TermData>();
+
+ public bool CaseInsensitiveTerms;
+
+ public LanguageSourceData.MissingTranslationAction OnMissingTranslation = LanguageSourceData.MissingTranslationAction.Fallback;
+
+ public string mTerm_AppName;
+
+ public LanguageSourceData SourceData
+ {
+ get
+ {
+ return mSource;
+ }
+ set
+ {
+ mSource = value;
+ }
+ }
+
+ public event fnOnSourceUpdated Event_OnSourceUpdateFromGoogle;
+
+ private void Awake()
+ {
+ mSource.owner = this;
+ mSource.Awake();
+ }
+
+ private void OnDestroy()
+ {
+ NeverDestroy = false;
+ if (!NeverDestroy)
+ {
+ mSource.OnDestroy();
+ }
+ }
+
+ public string GetSourceName()
+ {
+ string text = base.gameObject.name;
+ Transform parent = base.transform.parent;
+ while ((bool)parent)
+ {
+ text = parent.name + "_" + text;
+ parent = parent.parent;
+ }
+ return text;
+ }
+
+ public void OnBeforeSerialize()
+ {
+ version = 1;
+ }
+
+ public void OnAfterDeserialize()
+ {
+ if (version != 0 && mSource != null)
+ {
+ return;
+ }
+ mSource = new LanguageSourceData();
+ mSource.owner = this;
+ mSource.UserAgreesToHaveItOnTheScene = UserAgreesToHaveItOnTheScene;
+ mSource.UserAgreesToHaveItInsideThePluginsFolder = UserAgreesToHaveItInsideThePluginsFolder;
+ mSource.IgnoreDeviceLanguage = IgnoreDeviceLanguage;
+ mSource._AllowUnloadingLanguages = _AllowUnloadingLanguages;
+ mSource.CaseInsensitiveTerms = CaseInsensitiveTerms;
+ mSource.OnMissingTranslation = OnMissingTranslation;
+ mSource.mTerm_AppName = mTerm_AppName;
+ mSource.GoogleLiveSyncIsUptoDate = GoogleLiveSyncIsUptoDate;
+ mSource.Google_WebServiceURL = Google_WebServiceURL;
+ mSource.Google_SpreadsheetKey = Google_SpreadsheetKey;
+ mSource.Google_SpreadsheetName = Google_SpreadsheetName;
+ mSource.Google_LastUpdatedVersion = Google_LastUpdatedVersion;
+ mSource.GoogleUpdateFrequency = GoogleUpdateFrequency;
+ mSource.GoogleUpdateDelay = GoogleUpdateDelay;
+ mSource.Event_OnSourceUpdateFromGoogle += this.Event_OnSourceUpdateFromGoogle;
+ if (mLanguages != null && mLanguages.Count > 0)
+ {
+ mSource.mLanguages.Clear();
+ mSource.mLanguages.AddRange(mLanguages);
+ mLanguages.Clear();
+ }
+ if (Assets != null && Assets.Count > 0)
+ {
+ mSource.Assets.Clear();
+ mSource.Assets.AddRange(Assets);
+ Assets.Clear();
+ }
+ if (mTerms != null && mTerms.Count > 0)
+ {
+ mSource.mTerms.Clear();
+ for (int i = 0; i < mTerms.Count; i++)
+ {
+ mSource.mTerms.Add(mTerms[i]);
+ }
+ mTerms.Clear();
+ }
+ version = 1;
+ this.Event_OnSourceUpdateFromGoogle = null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LanguageSourceAsset.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LanguageSourceAsset.cs
new file mode 100644
index 0000000..5c4e9b6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LanguageSourceAsset.cs
@@ -0,0 +1,21 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+[CreateAssetMenu(fileName = "I2Languages", menuName = "I2 Localization/LanguageSource", order = 1)]
+public class LanguageSourceAsset : ScriptableObject, ILanguageSource
+{
+ public LanguageSourceData mSource = new LanguageSourceData();
+
+ public LanguageSourceData SourceData
+ {
+ get
+ {
+ return mSource;
+ }
+ set
+ {
+ mSource = value;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LanguageSourceData.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LanguageSourceData.cs
new file mode 100644
index 0000000..47646f7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LanguageSourceData.cs
@@ -0,0 +1,1661 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using UnityEngine;
+using UnityEngine.Networking;
+using UnityEngine.SceneManagement;
+
+namespace I2.Loc;
+
+[Serializable]
+[ExecuteInEditMode]
+public class LanguageSourceData
+{
+ public enum MissingTranslationAction
+ {
+ Empty,
+ Fallback,
+ ShowWarning,
+ ShowTerm
+ }
+
+ public enum eAllowUnloadLanguages
+ {
+ Never,
+ OnlyInDevice,
+ EditorAndDevice
+ }
+
+ public enum eGoogleUpdateFrequency
+ {
+ Always,
+ Never,
+ Daily,
+ Weekly,
+ Monthly,
+ OnlyOnce,
+ EveryOtherDay
+ }
+
+ public enum eGoogleUpdateSynchronization
+ {
+ Manual,
+ OnSceneLoaded,
+ AsSoonAsDownloaded
+ }
+
+ [NonSerialized]
+ public ILanguageSource owner;
+
+ public bool UserAgreesToHaveItOnTheScene;
+
+ public bool UserAgreesToHaveItInsideThePluginsFolder;
+
+ public bool GoogleLiveSyncIsUptoDate = true;
+
+ [NonSerialized]
+ public bool mIsGlobalSource;
+
+ public List<TermData> mTerms = new List<TermData>();
+
+ public bool CaseInsensitiveTerms;
+
+ [NonSerialized]
+ public Dictionary<string, TermData> mDictionary = new Dictionary<string, TermData>(StringComparer.Ordinal);
+
+ public MissingTranslationAction OnMissingTranslation = MissingTranslationAction.Fallback;
+
+ public string mTerm_AppName;
+
+ public List<LanguageData> mLanguages = new List<LanguageData>();
+
+ public bool IgnoreDeviceLanguage;
+
+ public eAllowUnloadLanguages _AllowUnloadingLanguages;
+
+ public string Google_WebServiceURL;
+
+ public string Google_SpreadsheetKey;
+
+ public string Google_SpreadsheetName;
+
+ public string Google_LastUpdatedVersion;
+
+ public eGoogleUpdateFrequency GoogleUpdateFrequency = eGoogleUpdateFrequency.Weekly;
+
+ public eGoogleUpdateFrequency GoogleInEditorCheckFrequency = eGoogleUpdateFrequency.Daily;
+
+ public eGoogleUpdateSynchronization GoogleUpdateSynchronization = eGoogleUpdateSynchronization.OnSceneLoaded;
+
+ public float GoogleUpdateDelay;
+
+ public List<UnityEngine.Object> Assets = new List<UnityEngine.Object>();
+
+ [NonSerialized]
+ public Dictionary<string, UnityEngine.Object> mAssetDictionary = new Dictionary<string, UnityEngine.Object>(StringComparer.Ordinal);
+
+ private string mDelayedGoogleData;
+
+ public static string EmptyCategory = "Default";
+
+ public static char[] CategorySeparators = "/\\".ToCharArray();
+
+ public UnityEngine.Object ownerObject => owner as UnityEngine.Object;
+
+ public event LanguageSource.fnOnSourceUpdated Event_OnSourceUpdateFromGoogle;
+
+ public void Awake()
+ {
+ LocalizationManager.AddSource(this);
+ UpdateDictionary();
+ UpdateAssetDictionary();
+ LocalizationManager.LocalizeAll(Force: true);
+ }
+
+ public void OnDestroy()
+ {
+ LocalizationManager.RemoveSource(this);
+ }
+
+ public bool IsEqualTo(LanguageSourceData Source)
+ {
+ if (Source.mLanguages.Count != mLanguages.Count)
+ {
+ return false;
+ }
+ int i = 0;
+ for (int count = mLanguages.Count; i < count; i++)
+ {
+ if (Source.GetLanguageIndex(mLanguages[i].Name) < 0)
+ {
+ return false;
+ }
+ }
+ if (Source.mTerms.Count != mTerms.Count)
+ {
+ return false;
+ }
+ for (int j = 0; j < mTerms.Count; j++)
+ {
+ if (Source.GetTermData(mTerms[j].Term) == null)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ internal bool ManagerHasASimilarSource()
+ {
+ int i = 0;
+ for (int count = LocalizationManager.Sources.Count; i < count; i++)
+ {
+ LanguageSourceData languageSourceData = LocalizationManager.Sources[i];
+ if (languageSourceData != null && languageSourceData.IsEqualTo(this) && languageSourceData != this)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void ClearAllData()
+ {
+ mTerms.Clear();
+ mLanguages.Clear();
+ mDictionary.Clear();
+ mAssetDictionary.Clear();
+ }
+
+ public bool IsGlobalSource()
+ {
+ return mIsGlobalSource;
+ }
+
+ public void Editor_SetDirty()
+ {
+ }
+
+ public void UpdateAssetDictionary()
+ {
+ Assets.RemoveAll((UnityEngine.Object x) => x == null);
+ mAssetDictionary = Assets.Distinct().GroupBy((UnityEngine.Object o) => o.name, StringComparer.Ordinal).ToDictionary((IGrouping<string, UnityEngine.Object> g) => g.Key, (IGrouping<string, UnityEngine.Object> g) => g.First(), StringComparer.Ordinal);
+ }
+
+ public UnityEngine.Object FindAsset(string Name)
+ {
+ if (Assets != null)
+ {
+ if (mAssetDictionary == null || mAssetDictionary.Count != Assets.Count)
+ {
+ UpdateAssetDictionary();
+ }
+ if (mAssetDictionary.TryGetValue(Name, out var value))
+ {
+ return value;
+ }
+ }
+ return null;
+ }
+
+ public bool HasAsset(UnityEngine.Object Obj)
+ {
+ return Assets.Contains(Obj);
+ }
+
+ public void AddAsset(UnityEngine.Object Obj)
+ {
+ if (!Assets.Contains(Obj))
+ {
+ Assets.Add(Obj);
+ UpdateAssetDictionary();
+ }
+ }
+
+ private string Export_Language_to_Cache(int langIndex, bool fillTermWithFallback)
+ {
+ if (!mLanguages[langIndex].IsLoaded())
+ {
+ return null;
+ }
+ StringBuilder stringBuilder = new StringBuilder();
+ for (int i = 0; i < mTerms.Count; i++)
+ {
+ if (i > 0)
+ {
+ stringBuilder.Append("[i2t]");
+ }
+ TermData termData = mTerms[i];
+ stringBuilder.Append(termData.Term);
+ stringBuilder.Append("=");
+ string Translation = termData.Languages[langIndex];
+ if (OnMissingTranslation == MissingTranslationAction.Fallback && string.IsNullOrEmpty(Translation) && TryGetFallbackTranslation(termData, out Translation, langIndex, null, skipDisabled: true))
+ {
+ stringBuilder.Append("[i2fb]");
+ if (fillTermWithFallback)
+ {
+ termData.Languages[langIndex] = Translation;
+ }
+ }
+ if (!string.IsNullOrEmpty(Translation))
+ {
+ stringBuilder.Append(Translation);
+ }
+ }
+ return stringBuilder.ToString();
+ }
+
+ public string Export_I2CSV(string Category, char Separator = ',', bool specializationsAsRows = true)
+ {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.Append("Key[*]Type[*]Desc");
+ foreach (LanguageData mLanguage in mLanguages)
+ {
+ stringBuilder.Append("[*]");
+ if (!mLanguage.IsEnabled())
+ {
+ stringBuilder.Append('$');
+ }
+ stringBuilder.Append(GoogleLanguages.GetCodedLanguage(mLanguage.Name, mLanguage.Code));
+ }
+ stringBuilder.Append("[ln]");
+ mTerms.Sort((TermData a, TermData b) => string.CompareOrdinal(a.Term, b.Term));
+ int count = mLanguages.Count;
+ bool flag = true;
+ foreach (TermData mTerm in mTerms)
+ {
+ string term;
+ if (string.IsNullOrEmpty(Category) || (Category == EmptyCategory && mTerm.Term.IndexOfAny(CategorySeparators) < 0))
+ {
+ term = mTerm.Term;
+ }
+ else
+ {
+ if (!mTerm.Term.StartsWith(Category + "/", StringComparison.Ordinal) || !(Category != mTerm.Term))
+ {
+ continue;
+ }
+ term = mTerm.Term.Substring(Category.Length + 1);
+ }
+ if (!flag)
+ {
+ stringBuilder.Append("[ln]");
+ }
+ flag = false;
+ if (!specializationsAsRows)
+ {
+ AppendI2Term(stringBuilder, count, term, mTerm, Separator, null);
+ continue;
+ }
+ List<string> allSpecializations = mTerm.GetAllSpecializations();
+ for (int i = 0; i < allSpecializations.Count; i++)
+ {
+ if (i != 0)
+ {
+ stringBuilder.Append("[ln]");
+ }
+ string forceSpecialization = allSpecializations[i];
+ AppendI2Term(stringBuilder, count, term, mTerm, Separator, forceSpecialization);
+ }
+ }
+ return stringBuilder.ToString();
+ }
+
+ private static void AppendI2Term(StringBuilder Builder, int nLanguages, string Term, TermData termData, char Separator, string forceSpecialization)
+ {
+ AppendI2Text(Builder, Term);
+ if (!string.IsNullOrEmpty(forceSpecialization) && forceSpecialization != "Any")
+ {
+ Builder.Append("[");
+ Builder.Append(forceSpecialization);
+ Builder.Append("]");
+ }
+ Builder.Append("[*]");
+ Builder.Append(termData.TermType.ToString());
+ Builder.Append("[*]");
+ Builder.Append(termData.Description);
+ for (int i = 0; i < Mathf.Min(nLanguages, termData.Languages.Length); i++)
+ {
+ Builder.Append("[*]");
+ string text = termData.Languages[i];
+ if (!string.IsNullOrEmpty(forceSpecialization))
+ {
+ text = termData.GetTranslation(i, forceSpecialization);
+ }
+ AppendI2Text(Builder, text);
+ }
+ }
+
+ private static void AppendI2Text(StringBuilder Builder, string text)
+ {
+ if (!string.IsNullOrEmpty(text))
+ {
+ if (text.StartsWith("'", StringComparison.Ordinal) || text.StartsWith("=", StringComparison.Ordinal))
+ {
+ Builder.Append('\'');
+ }
+ Builder.Append(text);
+ }
+ }
+
+ public string Export_CSV(string Category, char Separator = ',', bool specializationsAsRows = true)
+ {
+ StringBuilder stringBuilder = new StringBuilder();
+ int count = mLanguages.Count;
+ stringBuilder.AppendFormat("Key{0}Type{0}Desc", Separator);
+ foreach (LanguageData mLanguage in mLanguages)
+ {
+ stringBuilder.Append(Separator);
+ if (!mLanguage.IsEnabled())
+ {
+ stringBuilder.Append('$');
+ }
+ AppendString(stringBuilder, GoogleLanguages.GetCodedLanguage(mLanguage.Name, mLanguage.Code), Separator);
+ }
+ stringBuilder.Append("\n");
+ mTerms.Sort((TermData a, TermData b) => string.CompareOrdinal(a.Term, b.Term));
+ foreach (TermData mTerm in mTerms)
+ {
+ string term;
+ if (string.IsNullOrEmpty(Category) || (Category == EmptyCategory && mTerm.Term.IndexOfAny(CategorySeparators) < 0))
+ {
+ term = mTerm.Term;
+ }
+ else
+ {
+ if (!mTerm.Term.StartsWith(Category + "/", StringComparison.Ordinal) || !(Category != mTerm.Term))
+ {
+ continue;
+ }
+ term = mTerm.Term.Substring(Category.Length + 1);
+ }
+ if (specializationsAsRows)
+ {
+ foreach (string allSpecialization in mTerm.GetAllSpecializations())
+ {
+ AppendTerm(stringBuilder, count, term, mTerm, allSpecialization, Separator);
+ }
+ }
+ else
+ {
+ AppendTerm(stringBuilder, count, term, mTerm, null, Separator);
+ }
+ }
+ return stringBuilder.ToString();
+ }
+
+ private static void AppendTerm(StringBuilder Builder, int nLanguages, string Term, TermData termData, string specialization, char Separator)
+ {
+ AppendString(Builder, Term, Separator);
+ if (!string.IsNullOrEmpty(specialization) && specialization != "Any")
+ {
+ Builder.AppendFormat("[{0}]", specialization);
+ }
+ Builder.Append(Separator);
+ Builder.Append(termData.TermType.ToString());
+ Builder.Append(Separator);
+ AppendString(Builder, termData.Description, Separator);
+ for (int i = 0; i < Mathf.Min(nLanguages, termData.Languages.Length); i++)
+ {
+ Builder.Append(Separator);
+ string text = termData.Languages[i];
+ if (!string.IsNullOrEmpty(specialization))
+ {
+ text = termData.GetTranslation(i, specialization);
+ }
+ AppendTranslation(Builder, text, Separator, null);
+ }
+ Builder.Append("\n");
+ }
+
+ private static void AppendString(StringBuilder Builder, string Text, char Separator)
+ {
+ if (!string.IsNullOrEmpty(Text))
+ {
+ Text = Text.Replace("\\n", "\n");
+ if (Text.IndexOfAny((Separator + "\n\"").ToCharArray()) >= 0)
+ {
+ Text = Text.Replace("\"", "\"\"");
+ Builder.AppendFormat("\"{0}\"", Text);
+ }
+ else
+ {
+ Builder.Append(Text);
+ }
+ }
+ }
+
+ private static void AppendTranslation(StringBuilder Builder, string Text, char Separator, string tags)
+ {
+ if (!string.IsNullOrEmpty(Text))
+ {
+ Text = Text.Replace("\\n", "\n");
+ if (Text.IndexOfAny((Separator + "\n\"").ToCharArray()) >= 0)
+ {
+ Text = Text.Replace("\"", "\"\"");
+ Builder.AppendFormat("\"{0}{1}\"", tags, Text);
+ }
+ else
+ {
+ Builder.Append(tags);
+ Builder.Append(Text);
+ }
+ }
+ }
+
+ public UnityWebRequest Export_Google_CreateWWWcall(eSpreadsheetUpdateMode UpdateMode = eSpreadsheetUpdateMode.Replace)
+ {
+ string value = Export_Google_CreateData();
+ WWWForm wWWForm = new WWWForm();
+ wWWForm.AddField("key", Google_SpreadsheetKey);
+ wWWForm.AddField("action", "SetLanguageSource");
+ wWWForm.AddField("data", value);
+ wWWForm.AddField("updateMode", UpdateMode.ToString());
+ UnityWebRequest unityWebRequest = UnityWebRequest.Post(LocalizationManager.GetWebServiceURL(this), wWWForm);
+ I2Utils.SendWebRequest(unityWebRequest);
+ return unityWebRequest;
+ }
+
+ private string Export_Google_CreateData()
+ {
+ List<string> categories = GetCategories(OnlyMainCategory: true);
+ StringBuilder stringBuilder = new StringBuilder();
+ bool flag = true;
+ foreach (string item in categories)
+ {
+ if (flag)
+ {
+ flag = false;
+ }
+ else
+ {
+ stringBuilder.Append("<I2Loc>");
+ }
+ bool specializationsAsRows = true;
+ string value = Export_I2CSV(item, ',', specializationsAsRows);
+ stringBuilder.Append(item);
+ stringBuilder.Append("<I2Loc>");
+ stringBuilder.Append(value);
+ }
+ return stringBuilder.ToString();
+ }
+
+ public string Import_CSV(string Category, string CSVstring, eSpreadsheetUpdateMode UpdateMode = eSpreadsheetUpdateMode.Replace, char Separator = ',')
+ {
+ List<string[]> cSV = LocalizationReader.ReadCSV(CSVstring, Separator);
+ return Import_CSV(Category, cSV, UpdateMode);
+ }
+
+ public string Import_I2CSV(string Category, string I2CSVstring, eSpreadsheetUpdateMode UpdateMode = eSpreadsheetUpdateMode.Replace)
+ {
+ List<string[]> cSV = LocalizationReader.ReadI2CSV(I2CSVstring);
+ return Import_CSV(Category, cSV, UpdateMode);
+ }
+
+ public string Import_CSV(string Category, List<string[]> CSV, eSpreadsheetUpdateMode UpdateMode = eSpreadsheetUpdateMode.Replace)
+ {
+ string[] array = CSV[0];
+ int num = 1;
+ int num2 = -1;
+ int num3 = -1;
+ string[] texts = new string[1] { "Key" };
+ string[] texts2 = new string[1] { "Type" };
+ string[] texts3 = new string[2] { "Desc", "Description" };
+ if (array.Length > 1 && ArrayContains(array[0], texts))
+ {
+ if (UpdateMode == eSpreadsheetUpdateMode.Replace)
+ {
+ ClearAllData();
+ }
+ if (array.Length > 2)
+ {
+ if (ArrayContains(array[1], texts2))
+ {
+ num2 = 1;
+ num = 2;
+ }
+ if (ArrayContains(array[1], texts3))
+ {
+ num3 = 1;
+ num = 2;
+ }
+ }
+ if (array.Length > 3)
+ {
+ if (ArrayContains(array[2], texts2))
+ {
+ num2 = 2;
+ num = 3;
+ }
+ if (ArrayContains(array[2], texts3))
+ {
+ num3 = 2;
+ num = 3;
+ }
+ }
+ int num4 = Mathf.Max(array.Length - num, 0);
+ int[] array2 = new int[num4];
+ for (int i = 0; i < num4; i++)
+ {
+ if (string.IsNullOrEmpty(array[i + num]))
+ {
+ array2[i] = -1;
+ continue;
+ }
+ string text = array[i + num];
+ bool flag = true;
+ if (text.StartsWith("$", StringComparison.Ordinal))
+ {
+ flag = false;
+ text = text.Substring(1);
+ }
+ GoogleLanguages.UnPackCodeFromLanguageName(text, out var Language, out var code);
+ int num5 = -1;
+ num5 = (string.IsNullOrEmpty(code) ? GetLanguageIndex(Language, AllowDiscartingRegion: true, SkipDisabled: false) : GetLanguageIndexFromCode(code));
+ if (num5 < 0)
+ {
+ LanguageData languageData = new LanguageData();
+ languageData.Name = Language;
+ languageData.Code = code;
+ languageData.Flags = (byte)(0u | ((!flag) ? 1u : 0u));
+ mLanguages.Add(languageData);
+ num5 = mLanguages.Count - 1;
+ }
+ array2[i] = num5;
+ }
+ num4 = mLanguages.Count;
+ int j = 0;
+ for (int count = mTerms.Count; j < count; j++)
+ {
+ TermData termData = mTerms[j];
+ if (termData.Languages.Length < num4)
+ {
+ Array.Resize(ref termData.Languages, num4);
+ Array.Resize(ref termData.Flags, num4);
+ }
+ }
+ int k = 1;
+ for (int count2 = CSV.Count; k < count2; k++)
+ {
+ array = CSV[k];
+ string Term = (string.IsNullOrEmpty(Category) ? array[0] : (Category + "/" + array[0]));
+ string text2 = null;
+ if (Term.EndsWith("]", StringComparison.Ordinal))
+ {
+ int num6 = Term.LastIndexOf('[');
+ if (num6 > 0)
+ {
+ text2 = Term.Substring(num6 + 1, Term.Length - num6 - 2);
+ if (text2 == "touch")
+ {
+ text2 = "Touch";
+ }
+ Term = Term.Remove(num6);
+ }
+ }
+ ValidateFullTerm(ref Term);
+ if (string.IsNullOrEmpty(Term))
+ {
+ continue;
+ }
+ TermData termData2 = GetTermData(Term);
+ if (termData2 == null)
+ {
+ termData2 = new TermData();
+ termData2.Term = Term;
+ termData2.Languages = new string[mLanguages.Count];
+ termData2.Flags = new byte[mLanguages.Count];
+ for (int l = 0; l < mLanguages.Count; l++)
+ {
+ termData2.Languages[l] = string.Empty;
+ }
+ mTerms.Add(termData2);
+ mDictionary.Add(Term, termData2);
+ }
+ else if (UpdateMode == eSpreadsheetUpdateMode.AddNewTerms)
+ {
+ continue;
+ }
+ if (num2 > 0)
+ {
+ termData2.TermType = GetTermType(array[num2]);
+ }
+ if (num3 > 0)
+ {
+ termData2.Description = array[num3];
+ }
+ for (int m = 0; m < array2.Length && m < array.Length - num; m++)
+ {
+ if (string.IsNullOrEmpty(array[m + num]))
+ {
+ continue;
+ }
+ int num7 = array2[m];
+ if (num7 >= 0)
+ {
+ string text3 = array[m + num];
+ if (text3 == "-")
+ {
+ text3 = string.Empty;
+ }
+ else if (text3 == "")
+ {
+ text3 = null;
+ }
+ termData2.SetTranslation(num7, text3, text2);
+ }
+ }
+ }
+ if (Application.isPlaying)
+ {
+ SaveLanguages(HasUnloadedLanguages());
+ }
+ return string.Empty;
+ }
+ return "Bad Spreadsheet Format.\nFirst columns should be 'Key', 'Type' and 'Desc'";
+ }
+
+ private bool ArrayContains(string MainText, params string[] texts)
+ {
+ int i = 0;
+ for (int num = texts.Length; i < num; i++)
+ {
+ if (MainText.IndexOf(texts[i], StringComparison.OrdinalIgnoreCase) >= 0)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static eTermType GetTermType(string type)
+ {
+ int i = 0;
+ for (int num = 10; i <= num; i++)
+ {
+ eTermType eTermType2 = (eTermType)i;
+ if (string.Equals(eTermType2.ToString(), type, StringComparison.OrdinalIgnoreCase))
+ {
+ return (eTermType)i;
+ }
+ }
+ return eTermType.Text;
+ }
+
+ private void Import_Language_from_Cache(int langIndex, string langData, bool useFallback, bool onlyCurrentSpecialization)
+ {
+ int num = 0;
+ while (num < langData.Length)
+ {
+ int num2 = langData.IndexOf("[i2t]", num, StringComparison.Ordinal);
+ if (num2 < 0)
+ {
+ num2 = langData.Length;
+ }
+ int num3 = langData.IndexOf("=", num, StringComparison.Ordinal);
+ if (num3 >= num2)
+ {
+ break;
+ }
+ string term = langData.Substring(num, num3 - num);
+ num = num3 + 1;
+ TermData termData = GetTermData(term);
+ if (termData != null)
+ {
+ string text = null;
+ if (num != num2)
+ {
+ text = langData.Substring(num, num2 - num);
+ if (text.StartsWith("[i2fb]", StringComparison.Ordinal))
+ {
+ text = (useFallback ? text.Substring(6) : null);
+ }
+ if (onlyCurrentSpecialization && text != null)
+ {
+ text = SpecializationManager.GetSpecializedText(text);
+ }
+ }
+ termData.Languages[langIndex] = text;
+ }
+ num = num2 + 5;
+ }
+ }
+
+ public static void FreeUnusedLanguages()
+ {
+ LanguageSourceData languageSourceData = LocalizationManager.Sources[0];
+ int languageIndex = languageSourceData.GetLanguageIndex(LocalizationManager.CurrentLanguage);
+ for (int i = 0; i < languageSourceData.mTerms.Count; i++)
+ {
+ TermData termData = languageSourceData.mTerms[i];
+ for (int j = 0; j < termData.Languages.Length; j++)
+ {
+ if (j != languageIndex)
+ {
+ termData.Languages[j] = null;
+ }
+ }
+ }
+ }
+
+ public void Import_Google_FromCache()
+ {
+ if (GoogleUpdateFrequency == eGoogleUpdateFrequency.Never || !I2Utils.IsPlaying())
+ {
+ return;
+ }
+ string sourcePlayerPrefName = GetSourcePlayerPrefName();
+ string text = PersistentStorage.LoadFile(PersistentStorage.eFileType.Persistent, "I2Source_" + sourcePlayerPrefName + ".loc", logExceptions: false);
+ if (string.IsNullOrEmpty(text))
+ {
+ return;
+ }
+ if (text.StartsWith("[i2e]", StringComparison.Ordinal))
+ {
+ text = StringObfucator.Decode(text.Substring(5, text.Length - 5));
+ }
+ bool flag = false;
+ string text2 = Google_LastUpdatedVersion;
+ if (PersistentStorage.HasSetting("I2SourceVersion_" + sourcePlayerPrefName))
+ {
+ text2 = PersistentStorage.GetSetting_String("I2SourceVersion_" + sourcePlayerPrefName, Google_LastUpdatedVersion);
+ flag = IsNewerVersion(Google_LastUpdatedVersion, text2);
+ }
+ if (!flag)
+ {
+ PersistentStorage.DeleteFile(PersistentStorage.eFileType.Persistent, "I2Source_" + sourcePlayerPrefName + ".loc", logExceptions: false);
+ PersistentStorage.DeleteSetting("I2SourceVersion_" + sourcePlayerPrefName);
+ return;
+ }
+ if (text2.Length > 19)
+ {
+ text2 = string.Empty;
+ }
+ Google_LastUpdatedVersion = text2;
+ Import_Google_Result(text, eSpreadsheetUpdateMode.Replace);
+ }
+
+ private bool IsNewerVersion(string currentVersion, string newVersion)
+ {
+ if (string.IsNullOrEmpty(newVersion))
+ {
+ return false;
+ }
+ if (string.IsNullOrEmpty(currentVersion))
+ {
+ return true;
+ }
+ if (!long.TryParse(newVersion, out var result) || !long.TryParse(currentVersion, out var result2))
+ {
+ return true;
+ }
+ return result > result2;
+ }
+
+ public void Import_Google(bool ForceUpdate, bool justCheck)
+ {
+ if ((!ForceUpdate && GoogleUpdateFrequency == eGoogleUpdateFrequency.Never) || !I2Utils.IsPlaying())
+ {
+ return;
+ }
+ eGoogleUpdateFrequency googleUpdateFrequency = GoogleUpdateFrequency;
+ string sourcePlayerPrefName = GetSourcePlayerPrefName();
+ if (!ForceUpdate && googleUpdateFrequency != 0)
+ {
+ string setting_String = PersistentStorage.GetSetting_String("LastGoogleUpdate_" + sourcePlayerPrefName, "");
+ try
+ {
+ if (DateTime.TryParse(setting_String, out var result))
+ {
+ double totalDays = (DateTime.Now - result).TotalDays;
+ switch (googleUpdateFrequency)
+ {
+ case eGoogleUpdateFrequency.Daily:
+ if (totalDays < 1.0)
+ {
+ return;
+ }
+ break;
+ case eGoogleUpdateFrequency.Weekly:
+ if (totalDays < 8.0)
+ {
+ return;
+ }
+ break;
+ case eGoogleUpdateFrequency.Monthly:
+ if (totalDays < 31.0)
+ {
+ return;
+ }
+ break;
+ case eGoogleUpdateFrequency.OnlyOnce:
+ return;
+ case eGoogleUpdateFrequency.EveryOtherDay:
+ if (totalDays < 2.0)
+ {
+ return;
+ }
+ break;
+ }
+ }
+ }
+ catch (Exception)
+ {
+ }
+ }
+ PersistentStorage.SetSetting_String("LastGoogleUpdate_" + sourcePlayerPrefName, DateTime.Now.ToString());
+ CoroutineManager.Start(Import_Google_Coroutine(ForceUpdate, justCheck));
+ }
+
+ private string GetSourcePlayerPrefName()
+ {
+ if (owner == null)
+ {
+ return null;
+ }
+ string text = (owner as UnityEngine.Object).name;
+ if (!string.IsNullOrEmpty(Google_SpreadsheetKey))
+ {
+ text += Google_SpreadsheetKey;
+ }
+ if (Array.IndexOf(LocalizationManager.GlobalSources, (owner as UnityEngine.Object).name) >= 0)
+ {
+ return text;
+ }
+ return SceneManager.GetActiveScene().name + "_" + text;
+ }
+
+ private IEnumerator Import_Google_Coroutine(bool forceUpdate, bool JustCheck)
+ {
+ UnityWebRequest www = Import_Google_CreateWWWcall(forceUpdate, JustCheck);
+ if (www == null)
+ {
+ yield break;
+ }
+ while (!www.isDone)
+ {
+ yield return null;
+ }
+ byte[] data = www.downloadHandler.data;
+ if (string.IsNullOrEmpty(www.error) && data != null)
+ {
+ string @string = Encoding.UTF8.GetString(data, 0, data.Length);
+ bool flag = string.IsNullOrEmpty(@string) || @string == "\"\"";
+ if (JustCheck)
+ {
+ if (!flag)
+ {
+ Debug.LogWarning("Spreadsheet is not up-to-date and Google Live Synchronization is enabled\nWhen playing in the device the Spreadsheet will be downloaded and translations may not behave as what you see in the editor.\nTo fix this, Import or Export replace to Google");
+ GoogleLiveSyncIsUptoDate = false;
+ }
+ yield break;
+ }
+ if (!flag)
+ {
+ mDelayedGoogleData = @string;
+ switch (GoogleUpdateSynchronization)
+ {
+ case eGoogleUpdateSynchronization.AsSoonAsDownloaded:
+ ApplyDownloadedDataFromGoogle();
+ break;
+ case eGoogleUpdateSynchronization.OnSceneLoaded:
+ SceneManager.sceneLoaded += ApplyDownloadedDataOnSceneLoaded;
+ break;
+ }
+ yield break;
+ }
+ }
+ if (this.Event_OnSourceUpdateFromGoogle != null)
+ {
+ this.Event_OnSourceUpdateFromGoogle(this, ReceivedNewData: false, www.error);
+ }
+ Debug.Log("Language Source was up-to-date with Google Spreadsheet");
+ }
+
+ private void ApplyDownloadedDataOnSceneLoaded(Scene scene, LoadSceneMode mode)
+ {
+ SceneManager.sceneLoaded -= ApplyDownloadedDataOnSceneLoaded;
+ ApplyDownloadedDataFromGoogle();
+ }
+
+ public void ApplyDownloadedDataFromGoogle()
+ {
+ if (string.IsNullOrEmpty(mDelayedGoogleData))
+ {
+ return;
+ }
+ if (string.IsNullOrEmpty(Import_Google_Result(mDelayedGoogleData, eSpreadsheetUpdateMode.Replace, saveInPlayerPrefs: true)))
+ {
+ if (this.Event_OnSourceUpdateFromGoogle != null)
+ {
+ this.Event_OnSourceUpdateFromGoogle(this, ReceivedNewData: true, "");
+ }
+ LocalizationManager.LocalizeAll(Force: true);
+ Debug.Log("Done Google Sync");
+ }
+ else
+ {
+ if (this.Event_OnSourceUpdateFromGoogle != null)
+ {
+ this.Event_OnSourceUpdateFromGoogle(this, ReceivedNewData: false, "");
+ }
+ Debug.Log("Done Google Sync: source was up-to-date");
+ }
+ }
+
+ public UnityWebRequest Import_Google_CreateWWWcall(bool ForceUpdate, bool justCheck)
+ {
+ if (!HasGoogleSpreadsheet())
+ {
+ return null;
+ }
+ string text = PersistentStorage.GetSetting_String("I2SourceVersion_" + GetSourcePlayerPrefName(), Google_LastUpdatedVersion);
+ if (text.Length > 19)
+ {
+ text = string.Empty;
+ }
+ if (IsNewerVersion(text, Google_LastUpdatedVersion))
+ {
+ Google_LastUpdatedVersion = text;
+ }
+ UnityWebRequest unityWebRequest = UnityWebRequest.Get(string.Format("{0}?key={1}&action=GetLanguageSource&version={2}", LocalizationManager.GetWebServiceURL(this), Google_SpreadsheetKey, ForceUpdate ? "0" : Google_LastUpdatedVersion));
+ I2Utils.SendWebRequest(unityWebRequest);
+ return unityWebRequest;
+ }
+
+ public bool HasGoogleSpreadsheet()
+ {
+ if (!string.IsNullOrEmpty(Google_WebServiceURL) && !string.IsNullOrEmpty(Google_SpreadsheetKey))
+ {
+ return !string.IsNullOrEmpty(LocalizationManager.GetWebServiceURL(this));
+ }
+ return false;
+ }
+
+ public string Import_Google_Result(string JsonString, eSpreadsheetUpdateMode UpdateMode, bool saveInPlayerPrefs = false)
+ {
+ try
+ {
+ string empty = string.Empty;
+ if (string.IsNullOrEmpty(JsonString) || JsonString == "\"\"")
+ {
+ return empty;
+ }
+ int num = JsonString.IndexOf("version=", StringComparison.Ordinal);
+ int num2 = JsonString.IndexOf("script_version=", StringComparison.Ordinal);
+ if (num < 0 || num2 < 0)
+ {
+ return "Invalid Response from Google, Most likely the WebService needs to be updated";
+ }
+ num += "version=".Length;
+ num2 += "script_version=".Length;
+ string text = JsonString.Substring(num, JsonString.IndexOf(",", num, StringComparison.Ordinal) - num);
+ int num3 = int.Parse(JsonString.Substring(num2, JsonString.IndexOf(",", num2, StringComparison.Ordinal) - num2));
+ if (text.Length > 19)
+ {
+ text = string.Empty;
+ }
+ if (num3 != LocalizationManager.GetRequiredWebServiceVersion())
+ {
+ return "The current Google WebService is not supported.\nPlease, delete the WebService from the Google Drive and Install the latest version.";
+ }
+ if (saveInPlayerPrefs && !IsNewerVersion(Google_LastUpdatedVersion, text))
+ {
+ return "LanguageSource is up-to-date";
+ }
+ if (saveInPlayerPrefs)
+ {
+ string sourcePlayerPrefName = GetSourcePlayerPrefName();
+ PersistentStorage.SaveFile(PersistentStorage.eFileType.Persistent, "I2Source_" + sourcePlayerPrefName + ".loc", "[i2e]" + StringObfucator.Encode(JsonString));
+ PersistentStorage.SetSetting_String("I2SourceVersion_" + sourcePlayerPrefName, text);
+ PersistentStorage.ForceSaveSettings();
+ }
+ Google_LastUpdatedVersion = text;
+ if (UpdateMode == eSpreadsheetUpdateMode.Replace)
+ {
+ ClearAllData();
+ }
+ int num4 = JsonString.IndexOf("[i2category]", StringComparison.Ordinal);
+ while (num4 > 0)
+ {
+ num4 += "[i2category]".Length;
+ int num5 = JsonString.IndexOf("[/i2category]", num4, StringComparison.Ordinal);
+ string category = JsonString.Substring(num4, num5 - num4);
+ num5 += "[/i2category]".Length;
+ int num6 = JsonString.IndexOf("[/i2csv]", num5, StringComparison.Ordinal);
+ string i2CSVstring = JsonString.Substring(num5, num6 - num5);
+ num4 = JsonString.IndexOf("[i2category]", num6, StringComparison.Ordinal);
+ Import_I2CSV(category, i2CSVstring, UpdateMode);
+ if (UpdateMode == eSpreadsheetUpdateMode.Replace)
+ {
+ UpdateMode = eSpreadsheetUpdateMode.Merge;
+ }
+ }
+ GoogleLiveSyncIsUptoDate = true;
+ if (I2Utils.IsPlaying())
+ {
+ SaveLanguages(unloadAll: true);
+ }
+ if (!string.IsNullOrEmpty(empty))
+ {
+ Editor_SetDirty();
+ }
+ return empty;
+ }
+ catch (Exception ex)
+ {
+ Debug.LogWarning(ex);
+ return ex.ToString();
+ }
+ }
+
+ public int GetLanguageIndex(string language, bool AllowDiscartingRegion = true, bool SkipDisabled = true)
+ {
+ int i = 0;
+ for (int count = mLanguages.Count; i < count; i++)
+ {
+ if ((!SkipDisabled || mLanguages[i].IsEnabled()) && string.Compare(mLanguages[i].Name, language, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return i;
+ }
+ }
+ if (AllowDiscartingRegion)
+ {
+ int num = -1;
+ int num2 = 0;
+ int j = 0;
+ for (int count2 = mLanguages.Count; j < count2; j++)
+ {
+ if (!SkipDisabled || mLanguages[j].IsEnabled())
+ {
+ int commonWordInLanguageNames = GetCommonWordInLanguageNames(mLanguages[j].Name, language);
+ if (commonWordInLanguageNames > num2)
+ {
+ num2 = commonWordInLanguageNames;
+ num = j;
+ }
+ }
+ }
+ if (num >= 0)
+ {
+ return num;
+ }
+ }
+ return -1;
+ }
+
+ public LanguageData GetLanguageData(string language, bool AllowDiscartingRegion = true)
+ {
+ int languageIndex = GetLanguageIndex(language, AllowDiscartingRegion, SkipDisabled: false);
+ if (languageIndex >= 0)
+ {
+ return mLanguages[languageIndex];
+ }
+ return null;
+ }
+
+ public bool IsCurrentLanguage(int languageIndex)
+ {
+ return LocalizationManager.CurrentLanguage == mLanguages[languageIndex].Name;
+ }
+
+ public int GetLanguageIndexFromCode(string Code, bool exactMatch = true, bool ignoreDisabled = false)
+ {
+ int i = 0;
+ for (int count = mLanguages.Count; i < count; i++)
+ {
+ if ((!ignoreDisabled || mLanguages[i].IsEnabled()) && string.Compare(mLanguages[i].Code, Code, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return i;
+ }
+ }
+ if (!exactMatch)
+ {
+ int j = 0;
+ for (int count2 = mLanguages.Count; j < count2; j++)
+ {
+ if ((!ignoreDisabled || mLanguages[j].IsEnabled()) && string.Compare(mLanguages[j].Code, 0, Code, 0, 2, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return j;
+ }
+ }
+ }
+ return -1;
+ }
+
+ public static int GetCommonWordInLanguageNames(string Language1, string Language2)
+ {
+ if (string.IsNullOrEmpty(Language1) || string.IsNullOrEmpty(Language2))
+ {
+ return 0;
+ }
+ char[] separator = "( )-/\\".ToCharArray();
+ string[] array = Language1.ToLower().Split(separator);
+ string[] array2 = Language2.ToLower().Split(separator);
+ int num = 0;
+ string[] array3 = array;
+ foreach (string value in array3)
+ {
+ if (!string.IsNullOrEmpty(value) && array2.Contains(value))
+ {
+ num++;
+ }
+ }
+ array3 = array2;
+ foreach (string value2 in array3)
+ {
+ if (!string.IsNullOrEmpty(value2) && array.Contains(value2))
+ {
+ num++;
+ }
+ }
+ return num;
+ }
+
+ public static bool AreTheSameLanguage(string Language1, string Language2)
+ {
+ Language1 = GetLanguageWithoutRegion(Language1);
+ Language2 = GetLanguageWithoutRegion(Language2);
+ return string.Compare(Language1, Language2, StringComparison.OrdinalIgnoreCase) == 0;
+ }
+
+ public static string GetLanguageWithoutRegion(string Language)
+ {
+ int num = Language.IndexOfAny("(/\\[,{".ToCharArray());
+ if (num < 0)
+ {
+ return Language;
+ }
+ return Language.Substring(0, num).Trim();
+ }
+
+ public void AddLanguage(string LanguageName)
+ {
+ AddLanguage(LanguageName, GoogleLanguages.GetLanguageCode(LanguageName));
+ }
+
+ public void AddLanguage(string LanguageName, string LanguageCode)
+ {
+ if (GetLanguageIndex(LanguageName, AllowDiscartingRegion: false) < 0)
+ {
+ LanguageData languageData = new LanguageData();
+ languageData.Name = LanguageName;
+ languageData.Code = LanguageCode;
+ mLanguages.Add(languageData);
+ int count = mLanguages.Count;
+ int i = 0;
+ for (int count2 = mTerms.Count; i < count2; i++)
+ {
+ Array.Resize(ref mTerms[i].Languages, count);
+ Array.Resize(ref mTerms[i].Flags, count);
+ }
+ Editor_SetDirty();
+ }
+ }
+
+ public void RemoveLanguage(string LanguageName)
+ {
+ int languageIndex = GetLanguageIndex(LanguageName, AllowDiscartingRegion: false, SkipDisabled: false);
+ if (languageIndex < 0)
+ {
+ return;
+ }
+ int count = mLanguages.Count;
+ int i = 0;
+ for (int count2 = mTerms.Count; i < count2; i++)
+ {
+ for (int j = languageIndex + 1; j < count; j++)
+ {
+ mTerms[i].Languages[j - 1] = mTerms[i].Languages[j];
+ mTerms[i].Flags[j - 1] = mTerms[i].Flags[j];
+ }
+ Array.Resize(ref mTerms[i].Languages, count - 1);
+ Array.Resize(ref mTerms[i].Flags, count - 1);
+ }
+ mLanguages.RemoveAt(languageIndex);
+ Editor_SetDirty();
+ }
+
+ public List<string> GetLanguages(bool skipDisabled = true)
+ {
+ List<string> list = new List<string>();
+ int i = 0;
+ for (int count = mLanguages.Count; i < count; i++)
+ {
+ if (!skipDisabled || mLanguages[i].IsEnabled())
+ {
+ list.Add(mLanguages[i].Name);
+ }
+ }
+ return list;
+ }
+
+ public List<string> GetLanguagesCode(bool allowRegions = true, bool skipDisabled = true)
+ {
+ List<string> list = new List<string>();
+ int i = 0;
+ for (int count = mLanguages.Count; i < count; i++)
+ {
+ if (!skipDisabled || mLanguages[i].IsEnabled())
+ {
+ string text = mLanguages[i].Code;
+ if (!allowRegions && text != null && text.Length > 2)
+ {
+ text = text.Substring(0, 2);
+ }
+ if (!string.IsNullOrEmpty(text) && !list.Contains(text))
+ {
+ list.Add(text);
+ }
+ }
+ }
+ return list;
+ }
+
+ public bool IsLanguageEnabled(string Language)
+ {
+ int languageIndex = GetLanguageIndex(Language, AllowDiscartingRegion: false);
+ if (languageIndex >= 0)
+ {
+ return mLanguages[languageIndex].IsEnabled();
+ }
+ return false;
+ }
+
+ public void EnableLanguage(string Language, bool bEnabled)
+ {
+ int languageIndex = GetLanguageIndex(Language, AllowDiscartingRegion: false, SkipDisabled: false);
+ if (languageIndex >= 0)
+ {
+ mLanguages[languageIndex].SetEnabled(bEnabled);
+ }
+ }
+
+ public bool AllowUnloadingLanguages()
+ {
+ return _AllowUnloadingLanguages != eAllowUnloadLanguages.Never;
+ }
+
+ private string GetSavedLanguageFileName(int languageIndex)
+ {
+ if (languageIndex < 0)
+ {
+ return null;
+ }
+ return "LangSource_" + GetSourcePlayerPrefName() + "_" + mLanguages[languageIndex].Name + ".loc";
+ }
+
+ public void LoadLanguage(int languageIndex, bool UnloadOtherLanguages, bool useFallback, bool onlyCurrentSpecialization, bool forceLoad)
+ {
+ if (!AllowUnloadingLanguages() || !PersistentStorage.CanAccessFiles())
+ {
+ return;
+ }
+ if (languageIndex >= 0 && (forceLoad || !mLanguages[languageIndex].IsLoaded()))
+ {
+ string savedLanguageFileName = GetSavedLanguageFileName(languageIndex);
+ string text = PersistentStorage.LoadFile(PersistentStorage.eFileType.Temporal, savedLanguageFileName, logExceptions: false);
+ if (!string.IsNullOrEmpty(text))
+ {
+ Import_Language_from_Cache(languageIndex, text, useFallback, onlyCurrentSpecialization);
+ mLanguages[languageIndex].SetLoaded(loaded: true);
+ }
+ }
+ if (!UnloadOtherLanguages || !I2Utils.IsPlaying())
+ {
+ return;
+ }
+ for (int i = 0; i < mLanguages.Count; i++)
+ {
+ if (i != languageIndex)
+ {
+ UnloadLanguage(i);
+ }
+ }
+ }
+
+ public void LoadAllLanguages(bool forceLoad = false)
+ {
+ for (int i = 0; i < mLanguages.Count; i++)
+ {
+ LoadLanguage(i, UnloadOtherLanguages: false, useFallback: false, onlyCurrentSpecialization: false, forceLoad);
+ }
+ }
+
+ public void UnloadLanguage(int languageIndex)
+ {
+ if (!AllowUnloadingLanguages() || !PersistentStorage.CanAccessFiles() || !I2Utils.IsPlaying() || !mLanguages[languageIndex].IsLoaded() || !mLanguages[languageIndex].CanBeUnloaded() || IsCurrentLanguage(languageIndex) || !PersistentStorage.HasFile(PersistentStorage.eFileType.Temporal, GetSavedLanguageFileName(languageIndex)))
+ {
+ return;
+ }
+ foreach (TermData mTerm in mTerms)
+ {
+ mTerm.Languages[languageIndex] = null;
+ }
+ mLanguages[languageIndex].SetLoaded(loaded: false);
+ }
+
+ public void SaveLanguages(bool unloadAll, PersistentStorage.eFileType fileLocation = PersistentStorage.eFileType.Temporal)
+ {
+ if (!AllowUnloadingLanguages() || !PersistentStorage.CanAccessFiles())
+ {
+ return;
+ }
+ for (int i = 0; i < mLanguages.Count; i++)
+ {
+ string text = Export_Language_to_Cache(i, IsCurrentLanguage(i));
+ if (!string.IsNullOrEmpty(text))
+ {
+ PersistentStorage.SaveFile(PersistentStorage.eFileType.Temporal, GetSavedLanguageFileName(i), text);
+ }
+ }
+ if (!unloadAll)
+ {
+ return;
+ }
+ for (int j = 0; j < mLanguages.Count; j++)
+ {
+ if (unloadAll && !IsCurrentLanguage(j))
+ {
+ UnloadLanguage(j);
+ }
+ }
+ }
+
+ public bool HasUnloadedLanguages()
+ {
+ for (int i = 0; i < mLanguages.Count; i++)
+ {
+ if (!mLanguages[i].IsLoaded())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public List<string> GetCategories(bool OnlyMainCategory = false, List<string> Categories = null)
+ {
+ if (Categories == null)
+ {
+ Categories = new List<string>();
+ }
+ foreach (TermData mTerm in mTerms)
+ {
+ string categoryFromFullTerm = GetCategoryFromFullTerm(mTerm.Term, OnlyMainCategory);
+ if (!Categories.Contains(categoryFromFullTerm))
+ {
+ Categories.Add(categoryFromFullTerm);
+ }
+ }
+ Categories.Sort();
+ return Categories;
+ }
+
+ public static string GetKeyFromFullTerm(string FullTerm, bool OnlyMainCategory = false)
+ {
+ int num = (OnlyMainCategory ? FullTerm.IndexOfAny(CategorySeparators) : FullTerm.LastIndexOfAny(CategorySeparators));
+ if (num >= 0)
+ {
+ return FullTerm.Substring(num + 1);
+ }
+ return FullTerm;
+ }
+
+ public static string GetCategoryFromFullTerm(string FullTerm, bool OnlyMainCategory = false)
+ {
+ int num = (OnlyMainCategory ? FullTerm.IndexOfAny(CategorySeparators) : FullTerm.LastIndexOfAny(CategorySeparators));
+ if (num >= 0)
+ {
+ return FullTerm.Substring(0, num);
+ }
+ return EmptyCategory;
+ }
+
+ public static void DeserializeFullTerm(string FullTerm, out string Key, out string Category, bool OnlyMainCategory = false)
+ {
+ int num = (OnlyMainCategory ? FullTerm.IndexOfAny(CategorySeparators) : FullTerm.LastIndexOfAny(CategorySeparators));
+ if (num < 0)
+ {
+ Category = EmptyCategory;
+ Key = FullTerm;
+ }
+ else
+ {
+ Category = FullTerm.Substring(0, num);
+ Key = FullTerm.Substring(num + 1);
+ }
+ }
+
+ public void UpdateDictionary(bool force = false)
+ {
+ if (force || mDictionary == null || mDictionary.Count != mTerms.Count)
+ {
+ StringComparer stringComparer = (CaseInsensitiveTerms ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal);
+ if (mDictionary.Comparer != stringComparer)
+ {
+ mDictionary = new Dictionary<string, TermData>(stringComparer);
+ }
+ else
+ {
+ mDictionary.Clear();
+ }
+ int i = 0;
+ for (int count = mTerms.Count; i < count; i++)
+ {
+ TermData termData = mTerms[i];
+ ValidateFullTerm(ref termData.Term);
+ mDictionary[termData.Term] = mTerms[i];
+ mTerms[i].Validate();
+ }
+ if (I2Utils.IsPlaying())
+ {
+ SaveLanguages(unloadAll: true);
+ }
+ }
+ }
+
+ public string GetTranslation(string term, string overrideLanguage = null, string overrideSpecialization = null, bool skipDisabled = false, bool allowCategoryMistmatch = false)
+ {
+ TryGetTranslation(term, out var Translation, overrideLanguage, overrideSpecialization, skipDisabled, allowCategoryMistmatch);
+ return Translation;
+ }
+
+ public bool TryGetTranslation(string term, out string Translation, string overrideLanguage = null, string overrideSpecialization = null, bool skipDisabled = false, bool allowCategoryMistmatch = false)
+ {
+ int languageIndex = GetLanguageIndex((overrideLanguage == null) ? LocalizationManager.CurrentLanguage : overrideLanguage, AllowDiscartingRegion: true, SkipDisabled: false);
+ if (languageIndex >= 0 && (!skipDisabled || mLanguages[languageIndex].IsEnabled()))
+ {
+ TermData termData = GetTermData(term, allowCategoryMistmatch);
+ if (termData != null)
+ {
+ Translation = termData.GetTranslation(languageIndex, overrideSpecialization, editMode: true);
+ if (Translation == "---")
+ {
+ Translation = string.Empty;
+ return true;
+ }
+ if (!string.IsNullOrEmpty(Translation))
+ {
+ return true;
+ }
+ Translation = null;
+ }
+ if (OnMissingTranslation == MissingTranslationAction.ShowWarning)
+ {
+ Translation = "<!-Missing Translation [" + term + "]-!>";
+ Debug.LogWarning("Missing Translation for '" + term + "'", Localize.CurrentLocalizeComponent);
+ return false;
+ }
+ if (OnMissingTranslation == MissingTranslationAction.Fallback && termData != null)
+ {
+ return TryGetFallbackTranslation(termData, out Translation, languageIndex, overrideSpecialization, skipDisabled);
+ }
+ if (OnMissingTranslation == MissingTranslationAction.Empty)
+ {
+ Translation = string.Empty;
+ return false;
+ }
+ if (OnMissingTranslation == MissingTranslationAction.ShowTerm)
+ {
+ Translation = term;
+ return false;
+ }
+ }
+ Translation = null;
+ return false;
+ }
+
+ private bool TryGetFallbackTranslation(TermData termData, out string Translation, int langIndex, string overrideSpecialization = null, bool skipDisabled = false)
+ {
+ string text = mLanguages[langIndex].Code;
+ if (!string.IsNullOrEmpty(text))
+ {
+ if (text.Contains("-"))
+ {
+ text = text.Substring(0, text.IndexOf('-'));
+ }
+ for (int i = 0; i < mLanguages.Count; i++)
+ {
+ if (i != langIndex && mLanguages[i].Code.StartsWith(text, StringComparison.Ordinal) && (!skipDisabled || mLanguages[i].IsEnabled()))
+ {
+ Translation = termData.GetTranslation(i, overrideSpecialization, editMode: true);
+ if (!string.IsNullOrEmpty(Translation))
+ {
+ return true;
+ }
+ }
+ }
+ }
+ for (int j = 0; j < mLanguages.Count; j++)
+ {
+ if (j != langIndex && (!skipDisabled || mLanguages[j].IsEnabled()) && (text == null || !mLanguages[j].Code.StartsWith(text, StringComparison.Ordinal)))
+ {
+ Translation = termData.GetTranslation(j, overrideSpecialization, editMode: true);
+ if (!string.IsNullOrEmpty(Translation))
+ {
+ return true;
+ }
+ }
+ }
+ Translation = null;
+ return false;
+ }
+
+ public TermData AddTerm(string term)
+ {
+ return AddTerm(term, eTermType.Text);
+ }
+
+ public TermData GetTermData(string term, bool allowCategoryMistmatch = false)
+ {
+ if (string.IsNullOrEmpty(term))
+ {
+ return null;
+ }
+ if (mDictionary.Count == 0)
+ {
+ UpdateDictionary();
+ }
+ if (mDictionary.TryGetValue(term, out var value))
+ {
+ return value;
+ }
+ TermData termData = null;
+ if (allowCategoryMistmatch)
+ {
+ string keyFromFullTerm = GetKeyFromFullTerm(term);
+ {
+ foreach (KeyValuePair<string, TermData> item in mDictionary)
+ {
+ if (item.Value.IsTerm(keyFromFullTerm, allowCategoryMistmatch: true))
+ {
+ if (termData != null)
+ {
+ return null;
+ }
+ termData = item.Value;
+ }
+ }
+ return termData;
+ }
+ }
+ return termData;
+ }
+
+ public bool ContainsTerm(string term)
+ {
+ return GetTermData(term) != null;
+ }
+
+ public List<string> GetTermsList(string Category = null)
+ {
+ if (mDictionary.Count != mTerms.Count)
+ {
+ UpdateDictionary();
+ }
+ if (string.IsNullOrEmpty(Category))
+ {
+ return new List<string>(mDictionary.Keys);
+ }
+ List<string> list = new List<string>();
+ for (int i = 0; i < mTerms.Count; i++)
+ {
+ TermData termData = mTerms[i];
+ if (GetCategoryFromFullTerm(termData.Term) == Category)
+ {
+ list.Add(termData.Term);
+ }
+ }
+ return list;
+ }
+
+ public TermData AddTerm(string NewTerm, eTermType termType, bool SaveSource = true)
+ {
+ ValidateFullTerm(ref NewTerm);
+ NewTerm = NewTerm.Trim();
+ if (mLanguages.Count == 0)
+ {
+ AddLanguage("English", "en");
+ }
+ TermData termData = GetTermData(NewTerm);
+ if (termData == null)
+ {
+ termData = new TermData();
+ termData.Term = NewTerm;
+ termData.TermType = termType;
+ termData.Languages = new string[mLanguages.Count];
+ termData.Flags = new byte[mLanguages.Count];
+ mTerms.Add(termData);
+ mDictionary.Add(NewTerm, termData);
+ }
+ return termData;
+ }
+
+ public void RemoveTerm(string term)
+ {
+ int i = 0;
+ for (int count = mTerms.Count; i < count; i++)
+ {
+ if (mTerms[i].Term == term)
+ {
+ mTerms.RemoveAt(i);
+ mDictionary.Remove(term);
+ break;
+ }
+ }
+ }
+
+ public static void ValidateFullTerm(ref string Term)
+ {
+ Term = Term.Replace('\\', '/');
+ Term = Term.Trim();
+ if (Term.StartsWith(EmptyCategory, StringComparison.Ordinal) && Term.Length > EmptyCategory.Length && Term[EmptyCategory.Length] == '/')
+ {
+ Term = Term.Substring(EmptyCategory.Length + 1);
+ }
+ Term = I2Utils.GetValidTermName(Term, allowCategory: true);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizationManager.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizationManager.cs
new file mode 100644
index 0000000..49292c5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizationManager.cs
@@ -0,0 +1,1056 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text.RegularExpressions;
+using System.Threading;
+using UnityEngine;
+
+namespace I2.Loc;
+
+public static class LocalizationManager
+{
+ public delegate bool FnCustomApplyLocalizationParams(ref string translation, _GetParam getParam, bool allowLocalizedParameters);
+
+ public delegate object _GetParam(string param);
+
+ public delegate void OnLocalizeCallback();
+
+ private static string mCurrentLanguage;
+
+ private static string mLanguageCode;
+
+ private static CultureInfo mCurrentCulture;
+
+ private static bool mChangeCultureInfo;
+
+ public static bool IsRight2Left;
+
+ public static bool HasJoinedWords;
+
+ public static List<ILocalizationParamsManager> ParamManagers = new List<ILocalizationParamsManager>();
+
+ public static FnCustomApplyLocalizationParams CustomApplyLocalizationParams;
+
+ private static string[] LanguagesRTL = new string[21]
+ {
+ "ar-DZ", "ar", "ar-BH", "ar-EG", "ar-IQ", "ar-JO", "ar-KW", "ar-LB", "ar-LY", "ar-MA",
+ "ar-OM", "ar-QA", "ar-SA", "ar-SY", "ar-TN", "ar-AE", "ar-YE", "fa", "he", "ur",
+ "ji"
+ };
+
+ public static List<LanguageSourceData> Sources = new List<LanguageSourceData>();
+
+ public static string[] GlobalSources = new string[1] { "I2Languages" };
+
+ public static Func<LanguageSourceData, bool> Callback_AllowSyncFromGoogle = null;
+
+ private static string mCurrentDeviceLanguage;
+
+ public static List<ILocalizeTargetDescriptor> mLocalizeTargets = new List<ILocalizeTargetDescriptor>();
+
+ private static bool mLocalizeIsScheduled;
+
+ private static bool mLocalizeIsScheduledWithForcedValue;
+
+ public static bool HighlightLocalizedTargets = false;
+
+ public static string CurrentLanguage
+ {
+ get
+ {
+ InitializeIfNeeded();
+ return mCurrentLanguage;
+ }
+ set
+ {
+ InitializeIfNeeded();
+ string supportedLanguage = GetSupportedLanguage(value);
+ if (!string.IsNullOrEmpty(supportedLanguage) && mCurrentLanguage != supportedLanguage)
+ {
+ SetLanguageAndCode(supportedLanguage, GetLanguageCode(supportedLanguage));
+ }
+ }
+ }
+
+ public static string CurrentLanguageCode
+ {
+ get
+ {
+ InitializeIfNeeded();
+ return mLanguageCode;
+ }
+ set
+ {
+ InitializeIfNeeded();
+ if (mLanguageCode != value)
+ {
+ string languageFromCode = GetLanguageFromCode(value);
+ if (!string.IsNullOrEmpty(languageFromCode))
+ {
+ SetLanguageAndCode(languageFromCode, value);
+ }
+ }
+ }
+ }
+
+ public static string CurrentRegion
+ {
+ get
+ {
+ string currentLanguage = CurrentLanguage;
+ int num = currentLanguage.IndexOfAny("/\\".ToCharArray());
+ if (num > 0)
+ {
+ return currentLanguage.Substring(num + 1);
+ }
+ num = currentLanguage.IndexOfAny("[(".ToCharArray());
+ int num2 = currentLanguage.LastIndexOfAny("])".ToCharArray());
+ if (num > 0 && num != num2)
+ {
+ return currentLanguage.Substring(num + 1, num2 - num - 1);
+ }
+ return string.Empty;
+ }
+ set
+ {
+ string text = CurrentLanguage;
+ int num = text.IndexOfAny("/\\".ToCharArray());
+ if (num > 0)
+ {
+ CurrentLanguage = text.Substring(num + 1) + value;
+ return;
+ }
+ num = text.IndexOfAny("[(".ToCharArray());
+ int num2 = text.LastIndexOfAny("])".ToCharArray());
+ if (num > 0 && num != num2)
+ {
+ text = text.Substring(num);
+ }
+ CurrentLanguage = text + "(" + value + ")";
+ }
+ }
+
+ public static string CurrentRegionCode
+ {
+ get
+ {
+ string currentLanguageCode = CurrentLanguageCode;
+ int num = currentLanguageCode.IndexOfAny(" -_/\\".ToCharArray());
+ if (num >= 0)
+ {
+ return currentLanguageCode.Substring(num + 1);
+ }
+ return string.Empty;
+ }
+ set
+ {
+ string text = CurrentLanguageCode;
+ int num = text.IndexOfAny(" -_/\\".ToCharArray());
+ if (num > 0)
+ {
+ text = text.Substring(0, num);
+ }
+ CurrentLanguageCode = text + "-" + value;
+ }
+ }
+
+ public static CultureInfo CurrentCulture => mCurrentCulture;
+
+ public static event OnLocalizeCallback OnLocalizeEvent;
+
+ public static void InitializeIfNeeded()
+ {
+ if (string.IsNullOrEmpty(mCurrentLanguage) || Sources.Count == 0)
+ {
+ AutoLoadGlobalParamManagers();
+ UpdateSources();
+ SelectStartupLanguage();
+ }
+ }
+
+ public static string GetVersion()
+ {
+ return "2.8.20 f2";
+ }
+
+ public static int GetRequiredWebServiceVersion()
+ {
+ return 5;
+ }
+
+ public static string GetWebServiceURL(LanguageSourceData source = null)
+ {
+ if (source != null && !string.IsNullOrEmpty(source.Google_WebServiceURL))
+ {
+ return source.Google_WebServiceURL;
+ }
+ InitializeIfNeeded();
+ for (int i = 0; i < Sources.Count; i++)
+ {
+ if (Sources[i] != null && !string.IsNullOrEmpty(Sources[i].Google_WebServiceURL))
+ {
+ return Sources[i].Google_WebServiceURL;
+ }
+ }
+ return string.Empty;
+ }
+
+ public static void SetLanguageAndCode(string LanguageName, string LanguageCode, bool RememberLanguage = true, bool Force = false)
+ {
+ if (mCurrentLanguage != LanguageName || mLanguageCode != LanguageCode || Force)
+ {
+ if (RememberLanguage)
+ {
+ PersistentStorage.SetSetting_String("I2 Language", LanguageName);
+ }
+ mCurrentLanguage = LanguageName;
+ mLanguageCode = LanguageCode;
+ mCurrentCulture = CreateCultureForCode(LanguageCode);
+ if (mChangeCultureInfo)
+ {
+ SetCurrentCultureInfo();
+ }
+ IsRight2Left = IsRTL(mLanguageCode);
+ HasJoinedWords = GoogleLanguages.LanguageCode_HasJoinedWord(mLanguageCode);
+ LocalizeAll(Force);
+ }
+ }
+
+ private static CultureInfo CreateCultureForCode(string code)
+ {
+ try
+ {
+ return CultureInfo.CreateSpecificCulture(code);
+ }
+ catch (Exception)
+ {
+ return CultureInfo.InvariantCulture;
+ }
+ }
+
+ public static void EnableChangingCultureInfo(bool bEnable)
+ {
+ if (!mChangeCultureInfo && bEnable)
+ {
+ SetCurrentCultureInfo();
+ }
+ mChangeCultureInfo = bEnable;
+ }
+
+ private static void SetCurrentCultureInfo()
+ {
+ Thread.CurrentThread.CurrentCulture = mCurrentCulture;
+ }
+
+ private static void SelectStartupLanguage()
+ {
+ if (Sources.Count == 0)
+ {
+ return;
+ }
+ string setting_String = PersistentStorage.GetSetting_String("I2 Language", string.Empty);
+ string currentDeviceLanguage = GetCurrentDeviceLanguage();
+ if (!string.IsNullOrEmpty(setting_String) && HasLanguage(setting_String, AllowDiscartingRegion: true, Initialize: false))
+ {
+ SetLanguageAndCode(setting_String, GetLanguageCode(setting_String));
+ return;
+ }
+ if (!Sources[0].IgnoreDeviceLanguage)
+ {
+ string supportedLanguage = GetSupportedLanguage(currentDeviceLanguage, ignoreDisabled: true);
+ if (!string.IsNullOrEmpty(supportedLanguage))
+ {
+ SetLanguageAndCode(supportedLanguage, GetLanguageCode(supportedLanguage), RememberLanguage: false);
+ return;
+ }
+ }
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ if (Sources[i].mLanguages.Count <= 0)
+ {
+ continue;
+ }
+ for (int j = 0; j < Sources[i].mLanguages.Count; j++)
+ {
+ if (Sources[i].mLanguages[j].IsEnabled())
+ {
+ SetLanguageAndCode(Sources[i].mLanguages[j].Name, Sources[i].mLanguages[j].Code, RememberLanguage: false);
+ return;
+ }
+ }
+ }
+ }
+
+ public static bool HasLanguage(string Language, bool AllowDiscartingRegion = true, bool Initialize = true, bool SkipDisabled = true)
+ {
+ if (Initialize)
+ {
+ InitializeIfNeeded();
+ }
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ if (Sources[i].GetLanguageIndex(Language, AllowDiscartingRegion: false, SkipDisabled) >= 0)
+ {
+ return true;
+ }
+ }
+ if (AllowDiscartingRegion)
+ {
+ int j = 0;
+ for (int count2 = Sources.Count; j < count2; j++)
+ {
+ if (Sources[j].GetLanguageIndex(Language, AllowDiscartingRegion: true, SkipDisabled) >= 0)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public static string GetSupportedLanguage(string Language, bool ignoreDisabled = false)
+ {
+ string languageCode = GoogleLanguages.GetLanguageCode(Language);
+ if (!string.IsNullOrEmpty(languageCode))
+ {
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ int languageIndexFromCode = Sources[i].GetLanguageIndexFromCode(languageCode, exactMatch: true, ignoreDisabled);
+ if (languageIndexFromCode >= 0)
+ {
+ return Sources[i].mLanguages[languageIndexFromCode].Name;
+ }
+ }
+ int j = 0;
+ for (int count2 = Sources.Count; j < count2; j++)
+ {
+ int languageIndexFromCode2 = Sources[j].GetLanguageIndexFromCode(languageCode, exactMatch: false, ignoreDisabled);
+ if (languageIndexFromCode2 >= 0)
+ {
+ return Sources[j].mLanguages[languageIndexFromCode2].Name;
+ }
+ }
+ }
+ int k = 0;
+ for (int count3 = Sources.Count; k < count3; k++)
+ {
+ int languageIndex = Sources[k].GetLanguageIndex(Language, AllowDiscartingRegion: false, ignoreDisabled);
+ if (languageIndex >= 0)
+ {
+ return Sources[k].mLanguages[languageIndex].Name;
+ }
+ }
+ int l = 0;
+ for (int count4 = Sources.Count; l < count4; l++)
+ {
+ int languageIndex2 = Sources[l].GetLanguageIndex(Language, AllowDiscartingRegion: true, ignoreDisabled);
+ if (languageIndex2 >= 0)
+ {
+ return Sources[l].mLanguages[languageIndex2].Name;
+ }
+ }
+ return string.Empty;
+ }
+
+ public static string GetLanguageCode(string Language)
+ {
+ if (Sources.Count == 0)
+ {
+ UpdateSources();
+ }
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ int languageIndex = Sources[i].GetLanguageIndex(Language);
+ if (languageIndex >= 0)
+ {
+ return Sources[i].mLanguages[languageIndex].Code;
+ }
+ }
+ return string.Empty;
+ }
+
+ public static string GetLanguageFromCode(string Code, bool exactMatch = true)
+ {
+ if (Sources.Count == 0)
+ {
+ UpdateSources();
+ }
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ int languageIndexFromCode = Sources[i].GetLanguageIndexFromCode(Code, exactMatch);
+ if (languageIndexFromCode >= 0)
+ {
+ return Sources[i].mLanguages[languageIndexFromCode].Name;
+ }
+ }
+ return string.Empty;
+ }
+
+ public static List<string> GetAllLanguages(bool SkipDisabled = true)
+ {
+ if (Sources.Count == 0)
+ {
+ UpdateSources();
+ }
+ List<string> Languages = new List<string>();
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ Languages.AddRange(from x in Sources[i].GetLanguages(SkipDisabled)
+ where !Languages.Contains(x)
+ select x);
+ }
+ return Languages;
+ }
+
+ public static List<string> GetAllLanguagesCode(bool allowRegions = true, bool SkipDisabled = true)
+ {
+ List<string> Languages = new List<string>();
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ Languages.AddRange(from x in Sources[i].GetLanguagesCode(allowRegions, SkipDisabled)
+ where !Languages.Contains(x)
+ select x);
+ }
+ return Languages;
+ }
+
+ public static bool IsLanguageEnabled(string Language)
+ {
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ if (!Sources[i].IsLanguageEnabled(Language))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static void LoadCurrentLanguage()
+ {
+ for (int i = 0; i < Sources.Count; i++)
+ {
+ int languageIndex = Sources[i].GetLanguageIndex(mCurrentLanguage, AllowDiscartingRegion: true, SkipDisabled: false);
+ Sources[i].LoadLanguage(languageIndex, UnloadOtherLanguages: true, useFallback: true, onlyCurrentSpecialization: true, forceLoad: false);
+ }
+ }
+
+ public static void PreviewLanguage(string NewLanguage)
+ {
+ mCurrentLanguage = NewLanguage;
+ mLanguageCode = GetLanguageCode(mCurrentLanguage);
+ IsRight2Left = IsRTL(mLanguageCode);
+ HasJoinedWords = GoogleLanguages.LanguageCode_HasJoinedWord(mLanguageCode);
+ }
+
+ public static void AutoLoadGlobalParamManagers()
+ {
+ LocalizationParamsManager[] array = UnityEngine.Object.FindObjectsOfType<LocalizationParamsManager>();
+ foreach (LocalizationParamsManager localizationParamsManager in array)
+ {
+ if (localizationParamsManager._IsGlobalManager && !ParamManagers.Contains(localizationParamsManager))
+ {
+ Debug.Log(localizationParamsManager);
+ ParamManagers.Add(localizationParamsManager);
+ }
+ }
+ }
+
+ public static void ApplyLocalizationParams(ref string translation, bool allowLocalizedParameters = true)
+ {
+ ApplyLocalizationParams(ref translation, (string p) => GetLocalizationParam(p, null), allowLocalizedParameters);
+ }
+
+ public static void ApplyLocalizationParams(ref string translation, GameObject root, bool allowLocalizedParameters = true)
+ {
+ ApplyLocalizationParams(ref translation, (string p) => GetLocalizationParam(p, root), allowLocalizedParameters);
+ }
+
+ public static void ApplyLocalizationParams(ref string translation, Dictionary<string, object> parameters, bool allowLocalizedParameters = true)
+ {
+ ApplyLocalizationParams(ref translation, delegate(string p)
+ {
+ object value = null;
+ return parameters.TryGetValue(p, out value) ? value : null;
+ }, allowLocalizedParameters);
+ }
+
+ public static void ApplyLocalizationParams(ref string translation, _GetParam getParam, bool allowLocalizedParameters = true)
+ {
+ if (translation == null || (CustomApplyLocalizationParams != null && CustomApplyLocalizationParams(ref translation, getParam, allowLocalizedParameters)))
+ {
+ return;
+ }
+ string text = null;
+ int num = 0;
+ int length = translation.Length;
+ int num2 = 0;
+ while (num2 >= 0 && num2 < translation.Length)
+ {
+ int num3 = translation.IndexOf("{[", num2, StringComparison.Ordinal);
+ if (num3 < 0)
+ {
+ break;
+ }
+ int num4 = translation.IndexOf("]}", num3, StringComparison.Ordinal);
+ if (num4 < 0)
+ {
+ break;
+ }
+ int num5 = translation.IndexOf("{[", num3 + 1, StringComparison.Ordinal);
+ if (num5 > 0 && num5 < num4)
+ {
+ num2 = num5;
+ continue;
+ }
+ int num6 = ((translation[num3 + 2] == '#') ? 3 : 2);
+ string param = translation.Substring(num3 + num6, num4 - num3 - num6);
+ string text2 = (string)getParam(param);
+ if (text2 != null)
+ {
+ if (allowLocalizedParameters)
+ {
+ LanguageSourceData source;
+ TermData termData = GetTermData(text2, out source);
+ if (termData != null)
+ {
+ int languageIndex = source.GetLanguageIndex(CurrentLanguage);
+ if (languageIndex >= 0)
+ {
+ text2 = termData.GetTranslation(languageIndex);
+ }
+ }
+ }
+ string oldValue = translation.Substring(num3, num4 - num3 + 2);
+ translation = translation.Replace(oldValue, text2);
+ int result = 0;
+ if (int.TryParse(text2, out result))
+ {
+ text = GoogleLanguages.GetPluralType(CurrentLanguageCode, result).ToString();
+ }
+ num2 = num3 + text2.Length;
+ }
+ else
+ {
+ num2 = num4 + 2;
+ }
+ }
+ if (text != null)
+ {
+ string text3 = "[i2p_" + text + "]";
+ num = translation.IndexOf(text3, StringComparison.OrdinalIgnoreCase);
+ num = ((num >= 0) ? (num + text3.Length) : 0);
+ length = translation.IndexOf("[i2p_", num + 1, StringComparison.OrdinalIgnoreCase);
+ if (length < 0)
+ {
+ length = translation.Length;
+ }
+ translation = translation.Substring(num, length - num);
+ }
+ }
+
+ internal static string GetLocalizationParam(string ParamName, GameObject root)
+ {
+ string text = null;
+ if ((bool)root)
+ {
+ MonoBehaviour[] components = root.GetComponents<MonoBehaviour>();
+ int i = 0;
+ for (int num = components.Length; i < num; i++)
+ {
+ if (components[i] is ILocalizationParamsManager localizationParamsManager && components[i].enabled)
+ {
+ text = localizationParamsManager.GetParameterValue(ParamName);
+ if (text != null)
+ {
+ return text;
+ }
+ }
+ }
+ }
+ int j = 0;
+ for (int count = ParamManagers.Count; j < count; j++)
+ {
+ text = ParamManagers[j].GetParameterValue(ParamName);
+ if (text != null)
+ {
+ return text;
+ }
+ }
+ return null;
+ }
+
+ private static string GetPluralType(MatchCollection matches, string langCode, _GetParam getParam)
+ {
+ int i = 0;
+ for (int count = matches.Count; i < count; i++)
+ {
+ Match match = matches[i];
+ string value = match.Groups[match.Groups.Count - 1].Value;
+ string text = (string)getParam(value);
+ if (text != null)
+ {
+ int result = 0;
+ if (int.TryParse(text, out result))
+ {
+ return GoogleLanguages.GetPluralType(langCode, result).ToString();
+ }
+ }
+ }
+ return null;
+ }
+
+ public static string ApplyRTLfix(string line)
+ {
+ return ApplyRTLfix(line, 0, ignoreNumbers: true);
+ }
+
+ public static string ApplyRTLfix(string line, int maxCharacters, bool ignoreNumbers)
+ {
+ if (string.IsNullOrEmpty(line))
+ {
+ return line;
+ }
+ char c = line[0];
+ if (c == '!' || c == '.' || c == '?')
+ {
+ line = line.Substring(1) + c;
+ }
+ int tagStart = -1;
+ int num = 0;
+ int num2 = 40000;
+ num = 0;
+ List<string> list = new List<string>();
+ while (I2Utils.FindNextTag(line, num, out tagStart, out num))
+ {
+ string text = "@@" + (char)(num2 + list.Count) + "@@";
+ list.Add(line.Substring(tagStart, num - tagStart + 1));
+ line = line.Substring(0, tagStart) + text + line.Substring(num + 1);
+ num = tagStart + 5;
+ }
+ line = line.Replace("\r\n", "\n");
+ line = I2Utils.SplitLine(line, maxCharacters);
+ line = RTLFixer.Fix(line, showTashkeel: true, !ignoreNumbers);
+ for (int i = 0; i < list.Count; i++)
+ {
+ int length = line.Length;
+ for (int j = 0; j < length - 4; j++)
+ {
+ if (line[j] == '@' && line[j + 1] == '@' && line[j + 2] >= num2 && line[j + 3] == '@' && line[j + 4] == '@')
+ {
+ int num3 = line[j + 2] - num2;
+ num3 = ((num3 % 2 != 0) ? (num3 - 1) : (num3 + 1));
+ if (num3 >= list.Count)
+ {
+ num3 = list.Count - 1;
+ }
+ line = line.Substring(0, j) + list[num3] + line.Substring(j + 5);
+ break;
+ }
+ }
+ }
+ return line;
+ }
+
+ public static string FixRTL_IfNeeded(string text, int maxCharacters = 0, bool ignoreNumber = false)
+ {
+ if (IsRight2Left)
+ {
+ return ApplyRTLfix(text, maxCharacters, ignoreNumber);
+ }
+ return text;
+ }
+
+ public static bool IsRTL(string Code)
+ {
+ return Array.IndexOf(LanguagesRTL, Code) >= 0;
+ }
+
+ public static bool UpdateSources()
+ {
+ UnregisterDeletededSources();
+ RegisterSourceInResources();
+ RegisterSceneSources();
+ return Sources.Count > 0;
+ }
+
+ private static void UnregisterDeletededSources()
+ {
+ for (int num = Sources.Count - 1; num >= 0; num--)
+ {
+ if (Sources[num] == null)
+ {
+ RemoveSource(Sources[num]);
+ }
+ }
+ }
+
+ private static void RegisterSceneSources()
+ {
+ LanguageSource[] array = (LanguageSource[])Resources.FindObjectsOfTypeAll(typeof(LanguageSource));
+ foreach (LanguageSource languageSource in array)
+ {
+ if (!Sources.Contains(languageSource.mSource))
+ {
+ if (languageSource.mSource.owner == null)
+ {
+ languageSource.mSource.owner = languageSource;
+ }
+ AddSource(languageSource.mSource);
+ }
+ }
+ }
+
+ private static void RegisterSourceInResources()
+ {
+ string[] globalSources = GlobalSources;
+ foreach (string name in globalSources)
+ {
+ LanguageSourceAsset asset = ResourceManager.pInstance.GetAsset<LanguageSourceAsset>(name);
+ if ((bool)asset && !Sources.Contains(asset.mSource))
+ {
+ if (!asset.mSource.mIsGlobalSource)
+ {
+ asset.mSource.mIsGlobalSource = true;
+ }
+ asset.mSource.owner = asset;
+ AddSource(asset.mSource);
+ }
+ }
+ }
+
+ private static bool AllowSyncFromGoogle(LanguageSourceData Source)
+ {
+ if (Callback_AllowSyncFromGoogle == null)
+ {
+ return true;
+ }
+ return Callback_AllowSyncFromGoogle(Source);
+ }
+
+ internal static void AddSource(LanguageSourceData Source)
+ {
+ if (Sources.Contains(Source))
+ {
+ return;
+ }
+ Sources.Add(Source);
+ if (Source.HasGoogleSpreadsheet() && Source.GoogleUpdateFrequency != LanguageSourceData.eGoogleUpdateFrequency.Never && AllowSyncFromGoogle(Source))
+ {
+ Source.Import_Google_FromCache();
+ bool justCheck = false;
+ if (Source.GoogleUpdateDelay > 0f)
+ {
+ CoroutineManager.Start(Delayed_Import_Google(Source, Source.GoogleUpdateDelay, justCheck));
+ }
+ else
+ {
+ Source.Import_Google(ForceUpdate: false, justCheck);
+ }
+ }
+ for (int i = 0; i < Source.mLanguages.Count; i++)
+ {
+ Source.mLanguages[i].SetLoaded(loaded: true);
+ }
+ if (Source.mDictionary.Count == 0)
+ {
+ Source.UpdateDictionary(force: true);
+ }
+ }
+
+ private static IEnumerator Delayed_Import_Google(LanguageSourceData source, float delay, bool justCheck)
+ {
+ yield return new WaitForSeconds(delay);
+ source?.Import_Google(ForceUpdate: false, justCheck);
+ }
+
+ internal static void RemoveSource(LanguageSourceData Source)
+ {
+ Sources.Remove(Source);
+ }
+
+ public static bool IsGlobalSource(string SourceName)
+ {
+ return Array.IndexOf(GlobalSources, SourceName) >= 0;
+ }
+
+ public static LanguageSourceData GetSourceContaining(string term, bool fallbackToFirst = true)
+ {
+ if (!string.IsNullOrEmpty(term))
+ {
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ if (Sources[i].GetTermData(term) != null)
+ {
+ return Sources[i];
+ }
+ }
+ }
+ if (!fallbackToFirst || Sources.Count <= 0)
+ {
+ return null;
+ }
+ return Sources[0];
+ }
+
+ public static UnityEngine.Object FindAsset(string value)
+ {
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ UnityEngine.Object @object = Sources[i].FindAsset(value);
+ if ((bool)@object)
+ {
+ return @object;
+ }
+ }
+ return null;
+ }
+
+ public static void ApplyDownloadedDataFromGoogle()
+ {
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ Sources[i].ApplyDownloadedDataFromGoogle();
+ }
+ }
+
+ public static string GetCurrentDeviceLanguage(bool force = false)
+ {
+ if (force || string.IsNullOrEmpty(mCurrentDeviceLanguage))
+ {
+ DetectDeviceLanguage();
+ }
+ return mCurrentDeviceLanguage;
+ }
+
+ private static void DetectDeviceLanguage()
+ {
+ mCurrentDeviceLanguage = Application.systemLanguage.ToString();
+ if (mCurrentDeviceLanguage == "ChineseSimplified")
+ {
+ mCurrentDeviceLanguage = "Chinese (Simplified)";
+ }
+ if (mCurrentDeviceLanguage == "ChineseTraditional")
+ {
+ mCurrentDeviceLanguage = "Chinese (Traditional)";
+ }
+ }
+
+ public static void RegisterTarget(ILocalizeTargetDescriptor desc)
+ {
+ if (mLocalizeTargets.FindIndex((ILocalizeTargetDescriptor x) => x.Name == desc.Name) != -1)
+ {
+ return;
+ }
+ for (int i = 0; i < mLocalizeTargets.Count; i++)
+ {
+ if (mLocalizeTargets[i].Priority > desc.Priority)
+ {
+ mLocalizeTargets.Insert(i, desc);
+ return;
+ }
+ }
+ mLocalizeTargets.Add(desc);
+ }
+
+ public static string GetTranslation(string Term, bool FixForRTL = true, int maxLineLengthForRTL = 0, bool ignoreRTLnumbers = true, bool applyParameters = false, GameObject localParametersRoot = null, string overrideLanguage = null, bool allowLocalizedParameters = true)
+ {
+ string Translation = null;
+ TryGetTranslation(Term, out Translation, FixForRTL, maxLineLengthForRTL, ignoreRTLnumbers, applyParameters, localParametersRoot, overrideLanguage, allowLocalizedParameters);
+ return Translation;
+ }
+
+ public static string GetTermTranslation(string Term, bool FixForRTL = true, int maxLineLengthForRTL = 0, bool ignoreRTLnumbers = true, bool applyParameters = false, GameObject localParametersRoot = null, string overrideLanguage = null, bool allowLocalizedParameters = true)
+ {
+ return GetTranslation(Term, FixForRTL, maxLineLengthForRTL, ignoreRTLnumbers, applyParameters, localParametersRoot, overrideLanguage, allowLocalizedParameters);
+ }
+
+ public static bool TryGetTranslation(string Term, out string Translation, bool FixForRTL = true, int maxLineLengthForRTL = 0, bool ignoreRTLnumbers = true, bool applyParameters = false, GameObject localParametersRoot = null, string overrideLanguage = null, bool allowLocalizedParameters = true)
+ {
+ Translation = null;
+ if (string.IsNullOrEmpty(Term))
+ {
+ return false;
+ }
+ InitializeIfNeeded();
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ if (Sources[i].TryGetTranslation(Term, out Translation, overrideLanguage))
+ {
+ if (applyParameters)
+ {
+ ApplyLocalizationParams(ref Translation, localParametersRoot, allowLocalizedParameters);
+ }
+ if (IsRight2Left && FixForRTL)
+ {
+ Translation = ApplyRTLfix(Translation, maxLineLengthForRTL, ignoreRTLnumbers);
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static T GetTranslatedObject<T>(string AssetName, Localize optionalLocComp = null) where T : UnityEngine.Object
+ {
+ if (optionalLocComp != null)
+ {
+ return optionalLocComp.FindTranslatedObject<T>(AssetName);
+ }
+ T val = FindAsset(AssetName) as T;
+ if ((bool)(UnityEngine.Object)val)
+ {
+ return val;
+ }
+ return ResourceManager.pInstance.GetAsset<T>(AssetName);
+ }
+
+ public static T GetTranslatedObjectByTermName<T>(string Term, Localize optionalLocComp = null) where T : UnityEngine.Object
+ {
+ return GetTranslatedObject<T>(GetTranslation(Term, FixForRTL: false));
+ }
+
+ public static string GetAppName(string languageCode)
+ {
+ if (!string.IsNullOrEmpty(languageCode))
+ {
+ for (int i = 0; i < Sources.Count; i++)
+ {
+ if (string.IsNullOrEmpty(Sources[i].mTerm_AppName))
+ {
+ continue;
+ }
+ int languageIndexFromCode = Sources[i].GetLanguageIndexFromCode(languageCode, exactMatch: false);
+ if (languageIndexFromCode < 0)
+ {
+ continue;
+ }
+ TermData termData = Sources[i].GetTermData(Sources[i].mTerm_AppName);
+ if (termData != null)
+ {
+ string translation = termData.GetTranslation(languageIndexFromCode);
+ if (!string.IsNullOrEmpty(translation))
+ {
+ return translation;
+ }
+ }
+ }
+ }
+ return Application.productName;
+ }
+
+ public static void LocalizeAll(bool Force = false)
+ {
+ LoadCurrentLanguage();
+ if (!Application.isPlaying)
+ {
+ DoLocalizeAll(Force);
+ return;
+ }
+ mLocalizeIsScheduledWithForcedValue |= Force;
+ if (!mLocalizeIsScheduled)
+ {
+ CoroutineManager.Start(Coroutine_LocalizeAll());
+ }
+ }
+
+ private static IEnumerator Coroutine_LocalizeAll()
+ {
+ mLocalizeIsScheduled = true;
+ yield return null;
+ mLocalizeIsScheduled = false;
+ bool force = mLocalizeIsScheduledWithForcedValue;
+ mLocalizeIsScheduledWithForcedValue = false;
+ DoLocalizeAll(force);
+ }
+
+ private static void DoLocalizeAll(bool Force = false)
+ {
+ Localize[] array = (Localize[])Resources.FindObjectsOfTypeAll(typeof(Localize));
+ int i = 0;
+ for (int num = array.Length; i < num; i++)
+ {
+ array[i].OnLocalize(Force);
+ }
+ if (LocalizationManager.OnLocalizeEvent != null)
+ {
+ LocalizationManager.OnLocalizeEvent();
+ }
+ }
+
+ public static List<string> GetCategories()
+ {
+ List<string> list = new List<string>();
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ Sources[i].GetCategories(OnlyMainCategory: false, list);
+ }
+ return list;
+ }
+
+ public static List<string> GetTermsList(string Category = null)
+ {
+ if (Sources.Count == 0)
+ {
+ UpdateSources();
+ }
+ if (Sources.Count == 1)
+ {
+ return Sources[0].GetTermsList(Category);
+ }
+ HashSet<string> hashSet = new HashSet<string>();
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ hashSet.UnionWith(Sources[i].GetTermsList(Category));
+ }
+ return new List<string>(hashSet);
+ }
+
+ public static TermData GetTermData(string term)
+ {
+ InitializeIfNeeded();
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ TermData termData = Sources[i].GetTermData(term);
+ if (termData != null)
+ {
+ return termData;
+ }
+ }
+ return null;
+ }
+
+ public static TermData GetTermData(string term, out LanguageSourceData source)
+ {
+ InitializeIfNeeded();
+ int i = 0;
+ for (int count = Sources.Count; i < count; i++)
+ {
+ TermData termData = Sources[i].GetTermData(term);
+ if (termData != null)
+ {
+ source = Sources[i];
+ return termData;
+ }
+ }
+ source = null;
+ return null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizationParamsManager.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizationParamsManager.cs
new file mode 100644
index 0000000..2690bf1
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizationParamsManager.cs
@@ -0,0 +1,97 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class LocalizationParamsManager : MonoBehaviour, ILocalizationParamsManager
+{
+ [Serializable]
+ public struct ParamValue
+ {
+ public string Name;
+
+ public string Value;
+ }
+
+ [SerializeField]
+ public List<ParamValue> _Params = new List<ParamValue>();
+
+ public bool _IsGlobalManager;
+
+ public string GetParameterValue(string ParamName)
+ {
+ if (_Params != null)
+ {
+ int i = 0;
+ for (int count = _Params.Count; i < count; i++)
+ {
+ if (_Params[i].Name == ParamName)
+ {
+ return _Params[i].Value;
+ }
+ }
+ }
+ return null;
+ }
+
+ public void SetParameterValue(string ParamName, string ParamValue, bool localize = true)
+ {
+ bool flag = false;
+ int i = 0;
+ for (int count = _Params.Count; i < count; i++)
+ {
+ if (_Params[i].Name == ParamName)
+ {
+ ParamValue value = _Params[i];
+ value.Value = ParamValue;
+ _Params[i] = value;
+ flag = true;
+ break;
+ }
+ }
+ if (!flag)
+ {
+ _Params.Add(new ParamValue
+ {
+ Name = ParamName,
+ Value = ParamValue
+ });
+ }
+ if (localize)
+ {
+ OnLocalize();
+ }
+ }
+
+ public void OnLocalize()
+ {
+ Localize component = GetComponent<Localize>();
+ if (component != null)
+ {
+ component.OnLocalize(Force: true);
+ }
+ }
+
+ public virtual void OnEnable()
+ {
+ if (_IsGlobalManager)
+ {
+ DoAutoRegister();
+ }
+ }
+
+ public void DoAutoRegister()
+ {
+ if (!LocalizationManager.ParamManagers.Contains(this))
+ {
+ LocalizationManager.ParamManagers.Add(this);
+ LocalizationManager.LocalizeAll(Force: true);
+ }
+ }
+
+ public void OnDisable()
+ {
+ LocalizationManager.ParamManagers.Remove(this);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizationReader.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizationReader.cs
new file mode 100644
index 0000000..a940e76
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizationReader.cs
@@ -0,0 +1,195 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class LocalizationReader
+{
+ public static Dictionary<string, string> ReadTextAsset(TextAsset asset)
+ {
+ StringReader stringReader = new StringReader(Encoding.UTF8.GetString(asset.bytes, 0, asset.bytes.Length).Replace("\r\n", "\n").Replace("\r", "\n"));
+ Dictionary<string, string> dictionary = new Dictionary<string, string>(StringComparer.Ordinal);
+ string line;
+ while ((line = stringReader.ReadLine()) != null)
+ {
+ if (TextAsset_ReadLine(line, out var key, out var value, out var _, out var _, out var _) && !string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(value))
+ {
+ dictionary[key] = value;
+ }
+ }
+ return dictionary;
+ }
+
+ public static bool TextAsset_ReadLine(string line, out string key, out string value, out string category, out string comment, out string termType)
+ {
+ key = string.Empty;
+ category = string.Empty;
+ comment = string.Empty;
+ termType = string.Empty;
+ value = string.Empty;
+ int num = line.LastIndexOf("//", StringComparison.Ordinal);
+ if (num >= 0)
+ {
+ comment = line.Substring(num + 2).Trim();
+ comment = DecodeString(comment);
+ line = line.Substring(0, num);
+ }
+ int num2 = line.IndexOf("=", StringComparison.Ordinal);
+ if (num2 < 0)
+ {
+ return false;
+ }
+ key = line.Substring(0, num2).Trim();
+ value = line.Substring(num2 + 1).Trim();
+ value = value.Replace("\r\n", "\n").Replace("\n", "\\n");
+ value = DecodeString(value);
+ if (key.Length > 2 && key[0] == '[')
+ {
+ int num3 = key.IndexOf(']');
+ if (num3 >= 0)
+ {
+ termType = key.Substring(1, num3 - 1);
+ key = key.Substring(num3 + 1);
+ }
+ }
+ ValidateFullTerm(ref key);
+ return true;
+ }
+
+ public static string ReadCSVfile(string Path, Encoding encoding)
+ {
+ string text = string.Empty;
+ using (StreamReader streamReader = new StreamReader(Path, encoding))
+ {
+ text = streamReader.ReadToEnd();
+ }
+ text = text.Replace("\r\n", "\n");
+ return text.Replace("\r", "\n");
+ }
+
+ public static List<string[]> ReadCSV(string Text, char Separator = ',')
+ {
+ int iStart = 0;
+ List<string[]> list = new List<string[]>();
+ while (iStart < Text.Length)
+ {
+ string[] array = ParseCSVline(Text, ref iStart, Separator);
+ if (array == null)
+ {
+ break;
+ }
+ list.Add(array);
+ }
+ return list;
+ }
+
+ private static string[] ParseCSVline(string Line, ref int iStart, char Separator)
+ {
+ List<string> list = new List<string>();
+ int length = Line.Length;
+ int iWordStart = iStart;
+ bool flag = false;
+ while (iStart < length)
+ {
+ char c = Line[iStart];
+ if (flag)
+ {
+ if (c == '"')
+ {
+ if (iStart + 1 >= length || Line[iStart + 1] != '"')
+ {
+ flag = false;
+ }
+ else if (iStart + 2 < length && Line[iStart + 2] == '"')
+ {
+ flag = false;
+ iStart += 2;
+ }
+ else
+ {
+ iStart++;
+ }
+ }
+ }
+ else if (c == '\n' || c == Separator)
+ {
+ AddCSVtoken(ref list, ref Line, iStart, ref iWordStart);
+ if (c == '\n')
+ {
+ iStart++;
+ break;
+ }
+ }
+ else if (c == '"')
+ {
+ flag = true;
+ }
+ iStart++;
+ }
+ if (iStart > iWordStart)
+ {
+ AddCSVtoken(ref list, ref Line, iStart, ref iWordStart);
+ }
+ return list.ToArray();
+ }
+
+ private static void AddCSVtoken(ref List<string> list, ref string Line, int iEnd, ref int iWordStart)
+ {
+ string text = Line.Substring(iWordStart, iEnd - iWordStart);
+ iWordStart = iEnd + 1;
+ text = text.Replace("\"\"", "\"");
+ if (text.Length > 1 && text[0] == '"' && text[text.Length - 1] == '"')
+ {
+ text = text.Substring(1, text.Length - 2);
+ }
+ list.Add(text);
+ }
+
+ public static List<string[]> ReadI2CSV(string Text)
+ {
+ string[] separator = new string[1] { "[*]" };
+ string[] separator2 = new string[1] { "[ln]" };
+ List<string[]> list = new List<string[]>();
+ string[] array = Text.Split(separator2, StringSplitOptions.None);
+ foreach (string text in array)
+ {
+ list.Add(text.Split(separator, StringSplitOptions.None));
+ }
+ return list;
+ }
+
+ public static void ValidateFullTerm(ref string Term)
+ {
+ Term = Term.Replace('\\', '/');
+ int num = Term.IndexOf('/');
+ if (num >= 0)
+ {
+ int startIndex;
+ while ((startIndex = Term.LastIndexOf('/')) != num)
+ {
+ Term = Term.Remove(startIndex, 1);
+ }
+ }
+ }
+
+ public static string EncodeString(string str)
+ {
+ if (string.IsNullOrEmpty(str))
+ {
+ return string.Empty;
+ }
+ return str.Replace("\r\n", "<\\n>").Replace("\r", "<\\n>").Replace("\n", "<\\n>");
+ }
+
+ public static string DecodeString(string str)
+ {
+ if (string.IsNullOrEmpty(str))
+ {
+ return string.Empty;
+ }
+ return str.Replace("<\\n>", "\r\n");
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/Localize.cs b/Thronefall_v1.57/Thronefall/I2.Loc/Localize.cs
new file mode 100644
index 0000000..5fc8fac
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/Localize.cs
@@ -0,0 +1,464 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using UnityEngine;
+using UnityEngine.Events;
+
+namespace I2.Loc;
+
+[AddComponentMenu("I2/Localization/I2 Localize")]
+public class Localize : MonoBehaviour
+{
+ public enum TermModification
+ {
+ DontModify,
+ ToUpper,
+ ToLower,
+ ToUpperFirst,
+ ToTitle
+ }
+
+ public string mTerm = string.Empty;
+
+ public string mTermSecondary = string.Empty;
+
+ [NonSerialized]
+ public string FinalTerm;
+
+ [NonSerialized]
+ public string FinalSecondaryTerm;
+
+ public TermModification PrimaryTermModifier;
+
+ public TermModification SecondaryTermModifier;
+
+ public string TermPrefix;
+
+ public string TermSuffix;
+
+ public bool LocalizeOnAwake = true;
+
+ private string LastLocalizedLanguage;
+
+ public bool IgnoreRTL;
+
+ public int MaxCharactersInRTL;
+
+ public bool IgnoreNumbersInRTL = true;
+
+ public bool CorrectAlignmentForRTL = true;
+
+ public bool AddSpacesToJoinedLanguages;
+
+ public bool AllowLocalizedParameters = true;
+
+ public bool AllowParameters = true;
+
+ public List<UnityEngine.Object> TranslatedObjects = new List<UnityEngine.Object>();
+
+ [NonSerialized]
+ public Dictionary<string, UnityEngine.Object> mAssetDictionary = new Dictionary<string, UnityEngine.Object>(StringComparer.Ordinal);
+
+ public UnityEvent LocalizeEvent = new UnityEvent();
+
+ public static string MainTranslation;
+
+ public static string SecondaryTranslation;
+
+ public static string CallBackTerm;
+
+ public static string CallBackSecondaryTerm;
+
+ public static Localize CurrentLocalizeComponent;
+
+ public bool AlwaysForceLocalize;
+
+ [SerializeField]
+ public EventCallback LocalizeCallBack = new EventCallback();
+
+ public bool mGUI_ShowReferences;
+
+ public bool mGUI_ShowTems = true;
+
+ public bool mGUI_ShowCallback;
+
+ public ILocalizeTarget mLocalizeTarget;
+
+ public string mLocalizeTargetName;
+
+ public string Term
+ {
+ get
+ {
+ return mTerm;
+ }
+ set
+ {
+ SetTerm(value);
+ }
+ }
+
+ public string SecondaryTerm
+ {
+ get
+ {
+ return mTermSecondary;
+ }
+ set
+ {
+ SetTerm(null, value);
+ }
+ }
+
+ private void Awake()
+ {
+ UpdateAssetDictionary();
+ FindTarget();
+ if (LocalizeOnAwake)
+ {
+ OnLocalize();
+ }
+ }
+
+ private void OnEnable()
+ {
+ OnLocalize();
+ }
+
+ public bool HasCallback()
+ {
+ if (LocalizeCallBack.HasCallback())
+ {
+ return true;
+ }
+ return LocalizeEvent.GetPersistentEventCount() > 0;
+ }
+
+ public void OnLocalize(bool Force = false)
+ {
+ if ((!Force && (!base.enabled || base.gameObject == null || !base.gameObject.activeInHierarchy)) || string.IsNullOrEmpty(LocalizationManager.CurrentLanguage) || (!AlwaysForceLocalize && !Force && !HasCallback() && LastLocalizedLanguage == LocalizationManager.CurrentLanguage))
+ {
+ return;
+ }
+ LastLocalizedLanguage = LocalizationManager.CurrentLanguage;
+ if (string.IsNullOrEmpty(FinalTerm) || string.IsNullOrEmpty(FinalSecondaryTerm))
+ {
+ GetFinalTerms(out FinalTerm, out FinalSecondaryTerm);
+ }
+ bool flag = I2Utils.IsPlaying() && HasCallback();
+ if (!flag && string.IsNullOrEmpty(FinalTerm) && string.IsNullOrEmpty(FinalSecondaryTerm))
+ {
+ return;
+ }
+ CurrentLocalizeComponent = this;
+ CallBackTerm = FinalTerm;
+ CallBackSecondaryTerm = FinalSecondaryTerm;
+ MainTranslation = ((string.IsNullOrEmpty(FinalTerm) || FinalTerm == "-") ? null : LocalizationManager.GetTranslation(FinalTerm, FixForRTL: false));
+ SecondaryTranslation = ((string.IsNullOrEmpty(FinalSecondaryTerm) || FinalSecondaryTerm == "-") ? null : LocalizationManager.GetTranslation(FinalSecondaryTerm, FixForRTL: false));
+ if (!flag && string.IsNullOrEmpty(FinalTerm) && string.IsNullOrEmpty(SecondaryTranslation))
+ {
+ return;
+ }
+ LocalizeCallBack.Execute(this);
+ LocalizeEvent.Invoke();
+ if (AllowParameters)
+ {
+ LocalizationManager.ApplyLocalizationParams(ref MainTranslation, base.gameObject, AllowLocalizedParameters);
+ }
+ if (!FindTarget())
+ {
+ return;
+ }
+ bool flag2 = LocalizationManager.IsRight2Left && !IgnoreRTL;
+ if (MainTranslation != null)
+ {
+ switch (PrimaryTermModifier)
+ {
+ case TermModification.ToUpper:
+ MainTranslation = MainTranslation.ToUpper();
+ break;
+ case TermModification.ToLower:
+ MainTranslation = MainTranslation.ToLower();
+ break;
+ case TermModification.ToUpperFirst:
+ MainTranslation = GoogleTranslation.UppercaseFirst(MainTranslation);
+ break;
+ case TermModification.ToTitle:
+ MainTranslation = GoogleTranslation.TitleCase(MainTranslation);
+ break;
+ }
+ if (!string.IsNullOrEmpty(TermPrefix))
+ {
+ MainTranslation = (flag2 ? (MainTranslation + TermPrefix) : (TermPrefix + MainTranslation));
+ }
+ if (!string.IsNullOrEmpty(TermSuffix))
+ {
+ MainTranslation = (flag2 ? (TermSuffix + MainTranslation) : (MainTranslation + TermSuffix));
+ }
+ if (AddSpacesToJoinedLanguages && LocalizationManager.HasJoinedWords && !string.IsNullOrEmpty(MainTranslation))
+ {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.Append(MainTranslation[0]);
+ int i = 1;
+ for (int length = MainTranslation.Length; i < length; i++)
+ {
+ stringBuilder.Append(' ');
+ stringBuilder.Append(MainTranslation[i]);
+ }
+ MainTranslation = stringBuilder.ToString();
+ }
+ if (flag2 && mLocalizeTarget.AllowMainTermToBeRTL() && !string.IsNullOrEmpty(MainTranslation))
+ {
+ MainTranslation = LocalizationManager.ApplyRTLfix(MainTranslation, MaxCharactersInRTL, IgnoreNumbersInRTL);
+ }
+ }
+ if (SecondaryTranslation != null)
+ {
+ switch (SecondaryTermModifier)
+ {
+ case TermModification.ToUpper:
+ SecondaryTranslation = SecondaryTranslation.ToUpper();
+ break;
+ case TermModification.ToLower:
+ SecondaryTranslation = SecondaryTranslation.ToLower();
+ break;
+ case TermModification.ToUpperFirst:
+ SecondaryTranslation = GoogleTranslation.UppercaseFirst(SecondaryTranslation);
+ break;
+ case TermModification.ToTitle:
+ SecondaryTranslation = GoogleTranslation.TitleCase(SecondaryTranslation);
+ break;
+ }
+ if (flag2 && mLocalizeTarget.AllowSecondTermToBeRTL() && !string.IsNullOrEmpty(SecondaryTranslation))
+ {
+ SecondaryTranslation = LocalizationManager.ApplyRTLfix(SecondaryTranslation);
+ }
+ }
+ if (LocalizationManager.HighlightLocalizedTargets)
+ {
+ MainTranslation = "LOC:" + FinalTerm;
+ }
+ mLocalizeTarget.DoLocalize(this, MainTranslation, SecondaryTranslation);
+ CurrentLocalizeComponent = null;
+ }
+
+ public bool FindTarget()
+ {
+ if (mLocalizeTarget != null && mLocalizeTarget.IsValid(this))
+ {
+ return true;
+ }
+ if (mLocalizeTarget != null)
+ {
+ UnityEngine.Object.DestroyImmediate(mLocalizeTarget);
+ mLocalizeTarget = null;
+ mLocalizeTargetName = null;
+ }
+ if (!string.IsNullOrEmpty(mLocalizeTargetName))
+ {
+ foreach (ILocalizeTargetDescriptor mLocalizeTarget in LocalizationManager.mLocalizeTargets)
+ {
+ if (mLocalizeTargetName == mLocalizeTarget.GetTargetType().ToString())
+ {
+ if (mLocalizeTarget.CanLocalize(this))
+ {
+ this.mLocalizeTarget = mLocalizeTarget.CreateTarget(this);
+ }
+ if (this.mLocalizeTarget != null)
+ {
+ return true;
+ }
+ }
+ }
+ }
+ foreach (ILocalizeTargetDescriptor mLocalizeTarget2 in LocalizationManager.mLocalizeTargets)
+ {
+ if (mLocalizeTarget2.CanLocalize(this))
+ {
+ this.mLocalizeTarget = mLocalizeTarget2.CreateTarget(this);
+ mLocalizeTargetName = mLocalizeTarget2.GetTargetType().ToString();
+ if (this.mLocalizeTarget != null)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public void GetFinalTerms(out string primaryTerm, out string secondaryTerm)
+ {
+ primaryTerm = string.Empty;
+ secondaryTerm = string.Empty;
+ if (FindTarget())
+ {
+ if (mLocalizeTarget != null)
+ {
+ mLocalizeTarget.GetFinalTerms(this, mTerm, mTermSecondary, out primaryTerm, out secondaryTerm);
+ primaryTerm = I2Utils.GetValidTermName(primaryTerm);
+ }
+ if (!string.IsNullOrEmpty(mTerm))
+ {
+ primaryTerm = mTerm;
+ }
+ if (!string.IsNullOrEmpty(mTermSecondary))
+ {
+ secondaryTerm = mTermSecondary;
+ }
+ if (primaryTerm != null)
+ {
+ primaryTerm = primaryTerm.Trim();
+ }
+ if (secondaryTerm != null)
+ {
+ secondaryTerm = secondaryTerm.Trim();
+ }
+ }
+ }
+
+ public string GetMainTargetsText()
+ {
+ string primaryTerm = null;
+ string secondaryTerm = null;
+ if (mLocalizeTarget != null)
+ {
+ mLocalizeTarget.GetFinalTerms(this, null, null, out primaryTerm, out secondaryTerm);
+ }
+ if (!string.IsNullOrEmpty(primaryTerm))
+ {
+ return primaryTerm;
+ }
+ return mTerm;
+ }
+
+ public void SetFinalTerms(string Main, string Secondary, out string primaryTerm, out string secondaryTerm, bool RemoveNonASCII)
+ {
+ primaryTerm = (RemoveNonASCII ? I2Utils.GetValidTermName(Main) : Main);
+ secondaryTerm = Secondary;
+ }
+
+ public void SetTerm(string primary)
+ {
+ if (!string.IsNullOrEmpty(primary))
+ {
+ FinalTerm = (mTerm = primary);
+ }
+ OnLocalize(Force: true);
+ }
+
+ public void SetTerm(string primary, string secondary)
+ {
+ if (!string.IsNullOrEmpty(primary))
+ {
+ FinalTerm = (mTerm = primary);
+ }
+ FinalSecondaryTerm = (mTermSecondary = secondary);
+ OnLocalize(Force: true);
+ }
+
+ internal T GetSecondaryTranslatedObj<T>(ref string mainTranslation, ref string secondaryTranslation) where T : UnityEngine.Object
+ {
+ DeserializeTranslation(mainTranslation, out var value, out var secondary);
+ T val = null;
+ if (!string.IsNullOrEmpty(secondary))
+ {
+ val = GetObject<T>(secondary);
+ if ((UnityEngine.Object)val != (UnityEngine.Object)null)
+ {
+ mainTranslation = value;
+ secondaryTranslation = secondary;
+ }
+ }
+ if ((UnityEngine.Object)val == (UnityEngine.Object)null)
+ {
+ val = GetObject<T>(secondaryTranslation);
+ }
+ return val;
+ }
+
+ public void UpdateAssetDictionary()
+ {
+ TranslatedObjects.RemoveAll((UnityEngine.Object x) => x == null);
+ mAssetDictionary = (from o in TranslatedObjects.Distinct()
+ group o by o.name).ToDictionary((IGrouping<string, UnityEngine.Object> g) => g.Key, (IGrouping<string, UnityEngine.Object> g) => g.First());
+ }
+
+ internal T GetObject<T>(string Translation) where T : UnityEngine.Object
+ {
+ if (string.IsNullOrEmpty(Translation))
+ {
+ return null;
+ }
+ return GetTranslatedObject<T>(Translation);
+ }
+
+ private T GetTranslatedObject<T>(string Translation) where T : UnityEngine.Object
+ {
+ return FindTranslatedObject<T>(Translation);
+ }
+
+ private void DeserializeTranslation(string translation, out string value, out string secondary)
+ {
+ if (!string.IsNullOrEmpty(translation) && translation.Length > 1 && translation[0] == '[')
+ {
+ int num = translation.IndexOf(']');
+ if (num > 0)
+ {
+ secondary = translation.Substring(1, num - 1);
+ value = translation.Substring(num + 1);
+ return;
+ }
+ }
+ value = translation;
+ secondary = string.Empty;
+ }
+
+ public T FindTranslatedObject<T>(string value) where T : UnityEngine.Object
+ {
+ if (string.IsNullOrEmpty(value))
+ {
+ return null;
+ }
+ if (mAssetDictionary == null || mAssetDictionary.Count != TranslatedObjects.Count)
+ {
+ UpdateAssetDictionary();
+ }
+ foreach (KeyValuePair<string, UnityEngine.Object> item in mAssetDictionary)
+ {
+ if (item.Value is T && value.EndsWith(item.Key, StringComparison.OrdinalIgnoreCase) && string.Compare(value, item.Key, StringComparison.OrdinalIgnoreCase) == 0)
+ {
+ return (T)item.Value;
+ }
+ }
+ T val = LocalizationManager.FindAsset(value) as T;
+ if ((bool)(UnityEngine.Object)val)
+ {
+ return val;
+ }
+ return ResourceManager.pInstance.GetAsset<T>(value);
+ }
+
+ public bool HasTranslatedObject(UnityEngine.Object Obj)
+ {
+ if (TranslatedObjects.Contains(Obj))
+ {
+ return true;
+ }
+ return ResourceManager.pInstance.HasAsset(Obj);
+ }
+
+ public void AddTranslatedObject(UnityEngine.Object Obj)
+ {
+ if (!TranslatedObjects.Contains(Obj))
+ {
+ TranslatedObjects.Add(Obj);
+ UpdateAssetDictionary();
+ }
+ }
+
+ public void SetGlobalLanguage(string Language)
+ {
+ LocalizationManager.CurrentLanguage = Language;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeDropdown.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeDropdown.cs
new file mode 100644
index 0000000..57fd328
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeDropdown.cs
@@ -0,0 +1,100 @@
+using System.Collections.Generic;
+using TMPro;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace I2.Loc;
+
+[AddComponentMenu("I2/Localization/Localize Dropdown")]
+public class LocalizeDropdown : MonoBehaviour
+{
+ public List<string> _Terms = new List<string>();
+
+ public void Start()
+ {
+ LocalizationManager.OnLocalizeEvent += OnLocalize;
+ OnLocalize();
+ }
+
+ public void OnDestroy()
+ {
+ LocalizationManager.OnLocalizeEvent -= OnLocalize;
+ }
+
+ private void OnEnable()
+ {
+ if (_Terms.Count == 0)
+ {
+ FillValues();
+ }
+ OnLocalize();
+ }
+
+ public void OnLocalize()
+ {
+ if (base.enabled && !(base.gameObject == null) && base.gameObject.activeInHierarchy && !string.IsNullOrEmpty(LocalizationManager.CurrentLanguage))
+ {
+ UpdateLocalization();
+ }
+ }
+
+ private void FillValues()
+ {
+ Dropdown component = GetComponent<Dropdown>();
+ if (component == null && I2Utils.IsPlaying())
+ {
+ FillValuesTMPro();
+ return;
+ }
+ foreach (Dropdown.OptionData option in component.options)
+ {
+ _Terms.Add(option.text);
+ }
+ }
+
+ public void UpdateLocalization()
+ {
+ Dropdown component = GetComponent<Dropdown>();
+ if (component == null)
+ {
+ UpdateLocalizationTMPro();
+ return;
+ }
+ component.options.Clear();
+ foreach (string term in _Terms)
+ {
+ string text = TextTranslator.Translate(term);
+ component.options.Add(new Dropdown.OptionData(text));
+ }
+ component.RefreshShownValue();
+ }
+
+ public void UpdateLocalizationTMPro()
+ {
+ TMP_Dropdown component = GetComponent<TMP_Dropdown>();
+ if (component == null)
+ {
+ return;
+ }
+ component.options.Clear();
+ foreach (string term in _Terms)
+ {
+ string text = TextTranslator.Translate(term);
+ component.options.Add(new TMP_Dropdown.OptionData(text));
+ }
+ component.RefreshShownValue();
+ }
+
+ private void FillValuesTMPro()
+ {
+ TMP_Dropdown component = GetComponent<TMP_Dropdown>();
+ if (component == null)
+ {
+ return;
+ }
+ foreach (TMP_Dropdown.OptionData option in component.options)
+ {
+ _Terms.Add(option.text);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget.cs
new file mode 100644
index 0000000..a746e60
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget.cs
@@ -0,0 +1,25 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public abstract class LocalizeTarget<T> : ILocalizeTarget where T : Object
+{
+ public T mTarget;
+
+ public override bool IsValid(Localize cmp)
+ {
+ if ((Object)mTarget != (Object)null)
+ {
+ Component component = mTarget as Component;
+ if (component != null && component.gameObject != cmp.gameObject)
+ {
+ mTarget = null;
+ }
+ }
+ if ((Object)mTarget == (Object)null)
+ {
+ mTarget = cmp.GetComponent<T>();
+ }
+ return (Object)mTarget != (Object)null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc.cs
new file mode 100644
index 0000000..44f67b2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc.cs
@@ -0,0 +1,17 @@
+using System;
+using UnityEngine;
+
+namespace I2.Loc;
+
+public abstract class LocalizeTargetDesc<T> : ILocalizeTargetDescriptor where T : ILocalizeTarget
+{
+ public override ILocalizeTarget CreateTarget(Localize cmp)
+ {
+ return ScriptableObject.CreateInstance<T>();
+ }
+
+ public override Type GetTargetType()
+ {
+ return typeof(T);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc_Child.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc_Child.cs
new file mode 100644
index 0000000..e8401c7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc_Child.cs
@@ -0,0 +1,9 @@
+namespace I2.Loc;
+
+public class LocalizeTargetDesc_Child : LocalizeTargetDesc<LocalizeTarget_UnityStandard_Child>
+{
+ public override bool CanLocalize(Localize cmp)
+ {
+ return cmp.transform.childCount > 1;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc_Prefab.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc_Prefab.cs
new file mode 100644
index 0000000..ee10200
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc_Prefab.cs
@@ -0,0 +1,9 @@
+namespace I2.Loc;
+
+public class LocalizeTargetDesc_Prefab : LocalizeTargetDesc<LocalizeTarget_UnityStandard_Prefab>
+{
+ public override bool CanLocalize(Localize cmp)
+ {
+ return true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc_Type.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc_Type.cs
new file mode 100644
index 0000000..5ee9dba
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTargetDesc_Type.cs
@@ -0,0 +1,23 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class LocalizeTargetDesc_Type<T, G> : LocalizeTargetDesc<G> where T : Object where G : LocalizeTarget<T>
+{
+ public override bool CanLocalize(Localize cmp)
+ {
+ return (Object)cmp.GetComponent<T>() != (Object)null;
+ }
+
+ public override ILocalizeTarget CreateTarget(Localize cmp)
+ {
+ T component = cmp.GetComponent<T>();
+ if ((Object)component == (Object)null)
+ {
+ return null;
+ }
+ G val = ScriptableObject.CreateInstance<G>();
+ val.mTarget = component;
+ return val;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_TextMeshPro_Label.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_TextMeshPro_Label.cs
new file mode 100644
index 0000000..6802642
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_TextMeshPro_Label.cs
@@ -0,0 +1,257 @@
+using System;
+using TMPro;
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class LocalizeTarget_TextMeshPro_Label : LocalizeTarget<TextMeshPro>
+{
+ private TextAlignmentOptions mAlignment_RTL = TextAlignmentOptions.Right;
+
+ private TextAlignmentOptions mAlignment_LTR = TextAlignmentOptions.Left;
+
+ private bool mAlignmentWasRTL;
+
+ private bool mInitializeAlignment = true;
+
+ static LocalizeTarget_TextMeshPro_Label()
+ {
+ AutoRegister();
+ }
+
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
+ private static void AutoRegister()
+ {
+ LocalizationManager.RegisterTarget(new LocalizeTargetDesc_Type<TextMeshPro, LocalizeTarget_TextMeshPro_Label>
+ {
+ Name = "TextMeshPro Label",
+ Priority = 100
+ });
+ }
+
+ public override eTermType GetPrimaryTermType(Localize cmp)
+ {
+ return eTermType.Text;
+ }
+
+ public override eTermType GetSecondaryTermType(Localize cmp)
+ {
+ return eTermType.Font;
+ }
+
+ public override bool CanUseSecondaryTerm()
+ {
+ return true;
+ }
+
+ public override bool AllowMainTermToBeRTL()
+ {
+ return true;
+ }
+
+ public override bool AllowSecondTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override void GetFinalTerms(Localize cmp, string Main, string Secondary, out string primaryTerm, out string secondaryTerm)
+ {
+ primaryTerm = (mTarget ? mTarget.text : null);
+ secondaryTerm = ((mTarget.font != null) ? mTarget.font.name : string.Empty);
+ }
+
+ public override void DoLocalize(Localize cmp, string mainTranslation, string secondaryTranslation)
+ {
+ TMP_FontAsset secondaryTranslatedObj = cmp.GetSecondaryTranslatedObj<TMP_FontAsset>(ref mainTranslation, ref secondaryTranslation);
+ if (secondaryTranslatedObj != null)
+ {
+ SetFont(mTarget, secondaryTranslatedObj);
+ }
+ else
+ {
+ Material secondaryTranslatedObj2 = cmp.GetSecondaryTranslatedObj<Material>(ref mainTranslation, ref secondaryTranslation);
+ if (secondaryTranslatedObj2 != null && mTarget.fontMaterial != secondaryTranslatedObj2)
+ {
+ if (!secondaryTranslatedObj2.name.StartsWith(mTarget.font.name, StringComparison.Ordinal))
+ {
+ secondaryTranslatedObj = GetTMPFontFromMaterial(cmp, secondaryTranslation.EndsWith(secondaryTranslatedObj2.name, StringComparison.Ordinal) ? secondaryTranslation : secondaryTranslatedObj2.name);
+ if (secondaryTranslatedObj != null)
+ {
+ SetFont(mTarget, secondaryTranslatedObj);
+ }
+ }
+ SetMaterial(mTarget, secondaryTranslatedObj2);
+ }
+ }
+ if (mInitializeAlignment)
+ {
+ mInitializeAlignment = false;
+ mAlignmentWasRTL = LocalizationManager.IsRight2Left;
+ InitAlignment_TMPro(mAlignmentWasRTL, mTarget.alignment, out mAlignment_LTR, out mAlignment_RTL);
+ }
+ else
+ {
+ InitAlignment_TMPro(mAlignmentWasRTL, mTarget.alignment, out var alignLTR, out var alignRTL);
+ if ((mAlignmentWasRTL && mAlignment_RTL != alignRTL) || (!mAlignmentWasRTL && mAlignment_LTR != alignLTR))
+ {
+ mAlignment_LTR = alignLTR;
+ mAlignment_RTL = alignRTL;
+ }
+ mAlignmentWasRTL = LocalizationManager.IsRight2Left;
+ }
+ if (mainTranslation != null && mTarget.text != mainTranslation)
+ {
+ if (cmp.CorrectAlignmentForRTL)
+ {
+ mTarget.alignment = (LocalizationManager.IsRight2Left ? mAlignment_RTL : mAlignment_LTR);
+ }
+ mTarget.isRightToLeftText = LocalizationManager.IsRight2Left;
+ if (LocalizationManager.IsRight2Left)
+ {
+ mainTranslation = I2Utils.ReverseText(mainTranslation);
+ }
+ mTarget.text = mainTranslation;
+ }
+ }
+
+ internal static TMP_FontAsset GetTMPFontFromMaterial(Localize cmp, string matName)
+ {
+ string text = " .\\/-[]()";
+ int num = matName.Length - 1;
+ while (num > 0)
+ {
+ while (num > 0 && text.IndexOf(matName[num]) >= 0)
+ {
+ num--;
+ }
+ if (num <= 0)
+ {
+ break;
+ }
+ string translation = matName.Substring(0, num + 1);
+ TMP_FontAsset @object = cmp.GetObject<TMP_FontAsset>(translation);
+ if (@object != null)
+ {
+ return @object;
+ }
+ while (num > 0 && text.IndexOf(matName[num]) < 0)
+ {
+ num--;
+ }
+ }
+ return null;
+ }
+
+ internal static void InitAlignment_TMPro(bool isRTL, TextAlignmentOptions alignment, out TextAlignmentOptions alignLTR, out TextAlignmentOptions alignRTL)
+ {
+ alignLTR = (alignRTL = alignment);
+ if (isRTL)
+ {
+ switch (alignment)
+ {
+ case TextAlignmentOptions.TopRight:
+ alignLTR = TextAlignmentOptions.TopLeft;
+ break;
+ case TextAlignmentOptions.Right:
+ alignLTR = TextAlignmentOptions.Left;
+ break;
+ case TextAlignmentOptions.BottomRight:
+ alignLTR = TextAlignmentOptions.BottomLeft;
+ break;
+ case TextAlignmentOptions.BaselineRight:
+ alignLTR = TextAlignmentOptions.BaselineLeft;
+ break;
+ case TextAlignmentOptions.MidlineRight:
+ alignLTR = TextAlignmentOptions.MidlineLeft;
+ break;
+ case TextAlignmentOptions.CaplineRight:
+ alignLTR = TextAlignmentOptions.CaplineLeft;
+ break;
+ case TextAlignmentOptions.TopLeft:
+ alignLTR = TextAlignmentOptions.TopRight;
+ break;
+ case TextAlignmentOptions.Left:
+ alignLTR = TextAlignmentOptions.Right;
+ break;
+ case TextAlignmentOptions.BottomLeft:
+ alignLTR = TextAlignmentOptions.BottomRight;
+ break;
+ case TextAlignmentOptions.BaselineLeft:
+ alignLTR = TextAlignmentOptions.BaselineRight;
+ break;
+ case TextAlignmentOptions.MidlineLeft:
+ alignLTR = TextAlignmentOptions.MidlineRight;
+ break;
+ case TextAlignmentOptions.CaplineLeft:
+ alignLTR = TextAlignmentOptions.CaplineRight;
+ break;
+ }
+ }
+ else
+ {
+ switch (alignment)
+ {
+ case TextAlignmentOptions.TopRight:
+ alignRTL = TextAlignmentOptions.TopLeft;
+ break;
+ case TextAlignmentOptions.Right:
+ alignRTL = TextAlignmentOptions.Left;
+ break;
+ case TextAlignmentOptions.BottomRight:
+ alignRTL = TextAlignmentOptions.BottomLeft;
+ break;
+ case TextAlignmentOptions.BaselineRight:
+ alignRTL = TextAlignmentOptions.BaselineLeft;
+ break;
+ case TextAlignmentOptions.MidlineRight:
+ alignRTL = TextAlignmentOptions.MidlineLeft;
+ break;
+ case TextAlignmentOptions.CaplineRight:
+ alignRTL = TextAlignmentOptions.CaplineLeft;
+ break;
+ case TextAlignmentOptions.TopLeft:
+ alignRTL = TextAlignmentOptions.TopRight;
+ break;
+ case TextAlignmentOptions.Left:
+ alignRTL = TextAlignmentOptions.Right;
+ break;
+ case TextAlignmentOptions.BottomLeft:
+ alignRTL = TextAlignmentOptions.BottomRight;
+ break;
+ case TextAlignmentOptions.BaselineLeft:
+ alignRTL = TextAlignmentOptions.BaselineRight;
+ break;
+ case TextAlignmentOptions.MidlineLeft:
+ alignRTL = TextAlignmentOptions.MidlineRight;
+ break;
+ case TextAlignmentOptions.CaplineLeft:
+ alignRTL = TextAlignmentOptions.CaplineRight;
+ break;
+ }
+ }
+ }
+
+ internal static void SetFont(TMP_Text label, TMP_FontAsset newFont)
+ {
+ if (label.font != newFont)
+ {
+ label.font = newFont;
+ }
+ if (label.linkedTextComponent != null)
+ {
+ SetFont(label.linkedTextComponent, newFont);
+ }
+ }
+
+ internal static void SetMaterial(TMP_Text label, Material newMat)
+ {
+ if (label.fontSharedMaterial != newMat)
+ {
+ label.fontSharedMaterial = newMat;
+ }
+ if (label.linkedTextComponent != null)
+ {
+ SetMaterial(label.linkedTextComponent, newMat);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_TextMeshPro_UGUI.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_TextMeshPro_UGUI.cs
new file mode 100644
index 0000000..e2f3d7d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_TextMeshPro_UGUI.cs
@@ -0,0 +1,116 @@
+using System;
+using TMPro;
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class LocalizeTarget_TextMeshPro_UGUI : LocalizeTarget<TextMeshProUGUI>
+{
+ public TextAlignmentOptions mAlignment_RTL = TextAlignmentOptions.Right;
+
+ public TextAlignmentOptions mAlignment_LTR = TextAlignmentOptions.Left;
+
+ public bool mAlignmentWasRTL;
+
+ public bool mInitializeAlignment = true;
+
+ static LocalizeTarget_TextMeshPro_UGUI()
+ {
+ AutoRegister();
+ }
+
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
+ private static void AutoRegister()
+ {
+ LocalizationManager.RegisterTarget(new LocalizeTargetDesc_Type<TextMeshProUGUI, LocalizeTarget_TextMeshPro_UGUI>
+ {
+ Name = "TextMeshPro UGUI",
+ Priority = 100
+ });
+ }
+
+ public override eTermType GetPrimaryTermType(Localize cmp)
+ {
+ return eTermType.Text;
+ }
+
+ public override eTermType GetSecondaryTermType(Localize cmp)
+ {
+ return eTermType.TextMeshPFont;
+ }
+
+ public override bool CanUseSecondaryTerm()
+ {
+ return true;
+ }
+
+ public override bool AllowMainTermToBeRTL()
+ {
+ return true;
+ }
+
+ public override bool AllowSecondTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override void GetFinalTerms(Localize cmp, string Main, string Secondary, out string primaryTerm, out string secondaryTerm)
+ {
+ primaryTerm = (mTarget ? mTarget.text : null);
+ secondaryTerm = ((mTarget.font != null) ? mTarget.font.name : string.Empty);
+ }
+
+ public override void DoLocalize(Localize cmp, string mainTranslation, string secondaryTranslation)
+ {
+ TMP_FontAsset secondaryTranslatedObj = cmp.GetSecondaryTranslatedObj<TMP_FontAsset>(ref mainTranslation, ref secondaryTranslation);
+ if (secondaryTranslatedObj != null)
+ {
+ LocalizeTarget_TextMeshPro_Label.SetFont(mTarget, secondaryTranslatedObj);
+ }
+ else
+ {
+ Material secondaryTranslatedObj2 = cmp.GetSecondaryTranslatedObj<Material>(ref mainTranslation, ref secondaryTranslation);
+ if (secondaryTranslatedObj2 != null && mTarget.fontMaterial != secondaryTranslatedObj2)
+ {
+ if (!secondaryTranslatedObj2.name.StartsWith(mTarget.font.name, StringComparison.Ordinal))
+ {
+ secondaryTranslatedObj = LocalizeTarget_TextMeshPro_Label.GetTMPFontFromMaterial(cmp, secondaryTranslation.EndsWith(secondaryTranslatedObj2.name, StringComparison.Ordinal) ? secondaryTranslation : secondaryTranslatedObj2.name);
+ if (secondaryTranslatedObj != null)
+ {
+ LocalizeTarget_TextMeshPro_Label.SetFont(mTarget, secondaryTranslatedObj);
+ }
+ }
+ LocalizeTarget_TextMeshPro_Label.SetMaterial(mTarget, secondaryTranslatedObj2);
+ }
+ }
+ if (mInitializeAlignment)
+ {
+ mInitializeAlignment = false;
+ mAlignmentWasRTL = LocalizationManager.IsRight2Left;
+ LocalizeTarget_TextMeshPro_Label.InitAlignment_TMPro(mAlignmentWasRTL, mTarget.alignment, out mAlignment_LTR, out mAlignment_RTL);
+ }
+ else
+ {
+ LocalizeTarget_TextMeshPro_Label.InitAlignment_TMPro(mAlignmentWasRTL, mTarget.alignment, out var alignLTR, out var alignRTL);
+ if ((mAlignmentWasRTL && mAlignment_RTL != alignRTL) || (!mAlignmentWasRTL && mAlignment_LTR != alignLTR))
+ {
+ mAlignment_LTR = alignLTR;
+ mAlignment_RTL = alignRTL;
+ }
+ mAlignmentWasRTL = LocalizationManager.IsRight2Left;
+ }
+ if (mainTranslation != null && mTarget.text != mainTranslation)
+ {
+ if (cmp.CorrectAlignmentForRTL)
+ {
+ mTarget.alignment = (LocalizationManager.IsRight2Left ? mAlignment_RTL : mAlignment_LTR);
+ }
+ mTarget.isRightToLeftText = LocalizationManager.IsRight2Left;
+ if (LocalizationManager.IsRight2Left)
+ {
+ mainTranslation = I2Utils.ReverseText(mainTranslation);
+ }
+ mTarget.text = mainTranslation;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_AudioSource.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_AudioSource.cs
new file mode 100644
index 0000000..b540830
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_AudioSource.cs
@@ -0,0 +1,68 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class LocalizeTarget_UnityStandard_AudioSource : LocalizeTarget<AudioSource>
+{
+ static LocalizeTarget_UnityStandard_AudioSource()
+ {
+ AutoRegister();
+ }
+
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
+ private static void AutoRegister()
+ {
+ LocalizationManager.RegisterTarget(new LocalizeTargetDesc_Type<AudioSource, LocalizeTarget_UnityStandard_AudioSource>
+ {
+ Name = "AudioSource",
+ Priority = 100
+ });
+ }
+
+ public override eTermType GetPrimaryTermType(Localize cmp)
+ {
+ return eTermType.AudioClip;
+ }
+
+ public override eTermType GetSecondaryTermType(Localize cmp)
+ {
+ return eTermType.Text;
+ }
+
+ public override bool CanUseSecondaryTerm()
+ {
+ return false;
+ }
+
+ public override bool AllowMainTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override bool AllowSecondTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override void GetFinalTerms(Localize cmp, string Main, string Secondary, out string primaryTerm, out string secondaryTerm)
+ {
+ AudioClip clip = mTarget.clip;
+ primaryTerm = (clip ? clip.name : string.Empty);
+ secondaryTerm = null;
+ }
+
+ public override void DoLocalize(Localize cmp, string mainTranslation, string secondaryTranslation)
+ {
+ bool num = (mTarget.isPlaying || mTarget.loop) && Application.isPlaying;
+ AudioClip clip = mTarget.clip;
+ AudioClip audioClip = cmp.FindTranslatedObject<AudioClip>(mainTranslation);
+ if (clip != audioClip)
+ {
+ mTarget.clip = audioClip;
+ }
+ if (num && (bool)mTarget.clip)
+ {
+ mTarget.Play();
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_Child.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_Child.cs
new file mode 100644
index 0000000..da89189
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_Child.cs
@@ -0,0 +1,76 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class LocalizeTarget_UnityStandard_Child : LocalizeTarget<GameObject>
+{
+ static LocalizeTarget_UnityStandard_Child()
+ {
+ AutoRegister();
+ }
+
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
+ private static void AutoRegister()
+ {
+ LocalizationManager.RegisterTarget(new LocalizeTargetDesc_Child
+ {
+ Name = "Child",
+ Priority = 200
+ });
+ }
+
+ public override bool IsValid(Localize cmp)
+ {
+ return cmp.transform.childCount > 1;
+ }
+
+ public override eTermType GetPrimaryTermType(Localize cmp)
+ {
+ return eTermType.GameObject;
+ }
+
+ public override eTermType GetSecondaryTermType(Localize cmp)
+ {
+ return eTermType.Text;
+ }
+
+ public override bool CanUseSecondaryTerm()
+ {
+ return false;
+ }
+
+ public override bool AllowMainTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override bool AllowSecondTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override void GetFinalTerms(Localize cmp, string Main, string Secondary, out string primaryTerm, out string secondaryTerm)
+ {
+ primaryTerm = cmp.name;
+ secondaryTerm = null;
+ }
+
+ public override void DoLocalize(Localize cmp, string mainTranslation, string secondaryTranslation)
+ {
+ if (!string.IsNullOrEmpty(mainTranslation))
+ {
+ Transform transform = cmp.transform;
+ string text = mainTranslation;
+ int num = mainTranslation.LastIndexOfAny(LanguageSourceData.CategorySeparators);
+ if (num >= 0)
+ {
+ text = text.Substring(num + 1);
+ }
+ for (int i = 0; i < transform.childCount; i++)
+ {
+ Transform child = transform.GetChild(i);
+ child.gameObject.SetActive(child.name == text);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_MeshRenderer.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_MeshRenderer.cs
new file mode 100644
index 0000000..07cbecd
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_MeshRenderer.cs
@@ -0,0 +1,89 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class LocalizeTarget_UnityStandard_MeshRenderer : LocalizeTarget<MeshRenderer>
+{
+ static LocalizeTarget_UnityStandard_MeshRenderer()
+ {
+ AutoRegister();
+ }
+
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
+ private static void AutoRegister()
+ {
+ LocalizationManager.RegisterTarget(new LocalizeTargetDesc_Type<MeshRenderer, LocalizeTarget_UnityStandard_MeshRenderer>
+ {
+ Name = "MeshRenderer",
+ Priority = 800
+ });
+ }
+
+ public override eTermType GetPrimaryTermType(Localize cmp)
+ {
+ return eTermType.Mesh;
+ }
+
+ public override eTermType GetSecondaryTermType(Localize cmp)
+ {
+ return eTermType.Material;
+ }
+
+ public override bool CanUseSecondaryTerm()
+ {
+ return true;
+ }
+
+ public override bool AllowMainTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override bool AllowSecondTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override void GetFinalTerms(Localize cmp, string Main, string Secondary, out string primaryTerm, out string secondaryTerm)
+ {
+ if (mTarget == null)
+ {
+ primaryTerm = (secondaryTerm = null);
+ }
+ else
+ {
+ MeshFilter component = mTarget.GetComponent<MeshFilter>();
+ if (component == null || component.sharedMesh == null)
+ {
+ primaryTerm = null;
+ }
+ else
+ {
+ primaryTerm = component.sharedMesh.name;
+ }
+ }
+ if (mTarget == null || mTarget.sharedMaterial == null)
+ {
+ secondaryTerm = null;
+ }
+ else
+ {
+ secondaryTerm = mTarget.sharedMaterial.name;
+ }
+ }
+
+ public override void DoLocalize(Localize cmp, string mainTranslation, string secondaryTranslation)
+ {
+ Material secondaryTranslatedObj = cmp.GetSecondaryTranslatedObj<Material>(ref mainTranslation, ref secondaryTranslation);
+ if (secondaryTranslatedObj != null && mTarget.sharedMaterial != secondaryTranslatedObj)
+ {
+ mTarget.material = secondaryTranslatedObj;
+ }
+ Mesh mesh = cmp.FindTranslatedObject<Mesh>(mainTranslation);
+ MeshFilter component = mTarget.GetComponent<MeshFilter>();
+ if (mesh != null && component.sharedMesh != mesh)
+ {
+ component.mesh = mesh;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_Prefab.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_Prefab.cs
new file mode 100644
index 0000000..a4c9d7e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_Prefab.cs
@@ -0,0 +1,108 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class LocalizeTarget_UnityStandard_Prefab : LocalizeTarget<GameObject>
+{
+ static LocalizeTarget_UnityStandard_Prefab()
+ {
+ AutoRegister();
+ }
+
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
+ private static void AutoRegister()
+ {
+ LocalizationManager.RegisterTarget(new LocalizeTargetDesc_Prefab
+ {
+ Name = "Prefab",
+ Priority = 250
+ });
+ }
+
+ public override bool IsValid(Localize cmp)
+ {
+ return true;
+ }
+
+ public override eTermType GetPrimaryTermType(Localize cmp)
+ {
+ return eTermType.GameObject;
+ }
+
+ public override eTermType GetSecondaryTermType(Localize cmp)
+ {
+ return eTermType.Text;
+ }
+
+ public override bool CanUseSecondaryTerm()
+ {
+ return false;
+ }
+
+ public override bool AllowMainTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override bool AllowSecondTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override void GetFinalTerms(Localize cmp, string Main, string Secondary, out string primaryTerm, out string secondaryTerm)
+ {
+ primaryTerm = cmp.name;
+ secondaryTerm = null;
+ }
+
+ public override void DoLocalize(Localize cmp, string mainTranslation, string secondaryTranslation)
+ {
+ if (string.IsNullOrEmpty(mainTranslation) || ((bool)mTarget && mTarget.name == mainTranslation))
+ {
+ return;
+ }
+ Transform transform = cmp.transform;
+ string text = mainTranslation;
+ int num = mainTranslation.LastIndexOfAny(LanguageSourceData.CategorySeparators);
+ if (num >= 0)
+ {
+ text = text.Substring(num + 1);
+ }
+ Transform transform2 = InstantiateNewPrefab(cmp, mainTranslation);
+ if (transform2 == null)
+ {
+ return;
+ }
+ transform2.name = text;
+ for (int num2 = transform.childCount - 1; num2 >= 0; num2--)
+ {
+ Transform child = transform.GetChild(num2);
+ if (child != transform2)
+ {
+ Object.Destroy(child.gameObject);
+ }
+ }
+ }
+
+ private Transform InstantiateNewPrefab(Localize cmp, string mainTranslation)
+ {
+ GameObject gameObject = cmp.FindTranslatedObject<GameObject>(mainTranslation);
+ if (gameObject == null)
+ {
+ return null;
+ }
+ GameObject gameObject2 = mTarget;
+ mTarget = Object.Instantiate(gameObject);
+ if (mTarget == null)
+ {
+ return null;
+ }
+ Transform transform = cmp.transform;
+ Transform transform2 = mTarget.transform;
+ transform2.SetParent(transform);
+ Transform transform3 = (gameObject2 ? gameObject2.transform : transform);
+ transform2.rotation = transform3.rotation;
+ transform2.position = transform3.position;
+ return transform2;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_SpriteRenderer.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_SpriteRenderer.cs
new file mode 100644
index 0000000..3acb521
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_SpriteRenderer.cs
@@ -0,0 +1,62 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class LocalizeTarget_UnityStandard_SpriteRenderer : LocalizeTarget<SpriteRenderer>
+{
+ static LocalizeTarget_UnityStandard_SpriteRenderer()
+ {
+ AutoRegister();
+ }
+
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
+ private static void AutoRegister()
+ {
+ LocalizationManager.RegisterTarget(new LocalizeTargetDesc_Type<SpriteRenderer, LocalizeTarget_UnityStandard_SpriteRenderer>
+ {
+ Name = "SpriteRenderer",
+ Priority = 100
+ });
+ }
+
+ public override eTermType GetPrimaryTermType(Localize cmp)
+ {
+ return eTermType.Sprite;
+ }
+
+ public override eTermType GetSecondaryTermType(Localize cmp)
+ {
+ return eTermType.Text;
+ }
+
+ public override bool CanUseSecondaryTerm()
+ {
+ return false;
+ }
+
+ public override bool AllowMainTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override bool AllowSecondTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override void GetFinalTerms(Localize cmp, string Main, string Secondary, out string primaryTerm, out string secondaryTerm)
+ {
+ Sprite sprite = mTarget.sprite;
+ primaryTerm = ((sprite != null) ? sprite.name : string.Empty);
+ secondaryTerm = null;
+ }
+
+ public override void DoLocalize(Localize cmp, string mainTranslation, string secondaryTranslation)
+ {
+ Sprite sprite = mTarget.sprite;
+ if (sprite == null || sprite.name != mainTranslation)
+ {
+ mTarget.sprite = cmp.FindTranslatedObject<Sprite>(mainTranslation);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_TextMesh.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_TextMesh.cs
new file mode 100644
index 0000000..4f3e629
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_TextMesh.cs
@@ -0,0 +1,92 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class LocalizeTarget_UnityStandard_TextMesh : LocalizeTarget<TextMesh>
+{
+ private TextAlignment mAlignment_RTL = TextAlignment.Right;
+
+ private TextAlignment mAlignment_LTR;
+
+ private bool mAlignmentWasRTL;
+
+ private bool mInitializeAlignment = true;
+
+ static LocalizeTarget_UnityStandard_TextMesh()
+ {
+ AutoRegister();
+ }
+
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
+ private static void AutoRegister()
+ {
+ LocalizationManager.RegisterTarget(new LocalizeTargetDesc_Type<TextMesh, LocalizeTarget_UnityStandard_TextMesh>
+ {
+ Name = "TextMesh",
+ Priority = 100
+ });
+ }
+
+ public override eTermType GetPrimaryTermType(Localize cmp)
+ {
+ return eTermType.Text;
+ }
+
+ public override eTermType GetSecondaryTermType(Localize cmp)
+ {
+ return eTermType.Font;
+ }
+
+ public override bool CanUseSecondaryTerm()
+ {
+ return true;
+ }
+
+ public override bool AllowMainTermToBeRTL()
+ {
+ return true;
+ }
+
+ public override bool AllowSecondTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override void GetFinalTerms(Localize cmp, string Main, string Secondary, out string primaryTerm, out string secondaryTerm)
+ {
+ primaryTerm = (mTarget ? mTarget.text : null);
+ secondaryTerm = ((string.IsNullOrEmpty(Secondary) && mTarget.font != null) ? mTarget.font.name : null);
+ }
+
+ public override void DoLocalize(Localize cmp, string mainTranslation, string secondaryTranslation)
+ {
+ Font secondaryTranslatedObj = cmp.GetSecondaryTranslatedObj<Font>(ref mainTranslation, ref secondaryTranslation);
+ if (secondaryTranslatedObj != null && mTarget.font != secondaryTranslatedObj)
+ {
+ mTarget.font = secondaryTranslatedObj;
+ mTarget.GetComponentInChildren<MeshRenderer>().material = secondaryTranslatedObj.material;
+ }
+ if (mInitializeAlignment)
+ {
+ mInitializeAlignment = false;
+ mAlignment_LTR = (mAlignment_RTL = mTarget.alignment);
+ if (LocalizationManager.IsRight2Left && mAlignment_RTL == TextAlignment.Right)
+ {
+ mAlignment_LTR = TextAlignment.Left;
+ }
+ if (!LocalizationManager.IsRight2Left && mAlignment_LTR == TextAlignment.Left)
+ {
+ mAlignment_RTL = TextAlignment.Right;
+ }
+ }
+ if (mainTranslation != null && mTarget.text != mainTranslation)
+ {
+ if (cmp.CorrectAlignmentForRTL && mTarget.alignment != TextAlignment.Center)
+ {
+ mTarget.alignment = (LocalizationManager.IsRight2Left ? mAlignment_RTL : mAlignment_LTR);
+ }
+ mTarget.font.RequestCharactersInTexture(mainTranslation);
+ mTarget.text = mainTranslation;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_VideoPlayer.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_VideoPlayer.cs
new file mode 100644
index 0000000..fb2b0a0
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityStandard_VideoPlayer.cs
@@ -0,0 +1,63 @@
+using UnityEngine;
+using UnityEngine.Video;
+
+namespace I2.Loc;
+
+public class LocalizeTarget_UnityStandard_VideoPlayer : LocalizeTarget<VideoPlayer>
+{
+ static LocalizeTarget_UnityStandard_VideoPlayer()
+ {
+ AutoRegister();
+ }
+
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
+ private static void AutoRegister()
+ {
+ LocalizationManager.RegisterTarget(new LocalizeTargetDesc_Type<VideoPlayer, LocalizeTarget_UnityStandard_VideoPlayer>
+ {
+ Name = "VideoPlayer",
+ Priority = 100
+ });
+ }
+
+ public override eTermType GetPrimaryTermType(Localize cmp)
+ {
+ return eTermType.Video;
+ }
+
+ public override eTermType GetSecondaryTermType(Localize cmp)
+ {
+ return eTermType.Text;
+ }
+
+ public override bool CanUseSecondaryTerm()
+ {
+ return false;
+ }
+
+ public override bool AllowMainTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override bool AllowSecondTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override void GetFinalTerms(Localize cmp, string Main, string Secondary, out string primaryTerm, out string secondaryTerm)
+ {
+ VideoClip clip = mTarget.clip;
+ primaryTerm = ((clip != null) ? clip.name : string.Empty);
+ secondaryTerm = null;
+ }
+
+ public override void DoLocalize(Localize cmp, string mainTranslation, string secondaryTranslation)
+ {
+ VideoClip clip = mTarget.clip;
+ if (clip == null || clip.name != mainTranslation)
+ {
+ mTarget.clip = cmp.FindTranslatedObject<VideoClip>(mainTranslation);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityUI_Image.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityUI_Image.cs
new file mode 100644
index 0000000..4270743
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityUI_Image.cs
@@ -0,0 +1,70 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace I2.Loc;
+
+public class LocalizeTarget_UnityUI_Image : LocalizeTarget<Image>
+{
+ static LocalizeTarget_UnityUI_Image()
+ {
+ AutoRegister();
+ }
+
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
+ private static void AutoRegister()
+ {
+ LocalizationManager.RegisterTarget(new LocalizeTargetDesc_Type<Image, LocalizeTarget_UnityUI_Image>
+ {
+ Name = "Image",
+ Priority = 100
+ });
+ }
+
+ public override bool CanUseSecondaryTerm()
+ {
+ return false;
+ }
+
+ public override bool AllowMainTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override bool AllowSecondTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override eTermType GetPrimaryTermType(Localize cmp)
+ {
+ if (!(mTarget.sprite == null))
+ {
+ return eTermType.Sprite;
+ }
+ return eTermType.Texture;
+ }
+
+ public override eTermType GetSecondaryTermType(Localize cmp)
+ {
+ return eTermType.Text;
+ }
+
+ public override void GetFinalTerms(Localize cmp, string Main, string Secondary, out string primaryTerm, out string secondaryTerm)
+ {
+ primaryTerm = (mTarget.mainTexture ? mTarget.mainTexture.name : "");
+ if (mTarget.sprite != null && mTarget.sprite.name != primaryTerm)
+ {
+ primaryTerm = primaryTerm + "." + mTarget.sprite.name;
+ }
+ secondaryTerm = null;
+ }
+
+ public override void DoLocalize(Localize cmp, string mainTranslation, string secondaryTranslation)
+ {
+ Sprite sprite = mTarget.sprite;
+ if (sprite == null || sprite.name != mainTranslation)
+ {
+ mTarget.sprite = cmp.FindTranslatedObject<Sprite>(mainTranslation);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityUI_RawImage.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityUI_RawImage.cs
new file mode 100644
index 0000000..3275190
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityUI_RawImage.cs
@@ -0,0 +1,62 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace I2.Loc;
+
+public class LocalizeTarget_UnityUI_RawImage : LocalizeTarget<RawImage>
+{
+ static LocalizeTarget_UnityUI_RawImage()
+ {
+ AutoRegister();
+ }
+
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
+ private static void AutoRegister()
+ {
+ LocalizationManager.RegisterTarget(new LocalizeTargetDesc_Type<RawImage, LocalizeTarget_UnityUI_RawImage>
+ {
+ Name = "RawImage",
+ Priority = 100
+ });
+ }
+
+ public override eTermType GetPrimaryTermType(Localize cmp)
+ {
+ return eTermType.Texture;
+ }
+
+ public override eTermType GetSecondaryTermType(Localize cmp)
+ {
+ return eTermType.Text;
+ }
+
+ public override bool CanUseSecondaryTerm()
+ {
+ return false;
+ }
+
+ public override bool AllowMainTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override bool AllowSecondTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override void GetFinalTerms(Localize cmp, string Main, string Secondary, out string primaryTerm, out string secondaryTerm)
+ {
+ primaryTerm = (mTarget.mainTexture ? mTarget.mainTexture.name : "");
+ secondaryTerm = null;
+ }
+
+ public override void DoLocalize(Localize cmp, string mainTranslation, string secondaryTranslation)
+ {
+ Texture texture = mTarget.texture;
+ if (texture == null || texture.name != mainTranslation)
+ {
+ mTarget.texture = cmp.FindTranslatedObject<Texture>(mainTranslation);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityUI_Text.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityUI_Text.cs
new file mode 100644
index 0000000..ab26e0d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizeTarget_UnityUI_Text.cs
@@ -0,0 +1,156 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace I2.Loc;
+
+public class LocalizeTarget_UnityUI_Text : LocalizeTarget<Text>
+{
+ private TextAnchor mAlignment_RTL = TextAnchor.UpperRight;
+
+ private TextAnchor mAlignment_LTR;
+
+ private bool mAlignmentWasRTL;
+
+ private bool mInitializeAlignment = true;
+
+ static LocalizeTarget_UnityUI_Text()
+ {
+ AutoRegister();
+ }
+
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
+ private static void AutoRegister()
+ {
+ LocalizationManager.RegisterTarget(new LocalizeTargetDesc_Type<Text, LocalizeTarget_UnityUI_Text>
+ {
+ Name = "Text",
+ Priority = 100
+ });
+ }
+
+ public override eTermType GetPrimaryTermType(Localize cmp)
+ {
+ return eTermType.Text;
+ }
+
+ public override eTermType GetSecondaryTermType(Localize cmp)
+ {
+ return eTermType.Font;
+ }
+
+ public override bool CanUseSecondaryTerm()
+ {
+ return true;
+ }
+
+ public override bool AllowMainTermToBeRTL()
+ {
+ return true;
+ }
+
+ public override bool AllowSecondTermToBeRTL()
+ {
+ return false;
+ }
+
+ public override void GetFinalTerms(Localize cmp, string Main, string Secondary, out string primaryTerm, out string secondaryTerm)
+ {
+ primaryTerm = (mTarget ? mTarget.text : null);
+ secondaryTerm = ((mTarget.font != null) ? mTarget.font.name : string.Empty);
+ }
+
+ public override void DoLocalize(Localize cmp, string mainTranslation, string secondaryTranslation)
+ {
+ Font secondaryTranslatedObj = cmp.GetSecondaryTranslatedObj<Font>(ref mainTranslation, ref secondaryTranslation);
+ if (secondaryTranslatedObj != null && secondaryTranslatedObj != mTarget.font)
+ {
+ mTarget.font = secondaryTranslatedObj;
+ }
+ if (mInitializeAlignment)
+ {
+ mInitializeAlignment = false;
+ mAlignmentWasRTL = LocalizationManager.IsRight2Left;
+ InitAlignment(mAlignmentWasRTL, mTarget.alignment, out mAlignment_LTR, out mAlignment_RTL);
+ }
+ else
+ {
+ InitAlignment(mAlignmentWasRTL, mTarget.alignment, out var alignLTR, out var alignRTL);
+ if ((mAlignmentWasRTL && mAlignment_RTL != alignRTL) || (!mAlignmentWasRTL && mAlignment_LTR != alignLTR))
+ {
+ mAlignment_LTR = alignLTR;
+ mAlignment_RTL = alignRTL;
+ }
+ mAlignmentWasRTL = LocalizationManager.IsRight2Left;
+ }
+ if (mainTranslation != null && mTarget.text != mainTranslation)
+ {
+ if (cmp.CorrectAlignmentForRTL)
+ {
+ mTarget.alignment = (LocalizationManager.IsRight2Left ? mAlignment_RTL : mAlignment_LTR);
+ }
+ mTarget.text = mainTranslation;
+ mTarget.SetVerticesDirty();
+ }
+ }
+
+ private void InitAlignment(bool isRTL, TextAnchor alignment, out TextAnchor alignLTR, out TextAnchor alignRTL)
+ {
+ alignLTR = (alignRTL = alignment);
+ if (isRTL)
+ {
+ switch (alignment)
+ {
+ case TextAnchor.UpperRight:
+ alignLTR = TextAnchor.UpperLeft;
+ break;
+ case TextAnchor.MiddleRight:
+ alignLTR = TextAnchor.MiddleLeft;
+ break;
+ case TextAnchor.LowerRight:
+ alignLTR = TextAnchor.LowerLeft;
+ break;
+ case TextAnchor.UpperLeft:
+ alignLTR = TextAnchor.UpperRight;
+ break;
+ case TextAnchor.MiddleLeft:
+ alignLTR = TextAnchor.MiddleRight;
+ break;
+ case TextAnchor.LowerLeft:
+ alignLTR = TextAnchor.LowerRight;
+ break;
+ case TextAnchor.UpperCenter:
+ case TextAnchor.MiddleCenter:
+ case TextAnchor.LowerCenter:
+ break;
+ }
+ }
+ else
+ {
+ switch (alignment)
+ {
+ case TextAnchor.UpperRight:
+ alignRTL = TextAnchor.UpperLeft;
+ break;
+ case TextAnchor.MiddleRight:
+ alignRTL = TextAnchor.MiddleLeft;
+ break;
+ case TextAnchor.LowerRight:
+ alignRTL = TextAnchor.LowerLeft;
+ break;
+ case TextAnchor.UpperLeft:
+ alignRTL = TextAnchor.UpperRight;
+ break;
+ case TextAnchor.MiddleLeft:
+ alignRTL = TextAnchor.MiddleRight;
+ break;
+ case TextAnchor.LowerLeft:
+ alignRTL = TextAnchor.LowerRight;
+ break;
+ case TextAnchor.UpperCenter:
+ case TextAnchor.MiddleCenter:
+ case TextAnchor.LowerCenter:
+ break;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/LocalizedString.cs b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizedString.cs
new file mode 100644
index 0000000..51ff195
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/LocalizedString.cs
@@ -0,0 +1,45 @@
+using System;
+
+namespace I2.Loc;
+
+[Serializable]
+public struct LocalizedString
+{
+ public string mTerm;
+
+ public bool mRTL_IgnoreArabicFix;
+
+ public int mRTL_MaxLineLength;
+
+ public bool mRTL_ConvertNumbers;
+
+ public bool m_DontLocalizeParameters;
+
+ public static implicit operator string(LocalizedString s)
+ {
+ return s.ToString();
+ }
+
+ public static implicit operator LocalizedString(string term)
+ {
+ LocalizedString result = default(LocalizedString);
+ result.mTerm = term;
+ return result;
+ }
+
+ public LocalizedString(LocalizedString str)
+ {
+ mTerm = str.mTerm;
+ mRTL_IgnoreArabicFix = str.mRTL_IgnoreArabicFix;
+ mRTL_MaxLineLength = str.mRTL_MaxLineLength;
+ mRTL_ConvertNumbers = str.mRTL_ConvertNumbers;
+ m_DontLocalizeParameters = str.m_DontLocalizeParameters;
+ }
+
+ public override string ToString()
+ {
+ string translation = TextTranslator.Translate(mTerm, !mRTL_IgnoreArabicFix, mRTL_MaxLineLength, !mRTL_ConvertNumbers);
+ LocalizationManager.ApplyLocalizationParams(ref translation, !m_DontLocalizeParameters);
+ return translation;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/PersistentStorage.cs b/Thronefall_v1.57/Thronefall/I2.Loc/PersistentStorage.cs
new file mode 100644
index 0000000..37854fd
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/PersistentStorage.cs
@@ -0,0 +1,104 @@
+namespace I2.Loc;
+
+public static class PersistentStorage
+{
+ public enum eFileType
+ {
+ Raw,
+ Persistent,
+ Temporal,
+ Streaming
+ }
+
+ private static I2CustomPersistentStorage mStorage;
+
+ public static void SetSetting_String(string key, string value)
+ {
+ if (mStorage == null)
+ {
+ mStorage = new I2CustomPersistentStorage();
+ }
+ mStorage.SetSetting_String(key, value);
+ }
+
+ public static string GetSetting_String(string key, string defaultValue)
+ {
+ if (mStorage == null)
+ {
+ mStorage = new I2CustomPersistentStorage();
+ }
+ return mStorage.GetSetting_String(key, defaultValue);
+ }
+
+ public static void DeleteSetting(string key)
+ {
+ if (mStorage == null)
+ {
+ mStorage = new I2CustomPersistentStorage();
+ }
+ mStorage.DeleteSetting(key);
+ }
+
+ public static bool HasSetting(string key)
+ {
+ if (mStorage == null)
+ {
+ mStorage = new I2CustomPersistentStorage();
+ }
+ return mStorage.HasSetting(key);
+ }
+
+ public static void ForceSaveSettings()
+ {
+ if (mStorage == null)
+ {
+ mStorage = new I2CustomPersistentStorage();
+ }
+ mStorage.ForceSaveSettings();
+ }
+
+ public static bool CanAccessFiles()
+ {
+ if (mStorage == null)
+ {
+ mStorage = new I2CustomPersistentStorage();
+ }
+ return mStorage.CanAccessFiles();
+ }
+
+ public static bool SaveFile(eFileType fileType, string fileName, string data, bool logExceptions = true)
+ {
+ if (mStorage == null)
+ {
+ mStorage = new I2CustomPersistentStorage();
+ }
+ return mStorage.SaveFile(fileType, fileName, data, logExceptions);
+ }
+
+ public static string LoadFile(eFileType fileType, string fileName, bool logExceptions = true)
+ {
+ if (mStorage == null)
+ {
+ mStorage = new I2CustomPersistentStorage();
+ }
+ return mStorage.LoadFile(fileType, fileName, logExceptions);
+ }
+
+ public static bool DeleteFile(eFileType fileType, string fileName, bool logExceptions = true)
+ {
+ if (mStorage == null)
+ {
+ mStorage = new I2CustomPersistentStorage();
+ }
+ return mStorage.DeleteFile(fileType, fileName, logExceptions);
+ }
+
+ public static bool HasFile(eFileType fileType, string fileName, bool logExceptions = true)
+ {
+ if (mStorage == null)
+ {
+ mStorage = new I2CustomPersistentStorage();
+ }
+ return mStorage.HasFile(fileType, fileName, logExceptions);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/RTLFixer.cs b/Thronefall_v1.57/Thronefall/I2.Loc/RTLFixer.cs
new file mode 100644
index 0000000..56ccb8b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/RTLFixer.cs
@@ -0,0 +1,79 @@
+using System;
+
+namespace I2.Loc;
+
+public class RTLFixer
+{
+ public static string Fix(string str)
+ {
+ return Fix(str, showTashkeel: false, useHinduNumbers: true);
+ }
+
+ public static string Fix(string str, bool rtl)
+ {
+ if (rtl)
+ {
+ return Fix(str);
+ }
+ string[] array = str.Split(' ');
+ string text = "";
+ string text2 = "";
+ string[] array2 = array;
+ foreach (string text3 in array2)
+ {
+ if (char.IsLower(text3.ToLower()[text3.Length / 2]))
+ {
+ text = text + Fix(text2) + text3 + " ";
+ text2 = "";
+ }
+ else
+ {
+ text2 = text2 + text3 + " ";
+ }
+ }
+ if (text2 != "")
+ {
+ text += Fix(text2);
+ }
+ return text;
+ }
+
+ public static string Fix(string str, bool showTashkeel, bool useHinduNumbers)
+ {
+ string text = HindiFixer.Fix(str);
+ if (text != str)
+ {
+ return text;
+ }
+ RTLFixerTool.showTashkeel = showTashkeel;
+ RTLFixerTool.useHinduNumbers = useHinduNumbers;
+ if (str.Contains("\n"))
+ {
+ str = str.Replace("\n", Environment.NewLine);
+ }
+ if (str.Contains(Environment.NewLine))
+ {
+ string[] separator = new string[1] { Environment.NewLine };
+ string[] array = str.Split(separator, StringSplitOptions.None);
+ if (array.Length == 0)
+ {
+ return RTLFixerTool.FixLine(str);
+ }
+ if (array.Length == 1)
+ {
+ return RTLFixerTool.FixLine(str);
+ }
+ string text2 = RTLFixerTool.FixLine(array[0]);
+ int i = 1;
+ if (array.Length > 1)
+ {
+ for (; i < array.Length; i++)
+ {
+ text2 = text2 + Environment.NewLine + RTLFixerTool.FixLine(array[i]);
+ }
+ }
+ return text2;
+ }
+ return RTLFixerTool.FixLine(str);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/RTLFixerTool.cs b/Thronefall_v1.57/Thronefall/I2.Loc/RTLFixerTool.cs
new file mode 100644
index 0000000..c0a9b27
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/RTLFixerTool.cs
@@ -0,0 +1,404 @@
+using System;
+using System.Collections.Generic;
+
+namespace I2.Loc;
+
+internal class RTLFixerTool
+{
+ internal static bool showTashkeel = true;
+
+ internal static bool useHinduNumbers;
+
+ internal static string RemoveTashkeel(string str, out List<TashkeelLocation> tashkeelLocation)
+ {
+ tashkeelLocation = new List<TashkeelLocation>();
+ char[] array = str.ToCharArray();
+ int num = 0;
+ for (int i = 0; i < array.Length; i++)
+ {
+ if (array[i] == '\u064b')
+ {
+ tashkeelLocation.Add(new TashkeelLocation('\u064b', i));
+ num++;
+ }
+ else if (array[i] == '\u064c')
+ {
+ tashkeelLocation.Add(new TashkeelLocation('\u064c', i));
+ num++;
+ }
+ else if (array[i] == '\u064d')
+ {
+ tashkeelLocation.Add(new TashkeelLocation('\u064d', i));
+ num++;
+ }
+ else if (array[i] == '\u064e')
+ {
+ if (num > 0 && tashkeelLocation[num - 1].tashkeel == '\u0651')
+ {
+ tashkeelLocation[num - 1].tashkeel = 'ﱠ';
+ continue;
+ }
+ tashkeelLocation.Add(new TashkeelLocation('\u064e', i));
+ num++;
+ }
+ else if (array[i] == '\u064f')
+ {
+ if (num > 0 && tashkeelLocation[num - 1].tashkeel == '\u0651')
+ {
+ tashkeelLocation[num - 1].tashkeel = 'ﱡ';
+ continue;
+ }
+ tashkeelLocation.Add(new TashkeelLocation('\u064f', i));
+ num++;
+ }
+ else if (array[i] == '\u0650')
+ {
+ if (num > 0 && tashkeelLocation[num - 1].tashkeel == '\u0651')
+ {
+ tashkeelLocation[num - 1].tashkeel = 'ﱢ';
+ continue;
+ }
+ tashkeelLocation.Add(new TashkeelLocation('\u0650', i));
+ num++;
+ }
+ else if (array[i] == '\u0651')
+ {
+ if (num > 0)
+ {
+ if (tashkeelLocation[num - 1].tashkeel == '\u064e')
+ {
+ tashkeelLocation[num - 1].tashkeel = 'ﱠ';
+ continue;
+ }
+ if (tashkeelLocation[num - 1].tashkeel == '\u064f')
+ {
+ tashkeelLocation[num - 1].tashkeel = 'ﱡ';
+ continue;
+ }
+ if (tashkeelLocation[num - 1].tashkeel == '\u0650')
+ {
+ tashkeelLocation[num - 1].tashkeel = 'ﱢ';
+ continue;
+ }
+ }
+ tashkeelLocation.Add(new TashkeelLocation('\u0651', i));
+ num++;
+ }
+ else if (array[i] == '\u0652')
+ {
+ tashkeelLocation.Add(new TashkeelLocation('\u0652', i));
+ num++;
+ }
+ else if (array[i] == '\u0653')
+ {
+ tashkeelLocation.Add(new TashkeelLocation('\u0653', i));
+ num++;
+ }
+ }
+ string[] array2 = str.Split('\u064b', '\u064c', '\u064d', '\u064e', '\u064f', '\u0650', '\u0651', '\u0652', '\u0653', 'ﱠ', 'ﱡ', 'ﱢ');
+ str = "";
+ string[] array3 = array2;
+ foreach (string text in array3)
+ {
+ str += text;
+ }
+ return str;
+ }
+
+ internal static char[] ReturnTashkeel(char[] letters, List<TashkeelLocation> tashkeelLocation)
+ {
+ char[] array = new char[letters.Length + tashkeelLocation.Count];
+ int num = 0;
+ for (int i = 0; i < letters.Length; i++)
+ {
+ array[num] = letters[i];
+ num++;
+ foreach (TashkeelLocation item in tashkeelLocation)
+ {
+ if (item.position == num)
+ {
+ array[num] = item.tashkeel;
+ num++;
+ }
+ }
+ }
+ return array;
+ }
+
+ internal static string FixLine(string str)
+ {
+ string text = "";
+ List<TashkeelLocation> tashkeelLocation;
+ string text2 = RemoveTashkeel(str, out tashkeelLocation);
+ char[] array = text2.ToCharArray();
+ char[] array2 = text2.ToCharArray();
+ for (int i = 0; i < array.Length; i++)
+ {
+ array[i] = (char)ArabicTable.ArabicMapper.Convert(array[i]);
+ }
+ for (int j = 0; j < array.Length; j++)
+ {
+ bool flag = false;
+ if (array[j] == 'ﻝ' && j < array.Length - 1)
+ {
+ if (array[j + 1] == 'ﺇ')
+ {
+ array[j] = 'ﻷ';
+ array2[j + 1] = '\uffff';
+ flag = true;
+ }
+ else if (array[j + 1] == 'ﺍ')
+ {
+ array[j] = 'ﻹ';
+ array2[j + 1] = '\uffff';
+ flag = true;
+ }
+ else if (array[j + 1] == 'ﺃ')
+ {
+ array[j] = 'ﻵ';
+ array2[j + 1] = '\uffff';
+ flag = true;
+ }
+ else if (array[j + 1] == 'ﺁ')
+ {
+ array[j] = 'ﻳ';
+ array2[j + 1] = '\uffff';
+ flag = true;
+ }
+ }
+ if (!IsIgnoredCharacter(array[j]))
+ {
+ if (IsMiddleLetter(array, j))
+ {
+ array2[j] = (char)(array[j] + 3);
+ }
+ else if (IsFinishingLetter(array, j))
+ {
+ array2[j] = (char)(array[j] + 1);
+ }
+ else if (IsLeadingLetter(array, j))
+ {
+ array2[j] = (char)(array[j] + 2);
+ }
+ }
+ text = text + Convert.ToString(array[j], 16) + " ";
+ if (flag)
+ {
+ j++;
+ }
+ if (useHinduNumbers)
+ {
+ if (array[j] == '0')
+ {
+ array2[j] = '٠';
+ }
+ else if (array[j] == '1')
+ {
+ array2[j] = '١';
+ }
+ else if (array[j] == '2')
+ {
+ array2[j] = '٢';
+ }
+ else if (array[j] == '3')
+ {
+ array2[j] = '٣';
+ }
+ else if (array[j] == '4')
+ {
+ array2[j] = '٤';
+ }
+ else if (array[j] == '5')
+ {
+ array2[j] = '٥';
+ }
+ else if (array[j] == '6')
+ {
+ array2[j] = '٦';
+ }
+ else if (array[j] == '7')
+ {
+ array2[j] = '٧';
+ }
+ else if (array[j] == '8')
+ {
+ array2[j] = '٨';
+ }
+ else if (array[j] == '9')
+ {
+ array2[j] = '٩';
+ }
+ }
+ }
+ if (showTashkeel)
+ {
+ array2 = ReturnTashkeel(array2, tashkeelLocation);
+ }
+ List<char> list = new List<char>();
+ List<char> list2 = new List<char>();
+ for (int num = array2.Length - 1; num >= 0; num--)
+ {
+ if (char.IsPunctuation(array2[num]) && num > 0 && num < array2.Length - 1 && (char.IsPunctuation(array2[num - 1]) || char.IsPunctuation(array2[num + 1])))
+ {
+ if (array2[num] == '(')
+ {
+ list.Add(')');
+ }
+ else if (array2[num] == ')')
+ {
+ list.Add('(');
+ }
+ else if (array2[num] == '<')
+ {
+ list.Add('>');
+ }
+ else if (array2[num] == '>')
+ {
+ list.Add('<');
+ }
+ else if (array2[num] == '[')
+ {
+ list.Add(']');
+ }
+ else if (array2[num] == ']')
+ {
+ list.Add('[');
+ }
+ else if (array2[num] != '\uffff')
+ {
+ list.Add(array2[num]);
+ }
+ }
+ else if (array2[num] == ' ' && num > 0 && num < array2.Length - 1 && (char.IsLower(array2[num - 1]) || char.IsUpper(array2[num - 1]) || char.IsNumber(array2[num - 1])) && (char.IsLower(array2[num + 1]) || char.IsUpper(array2[num + 1]) || char.IsNumber(array2[num + 1])))
+ {
+ list2.Add(array2[num]);
+ }
+ else if (char.IsNumber(array2[num]) || char.IsLower(array2[num]) || char.IsUpper(array2[num]) || char.IsSymbol(array2[num]) || char.IsPunctuation(array2[num]))
+ {
+ if (array2[num] == '(')
+ {
+ list2.Add(')');
+ }
+ else if (array2[num] == ')')
+ {
+ list2.Add('(');
+ }
+ else if (array2[num] == '<')
+ {
+ list2.Add('>');
+ }
+ else if (array2[num] == '>')
+ {
+ list2.Add('<');
+ }
+ else if (array2[num] == '[')
+ {
+ list.Add(']');
+ }
+ else if (array2[num] == ']')
+ {
+ list.Add('[');
+ }
+ else
+ {
+ list2.Add(array2[num]);
+ }
+ }
+ else if ((array2[num] >= '\ud800' && array2[num] <= '\udbff') || (array2[num] >= '\udc00' && array2[num] <= '\udfff'))
+ {
+ list2.Add(array2[num]);
+ }
+ else
+ {
+ if (list2.Count > 0)
+ {
+ for (int k = 0; k < list2.Count; k++)
+ {
+ list.Add(list2[list2.Count - 1 - k]);
+ }
+ list2.Clear();
+ }
+ if (array2[num] != '\uffff')
+ {
+ list.Add(array2[num]);
+ }
+ }
+ }
+ if (list2.Count > 0)
+ {
+ for (int l = 0; l < list2.Count; l++)
+ {
+ list.Add(list2[list2.Count - 1 - l]);
+ }
+ list2.Clear();
+ }
+ array2 = new char[list.Count];
+ for (int m = 0; m < array2.Length; m++)
+ {
+ array2[m] = list[m];
+ }
+ str = new string(array2);
+ return str;
+ }
+
+ internal static bool IsIgnoredCharacter(char ch)
+ {
+ bool num = char.IsPunctuation(ch);
+ bool flag = char.IsNumber(ch);
+ bool flag2 = char.IsLower(ch);
+ bool flag3 = char.IsUpper(ch);
+ bool flag4 = char.IsSymbol(ch);
+ bool flag5 = ch == 'ﭖ' || ch == 'ﭺ' || ch == 'ﮊ' || ch == 'ﮒ' || ch == 'ﮎ';
+ bool flag6 = (ch <= '\ufeff' && ch >= 'ﹰ') || flag5 || ch == 'ﯼ';
+ if (!(num || flag || flag2 || flag3 || flag4) && flag6 && ch != 'a' && ch != '>' && ch != '<')
+ {
+ return ch == '؛';
+ }
+ return true;
+ }
+
+ internal static bool IsLeadingLetter(char[] letters, int index)
+ {
+ bool num = index == 0 || letters[index - 1] == ' ' || letters[index - 1] == '*' || letters[index - 1] == 'A' || char.IsPunctuation(letters[index - 1]) || letters[index - 1] == '>' || letters[index - 1] == '<' || letters[index - 1] == 'ﺍ' || letters[index - 1] == 'ﺩ' || letters[index - 1] == 'ﺫ' || letters[index - 1] == 'ﺭ' || letters[index - 1] == 'ﺯ' || letters[index - 1] == 'ﮊ' || letters[index - 1] == 'ﻭ' || letters[index - 1] == 'ﺁ' || letters[index - 1] == 'ﺃ' || letters[index - 1] == 'ﺇ' || letters[index - 1] == 'ﺅ';
+ bool flag = letters[index] != ' ' && letters[index] != 'ﺩ' && letters[index] != 'ﺫ' && letters[index] != 'ﺭ' && letters[index] != 'ﺯ' && letters[index] != 'ﮊ' && letters[index] != 'ﺍ' && letters[index] != 'ﺃ' && letters[index] != 'ﺇ' && letters[index] != 'ﺁ' && letters[index] != 'ﺅ' && letters[index] != 'ﻭ' && letters[index] != 'ﺀ';
+ bool flag2 = index < letters.Length - 1 && letters[index + 1] != ' ' && !char.IsPunctuation(letters[index + 1]) && !char.IsNumber(letters[index + 1]) && !char.IsSymbol(letters[index + 1]) && !char.IsLower(letters[index + 1]) && !char.IsUpper(letters[index + 1]) && letters[index + 1] != 'ﺀ';
+ if (num && flag && flag2)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ internal static bool IsFinishingLetter(char[] letters, int index)
+ {
+ bool num = index != 0 && letters[index - 1] != ' ' && letters[index - 1] != 'ﺩ' && letters[index - 1] != 'ﺫ' && letters[index - 1] != 'ﺭ' && letters[index - 1] != 'ﺯ' && letters[index - 1] != 'ﮊ' && letters[index - 1] != 'ﻭ' && letters[index - 1] != 'ﺍ' && letters[index - 1] != 'ﺁ' && letters[index - 1] != 'ﺃ' && letters[index - 1] != 'ﺇ' && letters[index - 1] != 'ﺅ' && letters[index - 1] != 'ﺀ' && !char.IsPunctuation(letters[index - 1]) && letters[index - 1] != '>' && letters[index - 1] != '<';
+ bool flag = letters[index] != ' ' && letters[index] != 'ﺀ';
+ if (num && flag)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ internal static bool IsMiddleLetter(char[] letters, int index)
+ {
+ bool flag = index != 0 && letters[index] != 'ﺍ' && letters[index] != 'ﺩ' && letters[index] != 'ﺫ' && letters[index] != 'ﺭ' && letters[index] != 'ﺯ' && letters[index] != 'ﮊ' && letters[index] != 'ﻭ' && letters[index] != 'ﺁ' && letters[index] != 'ﺃ' && letters[index] != 'ﺇ' && letters[index] != 'ﺅ' && letters[index] != 'ﺀ';
+ bool flag2 = index != 0 && letters[index - 1] != 'ﺍ' && letters[index - 1] != 'ﺩ' && letters[index - 1] != 'ﺫ' && letters[index - 1] != 'ﺭ' && letters[index - 1] != 'ﺯ' && letters[index - 1] != 'ﮊ' && letters[index - 1] != 'ﻭ' && letters[index - 1] != 'ﺁ' && letters[index - 1] != 'ﺃ' && letters[index - 1] != 'ﺇ' && letters[index - 1] != 'ﺅ' && letters[index - 1] != 'ﺀ' && !char.IsPunctuation(letters[index - 1]) && letters[index - 1] != '>' && letters[index - 1] != '<' && letters[index - 1] != ' ' && letters[index - 1] != '*';
+ if (index < letters.Length - 1 && letters[index + 1] != ' ' && letters[index + 1] != '\r' && letters[index + 1] != 'ﺀ' && !char.IsNumber(letters[index + 1]) && !char.IsSymbol(letters[index + 1]) && !char.IsPunctuation(letters[index + 1]) && flag2 && flag)
+ {
+ try
+ {
+ if (char.IsPunctuation(letters[index + 1]))
+ {
+ return false;
+ }
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+ return false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/RealTimeTranslation.cs b/Thronefall_v1.57/Thronefall/I2.Loc/RealTimeTranslation.cs
new file mode 100644
index 0000000..d0bee68
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/RealTimeTranslation.cs
@@ -0,0 +1,118 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class RealTimeTranslation : MonoBehaviour
+{
+ private string OriginalText = "This is an example showing how to use the google translator to translate chat messages within the game.\nIt also supports multiline translations.";
+
+ private string TranslatedText = string.Empty;
+
+ private bool IsTranslating;
+
+ public void OnGUI()
+ {
+ GUILayout.Label("Translate:");
+ OriginalText = GUILayout.TextArea(OriginalText, GUILayout.Width(Screen.width));
+ GUILayout.Space(10f);
+ GUILayout.BeginHorizontal();
+ if (GUILayout.Button("English -> Español", GUILayout.Height(100f)))
+ {
+ StartTranslating("en", "es");
+ }
+ if (GUILayout.Button("Español -> English", GUILayout.Height(100f)))
+ {
+ StartTranslating("es", "en");
+ }
+ GUILayout.EndHorizontal();
+ GUILayout.Space(10f);
+ GUILayout.BeginHorizontal();
+ GUILayout.TextArea("Multiple Translation with 1 call:\n'This is an example' -> en,zh\n'Hola' -> en");
+ if (GUILayout.Button("Multi Translate", GUILayout.ExpandHeight(expand: true)))
+ {
+ ExampleMultiTranslations_Async();
+ }
+ GUILayout.EndHorizontal();
+ GUILayout.TextArea(TranslatedText, GUILayout.Width(Screen.width));
+ GUILayout.Space(10f);
+ if (IsTranslating)
+ {
+ GUILayout.Label("Contacting Google....");
+ }
+ }
+
+ public void StartTranslating(string fromCode, string toCode)
+ {
+ IsTranslating = true;
+ GoogleTranslation.Translate(OriginalText, fromCode, toCode, OnTranslationReady);
+ }
+
+ private void OnTranslationReady(string Translation, string errorMsg)
+ {
+ IsTranslating = false;
+ if (errorMsg != null)
+ {
+ Debug.LogError(errorMsg);
+ }
+ else
+ {
+ TranslatedText = Translation;
+ }
+ }
+
+ public void ExampleMultiTranslations_Blocking()
+ {
+ Dictionary<string, TranslationQuery> dictionary = new Dictionary<string, TranslationQuery>();
+ GoogleTranslation.AddQuery("This is an example", "en", "es", dictionary);
+ GoogleTranslation.AddQuery("This is an example", "auto", "zh", dictionary);
+ GoogleTranslation.AddQuery("Hola", "es", "en", dictionary);
+ if (GoogleTranslation.ForceTranslate(dictionary))
+ {
+ Debug.Log(GoogleTranslation.GetQueryResult("This is an example", "en", dictionary));
+ Debug.Log(GoogleTranslation.GetQueryResult("This is an example", "zh", dictionary));
+ Debug.Log(GoogleTranslation.GetQueryResult("This is an example", "", dictionary));
+ Debug.Log(dictionary["Hola"].Results[0]);
+ }
+ }
+
+ public void ExampleMultiTranslations_Async()
+ {
+ IsTranslating = true;
+ Dictionary<string, TranslationQuery> dictionary = new Dictionary<string, TranslationQuery>();
+ GoogleTranslation.AddQuery("This is an example", "en", "es", dictionary);
+ GoogleTranslation.AddQuery("This is an example", "auto", "zh", dictionary);
+ GoogleTranslation.AddQuery("Hola", "es", "en", dictionary);
+ GoogleTranslation.Translate(dictionary, OnMultitranslationReady);
+ }
+
+ private void OnMultitranslationReady(Dictionary<string, TranslationQuery> dict, string errorMsg)
+ {
+ if (!string.IsNullOrEmpty(errorMsg))
+ {
+ Debug.LogError(errorMsg);
+ return;
+ }
+ IsTranslating = false;
+ TranslatedText = "";
+ TranslatedText = TranslatedText + GoogleTranslation.GetQueryResult("This is an example", "es", dict) + "\n";
+ TranslatedText = TranslatedText + GoogleTranslation.GetQueryResult("This is an example", "zh", dict) + "\n";
+ TranslatedText = TranslatedText + GoogleTranslation.GetQueryResult("This is an example", "", dict) + "\n";
+ TranslatedText += dict["Hola"].Results[0];
+ }
+
+ public bool IsWaitingForTranslation()
+ {
+ return IsTranslating;
+ }
+
+ public string GetTranslatedText()
+ {
+ return TranslatedText;
+ }
+
+ public void SetOriginalText(string text)
+ {
+ OriginalText = text;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/RegisterBundlesManager.cs b/Thronefall_v1.57/Thronefall/I2.Loc/RegisterBundlesManager.cs
new file mode 100644
index 0000000..e475810
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/RegisterBundlesManager.cs
@@ -0,0 +1,25 @@
+using System;
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class RegisterBundlesManager : MonoBehaviour, IResourceManager_Bundles
+{
+ public void OnEnable()
+ {
+ if (!ResourceManager.pInstance.mBundleManagers.Contains(this))
+ {
+ ResourceManager.pInstance.mBundleManagers.Add(this);
+ }
+ }
+
+ public void OnDisable()
+ {
+ ResourceManager.pInstance.mBundleManagers.Remove(this);
+ }
+
+ public virtual UnityEngine.Object LoadFromBundle(string path, Type assetType)
+ {
+ return null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/RegisterCallback_AllowSyncFromGoogle.cs b/Thronefall_v1.57/Thronefall/I2.Loc/RegisterCallback_AllowSyncFromGoogle.cs
new file mode 100644
index 0000000..039dc18
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/RegisterCallback_AllowSyncFromGoogle.cs
@@ -0,0 +1,26 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class RegisterCallback_AllowSyncFromGoogle : MonoBehaviour
+{
+ public void Awake()
+ {
+ LocalizationManager.Callback_AllowSyncFromGoogle = AllowSyncFromGoogle;
+ }
+
+ public void OnEnable()
+ {
+ LocalizationManager.Callback_AllowSyncFromGoogle = AllowSyncFromGoogle;
+ }
+
+ public void OnDisable()
+ {
+ LocalizationManager.Callback_AllowSyncFromGoogle = null;
+ }
+
+ public virtual bool AllowSyncFromGoogle(LanguageSourceData Source)
+ {
+ return true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/RegisterGlobalParameters.cs b/Thronefall_v1.57/Thronefall/I2.Loc/RegisterGlobalParameters.cs
new file mode 100644
index 0000000..4642977
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/RegisterGlobalParameters.cs
@@ -0,0 +1,25 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class RegisterGlobalParameters : MonoBehaviour, ILocalizationParamsManager
+{
+ public virtual void OnEnable()
+ {
+ if (!LocalizationManager.ParamManagers.Contains(this))
+ {
+ LocalizationManager.ParamManagers.Add(this);
+ LocalizationManager.LocalizeAll(Force: true);
+ }
+ }
+
+ public virtual void OnDisable()
+ {
+ LocalizationManager.ParamManagers.Remove(this);
+ }
+
+ public virtual string GetParameterValue(string ParamName)
+ {
+ return null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/ResourceManager.cs b/Thronefall_v1.57/Thronefall/I2.Loc/ResourceManager.cs
new file mode 100644
index 0000000..793bb21
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/ResourceManager.cs
@@ -0,0 +1,160 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.SceneManagement;
+
+namespace I2.Loc;
+
+public class ResourceManager : MonoBehaviour
+{
+ private static ResourceManager mInstance;
+
+ public List<IResourceManager_Bundles> mBundleManagers = new List<IResourceManager_Bundles>();
+
+ public UnityEngine.Object[] Assets;
+
+ private readonly Dictionary<string, UnityEngine.Object> mResourcesCache = new Dictionary<string, UnityEngine.Object>(StringComparer.Ordinal);
+
+ public static ResourceManager pInstance
+ {
+ get
+ {
+ bool flag = mInstance == null;
+ if (mInstance == null)
+ {
+ mInstance = (ResourceManager)UnityEngine.Object.FindObjectOfType(typeof(ResourceManager));
+ }
+ if (mInstance == null)
+ {
+ GameObject obj = new GameObject("I2ResourceManager", typeof(ResourceManager));
+ obj.hideFlags |= HideFlags.HideAndDontSave;
+ mInstance = obj.GetComponent<ResourceManager>();
+ SceneManager.sceneLoaded += MyOnLevelWasLoaded;
+ }
+ if (flag && Application.isPlaying)
+ {
+ UnityEngine.Object.DontDestroyOnLoad(mInstance.gameObject);
+ }
+ return mInstance;
+ }
+ }
+
+ public static void MyOnLevelWasLoaded(Scene scene, LoadSceneMode mode)
+ {
+ pInstance.CleanResourceCache();
+ LocalizationManager.UpdateSources();
+ }
+
+ public T GetAsset<T>(string Name) where T : UnityEngine.Object
+ {
+ T val = FindAsset(Name) as T;
+ if ((UnityEngine.Object)val != (UnityEngine.Object)null)
+ {
+ return val;
+ }
+ return LoadFromResources<T>(Name);
+ }
+
+ private UnityEngine.Object FindAsset(string Name)
+ {
+ if (Assets != null)
+ {
+ int i = 0;
+ for (int num = Assets.Length; i < num; i++)
+ {
+ if (Assets[i] != null && Assets[i].name == Name)
+ {
+ return Assets[i];
+ }
+ }
+ }
+ return null;
+ }
+
+ public bool HasAsset(UnityEngine.Object Obj)
+ {
+ if (Assets == null)
+ {
+ return false;
+ }
+ return Array.IndexOf(Assets, Obj) >= 0;
+ }
+
+ public T LoadFromResources<T>(string Path) where T : UnityEngine.Object
+ {
+ try
+ {
+ if (string.IsNullOrEmpty(Path))
+ {
+ return null;
+ }
+ if (mResourcesCache.TryGetValue(Path, out var value) && value != null)
+ {
+ return value as T;
+ }
+ T val = null;
+ if (Path.EndsWith("]", StringComparison.OrdinalIgnoreCase))
+ {
+ int num = Path.LastIndexOf("[", StringComparison.OrdinalIgnoreCase);
+ int length = Path.Length - num - 2;
+ string value2 = Path.Substring(num + 1, length);
+ Path = Path.Substring(0, num);
+ T[] array = Resources.LoadAll<T>(Path);
+ int i = 0;
+ for (int num2 = array.Length; i < num2; i++)
+ {
+ if (array[i].name.Equals(value2))
+ {
+ val = array[i];
+ break;
+ }
+ }
+ }
+ else
+ {
+ val = Resources.Load(Path, typeof(T)) as T;
+ }
+ if ((UnityEngine.Object)val == (UnityEngine.Object)null)
+ {
+ val = LoadFromBundle<T>(Path);
+ }
+ if ((UnityEngine.Object)val != (UnityEngine.Object)null)
+ {
+ mResourcesCache[Path] = val;
+ }
+ return val;
+ }
+ catch (Exception ex)
+ {
+ Debug.LogErrorFormat("Unable to load {0} '{1}'\nERROR: {2}", typeof(T), Path, ex.ToString());
+ return null;
+ }
+ }
+
+ public T LoadFromBundle<T>(string path) where T : UnityEngine.Object
+ {
+ int i = 0;
+ for (int count = mBundleManagers.Count; i < count; i++)
+ {
+ if (mBundleManagers[i] != null)
+ {
+ T val = mBundleManagers[i].LoadFromBundle(path, typeof(T)) as T;
+ if ((UnityEngine.Object)val != (UnityEngine.Object)null)
+ {
+ return val;
+ }
+ }
+ }
+ return null;
+ }
+
+ public void CleanResourceCache(bool unloadResources = false)
+ {
+ mResourcesCache.Clear();
+ if (unloadResources)
+ {
+ Resources.UnloadUnusedAssets();
+ }
+ CancelInvoke();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/SetLanguage.cs b/Thronefall_v1.57/Thronefall/I2.Loc/SetLanguage.cs
new file mode 100644
index 0000000..108efdc
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/SetLanguage.cs
@@ -0,0 +1,22 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+[AddComponentMenu("I2/Localization/SetLanguage Button")]
+public class SetLanguage : MonoBehaviour
+{
+ public string _Language;
+
+ private void OnClick()
+ {
+ ApplyLanguage();
+ }
+
+ public void ApplyLanguage()
+ {
+ if (LocalizationManager.HasLanguage(_Language))
+ {
+ LocalizationManager.CurrentLanguage = _Language;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/SetLanguageDropdown.cs b/Thronefall_v1.57/Thronefall/I2.Loc/SetLanguageDropdown.cs
new file mode 100644
index 0000000..4175b4f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/SetLanguageDropdown.cs
@@ -0,0 +1,39 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace I2.Loc;
+
+[AddComponentMenu("I2/Localization/SetLanguage Dropdown")]
+public class SetLanguageDropdown : MonoBehaviour
+{
+ private void OnEnable()
+ {
+ Dropdown component = GetComponent<Dropdown>();
+ if (!(component == null))
+ {
+ string currentLanguage = LocalizationManager.CurrentLanguage;
+ if (LocalizationManager.Sources.Count == 0)
+ {
+ LocalizationManager.UpdateSources();
+ }
+ List<string> allLanguages = LocalizationManager.GetAllLanguages();
+ component.ClearOptions();
+ component.AddOptions(allLanguages);
+ component.value = allLanguages.IndexOf(currentLanguage);
+ component.onValueChanged.RemoveListener(OnValueChanged);
+ component.onValueChanged.AddListener(OnValueChanged);
+ }
+ }
+
+ private void OnValueChanged(int index)
+ {
+ Dropdown component = GetComponent<Dropdown>();
+ if (index < 0)
+ {
+ index = 0;
+ component.value = index;
+ }
+ LocalizationManager.CurrentLanguage = component.options[index].text;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/SpecializationManager.cs b/Thronefall_v1.57/Thronefall/I2.Loc/SpecializationManager.cs
new file mode 100644
index 0000000..93515a5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/SpecializationManager.cs
@@ -0,0 +1,156 @@
+using System;
+using System.Collections.Generic;
+
+namespace I2.Loc;
+
+public class SpecializationManager : BaseSpecializationManager
+{
+ public static SpecializationManager Singleton = new SpecializationManager();
+
+ private SpecializationManager()
+ {
+ InitializeSpecializations();
+ }
+
+ public static string GetSpecializedText(string text, string specialization = null)
+ {
+ int num = text.IndexOf("[i2s_", StringComparison.Ordinal);
+ if (num < 0)
+ {
+ return text;
+ }
+ if (string.IsNullOrEmpty(specialization))
+ {
+ specialization = Singleton.GetCurrentSpecialization();
+ }
+ while (!string.IsNullOrEmpty(specialization) && specialization != "Any")
+ {
+ string text2 = "[i2s_" + specialization + "]";
+ int num2 = text.IndexOf(text2, StringComparison.Ordinal);
+ if (num2 < 0)
+ {
+ specialization = Singleton.GetFallbackSpecialization(specialization);
+ continue;
+ }
+ num2 += text2.Length;
+ int num3 = text.IndexOf("[i2s_", num2, StringComparison.Ordinal);
+ if (num3 < 0)
+ {
+ num3 = text.Length;
+ }
+ return text.Substring(num2, num3 - num2);
+ }
+ return text.Substring(0, num);
+ }
+
+ public static string SetSpecializedText(string text, string newText, string specialization)
+ {
+ if (string.IsNullOrEmpty(specialization))
+ {
+ specialization = "Any";
+ }
+ if ((text == null || !text.Contains("[i2s_")) && specialization == "Any")
+ {
+ return newText;
+ }
+ Dictionary<string, string> specializations = GetSpecializations(text);
+ specializations[specialization] = newText;
+ return SetSpecializedText(specializations);
+ }
+
+ public static string SetSpecializedText(Dictionary<string, string> specializations)
+ {
+ if (!specializations.TryGetValue("Any", out var value))
+ {
+ value = string.Empty;
+ }
+ foreach (KeyValuePair<string, string> specialization in specializations)
+ {
+ if (specialization.Key != "Any" && !string.IsNullOrEmpty(specialization.Value))
+ {
+ value = value + "[i2s_" + specialization.Key + "]" + specialization.Value;
+ }
+ }
+ return value;
+ }
+
+ public static Dictionary<string, string> GetSpecializations(string text, Dictionary<string, string> buffer = null)
+ {
+ if (buffer == null)
+ {
+ buffer = new Dictionary<string, string>(StringComparer.Ordinal);
+ }
+ else
+ {
+ buffer.Clear();
+ }
+ if (text == null)
+ {
+ buffer["Any"] = "";
+ return buffer;
+ }
+ int num = 0;
+ int num2 = text.IndexOf("[i2s_", StringComparison.Ordinal);
+ if (num2 < 0)
+ {
+ num2 = text.Length;
+ }
+ buffer["Any"] = text.Substring(0, num2);
+ for (num = num2; num < text.Length; num = num2)
+ {
+ num += "[i2s_".Length;
+ int num3 = text.IndexOf(']', num);
+ if (num3 < 0)
+ {
+ break;
+ }
+ string key = text.Substring(num, num3 - num);
+ num = num3 + 1;
+ num2 = text.IndexOf("[i2s_", num, StringComparison.Ordinal);
+ if (num2 < 0)
+ {
+ num2 = text.Length;
+ }
+ string value = text.Substring(num, num2 - num);
+ buffer[key] = value;
+ }
+ return buffer;
+ }
+
+ public static void AppendSpecializations(string text, List<string> list = null)
+ {
+ if (text == null)
+ {
+ return;
+ }
+ if (list == null)
+ {
+ list = new List<string>();
+ }
+ if (!list.Contains("Any"))
+ {
+ list.Add("Any");
+ }
+ int num = 0;
+ while (num < text.Length)
+ {
+ num = text.IndexOf("[i2s_", num, StringComparison.Ordinal);
+ if (num >= 0)
+ {
+ num += "[i2s_".Length;
+ int num2 = text.IndexOf(']', num);
+ if (num2 >= 0)
+ {
+ string item = text.Substring(num, num2 - num);
+ if (!list.Contains(item))
+ {
+ list.Add(item);
+ }
+ continue;
+ }
+ break;
+ }
+ break;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/StringObfucator.cs b/Thronefall_v1.57/Thronefall/I2.Loc/StringObfucator.cs
new file mode 100644
index 0000000..4f054ef
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/StringObfucator.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Text;
+
+namespace I2.Loc;
+
+public class StringObfucator
+{
+ public static char[] StringObfuscatorPassword = "ÝúbUu\u00b8CÁ§*4PÚ©-᩾@T6Dl±ÒWâuzÅm4GÐóØ$=Íg,¥Që®iKEßr¡×60Ít4öÃ~^«y:Èd1<QÛÝúbUu\u00b8CÁ§*4PÚ©-᩾@T6Dl±ÒWâuzÅm4GÐóØ$=Íg,¥Që®iKEßr¡×60Ít4öÃ~^«y:Èd".ToCharArray();
+
+ public static string Encode(string NormalString)
+ {
+ try
+ {
+ return ToBase64(XoREncode(NormalString));
+ }
+ catch (Exception)
+ {
+ return null;
+ }
+ }
+
+ public static string Decode(string ObfucatedString)
+ {
+ try
+ {
+ return XoREncode(FromBase64(ObfucatedString));
+ }
+ catch (Exception)
+ {
+ return null;
+ }
+ }
+
+ private static string ToBase64(string regularString)
+ {
+ return Convert.ToBase64String(Encoding.UTF8.GetBytes(regularString));
+ }
+
+ private static string FromBase64(string base64string)
+ {
+ byte[] array = Convert.FromBase64String(base64string);
+ return Encoding.UTF8.GetString(array, 0, array.Length);
+ }
+
+ private static string XoREncode(string NormalString)
+ {
+ try
+ {
+ char[] stringObfuscatorPassword = StringObfuscatorPassword;
+ char[] array = NormalString.ToCharArray();
+ int num = stringObfuscatorPassword.Length;
+ int i = 0;
+ for (int num2 = array.Length; i < num2; i++)
+ {
+ array[i] = (char)(array[i] ^ stringObfuscatorPassword[i % num] ^ (byte)((i % 2 == 0) ? (i * 23) : (-i * 51)));
+ }
+ return new string(array);
+ }
+ catch (Exception)
+ {
+ return null;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/TashkeelLocation.cs b/Thronefall_v1.57/Thronefall/I2.Loc/TashkeelLocation.cs
new file mode 100644
index 0000000..ac6f3a4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/TashkeelLocation.cs
@@ -0,0 +1,14 @@
+namespace I2.Loc;
+
+internal class TashkeelLocation
+{
+ public char tashkeel;
+
+ public int position;
+
+ public TashkeelLocation(char tashkeel, int position)
+ {
+ this.tashkeel = tashkeel;
+ this.position = position;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/TermData.cs b/Thronefall_v1.57/Thronefall/I2.Loc/TermData.cs
new file mode 100644
index 0000000..6827525
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/TermData.cs
@@ -0,0 +1,123 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace I2.Loc;
+
+[Serializable]
+public class TermData
+{
+ public string Term = string.Empty;
+
+ public eTermType TermType;
+
+ [NonSerialized]
+ public string Description;
+
+ public string[] Languages = Array.Empty<string>();
+
+ public byte[] Flags = Array.Empty<byte>();
+
+ [SerializeField]
+ private string[] Languages_Touch;
+
+ public string GetTranslation(int idx, string specialization = null, bool editMode = false)
+ {
+ string text = Languages[idx];
+ if (text != null)
+ {
+ text = SpecializationManager.GetSpecializedText(text, specialization);
+ if (!editMode)
+ {
+ text = text.Replace("[i2nt]", "").Replace("[/i2nt]", "");
+ }
+ }
+ return text;
+ }
+
+ public void SetTranslation(int idx, string translation, string specialization = null)
+ {
+ Languages[idx] = SpecializationManager.SetSpecializedText(Languages[idx], translation, specialization);
+ }
+
+ public void RemoveSpecialization(string specialization)
+ {
+ for (int i = 0; i < Languages.Length; i++)
+ {
+ RemoveSpecialization(i, specialization);
+ }
+ }
+
+ public void RemoveSpecialization(int idx, string specialization)
+ {
+ string text = Languages[idx];
+ if (!(specialization == "Any") && text.Contains("[i2s_" + specialization + "]"))
+ {
+ Dictionary<string, string> specializations = SpecializationManager.GetSpecializations(text);
+ specializations.Remove(specialization);
+ Languages[idx] = SpecializationManager.SetSpecializedText(specializations);
+ }
+ }
+
+ public bool IsAutoTranslated(int idx, bool IsTouch)
+ {
+ return (Flags[idx] & 2) > 0;
+ }
+
+ public void Validate()
+ {
+ int num = Mathf.Max(Languages.Length, Flags.Length);
+ if (Languages.Length != num)
+ {
+ Array.Resize(ref Languages, num);
+ }
+ if (Flags.Length != num)
+ {
+ Array.Resize(ref Flags, num);
+ }
+ if (Languages_Touch == null)
+ {
+ return;
+ }
+ for (int i = 0; i < Mathf.Min(Languages_Touch.Length, num); i++)
+ {
+ if (string.IsNullOrEmpty(Languages[i]) && !string.IsNullOrEmpty(Languages_Touch[i]))
+ {
+ Languages[i] = Languages_Touch[i];
+ Languages_Touch[i] = null;
+ }
+ }
+ Languages_Touch = null;
+ }
+
+ public bool IsTerm(string name, bool allowCategoryMistmatch)
+ {
+ if (!allowCategoryMistmatch)
+ {
+ return name == Term;
+ }
+ return name == LanguageSourceData.GetKeyFromFullTerm(Term);
+ }
+
+ public bool HasSpecializations()
+ {
+ for (int i = 0; i < Languages.Length; i++)
+ {
+ if (!string.IsNullOrEmpty(Languages[i]) && Languages[i].Contains("[i2s_"))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public List<string> GetAllSpecializations()
+ {
+ List<string> list = new List<string>();
+ for (int i = 0; i < Languages.Length; i++)
+ {
+ SpecializationManager.AppendSpecializations(Languages[i], list);
+ }
+ return list;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/TermsPopup.cs b/Thronefall_v1.57/Thronefall/I2.Loc/TermsPopup.cs
new file mode 100644
index 0000000..827e495
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/TermsPopup.cs
@@ -0,0 +1,13 @@
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class TermsPopup : PropertyAttribute
+{
+ public string Filter { get; private set; }
+
+ public TermsPopup(string filter = "")
+ {
+ Filter = filter;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/ToggleLanguage.cs b/Thronefall_v1.57/Thronefall/I2.Loc/ToggleLanguage.cs
new file mode 100644
index 0000000..881e0fe
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/ToggleLanguage.cs
@@ -0,0 +1,27 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace I2.Loc;
+
+public class ToggleLanguage : MonoBehaviour
+{
+ private void Start()
+ {
+ Invoke("test", 3f);
+ }
+
+ private void test()
+ {
+ List<string> allLanguages = LocalizationManager.GetAllLanguages();
+ int num = allLanguages.IndexOf(LocalizationManager.CurrentLanguage);
+ if (num < 0)
+ {
+ num = 0;
+ }
+ else
+ {
+ num = (num + 1) % allLanguages.Count;
+ }
+ Invoke("test", 3f);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/TranslationFlag.cs b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationFlag.cs
new file mode 100644
index 0000000..c2c705b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationFlag.cs
@@ -0,0 +1,7 @@
+namespace I2.Loc;
+
+public enum TranslationFlag : byte
+{
+ Normal = 1,
+ AutoTranslated
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob.cs b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob.cs
new file mode 100644
index 0000000..a93545d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob.cs
@@ -0,0 +1,24 @@
+using System;
+
+namespace I2.Loc;
+
+public class TranslationJob : IDisposable
+{
+ public enum eJobState
+ {
+ Running,
+ Succeeded,
+ Failed
+ }
+
+ public eJobState mJobState;
+
+ public virtual eJobState GetState()
+ {
+ return mJobState;
+ }
+
+ public virtual void Dispose()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_GET.cs b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_GET.cs
new file mode 100644
index 0000000..d224401
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_GET.cs
@@ -0,0 +1,72 @@
+using System.Collections.Generic;
+using System.Text;
+using UnityEngine.Networking;
+
+namespace I2.Loc;
+
+public class TranslationJob_GET : TranslationJob_WWW
+{
+ private Dictionary<string, TranslationQuery> _requests;
+
+ private GoogleTranslation.fnOnTranslationReady _OnTranslationReady;
+
+ private List<string> mQueries;
+
+ public string mErrorMessage;
+
+ public TranslationJob_GET(Dictionary<string, TranslationQuery> requests, GoogleTranslation.fnOnTranslationReady OnTranslationReady)
+ {
+ _requests = requests;
+ _OnTranslationReady = OnTranslationReady;
+ mQueries = GoogleTranslation.ConvertTranslationRequest(requests, encodeGET: true);
+ GetState();
+ }
+
+ private void ExecuteNextQuery()
+ {
+ if (mQueries.Count == 0)
+ {
+ mJobState = eJobState.Succeeded;
+ return;
+ }
+ int index = mQueries.Count - 1;
+ string text = mQueries[index];
+ mQueries.RemoveAt(index);
+ string uri = LocalizationManager.GetWebServiceURL() + "?action=Translate&list=" + text;
+ www = UnityWebRequest.Get(uri);
+ I2Utils.SendWebRequest(www);
+ }
+
+ public override eJobState GetState()
+ {
+ if (www != null && www.isDone)
+ {
+ ProcessResult(www.downloadHandler.data, www.error);
+ www.Dispose();
+ www = null;
+ }
+ if (www == null)
+ {
+ ExecuteNextQuery();
+ }
+ return mJobState;
+ }
+
+ public void ProcessResult(byte[] bytes, string errorMsg)
+ {
+ if (string.IsNullOrEmpty(errorMsg))
+ {
+ errorMsg = GoogleTranslation.ParseTranslationResult(Encoding.UTF8.GetString(bytes, 0, bytes.Length), _requests);
+ if (string.IsNullOrEmpty(errorMsg))
+ {
+ if (_OnTranslationReady != null)
+ {
+ _OnTranslationReady(_requests, null);
+ }
+ return;
+ }
+ }
+ mJobState = eJobState.Failed;
+ mErrorMessage = errorMsg;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_Main.cs b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_Main.cs
new file mode 100644
index 0000000..595872a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_Main.cs
@@ -0,0 +1,96 @@
+using System.Collections.Generic;
+
+namespace I2.Loc;
+
+public class TranslationJob_Main : TranslationJob
+{
+ private TranslationJob_WEB mWeb;
+
+ private TranslationJob_POST mPost;
+
+ private TranslationJob_GET mGet;
+
+ private Dictionary<string, TranslationQuery> _requests;
+
+ private GoogleTranslation.fnOnTranslationReady _OnTranslationReady;
+
+ public string mErrorMessage;
+
+ public TranslationJob_Main(Dictionary<string, TranslationQuery> requests, GoogleTranslation.fnOnTranslationReady OnTranslationReady)
+ {
+ _requests = requests;
+ _OnTranslationReady = OnTranslationReady;
+ mPost = new TranslationJob_POST(requests, OnTranslationReady);
+ }
+
+ public override eJobState GetState()
+ {
+ if (mWeb != null)
+ {
+ switch (mWeb.GetState())
+ {
+ case eJobState.Running:
+ return eJobState.Running;
+ case eJobState.Succeeded:
+ mJobState = eJobState.Succeeded;
+ break;
+ case eJobState.Failed:
+ mWeb.Dispose();
+ mWeb = null;
+ mPost = new TranslationJob_POST(_requests, _OnTranslationReady);
+ break;
+ }
+ }
+ if (mPost != null)
+ {
+ switch (mPost.GetState())
+ {
+ case eJobState.Running:
+ return eJobState.Running;
+ case eJobState.Succeeded:
+ mJobState = eJobState.Succeeded;
+ break;
+ case eJobState.Failed:
+ mPost.Dispose();
+ mPost = null;
+ mGet = new TranslationJob_GET(_requests, _OnTranslationReady);
+ break;
+ }
+ }
+ if (mGet != null)
+ {
+ switch (mGet.GetState())
+ {
+ case eJobState.Running:
+ return eJobState.Running;
+ case eJobState.Succeeded:
+ mJobState = eJobState.Succeeded;
+ break;
+ case eJobState.Failed:
+ mErrorMessage = mGet.mErrorMessage;
+ if (_OnTranslationReady != null)
+ {
+ _OnTranslationReady(_requests, mErrorMessage);
+ }
+ mGet.Dispose();
+ mGet = null;
+ break;
+ }
+ }
+ return mJobState;
+ }
+
+ public override void Dispose()
+ {
+ if (mPost != null)
+ {
+ mPost.Dispose();
+ }
+ if (mGet != null)
+ {
+ mGet.Dispose();
+ }
+ mPost = null;
+ mGet = null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_POST.cs b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_POST.cs
new file mode 100644
index 0000000..561cb90
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_POST.cs
@@ -0,0 +1,51 @@
+using System.Collections.Generic;
+using System.Text;
+using UnityEngine;
+using UnityEngine.Networking;
+
+namespace I2.Loc;
+
+public class TranslationJob_POST : TranslationJob_WWW
+{
+ private Dictionary<string, TranslationQuery> _requests;
+
+ private GoogleTranslation.fnOnTranslationReady _OnTranslationReady;
+
+ public TranslationJob_POST(Dictionary<string, TranslationQuery> requests, GoogleTranslation.fnOnTranslationReady OnTranslationReady)
+ {
+ _requests = requests;
+ _OnTranslationReady = OnTranslationReady;
+ List<string> list = GoogleTranslation.ConvertTranslationRequest(requests, encodeGET: false);
+ WWWForm wWWForm = new WWWForm();
+ wWWForm.AddField("action", "Translate");
+ wWWForm.AddField("list", list[0]);
+ www = UnityWebRequest.Post(LocalizationManager.GetWebServiceURL(), wWWForm);
+ I2Utils.SendWebRequest(www);
+ }
+
+ public override eJobState GetState()
+ {
+ if (www != null && www.isDone)
+ {
+ ProcessResult(www.downloadHandler.data, www.error);
+ www.Dispose();
+ www = null;
+ }
+ return mJobState;
+ }
+
+ public void ProcessResult(byte[] bytes, string errorMsg)
+ {
+ if (!string.IsNullOrEmpty(errorMsg))
+ {
+ mJobState = eJobState.Failed;
+ return;
+ }
+ errorMsg = GoogleTranslation.ParseTranslationResult(Encoding.UTF8.GetString(bytes, 0, bytes.Length), _requests);
+ if (_OnTranslationReady != null)
+ {
+ _OnTranslationReady(_requests, errorMsg);
+ }
+ mJobState = eJobState.Succeeded;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_WEB.cs b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_WEB.cs
new file mode 100644
index 0000000..4136e38
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_WEB.cs
@@ -0,0 +1,154 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Text;
+using System.Text.RegularExpressions;
+using UnityEngine;
+using UnityEngine.Networking;
+
+namespace I2.Loc;
+
+public class TranslationJob_WEB : TranslationJob_WWW
+{
+ private Dictionary<string, TranslationQuery> _requests;
+
+ private GoogleTranslation.fnOnTranslationReady _OnTranslationReady;
+
+ public string mErrorMessage;
+
+ private string mCurrentBatch_ToLanguageCode;
+
+ private string mCurrentBatch_FromLanguageCode;
+
+ private List<string> mCurrentBatch_Text;
+
+ private List<KeyValuePair<string, string>> mQueries;
+
+ public TranslationJob_WEB(Dictionary<string, TranslationQuery> requests, GoogleTranslation.fnOnTranslationReady OnTranslationReady)
+ {
+ _requests = requests;
+ _OnTranslationReady = OnTranslationReady;
+ FindAllQueries();
+ ExecuteNextBatch();
+ }
+
+ private void FindAllQueries()
+ {
+ mQueries = new List<KeyValuePair<string, string>>();
+ foreach (KeyValuePair<string, TranslationQuery> request in _requests)
+ {
+ string[] targetLanguagesCode = request.Value.TargetLanguagesCode;
+ foreach (string text in targetLanguagesCode)
+ {
+ mQueries.Add(new KeyValuePair<string, string>(request.Value.OrigText, request.Value.LanguageCode + ":" + text));
+ }
+ }
+ mQueries.Sort((KeyValuePair<string, string> a, KeyValuePair<string, string> b) => a.Value.CompareTo(b.Value));
+ }
+
+ private void ExecuteNextBatch()
+ {
+ if (mQueries.Count == 0)
+ {
+ mJobState = eJobState.Succeeded;
+ return;
+ }
+ mCurrentBatch_Text = new List<string>();
+ string text = null;
+ int num = 200;
+ StringBuilder stringBuilder = new StringBuilder();
+ int i;
+ for (i = 0; i < mQueries.Count; i++)
+ {
+ string key = mQueries[i].Key;
+ string value = mQueries[i].Value;
+ if (text == null || value == text)
+ {
+ if (i != 0)
+ {
+ stringBuilder.Append("|||");
+ }
+ stringBuilder.Append(key);
+ mCurrentBatch_Text.Add(key);
+ text = value;
+ }
+ if (stringBuilder.Length > num)
+ {
+ break;
+ }
+ }
+ mQueries.RemoveRange(0, i);
+ string[] array = text.Split(':');
+ mCurrentBatch_FromLanguageCode = array[0];
+ mCurrentBatch_ToLanguageCode = array[1];
+ string text2 = $"http://www.google.com/translate_t?hl=en&vi=c&ie=UTF8&oe=UTF8&submit=Translate&langpair={mCurrentBatch_FromLanguageCode}|{mCurrentBatch_ToLanguageCode}&text={Uri.EscapeUriString(stringBuilder.ToString())}";
+ Debug.Log(text2);
+ www = UnityWebRequest.Get(text2);
+ I2Utils.SendWebRequest(www);
+ }
+
+ public override eJobState GetState()
+ {
+ if (www != null && www.isDone)
+ {
+ ProcessResult(www.downloadHandler.data, www.error);
+ www.Dispose();
+ www = null;
+ }
+ if (www == null)
+ {
+ ExecuteNextBatch();
+ }
+ return mJobState;
+ }
+
+ public void ProcessResult(byte[] bytes, string errorMsg)
+ {
+ if (string.IsNullOrEmpty(errorMsg))
+ {
+ string @string = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
+ Debug.Log(ParseTranslationResult(@string, "aab"));
+ if (string.IsNullOrEmpty(errorMsg))
+ {
+ if (_OnTranslationReady != null)
+ {
+ _OnTranslationReady(_requests, null);
+ }
+ return;
+ }
+ }
+ mJobState = eJobState.Failed;
+ mErrorMessage = errorMsg;
+ }
+
+ private string ParseTranslationResult(string html, string OriginalText)
+ {
+ try
+ {
+ int num = html.IndexOf("TRANSLATED_TEXT='", StringComparison.Ordinal) + "TRANSLATED_TEXT='".Length;
+ int num2 = html.IndexOf("';var", num, StringComparison.Ordinal);
+ string input = html.Substring(num, num2 - num);
+ input = Regex.Replace(input, "\\\\x([a-fA-F0-9]{2})", (Match match) => char.ConvertFromUtf32(int.Parse(match.Groups[1].Value, NumberStyles.HexNumber)));
+ input = Regex.Replace(input, "&#(\\d+);", (Match match) => char.ConvertFromUtf32(int.Parse(match.Groups[1].Value)));
+ input = input.Replace("<br>", "\n");
+ if (OriginalText.ToUpper() == OriginalText)
+ {
+ input = input.ToUpper();
+ }
+ else if (GoogleTranslation.UppercaseFirst(OriginalText) == OriginalText)
+ {
+ input = GoogleTranslation.UppercaseFirst(input);
+ }
+ else if (GoogleTranslation.TitleCase(OriginalText) == OriginalText)
+ {
+ input = GoogleTranslation.TitleCase(input);
+ }
+ return input;
+ }
+ catch (Exception ex)
+ {
+ Debug.LogError(ex.Message);
+ return string.Empty;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_WWW.cs b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_WWW.cs
new file mode 100644
index 0000000..f10586e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationJob_WWW.cs
@@ -0,0 +1,17 @@
+using UnityEngine.Networking;
+
+namespace I2.Loc;
+
+public class TranslationJob_WWW : TranslationJob
+{
+ public UnityWebRequest www;
+
+ public override void Dispose()
+ {
+ if (www != null)
+ {
+ www.Dispose();
+ }
+ www = null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/TranslationQuery.cs b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationQuery.cs
new file mode 100644
index 0000000..009b151
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/TranslationQuery.cs
@@ -0,0 +1,16 @@
+namespace I2.Loc;
+
+public struct TranslationQuery
+{
+ public string OrigText;
+
+ public string Text;
+
+ public string LanguageCode;
+
+ public string[] TargetLanguagesCode;
+
+ public string[] Results;
+
+ public string[] Tags;
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/eLanguageDataFlags.cs b/Thronefall_v1.57/Thronefall/I2.Loc/eLanguageDataFlags.cs
new file mode 100644
index 0000000..4378a2d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/eLanguageDataFlags.cs
@@ -0,0 +1,8 @@
+namespace I2.Loc;
+
+public enum eLanguageDataFlags
+{
+ DISABLED = 1,
+ KEEP_LOADED = 2,
+ NOT_LOADED = 4
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/ePluralType.cs b/Thronefall_v1.57/Thronefall/I2.Loc/ePluralType.cs
new file mode 100644
index 0000000..cffad52
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/ePluralType.cs
@@ -0,0 +1,11 @@
+namespace I2.Loc;
+
+public enum ePluralType
+{
+ Zero,
+ One,
+ Two,
+ Few,
+ Many,
+ Plural
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/eSpreadsheetUpdateMode.cs b/Thronefall_v1.57/Thronefall/I2.Loc/eSpreadsheetUpdateMode.cs
new file mode 100644
index 0000000..75d6fca
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/eSpreadsheetUpdateMode.cs
@@ -0,0 +1,9 @@
+namespace I2.Loc;
+
+public enum eSpreadsheetUpdateMode
+{
+ None,
+ Replace,
+ Merge,
+ AddNewTerms
+}
diff --git a/Thronefall_v1.57/Thronefall/I2.Loc/eTermType.cs b/Thronefall_v1.57/Thronefall/I2.Loc/eTermType.cs
new file mode 100644
index 0000000..dd00f6d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/I2.Loc/eTermType.cs
@@ -0,0 +1,17 @@
+namespace I2.Loc;
+
+public enum eTermType
+{
+ Text,
+ Font,
+ Texture,
+ AudioClip,
+ GameObject,
+ Sprite,
+ Material,
+ Child,
+ Mesh,
+ TextMeshPFont,
+ Object,
+ Video
+}
diff --git a/Thronefall_v1.57/Thronefall/MoreMountains.Feedbacks/OneShotAudioTrigger.cs b/Thronefall_v1.57/Thronefall/MoreMountains.Feedbacks/OneShotAudioTrigger.cs
new file mode 100644
index 0000000..a2246cf
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/MoreMountains.Feedbacks/OneShotAudioTrigger.cs
@@ -0,0 +1,18 @@
+using UnityEngine;
+
+namespace MoreMountains.Feedbacks;
+
+[AddComponentMenu("")]
+[FeedbackHelp("This feedback will allow you to play an audio oneshot on the Thronefall Sound Manager.")]
+[FeedbackPath("Thronefall/Audio Oneshot")]
+public class OneShotAudioTrigger : MMF_Feedback
+{
+ [MMFInspectorGroup("Audio", true, 12, true, false)]
+ [Tooltip("The oneshot you want to play.")]
+ public ThronefallAudioManager.AudioOneShot oneshot;
+
+ protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1f)
+ {
+ ThronefallAudioManager.Oneshot(oneshot);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/AfterCombineAction.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/AfterCombineAction.cs
new file mode 100644
index 0000000..f586b15
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/AfterCombineAction.cs
@@ -0,0 +1,8 @@
+namespace NGS.MeshFusionPro;
+
+public enum AfterCombineAction
+{
+ DisableComponents,
+ DestroyGameObject,
+ DoNothing
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BinaryTree.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BinaryTree.cs
new file mode 100644
index 0000000..b7eddf1
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BinaryTree.cs
@@ -0,0 +1,156 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public abstract class BinaryTree<TNode, TData> where TNode : BinaryTreeNode<TData>
+{
+ private Dictionary<TData, List<TNode>> _dataToNodes;
+
+ public IBinaryTreeNode Root => RootInternal;
+
+ public int Height { get; private set; }
+
+ protected TNode RootInternal { get; private set; }
+
+ public BinaryTree()
+ {
+ Height = 0;
+ _dataToNodes = new Dictionary<TData, List<TNode>>();
+ }
+
+ public void Add(TData data)
+ {
+ if (Root == null)
+ {
+ RootInternal = CreateRoot(data);
+ Height = 1;
+ }
+ if (!Includes(RootInternal, data))
+ {
+ GrowTreeUp(data);
+ }
+ AddData(RootInternal, data, 1);
+ }
+
+ public bool Remove(TData data)
+ {
+ if (!_dataToNodes.TryGetValue(data, out var value))
+ {
+ return false;
+ }
+ foreach (TNode item in value)
+ {
+ item.Remove(data);
+ }
+ return _dataToNodes.Remove(data);
+ }
+
+ protected void GrowTreeUp(TData target)
+ {
+ if (!Includes(RootInternal, target))
+ {
+ RootInternal = ExpandRoot(RootInternal, target);
+ Height++;
+ GrowTreeUp(target);
+ }
+ }
+
+ protected void GrowTreeDown(TNode node, TData target, int depth)
+ {
+ if (node.HasChilds)
+ {
+ throw new Exception("GrowTreeDown::" + depth + " node already has childs");
+ }
+ Bounds bounds = node.Bounds;
+ Vector3 vector;
+ Vector3 size;
+ if (bounds.size.x > bounds.size.y || bounds.size.x > bounds.size.z)
+ {
+ vector = new Vector3(bounds.size.x / 4f, 0f, 0f);
+ size = new Vector3(bounds.size.x / 2f, bounds.size.y, bounds.size.z);
+ }
+ else if (bounds.size.y > bounds.size.x || bounds.size.y > bounds.size.z)
+ {
+ vector = new Vector3(0f, bounds.size.y / 4f, 0f);
+ size = new Vector3(bounds.size.x, bounds.size.y / 2f, bounds.size.z);
+ }
+ else
+ {
+ vector = new Vector3(0f, 0f, bounds.size.z / 4f);
+ size = new Vector3(bounds.size.x, bounds.size.y, bounds.size.z / 2f);
+ }
+ bool flag = depth == Height;
+ TNode val = CreateNode(bounds.center - vector, size, flag);
+ TNode val2 = CreateNode(bounds.center + vector, size, flag);
+ node.SetChilds(val, val2);
+ if (!flag)
+ {
+ if (Intersects(val, target))
+ {
+ GrowTreeDown(val, target, depth + 1);
+ }
+ if (Intersects(val2, target))
+ {
+ GrowTreeDown(val2, target, depth + 1);
+ }
+ }
+ }
+
+ protected void AddData(TNode node, TData data, int depth)
+ {
+ if (node.IsLeaf)
+ {
+ node.Add(data);
+ if (!_dataToNodes.TryGetValue(data, out var value))
+ {
+ value = new List<TNode>();
+ _dataToNodes.Add(data, value);
+ }
+ if (!value.Contains(node))
+ {
+ value.Add(node);
+ }
+ return;
+ }
+ if (!node.HasChilds)
+ {
+ GrowTreeDown(node, data, depth + 1);
+ }
+ TNode node2 = (TNode)node.Left;
+ TNode node3 = (TNode)node.Right;
+ if (Intersects(node2, data))
+ {
+ AddData(node2, data, depth + 1);
+ }
+ if (Intersects(node3, data))
+ {
+ AddData(node3, data, depth + 1);
+ }
+ }
+
+ protected void TreeTraversal(Func<TNode, int, bool> func)
+ {
+ TreeTraversal(RootInternal, 1, func);
+ }
+
+ protected void TreeTraversal(TNode current, int depth, Func<TNode, int, bool> func)
+ {
+ if (func(current, depth) && current.HasChilds)
+ {
+ TreeTraversal((TNode)current.Left, depth + 1, func);
+ TreeTraversal((TNode)current.Right, depth + 1, func);
+ }
+ }
+
+ protected abstract TNode CreateRoot(TData data);
+
+ protected abstract TNode ExpandRoot(TNode root, TData target);
+
+ protected abstract TNode CreateNode(Vector3 center, Vector3 size, bool isLeaf);
+
+ protected abstract bool Intersects(TNode node, TData data);
+
+ protected abstract bool Includes(TNode node, TData data);
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BinaryTreeDrawer.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BinaryTreeDrawer.cs
new file mode 100644
index 0000000..87776a2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BinaryTreeDrawer.cs
@@ -0,0 +1,22 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class BinaryTreeDrawer<TData>
+{
+ public void DrawGizmo(IBinaryTreeNode root, Color color)
+ {
+ Gizmos.color = color;
+ DrawNode(root);
+ }
+
+ private void DrawNode(IBinaryTreeNode node)
+ {
+ Gizmos.DrawWireCube(node.Center, node.Size);
+ if (node.HasChilds)
+ {
+ DrawNode(node.GetLeft());
+ DrawNode(node.GetRight());
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BinaryTreeNode.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BinaryTreeNode.cs
new file mode 100644
index 0000000..4558519
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BinaryTreeNode.cs
@@ -0,0 +1,48 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public abstract class BinaryTreeNode<TData> : IBinaryTreeNode
+{
+ public BinaryTreeNode<TData> Left { get; private set; }
+
+ public BinaryTreeNode<TData> Right { get; private set; }
+
+ public bool IsLeaf { get; private set; }
+
+ public bool HasChilds => Left != null;
+
+ public Vector3 Center { get; private set; }
+
+ public Vector3 Size { get; private set; }
+
+ public Bounds Bounds { get; private set; }
+
+ public BinaryTreeNode(Vector3 center, Vector3 size, bool isLeaf)
+ {
+ Center = center;
+ Size = size;
+ Bounds = new Bounds(center, size);
+ IsLeaf = isLeaf;
+ }
+
+ public IBinaryTreeNode GetLeft()
+ {
+ return Left;
+ }
+
+ public IBinaryTreeNode GetRight()
+ {
+ return Right;
+ }
+
+ public void SetChilds(BinaryTreeNode<TData> left, BinaryTreeNode<TData> right)
+ {
+ Left = left;
+ Right = right;
+ }
+
+ public abstract void Add(TData data);
+
+ public abstract void Remove(TData data);
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BoundsHelper.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BoundsHelper.cs
new file mode 100644
index 0000000..012a350
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/BoundsHelper.cs
@@ -0,0 +1,39 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public static class BoundsHelper
+{
+ public static Bounds Transform(this Bounds bounds, Matrix4x4 transform)
+ {
+ Vector3 min = bounds.min;
+ Vector3 max = bounds.max;
+ Vector4 column = transform.GetColumn(3);
+ Vector3 vector = column;
+ Vector3 vector2 = column;
+ for (int i = 0; i < 3; i++)
+ {
+ for (int j = 0; j < 3; j++)
+ {
+ float num = transform[i, j];
+ float num2 = num * min[j];
+ float num3 = num * max[j];
+ vector[i] += ((num2 < num3) ? num2 : num3);
+ vector2[i] += ((num2 < num3) ? num3 : num2);
+ }
+ }
+ Bounds result = default(Bounds);
+ result.center = transform.MultiplyPoint3x4(bounds.center);
+ result.size = vector2 - vector;
+ return result;
+ }
+
+ public static bool Contains(this Bounds bounds, Bounds target)
+ {
+ if (bounds.Contains(target.min))
+ {
+ return bounds.Contains(target.max);
+ }
+ return false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineErrorStrategy.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineErrorStrategy.cs
new file mode 100644
index 0000000..89cfbe3
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineErrorStrategy.cs
@@ -0,0 +1,7 @@
+namespace NGS.MeshFusionPro;
+
+public enum CombineErrorStrategy
+{
+ UndoCombining,
+ Ignore
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineMethod.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineMethod.cs
new file mode 100644
index 0000000..e30d53e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineMethod.cs
@@ -0,0 +1,6 @@
+namespace NGS.MeshFusionPro;
+
+public enum CombineMethod
+{
+ Simple
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineSource.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineSource.cs
new file mode 100644
index 0000000..f010062
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineSource.cs
@@ -0,0 +1,92 @@
+using System;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class CombineSource : ICombineSource<CombinedObject, CombinedObjectPart>, ICombineSource
+{
+ public Vector3 Position { get; private set; }
+
+ public Bounds Bounds { get; private set; }
+
+ public MeshCombineInfo CombineInfo { get; private set; }
+
+ public RendererSettings RendererSettings { get; private set; }
+
+ public event Action<ICombinedObject, ICombinedObjectPart> onCombined;
+
+ public event Action<ICombinedObject, string> onCombineError;
+
+ public event Action<ICombinedObject> onCombineFailed;
+
+ public event Action<CombinedObject, CombinedObjectPart> onCombinedTyped;
+
+ public event Action<CombinedObject, string> onCombineErrorTyped;
+
+ public event Action<CombinedObject> onCombineFailedTyped;
+
+ public CombineSource(GameObject go, int submeshIndex = 0)
+ : this(go.GetComponent<MeshFilter>().mesh, go.GetComponent<MeshRenderer>(), submeshIndex)
+ {
+ }
+
+ public CombineSource(Mesh mesh, MeshRenderer renderer, int submeshIndex = 0)
+ {
+ if (mesh == null)
+ {
+ throw new ArgumentException("Mesh is null");
+ }
+ if (renderer == null)
+ {
+ throw new ArgumentException("Mesh Renderer is null");
+ }
+ if (submeshIndex >= mesh.subMeshCount)
+ {
+ throw new ArgumentException("Submesh index is greater the submeshCount");
+ }
+ MeshCombineInfo info = new MeshCombineInfo(mesh, renderer.localToWorldMatrix, renderer.lightmapScaleOffset, renderer.realtimeLightmapScaleOffset, submeshIndex);
+ RendererSettings settings = new RendererSettings(renderer, submeshIndex);
+ Construct(info, settings, renderer.bounds);
+ }
+
+ public CombineSource(MeshCombineInfo info, RendererSettings settings)
+ : this(info, settings, info.mesh.bounds.Transform(info.transformMatrix))
+ {
+ }
+
+ public CombineSource(MeshCombineInfo info, RendererSettings settings, Bounds bounds)
+ {
+ Construct(info, settings, bounds);
+ }
+
+ private void Construct(MeshCombineInfo info, RendererSettings settings, Bounds bounds)
+ {
+ CombineInfo = info;
+ RendererSettings = settings;
+ Position = info.transformMatrix.GetTranslation();
+ Bounds = bounds;
+ }
+
+ public void Combined(CombinedObject root, CombinedObjectPart part)
+ {
+ this.onCombined?.Invoke(root, part);
+ this.onCombinedTyped?.Invoke(root, part);
+ }
+
+ public void CombineError(CombinedObject root, string errorMessage)
+ {
+ if (this.onCombineError == null && this.onCombinedTyped == null)
+ {
+ Debug.Log("Error during combine " + root.name + ", reason :" + errorMessage);
+ return;
+ }
+ this.onCombineError?.Invoke(root, errorMessage);
+ this.onCombineErrorTyped?.Invoke(root, errorMessage);
+ }
+
+ public void CombineFailed(CombinedObject root)
+ {
+ this.onCombineFailed?.Invoke(root);
+ this.onCombineFailedTyped?.Invoke(root);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineTree.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineTree.cs
new file mode 100644
index 0000000..2fd39af
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineTree.cs
@@ -0,0 +1,112 @@
+using System;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class CombineTree : BinaryTree<CombineTreeNode, ICombineSource>
+{
+ private ICombinedMeshFactory _factory;
+
+ private float _leafSize;
+
+ private int _vertexLimit;
+
+ public float LeafSize => _leafSize;
+
+ public int VertexLimit => _vertexLimit;
+
+ public ICombinedMeshFactory CombinedMeshFactory => _factory;
+
+ public event Action<CombinedObject> onStaticCombinedObjectCreated;
+
+ public event Action<DynamicCombinedObject> onDynamicCombinedObjectCreated;
+
+ public event Action<CombinedLODGroup> onCombinedLODGroupCreated;
+
+ public CombineTree(ICombinedMeshFactory factory, float leafSize, int vertexLimit)
+ {
+ _factory = factory;
+ _leafSize = leafSize;
+ _vertexLimit = vertexLimit;
+ }
+
+ public void Combine()
+ {
+ TreeTraversal(delegate(CombineTreeNode node, int depth)
+ {
+ node.Combine();
+ return true;
+ });
+ }
+
+ protected override CombineTreeNode CreateRoot(ICombineSource source)
+ {
+ return CreateNode(source.Position, Vector3.one * _leafSize, isLeaf: true);
+ }
+
+ protected override CombineTreeNode CreateNode(Vector3 center, Vector3 size, bool isLeaf)
+ {
+ CombineTreeNode combineTreeNode = new CombineTreeNode(this, center, size, isLeaf);
+ combineTreeNode.onStaticCombinedObjectCreated += this.onStaticCombinedObjectCreated;
+ combineTreeNode.onDynamicCombinedObjectCreated += this.onDynamicCombinedObjectCreated;
+ combineTreeNode.onCombinedLODGroupCreated += this.onCombinedLODGroupCreated;
+ return combineTreeNode;
+ }
+
+ protected override CombineTreeNode ExpandRoot(CombineTreeNode root, ICombineSource target)
+ {
+ Bounds bounds = root.Bounds;
+ Bounds bounds2 = target.Bounds;
+ Vector3 center = Vector3.zero;
+ Vector3 size = Vector3.zero;
+ Vector3 center2 = Vector3.zero;
+ bool flag = false;
+ for (int i = 0; i < 3; i++)
+ {
+ if (bounds2.min[i] < bounds.min[i])
+ {
+ size = bounds.size;
+ size[i] *= 2f;
+ center = bounds.center;
+ center[i] -= bounds.size[i] / 2f;
+ center2 = bounds.center;
+ center2[i] -= bounds.size[i];
+ break;
+ }
+ if (bounds2.max[i] > bounds.max[i])
+ {
+ size = bounds.size;
+ size[i] *= 2f;
+ center = bounds.center;
+ center[i] += bounds.size[i] / 2f;
+ center2 = bounds.center;
+ center2[i] += bounds.size[i];
+ flag = true;
+ break;
+ }
+ }
+ CombineTreeNode combineTreeNode = CreateNode(center, size, isLeaf: false);
+ CombineTreeNode combineTreeNode2 = CreateNode(center2, bounds.size, root.IsLeaf);
+ if (flag)
+ {
+ combineTreeNode.SetChilds(base.RootInternal, combineTreeNode2);
+ }
+ else
+ {
+ combineTreeNode.SetChilds(combineTreeNode2, base.RootInternal);
+ }
+ return combineTreeNode;
+ }
+
+ protected override bool Includes(CombineTreeNode node, ICombineSource source)
+ {
+ Bounds bounds = node.Bounds;
+ Bounds bounds2 = source.Bounds;
+ return bounds.Contains(bounds2);
+ }
+
+ protected override bool Intersects(CombineTreeNode node, ICombineSource source)
+ {
+ return node.Bounds.Contains(source.Position);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineTreeNode.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineTreeNode.cs
new file mode 100644
index 0000000..ca4c318
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombineTreeNode.cs
@@ -0,0 +1,45 @@
+using System;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class CombineTreeNode : BinaryTreeNode<ICombineSource>
+{
+ private CombineTree _tree;
+
+ private UniversalObjectsCombiner _combiner;
+
+ public event Action<CombinedObject> onStaticCombinedObjectCreated;
+
+ public event Action<DynamicCombinedObject> onDynamicCombinedObjectCreated;
+
+ public event Action<CombinedLODGroup> onCombinedLODGroupCreated;
+
+ public CombineTreeNode(CombineTree tree, Vector3 center, Vector3 size, bool isLeaf)
+ : base(center, size, isLeaf)
+ {
+ _tree = tree;
+ }
+
+ public override void Add(ICombineSource source)
+ {
+ if (_combiner == null)
+ {
+ _combiner = new UniversalObjectsCombiner(_tree.CombinedMeshFactory, _tree.VertexLimit);
+ _combiner.onStaticCombinedObjectCreated += this.onStaticCombinedObjectCreated;
+ _combiner.onDynamicCombinedObjectCreated += this.onDynamicCombinedObjectCreated;
+ _combiner.onCombinedLODGroupCreated += this.onCombinedLODGroupCreated;
+ }
+ _combiner.AddSource(source);
+ }
+
+ public override void Remove(ICombineSource source)
+ {
+ _combiner.RemoveSource(source);
+ }
+
+ public void Combine()
+ {
+ _combiner?.Combine();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedLODGroup.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedLODGroup.cs
new file mode 100644
index 0000000..e5f2a93
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedLODGroup.cs
@@ -0,0 +1,265 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class CombinedLODGroup : MonoBehaviour, ICombinedObject<CombinedLODGroupPart, LODGroupCombineSource>, ICombinedObject
+{
+ private class LevelOfDetailCombiner : StaticObjectsCombiner
+ {
+ private Transform _transform;
+
+ private CombinedLODGroup _group;
+
+ private Renderer[] _renderers;
+
+ private int _level;
+
+ public LevelOfDetailCombiner(int level, CombinedLODGroup group, ICombinedMeshFactory factory, int vertexLimit)
+ : base(factory, vertexLimit)
+ {
+ _level = level;
+ _group = group;
+ _transform = new GameObject("LOD" + _level).transform;
+ _transform.parent = group.transform;
+ _transform.localPosition = Vector3.zero;
+ }
+
+ public Renderer[] GetRenderers()
+ {
+ if (_renderers == null || _renderers.Length != base.CombinedObjects.Count)
+ {
+ UpdateRenderersList();
+ }
+ return _renderers;
+ }
+
+ public Bounds CalculateBounds()
+ {
+ Bounds result = new Bounds(_group.transform.position, Vector3.zero);
+ GetRenderers();
+ for (int i = 0; i < _renderers.Length; i++)
+ {
+ if (base.CombinedObjects[i].Parts.Count > 0)
+ {
+ result.Encapsulate(_renderers[i].bounds);
+ }
+ }
+ return result;
+ }
+
+ protected override CombinedObject CreateCombinedObject(CombineSource source)
+ {
+ CombinedObject combinedObject = base.CreateCombinedObject(source);
+ combinedObject.transform.parent = _transform;
+ _group._updateLODs = true;
+ return combinedObject;
+ }
+
+ private void UpdateRenderersList()
+ {
+ _renderers = base.CombinedObjects.Select((CombinedObject r) => r.GetComponent<Renderer>()).ToArray();
+ }
+ }
+
+ private LODGroup _group;
+
+ private List<CombinedLODGroupPart> _parts;
+
+ private LevelOfDetailCombiner[] _levelCombiners;
+
+ private LOD[] _lods;
+
+ private Bounds _localBounds;
+
+ private int _lodCount;
+
+ private LODGroupSettings _originalSettings;
+
+ private float _originalBoundsSize;
+
+ private bool _updateLODs;
+
+ IReadOnlyList<ICombinedObjectPart> ICombinedObject.Parts => _parts;
+
+ public IReadOnlyList<CombinedLODGroupPart> Parts => _parts;
+
+ public LODGroupSettings Settings => _originalSettings;
+
+ public Bounds Bounds
+ {
+ get
+ {
+ Bounds localBounds = _localBounds;
+ localBounds.center += base.transform.position;
+ return localBounds;
+ }
+ }
+
+ public static CombinedLODGroup Create(MeshType meshType, CombineMethod combineMethod, LODGroupSettings settings, int vertexLimit = 45000)
+ {
+ return Create(new CombinedMeshFactory(meshType, combineMethod), settings, vertexLimit);
+ }
+
+ public static CombinedLODGroup Create(ICombinedMeshFactory factory, LODGroupSettings settings, int vertexLimit = 45000)
+ {
+ CombinedLODGroup combinedLODGroup = new GameObject("CombinedLODGroup").AddComponent<CombinedLODGroup>();
+ combinedLODGroup.Construct(settings, factory, vertexLimit);
+ return combinedLODGroup;
+ }
+
+ private void Construct(LODGroupSettings settings, ICombinedMeshFactory factory, int vertexLimit)
+ {
+ if (factory == null)
+ {
+ throw new ArgumentException("CombinedLODGroup::factory is null");
+ }
+ _group = base.gameObject.AddComponent<LODGroup>();
+ _parts = new List<CombinedLODGroupPart>();
+ _group.fadeMode = settings.fadeMode;
+ _group.animateCrossFading = settings.animateCrossFading;
+ _originalSettings = settings;
+ _lodCount = _originalSettings.lodCount;
+ _levelCombiners = new LevelOfDetailCombiner[_lodCount];
+ _lods = new LOD[_originalSettings.lodCount];
+ for (int i = 0; i < _originalSettings.lodCount; i++)
+ {
+ _levelCombiners[i] = new LevelOfDetailCombiner(i, this, factory, vertexLimit);
+ _lods[i] = new LOD
+ {
+ fadeTransitionWidth = _originalSettings.fadeTransitionsWidth[i],
+ screenRelativeTransitionHeight = _originalSettings.screenTransitionsHeight[i],
+ renderers = null
+ };
+ }
+ }
+
+ public void Combine(IEnumerable<ICombineSource> sources)
+ {
+ Combine(sources.Select((ICombineSource s) => (LODGroupCombineSource)s));
+ }
+
+ public void Combine(IEnumerable<LODGroupCombineSource> sourceGroups)
+ {
+ if (sourceGroups == null || sourceGroups.Count() == 0)
+ {
+ throw new ArgumentException("CombinedLODGroup::sources is null");
+ }
+ LODGroupCombineSource[] array = sourceGroups.ToArray();
+ if (_parts.Count == 0)
+ {
+ InitBeforeFirstCombine(array);
+ }
+ List<CombinedObjectPart>[] combinedParts = FillCombinersAndCreateBaseParts(array);
+ for (int i = 0; i < _lodCount; i++)
+ {
+ _levelCombiners[i].Combine();
+ }
+ RecalculateBounds();
+ if (_updateLODs)
+ {
+ UpdateLODs();
+ _updateLODs = false;
+ }
+ CreatePartsAndNotifySources(array, combinedParts);
+ }
+
+ public void Destroy(CombinedLODGroupPart part, IList<CombinedObjectPart> baseParts)
+ {
+ if (_parts.Remove(part))
+ {
+ for (int i = 0; i < baseParts.Count; i++)
+ {
+ baseParts[i].Destroy();
+ }
+ RecalculateBounds();
+ }
+ }
+
+ private void InitBeforeFirstCombine(LODGroupCombineSource[] sources)
+ {
+ Vector3 zero = Vector3.zero;
+ for (int i = 0; i < sources.Length; i++)
+ {
+ zero += sources[i].Position;
+ }
+ base.transform.position = zero / sources.Length;
+ _originalBoundsSize = sources[0].Bounds.size.magnitude;
+ }
+
+ private List<CombinedObjectPart>[] FillCombinersAndCreateBaseParts(LODGroupCombineSource[] sourceGroups)
+ {
+ List<CombinedObjectPart>[] parts = new List<CombinedObjectPart>[sourceGroups.Length];
+ for (int i = 0; i < sourceGroups.Length; i++)
+ {
+ LODGroupCombineSource sourceGroup = sourceGroups[i];
+ parts[i] = new List<CombinedObjectPart>();
+ for (int j = 0; j < _lodCount; j++)
+ {
+ CombineSource[] array = sourceGroup.BaseSources[j];
+ foreach (CombineSource obj in array)
+ {
+ int g = i;
+ obj.onCombinedTyped += delegate(CombinedObject o, CombinedObjectPart p)
+ {
+ parts[g].Add(p);
+ };
+ obj.onCombineErrorTyped += delegate(CombinedObject root, string msg)
+ {
+ sourceGroup.CombineError(this, msg);
+ };
+ }
+ _levelCombiners[j].AddSources(array);
+ }
+ }
+ return parts;
+ }
+
+ private void RecalculateBounds()
+ {
+ _localBounds = new Bounds(base.transform.position, Vector3.zero);
+ for (int i = 0; i < _levelCombiners.Length; i++)
+ {
+ _localBounds.Encapsulate(_levelCombiners[i].CalculateBounds());
+ }
+ _localBounds.center -= base.transform.position;
+ }
+
+ private void UpdateLODs()
+ {
+ float value = _localBounds.size.magnitude / _originalBoundsSize;
+ float num = 1f;
+ value = Mathf.Clamp(value, 1f, 100f);
+ for (int i = 0; i < _lodCount; i++)
+ {
+ LOD lOD = _lods[i];
+ lOD.renderers = _levelCombiners[i].GetRenderers();
+ lOD.screenRelativeTransitionHeight = _originalSettings.screenTransitionsHeight[i] * value;
+ if (lOD.screenRelativeTransitionHeight >= num)
+ {
+ num = (lOD.screenRelativeTransitionHeight = num - 0.03f);
+ }
+ _lods[i] = lOD;
+ }
+ _group.SetLODs(_lods);
+ }
+
+ private void CreatePartsAndNotifySources(LODGroupCombineSource[] sourceGroups, List<CombinedObjectPart>[] combinedParts)
+ {
+ for (int i = 0; i < sourceGroups.Length; i++)
+ {
+ LODGroupCombineSource lODGroupCombineSource = sourceGroups[i];
+ List<CombinedObjectPart> list = combinedParts[i];
+ if (list.Count == 0)
+ {
+ lODGroupCombineSource.CombineFailed(this);
+ continue;
+ }
+ CombinedLODGroupPart combinedLODGroupPart = new CombinedLODGroupPart(this, list);
+ _parts.Add(combinedLODGroupPart);
+ lODGroupCombineSource.Combined(this, combinedLODGroupPart);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedLODGroupMatcher.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedLODGroupMatcher.cs
new file mode 100644
index 0000000..ef1b3c7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedLODGroupMatcher.cs
@@ -0,0 +1,20 @@
+namespace NGS.MeshFusionPro;
+
+public class CombinedLODGroupMatcher : CombinedObjectMatcher<CombinedLODGroup, LODGroupCombineSource>
+{
+ private LODGroupSettings _settings;
+
+ public override void StartMatching(CombinedLODGroup combinedObject)
+ {
+ _settings = combinedObject.Settings;
+ }
+
+ public override bool CanAddSource(LODGroupCombineSource source)
+ {
+ return source.Settings.IsEqual(_settings, 0.01f, 0.01f);
+ }
+
+ public override void SourceAdded(LODGroupCombineSource source)
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedLODGroupPart.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedLODGroupPart.cs
new file mode 100644
index 0000000..95c9c00
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedLODGroupPart.cs
@@ -0,0 +1,49 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class CombinedLODGroupPart : ICombinedObjectPart<CombinedLODGroup>, ICombinedObjectPart
+{
+ private List<CombinedObjectPart> _baseParts;
+
+ private Bounds _localBounds;
+
+ ICombinedObject ICombinedObjectPart.Root => Root;
+
+ public CombinedLODGroup Root { get; private set; }
+
+ public Bounds LocalBounds => _localBounds;
+
+ public Bounds Bounds
+ {
+ get
+ {
+ Bounds localBounds = _localBounds;
+ localBounds.center += Root.transform.position;
+ return localBounds;
+ }
+ }
+
+ public CombinedLODGroupPart(CombinedLODGroup root, List<CombinedObjectPart> baseParts)
+ {
+ Root = root;
+ _baseParts = baseParts;
+ CalculateLocalBounds();
+ }
+
+ public void Destroy()
+ {
+ Root.Destroy(this, _baseParts);
+ }
+
+ private void CalculateLocalBounds()
+ {
+ _localBounds = _baseParts[0].Bounds;
+ for (int i = 1; i < _baseParts.Count; i++)
+ {
+ _localBounds.Encapsulate(_baseParts[i].Bounds);
+ }
+ _localBounds.center -= Root.transform.position;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMesh.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMesh.cs
new file mode 100644
index 0000000..fd9933b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMesh.cs
@@ -0,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class CombinedMesh : IDisposable
+{
+ private Mesh _mesh;
+
+ private CombinedMeshDataInternal _meshData;
+
+ private IMeshCombiner _combiner;
+
+ private IMeshCutter _cutter;
+
+ public Mesh Mesh => _mesh;
+
+ public CombinedMeshData MeshData => _meshData;
+
+ public CombinedMesh(IMeshCombiner combiner, IMeshCutter cutter)
+ {
+ if (combiner == null)
+ {
+ throw new ArgumentNullException("MeshCombiner not assigned");
+ }
+ if (cutter == null)
+ {
+ throw new ArgumentNullException("MeshCutter not assigned");
+ }
+ _mesh = new Mesh();
+ _mesh.MarkDynamic();
+ _combiner = combiner;
+ _cutter = cutter;
+ _meshData = CreateMeshData();
+ _meshData.Initialize(this);
+ }
+
+ public CombinedMeshPart[] Combine(IList<MeshCombineInfo> infos)
+ {
+ _combiner.Combine(_mesh, infos);
+ return _meshData.CreateParts(infos);
+ }
+
+ public void Cut(IList<CombinedMeshPart> parts)
+ {
+ MeshCuttingInfo[] array = new MeshCuttingInfo[parts.Count];
+ for (int i = 0; i < parts.Count; i++)
+ {
+ CombinedMeshPart combinedMeshPart = parts[i];
+ array[i] = new MeshCuttingInfo
+ {
+ vertexStart = combinedMeshPart.VertexStart,
+ vertexCount = combinedMeshPart.VertexCount,
+ triangleStart = combinedMeshPart.TrianglesStart,
+ triangleCount = combinedMeshPart.TrianglesCount
+ };
+ }
+ _cutter.Cut(_mesh, array);
+ _meshData.RemoveParts(parts);
+ }
+
+ public void Dispose()
+ {
+ _meshData.Dispose();
+ }
+
+ protected virtual CombinedMeshDataInternal CreateMeshData()
+ {
+ return new CombinedMeshDataInternal();
+ }
+}
+public class CombinedMesh<TCombinedMeshData> : CombinedMesh where TCombinedMeshData : CombinedMeshDataInternal, new()
+{
+ public TCombinedMeshData MeshDataInternal => (TCombinedMeshData)base.MeshData;
+
+ public CombinedMesh(IMeshCombiner combiner, IMeshCutter cutter)
+ : base(combiner, cutter)
+ {
+ }
+
+ protected override CombinedMeshDataInternal CreateMeshData()
+ {
+ return new TCombinedMeshData();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshData.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshData.cs
new file mode 100644
index 0000000..06afc2b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshData.cs
@@ -0,0 +1,17 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public abstract class CombinedMeshData
+{
+ public abstract int PartsCount { get; }
+
+ public abstract int VertexCount { get; }
+
+ public abstract Bounds GetBounds();
+
+ public abstract Bounds GetBounds(CombinedMeshPart part);
+
+ public abstract IEnumerable<CombinedMeshPart> GetParts();
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshDataInternal.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshDataInternal.cs
new file mode 100644
index 0000000..c055f95
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshDataInternal.cs
@@ -0,0 +1,124 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class CombinedMeshDataInternal : CombinedMeshData, IDisposable
+{
+ private CombinedMesh _root;
+
+ private List<CombinedMeshPartInternal> _parts;
+
+ private int _vertexCount;
+
+ private int _trianglesCount;
+
+ private List<Bounds> _partsBounds;
+
+ private Bounds _boundingBox;
+
+ public override int PartsCount => _parts.Count;
+
+ public override int VertexCount => _vertexCount;
+
+ protected CombinedMesh Root => _root;
+
+ public void Initialize(CombinedMesh root)
+ {
+ _root = root;
+ _parts = new List<CombinedMeshPartInternal>();
+ OnInitialized();
+ }
+
+ public override Bounds GetBounds()
+ {
+ return _boundingBox;
+ }
+
+ public override Bounds GetBounds(CombinedMeshPart part)
+ {
+ return _partsBounds[part.Index];
+ }
+
+ public override IEnumerable<CombinedMeshPart> GetParts()
+ {
+ for (int i = 0; i < _parts.Count; i++)
+ {
+ yield return _parts[i];
+ }
+ }
+
+ public void Dispose()
+ {
+ OnDispose();
+ }
+
+ public CombinedMeshPart[] CreateParts(IList<MeshCombineInfo> infos)
+ {
+ CombinedMeshPart[] array = new CombinedMeshPart[infos.Count];
+ for (int i = 0; i < array.Length; i++)
+ {
+ MeshCombineInfo meshCombineInfo = infos[i];
+ Mesh mesh = meshCombineInfo.mesh;
+ Matrix4x4 transformMatrix = meshCombineInfo.transformMatrix;
+ int vertexCount = _vertexCount;
+ int vertexCount2 = meshCombineInfo.vertexCount;
+ int trianglesCount = _trianglesCount;
+ int trianglesCount2 = meshCombineInfo.trianglesCount;
+ CombinedMeshPartInternal combinedMeshPartInternal = new CombinedMeshPartInternal(_root, _parts.Count, vertexCount, vertexCount2, trianglesCount, trianglesCount2);
+ _parts.Add(combinedMeshPartInternal);
+ array[i] = combinedMeshPartInternal;
+ _vertexCount += vertexCount2;
+ _trianglesCount += trianglesCount2;
+ OnAddPart(combinedMeshPartInternal, mesh, transformMatrix);
+ }
+ OnMeshUpdated();
+ return array;
+ }
+
+ public void RemoveParts(IList<CombinedMeshPart> parts)
+ {
+ for (int i = 0; i < parts.Count; i++)
+ {
+ CombinedMeshPartInternal combinedMeshPartInternal = (CombinedMeshPartInternal)parts[i];
+ OnRemovePart(combinedMeshPartInternal);
+ int num = _parts.IndexOf(combinedMeshPartInternal);
+ int vertexCount = combinedMeshPartInternal.VertexCount;
+ int trianglesCount = combinedMeshPartInternal.TrianglesCount;
+ for (int j = num + 1; j < _parts.Count; j++)
+ {
+ CombinedMeshPartInternal combinedMeshPartInternal2 = _parts[j];
+ combinedMeshPartInternal2.Offset(newVertexStart: combinedMeshPartInternal2.VertexStart - vertexCount, newTrianglesStart: combinedMeshPartInternal2.TrianglesStart - trianglesCount, newIndex: combinedMeshPartInternal2.Index - 1);
+ }
+ _parts.Remove(combinedMeshPartInternal);
+ _vertexCount -= combinedMeshPartInternal.VertexCount;
+ _trianglesCount -= combinedMeshPartInternal.TrianglesCount;
+ }
+ OnMeshUpdated();
+ }
+
+ protected virtual void OnInitialized()
+ {
+ _partsBounds = new List<Bounds>();
+ }
+
+ protected virtual void OnAddPart(CombinedMeshPart part, Mesh mesh, Matrix4x4 transform)
+ {
+ _partsBounds.Add(mesh.bounds.Transform(transform));
+ }
+
+ protected virtual void OnRemovePart(CombinedMeshPart part)
+ {
+ _partsBounds.RemoveAt(part.Index);
+ }
+
+ protected virtual void OnMeshUpdated()
+ {
+ _boundingBox = _root.Mesh.bounds;
+ }
+
+ protected virtual void OnDispose()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshFactory.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshFactory.cs
new file mode 100644
index 0000000..850efd8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshFactory.cs
@@ -0,0 +1,43 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class CombinedMeshFactory : ICombinedMeshFactory
+{
+ private IMeshToolsFactory _tools;
+
+ private IMovableCombinedMeshFactory _movableMeshFactory;
+
+ public CombinedMeshFactory(MeshType meshType, CombineMethod combineMethod, MoveMethod moveMethod = MoveMethod.Simple)
+ {
+ if (meshType == MeshType.Standard)
+ {
+ _tools = new SimpleToolsSTDFactory();
+ if (moveMethod == MoveMethod.Simple)
+ {
+ _movableMeshFactory = new SimpleMovableMeshSTDFactory(_tools);
+ }
+ else
+ {
+ _movableMeshFactory = new JobsMovableMeshSTDFactory(_tools);
+ }
+ return;
+ }
+ _tools = new SimpleToolsLWFactory();
+ if (moveMethod == MoveMethod.Simple)
+ {
+ Debug.Log("Simple mover not implemented yet for lightweight meshes. Jobs mover will be used instead");
+ }
+ _movableMeshFactory = new JobsMovableMeshLWFactory(_tools);
+ }
+
+ public CombinedMesh CreateCombinedMesh()
+ {
+ return new CombinedMesh(_tools.CreateMeshCombiner(), _tools.CreateMeshCutter());
+ }
+
+ public CombinedMesh CreateMovableCombinedMesh(out ICombinedMeshMover mover)
+ {
+ return _movableMeshFactory.CreateMovableMesh(out mover);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshPart.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshPart.cs
new file mode 100644
index 0000000..9034a26
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshPart.cs
@@ -0,0 +1,26 @@
+namespace NGS.MeshFusionPro;
+
+public class CombinedMeshPart
+{
+ public CombinedMesh Root { get; private set; }
+
+ public int Index { get; protected set; }
+
+ public int VertexStart { get; protected set; }
+
+ public int VertexCount { get; protected set; }
+
+ public int TrianglesStart { get; protected set; }
+
+ public int TrianglesCount { get; protected set; }
+
+ public CombinedMeshPart(CombinedMesh root, int index, int vertexStart, int vertexCount, int trianglesStart, int trianglesCount)
+ {
+ Root = root;
+ Index = index;
+ VertexStart = vertexStart;
+ VertexCount = vertexCount;
+ TrianglesStart = trianglesStart;
+ TrianglesCount = trianglesCount;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshPartInternal.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshPartInternal.cs
new file mode 100644
index 0000000..9bc07cd
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedMeshPartInternal.cs
@@ -0,0 +1,16 @@
+namespace NGS.MeshFusionPro;
+
+public class CombinedMeshPartInternal : CombinedMeshPart
+{
+ public CombinedMeshPartInternal(CombinedMesh root, int index, int vertexStart, int vertexCount, int trianglesStart, int trianglesCount)
+ : base(root, index, vertexStart, vertexCount, trianglesStart, trianglesCount)
+ {
+ }
+
+ public void Offset(int newIndex, int newVertexStart, int newTrianglesStart)
+ {
+ base.Index = newIndex;
+ base.VertexStart = newVertexStart;
+ base.TrianglesStart = newTrianglesStart;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedObject.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedObject.cs
new file mode 100644
index 0000000..5a7bc43
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedObject.cs
@@ -0,0 +1,209 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class CombinedObject : MonoBehaviour, ICombinedObject<CombinedObjectPart, CombineSource>, ICombinedObject
+{
+ private CombinedMesh _combinedMesh;
+
+ private CombinedMeshDataInternal _meshData;
+
+ private List<CombinedObjectPart> _parts;
+
+ private List<CombinedMeshPart> _destroyedMeshParts;
+
+ private RendererSettings _rendererSettings;
+
+ private bool _updating;
+
+ IReadOnlyList<ICombinedObjectPart> ICombinedObject.Parts => _parts;
+
+ public IReadOnlyList<CombinedObjectPart> Parts => _parts;
+
+ public RendererSettings RendererSettings => _rendererSettings;
+
+ public Bounds Bounds
+ {
+ get
+ {
+ Bounds localBounds = LocalBounds;
+ localBounds.center += base.transform.position;
+ return localBounds;
+ }
+ }
+
+ public Bounds LocalBounds => _combinedMesh.MeshData.GetBounds();
+
+ public int VertexCount => _combinedMesh.MeshData.VertexCount;
+
+ public bool Updating
+ {
+ get
+ {
+ return _updating;
+ }
+ set
+ {
+ _updating = value;
+ base.enabled = value;
+ }
+ }
+
+ private void Update()
+ {
+ if (!Updating)
+ {
+ base.enabled = false;
+ return;
+ }
+ ForceUpdate();
+ base.enabled = false;
+ }
+
+ private void OnDestroy()
+ {
+ _combinedMesh.Dispose();
+ }
+
+ public static CombinedObject Create(MeshType meshType, CombineMethod combineType, RendererSettings settings)
+ {
+ return Create(new CombinedMeshFactory(meshType, combineType), settings);
+ }
+
+ public static CombinedObject Create(ICombinedMeshFactory factory, RendererSettings settings)
+ {
+ return Create(factory.CreateCombinedMesh(), settings);
+ }
+
+ public static CombinedObject Create(CombinedMesh combinedMesh, RendererSettings settings)
+ {
+ CombinedObject combinedObject = new GameObject("Combined Object").AddComponent<CombinedObject>();
+ combinedObject.Construct(combinedMesh, settings);
+ return combinedObject;
+ }
+
+ private void Construct(CombinedMesh combinedMesh, RendererSettings settings)
+ {
+ _combinedMesh = combinedMesh;
+ _meshData = (CombinedMeshDataInternal)_combinedMesh.MeshData;
+ _parts = new List<CombinedObjectPart>();
+ _destroyedMeshParts = new List<CombinedMeshPart>();
+ _rendererSettings = settings;
+ _updating = true;
+ if (combinedMesh.MeshData.PartsCount > 0)
+ {
+ foreach (CombinedMeshPart part in combinedMesh.MeshData.GetParts())
+ {
+ _parts.Add(new CombinedObjectPart(this, part));
+ }
+ }
+ CreateMeshFilter(_combinedMesh.Mesh);
+ CreateMeshRenderer(settings);
+ }
+
+ public void ForceUpdate()
+ {
+ if (_destroyedMeshParts.Count > 0)
+ {
+ _combinedMesh.Cut(_destroyedMeshParts);
+ _destroyedMeshParts.Clear();
+ }
+ }
+
+ public Bounds GetLocalBounds(CombinedObjectPart part)
+ {
+ return _meshData.GetBounds(part.MeshPart);
+ }
+
+ public Bounds GetBounds(CombinedObjectPart part)
+ {
+ Bounds localBounds = GetLocalBounds(part);
+ localBounds.center += base.transform.position;
+ return localBounds;
+ }
+
+ public void Combine(IEnumerable<ICombineSource> sources)
+ {
+ Combine(sources.Select((ICombineSource s) => (CombineSource)s));
+ }
+
+ public void Combine(IEnumerable<CombineSource> sources)
+ {
+ if (_parts.Count == 0)
+ {
+ base.transform.position = GetAveragePosition(sources);
+ }
+ Vector3 position = base.transform.position;
+ int num = sources.Count();
+ int num2 = 0;
+ MeshCombineInfo[] array = new MeshCombineInfo[num];
+ foreach (CombineSource source in sources)
+ {
+ MeshCombineInfo combineInfo = source.CombineInfo;
+ combineInfo.transformMatrix = combineInfo.transformMatrix.SetTranslation(source.Position - position);
+ array[num2++] = combineInfo;
+ }
+ try
+ {
+ CombinedMeshPart[] array2 = _combinedMesh.Combine(array);
+ num2 = 0;
+ foreach (CombineSource source2 in sources)
+ {
+ CombinedObjectPart combinedObjectPart = new CombinedObjectPart(this, array2[num2]);
+ _parts.Add(combinedObjectPart);
+ source2.Combined(this, combinedObjectPart);
+ num2++;
+ }
+ }
+ catch (Exception ex)
+ {
+ string errorMessage = ex.Message + ex.StackTrace;
+ foreach (CombineSource source3 in sources)
+ {
+ source3.CombineError(this, errorMessage);
+ source3.CombineFailed(this);
+ }
+ }
+ }
+
+ public void Destroy(CombinedObjectPart part)
+ {
+ if (_parts.Remove(part))
+ {
+ _destroyedMeshParts.Add(part.MeshPart);
+ base.enabled = true;
+ }
+ }
+
+ private void CreateMeshFilter(Mesh mesh)
+ {
+ base.gameObject.AddComponent<MeshFilter>().sharedMesh = mesh;
+ }
+
+ private void CreateMeshRenderer(RendererSettings settings)
+ {
+ MeshRenderer meshRenderer = base.gameObject.AddComponent<MeshRenderer>();
+ meshRenderer.sharedMaterial = settings.material;
+ meshRenderer.shadowCastingMode = settings.shadowMode;
+ meshRenderer.receiveShadows = settings.receiveShadows;
+ meshRenderer.lightmapIndex = settings.lightmapIndex;
+ meshRenderer.realtimeLightmapIndex = settings.realtimeLightmapIndex;
+ meshRenderer.tag = settings.tag;
+ meshRenderer.gameObject.layer = settings.layer;
+ }
+
+ private Vector3 GetAveragePosition(IEnumerable<CombineSource> sources)
+ {
+ Vector3 zero = Vector3.zero;
+ int num = 0;
+ foreach (CombineSource source in sources)
+ {
+ zero += source.Position;
+ num++;
+ }
+ return zero / num;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedObjectMatcher.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedObjectMatcher.cs
new file mode 100644
index 0000000..57e39b7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedObjectMatcher.cs
@@ -0,0 +1,10 @@
+namespace NGS.MeshFusionPro;
+
+public abstract class CombinedObjectMatcher<TCombinedObject, TCombineSource> where TCombinedObject : ICombinedObject where TCombineSource : ICombineSource
+{
+ public abstract void StartMatching(TCombinedObject combinedObject);
+
+ public abstract bool CanAddSource(TCombineSource source);
+
+ public abstract void SourceAdded(TCombineSource source);
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedObjectPart.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedObjectPart.cs
new file mode 100644
index 0000000..ca434ff
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/CombinedObjectPart.cs
@@ -0,0 +1,35 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class CombinedObjectPart : ICombinedObjectPart<CombinedObject>, ICombinedObjectPart
+{
+ private bool _destroyed;
+
+ ICombinedObject ICombinedObjectPart.Root => Root;
+
+ public CombinedObject Root { get; private set; }
+
+ public CombinedMeshPart MeshPart { get; private set; }
+
+ public Bounds LocalBounds => Root.GetLocalBounds(this);
+
+ public Bounds Bounds => Root.GetBounds(this);
+
+ public CombinedObjectPart(CombinedObject root, CombinedMeshPart meshPart)
+ {
+ Root = root;
+ MeshPart = meshPart;
+ }
+
+ public void Destroy()
+ {
+ if (_destroyed)
+ {
+ Debug.Log("CombinedPart already destroyed");
+ return;
+ }
+ Root.Destroy(this);
+ _destroyed = true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombineSource.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombineSource.cs
new file mode 100644
index 0000000..dcbf244
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombineSource.cs
@@ -0,0 +1,70 @@
+using System;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class DynamicCombineSource : ICombineSource<DynamicCombinedObject, DynamicCombinedObjectPart>, ICombineSource
+{
+ private CombineSource _base;
+
+ public CombineSource Base => _base;
+
+ public Vector3 Position => _base.Position;
+
+ public Bounds Bounds => _base.Bounds;
+
+ public event Action<ICombinedObject, ICombinedObjectPart> onCombined;
+
+ public event Action<ICombinedObject, string> onCombineError;
+
+ public event Action<ICombinedObject> onCombineFailed;
+
+ public event Action<DynamicCombinedObject, DynamicCombinedObjectPart> onCombinedTyped;
+
+ public event Action<DynamicCombinedObject, string> onCombineErrorTyped;
+
+ public event Action<DynamicCombinedObject> onCombineFailedTyped;
+
+ public DynamicCombineSource(GameObject go, int submeshIndex = 0)
+ {
+ _base = new CombineSource(go, submeshIndex);
+ }
+
+ public DynamicCombineSource(Mesh mesh, MeshRenderer renderer, int submeshIndex = 0)
+ {
+ _base = new CombineSource(mesh, renderer, submeshIndex);
+ }
+
+ public DynamicCombineSource(MeshCombineInfo info, RendererSettings settings)
+ {
+ _base = new CombineSource(info, settings);
+ }
+
+ public DynamicCombineSource(MeshCombineInfo info, RendererSettings settings, Bounds bounds)
+ {
+ _base = new CombineSource(info, settings, bounds);
+ }
+
+ public void Combined(DynamicCombinedObject root, DynamicCombinedObjectPart part)
+ {
+ this.onCombined?.Invoke(root, part);
+ this.onCombinedTyped?.Invoke(root, part);
+ }
+
+ public void CombineError(DynamicCombinedObject root, string errorMessage)
+ {
+ if (this.onCombineError == null && this.onCombineErrorTyped == null)
+ {
+ Debug.Log("Error during combine " + root.name + ", reason :" + errorMessage);
+ return;
+ }
+ this.onCombineError?.Invoke(root, errorMessage);
+ this.onCombineErrorTyped?.Invoke(root, errorMessage);
+ }
+
+ public void CombineFailed(DynamicCombinedObject root)
+ {
+ this.onCombineFailed?.Invoke(root);
+ this.onCombineFailedTyped?.Invoke(root);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObject.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObject.cs
new file mode 100644
index 0000000..464bee8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObject.cs
@@ -0,0 +1,155 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class DynamicCombinedObject : MonoBehaviour, ICombinedObject<DynamicCombinedObjectPart, DynamicCombineSource>, ICombinedObject
+{
+ private CombinedObject _baseObject;
+
+ private List<DynamicCombinedObjectPart> _parts;
+
+ private ICombinedMeshMover _meshMover;
+
+ private List<DynamicCombinedObjectPartInternal> _movedParts;
+
+ private List<PartMoveInfo> _movedPartsData;
+
+ private bool _partsMoved;
+
+ IReadOnlyList<ICombinedObjectPart> ICombinedObject.Parts => _parts;
+
+ public IReadOnlyList<DynamicCombinedObjectPart> Parts => _parts;
+
+ public RendererSettings RendererSettings => _baseObject.RendererSettings;
+
+ public Bounds Bounds => _baseObject.Bounds;
+
+ public Bounds LocalBounds => _baseObject.LocalBounds;
+
+ public int VertexCount => _baseObject.VertexCount;
+
+ private void Update()
+ {
+ if (_movedParts.Count > 0)
+ {
+ if (_meshMover is IAsyncCombinedMeshMover asyncCombinedMeshMover)
+ {
+ asyncCombinedMeshMover.MovePartsAsync(_movedPartsData);
+ }
+ else
+ {
+ _meshMover.MoveParts(_movedPartsData);
+ }
+ for (int i = 0; i < _movedParts.Count; i++)
+ {
+ _movedParts[i].PositionUpdated();
+ }
+ _movedParts.Clear();
+ _movedPartsData.Clear();
+ _partsMoved = true;
+ }
+ }
+
+ private void LateUpdate()
+ {
+ if (_partsMoved)
+ {
+ if (_meshMover is IAsyncCombinedMeshMover asyncCombinedMeshMover)
+ {
+ asyncCombinedMeshMover.FinishAsyncMoving();
+ }
+ _meshMover.ApplyData();
+ _partsMoved = false;
+ }
+ _baseObject.ForceUpdate();
+ if (_movedParts.Count == 0)
+ {
+ base.enabled = false;
+ }
+ }
+
+ private void OnDestroy()
+ {
+ if (_meshMover is IDisposable disposable)
+ {
+ disposable.Dispose();
+ }
+ }
+
+ public static DynamicCombinedObject Create(MeshType meshType, CombineMethod combineMethod, MoveMethod moveMethod, RendererSettings settings)
+ {
+ return Create(new CombinedMeshFactory(meshType, combineMethod, moveMethod), settings);
+ }
+
+ public static DynamicCombinedObject Create(ICombinedMeshFactory factory, RendererSettings settings)
+ {
+ ICombinedMeshMover mover;
+ CombinedObject combinedObject = CombinedObject.Create(factory.CreateMovableCombinedMesh(out mover), settings);
+ DynamicCombinedObject dynamicCombinedObject = combinedObject.gameObject.AddComponent<DynamicCombinedObject>();
+ dynamicCombinedObject.Construct(combinedObject, mover);
+ return dynamicCombinedObject;
+ }
+
+ private void Construct(CombinedObject baseObject, ICombinedMeshMover mover)
+ {
+ base.gameObject.name = "Dynamic Combined Object";
+ _baseObject = baseObject;
+ _meshMover = mover;
+ _parts = new List<DynamicCombinedObjectPart>();
+ _movedParts = new List<DynamicCombinedObjectPartInternal>();
+ _movedPartsData = new List<PartMoveInfo>();
+ _baseObject.Updating = false;
+ }
+
+ public void Combine(IEnumerable<ICombineSource> sources)
+ {
+ Combine(sources.Select((ICombineSource s) => (DynamicCombineSource)s));
+ }
+
+ public void Combine(IEnumerable<DynamicCombineSource> sources)
+ {
+ int num = sources.Count();
+ CombineSource[] array = new CombineSource[num];
+ _ = new DynamicCombinedObjectPart[num];
+ int num2 = 0;
+ foreach (DynamicCombineSource source in sources)
+ {
+ CombineSource baseSource = source.Base;
+ array[num2++] = baseSource;
+ baseSource.onCombinedTyped += delegate(CombinedObject root, CombinedObjectPart part)
+ {
+ DynamicCombinedObjectPart dynamicCombinedObjectPart = new DynamicCombinedObjectPartInternal(this, part, baseSource.CombineInfo.transformMatrix);
+ _parts.Add(dynamicCombinedObjectPart);
+ source.Combined(this, dynamicCombinedObjectPart);
+ };
+ baseSource.onCombineErrorTyped += delegate(CombinedObject root, string message)
+ {
+ source.CombineError(this, message);
+ };
+ baseSource.onCombineFailedTyped += delegate
+ {
+ source.CombineFailed(this);
+ };
+ }
+ _baseObject.Combine(array);
+ }
+
+ public void UpdatePart(DynamicCombinedObjectPartInternal part)
+ {
+ _movedParts.Add(part);
+ _movedPartsData.Add(part.CreateMoveInfo());
+ base.enabled = true;
+ }
+
+ public void Destroy(DynamicCombinedObjectPart dynamicPart, CombinedObjectPart basePart)
+ {
+ if (_parts.Remove(dynamicPart))
+ {
+ basePart.Destroy();
+ base.enabled = true;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObjectMatcher.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObjectMatcher.cs
new file mode 100644
index 0000000..cf76052
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObjectMatcher.cs
@@ -0,0 +1,39 @@
+namespace NGS.MeshFusionPro;
+
+public class DynamicCombinedObjectMatcher : CombinedObjectMatcher<DynamicCombinedObject, DynamicCombineSource>
+{
+ private RendererSettings _settings;
+
+ private int _vertexCount;
+
+ private int _vertexLimit;
+
+ public DynamicCombinedObjectMatcher(int vertexLimit)
+ {
+ _vertexLimit = vertexLimit;
+ }
+
+ public override void StartMatching(DynamicCombinedObject combinedObject)
+ {
+ _settings = combinedObject.RendererSettings;
+ _vertexCount = combinedObject.VertexCount;
+ }
+
+ public override bool CanAddSource(DynamicCombineSource source)
+ {
+ if (!_settings.Equals(source.Base.RendererSettings))
+ {
+ return false;
+ }
+ if (_vertexCount + source.Base.CombineInfo.vertexCount > _vertexLimit)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public override void SourceAdded(DynamicCombineSource source)
+ {
+ _vertexCount += source.Base.CombineInfo.vertexCount;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObjectPart.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObjectPart.cs
new file mode 100644
index 0000000..c2ff95d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObjectPart.cs
@@ -0,0 +1,44 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public abstract class DynamicCombinedObjectPart : ICombinedObjectPart<DynamicCombinedObject>, ICombinedObjectPart
+{
+ protected DynamicCombinedObject _root;
+
+ protected CombinedObjectPart _basePart;
+
+ private bool _destroyed;
+
+ ICombinedObject ICombinedObjectPart.Root => Root;
+
+ public DynamicCombinedObject Root => _root;
+
+ public Bounds LocalBounds => _basePart.LocalBounds;
+
+ public Bounds Bounds => _basePart.Bounds;
+
+ public DynamicCombinedObjectPart(DynamicCombinedObject root, CombinedObjectPart basePart, Matrix4x4 transformMatrix)
+ {
+ _root = root;
+ _basePart = basePart;
+ }
+
+ public abstract void Move(Vector3 position, Quaternion rotation, Vector3 scale);
+
+ public abstract void Move(Matrix4x4 transform);
+
+ public abstract void MoveLocal(Matrix4x4 localTransform);
+
+ public void Destroy()
+ {
+ if (_destroyed)
+ {
+ Debug.Log("Part already destroyed");
+ }
+ else
+ {
+ _root.Destroy(this, _basePart);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObjectPartInternal.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObjectPartInternal.cs
new file mode 100644
index 0000000..d7a0c1c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicCombinedObjectPartInternal.cs
@@ -0,0 +1,61 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class DynamicCombinedObjectPartInternal : DynamicCombinedObjectPart
+{
+ private Matrix4x4 _localTransform;
+
+ private Matrix4x4 _targetLocalTransform;
+
+ private Matrix4x4 _worldToLocalMatrix;
+
+ private bool _inMove;
+
+ public DynamicCombinedObjectPartInternal(DynamicCombinedObject root, CombinedObjectPart basePart, Matrix4x4 transformMatrix)
+ : base(root, basePart, transformMatrix)
+ {
+ Vector3 pos = transformMatrix.GetTranslation() - root.transform.position;
+ _localTransform = transformMatrix.SetTranslation(pos);
+ _worldToLocalMatrix = base.Root.transform.worldToLocalMatrix;
+ }
+
+ public override void Move(Vector3 position, Quaternion rotation, Vector3 scale)
+ {
+ Move(Matrix4x4.TRS(position, rotation, scale));
+ }
+
+ public override void Move(Matrix4x4 transform)
+ {
+ Matrix4x4 localTransform = _worldToLocalMatrix * transform;
+ MoveLocal(localTransform);
+ }
+
+ public override void MoveLocal(Matrix4x4 localTransform)
+ {
+ if (!_inMove)
+ {
+ _targetLocalTransform = localTransform;
+ _root.UpdatePart(this);
+ _inMove = true;
+ }
+ }
+
+ public PartMoveInfo CreateMoveInfo()
+ {
+ CombinedMeshPart meshPart = _basePart.MeshPart;
+ PartMoveInfo result = default(PartMoveInfo);
+ result.partIndex = meshPart.Index;
+ result.vertexStart = meshPart.VertexStart;
+ result.vertexCount = meshPart.VertexCount;
+ result.currentTransform = _localTransform;
+ result.targetTransform = _targetLocalTransform;
+ return result;
+ }
+
+ public void PositionUpdated()
+ {
+ _localTransform = _targetLocalTransform;
+ _inMove = false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicMeshFusionSource.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicMeshFusionSource.cs
new file mode 100644
index 0000000..bf92aec
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicMeshFusionSource.cs
@@ -0,0 +1,130 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class DynamicMeshFusionSource : MeshFusionSource
+{
+ [SerializeField]
+ [HideInInspector]
+ private MeshRenderer _renderer;
+
+ [SerializeField]
+ [HideInInspector]
+ private MeshFilter _filter;
+
+ [SerializeField]
+ [HideInInspector]
+ private Mesh _mesh;
+
+ private DynamicCombineSource[] _sources;
+
+ private DynamicCombinedObjectPart[] _parts;
+
+ public override bool TryGetBounds(ref Bounds bounds)
+ {
+ if (_renderer != null)
+ {
+ bounds = _renderer.bounds;
+ return true;
+ }
+ return false;
+ }
+
+ protected override void OnSourceCombinedInternal(ICombinedObject root, ICombinedObjectPart part)
+ {
+ for (int i = 0; i < _parts.Length; i++)
+ {
+ if (_parts[i] == null)
+ {
+ _parts[i] = (DynamicCombinedObjectPart)part;
+ return;
+ }
+ }
+ throw new Exception("Unexpected Behaviour");
+ }
+
+ protected override bool CheckCompatibilityAndGetComponents(out string incompatibilityReason)
+ {
+ incompatibilityReason = "";
+ return CanCreateCombineSource(base.gameObject, ref incompatibilityReason, ref _renderer, ref _filter, ref _mesh);
+ }
+
+ protected override void CreateSources()
+ {
+ if (_sources == null)
+ {
+ _sources = new DynamicCombineSource[_mesh.subMeshCount];
+ }
+ if (_parts == null)
+ {
+ _parts = new DynamicCombinedObjectPart[_mesh.subMeshCount];
+ }
+ for (int i = 0; i < _sources.Length; i++)
+ {
+ _sources[i] = new DynamicCombineSource(_mesh, _renderer, i);
+ }
+ }
+
+ protected override IEnumerable<ICombineSource> GetCombineSources()
+ {
+ if (_sources == null)
+ {
+ yield break;
+ }
+ for (int i = 0; i < _sources.Length; i++)
+ {
+ DynamicCombineSource dynamicCombineSource = _sources[i];
+ if (dynamicCombineSource == null)
+ {
+ break;
+ }
+ yield return dynamicCombineSource;
+ }
+ }
+
+ protected override IEnumerable<ICombinedObjectPart> GetCombinedParts()
+ {
+ if (_parts == null)
+ {
+ yield break;
+ }
+ for (int i = 0; i < _parts.Length; i++)
+ {
+ DynamicCombinedObjectPart dynamicCombinedObjectPart = _parts[i];
+ if (dynamicCombinedObjectPart == null)
+ {
+ break;
+ }
+ yield return dynamicCombinedObjectPart;
+ }
+ }
+
+ protected override void ClearSources()
+ {
+ if (_sources != null)
+ {
+ for (int i = 0; i < _sources.Length && _sources[i] != null; i++)
+ {
+ _sources[i] = null;
+ }
+ }
+ }
+
+ protected override void ClearParts()
+ {
+ if (_parts != null)
+ {
+ for (int i = 0; i < _parts.Length; i++)
+ {
+ _parts[i] = null;
+ }
+ }
+ }
+
+ protected override void ToggleComponents(bool enabled)
+ {
+ _renderer.enabled = enabled;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicObjectsCombiner.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicObjectsCombiner.cs
new file mode 100644
index 0000000..a7d6115
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/DynamicObjectsCombiner.cs
@@ -0,0 +1,42 @@
+using System.Collections.Generic;
+
+namespace NGS.MeshFusionPro;
+
+public class DynamicObjectsCombiner : ObjectsCombiner<DynamicCombinedObject, DynamicCombineSource>
+{
+ private ICombinedMeshFactory _factory;
+
+ private DynamicCombinedObjectMatcher _matcher;
+
+ private int _vertexLimit;
+
+ public DynamicObjectsCombiner(ICombinedMeshFactory factory, int vertexLimit)
+ {
+ _factory = factory;
+ _matcher = new DynamicCombinedObjectMatcher(vertexLimit);
+ _vertexLimit = vertexLimit;
+ }
+
+ public override void AddSource(DynamicCombineSource source)
+ {
+ if (source.Base.CombineInfo.vertexCount < _vertexLimit)
+ {
+ base.AddSource(source);
+ }
+ }
+
+ protected override void CombineSources(DynamicCombinedObject root, IList<DynamicCombineSource> sources)
+ {
+ root.Combine(sources);
+ }
+
+ protected override DynamicCombinedObject CreateCombinedObject(DynamicCombineSource source)
+ {
+ return DynamicCombinedObject.Create(_factory, source.Base.RendererSettings);
+ }
+
+ protected override CombinedObjectMatcher<DynamicCombinedObject, DynamicCombineSource> GetMatcher()
+ {
+ return _matcher;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IAsyncCombinedMeshMover.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IAsyncCombinedMeshMover.cs
new file mode 100644
index 0000000..07f0de8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IAsyncCombinedMeshMover.cs
@@ -0,0 +1,10 @@
+using System.Collections.Generic;
+
+namespace NGS.MeshFusionPro;
+
+public interface IAsyncCombinedMeshMover : ICombinedMeshMover
+{
+ void MovePartsAsync(IList<PartMoveInfo> moveInfos);
+
+ void FinishAsyncMoving();
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IBinaryTreeNode.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IBinaryTreeNode.cs
new file mode 100644
index 0000000..c25beae
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IBinaryTreeNode.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public interface IBinaryTreeNode
+{
+ Vector3 Center { get; }
+
+ Vector3 Size { get; }
+
+ Bounds Bounds { get; }
+
+ bool HasChilds { get; }
+
+ bool IsLeaf { get; }
+
+ IBinaryTreeNode GetLeft();
+
+ IBinaryTreeNode GetRight();
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombineSource.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombineSource.cs
new file mode 100644
index 0000000..2b147b7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombineSource.cs
@@ -0,0 +1,25 @@
+using System;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public interface ICombineSource
+{
+ Vector3 Position { get; }
+
+ Bounds Bounds { get; }
+
+ event Action<ICombinedObject, ICombinedObjectPart> onCombined;
+
+ event Action<ICombinedObject, string> onCombineError;
+
+ event Action<ICombinedObject> onCombineFailed;
+}
+public interface ICombineSource<TCombinedObject, TCombinedPart> : ICombineSource where TCombinedObject : ICombinedObject where TCombinedPart : ICombinedObjectPart
+{
+ event Action<TCombinedObject, TCombinedPart> onCombinedTyped;
+
+ event Action<TCombinedObject, string> onCombineErrorTyped;
+
+ event Action<TCombinedObject> onCombineFailedTyped;
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedMeshFactory.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedMeshFactory.cs
new file mode 100644
index 0000000..98d71f7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedMeshFactory.cs
@@ -0,0 +1,8 @@
+namespace NGS.MeshFusionPro;
+
+public interface ICombinedMeshFactory
+{
+ CombinedMesh CreateCombinedMesh();
+
+ CombinedMesh CreateMovableCombinedMesh(out ICombinedMeshMover mover);
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedMeshMover.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedMeshMover.cs
new file mode 100644
index 0000000..05560a1
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedMeshMover.cs
@@ -0,0 +1,10 @@
+using System.Collections.Generic;
+
+namespace NGS.MeshFusionPro;
+
+public interface ICombinedMeshMover
+{
+ void MoveParts(IList<PartMoveInfo> moveInfos);
+
+ void ApplyData();
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedObject.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedObject.cs
new file mode 100644
index 0000000..5c2bb55
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedObject.cs
@@ -0,0 +1,16 @@
+using System.Collections.Generic;
+
+namespace NGS.MeshFusionPro;
+
+public interface ICombinedObject
+{
+ IReadOnlyList<ICombinedObjectPart> Parts { get; }
+
+ void Combine(IEnumerable<ICombineSource> sources);
+}
+public interface ICombinedObject<TCombinedPart, TCombinedSource> : ICombinedObject where TCombinedPart : ICombinedObjectPart where TCombinedSource : ICombineSource
+{
+ new IReadOnlyList<TCombinedPart> Parts { get; }
+
+ void Combine(IEnumerable<TCombinedSource> sources);
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedObjectPart.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedObjectPart.cs
new file mode 100644
index 0000000..b5a0f08
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ICombinedObjectPart.cs
@@ -0,0 +1,18 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public interface ICombinedObjectPart
+{
+ ICombinedObject Root { get; }
+
+ Bounds Bounds { get; }
+
+ Bounds LocalBounds { get; }
+
+ void Destroy();
+}
+public interface ICombinedObjectPart<TCombinedObject> : ICombinedObjectPart where TCombinedObject : ICombinedObject
+{
+ new TCombinedObject Root { get; }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMeshCombiner.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMeshCombiner.cs
new file mode 100644
index 0000000..ccd84ce
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMeshCombiner.cs
@@ -0,0 +1,9 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public interface IMeshCombiner
+{
+ void Combine(Mesh mesh, IList<MeshCombineInfo> combineInfos);
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMeshCutter.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMeshCutter.cs
new file mode 100644
index 0000000..f9af704
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMeshCutter.cs
@@ -0,0 +1,11 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public interface IMeshCutter
+{
+ void Cut(Mesh mesh, MeshCuttingInfo cuttingInfo);
+
+ void Cut(Mesh mesh, IList<MeshCuttingInfo> cuttingInfos);
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMeshToolsFactory.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMeshToolsFactory.cs
new file mode 100644
index 0000000..2d670e2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMeshToolsFactory.cs
@@ -0,0 +1,8 @@
+namespace NGS.MeshFusionPro;
+
+public interface IMeshToolsFactory
+{
+ IMeshCombiner CreateMeshCombiner();
+
+ IMeshCutter CreateMeshCutter();
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMovableCombinedMeshFactory.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMovableCombinedMeshFactory.cs
new file mode 100644
index 0000000..555d632
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/IMovableCombinedMeshFactory.cs
@@ -0,0 +1,6 @@
+namespace NGS.MeshFusionPro;
+
+public interface IMovableCombinedMeshFactory
+{
+ CombinedMesh CreateMovableMesh(out ICombinedMeshMover mover);
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ISourceTrackingStrategy.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ISourceTrackingStrategy.cs
new file mode 100644
index 0000000..ba5db36
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ISourceTrackingStrategy.cs
@@ -0,0 +1,6 @@
+namespace NGS.MeshFusionPro;
+
+public interface ISourceTrackingStrategy
+{
+ bool OnUpdate();
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMeshMoverLW.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMeshMoverLW.cs
new file mode 100644
index 0000000..b2ea31d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMeshMoverLW.cs
@@ -0,0 +1,139 @@
+using System;
+using System.Collections.Generic;
+using Unity.Burst;
+using Unity.Collections;
+using Unity.Jobs;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class JobsMeshMoverLW : IAsyncCombinedMeshMover, ICombinedMeshMover, IDisposable
+{
+ [BurstCompile]
+ private struct MovePartsJob : IJobParallelFor
+ {
+ [NativeDisableParallelForRestriction]
+ public NativeArray<LightweightVertex> vertices;
+
+ [ReadOnly]
+ public NativeArray<LightweightVertex> localVertices;
+
+ [WriteOnly]
+ [NativeDisableParallelForRestriction]
+ public NativeArray<Bounds> bounds;
+
+ [ReadOnly]
+ [NativeDisableParallelForRestriction]
+ public NativeArray<Bounds> localBounds;
+
+ [ReadOnly]
+ public NativeList<PartMoveInfo> moveInfos;
+
+ public void Execute(int idx)
+ {
+ PartMoveInfo partMoveInfo = moveInfos[idx];
+ int partIndex = partMoveInfo.partIndex;
+ int vertexStart = partMoveInfo.vertexStart;
+ int num = vertexStart + partMoveInfo.vertexCount;
+ Matrix4x4 targetTransform = partMoveInfo.targetTransform;
+ for (int i = vertexStart; i < num; i++)
+ {
+ LightweightVertex lightweightVertex = localVertices[i];
+ float w = lightweightVertex.tanW;
+ Vector3 normalized = targetTransform.MultiplyVector(lightweightVertex.Normal).normalized;
+ Vector4 tangent = targetTransform.MultiplyVector(lightweightVertex.Tangent).normalized;
+ tangent.w = w;
+ LightweightVertex lightweightVertex2 = default(LightweightVertex);
+ lightweightVertex2.Position = targetTransform.MultiplyPoint3x4(lightweightVertex.Position);
+ lightweightVertex2.Normal = normalized;
+ lightweightVertex2.Tangent = tangent;
+ lightweightVertex2.uv = lightweightVertex.uv;
+ lightweightVertex2.uv2 = lightweightVertex.uv2;
+ LightweightVertex value = lightweightVertex2;
+ vertices[i] = value;
+ }
+ bounds[partIndex] = localBounds[partIndex].Transform(targetTransform);
+ }
+ }
+
+ [BurstCompile]
+ private struct RecalculateBoundsJob : IJob
+ {
+ public NativeArray<Bounds> bounds;
+
+ public NativeArray<Bounds> boundingBox;
+
+ public void Execute()
+ {
+ Bounds value = boundingBox[0];
+ value.size = Vector3.zero;
+ for (int i = 0; i < bounds.Length; i++)
+ {
+ value.Encapsulate(bounds[i]);
+ }
+ boundingBox[0] = value;
+ }
+ }
+
+ private MeshDataNativeArraysLW _meshData;
+
+ private NativeList<PartMoveInfo> _moveInfos;
+
+ private JobHandle _handle;
+
+ public JobsMeshMoverLW(MeshDataNativeArraysLW meshData)
+ {
+ _meshData = meshData;
+ _moveInfos = new NativeList<PartMoveInfo>(Allocator.Persistent);
+ }
+
+ public void MoveParts(IList<PartMoveInfo> moveInfos)
+ {
+ MovePartsAsync(moveInfos);
+ FinishAsyncMoving();
+ }
+
+ public void MovePartsAsync(IList<PartMoveInfo> moveInfos)
+ {
+ NativeArray<Bounds> bounds = _meshData.Bounds;
+ bounds[0] = new Bounds(_meshData.GetBounds().center, Vector3.zero);
+ _moveInfos.Clear();
+ for (int i = 0; i < moveInfos.Count; i++)
+ {
+ ref NativeList<PartMoveInfo> moveInfos2 = ref _moveInfos;
+ PartMoveInfo value = moveInfos[i];
+ moveInfos2.Add(in value);
+ }
+ MovePartsJob movePartsJob = default(MovePartsJob);
+ movePartsJob.vertices = _meshData.Vertices;
+ movePartsJob.bounds = _meshData.PartsBounds;
+ movePartsJob.localVertices = _meshData.VerticesLocal;
+ movePartsJob.localBounds = _meshData.PartsBoundsLocal;
+ movePartsJob.moveInfos = _moveInfos;
+ MovePartsJob jobData = movePartsJob;
+ RecalculateBoundsJob recalculateBoundsJob = default(RecalculateBoundsJob);
+ recalculateBoundsJob.bounds = _meshData.PartsBounds;
+ recalculateBoundsJob.boundingBox = bounds;
+ RecalculateBoundsJob jobData2 = recalculateBoundsJob;
+ _handle = jobData2.Schedule(IJobParallelForExtensions.Schedule(jobData, _moveInfos.Length, 4));
+ }
+
+ public void FinishAsyncMoving()
+ {
+ _handle.Complete();
+ }
+
+ public void ApplyData()
+ {
+ if (!_handle.IsCompleted)
+ {
+ FinishAsyncMoving();
+ }
+ _meshData.ApplyDataToMesh();
+ }
+
+ public void Dispose()
+ {
+ _moveInfos.Dispose();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMeshMoverSTD.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMeshMoverSTD.cs
new file mode 100644
index 0000000..535b8af
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMeshMoverSTD.cs
@@ -0,0 +1,144 @@
+using System;
+using System.Collections.Generic;
+using Unity.Burst;
+using Unity.Collections;
+using Unity.Jobs;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class JobsMeshMoverSTD : IAsyncCombinedMeshMover, ICombinedMeshMover, IDisposable
+{
+ [BurstCompile]
+ private struct MovePartsJob : IJobParallelFor
+ {
+ [NativeDisableParallelForRestriction]
+ public NativeArray<Vector3> vertices;
+
+ [NativeDisableParallelForRestriction]
+ public NativeArray<Vector3> normals;
+
+ [NativeDisableParallelForRestriction]
+ public NativeArray<Vector4> tangents;
+
+ [WriteOnly]
+ [NativeDisableParallelForRestriction]
+ public NativeArray<Bounds> bounds;
+
+ [ReadOnly]
+ [NativeDisableParallelForRestriction]
+ public NativeArray<Bounds> localBounds;
+
+ [ReadOnly]
+ public NativeList<PartMoveInfo> moveInfos;
+
+ public void Execute(int idx)
+ {
+ PartMoveInfo partMoveInfo = moveInfos[idx];
+ int partIndex = partMoveInfo.partIndex;
+ int vertexStart = partMoveInfo.vertexStart;
+ int num = vertexStart + partMoveInfo.vertexCount;
+ Matrix4x4 targetTransform = partMoveInfo.targetTransform;
+ Matrix4x4 inverse = partMoveInfo.currentTransform.inverse;
+ for (int i = vertexStart; i < num; i++)
+ {
+ Vector3 point = vertices[i];
+ Vector3 vector = normals[i];
+ Vector4 vector2 = tangents[i];
+ float w = vector2.w;
+ point = inverse.MultiplyPoint3x4(point);
+ point = targetTransform.MultiplyPoint3x4(point);
+ vector = inverse.MultiplyVector(vector);
+ vector = targetTransform.MultiplyVector(vector);
+ vector2 = inverse.MultiplyVector(vector2);
+ vector2 = targetTransform.MultiplyVector(vector2);
+ vector2.w = w;
+ vertices[i] = point;
+ normals[i] = vector;
+ tangents[i] = vector2;
+ }
+ bounds[partIndex] = localBounds[partIndex].Transform(targetTransform);
+ }
+ }
+
+ [BurstCompile]
+ private struct RecalculateBoundsJob : IJob
+ {
+ public NativeArray<Bounds> bounds;
+
+ public NativeArray<Bounds> boundingBox;
+
+ public void Execute()
+ {
+ Bounds value = boundingBox[0];
+ for (int i = 0; i < bounds.Length; i++)
+ {
+ value.Encapsulate(bounds[i]);
+ }
+ boundingBox[0] = value;
+ }
+ }
+
+ private MeshDataNativeArraysSTD _meshData;
+
+ private NativeList<PartMoveInfo> _moveInfos;
+
+ private JobHandle _handle;
+
+ public JobsMeshMoverSTD(MeshDataNativeArraysSTD meshData)
+ {
+ _meshData = meshData;
+ _moveInfos = new NativeList<PartMoveInfo>(Allocator.Persistent);
+ }
+
+ public void MoveParts(IList<PartMoveInfo> moveInfos)
+ {
+ MovePartsAsync(moveInfos);
+ FinishAsyncMoving();
+ }
+
+ public void MovePartsAsync(IList<PartMoveInfo> moveInfos)
+ {
+ NativeArray<Bounds> bounds = _meshData.Bounds;
+ bounds[0] = new Bounds(_meshData.GetBounds().center, Vector3.zero);
+ _moveInfos.Clear();
+ for (int i = 0; i < moveInfos.Count; i++)
+ {
+ ref NativeList<PartMoveInfo> moveInfos2 = ref _moveInfos;
+ PartMoveInfo value = moveInfos[i];
+ moveInfos2.Add(in value);
+ }
+ MovePartsJob movePartsJob = default(MovePartsJob);
+ movePartsJob.vertices = _meshData.Vertices;
+ movePartsJob.normals = _meshData.Normals;
+ movePartsJob.tangents = _meshData.Tangents;
+ movePartsJob.bounds = _meshData.PartsBounds;
+ movePartsJob.localBounds = _meshData.PartsBoundsLocal;
+ movePartsJob.moveInfos = _moveInfos;
+ MovePartsJob jobData = movePartsJob;
+ RecalculateBoundsJob recalculateBoundsJob = default(RecalculateBoundsJob);
+ recalculateBoundsJob.bounds = _meshData.PartsBounds;
+ recalculateBoundsJob.boundingBox = bounds;
+ RecalculateBoundsJob jobData2 = recalculateBoundsJob;
+ _handle = jobData2.Schedule(IJobParallelForExtensions.Schedule(jobData, _moveInfos.Length, 4));
+ }
+
+ public void FinishAsyncMoving()
+ {
+ _handle.Complete();
+ }
+
+ public void ApplyData()
+ {
+ if (!_handle.IsCompleted)
+ {
+ FinishAsyncMoving();
+ }
+ _meshData.ApplyDataToMesh();
+ }
+
+ public void Dispose()
+ {
+ _moveInfos.Dispose();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMovableMeshLWFactory.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMovableMeshLWFactory.cs
new file mode 100644
index 0000000..4790976
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMovableMeshLWFactory.cs
@@ -0,0 +1,18 @@
+namespace NGS.MeshFusionPro;
+
+public class JobsMovableMeshLWFactory : IMovableCombinedMeshFactory
+{
+ private IMeshToolsFactory _tools;
+
+ public JobsMovableMeshLWFactory(IMeshToolsFactory tools)
+ {
+ _tools = tools;
+ }
+
+ public CombinedMesh CreateMovableMesh(out ICombinedMeshMover mover)
+ {
+ CombinedMesh<MeshDataNativeArraysLW> combinedMesh = new CombinedMesh<MeshDataNativeArraysLW>(_tools.CreateMeshCombiner(), _tools.CreateMeshCutter());
+ mover = new JobsMeshMoverLW(combinedMesh.MeshDataInternal);
+ return combinedMesh;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMovableMeshSTDFactory.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMovableMeshSTDFactory.cs
new file mode 100644
index 0000000..36402f5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/JobsMovableMeshSTDFactory.cs
@@ -0,0 +1,18 @@
+namespace NGS.MeshFusionPro;
+
+public class JobsMovableMeshSTDFactory : IMovableCombinedMeshFactory
+{
+ private IMeshToolsFactory _tools;
+
+ public JobsMovableMeshSTDFactory(IMeshToolsFactory tools)
+ {
+ _tools = tools;
+ }
+
+ public CombinedMesh CreateMovableMesh(out ICombinedMeshMover mover)
+ {
+ CombinedMesh<MeshDataNativeArraysSTD> combinedMesh = new CombinedMesh<MeshDataNativeArraysSTD>(_tools.CreateMeshCombiner(), _tools.CreateMeshCutter());
+ mover = new JobsMeshMoverSTD(combinedMesh.MeshDataInternal);
+ return combinedMesh;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODGroupCombineSource.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODGroupCombineSource.cs
new file mode 100644
index 0000000..66c640b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODGroupCombineSource.cs
@@ -0,0 +1,106 @@
+using System;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class LODGroupCombineSource : ICombineSource<CombinedLODGroup, CombinedLODGroupPart>, ICombineSource
+{
+ private Bounds _bounds;
+
+ private LODGroupSettings _settings;
+
+ private CombineSource[][] _sources;
+
+ public Vector3 Position { get; private set; }
+
+ public Bounds Bounds => _bounds;
+
+ public LODGroup LODGroup { get; private set; }
+
+ public LODGroupSettings Settings => _settings;
+
+ public CombineSource[][] BaseSources => _sources;
+
+ public event Action<ICombinedObject, ICombinedObjectPart> onCombined;
+
+ public event Action<ICombinedObject, string> onCombineError;
+
+ public event Action<ICombinedObject> onCombineFailed;
+
+ public event Action<CombinedLODGroup, CombinedLODGroupPart> onCombinedTyped;
+
+ public event Action<CombinedLODGroup, string> onCombineErrorTyped;
+
+ public event Action<CombinedLODGroup> onCombineFailedTyped;
+
+ public LODGroupCombineSource(LODGroup group)
+ {
+ LODGroup = group;
+ Position = group.transform.position;
+ LOD[] lODs = group.GetLODs();
+ _settings = new LODGroupSettings(group);
+ _sources = new CombineSource[_settings.lodCount][];
+ _bounds = new Bounds(group.localReferencePoint + Position, Vector3.zero);
+ for (int i = 0; i < lODs.Length; i++)
+ {
+ Renderer[] renderers = lODs[i].renderers;
+ CreateSourcesArray(i, renderers);
+ FillSources(i, renderers);
+ }
+ }
+
+ public void Combined(CombinedLODGroup root, CombinedLODGroupPart part)
+ {
+ this.onCombined?.Invoke(root, part);
+ this.onCombinedTyped?.Invoke(root, part);
+ }
+
+ public void CombineError(CombinedLODGroup root, string errorMessage)
+ {
+ if (this.onCombineError == null && this.onCombineErrorTyped == null)
+ {
+ Debug.Log("Combine error occured : " + root.name + ", reason : " + errorMessage);
+ return;
+ }
+ this.onCombineError?.Invoke(root, errorMessage);
+ this.onCombineErrorTyped?.Invoke(root, errorMessage);
+ }
+
+ public void CombineFailed(CombinedLODGroup root)
+ {
+ this.onCombineFailed?.Invoke(root);
+ this.onCombineFailedTyped?.Invoke(root);
+ }
+
+ private void CreateSourcesArray(int level, Renderer[] renderers)
+ {
+ int num = 0;
+ for (int i = 0; i < renderers.Length; i++)
+ {
+ if (!(renderers[i] == null))
+ {
+ num += renderers[i].sharedMaterials.Length;
+ }
+ }
+ _sources[level] = new CombineSource[num];
+ }
+
+ private void FillSources(int level, Renderer[] renderers)
+ {
+ int num = 0;
+ for (int i = 0; i < renderers.Length; i++)
+ {
+ MeshRenderer meshRenderer = (MeshRenderer)renderers[i];
+ if (!(meshRenderer == null))
+ {
+ Mesh sharedMesh = meshRenderer.GetComponent<MeshFilter>().sharedMesh;
+ for (int j = 0; j < sharedMesh.subMeshCount; j++)
+ {
+ _sources[level][num] = new CombineSource(sharedMesh, meshRenderer, j);
+ num++;
+ }
+ _bounds.Encapsulate(meshRenderer.bounds);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODGroupSettings.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODGroupSettings.cs
new file mode 100644
index 0000000..b0d123f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODGroupSettings.cs
@@ -0,0 +1,63 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public struct LODGroupSettings
+{
+ public float size;
+
+ public int lodCount;
+
+ public LODFadeMode fadeMode;
+
+ public bool animateCrossFading;
+
+ public float[] screenTransitionsHeight;
+
+ public float[] fadeTransitionsWidth;
+
+ public LODGroupSettings(LODGroup group)
+ {
+ size = group.size;
+ lodCount = group.lodCount;
+ fadeMode = group.fadeMode;
+ animateCrossFading = group.animateCrossFading;
+ screenTransitionsHeight = new float[lodCount];
+ fadeTransitionsWidth = new float[lodCount];
+ LOD[] lODs = group.GetLODs();
+ for (int i = 0; i < lodCount; i++)
+ {
+ LOD lOD = lODs[i];
+ screenTransitionsHeight[i] = lOD.screenRelativeTransitionHeight;
+ fadeTransitionsWidth[i] = lOD.fadeTransitionWidth;
+ }
+ }
+
+ public bool IsEqual(LODGroupSettings settings, float screenHeightThreshold = 0.0001f, float fadeWidthThreshold = 0.0001f)
+ {
+ if (lodCount != settings.lodCount)
+ {
+ return false;
+ }
+ if (fadeMode != settings.fadeMode)
+ {
+ return false;
+ }
+ if (animateCrossFading != settings.animateCrossFading)
+ {
+ return false;
+ }
+ for (int i = 0; i < lodCount; i++)
+ {
+ if (Mathf.Abs(screenTransitionsHeight[i] - settings.screenTransitionsHeight[i]) > screenHeightThreshold)
+ {
+ return false;
+ }
+ if (Mathf.Abs(fadeTransitionsWidth[i] - settings.fadeTransitionsWidth[i]) > fadeWidthThreshold)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODGroupsCombiner.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODGroupsCombiner.cs
new file mode 100644
index 0000000..961bf28
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODGroupsCombiner.cs
@@ -0,0 +1,34 @@
+using System.Collections.Generic;
+
+namespace NGS.MeshFusionPro;
+
+public class LODGroupsCombiner : ObjectsCombiner<CombinedLODGroup, LODGroupCombineSource>
+{
+ private ICombinedMeshFactory _factory;
+
+ private CombinedLODGroupMatcher _matcher;
+
+ private int _vertexLimit;
+
+ public LODGroupsCombiner(ICombinedMeshFactory factory, int vertexLimit)
+ {
+ _factory = factory;
+ _matcher = new CombinedLODGroupMatcher();
+ _vertexLimit = vertexLimit;
+ }
+
+ protected override CombinedLODGroup CreateCombinedObject(LODGroupCombineSource source)
+ {
+ return CombinedLODGroup.Create(_factory, source.Settings, _vertexLimit);
+ }
+
+ protected override void CombineSources(CombinedLODGroup root, IList<LODGroupCombineSource> sources)
+ {
+ root.Combine(sources);
+ }
+
+ protected override CombinedObjectMatcher<CombinedLODGroup, LODGroupCombineSource> GetMatcher()
+ {
+ return _matcher;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODMeshFusionSource.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODMeshFusionSource.cs
new file mode 100644
index 0000000..4b941b9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LODMeshFusionSource.cs
@@ -0,0 +1,141 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class LODMeshFusionSource : MeshFusionSource
+{
+ [SerializeField]
+ [HideInInspector]
+ private LODGroup _group;
+
+ private LODGroupCombineSource _source;
+
+ private CombinedLODGroupPart _part;
+
+ private Bounds? _savedBounds;
+
+ public override bool TryGetBounds(ref Bounds bounds)
+ {
+ if (_source != null)
+ {
+ bounds = _source.Bounds;
+ return true;
+ }
+ if (_part != null)
+ {
+ bounds = _part.Bounds;
+ return true;
+ }
+ if (_savedBounds.HasValue)
+ {
+ bounds = _savedBounds.Value;
+ return true;
+ }
+ if (base.IsIncompatible)
+ {
+ return false;
+ }
+ LOD[] lODs = _group.GetLODs();
+ bounds = new Bounds(base.transform.position, Vector3.zero);
+ for (int i = 0; i < lODs.Length; i++)
+ {
+ Renderer[] renderers = lODs[i].renderers;
+ for (int j = 0; j < renderers.Length; j++)
+ {
+ if (!(renderers[j] == null))
+ {
+ bounds.Encapsulate(renderers[j].bounds);
+ }
+ }
+ }
+ _savedBounds = bounds;
+ return true;
+ }
+
+ protected override void OnSourceCombinedInternal(ICombinedObject root, ICombinedObjectPart part)
+ {
+ _part = (CombinedLODGroupPart)part;
+ }
+
+ protected override bool CheckCompatibilityAndGetComponents(out string incompatibilityReason)
+ {
+ if (_group == null)
+ {
+ _group = GetComponent<LODGroup>();
+ }
+ if (_group == null)
+ {
+ incompatibilityReason = "LODGroup not found";
+ return false;
+ }
+ incompatibilityReason = "";
+ MeshFilter filter = null;
+ Mesh mesh = null;
+ LOD[] lODs = _group.GetLODs();
+ for (int i = 0; i < lODs.Length; i++)
+ {
+ Renderer[] renderers = lODs[i].renderers;
+ for (int j = 0; j < renderers.Length; j++)
+ {
+ MeshRenderer renderer = renderers[j] as MeshRenderer;
+ if (!(renderer == null) && !CanCreateCombineSource(renderer.gameObject, ref incompatibilityReason, ref renderer, ref filter, ref mesh))
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ protected override void CreateSources()
+ {
+ _source = new LODGroupCombineSource(_group);
+ }
+
+ protected override IEnumerable<ICombineSource> GetCombineSources()
+ {
+ if (_source != null)
+ {
+ yield return _source;
+ }
+ }
+
+ protected override IEnumerable<ICombinedObjectPart> GetCombinedParts()
+ {
+ if (_part != null)
+ {
+ yield return _part;
+ }
+ }
+
+ protected override void ClearSources()
+ {
+ if (_source != null)
+ {
+ _source = null;
+ }
+ }
+
+ protected override void ClearParts()
+ {
+ if (_part != null)
+ {
+ _part = null;
+ }
+ }
+
+ protected override void ToggleComponents(bool enabled)
+ {
+ LOD[] lODs = _group.GetLODs();
+ for (int i = 0; i < lODs.Length; i++)
+ {
+ Renderer[] renderers = lODs[i].renderers;
+ for (int j = 0; j < renderers.Length; j++)
+ {
+ renderers[j].enabled = enabled;
+ }
+ }
+ _group.enabled = enabled;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LightweightVertex.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LightweightVertex.cs
new file mode 100644
index 0000000..5c5de9e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/LightweightVertex.cs
@@ -0,0 +1,95 @@
+using Unity.Mathematics;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public struct LightweightVertex
+{
+ public float3 pos;
+
+ public sbyte normX;
+
+ public sbyte normY;
+
+ public sbyte normZ;
+
+ public sbyte normW;
+
+ public sbyte tanX;
+
+ public sbyte tanY;
+
+ public sbyte tanZ;
+
+ public sbyte tanW;
+
+ public half2 uv;
+
+ public half2 uv2;
+
+ public Vector3 Position
+ {
+ get
+ {
+ return pos;
+ }
+ set
+ {
+ pos = value;
+ }
+ }
+
+ public Vector3 Normal
+ {
+ get
+ {
+ return new Vector3((float)normX / 127f, (float)normY / 127f, (float)normZ / 127f);
+ }
+ set
+ {
+ normX = (sbyte)(value.x * 127f);
+ normY = (sbyte)(value.y * 127f);
+ normZ = (sbyte)(value.z * 127f);
+ normW = 1;
+ }
+ }
+
+ public Vector4 Tangent
+ {
+ get
+ {
+ return new Vector4((float)tanX / 127f, (float)tanY / 127f, (float)tanZ / 127f, (float)tanW / 127f);
+ }
+ set
+ {
+ tanX = (sbyte)(value.x * 127f);
+ tanY = (sbyte)(value.y * 127f);
+ tanZ = (sbyte)(value.z * 127f);
+ tanW = (sbyte)(value.w * 127f);
+ }
+ }
+
+ public Vector2 UV
+ {
+ get
+ {
+ return new Vector2(uv.x, uv.y);
+ }
+ set
+ {
+ uv = new half2((half)value.x, (half)value.y);
+ }
+ }
+
+ public Vector2 UV2
+ {
+ get
+ {
+ return new Vector2(uv2.x, uv2.y);
+ }
+ set
+ {
+ uv2 = new half2((half)value.x, (half)value.y);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MatrixHelper.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MatrixHelper.cs
new file mode 100644
index 0000000..feb92b1
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MatrixHelper.cs
@@ -0,0 +1,18 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public static class MatrixHelper
+{
+ public static Vector3 GetTranslation(this Matrix4x4 matrix)
+ {
+ return matrix.GetColumn(3);
+ }
+
+ public static Matrix4x4 SetTranslation(this Matrix4x4 matrix, Vector3 pos)
+ {
+ Matrix4x4 result = matrix;
+ result.SetColumn(3, new Vector4(pos.x, pos.y, pos.z, 1f));
+ return result;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombineInfo.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombineInfo.cs
new file mode 100644
index 0000000..ed879cb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombineInfo.cs
@@ -0,0 +1,43 @@
+using UnityEngine;
+using UnityEngine.Rendering;
+
+namespace NGS.MeshFusionPro;
+
+public struct MeshCombineInfo
+{
+ public Mesh mesh;
+
+ public Matrix4x4 transformMatrix;
+
+ public Vector4 lightmapScaleOffset;
+
+ public Vector4 realtimeLightmapScaleOffset;
+
+ public int submeshIndex;
+
+ public readonly int vertexCount;
+
+ public readonly int trianglesCount;
+
+ public MeshCombineInfo(Mesh mesh, int submeshIndex = 0)
+ : this(mesh, Matrix4x4.identity, submeshIndex)
+ {
+ }
+
+ public MeshCombineInfo(Mesh mesh, Matrix4x4 transformMatrix, int submeshIndex = 0)
+ : this(mesh, transformMatrix, new Vector4(1f, 1f, 0f, 0f), new Vector4(1f, 1f, 0f, 0f), submeshIndex)
+ {
+ }
+
+ public MeshCombineInfo(Mesh mesh, Matrix4x4 transformMatrix, Vector4 lightmapScaleOffset, Vector4 realtimeLightmapScaleOffset, int submeshIndex = 0)
+ {
+ this.mesh = mesh;
+ this.transformMatrix = transformMatrix;
+ this.lightmapScaleOffset = lightmapScaleOffset;
+ this.realtimeLightmapScaleOffset = realtimeLightmapScaleOffset;
+ this.submeshIndex = submeshIndex;
+ SubMeshDescriptor subMesh = mesh.GetSubMesh(submeshIndex);
+ vertexCount = subMesh.vertexCount;
+ trianglesCount = subMesh.indexCount;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombinerBase.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombinerBase.cs
new file mode 100644
index 0000000..34804fd
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombinerBase.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public abstract class MeshCombinerBase : IMeshCombiner
+{
+ public void Combine(Mesh mesh, IList<MeshCombineInfo> infos)
+ {
+ ValidateMesh(mesh);
+ ValidateCombineInfos(infos);
+ CombineInternal(mesh, infos);
+ }
+
+ protected abstract void CombineInternal(Mesh mesh, IList<MeshCombineInfo> infos);
+
+ protected virtual void ValidateMesh(Mesh mesh)
+ {
+ if (mesh == null)
+ {
+ throw new ArgumentNullException("mesh");
+ }
+ if (mesh.subMeshCount > 1)
+ {
+ throw new ArgumentException("BaseMeshCombiner::input 'mesh' should have 1 submesh");
+ }
+ }
+
+ protected virtual void ValidateCombineInfos(IList<MeshCombineInfo> infos)
+ {
+ if (infos == null)
+ {
+ throw new ArgumentNullException("MeshCombineInfos is null");
+ }
+ for (int i = 0; i < infos.Count; i++)
+ {
+ if (infos[i].mesh == null)
+ {
+ throw new ArgumentNullException("MeshCombineInfo.mesh is null");
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombinerSimpleLW.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombinerSimpleLW.cs
new file mode 100644
index 0000000..50e6031
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombinerSimpleLW.cs
@@ -0,0 +1,29 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class MeshCombinerSimpleLW : MeshCombinerBase
+{
+ private MeshCombinerSimpleSTD _stdCombiner;
+
+ public MeshCombinerSimpleLW()
+ {
+ _stdCombiner = new MeshCombinerSimpleSTD();
+ }
+
+ protected override void CombineInternal(Mesh mesh, IList<MeshCombineInfo> infos)
+ {
+ VertexBufferUtil.ToStandardBuffer(mesh);
+ try
+ {
+ _stdCombiner.Combine(mesh, infos);
+ VertexBufferUtil.ToLightweightBuffer(mesh);
+ }
+ catch
+ {
+ VertexBufferUtil.ToLightweightBuffer(mesh);
+ throw;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombinerSimpleSTD.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombinerSimpleSTD.cs
new file mode 100644
index 0000000..3e9fb86
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCombinerSimpleSTD.cs
@@ -0,0 +1,42 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class MeshCombinerSimpleSTD : MeshCombinerBase
+{
+ private MeshSeparatorSimple _meshSeparator;
+
+ public MeshCombinerSimpleSTD()
+ {
+ _meshSeparator = new MeshSeparatorSimple();
+ }
+
+ protected override void CombineInternal(Mesh mesh, IList<MeshCombineInfo> infos)
+ {
+ CombineInstance[] array = new CombineInstance[infos.Count + 1];
+ Mesh mesh2 = Object.Instantiate(mesh);
+ array[0] = CreateCombineInstance(new MeshCombineInfo(mesh2));
+ for (int i = 0; i < infos.Count; i++)
+ {
+ array[i + 1] = CreateCombineInstance(infos[i]);
+ }
+ mesh.CombineMeshes(array, mergeSubMeshes: true, useMatrices: true, hasLightmapData: true);
+ }
+
+ private CombineInstance CreateCombineInstance(MeshCombineInfo info)
+ {
+ Mesh mesh = info.mesh;
+ if (mesh.subMeshCount > 1)
+ {
+ mesh = _meshSeparator.GetSubmesh(mesh, info.submeshIndex);
+ }
+ CombineInstance result = default(CombineInstance);
+ result.mesh = mesh;
+ result.subMeshIndex = 0;
+ result.transform = info.transformMatrix;
+ result.lightmapScaleOffset = info.lightmapScaleOffset;
+ result.realtimeLightmapScaleOffset = info.realtimeLightmapScaleOffset;
+ return result;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCutterSimpleLW.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCutterSimpleLW.cs
new file mode 100644
index 0000000..4a70c56
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCutterSimpleLW.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Unity.Collections;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class MeshCutterSimpleLW : IMeshCutter
+{
+ private static List<int> _triangles;
+
+ static MeshCutterSimpleLW()
+ {
+ _triangles = new List<int>();
+ }
+
+ public void Cut(Mesh mesh, MeshCuttingInfo info)
+ {
+ Cut(mesh, new MeshCuttingInfo[1] { info });
+ }
+
+ public void Cut(Mesh mesh, IList<MeshCuttingInfo> infos)
+ {
+ ValidateMeshOrThrowException(mesh);
+ mesh.GetTriangles(_triangles, 0);
+ using (Mesh.MeshDataArray meshDataArray = Mesh.AcquireReadOnlyMeshData(mesh))
+ {
+ NativeArray<LightweightVertex> other = meshDataArray[0].GetVertexData<LightweightVertex>();
+ NativeList<LightweightVertex> nativeList = new NativeList<LightweightVertex>(Allocator.Temp);
+ nativeList.CopyFrom(in other);
+ foreach (MeshCuttingInfo item in infos.OrderByDescending((MeshCuttingInfo i) => i.triangleStart))
+ {
+ nativeList.RemoveRange(item.vertexStart, item.vertexCount);
+ _triangles.RemoveRange(item.triangleStart, item.triangleCount);
+ OffsetTriangles(item);
+ }
+ mesh.SetTriangles(_triangles, 0);
+ mesh.SetVertexBufferData<LightweightVertex>(nativeList, 0, 0, nativeList.Length);
+ }
+ _triangles.Clear();
+ }
+
+ private void ValidateMeshOrThrowException(Mesh mesh)
+ {
+ if (mesh == null)
+ {
+ throw new ArgumentNullException("mesh");
+ }
+ if (mesh.subMeshCount > 1)
+ {
+ throw new ArgumentException("SimpleMeshCutter::'mesh' should has only 1 submesh");
+ }
+ }
+
+ private void OffsetTriangles(MeshCuttingInfo info)
+ {
+ int vertexCount = info.vertexCount;
+ int triangleStart = info.triangleStart;
+ int count = _triangles.Count;
+ for (int i = triangleStart; i < count; i++)
+ {
+ _triangles[i] -= vertexCount;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCutterSimpleSTD.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCutterSimpleSTD.cs
new file mode 100644
index 0000000..950f0e9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCutterSimpleSTD.cs
@@ -0,0 +1,138 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class MeshCutterSimpleSTD : IMeshCutter
+{
+ private static List<Vector3> _vertices;
+
+ private static List<Vector3> _normals;
+
+ private static List<Vector4> _tangents;
+
+ private static List<int> _triangles;
+
+ private static List<Vector2>[] _uvs;
+
+ private static int _maxUVsCount;
+
+ static MeshCutterSimpleSTD()
+ {
+ _maxUVsCount = 4;
+ _vertices = new List<Vector3>();
+ _normals = new List<Vector3>();
+ _tangents = new List<Vector4>();
+ _triangles = new List<int>();
+ _uvs = new List<Vector2>[_maxUVsCount];
+ for (int i = 0; i < _maxUVsCount; i++)
+ {
+ _uvs[i] = new List<Vector2>();
+ }
+ }
+
+ public void Cut(Mesh mesh, MeshCuttingInfo info)
+ {
+ Cut(mesh, new MeshCuttingInfo[1] { info });
+ }
+
+ public void Cut(Mesh mesh, IList<MeshCuttingInfo> infos)
+ {
+ ValidateMeshOrThrowException(mesh);
+ CollectData(mesh);
+ foreach (MeshCuttingInfo item in infos.OrderByDescending((MeshCuttingInfo i) => i.triangleStart))
+ {
+ RemoveData(item);
+ OffsetTriangles(item);
+ }
+ ApplyDataToMesh(mesh);
+ ClearData();
+ }
+
+ private void ValidateMeshOrThrowException(Mesh mesh)
+ {
+ if (mesh == null)
+ {
+ throw new ArgumentNullException("mesh is null");
+ }
+ if (mesh.subMeshCount > 1)
+ {
+ throw new ArgumentException("SimpleMeshCutter::'mesh' should has only 1 submesh");
+ }
+ }
+
+ private void CollectData(Mesh mesh)
+ {
+ mesh.GetVertices(_vertices);
+ mesh.GetNormals(_normals);
+ mesh.GetTangents(_tangents);
+ mesh.GetTriangles(_triangles, 0);
+ for (int i = 0; i < _maxUVsCount; i++)
+ {
+ mesh.GetUVs(i, _uvs[i]);
+ }
+ }
+
+ private void RemoveData(MeshCuttingInfo cuttingInfo)
+ {
+ int vertexStart = cuttingInfo.vertexStart;
+ int vertexCount = cuttingInfo.vertexCount;
+ _vertices.RemoveRange(vertexStart, vertexCount);
+ if (_normals.Count > 0)
+ {
+ _normals.RemoveRange(vertexStart, vertexCount);
+ }
+ if (_tangents.Count > 0)
+ {
+ _tangents.RemoveRange(vertexStart, vertexCount);
+ }
+ _triangles.RemoveRange(cuttingInfo.triangleStart, cuttingInfo.triangleCount);
+ for (int i = 0; i < _uvs.Length; i++)
+ {
+ if (_uvs[i].Count > 0)
+ {
+ _uvs[i].RemoveRange(vertexStart, vertexCount);
+ }
+ }
+ }
+
+ private void OffsetTriangles(MeshCuttingInfo info)
+ {
+ int vertexCount = info.vertexCount;
+ int triangleStart = info.triangleStart;
+ int count = _triangles.Count;
+ for (int i = triangleStart; i < count; i++)
+ {
+ _triangles[i] -= vertexCount;
+ }
+ }
+
+ private void ApplyDataToMesh(Mesh mesh)
+ {
+ mesh.SetTriangles(_triangles, 0);
+ mesh.SetVertices(_vertices);
+ mesh.SetNormals(_normals);
+ mesh.SetTangents(_tangents);
+ for (int i = 0; i < _maxUVsCount; i++)
+ {
+ if (_uvs[i].Count > 0)
+ {
+ mesh.SetUVs(i, _uvs[i]);
+ }
+ }
+ }
+
+ private void ClearData()
+ {
+ _vertices.Clear();
+ _normals.Clear();
+ _tangents.Clear();
+ _triangles.Clear();
+ for (int i = 0; i < _maxUVsCount; i++)
+ {
+ _uvs[i].Clear();
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCuttingInfo.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCuttingInfo.cs
new file mode 100644
index 0000000..a295571
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshCuttingInfo.cs
@@ -0,0 +1,20 @@
+namespace NGS.MeshFusionPro;
+
+public struct MeshCuttingInfo
+{
+ public int vertexStart;
+
+ public int vertexCount;
+
+ public int triangleStart;
+
+ public int triangleCount;
+
+ public MeshCuttingInfo(int vertexStart, int vertexCount, int triangleStart, int triangleCount)
+ {
+ this.vertexStart = vertexStart;
+ this.vertexCount = vertexCount;
+ this.triangleStart = triangleStart;
+ this.triangleCount = triangleCount;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshDataListsSTD.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshDataListsSTD.cs
new file mode 100644
index 0000000..1bf34eb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshDataListsSTD.cs
@@ -0,0 +1,83 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class MeshDataListsSTD : CombinedMeshDataInternal
+{
+ private CombinedMesh _root;
+
+ private List<Vector3> _vertices;
+
+ private List<Vector3> _normals;
+
+ private List<Vector4> _tangents;
+
+ private List<Bounds> _partsBounds;
+
+ private List<Bounds> _partsBoundsLocal;
+
+ public List<Vector3> Vertices => _vertices;
+
+ public List<Vector3> Normals => _normals;
+
+ public List<Vector4> Tangents => _tangents;
+
+ public List<Bounds> PartsBounds => _partsBounds;
+
+ public List<Bounds> PartsBoundsLocal => _partsBoundsLocal;
+
+ public Bounds Bounds { get; set; }
+
+ public override Bounds GetBounds()
+ {
+ return Bounds;
+ }
+
+ public override Bounds GetBounds(CombinedMeshPart part)
+ {
+ return _partsBounds[part.Index];
+ }
+
+ public void ApplyDataToMesh()
+ {
+ Mesh mesh = _root.Mesh;
+ mesh.SetVertices(_vertices);
+ mesh.SetNormals(_normals);
+ mesh.SetTangents(_tangents);
+ mesh.bounds = Bounds;
+ }
+
+ protected override void OnInitialized()
+ {
+ _root = base.Root;
+ _vertices = new List<Vector3>();
+ _normals = new List<Vector3>();
+ _tangents = new List<Vector4>();
+ _partsBounds = new List<Bounds>();
+ _partsBoundsLocal = new List<Bounds>();
+ }
+
+ protected override void OnAddPart(CombinedMeshPart part, Mesh mesh, Matrix4x4 transform)
+ {
+ Bounds bounds = mesh.bounds;
+ Bounds item = bounds.Transform(transform);
+ _partsBounds.Add(item);
+ _partsBoundsLocal.Add(bounds);
+ }
+
+ protected override void OnRemovePart(CombinedMeshPart part)
+ {
+ _partsBounds.RemoveAt(part.Index);
+ _partsBoundsLocal.RemoveAt(part.Index);
+ }
+
+ protected override void OnMeshUpdated()
+ {
+ Mesh mesh = _root.Mesh;
+ mesh.GetVertices(_vertices);
+ mesh.GetNormals(_normals);
+ mesh.GetTangents(_tangents);
+ Bounds = mesh.bounds;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshDataNativeArraysLW.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshDataNativeArraysLW.cs
new file mode 100644
index 0000000..939d022
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshDataNativeArraysLW.cs
@@ -0,0 +1,131 @@
+using System.Collections.Generic;
+using Unity.Collections;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class MeshDataNativeArraysLW : CombinedMeshDataInternal
+{
+ private CombinedMesh _root;
+
+ private NativeList<LightweightVertex> _vertices;
+
+ private NativeList<Bounds> _partsBounds;
+
+ private NativeArray<Bounds> _bounds;
+
+ private NativeList<LightweightVertex> _verticesLocal;
+
+ private NativeList<Bounds> _partsBoundsLocal;
+
+ private List<Vector3> _tempVertices;
+
+ private List<Vector3> _tempNormals;
+
+ private List<Vector4> _tempTangents;
+
+ private List<Vector2> _tempUV;
+
+ private List<Vector2> _tempUV2;
+
+ public NativeArray<LightweightVertex> Vertices => _vertices;
+
+ public NativeArray<Bounds> PartsBounds => _partsBounds;
+
+ public NativeArray<Bounds> Bounds => _bounds;
+
+ public NativeArray<LightweightVertex> VerticesLocal => _verticesLocal;
+
+ public NativeArray<Bounds> PartsBoundsLocal => _partsBoundsLocal;
+
+ public override Bounds GetBounds()
+ {
+ return _bounds[0];
+ }
+
+ public override Bounds GetBounds(CombinedMeshPart part)
+ {
+ return _partsBounds[part.Index];
+ }
+
+ public void ApplyDataToMesh()
+ {
+ Mesh mesh = _root.Mesh;
+ mesh.SetVertexBufferData(Vertices, 0, 0, _vertices.Length);
+ mesh.bounds = _bounds[0];
+ }
+
+ protected override void OnInitialized()
+ {
+ _root = base.Root;
+ VertexBufferUtil.ToLightweightBuffer(_root.Mesh);
+ _vertices = new NativeList<LightweightVertex>(Allocator.Persistent);
+ _partsBounds = new NativeList<Bounds>(Allocator.Persistent);
+ _bounds = new NativeArray<Bounds>(1, Allocator.Persistent);
+ _verticesLocal = new NativeList<LightweightVertex>(Allocator.Persistent);
+ _partsBoundsLocal = new NativeList<Bounds>(Allocator.Persistent);
+ _tempVertices = new List<Vector3>();
+ _tempNormals = new List<Vector3>();
+ _tempTangents = new List<Vector4>();
+ _tempUV = new List<Vector2>();
+ _tempUV2 = new List<Vector2>();
+ }
+
+ protected override void OnAddPart(CombinedMeshPart part, Mesh mesh, Matrix4x4 transform)
+ {
+ Bounds value = mesh.bounds;
+ Bounds value2 = value.Transform(transform);
+ _partsBounds.Add(in value2);
+ _partsBoundsLocal.Add(in value);
+ mesh.GetVertices(_tempVertices);
+ mesh.GetNormals(_tempNormals);
+ mesh.GetTangents(_tempTangents);
+ mesh.GetUVs(0, _tempUV);
+ mesh.GetUVs(1, _tempUV2);
+ int vertexCount = mesh.vertexCount;
+ for (int i = 0; i < vertexCount; i++)
+ {
+ LightweightVertex value3 = default(LightweightVertex);
+ value3.Position = _tempVertices[i];
+ value3.Normal = _tempNormals[i];
+ value3.Tangent = _tempTangents[i];
+ if (_tempUV.Count > 0)
+ {
+ value3.UV = _tempUV[i];
+ }
+ if (_tempUV2.Count > 0)
+ {
+ value3.UV2 = _tempUV2[i];
+ }
+ _verticesLocal.Add(in value3);
+ }
+ }
+
+ protected override void OnRemovePart(CombinedMeshPart part)
+ {
+ _partsBounds.RemoveAt(part.Index);
+ _verticesLocal.RemoveRange(part.VertexStart, part.VertexCount);
+ _partsBoundsLocal.RemoveAt(part.Index);
+ }
+
+ protected override void OnMeshUpdated()
+ {
+ Mesh mesh = _root.Mesh;
+ using (Mesh.MeshDataArray meshDataArray = Mesh.AcquireReadOnlyMeshData(mesh))
+ {
+ Mesh.MeshData meshData = meshDataArray[0];
+ _vertices.Clear();
+ _vertices.AddRange(meshData.GetVertexData<LightweightVertex>());
+ }
+ _bounds[0] = mesh.bounds;
+ }
+
+ protected override void OnDispose()
+ {
+ _vertices.Dispose();
+ _partsBounds.Dispose();
+ _bounds.Dispose();
+ _verticesLocal.Dispose();
+ _partsBoundsLocal.Dispose();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshDataNativeArraysSTD.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshDataNativeArraysSTD.cs
new file mode 100644
index 0000000..3063894
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshDataNativeArraysSTD.cs
@@ -0,0 +1,104 @@
+using Unity.Collections;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class MeshDataNativeArraysSTD : CombinedMeshDataInternal
+{
+ private CombinedMesh _root;
+
+ private NativeList<Vector3> _vertices;
+
+ private NativeList<Vector3> _normals;
+
+ private NativeList<Vector4> _tangents;
+
+ private NativeList<Bounds> _partsBounds;
+
+ private NativeList<Bounds> _partsBoundsLocal;
+
+ private NativeArray<Bounds> _bounds;
+
+ public NativeArray<Vector3> Vertices => _vertices;
+
+ public NativeArray<Vector3> Normals => _normals;
+
+ public NativeArray<Vector4> Tangents => _tangents;
+
+ public NativeArray<Bounds> PartsBounds => _partsBounds;
+
+ public NativeArray<Bounds> PartsBoundsLocal => _partsBoundsLocal;
+
+ public NativeArray<Bounds> Bounds => _bounds;
+
+ public override Bounds GetBounds()
+ {
+ return _bounds[0];
+ }
+
+ public override Bounds GetBounds(CombinedMeshPart part)
+ {
+ return _partsBounds[part.Index];
+ }
+
+ public void ApplyDataToMesh()
+ {
+ Mesh mesh = _root.Mesh;
+ mesh.SetVertices(Vertices);
+ mesh.SetNormals(Normals);
+ mesh.SetTangents(Tangents);
+ mesh.bounds = _bounds[0];
+ }
+
+ protected override void OnInitialized()
+ {
+ _root = base.Root;
+ _vertices = new NativeList<Vector3>(Allocator.Persistent);
+ _normals = new NativeList<Vector3>(Allocator.Persistent);
+ _tangents = new NativeList<Vector4>(Allocator.Persistent);
+ _partsBounds = new NativeList<Bounds>(Allocator.Persistent);
+ _partsBoundsLocal = new NativeList<Bounds>(Allocator.Persistent);
+ _bounds = new NativeArray<Bounds>(1, Allocator.Persistent);
+ }
+
+ protected override void OnAddPart(CombinedMeshPart part, Mesh mesh, Matrix4x4 transform)
+ {
+ Bounds value = mesh.bounds;
+ Bounds value2 = value.Transform(transform);
+ _partsBounds.Add(in value2);
+ _partsBoundsLocal.Add(in value);
+ }
+
+ protected override void OnRemovePart(CombinedMeshPart part)
+ {
+ _partsBounds.RemoveAt(part.Index);
+ _partsBoundsLocal.RemoveAt(part.Index);
+ }
+
+ protected override void OnMeshUpdated()
+ {
+ Mesh mesh = _root.Mesh;
+ int vertexCount = mesh.vertexCount;
+ _vertices.ResizeUninitialized(vertexCount);
+ _normals.ResizeUninitialized(vertexCount);
+ _tangents.ResizeUninitialized(vertexCount);
+ using (Mesh.MeshDataArray meshDataArray = Mesh.AcquireReadOnlyMeshData(mesh))
+ {
+ Mesh.MeshData meshData = meshDataArray[0];
+ meshData.GetVertices(_vertices);
+ meshData.GetNormals(_normals);
+ meshData.GetTangents(_tangents);
+ }
+ _bounds[0] = mesh.bounds;
+ }
+
+ protected override void OnDispose()
+ {
+ _vertices.Dispose();
+ _normals.Dispose();
+ _tangents.Dispose();
+ _partsBounds.Dispose();
+ _partsBoundsLocal.Dispose();
+ _bounds.Dispose();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshFusionSource.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshFusionSource.cs
new file mode 100644
index 0000000..555f9e8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshFusionSource.cs
@@ -0,0 +1,333 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+[DisallowMultipleComponent]
+public abstract class MeshFusionSource : MonoBehaviour
+{
+ private RuntimeMeshFusion _controller;
+
+ private int _combinedSourcesCount;
+
+ private int _failedSourcesCount;
+
+ private int _totalSourcesCount;
+
+ [field: SerializeField]
+ public SourceCombineStatus CombineStatus { get; private set; }
+
+ [field: SerializeField]
+ public int ControllerIndex { get; set; }
+
+ [field: SerializeField]
+ [field: HideInInspector]
+ public bool CombineAtStart { get; set; } = true;
+
+
+ [field: SerializeField]
+ [field: HideInInspector]
+ public CombineErrorStrategy CombineErrorStrategy { get; set; }
+
+ [field: SerializeField]
+ public AfterCombineAction AfterCombineAction { get; set; }
+
+ [field: SerializeField]
+ public bool IsIncompatible { get; private set; }
+
+ [field: SerializeField]
+ public string IncompatibilityReason { get; private set; }
+
+ [field: SerializeField]
+ public bool HasCombineErrors { get; private set; }
+
+ [field: SerializeField]
+ public string CombineErrors { get; private set; }
+
+ public event Action<MeshFusionSource, IEnumerable<ICombinedObjectPart>> onCombineFinished;
+
+ private void Reset()
+ {
+ CheckCompatibility();
+ }
+
+ private void Start()
+ {
+ if (CombineAtStart)
+ {
+ AssignToController();
+ }
+ }
+
+ private void OnDestroy()
+ {
+ Unfreeze();
+ }
+
+ public void Unfreeze()
+ {
+ if (CombineStatus == SourceCombineStatus.AssignedToController)
+ {
+ UnassignFromController();
+ }
+ ClearSourcesAndUnsubscribe();
+ }
+
+ public abstract bool TryGetBounds(ref Bounds bounds);
+
+ public bool CheckCompatibility()
+ {
+ try
+ {
+ string incompatibilityReason;
+ bool flag = CheckCompatibilityAndGetComponents(out incompatibilityReason);
+ IsIncompatible = !flag;
+ IncompatibilityReason = incompatibilityReason;
+ return flag;
+ }
+ catch (Exception ex)
+ {
+ IsIncompatible = true;
+ IncompatibilityReason += $"\n{ex.Message}{ex.StackTrace}";
+ return false;
+ }
+ }
+
+ public bool AssignToController()
+ {
+ try
+ {
+ if (CombineStatus != 0)
+ {
+ return false;
+ }
+ if (!CheckCompatibility())
+ {
+ return false;
+ }
+ _controller = RuntimeMeshFusion.FindByIndex(ControllerIndex);
+ if (_controller == null)
+ {
+ throw new NullReferenceException("RuntimeMeshFusion with index " + ControllerIndex + " not found");
+ }
+ CreateSourcesAndSubscribe();
+ HasCombineErrors = false;
+ CombineErrors = "";
+ _combinedSourcesCount = 0;
+ _failedSourcesCount = 0;
+ _totalSourcesCount = 0;
+ foreach (ICombineSource combineSource in GetCombineSources())
+ {
+ _totalSourcesCount++;
+ _controller.AddSource(combineSource);
+ }
+ CombineStatus = SourceCombineStatus.AssignedToController;
+ return true;
+ }
+ catch (Exception ex)
+ {
+ HasCombineErrors = true;
+ CombineErrors += $"\n{ex.Message}\n{ex.StackTrace}";
+ UnassignFromController();
+ CombineStatus = SourceCombineStatus.FailedToCombine;
+ return false;
+ }
+ }
+
+ public void UndoCombine()
+ {
+ try
+ {
+ foreach (ICombinedObjectPart combinedPart in GetCombinedParts())
+ {
+ combinedPart.Destroy();
+ }
+ foreach (ICombineSource combineSource in GetCombineSources())
+ {
+ combineSource.onCombined += delegate(ICombinedObject root, ICombinedObjectPart part)
+ {
+ part.Destroy();
+ };
+ }
+ UnassignFromController();
+ ClearSourcesAndUnsubscribe();
+ ClearParts();
+ _combinedSourcesCount = 0;
+ _failedSourcesCount = 0;
+ ToggleComponents(enabled: true);
+ CombineStatus = SourceCombineStatus.NotCombined;
+ }
+ catch (Exception ex)
+ {
+ HasCombineErrors = true;
+ CombineErrors += $"\n{ex.Message}\n{ex.StackTrace}";
+ CombineStatus = SourceCombineStatus.FailedToCombine;
+ }
+ }
+
+ private void CreateSourcesAndSubscribe()
+ {
+ CreateSources();
+ foreach (ICombineSource combineSource in GetCombineSources())
+ {
+ combineSource.onCombined += OnSourceCombinedHandler;
+ combineSource.onCombineError += OnCombineErrorHandler;
+ combineSource.onCombineFailed += OnFailedCombineSourceHandler;
+ }
+ }
+
+ private void ClearSourcesAndUnsubscribe()
+ {
+ foreach (ICombineSource combineSource in GetCombineSources())
+ {
+ combineSource.onCombined -= OnSourceCombinedHandler;
+ combineSource.onCombineError -= OnCombineErrorHandler;
+ combineSource.onCombineFailed -= OnFailedCombineSourceHandler;
+ }
+ ClearSources();
+ }
+
+ private void UnassignFromController()
+ {
+ if (_controller != null)
+ {
+ foreach (ICombineSource combineSource in GetCombineSources())
+ {
+ _controller.RemoveSource(combineSource);
+ }
+ }
+ _controller = null;
+ }
+
+ private void OnSourceCombinedHandler(ICombinedObject root, ICombinedObjectPart part)
+ {
+ CombineStatus = SourceCombineStatus.CombinedPartially;
+ _combinedSourcesCount++;
+ OnSourceCombinedInternal(root, part);
+ if (_combinedSourcesCount + _failedSourcesCount == _totalSourcesCount)
+ {
+ OnCombineFinishedHandler();
+ }
+ }
+
+ private void OnCombineErrorHandler(ICombinedObject root, string errorMessage)
+ {
+ HasCombineErrors = true;
+ CombineErrors = CombineErrors + errorMessage + "\n";
+ OnCombineErrorInternal(root, errorMessage);
+ if (CombineErrorStrategy == CombineErrorStrategy.UndoCombining)
+ {
+ UndoCombine();
+ }
+ }
+
+ private void OnFailedCombineSourceHandler(ICombinedObject root)
+ {
+ _failedSourcesCount++;
+ OnFailedCombineSourceInternal(root);
+ if (_combinedSourcesCount + _failedSourcesCount == _totalSourcesCount)
+ {
+ OnCombineFinishedHandler();
+ }
+ }
+
+ private void OnCombineFinishedHandler()
+ {
+ ClearSourcesAndUnsubscribe();
+ if (_combinedSourcesCount == _totalSourcesCount)
+ {
+ CombineStatus = SourceCombineStatus.Combined;
+ }
+ else if (_failedSourcesCount == _totalSourcesCount)
+ {
+ CombineStatus = SourceCombineStatus.FailedToCombine;
+ return;
+ }
+ OnCombineFinishedInternal();
+ this.onCombineFinished?.Invoke(this, GetCombinedParts());
+ if (AfterCombineAction == AfterCombineAction.DisableComponents)
+ {
+ ToggleComponents(enabled: false);
+ }
+ else if (AfterCombineAction == AfterCombineAction.DestroyGameObject)
+ {
+ UnityEngine.Object.Destroy(base.gameObject);
+ }
+ }
+
+ protected virtual void OnSourceCombinedInternal(ICombinedObject root, ICombinedObjectPart part)
+ {
+ }
+
+ protected virtual void OnCombineErrorInternal(ICombinedObject root, string errorMessage)
+ {
+ }
+
+ protected virtual void OnFailedCombineSourceInternal(ICombinedObject root)
+ {
+ }
+
+ protected virtual void OnCombineFinishedInternal()
+ {
+ }
+
+ protected bool CanCreateCombineSource(GameObject go, ref string incompatibilityReason, ref MeshRenderer renderer, ref MeshFilter filter, ref Mesh mesh)
+ {
+ if (renderer == null)
+ {
+ renderer = go.GetComponent<MeshRenderer>();
+ }
+ if (renderer == null)
+ {
+ incompatibilityReason = "MeshRenderer not found";
+ return false;
+ }
+ if (renderer.isPartOfStaticBatch)
+ {
+ incompatibilityReason = "MeshRenderer is PartOfStaticBatching\nDisable Static Batching";
+ return false;
+ }
+ if (filter == null)
+ {
+ filter = go.GetComponent<MeshFilter>();
+ }
+ if (filter == null)
+ {
+ incompatibilityReason = "MeshFilter not found";
+ return false;
+ }
+ mesh = filter.sharedMesh;
+ if (mesh == null)
+ {
+ incompatibilityReason = "Mesh not found";
+ return false;
+ }
+ if (!mesh.isReadable)
+ {
+ incompatibilityReason = "Mesh is not readable. Enable Read/Write in import settings";
+ return false;
+ }
+ if (mesh.subMeshCount != renderer.sharedMaterials.Length)
+ {
+ incompatibilityReason = "Submesh count and Materials count isn't equal";
+ return false;
+ }
+ incompatibilityReason = "";
+ return true;
+ }
+
+ protected abstract bool CheckCompatibilityAndGetComponents(out string incompatibilityReason);
+
+ protected abstract void CreateSources();
+
+ protected abstract void ClearSources();
+
+ protected abstract void ClearParts();
+
+ protected abstract IEnumerable<ICombineSource> GetCombineSources();
+
+ protected abstract IEnumerable<ICombinedObjectPart> GetCombinedParts();
+
+ protected abstract void ToggleComponents(bool enabled);
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshSeparatorSimple.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshSeparatorSimple.cs
new file mode 100644
index 0000000..6c79a16
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshSeparatorSimple.cs
@@ -0,0 +1,130 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Rendering;
+
+namespace NGS.MeshFusionPro;
+
+public class MeshSeparatorSimple
+{
+ private const int MAX_UV_CHANNELS = 4;
+
+ private static Dictionary<Mesh, Mesh[]> _meshToSubmeshes;
+
+ private static List<Vector3> _srcVertices;
+
+ private static List<Vector3> _srcNormals;
+
+ private static List<Vector4> _srcTangents;
+
+ private static List<Vector2> _srcUV;
+
+ private static List<int> _triangles;
+
+ private static List<Vector3> _vertices;
+
+ private static List<Vector3> _normals;
+
+ private static List<Vector4> _tangents;
+
+ private static List<Vector2> _uv;
+
+ static MeshSeparatorSimple()
+ {
+ _meshToSubmeshes = new Dictionary<Mesh, Mesh[]>();
+ _srcVertices = new List<Vector3>();
+ _srcNormals = new List<Vector3>();
+ _srcTangents = new List<Vector4>();
+ _srcUV = new List<Vector2>();
+ _triangles = new List<int>();
+ _vertices = new List<Vector3>();
+ _normals = new List<Vector3>();
+ _tangents = new List<Vector4>();
+ _uv = new List<Vector2>();
+ }
+
+ public Mesh GetSubmesh(Mesh source, int submesh)
+ {
+ if (!_meshToSubmeshes.TryGetValue(source, out var value))
+ {
+ value = Separate(source);
+ _meshToSubmeshes.Add(source, value);
+ }
+ return value[submesh];
+ }
+
+ private Mesh[] Separate(Mesh mesh)
+ {
+ int subMeshCount = mesh.subMeshCount;
+ Mesh[] array = new Mesh[subMeshCount];
+ CollectMeshData(mesh);
+ for (int i = 0; i < subMeshCount; i++)
+ {
+ array[i] = CreateFromSubmesh(mesh, i);
+ }
+ ClearData();
+ return array;
+ }
+
+ private void CollectMeshData(Mesh mesh)
+ {
+ mesh.GetVertices(_srcVertices);
+ mesh.GetNormals(_srcNormals);
+ mesh.GetTangents(_srcTangents);
+ }
+
+ private Mesh CreateFromSubmesh(Mesh mesh, int submesh)
+ {
+ SubMeshDescriptor subMesh = mesh.GetSubMesh(submesh);
+ Mesh mesh2 = new Mesh();
+ int indexCount = subMesh.indexCount;
+ int vertexCount = subMesh.vertexCount;
+ int firstVertex = subMesh.firstVertex;
+ int num = firstVertex + vertexCount;
+ _vertices.Clear();
+ _normals.Clear();
+ _tangents.Clear();
+ mesh.GetIndices(_triangles, submesh);
+ for (int i = firstVertex; i < num; i++)
+ {
+ _vertices.Add(_srcVertices[i]);
+ _normals.Add(_srcNormals[i]);
+ _tangents.Add(_srcTangents[i]);
+ }
+ for (int j = 0; j < indexCount; j++)
+ {
+ _triangles[j] -= firstVertex;
+ }
+ mesh2.SetVertices(_vertices);
+ mesh2.SetNormals(_normals);
+ mesh2.SetTangents(_tangents);
+ mesh2.SetTriangles(_triangles, 0, calculateBounds: false);
+ mesh2.bounds = subMesh.bounds;
+ for (int k = 0; k < 4; k++)
+ {
+ mesh.GetUVs(k, _srcUV);
+ if (_srcUV.Count != 0)
+ {
+ _uv.Clear();
+ for (int l = firstVertex; l < num; l++)
+ {
+ _uv.Add(_srcUV[l]);
+ }
+ mesh2.SetUVs(k, _uv);
+ }
+ }
+ return mesh2;
+ }
+
+ private void ClearData()
+ {
+ _srcVertices.Clear();
+ _srcNormals.Clear();
+ _srcTangents.Clear();
+ _srcUV.Clear();
+ _triangles.Clear();
+ _vertices.Clear();
+ _normals.Clear();
+ _tangents.Clear();
+ _uv.Clear();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshType.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshType.cs
new file mode 100644
index 0000000..63cafe1
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MeshType.cs
@@ -0,0 +1,7 @@
+namespace NGS.MeshFusionPro;
+
+public enum MeshType
+{
+ Standard,
+ Lightweight
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MoveMethod.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MoveMethod.cs
new file mode 100644
index 0000000..27d690f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/MoveMethod.cs
@@ -0,0 +1,7 @@
+namespace NGS.MeshFusionPro;
+
+public enum MoveMethod
+{
+ Simple,
+ Jobs
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ObjectsCombiner.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ObjectsCombiner.cs
new file mode 100644
index 0000000..6cf2299
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/ObjectsCombiner.cs
@@ -0,0 +1,155 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public abstract class ObjectsCombiner<TCombinedObject, TCombineSource> where TCombinedObject : ICombinedObject where TCombineSource : ICombineSource
+{
+ private List<TCombinedObject> _combinedObjects;
+
+ private List<TCombineSource> _sources;
+
+ private List<TCombineSource> _sourcesForCombine;
+
+ public IReadOnlyList<TCombinedObject> CombinedObjects => _combinedObjects;
+
+ public bool ContainSources => _sources.Count > 0;
+
+ public event Action<TCombinedObject> onCombinedObjectCreated;
+
+ protected ObjectsCombiner()
+ {
+ _sources = new List<TCombineSource>();
+ _combinedObjects = new List<TCombinedObject>();
+ _sourcesForCombine = new List<TCombineSource>();
+ }
+
+ public virtual void AddSource(TCombineSource source)
+ {
+ _sources.Add(source);
+ }
+
+ public void AddSources(IEnumerable<TCombineSource> sources)
+ {
+ foreach (TCombineSource source in sources)
+ {
+ AddSource(source);
+ }
+ }
+
+ public void RemoveSource(TCombineSource source)
+ {
+ _sources.Remove(source);
+ }
+
+ public void Combine()
+ {
+ if (_sources.Count != 0)
+ {
+ CleanEmptyData();
+ CombineInternal();
+ _sources.Clear();
+ }
+ }
+
+ private void CleanEmptyData()
+ {
+ int num = 0;
+ while (num < _combinedObjects.Count)
+ {
+ if (_combinedObjects[num] == null)
+ {
+ _combinedObjects.RemoveAt(num);
+ }
+ else
+ {
+ num++;
+ }
+ }
+ num = 0;
+ while (num < _sources.Count)
+ {
+ if (_sources[num] == null)
+ {
+ _sources.RemoveAt(num);
+ }
+ else
+ {
+ num++;
+ }
+ }
+ }
+
+ private void CombineInternal()
+ {
+ _sourcesForCombine.Clear();
+ int num = 0;
+ while (num <= _combinedObjects.Count && _sources.Count != 0)
+ {
+ bool flag = false;
+ TCombinedObject val;
+ if (num == _combinedObjects.Count)
+ {
+ try
+ {
+ val = CreateCombinedObject(_sources[0]);
+ _combinedObjects.Add(val);
+ flag = true;
+ }
+ catch (Exception ex)
+ {
+ Debug.Log("Unable to create CombinedObject : " + ex.Message + ex.StackTrace);
+ _sources.RemoveAt(0);
+ continue;
+ }
+ }
+ else
+ {
+ val = _combinedObjects[num];
+ }
+ CombinedObjectMatcher<TCombinedObject, TCombineSource> matcher = GetMatcher();
+ matcher.StartMatching(val);
+ int num2 = 0;
+ while (num2 < _sources.Count)
+ {
+ TCombineSource val2 = _sources[num2];
+ if (matcher.CanAddSource(val2))
+ {
+ _sourcesForCombine.Add(val2);
+ matcher.SourceAdded(val2);
+ _sources.RemoveAt(num2);
+ }
+ else
+ {
+ num2++;
+ }
+ }
+ if (_sourcesForCombine.Count > 0)
+ {
+ try
+ {
+ CombineSources(val, _sourcesForCombine);
+ _sourcesForCombine.Clear();
+ }
+ catch (Exception ex2)
+ {
+ Debug.Log("Unable to combine sources in ObjectsCombiner : " + ex2.Message + ex2.StackTrace);
+ _sourcesForCombine.Clear();
+ continue;
+ }
+ }
+ if (flag)
+ {
+ this.onCombinedObjectCreated?.Invoke(val);
+ }
+ num++;
+ }
+ }
+
+ protected abstract CombinedObjectMatcher<TCombinedObject, TCombineSource> GetMatcher();
+
+ protected abstract TCombinedObject CreateCombinedObject(TCombineSource source);
+
+ protected abstract void CombineSources(TCombinedObject root, IList<TCombineSource> sources);
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/PartMoveInfo.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/PartMoveInfo.cs
new file mode 100644
index 0000000..776f8ad
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/PartMoveInfo.cs
@@ -0,0 +1,16 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public struct PartMoveInfo
+{
+ public int partIndex;
+
+ public int vertexStart;
+
+ public int vertexCount;
+
+ public Matrix4x4 currentTransform;
+
+ public Matrix4x4 targetTransform;
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RendererHelper.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RendererHelper.cs
new file mode 100644
index 0000000..f513a90
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RendererHelper.cs
@@ -0,0 +1,20 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public static class RendererHelper
+{
+ private static List<Material> _materials;
+
+ static RendererHelper()
+ {
+ _materials = new List<Material>();
+ }
+
+ public static Material GetSharedMaterialWithoutAlloc(this Renderer renderer, int index)
+ {
+ renderer.GetSharedMaterials(_materials);
+ return _materials[index];
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RendererSettings.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RendererSettings.cs
new file mode 100644
index 0000000..8d29b8c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RendererSettings.cs
@@ -0,0 +1,43 @@
+using UnityEngine;
+using UnityEngine.Rendering;
+
+namespace NGS.MeshFusionPro;
+
+public struct RendererSettings
+{
+ public string tag;
+
+ public int layer;
+
+ public Material material;
+
+ public ShadowCastingMode shadowMode;
+
+ public bool receiveShadows;
+
+ public int lightmapIndex;
+
+ public int realtimeLightmapIndex;
+
+ public RendererSettings(Material material, ShadowCastingMode shadowMode = ShadowCastingMode.On, bool receiveShadows = true, int lightmapIndex = -1, int realtimeLightmapIndex = -1, string tag = "Untagged", int layer = 0)
+ {
+ this.material = material;
+ this.shadowMode = shadowMode;
+ this.receiveShadows = receiveShadows;
+ this.lightmapIndex = lightmapIndex;
+ this.realtimeLightmapIndex = realtimeLightmapIndex;
+ this.tag = tag;
+ this.layer = layer;
+ }
+
+ public RendererSettings(Renderer renderer, int materialIndex = 0)
+ {
+ material = renderer.GetSharedMaterialWithoutAlloc(materialIndex);
+ shadowMode = renderer.shadowCastingMode;
+ receiveShadows = renderer.receiveShadows;
+ lightmapIndex = renderer.lightmapIndex;
+ realtimeLightmapIndex = renderer.realtimeLightmapIndex;
+ tag = renderer.tag;
+ layer = renderer.gameObject.layer;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RigidbodyTrackingStrategy.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RigidbodyTrackingStrategy.cs
new file mode 100644
index 0000000..763f666
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RigidbodyTrackingStrategy.cs
@@ -0,0 +1,62 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class RigidbodyTrackingStrategy : ISourceTrackingStrategy
+{
+ private Rigidbody _rigidbody;
+
+ private Transform _transform;
+
+ private DynamicCombinedObjectPart[] _parts;
+
+ private float _velocityThreashold = 0.5f;
+
+ private float _angularVelocityThreashold = 0.3f;
+
+ public float VelocityThreashold
+ {
+ get
+ {
+ return _velocityThreashold;
+ }
+ set
+ {
+ _velocityThreashold = Mathf.Max(0f, value);
+ }
+ }
+
+ public float AngularVelocityThreashold
+ {
+ get
+ {
+ return _angularVelocityThreashold;
+ }
+ set
+ {
+ _angularVelocityThreashold = Mathf.Max(0f, value);
+ }
+ }
+
+ public RigidbodyTrackingStrategy(Rigidbody target, DynamicCombinedObjectPart[] parts)
+ {
+ _rigidbody = target;
+ _transform = target.transform;
+ _parts = parts;
+ }
+
+ public bool OnUpdate()
+ {
+ float magnitude = _rigidbody.velocity.magnitude;
+ float magnitude2 = _rigidbody.angularVelocity.magnitude;
+ if (magnitude > _velocityThreashold || magnitude2 > _angularVelocityThreashold)
+ {
+ for (int i = 0; i < _parts.Length; i++)
+ {
+ _parts[i].Move(_transform.localToWorldMatrix);
+ }
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RuntimeMeshFusion.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RuntimeMeshFusion.cs
new file mode 100644
index 0000000..38c811b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/RuntimeMeshFusion.cs
@@ -0,0 +1,197 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class RuntimeMeshFusion : MonoBehaviour
+{
+ private static List<RuntimeMeshFusion> _Instances;
+
+ [SerializeField]
+ [HideInInspector]
+ private int _controllerIndex;
+
+ [SerializeField]
+ [HideInInspector]
+ private bool _drawGizmo;
+
+ [SerializeField]
+ [HideInInspector]
+ private int _cellSize = 80;
+
+ [SerializeField]
+ [HideInInspector]
+ private int _maxVerticesPerObject = 40000;
+
+ [SerializeField]
+ [HideInInspector]
+ private MeshType _meshType;
+
+ [SerializeField]
+ [HideInInspector]
+ private MoveMethod _moveMethod = MoveMethod.Jobs;
+
+ private CombineTree _combineTree;
+
+ private bool _sourceAdded;
+
+ private BinaryTreeDrawer<ICombineSource> _treeDrawer;
+
+ public int ControllerIndex
+ {
+ get
+ {
+ return _controllerIndex;
+ }
+ set
+ {
+ if (!Application.isPlaying)
+ {
+ _controllerIndex = value;
+ }
+ }
+ }
+
+ public bool DrawGizmo
+ {
+ get
+ {
+ return _drawGizmo;
+ }
+ set
+ {
+ _drawGizmo = value;
+ }
+ }
+
+ public int CellSize
+ {
+ get
+ {
+ return _cellSize;
+ }
+ set
+ {
+ if (!Application.isPlaying)
+ {
+ _cellSize = Mathf.Max(1, value);
+ }
+ }
+ }
+
+ public int MaxVertices
+ {
+ get
+ {
+ return _maxVerticesPerObject;
+ }
+ set
+ {
+ if (!Application.isPlaying)
+ {
+ _maxVerticesPerObject = Mathf.Clamp(value, 500, 65000);
+ }
+ }
+ }
+
+ public MeshType MeshType
+ {
+ get
+ {
+ return _meshType;
+ }
+ set
+ {
+ if (!Application.isPlaying)
+ {
+ _meshType = value;
+ }
+ }
+ }
+
+ public MoveMethod MoveMethod
+ {
+ get
+ {
+ return _moveMethod;
+ }
+ set
+ {
+ if (!Application.isPlaying)
+ {
+ _moveMethod = value;
+ }
+ }
+ }
+
+ private void Awake()
+ {
+ if (_Instances == null)
+ {
+ _Instances = new List<RuntimeMeshFusion>();
+ }
+ _Instances.Add(this);
+ ICombinedMeshFactory factory = new CombinedMeshFactory(_meshType, CombineMethod.Simple, _moveMethod);
+ _combineTree = new CombineTree(factory, _cellSize, _maxVerticesPerObject);
+ _treeDrawer = new BinaryTreeDrawer<ICombineSource>();
+ Transform parent = new GameObject("CombinedObjects").transform;
+ _combineTree.onStaticCombinedObjectCreated += delegate(CombinedObject r)
+ {
+ r.transform.parent = parent;
+ };
+ _combineTree.onDynamicCombinedObjectCreated += delegate(DynamicCombinedObject r)
+ {
+ r.transform.parent = parent;
+ };
+ _combineTree.onCombinedLODGroupCreated += delegate(CombinedLODGroup r)
+ {
+ r.transform.parent = parent;
+ };
+ }
+
+ private void Update()
+ {
+ if (_sourceAdded)
+ {
+ _combineTree.Combine();
+ _sourceAdded = false;
+ }
+ }
+
+ private void OnDrawGizmos()
+ {
+ if (Application.isPlaying && _drawGizmo && _combineTree != null && _combineTree.Root != null)
+ {
+ _treeDrawer.DrawGizmo(_combineTree.Root, Color.white);
+ }
+ }
+
+ private void OnDestroy()
+ {
+ _Instances.Remove(this);
+ }
+
+ public static RuntimeMeshFusion FindByIndex(int index)
+ {
+ for (int i = 0; i < _Instances.Count; i++)
+ {
+ RuntimeMeshFusion runtimeMeshFusion = _Instances[i];
+ if (runtimeMeshFusion.ControllerIndex == index)
+ {
+ return runtimeMeshFusion;
+ }
+ }
+ throw new KeyNotFoundException("MeshFusionController with index : " + index + " not found");
+ }
+
+ public void AddSource(ICombineSource source)
+ {
+ _combineTree.Add(source);
+ _sourceAdded = true;
+ }
+
+ public void RemoveSource(ICombineSource source)
+ {
+ _combineTree.Remove(source);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleMeshMoverSTD.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleMeshMoverSTD.cs
new file mode 100644
index 0000000..5a56ec3
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleMeshMoverSTD.cs
@@ -0,0 +1,62 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class SimpleMeshMoverSTD : ICombinedMeshMover
+{
+ private MeshDataListsSTD _meshData;
+
+ public SimpleMeshMoverSTD(MeshDataListsSTD meshData)
+ {
+ _meshData = meshData;
+ }
+
+ public void MoveParts(IList<PartMoveInfo> moveInfos)
+ {
+ List<Vector3> vertices = _meshData.Vertices;
+ List<Vector3> normals = _meshData.Normals;
+ List<Vector4> tangents = _meshData.Tangents;
+ List<Bounds> partsBounds = _meshData.PartsBounds;
+ List<Bounds> partsBoundsLocal = _meshData.PartsBoundsLocal;
+ Bounds bounds = _meshData.GetBounds();
+ bounds.size = Vector3.zero;
+ for (int i = 0; i < moveInfos.Count; i++)
+ {
+ PartMoveInfo partMoveInfo = moveInfos[i];
+ int partIndex = partMoveInfo.partIndex;
+ int vertexStart = partMoveInfo.vertexStart;
+ int num = vertexStart + partMoveInfo.vertexCount;
+ Matrix4x4 targetTransform = partMoveInfo.targetTransform;
+ Matrix4x4 inverse = partMoveInfo.currentTransform.inverse;
+ for (int j = vertexStart; j < num; j++)
+ {
+ Vector3 point = vertices[j];
+ Vector3 vector = normals[j];
+ Vector4 vector2 = tangents[j];
+ float w = vector2.w;
+ point = inverse.MultiplyPoint3x4(point);
+ point = targetTransform.MultiplyPoint3x4(point);
+ vector = inverse.MultiplyVector(vector);
+ vector = targetTransform.MultiplyVector(vector);
+ vector2 = inverse.MultiplyVector(vector2);
+ vector2 = targetTransform.MultiplyVector(vector2);
+ vector2.w = w;
+ vertices[j] = point;
+ normals[j] = vector;
+ tangents[j] = vector2;
+ }
+ partsBounds[partIndex] = partsBoundsLocal[partIndex].Transform(targetTransform);
+ }
+ for (int k = 0; k < partsBounds.Count; k++)
+ {
+ bounds.Encapsulate(partsBounds[k]);
+ }
+ _meshData.Bounds = bounds;
+ }
+
+ public void ApplyData()
+ {
+ _meshData.ApplyDataToMesh();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleMovableMeshSTDFactory.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleMovableMeshSTDFactory.cs
new file mode 100644
index 0000000..3454e5e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleMovableMeshSTDFactory.cs
@@ -0,0 +1,18 @@
+namespace NGS.MeshFusionPro;
+
+public class SimpleMovableMeshSTDFactory : IMovableCombinedMeshFactory
+{
+ private IMeshToolsFactory _tools;
+
+ public SimpleMovableMeshSTDFactory(IMeshToolsFactory tools)
+ {
+ _tools = tools;
+ }
+
+ public CombinedMesh CreateMovableMesh(out ICombinedMeshMover mover)
+ {
+ CombinedMesh<MeshDataListsSTD> combinedMesh = new CombinedMesh<MeshDataListsSTD>(_tools.CreateMeshCombiner(), _tools.CreateMeshCutter());
+ mover = new SimpleMeshMoverSTD(combinedMesh.MeshDataInternal);
+ return combinedMesh;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleToolsLWFactory.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleToolsLWFactory.cs
new file mode 100644
index 0000000..cedbde2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleToolsLWFactory.cs
@@ -0,0 +1,14 @@
+namespace NGS.MeshFusionPro;
+
+public class SimpleToolsLWFactory : IMeshToolsFactory
+{
+ public IMeshCombiner CreateMeshCombiner()
+ {
+ return new MeshCombinerSimpleLW();
+ }
+
+ public IMeshCutter CreateMeshCutter()
+ {
+ return new MeshCutterSimpleLW();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleToolsSTDFactory.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleToolsSTDFactory.cs
new file mode 100644
index 0000000..ee1ce77
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SimpleToolsSTDFactory.cs
@@ -0,0 +1,14 @@
+namespace NGS.MeshFusionPro;
+
+public class SimpleToolsSTDFactory : IMeshToolsFactory
+{
+ public IMeshCombiner CreateMeshCombiner()
+ {
+ return new MeshCombinerSimpleSTD();
+ }
+
+ public IMeshCutter CreateMeshCutter()
+ {
+ return new MeshCutterSimpleSTD();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SourceCombineStatus.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SourceCombineStatus.cs
new file mode 100644
index 0000000..8aab0cd
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SourceCombineStatus.cs
@@ -0,0 +1,10 @@
+namespace NGS.MeshFusionPro;
+
+public enum SourceCombineStatus
+{
+ NotCombined,
+ AssignedToController,
+ CombinedPartially,
+ Combined,
+ FailedToCombine
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SourceTracker.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SourceTracker.cs
new file mode 100644
index 0000000..571d46d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/SourceTracker.cs
@@ -0,0 +1,161 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+[DisallowMultipleComponent]
+[RequireComponent(typeof(MeshFusionSource))]
+public class SourceTracker : MonoBehaviour
+{
+ [SerializeField]
+ private MeshFusionSource _source;
+
+ [SerializeField]
+ private bool _isDynamicObject;
+
+ [SerializeField]
+ private Rigidbody _rigidbody;
+
+ private IEnumerable<ICombinedObjectPart> _parts;
+
+ private ISourceTrackingStrategy _trackingStrategy;
+
+ private float _idleTime;
+
+ private Action _updateFunc;
+
+ public bool IsDynamicObject => _isDynamicObject;
+
+ [field: SerializeField]
+ public TrackingTarget TrackingTarget { get; set; }
+
+ [field: SerializeField]
+ public bool DisableWhenIdle { get; set; } = true;
+
+
+ [field: SerializeField]
+ [field: Min(0.01f)]
+ public float MaxIdleTime { get; set; } = 5f;
+
+
+ [field: SerializeField]
+ public bool WakeUpWhenCollision { get; set; } = true;
+
+
+ [field: SerializeField]
+ public bool TrackingDestroy { get; set; } = true;
+
+
+ public void WakeUp()
+ {
+ base.enabled = true;
+ _idleTime = 0f;
+ }
+
+ private void Reset()
+ {
+ _source = GetComponent<MeshFusionSource>();
+ _isDynamicObject = _source is DynamicMeshFusionSource;
+ if (TryGetComponent<Rigidbody>(out _rigidbody))
+ {
+ TrackingTarget = TrackingTarget.Rigidbody;
+ }
+ }
+
+ private void Awake()
+ {
+ if (_source == null)
+ {
+ _source = GetComponent<MeshFusionSource>();
+ _isDynamicObject = _source is DynamicMeshFusionSource;
+ }
+ _source.onCombineFinished += OnCombineFinished;
+ base.enabled = false;
+ }
+
+ private void Update()
+ {
+ try
+ {
+ _updateFunc?.Invoke();
+ }
+ catch
+ {
+ if (!_isDynamicObject)
+ {
+ base.enabled = false;
+ return;
+ }
+ throw;
+ }
+ }
+
+ private void OnCollisionEnter(Collision collision)
+ {
+ if (_isDynamicObject && WakeUpWhenCollision && _parts != null)
+ {
+ WakeUp();
+ }
+ }
+
+ private void OnDestroy()
+ {
+ if (!base.gameObject.scene.isLoaded || !TrackingDestroy || _parts == null)
+ {
+ return;
+ }
+ foreach (ICombinedObjectPart part in _parts)
+ {
+ if (part != null && part.Root != null)
+ {
+ part.Destroy();
+ }
+ }
+ }
+
+ private void OnCombineFinished(MeshFusionSource source, IEnumerable<ICombinedObjectPart> parts)
+ {
+ _parts = parts;
+ _source.onCombineFinished -= OnCombineFinished;
+ if (!_isDynamicObject)
+ {
+ return;
+ }
+ _updateFunc = UpdateMoveTracker;
+ if (TrackingTarget == TrackingTarget.Rigidbody && _rigidbody != null)
+ {
+ _trackingStrategy = new RigidbodyTrackingStrategy(_rigidbody, parts.Select((ICombinedObjectPart p) => (DynamicCombinedObjectPart)p).ToArray());
+ if (DisableWhenIdle)
+ {
+ _updateFunc = UpdateMoveTrackerAndCheckIdle;
+ }
+ }
+ else
+ {
+ _trackingStrategy = new TransformTrackingStrategy(base.transform, parts.Select((ICombinedObjectPart p) => (DynamicCombinedObjectPart)p).ToArray());
+ }
+ base.enabled = true;
+ }
+
+ private void UpdateMoveTracker()
+ {
+ _trackingStrategy.OnUpdate();
+ }
+
+ private void UpdateMoveTrackerAndCheckIdle()
+ {
+ if (_trackingStrategy.OnUpdate())
+ {
+ _idleTime = 0f;
+ return;
+ }
+ _idleTime += Time.deltaTime;
+ if (_idleTime > MaxIdleTime)
+ {
+ _idleTime = 0f;
+ base.enabled = false;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/StaticCombinedObjectMatcher.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/StaticCombinedObjectMatcher.cs
new file mode 100644
index 0000000..60ea49c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/StaticCombinedObjectMatcher.cs
@@ -0,0 +1,39 @@
+namespace NGS.MeshFusionPro;
+
+public class StaticCombinedObjectMatcher : CombinedObjectMatcher<CombinedObject, CombineSource>
+{
+ private RendererSettings _settings;
+
+ private int _vertexCount;
+
+ private int _vertexLimit;
+
+ public StaticCombinedObjectMatcher(int vertexLimit)
+ {
+ _vertexLimit = vertexLimit;
+ }
+
+ public override void StartMatching(CombinedObject combinedObject)
+ {
+ _settings = combinedObject.RendererSettings;
+ _vertexCount = combinedObject.VertexCount;
+ }
+
+ public override bool CanAddSource(CombineSource source)
+ {
+ if (!_settings.Equals(source.RendererSettings))
+ {
+ return false;
+ }
+ if (_vertexCount + source.CombineInfo.vertexCount > _vertexLimit)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public override void SourceAdded(CombineSource source)
+ {
+ _vertexCount += source.CombineInfo.vertexCount;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/StaticMeshFusionSource.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/StaticMeshFusionSource.cs
new file mode 100644
index 0000000..fbd86b3
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/StaticMeshFusionSource.cs
@@ -0,0 +1,131 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class StaticMeshFusionSource : MeshFusionSource
+{
+ [SerializeField]
+ [HideInInspector]
+ private MeshRenderer _renderer;
+
+ [SerializeField]
+ [HideInInspector]
+ private MeshFilter _filter;
+
+ [SerializeField]
+ [HideInInspector]
+ private Mesh _mesh;
+
+ private CombineSource[] _sources;
+
+ private CombinedObjectPart[] _parts;
+
+ public override bool TryGetBounds(ref Bounds bounds)
+ {
+ if (_renderer != null)
+ {
+ bounds = _renderer.bounds;
+ return true;
+ }
+ return false;
+ }
+
+ protected override void OnSourceCombinedInternal(ICombinedObject root, ICombinedObjectPart part)
+ {
+ for (int i = 0; i < _parts.Length; i++)
+ {
+ if (_parts[i] == null)
+ {
+ _parts[i] = (CombinedObjectPart)part;
+ return;
+ }
+ }
+ throw new Exception("Unexpected Behaviour");
+ }
+
+ protected override bool CheckCompatibilityAndGetComponents(out string incompatibilityReason)
+ {
+ incompatibilityReason = "";
+ return CanCreateCombineSource(base.gameObject, ref incompatibilityReason, ref _renderer, ref _filter, ref _mesh);
+ }
+
+ protected override void CreateSources()
+ {
+ if (_sources == null)
+ {
+ _sources = new CombineSource[_mesh.subMeshCount];
+ }
+ if (_parts == null)
+ {
+ _parts = new CombinedObjectPart[_mesh.subMeshCount];
+ }
+ for (int i = 0; i < _sources.Length; i++)
+ {
+ CombineSource combineSource = new CombineSource(_mesh, _renderer, i);
+ _sources[i] = combineSource;
+ }
+ }
+
+ protected override IEnumerable<ICombineSource> GetCombineSources()
+ {
+ if (_sources == null)
+ {
+ yield break;
+ }
+ for (int i = 0; i < _sources.Length; i++)
+ {
+ CombineSource combineSource = _sources[i];
+ if (combineSource == null)
+ {
+ break;
+ }
+ yield return combineSource;
+ }
+ }
+
+ protected override IEnumerable<ICombinedObjectPart> GetCombinedParts()
+ {
+ if (_parts == null)
+ {
+ yield break;
+ }
+ for (int i = 0; i < _parts.Length; i++)
+ {
+ CombinedObjectPart combinedObjectPart = _parts[i];
+ if (combinedObjectPart == null)
+ {
+ break;
+ }
+ yield return combinedObjectPart;
+ }
+ }
+
+ protected override void ClearSources()
+ {
+ if (_sources != null)
+ {
+ for (int i = 0; i < _sources.Length; i++)
+ {
+ _sources[i] = null;
+ }
+ }
+ }
+
+ protected override void ClearParts()
+ {
+ if (_parts != null)
+ {
+ for (int i = 0; i < _parts.Length; i++)
+ {
+ _parts[i] = null;
+ }
+ }
+ }
+
+ protected override void ToggleComponents(bool enabled)
+ {
+ _renderer.enabled = enabled;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/StaticObjectsCombiner.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/StaticObjectsCombiner.cs
new file mode 100644
index 0000000..e1cc19a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/StaticObjectsCombiner.cs
@@ -0,0 +1,42 @@
+using System.Collections.Generic;
+
+namespace NGS.MeshFusionPro;
+
+public class StaticObjectsCombiner : ObjectsCombiner<CombinedObject, CombineSource>
+{
+ private ICombinedMeshFactory _factory;
+
+ private StaticCombinedObjectMatcher _matcher;
+
+ private int _vertexLimit;
+
+ public StaticObjectsCombiner(ICombinedMeshFactory factory, int vertexLimit)
+ {
+ _factory = factory;
+ _matcher = new StaticCombinedObjectMatcher(vertexLimit);
+ _vertexLimit = vertexLimit;
+ }
+
+ public override void AddSource(CombineSource source)
+ {
+ if (source.CombineInfo.vertexCount < _vertexLimit)
+ {
+ base.AddSource(source);
+ }
+ }
+
+ protected override void CombineSources(CombinedObject root, IList<CombineSource> sources)
+ {
+ root.Combine(sources);
+ }
+
+ protected override CombinedObject CreateCombinedObject(CombineSource source)
+ {
+ return CombinedObject.Create(_factory, source.RendererSettings);
+ }
+
+ protected override CombinedObjectMatcher<CombinedObject, CombineSource> GetMatcher()
+ {
+ return _matcher;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/TrackingTarget.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/TrackingTarget.cs
new file mode 100644
index 0000000..3c2276b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/TrackingTarget.cs
@@ -0,0 +1,7 @@
+namespace NGS.MeshFusionPro;
+
+public enum TrackingTarget
+{
+ Transform,
+ Rigidbody
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/TransformTrackingStrategy.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/TransformTrackingStrategy.cs
new file mode 100644
index 0000000..2a5f282
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/TransformTrackingStrategy.cs
@@ -0,0 +1,30 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class TransformTrackingStrategy : ISourceTrackingStrategy
+{
+ private Transform _transform;
+
+ private DynamicCombinedObjectPart[] _parts;
+
+ public TransformTrackingStrategy(Transform target, DynamicCombinedObjectPart[] parts)
+ {
+ _transform = target;
+ _parts = parts;
+ }
+
+ public bool OnUpdate()
+ {
+ if (_transform.hasChanged)
+ {
+ for (int i = 0; i < _parts.Length; i++)
+ {
+ _parts[i].Move(_transform.localToWorldMatrix);
+ }
+ _transform.hasChanged = false;
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/UniversalObjectsCombiner.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/UniversalObjectsCombiner.cs
new file mode 100644
index 0000000..ae5189f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/UniversalObjectsCombiner.cs
@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+
+namespace NGS.MeshFusionPro;
+
+public class UniversalObjectsCombiner
+{
+ private StaticObjectsCombiner _staticCombiner;
+
+ private DynamicObjectsCombiner _dynamicCombiner;
+
+ private LODGroupsCombiner _lodCombiner;
+
+ public event Action<CombinedObject> onStaticCombinedObjectCreated;
+
+ public event Action<DynamicCombinedObject> onDynamicCombinedObjectCreated;
+
+ public event Action<CombinedLODGroup> onCombinedLODGroupCreated;
+
+ public UniversalObjectsCombiner(ICombinedMeshFactory factory, int vertexLimit)
+ {
+ _staticCombiner = new StaticObjectsCombiner(factory, vertexLimit);
+ _dynamicCombiner = new DynamicObjectsCombiner(factory, vertexLimit);
+ _lodCombiner = new LODGroupsCombiner(factory, vertexLimit);
+ _staticCombiner.onCombinedObjectCreated += delegate(CombinedObject r)
+ {
+ this.onStaticCombinedObjectCreated?.Invoke(r);
+ };
+ _dynamicCombiner.onCombinedObjectCreated += delegate(DynamicCombinedObject r)
+ {
+ this.onDynamicCombinedObjectCreated?.Invoke(r);
+ };
+ _lodCombiner.onCombinedObjectCreated += delegate(CombinedLODGroup r)
+ {
+ this.onCombinedLODGroupCreated?.Invoke(r);
+ };
+ }
+
+ public void AddSource(ICombineSource source)
+ {
+ if (source is CombineSource source2)
+ {
+ _staticCombiner.AddSource(source2);
+ return;
+ }
+ if (source is DynamicCombineSource source3)
+ {
+ _dynamicCombiner.AddSource(source3);
+ return;
+ }
+ if (source is LODGroupCombineSource source4)
+ {
+ _lodCombiner.AddSource(source4);
+ return;
+ }
+ throw new NotImplementedException("Unknown Combine Source");
+ }
+
+ public void AddSources(IEnumerable<ICombineSource> sources)
+ {
+ foreach (ICombineSource source in sources)
+ {
+ AddSource(source);
+ }
+ }
+
+ public void RemoveSource(ICombineSource source)
+ {
+ if (source is CombineSource source2)
+ {
+ _staticCombiner.RemoveSource(source2);
+ return;
+ }
+ if (source is DynamicCombineSource source3)
+ {
+ _dynamicCombiner.RemoveSource(source3);
+ return;
+ }
+ if (source is LODGroupCombineSource source4)
+ {
+ _lodCombiner.RemoveSource(source4);
+ return;
+ }
+ throw new NotImplementedException("Unknown Combine Source");
+ }
+
+ public void Combine()
+ {
+ if (_staticCombiner.ContainSources)
+ {
+ _staticCombiner.Combine();
+ }
+ if (_dynamicCombiner.ContainSources)
+ {
+ _dynamicCombiner.Combine();
+ }
+ if (_lodCombiner.ContainSources)
+ {
+ _lodCombiner.Combine();
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/VertexBufferUtil.cs b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/VertexBufferUtil.cs
new file mode 100644
index 0000000..e409ce5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/NGS.MeshFusionPro/VertexBufferUtil.cs
@@ -0,0 +1,124 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Rendering;
+
+namespace NGS.MeshFusionPro;
+
+public static class VertexBufferUtil
+{
+ private static readonly Dictionary<VertexAttribute, VertexAttributeDescriptor> StandardAttributesMap;
+
+ private static readonly VertexAttributeDescriptor[] LightweightAttributesLayout;
+
+ private static List<VertexAttributeDescriptor> _meshAttributes;
+
+ static VertexBufferUtil()
+ {
+ LightweightAttributesLayout = new VertexAttributeDescriptor[5]
+ {
+ new VertexAttributeDescriptor(VertexAttribute.Position, VertexAttributeFormat.Float32, 3, 0),
+ new VertexAttributeDescriptor(VertexAttribute.Normal, VertexAttributeFormat.SNorm8, 4),
+ new VertexAttributeDescriptor(VertexAttribute.Tangent, VertexAttributeFormat.SNorm8, 4),
+ new VertexAttributeDescriptor(VertexAttribute.TexCoord0, VertexAttributeFormat.Float16, 2),
+ new VertexAttributeDescriptor(VertexAttribute.TexCoord1, VertexAttributeFormat.Float16, 2)
+ };
+ StandardAttributesMap = new Dictionary<VertexAttribute, VertexAttributeDescriptor>
+ {
+ {
+ VertexAttribute.Position,
+ new VertexAttributeDescriptor(VertexAttribute.Position, VertexAttributeFormat.Float32, 3, 0)
+ },
+ {
+ VertexAttribute.Normal,
+ new VertexAttributeDescriptor(VertexAttribute.Normal)
+ },
+ {
+ VertexAttribute.Tangent,
+ new VertexAttributeDescriptor(VertexAttribute.Tangent, VertexAttributeFormat.Float32, 4)
+ },
+ {
+ VertexAttribute.TexCoord0,
+ new VertexAttributeDescriptor(VertexAttribute.TexCoord0, VertexAttributeFormat.Float32, 2)
+ },
+ {
+ VertexAttribute.TexCoord1,
+ new VertexAttributeDescriptor(VertexAttribute.TexCoord1, VertexAttributeFormat.Float32, 2)
+ },
+ {
+ VertexAttribute.TexCoord2,
+ new VertexAttributeDescriptor(VertexAttribute.TexCoord2, VertexAttributeFormat.Float32, 2)
+ },
+ {
+ VertexAttribute.TexCoord3,
+ new VertexAttributeDescriptor(VertexAttribute.TexCoord3, VertexAttributeFormat.Float32, 2)
+ }
+ };
+ _meshAttributes = new List<VertexAttributeDescriptor>();
+ }
+
+ public static bool IsStandardBuffer(Mesh mesh)
+ {
+ mesh.GetVertexAttributes(_meshAttributes);
+ for (int i = 0; i < _meshAttributes.Count; i++)
+ {
+ VertexAttributeDescriptor vertexAttributeDescriptor = _meshAttributes[i];
+ VertexAttributeDescriptor vertexAttributeDescriptor2 = StandardAttributesMap[vertexAttributeDescriptor.attribute];
+ if (vertexAttributeDescriptor.format != vertexAttributeDescriptor2.format)
+ {
+ return false;
+ }
+ if (vertexAttributeDescriptor.dimension != vertexAttributeDescriptor2.dimension)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static bool IsLightweightBuffer(Mesh mesh)
+ {
+ mesh.GetVertexAttributes(_meshAttributes);
+ if (_meshAttributes.Count != LightweightAttributesLayout.Length)
+ {
+ return false;
+ }
+ for (int i = 0; i < _meshAttributes.Count; i++)
+ {
+ VertexAttributeDescriptor vertexAttributeDescriptor = _meshAttributes[i];
+ VertexAttributeDescriptor vertexAttributeDescriptor2 = LightweightAttributesLayout[i];
+ if (vertexAttributeDescriptor.attribute != vertexAttributeDescriptor2.attribute)
+ {
+ return false;
+ }
+ if (vertexAttributeDescriptor.format != vertexAttributeDescriptor2.format)
+ {
+ return false;
+ }
+ if (vertexAttributeDescriptor.dimension != vertexAttributeDescriptor2.dimension)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static void ToStandardBuffer(Mesh mesh)
+ {
+ if (!IsStandardBuffer(mesh))
+ {
+ for (int i = 0; i < _meshAttributes.Count; i++)
+ {
+ _meshAttributes[i] = StandardAttributesMap[_meshAttributes[i].attribute];
+ }
+ mesh.SetVertexBufferParams(mesh.vertexCount, _meshAttributes.ToArray());
+ }
+ }
+
+ public static void ToLightweightBuffer(Mesh mesh)
+ {
+ if (!IsLightweightBuffer(mesh))
+ {
+ mesh.SetVertexBufferParams(mesh.vertexCount, LightweightAttributesLayout);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Properties/AssemblyInfo.cs b/Thronefall_v1.57/Thronefall/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..bbd7eef
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Properties/AssemblyInfo.cs
@@ -0,0 +1,5 @@
+using System.Diagnostics;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyVersion("0.0.0.0")]
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Data/UserDataStore_PlayerPrefs.cs b/Thronefall_v1.57/Thronefall/Rewired.Data/UserDataStore_PlayerPrefs.cs
new file mode 100644
index 0000000..b5a933b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Data/UserDataStore_PlayerPrefs.cs
@@ -0,0 +1,1358 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+using Rewired.Utils.Libraries.TinyJson;
+using UnityEngine;
+
+namespace Rewired.Data;
+
+public class UserDataStore_PlayerPrefs : UserDataStore
+{
+ private class ControllerAssignmentSaveInfo
+ {
+ public class PlayerInfo
+ {
+ public int id;
+
+ public bool hasKeyboard;
+
+ public bool hasMouse;
+
+ public JoystickInfo[] joysticks;
+
+ public int joystickCount
+ {
+ get
+ {
+ if (joysticks == null)
+ {
+ return 0;
+ }
+ return joysticks.Length;
+ }
+ }
+
+ public int IndexOfJoystick(int joystickId)
+ {
+ for (int i = 0; i < joystickCount; i++)
+ {
+ if (joysticks[i] != null && joysticks[i].id == joystickId)
+ {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ public bool ContainsJoystick(int joystickId)
+ {
+ return IndexOfJoystick(joystickId) >= 0;
+ }
+ }
+
+ public class JoystickInfo
+ {
+ public Guid instanceGuid;
+
+ public string hardwareIdentifier;
+
+ public int id;
+ }
+
+ public PlayerInfo[] players;
+
+ public int playerCount
+ {
+ get
+ {
+ if (players == null)
+ {
+ return 0;
+ }
+ return players.Length;
+ }
+ }
+
+ public ControllerAssignmentSaveInfo()
+ {
+ }
+
+ public ControllerAssignmentSaveInfo(int playerCount)
+ {
+ players = new PlayerInfo[playerCount];
+ for (int i = 0; i < playerCount; i++)
+ {
+ players[i] = new PlayerInfo();
+ }
+ }
+
+ public int IndexOfPlayer(int playerId)
+ {
+ for (int i = 0; i < playerCount; i++)
+ {
+ if (players[i] != null && players[i].id == playerId)
+ {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ public bool ContainsPlayer(int playerId)
+ {
+ return IndexOfPlayer(playerId) >= 0;
+ }
+ }
+
+ private class JoystickAssignmentHistoryInfo
+ {
+ public readonly Joystick joystick;
+
+ public readonly int oldJoystickId;
+
+ public JoystickAssignmentHistoryInfo(Joystick joystick, int oldJoystickId)
+ {
+ if (joystick == null)
+ {
+ throw new ArgumentNullException("joystick");
+ }
+ this.joystick = joystick;
+ this.oldJoystickId = oldJoystickId;
+ }
+ }
+
+ private const string thisScriptName = "UserDataStore_PlayerPrefs";
+
+ private const string logPrefix = "Rewired: ";
+
+ private const string editorLoadedMessage = "\n***IMPORTANT:*** Changes made to the Rewired Input Manager configuration after the last time XML data was saved WILL NOT be used because the loaded old saved data has overwritten these values. If you change something in the Rewired Input Manager such as a Joystick Map or Input Behavior settings, you will not see these changes reflected in the current configuration. Clear PlayerPrefs using the inspector option on the UserDataStore_PlayerPrefs component.";
+
+ private const string playerPrefsKeySuffix_controllerAssignments = "ControllerAssignments";
+
+ private const int controllerMapPPKeyVersion_original = 0;
+
+ private const int controllerMapPPKeyVersion_includeDuplicateJoystickIndex = 1;
+
+ private const int controllerMapPPKeyVersion_supportDisconnectedControllers = 2;
+
+ private const int controllerMapPPKeyVersion_includeFormatVersion = 2;
+
+ private const int controllerMapPPKeyVersion = 2;
+
+ [Tooltip("Should this script be used? If disabled, nothing will be saved or loaded.")]
+ [SerializeField]
+ private bool isEnabled = true;
+
+ [Tooltip("Should saved data be loaded on start?")]
+ [SerializeField]
+ private bool loadDataOnStart = true;
+
+ [Tooltip("Should Player Joystick assignments be saved and loaded? This is not totally reliable for all Joysticks on all platforms. Some platforms/input sources do not provide enough information to reliably save assignments from session to session and reboot to reboot.")]
+ [SerializeField]
+ private bool loadJoystickAssignments = true;
+
+ [Tooltip("Should Player Keyboard assignments be saved and loaded?")]
+ [SerializeField]
+ private bool loadKeyboardAssignments = true;
+
+ [Tooltip("Should Player Mouse assignments be saved and loaded?")]
+ [SerializeField]
+ private bool loadMouseAssignments = true;
+
+ [Tooltip("The PlayerPrefs key prefix. Change this to change how keys are stored in PlayerPrefs. Changing this will make saved data already stored with the old key no longer accessible.")]
+ [SerializeField]
+ private string playerPrefsKeyPrefix = "RewiredSaveData";
+
+ [NonSerialized]
+ private bool allowImpreciseJoystickAssignmentMatching = true;
+
+ [NonSerialized]
+ private bool deferredJoystickAssignmentLoadPending;
+
+ [NonSerialized]
+ private bool wasJoystickEverDetected;
+
+ [NonSerialized]
+ private List<int> __allActionIds;
+
+ [NonSerialized]
+ private string __allActionIdsString;
+
+ public bool IsEnabled
+ {
+ get
+ {
+ return isEnabled;
+ }
+ set
+ {
+ isEnabled = value;
+ }
+ }
+
+ public bool LoadDataOnStart
+ {
+ get
+ {
+ return loadDataOnStart;
+ }
+ set
+ {
+ loadDataOnStart = value;
+ }
+ }
+
+ public bool LoadJoystickAssignments
+ {
+ get
+ {
+ return loadJoystickAssignments;
+ }
+ set
+ {
+ loadJoystickAssignments = value;
+ }
+ }
+
+ public bool LoadKeyboardAssignments
+ {
+ get
+ {
+ return loadKeyboardAssignments;
+ }
+ set
+ {
+ loadKeyboardAssignments = value;
+ }
+ }
+
+ public bool LoadMouseAssignments
+ {
+ get
+ {
+ return loadMouseAssignments;
+ }
+ set
+ {
+ loadMouseAssignments = value;
+ }
+ }
+
+ public string PlayerPrefsKeyPrefix
+ {
+ get
+ {
+ return playerPrefsKeyPrefix;
+ }
+ set
+ {
+ playerPrefsKeyPrefix = value;
+ }
+ }
+
+ private string playerPrefsKey_controllerAssignments => string.Format("{0}_{1}", playerPrefsKeyPrefix, "ControllerAssignments");
+
+ private bool loadControllerAssignments
+ {
+ get
+ {
+ if (!loadKeyboardAssignments && !loadMouseAssignments)
+ {
+ return loadJoystickAssignments;
+ }
+ return true;
+ }
+ }
+
+ private List<int> allActionIds
+ {
+ get
+ {
+ if (__allActionIds != null)
+ {
+ return __allActionIds;
+ }
+ List<int> list = new List<int>();
+ IList<InputAction> actions = ReInput.mapping.Actions;
+ for (int i = 0; i < actions.Count; i++)
+ {
+ list.Add(actions[i].id);
+ }
+ __allActionIds = list;
+ return list;
+ }
+ }
+
+ private string allActionIdsString
+ {
+ get
+ {
+ if (!string.IsNullOrEmpty(__allActionIdsString))
+ {
+ return __allActionIdsString;
+ }
+ StringBuilder stringBuilder = new StringBuilder();
+ List<int> list = allActionIds;
+ for (int i = 0; i < list.Count; i++)
+ {
+ if (i > 0)
+ {
+ stringBuilder.Append(",");
+ }
+ stringBuilder.Append(list[i]);
+ }
+ __allActionIdsString = stringBuilder.ToString();
+ return __allActionIdsString;
+ }
+ }
+
+ public override void Save()
+ {
+ if (!isEnabled)
+ {
+ Debug.LogWarning("Rewired: UserDataStore_PlayerPrefs is disabled and will not save any data.", this);
+ }
+ else
+ {
+ SaveAll();
+ }
+ }
+
+ public override void SaveControllerData(int playerId, ControllerType controllerType, int controllerId)
+ {
+ if (!isEnabled)
+ {
+ Debug.LogWarning("Rewired: UserDataStore_PlayerPrefs is disabled and will not save any data.", this);
+ }
+ else
+ {
+ SaveControllerDataNow(playerId, controllerType, controllerId);
+ }
+ }
+
+ public override void SaveControllerData(ControllerType controllerType, int controllerId)
+ {
+ if (!isEnabled)
+ {
+ Debug.LogWarning("Rewired: UserDataStore_PlayerPrefs is disabled and will not save any data.", this);
+ }
+ else
+ {
+ SaveControllerDataNow(controllerType, controllerId);
+ }
+ }
+
+ public override void SavePlayerData(int playerId)
+ {
+ if (!isEnabled)
+ {
+ Debug.LogWarning("Rewired: UserDataStore_PlayerPrefs is disabled and will not save any data.", this);
+ }
+ else
+ {
+ SavePlayerDataNow(playerId);
+ }
+ }
+
+ public override void SaveInputBehavior(int playerId, int behaviorId)
+ {
+ if (!isEnabled)
+ {
+ Debug.LogWarning("Rewired: UserDataStore_PlayerPrefs is disabled and will not save any data.", this);
+ }
+ else
+ {
+ SaveInputBehaviorNow(playerId, behaviorId);
+ }
+ }
+
+ public override void Load()
+ {
+ if (!isEnabled)
+ {
+ Debug.LogWarning("Rewired: UserDataStore_PlayerPrefs is disabled and will not load any data.", this);
+ }
+ else
+ {
+ LoadAll();
+ }
+ }
+
+ public override void LoadControllerData(int playerId, ControllerType controllerType, int controllerId)
+ {
+ if (!isEnabled)
+ {
+ Debug.LogWarning("Rewired: UserDataStore_PlayerPrefs is disabled and will not load any data.", this);
+ }
+ else
+ {
+ LoadControllerDataNow(playerId, controllerType, controllerId);
+ }
+ }
+
+ public override void LoadControllerData(ControllerType controllerType, int controllerId)
+ {
+ if (!isEnabled)
+ {
+ Debug.LogWarning("Rewired: UserDataStore_PlayerPrefs is disabled and will not load any data.", this);
+ }
+ else
+ {
+ LoadControllerDataNow(controllerType, controllerId);
+ }
+ }
+
+ public override void LoadPlayerData(int playerId)
+ {
+ if (!isEnabled)
+ {
+ Debug.LogWarning("Rewired: UserDataStore_PlayerPrefs is disabled and will not load any data.", this);
+ }
+ else
+ {
+ LoadPlayerDataNow(playerId);
+ }
+ }
+
+ public override void LoadInputBehavior(int playerId, int behaviorId)
+ {
+ if (!isEnabled)
+ {
+ Debug.LogWarning("Rewired: UserDataStore_PlayerPrefs is disabled and will not load any data.", this);
+ }
+ else
+ {
+ LoadInputBehaviorNow(playerId, behaviorId);
+ }
+ }
+
+ protected override void OnInitialize()
+ {
+ if (loadDataOnStart)
+ {
+ Load();
+ if (loadControllerAssignments && ReInput.controllers.joystickCount > 0)
+ {
+ wasJoystickEverDetected = true;
+ SaveControllerAssignments();
+ }
+ }
+ }
+
+ protected override void OnControllerConnected(ControllerStatusChangedEventArgs args)
+ {
+ if (isEnabled && args.controllerType == ControllerType.Joystick)
+ {
+ LoadJoystickData(args.controllerId);
+ if (loadDataOnStart && loadJoystickAssignments && !wasJoystickEverDetected)
+ {
+ StartCoroutine(LoadJoystickAssignmentsDeferred());
+ }
+ if (loadJoystickAssignments && !deferredJoystickAssignmentLoadPending)
+ {
+ SaveControllerAssignments();
+ }
+ wasJoystickEverDetected = true;
+ }
+ }
+
+ protected override void OnControllerPreDisconnect(ControllerStatusChangedEventArgs args)
+ {
+ if (isEnabled && args.controllerType == ControllerType.Joystick)
+ {
+ SaveJoystickData(args.controllerId);
+ }
+ }
+
+ protected override void OnControllerDisconnected(ControllerStatusChangedEventArgs args)
+ {
+ if (isEnabled && loadControllerAssignments)
+ {
+ SaveControllerAssignments();
+ }
+ }
+
+ public override void SaveControllerMap(int playerId, ControllerMap controllerMap)
+ {
+ if (controllerMap != null)
+ {
+ Player player = ReInput.players.GetPlayer(playerId);
+ if (player != null)
+ {
+ SaveControllerMap(player, controllerMap);
+ }
+ }
+ }
+
+ public override ControllerMap LoadControllerMap(int playerId, ControllerIdentifier controllerIdentifier, int categoryId, int layoutId)
+ {
+ Player player = ReInput.players.GetPlayer(playerId);
+ if (player == null)
+ {
+ return null;
+ }
+ return LoadControllerMap(player, controllerIdentifier, categoryId, layoutId);
+ }
+
+ private int LoadAll()
+ {
+ int num = 0;
+ if (loadControllerAssignments && LoadControllerAssignmentsNow())
+ {
+ num++;
+ }
+ IList<Player> allPlayers = ReInput.players.AllPlayers;
+ for (int i = 0; i < allPlayers.Count; i++)
+ {
+ num += LoadPlayerDataNow(allPlayers[i]);
+ }
+ return num + LoadAllJoystickCalibrationData();
+ }
+
+ private int LoadPlayerDataNow(int playerId)
+ {
+ return LoadPlayerDataNow(ReInput.players.GetPlayer(playerId));
+ }
+
+ private int LoadPlayerDataNow(Player player)
+ {
+ if (player == null)
+ {
+ return 0;
+ }
+ int num = 0;
+ num += LoadInputBehaviors(player.id);
+ num += LoadControllerMaps(player.id, ControllerType.Keyboard, 0);
+ num += LoadControllerMaps(player.id, ControllerType.Mouse, 0);
+ foreach (Joystick joystick in player.controllers.Joysticks)
+ {
+ num += LoadControllerMaps(player.id, ControllerType.Joystick, joystick.id);
+ }
+ RefreshLayoutManager(player.id);
+ return num;
+ }
+
+ private int LoadAllJoystickCalibrationData()
+ {
+ int num = 0;
+ IList<Joystick> joysticks = ReInput.controllers.Joysticks;
+ for (int i = 0; i < joysticks.Count; i++)
+ {
+ num += LoadJoystickCalibrationData(joysticks[i]);
+ }
+ return num;
+ }
+
+ private int LoadJoystickCalibrationData(Joystick joystick)
+ {
+ if (joystick == null)
+ {
+ return 0;
+ }
+ if (!joystick.ImportCalibrationMapFromXmlString(GetJoystickCalibrationMapXml(joystick)))
+ {
+ return 0;
+ }
+ return 1;
+ }
+
+ private int LoadJoystickCalibrationData(int joystickId)
+ {
+ return LoadJoystickCalibrationData(ReInput.controllers.GetJoystick(joystickId));
+ }
+
+ private int LoadJoystickData(int joystickId)
+ {
+ int num = 0;
+ IList<Player> allPlayers = ReInput.players.AllPlayers;
+ for (int i = 0; i < allPlayers.Count; i++)
+ {
+ Player player = allPlayers[i];
+ if (player.controllers.ContainsController(ControllerType.Joystick, joystickId))
+ {
+ num += LoadControllerMaps(player.id, ControllerType.Joystick, joystickId);
+ RefreshLayoutManager(player.id);
+ }
+ }
+ return num + LoadJoystickCalibrationData(joystickId);
+ }
+
+ private int LoadControllerDataNow(int playerId, ControllerType controllerType, int controllerId)
+ {
+ int num = 0 + LoadControllerMaps(playerId, controllerType, controllerId);
+ RefreshLayoutManager(playerId);
+ return num + LoadControllerDataNow(controllerType, controllerId);
+ }
+
+ private int LoadControllerDataNow(ControllerType controllerType, int controllerId)
+ {
+ int num = 0;
+ if (controllerType == ControllerType.Joystick)
+ {
+ num += LoadJoystickCalibrationData(controllerId);
+ }
+ return num;
+ }
+
+ private int LoadControllerMaps(int playerId, ControllerType controllerType, int controllerId)
+ {
+ int num = 0;
+ Player player = ReInput.players.GetPlayer(playerId);
+ if (player == null)
+ {
+ return num;
+ }
+ Controller controller = ReInput.controllers.GetController(controllerType, controllerId);
+ if (controller == null)
+ {
+ return num;
+ }
+ IList<InputMapCategory> mapCategories = ReInput.mapping.MapCategories;
+ for (int i = 0; i < mapCategories.Count; i++)
+ {
+ InputMapCategory inputMapCategory = mapCategories[i];
+ if (!inputMapCategory.userAssignable)
+ {
+ continue;
+ }
+ IList<InputLayout> list = ReInput.mapping.MapLayouts(controller.type);
+ for (int j = 0; j < list.Count; j++)
+ {
+ InputLayout inputLayout = list[j];
+ ControllerMap controllerMap = LoadControllerMap(player, controller.identifier, inputMapCategory.id, inputLayout.id);
+ if (controllerMap != null)
+ {
+ player.controllers.maps.AddMap(controller, controllerMap);
+ num++;
+ }
+ }
+ }
+ return num;
+ }
+
+ private ControllerMap LoadControllerMap(Player player, ControllerIdentifier controllerIdentifier, int categoryId, int layoutId)
+ {
+ if (player == null)
+ {
+ return null;
+ }
+ string controllerMapXml = GetControllerMapXml(player, controllerIdentifier, categoryId, layoutId);
+ if (string.IsNullOrEmpty(controllerMapXml))
+ {
+ return null;
+ }
+ ControllerMap controllerMap = ControllerMap.CreateFromXml(controllerIdentifier.controllerType, controllerMapXml);
+ if (controllerMap == null)
+ {
+ return null;
+ }
+ List<int> controllerMapKnownActionIds = GetControllerMapKnownActionIds(player, controllerIdentifier, categoryId, layoutId);
+ AddDefaultMappingsForNewActions(controllerIdentifier, controllerMap, controllerMapKnownActionIds);
+ return controllerMap;
+ }
+
+ private int LoadInputBehaviors(int playerId)
+ {
+ Player player = ReInput.players.GetPlayer(playerId);
+ if (player == null)
+ {
+ return 0;
+ }
+ int num = 0;
+ IList<InputBehavior> inputBehaviors = ReInput.mapping.GetInputBehaviors(player.id);
+ for (int i = 0; i < inputBehaviors.Count; i++)
+ {
+ num += LoadInputBehaviorNow(player, inputBehaviors[i]);
+ }
+ return num;
+ }
+
+ private int LoadInputBehaviorNow(int playerId, int behaviorId)
+ {
+ Player player = ReInput.players.GetPlayer(playerId);
+ if (player == null)
+ {
+ return 0;
+ }
+ InputBehavior inputBehavior = ReInput.mapping.GetInputBehavior(playerId, behaviorId);
+ if (inputBehavior == null)
+ {
+ return 0;
+ }
+ return LoadInputBehaviorNow(player, inputBehavior);
+ }
+
+ private int LoadInputBehaviorNow(Player player, InputBehavior inputBehavior)
+ {
+ if (player == null || inputBehavior == null)
+ {
+ return 0;
+ }
+ string inputBehaviorXml = GetInputBehaviorXml(player, inputBehavior.id);
+ if (inputBehaviorXml == null || inputBehaviorXml == string.Empty)
+ {
+ return 0;
+ }
+ if (!inputBehavior.ImportXmlString(inputBehaviorXml))
+ {
+ return 0;
+ }
+ return 1;
+ }
+
+ private bool LoadControllerAssignmentsNow()
+ {
+ try
+ {
+ ControllerAssignmentSaveInfo controllerAssignmentSaveInfo = LoadControllerAssignmentData();
+ if (controllerAssignmentSaveInfo == null)
+ {
+ return false;
+ }
+ if (loadKeyboardAssignments || loadMouseAssignments)
+ {
+ LoadKeyboardAndMouseAssignmentsNow(controllerAssignmentSaveInfo);
+ }
+ if (loadJoystickAssignments)
+ {
+ LoadJoystickAssignmentsNow(controllerAssignmentSaveInfo);
+ }
+ }
+ catch
+ {
+ }
+ return true;
+ }
+
+ private bool LoadKeyboardAndMouseAssignmentsNow(ControllerAssignmentSaveInfo data)
+ {
+ try
+ {
+ if (data == null && (data = LoadControllerAssignmentData()) == null)
+ {
+ return false;
+ }
+ foreach (Player allPlayer in ReInput.players.AllPlayers)
+ {
+ if (data.ContainsPlayer(allPlayer.id))
+ {
+ ControllerAssignmentSaveInfo.PlayerInfo playerInfo = data.players[data.IndexOfPlayer(allPlayer.id)];
+ if (loadKeyboardAssignments)
+ {
+ allPlayer.controllers.hasKeyboard = playerInfo.hasKeyboard;
+ }
+ if (loadMouseAssignments)
+ {
+ allPlayer.controllers.hasMouse = playerInfo.hasMouse;
+ }
+ }
+ }
+ }
+ catch
+ {
+ }
+ return true;
+ }
+
+ private bool LoadJoystickAssignmentsNow(ControllerAssignmentSaveInfo data)
+ {
+ try
+ {
+ if (ReInput.controllers.joystickCount == 0)
+ {
+ return false;
+ }
+ if (data == null && (data = LoadControllerAssignmentData()) == null)
+ {
+ return false;
+ }
+ foreach (Player allPlayer in ReInput.players.AllPlayers)
+ {
+ allPlayer.controllers.ClearControllersOfType(ControllerType.Joystick);
+ }
+ List<JoystickAssignmentHistoryInfo> list = (loadJoystickAssignments ? new List<JoystickAssignmentHistoryInfo>() : null);
+ foreach (Player allPlayer2 in ReInput.players.AllPlayers)
+ {
+ if (!data.ContainsPlayer(allPlayer2.id))
+ {
+ continue;
+ }
+ ControllerAssignmentSaveInfo.PlayerInfo playerInfo = data.players[data.IndexOfPlayer(allPlayer2.id)];
+ for (int i = 0; i < playerInfo.joystickCount; i++)
+ {
+ ControllerAssignmentSaveInfo.JoystickInfo joystickInfo2 = playerInfo.joysticks[i];
+ if (joystickInfo2 == null)
+ {
+ continue;
+ }
+ Joystick joystick = FindJoystickPrecise(joystickInfo2);
+ if (joystick != null)
+ {
+ if (list.Find((JoystickAssignmentHistoryInfo x) => x.joystick == joystick) == null)
+ {
+ list.Add(new JoystickAssignmentHistoryInfo(joystick, joystickInfo2.id));
+ }
+ allPlayer2.controllers.AddController(joystick, removeFromOtherPlayers: false);
+ }
+ }
+ }
+ if (allowImpreciseJoystickAssignmentMatching)
+ {
+ foreach (Player allPlayer3 in ReInput.players.AllPlayers)
+ {
+ if (!data.ContainsPlayer(allPlayer3.id))
+ {
+ continue;
+ }
+ ControllerAssignmentSaveInfo.PlayerInfo playerInfo2 = data.players[data.IndexOfPlayer(allPlayer3.id)];
+ for (int j = 0; j < playerInfo2.joystickCount; j++)
+ {
+ ControllerAssignmentSaveInfo.JoystickInfo joystickInfo = playerInfo2.joysticks[j];
+ if (joystickInfo == null)
+ {
+ continue;
+ }
+ Joystick joystick2 = null;
+ int num = list.FindIndex((JoystickAssignmentHistoryInfo x) => x.oldJoystickId == joystickInfo.id);
+ if (num >= 0)
+ {
+ joystick2 = list[num].joystick;
+ }
+ else
+ {
+ if (!TryFindJoysticksImprecise(joystickInfo, out var matches))
+ {
+ continue;
+ }
+ foreach (Joystick match in matches)
+ {
+ if (list.Find((JoystickAssignmentHistoryInfo x) => x.joystick == match) == null)
+ {
+ joystick2 = match;
+ break;
+ }
+ }
+ if (joystick2 == null)
+ {
+ continue;
+ }
+ list.Add(new JoystickAssignmentHistoryInfo(joystick2, joystickInfo.id));
+ }
+ allPlayer3.controllers.AddController(joystick2, removeFromOtherPlayers: false);
+ }
+ }
+ }
+ }
+ catch
+ {
+ }
+ if (ReInput.configuration.autoAssignJoysticks)
+ {
+ ReInput.controllers.AutoAssignJoysticks();
+ }
+ return true;
+ }
+
+ private ControllerAssignmentSaveInfo LoadControllerAssignmentData()
+ {
+ try
+ {
+ if (!PlayerPrefs.HasKey(playerPrefsKey_controllerAssignments))
+ {
+ return null;
+ }
+ string @string = PlayerPrefs.GetString(playerPrefsKey_controllerAssignments);
+ if (string.IsNullOrEmpty(@string))
+ {
+ return null;
+ }
+ ControllerAssignmentSaveInfo controllerAssignmentSaveInfo = JsonParser.FromJson<ControllerAssignmentSaveInfo>(@string);
+ if (controllerAssignmentSaveInfo == null || controllerAssignmentSaveInfo.playerCount == 0)
+ {
+ return null;
+ }
+ return controllerAssignmentSaveInfo;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ private IEnumerator LoadJoystickAssignmentsDeferred()
+ {
+ deferredJoystickAssignmentLoadPending = true;
+ yield return new WaitForEndOfFrame();
+ if (ReInput.isReady)
+ {
+ LoadJoystickAssignmentsNow(null);
+ SaveControllerAssignments();
+ deferredJoystickAssignmentLoadPending = false;
+ }
+ }
+
+ private void SaveAll()
+ {
+ IList<Player> allPlayers = ReInput.players.AllPlayers;
+ for (int i = 0; i < allPlayers.Count; i++)
+ {
+ SavePlayerDataNow(allPlayers[i]);
+ }
+ SaveAllJoystickCalibrationData();
+ if (loadControllerAssignments)
+ {
+ SaveControllerAssignments();
+ }
+ PlayerPrefs.Save();
+ }
+
+ private void SavePlayerDataNow(int playerId)
+ {
+ SavePlayerDataNow(ReInput.players.GetPlayer(playerId));
+ PlayerPrefs.Save();
+ }
+
+ private void SavePlayerDataNow(Player player)
+ {
+ if (player != null)
+ {
+ PlayerSaveData saveData = player.GetSaveData(userAssignableMapsOnly: true);
+ SaveInputBehaviors(player, saveData);
+ SaveControllerMaps(player, saveData);
+ }
+ }
+
+ private void SaveAllJoystickCalibrationData()
+ {
+ IList<Joystick> joysticks = ReInput.controllers.Joysticks;
+ for (int i = 0; i < joysticks.Count; i++)
+ {
+ SaveJoystickCalibrationData(joysticks[i]);
+ }
+ }
+
+ private void SaveJoystickCalibrationData(int joystickId)
+ {
+ SaveJoystickCalibrationData(ReInput.controllers.GetJoystick(joystickId));
+ }
+
+ private void SaveJoystickCalibrationData(Joystick joystick)
+ {
+ if (joystick != null)
+ {
+ JoystickCalibrationMapSaveData calibrationMapSaveData = joystick.GetCalibrationMapSaveData();
+ PlayerPrefs.SetString(GetJoystickCalibrationMapPlayerPrefsKey(joystick), calibrationMapSaveData.map.ToXmlString());
+ }
+ }
+
+ private void SaveJoystickData(int joystickId)
+ {
+ IList<Player> allPlayers = ReInput.players.AllPlayers;
+ for (int i = 0; i < allPlayers.Count; i++)
+ {
+ Player player = allPlayers[i];
+ if (player.controllers.ContainsController(ControllerType.Joystick, joystickId))
+ {
+ SaveControllerMaps(player.id, ControllerType.Joystick, joystickId);
+ }
+ }
+ SaveJoystickCalibrationData(joystickId);
+ }
+
+ private void SaveControllerDataNow(int playerId, ControllerType controllerType, int controllerId)
+ {
+ SaveControllerMaps(playerId, controllerType, controllerId);
+ SaveControllerDataNow(controllerType, controllerId);
+ PlayerPrefs.Save();
+ }
+
+ private void SaveControllerDataNow(ControllerType controllerType, int controllerId)
+ {
+ if (controllerType == ControllerType.Joystick)
+ {
+ SaveJoystickCalibrationData(controllerId);
+ }
+ PlayerPrefs.Save();
+ }
+
+ private void SaveControllerMaps(Player player, PlayerSaveData playerSaveData)
+ {
+ foreach (ControllerMapSaveData allControllerMapSaveDatum in playerSaveData.AllControllerMapSaveData)
+ {
+ SaveControllerMap(player, allControllerMapSaveDatum.map);
+ }
+ }
+
+ private void SaveControllerMaps(int playerId, ControllerType controllerType, int controllerId)
+ {
+ Player player = ReInput.players.GetPlayer(playerId);
+ if (player == null || !player.controllers.ContainsController(controllerType, controllerId))
+ {
+ return;
+ }
+ ControllerMapSaveData[] mapSaveData = player.controllers.maps.GetMapSaveData(controllerType, controllerId, userAssignableMapsOnly: true);
+ if (mapSaveData != null)
+ {
+ for (int i = 0; i < mapSaveData.Length; i++)
+ {
+ SaveControllerMap(player, mapSaveData[i].map);
+ }
+ }
+ }
+
+ private void SaveControllerMap(Player player, ControllerMap controllerMap)
+ {
+ PlayerPrefs.SetString(GetControllerMapPlayerPrefsKey(player, controllerMap.controller.identifier, controllerMap.categoryId, controllerMap.layoutId, 2), controllerMap.ToXmlString());
+ PlayerPrefs.SetString(GetControllerMapKnownActionIdsPlayerPrefsKey(player, controllerMap.controller.identifier, controllerMap.categoryId, controllerMap.layoutId, 2), allActionIdsString);
+ }
+
+ private void SaveInputBehaviors(Player player, PlayerSaveData playerSaveData)
+ {
+ if (player != null)
+ {
+ InputBehavior[] inputBehaviors = playerSaveData.inputBehaviors;
+ for (int i = 0; i < inputBehaviors.Length; i++)
+ {
+ SaveInputBehaviorNow(player, inputBehaviors[i]);
+ }
+ }
+ }
+
+ private void SaveInputBehaviorNow(int playerId, int behaviorId)
+ {
+ Player player = ReInput.players.GetPlayer(playerId);
+ if (player != null)
+ {
+ InputBehavior inputBehavior = ReInput.mapping.GetInputBehavior(playerId, behaviorId);
+ if (inputBehavior != null)
+ {
+ SaveInputBehaviorNow(player, inputBehavior);
+ PlayerPrefs.Save();
+ }
+ }
+ }
+
+ private void SaveInputBehaviorNow(Player player, InputBehavior inputBehavior)
+ {
+ if (player != null && inputBehavior != null)
+ {
+ PlayerPrefs.SetString(GetInputBehaviorPlayerPrefsKey(player, inputBehavior.id), inputBehavior.ToXmlString());
+ }
+ }
+
+ private bool SaveControllerAssignments()
+ {
+ try
+ {
+ ControllerAssignmentSaveInfo controllerAssignmentSaveInfo = new ControllerAssignmentSaveInfo(ReInput.players.allPlayerCount);
+ for (int i = 0; i < ReInput.players.allPlayerCount; i++)
+ {
+ Player player = ReInput.players.AllPlayers[i];
+ ControllerAssignmentSaveInfo.PlayerInfo playerInfo = new ControllerAssignmentSaveInfo.PlayerInfo();
+ controllerAssignmentSaveInfo.players[i] = playerInfo;
+ playerInfo.id = player.id;
+ playerInfo.hasKeyboard = player.controllers.hasKeyboard;
+ playerInfo.hasMouse = player.controllers.hasMouse;
+ ControllerAssignmentSaveInfo.JoystickInfo[] array = (playerInfo.joysticks = new ControllerAssignmentSaveInfo.JoystickInfo[player.controllers.joystickCount]);
+ for (int j = 0; j < player.controllers.joystickCount; j++)
+ {
+ Joystick joystick = player.controllers.Joysticks[j];
+ ControllerAssignmentSaveInfo.JoystickInfo joystickInfo = new ControllerAssignmentSaveInfo.JoystickInfo();
+ joystickInfo.instanceGuid = joystick.deviceInstanceGuid;
+ joystickInfo.id = joystick.id;
+ joystickInfo.hardwareIdentifier = joystick.hardwareIdentifier;
+ array[j] = joystickInfo;
+ }
+ }
+ PlayerPrefs.SetString(playerPrefsKey_controllerAssignments, JsonWriter.ToJson(controllerAssignmentSaveInfo));
+ PlayerPrefs.Save();
+ }
+ catch
+ {
+ }
+ return true;
+ }
+
+ private bool ControllerAssignmentSaveDataExists()
+ {
+ if (!PlayerPrefs.HasKey(playerPrefsKey_controllerAssignments))
+ {
+ return false;
+ }
+ if (string.IsNullOrEmpty(PlayerPrefs.GetString(playerPrefsKey_controllerAssignments)))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ private string GetBasePlayerPrefsKey(Player player)
+ {
+ return playerPrefsKeyPrefix + "|playerName=" + player.name;
+ }
+
+ private string GetControllerMapPlayerPrefsKey(Player player, ControllerIdentifier controllerIdentifier, int categoryId, int layoutId, int ppKeyVersion)
+ {
+ return string.Concat(GetBasePlayerPrefsKey(player) + "|dataType=ControllerMap", GetControllerMapPlayerPrefsKeyCommonSuffix(player, controllerIdentifier, categoryId, layoutId, ppKeyVersion));
+ }
+
+ private string GetControllerMapKnownActionIdsPlayerPrefsKey(Player player, ControllerIdentifier controllerIdentifier, int categoryId, int layoutId, int ppKeyVersion)
+ {
+ return string.Concat(GetBasePlayerPrefsKey(player) + "|dataType=ControllerMap_KnownActionIds", GetControllerMapPlayerPrefsKeyCommonSuffix(player, controllerIdentifier, categoryId, layoutId, ppKeyVersion));
+ }
+
+ private static string GetControllerMapPlayerPrefsKeyCommonSuffix(Player player, ControllerIdentifier controllerIdentifier, int categoryId, int layoutId, int ppKeyVersion)
+ {
+ string text = "";
+ if (ppKeyVersion >= 2)
+ {
+ text = text + "|kv=" + ppKeyVersion;
+ }
+ text = text + "|controllerMapType=" + GetControllerMapType(controllerIdentifier.controllerType).Name;
+ text = text + "|categoryId=" + categoryId + "|layoutId=" + layoutId;
+ if (ppKeyVersion >= 2)
+ {
+ text = text + "|hardwareGuid=" + controllerIdentifier.hardwareTypeGuid.ToString();
+ if (controllerIdentifier.hardwareTypeGuid == Guid.Empty)
+ {
+ text = text + "|hardwareIdentifier=" + controllerIdentifier.hardwareIdentifier;
+ }
+ if (controllerIdentifier.controllerType == ControllerType.Joystick)
+ {
+ text = text + "|duplicate=" + GetDuplicateIndex(player, controllerIdentifier);
+ }
+ }
+ else
+ {
+ text = text + "|hardwareIdentifier=" + controllerIdentifier.hardwareIdentifier;
+ if (controllerIdentifier.controllerType == ControllerType.Joystick)
+ {
+ text = text + "|hardwareGuid=" + controllerIdentifier.hardwareTypeGuid.ToString();
+ if (ppKeyVersion >= 1)
+ {
+ text = text + "|duplicate=" + GetDuplicateIndex(player, controllerIdentifier);
+ }
+ }
+ }
+ return text;
+ }
+
+ private string GetJoystickCalibrationMapPlayerPrefsKey(Joystick joystick)
+ {
+ return string.Concat(string.Concat(string.Concat(playerPrefsKeyPrefix + "|dataType=CalibrationMap", "|controllerType=", joystick.type.ToString()), "|hardwareIdentifier=", joystick.hardwareIdentifier), "|hardwareGuid=", joystick.hardwareTypeGuid.ToString());
+ }
+
+ private string GetInputBehaviorPlayerPrefsKey(Player player, int inputBehaviorId)
+ {
+ return string.Concat(GetBasePlayerPrefsKey(player) + "|dataType=InputBehavior", "|id=", inputBehaviorId.ToString());
+ }
+
+ private string GetControllerMapXml(Player player, ControllerIdentifier controllerIdentifier, int categoryId, int layoutId)
+ {
+ for (int num = 2; num >= 0; num--)
+ {
+ string controllerMapPlayerPrefsKey = GetControllerMapPlayerPrefsKey(player, controllerIdentifier, categoryId, layoutId, num);
+ if (PlayerPrefs.HasKey(controllerMapPlayerPrefsKey))
+ {
+ return PlayerPrefs.GetString(controllerMapPlayerPrefsKey);
+ }
+ }
+ return null;
+ }
+
+ private List<int> GetControllerMapKnownActionIds(Player player, ControllerIdentifier controllerIdentifier, int categoryId, int layoutId)
+ {
+ List<int> list = new List<int>();
+ string key = null;
+ bool flag = false;
+ for (int num = 2; num >= 0; num--)
+ {
+ key = GetControllerMapKnownActionIdsPlayerPrefsKey(player, controllerIdentifier, categoryId, layoutId, num);
+ if (PlayerPrefs.HasKey(key))
+ {
+ flag = true;
+ break;
+ }
+ }
+ if (!flag)
+ {
+ return list;
+ }
+ string @string = PlayerPrefs.GetString(key);
+ if (string.IsNullOrEmpty(@string))
+ {
+ return list;
+ }
+ string[] array = @string.Split(',');
+ for (int i = 0; i < array.Length; i++)
+ {
+ if (!string.IsNullOrEmpty(array[i]) && int.TryParse(array[i], out var result))
+ {
+ list.Add(result);
+ }
+ }
+ return list;
+ }
+
+ private string GetJoystickCalibrationMapXml(Joystick joystick)
+ {
+ string joystickCalibrationMapPlayerPrefsKey = GetJoystickCalibrationMapPlayerPrefsKey(joystick);
+ if (!PlayerPrefs.HasKey(joystickCalibrationMapPlayerPrefsKey))
+ {
+ return string.Empty;
+ }
+ return PlayerPrefs.GetString(joystickCalibrationMapPlayerPrefsKey);
+ }
+
+ private string GetInputBehaviorXml(Player player, int id)
+ {
+ string inputBehaviorPlayerPrefsKey = GetInputBehaviorPlayerPrefsKey(player, id);
+ if (!PlayerPrefs.HasKey(inputBehaviorPlayerPrefsKey))
+ {
+ return string.Empty;
+ }
+ return PlayerPrefs.GetString(inputBehaviorPlayerPrefsKey);
+ }
+
+ private void AddDefaultMappingsForNewActions(ControllerIdentifier controllerIdentifier, ControllerMap controllerMap, List<int> knownActionIds)
+ {
+ if (controllerMap == null || knownActionIds == null || knownActionIds == null || knownActionIds.Count == 0)
+ {
+ return;
+ }
+ ControllerMap controllerMapInstance = ReInput.mapping.GetControllerMapInstance(controllerIdentifier, controllerMap.categoryId, controllerMap.layoutId);
+ if (controllerMapInstance == null)
+ {
+ return;
+ }
+ List<int> list = new List<int>();
+ foreach (int allActionId in allActionIds)
+ {
+ if (!knownActionIds.Contains(allActionId))
+ {
+ list.Add(allActionId);
+ }
+ }
+ if (list.Count == 0)
+ {
+ return;
+ }
+ foreach (ActionElementMap allMap in controllerMapInstance.AllMaps)
+ {
+ if (list.Contains(allMap.actionId) && !controllerMap.DoesElementAssignmentConflict(allMap))
+ {
+ ElementAssignment elementAssignment = new ElementAssignment(controllerMap.controllerType, allMap.elementType, allMap.elementIdentifierId, allMap.axisRange, allMap.keyCode, allMap.modifierKeyFlags, allMap.actionId, allMap.axisContribution, allMap.invert);
+ controllerMap.CreateElementMap(elementAssignment);
+ }
+ }
+ }
+
+ private Joystick FindJoystickPrecise(ControllerAssignmentSaveInfo.JoystickInfo joystickInfo)
+ {
+ if (joystickInfo == null)
+ {
+ return null;
+ }
+ if (joystickInfo.instanceGuid == Guid.Empty)
+ {
+ return null;
+ }
+ IList<Joystick> joysticks = ReInput.controllers.Joysticks;
+ for (int i = 0; i < joysticks.Count; i++)
+ {
+ if (joysticks[i].deviceInstanceGuid == joystickInfo.instanceGuid)
+ {
+ return joysticks[i];
+ }
+ }
+ return null;
+ }
+
+ private bool TryFindJoysticksImprecise(ControllerAssignmentSaveInfo.JoystickInfo joystickInfo, out List<Joystick> matches)
+ {
+ matches = null;
+ if (joystickInfo == null)
+ {
+ return false;
+ }
+ if (string.IsNullOrEmpty(joystickInfo.hardwareIdentifier))
+ {
+ return false;
+ }
+ IList<Joystick> joysticks = ReInput.controllers.Joysticks;
+ for (int i = 0; i < joysticks.Count; i++)
+ {
+ if (string.Equals(joysticks[i].hardwareIdentifier, joystickInfo.hardwareIdentifier, StringComparison.OrdinalIgnoreCase))
+ {
+ if (matches == null)
+ {
+ matches = new List<Joystick>();
+ }
+ matches.Add(joysticks[i]);
+ }
+ }
+ return matches != null;
+ }
+
+ private static int GetDuplicateIndex(Player player, ControllerIdentifier controllerIdentifier)
+ {
+ Controller controller = ReInput.controllers.GetController(controllerIdentifier);
+ if (controller == null)
+ {
+ return 0;
+ }
+ int num = 0;
+ foreach (Controller controller2 in player.controllers.Controllers)
+ {
+ if (controller2.type != controller.type)
+ {
+ continue;
+ }
+ bool flag = false;
+ if (controller.type == ControllerType.Joystick)
+ {
+ if ((controller2 as Joystick).hardwareTypeGuid != controller.hardwareTypeGuid)
+ {
+ continue;
+ }
+ if (controller.hardwareTypeGuid != Guid.Empty)
+ {
+ flag = true;
+ }
+ }
+ if (flag || !(controller2.hardwareIdentifier != controller.hardwareIdentifier))
+ {
+ if (controller2 == controller)
+ {
+ return num;
+ }
+ num++;
+ }
+ }
+ return num;
+ }
+
+ private void RefreshLayoutManager(int playerId)
+ {
+ ReInput.players.GetPlayer(playerId)?.controllers.maps.layoutManager.Apply();
+ }
+
+ private static Type GetControllerMapType(ControllerType controllerType)
+ {
+ switch (controllerType)
+ {
+ case ControllerType.Custom:
+ return typeof(CustomControllerMap);
+ case ControllerType.Joystick:
+ return typeof(JoystickMap);
+ case ControllerType.Keyboard:
+ return typeof(KeyboardMap);
+ case ControllerType.Mouse:
+ return typeof(MouseMap);
+ default:
+ Debug.LogWarning("Rewired: Unknown ControllerType " + controllerType);
+ return null;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos.GamepadTemplateUI/ControllerUIEffect.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos.GamepadTemplateUI/ControllerUIEffect.cs
new file mode 100644
index 0000000..695aa76
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos.GamepadTemplateUI/ControllerUIEffect.cs
@@ -0,0 +1,57 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Rewired.Demos.GamepadTemplateUI;
+
+[RequireComponent(typeof(Image))]
+public class ControllerUIEffect : MonoBehaviour
+{
+ [SerializeField]
+ private Color _highlightColor = Color.white;
+
+ private Image _image;
+
+ private Color _color;
+
+ private Color _origColor;
+
+ private bool _isActive;
+
+ private float _highlightAmount;
+
+ private void Awake()
+ {
+ _image = GetComponent<Image>();
+ _origColor = _image.color;
+ _color = _origColor;
+ }
+
+ public void Activate(float amount)
+ {
+ amount = Mathf.Clamp01(amount);
+ if (!_isActive || amount != _highlightAmount)
+ {
+ _highlightAmount = amount;
+ _color = Color.Lerp(_origColor, _highlightColor, _highlightAmount);
+ _isActive = true;
+ RedrawImage();
+ }
+ }
+
+ public void Deactivate()
+ {
+ if (_isActive)
+ {
+ _color = _origColor;
+ _highlightAmount = 0f;
+ _isActive = false;
+ RedrawImage();
+ }
+ }
+
+ private void RedrawImage()
+ {
+ _image.color = _color;
+ _image.enabled = _isActive;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos.GamepadTemplateUI/ControllerUIElement.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos.GamepadTemplateUI/ControllerUIElement.cs
new file mode 100644
index 0000000..b59e6f8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos.GamepadTemplateUI/ControllerUIElement.cs
@@ -0,0 +1,186 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Rewired.Demos.GamepadTemplateUI;
+
+[RequireComponent(typeof(Image))]
+public class ControllerUIElement : MonoBehaviour
+{
+ [SerializeField]
+ private Color _highlightColor = Color.white;
+
+ [SerializeField]
+ private ControllerUIEffect _positiveUIEffect;
+
+ [SerializeField]
+ private ControllerUIEffect _negativeUIEffect;
+
+ [SerializeField]
+ private Text _label;
+
+ [SerializeField]
+ private Text _positiveLabel;
+
+ [SerializeField]
+ private Text _negativeLabel;
+
+ [SerializeField]
+ private ControllerUIElement[] _childElements = new ControllerUIElement[0];
+
+ private Image _image;
+
+ private Color _color;
+
+ private Color _origColor;
+
+ private bool _isActive;
+
+ private float _highlightAmount;
+
+ private bool hasEffects
+ {
+ get
+ {
+ if (!(_positiveUIEffect != null))
+ {
+ return _negativeUIEffect != null;
+ }
+ return true;
+ }
+ }
+
+ private void Awake()
+ {
+ _image = GetComponent<Image>();
+ _origColor = _image.color;
+ _color = _origColor;
+ ClearLabels();
+ }
+
+ public void Activate(float amount)
+ {
+ amount = Mathf.Clamp(amount, -1f, 1f);
+ if (hasEffects)
+ {
+ if (amount < 0f && _negativeUIEffect != null)
+ {
+ _negativeUIEffect.Activate(Mathf.Abs(amount));
+ }
+ if (amount > 0f && _positiveUIEffect != null)
+ {
+ _positiveUIEffect.Activate(Mathf.Abs(amount));
+ }
+ }
+ else
+ {
+ if (_isActive && amount == _highlightAmount)
+ {
+ return;
+ }
+ _highlightAmount = amount;
+ _color = Color.Lerp(_origColor, _highlightColor, _highlightAmount);
+ }
+ _isActive = true;
+ RedrawImage();
+ if (_childElements.Length == 0)
+ {
+ return;
+ }
+ for (int i = 0; i < _childElements.Length; i++)
+ {
+ if (!(_childElements[i] == null))
+ {
+ _childElements[i].Activate(amount);
+ }
+ }
+ }
+
+ public void Deactivate()
+ {
+ if (!_isActive)
+ {
+ return;
+ }
+ _color = _origColor;
+ _highlightAmount = 0f;
+ if (_positiveUIEffect != null)
+ {
+ _positiveUIEffect.Deactivate();
+ }
+ if (_negativeUIEffect != null)
+ {
+ _negativeUIEffect.Deactivate();
+ }
+ _isActive = false;
+ RedrawImage();
+ if (_childElements.Length == 0)
+ {
+ return;
+ }
+ for (int i = 0; i < _childElements.Length; i++)
+ {
+ if (!(_childElements[i] == null))
+ {
+ _childElements[i].Deactivate();
+ }
+ }
+ }
+
+ public void SetLabel(string text, AxisRange labelType)
+ {
+ Text text2 = labelType switch
+ {
+ AxisRange.Full => _label,
+ AxisRange.Positive => _positiveLabel,
+ AxisRange.Negative => _negativeLabel,
+ _ => null,
+ };
+ if (text2 != null)
+ {
+ text2.text = text;
+ }
+ if (_childElements.Length == 0)
+ {
+ return;
+ }
+ for (int i = 0; i < _childElements.Length; i++)
+ {
+ if (!(_childElements[i] == null))
+ {
+ _childElements[i].SetLabel(text, labelType);
+ }
+ }
+ }
+
+ public void ClearLabels()
+ {
+ if (_label != null)
+ {
+ _label.text = string.Empty;
+ }
+ if (_positiveLabel != null)
+ {
+ _positiveLabel.text = string.Empty;
+ }
+ if (_negativeLabel != null)
+ {
+ _negativeLabel.text = string.Empty;
+ }
+ if (_childElements.Length == 0)
+ {
+ return;
+ }
+ for (int i = 0; i < _childElements.Length; i++)
+ {
+ if (!(_childElements[i] == null))
+ {
+ _childElements[i].ClearLabels();
+ }
+ }
+ }
+
+ private void RedrawImage()
+ {
+ _image.color = _color;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos.GamepadTemplateUI/GamepadTemplateUI.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos.GamepadTemplateUI/GamepadTemplateUI.cs
new file mode 100644
index 0000000..e56617c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos.GamepadTemplateUI/GamepadTemplateUI.cs
@@ -0,0 +1,417 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Rewired.Demos.GamepadTemplateUI;
+
+public class GamepadTemplateUI : MonoBehaviour
+{
+ private class Stick
+ {
+ private RectTransform _transform;
+
+ private Vector2 _origPosition;
+
+ private int _xAxisElementId = -1;
+
+ private int _yAxisElementId = -1;
+
+ public Vector2 position
+ {
+ get
+ {
+ if (!(_transform != null))
+ {
+ return Vector2.zero;
+ }
+ return _transform.anchoredPosition - _origPosition;
+ }
+ set
+ {
+ if (!(_transform == null))
+ {
+ _transform.anchoredPosition = _origPosition + value;
+ }
+ }
+ }
+
+ public Stick(RectTransform transform, int xAxisElementId, int yAxisElementId)
+ {
+ if (!(transform == null))
+ {
+ _transform = transform;
+ _origPosition = _transform.anchoredPosition;
+ _xAxisElementId = xAxisElementId;
+ _yAxisElementId = yAxisElementId;
+ }
+ }
+
+ public void Reset()
+ {
+ if (!(_transform == null))
+ {
+ _transform.anchoredPosition = _origPosition;
+ }
+ }
+
+ public bool ContainsElement(int elementId)
+ {
+ if (_transform == null)
+ {
+ return false;
+ }
+ if (elementId != _xAxisElementId)
+ {
+ return elementId == _yAxisElementId;
+ }
+ return true;
+ }
+
+ public void SetAxisPosition(int elementId, float value)
+ {
+ if (!(_transform == null))
+ {
+ Vector2 vector = position;
+ if (elementId == _xAxisElementId)
+ {
+ vector.x = value;
+ }
+ else if (elementId == _yAxisElementId)
+ {
+ vector.y = value;
+ }
+ position = vector;
+ }
+ }
+ }
+
+ private class UIElement
+ {
+ public int id;
+
+ public ControllerUIElement element;
+
+ public UIElement(int id, ControllerUIElement element)
+ {
+ this.id = id;
+ this.element = element;
+ }
+ }
+
+ private const float stickRadius = 20f;
+
+ public int playerId;
+
+ [SerializeField]
+ private RectTransform leftStick;
+
+ [SerializeField]
+ private RectTransform rightStick;
+
+ [SerializeField]
+ private ControllerUIElement leftStickX;
+
+ [SerializeField]
+ private ControllerUIElement leftStickY;
+
+ [SerializeField]
+ private ControllerUIElement leftStickButton;
+
+ [SerializeField]
+ private ControllerUIElement rightStickX;
+
+ [SerializeField]
+ private ControllerUIElement rightStickY;
+
+ [SerializeField]
+ private ControllerUIElement rightStickButton;
+
+ [SerializeField]
+ private ControllerUIElement actionBottomRow1;
+
+ [SerializeField]
+ private ControllerUIElement actionBottomRow2;
+
+ [SerializeField]
+ private ControllerUIElement actionBottomRow3;
+
+ [SerializeField]
+ private ControllerUIElement actionTopRow1;
+
+ [SerializeField]
+ private ControllerUIElement actionTopRow2;
+
+ [SerializeField]
+ private ControllerUIElement actionTopRow3;
+
+ [SerializeField]
+ private ControllerUIElement leftShoulder;
+
+ [SerializeField]
+ private ControllerUIElement leftTrigger;
+
+ [SerializeField]
+ private ControllerUIElement rightShoulder;
+
+ [SerializeField]
+ private ControllerUIElement rightTrigger;
+
+ [SerializeField]
+ private ControllerUIElement center1;
+
+ [SerializeField]
+ private ControllerUIElement center2;
+
+ [SerializeField]
+ private ControllerUIElement center3;
+
+ [SerializeField]
+ private ControllerUIElement dPadUp;
+
+ [SerializeField]
+ private ControllerUIElement dPadRight;
+
+ [SerializeField]
+ private ControllerUIElement dPadDown;
+
+ [SerializeField]
+ private ControllerUIElement dPadLeft;
+
+ private UIElement[] _uiElementsArray;
+
+ private Dictionary<int, ControllerUIElement> _uiElements = new Dictionary<int, ControllerUIElement>();
+
+ private IList<ControllerTemplateElementTarget> _tempTargetList = new List<ControllerTemplateElementTarget>(2);
+
+ private Stick[] _sticks;
+
+ private Player player => ReInput.players.GetPlayer(playerId);
+
+ private void Awake()
+ {
+ _uiElementsArray = new UIElement[23]
+ {
+ new UIElement(0, leftStickX),
+ new UIElement(1, leftStickY),
+ new UIElement(17, leftStickButton),
+ new UIElement(2, rightStickX),
+ new UIElement(3, rightStickY),
+ new UIElement(18, rightStickButton),
+ new UIElement(4, actionBottomRow1),
+ new UIElement(5, actionBottomRow2),
+ new UIElement(6, actionBottomRow3),
+ new UIElement(7, actionTopRow1),
+ new UIElement(8, actionTopRow2),
+ new UIElement(9, actionTopRow3),
+ new UIElement(14, center1),
+ new UIElement(15, center2),
+ new UIElement(16, center3),
+ new UIElement(19, dPadUp),
+ new UIElement(20, dPadRight),
+ new UIElement(21, dPadDown),
+ new UIElement(22, dPadLeft),
+ new UIElement(10, leftShoulder),
+ new UIElement(11, leftTrigger),
+ new UIElement(12, rightShoulder),
+ new UIElement(13, rightTrigger)
+ };
+ for (int i = 0; i < _uiElementsArray.Length; i++)
+ {
+ _uiElements.Add(_uiElementsArray[i].id, _uiElementsArray[i].element);
+ }
+ _sticks = new Stick[2]
+ {
+ new Stick(leftStick, 0, 1),
+ new Stick(rightStick, 2, 3)
+ };
+ ReInput.ControllerConnectedEvent += OnControllerConnected;
+ ReInput.ControllerDisconnectedEvent += OnControllerDisconnected;
+ }
+
+ private void Start()
+ {
+ if (ReInput.isReady)
+ {
+ DrawLabels();
+ }
+ }
+
+ private void OnDestroy()
+ {
+ ReInput.ControllerConnectedEvent -= OnControllerConnected;
+ ReInput.ControllerDisconnectedEvent -= OnControllerDisconnected;
+ }
+
+ private void Update()
+ {
+ if (ReInput.isReady)
+ {
+ DrawActiveElements();
+ }
+ }
+
+ private void DrawActiveElements()
+ {
+ for (int i = 0; i < _uiElementsArray.Length; i++)
+ {
+ _uiElementsArray[i].element.Deactivate();
+ }
+ for (int j = 0; j < _sticks.Length; j++)
+ {
+ _sticks[j].Reset();
+ }
+ IList<InputAction> actions = ReInput.mapping.Actions;
+ for (int k = 0; k < actions.Count; k++)
+ {
+ ActivateElements(player, actions[k].id);
+ }
+ }
+
+ private void ActivateElements(Player player, int actionId)
+ {
+ float axis = player.GetAxis(actionId);
+ if (axis == 0f)
+ {
+ return;
+ }
+ IList<InputActionSourceData> currentInputSources = player.GetCurrentInputSources(actionId);
+ for (int i = 0; i < currentInputSources.Count; i++)
+ {
+ InputActionSourceData inputActionSourceData = currentInputSources[i];
+ IGamepadTemplate template = inputActionSourceData.controller.GetTemplate<IGamepadTemplate>();
+ if (template == null)
+ {
+ continue;
+ }
+ template.GetElementTargets(inputActionSourceData.actionElementMap, _tempTargetList);
+ for (int j = 0; j < _tempTargetList.Count; j++)
+ {
+ ControllerTemplateElementTarget controllerTemplateElementTarget = _tempTargetList[j];
+ int id = controllerTemplateElementTarget.element.id;
+ ControllerUIElement controllerUIElement = _uiElements[id];
+ if (controllerTemplateElementTarget.elementType == ControllerTemplateElementType.Axis)
+ {
+ controllerUIElement.Activate(axis);
+ }
+ else if (controllerTemplateElementTarget.elementType == ControllerTemplateElementType.Button && (player.GetButton(actionId) || player.GetNegativeButton(actionId)))
+ {
+ controllerUIElement.Activate(1f);
+ }
+ GetStick(id)?.SetAxisPosition(id, axis * 20f);
+ }
+ }
+ }
+
+ private void DrawLabels()
+ {
+ for (int i = 0; i < _uiElementsArray.Length; i++)
+ {
+ _uiElementsArray[i].element.ClearLabels();
+ }
+ IList<InputAction> actions = ReInput.mapping.Actions;
+ for (int j = 0; j < actions.Count; j++)
+ {
+ DrawLabels(player, actions[j]);
+ }
+ }
+
+ private void DrawLabels(Player player, InputAction action)
+ {
+ Controller firstControllerWithTemplate = player.controllers.GetFirstControllerWithTemplate<IGamepadTemplate>();
+ if (firstControllerWithTemplate == null)
+ {
+ return;
+ }
+ IGamepadTemplate template = firstControllerWithTemplate.GetTemplate<IGamepadTemplate>();
+ ControllerMap map = player.controllers.maps.GetMap(firstControllerWithTemplate, "Default", "Default");
+ if (map != null)
+ {
+ for (int i = 0; i < _uiElementsArray.Length; i++)
+ {
+ ControllerUIElement element = _uiElementsArray[i].element;
+ int id = _uiElementsArray[i].id;
+ IControllerTemplateElement element2 = template.GetElement(id);
+ DrawLabel(element, action, map, template, element2);
+ }
+ }
+ }
+
+ private void DrawLabel(ControllerUIElement uiElement, InputAction action, ControllerMap controllerMap, IControllerTemplate template, IControllerTemplateElement element)
+ {
+ if (element.source == null)
+ {
+ return;
+ }
+ if (element.source.type == ControllerTemplateElementSourceType.Axis)
+ {
+ IControllerTemplateAxisSource controllerTemplateAxisSource = element.source as IControllerTemplateAxisSource;
+ ActionElementMap firstElementMapWithElementTarget;
+ if (controllerTemplateAxisSource.splitAxis)
+ {
+ firstElementMapWithElementTarget = controllerMap.GetFirstElementMapWithElementTarget(controllerTemplateAxisSource.positiveTarget, action.id, skipDisabledMaps: true);
+ if (firstElementMapWithElementTarget != null)
+ {
+ uiElement.SetLabel(firstElementMapWithElementTarget.actionDescriptiveName, AxisRange.Positive);
+ }
+ firstElementMapWithElementTarget = controllerMap.GetFirstElementMapWithElementTarget(controllerTemplateAxisSource.negativeTarget, action.id, skipDisabledMaps: true);
+ if (firstElementMapWithElementTarget != null)
+ {
+ uiElement.SetLabel(firstElementMapWithElementTarget.actionDescriptiveName, AxisRange.Negative);
+ }
+ return;
+ }
+ firstElementMapWithElementTarget = controllerMap.GetFirstElementMapWithElementTarget(controllerTemplateAxisSource.fullTarget, action.id, skipDisabledMaps: true);
+ if (firstElementMapWithElementTarget != null)
+ {
+ uiElement.SetLabel(firstElementMapWithElementTarget.actionDescriptiveName, AxisRange.Full);
+ return;
+ }
+ firstElementMapWithElementTarget = controllerMap.GetFirstElementMapWithElementTarget(new ControllerElementTarget(controllerTemplateAxisSource.fullTarget)
+ {
+ axisRange = AxisRange.Positive
+ }, action.id, skipDisabledMaps: true);
+ if (firstElementMapWithElementTarget != null)
+ {
+ uiElement.SetLabel(firstElementMapWithElementTarget.actionDescriptiveName, AxisRange.Positive);
+ }
+ firstElementMapWithElementTarget = controllerMap.GetFirstElementMapWithElementTarget(new ControllerElementTarget(controllerTemplateAxisSource.fullTarget)
+ {
+ axisRange = AxisRange.Negative
+ }, action.id, skipDisabledMaps: true);
+ if (firstElementMapWithElementTarget != null)
+ {
+ uiElement.SetLabel(firstElementMapWithElementTarget.actionDescriptiveName, AxisRange.Negative);
+ }
+ }
+ else if (element.source.type == ControllerTemplateElementSourceType.Button)
+ {
+ IControllerTemplateButtonSource controllerTemplateButtonSource = element.source as IControllerTemplateButtonSource;
+ ActionElementMap firstElementMapWithElementTarget = controllerMap.GetFirstElementMapWithElementTarget(controllerTemplateButtonSource.target, action.id, skipDisabledMaps: true);
+ if (firstElementMapWithElementTarget != null)
+ {
+ uiElement.SetLabel(firstElementMapWithElementTarget.actionDescriptiveName, AxisRange.Full);
+ }
+ }
+ }
+
+ private Stick GetStick(int elementId)
+ {
+ for (int i = 0; i < _sticks.Length; i++)
+ {
+ if (_sticks[i].ContainsElement(elementId))
+ {
+ return _sticks[i];
+ }
+ }
+ return null;
+ }
+
+ private void OnControllerConnected(ControllerStatusChangedEventArgs args)
+ {
+ DrawLabels();
+ }
+
+ private void OnControllerDisconnected(ControllerStatusChangedEventArgs args)
+ {
+ DrawLabels();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/Bullet.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/Bullet.cs
new file mode 100644
index 0000000..bb521c8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/Bullet.cs
@@ -0,0 +1,30 @@
+using UnityEngine;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+public class Bullet : MonoBehaviour
+{
+ public float lifeTime = 3f;
+
+ private bool die;
+
+ private float deathTime;
+
+ private void Start()
+ {
+ if (lifeTime > 0f)
+ {
+ deathTime = Time.time + lifeTime;
+ die = true;
+ }
+ }
+
+ private void Update()
+ {
+ if (die && Time.time >= deathTime)
+ {
+ Object.Destroy(base.gameObject);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/ControlRemappingDemo1.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/ControlRemappingDemo1.cs
new file mode 100644
index 0000000..b0e4f51
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/ControlRemappingDemo1.cs
@@ -0,0 +1,1797 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+public class ControlRemappingDemo1 : MonoBehaviour
+{
+ private class ControllerSelection
+ {
+ private int _id;
+
+ private int _idPrev;
+
+ private ControllerType _type;
+
+ private ControllerType _typePrev;
+
+ public int id
+ {
+ get
+ {
+ return _id;
+ }
+ set
+ {
+ _idPrev = _id;
+ _id = value;
+ }
+ }
+
+ public ControllerType type
+ {
+ get
+ {
+ return _type;
+ }
+ set
+ {
+ _typePrev = _type;
+ _type = value;
+ }
+ }
+
+ public int idPrev => _idPrev;
+
+ public ControllerType typePrev => _typePrev;
+
+ public bool hasSelection => _id >= 0;
+
+ public ControllerSelection()
+ {
+ Clear();
+ }
+
+ public void Set(int id, ControllerType type)
+ {
+ this.id = id;
+ this.type = type;
+ }
+
+ public void Clear()
+ {
+ _id = -1;
+ _idPrev = -1;
+ _type = ControllerType.Joystick;
+ _typePrev = ControllerType.Joystick;
+ }
+ }
+
+ private class DialogHelper
+ {
+ public enum DialogType
+ {
+ None = 0,
+ JoystickConflict = 1,
+ ElementConflict = 2,
+ KeyConflict = 3,
+ DeleteAssignmentConfirmation = 10,
+ AssignElement = 11
+ }
+
+ private const float openBusyDelay = 0.25f;
+
+ private const float closeBusyDelay = 0.1f;
+
+ private DialogType _type;
+
+ private bool _enabled;
+
+ private float _busyTime;
+
+ private bool _busyTimerRunning;
+
+ private Action<int> drawWindowDelegate;
+
+ private GUI.WindowFunction drawWindowFunction;
+
+ private WindowProperties windowProperties;
+
+ private int currentActionId;
+
+ private Action<int, UserResponse> resultCallback;
+
+ private float busyTimer
+ {
+ get
+ {
+ if (!_busyTimerRunning)
+ {
+ return 0f;
+ }
+ return _busyTime - Time.realtimeSinceStartup;
+ }
+ }
+
+ public bool enabled
+ {
+ get
+ {
+ return _enabled;
+ }
+ set
+ {
+ if (value)
+ {
+ if (_type != 0)
+ {
+ StateChanged(0.25f);
+ }
+ }
+ else
+ {
+ _enabled = value;
+ _type = DialogType.None;
+ StateChanged(0.1f);
+ }
+ }
+ }
+
+ public DialogType type
+ {
+ get
+ {
+ if (!_enabled)
+ {
+ return DialogType.None;
+ }
+ return _type;
+ }
+ set
+ {
+ if (value == DialogType.None)
+ {
+ _enabled = false;
+ StateChanged(0.1f);
+ }
+ else
+ {
+ _enabled = true;
+ StateChanged(0.25f);
+ }
+ _type = value;
+ }
+ }
+
+ public bool busy => _busyTimerRunning;
+
+ public DialogHelper()
+ {
+ drawWindowDelegate = DrawWindow;
+ drawWindowFunction = drawWindowDelegate.Invoke;
+ }
+
+ public void StartModal(int queueActionId, DialogType type, WindowProperties windowProperties, Action<int, UserResponse> resultCallback)
+ {
+ StartModal(queueActionId, type, windowProperties, resultCallback, -1f);
+ }
+
+ public void StartModal(int queueActionId, DialogType type, WindowProperties windowProperties, Action<int, UserResponse> resultCallback, float openBusyDelay)
+ {
+ currentActionId = queueActionId;
+ this.windowProperties = windowProperties;
+ this.type = type;
+ this.resultCallback = resultCallback;
+ if (openBusyDelay >= 0f)
+ {
+ StateChanged(openBusyDelay);
+ }
+ }
+
+ public void Update()
+ {
+ Draw();
+ UpdateTimers();
+ }
+
+ public void Draw()
+ {
+ if (_enabled)
+ {
+ bool flag = GUI.enabled;
+ GUI.enabled = true;
+ GUILayout.Window(windowProperties.windowId, windowProperties.rect, drawWindowFunction, windowProperties.title);
+ GUI.FocusWindow(windowProperties.windowId);
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ }
+ }
+
+ public void DrawConfirmButton()
+ {
+ DrawConfirmButton("Confirm");
+ }
+
+ public void DrawConfirmButton(string title)
+ {
+ bool flag = GUI.enabled;
+ if (busy)
+ {
+ GUI.enabled = false;
+ }
+ if (GUILayout.Button(title))
+ {
+ Confirm(UserResponse.Confirm);
+ }
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ }
+
+ public void DrawConfirmButton(UserResponse response)
+ {
+ DrawConfirmButton(response, "Confirm");
+ }
+
+ public void DrawConfirmButton(UserResponse response, string title)
+ {
+ bool flag = GUI.enabled;
+ if (busy)
+ {
+ GUI.enabled = false;
+ }
+ if (GUILayout.Button(title))
+ {
+ Confirm(response);
+ }
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ }
+
+ public void DrawCancelButton()
+ {
+ DrawCancelButton("Cancel");
+ }
+
+ public void DrawCancelButton(string title)
+ {
+ bool flag = GUI.enabled;
+ if (busy)
+ {
+ GUI.enabled = false;
+ }
+ if (GUILayout.Button(title))
+ {
+ Cancel();
+ }
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ }
+
+ public void Confirm()
+ {
+ Confirm(UserResponse.Confirm);
+ }
+
+ public void Confirm(UserResponse response)
+ {
+ resultCallback(currentActionId, response);
+ Close();
+ }
+
+ public void Cancel()
+ {
+ resultCallback(currentActionId, UserResponse.Cancel);
+ Close();
+ }
+
+ private void DrawWindow(int windowId)
+ {
+ windowProperties.windowDrawDelegate(windowProperties.title, windowProperties.message);
+ }
+
+ private void UpdateTimers()
+ {
+ if (_busyTimerRunning && busyTimer <= 0f)
+ {
+ _busyTimerRunning = false;
+ }
+ }
+
+ private void StartBusyTimer(float time)
+ {
+ _busyTime = time + Time.realtimeSinceStartup;
+ _busyTimerRunning = true;
+ }
+
+ private void Close()
+ {
+ Reset();
+ StateChanged(0.1f);
+ }
+
+ private void StateChanged(float delay)
+ {
+ StartBusyTimer(delay);
+ }
+
+ private void Reset()
+ {
+ _enabled = false;
+ _type = DialogType.None;
+ currentActionId = -1;
+ resultCallback = null;
+ }
+
+ private void ResetTimers()
+ {
+ _busyTimerRunning = false;
+ }
+
+ public void FullReset()
+ {
+ Reset();
+ ResetTimers();
+ }
+ }
+
+ private abstract class QueueEntry
+ {
+ public enum State
+ {
+ Waiting,
+ Confirmed,
+ Canceled
+ }
+
+ private static int uidCounter;
+
+ public int id { get; protected set; }
+
+ public QueueActionType queueActionType { get; protected set; }
+
+ public State state { get; protected set; }
+
+ public UserResponse response { get; protected set; }
+
+ protected static int nextId
+ {
+ get
+ {
+ int result = uidCounter;
+ uidCounter++;
+ return result;
+ }
+ }
+
+ public QueueEntry(QueueActionType queueActionType)
+ {
+ id = nextId;
+ this.queueActionType = queueActionType;
+ }
+
+ public void Confirm(UserResponse response)
+ {
+ state = State.Confirmed;
+ this.response = response;
+ }
+
+ public void Cancel()
+ {
+ state = State.Canceled;
+ }
+ }
+
+ private class JoystickAssignmentChange : QueueEntry
+ {
+ public int playerId { get; private set; }
+
+ public int joystickId { get; private set; }
+
+ public bool assign { get; private set; }
+
+ public JoystickAssignmentChange(int newPlayerId, int joystickId, bool assign)
+ : base(QueueActionType.JoystickAssignment)
+ {
+ playerId = newPlayerId;
+ this.joystickId = joystickId;
+ this.assign = assign;
+ }
+ }
+
+ private class ElementAssignmentChange : QueueEntry
+ {
+ public ElementAssignmentChangeType changeType { get; set; }
+
+ public InputMapper.Context context { get; private set; }
+
+ public ElementAssignmentChange(ElementAssignmentChangeType changeType, InputMapper.Context context)
+ : base(QueueActionType.ElementAssignment)
+ {
+ this.changeType = changeType;
+ this.context = context;
+ }
+
+ public ElementAssignmentChange(ElementAssignmentChange other)
+ : this(other.changeType, other.context.Clone())
+ {
+ }
+ }
+
+ private class FallbackJoystickIdentification : QueueEntry
+ {
+ public int joystickId { get; private set; }
+
+ public string joystickName { get; private set; }
+
+ public FallbackJoystickIdentification(int joystickId, string joystickName)
+ : base(QueueActionType.FallbackJoystickIdentification)
+ {
+ this.joystickId = joystickId;
+ this.joystickName = joystickName;
+ }
+ }
+
+ private class Calibration : QueueEntry
+ {
+ public int selectedElementIdentifierId;
+
+ public bool recording;
+
+ public Player player { get; private set; }
+
+ public ControllerType controllerType { get; private set; }
+
+ public Joystick joystick { get; private set; }
+
+ public CalibrationMap calibrationMap { get; private set; }
+
+ public Calibration(Player player, Joystick joystick, CalibrationMap calibrationMap)
+ : base(QueueActionType.Calibrate)
+ {
+ this.player = player;
+ this.joystick = joystick;
+ this.calibrationMap = calibrationMap;
+ selectedElementIdentifierId = -1;
+ }
+ }
+
+ private struct WindowProperties
+ {
+ public int windowId;
+
+ public Rect rect;
+
+ public Action<string, string> windowDrawDelegate;
+
+ public string title;
+
+ public string message;
+ }
+
+ private enum QueueActionType
+ {
+ None,
+ JoystickAssignment,
+ ElementAssignment,
+ FallbackJoystickIdentification,
+ Calibrate
+ }
+
+ private enum ElementAssignmentChangeType
+ {
+ Add,
+ Replace,
+ Remove,
+ ReassignOrRemove,
+ ConflictCheck
+ }
+
+ public enum UserResponse
+ {
+ Confirm,
+ Cancel,
+ Custom1,
+ Custom2
+ }
+
+ private const float defaultModalWidth = 250f;
+
+ private const float defaultModalHeight = 200f;
+
+ private const float assignmentTimeout = 5f;
+
+ private DialogHelper dialog;
+
+ private InputMapper inputMapper = new InputMapper();
+
+ private InputMapper.ConflictFoundEventData conflictFoundEventData;
+
+ private bool guiState;
+
+ private bool busy;
+
+ private bool pageGUIState;
+
+ private Player selectedPlayer;
+
+ private int selectedMapCategoryId;
+
+ private ControllerSelection selectedController;
+
+ private ControllerMap selectedMap;
+
+ private bool showMenu;
+
+ private bool startListening;
+
+ private Vector2 actionScrollPos;
+
+ private Vector2 calibrateScrollPos;
+
+ private Queue<QueueEntry> actionQueue;
+
+ private bool setupFinished;
+
+ [NonSerialized]
+ private bool initialized;
+
+ private bool isCompiling;
+
+ private GUIStyle style_wordWrap;
+
+ private GUIStyle style_centeredBox;
+
+ private void Awake()
+ {
+ inputMapper.options.timeout = 5f;
+ inputMapper.options.ignoreMouseXAxis = true;
+ inputMapper.options.ignoreMouseYAxis = true;
+ Initialize();
+ }
+
+ private void OnEnable()
+ {
+ Subscribe();
+ }
+
+ private void OnDisable()
+ {
+ Unsubscribe();
+ }
+
+ private void Initialize()
+ {
+ dialog = new DialogHelper();
+ actionQueue = new Queue<QueueEntry>();
+ selectedController = new ControllerSelection();
+ ReInput.ControllerConnectedEvent += JoystickConnected;
+ ReInput.ControllerPreDisconnectEvent += JoystickPreDisconnect;
+ ReInput.ControllerDisconnectedEvent += JoystickDisconnected;
+ ResetAll();
+ initialized = true;
+ ReInput.userDataStore.Load();
+ if (ReInput.unityJoystickIdentificationRequired)
+ {
+ IdentifyAllJoysticks();
+ }
+ }
+
+ private void Setup()
+ {
+ if (!setupFinished)
+ {
+ style_wordWrap = new GUIStyle(GUI.skin.label);
+ style_wordWrap.wordWrap = true;
+ style_centeredBox = new GUIStyle(GUI.skin.box);
+ style_centeredBox.alignment = TextAnchor.MiddleCenter;
+ setupFinished = true;
+ }
+ }
+
+ private void Subscribe()
+ {
+ Unsubscribe();
+ inputMapper.ConflictFoundEvent += OnConflictFound;
+ inputMapper.StoppedEvent += OnStopped;
+ }
+
+ private void Unsubscribe()
+ {
+ inputMapper.RemoveAllEventListeners();
+ }
+
+ public void OnGUI()
+ {
+ if (initialized)
+ {
+ Setup();
+ HandleMenuControl();
+ if (!showMenu)
+ {
+ DrawInitialScreen();
+ return;
+ }
+ SetGUIStateStart();
+ ProcessQueue();
+ DrawPage();
+ ShowDialog();
+ SetGUIStateEnd();
+ busy = false;
+ }
+ }
+
+ private void HandleMenuControl()
+ {
+ if (!dialog.enabled && Event.current.type == EventType.Layout && ReInput.players.GetSystemPlayer().GetButtonDown("Menu"))
+ {
+ if (showMenu)
+ {
+ ReInput.userDataStore.Save();
+ Close();
+ }
+ else
+ {
+ Open();
+ }
+ }
+ }
+
+ private void Close()
+ {
+ ClearWorkingVars();
+ showMenu = false;
+ }
+
+ private void Open()
+ {
+ showMenu = true;
+ }
+
+ private void DrawInitialScreen()
+ {
+ ActionElementMap firstElementMapWithAction = ReInput.players.GetSystemPlayer().controllers.maps.GetFirstElementMapWithAction("Menu", skipDisabledMaps: true);
+ GUIContent content = ((firstElementMapWithAction == null) ? new GUIContent("There is no element assigned to open the menu!") : new GUIContent("Press " + firstElementMapWithAction.elementIdentifierName + " to open the menu."));
+ GUILayout.BeginArea(GetScreenCenteredRect(300f, 50f));
+ GUILayout.Box(content, style_centeredBox, GUILayout.ExpandHeight(expand: true), GUILayout.ExpandWidth(expand: true));
+ GUILayout.EndArea();
+ }
+
+ private void DrawPage()
+ {
+ if (GUI.enabled != pageGUIState)
+ {
+ GUI.enabled = pageGUIState;
+ }
+ GUILayout.BeginArea(new Rect(((float)Screen.width - (float)Screen.width * 0.9f) * 0.5f, ((float)Screen.height - (float)Screen.height * 0.9f) * 0.5f, (float)Screen.width * 0.9f, (float)Screen.height * 0.9f));
+ DrawPlayerSelector();
+ DrawJoystickSelector();
+ DrawMouseAssignment();
+ DrawControllerSelector();
+ DrawCalibrateButton();
+ DrawMapCategories();
+ actionScrollPos = GUILayout.BeginScrollView(actionScrollPos);
+ DrawCategoryActions();
+ GUILayout.EndScrollView();
+ GUILayout.EndArea();
+ }
+
+ private void DrawPlayerSelector()
+ {
+ if (ReInput.players.allPlayerCount == 0)
+ {
+ GUILayout.Label("There are no players.");
+ return;
+ }
+ GUILayout.Space(15f);
+ GUILayout.Label("Players:");
+ GUILayout.BeginHorizontal();
+ foreach (Player player in ReInput.players.GetPlayers(includeSystemPlayer: true))
+ {
+ if (selectedPlayer == null)
+ {
+ selectedPlayer = player;
+ }
+ bool flag = ((player == selectedPlayer) ? true : false);
+ bool flag2 = GUILayout.Toggle(flag, (player.descriptiveName != string.Empty) ? player.descriptiveName : player.name, "Button", GUILayout.ExpandWidth(expand: false));
+ if (flag2 != flag && flag2)
+ {
+ selectedPlayer = player;
+ selectedController.Clear();
+ selectedMapCategoryId = -1;
+ }
+ }
+ GUILayout.EndHorizontal();
+ }
+
+ private void DrawMouseAssignment()
+ {
+ bool flag = GUI.enabled;
+ if (selectedPlayer == null)
+ {
+ GUI.enabled = false;
+ }
+ GUILayout.Space(15f);
+ GUILayout.Label("Assign Mouse:");
+ GUILayout.BeginHorizontal();
+ bool flag2 = ((selectedPlayer != null && selectedPlayer.controllers.hasMouse) ? true : false);
+ bool flag3 = GUILayout.Toggle(flag2, "Assign Mouse", "Button", GUILayout.ExpandWidth(expand: false));
+ if (flag3 != flag2)
+ {
+ if (flag3)
+ {
+ selectedPlayer.controllers.hasMouse = true;
+ foreach (Player player in ReInput.players.Players)
+ {
+ if (player != selectedPlayer)
+ {
+ player.controllers.hasMouse = false;
+ }
+ }
+ }
+ else
+ {
+ selectedPlayer.controllers.hasMouse = false;
+ }
+ }
+ GUILayout.EndHorizontal();
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ }
+
+ private void DrawJoystickSelector()
+ {
+ bool flag = GUI.enabled;
+ if (selectedPlayer == null)
+ {
+ GUI.enabled = false;
+ }
+ GUILayout.Space(15f);
+ GUILayout.Label("Assign Joysticks:");
+ GUILayout.BeginHorizontal();
+ bool flag2 = ((selectedPlayer == null || selectedPlayer.controllers.joystickCount == 0) ? true : false);
+ bool flag3 = GUILayout.Toggle(flag2, "None", "Button", GUILayout.ExpandWidth(expand: false));
+ if (flag3 != flag2)
+ {
+ selectedPlayer.controllers.ClearControllersOfType(ControllerType.Joystick);
+ ControllerSelectionChanged();
+ }
+ if (selectedPlayer != null)
+ {
+ foreach (Joystick joystick in ReInput.controllers.Joysticks)
+ {
+ flag2 = selectedPlayer.controllers.ContainsController(joystick);
+ flag3 = GUILayout.Toggle(flag2, joystick.name, "Button", GUILayout.ExpandWidth(expand: false));
+ if (flag3 != flag2)
+ {
+ EnqueueAction(new JoystickAssignmentChange(selectedPlayer.id, joystick.id, flag3));
+ }
+ }
+ }
+ GUILayout.EndHorizontal();
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ }
+
+ private void DrawControllerSelector()
+ {
+ if (selectedPlayer == null)
+ {
+ return;
+ }
+ bool flag = GUI.enabled;
+ GUILayout.Space(15f);
+ GUILayout.Label("Controller to Map:");
+ GUILayout.BeginHorizontal();
+ if (!selectedController.hasSelection)
+ {
+ selectedController.Set(0, ControllerType.Keyboard);
+ ControllerSelectionChanged();
+ }
+ bool flag2 = selectedController.type == ControllerType.Keyboard;
+ if (GUILayout.Toggle(flag2, "Keyboard", "Button", GUILayout.ExpandWidth(expand: false)) != flag2)
+ {
+ selectedController.Set(0, ControllerType.Keyboard);
+ ControllerSelectionChanged();
+ }
+ if (!selectedPlayer.controllers.hasMouse)
+ {
+ GUI.enabled = false;
+ }
+ flag2 = selectedController.type == ControllerType.Mouse;
+ if (GUILayout.Toggle(flag2, "Mouse", "Button", GUILayout.ExpandWidth(expand: false)) != flag2)
+ {
+ selectedController.Set(0, ControllerType.Mouse);
+ ControllerSelectionChanged();
+ }
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ foreach (Joystick joystick in selectedPlayer.controllers.Joysticks)
+ {
+ flag2 = selectedController.type == ControllerType.Joystick && selectedController.id == joystick.id;
+ if (GUILayout.Toggle(flag2, joystick.name, "Button", GUILayout.ExpandWidth(expand: false)) != flag2)
+ {
+ selectedController.Set(joystick.id, ControllerType.Joystick);
+ ControllerSelectionChanged();
+ }
+ }
+ GUILayout.EndHorizontal();
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ }
+
+ private void DrawCalibrateButton()
+ {
+ if (selectedPlayer == null)
+ {
+ return;
+ }
+ bool flag = GUI.enabled;
+ GUILayout.Space(10f);
+ Controller controller = (selectedController.hasSelection ? selectedPlayer.controllers.GetController(selectedController.type, selectedController.id) : null);
+ if (controller == null || selectedController.type != ControllerType.Joystick)
+ {
+ GUI.enabled = false;
+ GUILayout.Button("Select a controller to calibrate", GUILayout.ExpandWidth(expand: false));
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ }
+ else if (GUILayout.Button("Calibrate " + controller.name, GUILayout.ExpandWidth(expand: false)) && controller is Joystick joystick)
+ {
+ CalibrationMap calibrationMap = joystick.calibrationMap;
+ if (calibrationMap != null)
+ {
+ EnqueueAction(new Calibration(selectedPlayer, joystick, calibrationMap));
+ }
+ }
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ }
+
+ private void DrawMapCategories()
+ {
+ if (selectedPlayer == null || !selectedController.hasSelection)
+ {
+ return;
+ }
+ bool flag = GUI.enabled;
+ GUILayout.Space(15f);
+ GUILayout.Label("Categories:");
+ GUILayout.BeginHorizontal();
+ foreach (InputMapCategory userAssignableMapCategory in ReInput.mapping.UserAssignableMapCategories)
+ {
+ if (!selectedPlayer.controllers.maps.ContainsMapInCategory(selectedController.type, userAssignableMapCategory.id))
+ {
+ GUI.enabled = false;
+ }
+ else if (selectedMapCategoryId < 0)
+ {
+ selectedMapCategoryId = userAssignableMapCategory.id;
+ selectedMap = selectedPlayer.controllers.maps.GetFirstMapInCategory(selectedController.type, selectedController.id, userAssignableMapCategory.id);
+ }
+ bool flag2 = ((userAssignableMapCategory.id == selectedMapCategoryId) ? true : false);
+ if (GUILayout.Toggle(flag2, (userAssignableMapCategory.descriptiveName != string.Empty) ? userAssignableMapCategory.descriptiveName : userAssignableMapCategory.name, "Button", GUILayout.ExpandWidth(expand: false)) != flag2)
+ {
+ selectedMapCategoryId = userAssignableMapCategory.id;
+ selectedMap = selectedPlayer.controllers.maps.GetFirstMapInCategory(selectedController.type, selectedController.id, userAssignableMapCategory.id);
+ }
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ }
+ GUILayout.EndHorizontal();
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ }
+
+ private void DrawCategoryActions()
+ {
+ if (selectedPlayer == null || selectedMapCategoryId < 0)
+ {
+ return;
+ }
+ bool flag = GUI.enabled;
+ if (selectedMap == null)
+ {
+ return;
+ }
+ GUILayout.Space(15f);
+ GUILayout.Label("Actions:");
+ InputMapCategory mapCategory = ReInput.mapping.GetMapCategory(selectedMapCategoryId);
+ if (mapCategory == null)
+ {
+ return;
+ }
+ InputCategory actionCategory = ReInput.mapping.GetActionCategory(mapCategory.name);
+ if (actionCategory == null)
+ {
+ return;
+ }
+ float width = 150f;
+ foreach (InputAction item in ReInput.mapping.ActionsInCategory(actionCategory.id))
+ {
+ string text = ((item.descriptiveName != string.Empty) ? item.descriptiveName : item.name);
+ if (item.type == InputActionType.Button)
+ {
+ GUILayout.BeginHorizontal();
+ GUILayout.Label(text, GUILayout.Width(width));
+ DrawAddActionMapButton(selectedPlayer.id, item, AxisRange.Positive, selectedController, selectedMap);
+ foreach (ActionElementMap allMap in selectedMap.AllMaps)
+ {
+ if (allMap.actionId == item.id)
+ {
+ DrawActionAssignmentButton(selectedPlayer.id, item, AxisRange.Positive, selectedController, selectedMap, allMap);
+ }
+ }
+ GUILayout.EndHorizontal();
+ }
+ else
+ {
+ if (item.type != 0)
+ {
+ continue;
+ }
+ if (selectedController.type != 0)
+ {
+ GUILayout.BeginHorizontal();
+ GUILayout.Label(text, GUILayout.Width(width));
+ DrawAddActionMapButton(selectedPlayer.id, item, AxisRange.Full, selectedController, selectedMap);
+ foreach (ActionElementMap allMap2 in selectedMap.AllMaps)
+ {
+ if (allMap2.actionId == item.id && allMap2.elementType != ControllerElementType.Button && allMap2.axisType != AxisType.Split)
+ {
+ DrawActionAssignmentButton(selectedPlayer.id, item, AxisRange.Full, selectedController, selectedMap, allMap2);
+ DrawInvertButton(selectedPlayer.id, item, Pole.Positive, selectedController, selectedMap, allMap2);
+ }
+ }
+ GUILayout.EndHorizontal();
+ }
+ string text2 = ((item.positiveDescriptiveName != string.Empty) ? item.positiveDescriptiveName : (item.descriptiveName + " +"));
+ GUILayout.BeginHorizontal();
+ GUILayout.Label(text2, GUILayout.Width(width));
+ DrawAddActionMapButton(selectedPlayer.id, item, AxisRange.Positive, selectedController, selectedMap);
+ foreach (ActionElementMap allMap3 in selectedMap.AllMaps)
+ {
+ if (allMap3.actionId == item.id && allMap3.axisContribution == Pole.Positive && allMap3.axisType != AxisType.Normal)
+ {
+ DrawActionAssignmentButton(selectedPlayer.id, item, AxisRange.Positive, selectedController, selectedMap, allMap3);
+ }
+ }
+ GUILayout.EndHorizontal();
+ string text3 = ((item.negativeDescriptiveName != string.Empty) ? item.negativeDescriptiveName : (item.descriptiveName + " -"));
+ GUILayout.BeginHorizontal();
+ GUILayout.Label(text3, GUILayout.Width(width));
+ DrawAddActionMapButton(selectedPlayer.id, item, AxisRange.Negative, selectedController, selectedMap);
+ foreach (ActionElementMap allMap4 in selectedMap.AllMaps)
+ {
+ if (allMap4.actionId == item.id && allMap4.axisContribution == Pole.Negative && allMap4.axisType != AxisType.Normal)
+ {
+ DrawActionAssignmentButton(selectedPlayer.id, item, AxisRange.Negative, selectedController, selectedMap, allMap4);
+ }
+ }
+ GUILayout.EndHorizontal();
+ }
+ }
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ }
+
+ private void DrawActionAssignmentButton(int playerId, InputAction action, AxisRange actionRange, ControllerSelection controller, ControllerMap controllerMap, ActionElementMap elementMap)
+ {
+ if (GUILayout.Button(elementMap.elementIdentifierName, GUILayout.ExpandWidth(expand: false), GUILayout.MinWidth(30f)))
+ {
+ InputMapper.Context context = new InputMapper.Context
+ {
+ actionId = action.id,
+ actionRange = actionRange,
+ controllerMap = controllerMap,
+ actionElementMapToReplace = elementMap
+ };
+ EnqueueAction(new ElementAssignmentChange(ElementAssignmentChangeType.ReassignOrRemove, context));
+ startListening = true;
+ }
+ GUILayout.Space(4f);
+ }
+
+ private void DrawInvertButton(int playerId, InputAction action, Pole actionAxisContribution, ControllerSelection controller, ControllerMap controllerMap, ActionElementMap elementMap)
+ {
+ bool invert = elementMap.invert;
+ bool flag = GUILayout.Toggle(invert, "Invert", GUILayout.ExpandWidth(expand: false));
+ if (flag != invert)
+ {
+ elementMap.invert = flag;
+ }
+ GUILayout.Space(10f);
+ }
+
+ private void DrawAddActionMapButton(int playerId, InputAction action, AxisRange actionRange, ControllerSelection controller, ControllerMap controllerMap)
+ {
+ if (GUILayout.Button("Add...", GUILayout.ExpandWidth(expand: false)))
+ {
+ InputMapper.Context context = new InputMapper.Context
+ {
+ actionId = action.id,
+ actionRange = actionRange,
+ controllerMap = controllerMap
+ };
+ EnqueueAction(new ElementAssignmentChange(ElementAssignmentChangeType.Add, context));
+ startListening = true;
+ }
+ GUILayout.Space(10f);
+ }
+
+ private void ShowDialog()
+ {
+ dialog.Update();
+ }
+
+ private void DrawModalWindow(string title, string message)
+ {
+ if (dialog.enabled)
+ {
+ GUILayout.Space(5f);
+ GUILayout.Label(message, style_wordWrap);
+ GUILayout.FlexibleSpace();
+ GUILayout.BeginHorizontal();
+ dialog.DrawConfirmButton("Okay");
+ GUILayout.FlexibleSpace();
+ dialog.DrawCancelButton();
+ GUILayout.EndHorizontal();
+ }
+ }
+
+ private void DrawModalWindow_OkayOnly(string title, string message)
+ {
+ if (dialog.enabled)
+ {
+ GUILayout.Space(5f);
+ GUILayout.Label(message, style_wordWrap);
+ GUILayout.FlexibleSpace();
+ GUILayout.BeginHorizontal();
+ dialog.DrawConfirmButton("Okay");
+ GUILayout.EndHorizontal();
+ }
+ }
+
+ private void DrawElementAssignmentWindow(string title, string message)
+ {
+ if (!dialog.enabled)
+ {
+ return;
+ }
+ GUILayout.Space(5f);
+ GUILayout.Label(message, style_wordWrap);
+ GUILayout.FlexibleSpace();
+ if (!(actionQueue.Peek() is ElementAssignmentChange elementAssignmentChange))
+ {
+ dialog.Cancel();
+ return;
+ }
+ float num;
+ if (!dialog.busy)
+ {
+ if (startListening && inputMapper.status == InputMapper.Status.Idle)
+ {
+ inputMapper.Start(elementAssignmentChange.context);
+ startListening = false;
+ }
+ if (conflictFoundEventData != null)
+ {
+ dialog.Confirm();
+ return;
+ }
+ num = inputMapper.timeRemaining;
+ if (num == 0f)
+ {
+ dialog.Cancel();
+ return;
+ }
+ }
+ else
+ {
+ num = inputMapper.options.timeout;
+ }
+ GUILayout.Label("Assignment will be canceled in " + (int)Mathf.Ceil(num) + "...", style_wordWrap);
+ }
+
+ private void DrawElementAssignmentProtectedConflictWindow(string title, string message)
+ {
+ if (dialog.enabled)
+ {
+ GUILayout.Space(5f);
+ GUILayout.Label(message, style_wordWrap);
+ GUILayout.FlexibleSpace();
+ if (!(actionQueue.Peek() is ElementAssignmentChange))
+ {
+ dialog.Cancel();
+ return;
+ }
+ GUILayout.BeginHorizontal();
+ dialog.DrawConfirmButton(UserResponse.Custom1, "Add");
+ GUILayout.FlexibleSpace();
+ dialog.DrawCancelButton();
+ GUILayout.EndHorizontal();
+ }
+ }
+
+ private void DrawElementAssignmentNormalConflictWindow(string title, string message)
+ {
+ if (dialog.enabled)
+ {
+ GUILayout.Space(5f);
+ GUILayout.Label(message, style_wordWrap);
+ GUILayout.FlexibleSpace();
+ if (!(actionQueue.Peek() is ElementAssignmentChange))
+ {
+ dialog.Cancel();
+ return;
+ }
+ GUILayout.BeginHorizontal();
+ dialog.DrawConfirmButton(UserResponse.Confirm, "Replace");
+ GUILayout.FlexibleSpace();
+ dialog.DrawConfirmButton(UserResponse.Custom1, "Add");
+ GUILayout.FlexibleSpace();
+ dialog.DrawCancelButton();
+ GUILayout.EndHorizontal();
+ }
+ }
+
+ private void DrawReassignOrRemoveElementAssignmentWindow(string title, string message)
+ {
+ if (dialog.enabled)
+ {
+ GUILayout.Space(5f);
+ GUILayout.Label(message, style_wordWrap);
+ GUILayout.FlexibleSpace();
+ GUILayout.BeginHorizontal();
+ dialog.DrawConfirmButton("Reassign");
+ GUILayout.FlexibleSpace();
+ dialog.DrawCancelButton("Remove");
+ GUILayout.EndHorizontal();
+ }
+ }
+
+ private void DrawFallbackJoystickIdentificationWindow(string title, string message)
+ {
+ if (!dialog.enabled)
+ {
+ return;
+ }
+ if (!(actionQueue.Peek() is FallbackJoystickIdentification fallbackJoystickIdentification))
+ {
+ dialog.Cancel();
+ return;
+ }
+ GUILayout.Space(5f);
+ GUILayout.Label(message, style_wordWrap);
+ GUILayout.Label("Press any button or axis on \"" + fallbackJoystickIdentification.joystickName + "\" now.", style_wordWrap);
+ GUILayout.FlexibleSpace();
+ if (GUILayout.Button("Skip"))
+ {
+ dialog.Cancel();
+ }
+ else if (!dialog.busy && ReInput.controllers.SetUnityJoystickIdFromAnyButtonOrAxisPress(fallbackJoystickIdentification.joystickId, 0.8f, positiveAxesOnly: false))
+ {
+ dialog.Confirm();
+ }
+ }
+
+ private void DrawCalibrationWindow(string title, string message)
+ {
+ if (!dialog.enabled)
+ {
+ return;
+ }
+ if (!(actionQueue.Peek() is Calibration calibration))
+ {
+ dialog.Cancel();
+ return;
+ }
+ GUILayout.Space(5f);
+ GUILayout.Label(message, style_wordWrap);
+ GUILayout.Space(20f);
+ GUILayout.BeginHorizontal();
+ bool flag = GUI.enabled;
+ GUILayout.BeginVertical(GUILayout.Width(200f));
+ calibrateScrollPos = GUILayout.BeginScrollView(calibrateScrollPos);
+ if (calibration.recording)
+ {
+ GUI.enabled = false;
+ }
+ IList<ControllerElementIdentifier> axisElementIdentifiers = calibration.joystick.AxisElementIdentifiers;
+ for (int i = 0; i < axisElementIdentifiers.Count; i++)
+ {
+ ControllerElementIdentifier controllerElementIdentifier = axisElementIdentifiers[i];
+ bool flag2 = calibration.selectedElementIdentifierId == controllerElementIdentifier.id;
+ bool flag3 = GUILayout.Toggle(flag2, controllerElementIdentifier.name, "Button", GUILayout.ExpandWidth(expand: false));
+ if (flag2 != flag3)
+ {
+ calibration.selectedElementIdentifierId = controllerElementIdentifier.id;
+ }
+ }
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ GUILayout.EndScrollView();
+ GUILayout.EndVertical();
+ GUILayout.BeginVertical(GUILayout.Width(200f));
+ if (calibration.selectedElementIdentifierId >= 0)
+ {
+ float axisRawById = calibration.joystick.GetAxisRawById(calibration.selectedElementIdentifierId);
+ GUILayout.Label("Raw Value: " + axisRawById);
+ int axisIndexById = calibration.joystick.GetAxisIndexById(calibration.selectedElementIdentifierId);
+ AxisCalibration axis = calibration.calibrationMap.GetAxis(axisIndexById);
+ GUILayout.Label("Calibrated Value: " + calibration.joystick.GetAxisById(calibration.selectedElementIdentifierId));
+ GUILayout.Label("Zero: " + axis.calibratedZero);
+ GUILayout.Label("Min: " + axis.calibratedMin);
+ GUILayout.Label("Max: " + axis.calibratedMax);
+ GUILayout.Label("Dead Zone: " + axis.deadZone);
+ GUILayout.Space(15f);
+ bool flag4 = GUILayout.Toggle(axis.enabled, "Enabled", "Button", GUILayout.ExpandWidth(expand: false));
+ if (axis.enabled != flag4)
+ {
+ axis.enabled = flag4;
+ }
+ GUILayout.Space(10f);
+ bool flag5 = GUILayout.Toggle(calibration.recording, "Record Min/Max", "Button", GUILayout.ExpandWidth(expand: false));
+ if (flag5 != calibration.recording)
+ {
+ if (flag5)
+ {
+ axis.calibratedMax = 0f;
+ axis.calibratedMin = 0f;
+ }
+ calibration.recording = flag5;
+ }
+ if (calibration.recording)
+ {
+ axis.calibratedMin = Mathf.Min(axis.calibratedMin, axisRawById, axis.calibratedMin);
+ axis.calibratedMax = Mathf.Max(axis.calibratedMax, axisRawById, axis.calibratedMax);
+ GUI.enabled = false;
+ }
+ if (GUILayout.Button("Set Zero", GUILayout.ExpandWidth(expand: false)))
+ {
+ axis.calibratedZero = axisRawById;
+ }
+ if (GUILayout.Button("Set Dead Zone", GUILayout.ExpandWidth(expand: false)))
+ {
+ axis.deadZone = axisRawById;
+ }
+ bool flag6 = GUILayout.Toggle(axis.invert, "Invert", "Button", GUILayout.ExpandWidth(expand: false));
+ if (axis.invert != flag6)
+ {
+ axis.invert = flag6;
+ }
+ GUILayout.Space(10f);
+ if (GUILayout.Button("Reset", GUILayout.ExpandWidth(expand: false)))
+ {
+ axis.Reset();
+ }
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ }
+ else
+ {
+ GUILayout.Label("Select an axis to begin.");
+ }
+ GUILayout.EndVertical();
+ GUILayout.EndHorizontal();
+ GUILayout.FlexibleSpace();
+ if (calibration.recording)
+ {
+ GUI.enabled = false;
+ }
+ if (GUILayout.Button("Close"))
+ {
+ calibrateScrollPos = default(Vector2);
+ dialog.Confirm();
+ }
+ if (GUI.enabled != flag)
+ {
+ GUI.enabled = flag;
+ }
+ }
+
+ private void DialogResultCallback(int queueActionId, UserResponse response)
+ {
+ foreach (QueueEntry item in actionQueue)
+ {
+ if (item.id == queueActionId)
+ {
+ if (response != UserResponse.Cancel)
+ {
+ item.Confirm(response);
+ }
+ else
+ {
+ item.Cancel();
+ }
+ break;
+ }
+ }
+ }
+
+ private Rect GetScreenCenteredRect(float width, float height)
+ {
+ return new Rect((float)Screen.width * 0.5f - width * 0.5f, (float)((double)Screen.height * 0.5 - (double)(height * 0.5f)), width, height);
+ }
+
+ private void EnqueueAction(QueueEntry entry)
+ {
+ if (entry != null)
+ {
+ busy = true;
+ GUI.enabled = false;
+ actionQueue.Enqueue(entry);
+ }
+ }
+
+ private void ProcessQueue()
+ {
+ if (dialog.enabled || busy || actionQueue.Count == 0)
+ {
+ return;
+ }
+ while (actionQueue.Count > 0)
+ {
+ QueueEntry queueEntry = actionQueue.Peek();
+ bool flag = false;
+ switch (queueEntry.queueActionType)
+ {
+ case QueueActionType.JoystickAssignment:
+ flag = ProcessJoystickAssignmentChange((JoystickAssignmentChange)queueEntry);
+ break;
+ case QueueActionType.ElementAssignment:
+ flag = ProcessElementAssignmentChange((ElementAssignmentChange)queueEntry);
+ break;
+ case QueueActionType.FallbackJoystickIdentification:
+ flag = ProcessFallbackJoystickIdentification((FallbackJoystickIdentification)queueEntry);
+ break;
+ case QueueActionType.Calibrate:
+ flag = ProcessCalibration((Calibration)queueEntry);
+ break;
+ }
+ if (flag)
+ {
+ actionQueue.Dequeue();
+ continue;
+ }
+ break;
+ }
+ }
+
+ private bool ProcessJoystickAssignmentChange(JoystickAssignmentChange entry)
+ {
+ if (entry.state == QueueEntry.State.Canceled)
+ {
+ return true;
+ }
+ Player player = ReInput.players.GetPlayer(entry.playerId);
+ if (player == null)
+ {
+ return true;
+ }
+ if (!entry.assign)
+ {
+ player.controllers.RemoveController(ControllerType.Joystick, entry.joystickId);
+ ControllerSelectionChanged();
+ return true;
+ }
+ if (player.controllers.ContainsController(ControllerType.Joystick, entry.joystickId))
+ {
+ return true;
+ }
+ if (!ReInput.controllers.IsJoystickAssigned(entry.joystickId) || entry.state == QueueEntry.State.Confirmed)
+ {
+ player.controllers.AddController(ControllerType.Joystick, entry.joystickId, removeFromOtherPlayers: true);
+ ControllerSelectionChanged();
+ return true;
+ }
+ dialog.StartModal(entry.id, DialogHelper.DialogType.JoystickConflict, new WindowProperties
+ {
+ title = "Joystick Reassignment",
+ message = "This joystick is already assigned to another player. Do you want to reassign this joystick to " + player.descriptiveName + "?",
+ rect = GetScreenCenteredRect(250f, 200f),
+ windowDrawDelegate = DrawModalWindow
+ }, DialogResultCallback);
+ return false;
+ }
+
+ private bool ProcessElementAssignmentChange(ElementAssignmentChange entry)
+ {
+ switch (entry.changeType)
+ {
+ case ElementAssignmentChangeType.ReassignOrRemove:
+ return ProcessRemoveOrReassignElementAssignment(entry);
+ case ElementAssignmentChangeType.Remove:
+ return ProcessRemoveElementAssignment(entry);
+ case ElementAssignmentChangeType.Add:
+ case ElementAssignmentChangeType.Replace:
+ return ProcessAddOrReplaceElementAssignment(entry);
+ case ElementAssignmentChangeType.ConflictCheck:
+ return ProcessElementAssignmentConflictCheck(entry);
+ default:
+ throw new NotImplementedException();
+ }
+ }
+
+ private bool ProcessRemoveOrReassignElementAssignment(ElementAssignmentChange entry)
+ {
+ if (entry.context.controllerMap == null)
+ {
+ return true;
+ }
+ if (entry.state == QueueEntry.State.Canceled)
+ {
+ ElementAssignmentChange elementAssignmentChange = new ElementAssignmentChange(entry);
+ elementAssignmentChange.changeType = ElementAssignmentChangeType.Remove;
+ actionQueue.Enqueue(elementAssignmentChange);
+ return true;
+ }
+ if (entry.state == QueueEntry.State.Confirmed)
+ {
+ ElementAssignmentChange elementAssignmentChange2 = new ElementAssignmentChange(entry);
+ elementAssignmentChange2.changeType = ElementAssignmentChangeType.Replace;
+ actionQueue.Enqueue(elementAssignmentChange2);
+ return true;
+ }
+ dialog.StartModal(entry.id, DialogHelper.DialogType.AssignElement, new WindowProperties
+ {
+ title = "Reassign or Remove",
+ message = "Do you want to reassign or remove this assignment?",
+ rect = GetScreenCenteredRect(250f, 200f),
+ windowDrawDelegate = DrawReassignOrRemoveElementAssignmentWindow
+ }, DialogResultCallback);
+ return false;
+ }
+
+ private bool ProcessRemoveElementAssignment(ElementAssignmentChange entry)
+ {
+ if (entry.context.controllerMap == null)
+ {
+ return true;
+ }
+ if (entry.state == QueueEntry.State.Canceled)
+ {
+ return true;
+ }
+ if (entry.state == QueueEntry.State.Confirmed)
+ {
+ entry.context.controllerMap.DeleteElementMap(entry.context.actionElementMapToReplace.id);
+ return true;
+ }
+ dialog.StartModal(entry.id, DialogHelper.DialogType.DeleteAssignmentConfirmation, new WindowProperties
+ {
+ title = "Remove Assignment",
+ message = "Are you sure you want to remove this assignment?",
+ rect = GetScreenCenteredRect(250f, 200f),
+ windowDrawDelegate = DrawModalWindow
+ }, DialogResultCallback);
+ return false;
+ }
+
+ private bool ProcessAddOrReplaceElementAssignment(ElementAssignmentChange entry)
+ {
+ if (entry.state == QueueEntry.State.Canceled)
+ {
+ inputMapper.Stop();
+ return true;
+ }
+ if (entry.state == QueueEntry.State.Confirmed)
+ {
+ if (Event.current.type != EventType.Layout)
+ {
+ return false;
+ }
+ if (conflictFoundEventData != null)
+ {
+ ElementAssignmentChange elementAssignmentChange = new ElementAssignmentChange(entry);
+ elementAssignmentChange.changeType = ElementAssignmentChangeType.ConflictCheck;
+ actionQueue.Enqueue(elementAssignmentChange);
+ }
+ return true;
+ }
+ string text;
+ if (entry.context.controllerMap.controllerType != 0)
+ {
+ text = ((entry.context.controllerMap.controllerType != ControllerType.Mouse) ? "Press any button or axis to assign it to this action." : "Press any mouse button or axis to assign it to this action.\n\nTo assign mouse movement axes, move the mouse quickly in the direction you want mapped to the action. Slow movements will be ignored.");
+ }
+ else
+ {
+ text = ((Application.platform != 0 && Application.platform != RuntimePlatform.OSXPlayer) ? "Press any key to assign it to this action. You may also use the modifier keys Control, Alt, and Shift. If you wish to assign a modifier key itself to this action, press and hold the key for 1 second." : "Press any key to assign it to this action. You may also use the modifier keys Command, Control, Alt, and Shift. If you wish to assign a modifier key itself to this action, press and hold the key for 1 second.");
+ if (Application.isEditor)
+ {
+ text += "\n\nNOTE: Some modifier key combinations will not work in the Unity Editor, but they will work in a game build.";
+ }
+ }
+ dialog.StartModal(entry.id, DialogHelper.DialogType.AssignElement, new WindowProperties
+ {
+ title = "Assign",
+ message = text,
+ rect = GetScreenCenteredRect(250f, 200f),
+ windowDrawDelegate = DrawElementAssignmentWindow
+ }, DialogResultCallback);
+ return false;
+ }
+
+ private bool ProcessElementAssignmentConflictCheck(ElementAssignmentChange entry)
+ {
+ if (entry.context.controllerMap == null)
+ {
+ return true;
+ }
+ if (entry.state == QueueEntry.State.Canceled)
+ {
+ inputMapper.Stop();
+ return true;
+ }
+ if (conflictFoundEventData == null)
+ {
+ return true;
+ }
+ if (entry.state == QueueEntry.State.Confirmed)
+ {
+ if (entry.response == UserResponse.Confirm)
+ {
+ conflictFoundEventData.responseCallback(InputMapper.ConflictResponse.Replace);
+ }
+ else
+ {
+ if (entry.response != UserResponse.Custom1)
+ {
+ throw new NotImplementedException();
+ }
+ conflictFoundEventData.responseCallback(InputMapper.ConflictResponse.Add);
+ }
+ return true;
+ }
+ if (conflictFoundEventData.isProtected)
+ {
+ string message = conflictFoundEventData.assignment.elementDisplayName + " is already in use and is protected from reassignment. You cannot remove the protected assignment, but you can still assign the action to this element. If you do so, the element will trigger multiple actions when activated.";
+ dialog.StartModal(entry.id, DialogHelper.DialogType.AssignElement, new WindowProperties
+ {
+ title = "Assignment Conflict",
+ message = message,
+ rect = GetScreenCenteredRect(250f, 200f),
+ windowDrawDelegate = DrawElementAssignmentProtectedConflictWindow
+ }, DialogResultCallback);
+ }
+ else
+ {
+ string message2 = conflictFoundEventData.assignment.elementDisplayName + " is already in use. You may replace the other conflicting assignments, add this assignment anyway which will leave multiple actions assigned to this element, or cancel this assignment.";
+ dialog.StartModal(entry.id, DialogHelper.DialogType.AssignElement, new WindowProperties
+ {
+ title = "Assignment Conflict",
+ message = message2,
+ rect = GetScreenCenteredRect(250f, 200f),
+ windowDrawDelegate = DrawElementAssignmentNormalConflictWindow
+ }, DialogResultCallback);
+ }
+ return false;
+ }
+
+ private bool ProcessFallbackJoystickIdentification(FallbackJoystickIdentification entry)
+ {
+ if (entry.state == QueueEntry.State.Canceled)
+ {
+ return true;
+ }
+ if (entry.state == QueueEntry.State.Confirmed)
+ {
+ return true;
+ }
+ dialog.StartModal(entry.id, DialogHelper.DialogType.JoystickConflict, new WindowProperties
+ {
+ title = "Joystick Identification Required",
+ message = "A joystick has been attached or removed. You will need to identify each joystick by pressing a button on the controller listed below:",
+ rect = GetScreenCenteredRect(250f, 200f),
+ windowDrawDelegate = DrawFallbackJoystickIdentificationWindow
+ }, DialogResultCallback, 1f);
+ return false;
+ }
+
+ private bool ProcessCalibration(Calibration entry)
+ {
+ if (entry.state == QueueEntry.State.Canceled)
+ {
+ return true;
+ }
+ if (entry.state == QueueEntry.State.Confirmed)
+ {
+ return true;
+ }
+ dialog.StartModal(entry.id, DialogHelper.DialogType.JoystickConflict, new WindowProperties
+ {
+ title = "Calibrate Controller",
+ message = "Select an axis to calibrate on the " + entry.joystick.name + ".",
+ rect = GetScreenCenteredRect(450f, 480f),
+ windowDrawDelegate = DrawCalibrationWindow
+ }, DialogResultCallback);
+ return false;
+ }
+
+ private void PlayerSelectionChanged()
+ {
+ ClearControllerSelection();
+ }
+
+ private void ControllerSelectionChanged()
+ {
+ ClearMapSelection();
+ }
+
+ private void ClearControllerSelection()
+ {
+ selectedController.Clear();
+ ClearMapSelection();
+ }
+
+ private void ClearMapSelection()
+ {
+ selectedMapCategoryId = -1;
+ selectedMap = null;
+ }
+
+ private void ResetAll()
+ {
+ ClearWorkingVars();
+ initialized = false;
+ showMenu = false;
+ }
+
+ private void ClearWorkingVars()
+ {
+ selectedPlayer = null;
+ ClearMapSelection();
+ selectedController.Clear();
+ actionScrollPos = default(Vector2);
+ dialog.FullReset();
+ actionQueue.Clear();
+ busy = false;
+ startListening = false;
+ conflictFoundEventData = null;
+ inputMapper.Stop();
+ }
+
+ private void SetGUIStateStart()
+ {
+ guiState = true;
+ if (busy)
+ {
+ guiState = false;
+ }
+ pageGUIState = guiState && !busy && !dialog.enabled && !dialog.busy;
+ if (GUI.enabled != guiState)
+ {
+ GUI.enabled = guiState;
+ }
+ }
+
+ private void SetGUIStateEnd()
+ {
+ guiState = true;
+ if (!GUI.enabled)
+ {
+ GUI.enabled = guiState;
+ }
+ }
+
+ private void JoystickConnected(ControllerStatusChangedEventArgs args)
+ {
+ if (ReInput.controllers.IsControllerAssigned(args.controllerType, args.controllerId))
+ {
+ foreach (Player allPlayer in ReInput.players.AllPlayers)
+ {
+ if (allPlayer.controllers.ContainsController(args.controllerType, args.controllerId))
+ {
+ ReInput.userDataStore.LoadControllerData(allPlayer.id, args.controllerType, args.controllerId);
+ }
+ }
+ }
+ else
+ {
+ ReInput.userDataStore.LoadControllerData(args.controllerType, args.controllerId);
+ }
+ if (ReInput.unityJoystickIdentificationRequired)
+ {
+ IdentifyAllJoysticks();
+ }
+ }
+
+ private void JoystickPreDisconnect(ControllerStatusChangedEventArgs args)
+ {
+ if (selectedController.hasSelection && args.controllerType == selectedController.type && args.controllerId == selectedController.id)
+ {
+ ClearControllerSelection();
+ }
+ if (!showMenu)
+ {
+ return;
+ }
+ if (ReInput.controllers.IsControllerAssigned(args.controllerType, args.controllerId))
+ {
+ foreach (Player allPlayer in ReInput.players.AllPlayers)
+ {
+ if (allPlayer.controllers.ContainsController(args.controllerType, args.controllerId))
+ {
+ ReInput.userDataStore.SaveControllerData(allPlayer.id, args.controllerType, args.controllerId);
+ }
+ }
+ return;
+ }
+ ReInput.userDataStore.SaveControllerData(args.controllerType, args.controllerId);
+ }
+
+ private void JoystickDisconnected(ControllerStatusChangedEventArgs args)
+ {
+ if (showMenu)
+ {
+ ClearWorkingVars();
+ }
+ if (ReInput.unityJoystickIdentificationRequired)
+ {
+ IdentifyAllJoysticks();
+ }
+ }
+
+ private void OnConflictFound(InputMapper.ConflictFoundEventData data)
+ {
+ conflictFoundEventData = data;
+ }
+
+ private void OnStopped(InputMapper.StoppedEventData data)
+ {
+ conflictFoundEventData = null;
+ }
+
+ public void IdentifyAllJoysticks()
+ {
+ if (ReInput.controllers.joystickCount == 0)
+ {
+ return;
+ }
+ ClearWorkingVars();
+ Open();
+ foreach (Joystick joystick in ReInput.controllers.Joysticks)
+ {
+ actionQueue.Enqueue(new FallbackJoystickIdentification(joystick.id, joystick.name));
+ }
+ }
+
+ protected void CheckRecompile()
+ {
+ }
+
+ private void RecompileWindow(int windowId)
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/CustomControllerDemo.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/CustomControllerDemo.cs
new file mode 100644
index 0000000..2c67e86
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/CustomControllerDemo.cs
@@ -0,0 +1,144 @@
+using System;
+using UnityEngine;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+public class CustomControllerDemo : MonoBehaviour
+{
+ public int playerId;
+
+ public string controllerTag;
+
+ public bool useUpdateCallbacks;
+
+ private int buttonCount;
+
+ private int axisCount;
+
+ private float[] axisValues;
+
+ private bool[] buttonValues;
+
+ private TouchJoystickExample[] joysticks;
+
+ private TouchButtonExample[] buttons;
+
+ private CustomController controller;
+
+ [NonSerialized]
+ private bool initialized;
+
+ private void Awake()
+ {
+ ScreenOrientation screenOrientation = ScreenOrientation.LandscapeLeft;
+ if (SystemInfo.deviceType == DeviceType.Handheld && Screen.orientation != screenOrientation)
+ {
+ Screen.orientation = screenOrientation;
+ }
+ Initialize();
+ }
+
+ private void Initialize()
+ {
+ ReInput.InputSourceUpdateEvent += OnInputSourceUpdate;
+ joysticks = GetComponentsInChildren<TouchJoystickExample>();
+ buttons = GetComponentsInChildren<TouchButtonExample>();
+ axisCount = joysticks.Length * 2;
+ buttonCount = buttons.Length;
+ axisValues = new float[axisCount];
+ buttonValues = new bool[buttonCount];
+ Player player = ReInput.players.GetPlayer(playerId);
+ controller = player.controllers.GetControllerWithTag<CustomController>(controllerTag);
+ if (controller == null)
+ {
+ Debug.LogError("A matching controller was not found for tag \"" + controllerTag + "\"");
+ }
+ if (controller.buttonCount != buttonValues.Length || controller.axisCount != axisValues.Length)
+ {
+ Debug.LogError("Controller has wrong number of elements!");
+ }
+ if (useUpdateCallbacks && controller != null)
+ {
+ controller.SetAxisUpdateCallback(GetAxisValueCallback);
+ controller.SetButtonUpdateCallback(GetButtonValueCallback);
+ }
+ initialized = true;
+ }
+
+ private void Update()
+ {
+ if (ReInput.isReady && !initialized)
+ {
+ Initialize();
+ }
+ }
+
+ private void OnInputSourceUpdate()
+ {
+ GetSourceAxisValues();
+ GetSourceButtonValues();
+ if (!useUpdateCallbacks)
+ {
+ SetControllerAxisValues();
+ SetControllerButtonValues();
+ }
+ }
+
+ private void GetSourceAxisValues()
+ {
+ for (int i = 0; i < axisValues.Length; i++)
+ {
+ if (i % 2 != 0)
+ {
+ axisValues[i] = joysticks[i / 2].position.y;
+ }
+ else
+ {
+ axisValues[i] = joysticks[i / 2].position.x;
+ }
+ }
+ }
+
+ private void GetSourceButtonValues()
+ {
+ for (int i = 0; i < buttonValues.Length; i++)
+ {
+ buttonValues[i] = buttons[i].isPressed;
+ }
+ }
+
+ private void SetControllerAxisValues()
+ {
+ for (int i = 0; i < axisValues.Length; i++)
+ {
+ controller.SetAxisValue(i, axisValues[i]);
+ }
+ }
+
+ private void SetControllerButtonValues()
+ {
+ for (int i = 0; i < buttonValues.Length; i++)
+ {
+ controller.SetButtonValue(i, buttonValues[i]);
+ }
+ }
+
+ private float GetAxisValueCallback(int index)
+ {
+ if (index >= axisValues.Length)
+ {
+ return 0f;
+ }
+ return axisValues[index];
+ }
+
+ private bool GetButtonValueCallback(int index)
+ {
+ if (index >= buttonValues.Length)
+ {
+ return false;
+ }
+ return buttonValues[index];
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/CustomControllerDemo_Player.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/CustomControllerDemo_Player.cs
new file mode 100644
index 0000000..7c4346a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/CustomControllerDemo_Player.cs
@@ -0,0 +1,58 @@
+using UnityEngine;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+[RequireComponent(typeof(CharacterController))]
+public class CustomControllerDemo_Player : MonoBehaviour
+{
+ public int playerId;
+
+ public float speed = 1f;
+
+ public float bulletSpeed = 20f;
+
+ public GameObject bulletPrefab;
+
+ private Player _player;
+
+ private CharacterController cc;
+
+ private Player player
+ {
+ get
+ {
+ if (_player == null)
+ {
+ _player = ReInput.players.GetPlayer(playerId);
+ }
+ return _player;
+ }
+ }
+
+ private void Awake()
+ {
+ cc = GetComponent<CharacterController>();
+ }
+
+ private void Update()
+ {
+ if (ReInput.isReady)
+ {
+ Vector2 vector = new Vector2(player.GetAxis("Move Horizontal"), player.GetAxis("Move Vertical"));
+ cc.Move(vector * speed * Time.deltaTime);
+ if (player.GetButtonDown("Fire"))
+ {
+ Vector3 vector2 = Vector3.Scale(new Vector3(1f, 0f, 0f), base.transform.right);
+ Object.Instantiate(bulletPrefab, base.transform.position + vector2, Quaternion.identity).GetComponent<Rigidbody>().velocity = new Vector3(bulletSpeed * base.transform.right.x, 0f, 0f);
+ }
+ if (player.GetButtonDown("Change Color"))
+ {
+ Renderer component = GetComponent<Renderer>();
+ Material material = component.material;
+ material.color = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f), 1f);
+ component.material = material;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/CustomControllersTiltDemo.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/CustomControllersTiltDemo.cs
new file mode 100644
index 0000000..d24caf2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/CustomControllersTiltDemo.cs
@@ -0,0 +1,47 @@
+using UnityEngine;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+public class CustomControllersTiltDemo : MonoBehaviour
+{
+ public Transform target;
+
+ public float speed = 10f;
+
+ private CustomController controller;
+
+ private Player player;
+
+ private void Awake()
+ {
+ Screen.orientation = ScreenOrientation.LandscapeLeft;
+ player = ReInput.players.GetPlayer(0);
+ ReInput.InputSourceUpdateEvent += OnInputUpdate;
+ controller = (CustomController)player.controllers.GetControllerWithTag(ControllerType.Custom, "TiltController");
+ }
+
+ private void Update()
+ {
+ if (!(target == null))
+ {
+ Vector3 zero = Vector3.zero;
+ zero.y = player.GetAxis("Tilt Vertical");
+ zero.x = player.GetAxis("Tilt Horizontal");
+ if (zero.sqrMagnitude > 1f)
+ {
+ zero.Normalize();
+ }
+ zero *= Time.deltaTime;
+ target.Translate(zero * speed);
+ }
+ }
+
+ private void OnInputUpdate()
+ {
+ Vector3 acceleration = Input.acceleration;
+ controller.SetAxisValue(0, acceleration.x);
+ controller.SetAxisValue(1, acceleration.y);
+ controller.SetAxisValue(2, acceleration.z);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/DualShock4SpecialFeaturesExample.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/DualShock4SpecialFeaturesExample.cs
new file mode 100644
index 0000000..838b779
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/DualShock4SpecialFeaturesExample.cs
@@ -0,0 +1,219 @@
+using System.Collections.Generic;
+using Rewired.ControllerExtensions;
+using UnityEngine;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+public class DualShock4SpecialFeaturesExample : MonoBehaviour
+{
+ private class Touch
+ {
+ public GameObject go;
+
+ public int touchId = -1;
+ }
+
+ private const int maxTouches = 2;
+
+ public int playerId;
+
+ public Transform touchpadTransform;
+
+ public GameObject lightObject;
+
+ public Transform accelerometerTransform;
+
+ private List<Touch> touches;
+
+ private Queue<Touch> unusedTouches;
+
+ private bool isFlashing;
+
+ private GUIStyle textStyle;
+
+ private Player player => ReInput.players.GetPlayer(playerId);
+
+ private void Awake()
+ {
+ InitializeTouchObjects();
+ }
+
+ private void Update()
+ {
+ if (!ReInput.isReady)
+ {
+ return;
+ }
+ IDualShock4Extension firstDS = GetFirstDS4(player);
+ if (firstDS != null)
+ {
+ base.transform.rotation = firstDS.GetOrientation();
+ HandleTouchpad(firstDS);
+ Vector3 accelerometerValue = firstDS.GetAccelerometerValue();
+ accelerometerTransform.LookAt(accelerometerTransform.position + accelerometerValue);
+ }
+ if (player.GetButtonDown("CycleLight"))
+ {
+ SetRandomLightColor();
+ }
+ if (player.GetButtonDown("ResetOrientation"))
+ {
+ ResetOrientation();
+ }
+ if (player.GetButtonDown("ToggleLightFlash"))
+ {
+ if (isFlashing)
+ {
+ StopLightFlash();
+ }
+ else
+ {
+ StartLightFlash();
+ }
+ isFlashing = !isFlashing;
+ }
+ if (player.GetButtonDown("VibrateLeft"))
+ {
+ firstDS.SetVibration(0, 1f, 1f);
+ }
+ if (player.GetButtonDown("VibrateRight"))
+ {
+ firstDS.SetVibration(1, 1f, 1f);
+ }
+ }
+
+ private void OnGUI()
+ {
+ if (textStyle == null)
+ {
+ textStyle = new GUIStyle(GUI.skin.label);
+ textStyle.fontSize = 20;
+ textStyle.wordWrap = true;
+ }
+ if (GetFirstDS4(player) != null)
+ {
+ GUILayout.BeginArea(new Rect(200f, 100f, (float)Screen.width - 400f, (float)Screen.height - 200f));
+ GUILayout.Label("Rotate the Dual Shock 4 to see the model rotate in sync.", textStyle);
+ GUILayout.Label("Touch the touchpad to see them appear on the model.", textStyle);
+ ActionElementMap firstElementMapWithAction = player.controllers.maps.GetFirstElementMapWithAction(ControllerType.Joystick, "ResetOrientation", skipDisabledMaps: true);
+ if (firstElementMapWithAction != null)
+ {
+ GUILayout.Label("Press " + firstElementMapWithAction.elementIdentifierName + " to reset the orientation. Hold the gamepad facing the screen with sticks pointing up and press the button.", textStyle);
+ }
+ firstElementMapWithAction = player.controllers.maps.GetFirstElementMapWithAction(ControllerType.Joystick, "CycleLight", skipDisabledMaps: true);
+ if (firstElementMapWithAction != null)
+ {
+ GUILayout.Label("Press " + firstElementMapWithAction.elementIdentifierName + " to change the light color.", textStyle);
+ }
+ firstElementMapWithAction = player.controllers.maps.GetFirstElementMapWithAction(ControllerType.Joystick, "ToggleLightFlash", skipDisabledMaps: true);
+ if (firstElementMapWithAction != null)
+ {
+ GUILayout.Label("Press " + firstElementMapWithAction.elementIdentifierName + " to start or stop the light flashing.", textStyle);
+ }
+ firstElementMapWithAction = player.controllers.maps.GetFirstElementMapWithAction(ControllerType.Joystick, "VibrateLeft", skipDisabledMaps: true);
+ if (firstElementMapWithAction != null)
+ {
+ GUILayout.Label("Press " + firstElementMapWithAction.elementIdentifierName + " vibrate the left motor.", textStyle);
+ }
+ firstElementMapWithAction = player.controllers.maps.GetFirstElementMapWithAction(ControllerType.Joystick, "VibrateRight", skipDisabledMaps: true);
+ if (firstElementMapWithAction != null)
+ {
+ GUILayout.Label("Press " + firstElementMapWithAction.elementIdentifierName + " vibrate the right motor.", textStyle);
+ }
+ GUILayout.EndArea();
+ }
+ }
+
+ private void ResetOrientation()
+ {
+ GetFirstDS4(player)?.ResetOrientation();
+ }
+
+ private void SetRandomLightColor()
+ {
+ IDualShock4Extension firstDS = GetFirstDS4(player);
+ if (firstDS != null)
+ {
+ Color color = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f), 1f);
+ firstDS.SetLightColor(color);
+ lightObject.GetComponent<MeshRenderer>().material.color = color;
+ }
+ }
+
+ private void StartLightFlash()
+ {
+ if (GetFirstDS4(player) is DualShock4Extension dualShock4Extension)
+ {
+ dualShock4Extension.SetLightFlash(0.5f, 0.5f);
+ }
+ }
+
+ private void StopLightFlash()
+ {
+ if (GetFirstDS4(player) is DualShock4Extension dualShock4Extension)
+ {
+ dualShock4Extension.StopLightFlash();
+ }
+ }
+
+ private IDualShock4Extension GetFirstDS4(Player player)
+ {
+ foreach (Joystick joystick in player.controllers.Joysticks)
+ {
+ IDualShock4Extension extension = joystick.GetExtension<IDualShock4Extension>();
+ if (extension != null)
+ {
+ return extension;
+ }
+ }
+ return null;
+ }
+
+ private void InitializeTouchObjects()
+ {
+ touches = new List<Touch>(2);
+ unusedTouches = new Queue<Touch>(2);
+ for (int i = 0; i < 2; i++)
+ {
+ Touch touch = new Touch();
+ touch.go = GameObject.CreatePrimitive(PrimitiveType.Sphere);
+ touch.go.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
+ touch.go.transform.SetParent(touchpadTransform, worldPositionStays: true);
+ touch.go.GetComponent<MeshRenderer>().material.color = ((i == 0) ? Color.red : Color.green);
+ touch.go.SetActive(value: false);
+ unusedTouches.Enqueue(touch);
+ }
+ }
+
+ private void HandleTouchpad(IDualShock4Extension ds4)
+ {
+ for (int num = touches.Count - 1; num >= 0; num--)
+ {
+ Touch touch = touches[num];
+ if (!ds4.IsTouchingByTouchId(touch.touchId))
+ {
+ touch.go.SetActive(value: false);
+ unusedTouches.Enqueue(touch);
+ touches.RemoveAt(num);
+ }
+ }
+ for (int i = 0; i < ds4.maxTouches; i++)
+ {
+ if (ds4.IsTouching(i))
+ {
+ int touchId = ds4.GetTouchId(i);
+ Touch touch2 = touches.Find((Touch x) => x.touchId == touchId);
+ if (touch2 == null)
+ {
+ touch2 = unusedTouches.Dequeue();
+ touches.Add(touch2);
+ }
+ touch2.touchId = touchId;
+ touch2.go.SetActive(value: true);
+ ds4.GetTouchPosition(i, out var position);
+ touch2.go.transform.localPosition = new Vector3(position.x - 0.5f, 0.5f + touch2.go.transform.localScale.y * 0.5f, position.y - 0.5f);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/EightPlayersExample_Player.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/EightPlayersExample_Player.cs
new file mode 100644
index 0000000..0ce56e1
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/EightPlayersExample_Player.cs
@@ -0,0 +1,71 @@
+using System;
+using UnityEngine;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+[RequireComponent(typeof(CharacterController))]
+public class EightPlayersExample_Player : MonoBehaviour
+{
+ public int playerId;
+
+ public float moveSpeed = 3f;
+
+ public float bulletSpeed = 15f;
+
+ public GameObject bulletPrefab;
+
+ private Player player;
+
+ private CharacterController cc;
+
+ private Vector3 moveVector;
+
+ private bool fire;
+
+ [NonSerialized]
+ private bool initialized;
+
+ private void Awake()
+ {
+ cc = GetComponent<CharacterController>();
+ }
+
+ private void Initialize()
+ {
+ player = ReInput.players.GetPlayer(playerId);
+ initialized = true;
+ }
+
+ private void Update()
+ {
+ if (ReInput.isReady)
+ {
+ if (!initialized)
+ {
+ Initialize();
+ }
+ GetInput();
+ ProcessInput();
+ }
+ }
+
+ private void GetInput()
+ {
+ moveVector.x = player.GetAxis("Move Horizontal");
+ moveVector.y = player.GetAxis("Move Vertical");
+ fire = player.GetButtonDown("Fire");
+ }
+
+ private void ProcessInput()
+ {
+ if (moveVector.x != 0f || moveVector.y != 0f)
+ {
+ cc.Move(moveVector * moveSpeed * Time.deltaTime);
+ }
+ if (fire)
+ {
+ UnityEngine.Object.Instantiate(bulletPrefab, base.transform.position + base.transform.right, base.transform.rotation).GetComponent<Rigidbody>().AddForce(base.transform.right * bulletSpeed, ForceMode.VelocityChange);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/FallbackJoystickIdentificationDemo.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/FallbackJoystickIdentificationDemo.cs
new file mode 100644
index 0000000..3213b71
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/FallbackJoystickIdentificationDemo.cs
@@ -0,0 +1,114 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+public class FallbackJoystickIdentificationDemo : MonoBehaviour
+{
+ private const float windowWidth = 250f;
+
+ private const float windowHeight = 250f;
+
+ private const float inputDelay = 1f;
+
+ private bool identifyRequired;
+
+ private Queue<Joystick> joysticksToIdentify;
+
+ private float nextInputAllowedTime;
+
+ private GUIStyle style;
+
+ private void Awake()
+ {
+ if (ReInput.unityJoystickIdentificationRequired)
+ {
+ ReInput.ControllerConnectedEvent += JoystickConnected;
+ ReInput.ControllerDisconnectedEvent += JoystickDisconnected;
+ IdentifyAllJoysticks();
+ }
+ }
+
+ private void JoystickConnected(ControllerStatusChangedEventArgs args)
+ {
+ IdentifyAllJoysticks();
+ }
+
+ private void JoystickDisconnected(ControllerStatusChangedEventArgs args)
+ {
+ IdentifyAllJoysticks();
+ }
+
+ public void IdentifyAllJoysticks()
+ {
+ Reset();
+ if (ReInput.controllers.joystickCount != 0)
+ {
+ Joystick[] joysticks = ReInput.controllers.GetJoysticks();
+ if (joysticks != null)
+ {
+ identifyRequired = true;
+ joysticksToIdentify = new Queue<Joystick>(joysticks);
+ SetInputDelay();
+ }
+ }
+ }
+
+ private void SetInputDelay()
+ {
+ nextInputAllowedTime = Time.time + 1f;
+ }
+
+ private void OnGUI()
+ {
+ if (!identifyRequired)
+ {
+ return;
+ }
+ if (joysticksToIdentify == null || joysticksToIdentify.Count == 0)
+ {
+ Reset();
+ return;
+ }
+ Rect screenRect = new Rect((float)Screen.width * 0.5f - 125f, (float)Screen.height * 0.5f - 125f, 250f, 250f);
+ GUILayout.Window(0, screenRect, DrawDialogWindow, "Joystick Identification Required");
+ GUI.FocusWindow(0);
+ if (!(Time.time < nextInputAllowedTime) && ReInput.controllers.SetUnityJoystickIdFromAnyButtonOrAxisPress(joysticksToIdentify.Peek().id, 0.8f, positiveAxesOnly: false))
+ {
+ joysticksToIdentify.Dequeue();
+ SetInputDelay();
+ if (joysticksToIdentify.Count == 0)
+ {
+ Reset();
+ }
+ }
+ }
+
+ private void DrawDialogWindow(int windowId)
+ {
+ if (identifyRequired)
+ {
+ if (style == null)
+ {
+ style = new GUIStyle(GUI.skin.label);
+ style.wordWrap = true;
+ }
+ GUILayout.Space(15f);
+ GUILayout.Label("A joystick has been attached or removed. You will need to identify each joystick by pressing a button on the controller listed below:", style);
+ Joystick joystick = joysticksToIdentify.Peek();
+ GUILayout.Label("Press any button on \"" + joystick.name + "\" now.", style);
+ GUILayout.FlexibleSpace();
+ if (GUILayout.Button("Skip"))
+ {
+ joysticksToIdentify.Dequeue();
+ }
+ }
+ }
+
+ private void Reset()
+ {
+ joysticksToIdentify = null;
+ identifyRequired = false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/PlayerMouseSpriteExample.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/PlayerMouseSpriteExample.cs
new file mode 100644
index 0000000..194fb5d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/PlayerMouseSpriteExample.cs
@@ -0,0 +1,116 @@
+using System;
+using UnityEngine;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+public class PlayerMouseSpriteExample : MonoBehaviour
+{
+ [Tooltip("The Player that will control the mouse")]
+ public int playerId;
+
+ [Tooltip("The Rewired Action used for the mouse horizontal axis.")]
+ public string horizontalAction = "MouseX";
+
+ [Tooltip("The Rewired Action used for the mouse vertical axis.")]
+ public string verticalAction = "MouseY";
+
+ [Tooltip("The Rewired Action used for the mouse wheel axis.")]
+ public string wheelAction = "MouseWheel";
+
+ [Tooltip("The Rewired Action used for the mouse left button.")]
+ public string leftButtonAction = "MouseLeftButton";
+
+ [Tooltip("The Rewired Action used for the mouse right button.")]
+ public string rightButtonAction = "MouseRightButton";
+
+ [Tooltip("The Rewired Action used for the mouse middle button.")]
+ public string middleButtonAction = "MouseMiddleButton";
+
+ [Tooltip("The distance from the camera that the pointer will be drawn.")]
+ public float distanceFromCamera = 1f;
+
+ [Tooltip("The scale of the sprite pointer.")]
+ public float spriteScale = 0.05f;
+
+ [Tooltip("The pointer prefab.")]
+ public GameObject pointerPrefab;
+
+ [Tooltip("The click effect prefab.")]
+ public GameObject clickEffectPrefab;
+
+ [Tooltip("Should the hardware pointer be hidden?")]
+ public bool hideHardwarePointer = true;
+
+ [NonSerialized]
+ private GameObject pointer;
+
+ [NonSerialized]
+ private PlayerMouse mouse;
+
+ private void Awake()
+ {
+ pointer = UnityEngine.Object.Instantiate(pointerPrefab);
+ pointer.transform.localScale = new Vector3(spriteScale, spriteScale, spriteScale);
+ if (hideHardwarePointer)
+ {
+ Cursor.visible = false;
+ }
+ mouse = PlayerMouse.Factory.Create();
+ mouse.playerId = playerId;
+ mouse.xAxis.actionName = horizontalAction;
+ mouse.yAxis.actionName = verticalAction;
+ mouse.wheel.yAxis.actionName = wheelAction;
+ mouse.leftButton.actionName = leftButtonAction;
+ mouse.rightButton.actionName = rightButtonAction;
+ mouse.middleButton.actionName = middleButtonAction;
+ mouse.pointerSpeed = 1f;
+ mouse.wheel.yAxis.repeatRate = 5f;
+ mouse.screenPosition = new Vector2((float)Screen.width * 0.5f, (float)Screen.height * 0.5f);
+ mouse.ScreenPositionChangedEvent += OnScreenPositionChanged;
+ OnScreenPositionChanged(mouse.screenPosition);
+ }
+
+ private void Update()
+ {
+ if (ReInput.isReady)
+ {
+ pointer.transform.Rotate(Vector3.forward, mouse.wheel.yAxis.value * 20f);
+ if (mouse.leftButton.justPressed)
+ {
+ CreateClickEffect(new Color(0f, 1f, 0f, 1f));
+ }
+ if (mouse.rightButton.justPressed)
+ {
+ CreateClickEffect(new Color(1f, 0f, 0f, 1f));
+ }
+ if (mouse.middleButton.justPressed)
+ {
+ CreateClickEffect(new Color(1f, 1f, 0f, 1f));
+ }
+ }
+ }
+
+ private void OnDestroy()
+ {
+ if (ReInput.isReady)
+ {
+ mouse.ScreenPositionChangedEvent -= OnScreenPositionChanged;
+ }
+ }
+
+ private void CreateClickEffect(Color color)
+ {
+ GameObject obj = UnityEngine.Object.Instantiate(clickEffectPrefab);
+ obj.transform.localScale = new Vector3(spriteScale, spriteScale, spriteScale);
+ obj.transform.position = Camera.main.ScreenToWorldPoint(new Vector3(mouse.screenPosition.x, mouse.screenPosition.y, distanceFromCamera));
+ obj.GetComponentInChildren<SpriteRenderer>().color = color;
+ UnityEngine.Object.Destroy(obj, 0.5f);
+ }
+
+ private void OnScreenPositionChanged(Vector2 position)
+ {
+ Vector3 position2 = Camera.main.ScreenToWorldPoint(new Vector3(position.x, position.y, distanceFromCamera));
+ pointer.transform.position = position2;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/PlayerPointerEventHandlerExample.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/PlayerPointerEventHandlerExample.cs
new file mode 100644
index 0000000..dde8871
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/PlayerPointerEventHandlerExample.cs
@@ -0,0 +1,138 @@
+using System.Collections.Generic;
+using System.Text;
+using Rewired.Integration.UnityUI;
+using UnityEngine;
+using UnityEngine.EventSystems;
+using UnityEngine.UI;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+public sealed class PlayerPointerEventHandlerExample : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerUpHandler, IPointerDownHandler, IPointerClickHandler, IScrollHandler, IBeginDragHandler, IDragHandler, IEndDragHandler
+{
+ public Text text;
+
+ private const int logLength = 10;
+
+ private List<string> log = new List<string>();
+
+ private void Log(string o)
+ {
+ log.Add(o);
+ if (log.Count > 10)
+ {
+ log.RemoveAt(0);
+ }
+ }
+
+ private void Update()
+ {
+ if (!(text != null))
+ {
+ return;
+ }
+ StringBuilder stringBuilder = new StringBuilder();
+ foreach (string item in log)
+ {
+ stringBuilder.AppendLine(item);
+ }
+ text.text = stringBuilder.ToString();
+ }
+
+ public void OnPointerEnter(PointerEventData eventData)
+ {
+ if (eventData is PlayerPointerEventData)
+ {
+ PlayerPointerEventData playerPointerEventData = (PlayerPointerEventData)eventData;
+ Log("OnPointerEnter: Player = " + playerPointerEventData.playerId + ", Pointer Index = " + playerPointerEventData.inputSourceIndex + ", Source = " + GetSourceName(playerPointerEventData));
+ }
+ }
+
+ public void OnPointerExit(PointerEventData eventData)
+ {
+ if (eventData is PlayerPointerEventData)
+ {
+ PlayerPointerEventData playerPointerEventData = (PlayerPointerEventData)eventData;
+ Log("OnPointerExit: Player = " + playerPointerEventData.playerId + ", Pointer Index = " + playerPointerEventData.inputSourceIndex + ", Source = " + GetSourceName(playerPointerEventData));
+ }
+ }
+
+ public void OnPointerUp(PointerEventData eventData)
+ {
+ if (eventData is PlayerPointerEventData)
+ {
+ PlayerPointerEventData playerPointerEventData = (PlayerPointerEventData)eventData;
+ Log("OnPointerUp: Player = " + playerPointerEventData.playerId + ", Pointer Index = " + playerPointerEventData.inputSourceIndex + ", Source = " + GetSourceName(playerPointerEventData) + ", Button Index = " + playerPointerEventData.buttonIndex);
+ }
+ }
+
+ public void OnPointerDown(PointerEventData eventData)
+ {
+ if (eventData is PlayerPointerEventData)
+ {
+ PlayerPointerEventData playerPointerEventData = (PlayerPointerEventData)eventData;
+ Log("OnPointerDown: Player = " + playerPointerEventData.playerId + ", Pointer Index = " + playerPointerEventData.inputSourceIndex + ", Source = " + GetSourceName(playerPointerEventData) + ", Button Index = " + playerPointerEventData.buttonIndex);
+ }
+ }
+
+ public void OnPointerClick(PointerEventData eventData)
+ {
+ if (eventData is PlayerPointerEventData)
+ {
+ PlayerPointerEventData playerPointerEventData = (PlayerPointerEventData)eventData;
+ Log("OnPointerClick: Player = " + playerPointerEventData.playerId + ", Pointer Index = " + playerPointerEventData.inputSourceIndex + ", Source = " + GetSourceName(playerPointerEventData) + ", Button Index = " + playerPointerEventData.buttonIndex);
+ }
+ }
+
+ public void OnScroll(PointerEventData eventData)
+ {
+ if (eventData is PlayerPointerEventData)
+ {
+ PlayerPointerEventData playerPointerEventData = (PlayerPointerEventData)eventData;
+ Log("OnScroll: Player = " + playerPointerEventData.playerId + ", Pointer Index = " + playerPointerEventData.inputSourceIndex + ", Source = " + GetSourceName(playerPointerEventData));
+ }
+ }
+
+ public void OnBeginDrag(PointerEventData eventData)
+ {
+ if (eventData is PlayerPointerEventData)
+ {
+ PlayerPointerEventData playerPointerEventData = (PlayerPointerEventData)eventData;
+ Log("OnBeginDrag: Player = " + playerPointerEventData.playerId + ", Pointer Index = " + playerPointerEventData.inputSourceIndex + ", Source = " + GetSourceName(playerPointerEventData) + ", Button Index = " + playerPointerEventData.buttonIndex);
+ }
+ }
+
+ public void OnDrag(PointerEventData eventData)
+ {
+ if (eventData is PlayerPointerEventData)
+ {
+ PlayerPointerEventData playerPointerEventData = (PlayerPointerEventData)eventData;
+ Log("OnDrag: Player = " + playerPointerEventData.playerId + ", Pointer Index = " + playerPointerEventData.inputSourceIndex + ", Source = " + GetSourceName(playerPointerEventData) + ", Button Index = " + playerPointerEventData.buttonIndex);
+ }
+ }
+
+ public void OnEndDrag(PointerEventData eventData)
+ {
+ if (eventData is PlayerPointerEventData)
+ {
+ PlayerPointerEventData playerPointerEventData = (PlayerPointerEventData)eventData;
+ Log("OnEndDrag: Player = " + playerPointerEventData.playerId + ", Pointer Index = " + playerPointerEventData.inputSourceIndex + ", Source = " + GetSourceName(playerPointerEventData) + ", Button Index = " + playerPointerEventData.buttonIndex);
+ }
+ }
+
+ private static string GetSourceName(PlayerPointerEventData playerEventData)
+ {
+ if (playerEventData.sourceType == PointerEventType.Mouse)
+ {
+ if (playerEventData.mouseSource is Behaviour)
+ {
+ return (playerEventData.mouseSource as Behaviour).name;
+ }
+ }
+ else if (playerEventData.sourceType == PointerEventType.Touch && playerEventData.touchSource is Behaviour)
+ {
+ return (playerEventData.touchSource as Behaviour).name;
+ }
+ return null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/PressAnyButtonToJoinExample_Assigner.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/PressAnyButtonToJoinExample_Assigner.cs
new file mode 100644
index 0000000..83c25e8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/PressAnyButtonToJoinExample_Assigner.cs
@@ -0,0 +1,57 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+public class PressAnyButtonToJoinExample_Assigner : MonoBehaviour
+{
+ private void Update()
+ {
+ if (ReInput.isReady)
+ {
+ AssignJoysticksToPlayers();
+ }
+ }
+
+ private void AssignJoysticksToPlayers()
+ {
+ IList<Joystick> joysticks = ReInput.controllers.Joysticks;
+ for (int i = 0; i < joysticks.Count; i++)
+ {
+ Joystick joystick = joysticks[i];
+ if (!ReInput.controllers.IsControllerAssigned(joystick.type, joystick.id) && joystick.GetAnyButtonDown())
+ {
+ Player player = FindPlayerWithoutJoystick();
+ if (player == null)
+ {
+ return;
+ }
+ player.controllers.AddController(joystick, removeFromOtherPlayers: false);
+ }
+ }
+ if (DoAllPlayersHaveJoysticks())
+ {
+ ReInput.configuration.autoAssignJoysticks = true;
+ base.enabled = false;
+ }
+ }
+
+ private Player FindPlayerWithoutJoystick()
+ {
+ IList<Player> players = ReInput.players.Players;
+ for (int i = 0; i < players.Count; i++)
+ {
+ if (players[i].controllers.joystickCount <= 0)
+ {
+ return players[i];
+ }
+ }
+ return null;
+ }
+
+ private bool DoAllPlayersHaveJoysticks()
+ {
+ return FindPlayerWithoutJoystick() == null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/PressAnyButtonToJoinExample_GamePlayer.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/PressAnyButtonToJoinExample_GamePlayer.cs
new file mode 100644
index 0000000..a0466ce
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/PressAnyButtonToJoinExample_GamePlayer.cs
@@ -0,0 +1,67 @@
+using UnityEngine;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+[RequireComponent(typeof(CharacterController))]
+public class PressAnyButtonToJoinExample_GamePlayer : MonoBehaviour
+{
+ public int playerId;
+
+ public float moveSpeed = 3f;
+
+ public float bulletSpeed = 15f;
+
+ public GameObject bulletPrefab;
+
+ private CharacterController cc;
+
+ private Vector3 moveVector;
+
+ private bool fire;
+
+ private Player player
+ {
+ get
+ {
+ if (!ReInput.isReady)
+ {
+ return null;
+ }
+ return ReInput.players.GetPlayer(playerId);
+ }
+ }
+
+ private void OnEnable()
+ {
+ cc = GetComponent<CharacterController>();
+ }
+
+ private void Update()
+ {
+ if (ReInput.isReady && player != null)
+ {
+ GetInput();
+ ProcessInput();
+ }
+ }
+
+ private void GetInput()
+ {
+ moveVector.x = player.GetAxis("Move Horizontal");
+ moveVector.y = player.GetAxis("Move Vertical");
+ fire = player.GetButtonDown("Fire");
+ }
+
+ private void ProcessInput()
+ {
+ if (moveVector.x != 0f || moveVector.y != 0f)
+ {
+ cc.Move(moveVector * moveSpeed * Time.deltaTime);
+ }
+ if (fire)
+ {
+ Object.Instantiate(bulletPrefab, base.transform.position + base.transform.right, base.transform.rotation).GetComponent<Rigidbody>().AddForce(base.transform.right * bulletSpeed, ForceMode.VelocityChange);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/PressStartToJoinExample_Assigner.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/PressStartToJoinExample_Assigner.cs
new file mode 100644
index 0000000..6b23589
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/PressStartToJoinExample_Assigner.cs
@@ -0,0 +1,87 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+public class PressStartToJoinExample_Assigner : MonoBehaviour
+{
+ private class PlayerMap
+ {
+ public int rewiredPlayerId;
+
+ public int gamePlayerId;
+
+ public PlayerMap(int rewiredPlayerId, int gamePlayerId)
+ {
+ this.rewiredPlayerId = rewiredPlayerId;
+ this.gamePlayerId = gamePlayerId;
+ }
+ }
+
+ private static PressStartToJoinExample_Assigner instance;
+
+ public int maxPlayers = 4;
+
+ private List<PlayerMap> playerMap;
+
+ private int gamePlayerIdCounter;
+
+ public static Player GetRewiredPlayer(int gamePlayerId)
+ {
+ if (!ReInput.isReady)
+ {
+ return null;
+ }
+ if (instance == null)
+ {
+ Debug.LogError("Not initialized. Do you have a PressStartToJoinPlayerSelector in your scehe?");
+ return null;
+ }
+ for (int i = 0; i < instance.playerMap.Count; i++)
+ {
+ if (instance.playerMap[i].gamePlayerId == gamePlayerId)
+ {
+ return ReInput.players.GetPlayer(instance.playerMap[i].rewiredPlayerId);
+ }
+ }
+ return null;
+ }
+
+ private void Awake()
+ {
+ playerMap = new List<PlayerMap>();
+ instance = this;
+ }
+
+ private void Update()
+ {
+ for (int i = 0; i < ReInput.players.playerCount; i++)
+ {
+ if (ReInput.players.GetPlayer(i).GetButtonDown("JoinGame"))
+ {
+ AssignNextPlayer(i);
+ }
+ }
+ }
+
+ private void AssignNextPlayer(int rewiredPlayerId)
+ {
+ if (playerMap.Count >= maxPlayers)
+ {
+ Debug.LogError("Max player limit already reached!");
+ return;
+ }
+ int nextGamePlayerId = GetNextGamePlayerId();
+ playerMap.Add(new PlayerMap(rewiredPlayerId, nextGamePlayerId));
+ Player player = ReInput.players.GetPlayer(rewiredPlayerId);
+ player.controllers.maps.SetMapsEnabled(state: false, "Assignment");
+ player.controllers.maps.SetMapsEnabled(state: true, "Default");
+ Debug.Log("Added Rewired Player id " + rewiredPlayerId + " to game player " + nextGamePlayerId);
+ }
+
+ private int GetNextGamePlayerId()
+ {
+ return gamePlayerIdCounter++;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/PressStartToJoinExample_GamePlayer.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/PressStartToJoinExample_GamePlayer.cs
new file mode 100644
index 0000000..04ee6c4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/PressStartToJoinExample_GamePlayer.cs
@@ -0,0 +1,57 @@
+using UnityEngine;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+[RequireComponent(typeof(CharacterController))]
+public class PressStartToJoinExample_GamePlayer : MonoBehaviour
+{
+ public int gamePlayerId;
+
+ public float moveSpeed = 3f;
+
+ public float bulletSpeed = 15f;
+
+ public GameObject bulletPrefab;
+
+ private CharacterController cc;
+
+ private Vector3 moveVector;
+
+ private bool fire;
+
+ private Player player => PressStartToJoinExample_Assigner.GetRewiredPlayer(gamePlayerId);
+
+ private void OnEnable()
+ {
+ cc = GetComponent<CharacterController>();
+ }
+
+ private void Update()
+ {
+ if (ReInput.isReady && player != null)
+ {
+ GetInput();
+ ProcessInput();
+ }
+ }
+
+ private void GetInput()
+ {
+ moveVector.x = player.GetAxis("Move Horizontal");
+ moveVector.y = player.GetAxis("Move Vertical");
+ fire = player.GetButtonDown("Fire");
+ }
+
+ private void ProcessInput()
+ {
+ if (moveVector.x != 0f || moveVector.y != 0f)
+ {
+ cc.Move(moveVector * moveSpeed * Time.deltaTime);
+ }
+ if (fire)
+ {
+ Object.Instantiate(bulletPrefab, base.transform.position + base.transform.right, base.transform.rotation).GetComponent<Rigidbody>().AddForce(base.transform.right * bulletSpeed, ForceMode.VelocityChange);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/SimpleCombinedKeyboardMouseRemapping.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/SimpleCombinedKeyboardMouseRemapping.cs
new file mode 100644
index 0000000..3a2544b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/SimpleCombinedKeyboardMouseRemapping.cs
@@ -0,0 +1,225 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+public class SimpleCombinedKeyboardMouseRemapping : MonoBehaviour
+{
+ private class Row
+ {
+ public InputAction action;
+
+ public AxisRange actionRange;
+
+ public Button button;
+
+ public Text text;
+ }
+
+ private struct TargetMapping
+ {
+ public ControllerMap controllerMap;
+
+ public int actionElementMapId;
+ }
+
+ private const string category = "Default";
+
+ private const string layout = "Default";
+
+ private const string uiCategory = "UI";
+
+ private InputMapper inputMapper_keyboard = new InputMapper();
+
+ private InputMapper inputMapper_mouse = new InputMapper();
+
+ public GameObject buttonPrefab;
+
+ public GameObject textPrefab;
+
+ public RectTransform fieldGroupTransform;
+
+ public RectTransform actionGroupTransform;
+
+ public Text controllerNameUIText;
+
+ public Text statusUIText;
+
+ private List<Row> rows = new List<Row>();
+
+ private TargetMapping _replaceTargetMapping;
+
+ private Player player => ReInput.players.GetPlayer(0);
+
+ private void OnEnable()
+ {
+ if (ReInput.isReady)
+ {
+ inputMapper_keyboard.options.timeout = 5f;
+ inputMapper_mouse.options.timeout = 5f;
+ inputMapper_mouse.options.ignoreMouseXAxis = true;
+ inputMapper_mouse.options.ignoreMouseYAxis = true;
+ inputMapper_keyboard.options.allowButtonsOnFullAxisAssignment = false;
+ inputMapper_mouse.options.allowButtonsOnFullAxisAssignment = false;
+ inputMapper_keyboard.InputMappedEvent += OnInputMapped;
+ inputMapper_keyboard.StoppedEvent += OnStopped;
+ inputMapper_mouse.InputMappedEvent += OnInputMapped;
+ inputMapper_mouse.StoppedEvent += OnStopped;
+ InitializeUI();
+ }
+ }
+
+ private void OnDisable()
+ {
+ inputMapper_keyboard.Stop();
+ inputMapper_mouse.Stop();
+ inputMapper_keyboard.RemoveAllEventListeners();
+ inputMapper_mouse.RemoveAllEventListeners();
+ }
+
+ private void RedrawUI()
+ {
+ controllerNameUIText.text = "Keyboard/Mouse";
+ for (int i = 0; i < rows.Count; i++)
+ {
+ Row row = rows[i];
+ InputAction action = rows[i].action;
+ string text = string.Empty;
+ int actionElementMapId = -1;
+ for (int j = 0; j < 2; j++)
+ {
+ ControllerType controllerType = ((j != 0) ? ControllerType.Mouse : ControllerType.Keyboard);
+ foreach (ActionElementMap item in player.controllers.maps.GetMap(controllerType, 0, "Default", "Default").ElementMapsWithAction(action.id))
+ {
+ if (item.ShowInField(row.actionRange))
+ {
+ text = item.elementIdentifierName;
+ actionElementMapId = item.id;
+ break;
+ }
+ }
+ if (actionElementMapId >= 0)
+ {
+ break;
+ }
+ }
+ row.text.text = text;
+ row.button.onClick.RemoveAllListeners();
+ int index = i;
+ row.button.onClick.AddListener(delegate
+ {
+ OnInputFieldClicked(index, actionElementMapId);
+ });
+ }
+ }
+
+ private void ClearUI()
+ {
+ controllerNameUIText.text = string.Empty;
+ for (int i = 0; i < rows.Count; i++)
+ {
+ rows[i].text.text = string.Empty;
+ }
+ }
+
+ private void InitializeUI()
+ {
+ foreach (Transform item in actionGroupTransform)
+ {
+ Object.Destroy(item.gameObject);
+ }
+ foreach (Transform item2 in fieldGroupTransform)
+ {
+ Object.Destroy(item2.gameObject);
+ }
+ foreach (InputAction item3 in ReInput.mapping.ActionsInCategory("Default"))
+ {
+ if (item3.type == InputActionType.Axis)
+ {
+ CreateUIRow(item3, AxisRange.Full, item3.descriptiveName);
+ CreateUIRow(item3, AxisRange.Positive, (!string.IsNullOrEmpty(item3.positiveDescriptiveName)) ? item3.positiveDescriptiveName : (item3.descriptiveName + " +"));
+ CreateUIRow(item3, AxisRange.Negative, (!string.IsNullOrEmpty(item3.negativeDescriptiveName)) ? item3.negativeDescriptiveName : (item3.descriptiveName + " -"));
+ }
+ else if (item3.type == InputActionType.Button)
+ {
+ CreateUIRow(item3, AxisRange.Positive, item3.descriptiveName);
+ }
+ }
+ RedrawUI();
+ }
+
+ private void CreateUIRow(InputAction action, AxisRange actionRange, string label)
+ {
+ GameObject obj = Object.Instantiate(textPrefab);
+ obj.transform.SetParent(actionGroupTransform);
+ obj.transform.SetAsLastSibling();
+ obj.GetComponent<Text>().text = label;
+ GameObject gameObject = Object.Instantiate(buttonPrefab);
+ gameObject.transform.SetParent(fieldGroupTransform);
+ gameObject.transform.SetAsLastSibling();
+ rows.Add(new Row
+ {
+ action = action,
+ actionRange = actionRange,
+ button = gameObject.GetComponent<Button>(),
+ text = gameObject.GetComponentInChildren<Text>()
+ });
+ }
+
+ private void OnInputFieldClicked(int index, int actionElementMapToReplaceId)
+ {
+ if (index >= 0 && index < rows.Count)
+ {
+ ControllerMap map = player.controllers.maps.GetMap(ControllerType.Keyboard, 0, "Default", "Default");
+ ControllerMap map2 = player.controllers.maps.GetMap(ControllerType.Mouse, 0, "Default", "Default");
+ ControllerMap controllerMap = (map.ContainsElementMap(actionElementMapToReplaceId) ? map : ((!map2.ContainsElementMap(actionElementMapToReplaceId)) ? null : map2));
+ _replaceTargetMapping = new TargetMapping
+ {
+ actionElementMapId = actionElementMapToReplaceId,
+ controllerMap = controllerMap
+ };
+ StartCoroutine(StartListeningDelayed(index, map, map2, actionElementMapToReplaceId));
+ }
+ }
+
+ private IEnumerator StartListeningDelayed(int index, ControllerMap keyboardMap, ControllerMap mouseMap, int actionElementMapToReplaceId)
+ {
+ yield return new WaitForSeconds(0.1f);
+ inputMapper_keyboard.Start(new InputMapper.Context
+ {
+ actionId = rows[index].action.id,
+ controllerMap = keyboardMap,
+ actionRange = rows[index].actionRange,
+ actionElementMapToReplace = keyboardMap.GetElementMap(actionElementMapToReplaceId)
+ });
+ inputMapper_mouse.Start(new InputMapper.Context
+ {
+ actionId = rows[index].action.id,
+ controllerMap = mouseMap,
+ actionRange = rows[index].actionRange,
+ actionElementMapToReplace = mouseMap.GetElementMap(actionElementMapToReplaceId)
+ });
+ player.controllers.maps.SetMapsEnabled(state: false, "UI");
+ statusUIText.text = "Listening...";
+ }
+
+ private void OnInputMapped(InputMapper.InputMappedEventData data)
+ {
+ inputMapper_keyboard.Stop();
+ inputMapper_mouse.Stop();
+ if (_replaceTargetMapping.controllerMap != null && data.actionElementMap.controllerMap != _replaceTargetMapping.controllerMap)
+ {
+ _replaceTargetMapping.controllerMap.DeleteElementMap(_replaceTargetMapping.actionElementMapId);
+ }
+ RedrawUI();
+ }
+
+ private void OnStopped(InputMapper.StoppedEventData data)
+ {
+ statusUIText.text = string.Empty;
+ player.controllers.maps.SetMapsEnabled(state: true, "UI");
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/SimpleControlRemapping.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/SimpleControlRemapping.cs
new file mode 100644
index 0000000..386ebe7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/SimpleControlRemapping.cs
@@ -0,0 +1,257 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+public class SimpleControlRemapping : MonoBehaviour
+{
+ private class Row
+ {
+ public InputAction action;
+
+ public AxisRange actionRange;
+
+ public Button button;
+
+ public Text text;
+ }
+
+ private const string category = "Default";
+
+ private const string layout = "Default";
+
+ private const string uiCategory = "UI";
+
+ private InputMapper inputMapper = new InputMapper();
+
+ public GameObject buttonPrefab;
+
+ public GameObject textPrefab;
+
+ public RectTransform fieldGroupTransform;
+
+ public RectTransform actionGroupTransform;
+
+ public Text controllerNameUIText;
+
+ public Text statusUIText;
+
+ private ControllerType selectedControllerType;
+
+ private int selectedControllerId;
+
+ private List<Row> rows = new List<Row>();
+
+ private Player player => ReInput.players.GetPlayer(0);
+
+ private ControllerMap controllerMap
+ {
+ get
+ {
+ if (controller == null)
+ {
+ return null;
+ }
+ return player.controllers.maps.GetMap(controller.type, controller.id, "Default", "Default");
+ }
+ }
+
+ private Controller controller => player.controllers.GetController(selectedControllerType, selectedControllerId);
+
+ private void OnEnable()
+ {
+ if (ReInput.isReady)
+ {
+ inputMapper.options.timeout = 5f;
+ inputMapper.options.ignoreMouseXAxis = true;
+ inputMapper.options.ignoreMouseYAxis = true;
+ ReInput.ControllerConnectedEvent += OnControllerChanged;
+ ReInput.ControllerDisconnectedEvent += OnControllerChanged;
+ inputMapper.InputMappedEvent += OnInputMapped;
+ inputMapper.StoppedEvent += OnStopped;
+ InitializeUI();
+ }
+ }
+
+ private void OnDisable()
+ {
+ inputMapper.Stop();
+ inputMapper.RemoveAllEventListeners();
+ ReInput.ControllerConnectedEvent -= OnControllerChanged;
+ ReInput.ControllerDisconnectedEvent -= OnControllerChanged;
+ }
+
+ private void RedrawUI()
+ {
+ if (controller == null)
+ {
+ ClearUI();
+ return;
+ }
+ controllerNameUIText.text = controller.name;
+ for (int i = 0; i < rows.Count; i++)
+ {
+ Row row = rows[i];
+ InputAction action = rows[i].action;
+ string text = string.Empty;
+ int actionElementMapId = -1;
+ foreach (ActionElementMap item in controllerMap.ElementMapsWithAction(action.id))
+ {
+ if (item.ShowInField(row.actionRange))
+ {
+ text = item.elementIdentifierName;
+ actionElementMapId = item.id;
+ break;
+ }
+ }
+ row.text.text = text;
+ row.button.onClick.RemoveAllListeners();
+ int index = i;
+ row.button.onClick.AddListener(delegate
+ {
+ OnInputFieldClicked(index, actionElementMapId);
+ });
+ }
+ }
+
+ private void ClearUI()
+ {
+ if (selectedControllerType == ControllerType.Joystick)
+ {
+ controllerNameUIText.text = "No joysticks attached";
+ }
+ else
+ {
+ controllerNameUIText.text = string.Empty;
+ }
+ for (int i = 0; i < rows.Count; i++)
+ {
+ rows[i].text.text = string.Empty;
+ }
+ }
+
+ private void InitializeUI()
+ {
+ foreach (Transform item in actionGroupTransform)
+ {
+ Object.Destroy(item.gameObject);
+ }
+ foreach (Transform item2 in fieldGroupTransform)
+ {
+ Object.Destroy(item2.gameObject);
+ }
+ foreach (InputAction item3 in ReInput.mapping.ActionsInCategory("Default"))
+ {
+ if (item3.type == InputActionType.Axis)
+ {
+ CreateUIRow(item3, AxisRange.Full, item3.descriptiveName);
+ CreateUIRow(item3, AxisRange.Positive, (!string.IsNullOrEmpty(item3.positiveDescriptiveName)) ? item3.positiveDescriptiveName : (item3.descriptiveName + " +"));
+ CreateUIRow(item3, AxisRange.Negative, (!string.IsNullOrEmpty(item3.negativeDescriptiveName)) ? item3.negativeDescriptiveName : (item3.descriptiveName + " -"));
+ }
+ else if (item3.type == InputActionType.Button)
+ {
+ CreateUIRow(item3, AxisRange.Positive, item3.descriptiveName);
+ }
+ }
+ RedrawUI();
+ }
+
+ private void CreateUIRow(InputAction action, AxisRange actionRange, string label)
+ {
+ GameObject obj = Object.Instantiate(textPrefab);
+ obj.transform.SetParent(actionGroupTransform);
+ obj.transform.SetAsLastSibling();
+ obj.GetComponent<Text>().text = label;
+ GameObject gameObject = Object.Instantiate(buttonPrefab);
+ gameObject.transform.SetParent(fieldGroupTransform);
+ gameObject.transform.SetAsLastSibling();
+ rows.Add(new Row
+ {
+ action = action,
+ actionRange = actionRange,
+ button = gameObject.GetComponent<Button>(),
+ text = gameObject.GetComponentInChildren<Text>()
+ });
+ }
+
+ private void SetSelectedController(ControllerType controllerType)
+ {
+ bool flag = false;
+ if (controllerType != selectedControllerType)
+ {
+ selectedControllerType = controllerType;
+ flag = true;
+ }
+ int num = selectedControllerId;
+ if (selectedControllerType == ControllerType.Joystick)
+ {
+ if (player.controllers.joystickCount > 0)
+ {
+ selectedControllerId = player.controllers.Joysticks[0].id;
+ }
+ else
+ {
+ selectedControllerId = -1;
+ }
+ }
+ else
+ {
+ selectedControllerId = 0;
+ }
+ if (selectedControllerId != num)
+ {
+ flag = true;
+ }
+ if (flag)
+ {
+ inputMapper.Stop();
+ RedrawUI();
+ }
+ }
+
+ public void OnControllerSelected(int controllerType)
+ {
+ SetSelectedController((ControllerType)controllerType);
+ }
+
+ private void OnInputFieldClicked(int index, int actionElementMapToReplaceId)
+ {
+ if (index >= 0 && index < rows.Count && controller != null)
+ {
+ StartCoroutine(StartListeningDelayed(index, actionElementMapToReplaceId));
+ }
+ }
+
+ private IEnumerator StartListeningDelayed(int index, int actionElementMapToReplaceId)
+ {
+ yield return new WaitForSeconds(0.1f);
+ inputMapper.Start(new InputMapper.Context
+ {
+ actionId = rows[index].action.id,
+ controllerMap = controllerMap,
+ actionRange = rows[index].actionRange,
+ actionElementMapToReplace = controllerMap.GetElementMap(actionElementMapToReplaceId)
+ });
+ player.controllers.maps.SetMapsEnabled(state: false, "UI");
+ statusUIText.text = "Listening...";
+ }
+
+ private void OnControllerChanged(ControllerStatusChangedEventArgs args)
+ {
+ SetSelectedController(selectedControllerType);
+ }
+
+ private void OnInputMapped(InputMapper.InputMappedEventData data)
+ {
+ RedrawUI();
+ }
+
+ private void OnStopped(InputMapper.StoppedEventData data)
+ {
+ statusUIText.text = string.Empty;
+ player.controllers.maps.SetMapsEnabled(state: true, "UI");
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/TouchButtonExample.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/TouchButtonExample.cs
new file mode 100644
index 0000000..af6edad
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/TouchButtonExample.cs
@@ -0,0 +1,52 @@
+using UnityEngine;
+using UnityEngine.EventSystems;
+using UnityEngine.UI;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+[RequireComponent(typeof(Image))]
+public class TouchButtonExample : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IPointerUpHandler
+{
+ public bool allowMouseControl = true;
+
+ public bool isPressed { get; private set; }
+
+ private void Awake()
+ {
+ if (SystemInfo.deviceType == DeviceType.Handheld)
+ {
+ allowMouseControl = false;
+ }
+ }
+
+ private void Restart()
+ {
+ isPressed = false;
+ }
+
+ void IPointerDownHandler.OnPointerDown(PointerEventData eventData)
+ {
+ if (allowMouseControl || !IsMousePointerId(eventData.pointerId))
+ {
+ isPressed = true;
+ }
+ }
+
+ void IPointerUpHandler.OnPointerUp(PointerEventData eventData)
+ {
+ if (allowMouseControl || !IsMousePointerId(eventData.pointerId))
+ {
+ isPressed = false;
+ }
+ }
+
+ private static bool IsMousePointerId(int id)
+ {
+ if (id != -1 && id != -2)
+ {
+ return id == -3;
+ }
+ return true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/TouchJoystickExample.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/TouchJoystickExample.cs
new file mode 100644
index 0000000..f05af89
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/TouchJoystickExample.cs
@@ -0,0 +1,110 @@
+using System;
+using UnityEngine;
+using UnityEngine.EventSystems;
+using UnityEngine.UI;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+[RequireComponent(typeof(Image))]
+public class TouchJoystickExample : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IPointerUpHandler, IDragHandler
+{
+ public bool allowMouseControl = true;
+
+ public int radius = 50;
+
+ private Vector2 origAnchoredPosition;
+
+ private Vector3 origWorldPosition;
+
+ private Vector2 origScreenResolution;
+
+ private ScreenOrientation origScreenOrientation;
+
+ [NonSerialized]
+ private bool hasFinger;
+
+ [NonSerialized]
+ private int lastFingerId;
+
+ public Vector2 position { get; private set; }
+
+ private void Start()
+ {
+ if (SystemInfo.deviceType == DeviceType.Handheld)
+ {
+ allowMouseControl = false;
+ }
+ StoreOrigValues();
+ }
+
+ private void Update()
+ {
+ if ((float)Screen.width != origScreenResolution.x || (float)Screen.height != origScreenResolution.y || Screen.orientation != origScreenOrientation)
+ {
+ Restart();
+ StoreOrigValues();
+ }
+ }
+
+ private void Restart()
+ {
+ hasFinger = false;
+ (base.transform as RectTransform).anchoredPosition = origAnchoredPosition;
+ position = Vector2.zero;
+ }
+
+ private void StoreOrigValues()
+ {
+ origAnchoredPosition = (base.transform as RectTransform).anchoredPosition;
+ origWorldPosition = base.transform.position;
+ origScreenResolution = new Vector2(Screen.width, Screen.height);
+ origScreenOrientation = Screen.orientation;
+ }
+
+ private void UpdateValue(Vector3 value)
+ {
+ Vector3 vector = origWorldPosition - value;
+ vector.y = 0f - vector.y;
+ vector /= (float)radius;
+ position = new Vector2(0f - vector.x, vector.y);
+ }
+
+ void IPointerDownHandler.OnPointerDown(PointerEventData eventData)
+ {
+ if (!hasFinger && (allowMouseControl || !IsMousePointerId(eventData.pointerId)))
+ {
+ hasFinger = true;
+ lastFingerId = eventData.pointerId;
+ }
+ }
+
+ void IPointerUpHandler.OnPointerUp(PointerEventData eventData)
+ {
+ if (eventData.pointerId == lastFingerId && (allowMouseControl || !IsMousePointerId(eventData.pointerId)))
+ {
+ Restart();
+ }
+ }
+
+ void IDragHandler.OnDrag(PointerEventData eventData)
+ {
+ if (hasFinger && eventData.pointerId == lastFingerId)
+ {
+ Vector3 vector = new Vector3(eventData.position.x - origWorldPosition.x, eventData.position.y - origWorldPosition.y);
+ vector = Vector3.ClampMagnitude(vector, radius);
+ Vector3 value = origWorldPosition + vector;
+ base.transform.position = value;
+ UpdateValue(value);
+ }
+ }
+
+ private static bool IsMousePointerId(int id)
+ {
+ if (id != -1 && id != -2)
+ {
+ return id == -3;
+ }
+ return true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Demos/UIPointer.cs b/Thronefall_v1.57/Thronefall/Rewired.Demos/UIPointer.cs
new file mode 100644
index 0000000..c65fdae
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Demos/UIPointer.cs
@@ -0,0 +1,98 @@
+using UnityEngine;
+using UnityEngine.EventSystems;
+using UnityEngine.UI;
+
+namespace Rewired.Demos;
+
+[AddComponentMenu("")]
+[RequireComponent(typeof(RectTransform))]
+public sealed class UIPointer : UIBehaviour
+{
+ [Tooltip("Should the hardware pointer be hidden?")]
+ [SerializeField]
+ private bool _hideHardwarePointer = true;
+
+ [Tooltip("Sets the pointer to the last sibling in the parent hierarchy. Do not enable this on multiple UIPointers under the same parent transform or they will constantly fight each other for dominance.")]
+ [SerializeField]
+ private bool _autoSort = true;
+
+ private Canvas _canvas;
+
+ public bool autoSort
+ {
+ get
+ {
+ return _autoSort;
+ }
+ set
+ {
+ if (value != _autoSort)
+ {
+ _autoSort = value;
+ if (value)
+ {
+ base.transform.SetAsLastSibling();
+ }
+ }
+ }
+ }
+
+ protected override void Awake()
+ {
+ base.Awake();
+ Graphic[] componentsInChildren = GetComponentsInChildren<Graphic>();
+ for (int i = 0; i < componentsInChildren.Length; i++)
+ {
+ componentsInChildren[i].raycastTarget = false;
+ }
+ if (_hideHardwarePointer)
+ {
+ Cursor.visible = false;
+ }
+ if (_autoSort)
+ {
+ base.transform.SetAsLastSibling();
+ }
+ GetDependencies();
+ }
+
+ private void Update()
+ {
+ if (_autoSort && base.transform.GetSiblingIndex() < base.transform.parent.childCount - 1)
+ {
+ base.transform.SetAsLastSibling();
+ }
+ }
+
+ protected override void OnTransformParentChanged()
+ {
+ base.OnTransformParentChanged();
+ GetDependencies();
+ }
+
+ protected override void OnCanvasGroupChanged()
+ {
+ base.OnCanvasGroupChanged();
+ GetDependencies();
+ }
+
+ public void OnScreenPositionChanged(Vector2 screenPosition)
+ {
+ if (!(_canvas == null))
+ {
+ Camera cam = null;
+ RenderMode renderMode = _canvas.renderMode;
+ if (renderMode != 0 && (uint)(renderMode - 1) <= 1u)
+ {
+ cam = _canvas.worldCamera;
+ }
+ RectTransformUtility.ScreenPointToLocalPointInRectangle(base.transform.parent as RectTransform, screenPosition, cam, out var localPoint);
+ base.transform.localPosition = new Vector3(localPoint.x, localPoint.y, base.transform.localPosition.z);
+ }
+ }
+
+ private void GetDependencies()
+ {
+ _canvas = base.transform.root.GetComponentInChildren<Canvas>();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/PlayerPointerEventData.cs b/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/PlayerPointerEventData.cs
new file mode 100644
index 0000000..0c95915
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/PlayerPointerEventData.cs
@@ -0,0 +1,41 @@
+using System.Text;
+using Rewired.UI;
+using UnityEngine.EventSystems;
+
+namespace Rewired.Integration.UnityUI;
+
+public class PlayerPointerEventData : PointerEventData
+{
+ public int playerId { get; set; }
+
+ public int inputSourceIndex { get; set; }
+
+ public IMouseInputSource mouseSource { get; set; }
+
+ public ITouchInputSource touchSource { get; set; }
+
+ public PointerEventType sourceType { get; set; }
+
+ public int buttonIndex { get; set; }
+
+ public PlayerPointerEventData(EventSystem eventSystem)
+ : base(eventSystem)
+ {
+ playerId = -1;
+ inputSourceIndex = -1;
+ buttonIndex = -1;
+ }
+
+ public override string ToString()
+ {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.AppendLine("<b>Player Id</b>: " + playerId);
+ stringBuilder.AppendLine("<b>Mouse Source</b>: " + mouseSource);
+ stringBuilder.AppendLine("<b>Input Source Index</b>: " + inputSourceIndex);
+ stringBuilder.AppendLine("<b>Touch Source/b>: " + touchSource);
+ stringBuilder.AppendLine("<b>Source Type</b>: " + sourceType);
+ stringBuilder.AppendLine("<b>Button Index</b>: " + buttonIndex);
+ stringBuilder.Append(base.ToString());
+ return stringBuilder.ToString();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/PointerEventType.cs b/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/PointerEventType.cs
new file mode 100644
index 0000000..ce70ee8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/PointerEventType.cs
@@ -0,0 +1,7 @@
+namespace Rewired.Integration.UnityUI;
+
+public enum PointerEventType
+{
+ Mouse,
+ Touch
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/RewiredEventSystem.cs b/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/RewiredEventSystem.cs
new file mode 100644
index 0000000..c46b002
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/RewiredEventSystem.cs
@@ -0,0 +1,49 @@
+using UnityEngine;
+using UnityEngine.EventSystems;
+
+namespace Rewired.Integration.UnityUI;
+
+[AddComponentMenu("Rewired/Rewired Event System")]
+public class RewiredEventSystem : EventSystem
+{
+ [Tooltip("If enabled, the Event System will be updated every frame even if other Event Systems are enabled. Otherwise, only EventSystem.current will be updated.")]
+ [SerializeField]
+ private bool _alwaysUpdate;
+
+ public bool alwaysUpdate
+ {
+ get
+ {
+ return _alwaysUpdate;
+ }
+ set
+ {
+ _alwaysUpdate = value;
+ }
+ }
+
+ protected override void Update()
+ {
+ if (alwaysUpdate)
+ {
+ EventSystem eventSystem = EventSystem.current;
+ if (eventSystem != this)
+ {
+ EventSystem.current = this;
+ }
+ try
+ {
+ base.Update();
+ return;
+ }
+ finally
+ {
+ if (eventSystem != this)
+ {
+ EventSystem.current = eventSystem;
+ }
+ }
+ }
+ base.Update();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/RewiredPointerInputModule.cs b/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/RewiredPointerInputModule.cs
new file mode 100644
index 0000000..27d419b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/RewiredPointerInputModule.cs
@@ -0,0 +1,781 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Rewired.UI;
+using Rewired.Utils;
+using UnityEngine;
+using UnityEngine.EventSystems;
+
+namespace Rewired.Integration.UnityUI;
+
+public abstract class RewiredPointerInputModule : BaseInputModule
+{
+ protected class MouseState
+ {
+ private List<ButtonState> m_TrackedButtons = new List<ButtonState>();
+
+ public bool AnyPressesThisFrame()
+ {
+ for (int i = 0; i < m_TrackedButtons.Count; i++)
+ {
+ if (m_TrackedButtons[i].eventData.PressedThisFrame())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public bool AnyReleasesThisFrame()
+ {
+ for (int i = 0; i < m_TrackedButtons.Count; i++)
+ {
+ if (m_TrackedButtons[i].eventData.ReleasedThisFrame())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public ButtonState GetButtonState(int button)
+ {
+ ButtonState buttonState = null;
+ for (int i = 0; i < m_TrackedButtons.Count; i++)
+ {
+ if (m_TrackedButtons[i].button == button)
+ {
+ buttonState = m_TrackedButtons[i];
+ break;
+ }
+ }
+ if (buttonState == null)
+ {
+ buttonState = new ButtonState
+ {
+ button = button,
+ eventData = new MouseButtonEventData()
+ };
+ m_TrackedButtons.Add(buttonState);
+ }
+ return buttonState;
+ }
+
+ public void SetButtonState(int button, PointerEventData.FramePressState stateForMouseButton, PlayerPointerEventData data)
+ {
+ ButtonState buttonState = GetButtonState(button);
+ buttonState.eventData.buttonState = stateForMouseButton;
+ buttonState.eventData.buttonData = data;
+ }
+ }
+
+ public class MouseButtonEventData
+ {
+ public PointerEventData.FramePressState buttonState;
+
+ public PlayerPointerEventData buttonData;
+
+ public bool PressedThisFrame()
+ {
+ if (buttonState != 0)
+ {
+ return buttonState == PointerEventData.FramePressState.PressedAndReleased;
+ }
+ return true;
+ }
+
+ public bool ReleasedThisFrame()
+ {
+ if (buttonState != PointerEventData.FramePressState.Released)
+ {
+ return buttonState == PointerEventData.FramePressState.PressedAndReleased;
+ }
+ return true;
+ }
+ }
+
+ protected class ButtonState
+ {
+ private int m_Button;
+
+ private MouseButtonEventData m_EventData;
+
+ public MouseButtonEventData eventData
+ {
+ get
+ {
+ return m_EventData;
+ }
+ set
+ {
+ m_EventData = value;
+ }
+ }
+
+ public int button
+ {
+ get
+ {
+ return m_Button;
+ }
+ set
+ {
+ m_Button = value;
+ }
+ }
+ }
+
+ private sealed class UnityInputSource : IMouseInputSource, ITouchInputSource
+ {
+ private Vector2 m_MousePosition;
+
+ private Vector2 m_MousePositionPrev;
+
+ private int m_LastUpdatedFrame = -1;
+
+ int IMouseInputSource.playerId
+ {
+ get
+ {
+ TryUpdate();
+ return 0;
+ }
+ }
+
+ int ITouchInputSource.playerId
+ {
+ get
+ {
+ TryUpdate();
+ return 0;
+ }
+ }
+
+ bool IMouseInputSource.enabled
+ {
+ get
+ {
+ TryUpdate();
+ return Input.mousePresent;
+ }
+ }
+
+ bool IMouseInputSource.locked
+ {
+ get
+ {
+ TryUpdate();
+ return Cursor.lockState == CursorLockMode.Locked;
+ }
+ }
+
+ int IMouseInputSource.buttonCount
+ {
+ get
+ {
+ TryUpdate();
+ return 3;
+ }
+ }
+
+ Vector2 IMouseInputSource.screenPosition
+ {
+ get
+ {
+ TryUpdate();
+ return Input.mousePosition;
+ }
+ }
+
+ Vector2 IMouseInputSource.screenPositionDelta
+ {
+ get
+ {
+ TryUpdate();
+ return m_MousePosition - m_MousePositionPrev;
+ }
+ }
+
+ Vector2 IMouseInputSource.wheelDelta
+ {
+ get
+ {
+ TryUpdate();
+ return Input.mouseScrollDelta;
+ }
+ }
+
+ bool ITouchInputSource.touchSupported
+ {
+ get
+ {
+ TryUpdate();
+ return Input.touchSupported;
+ }
+ }
+
+ int ITouchInputSource.touchCount
+ {
+ get
+ {
+ TryUpdate();
+ return Input.touchCount;
+ }
+ }
+
+ bool IMouseInputSource.GetButtonDown(int button)
+ {
+ TryUpdate();
+ return Input.GetMouseButtonDown(button);
+ }
+
+ bool IMouseInputSource.GetButtonUp(int button)
+ {
+ TryUpdate();
+ return Input.GetMouseButtonUp(button);
+ }
+
+ bool IMouseInputSource.GetButton(int button)
+ {
+ TryUpdate();
+ return Input.GetMouseButton(button);
+ }
+
+ Touch ITouchInputSource.GetTouch(int index)
+ {
+ TryUpdate();
+ return Input.GetTouch(index);
+ }
+
+ private void TryUpdate()
+ {
+ if (Time.frameCount != m_LastUpdatedFrame)
+ {
+ m_LastUpdatedFrame = Time.frameCount;
+ m_MousePositionPrev = m_MousePosition;
+ m_MousePosition = Input.mousePosition;
+ }
+ }
+ }
+
+ public const int kMouseLeftId = -1;
+
+ public const int kMouseRightId = -2;
+
+ public const int kMouseMiddleId = -3;
+
+ public const int kFakeTouchesId = -4;
+
+ private const int customButtonsStartingId = -2147483520;
+
+ private const int customButtonsMaxCount = 128;
+
+ private const int customButtonsLastId = -2147483392;
+
+ private readonly List<IMouseInputSource> m_MouseInputSourcesList = new List<IMouseInputSource>();
+
+ private Dictionary<int, Dictionary<int, PlayerPointerEventData>[]> m_PlayerPointerData = new Dictionary<int, Dictionary<int, PlayerPointerEventData>[]>();
+
+ private ITouchInputSource m_UserDefaultTouchInputSource;
+
+ private UnityInputSource __m_DefaultInputSource;
+
+ private readonly MouseState m_MouseState = new MouseState();
+
+ private UnityInputSource defaultInputSource
+ {
+ get
+ {
+ if (__m_DefaultInputSource == null)
+ {
+ return __m_DefaultInputSource = new UnityInputSource();
+ }
+ return __m_DefaultInputSource;
+ }
+ }
+
+ private IMouseInputSource defaultMouseInputSource => defaultInputSource;
+
+ protected ITouchInputSource defaultTouchInputSource => defaultInputSource;
+
+ protected virtual bool isMouseSupported
+ {
+ get
+ {
+ int count = m_MouseInputSourcesList.Count;
+ if (count == 0)
+ {
+ return defaultMouseInputSource.enabled;
+ }
+ for (int i = 0; i < count; i++)
+ {
+ if (m_MouseInputSourcesList[i].enabled)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ protected bool IsDefaultMouse(IMouseInputSource mouse)
+ {
+ return defaultMouseInputSource == mouse;
+ }
+
+ public IMouseInputSource GetMouseInputSource(int playerId, int mouseIndex)
+ {
+ if (mouseIndex < 0)
+ {
+ throw new ArgumentOutOfRangeException("mouseIndex");
+ }
+ if (m_MouseInputSourcesList.Count == 0 && IsDefaultPlayer(playerId))
+ {
+ return defaultMouseInputSource;
+ }
+ int count = m_MouseInputSourcesList.Count;
+ int num = 0;
+ for (int i = 0; i < count; i++)
+ {
+ IMouseInputSource mouseInputSource = m_MouseInputSourcesList[i];
+ if (!UnityTools.IsNullOrDestroyed(mouseInputSource) && mouseInputSource.playerId == playerId)
+ {
+ if (mouseIndex == num)
+ {
+ return mouseInputSource;
+ }
+ num++;
+ }
+ }
+ return null;
+ }
+
+ public void RemoveMouseInputSource(IMouseInputSource source)
+ {
+ if (source == null)
+ {
+ throw new ArgumentNullException("source");
+ }
+ m_MouseInputSourcesList.Remove(source);
+ }
+
+ public void AddMouseInputSource(IMouseInputSource source)
+ {
+ if (UnityTools.IsNullOrDestroyed(source))
+ {
+ throw new ArgumentNullException("source");
+ }
+ m_MouseInputSourcesList.Add(source);
+ }
+
+ public int GetMouseInputSourceCount(int playerId)
+ {
+ if (m_MouseInputSourcesList.Count == 0 && IsDefaultPlayer(playerId))
+ {
+ return 1;
+ }
+ int count = m_MouseInputSourcesList.Count;
+ int num = 0;
+ for (int i = 0; i < count; i++)
+ {
+ IMouseInputSource mouseInputSource = m_MouseInputSourcesList[i];
+ if (!UnityTools.IsNullOrDestroyed(mouseInputSource) && mouseInputSource.playerId == playerId)
+ {
+ num++;
+ }
+ }
+ return num;
+ }
+
+ public ITouchInputSource GetTouchInputSource(int playerId, int sourceIndex)
+ {
+ if (!UnityTools.IsNullOrDestroyed(m_UserDefaultTouchInputSource))
+ {
+ return m_UserDefaultTouchInputSource;
+ }
+ return defaultTouchInputSource;
+ }
+
+ public void RemoveTouchInputSource(ITouchInputSource source)
+ {
+ if (source == null)
+ {
+ throw new ArgumentNullException("source");
+ }
+ if (m_UserDefaultTouchInputSource == source)
+ {
+ m_UserDefaultTouchInputSource = null;
+ }
+ }
+
+ public void AddTouchInputSource(ITouchInputSource source)
+ {
+ if (UnityTools.IsNullOrDestroyed(source))
+ {
+ throw new ArgumentNullException("source");
+ }
+ m_UserDefaultTouchInputSource = source;
+ }
+
+ public int GetTouchInputSourceCount(int playerId)
+ {
+ if (!IsDefaultPlayer(playerId))
+ {
+ return 0;
+ }
+ return 1;
+ }
+
+ protected void ClearMouseInputSources()
+ {
+ m_MouseInputSourcesList.Clear();
+ }
+
+ protected abstract bool IsDefaultPlayer(int playerId);
+
+ protected bool GetPointerData(int playerId, int pointerIndex, int pointerTypeId, out PlayerPointerEventData data, bool create, PointerEventType pointerEventType)
+ {
+ if (!m_PlayerPointerData.TryGetValue(playerId, out var value))
+ {
+ value = new Dictionary<int, PlayerPointerEventData>[pointerIndex + 1];
+ for (int i = 0; i < value.Length; i++)
+ {
+ value[i] = new Dictionary<int, PlayerPointerEventData>();
+ }
+ m_PlayerPointerData.Add(playerId, value);
+ }
+ if (pointerIndex >= value.Length)
+ {
+ Dictionary<int, PlayerPointerEventData>[] array = new Dictionary<int, PlayerPointerEventData>[pointerIndex + 1];
+ for (int j = 0; j < value.Length; j++)
+ {
+ array[j] = value[j];
+ }
+ array[pointerIndex] = new Dictionary<int, PlayerPointerEventData>();
+ value = array;
+ m_PlayerPointerData[playerId] = value;
+ }
+ Dictionary<int, PlayerPointerEventData> dictionary = value[pointerIndex];
+ if (!dictionary.TryGetValue(pointerTypeId, out data))
+ {
+ if (!create)
+ {
+ return false;
+ }
+ data = CreatePointerEventData(playerId, pointerIndex, pointerTypeId, pointerEventType);
+ dictionary.Add(pointerTypeId, data);
+ return true;
+ }
+ data.mouseSource = ((pointerEventType == PointerEventType.Mouse) ? GetMouseInputSource(playerId, pointerIndex) : null);
+ data.touchSource = ((pointerEventType == PointerEventType.Touch) ? GetTouchInputSource(playerId, pointerIndex) : null);
+ return false;
+ }
+
+ private PlayerPointerEventData CreatePointerEventData(int playerId, int pointerIndex, int pointerTypeId, PointerEventType pointerEventType)
+ {
+ PlayerPointerEventData playerPointerEventData = new PlayerPointerEventData(base.eventSystem)
+ {
+ playerId = playerId,
+ inputSourceIndex = pointerIndex,
+ pointerId = pointerTypeId,
+ sourceType = pointerEventType
+ };
+ switch (pointerEventType)
+ {
+ case PointerEventType.Mouse:
+ playerPointerEventData.mouseSource = GetMouseInputSource(playerId, pointerIndex);
+ break;
+ case PointerEventType.Touch:
+ playerPointerEventData.touchSource = GetTouchInputSource(playerId, pointerIndex);
+ break;
+ }
+ if (pointerTypeId == -1)
+ {
+ playerPointerEventData.buttonIndex = 0;
+ }
+ else if (pointerTypeId == -2)
+ {
+ playerPointerEventData.buttonIndex = 1;
+ }
+ else if (pointerTypeId == -3)
+ {
+ playerPointerEventData.buttonIndex = 2;
+ }
+ else if (pointerTypeId >= -2147483520 && pointerTypeId <= -2147483392)
+ {
+ playerPointerEventData.buttonIndex = pointerTypeId - -2147483520;
+ }
+ return playerPointerEventData;
+ }
+
+ protected void RemovePointerData(PlayerPointerEventData data)
+ {
+ if (m_PlayerPointerData.TryGetValue(data.playerId, out var value) && (uint)data.inputSourceIndex < (uint)value.Length)
+ {
+ value[data.inputSourceIndex].Remove(data.pointerId);
+ }
+ }
+
+ protected PlayerPointerEventData GetTouchPointerEventData(int playerId, int touchDeviceIndex, Touch input, out bool pressed, out bool released)
+ {
+ PlayerPointerEventData data;
+ bool pointerData = GetPointerData(playerId, touchDeviceIndex, input.fingerId, out data, create: true, PointerEventType.Touch);
+ data.Reset();
+ pressed = pointerData || input.phase == TouchPhase.Began;
+ released = input.phase == TouchPhase.Canceled || input.phase == TouchPhase.Ended;
+ if (pointerData)
+ {
+ data.position = input.position;
+ }
+ if (pressed)
+ {
+ data.delta = Vector2.zero;
+ }
+ else
+ {
+ data.delta = input.position - data.position;
+ }
+ data.position = input.position;
+ data.button = PointerEventData.InputButton.Left;
+ base.eventSystem.RaycastAll(data, m_RaycastResultCache);
+ RaycastResult pointerCurrentRaycast = BaseInputModule.FindFirstRaycast(m_RaycastResultCache);
+ data.pointerCurrentRaycast = pointerCurrentRaycast;
+ m_RaycastResultCache.Clear();
+ return data;
+ }
+
+ protected virtual MouseState GetMousePointerEventData(int playerId, int mouseIndex)
+ {
+ IMouseInputSource mouseInputSource = GetMouseInputSource(playerId, mouseIndex);
+ if (mouseInputSource == null)
+ {
+ return null;
+ }
+ PlayerPointerEventData data;
+ bool pointerData = GetPointerData(playerId, mouseIndex, -1, out data, create: true, PointerEventType.Mouse);
+ data.Reset();
+ if (pointerData)
+ {
+ data.position = mouseInputSource.screenPosition;
+ }
+ Vector2 screenPosition = mouseInputSource.screenPosition;
+ if (mouseInputSource.locked || !mouseInputSource.enabled)
+ {
+ data.position = new Vector2(-1f, -1f);
+ data.delta = Vector2.zero;
+ }
+ else
+ {
+ data.delta = screenPosition - data.position;
+ data.position = screenPosition;
+ }
+ data.scrollDelta = mouseInputSource.wheelDelta;
+ data.button = PointerEventData.InputButton.Left;
+ base.eventSystem.RaycastAll(data, m_RaycastResultCache);
+ RaycastResult pointerCurrentRaycast = BaseInputModule.FindFirstRaycast(m_RaycastResultCache);
+ data.pointerCurrentRaycast = pointerCurrentRaycast;
+ m_RaycastResultCache.Clear();
+ GetPointerData(playerId, mouseIndex, -2, out var data2, create: true, PointerEventType.Mouse);
+ CopyFromTo(data, data2);
+ data2.button = PointerEventData.InputButton.Right;
+ GetPointerData(playerId, mouseIndex, -3, out var data3, create: true, PointerEventType.Mouse);
+ CopyFromTo(data, data3);
+ data3.button = PointerEventData.InputButton.Middle;
+ for (int i = 3; i < mouseInputSource.buttonCount; i++)
+ {
+ GetPointerData(playerId, mouseIndex, -2147483520 + i, out var data4, create: true, PointerEventType.Mouse);
+ CopyFromTo(data, data4);
+ data4.button = (PointerEventData.InputButton)(-1);
+ }
+ m_MouseState.SetButtonState(0, StateForMouseButton(playerId, mouseIndex, 0), data);
+ m_MouseState.SetButtonState(1, StateForMouseButton(playerId, mouseIndex, 1), data2);
+ m_MouseState.SetButtonState(2, StateForMouseButton(playerId, mouseIndex, 2), data3);
+ for (int j = 3; j < mouseInputSource.buttonCount; j++)
+ {
+ GetPointerData(playerId, mouseIndex, -2147483520 + j, out var data5, create: false, PointerEventType.Mouse);
+ m_MouseState.SetButtonState(j, StateForMouseButton(playerId, mouseIndex, j), data5);
+ }
+ return m_MouseState;
+ }
+
+ protected PlayerPointerEventData GetLastPointerEventData(int playerId, int pointerIndex, int pointerTypeId, bool ignorePointerTypeId, PointerEventType pointerEventType)
+ {
+ if (!ignorePointerTypeId)
+ {
+ GetPointerData(playerId, pointerIndex, pointerTypeId, out var data, create: false, pointerEventType);
+ return data;
+ }
+ if (!m_PlayerPointerData.TryGetValue(playerId, out var value))
+ {
+ return null;
+ }
+ if ((uint)pointerIndex >= (uint)value.Length)
+ {
+ return null;
+ }
+ using (Dictionary<int, PlayerPointerEventData>.Enumerator enumerator = value[pointerIndex].GetEnumerator())
+ {
+ if (enumerator.MoveNext())
+ {
+ return enumerator.Current.Value;
+ }
+ }
+ return null;
+ }
+
+ private static bool ShouldStartDrag(Vector2 pressPos, Vector2 currentPos, float threshold, bool useDragThreshold)
+ {
+ if (!useDragThreshold)
+ {
+ return true;
+ }
+ return (pressPos - currentPos).sqrMagnitude >= threshold * threshold;
+ }
+
+ protected virtual void ProcessMove(PlayerPointerEventData pointerEvent)
+ {
+ GameObject newEnterTarget;
+ if (pointerEvent.sourceType == PointerEventType.Mouse)
+ {
+ IMouseInputSource mouseInputSource = GetMouseInputSource(pointerEvent.playerId, pointerEvent.inputSourceIndex);
+ newEnterTarget = ((mouseInputSource == null) ? null : ((!mouseInputSource.enabled || mouseInputSource.locked) ? null : pointerEvent.pointerCurrentRaycast.gameObject));
+ }
+ else
+ {
+ if (pointerEvent.sourceType != PointerEventType.Touch)
+ {
+ throw new NotImplementedException();
+ }
+ newEnterTarget = pointerEvent.pointerCurrentRaycast.gameObject;
+ }
+ HandlePointerExitAndEnter(pointerEvent, newEnterTarget);
+ }
+
+ protected virtual void ProcessDrag(PlayerPointerEventData pointerEvent)
+ {
+ if (!pointerEvent.IsPointerMoving() || pointerEvent.pointerDrag == null)
+ {
+ return;
+ }
+ if (pointerEvent.sourceType == PointerEventType.Mouse)
+ {
+ IMouseInputSource mouseInputSource = GetMouseInputSource(pointerEvent.playerId, pointerEvent.inputSourceIndex);
+ if (mouseInputSource == null || mouseInputSource.locked || !mouseInputSource.enabled)
+ {
+ return;
+ }
+ }
+ if (!pointerEvent.dragging && ShouldStartDrag(pointerEvent.pressPosition, pointerEvent.position, base.eventSystem.pixelDragThreshold, pointerEvent.useDragThreshold))
+ {
+ ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.beginDragHandler);
+ pointerEvent.dragging = true;
+ }
+ if (pointerEvent.dragging)
+ {
+ if (pointerEvent.pointerPress != pointerEvent.pointerDrag)
+ {
+ ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler);
+ pointerEvent.eligibleForClick = false;
+ pointerEvent.pointerPress = null;
+ pointerEvent.rawPointerPress = null;
+ }
+ ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.dragHandler);
+ }
+ }
+
+ public override bool IsPointerOverGameObject(int pointerTypeId)
+ {
+ foreach (KeyValuePair<int, Dictionary<int, PlayerPointerEventData>[]> playerPointerDatum in m_PlayerPointerData)
+ {
+ Dictionary<int, PlayerPointerEventData>[] value = playerPointerDatum.Value;
+ for (int i = 0; i < value.Length; i++)
+ {
+ if (value[i].TryGetValue(pointerTypeId, out var value2) && value2.pointerEnter != null)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ protected void ClearSelection()
+ {
+ BaseEventData baseEventData = GetBaseEventData();
+ foreach (KeyValuePair<int, Dictionary<int, PlayerPointerEventData>[]> playerPointerDatum in m_PlayerPointerData)
+ {
+ Dictionary<int, PlayerPointerEventData>[] value = playerPointerDatum.Value;
+ for (int i = 0; i < value.Length; i++)
+ {
+ foreach (KeyValuePair<int, PlayerPointerEventData> item in value[i])
+ {
+ HandlePointerExitAndEnter(item.Value, null);
+ }
+ value[i].Clear();
+ }
+ }
+ base.eventSystem.SetSelectedGameObject(null, baseEventData);
+ }
+
+ public override string ToString()
+ {
+ StringBuilder stringBuilder = new StringBuilder("<b>Pointer Input Module of type: </b>" + GetType());
+ stringBuilder.AppendLine();
+ foreach (KeyValuePair<int, Dictionary<int, PlayerPointerEventData>[]> playerPointerDatum in m_PlayerPointerData)
+ {
+ stringBuilder.AppendLine("<B>Player Id:</b> " + playerPointerDatum.Key);
+ Dictionary<int, PlayerPointerEventData>[] value = playerPointerDatum.Value;
+ for (int i = 0; i < value.Length; i++)
+ {
+ stringBuilder.AppendLine("<B>Pointer Index:</b> " + i);
+ foreach (KeyValuePair<int, PlayerPointerEventData> item in value[i])
+ {
+ stringBuilder.AppendLine("<B>Button Id:</b> " + item.Key);
+ stringBuilder.AppendLine(item.Value.ToString());
+ }
+ }
+ }
+ return stringBuilder.ToString();
+ }
+
+ protected void DeselectIfSelectionChanged(GameObject currentOverGo, BaseEventData pointerEvent)
+ {
+ if (ExecuteEvents.GetEventHandler<ISelectHandler>(currentOverGo) != base.eventSystem.currentSelectedGameObject)
+ {
+ base.eventSystem.SetSelectedGameObject(null, pointerEvent);
+ }
+ }
+
+ protected void CopyFromTo(PointerEventData from, PointerEventData to)
+ {
+ to.position = from.position;
+ to.delta = from.delta;
+ to.scrollDelta = from.scrollDelta;
+ to.pointerCurrentRaycast = from.pointerCurrentRaycast;
+ to.pointerEnter = from.pointerEnter;
+ }
+
+ protected PointerEventData.FramePressState StateForMouseButton(int playerId, int mouseIndex, int buttonId)
+ {
+ IMouseInputSource mouseInputSource = GetMouseInputSource(playerId, mouseIndex);
+ if (mouseInputSource == null)
+ {
+ return PointerEventData.FramePressState.NotChanged;
+ }
+ bool buttonDown = mouseInputSource.GetButtonDown(buttonId);
+ bool buttonUp = mouseInputSource.GetButtonUp(buttonId);
+ if (buttonDown && buttonUp)
+ {
+ return PointerEventData.FramePressState.PressedAndReleased;
+ }
+ if (buttonDown)
+ {
+ return PointerEventData.FramePressState.Pressed;
+ }
+ if (buttonUp)
+ {
+ return PointerEventData.FramePressState.Released;
+ }
+ return PointerEventData.FramePressState.NotChanged;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/RewiredStandaloneInputModule.cs b/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/RewiredStandaloneInputModule.cs
new file mode 100644
index 0000000..02245ab
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Integration.UnityUI/RewiredStandaloneInputModule.cs
@@ -0,0 +1,1415 @@
+using System;
+using System.Collections.Generic;
+using Rewired.Components;
+using Rewired.UI;
+using Rewired.Utils;
+using UnityEngine;
+using UnityEngine.EventSystems;
+using UnityEngine.Serialization;
+
+namespace Rewired.Integration.UnityUI;
+
+[AddComponentMenu("Rewired/Rewired Standalone Input Module")]
+public sealed class RewiredStandaloneInputModule : RewiredPointerInputModule
+{
+ [Serializable]
+ public class PlayerSetting
+ {
+ public int playerId;
+
+ public List<Rewired.Components.PlayerMouse> playerMice = new List<Rewired.Components.PlayerMouse>();
+
+ public PlayerSetting()
+ {
+ }
+
+ private PlayerSetting(PlayerSetting other)
+ {
+ if (other == null)
+ {
+ throw new ArgumentNullException("other");
+ }
+ playerId = other.playerId;
+ playerMice = new List<Rewired.Components.PlayerMouse>();
+ if (other.playerMice == null)
+ {
+ return;
+ }
+ foreach (Rewired.Components.PlayerMouse item in other.playerMice)
+ {
+ playerMice.Add(item);
+ }
+ }
+
+ public PlayerSetting Clone()
+ {
+ return new PlayerSetting(this);
+ }
+ }
+
+ private const string DEFAULT_ACTION_MOVE_HORIZONTAL = "UIHorizontal";
+
+ private const string DEFAULT_ACTION_MOVE_VERTICAL = "UIVertical";
+
+ private const string DEFAULT_ACTION_SUBMIT = "UISubmit";
+
+ private const string DEFAULT_ACTION_CANCEL = "UICancel";
+
+ [Tooltip("(Optional) Link the Rewired Input Manager here for easier access to Player ids, etc.")]
+ [SerializeField]
+ private InputManager_Base rewiredInputManager;
+
+ [SerializeField]
+ [Tooltip("Use all Rewired game Players to control the UI. This does not include the System Player. If enabled, this setting overrides individual Player Ids set in Rewired Player Ids.")]
+ private bool useAllRewiredGamePlayers;
+
+ [SerializeField]
+ [Tooltip("Allow the Rewired System Player to control the UI.")]
+ private bool useRewiredSystemPlayer;
+
+ [SerializeField]
+ [Tooltip("A list of Player Ids that are allowed to control the UI. If Use All Rewired Game Players = True, this list will be ignored.")]
+ private int[] rewiredPlayerIds = new int[1];
+
+ [SerializeField]
+ [Tooltip("Allow only Players with Player.isPlaying = true to control the UI.")]
+ private bool usePlayingPlayersOnly;
+
+ [SerializeField]
+ [Tooltip("Player Mice allowed to interact with the UI. Each Player that owns a Player Mouse must also be allowed to control the UI or the Player Mouse will not function.")]
+ private List<Rewired.Components.PlayerMouse> playerMice = new List<Rewired.Components.PlayerMouse>();
+
+ [SerializeField]
+ [Tooltip("Makes an axis press always move only one UI selection. Enable if you do not want to allow scrolling through UI elements by holding an axis direction.")]
+ private bool moveOneElementPerAxisPress;
+
+ [SerializeField]
+ [Tooltip("If enabled, Action Ids will be used to set the Actions. If disabled, string names will be used to set the Actions.")]
+ private bool setActionsById;
+
+ [SerializeField]
+ [Tooltip("Id of the horizontal Action for movement (if axis events are used).")]
+ private int horizontalActionId = -1;
+
+ [SerializeField]
+ [Tooltip("Id of the vertical Action for movement (if axis events are used).")]
+ private int verticalActionId = -1;
+
+ [SerializeField]
+ [Tooltip("Id of the Action used to submit.")]
+ private int submitActionId = -1;
+
+ [SerializeField]
+ [Tooltip("Id of the Action used to cancel.")]
+ private int cancelActionId = -1;
+
+ [SerializeField]
+ [Tooltip("Name of the horizontal axis for movement (if axis events are used).")]
+ private string m_HorizontalAxis = "UIHorizontal";
+
+ [SerializeField]
+ [Tooltip("Name of the vertical axis for movement (if axis events are used).")]
+ private string m_VerticalAxis = "UIVertical";
+
+ [SerializeField]
+ [Tooltip("Name of the action used to submit.")]
+ private string m_SubmitButton = "UISubmit";
+
+ [SerializeField]
+ [Tooltip("Name of the action used to cancel.")]
+ private string m_CancelButton = "UICancel";
+
+ [SerializeField]
+ [Tooltip("Number of selection changes allowed per second when a movement button/axis is held in a direction.")]
+ private float m_InputActionsPerSecond = 10f;
+
+ [SerializeField]
+ [Tooltip("Delay in seconds before vertical/horizontal movement starts repeating continouously when a movement direction is held.")]
+ private float m_RepeatDelay;
+
+ [SerializeField]
+ [Tooltip("Allows the mouse to be used to select elements.")]
+ private bool m_allowMouseInput = true;
+
+ [SerializeField]
+ [Tooltip("Allows the mouse to be used to select elements if the device also supports touch control.")]
+ private bool m_allowMouseInputIfTouchSupported = true;
+
+ [SerializeField]
+ [Tooltip("Allows touch input to be used to select elements.")]
+ private bool m_allowTouchInput = true;
+
+ [SerializeField]
+ [Tooltip("Deselects the current selection on mouse/touch click when the pointer is not over a selectable object.")]
+ private bool m_deselectIfBackgroundClicked = true;
+
+ [SerializeField]
+ [Tooltip("Deselects the current selection on mouse/touch click before selecting the next object.")]
+ private bool m_deselectBeforeSelecting = true;
+
+ [SerializeField]
+ [FormerlySerializedAs("m_AllowActivationOnMobileDevice")]
+ [Tooltip("Forces the module to always be active.")]
+ private bool m_ForceModuleActive;
+
+ [NonSerialized]
+ private int[] playerIds;
+
+ private bool recompiling;
+
+ [NonSerialized]
+ private bool isTouchSupported;
+
+ [NonSerialized]
+ private double m_PrevActionTime;
+
+ [NonSerialized]
+ private Vector2 m_LastMoveVector;
+
+ [NonSerialized]
+ private int m_ConsecutiveMoveCount;
+
+ [NonSerialized]
+ private bool m_HasFocus = true;
+
+ public InputManager_Base RewiredInputManager
+ {
+ get
+ {
+ return rewiredInputManager;
+ }
+ set
+ {
+ rewiredInputManager = value;
+ }
+ }
+
+ public bool UseAllRewiredGamePlayers
+ {
+ get
+ {
+ return useAllRewiredGamePlayers;
+ }
+ set
+ {
+ bool num = value != useAllRewiredGamePlayers;
+ useAllRewiredGamePlayers = value;
+ if (num)
+ {
+ SetupRewiredVars();
+ }
+ }
+ }
+
+ public bool UseRewiredSystemPlayer
+ {
+ get
+ {
+ return useRewiredSystemPlayer;
+ }
+ set
+ {
+ bool num = value != useRewiredSystemPlayer;
+ useRewiredSystemPlayer = value;
+ if (num)
+ {
+ SetupRewiredVars();
+ }
+ }
+ }
+
+ public int[] RewiredPlayerIds
+ {
+ get
+ {
+ return (int[])rewiredPlayerIds.Clone();
+ }
+ set
+ {
+ rewiredPlayerIds = ((value != null) ? ((int[])value.Clone()) : new int[0]);
+ SetupRewiredVars();
+ }
+ }
+
+ public bool UsePlayingPlayersOnly
+ {
+ get
+ {
+ return usePlayingPlayersOnly;
+ }
+ set
+ {
+ usePlayingPlayersOnly = value;
+ }
+ }
+
+ public List<Rewired.Components.PlayerMouse> PlayerMice
+ {
+ get
+ {
+ return new List<Rewired.Components.PlayerMouse>(playerMice);
+ }
+ set
+ {
+ if (value == null)
+ {
+ playerMice = new List<Rewired.Components.PlayerMouse>();
+ SetupRewiredVars();
+ }
+ else
+ {
+ playerMice = new List<Rewired.Components.PlayerMouse>(value);
+ SetupRewiredVars();
+ }
+ }
+ }
+
+ public bool MoveOneElementPerAxisPress
+ {
+ get
+ {
+ return moveOneElementPerAxisPress;
+ }
+ set
+ {
+ moveOneElementPerAxisPress = value;
+ }
+ }
+
+ public bool allowMouseInput
+ {
+ get
+ {
+ return m_allowMouseInput;
+ }
+ set
+ {
+ m_allowMouseInput = value;
+ }
+ }
+
+ public bool allowMouseInputIfTouchSupported
+ {
+ get
+ {
+ return m_allowMouseInputIfTouchSupported;
+ }
+ set
+ {
+ m_allowMouseInputIfTouchSupported = value;
+ }
+ }
+
+ public bool allowTouchInput
+ {
+ get
+ {
+ return m_allowTouchInput;
+ }
+ set
+ {
+ m_allowTouchInput = value;
+ }
+ }
+
+ public bool deselectIfBackgroundClicked
+ {
+ get
+ {
+ return m_deselectIfBackgroundClicked;
+ }
+ set
+ {
+ m_deselectIfBackgroundClicked = value;
+ }
+ }
+
+ private bool deselectBeforeSelecting
+ {
+ get
+ {
+ return m_deselectBeforeSelecting;
+ }
+ set
+ {
+ m_deselectBeforeSelecting = value;
+ }
+ }
+
+ public bool SetActionsById
+ {
+ get
+ {
+ return setActionsById;
+ }
+ set
+ {
+ if (setActionsById != value)
+ {
+ setActionsById = value;
+ SetupRewiredVars();
+ }
+ }
+ }
+
+ public int HorizontalActionId
+ {
+ get
+ {
+ return horizontalActionId;
+ }
+ set
+ {
+ if (value != horizontalActionId)
+ {
+ horizontalActionId = value;
+ if (ReInput.isReady)
+ {
+ m_HorizontalAxis = ((ReInput.mapping.GetAction(value) != null) ? ReInput.mapping.GetAction(value).name : string.Empty);
+ }
+ }
+ }
+ }
+
+ public int VerticalActionId
+ {
+ get
+ {
+ return verticalActionId;
+ }
+ set
+ {
+ if (value != verticalActionId)
+ {
+ verticalActionId = value;
+ if (ReInput.isReady)
+ {
+ m_VerticalAxis = ((ReInput.mapping.GetAction(value) != null) ? ReInput.mapping.GetAction(value).name : string.Empty);
+ }
+ }
+ }
+ }
+
+ public int SubmitActionId
+ {
+ get
+ {
+ return submitActionId;
+ }
+ set
+ {
+ if (value != submitActionId)
+ {
+ submitActionId = value;
+ if (ReInput.isReady)
+ {
+ m_SubmitButton = ((ReInput.mapping.GetAction(value) != null) ? ReInput.mapping.GetAction(value).name : string.Empty);
+ }
+ }
+ }
+ }
+
+ public int CancelActionId
+ {
+ get
+ {
+ return cancelActionId;
+ }
+ set
+ {
+ if (value != cancelActionId)
+ {
+ cancelActionId = value;
+ if (ReInput.isReady)
+ {
+ m_CancelButton = ((ReInput.mapping.GetAction(value) != null) ? ReInput.mapping.GetAction(value).name : string.Empty);
+ }
+ }
+ }
+ }
+
+ protected override bool isMouseSupported
+ {
+ get
+ {
+ if (!base.isMouseSupported)
+ {
+ return false;
+ }
+ if (!m_allowMouseInput)
+ {
+ return false;
+ }
+ if (!isTouchSupported)
+ {
+ return true;
+ }
+ return m_allowMouseInputIfTouchSupported;
+ }
+ }
+
+ private bool isTouchAllowed => m_allowTouchInput;
+
+ [Obsolete("allowActivationOnMobileDevice has been deprecated. Use forceModuleActive instead")]
+ public bool allowActivationOnMobileDevice
+ {
+ get
+ {
+ return m_ForceModuleActive;
+ }
+ set
+ {
+ m_ForceModuleActive = value;
+ }
+ }
+
+ public bool forceModuleActive
+ {
+ get
+ {
+ return m_ForceModuleActive;
+ }
+ set
+ {
+ m_ForceModuleActive = value;
+ }
+ }
+
+ public float inputActionsPerSecond
+ {
+ get
+ {
+ return m_InputActionsPerSecond;
+ }
+ set
+ {
+ m_InputActionsPerSecond = value;
+ }
+ }
+
+ public float repeatDelay
+ {
+ get
+ {
+ return m_RepeatDelay;
+ }
+ set
+ {
+ m_RepeatDelay = value;
+ }
+ }
+
+ public string horizontalAxis
+ {
+ get
+ {
+ return m_HorizontalAxis;
+ }
+ set
+ {
+ if (!(m_HorizontalAxis == value))
+ {
+ m_HorizontalAxis = value;
+ if (ReInput.isReady)
+ {
+ horizontalActionId = ReInput.mapping.GetActionId(value);
+ }
+ }
+ }
+ }
+
+ public string verticalAxis
+ {
+ get
+ {
+ return m_VerticalAxis;
+ }
+ set
+ {
+ if (!(m_VerticalAxis == value))
+ {
+ m_VerticalAxis = value;
+ if (ReInput.isReady)
+ {
+ verticalActionId = ReInput.mapping.GetActionId(value);
+ }
+ }
+ }
+ }
+
+ public string submitButton
+ {
+ get
+ {
+ return m_SubmitButton;
+ }
+ set
+ {
+ if (!(m_SubmitButton == value))
+ {
+ m_SubmitButton = value;
+ if (ReInput.isReady)
+ {
+ submitActionId = ReInput.mapping.GetActionId(value);
+ }
+ }
+ }
+ }
+
+ public string cancelButton
+ {
+ get
+ {
+ return m_CancelButton;
+ }
+ set
+ {
+ if (!(m_CancelButton == value))
+ {
+ m_CancelButton = value;
+ if (ReInput.isReady)
+ {
+ cancelActionId = ReInput.mapping.GetActionId(value);
+ }
+ }
+ }
+ }
+
+ private RewiredStandaloneInputModule()
+ {
+ }
+
+ protected override void Awake()
+ {
+ base.Awake();
+ isTouchSupported = base.defaultTouchInputSource.touchSupported;
+ TouchInputModule component = GetComponent<TouchInputModule>();
+ if (component != null)
+ {
+ component.enabled = false;
+ }
+ ReInput.InitializedEvent += OnRewiredInitialized;
+ InitializeRewired();
+ }
+
+ public override void UpdateModule()
+ {
+ CheckEditorRecompile();
+ if (!recompiling && ReInput.isReady && !m_HasFocus)
+ {
+ ShouldIgnoreEventsOnNoFocus();
+ }
+ }
+
+ public override bool IsModuleSupported()
+ {
+ return true;
+ }
+
+ public override bool ShouldActivateModule()
+ {
+ if (!base.ShouldActivateModule())
+ {
+ return false;
+ }
+ if (recompiling)
+ {
+ return false;
+ }
+ if (!ReInput.isReady)
+ {
+ return false;
+ }
+ bool flag = m_ForceModuleActive;
+ for (int i = 0; i < playerIds.Length; i++)
+ {
+ Player player = ReInput.players.GetPlayer(playerIds[i]);
+ if (player != null && (!usePlayingPlayersOnly || player.isPlaying))
+ {
+ flag |= GetButtonDown(player, submitActionId);
+ flag |= GetButtonDown(player, cancelActionId);
+ if (moveOneElementPerAxisPress)
+ {
+ flag |= GetButtonDown(player, horizontalActionId) || GetNegativeButtonDown(player, horizontalActionId);
+ flag |= GetButtonDown(player, verticalActionId) || GetNegativeButtonDown(player, verticalActionId);
+ }
+ else
+ {
+ flag |= !Mathf.Approximately(GetAxis(player, horizontalActionId), 0f);
+ flag |= !Mathf.Approximately(GetAxis(player, verticalActionId), 0f);
+ }
+ }
+ }
+ if (isMouseSupported)
+ {
+ flag |= DidAnyMouseMove();
+ flag |= GetMouseButtonDownOnAnyMouse(0);
+ }
+ if (isTouchAllowed)
+ {
+ for (int j = 0; j < base.defaultTouchInputSource.touchCount; j++)
+ {
+ Touch touch = base.defaultTouchInputSource.GetTouch(j);
+ flag |= touch.phase == TouchPhase.Began || touch.phase == TouchPhase.Moved || touch.phase == TouchPhase.Stationary;
+ }
+ }
+ return flag;
+ }
+
+ public override void ActivateModule()
+ {
+ if (m_HasFocus || !ShouldIgnoreEventsOnNoFocus())
+ {
+ base.ActivateModule();
+ GameObject gameObject = base.eventSystem.currentSelectedGameObject;
+ if (gameObject == null)
+ {
+ gameObject = base.eventSystem.firstSelectedGameObject;
+ }
+ base.eventSystem.SetSelectedGameObject(gameObject, GetBaseEventData());
+ }
+ }
+
+ public override void DeactivateModule()
+ {
+ base.DeactivateModule();
+ ClearSelection();
+ }
+
+ public override void Process()
+ {
+ if (!ReInput.isReady || (!m_HasFocus && ShouldIgnoreEventsOnNoFocus()) || !base.enabled || !base.gameObject.activeInHierarchy)
+ {
+ return;
+ }
+ bool flag = SendUpdateEventToSelectedObject();
+ if (base.eventSystem.sendNavigationEvents)
+ {
+ if (!flag)
+ {
+ flag |= SendMoveEventToSelectedObject();
+ }
+ if (!flag)
+ {
+ SendSubmitEventToSelectedObject();
+ }
+ }
+ if (!ProcessTouchEvents() && isMouseSupported)
+ {
+ ProcessMouseEvents();
+ }
+ }
+
+ private bool ProcessTouchEvents()
+ {
+ if (!isTouchAllowed)
+ {
+ return false;
+ }
+ for (int i = 0; i < base.defaultTouchInputSource.touchCount; i++)
+ {
+ Touch touch = base.defaultTouchInputSource.GetTouch(i);
+ if (touch.type != TouchType.Indirect)
+ {
+ bool pressed;
+ bool released;
+ PlayerPointerEventData touchPointerEventData = GetTouchPointerEventData(0, 0, touch, out pressed, out released);
+ ProcessTouchPress(touchPointerEventData, pressed, released);
+ if (!released)
+ {
+ ProcessMove(touchPointerEventData);
+ ProcessDrag(touchPointerEventData);
+ }
+ else
+ {
+ RemovePointerData(touchPointerEventData);
+ }
+ }
+ }
+ return base.defaultTouchInputSource.touchCount > 0;
+ }
+
+ private void ProcessTouchPress(PointerEventData pointerEvent, bool pressed, bool released)
+ {
+ GameObject gameObject = pointerEvent.pointerCurrentRaycast.gameObject;
+ if (pressed)
+ {
+ pointerEvent.eligibleForClick = true;
+ pointerEvent.delta = Vector2.zero;
+ pointerEvent.dragging = false;
+ pointerEvent.useDragThreshold = true;
+ pointerEvent.pressPosition = pointerEvent.position;
+ pointerEvent.pointerPressRaycast = pointerEvent.pointerCurrentRaycast;
+ HandleMouseTouchDeselectionOnSelectionChanged(gameObject, pointerEvent);
+ if (pointerEvent.pointerEnter != gameObject)
+ {
+ HandlePointerExitAndEnter(pointerEvent, gameObject);
+ pointerEvent.pointerEnter = gameObject;
+ }
+ GameObject gameObject2 = ExecuteEvents.ExecuteHierarchy(gameObject, pointerEvent, ExecuteEvents.pointerDownHandler);
+ if (gameObject2 == null)
+ {
+ gameObject2 = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
+ }
+ double unscaledTime = ReInput.time.unscaledTime;
+ if (gameObject2 == pointerEvent.lastPress)
+ {
+ if (unscaledTime - (double)pointerEvent.clickTime < 0.30000001192092896)
+ {
+ int clickCount = pointerEvent.clickCount + 1;
+ pointerEvent.clickCount = clickCount;
+ }
+ else
+ {
+ pointerEvent.clickCount = 1;
+ }
+ pointerEvent.clickTime = (float)unscaledTime;
+ }
+ else
+ {
+ pointerEvent.clickCount = 1;
+ }
+ pointerEvent.pointerPress = gameObject2;
+ pointerEvent.rawPointerPress = gameObject;
+ pointerEvent.clickTime = (float)unscaledTime;
+ pointerEvent.pointerDrag = ExecuteEvents.GetEventHandler<IDragHandler>(gameObject);
+ if (pointerEvent.pointerDrag != null)
+ {
+ ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.initializePotentialDrag);
+ }
+ }
+ if (released)
+ {
+ ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler);
+ GameObject eventHandler = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
+ if (pointerEvent.pointerPress == eventHandler && pointerEvent.eligibleForClick)
+ {
+ ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerClickHandler);
+ }
+ else if (pointerEvent.pointerDrag != null && pointerEvent.dragging)
+ {
+ ExecuteEvents.ExecuteHierarchy(gameObject, pointerEvent, ExecuteEvents.dropHandler);
+ }
+ pointerEvent.eligibleForClick = false;
+ pointerEvent.pointerPress = null;
+ pointerEvent.rawPointerPress = null;
+ if (pointerEvent.pointerDrag != null && pointerEvent.dragging)
+ {
+ ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.endDragHandler);
+ }
+ pointerEvent.dragging = false;
+ pointerEvent.pointerDrag = null;
+ if (pointerEvent.pointerDrag != null)
+ {
+ ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.endDragHandler);
+ }
+ pointerEvent.pointerDrag = null;
+ ExecuteEvents.ExecuteHierarchy(pointerEvent.pointerEnter, pointerEvent, ExecuteEvents.pointerExitHandler);
+ pointerEvent.pointerEnter = null;
+ }
+ }
+
+ private bool SendSubmitEventToSelectedObject()
+ {
+ if (base.eventSystem.currentSelectedGameObject == null)
+ {
+ return false;
+ }
+ if (recompiling)
+ {
+ return false;
+ }
+ BaseEventData baseEventData = GetBaseEventData();
+ for (int i = 0; i < playerIds.Length; i++)
+ {
+ Player player = ReInput.players.GetPlayer(playerIds[i]);
+ if (player != null && (!usePlayingPlayersOnly || player.isPlaying))
+ {
+ if (GetButtonDown(player, submitActionId))
+ {
+ ExecuteEvents.Execute(base.eventSystem.currentSelectedGameObject, baseEventData, ExecuteEvents.submitHandler);
+ break;
+ }
+ if (GetButtonDown(player, cancelActionId))
+ {
+ ExecuteEvents.Execute(base.eventSystem.currentSelectedGameObject, baseEventData, ExecuteEvents.cancelHandler);
+ break;
+ }
+ }
+ }
+ return baseEventData.used;
+ }
+
+ private Vector2 GetRawMoveVector()
+ {
+ if (recompiling)
+ {
+ return Vector2.zero;
+ }
+ Vector2 zero = Vector2.zero;
+ for (int i = 0; i < playerIds.Length; i++)
+ {
+ Player player = ReInput.players.GetPlayer(playerIds[i]);
+ if (player == null || (usePlayingPlayersOnly && !player.isPlaying))
+ {
+ continue;
+ }
+ float num = GetAxis(player, horizontalActionId);
+ float num2 = GetAxis(player, verticalActionId);
+ if (Mathf.Approximately(num, 0f))
+ {
+ num = 0f;
+ }
+ if (Mathf.Approximately(num2, 0f))
+ {
+ num2 = 0f;
+ }
+ if (moveOneElementPerAxisPress)
+ {
+ if (GetButtonDown(player, horizontalActionId) && num > 0f)
+ {
+ zero.x += 1f;
+ }
+ if (GetNegativeButtonDown(player, horizontalActionId) && num < 0f)
+ {
+ zero.x -= 1f;
+ }
+ if (GetButtonDown(player, verticalActionId) && num2 > 0f)
+ {
+ zero.y += 1f;
+ }
+ if (GetNegativeButtonDown(player, verticalActionId) && num2 < 0f)
+ {
+ zero.y -= 1f;
+ }
+ }
+ else
+ {
+ if (GetButton(player, horizontalActionId) && num > 0f)
+ {
+ zero.x += 1f;
+ }
+ if (GetNegativeButton(player, horizontalActionId) && num < 0f)
+ {
+ zero.x -= 1f;
+ }
+ if (GetButton(player, verticalActionId) && num2 > 0f)
+ {
+ zero.y += 1f;
+ }
+ if (GetNegativeButton(player, verticalActionId) && num2 < 0f)
+ {
+ zero.y -= 1f;
+ }
+ }
+ }
+ return zero;
+ }
+
+ private bool SendMoveEventToSelectedObject()
+ {
+ if (recompiling)
+ {
+ return false;
+ }
+ double unscaledTime = ReInput.time.unscaledTime;
+ Vector2 rawMoveVector = GetRawMoveVector();
+ if (Mathf.Approximately(rawMoveVector.x, 0f) && Mathf.Approximately(rawMoveVector.y, 0f))
+ {
+ m_ConsecutiveMoveCount = 0;
+ return false;
+ }
+ bool flag = Vector2.Dot(rawMoveVector, m_LastMoveVector) > 0f;
+ CheckButtonOrKeyMovement(out var downHorizontal, out var downVertical);
+ AxisEventData axisEventData = null;
+ bool flag2 = downHorizontal || downVertical;
+ if (flag2)
+ {
+ axisEventData = GetAxisEventData(rawMoveVector.x, rawMoveVector.y, 0f);
+ MoveDirection moveDir = axisEventData.moveDir;
+ flag2 = ((moveDir == MoveDirection.Up || moveDir == MoveDirection.Down) && downVertical) || ((moveDir == MoveDirection.Left || moveDir == MoveDirection.Right) && downHorizontal);
+ }
+ if (!flag2)
+ {
+ flag2 = ((!(m_RepeatDelay > 0f)) ? (unscaledTime > m_PrevActionTime + (double)(1f / m_InputActionsPerSecond)) : ((!flag || m_ConsecutiveMoveCount != 1) ? (unscaledTime > m_PrevActionTime + (double)(1f / m_InputActionsPerSecond)) : (unscaledTime > m_PrevActionTime + (double)m_RepeatDelay)));
+ }
+ if (!flag2)
+ {
+ return false;
+ }
+ if (axisEventData == null)
+ {
+ axisEventData = GetAxisEventData(rawMoveVector.x, rawMoveVector.y, 0f);
+ }
+ if (axisEventData.moveDir != MoveDirection.None)
+ {
+ ExecuteEvents.Execute(base.eventSystem.currentSelectedGameObject, axisEventData, ExecuteEvents.moveHandler);
+ if (!flag)
+ {
+ m_ConsecutiveMoveCount = 0;
+ }
+ if (m_ConsecutiveMoveCount == 0 || !(downHorizontal || downVertical))
+ {
+ m_ConsecutiveMoveCount++;
+ }
+ m_PrevActionTime = unscaledTime;
+ m_LastMoveVector = rawMoveVector;
+ }
+ else
+ {
+ m_ConsecutiveMoveCount = 0;
+ }
+ return axisEventData.used;
+ }
+
+ private void CheckButtonOrKeyMovement(out bool downHorizontal, out bool downVertical)
+ {
+ downHorizontal = false;
+ downVertical = false;
+ for (int i = 0; i < playerIds.Length; i++)
+ {
+ Player player = ReInput.players.GetPlayer(playerIds[i]);
+ if (player != null && (!usePlayingPlayersOnly || player.isPlaying))
+ {
+ downHorizontal |= GetButtonDown(player, horizontalActionId) || GetNegativeButtonDown(player, horizontalActionId);
+ downVertical |= GetButtonDown(player, verticalActionId) || GetNegativeButtonDown(player, verticalActionId);
+ }
+ }
+ }
+
+ private void ProcessMouseEvents()
+ {
+ for (int i = 0; i < playerIds.Length; i++)
+ {
+ Player player = ReInput.players.GetPlayer(playerIds[i]);
+ if (player != null && (!usePlayingPlayersOnly || player.isPlaying))
+ {
+ int mouseInputSourceCount = GetMouseInputSourceCount(playerIds[i]);
+ for (int j = 0; j < mouseInputSourceCount; j++)
+ {
+ ProcessMouseEvent(playerIds[i], j);
+ }
+ }
+ }
+ }
+
+ private void ProcessMouseEvent(int playerId, int pointerIndex)
+ {
+ MouseState mousePointerEventData = GetMousePointerEventData(playerId, pointerIndex);
+ if (mousePointerEventData == null)
+ {
+ return;
+ }
+ MouseButtonEventData eventData = mousePointerEventData.GetButtonState(0).eventData;
+ ProcessMousePress(eventData);
+ ProcessMove(eventData.buttonData);
+ ProcessDrag(eventData.buttonData);
+ ProcessMousePress(mousePointerEventData.GetButtonState(1).eventData);
+ ProcessDrag(mousePointerEventData.GetButtonState(1).eventData.buttonData);
+ ProcessMousePress(mousePointerEventData.GetButtonState(2).eventData);
+ ProcessDrag(mousePointerEventData.GetButtonState(2).eventData.buttonData);
+ IMouseInputSource mouseInputSource = GetMouseInputSource(playerId, pointerIndex);
+ if (mouseInputSource != null)
+ {
+ for (int i = 3; i < mouseInputSource.buttonCount; i++)
+ {
+ ProcessMousePress(mousePointerEventData.GetButtonState(i).eventData);
+ ProcessDrag(mousePointerEventData.GetButtonState(i).eventData.buttonData);
+ }
+ if (!Mathf.Approximately(eventData.buttonData.scrollDelta.sqrMagnitude, 0f))
+ {
+ ExecuteEvents.ExecuteHierarchy(ExecuteEvents.GetEventHandler<IScrollHandler>(eventData.buttonData.pointerCurrentRaycast.gameObject), eventData.buttonData, ExecuteEvents.scrollHandler);
+ }
+ }
+ }
+
+ private bool SendUpdateEventToSelectedObject()
+ {
+ if (base.eventSystem.currentSelectedGameObject == null)
+ {
+ return false;
+ }
+ BaseEventData baseEventData = GetBaseEventData();
+ ExecuteEvents.Execute(base.eventSystem.currentSelectedGameObject, baseEventData, ExecuteEvents.updateSelectedHandler);
+ return baseEventData.used;
+ }
+
+ private void ProcessMousePress(MouseButtonEventData data)
+ {
+ PlayerPointerEventData buttonData = data.buttonData;
+ if (GetMouseInputSource(buttonData.playerId, buttonData.inputSourceIndex) == null)
+ {
+ return;
+ }
+ GameObject gameObject = buttonData.pointerCurrentRaycast.gameObject;
+ if (data.PressedThisFrame())
+ {
+ buttonData.eligibleForClick = true;
+ buttonData.delta = Vector2.zero;
+ buttonData.dragging = false;
+ buttonData.useDragThreshold = true;
+ buttonData.pressPosition = buttonData.position;
+ buttonData.pointerPressRaycast = buttonData.pointerCurrentRaycast;
+ HandleMouseTouchDeselectionOnSelectionChanged(gameObject, buttonData);
+ GameObject gameObject2 = ExecuteEvents.ExecuteHierarchy(gameObject, buttonData, ExecuteEvents.pointerDownHandler);
+ if (gameObject2 == null)
+ {
+ gameObject2 = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
+ }
+ double unscaledTime = ReInput.time.unscaledTime;
+ if (gameObject2 == buttonData.lastPress)
+ {
+ if (unscaledTime - (double)buttonData.clickTime < 0.30000001192092896)
+ {
+ int clickCount = buttonData.clickCount + 1;
+ buttonData.clickCount = clickCount;
+ }
+ else
+ {
+ buttonData.clickCount = 1;
+ }
+ buttonData.clickTime = (float)unscaledTime;
+ }
+ else
+ {
+ buttonData.clickCount = 1;
+ }
+ buttonData.pointerPress = gameObject2;
+ buttonData.rawPointerPress = gameObject;
+ buttonData.clickTime = (float)unscaledTime;
+ buttonData.pointerDrag = ExecuteEvents.GetEventHandler<IDragHandler>(gameObject);
+ if (buttonData.pointerDrag != null)
+ {
+ ExecuteEvents.Execute(buttonData.pointerDrag, buttonData, ExecuteEvents.initializePotentialDrag);
+ }
+ }
+ if (data.ReleasedThisFrame())
+ {
+ ExecuteEvents.Execute(buttonData.pointerPress, buttonData, ExecuteEvents.pointerUpHandler);
+ GameObject eventHandler = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
+ if (buttonData.pointerPress == eventHandler && buttonData.eligibleForClick)
+ {
+ ExecuteEvents.Execute(buttonData.pointerPress, buttonData, ExecuteEvents.pointerClickHandler);
+ }
+ else if (buttonData.pointerDrag != null && buttonData.dragging)
+ {
+ ExecuteEvents.ExecuteHierarchy(gameObject, buttonData, ExecuteEvents.dropHandler);
+ }
+ buttonData.eligibleForClick = false;
+ buttonData.pointerPress = null;
+ buttonData.rawPointerPress = null;
+ if (buttonData.pointerDrag != null && buttonData.dragging)
+ {
+ ExecuteEvents.Execute(buttonData.pointerDrag, buttonData, ExecuteEvents.endDragHandler);
+ }
+ buttonData.dragging = false;
+ buttonData.pointerDrag = null;
+ if (gameObject != buttonData.pointerEnter)
+ {
+ HandlePointerExitAndEnter(buttonData, null);
+ HandlePointerExitAndEnter(buttonData, gameObject);
+ }
+ }
+ }
+
+ private void HandleMouseTouchDeselectionOnSelectionChanged(GameObject currentOverGo, BaseEventData pointerEvent)
+ {
+ if (m_deselectIfBackgroundClicked && m_deselectBeforeSelecting)
+ {
+ DeselectIfSelectionChanged(currentOverGo, pointerEvent);
+ return;
+ }
+ GameObject eventHandler = ExecuteEvents.GetEventHandler<ISelectHandler>(currentOverGo);
+ if (m_deselectIfBackgroundClicked)
+ {
+ if (eventHandler != base.eventSystem.currentSelectedGameObject && eventHandler != null)
+ {
+ base.eventSystem.SetSelectedGameObject(null, pointerEvent);
+ }
+ }
+ else if (m_deselectBeforeSelecting && eventHandler != null && eventHandler != base.eventSystem.currentSelectedGameObject)
+ {
+ base.eventSystem.SetSelectedGameObject(null, pointerEvent);
+ }
+ }
+
+ private void OnApplicationFocus(bool hasFocus)
+ {
+ m_HasFocus = hasFocus;
+ }
+
+ private bool ShouldIgnoreEventsOnNoFocus()
+ {
+ if (!ReInput.isReady)
+ {
+ return true;
+ }
+ return ReInput.configuration.ignoreInputWhenAppNotInFocus;
+ }
+
+ protected override void OnDestroy()
+ {
+ base.OnDestroy();
+ ReInput.InitializedEvent -= OnRewiredInitialized;
+ ReInput.ShutDownEvent -= OnRewiredShutDown;
+ ReInput.EditorRecompileEvent -= OnEditorRecompile;
+ }
+
+ protected override bool IsDefaultPlayer(int playerId)
+ {
+ if (playerIds == null)
+ {
+ return false;
+ }
+ if (!ReInput.isReady)
+ {
+ return false;
+ }
+ for (int i = 0; i < 3; i++)
+ {
+ for (int j = 0; j < playerIds.Length; j++)
+ {
+ Player player = ReInput.players.GetPlayer(playerIds[j]);
+ if (player != null && (i >= 1 || !usePlayingPlayersOnly || player.isPlaying) && (i >= 2 || player.controllers.hasMouse))
+ {
+ return playerIds[j] == playerId;
+ }
+ }
+ }
+ return false;
+ }
+
+ private void InitializeRewired()
+ {
+ if (!ReInput.isReady)
+ {
+ Debug.LogError("Rewired is not initialized! Are you missing a Rewired Input Manager in your scene?");
+ return;
+ }
+ ReInput.ShutDownEvent -= OnRewiredShutDown;
+ ReInput.ShutDownEvent += OnRewiredShutDown;
+ ReInput.EditorRecompileEvent -= OnEditorRecompile;
+ ReInput.EditorRecompileEvent += OnEditorRecompile;
+ SetupRewiredVars();
+ }
+
+ private void SetupRewiredVars()
+ {
+ if (!ReInput.isReady)
+ {
+ return;
+ }
+ SetUpRewiredActions();
+ if (useAllRewiredGamePlayers)
+ {
+ IList<Player> list = (useRewiredSystemPlayer ? ReInput.players.AllPlayers : ReInput.players.Players);
+ playerIds = new int[list.Count];
+ for (int i = 0; i < list.Count; i++)
+ {
+ playerIds[i] = list[i].id;
+ }
+ }
+ else
+ {
+ bool flag = false;
+ List<int> list2 = new List<int>(rewiredPlayerIds.Length + 1);
+ for (int j = 0; j < rewiredPlayerIds.Length; j++)
+ {
+ Player player = ReInput.players.GetPlayer(rewiredPlayerIds[j]);
+ if (player != null && !list2.Contains(player.id))
+ {
+ list2.Add(player.id);
+ if (player.id == 9999999)
+ {
+ flag = true;
+ }
+ }
+ }
+ if (useRewiredSystemPlayer && !flag)
+ {
+ list2.Insert(0, ReInput.players.GetSystemPlayer().id);
+ }
+ playerIds = list2.ToArray();
+ }
+ SetUpRewiredPlayerMice();
+ }
+
+ private void SetUpRewiredPlayerMice()
+ {
+ if (!ReInput.isReady)
+ {
+ return;
+ }
+ ClearMouseInputSources();
+ for (int i = 0; i < playerMice.Count; i++)
+ {
+ Rewired.Components.PlayerMouse playerMouse = playerMice[i];
+ if (!UnityTools.IsNullOrDestroyed(playerMouse))
+ {
+ AddMouseInputSource(playerMouse);
+ }
+ }
+ }
+
+ private void SetUpRewiredActions()
+ {
+ if (!ReInput.isReady)
+ {
+ return;
+ }
+ if (!setActionsById)
+ {
+ horizontalActionId = ReInput.mapping.GetActionId(m_HorizontalAxis);
+ verticalActionId = ReInput.mapping.GetActionId(m_VerticalAxis);
+ submitActionId = ReInput.mapping.GetActionId(m_SubmitButton);
+ cancelActionId = ReInput.mapping.GetActionId(m_CancelButton);
+ return;
+ }
+ InputAction action = ReInput.mapping.GetAction(horizontalActionId);
+ m_HorizontalAxis = ((action != null) ? action.name : string.Empty);
+ if (action == null)
+ {
+ horizontalActionId = -1;
+ }
+ action = ReInput.mapping.GetAction(verticalActionId);
+ m_VerticalAxis = ((action != null) ? action.name : string.Empty);
+ if (action == null)
+ {
+ verticalActionId = -1;
+ }
+ action = ReInput.mapping.GetAction(submitActionId);
+ m_SubmitButton = ((action != null) ? action.name : string.Empty);
+ if (action == null)
+ {
+ submitActionId = -1;
+ }
+ action = ReInput.mapping.GetAction(cancelActionId);
+ m_CancelButton = ((action != null) ? action.name : string.Empty);
+ if (action == null)
+ {
+ cancelActionId = -1;
+ }
+ }
+
+ private bool GetButton(Player player, int actionId)
+ {
+ if (actionId < 0)
+ {
+ return false;
+ }
+ return player.GetButton(actionId);
+ }
+
+ private bool GetButtonDown(Player player, int actionId)
+ {
+ if (actionId < 0)
+ {
+ return false;
+ }
+ return player.GetButtonDown(actionId);
+ }
+
+ private bool GetNegativeButton(Player player, int actionId)
+ {
+ if (actionId < 0)
+ {
+ return false;
+ }
+ return player.GetNegativeButton(actionId);
+ }
+
+ private bool GetNegativeButtonDown(Player player, int actionId)
+ {
+ if (actionId < 0)
+ {
+ return false;
+ }
+ return player.GetNegativeButtonDown(actionId);
+ }
+
+ private float GetAxis(Player player, int actionId)
+ {
+ if (actionId < 0)
+ {
+ return 0f;
+ }
+ return player.GetAxis(actionId);
+ }
+
+ private void CheckEditorRecompile()
+ {
+ if (recompiling && ReInput.isReady)
+ {
+ recompiling = false;
+ InitializeRewired();
+ }
+ }
+
+ private void OnEditorRecompile()
+ {
+ recompiling = true;
+ ClearRewiredVars();
+ }
+
+ private void ClearRewiredVars()
+ {
+ Array.Clear(playerIds, 0, playerIds.Length);
+ ClearMouseInputSources();
+ }
+
+ private bool DidAnyMouseMove()
+ {
+ for (int i = 0; i < playerIds.Length; i++)
+ {
+ int playerId = playerIds[i];
+ Player player = ReInput.players.GetPlayer(playerId);
+ if (player == null || (usePlayingPlayersOnly && !player.isPlaying))
+ {
+ continue;
+ }
+ int mouseInputSourceCount = GetMouseInputSourceCount(playerId);
+ for (int j = 0; j < mouseInputSourceCount; j++)
+ {
+ IMouseInputSource mouseInputSource = GetMouseInputSource(playerId, j);
+ if (mouseInputSource != null && mouseInputSource.screenPositionDelta.sqrMagnitude > 0f)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private bool GetMouseButtonDownOnAnyMouse(int buttonIndex)
+ {
+ for (int i = 0; i < playerIds.Length; i++)
+ {
+ int playerId = playerIds[i];
+ Player player = ReInput.players.GetPlayer(playerId);
+ if (player == null || (usePlayingPlayersOnly && !player.isPlaying))
+ {
+ continue;
+ }
+ int mouseInputSourceCount = GetMouseInputSourceCount(playerId);
+ for (int j = 0; j < mouseInputSourceCount; j++)
+ {
+ IMouseInputSource mouseInputSource = GetMouseInputSource(playerId, j);
+ if (mouseInputSource != null && mouseInputSource.GetButtonDown(buttonIndex))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private void OnRewiredInitialized()
+ {
+ InitializeRewired();
+ }
+
+ private void OnRewiredShutDown()
+ {
+ ClearRewiredVars();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Internal/ControllerTemplateFactory.cs b/Thronefall_v1.57/Thronefall/Rewired.Internal/ControllerTemplateFactory.cs
new file mode 100644
index 0000000..d1ac2b5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Internal/ControllerTemplateFactory.cs
@@ -0,0 +1,59 @@
+using System;
+
+namespace Rewired.Internal;
+
+public static class ControllerTemplateFactory
+{
+ private static readonly Type[] _defaultTemplateTypes = new Type[6]
+ {
+ typeof(GamepadTemplate),
+ typeof(RacingWheelTemplate),
+ typeof(HOTASTemplate),
+ typeof(FlightYokeTemplate),
+ typeof(FlightPedalsTemplate),
+ typeof(SixDofControllerTemplate)
+ };
+
+ private static readonly Type[] _defaultTemplateInterfaceTypes = new Type[6]
+ {
+ typeof(IGamepadTemplate),
+ typeof(IRacingWheelTemplate),
+ typeof(IHOTASTemplate),
+ typeof(IFlightYokeTemplate),
+ typeof(IFlightPedalsTemplate),
+ typeof(ISixDofControllerTemplate)
+ };
+
+ public static Type[] templateTypes => _defaultTemplateTypes;
+
+ public static Type[] templateInterfaceTypes => _defaultTemplateInterfaceTypes;
+
+ public static IControllerTemplate Create(Guid typeGuid, object payload)
+ {
+ if (typeGuid == GamepadTemplate.typeGuid)
+ {
+ return new GamepadTemplate(payload);
+ }
+ if (typeGuid == RacingWheelTemplate.typeGuid)
+ {
+ return new RacingWheelTemplate(payload);
+ }
+ if (typeGuid == HOTASTemplate.typeGuid)
+ {
+ return new HOTASTemplate(payload);
+ }
+ if (typeGuid == FlightYokeTemplate.typeGuid)
+ {
+ return new FlightYokeTemplate(payload);
+ }
+ if (typeGuid == FlightPedalsTemplate.typeGuid)
+ {
+ return new FlightPedalsTemplate(payload);
+ }
+ if (typeGuid == SixDofControllerTemplate.typeGuid)
+ {
+ return new SixDofControllerTemplate(payload);
+ }
+ return null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired.Utils/ExternalTools.cs b/Thronefall_v1.57/Thronefall/Rewired.Utils/ExternalTools.cs
new file mode 100644
index 0000000..d22fdd5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired.Utils/ExternalTools.cs
@@ -0,0 +1,171 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using Rewired.Internal;
+using Rewired.Utils.Interfaces;
+using Rewired.Utils.Platforms.Windows;
+using UnityEngine;
+using UnityEngine.UI;
+using UnityEngine.Windows;
+
+namespace Rewired.Utils;
+
+[EditorBrowsable(EditorBrowsableState.Never)]
+public class ExternalTools : IExternalTools
+{
+ private static Func<object> _getPlatformInitializerDelegate;
+
+ private bool _isEditorPaused;
+
+ private Action<bool> _EditorPausedStateChangedEvent;
+
+ public static Func<object> getPlatformInitializerDelegate
+ {
+ get
+ {
+ return _getPlatformInitializerDelegate;
+ }
+ set
+ {
+ _getPlatformInitializerDelegate = value;
+ }
+ }
+
+ public bool isEditorPaused => _isEditorPaused;
+
+ public bool UnityInput_IsTouchPressureSupported => UnityEngine.Input.touchPressureSupported;
+
+ public event Action<bool> EditorPausedStateChangedEvent
+ {
+ add
+ {
+ _EditorPausedStateChangedEvent = (Action<bool>)Delegate.Combine(_EditorPausedStateChangedEvent, value);
+ }
+ remove
+ {
+ _EditorPausedStateChangedEvent = (Action<bool>)Delegate.Remove(_EditorPausedStateChangedEvent, value);
+ }
+ }
+
+ public event Action<uint, bool> XboxOneInput_OnGamepadStateChange;
+
+ public void Destroy()
+ {
+ }
+
+ public object GetPlatformInitializer()
+ {
+ return Main.GetPlatformInitializer();
+ }
+
+ public string GetFocusedEditorWindowTitle()
+ {
+ return string.Empty;
+ }
+
+ public bool IsEditorSceneViewFocused()
+ {
+ return false;
+ }
+
+ public bool LinuxInput_IsJoystickPreconfigured(string name)
+ {
+ return false;
+ }
+
+ public int XboxOneInput_GetUserIdForGamepad(uint id)
+ {
+ return 0;
+ }
+
+ public ulong XboxOneInput_GetControllerId(uint unityJoystickId)
+ {
+ return 0uL;
+ }
+
+ public bool XboxOneInput_IsGamepadActive(uint unityJoystickId)
+ {
+ return false;
+ }
+
+ public string XboxOneInput_GetControllerType(ulong xboxControllerId)
+ {
+ return string.Empty;
+ }
+
+ public uint XboxOneInput_GetJoystickId(ulong xboxControllerId)
+ {
+ return 0u;
+ }
+
+ public void XboxOne_Gamepad_UpdatePlugin()
+ {
+ }
+
+ public bool XboxOne_Gamepad_SetGamepadVibration(ulong xboxOneJoystickId, float leftMotor, float rightMotor, float leftTriggerLevel, float rightTriggerLevel)
+ {
+ return false;
+ }
+
+ public void XboxOne_Gamepad_PulseVibrateMotor(ulong xboxOneJoystickId, int motorInt, float startLevel, float endLevel, ulong durationMS)
+ {
+ }
+
+ public void GetDeviceVIDPIDs(out List<int> vids, out List<int> pids)
+ {
+ vids = new List<int>();
+ pids = new List<int>();
+ }
+
+ public int GetAndroidAPILevel()
+ {
+ return -1;
+ }
+
+ public void WindowsStandalone_ForwardRawInput(IntPtr rawInputHeaderIndices, IntPtr rawInputDataIndices, uint indicesCount, IntPtr rawInputData, uint rawInputDataSize)
+ {
+ UnityEngine.Windows.Input.ForwardRawInput(rawInputHeaderIndices, rawInputDataIndices, indicesCount, rawInputData, rawInputDataSize);
+ }
+
+ public bool UnityUI_Graphic_GetRaycastTarget(object graphic)
+ {
+ if (graphic as Graphic == null)
+ {
+ return false;
+ }
+ return (graphic as Graphic).raycastTarget;
+ }
+
+ public void UnityUI_Graphic_SetRaycastTarget(object graphic, bool value)
+ {
+ if (!(graphic as Graphic == null))
+ {
+ (graphic as Graphic).raycastTarget = value;
+ }
+ }
+
+ public float UnityInput_GetTouchPressure(ref Touch touch)
+ {
+ return touch.pressure;
+ }
+
+ public float UnityInput_GetTouchMaximumPossiblePressure(ref Touch touch)
+ {
+ return touch.maximumPossiblePressure;
+ }
+
+ public IControllerTemplate CreateControllerTemplate(Guid typeGuid, object payload)
+ {
+ return ControllerTemplateFactory.Create(typeGuid, payload);
+ }
+
+ public Type[] GetControllerTemplateTypes()
+ {
+ return ControllerTemplateFactory.templateTypes;
+ }
+
+ public Type[] GetControllerTemplateInterfaceTypes()
+ {
+ return ControllerTemplateFactory.templateInterfaceTypes;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired/FlightPedalsTemplate.cs b/Thronefall_v1.57/Thronefall/Rewired/FlightPedalsTemplate.cs
new file mode 100644
index 0000000..29a18b5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired/FlightPedalsTemplate.cs
@@ -0,0 +1,25 @@
+using System;
+
+namespace Rewired;
+
+public sealed class FlightPedalsTemplate : ControllerTemplate, IFlightPedalsTemplate, IControllerTemplate
+{
+ public static readonly Guid typeGuid = new Guid("f6fe76f8-be2a-4db2-b853-9e3652075913");
+
+ public const int elementId_leftPedal = 0;
+
+ public const int elementId_rightPedal = 1;
+
+ public const int elementId_slide = 2;
+
+ IControllerTemplateAxis IFlightPedalsTemplate.leftPedal => GetElement<IControllerTemplateAxis>(0);
+
+ IControllerTemplateAxis IFlightPedalsTemplate.rightPedal => GetElement<IControllerTemplateAxis>(1);
+
+ IControllerTemplateAxis IFlightPedalsTemplate.slide => GetElement<IControllerTemplateAxis>(2);
+
+ public FlightPedalsTemplate(object payload)
+ : base(payload)
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired/FlightYokeTemplate.cs b/Thronefall_v1.57/Thronefall/Rewired/FlightYokeTemplate.cs
new file mode 100644
index 0000000..818f761
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired/FlightYokeTemplate.cs
@@ -0,0 +1,265 @@
+using System;
+
+namespace Rewired;
+
+public sealed class FlightYokeTemplate : ControllerTemplate, IFlightYokeTemplate, IControllerTemplate
+{
+ public static readonly Guid typeGuid = new Guid("f311fa16-0ccc-41c0-ac4b-50f7100bb8ff");
+
+ public const int elementId_rotateYoke = 0;
+
+ public const int elementId_yokeZ = 1;
+
+ public const int elementId_leftPaddle = 59;
+
+ public const int elementId_rightPaddle = 60;
+
+ public const int elementId_lever1Axis = 2;
+
+ public const int elementId_lever1MinDetent = 64;
+
+ public const int elementId_lever2Axis = 3;
+
+ public const int elementId_lever2MinDetent = 65;
+
+ public const int elementId_lever3Axis = 4;
+
+ public const int elementId_lever3MinDetent = 66;
+
+ public const int elementId_lever4Axis = 5;
+
+ public const int elementId_lever4MinDetent = 67;
+
+ public const int elementId_lever5Axis = 6;
+
+ public const int elementId_lever5MinDetent = 68;
+
+ public const int elementId_leftGripButton1 = 7;
+
+ public const int elementId_leftGripButton2 = 8;
+
+ public const int elementId_leftGripButton3 = 9;
+
+ public const int elementId_leftGripButton4 = 10;
+
+ public const int elementId_leftGripButton5 = 11;
+
+ public const int elementId_leftGripButton6 = 12;
+
+ public const int elementId_rightGripButton1 = 13;
+
+ public const int elementId_rightGripButton2 = 14;
+
+ public const int elementId_rightGripButton3 = 15;
+
+ public const int elementId_rightGripButton4 = 16;
+
+ public const int elementId_rightGripButton5 = 17;
+
+ public const int elementId_rightGripButton6 = 18;
+
+ public const int elementId_centerButton1 = 19;
+
+ public const int elementId_centerButton2 = 20;
+
+ public const int elementId_centerButton3 = 21;
+
+ public const int elementId_centerButton4 = 22;
+
+ public const int elementId_centerButton5 = 23;
+
+ public const int elementId_centerButton6 = 24;
+
+ public const int elementId_centerButton7 = 25;
+
+ public const int elementId_centerButton8 = 26;
+
+ public const int elementId_wheel1Up = 53;
+
+ public const int elementId_wheel1Down = 54;
+
+ public const int elementId_wheel1Press = 55;
+
+ public const int elementId_wheel2Up = 56;
+
+ public const int elementId_wheel2Down = 57;
+
+ public const int elementId_wheel2Press = 58;
+
+ public const int elementId_leftGripHatUp = 27;
+
+ public const int elementId_leftGripHatUpRight = 28;
+
+ public const int elementId_leftGripHatRight = 29;
+
+ public const int elementId_leftGripHatDownRight = 30;
+
+ public const int elementId_leftGripHatDown = 31;
+
+ public const int elementId_leftGripHatDownLeft = 32;
+
+ public const int elementId_leftGripHatLeft = 33;
+
+ public const int elementId_leftGripHatUpLeft = 34;
+
+ public const int elementId_rightGripHatUp = 35;
+
+ public const int elementId_rightGripHatUpRight = 36;
+
+ public const int elementId_rightGripHatRight = 37;
+
+ public const int elementId_rightGripHatDownRight = 38;
+
+ public const int elementId_rightGripHatDown = 39;
+
+ public const int elementId_rightGripHatDownLeft = 40;
+
+ public const int elementId_rightGripHatLeft = 41;
+
+ public const int elementId_rightGripHatUpLeft = 42;
+
+ public const int elementId_consoleButton1 = 43;
+
+ public const int elementId_consoleButton2 = 44;
+
+ public const int elementId_consoleButton3 = 45;
+
+ public const int elementId_consoleButton4 = 46;
+
+ public const int elementId_consoleButton5 = 47;
+
+ public const int elementId_consoleButton6 = 48;
+
+ public const int elementId_consoleButton7 = 49;
+
+ public const int elementId_consoleButton8 = 50;
+
+ public const int elementId_consoleButton9 = 51;
+
+ public const int elementId_consoleButton10 = 52;
+
+ public const int elementId_mode1 = 61;
+
+ public const int elementId_mode2 = 62;
+
+ public const int elementId_mode3 = 63;
+
+ public const int elementId_yoke = 69;
+
+ public const int elementId_lever1 = 70;
+
+ public const int elementId_lever2 = 71;
+
+ public const int elementId_lever3 = 72;
+
+ public const int elementId_lever4 = 73;
+
+ public const int elementId_lever5 = 74;
+
+ public const int elementId_leftGripHat = 75;
+
+ public const int elementId_rightGripHat = 76;
+
+ IControllerTemplateButton IFlightYokeTemplate.leftPaddle => GetElement<IControllerTemplateButton>(59);
+
+ IControllerTemplateButton IFlightYokeTemplate.rightPaddle => GetElement<IControllerTemplateButton>(60);
+
+ IControllerTemplateButton IFlightYokeTemplate.leftGripButton1 => GetElement<IControllerTemplateButton>(7);
+
+ IControllerTemplateButton IFlightYokeTemplate.leftGripButton2 => GetElement<IControllerTemplateButton>(8);
+
+ IControllerTemplateButton IFlightYokeTemplate.leftGripButton3 => GetElement<IControllerTemplateButton>(9);
+
+ IControllerTemplateButton IFlightYokeTemplate.leftGripButton4 => GetElement<IControllerTemplateButton>(10);
+
+ IControllerTemplateButton IFlightYokeTemplate.leftGripButton5 => GetElement<IControllerTemplateButton>(11);
+
+ IControllerTemplateButton IFlightYokeTemplate.leftGripButton6 => GetElement<IControllerTemplateButton>(12);
+
+ IControllerTemplateButton IFlightYokeTemplate.rightGripButton1 => GetElement<IControllerTemplateButton>(13);
+
+ IControllerTemplateButton IFlightYokeTemplate.rightGripButton2 => GetElement<IControllerTemplateButton>(14);
+
+ IControllerTemplateButton IFlightYokeTemplate.rightGripButton3 => GetElement<IControllerTemplateButton>(15);
+
+ IControllerTemplateButton IFlightYokeTemplate.rightGripButton4 => GetElement<IControllerTemplateButton>(16);
+
+ IControllerTemplateButton IFlightYokeTemplate.rightGripButton5 => GetElement<IControllerTemplateButton>(17);
+
+ IControllerTemplateButton IFlightYokeTemplate.rightGripButton6 => GetElement<IControllerTemplateButton>(18);
+
+ IControllerTemplateButton IFlightYokeTemplate.centerButton1 => GetElement<IControllerTemplateButton>(19);
+
+ IControllerTemplateButton IFlightYokeTemplate.centerButton2 => GetElement<IControllerTemplateButton>(20);
+
+ IControllerTemplateButton IFlightYokeTemplate.centerButton3 => GetElement<IControllerTemplateButton>(21);
+
+ IControllerTemplateButton IFlightYokeTemplate.centerButton4 => GetElement<IControllerTemplateButton>(22);
+
+ IControllerTemplateButton IFlightYokeTemplate.centerButton5 => GetElement<IControllerTemplateButton>(23);
+
+ IControllerTemplateButton IFlightYokeTemplate.centerButton6 => GetElement<IControllerTemplateButton>(24);
+
+ IControllerTemplateButton IFlightYokeTemplate.centerButton7 => GetElement<IControllerTemplateButton>(25);
+
+ IControllerTemplateButton IFlightYokeTemplate.centerButton8 => GetElement<IControllerTemplateButton>(26);
+
+ IControllerTemplateButton IFlightYokeTemplate.wheel1Up => GetElement<IControllerTemplateButton>(53);
+
+ IControllerTemplateButton IFlightYokeTemplate.wheel1Down => GetElement<IControllerTemplateButton>(54);
+
+ IControllerTemplateButton IFlightYokeTemplate.wheel1Press => GetElement<IControllerTemplateButton>(55);
+
+ IControllerTemplateButton IFlightYokeTemplate.wheel2Up => GetElement<IControllerTemplateButton>(56);
+
+ IControllerTemplateButton IFlightYokeTemplate.wheel2Down => GetElement<IControllerTemplateButton>(57);
+
+ IControllerTemplateButton IFlightYokeTemplate.wheel2Press => GetElement<IControllerTemplateButton>(58);
+
+ IControllerTemplateButton IFlightYokeTemplate.consoleButton1 => GetElement<IControllerTemplateButton>(43);
+
+ IControllerTemplateButton IFlightYokeTemplate.consoleButton2 => GetElement<IControllerTemplateButton>(44);
+
+ IControllerTemplateButton IFlightYokeTemplate.consoleButton3 => GetElement<IControllerTemplateButton>(45);
+
+ IControllerTemplateButton IFlightYokeTemplate.consoleButton4 => GetElement<IControllerTemplateButton>(46);
+
+ IControllerTemplateButton IFlightYokeTemplate.consoleButton5 => GetElement<IControllerTemplateButton>(47);
+
+ IControllerTemplateButton IFlightYokeTemplate.consoleButton6 => GetElement<IControllerTemplateButton>(48);
+
+ IControllerTemplateButton IFlightYokeTemplate.consoleButton7 => GetElement<IControllerTemplateButton>(49);
+
+ IControllerTemplateButton IFlightYokeTemplate.consoleButton8 => GetElement<IControllerTemplateButton>(50);
+
+ IControllerTemplateButton IFlightYokeTemplate.consoleButton9 => GetElement<IControllerTemplateButton>(51);
+
+ IControllerTemplateButton IFlightYokeTemplate.consoleButton10 => GetElement<IControllerTemplateButton>(52);
+
+ IControllerTemplateButton IFlightYokeTemplate.mode1 => GetElement<IControllerTemplateButton>(61);
+
+ IControllerTemplateButton IFlightYokeTemplate.mode2 => GetElement<IControllerTemplateButton>(62);
+
+ IControllerTemplateButton IFlightYokeTemplate.mode3 => GetElement<IControllerTemplateButton>(63);
+
+ IControllerTemplateYoke IFlightYokeTemplate.yoke => GetElement<IControllerTemplateYoke>(69);
+
+ IControllerTemplateThrottle IFlightYokeTemplate.lever1 => GetElement<IControllerTemplateThrottle>(70);
+
+ IControllerTemplateThrottle IFlightYokeTemplate.lever2 => GetElement<IControllerTemplateThrottle>(71);
+
+ IControllerTemplateThrottle IFlightYokeTemplate.lever3 => GetElement<IControllerTemplateThrottle>(72);
+
+ IControllerTemplateThrottle IFlightYokeTemplate.lever4 => GetElement<IControllerTemplateThrottle>(73);
+
+ IControllerTemplateThrottle IFlightYokeTemplate.lever5 => GetElement<IControllerTemplateThrottle>(74);
+
+ IControllerTemplateHat IFlightYokeTemplate.leftGripHat => GetElement<IControllerTemplateHat>(75);
+
+ IControllerTemplateHat IFlightYokeTemplate.rightGripHat => GetElement<IControllerTemplateHat>(76);
+
+ public FlightYokeTemplate(object payload)
+ : base(payload)
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired/GamepadTemplate.cs b/Thronefall_v1.57/Thronefall/Rewired/GamepadTemplate.cs
new file mode 100644
index 0000000..2db2fba
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired/GamepadTemplate.cs
@@ -0,0 +1,149 @@
+using System;
+
+namespace Rewired;
+
+public sealed class GamepadTemplate : ControllerTemplate, IGamepadTemplate, IControllerTemplate
+{
+ public static readonly Guid typeGuid = new Guid("83b427e4-086f-47f3-bb06-be266abd1ca5");
+
+ public const int elementId_leftStickX = 0;
+
+ public const int elementId_leftStickY = 1;
+
+ public const int elementId_rightStickX = 2;
+
+ public const int elementId_rightStickY = 3;
+
+ public const int elementId_actionBottomRow1 = 4;
+
+ public const int elementId_a = 4;
+
+ public const int elementId_actionBottomRow2 = 5;
+
+ public const int elementId_b = 5;
+
+ public const int elementId_actionBottomRow3 = 6;
+
+ public const int elementId_c = 6;
+
+ public const int elementId_actionTopRow1 = 7;
+
+ public const int elementId_x = 7;
+
+ public const int elementId_actionTopRow2 = 8;
+
+ public const int elementId_y = 8;
+
+ public const int elementId_actionTopRow3 = 9;
+
+ public const int elementId_z = 9;
+
+ public const int elementId_leftShoulder1 = 10;
+
+ public const int elementId_leftBumper = 10;
+
+ public const int elementId_leftShoulder2 = 11;
+
+ public const int elementId_leftTrigger = 11;
+
+ public const int elementId_rightShoulder1 = 12;
+
+ public const int elementId_rightBumper = 12;
+
+ public const int elementId_rightShoulder2 = 13;
+
+ public const int elementId_rightTrigger = 13;
+
+ public const int elementId_center1 = 14;
+
+ public const int elementId_back = 14;
+
+ public const int elementId_center2 = 15;
+
+ public const int elementId_start = 15;
+
+ public const int elementId_center3 = 16;
+
+ public const int elementId_guide = 16;
+
+ public const int elementId_leftStickButton = 17;
+
+ public const int elementId_rightStickButton = 18;
+
+ public const int elementId_dPadUp = 19;
+
+ public const int elementId_dPadRight = 20;
+
+ public const int elementId_dPadDown = 21;
+
+ public const int elementId_dPadLeft = 22;
+
+ public const int elementId_leftStick = 23;
+
+ public const int elementId_rightStick = 24;
+
+ public const int elementId_dPad = 25;
+
+ IControllerTemplateButton IGamepadTemplate.actionBottomRow1 => GetElement<IControllerTemplateButton>(4);
+
+ IControllerTemplateButton IGamepadTemplate.a => GetElement<IControllerTemplateButton>(4);
+
+ IControllerTemplateButton IGamepadTemplate.actionBottomRow2 => GetElement<IControllerTemplateButton>(5);
+
+ IControllerTemplateButton IGamepadTemplate.b => GetElement<IControllerTemplateButton>(5);
+
+ IControllerTemplateButton IGamepadTemplate.actionBottomRow3 => GetElement<IControllerTemplateButton>(6);
+
+ IControllerTemplateButton IGamepadTemplate.c => GetElement<IControllerTemplateButton>(6);
+
+ IControllerTemplateButton IGamepadTemplate.actionTopRow1 => GetElement<IControllerTemplateButton>(7);
+
+ IControllerTemplateButton IGamepadTemplate.x => GetElement<IControllerTemplateButton>(7);
+
+ IControllerTemplateButton IGamepadTemplate.actionTopRow2 => GetElement<IControllerTemplateButton>(8);
+
+ IControllerTemplateButton IGamepadTemplate.y => GetElement<IControllerTemplateButton>(8);
+
+ IControllerTemplateButton IGamepadTemplate.actionTopRow3 => GetElement<IControllerTemplateButton>(9);
+
+ IControllerTemplateButton IGamepadTemplate.z => GetElement<IControllerTemplateButton>(9);
+
+ IControllerTemplateButton IGamepadTemplate.leftShoulder1 => GetElement<IControllerTemplateButton>(10);
+
+ IControllerTemplateButton IGamepadTemplate.leftBumper => GetElement<IControllerTemplateButton>(10);
+
+ IControllerTemplateAxis IGamepadTemplate.leftShoulder2 => GetElement<IControllerTemplateAxis>(11);
+
+ IControllerTemplateAxis IGamepadTemplate.leftTrigger => GetElement<IControllerTemplateAxis>(11);
+
+ IControllerTemplateButton IGamepadTemplate.rightShoulder1 => GetElement<IControllerTemplateButton>(12);
+
+ IControllerTemplateButton IGamepadTemplate.rightBumper => GetElement<IControllerTemplateButton>(12);
+
+ IControllerTemplateAxis IGamepadTemplate.rightShoulder2 => GetElement<IControllerTemplateAxis>(13);
+
+ IControllerTemplateAxis IGamepadTemplate.rightTrigger => GetElement<IControllerTemplateAxis>(13);
+
+ IControllerTemplateButton IGamepadTemplate.center1 => GetElement<IControllerTemplateButton>(14);
+
+ IControllerTemplateButton IGamepadTemplate.back => GetElement<IControllerTemplateButton>(14);
+
+ IControllerTemplateButton IGamepadTemplate.center2 => GetElement<IControllerTemplateButton>(15);
+
+ IControllerTemplateButton IGamepadTemplate.start => GetElement<IControllerTemplateButton>(15);
+
+ IControllerTemplateButton IGamepadTemplate.center3 => GetElement<IControllerTemplateButton>(16);
+
+ IControllerTemplateButton IGamepadTemplate.guide => GetElement<IControllerTemplateButton>(16);
+
+ IControllerTemplateThumbStick IGamepadTemplate.leftStick => GetElement<IControllerTemplateThumbStick>(23);
+
+ IControllerTemplateThumbStick IGamepadTemplate.rightStick => GetElement<IControllerTemplateThumbStick>(24);
+
+ IControllerTemplateDPad IGamepadTemplate.dPad => GetElement<IControllerTemplateDPad>(25);
+
+ public GamepadTemplate(object payload)
+ : base(payload)
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired/HOTASTemplate.cs b/Thronefall_v1.57/Thronefall/Rewired/HOTASTemplate.cs
new file mode 100644
index 0000000..9324f5c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired/HOTASTemplate.cs
@@ -0,0 +1,525 @@
+using System;
+
+namespace Rewired;
+
+public sealed class HOTASTemplate : ControllerTemplate, IHOTASTemplate, IControllerTemplate
+{
+ public static readonly Guid typeGuid = new Guid("061a00cf-d8c2-4f8d-8cb5-a15a010bc53e");
+
+ public const int elementId_stickX = 0;
+
+ public const int elementId_stickY = 1;
+
+ public const int elementId_stickRotate = 2;
+
+ public const int elementId_stickMiniStick1X = 78;
+
+ public const int elementId_stickMiniStick1Y = 79;
+
+ public const int elementId_stickMiniStick1Press = 80;
+
+ public const int elementId_stickMiniStick2X = 81;
+
+ public const int elementId_stickMiniStick2Y = 82;
+
+ public const int elementId_stickMiniStick2Press = 83;
+
+ public const int elementId_stickTrigger = 3;
+
+ public const int elementId_stickTriggerStage2 = 4;
+
+ public const int elementId_stickPinkyButton = 5;
+
+ public const int elementId_stickPinkyTrigger = 154;
+
+ public const int elementId_stickButton1 = 6;
+
+ public const int elementId_stickButton2 = 7;
+
+ public const int elementId_stickButton3 = 8;
+
+ public const int elementId_stickButton4 = 9;
+
+ public const int elementId_stickButton5 = 10;
+
+ public const int elementId_stickButton6 = 11;
+
+ public const int elementId_stickButton7 = 12;
+
+ public const int elementId_stickButton8 = 13;
+
+ public const int elementId_stickButton9 = 14;
+
+ public const int elementId_stickButton10 = 15;
+
+ public const int elementId_stickBaseButton1 = 18;
+
+ public const int elementId_stickBaseButton2 = 19;
+
+ public const int elementId_stickBaseButton3 = 20;
+
+ public const int elementId_stickBaseButton4 = 21;
+
+ public const int elementId_stickBaseButton5 = 22;
+
+ public const int elementId_stickBaseButton6 = 23;
+
+ public const int elementId_stickBaseButton7 = 24;
+
+ public const int elementId_stickBaseButton8 = 25;
+
+ public const int elementId_stickBaseButton9 = 26;
+
+ public const int elementId_stickBaseButton10 = 27;
+
+ public const int elementId_stickBaseButton11 = 161;
+
+ public const int elementId_stickBaseButton12 = 162;
+
+ public const int elementId_stickHat1Up = 28;
+
+ public const int elementId_stickHat1UpRight = 29;
+
+ public const int elementId_stickHat1Right = 30;
+
+ public const int elementId_stickHat1DownRight = 31;
+
+ public const int elementId_stickHat1Down = 32;
+
+ public const int elementId_stickHat1DownLeft = 33;
+
+ public const int elementId_stickHat1Left = 34;
+
+ public const int elementId_stickHat1Up_Left = 35;
+
+ public const int elementId_stickHat2Up = 36;
+
+ public const int elementId_stickHat2Up_right = 37;
+
+ public const int elementId_stickHat2Right = 38;
+
+ public const int elementId_stickHat2Down_Right = 39;
+
+ public const int elementId_stickHat2Down = 40;
+
+ public const int elementId_stickHat2Down_Left = 41;
+
+ public const int elementId_stickHat2Left = 42;
+
+ public const int elementId_stickHat2Up_Left = 43;
+
+ public const int elementId_stickHat3Up = 84;
+
+ public const int elementId_stickHat3Up_Right = 85;
+
+ public const int elementId_stickHat3Right = 86;
+
+ public const int elementId_stickHat3Down_Right = 87;
+
+ public const int elementId_stickHat3Down = 88;
+
+ public const int elementId_stickHat3Down_Left = 89;
+
+ public const int elementId_stickHat3Left = 90;
+
+ public const int elementId_stickHat3Up_Left = 91;
+
+ public const int elementId_stickHat4Up = 92;
+
+ public const int elementId_stickHat4Up_Right = 93;
+
+ public const int elementId_stickHat4Right = 94;
+
+ public const int elementId_stickHat4Down_Right = 95;
+
+ public const int elementId_stickHat4Down = 96;
+
+ public const int elementId_stickHat4Down_Left = 97;
+
+ public const int elementId_stickHat4Left = 98;
+
+ public const int elementId_stickHat4Up_Left = 99;
+
+ public const int elementId_mode1 = 44;
+
+ public const int elementId_mode2 = 45;
+
+ public const int elementId_mode3 = 46;
+
+ public const int elementId_throttle1Axis = 49;
+
+ public const int elementId_throttle2Axis = 155;
+
+ public const int elementId_throttle1MinDetent = 166;
+
+ public const int elementId_throttle2MinDetent = 167;
+
+ public const int elementId_throttleButton1 = 50;
+
+ public const int elementId_throttleButton2 = 51;
+
+ public const int elementId_throttleButton3 = 52;
+
+ public const int elementId_throttleButton4 = 53;
+
+ public const int elementId_throttleButton5 = 54;
+
+ public const int elementId_throttleButton6 = 55;
+
+ public const int elementId_throttleButton7 = 56;
+
+ public const int elementId_throttleButton8 = 57;
+
+ public const int elementId_throttleButton9 = 58;
+
+ public const int elementId_throttleButton10 = 59;
+
+ public const int elementId_throttleBaseButton1 = 60;
+
+ public const int elementId_throttleBaseButton2 = 61;
+
+ public const int elementId_throttleBaseButton3 = 62;
+
+ public const int elementId_throttleBaseButton4 = 63;
+
+ public const int elementId_throttleBaseButton5 = 64;
+
+ public const int elementId_throttleBaseButton6 = 65;
+
+ public const int elementId_throttleBaseButton7 = 66;
+
+ public const int elementId_throttleBaseButton8 = 67;
+
+ public const int elementId_throttleBaseButton9 = 68;
+
+ public const int elementId_throttleBaseButton10 = 69;
+
+ public const int elementId_throttleBaseButton11 = 132;
+
+ public const int elementId_throttleBaseButton12 = 133;
+
+ public const int elementId_throttleBaseButton13 = 134;
+
+ public const int elementId_throttleBaseButton14 = 135;
+
+ public const int elementId_throttleBaseButton15 = 136;
+
+ public const int elementId_throttleSlider1 = 70;
+
+ public const int elementId_throttleSlider2 = 71;
+
+ public const int elementId_throttleSlider3 = 72;
+
+ public const int elementId_throttleSlider4 = 73;
+
+ public const int elementId_throttleDial1 = 74;
+
+ public const int elementId_throttleDial2 = 142;
+
+ public const int elementId_throttleDial3 = 143;
+
+ public const int elementId_throttleDial4 = 144;
+
+ public const int elementId_throttleMiniStickX = 75;
+
+ public const int elementId_throttleMiniStickY = 76;
+
+ public const int elementId_throttleMiniStickPress = 77;
+
+ public const int elementId_throttleWheel1Forward = 145;
+
+ public const int elementId_throttleWheel1Back = 146;
+
+ public const int elementId_throttleWheel1Press = 147;
+
+ public const int elementId_throttleWheel2Forward = 148;
+
+ public const int elementId_throttleWheel2Back = 149;
+
+ public const int elementId_throttleWheel2Press = 150;
+
+ public const int elementId_throttleWheel3Forward = 151;
+
+ public const int elementId_throttleWheel3Back = 152;
+
+ public const int elementId_throttleWheel3Press = 153;
+
+ public const int elementId_throttleHat1Up = 100;
+
+ public const int elementId_throttleHat1Up_Right = 101;
+
+ public const int elementId_throttleHat1Right = 102;
+
+ public const int elementId_throttleHat1Down_Right = 103;
+
+ public const int elementId_throttleHat1Down = 104;
+
+ public const int elementId_throttleHat1Down_Left = 105;
+
+ public const int elementId_throttleHat1Left = 106;
+
+ public const int elementId_throttleHat1Up_Left = 107;
+
+ public const int elementId_throttleHat2Up = 108;
+
+ public const int elementId_throttleHat2Up_Right = 109;
+
+ public const int elementId_throttleHat2Right = 110;
+
+ public const int elementId_throttleHat2Down_Right = 111;
+
+ public const int elementId_throttleHat2Down = 112;
+
+ public const int elementId_throttleHat2Down_Left = 113;
+
+ public const int elementId_throttleHat2Left = 114;
+
+ public const int elementId_throttleHat2Up_Left = 115;
+
+ public const int elementId_throttleHat3Up = 116;
+
+ public const int elementId_throttleHat3Up_Right = 117;
+
+ public const int elementId_throttleHat3Right = 118;
+
+ public const int elementId_throttleHat3Down_Right = 119;
+
+ public const int elementId_throttleHat3Down = 120;
+
+ public const int elementId_throttleHat3Down_Left = 121;
+
+ public const int elementId_throttleHat3Left = 122;
+
+ public const int elementId_throttleHat3Up_Left = 123;
+
+ public const int elementId_throttleHat4Up = 124;
+
+ public const int elementId_throttleHat4Up_Right = 125;
+
+ public const int elementId_throttleHat4Right = 126;
+
+ public const int elementId_throttleHat4Down_Right = 127;
+
+ public const int elementId_throttleHat4Down = 128;
+
+ public const int elementId_throttleHat4Down_Left = 129;
+
+ public const int elementId_throttleHat4Left = 130;
+
+ public const int elementId_throttleHat4Up_Left = 131;
+
+ public const int elementId_leftPedal = 168;
+
+ public const int elementId_rightPedal = 169;
+
+ public const int elementId_slidePedals = 170;
+
+ public const int elementId_stick = 171;
+
+ public const int elementId_stickMiniStick1 = 172;
+
+ public const int elementId_stickMiniStick2 = 173;
+
+ public const int elementId_stickHat1 = 174;
+
+ public const int elementId_stickHat2 = 175;
+
+ public const int elementId_stickHat3 = 176;
+
+ public const int elementId_stickHat4 = 177;
+
+ public const int elementId_throttle1 = 178;
+
+ public const int elementId_throttle2 = 179;
+
+ public const int elementId_throttleMiniStick = 180;
+
+ public const int elementId_throttleHat1 = 181;
+
+ public const int elementId_throttleHat2 = 182;
+
+ public const int elementId_throttleHat3 = 183;
+
+ public const int elementId_throttleHat4 = 184;
+
+ IControllerTemplateButton IHOTASTemplate.stickTrigger => GetElement<IControllerTemplateButton>(3);
+
+ IControllerTemplateButton IHOTASTemplate.stickTriggerStage2 => GetElement<IControllerTemplateButton>(4);
+
+ IControllerTemplateButton IHOTASTemplate.stickPinkyButton => GetElement<IControllerTemplateButton>(5);
+
+ IControllerTemplateButton IHOTASTemplate.stickPinkyTrigger => GetElement<IControllerTemplateButton>(154);
+
+ IControllerTemplateButton IHOTASTemplate.stickButton1 => GetElement<IControllerTemplateButton>(6);
+
+ IControllerTemplateButton IHOTASTemplate.stickButton2 => GetElement<IControllerTemplateButton>(7);
+
+ IControllerTemplateButton IHOTASTemplate.stickButton3 => GetElement<IControllerTemplateButton>(8);
+
+ IControllerTemplateButton IHOTASTemplate.stickButton4 => GetElement<IControllerTemplateButton>(9);
+
+ IControllerTemplateButton IHOTASTemplate.stickButton5 => GetElement<IControllerTemplateButton>(10);
+
+ IControllerTemplateButton IHOTASTemplate.stickButton6 => GetElement<IControllerTemplateButton>(11);
+
+ IControllerTemplateButton IHOTASTemplate.stickButton7 => GetElement<IControllerTemplateButton>(12);
+
+ IControllerTemplateButton IHOTASTemplate.stickButton8 => GetElement<IControllerTemplateButton>(13);
+
+ IControllerTemplateButton IHOTASTemplate.stickButton9 => GetElement<IControllerTemplateButton>(14);
+
+ IControllerTemplateButton IHOTASTemplate.stickButton10 => GetElement<IControllerTemplateButton>(15);
+
+ IControllerTemplateButton IHOTASTemplate.stickBaseButton1 => GetElement<IControllerTemplateButton>(18);
+
+ IControllerTemplateButton IHOTASTemplate.stickBaseButton2 => GetElement<IControllerTemplateButton>(19);
+
+ IControllerTemplateButton IHOTASTemplate.stickBaseButton3 => GetElement<IControllerTemplateButton>(20);
+
+ IControllerTemplateButton IHOTASTemplate.stickBaseButton4 => GetElement<IControllerTemplateButton>(21);
+
+ IControllerTemplateButton IHOTASTemplate.stickBaseButton5 => GetElement<IControllerTemplateButton>(22);
+
+ IControllerTemplateButton IHOTASTemplate.stickBaseButton6 => GetElement<IControllerTemplateButton>(23);
+
+ IControllerTemplateButton IHOTASTemplate.stickBaseButton7 => GetElement<IControllerTemplateButton>(24);
+
+ IControllerTemplateButton IHOTASTemplate.stickBaseButton8 => GetElement<IControllerTemplateButton>(25);
+
+ IControllerTemplateButton IHOTASTemplate.stickBaseButton9 => GetElement<IControllerTemplateButton>(26);
+
+ IControllerTemplateButton IHOTASTemplate.stickBaseButton10 => GetElement<IControllerTemplateButton>(27);
+
+ IControllerTemplateButton IHOTASTemplate.stickBaseButton11 => GetElement<IControllerTemplateButton>(161);
+
+ IControllerTemplateButton IHOTASTemplate.stickBaseButton12 => GetElement<IControllerTemplateButton>(162);
+
+ IControllerTemplateButton IHOTASTemplate.mode1 => GetElement<IControllerTemplateButton>(44);
+
+ IControllerTemplateButton IHOTASTemplate.mode2 => GetElement<IControllerTemplateButton>(45);
+
+ IControllerTemplateButton IHOTASTemplate.mode3 => GetElement<IControllerTemplateButton>(46);
+
+ IControllerTemplateButton IHOTASTemplate.throttleButton1 => GetElement<IControllerTemplateButton>(50);
+
+ IControllerTemplateButton IHOTASTemplate.throttleButton2 => GetElement<IControllerTemplateButton>(51);
+
+ IControllerTemplateButton IHOTASTemplate.throttleButton3 => GetElement<IControllerTemplateButton>(52);
+
+ IControllerTemplateButton IHOTASTemplate.throttleButton4 => GetElement<IControllerTemplateButton>(53);
+
+ IControllerTemplateButton IHOTASTemplate.throttleButton5 => GetElement<IControllerTemplateButton>(54);
+
+ IControllerTemplateButton IHOTASTemplate.throttleButton6 => GetElement<IControllerTemplateButton>(55);
+
+ IControllerTemplateButton IHOTASTemplate.throttleButton7 => GetElement<IControllerTemplateButton>(56);
+
+ IControllerTemplateButton IHOTASTemplate.throttleButton8 => GetElement<IControllerTemplateButton>(57);
+
+ IControllerTemplateButton IHOTASTemplate.throttleButton9 => GetElement<IControllerTemplateButton>(58);
+
+ IControllerTemplateButton IHOTASTemplate.throttleButton10 => GetElement<IControllerTemplateButton>(59);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton1 => GetElement<IControllerTemplateButton>(60);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton2 => GetElement<IControllerTemplateButton>(61);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton3 => GetElement<IControllerTemplateButton>(62);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton4 => GetElement<IControllerTemplateButton>(63);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton5 => GetElement<IControllerTemplateButton>(64);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton6 => GetElement<IControllerTemplateButton>(65);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton7 => GetElement<IControllerTemplateButton>(66);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton8 => GetElement<IControllerTemplateButton>(67);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton9 => GetElement<IControllerTemplateButton>(68);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton10 => GetElement<IControllerTemplateButton>(69);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton11 => GetElement<IControllerTemplateButton>(132);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton12 => GetElement<IControllerTemplateButton>(133);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton13 => GetElement<IControllerTemplateButton>(134);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton14 => GetElement<IControllerTemplateButton>(135);
+
+ IControllerTemplateButton IHOTASTemplate.throttleBaseButton15 => GetElement<IControllerTemplateButton>(136);
+
+ IControllerTemplateAxis IHOTASTemplate.throttleSlider1 => GetElement<IControllerTemplateAxis>(70);
+
+ IControllerTemplateAxis IHOTASTemplate.throttleSlider2 => GetElement<IControllerTemplateAxis>(71);
+
+ IControllerTemplateAxis IHOTASTemplate.throttleSlider3 => GetElement<IControllerTemplateAxis>(72);
+
+ IControllerTemplateAxis IHOTASTemplate.throttleSlider4 => GetElement<IControllerTemplateAxis>(73);
+
+ IControllerTemplateAxis IHOTASTemplate.throttleDial1 => GetElement<IControllerTemplateAxis>(74);
+
+ IControllerTemplateAxis IHOTASTemplate.throttleDial2 => GetElement<IControllerTemplateAxis>(142);
+
+ IControllerTemplateAxis IHOTASTemplate.throttleDial3 => GetElement<IControllerTemplateAxis>(143);
+
+ IControllerTemplateAxis IHOTASTemplate.throttleDial4 => GetElement<IControllerTemplateAxis>(144);
+
+ IControllerTemplateButton IHOTASTemplate.throttleWheel1Forward => GetElement<IControllerTemplateButton>(145);
+
+ IControllerTemplateButton IHOTASTemplate.throttleWheel1Back => GetElement<IControllerTemplateButton>(146);
+
+ IControllerTemplateButton IHOTASTemplate.throttleWheel1Press => GetElement<IControllerTemplateButton>(147);
+
+ IControllerTemplateButton IHOTASTemplate.throttleWheel2Forward => GetElement<IControllerTemplateButton>(148);
+
+ IControllerTemplateButton IHOTASTemplate.throttleWheel2Back => GetElement<IControllerTemplateButton>(149);
+
+ IControllerTemplateButton IHOTASTemplate.throttleWheel2Press => GetElement<IControllerTemplateButton>(150);
+
+ IControllerTemplateButton IHOTASTemplate.throttleWheel3Forward => GetElement<IControllerTemplateButton>(151);
+
+ IControllerTemplateButton IHOTASTemplate.throttleWheel3Back => GetElement<IControllerTemplateButton>(152);
+
+ IControllerTemplateButton IHOTASTemplate.throttleWheel3Press => GetElement<IControllerTemplateButton>(153);
+
+ IControllerTemplateAxis IHOTASTemplate.leftPedal => GetElement<IControllerTemplateAxis>(168);
+
+ IControllerTemplateAxis IHOTASTemplate.rightPedal => GetElement<IControllerTemplateAxis>(169);
+
+ IControllerTemplateAxis IHOTASTemplate.slidePedals => GetElement<IControllerTemplateAxis>(170);
+
+ IControllerTemplateStick IHOTASTemplate.stick => GetElement<IControllerTemplateStick>(171);
+
+ IControllerTemplateThumbStick IHOTASTemplate.stickMiniStick1 => GetElement<IControllerTemplateThumbStick>(172);
+
+ IControllerTemplateThumbStick IHOTASTemplate.stickMiniStick2 => GetElement<IControllerTemplateThumbStick>(173);
+
+ IControllerTemplateHat IHOTASTemplate.stickHat1 => GetElement<IControllerTemplateHat>(174);
+
+ IControllerTemplateHat IHOTASTemplate.stickHat2 => GetElement<IControllerTemplateHat>(175);
+
+ IControllerTemplateHat IHOTASTemplate.stickHat3 => GetElement<IControllerTemplateHat>(176);
+
+ IControllerTemplateHat IHOTASTemplate.stickHat4 => GetElement<IControllerTemplateHat>(177);
+
+ IControllerTemplateThrottle IHOTASTemplate.throttle1 => GetElement<IControllerTemplateThrottle>(178);
+
+ IControllerTemplateThrottle IHOTASTemplate.throttle2 => GetElement<IControllerTemplateThrottle>(179);
+
+ IControllerTemplateThumbStick IHOTASTemplate.throttleMiniStick => GetElement<IControllerTemplateThumbStick>(180);
+
+ IControllerTemplateHat IHOTASTemplate.throttleHat1 => GetElement<IControllerTemplateHat>(181);
+
+ IControllerTemplateHat IHOTASTemplate.throttleHat2 => GetElement<IControllerTemplateHat>(182);
+
+ IControllerTemplateHat IHOTASTemplate.throttleHat3 => GetElement<IControllerTemplateHat>(183);
+
+ IControllerTemplateHat IHOTASTemplate.throttleHat4 => GetElement<IControllerTemplateHat>(184);
+
+ public HOTASTemplate(object payload)
+ : base(payload)
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired/IFlightPedalsTemplate.cs b/Thronefall_v1.57/Thronefall/Rewired/IFlightPedalsTemplate.cs
new file mode 100644
index 0000000..61f91de
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired/IFlightPedalsTemplate.cs
@@ -0,0 +1,10 @@
+namespace Rewired;
+
+public interface IFlightPedalsTemplate : IControllerTemplate
+{
+ IControllerTemplateAxis leftPedal { get; }
+
+ IControllerTemplateAxis rightPedal { get; }
+
+ IControllerTemplateAxis slide { get; }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired/IFlightYokeTemplate.cs b/Thronefall_v1.57/Thronefall/Rewired/IFlightYokeTemplate.cs
new file mode 100644
index 0000000..9fc5660
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired/IFlightYokeTemplate.cs
@@ -0,0 +1,102 @@
+namespace Rewired;
+
+public interface IFlightYokeTemplate : IControllerTemplate
+{
+ IControllerTemplateButton leftPaddle { get; }
+
+ IControllerTemplateButton rightPaddle { get; }
+
+ IControllerTemplateButton leftGripButton1 { get; }
+
+ IControllerTemplateButton leftGripButton2 { get; }
+
+ IControllerTemplateButton leftGripButton3 { get; }
+
+ IControllerTemplateButton leftGripButton4 { get; }
+
+ IControllerTemplateButton leftGripButton5 { get; }
+
+ IControllerTemplateButton leftGripButton6 { get; }
+
+ IControllerTemplateButton rightGripButton1 { get; }
+
+ IControllerTemplateButton rightGripButton2 { get; }
+
+ IControllerTemplateButton rightGripButton3 { get; }
+
+ IControllerTemplateButton rightGripButton4 { get; }
+
+ IControllerTemplateButton rightGripButton5 { get; }
+
+ IControllerTemplateButton rightGripButton6 { get; }
+
+ IControllerTemplateButton centerButton1 { get; }
+
+ IControllerTemplateButton centerButton2 { get; }
+
+ IControllerTemplateButton centerButton3 { get; }
+
+ IControllerTemplateButton centerButton4 { get; }
+
+ IControllerTemplateButton centerButton5 { get; }
+
+ IControllerTemplateButton centerButton6 { get; }
+
+ IControllerTemplateButton centerButton7 { get; }
+
+ IControllerTemplateButton centerButton8 { get; }
+
+ IControllerTemplateButton wheel1Up { get; }
+
+ IControllerTemplateButton wheel1Down { get; }
+
+ IControllerTemplateButton wheel1Press { get; }
+
+ IControllerTemplateButton wheel2Up { get; }
+
+ IControllerTemplateButton wheel2Down { get; }
+
+ IControllerTemplateButton wheel2Press { get; }
+
+ IControllerTemplateButton consoleButton1 { get; }
+
+ IControllerTemplateButton consoleButton2 { get; }
+
+ IControllerTemplateButton consoleButton3 { get; }
+
+ IControllerTemplateButton consoleButton4 { get; }
+
+ IControllerTemplateButton consoleButton5 { get; }
+
+ IControllerTemplateButton consoleButton6 { get; }
+
+ IControllerTemplateButton consoleButton7 { get; }
+
+ IControllerTemplateButton consoleButton8 { get; }
+
+ IControllerTemplateButton consoleButton9 { get; }
+
+ IControllerTemplateButton consoleButton10 { get; }
+
+ IControllerTemplateButton mode1 { get; }
+
+ IControllerTemplateButton mode2 { get; }
+
+ IControllerTemplateButton mode3 { get; }
+
+ IControllerTemplateYoke yoke { get; }
+
+ IControllerTemplateThrottle lever1 { get; }
+
+ IControllerTemplateThrottle lever2 { get; }
+
+ IControllerTemplateThrottle lever3 { get; }
+
+ IControllerTemplateThrottle lever4 { get; }
+
+ IControllerTemplateThrottle lever5 { get; }
+
+ IControllerTemplateHat leftGripHat { get; }
+
+ IControllerTemplateHat rightGripHat { get; }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired/IGamepadTemplate.cs b/Thronefall_v1.57/Thronefall/Rewired/IGamepadTemplate.cs
new file mode 100644
index 0000000..76b14b8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired/IGamepadTemplate.cs
@@ -0,0 +1,62 @@
+namespace Rewired;
+
+public interface IGamepadTemplate : IControllerTemplate
+{
+ IControllerTemplateButton actionBottomRow1 { get; }
+
+ IControllerTemplateButton a { get; }
+
+ IControllerTemplateButton actionBottomRow2 { get; }
+
+ IControllerTemplateButton b { get; }
+
+ IControllerTemplateButton actionBottomRow3 { get; }
+
+ IControllerTemplateButton c { get; }
+
+ IControllerTemplateButton actionTopRow1 { get; }
+
+ IControllerTemplateButton x { get; }
+
+ IControllerTemplateButton actionTopRow2 { get; }
+
+ IControllerTemplateButton y { get; }
+
+ IControllerTemplateButton actionTopRow3 { get; }
+
+ IControllerTemplateButton z { get; }
+
+ IControllerTemplateButton leftShoulder1 { get; }
+
+ IControllerTemplateButton leftBumper { get; }
+
+ IControllerTemplateAxis leftShoulder2 { get; }
+
+ IControllerTemplateAxis leftTrigger { get; }
+
+ IControllerTemplateButton rightShoulder1 { get; }
+
+ IControllerTemplateButton rightBumper { get; }
+
+ IControllerTemplateAxis rightShoulder2 { get; }
+
+ IControllerTemplateAxis rightTrigger { get; }
+
+ IControllerTemplateButton center1 { get; }
+
+ IControllerTemplateButton back { get; }
+
+ IControllerTemplateButton center2 { get; }
+
+ IControllerTemplateButton start { get; }
+
+ IControllerTemplateButton center3 { get; }
+
+ IControllerTemplateButton guide { get; }
+
+ IControllerTemplateThumbStick leftStick { get; }
+
+ IControllerTemplateThumbStick rightStick { get; }
+
+ IControllerTemplateDPad dPad { get; }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired/IHOTASTemplate.cs b/Thronefall_v1.57/Thronefall/Rewired/IHOTASTemplate.cs
new file mode 100644
index 0000000..8a801b5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired/IHOTASTemplate.cs
@@ -0,0 +1,180 @@
+namespace Rewired;
+
+public interface IHOTASTemplate : IControllerTemplate
+{
+ IControllerTemplateButton stickTrigger { get; }
+
+ IControllerTemplateButton stickTriggerStage2 { get; }
+
+ IControllerTemplateButton stickPinkyButton { get; }
+
+ IControllerTemplateButton stickPinkyTrigger { get; }
+
+ IControllerTemplateButton stickButton1 { get; }
+
+ IControllerTemplateButton stickButton2 { get; }
+
+ IControllerTemplateButton stickButton3 { get; }
+
+ IControllerTemplateButton stickButton4 { get; }
+
+ IControllerTemplateButton stickButton5 { get; }
+
+ IControllerTemplateButton stickButton6 { get; }
+
+ IControllerTemplateButton stickButton7 { get; }
+
+ IControllerTemplateButton stickButton8 { get; }
+
+ IControllerTemplateButton stickButton9 { get; }
+
+ IControllerTemplateButton stickButton10 { get; }
+
+ IControllerTemplateButton stickBaseButton1 { get; }
+
+ IControllerTemplateButton stickBaseButton2 { get; }
+
+ IControllerTemplateButton stickBaseButton3 { get; }
+
+ IControllerTemplateButton stickBaseButton4 { get; }
+
+ IControllerTemplateButton stickBaseButton5 { get; }
+
+ IControllerTemplateButton stickBaseButton6 { get; }
+
+ IControllerTemplateButton stickBaseButton7 { get; }
+
+ IControllerTemplateButton stickBaseButton8 { get; }
+
+ IControllerTemplateButton stickBaseButton9 { get; }
+
+ IControllerTemplateButton stickBaseButton10 { get; }
+
+ IControllerTemplateButton stickBaseButton11 { get; }
+
+ IControllerTemplateButton stickBaseButton12 { get; }
+
+ IControllerTemplateButton mode1 { get; }
+
+ IControllerTemplateButton mode2 { get; }
+
+ IControllerTemplateButton mode3 { get; }
+
+ IControllerTemplateButton throttleButton1 { get; }
+
+ IControllerTemplateButton throttleButton2 { get; }
+
+ IControllerTemplateButton throttleButton3 { get; }
+
+ IControllerTemplateButton throttleButton4 { get; }
+
+ IControllerTemplateButton throttleButton5 { get; }
+
+ IControllerTemplateButton throttleButton6 { get; }
+
+ IControllerTemplateButton throttleButton7 { get; }
+
+ IControllerTemplateButton throttleButton8 { get; }
+
+ IControllerTemplateButton throttleButton9 { get; }
+
+ IControllerTemplateButton throttleButton10 { get; }
+
+ IControllerTemplateButton throttleBaseButton1 { get; }
+
+ IControllerTemplateButton throttleBaseButton2 { get; }
+
+ IControllerTemplateButton throttleBaseButton3 { get; }
+
+ IControllerTemplateButton throttleBaseButton4 { get; }
+
+ IControllerTemplateButton throttleBaseButton5 { get; }
+
+ IControllerTemplateButton throttleBaseButton6 { get; }
+
+ IControllerTemplateButton throttleBaseButton7 { get; }
+
+ IControllerTemplateButton throttleBaseButton8 { get; }
+
+ IControllerTemplateButton throttleBaseButton9 { get; }
+
+ IControllerTemplateButton throttleBaseButton10 { get; }
+
+ IControllerTemplateButton throttleBaseButton11 { get; }
+
+ IControllerTemplateButton throttleBaseButton12 { get; }
+
+ IControllerTemplateButton throttleBaseButton13 { get; }
+
+ IControllerTemplateButton throttleBaseButton14 { get; }
+
+ IControllerTemplateButton throttleBaseButton15 { get; }
+
+ IControllerTemplateAxis throttleSlider1 { get; }
+
+ IControllerTemplateAxis throttleSlider2 { get; }
+
+ IControllerTemplateAxis throttleSlider3 { get; }
+
+ IControllerTemplateAxis throttleSlider4 { get; }
+
+ IControllerTemplateAxis throttleDial1 { get; }
+
+ IControllerTemplateAxis throttleDial2 { get; }
+
+ IControllerTemplateAxis throttleDial3 { get; }
+
+ IControllerTemplateAxis throttleDial4 { get; }
+
+ IControllerTemplateButton throttleWheel1Forward { get; }
+
+ IControllerTemplateButton throttleWheel1Back { get; }
+
+ IControllerTemplateButton throttleWheel1Press { get; }
+
+ IControllerTemplateButton throttleWheel2Forward { get; }
+
+ IControllerTemplateButton throttleWheel2Back { get; }
+
+ IControllerTemplateButton throttleWheel2Press { get; }
+
+ IControllerTemplateButton throttleWheel3Forward { get; }
+
+ IControllerTemplateButton throttleWheel3Back { get; }
+
+ IControllerTemplateButton throttleWheel3Press { get; }
+
+ IControllerTemplateAxis leftPedal { get; }
+
+ IControllerTemplateAxis rightPedal { get; }
+
+ IControllerTemplateAxis slidePedals { get; }
+
+ IControllerTemplateStick stick { get; }
+
+ IControllerTemplateThumbStick stickMiniStick1 { get; }
+
+ IControllerTemplateThumbStick stickMiniStick2 { get; }
+
+ IControllerTemplateHat stickHat1 { get; }
+
+ IControllerTemplateHat stickHat2 { get; }
+
+ IControllerTemplateHat stickHat3 { get; }
+
+ IControllerTemplateHat stickHat4 { get; }
+
+ IControllerTemplateThrottle throttle1 { get; }
+
+ IControllerTemplateThrottle throttle2 { get; }
+
+ IControllerTemplateThumbStick throttleMiniStick { get; }
+
+ IControllerTemplateHat throttleHat1 { get; }
+
+ IControllerTemplateHat throttleHat2 { get; }
+
+ IControllerTemplateHat throttleHat3 { get; }
+
+ IControllerTemplateHat throttleHat4 { get; }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired/IRacingWheelTemplate.cs b/Thronefall_v1.57/Thronefall/Rewired/IRacingWheelTemplate.cs
new file mode 100644
index 0000000..fe9a246
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired/IRacingWheelTemplate.cs
@@ -0,0 +1,88 @@
+namespace Rewired;
+
+public interface IRacingWheelTemplate : IControllerTemplate
+{
+ IControllerTemplateAxis wheel { get; }
+
+ IControllerTemplateAxis accelerator { get; }
+
+ IControllerTemplateAxis brake { get; }
+
+ IControllerTemplateAxis clutch { get; }
+
+ IControllerTemplateButton shiftDown { get; }
+
+ IControllerTemplateButton shiftUp { get; }
+
+ IControllerTemplateButton wheelButton1 { get; }
+
+ IControllerTemplateButton wheelButton2 { get; }
+
+ IControllerTemplateButton wheelButton3 { get; }
+
+ IControllerTemplateButton wheelButton4 { get; }
+
+ IControllerTemplateButton wheelButton5 { get; }
+
+ IControllerTemplateButton wheelButton6 { get; }
+
+ IControllerTemplateButton wheelButton7 { get; }
+
+ IControllerTemplateButton wheelButton8 { get; }
+
+ IControllerTemplateButton wheelButton9 { get; }
+
+ IControllerTemplateButton wheelButton10 { get; }
+
+ IControllerTemplateButton consoleButton1 { get; }
+
+ IControllerTemplateButton consoleButton2 { get; }
+
+ IControllerTemplateButton consoleButton3 { get; }
+
+ IControllerTemplateButton consoleButton4 { get; }
+
+ IControllerTemplateButton consoleButton5 { get; }
+
+ IControllerTemplateButton consoleButton6 { get; }
+
+ IControllerTemplateButton consoleButton7 { get; }
+
+ IControllerTemplateButton consoleButton8 { get; }
+
+ IControllerTemplateButton consoleButton9 { get; }
+
+ IControllerTemplateButton consoleButton10 { get; }
+
+ IControllerTemplateButton shifter1 { get; }
+
+ IControllerTemplateButton shifter2 { get; }
+
+ IControllerTemplateButton shifter3 { get; }
+
+ IControllerTemplateButton shifter4 { get; }
+
+ IControllerTemplateButton shifter5 { get; }
+
+ IControllerTemplateButton shifter6 { get; }
+
+ IControllerTemplateButton shifter7 { get; }
+
+ IControllerTemplateButton shifter8 { get; }
+
+ IControllerTemplateButton shifter9 { get; }
+
+ IControllerTemplateButton shifter10 { get; }
+
+ IControllerTemplateButton reverseGear { get; }
+
+ IControllerTemplateButton select { get; }
+
+ IControllerTemplateButton start { get; }
+
+ IControllerTemplateButton systemButton { get; }
+
+ IControllerTemplateButton horn { get; }
+
+ IControllerTemplateDPad dPad { get; }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired/ISixDofControllerTemplate.cs b/Thronefall_v1.57/Thronefall/Rewired/ISixDofControllerTemplate.cs
new file mode 100644
index 0000000..326e0c5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired/ISixDofControllerTemplate.cs
@@ -0,0 +1,86 @@
+namespace Rewired;
+
+public interface ISixDofControllerTemplate : IControllerTemplate
+{
+ IControllerTemplateAxis extraAxis1 { get; }
+
+ IControllerTemplateAxis extraAxis2 { get; }
+
+ IControllerTemplateAxis extraAxis3 { get; }
+
+ IControllerTemplateAxis extraAxis4 { get; }
+
+ IControllerTemplateButton button1 { get; }
+
+ IControllerTemplateButton button2 { get; }
+
+ IControllerTemplateButton button3 { get; }
+
+ IControllerTemplateButton button4 { get; }
+
+ IControllerTemplateButton button5 { get; }
+
+ IControllerTemplateButton button6 { get; }
+
+ IControllerTemplateButton button7 { get; }
+
+ IControllerTemplateButton button8 { get; }
+
+ IControllerTemplateButton button9 { get; }
+
+ IControllerTemplateButton button10 { get; }
+
+ IControllerTemplateButton button11 { get; }
+
+ IControllerTemplateButton button12 { get; }
+
+ IControllerTemplateButton button13 { get; }
+
+ IControllerTemplateButton button14 { get; }
+
+ IControllerTemplateButton button15 { get; }
+
+ IControllerTemplateButton button16 { get; }
+
+ IControllerTemplateButton button17 { get; }
+
+ IControllerTemplateButton button18 { get; }
+
+ IControllerTemplateButton button19 { get; }
+
+ IControllerTemplateButton button20 { get; }
+
+ IControllerTemplateButton button21 { get; }
+
+ IControllerTemplateButton button22 { get; }
+
+ IControllerTemplateButton button23 { get; }
+
+ IControllerTemplateButton button24 { get; }
+
+ IControllerTemplateButton button25 { get; }
+
+ IControllerTemplateButton button26 { get; }
+
+ IControllerTemplateButton button27 { get; }
+
+ IControllerTemplateButton button28 { get; }
+
+ IControllerTemplateButton button29 { get; }
+
+ IControllerTemplateButton button30 { get; }
+
+ IControllerTemplateButton button31 { get; }
+
+ IControllerTemplateButton button32 { get; }
+
+ IControllerTemplateHat hat1 { get; }
+
+ IControllerTemplateHat hat2 { get; }
+
+ IControllerTemplateThrottle throttle1 { get; }
+
+ IControllerTemplateThrottle throttle2 { get; }
+
+ IControllerTemplateStick6D stick { get; }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired/InputManager.cs b/Thronefall_v1.57/Thronefall/Rewired/InputManager.cs
new file mode 100644
index 0000000..1bae3e4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired/InputManager.cs
@@ -0,0 +1,81 @@
+using System.ComponentModel;
+using System.Text.RegularExpressions;
+using Rewired.Platforms;
+using Rewired.Utils;
+using Rewired.Utils.Interfaces;
+using UnityEngine;
+using UnityEngine.SceneManagement;
+
+namespace Rewired;
+
+[AddComponentMenu("Rewired/Input Manager")]
+[EditorBrowsable(EditorBrowsableState.Never)]
+public sealed class InputManager : InputManager_Base
+{
+ private bool ignoreRecompile;
+
+ protected override void OnInitialized()
+ {
+ SubscribeEvents();
+ }
+
+ protected override void OnDeinitialized()
+ {
+ UnsubscribeEvents();
+ }
+
+ protected override void DetectPlatform()
+ {
+ scriptingBackend = ScriptingBackend.Mono;
+ scriptingAPILevel = ScriptingAPILevel.Net20;
+ editorPlatform = EditorPlatform.None;
+ platform = Platform.Unknown;
+ webplayerPlatform = WebplayerPlatform.None;
+ isEditor = false;
+ if (SystemInfo.deviceName == null)
+ {
+ _ = string.Empty;
+ }
+ if (SystemInfo.deviceModel == null)
+ {
+ _ = string.Empty;
+ }
+ platform = Platform.Windows;
+ scriptingBackend = ScriptingBackend.Mono;
+ scriptingAPILevel = ScriptingAPILevel.NetStandard20;
+ }
+
+ protected override void CheckRecompile()
+ {
+ }
+
+ protected override IExternalTools GetExternalTools()
+ {
+ return new ExternalTools();
+ }
+
+ private bool CheckDeviceName(string searchPattern, string deviceName, string deviceModel)
+ {
+ if (!Regex.IsMatch(deviceName, searchPattern, RegexOptions.IgnoreCase))
+ {
+ return Regex.IsMatch(deviceModel, searchPattern, RegexOptions.IgnoreCase);
+ }
+ return true;
+ }
+
+ private void SubscribeEvents()
+ {
+ UnsubscribeEvents();
+ SceneManager.sceneLoaded += OnSceneLoaded;
+ }
+
+ private void UnsubscribeEvents()
+ {
+ SceneManager.sceneLoaded -= OnSceneLoaded;
+ }
+
+ private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
+ {
+ OnSceneLoaded();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired/RacingWheelTemplate.cs b/Thronefall_v1.57/Thronefall/Rewired/RacingWheelTemplate.cs
new file mode 100644
index 0000000..85fb3c3
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired/RacingWheelTemplate.cs
@@ -0,0 +1,189 @@
+using System;
+
+namespace Rewired;
+
+public sealed class RacingWheelTemplate : ControllerTemplate, IRacingWheelTemplate, IControllerTemplate
+{
+ public static readonly Guid typeGuid = new Guid("104e31d8-9115-4dd5-a398-2e54d35e6c83");
+
+ public const int elementId_wheel = 0;
+
+ public const int elementId_accelerator = 1;
+
+ public const int elementId_brake = 2;
+
+ public const int elementId_clutch = 3;
+
+ public const int elementId_shiftDown = 4;
+
+ public const int elementId_shiftUp = 5;
+
+ public const int elementId_wheelButton1 = 6;
+
+ public const int elementId_wheelButton2 = 7;
+
+ public const int elementId_wheelButton3 = 8;
+
+ public const int elementId_wheelButton4 = 9;
+
+ public const int elementId_wheelButton5 = 10;
+
+ public const int elementId_wheelButton6 = 11;
+
+ public const int elementId_wheelButton7 = 12;
+
+ public const int elementId_wheelButton8 = 13;
+
+ public const int elementId_wheelButton9 = 14;
+
+ public const int elementId_wheelButton10 = 15;
+
+ public const int elementId_consoleButton1 = 16;
+
+ public const int elementId_consoleButton2 = 17;
+
+ public const int elementId_consoleButton3 = 18;
+
+ public const int elementId_consoleButton4 = 19;
+
+ public const int elementId_consoleButton5 = 20;
+
+ public const int elementId_consoleButton6 = 21;
+
+ public const int elementId_consoleButton7 = 22;
+
+ public const int elementId_consoleButton8 = 23;
+
+ public const int elementId_consoleButton9 = 24;
+
+ public const int elementId_consoleButton10 = 25;
+
+ public const int elementId_shifter1 = 26;
+
+ public const int elementId_shifter2 = 27;
+
+ public const int elementId_shifter3 = 28;
+
+ public const int elementId_shifter4 = 29;
+
+ public const int elementId_shifter5 = 30;
+
+ public const int elementId_shifter6 = 31;
+
+ public const int elementId_shifter7 = 32;
+
+ public const int elementId_shifter8 = 33;
+
+ public const int elementId_shifter9 = 34;
+
+ public const int elementId_shifter10 = 35;
+
+ public const int elementId_reverseGear = 44;
+
+ public const int elementId_select = 36;
+
+ public const int elementId_start = 37;
+
+ public const int elementId_systemButton = 38;
+
+ public const int elementId_horn = 43;
+
+ public const int elementId_dPadUp = 39;
+
+ public const int elementId_dPadRight = 40;
+
+ public const int elementId_dPadDown = 41;
+
+ public const int elementId_dPadLeft = 42;
+
+ public const int elementId_dPad = 45;
+
+ IControllerTemplateAxis IRacingWheelTemplate.wheel => GetElement<IControllerTemplateAxis>(0);
+
+ IControllerTemplateAxis IRacingWheelTemplate.accelerator => GetElement<IControllerTemplateAxis>(1);
+
+ IControllerTemplateAxis IRacingWheelTemplate.brake => GetElement<IControllerTemplateAxis>(2);
+
+ IControllerTemplateAxis IRacingWheelTemplate.clutch => GetElement<IControllerTemplateAxis>(3);
+
+ IControllerTemplateButton IRacingWheelTemplate.shiftDown => GetElement<IControllerTemplateButton>(4);
+
+ IControllerTemplateButton IRacingWheelTemplate.shiftUp => GetElement<IControllerTemplateButton>(5);
+
+ IControllerTemplateButton IRacingWheelTemplate.wheelButton1 => GetElement<IControllerTemplateButton>(6);
+
+ IControllerTemplateButton IRacingWheelTemplate.wheelButton2 => GetElement<IControllerTemplateButton>(7);
+
+ IControllerTemplateButton IRacingWheelTemplate.wheelButton3 => GetElement<IControllerTemplateButton>(8);
+
+ IControllerTemplateButton IRacingWheelTemplate.wheelButton4 => GetElement<IControllerTemplateButton>(9);
+
+ IControllerTemplateButton IRacingWheelTemplate.wheelButton5 => GetElement<IControllerTemplateButton>(10);
+
+ IControllerTemplateButton IRacingWheelTemplate.wheelButton6 => GetElement<IControllerTemplateButton>(11);
+
+ IControllerTemplateButton IRacingWheelTemplate.wheelButton7 => GetElement<IControllerTemplateButton>(12);
+
+ IControllerTemplateButton IRacingWheelTemplate.wheelButton8 => GetElement<IControllerTemplateButton>(13);
+
+ IControllerTemplateButton IRacingWheelTemplate.wheelButton9 => GetElement<IControllerTemplateButton>(14);
+
+ IControllerTemplateButton IRacingWheelTemplate.wheelButton10 => GetElement<IControllerTemplateButton>(15);
+
+ IControllerTemplateButton IRacingWheelTemplate.consoleButton1 => GetElement<IControllerTemplateButton>(16);
+
+ IControllerTemplateButton IRacingWheelTemplate.consoleButton2 => GetElement<IControllerTemplateButton>(17);
+
+ IControllerTemplateButton IRacingWheelTemplate.consoleButton3 => GetElement<IControllerTemplateButton>(18);
+
+ IControllerTemplateButton IRacingWheelTemplate.consoleButton4 => GetElement<IControllerTemplateButton>(19);
+
+ IControllerTemplateButton IRacingWheelTemplate.consoleButton5 => GetElement<IControllerTemplateButton>(20);
+
+ IControllerTemplateButton IRacingWheelTemplate.consoleButton6 => GetElement<IControllerTemplateButton>(21);
+
+ IControllerTemplateButton IRacingWheelTemplate.consoleButton7 => GetElement<IControllerTemplateButton>(22);
+
+ IControllerTemplateButton IRacingWheelTemplate.consoleButton8 => GetElement<IControllerTemplateButton>(23);
+
+ IControllerTemplateButton IRacingWheelTemplate.consoleButton9 => GetElement<IControllerTemplateButton>(24);
+
+ IControllerTemplateButton IRacingWheelTemplate.consoleButton10 => GetElement<IControllerTemplateButton>(25);
+
+ IControllerTemplateButton IRacingWheelTemplate.shifter1 => GetElement<IControllerTemplateButton>(26);
+
+ IControllerTemplateButton IRacingWheelTemplate.shifter2 => GetElement<IControllerTemplateButton>(27);
+
+ IControllerTemplateButton IRacingWheelTemplate.shifter3 => GetElement<IControllerTemplateButton>(28);
+
+ IControllerTemplateButton IRacingWheelTemplate.shifter4 => GetElement<IControllerTemplateButton>(29);
+
+ IControllerTemplateButton IRacingWheelTemplate.shifter5 => GetElement<IControllerTemplateButton>(30);
+
+ IControllerTemplateButton IRacingWheelTemplate.shifter6 => GetElement<IControllerTemplateButton>(31);
+
+ IControllerTemplateButton IRacingWheelTemplate.shifter7 => GetElement<IControllerTemplateButton>(32);
+
+ IControllerTemplateButton IRacingWheelTemplate.shifter8 => GetElement<IControllerTemplateButton>(33);
+
+ IControllerTemplateButton IRacingWheelTemplate.shifter9 => GetElement<IControllerTemplateButton>(34);
+
+ IControllerTemplateButton IRacingWheelTemplate.shifter10 => GetElement<IControllerTemplateButton>(35);
+
+ IControllerTemplateButton IRacingWheelTemplate.reverseGear => GetElement<IControllerTemplateButton>(44);
+
+ IControllerTemplateButton IRacingWheelTemplate.select => GetElement<IControllerTemplateButton>(36);
+
+ IControllerTemplateButton IRacingWheelTemplate.start => GetElement<IControllerTemplateButton>(37);
+
+ IControllerTemplateButton IRacingWheelTemplate.systemButton => GetElement<IControllerTemplateButton>(38);
+
+ IControllerTemplateButton IRacingWheelTemplate.horn => GetElement<IControllerTemplateButton>(43);
+
+ IControllerTemplateDPad IRacingWheelTemplate.dPad => GetElement<IControllerTemplateDPad>(45);
+
+ public RacingWheelTemplate(object payload)
+ : base(payload)
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Rewired/SixDofControllerTemplate.cs b/Thronefall_v1.57/Thronefall/Rewired/SixDofControllerTemplate.cs
new file mode 100644
index 0000000..083b9bc
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Rewired/SixDofControllerTemplate.cs
@@ -0,0 +1,229 @@
+using System;
+
+namespace Rewired;
+
+public sealed class SixDofControllerTemplate : ControllerTemplate, ISixDofControllerTemplate, IControllerTemplate
+{
+ public static readonly Guid typeGuid = new Guid("2599beb3-522b-43dd-a4ef-93fd60e5eafa");
+
+ public const int elementId_positionX = 1;
+
+ public const int elementId_positionY = 2;
+
+ public const int elementId_positionZ = 0;
+
+ public const int elementId_rotationX = 3;
+
+ public const int elementId_rotationY = 5;
+
+ public const int elementId_rotationZ = 4;
+
+ public const int elementId_throttle1Axis = 6;
+
+ public const int elementId_throttle1MinDetent = 50;
+
+ public const int elementId_throttle2Axis = 7;
+
+ public const int elementId_throttle2MinDetent = 51;
+
+ public const int elementId_extraAxis1 = 8;
+
+ public const int elementId_extraAxis2 = 9;
+
+ public const int elementId_extraAxis3 = 10;
+
+ public const int elementId_extraAxis4 = 11;
+
+ public const int elementId_button1 = 12;
+
+ public const int elementId_button2 = 13;
+
+ public const int elementId_button3 = 14;
+
+ public const int elementId_button4 = 15;
+
+ public const int elementId_button5 = 16;
+
+ public const int elementId_button6 = 17;
+
+ public const int elementId_button7 = 18;
+
+ public const int elementId_button8 = 19;
+
+ public const int elementId_button9 = 20;
+
+ public const int elementId_button10 = 21;
+
+ public const int elementId_button11 = 22;
+
+ public const int elementId_button12 = 23;
+
+ public const int elementId_button13 = 24;
+
+ public const int elementId_button14 = 25;
+
+ public const int elementId_button15 = 26;
+
+ public const int elementId_button16 = 27;
+
+ public const int elementId_button17 = 28;
+
+ public const int elementId_button18 = 29;
+
+ public const int elementId_button19 = 30;
+
+ public const int elementId_button20 = 31;
+
+ public const int elementId_button21 = 55;
+
+ public const int elementId_button22 = 56;
+
+ public const int elementId_button23 = 57;
+
+ public const int elementId_button24 = 58;
+
+ public const int elementId_button25 = 59;
+
+ public const int elementId_button26 = 60;
+
+ public const int elementId_button27 = 61;
+
+ public const int elementId_button28 = 62;
+
+ public const int elementId_button29 = 63;
+
+ public const int elementId_button30 = 64;
+
+ public const int elementId_button31 = 65;
+
+ public const int elementId_button32 = 66;
+
+ public const int elementId_hat1Up = 32;
+
+ public const int elementId_hat1UpRight = 33;
+
+ public const int elementId_hat1Right = 34;
+
+ public const int elementId_hat1DownRight = 35;
+
+ public const int elementId_hat1Down = 36;
+
+ public const int elementId_hat1DownLeft = 37;
+
+ public const int elementId_hat1Left = 38;
+
+ public const int elementId_hat1UpLeft = 39;
+
+ public const int elementId_hat2Up = 40;
+
+ public const int elementId_hat2UpRight = 41;
+
+ public const int elementId_hat2Right = 42;
+
+ public const int elementId_hat2DownRight = 43;
+
+ public const int elementId_hat2Down = 44;
+
+ public const int elementId_hat2DownLeft = 45;
+
+ public const int elementId_hat2Left = 46;
+
+ public const int elementId_hat2UpLeft = 47;
+
+ public const int elementId_hat1 = 48;
+
+ public const int elementId_hat2 = 49;
+
+ public const int elementId_throttle1 = 52;
+
+ public const int elementId_throttle2 = 53;
+
+ public const int elementId_stick = 54;
+
+ IControllerTemplateAxis ISixDofControllerTemplate.extraAxis1 => GetElement<IControllerTemplateAxis>(8);
+
+ IControllerTemplateAxis ISixDofControllerTemplate.extraAxis2 => GetElement<IControllerTemplateAxis>(9);
+
+ IControllerTemplateAxis ISixDofControllerTemplate.extraAxis3 => GetElement<IControllerTemplateAxis>(10);
+
+ IControllerTemplateAxis ISixDofControllerTemplate.extraAxis4 => GetElement<IControllerTemplateAxis>(11);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button1 => GetElement<IControllerTemplateButton>(12);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button2 => GetElement<IControllerTemplateButton>(13);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button3 => GetElement<IControllerTemplateButton>(14);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button4 => GetElement<IControllerTemplateButton>(15);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button5 => GetElement<IControllerTemplateButton>(16);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button6 => GetElement<IControllerTemplateButton>(17);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button7 => GetElement<IControllerTemplateButton>(18);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button8 => GetElement<IControllerTemplateButton>(19);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button9 => GetElement<IControllerTemplateButton>(20);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button10 => GetElement<IControllerTemplateButton>(21);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button11 => GetElement<IControllerTemplateButton>(22);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button12 => GetElement<IControllerTemplateButton>(23);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button13 => GetElement<IControllerTemplateButton>(24);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button14 => GetElement<IControllerTemplateButton>(25);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button15 => GetElement<IControllerTemplateButton>(26);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button16 => GetElement<IControllerTemplateButton>(27);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button17 => GetElement<IControllerTemplateButton>(28);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button18 => GetElement<IControllerTemplateButton>(29);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button19 => GetElement<IControllerTemplateButton>(30);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button20 => GetElement<IControllerTemplateButton>(31);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button21 => GetElement<IControllerTemplateButton>(55);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button22 => GetElement<IControllerTemplateButton>(56);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button23 => GetElement<IControllerTemplateButton>(57);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button24 => GetElement<IControllerTemplateButton>(58);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button25 => GetElement<IControllerTemplateButton>(59);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button26 => GetElement<IControllerTemplateButton>(60);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button27 => GetElement<IControllerTemplateButton>(61);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button28 => GetElement<IControllerTemplateButton>(62);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button29 => GetElement<IControllerTemplateButton>(63);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button30 => GetElement<IControllerTemplateButton>(64);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button31 => GetElement<IControllerTemplateButton>(65);
+
+ IControllerTemplateButton ISixDofControllerTemplate.button32 => GetElement<IControllerTemplateButton>(66);
+
+ IControllerTemplateHat ISixDofControllerTemplate.hat1 => GetElement<IControllerTemplateHat>(48);
+
+ IControllerTemplateHat ISixDofControllerTemplate.hat2 => GetElement<IControllerTemplateHat>(49);
+
+ IControllerTemplateThrottle ISixDofControllerTemplate.throttle1 => GetElement<IControllerTemplateThrottle>(52);
+
+ IControllerTemplateThrottle ISixDofControllerTemplate.throttle2 => GetElement<IControllerTemplateThrottle>(53);
+
+ IControllerTemplateStick6D ISixDofControllerTemplate.stick => GetElement<IControllerTemplateStick6D>(54);
+
+ public SixDofControllerTemplate(object payload)
+ : base(payload)
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AchievementManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/AchievementManager.cs
new file mode 100644
index 0000000..3fa3a7e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AchievementManager.cs
@@ -0,0 +1,158 @@
+using System;
+using Steamworks;
+using UnityEngine;
+
+public class AchievementManager : MonoBehaviour
+{
+ public enum Achievements
+ {
+ ET_STAGE_1 = 11,
+ ET_STAGE_2 = 12,
+ ET_STAGE_3 = 13,
+ ET_STAGE_4 = 14,
+ ET_STAGE_5 = 15,
+ ET_STAGE_6 = 16,
+ ET_STAGE_7 = 17,
+ START_TUTORIAL = 0,
+ COMPLETE_TUTORIAL = 1,
+ NORDFELS_BEATEN = 2,
+ NORDFELS_QUESTSCOMPLETE = 3,
+ DURSTSTEIN_BEATEN = 4,
+ DURSTSTEIN_QUESTSCOMPLETE = 5,
+ FROSTSEE_BEATEN = 6,
+ FROSTSEE_QUESTSCOMPLETE = 7,
+ MAXLEVEL_REACHED = 8,
+ UFERWIND_BEATEN = 9,
+ UFERWIND_QUESTSCOMPLETE = 10,
+ STURMKLAMM_BEATEN = 18,
+ STURMKLAMM_QUESTSCOMPLETE = 19,
+ CROWNS_5 = 20,
+ CROWNS_10 = 21,
+ CROWNS_20 = 22,
+ CROWNS_30 = 23
+ }
+
+ public static void GiveCrownsAchievement(int _crownsAchieved)
+ {
+ if (_crownsAchieved >= 5)
+ {
+ UnlockAchievement(Achievements.CROWNS_5);
+ }
+ if (_crownsAchieved >= 10)
+ {
+ UnlockAchievement(Achievements.CROWNS_10);
+ }
+ if (_crownsAchieved >= 20)
+ {
+ UnlockAchievement(Achievements.CROWNS_20);
+ }
+ if (_crownsAchieved >= 30)
+ {
+ UnlockAchievement(Achievements.CROWNS_30);
+ }
+ }
+
+ public static void UnlockEternalTrialsAchievementForBeating(int _stage)
+ {
+ switch (_stage)
+ {
+ case 1:
+ UnlockAchievement(Achievements.ET_STAGE_1);
+ break;
+ case 2:
+ UnlockAchievement(Achievements.ET_STAGE_2);
+ break;
+ case 3:
+ UnlockAchievement(Achievements.ET_STAGE_3);
+ break;
+ case 4:
+ UnlockAchievement(Achievements.ET_STAGE_4);
+ break;
+ case 5:
+ UnlockAchievement(Achievements.ET_STAGE_5);
+ break;
+ case 6:
+ UnlockAchievement(Achievements.ET_STAGE_6);
+ break;
+ case 7:
+ UnlockAchievement(Achievements.ET_STAGE_7);
+ break;
+ }
+ }
+
+ public static void UnlockAchievement(Achievements _achievement)
+ {
+ if (SteamManager.Initialized)
+ {
+ SteamUserStats.SetAchievement(_achievement.ToString());
+ SteamUserStats.StoreStats();
+ }
+ }
+
+ public static void ResetAllAchievements()
+ {
+ if (!Application.isPlaying)
+ {
+ Debug.LogWarning("Warning: Resetting achievements only works while in play mode.");
+ return;
+ }
+ string[] names = Enum.GetNames(typeof(Achievements));
+ for (int i = 0; i < names.Length; i++)
+ {
+ SteamUserStats.ClearAchievement(names[i]);
+ }
+ }
+
+ public static void LevelBeaten(string _scene)
+ {
+ if (_scene == "Neuland(Tutorial)")
+ {
+ UnlockAchievement(Achievements.START_TUTORIAL);
+ UnlockAchievement(Achievements.COMPLETE_TUTORIAL);
+ }
+ if (_scene == "Nordfels")
+ {
+ UnlockAchievement(Achievements.NORDFELS_BEATEN);
+ }
+ if (_scene == "Durststein")
+ {
+ UnlockAchievement(Achievements.DURSTSTEIN_BEATEN);
+ }
+ if (_scene == "Frostsee")
+ {
+ UnlockAchievement(Achievements.FROSTSEE_BEATEN);
+ }
+ if (_scene == "Uferwind")
+ {
+ UnlockAchievement(Achievements.UFERWIND_BEATEN);
+ }
+ if (_scene == "Sturmklamm")
+ {
+ UnlockAchievement(Achievements.STURMKLAMM_BEATEN);
+ }
+ }
+
+ public static void LevelAllQuestsComplete(string _scene)
+ {
+ if (_scene == "Nordfels")
+ {
+ UnlockAchievement(Achievements.NORDFELS_QUESTSCOMPLETE);
+ }
+ if (_scene == "Durststein")
+ {
+ UnlockAchievement(Achievements.DURSTSTEIN_QUESTSCOMPLETE);
+ }
+ if (_scene == "Frostsee")
+ {
+ UnlockAchievement(Achievements.FROSTSEE_QUESTSCOMPLETE);
+ }
+ if (_scene == "Uferwind")
+ {
+ UnlockAchievement(Achievements.UFERWIND_QUESTSCOMPLETE);
+ }
+ if (_scene == "Sturmklamm")
+ {
+ UnlockAchievement(Achievements.STURMKLAMM_QUESTSCOMPLETE);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AdditionalWeaponEffectScript.cs b/Thronefall_v1.57/Thronefall/Thronefall/AdditionalWeaponEffectScript.cs
new file mode 100644
index 0000000..b3b7c80
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AdditionalWeaponEffectScript.cs
@@ -0,0 +1,9 @@
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "Weapon", menuName = "SimpleSiege/Weapon Effect")]
+public class AdditionalWeaponEffectScript : ScriptableObject
+{
+ public virtual void Effect(Hp _hpHit, TaggedObject _attacked, TaggedObject _attacker, Weapon _weapon, float _damageMultiplyer)
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AfterMatchUIManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/AfterMatchUIManager.cs
new file mode 100644
index 0000000..1310934
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AfterMatchUIManager.cs
@@ -0,0 +1,251 @@
+using System.Collections;
+using Rewired;
+using TMPro;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class AfterMatchUIManager : MonoBehaviour
+{
+ [Header("Score Screen")]
+ [SerializeField]
+ private GameObject scoreScreenUI;
+
+ [SerializeField]
+ private TMP_Text ingameHighscore;
+
+ [SerializeField]
+ private TMP_Text goldBonus;
+
+ [SerializeField]
+ private TMP_Text mutationBonus;
+
+ [SerializeField]
+ private TMP_Text totalScore;
+
+ [SerializeField]
+ private GameObject newPersonalBest;
+
+ [Header("Graphs")]
+ [SerializeField]
+ private GameObject graphs;
+
+ [SerializeField]
+ private GraphDrawer graphDrawerA;
+
+ [SerializeField]
+ private GraphDrawer graphDrawerB;
+
+ [Header("Leveling")]
+ [SerializeField]
+ private GameObject levelingProgressUI;
+
+ [SerializeField]
+ private TMP_Text currentLevelTxt1;
+
+ [SerializeField]
+ private RectTransform levelingBarBack;
+
+ [SerializeField]
+ private RectTransform levelingBarFront;
+
+ [SerializeField]
+ private TMP_Text xpDisplay;
+
+ [SerializeField]
+ private Image rewardPreview1;
+
+ [Header("Rewards")]
+ [SerializeField]
+ private GameObject rewardDisplayUI;
+
+ [SerializeField]
+ private TMP_Text currentLevelTxt2;
+
+ [SerializeField]
+ private Image rewardPreview2;
+
+ [SerializeField]
+ private TMP_Text itemName;
+
+ [SerializeField]
+ private TMP_Text itemDescription;
+
+ [Header("Max Level")]
+ [SerializeField]
+ private GameObject maxLevelReachedUI;
+
+ [SerializeField]
+ private GameObject demoLockedUI;
+
+ [Header("Settings")]
+ [SerializeField]
+ private float timeToFillUpABar = 5f;
+
+ [SerializeField]
+ private float waitAtBeginning = 0.25f;
+
+ [SerializeField]
+ private float waitAfterFillingUpABar = 0.25f;
+
+ [SerializeField]
+ private float waitBeforeYouCanInteract = 0.25f;
+
+ private PerkManager perkManager;
+
+ private MetaLevel nextMetaLevel;
+
+ private Player input;
+
+ private void Start()
+ {
+ perkManager = PerkManager.instance;
+ StartCoroutine(ShowRewards());
+ input = ReInput.players.GetPlayer(0);
+ }
+
+ private IEnumerator ShowRewards()
+ {
+ EnableScoreUI();
+ ingameHighscore.text = SceneTransitionManager.instance.IngameScoreFromLastMatch.ToString();
+ goldBonus.text = "+" + SceneTransitionManager.instance.GoldBonusScoreFromLastMatch;
+ mutationBonus.text = "+" + SceneTransitionManager.instance.MutatorBonusScoreFromLastMatch;
+ totalScore.text = SceneTransitionManager.instance.TotalScoreFromLastMatch.ToString();
+ newPersonalBest.SetActive(SceneTransitionManager.instance.TotalScoreFromLastMatchIsNewPersonalRecord);
+ yield return new WaitForSeconds(waitAtBeginning);
+ while (!input.GetButtonDown("Interact"))
+ {
+ yield return null;
+ }
+ int xpToGive = SceneTransitionManager.instance.TotalScoreFromLastMatch;
+ yield return SelectNextMetaLevel();
+ EnableLevelingProgressUI();
+ currentLevelTxt1.text = "Level " + perkManager.level;
+ rewardPreview1.sprite = nextMetaLevel.reward.icon;
+ UpdateLevelingBar();
+ yield return new WaitForSeconds(waitAtBeginning);
+ float xPTrickleSpeed = (float)nextMetaLevel.requiredXp / timeToFillUpABar;
+ float xpTrickle = 0f;
+ while (xpToGive > 0)
+ {
+ xpTrickle += xPTrickleSpeed * Time.deltaTime;
+ int num = (int)xpTrickle;
+ xpTrickle -= (float)num;
+ xpToGive -= num;
+ if (xpToGive < 0)
+ {
+ num -= xpToGive;
+ }
+ perkManager.xp += num;
+ UpdateLevelingBar();
+ if (perkManager.xp >= nextMetaLevel.requiredXp)
+ {
+ yield return new WaitForSeconds(waitAfterFillingUpABar);
+ EnableRewardDisplayUI();
+ currentLevelTxt2.text = "Level " + (1 + perkManager.level);
+ rewardPreview2.sprite = nextMetaLevel.reward.icon;
+ itemName.text = nextMetaLevel.reward.displayName;
+ itemDescription.text = nextMetaLevel.reward.description;
+ yield return new WaitForSeconds(waitBeforeYouCanInteract);
+ while (!input.GetButtonDown("Interact"))
+ {
+ yield return null;
+ }
+ perkManager.xp -= nextMetaLevel.requiredXp;
+ perkManager.UnlockedEquippables.Add(nextMetaLevel.reward);
+ perkManager.level++;
+ yield return SelectNextMetaLevel();
+ xPTrickleSpeed = (float)nextMetaLevel.requiredXp / timeToFillUpABar;
+ currentLevelTxt1.text = "Level " + perkManager.level;
+ rewardPreview1.sprite = nextMetaLevel.reward.icon;
+ EnableLevelingProgressUI();
+ }
+ yield return null;
+ }
+ yield return null;
+ while (!input.GetButtonDown("Interact"))
+ {
+ yield return null;
+ }
+ LevelProgressManager.instance.GetLevelDataForScene(SceneTransitionManager.instance.ComingFromGameplayScene).SaveScoreAndStatsToBestIfBest(_endOfMatch: true);
+ SteamManager.Instance.UploadHighscore(SceneTransitionManager.instance.TotalScoreFromLastMatch, SceneTransitionManager.instance.ComingFromGameplayScene);
+ SaveLoadManager.instance.SaveGame();
+ SceneTransitionManager.instance.TransitionFromEndScreenToLevelSelect();
+ }
+
+ private IEnumerator SelectNextMetaLevel()
+ {
+ nextMetaLevel = perkManager.NextMetaLevel;
+ if (nextMetaLevel == null)
+ {
+ EnableMaxLevelReachedUI();
+ yield return new WaitForSeconds(waitBeforeYouCanInteract);
+ while (!input.GetButtonDown("Interact"))
+ {
+ yield return null;
+ }
+ SceneTransitionManager.instance.TransitionFromEndScreenToLevelSelect();
+ StopAllCoroutines();
+ yield return null;
+ }
+ }
+
+ private void DisableAllUI()
+ {
+ levelingProgressUI.SetActive(value: false);
+ rewardDisplayUI.SetActive(value: false);
+ maxLevelReachedUI.SetActive(value: false);
+ graphs.SetActive(value: false);
+ scoreScreenUI.SetActive(value: false);
+ demoLockedUI.SetActive(value: false);
+ }
+
+ private void EnableLevelingProgressUI()
+ {
+ DisableAllUI();
+ levelingProgressUI.SetActive(value: true);
+ }
+
+ private void EnableRewardDisplayUI()
+ {
+ DisableAllUI();
+ rewardDisplayUI.SetActive(value: true);
+ }
+
+ private void EnableMaxLevelReachedUI()
+ {
+ DisableAllUI();
+ maxLevelReachedUI.SetActive(value: true);
+ }
+
+ private void EnableDemoLockedUI()
+ {
+ DisableAllUI();
+ demoLockedUI.SetActive(value: true);
+ }
+
+ private void EnableGraphsUI()
+ {
+ DisableAllUI();
+ graphs.SetActive(value: false);
+ }
+
+ private void EnableScoreUI()
+ {
+ DisableAllUI();
+ scoreScreenUI.SetActive(value: true);
+ }
+
+ private void UpdateLevelingBar()
+ {
+ xpDisplay.text = perkManager.xp + " / " + nextMetaLevel.requiredXp;
+ SetLevelingParPercentage((float)perkManager.xp / (float)nextMetaLevel.requiredXp);
+ }
+
+ private void SetLevelingParPercentage(float _percentage)
+ {
+ float width = levelingBarBack.rect.width;
+ float num = width * _percentage;
+ levelingBarFront.localScale = new Vector3(_percentage, 1f, 1f);
+ levelingBarFront.localPosition = new Vector3(num / 2f - width / 2f, 0f, 0f);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AimbotProjectile.cs b/Thronefall_v1.57/Thronefall/Thronefall/AimbotProjectile.cs
new file mode 100644
index 0000000..e3e675d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AimbotProjectile.cs
@@ -0,0 +1,192 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Events;
+
+public class AimbotProjectile : MonoBehaviour
+{
+ [Serializable]
+ public class GameObjectToDestroyAfterTime
+ {
+ public GameObject target;
+
+ public float lifetime;
+ }
+
+ private Weapon weapon;
+
+ public bool shakeCameraOnDestroy;
+
+ public List<GameObjectToDestroyAfterTime> objectsToUnparentOnDestroy = new List<GameObjectToDestroyAfterTime>();
+
+ public GameObject spawnOnHit;
+
+ private Transform targetTransform;
+
+ private Hp targetHp;
+
+ private TaggedObject targetTaggedObject;
+
+ private Vector3 rememberTarget;
+
+ private Vector3 myLinearPosition;
+
+ private Vector3 spawnPosition;
+
+ private Vector3 previousPosition;
+
+ private float finalDamageMultiplyer = 1f;
+
+ private float remainingRange;
+
+ private TaggedObject firedBy;
+
+ private bool firedByPlayer;
+
+ private bool targetIsFlying;
+
+ [HideInInspector]
+ public UnityEvent onHit = new UnityEvent();
+
+ private float speed;
+
+ public Weapon Weapon
+ {
+ get
+ {
+ return weapon;
+ }
+ set
+ {
+ weapon = value;
+ }
+ }
+
+ public void Fire(Weapon _weapon, Hp _target, float _chaseRange, Vector3 _backupTarget, TaggedObject _firedBy, float _finalDamageMultiplyer = 1f, float _projectileSpeedMultiplyer = 1f)
+ {
+ firedBy = _firedBy;
+ if ((bool)firedBy)
+ {
+ firedByPlayer = _firedBy.Tags.Contains(TagManager.ETag.Player);
+ }
+ weapon = _weapon;
+ if ((bool)_target)
+ {
+ targetTransform = _target.transform;
+ rememberTarget = targetTransform.position;
+ targetHp = _target;
+ targetTaggedObject = _target.GetComponent<TaggedObject>();
+ if (targetTaggedObject.Tags.Contains(TagManager.ETag.Flying))
+ {
+ targetIsFlying = true;
+ }
+ }
+ else
+ {
+ rememberTarget = _backupTarget;
+ }
+ myLinearPosition = base.transform.position;
+ spawnPosition = base.transform.position;
+ previousPosition = base.transform.position;
+ remainingRange = Mathf.Max(_chaseRange, (spawnPosition - rememberTarget).magnitude + 0.5f);
+ finalDamageMultiplyer = _finalDamageMultiplyer;
+ foreach (GameObjectToDestroyAfterTime item in objectsToUnparentOnDestroy)
+ {
+ item?.target.transform.SetParent(null);
+ }
+ speed = weapon.projectileSpeed * _projectileSpeedMultiplyer;
+ Update();
+ }
+
+ private void Update()
+ {
+ if ((bool)targetTransform)
+ {
+ if (targetTaggedObject.colliderForBigOjectsToMeasureDistance != null)
+ {
+ rememberTarget = targetTaggedObject.colliderForBigOjectsToMeasureDistance.ClosestPoint(spawnPosition);
+ }
+ else
+ {
+ rememberTarget = targetTransform.position + targetHp.hitFeedbackHeight * Vector3.up;
+ }
+ }
+ Vector3 vector = rememberTarget - myLinearPosition;
+ float num = speed * Time.deltaTime;
+ if (num >= vector.magnitude)
+ {
+ _ = base.transform.position;
+ base.transform.position = rememberTarget;
+ if (targetTaggedObject != null && targetHp != null && targetTransform != null)
+ {
+ weapon.DealDamage(targetHp, finalDamageMultiplyer, firedBy);
+ }
+ GameObject gameObject = null;
+ if (!targetIsFlying && (bool)weapon.spawnOnGroundWhenTargetingGround)
+ {
+ gameObject = ((!(targetTransform != null)) ? UnityEngine.Object.Instantiate(weapon.spawnOnGroundWhenTargetingGround, base.transform.position, Quaternion.identity) : UnityEngine.Object.Instantiate(weapon.spawnOnGroundWhenTargetingGround, targetTransform.position, Quaternion.identity));
+ }
+ else if (targetIsFlying && (bool)weapon.spawnInAirWhenTargetingAir)
+ {
+ gameObject = ((!(targetTransform != null)) ? UnityEngine.Object.Instantiate(weapon.spawnInAirWhenTargetingAir, base.transform.position, Quaternion.identity) : UnityEngine.Object.Instantiate(weapon.spawnInAirWhenTargetingAir, targetTransform.position, Quaternion.identity));
+ }
+ if ((bool)gameObject)
+ {
+ WeaponDamageDealer[] components = gameObject.GetComponents<WeaponDamageDealer>();
+ for (int i = 0; i < components.Length; i++)
+ {
+ components[i].DamageMultiplyer = finalDamageMultiplyer;
+ }
+ }
+ if (spawnOnHit != null)
+ {
+ UnityEngine.Object.Instantiate(spawnOnHit, base.transform.position, Quaternion.identity, null);
+ }
+ onHit.Invoke();
+ UnityEngine.Object.Destroy(base.gameObject);
+ }
+ else
+ {
+ myLinearPosition += vector.normalized * num;
+ }
+ float magnitude = (rememberTarget - spawnPosition).magnitude;
+ float num4;
+ if (magnitude > 0.001f)
+ {
+ float num2 = (myLinearPosition - spawnPosition).magnitude / magnitude;
+ float num3 = Mathf.Max(0f, (magnitude + weapon.projectileParabulaOffset) * weapon.projectileParabulaFactor);
+ num4 = (0f - Mathf.Pow(2f * num2 - 1f, 2f) + 1f) * num3;
+ }
+ else
+ {
+ num4 = 0f;
+ }
+ base.transform.position = myLinearPosition + Vector3.up * num4;
+ if (weapon.projectileFacingDirection == Weapon.EFacingDirection.FaceVictim && base.transform.position != previousPosition)
+ {
+ base.transform.rotation = Quaternion.LookRotation(base.transform.position - previousPosition, Vector3.up);
+ }
+ previousPosition = base.transform.position;
+ foreach (GameObjectToDestroyAfterTime item in objectsToUnparentOnDestroy)
+ {
+ item.target.transform.position = base.transform.position;
+ }
+ remainingRange -= num;
+ if (remainingRange <= 0f)
+ {
+ targetTransform = null;
+ }
+ }
+
+ private void OnDestroy()
+ {
+ foreach (GameObjectToDestroyAfterTime item in objectsToUnparentOnDestroy)
+ {
+ UnityEngine.Object.Destroy(item.target, item.lifetime);
+ }
+ if (shakeCameraOnDestroy && (bool)CameraController.instance)
+ {
+ CameraController.instance.ShakePunch();
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AncientShrinePerk.cs b/Thronefall_v1.57/Thronefall/Thronefall/AncientShrinePerk.cs
new file mode 100644
index 0000000..0fb41f9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AncientShrinePerk.cs
@@ -0,0 +1,29 @@
+using UnityEngine;
+
+public class AncientShrinePerk : MonoBehaviour
+{
+ [SerializeField]
+ private Equippable requiredPerk;
+
+ [SerializeField]
+ private BuildSlot buildSlot;
+
+ [SerializeField]
+ private Shrine shrine;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ private float xpRequirementMulti = 2f;
+
+ private void Start()
+ {
+ if (PerkManager.IsEquipped(requiredPerk))
+ {
+ if (buildSlot.Level == 0)
+ {
+ buildSlot.ExecuteBuildOrUpgrade(PlayerInteraction.instance, _presentChoice: false);
+ }
+ shrine.AdjustRequiredXp(xpRequirementMulti);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AnimateSizeAndDestroy.cs b/Thronefall_v1.57/Thronefall/Thronefall/AnimateSizeAndDestroy.cs
new file mode 100644
index 0000000..7ec5b1a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AnimateSizeAndDestroy.cs
@@ -0,0 +1,30 @@
+using System.Collections;
+using UnityEngine;
+
+public class AnimateSizeAndDestroy : MonoBehaviour
+{
+ public AnimationCurve animationCurve;
+
+ public float duration = 1f;
+
+ private Vector3 initialScale;
+
+ private void Start()
+ {
+ initialScale = base.transform.localScale;
+ StartCoroutine(AnimateScale());
+ }
+
+ private IEnumerator AnimateScale()
+ {
+ float time = 0f;
+ while (time <= duration)
+ {
+ float num = animationCurve.Evaluate(time / duration);
+ base.transform.localScale = initialScale * num;
+ time += Time.deltaTime;
+ yield return null;
+ }
+ Object.Destroy(base.gameObject);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ApplyHeroUnitPerks.cs b/Thronefall_v1.57/Thronefall/Thronefall/ApplyHeroUnitPerks.cs
new file mode 100644
index 0000000..2b67f72
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ApplyHeroUnitPerks.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+
+public class ApplyHeroUnitPerks : MonoBehaviour
+{
+ private void Start()
+ {
+ Hp component = GetComponent<Hp>();
+ if (PerkManager.instance.StrongerHeros)
+ {
+ component.maxHp *= PerkManager.instance.strongerHeros_healthMutli;
+ component.DamageMultiplyer *= PerkManager.instance.strongerHeros_damageMulti;
+ component.SetHpToMaxHp();
+ AutoAttack[] componentsInChildren = GetComponentsInChildren<AutoAttack>();
+ for (int i = 0; i < componentsInChildren.Length; i++)
+ {
+ componentsInChildren[i].DamageMultiplyer *= PerkManager.instance.strongerHeros_damageMulti;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ApplyUpgradeIndicatorColor.cs b/Thronefall_v1.57/Thronefall/Thronefall/ApplyUpgradeIndicatorColor.cs
new file mode 100644
index 0000000..065accb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ApplyUpgradeIndicatorColor.cs
@@ -0,0 +1,15 @@
+using Shapes;
+using UnityEngine;
+
+[RequireComponent(typeof(Rectangle))]
+public class ApplyUpgradeIndicatorColor : MonoBehaviour
+{
+ private void Start()
+ {
+ Rectangle component = GetComponent<Rectangle>();
+ if ((bool)ColorAndLightManager.currentColorscheme)
+ {
+ component.Color = ColorAndLightManager.currentColorscheme.upgradeInteractorColor;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AttackCooldownAnimation.cs b/Thronefall_v1.57/Thronefall/Thronefall/AttackCooldownAnimation.cs
new file mode 100644
index 0000000..d4f65c5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AttackCooldownAnimation.cs
@@ -0,0 +1,50 @@
+using MoreMountains.Feedbacks;
+using MPUIKIT;
+using UnityEngine;
+
+public class AttackCooldownAnimation : MonoBehaviour
+{
+ public GameObject parent;
+
+ public MPImage cooldownIndicator;
+
+ public MMF_Player onShow;
+
+ public MMF_Player onHide;
+
+ private float currentCooldownPercentage;
+
+ private bool inCooldown;
+
+ private void Start()
+ {
+ parent.SetActive(value: false);
+ }
+
+ public void SetCurrentCooldownPercentage(float value)
+ {
+ currentCooldownPercentage = value;
+ if (inCooldown && currentCooldownPercentage <= 0f)
+ {
+ onShow.StopFeedbacks();
+ onHide.StopFeedbacks();
+ onHide.PlayFeedbacks();
+ inCooldown = false;
+ }
+ if (!inCooldown && currentCooldownPercentage > 0f)
+ {
+ onShow.StopFeedbacks();
+ onHide.StopFeedbacks();
+ onShow.PlayFeedbacks();
+ inCooldown = true;
+ }
+ }
+
+ private void Update()
+ {
+ if (currentCooldownPercentage > 0f)
+ {
+ cooldownIndicator.fillAmount = 1f - currentCooldownPercentage;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AudioDayNightFader.cs b/Thronefall_v1.57/Thronefall/Thronefall/AudioDayNightFader.cs
new file mode 100644
index 0000000..803112f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AudioDayNightFader.cs
@@ -0,0 +1,91 @@
+using System.Collections;
+using UnityEngine;
+using UnityEngine.Audio;
+
+public class AudioDayNightFader : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ public float fadeTime = 0.5f;
+
+ public AudioMixer mixer;
+
+ public AudioClip nightMusic;
+
+ public AudioClip finalNightMusic;
+
+ public float nightMusicFadeInTime = 3f;
+
+ public float nightMusicFadeOutTime = 4f;
+
+ private float transitionClock;
+
+ private float dayTargetVol;
+
+ private float nightTargetVol;
+
+ private void Start()
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ mixer.GetFloat("DayEnvVolume", out dayTargetVol);
+ mixer.GetFloat("NightEnvVolume", out nightTargetVol);
+ dayTargetVol = Mathf.Pow(10f, dayTargetVol / 20f);
+ nightTargetVol = Mathf.Pow(10f, nightTargetVol / 20f);
+ mixer.SetFloat("NightEnvVolume", Mathf.Log10(0.0001f) * 20f);
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ StopAllCoroutines();
+ StartCoroutine(FadeToDay());
+ }
+
+ public void OnDusk()
+ {
+ StopAllCoroutines();
+ StartCoroutine(FadeToNight());
+ }
+
+ private IEnumerator FadeToNight()
+ {
+ if (EnemySpawner.instance.Wavenumber >= EnemySpawner.instance.waves.Count - 1)
+ {
+ MusicManager.instance.PlayMusic(finalNightMusic, nightMusicFadeInTime);
+ }
+ else
+ {
+ MusicManager.instance.PlayMusic(nightMusic, nightMusicFadeInTime);
+ }
+ while (transitionClock < 1f)
+ {
+ transitionClock += Time.deltaTime / fadeTime;
+ mixer.SetFloat("DayEnvVolume", Mathf.Log10(Mathf.Lerp(dayTargetVol, 0.0001f, transitionClock)) * 20f);
+ mixer.SetFloat("NightEnvVolume", Mathf.Log10(Mathf.Lerp(0.0001f, nightTargetVol, transitionClock)) * 20f);
+ yield return null;
+ }
+ transitionClock = 1f;
+ mixer.SetFloat("DayEnvVolume", Mathf.Log10(0.0001f) * 20f);
+ mixer.SetFloat("NightEnvVolume", Mathf.Log10(nightTargetVol) * 20f);
+ }
+
+ private IEnumerator FadeToDay()
+ {
+ MusicManager.instance.PlayMusic(null, nightMusicFadeOutTime);
+ while (transitionClock > 0f)
+ {
+ transitionClock -= Time.deltaTime / fadeTime;
+ mixer.SetFloat("DayEnvVolume", Mathf.Log10(Mathf.Lerp(dayTargetVol, 0.0001f, transitionClock)) * 20f);
+ mixer.SetFloat("NightEnvVolume", Mathf.Log10(Mathf.Lerp(0.0001f, nightTargetVol, transitionClock)) * 20f);
+ yield return null;
+ }
+ transitionClock = 0f;
+ mixer.SetFloat("DayEnvVolume", Mathf.Log10(dayTargetVol) * 20f);
+ mixer.SetFloat("NightEnvVolume", Mathf.Log10(0.0001f) * 20f);
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AudioSet.cs b/Thronefall_v1.57/Thronefall/Thronefall/AudioSet.cs
new file mode 100644
index 0000000..efab46e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AudioSet.cs
@@ -0,0 +1,453 @@
+using System;
+using UnityEngine;
+using UnityEngine.Audio;
+
+[CreateAssetMenu(fileName = "New Audio Set", menuName = "SimpleSiege/Audio Set")]
+public class AudioSet : ScriptableObject
+{
+ [Serializable]
+ public class ClipArray
+ {
+ public AudioClip[] clips;
+
+ public AudioClip GetRandomClip()
+ {
+ return clips[UnityEngine.Random.Range(0, clips.Length)];
+ }
+ }
+
+ [Header("MIXER GROUPS")]
+ public AudioMixerGroup mixGroupFX;
+
+ [Header("DAY/NIGHT")]
+ [SerializeField]
+ private AudioClip nightSurvived;
+
+ [SerializeField]
+ private AudioClip buildingRepair;
+
+ [Header("BUILDING")]
+ [SerializeField]
+ private AudioClip coinslotFill;
+
+ [SerializeField]
+ private AudioClip lastCoinslotFill;
+
+ [SerializeField]
+ private AudioClip coinslotInteractionStart;
+
+ [SerializeField]
+ private AudioClip payBackground;
+
+ [SerializeField]
+ private AudioClip buildingBuild;
+
+ [SerializeField]
+ private AudioClip buildingUpgrade;
+
+ [SerializeField]
+ private ClipArray towerShot;
+
+ [SerializeField]
+ private ClipArray ballistaShot;
+
+ [SerializeField]
+ private AudioClip enemySpawn;
+
+ [SerializeField]
+ private ClipArray defaultOnFootStep;
+
+ [SerializeField]
+ private ClipArray giantStep;
+
+ [SerializeField]
+ private ClipArray flyingSmall;
+
+ [SerializeField]
+ private ClipArray flyingBig;
+
+ [SerializeField]
+ private ClipArray flyingWizzard;
+
+ [SerializeField]
+ private ClipArray siegeRoll;
+
+ [SerializeField]
+ private ClipArray racerRoll;
+
+ [SerializeField]
+ private ClipArray squishyBounce;
+
+ [SerializeField]
+ private ClipArray exploderRoll;
+
+ [SerializeField]
+ private ClipArray monsterRiderGallop;
+
+ [SerializeField]
+ private ClipArray slimeStep;
+
+ [SerializeField]
+ private ClipArray defaultSwordAttack;
+
+ [SerializeField]
+ private ClipArray pointySpearAttack;
+
+ [SerializeField]
+ private ClipArray massiveBluntAttack;
+
+ [SerializeField]
+ private ClipArray flyerSpit;
+
+ [SerializeField]
+ private ClipArray flatbowShot;
+
+ [SerializeField]
+ private ClipArray crossbowShow;
+
+ [SerializeField]
+ private ClipArray catapultShot;
+
+ [SerializeField]
+ private ClipArray ram;
+
+ [SerializeField]
+ private ClipArray racerBite;
+
+ [SerializeField]
+ private ClipArray hunterlingBite;
+
+ [SerializeField]
+ private ClipArray slimeSpit;
+
+ [SerializeField]
+ private ClipArray fireSpit;
+
+ [SerializeField]
+ private ClipArray healingProjectile;
+
+ [SerializeField]
+ private ClipArray flyingWizardCast;
+
+ [SerializeField]
+ private ClipArray defaultHumanoidOnFootDamage;
+
+ [SerializeField]
+ private ClipArray bigOrganicDamage;
+
+ [SerializeField]
+ private ClipArray smallOrganicDamage;
+
+ [SerializeField]
+ private ClipArray siegeDamage;
+
+ [SerializeField]
+ private ClipArray defaultHumanoidOnFootDeath;
+
+ [SerializeField]
+ private ClipArray bigOrganicDeath;
+
+ [SerializeField]
+ private ClipArray siegeDeath;
+
+ [SerializeField]
+ private ClipArray exploderDeath;
+
+ [SerializeField]
+ private ClipArray eismolochAppear;
+
+ [SerializeField]
+ private ClipArray eismolochSpawnUnits;
+
+ [SerializeField]
+ private ClipArray eismolochScream;
+
+ [SerializeField]
+ private ClipArray playerSword;
+
+ [SerializeField]
+ private ClipArray playerSwordBigHit;
+
+ [SerializeField]
+ private ClipArray playerBow;
+
+ [SerializeField]
+ private ClipArray playerBowStab;
+
+ [SerializeField]
+ private ClipArray playerBowStabMiss;
+
+ [SerializeField]
+ private ClipArray playerCantUseActiveAbility;
+
+ [SerializeField]
+ private ClipArray assasinsTrainingWeaponTimedPerfectly;
+
+ [SerializeField]
+ private ClipArray activeAbilityCooldownReadyToUse;
+
+ [SerializeField]
+ private ClipArray playerSpear;
+
+ [SerializeField]
+ private ClipArray playerLightningWand;
+
+ [SerializeField]
+ private ClipArray playerLightningWandActiveAbility;
+
+ [SerializeField]
+ private ClipArray playerShadowCodex;
+
+ [SerializeField]
+ private ClipArray playerDeath;
+
+ [SerializeField]
+ private ClipArray playerDamage;
+
+ [SerializeField]
+ private AudioClip playerRevive;
+
+ [SerializeField]
+ private ClipArray addedUnitToCommanding;
+
+ [SerializeField]
+ private ClipArray placeCommandingUnits;
+
+ [SerializeField]
+ private ClipArray holdPosition;
+
+ [SerializeField]
+ private ClipArray catapultImpact;
+
+ [SerializeField]
+ private ClipArray buttonSelect;
+
+ [SerializeField]
+ private ClipArray buttonApply;
+
+ [SerializeField]
+ private ClipArray buttonApplyHero;
+
+ [SerializeField]
+ private ClipArray coinCollect;
+
+ [SerializeField]
+ private AudioClip nightCallStart;
+
+ [SerializeField]
+ private AudioClip nightCallComplete;
+
+ [SerializeField]
+ private AudioClip victory;
+
+ [SerializeField]
+ private AudioClip defeat;
+
+ [SerializeField]
+ private AudioClip pointLockInMinor;
+
+ [SerializeField]
+ private AudioClip pointLockInMajor;
+
+ [SerializeField]
+ private AudioClip pointScreenBuildA;
+
+ [SerializeField]
+ private AudioClip pointScreenBuildB;
+
+ [SerializeField]
+ private AudioClip pointScreenBuildC;
+
+ [SerializeField]
+ private AudioClip pointFillStart;
+
+ [SerializeField]
+ private AudioClip pointFill;
+
+ [SerializeField]
+ private AudioClip newHighscore;
+
+ [SerializeField]
+ private AudioClip levelUp;
+
+ [SerializeField]
+ private AudioClip showWaveCount;
+
+ [SerializeField]
+ private AudioClip closeWaveCount;
+
+ [SerializeField]
+ private AudioClip showTooltip;
+
+ public AudioClip NightSurvived => nightSurvived;
+
+ public AudioClip BuildingRepair => buildingRepair;
+
+ public AudioClip CoinslotFill => coinslotFill;
+
+ public AudioClip LastCoinslotFill => lastCoinslotFill;
+
+ public AudioClip CoinslotInteractionStart => coinslotInteractionStart;
+
+ public AudioClip PayBackground => payBackground;
+
+ public AudioClip BuildingBuild => buildingBuild;
+
+ public AudioClip BuildingUpgrade => buildingUpgrade;
+
+ public ClipArray TowerShot => towerShot;
+
+ public ClipArray BallistaShot => ballistaShot;
+
+ public AudioClip EnemySpawn => enemySpawn;
+
+ public ClipArray DefaultOnFootStep => defaultOnFootStep;
+
+ public ClipArray GiantStep => giantStep;
+
+ public ClipArray FlyingSmall => flyingSmall;
+
+ public ClipArray FlyingBig => flyingBig;
+
+ public ClipArray FlyingWizzard => flyingWizzard;
+
+ public ClipArray SiegeRoll => siegeRoll;
+
+ public ClipArray RacerRoll => racerRoll;
+
+ public ClipArray SquishyBounce => squishyBounce;
+
+ public ClipArray ExploderRoll => exploderRoll;
+
+ public ClipArray MonsterRiderGallop => monsterRiderGallop;
+
+ public ClipArray SlimeStep => slimeStep;
+
+ public ClipArray DefaultSwordAttack => defaultSwordAttack;
+
+ public ClipArray PointySpearAttack => pointySpearAttack;
+
+ public ClipArray MassiveBluntAttack => massiveBluntAttack;
+
+ public ClipArray FlyerSpit => flyerSpit;
+
+ public ClipArray FlatbowShot => flatbowShot;
+
+ public ClipArray CrossbowShot => crossbowShow;
+
+ public ClipArray CatapultShot => catapultShot;
+
+ public ClipArray Ram => ram;
+
+ public ClipArray RacerBite => racerBite;
+
+ public ClipArray HunterlingBite => hunterlingBite;
+
+ public ClipArray SlimeSpit => slimeSpit;
+
+ public ClipArray FireSpit => fireSpit;
+
+ public ClipArray HealingProjectile => healingProjectile;
+
+ public ClipArray FlyingWizardCast => flyingWizardCast;
+
+ public ClipArray DefaultHumanoidOnFootDamage => defaultHumanoidOnFootDamage;
+
+ public ClipArray BigOrganicDamage => bigOrganicDamage;
+
+ public ClipArray SmallOrganicDamage => smallOrganicDamage;
+
+ public ClipArray SiegeDamage => siegeDamage;
+
+ public ClipArray DefaultHumanoidOnFootDeath => defaultHumanoidOnFootDeath;
+
+ public ClipArray BigOrganicDeath => bigOrganicDeath;
+
+ public ClipArray SiegeDeath => siegeDeath;
+
+ public ClipArray ExploderDeath => exploderDeath;
+
+ public ClipArray EismolochAppear => eismolochAppear;
+
+ public ClipArray EismolochSpawnUnits => eismolochSpawnUnits;
+
+ public ClipArray EismolochScream => eismolochScream;
+
+ public ClipArray PlayerSword => playerSword;
+
+ public ClipArray PlayerSwordBigHit => playerSwordBigHit;
+
+ public ClipArray PlayerBow => playerBow;
+
+ public ClipArray PlayerBowStab => playerBowStab;
+
+ public ClipArray PlayerBowStabMiss => playerBowStabMiss;
+
+ public ClipArray PlayerCantUseActiveAbility => playerCantUseActiveAbility;
+
+ public ClipArray AssasinsTrainingWeaponTimedPerfectly => assasinsTrainingWeaponTimedPerfectly;
+
+ public ClipArray ActiveAbilityCooldownReadyToUse => activeAbilityCooldownReadyToUse;
+
+ public ClipArray PlayerSpear => playerSpear;
+
+ public ClipArray PlayerLightningWand => playerLightningWand;
+
+ public ClipArray PlayerLightningWandActiveAbility => playerLightningWandActiveAbility;
+
+ public ClipArray PlayerShadowCodex => playerShadowCodex;
+
+ public ClipArray PlayerDeath => playerDeath;
+
+ public ClipArray PlayerDamage => playerDamage;
+
+ public AudioClip PlayerRevive => playerRevive;
+
+ public ClipArray AddedUnitToCommanding => addedUnitToCommanding;
+
+ public ClipArray PlaceCommandingUnits => placeCommandingUnits;
+
+ public ClipArray HoldPosition => holdPosition;
+
+ public ClipArray CatapultImpact => catapultImpact;
+
+ public ClipArray ButtonSelect => buttonSelect;
+
+ public ClipArray ButtonApply => buttonApply;
+
+ public ClipArray ButtonApplyHero => buttonApplyHero;
+
+ public ClipArray CoinCollect => coinCollect;
+
+ public AudioClip NightCallStart => nightCallStart;
+
+ public AudioClip NightCallComplete => nightCallComplete;
+
+ public AudioClip Victory => victory;
+
+ public AudioClip Defeat => defeat;
+
+ public AudioClip PointLockInMinor => pointLockInMinor;
+
+ public AudioClip PointLockInMajor => pointLockInMajor;
+
+ public AudioClip PointScreenBuildA => pointScreenBuildA;
+
+ public AudioClip PointScreenBuildB => pointScreenBuildB;
+
+ public AudioClip PointScreenBuildC => pointScreenBuildC;
+
+ public AudioClip PointFillStart => pointFillStart;
+
+ public AudioClip PointFill => pointFill;
+
+ public AudioClip NewHighscore => newHighscore;
+
+ public AudioClip LevelUp => levelUp;
+
+ public AudioClip ShowWaveCount => showWaveCount;
+
+ public AudioClip CloseWaveCount => closeWaveCount;
+
+ public AudioClip ShowTooltip => showTooltip;
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AutoAttack.cs b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttack.cs
new file mode 100644
index 0000000..92fe14c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttack.cs
@@ -0,0 +1,138 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Events;
+
+public class AutoAttack : MonoBehaviour
+{
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public float cooldownDuration = 1f;
+
+ public float cooldownAfterSpawn = -1f;
+
+ [Range(0f, 1f)]
+ public float cooldownRandomization;
+
+ [Tooltip("How often this script checks if an attack is possible once the cooldown is down")]
+ public float recheckTargetInterval = 0.5f;
+
+ public List<TargetPriority> targetPriorities = new List<TargetPriority>();
+
+ public Weapon weapon;
+
+ public float spawnAttackHeight = 0.5f;
+
+ protected TaggedObject taggedObject;
+
+ protected float cooldown = -1f;
+
+ [HideInInspector]
+ public bool onCooldown;
+
+ public Transform optionalAttackOrigin;
+
+ [SerializeField]
+ protected float damageMultiplyer = 1f;
+
+ [SerializeField]
+ protected float projectileSpeedMultiplyer = 1f;
+
+ [HideInInspector]
+ public UnityEvent onAttackTriggered = new UnityEvent();
+
+ private protected Vector3 lastTargetPosition;
+
+ public float DamageMultiplyer
+ {
+ get
+ {
+ return damageMultiplyer;
+ }
+ set
+ {
+ damageMultiplyer = value;
+ }
+ }
+
+ public float ProjectileSpeedMultiplyer
+ {
+ get
+ {
+ return projectileSpeedMultiplyer;
+ }
+ set
+ {
+ projectileSpeedMultiplyer = value;
+ }
+ }
+
+ public Vector3 LastTargetPosition => lastTargetPosition;
+
+ public void ReduceCooldownBy(float _reduceBy)
+ {
+ cooldown -= _reduceBy;
+ }
+
+ public virtual void Start()
+ {
+ cooldown = cooldownAfterSpawn;
+ taggedObject = GetComponent<TaggedObject>();
+ }
+
+ public virtual void Update()
+ {
+ cooldown -= Time.deltaTime;
+ if (!(cooldown > 0f))
+ {
+ TaggedObject taggedObject = FindAutoAttackTarget();
+ if (taggedObject == null)
+ {
+ cooldown += recheckTargetInterval;
+ onCooldown = false;
+ }
+ else
+ {
+ cooldown += cooldownDuration * (1f + (1f - 2f * Random.value) * cooldownRandomization);
+ OnAttack(taggedObject);
+ }
+ }
+ }
+
+ public virtual void OnAttack(TaggedObject target)
+ {
+ Vector3 attackOrigin = base.transform.position + spawnAttackHeight * Vector3.up;
+ if (optionalAttackOrigin != null)
+ {
+ attackOrigin = optionalAttackOrigin.position;
+ }
+ weapon.Attack(attackOrigin, target.Hp, Vector3.zero, taggedObject, damageMultiplyer, projectileSpeedMultiplyer);
+ lastTargetPosition = target.transform.position;
+ onAttackTriggered.Invoke();
+ onCooldown = true;
+ }
+
+ public virtual TaggedObject FindAutoAttackTarget()
+ {
+ for (int i = 0; i < targetPriorities.Count; i++)
+ {
+ TaggedObject taggedObject = targetPriorities[i].FindClosestTaggedObject(base.transform.position);
+ if (taggedObject != null)
+ {
+ return taggedObject;
+ }
+ }
+ return null;
+ }
+
+ public static TaggedObject FindAutoAttackTarget(List<TargetPriority> targetPriorities, Vector3 ownPosition)
+ {
+ for (int i = 0; i < targetPriorities.Count; i++)
+ {
+ TaggedObject taggedObject = targetPriorities[i].FindClosestTaggedObject(ownPosition);
+ if (taggedObject != null)
+ {
+ return taggedObject;
+ }
+ }
+ return null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackHighestHealth.cs b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackHighestHealth.cs
new file mode 100644
index 0000000..f489337
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackHighestHealth.cs
@@ -0,0 +1,15 @@
+public class AutoAttackHighestHealth : AutoAttack
+{
+ public override TaggedObject FindAutoAttackTarget()
+ {
+ for (int i = 0; i < targetPriorities.Count; i++)
+ {
+ TaggedObject taggedObject = targetPriorities[i].FindHighestHealthObjectInRange(base.transform.position);
+ if (taggedObject != null)
+ {
+ return taggedObject;
+ }
+ }
+ return null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackLowestHealth.cs b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackLowestHealth.cs
new file mode 100644
index 0000000..4db887b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackLowestHealth.cs
@@ -0,0 +1,17 @@
+public class AutoAttackLowestHealth : AutoAttack
+{
+ public bool excludeFullHealthTargets = true;
+
+ public override TaggedObject FindAutoAttackTarget()
+ {
+ for (int i = 0; i < targetPriorities.Count; i++)
+ {
+ TaggedObject taggedObject = targetPriorities[i].FindLowestHealthObjectInRange(base.transform.position, excludeFullHealthTargets);
+ if (taggedObject != null)
+ {
+ return taggedObject;
+ }
+ }
+ return null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackLowestInRangeMulti.cs b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackLowestInRangeMulti.cs
new file mode 100644
index 0000000..f83b0f2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackLowestInRangeMulti.cs
@@ -0,0 +1,61 @@
+using UnityEngine;
+
+public class AutoAttackLowestInRangeMulti : AutoAttack
+{
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private int attackTargets = 3;
+
+ [SerializeField]
+ public bool excludeFullHealthTargets = true;
+
+ [SerializeField]
+ private float randomizeSpawnPosition;
+
+ [SerializeField]
+ private float randomizeProjectileSpeed;
+
+ private TaggedObject[] targets;
+
+ public override void Start()
+ {
+ base.Start();
+ targets = new TaggedObject[attackTargets];
+ }
+
+ public override void Update()
+ {
+ cooldown -= Time.deltaTime;
+ if (!(cooldown <= 0f))
+ {
+ return;
+ }
+ FindAutoAttackTargets(targets);
+ cooldown += cooldownDuration * (1f + (1f - 2f * Random.value) * cooldownRandomization);
+ TaggedObject[] array = targets;
+ foreach (TaggedObject taggedObject in array)
+ {
+ if (!(taggedObject == null))
+ {
+ Vector3 vector = new Vector3(Random.value - 0.5f, Random.value - 0.5f, Random.value - 0.5f) * randomizeSpawnPosition;
+ float num = 1f + (Random.value - 0.5f) * randomizeProjectileSpeed;
+ weapon.Attack(base.transform.position + spawnAttackHeight * Vector3.up + vector, taggedObject.Hp, Vector3.zero, base.taggedObject, damageMultiplyer, num);
+ lastTargetPosition = taggedObject.transform.position;
+ onAttackTriggered.Invoke();
+ onCooldown = true;
+ }
+ }
+ }
+
+ private void FindAutoAttackTargets(TaggedObject[] outAttacks)
+ {
+ for (int i = 0; i < targetPriorities.Count; i++)
+ {
+ targetPriorities[i].FindLowestHealthTaggedObjects(base.transform.position, outAttacks, excludeFullHealthTargets);
+ if (outAttacks[i] != null)
+ {
+ break;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackRandom.cs b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackRandom.cs
new file mode 100644
index 0000000..ef22ff1
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackRandom.cs
@@ -0,0 +1,15 @@
+public class AutoAttackRandom : AutoAttack
+{
+ public override TaggedObject FindAutoAttackTarget()
+ {
+ for (int i = 0; i < targetPriorities.Count; i++)
+ {
+ TaggedObject taggedObject = targetPriorities[i].FindRandomObjectInRange(base.transform.position);
+ if (taggedObject != null)
+ {
+ return taggedObject;
+ }
+ }
+ return null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackTower.cs b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackTower.cs
new file mode 100644
index 0000000..be715f0
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackTower.cs
@@ -0,0 +1,180 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class AutoAttackTower : AutoAttack
+{
+ public enum ETargetingMode
+ {
+ TargetClosest,
+ TargetRandom,
+ TargetHighestHealth,
+ TargetLowestHealthDamaging,
+ TargetLowestHealthHealing
+ }
+
+ [Header("Tower Settings")]
+ public ETargetingMode targetingMode;
+
+ public int simultaneousProjectiles;
+
+ private List<TaggedObject> attackTargets = new List<TaggedObject>();
+
+ [HideInInspector]
+ public TaggedObject[] tempCollectionArray = new TaggedObject[1];
+
+ public override void Update()
+ {
+ cooldown -= Time.deltaTime;
+ if (cooldown > 0f)
+ {
+ return;
+ }
+ FindAutoAttackTargets();
+ bool flag = false;
+ foreach (TaggedObject attackTarget in attackTargets)
+ {
+ if (!(attackTarget == null))
+ {
+ OnAttack(attackTarget);
+ flag = true;
+ }
+ }
+ if (flag)
+ {
+ cooldown += cooldownDuration * (1f + (1f - 2f * Random.value) * cooldownRandomization);
+ return;
+ }
+ cooldown += recheckTargetInterval;
+ onCooldown = false;
+ }
+
+ public void FindAutoAttackTargets()
+ {
+ attackTargets.Clear();
+ for (int i = 0; i < tempCollectionArray.Length; i++)
+ {
+ tempCollectionArray[i] = null;
+ }
+ switch (targetingMode)
+ {
+ case ETargetingMode.TargetClosest:
+ {
+ for (int l = 0; l < targetPriorities.Count; l++)
+ {
+ targetPriorities[l].FindClosestTaggedObjects(base.transform.position, tempCollectionArray);
+ TaggedObject[] array = tempCollectionArray;
+ foreach (TaggedObject taggedObject2 in array)
+ {
+ if (taggedObject2 == null)
+ {
+ break;
+ }
+ attackTargets.Add(taggedObject2);
+ if (attackTargets.Count >= simultaneousProjectiles)
+ {
+ return;
+ }
+ }
+ }
+ break;
+ }
+ case ETargetingMode.TargetRandom:
+ {
+ for (int n = 0; n < targetPriorities.Count; n++)
+ {
+ targetPriorities[n].FindRandomObjectsInRange(base.transform.position, tempCollectionArray);
+ TaggedObject[] array = tempCollectionArray;
+ foreach (TaggedObject taggedObject4 in array)
+ {
+ if (taggedObject4 == null)
+ {
+ break;
+ }
+ attackTargets.Add(taggedObject4);
+ if (attackTargets.Count >= simultaneousProjectiles)
+ {
+ return;
+ }
+ }
+ }
+ break;
+ }
+ case ETargetingMode.TargetHighestHealth:
+ {
+ for (int num = 0; num < targetPriorities.Count; num++)
+ {
+ targetPriorities[num].FindHighestHealthObjectsInRange(base.transform.position, tempCollectionArray);
+ TaggedObject[] array = tempCollectionArray;
+ foreach (TaggedObject taggedObject5 in array)
+ {
+ if (taggedObject5 == null)
+ {
+ break;
+ }
+ attackTargets.Add(taggedObject5);
+ if (attackTargets.Count >= simultaneousProjectiles)
+ {
+ return;
+ }
+ }
+ }
+ break;
+ }
+ case ETargetingMode.TargetLowestHealthDamaging:
+ {
+ for (int m = 0; m < targetPriorities.Count; m++)
+ {
+ targetPriorities[m].FindLowestHealthObjectsInRange(base.transform.position, tempCollectionArray, _excludeFullHealthTargets: false);
+ TaggedObject[] array = tempCollectionArray;
+ foreach (TaggedObject taggedObject3 in array)
+ {
+ if (taggedObject3 == null)
+ {
+ break;
+ }
+ attackTargets.Add(taggedObject3);
+ if (attackTargets.Count >= simultaneousProjectiles)
+ {
+ return;
+ }
+ }
+ }
+ break;
+ }
+ case ETargetingMode.TargetLowestHealthHealing:
+ {
+ for (int j = 0; j < targetPriorities.Count; j++)
+ {
+ targetPriorities[j].FindLowestHealthObjectsInRange(base.transform.position, tempCollectionArray);
+ TaggedObject[] array = tempCollectionArray;
+ foreach (TaggedObject taggedObject in array)
+ {
+ if (taggedObject == null)
+ {
+ break;
+ }
+ attackTargets.Add(taggedObject);
+ if (attackTargets.Count >= simultaneousProjectiles)
+ {
+ return;
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ public override void OnAttack(TaggedObject target)
+ {
+ Vector3 attackOrigin = base.transform.position + spawnAttackHeight * Vector3.up;
+ if (optionalAttackOrigin != null)
+ {
+ attackOrigin = optionalAttackOrigin.position;
+ }
+ weapon.Attack(attackOrigin, target.Hp, Vector3.zero, taggedObject, damageMultiplyer, projectileSpeedMultiplyer);
+ lastTargetPosition = target.transform.position;
+ onAttackTriggered.Invoke();
+ onCooldown = true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackTwoTargets.cs b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackTwoTargets.cs
new file mode 100644
index 0000000..eab69fb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackTwoTargets.cs
@@ -0,0 +1,40 @@
+using UnityEngine;
+
+public class AutoAttackTwoTargets : AutoAttack
+{
+ private TaggedObject[] targets = new TaggedObject[2];
+
+ public override void Update()
+ {
+ cooldown -= Time.deltaTime;
+ if (!(cooldown <= 0f))
+ {
+ return;
+ }
+ FindAutoAttackTargets(targets);
+ cooldown += cooldownDuration * (1f + (1f - 2f * Random.value) * cooldownRandomization);
+ TaggedObject[] array = targets;
+ foreach (TaggedObject taggedObject in array)
+ {
+ if (!(taggedObject == null))
+ {
+ weapon.Attack(base.transform.position + spawnAttackHeight * Vector3.up, taggedObject.Hp, Vector3.zero, base.taggedObject, damageMultiplyer);
+ lastTargetPosition = taggedObject.transform.position;
+ onAttackTriggered.Invoke();
+ onCooldown = true;
+ }
+ }
+ }
+
+ private void FindAutoAttackTargets(TaggedObject[] outAttacks)
+ {
+ for (int i = 0; i < targetPriorities.Count; i++)
+ {
+ targetPriorities[i].FindClosestTaggedObjects(base.transform.position, outAttacks);
+ if (outAttacks[i] != null)
+ {
+ break;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackWithWarning.cs b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackWithWarning.cs
new file mode 100644
index 0000000..b592e96
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AutoAttackWithWarning.cs
@@ -0,0 +1,86 @@
+using Shapes;
+using UnityEngine;
+
+public class AutoAttackWithWarning : AutoAttack
+{
+ [SerializeField]
+ private Line line;
+
+ private TaggedObject targeting;
+
+ [SerializeField]
+ private float breakTargetingDistance = 10f;
+
+ private TagManager tagManager;
+
+ public override void Start()
+ {
+ base.Start();
+ tagManager = TagManager.instance;
+ line.transform.SetParent(null);
+ line.transform.position = Vector3.zero;
+ }
+
+ public override void Update()
+ {
+ HandleTargeting();
+ base.Update();
+ }
+
+ private void HandleTargeting()
+ {
+ if (!targeting)
+ {
+ targeting = null;
+ line.enabled = false;
+ return;
+ }
+ if (!targeting.Tags.Contains(TagManager.ETag.AUTO_Alive))
+ {
+ targeting = null;
+ line.enabled = false;
+ return;
+ }
+ Vector3 vector = base.transform.position + Vector3.up * spawnAttackHeight;
+ if (tagManager.MeasureDistanceToTaggedObject(targeting, vector) > breakTargetingDistance)
+ {
+ targeting = null;
+ line.enabled = false;
+ }
+ else if (targeting.Tags.Contains(TagManager.ETag.Building))
+ {
+ line.enabled = false;
+ }
+ else
+ {
+ line.enabled = true;
+ line.Start = vector;
+ line.End = targeting.transform.position + Vector3.up * 1f;
+ }
+ }
+
+ public override void OnAttack(TaggedObject target)
+ {
+ if ((bool)targeting && target != targeting)
+ {
+ OnAttack(targeting);
+ }
+ if (target != targeting)
+ {
+ targeting = target;
+ return;
+ }
+ weapon.Attack(base.transform.position + spawnAttackHeight * Vector3.up, target.Hp, Vector3.zero, taggedObject, damageMultiplyer);
+ lastTargetPosition = target.transform.position;
+ onAttackTriggered.Invoke();
+ onCooldown = true;
+ }
+
+ private void OnDestroy()
+ {
+ if ((bool)line)
+ {
+ Object.Destroy(line.gameObject);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AutoDayNight.cs b/Thronefall_v1.57/Thronefall/Thronefall/AutoDayNight.cs
new file mode 100644
index 0000000..c790f2f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AutoDayNight.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+public class AutoDayNight : MonoBehaviour
+{
+ public float dayLength = 15f;
+
+ public GameObject uiCountdownPrefab;
+
+ private void Start()
+ {
+ if ((bool)DayNightCycle.Instance)
+ {
+ DayNightCycle.Instance.SetToAuto(dayLength);
+ }
+ Object.Instantiate(uiCountdownPrefab, NightscoreUI.instance.transform);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AutoRevive.cs b/Thronefall_v1.57/Thronefall/Thronefall/AutoRevive.cs
new file mode 100644
index 0000000..250f1ab
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AutoRevive.cs
@@ -0,0 +1,112 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Events;
+
+[RequireComponent(typeof(Hp))]
+public class AutoRevive : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ [SerializeField]
+ private PlayerHpRegen playerHpRegen;
+
+ [HideInInspector]
+ public UnityEvent onReviveTrigger = new UnityEvent();
+
+ private Hp hp;
+
+ public float reviveAfterBeingKnockedOutFor = 20f;
+
+ public float refillHealthForSecs = 10f;
+
+ private float hasBeenKnockedOutFor;
+
+ private bool ringOfResurection;
+
+ private bool quickReviveAvailable = true;
+
+ private bool godOfDeathActive;
+
+ [SerializeField]
+ private Equippable ringOfResurectionPerk;
+
+ private float ReviveAfterBeingKnockedOutFor
+ {
+ get
+ {
+ if (ringOfResurection && quickReviveAvailable)
+ {
+ return 2f;
+ }
+ return reviveAfterBeingKnockedOutFor;
+ }
+ }
+
+ public float TimeTillRevive
+ {
+ get
+ {
+ if (hasBeenKnockedOutFor <= 0f)
+ {
+ return -1f;
+ }
+ return ReviveAfterBeingKnockedOutFor - hasBeenKnockedOutFor;
+ }
+ }
+
+ public void OnDusk()
+ {
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ quickReviveAvailable = true;
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ private void Start()
+ {
+ godOfDeathActive = PerkManager.instance.GodOfDeathActive;
+ if (godOfDeathActive)
+ {
+ reviveAfterBeingKnockedOutFor *= PerkManager.instance.godOfDeath_playerRespawnMultiplyer;
+ }
+ hp = GetComponent<Hp>();
+ ringOfResurection = PerkManager.IsEquipped(ringOfResurectionPerk);
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ }
+
+ private void Update()
+ {
+ if (hp.KnockedOut)
+ {
+ hasBeenKnockedOutFor += Time.deltaTime;
+ if (hasBeenKnockedOutFor >= ReviveAfterBeingKnockedOutFor)
+ {
+ if (ringOfResurection && quickReviveAvailable)
+ {
+ hp.Revive();
+ }
+ else
+ {
+ hp.Revive(callReviveEvent: true, playerHpRegen.HealingPerSecond * refillHealthForSecs / hp.maxHp);
+ }
+ if (ringOfResurection && quickReviveAvailable)
+ {
+ Hp.ReviveAllUnitsWithTag(new List<TagManager.ETag> { TagManager.ETag.PlayerUnit }, new List<TagManager.ETag>());
+ }
+ onReviveTrigger.Invoke();
+ quickReviveAvailable = false;
+ }
+ }
+ else
+ {
+ hasBeenKnockedOutFor = 0f;
+ }
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/AutoUpgradeBuildingOnStart.cs b/Thronefall_v1.57/Thronefall/Thronefall/AutoUpgradeBuildingOnStart.cs
new file mode 100644
index 0000000..279013c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/AutoUpgradeBuildingOnStart.cs
@@ -0,0 +1,37 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class AutoUpgradeBuildingOnStart : MonoBehaviour
+{
+ public List<int> upgradePaths = new List<int>();
+
+ private void Start()
+ {
+ StartCoroutine(AutoUpgradeOnStart());
+ }
+
+ private IEnumerator AutoUpgradeOnStart()
+ {
+ BuildSlot bs = GetComponent<BuildSlot>();
+ bs.Activate();
+ bs.StartDeactivated = false;
+ bs.Interactor.SetHarvested(_harvested: true);
+ yield return null;
+ for (int iUpgrade = 0; iUpgrade < upgradePaths.Count; iUpgrade++)
+ {
+ int index = upgradePaths[iUpgrade];
+ if (bs.Level <= iUpgrade)
+ {
+ BuildSlot.UpgradeBranch upgBranch = bs.upgrades[bs.Level].upgradeBranches[index];
+ bs.ForceManualUpgradeWithoutFeedbackEffects(upgBranch);
+ yield return null;
+ }
+ }
+ if (bs.AppliedUpgrades.Count < upgradePaths.Count)
+ {
+ bs.AppliedUpgrades.Clear();
+ bs.AppliedUpgrades.AddRange(upgradePaths);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BackToTitlescreenUIHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/BackToTitlescreenUIHelper.cs
new file mode 100644
index 0000000..da76893
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BackToTitlescreenUIHelper.cs
@@ -0,0 +1,9 @@
+using UnityEngine;
+
+public class BackToTitlescreenUIHelper : MonoBehaviour
+{
+ public void TransitionToMainMenu()
+ {
+ SceneTransitionManager.instance.TransitionToMainMenu();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BackupAudioListener.cs b/Thronefall_v1.57/Thronefall/Thronefall/BackupAudioListener.cs
new file mode 100644
index 0000000..276c372
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BackupAudioListener.cs
@@ -0,0 +1,24 @@
+using UnityEngine;
+
+public class BackupAudioListener : MonoBehaviour
+{
+ public static BackupAudioListener Instance { get; private set; }
+
+ private void Awake()
+ {
+ if (Instance == null)
+ {
+ Instance = this;
+ Object.DontDestroyOnLoad(base.gameObject);
+ }
+ else
+ {
+ Object.Destroy(base.gameObject);
+ }
+ }
+
+ public void EnableBackupListener(bool enable)
+ {
+ GetComponent<AudioListener>().enabled = enable;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BakeTrail.cs b/Thronefall_v1.57/Thronefall/Thronefall/BakeTrail.cs
new file mode 100644
index 0000000..d06fd55
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BakeTrail.cs
@@ -0,0 +1,38 @@
+using Ara;
+using UnityEngine;
+
+[RequireComponent(typeof(AraTrail))]
+public class BakeTrail : MonoBehaviour
+{
+ private AraTrail trail;
+
+ private void Awake()
+ {
+ trail = GetComponent<AraTrail>();
+ }
+
+ private void Update()
+ {
+ if (Input.GetKeyDown(KeyCode.Space))
+ {
+ Bake();
+ }
+ }
+
+ private void Bake()
+ {
+ MeshFilter meshFilter = base.gameObject.AddComponent<MeshFilter>();
+ MeshRenderer meshRenderer = base.gameObject.AddComponent<MeshRenderer>();
+ if (meshFilter != null && meshRenderer != null)
+ {
+ meshFilter.mesh = Object.Instantiate(trail.mesh);
+ meshRenderer.materials = trail.materials;
+ Object.Destroy(this);
+ Object.Destroy(trail);
+ }
+ else
+ {
+ Debug.LogError("[BakeTrail]: Could not bake the trail because the object already had a MeshRenderer.");
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BalancingParameter.cs b/Thronefall_v1.57/Thronefall/Thronefall/BalancingParameter.cs
new file mode 100644
index 0000000..7d6e586
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BalancingParameter.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Globalization;
+using UnityEngine;
+
+[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
+public class BalancingParameter : Attribute
+{
+ public enum EType
+ {
+ Default,
+ PercentageModifyer,
+ Percentage
+ }
+
+ public string key;
+
+ public EType type;
+
+ public BalancingParameter(EType _type = EType.Default)
+ {
+ type = _type;
+ }
+
+ public string ValueToString(string input)
+ {
+ return input;
+ }
+
+ public string ValueToString(float input)
+ {
+ switch (type)
+ {
+ case EType.PercentageModifyer:
+ input -= 1f;
+ if (input >= 0f)
+ {
+ return "+" + Mathf.RoundToInt(input * 100f).ToString(CultureInfo.InvariantCulture) + "%";
+ }
+ return Mathf.RoundToInt(input * 100f).ToString(CultureInfo.InvariantCulture) + "%";
+ case EType.Percentage:
+ _ = 0f;
+ return Mathf.RoundToInt(input * 100f).ToString(CultureInfo.InvariantCulture) + "%";
+ default:
+ return input.ToString(CultureInfo.InvariantCulture);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BalancingParameters.cs b/Thronefall_v1.57/Thronefall/Thronefall/BalancingParameters.cs
new file mode 100644
index 0000000..ab338a6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BalancingParameters.cs
@@ -0,0 +1,7 @@
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "SimpleSiege/BalancingParameters", menuName = "BalancingParameters")]
+public class BalancingParameters : ScriptableObject
+{
+ public StringFloatSerializableDictionary parameters = new StringFloatSerializableDictionary();
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BarricadeDamage.cs b/Thronefall_v1.57/Thronefall/Thronefall/BarricadeDamage.cs
new file mode 100644
index 0000000..1a2def9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BarricadeDamage.cs
@@ -0,0 +1,73 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class BarricadeDamage : MonoBehaviour
+{
+ public float preSelectRadius = 4f;
+
+ public float slowTime = 3f;
+
+ public List<DamageModifyer> damage;
+
+ public LayerMask lmTakeDamage;
+
+ private Collider[] overlapColliders = new Collider[50];
+
+ private float timeSinceLastCollisionCheck;
+
+ public float DamageMultiplyer = 1f;
+
+ private BoxCollider myCollider;
+
+ private BlacksmithUpgrades blacksmithUpgrades;
+
+ private void Start()
+ {
+ myCollider = GetComponent<BoxCollider>();
+ timeSinceLastCollisionCheck = Random.value;
+ }
+
+ private void Update()
+ {
+ timeSinceLastCollisionCheck += Time.deltaTime;
+ if (timeSinceLastCollisionCheck < 0.2f)
+ {
+ return;
+ }
+ timeSinceLastCollisionCheck = 0f;
+ foreach (TaggedObject enemyUnit in TagManager.instance.EnemyUnits)
+ {
+ if (!(Vector3.Distance(base.transform.position, enemyUnit.transform.position) <= preSelectRadius) || enemyUnit.Hp.PathfindMovement.IsSlowed)
+ {
+ continue;
+ }
+ overlapColliders = Physics.OverlapBox(base.transform.position, myCollider.size, base.transform.rotation, lmTakeDamage);
+ Collider[] array = overlapColliders;
+ for (int i = 0; i < array.Length; i++)
+ {
+ TaggedObject componentInParent = array[i].GetComponentInParent<TaggedObject>();
+ if (!componentInParent || !componentInParent.Tags.Contains(TagManager.ETag.EnemyOwned) || !componentInParent.Tags.Contains(TagManager.ETag.FastMoving))
+ {
+ continue;
+ }
+ Hp hp = componentInParent.Hp;
+ if (!hp)
+ {
+ continue;
+ }
+ PathfindMovement pathfindMovement = hp.PathfindMovement;
+ if ((bool)pathfindMovement && !pathfindMovement.IsSlowed)
+ {
+ if (!blacksmithUpgrades)
+ {
+ blacksmithUpgrades = BlacksmithUpgrades.instance;
+ }
+ float meleeDamage = blacksmithUpgrades.meleeDamage;
+ pathfindMovement.Slow(slowTime);
+ hp.TakeDamage(DamageModifyer.CalculateDamageOnTarget(componentInParent, damage, DamageMultiplyer * meleeDamage));
+ }
+ }
+ break;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BeforeGamePopUp.cs b/Thronefall_v1.57/Thronefall/Thronefall/BeforeGamePopUp.cs
new file mode 100644
index 0000000..0b10b92
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BeforeGamePopUp.cs
@@ -0,0 +1,15 @@
+using System;
+
+[Serializable]
+public class BeforeGamePopUp
+{
+ public UIFrame uiFrame;
+
+ public bool showInDemoVersion = true;
+
+ public bool showInFullVersion = true;
+
+ public bool onlyShowOnce;
+
+ public string identifier;
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BillboardAlign.cs b/Thronefall_v1.57/Thronefall/Thronefall/BillboardAlign.cs
new file mode 100644
index 0000000..480eb82
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BillboardAlign.cs
@@ -0,0 +1,18 @@
+using UnityEngine;
+
+public class BillboardAlign : MonoBehaviour
+{
+ public bool negativeZ = true;
+
+ private void Start()
+ {
+ if (negativeZ)
+ {
+ base.transform.forward = Camera.main.transform.forward;
+ }
+ else
+ {
+ base.transform.forward = Camera.main.transform.forward * -1f;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BlacksmithUpgrade.cs b/Thronefall_v1.57/Thronefall/Thronefall/BlacksmithUpgrade.cs
new file mode 100644
index 0000000..6d3b665
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BlacksmithUpgrade.cs
@@ -0,0 +1,161 @@
+using UnityEngine;
+
+public class BlacksmithUpgrade : MonoBehaviour, DayNightCycle.IDaytimeSensitive, ISaveLoad
+{
+ [SerializeField]
+ private BuildingInteractor buildingInteractor;
+
+ [SerializeField]
+ private ProductionBar productionBar;
+
+ [SerializeField]
+ private Weapon.EDamageAffectedByBlacksmithUpgrade upgrade;
+
+ [SerializeField]
+ private float multiplyer = 1.2f;
+
+ [SerializeField]
+ private int researchTime = 2;
+
+ [SerializeField]
+ private Equippable researchSpeedPerk;
+
+ private int researchTimeLeft;
+
+ private bool isInitializedForSaving;
+
+ private bool hasLoadedDataFromSave;
+
+ private bool bumpedResearchThisDawn;
+
+ private void Start()
+ {
+ if (!hasLoadedDataFromSave || researchTimeLeft > 0)
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ }
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ if (!base.gameObject.activeInHierarchy || bumpedResearchThisDawn)
+ {
+ return;
+ }
+ bumpedResearchThisDawn = true;
+ isInitializedForSaving = true;
+ if (!buildingInteractor.KnockedOutTonight)
+ {
+ researchTimeLeft--;
+ UpdateProgressBar();
+ if (researchTimeLeft <= 0)
+ {
+ productionBar.gameObject.SetActive(value: false);
+ buildingInteractor.showsHarvestDeniedCueEvenWithNoIncome = false;
+ ApplyUpgrade();
+ buildingInteractor.buildingIsCurrentlyBusyAndCantBeUpgraded = false;
+ buildingInteractor.UpdateInteractionState();
+ DayNightCycle.Instance.UnregisterDaytimeSensitiveObject(this);
+ }
+ }
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ private void ApplyUpgrade()
+ {
+ switch (upgrade)
+ {
+ case Weapon.EDamageAffectedByBlacksmithUpgrade.MultiplyBy_MeleeDamage:
+ BlacksmithUpgrades.instance.meleeDamage *= multiplyer;
+ break;
+ case Weapon.EDamageAffectedByBlacksmithUpgrade.MultiplyBy_RangedDamage:
+ BlacksmithUpgrades.instance.rangedDamage *= multiplyer;
+ break;
+ case Weapon.EDamageAffectedByBlacksmithUpgrade.DivideBy_MeleeResistance:
+ BlacksmithUpgrades.instance.meleeResistance *= multiplyer;
+ break;
+ case Weapon.EDamageAffectedByBlacksmithUpgrade.DivideBy_RangedResistance:
+ BlacksmithUpgrades.instance.rangedResistance *= multiplyer;
+ break;
+ }
+ }
+
+ public void OnDusk()
+ {
+ bumpedResearchThisDawn = false;
+ }
+
+ private void OnEnable()
+ {
+ ManualLoad(GetComponentInParent<SaveLoadEntity>().GUID);
+ if (!hasLoadedDataFromSave)
+ {
+ researchTimeLeft = researchTime;
+ if (PerkManager.IsEquipped(researchSpeedPerk))
+ {
+ researchTimeLeft--;
+ }
+ UpdateProgressBar();
+ buildingInteractor.buildingIsCurrentlyBusyAndCantBeUpgraded = true;
+ buildingInteractor.UpdateInteractionState();
+ }
+ }
+
+ private void UpdateProgressBar()
+ {
+ productionBar.gameObject.SetActive(value: true);
+ productionBar.UpdateVisual(1f - (float)researchTimeLeft / (float)researchTime + 0.075f);
+ buildingInteractor.showsHarvestDeniedCueEvenWithNoIncome = true;
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnSave(string guid)
+ {
+ if (isInitializedForSaving)
+ {
+ MatchSaveLoadHandler.SaveValue(guid, base.transform.parent.gameObject.name + "_" + base.gameObject.name + "_researchTimeLeft", researchTimeLeft);
+ }
+ }
+
+ private void ManualLoad(string guid)
+ {
+ if (!MatchSaveLoadHandler.IsLoadingPermitted)
+ {
+ return;
+ }
+ hasLoadedDataFromSave = MatchSaveLoadHandler.TryLoadValue(guid, base.transform.parent.gameObject.name + "_" + base.gameObject.name + "_researchTimeLeft", ref researchTimeLeft);
+ if (hasLoadedDataFromSave)
+ {
+ if (researchTimeLeft > 0)
+ {
+ UpdateProgressBar();
+ buildingInteractor.buildingIsCurrentlyBusyAndCantBeUpgraded = true;
+ buildingInteractor.UpdateInteractionState();
+ }
+ else
+ {
+ ApplyUpgrade();
+ buildingInteractor.UpdateInteractionState();
+ researchTimeLeft = -10;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BlacksmithUpgrades.cs b/Thronefall_v1.57/Thronefall/Thronefall/BlacksmithUpgrades.cs
new file mode 100644
index 0000000..def9eb5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BlacksmithUpgrades.cs
@@ -0,0 +1,43 @@
+using UnityEngine;
+
+public class BlacksmithUpgrades : MonoBehaviour
+{
+ public static BlacksmithUpgrades instance;
+
+ public float meleeDamage = 1f;
+
+ public float rangedDamage = 1f;
+
+ public float meleeResistance = 1f;
+
+ public float rangedResistance = 1f;
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ private void Start()
+ {
+ if (PerkManager.instance.MeleeResistenceActive)
+ {
+ meleeResistance *= PerkManager.instance.meleeResistence_AmountMulti;
+ }
+ if (PerkManager.instance.RangedResistenceActive)
+ {
+ rangedResistance *= PerkManager.instance.rangedResistence_AmountMulti;
+ }
+ if (PerkManager.instance.RangedDamageActive)
+ {
+ rangedDamage *= PerkManager.instance.rangedDamage_multi;
+ }
+ if (PerkManager.instance.MeleeDamageActive)
+ {
+ meleeDamage *= PerkManager.instance.meleeDamage_multi;
+ }
+ }
+
+ private void Update()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BlockProjectiles.cs b/Thronefall_v1.57/Thronefall/Thronefall/BlockProjectiles.cs
new file mode 100644
index 0000000..78cdb8a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BlockProjectiles.cs
@@ -0,0 +1,53 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class BlockProjectiles : MonoBehaviour
+{
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float blockInterval = 1f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float range = 30f;
+
+ [SerializeField]
+ private GameObject fxBlockProjectile;
+
+ private float cooldown;
+
+ private TagManager tagManager;
+
+ public List<TagManager.ETag> mustHaveTags = new List<TagManager.ETag>();
+
+ private List<TagManager.ETag> mayNotHaveTags = new List<TagManager.ETag>();
+
+ private void Start()
+ {
+ tagManager = TagManager.instance;
+ cooldown = Random.value * blockInterval;
+ }
+
+ private void Update()
+ {
+ cooldown -= Time.deltaTime;
+ while (cooldown <= 0f)
+ {
+ BlockAnArrow();
+ cooldown += blockInterval;
+ }
+ }
+
+ private void BlockAnArrow()
+ {
+ TaggedObject taggedObject = tagManager.FindClosestTaggedObjectWithTags(base.transform.position, mustHaveTags, mayNotHaveTags);
+ if (!(taggedObject == null) && (taggedObject.transform.position - base.transform.position).magnitude < range)
+ {
+ if ((bool)fxBlockProjectile)
+ {
+ Object.Instantiate(fxBlockProjectile, taggedObject.transform.position, Quaternion.identity);
+ }
+ Object.Destroy(taggedObject.gameObject);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BoatAnimation.cs b/Thronefall_v1.57/Thronefall/Thronefall/BoatAnimation.cs
new file mode 100644
index 0000000..d038afa
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BoatAnimation.cs
@@ -0,0 +1,37 @@
+using UnityEngine;
+
+public class BoatAnimation : MonoBehaviour
+{
+ private Vector3 startPosition;
+
+ private Quaternion startRotation;
+
+ private float time;
+
+ [SerializeField]
+ private AnimationCurve yOffset;
+
+ [SerializeField]
+ private AnimationCurve xRotation;
+
+ [SerializeField]
+ private AnimationCurve yRotation;
+
+ [SerializeField]
+ private AnimationCurve zRotation;
+
+ private void Start()
+ {
+ time = Random.value * 10000f;
+ startPosition = base.transform.position;
+ startRotation = base.transform.rotation;
+ }
+
+ private void Update()
+ {
+ time += Time.deltaTime;
+ Quaternion quaternion = Quaternion.Euler(xRotation.Evaluate(time), yRotation.Evaluate(time), zRotation.Evaluate(time));
+ base.transform.rotation = startRotation * quaternion;
+ base.transform.position = startPosition + Vector3.up * yOffset.Evaluate(time);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BonusLevelInteractor.cs b/Thronefall_v1.57/Thronefall/Thronefall/BonusLevelInteractor.cs
new file mode 100644
index 0000000..a059c94
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BonusLevelInteractor.cs
@@ -0,0 +1,192 @@
+using I2.Loc;
+using TMPro;
+using UnityEngine;
+
+public class BonusLevelInteractor : InteractorBase
+{
+ public static BonusLevelInteractor lastSelected;
+
+ public static LevelInfo lastActiveLevelInfo;
+
+ private LevelSelectManager levelSelectManager;
+
+ private LevelProgressManager levelProgressManager;
+
+ private LevelData myLevelData;
+
+ [Header("Setup")]
+ [SerializeField]
+ private string tooltipThisLevelMustBeBeaten = "Beat <lvlname> to unlock this level.";
+
+ [SerializeField]
+ private GameObject focusPanel;
+
+ [SerializeField]
+ private GameObject cantBePlayedPanel;
+
+ [SerializeField]
+ private TextMeshProUGUI cantBePlayedCue;
+
+ [SerializeField]
+ private GameObject lockedLevelVisuals;
+
+ [SerializeField]
+ private GameObject unlockedLevelVisuals;
+
+ [SerializeField]
+ private GameObject beatenLevelVisuals;
+
+ [SerializeField]
+ private TMP_Text questsComplete;
+
+ [SerializeField]
+ private TextMeshProUGUI challengeName;
+
+ public LevelInfo[] levelsToPick;
+
+ [Header("Level Info")]
+ public LevelInfo baseLevelInfo;
+
+ public LevelInfo levelToBeatToUnlock;
+
+ [Header("Colors")]
+ [SerializeField]
+ private Color allQuestComplete;
+
+ [SerializeField]
+ private Color notAllQuestComplete;
+
+ public bool CanBePlayed
+ {
+ get
+ {
+ if (levelToBeatToUnlock != null && !levelToBeatToUnlock.Beaten)
+ {
+ return false;
+ }
+ return true;
+ }
+ }
+
+ public string CanNotBePlayedReason
+ {
+ get
+ {
+ if ((bool)levelToBeatToUnlock && !levelToBeatToUnlock.Beaten)
+ {
+ return tooltipThisLevelMustBeBeaten.Replace("<lvlname>", levelToBeatToUnlock.displayName);
+ }
+ return "";
+ }
+ }
+
+ public void UpdateVisualsOnStart()
+ {
+ if (myLevelData == null)
+ {
+ levelProgressManager = LevelProgressManager.instance;
+ myLevelData = levelProgressManager.GetLevelDataForScene(baseLevelInfo.sceneName);
+ }
+ lockedLevelVisuals.SetActive(value: false);
+ unlockedLevelVisuals.SetActive(value: false);
+ beatenLevelVisuals.SetActive(value: false);
+ questsComplete.transform.parent.gameObject.SetActive(value: false);
+ int num = 0;
+ int num2 = 0;
+ LevelInfo[] array = levelsToPick;
+ foreach (LevelInfo levelInfo in array)
+ {
+ num += levelInfo.QuestsTotal();
+ num2 += levelInfo.QuestsComplete();
+ }
+ questsComplete.text = num2 + "/" + num;
+ questsComplete.color = ((num2 >= num) ? allQuestComplete : notAllQuestComplete);
+ if (challengeName != null)
+ {
+ challengeName.text = LocalizationManager.GetTermTranslation("Menu/Bonus Modes");
+ }
+ if (!CanBePlayed)
+ {
+ lockedLevelVisuals.SetActive(value: true);
+ return;
+ }
+ if (num2 >= num)
+ {
+ beatenLevelVisuals.SetActive(value: true);
+ }
+ else
+ {
+ unlockedLevelVisuals.SetActive(value: true);
+ }
+ questsComplete.transform.parent.gameObject.SetActive(value: true);
+ }
+
+ private void Start()
+ {
+ levelSelectManager = GetComponentInParent<LevelSelectManager>();
+ levelProgressManager = LevelProgressManager.instance;
+ myLevelData = levelProgressManager.GetLevelDataForScene(baseLevelInfo.sceneName);
+ focusPanel.SetActive(value: false);
+ cantBePlayedPanel.SetActive(value: false);
+ UpdateVisualsOnStart();
+ }
+
+ public override string ReturnTooltip()
+ {
+ if (CanBePlayed)
+ {
+ return TextTranslator.Translate("Menu/Level Interactor Cue");
+ }
+ return "";
+ }
+
+ private string GenerateCueText()
+ {
+ if (!CanBePlayed)
+ {
+ return CanNotBePlayedReason;
+ }
+ if (levelSelectManager.PreLevelMenuIsOpen)
+ {
+ return "";
+ }
+ return baseLevelInfo.displayName;
+ }
+
+ public override void InteractionBegin(PlayerInteraction _player)
+ {
+ if (CanBePlayed)
+ {
+ lastSelected = this;
+ lastActiveLevelInfo = baseLevelInfo;
+ UIFrameManager.TryOpenBonusLevelSelect();
+ }
+ }
+
+ public override void Focus(PlayerInteraction _player)
+ {
+ if (CanBePlayed)
+ {
+ focusPanel.SetActive(value: true);
+ cantBePlayedPanel.SetActive(value: false);
+ if (challengeName != null)
+ {
+ challengeName.text = LocalizationManager.GetTermTranslation("Menu/Bonus Modes");
+ }
+ return;
+ }
+ cantBePlayedCue.text = GenerateCueText();
+ cantBePlayedPanel.SetActive(value: true);
+ focusPanel.SetActive(value: false);
+ if (challengeName != null)
+ {
+ challengeName.text = LocalizationManager.GetTermTranslation("Menu/Bonus Modes");
+ }
+ }
+
+ public override void Unfocus(PlayerInteraction _player)
+ {
+ focusPanel.SetActive(value: false);
+ cantBePlayedPanel.SetActive(value: false);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BuildSlot.cs b/Thronefall_v1.57/Thronefall/Thronefall/BuildSlot.cs
new file mode 100644
index 0000000..f80c273
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BuildSlot.cs
@@ -0,0 +1,830 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using Pathfinding;
+using UnityEngine;
+using UnityEngine.Events;
+
+[SelectionBase]
+public class BuildSlot : MonoBehaviour, DayNightCycle.IDaytimeSensitive, ISaveLoad
+{
+ public enum BuildingState
+ {
+ Blueprint,
+ Built
+ }
+
+ [Serializable]
+ public class Upgrade
+ {
+ public string upgradeTooltip;
+
+ [Min(0f)]
+ public int cost = 3;
+
+ public List<UpgradeBranch> upgradeBranches;
+ }
+
+ [Serializable]
+ public class UpgradeBranch
+ {
+ [Tooltip("Only necessary when there are multiple options:")]
+ public Choice choiceDetails;
+
+ public Mesh replacementMesh;
+
+ public int goldIncomeChange;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public int hpChange;
+
+ public List<GameObject> objectsToActivate = new List<GameObject>();
+
+ public List<GameObject> objectsToDisable = new List<GameObject>();
+ }
+
+ public string buildingName;
+
+ [Tooltip("The root is the required parent object no arrow points to, so this is pretty much always gonna be the casle center.E.g. this is set to 0 this building can not have a higher level than the castle center level.")]
+ [SerializeField]
+ private int requiredRootLevelDifference = -100;
+
+ private BuildSlot requiredRoot;
+
+ private List<BuildSlot> isRootOf = new List<BuildSlot>();
+
+ private List<BuildSlot> isActivatorOf = new List<BuildSlot>();
+
+ [SerializeField]
+ private bool startDeactivated = true;
+
+ [SerializeField]
+ private BuildSlot activatorBuilding;
+
+ [Min(0f)]
+ [SerializeField]
+ private int activatorLevel;
+
+ [SerializeField]
+ private bool activatorUpgradesThis;
+
+ public List<Upgrade> upgrades = new List<Upgrade>();
+
+ private int level;
+
+ private List<int> appliedUpgrades = new List<int>();
+
+ [HideInInspector]
+ public UnityEvent OnAfterDelayedLoadFinished = new UnityEvent();
+
+ private Hp hpParent;
+
+ [SerializeField]
+ private GameObject buildingParent;
+
+ [SerializeField]
+ private GameObject bluepringParent;
+
+ [SerializeField]
+ private BuildingInteractor interactor;
+
+ [SerializeField]
+ private MeshFilter mainMesh;
+
+ [SerializeField]
+ private BoxCollider mainCollider;
+
+ [SerializeField]
+ private BoxCollider damageCollider;
+
+ [SerializeField]
+ private BoxCollider interactorCollider;
+
+ [SerializeField]
+ private NavmeshCut navmeshCut;
+
+ public bool hideGizmos;
+
+ public float navmeshCutPadding = 1f;
+
+ public BuildingMeshTracker buildingMeshTracker;
+
+ [HideInInspector]
+ public BuildingInteractor buildingInteractor;
+
+ private int goldIncome;
+
+ private List<Upgrade> upgradesWithCostsLoadedFromSave = new List<Upgrade>();
+
+ [HideInInspector]
+ public UnityEvent OnUpgrade = new UnityEvent();
+
+ [HideInInspector]
+ public UnityEvent OnParentUpgrade = new UnityEvent();
+
+ [HideInInspector]
+ public UnityEvent OnUpgradeCancel = new UnityEvent();
+
+ private List<BuildSlot> builtSlotsThatRelyOnThisBuilding = new List<BuildSlot>();
+
+ private bool gotActivated;
+
+ private Upgrade upgradeSelected;
+
+ private PlayerInteraction playerInteractionSelected;
+
+ public string LOCIDENTIFIER_NAME => "Building/" + buildingName;
+
+ public int RequiredRootLevelDifference => requiredRootLevelDifference;
+
+ public List<BuildSlot> IsRootOf => isRootOf;
+
+ public List<BuildSlot> IsActivatorOf => isActivatorOf;
+
+ public BuildSlot ActivatorBuilding => activatorBuilding;
+
+ public bool StartDeactivated
+ {
+ get
+ {
+ return startDeactivated;
+ }
+ set
+ {
+ startDeactivated = value;
+ }
+ }
+
+ public int ActivatorLevel
+ {
+ get
+ {
+ return activatorLevel;
+ }
+ set
+ {
+ activatorLevel = value;
+ }
+ }
+
+ public bool ActivatorUpgradesThis => activatorUpgradesThis;
+
+ public List<Upgrade> Upgrades
+ {
+ get
+ {
+ if (!activatorUpgradesThis)
+ {
+ return upgrades;
+ }
+ return activatorBuilding.Upgrades;
+ }
+ }
+
+ public List<Upgrade> OwnUpgrades => upgrades;
+
+ public int Level
+ {
+ get
+ {
+ if (!activatorUpgradesThis)
+ {
+ return level;
+ }
+ return activatorBuilding.Level;
+ }
+ }
+
+ public List<int> AppliedUpgrades => appliedUpgrades;
+
+ private Hp HpParent
+ {
+ get
+ {
+ if (!hpParent && (bool)buildingParent)
+ {
+ hpParent = buildingParent.GetComponent<Hp>();
+ }
+ return hpParent;
+ }
+ }
+
+ public BuildingInteractor Interactor => interactor;
+
+ public MeshFilter MainMesh => mainMesh;
+
+ public ReadOnlyCollection<Upgrade> UpgradesWithCostsLoadedFromSave => upgradesWithCostsLoadedFromSave.AsReadOnly();
+
+ public BuildingState State
+ {
+ get
+ {
+ if (level < 1)
+ {
+ return BuildingState.Blueprint;
+ }
+ return BuildingState.Built;
+ }
+ }
+
+ public int GoldIncome
+ {
+ get
+ {
+ return goldIncome;
+ }
+ set
+ {
+ goldIncome = value;
+ }
+ }
+
+ public bool CanBeUpgraded
+ {
+ get
+ {
+ if (activatorUpgradesThis)
+ {
+ return activatorBuilding.CanBeUpgraded;
+ }
+ if (requiredRoot == null)
+ {
+ return level < upgrades.Count;
+ }
+ if (level < upgrades.Count)
+ {
+ if (requiredRoot.Level <= level + requiredRootLevelDifference && level != 0)
+ {
+ return requiredRoot.Level >= 3;
+ }
+ return true;
+ }
+ return false;
+ }
+ }
+
+ public bool NextUpgradeIsChoice
+ {
+ get
+ {
+ if (CanBeUpgraded)
+ {
+ return upgrades[level].upgradeBranches.Count > 1;
+ }
+ return false;
+ }
+ }
+
+ public int NextUpgradeOrBuildCost
+ {
+ get
+ {
+ if (activatorUpgradesThis)
+ {
+ return activatorBuilding.NextUpgradeOrBuildCost;
+ }
+ if (CanBeUpgraded)
+ {
+ return upgrades[level].cost;
+ }
+ return 100;
+ }
+ set
+ {
+ if (activatorUpgradesThis)
+ {
+ activatorBuilding.NextUpgradeOrBuildCost = value;
+ }
+ if (CanBeUpgraded)
+ {
+ upgrades[level].cost = value;
+ }
+ }
+ }
+
+ public GameObject BuildingParent => buildingParent;
+
+ private bool IsBlueprint => level == 0;
+
+ public List<BuildSlot> BuiltSlotsThatRelyOnThisBuilding => builtSlotsThatRelyOnThisBuilding;
+
+ public string GET_LOCIDENTIFIER_UPGRADE(int upgradeNumber)
+ {
+ return LOCIDENTIFIER_NAME + " Upgrade " + upgradeNumber;
+ }
+
+ public string GET_LOCIDENTIFIER_CHOICENAME(Choice choice)
+ {
+ return LOCIDENTIFIER_NAME + " Choice " + choice.name;
+ }
+
+ public string GET_LOCIDENTIFIER_CHOICEDESCRIPTION(Choice choice)
+ {
+ return GET_LOCIDENTIFIER_CHOICENAME(choice) + " Description";
+ }
+
+ public void SetActivatorBuilding(BuildSlot _bs)
+ {
+ activatorBuilding = _bs;
+ }
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ if (MatchSaveLoadHandler.TryLoadValue(guid, "level", ref level))
+ {
+ startDeactivated = false;
+ }
+ int[] value = new int[0];
+ MatchSaveLoadHandler.TryLoadValue(guid, "appliedUpgrades", ref value);
+ if (value.Length != 0)
+ {
+ appliedUpgrades = new List<int>(value);
+ }
+ int value2 = 0;
+ MatchSaveLoadHandler.TryLoadValue(guid, "NextUpgradeOrBuildCost", ref value2);
+ if (value2 != 0 && level < upgrades.Count)
+ {
+ upgrades[level].cost = value2;
+ upgradesWithCostsLoadedFromSave.Add(upgrades[level]);
+ }
+ StartCoroutine(ApplyLoadedUpgradesDelayed());
+ }
+
+ private IEnumerator ApplyLoadedUpgradesDelayed()
+ {
+ yield return null;
+ for (int i = 0; i < appliedUpgrades.Count; i++)
+ {
+ ApplyLocalUpgradeChanges(upgrades[i].upgradeBranches[appliedUpgrades[i]], isLoadingFromSavedata: true);
+ }
+ OnAfterDelayedLoadFinished.Invoke();
+ }
+
+ public void OnSave(string guid)
+ {
+ MatchSaveLoadHandler.SaveValue(guid, "level", level);
+ MatchSaveLoadHandler.SaveValue(guid, "appliedUpgrades", appliedUpgrades.ToArray());
+ if (level < upgrades.Count)
+ {
+ MatchSaveLoadHandler.SaveValue(guid, "NextUpgradeOrBuildCost", upgrades[level].cost);
+ }
+ }
+
+ public string ReturnTooltip()
+ {
+ if (!CanBeUpgraded)
+ {
+ return "";
+ }
+ string text = ((level <= 0) ? TextTranslator.Translate("Tooltip/Build") : TextTranslator.Translate("Tooltip/Upgrade Building"));
+ string text2 = "<style=\"Tooltip Header\">" + text + " " + TextTranslator.Translate(LOCIDENTIFIER_NAME) + ":\n";
+ text2 = text2 + "<style=\"Tooltip Default\">" + TextTranslator.Translate(GET_LOCIDENTIFIER_UPGRADE(level)) + "\n";
+ text2 += "<style=\"Tooltip Numerals\">";
+ int num = 0;
+ Hp componentInChildren = GetComponentInChildren<Hp>(includeInactive: true);
+ if ((bool)componentInChildren)
+ {
+ num = (int)componentInChildren.maxHp;
+ }
+ List<int> list = new List<int>();
+ List<int> list2 = new List<int>();
+ foreach (UpgradeBranch upgradeBranch in upgrades[level].upgradeBranches)
+ {
+ int item = goldIncome + upgradeBranch.goldIncomeChange;
+ if (!list.Contains(item))
+ {
+ list.Add(item);
+ }
+ int item2 = num + upgradeBranch.hpChange;
+ if (!list2.Contains(item2))
+ {
+ list2.Add(item2);
+ }
+ }
+ list2.Sort();
+ list.Sort();
+ string text3 = "";
+ string text4 = "";
+ for (int i = 0; i < list.Count; i++)
+ {
+ if (i > 0)
+ {
+ text3 += "/";
+ }
+ text3 += list[i];
+ }
+ for (int j = 0; j < list2.Count; j++)
+ {
+ if (j > 0)
+ {
+ text4 += "/";
+ }
+ text4 += list2[j];
+ }
+ if (level > 0)
+ {
+ text2 = ((list2.Count <= 1 && list2[0] == num) ? (text2 + "\n" + num + "<sprite name=\"heart\">") : (text2 + "\n" + num + "<sprite name=\"heart\"> <sprite name=\"arrow_right\"> " + text4 + "<sprite name=\"heart\">"));
+ if (list.Count > 1 || list[0] != goldIncome)
+ {
+ return text2 + "\n" + goldIncome + "<sprite name=\"coin\"> <sprite name=\"arrow_right\"> " + text3 + "<sprite name=\"coin\">";
+ }
+ return text2 + "\n" + goldIncome + "<sprite name=\"coin\">";
+ }
+ text2 = ((list2.Count <= 1 && list2[0] == num) ? (text2 + "\n<sprite name=\"arrow_right\"> " + num + "<sprite name=\"heart\">") : (text2 + "\n<sprite name=\"arrow_right\"> " + text4 + "<sprite name=\"heart\">"));
+ if (list.Count > 1 || list[0] != goldIncome)
+ {
+ return text2 + "\n<sprite name=\"arrow_right\"> " + text3 + "<sprite name=\"coin\">";
+ }
+ return text2 + "\n<sprite name=\"arrow_right\"> " + goldIncome + "<sprite name=\"coin\">";
+ }
+
+ private void OnEnable()
+ {
+ foreach (Upgrade upgrade in upgrades)
+ {
+ foreach (UpgradeBranch upgradeBranch in upgrade.upgradeBranches)
+ {
+ foreach (GameObject item in upgradeBranch.objectsToActivate)
+ {
+ if ((bool)item)
+ {
+ item.SetActive(value: false);
+ }
+ }
+ }
+ }
+ }
+
+ public List<BuildSlot> GetBuildSlotsThatWillUnlockWhenUpgraded()
+ {
+ List<BuildSlot> list = new List<BuildSlot>();
+ for (int i = 0; i < builtSlotsThatRelyOnThisBuilding.Count; i++)
+ {
+ if (builtSlotsThatRelyOnThisBuilding[i].activatorLevel == level)
+ {
+ list.Add(builtSlotsThatRelyOnThisBuilding[i]);
+ }
+ }
+ return list;
+ }
+
+ public List<MeshFilter> GetBlueprintPreviewsThatWillUnlockWhenUpgraded()
+ {
+ List<MeshFilter> list = new List<MeshFilter>();
+ for (int i = 0; i < builtSlotsThatRelyOnThisBuilding.Count; i++)
+ {
+ if (builtSlotsThatRelyOnThisBuilding[i].activatorLevel == level)
+ {
+ if (builtSlotsThatRelyOnThisBuilding[i].State == BuildingState.Built || builtSlotsThatRelyOnThisBuilding[i].activatorUpgradesThis)
+ {
+ MeshFilter[] componentsInChildren = builtSlotsThatRelyOnThisBuilding[i].buildingParent.GetComponentsInChildren<MeshFilter>();
+ list.AddRange(componentsInChildren);
+ }
+ else
+ {
+ MeshFilter[] componentsInChildren2 = builtSlotsThatRelyOnThisBuilding[i].bluepringParent.GetComponentsInChildren<MeshFilter>();
+ list.AddRange(componentsInChildren2);
+ }
+ }
+ }
+ return list;
+ }
+
+ public List<GameObject> GetGameObjectsThatWillUnlockWhenUpgraded(int _upgradeBranch)
+ {
+ if (level >= upgrades.Count)
+ {
+ return new List<GameObject>();
+ }
+ return upgrades[level].upgradeBranches[_upgradeBranch % upgrades[level].upgradeBranches.Count].objectsToActivate;
+ }
+
+ private void Start()
+ {
+ requiredRoot = this;
+ if ((bool)activatorBuilding)
+ {
+ activatorBuilding.isActivatorOf.Add(this);
+ }
+ while (requiredRoot.activatorBuilding != null)
+ {
+ requiredRoot = requiredRoot.activatorBuilding;
+ }
+ if (requiredRoot != this)
+ {
+ requiredRoot.isRootOf.Add(this);
+ }
+ if ((bool)activatorBuilding)
+ {
+ activatorBuilding.builtSlotsThatRelyOnThisBuilding.Add(this);
+ }
+ if (startDeactivated)
+ {
+ base.gameObject.SetActive(value: false);
+ if ((bool)activatorBuilding)
+ {
+ activatorBuilding.OnUpgrade.AddListener(Activate);
+ }
+ }
+ else
+ {
+ Activate();
+ }
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ }
+
+ public void Activate()
+ {
+ if (!gotActivated && (!startDeactivated || activatorBuilding.Level > activatorLevel))
+ {
+ gotActivated = true;
+ base.gameObject.SetActive(value: true);
+ ActivateOrDeactivateBuliding(State);
+ }
+ }
+
+ private void ActivateOrDeactivateBuliding(BuildingState nextState)
+ {
+ switch (nextState)
+ {
+ case BuildingState.Blueprint:
+ if ((bool)buildingParent)
+ {
+ buildingParent.SetActive(value: false);
+ }
+ if ((bool)bluepringParent)
+ {
+ bluepringParent.SetActive(value: true);
+ }
+ break;
+ case BuildingState.Built:
+ if ((bool)buildingParent)
+ {
+ buildingParent.SetActive(value: true);
+ }
+ if ((bool)bluepringParent)
+ {
+ bluepringParent.SetActive(value: false);
+ }
+ break;
+ }
+ }
+
+ public void TryToBuildOrUpgradeAndPay(PlayerInteraction player, bool _presentChoice = true)
+ {
+ if (!CanBeUpgraded)
+ {
+ return;
+ }
+ if (activatorUpgradesThis)
+ {
+ activatorBuilding.TryToBuildOrUpgradeAndPay(player, _presentChoice);
+ return;
+ }
+ for (int i = 0; i < builtSlotsThatRelyOnThisBuilding.Count; i++)
+ {
+ BuildSlot buildSlot = builtSlotsThatRelyOnThisBuilding[i];
+ if (buildSlot.ActivatorUpgradesThis && buildSlot.activatorBuilding == this)
+ {
+ buildSlot.gameObject.SetActive(value: true);
+ buildSlot.ExecuteBuildOrUpgrade(player, _presentChoice: false);
+ }
+ }
+ ExecuteBuildOrUpgrade(player, _presentChoice);
+ for (int j = 0; j < builtSlotsThatRelyOnThisBuilding.Count; j++)
+ {
+ BuildSlot buildSlot2 = builtSlotsThatRelyOnThisBuilding[j];
+ if ((bool)buildSlot2.buildingInteractor)
+ {
+ buildSlot2.buildingInteractor.UpdateInteractionState();
+ }
+ }
+ if ((bool)buildingInteractor)
+ {
+ buildingInteractor.UpdateInteractionState();
+ }
+ }
+
+ public void ExecuteBuildOrUpgrade(PlayerInteraction _player, bool _presentChoice)
+ {
+ if (CanBeUpgraded)
+ {
+ ExecuteUpgrade(upgrades[level], _player, _presentChoice);
+ }
+ }
+
+ private void ExecuteUpgrade(Upgrade _upg, PlayerInteraction _player, bool _presentChoice)
+ {
+ if (ChoiceManager.instance.ChoiceCoroutineRunning)
+ {
+ return;
+ }
+ List<Choice> list = new List<Choice>();
+ foreach (UpgradeBranch upgradeBranch in _upg.upgradeBranches)
+ {
+ list.Add(upgradeBranch.choiceDetails);
+ }
+ upgradeSelected = _upg;
+ playerInteractionSelected = _player;
+ if (_presentChoice)
+ {
+ ChoiceManager.instance.PresentChoices(list, this, OnUpgradeChoiceComplete);
+ }
+ else
+ {
+ OnUpgradeChoiceComplete(_upg.upgradeBranches[UnityEngine.Random.Range(0, _upg.upgradeBranches.Count)].choiceDetails);
+ }
+ }
+
+ public void OnUpgradeChoiceComplete(Choice _choiceMade)
+ {
+ if (_choiceMade == null)
+ {
+ OnUpgradeCancel.Invoke();
+ return;
+ }
+ if (level == 0)
+ {
+ ActivateOrDeactivateBuliding(BuildingState.Built);
+ }
+ level++;
+ UpgradeBranch upgBranch = null;
+ int num = 0;
+ foreach (UpgradeBranch upgradeBranch in upgradeSelected.upgradeBranches)
+ {
+ if (upgradeBranch.choiceDetails == _choiceMade)
+ {
+ upgBranch = upgradeBranch;
+ appliedUpgrades.Add(num);
+ }
+ num++;
+ }
+ ApplyLocalUpgradeChanges(upgBranch);
+ foreach (BuildSlot item in isRootOf)
+ {
+ if (item == null)
+ {
+ continue;
+ }
+ BuildingInteractor[] componentsInChildren = item.GetComponentsInChildren<BuildingInteractor>();
+ foreach (BuildingInteractor buildingInteractor in componentsInChildren)
+ {
+ if (!(buildingInteractor == null))
+ {
+ buildingInteractor.UpdateInteractionState();
+ }
+ }
+ }
+ if (activatorUpgradesThis)
+ {
+ OnParentUpgrade.Invoke();
+ return;
+ }
+ OnUpgrade.Invoke();
+ TooltipManager.instance.SetInteractorRefreshFlag();
+ }
+
+ public void ForceManualUpgradeWithoutFeedbackEffects(UpgradeBranch upgBranch)
+ {
+ if (upgBranch == null)
+ {
+ OnUpgradeCancel.Invoke();
+ return;
+ }
+ if (level == 0)
+ {
+ ActivateOrDeactivateBuliding(BuildingState.Built);
+ }
+ level++;
+ ApplyLocalUpgradeChanges(upgBranch);
+ foreach (BuildSlot item in isRootOf)
+ {
+ if (item == null)
+ {
+ continue;
+ }
+ BuildingInteractor[] componentsInChildren = item.GetComponentsInChildren<BuildingInteractor>();
+ foreach (BuildingInteractor buildingInteractor in componentsInChildren)
+ {
+ if (!(buildingInteractor == null))
+ {
+ buildingInteractor.UpdateInteractionState();
+ }
+ }
+ }
+ foreach (BuildSlot item2 in isActivatorOf)
+ {
+ item2.Activate();
+ }
+ int num = upgrades[level - 1].upgradeBranches.FindIndex((UpgradeBranch c) => c == upgBranch);
+ if (num == -1)
+ {
+ num = 0;
+ }
+ appliedUpgrades.Add(num);
+ if (!activatorUpgradesThis)
+ {
+ TooltipManager.instance.SetInteractorRefreshFlag();
+ }
+ }
+
+ public void ApplyLocalUpgradeChanges(UpgradeBranch upgBranch, bool isLoadingFromSavedata = false)
+ {
+ if (upgBranch == null)
+ {
+ return;
+ }
+ buildingMeshTracker.Unfreeze();
+ buildingMeshTracker.FreezeMeshWithDelay();
+ if (upgBranch.replacementMesh != null)
+ {
+ mainMesh.mesh = upgBranch.replacementMesh;
+ }
+ goldIncome += upgBranch.goldIncomeChange;
+ if ((bool)HpParent && !isLoadingFromSavedata)
+ {
+ if (HpParent.HpValue <= 0f && level > 1)
+ {
+ HpParent.Revive();
+ HpParent.SetHpTo(1f);
+ }
+ HpParent.maxHp += upgBranch.hpChange;
+ HpParent.Heal(upgBranch.hpChange);
+ if ((bool)HpParent.TaggedObj)
+ {
+ HpParent.TaggedObj.RemoveTag(TagManager.ETag.AUTO_NoReviveNextMorning);
+ }
+ }
+ else if ((bool)HpParent)
+ {
+ HpParent.maxHp += upgBranch.hpChange;
+ HpParent.OnHpChange.Invoke();
+ }
+ foreach (GameObject item in upgBranch.objectsToActivate)
+ {
+ if (item != null)
+ {
+ item.SetActive(value: true);
+ }
+ }
+ foreach (GameObject item2 in upgBranch.objectsToDisable)
+ {
+ if (item2 != null)
+ {
+ item2.SetActive(value: false);
+ }
+ }
+ }
+
+ public void ReplaceMeshExternal(Mesh replacement)
+ {
+ buildingMeshTracker.Unfreeze();
+ buildingMeshTracker.FreezeMeshWithDelay();
+ mainMesh.mesh = replacement;
+ }
+
+ public void DEBUGUpgradeToMax()
+ {
+ while (CanBeUpgraded)
+ {
+ TryToBuildOrUpgradeAndPay(null, _presentChoice: false);
+ }
+ if ((bool)interactor)
+ {
+ interactor.UpdateInteractionState();
+ }
+ }
+
+ public void OnDusk()
+ {
+ if (IsBlueprint && (bool)bluepringParent)
+ {
+ bluepringParent.SetActive(value: false);
+ }
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ if (IsBlueprint && (bool)bluepringParent)
+ {
+ bluepringParent.SetActive(value: true);
+ }
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BuildingDestructionHandler.cs b/Thronefall_v1.57/Thronefall/Thronefall/BuildingDestructionHandler.cs
new file mode 100644
index 0000000..d03a975
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BuildingDestructionHandler.cs
@@ -0,0 +1,62 @@
+using UnityEngine;
+
+public class BuildingDestructionHandler : MonoBehaviour
+{
+ public bool shakeCamera;
+
+ public MeshRenderer mainMesh;
+
+ public ParticleSystem debrisParticles;
+
+ public ParticleSystem smokeParticles;
+
+ public AudioSource destructionSource;
+
+ public float destructionPitchRange = 0.2f;
+
+ private ParticleSystem.ShapeModule debrisShape;
+
+ private ParticleSystem.ShapeModule smokeShape;
+
+ private float debrisPlaytime = 5f;
+
+ private float debrisClock;
+
+ private void Awake()
+ {
+ debrisShape = debrisParticles.shape;
+ smokeShape = smokeParticles.shape;
+ }
+
+ private void OnEnable()
+ {
+ if (shakeCamera && (bool)CameraController.instance)
+ {
+ CameraController.instance.ShakePunch();
+ }
+ debrisParticles.transform.position = mainMesh.transform.position;
+ debrisParticles.transform.rotation = mainMesh.transform.rotation;
+ smokeParticles.transform.position = mainMesh.transform.position;
+ smokeParticles.transform.rotation = mainMesh.transform.rotation;
+ debrisShape.scale = mainMesh.localBounds.size;
+ debrisShape.position = mainMesh.localBounds.center;
+ smokeShape.scale = mainMesh.localBounds.size;
+ smokeShape.position = mainMesh.localBounds.center;
+ debrisClock = 0f;
+ debrisParticles.Play();
+ destructionSource.pitch = Random.Range(1f - destructionPitchRange, 1f + destructionPitchRange);
+ destructionSource.Play();
+ }
+
+ private void Update()
+ {
+ if (debrisParticles.isPlaying)
+ {
+ debrisClock += Time.deltaTime;
+ if (debrisClock >= debrisPlaytime)
+ {
+ debrisParticles.Pause();
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BuildingFXProcessor.cs b/Thronefall_v1.57/Thronefall/Thronefall/BuildingFXProcessor.cs
new file mode 100644
index 0000000..05ab937
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BuildingFXProcessor.cs
@@ -0,0 +1,65 @@
+using System.Collections;
+using MoreMountains.Feedbacks;
+using UnityEngine;
+
+public class BuildingFXProcessor : MonoBehaviour
+{
+ public BuildSlot targetBuilding;
+
+ public Hp targetHp;
+
+ public MMF_Player onBuildFX;
+
+ public MMF_Player onParentBuildFX;
+
+ public MMF_Player onUpgradeFX;
+
+ public MMF_Player onParentUpgradeFX;
+
+ public MMF_Player onReviveFX;
+
+ private void Start()
+ {
+ targetBuilding.OnUpgrade.AddListener(OnBuildingUpgrade);
+ targetBuilding.OnParentUpgrade.AddListener(OnParentBuildingUpgrade);
+ if ((bool)targetHp)
+ {
+ targetHp.OnRevive.AddListener(OnBuildingRevive);
+ }
+ }
+
+ private void OnBuildingUpgrade()
+ {
+ if (targetBuilding.Level == 1)
+ {
+ onBuildFX.PlayFeedbacks();
+ }
+ else if (targetBuilding.Level > 1)
+ {
+ onUpgradeFX.PlayFeedbacks();
+ }
+ }
+
+ private void OnParentBuildingUpgrade()
+ {
+ StartCoroutine(PlayDelayedParentUpgradeFeedback());
+ }
+
+ private IEnumerator PlayDelayedParentUpgradeFeedback()
+ {
+ yield return null;
+ if (targetBuilding.Level == 1)
+ {
+ onParentBuildFX.PlayFeedbacks();
+ }
+ else if (targetBuilding.Level > 1)
+ {
+ onParentUpgradeFX.PlayFeedbacks();
+ }
+ }
+
+ private void OnBuildingRevive()
+ {
+ onReviveFX.PlayFeedbacks();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BuildingInteractor.cs b/Thronefall_v1.57/Thronefall/Thronefall/BuildingInteractor.cs
new file mode 100644
index 0000000..51c3fc5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BuildingInteractor.cs
@@ -0,0 +1,500 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class BuildingInteractor : InteractorBase, DayNightCycle.IDaytimeSensitive, ISaveLoad
+{
+ public enum InteractionState
+ {
+ None,
+ Harvest,
+ Upgrade
+ }
+
+ public static bool displayAllBuildPreviews;
+
+ public BuildSlot targetBuilding;
+
+ public Hp buildingHP;
+
+ public CoinSpawner coinSpawner;
+
+ public GameObject harvestCue;
+
+ public GameObject harvestDeniedCue;
+
+ public GameObject upgradeCue;
+
+ public CostDisplay costDisplay;
+
+ public Material previewMaterial;
+
+ public bool showsHarvestDeniedCueEvenWithNoIncome;
+
+ private List<IncomeModifyer> incomeModifiers = new List<IncomeModifyer>();
+
+ private InteractionState currentState;
+
+ private bool knockedOutTonight;
+
+ private bool harvestedToday;
+
+ private bool focussed;
+
+ private Mesh upgradePreviewMesh;
+
+ private bool interactionComplete;
+
+ private bool interactionStarted;
+
+ private bool isWaitingForChoice;
+
+ private PlayerInteraction bufferedPlayer;
+
+ public bool buildingIsCurrentlyBusyAndCantBeUpgraded;
+
+ public static int CurrentUpgradePreviewBranchNumber
+ {
+ get
+ {
+ if ((bool)ChoiceManager.instance && ChoiceManager.instance.ChoiceCoroutineRunning)
+ {
+ return ChoiceUIFrameHelper.CurrentSelectionIndex;
+ }
+ return Mathf.RoundToInt(Time.time * 2f);
+ }
+ }
+
+ public List<IncomeModifyer> IncomeModifiers => incomeModifiers;
+
+ public bool KnockedOutTonight => knockedOutTonight;
+
+ public bool canBeHarvested
+ {
+ get
+ {
+ if (targetBuilding.State == BuildSlot.BuildingState.Built && !harvestedToday && targetBuilding.GoldIncome > 0)
+ {
+ return !knockedOutTonight;
+ }
+ return false;
+ }
+ }
+
+ public bool harvestIsDenied
+ {
+ get
+ {
+ if (targetBuilding.State == BuildSlot.BuildingState.Built && (targetBuilding.GoldIncome > 0 || showsHarvestDeniedCueEvenWithNoIncome))
+ {
+ return knockedOutTonight;
+ }
+ return false;
+ }
+ }
+
+ public int GoldIncome => targetBuilding.GoldIncome;
+
+ public bool Focussed => focussed;
+
+ public bool HarvestCueVisible => harvestCue.activeSelf;
+
+ public bool UpgradeCueVisible => upgradeCue.activeSelf;
+
+ public override bool CanBeInteractedWith => currentState != InteractionState.None;
+
+ public bool IsWaitingForChoice => isWaitingForChoice;
+
+ public Mesh UpgradePreviewMesh
+ {
+ get
+ {
+ if (targetBuilding.State == BuildSlot.BuildingState.Built)
+ {
+ if (!targetBuilding.CanBeUpgraded)
+ {
+ return null;
+ }
+ BuildSlot.Upgrade upgrade = targetBuilding.Upgrades[targetBuilding.Level];
+ return upgrade.upgradeBranches[CurrentUpgradePreviewBranchNumber % upgrade.upgradeBranches.Count].replacementMesh;
+ }
+ return targetBuilding.MainMesh.mesh;
+ }
+ }
+
+ public void SetHarvested(bool _harvested)
+ {
+ harvestedToday = _harvested;
+ }
+
+ public void MarkAsHarvested()
+ {
+ harvestedToday = true;
+ }
+
+ public override string ReturnTooltip()
+ {
+ return targetBuilding.ReturnTooltip();
+ }
+
+ private void Start()
+ {
+ targetBuilding.buildingInteractor = this;
+ if ((bool)buildingHP)
+ {
+ buildingHP.OnKillOrKnockout.AddListener(OnKnockOut);
+ }
+ targetBuilding.OnUpgrade.AddListener(OnTargetUpgrade);
+ targetBuilding.OnUpgradeCancel.AddListener(OnTargetUpgradeCanceled);
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ UpdateInteractionState();
+ if ((bool)TagManager.instance)
+ {
+ TagManager.instance.playerBuildingInteractors.Add(this);
+ }
+ }
+
+ public override void InteractionBegin(PlayerInteraction player)
+ {
+ if (!isWaitingForChoice)
+ {
+ interactionStarted = true;
+ interactionComplete = false;
+ bufferedPlayer = player;
+ if (currentState == InteractionState.Upgrade)
+ {
+ ThronefallAudioManager.Oneshot(ThronefallAudioManager.AudioOneShot.CoinslotInteractionStart);
+ }
+ }
+ }
+
+ public override void InteractionHold(PlayerInteraction player)
+ {
+ if (currentState != InteractionState.Upgrade || interactionComplete || !interactionStarted || isWaitingForChoice)
+ {
+ return;
+ }
+ if (costDisplay.CompletelyFilled)
+ {
+ isWaitingForChoice = targetBuilding.NextUpgradeIsChoice;
+ targetBuilding.TryToBuildOrUpgradeAndPay(player);
+ if (!isWaitingForChoice)
+ {
+ BuildComplete();
+ }
+ else
+ {
+ costDisplay.gameObject.SetActive(value: false);
+ }
+ }
+ else if (player.Balance > 0)
+ {
+ if (costDisplay.FillUp())
+ {
+ player.SpendCoins(1);
+ }
+ }
+ else
+ {
+ costDisplay.Deny();
+ }
+ }
+
+ public override void InteractionEnd(PlayerInteraction player)
+ {
+ if (!isWaitingForChoice && interactionStarted)
+ {
+ interactionStarted = false;
+ if (currentState == InteractionState.Upgrade)
+ {
+ costDisplay.CancelFill(player);
+ ThronefallAudioManager.Instance.MakeSureCoinFillSoundIsNotPlayingAnymore();
+ }
+ }
+ }
+
+ private void BuildComplete()
+ {
+ harvestedToday = true;
+ interactionComplete = true;
+ costDisplay.OnCompletion();
+ UpdateInteractionState();
+ }
+
+ private void CancelBuild()
+ {
+ costDisplay.CancelFill(bufferedPlayer);
+ }
+
+ private void OnTargetUpgrade()
+ {
+ if (isWaitingForChoice)
+ {
+ isWaitingForChoice = false;
+ costDisplay.gameObject.SetActive(value: true);
+ interactionStarted = false;
+ BuildComplete();
+ }
+ }
+
+ private void OnTargetUpgradeCanceled()
+ {
+ if (isWaitingForChoice)
+ {
+ isWaitingForChoice = false;
+ if (DayNightCycle.Instance.CurrentTimestate != DayNightCycle.Timestate.Night)
+ {
+ costDisplay.gameObject.SetActive(value: true);
+ }
+ interactionStarted = false;
+ CancelBuild();
+ }
+ }
+
+ public void OnDusk()
+ {
+ knockedOutTonight = false;
+ UpdateInteractionState(forceState: true);
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ harvestedToday = false;
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ PlayerInteraction component = TagManager.instance.Players[0].GetComponent<PlayerInteraction>();
+ Harvest(component);
+ foreach (IncomeModifyer incomeModifier in incomeModifiers)
+ {
+ incomeModifier.OnDawn();
+ }
+ UpdateInteractionState();
+ }
+
+ public void UpdateInteractionState(bool forceState = false, InteractionState forcedState = InteractionState.None)
+ {
+ if (isWaitingForChoice || !base.gameObject)
+ {
+ return;
+ }
+ base.gameObject.SetActive(value: true);
+ if (canBeHarvested)
+ {
+ currentState = InteractionState.Harvest;
+ }
+ else if (targetBuilding.CanBeUpgraded)
+ {
+ currentState = InteractionState.Upgrade;
+ }
+ else
+ {
+ currentState = InteractionState.None;
+ }
+ if (DayNightCycle.Instance.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ currentState = InteractionState.None;
+ }
+ if (forceState)
+ {
+ currentState = forcedState;
+ }
+ if (harvestIsDenied)
+ {
+ harvestDeniedCue.SetActive(value: true);
+ }
+ else
+ {
+ harvestDeniedCue.SetActive(value: false);
+ }
+ if (buildingIsCurrentlyBusyAndCantBeUpgraded)
+ {
+ currentState = InteractionState.None;
+ }
+ switch (currentState)
+ {
+ case InteractionState.None:
+ harvestCue.SetActive(value: false);
+ upgradeCue.SetActive(value: false);
+ DisableCostDisplay();
+ break;
+ case InteractionState.Harvest:
+ harvestCue.SetActive(value: true);
+ upgradeCue.SetActive(targetBuilding.CanBeUpgraded);
+ DisableCostDisplay();
+ break;
+ case InteractionState.Upgrade:
+ harvestCue.SetActive(value: false);
+ if (focussed)
+ {
+ ActivateCostDisplay();
+ upgradeCue.SetActive(value: false);
+ break;
+ }
+ DisableCostDisplay();
+ if (targetBuilding.State == BuildSlot.BuildingState.Built)
+ {
+ upgradeCue.SetActive(value: true);
+ }
+ else
+ {
+ upgradeCue.SetActive(value: false);
+ }
+ break;
+ }
+ }
+
+ public override void Focus(PlayerInteraction player)
+ {
+ focussed = true;
+ UpdateInteractionState();
+ if (currentState == InteractionState.Harvest)
+ {
+ Harvest(player);
+ }
+ }
+
+ public void Harvest(PlayerInteraction player)
+ {
+ if (canBeHarvested)
+ {
+ coinSpawner.TriggerCoinSpawn(targetBuilding.GoldIncome, player);
+ harvestedToday = true;
+ UpdateInteractionState();
+ }
+ }
+
+ public override void Unfocus(PlayerInteraction player)
+ {
+ focussed = false;
+ if (!costDisplay.CompletelyEmpty)
+ {
+ costDisplay.CancelFill(player);
+ }
+ UpdateInteractionState();
+ ThronefallAudioManager.Instance.MakeSureCoinFillSoundIsNotPlayingAnymore();
+ }
+
+ private void ActivateCostDisplay()
+ {
+ costDisplay.UpdateDisplay(targetBuilding.NextUpgradeOrBuildCost);
+ }
+
+ private void DisableCostDisplay()
+ {
+ costDisplay.Hide();
+ }
+
+ public void OnKnockOut()
+ {
+ knockedOutTonight = true;
+ }
+
+ private void Update()
+ {
+ if ((focussed || displayAllBuildPreviews) && currentState == InteractionState.Upgrade)
+ {
+ if (!targetBuilding.ActivatorUpgradesThis)
+ {
+ PreviewSelf();
+ }
+ else
+ {
+ targetBuilding.ActivatorBuilding.buildingInteractor.PreviewSelf();
+ }
+ }
+ if (!focussed && costDisplay.gameObject.activeSelf)
+ {
+ costDisplay.Hide();
+ }
+ }
+
+ public void PreviewSelf()
+ {
+ MeshFilter mainMesh = targetBuilding.MainMesh;
+ if ((bool)UpgradePreviewMesh)
+ {
+ Graphics.DrawMesh(UpgradePreviewMesh, targetBuilding.MainMesh.transform.localToWorldMatrix, previewMaterial, 0);
+ }
+ else if (!mainMesh.gameObject.activeInHierarchy)
+ {
+ Graphics.DrawMesh(mainMesh.mesh, mainMesh.transform.localToWorldMatrix, previewMaterial, 0);
+ }
+ List<GameObject> gameObjectsThatWillUnlockWhenUpgraded = targetBuilding.GetGameObjectsThatWillUnlockWhenUpgraded(CurrentUpgradePreviewBranchNumber);
+ for (int i = 0; i < gameObjectsThatWillUnlockWhenUpgraded.Count; i++)
+ {
+ if (gameObjectsThatWillUnlockWhenUpgraded[i].transform.parent == null)
+ {
+ PreviewGameObject(gameObjectsThatWillUnlockWhenUpgraded[i]);
+ }
+ else if (gameObjectsThatWillUnlockWhenUpgraded[i].transform.parent.gameObject.activeSelf || gameObjectsThatWillUnlockWhenUpgraded.Contains(gameObjectsThatWillUnlockWhenUpgraded[i].transform.parent.gameObject))
+ {
+ PreviewGameObject(gameObjectsThatWillUnlockWhenUpgraded[i]);
+ }
+ }
+ for (int j = 0; j < targetBuilding.BuiltSlotsThatRelyOnThisBuilding.Count; j++)
+ {
+ BuildSlot buildSlot = targetBuilding.BuiltSlotsThatRelyOnThisBuilding[j];
+ if (buildSlot.ActivatorUpgradesThis && buildSlot.ActivatorBuilding == targetBuilding && (bool)buildSlot.buildingInteractor)
+ {
+ buildSlot.buildingInteractor.PreviewSelf();
+ }
+ }
+ List<MeshFilter> blueprintPreviewsThatWillUnlockWhenUpgraded = targetBuilding.GetBlueprintPreviewsThatWillUnlockWhenUpgraded();
+ for (int k = 0; k < blueprintPreviewsThatWillUnlockWhenUpgraded.Count; k++)
+ {
+ mainMesh = blueprintPreviewsThatWillUnlockWhenUpgraded[k];
+ Graphics.DrawMesh(mainMesh.mesh, mainMesh.transform.localToWorldMatrix, previewMaterial, 0);
+ }
+ }
+
+ private void PreviewGameObject(GameObject _go)
+ {
+ MeshFilter[] componentsInChildren = _go.GetComponentsInChildren<MeshFilter>();
+ foreach (MeshFilter meshFilter in componentsInChildren)
+ {
+ Graphics.DrawMesh(meshFilter.mesh, meshFilter.transform.localToWorldMatrix, previewMaterial, 0);
+ }
+ }
+
+ private void OnDestroy()
+ {
+ DayNightCycle.Instance.UnregisterDaytimeSensitiveObject(this);
+ if ((bool)TagManager.instance)
+ {
+ TagManager.instance.playerBuildingInteractors.Remove(this);
+ }
+ }
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ MatchSaveLoadHandler.TryLoadValue(guid, "knockedOutTonight", ref knockedOutTonight);
+ harvestedToday = true;
+ StartCoroutine(UpdateInteractionStateDelayed());
+ }
+
+ public void OnSave(string guid)
+ {
+ MatchSaveLoadHandler.SaveValue(guid, "knockedOutTonight", knockedOutTonight);
+ }
+
+ private IEnumerator UpdateInteractionStateDelayed()
+ {
+ yield return null;
+ yield return null;
+ UpdateInteractionState();
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BuildingMeshTracker.cs b/Thronefall_v1.57/Thronefall/Thronefall/BuildingMeshTracker.cs
new file mode 100644
index 0000000..cf0a58c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BuildingMeshTracker.cs
@@ -0,0 +1,60 @@
+using System.Collections;
+using NGS.MeshFusionPro;
+using UnityEngine;
+
+public class BuildingMeshTracker : MonoBehaviour
+{
+ [SerializeField]
+ private MeshFusionSource meshFuser;
+
+ private Coroutine freezeWithDelay;
+
+ private bool freezeWithDelayCoroRunning;
+
+ protected void OnEnable()
+ {
+ FreezeMeshWithDelay();
+ }
+
+ protected void OnDisable()
+ {
+ Unfreeze();
+ }
+
+ public virtual void Unfreeze()
+ {
+ if (freezeWithDelayCoroRunning)
+ {
+ StopCoroutine(freezeWithDelay);
+ freezeWithDelayCoroRunning = false;
+ }
+ meshFuser.UndoCombine();
+ }
+
+ public virtual void FreezeMeshWithDelay()
+ {
+ if (!meshFuser.gameObject.activeInHierarchy)
+ {
+ return;
+ }
+ if (freezeWithDelay == null)
+ {
+ freezeWithDelay = StartCoroutine(FreezeMeshWithDelayCoro());
+ return;
+ }
+ if (freezeWithDelayCoroRunning)
+ {
+ StopCoroutine(freezeWithDelay);
+ freezeWithDelayCoroRunning = false;
+ }
+ freezeWithDelay = StartCoroutine(FreezeMeshWithDelayCoro());
+ }
+
+ public virtual IEnumerator FreezeMeshWithDelayCoro()
+ {
+ freezeWithDelayCoroRunning = true;
+ yield return new WaitForSeconds(2f);
+ meshFuser.AssignToController();
+ freezeWithDelayCoroRunning = false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BuildingMeshesTracker.cs b/Thronefall_v1.57/Thronefall/Thronefall/BuildingMeshesTracker.cs
new file mode 100644
index 0000000..0a93b24
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BuildingMeshesTracker.cs
@@ -0,0 +1,57 @@
+using System.Collections;
+using NGS.MeshFusionPro;
+using UnityEngine;
+
+public class BuildingMeshesTracker : BuildingMeshTracker
+{
+ [SerializeField]
+ private MeshFusionSource[] meshFusers;
+
+ private Coroutine freezeWithDelay2;
+
+ private bool freezeWithDelayCoroRunning2;
+
+ public override void Unfreeze()
+ {
+ if (freezeWithDelayCoroRunning2)
+ {
+ StopCoroutine(freezeWithDelay2);
+ freezeWithDelayCoroRunning2 = false;
+ }
+ MeshFusionSource[] array = meshFusers;
+ for (int i = 0; i < array.Length; i++)
+ {
+ array[i].UndoCombine();
+ }
+ }
+
+ public override void FreezeMeshWithDelay()
+ {
+ if (freezeWithDelay2 == null)
+ {
+ freezeWithDelay2 = StartCoroutine(FreezeMeshWithDelayCoro());
+ return;
+ }
+ if (freezeWithDelayCoroRunning2)
+ {
+ StopCoroutine(freezeWithDelay2);
+ freezeWithDelayCoroRunning2 = false;
+ }
+ freezeWithDelay2 = StartCoroutine(FreezeMeshWithDelayCoro());
+ }
+
+ public override IEnumerator FreezeMeshWithDelayCoro()
+ {
+ freezeWithDelayCoroRunning2 = true;
+ yield return new WaitForSeconds(2f);
+ MeshFusionSource[] array = meshFusers;
+ foreach (MeshFusionSource meshFusionSource in array)
+ {
+ if (meshFusionSource.gameObject.activeInHierarchy)
+ {
+ meshFusionSource.AssignToController();
+ }
+ }
+ freezeWithDelayCoroRunning2 = false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/BuildingRangeIndicator.cs b/Thronefall_v1.57/Thronefall/Thronefall/BuildingRangeIndicator.cs
new file mode 100644
index 0000000..b3b28a9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/BuildingRangeIndicator.cs
@@ -0,0 +1,161 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class BuildingRangeIndicator : MonoBehaviour
+{
+ public Transform weaponsParent;
+
+ public BuildSlot buildSlot;
+
+ public BuildingInteractor interactor;
+
+ public Shrine optionalShrine;
+
+ private Coroutine tickRoutine;
+
+ public void Activate()
+ {
+ if (tickRoutine != null)
+ {
+ StopCoroutine(tickRoutine);
+ tickRoutine = null;
+ }
+ tickRoutine = StartCoroutine(Tick());
+ }
+
+ private IEnumerator Tick()
+ {
+ while (true)
+ {
+ bool flag = false;
+ bool flag2 = false;
+ float num = 0f;
+ float num2 = 0f;
+ if (DayNightCycle.Instance.CurrentTimestate == DayNightCycle.Timestate.Day && (buildSlot.State == BuildSlot.BuildingState.Built || interactor.Focussed))
+ {
+ foreach (Transform item in weaponsParent)
+ {
+ if (!item.gameObject.activeSelf)
+ {
+ continue;
+ }
+ AutoAttack component = item.GetComponent<AutoAttack>();
+ PerkDestroyGameObjectModifyer component2 = item.GetComponent<PerkDestroyGameObjectModifyer>();
+ if ((bool)component2 && component2.IsGoingToBeDestroyed)
+ {
+ continue;
+ }
+ PerkRangeModifyer component3 = item.GetComponent<PerkRangeModifyer>();
+ float num3 = 1f;
+ if ((bool)component3 && component3.IsActive)
+ {
+ num3 = component3.rangeMultiplyer;
+ }
+ if (!component)
+ {
+ continue;
+ }
+ if (item.gameObject.activeInHierarchy)
+ {
+ flag = true;
+ foreach (TargetPriority targetPriority in component.targetPriorities)
+ {
+ if (targetPriority.range * num3 > num)
+ {
+ num = targetPriority.range * num3;
+ }
+ }
+ continue;
+ }
+ flag2 = true;
+ foreach (TargetPriority targetPriority2 in component.targetPriorities)
+ {
+ if (targetPriority2.range * num3 > num2)
+ {
+ num2 = targetPriority2.range * num3;
+ }
+ }
+ }
+ if (buildSlot.CanBeUpgraded)
+ {
+ List<GameObject> list = new List<GameObject>();
+ List<GameObject> gameObjectsThatWillUnlockWhenUpgraded = buildSlot.GetGameObjectsThatWillUnlockWhenUpgraded(BuildingInteractor.CurrentUpgradePreviewBranchNumber);
+ list.AddRange(gameObjectsThatWillUnlockWhenUpgraded);
+ foreach (GameObject item2 in list)
+ {
+ AutoAttack component4 = item2.GetComponent<AutoAttack>();
+ PerkDestroyGameObjectModifyer component5 = item2.GetComponent<PerkDestroyGameObjectModifyer>();
+ if ((bool)component5 && component5.IsGoingToBeDestroyed)
+ {
+ continue;
+ }
+ PerkRangeModifyer component6 = item2.GetComponent<PerkRangeModifyer>();
+ float num4 = 1f;
+ if ((bool)component6 && component6.IsActive)
+ {
+ num4 = component6.rangeMultiplyer;
+ }
+ if ((bool)component4)
+ {
+ flag2 = true;
+ foreach (TargetPriority targetPriority3 in component4.targetPriorities)
+ {
+ if (targetPriority3.range * num4 > num2)
+ {
+ num2 = targetPriority3.range * num4;
+ }
+ }
+ }
+ TowerUpgrade component7 = item2.GetComponent<TowerUpgrade>();
+ if ((bool)component7)
+ {
+ flag2 = true;
+ num2 *= component7.RangeMulti;
+ break;
+ }
+ }
+ }
+ if (optionalShrine != null)
+ {
+ if (!optionalShrine.ShrineHasBeenActivated)
+ {
+ RangeIndicatorHandler.instance.ShowIndicator(base.transform.position, optionalShrine.CollectionRange, base.gameObject, RangeIndicatorHandler.IndicatorType.Special);
+ }
+ else
+ {
+ RangeIndicatorHandler.instance.HideIndicator(base.gameObject, RangeIndicatorHandler.IndicatorType.Special);
+ }
+ }
+ }
+ if (flag)
+ {
+ RangeIndicatorHandler.instance.ShowIndicator(base.transform.position, num, base.gameObject, RangeIndicatorHandler.IndicatorType.Built);
+ }
+ else
+ {
+ RangeIndicatorHandler.instance.HideIndicator(base.gameObject, RangeIndicatorHandler.IndicatorType.Built);
+ }
+ if (flag2 && !Mathf.Approximately(num, num2))
+ {
+ RangeIndicatorHandler.instance.ShowIndicator(base.transform.position, num2, base.gameObject, RangeIndicatorHandler.IndicatorType.Preview);
+ }
+ else
+ {
+ RangeIndicatorHandler.instance.HideIndicator(base.gameObject, RangeIndicatorHandler.IndicatorType.Preview);
+ }
+ yield return null;
+ }
+ }
+
+ public void Deactivate()
+ {
+ StopAllCoroutines();
+ RangeIndicatorHandler.instance.HideIndicator(base.gameObject, RangeIndicatorHandler.IndicatorType.Built);
+ RangeIndicatorHandler.instance.HideIndicator(base.gameObject, RangeIndicatorHandler.IndicatorType.Preview);
+ if ((bool)optionalShrine)
+ {
+ RangeIndicatorHandler.instance.HideIndicator(base.gameObject, RangeIndicatorHandler.IndicatorType.Special);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/CameraBounds.cs b/Thronefall_v1.57/Thronefall/Thronefall/CameraBounds.cs
new file mode 100644
index 0000000..2eb79dc
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/CameraBounds.cs
@@ -0,0 +1,135 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+[CreateAssetMenu]
+public class CameraBounds : ScriptableObject
+{
+ public List<Vector2> bounds = new List<Vector2>();
+
+ private List<Vector2> boundsToUse = new List<Vector2>();
+
+ public void PrepareBounds(float offset)
+ {
+ boundsToUse = new List<Vector2>(bounds);
+ for (int i = 0; i < 10; i++)
+ {
+ GrowShrinkPoly(boundsToUse, offset / 10f, offset / 10f * 2f);
+ }
+ MakeBoundsConvex(boundsToUse);
+ }
+
+ public static void GrowShrinkPoly(List<Vector2> bounds, float offset, float minDistance)
+ {
+ int count = bounds.Count;
+ for (int i = 0; i < count; i++)
+ {
+ Vector2 vector = bounds[(i - 1 + count) % count];
+ Vector2 vector2 = bounds[i];
+ Vector2 vector3 = bounds[(i + 1) % count];
+ Vector2 normalized = (vector2 - vector).normalized;
+ Vector2 normalized2 = (vector3 - vector2).normalized;
+ Vector2 vector4 = new Vector2(0f - normalized.y, normalized.x);
+ Vector2 vector5 = new Vector2(0f - normalized2.y, normalized2.x);
+ Vector2 vector6 = (vector4 + vector5) / 2f;
+ Vector2 vector7 = vector2 + vector6 * offset;
+ float num = Vector2.Distance(vector7, vector);
+ float num2 = Vector2.Distance(vector7, vector3);
+ if (num >= minDistance && num2 >= minDistance)
+ {
+ bounds[i] = vector7;
+ }
+ }
+ }
+
+ public static void BevelPolygon(List<Vector2> bounds, float percentageOfSideLength)
+ {
+ List<Vector2> list = new List<Vector2>();
+ for (int i = 0; i < bounds.Count; i++)
+ {
+ Vector2 vector = bounds[(i - 1 + bounds.Count) % bounds.Count];
+ Vector2 vector2 = bounds[i];
+ Vector2 vector3 = bounds[(i + 1) % bounds.Count];
+ Vector2 normalized = (vector - vector2).normalized;
+ Vector2 normalized2 = (vector3 - vector2).normalized;
+ float num = (vector - vector2).magnitude * percentageOfSideLength;
+ float num2 = (vector3 - vector2).magnitude * percentageOfSideLength;
+ Vector2 item = vector2 + normalized * num;
+ Vector2 item2 = vector2 + normalized2 * num2;
+ list.Add(item);
+ list.Add(item2);
+ }
+ bounds.Clear();
+ bounds.AddRange(list);
+ }
+
+ public static void DrawPolygonDebug(List<Vector2> bounds, float height)
+ {
+ int count = bounds.Count;
+ for (int i = 0; i < count; i++)
+ {
+ Vector3 start = new Vector3(bounds[i].x, height, bounds[i].y);
+ Vector3 end = new Vector3(bounds[(i + 1) % count].x, height, bounds[(i + 1) % count].y);
+ Debug.DrawLine(start, end, Color.red, Time.deltaTime * 3f);
+ }
+ }
+
+ public static void MakeBoundsConvex(List<Vector2> bounds)
+ {
+ int num = 0;
+ while (num < bounds.Count)
+ {
+ Vector2 vector = bounds[num];
+ Vector2 vector2 = bounds[(num + 1) % bounds.Count];
+ Vector2 vector3 = bounds[(num + 2) % bounds.Count];
+ float current = Mathf.Atan2(vector.y - vector2.y, vector.x - vector2.x) * 57.29578f;
+ float target = Mathf.Atan2(vector3.y - vector2.y, vector3.x - vector2.x) * 57.29578f;
+ if (Mathf.DeltaAngle(current, target) <= 0f)
+ {
+ bounds.RemoveAt((num + 1) % bounds.Count);
+ }
+ else
+ {
+ num++;
+ }
+ }
+ }
+
+ public bool IsInBounds(Vector2 point)
+ {
+ bool flag = false;
+ int num = 0;
+ int index = boundsToUse.Count - 1;
+ while (num < boundsToUse.Count)
+ {
+ if (boundsToUse[num].y > point.y != boundsToUse[index].y > point.y && point.x < (boundsToUse[index].x - boundsToUse[num].x) * (point.y - boundsToUse[num].y) / (boundsToUse[index].y - boundsToUse[num].y) + boundsToUse[num].x)
+ {
+ flag = !flag;
+ }
+ index = num++;
+ }
+ return flag;
+ }
+
+ public Vector2 ClosestPointOnBounds(Vector2 point)
+ {
+ Vector2 result = default(Vector2);
+ float num = float.MaxValue;
+ int num2 = 0;
+ int index = boundsToUse.Count - 1;
+ while (num2 < boundsToUse.Count)
+ {
+ Vector2 vector = boundsToUse[index];
+ Vector2 vector2 = boundsToUse[num2];
+ float num3 = Vector2.Dot(point - vector, vector2 - vector) / Vector2.Dot(vector2 - vector, vector2 - vector);
+ Vector2 vector3 = ((num3 < 0f) ? vector : ((!(num3 > 1f)) ? (vector + num3 * (vector2 - vector)) : vector2));
+ float sqrMagnitude = (vector3 - point).sqrMagnitude;
+ if (sqrMagnitude < num)
+ {
+ num = sqrMagnitude;
+ result = vector3;
+ }
+ index = num2++;
+ }
+ return result;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/CameraController.cs b/Thronefall_v1.57/Thronefall/Thronefall/CameraController.cs
new file mode 100644
index 0000000..a95b27b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/CameraController.cs
@@ -0,0 +1,56 @@
+using System.Collections;
+using UnityEngine;
+
+public class CameraController : MonoBehaviour
+{
+ public static CameraController instance;
+
+ public AnimationCurve shakeCurve;
+
+ public float shakeDuration = 1f;
+
+ public float shakeScaleFactor = -1f;
+
+ private Camera targetCamera;
+
+ private float initialScale;
+
+ private bool initialized;
+
+ private void Awake()
+ {
+ if (instance != null)
+ {
+ Debug.LogWarning("More than one camera controller in the scene.");
+ }
+ instance = this;
+ }
+
+ private void Start()
+ {
+ targetCamera = Camera.main;
+ initialScale = targetCamera.orthographicSize;
+ initialized = true;
+ }
+
+ public void ShakePunch()
+ {
+ if (initialized)
+ {
+ StopAllCoroutines();
+ StartCoroutine(ExecuteShake(shakeScaleFactor, shakeDuration));
+ }
+ }
+
+ private IEnumerator ExecuteShake(float scale, float duration)
+ {
+ float timer = 0f;
+ while (timer <= duration)
+ {
+ timer += Time.deltaTime;
+ targetCamera.orthographicSize = initialScale + shakeCurve.Evaluate(timer / duration) * scale;
+ yield return null;
+ }
+ targetCamera.orthographicSize = initialScale;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/CameraRig.cs b/Thronefall_v1.57/Thronefall/Thronefall/CameraRig.cs
new file mode 100644
index 0000000..7a87897
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/CameraRig.cs
@@ -0,0 +1,120 @@
+using System.Collections;
+using UnityEngine;
+
+public class CameraRig : MonoBehaviour
+{
+ [Header("Forced Camera")]
+ [HideInInspector]
+ public Transform overrideCameraTarget;
+
+ private Transform cameraTarget;
+
+ private Transform currentTarget;
+
+ private Quaternion startRotation;
+
+ [SerializeField]
+ private float transitionSpeed = 1f;
+
+ [Header("Camera Boundaries")]
+ [SerializeField]
+ private CameraBounds camBounds;
+
+ [SerializeField]
+ private bool addCamBoundMode;
+
+ [SerializeField]
+ private KeyCode debugAddCamBound;
+
+ [SerializeField]
+ private KeyCode enableDisableCamBound;
+
+ [SerializeField]
+ private bool boundsEnabled = true;
+
+ [SerializeField]
+ private float outerBoundWidth = 12f;
+
+ private Vector3 targetPosition;
+
+ private bool transitionRunning;
+
+ private void Start()
+ {
+ startRotation = base.transform.rotation;
+ cameraTarget = base.transform.parent;
+ base.transform.SetParent(null);
+ }
+
+ private void Update()
+ {
+ targetPosition = base.transform.position;
+ if (overrideCameraTarget != null && currentTarget != overrideCameraTarget)
+ {
+ StartCoroutine(TransitionToTarget(overrideCameraTarget));
+ }
+ else if (overrideCameraTarget == null && currentTarget != cameraTarget)
+ {
+ StartCoroutine(TransitionToTarget(cameraTarget));
+ }
+ else if (!transitionRunning)
+ {
+ if (overrideCameraTarget != null)
+ {
+ base.transform.position = overrideCameraTarget.position;
+ base.transform.rotation = overrideCameraTarget.rotation;
+ }
+ else
+ {
+ base.transform.position = cameraTarget.position;
+ base.transform.rotation = startRotation;
+ }
+ }
+ }
+
+ private void HandleBounds()
+ {
+ if (!camBounds)
+ {
+ base.transform.position = targetPosition;
+ return;
+ }
+ if (!boundsEnabled)
+ {
+ base.transform.position = targetPosition;
+ return;
+ }
+ if (camBounds.IsInBounds(new Vector2(targetPosition.x, targetPosition.z)))
+ {
+ base.transform.position = targetPosition;
+ return;
+ }
+ Vector2 vector = camBounds.ClosestPointOnBounds(new Vector2(targetPosition.x, targetPosition.z));
+ float magnitude = (vector - new Vector2(targetPosition.x, targetPosition.z)).magnitude;
+ Vector3 vector2 = new Vector3(vector.x, targetPosition.y, vector.y);
+ float num = Mathf.Clamp01(magnitude / outerBoundWidth);
+ num = 0f - Mathf.Pow(num, 2f) + 2f * num;
+ Vector2 normalized = (new Vector2(targetPosition.x, targetPosition.z) - vector).normalized;
+ Vector3 b = vector2 + new Vector3(normalized.x, 0f, normalized.y) * outerBoundWidth * 0.5f;
+ base.transform.position = Vector3.Lerp(vector2, b, num);
+ }
+
+ private IEnumerator TransitionToTarget(Transform newTarget)
+ {
+ transitionRunning = true;
+ Vector3 startPosition = base.transform.position;
+ Quaternion startRotation = base.transform.rotation;
+ float transitionTime2 = 0f;
+ while (targetPosition != newTarget.position || base.transform.rotation != newTarget.rotation)
+ {
+ transitionTime2 = Mathf.Clamp(transitionTime2, 0f, 1f);
+ float t = 3f * Mathf.Pow(transitionTime2, 2f) - 2f * Mathf.Pow(transitionTime2, 3f);
+ base.transform.position = Vector3.Lerp(startPosition, newTarget.position, t);
+ base.transform.rotation = Quaternion.Lerp(startRotation, newTarget.rotation, t);
+ transitionTime2 += Time.deltaTime * transitionSpeed;
+ yield return null;
+ }
+ currentTarget = newTarget;
+ transitionRunning = false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/CancelOrOpenPauseMenu.cs b/Thronefall_v1.57/Thronefall/Thronefall/CancelOrOpenPauseMenu.cs
new file mode 100644
index 0000000..2c2b3ca
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/CancelOrOpenPauseMenu.cs
@@ -0,0 +1,30 @@
+using Rewired;
+using UnityEngine;
+
+public class CancelOrOpenPauseMenu : MonoBehaviour
+{
+ private Player input;
+
+ private ChoiceManager choiceManager;
+
+ private void Start()
+ {
+ input = ReInput.players.GetPlayer(0);
+ choiceManager = ChoiceManager.instance;
+ }
+
+ private void Update()
+ {
+ if (input.GetButtonDown("Pause Menu & Cancel"))
+ {
+ if (choiceManager.ChoiceCoroutineRunning)
+ {
+ choiceManager.CancelChoice();
+ }
+ else
+ {
+ SceneTransitionManager.instance.TransitionFromGameplayToEndScreen(ScoreManager.Instance.CurrentScore, 0, 0, 0);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Checkbox.cs b/Thronefall_v1.57/Thronefall/Thronefall/Checkbox.cs
new file mode 100644
index 0000000..40e1344
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Checkbox.cs
@@ -0,0 +1,29 @@
+using UnityEngine;
+using UnityEngine.Events;
+
+public class Checkbox : MonoBehaviour
+{
+ public UnityEvent onToggle = new UnityEvent();
+
+ public bool state;
+
+ public GameObject checkObj;
+
+ public void SetState(bool active)
+ {
+ state = active;
+ UpdateDisplay();
+ }
+
+ public void Toggle()
+ {
+ state = !state;
+ UpdateDisplay();
+ onToggle.Invoke();
+ }
+
+ private void UpdateDisplay()
+ {
+ checkObj.SetActive(state);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Choice.cs b/Thronefall_v1.57/Thronefall/Thronefall/Choice.cs
new file mode 100644
index 0000000..07d72c0
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Choice.cs
@@ -0,0 +1,40 @@
+using System;
+using UnityEngine;
+
+[Serializable]
+public class Choice
+{
+ public bool disabledInThisMode;
+
+ public string name = "<nameHere>";
+
+ [TextArea]
+ public string tooltip = "<tooltipHere>";
+
+ public Sprite icon;
+
+ public EquippableBuildingUpgrade requiresUnlocked;
+
+ public bool CanBePicked
+ {
+ get
+ {
+ if (!LevelProgressManager.instance.AreAllBuildOptionsUnlockedInThisLevel())
+ {
+ if (!(requiresUnlocked == null))
+ {
+ return PerkManager.instance.UnlockedEquippables.Contains(requiresUnlocked);
+ }
+ return true;
+ }
+ return true;
+ }
+ }
+
+ public Choice(string _name, string _tooltip, Sprite _icon = null)
+ {
+ name = _name;
+ tooltip = _tooltip;
+ icon = null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ChoiceManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/ChoiceManager.cs
new file mode 100644
index 0000000..6ab87f9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ChoiceManager.cs
@@ -0,0 +1,83 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class ChoiceManager : MonoBehaviour
+{
+ public static ChoiceManager instance;
+
+ private bool choiceCoroutineRunning;
+
+ private bool choiceCanceled;
+
+ [HideInInspector]
+ public List<Choice> availableChoices = new List<Choice>();
+
+ [HideInInspector]
+ public Choice choiceToReturn;
+
+ [HideInInspector]
+ public BuildSlot currentOriginBuildSlot;
+
+ public bool ChoiceCoroutineWaiting
+ {
+ get
+ {
+ if (!choiceCanceled)
+ {
+ return choiceToReturn == null;
+ }
+ return false;
+ }
+ }
+
+ public bool ChoiceCoroutineRunning => choiceCoroutineRunning;
+
+ public void CancelChoice()
+ {
+ choiceCanceled = true;
+ }
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ public void PresentChoices(List<Choice> _availableChoices, BuildSlot originBuildSlot, Action<Choice> _onCompleteFunction)
+ {
+ if (!choiceCoroutineRunning)
+ {
+ currentOriginBuildSlot = originBuildSlot;
+ if (_availableChoices.Count == 0)
+ {
+ _onCompleteFunction(null);
+ return;
+ }
+ if (_availableChoices.Count == 1)
+ {
+ _onCompleteFunction(_availableChoices[0]);
+ return;
+ }
+ availableChoices = _availableChoices;
+ UIFrameManager.instance.PresentChoiceFrame();
+ StartCoroutine(Choice(_availableChoices, _onCompleteFunction));
+ }
+ }
+
+ private IEnumerator Choice(List<Choice> _availableChoices, Action<Choice> _onCompleteFunction)
+ {
+ choiceToReturn = null;
+ choiceCoroutineRunning = true;
+ choiceCanceled = false;
+ LocalGamestate.Instance.SetPlayerFreezeState(frozen: true);
+ while (choiceToReturn == null && !choiceCanceled)
+ {
+ yield return null;
+ }
+ LocalGamestate.Instance.SetPlayerFreezeState(frozen: false);
+ yield return null;
+ _onCompleteFunction(choiceToReturn);
+ choiceCoroutineRunning = false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ChoiceUI.cs b/Thronefall_v1.57/Thronefall/Thronefall/ChoiceUI.cs
new file mode 100644
index 0000000..23b2af9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ChoiceUI.cs
@@ -0,0 +1,52 @@
+using TMPro;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class ChoiceUI : MonoBehaviour
+{
+ public Choice choice;
+
+ public TMP_Text title;
+
+ public TMP_Text description;
+
+ public GameObject selected;
+
+ public Image icon;
+
+ public GameObject unlocked;
+
+ public GameObject locked;
+
+ private bool isunlocked;
+
+ public bool IsUnlocked => isunlocked;
+
+ public void SetChoice(Choice _choice)
+ {
+ if (!_choice.requiresUnlocked)
+ {
+ isunlocked = true;
+ }
+ else
+ {
+ isunlocked = _choice.CanBePicked;
+ }
+ if (_choice.disabledInThisMode)
+ {
+ isunlocked = false;
+ }
+ unlocked.SetActive(isunlocked);
+ locked.SetActive(!isunlocked);
+ choice = _choice;
+ title.text = _choice.name;
+ description.text = _choice.tooltip;
+ icon.sprite = _choice.icon;
+ SetHighlighted(_highlighted: false);
+ }
+
+ public void SetHighlighted(bool _highlighted)
+ {
+ selected.SetActive(_highlighted);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ChoiceUIFrameHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/ChoiceUIFrameHelper.cs
new file mode 100644
index 0000000..e4530f9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ChoiceUIFrameHelper.cs
@@ -0,0 +1,116 @@
+using System.Collections.Generic;
+using TMPro;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class ChoiceUIFrameHelper : MonoBehaviour
+{
+ public static int CurrentSelectionIndex;
+
+ public UIFrame frame;
+
+ public HorizontalLayoutGroup choicesParent;
+
+ public TFUIUpgradeChoice upgradeChoiceButtonPrefab;
+
+ public TextMeshProUGUI choiceTitle;
+
+ public TextMeshProUGUI choiceDescription;
+
+ private List<TFUIUpgradeChoice> choices = new List<TFUIUpgradeChoice>();
+
+ public void OnShow()
+ {
+ choices.Clear();
+ foreach (Transform item in choicesParent.transform)
+ {
+ Object.Destroy(item.gameObject);
+ }
+ foreach (Choice availableChoice in ChoiceManager.instance.availableChoices)
+ {
+ AddChoiceTFUI(choicesParent, availableChoice);
+ }
+ RecomputeNavigation();
+ }
+
+ private void AddChoiceTFUI(HorizontalLayoutGroup parent, Choice _choice)
+ {
+ TFUIUpgradeChoice component = Object.Instantiate(upgradeChoiceButtonPrefab, parent.transform).GetComponent<TFUIUpgradeChoice>();
+ component.SetData(_choice);
+ choices.Add(component);
+ }
+
+ private void RecomputeNavigation()
+ {
+ for (int i = 0; i < choices.Count; i++)
+ {
+ TFUIUpgradeChoice tFUIUpgradeChoice = choices[i];
+ if (i <= 0)
+ {
+ tFUIUpgradeChoice.leftNav = choices[choices.Count - 1];
+ }
+ else
+ {
+ tFUIUpgradeChoice.leftNav = choices[i - 1];
+ }
+ if (i >= choices.Count - 1)
+ {
+ tFUIUpgradeChoice.rightNav = choices[0];
+ }
+ else
+ {
+ tFUIUpgradeChoice.rightNav = choices[i + 1];
+ }
+ }
+ frame.firstSelected = choices[0];
+ }
+
+ public void UpdateSelectedChoice()
+ {
+ TFUIUpgradeChoice tFUIUpgradeChoice = null;
+ if (frame.CurrentFocus != null)
+ {
+ tFUIUpgradeChoice = frame.CurrentFocus as TFUIUpgradeChoice;
+ }
+ if (tFUIUpgradeChoice == null && frame.CurrentSelection != null)
+ {
+ tFUIUpgradeChoice = frame.CurrentSelection as TFUIUpgradeChoice;
+ }
+ if (tFUIUpgradeChoice != null)
+ {
+ if (tFUIUpgradeChoice.Data.disabledInThisMode)
+ {
+ choiceTitle.text = TextTranslator.Translate("Menu/Locked");
+ choiceDescription.text = TextTranslator.Translate("Menu/Locked Choice Mini Mode Description");
+ }
+ else if (!tFUIUpgradeChoice.Locked)
+ {
+ BuildSlot currentOriginBuildSlot = ChoiceManager.instance.currentOriginBuildSlot;
+ choiceTitle.text = TextTranslator.Translate(currentOriginBuildSlot.GET_LOCIDENTIFIER_CHOICENAME(tFUIUpgradeChoice.Data));
+ choiceDescription.text = TextTranslator.Translate(currentOriginBuildSlot.GET_LOCIDENTIFIER_CHOICEDESCRIPTION(tFUIUpgradeChoice.Data));
+ }
+ else
+ {
+ choiceTitle.text = TextTranslator.Translate("Menu/Locked");
+ choiceDescription.text = TextTranslator.Translate("Menu/Locked Choice Description");
+ }
+ }
+ for (int i = 0; i < choices.Count; i++)
+ {
+ if (choices[i] == tFUIUpgradeChoice)
+ {
+ CurrentSelectionIndex = i;
+ }
+ }
+ }
+
+ public void OnApply()
+ {
+ TFUIUpgradeChoice tFUIUpgradeChoice = frame.LastApplied as TFUIUpgradeChoice;
+ if (!(tFUIUpgradeChoice == null) && !tFUIUpgradeChoice.Locked)
+ {
+ ChoiceManager.instance.choiceToReturn = tFUIUpgradeChoice.Data;
+ UIFrameManager.instance.CloseActiveFrame();
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Coin.cs b/Thronefall_v1.57/Thronefall/Thronefall/Coin.cs
new file mode 100644
index 0000000..9ba06a2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Coin.cs
@@ -0,0 +1,137 @@
+using UnityEngine;
+
+public class Coin : MonoBehaviour
+{
+ public Transform mesh;
+
+ public float maxSpeed = 20f;
+
+ public float accelerationTime = 1f;
+
+ public AnimationCurve accelerationCurve;
+
+ public float spawnAnimationDuration = 1f;
+
+ public float spawnAnimationScale = 10f;
+
+ public AnimationCurve spawnAnimationCurve;
+
+ public bool groundOnSpawn;
+
+ public LayerMask groundLayer;
+
+ public Vector3 groundingOffset;
+
+ public bool registerInTagManager;
+
+ public GameObject onPickUpParticles;
+
+ private PlayerInteraction target;
+
+ private Vector3 targetOffset = Vector3.up * 2f;
+
+ private float pickupRange = 0.1f;
+
+ private float spawnAnimationClock;
+
+ private Vector3 initialPosition;
+
+ private float accelerationClock;
+
+ private bool grounded;
+
+ private Vector3 groundingPos;
+
+ private float groundingVelocity;
+
+ private bool particlesSpawned;
+
+ public bool IsFree => target == null;
+
+ private void Start()
+ {
+ mesh.rotation = Quaternion.Euler(Random.Range(0, 360), Random.Range(0, 360), Random.Range(0, 360));
+ initialPosition = base.transform.position;
+ if (groundOnSpawn)
+ {
+ if (Physics.Raycast(new Ray(base.transform.position, Vector3.down), out var hitInfo, float.PositiveInfinity, groundLayer))
+ {
+ groundingPos = hitInfo.point + groundingOffset;
+ initialPosition = groundingPos;
+ }
+ else
+ {
+ grounded = true;
+ }
+ }
+ if (registerInTagManager && (bool)TagManager.instance)
+ {
+ TagManager.instance.freeCoins.Add(this);
+ }
+ if ((bool)TagManager.instance)
+ {
+ TagManager.instance.coins.Add(this);
+ }
+ }
+
+ private void Update()
+ {
+ mesh.Rotate(45f * Time.deltaTime, 120f * Time.deltaTime, 0f, Space.World);
+ if (groundOnSpawn && !grounded)
+ {
+ groundingVelocity += 9.81f * Time.deltaTime;
+ base.transform.position = Vector3.MoveTowards(base.transform.position, groundingPos, groundingVelocity);
+ if (Vector3.Distance(base.transform.position, groundingPos) < 0.05f)
+ {
+ base.transform.position = groundingPos;
+ grounded = true;
+ }
+ }
+ else if (spawnAnimationClock < spawnAnimationDuration)
+ {
+ spawnAnimationClock += Time.deltaTime;
+ base.transform.position = initialPosition + Vector3.up * spawnAnimationScale * spawnAnimationCurve.Evaluate(spawnAnimationClock / spawnAnimationDuration);
+ }
+ else
+ {
+ if (!target)
+ {
+ return;
+ }
+ accelerationClock += Time.deltaTime;
+ Vector3 vector = target.transform.position + targetOffset;
+ base.transform.position = Vector3.MoveTowards(base.transform.position, vector, maxSpeed * Time.deltaTime * accelerationCurve.Evaluate(accelerationClock / accelerationTime));
+ if (!particlesSpawned && Vector3.Distance(vector, base.transform.position) < 3f)
+ {
+ if (onPickUpParticles != null)
+ {
+ Object.Instantiate(onPickUpParticles, vector, Quaternion.identity, target.transform);
+ }
+ particlesSpawned = true;
+ }
+ if (Vector3.Distance(vector, base.transform.position) < pickupRange)
+ {
+ target.AddCoin();
+ ThronefallAudioManager.Oneshot(ThronefallAudioManager.AudioOneShot.CoinCollect);
+ Object.Destroy(base.gameObject);
+ }
+ }
+ }
+
+ public void SetTarget(PlayerInteraction target)
+ {
+ this.target = target;
+ }
+
+ private void OnDestroy()
+ {
+ if (registerInTagManager && (bool)TagManager.instance)
+ {
+ TagManager.instance.freeCoins.Remove(this);
+ }
+ if ((bool)TagManager.instance)
+ {
+ TagManager.instance.coins.Remove(this);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/CoinSpawner.cs b/Thronefall_v1.57/Thronefall/Thronefall/CoinSpawner.cs
new file mode 100644
index 0000000..0de0c20
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/CoinSpawner.cs
@@ -0,0 +1,63 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class CoinSpawner : MonoBehaviour
+{
+ public GameObject coinPrefab;
+
+ public float interval = 0.5f;
+
+ private int coinsLeft;
+
+ public static List<CoinSpawner> allCoinSpawners = new List<CoinSpawner>();
+
+ public int CoinsLeft => coinsLeft;
+
+ public static int AllCoinsLeftToBeSpawned
+ {
+ get
+ {
+ int num = 0;
+ for (int num2 = allCoinSpawners.Count - 1; num2 >= 0; num2--)
+ {
+ if (allCoinSpawners[num2] == null)
+ {
+ allCoinSpawners.RemoveAt(num2);
+ }
+ else
+ {
+ num += allCoinSpawners[num2].CoinsLeft;
+ }
+ }
+ return num;
+ }
+ }
+
+ private void OnEnable()
+ {
+ allCoinSpawners.Add(this);
+ }
+
+ private void OnDisable()
+ {
+ allCoinSpawners.Remove(this);
+ }
+
+ public void TriggerCoinSpawn(int amount, PlayerInteraction player)
+ {
+ StartCoroutine(SpawnCoins(amount, interval, player));
+ }
+
+ private IEnumerator SpawnCoins(int amount, float delay, PlayerInteraction player)
+ {
+ coinsLeft = amount;
+ WaitForSeconds wait = new WaitForSeconds(delay);
+ for (int i = 0; i < amount; i++)
+ {
+ coinsLeft--;
+ Object.Instantiate(coinPrefab, base.transform.position, Quaternion.identity).GetComponent<Coin>().SetTarget(player);
+ yield return wait;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Coinslot.cs b/Thronefall_v1.57/Thronefall/Thronefall/Coinslot.cs
new file mode 100644
index 0000000..4a505f1
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Coinslot.cs
@@ -0,0 +1,76 @@
+using MoreMountains.Feedbacks;
+using UnityEngine;
+
+public class Coinslot : MonoBehaviour
+{
+ public Transform fillTarget;
+
+ public AnimationCurve fillCurve;
+
+ public MMF_Player fullFeedback;
+
+ public MMF_Player deniedFeedback;
+
+ public MMF_Player appearFeedback;
+
+ public MMF_Player disappearFeedback;
+
+ public MMF_Player fullCompleteFeedback;
+
+ private float fill01;
+
+ public bool isFull => fill01 >= 1f;
+
+ public float CurrentFill01 => fill01;
+
+ public bool AddFill(float percentage, bool isLastCoin)
+ {
+ fill01 += percentage;
+ fillTarget.localScale = Vector3.one * fillCurve.Evaluate(Mathf.Clamp01(fill01));
+ if (isFull)
+ {
+ if (!isLastCoin)
+ {
+ fullFeedback.PlayFeedbacks();
+ }
+ else
+ {
+ fullCompleteFeedback.PlayFeedbacks();
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public void SetEmpty()
+ {
+ fill01 = 0f;
+ fillTarget.localScale = Vector3.zero;
+ }
+
+ public void PlayDeny()
+ {
+ deniedFeedback.PlayFeedbacks();
+ }
+
+ public void Appear()
+ {
+ fullFeedback.StopFeedbacks();
+ deniedFeedback.StopFeedbacks();
+ appearFeedback.StopFeedbacks();
+ disappearFeedback.StopFeedbacks();
+ fill01 = 0f;
+ fillTarget.localScale = Vector3.zero;
+ base.transform.localScale = Vector3.zero;
+ appearFeedback.PlayFeedbacks();
+ }
+
+ public void Disappear()
+ {
+ fullFeedback.StopFeedbacks();
+ deniedFeedback.StopFeedbacks();
+ appearFeedback.StopFeedbacks();
+ disappearFeedback.StopFeedbacks();
+ disappearFeedback.PlayFeedbacks();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ColorAndLightManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/ColorAndLightManager.cs
new file mode 100644
index 0000000..9490059
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ColorAndLightManager.cs
@@ -0,0 +1,340 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class ColorAndLightManager : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ private static ColorAndLightManager instance;
+
+ [SerializeField]
+ private Light sunlight;
+
+ private Light bonfireLight;
+
+ [SerializeField]
+ private Colorscheme winterModeOverrideScheme;
+
+ [SerializeField]
+ private bool ignoreWintermode;
+
+ [SerializeField]
+ private Colorscheme colorscheme;
+
+ private Colorscheme initialColorscheme;
+
+ [SerializeField]
+ private float transitionDuration = 3f;
+
+ [SerializeField]
+ private Transform playerTransform;
+
+ [SerializeField]
+ private Material enemyMaterial;
+
+ [SerializeField]
+ private Material allyMaterial;
+
+ [SerializeField]
+ private Material playerMaterial;
+
+ [SerializeField]
+ private Material playerCapeMaterial;
+
+ [SerializeField]
+ private Material playerCrownMaterial;
+
+ [SerializeField]
+ private Material horseMaterial;
+
+ [SerializeField]
+ private Material buildingMaterial;
+
+ [SerializeField]
+ private Material buildingPreviewMaterial;
+
+ [SerializeField]
+ private Material coinMaterial;
+
+ [SerializeField]
+ private Material groundMaterial;
+
+ [SerializeField]
+ private Material groundHigh;
+
+ [SerializeField]
+ private Material groundLow;
+
+ [SerializeField]
+ private Material earthMaterial;
+
+ [SerializeField]
+ private Material sandMaterial;
+
+ [SerializeField]
+ private Material groundPatches;
+
+ [SerializeField]
+ private Material treeMaterial;
+
+ [SerializeField]
+ private Material rockMaterial;
+
+ [SerializeField]
+ private Material waterMaterial;
+
+ [SerializeField]
+ private Material oceanMaterial;
+
+ [SerializeField]
+ private Material roadMaterial;
+
+ [SerializeField]
+ private Material shadowShapeMaterial;
+
+ [SerializeField]
+ private Material customPostProcessingMaterial;
+
+ [SerializeField]
+ private bool ignoreEternalTrials;
+
+ [SerializeField]
+ private List<Colorscheme> eternalTrialColorschemes = new List<Colorscheme>();
+
+ private GameObject playerCameraParticles;
+
+ public static Colorscheme currentColorscheme;
+
+ private static Material eliteEnemyMaterial;
+
+ public static ColorAndLightManager Instance => instance;
+
+ public Light Sunlight => sunlight;
+
+ public Light BonfireLight => bonfireLight;
+
+ public static Material EliteEnemyMaterial => eliteEnemyMaterial;
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDusk()
+ {
+ StopAllCoroutines();
+ StartCoroutine(ToNight());
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ StopAllCoroutines();
+ StartCoroutine(ToDay());
+ }
+
+ public void Daylight()
+ {
+ sunlight.color = colorscheme.dayLightColor;
+ AdjustAllOutlineColorsBasedOnLight(colorscheme.globalShadowColor, colorscheme.dayLightColor);
+ }
+
+ public void SunsetLight()
+ {
+ sunlight.color = colorscheme.sunsetLightColor;
+ AdjustAllOutlineColorsBasedOnLight(colorscheme.globalShadowColor, colorscheme.sunsetLightColor);
+ }
+
+ public void NightLight()
+ {
+ sunlight.color = colorscheme.nightLightColor;
+ AdjustAllOutlineColorsBasedOnLight(colorscheme.globalShadowColor, colorscheme.nightLightColor);
+ }
+
+ private IEnumerator ToDay()
+ {
+ float timer2 = 0f;
+ sunlight.color = colorscheme.nightLightColor;
+ while (timer2 <= transitionDuration)
+ {
+ timer2 += Time.deltaTime;
+ sunlight.color = Color.Lerp(colorscheme.nightLightColor, colorscheme.sunsetLightColor, timer2 / transitionDuration);
+ AdjustAllOutlineColorsBasedOnLight(colorscheme.globalShadowColor, sunlight.color);
+ yield return null;
+ }
+ timer2 = 0f;
+ while (timer2 <= transitionDuration)
+ {
+ timer2 += Time.deltaTime;
+ sunlight.color = Color.Lerp(colorscheme.sunsetLightColor, colorscheme.dayLightColor, timer2 / transitionDuration);
+ AdjustAllOutlineColorsBasedOnLight(colorscheme.globalShadowColor, sunlight.color);
+ yield return null;
+ }
+ sunlight.color = colorscheme.dayLightColor;
+ AdjustAllOutlineColorsBasedOnLight(colorscheme.globalShadowColor, sunlight.color);
+ }
+
+ private IEnumerator ToNight()
+ {
+ float timer = 0f;
+ sunlight.color = colorscheme.dayLightColor;
+ while (timer <= transitionDuration)
+ {
+ timer += Time.deltaTime;
+ sunlight.color = Color.Lerp(colorscheme.dayLightColor, colorscheme.nightLightColor, timer / transitionDuration);
+ AdjustAllOutlineColorsBasedOnLight(colorscheme.globalShadowColor, sunlight.color);
+ yield return null;
+ }
+ sunlight.color = colorscheme.nightLightColor;
+ AdjustAllOutlineColorsBasedOnLight(colorscheme.globalShadowColor, sunlight.color);
+ }
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ private void Start()
+ {
+ initialColorscheme = colorscheme;
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ if (SettingsManager.Instance.WinterMode && !ignoreWintermode && winterModeOverrideScheme != null)
+ {
+ colorscheme = winterModeOverrideScheme;
+ }
+ else if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.EternalTrial && !ignoreEternalTrials)
+ {
+ colorscheme = eternalTrialColorschemes[new System.Random(EternalTrialsRunManager.CurrentRun.currentStageSeed).Next(0, eternalTrialColorschemes.Count)];
+ }
+ sunlight.color = colorscheme.dayLightColor;
+ ApplyColorScheme(colorscheme);
+ if (playerCameraParticles != null)
+ {
+ UnityEngine.Object.Destroy(playerCameraParticles);
+ }
+ if ((bool)playerTransform && (bool)colorscheme.particlesToAttachToPlayer)
+ {
+ playerCameraParticles = UnityEngine.Object.Instantiate(colorscheme.particlesToAttachToPlayer, playerTransform);
+ playerCameraParticles.transform.localPosition = Vector3.zero;
+ }
+ eliteEnemyMaterial = new Material(enemyMaterial);
+ eliteEnemyMaterial.SetColor("_OutlineColor", Color.yellow);
+ }
+
+ public void ApplayColorScheme()
+ {
+ ApplyColorScheme(colorscheme);
+ }
+
+ public void ApplyColorScheme(Colorscheme _colorScheme)
+ {
+ SetMaterialColors(enemyMaterial, _colorScheme.enemyLightColor, _colorScheme.enemyMidColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(allyMaterial, _colorScheme.allyLightColor, _colorScheme.allyMidColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(playerMaterial, _colorScheme.playerLightColor, _colorScheme.playerMidColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(playerCapeMaterial, _colorScheme.playerCapeLightColor, _colorScheme.playerCapeMidColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(playerCrownMaterial, _colorScheme.playerCrownLightColor, _colorScheme.playerCrownMidColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(horseMaterial, _colorScheme.horseLightColor, _colorScheme.horseMidColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(buildingMaterial, _colorScheme.buildingLightColor, _colorScheme.buildingMidColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(_lightCol: new Color(_colorScheme.buildingLightColor.r, _colorScheme.buildingLightColor.g, _colorScheme.buildingLightColor.b, 0.15f), _midCol: new Color(_colorScheme.buildingMidColor.r, _colorScheme.buildingMidColor.g, _colorScheme.buildingMidColor.b, 0.15f), _shadowCol: new Color(_colorScheme.globalShadowColor.r, _colorScheme.globalShadowColor.g, _colorScheme.globalShadowColor.b, 0.15f), _mat: buildingPreviewMaterial);
+ SetMaterialColors(coinMaterial, _colorScheme.coinLightColor, _colorScheme.coinMidColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(groundMaterial, _colorScheme.groundColor, _colorScheme.globalShadowColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(groundPatches, _colorScheme.groundColorLow, _colorScheme.globalShadowColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(groundHigh, _colorScheme.groundColorHigh, _colorScheme.globalShadowColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(groundLow, _colorScheme.groundColorLow, _colorScheme.globalShadowColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(earthMaterial, _colorScheme.earthLightColor, _colorScheme.earthMidColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(sandMaterial, _colorScheme.sandColor, _colorScheme.globalShadowColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(treeMaterial, _colorScheme.treeLightColor, _colorScheme.treeMidColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(rockMaterial, _colorScheme.rockLightColor, _colorScheme.rockMidColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(waterMaterial, _colorScheme.waterLightColor, _colorScheme.waterSecondaryColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(oceanMaterial, _colorScheme.waterLightColor, _colorScheme.waterSecondaryColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(roadMaterial, _colorScheme.roadColor, _colorScheme.globalShadowColor, _colorScheme.globalShadowColor);
+ SetMaterialColors(shadowShapeMaterial, _colorScheme.globalShadowColor, _colorScheme.globalShadowColor, _colorScheme.globalShadowColor);
+ SetMaterialColorsPostProcessing(customPostProcessingMaterial, _colorScheme.brightness, _colorScheme.topColorAdd, _colorScheme.botColorAdd, _colorScheme.contrast, _colorScheme.saturation, _colorScheme.mix);
+ if ((bool)bonfireLight)
+ {
+ bonfireLight.color = _colorScheme.bonfireLightColor;
+ }
+ currentColorscheme = _colorScheme;
+ }
+
+ private void SetMaterialColors(Material _mat, Color _lightCol, Color _midCol, Color _shadowCol)
+ {
+ _mat.SetColor("_BaseColor", _lightCol);
+ _mat.SetColor("_ColorDim", _midCol);
+ _mat.SetColor("_ColorDimExtra", _shadowCol);
+ _mat.SetColor("_UnityShadowColor", _shadowCol);
+ _mat.SetColor("_OutlineColor", _shadowCol);
+ }
+
+ public void AdjustAllOutlineColorsBasedOnLight(Color outlineColor, Color lightColor)
+ {
+ SetOutlineColorBasedOnLight(enemyMaterial, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(allyMaterial, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(playerMaterial, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(playerCapeMaterial, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(playerCrownMaterial, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(horseMaterial, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(buildingMaterial, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(coinMaterial, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(groundMaterial, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(earthMaterial, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(groundLow, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(groundHigh, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(sandMaterial, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(groundPatches, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(treeMaterial, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(rockMaterial, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(waterMaterial, outlineColor, lightColor);
+ SetOutlineColorBasedOnLight(oceanMaterial, outlineColor, lightColor);
+ }
+
+ private void SetOutlineColorBasedOnLight(Material _mat, Color _outlineCol, Color lightCol)
+ {
+ Color value = Color.Lerp(_outlineCol, _outlineCol * lightCol, _mat.GetFloat("_LightContribution"));
+ _mat.SetColor("_OutlineColor", value);
+ }
+
+ private void SetMaterialColorsPostProcessing(Material _mat, float _brightness, Color _top, Color _bot, float _contrast, float _saturation, float _mix)
+ {
+ _mat.SetFloat("_Brightness", _brightness);
+ _mat.SetColor("_TopColorAdd", _top);
+ _mat.SetColor("_BotColorAdd", _bot);
+ _mat.SetFloat("_Contrast", _contrast);
+ _mat.SetFloat("_Saturation", _saturation);
+ _mat.SetFloat("_Mix", _mix);
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+
+ public void OnWinterModeToggle()
+ {
+ colorscheme = initialColorscheme;
+ if (SettingsManager.Instance.WinterMode && !ignoreWintermode && winterModeOverrideScheme != null)
+ {
+ colorscheme = winterModeOverrideScheme;
+ }
+ else if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.EternalTrial && !ignoreEternalTrials)
+ {
+ colorscheme = eternalTrialColorschemes[new System.Random(EternalTrialsRunManager.CurrentRun.currentStageSeed).Next(0, eternalTrialColorschemes.Count)];
+ }
+ sunlight.color = colorscheme.dayLightColor;
+ ApplyColorScheme(colorscheme);
+ if (playerCameraParticles != null)
+ {
+ UnityEngine.Object.Destroy(playerCameraParticles);
+ }
+ if ((bool)playerTransform && (bool)colorscheme.particlesToAttachToPlayer)
+ {
+ playerCameraParticles = UnityEngine.Object.Instantiate(colorscheme.particlesToAttachToPlayer, playerTransform);
+ playerCameraParticles.transform.localPosition = Vector3.zero;
+ }
+ eliteEnemyMaterial = new Material(enemyMaterial);
+ eliteEnemyMaterial.SetColor("_OutlineColor", Color.yellow);
+ }
+
+ public void RegisterBonfireLight(Light bonfire)
+ {
+ bonfireLight = bonfire;
+ bonfireLight.color = currentColorscheme.bonfireLightColor;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Colorscheme.cs b/Thronefall_v1.57/Thronefall/Thronefall/Colorscheme.cs
new file mode 100644
index 0000000..2f25811
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Colorscheme.cs
@@ -0,0 +1,106 @@
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "New Color Scheme", menuName = "SimpleSiege/Colorscheme")]
+public class Colorscheme : ScriptableObject
+{
+ public readonly Color dayLightColor = Color.white;
+
+ public Color sunsetLightColor;
+
+ public Color nightLightColor;
+
+ public Color globalShadowColor;
+
+ public Color bonfireLightColor = new Color(1f, 0.701447f, 0.1273585f);
+
+ [Header("Enemies")]
+ public Color enemyLightColor;
+
+ public Color enemyMidColor;
+
+ [Header("Allies")]
+ public Color allyLightColor;
+
+ public Color allyMidColor;
+
+ [Header("Player")]
+ public Color playerLightColor;
+
+ public Color playerMidColor;
+
+ public Color playerCapeLightColor;
+
+ public Color playerCapeMidColor;
+
+ public Color playerCrownLightColor;
+
+ public Color playerCrownMidColor;
+
+ public Color horseLightColor;
+
+ public Color horseMidColor;
+
+ [Header("Buildings")]
+ public Color buildingLightColor;
+
+ public Color buildingMidColor;
+
+ public Color coinLightColor;
+
+ public Color coinMidColor;
+
+ [Header("Environment")]
+ public Color groundColor;
+
+ public Color groundColorHigh;
+
+ public Color groundColorLow;
+
+ public Color earthLightColor;
+
+ public Color earthMidColor;
+
+ public Color sandColor;
+
+ public Color treeLightColor;
+
+ public Color treeMidColor;
+
+ public Color rockLightColor;
+
+ public Color rockMidColor;
+
+ public Color waterLightColor;
+
+ public Color waterSecondaryColor;
+
+ public Color roadColor;
+
+ [Header("UI")]
+ public Color upgradeInteractorColor;
+
+ [Header("Post Processing")]
+ public float brightness;
+
+ public Color topColorAdd = Color.black;
+
+ public Color botColorAdd = Color.black;
+
+ public float contrast = 1f;
+
+ public float saturation = 1f;
+
+ public float mix = 1f;
+
+ [Header("Particles")]
+ public GameObject particlesToAttachToPlayer;
+
+ private void OnValidate()
+ {
+ ColorAndLightManager colorAndLightManager = Object.FindObjectOfType<ColorAndLightManager>();
+ if ((bool)colorAndLightManager)
+ {
+ colorAndLightManager.ApplyColorScheme(this);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/CommandUnits.cs b/Thronefall_v1.57/Thronefall/Thronefall/CommandUnits.cs
new file mode 100644
index 0000000..a028e68
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/CommandUnits.cs
@@ -0,0 +1,414 @@
+using System.Collections.Generic;
+using Pathfinding;
+using Rewired;
+using UnityEngine;
+
+public class CommandUnits : MonoBehaviour
+{
+ public static CommandUnits instance;
+
+ public UnitCommandRadiusAnimation rangeIndicator;
+
+ public GameObject commandingIndicator;
+
+ public ParticleSystem dropWaypointFx;
+
+ public int drowWaypointParticleCount = 100;
+
+ public float attractRange;
+
+ public string graphNameOfPlayerUnits;
+
+ public string graphNameOfFlyingUnits;
+
+ public float unitDistanceFromEachOther = 2f;
+
+ public float unitDistanceMoveStep = 0.5f;
+
+ public int maxPositioningRepeats = 5;
+
+ public float holdToHoldPositionTime = 1f;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float commanderUnitMoveSpeedMulti = 1.6f;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float commanderHoldHealthMulti = 1.2f;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float commanderHoldDamageMulti = 1.2f;
+
+ private ThronefallAudioManager audioManager;
+
+ private AudioSet audioSet;
+
+ private NNConstraint nearestConstraint = new NNConstraint();
+
+ private NNConstraint nearestConstraintAir = new NNConstraint();
+
+ private List<PathfindMovementPlayerunit> playerUnitsCommanding = new List<PathfindMovementPlayerunit>();
+
+ private List<PathfindMovementPlayerunit> playerUnitsCommandingBuffer = new List<PathfindMovementPlayerunit>();
+
+ private Player input;
+
+ [HideInInspector]
+ public bool commanding;
+
+ private TagManager tagManager;
+
+ private AstarPath astarPath;
+
+ private PlayerUpgradeManager playerUPgradeManager;
+
+ private Hp hpPlayer;
+
+ private float timeSincePlace;
+
+ private bool switchedToHold;
+
+ private List<TagManager.ETag> mustHaveTags = new List<TagManager.ETag>();
+
+ private List<TagManager.ETag> mayNotHaveTags = new List<TagManager.ETag>();
+
+ private List<TaggedObject> results = new List<TaggedObject>();
+
+ private bool commandUnitsToggledOn;
+
+ [SerializeField]
+ private bool canCommandUnitsInThisMode = true;
+
+ private bool rangeIndicatorActive;
+
+ private bool commandUnitsButtonLast;
+
+ private List<PathfindMovementPlayerunit> toBePlaced = new List<PathfindMovementPlayerunit>();
+
+ private List<AutoAttack> autoAttacksToEnable = new List<AutoAttack>();
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ private void Start()
+ {
+ audioManager = ThronefallAudioManager.Instance;
+ audioSet = audioManager.audioContent;
+ input = ReInput.players.GetPlayer(0);
+ tagManager = TagManager.instance;
+ astarPath = AstarPath.active;
+ nearestConstraint.graphMask = GraphMask.FromGraphName(graphNameOfPlayerUnits);
+ nearestConstraintAir.graphMask = GraphMask.FromGraphName(graphNameOfFlyingUnits);
+ playerUPgradeManager = PlayerUpgradeManager.instance;
+ hpPlayer = GetComponent<Hp>();
+ UnitProductionSelector.Clear();
+ }
+
+ private void Update()
+ {
+ if (Time.timeScale == 0f)
+ {
+ return;
+ }
+ float distanceFromCollider;
+ UnitProductionSelector standingInSelectRangeOf = UnitProductionSelector.FindClosestToPoint(base.transform.position, out distanceFromCollider);
+ if (distanceFromCollider > 4f)
+ {
+ standingInSelectRangeOf = null;
+ }
+ if (input.GetButtonDown("Command Units Toggle"))
+ {
+ commandUnitsToggledOn = !commandUnitsToggledOn;
+ }
+ bool button = input.GetButton("Command Units");
+ if (button)
+ {
+ commandUnitsToggledOn = false;
+ }
+ bool button2 = input.GetButton("Smart Command Units");
+ bool flag = button || button2 || commandUnitsToggledOn;
+ bool flag2 = flag && !commandUnitsButtonLast;
+ bool flag3 = !flag && commandUnitsButtonLast;
+ commandUnitsButtonLast = flag;
+ bool selectButtonPressed = flag;
+ if (!LocalGamestate.Instance.PlayerFrozen)
+ {
+ if (input.GetButtonDown("Select All Army") && hpPlayer.HpValue > 0f)
+ {
+ mustHaveTags.Clear();
+ mayNotHaveTags.Clear();
+ mustHaveTags.Add(TagManager.ETag.PlayerUnit);
+ TagManager.instance.FindAllTaggedObjectsWithTags(results, mustHaveTags, mayNotHaveTags);
+ TryToSelectUnits(results);
+ }
+ if (input.GetButtonDown("Select All Melee") && hpPlayer.HpValue > 0f)
+ {
+ mustHaveTags.Clear();
+ mayNotHaveTags.Clear();
+ mustHaveTags.Add(TagManager.ETag.PlayerUnit);
+ mustHaveTags.Add(TagManager.ETag.MeeleFighter);
+ mayNotHaveTags.Add(TagManager.ETag.PlayerHeroUnit);
+ TagManager.instance.FindAllTaggedObjectsWithTags(results, mustHaveTags, mayNotHaveTags);
+ TryToSelectUnits(results);
+ }
+ if (input.GetButtonDown("Select All Ranged") && hpPlayer.HpValue > 0f)
+ {
+ mustHaveTags.Clear();
+ mayNotHaveTags.Clear();
+ mustHaveTags.Add(TagManager.ETag.PlayerUnit);
+ mustHaveTags.Add(TagManager.ETag.RangedFighter);
+ mayNotHaveTags.Add(TagManager.ETag.PlayerHeroUnit);
+ TagManager.instance.FindAllTaggedObjectsWithTags(results, mustHaveTags, mayNotHaveTags);
+ TryToSelectUnits(results);
+ }
+ if (input.GetButtonDown("Select All Heroes") && hpPlayer.HpValue > 0f)
+ {
+ mustHaveTags.Clear();
+ mayNotHaveTags.Clear();
+ mustHaveTags.Add(TagManager.ETag.PlayerUnit);
+ mustHaveTags.Add(TagManager.ETag.PlayerHeroUnit);
+ TagManager.instance.FindAllTaggedObjectsWithTags(results, mustHaveTags, mayNotHaveTags);
+ TryToSelectUnits(results);
+ }
+ }
+ if (!commanding)
+ {
+ if (flag2 && hpPlayer.HpValue > 0f)
+ {
+ rangeIndicator.Activate();
+ rangeIndicatorActive = true;
+ }
+ if (flag && hpPlayer.HpValue > 0f)
+ {
+ foreach (TaggedObject playerUnit in TagManager.instance.PlayerUnits)
+ {
+ if (tagManager.MeasureDistanceToTaggedObject(playerUnit, base.transform.position) <= attractRange)
+ {
+ OnUnitAdd(playerUnit, button2);
+ }
+ else if (playerUnit.Tags.Contains(TagManager.ETag.Flying) && (new Vector2(base.transform.position.x, base.transform.position.z) - new Vector2(playerUnit.transform.position.x, playerUnit.transform.position.z)).magnitude <= attractRange)
+ {
+ OnUnitAdd(playerUnit, button2);
+ }
+ }
+ }
+ else if (playerUnitsCommanding.Count > 0)
+ {
+ commanding = true;
+ }
+ }
+ else
+ {
+ if (flag2 || hpPlayer.HpValue <= 0f)
+ {
+ PlaceCommandedUnitsAndCalculateTargetPositions(button2);
+ timeSincePlace = 0f;
+ switchedToHold = false;
+ }
+ if (flag && hpPlayer.HpValue > 0f)
+ {
+ timeSincePlace += Time.deltaTime;
+ if (timeSincePlace > holdToHoldPositionTime && !switchedToHold)
+ {
+ switchedToHold = true;
+ MakeUnitsInBufferHoldPosition();
+ }
+ }
+ if (flag3 || hpPlayer.HpValue <= 0f)
+ {
+ commanding = false;
+ timeSincePlace = 0f;
+ }
+ }
+ for (int num = playerUnitsCommanding.Count - 1; num >= 0; num--)
+ {
+ PathfindMovementPlayerunit pathfindMovementPlayerunit = playerUnitsCommanding[num];
+ pathfindMovementPlayerunit.HomePosition = base.transform.position;
+ if (!pathfindMovementPlayerunit.enabled)
+ {
+ playerUnitsCommanding.RemoveAt(num);
+ OnUnitRemove(pathfindMovementPlayerunit);
+ }
+ }
+ if (playerUnitsCommanding.Count > 0 && !flag)
+ {
+ commandingIndicator.SetActive(value: true);
+ }
+ else
+ {
+ commandingIndicator.SetActive(value: false);
+ }
+ if (!flag && rangeIndicator.Active)
+ {
+ rangeIndicator.Deactivate();
+ rangeIndicatorActive = false;
+ }
+ if (commanding)
+ {
+ standingInSelectRangeOf = null;
+ selectButtonPressed = false;
+ }
+ UnitProductionSelector.CustomUpdate(standingInSelectRangeOf, selectButtonPressed, button2);
+ }
+
+ public void MakeUnitsInBufferHoldPosition()
+ {
+ if (playerUnitsCommandingBuffer.Count > 0)
+ {
+ audioManager.PlaySoundAsOneShot(audioSet.HoldPosition, 0.45f, 0.9f + Random.value * 0.2f, audioManager.mgSFX, 10);
+ }
+ foreach (PathfindMovementPlayerunit item in playerUnitsCommandingBuffer)
+ {
+ item.HoldPosition = true;
+ }
+ }
+
+ public void ForceCommandingEnd()
+ {
+ if (commanding)
+ {
+ PlaceCommandedUnitsAndCalculateTargetPositions(_smartCommand: false);
+ }
+ }
+
+ public void PlaceCommandedUnitsAndCalculateTargetPositions(bool _smartCommand)
+ {
+ if (!commanding || playerUnitsCommanding.Count <= 0)
+ {
+ return;
+ }
+ commandUnitsToggledOn = false;
+ audioManager.PlaySoundAsOneShot(audioSet.PlaceCommandingUnits, 0.35f, 0.9f + Random.value * 0.2f, audioManager.mgSFX, 10);
+ dropWaypointFx.Emit(drowWaypointParticleCount);
+ string text = playerUnitsCommanding[0].name;
+ toBePlaced.Clear();
+ foreach (PathfindMovementPlayerunit item in playerUnitsCommanding)
+ {
+ if (!_smartCommand || item.name == text)
+ {
+ toBePlaced.Add(item);
+ }
+ }
+ foreach (PathfindMovementPlayerunit item2 in toBePlaced)
+ {
+ OnUnitRemove(item2);
+ playerUnitsCommanding.Remove(item2);
+ }
+ for (int num = autoAttacksToEnable.Count - 1; num >= 0; num--)
+ {
+ AutoAttack autoAttack = autoAttacksToEnable[num];
+ if (autoAttack != null && (!_smartCommand || autoAttack.gameObject.name == text) && autoAttack.GetComponent<Hp>().HpValue > 0f)
+ {
+ autoAttack.enabled = true;
+ autoAttacksToEnable.RemoveAt(num);
+ }
+ }
+ for (int i = 0; i < toBePlaced.Count; i++)
+ {
+ PathfindMovementPlayerunit pathfindMovementPlayerunit = toBePlaced[i];
+ Vector3 vector = Quaternion.AngleAxis((float)(i / toBePlaced.Count) * 360f, Vector3.up) * Vector3.right * unitDistanceMoveStep;
+ pathfindMovementPlayerunit.HomePosition = astarPath.GetNearest(base.transform.position + vector + new Vector3(Random.value - 0.5f, 0f, Random.value - 0.5f) * unitDistanceMoveStep * 0.1f, pathfindMovementPlayerunit.Flying ? nearestConstraintAir : nearestConstraint).position;
+ }
+ for (int j = 0; j < maxPositioningRepeats; j++)
+ {
+ bool flag = false;
+ for (int k = 0; k < toBePlaced.Count; k++)
+ {
+ PathfindMovementPlayerunit pathfindMovementPlayerunit2 = toBePlaced[k];
+ for (int l = k + 1; l < toBePlaced.Count; l++)
+ {
+ PathfindMovementPlayerunit pathfindMovementPlayerunit3 = toBePlaced[l];
+ if (!((pathfindMovementPlayerunit2.HomePosition - pathfindMovementPlayerunit3.HomePosition).magnitude > unitDistanceFromEachOther))
+ {
+ Vector3 vector2 = (pathfindMovementPlayerunit2.HomePosition - pathfindMovementPlayerunit3.HomePosition).normalized * unitDistanceMoveStep;
+ pathfindMovementPlayerunit2.HomePosition = astarPath.GetNearest(pathfindMovementPlayerunit2.HomePosition + vector2, pathfindMovementPlayerunit2.Flying ? nearestConstraintAir : nearestConstraint).position;
+ pathfindMovementPlayerunit3.HomePosition = astarPath.GetNearest(pathfindMovementPlayerunit3.HomePosition - vector2, pathfindMovementPlayerunit3.Flying ? nearestConstraintAir : nearestConstraint).position;
+ flag = true;
+ }
+ }
+ }
+ if (!flag)
+ {
+ break;
+ }
+ }
+ if (DayNightCycle.Instance.CurrentTimestate == DayNightCycle.Timestate.Day)
+ {
+ foreach (PathfindMovementPlayerunit item3 in toBePlaced)
+ {
+ item3.transform.position = item3.HomePosition;
+ item3.ClearCurrentPath();
+ }
+ }
+ playerUnitsCommandingBuffer.Clear();
+ playerUnitsCommandingBuffer.AddRange(toBePlaced);
+ }
+
+ public void OnUnitAdd(TaggedObject _t, bool _smartCommand)
+ {
+ if (_t == null || _t.Hp == null || !canCommandUnitsInThisMode)
+ {
+ return;
+ }
+ PathfindMovementPlayerunit pathfindMovementPlayerunit = (PathfindMovementPlayerunit)_t.Hp.PathfindMovement;
+ if (playerUnitsCommanding.Contains(pathfindMovementPlayerunit) || (_smartCommand && playerUnitsCommanding.Count > 0 && playerUnitsCommanding[0].name != _t.name))
+ {
+ return;
+ }
+ audioManager.PlaySoundAsOneShot(audioSet.AddedUnitToCommanding, 0.55f, 0.7f + (float)playerUnitsCommanding.Count * 0.025f, audioManager.mgSFX, 50);
+ playerUnitsCommanding.Add(pathfindMovementPlayerunit);
+ pathfindMovementPlayerunit.FollowPlayer(_follow: true);
+ MaterialFlasherFX componentInChildren = pathfindMovementPlayerunit.GetComponentInChildren<MaterialFlasherFX>();
+ if ((bool)componentInChildren)
+ {
+ componentInChildren.SetSelected(_selected: true);
+ }
+ _t.Tags.Add(TagManager.ETag.AUTO_Commanded);
+ if (playerUPgradeManager.commander)
+ {
+ pathfindMovementPlayerunit.movementSpeed *= commanderUnitMoveSpeedMulti;
+ return;
+ }
+ AutoAttack[] components = _t.GetComponents<AutoAttack>();
+ foreach (AutoAttack autoAttack in components)
+ {
+ autoAttack.enabled = false;
+ autoAttacksToEnable.Add(autoAttack);
+ }
+ }
+
+ public void OnUnitRemove(PathfindMovementPlayerunit _p)
+ {
+ if (canCommandUnitsInThisMode)
+ {
+ _p.HasReachedHomePositionAlready = false;
+ _p.FollowPlayer(_follow: false);
+ MaterialFlasherFX componentInChildren = _p.GetComponentInChildren<MaterialFlasherFX>();
+ if ((bool)componentInChildren)
+ {
+ componentInChildren.SetSelected(_selected: false);
+ }
+ _p.GetComponent<TaggedObject>().Tags.Remove(TagManager.ETag.AUTO_Commanded);
+ if (playerUPgradeManager.commander)
+ {
+ _p.movementSpeed /= commanderUnitMoveSpeedMulti;
+ }
+ }
+ }
+
+ private void TryToSelectUnits(List<TaggedObject> _select)
+ {
+ if (commanding)
+ {
+ PlaceCommandedUnitsAndCalculateTargetPositions(_smartCommand: false);
+ commanding = false;
+ return;
+ }
+ foreach (TaggedObject item in _select)
+ {
+ OnUnitAdd(item, _smartCommand: false);
+ }
+ commanding = playerUnitsCommanding.Count > 0;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ControlConfig.cs b/Thronefall_v1.57/Thronefall/Thronefall/ControlConfig.cs
new file mode 100644
index 0000000..9079dfa
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ControlConfig.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using Rewired;
+
+[Serializable]
+public class ControlConfig
+{
+ [Serializable]
+ public class ControllerData
+ {
+ public ControllerType controllerType;
+
+ public int controllerId;
+
+ public string jsonMap;
+
+ public List<int> knownActionIds = new List<int>();
+
+ public ControllerData(ControllerType controllerType, int controllerId, string jsonMap)
+ {
+ this.controllerType = controllerType;
+ this.controllerId = controllerId;
+ this.jsonMap = jsonMap;
+ knownActionIds = ControlConfigSaveLoad.GetAllKnownActionIDs();
+ }
+ }
+
+ public bool initialized;
+
+ public List<ControllerData> controllerDataSet = new List<ControllerData>();
+
+ public void Initialize(List<ControllerMap> maps)
+ {
+ controllerDataSet = new List<ControllerData>();
+ foreach (ControllerMap map in maps)
+ {
+ controllerDataSet.Add(new ControllerData(map.controllerType, map.controllerId, map.ToJsonString()));
+ }
+ initialized = true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ControlConfigSaveLoad.cs b/Thronefall_v1.57/Thronefall/Thronefall/ControlConfigSaveLoad.cs
new file mode 100644
index 0000000..0f06a1e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ControlConfigSaveLoad.cs
@@ -0,0 +1,110 @@
+using System.Collections.Generic;
+using System.IO;
+using Rewired;
+using UnityEngine;
+
+public static class ControlConfigSaveLoad
+{
+ private static string SavePath => Application.persistentDataPath + "/ControlsConfig.json";
+
+ public static void SaveControlConfigToJson()
+ {
+ try
+ {
+ Player player = ReInput.players.GetPlayer(0);
+ ControlConfig controlConfig = new ControlConfig();
+ controlConfig.Initialize(new List<ControllerMap>(player.controllers.maps.GetAllMaps()));
+ string contents = JsonUtility.ToJson(controlConfig);
+ File.WriteAllText(SavePath, contents);
+ Debug.Log("Control Config successfully saved.");
+ }
+ catch
+ {
+ Debug.LogError("There has been an error while trying to save the control config.");
+ }
+ }
+
+ public static void LoadControlConfigFromJson()
+ {
+ try
+ {
+ if (!File.Exists(SavePath))
+ {
+ return;
+ }
+ ControlConfig controlConfig = JsonUtility.FromJson<ControlConfig>(File.ReadAllText(SavePath));
+ Player player = ReInput.players.GetPlayer(0);
+ List<int> allKnownActionIDs = GetAllKnownActionIDs();
+ foreach (ControlConfig.ControllerData item in controlConfig.controllerDataSet)
+ {
+ Controller controller = ReInput.controllers.GetController(item.controllerType, item.controllerId);
+ if (controller != null)
+ {
+ try
+ {
+ ControllerMap controllerMap = ControllerMap.CreateFromJson(controller.type, item.jsonMap);
+ AddDefaultMappingsForNewActions(controller.identifier, controllerMap, item.knownActionIds, allKnownActionIDs);
+ player.controllers.maps.AddMap(controller, controllerMap);
+ }
+ catch
+ {
+ Debug.LogError("There was an error when trying to load a control map");
+ }
+ }
+ }
+ Debug.Log("Controls Config loaded.");
+ }
+ catch
+ {
+ Debug.Log("There has been an error while trying to load the control config.");
+ }
+ }
+
+ public static List<int> GetAllKnownActionIDs()
+ {
+ if (!ReInput.isReady)
+ {
+ return new List<int>();
+ }
+ List<int> list = new List<int>();
+ IList<InputAction> actions = ReInput.mapping.Actions;
+ for (int i = 0; i < actions.Count; i++)
+ {
+ list.Add(actions[i].id);
+ }
+ return list;
+ }
+
+ private static void AddDefaultMappingsForNewActions(ControllerIdentifier controllerIdentifier, ControllerMap controllerMap, List<int> knownActionIds, List<int> allActionIds)
+ {
+ if (controllerMap == null || knownActionIds == null || knownActionIds == null || knownActionIds.Count == 0)
+ {
+ return;
+ }
+ ControllerMap controllerMapInstance = ReInput.mapping.GetControllerMapInstance(controllerIdentifier, controllerMap.categoryId, controllerMap.layoutId);
+ if (controllerMapInstance == null)
+ {
+ return;
+ }
+ List<int> list = new List<int>();
+ foreach (int allActionId in allActionIds)
+ {
+ if (!knownActionIds.Contains(allActionId))
+ {
+ list.Add(allActionId);
+ }
+ }
+ if (list.Count == 0)
+ {
+ return;
+ }
+ foreach (ActionElementMap allMap in controllerMapInstance.AllMaps)
+ {
+ if (list.Contains(allMap.actionId) && !controllerMap.DoesElementAssignmentConflict(allMap))
+ {
+ ElementAssignment elementAssignment = new ElementAssignment(controllerMap.controllerType, allMap.elementType, allMap.elementIdentifierId, allMap.axisRange, allMap.keyCode, allMap.modifierKeyFlags, allMap.actionId, allMap.axisContribution, allMap.invert);
+ controllerMap.CreateElementMap(elementAssignment);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ControlMapButton.cs b/Thronefall_v1.57/Thronefall/Thronefall/ControlMapButton.cs
new file mode 100644
index 0000000..9693730
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ControlMapButton.cs
@@ -0,0 +1,193 @@
+using System.Collections.Generic;
+using I2.Loc;
+using Rewired;
+using TMPro;
+using UnityEngine;
+
+public class ControlMapButton : MonoBehaviour
+{
+ public enum AxisMode
+ {
+ Button,
+ Positive,
+ Negative
+ }
+
+ public TFUITextButton target;
+
+ public GameObject selectionIndicator;
+
+ public TextMeshProUGUI displayKeyboard;
+
+ public TextMeshProUGUI displayMouse;
+
+ public TextMeshProUGUI displayController;
+
+ private AxisMode axisMode;
+
+ private InputAction actionToMap;
+
+ private KeyRebinder targetRebinder;
+
+ private ActionElementMap keyMap;
+
+ private ActionElementMap mouseMap;
+
+ private ActionElementMap joystickMap;
+
+ private string descriptor
+ {
+ get
+ {
+ if (axisMode == AxisMode.Positive)
+ {
+ return actionToMap.name + " Positive";
+ }
+ if (axisMode == AxisMode.Negative)
+ {
+ return actionToMap.name + " Negative";
+ }
+ return actionToMap.name;
+ }
+ }
+
+ private void Start()
+ {
+ selectionIndicator.SetActive(value: false);
+ target.onApply.AddListener(OnApply);
+ target.onSelectionStateChange.AddListener(UpdateSelectionIndicator);
+ }
+
+ public void SetData(InputAction _action, KeyRebinder _rebinder, AxisMode _axisMode)
+ {
+ axisMode = _axisMode;
+ targetRebinder = _rebinder;
+ actionToMap = _action;
+ Refresh();
+ target.SetOriginalString(LocalizationManager.GetTermTranslation("Controls/" + descriptor));
+ }
+
+ public void Refresh()
+ {
+ UpdateMappings();
+ UpdateLabels();
+ }
+
+ private void UpdateMappings()
+ {
+ keyMap = null;
+ mouseMap = null;
+ joystickMap = null;
+ List<ActionElementMap> list = new List<ActionElementMap>();
+ if (targetRebinder.KeyboardMap != null)
+ {
+ list = new List<ActionElementMap>(targetRebinder.KeyboardMap.GetElementMapsWithAction(actionToMap.id));
+ }
+ List<ActionElementMap> list2 = new List<ActionElementMap>();
+ if (targetRebinder.MouseMap != null)
+ {
+ list2 = new List<ActionElementMap>(targetRebinder.MouseMap.GetElementMapsWithAction(actionToMap.id));
+ }
+ List<ActionElementMap> list3 = new List<ActionElementMap>();
+ if (targetRebinder.JoystickMap != null)
+ {
+ list3 = new List<ActionElementMap>(targetRebinder.JoystickMap.GetElementMapsWithAction(actionToMap.id));
+ }
+ for (int num = list.Count - 1; num >= 0; num--)
+ {
+ ActionElementMap actionElementMap = list[num];
+ switch (axisMode)
+ {
+ case AxisMode.Negative:
+ if (actionElementMap.axisContribution != Pole.Negative)
+ {
+ list.RemoveAt(num);
+ }
+ break;
+ case AxisMode.Positive:
+ if (actionElementMap.axisContribution != 0)
+ {
+ list.RemoveAt(num);
+ }
+ break;
+ }
+ }
+ for (int num2 = list2.Count - 1; num2 >= 0; num2--)
+ {
+ ActionElementMap actionElementMap2 = list2[num2];
+ switch (axisMode)
+ {
+ case AxisMode.Negative:
+ if (actionElementMap2.axisContribution != Pole.Negative)
+ {
+ list2.RemoveAt(num2);
+ }
+ break;
+ case AxisMode.Positive:
+ if (actionElementMap2.axisContribution != 0)
+ {
+ list2.RemoveAt(num2);
+ }
+ break;
+ }
+ }
+ for (int num3 = list3.Count - 1; num3 >= 0; num3--)
+ {
+ ActionElementMap actionElementMap3 = list3[num3];
+ switch (axisMode)
+ {
+ case AxisMode.Negative:
+ if (actionElementMap3.axisContribution != Pole.Negative)
+ {
+ list3.RemoveAt(num3);
+ }
+ break;
+ case AxisMode.Positive:
+ if (actionElementMap3.axisContribution != 0)
+ {
+ list3.RemoveAt(num3);
+ }
+ break;
+ }
+ }
+ if (list.Count > 0)
+ {
+ keyMap = list[0];
+ }
+ if (list2.Count > 0)
+ {
+ mouseMap = list2[0];
+ }
+ if (list3.Count > 0)
+ {
+ joystickMap = list3[0];
+ }
+ }
+
+ private void UpdateLabels()
+ {
+ string text = ((keyMap != null) ? keyMap.elementIdentifierName : "﹘");
+ string text2 = ((mouseMap != null) ? mouseMap.elementIdentifierName : "﹘");
+ string text3 = ((joystickMap == null) ? "﹘" : joystickMap.elementIdentifierName);
+ displayKeyboard.text = text;
+ displayMouse.text = text2;
+ displayController.text = text3;
+ }
+
+ private void OnApply()
+ {
+ targetRebinder.TriggerRebind(actionToMap, keyMap, mouseMap, joystickMap, axisMode);
+ }
+
+ private void UpdateSelectionIndicator()
+ {
+ if (target.CurrentState == ThronefallUIElement.SelectionState.Selected)
+ {
+ selectionIndicator.SetActive(value: true);
+ }
+ else
+ {
+ selectionIndicator.SetActive(value: false);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ControllerPicker.cs b/Thronefall_v1.57/Thronefall/Thronefall/ControllerPicker.cs
new file mode 100644
index 0000000..a4963c7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ControllerPicker.cs
@@ -0,0 +1,12 @@
+using UnityEngine;
+
+public class ControllerPicker : MonoBehaviour
+{
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/CostDisplay.cs b/Thronefall_v1.57/Thronefall/Thronefall/CostDisplay.cs
new file mode 100644
index 0000000..12b3059
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/CostDisplay.cs
@@ -0,0 +1,257 @@
+using System.Collections;
+using System.Collections.Generic;
+using MoreMountains.Feedbacks;
+using TMPro;
+using UnityEngine;
+
+public class CostDisplay : MonoBehaviour
+{
+ public Coinslot coinslotPrefab;
+
+ public Coin coinPrefab;
+
+ public RectTransform gridParent;
+
+ public float horizontalSpacing;
+
+ public int maxElementsPerRow = 5;
+
+ public AnimationCurve yDistribution = new AnimationCurve();
+
+ public float peakYOffset = 50f;
+
+ public float rowYSpacing = 100f;
+
+ public Transform amountDisplayParent;
+
+ public TextMeshProUGUI amountDisplay;
+
+ public MMF_Player displayCostAmountShow;
+
+ public MMF_Player displayCostAmountHide;
+
+ private List<Coinslot> coinslotPool = new List<Coinslot>();
+
+ private List<Coinslot> currentlyActiveCoinslots = new List<Coinslot>();
+
+ private float elementWidth;
+
+ private float yCurveLeftAnchor;
+
+ private float yCurveRightAnchor;
+
+ private bool reUpdateBecauseFuckUnityCanvas;
+
+ private int currentAmount;
+
+ private int currentlyFilledCoins;
+
+ private float completeFillDuration = 1f;
+
+ private float minFillDurationPerCoin = 0.15f;
+
+ private bool denied;
+
+ private bool inDisappearAnimation;
+
+ private const float defaultScale = 0.01f;
+
+ private const float largeUIScale = 0.0125f;
+
+ public static int currentlyFilledCoinsFromLastActiveDisplay;
+
+ public bool CompletelyFilled => currentlyFilledCoins >= currentAmount;
+
+ public bool CompletelyEmpty => currentlyFilledCoins <= 0;
+
+ private float TotalFillTime => Mathf.Clamp((float)currentlyActiveCoinslots.Count * minFillDurationPerCoin * 0.9f, 0.8f, 1.75f);
+
+ private void Start()
+ {
+ elementWidth = coinslotPrefab.GetComponent<RectTransform>().sizeDelta.x;
+ float num = (float)maxElementsPerRow * elementWidth + (float)(maxElementsPerRow - 1) * horizontalSpacing;
+ yCurveLeftAnchor = (0f - num) / 2f + elementWidth / 2f;
+ yCurveRightAnchor = num / 2f - elementWidth / 2f;
+ }
+
+ private void Update()
+ {
+ if (reUpdateBecauseFuckUnityCanvas)
+ {
+ UpdateDisplay(currentAmount, dirty: false);
+ }
+ }
+
+ public void UpdateDisplay(int amount, bool dirty = true)
+ {
+ if (SettingsManager.Instance.UseLargeInGameUI)
+ {
+ base.transform.localScale = Vector3.one * 0.0125f;
+ }
+ else
+ {
+ base.transform.localScale = Vector3.one * 0.01f;
+ }
+ inDisappearAnimation = false;
+ base.gameObject.SetActive(value: true);
+ StopAllCoroutines();
+ currentAmount = amount;
+ reUpdateBecauseFuckUnityCanvas = dirty;
+ currentlyActiveCoinslots.Clear();
+ currentlyFilledCoins = 0;
+ denied = false;
+ amountDisplayParent.gameObject.SetActive(value: false);
+ if (amount < 1)
+ {
+ foreach (Coinslot item in coinslotPool)
+ {
+ item.gameObject.SetActive(value: false);
+ }
+ return;
+ }
+ int num = amount - coinslotPool.Count;
+ for (int i = 0; i < num; i++)
+ {
+ coinslotPool.Add(Object.Instantiate(coinslotPrefab.gameObject, gridParent).GetComponent<Coinslot>());
+ }
+ int num2 = amount;
+ int num3 = num2;
+ if (num3 > maxElementsPerRow)
+ {
+ num3 = maxElementsPerRow;
+ }
+ int num4 = 0;
+ int num5 = 0;
+ float num6 = (0f - ((float)num3 * elementWidth + (float)(num3 - 1) * horizontalSpacing)) / 2f + elementWidth / 2f;
+ for (int j = 0; j < coinslotPool.Count; j++)
+ {
+ Coinslot coinslot = coinslotPool[j];
+ if (j < amount)
+ {
+ coinslot.gameObject.SetActive(value: true);
+ currentlyActiveCoinslots.Add(coinslot);
+ coinslot.transform.localScale = Vector3.zero;
+ float num7 = num6 + ((float)num4 * elementWidth + (float)num4 * horizontalSpacing);
+ float y = peakYOffset * yDistribution.Evaluate(Mathf.InverseLerp(yCurveLeftAnchor, yCurveRightAnchor, num7)) + rowYSpacing * (float)num5;
+ coinslotPool[j].GetComponent<RectTransform>().anchoredPosition = new Vector2(num7, y);
+ num4++;
+ num2--;
+ if (num4 >= maxElementsPerRow)
+ {
+ num3 = num2;
+ if (num3 > maxElementsPerRow)
+ {
+ num3 = maxElementsPerRow;
+ }
+ num4 = 0;
+ num5++;
+ num6 = (0f - ((float)num3 * elementWidth + (float)(num3 - 1) * horizontalSpacing)) / 2f + elementWidth / 2f;
+ }
+ }
+ else
+ {
+ coinslot.gameObject.SetActive(value: false);
+ }
+ }
+ foreach (Coinslot currentlyActiveCoinslot in currentlyActiveCoinslots)
+ {
+ currentlyActiveCoinslot.SetEmpty();
+ }
+ ThronefallAudioManager.SetCoinDisplayFillTime(TotalFillTime);
+ StartCoroutine(AnimateShowSlots());
+ }
+
+ public bool FillUp()
+ {
+ currentlyFilledCoinsFromLastActiveDisplay = currentlyFilledCoins;
+ if (currentlyActiveCoinslots.Count > currentlyFilledCoins)
+ {
+ float num = 1f / (TotalFillTime / (float)currentlyActiveCoinslots.Count);
+ if (currentlyActiveCoinslots[currentlyFilledCoins].AddFill(Time.deltaTime * num, currentlyActiveCoinslots.Count - 1 == currentlyFilledCoins))
+ {
+ currentlyFilledCoins++;
+ currentlyFilledCoinsFromLastActiveDisplay = currentlyFilledCoins;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void Deny()
+ {
+ if (!denied)
+ {
+ currentlyActiveCoinslots[currentlyFilledCoins].PlayDeny();
+ ThronefallAudioManager.Instance.MakeSureCoinFillSoundIsNotPlayingAnymore();
+ denied = true;
+ }
+ }
+
+ public void OnCompletion()
+ {
+ currentlyFilledCoins = 0;
+ currentlyFilledCoinsFromLastActiveDisplay = 0;
+ denied = false;
+ }
+
+ public void CancelFill(PlayerInteraction player)
+ {
+ foreach (Coinslot currentlyActiveCoinslot in currentlyActiveCoinslots)
+ {
+ if (currentlyActiveCoinslot.isFull)
+ {
+ Object.Instantiate(coinPrefab, currentlyActiveCoinslot.transform.position, currentlyActiveCoinslot.transform.rotation).SetTarget(player);
+ }
+ currentlyActiveCoinslot.SetEmpty();
+ }
+ ThronefallAudioManager.Oneshot(ThronefallAudioManager.AudioOneShot.CoinFillCancel);
+ currentlyFilledCoins = 0;
+ currentlyFilledCoinsFromLastActiveDisplay = 0;
+ denied = false;
+ }
+
+ private IEnumerator AnimateShowSlots()
+ {
+ float waitTime = 0.2f / (float)currentAmount;
+ if (currentAmount > maxElementsPerRow)
+ {
+ amountDisplayParent.gameObject.SetActive(value: true);
+ amountDisplay.text = "x" + currentAmount;
+ displayCostAmountShow.PlayFeedbacks();
+ yield return new WaitForSeconds(waitTime);
+ }
+ foreach (Coinslot currentlyActiveCoinslot in currentlyActiveCoinslots)
+ {
+ currentlyActiveCoinslot.Appear();
+ yield return new WaitForSeconds(waitTime);
+ }
+ }
+
+ public void Hide()
+ {
+ if (base.gameObject.activeSelf && !inDisappearAnimation)
+ {
+ inDisappearAnimation = true;
+ StopAllCoroutines();
+ StartCoroutine(AnimateHideSlots());
+ }
+ }
+
+ private IEnumerator AnimateHideSlots()
+ {
+ float waitTime = 0.2f / (float)currentAmount;
+ if (amountDisplay.gameObject.activeInHierarchy)
+ {
+ displayCostAmountHide.PlayFeedbacks();
+ yield return new WaitForSeconds(waitTime);
+ }
+ foreach (Coinslot currentlyActiveCoinslot in currentlyActiveCoinslots)
+ {
+ currentlyActiveCoinslot.Disappear();
+ yield return new WaitForSeconds(waitTime);
+ }
+ yield return new WaitForSeconds(1f);
+ inDisappearAnimation = false;
+ base.gameObject.SetActive(value: false);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/CurseBlastMA.cs b/Thronefall_v1.57/Thronefall/Thronefall/CurseBlastMA.cs
new file mode 100644
index 0000000..c57c60e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/CurseBlastMA.cs
@@ -0,0 +1,78 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class CurseBlastMA : ManualAttack
+{
+ public static CurseBlastMA instance;
+
+ private List<Hp> cursedHps = new List<Hp>();
+
+ private List<TaggedObject> cursedTags = new List<TaggedObject>();
+
+ private List<GameObject> cursedMarkers = new List<GameObject>();
+
+ [SerializeField]
+ private GameObject cursedMarkerPrefab;
+
+ [SerializeField]
+ private GameObject curseBlastFX;
+
+ [SerializeField]
+ private GameObject activatePlayerFX;
+
+ [SerializeField]
+ private Transform playerFXOrigin;
+
+ [SerializeField]
+ private AudioSource blastAudio;
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ public void AddCursedHp(Hp _hp, Weapon _immediatelyDamageEverybodyWith, TaggedObject _attacked, float _damageMultiplyer)
+ {
+ foreach (Hp cursedHp in cursedHps)
+ {
+ _immediatelyDamageEverybodyWith.DealDamage(cursedHp, _damageMultiplyer, null);
+ }
+ if (!cursedHps.Contains(_hp))
+ {
+ cursedHps.Add(_hp);
+ _attacked.AddTag(TagManager.ETag.VodooCursed);
+ cursedTags.Add(_attacked);
+ GameObject item = Object.Instantiate(cursedMarkerPrefab, _hp.transform.position, Quaternion.identity, _hp.transform);
+ cursedMarkers.Add(item);
+ }
+ }
+
+ public override void Attack()
+ {
+ Object.Instantiate(activatePlayerFX, playerFXOrigin.position, Quaternion.identity).AddComponent<FollowTransform>().target = playerFXOrigin;
+ blastAudio.pitch = Random.Range(0.9f, 1.1f);
+ blastAudio.Play();
+ foreach (Hp cursedHp in cursedHps)
+ {
+ weapon.DealDamage(cursedHp, base.AttackDamageMultiplyer, null);
+ if (cursedHp != null)
+ {
+ Object.Instantiate(curseBlastFX, cursedHp.gameObject.transform.position, Quaternion.identity).AddComponent<FollowTransform>().target = cursedHp.gameObject.transform;
+ }
+ }
+ cursedHps.Clear();
+ foreach (TaggedObject cursedTag in cursedTags)
+ {
+ cursedTag.RemoveTag(TagManager.ETag.VodooCursed);
+ }
+ cursedTags.Clear();
+ foreach (GameObject cursedMarker in cursedMarkers)
+ {
+ if (cursedMarker != null)
+ {
+ Object.Destroy(cursedMarker);
+ }
+ }
+ cursedMarkers.Clear();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/CurseEffect.cs b/Thronefall_v1.57/Thronefall/Thronefall/CurseEffect.cs
new file mode 100644
index 0000000..70d5cf7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/CurseEffect.cs
@@ -0,0 +1,13 @@
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "Weapon", menuName = "SimpleSiege/Cursed Blowpipe Effect")]
+public class CurseEffect : AdditionalWeaponEffectScript
+{
+ [SerializeField]
+ private Weapon weaponToDamageEverybody;
+
+ public override void Effect(Hp _hpHit, TaggedObject _attacked, TaggedObject _attacker, Weapon _weapon, float _damageMultiplyer)
+ {
+ CurseBlastMA.instance.AddCursedHp(_hpHit, weaponToDamageEverybody, _attacked, _damageMultiplyer);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/CustomPostProcess.cs b/Thronefall_v1.57/Thronefall/Thronefall/CustomPostProcess.cs
new file mode 100644
index 0000000..6b88bfc
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/CustomPostProcess.cs
@@ -0,0 +1,62 @@
+using System;
+using UnityEngine;
+using UnityEngine.Rendering;
+using UnityEngine.Rendering.Universal;
+
+public class CustomPostProcess : ScriptableRendererFeature
+{
+ private class CustomRenderPass : ScriptableRenderPass
+ {
+ public RenderTargetIdentifier source;
+
+ private Material mat;
+
+ private RenderTargetHandle tempRenderTargetHandle;
+
+ public CustomRenderPass(Material _mat)
+ {
+ mat = _mat;
+ tempRenderTargetHandle.Init("_TemporaryColorTexture");
+ }
+
+ public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData)
+ {
+ }
+
+ public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
+ {
+ CommandBuffer commandBuffer = CommandBufferPool.Get();
+ commandBuffer.GetTemporaryRT(tempRenderTargetHandle.id, renderingData.cameraData.cameraTargetDescriptor);
+ Blit(commandBuffer, source, tempRenderTargetHandle.Identifier(), mat);
+ Blit(commandBuffer, tempRenderTargetHandle.Identifier(), source);
+ context.ExecuteCommandBuffer(commandBuffer);
+ CommandBufferPool.Release(commandBuffer);
+ }
+
+ public override void OnCameraCleanup(CommandBuffer cmd)
+ {
+ }
+ }
+
+ [Serializable]
+ public class Settings
+ {
+ public Material material;
+ }
+
+ private CustomRenderPass m_ScriptablePass;
+
+ public Settings settings;
+
+ public override void Create()
+ {
+ m_ScriptablePass = new CustomRenderPass(settings.material);
+ m_ScriptablePass.renderPassEvent = RenderPassEvent.BeforeRenderingPostProcessing;
+ }
+
+ public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
+ {
+ m_ScriptablePass.source = renderer.cameraColorTarget;
+ renderer.EnqueuePass(m_ScriptablePass);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DamageModifyer.cs b/Thronefall_v1.57/Thronefall/Thronefall/DamageModifyer.cs
new file mode 100644
index 0000000..a7b80d7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DamageModifyer.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+
+[Serializable]
+public class DamageModifyer
+{
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public List<TagManager.ETag> requiredTags = new List<TagManager.ETag>();
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public float damageAdded;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public float damageMultiplyer = 1f;
+
+ public bool AppliesTo(TaggedObject _taggedObject)
+ {
+ for (int i = 0; i < requiredTags.Count; i++)
+ {
+ if (!_taggedObject.Tags.Contains(requiredTags[i]))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static float CalculateDamageOnTarget(TaggedObject _taggedObject, List<DamageModifyer> _damageModifyers, float _finalDamageMultiplyer = 1f)
+ {
+ float num = 0f;
+ for (int i = 0; i < _damageModifyers.Count; i++)
+ {
+ DamageModifyer damageModifyer = _damageModifyers[i];
+ if (damageModifyer.AppliesTo(_taggedObject))
+ {
+ num += damageModifyer.damageAdded;
+ num *= damageModifyer.damageMultiplyer;
+ }
+ }
+ return num * _finalDamageMultiplyer;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DamagePlayerWhenEnteringRange.cs b/Thronefall_v1.57/Thronefall/Thronefall/DamagePlayerWhenEnteringRange.cs
new file mode 100644
index 0000000..53ff55a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DamagePlayerWhenEnteringRange.cs
@@ -0,0 +1,94 @@
+using UnityEngine;
+
+public class DamagePlayerWhenEnteringRange : MonoBehaviour
+{
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float damageWhenEntering;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float addedDamageWhenEnteringWhileMoving;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float addedDamageWhenEnteringWhileSprinting;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float range;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float slowPlayerFor;
+
+ [SerializeField]
+ private TaggedObject myTaggedObject;
+
+ private TaggedObject playerTaggedObj;
+
+ private Transform transformPlayer;
+
+ private Hp playerHp;
+
+ private bool playerWasLastOutsideRange = true;
+
+ private PlayerMovement playerMovement;
+
+ private Vector3 previousPlayerPosition;
+
+ private void Start()
+ {
+ playerTaggedObj = TagManager.instance.Players[0];
+ transformPlayer = playerTaggedObj.transform;
+ playerHp = playerTaggedObj.Hp;
+ playerMovement = transformPlayer.GetComponent<PlayerMovement>();
+ PerkManager instance = PerkManager.instance;
+ if (instance.CurrentlyEquipped.Contains(instance.tigerGodPerk))
+ {
+ damageWhenEntering *= instance.tauntTheTiger_damageMultiplyer;
+ addedDamageWhenEnteringWhileMoving *= instance.tauntTheTiger_damageMultiplyer;
+ addedDamageWhenEnteringWhileSprinting *= instance.tauntTheTiger_damageMultiplyer;
+ }
+ if (instance.PrayToWarGodsActive)
+ {
+ damageWhenEntering *= instance.prayWarGods_dmgMulti;
+ addedDamageWhenEnteringWhileMoving *= instance.prayWarGods_dmgMulti;
+ addedDamageWhenEnteringWhileSprinting *= instance.prayWarGods_dmgMulti;
+ }
+ }
+
+ private void Update()
+ {
+ if (Vector3.Distance(base.transform.position, transformPlayer.position) <= range)
+ {
+ Vector3 velocity = playerMovement.Velocity;
+ Vector3 normalized = (transformPlayer.position - base.transform.position).normalized;
+ if (Vector3.Dot(velocity, normalized) < 0f && playerWasLastOutsideRange)
+ {
+ ApplyDamage();
+ }
+ playerWasLastOutsideRange = false;
+ }
+ else
+ {
+ playerWasLastOutsideRange = true;
+ }
+ }
+
+ private void ApplyDamage()
+ {
+ float num = damageWhenEntering;
+ if (playerMovement.Moving)
+ {
+ playerMovement.Slow(slowPlayerFor);
+ num += addedDamageWhenEnteringWhileMoving;
+ }
+ if (playerMovement.Sprinting)
+ {
+ playerMovement.Slow(slowPlayerFor);
+ num += addedDamageWhenEnteringWhileSprinting;
+ }
+ playerHp.TakeDamage(num, myTaggedObject);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DayCountdownUI.cs b/Thronefall_v1.57/Thronefall/Thronefall/DayCountdownUI.cs
new file mode 100644
index 0000000..a62655c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DayCountdownUI.cs
@@ -0,0 +1,33 @@
+using TMPro;
+using UnityEngine;
+
+public class DayCountdownUI : MonoBehaviour
+{
+ public GameObject parentToToggle;
+
+ public TextMeshProUGUI clockText;
+
+ private void Update()
+ {
+ if (DayNightCycle.Instance.CurrentTimestate == DayNightCycle.Timestate.Day)
+ {
+ if (!parentToToggle.activeSelf)
+ {
+ parentToToggle.SetActive(value: true);
+ }
+ int num = (int)DayNightCycle.Instance.RemainingAutoDayTime / 60;
+ int num2 = Mathf.RoundToInt(DayNightCycle.Instance.RemainingAutoDayTime % 60f);
+ string text = num + ":";
+ if (num2 < 10)
+ {
+ text += "0";
+ }
+ text += num2;
+ clockText.text = text;
+ }
+ else if (parentToToggle.activeSelf)
+ {
+ parentToToggle.SetActive(value: false);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DayNightCycle.cs b/Thronefall_v1.57/Thronefall/Thronefall/DayNightCycle.cs
new file mode 100644
index 0000000..77cf2e8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DayNightCycle.cs
@@ -0,0 +1,283 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class DayNightCycle : MonoBehaviour
+{
+ public interface IDaytimeSensitive
+ {
+ void OnDuskEarly();
+
+ void OnDusk();
+
+ void OnDawn_AfterSunrise();
+
+ void OnDawn_BeforeSunrise();
+ }
+
+ public enum Timestate
+ {
+ Day,
+ Night
+ }
+
+ private static DayNightCycle instance;
+
+ public float sunriseTime = 2.5f;
+
+ private Timestate currentTimestate;
+
+ private float currentNightLength;
+
+ private List<IDaytimeSensitive> daytimeSensitiveObjects = new List<IDaytimeSensitive>();
+
+ private bool afterSunrise = true;
+
+ private bool isInAutoMode;
+
+ private float autoDayCycleLength;
+
+ private float remainingAutoDayTime;
+
+ public static DayNightCycle Instance => instance;
+
+ public Timestate CurrentTimestate => currentTimestate;
+
+ public float CurrentNightLength => currentNightLength;
+
+ public bool AfterSunrise => afterSunrise;
+
+ public bool IsInAutoMode => isInAutoMode;
+
+ public float RemainingAutoDayTime => remainingAutoDayTime;
+
+ public int CoinCountToBeHarvested
+ {
+ get
+ {
+ int num = 0;
+ foreach (BuildingInteractor playerBuildingInteractor in TagManager.instance.playerBuildingInteractors)
+ {
+ if ((bool)playerBuildingInteractor.coinSpawner)
+ {
+ num += playerBuildingInteractor.coinSpawner.CoinsLeft;
+ }
+ if (playerBuildingInteractor.canBeHarvested)
+ {
+ num += playerBuildingInteractor.GoldIncome;
+ }
+ }
+ return num;
+ }
+ }
+
+ private void Awake()
+ {
+ if (instance != null)
+ {
+ UnityEngine.Object.Destroy(this);
+ }
+ else
+ {
+ instance = this;
+ }
+ }
+
+ private void Update()
+ {
+ if (LocalGamestate.Instance.CurrentState != LocalGamestate.State.InMatch)
+ {
+ return;
+ }
+ if (currentTimestate == Timestate.Night)
+ {
+ currentNightLength += Time.deltaTime;
+ }
+ if (currentTimestate == Timestate.Night && (bool)TagManager.instance && (bool)EnemySpawner.instance && !EnemySpawner.instance.SpawningInProgress && EnemySpawner.instance.NumberOfEnemiesOnTheMap <= 0 && base.gameObject.activeInHierarchy)
+ {
+ StartCoroutine(SwitchToDayCoroutine());
+ }
+ if (!isInAutoMode || TagManager.instance.CountObjectsWithTag(TagManager.ETag.CastleCenter) <= 0 || currentTimestate != 0)
+ {
+ return;
+ }
+ remainingAutoDayTime -= Time.deltaTime;
+ if (remainingAutoDayTime <= 0f)
+ {
+ remainingAutoDayTime = 0f;
+ if (ChoiceManager.instance.ChoiceCoroutineWaiting)
+ {
+ ChoiceManager.instance.CancelChoice();
+ UIFrameManager.instance.CloseAllFrames();
+ }
+ SwitchToNight();
+ }
+ }
+
+ private void DawnCallAfterSunrise()
+ {
+ afterSunrise = true;
+ Hp.ReviveAllKnockedOutPlayerUnitsAndBuildings();
+ for (int num = daytimeSensitiveObjects.Count - 1; num >= 0; num--)
+ {
+ try
+ {
+ if (daytimeSensitiveObjects[num] != null)
+ {
+ daytimeSensitiveObjects[num].OnDawn_AfterSunrise();
+ }
+ else
+ {
+ daytimeSensitiveObjects.RemoveAt(num);
+ }
+ }
+ catch (Exception message)
+ {
+ Debug.LogError(message);
+ }
+ }
+ ThronefallAudioManager.Oneshot(ThronefallAudioManager.AudioOneShot.BuildingRepair);
+ LevelData levelDataForActiveScene = LevelProgressManager.instance.GetLevelDataForActiveScene();
+ int networth = PlayerInteraction.instance.Networth;
+ networth += TagManager.instance.freeCoins.Count;
+ networth += CoinCountToBeHarvested;
+ levelDataForActiveScene.dayToDayNetworth.Add(networth);
+ PlayerInteraction component = TagManager.instance.Players[0].GetComponent<PlayerInteraction>();
+ foreach (Coin freeCoin in TagManager.instance.freeCoins)
+ {
+ if (freeCoin.IsFree)
+ {
+ freeCoin.SetTarget(component);
+ }
+ }
+ }
+
+ private void DawnCallBeforeSunrise()
+ {
+ remainingAutoDayTime = autoDayCycleLength;
+ afterSunrise = false;
+ for (int num = daytimeSensitiveObjects.Count - 1; num >= 0; num--)
+ {
+ try
+ {
+ if (daytimeSensitiveObjects[num] != null)
+ {
+ daytimeSensitiveObjects[num].OnDawn_BeforeSunrise();
+ }
+ else
+ {
+ daytimeSensitiveObjects.RemoveAt(num);
+ }
+ }
+ catch (Exception message)
+ {
+ Debug.LogError(message);
+ }
+ }
+ ThronefallAudioManager.Oneshot(ThronefallAudioManager.AudioOneShot.NightSurvived);
+ }
+
+ private void DuskCall()
+ {
+ afterSunrise = false;
+ currentNightLength = 0f;
+ List<TagManager.ETag> list = new List<TagManager.ETag>();
+ List<TagManager.ETag> list2 = new List<TagManager.ETag>();
+ list.Add(TagManager.ETag.PlayerOwned);
+ list2.Add(TagManager.ETag.AUTO_NoReviveNextMorning);
+ Hp.SetAllUnitsWithTagInvulnerable(list, list2, _invulnerable: false);
+ for (int num = daytimeSensitiveObjects.Count - 1; num >= 0; num--)
+ {
+ try
+ {
+ if (daytimeSensitiveObjects[num] != null)
+ {
+ daytimeSensitiveObjects[num].OnDuskEarly();
+ }
+ else
+ {
+ daytimeSensitiveObjects.RemoveAt(num);
+ }
+ }
+ catch (Exception message)
+ {
+ Debug.LogError(message);
+ }
+ }
+ for (int num2 = daytimeSensitiveObjects.Count - 1; num2 >= 0; num2--)
+ {
+ try
+ {
+ if (daytimeSensitiveObjects[num2] != null)
+ {
+ daytimeSensitiveObjects[num2].OnDusk();
+ }
+ else
+ {
+ daytimeSensitiveObjects.RemoveAt(num2);
+ }
+ }
+ catch (Exception message2)
+ {
+ Debug.LogError(message2);
+ }
+ }
+ }
+
+ public void ToggleDaytime()
+ {
+ if (currentTimestate == Timestate.Day)
+ {
+ currentTimestate = Timestate.Night;
+ DuskCall();
+ }
+ else
+ {
+ currentTimestate = Timestate.Day;
+ DawnCallBeforeSunrise();
+ DawnCallAfterSunrise();
+ }
+ }
+
+ private IEnumerator SwitchToDayCoroutine()
+ {
+ if (currentTimestate == Timestate.Night)
+ {
+ currentTimestate = Timestate.Day;
+ DawnCallBeforeSunrise();
+ yield return new WaitForSeconds(sunriseTime);
+ DawnCallAfterSunrise();
+ if (EnemySpawner.instance.Wavenumber >= EnemySpawner.instance.waves.Count - 1)
+ {
+ LocalGamestate.Instance.SetState(LocalGamestate.State.AfterMatchVictory);
+ }
+ }
+ }
+
+ public void SwitchToNight()
+ {
+ if (currentTimestate != Timestate.Night)
+ {
+ currentTimestate = Timestate.Night;
+ DuskCall();
+ }
+ }
+
+ public void RegisterDaytimeSensitiveObject(IDaytimeSensitive obj)
+ {
+ daytimeSensitiveObjects.Add(obj);
+ }
+
+ public void UnregisterDaytimeSensitiveObject(IDaytimeSensitive obj)
+ {
+ daytimeSensitiveObjects.Remove(obj);
+ }
+
+ public void SetToAuto(float cycleLength)
+ {
+ autoDayCycleLength = cycleLength;
+ remainingAutoDayTime = cycleLength;
+ isInAutoMode = true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DaytimeDisplay.cs b/Thronefall_v1.57/Thronefall/Thronefall/DaytimeDisplay.cs
new file mode 100644
index 0000000..e179fcc
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DaytimeDisplay.cs
@@ -0,0 +1,15 @@
+using TMPro;
+using UnityEngine;
+
+public class DaytimeDisplay : MonoBehaviour
+{
+ public TextMeshProUGUI display;
+
+ private void Update()
+ {
+ if ((bool)DayNightCycle.Instance)
+ {
+ display.text = DayNightCycle.Instance.CurrentTimestate.ToString();
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DaytimeSensitiveActivation.cs b/Thronefall_v1.57/Thronefall/Thronefall/DaytimeSensitiveActivation.cs
new file mode 100644
index 0000000..804aaf6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DaytimeSensitiveActivation.cs
@@ -0,0 +1,53 @@
+using UnityEngine;
+
+public class DaytimeSensitiveActivation : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ public DayNightCycle.Timestate activeTime;
+
+ public GameObject target;
+
+ public void OnDawn_AfterSunrise()
+ {
+ if (activeTime == DayNightCycle.Timestate.Day)
+ {
+ target.SetActive(value: true);
+ }
+ else
+ {
+ target.SetActive(value: false);
+ }
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public void OnDusk()
+ {
+ if (activeTime == DayNightCycle.Timestate.Night)
+ {
+ target.SetActive(value: true);
+ }
+ else
+ {
+ target.SetActive(value: false);
+ }
+ }
+
+ private void Start()
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ if (DayNightCycle.Instance.CurrentTimestate == DayNightCycle.Timestate.Day)
+ {
+ target.SetActive(activeTime == DayNightCycle.Timestate.Day);
+ }
+ else
+ {
+ target.SetActive(activeTime == DayNightCycle.Timestate.Night);
+ }
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DaytimeSensitiveLight.cs b/Thronefall_v1.57/Thronefall/Thronefall/DaytimeSensitiveLight.cs
new file mode 100644
index 0000000..830bfa1
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DaytimeSensitiveLight.cs
@@ -0,0 +1,87 @@
+using System.Collections;
+using UnityEngine;
+
+[RequireComponent(typeof(Light))]
+public class DaytimeSensitiveLight : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ [SerializeField]
+ private Color dayColor = Color.white;
+
+ [SerializeField]
+ private Color sunsetColor;
+
+ [SerializeField]
+ private Color nightColor;
+
+ [SerializeField]
+ private float dayToSunsetDuration = 2f;
+
+ [SerializeField]
+ private float sunsetToNightDuration = 2f;
+
+ private Light targetLight;
+
+ private void Start()
+ {
+ targetLight = GetComponent<Light>();
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDusk()
+ {
+ StopAllCoroutines();
+ StartCoroutine(ToNight());
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ StopAllCoroutines();
+ StartCoroutine(ToDay());
+ }
+
+ private IEnumerator ToDay()
+ {
+ float timer2 = 0f;
+ while (timer2 <= sunsetToNightDuration)
+ {
+ timer2 += Time.deltaTime;
+ targetLight.color = Color.Lerp(nightColor, sunsetColor, timer2 / sunsetToNightDuration);
+ yield return null;
+ }
+ timer2 = 0f;
+ while (timer2 <= dayToSunsetDuration)
+ {
+ timer2 += Time.deltaTime;
+ targetLight.color = Color.Lerp(sunsetColor, dayColor, timer2 / dayToSunsetDuration);
+ yield return null;
+ }
+ targetLight.color = dayColor;
+ }
+
+ private IEnumerator ToNight()
+ {
+ float timer2 = 0f;
+ while (timer2 <= dayToSunsetDuration)
+ {
+ timer2 += Time.deltaTime;
+ targetLight.color = Color.Lerp(dayColor, sunsetColor, timer2 / dayToSunsetDuration);
+ yield return null;
+ }
+ timer2 = 0f;
+ while (timer2 <= sunsetToNightDuration)
+ {
+ timer2 += Time.deltaTime;
+ targetLight.color = Color.Lerp(dayColor, nightColor, timer2 / sunsetToNightDuration);
+ yield return null;
+ }
+ targetLight.color = nightColor;
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DebugBuildingDestroyer.cs b/Thronefall_v1.57/Thronefall/Thronefall/DebugBuildingDestroyer.cs
new file mode 100644
index 0000000..4e9d10c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DebugBuildingDestroyer.cs
@@ -0,0 +1,33 @@
+using UnityEngine;
+
+public class DebugBuildingDestroyer : MonoBehaviour
+{
+ public LayerMask interactionLayer;
+
+ public float interactionRadius = 4f;
+
+ private void Update()
+ {
+ Collider[] array = Physics.OverlapSphere(base.transform.position, interactionRadius, interactionLayer);
+ Hp hp = null;
+ float num = float.PositiveInfinity;
+ Collider[] array2 = array;
+ foreach (Collider collider in array2)
+ {
+ Hp componentInParent = collider.GetComponentInParent<Hp>();
+ if (!(componentInParent.gameObject == base.gameObject) && (bool)componentInParent)
+ {
+ float num2 = Vector3.Distance(base.transform.position, collider.ClosestPoint(base.transform.position));
+ if (num2 < num)
+ {
+ hp = componentInParent;
+ num = num2;
+ }
+ }
+ }
+ if ((bool)hp && Input.GetKeyDown(KeyCode.LeftShift))
+ {
+ hp.TakeDamage(hp.maxHp);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DebugCoinDisplay.cs b/Thronefall_v1.57/Thronefall/Thronefall/DebugCoinDisplay.cs
new file mode 100644
index 0000000..b2f021d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DebugCoinDisplay.cs
@@ -0,0 +1,19 @@
+using TMPro;
+using UnityEngine;
+
+public class DebugCoinDisplay : MonoBehaviour
+{
+ public TextMeshProUGUI target;
+
+ private PlayerInteraction player;
+
+ private void Start()
+ {
+ player = Object.FindObjectOfType<PlayerInteraction>();
+ }
+
+ private void Update()
+ {
+ target.text = player.Balance.ToString();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DebugController.cs b/Thronefall_v1.57/Thronefall/Thronefall/DebugController.cs
new file mode 100644
index 0000000..ee6c012
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DebugController.cs
@@ -0,0 +1,138 @@
+using UnityEngine;
+
+public class DebugController : MonoBehaviour
+{
+ public enum SaveLoadMode
+ {
+ Normal,
+ LoadEmptySaveFileOnStartup,
+ LoadMaxedOutSaveFileOnStartup
+ }
+
+ [Tooltip("Set to -1 to disable")]
+ public int startGameInWave = -1;
+
+ public static DebugController instance;
+
+ [SerializeField]
+ private SaveLoadMode saveLoadMode;
+
+ public TextAsset emptySaveFile;
+
+ public TextAsset maxedSaveFile;
+
+ public KeyCode addCoin = KeyCode.Alpha2;
+
+ public KeyCode removeCoin = KeyCode.Alpha3;
+
+ public KeyCode getPoints = KeyCode.Alpha4;
+
+ public KeyCode upgradeAllBuildingsToMax = KeyCode.Alpha9;
+
+ public KeyCode reviveAllYourUnits = KeyCode.Alpha6;
+
+ public KeyCode killAllEnemyUnits = KeyCode.Alpha7;
+
+ public KeyCode restartScene = KeyCode.R;
+
+ public KeyCode spawnNextWave = KeyCode.T;
+
+ public KeyCode goToLevelSelect = KeyCode.Escape;
+
+ public KeyCode instaWinLevel = KeyCode.End;
+
+ public KeyCode causeLagSpike = KeyCode.L;
+
+ public KeyCode openTestChoice = KeyCode.C;
+
+ public KeyCode softWinLevel = KeyCode.Alpha8;
+
+ public KeyCode loseLevel = KeyCode.Q;
+
+ public KeyCode deletePlayerPrefs = KeyCode.Minus;
+
+ public KeyCode killPlayer = KeyCode.K;
+
+ public KeyCode enableDisableUI = KeyCode.KeypadMinus;
+
+ public KeyCode printNextWaveInfo = KeyCode.N;
+
+ private PlayerInteraction playerInteraction;
+
+ private float muteClock;
+
+ private bool muted;
+
+ private float initMasterVol;
+
+ public int StartGameInWave => -1;
+
+ public static SaveLoadMode SaveLoadModeToUse
+ {
+ get
+ {
+ if (instance == null)
+ {
+ return SaveLoadMode.Normal;
+ }
+ _ = instance.enabled;
+ return SaveLoadMode.Normal;
+ }
+ }
+
+ public static bool SaveTheGame
+ {
+ get
+ {
+ if (instance == null)
+ {
+ return true;
+ }
+ _ = instance.enabled;
+ return true;
+ }
+ }
+
+ private void Awake()
+ {
+ if (instance != null)
+ {
+ Object.Destroy(base.gameObject);
+ return;
+ }
+ instance = this;
+ Object.DontDestroyOnLoad(base.gameObject);
+ }
+
+ public void EnableUICanvases()
+ {
+ NightCall.instance.gameObject.SetActive(value: true);
+ UIFrameManager.instance.gameObject.SetActive(value: true);
+ }
+
+ private void Update()
+ {
+ }
+
+ public void LogChoice(Choice _choice)
+ {
+ if (_choice != null)
+ {
+ Debug.Log(_choice.name);
+ }
+ else
+ {
+ Debug.Log("Choice cancelled.");
+ }
+ }
+
+ public void Mute(float duration = 3f)
+ {
+ ThronefallAudioManager.Mute();
+ muted = true;
+ if (duration > muteClock)
+ {
+ muteClock = duration;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DemoQuitSwitch.cs b/Thronefall_v1.57/Thronefall/Thronefall/DemoQuitSwitch.cs
new file mode 100644
index 0000000..5f1f586
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DemoQuitSwitch.cs
@@ -0,0 +1,11 @@
+using UnityEngine;
+
+public class DemoQuitSwitch : MonoBehaviour
+{
+ public UIFrame demoFrame;
+
+ public void Trigger()
+ {
+ UIFrameManager.instance.QuitToDesktop();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DestroyAfter.cs b/Thronefall_v1.57/Thronefall/Thronefall/DestroyAfter.cs
new file mode 100644
index 0000000..b3a705b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DestroyAfter.cs
@@ -0,0 +1,15 @@
+using UnityEngine;
+
+public class DestroyAfter : MonoBehaviour
+{
+ public float destroyAfter = 5f;
+
+ private void Update()
+ {
+ destroyAfter -= Time.deltaTime;
+ if (destroyAfter <= 0f)
+ {
+ Object.Destroy(base.gameObject);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DestroyOrDisableOnEnable.cs b/Thronefall_v1.57/Thronefall/Thronefall/DestroyOrDisableOnEnable.cs
new file mode 100644
index 0000000..5879f90
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DestroyOrDisableOnEnable.cs
@@ -0,0 +1,27 @@
+using UnityEngine;
+
+public class DestroyOrDisableOnEnable : MonoBehaviour
+{
+ [SerializeField]
+ private Hp[] destroy;
+
+ [SerializeField]
+ private GameObject[] disable;
+
+ private void OnEnable()
+ {
+ Hp[] array = destroy;
+ foreach (Hp hp in array)
+ {
+ if (hp.gameObject.activeInHierarchy)
+ {
+ hp.TakeDamage(1E+09f);
+ }
+ }
+ GameObject[] array2 = disable;
+ for (int i = 0; i < array2.Length; i++)
+ {
+ array2[i].SetActive(value: false);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DisableButtonInWaveZero.cs b/Thronefall_v1.57/Thronefall/Thronefall/DisableButtonInWaveZero.cs
new file mode 100644
index 0000000..9534dff
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DisableButtonInWaveZero.cs
@@ -0,0 +1,25 @@
+using UnityEngine;
+using UnityEngine.SceneManagement;
+
+public class DisableButtonInWaveZero : MonoBehaviour
+{
+ public bool alwaysDisableInTutorial = true;
+
+ public bool disableInWaveZero = true;
+
+ public GameObject buttonToDisable;
+
+ public void OnEnable()
+ {
+ bool flag = SceneManager.GetActiveScene().name == "Neuland(Tutorial)";
+ bool flag2 = EnemySpawner.instance != null && EnemySpawner.instance.Wavenumber < 1;
+ if ((alwaysDisableInTutorial && flag) || (disableInWaveZero && flag2))
+ {
+ buttonToDisable.SetActive(value: false);
+ }
+ else
+ {
+ buttonToDisable.SetActive(value: true);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DisableOnStart.cs b/Thronefall_v1.57/Thronefall/Thronefall/DisableOnStart.cs
new file mode 100644
index 0000000..2a38cf4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DisableOnStart.cs
@@ -0,0 +1,9 @@
+using UnityEngine;
+
+public class DisableOnStart : MonoBehaviour
+{
+ private void Start()
+ {
+ base.gameObject.SetActive(value: false);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/DynamicLayoutGroupSpacing.cs b/Thronefall_v1.57/Thronefall/Thronefall/DynamicLayoutGroupSpacing.cs
new file mode 100644
index 0000000..11b5ee0
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/DynamicLayoutGroupSpacing.cs
@@ -0,0 +1,49 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+[RequireComponent(typeof(HorizontalLayoutGroup))]
+public class DynamicLayoutGroupSpacing : MonoBehaviour
+{
+ public int maxSpacing = 10;
+
+ public float maxWidth = 1070f;
+
+ private HorizontalLayoutGroup layout;
+
+ private RectTransform rectT;
+
+ private int bufferedChildCount;
+
+ private void Awake()
+ {
+ layout = GetComponent<HorizontalLayoutGroup>();
+ rectT = GetComponent<RectTransform>();
+ }
+
+ private void Update()
+ {
+ if (rectT.childCount != bufferedChildCount)
+ {
+ Refresh();
+ }
+ }
+
+ [ContextMenu("REFRESH")]
+ private void Refresh()
+ {
+ int num = 0;
+ float num2 = 0f;
+ foreach (RectTransform item in rectT)
+ {
+ num++;
+ num2 += item.sizeDelta.x;
+ }
+ float num3 = (maxWidth - num2) / ((float)num - 1f);
+ if (num3 > (float)maxSpacing)
+ {
+ num3 = maxSpacing;
+ }
+ layout.spacing = num3;
+ bufferedChildCount = rectT.childCount;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ETChoicePickScreen.cs b/Thronefall_v1.57/Thronefall/Thronefall/ETChoicePickScreen.cs
new file mode 100644
index 0000000..dc7ea17
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ETChoicePickScreen.cs
@@ -0,0 +1,294 @@
+using System.Collections.Generic;
+using TMPro;
+using UnityEngine;
+
+public class ETChoicePickScreen : MonoBehaviour
+{
+ public UIFrame targetFrame;
+
+ public ETMapChoiceDisplay displayPrefab;
+
+ public EternalTrialsMapPreview mapPreviewTT;
+
+ public GameObject tooltipObject;
+
+ public Transform choicesParent;
+
+ public Transform currentLoadoutParent;
+
+ public GameObject noLoadoutYet;
+
+ public TextMeshProUGUI currentLevelDisplay;
+
+ public TFUIEquippable perkTFUIPrefab;
+
+ private ETMapChoiceDisplay selectedChoice;
+
+ private ETMapChoiceDisplay[] choicesUIDisplays;
+
+ private TFUIEquippable[] currentLoadoutTFUIs;
+
+ private void Start()
+ {
+ targetFrame.onNewFocus.AddListener(OnTargetFrameFocusChange);
+ targetFrame.onNewSelection.AddListener(OnTargetFrameSelectionChange);
+ }
+
+ private void Update()
+ {
+ }
+
+ public void CheckForPerkDisable()
+ {
+ if (targetFrame.CurrentSelection == null)
+ {
+ return;
+ }
+ TFUIEquippable component = targetFrame.CurrentSelection.GetComponent<TFUIEquippable>();
+ if (!component)
+ {
+ return;
+ }
+ EquippablePerk equippablePerk = component.Data as EquippablePerk;
+ if ((bool)equippablePerk)
+ {
+ if (EternalTrialsRunManager.CurrentRun.disabledPerks.Contains(equippablePerk))
+ {
+ EternalTrialsRunManager.CurrentRun.disabledPerks.Remove(equippablePerk);
+ }
+ else
+ {
+ EternalTrialsRunManager.CurrentRun.disabledPerks.Add(equippablePerk);
+ }
+ component.SetDataEternalTrials(equippablePerk);
+ component.HardStateSet(ThronefallUIElement.SelectionState.Selected);
+ component.Pick();
+ }
+ }
+
+ public void Activate()
+ {
+ foreach (Transform item in choicesParent)
+ {
+ Object.Destroy(item.gameObject);
+ }
+ MapChoice[] mapChoices = EternalTrialsRunManager.GetMapChoices();
+ choicesUIDisplays = new ETMapChoiceDisplay[mapChoices.Length];
+ for (int i = 0; i < mapChoices.Length; i++)
+ {
+ ETMapChoiceDisplay eTMapChoiceDisplay = Object.Instantiate(displayPrefab, choicesParent);
+ eTMapChoiceDisplay.SetData(mapChoices[i], this);
+ choicesUIDisplays[i] = eTMapChoiceDisplay;
+ }
+ InitializeChoiceSelection();
+ string text = "<style=Body Bold>" + TextTranslator.Translate("Menu/Stage") + "<style=Body Numerals> " + (EternalTrialsRunManager.CurrentRun.stage + 1);
+ currentLevelDisplay.text = text;
+ foreach (Transform item2 in currentLoadoutParent)
+ {
+ Object.Destroy(item2.gameObject);
+ }
+ EquippablePerk[] array = EternalTrialsRunManager.CurrentRun.acquiredPerks.ToArray();
+ currentLoadoutTFUIs = new TFUIEquippable[array.Length];
+ noLoadoutYet.SetActive(array.Length == 0);
+ for (int j = 0; j < array.Length; j++)
+ {
+ currentLoadoutTFUIs[j] = Object.Instantiate(perkTFUIPrefab, currentLoadoutParent);
+ currentLoadoutTFUIs[j].SetDataEternalTrials(array[j]);
+ currentLoadoutTFUIs[j].Pick();
+ }
+ RecomputeAllNavigation();
+ }
+
+ public void ConfirmChoice(MapChoice choice)
+ {
+ EternalTrialsRunManager.ConfirmChoice(choice);
+ EternalTrialsRunManager.LoadNextMap();
+ }
+
+ private void InitializeChoiceSelection()
+ {
+ if (choicesUIDisplays.Length == 3)
+ {
+ SelectNewChoice(choicesUIDisplays[1], autoSelectPlayButton: false, makePlayButtonUIFrameDefaultSelection: true);
+ }
+ else
+ {
+ SelectNewChoice(choicesUIDisplays[0], autoSelectPlayButton: false, makePlayButtonUIFrameDefaultSelection: true);
+ }
+ }
+
+ private void SelectNewChoice(ETMapChoiceDisplay newChoice, bool autoSelectPlayButton, bool makePlayButtonUIFrameDefaultSelection = false)
+ {
+ selectedChoice = newChoice;
+ ETMapChoiceDisplay[] array = choicesUIDisplays;
+ foreach (ETMapChoiceDisplay eTMapChoiceDisplay in array)
+ {
+ if (eTMapChoiceDisplay != selectedChoice)
+ {
+ eTMapChoiceDisplay.Unselect();
+ }
+ }
+ selectedChoice.Select();
+ if (autoSelectPlayButton)
+ {
+ targetFrame.Select(selectedChoice.confirmButton);
+ }
+ if (makePlayButtonUIFrameDefaultSelection)
+ {
+ targetFrame.firstSelected = selectedChoice.confirmButton;
+ }
+ RecomputeCurrentLoadoutTFUINavigation();
+ mapPreviewTT.SetData(newChoice.Data.waveInfos, newChoice.Data.goldAtStart);
+ }
+
+ private void OnTargetFrameFocusChange()
+ {
+ if (!(targetFrame.CurrentFocus == null))
+ {
+ ETMapChoiceDisplay componentInParent = targetFrame.CurrentFocus.GetComponentInParent<ETMapChoiceDisplay>();
+ if (!(componentInParent == null) && componentInParent != selectedChoice)
+ {
+ SelectNewChoice(componentInParent, !(targetFrame.CurrentFocus is TFUIEquippable));
+ }
+ }
+ }
+
+ private void OnTargetFrameSelectionChange()
+ {
+ if (!(targetFrame.CurrentSelection == null))
+ {
+ ETMapChoiceDisplay componentInParent = targetFrame.CurrentSelection.GetComponentInParent<ETMapChoiceDisplay>();
+ if (!(componentInParent == null) && componentInParent != selectedChoice)
+ {
+ SelectNewChoice(componentInParent, !(targetFrame.CurrentSelection is TFUIEquippable));
+ }
+ }
+ }
+
+ private void RecomputeAllNavigation()
+ {
+ List<ETMapChoiceDisplay> list = new List<ETMapChoiceDisplay>();
+ ETMapChoiceDisplay[] array = choicesUIDisplays;
+ foreach (ETMapChoiceDisplay eTMapChoiceDisplay in array)
+ {
+ if (eTMapChoiceDisplay.currentPerkTFUIs.Length != 0)
+ {
+ list.Add(eTMapChoiceDisplay);
+ }
+ }
+ for (int j = 0; j < choicesUIDisplays.Length; j++)
+ {
+ ETMapChoiceDisplay eTMapChoiceDisplay2 = choicesUIDisplays[j];
+ for (int k = 0; k < eTMapChoiceDisplay2.currentPerkTFUIs.Length; k++)
+ {
+ if (eTMapChoiceDisplay2.currentPerkTFUIs.Length == 0)
+ {
+ break;
+ }
+ if (k == 0)
+ {
+ if (j == 0)
+ {
+ eTMapChoiceDisplay2.currentPerkTFUIs[k].leftNav = list[list.Count - 1].currentPerkTFUIs[list[list.Count - 1].currentPerkTFUIs.Length - 1];
+ }
+ else
+ {
+ eTMapChoiceDisplay2.currentPerkTFUIs[k].leftNav = list[j - 1].currentPerkTFUIs[list[j - 1].currentPerkTFUIs.Length - 1];
+ }
+ }
+ else
+ {
+ eTMapChoiceDisplay2.currentPerkTFUIs[k].leftNav = eTMapChoiceDisplay2.currentPerkTFUIs[k - 1];
+ }
+ if (k == eTMapChoiceDisplay2.currentPerkTFUIs.Length - 1)
+ {
+ if (j == list.Count - 1)
+ {
+ eTMapChoiceDisplay2.currentPerkTFUIs[k].rightNav = list[0].currentPerkTFUIs[0];
+ }
+ else
+ {
+ eTMapChoiceDisplay2.currentPerkTFUIs[k].rightNav = list[j + 1].currentPerkTFUIs[0];
+ }
+ }
+ else
+ {
+ eTMapChoiceDisplay2.currentPerkTFUIs[k].rightNav = eTMapChoiceDisplay2.currentPerkTFUIs[k + 1];
+ }
+ eTMapChoiceDisplay2.currentPerkTFUIs[k].topNav = eTMapChoiceDisplay2.weapon;
+ eTMapChoiceDisplay2.currentPerkTFUIs[k].botNav = eTMapChoiceDisplay2.confirmButton;
+ }
+ if (currentLoadoutTFUIs.Length != 0)
+ {
+ eTMapChoiceDisplay2.weapon.topNav = currentLoadoutTFUIs[currentLoadoutTFUIs.Length - 1];
+ eTMapChoiceDisplay2.confirmButton.botNav = currentLoadoutTFUIs[currentLoadoutTFUIs.Length - 1];
+ }
+ else
+ {
+ eTMapChoiceDisplay2.weapon.topNav = eTMapChoiceDisplay2.confirmButton;
+ eTMapChoiceDisplay2.confirmButton.botNav = eTMapChoiceDisplay2.weapon;
+ }
+ if (eTMapChoiceDisplay2.currentPerkTFUIs.Length != 0)
+ {
+ eTMapChoiceDisplay2.weapon.botNav = eTMapChoiceDisplay2.currentPerkTFUIs[0];
+ eTMapChoiceDisplay2.confirmButton.topNav = eTMapChoiceDisplay2.currentPerkTFUIs[0];
+ }
+ else
+ {
+ eTMapChoiceDisplay2.weapon.botNav = eTMapChoiceDisplay2.confirmButton;
+ eTMapChoiceDisplay2.confirmButton.topNav = eTMapChoiceDisplay2.weapon;
+ }
+ eTMapChoiceDisplay2.confirmButton.forceNavigateToDisabledElements = true;
+ if (j == 0)
+ {
+ eTMapChoiceDisplay2.confirmButton.leftNav = choicesUIDisplays[choicesUIDisplays.Length - 1].confirmButton;
+ eTMapChoiceDisplay2.weapon.leftNav = choicesUIDisplays[choicesUIDisplays.Length - 1].weapon;
+ }
+ else
+ {
+ eTMapChoiceDisplay2.confirmButton.leftNav = choicesUIDisplays[j - 1].confirmButton;
+ eTMapChoiceDisplay2.weapon.leftNav = choicesUIDisplays[j - 1].weapon;
+ }
+ if (j == choicesUIDisplays.Length - 1)
+ {
+ eTMapChoiceDisplay2.confirmButton.rightNav = choicesUIDisplays[0].confirmButton;
+ eTMapChoiceDisplay2.weapon.rightNav = choicesUIDisplays[0].weapon;
+ }
+ else
+ {
+ eTMapChoiceDisplay2.confirmButton.rightNav = choicesUIDisplays[j + 1].confirmButton;
+ eTMapChoiceDisplay2.weapon.rightNav = choicesUIDisplays[j + 1].weapon;
+ }
+ }
+ RecomputeCurrentLoadoutTFUINavigation();
+ }
+
+ private void RecomputeCurrentLoadoutTFUINavigation()
+ {
+ if (currentLoadoutTFUIs == null || currentLoadoutTFUIs.Length == 0)
+ {
+ return;
+ }
+ for (int i = 0; i < currentLoadoutTFUIs.Length; i++)
+ {
+ if (i == 0)
+ {
+ currentLoadoutTFUIs[i].rightNav = currentLoadoutTFUIs[currentLoadoutTFUIs.Length - 1];
+ }
+ else
+ {
+ currentLoadoutTFUIs[i].rightNav = currentLoadoutTFUIs[i - 1];
+ }
+ if (i == currentLoadoutTFUIs.Length - 1)
+ {
+ currentLoadoutTFUIs[i].leftNav = currentLoadoutTFUIs[0];
+ }
+ else
+ {
+ currentLoadoutTFUIs[i].leftNav = currentLoadoutTFUIs[i + 1];
+ }
+ currentLoadoutTFUIs[i].topNav = selectedChoice.confirmButton;
+ currentLoadoutTFUIs[i].botNav = selectedChoice.weapon;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ETMapChoiceDisplay.cs b/Thronefall_v1.57/Thronefall/Thronefall/ETMapChoiceDisplay.cs
new file mode 100644
index 0000000..4970c2a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ETMapChoiceDisplay.cs
@@ -0,0 +1,124 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using MPUIKIT;
+using UnityEngine;
+
+public class ETMapChoiceDisplay : MonoBehaviour
+{
+ [Serializable]
+ public class MapIcon
+ {
+ public string mapName;
+
+ public Sprite icon;
+ }
+
+ public ThronefallUIElement confirmButton;
+
+ public TFUIEquippable weapon;
+
+ public TFUIEquippable perkTFUIPrefab;
+
+ public Transform perkGroup;
+
+ public MPImage mapPreviewImage;
+
+ public List<MapIcon> mapIcons = new List<MapIcon>();
+
+ public Color imageUnselectedCol;
+
+ public Color outlineSelectedCol;
+
+ public Color outlineUnselectedCol;
+
+ public AnimationCurve scaleAnimationCurve;
+
+ public float animationTime = 0.3f;
+
+ public float targetScale = 1.15f;
+
+ private MapChoice data;
+
+ private ETChoicePickScreen target;
+
+ [HideInInspector]
+ public TFUIEquippable[] currentPerkTFUIs;
+
+ public MapChoice Data => data;
+
+ public void SetData(MapChoice choice, ETChoicePickScreen target)
+ {
+ this.target = target;
+ data = choice;
+ foreach (Transform item in perkGroup)
+ {
+ UnityEngine.Object.Destroy(item.gameObject);
+ }
+ weapon.SetData(data.containedWeapon, loadoutIsFixed: false, overrideShow: true);
+ currentPerkTFUIs = new TFUIEquippable[data.containedPerks.Count];
+ for (int i = 0; i < data.containedPerks.Count; i++)
+ {
+ currentPerkTFUIs[i] = UnityEngine.Object.Instantiate(perkTFUIPrefab, perkGroup);
+ currentPerkTFUIs[i].SetDataEternalTrials(data.containedPerks[i]);
+ }
+ confirmButton.onApply.AddListener(Confirm);
+ foreach (MapIcon mapIcon in mapIcons)
+ {
+ if (mapIcon.mapName == data.mapName)
+ {
+ mapPreviewImage.sprite = mapIcon.icon;
+ break;
+ }
+ }
+ }
+
+ public void Confirm()
+ {
+ target.ConfirmChoice(data);
+ }
+
+ public void Select()
+ {
+ StopAllCoroutines();
+ StartCoroutine(ScaleAnimation(base.transform.localScale, Vector3.one * targetScale, animationTime));
+ confirmButton.gameObject.SetActive(value: true);
+ weapon.Pick();
+ TFUIEquippable[] array = currentPerkTFUIs;
+ for (int i = 0; i < array.Length; i++)
+ {
+ array[i].Pick();
+ }
+ mapPreviewImage.color = Color.white;
+ mapPreviewImage.OutlineColor = outlineSelectedCol;
+ }
+
+ public void Unselect()
+ {
+ StopAllCoroutines();
+ StartCoroutine(ScaleAnimation(base.transform.localScale, Vector3.one, animationTime));
+ base.transform.localScale = Vector3.one;
+ confirmButton.gameObject.SetActive(value: false);
+ weapon.UnPick();
+ TFUIEquippable[] array = currentPerkTFUIs;
+ for (int i = 0; i < array.Length; i++)
+ {
+ array[i].UnPick();
+ }
+ mapPreviewImage.color = imageUnselectedCol;
+ mapPreviewImage.OutlineColor = outlineUnselectedCol;
+ }
+
+ private IEnumerator ScaleAnimation(Vector3 startScale, Vector3 targetScale, float time)
+ {
+ base.transform.localScale = startScale;
+ float clock = 0f;
+ while (clock <= time)
+ {
+ clock += Time.unscaledDeltaTime;
+ base.transform.localScale = Vector3.LerpUnclamped(startScale, targetScale, scaleAnimationCurve.Evaluate(Mathf.InverseLerp(0f, time, clock)));
+ yield return null;
+ }
+ base.transform.localScale = targetScale;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EconomySimulator.cs b/Thronefall_v1.57/Thronefall/Thronefall/EconomySimulator.cs
new file mode 100644
index 0000000..41c3562
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EconomySimulator.cs
@@ -0,0 +1,137 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class EconomySimulator
+{
+ private static List<VirtualBuilding> virtualBuildingsRef = new List<VirtualBuilding>();
+
+ public static List<VirtualBuilding> VirtualBuildings => virtualBuildingsRef;
+
+ public static void SimulateEconomy(out List<int> _OUTgoldSpentOnEconomyBeforeNight, out List<int> _OUTgoldSpentOnDefenseBeforeNight, out List<int> _OUTNetworthBeforeNight, out List<int> _OUTgoldEarnedInNight, out List<int> _OUTgoldDroppedInNight, out List<string> _OUTBuildorder, out List<int> _OUTDefensePower, List<VirtualBuilding> _virtualBuildings, int _startingGold, float _goldDropRate, int _minGoldDrops, int _maxGoldDrops, int _maxWaveCount)
+ {
+ virtualBuildingsRef = _virtualBuildings;
+ foreach (VirtualBuilding _virtualBuilding in _virtualBuildings)
+ {
+ _virtualBuilding.Reset();
+ }
+ _OUTgoldSpentOnEconomyBeforeNight = new List<int>();
+ _OUTgoldSpentOnDefenseBeforeNight = new List<int>();
+ _OUTNetworthBeforeNight = new List<int>();
+ _OUTgoldDroppedInNight = new List<int>();
+ _OUTgoldEarnedInNight = new List<int>();
+ _OUTBuildorder = new List<string>();
+ _OUTDefensePower = new List<int>();
+ int _virtualGold = _startingGold;
+ int num = _startingGold;
+ for (int i = 0; i < _maxWaveCount; i++)
+ {
+ int _budget = Mathf.FloorToInt((float)_virtualGold / 2f);
+ int _budget2 = _virtualGold - _budget;
+ if (i >= _maxWaveCount - 2)
+ {
+ _budget = _virtualGold;
+ _budget2 = 0;
+ }
+ string text = "";
+ text += SimulateSpending(ref _budget, ref _virtualGold, _virtualBuildings, _spendOnEconomy: false);
+ text += SimulateSpending(ref _budget2, ref _virtualGold, _virtualBuildings, _spendOnEconomy: true);
+ if (AllBuildingsBuilt(_virtualBuildings))
+ {
+ SimulateEconomy(out _OUTgoldSpentOnEconomyBeforeNight, out _OUTgoldSpentOnDefenseBeforeNight, out _OUTNetworthBeforeNight, out _OUTgoldEarnedInNight, out _OUTgoldDroppedInNight, out _OUTBuildorder, out _OUTDefensePower, _virtualBuildings, _startingGold, _goldDropRate, _minGoldDrops, _maxGoldDrops, i - 1);
+ break;
+ }
+ int num2 = 0;
+ foreach (VirtualBuilding _virtualBuilding2 in _virtualBuildings)
+ {
+ if (_virtualBuilding2.built)
+ {
+ num2 += _virtualBuilding2.income;
+ }
+ }
+ foreach (VirtualBuilding _virtualBuilding3 in _virtualBuildings)
+ {
+ if (_virtualBuilding3.built && _virtualBuilding3.callAfterIncome != null)
+ {
+ _virtualBuilding3.callAfterIncome.Invoke();
+ }
+ }
+ int num3 = Mathf.Clamp(Mathf.CeilToInt((float)num * _goldDropRate), _minGoldDrops, _maxGoldDrops);
+ if (i >= _maxWaveCount - 1)
+ {
+ num3 = 0;
+ }
+ _virtualGold += num2 + num3;
+ int num4 = 0;
+ int num5 = 0;
+ int num6 = 0;
+ foreach (VirtualBuilding _virtualBuilding4 in _virtualBuildings)
+ {
+ if (_virtualBuilding4.built)
+ {
+ if (_virtualBuilding4.economicBuilding)
+ {
+ num4 += _virtualBuilding4.cost;
+ }
+ else
+ {
+ num5 += _virtualBuilding4.cost;
+ }
+ num6 += _virtualBuilding4.defensePower;
+ }
+ }
+ _OUTgoldDroppedInNight.Add(num3);
+ _OUTNetworthBeforeNight.Add(num);
+ _OUTgoldSpentOnEconomyBeforeNight.Add(num4);
+ _OUTgoldSpentOnDefenseBeforeNight.Add(num5);
+ _OUTgoldEarnedInNight.Add(num2);
+ _OUTBuildorder.Add(text);
+ _OUTDefensePower.Add(num6);
+ num += num2 + num3;
+ }
+ }
+
+ private static VirtualBuilding FindBestBuilding(int budget, List<VirtualBuilding> buildings, bool spendOnEconomy)
+ {
+ float num = 0f;
+ VirtualBuilding result = null;
+ foreach (VirtualBuilding building in buildings)
+ {
+ if (building.economicBuilding == spendOnEconomy && building.IsBuildable(budget, buildings) && !building.built && building.priority > num)
+ {
+ num = building.priority;
+ result = building;
+ }
+ }
+ return result;
+ }
+
+ private static string SimulateSpending(ref int _budget, ref int _virtualGold, List<VirtualBuilding> _virtualBuildings, bool _spendOnEconomy)
+ {
+ string text = "";
+ for (int num = 10000; num >= 0; num--)
+ {
+ VirtualBuilding virtualBuilding = FindBestBuilding(_budget, _virtualBuildings, _spendOnEconomy);
+ if (virtualBuilding == null)
+ {
+ break;
+ }
+ _budget -= virtualBuilding.cost;
+ _virtualGold -= virtualBuilding.cost;
+ virtualBuilding.built = true;
+ text = text + "(" + virtualBuilding.name + " Level " + virtualBuilding.representingLevel + ") ";
+ }
+ return text;
+ }
+
+ private static bool AllBuildingsBuilt(List<VirtualBuilding> buildings)
+ {
+ foreach (VirtualBuilding building in buildings)
+ {
+ if (!building.built)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EliteTowers.cs b/Thronefall_v1.57/Thronefall/Thronefall/EliteTowers.cs
new file mode 100644
index 0000000..868bf35
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EliteTowers.cs
@@ -0,0 +1,79 @@
+using UnityEngine;
+
+public class EliteTowers : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ private bool eliteMode;
+
+ [SerializeField]
+ private GameObject eliteModeMarker;
+
+ [SerializeField]
+ private GameObject intactParent;
+
+ private void Start()
+ {
+ if (PerkManager.instance.EliteTowersEquipped)
+ {
+ if ((bool)DayNightCycle.Instance)
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ }
+ GetComponentInParent<BuildSlot>().OnUpgrade.AddListener(PutIntoEliteMode);
+ }
+ }
+
+ private void PutIntoEliteMode()
+ {
+ if (!eliteMode)
+ {
+ eliteMode = true;
+ eliteModeMarker.SetActive(value: true);
+ AutoAttack[] componentsInChildren = intactParent.GetComponentsInChildren<AutoAttack>();
+ for (int i = 0; i < componentsInChildren.Length; i++)
+ {
+ componentsInChildren[i].DamageMultiplyer *= PerkManager.instance.eliteTowerDamageMultiplyer;
+ }
+ HotOilTower[] componentsInChildren2 = intactParent.GetComponentsInChildren<HotOilTower>();
+ for (int i = 0; i < componentsInChildren2.Length; i++)
+ {
+ componentsInChildren2[i].DamageMultiplyer *= PerkManager.instance.eliteTowerDamageMultiplyer;
+ }
+ }
+ }
+
+ private void GoOutOfEliteMode()
+ {
+ if (eliteMode)
+ {
+ eliteMode = false;
+ eliteModeMarker.SetActive(value: false);
+ AutoAttack[] componentsInChildren = intactParent.GetComponentsInChildren<AutoAttack>();
+ for (int i = 0; i < componentsInChildren.Length; i++)
+ {
+ componentsInChildren[i].DamageMultiplyer /= PerkManager.instance.eliteTowerDamageMultiplyer;
+ }
+ HotOilTower[] componentsInChildren2 = intactParent.GetComponentsInChildren<HotOilTower>();
+ for (int i = 0; i < componentsInChildren2.Length; i++)
+ {
+ componentsInChildren2[i].DamageMultiplyer /= PerkManager.instance.eliteTowerDamageMultiplyer;
+ }
+ }
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+
+ public void OnDusk()
+ {
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ GoOutOfEliteMode();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EnableAllChildren.cs b/Thronefall_v1.57/Thronefall/Thronefall/EnableAllChildren.cs
new file mode 100644
index 0000000..6f13300
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EnableAllChildren.cs
@@ -0,0 +1,12 @@
+using UnityEngine;
+
+public class EnableAllChildren : MonoBehaviour
+{
+ private void Start()
+ {
+ for (int i = 0; i < base.transform.childCount; i++)
+ {
+ base.transform.GetChild(i).gameObject.SetActive(value: true);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EndOfMatchScoreUIHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/EndOfMatchScoreUIHelper.cs
new file mode 100644
index 0000000..b8298a6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EndOfMatchScoreUIHelper.cs
@@ -0,0 +1,728 @@
+using System.Collections;
+using MPUIKIT;
+using Rewired;
+using TMPro;
+using UnityEngine;
+
+public class EndOfMatchScoreUIHelper : MonoBehaviour
+{
+ [Header("Pre Frame")]
+ public GameObject preFrameParent;
+
+ public GameObject mainFrameParent;
+
+ public GameObject preFrameVictory;
+
+ public GameObject preFrameDefeat;
+
+ public RectTransform preFrameMask;
+
+ public CanvasGroup preFrameCG;
+
+ public CanvasGroup mainFrameCG;
+
+ public float preFrameMaskTargetHeight;
+
+ public AnimationCurve preFrameMaskACCurve;
+
+ public float preFrameAnimationTime = 0.75f;
+
+ public float preFrameWaittime;
+
+ public AudioSource audioSource;
+
+ [Header("Main Frame")]
+ public TextMeshProUGUI baseScore;
+
+ public TextMeshProUGUI goldScore;
+
+ public TextMeshProUGUI mutatorScore;
+
+ public TextMeshProUGUI noRetriesScore;
+
+ public TextMeshProUGUI overallScore;
+
+ public TextMeshProUGUI bestScore;
+
+ public TextMeshProUGUI levelDisplay;
+
+ public TextMeshProUGUI xpDisplay;
+
+ public TextMeshProUGUI levelUpLevelDisplay;
+
+ public TextMeshProUGUI levelUpRewardDescription;
+
+ public TextMeshProUGUI victoryDisplay;
+
+ public TextMeshProUGUI defeatDisplay;
+
+ public TextMeshProUGUI baseScoreName;
+
+ public TextMeshProUGUI goldBonusName;
+
+ public TextMeshProUGUI MutatorBonusName;
+
+ public TextMeshProUGUI noRetryBonusName;
+
+ public GameObject victoryParent;
+
+ public GameObject defeatParent;
+
+ public GameObject newHighscoreIndicator;
+
+ public GameObject progressionBarParent;
+
+ public GameObject demoMaxLevel;
+
+ public GameObject regularMaxLevel;
+
+ public GameObject rewardWaitIndicator;
+
+ public GameObject victoryButtonsClassic;
+
+ public GameObject defeatButtonsClassic;
+
+ public GameObject victoryButtonsET;
+
+ public GameObject defeatButtonsET;
+
+ public GameObject dividerParent;
+
+ public GameObject progressionBarORMaxLevelParent;
+
+ public GameObject progressionBarOnly;
+
+ public GameObject nextPerk;
+
+ public MPImageBasic xpFill;
+
+ public MPImageBasic nextUnlockIcon;
+
+ public MPImageBasic nextunlockBG;
+
+ public MPImageBasic levelUpRewardIcon;
+
+ public MPImageBasic levelUpRewardBg;
+
+ public MPImageBasic rewardWaitFill;
+
+ public Color weaponBG;
+
+ public Color perkBG;
+
+ public Color mutatorBG;
+
+ public Color perkpointBG;
+
+ public Color buildingUpgradeBG;
+
+ public ThronefallUIElement victoryClassicSelectedButton;
+
+ public ThronefallUIElement defeatClassicSelectedButton;
+
+ public ThronefallUIElement victoryETSelectedButton;
+
+ public ThronefallUIElement defeatETSelectedButton;
+
+ public ThronefallUIElement rewardAcceptButton;
+
+ public UIFrame rewardFrame;
+
+ public AnimationCurve popShowCurve;
+
+ public AnimationCurve bumpCurve;
+
+ public AnimationCurve scoreFillWiggle;
+
+ [Header("Animation Sequences")]
+ public IUIAnimationSequence eternalTrialsVictory;
+
+ public IUIAnimationSequence eternalTrialsDefeat;
+
+ [Header("Settings")]
+ [SerializeField]
+ private float timeToFillUpABar = 3f;
+
+ [SerializeField]
+ private float waitAtBeginning = 0.25f;
+
+ [SerializeField]
+ private float waitAfterFillingUpABar = 0.25f;
+
+ [SerializeField]
+ private float waitAfterReward = 2f;
+
+ [SerializeField]
+ private float waitWhenMaxLevelAlreadyReached = 0.5f;
+
+ private MetaLevel nextMetaLevel;
+
+ private PerkManager perkManager;
+
+ private Player input;
+
+ private UIFrame frame;
+
+ private bool inAnimation;
+
+ private bool inScoreUnroll;
+
+ private int baseScoreThisRound;
+
+ private int goldScoreThisRound;
+
+ private int mutatorScoreThisRound;
+
+ private int noRetryScoreThisRound;
+
+ private int overallScoreThisRound;
+
+ private int animationNextScore;
+
+ private float defaultWaitStep = 0.5f;
+
+ private float minorWaitStep = 0.25f;
+
+ private float animationStepA = 1.5f;
+
+ private float animationStepB = 0.5f;
+
+ private bool skipScoringAnimation;
+
+ private Coroutine currentScoringAnimation;
+
+ private void Update()
+ {
+ if (input.GetButtonDown("Interact") && inScoreUnroll)
+ {
+ if (currentScoringAnimation != null)
+ {
+ StopCoroutine(currentScoringAnimation);
+ }
+ currentScoringAnimation = null;
+ audioSource.Stop();
+ skipScoringAnimation = true;
+ inScoreUnroll = false;
+ }
+ }
+
+ public void OnActivate()
+ {
+ if ((bool)LocalGamestate.Instance && LocalGamestate.Instance.endScreenShownThisMatch)
+ {
+ Time.timeScale = 0f;
+ }
+ else if (!inAnimation)
+ {
+ if ((bool)LocalGamestate.Instance)
+ {
+ LocalGamestate.Instance.endScreenShownThisMatch = true;
+ }
+ inAnimation = true;
+ inScoreUnroll = false;
+ skipScoringAnimation = false;
+ perkManager = PerkManager.instance;
+ input = ReInput.players.GetPlayer(0);
+ frame = GetComponent<UIFrame>();
+ eternalTrialsDefeat.Reset();
+ eternalTrialsVictory.Reset();
+ mainFrameParent.SetActive(value: false);
+ preFrameParent.SetActive(value: true);
+ preFrameMask.sizeDelta = new Vector2(preFrameMask.sizeDelta.x, 0f);
+ preFrameCG.alpha = 0f;
+ if (LocalGamestate.Instance.CurrentState == LocalGamestate.State.AfterMatchVictory)
+ {
+ preFrameVictory.SetActive(value: true);
+ preFrameDefeat.SetActive(value: false);
+ audioSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.Victory);
+ }
+ else
+ {
+ preFrameVictory.SetActive(value: false);
+ preFrameDefeat.SetActive(value: true);
+ audioSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.Defeat);
+ }
+ StartCoroutine(ActivateAnimation());
+ }
+ }
+
+ public void OnContinue()
+ {
+ SceneTransitionManager.instance.TransitionFromEndScreenToLevelSelect();
+ }
+
+ public void OnTryAgain()
+ {
+ SceneTransitionManager.instance.RestartCurrentLevel();
+ }
+
+ public void OnTryAgainET()
+ {
+ EternalTrialsRunManager.CreateFreshRun();
+ UIFrameManager.OpenEternalTrialsLoadoutPick();
+ }
+
+ public void OnContinueET()
+ {
+ UIFrameManager.OpenEternalTrialsLoadoutPick();
+ }
+
+ public void ToMenuET()
+ {
+ SceneTransitionManager.instance.TransitionFromEndScreenToLevelSelect();
+ }
+
+ private IEnumerator ActivateAnimation()
+ {
+ float preFrameTimer = 0f;
+ while (preFrameTimer < preFrameAnimationTime)
+ {
+ preFrameTimer += Time.unscaledDeltaTime;
+ float num = preFrameMaskACCurve.Evaluate(Mathf.InverseLerp(0f, preFrameAnimationTime, preFrameTimer));
+ Vector2 sizeDelta = new Vector2(preFrameMask.sizeDelta.x, Mathf.Lerp(0f, preFrameMaskTargetHeight, num));
+ preFrameMask.sizeDelta = sizeDelta;
+ preFrameCG.alpha = num;
+ yield return null;
+ }
+ preFrameMask.sizeDelta = new Vector2(preFrameMask.sizeDelta.x, preFrameMaskTargetHeight);
+ preFrameCG.alpha = 1f;
+ if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.Classic)
+ {
+ yield return StartCoroutine(ClassicModeAnimationSequence());
+ }
+ else if (LocalGamestate.Instance.CurrentState == LocalGamestate.State.AfterMatchVictory)
+ {
+ yield return StartCoroutine(eternalTrialsVictory.PlayAnimation(frame));
+ }
+ else
+ {
+ yield return StartCoroutine(eternalTrialsDefeat.PlayAnimation(frame));
+ }
+ inAnimation = false;
+ yield return null;
+ }
+
+ private IEnumerator ClassicModeAnimationSequence()
+ {
+ victoryDisplay.text = TextTranslator.Translate("Menu/Victory") + ".";
+ defeatDisplay.text = TextTranslator.Translate("Menu/Defeat") + ".";
+ if (LocalGamestate.Instance.CurrentState == LocalGamestate.State.AfterMatchDefeat)
+ {
+ victoryParent.SetActive(value: false);
+ defeatParent.SetActive(value: true);
+ }
+ else
+ {
+ victoryParent.SetActive(value: true);
+ defeatParent.SetActive(value: false);
+ }
+ baseScore.gameObject.SetActive(value: false);
+ baseScoreName.gameObject.SetActive(value: false);
+ goldScore.gameObject.SetActive(value: false);
+ goldBonusName.gameObject.SetActive(value: false);
+ mutatorScore.gameObject.SetActive(value: false);
+ noRetriesScore.gameObject.SetActive(value: false);
+ noRetryBonusName.gameObject.SetActive(value: false);
+ MutatorBonusName.gameObject.SetActive(value: false);
+ dividerParent.SetActive(value: false);
+ progressionBarORMaxLevelParent.SetActive(value: false);
+ levelDisplay.gameObject.SetActive(value: false);
+ newHighscoreIndicator.SetActive(value: false);
+ victoryButtonsClassic.SetActive(value: false);
+ defeatButtonsClassic.SetActive(value: false);
+ victoryButtonsET.SetActive(value: false);
+ defeatButtonsET.SetActive(value: false);
+ demoMaxLevel.SetActive(value: false);
+ regularMaxLevel.SetActive(value: false);
+ progressionBarParent.SetActive(value: true);
+ yield return new WaitForSecondsRealtime(preFrameWaittime);
+ mainFrameCG.alpha = 0f;
+ mainFrameParent.SetActive(value: true);
+ float mainFrameFadeTimer = 0f;
+ float fadeTime = 0.25f;
+ while (mainFrameFadeTimer < fadeTime)
+ {
+ mainFrameFadeTimer += Time.unscaledDeltaTime;
+ mainFrameCG.alpha = mainFrameFadeTimer / fadeTime;
+ yield return null;
+ }
+ mainFrameCG.alpha = 1f;
+ preFrameParent.SetActive(value: false);
+ Time.timeScale = 0f;
+ currentScoringAnimation = StartCoroutine(UnrollScores());
+ while (currentScoringAnimation != null)
+ {
+ yield return null;
+ }
+ if (skipScoringAnimation)
+ {
+ SkipUnrollScores();
+ }
+ if (SceneTransitionManager.instance.TotalScoreFromLastMatchIsNewPersonalRecord)
+ {
+ newHighscoreIndicator.SetActive(value: true);
+ yield return StartCoroutine(PopShowTransform(newHighscoreIndicator.transform, ThronefallAudioManager.Instance.audioContent.NewHighscore, popShowCurve, 0.5f));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ }
+ else
+ {
+ newHighscoreIndicator.SetActive(value: false);
+ }
+ int xpToGive = SceneTransitionManager.instance.TotalScoreFromLastMatch;
+ GetNextMetaLevel();
+ if (nextMetaLevel != null)
+ {
+ UpdateLevelingBar();
+ }
+ levelDisplay.text = TextTranslator.Translate("Menu/Level") + " <style=\"Body Numerals\">" + perkManager.level;
+ levelDisplay.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(levelDisplay.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildB, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ progressionBarORMaxLevelParent.SetActive(value: true);
+ StartCoroutine(PopShowTransform(progressionBarORMaxLevelParent.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildC, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(defaultWaitStep);
+ inAnimation = true;
+ if (nextMetaLevel != null)
+ {
+ nextUnlockIcon.sprite = nextMetaLevel.reward.icon;
+ nextunlockBG.color = GetColorForEquippable(nextMetaLevel.reward);
+ UpdateLevelingBar();
+ yield return StartCoroutine(FillUpXPBar(xpToGive));
+ }
+ else
+ {
+ yield return new WaitForSecondsRealtime(waitWhenMaxLevelAlreadyReached);
+ }
+ inAnimation = false;
+ LevelProgressManager.instance.GetLevelDataForScene(SceneTransitionManager.instance.ComingFromGameplayScene).SaveScoreAndStatsToBestIfBest(_endOfMatch: true);
+ SteamManager.Instance.UploadHighscore(SceneTransitionManager.instance.TotalScoreFromLastMatch, SceneTransitionManager.instance.ComingFromGameplayScene);
+ SaveLoadManager.instance.SaveGame();
+ if (LocalGamestate.Instance.CurrentState == LocalGamestate.State.AfterMatchDefeat)
+ {
+ if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.Classic)
+ {
+ defeatButtonsClassic.SetActive(value: true);
+ frame.Select(defeatClassicSelectedButton);
+ }
+ else
+ {
+ defeatButtonsET.SetActive(value: true);
+ frame.Select(defeatETSelectedButton);
+ }
+ }
+ else if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.Classic)
+ {
+ victoryButtonsClassic.SetActive(value: true);
+ frame.Select(victoryClassicSelectedButton);
+ }
+ else
+ {
+ victoryButtonsET.SetActive(value: true);
+ frame.Select(victoryETSelectedButton);
+ }
+ }
+
+ private void GetNextMetaLevel()
+ {
+ nextMetaLevel = perkManager.NextMetaLevel;
+ if (nextMetaLevel == null)
+ {
+ EnableMaxLevelReachedUI();
+ }
+ }
+
+ private void EnableMaxLevelReachedUI()
+ {
+ progressionBarParent.SetActive(value: false);
+ regularMaxLevel.SetActive(value: true);
+ AchievementManager.UnlockAchievement(AchievementManager.Achievements.MAXLEVEL_REACHED);
+ }
+
+ private void EnableDemoLockedUI()
+ {
+ progressionBarParent.SetActive(value: false);
+ demoMaxLevel.SetActive(value: true);
+ }
+
+ private void EnableRewardDisplayUI()
+ {
+ levelUpLevelDisplay.text = TextTranslator.Translate("Menu/Level") + " <style=\"Body Numerals\">" + (1 + perkManager.level);
+ levelUpRewardIcon.sprite = nextMetaLevel.reward.icon;
+ levelUpRewardBg.color = GetColorForEquippable(nextMetaLevel.reward);
+ levelUpRewardDescription.text = "<style=\"Header\"><size=30>" + TextTranslator.Translate(nextMetaLevel.reward.LOCIDENTIFIER_NAME) + "</style><style=\"Body Light\"><size=20>\n" + TextTranslator.Translate(nextMetaLevel.reward.LOCIDENTIFIER_DESCRIPTION);
+ UIFrameManager.ShowLevelUpReward();
+ }
+
+ private void UpdateLevelingBar()
+ {
+ xpDisplay.text = perkManager.xp + " / " + nextMetaLevel.requiredXp;
+ xpFill.fillAmount = (float)perkManager.xp / (float)nextMetaLevel.requiredXp;
+ }
+
+ private IEnumerator UnrollScores()
+ {
+ inScoreUnroll = true;
+ baseScoreThisRound = SceneTransitionManager.instance.IngameScoreFromLastMatch;
+ goldScoreThisRound = SceneTransitionManager.instance.GoldBonusScoreFromLastMatch;
+ mutatorScoreThisRound = SceneTransitionManager.instance.MutatorBonusScoreFromLastMatch;
+ noRetryScoreThisRound = SceneTransitionManager.instance.NoRetryBonusScoreFromLastMatch;
+ overallScoreThisRound = 0;
+ animationNextScore = 0;
+ baseScore.text = baseScoreThisRound.ToString();
+ goldScore.text = goldScoreThisRound.ToString();
+ mutatorScore.text = mutatorScoreThisRound.ToString();
+ noRetriesScore.text = noRetryScoreThisRound.ToString();
+ overallScore.text = overallScoreThisRound.ToString();
+ bestScore.text = SceneTransitionManager.instance.LevelDataFromLastMatch.highscoreBest.ToString();
+ dividerParent.SetActive(value: true);
+ StartCoroutine(PopShowTransform(dividerParent.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildB, popShowCurve, animationStepB));
+ baseScoreName.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(baseScoreName.transform, null, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ baseScore.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(baseScore.transform, null, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ yield return AddToOverallScore(baseScoreThisRound, animationStepA);
+ goldBonusName.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(goldBonusName.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildC, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ goldScore.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(goldScore.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildA, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ yield return AddToOverallScore(goldScoreThisRound, animationStepA);
+ MutatorBonusName.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(MutatorBonusName.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildC, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ mutatorScore.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(mutatorScore.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildA, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ yield return AddToOverallScore(mutatorScoreThisRound, animationStepA);
+ noRetryBonusName.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(noRetryBonusName.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildC, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ noRetriesScore.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(noRetriesScore.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildA, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ yield return AddToOverallScore(noRetryScoreThisRound, animationStepA);
+ currentScoringAnimation = null;
+ }
+
+ private void SkipUnrollScores()
+ {
+ baseScoreThisRound = SceneTransitionManager.instance.IngameScoreFromLastMatch;
+ goldScoreThisRound = SceneTransitionManager.instance.GoldBonusScoreFromLastMatch;
+ mutatorScoreThisRound = SceneTransitionManager.instance.MutatorBonusScoreFromLastMatch;
+ noRetryScoreThisRound = SceneTransitionManager.instance.NoRetryBonusScoreFromLastMatch;
+ overallScoreThisRound = SceneTransitionManager.instance.TotalScoreFromLastMatch;
+ baseScore.text = baseScoreThisRound.ToString();
+ goldScore.text = goldScoreThisRound.ToString();
+ mutatorScore.text = mutatorScoreThisRound.ToString();
+ noRetriesScore.text = noRetryScoreThisRound.ToString();
+ overallScore.text = overallScoreThisRound.ToString();
+ newHighscoreIndicator.SetActive(SceneTransitionManager.instance.TotalScoreFromLastMatchIsNewPersonalRecord);
+ bestScore.text = SceneTransitionManager.instance.LevelDataFromLastMatch.highscoreBest.ToString();
+ dividerParent.SetActive(value: true);
+ baseScoreName.gameObject.SetActive(value: true);
+ baseScore.gameObject.SetActive(value: true);
+ goldBonusName.gameObject.SetActive(value: true);
+ goldScore.gameObject.SetActive(value: true);
+ MutatorBonusName.gameObject.SetActive(value: true);
+ mutatorScore.gameObject.SetActive(value: true);
+ noRetryBonusName.gameObject.SetActive(value: true);
+ noRetriesScore.gameObject.SetActive(value: true);
+ dividerParent.transform.localScale = Vector3.one;
+ baseScoreName.transform.localScale = Vector3.one;
+ baseScore.transform.localScale = Vector3.one;
+ goldBonusName.transform.localScale = Vector3.one;
+ goldScore.transform.localScale = Vector3.one;
+ MutatorBonusName.transform.localScale = Vector3.one;
+ mutatorScore.transform.localScale = Vector3.one;
+ noRetriesScore.transform.localScale = Vector3.one;
+ noRetryBonusName.transform.localScale = Vector3.one;
+ overallScore.transform.localScale = Vector3.one;
+ StartCoroutine(LockInScoreBump(0.5f));
+ }
+
+ private IEnumerator AddToOverallScore(int scoreToAdd, float animTime)
+ {
+ if (scoreToAdd == 0)
+ {
+ yield return new WaitForSecondsRealtime(0.15f);
+ yield break;
+ }
+ audioSource.clip = ThronefallAudioManager.Instance.audioContent.PointFill;
+ audioSource.loop = true;
+ audioSource.Play();
+ animationNextScore += scoreToAdd;
+ float timer = 0f;
+ while (timer < animTime)
+ {
+ timer += Time.unscaledDeltaTime;
+ overallScore.text = Mathf.RoundToInt(Mathf.Lerp(overallScoreThisRound, animationNextScore, Mathf.InverseLerp(0f, animTime, timer))).ToString();
+ yield return null;
+ }
+ overallScoreThisRound = animationNextScore;
+ overallScore.text = overallScoreThisRound.ToString();
+ audioSource.Stop();
+ audioSource.loop = false;
+ yield return StartCoroutine(LockInScoreBump(0.5f));
+ }
+
+ private IEnumerator LockInScoreBump(float animTime)
+ {
+ audioSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.PointLockInMajor, 0.85f);
+ float timer = 0f;
+ while (timer < animTime)
+ {
+ timer += Time.unscaledDeltaTime;
+ overallScore.transform.localScale = Vector3.one * bumpCurve.Evaluate(Mathf.InverseLerp(0f, animTime, timer));
+ yield return null;
+ }
+ overallScore.transform.localScale = Vector3.one;
+ }
+
+ private IEnumerator Bump(float animTime, Transform target, AudioClip clip)
+ {
+ if ((bool)clip)
+ {
+ audioSource.PlayOneShot(clip);
+ }
+ float timer = 0f;
+ while (timer < animTime)
+ {
+ timer += Time.unscaledDeltaTime;
+ target.transform.localScale = Vector3.one * bumpCurve.Evaluate(Mathf.InverseLerp(0f, animTime, timer));
+ yield return null;
+ }
+ target.transform.localScale = Vector3.one;
+ }
+
+ private IEnumerator PopShowTransform(Transform target, AudioClip clip, AnimationCurve curve, float animTime)
+ {
+ if ((bool)clip)
+ {
+ audioSource.PlayOneShot(clip);
+ }
+ float timer = 0f;
+ while (timer < animTime)
+ {
+ timer += Time.unscaledDeltaTime;
+ target.localScale = Vector3.one * curve.Evaluate(Mathf.InverseLerp(0f, animTime, timer));
+ yield return null;
+ }
+ target.localScale = Vector3.one;
+ }
+
+ private IEnumerator FillUpXPBar(int xp)
+ {
+ int xpToGive = xp;
+ float xpFillSpeed = (float)nextMetaLevel.requiredXp / timeToFillUpABar;
+ _ = perkManager.xp;
+ float xpFillFloat = perkManager.xp;
+ audioSource.clip = ThronefallAudioManager.Instance.audioContent.PointFill;
+ audioSource.loop = true;
+ audioSource.Play();
+ float progressionBarWiggleTime = 0f;
+ while (xpToGive > 0 && nextMetaLevel != null)
+ {
+ if (!audioSource.isPlaying)
+ {
+ audioSource.Play();
+ }
+ progressionBarWiggleTime += Time.unscaledDeltaTime * 10f;
+ progressionBarOnly.transform.localScale = Vector3.one * scoreFillWiggle.Evaluate(progressionBarWiggleTime);
+ int num = nextMetaLevel.requiredXp - perkManager.xp;
+ int num2;
+ if (input.GetButtonDown("Interact") || nextMetaLevel == null)
+ {
+ num2 = xpToGive;
+ }
+ else
+ {
+ xpFillFloat += xpFillSpeed * Time.unscaledDeltaTime;
+ num2 = Mathf.RoundToInt(xpFillFloat) - perkManager.xp;
+ }
+ if (num2 > num)
+ {
+ num2 = num;
+ }
+ perkManager.xp += num2;
+ xpToGive -= num2;
+ UpdateLevelingBar();
+ if (nextMetaLevel != null && perkManager.xp >= nextMetaLevel.requiredXp)
+ {
+ audioSource.Stop();
+ rewardAcceptButton.gameObject.SetActive(value: false);
+ rewardWaitIndicator.SetActive(value: true);
+ audioSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.LevelUp);
+ StartCoroutine(Bump(0.5f, nextPerk.transform, null));
+ yield return new WaitForSecondsRealtime(0.5f);
+ EnableRewardDisplayUI();
+ perkManager.xp = 0;
+ xpFillFloat = 0f;
+ perkManager.UnlockedEquippables.Add(nextMetaLevel.reward);
+ perkManager.level++;
+ GetNextMetaLevel();
+ float timer = 0f;
+ while (timer < waitAfterReward && (timer == 0f || !input.GetButtonDown("Interact")))
+ {
+ timer += Time.unscaledDeltaTime;
+ rewardWaitFill.fillAmount = timer / waitAfterReward;
+ yield return null;
+ }
+ rewardAcceptButton.gameObject.SetActive(value: true);
+ rewardWaitIndicator.SetActive(value: false);
+ rewardFrame.Select(rewardAcceptButton);
+ while (!frame.Interactable)
+ {
+ yield return null;
+ }
+ if (nextMetaLevel != null)
+ {
+ xpFillSpeed = (float)nextMetaLevel.requiredXp / timeToFillUpABar;
+ levelDisplay.text = TextTranslator.Translate("Menu/Level") + " <style=\"Body Numerals\">" + perkManager.level;
+ nextUnlockIcon.sprite = nextMetaLevel.reward.icon;
+ nextunlockBG.color = GetColorForEquippable(nextMetaLevel.reward);
+ }
+ Time.timeScale = 0f;
+ }
+ yield return null;
+ }
+ progressionBarOnly.transform.localScale = Vector3.one;
+ audioSource.Stop();
+ audioSource.loop = false;
+ StartCoroutine(Bump(animationStepB, progressionBarParent.transform, ThronefallAudioManager.Instance.audioContent.PointLockInMinor));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ }
+
+ private Color GetColorForEquippable(Equippable e)
+ {
+ Color white = Color.white;
+ if (e is EquippableWeapon)
+ {
+ white = weaponBG;
+ }
+ if (e is EquippablePerk)
+ {
+ white = perkBG;
+ }
+ if (e is PerkPoint)
+ {
+ white = perkpointBG;
+ }
+ if (e is EquippableMutation)
+ {
+ white = mutatorBG;
+ }
+ if (e is EquippableBuildingUpgrade)
+ {
+ white = buildingUpgradeBG;
+ }
+ return white;
+ }
+
+ private void OnDisable()
+ {
+ inAnimation = false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EndOfMatchUI.cs b/Thronefall_v1.57/Thronefall/Thronefall/EndOfMatchUI.cs
new file mode 100644
index 0000000..2dac632
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EndOfMatchUI.cs
@@ -0,0 +1,39 @@
+using TMPro;
+using UnityEngine;
+
+public class EndOfMatchUI : MonoBehaviour
+{
+ public GameObject victoryScreen;
+
+ public GameObject defeatScreen;
+
+ public TextMeshProUGUI scorePanel;
+
+ private void Start()
+ {
+ victoryScreen.SetActive(value: false);
+ defeatScreen.SetActive(value: false);
+ scorePanel.gameObject.SetActive(value: false);
+ if ((bool)LocalGamestate.Instance)
+ {
+ LocalGamestate.Instance.OnGameStateChange.AddListener(GamestateHasChanged);
+ }
+ }
+
+ private void GamestateHasChanged()
+ {
+ switch (LocalGamestate.Instance.CurrentState)
+ {
+ case LocalGamestate.State.AfterMatchDefeat:
+ defeatScreen.SetActive(value: true);
+ scorePanel.gameObject.SetActive(value: true);
+ scorePanel.text = "score: " + ScoreManager.Instance.CurrentScore;
+ break;
+ case LocalGamestate.State.AfterMatchVictory:
+ victoryScreen.SetActive(value: true);
+ scorePanel.gameObject.SetActive(value: true);
+ scorePanel.text = "score: " + ScoreManager.Instance.CurrentScore;
+ break;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EndscreenRetryHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/EndscreenRetryHelper.cs
new file mode 100644
index 0000000..54fae67
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EndscreenRetryHelper.cs
@@ -0,0 +1,31 @@
+using UnityEngine;
+
+public class EndscreenRetryHelper : MonoBehaviour
+{
+ public void InstantRestartIfInSaveForbiddenMap()
+ {
+ if (MatchSaveLoadHandler.SaveLoadForbidden)
+ {
+ UIFrameManager.instance.CloseAllFrames();
+ base.gameObject.SetActive(value: false);
+ MatchSaveLoadHandler.OverwriteCurrentSave = true;
+ SceneTransitionManager.instance.RestartCurrentLevel();
+ }
+ }
+
+ public void FreshStart()
+ {
+ MatchSaveLoadHandler.OverwriteCurrentSave = true;
+ UIFrameManager.OpenInMapPerkSelect();
+ }
+
+ public void RestartLastDay()
+ {
+ if (EnemySpawner.instance.Wavenumber > 0)
+ {
+ MatchSaveLoadHandler.OverwriteCurrentSave = false;
+ MatchSaveLoadHandler.CurrentSave.ApplyLoadout();
+ }
+ SceneTransitionManager.instance.RestartCurrentLevel();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EnemyScreenMarkerUIHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/EnemyScreenMarkerUIHelper.cs
new file mode 100644
index 0000000..e2131a9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EnemyScreenMarkerUIHelper.cs
@@ -0,0 +1,89 @@
+using MPUIKIT;
+using TMPro;
+using UnityEngine;
+
+public class EnemyScreenMarkerUIHelper : MonoBehaviour
+{
+ public GameObject defaultMarkerParent;
+
+ public MPImageBasic defaultRegularBackground;
+
+ public MPImageBasic defaultEliteBackground;
+
+ public MPImageBasic enemyIcon;
+
+ public TextMeshProUGUI enemyNumber;
+
+ public GameObject largeMarkerParent;
+
+ public MPImageBasic largeRegularBackround;
+
+ public MPImageBasic largeEliteBackground;
+
+ public MPImageBasic largeEnemyIcon;
+
+ public TextMeshProUGUI largeEnemyNumber;
+
+ public Vector2 largeDimensions = new Vector2(112f, 112f);
+
+ private Vector2 regularDimensions;
+
+ private RectTransform ownRT;
+
+ private SettingsManager settings;
+
+ private void Start()
+ {
+ settings = SettingsManager.Instance;
+ ownRT = GetComponent<RectTransform>();
+ regularDimensions = ownRT.sizeDelta;
+ }
+
+ public void SetElite(bool isElite)
+ {
+ if (defaultRegularBackground == null || largeRegularBackround == null)
+ {
+ return;
+ }
+ defaultRegularBackground.enabled = !isElite;
+ largeRegularBackround.enabled = !isElite;
+ if (defaultEliteBackground == null || largeEliteBackground == null)
+ {
+ return;
+ }
+ defaultEliteBackground.enabled = isElite;
+ largeEliteBackground.enabled = isElite;
+ if (!(enemyIcon == null))
+ {
+ if (isElite)
+ {
+ enemyIcon.color = Color.yellow;
+ }
+ if (!(largeEnemyIcon == null) && isElite)
+ {
+ largeEnemyIcon.color = Color.yellow;
+ }
+ }
+ }
+
+ private void Update()
+ {
+ if (!(defaultMarkerParent == null) && !(largeMarkerParent == null))
+ {
+ if (settings.UseLargeInGameUI)
+ {
+ defaultMarkerParent.SetActive(value: false);
+ largeMarkerParent.SetActive(value: true);
+ largeEnemyIcon.sprite = enemyIcon.sprite;
+ largeEnemyNumber.text = enemyNumber.text;
+ ownRT.sizeDelta = largeDimensions;
+ }
+ else
+ {
+ defaultMarkerParent.SetActive(value: true);
+ largeMarkerParent.SetActive(value: false);
+ ownRT.sizeDelta = regularDimensions;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EnemySpawnLine.cs b/Thronefall_v1.57/Thronefall/Thronefall/EnemySpawnLine.cs
new file mode 100644
index 0000000..47e46fb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EnemySpawnLine.cs
@@ -0,0 +1,34 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class EnemySpawnLine : MonoBehaviour
+{
+ public enum ESpawnDifficulty
+ {
+ Normal,
+ EasierForPlayerToDealWith,
+ HarderForPlayerToDealWith
+ }
+
+ [SerializeField]
+ private ESpawnDifficulty difficulty;
+
+ public bool canSpawnFlying;
+
+ public bool canSpawnSmallGround;
+
+ public bool canSpawnBigGround;
+
+ public List<EnemySpawnLine> mostlySharedAttackpaths = new List<EnemySpawnLine>();
+
+ public List<EnemySpawnLine> mostlySeperatedAttackPaths = new List<EnemySpawnLine>();
+
+ public float DifficultyBudgetMultiplyer => difficulty switch
+ {
+ ESpawnDifficulty.EasierForPlayerToDealWith => 1.15f,
+ ESpawnDifficulty.HarderForPlayerToDealWith => 0.85f,
+ _ => 1f,
+ };
+
+ public Transform SpawnLine => base.transform;
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EnemySpawnManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/EnemySpawnManager.cs
new file mode 100644
index 0000000..9a6fc6f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EnemySpawnManager.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class EnemySpawnManager : MonoBehaviour
+{
+ public static EnemySpawnManager instance;
+
+ public GameObject screenMarkerPrefabEnemySpawns;
+
+ public GameObject screenMarkerPrefabOffscreenWarning;
+
+ public Weapon weaponOnSpawn;
+
+ public float weaponAttackHeight = 1f;
+
+ private void Awake()
+ {
+ instance = this;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EnemySpawner.cs b/Thronefall_v1.57/Thronefall/Thronefall/EnemySpawner.cs
new file mode 100644
index 0000000..517cc47
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EnemySpawner.cs
@@ -0,0 +1,539 @@
+using System.Collections.Generic;
+using Pathfinding;
+using UnityEngine;
+
+public class EnemySpawner : MonoBehaviour, DayNightCycle.IDaytimeSensitive, ISaveLoad
+{
+ private PerkManager perkManager;
+
+ private EnemySpawnManager enemySpawnManager;
+
+ public static EnemySpawner instance;
+
+ private TutorialManager tutorialManager;
+
+ public LocalGamestate.GameMode currentMode;
+
+ public int goldBalanceAtStart = 10;
+
+ private bool loadedBalanceFromSave;
+
+ private bool spawningInProgress;
+
+ public EternalWaveGenerator waveGeneratorScript;
+
+ public List<Wave> waves = new List<Wave>();
+
+ private List<ScreenMarker> screenMarkersEnemySpawns = new List<ScreenMarker>();
+
+ private List<ScreenMarker> screenMarkersOffscreenWarnings = new List<ScreenMarker>();
+
+ private int wavenumber = -1;
+
+ private int wavenumberLoadedFromSave = -1;
+
+ private float lastSpawnPeriodDuration;
+
+ private float lastSpawnPeriodClock;
+
+ private bool treasureHunterActive;
+
+ private bool cheeseGodActive;
+
+ private bool loadedFromSave;
+
+ private int numberOfEnemiesOnTheMap;
+
+ private float timeSinceSpaningEnded;
+
+ private float waveRunningForTime;
+
+ public bool SpawningInProgress => spawningInProgress;
+
+ public int WaveCount => waves.Count;
+
+ public int Wavenumber => wavenumber;
+
+ public bool MatchOver
+ {
+ get
+ {
+ if (wavenumber >= waves.Count - 1)
+ {
+ return !SpawningInProgress;
+ }
+ return false;
+ }
+ }
+
+ public bool LevelBeatenAsSoonAsWaveFinished => wavenumber > waves.Count - 2;
+
+ public bool PreFinalWaveComingUp => wavenumber == waves.Count - 3;
+
+ public float LastSpawnPeriodDuration => lastSpawnPeriodDuration;
+
+ public float LastSpawnPeriodClock => lastSpawnPeriodClock;
+
+ public bool InfinitelySpawning { get; set; }
+
+ private bool isInClassicMode => currentMode == LocalGamestate.GameMode.Classic;
+
+ private bool isInEternalTrialMode => currentMode == LocalGamestate.GameMode.EternalTrial;
+
+ public int NumberOfEnemiesOnTheMap => numberOfEnemiesOnTheMap;
+
+ public float TimeSinceSpawningEnded => timeSinceSpaningEnded;
+
+ public float WaveRunningForTime => waveRunningForTime;
+
+ public bool TwoWavesBeforeFinalWaveComingUp(int w)
+ {
+ return w == waves.Count - 4;
+ }
+
+ public bool WaveBeforeFinalWaveComingUp(int w)
+ {
+ return w == waves.Count - 3;
+ }
+
+ public bool FinalWaveComingUp(int w)
+ {
+ return w == waves.Count - 2;
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+
+ public void DebugSkipWave()
+ {
+ StopSpawnAfterWaveAndReset();
+ wavenumber++;
+ }
+
+ public void EnemySpawnersHornFocussed()
+ {
+ if ((bool)tutorialManager && !tutorialManager.MayShowEnemySpawn)
+ {
+ for (int i = 0; i < screenMarkersEnemySpawns.Count; i++)
+ {
+ screenMarkersEnemySpawns[i].showWhenOnScreen = false;
+ screenMarkersEnemySpawns[i].showWhenOffScreen = false;
+ }
+ for (int j = 0; j < screenMarkersOffscreenWarnings.Count; j++)
+ {
+ screenMarkersOffscreenWarnings[j].showWhenOnScreen = false;
+ screenMarkersOffscreenWarnings[j].showWhenOffScreen = false;
+ }
+ }
+ else
+ {
+ for (int k = 0; k < screenMarkersEnemySpawns.Count; k++)
+ {
+ screenMarkersEnemySpawns[k].showWhenOnScreen = true;
+ screenMarkersEnemySpawns[k].showWhenOffScreen = true;
+ }
+ for (int l = 0; l < screenMarkersOffscreenWarnings.Count; l++)
+ {
+ screenMarkersOffscreenWarnings[l].showWhenOnScreen = false;
+ screenMarkersOffscreenWarnings[l].showWhenOffScreen = false;
+ }
+ }
+ }
+
+ public void EnemySpawnersHornUnFocussed()
+ {
+ if ((bool)tutorialManager && !tutorialManager.MayShowEnemySpawn)
+ {
+ for (int i = 0; i < screenMarkersEnemySpawns.Count; i++)
+ {
+ screenMarkersEnemySpawns[i].showWhenOnScreen = false;
+ screenMarkersEnemySpawns[i].showWhenOffScreen = false;
+ }
+ for (int j = 0; j < screenMarkersOffscreenWarnings.Count; j++)
+ {
+ screenMarkersOffscreenWarnings[j].showWhenOnScreen = false;
+ screenMarkersOffscreenWarnings[j].showWhenOffScreen = false;
+ }
+ }
+ else
+ {
+ for (int k = 0; k < screenMarkersEnemySpawns.Count; k++)
+ {
+ screenMarkersEnemySpawns[k].showWhenOnScreen = true;
+ screenMarkersEnemySpawns[k].showWhenOffScreen = true;
+ }
+ for (int l = 0; l < screenMarkersOffscreenWarnings.Count; l++)
+ {
+ screenMarkersOffscreenWarnings[l].showWhenOnScreen = false;
+ screenMarkersOffscreenWarnings[l].showWhenOffScreen = false;
+ }
+ }
+ }
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ goldBalanceAtStart = 0;
+ loadedBalanceFromSave = MatchSaveLoadHandler.TryLoadValue(guid, "wavenumber", ref wavenumberLoadedFromSave);
+ loadedFromSave = true;
+ }
+
+ public void OnSave(string guid)
+ {
+ MatchSaveLoadHandler.SaveValue(guid, "wavenumber", wavenumber);
+ }
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ private void Start()
+ {
+ if (LocalGamestate.GameModeSet)
+ {
+ currentMode = LocalGamestate.SelectedGameMode;
+ }
+ else
+ {
+ LocalGamestate.SelectedGameMode = currentMode;
+ }
+ perkManager = PerkManager.instance;
+ enemySpawnManager = EnemySpawnManager.instance;
+ tutorialManager = TutorialManager.instance;
+ EnemySpawnersHornUnFocussed();
+ if ((bool)DayNightCycle.Instance)
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ }
+ spawningInProgress = false;
+ wavenumber = -1;
+ if (isInClassicMode && DebugController.instance.StartGameInWave != -1)
+ {
+ wavenumber = DebugController.instance.StartGameInWave - 1;
+ }
+ if (wavenumberLoadedFromSave != -1)
+ {
+ wavenumber = wavenumberLoadedFromSave;
+ }
+ if (isInEternalTrialMode && waveGeneratorScript != null)
+ {
+ LevelInfo levelInfoFromCurrentSceneName = LevelProgressManager.instance.GetLevelInfoFromCurrentSceneName();
+ if (levelInfoFromCurrentSceneName == null)
+ {
+ Debug.LogError("Warning! We apparently did not recieve correct Level Info.");
+ }
+ waves = waveGeneratorScript.GenerateWaves(base.transform.GetComponentsInChildren<EnemySpawnLine>(), levelInfoFromCurrentSceneName, EternalTrialsRunManager.CurrentRun.stage, out goldBalanceAtStart, EternalTrialsRunManager.CurrentRun.currentStageSeed);
+ }
+ if (PerkManager.instance.EliteGodEquipped)
+ {
+ int num = PerkManager.instance.eliteGodSpawnInterval;
+ foreach (Wave wave in waves)
+ {
+ foreach (Spawn spawn in wave.spawns)
+ {
+ if (!spawn.eliteEnemies)
+ {
+ num--;
+ if (num <= 0)
+ {
+ spawn.eliteEnemies = true;
+ num = PerkManager.instance.eliteGodSpawnInterval;
+ }
+ }
+ }
+ }
+ }
+ if (PerkManager.instance.RatGodActive)
+ {
+ float num2 = 0f;
+ foreach (Wave wave2 in waves)
+ {
+ foreach (Spawn spawn2 in wave2.spawns)
+ {
+ float num3 = (float)spawn2.goldCoins * PerkManager.instance.ratGod_GoldModifyer + num2;
+ spawn2.goldCoins = Mathf.CeilToInt(Mathf.Max(0f, num3));
+ num2 = num3 - (float)spawn2.goldCoins;
+ }
+ }
+ }
+ if (PerkManager.instance.LoanEquipped)
+ {
+ goldBalanceAtStart += PerkManager.instance.loanBonusMoney;
+ int num4 = PerkManager.instance.loanInterestMoney;
+ for (int i = 0; i < waves.Count; i++)
+ {
+ foreach (Spawn spawn3 in waves[i].spawns)
+ {
+ int num5 = Mathf.Min(spawn3.goldCoins, num4);
+ num4 -= num5;
+ spawn3.goldCoins -= num5;
+ }
+ }
+ }
+ if (PerkManager.instance.RoyalMintActive && !loadedBalanceFromSave)
+ {
+ goldBalanceAtStart += PerkManager.instance.royalMint_startGoldBonus;
+ }
+ if (!loadedBalanceFromSave)
+ {
+ PlayerMovement[] registeredPlayers = PlayerManager.Instance.RegisteredPlayers;
+ for (int j = 0; j < registeredPlayers.Length; j++)
+ {
+ registeredPlayers[j].GetComponent<PlayerInteraction>().AddCoin(goldBalanceAtStart);
+ }
+ }
+ LevelProgressManager.instance.GetLevelDataForActiveScene()?.dayToDayNetworth.Add(goldBalanceAtStart);
+ treasureHunterActive = PerkManager.instance.TreasureHunterActive;
+ cheeseGodActive = PerkManager.instance.CheeseGodActive;
+ if (cheeseGodActive)
+ {
+ for (int k = 0; k < Mathf.Min(PerkManager.instance.cheeseGod_affectedNights, waves.Count); k++)
+ {
+ foreach (Spawn spawn4 in waves[k].spawns)
+ {
+ spawn4.count = Mathf.RoundToInt((float)spawn4.count * PerkManager.instance.cheeseGod_spawnAmountMulti);
+ spawn4.interval /= PerkManager.instance.cheeseGod_firstWavesSpawnSpeed;
+ spawn4.delay /= PerkManager.instance.cheeseGod_firstWavesSpawnSpeed;
+ }
+ }
+ }
+ OnStartOfTheDay();
+ }
+
+ private void Update()
+ {
+ lastSpawnPeriodClock += Time.deltaTime;
+ if (!spawningInProgress)
+ {
+ numberOfEnemiesOnTheMap = TagManager.instance.CountAllTaggedObjectsWithTag(TagManager.ETag.EnemyOwned);
+ timeSinceSpaningEnded += Time.deltaTime;
+ return;
+ }
+ lastSpawnPeriodDuration += Time.deltaTime;
+ waves[wavenumber].Update();
+ if (waves[wavenumber].HasFinished())
+ {
+ if (InfinitelySpawning)
+ {
+ if (TagManager.instance.CountAllTaggedObjectsWithTag(TagManager.ETag.EnemyOwned) <= 0)
+ {
+ foreach (Spawn spawn in waves[wavenumber].spawns)
+ {
+ spawn.Reset(_resetGold: false);
+ }
+ }
+ }
+ else
+ {
+ StopSpawnAfterWaveAndReset();
+ }
+ }
+ numberOfEnemiesOnTheMap = TagManager.instance.CountAllTaggedObjectsWithTag(TagManager.ETag.EnemyOwned);
+ if (numberOfEnemiesOnTheMap <= 0)
+ {
+ waves[wavenumber].ReduceMaxDelayTillNextSpawn();
+ }
+ }
+
+ public void OnStartOfTheDay()
+ {
+ timeSinceSpaningEnded = 0f;
+ if (wavenumber + 1 >= waves.Count)
+ {
+ return;
+ }
+ if (treasureHunterActive && !loadedFromSave)
+ {
+ int amount = 0;
+ if (GetTreasureHunterBonus(wavenumber, out amount))
+ {
+ PlayerMovement[] registeredPlayers = PlayerManager.Instance.RegisteredPlayers;
+ for (int i = 0; i < registeredPlayers.Length; i++)
+ {
+ registeredPlayers[i].GetComponent<PlayerInteraction>().AddCoin(amount);
+ }
+ }
+ }
+ foreach (Spawn spawn in waves[wavenumber + 1].spawns)
+ {
+ Vector3 vector = (spawn.spawnLine.GetChild(0).position + spawn.spawnLine.GetChild(spawn.spawnLine.childCount - 1).position) / 2f;
+ Sprite sprite = spawn.enemyPrefab.GetComponent<ScreenMarkerIcon>().sprite;
+ ScreenMarker screenMarker = null;
+ for (int j = 0; j < screenMarkersEnemySpawns.Count; j++)
+ {
+ if (!(screenMarkersEnemySpawns[j].Sprite != sprite) && !(screenMarkersEnemySpawns[j].transform.position != vector) && screenMarkersEnemySpawns[j].Elite == spawn.eliteEnemies)
+ {
+ screenMarker = screenMarkersEnemySpawns[j];
+ screenMarker.SetNumber(screenMarker.Number + spawn.count);
+ }
+ }
+ if (!(screenMarker != null))
+ {
+ ScreenMarker component = Object.Instantiate(enemySpawnManager.screenMarkerPrefabEnemySpawns, vector, Quaternion.identity).GetComponent<ScreenMarker>();
+ component.SetSprite(sprite);
+ component.SetNumber(spawn.count);
+ component.SetElite(spawn.eliteEnemies);
+ screenMarkersEnemySpawns.Add(component);
+ }
+ }
+ EnemySpawnersHornUnFocussed();
+ }
+
+ public bool GetTreasureHunterBonus(int wave, out int amount)
+ {
+ amount = 0;
+ if (TwoWavesBeforeFinalWaveComingUp(wave))
+ {
+ amount = PerkManager.instance.treasureHunterGoldAmountWave1;
+ return true;
+ }
+ if (WaveBeforeFinalWaveComingUp(wave))
+ {
+ amount = PerkManager.instance.treasureHunterGoldAmountWave2;
+ return true;
+ }
+ if (FinalWaveComingUp(wave))
+ {
+ amount = PerkManager.instance.treasureHunterGoldAmountWave3;
+ return true;
+ }
+ return false;
+ }
+
+ public void OnStartOfTheNight()
+ {
+ loadedFromSave = false;
+ timeSinceSpaningEnded = 0f;
+ for (int num = screenMarkersEnemySpawns.Count - 1; num >= 0; num--)
+ {
+ Object.Destroy(screenMarkersEnemySpawns[num].gameObject);
+ }
+ screenMarkersEnemySpawns.Clear();
+ for (int num2 = screenMarkersOffscreenWarnings.Count - 1; num2 >= 0; num2--)
+ {
+ Object.Destroy(screenMarkersOffscreenWarnings[num2].gameObject);
+ }
+ screenMarkersOffscreenWarnings.Clear();
+ StartSpawning();
+ }
+
+ public void StartSpawning()
+ {
+ if (spawningInProgress)
+ {
+ return;
+ }
+ lastSpawnPeriodDuration = 0f;
+ lastSpawnPeriodClock = 0f;
+ wavenumber++;
+ wavenumber = Mathf.Clamp(wavenumber, 0, waves.Count - 1);
+ waves[wavenumber].Reset();
+ spawningInProgress = true;
+ foreach (Spawn spawn in waves[wavenumber].spawns)
+ {
+ if (!spawn.enemyPrefab.scene.isLoaded)
+ {
+ continue;
+ }
+ try
+ {
+ NavmeshCut componentInChildren = spawn.enemyPrefab.transform.parent.GetComponentInChildren<NavmeshCut>();
+ if ((bool)componentInChildren)
+ {
+ Object.Destroy(componentInChildren);
+ }
+ }
+ catch
+ {
+ Debug.LogError("Enemy was spawned form scene but something went wrong with disabling potential NavmeshCuts.");
+ }
+ }
+ }
+
+ public void StopSpawnAfterWaveAndReset()
+ {
+ if (spawningInProgress)
+ {
+ spawningInProgress = false;
+ }
+ }
+
+ public void OnDusk()
+ {
+ OnStartOfTheNight();
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ OnStartOfTheDay();
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public static WaveInfo GetWaveInfoForNextWave()
+ {
+ if (instance == null)
+ {
+ return new WaveInfo();
+ }
+ if (DayNightCycle.Instance.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ return instance.GetWaveInfo(instance.wavenumber);
+ }
+ return instance.GetWaveInfo(instance.wavenumber + 1);
+ }
+
+ private WaveInfo GetWaveInfo(int waveNumber)
+ {
+ if (waveNumber >= waves.Count || waveNumber < 0)
+ {
+ return new WaveInfo();
+ }
+ WaveInfo waveInfo = new WaveInfo();
+ waveInfo.waveNumber = waveNumber + 1;
+ waveInfo.outOfWaves = waves.Count;
+ foreach (Spawn spawn in waves[waveNumber].spawns)
+ {
+ if (spawn.enemyPrefab == null)
+ {
+ continue;
+ }
+ ScreenMarkerIcon component = spawn.enemyPrefab.GetComponent<ScreenMarkerIcon>();
+ string unitDescription = component.UnitDescription;
+ string unitName = component.UnitName;
+ Sprite sprite = component.sprite;
+ WaveEnemyInfo waveEnemyInfo = null;
+ foreach (WaveEnemyInfo enemy in waveInfo.enemies)
+ {
+ if (enemy.enemyIcon == sprite && enemy.enemyName == unitName && enemy.eliteEnemy == spawn.eliteEnemies)
+ {
+ waveEnemyInfo = enemy;
+ break;
+ }
+ }
+ if (waveEnemyInfo == null)
+ {
+ waveEnemyInfo = new WaveEnemyInfo();
+ waveEnemyInfo.enemyDescription = unitDescription;
+ waveEnemyInfo.enemyName = unitName;
+ waveEnemyInfo.enemyIcon = sprite;
+ waveEnemyInfo.eliteEnemy = spawn.eliteEnemies;
+ waveInfo.enemies.Add(waveEnemyInfo);
+ }
+ waveInfo.goldReward += spawn.goldCoins;
+ waveEnemyInfo.enemyCount += spawn.count;
+ }
+ return waveInfo;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EnumSelector.cs b/Thronefall_v1.57/Thronefall/Thronefall/EnumSelector.cs
new file mode 100644
index 0000000..d3349bb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EnumSelector.cs
@@ -0,0 +1,163 @@
+using System.Collections.Generic;
+using TMPro;
+using UnityEngine;
+using UnityEngine.Events;
+
+public class EnumSelector : MonoBehaviour
+{
+ public ThronefallUIElement target;
+
+ public List<string> options = new List<string>();
+
+ private int index;
+
+ public bool delayedApply;
+
+ public GameObject applyButton;
+
+ public ThronefallUIElement.NavigationDirection increase;
+
+ public ThronefallUIElement.NavigationDirection decrease = ThronefallUIElement.NavigationDirection.Left;
+
+ public TextMeshProUGUI display;
+
+ public GameObject buttons;
+
+ public UnityEvent onChange = new UnityEvent();
+
+ public UnityEvent onIncrease = new UnityEvent();
+
+ public UnityEvent onDecrease = new UnityEvent();
+
+ private bool unpropagatedChanges;
+
+ private int bufferIndex;
+
+ public int Index => index;
+
+ private void Start()
+ {
+ target.onApply.AddListener(PropagateDelayedChange);
+ target.onSelectionStateChange.AddListener(OnLinkedTFUINavigate);
+ }
+
+ public void UpdateDisplay()
+ {
+ if (unpropagatedChanges)
+ {
+ display.text = options[index] + "<style=Settings Warning> *</style>";
+ if ((bool)applyButton)
+ {
+ applyButton.SetActive(value: true);
+ }
+ }
+ else
+ {
+ display.text = options[index];
+ if ((bool)applyButton)
+ {
+ applyButton.SetActive(value: false);
+ }
+ }
+ }
+
+ public void Navigate(ThronefallUIElement.NavigationDirection direction)
+ {
+ if (direction == increase)
+ {
+ onIncrease.Invoke();
+ index++;
+ }
+ else if (direction == decrease)
+ {
+ index--;
+ onDecrease.Invoke();
+ }
+ if (index > options.Count - 1)
+ {
+ index = 0;
+ }
+ if (index < 0)
+ {
+ index = options.Count - 1;
+ }
+ if (delayedApply && index != bufferIndex)
+ {
+ unpropagatedChanges = true;
+ }
+ else
+ {
+ unpropagatedChanges = false;
+ }
+ UpdateDisplay();
+ if (!delayedApply)
+ {
+ ApplyChanges();
+ }
+ }
+
+ public void Increase()
+ {
+ Navigate(increase);
+ }
+
+ public void Decrease()
+ {
+ Navigate(decrease);
+ }
+
+ public void OnTFUIStateChange()
+ {
+ if (target.CurrentState != 0)
+ {
+ buttons.SetActive(value: true);
+ }
+ else
+ {
+ buttons.SetActive(value: false);
+ }
+ }
+
+ public void SetIndex(int i)
+ {
+ index = i;
+ if (index > options.Count - 1)
+ {
+ index = 0;
+ }
+ if (index < 0)
+ {
+ index = options.Count - 1;
+ }
+ bufferIndex = index;
+ UpdateDisplay();
+ }
+
+ public void OnLinkedTFUINavigate()
+ {
+ CancelChanges();
+ }
+
+ public void PropagateDelayedChange()
+ {
+ if (delayedApply)
+ {
+ ApplyChanges();
+ }
+ }
+
+ private void ApplyChanges()
+ {
+ bufferIndex = index;
+ onChange.Invoke();
+ unpropagatedChanges = false;
+ UpdateDisplay();
+ }
+
+ private void CancelChanges()
+ {
+ index = bufferIndex;
+ unpropagatedChanges = false;
+ UpdateDisplay();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EnumSelectorButtonAnimation.cs b/Thronefall_v1.57/Thronefall/Thronefall/EnumSelectorButtonAnimation.cs
new file mode 100644
index 0000000..4cb6333
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EnumSelectorButtonAnimation.cs
@@ -0,0 +1,14 @@
+using UnityEngine;
+
+public class EnumSelectorButtonAnimation : MonoBehaviour
+{
+ public Transform decreaseB;
+
+ public Transform increaseB;
+
+ private void OnEnable()
+ {
+ decreaseB.localScale = Vector3.zero;
+ increaseB.localScale = Vector3.zero;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Equippable.cs b/Thronefall_v1.57/Thronefall/Thronefall/Equippable.cs
new file mode 100644
index 0000000..05b442d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Equippable.cs
@@ -0,0 +1,15 @@
+using UnityEngine;
+
+public class Equippable : ScriptableObject
+{
+ public Sprite icon;
+
+ public string displayName;
+
+ [TextArea]
+ public string description;
+
+ public string LOCIDENTIFIER_NAME => "Equippable/" + displayName;
+
+ public string LOCIDENTIFIER_DESCRIPTION => LOCIDENTIFIER_NAME + " Description";
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EquippableBuildingUpgrade.cs b/Thronefall_v1.57/Thronefall/Thronefall/EquippableBuildingUpgrade.cs
new file mode 100644
index 0000000..8120e18
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EquippableBuildingUpgrade.cs
@@ -0,0 +1,6 @@
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "Data", menuName = "SimpleSiege/Equippable Building Upgrade", order = 1)]
+public class EquippableBuildingUpgrade : Equippable
+{
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EquippableMutation.cs b/Thronefall_v1.57/Thronefall/Thronefall/EquippableMutation.cs
new file mode 100644
index 0000000..6df0b87
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EquippableMutation.cs
@@ -0,0 +1,8 @@
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "Data", menuName = "SimpleSiege/Equippable Mutation", order = 1)]
+public class EquippableMutation : Equippable
+{
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float scoreMultiplyerOnWin = 1.2f;
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EquippablePerk.cs b/Thronefall_v1.57/Thronefall/Thronefall/EquippablePerk.cs
new file mode 100644
index 0000000..b3b5468
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EquippablePerk.cs
@@ -0,0 +1,6 @@
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "Data", menuName = "SimpleSiege/Equippable Perk", order = 1)]
+public class EquippablePerk : Equippable
+{
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EquippableWeapon.cs b/Thronefall_v1.57/Thronefall/Thronefall/EquippableWeapon.cs
new file mode 100644
index 0000000..134c067
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EquippableWeapon.cs
@@ -0,0 +1,6 @@
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "Data", menuName = "SimpleSiege/Equippable Weapon", order = 1)]
+public class EquippableWeapon : Equippable
+{
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialEnemy.cs b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialEnemy.cs
new file mode 100644
index 0000000..9dc23e3
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialEnemy.cs
@@ -0,0 +1,97 @@
+using System;
+using System.Collections.Generic;
+using Pathfinding;
+using UnityEngine;
+
+[Serializable]
+public class EternalTrialEnemy
+{
+ public enum EGroup
+ {
+ BreadAndButter,
+ Flavour,
+ Flying
+ }
+
+ public GameObject enemyPrefab;
+
+ public float difficultyValue = 1f;
+
+ public float minDefenseInvestment;
+
+ private float difficultyValueTemp = 1f;
+
+ private List<EnemySpawnLine> tempSpawnLineList = new List<EnemySpawnLine>();
+
+ private List<float> tempSpawnLineSpawnDuration = new List<float>();
+
+ private List<float> tempSpawnLineTargetDifficulty = new List<float>();
+
+ private List<float> tempSpawnLineActualDifficulty = new List<float>();
+
+ private float tempTargetDifficulty;
+
+ private float tempActualDifficulty;
+
+ private List<int> tempSpawnAmount = new List<int>();
+
+ private List<int> tempDropGold = new List<int>();
+
+ public EGroup group;
+
+ public float DifficultyValueTemp
+ {
+ get
+ {
+ return difficultyValueTemp;
+ }
+ set
+ {
+ difficultyValueTemp = value;
+ }
+ }
+
+ public List<EnemySpawnLine> TempSpawnLineList => tempSpawnLineList;
+
+ public List<float> TempSpawnLineSpawnDuration => tempSpawnLineSpawnDuration;
+
+ public List<float> TempSpawnLineTargetDifficulty => tempSpawnLineTargetDifficulty;
+
+ public List<float> TempSpawnLineActualDifficulty => tempSpawnLineActualDifficulty;
+
+ public float TempTargetDifficulty
+ {
+ get
+ {
+ return tempTargetDifficulty;
+ }
+ set
+ {
+ tempTargetDifficulty = value;
+ }
+ }
+
+ public float TempActualDifficulty
+ {
+ get
+ {
+ return tempActualDifficulty;
+ }
+ set
+ {
+ tempActualDifficulty = value;
+ }
+ }
+
+ public List<int> TempSpawnAmount => tempSpawnAmount;
+
+ public List<int> TempDropGold => tempDropGold;
+
+ public int desiredGroupSize => 5;
+
+ public bool flying => enemyPrefab.GetComponentInChildren<TaggedObject>().Tags.Contains(TagManager.ETag.Flying);
+
+ public bool smallGround => enemyPrefab.GetComponentInChildren<Seeker>().graphMask.Contains(0);
+
+ public bool bigGround => enemyPrefab.GetComponentInChildren<Seeker>().graphMask.Contains(2);
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialEnemySet.cs b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialEnemySet.cs
new file mode 100644
index 0000000..97d792a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialEnemySet.cs
@@ -0,0 +1,47 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "New Enemyset", menuName = "SimpleSiege/Eternal Trial Enemyset")]
+public class EternalTrialEnemySet : ScriptableObject
+{
+ public List<EternalTrialEnemy> enemies;
+
+ public List<EternalTrialEnemy> ListAllFlying()
+ {
+ List<EternalTrialEnemy> list = new List<EternalTrialEnemy>();
+ foreach (EternalTrialEnemy enemy in enemies)
+ {
+ if (enemy.flying)
+ {
+ list.Add(enemy);
+ }
+ }
+ return list;
+ }
+
+ public List<EternalTrialEnemy> ListAllGroundSmall()
+ {
+ List<EternalTrialEnemy> list = new List<EternalTrialEnemy>();
+ foreach (EternalTrialEnemy enemy in enemies)
+ {
+ if (enemy.smallGround)
+ {
+ list.Add(enemy);
+ }
+ }
+ return list;
+ }
+
+ public List<EternalTrialEnemy> ListAllGroundBig()
+ {
+ List<EternalTrialEnemy> list = new List<EternalTrialEnemy>();
+ foreach (EternalTrialEnemy enemy in enemies)
+ {
+ if (enemy.bigGround)
+ {
+ list.Add(enemy);
+ }
+ }
+ return list;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsDefeatUI.cs b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsDefeatUI.cs
new file mode 100644
index 0000000..f633941
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsDefeatUI.cs
@@ -0,0 +1,516 @@
+using System.Collections;
+using MPUIKIT;
+using Rewired;
+using TMPro;
+using UnityEngine;
+
+public class EternalTrialsDefeatUI : IUIAnimationSequence
+{
+ public GameObject parentObject;
+
+ public CanvasGroup mainFrameCG;
+
+ public UIFrame frame;
+
+ public ThronefallUIElement continueButton;
+
+ public AudioSource audioSource;
+
+ public TextMeshProUGUI stageDisplay;
+
+ [Header("Main Frame")]
+ public TextMeshProUGUI baseScore;
+
+ public TextMeshProUGUI stageBonus;
+
+ public TextMeshProUGUI overallScore;
+
+ public TextMeshProUGUI bestScore;
+
+ public TextMeshProUGUI levelDisplay;
+
+ public TextMeshProUGUI xpDisplay;
+
+ public TextMeshProUGUI levelUpLevelDisplay;
+
+ public TextMeshProUGUI levelUpRewardDescription;
+
+ public TextMeshProUGUI defeatDisplay;
+
+ public TextMeshProUGUI baseScoreName;
+
+ public TextMeshProUGUI stageBonusName;
+
+ public GameObject newHighscoreIndicator;
+
+ public GameObject progressionBarParent;
+
+ public GameObject regularMaxLevel;
+
+ public GameObject rewardWaitIndicator;
+
+ public GameObject dividerParent;
+
+ public GameObject progressionBarORMaxLevelParent;
+
+ public GameObject progressionBarOnly;
+
+ public GameObject nextPerk;
+
+ public MPImageBasic xpFill;
+
+ public MPImageBasic nextUnlockIcon;
+
+ public MPImageBasic nextunlockBG;
+
+ public MPImageBasic levelUpRewardIcon;
+
+ public MPImageBasic levelUpRewardBg;
+
+ public MPImageBasic rewardWaitFill;
+
+ public Color weaponBG;
+
+ public Color perkBG;
+
+ public Color mutatorBG;
+
+ public Color perkpointBG;
+
+ public Color buildingUpgradeBG;
+
+ public ThronefallUIElement rewardAcceptButton;
+
+ public UIFrame rewardFrame;
+
+ public AnimationCurve popShowCurve;
+
+ public AnimationCurve bumpCurve;
+
+ public AnimationCurve scoreFillWiggle;
+
+ [Header("Settings")]
+ [SerializeField]
+ private float timeToFillUpABar = 3f;
+
+ [SerializeField]
+ private float waitAtBeginning = 0.25f;
+
+ [SerializeField]
+ private float waitAfterFillingUpABar = 0.25f;
+
+ [SerializeField]
+ private float waitAfterReward = 2f;
+
+ [SerializeField]
+ private float waitWhenMaxLevelAlreadyReached = 0.5f;
+
+ private MetaLevel nextMetaLevel;
+
+ private PerkManager perkManager;
+
+ private Player input;
+
+ private bool inAnimation;
+
+ private bool inScoreUnroll;
+
+ private int baseScoreThisRound;
+
+ private int stageBonusThisRound;
+
+ private int overallScoreThisRound;
+
+ private int animationNextScore;
+
+ private float defaultWaitStep = 0.5f;
+
+ private float minorWaitStep = 0.25f;
+
+ private float animationStepA = 1.5f;
+
+ private float animationStepB = 0.5f;
+
+ private bool skipScoringAnimation;
+
+ private Coroutine currentScoringAnimation;
+
+ private void Update()
+ {
+ if (input != null && input.GetButtonDown("Interact") && inScoreUnroll)
+ {
+ if (currentScoringAnimation != null)
+ {
+ StopCoroutine(currentScoringAnimation);
+ }
+ currentScoringAnimation = null;
+ audioSource.Stop();
+ skipScoringAnimation = true;
+ inScoreUnroll = false;
+ }
+ }
+
+ public override IEnumerator PlayAnimation(UIFrame contextFrame)
+ {
+ inAnimation = true;
+ inScoreUnroll = false;
+ skipScoringAnimation = false;
+ perkManager = PerkManager.instance;
+ input = ReInput.players.GetPlayer(0);
+ parentObject.SetActive(value: true);
+ yield return StartCoroutine(ETDefeatAnimationSequence());
+ contextFrame.Select(continueButton);
+ yield return null;
+ }
+
+ public override void Reset()
+ {
+ parentObject.SetActive(value: false);
+ }
+
+ private IEnumerator ETDefeatAnimationSequence()
+ {
+ defeatDisplay.text = TextTranslator.Translate("Menu/Defeat") + ".";
+ stageDisplay.text = "<style=Body Bold>" + TextTranslator.Translate("Menu/Stage") + "<style=Body Numerals> " + (EternalTrialsRunManager.CurrentRun.stage + 1);
+ baseScore.gameObject.SetActive(value: false);
+ baseScoreName.gameObject.SetActive(value: false);
+ stageBonus.gameObject.SetActive(value: false);
+ stageBonusName.gameObject.SetActive(value: false);
+ dividerParent.SetActive(value: false);
+ progressionBarORMaxLevelParent.SetActive(value: false);
+ levelDisplay.gameObject.SetActive(value: false);
+ newHighscoreIndicator.SetActive(value: false);
+ regularMaxLevel.SetActive(value: false);
+ progressionBarParent.SetActive(value: true);
+ mainFrameCG.alpha = 0f;
+ parentObject.SetActive(value: true);
+ float mainFrameFadeTimer = 0f;
+ float fadeTime = 0.25f;
+ while (mainFrameFadeTimer < fadeTime)
+ {
+ mainFrameFadeTimer += Time.unscaledDeltaTime;
+ mainFrameCG.alpha = mainFrameFadeTimer / fadeTime;
+ yield return null;
+ }
+ mainFrameCG.alpha = 1f;
+ Time.timeScale = 0f;
+ int num = EternalTrialsRunManager.CurrentRun.score + EternalTrialsRunManager.CurrentRun.StageBonusScore;
+ bool newHighscore = num > LevelProgressManager.instance.EternalTrialsHighscore;
+ LevelProgressManager.instance.EternalTrialsHighscore = Mathf.Max(LevelProgressManager.instance.EternalTrialsHighscore, num);
+ currentScoringAnimation = StartCoroutine(UnrollScores());
+ while (currentScoringAnimation != null)
+ {
+ yield return null;
+ }
+ if (skipScoringAnimation)
+ {
+ SkipUnrollScores();
+ }
+ if (newHighscore)
+ {
+ newHighscoreIndicator.SetActive(value: true);
+ yield return StartCoroutine(PopShowTransform(newHighscoreIndicator.transform, ThronefallAudioManager.Instance.audioContent.NewHighscore, popShowCurve, 0.5f));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ }
+ else
+ {
+ newHighscoreIndicator.SetActive(value: false);
+ }
+ int xpToGive = EternalTrialsRunManager.CurrentRun.score + EternalTrialsRunManager.CurrentRun.StageBonusScore;
+ GetNextMetaLevel();
+ if (nextMetaLevel != null)
+ {
+ UpdateLevelingBar();
+ }
+ levelDisplay.text = TextTranslator.Translate("Menu/Level") + " <style=\"Body Numerals\">" + perkManager.level;
+ levelDisplay.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(levelDisplay.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildB, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ progressionBarORMaxLevelParent.SetActive(value: true);
+ StartCoroutine(PopShowTransform(progressionBarORMaxLevelParent.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildC, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(defaultWaitStep);
+ inAnimation = true;
+ if (nextMetaLevel != null)
+ {
+ nextUnlockIcon.sprite = nextMetaLevel.reward.icon;
+ nextunlockBG.color = GetColorForEquippable(nextMetaLevel.reward);
+ UpdateLevelingBar();
+ yield return StartCoroutine(FillUpXPBar(xpToGive));
+ }
+ else
+ {
+ yield return new WaitForSecondsRealtime(waitWhenMaxLevelAlreadyReached);
+ }
+ inAnimation = false;
+ SteamManager.Instance.UploadHighscore(LevelProgressManager.instance.EternalTrialsHighscore, "Eternal Trials Season 2");
+ SaveLoadManager.instance.SaveGame();
+ }
+
+ private void GetNextMetaLevel()
+ {
+ nextMetaLevel = perkManager.NextMetaLevel;
+ if (nextMetaLevel == null)
+ {
+ EnableMaxLevelReachedUI();
+ }
+ }
+
+ private void EnableMaxLevelReachedUI()
+ {
+ progressionBarParent.SetActive(value: false);
+ regularMaxLevel.SetActive(value: true);
+ AchievementManager.UnlockAchievement(AchievementManager.Achievements.MAXLEVEL_REACHED);
+ }
+
+ private void EnableRewardDisplayUI()
+ {
+ levelUpLevelDisplay.text = TextTranslator.Translate("Menu/Level") + " <style=\"Body Numerals\">" + (1 + perkManager.level);
+ levelUpRewardIcon.sprite = nextMetaLevel.reward.icon;
+ levelUpRewardBg.color = GetColorForEquippable(nextMetaLevel.reward);
+ levelUpRewardDescription.text = "<style=\"Header\"><size=30>" + TextTranslator.Translate(nextMetaLevel.reward.LOCIDENTIFIER_NAME) + "</style><style=\"Body Light\"><size=20>\n" + TextTranslator.Translate(nextMetaLevel.reward.LOCIDENTIFIER_DESCRIPTION);
+ UIFrameManager.ShowLevelUpReward();
+ }
+
+ private void UpdateLevelingBar()
+ {
+ xpDisplay.text = perkManager.xp + " / " + nextMetaLevel.requiredXp;
+ xpFill.fillAmount = (float)perkManager.xp / (float)nextMetaLevel.requiredXp;
+ }
+
+ private IEnumerator UnrollScores()
+ {
+ inScoreUnroll = true;
+ baseScoreThisRound = EternalTrialsRunManager.CurrentRun.score;
+ stageBonusThisRound = EternalTrialsRunManager.CurrentRun.StageBonusScore;
+ overallScoreThisRound = 0;
+ animationNextScore = 0;
+ baseScore.text = baseScoreThisRound.ToString();
+ stageBonus.text = stageBonusThisRound.ToString();
+ overallScore.text = overallScoreThisRound.ToString();
+ bestScore.text = LevelProgressManager.instance.EternalTrialsHighscore.ToString();
+ dividerParent.SetActive(value: true);
+ StartCoroutine(PopShowTransform(dividerParent.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildB, popShowCurve, animationStepB));
+ baseScoreName.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(baseScoreName.transform, null, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ baseScore.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(baseScore.transform, null, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ yield return AddToOverallScore(baseScoreThisRound, animationStepA);
+ stageBonusName.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(stageBonusName.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildC, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ stageBonus.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(stageBonus.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildA, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ yield return AddToOverallScore(stageBonusThisRound, animationStepA);
+ currentScoringAnimation = null;
+ }
+
+ private void SkipUnrollScores()
+ {
+ baseScoreThisRound = EternalTrialsRunManager.CurrentRun.score;
+ stageBonusThisRound = EternalTrialsRunManager.CurrentRun.StageBonusScore;
+ overallScoreThisRound = baseScoreThisRound + stageBonusThisRound;
+ baseScore.text = baseScoreThisRound.ToString();
+ stageBonus.text = stageBonusThisRound.ToString();
+ overallScore.text = overallScoreThisRound.ToString();
+ newHighscoreIndicator.SetActive(SceneTransitionManager.instance.TotalScoreFromLastMatchIsNewPersonalRecord);
+ bestScore.text = SceneTransitionManager.instance.LevelDataFromLastMatch.highscoreBest.ToString();
+ dividerParent.SetActive(value: true);
+ baseScoreName.gameObject.SetActive(value: true);
+ baseScore.gameObject.SetActive(value: true);
+ stageBonusName.gameObject.SetActive(value: true);
+ stageBonus.gameObject.SetActive(value: true);
+ dividerParent.transform.localScale = Vector3.one;
+ baseScoreName.transform.localScale = Vector3.one;
+ baseScore.transform.localScale = Vector3.one;
+ stageBonusName.transform.localScale = Vector3.one;
+ stageBonus.transform.localScale = Vector3.one;
+ overallScore.transform.localScale = Vector3.one;
+ StartCoroutine(LockInScoreBump(0.5f));
+ }
+
+ private IEnumerator AddToOverallScore(int scoreToAdd, float animTime)
+ {
+ if (scoreToAdd == 0)
+ {
+ yield return new WaitForSecondsRealtime(0.15f);
+ yield break;
+ }
+ audioSource.clip = ThronefallAudioManager.Instance.audioContent.PointFill;
+ audioSource.loop = true;
+ audioSource.Play();
+ animationNextScore += scoreToAdd;
+ float timer = 0f;
+ while (timer < animTime)
+ {
+ timer += Time.unscaledDeltaTime;
+ overallScore.text = Mathf.RoundToInt(Mathf.Lerp(overallScoreThisRound, animationNextScore, Mathf.InverseLerp(0f, animTime, timer))).ToString();
+ yield return null;
+ }
+ overallScoreThisRound = animationNextScore;
+ overallScore.text = overallScoreThisRound.ToString();
+ audioSource.Stop();
+ audioSource.loop = false;
+ yield return StartCoroutine(LockInScoreBump(0.5f));
+ }
+
+ private IEnumerator LockInScoreBump(float animTime)
+ {
+ audioSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.PointLockInMajor, 0.85f);
+ float timer = 0f;
+ while (timer < animTime)
+ {
+ timer += Time.unscaledDeltaTime;
+ overallScore.transform.localScale = Vector3.one * bumpCurve.Evaluate(Mathf.InverseLerp(0f, animTime, timer));
+ yield return null;
+ }
+ overallScore.transform.localScale = Vector3.one;
+ }
+
+ private IEnumerator Bump(float animTime, Transform target, AudioClip clip)
+ {
+ if ((bool)clip)
+ {
+ audioSource.PlayOneShot(clip);
+ }
+ float timer = 0f;
+ while (timer < animTime)
+ {
+ timer += Time.unscaledDeltaTime;
+ target.transform.localScale = Vector3.one * bumpCurve.Evaluate(Mathf.InverseLerp(0f, animTime, timer));
+ yield return null;
+ }
+ target.transform.localScale = Vector3.one;
+ }
+
+ private IEnumerator PopShowTransform(Transform target, AudioClip clip, AnimationCurve curve, float animTime)
+ {
+ if ((bool)clip)
+ {
+ audioSource.PlayOneShot(clip);
+ }
+ float timer = 0f;
+ while (timer < animTime)
+ {
+ timer += Time.unscaledDeltaTime;
+ target.localScale = Vector3.one * curve.Evaluate(Mathf.InverseLerp(0f, animTime, timer));
+ yield return null;
+ }
+ target.localScale = Vector3.one;
+ }
+
+ private IEnumerator FillUpXPBar(int xp)
+ {
+ int xpToGive = xp;
+ float xpFillSpeed = (float)nextMetaLevel.requiredXp / timeToFillUpABar;
+ _ = perkManager.xp;
+ float xpFillFloat = perkManager.xp;
+ audioSource.clip = ThronefallAudioManager.Instance.audioContent.PointFill;
+ audioSource.loop = true;
+ audioSource.Play();
+ float progressionBarWiggleTime = 0f;
+ while (xpToGive > 0 && nextMetaLevel != null)
+ {
+ if (!audioSource.isPlaying)
+ {
+ audioSource.Play();
+ }
+ progressionBarWiggleTime += Time.unscaledDeltaTime * 10f;
+ progressionBarOnly.transform.localScale = Vector3.one * scoreFillWiggle.Evaluate(progressionBarWiggleTime);
+ int num = nextMetaLevel.requiredXp - perkManager.xp;
+ int num2;
+ if (input.GetButtonDown("Interact") || nextMetaLevel == null)
+ {
+ num2 = xpToGive;
+ }
+ else
+ {
+ xpFillFloat += xpFillSpeed * Time.unscaledDeltaTime;
+ num2 = Mathf.RoundToInt(xpFillFloat) - perkManager.xp;
+ }
+ if (num2 > num)
+ {
+ num2 = num;
+ }
+ perkManager.xp += num2;
+ xpToGive -= num2;
+ UpdateLevelingBar();
+ if (nextMetaLevel != null && perkManager.xp >= nextMetaLevel.requiredXp)
+ {
+ audioSource.Stop();
+ rewardAcceptButton.gameObject.SetActive(value: false);
+ rewardWaitIndicator.SetActive(value: true);
+ audioSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.LevelUp);
+ StartCoroutine(Bump(0.5f, nextPerk.transform, null));
+ yield return new WaitForSecondsRealtime(0.5f);
+ EnableRewardDisplayUI();
+ perkManager.xp = 0;
+ xpFillFloat = 0f;
+ perkManager.UnlockedEquippables.Add(nextMetaLevel.reward);
+ perkManager.level++;
+ GetNextMetaLevel();
+ float timer = 0f;
+ while (timer < waitAfterReward && (timer == 0f || !input.GetButtonDown("Interact")))
+ {
+ timer += Time.unscaledDeltaTime;
+ rewardWaitFill.fillAmount = timer / waitAfterReward;
+ yield return null;
+ }
+ rewardAcceptButton.gameObject.SetActive(value: true);
+ rewardWaitIndicator.SetActive(value: false);
+ rewardFrame.Select(rewardAcceptButton);
+ while (!frame.Interactable)
+ {
+ yield return null;
+ }
+ if (nextMetaLevel != null)
+ {
+ xpFillSpeed = (float)nextMetaLevel.requiredXp / timeToFillUpABar;
+ levelDisplay.text = TextTranslator.Translate("Menu/Level") + " <style=\"Body Numerals\">" + perkManager.level;
+ nextUnlockIcon.sprite = nextMetaLevel.reward.icon;
+ nextunlockBG.color = GetColorForEquippable(nextMetaLevel.reward);
+ }
+ Time.timeScale = 0f;
+ }
+ yield return null;
+ }
+ progressionBarOnly.transform.localScale = Vector3.one;
+ audioSource.Stop();
+ audioSource.loop = false;
+ StartCoroutine(Bump(animationStepB, progressionBarParent.transform, ThronefallAudioManager.Instance.audioContent.PointLockInMinor));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ }
+
+ private Color GetColorForEquippable(Equippable e)
+ {
+ Color white = Color.white;
+ if (e is EquippableWeapon)
+ {
+ white = weaponBG;
+ }
+ if (e is EquippablePerk)
+ {
+ white = perkBG;
+ }
+ if (e is PerkPoint)
+ {
+ white = perkpointBG;
+ }
+ if (e is EquippableMutation)
+ {
+ white = mutatorBG;
+ }
+ if (e is EquippableBuildingUpgrade)
+ {
+ white = buildingUpgradeBG;
+ }
+ return white;
+ }
+
+ private void OnDisable()
+ {
+ inAnimation = false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsHighscorePreview.cs b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsHighscorePreview.cs
new file mode 100644
index 0000000..2336f47
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsHighscorePreview.cs
@@ -0,0 +1,66 @@
+using System.Collections.Generic;
+using Steamworks;
+using TMPro;
+using UnityEngine;
+
+public class EternalTrialsHighscorePreview : MonoBehaviour
+{
+ public TMP_Text highscore;
+
+ public TMP_Text friendsRank;
+
+ private bool subscribedToSteamManager;
+
+ private readonly string lightTextCue = "<style=Body Light>";
+
+ private void OnEnable()
+ {
+ HighscoreTable.ETERNAL_TRIALS = true;
+ int eternalTrialsHighscore = LevelProgressManager.instance.EternalTrialsHighscore;
+ string text = ((eternalTrialsHighscore != 0) ? eternalTrialsHighscore.ToString() : "-");
+ highscore.text = TextTranslator.Translate("Menu/Highscore") + ": " + lightTextCue + text;
+ friendsRank.text = TextTranslator.Translate("Menu/Friends Rank") + ": " + lightTextCue + "-";
+ SubscribeToSteamManger();
+ SteamManager.Instance.DownloadFriendsHighscores("Eternal Trials Season 2");
+ }
+
+ private void SubscribeToSteamManger()
+ {
+ if (!subscribedToSteamManager)
+ {
+ SteamManager.Instance.OnLeaderboardDownloadCallbackComplete.AddListener(RefreshUI);
+ subscribedToSteamManager = true;
+ }
+ }
+
+ public void RefreshUI()
+ {
+ friendsRank.text = TextTranslator.Translate("Menu/Friends Rank") + ": " + lightTextCue;
+ List<SteamManager.LeaderboardEntry> lastDownloadedLeaderboardEntires = SteamManager.Instance.lastDownloadedLeaderboardEntires;
+ if (lastDownloadedLeaderboardEntires.Count > 0)
+ {
+ int num = 0;
+ int num2 = 1;
+ foreach (SteamManager.LeaderboardEntry item in lastDownloadedLeaderboardEntires)
+ {
+ if (item.username == SteamFriends.GetPersonaName())
+ {
+ num = num2;
+ break;
+ }
+ num2++;
+ }
+ if (num == 0)
+ {
+ friendsRank.text += "-";
+ return;
+ }
+ TMP_Text tMP_Text = friendsRank;
+ tMP_Text.text = tMP_Text.text + "#" + num;
+ }
+ else
+ {
+ friendsRank.text += "-";
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsInteractor.cs b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsInteractor.cs
new file mode 100644
index 0000000..7f48184
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsInteractor.cs
@@ -0,0 +1,37 @@
+using UnityEngine;
+
+public class EternalTrialsInteractor : InteractorBase
+{
+ [SerializeField]
+ private GameObject focusPanel;
+
+ public Transform banner;
+
+ public override string ReturnTooltip()
+ {
+ return TextTranslator.Translate("Menu/Level Interactor Cue");
+ }
+
+ public override void Focus(PlayerInteraction player)
+ {
+ focusPanel.SetActive(value: true);
+ }
+
+ public override void Unfocus(PlayerInteraction player)
+ {
+ focusPanel.SetActive(value: false);
+ }
+
+ public override void InteractionBegin(PlayerInteraction player)
+ {
+ bool flag = false;
+ if ((bool)InGamePopUpHelper.instance)
+ {
+ flag = InGamePopUpHelper.instance.PopEternalTrials();
+ }
+ if (!flag)
+ {
+ UIFrameManager.TryOpenEternalTrialsSelect();
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsLoadoutScreenHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsLoadoutScreenHelper.cs
new file mode 100644
index 0000000..aa0ac54
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsLoadoutScreenHelper.cs
@@ -0,0 +1,11 @@
+using UnityEngine;
+
+public class EternalTrialsLoadoutScreenHelper : MonoBehaviour
+{
+ public LoadoutUIHelper loadout;
+
+ public void Play()
+ {
+ EternalTrialsRunManager.LoadNextMap();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsMapPreview.cs b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsMapPreview.cs
new file mode 100644
index 0000000..2e06cc4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsMapPreview.cs
@@ -0,0 +1,36 @@
+using System.Collections.Generic;
+using TMPro;
+using UnityEngine;
+
+public class EternalTrialsMapPreview : MonoBehaviour
+{
+ public NightPreviewElement nightPreviewElementPrefab;
+
+ public Transform nightPreviewParent;
+
+ public UIParentResizer sizer;
+
+ public TextMeshProUGUI goldNumber;
+
+ private List<NightPreviewElement> previewElements = new List<NightPreviewElement>();
+
+ public void SetData(List<WaveInfo> waves, int startingGold)
+ {
+ foreach (NightPreviewElement previewElement in previewElements)
+ {
+ previewElement.gameObject.SetActive(value: false);
+ }
+ int num = waves.Count - previewElements.Count;
+ for (int i = 0; i < num; i++)
+ {
+ previewElements.Add(Object.Instantiate(nightPreviewElementPrefab, nightPreviewParent));
+ }
+ for (int j = 0; j < waves.Count; j++)
+ {
+ previewElements[j].gameObject.SetActive(value: true);
+ previewElements[j].SetData(waves[j]);
+ }
+ goldNumber.text = "<sprite name=coin>" + startingGold;
+ sizer.Trigger();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsRun.cs b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsRun.cs
new file mode 100644
index 0000000..b93a935
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsRun.cs
@@ -0,0 +1,124 @@
+using System;
+using System.Collections.Generic;
+
+[Serializable]
+public class EternalTrialsRun
+{
+ public int currentStageSeed;
+
+ public string currentMap = "Nordfels";
+
+ public int stage;
+
+ public int score;
+
+ public bool runComplete;
+
+ public bool inGame;
+
+ public bool inNight;
+
+ public List<EquippablePerk> acquiredPerks = new List<EquippablePerk>();
+
+ public List<EquippablePerk> disabledPerks = new List<EquippablePerk>();
+
+ public EquippableWeapon currentWeapon;
+
+ public List<string> acquiredPerkNamesForSaving = new List<string>();
+
+ public List<string> disabledPerkNamesForSaving = new List<string>();
+
+ public string currentWeaponNameForSaving = "";
+
+ public int StageBonusScore => stage * stage * 1000;
+
+ public int OverallScore => score + StageBonusScore;
+
+ public EternalTrialsRun(string currentMap, int currentStageSeed, int stage = 0, bool runComplete = false)
+ {
+ this.currentStageSeed = currentStageSeed;
+ this.currentMap = currentMap;
+ this.stage = stage;
+ this.runComplete = runComplete;
+ }
+
+ public void LoadoutToStringsForSaving()
+ {
+ acquiredPerkNamesForSaving = new List<string>();
+ disabledPerkNamesForSaving = new List<string>();
+ currentWeaponNameForSaving = "";
+ if (currentWeapon != null)
+ {
+ currentWeaponNameForSaving = currentWeapon.displayName;
+ }
+ foreach (EquippablePerk acquiredPerk in acquiredPerks)
+ {
+ acquiredPerkNamesForSaving.Add(acquiredPerk.displayName);
+ }
+ foreach (EquippablePerk disabledPerk in disabledPerks)
+ {
+ disabledPerkNamesForSaving.Add(disabledPerk.displayName);
+ }
+ }
+
+ public void SavedStringsToLoadout()
+ {
+ currentWeapon = null;
+ acquiredPerks = new List<EquippablePerk>();
+ disabledPerks = new List<EquippablePerk>();
+ List<EquippableWeapon> list = new List<EquippableWeapon>();
+ List<EquippablePerk> list2 = new List<EquippablePerk>();
+ foreach (MetaLevel metaLevel in PerkManager.instance.MetaLevels)
+ {
+ if (metaLevel.reward is EquippableWeapon)
+ {
+ list.Add(metaLevel.reward as EquippableWeapon);
+ }
+ if (metaLevel.reward is EquippablePerk)
+ {
+ list2.Add(metaLevel.reward as EquippablePerk);
+ }
+ }
+ foreach (Equippable unlockedEquippable in PerkManager.instance.UnlockedEquippables)
+ {
+ if (unlockedEquippable is EquippableWeapon && !list.Contains(unlockedEquippable as EquippableWeapon))
+ {
+ list.Add(unlockedEquippable as EquippableWeapon);
+ }
+ if (unlockedEquippable is EquippablePerk && !list2.Contains(unlockedEquippable as EquippablePerk))
+ {
+ list2.Add(unlockedEquippable as EquippablePerk);
+ }
+ }
+ foreach (EquippableWeapon item in list)
+ {
+ if (item.displayName == currentWeaponNameForSaving)
+ {
+ currentWeapon = item;
+ break;
+ }
+ }
+ foreach (string item2 in acquiredPerkNamesForSaving)
+ {
+ foreach (EquippablePerk item3 in list2)
+ {
+ if (item3.displayName == item2)
+ {
+ acquiredPerks.Add(item3);
+ break;
+ }
+ }
+ }
+ foreach (string item4 in disabledPerkNamesForSaving)
+ {
+ foreach (EquippablePerk item5 in list2)
+ {
+ if (item5.displayName == item4)
+ {
+ disabledPerks.Add(item5);
+ break;
+ }
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsRunManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsRunManager.cs
new file mode 100644
index 0000000..84acacf
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsRunManager.cs
@@ -0,0 +1,214 @@
+using System;
+using System.IO;
+using UnityEngine;
+
+public class EternalTrialsRunManager : MonoBehaviour
+{
+ public static readonly string[] mapRotation = new string[5] { "Nordfels", "Durststein", "Frostsee", "Uferwind", "Sturmklamm" };
+
+ public const int STAGE_SCORE_MULTIPLIER = 1000;
+
+ private static EternalTrialsRun currentRun;
+
+ private static EternalTrialsRun lastDiscardedRun;
+
+ private static int freshRunSeed = 0;
+
+ private static string SavePath => Application.persistentDataPath + "/EternalTrials_V2.json";
+
+ public static EternalTrialsRun CurrentRun
+ {
+ get
+ {
+ if (currentRun == null)
+ {
+ currentRun = TryLoadRun();
+ }
+ if (currentRun == null)
+ {
+ CreateFreshRun();
+ }
+ return currentRun;
+ }
+ }
+
+ public static EternalTrialsRun LastDiscardedRun => lastDiscardedRun;
+
+ public static bool HasOngoingRun
+ {
+ get
+ {
+ if (CurrentRun.stage > 0 || CurrentRun.inGame)
+ {
+ return !CurrentRun.runComplete;
+ }
+ return false;
+ }
+ }
+
+ public static void SaveRun(EternalTrialsRun runToSave)
+ {
+ try
+ {
+ CurrentRun.LoadoutToStringsForSaving();
+ string contents = JsonUtility.ToJson(runToSave);
+ File.WriteAllText(SavePath, contents);
+ }
+ catch
+ {
+ Debug.LogError("There has been an error while trying to save the Eternal Trials run config.");
+ }
+ }
+
+ public static EternalTrialsRun TryLoadRun()
+ {
+ freshRunSeed = PlayerPrefs.GetInt("EternalTrials_FreshRunSeed");
+ if (freshRunSeed == 0)
+ {
+ GenerateNewFreshRunSeed();
+ }
+ try
+ {
+ if (File.Exists(SavePath))
+ {
+ EternalTrialsRun eternalTrialsRun = JsonUtility.FromJson<EternalTrialsRun>(File.ReadAllText(SavePath));
+ eternalTrialsRun.SavedStringsToLoadout();
+ Debug.Log("Eternal Trials run loaded.");
+ return eternalTrialsRun;
+ }
+ return null;
+ }
+ catch
+ {
+ Debug.Log("There has been an error while trying to load the Eternal Trials Run.");
+ return null;
+ }
+ }
+
+ public static void GenerateNewFreshRunSeed()
+ {
+ freshRunSeed = new System.Random().Next(int.MinValue, int.MaxValue);
+ PlayerPrefs.SetInt("EternalTrials_FreshRunSeed", freshRunSeed);
+ }
+
+ public static void DiscardActiveRun()
+ {
+ if (HasOngoingRun)
+ {
+ lastDiscardedRun = CurrentRun;
+ }
+ }
+
+ public static void RetrieveLastDiscardedRun()
+ {
+ if ((!(SceneTransitionManager.instance != null) || !SceneTransitionManager.instance.SceneTransitionIsRunning) && lastDiscardedRun != null)
+ {
+ currentRun = lastDiscardedRun;
+ }
+ }
+
+ public static void OnVictory()
+ {
+ string text = "";
+ CurrentRun.stage++;
+ AchievementManager.UnlockEternalTrialsAchievementForBeating(CurrentRun.stage);
+ for (int i = 0; i < mapRotation.Length; i++)
+ {
+ if (mapRotation[i] == CurrentRun.currentMap)
+ {
+ int num = i + 1;
+ if (num >= mapRotation.Length)
+ {
+ num = 0;
+ }
+ text = mapRotation[num];
+ }
+ }
+ if (text.Length <= 0)
+ {
+ Debug.Log("Current map not found in map rotation. Loading first map in rotation");
+ text = mapRotation[0];
+ }
+ CurrentRun.currentMap = text;
+ CurrentRun.currentStageSeed = new System.Random().Next(int.MinValue, int.MaxValue);
+ CurrentRun.inGame = false;
+ CurrentRun.inNight = false;
+ SaveRun(CurrentRun);
+ GenerateNewFreshRunSeed();
+ }
+
+ public static void OnDefeat()
+ {
+ CurrentRun.runComplete = true;
+ CurrentRun.inGame = false;
+ CurrentRun.inNight = false;
+ SaveRun(CurrentRun);
+ GenerateNewFreshRunSeed();
+ }
+
+ public static void LoadNextMap()
+ {
+ for (int num = PerkManager.instance.CurrentlyEquipped.Count - 1; num >= 0; num--)
+ {
+ PerkManager.SetEquipped(PerkManager.instance.CurrentlyEquipped[num], _equipped: false);
+ }
+ foreach (EquippablePerk acquiredPerk in CurrentRun.acquiredPerks)
+ {
+ if (acquiredPerk as EquippablePerk != null)
+ {
+ if (!CurrentRun.disabledPerks.Contains(acquiredPerk as EquippablePerk))
+ {
+ PerkManager.SetEquipped(acquiredPerk, _equipped: true);
+ }
+ }
+ else
+ {
+ PerkManager.SetEquipped(acquiredPerk, _equipped: true);
+ }
+ }
+ PerkManager.SetEquipped(CurrentRun.currentWeapon, _equipped: true);
+ SceneTransitionManager.instance.TransitionFromNullToLevel(CurrentRun.currentMap);
+ }
+
+ public static void CreateFreshRun()
+ {
+ currentRun = new EternalTrialsRun(mapRotation[0], freshRunSeed);
+ }
+
+ public static MapChoice[] GetMapChoices()
+ {
+ System.Random random = new System.Random(CurrentRun.currentStageSeed);
+ MapChoice[] array = new MapChoice[3];
+ string[] array2 = (string[])mapRotation.Clone();
+ array2.ETShuffle(random);
+ for (int i = 0; i < array.Length; i++)
+ {
+ if (i < array2.Length)
+ {
+ array[i] = MapChoice.GenerateNewMapChoice(2, array2[i], random, i);
+ }
+ else
+ {
+ array[i] = MapChoice.GenerateNewMapChoice(2, mapRotation[random.Next(0, mapRotation.Length)], random, i);
+ }
+ }
+ return array;
+ }
+
+ public static void ConfirmChoice(MapChoice choice)
+ {
+ CurrentRun.currentMap = choice.mapName;
+ CurrentRun.acquiredPerks.AddRange(choice.containedPerks);
+ CurrentRun.currentWeapon = choice.containedWeapon;
+ CurrentRun.inGame = true;
+ CurrentRun.currentStageSeed += choice.id;
+ SaveRun(CurrentRun);
+ GenerateNewFreshRunSeed();
+ }
+
+ public static void AddScore(int amount)
+ {
+ CurrentRun.score += amount;
+ SaveRun(CurrentRun);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsSelectScreen.cs b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsSelectScreen.cs
new file mode 100644
index 0000000..6de2470
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsSelectScreen.cs
@@ -0,0 +1,67 @@
+using UnityEngine;
+
+public class EternalTrialsSelectScreen : MonoBehaviour
+{
+ public UIFrame targetFrame;
+
+ public UIFrame loadoutSelectionFrame;
+
+ public GameObject runExistantButtons;
+
+ public GameObject noRunSavedButtons;
+
+ public ThronefallUIElement runExistantFirstSelected;
+
+ public ThronefallUIElement noRunSavedFirstSelected;
+
+ public ThronefallUIElement highscoreButton;
+
+ public ThronefallUIElement noSaveButton;
+
+ public ThronefallUIElement saveUpperButton;
+
+ public ThronefallUIElement saveLowerButton;
+
+ public void ContinueRun()
+ {
+ LocalGamestate.SelectedGameMode = LocalGamestate.GameMode.EternalTrial;
+ if (EternalTrialsRunManager.CurrentRun.inGame)
+ {
+ EternalTrialsRunManager.LoadNextMap();
+ }
+ else
+ {
+ UIFrameManager.instance.ChangeActiveFrame(loadoutSelectionFrame);
+ }
+ }
+
+ public void NewRun()
+ {
+ LocalGamestate.SelectedGameMode = LocalGamestate.GameMode.EternalTrial;
+ EternalTrialsRunManager.DiscardActiveRun();
+ EternalTrialsRunManager.CreateFreshRun();
+ UIFrameManager.instance.ChangeActiveFrame(loadoutSelectionFrame);
+ }
+
+ public void Refresh()
+ {
+ EternalTrialsRunManager.RetrieveLastDiscardedRun();
+ MatchSaveLoadHandler.TryLoadRun("ET_CurrentLevel");
+ if (EternalTrialsRunManager.HasOngoingRun)
+ {
+ runExistantButtons.SetActive(value: true);
+ noRunSavedButtons.SetActive(value: false);
+ targetFrame.firstSelected = runExistantFirstSelected;
+ highscoreButton.topNav = saveLowerButton;
+ highscoreButton.botNav = saveUpperButton;
+ }
+ else
+ {
+ runExistantButtons.SetActive(value: false);
+ noRunSavedButtons.SetActive(value: true);
+ targetFrame.firstSelected = noRunSavedFirstSelected;
+ highscoreButton.topNav = noSaveButton;
+ highscoreButton.botNav = noSaveButton;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsStageCountDisplay.cs b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsStageCountDisplay.cs
new file mode 100644
index 0000000..75920fa
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsStageCountDisplay.cs
@@ -0,0 +1,27 @@
+using TMPro;
+using UnityEngine;
+
+public class EternalTrialsStageCountDisplay : MonoBehaviour
+{
+ public GameObject toggleObj;
+
+ public TextMeshProUGUI targetDisplay;
+
+ private void OnEnable()
+ {
+ Refresh();
+ }
+
+ public void Refresh()
+ {
+ if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.EternalTrial)
+ {
+ toggleObj.SetActive(value: true);
+ targetDisplay.text = (EternalTrialsRunManager.CurrentRun.stage + 1).ToString();
+ }
+ else
+ {
+ toggleObj.SetActive(value: false);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsVictoryUI.cs b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsVictoryUI.cs
new file mode 100644
index 0000000..3867194
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EternalTrialsVictoryUI.cs
@@ -0,0 +1,246 @@
+using System.Collections;
+using Rewired;
+using TMPro;
+using UnityEngine;
+
+public class EternalTrialsVictoryUI : IUIAnimationSequence
+{
+ public GameObject parentObject;
+
+ public GameObject dividerParent;
+
+ public ThronefallUIElement continueButton;
+
+ public TextMeshProUGUI stageDisplay;
+
+ public TextMeshProUGUI baseScore;
+
+ public TextMeshProUGUI baseScoreName;
+
+ public TextMeshProUGUI goldScore;
+
+ public TextMeshProUGUI goldBonusName;
+
+ public TextMeshProUGUI overallScore;
+
+ public TextMeshProUGUI victoryDisplay;
+
+ public AnimationCurve popShowCurve;
+
+ public AnimationCurve bumpCurve;
+
+ public AnimationCurve scoreFillWiggle;
+
+ public AudioSource audioSource;
+
+ public CanvasGroup backgroundCG;
+
+ private bool inScoreUnroll;
+
+ private int baseScoreThisRound;
+
+ private int goldScoreThisRound;
+
+ private int overallScoreThisRound;
+
+ private int animationNextScore;
+
+ private float defaultWaitStep = 0.5f;
+
+ private float minorWaitStep = 0.25f;
+
+ private float animationStepA = 1.5f;
+
+ private float animationStepB = 0.5f;
+
+ private Coroutine currentScoringAnimation;
+
+ private bool skipScoringAnimation;
+
+ private bool inAnimation;
+
+ private Player input;
+
+ private void Update()
+ {
+ if (input == null)
+ {
+ input = ReInput.players.GetPlayer(0);
+ }
+ if (input != null && input.GetButtonDown("Interact") && inScoreUnroll)
+ {
+ if (currentScoringAnimation != null)
+ {
+ StopCoroutine(currentScoringAnimation);
+ }
+ currentScoringAnimation = null;
+ audioSource.Stop();
+ skipScoringAnimation = true;
+ inScoreUnroll = false;
+ }
+ }
+
+ public override IEnumerator PlayAnimation(UIFrame contextFrame)
+ {
+ inScoreUnroll = false;
+ skipScoringAnimation = false;
+ parentObject.SetActive(value: true);
+ victoryDisplay.text = TextTranslator.Translate("Menu/Victory") + ".";
+ stageDisplay.text = "<style=Body Bold>" + TextTranslator.Translate("Menu/Stage") + "<style=Body Numerals> " + EternalTrialsRunManager.CurrentRun.stage;
+ baseScore.gameObject.SetActive(value: false);
+ baseScoreName.gameObject.SetActive(value: false);
+ goldScore.gameObject.SetActive(value: false);
+ goldBonusName.gameObject.SetActive(value: false);
+ dividerParent.SetActive(value: false);
+ backgroundCG.alpha = 0f;
+ parentObject.SetActive(value: true);
+ float mainFrameFadeTimer = 0f;
+ float fadeTime = 0.25f;
+ while (mainFrameFadeTimer < fadeTime)
+ {
+ mainFrameFadeTimer += Time.unscaledDeltaTime;
+ backgroundCG.alpha = mainFrameFadeTimer / fadeTime;
+ yield return null;
+ }
+ backgroundCG.alpha = 1f;
+ Time.timeScale = 0f;
+ currentScoringAnimation = StartCoroutine(UnrollScores());
+ while (currentScoringAnimation != null)
+ {
+ yield return null;
+ }
+ if (skipScoringAnimation)
+ {
+ SkipUnrollScores();
+ }
+ inAnimation = false;
+ contextFrame.Select(continueButton);
+ yield return null;
+ }
+
+ public override void Reset()
+ {
+ parentObject.SetActive(value: false);
+ }
+
+ private IEnumerator UnrollScores()
+ {
+ inScoreUnroll = true;
+ baseScoreThisRound = SceneTransitionManager.instance.IngameScoreFromLastMatch;
+ goldScoreThisRound = SceneTransitionManager.instance.GoldBonusScoreFromLastMatch;
+ overallScoreThisRound = EternalTrialsRunManager.CurrentRun.score - baseScoreThisRound - goldScoreThisRound;
+ animationNextScore = overallScoreThisRound;
+ baseScore.text = baseScoreThisRound.ToString();
+ goldScore.text = goldScoreThisRound.ToString();
+ overallScore.text = overallScoreThisRound.ToString();
+ dividerParent.SetActive(value: true);
+ StartCoroutine(PopShowTransform(dividerParent.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildB, popShowCurve, animationStepB));
+ baseScoreName.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(baseScoreName.transform, null, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ baseScore.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(baseScore.transform, null, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ yield return AddToOverallScore(baseScoreThisRound, animationStepA);
+ goldBonusName.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(goldBonusName.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildC, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ goldScore.gameObject.SetActive(value: true);
+ StartCoroutine(PopShowTransform(goldScore.transform, ThronefallAudioManager.Instance.audioContent.PointScreenBuildA, popShowCurve, animationStepB));
+ yield return new WaitForSecondsRealtime(minorWaitStep);
+ yield return AddToOverallScore(goldScoreThisRound, animationStepA);
+ currentScoringAnimation = null;
+ }
+
+ private void SkipUnrollScores()
+ {
+ baseScoreThisRound = SceneTransitionManager.instance.IngameScoreFromLastMatch;
+ goldScoreThisRound = SceneTransitionManager.instance.GoldBonusScoreFromLastMatch;
+ overallScoreThisRound = EternalTrialsRunManager.CurrentRun.score;
+ baseScore.text = baseScoreThisRound.ToString();
+ goldScore.text = goldScoreThisRound.ToString();
+ overallScore.text = overallScoreThisRound.ToString();
+ dividerParent.SetActive(value: true);
+ baseScoreName.gameObject.SetActive(value: true);
+ baseScore.gameObject.SetActive(value: true);
+ goldBonusName.gameObject.SetActive(value: true);
+ goldScore.gameObject.SetActive(value: true);
+ dividerParent.transform.localScale = Vector3.one;
+ baseScoreName.transform.localScale = Vector3.one;
+ baseScore.transform.localScale = Vector3.one;
+ goldBonusName.transform.localScale = Vector3.one;
+ goldScore.transform.localScale = Vector3.one;
+ overallScore.transform.localScale = Vector3.one;
+ StartCoroutine(LockInScoreBump(0.5f));
+ }
+
+ private IEnumerator AddToOverallScore(int scoreToAdd, float animTime)
+ {
+ if (scoreToAdd == 0)
+ {
+ yield return new WaitForSecondsRealtime(0.15f);
+ yield break;
+ }
+ audioSource.clip = ThronefallAudioManager.Instance.audioContent.PointFill;
+ audioSource.loop = true;
+ audioSource.Play();
+ animationNextScore += scoreToAdd;
+ float timer = 0f;
+ while (timer < animTime)
+ {
+ timer += Time.unscaledDeltaTime;
+ overallScore.text = Mathf.RoundToInt(Mathf.Lerp(overallScoreThisRound, animationNextScore, Mathf.InverseLerp(0f, animTime, timer))).ToString();
+ yield return null;
+ }
+ overallScoreThisRound = animationNextScore;
+ overallScore.text = overallScoreThisRound.ToString();
+ audioSource.Stop();
+ audioSource.loop = false;
+ yield return StartCoroutine(LockInScoreBump(0.5f));
+ }
+
+ private IEnumerator LockInScoreBump(float animTime)
+ {
+ audioSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.PointLockInMajor, 0.85f);
+ float timer = 0f;
+ while (timer < animTime)
+ {
+ timer += Time.unscaledDeltaTime;
+ overallScore.transform.localScale = Vector3.one * bumpCurve.Evaluate(Mathf.InverseLerp(0f, animTime, timer));
+ yield return null;
+ }
+ overallScore.transform.localScale = Vector3.one;
+ }
+
+ private IEnumerator Bump(float animTime, Transform target, AudioClip clip)
+ {
+ if ((bool)clip)
+ {
+ audioSource.PlayOneShot(clip);
+ }
+ float timer = 0f;
+ while (timer < animTime)
+ {
+ timer += Time.unscaledDeltaTime;
+ target.transform.localScale = Vector3.one * bumpCurve.Evaluate(Mathf.InverseLerp(0f, animTime, timer));
+ yield return null;
+ }
+ target.transform.localScale = Vector3.one;
+ }
+
+ private IEnumerator PopShowTransform(Transform target, AudioClip clip, AnimationCurve curve, float animTime)
+ {
+ if ((bool)clip)
+ {
+ audioSource.PlayOneShot(clip);
+ }
+ float timer = 0f;
+ while (timer < animTime)
+ {
+ timer += Time.unscaledDeltaTime;
+ target.localScale = Vector3.one * curve.Evaluate(Mathf.InverseLerp(0f, animTime, timer));
+ yield return null;
+ }
+ target.localScale = Vector3.one;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/EternalWaveGenerator.cs b/Thronefall_v1.57/Thronefall/Thronefall/EternalWaveGenerator.cs
new file mode 100644
index 0000000..bc0357e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/EternalWaveGenerator.cs
@@ -0,0 +1,17 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class EternalWaveGenerator : ScriptableObject
+{
+ public virtual List<Wave> GenerateWaves(EnemySpawnLine[] _spawns, LevelInfo _levelInfo, int stage, out int startingGold, int seed, int waveCountOverride = -1)
+ {
+ List<Wave> result = new List<Wave>();
+ startingGold = 10;
+ return result;
+ }
+
+ public virtual string ReturnDebugInfoAboutWave(int _wave)
+ {
+ return "";
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/FakeChildTo.cs b/Thronefall_v1.57/Thronefall/Thronefall/FakeChildTo.cs
new file mode 100644
index 0000000..c7307e6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/FakeChildTo.cs
@@ -0,0 +1,40 @@
+using UnityEngine;
+
+public class FakeChildTo : MonoBehaviour
+{
+ [SerializeField]
+ private Transform fakeParent;
+
+ [SerializeField]
+ private bool unparentAtStart = true;
+
+ [SerializeField]
+ private bool disableThisComponentAfterStart;
+
+ private Vector3 offset;
+
+ private void Start()
+ {
+ offset = base.transform.localPosition;
+ if (unparentAtStart)
+ {
+ base.transform.SetParent(null);
+ }
+ if (disableThisComponentAfterStart)
+ {
+ base.enabled = false;
+ }
+ }
+
+ private void Update()
+ {
+ if (!fakeParent)
+ {
+ Object.Destroy(base.gameObject);
+ }
+ else
+ {
+ base.transform.position = fakeParent.position + offset;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/FakeTransorm.cs b/Thronefall_v1.57/Thronefall/Thronefall/FakeTransorm.cs
new file mode 100644
index 0000000..3202c80
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/FakeTransorm.cs
@@ -0,0 +1,41 @@
+using System;
+using UnityEngine;
+
+[Serializable]
+public class FakeTransorm
+{
+ private Vector3 localPosition;
+
+ private Vector3 localScale;
+
+ private Quaternion localRotation;
+
+ public FakeTransorm(Transform _transform)
+ {
+ SetToTransormValues(_transform);
+ }
+
+ public void SetToTransormValues(Transform _transform)
+ {
+ localPosition = _transform.localPosition;
+ localScale = _transform.localScale;
+ localRotation = _transform.localRotation;
+ }
+
+ public bool IsEqualTo(Transform _transform)
+ {
+ if (localPosition != _transform.localPosition)
+ {
+ return false;
+ }
+ if (localScale != _transform.localScale)
+ {
+ return false;
+ }
+ if (localRotation != _transform.localRotation)
+ {
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/FireArcherBurn.cs b/Thronefall_v1.57/Thronefall/Thronefall/FireArcherBurn.cs
new file mode 100644
index 0000000..63ff565
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/FireArcherBurn.cs
@@ -0,0 +1,83 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class FireArcherBurn : WeaponDamageDealer
+{
+ public ParticleSystem hotOilGround;
+
+ public float hotOilGroundBurnTickDuration = 0.2f;
+
+ public int hotOilGroundBurnTicks = 5;
+
+ public float range = 3.5f;
+
+ public List<DamageModifyer> damageModifyers = new List<DamageModifyer>();
+
+ public List<TagManager.ETag> mustHaveTags;
+
+ public List<TagManager.ETag> mayNotHaveTags;
+
+ public float timeTillSelfDestroy = 5f;
+
+ private TagManager tagManager;
+
+ private List<TaggedObject> foundTaggedObjects = new List<TaggedObject>();
+
+ private float timeTillTickEnds;
+
+ private int ticksRemaining;
+
+ private void Start()
+ {
+ tagManager = TagManager.instance;
+ if (DamageTick())
+ {
+ timeTillTickEnds = hotOilGroundBurnTickDuration;
+ ticksRemaining = hotOilGroundBurnTicks - 1;
+ ParticleSystem.EmissionModule emission = hotOilGround.emission;
+ emission.enabled = true;
+ }
+ }
+
+ private void Update()
+ {
+ if (timeTillTickEnds > 0f)
+ {
+ timeTillTickEnds -= Time.deltaTime;
+ if (timeTillTickEnds <= 0f)
+ {
+ ticksRemaining--;
+ if (ticksRemaining < 0)
+ {
+ ParticleSystem.EmissionModule emission = hotOilGround.emission;
+ emission.enabled = false;
+ }
+ else
+ {
+ DamageTick();
+ timeTillTickEnds = hotOilGroundBurnTickDuration;
+ }
+ }
+ }
+ timeTillSelfDestroy -= Time.deltaTime;
+ if (timeTillSelfDestroy <= 0f)
+ {
+ Object.Destroy(base.gameObject);
+ }
+ }
+
+ private bool DamageTick()
+ {
+ bool result = false;
+ tagManager.FindAllTaggedObjectsWithTags(foundTaggedObjects, mustHaveTags, mayNotHaveTags);
+ for (int i = 0; i < foundTaggedObjects.Count; i++)
+ {
+ if (!(tagManager.MeasureDistanceToTaggedObject(foundTaggedObjects[i], base.transform.position) > range))
+ {
+ result = true;
+ foundTaggedObjects[i].Hp.TakeDamage(DamageModifyer.CalculateDamageOnTarget(foundTaggedObjects[i], damageModifyers, damageMultiplyer) / (float)hotOilGroundBurnTicks);
+ }
+ }
+ return result;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/FishingHarbour.cs b/Thronefall_v1.57/Thronefall/Thronefall/FishingHarbour.cs
new file mode 100644
index 0000000..50fb7bb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/FishingHarbour.cs
@@ -0,0 +1,97 @@
+using System.Collections;
+using UnityEngine;
+
+public class FishingHarbour : IncomeModifyer, ISaveLoad
+{
+ public int incomeIncreasePerTurn = 1;
+
+ public int maximumIncome = 5;
+
+ private int maximumBoats;
+
+ public Transform activeChildOnIncomeIncrease;
+
+ private int activationNr;
+
+ private int shipsBuilt;
+
+ [Header("Perk Upgrade")]
+ [SerializeField]
+ private Equippable perk;
+
+ [SerializeField]
+ private int additionalBoatCapacity;
+
+ private void Start()
+ {
+ buildingInteractor.IncomeModifiers.Add(this);
+ for (int i = 0; i < activeChildOnIncomeIncrease.childCount; i++)
+ {
+ activeChildOnIncomeIncrease.GetChild(i).gameObject.SetActive(value: false);
+ }
+ if (PerkManager.instance.CurrentlyEquipped.Contains(perk))
+ {
+ foreach (BuildSlot.UpgradeBranch upgradeBranch in buildSlot.Upgrades[0].upgradeBranches)
+ {
+ upgradeBranch.objectsToActivate.Add(activeChildOnIncomeIncrease.GetChild(0).gameObject);
+ }
+ maximumIncome += additionalBoatCapacity;
+ activationNr = 1;
+ }
+ maximumBoats = maximumIncome;
+ }
+
+ public override void OnDawn()
+ {
+ if (buildSlot.Level > 0 && !buildingInteractor.KnockedOutTonight)
+ {
+ StartCoroutine(IncreaseIncomeAndBuildShip());
+ }
+ }
+
+ private IEnumerator IncreaseIncomeAndBuildShip()
+ {
+ yield return null;
+ yield return null;
+ if (activationNr < maximumBoats)
+ {
+ activeChildOnIncomeIncrease.GetChild(activationNr).gameObject.SetActive(value: true);
+ }
+ activationNr++;
+ shipsBuilt++;
+ buildSlot.GoldIncome = Mathf.Min(buildSlot.GoldIncome + incomeIncreasePerTurn, maximumIncome);
+ buildSlot.Upgrades[1].upgradeBranches[0].goldIncomeChange = buildSlot.GoldIncome;
+ buildSlot.Interactor.MarkAsHarvested();
+ }
+
+ private IEnumerator BatchBuildShipsOnLoad(int amount)
+ {
+ for (int i = 0; i < amount; i++)
+ {
+ yield return StartCoroutine(IncreaseIncomeAndBuildShip());
+ }
+ }
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ int value = 0;
+ MatchSaveLoadHandler.TryLoadValue(guid, "shipsBuilt", ref value);
+ if (value > 0)
+ {
+ StartCoroutine(BatchBuildShipsOnLoad(value));
+ }
+ }
+
+ public void OnSave(string guid)
+ {
+ MatchSaveLoadHandler.SaveValue(guid, "shipsBuilt", shipsBuilt);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/FishingHarbourUpgrade.cs b/Thronefall_v1.57/Thronefall/Thronefall/FishingHarbourUpgrade.cs
new file mode 100644
index 0000000..f8cc3ee
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/FishingHarbourUpgrade.cs
@@ -0,0 +1,15 @@
+using UnityEngine;
+
+public class FishingHarbourUpgrade : MonoBehaviour
+{
+ [SerializeField]
+ private FishingHarbour fishingHarbour;
+
+ private void OnEnable()
+ {
+ fishingHarbour.maximumIncome *= 2;
+ fishingHarbour.incomeIncreasePerTurn *= 2;
+ Object.Destroy(this);
+ Object.Destroy(base.gameObject);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/FollowTransform.cs b/Thronefall_v1.57/Thronefall/Thronefall/FollowTransform.cs
new file mode 100644
index 0000000..606bd93
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/FollowTransform.cs
@@ -0,0 +1,14 @@
+using UnityEngine;
+
+public class FollowTransform : MonoBehaviour
+{
+ public Transform target;
+
+ private void Update()
+ {
+ if ((bool)target)
+ {
+ base.transform.position = target.position;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ForceCameraPosOnEnable.cs b/Thronefall_v1.57/Thronefall/Thronefall/ForceCameraPosOnEnable.cs
new file mode 100644
index 0000000..859dcff
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ForceCameraPosOnEnable.cs
@@ -0,0 +1,27 @@
+using UnityEngine;
+
+public class ForceCameraPosOnEnable : MonoBehaviour
+{
+ [SerializeField]
+ private CameraRig cameraRig;
+
+ [SerializeField]
+ private Transform forcedPosition;
+
+ [SerializeField]
+ private float duration;
+
+ private void Update()
+ {
+ if (duration >= 0f)
+ {
+ cameraRig.overrideCameraTarget = forcedPosition;
+ duration -= Time.deltaTime;
+ }
+ else
+ {
+ cameraRig.overrideCameraTarget = null;
+ Object.Destroy(this);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/FreezePositionOnEnable.cs b/Thronefall_v1.57/Thronefall/Thronefall/FreezePositionOnEnable.cs
new file mode 100644
index 0000000..60685aa
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/FreezePositionOnEnable.cs
@@ -0,0 +1,25 @@
+using UnityEngine;
+
+public class FreezePositionOnEnable : MonoBehaviour
+{
+ private Transform oldParent;
+
+ private void OnEnable()
+ {
+ if (oldParent == null)
+ {
+ oldParent = base.transform.parent;
+ }
+ base.transform.SetParent(null);
+ base.transform.position = oldParent.position;
+ base.transform.rotation = oldParent.rotation;
+ }
+
+ private void Update()
+ {
+ if (!oldParent.gameObject.activeInHierarchy)
+ {
+ base.transform.SetParent(oldParent);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/FromToAnimation.cs b/Thronefall_v1.57/Thronefall/Thronefall/FromToAnimation.cs
new file mode 100644
index 0000000..29807cc
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/FromToAnimation.cs
@@ -0,0 +1,45 @@
+using System.Collections;
+using UnityEngine;
+
+public class FromToAnimation : OneShotAnimationBase
+{
+ public AnimationCurve curve;
+
+ public float duration = 0.75f;
+
+ public Vector3 eulerTargetRotation;
+
+ public Transform transformToAnimate;
+
+ private Quaternion initialRotation;
+
+ private Quaternion targetRotation;
+
+ private void Start()
+ {
+ initialRotation = transformToAnimate.localRotation;
+ targetRotation = Quaternion.Euler(eulerTargetRotation.x, eulerTargetRotation.y, eulerTargetRotation.z);
+ }
+
+ private IEnumerator Animate()
+ {
+ transformToAnimate.localRotation = initialRotation;
+ float timer = 0f;
+ while (timer < duration)
+ {
+ transformToAnimate.localRotation = Quaternion.Lerp(initialRotation, targetRotation, curve.Evaluate(timer / duration));
+ timer += Time.deltaTime;
+ yield return null;
+ }
+ transformToAnimate.localRotation = Quaternion.Lerp(initialRotation, targetRotation, curve.Evaluate(1f));
+ }
+
+ public override void Trigger()
+ {
+ if (base.gameObject.activeInHierarchy)
+ {
+ StopAllCoroutines();
+ StartCoroutine(Animate());
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/GPUInstanced.cs b/Thronefall_v1.57/Thronefall/Thronefall/GPUInstanced.cs
new file mode 100644
index 0000000..46c4d3e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/GPUInstanced.cs
@@ -0,0 +1,80 @@
+using UnityEngine;
+
+public class GPUInstanced : MonoBehaviour
+{
+ private MeshRenderer mr;
+
+ private GPUInstancingManager gpui;
+
+ private bool started;
+
+ private bool eenabled;
+
+ private Mesh mesh;
+
+ private Material mat;
+
+ private void Start()
+ {
+ if (mr == null)
+ {
+ mr = GetComponent<MeshRenderer>();
+ }
+ if (mr == null)
+ {
+ Object.Destroy(this);
+ return;
+ }
+ if (gpui == null)
+ {
+ gpui = GPUInstancingManager.Instance;
+ }
+ if (gpui == null)
+ {
+ Object.Destroy(this);
+ return;
+ }
+ mesh = mr.GetComponent<MeshFilter>().sharedMesh;
+ mat = mr.sharedMaterial;
+ if (eenabled)
+ {
+ mr.enabled = false;
+ gpui.AddVirtualMeshRenderer(mesh, mat, base.transform);
+ }
+ started = true;
+ }
+
+ private void OnEnable()
+ {
+ eenabled = true;
+ if (started)
+ {
+ mr.enabled = false;
+ gpui.AddVirtualMeshRenderer(mesh, mat, base.transform);
+ }
+ }
+
+ private void OnDisable()
+ {
+ eenabled = false;
+ if (started)
+ {
+ gpui.RemoveVirtualMeshRenderer(mesh, mat, base.transform);
+ }
+ }
+
+ public void OnMeshOrMaterialUpdate(Mesh newMesh, Material newMat)
+ {
+ if (newMesh != mesh || newMat != mat)
+ {
+ gpui.UpdateVirtualMeshRenderer(mesh, mat, newMesh, newMat, base.transform);
+ mesh = newMesh;
+ mat = newMat;
+ }
+ }
+
+ private void Update()
+ {
+ OnMeshOrMaterialUpdate(mesh, mr.sharedMaterial);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/GPUInstancingManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/GPUInstancingManager.cs
new file mode 100644
index 0000000..99d9dab
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/GPUInstancingManager.cs
@@ -0,0 +1,119 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class GPUInstancingManager : MonoBehaviour
+{
+ private struct MaterialMeshPair
+ {
+ public Material material;
+
+ public Mesh mesh;
+ }
+
+ private struct TransformMatrixPair
+ {
+ public List<Transform> transforms;
+
+ public List<Matrix4x4> matrices;
+ }
+
+ public static GPUInstancingManager Instance;
+
+ [Tooltip("Do not change this during runtime!")]
+ [SerializeField]
+ private bool gpuInstancingEnabled = true;
+
+ [SerializeField]
+ private bool debugLogs;
+
+ private Dictionary<MaterialMeshPair, TransformMatrixPair> matMeshPairToRenderersDictionary;
+
+ private List<Matrix4x4> transformMatricesBuffer = new List<Matrix4x4>();
+
+ private void Awake()
+ {
+ if (gpuInstancingEnabled)
+ {
+ Instance = this;
+ }
+ else
+ {
+ Instance = null;
+ }
+ matMeshPairToRenderersDictionary = new Dictionary<MaterialMeshPair, TransformMatrixPair>();
+ }
+
+ private void Update()
+ {
+ int num = 0;
+ int num2 = 0;
+ foreach (KeyValuePair<MaterialMeshPair, TransformMatrixPair> item in matMeshPairToRenderersDictionary)
+ {
+ TransformMatrixPair value = item.Value;
+ for (int i = 0; i < value.transforms.Count; i++)
+ {
+ if (value.transforms[i] != null)
+ {
+ value.matrices[i] = value.transforms[i].localToWorldMatrix;
+ }
+ }
+ if (value.matrices.Count >= 1024)
+ {
+ Debug.LogWarning("Drawing too many meshes with mesh: " + item.Key.mesh.ToString());
+ }
+ try
+ {
+ Graphics.DrawMeshInstanced(item.Key.mesh, 0, item.Key.material, value.matrices);
+ }
+ catch
+ {
+ Debug.LogError("GPU instancing with material failed: " + item.Key.material.ToString());
+ }
+ num += value.transforms.Count;
+ num2++;
+ }
+ }
+
+ public void AddVirtualMeshRenderer(Mesh mesh, Material material, Transform transform)
+ {
+ MaterialMeshPair key = default(MaterialMeshPair);
+ key.material = material;
+ key.mesh = mesh;
+ if (!matMeshPairToRenderersDictionary.TryGetValue(key, out var value))
+ {
+ TransformMatrixPair transformMatrixPair = default(TransformMatrixPair);
+ transformMatrixPair.transforms = new List<Transform>();
+ transformMatrixPair.matrices = new List<Matrix4x4>();
+ value = transformMatrixPair;
+ matMeshPairToRenderersDictionary[key] = value;
+ }
+ value.transforms.Add(transform);
+ value.matrices.Add(transform.localToWorldMatrix);
+ }
+
+ public void RemoveVirtualMeshRenderer(Mesh mesh, Material material, Transform transform)
+ {
+ MaterialMeshPair key = default(MaterialMeshPair);
+ key.material = material;
+ key.mesh = mesh;
+ if (matMeshPairToRenderersDictionary.TryGetValue(key, out var value))
+ {
+ int num = value.transforms.IndexOf(transform);
+ if (num != -1)
+ {
+ value.transforms.RemoveAt(num);
+ value.matrices.RemoveAt(num);
+ }
+ if (value.transforms.Count == 0)
+ {
+ matMeshPairToRenderersDictionary.Remove(key);
+ }
+ }
+ }
+
+ public void UpdateVirtualMeshRenderer(Mesh oldMesh, Material oldMaterial, Mesh newMesh, Material newMaterial, Transform transform)
+ {
+ RemoveVirtualMeshRenderer(oldMesh, oldMaterial, transform);
+ AddVirtualMeshRenderer(newMesh, newMaterial, transform);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/GateOpener.cs b/Thronefall_v1.57/Thronefall/Thronefall/GateOpener.cs
new file mode 100644
index 0000000..31d79a4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/GateOpener.cs
@@ -0,0 +1,172 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class GateOpener : MonoBehaviour
+{
+ public enum Mode
+ {
+ Door,
+ Bars
+ }
+
+ public float openDistance = 5f;
+
+ public float clearDistance = 10f;
+
+ public Mode mode;
+
+ public Transform doorL;
+
+ public Transform doorR;
+
+ public float maxAngle;
+
+ public Transform bars;
+
+ public Vector3 openPositionOffset = new Vector3(0f, -3.6f, 0f);
+
+ public float animationTime = 1f;
+
+ private bool open;
+
+ private List<TagManager.ETag> tagList = new List<TagManager.ETag>(new TagManager.ETag[2]
+ {
+ TagManager.ETag.Player,
+ TagManager.ETag.PlayerUnit
+ });
+
+ private float openAnimationClock;
+
+ private IReadOnlyList<TaggedObject> playerUnits;
+
+ private IReadOnlyList<TaggedObject> players;
+
+ private Vector3 doorLInitRotation;
+
+ private Vector3 doorRInitRotation;
+
+ private Vector3 barsInitPosition;
+
+ private bool isDoor => mode == Mode.Door;
+
+ private bool isBars => mode == Mode.Bars;
+
+ private void Start()
+ {
+ if ((bool)doorL)
+ {
+ doorLInitRotation = doorL.rotation.eulerAngles;
+ }
+ if ((bool)doorR)
+ {
+ doorRInitRotation = doorR.rotation.eulerAngles;
+ }
+ if ((bool)bars)
+ {
+ barsInitPosition = bars.transform.position;
+ }
+ if (!TagManager.instance)
+ {
+ Debug.LogError("No Tag Manager in scene.");
+ return;
+ }
+ playerUnits = TagManager.instance.PlayerUnits;
+ players = TagManager.instance.Players;
+ }
+
+ private void Update()
+ {
+ if (!TagManager.instance)
+ {
+ return;
+ }
+ if (open)
+ {
+ bool flag = true;
+ foreach (TaggedObject playerUnit in TagManager.instance.PlayerUnits)
+ {
+ if (playerUnit.gameObject.activeInHierarchy && Vector3.Distance(base.transform.position, playerUnit.transform.position) <= clearDistance && playerUnit.Tags.Contains(TagManager.ETag.AUTO_Alive) && !(Vector3.Distance(playerUnit.transform.position, playerUnit.GetComponent<PathfindMovementPlayerunit>().HomePosition) < 0.5f))
+ {
+ flag = false;
+ break;
+ }
+ }
+ foreach (TaggedObject player in players)
+ {
+ if (player.gameObject.activeInHierarchy && Vector3.Distance(base.transform.position, player.transform.position) <= openDistance && player.Tags.Contains(TagManager.ETag.AUTO_Alive))
+ {
+ flag = false;
+ }
+ }
+ if (flag)
+ {
+ Close();
+ }
+ }
+ else
+ {
+ foreach (TaggedObject playerUnit2 in playerUnits)
+ {
+ if (playerUnit2.gameObject.activeInHierarchy && Vector3.Distance(base.transform.position, playerUnit2.transform.position) <= openDistance && playerUnit2.Tags.Contains(TagManager.ETag.AUTO_Alive) && !(Vector3.Distance(playerUnit2.transform.position, playerUnit2.GetComponent<PathfindMovementPlayerunit>().HomePosition) < 0.5f))
+ {
+ Open();
+ return;
+ }
+ }
+ foreach (TaggedObject player2 in players)
+ {
+ if (player2.gameObject.activeInHierarchy && Vector3.Distance(base.transform.position, player2.transform.position) <= openDistance && player2.Tags.Contains(TagManager.ETag.AUTO_Alive))
+ {
+ Open();
+ }
+ }
+ }
+ if (open && openAnimationClock < animationTime)
+ {
+ openAnimationClock += Time.deltaTime;
+ if (openAnimationClock > animationTime)
+ {
+ openAnimationClock = animationTime;
+ }
+ }
+ else if (!open && openAnimationClock > 0f)
+ {
+ openAnimationClock -= Time.deltaTime;
+ if (openAnimationClock < 0f)
+ {
+ openAnimationClock = 0f;
+ }
+ }
+ switch (mode)
+ {
+ case Mode.Door:
+ {
+ float num = Mathf.SmoothStep(0f, maxAngle, openAnimationClock / animationTime);
+ doorL.rotation = Quaternion.Euler(doorLInitRotation + Vector3.forward * num);
+ doorR.rotation = Quaternion.Euler(doorRInitRotation + Vector3.forward * (0f - num));
+ break;
+ }
+ case Mode.Bars:
+ bars.transform.position = Vector3.Slerp(barsInitPosition, barsInitPosition + openPositionOffset, openAnimationClock / animationTime);
+ break;
+ }
+ }
+
+ private void Close()
+ {
+ open = false;
+ }
+
+ private void Open()
+ {
+ open = true;
+ }
+
+ private void OnDrawGizmosSelected()
+ {
+ Gizmos.color = Color.yellow;
+ Gizmos.DrawWireSphere(base.transform.position, openDistance);
+ Gizmos.color = Color.red;
+ Gizmos.DrawWireSphere(base.transform.position, clearDistance);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/GlobalAudioListener.cs b/Thronefall_v1.57/Thronefall/Thronefall/GlobalAudioListener.cs
new file mode 100644
index 0000000..28a5019
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/GlobalAudioListener.cs
@@ -0,0 +1,48 @@
+using UnityEngine;
+
+public class GlobalAudioListener : MonoBehaviour
+{
+ public static GlobalAudioListener instance;
+
+ private PlayerInteraction bufferedPlayerInteraction;
+
+ private Transform bufferedTargetTransform;
+
+ private Vector3 offset = new Vector3(0f, 2f, 0f);
+
+ private void Awake()
+ {
+ if (instance != null)
+ {
+ Object.Destroy(base.gameObject);
+ return;
+ }
+ instance = this;
+ Object.DontDestroyOnLoad(base.gameObject);
+ }
+
+ private void Update()
+ {
+ PlayerInteraction playerInteraction = PlayerInteraction.instance;
+ if (bufferedPlayerInteraction != playerInteraction)
+ {
+ if (playerInteraction == null)
+ {
+ bufferedTargetTransform = null;
+ }
+ else
+ {
+ bufferedTargetTransform = playerInteraction.transform;
+ }
+ }
+ if (bufferedTargetTransform != null)
+ {
+ base.transform.position = bufferedTargetTransform.position + offset;
+ }
+ else
+ {
+ base.transform.position = Vector3.zero;
+ }
+ bufferedPlayerInteraction = playerInteraction;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/GlobalHealing.cs b/Thronefall_v1.57/Thronefall/Thronefall/GlobalHealing.cs
new file mode 100644
index 0000000..8fdba6f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/GlobalHealing.cs
@@ -0,0 +1,78 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class GlobalHealing : MonoBehaviour
+{
+ private bool healPlayerUntisPerkActive;
+
+ private bool healEnemyUnitsMutatorActive;
+
+ private float healPlayerUnitsPerHeal;
+
+ private float healEnemyUnitsPerHealPercentage;
+
+ private float healPlayerUnitsCooldown = 1f;
+
+ private float healEnemyUnitsCooldown = 0.1f;
+
+ private TagManager tagManager;
+
+ [SerializeField]
+ private List<TagManager.ETag> playerUnitsMustHaveTags;
+
+ [SerializeField]
+ private List<TagManager.ETag> playerUnitsMayNotHaveTags;
+
+ [SerializeField]
+ private List<TagManager.ETag> enemyUnitsMustHaveTags;
+
+ [SerializeField]
+ private List<TagManager.ETag> enemyUnitsMayNotHaveTags;
+
+ private List<TaggedObject> taggedObjectsFound = new List<TaggedObject>();
+
+ private void Start()
+ {
+ tagManager = TagManager.instance;
+ healPlayerUntisPerkActive = PerkManager.instance.HealthPotionsActive;
+ healEnemyUnitsMutatorActive = PerkManager.instance.TauntThePhoenixGodActive;
+ healPlayerUnitsPerHeal = PerkManager.instance.healthPotion_HealingPerSec * 2f;
+ healEnemyUnitsPerHealPercentage = PerkManager.instance.phoenixGod_HealingPercentagePerSec * 2f;
+ if (!healPlayerUntisPerkActive && !healEnemyUnitsMutatorActive)
+ {
+ Object.Destroy(this);
+ }
+ }
+
+ private void Update()
+ {
+ if (healPlayerUntisPerkActive)
+ {
+ healPlayerUnitsCooldown -= Time.deltaTime;
+ if (healPlayerUnitsCooldown <= 0f)
+ {
+ healPlayerUnitsCooldown += 2f;
+ tagManager.FindAllTaggedObjectsWithTags(taggedObjectsFound, playerUnitsMustHaveTags, playerUnitsMayNotHaveTags);
+ foreach (TaggedObject item in taggedObjectsFound)
+ {
+ item.Hp.Heal(healPlayerUnitsPerHeal);
+ }
+ }
+ }
+ if (!healEnemyUnitsMutatorActive)
+ {
+ return;
+ }
+ healEnemyUnitsCooldown -= Time.deltaTime;
+ if (!(healEnemyUnitsCooldown <= 0f))
+ {
+ return;
+ }
+ healEnemyUnitsCooldown += 2f;
+ tagManager.FindAllTaggedObjectsWithTags(taggedObjectsFound, enemyUnitsMustHaveTags, enemyUnitsMayNotHaveTags);
+ foreach (TaggedObject item2 in taggedObjectsFound)
+ {
+ item2.Hp.Heal(healEnemyUnitsPerHealPercentage * item2.Hp.maxHp);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/GraphDrawer.cs b/Thronefall_v1.57/Thronefall/Thronefall/GraphDrawer.cs
new file mode 100644
index 0000000..4776cdd
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/GraphDrawer.cs
@@ -0,0 +1,125 @@
+using System.Collections.Generic;
+using TMPro;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class GraphDrawer : MonoBehaviour
+{
+ public enum Type
+ {
+ Networth,
+ Score
+ }
+
+ public Type type;
+
+ private List<int> current;
+
+ private List<int> oldBest;
+
+ [SerializeField]
+ private Color colorCurrent;
+
+ [SerializeField]
+ private Color colorOldBest;
+
+ [SerializeField]
+ private GameObject graphMarkersPrefab;
+
+ [SerializeField]
+ private GameObject graphSclaeMarkerPrefab;
+
+ [SerializeField]
+ private RectTransform graphSurface;
+
+ private int xMaxScale;
+
+ private int yMaxScale;
+
+ private float width;
+
+ private float height;
+
+ private float wspacing;
+
+ public void Generate(string _comingFromScene)
+ {
+ LevelData levelDataForScene = LevelProgressManager.instance.GetLevelDataForScene(_comingFromScene);
+ if (type == Type.Networth)
+ {
+ current = levelDataForScene.dayToDayNetworth;
+ oldBest = levelDataForScene.dayToDayNetworthBest;
+ }
+ else if (type == Type.Score)
+ {
+ current = levelDataForScene.dayToDayScore;
+ oldBest = levelDataForScene.dayToDayScoreBest;
+ }
+ xMaxScale = Mathf.Max(oldBest.Count, current.Count);
+ width = graphSurface.rect.width;
+ height = graphSurface.rect.height;
+ if (xMaxScale > 1)
+ {
+ wspacing = width / (float)(xMaxScale - 1);
+ }
+ else
+ {
+ wspacing = 0f;
+ }
+ yMaxScale = 1;
+ for (int i = 0; i < oldBest.Count; i++)
+ {
+ yMaxScale = Mathf.Max(yMaxScale, oldBest[i]);
+ }
+ for (int j = 0; j < current.Count; j++)
+ {
+ yMaxScale = Mathf.Max(yMaxScale, current[j]);
+ }
+ GameObject gameObject = Object.Instantiate(graphSclaeMarkerPrefab, graphSurface);
+ gameObject.transform.localPosition = new Vector3((0f - width) / 2f, (0f - height) / 2f);
+ gameObject.GetComponentInChildren<TMP_Text>().text = "0";
+ gameObject = Object.Instantiate(graphSclaeMarkerPrefab, graphSurface);
+ gameObject.transform.localPosition = new Vector3((0f - width) / 2f, height / 2f);
+ if (yMaxScale < 1000)
+ {
+ gameObject.GetComponentInChildren<TMP_Text>().text = yMaxScale.ToString();
+ }
+ else
+ {
+ int num = Mathf.FloorToInt((float)yMaxScale / 1000f);
+ int num2 = Mathf.FloorToInt((float)yMaxScale / 100f) - num * 10;
+ gameObject.GetComponentInChildren<TMP_Text>().text = num + "." + num2 + "K";
+ }
+ PlotList(oldBest, colorOldBest);
+ PlotList(current, colorCurrent);
+ }
+
+ private void PlotList(List<int> _list, Color _color)
+ {
+ if (_list.Count <= 0)
+ {
+ return;
+ }
+ Vector3 vector = Vector3.zero;
+ for (int i = 0; i < _list.Count; i++)
+ {
+ float x = (float)i * wspacing - width / 2f;
+ float y = (float)_list[i] / (float)yMaxScale * height - height / 2f;
+ Vector3 vector2 = new Vector3(x, y, 0f);
+ if (i > 0 || _list.Count <= 1)
+ {
+ GameObject obj = Object.Instantiate(graphMarkersPrefab, graphSurface);
+ RectTransform component = obj.GetComponent<RectTransform>();
+ component.localPosition = vector2;
+ obj.GetComponent<Image>().color = _color;
+ if (i > 0)
+ {
+ component.localPosition = (vector + vector2) / 2f;
+ component.localScale = new Vector3((vector - vector2).magnitude / component.rect.width, component.localScale.y, component.localScale.z);
+ component.localRotation = Quaternion.Euler(0f, 0f, Vector2.SignedAngle(Vector2.right, vector - vector2));
+ }
+ }
+ vector = vector2;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/HealBoostMA.cs b/Thronefall_v1.57/Thronefall/Thronefall/HealBoostMA.cs
new file mode 100644
index 0000000..8e24393
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/HealBoostMA.cs
@@ -0,0 +1,69 @@
+using UnityEngine;
+
+public class HealBoostMA : ManualAttack
+{
+ public float attackSpeedBoost = 20f;
+
+ public ManualAttack manualAttackToBoost;
+
+ public ParticleSystem boostParticles;
+
+ public float attackSpeedDuration = 2f;
+
+ public float healthRegenerationPerSecond = 16.66f;
+
+ public float attackSpeedDurationWhenLowHealth = 4f;
+
+ private float disableBoostIn;
+
+ private float attackSpeedOriginal;
+
+ private bool attackSpeedReduced;
+
+ private float cooldownOnAttack;
+
+ public override void Start()
+ {
+ base.Start();
+ }
+
+ public override void Attack()
+ {
+ if (!attackSpeedReduced)
+ {
+ attackSpeedOriginal = manualAttackToBoost.cooldownTime;
+ manualAttackToBoost.cooldownTime /= attackSpeedBoost;
+ attackSpeedReduced = true;
+ }
+ ParticleSystem.EmissionModule emission = boostParticles.emission;
+ emission.enabled = true;
+ disableBoostIn = attackSpeedDuration;
+ if (hpPlayer.HpPercentage <= 0.33f)
+ {
+ disableBoostIn = attackSpeedDurationWhenLowHealth;
+ }
+ cooldownOnAttack = cooldown;
+ }
+
+ public override void Update()
+ {
+ base.Update();
+ disableBoostIn -= Time.deltaTime;
+ bool flag = hpPlayer.HpValue <= 0f;
+ if (disableBoostIn > 0f && !flag)
+ {
+ hpPlayer.Heal(healthRegenerationPerSecond * PlayerUpgradeManager.instance.PlayerHealthRegenerationMultiplyer * Time.deltaTime);
+ cooldown = cooldownOnAttack;
+ }
+ if ((disableBoostIn + Time.deltaTime > 0f && disableBoostIn <= Time.deltaTime) || flag)
+ {
+ if (attackSpeedReduced)
+ {
+ attackSpeedReduced = false;
+ manualAttackToBoost.cooldownTime = attackSpeedOriginal;
+ }
+ ParticleSystem.EmissionModule emission = boostParticles.emission;
+ emission.enabled = false;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/HealthStealWeaponEffect.cs b/Thronefall_v1.57/Thronefall/Thronefall/HealthStealWeaponEffect.cs
new file mode 100644
index 0000000..8f665a9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/HealthStealWeaponEffect.cs
@@ -0,0 +1,14 @@
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "Weapon", menuName = "SimpleSiege/Healthsteal Effect")]
+public class HealthStealWeaponEffect : AdditionalWeaponEffectScript
+{
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Percentage)]
+ private float regenTargetHp = 2f;
+
+ public override void Effect(Hp _hpHit, TaggedObject _attacked, TaggedObject _attacker, Weapon _weapon, float _damageMultiplyer)
+ {
+ _attacker.Hp.Heal(regenTargetHp);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Healthbar.cs b/Thronefall_v1.57/Thronefall/Thronefall/Healthbar.cs
new file mode 100644
index 0000000..e8e63e6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Healthbar.cs
@@ -0,0 +1,172 @@
+using MPUIKIT;
+using UnityEngine;
+
+public class Healthbar : MonoBehaviour
+{
+ [SerializeField]
+ protected GameObject canvasParent;
+
+ [SerializeField]
+ protected MPImageBasic fill;
+
+ [SerializeField]
+ protected MPImageBasic delayedFill;
+
+ [SerializeField]
+ protected Hp target;
+
+ [SerializeField]
+ protected Color deathFillColor;
+
+ [SerializeField]
+ private bool flashWhenBelowThreshold;
+
+ [SerializeField]
+ [Range(0f, 1f)]
+ private float flashThreshhold;
+
+ [SerializeField]
+ private float flashInterval = 0.25f;
+
+ [SerializeField]
+ private Color flashColor;
+
+ [SerializeField]
+ private MPImageBasic flashTarget;
+
+ [SerializeField]
+ private float damageFlashSize = 1.2f;
+
+ protected Color defaultDelayedFillColor;
+
+ protected float hpLast;
+
+ private float hpNow;
+
+ private float damageFlash;
+
+ private bool shouldUnparentAndDestroyOnDeath;
+
+ private Color flashDefaultColor;
+
+ private float flashClock;
+
+ private readonly float finalDrainSpeed = 0.5f;
+
+ private readonly float maxDrainSpeed = 1f;
+
+ private readonly float minDrainSpeed = 0.1f;
+
+ private void Start()
+ {
+ target.OnHpChange.AddListener(UpdateDisplay);
+ defaultDelayedFillColor = delayedFill.color;
+ UpdateDisplay();
+ delayedFill.fillAmount = fill.fillAmount;
+ hpLast = 1f;
+ shouldUnparentAndDestroyOnDeath = !target.getsKnockedOutInsteadOfDying;
+ if (shouldUnparentAndDestroyOnDeath)
+ {
+ target.OnKillOrKnockout.AddListener(UnparentItself);
+ }
+ if (flashWhenBelowThreshold)
+ {
+ flashDefaultColor = flashTarget.color;
+ }
+ }
+
+ private void Update()
+ {
+ hpNow = fill.fillAmount;
+ bool flag = Mathf.Approximately(hpNow, 0f);
+ if (!Mathf.Approximately(hpNow, delayedFill.fillAmount))
+ {
+ if (!flag)
+ {
+ delayedFill.fillAmount = Mathf.MoveTowards(delayedFill.fillAmount, fill.fillAmount, Mathf.Lerp(minDrainSpeed, maxDrainSpeed, delayedFill.fillAmount - fill.fillAmount) * Time.deltaTime);
+ }
+ else
+ {
+ delayedFill.fillAmount = Mathf.MoveTowards(delayedFill.fillAmount, fill.fillAmount, Mathf.Lerp(finalDrainSpeed, maxDrainSpeed, delayedFill.fillAmount - fill.fillAmount) * Time.deltaTime);
+ }
+ }
+ if (hpNow < hpLast)
+ {
+ damageFlash = 2f;
+ }
+ if (flag && delayedFill.fillAmount < 0.01f)
+ {
+ if (shouldUnparentAndDestroyOnDeath)
+ {
+ Object.Destroy(base.gameObject);
+ }
+ else
+ {
+ canvasParent.SetActive(value: false);
+ base.enabled = false;
+ }
+ }
+ if (flashWhenBelowThreshold)
+ {
+ if (hpNow <= flashThreshhold && hpNow > 0f)
+ {
+ flashClock -= Time.deltaTime;
+ if (flashClock <= 0f)
+ {
+ flashClock = flashInterval;
+ if (flashTarget.color == flashColor)
+ {
+ flashTarget.color = flashDefaultColor;
+ }
+ else
+ {
+ flashTarget.color = flashColor;
+ }
+ }
+ }
+ else if (flashTarget.color != flashDefaultColor)
+ {
+ flashTarget.color = flashDefaultColor;
+ flashClock = 0f;
+ }
+ else
+ {
+ flashClock = 0f;
+ }
+ }
+ float num = Mathf.Lerp(1f, damageFlashSize, damageFlash);
+ base.transform.localScale = new Vector3(num, num, num);
+ damageFlash *= Mathf.Pow(0.1f, Time.deltaTime * 3f);
+ hpLast = hpNow;
+ }
+
+ public virtual void UpdateDisplay()
+ {
+ if (target.HpPercentage == 1f)
+ {
+ canvasParent.SetActive(value: false);
+ base.enabled = false;
+ hpLast = 1f;
+ delayedFill.fillAmount = hpLast;
+ }
+ else
+ {
+ canvasParent.SetActive(value: true);
+ base.enabled = true;
+ }
+ fill.fillAmount = target.HpPercentage;
+ if (Mathf.Approximately(fill.fillAmount, 0f))
+ {
+ delayedFill.color = deathFillColor;
+ }
+ else
+ {
+ delayedFill.color = defaultDelayedFillColor;
+ }
+ }
+
+ private void UnparentItself()
+ {
+ base.transform.SetParent(null);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/HealthbarMulti.cs b/Thronefall_v1.57/Thronefall/Thronefall/HealthbarMulti.cs
new file mode 100644
index 0000000..8cfd05a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/HealthbarMulti.cs
@@ -0,0 +1,46 @@
+using UnityEngine;
+
+public class HealthbarMulti : Healthbar
+{
+ [SerializeField]
+ private int segments = 10;
+
+ [SerializeField]
+ private Transform lifes;
+
+ public override void UpdateDisplay()
+ {
+ float fillAmount = target.HpPercentage * (float)segments % 1f;
+ _ = target.HpPercentage * (float)segments % 1f;
+ int num = Mathf.FloorToInt(target.HpPercentage / (1f / (float)segments));
+ for (int i = 0; i < lifes.childCount; i++)
+ {
+ lifes.GetChild(i).gameObject.SetActive(num > i);
+ }
+ if (target.invulnerable)
+ {
+ fillAmount = 1f;
+ }
+ if (target.HpPercentage == 1f)
+ {
+ canvasParent.SetActive(value: false);
+ base.enabled = false;
+ hpLast = 1f;
+ delayedFill.fillAmount = hpLast;
+ }
+ else
+ {
+ canvasParent.SetActive(value: true);
+ base.enabled = true;
+ }
+ fill.fillAmount = fillAmount;
+ if (Mathf.Approximately(fill.fillAmount, 0f))
+ {
+ delayedFill.color = deathFillColor;
+ }
+ else
+ {
+ delayedFill.color = defaultDelayedFillColor;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/HighscorePreviewUI.cs b/Thronefall_v1.57/Thronefall/Thronefall/HighscorePreviewUI.cs
new file mode 100644
index 0000000..85db980
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/HighscorePreviewUI.cs
@@ -0,0 +1,66 @@
+using System.Collections.Generic;
+using Steamworks;
+using TMPro;
+using UnityEngine;
+
+public class HighscorePreviewUI : MonoBehaviour
+{
+ public TMP_Text highscore;
+
+ public TMP_Text friendsRank;
+
+ private bool subscribedToSteamManager;
+
+ private readonly string lightTextCue = "<style=Body Light>";
+
+ private void OnEnable()
+ {
+ HighscoreTable.ETERNAL_TRIALS = false;
+ int highscoreBest = LevelProgressManager.instance.GetLevelDataForScene(LevelInteractor.lastActiveLevelInfo.sceneName).highscoreBest;
+ string text = ((highscoreBest != 0) ? highscoreBest.ToString() : "-");
+ highscore.text = TextTranslator.Translate("Menu/Highscore") + ": " + lightTextCue + text;
+ friendsRank.text = TextTranslator.Translate("Menu/Friends Rank") + ": " + lightTextCue + "-";
+ SubscribeToSteamManger();
+ SteamManager.Instance.DownloadFriendsHighscores(LevelInteractor.lastActiveLevelInfo.sceneName);
+ }
+
+ private void SubscribeToSteamManger()
+ {
+ if (!subscribedToSteamManager)
+ {
+ SteamManager.Instance.OnLeaderboardDownloadCallbackComplete.AddListener(RefreshUI);
+ subscribedToSteamManager = true;
+ }
+ }
+
+ public void RefreshUI()
+ {
+ friendsRank.text = TextTranslator.Translate("Menu/Friends Rank") + ": " + lightTextCue;
+ List<SteamManager.LeaderboardEntry> lastDownloadedLeaderboardEntires = SteamManager.Instance.lastDownloadedLeaderboardEntires;
+ if (lastDownloadedLeaderboardEntires.Count > 0)
+ {
+ int num = 0;
+ int num2 = 1;
+ foreach (SteamManager.LeaderboardEntry item in lastDownloadedLeaderboardEntires)
+ {
+ if (item.username == SteamFriends.GetPersonaName())
+ {
+ num = num2;
+ break;
+ }
+ num2++;
+ }
+ if (num == 0)
+ {
+ friendsRank.text += "-";
+ return;
+ }
+ TMP_Text tMP_Text = friendsRank;
+ tMP_Text.text = tMP_Text.text + "#" + num;
+ }
+ else
+ {
+ friendsRank.text += "-";
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/HighscoreTable.cs b/Thronefall_v1.57/Thronefall/Thronefall/HighscoreTable.cs
new file mode 100644
index 0000000..ec61d09
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/HighscoreTable.cs
@@ -0,0 +1,132 @@
+using System.Collections.Generic;
+using Steamworks;
+using TMPro;
+using UnityEngine;
+
+public class HighscoreTable : MonoBehaviour
+{
+ public static bool ETERNAL_TRIALS;
+
+ private ScoreTag[] scoreTags = new ScoreTag[0];
+
+ private string currentHighscoreTableToCall = "";
+
+ public Transform scoreTagParent;
+
+ public GameObject loading;
+
+ public GameObject notConnectedToSteam;
+
+ public GameObject noScore;
+
+ public GameObject noFriends;
+
+ public TextMeshProUGUI levelTitle;
+
+ private bool subscribedToSteamManager;
+
+ public void UpdateLevelTitle()
+ {
+ if (ETERNAL_TRIALS)
+ {
+ levelTitle.text = TextTranslator.Translate("Menu/Eternal Trials");
+ return;
+ }
+ LevelInfo levelInfo = null;
+ levelInfo = ((!(LevelInteractor.lastActiveLevelInfo != null)) ? LevelProgressManager.instance.GetLevelInfoFromCurrentSceneName() : LevelInteractor.lastActiveLevelInfo);
+ if (!(levelInfo == null))
+ {
+ levelTitle.text = levelInfo.displayName;
+ if (levelInfo.displaySubtitle.Length > 0)
+ {
+ TextMeshProUGUI textMeshProUGUI = levelTitle;
+ textMeshProUGUI.text = textMeshProUGUI.text + "\n<size=" + 20 + "><style=Subheader>" + levelInfo.displaySubtitle + "</size></style>";
+ }
+ }
+ }
+
+ public void SetAndDownloadHighscoreTable(string _highscoreTableName)
+ {
+ noScore.SetActive(value: false);
+ noFriends.SetActive(value: false);
+ currentHighscoreTableToCall = _highscoreTableName;
+ scoreTags = new ScoreTag[scoreTagParent.childCount];
+ for (int i = 0; i < scoreTagParent.childCount; i++)
+ {
+ scoreTags[i] = scoreTagParent.GetChild(i).GetComponent<ScoreTag>();
+ scoreTagParent.GetChild(i).gameObject.SetActive(value: false);
+ }
+ if (SteamManager.Initialized)
+ {
+ SubscribeToSteamManger();
+ SteamManager.Instance.DownloadFriendsHighscores(currentHighscoreTableToCall);
+ loading.SetActive(value: true);
+ notConnectedToSteam.SetActive(value: false);
+ }
+ else
+ {
+ loading.SetActive(value: false);
+ notConnectedToSteam.SetActive(value: true);
+ }
+ }
+
+ private void OnEnable()
+ {
+ UpdateLevelTitle();
+ if (ETERNAL_TRIALS)
+ {
+ SetAndDownloadHighscoreTable("Eternal Trials Season 2");
+ }
+ else
+ {
+ SetAndDownloadHighscoreTable(LevelInteractor.lastActiveLevelInfo.sceneName);
+ }
+ }
+
+ private void SubscribeToSteamManger()
+ {
+ if (!subscribedToSteamManager)
+ {
+ SteamManager.Instance.OnLeaderboardDownloadCallbackComplete.AddListener(RefreshUI);
+ subscribedToSteamManager = true;
+ }
+ }
+
+ private void RefreshUI()
+ {
+ for (int i = 0; i < scoreTags.Length; i++)
+ {
+ scoreTags[i].gameObject.SetActive(value: false);
+ }
+ List<SteamManager.LeaderboardEntry> lastDownloadedLeaderboardEntires = SteamManager.Instance.lastDownloadedLeaderboardEntires;
+ if (lastDownloadedLeaderboardEntires.Count > 0)
+ {
+ loading.SetActive(value: false);
+ notConnectedToSteam.SetActive(value: false);
+ bool flag = false;
+ foreach (SteamManager.LeaderboardEntry item in lastDownloadedLeaderboardEntires)
+ {
+ if (item.username == SteamFriends.GetPersonaName())
+ {
+ flag = true;
+ break;
+ }
+ }
+ noScore.SetActive(!flag);
+ noFriends.SetActive(lastDownloadedLeaderboardEntires.Count == 1 && flag);
+ }
+ else
+ {
+ loading.SetActive(value: false);
+ notConnectedToSteam.SetActive(value: false);
+ noScore.SetActive(value: true);
+ noFriends.SetActive(value: true);
+ }
+ for (int j = 0; j < lastDownloadedLeaderboardEntires.Count && j <= scoreTags.Length - 1; j++)
+ {
+ bool isPlayer = lastDownloadedLeaderboardEntires[j].username == SteamFriends.GetPersonaName();
+ scoreTags[j].gameObject.SetActive(value: true);
+ scoreTags[j].SetNameAndScore(lastDownloadedLeaderboardEntires[j].username, lastDownloadedLeaderboardEntires[j].score, j + 1, isPlayer);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/HotOilTower.cs b/Thronefall_v1.57/Thronefall/Thronefall/HotOilTower.cs
new file mode 100644
index 0000000..b6a2f4b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/HotOilTower.cs
@@ -0,0 +1,106 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class HotOilTower : MonoBehaviour
+{
+ public ParticleSystem hotOilGround;
+
+ public float hotOilGroundBurnTickDuration = 0.2f;
+
+ public int hotOilGroundBurnTicks = 5;
+
+ public float attackCooldown = 5f;
+
+ public float checkRate = 1f;
+
+ public float range = 3.5f;
+
+ public List<DamageModifyer> damageModifyers = new List<DamageModifyer>();
+
+ public List<TagManager.ETag> mustHaveTags;
+
+ public List<TagManager.ETag> mayNotHaveTags;
+
+ public float DamageMultiplyer = 1f;
+
+ private float cooldown;
+
+ private TagManager tagManager;
+
+ private List<TaggedObject> foundTaggedObjects = new List<TaggedObject>();
+
+ private float timeTillTickEnds;
+
+ private int ticksRemaining;
+
+ private BlacksmithUpgrades blacksmithUpgrages;
+
+ private void Start()
+ {
+ cooldown = Random.value;
+ tagManager = TagManager.instance;
+ }
+
+ public void ReduceCooldownBy(float _reduceBy)
+ {
+ cooldown -= _reduceBy;
+ }
+
+ private void Update()
+ {
+ cooldown -= Time.deltaTime;
+ if (timeTillTickEnds > 0f)
+ {
+ timeTillTickEnds -= Time.deltaTime;
+ if (timeTillTickEnds <= 0f)
+ {
+ ticksRemaining--;
+ if (ticksRemaining < 0)
+ {
+ ParticleSystem.EmissionModule emission = hotOilGround.emission;
+ emission.enabled = false;
+ }
+ else
+ {
+ DamageTick();
+ timeTillTickEnds = hotOilGroundBurnTickDuration;
+ }
+ }
+ }
+ if (cooldown <= 0f)
+ {
+ if (DamageTick())
+ {
+ cooldown = attackCooldown;
+ timeTillTickEnds = hotOilGroundBurnTickDuration;
+ ticksRemaining = hotOilGroundBurnTicks - 1;
+ ParticleSystem.EmissionModule emission2 = hotOilGround.emission;
+ emission2.enabled = true;
+ }
+ else
+ {
+ cooldown = checkRate;
+ }
+ }
+ }
+
+ private bool DamageTick()
+ {
+ bool result = false;
+ tagManager.FindAllTaggedObjectsWithTags(foundTaggedObjects, mustHaveTags, mayNotHaveTags);
+ for (int i = 0; i < foundTaggedObjects.Count; i++)
+ {
+ if (!(tagManager.MeasureDistanceToTaggedObject(foundTaggedObjects[i], base.transform.position) > range))
+ {
+ result = true;
+ if (!blacksmithUpgrages)
+ {
+ blacksmithUpgrages = BlacksmithUpgrades.instance;
+ }
+ float meleeDamage = blacksmithUpgrages.meleeDamage;
+ foundTaggedObjects[i].Hp.TakeDamage(DamageModifyer.CalculateDamageOnTarget(foundTaggedObjects[i], damageModifyers, DamageMultiplyer * meleeDamage) / (float)hotOilGroundBurnTicks);
+ }
+ }
+ return result;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Hp.cs b/Thronefall_v1.57/Thronefall/Thronefall/Hp.cs
new file mode 100644
index 0000000..a29e277
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Hp.cs
@@ -0,0 +1,463 @@
+using System.Collections.Generic;
+using Pathfinding;
+using Pathfinding.RVO;
+using UnityEngine;
+using UnityEngine.Events;
+
+[RequireComponent(typeof(TaggedObject))]
+public class Hp : MonoBehaviour, ISaveLoad
+{
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public float maxHp;
+
+ public bool getsKnockedOutInsteadOfDying;
+
+ private float hp;
+
+ private bool gotLoadedHpValue;
+
+ private TaggedObject taggedObject;
+
+ [Tooltip("The hight where enemies aim at and where hit indicators are spawned")]
+ public float hitFeedbackHeight;
+
+ [Tooltip("This child object is enabled when this unit is alive.")]
+ public GameObject aliveVisuals;
+
+ [Tooltip("This child object is enabled when this unit is knocked out.")]
+ public GameObject knockedOutVisuals;
+
+ public GameObject fxToSpawnOnDeath;
+
+ public Vector3 deathFxSpawnOffset;
+
+ public Transform deathFxSpawnWithPosAndRotOf;
+
+ [HideInInspector]
+ public UnityEvent OnHpChange = new UnityEvent();
+
+ [HideInInspector]
+ public UnityEvent OnRevive = new UnityEvent();
+
+ [HideInInspector]
+ public UnityEvent OnHeal = new UnityEvent();
+
+ [HideInInspector]
+ public UnityEvent<bool> OnReceiveDamage = new UnityEvent<bool>();
+
+ [HideInInspector]
+ public UnityEvent OnKillOrKnockout = new UnityEvent();
+
+ private AutoAttack[] autoAttacks;
+
+ private ManualAttack[] manualAttacks;
+
+ private PathfindMovement pathfindMovement;
+
+ private RVOController rvoController;
+
+ private PlayerMovement playerMovement;
+
+ private NavmeshCut[] navmeshCut;
+
+ private PlayerInteraction playerInteraction;
+
+ public GameObject coin;
+
+ public float coinSpawnOffset;
+
+ public int coinCount;
+
+ [SerializeField]
+ private Weapon spwanAttackOnDeath;
+
+ private float damageMultiplyer = 1f;
+
+ private float healingMultiplyer = 1f;
+
+ public bool invulnerable;
+
+ private float hpOritinal;
+
+ private bool initilaized;
+
+ public float HpValue => hp;
+
+ public float HpPercentage => hp / maxHp;
+
+ public bool KnockedOut => hp <= 0f;
+
+ public TaggedObject TaggedObj => taggedObject;
+
+ public PathfindMovement PathfindMovement => pathfindMovement;
+
+ public Weapon SpwanAttackOnDeath
+ {
+ get
+ {
+ return spwanAttackOnDeath;
+ }
+ set
+ {
+ spwanAttackOnDeath = value;
+ }
+ }
+
+ public float DamageMultiplyer
+ {
+ get
+ {
+ return damageMultiplyer;
+ }
+ set
+ {
+ damageMultiplyer = value;
+ }
+ }
+
+ public bool Alive => hp >= 0f;
+
+ public float HpOriginal
+ {
+ get
+ {
+ return hpOritinal;
+ }
+ set
+ {
+ hpOritinal = value;
+ }
+ }
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ int value = 0;
+ gotLoadedHpValue = MatchSaveLoadHandler.TryLoadValue(guid, base.gameObject.name + "_hp", ref value);
+ hp = value;
+ }
+
+ public void OnSave(string guid)
+ {
+ MatchSaveLoadHandler.SaveValue(guid, base.gameObject.name + "_hp", Mathf.RoundToInt(hp));
+ }
+
+ public void ScaleHp(float _multiply)
+ {
+ hp *= _multiply;
+ maxHp *= _multiply;
+ }
+
+ public void SetHpToMaxHp()
+ {
+ hp = maxHp;
+ }
+
+ private void Initialize()
+ {
+ if (!initilaized)
+ {
+ initilaized = true;
+ playerInteraction = GetComponent<PlayerInteraction>();
+ taggedObject = GetComponent<TaggedObject>();
+ autoAttacks = GetComponents<AutoAttack>();
+ manualAttacks = GetComponents<ManualAttack>();
+ pathfindMovement = GetComponent<PathfindMovement>();
+ rvoController = GetComponent<RVOController>();
+ playerMovement = GetComponent<PlayerMovement>();
+ navmeshCut = GetComponentsInChildren<NavmeshCut>();
+ if (!gotLoadedHpValue)
+ {
+ taggedObject.AddTag(TagManager.ETag.AUTO_Alive);
+ }
+ }
+ }
+
+ private void Start()
+ {
+ Initialize();
+ if (!gotLoadedHpValue)
+ {
+ Revive(callReviveEvent: false);
+ }
+ ActivateAndDeactivateChildrenAndCompements(hp > 0f);
+ if (PerkManager.instance.HealingSpiritsActive && (bool)taggedObject && taggedObject.Tags.Contains(TagManager.ETag.PlayerOwned))
+ {
+ healingMultiplyer *= PerkManager.instance.healingSpirits_healMulti;
+ }
+ }
+
+ private void ActivateAndDeactivateChildrenAndCompements(bool _alive)
+ {
+ Initialize();
+ if ((bool)aliveVisuals)
+ {
+ aliveVisuals.SetActive(_alive);
+ }
+ if ((bool)knockedOutVisuals)
+ {
+ knockedOutVisuals.SetActive(!_alive);
+ }
+ if (autoAttacks.Length != 0)
+ {
+ AutoAttack[] array = autoAttacks;
+ for (int i = 0; i < array.Length; i++)
+ {
+ array[i].enabled = _alive;
+ }
+ }
+ if (manualAttacks.Length != 0)
+ {
+ ManualAttack[] array2 = manualAttacks;
+ for (int i = 0; i < array2.Length; i++)
+ {
+ array2[i].enabled = _alive;
+ }
+ }
+ if ((bool)pathfindMovement)
+ {
+ pathfindMovement.enabled = _alive;
+ if (!_alive)
+ {
+ pathfindMovement.ClearCurrentPath();
+ }
+ }
+ if ((bool)rvoController)
+ {
+ rvoController.enabled = _alive;
+ }
+ if ((bool)playerMovement)
+ {
+ playerMovement.Dead = !_alive;
+ }
+ NavmeshCut[] array3 = navmeshCut;
+ for (int i = 0; i < array3.Length; i++)
+ {
+ array3[i].enabled = _alive;
+ }
+ if ((bool)playerInteraction)
+ {
+ playerInteraction.enabled = _alive;
+ }
+ }
+
+ public void Revive(bool callReviveEvent = true, float healthPercentage = 1f)
+ {
+ Initialize();
+ if (hp <= 0f)
+ {
+ if (callReviveEvent)
+ {
+ OnRevive.Invoke();
+ }
+ taggedObject.RemoveTag(TagManager.ETag.AUTO_KnockedOutAndHealOnDawn);
+ taggedObject.AddTag(TagManager.ETag.AUTO_Alive);
+ ActivateAndDeactivateChildrenAndCompements(_alive: true);
+ hp = 0f;
+ }
+ else if (hp < maxHp)
+ {
+ OnHeal.Invoke();
+ }
+ hp += maxHp * healthPercentage;
+ if (hp > maxHp)
+ {
+ hp = maxHp;
+ }
+ OnHpChange.Invoke();
+ }
+
+ public void MakeInvulerable(bool _infulerable)
+ {
+ invulnerable = _infulerable;
+ }
+
+ public bool TakeDamage(float _amount, TaggedObject _damageComingFrom = null, bool causedByPlayer = false, bool invokeFeedbackEvents = true)
+ {
+ if (hp <= 0f)
+ {
+ return false;
+ }
+ if (invulnerable)
+ {
+ return false;
+ }
+ if (_amount <= 0f)
+ {
+ Heal(0f - _amount);
+ return false;
+ }
+ if ((bool)pathfindMovement)
+ {
+ pathfindMovement.GetAgroFromObject(_damageComingFrom);
+ }
+ hp -= _amount;
+ if (invokeFeedbackEvents)
+ {
+ OnReceiveDamage.Invoke(causedByPlayer);
+ }
+ OnHpChange.Invoke();
+ if (hp <= 0f)
+ {
+ OnKillOrKnockout.Invoke();
+ if ((bool)fxToSpawnOnDeath)
+ {
+ if ((bool)deathFxSpawnWithPosAndRotOf)
+ {
+ Object.Instantiate(fxToSpawnOnDeath, deathFxSpawnWithPosAndRotOf.position + deathFxSpawnOffset, deathFxSpawnWithPosAndRotOf.rotation, null);
+ }
+ else
+ {
+ Object.Instantiate(fxToSpawnOnDeath, base.transform.position + deathFxSpawnOffset, fxToSpawnOnDeath.transform.rotation, null);
+ }
+ }
+ if (getsKnockedOutInsteadOfDying)
+ {
+ taggedObject.RemoveTag(TagManager.ETag.AUTO_Alive);
+ taggedObject.AddTag(TagManager.ETag.AUTO_KnockedOutAndHealOnDawn);
+ ActivateAndDeactivateChildrenAndCompements(_alive: false);
+ }
+ else
+ {
+ Shrine.DeathOfUnitAt(base.transform.position, HpOriginal);
+ Object.Destroy(base.gameObject);
+ if ((bool)coin)
+ {
+ for (int i = 0; i < coinCount; i++)
+ {
+ if (i > 1)
+ {
+ Object.Instantiate(coin, base.transform.position + Vector3.up * coinSpawnOffset + Quaternion.Euler(0f, 45f * (float)i, 0f) * Vector3.forward * 2f, Quaternion.identity);
+ }
+ else
+ {
+ Object.Instantiate(coin, base.transform.position + Vector3.up * coinSpawnOffset, Quaternion.identity);
+ }
+ }
+ }
+ }
+ if ((bool)spwanAttackOnDeath)
+ {
+ spwanAttackOnDeath.Attack(base.transform.position, null, Vector3.zero, taggedObject, damageMultiplyer);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public void Heal(float _amount)
+ {
+ if (!(hp <= 0f) && !(_amount <= 0f))
+ {
+ hp += _amount * healingMultiplyer;
+ if (hp > maxHp)
+ {
+ hp = maxHp;
+ }
+ OnHpChange.Invoke();
+ }
+ }
+
+ public void SetHpTo(float _value)
+ {
+ hp = _value;
+ OnHpChange.Invoke();
+ }
+
+ public static void ReviveAllUnitsWithTag(List<TagManager.ETag> _mustHaveTags, List<TagManager.ETag> _mayNotHaveTags, float _healthPercentage = 1f)
+ {
+ List<TaggedObject> list = new List<TaggedObject>();
+ TagManager.instance.FindAllTaggedObjectsWithTags(list, _mustHaveTags, _mayNotHaveTags);
+ for (int i = 0; i < list.Count; i++)
+ {
+ list[i].Hp.Revive(callReviveEvent: true, _healthPercentage);
+ }
+ }
+
+ public static void SetAllUnitsWithTagInvulnerable(List<TagManager.ETag> _mustHaveTags, List<TagManager.ETag> _mayNotHaveTags, bool _invulnerable)
+ {
+ List<TaggedObject> list = new List<TaggedObject>();
+ TagManager.instance.FindAllTaggedObjectsWithTags(list, _mustHaveTags, _mayNotHaveTags);
+ for (int i = 0; i < list.Count; i++)
+ {
+ list[i].Hp.MakeInvulerable(_invulnerable);
+ }
+ }
+
+ public static void MarkDestroyedBuildingsAsDontRevive(List<TagManager.ETag> _mustHaveTags, List<TagManager.ETag> _mayNotHaveTags, float _healthPercentage = 1f)
+ {
+ List<TaggedObject> list = new List<TaggedObject>();
+ TagManager.instance.FindAllTaggedObjectsWithTags(list, _mustHaveTags, _mayNotHaveTags);
+ for (int i = 0; i < list.Count; i++)
+ {
+ if (list[i].Tags.Contains(TagManager.ETag.AUTO_KnockedOutAndHealOnDawn))
+ {
+ list[i].GetComponentInParent<BuildSlot>().Interactor.OnKnockOut();
+ if (!list[i].Tags.Contains(TagManager.ETag.AUTO_NoReviveNextMorning))
+ {
+ list[i].Tags.Add(TagManager.ETag.AUTO_NoReviveNextMorning);
+ }
+ else
+ {
+ list[i].Tags.Remove(TagManager.ETag.AUTO_NoReviveNextMorning);
+ }
+ }
+ }
+ }
+
+ public static void KillAllUnitsWithTag(List<TagManager.ETag> _mustHaveTags, List<TagManager.ETag> _mayNotHaveTags)
+ {
+ List<TaggedObject> list = new List<TaggedObject>();
+ TagManager.instance.FindAllTaggedObjectsWithTags(list, _mustHaveTags, _mayNotHaveTags);
+ for (int i = 0; i < list.Count; i++)
+ {
+ list[i].Hp.TakeDamage(float.MaxValue);
+ }
+ }
+
+ public static void ReviveAllKnockedOutPlayerUnitsAndBuildings()
+ {
+ if (!PerkManager.instance.DestructionGodActive)
+ {
+ List<TagManager.ETag> list = new List<TagManager.ETag>();
+ List<TagManager.ETag> list2 = new List<TagManager.ETag>();
+ list.Add(TagManager.ETag.PlayerOwned);
+ list2.Add(TagManager.ETag.AUTO_NoReviveNextMorning);
+ ReviveAllUnitsWithTag(list, list2);
+ SetAllUnitsWithTagInvulnerable(list, list2, _invulnerable: true);
+ return;
+ }
+ List<TagManager.ETag> list3 = new List<TagManager.ETag>();
+ List<TagManager.ETag> mayNotHaveTags = new List<TagManager.ETag>();
+ list3.Add(TagManager.ETag.PlayerOwned);
+ list3.Add(TagManager.ETag.Building);
+ MarkDestroyedBuildingsAsDontRevive(list3, mayNotHaveTags);
+ List<TagManager.ETag> list4 = new List<TagManager.ETag>();
+ mayNotHaveTags = new List<TagManager.ETag>();
+ list4.Add(TagManager.ETag.PlayerOwned);
+ mayNotHaveTags.Add(TagManager.ETag.Building);
+ mayNotHaveTags.Add(TagManager.ETag.AUTO_NoReviveNextMorning);
+ ReviveAllUnitsWithTag(list4, mayNotHaveTags);
+ SetAllUnitsWithTagInvulnerable(list4, mayNotHaveTags, _invulnerable: true);
+ mayNotHaveTags.Clear();
+ mayNotHaveTags.Add(TagManager.ETag.AUTO_NoReviveNextMorning);
+ list4.Add(TagManager.ETag.Building);
+ ReviveAllUnitsWithTag(list4, mayNotHaveTags, PerkManager.instance.destructionGodHealthRegen);
+ SetAllUnitsWithTagInvulnerable(list4, mayNotHaveTags, _invulnerable: true);
+ }
+
+ public static void KillAllEnemyUnits()
+ {
+ List<TagManager.ETag> list = new List<TagManager.ETag>();
+ List<TagManager.ETag> mayNotHaveTags = new List<TagManager.ETag>();
+ list.Add(TagManager.ETag.EnemyOwned);
+ KillAllUnitsWithTag(list, mayNotHaveTags);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ISaveLoad.cs b/Thronefall_v1.57/Thronefall/Thronefall/ISaveLoad.cs
new file mode 100644
index 0000000..1955d6d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ISaveLoad.cs
@@ -0,0 +1,10 @@
+public interface ISaveLoad
+{
+ void OnBeforeMainLoadPass(string guid);
+
+ void OnLoad(string guid);
+
+ void OnAfterMainLoadPass(string guid);
+
+ void OnSave(string guid);
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/IUIAnimationSequence.cs b/Thronefall_v1.57/Thronefall/Thronefall/IUIAnimationSequence.cs
new file mode 100644
index 0000000..725849c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/IUIAnimationSequence.cs
@@ -0,0 +1,9 @@
+using System.Collections;
+using UnityEngine;
+
+public abstract class IUIAnimationSequence : MonoBehaviour
+{
+ public abstract void Reset();
+
+ public abstract IEnumerator PlayAnimation(UIFrame contextFrame);
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/InGamePopUp.cs b/Thronefall_v1.57/Thronefall/Thronefall/InGamePopUp.cs
new file mode 100644
index 0000000..7b73065
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/InGamePopUp.cs
@@ -0,0 +1,9 @@
+using System;
+
+[Serializable]
+public class InGamePopUp
+{
+ public UIFrame uiFrame;
+
+ public string identifier;
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/InGamePopUpHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/InGamePopUpHelper.cs
new file mode 100644
index 0000000..aa4c125
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/InGamePopUpHelper.cs
@@ -0,0 +1,56 @@
+using UnityEngine;
+
+public class InGamePopUpHelper : MonoBehaviour
+{
+ public static InGamePopUpHelper instance;
+
+ public const string SHOW_ONCE_IDENTIFIER_PREFIX = "PopupShown_";
+
+ public InGamePopUp eternalTrialsFirstTime;
+
+ public InGamePopUp eternalTrialsV2Patch;
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ public bool PopEternalTrials()
+ {
+ bool flag = false;
+ bool flag2 = false;
+ if (EternalTrialsRunManager.HasOngoingRun || LevelProgressManager.instance.EternalTrialsHighscore != 0)
+ {
+ flag = true;
+ PlayerPrefs.SetInt("PopupShown_" + eternalTrialsFirstTime.identifier, 1);
+ }
+ if (PlayerPrefs.GetInt("PopupShown_" + eternalTrialsFirstTime.identifier) != 0)
+ {
+ flag = true;
+ }
+ else
+ {
+ PlayerPrefs.SetInt("PopupShown_" + eternalTrialsFirstTime.identifier, 1);
+ PlayerPrefs.SetInt("PopupShown_" + eternalTrialsV2Patch.identifier, 1);
+ }
+ if (PlayerPrefs.GetInt("PopupShown_" + eternalTrialsV2Patch.identifier) != 0)
+ {
+ flag2 = true;
+ }
+ else
+ {
+ PlayerPrefs.SetInt("PopupShown_" + eternalTrialsV2Patch.identifier, 1);
+ }
+ if (!flag)
+ {
+ UIFrameManager.instance.ChangeActiveFrameKeepOldVisible(eternalTrialsFirstTime.uiFrame);
+ return true;
+ }
+ if (!flag2)
+ {
+ UIFrameManager.instance.ChangeActiveFrameKeepOldVisible(eternalTrialsV2Patch.uiFrame);
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/InGameResignUIHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/InGameResignUIHelper.cs
new file mode 100644
index 0000000..05be631
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/InGameResignUIHelper.cs
@@ -0,0 +1,18 @@
+using UnityEngine;
+
+public class InGameResignUIHelper : MonoBehaviour
+{
+ public void Resign()
+ {
+ try
+ {
+ Debug.Log("Resign");
+ UIFrameManager.instance.CloseAllFrames();
+ LocalGamestate.Instance.SetState(LocalGamestate.State.AfterMatchDefeat, forceTransition: false, immediate: true);
+ }
+ catch
+ {
+ Debug.Log("Error in InGameResignUIHelper: Bro we can not resign here.");
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/InMatchResignHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/InMatchResignHelper.cs
new file mode 100644
index 0000000..46f158e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/InMatchResignHelper.cs
@@ -0,0 +1,45 @@
+using UnityEngine;
+
+public class InMatchResignHelper : MonoBehaviour
+{
+ public UIFrame classicRetryPopUp;
+
+ public UIFrame etResignPopUp;
+
+ public UIFrame etBackToMapPopUp;
+
+ public void TryResign()
+ {
+ if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.EternalTrial)
+ {
+ UIFrameManager.instance.ChangeActiveFrame(etResignPopUp);
+ }
+ else
+ {
+ UIFrameManager.instance.ChangeActiveFrame(classicRetryPopUp);
+ }
+ }
+
+ public void ApplyResign()
+ {
+ UIFrameManager.instance.CloseAllFrames();
+ LocalGamestate.Instance.SetState(LocalGamestate.State.AfterMatchDefeat);
+ }
+
+ public void TryBackToMap()
+ {
+ if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.EternalTrial && EternalTrialsRunManager.CurrentRun.inNight)
+ {
+ UIFrameManager.instance.ChangeActiveFrame(etBackToMapPopUp);
+ }
+ else
+ {
+ SceneTransitionManager.instance.TransitionFromLevelToLevelSelect();
+ }
+ }
+
+ public void AppliedBackToMap()
+ {
+ SceneTransitionManager.instance.TransitionFromLevelToLevelSelect();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/IncomeModifyer.cs b/Thronefall_v1.57/Thronefall/Thronefall/IncomeModifyer.cs
new file mode 100644
index 0000000..d8a523c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/IncomeModifyer.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+public class IncomeModifyer : MonoBehaviour
+{
+ public BuildSlot buildSlot;
+
+ public BuildingInteractor buildingInteractor;
+
+ private void Start()
+ {
+ buildingInteractor.IncomeModifiers.Add(this);
+ }
+
+ public virtual void OnDawn()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/IncreaseAttackSpeedOverTime.cs b/Thronefall_v1.57/Thronefall/Thronefall/IncreaseAttackSpeedOverTime.cs
new file mode 100644
index 0000000..6b9ee4c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/IncreaseAttackSpeedOverTime.cs
@@ -0,0 +1,56 @@
+using UnityEngine;
+
+public class IncreaseAttackSpeedOverTime : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ [SerializeField]
+ private AutoAttack autoAttack;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Percentage)]
+ private float maximumAdditionalCooldownSpeed = 4f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float increaseSpeed = 0.1f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float decreaseSpeed = 1f;
+
+ private float additionalCooldownSpeed;
+
+ private void Start()
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ }
+
+ private void Update()
+ {
+ if (autoAttack.onCooldown)
+ {
+ additionalCooldownSpeed = Mathf.Min(additionalCooldownSpeed + increaseSpeed * Time.deltaTime, maximumAdditionalCooldownSpeed);
+ autoAttack.ReduceCooldownBy(additionalCooldownSpeed * Time.deltaTime);
+ }
+ else
+ {
+ additionalCooldownSpeed = Mathf.Max(additionalCooldownSpeed - decreaseSpeed * Time.deltaTime, 0f);
+ }
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public void OnDusk()
+ {
+ additionalCooldownSpeed = 0f;
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/IncreaseIncomeDaily.cs b/Thronefall_v1.57/Thronefall/Thronefall/IncreaseIncomeDaily.cs
new file mode 100644
index 0000000..da193ce
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/IncreaseIncomeDaily.cs
@@ -0,0 +1,56 @@
+public class IncreaseIncomeDaily : IncomeModifyer, ISaveLoad
+{
+ private int incomeIncrease;
+
+ private BuildSlot myBuildSlot;
+
+ private bool initialized;
+
+ private void Initialize()
+ {
+ if (!initialized)
+ {
+ myBuildSlot = GetComponent<BuildSlot>();
+ myBuildSlot.Interactor.IncomeModifiers.Add(this);
+ initialized = true;
+ }
+ }
+
+ private void Start()
+ {
+ Initialize();
+ }
+
+ public override void OnDawn()
+ {
+ myBuildSlot.GoldIncome++;
+ incomeIncrease++;
+ }
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ Initialize();
+ incomeIncrease = 0;
+ MatchSaveLoadHandler.TryLoadValue(guid, "incomeIncrease", ref incomeIncrease);
+ myBuildSlot.OnAfterDelayedLoadFinished.AddListener(ExecuteDelayedLoad);
+ }
+
+ private void ExecuteDelayedLoad()
+ {
+ Initialize();
+ myBuildSlot.GoldIncome += incomeIncrease;
+ }
+
+ public void OnSave(string guid)
+ {
+ MatchSaveLoadHandler.SaveValue(guid, "incomeIncrease", incomeIncrease);
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/InteractorBase.cs b/Thronefall_v1.57/Thronefall/Thronefall/InteractorBase.cs
new file mode 100644
index 0000000..3c503c3
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/InteractorBase.cs
@@ -0,0 +1,27 @@
+using UnityEngine;
+
+public abstract class InteractorBase : MonoBehaviour
+{
+ public virtual bool CanBeInteractedWith => true;
+
+ public virtual string ReturnTooltip()
+ {
+ return "";
+ }
+
+ public virtual void InteractionBegin(PlayerInteraction player)
+ {
+ }
+
+ public virtual void InteractionHold(PlayerInteraction player)
+ {
+ }
+
+ public virtual void InteractionEnd(PlayerInteraction player)
+ {
+ }
+
+ public abstract void Focus(PlayerInteraction player);
+
+ public abstract void Unfocus(PlayerInteraction player);
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Invulnerable.cs b/Thronefall_v1.57/Thronefall/Thronefall/Invulnerable.cs
new file mode 100644
index 0000000..9a7857c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Invulnerable.cs
@@ -0,0 +1,16 @@
+using UnityEngine;
+
+public class Invulnerable : MonoBehaviour
+{
+ private Hp hp;
+
+ private void Start()
+ {
+ hp = GetComponent<Hp>();
+ }
+
+ private void Update()
+ {
+ hp.Heal(1000000f);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/KeepRelativeRotationTo.cs b/Thronefall_v1.57/Thronefall/Thronefall/KeepRelativeRotationTo.cs
new file mode 100644
index 0000000..94dbe16
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/KeepRelativeRotationTo.cs
@@ -0,0 +1,59 @@
+using UnityEngine;
+
+public class KeepRelativeRotationTo : MonoBehaviour
+{
+ [SerializeField]
+ private Transform transformToKeepRelativeRotationTo;
+
+ [SerializeField]
+ private Vector3 upVector = Vector3.up;
+
+ private Quaternion initialOffset;
+
+ private Vector3 selfPosition;
+
+ private Vector3 otherPosition;
+
+ private Quaternion localRotationStart;
+
+ private Vector3 upVectorAdjusted;
+
+ private void PrepareData()
+ {
+ if ((bool)base.transform.parent)
+ {
+ selfPosition = base.transform.localPosition;
+ otherPosition = base.transform.parent.worldToLocalMatrix.MultiplyPoint(transformToKeepRelativeRotationTo.position);
+ upVectorAdjusted = upVector;
+ }
+ else
+ {
+ selfPosition = base.transform.position;
+ otherPosition = transformToKeepRelativeRotationTo.position;
+ upVectorAdjusted = upVector;
+ }
+ }
+
+ private void Start()
+ {
+ if ((bool)base.transform.parent)
+ {
+ upVector = base.transform.localToWorldMatrix.MultiplyVector(upVector);
+ upVector = base.transform.parent.localToWorldMatrix.MultiplyVector(upVector);
+ upVector = upVector.normalized;
+ }
+ localRotationStart = base.transform.localRotation;
+ PrepareData();
+ initialOffset = Quaternion.Inverse(Quaternion.LookRotation(otherPosition - selfPosition, upVectorAdjusted));
+ }
+
+ private void Update()
+ {
+ if ((bool)transformToKeepRelativeRotationTo)
+ {
+ PrepareData();
+ Quaternion quaternion = Quaternion.LookRotation(otherPosition - selfPosition, upVectorAdjusted);
+ base.transform.localRotation = quaternion * initialOffset * localRotationStart;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/KeyRebinder.cs b/Thronefall_v1.57/Thronefall/Thronefall/KeyRebinder.cs
new file mode 100644
index 0000000..532d559
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/KeyRebinder.cs
@@ -0,0 +1,444 @@
+using System.Collections;
+using System.Collections.Generic;
+using I2.Loc;
+using Rewired;
+using TMPro;
+using UnityEngine;
+
+public class KeyRebinder : MonoBehaviour
+{
+ public List<string> actionCategoriesToShow = new List<string>();
+
+ public GameObject listeningToRemapPopUp;
+
+ public ThronefallUIElement tabButton;
+
+ public GameObject controlDevicesIconsPrefab;
+
+ public ThronefallUIElement restoreControlsButtonPrefab;
+
+ public ThronefallUIElement controllerPickerButtonPrefab;
+
+ public ControlMapButton buttonPrefab;
+
+ public Transform buttonParent;
+
+ public TextMeshProUGUI remapListenTimerText;
+
+ public List<ControlMapButton> buttons = new List<ControlMapButton>();
+
+ private InputMapper keyboardMapper;
+
+ private InputMapper mouseMapper;
+
+ private InputMapper joystickMapper;
+
+ private Joystick selectedJoystick;
+
+ private ControllerMap keyboardMap;
+
+ private ControllerMap mouseMap;
+
+ private ControllerMap joystickMap;
+
+ private bool listening;
+
+ private bool mapCallbackRecieved;
+
+ private const string uiCategory = "UI";
+
+ private const string gameplayAlwaysCategory = "Gameplay Always";
+
+ private readonly string[] gameplayNotOverlappingCategories = new string[2] { "Gameplay Day", "Gameplay Night" };
+
+ private EnumSelector controllerSelector;
+
+ private Dictionary<string, int> registeredJoysticks = new Dictionary<string, int>();
+
+ private Player player => ReInput.players.GetPlayer(0);
+
+ public Joystick SelectedJoystick => selectedJoystick;
+
+ public ControllerMap KeyboardMap => keyboardMap;
+
+ public ControllerMap MouseMap => mouseMap;
+
+ public ControllerMap JoystickMap => joystickMap;
+
+ private int UICategoryId => ReInput.mapping.GetActionCategoryId("UI");
+
+ private int GameplayAlwaysCategoryId => ReInput.mapping.GetActionCategoryId("Gameplay Always");
+
+ private List<int> GameplayNotOverlappingCategoriesIds
+ {
+ get
+ {
+ List<int> list = new List<int>();
+ string[] array = gameplayNotOverlappingCategories;
+ foreach (string text in array)
+ {
+ list.Add(ReInput.mapping.GetActionCategoryId(text));
+ }
+ return list;
+ }
+ }
+
+ private void OnEnable()
+ {
+ keyboardMapper = new InputMapper();
+ keyboardMapper.options.allowKeyboardModifierKeyAsPrimary = true;
+ keyboardMapper.options.allowKeyboardKeysWithModifiers = false;
+ keyboardMapper.options.ignoreMouseXAxis = true;
+ keyboardMapper.options.ignoreMouseYAxis = true;
+ keyboardMapper.options.timeout = 3f;
+ keyboardMapper.options.checkForConflicts = true;
+ keyboardMapper.ConflictFoundEvent += OnBindConflict;
+ mouseMapper = new InputMapper();
+ mouseMapper.options.ignoreMouseXAxis = true;
+ mouseMapper.options.ignoreMouseYAxis = true;
+ mouseMapper.options.timeout = 3f;
+ mouseMapper.options.checkForConflicts = true;
+ mouseMapper.ConflictFoundEvent += OnBindConflict;
+ joystickMapper = new InputMapper();
+ joystickMapper.options.ignoreMouseXAxis = true;
+ joystickMapper.options.ignoreMouseYAxis = true;
+ joystickMapper.options.timeout = 3f;
+ joystickMapper.options.checkForConflicts = true;
+ joystickMapper.ConflictFoundEvent += OnBindConflict;
+ ReInput.ControllerConnectedEvent += OnControllerConnectionChange;
+ ReInput.ControllerDisconnectedEvent += OnControllerConnectionChange;
+ keyboardMapper.InputMappedEvent += OnInputMapped;
+ mouseMapper.InputMappedEvent += OnInputMapped;
+ joystickMapper.InputMappedEvent += OnInputMapped;
+ listeningToRemapPopUp.SetActive(value: false);
+ RegenerateButtons();
+ }
+
+ private void OnDisable()
+ {
+ ReInput.ControllerConnectedEvent -= OnControllerConnectionChange;
+ ReInput.ControllerDisconnectedEvent -= OnControllerConnectionChange;
+ }
+
+ public void RegenerateButtons()
+ {
+ int num = 0;
+ buttons.Clear();
+ List<GameObject> list = new List<GameObject>();
+ foreach (Transform item in buttonParent)
+ {
+ list.Add(item.gameObject);
+ }
+ for (int num2 = list.Count - 1; num2 >= 0; num2--)
+ {
+ Object.Destroy(list[num2]);
+ }
+ ThronefallUIElement thronefallUIElement = Object.Instantiate(controllerPickerButtonPrefab, buttonParent);
+ thronefallUIElement.gameObject.AddComponent<ScrollElementID>().id = num;
+ num++;
+ controllerSelector = thronefallUIElement.GetComponentInChildren<EnumSelector>();
+ controllerSelector.onChange.AddListener(OnControllerSelectionChange);
+ RefreshControllerPickOptions();
+ RefreshAllMaps();
+ ThronefallUIElement thronefallUIElement2 = Object.Instantiate(restoreControlsButtonPrefab, buttonParent);
+ thronefallUIElement2.gameObject.AddComponent<ScrollElementID>().id = num;
+ num++;
+ Object.Instantiate(controlDevicesIconsPrefab, buttonParent).gameObject.AddComponent<ScrollElementID>().id = num;
+ num++;
+ foreach (string item2 in actionCategoriesToShow)
+ {
+ ControlMapButton controlMapButton = null;
+ foreach (InputAction item3 in ReInput.mapping.ActionsInCategory(item2))
+ {
+ if (item3.userAssignable)
+ {
+ if (item3.type == InputActionType.Axis)
+ {
+ controlMapButton = Object.Instantiate(buttonPrefab, buttonParent);
+ controlMapButton.SetData(item3, this, ControlMapButton.AxisMode.Positive);
+ controlMapButton.gameObject.AddComponent<ScrollElementID>().id = num;
+ num++;
+ buttons.Add(controlMapButton);
+ controlMapButton = Object.Instantiate(buttonPrefab, buttonParent);
+ controlMapButton.SetData(item3, this, ControlMapButton.AxisMode.Negative);
+ controlMapButton.gameObject.AddComponent<ScrollElementID>().id = num;
+ num++;
+ buttons.Add(controlMapButton);
+ }
+ else
+ {
+ controlMapButton = Object.Instantiate(buttonPrefab, buttonParent);
+ controlMapButton.SetData(item3, this, ControlMapButton.AxisMode.Button);
+ controlMapButton.gameObject.AddComponent<ScrollElementID>().id = num;
+ num++;
+ buttons.Add(controlMapButton);
+ }
+ }
+ }
+ }
+ thronefallUIElement.topNav = tabButton;
+ thronefallUIElement.botNav = thronefallUIElement2;
+ thronefallUIElement2.topNav = thronefallUIElement;
+ for (int i = 0; i < buttons.Count; i++)
+ {
+ if (i == 0)
+ {
+ buttons[i].target.topNav = thronefallUIElement2;
+ }
+ else
+ {
+ buttons[i].target.topNav = buttons[i - 1].target;
+ }
+ if (i == buttons.Count - 1)
+ {
+ buttons[i].target.botNav = tabButton;
+ }
+ else
+ {
+ buttons[i].target.botNav = buttons[i + 1].target;
+ }
+ }
+ tabButton.botNav = thronefallUIElement;
+ tabButton.topNav = buttons[buttons.Count - 1].target;
+ thronefallUIElement2.botNav = buttons[0].target;
+ GetComponentInParent<UIFrame>().RefetchManagedElements();
+ }
+
+ public void UpdateButtonLabels()
+ {
+ foreach (ControlMapButton button in buttons)
+ {
+ button.Refresh();
+ }
+ }
+
+ public void OnControllerConnectionChange(ControllerStatusChangedEventArgs args)
+ {
+ RefreshControllerPickOptions();
+ RefreshSelectedJoystickAndLoadMap();
+ UpdateButtonLabels();
+ }
+
+ private void RefreshAllMaps()
+ {
+ foreach (ControllerMap allMap in player.controllers.maps.GetAllMaps())
+ {
+ if (allMap.controller.type == ControllerType.Keyboard && allMap.categoryId == 0)
+ {
+ keyboardMap = allMap;
+ }
+ }
+ foreach (ControllerMap allMap2 in player.controllers.maps.GetAllMaps())
+ {
+ if (allMap2.controller.type == ControllerType.Mouse && allMap2.categoryId == 0)
+ {
+ mouseMap = allMap2;
+ }
+ }
+ RefreshSelectedJoystickAndLoadMap();
+ }
+
+ private void RefreshSelectedJoystickAndLoadMap()
+ {
+ selectedJoystick = null;
+ if (controllerSelector != null && registeredJoysticks.TryGetValue(controllerSelector.options[controllerSelector.Index], out var value))
+ {
+ selectedJoystick = player.controllers.GetController<Joystick>(value);
+ if (selectedJoystick != null)
+ {
+ joystickMap = player.controllers.maps.GetMap(selectedJoystick, 0, 0);
+ }
+ else
+ {
+ joystickMap = null;
+ }
+ }
+ }
+
+ private void RefreshControllerPickOptions()
+ {
+ if (controllerSelector == null)
+ {
+ return;
+ }
+ controllerSelector.options.Clear();
+ registeredJoysticks.Clear();
+ if (player.controllers.joystickCount > 0)
+ {
+ foreach (Joystick joystick in player.controllers.Joysticks)
+ {
+ controllerSelector.options.Add(joystick.name);
+ registeredJoysticks.Add(joystick.name, joystick.id);
+ }
+ }
+ else
+ {
+ controllerSelector.options.Add(LocalizationManager.GetTermTranslation("Controls/No Controller"));
+ }
+ controllerSelector.UpdateDisplay();
+ }
+
+ private void OnControllerSelectionChange()
+ {
+ RefreshSelectedJoystickAndLoadMap();
+ UpdateButtonLabels();
+ }
+
+ public void TriggerRebind(InputAction actionToMap, ActionElementMap keyboardMapToReplace, ActionElementMap mouseMapToReplace, ActionElementMap joystickMapToReplace, ControlMapButton.AxisMode axisMode)
+ {
+ if (!listening)
+ {
+ listening = true;
+ player.controllers.maps.SetAllMapsEnabled(state: false);
+ listeningToRemapPopUp.SetActive(value: true);
+ StartCoroutine(ListenForRebind(actionToMap, keyboardMapToReplace, mouseMapToReplace, joystickMapToReplace, axisMode));
+ }
+ }
+
+ private IEnumerator ListenForRebind(InputAction actionToMap, ActionElementMap keyboardMapToReplace, ActionElementMap mouseMapToReplace, ActionElementMap joystickMapToReplace, ControlMapButton.AxisMode axisMode)
+ {
+ yield return new WaitForSecondsRealtime(0.1f);
+ mapCallbackRecieved = false;
+ Dictionary<AxisCalibration, float> modifiedAxes = new Dictionary<AxisCalibration, float>();
+ if (selectedJoystick != null)
+ {
+ foreach (AxisCalibration axis in selectedJoystick.calibrationMap.Axes)
+ {
+ modifiedAxes.Add(axis, axis.deadZone);
+ axis.deadZone = 0.75f;
+ }
+ }
+ AxisRange actionRange = AxisRange.Full;
+ switch (axisMode)
+ {
+ case ControlMapButton.AxisMode.Positive:
+ actionRange = AxisRange.Positive;
+ break;
+ case ControlMapButton.AxisMode.Negative:
+ actionRange = AxisRange.Negative;
+ break;
+ }
+ if (keyboardMap != null)
+ {
+ keyboardMapper.Start(new InputMapper.Context
+ {
+ actionId = actionToMap.id,
+ controllerMap = keyboardMap,
+ actionRange = actionRange,
+ actionElementMapToReplace = keyboardMapToReplace
+ });
+ }
+ if (mouseMap != null)
+ {
+ mouseMapper.Start(new InputMapper.Context
+ {
+ actionId = actionToMap.id,
+ controllerMap = mouseMap,
+ actionRange = actionRange,
+ actionElementMapToReplace = mouseMapToReplace
+ });
+ }
+ if (joystickMap != null)
+ {
+ joystickMapper.Start(new InputMapper.Context
+ {
+ actionId = actionToMap.id,
+ controllerMap = joystickMap,
+ actionRange = actionRange,
+ actionElementMapToReplace = joystickMapToReplace
+ });
+ }
+ while (keyboardMapper.timeRemaining > 0f || joystickMapper.timeRemaining > 0f || mouseMapper.timeRemaining > 0f)
+ {
+ remapListenTimerText.text = Mathf.RoundToInt(keyboardMapper.timeRemaining).ToString();
+ if (mapCallbackRecieved)
+ {
+ break;
+ }
+ yield return null;
+ }
+ keyboardMapper.Stop();
+ mouseMapper.Stop();
+ joystickMapper.Stop();
+ listeningToRemapPopUp.SetActive(value: false);
+ UpdateButtonLabels();
+ if (selectedJoystick != null)
+ {
+ foreach (AxisCalibration axis2 in selectedJoystick.calibrationMap.Axes)
+ {
+ if (modifiedAxes.TryGetValue(axis2, out var value))
+ {
+ axis2.deadZone = value;
+ }
+ }
+ }
+ yield return new WaitForSecondsRealtime(0.1f);
+ listening = false;
+ player.controllers.maps.SetAllMapsEnabled(state: true);
+ ControlConfigSaveLoad.SaveControlConfigToJson();
+ }
+
+ private void OnInputMapped(InputMapper.InputMappedEventData e)
+ {
+ mapCallbackRecieved = true;
+ }
+
+ private void OnBindConflict(InputMapper.ConflictFoundEventData e)
+ {
+ int gameplayAlwaysCategoryId = GameplayAlwaysCategoryId;
+ List<int> gameplayNotOverlappingCategoriesIds = GameplayNotOverlappingCategoriesIds;
+ int uICategoryId = UICategoryId;
+ int categoryId = e.assignment.action.categoryId;
+ List<int> list = new List<int>();
+ foreach (ElementAssignmentConflictInfo conflict in e.conflicts)
+ {
+ list.Add(conflict.action.categoryId);
+ }
+ List<ElementAssignmentConflictInfo> list2 = new List<ElementAssignmentConflictInfo>();
+ if (categoryId == gameplayAlwaysCategoryId)
+ {
+ foreach (ElementAssignmentConflictInfo conflict2 in e.conflicts)
+ {
+ if (conflict2.action.categoryId == categoryId || gameplayNotOverlappingCategoriesIds.Contains(conflict2.action.categoryId))
+ {
+ list2.Add(conflict2);
+ }
+ }
+ }
+ else if (gameplayNotOverlappingCategoriesIds.Contains(categoryId))
+ {
+ foreach (ElementAssignmentConflictInfo conflict3 in e.conflicts)
+ {
+ if (conflict3.action.categoryId == categoryId || conflict3.action.categoryId == gameplayAlwaysCategoryId)
+ {
+ list2.Add(conflict3);
+ }
+ }
+ }
+ if (categoryId == uICategoryId)
+ {
+ foreach (ElementAssignmentConflictInfo conflict4 in e.conflicts)
+ {
+ if (conflict4.action.categoryId == uICategoryId)
+ {
+ list2.Add(conflict4);
+ }
+ }
+ }
+ foreach (ElementAssignmentConflictInfo item in list2)
+ {
+ item.controllerMap.DeleteElementMap(item.elementMapId);
+ }
+ e.responseCallback(InputMapper.ConflictResponse.Add);
+ }
+
+ public void TriggerControlsReset()
+ {
+ player.controllers.maps.LoadDefaultMaps(ControllerType.Mouse);
+ player.controllers.maps.LoadDefaultMaps(ControllerType.Keyboard);
+ player.controllers.maps.LoadDefaultMaps(ControllerType.Joystick);
+ ControlConfigSaveLoad.SaveControlConfigToJson();
+ RefreshAllMaps();
+ UpdateButtonLabels();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/KeyframedBoss.cs b/Thronefall_v1.57/Thronefall/Thronefall/KeyframedBoss.cs
new file mode 100644
index 0000000..5f2b2c2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/KeyframedBoss.cs
@@ -0,0 +1,180 @@
+using System.Collections;
+using UnityEngine;
+
+public class KeyframedBoss : MonoBehaviour
+{
+ [SerializeField]
+ private HealthbarMulti hpBarMulti;
+
+ [SerializeField]
+ private Hp hp;
+
+ [SerializeField]
+ private Transform stratKeyframe;
+
+ [SerializeField]
+ private Transform cutsceneKeyframe;
+
+ [SerializeField]
+ private float cutsceneHoldPosition = 4f;
+
+ [SerializeField]
+ private Transform[] mainKeyframes;
+
+ [SerializeField]
+ private Transform[] transitionalKeyframes;
+
+ [SerializeField]
+ private float animationDuration;
+
+ [SerializeField]
+ private float cutsceneAnimationDuration;
+
+ [SerializeField]
+ private DestroyOrDisableOnEnable disablerComponent;
+
+ private int bossStage;
+
+ private bool coroutineRunning;
+
+ [SerializeField]
+ private WigglerAnimationState wigglerAnimationState;
+
+ [SerializeField]
+ private float spawnWarningTime = 2f;
+
+ [SerializeField]
+ private Wave waveToSpawn;
+
+ [SerializeField]
+ private float waveToSpawnInterval;
+
+ [SerializeField]
+ private float waveToSpawnIntervalIncrease = 2f;
+
+ private float waveToSpawnIntervalCurrent;
+
+ private float cooldownToEnemySpawn;
+
+ private bool waveRunning;
+
+ private bool cutSceneAnimation;
+
+ [SerializeField]
+ private AudioSource audioSourceSpawnsAndScream;
+
+ private ThronefallAudioManager audioManager;
+
+ private AudioSet audioSet;
+
+ [SerializeField]
+ private float takeDamageDuringEnemySpawn = 100f;
+
+ private void Start()
+ {
+ audioManager = ThronefallAudioManager.Instance;
+ audioSet = audioManager.audioContent;
+ waveToSpawnIntervalCurrent = waveToSpawnInterval;
+ base.transform.localPosition = stratKeyframe.localPosition;
+ base.transform.localRotation = stratKeyframe.localRotation;
+ StopAllCoroutines();
+ StartCoroutine(StartAnimation());
+ }
+
+ private IEnumerator StartAnimation()
+ {
+ hp.invulnerable = true;
+ coroutineRunning = true;
+ yield return TransitionTo(cutsceneKeyframe, cutsceneAnimationDuration);
+ hp.invulnerable = true;
+ coroutineRunning = true;
+ cutSceneAnimation = true;
+ disablerComponent.enabled = true;
+ yield return new WaitForSeconds(cutsceneHoldPosition);
+ cutSceneAnimation = false;
+ yield return TransitionTo(mainKeyframes[0], animationDuration / 2f);
+ coroutineRunning = false;
+ hp.invulnerable = false;
+ hp.TakeDamage(1f);
+ hpBarMulti.UpdateDisplay();
+ }
+
+ private void Update()
+ {
+ if (hp.HpPercentage <= (float)(mainKeyframes.Length - (bossStage + 1)) / (float)mainKeyframes.Length)
+ {
+ waveToSpawnIntervalCurrent = waveToSpawnInterval;
+ bossStage++;
+ StopAllCoroutines();
+ StartCoroutine(TransitionOverTo(transitionalKeyframes[bossStage], mainKeyframes[bossStage], animationDuration));
+ }
+ cooldownToEnemySpawn -= Time.deltaTime;
+ if (cooldownToEnemySpawn <= 0f && !coroutineRunning && !waveRunning)
+ {
+ cooldownToEnemySpawn = waveToSpawnIntervalCurrent;
+ waveToSpawnIntervalCurrent += waveToSpawnIntervalIncrease;
+ waveToSpawn.Reset();
+ waveRunning = true;
+ }
+ if (waveRunning)
+ {
+ hp.TakeDamage(Time.deltaTime * takeDamageDuringEnemySpawn, null, causedByPlayer: false, invokeFeedbackEvents: false);
+ waveToSpawn.Update();
+ if (waveToSpawn.HasFinished())
+ {
+ waveRunning = false;
+ }
+ }
+ if (waveRunning || (cooldownToEnemySpawn <= spawnWarningTime && !coroutineRunning))
+ {
+ if (wigglerAnimationState.animationState != 1)
+ {
+ audioSourceSpawnsAndScream.PlayOneShot(audioSet.EismolochSpawnUnits.clips[Random.Range(0, audioSet.EismolochSpawnUnits.clips.Length)]);
+ if (Random.value <= 0.33f)
+ {
+ audioSourceSpawnsAndScream.PlayOneShot(audioSet.EismolochScream.clips[Random.Range(0, audioSet.EismolochScream.clips.Length)]);
+ }
+ }
+ wigglerAnimationState.animationState = 1;
+ }
+ else if (cutSceneAnimation)
+ {
+ wigglerAnimationState.animationState = 1;
+ }
+ else
+ {
+ wigglerAnimationState.animationState = 0;
+ }
+ }
+
+ private IEnumerator TransitionOverTo(Transform _transitionOver, Transform _transitionTo, float _animationDuration = 5f)
+ {
+ coroutineRunning = true;
+ yield return TransitionTo(_transitionOver, _animationDuration / 2f);
+ coroutineRunning = true;
+ yield return TransitionTo(_transitionTo, _animationDuration / 2f);
+ coroutineRunning = false;
+ }
+
+ private IEnumerator TransitionTo(Transform _transitionTo, float _animationDuration = 5f)
+ {
+ hp.invulnerable = true;
+ hpBarMulti.UpdateDisplay();
+ coroutineRunning = true;
+ Vector3 startPosition = base.transform.localPosition;
+ Quaternion startRotation = base.transform.localRotation;
+ for (float animProgress = 0f; animProgress < _animationDuration; animProgress += Time.deltaTime)
+ {
+ float f = animProgress / _animationDuration;
+ f = 3f * Mathf.Pow(f, 2f) - 2f * Mathf.Pow(f, 3f);
+ base.transform.localPosition = Vector3.Lerp(startPosition, _transitionTo.localPosition, f);
+ base.transform.localRotation = Quaternion.Lerp(startRotation, _transitionTo.localRotation, f);
+ yield return null;
+ }
+ base.transform.localPosition = _transitionTo.localPosition;
+ base.transform.localRotation = _transitionTo.localRotation;
+ coroutineRunning = false;
+ hp.invulnerable = false;
+ hpBarMulti.UpdateDisplay();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LaunchableDefenseMechanismInteractor.cs b/Thronefall_v1.57/Thronefall/Thronefall/LaunchableDefenseMechanismInteractor.cs
new file mode 100644
index 0000000..90fcd7b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LaunchableDefenseMechanismInteractor.cs
@@ -0,0 +1,87 @@
+using UnityEngine;
+
+public class LaunchableDefenseMechanismInteractor : InteractorBase, DayNightCycle.IDaytimeSensitive
+{
+ public GameObject focusIndicator;
+
+ public LaunchableProjectile projectilePrefab;
+
+ public Transform projectileSpawn;
+
+ public bool autoReloadOnDawn = true;
+
+ private LaunchableProjectile currentProjectile;
+
+ private void Start()
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ Reload();
+ if (DayNightCycle.Instance.CurrentTimestate == DayNightCycle.Timestate.Day)
+ {
+ base.gameObject.SetActive(value: false);
+ }
+ }
+
+ public override void Focus(PlayerInteraction player)
+ {
+ if ((bool)currentProjectile)
+ {
+ focusIndicator.SetActive(value: true);
+ }
+ }
+
+ public override void InteractionBegin(PlayerInteraction player)
+ {
+ if ((bool)currentProjectile)
+ {
+ currentProjectile.Launch();
+ currentProjectile.transform.parent = null;
+ currentProjectile = null;
+ Unfocus(player);
+ }
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ base.gameObject.SetActive(value: false);
+ if (autoReloadOnDawn)
+ {
+ Reload();
+ }
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public void OnDusk()
+ {
+ base.gameObject.SetActive(value: true);
+ }
+
+ public override void Unfocus(PlayerInteraction player)
+ {
+ focusIndicator.SetActive(value: false);
+ }
+
+ public void Reload()
+ {
+ if (!currentProjectile)
+ {
+ currentProjectile = Object.Instantiate(projectilePrefab, projectileSpawn.transform.position, projectileSpawn.transform.rotation, base.transform.parent);
+ }
+ }
+
+ private void OnDrawGizmos()
+ {
+ Gizmos.color = Color.black;
+ Gizmos.DrawWireMesh(projectilePrefab.GetComponentInChildren<MeshFilter>().sharedMesh, 0, projectileSpawn.position, projectileSpawn.rotation, projectilePrefab.transform.localScale);
+ Gizmos.color = Color.magenta;
+ Gizmos.DrawLine(projectileSpawn.position, projectileSpawn.position + projectileSpawn.forward * 15f);
+ Gizmos.DrawWireSphere(projectileSpawn.position + projectileSpawn.forward * 15f, 0.3f);
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LaunchableProjectile.cs b/Thronefall_v1.57/Thronefall/Thronefall/LaunchableProjectile.cs
new file mode 100644
index 0000000..84f9fbd
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LaunchableProjectile.cs
@@ -0,0 +1,66 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class LaunchableProjectile : MonoBehaviour
+{
+ public float speed = 20f;
+
+ public float lifetime = 3f;
+
+ public bool groundedTranslation;
+
+ public LayerMask groundLayer;
+
+ public Vector3 groundingOfffset;
+
+ public List<DamageModifyer> dmgModifiers = new List<DamageModifyer>();
+
+ public LayerMask hitLayer;
+
+ public Vector3 damageBoxExtents;
+
+ private bool launched;
+
+ private float timer;
+
+ private List<Hp> touchedEnemies = new List<Hp>();
+
+ public void Launch()
+ {
+ launched = true;
+ if (groundedTranslation && Physics.Raycast(new Ray(base.transform.position, Vector3.down), out var hitInfo, float.PositiveInfinity, groundLayer))
+ {
+ base.transform.position = hitInfo.point + groundingOfffset;
+ }
+ }
+
+ private void Update()
+ {
+ if (!launched)
+ {
+ return;
+ }
+ timer += Time.deltaTime;
+ base.transform.position += base.transform.forward * speed * Time.deltaTime;
+ Collider[] array = Physics.OverlapBox(base.transform.position, damageBoxExtents / 2f, base.transform.rotation, hitLayer);
+ for (int i = 0; i < array.Length; i++)
+ {
+ Hp componentInParent = array[i].GetComponentInParent<Hp>();
+ if ((bool)componentInParent && !touchedEnemies.Contains(componentInParent))
+ {
+ touchedEnemies.Add(componentInParent);
+ componentInParent.TakeDamage(DamageModifyer.CalculateDamageOnTarget(componentInParent.TaggedObj, dmgModifiers));
+ }
+ }
+ if (timer >= lifetime)
+ {
+ Object.Destroy(base.gameObject);
+ }
+ }
+
+ private void OnDrawGizmos()
+ {
+ Gizmos.color = Color.magenta;
+ Gizmos.DrawWireCube(base.transform.position, damageBoxExtents);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LevelAudio.cs b/Thronefall_v1.57/Thronefall/Thronefall/LevelAudio.cs
new file mode 100644
index 0000000..0ced3a9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LevelAudio.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class LevelAudio : MonoBehaviour
+{
+ [Serializable]
+ public class CivilisationAudioSource
+ {
+ public AudioSource audioSource;
+
+ public float volumeAtCastleCenterBuild = 0.1f;
+
+ public float targetVolume;
+
+ public int targetBuildingAmount;
+ }
+
+ public List<CivilisationAudioSource> managedCivAudioSources;
+
+ private int buildingCount;
+
+ private void OnValidate()
+ {
+ foreach (CivilisationAudioSource managedCivAudioSource in managedCivAudioSources)
+ {
+ if (managedCivAudioSource.audioSource != null)
+ {
+ managedCivAudioSource.targetVolume = managedCivAudioSource.audioSource.volume;
+ }
+ }
+ }
+
+ private void Start()
+ {
+ for (int num = managedCivAudioSources.Count - 1; num >= 0; num--)
+ {
+ CivilisationAudioSource civilisationAudioSource = managedCivAudioSources[num];
+ if (civilisationAudioSource.audioSource == null)
+ {
+ managedCivAudioSources.RemoveAt(num);
+ }
+ else
+ {
+ civilisationAudioSource.targetVolume = civilisationAudioSource.audioSource.volume;
+ civilisationAudioSource.audioSource.volume = 0f;
+ }
+ }
+ ThronefallAudioManager.Instance.onBuildingBuild.AddListener(OnNewBuildingBuilt);
+ }
+
+ private void OnNewBuildingBuilt()
+ {
+ for (int num = managedCivAudioSources.Count - 1; num >= 0; num--)
+ {
+ CivilisationAudioSource civilisationAudioSource = managedCivAudioSources[num];
+ civilisationAudioSource.audioSource.volume = Mathf.Lerp(civilisationAudioSource.volumeAtCastleCenterBuild, civilisationAudioSource.targetVolume, Mathf.InverseLerp(0f, civilisationAudioSource.targetBuildingAmount, buildingCount));
+ if (buildingCount >= civilisationAudioSource.targetBuildingAmount)
+ {
+ managedCivAudioSources.RemoveAt(num);
+ }
+ }
+ buildingCount++;
+ if (managedCivAudioSources.Count < 1)
+ {
+ ThronefallAudioManager.Instance.onBuildingBuild.RemoveListener(OnNewBuildingBuilt);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LevelBorder.cs b/Thronefall_v1.57/Thronefall/Thronefall/LevelBorder.cs
new file mode 100644
index 0000000..3e4cf20
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LevelBorder.cs
@@ -0,0 +1,191 @@
+using System.Collections;
+using Shapes;
+using UnityEngine;
+
+public class LevelBorder : MonoBehaviour
+{
+ public float fadeInDistance;
+
+ public BoxCollider boxCol;
+
+ public Line line;
+
+ public BoxCollider[] boxColArray;
+
+ public Line[] lineArray;
+
+ private readonly float tickTime = 0.5f;
+
+ private readonly float fadeTime = 0.75f;
+
+ private float timer;
+
+ private bool fadedIn;
+
+ private Transform target;
+
+ private Color defaultColor;
+
+ private Color fadeOutColor;
+
+ public bool arrayMode;
+
+ private Coroutine currentFade;
+
+ private bool notInArrayMode => !arrayMode;
+
+ private void Start()
+ {
+ target = TagManager.instance.Players[0].transform;
+ defaultColor = line.Color;
+ fadeOutColor = defaultColor;
+ fadeOutColor.a = 0f;
+ if (!arrayMode)
+ {
+ line.Color = fadeOutColor;
+ return;
+ }
+ Line[] array = lineArray;
+ for (int i = 0; i < array.Length; i++)
+ {
+ array[i].Color = fadeOutColor;
+ }
+ }
+
+ private void Update()
+ {
+ timer += Time.deltaTime;
+ if (!(timer >= tickTime))
+ {
+ return;
+ }
+ timer = 0f;
+ if (!arrayMode)
+ {
+ float num = Vector3.Distance(target.position, boxCol.ClosestPoint(target.position));
+ if (fadedIn && num > fadeInDistance)
+ {
+ if (currentFade == null)
+ {
+ currentFade = StartCoroutine(FadeOut());
+ }
+ fadedIn = false;
+ }
+ else if (!fadedIn && num <= fadeInDistance)
+ {
+ if (currentFade == null)
+ {
+ currentFade = StartCoroutine(FadeIn());
+ }
+ fadedIn = true;
+ }
+ return;
+ }
+ float num2 = float.PositiveInfinity;
+ BoxCollider[] array = boxColArray;
+ foreach (BoxCollider boxCollider in array)
+ {
+ float num3 = Vector3.Distance(target.position, boxCollider.ClosestPoint(target.position));
+ if (num3 < num2)
+ {
+ num2 = num3;
+ }
+ }
+ if (fadedIn && num2 > fadeInDistance)
+ {
+ if (currentFade == null)
+ {
+ currentFade = StartCoroutine(FadeOut());
+ }
+ fadedIn = false;
+ }
+ else if (!fadedIn && num2 <= fadeInDistance)
+ {
+ if (currentFade == null)
+ {
+ currentFade = StartCoroutine(FadeIn());
+ }
+ fadedIn = true;
+ }
+ }
+
+ private IEnumerator FadeIn()
+ {
+ float timer = 0f;
+ while (timer <= fadeTime)
+ {
+ timer += Time.deltaTime;
+ if (!arrayMode)
+ {
+ line.Color = Color.Lerp(fadeOutColor, defaultColor, timer / fadeTime);
+ }
+ else
+ {
+ Color color = Color.Lerp(fadeOutColor, defaultColor, timer / fadeTime);
+ Line[] array = lineArray;
+ for (int i = 0; i < array.Length; i++)
+ {
+ array[i].Color = color;
+ }
+ }
+ yield return null;
+ }
+ if (!arrayMode)
+ {
+ line.Color = defaultColor;
+ }
+ else
+ {
+ Line[] array = lineArray;
+ for (int i = 0; i < array.Length; i++)
+ {
+ array[i].Color = defaultColor;
+ }
+ }
+ currentFade = null;
+ if (!fadedIn)
+ {
+ currentFade = StartCoroutine(FadeOut());
+ }
+ }
+
+ private IEnumerator FadeOut()
+ {
+ float timer = 0f;
+ while (timer <= fadeTime)
+ {
+ timer += Time.deltaTime;
+ if (!arrayMode)
+ {
+ line.Color = Color.Lerp(defaultColor, fadeOutColor, timer / fadeTime);
+ }
+ else
+ {
+ Color color = Color.Lerp(defaultColor, fadeOutColor, timer / fadeTime);
+ Line[] array = lineArray;
+ for (int i = 0; i < array.Length; i++)
+ {
+ array[i].Color = color;
+ }
+ }
+ yield return null;
+ }
+ if (!arrayMode)
+ {
+ line.Color = fadeOutColor;
+ }
+ else
+ {
+ Line[] array = lineArray;
+ for (int i = 0; i < array.Length; i++)
+ {
+ array[i].Color = fadeOutColor;
+ }
+ }
+ currentFade = null;
+ if (fadedIn)
+ {
+ currentFade = StartCoroutine(FadeIn());
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LevelData.cs b/Thronefall_v1.57/Thronefall/Thronefall/LevelData.cs
new file mode 100644
index 0000000..2f7caa9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LevelData.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+
+[Serializable]
+public class LevelData
+{
+ public int questsCompleteWhenLastVisitingMap;
+
+ public bool beaten;
+
+ public int highscore;
+
+ public List<int> dayToDayScore = new List<int>();
+
+ public List<int> dayToDayNetworth = new List<int>();
+
+ public bool beatenBest;
+
+ public int highscoreBest;
+
+ public List<int> dayToDayScoreBest = new List<int>();
+
+ public List<int> dayToDayNetworthBest = new List<int>();
+
+ public List<List<Equippable>> levelHasBeenBeatenWith = new List<List<Equippable>>();
+
+ public void SaveScoreAndStatsToBestIfBest(bool _endOfMatch)
+ {
+ beatenBest = beaten || beatenBest;
+ if (highscore > highscoreBest)
+ {
+ highscoreBest = highscore;
+ dayToDayScoreBest = new List<int>(dayToDayScore);
+ dayToDayNetworthBest = new List<int>(dayToDayNetworth);
+ }
+ if (_endOfMatch && beaten)
+ {
+ levelHasBeenBeatenWith.Add(new List<Equippable>(PerkManager.instance.CurrentlyEquipped));
+ }
+ beaten = false;
+ highscore = 0;
+ dayToDayScore = new List<int>();
+ dayToDayScore.Add(0);
+ dayToDayNetworth = new List<int>();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LevelInfo.cs b/Thronefall_v1.57/Thronefall/Thronefall/LevelInfo.cs
new file mode 100644
index 0000000..3e0076f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LevelInfo.cs
@@ -0,0 +1,93 @@
+using System.Collections.Generic;
+using I2.Loc;
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "Level Info", menuName = "SimpleSiege/Level Info")]
+public class LevelInfo : ScriptableObject
+{
+ public enum ProgressionContribution
+ {
+ Crowns,
+ Stars
+ }
+
+ [Header("Basic Info")]
+ public string sceneName;
+
+ public string displayName;
+
+ public bool useSubtitle;
+
+ public bool useModeDescription;
+
+ public bool allBuildingChoicesUnlocked;
+
+ public bool ignoreSaves;
+
+ public bool unlockedInDemo;
+
+ public ProgressionContribution contribution;
+
+ [Header("Unlock Requirement")]
+ public LevelInfo unlockRequirement;
+
+ [Header("Enemy Spawner")]
+ public EnemySpawner enemySpawner;
+
+ [Header("Quests")]
+ public List<Quest> quests = new List<Quest>();
+
+ [Header("Loadout")]
+ public List<Equippable> fixedLoadout = new List<Equippable>();
+
+ [Header("Virtual Buildings")]
+ public List<VirtualBuilding> virtualBuildings = new List<VirtualBuilding>();
+
+ public string displaySubtitle
+ {
+ get
+ {
+ if (useSubtitle)
+ {
+ return LocalizationManager.GetTermTranslation("Map/" + sceneName);
+ }
+ return "";
+ }
+ }
+
+ public string displayModeDescription
+ {
+ get
+ {
+ if (useModeDescription)
+ {
+ return LocalizationManager.GetTermTranslation("Map Description/" + sceneName);
+ }
+ return "";
+ }
+ }
+
+ public bool HasFixedLoadout => fixedLoadout.Count > 0;
+
+ public LevelData LevelData => LevelProgressManager.instance.GetLevelDataForScene(sceneName);
+
+ public bool Beaten => LevelData.beatenBest;
+
+ public int QuestsComplete()
+ {
+ int num = 0;
+ for (int i = 0; i < quests.Count; i++)
+ {
+ if (quests[i].CheckBeaten(LevelData))
+ {
+ num++;
+ }
+ }
+ return num;
+ }
+
+ public int QuestsTotal()
+ {
+ return quests.Count;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LevelInteractor.cs b/Thronefall_v1.57/Thronefall/Thronefall/LevelInteractor.cs
new file mode 100644
index 0000000..69a0d9c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LevelInteractor.cs
@@ -0,0 +1,231 @@
+using System.Collections;
+using System.Collections.Generic;
+using TMPro;
+using UnityEngine;
+
+public class LevelInteractor : InteractorBase
+{
+ public static LevelInfo lastActiveLevelInfo;
+
+ private LevelSelectManager levelSelectManager;
+
+ private LevelProgressManager levelProgressManager;
+
+ private LevelData myLevelData;
+
+ [Header("Setup")]
+ [SerializeField]
+ private string tooltipThisLevelMustBeBeaten = "Beat <lvlname> to unlock this level.";
+
+ [SerializeField]
+ private GameObject focusPanel;
+
+ [SerializeField]
+ private GameObject cantBePlayedPanel;
+
+ [SerializeField]
+ private TextMeshProUGUI cantBePlayedCue;
+
+ [SerializeField]
+ private GameObject lockedLevelVisuals;
+
+ [SerializeField]
+ private GameObject unlockedLevelVisuals;
+
+ [SerializeField]
+ private GameObject beatenLevelVisuals;
+
+ [SerializeField]
+ private Transform rewardBuildingsParent;
+
+ [SerializeField]
+ private TMP_Text questsComplete;
+
+ [SerializeField]
+ private TextMeshProUGUI challengeName;
+
+ [Header("Colors")]
+ [SerializeField]
+ private Color allQuestComplete;
+
+ [SerializeField]
+ private Color notAllQuestComplete;
+
+ [Header("Level Info")]
+ public LevelInfo levelInfo;
+
+ public List<Quest> Quests => levelInfo.quests;
+
+ public bool CanBePlayed
+ {
+ get
+ {
+ if (levelInfo.unlockRequirement != null && !levelInfo.unlockRequirement.Beaten)
+ {
+ return false;
+ }
+ return true;
+ }
+ }
+
+ public string CanNotBePlayedReason
+ {
+ get
+ {
+ if ((bool)levelInfo.unlockRequirement && !levelInfo.unlockRequirement.Beaten)
+ {
+ return tooltipThisLevelMustBeBeaten.Replace("<lvlname>", levelInfo.unlockRequirement.displayName);
+ }
+ return "";
+ }
+ }
+
+ public void UpdateVisualsOnStart()
+ {
+ if (myLevelData == null)
+ {
+ levelProgressManager = LevelProgressManager.instance;
+ myLevelData = levelProgressManager.GetLevelDataForScene(levelInfo.sceneName);
+ }
+ lockedLevelVisuals.SetActive(value: false);
+ unlockedLevelVisuals.SetActive(value: false);
+ beatenLevelVisuals.SetActive(value: false);
+ questsComplete.transform.parent.gameObject.SetActive(value: false);
+ questsComplete.text = QuestsBeatenString();
+ int num = levelInfo.QuestsComplete();
+ if (num == levelInfo.QuestsTotal())
+ {
+ AchievementManager.LevelAllQuestsComplete(levelInfo.sceneName);
+ }
+ if (myLevelData.beatenBest)
+ {
+ AchievementManager.LevelBeaten(levelInfo.sceneName);
+ }
+ questsComplete.color = ((num >= levelInfo.QuestsTotal()) ? allQuestComplete : notAllQuestComplete);
+ float num2 = (float)num / (float)levelInfo.QuestsTotal();
+ int enabledBuildings = Mathf.FloorToInt((float)rewardBuildingsParent.childCount * (float)myLevelData.questsCompleteWhenLastVisitingMap);
+ int num3 = Mathf.FloorToInt((float)rewardBuildingsParent.childCount * num2);
+ myLevelData.questsCompleteWhenLastVisitingMap = num3;
+ StartCoroutine(EnableBuildingsCoroutine(enabledBuildings, num3, 0.75f, 0.5f));
+ if (challengeName != null)
+ {
+ challengeName.text = levelInfo.displaySubtitle;
+ }
+ if (!CanBePlayed)
+ {
+ lockedLevelVisuals.SetActive(value: true);
+ return;
+ }
+ questsComplete.transform.parent.gameObject.SetActive(value: true);
+ if (!levelInfo.Beaten)
+ {
+ unlockedLevelVisuals.SetActive(value: true);
+ }
+ else
+ {
+ beatenLevelVisuals.SetActive(value: true);
+ }
+ }
+
+ private IEnumerator EnableBuildingsCoroutine(int _enabledBuildings, int _enabledBuildingsUpTo, float _initialDelay, float _interval)
+ {
+ if (rewardBuildingsParent.childCount < _enabledBuildingsUpTo)
+ {
+ Debug.LogWarning("Not enough children in the rewardBuildingsParent to satisfy enabledBuildingsUpTo");
+ yield break;
+ }
+ if (rewardBuildingsParent.childCount < _enabledBuildings)
+ {
+ Debug.LogWarning("Not enough children in the rewardBuildingsParent to satisfy enabledBuildings");
+ yield break;
+ }
+ for (int j = 0; j < rewardBuildingsParent.childCount; j++)
+ {
+ rewardBuildingsParent.GetChild(j).gameObject.SetActive(value: false);
+ }
+ for (int k = 0; k < _enabledBuildings; k++)
+ {
+ rewardBuildingsParent.GetChild(k).gameObject.SetActive(value: true);
+ }
+ yield return new WaitForSeconds(_initialDelay);
+ for (int i = _enabledBuildings; i < _enabledBuildingsUpTo; i++)
+ {
+ rewardBuildingsParent.GetChild(i).gameObject.SetActive(value: true);
+ rewardBuildingsParent.GetChild(i).GetChild(0).gameObject.SetActive(value: true);
+ yield return new WaitForSeconds(_interval);
+ }
+ }
+
+ private void Start()
+ {
+ levelSelectManager = GetComponentInParent<LevelSelectManager>();
+ levelProgressManager = LevelProgressManager.instance;
+ myLevelData = levelProgressManager.GetLevelDataForScene(levelInfo.sceneName);
+ focusPanel.SetActive(value: false);
+ cantBePlayedPanel.SetActive(value: false);
+ UpdateVisualsOnStart();
+ }
+
+ public override string ReturnTooltip()
+ {
+ if (CanBePlayed)
+ {
+ return TextTranslator.Translate("Menu/Level Interactor Cue");
+ }
+ return "";
+ }
+
+ private string GenerateCueText()
+ {
+ if (!CanBePlayed)
+ {
+ return CanNotBePlayedReason;
+ }
+ if (levelSelectManager.PreLevelMenuIsOpen)
+ {
+ return "";
+ }
+ return levelInfo.displayName;
+ }
+
+ public override void InteractionBegin(PlayerInteraction _player)
+ {
+ if (CanBePlayed)
+ {
+ lastActiveLevelInfo = levelInfo;
+ UIFrameManager.TryOpenLevelSelect();
+ }
+ }
+
+ public override void Focus(PlayerInteraction _player)
+ {
+ if (CanBePlayed)
+ {
+ focusPanel.SetActive(value: true);
+ cantBePlayedPanel.SetActive(value: false);
+ if (challengeName != null)
+ {
+ challengeName.text = levelInfo.displaySubtitle;
+ }
+ return;
+ }
+ cantBePlayedCue.text = GenerateCueText();
+ cantBePlayedPanel.SetActive(value: true);
+ focusPanel.SetActive(value: false);
+ if (challengeName != null)
+ {
+ challengeName.text = levelInfo.displaySubtitle;
+ }
+ }
+
+ public override void Unfocus(PlayerInteraction _player)
+ {
+ focusPanel.SetActive(value: false);
+ cantBePlayedPanel.SetActive(value: false);
+ }
+
+ public string QuestsBeatenString()
+ {
+ return levelInfo.QuestsComplete() + "/" + levelInfo.QuestsTotal();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LevelNameDisplay.cs b/Thronefall_v1.57/Thronefall/Thronefall/LevelNameDisplay.cs
new file mode 100644
index 0000000..46e0512
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LevelNameDisplay.cs
@@ -0,0 +1,32 @@
+using I2.Loc;
+using TMPro;
+using UnityEngine;
+
+public class LevelNameDisplay : MonoBehaviour
+{
+ public TextMeshProUGUI levelTitle;
+
+ public float untertitleSize = 20f;
+
+ public bool displayFixedLoadoutWarning;
+
+ public void UpdateLevelTitle()
+ {
+ LevelInfo levelInfo = null;
+ levelInfo = ((!(LevelInteractor.lastActiveLevelInfo != null)) ? LevelProgressManager.instance.GetLevelInfoFromCurrentSceneName() : LevelInteractor.lastActiveLevelInfo);
+ if (!(levelInfo == null))
+ {
+ levelTitle.text = levelInfo.displayName;
+ if (levelInfo.displaySubtitle.Length > 0)
+ {
+ TextMeshProUGUI textMeshProUGUI = levelTitle;
+ textMeshProUGUI.text = textMeshProUGUI.text + "\n<size=" + untertitleSize + "><style=Subheader>" + levelInfo.displaySubtitle + "</size></style>";
+ }
+ if (displayFixedLoadoutWarning && levelInfo.HasFixedLoadout)
+ {
+ TextMeshProUGUI textMeshProUGUI2 = levelTitle;
+ textMeshProUGUI2.text = textMeshProUGUI2.text + "\n<style=Fixed Loadout>" + LocalizationManager.GetTranslation("Menu/Fixed Loadout Cue") + "</style>";
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LevelProgressManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/LevelProgressManager.cs
new file mode 100644
index 0000000..32444f3
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LevelProgressManager.cs
@@ -0,0 +1,129 @@
+using UnityEngine;
+using UnityEngine.SceneManagement;
+
+public class LevelProgressManager : MonoBehaviour
+{
+ public static LevelProgressManager instance;
+
+ public LevelInfo[] levelInfos;
+
+ [Header("Generated Data:")]
+ [SerializeField]
+ private SceneNameToLevelData sceneNameToLevelData = new SceneNameToLevelData();
+
+ public int EternalTrialsHighscore { get; set; }
+
+ public SceneNameToLevelData SceneNameToLevelData => sceneNameToLevelData;
+
+ public LevelInfo GetLevelInfoFromSceneName(string _sceneName)
+ {
+ for (int i = 0; i < levelInfos.Length; i++)
+ {
+ if (levelInfos[i].sceneName == _sceneName)
+ {
+ return levelInfos[i];
+ }
+ }
+ return null;
+ }
+
+ public LevelInfo GetLevelInfoFromCurrentSceneName()
+ {
+ for (int i = 0; i < SceneManager.sceneCount; i++)
+ {
+ Scene sceneAt = SceneManager.GetSceneAt(i);
+ if (sceneAt.isLoaded)
+ {
+ LevelInfo levelInfoFromSceneName = GetLevelInfoFromSceneName(sceneAt.name);
+ if (levelInfoFromSceneName != null)
+ {
+ return levelInfoFromSceneName;
+ }
+ }
+ }
+ return null;
+ }
+
+ public bool StartsWithUnderscore(string input)
+ {
+ if (string.IsNullOrEmpty(input))
+ {
+ return false;
+ }
+ return input[0] == '_';
+ }
+
+ public bool AreAllBuildOptionsUnlockedInThisLevel()
+ {
+ LevelInfo levelInfoFromCurrentSceneName = GetLevelInfoFromCurrentSceneName();
+ if (levelInfoFromCurrentSceneName == null)
+ {
+ return false;
+ }
+ return levelInfoFromCurrentSceneName.allBuildingChoicesUnlocked;
+ }
+
+ private void Awake()
+ {
+ if ((bool)instance)
+ {
+ Object.Destroy(base.gameObject);
+ return;
+ }
+ instance = this;
+ Object.DontDestroyOnLoad(base.transform.root.gameObject);
+ }
+
+ public LevelData GetLevelDataForScene(string _sceneName)
+ {
+ if (_sceneName == SceneTransitionManager.instance.levelSelectScene)
+ {
+ return null;
+ }
+ if (StartsWithUnderscore(_sceneName))
+ {
+ return null;
+ }
+ if (sceneNameToLevelData.ContainsKey(_sceneName))
+ {
+ return sceneNameToLevelData[_sceneName];
+ }
+ LevelData levelData = new LevelData();
+ sceneNameToLevelData.Add(_sceneName, levelData);
+ return levelData;
+ }
+
+ public LevelData GetLevelDataForActiveScene()
+ {
+ string sceneName = SceneManager.GetActiveScene().name;
+ return GetLevelDataForScene(sceneName);
+ }
+
+ public int CrownsAvailabe()
+ {
+ int num = 0;
+ LevelInfo[] array = levelInfos;
+ foreach (LevelInfo levelInfo in array)
+ {
+ if (levelInfo.contribution == LevelInfo.ProgressionContribution.Crowns)
+ {
+ num += levelInfo.QuestsTotal();
+ }
+ }
+ return num;
+ }
+
+ public int CrownsAchieved()
+ {
+ int num = 0;
+ LevelInfo[] array = levelInfos;
+ foreach (LevelInfo levelInfo in array)
+ {
+ if (levelInfo.contribution == LevelInfo.ProgressionContribution.Crowns)
+ {
+ num += levelInfo.QuestsComplete();
+ }
+ }
+ return num;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LevelSelectManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/LevelSelectManager.cs
new file mode 100644
index 0000000..afb9fb4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LevelSelectManager.cs
@@ -0,0 +1,95 @@
+using TMPro;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class LevelSelectManager : MonoBehaviour
+{
+ public static LevelSelectManager instance;
+
+ private LevelInteractor[] levelInteractors;
+
+ private BonusLevelInteractor[] bonusLevelInteractors;
+
+ public Vector3 spawnOnLevelOffsetPositon;
+
+ public PlayerMovement playerMovement;
+
+ public TMP_Text levelTitle;
+
+ public TMP_Text levelHighscore;
+
+ public TMP_Text beatenState;
+
+ public string notBeatenYet = "Not beaten yet.";
+
+ public string successfullyBeaten = "Successfully beaten.";
+
+ public string scorePrefix = "Your Best: ";
+
+ public GameObject tooltipObject;
+
+ public Image tooltipImage;
+
+ public TMP_Text tooltipTitle;
+
+ public TMP_Text tooltipDescription;
+
+ private Equippable showingTooltipFor;
+
+ public Canvas levelSelectedCanvas;
+
+ public Camera camMain;
+
+ private LevelInteractor openedLevel;
+
+ private int iFrames;
+
+ private bool fixedLoadout;
+
+ public Equippable ShowingTooltipFor => showingTooltipFor;
+
+ public bool PreLevelMenuIsOpen => openedLevel != null;
+
+ public void ShowTooltip(Equippable _eq)
+ {
+ showingTooltipFor = _eq;
+ tooltipObject.SetActive(_eq != null);
+ if (!(_eq == null))
+ {
+ tooltipImage.sprite = _eq.icon;
+ tooltipTitle.text = _eq.displayName;
+ tooltipDescription.text = _eq.description;
+ float num = camMain.pixelRect.height / levelSelectedCanvas.pixelRect.height;
+ tooltipObject.transform.position = Input.mousePosition * num;
+ }
+ }
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ private void Start()
+ {
+ levelInteractors = GetComponentsInChildren<LevelInteractor>();
+ bonusLevelInteractors = GetComponentsInChildren<BonusLevelInteractor>();
+ ShowTooltip(null);
+ }
+
+ private void MovePlayerToTheLevelYouCameFrom()
+ {
+ }
+
+ public void PlayButtonPressed()
+ {
+ if (PreLevelMenuIsOpen)
+ {
+ if (openedLevel.levelInfo.fixedLoadout.Count > 0)
+ {
+ PerkManager.instance.CurrentlyEquipped.Clear();
+ PerkManager.instance.CurrentlyEquipped.AddRange(openedLevel.levelInfo.fixedLoadout);
+ }
+ SceneTransitionManager.instance.TransitionFromLevelSelectToLevel(openedLevel.levelInfo.sceneName);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LevelSelectUIFrameHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/LevelSelectUIFrameHelper.cs
new file mode 100644
index 0000000..eae254c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LevelSelectUIFrameHelper.cs
@@ -0,0 +1,53 @@
+using TMPro;
+using UnityEngine;
+
+public class LevelSelectUIFrameHelper : MonoBehaviour
+{
+ public UIFrame target;
+
+ public TextMeshProUGUI levelTitle;
+
+ public ThronefallUIElement highscoreButton;
+
+ public ThronefallUIElement noSavePlayButton;
+
+ public ThronefallUIElement saveUpperButton;
+
+ public ThronefallUIElement saveLowerButton;
+
+ public GameObject hasSaveParent;
+
+ public GameObject hasNoSaveParent;
+
+ public void OnShow()
+ {
+ MatchSaveLoadHandler.TryLoadRun(LevelInteractor.lastActiveLevelInfo.displayName + LevelInteractor.lastActiveLevelInfo.displaySubtitle);
+ if (MatchSaveLoadHandler.CurrentSave != null && !LevelInteractor.lastActiveLevelInfo.ignoreSaves && !MatchSaveLoadHandler.CurrentSave.runComplete)
+ {
+ hasSaveParent.SetActive(value: true);
+ hasNoSaveParent.SetActive(value: false);
+ target.firstSelected = saveLowerButton;
+ highscoreButton.topNav = saveLowerButton;
+ highscoreButton.botNav = saveUpperButton;
+ }
+ else
+ {
+ hasSaveParent.SetActive(value: false);
+ hasNoSaveParent.SetActive(value: true);
+ target.firstSelected = noSavePlayButton;
+ highscoreButton.topNav = noSavePlayButton;
+ highscoreButton.botNav = noSavePlayButton;
+ }
+ }
+
+ public void TransitionToSelectedLevel()
+ {
+ LocalGamestate.SelectedGameMode = LocalGamestate.GameMode.Classic;
+ SceneTransitionManager.instance.TransitionFromLevelSelectToLevel(LevelInteractor.lastActiveLevelInfo.sceneName);
+ }
+
+ public void SetOverrideSave(bool value)
+ {
+ MatchSaveLoadHandler.OverwriteCurrentSave = value;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LevelUpScreenAnimation.cs b/Thronefall_v1.57/Thronefall/Thronefall/LevelUpScreenAnimation.cs
new file mode 100644
index 0000000..b0d4476
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LevelUpScreenAnimation.cs
@@ -0,0 +1,29 @@
+using System.Collections;
+using UnityEngine;
+
+public class LevelUpScreenAnimation : MonoBehaviour
+{
+ public float animationTime = 0.5f;
+
+ public AnimationCurve scaleCurve;
+
+ public Transform target;
+
+ public void Trigger()
+ {
+ StopAllCoroutines();
+ StartCoroutine(Animation());
+ }
+
+ private IEnumerator Animation()
+ {
+ float timer = 0f;
+ while (timer < animationTime)
+ {
+ timer += Time.unscaledDeltaTime;
+ target.localScale = Vector3.one * scaleCurve.Evaluate(Mathf.InverseLerp(0f, animationTime, timer));
+ yield return null;
+ }
+ target.localScale = Vector3.one;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LightningStriker.cs b/Thronefall_v1.57/Thronefall/Thronefall/LightningStriker.cs
new file mode 100644
index 0000000..97491bf
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LightningStriker.cs
@@ -0,0 +1,87 @@
+using System.Collections;
+using UnityEngine;
+
+public class LightningStriker : MonoBehaviour
+{
+ public float minSecondsBetweenStrikes = 20f;
+
+ public float maxSecondsBetweenStrikes = 120f;
+
+ public AnimationCurve intensityCurve;
+
+ public float maxIntensity = 3f;
+
+ public float strikeDuration = 1f;
+
+ public Color lightningLightColor = Color.white;
+
+ public AudioClip thunder;
+
+ private Light mainLight;
+
+ private Light lightningLight;
+
+ private AudioSource aSource;
+
+ private bool inAnimation;
+
+ private float timer;
+
+ private void Start()
+ {
+ if (ColorAndLightManager.Instance == null || ColorAndLightManager.Instance.Sunlight == null)
+ {
+ base.enabled = false;
+ return;
+ }
+ mainLight = ColorAndLightManager.Instance.Sunlight;
+ lightningLight = GetComponent<Light>();
+ aSource = GetComponent<AudioSource>();
+ ResetTimer();
+ if (ColorAndLightManager.Instance != null && ColorAndLightManager.Instance.Sunlight != null)
+ {
+ base.transform.rotation = ColorAndLightManager.Instance.Sunlight.transform.rotation;
+ }
+ }
+
+ private void Update()
+ {
+ if (!inAnimation)
+ {
+ timer -= Time.deltaTime;
+ if (timer <= 0f)
+ {
+ StartCoroutine(AnimateLightningStrike());
+ }
+ }
+ }
+
+ private IEnumerator AnimateLightningStrike()
+ {
+ inAnimation = true;
+ lightningLight.color = mainLight.color;
+ lightningLight.intensity = mainLight.intensity;
+ lightningLight.enabled = true;
+ mainLight.enabled = false;
+ aSource.pitch = Random.Range(0.8f, 1.2f);
+ aSource.PlayOneShot(thunder);
+ float clock = 0f;
+ while (clock <= strikeDuration)
+ {
+ clock += Time.deltaTime;
+ float t = intensityCurve.Evaluate(Mathf.InverseLerp(0f, strikeDuration, clock));
+ lightningLight.color = Color.Lerp(mainLight.color, lightningLight.color, t);
+ lightningLight.intensity = Mathf.Lerp(mainLight.intensity, maxIntensity, t);
+ yield return null;
+ }
+ lightningLight.enabled = false;
+ mainLight.enabled = true;
+ ResetTimer();
+ inAnimation = false;
+ }
+
+ private void ResetTimer()
+ {
+ timer = Random.Range(minSecondsBetweenStrikes, maxSecondsBetweenStrikes);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LightningWandMA.cs b/Thronefall_v1.57/Thronefall/Thronefall/LightningWandMA.cs
new file mode 100644
index 0000000..e872745
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LightningWandMA.cs
@@ -0,0 +1,70 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class LightningWandMA : ManualAttack
+{
+ private List<TaggedObject> possibleAttackTargets = new List<TaggedObject>();
+
+ private TagManager tagManager;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float distanceBetweenAttacks;
+
+ public override void Start()
+ {
+ base.Start();
+ tagManager = TagManager.instance;
+ }
+
+ public override void Attack()
+ {
+ if ((bool)particlesOnAttack)
+ {
+ particlesOnAttack.Play();
+ }
+ if (playOneShotOnAttack)
+ {
+ ThronefallAudioManager.Oneshot(oneshotOnAttack);
+ }
+ TaggedObject taggedObject = FindAttackTarget(_choosePreferredTargetIfPossible: true);
+ if (!taggedObject)
+ {
+ return;
+ }
+ _ = taggedObject.Hp;
+ lastTargetPos = taggedObject.transform.position;
+ onAttack.Invoke();
+ tagManager.FindAllTaggedObjectsWithTags(possibleAttackTargets, targetPriorities[0].mustHaveTags, targetPriorities[0].mayNotHaveTags);
+ float range = targetPriorities[0].range;
+ for (int num = possibleAttackTargets.Count - 1; num >= 0; num--)
+ {
+ if (tagManager.MeasureDistanceToTaggedObject(possibleAttackTargets[num], base.transform.position) > range)
+ {
+ possibleAttackTargets.RemoveAt(num);
+ }
+ }
+ for (int num2 = possibleAttackTargets.Count - 1; num2 >= 0; num2--)
+ {
+ for (int num3 = possibleAttackTargets.Count - 1; num3 >= 0; num3--)
+ {
+ if (num2 != num3 && Vector3.Distance(possibleAttackTargets[num2].transform.position, possibleAttackTargets[num3].transform.position) < distanceBetweenAttacks && possibleAttackTargets[num3] != taggedObject)
+ {
+ possibleAttackTargets.RemoveAt(num3);
+ if (num3 < num2)
+ {
+ num2--;
+ }
+ }
+ }
+ }
+ foreach (TaggedObject possibleAttackTarget in possibleAttackTargets)
+ {
+ Hp hp = possibleAttackTarget.Hp;
+ if ((bool)hp)
+ {
+ weapon.Attack(base.transform.position + spawnAttackHeight * Vector3.up, hp, transformForAttackDirection.forward, myTaggedObj, base.AttackDamageMultiplyer);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LimitDeltaTime.cs b/Thronefall_v1.57/Thronefall/Thronefall/LimitDeltaTime.cs
new file mode 100644
index 0000000..d0a7f54
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LimitDeltaTime.cs
@@ -0,0 +1,11 @@
+using UnityEngine;
+
+public class LimitDeltaTime : MonoBehaviour
+{
+ public float maxDeltaTimeInMs = 16f;
+
+ private void Start()
+ {
+ Time.maximumDeltaTime = maxDeltaTimeInMs / 1000f;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LimitedLifetime.cs b/Thronefall_v1.57/Thronefall/Thronefall/LimitedLifetime.cs
new file mode 100644
index 0000000..1d99757
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LimitedLifetime.cs
@@ -0,0 +1,11 @@
+using UnityEngine;
+
+public class LimitedLifetime : MonoBehaviour
+{
+ public float liftetime = 5f;
+
+ private void Start()
+ {
+ Object.Destroy(base.gameObject, liftetime);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LoadSceneOnTop.cs b/Thronefall_v1.57/Thronefall/Thronefall/LoadSceneOnTop.cs
new file mode 100644
index 0000000..c514abe
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LoadSceneOnTop.cs
@@ -0,0 +1,25 @@
+using UnityEngine;
+using UnityEngine.SceneManagement;
+
+public class LoadSceneOnTop : MonoBehaviour
+{
+ [SerializeField]
+ private string sceneNameToLoad;
+
+ private void Start()
+ {
+ LoadScene();
+ }
+
+ public void LoadScene()
+ {
+ if (!string.IsNullOrEmpty(sceneNameToLoad))
+ {
+ SceneManager.LoadScene(sceneNameToLoad, LoadSceneMode.Additive);
+ }
+ else
+ {
+ Debug.LogError("Scene name is not specified. Please provide a valid scene name.");
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LoadoutUIHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/LoadoutUIHelper.cs
new file mode 100644
index 0000000..af0b6ff
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LoadoutUIHelper.cs
@@ -0,0 +1,552 @@
+using System.Collections.Generic;
+using I2.Loc;
+using TMPro;
+using UnityEngine;
+using UnityEngine.SceneManagement;
+using UnityEngine.UI;
+
+public class LoadoutUIHelper : MonoBehaviour
+{
+ public bool inMatch;
+
+ public bool autoSelectPlay;
+
+ public LocalGamestate.GameMode mode;
+
+ public UIFrame frame;
+
+ public TextMeshProUGUI perksText;
+
+ public TextMeshProUGUI mutatorBonusText;
+
+ public TextMeshProUGUI currentEternalTrialBalanceText;
+
+ public ThronefallUIElement playButton;
+
+ public GridLayoutGroup weaponsParent;
+
+ public GridLayoutGroup perksParent;
+
+ public GridLayoutGroup mutatorsParent;
+
+ public TFUIEquippable equippableButtonPrefab;
+
+ public Transform questsParent;
+
+ public QuestEntry questEntryPrefab;
+
+ private List<TFUIEquippable> weapons = new List<TFUIEquippable>();
+
+ private List<TFUIEquippable> perks = new List<TFUIEquippable>();
+
+ private List<TFUIEquippable> mutators = new List<TFUIEquippable>();
+
+ private List<TFUIEquippable> equippedWeapons = new List<TFUIEquippable>();
+
+ private List<TFUIEquippable> equippedPerks = new List<TFUIEquippable>();
+
+ private List<TFUIEquippable> equippedMutators = new List<TFUIEquippable>();
+
+ private readonly int numberOfWeaponsAllowedToEquip = 1;
+
+ private readonly int numberOfMutatiomsAllowedToEquip = 1000;
+
+ private int numberOfPerksAllowedToEquip;
+
+ private LevelData levelData;
+
+ private LevelInfo levelInfo;
+
+ private bool GetLevelData => mode == LocalGamestate.GameMode.Classic;
+
+ private bool DrawQuests => mode == LocalGamestate.GameMode.Classic;
+
+ private bool DrawMutators => mode == LocalGamestate.GameMode.Classic;
+
+ private bool HasFixedLoadout
+ {
+ get
+ {
+ if (GetLevelData && levelInfo != null)
+ {
+ return levelInfo.HasFixedLoadout;
+ }
+ return false;
+ }
+ }
+
+ private bool UnequipAllBesidesWeaponsOnStart => mode == LocalGamestate.GameMode.EternalTrial;
+
+ public int LoadoutWorth => equippedPerks.Count;
+
+ public void OnShow()
+ {
+ if (inMatch && MatchSaveLoadHandler.SaveLoadForbidden)
+ {
+ SceneTransitionManager.instance.RestartCurrentLevel();
+ base.gameObject.SetActive(value: false);
+ return;
+ }
+ if (GetLevelData)
+ {
+ if (inMatch)
+ {
+ levelData = LevelProgressManager.instance.GetLevelDataForActiveScene();
+ levelInfo = LevelProgressManager.instance.GetLevelInfoFromCurrentSceneName();
+ }
+ else
+ {
+ levelData = LevelProgressManager.instance.GetLevelDataForScene(LevelInteractor.lastActiveLevelInfo.sceneName);
+ levelInfo = LevelProgressManager.instance.GetLevelInfoFromSceneName(LevelInteractor.lastActiveLevelInfo.sceneName);
+ }
+ }
+ weapons.Clear();
+ perks.Clear();
+ mutators.Clear();
+ equippedWeapons.Clear();
+ equippedPerks.Clear();
+ equippedMutators.Clear();
+ foreach (Transform item in weaponsParent.transform)
+ {
+ Object.Destroy(item.gameObject);
+ }
+ foreach (Transform item2 in perksParent.transform)
+ {
+ Object.Destroy(item2.gameObject);
+ }
+ if (DrawMutators)
+ {
+ foreach (Transform item3 in mutatorsParent.transform)
+ {
+ Object.Destroy(item3.gameObject);
+ }
+ }
+ numberOfPerksAllowedToEquip = 0;
+ foreach (Equippable unlockedEquippable in PerkManager.instance.UnlockedEquippables)
+ {
+ if (!DrawMutators && UnequipAllBesidesWeaponsOnStart && unlockedEquippable is EquippableMutation)
+ {
+ PerkManager.SetEquipped(unlockedEquippable, _equipped: false);
+ }
+ if (unlockedEquippable is PerkPoint && mode == LocalGamestate.GameMode.Classic)
+ {
+ numberOfPerksAllowedToEquip++;
+ }
+ else if (unlockedEquippable is EquippableWeapon)
+ {
+ AddTFUIEquippable(weaponsParent, unlockedEquippable);
+ }
+ else if (unlockedEquippable is EquippablePerk)
+ {
+ AddTFUIEquippable(perksParent, unlockedEquippable);
+ }
+ else if (unlockedEquippable is EquippableMutation && DrawMutators)
+ {
+ AddTFUIEquippable(mutatorsParent, unlockedEquippable);
+ }
+ }
+ foreach (MetaLevel metaLevel in PerkManager.instance.MetaLevels)
+ {
+ Equippable reward = metaLevel.reward;
+ if (!DrawMutators && UnequipAllBesidesWeaponsOnStart && metaLevel.reward is EquippableMutation)
+ {
+ PerkManager.SetEquipped(metaLevel.reward, _equipped: false);
+ }
+ if (!PerkManager.instance.UnlockedEquippables.Contains(reward))
+ {
+ if (PerkManager.IsEquipped(reward) && !levelInfo.fixedLoadout.Contains(reward))
+ {
+ PerkManager.SetEquipped(reward, _equipped: false);
+ }
+ if (reward is EquippableWeapon)
+ {
+ AddTFUIEquippable(weaponsParent, reward);
+ }
+ else if (reward is EquippablePerk)
+ {
+ AddTFUIEquippable(perksParent, reward);
+ }
+ else if (reward is EquippableMutation && DrawMutators)
+ {
+ AddTFUIEquippable(mutatorsParent, reward);
+ }
+ }
+ }
+ if (equippedPerks.Count > numberOfPerksAllowedToEquip)
+ {
+ int num = equippedPerks.Count - numberOfPerksAllowedToEquip;
+ int num2 = 0;
+ for (int num3 = equippedPerks.Count - 1; num3 >= 0; num3--)
+ {
+ if (num2 < num)
+ {
+ TFUIEquippable tFUIEquippable = equippedPerks[num3];
+ if (!HasFixedLoadout || !levelInfo.fixedLoadout.Contains(tFUIEquippable.Data))
+ {
+ PerkManager.SetEquipped(tFUIEquippable.Data, _equipped: false);
+ tFUIEquippable.UnPick();
+ equippedPerks.Remove(tFUIEquippable);
+ num2++;
+ }
+ }
+ }
+ Debug.Log("Unequipped " + num2 + " excess perks.");
+ }
+ if (equippedWeapons.Count < 1 && !HasFixedLoadout)
+ {
+ PerkManager.SetEquipped(weapons[0].Data, _equipped: true);
+ weapons[0].Pick();
+ equippedWeapons.Add(weapons[0]);
+ }
+ RecomputeNavigation();
+ UpdatePerkPointsRemainingText();
+ if (DrawQuests)
+ {
+ RewriteQuestTexts();
+ }
+ if (DrawMutators)
+ {
+ UpdateMutatorBonusText();
+ }
+ }
+
+ private void AddTFUIEquippable(GridLayoutGroup parent, Equippable e)
+ {
+ TFUIEquippable component = Object.Instantiate(equippableButtonPrefab, parent.transform).GetComponent<TFUIEquippable>();
+ component.SetData(e, HasFixedLoadout, overrideShow: false, levelInfo);
+ if (PerkManager.IsEquipped(e))
+ {
+ bool flag = HasFixedLoadout && !levelInfo.fixedLoadout.Contains(e);
+ if (UnequipAllBesidesWeaponsOnStart && !(e is EquippableWeapon))
+ {
+ flag = true;
+ }
+ if (flag)
+ {
+ PerkManager.SetEquipped(e, _equipped: false);
+ }
+ else
+ {
+ component.Pick();
+ if (e is EquippableWeapon)
+ {
+ equippedWeapons.Add(component);
+ }
+ if (e is EquippablePerk)
+ {
+ equippedPerks.Add(component);
+ }
+ if (e is EquippableMutation)
+ {
+ equippedMutators.Add(component);
+ }
+ }
+ }
+ else if (HasFixedLoadout && levelInfo.fixedLoadout.Contains(e))
+ {
+ PerkManager.SetEquipped(e, _equipped: true);
+ component.Pick();
+ if (e is EquippableWeapon)
+ {
+ equippedWeapons.Add(component);
+ }
+ if (e is EquippablePerk)
+ {
+ equippedPerks.Add(component);
+ }
+ if (e is EquippableMutation)
+ {
+ equippedMutators.Add(component);
+ }
+ }
+ if (parent == weaponsParent)
+ {
+ weapons.Add(component);
+ }
+ else if (parent == perksParent)
+ {
+ perks.Add(component);
+ }
+ else if (parent == mutatorsParent)
+ {
+ mutators.Add(component);
+ }
+ }
+
+ public void TrySelectEquippableForLoadout()
+ {
+ TFUIEquippable tFUIEquippable = frame.LastApplied as TFUIEquippable;
+ if (tFUIEquippable == null || tFUIEquippable.Locked || HasFixedLoadout)
+ {
+ return;
+ }
+ if (tFUIEquippable.Data is EquippableWeapon)
+ {
+ for (int num = equippedWeapons.Count - 1; num >= 0; num--)
+ {
+ PerkManager.SetEquipped(equippedWeapons[num].Data, _equipped: false);
+ equippedWeapons[num].UnPick();
+ equippedWeapons.Remove(equippedWeapons[num]);
+ }
+ tFUIEquippable.Pick();
+ PerkManager.SetEquipped(tFUIEquippable.Data, _equipped: true);
+ equippedWeapons.Add(tFUIEquippable);
+ }
+ if (tFUIEquippable.Data is EquippablePerk)
+ {
+ List<TFUIEquippable> list = new List<TFUIEquippable>();
+ int num2 = 0;
+ for (int num3 = equippedPerks.Count - 1; num3 >= 0; num3--)
+ {
+ if (equippedPerks[num3] != tFUIEquippable)
+ {
+ num2++;
+ }
+ if (num2 >= numberOfPerksAllowedToEquip)
+ {
+ list.Add(equippedPerks[num3]);
+ }
+ }
+ foreach (TFUIEquippable item in list)
+ {
+ PerkManager.SetEquipped(item.Data, _equipped: false);
+ item.UnPick();
+ equippedPerks.Remove(item);
+ }
+ if (equippedPerks.Contains(tFUIEquippable))
+ {
+ tFUIEquippable.UnPick();
+ PerkManager.SetEquipped(tFUIEquippable.Data, _equipped: false);
+ equippedPerks.Remove(tFUIEquippable);
+ }
+ else
+ {
+ tFUIEquippable.Pick();
+ PerkManager.SetEquipped(tFUIEquippable.Data, _equipped: true);
+ equippedPerks.Add(tFUIEquippable);
+ }
+ }
+ if (tFUIEquippable.Data is EquippableMutation)
+ {
+ if (equippedMutators.Contains(tFUIEquippable))
+ {
+ tFUIEquippable.UnPick();
+ PerkManager.SetEquipped(tFUIEquippable.Data, _equipped: false);
+ equippedMutators.Remove(tFUIEquippable);
+ }
+ else
+ {
+ tFUIEquippable.Pick();
+ PerkManager.SetEquipped(tFUIEquippable.Data, _equipped: true);
+ equippedMutators.Add(tFUIEquippable);
+ }
+ }
+ UpdatePerkPointsRemainingText();
+ if (DrawMutators)
+ {
+ UpdateMutatorBonusText();
+ }
+ }
+
+ private void RecomputeNavigation()
+ {
+ int constraintCount = weaponsParent.constraintCount;
+ if (DrawMutators)
+ {
+ AssignNavigationTargets(weapons, playButton, null, null, perks, constraintCount);
+ AssignNavigationTargets(perks, null, weapons, null, mutators, constraintCount);
+ AssignNavigationTargets(mutators, null, perks, playButton, null, constraintCount);
+ playButton.topNav = mutators[mutators.Count - 1];
+ playButton.leftNav = mutators[mutators.Count - 1];
+ }
+ else
+ {
+ AssignNavigationTargets(weapons, playButton, null, null, perks, constraintCount);
+ AssignNavigationTargets(perks, null, weapons, playButton, null, constraintCount);
+ playButton.topNav = perks[perks.Count - 1];
+ playButton.leftNav = perks[perks.Count - 1];
+ }
+ playButton.botNav = weapons[0];
+ playButton.rightNav = weapons[0];
+ if (!autoSelectPlay)
+ {
+ GetComponent<UIFrame>().firstSelected = weapons[0];
+ }
+ }
+
+ private void RewriteQuestTexts()
+ {
+ if (!DrawQuests)
+ {
+ return;
+ }
+ for (int num = questsParent.childCount - 1; num >= 0; num--)
+ {
+ Object.Destroy(questsParent.GetChild(num).gameObject);
+ }
+ int num2 = 0;
+ LevelInfo levelInfo = null;
+ if (LevelInteractor.lastActiveLevelInfo != null)
+ {
+ levelInfo = LevelInteractor.lastActiveLevelInfo;
+ }
+ if (levelInfo == null)
+ {
+ levelInfo = LevelProgressManager.instance.GetLevelInfoFromSceneName(SceneManager.GetActiveScene().name);
+ }
+ if (!(levelInfo != null))
+ {
+ return;
+ }
+ foreach (Quest quest in levelInfo.quests)
+ {
+ Object.Instantiate(questEntryPrefab, questsParent).Init(quest, num2, quest.CheckBeaten(levelInfo.LevelData));
+ num2++;
+ }
+ }
+
+ private void UpdatePerkPointsRemainingText()
+ {
+ if (HasFixedLoadout || mode == LocalGamestate.GameMode.EternalTrial)
+ {
+ perksText.text = TextTranslator.Translate("Menu/Perks");
+ }
+ else
+ {
+ perksText.text = TextTranslator.Translate("Menu/Perks") + " (" + equippedPerks.Count + "/" + numberOfPerksAllowedToEquip + ")";
+ }
+ if (mode == LocalGamestate.GameMode.EternalTrial)
+ {
+ currentEternalTrialBalanceText.gameObject.SetActive(value: true);
+ }
+ else if (currentEternalTrialBalanceText != null)
+ {
+ currentEternalTrialBalanceText.gameObject.SetActive(value: false);
+ }
+ }
+
+ private void UpdateMutatorBonusText()
+ {
+ if (!DrawMutators)
+ {
+ return;
+ }
+ if (equippedMutators.Count > 0)
+ {
+ mutatorBonusText.gameObject.SetActive(value: true);
+ float num = 1f;
+ foreach (TFUIEquippable equippedMutator in equippedMutators)
+ {
+ EquippableMutation equippableMutation = equippedMutator.Data as EquippableMutation;
+ if (!(equippableMutation == null))
+ {
+ num *= equippableMutation.scoreMultiplyerOnWin;
+ }
+ }
+ num -= 1f;
+ num *= 100f;
+ string text = "";
+ if (num >= 0f)
+ {
+ text += "+";
+ }
+ text = text + num.ToString("F0") + "%";
+ mutatorBonusText.text = LocalizationManager.GetTermTranslation("Menu/Mutator Bonus Preview") + ": <style=Body Bold>" + text;
+ }
+ else
+ {
+ mutatorBonusText.gameObject.SetActive(value: false);
+ }
+ }
+
+ private void AssignNavigationTargets(List<TFUIEquippable> targetElements, ThronefallUIElement aboveElement, List<TFUIEquippable> aboveList, ThronefallUIElement belowElement, List<TFUIEquippable> belowList, int maxColumns)
+ {
+ for (int i = 0; i < targetElements.Count; i++)
+ {
+ TFUIEquippable tFUIEquippable = targetElements[i];
+ int num = i - 1;
+ int num2 = i + 1;
+ int num3 = i + maxColumns;
+ int num4 = i - maxColumns;
+ if (num < 0)
+ {
+ if (aboveElement != null)
+ {
+ tFUIEquippable.leftNav = aboveElement;
+ }
+ else
+ {
+ tFUIEquippable.leftNav = aboveList[aboveList.Count - 1];
+ }
+ }
+ else
+ {
+ tFUIEquippable.leftNav = targetElements[num];
+ }
+ if (num2 >= targetElements.Count)
+ {
+ if (belowElement != null)
+ {
+ tFUIEquippable.rightNav = belowElement;
+ }
+ else
+ {
+ tFUIEquippable.rightNav = belowList[0];
+ }
+ }
+ else
+ {
+ tFUIEquippable.rightNav = targetElements[num2];
+ }
+ if (num3 >= targetElements.Count)
+ {
+ if (targetElements.Count - i > targetElements.Count % maxColumns)
+ {
+ tFUIEquippable.botNav = targetElements[targetElements.Count - 1];
+ }
+ else if (belowElement != null)
+ {
+ tFUIEquippable.botNav = belowElement;
+ }
+ else
+ {
+ int num5 = i % maxColumns;
+ if (belowList.Count < num5)
+ {
+ tFUIEquippable.botNav = belowList[belowList.Count - 1];
+ }
+ else
+ {
+ tFUIEquippable.botNav = belowList[num5];
+ }
+ }
+ }
+ else
+ {
+ tFUIEquippable.botNav = targetElements[num3];
+ }
+ if (num4 < 0)
+ {
+ if (aboveElement != null)
+ {
+ tFUIEquippable.topNav = aboveElement;
+ continue;
+ }
+ int num6 = i % maxColumns;
+ int num7 = aboveList.Count % maxColumns;
+ if (num6 > num7)
+ {
+ tFUIEquippable.topNav = aboveList[aboveList.Count - 1];
+ continue;
+ }
+ int value = aboveList.Count - num7 + num6;
+ value = Mathf.Clamp(value, 0, aboveList.Count - 1);
+ tFUIEquippable.topNav = aboveList[value];
+ }
+ else
+ {
+ tFUIEquippable.topNav = targetElements[num4];
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LocalGamestate.cs b/Thronefall_v1.57/Thronefall/Thronefall/LocalGamestate.cs
new file mode 100644
index 0000000..8d82a37
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LocalGamestate.cs
@@ -0,0 +1,171 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Events;
+
+public class LocalGamestate : MonoBehaviour
+{
+ public enum GameMode
+ {
+ Classic,
+ EternalTrial
+ }
+
+ public enum State
+ {
+ PreMatch,
+ InMatch,
+ AfterMatchVictory,
+ AfterMatchDefeat
+ }
+
+ private static GameMode selectedGameMode;
+
+ private static bool gameModeSet;
+
+ [SerializeField]
+ private bool autoStartMatch = true;
+
+ [SerializeField]
+ private State currentState;
+
+ [SerializeField]
+ private List<Hp> objectsThatTriggerLoseWhenDestroyed = new List<Hp>();
+
+ [HideInInspector]
+ public UnityEvent OnGameStateChange = new UnityEvent();
+
+ private static LocalGamestate instance;
+
+ private bool playerFrozen;
+
+ [HideInInspector]
+ public bool endScreenShownThisMatch;
+
+ public static GameMode SelectedGameMode
+ {
+ get
+ {
+ return selectedGameMode;
+ }
+ set
+ {
+ selectedGameMode = value;
+ gameModeSet = true;
+ }
+ }
+
+ public static bool GameModeSet => gameModeSet;
+
+ public State CurrentState => currentState;
+
+ public static LocalGamestate Instance => instance;
+
+ public bool PlayerFrozen => playerFrozen;
+
+ private void Awake()
+ {
+ if (instance != null)
+ {
+ Debug.LogWarning("Multiple LocalGamestate Objects detected. Please make sure there is only on LocalGamestate in the scene. Old instance got destroyed.");
+ Object.Destroy(instance.gameObject);
+ }
+ instance = this;
+ }
+
+ private void Start()
+ {
+ LevelProgressManager.instance.GetLevelDataForActiveScene()?.SaveScoreAndStatsToBestIfBest(_endOfMatch: false);
+ if (autoStartMatch)
+ {
+ SetState(State.InMatch);
+ }
+ foreach (Hp item in objectsThatTriggerLoseWhenDestroyed)
+ {
+ if ((bool)item && item.OnKillOrKnockout != null)
+ {
+ item.OnKillOrKnockout.AddListener(OnVitalObjectKill);
+ }
+ }
+ }
+
+ public void SetState(State nextState, bool forceTransition = false, bool immediate = false)
+ {
+ if (currentState == State.AfterMatchVictory || currentState == State.AfterMatchDefeat || (nextState == currentState && !forceTransition))
+ {
+ return;
+ }
+ currentState = nextState;
+ OnGameStateChange.Invoke();
+ if (currentState == State.AfterMatchVictory)
+ {
+ LevelData levelDataForActiveScene = LevelProgressManager.instance.GetLevelDataForActiveScene();
+ if (levelDataForActiveScene != null)
+ {
+ levelDataForActiveScene.beaten = true;
+ }
+ MatchSaveLoadHandler.MarkRunCompleteAndSave();
+ }
+ else
+ {
+ LevelData levelDataForActiveScene2 = LevelProgressManager.instance.GetLevelDataForActiveScene();
+ if (levelDataForActiveScene2 != null)
+ {
+ levelDataForActiveScene2.beaten = false;
+ }
+ }
+ if (CurrentState == State.AfterMatchDefeat)
+ {
+ MusicManager.instance.PlayMusic(null, 3f);
+ }
+ if (currentState == State.AfterMatchVictory || currentState == State.AfterMatchDefeat)
+ {
+ StartCoroutine(WaitThenTriggerEndOfMatchScreen(immediate));
+ }
+ }
+
+ private IEnumerator WaitThenTriggerEndOfMatchScreen(bool immediate = false)
+ {
+ if (currentState == State.AfterMatchVictory)
+ {
+ if (selectedGameMode == GameMode.EternalTrial)
+ {
+ EternalTrialsRunManager.OnVictory();
+ }
+ }
+ else if (currentState == State.AfterMatchDefeat && selectedGameMode == GameMode.EternalTrial)
+ {
+ EternalTrialsRunManager.OnDefeat();
+ }
+ if (immediate)
+ {
+ yield return null;
+ }
+ else
+ {
+ yield return new WaitForSeconds(1f);
+ }
+ if (currentState == State.AfterMatchVictory)
+ {
+ SceneTransitionManager.instance.TransitionFromGameplayToEndScreen(ScoreManager.Instance.CurrentScore, ScoreManager.Instance.VictoryGoldBonus, ScoreManager.Instance.VictoryMutatorBonus, ScoreManager.Instance.VictoryNoRetryBonus);
+ }
+ else
+ {
+ SceneTransitionManager.instance.TransitionFromGameplayToEndScreen(ScoreManager.Instance.CurrentScore, 0, 0, ScoreManager.Instance.DefeatNoRetryBonus);
+ }
+ yield return null;
+ }
+
+ private void OnVitalObjectKill()
+ {
+ if (currentState == State.InMatch)
+ {
+ SetState(State.AfterMatchDefeat);
+ }
+ }
+
+ public void SetPlayerFreezeState(bool frozen)
+ {
+ playerFrozen = frozen;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LocalMatchSaveLoad.cs b/Thronefall_v1.57/Thronefall/Thronefall/LocalMatchSaveLoad.cs
new file mode 100644
index 0000000..1f40955
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LocalMatchSaveLoad.cs
@@ -0,0 +1,137 @@
+using System.Collections;
+using UnityEngine;
+
+public class LocalMatchSaveLoad : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ private static bool currentlyLoadingMatch;
+
+ public bool disableAutomaticSaveLoading;
+
+ private SaveLoadEntity[] allSaveLoadEntities;
+
+ public static bool CurrentlyLoadingMatch => currentlyLoadingMatch;
+
+ private void Awake()
+ {
+ if (!disableAutomaticSaveLoading)
+ {
+ allSaveLoadEntities = Object.FindObjectsOfType<SaveLoadEntity>(includeInactive: true);
+ TryLoad();
+ }
+ }
+
+ private void Start()
+ {
+ if (!disableAutomaticSaveLoading)
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.EternalTrial && EternalTrialsRunManager.CurrentRun.inNight)
+ {
+ LocalGamestate.Instance.SetState(LocalGamestate.State.AfterMatchDefeat);
+ }
+ }
+ }
+
+ [ContextMenu("SAVE")]
+ private void Save()
+ {
+ if (LocalGamestate.Instance.CurrentState != LocalGamestate.State.InMatch || EnemySpawner.instance.Wavenumber >= EnemySpawner.instance.waves.Count - 1)
+ {
+ return;
+ }
+ MatchSaveLoadHandler.InitializeCurrentSave();
+ if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.EternalTrial)
+ {
+ MatchSaveLoadHandler.CurrentSave.etSeed = EternalTrialsRunManager.CurrentRun.currentStageSeed;
+ }
+ SaveLoadEntity[] array = allSaveLoadEntities;
+ foreach (SaveLoadEntity saveLoadEntity in array)
+ {
+ if (!(saveLoadEntity == null))
+ {
+ saveLoadEntity.ExecuteSave();
+ }
+ }
+ MatchSaveLoadHandler.SaveRun();
+ }
+
+ private void TryLoad()
+ {
+ if (!MatchSaveLoadHandler.IsLoadingPermitted)
+ {
+ return;
+ }
+ currentlyLoadingMatch = true;
+ SaveLoadEntity[] array = allSaveLoadEntities;
+ foreach (SaveLoadEntity saveLoadEntity in array)
+ {
+ if (!(saveLoadEntity == null))
+ {
+ saveLoadEntity.ExecuteBeforeMainLoadPass();
+ }
+ }
+ array = allSaveLoadEntities;
+ foreach (SaveLoadEntity saveLoadEntity2 in array)
+ {
+ if (!(saveLoadEntity2 == null))
+ {
+ saveLoadEntity2.ExecuteLoad();
+ }
+ }
+ array = allSaveLoadEntities;
+ foreach (SaveLoadEntity saveLoadEntity3 in array)
+ {
+ if (!(saveLoadEntity3 == null))
+ {
+ saveLoadEntity3.ExecuteAfterMainLoadPass();
+ }
+ }
+ StartCoroutine(SetLoadStatWithDelay());
+ }
+
+ private IEnumerator SetLoadStatWithDelay()
+ {
+ yield return null;
+ yield return null;
+ yield return null;
+ yield return null;
+ yield return null;
+ currentlyLoadingMatch = false;
+ }
+
+ private IEnumerator TriggerDelayedSave()
+ {
+ yield return null;
+ yield return null;
+ yield return null;
+ yield return null;
+ Save();
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ StartCoroutine(TriggerDelayedSave());
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.EternalTrial)
+ {
+ EternalTrialsRunManager.CurrentRun.inNight = false;
+ EternalTrialsRunManager.SaveRun(EternalTrialsRunManager.CurrentRun);
+ }
+ }
+
+ public void OnDusk()
+ {
+ if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.EternalTrial)
+ {
+ EternalTrialsRunManager.CurrentRun.inNight = true;
+ EternalTrialsRunManager.SaveRun(EternalTrialsRunManager.CurrentRun);
+ }
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/LvlSelectTabButton.cs b/Thronefall_v1.57/Thronefall/Thronefall/LvlSelectTabButton.cs
new file mode 100644
index 0000000..45f6b60
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/LvlSelectTabButton.cs
@@ -0,0 +1,51 @@
+using UnityEngine;
+using UnityEngine.EventSystems;
+using UnityEngine.UI;
+
+public class LvlSelectTabButton : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler
+{
+ public int tabNumber;
+
+ private bool mouseIsOver;
+
+ private Color colorBasic;
+
+ private Image image;
+
+ [SerializeField]
+ private Color hoverColor;
+
+ [SerializeField]
+ private Color selectedColor;
+
+ public bool selected;
+
+ private void Start()
+ {
+ image = GetComponent<Image>();
+ colorBasic = image.color;
+ }
+
+ public void OnPointerEnter(PointerEventData eventData)
+ {
+ mouseIsOver = true;
+ }
+
+ public void OnPointerExit(PointerEventData eventData)
+ {
+ mouseIsOver = false;
+ }
+
+ private void Update()
+ {
+ image.color = (mouseIsOver ? hoverColor : colorBasic);
+ if (selected)
+ {
+ image.color = selectedColor;
+ }
+ if (Input.GetMouseButtonDown(0))
+ {
+ _ = mouseIsOver;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ManualAttack.cs b/Thronefall_v1.57/Thronefall/Thronefall/ManualAttack.cs
new file mode 100644
index 0000000..c859463
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ManualAttack.cs
@@ -0,0 +1,306 @@
+using System.Collections.Generic;
+using Rewired;
+using UnityEngine;
+using UnityEngine.Events;
+
+public class ManualAttack : MonoBehaviour
+{
+ public float spawnAttackHeight;
+
+ public List<TargetPriority> targetPriorities = new List<TargetPriority>();
+
+ public Weapon weapon;
+
+ public float cooldownTime = 1f;
+
+ public Transform transformForAttackDirection;
+
+ public Transform attackMarkerPosition;
+
+ public Transform preferredTargetMarkerPosition;
+
+ public bool autoAttack = true;
+
+ public ParticleSystem particlesOnAttack;
+
+ public bool playOneShotOnAttack;
+
+ public ThronefallAudioManager.AudioOneShot oneshotOnAttack;
+
+ public bool allowAttackWithoutTarget;
+
+ protected float cooldown;
+
+ protected float inputBuffer = -1f;
+
+ protected bool isAttacking;
+
+ protected Hp hpPlayer;
+
+ private Player input;
+
+ protected TaggedObject myTaggedObj;
+
+ private DayNightCycle dayNightCycle;
+
+ private PlayerUpgradeManager upgradeManager;
+
+ protected Vector3 lastTargetPos;
+
+ [HideInInspector]
+ public UnityEvent onAttack = new UnityEvent();
+
+ protected AudioSet audioSet;
+
+ private AudioSet.ClipArray caStillOnCooldown;
+
+ private AudioSet.ClipArray caAttackTimedPerfectly;
+
+ private AudioSet.ClipArray caCooldownOver;
+
+ protected ThronefallAudioManager audioManager;
+
+ private bool preferredTargetPreviouslySet;
+
+ protected bool timedActivationPerfectly;
+
+ protected TaggedObject preferredTarget;
+
+ protected TaggedObject target;
+
+ public float AttackDamageMultiplyer => upgradeManager.PlayerDamageMultiplyer;
+
+ public Vector3 LastTargetPos => lastTargetPos;
+
+ public float CooldownPercentage => Mathf.Clamp01(cooldown / cooldownTime);
+
+ public virtual void Start()
+ {
+ upgradeManager = PlayerUpgradeManager.instance;
+ hpPlayer = GetComponentInParent<Hp>();
+ input = ReInput.players.GetPlayer(0);
+ myTaggedObj = GetComponentInParent<TaggedObject>();
+ dayNightCycle = DayNightCycle.Instance;
+ audioSet = ThronefallAudioManager.Instance.audioContent;
+ audioManager = ThronefallAudioManager.Instance;
+ caStillOnCooldown = audioSet.PlayerCantUseActiveAbility;
+ caAttackTimedPerfectly = audioSet.AssasinsTrainingWeaponTimedPerfectly;
+ caCooldownOver = audioSet.ActiveAbilityCooldownReadyToUse;
+ }
+
+ public virtual void Update()
+ {
+ if (autoAttack)
+ {
+ if (hpPlayer.HpValue > 0f)
+ {
+ Tick();
+ }
+ DisableMarkersIfDead();
+ }
+ }
+
+ public void DisableMarkersIfDead()
+ {
+ if (hpPlayer.HpValue <= 0f)
+ {
+ if ((bool)attackMarkerPosition)
+ {
+ attackMarkerPosition.gameObject.SetActive(value: false);
+ }
+ if ((bool)preferredTargetMarkerPosition)
+ {
+ preferredTargetMarkerPosition.gameObject.SetActive(value: false);
+ }
+ cooldown = 0f;
+ preferredTarget = null;
+ }
+ }
+
+ public void Tick()
+ {
+ float num = cooldown;
+ cooldown -= Time.deltaTime;
+ if (num > 0f && cooldown <= 0f && !autoAttack && DayNightCycle.Instance.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ audioManager.PlaySoundAsOneShot(caCooldownOver, 1f, 1f, audioSet.mixGroupFX, 5);
+ }
+ isAttacking = false;
+ HandleAttackUpdate();
+ inputBuffer -= Time.deltaTime;
+ if ((bool)attackMarkerPosition)
+ {
+ if (autoAttack || cooldown <= 0f)
+ {
+ target = FindAttackTarget(_choosePreferredTargetIfPossible: true);
+ if (target == null)
+ {
+ attackMarkerPosition.gameObject.SetActive(value: false);
+ }
+ else
+ {
+ if (autoAttack)
+ {
+ inputBuffer = 0.2f;
+ isAttacking = true;
+ }
+ attackMarkerPosition.gameObject.SetActive(value: true);
+ attackMarkerPosition.position = target.transform.position;
+ }
+ }
+ else
+ {
+ attackMarkerPosition.gameObject.SetActive(value: false);
+ }
+ }
+ if (input.GetButtonDown("Lock Target"))
+ {
+ TaggedObject taggedObject = FindAttackTargetWithInfiniteRange();
+ if (preferredTarget == null)
+ {
+ preferredTarget = taggedObject;
+ if ((bool)preferredTarget && upgradeManager.godlyCurse && (bool)preferredTargetMarkerPosition)
+ {
+ preferredTarget.GetComponent<Hp>().ScaleHp(1f / upgradeManager.godlyCurseDamageMultiplyer);
+ }
+ }
+ else
+ {
+ if (upgradeManager.godlyCurse && (bool)preferredTargetMarkerPosition)
+ {
+ preferredTarget.GetComponent<Hp>().ScaleHp(upgradeManager.godlyCurseDamageMultiplyer);
+ }
+ preferredTarget = null;
+ }
+ }
+ else if (preferredTarget == null && preferredTargetPreviouslySet)
+ {
+ TaggedObject taggedObject2 = FindAttackTargetWithInfiniteRange();
+ if (taggedObject2 != null)
+ {
+ preferredTarget = taggedObject2;
+ if ((bool)preferredTarget && upgradeManager.godlyCurse && (bool)preferredTargetMarkerPosition)
+ {
+ preferredTarget.GetComponent<Hp>().ScaleHp(1f / upgradeManager.godlyCurseDamageMultiplyer);
+ }
+ }
+ }
+ if ((bool)preferredTargetMarkerPosition)
+ {
+ if ((bool)preferredTarget)
+ {
+ preferredTargetMarkerPosition.gameObject.SetActive(value: true);
+ preferredTargetMarkerPosition.position = preferredTarget.transform.position;
+ }
+ else
+ {
+ preferredTargetMarkerPosition.gameObject.SetActive(value: false);
+ }
+ }
+ preferredTargetPreviouslySet = preferredTarget != null;
+ }
+
+ public void TryToAttack()
+ {
+ if (dayNightCycle.CurrentTimestate != 0 || autoAttack)
+ {
+ if (upgradeManager.assassinsTraining)
+ {
+ timedActivationPerfectly = Mathf.Abs(cooldown) < UpgradeAssassinsTraining.instance.activationWindow;
+ }
+ inputBuffer = 0.2f;
+ isAttacking = true;
+ }
+ }
+
+ public void HandleAttackUpdate()
+ {
+ if (!(inputBuffer >= 0f))
+ {
+ return;
+ }
+ if (cooldown > 0f)
+ {
+ if (!autoAttack && cooldown > inputBuffer)
+ {
+ audioManager.PlaySoundAsOneShot(caStillOnCooldown, 1f, Random.Range(1.8f, 2.2f), audioSet.mixGroupFX, 5);
+ inputBuffer = -1f;
+ }
+ return;
+ }
+ inputBuffer = -1f;
+ isAttacking = true;
+ cooldown = cooldownTime;
+ if (timedActivationPerfectly)
+ {
+ cooldown *= UpgradeAssassinsTraining.instance.cooldownMultiForPerfectlyTimedAttacks;
+ audioManager.PlaySoundAsOneShot(caAttackTimedPerfectly, 1f, Random.Range(0.9f, 1.1f), audioSet.mixGroupFX, 4);
+ }
+ Attack();
+ }
+
+ public virtual void Attack()
+ {
+ if ((bool)particlesOnAttack)
+ {
+ particlesOnAttack.Play();
+ }
+ if (playOneShotOnAttack)
+ {
+ ThronefallAudioManager.Oneshot(oneshotOnAttack);
+ }
+ TaggedObject taggedObject = FindAttackTarget(_choosePreferredTargetIfPossible: true);
+ Hp hp = null;
+ if ((bool)taggedObject)
+ {
+ hp = taggedObject.Hp;
+ lastTargetPos = taggedObject.transform.position;
+ weapon.Attack(base.transform.position + spawnAttackHeight * Vector3.up, hp, transformForAttackDirection.forward, myTaggedObj, AttackDamageMultiplyer);
+ onAttack.Invoke();
+ }
+ else if (allowAttackWithoutTarget)
+ {
+ weapon.Attack(base.transform.position + spawnAttackHeight * Vector3.up, null, transformForAttackDirection.forward, myTaggedObj, AttackDamageMultiplyer);
+ onAttack.Invoke();
+ }
+ }
+
+ public virtual TaggedObject FindAttackTarget(bool _choosePreferredTargetIfPossible = false)
+ {
+ if (_choosePreferredTargetIfPossible && (bool)preferredTarget && TagManager.instance.MeasureDistanceToTaggedObject(preferredTarget, base.transform.position) <= targetPriorities[0].range)
+ {
+ return preferredTarget;
+ }
+ for (int i = 0; i < targetPriorities.Count; i++)
+ {
+ TaggedObject taggedObject = targetPriorities[i].FindClosestTaggedObject(base.transform.position);
+ if (taggedObject != null)
+ {
+ return taggedObject;
+ }
+ }
+ return null;
+ }
+
+ public virtual TaggedObject FindAttackTargetWithInfiniteRange(bool _choosePreferredTargetIfPossible = false)
+ {
+ TaggedObject taggedObject = FindAttackTarget(_choosePreferredTargetIfPossible);
+ if ((bool)taggedObject)
+ {
+ return taggedObject;
+ }
+ if (_choosePreferredTargetIfPossible && (bool)preferredTarget && TagManager.instance.MeasureDistanceToTaggedObject(preferredTarget, base.transform.position) <= 1000000f)
+ {
+ return preferredTarget;
+ }
+ for (int i = 0; i < targetPriorities.Count; i++)
+ {
+ TaggedObject taggedObject2 = targetPriorities[i].FindClosestTaggedObjectWithoutMaxDistanceCheck(base.transform.position);
+ if (taggedObject2 != null)
+ {
+ return taggedObject2;
+ }
+ }
+ return null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/MapAchievements.cs b/Thronefall_v1.57/Thronefall/Thronefall/MapAchievements.cs
new file mode 100644
index 0000000..410bb7d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/MapAchievements.cs
@@ -0,0 +1,17 @@
+using System.Collections;
+using UnityEngine;
+
+public class MapAchievements : MonoBehaviour
+{
+ private void Start()
+ {
+ StartCoroutine(GiveMapAchievements());
+ }
+
+ private IEnumerator GiveMapAchievements()
+ {
+ yield return null;
+ yield return null;
+ AchievementManager.GiveCrownsAchievement(LevelProgressManager.instance.CrownsAchieved());
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/MapChoice.cs b/Thronefall_v1.57/Thronefall/Thronefall/MapChoice.cs
new file mode 100644
index 0000000..58ce733
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/MapChoice.cs
@@ -0,0 +1,74 @@
+using System;
+using System.Collections.Generic;
+
+[Serializable]
+public class MapChoice
+{
+ public string mapName;
+
+ public EquippableWeapon containedWeapon;
+
+ public List<EquippablePerk> containedPerks = new List<EquippablePerk>();
+
+ public List<Wave> waves = new List<Wave>();
+
+ public List<WaveInfo> waveInfos = new List<WaveInfo>();
+
+ public int goldAtStart;
+
+ public int id;
+
+ public static MapChoice GenerateNewMapChoice(int numberOfPerks, string mapName, Random generator, int id)
+ {
+ MapChoice mapChoice = new MapChoice();
+ mapChoice.id = id;
+ mapChoice.mapName = mapName;
+ List<EquippableWeapon> list = new List<EquippableWeapon>();
+ List<EquippablePerk> list2 = new List<EquippablePerk>();
+ foreach (MetaLevel metaLevel in PerkManager.instance.MetaLevels)
+ {
+ if (metaLevel.reward is EquippableWeapon)
+ {
+ list.Add(metaLevel.reward as EquippableWeapon);
+ }
+ if (metaLevel.reward is EquippablePerk && !EternalTrialsRunManager.CurrentRun.acquiredPerks.Contains(metaLevel.reward as EquippablePerk))
+ {
+ list2.Add(metaLevel.reward as EquippablePerk);
+ }
+ }
+ foreach (Equippable unlockedEquippable in PerkManager.instance.UnlockedEquippables)
+ {
+ if (unlockedEquippable is EquippableWeapon && !list.Contains(unlockedEquippable as EquippableWeapon))
+ {
+ list.Add(unlockedEquippable as EquippableWeapon);
+ }
+ if (unlockedEquippable is EquippablePerk && !list2.Contains(unlockedEquippable as EquippablePerk) && !EternalTrialsRunManager.CurrentRun.acquiredPerks.Contains(unlockedEquippable as EquippablePerk))
+ {
+ list2.Add(unlockedEquippable as EquippablePerk);
+ }
+ }
+ for (int i = 0; i < numberOfPerks; i++)
+ {
+ if (list2.Count < 1)
+ {
+ break;
+ }
+ int index = generator.Next(0, list2.Count);
+ mapChoice.containedPerks.Add(list2[index]);
+ list2.RemoveAt(index);
+ }
+ mapChoice.containedWeapon = list[generator.Next(0, list.Count)];
+ LevelInfo levelInfoFromSceneName = LevelProgressManager.instance.GetLevelInfoFromSceneName(mapName);
+ mapChoice.waves = levelInfoFromSceneName.enemySpawner.waveGeneratorScript.GenerateWaves(levelInfoFromSceneName.enemySpawner.transform.GetComponentsInChildren<EnemySpawnLine>(), levelInfoFromSceneName, EternalTrialsRunManager.CurrentRun.stage, out var startingGold, EternalTrialsRunManager.CurrentRun.currentStageSeed + mapChoice.id);
+ int num = 1;
+ foreach (Wave wave in mapChoice.waves)
+ {
+ WaveInfo waveInfo = wave.GetWaveInfo();
+ waveInfo.waveNumber = num;
+ mapChoice.waveInfos.Add(waveInfo);
+ num++;
+ }
+ mapChoice.goldAtStart = startingGold;
+ return mapChoice;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/MatchSave.cs b/Thronefall_v1.57/Thronefall/Thronefall/MatchSave.cs
new file mode 100644
index 0000000..ffe7225
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/MatchSave.cs
@@ -0,0 +1,190 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+[Serializable]
+public class MatchSave
+{
+ [Serializable]
+ private class SerializableDictionaryValue<T>
+ {
+ public string key;
+
+ public T value;
+
+ public SerializableDictionaryValue(string _key, T _value)
+ {
+ key = _key;
+ value = _value;
+ }
+ }
+
+ public int etSeed;
+
+ public bool runComplete;
+
+ public bool hadRestarts;
+
+ private Dictionary<string, object> savedEntities = new Dictionary<string, object>();
+
+ public List<Equippable> currentLoadout = new List<Equippable>();
+
+ [SerializeField]
+ private List<SerializableDictionaryValue<string>> stringsToSerialize = new List<SerializableDictionaryValue<string>>();
+
+ [SerializeField]
+ private List<SerializableDictionaryValue<int>> intsToSerialize = new List<SerializableDictionaryValue<int>>();
+
+ [SerializeField]
+ private List<SerializableDictionaryValue<bool>> boolsToSerialize = new List<SerializableDictionaryValue<bool>>();
+
+ [SerializeField]
+ private List<SerializableDictionaryValue<float>> floatsToSerialize = new List<SerializableDictionaryValue<float>>();
+
+ [SerializeField]
+ private List<SerializableDictionaryValue<int[]>> intArraysToSerialize = new List<SerializableDictionaryValue<int[]>>();
+
+ [SerializeField]
+ private List<SerializableDictionaryValue<TagManager.ETag[]>> tagArraysToSerialize = new List<SerializableDictionaryValue<TagManager.ETag[]>>();
+
+ [SerializeField]
+ private List<string> currentLoadoutAsString;
+
+ public bool TryLoadValue<T>(string identifier, ref T value)
+ {
+ if (savedEntities.TryGetValue(identifier, out var value2))
+ {
+ if (value2 is T)
+ {
+ value = (T)value2;
+ return true;
+ }
+ return false;
+ }
+ return false;
+ }
+
+ public void AddValue<T>(string identifier, T value)
+ {
+ if (savedEntities.ContainsKey(identifier))
+ {
+ savedEntities[identifier] = value;
+ }
+ else
+ {
+ savedEntities.Add(identifier, value);
+ }
+ }
+
+ public void ConvertObjectDataToStrings()
+ {
+ FetchLoadout();
+ stringsToSerialize.Clear();
+ boolsToSerialize.Clear();
+ intsToSerialize.Clear();
+ floatsToSerialize.Clear();
+ intArraysToSerialize.Clear();
+ tagArraysToSerialize.Clear();
+ foreach (KeyValuePair<string, object> savedEntity in savedEntities)
+ {
+ if (savedEntity.Value is string)
+ {
+ stringsToSerialize.Add(new SerializableDictionaryValue<string>(savedEntity.Key, (string)savedEntity.Value));
+ }
+ else if (savedEntity.Value is int)
+ {
+ intsToSerialize.Add(new SerializableDictionaryValue<int>(savedEntity.Key, (int)savedEntity.Value));
+ }
+ else if (savedEntity.Value is bool)
+ {
+ boolsToSerialize.Add(new SerializableDictionaryValue<bool>(savedEntity.Key, (bool)savedEntity.Value));
+ }
+ else if (savedEntity.Value is float)
+ {
+ floatsToSerialize.Add(new SerializableDictionaryValue<float>(savedEntity.Key, (float)savedEntity.Value));
+ }
+ else if (savedEntity.Value is int[])
+ {
+ intArraysToSerialize.Add(new SerializableDictionaryValue<int[]>(savedEntity.Key, (int[])savedEntity.Value));
+ }
+ else if (savedEntity.Value is TagManager.ETag[])
+ {
+ tagArraysToSerialize.Add(new SerializableDictionaryValue<TagManager.ETag[]>(savedEntity.Key, (TagManager.ETag[])savedEntity.Value));
+ }
+ }
+ currentLoadoutAsString = new List<string>();
+ foreach (Equippable item in currentLoadout)
+ {
+ currentLoadoutAsString.Add(item.displayName);
+ }
+ }
+
+ public void ConvertStringsToObjectData()
+ {
+ savedEntities.Clear();
+ foreach (SerializableDictionaryValue<string> item in stringsToSerialize)
+ {
+ savedEntities.Add(item.key, item.value);
+ }
+ foreach (SerializableDictionaryValue<int> item2 in intsToSerialize)
+ {
+ savedEntities.Add(item2.key, item2.value);
+ }
+ foreach (SerializableDictionaryValue<float> item3 in floatsToSerialize)
+ {
+ savedEntities.Add(item3.key, item3.value);
+ }
+ foreach (SerializableDictionaryValue<bool> item4 in boolsToSerialize)
+ {
+ savedEntities.Add(item4.key, item4.value);
+ }
+ foreach (SerializableDictionaryValue<int[]> item5 in intArraysToSerialize)
+ {
+ savedEntities.Add(item5.key, item5.value);
+ }
+ foreach (SerializableDictionaryValue<TagManager.ETag[]> item6 in tagArraysToSerialize)
+ {
+ savedEntities.Add(item6.key, item6.value);
+ }
+ currentLoadout = new List<Equippable>();
+ List<Equippable> list = new List<Equippable>();
+ foreach (MetaLevel metaLevel in PerkManager.instance.MetaLevels)
+ {
+ list.Add(metaLevel.reward);
+ }
+ foreach (Equippable unlockedEquippable in PerkManager.instance.UnlockedEquippables)
+ {
+ if (!list.Contains(unlockedEquippable))
+ {
+ list.Add(unlockedEquippable);
+ }
+ }
+ foreach (string item7 in currentLoadoutAsString)
+ {
+ foreach (Equippable item8 in list)
+ {
+ if (item8 != null && item8.displayName == item7)
+ {
+ currentLoadout.Add(item8);
+ break;
+ }
+ }
+ }
+ ApplyLoadout();
+ }
+
+ public void ApplyLoadout()
+ {
+ PerkManager.ClearAllEquipped();
+ foreach (Equippable item in currentLoadout)
+ {
+ PerkManager.SetEquipped(item, _equipped: true);
+ }
+ }
+
+ public void FetchLoadout()
+ {
+ currentLoadout = new List<Equippable>();
+ currentLoadout.AddRange(PerkManager.instance.CurrentlyEquipped);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/MatchSaveLoadHandler.cs b/Thronefall_v1.57/Thronefall/Thronefall/MatchSaveLoadHandler.cs
new file mode 100644
index 0000000..52b8aff
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/MatchSaveLoadHandler.cs
@@ -0,0 +1,136 @@
+using System;
+using System.IO;
+using UnityEngine;
+
+public static class MatchSaveLoadHandler
+{
+ private static string currentMap = "Neuland";
+
+ private static MatchSave currentSave;
+
+ public static bool OverwriteCurrentSave = false;
+
+ private static string SavePath => Application.persistentDataPath + "/" + currentMap + ".json";
+
+ public static bool SaveLoadForbidden => currentMap == "Neuland";
+
+ public static MatchSave CurrentSave => currentSave;
+
+ public static bool IsLoadingPermitted
+ {
+ get
+ {
+ if (CurrentSave == null || OverwriteCurrentSave)
+ {
+ return false;
+ }
+ if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.EternalTrial && (EternalTrialsRunManager.CurrentRun.currentStageSeed != CurrentSave.etSeed || EternalTrialsRunManager.CurrentRun.runComplete))
+ {
+ OverwriteCurrentSave = true;
+ return false;
+ }
+ return true;
+ }
+ }
+
+ public static string GetPathFromIdentifierAndGUID(string guid, string identifier)
+ {
+ return guid + "_" + identifier;
+ }
+
+ public static bool TryLoadValue<T>(string guid, string identifier, ref T value)
+ {
+ return CurrentSave.TryLoadValue(GetPathFromIdentifierAndGUID(guid, identifier), ref value);
+ }
+
+ public static void SaveValue(string guid, string identifier, string value)
+ {
+ CurrentSave.AddValue(GetPathFromIdentifierAndGUID(guid, identifier), value);
+ }
+
+ public static void SaveValue(string guid, string identifier, int value)
+ {
+ CurrentSave.AddValue(GetPathFromIdentifierAndGUID(guid, identifier), value);
+ }
+
+ public static void SaveValue(string guid, string identifier, float value)
+ {
+ CurrentSave.AddValue(GetPathFromIdentifierAndGUID(guid, identifier), value);
+ }
+
+ public static void SaveValue(string guid, string identifier, bool value)
+ {
+ CurrentSave.AddValue(GetPathFromIdentifierAndGUID(guid, identifier), value);
+ }
+
+ public static void SaveValue(string guid, string identifier, int[] value)
+ {
+ CurrentSave.AddValue(GetPathFromIdentifierAndGUID(guid, identifier), value);
+ }
+
+ public static void SaveValue(string guid, string identifier, TagManager.ETag[] value)
+ {
+ CurrentSave.AddValue(GetPathFromIdentifierAndGUID(guid, identifier), value);
+ }
+
+ public static void InitializeCurrentSave()
+ {
+ if (currentSave == null || OverwriteCurrentSave)
+ {
+ currentSave = new MatchSave();
+ }
+ OverwriteCurrentSave = false;
+ }
+
+ public static void SaveRun()
+ {
+ if (currentSave == null)
+ {
+ Debug.Log("No data found to save.");
+ return;
+ }
+ try
+ {
+ currentSave.ConvertObjectDataToStrings();
+ string contents = JsonUtility.ToJson(CurrentSave);
+ File.WriteAllText(SavePath, contents);
+ Debug.Log("Match Data successfully saved.");
+ }
+ catch
+ {
+ Debug.LogError("There has been an error while trying to save the current match data.");
+ }
+ }
+
+ public static void MarkRunCompleteAndSave()
+ {
+ if (currentSave != null)
+ {
+ currentSave.runComplete = true;
+ SaveRun();
+ }
+ }
+
+ public static void TryLoadRun(string mapName)
+ {
+ currentMap = mapName;
+ currentSave = null;
+ try
+ {
+ if (File.Exists(SavePath))
+ {
+ currentSave = JsonUtility.FromJson<MatchSave>(File.ReadAllText(SavePath));
+ currentSave.ConvertStringsToObjectData();
+ Debug.Log("Match Save loaded.");
+ }
+ else
+ {
+ Debug.Log("No Save Data for Match found.");
+ }
+ }
+ catch (Exception ex)
+ {
+ Debug.LogError("There has been an error while trying to load the current match save." + ex);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/MaterialFlasherFX.cs b/Thronefall_v1.57/Thronefall/Thronefall/MaterialFlasherFX.cs
new file mode 100644
index 0000000..ed49ef1
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/MaterialFlasherFX.cs
@@ -0,0 +1,77 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class MaterialFlasherFX : MonoBehaviour
+{
+ public class RendererMaterialPair
+ {
+ public Renderer renderer;
+
+ public Material originalMaterial;
+
+ public RendererMaterialPair(Renderer targetRenderer)
+ {
+ renderer = targetRenderer;
+ originalMaterial = renderer.sharedMaterial;
+ }
+ }
+
+ public List<Renderer> targetRenderers;
+
+ public Material flashMaterial;
+
+ public Material specialFlashMaterial;
+
+ public Material unitSelectedMaterial;
+
+ private bool unitSelected;
+
+ private List<RendererMaterialPair> targetRendererMaterialPairs = new List<RendererMaterialPair>();
+
+ public void SetSelected(bool _selected)
+ {
+ unitSelected = _selected;
+ foreach (RendererMaterialPair targetRendererMaterialPair in targetRendererMaterialPairs)
+ {
+ targetRendererMaterialPair.renderer.sharedMaterial = (unitSelected ? unitSelectedMaterial : targetRendererMaterialPair.originalMaterial);
+ }
+ }
+
+ private void Start()
+ {
+ foreach (Renderer targetRenderer in targetRenderers)
+ {
+ if (!(targetRenderer == null))
+ {
+ targetRendererMaterialPairs.Add(new RendererMaterialPair(targetRenderer));
+ }
+ }
+ }
+
+ private IEnumerator FlashAnimation(float flashTime, Material mat)
+ {
+ foreach (RendererMaterialPair targetRendererMaterialPair in targetRendererMaterialPairs)
+ {
+ targetRendererMaterialPair.renderer.sharedMaterial = mat;
+ }
+ yield return new WaitForSeconds(flashTime);
+ foreach (RendererMaterialPair targetRendererMaterialPair2 in targetRendererMaterialPairs)
+ {
+ targetRendererMaterialPair2.renderer.sharedMaterial = (unitSelected ? unitSelectedMaterial : targetRendererMaterialPair2.originalMaterial);
+ }
+ }
+
+ public void TriggerFlash(bool special, float flashTime = 0.25f)
+ {
+ StopAllCoroutines();
+ if (special)
+ {
+ StartCoroutine(FlashAnimation(flashTime, specialFlashMaterial));
+ }
+ else
+ {
+ StartCoroutine(FlashAnimation(flashTime, flashMaterial));
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/MetaLevel.cs b/Thronefall_v1.57/Thronefall/Thronefall/MetaLevel.cs
new file mode 100644
index 0000000..985a7d4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/MetaLevel.cs
@@ -0,0 +1,9 @@
+using System;
+
+[Serializable]
+public class MetaLevel
+{
+ public int requiredXp;
+
+ public Equippable reward;
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/MillRotor.cs b/Thronefall_v1.57/Thronefall/Thronefall/MillRotor.cs
new file mode 100644
index 0000000..b2ddb0e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/MillRotor.cs
@@ -0,0 +1,44 @@
+using UnityEngine;
+
+public class MillRotor : MonoBehaviour
+{
+ public float rotationSpeed = 90f;
+
+ private float acceleration = 10f;
+
+ private float currentSpeed;
+
+ private DayNightCycle daynight;
+
+ private void Start()
+ {
+ daynight = DayNightCycle.Instance;
+ }
+
+ private void Update()
+ {
+ if (daynight.CurrentTimestate == DayNightCycle.Timestate.Day)
+ {
+ if (currentSpeed < rotationSpeed)
+ {
+ currentSpeed += acceleration * Time.deltaTime;
+ }
+ if (currentSpeed > rotationSpeed)
+ {
+ currentSpeed = rotationSpeed;
+ }
+ }
+ else if (daynight.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ if (currentSpeed > 0f)
+ {
+ currentSpeed -= acceleration * Time.deltaTime;
+ }
+ if (currentSpeed < 0f)
+ {
+ currentSpeed = 0f;
+ }
+ }
+ base.transform.Rotate(0f, currentSpeed * Time.deltaTime, 0f, Space.Self);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Mill_ImprovedPlow.cs b/Thronefall_v1.57/Thronefall/Thronefall/Mill_ImprovedPlow.cs
new file mode 100644
index 0000000..7508fc1
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Mill_ImprovedPlow.cs
@@ -0,0 +1,26 @@
+using UnityEngine;
+
+public class Mill_ImprovedPlow : MonoBehaviour
+{
+ [SerializeField]
+ private BuildSlot buildSlot;
+
+ public Mesh lvl2Mesh;
+
+ public Mesh lvl3Mesh;
+
+ private void OnEnable()
+ {
+ buildSlot.upgrades[1].upgradeBranches[0].replacementMesh = lvl2Mesh;
+ buildSlot.upgrades[2].upgradeBranches[0].replacementMesh = lvl3Mesh;
+ foreach (BuildSlot.UpgradeBranch upgradeBranch in buildSlot.Upgrades[1].upgradeBranches)
+ {
+ upgradeBranch.goldIncomeChange++;
+ }
+ foreach (BuildSlot.UpgradeBranch upgradeBranch2 in buildSlot.Upgrades[2].upgradeBranches)
+ {
+ upgradeBranch2.goldIncomeChange++;
+ }
+ Object.Destroy(base.gameObject);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Mill_ImprovementExplosiveTrap.cs b/Thronefall_v1.57/Thronefall/Thronefall/Mill_ImprovementExplosiveTrap.cs
new file mode 100644
index 0000000..47b8f33
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Mill_ImprovementExplosiveTrap.cs
@@ -0,0 +1,87 @@
+using UnityEngine;
+
+public class Mill_ImprovementExplosiveTrap : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ [SerializeField]
+ private Weapon weaponLvl1;
+
+ [SerializeField]
+ private Weapon weaponLvl2;
+
+ [SerializeField]
+ private Weapon weaponLvl3;
+
+ [SerializeField]
+ private Hp hpOfBuilding;
+
+ [SerializeField]
+ private BuildSlot buildSlot;
+
+ public Mesh lvl2Mesh;
+
+ public Mesh lvl3Mesh;
+
+ private void Start()
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public void OnDusk()
+ {
+ SetCorrectWeapon();
+ }
+
+ private void OnEnable()
+ {
+ buildSlot.upgrades[1].upgradeBranches[0].replacementMesh = lvl2Mesh;
+ buildSlot.upgrades[2].upgradeBranches[0].replacementMesh = lvl3Mesh;
+ SetCorrectWeapon();
+ }
+
+ private void SetCorrectWeapon()
+ {
+ if (buildSlot.Level == 1)
+ {
+ hpOfBuilding.SpwanAttackOnDeath = weaponLvl1;
+ {
+ foreach (BuildSlot item in buildSlot.IsActivatorOf)
+ {
+ item.GetComponentInChildren<Hp>(includeInactive: true).SpwanAttackOnDeath = weaponLvl1;
+ }
+ return;
+ }
+ }
+ if (buildSlot.Level == 2)
+ {
+ hpOfBuilding.SpwanAttackOnDeath = weaponLvl2;
+ {
+ foreach (BuildSlot item2 in buildSlot.IsActivatorOf)
+ {
+ item2.GetComponentInChildren<Hp>(includeInactive: true).SpwanAttackOnDeath = weaponLvl2;
+ }
+ return;
+ }
+ }
+ if (buildSlot.Level != 3)
+ {
+ return;
+ }
+ hpOfBuilding.SpwanAttackOnDeath = weaponLvl3;
+ foreach (BuildSlot item3 in buildSlot.IsActivatorOf)
+ {
+ item3.GetComponentInChildren<Hp>(includeInactive: true).SpwanAttackOnDeath = weaponLvl3;
+ }
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Mill_ImprovementWindSpirits.cs b/Thronefall_v1.57/Thronefall/Thronefall/Mill_ImprovementWindSpirits.cs
new file mode 100644
index 0000000..f4ad209
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Mill_ImprovementWindSpirits.cs
@@ -0,0 +1,119 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class Mill_ImprovementWindSpirits : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ [SerializeField]
+ private BuildSlot buildSlot;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float blockIntervalLvl1 = 1f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float blockIntervalLvl2 = 0.5f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float blockIntervalLvl3 = 0.25f;
+
+ public Mesh lvl2Mesh;
+
+ public Mesh lvl3Mesh;
+
+ private float blockInterval = 1f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float range = 30f;
+
+ [SerializeField]
+ private GameObject fxBlockArrow;
+
+ private float cooldown;
+
+ private TagManager tagManager;
+
+ public List<TagManager.ETag> mustHaveTags = new List<TagManager.ETag>();
+
+ private List<TagManager.ETag> mayNotHaveTags = new List<TagManager.ETag>();
+
+ [SerializeField]
+ private TagManager.ETag giveSelfAndFieldsmillThisTag;
+
+ private void Start()
+ {
+ tagManager = TagManager.instance;
+ cooldown = Random.value * blockInterval;
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ }
+
+ private void Update()
+ {
+ cooldown -= Time.deltaTime;
+ while (cooldown <= 0f)
+ {
+ BlockAnArrow();
+ cooldown += blockInterval;
+ }
+ }
+
+ private void BlockAnArrow()
+ {
+ TaggedObject taggedObject = tagManager.FindClosestTaggedObjectWithTags(base.transform.position, mustHaveTags, mayNotHaveTags);
+ if (!(taggedObject == null) && (taggedObject.transform.position - base.transform.position).magnitude < range)
+ {
+ if ((bool)fxBlockArrow)
+ {
+ Object.Instantiate(fxBlockArrow, taggedObject.transform.position, Quaternion.identity);
+ }
+ Object.Destroy(taggedObject.gameObject);
+ }
+ }
+
+ private void OnEnable()
+ {
+ buildSlot.upgrades[1].upgradeBranches[0].replacementMesh = lvl2Mesh;
+ buildSlot.upgrades[2].upgradeBranches[0].replacementMesh = lvl3Mesh;
+ GetComponentInParent<TaggedObject>().AddTag(giveSelfAndFieldsmillThisTag);
+ foreach (BuildSlot item in GetComponentInParent<BuildSlot>().BuiltSlotsThatRelyOnThisBuilding)
+ {
+ item.GetComponentInChildren<TaggedObject>(includeInactive: true).AddTag(giveSelfAndFieldsmillThisTag);
+ }
+ SetCorrectWeapon();
+ }
+
+ public void OnDusk()
+ {
+ SetCorrectWeapon();
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ private void SetCorrectWeapon()
+ {
+ if (buildSlot.Level == 1)
+ {
+ blockInterval = blockIntervalLvl1;
+ }
+ else if (buildSlot.Level == 2)
+ {
+ blockInterval = blockIntervalLvl2;
+ }
+ else if (buildSlot.Level == 3)
+ {
+ blockInterval = blockIntervalLvl3;
+ }
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Mill_Improvement_Scarecrows.cs b/Thronefall_v1.57/Thronefall/Thronefall/Mill_Improvement_Scarecrows.cs
new file mode 100644
index 0000000..7a7a51e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Mill_Improvement_Scarecrows.cs
@@ -0,0 +1,26 @@
+using UnityEngine;
+
+public class Mill_Improvement_Scarecrows : MonoBehaviour
+{
+ [SerializeField]
+ private BuildSlot buildSlot;
+
+ public Mesh lvl2Mesh;
+
+ public Mesh lvl3Mesh;
+
+ private void OnEnable()
+ {
+ buildSlot.upgrades[1].upgradeBranches[0].replacementMesh = lvl2Mesh;
+ buildSlot.upgrades[2].upgradeBranches[0].replacementMesh = lvl3Mesh;
+ foreach (BuildSlot item in buildSlot.BuiltSlotsThatRelyOnThisBuilding)
+ {
+ Scarecrow[] components = item.GetComponents<Scarecrow>();
+ foreach (Scarecrow scarecrow in components)
+ {
+ scarecrow.scareCrow.SetActive(value: true);
+ item.Upgrades[0].upgradeBranches[0].objectsToActivate.Add(scarecrow.scareCrow);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/MineShaft.cs b/Thronefall_v1.57/Thronefall/Thronefall/MineShaft.cs
new file mode 100644
index 0000000..5bcff2c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/MineShaft.cs
@@ -0,0 +1,216 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class MineShaft : IncomeModifyer, ISaveLoad
+{
+ public int incomeReductionPerTurn = 1;
+
+ public int minimumIncome = 1;
+
+ public Equippable sustainableMiningPerk;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public int minimumIncomeWithSustainableMining = 3;
+
+ private PlayerManager playerManager;
+
+ public Transform mineEntrance;
+
+ [SerializeField]
+ private float mineEnterDistance = 3f;
+
+ [SerializeField]
+ private float mineEnterAngleDotProd = 0.8f;
+
+ [SerializeField]
+ private float playerEnterTimerMax = 0.75f;
+
+ [SerializeField]
+ private float cooldownAfterTeleport = 1f;
+
+ private float playerEnterTimer;
+
+ public static List<MineShaft> allMineShafts = new List<MineShaft>();
+
+ private BuildSlot myBuildSlot;
+
+ private float cooldown;
+
+ private int loadedIncomeDecreaseLevel;
+
+ private int currentIncomeDecreaseLevel;
+
+ private bool initialized;
+
+ public BuildSlot MyBuildSlot => myBuildSlot;
+
+ public void SetCooldown(float _cooldown)
+ {
+ cooldown = _cooldown;
+ }
+
+ private void Initialize()
+ {
+ if (!initialized)
+ {
+ myBuildSlot = GetComponent<BuildSlot>();
+ myBuildSlot.Interactor.IncomeModifiers.Add(this);
+ initialized = true;
+ }
+ }
+
+ private void Start()
+ {
+ playerManager = PlayerManager.Instance;
+ if (!initialized)
+ {
+ Initialize();
+ }
+ playerEnterTimer = playerEnterTimerMax;
+ if (!allMineShafts.Contains(this))
+ {
+ allMineShafts.Add(this);
+ }
+ for (int num = allMineShafts.Count - 1; num >= 0; num--)
+ {
+ if (allMineShafts[num] == null)
+ {
+ allMineShafts.RemoveAt(num);
+ }
+ }
+ SortAllMineShafts();
+ }
+
+ private void SortAllMineShafts()
+ {
+ allMineShafts.Sort(delegate(MineShaft mineShaft1, MineShaft mineShaft2)
+ {
+ Vector3 position = mineShaft1.gameObject.transform.position;
+ Vector3 position2 = mineShaft2.gameObject.transform.position;
+ int num = position.z.CompareTo(position2.z);
+ if (num != 0)
+ {
+ return num;
+ }
+ int num2 = position.x.CompareTo(position2.x);
+ return (num2 != 0) ? num2 : position.y.CompareTo(position2.y);
+ });
+ }
+
+ public static MineShaft FindNextMineShaftAfter(int _i)
+ {
+ for (int num = (_i + 1) % allMineShafts.Count; num != _i; num = (num + 1) % allMineShafts.Count)
+ {
+ MineShaft mineShaft = allMineShafts[num];
+ if (mineShaft.MyBuildSlot.Level > 0 && mineShaft.buildingInteractor.buildingHP.TaggedObj.Tags.Contains(TagManager.ETag.AUTO_Alive))
+ {
+ return mineShaft;
+ }
+ }
+ return null;
+ }
+
+ private void Update()
+ {
+ cooldown -= Time.deltaTime;
+ if (MyBuildSlot.Level <= 0 || !buildingInteractor.buildingHP.TaggedObj.Tags.Contains(TagManager.ETag.AUTO_Alive) || cooldown > 0f)
+ {
+ return;
+ }
+ bool flag = false;
+ PlayerMovement[] registeredPlayers = playerManager.RegisteredPlayers;
+ foreach (PlayerMovement playerMovement in registeredPlayers)
+ {
+ if (!((mineEntrance.position - playerMovement.transform.position).magnitude < mineEnterDistance) || !(Vector3.Dot(mineEntrance.localToWorldMatrix.MultiplyVector(new Vector3(0f, 0f, 1f)).normalized, playerMovement.Velocity.normalized) > mineEnterAngleDotProd))
+ {
+ continue;
+ }
+ playerEnterTimer -= Time.deltaTime;
+ flag = true;
+ if (playerEnterTimer <= 0f)
+ {
+ MineShaft mineShaft = FindNextMineShaftAfter(allMineShafts.IndexOf(this));
+ if ((bool)mineShaft)
+ {
+ Vector3 position = mineShaft.transform.position;
+ position += mineShaft.mineEntrance.localToWorldMatrix.MultiplyVector(new Vector3(0f, 0f, -1f));
+ playerMovement.TeleportTo(position);
+ mineShaft.SetCooldown(cooldownAfterTeleport);
+ SetCooldown(cooldownAfterTeleport);
+ }
+ }
+ }
+ if (!flag)
+ {
+ playerEnterTimer = playerEnterTimerMax;
+ }
+ }
+
+ public override void OnDawn()
+ {
+ DecreaseIncome();
+ }
+
+ private void DecreaseIncome()
+ {
+ if (myBuildSlot.Level > 0 && !buildingInteractor.KnockedOutTonight)
+ {
+ currentIncomeDecreaseLevel++;
+ SetIncome();
+ }
+ }
+
+ private void ForceDecreaseIncome()
+ {
+ currentIncomeDecreaseLevel++;
+ SetIncome();
+ }
+
+ private void SetIncome()
+ {
+ if (PerkManager.IsEquipped(sustainableMiningPerk))
+ {
+ myBuildSlot.GoldIncome = Mathf.Max(myBuildSlot.GoldIncome - incomeReductionPerTurn, minimumIncomeWithSustainableMining);
+ }
+ else
+ {
+ myBuildSlot.GoldIncome = Mathf.Max(myBuildSlot.GoldIncome - incomeReductionPerTurn, minimumIncome);
+ }
+ }
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ if (!initialized)
+ {
+ Initialize();
+ }
+ loadedIncomeDecreaseLevel = 0;
+ MatchSaveLoadHandler.TryLoadValue(guid, "currentIncomeDecreaseLevel", ref loadedIncomeDecreaseLevel);
+ myBuildSlot.OnAfterDelayedLoadFinished.AddListener(ExecuteDelayedLoad);
+ }
+
+ private void ExecuteDelayedLoad()
+ {
+ if (!initialized)
+ {
+ Initialize();
+ }
+ for (int i = 0; i < loadedIncomeDecreaseLevel; i++)
+ {
+ ForceDecreaseIncome();
+ }
+ }
+
+ public void OnSave(string guid)
+ {
+ MatchSaveLoadHandler.SaveValue(guid, "currentIncomeDecreaseLevel", currentIncomeDecreaseLevel);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ModeRulesDisplay.cs b/Thronefall_v1.57/Thronefall/Thronefall/ModeRulesDisplay.cs
new file mode 100644
index 0000000..481aaba
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ModeRulesDisplay.cs
@@ -0,0 +1,31 @@
+using TMPro;
+using UnityEngine;
+
+public class ModeRulesDisplay : MonoBehaviour
+{
+ public TextMeshProUGUI rulesDisplay;
+
+ public GameObject modeRulePanel;
+
+ public UIParentResizer sizer;
+
+ public void Refresh()
+ {
+ LevelInfo levelInfo = null;
+ levelInfo = ((!(LevelInteractor.lastActiveLevelInfo != null)) ? LevelProgressManager.instance.GetLevelInfoFromCurrentSceneName() : LevelInteractor.lastActiveLevelInfo);
+ if (levelInfo == null)
+ {
+ modeRulePanel.SetActive(value: false);
+ }
+ else if (levelInfo.displayModeDescription.Length > 0)
+ {
+ rulesDisplay.text = levelInfo.displayModeDescription;
+ modeRulePanel.SetActive(value: true);
+ sizer.Trigger();
+ }
+ else
+ {
+ modeRulePanel.SetActive(value: false);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Moleman.cs b/Thronefall_v1.57/Thronefall/Thronefall/Moleman.cs
new file mode 100644
index 0000000..a1bcf20
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Moleman.cs
@@ -0,0 +1,168 @@
+using System;
+using System.Collections;
+using UnityEngine;
+
+public class Moleman : MonoBehaviour
+{
+ private PathfindMovementEnemy enemyMovement;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float nextTeleportIn = 3f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float teleportIntervalMin = 6f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float teleportIntervalMax = 6f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ [Range(0f, 1f)]
+ private float teleportTowardsTargetAmount = 0.5f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float targetDistanceMin = 0.5f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float targetDistanceMax = 20f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float maxTunnelingDistance = 20f;
+
+ [SerializeField]
+ private Transform aliveParent;
+
+ [SerializeField]
+ private GameObject meshParent;
+
+ [SerializeField]
+ private AutoAttack autoAttack;
+
+ [SerializeField]
+ private float digDepth = 2.5f;
+
+ [SerializeField]
+ private GameObject spawnOnDigDown;
+
+ [SerializeField]
+ private GameObject spawnOnDigUp;
+
+ [SerializeField]
+ private ParticleSystem digDownFX;
+
+ [SerializeField]
+ private ParticleSystem digUpFX;
+
+ [SerializeField]
+ private AudioSource digAudioSource;
+
+ [SerializeField]
+ private Vector2 digAudioPitchRange = new Vector2(1f, 1f);
+
+ [SerializeField]
+ private float animationSpeed = 2f;
+
+ [SerializeField]
+ private float digTrevelingSpeed = 2f;
+
+ private bool lastInAnim;
+
+ private bool teleportAnimRunning;
+
+ private void Start()
+ {
+ enemyMovement = GetComponent<PathfindMovementEnemy>();
+ }
+
+ private void Update()
+ {
+ if (!teleportAnimRunning)
+ {
+ nextTeleportIn -= Time.deltaTime;
+ if (nextTeleportIn <= 0f)
+ {
+ nextTeleportIn = Mathf.Lerp(teleportIntervalMin, teleportIntervalMax, UnityEngine.Random.value);
+ StartCoroutine(TeleportAnimation());
+ }
+ }
+ }
+
+ private IEnumerator TeleportAnimation()
+ {
+ teleportAnimRunning = true;
+ autoAttack.enabled = false;
+ InstantiateHere(spawnOnDigDown);
+ if ((bool)digDownFX)
+ {
+ digDownFX.Play();
+ }
+ for (float t3 = 1f; t3 > 0f; t3 -= Time.deltaTime * animationSpeed)
+ {
+ DigAnimation(t3);
+ yield return null;
+ }
+ Vector3 targetPos = Vector3.Lerp(base.transform.position, enemyMovement.SeekToTargetPosSnappedtoNavmesh, teleportTowardsTargetAmount);
+ float f = UnityEngine.Random.Range(0f, MathF.PI * 2f);
+ float num = UnityEngine.Random.Range(targetDistanceMin, targetDistanceMax);
+ Vector3 vector = new Vector3(Mathf.Cos(f) * num, 0f, Mathf.Sin(f) * num);
+ targetPos += vector;
+ targetPos = base.transform.position + (targetPos - base.transform.position).normalized * Mathf.Min((targetPos - base.transform.position).magnitude, maxTunnelingDistance);
+ meshParent.SetActive(value: false);
+ Vector3 startPos = base.transform.position;
+ targetPos = enemyMovement.GetNearestGroundPosition(targetPos);
+ float distance = (startPos - targetPos).magnitude;
+ for (float t3 = 0f; t3 < 1f; t3 += Time.deltaTime * digTrevelingSpeed / distance)
+ {
+ base.transform.position = Vector3.Lerp(startPos, targetPos, t3);
+ yield return null;
+ }
+ base.transform.position = targetPos;
+ meshParent.SetActive(value: true);
+ InstantiateHere(spawnOnDigUp);
+ if ((bool)digUpFX)
+ {
+ digUpFX.Play();
+ }
+ if ((bool)digAudioSource)
+ {
+ digAudioSource.pitch = UnityEngine.Random.Range(digAudioPitchRange.x, digAudioPitchRange.y);
+ digAudioSource.PlayOneShot(digAudioSource.clip);
+ }
+ for (float t3 = 0f; t3 < 1f; t3 += Time.deltaTime * animationSpeed)
+ {
+ DigAnimation(t3);
+ yield return null;
+ }
+ enemyMovement.OriginalPathRequest();
+ aliveParent.localRotation = Quaternion.identity;
+ aliveParent.localPosition = Vector3.zero;
+ teleportAnimRunning = false;
+ autoAttack.enabled = true;
+ }
+
+ private void DigAnimation(float _t)
+ {
+ enemyMovement.ClearCurrentPath();
+ aliveParent.localRotation = Quaternion.Euler(0f, _t * 1000f, 0f);
+ float num = (1f - _t) * (_t - 0.3f) * 3.333f;
+ aliveParent.localPosition = new Vector3(0f, num * digDepth, 0f);
+ }
+
+ private void InstantiateHere(GameObject _go)
+ {
+ if ((bool)_go)
+ {
+ FireArcherBurn component = UnityEngine.Object.Instantiate(_go, base.transform.position, Quaternion.identity).GetComponent<FireArcherBurn>();
+ if ((bool)component)
+ {
+ component.DamageMultiplyer = GetComponent<AutoAttack>().DamageMultiplyer;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/MusicManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/MusicManager.cs
new file mode 100644
index 0000000..9b779bb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/MusicManager.cs
@@ -0,0 +1,163 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class MusicManager : MonoBehaviour
+{
+ [Serializable]
+ public class OverrideVolume
+ {
+ public AudioClip audioClip;
+
+ [Range(0f, 1f)]
+ public float volume;
+
+ public OverrideVolume(AudioClip clip, float volume)
+ {
+ audioClip = clip;
+ this.volume = volume;
+ }
+ }
+
+ public static MusicManager instance;
+
+ [SerializeField]
+ private AudioSource audioSource;
+
+ private AudioClip currentMusic;
+
+ private Coroutine fadeCoroutine;
+
+ private float currentVolume;
+
+ [SerializeField]
+ private AudioClip[] resumeableMusicClips;
+
+ private Dictionary<AudioClip, float> resumeableMusicPlaybackPositions = new Dictionary<AudioClip, float>();
+
+ [SerializeField]
+ private List<OverrideVolume> overrideVolumes = new List<OverrideVolume>();
+
+ private float CurrentVolume
+ {
+ get
+ {
+ return currentVolume;
+ }
+ set
+ {
+ float num = value;
+ currentVolume = value;
+ OverrideVolume overrideVolume = overrideVolumes.Find((OverrideVolume o) => o.audioClip == currentMusic);
+ if (overrideVolume != null)
+ {
+ num *= overrideVolume.volume;
+ }
+ audioSource.volume = Mathf.Pow(num, 2f);
+ }
+ }
+
+ private void Awake()
+ {
+ if (instance != null)
+ {
+ UnityEngine.Object.Destroy(base.gameObject);
+ return;
+ }
+ instance = this;
+ CurrentVolume = 0f;
+ AudioClip[] array = resumeableMusicClips;
+ foreach (AudioClip key in array)
+ {
+ resumeableMusicPlaybackPositions.Add(key, 0f);
+ }
+ }
+
+ public void PlayMusic(AudioClip music, float fadeDuration = 4f)
+ {
+ if (currentMusic == music)
+ {
+ return;
+ }
+ if (music == null && currentMusic != null)
+ {
+ StartCoroutine(FadeOutAndStop(fadeDuration));
+ return;
+ }
+ if (fadeCoroutine != null)
+ {
+ StopCoroutine(fadeCoroutine);
+ }
+ fadeCoroutine = StartCoroutine(FadeOutChangeMusicFadeIn(music, fadeDuration));
+ }
+
+ private IEnumerator FadeOutChangeMusicFadeIn(AudioClip newMusic, float fadeDuration)
+ {
+ if (currentMusic != null)
+ {
+ if (resumeableMusicPlaybackPositions.ContainsKey(currentMusic))
+ {
+ resumeableMusicPlaybackPositions[currentMusic] = audioSource.time;
+ }
+ yield return StartCoroutine(FadeOut(fadeDuration));
+ }
+ CurrentVolume = 0f;
+ audioSource.clip = newMusic;
+ currentMusic = newMusic;
+ if (resumeableMusicPlaybackPositions.ContainsKey(newMusic))
+ {
+ audioSource.time = resumeableMusicPlaybackPositions[newMusic];
+ }
+ else
+ {
+ audioSource.time = 0f;
+ }
+ audioSource.Play();
+ yield return null;
+ yield return StartCoroutine(FadeIn(fadeDuration));
+ }
+
+ private IEnumerator FadeOutAndStop(float fadeDuration)
+ {
+ yield return StartCoroutine(FadeOut(fadeDuration));
+ if (currentMusic != null && resumeableMusicPlaybackPositions.ContainsKey(currentMusic))
+ {
+ resumeableMusicPlaybackPositions[currentMusic] = audioSource.time;
+ }
+ audioSource.Stop();
+ currentMusic = null;
+ }
+
+ private IEnumerator FadeOut(float fadeDuration)
+ {
+ if (fadeDuration <= 0f)
+ {
+ CurrentVolume = 0f;
+ yield break;
+ }
+ float fadeSpeed = 1f / fadeDuration;
+ while (CurrentVolume > 0f)
+ {
+ CurrentVolume -= fadeSpeed * Time.unscaledDeltaTime;
+ yield return null;
+ }
+ CurrentVolume = 0f;
+ }
+
+ private IEnumerator FadeIn(float fadeDuration)
+ {
+ if (fadeDuration <= 0f)
+ {
+ CurrentVolume = 1f;
+ yield break;
+ }
+ float fadeSpeed = 1f / fadeDuration;
+ while (CurrentVolume < 1f)
+ {
+ CurrentVolume += fadeSpeed * Time.unscaledDeltaTime;
+ yield return null;
+ }
+ CurrentVolume = 1f;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/NavmeshBakeHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/NavmeshBakeHelper.cs
new file mode 100644
index 0000000..0900d62
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/NavmeshBakeHelper.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class NavmeshBakeHelper : MonoBehaviour
+{
+ [SerializeField]
+ private GameObject invisibleWalls;
+
+ [SerializeField]
+ private GameObject flyerSurface;
+
+ [SerializeField]
+ private Vector3 center;
+
+ [SerializeField]
+ private Vector3 size;
+
+ [SerializeField]
+ private Vector3 rotation;
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/NightCall.cs b/Thronefall_v1.57/Thronefall/Thronefall/NightCall.cs
new file mode 100644
index 0000000..0e3dfc1
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/NightCall.cs
@@ -0,0 +1,144 @@
+using MoreMountains.Feedbacks;
+using MPUIKIT;
+using Rewired;
+using TMPro;
+using UnityEngine;
+
+public class NightCall : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ public static NightCall instance;
+
+ public float nightCallTime = 1f;
+
+ public MPImage targetGraphic;
+
+ public MPImage targetFill;
+
+ public MPImage background;
+
+ public TextMeshProUGUI nightCallCueText;
+
+ public TextMeshProUGUI nightCallTimeText;
+
+ public MMF_Player fullFeedback;
+
+ public AnimationCurve textCueScaleCurve;
+
+ public RectTransform scaleParent;
+
+ public AudioSource nightCallAudio;
+
+ private Player input;
+
+ private bool active = true;
+
+ private float currentFill;
+
+ private PlayerInteraction player;
+
+ private Color defaultBackgroundColor;
+
+ private float nightCallTargetVolume;
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ private void Start()
+ {
+ input = ReInput.players.GetPlayer(0);
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ targetFill.transform.localScale = Vector3.zero;
+ player = PlayerInteraction.instance;
+ defaultBackgroundColor = background.color;
+ nightCallTargetVolume = nightCallAudio.volume;
+ }
+
+ private void Update()
+ {
+ UpdateFill();
+ }
+
+ public void UpdateFill()
+ {
+ if (active)
+ {
+ if (SettingsManager.Instance.UseLargeInGameUI)
+ {
+ scaleParent.localScale = Vector3.one * 1.5f;
+ }
+ else
+ {
+ scaleParent.localScale = Vector3.one;
+ }
+ if (input.GetButtonDown("Call Night") && player.IsFreeToCallNight && !DayNightCycle.Instance.IsInAutoMode)
+ {
+ nightCallAudio.Stop();
+ nightCallAudio.PlayOneShot(ThronefallAudioManager.Instance.audioContent.NightCallStart, 0.45f);
+ }
+ if (input.GetButton("Call Night") && player.IsFreeToCallNight && !DayNightCycle.Instance.IsInAutoMode)
+ {
+ currentFill += Time.deltaTime * (1f / nightCallTime);
+ }
+ else
+ {
+ currentFill -= Time.deltaTime * 2f * (1f / nightCallTime);
+ }
+ if (currentFill >= 1f)
+ {
+ nightCallAudio.PlayOneShot(ThronefallAudioManager.Instance.audioContent.NightCallComplete, 0.8f);
+ DayNightCycle.Instance.SwitchToNight();
+ fullFeedback.PlayFeedbacks();
+ active = false;
+ }
+ if (currentFill > 0f)
+ {
+ nightCallCueText.gameObject.SetActive(value: true);
+ nightCallTimeText.text = (nightCallTime * (1f - currentFill)).ToString("F1") + "s";
+ nightCallCueText.transform.localScale = Vector3.one * textCueScaleCurve.Evaluate(Mathf.InverseLerp(0f, 0.15f, currentFill));
+ nightCallAudio.volume = Mathf.Lerp(0f, nightCallTargetVolume, Mathf.InverseLerp(0f, 0.3f, currentFill));
+ }
+ else
+ {
+ nightCallCueText.gameObject.SetActive(value: false);
+ nightCallCueText.transform.localScale = Vector3.one;
+ }
+ defaultBackgroundColor.a = Mathf.InverseLerp(0f, 0.4f, currentFill);
+ background.color = defaultBackgroundColor;
+ currentFill = Mathf.Clamp01(currentFill);
+ targetGraphic.fillAmount = currentFill;
+ }
+ else if (currentFill > 0f)
+ {
+ currentFill -= Time.deltaTime * 2f;
+ defaultBackgroundColor.a = Mathf.InverseLerp(0f, 0.4f, currentFill);
+ background.color = defaultBackgroundColor;
+ }
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ targetFill.transform.localScale = Vector3.zero;
+ targetGraphic.transform.localScale = Vector3.one;
+ targetGraphic.fillAmount = 0f;
+ nightCallCueText.gameObject.SetActive(value: false);
+ nightCallCueText.transform.localScale = Vector3.one;
+ defaultBackgroundColor.a = 0f;
+ background.color = defaultBackgroundColor;
+ currentFill = 0f;
+ active = true;
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public void OnDusk()
+ {
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/NightLight.cs b/Thronefall_v1.57/Thronefall/Thronefall/NightLight.cs
new file mode 100644
index 0000000..49efdb4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/NightLight.cs
@@ -0,0 +1,106 @@
+using System.Collections;
+using UnityEngine;
+
+[RequireComponent(typeof(Light))]
+public class NightLight : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ public float targetIntensity = 0.75f;
+
+ public float intensityFlickerRange = 0.15f;
+
+ public float distanceFlickerRange = 5f;
+
+ public float flickerSpeed = 1f;
+
+ public float fadeInTime = 2.5f;
+
+ public float fadeOutTime = 1f;
+
+ public ParticleSystem flames;
+
+ private float transitionTime;
+
+ private float targetRange;
+
+ private Light targetLight;
+
+ private bool fullyFadedIn;
+
+ private float currentIntensity => targetIntensity + Mathf.Lerp(0f - intensityFlickerRange, intensityFlickerRange, Mathf.PerlinNoise(Time.time * flickerSpeed, Time.time * flickerSpeed));
+
+ private float currentRange => targetRange + Mathf.Lerp(0f - distanceFlickerRange, distanceFlickerRange, Mathf.PerlinNoise(Time.time * flickerSpeed, Time.time * flickerSpeed));
+
+ private void Start()
+ {
+ transitionTime = DayNightCycle.Instance.sunriseTime;
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ targetLight = GetComponent<Light>();
+ targetLight.intensity = 0f;
+ targetRange = targetLight.range;
+ if ((bool)ColorAndLightManager.Instance)
+ {
+ ColorAndLightManager.Instance.RegisterBonfireLight(targetLight);
+ }
+ base.gameObject.SetActive(value: false);
+ }
+
+ private void Update()
+ {
+ if (fullyFadedIn)
+ {
+ targetLight.intensity = currentIntensity;
+ }
+ targetLight.range = currentRange;
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ StopAllCoroutines();
+ StartCoroutine(FadeLightOut());
+ }
+
+ public void OnDusk()
+ {
+ base.gameObject.SetActive(value: true);
+ StopAllCoroutines();
+ StartCoroutine(FadeLightIn());
+ }
+
+ private IEnumerator FadeLightIn()
+ {
+ fullyFadedIn = false;
+ float clock = 0f;
+ yield return new WaitForSeconds(transitionTime * 0.1f);
+ flames.Play();
+ while (clock < fadeInTime)
+ {
+ clock += Time.deltaTime;
+ targetLight.intensity = currentIntensity * Mathf.InverseLerp(0f, fadeInTime, clock);
+ yield return null;
+ }
+ targetLight.intensity = targetIntensity;
+ fullyFadedIn = true;
+ }
+
+ private IEnumerator FadeLightOut()
+ {
+ float clock = 0f;
+ flames.Stop();
+ while (clock < fadeOutTime)
+ {
+ clock += Time.deltaTime;
+ targetLight.intensity = currentIntensity * Mathf.InverseLerp(fadeOutTime, 0f, clock);
+ yield return null;
+ }
+ targetLight.intensity = 0f;
+ base.gameObject.SetActive(value: false);
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/NightPreviewElement.cs b/Thronefall_v1.57/Thronefall/Thronefall/NightPreviewElement.cs
new file mode 100644
index 0000000..6171da0
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/NightPreviewElement.cs
@@ -0,0 +1,42 @@
+using System.Collections.Generic;
+using System.Linq;
+using TMPro;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class NightPreviewElement : MonoBehaviour
+{
+ public TFUIEnemy enemyTFUIPrefab;
+
+ public TextMeshProUGUI number;
+
+ public List<TFUIEnemy> enemyTFUIs = new List<TFUIEnemy>();
+
+ public void SetData(WaveInfo info)
+ {
+ foreach (TFUIEnemy enemyTFUI in enemyTFUIs)
+ {
+ enemyTFUI.gameObject.SetActive(value: false);
+ }
+ int num = info.enemies.Count - enemyTFUIs.Count;
+ for (int i = 0; i < num; i++)
+ {
+ enemyTFUIs.Add(Object.Instantiate(enemyTFUIPrefab, base.transform));
+ }
+ info.enemies = info.enemies.OrderBy((WaveEnemyInfo o) => o.enemyCount).ToList();
+ for (int j = 0; j < info.enemies.Count; j++)
+ {
+ enemyTFUIs[j].gameObject.SetActive(value: true);
+ enemyTFUIs[j].SetDataSimple(info.enemies[j]);
+ }
+ number.text = info.waveNumber + ".";
+ Canvas.ForceUpdateCanvases();
+ GetComponent<HorizontalLayoutGroup>().SetLayoutHorizontal();
+ }
+
+ private void OnEnable()
+ {
+ Canvas.ForceUpdateCanvases();
+ GetComponent<HorizontalLayoutGroup>().SetLayoutHorizontal();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Nighthorn.cs b/Thronefall_v1.57/Thronefall/Thronefall/Nighthorn.cs
new file mode 100644
index 0000000..b6965d6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Nighthorn.cs
@@ -0,0 +1,172 @@
+using MoreMountains.Feedbacks;
+using UnityEngine;
+
+public class Nighthorn : InteractorBase, DayNightCycle.IDaytimeSensitive
+{
+ public static Nighthorn instance;
+
+ public GameObject nightCue;
+
+ public GameObject harvestCue;
+
+ public string autoCollectGoldTooltip;
+
+ public string startNightTooltip;
+
+ public string startPreFinalNightTooltip;
+
+ public string startFinalNightTooltip;
+
+ public MMF_Player onBlowFeedback;
+
+ private TutorialManager tutorialManager;
+
+ public int CoinCountToBeHarvested
+ {
+ get
+ {
+ int num = 0;
+ foreach (BuildingInteractor playerBuildingInteractor in TagManager.instance.playerBuildingInteractors)
+ {
+ if ((bool)playerBuildingInteractor.coinSpawner)
+ {
+ num += playerBuildingInteractor.coinSpawner.CoinsLeft;
+ }
+ if (playerBuildingInteractor.canBeHarvested)
+ {
+ num += playerBuildingInteractor.GoldIncome;
+ }
+ }
+ return num;
+ }
+ }
+
+ public bool AllCoinsHarvested
+ {
+ get
+ {
+ bool result = true;
+ foreach (BuildingInteractor playerBuildingInteractor in TagManager.instance.playerBuildingInteractors)
+ {
+ if (playerBuildingInteractor.canBeHarvested)
+ {
+ result = false;
+ break;
+ }
+ }
+ foreach (Coin freeCoin in TagManager.instance.freeCoins)
+ {
+ if (freeCoin.IsFree)
+ {
+ return false;
+ }
+ }
+ return result;
+ }
+ }
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ public override string ReturnTooltip()
+ {
+ if (!AllCoinsHarvested)
+ {
+ return autoCollectGoldTooltip;
+ }
+ if (EnemySpawner.instance.PreFinalWaveComingUp)
+ {
+ return startPreFinalNightTooltip;
+ }
+ if (EnemySpawner.instance.FinalWaveComingUp(EnemySpawner.instance.Wavenumber))
+ {
+ return startFinalNightTooltip;
+ }
+ return startNightTooltip;
+ }
+
+ private void Start()
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ tutorialManager = TutorialManager.instance;
+ }
+
+ public override void InteractionBegin(PlayerInteraction player)
+ {
+ if ((bool)tutorialManager && !TutorialManager.AllowStartingTheNight)
+ {
+ return;
+ }
+ if (AllCoinsHarvested)
+ {
+ onBlowFeedback.PlayFeedbacks();
+ DayNightCycle.Instance.SwitchToNight();
+ return;
+ }
+ foreach (BuildingInteractor playerBuildingInteractor in TagManager.instance.playerBuildingInteractors)
+ {
+ playerBuildingInteractor.Harvest(player);
+ }
+ foreach (Coin freeCoin in TagManager.instance.freeCoins)
+ {
+ if (freeCoin.IsFree)
+ {
+ freeCoin.SetTarget(player);
+ }
+ }
+ ActivateAndRefreshCues();
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ base.gameObject.SetActive(value: true);
+ }
+
+ public void OnDusk()
+ {
+ base.gameObject.SetActive(value: false);
+ DeactivateCues();
+ }
+
+ public override void Focus(PlayerInteraction player)
+ {
+ ActivateAndRefreshCues();
+ }
+
+ public override void Unfocus(PlayerInteraction player)
+ {
+ DeactivateCues();
+ EnemySpawner.instance.EnemySpawnersHornUnFocussed();
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public void ActivateAndRefreshCues()
+ {
+ if (AllCoinsHarvested)
+ {
+ nightCue.SetActive(value: true);
+ harvestCue.SetActive(value: false);
+ EnemySpawner.instance.EnemySpawnersHornFocussed();
+ }
+ else
+ {
+ nightCue.SetActive(value: false);
+ harvestCue.SetActive(value: true);
+ }
+ }
+
+ public void DeactivateCues()
+ {
+ nightCue.SetActive(value: false);
+ harvestCue.SetActive(value: false);
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/NightscoreUI.cs b/Thronefall_v1.57/Thronefall/Thronefall/NightscoreUI.cs
new file mode 100644
index 0000000..470ab38
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/NightscoreUI.cs
@@ -0,0 +1,294 @@
+using System.Collections;
+using MPUIKIT;
+using TMPro;
+using UnityEngine;
+
+public class NightscoreUI : MonoBehaviour
+{
+ public GameObject nightScorePanel;
+
+ public TextMeshProUGUI baseScore;
+
+ public TextMeshProUGUI timeBonus;
+
+ public TextMeshProUGUI protectionPercentage;
+
+ public TextMeshProUGUI protectionScore;
+
+ public TextMeshProUGUI overallScore;
+
+ public AudioSource pointSFXSource;
+
+ [Header("ANIMATION")]
+ public MPImage backgroundImage;
+
+ public RectTransform content;
+
+ public RectTransform nightSurviveText;
+
+ public RectTransform nightSurviveNumber;
+
+ public RectTransform timeText;
+
+ public RectTransform timeNumber;
+
+ public RectTransform protectionText;
+
+ public RectTransform protectionNumber;
+
+ public RectTransform overallScoreBG;
+
+ public RectTransform overallScoreNumber;
+
+ public AnimationCurve popCurve;
+
+ public AnimationCurve expandCurve;
+
+ public AnimationCurve bumpCurve;
+
+ public AnimationCurve simpleQuad;
+
+ public static NightscoreUI instance;
+
+ private float initialWaitTime = 3f;
+
+ private float completeWaitTime = 3f;
+
+ private float buildUpSFXVol = 0.8f;
+
+ private float clock;
+
+ private bool shown;
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ private void Start()
+ {
+ nightScorePanel.SetActive(value: false);
+ ScoreManager.Instance.OnNightScoreAdd.AddListener(ShowNightScore);
+ UIFrameManager.instance.onFrameOpen.AddListener(StopPointFillSoundOnPause);
+ }
+
+ private void StopPointFillSoundOnPause()
+ {
+ pointSFXSource.Stop();
+ }
+
+ public void ShowNightScore(int _baseScore, int _timeBonus, float _protectionPercentage, int _protectionBonus)
+ {
+ if (EnemySpawner.instance.Wavenumber < EnemySpawner.instance.waves.Count - 1)
+ {
+ shown = true;
+ StopAllCoroutines();
+ clock = 0f;
+ StartCoroutine(PlayPopUpAnimation(_baseScore, _timeBonus, _protectionPercentage, _protectionBonus));
+ }
+ }
+
+ public void HideNightScore()
+ {
+ shown = false;
+ pointSFXSource.Stop();
+ StopAllCoroutines();
+ StartCoroutine(PlayHideAnimation());
+ }
+
+ private IEnumerator PlayPopUpAnimation(int basescore, int timebonus, float protectionpercent, int protectionbonus)
+ {
+ nightScorePanel.SetActive(value: true);
+ Vector2 contentSizeDelta = content.sizeDelta;
+ int currentScore = ScoreManager.Instance.CurrentScore - basescore - timebonus - protectionbonus;
+ int nextScore = currentScore;
+ baseScore.text = "+" + basescore;
+ timeBonus.text = "+" + timebonus;
+ protectionPercentage.text = TextTranslator.Translate("Menu/Realm") + " " + Mathf.RoundToInt(protectionpercent * 100f) + "% " + TextTranslator.Translate("Menu/Protected");
+ protectionScore.text = "+" + protectionbonus;
+ overallScore.text = currentScore.ToString();
+ contentSizeDelta.y = 0f;
+ content.sizeDelta = contentSizeDelta;
+ nightSurviveText.localScale = Vector3.zero;
+ nightSurviveNumber.localScale = Vector3.zero;
+ timeText.localScale = Vector3.zero;
+ timeNumber.localScale = Vector3.zero;
+ protectionText.localScale = Vector3.zero;
+ protectionNumber.localScale = Vector3.zero;
+ overallScoreBG.localScale = Vector3.zero;
+ overallScoreNumber.localScale = Vector3.zero;
+ yield return new WaitForSeconds(initialWaitTime);
+ float animTime2 = 0.5f;
+ float timer2 = 0f;
+ while (timer2 < animTime2)
+ {
+ timer2 += Time.deltaTime;
+ overallScoreBG.localScale = Vector3.one * popCurve.Evaluate(Mathf.InverseLerp(0f, animTime2, timer2));
+ overallScoreNumber.localScale = Vector3.one * popCurve.Evaluate(Mathf.InverseLerp(0f, animTime2, timer2));
+ yield return null;
+ }
+ overallScoreBG.localScale = Vector3.one;
+ overallScoreNumber.localScale = Vector3.one;
+ yield return new WaitForSeconds(0.25f);
+ pointSFXSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.PointScreenBuildB, buildUpSFXVol);
+ animTime2 = 0.5f;
+ timer2 = 0f;
+ while (timer2 < animTime2)
+ {
+ timer2 += Time.deltaTime;
+ content.sizeDelta = contentSizeDelta + Vector2.up * 55f * expandCurve.Evaluate(Mathf.InverseLerp(0f, animTime2, timer2));
+ yield return null;
+ }
+ content.sizeDelta = contentSizeDelta + Vector2.up * 55f;
+ contentSizeDelta = content.sizeDelta;
+ pointSFXSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.PointScreenBuildC, buildUpSFXVol);
+ animTime2 = 0.5f;
+ timer2 = 0f;
+ while (timer2 < animTime2)
+ {
+ timer2 += Time.deltaTime;
+ nightSurviveText.localScale = Vector3.one * popCurve.Evaluate(Mathf.InverseLerp(0f, animTime2, timer2));
+ nightSurviveNumber.localScale = Vector3.one * popCurve.Evaluate(Mathf.InverseLerp(0f, animTime2, timer2));
+ yield return null;
+ }
+ nightSurviveText.localScale = Vector3.one;
+ nightSurviveNumber.localScale = Vector3.one;
+ pointSFXSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.PointScreenBuildB, buildUpSFXVol);
+ animTime2 = 0.5f;
+ timer2 = 0f;
+ while (timer2 < animTime2)
+ {
+ timer2 += Time.deltaTime;
+ content.sizeDelta = contentSizeDelta + Vector2.up * 30f * expandCurve.Evaluate(Mathf.InverseLerp(0f, animTime2, timer2));
+ yield return null;
+ }
+ content.sizeDelta = contentSizeDelta + Vector2.up * 30f;
+ contentSizeDelta = content.sizeDelta;
+ pointSFXSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.PointScreenBuildC, buildUpSFXVol);
+ animTime2 = 0.5f;
+ timer2 = 0f;
+ while (timer2 < animTime2)
+ {
+ timer2 += Time.deltaTime;
+ protectionText.localScale = Vector3.one * popCurve.Evaluate(Mathf.InverseLerp(0f, animTime2, timer2));
+ protectionNumber.localScale = Vector3.one * popCurve.Evaluate(Mathf.InverseLerp(0f, animTime2, timer2));
+ yield return null;
+ }
+ protectionText.localScale = Vector3.one;
+ protectionNumber.localScale = Vector3.one;
+ pointSFXSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.PointScreenBuildB, buildUpSFXVol);
+ animTime2 = 0.5f;
+ timer2 = 0f;
+ while (timer2 < animTime2)
+ {
+ timer2 += Time.deltaTime;
+ content.sizeDelta = contentSizeDelta + Vector2.up * 30f * expandCurve.Evaluate(Mathf.InverseLerp(0f, animTime2, timer2));
+ yield return null;
+ }
+ content.sizeDelta = contentSizeDelta + Vector2.up * 30f;
+ _ = content.sizeDelta;
+ pointSFXSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.PointScreenBuildC, buildUpSFXVol);
+ animTime2 = 0.5f;
+ timer2 = 0f;
+ while (timer2 < animTime2)
+ {
+ timer2 += Time.deltaTime;
+ timeText.localScale = Vector3.one * popCurve.Evaluate(Mathf.InverseLerp(0f, animTime2, timer2));
+ timeNumber.localScale = Vector3.one * popCurve.Evaluate(Mathf.InverseLerp(0f, animTime2, timer2));
+ yield return null;
+ }
+ timeText.localScale = Vector3.one;
+ timeNumber.localScale = Vector3.one;
+ pointSFXSource.Play();
+ animTime2 = 1.5f;
+ timer2 = 0f;
+ nextScore += basescore + protectionbonus + timebonus;
+ while (timer2 < animTime2)
+ {
+ timer2 += Time.deltaTime;
+ overallScore.text = Mathf.RoundToInt(Mathf.Lerp(currentScore, nextScore, Mathf.InverseLerp(0f, animTime2, timer2))).ToString();
+ yield return null;
+ }
+ currentScore = nextScore;
+ overallScore.text = currentScore.ToString();
+ pointSFXSource.Stop();
+ pointSFXSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.PointLockInMinor);
+ animTime2 = 0.5f;
+ timer2 = 0f;
+ while (timer2 < animTime2)
+ {
+ timer2 += Time.deltaTime;
+ overallScoreBG.localScale = Vector3.one * bumpCurve.Evaluate(Mathf.InverseLerp(0f, animTime2, timer2));
+ yield return null;
+ }
+ overallScoreBG.localScale = Vector3.one;
+ yield return new WaitForSeconds(completeWaitTime);
+ HideNightScore();
+ }
+
+ private IEnumerator PlayHideAnimation()
+ {
+ pointSFXSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.PointScreenBuildB, buildUpSFXVol);
+ Vector2 contentSizeDelta3 = content.sizeDelta;
+ nightSurviveText.localScale = Vector3.one;
+ nightSurviveNumber.localScale = Vector3.one;
+ timeText.localScale = Vector3.one;
+ timeNumber.localScale = Vector3.one;
+ protectionText.localScale = Vector3.one;
+ protectionNumber.localScale = Vector3.one;
+ overallScoreBG.localScale = Vector3.one;
+ overallScoreNumber.localScale = Vector3.one;
+ timeText.localScale = Vector3.zero;
+ timeNumber.localScale = Vector3.zero;
+ float animTime4 = 0.4f;
+ float timer4 = 0f;
+ while (timer4 < animTime4)
+ {
+ timer4 += Time.deltaTime;
+ content.sizeDelta = contentSizeDelta3 - Vector2.up * 30f * expandCurve.Evaluate(Mathf.InverseLerp(0f, animTime4, timer4));
+ yield return null;
+ }
+ content.sizeDelta = contentSizeDelta3 - Vector2.up * 30f;
+ contentSizeDelta3 = content.sizeDelta;
+ protectionText.localScale = Vector3.zero;
+ protectionNumber.localScale = Vector3.zero;
+ animTime4 = 0.4f;
+ timer4 = 0f;
+ while (timer4 < animTime4)
+ {
+ timer4 += Time.deltaTime;
+ content.sizeDelta = contentSizeDelta3 - Vector2.up * 30f * expandCurve.Evaluate(Mathf.InverseLerp(0f, animTime4, timer4));
+ yield return null;
+ }
+ content.sizeDelta = contentSizeDelta3 - Vector2.up * 30f;
+ contentSizeDelta3 = content.sizeDelta;
+ nightSurviveText.localScale = Vector3.zero;
+ nightSurviveNumber.localScale = Vector3.zero;
+ animTime4 = 0.4f;
+ timer4 = 0f;
+ while (timer4 < animTime4)
+ {
+ timer4 += Time.deltaTime;
+ if (Mathf.InverseLerp(0f, animTime4, timer4) > 0.425f)
+ {
+ backgroundImage.enabled = false;
+ }
+ content.sizeDelta = contentSizeDelta3 - Vector2.up * 55f * expandCurve.Evaluate(Mathf.InverseLerp(0f, animTime4, timer4));
+ yield return null;
+ }
+ content.sizeDelta = contentSizeDelta3 - Vector2.up * 55f;
+ backgroundImage.enabled = true;
+ animTime4 = 0.2f;
+ timer4 = 0f;
+ while (timer4 < animTime4)
+ {
+ timer4 += Time.deltaTime;
+ overallScoreNumber.localScale = Vector3.one * simpleQuad.Evaluate(Mathf.InverseLerp(animTime4, 0f, timer4));
+ overallScoreBG.localScale = Vector3.one * simpleQuad.Evaluate(Mathf.InverseLerp(animTime4, 0f, timer4));
+ yield return null;
+ }
+ overallScoreNumber.localScale = Vector3.zero;
+ overallScoreBG.localScale = Vector2.zero;
+ nightScorePanel.SetActive(value: false);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/OnDamageFeedbackHandler.cs b/Thronefall_v1.57/Thronefall/Thronefall/OnDamageFeedbackHandler.cs
new file mode 100644
index 0000000..82aed25
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/OnDamageFeedbackHandler.cs
@@ -0,0 +1,28 @@
+using UnityEngine;
+
+public class OnDamageFeedbackHandler : MonoBehaviour
+{
+ public Hp target;
+
+ public MaterialFlasherFX flasher;
+
+ public GameObject onDmgByPlayerFX;
+
+ private void Start()
+ {
+ target.OnReceiveDamage.AddListener(TakeDamage);
+ }
+
+ private void TakeDamage(bool causedByPlayer)
+ {
+ if (causedByPlayer)
+ {
+ Object.Instantiate(onDmgByPlayerFX, target.transform.position + Vector3.up * target.hitFeedbackHeight, onDmgByPlayerFX.transform.rotation);
+ flasher.TriggerFlash(special: true);
+ }
+ else
+ {
+ flasher.TriggerFlash(special: false);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/OneShotAnimationBase.cs b/Thronefall_v1.57/Thronefall/Thronefall/OneShotAnimationBase.cs
new file mode 100644
index 0000000..7967415
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/OneShotAnimationBase.cs
@@ -0,0 +1,6 @@
+using UnityEngine;
+
+public abstract class OneShotAnimationBase : MonoBehaviour
+{
+ public abstract void Trigger();
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PathMesher.cs b/Thronefall_v1.57/Thronefall/Thronefall/PathMesher.cs
new file mode 100644
index 0000000..244ee39
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PathMesher.cs
@@ -0,0 +1,339 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+[RequireComponent(typeof(MeshRenderer))]
+[RequireComponent(typeof(MeshFilter))]
+[ExecuteInEditMode]
+public class PathMesher : MonoBehaviour
+{
+ public enum UnwrapMode
+ {
+ XZWorldSpace,
+ River
+ }
+
+ [Serializable]
+ public class PathPoint
+ {
+ public Vector3 position;
+
+ public float width;
+
+ public PathPoint(Vector3 _position, float _width)
+ {
+ position = _position;
+ width = _width;
+ }
+ }
+
+ private MeshFilter meshFilter;
+
+ private MeshCollider meshCollider;
+
+ public int subdivisions = 3;
+
+ public float vertDistance = 0.2f;
+
+ public int endCapSubdivisions = 3;
+
+ public float widthWhobble = 0.5f;
+
+ public float positionWhobble = 0.5f;
+
+ public UnwrapMode uvUnwrapMode;
+
+ public float uvScale = 0.01f;
+
+ public bool topNormalsAlwaysFaceDirectlyUp;
+
+ public Vector3 extrudeDownOffset;
+
+ public bool vertical;
+
+ public bool loop;
+
+ public bool flipNormals;
+
+ private List<FakeTransorm> transformsRemember = new List<FakeTransorm>();
+
+ private List<PathPoint> pathPoints = new List<PathPoint>();
+
+ public void UpdateMesh()
+ {
+ pathPoints.Clear();
+ for (int i = 0; i < base.transform.childCount; i++)
+ {
+ Transform child = base.transform.GetChild(i);
+ pathPoints.Add(new PathPoint(child.localPosition, child.localScale.x));
+ }
+ if (pathPoints.Count < 2)
+ {
+ return;
+ }
+ if (loop)
+ {
+ Transform child2 = base.transform.GetChild(0);
+ pathPoints.Add(new PathPoint(child2.localPosition, child2.localScale.x));
+ }
+ meshFilter = GetComponent<MeshFilter>();
+ meshCollider = GetComponent<MeshCollider>();
+ Mesh mesh = new Mesh();
+ List<Vector3> list = new List<Vector3>();
+ List<Vector2> uvs = new List<Vector2>();
+ List<int> list2 = new List<int>();
+ List<int> list3 = new List<int>();
+ List<PathPoint> _pathOriginal = new List<PathPoint>();
+ InterpolateModifyer(pathPoints, _pathOriginal, subdivisions);
+ if (vertDistance > 0.1f)
+ {
+ ResampleModifyer(ref _pathOriginal, vertDistance, vertDistance / 10f);
+ }
+ AddRoundedEndsModifyer(_pathOriginal, endCapSubdivisions);
+ WhobbleModifyer(_pathOriginal, widthWhobble, positionWhobble);
+ float num = 0f;
+ for (int j = 0; j < _pathOriginal.Count; j++)
+ {
+ if (_pathOriginal.Count <= 1)
+ {
+ break;
+ }
+ Vector3 forwards = GetForwards(j, _pathOriginal);
+ Vector3 vector = Quaternion.Euler(0f, 90f, 0f) * forwards * _pathOriginal[j].width;
+ Vector3 vector2 = Quaternion.Euler(0f, -90f, 0f) * forwards * _pathOriginal[j].width;
+ if (vertical)
+ {
+ vector = Vector3.up * _pathOriginal[j].width;
+ vector2 = Vector3.down * _pathOriginal[j].width;
+ }
+ AddUnwrappedVertTop(_pathOriginal[j].position + vector, list, uvs, num, 0f - _pathOriginal[j].width);
+ AddUnwrappedVertTop(_pathOriginal[j].position + vector2, list, uvs, num, _pathOriginal[j].width);
+ if (j > 0)
+ {
+ num += (_pathOriginal[j].position - _pathOriginal[j - 1].position).magnitude;
+ }
+ }
+ int count = list.Count;
+ if (extrudeDownOffset.y != 0f)
+ {
+ num = 0f;
+ for (int k = 0; k <= 1; k++)
+ {
+ int num2 = 0;
+ for (int l = k; l < count - 2; l += 2)
+ {
+ AddUnwrappedVertTop(list[l], list, uvs, num, 0f);
+ AddUnwrappedVertTop(list[l] + extrudeDownOffset, list, uvs, num, 0f - extrudeDownOffset.magnitude);
+ num += (_pathOriginal[num2 + 1].position - _pathOriginal[num2].position).magnitude;
+ num2++;
+ AddUnwrappedVertTop(list[l + 2], list, uvs, num, 0f);
+ AddUnwrappedVertTop(list[l + 2] + extrudeDownOffset, list, uvs, num, 0f - extrudeDownOffset.magnitude);
+ }
+ }
+ }
+ Vector3[] normals = new Vector3[list.Count];
+ for (int m = 0; m < _pathOriginal.Count - 1; m++)
+ {
+ if (_pathOriginal.Count <= 1)
+ {
+ break;
+ }
+ int num3 = m * 2;
+ ConnectTriangle(num3 + 2, num3 + 1, num3, list2, normals, list, topNormalsAlwaysFaceDirectlyUp, vertical);
+ ConnectTriangle(num3 + 1, num3 + 2, num3 + 3, list2, normals, list, topNormalsAlwaysFaceDirectlyUp, vertical);
+ }
+ if (extrudeDownOffset.y != 0f)
+ {
+ int num4 = count;
+ for (int n = 0; n < count - 2; n += 2)
+ {
+ ConnectTriangle(num4, num4 + 1, num4 + 2, list3, normals, list, _makeNormalsFaceUp: false, _showFacesFacedDownwards: true);
+ ConnectTriangle(num4 + 3, num4 + 2, num4 + 1, list3, normals, list, _makeNormalsFaceUp: false, _showFacesFacedDownwards: true);
+ num4 += 4;
+ }
+ int num5 = num4;
+ for (int num6 = 1; num6 < count - 2; num6 += 2)
+ {
+ ConnectTriangle(num4 + 2, num4 + 1, num4, list3, normals, list, _makeNormalsFaceUp: false, _showFacesFacedDownwards: true);
+ ConnectTriangle(num4 + 1, num4 + 2, num4 + 3, list3, normals, list, _makeNormalsFaceUp: false, _showFacesFacedDownwards: true);
+ num4 += 4;
+ }
+ ConnectTriangle(num5, count + 1, count, list3, normals, list, _makeNormalsFaceUp: false, _showFacesFacedDownwards: true);
+ ConnectTriangle(count + 1, num5, num5 + 1, list3, normals, list, _makeNormalsFaceUp: false, _showFacesFacedDownwards: true);
+ ConnectTriangle(num5 - 2, num5 - 1, num4 - 2, list3, normals, list, _makeNormalsFaceUp: false, _showFacesFacedDownwards: true);
+ ConnectTriangle(num4 - 1, num4 - 2, num5 - 1, list3, normals, list, _makeNormalsFaceUp: false, _showFacesFacedDownwards: true);
+ }
+ mesh.subMeshCount = ((extrudeDownOffset.y == 0f) ? 1 : 2);
+ mesh.SetVertices(list);
+ mesh.SetTriangles(list2, 0);
+ if (extrudeDownOffset.y != 0f)
+ {
+ mesh.SetTriangles(list3, 1);
+ }
+ mesh.SetUVs(0, uvs);
+ mesh.SetNormals(normals);
+ mesh.RecalculateBounds();
+ if ((bool)meshFilter)
+ {
+ meshFilter.sharedMesh = mesh;
+ }
+ if ((bool)meshCollider)
+ {
+ meshCollider.sharedMesh = mesh;
+ }
+ }
+
+ public void ConnectTriangle(int _vertA, int _vertB, int _vertC, List<int> _tris, Vector3[] _normals, List<Vector3> _verts, bool _makeNormalsFaceUp, bool _showFacesFacedDownwards)
+ {
+ if (flipNormals)
+ {
+ int num = _vertA;
+ _vertA = _vertC;
+ _vertC = num;
+ }
+ Vector3 normalized = Vector3.Cross(_verts[_vertA] - _verts[_vertB], _verts[_vertC] - _verts[_vertB]).normalized;
+ if (normalized.y > 0f || _showFacesFacedDownwards)
+ {
+ _tris.Add(_vertC);
+ _tris.Add(_vertB);
+ _tris.Add(_vertA);
+ if (_makeNormalsFaceUp)
+ {
+ _normals[_vertC] = Vector3.up;
+ _normals[_vertB] = Vector3.up;
+ _normals[_vertA] = Vector3.up;
+ }
+ else
+ {
+ _normals[_vertC] = normalized;
+ _normals[_vertB] = normalized;
+ _normals[_vertA] = normalized;
+ }
+ }
+ }
+
+ public void AddUnwrappedVertTop(Vector3 _pos, List<Vector3> _verts, List<Vector2> _uvs, float _distanceTraveled, float _width)
+ {
+ _verts.Add(_pos);
+ if (uvUnwrapMode == UnwrapMode.XZWorldSpace)
+ {
+ _pos = base.transform.localToWorldMatrix.MultiplyPoint(_pos);
+ _uvs.Add(new Vector2(_pos.x * uvScale, _pos.z * uvScale));
+ }
+ else if (uvUnwrapMode == UnwrapMode.River)
+ {
+ _uvs.Add(new Vector2(_distanceTraveled * uvScale, _width * uvScale));
+ }
+ }
+
+ public void InterpolateModifyer(List<PathPoint> _pathIn, List<PathPoint> _pathOut, int _subdivisions)
+ {
+ for (int i = 0; i < _pathIn.Count - 1; i++)
+ {
+ for (int j = 0; j < _subdivisions; j++)
+ {
+ float num = (float)j / (float)_subdivisions;
+ float magnitude = (_pathIn[i + 1].position - _pathIn[i].position).magnitude;
+ Vector3 forwards = GetForwards(i, _pathIn);
+ Vector3 forwards2 = GetForwards(i + 1, _pathIn);
+ Vector3 a = _pathIn[i].position + num * forwards * magnitude;
+ Vector3 b = _pathIn[i + 1].position - (1f - num) * forwards2 * magnitude;
+ Vector3 position = Vector3.Lerp(a, b, Mathf.SmoothStep(0f, 1f, num));
+ float width = Mathf.SmoothStep(_pathIn[i].width, _pathIn[i + 1].width, num);
+ PathPoint item = new PathPoint(position, width);
+ _pathOut.Add(item);
+ }
+ }
+ _pathOut.Add(_pathIn[_pathIn.Count - 1]);
+ }
+
+ public void ResampleModifyer(ref List<PathPoint> _pathOriginal, float _maxDistance, float _stepSize = 0.1f)
+ {
+ if (_pathOriginal.Count < 2)
+ {
+ return;
+ }
+ List<PathPoint> list = new List<PathPoint>();
+ list.Add(_pathOriginal[0]);
+ float num = 0f;
+ for (int i = 0; i < _pathOriginal.Count - 1; i++)
+ {
+ int num2 = (int)Mathf.Ceil((_pathOriginal[i].position - _pathOriginal[i + 1].position).magnitude / _stepSize);
+ for (int j = 0; j < num2; j++)
+ {
+ num += _stepSize;
+ if (num >= _maxDistance)
+ {
+ float t = (float)j / (float)num2;
+ Vector3 position = Vector3.Lerp(_pathOriginal[i].position, _pathOriginal[i + 1].position, t);
+ float width = Mathf.Lerp(_pathOriginal[i].width, _pathOriginal[i + 1].width, t);
+ num = 0f;
+ list.Add(new PathPoint(position, width));
+ }
+ }
+ }
+ list.Add(_pathOriginal[_pathOriginal.Count - 1]);
+ _pathOriginal = list;
+ }
+
+ public void WhobbleModifyer(List<PathPoint> _path, float _widthAmount, float _posAmount)
+ {
+ UnityEngine.Random.InitState(_path.Count * 7);
+ for (int i = 0; i < _path.Count; i++)
+ {
+ _path[i].position += new Vector3(UnityEngine.Random.value - 0.5f, 0f, UnityEngine.Random.value - 0.5f) * _posAmount;
+ _path[i].width *= 1f + (UnityEngine.Random.value - 0.5f) * _widthAmount;
+ }
+ }
+
+ public void AddRoundedEndsModifyer(List<PathPoint> _pathModify, int _interpolations)
+ {
+ Vector3 position = _pathModify[0].position;
+ Vector3 vector = -GetForwards(0, _pathModify);
+ float width = _pathModify[0].width;
+ Vector3 position2 = _pathModify[_pathModify.Count - 1].position;
+ Vector3 forwards = GetForwards(_pathModify.Count - 1, _pathModify);
+ float width2 = _pathModify[_pathModify.Count - 1].width;
+ for (int i = 1; i < _interpolations; i++)
+ {
+ float f = (float)i / (float)_interpolations;
+ f = Mathf.Pow(f, 0.5f);
+ float width3 = width * (1f - Mathf.Pow(f, 3f));
+ float num = width * f;
+ _pathModify.Insert(0, new PathPoint(position + num * vector, width3));
+ }
+ for (int j = 1; j < _interpolations; j++)
+ {
+ float f2 = (float)j / (float)_interpolations;
+ f2 = Mathf.Pow(f2, 0.5f);
+ float width4 = width2 * (1f - Mathf.Pow(f2, 3f));
+ float num2 = width2 * f2;
+ _pathModify.Add(new PathPoint(position2 + num2 * forwards, width4));
+ }
+ }
+
+ private Vector3 GetForwards(int i, List<PathPoint> path, bool _xzPlaneOnly = true)
+ {
+ Vector3 result = ((i == 0) ? (path[i + 1].position - path[i].position).normalized : ((i != path.Count - 1) ? (path[i + 1].position - path[i - 1].position).normalized : (path[i].position - path[i - 1].position).normalized));
+ if (_xzPlaneOnly)
+ {
+ result = new Vector3(result.x, 0f, result.z).normalized;
+ }
+ return result;
+ }
+
+ public void Nullify()
+ {
+ List<Vector3> list = new List<Vector3>();
+ for (int i = 0; i < base.transform.childCount; i++)
+ {
+ Transform child = base.transform.GetChild(i);
+ list.Add(child.transform.position);
+ }
+ base.transform.position = Vector3.zero;
+ for (int j = 0; j < base.transform.childCount; j++)
+ {
+ base.transform.GetChild(j).transform.position = list[j];
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PathfindMovement.cs b/Thronefall_v1.57/Thronefall/Thronefall/PathfindMovement.cs
new file mode 100644
index 0000000..4a20af2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PathfindMovement.cs
@@ -0,0 +1,15 @@
+using Pathfinding.RVO;
+using UnityEngine;
+
+public abstract class PathfindMovement : MonoBehaviour
+{
+ public virtual bool IsSlowed => false;
+
+ public virtual RVOController RVO => null;
+
+ public abstract void ClearCurrentPath();
+
+ public abstract void Slow(float _duration);
+
+ public abstract void GetAgroFromObject(TaggedObject _agroTarget);
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PathfindMovementEnemy.cs b/Thronefall_v1.57/Thronefall/Thronefall/PathfindMovementEnemy.cs
new file mode 100644
index 0000000..93d58cf
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PathfindMovementEnemy.cs
@@ -0,0 +1,300 @@
+using System.Collections.Generic;
+using Pathfinding;
+using Pathfinding.RVO;
+using UnityEngine;
+
+[RequireComponent(typeof(Seeker))]
+public class PathfindMovementEnemy : PathfindMovement, DayNightCycle.IDaytimeSensitive
+{
+ public List<TargetPriority> targetPriorities = new List<TargetPriority>();
+
+ public float keepDistanceOf = 2f;
+
+ public float maximumDistanceFromHome = 100000f;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public float movementSpeed = 2f;
+
+ public float recalculatePathInterval = 1f;
+
+ public string backupMovementGraph = "";
+
+ public float agroTimeWhenAttackedByPlayer = 5f;
+
+ private TaggedObject agroPlayerTarget;
+
+ private float remainingPlayerAgroTime;
+
+ private Seeker seeker;
+
+ private RVOController rvo;
+
+ private Vector3 seekToTargetPosSnappedtoNavmesh = Vector3.zero;
+
+ private Vector3 seekToTargetPos = Vector3.zero;
+
+ private TaggedObject seekToTaggedObj;
+
+ private List<Vector3> path = new List<Vector3>();
+
+ private int nextPathPointIndex;
+
+ private float recalculatePathCooldown;
+
+ private Vector3 homePosition;
+
+ private bool currentlyWalkingHome = true;
+
+ private TargetPriority targetPrio;
+
+ private bool currentlyChasingPlayer;
+
+ private NNConstraint nearestConstraint = new NNConstraint();
+
+ private Vector3 nextPathPoint;
+
+ private Vector3 homeOffset = Vector3.zero;
+
+ private GraphMask graphMaskOriginal;
+
+ private GraphMask graphMaskBackup;
+
+ private float slowDurationMulti = 1f;
+
+ private float slowedFor;
+
+ private float speedWhenSlowed = 0.33f;
+
+ private Vector3 storeRequestedTargetPos;
+
+ public override RVOController RVO => rvo;
+
+ public Vector3 SeekToTargetPosSnappedtoNavmesh => seekToTargetPosSnappedtoNavmesh;
+
+ public List<Vector3> Path => path;
+
+ public Vector3 HomePosition => homePosition;
+
+ public Vector3 NextPathPoint => nextPathPoint;
+
+ public override bool IsSlowed => slowedFor > 0f;
+
+ public override void GetAgroFromObject(TaggedObject _agroTarget)
+ {
+ if ((bool)_agroTarget && _agroTarget.Tags.Contains(TagManager.ETag.Player))
+ {
+ agroPlayerTarget = _agroTarget;
+ remainingPlayerAgroTime = agroTimeWhenAttackedByPlayer;
+ if (!currentlyChasingPlayer && agroTimeWhenAttackedByPlayer > 0f)
+ {
+ OriginalPathRequest();
+ }
+ }
+ }
+
+ public void OnDusk()
+ {
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ private void Start()
+ {
+ seeker = GetComponent<Seeker>();
+ rvo = GetComponent<RVOController>();
+ recalculatePathCooldown = recalculatePathInterval * Random.value;
+ homePosition = base.transform.position;
+ nearestConstraint.graphMask = seeker.graphMask;
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ homeOffset = new Vector3(Random.value - 0.5f, 0f, Random.value - 0.5f);
+ foreach (TargetPriority targetPriority in targetPriorities)
+ {
+ targetPriority.mayNotHaveTags.Add(TagManager.ETag.AUTO_Commanded);
+ }
+ if (PerkManager.instance.IceMagicActive)
+ {
+ speedWhenSlowed *= PerkManager.instance.iceMagic_AdditionalsSlowMutli;
+ slowDurationMulti *= PerkManager.instance.iceMagic_SlowDurationMulti;
+ }
+ graphMaskOriginal = seeker.graphMask;
+ graphMaskBackup = GraphMask.FromGraphName(backupMovementGraph);
+ if (GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.MeeleFighter) && Random.value < 0.5f)
+ {
+ graphMaskOriginal = graphMaskBackup;
+ }
+ }
+
+ public void OriginalPathRequest()
+ {
+ seekToTargetPos = FindMoveToTarget();
+ seekToTargetPosSnappedtoNavmesh = AstarPath.active.GetNearest(seekToTargetPos, nearestConstraint).position;
+ storeRequestedTargetPos = seekToTargetPosSnappedtoNavmesh;
+ seeker.StartPath(base.transform.position, seekToTargetPosSnappedtoNavmesh, OriginalOnPathComplete, graphMaskOriginal);
+ }
+
+ private void OriginalOnPathComplete(Path _p)
+ {
+ if (backupMovementGraph != "")
+ {
+ if (_p.error)
+ {
+ BackupPathRequest();
+ return;
+ }
+ if ((storeRequestedTargetPos - _p.vectorPath[_p.vectorPath.Count - 1]).magnitude > 1f)
+ {
+ BackupPathRequest();
+ return;
+ }
+ }
+ else if (_p.error)
+ {
+ return;
+ }
+ path = _p.vectorPath;
+ nextPathPointIndex = 0;
+ }
+
+ private void BackupPathRequest()
+ {
+ seekToTargetPos = FindMoveToTarget();
+ seekToTargetPosSnappedtoNavmesh = AstarPath.active.GetNearest(seekToTargetPos, nearestConstraint).position;
+ storeRequestedTargetPos = seekToTargetPosSnappedtoNavmesh;
+ seeker.StartPath(base.transform.position, seekToTargetPosSnappedtoNavmesh, BackupOnPathComplete, graphMaskBackup);
+ }
+
+ public Vector3 GetNearestGroundPosition(Vector3 _position)
+ {
+ return AstarPath.active.GetNearest(_position, nearestConstraint).position;
+ }
+
+ private void BackupOnPathComplete(Path _p)
+ {
+ if (!_p.error)
+ {
+ path = _p.vectorPath;
+ nextPathPointIndex = 0;
+ }
+ }
+
+ private Vector3 FindMoveToTarget()
+ {
+ currentlyWalkingHome = false;
+ currentlyChasingPlayer = false;
+ if (remainingPlayerAgroTime > 0f && agroPlayerTarget != null && !agroPlayerTarget.Hp.KnockedOut)
+ {
+ seekToTaggedObj = agroPlayerTarget;
+ currentlyChasingPlayer = true;
+ return seekToTaggedObj.transform.position;
+ }
+ for (int i = 0; i < targetPriorities.Count; i++)
+ {
+ targetPrio = targetPriorities[i];
+ seekToTaggedObj = targetPrio.FindTaggedObjectCloseToHome(base.transform.position, homePosition, maximumDistanceFromHome, out var _outPosition);
+ if (!(seekToTaggedObj == null))
+ {
+ if (seekToTaggedObj.Tags.Contains(TagManager.ETag.Player))
+ {
+ currentlyChasingPlayer = true;
+ }
+ return _outPosition;
+ }
+ }
+ seekToTaggedObj = null;
+ targetPrio = null;
+ currentlyWalkingHome = true;
+ return homePosition + homeOffset;
+ }
+
+ private void Update()
+ {
+ if (remainingPlayerAgroTime > 0f)
+ {
+ remainingPlayerAgroTime -= Time.deltaTime;
+ }
+ recalculatePathCooldown -= Time.deltaTime;
+ if (recalculatePathCooldown <= 0f)
+ {
+ recalculatePathCooldown = recalculatePathInterval;
+ OriginalPathRequest();
+ }
+ if (currentlyChasingPlayer)
+ {
+ seekToTargetPosSnappedtoNavmesh = seekToTaggedObj.transform.position;
+ if (path.Count > 0)
+ {
+ path[path.Count - 1] = seekToTargetPosSnappedtoNavmesh;
+ }
+ seekToTargetPos = seekToTargetPosSnappedtoNavmesh;
+ }
+ FollowPathUpdate();
+ }
+
+ public override void Slow(float _duration)
+ {
+ slowedFor = Mathf.Max(_duration, slowedFor);
+ }
+
+ private void FollowPathUpdate()
+ {
+ if (path.Count <= nextPathPointIndex)
+ {
+ if (!currentlyChasingPlayer || path.Count <= 0)
+ {
+ return;
+ }
+ nextPathPointIndex = path.Count - 1;
+ }
+ nextPathPoint = path[nextPathPointIndex];
+ Vector3 vector;
+ if ((base.transform.position - seekToTargetPos).magnitude < keepDistanceOf && !currentlyWalkingHome)
+ {
+ vector = Vector3.zero;
+ nextPathPoint = base.transform.position;
+ }
+ else
+ {
+ vector = nextPathPoint - base.transform.position;
+ if (vector.magnitude <= 1f)
+ {
+ nextPathPointIndex++;
+ nextPathPointIndex = Mathf.Clamp(nextPathPointIndex, 0, path.Count - 1);
+ nextPathPoint = path[nextPathPointIndex];
+ vector = nextPathPoint - base.transform.position;
+ }
+ }
+ rvo.priority = vector.magnitude;
+ if (slowedFor > 0f)
+ {
+ rvo.SetTarget(nextPathPoint, vector.magnitude * 3f, movementSpeed * speedWhenSlowed);
+ slowedFor -= Time.deltaTime / slowDurationMulti;
+ }
+ else
+ {
+ rvo.SetTarget(nextPathPoint, vector.magnitude * 3f, movementSpeed);
+ }
+ Vector3 position = base.transform.position + rvo.CalculateMovementDelta(Time.deltaTime);
+ Vector3 position2 = AstarPath.active.GetNearest(position, nearestConstraint).position;
+ base.transform.position = position2;
+ }
+
+ public void SnapToNavmesh()
+ {
+ base.transform.position = AstarPath.active.GetNearest(base.transform.position, nearestConstraint).position;
+ }
+
+ public override void ClearCurrentPath()
+ {
+ path.Clear();
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PathfindMovementPlayerunit.cs b/Thronefall_v1.57/Thronefall/Thronefall/PathfindMovementPlayerunit.cs
new file mode 100644
index 0000000..1b28d10
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PathfindMovementPlayerunit.cs
@@ -0,0 +1,405 @@
+using System.Collections.Generic;
+using Pathfinding;
+using Pathfinding.RVO;
+using UnityEngine;
+
+[RequireComponent(typeof(Seeker))]
+public class PathfindMovementPlayerunit : PathfindMovement, DayNightCycle.IDaytimeSensitive
+{
+ public List<TargetPriority> targetPriorities = new List<TargetPriority>();
+
+ public float keepDistanceOf = 2f;
+
+ public float maximumDistanceFromHome = 100000f;
+
+ public float movementSpeed = 2f;
+
+ public float recalculatePathInterval = 1f;
+
+ public string backupMovementGraph = "";
+
+ public float agroTimeWhenAttackedByPlayer = 5f;
+
+ public float speedBoostDuringDaytime = 1.5f;
+
+ private TaggedObject agroPlayerTarget;
+
+ private Seeker seeker;
+
+ private RVOController rvo;
+
+ private Vector3 seekToTargetPosSnappedtoNavmesh = Vector3.zero;
+
+ private Vector3 seekToTargetPos = Vector3.zero;
+
+ private TaggedObject seekToTaggedObj;
+
+ private List<Vector3> path = new List<Vector3>();
+
+ private int nextPathPointIndex;
+
+ private float recalculatePathCooldown;
+
+ private Vector3 homePosition;
+
+ private Vector3 homePositionOriginal;
+
+ private bool currentlyWalkingHome = true;
+
+ private TargetPriority targetPrio;
+
+ private NNConstraint nearestConstraint = new NNConstraint();
+
+ private GraphMask graphMaskOriginal;
+
+ private Vector3 nextPathPoint;
+
+ private SettingsManager settingsManager;
+
+ private bool followingPlayer;
+
+ [SerializeField]
+ private GameObject holdPositionMarker;
+
+ private Transform holdPositionMarkerTransform;
+
+ private float slowedFor;
+
+ private bool day = true;
+
+ private bool holdPosition;
+
+ private const float HAS_REACHED_HOME_POS_DIST = 3f;
+
+ private const float TINY_AGRO_RANGE_ON_HOLD_POSITION = 7f;
+
+ private bool hasReachedHomePositionAlready;
+
+ private bool flying;
+
+ [Header("References")]
+ public Hp hp;
+
+ public AutoAttack[] autoAttacks;
+
+ private Vector3 storeRequestedTargetPos;
+
+ public override RVOController RVO => rvo;
+
+ public Vector3 SeekToTargetPosSnappedtoNavmesh => seekToTargetPosSnappedtoNavmesh;
+
+ public Vector3 HopePositionOriginal => homePositionOriginal;
+
+ public Vector3 HomePosition
+ {
+ get
+ {
+ return homePosition;
+ }
+ set
+ {
+ homePosition = value;
+ }
+ }
+
+ public Vector3 NextPathPoint => nextPathPoint;
+
+ public bool FollowingPlayer => followingPlayer;
+
+ public override bool IsSlowed => slowedFor > 0f;
+
+ public bool HasReachedHomePositionAlready
+ {
+ get
+ {
+ return hasReachedHomePositionAlready;
+ }
+ set
+ {
+ hasReachedHomePositionAlready = value;
+ }
+ }
+
+ public bool Flying => flying;
+
+ public bool HoldPosition
+ {
+ get
+ {
+ return holdPosition;
+ }
+ set
+ {
+ if (holdPosition == value)
+ {
+ return;
+ }
+ if (PlayerUpgradeManager.instance.commander)
+ {
+ if (value)
+ {
+ hp.ScaleHp(CommandUnits.instance.commanderHoldHealthMulti);
+ AutoAttack[] array = autoAttacks;
+ for (int i = 0; i < array.Length; i++)
+ {
+ array[i].DamageMultiplyer *= CommandUnits.instance.commanderHoldDamageMulti;
+ }
+ }
+ else
+ {
+ hp.ScaleHp(1f / CommandUnits.instance.commanderHoldHealthMulti);
+ AutoAttack[] array = autoAttacks;
+ for (int i = 0; i < array.Length; i++)
+ {
+ array[i].DamageMultiplyer /= CommandUnits.instance.commanderHoldDamageMulti;
+ }
+ }
+ }
+ holdPosition = value;
+ holdPositionMarker.SetActive(value);
+ if ((bool)holdPositionMarkerTransform)
+ {
+ holdPositionMarkerTransform.position = homePosition + 0.05f * Vector3.up;
+ }
+ }
+ }
+
+ public void FollowPlayer(bool _follow)
+ {
+ followingPlayer = _follow;
+ HoldPosition = false;
+ }
+
+ public override void GetAgroFromObject(TaggedObject _agroTarget)
+ {
+ }
+
+ private void OnDisable()
+ {
+ if ((bool)holdPositionMarker)
+ {
+ holdPositionMarker.SetActive(value: false);
+ }
+ }
+
+ private void OnEnable()
+ {
+ HoldPosition = false;
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+
+ public void OnDusk()
+ {
+ day = false;
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ day = true;
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ if (settingsManager.ResetUnitFormationEveryMorning)
+ {
+ homePosition = homePositionOriginal;
+ HoldPosition = false;
+ }
+ }
+
+ private void Start()
+ {
+ settingsManager = SettingsManager.Instance;
+ holdPositionMarkerTransform = holdPositionMarker.transform;
+ holdPositionMarkerTransform.SetParent(null);
+ HoldPosition = false;
+ seeker = GetComponent<Seeker>();
+ rvo = GetComponent<RVOController>();
+ recalculatePathCooldown = recalculatePathInterval * Random.value;
+ homePosition = base.transform.position;
+ homePositionOriginal = base.transform.position;
+ nearestConstraint.graphMask = seeker.graphMask;
+ graphMaskOriginal = seeker.graphMask;
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ flying = GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.Flying);
+ }
+
+ public void OriginalPathRequest()
+ {
+ seekToTargetPos = FindMoveToTarget();
+ seekToTargetPosSnappedtoNavmesh = AstarPath.active.GetNearest(seekToTargetPos, nearestConstraint).position;
+ storeRequestedTargetPos = seekToTargetPosSnappedtoNavmesh;
+ seeker.StartPath(base.transform.position, seekToTargetPosSnappedtoNavmesh, OriginalOnPathComplete, graphMaskOriginal);
+ }
+
+ private void OriginalOnPathComplete(Path _p)
+ {
+ if (backupMovementGraph != "")
+ {
+ if (_p.error)
+ {
+ BackupPathRequest();
+ return;
+ }
+ if ((storeRequestedTargetPos - _p.vectorPath[_p.vectorPath.Count - 1]).magnitude > 0.1f)
+ {
+ BackupPathRequest();
+ return;
+ }
+ }
+ else if (_p.error)
+ {
+ return;
+ }
+ path = _p.vectorPath;
+ nextPathPointIndex = 0;
+ }
+
+ private void BackupPathRequest()
+ {
+ seekToTargetPos = FindMoveToTarget();
+ seekToTargetPosSnappedtoNavmesh = AstarPath.active.GetNearest(seekToTargetPos, nearestConstraint).position;
+ storeRequestedTargetPos = seekToTargetPosSnappedtoNavmesh;
+ seeker.StartPath(base.transform.position, seekToTargetPosSnappedtoNavmesh, BackupOnPathComplete, GraphMask.FromGraphName(backupMovementGraph));
+ }
+
+ private void BackupOnPathComplete(Path _p)
+ {
+ if (!_p.error)
+ {
+ path = _p.vectorPath;
+ nextPathPointIndex = 0;
+ }
+ }
+
+ private Vector3 FindMoveToTarget()
+ {
+ if (followingPlayer)
+ {
+ seekToTaggedObj = null;
+ targetPrio = null;
+ currentlyWalkingHome = true;
+ return homePosition;
+ }
+ if (!hasReachedHomePositionAlready)
+ {
+ seekToTaggedObj = null;
+ targetPrio = null;
+ currentlyWalkingHome = true;
+ return homePosition;
+ }
+ currentlyWalkingHome = false;
+ for (int i = 0; i < targetPriorities.Count; i++)
+ {
+ targetPrio = targetPriorities[i];
+ Vector3 _outPosition;
+ if (holdPosition)
+ {
+ seekToTaggedObj = targetPrio.FindTaggedObjectCloseToHomeInHomeRange(base.transform.position, homePosition, 7f, out _outPosition);
+ }
+ else
+ {
+ seekToTaggedObj = targetPrio.FindTaggedObjectCloseToHome(base.transform.position, homePosition, maximumDistanceFromHome, out _outPosition);
+ }
+ if (!(seekToTaggedObj == null))
+ {
+ return _outPosition;
+ }
+ }
+ seekToTaggedObj = null;
+ targetPrio = null;
+ currentlyWalkingHome = true;
+ return homePosition;
+ }
+
+ private void Update()
+ {
+ recalculatePathCooldown -= Time.deltaTime;
+ if (recalculatePathCooldown <= 0f)
+ {
+ recalculatePathCooldown = recalculatePathInterval;
+ OriginalPathRequest();
+ }
+ if (followingPlayer)
+ {
+ if (path.Count > 0)
+ {
+ path[path.Count - 1] = homePosition;
+ }
+ seekToTargetPos = homePosition;
+ }
+ FollowPathUpdate();
+ }
+
+ public override void Slow(float _duration)
+ {
+ slowedFor = Mathf.Max(_duration, slowedFor);
+ }
+
+ private void FollowPathUpdate()
+ {
+ if (path.Count <= nextPathPointIndex)
+ {
+ if (!followingPlayer || path.Count <= 0)
+ {
+ return;
+ }
+ nextPathPointIndex = path.Count - 1;
+ }
+ nextPathPoint = path[nextPathPointIndex];
+ float magnitude = (base.transform.position - seekToTargetPos).magnitude;
+ if (magnitude < 3f && currentlyWalkingHome)
+ {
+ HasReachedHomePositionAlready = true;
+ }
+ Vector3 vector;
+ if (magnitude < keepDistanceOf && !currentlyWalkingHome)
+ {
+ vector = Vector3.zero;
+ nextPathPoint = base.transform.position;
+ }
+ else
+ {
+ vector = nextPathPoint - base.transform.position;
+ if (vector.magnitude <= 1f)
+ {
+ nextPathPointIndex++;
+ nextPathPointIndex = Mathf.Clamp(nextPathPointIndex, 0, path.Count - 1);
+ nextPathPoint = path[nextPathPointIndex];
+ vector = nextPathPoint - base.transform.position;
+ }
+ }
+ rvo.priority = vector.magnitude;
+ float num = (day ? (movementSpeed * speedBoostDuringDaytime) : movementSpeed);
+ if (slowedFor > 0f)
+ {
+ rvo.SetTarget(nextPathPoint, vector.magnitude * 3f, num * 0.33f);
+ slowedFor -= Time.deltaTime;
+ }
+ else
+ {
+ rvo.SetTarget(nextPathPoint, vector.magnitude * 3f, num);
+ }
+ Vector3 position = base.transform.position + rvo.CalculateMovementDelta(Time.deltaTime);
+ Vector3 position2 = AstarPath.active.GetNearest(position, nearestConstraint).position;
+ base.transform.position = position2;
+ }
+
+ public void SnapToNavmesh()
+ {
+ base.transform.position = AstarPath.active.GetNearest(base.transform.position, nearestConstraint).position;
+ }
+
+ public override void ClearCurrentPath()
+ {
+ path.Clear();
+ }
+
+ public Vector3 GetNearestGroundPosition(Vector3 _position)
+ {
+ return AstarPath.active.GetNearest(_position, nearestConstraint).position;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PaulsWaveGenerator.cs b/Thronefall_v1.57/Thronefall/Thronefall/PaulsWaveGenerator.cs
new file mode 100644
index 0000000..fbb2cfa
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PaulsWaveGenerator.cs
@@ -0,0 +1,238 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "New ET Settings", menuName = "SimpleSiege/Pauls Legacy Wave Generator")]
+public class PaulsWaveGenerator : EternalWaveGenerator
+{
+ [Serializable]
+ public class EnemySpawnGroup
+ {
+ public EternalTrialEnemy enemy;
+
+ public int count;
+
+ public EnemySpawnGroup(EternalTrialEnemy enemy, int count)
+ {
+ this.enemy = enemy;
+ this.count = count;
+ }
+ }
+
+ public int startGold = 10;
+
+ public int wavecount = 13;
+
+ public int maxNumberOfGroupsToSpawnSimultaneously = 2;
+
+ public float delayBetweenGroups = 5f;
+
+ public float initialWaveStrength = 6f;
+
+ public float targetWaveStrength = 300f;
+
+ [Range(0f, 1f)]
+ public float waveStrengthPerStageMultiplier = 0.15f;
+
+ public AnimationCurve strengthProgression = AnimationCurve.Linear(0f, 0f, 1f, 1f);
+
+ public int minGoldPerWave = 3;
+
+ public int maxGoldPerWave = 20;
+
+ public AnimationCurve goldProgression = AnimationCurve.Linear(0f, 0f, 1f, 1f);
+
+ public int minEnemyTypeLimitPerWave = 2;
+
+ public int maxEnemyTypeLimitPerWave = 5;
+
+ public AnimationCurve enemyTypeLimitProgression = AnimationCurve.Linear(0f, 0f, 1f, 1f);
+
+ public EternalTrialEnemySet enemySet;
+
+ private List<Transform> flyingSpawns = new List<Transform>();
+
+ private List<Transform> groundedSpawns = new List<Transform>();
+
+ public float[] strengthPerWave = new float[0];
+
+ public int[] goldPerWave = new int[0];
+
+ public int[] enemyTypeLimitPerWave = new int[0];
+
+ private void OnValidate()
+ {
+ RecalculateWaveParameters();
+ }
+
+ public void RecalculateWaveParameters()
+ {
+ RecalculateStrengthPerWave();
+ RecalculateGoldPerWave();
+ RecalculateEnemyTypeLimitPerWave();
+ }
+
+ private void RecalculateStrengthPerWave()
+ {
+ strengthPerWave = new float[wavecount];
+ for (int i = 0; i < wavecount; i++)
+ {
+ strengthPerWave[i] = Mathf.Lerp(initialWaveStrength, targetWaveStrength, strengthProgression.Evaluate(Mathf.InverseLerp(0f, wavecount - 1, i)));
+ }
+ }
+
+ private void RecalculateGoldPerWave()
+ {
+ goldPerWave = new int[wavecount];
+ for (int i = 0; i < wavecount; i++)
+ {
+ goldPerWave[i] = Mathf.RoundToInt(Mathf.Lerp(minGoldPerWave, maxGoldPerWave, goldProgression.Evaluate(Mathf.InverseLerp(0f, wavecount - 1, i))));
+ }
+ }
+
+ private void RecalculateEnemyTypeLimitPerWave()
+ {
+ enemyTypeLimitPerWave = new int[wavecount];
+ for (int i = 0; i < wavecount; i++)
+ {
+ enemyTypeLimitPerWave[i] = Mathf.RoundToInt(Mathf.Lerp(minEnemyTypeLimitPerWave, maxEnemyTypeLimitPerWave, enemyTypeLimitProgression.Evaluate(Mathf.InverseLerp(0f, wavecount - 1, i))));
+ }
+ }
+
+ public override List<Wave> GenerateWaves(EnemySpawnLine[] spawns, LevelInfo levelInfo, int stage, out int startingGold, int seed, int waveCountOverride = -1)
+ {
+ System.Random generator = new System.Random(seed);
+ startingGold = startGold;
+ flyingSpawns = new List<Transform>();
+ groundedSpawns = new List<Transform>();
+ foreach (EnemySpawnLine enemySpawnLine in spawns)
+ {
+ if (enemySpawnLine.canSpawnFlying)
+ {
+ flyingSpawns.Add(enemySpawnLine.SpawnLine);
+ }
+ if (enemySpawnLine.canSpawnSmallGround)
+ {
+ groundedSpawns.Add(enemySpawnLine.SpawnLine);
+ }
+ }
+ RecalculateWaveParameters();
+ List<Wave> list = new List<Wave>();
+ List<EternalTrialEnemy> list2 = new List<EternalTrialEnemy>(enemySet.enemies);
+ Dictionary<EternalTrialEnemy, int> openGroups = new Dictionary<EternalTrialEnemy, int>();
+ List<EnemySpawnGroup> closedGroups = new List<EnemySpawnGroup>();
+ List<EternalTrialEnemy> list3 = new List<EternalTrialEnemy>();
+ float num = 1f + (float)EternalTrialsRunManager.CurrentRun.stage * waveStrengthPerStageMultiplier;
+ float num2 = 0f;
+ int num3 = 0;
+ int num4 = 0;
+ for (int j = 0; j < wavecount; j++)
+ {
+ list3.Clear();
+ openGroups.Clear();
+ closedGroups.Clear();
+ num2 = strengthPerWave[j] * num;
+ num3 = goldPerWave[j];
+ num4 = enemyTypeLimitPerWave[j];
+ int num5 = 0;
+ while (num2 > 0f)
+ {
+ bool flag = false;
+ if (num5 < num4)
+ {
+ list2.ETShuffle(generator);
+ foreach (EternalTrialEnemy item in list2)
+ {
+ if (num2 >= item.difficultyValue)
+ {
+ num2 -= item.difficultyValue;
+ TryAddEnemyToGroup(item, ref openGroups, ref closedGroups);
+ flag = true;
+ if (!list3.Contains(item))
+ {
+ num5++;
+ list3.Add(item);
+ }
+ break;
+ }
+ }
+ }
+ else
+ {
+ list3.ETShuffle(generator);
+ foreach (EternalTrialEnemy item2 in list3)
+ {
+ if (num2 >= item2.difficultyValue)
+ {
+ num2 -= item2.difficultyValue;
+ TryAddEnemyToGroup(item2, ref openGroups, ref closedGroups);
+ flag = true;
+ break;
+ }
+ }
+ }
+ if (!flag)
+ {
+ break;
+ }
+ }
+ foreach (KeyValuePair<EternalTrialEnemy, int> item3 in openGroups)
+ {
+ closedGroups.Add(new EnemySpawnGroup(item3.Key, item3.Value));
+ }
+ Wave wave = new Wave();
+ int num6 = 0;
+ float num7 = 0f;
+ foreach (EnemySpawnGroup item4 in closedGroups)
+ {
+ num6++;
+ if (num6 > maxNumberOfGroupsToSpawnSimultaneously)
+ {
+ num6 = 0;
+ num7 += delayBetweenGroups;
+ }
+ Spawn spawn = new Spawn();
+ if (num3 > 0)
+ {
+ num3 -= (spawn.goldCoins = UnityEngine.Random.Range(1, num3 + 1));
+ }
+ spawn.count = item4.count;
+ spawn.interval = 0.15f;
+ spawn.delay = num7;
+ spawn.enemyPrefab = item4.enemy.enemyPrefab;
+ if (item4.enemy.flying)
+ {
+ spawn.spawnLine = flyingSpawns[UnityEngine.Random.Range(0, flyingSpawns.Count)];
+ }
+ else
+ {
+ spawn.spawnLine = groundedSpawns[UnityEngine.Random.Range(0, groundedSpawns.Count)];
+ }
+ wave.spawns.Add(spawn);
+ }
+ if (num3 > 0)
+ {
+ wave.spawns[0].goldCoins += num3;
+ }
+ list.Add(wave);
+ }
+ return list;
+ }
+
+ private void TryAddEnemyToGroup(EternalTrialEnemy e, ref Dictionary<EternalTrialEnemy, int> openGroups, ref List<EnemySpawnGroup> closedGroups)
+ {
+ if (openGroups.ContainsKey(e))
+ {
+ openGroups[e]++;
+ if (openGroups[e] + 1 > e.desiredGroupSize)
+ {
+ closedGroups.Add(new EnemySpawnGroup(e, openGroups[e]));
+ openGroups.Remove(e);
+ }
+ }
+ else
+ {
+ openGroups.Add(e, 1);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PauseBackToMenuHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/PauseBackToMenuHelper.cs
new file mode 100644
index 0000000..5071191
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PauseBackToMenuHelper.cs
@@ -0,0 +1,9 @@
+using UnityEngine;
+
+public class PauseBackToMenuHelper : MonoBehaviour
+{
+ public void BackToMenu()
+ {
+ SceneTransitionManager.instance.TransitionFromLevelToLevelSelect();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PauseUILoadoutHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/PauseUILoadoutHelper.cs
new file mode 100644
index 0000000..044e5c7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PauseUILoadoutHelper.cs
@@ -0,0 +1,235 @@
+using System.Collections.Generic;
+using I2.Loc;
+using TMPro;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class PauseUILoadoutHelper : MonoBehaviour
+{
+ public ThronefallUIElement topmostButton;
+
+ public ThronefallUIElement botmostButton;
+
+ public GridLayoutGroup loadoutGroup;
+
+ public GridLayoutGroup enemyPreview;
+
+ public TFUIEquippable equippableButtonPrefab;
+
+ public TFUIEnemy enemyButtonPrefab;
+
+ public TFUIIncomeDisplay incomeDisplayPrefab;
+
+ public TextMeshProUGUI nightPreviewText;
+
+ private List<ThronefallUIElement> loadoutGrid = new List<ThronefallUIElement>();
+
+ private List<ThronefallUIElement> enemyGrid = new List<ThronefallUIElement>();
+
+ private const int maxRows = 2;
+
+ public void Refresh()
+ {
+ if (SceneTransitionManager.instance.CurrentSceneState != SceneTransitionManager.SceneState.InGame)
+ {
+ return;
+ }
+ loadoutGrid.Clear();
+ foreach (Transform item in loadoutGroup.transform)
+ {
+ Object.Destroy(item.gameObject);
+ }
+ List<Equippable> list = new List<Equippable>();
+ List<Equippable> list2 = new List<Equippable>();
+ List<Equippable> list3 = new List<Equippable>();
+ foreach (Equippable item2 in PerkManager.instance.CurrentlyEquipped)
+ {
+ if (item2 is EquippableWeapon)
+ {
+ list.Add(item2);
+ }
+ else if (item2 is EquippablePerk)
+ {
+ list2.Add(item2);
+ }
+ else if (item2 is EquippableMutation)
+ {
+ list3.Add(item2);
+ }
+ }
+ foreach (Equippable item3 in list)
+ {
+ AddTFUIEquippable(loadoutGroup, item3);
+ }
+ foreach (Equippable item4 in list2)
+ {
+ AddTFUIEquippable(loadoutGroup, item4);
+ }
+ foreach (Equippable item5 in list3)
+ {
+ AddTFUIEquippable(loadoutGroup, item5);
+ }
+ if (EnemySpawner.instance != null)
+ {
+ enemyPreview.gameObject.SetActive(value: true);
+ nightPreviewText.gameObject.SetActive(value: true);
+ WaveInfo waveInfoForNextWave = EnemySpawner.GetWaveInfoForNextWave();
+ if (waveInfoForNextWave != null)
+ {
+ enemyGrid.Clear();
+ foreach (Transform item6 in enemyPreview.transform)
+ {
+ Object.Destroy(item6.gameObject);
+ }
+ foreach (WaveEnemyInfo enemy in waveInfoForNextWave.enemies)
+ {
+ AddTFUIEnemey(enemyPreview, enemy);
+ }
+ AddIncomePreview(enemyPreview);
+ nightPreviewText.text = LocalizationManager.GetTranslation("Menu/Night") + ": <style=Body Numerals>" + waveInfoForNextWave.waveNumber + "</style>/<style=Body Numerals>" + waveInfoForNextWave.outOfWaves;
+ }
+ }
+ else
+ {
+ enemyPreview.gameObject.SetActive(value: false);
+ nightPreviewText.gameObject.SetActive(value: false);
+ }
+ AssignNavigationTargets();
+ }
+
+ private void AddTFUIEquippable(GridLayoutGroup parent, Equippable e)
+ {
+ TFUIEquippable component = Object.Instantiate(equippableButtonPrefab, parent.transform).GetComponent<TFUIEquippable>();
+ component.SetDataSimple(e);
+ loadoutGrid.Add(component);
+ }
+
+ private void AddTFUIEnemey(GridLayoutGroup parent, WaveEnemyInfo e)
+ {
+ TFUIEnemy tFUIEnemy = Object.Instantiate(enemyButtonPrefab, parent.transform);
+ tFUIEnemy.SetDataSimple(e);
+ enemyGrid.Add(tFUIEnemy);
+ }
+
+ private void AddIncomePreview(GridLayoutGroup parent)
+ {
+ TFUIIncomeDisplay tFUIIncomeDisplay = Object.Instantiate(incomeDisplayPrefab, parent.transform);
+ tFUIIncomeDisplay.UpdateData();
+ enemyGrid.Add(tFUIIncomeDisplay);
+ }
+
+ private void AssignNavigationTargets()
+ {
+ ThronefallUIElement botElement = topmostButton;
+ if (loadoutGrid.Count > 0)
+ {
+ botElement = loadoutGrid[0];
+ }
+ CalculateGridNavigation(enemyGrid, botElement, botmostButton, isTopMostGrid: true, isBotMostGrid: false);
+ ThronefallUIElement topElement = botmostButton;
+ if (enemyGrid.Count > 0)
+ {
+ topElement = enemyGrid[0];
+ }
+ CalculateGridNavigation(loadoutGrid, topmostButton, topElement, isTopMostGrid: false, isBotMostGrid: true);
+ }
+
+ private void CalculateGridNavigation(List<ThronefallUIElement> grid, ThronefallUIElement botElement, ThronefallUIElement topElement, bool isTopMostGrid, bool isBotMostGrid)
+ {
+ int num = grid.Count / 2;
+ int num2 = grid.Count % 2;
+ if (num2 > 0)
+ {
+ num++;
+ }
+ else
+ {
+ num2 = 2;
+ }
+ int num3 = 0;
+ int num4 = 0;
+ for (int i = 0; i < grid.Count; i++)
+ {
+ ThronefallUIElement thronefallUIElement = grid[i];
+ if (num3 == 0)
+ {
+ thronefallUIElement.topNav = topElement;
+ }
+ else
+ {
+ thronefallUIElement.topNav = grid[i - 1];
+ }
+ if (num3 == 1 || (num == 1 && i == grid.Count - 1))
+ {
+ thronefallUIElement.botNav = botElement;
+ }
+ else if (num > 1 && i == grid.Count - 1)
+ {
+ thronefallUIElement.botNav = grid[2 * num4 - 1];
+ }
+ else
+ {
+ thronefallUIElement.botNav = grid[i + 1];
+ }
+ if (num > 1)
+ {
+ if (num4 == 0)
+ {
+ if (num3 <= num2 - 1)
+ {
+ thronefallUIElement.leftNav = grid[grid.Count - (num2 - num3)];
+ }
+ else if (i + 2 <= grid.Count - 1)
+ {
+ thronefallUIElement.leftNav = grid[i + 2];
+ }
+ }
+ else
+ {
+ thronefallUIElement.leftNav = grid[i - 2];
+ }
+ if (num4 == num - 1)
+ {
+ thronefallUIElement.rightNav = grid[i - 2 * (num - 1)];
+ }
+ else
+ {
+ int num5 = i + 2;
+ if (num5 <= grid.Count - 1)
+ {
+ thronefallUIElement.rightNav = grid[num5];
+ }
+ else
+ {
+ thronefallUIElement.rightNav = grid[i - 2 * num4];
+ }
+ }
+ }
+ num3++;
+ if (num3 > 1)
+ {
+ num3 = 0;
+ num4++;
+ }
+ }
+ if (grid.Count <= 0)
+ {
+ return;
+ }
+ if (isTopMostGrid)
+ {
+ botmostButton.botNav = grid[0];
+ }
+ if (isBotMostGrid)
+ {
+ if (num2 != 2 && num > 1)
+ {
+ topmostButton.topNav = grid[2 * (num - 1) - 1];
+ }
+ else
+ {
+ topmostButton.topNav = grid[grid.Count - 1];
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PeriodicallyEnableAndDisableDuringEnemySpawn.cs b/Thronefall_v1.57/Thronefall/Thronefall/PeriodicallyEnableAndDisableDuringEnemySpawn.cs
new file mode 100644
index 0000000..ed32d7f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PeriodicallyEnableAndDisableDuringEnemySpawn.cs
@@ -0,0 +1,29 @@
+using UnityEngine;
+
+public class PeriodicallyEnableAndDisableDuringEnemySpawn : MonoBehaviour
+{
+ [SerializeField]
+ private MonoBehaviour toEnableAndDisable;
+
+ [SerializeField]
+ private float enabledDuration = 10f;
+
+ [SerializeField]
+ private float disabledDuration = 10f;
+
+ private EnemySpawner enemySpawner;
+
+ private float totalTime;
+
+ private void Start()
+ {
+ enemySpawner = EnemySpawner.instance;
+ totalTime = enabledDuration + disabledDuration;
+ }
+
+ private void Update()
+ {
+ float lastSpawnPeriodClock = enemySpawner.LastSpawnPeriodClock;
+ toEnableAndDisable.enabled = lastSpawnPeriodClock % totalTime < enabledDuration;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkCooldownModifyer.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkCooldownModifyer.cs
new file mode 100644
index 0000000..44dc5a7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkCooldownModifyer.cs
@@ -0,0 +1,21 @@
+using UnityEngine;
+
+public class PerkCooldownModifyer : MonoBehaviour
+{
+ public Equippable requiredPerk;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float hpCooldownMultiplyer;
+
+ public AutoAttack autoAttack;
+
+ private void Start()
+ {
+ if (PerkManager.IsEquipped(requiredPerk))
+ {
+ autoAttack.cooldownDuration *= hpCooldownMultiplyer;
+ autoAttack.recheckTargetInterval *= hpCooldownMultiplyer;
+ }
+ Object.Destroy(this);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkCostModifyer.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkCostModifyer.cs
new file mode 100644
index 0000000..b924e0b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkCostModifyer.cs
@@ -0,0 +1,26 @@
+using UnityEngine;
+
+public class PerkCostModifyer : MonoBehaviour
+{
+ public Equippable requiredPerk;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public int[] upgradeCostChange;
+
+ private void Start()
+ {
+ if (PerkManager.IsEquipped(requiredPerk))
+ {
+ BuildSlot component = GetComponent<BuildSlot>();
+ for (int i = 0; i < component.Upgrades.Count; i++)
+ {
+ BuildSlot.Upgrade upgrade = component.Upgrades[i];
+ if (!component.UpgradesWithCostsLoadedFromSave.Contains(upgrade))
+ {
+ upgrade.cost += upgradeCostChange[i];
+ }
+ }
+ }
+ Object.Destroy(this);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkDamageAutoAttackModifyer.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkDamageAutoAttackModifyer.cs
new file mode 100644
index 0000000..dd35dc8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkDamageAutoAttackModifyer.cs
@@ -0,0 +1,23 @@
+using UnityEngine;
+
+public class PerkDamageAutoAttackModifyer : MonoBehaviour
+{
+ [SerializeField]
+ private Equippable perk;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float damageMultiplyer;
+
+ private void Start()
+ {
+ if (PerkManager.instance.CurrentlyEquipped.Contains(perk))
+ {
+ AutoAttack[] componentsInChildren = GetComponentsInChildren<AutoAttack>(includeInactive: true);
+ for (int i = 0; i < componentsInChildren.Length; i++)
+ {
+ componentsInChildren[i].DamageMultiplyer *= damageMultiplyer;
+ }
+ }
+ Object.Destroy(this);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkDamageModifyerPlayerunitAuto.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkDamageModifyerPlayerunitAuto.cs
new file mode 100644
index 0000000..1ceed5c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkDamageModifyerPlayerunitAuto.cs
@@ -0,0 +1,54 @@
+using UnityEngine;
+
+public class PerkDamageModifyerPlayerunitAuto : MonoBehaviour
+{
+ private void Start()
+ {
+ PerkManager instance = PerkManager.instance;
+ if (instance.ArcherySkillsActive)
+ {
+ AutoAttack[] componentsInChildren = GetComponentsInChildren<AutoAttack>(includeInactive: true);
+ for (int i = 0; i < componentsInChildren.Length; i++)
+ {
+ componentsInChildren[i].ProjectileSpeedMultiplyer *= instance.archerySkills_projectileSpeedMulti;
+ }
+ }
+ if (instance.WarriorModeActive)
+ {
+ AutoAttack[] componentsInChildren = GetComponentsInChildren<AutoAttack>(includeInactive: true);
+ for (int i = 0; i < componentsInChildren.Length; i++)
+ {
+ componentsInChildren[i].DamageMultiplyer *= instance.warriorModeAllyDmgMulti;
+ }
+ HotOilTower[] componentsInChildren2 = GetComponentsInChildren<HotOilTower>(includeInactive: true);
+ for (int i = 0; i < componentsInChildren2.Length; i++)
+ {
+ componentsInChildren2[i].DamageMultiplyer *= instance.warriorModeAllyDmgMulti;
+ }
+ BarricadeDamage[] componentsInChildren3 = GetComponentsInChildren<BarricadeDamage>(includeInactive: true);
+ for (int i = 0; i < componentsInChildren3.Length; i++)
+ {
+ componentsInChildren3[i].DamageMultiplyer *= instance.warriorModeAllyDmgMulti;
+ }
+ }
+ if (instance.CommanderModeActive)
+ {
+ AutoAttack[] componentsInChildren = GetComponentsInChildren<AutoAttack>(includeInactive: true);
+ for (int i = 0; i < componentsInChildren.Length; i++)
+ {
+ componentsInChildren[i].DamageMultiplyer *= instance.commanderModeAllyDmgMulti;
+ }
+ HotOilTower[] componentsInChildren2 = GetComponentsInChildren<HotOilTower>(includeInactive: true);
+ for (int i = 0; i < componentsInChildren2.Length; i++)
+ {
+ componentsInChildren2[i].DamageMultiplyer *= instance.commanderModeAllyDmgMulti;
+ }
+ BarricadeDamage[] componentsInChildren3 = GetComponentsInChildren<BarricadeDamage>(includeInactive: true);
+ for (int i = 0; i < componentsInChildren3.Length; i++)
+ {
+ componentsInChildren3[i].DamageMultiplyer *= instance.commanderModeAllyDmgMulti;
+ }
+ }
+ Object.Destroy(this);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkDestroyGameObjectModifyer.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkDestroyGameObjectModifyer.cs
new file mode 100644
index 0000000..4d761ac
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkDestroyGameObjectModifyer.cs
@@ -0,0 +1,47 @@
+using UnityEngine;
+
+public class PerkDestroyGameObjectModifyer : MonoBehaviour
+{
+ [SerializeField]
+ private Equippable perk;
+
+ [SerializeField]
+ private bool destroyIfPerkIsEquipped;
+
+ [SerializeField]
+ private bool destroyIfPerkIsNotEquipped;
+
+ public bool IsGoingToBeDestroyed
+ {
+ get
+ {
+ if (PerkManager.IsEquipped(perk))
+ {
+ if (destroyIfPerkIsEquipped)
+ {
+ return true;
+ }
+ }
+ else if (destroyIfPerkIsNotEquipped)
+ {
+ return true;
+ }
+ return false;
+ }
+ }
+
+ private void Start()
+ {
+ if (PerkManager.IsEquipped(perk))
+ {
+ if (destroyIfPerkIsEquipped)
+ {
+ Object.Destroy(base.gameObject);
+ }
+ }
+ else if (destroyIfPerkIsNotEquipped)
+ {
+ Object.Destroy(base.gameObject);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkHpModifyer.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkHpModifyer.cs
new file mode 100644
index 0000000..0720cc5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkHpModifyer.cs
@@ -0,0 +1,74 @@
+using UnityEngine;
+
+public class PerkHpModifyer : MonoBehaviour, ISaveLoad
+{
+ public Equippable requiredPerk;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float hpMultiplyer;
+
+ public Hp hp;
+
+ [SerializeField]
+ private bool isUnit;
+
+ private bool executed;
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ Execute(heal: false);
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ }
+
+ public void OnSave(string guid)
+ {
+ }
+
+ private void Start()
+ {
+ Execute(heal: true);
+ }
+
+ private void Execute(bool heal)
+ {
+ if (executed)
+ {
+ return;
+ }
+ executed = true;
+ if (PerkManager.IsEquipped(requiredPerk))
+ {
+ if (!isUnit)
+ {
+ BuildSlot buildSlot = GetComponent<BuildSlot>();
+ if (!buildSlot)
+ {
+ buildSlot = GetComponentInParent<BuildSlot>();
+ }
+ if ((bool)buildSlot)
+ {
+ foreach (BuildSlot.Upgrade ownUpgrade in buildSlot.OwnUpgrades)
+ {
+ foreach (BuildSlot.UpgradeBranch upgradeBranch in ownUpgrade.upgradeBranches)
+ {
+ upgradeBranch.hpChange = Mathf.RoundToInt((float)upgradeBranch.hpChange * hpMultiplyer);
+ }
+ }
+ }
+ }
+ hp.maxHp *= hpMultiplyer;
+ if (heal)
+ {
+ hp.Heal(float.MaxValue);
+ }
+ }
+ Object.Destroy(this);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkIncomeModifyer.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkIncomeModifyer.cs
new file mode 100644
index 0000000..cbdb207
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkIncomeModifyer.cs
@@ -0,0 +1,54 @@
+using UnityEngine;
+
+public class PerkIncomeModifyer : MonoBehaviour, ISaveLoad
+{
+ public Equippable requiredPerk;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public int[] upgradeIncomeChange;
+
+ private bool executed;
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ Execute();
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ }
+
+ public void OnSave(string guid)
+ {
+ }
+
+ private void Start()
+ {
+ Execute();
+ }
+
+ private void Execute()
+ {
+ if (executed)
+ {
+ return;
+ }
+ executed = true;
+ if (PerkManager.IsEquipped(requiredPerk))
+ {
+ BuildSlot component = GetComponent<BuildSlot>();
+ for (int i = 0; i < component.Upgrades.Count; i++)
+ {
+ foreach (BuildSlot.UpgradeBranch upgradeBranch in component.Upgrades[i].upgradeBranches)
+ {
+ upgradeBranch.goldIncomeChange += upgradeIncomeChange[i];
+ }
+ }
+ }
+ Object.Destroy(this);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkIndestructible.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkIndestructible.cs
new file mode 100644
index 0000000..0cb04c7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkIndestructible.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+
+public class PerkIndestructible : MonoBehaviour
+{
+ [SerializeField]
+ private Equippable indestructiblePerk;
+
+ private void Start()
+ {
+ if (PerkManager.IsEquipped(indestructiblePerk))
+ {
+ TaggedObject componentInChildren = GetComponentInChildren<TaggedObject>();
+ if ((bool)componentInChildren)
+ {
+ componentInChildren.RemoveTag(TagManager.ETag.PlayerOwned);
+ }
+ }
+ Object.Destroy(this);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkManager.cs
new file mode 100644
index 0000000..14376b7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkManager.cs
@@ -0,0 +1,403 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class PerkManager : MonoBehaviour
+{
+ public const int MaxLevel = 1000000;
+
+ public static PerkManager instance;
+
+ [Header("Equippables: ")]
+ [SerializeField]
+ private List<Equippable> currentlyEquipped;
+
+ [SerializeField]
+ private List<Equippable> unlockedEquippables;
+
+ public List<Equippable> countQuestsAsIncompleteWith = new List<Equippable>();
+
+ [Header("Leveling system: ")]
+ public int xp;
+
+ public int level = 1;
+
+ [SerializeField]
+ private List<MetaLevel> metaLevels;
+
+ public Equippable royalMint;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public int royalMint_startGoldBonus = 1;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float heavyArmor_HpMultiplyer;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float heavyArmor_SpeedMultiplyer;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float heavyArmor_SelfHealMultiplyer;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float godsLotion_RegenRateMultiplyer;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float godsLotion_RegenDelayMultiplyer;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float racingHorse_SpeedMultiplyer;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float gladiatorSchool_TrainingSpeedMultiplyer;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float elliteWarriors_TrainingSpeedMultiplyer;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float tauntTheTiger_damageMultiplyer;
+
+ public Equippable tigerGodPerk;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float tauntTheTurtle_hpMultiplyer;
+
+ public Equippable turtleGodPerk;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float tauntTheFalcon_speedMultiplyer;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float tauntTheFalcon_chasePlayerTimeMultiplyer;
+
+ public Equippable falconGodPerk;
+
+ public Equippable ratGodPerk;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float ratGod_GoldModifyer = 0.5f;
+
+ public Equippable warriorMode;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float warriorModeAllyDmgMulti = 0.5f;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float warriorModeSelfDmgMultiMax = 2f;
+
+ public Equippable commanderMode;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float commanderModeAllyDmgMulti = 1.5f;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float commanderModeSelfDmgMulti = 0.5f;
+
+ public Equippable glassCanon;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float glassCanon_dmgMulti = 1.5f;
+
+ public Equippable healintSpirits;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float healingSpirits_healMulti = 1.5f;
+
+ public Equippable archerySkills;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float archerySkills_projectileSpeedMulti = 1.8f;
+
+ public Equippable iceMagic;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float iceMagic_AdditionalsSlowMutli = 0.75f;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float iceMagic_SlowDurationMulti = 2f;
+
+ public Equippable rangedResistence;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float rangedResistence_AmountMulti = 1.3f;
+
+ public Equippable meleeResistence;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float meleeResistence_AmountMulti = 1.3f;
+
+ [BalancingParameter(BalancingParameter.EType.Percentage)]
+ public float powerTower_attackSpeedBonus = 2f;
+
+ public Equippable treasureHunter;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public int treasureHunterGoldAmountWave1 = 10;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public int treasureHunterGoldAmountWave2 = 20;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public int treasureHunterGoldAmountWave3 = 30;
+
+ public Equippable cheeseGod;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float cheeseGod_firstWavesSpawnSpeed = 1.25f;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float cheeseGod_spawnAmountMulti = 2f;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public int cheeseGod_affectedNights = 3;
+
+ public Equippable godOfDeath;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float godOfDeath_playerRespawnMultiplyer = 2f;
+
+ public Equippable destructionGod;
+
+ [BalancingParameter(BalancingParameter.EType.Percentage)]
+ public float destructionGodHealthRegen = 0.33f;
+
+ public Equippable tauntThePhoenixGod;
+
+ [BalancingParameter(BalancingParameter.EType.Percentage)]
+ public float phoenixGod_HealingPercentagePerSec = 0.2f;
+
+ public Equippable healthPotions;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public float healthPotion_HealingPerSec = 4f;
+
+ public Equippable antiAirTelescope;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float antiAir_helathMultiplyer = 0.75f;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float antiAir_damageMultiplyer = 0.75f;
+
+ public Equippable strongerHerosActive;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float strongerHeros_healthMutli = 1.4f;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float strongerHeros_damageMulti = 1.4f;
+
+ public Equippable meleeDamage;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float meleeDamage_multi = 1.25f;
+
+ public Equippable rangedDamage;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float rangedDamage_multi = 1.25f;
+
+ public Equippable prayToWarGods;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float prayWarGods_hpMulti = 0.8f;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float prayWarGods_dmgMulti = 0.8f;
+
+ public Equippable spellScroll;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float spellScrollActiveCooldownMulti = 0.65f;
+
+ public Equippable lightMaterials;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float lightMaterialsCooldownMulti = 0.75f;
+
+ public Equippable loan;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public int loanBonusMoney;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public int loanInterestMoney;
+
+ public Equippable riskTaker;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float riskTakerMaxBonusDamageMultiplyer;
+
+ public Equippable eliteTowers;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float eliteTowerDamageMultiplyer;
+
+ public Equippable eliteGod;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public int eliteGodSpawnInterval;
+
+ public Equippable growthGod;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float growthGodMaxDamageMulti;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float growthGodMaxHpMulti;
+
+ public Equippable rangeGod;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float rangeGodRangeMultiplyer;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float rangeGodMoveSpeedMultiplyer;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float rangeGodHealthMultiplyer;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float rangeGodDamageMultiplyer;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float rangeGodAttackCooldownMultiplyer;
+
+ public List<Equippable> UnlockedEquippables => unlockedEquippables;
+
+ public List<Equippable> CurrentlyEquipped => currentlyEquipped;
+
+ public List<MetaLevel> MetaLevels => metaLevels;
+
+ public MetaLevel NextMetaLevel
+ {
+ get
+ {
+ if (level - 1 >= metaLevels.Count || level >= 1000000)
+ {
+ return null;
+ }
+ return metaLevels[level - 1];
+ }
+ }
+
+ public bool RoyalMintActive => IsEquipped(royalMint);
+
+ public bool RatGodActive => IsEquipped(ratGodPerk);
+
+ public bool WarriorModeActive => IsEquipped(warriorMode);
+
+ public bool CommanderModeActive => IsEquipped(commanderMode);
+
+ public bool GlassCanonActive => IsEquipped(glassCanon);
+
+ public bool HealingSpiritsActive => IsEquipped(healintSpirits);
+
+ public bool ArcherySkillsActive => IsEquipped(archerySkills);
+
+ public bool IceMagicActive => IsEquipped(iceMagic);
+
+ public bool RangedResistenceActive => IsEquipped(rangedResistence);
+
+ public bool MeleeResistenceActive => IsEquipped(meleeResistence);
+
+ public bool TreasureHunterActive => IsEquipped(treasureHunter);
+
+ public bool CheeseGodActive => IsEquipped(cheeseGod);
+
+ public bool GodOfDeathActive => IsEquipped(godOfDeath);
+
+ public bool DestructionGodActive => IsEquipped(destructionGod);
+
+ public bool TauntThePhoenixGodActive => IsEquipped(tauntThePhoenixGod);
+
+ public bool HealthPotionsActive => IsEquipped(healthPotions);
+
+ public bool AntiAirTelescope => IsEquipped(antiAirTelescope);
+
+ public bool StrongerHeros => IsEquipped(strongerHerosActive);
+
+ public bool MeleeDamageActive => IsEquipped(meleeDamage);
+
+ public bool RangedDamageActive => IsEquipped(rangedDamage);
+
+ public bool PrayToWarGodsActive => IsEquipped(prayToWarGods);
+
+ public bool SpellScrollActive => IsEquipped(spellScroll);
+
+ public bool LightMaterialsEquipped => IsEquipped(lightMaterials);
+
+ public bool LoanEquipped => IsEquipped(loan);
+
+ public bool RiskTakerEquipped => IsEquipped(riskTaker);
+
+ public bool EliteTowersEquipped => IsEquipped(eliteTowers);
+
+ public bool EliteGodEquipped => IsEquipped(eliteGod);
+
+ public bool GrowthGodEquipped => IsEquipped(growthGod);
+
+ public bool RangeGodEquipped => IsEquipped(rangeGod);
+
+ private void Awake()
+ {
+ if ((bool)instance)
+ {
+ Object.Destroy(base.gameObject);
+ return;
+ }
+ instance = this;
+ Object.DontDestroyOnLoad(base.transform.root.gameObject);
+ }
+
+ public static bool IsEquipped(Equippable _perk)
+ {
+ if (!instance)
+ {
+ return false;
+ }
+ if (_perk == null)
+ {
+ return false;
+ }
+ return instance.currentlyEquipped.Contains(_perk);
+ }
+
+ public static void SetEquipped(Equippable _perk, bool _equipped)
+ {
+ if (!instance)
+ {
+ return;
+ }
+ if (_equipped)
+ {
+ if (!instance.currentlyEquipped.Contains(_perk))
+ {
+ instance.currentlyEquipped.Add(_perk);
+ }
+ }
+ else if (instance.currentlyEquipped.Contains(_perk))
+ {
+ instance.currentlyEquipped.Remove(_perk);
+ }
+ }
+
+ public static void ClearAllEquipped()
+ {
+ if ((bool)instance)
+ {
+ instance.currentlyEquipped.Clear();
+ }
+ }
+
+ public void CallAfterLoadToUnlockPerksAndStuff()
+ {
+ level = Mathf.Min(level, 1000000);
+ for (int i = 0; i < Mathf.Min(metaLevels.Count, level - 1); i++)
+ {
+ if (!unlockedEquippables.Contains(metaLevels[i].reward) || metaLevels[i].reward.GetType() == typeof(PerkPoint))
+ {
+ unlockedEquippables.Add(metaLevels[i].reward);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkPlayerHealthRegen.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkPlayerHealthRegen.cs
new file mode 100644
index 0000000..63ef11d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkPlayerHealthRegen.cs
@@ -0,0 +1,46 @@
+using UnityEngine;
+
+public class PerkPlayerHealthRegen : MonoBehaviour, ISaveLoad
+{
+ public Equippable requiredPerk;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float hpRegenMultiplyer;
+
+ private bool executed;
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ Execute(heal: false);
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ }
+
+ public void OnSave(string guid)
+ {
+ }
+
+ private void Start()
+ {
+ Execute(heal: true);
+ }
+
+ private void Execute(bool heal)
+ {
+ if (!executed)
+ {
+ executed = true;
+ if (PerkManager.IsEquipped(requiredPerk))
+ {
+ PlayerUpgradeManager.instance.PlayerHealthRegenerationMultiplyer *= hpRegenMultiplyer;
+ Object.Destroy(this);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkPoint.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkPoint.cs
new file mode 100644
index 0000000..b339e08
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkPoint.cs
@@ -0,0 +1,6 @@
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "Data", menuName = "SimpleSiege/Perk Point", order = 1)]
+public class PerkPoint : Equippable
+{
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkRangeModifyer.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkRangeModifyer.cs
new file mode 100644
index 0000000..5e685fa
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkRangeModifyer.cs
@@ -0,0 +1,31 @@
+using UnityEngine;
+
+public class PerkRangeModifyer : MonoBehaviour
+{
+ public Equippable requiredPerk;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float rangeMultiplyer;
+
+ public AutoAttack autoAttack;
+
+ public PathfindMovementPlayerunit pathfindMovement;
+
+ public bool IsActive => PerkManager.IsEquipped(requiredPerk);
+
+ private void Start()
+ {
+ if (PerkManager.IsEquipped(requiredPerk))
+ {
+ foreach (TargetPriority targetPriority in autoAttack.targetPriorities)
+ {
+ targetPriority.range *= rangeMultiplyer;
+ }
+ if ((bool)pathfindMovement)
+ {
+ pathfindMovement.keepDistanceOf *= rangeMultiplyer;
+ }
+ }
+ Object.Destroy(this);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkSelectionGroup.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkSelectionGroup.cs
new file mode 100644
index 0000000..b64a091
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkSelectionGroup.cs
@@ -0,0 +1,165 @@
+using System.Collections.Generic;
+using TMPro;
+using UnityEngine;
+
+public class PerkSelectionGroup : MonoBehaviour
+{
+ private enum Type
+ {
+ Weapons,
+ Perks,
+ Mutations,
+ FixedLoadout
+ }
+
+ public GameObject perkSelectionItemPrefab;
+
+ public GameObject perkLockedPrefab;
+
+ [SerializeField]
+ private Type type;
+
+ private PerkManager perkManager;
+
+ private int selectableAmount = 10000;
+
+ private List<PerkSelectionItem> selectedInMyGroup = new List<PerkSelectionItem>();
+
+ [SerializeField]
+ private TMP_Text headerText;
+
+ [SerializeField]
+ private string selectNone = "No perks unlocked yet.";
+
+ [SerializeField]
+ private string selectOne = "Select one perk.";
+
+ [SerializeField]
+ private string selectMulti = "Select <n> perks.";
+
+ [SerializeField]
+ private bool canDeselectPerks = true;
+
+ [SerializeField]
+ private Color textColorNormal = Color.white;
+
+ [SerializeField]
+ private Color textColorWarning = Color.red;
+
+ private int unlockedPerks;
+
+ private void Start()
+ {
+ UpdateVisuals();
+ }
+
+ public void UpdateVisuals()
+ {
+ perkManager = PerkManager.instance;
+ int num = 0;
+ for (int num2 = base.transform.childCount - 1; num2 >= 0; num2--)
+ {
+ Object.Destroy(base.transform.GetChild(num2).gameObject);
+ }
+ unlockedPerks = 0;
+ for (int i = 0; i < perkManager.UnlockedEquippables.Count; i++)
+ {
+ Equippable equippable = perkManager.UnlockedEquippables[i];
+ if (equippable.GetType() == typeof(PerkPoint))
+ {
+ num++;
+ }
+ if ((type == Type.Weapons && equippable.GetType() == typeof(EquippableWeapon)) || (type == Type.Perks && equippable.GetType() == typeof(EquippablePerk)) || (type == Type.Mutations && equippable.GetType() == typeof(EquippableMutation)))
+ {
+ Object.Instantiate(perkSelectionItemPrefab, base.transform).GetComponent<PerkSelectionItem>().Initialize(equippable);
+ unlockedPerks++;
+ }
+ }
+ for (int j = 0; j < perkManager.MetaLevels.Count; j++)
+ {
+ Equippable reward = perkManager.MetaLevels[j].reward;
+ if (((type == Type.Weapons && reward.GetType() == typeof(EquippableWeapon)) || (type == Type.Perks && reward.GetType() == typeof(EquippablePerk)) || (type == Type.Mutations && reward.GetType() == typeof(EquippableMutation))) && !perkManager.UnlockedEquippables.Contains(reward))
+ {
+ Object.Instantiate(perkLockedPrefab, base.transform);
+ }
+ }
+ if (type == Type.FixedLoadout && LevelInteractor.lastActiveLevelInfo != null)
+ {
+ selectableAmount = 0;
+ LevelInfo lastActiveLevelInfo = LevelInteractor.lastActiveLevelInfo;
+ for (int k = 0; k < lastActiveLevelInfo.fixedLoadout.Count; k++)
+ {
+ Equippable equippable2 = lastActiveLevelInfo.fixedLoadout[k];
+ PerkSelectionItem component = Object.Instantiate(perkSelectionItemPrefab, base.transform).GetComponent<PerkSelectionItem>();
+ component.Selected = true;
+ component.Initialize(equippable2);
+ selectableAmount++;
+ }
+ }
+ if (type == Type.Weapons)
+ {
+ selectableAmount = 1;
+ }
+ if (type == Type.Perks)
+ {
+ selectableAmount = num;
+ }
+ if (type == Type.Mutations)
+ {
+ selectableAmount = 10000;
+ }
+ if (selectableAmount <= 0 || unlockedPerks <= 0)
+ {
+ headerText.text = selectNone;
+ }
+ else if (selectableAmount == 1)
+ {
+ headerText.text = selectOne;
+ }
+ else
+ {
+ headerText.text = selectMulti.Replace("<n>", selectableAmount.ToString());
+ }
+ }
+
+ private void Update()
+ {
+ if (selectedInMyGroup.Count < Mathf.Min(unlockedPerks, selectableAmount))
+ {
+ headerText.color = textColorWarning;
+ }
+ else
+ {
+ headerText.color = textColorNormal;
+ }
+ }
+
+ public void SelectPerk(PerkSelectionItem _selectedPerk)
+ {
+ if (!canDeselectPerks && _selectedPerk.Selected)
+ {
+ return;
+ }
+ _selectedPerk.Selected = !_selectedPerk.Selected;
+ if (_selectedPerk.Selected)
+ {
+ selectedInMyGroup.Add(_selectedPerk);
+ if (!perkManager.CurrentlyEquipped.Contains(_selectedPerk.Equippable))
+ {
+ perkManager.CurrentlyEquipped.Add(_selectedPerk.Equippable);
+ }
+ if (selectedInMyGroup.Count > selectableAmount)
+ {
+ PerkSelectionItem perkSelectionItem = selectedInMyGroup[0];
+ perkSelectionItem.Selected = false;
+ selectedInMyGroup.Remove(perkSelectionItem);
+ perkManager.CurrentlyEquipped.Remove(perkSelectionItem.Equippable);
+ }
+ }
+ else
+ {
+ selectedInMyGroup.Remove(_selectedPerk);
+ perkManager.CurrentlyEquipped.Remove(_selectedPerk.Equippable);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkSelectionItem.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkSelectionItem.cs
new file mode 100644
index 0000000..6e43dea
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkSelectionItem.cs
@@ -0,0 +1,80 @@
+using UnityEngine;
+using UnityEngine.EventSystems;
+using UnityEngine.UI;
+
+public class PerkSelectionItem : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler
+{
+ private LevelSelectManager levelSelectManager;
+
+ [SerializeField]
+ private GameObject selectedMarker;
+
+ private PerkSelectionGroup perkSelectionGroup;
+
+ private Color colorBasic;
+
+ private Image image;
+
+ [SerializeField]
+ private Color hoverColor;
+
+ private bool mouseIsOver;
+
+ private Equippable equippable;
+
+ public Equippable Equippable => equippable;
+
+ public bool Selected
+ {
+ get
+ {
+ return selectedMarker.activeInHierarchy;
+ }
+ set
+ {
+ selectedMarker.SetActive(value);
+ }
+ }
+
+ public void OnPointerEnter(PointerEventData eventData)
+ {
+ mouseIsOver = true;
+ }
+
+ public void OnPointerExit(PointerEventData eventData)
+ {
+ mouseIsOver = false;
+ if (levelSelectManager.ShowingTooltipFor == equippable)
+ {
+ levelSelectManager.ShowTooltip(null);
+ }
+ }
+
+ private void Update()
+ {
+ image.color = (mouseIsOver ? hoverColor : colorBasic);
+ if (mouseIsOver)
+ {
+ levelSelectManager.ShowTooltip(equippable);
+ }
+ if (Input.GetMouseButtonDown(0) && mouseIsOver && (bool)perkSelectionGroup)
+ {
+ perkSelectionGroup.SelectPerk(this);
+ }
+ }
+
+ public void Initialize(Equippable _equippable)
+ {
+ image = GetComponent<Image>();
+ colorBasic = image.color;
+ perkSelectionGroup = GetComponentInParent<PerkSelectionGroup>();
+ Debug.Log(perkSelectionGroup);
+ levelSelectManager = LevelSelectManager.instance;
+ image.sprite = _equippable.icon;
+ equippable = _equippable;
+ if (PerkManager.instance.CurrentlyEquipped.Contains(equippable) && (bool)perkSelectionGroup)
+ {
+ perkSelectionGroup.SelectPerk(this);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkSelectionTooltipHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkSelectionTooltipHelper.cs
new file mode 100644
index 0000000..a0400d3
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkSelectionTooltipHelper.cs
@@ -0,0 +1,187 @@
+using MPUIKIT;
+using TMPro;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class PerkSelectionTooltipHelper : MonoBehaviour
+{
+ public UIFrame targetFrame;
+
+ public TextMeshProUGUI selectionTitle;
+
+ public TextMeshProUGUI selectionDescription;
+
+ public Image selectionIcon;
+
+ public MPImageBasic background;
+
+ public MPImageBasic eliteBackground;
+
+ public UIParentResizer sizer;
+
+ public bool disableOnNullSelect;
+
+ public GameObject tooltipParent;
+
+ public MPImageBasic enemyNumberBg;
+
+ public TextMeshProUGUI enemyNumberText;
+
+ private TFUIEquippable currentEquippableElement;
+
+ private TFUIEnemy currentEnemyElement;
+
+ private TFUIIncomeDisplay currentIncomeDisplay;
+
+ public void OnSelection()
+ {
+ if (targetFrame.CurrentSelection == null)
+ {
+ return;
+ }
+ TFUIEquippable tFUIEquippable = targetFrame.CurrentSelection as TFUIEquippable;
+ TFUIEnemy tFUIEnemy = targetFrame.CurrentSelection as TFUIEnemy;
+ TFUIIncomeDisplay tFUIIncomeDisplay = targetFrame.CurrentSelection as TFUIIncomeDisplay;
+ if (tFUIEquippable == null && tFUIEnemy == null && tFUIIncomeDisplay == null)
+ {
+ if (disableOnNullSelect)
+ {
+ tooltipParent.SetActive(value: false);
+ }
+ return;
+ }
+ if ((bool)tooltipParent)
+ {
+ tooltipParent.SetActive(value: true);
+ }
+ currentEquippableElement = tFUIEquippable;
+ currentEnemyElement = tFUIEnemy;
+ currentIncomeDisplay = tFUIIncomeDisplay;
+ UpdateTooltip();
+ }
+
+ public void OnFocus()
+ {
+ if (targetFrame.CurrentFocus == null)
+ {
+ OnSelection();
+ return;
+ }
+ if ((bool)tooltipParent)
+ {
+ tooltipParent.SetActive(value: true);
+ }
+ TFUIEquippable tFUIEquippable = targetFrame.CurrentFocus as TFUIEquippable;
+ TFUIEnemy tFUIEnemy = targetFrame.CurrentFocus as TFUIEnemy;
+ TFUIIncomeDisplay tFUIIncomeDisplay = targetFrame.CurrentFocus as TFUIIncomeDisplay;
+ if (tFUIEquippable == null && tFUIEnemy == null && tFUIIncomeDisplay == null)
+ {
+ if (disableOnNullSelect)
+ {
+ tooltipParent.SetActive(value: false);
+ }
+ }
+ else
+ {
+ currentEquippableElement = tFUIEquippable;
+ currentEnemyElement = tFUIEnemy;
+ currentIncomeDisplay = tFUIIncomeDisplay;
+ UpdateTooltip();
+ }
+ }
+
+ public void UpdateTooltip()
+ {
+ if (currentEquippableElement == null && currentEnemyElement == null && currentIncomeDisplay == null)
+ {
+ return;
+ }
+ string text = "";
+ string text2 = "";
+ if (currentEquippableElement != null)
+ {
+ Equippable data = currentEquippableElement.Data;
+ if (currentEquippableElement.Locked)
+ {
+ text = TextTranslator.Translate("Menu/Locked");
+ text2 = TextTranslator.Translate("Menu/Locked Choice Description");
+ if (data is EquippableWeapon)
+ {
+ text2 = TextTranslator.Translate("Menu/Locked Weapon Description");
+ }
+ else if (data is EquippablePerk)
+ {
+ text2 = TextTranslator.Translate("Menu/Locked Perk Description");
+ }
+ else if (data is EquippableMutation)
+ {
+ text2 = TextTranslator.Translate("Menu/Locked Mutator Description");
+ }
+ selectionIcon.sprite = currentEquippableElement.IconImg.sprite;
+ }
+ else
+ {
+ text = TextTranslator.Translate(data.LOCIDENTIFIER_NAME);
+ text2 = TextTranslator.Translate(data.LOCIDENTIFIER_DESCRIPTION);
+ selectionIcon.sprite = data.icon;
+ }
+ background.OutlineColor = currentEquippableElement.GetDefaultOutlineColor();
+ background.color = currentEquippableElement.GetBackgroundColor;
+ selectionIcon.color = currentEquippableElement.GetIconColor;
+ background.enabled = true;
+ if (eliteBackground != null)
+ {
+ eliteBackground.enabled = false;
+ }
+ if (enemyNumberBg != null)
+ {
+ enemyNumberBg.gameObject.SetActive(value: false);
+ }
+ }
+ else if (currentEnemyElement != null)
+ {
+ WaveEnemyInfo data2 = currentEnemyElement.Data;
+ text = data2.enemyName;
+ if (data2.eliteEnemy)
+ {
+ text = TextTranslator.Translate("Menu/Elite Prefix") + " " + text;
+ }
+ text2 = data2.enemyDescription;
+ selectionIcon.sprite = data2.enemyIcon;
+ background.OutlineColor = currentEnemyElement.GetDefaultOutlineColor();
+ background.color = currentEnemyElement.GetBackgroundColor;
+ background.enabled = !data2.eliteEnemy;
+ if (eliteBackground != null)
+ {
+ eliteBackground.OutlineColor = background.OutlineColor;
+ eliteBackground.color = background.color;
+ eliteBackground.enabled = data2.eliteEnemy;
+ }
+ selectionIcon.color = currentEnemyElement.GetIconColor;
+ if (enemyNumberBg != null)
+ {
+ enemyNumberBg.gameObject.SetActive(value: true);
+ enemyNumberBg.color = background.OutlineColor;
+ enemyNumberText.text = data2.enemyCount.ToString();
+ }
+ }
+ else if (currentIncomeDisplay != null)
+ {
+ text = currentIncomeDisplay.GetTitle();
+ text2 = currentIncomeDisplay.GetDescription();
+ selectionIcon.sprite = currentIncomeDisplay.iconImg.sprite;
+ background.OutlineColor = currentIncomeDisplay.GetDefaultOutlineColor();
+ background.color = currentIncomeDisplay.backgroundImg.color;
+ selectionIcon.color = currentIncomeDisplay.iconImg.color;
+ if (enemyNumberBg != null)
+ {
+ enemyNumberBg.gameObject.SetActive(value: true);
+ enemyNumberBg.color = background.OutlineColor;
+ enemyNumberText.text = currentIncomeDisplay.CurrentIncome.ToString();
+ }
+ }
+ selectionTitle.text = text;
+ selectionDescription.text = text2;
+ sizer.Trigger();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkSpeedModifyer.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkSpeedModifyer.cs
new file mode 100644
index 0000000..2458a10
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkSpeedModifyer.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+
+public class PerkSpeedModifyer : MonoBehaviour
+{
+ public Equippable requiredPerk;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float speedMultiplyer;
+
+ public PathfindMovementPlayerunit pathfindMovement;
+
+ private void Start()
+ {
+ if (PerkManager.IsEquipped(requiredPerk) && (bool)pathfindMovement)
+ {
+ pathfindMovement.movementSpeed *= speedMultiplyer;
+ }
+ Object.Destroy(this);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PerkWeaponModifyer.cs b/Thronefall_v1.57/Thronefall/Thronefall/PerkWeaponModifyer.cs
new file mode 100644
index 0000000..ab8d4bc
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PerkWeaponModifyer.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class PerkWeaponModifyer : MonoBehaviour
+{
+ public Equippable requiredPerk;
+
+ public Weapon weaponToInsert;
+
+ public AutoAttack autoAttack;
+
+ private void Start()
+ {
+ if (PerkManager.IsEquipped(requiredPerk))
+ {
+ autoAttack.weapon = weaponToInsert;
+ }
+ Object.Destroy(this);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PhysicalCoinAnimator.cs b/Thronefall_v1.57/Thronefall/Thronefall/PhysicalCoinAnimator.cs
new file mode 100644
index 0000000..2f44485
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PhysicalCoinAnimator.cs
@@ -0,0 +1,26 @@
+using UnityEngine;
+
+public class PhysicalCoinAnimator : MonoBehaviour
+{
+ public float animationTime = 0.5f;
+
+ public AnimationCurve animationCurve;
+
+ private float clock;
+
+ private void Awake()
+ {
+ base.transform.localScale = Vector3.zero;
+ }
+
+ private void Update()
+ {
+ clock += Time.deltaTime;
+ base.transform.localScale = Vector3.one * animationCurve.Evaluate(clock / animationTime);
+ if (clock >= animationTime)
+ {
+ base.transform.localScale = Vector3.one;
+ Object.Destroy(this);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayLevelButton.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayLevelButton.cs
new file mode 100644
index 0000000..b330372
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayLevelButton.cs
@@ -0,0 +1,40 @@
+using UnityEngine;
+using UnityEngine.EventSystems;
+using UnityEngine.UI;
+
+public class PlayLevelButton : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler
+{
+ private bool mouseIsOver;
+
+ private Color colorBasic;
+
+ private Image image;
+
+ [SerializeField]
+ private Color hoverColor;
+
+ private void Start()
+ {
+ image = GetComponent<Image>();
+ colorBasic = image.color;
+ }
+
+ public void OnPointerEnter(PointerEventData eventData)
+ {
+ mouseIsOver = true;
+ }
+
+ public void OnPointerExit(PointerEventData eventData)
+ {
+ mouseIsOver = false;
+ }
+
+ private void Update()
+ {
+ image.color = (mouseIsOver ? hoverColor : colorBasic);
+ if (Input.GetMouseButtonDown(0) && mouseIsOver)
+ {
+ LevelSelectManager.instance.PlayButtonPressed();
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayMusicOnStart.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayMusicOnStart.cs
new file mode 100644
index 0000000..ebf6369
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayMusicOnStart.cs
@@ -0,0 +1,31 @@
+using UnityEngine;
+
+public class PlayMusicOnStart : MonoBehaviour
+{
+ [SerializeField]
+ private AudioClip audioClip;
+
+ [SerializeField]
+ private float fadeDuration = 4f;
+
+ [SerializeField]
+ private bool destroyEntireGameObject = true;
+
+ private void Start()
+ {
+ MusicManager instance = MusicManager.instance;
+ if (instance != null)
+ {
+ instance.PlayMusic(audioClip, fadeDuration);
+ }
+ else
+ {
+ Debug.LogWarning("MusicManager instance not found.");
+ }
+ Object.Destroy(this);
+ if (destroyEntireGameObject)
+ {
+ Object.Destroy(base.gameObject);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayOneShotAfterSeconds.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayOneShotAfterSeconds.cs
new file mode 100644
index 0000000..1bf1a43
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayOneShotAfterSeconds.cs
@@ -0,0 +1,22 @@
+using UnityEngine;
+
+public class PlayOneShotAfterSeconds : MonoBehaviour
+{
+ public float initialDelay = 1f;
+
+ public ThronefallAudioManager.AudioOneShot type;
+
+ private float timer;
+
+ private void Update()
+ {
+ if (timer <= initialDelay)
+ {
+ timer += Time.deltaTime;
+ if (timer > initialDelay)
+ {
+ ThronefallAudioManager.WorldSpaceOneShot(type, base.transform.position);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayerAttack.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayerAttack.cs
new file mode 100644
index 0000000..3def160
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayerAttack.cs
@@ -0,0 +1,33 @@
+using Rewired;
+using UnityEngine;
+
+public class PlayerAttack : MonoBehaviour
+{
+ public Hp hpPlayer;
+
+ public AttackCooldownAnimation ui;
+
+ private ManualAttack attack;
+
+ private Player input;
+
+ private void Start()
+ {
+ input = ReInput.players.GetPlayer(0);
+ }
+
+ private void Update()
+ {
+ if ((bool)attack)
+ {
+ attack.Tick();
+ attack.DisableMarkersIfDead();
+ ui.SetCurrentCooldownPercentage(attack.CooldownPercentage);
+ }
+ }
+
+ public void AssignManualAttack(ManualAttack target)
+ {
+ attack = target;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayerAttackAnimator.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayerAttackAnimator.cs
new file mode 100644
index 0000000..10407a6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayerAttackAnimator.cs
@@ -0,0 +1,27 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class PlayerAttackAnimator : MonoBehaviour
+{
+ public List<OneShotAnimationBase> animations = new List<OneShotAnimationBase>();
+
+ private ManualAttack playerAttack;
+
+ public void AssignAttack(ManualAttack attack)
+ {
+ playerAttack = attack;
+ playerAttack.onAttack.AddListener(TriggerAnimations);
+ }
+
+ private void TriggerAnimations()
+ {
+ if (!base.gameObject.activeInHierarchy)
+ {
+ return;
+ }
+ foreach (OneShotAnimationBase animation in animations)
+ {
+ animation.Trigger();
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayerAttackTargetFacer.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayerAttackTargetFacer.cs
new file mode 100644
index 0000000..6692d49
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayerAttackTargetFacer.cs
@@ -0,0 +1,66 @@
+using UnityEngine;
+
+public class PlayerAttackTargetFacer : MonoBehaviour
+{
+ public Transform targetTransform;
+
+ public ManualAttack attack;
+
+ public float maxRotationDelta = 360f;
+
+ public float lookBackTime = 0.4f;
+
+ private Vector3 desiredForwardVector;
+
+ private Quaternion desiredRotation = Quaternion.identity;
+
+ private float lookClock;
+
+ private bool shouldReset;
+
+ public void AssignAttack(ManualAttack _attack)
+ {
+ attack = _attack;
+ attack.onAttack.AddListener(UpdateTarget);
+ if (attack.cooldownTime <= lookBackTime)
+ {
+ lookBackTime = attack.cooldownTime + 0.05f;
+ }
+ }
+
+ private void UpdateTarget()
+ {
+ if (!(attack.LastTargetPos == Vector3.zero))
+ {
+ desiredForwardVector = attack.LastTargetPos - targetTransform.position;
+ desiredForwardVector.y = 0f;
+ desiredForwardVector.Normalize();
+ desiredRotation = Quaternion.LookRotation(desiredForwardVector, Vector3.up);
+ lookClock = lookBackTime;
+ }
+ }
+
+ private void Update()
+ {
+ if (lookClock >= 0f)
+ {
+ lookClock -= Time.deltaTime;
+ if (!targetTransform.rotation.Equals(desiredRotation))
+ {
+ targetTransform.rotation = Quaternion.RotateTowards(targetTransform.rotation, desiredRotation, maxRotationDelta * Time.deltaTime);
+ }
+ if (lookClock <= 0f)
+ {
+ shouldReset = true;
+ }
+ }
+ else if (shouldReset)
+ {
+ targetTransform.rotation = Quaternion.RotateTowards(targetTransform.rotation, targetTransform.parent.rotation, maxRotationDelta * Time.deltaTime);
+ if (targetTransform.rotation.Equals(targetTransform.parent.rotation))
+ {
+ shouldReset = false;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayerBallMovement.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayerBallMovement.cs
new file mode 100644
index 0000000..033a00f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayerBallMovement.cs
@@ -0,0 +1,115 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class PlayerBallMovement : PlayerMovement
+{
+ [SerializeField]
+ private Rigidbody rigidbody;
+
+ [SerializeField]
+ private Transform targetPosition;
+
+ public Hp playerHp;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public float selfInflictedDamagePerHit = 1f;
+
+ public LayerMask lmRecieveDamage;
+
+ public List<DamageModifyer> damage;
+
+ private Collider[] tempColliders = new Collider[50];
+
+ public float cooldownPerObject = 4f;
+
+ private PlayerMovement playerMovement;
+
+ private PlayerUpgradeManager upgradeManager;
+
+ private BlacksmithUpgrades blacksmithUpgrades;
+
+ private List<TaggedObject> recentlyHit = new List<TaggedObject>();
+
+ private List<float> recentlyHitWhen = new List<float>();
+
+ private float time;
+
+ [SerializeField]
+ private SphereCollider myCollider;
+
+ public float DamageMultiplyer => upgradeManager.PlayerDamageMultiplyer * blacksmithUpgrades.meleeDamage;
+
+ public override void MoveScript(Vector2 inputVector)
+ {
+ inputVector = Vector2.ClampMagnitude(inputVector, 1f);
+ Vector3 normalized = Vector3.ProjectOnPlane(viewTransform.forward, Vector3.up).normalized;
+ Vector3 normalized2 = Vector3.ProjectOnPlane(viewTransform.right, Vector3.up).normalized;
+ Vector3 vector = default(Vector3);
+ vector += normalized * inputVector.x * Time.deltaTime;
+ vector += normalized2 * inputVector.y * Time.deltaTime;
+ if (base.Dead)
+ {
+ slowedFor = -1f;
+ vector *= moveSpeedWhenDead;
+ }
+ else
+ {
+ bool flag = dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Day;
+ vector *= ((!sprinting) ? (flag ? speedDuringDay : speed) : (flag ? sprintSpeedDuringDay : sprintSpeed));
+ slowedFor -= Time.deltaTime;
+ vector *= ((slowedFor > 0f) ? 0.33f : 1f);
+ if (heavyArmorEquipped && DayNightCycle.Instance.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ vector *= PerkManager.instance.heavyArmor_SpeedMultiplyer;
+ }
+ if (racingHorseEquipped)
+ {
+ vector *= PerkManager.instance.racingHorse_SpeedMultiplyer;
+ }
+ }
+ rigidbody.velocity += vector;
+ rigidbody.velocity += gravity * Time.deltaTime * Vector3.down;
+ Vector3 position = rigidbody.position;
+ float radius = myCollider.radius * myCollider.transform.localScale.x;
+ if (!base.Dead)
+ {
+ int num = Physics.OverlapSphereNonAlloc(position, radius, tempColliders, lmRecieveDamage);
+ for (int i = 0; i < num && !(tempColliders[i] == null); i++)
+ {
+ DealWithColliderHit(tempColliders[i]);
+ }
+ }
+ time += Time.deltaTime;
+ while (recentlyHitWhen.Count > 0 && time - recentlyHitWhen[0] > cooldownPerObject)
+ {
+ recentlyHitWhen.RemoveAt(0);
+ recentlyHit.RemoveAt(0);
+ }
+ }
+
+ private void FixedUpdate()
+ {
+ base.transform.position = targetPosition.position;
+ meshParent.rotation = rigidbody.rotation;
+ }
+
+ public override void Start()
+ {
+ base.Start();
+ playerMovement = GetComponentInParent<PlayerMovement>();
+ upgradeManager = PlayerUpgradeManager.instance;
+ blacksmithUpgrades = BlacksmithUpgrades.instance;
+ }
+
+ private void DealWithColliderHit(Collider other)
+ {
+ TaggedObject componentInParent = other.GetComponentInParent<TaggedObject>();
+ if ((bool)componentInParent && !recentlyHit.Contains(componentInParent) && componentInParent.Tags.Contains(TagManager.ETag.EnemyOwned))
+ {
+ componentInParent.Hp.TakeDamage(Weapon.CalculateDamageGeneral(componentInParent, damage, DamageMultiplyer * rigidbody.velocity.magnitude));
+ playerHp.TakeDamage(selfInflictedDamagePerHit * DamageMultiplyer);
+ recentlyHit.Add(componentInParent);
+ recentlyHitWhen.Add(time);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayerCharacterAudio.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayerCharacterAudio.cs
new file mode 100644
index 0000000..2e951ef
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayerCharacterAudio.cs
@@ -0,0 +1,94 @@
+using UnityEngine;
+
+public class PlayerCharacterAudio : MonoBehaviour
+{
+ public Hp playerHp;
+
+ public AutoRevive playerReviveComponent;
+
+ public AudioSource stepAudioSource;
+
+ public AudioSource fxAudioSource;
+
+ public AudioSource dmgAudioSource;
+
+ public PlayerMovement targetController;
+
+ public float fadeTime = 0.3f;
+
+ public float sprintPitch = 1.1f;
+
+ private PlayerWeaponAudio weaponAudio;
+
+ private float initialVolume;
+
+ private float initialPitch;
+
+ private float fadeSpeed;
+
+ private void Start()
+ {
+ initialPitch = stepAudioSource.pitch;
+ initialVolume = stepAudioSource.volume;
+ stepAudioSource.volume = 0f;
+ stepAudioSource.priority = 110;
+ fadeSpeed = initialVolume / fadeTime;
+ playerHp.OnKillOrKnockout.AddListener(OnDeath);
+ playerHp.OnReceiveDamage.AddListener(OnDmg);
+ playerReviveComponent.onReviveTrigger.AddListener(OnRevive);
+ }
+
+ public void OnWeaponEquip(ManualAttack weapon)
+ {
+ weaponAudio = weapon.GetComponent<PlayerWeaponAudio>();
+ weaponAudio.autoWeapon.onAttack.AddListener(PlayAttackSound);
+ }
+
+ private void PlayAttackSound()
+ {
+ fxAudioSource.priority = 5;
+ fxAudioSource.pitch = Random.Range(1f - weaponAudio.pitchRange, 1f + weaponAudio.pitchRange);
+ fxAudioSource.PlayOneShot(weaponAudio.AttackSound.GetRandomClip(), weaponAudio.volume);
+ }
+
+ private void OnDeath()
+ {
+ dmgAudioSource.priority = 5;
+ dmgAudioSource.pitch = 1f;
+ dmgAudioSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.PlayerDeath.GetRandomClip(), 1f);
+ }
+
+ private void OnDmg(bool b)
+ {
+ dmgAudioSource.priority = 5;
+ dmgAudioSource.pitch = Random.Range(0.9f, 1.1f);
+ dmgAudioSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.PlayerDamage.GetRandomClip(), 0.65f);
+ }
+
+ private void OnRevive()
+ {
+ fxAudioSource.priority = 5;
+ fxAudioSource.pitch = 1f;
+ fxAudioSource.PlayOneShot(ThronefallAudioManager.Instance.audioContent.PlayerRevive, 0.8f);
+ }
+
+ private void Update()
+ {
+ if (targetController.Sprinting)
+ {
+ stepAudioSource.pitch = sprintPitch;
+ }
+ else
+ {
+ stepAudioSource.pitch = initialPitch;
+ }
+ if (targetController.Moving && (playerHp == null || !playerHp.KnockedOut))
+ {
+ stepAudioSource.volume = Mathf.MoveTowards(stepAudioSource.volume, initialVolume, fadeSpeed * Time.unscaledDeltaTime);
+ }
+ else
+ {
+ stepAudioSource.volume = Mathf.MoveTowards(stepAudioSource.volume, 0f, fadeSpeed * Time.unscaledDeltaTime);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayerHpRegen.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayerHpRegen.cs
new file mode 100644
index 0000000..9478e2e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayerHpRegen.cs
@@ -0,0 +1,64 @@
+using UnityEngine;
+
+[RequireComponent(typeof(Hp))]
+public class PlayerHpRegen : MonoBehaviour
+{
+ [SerializeField]
+ private PlayerUpgradeManager playerUpgradeManager;
+
+ private Hp hp;
+
+ public float delayTillRegenerationStarts;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public float standardHealingPerSecond;
+
+ private float timeSinceLastTakenDamage;
+
+ private float hpRemember;
+
+ private bool heavyArmorEquipped;
+
+ private bool godsLotionEquipped;
+
+ [SerializeField]
+ private Equippable heavyArmorPerk;
+
+ [SerializeField]
+ private Equippable godsLotionPerk;
+
+ public float HealingPerSecond => standardHealingPerSecond * playerUpgradeManager.PlayerHealthRegenerationMultiplyer;
+
+ private void Start()
+ {
+ hp = GetComponent<Hp>();
+ hpRemember = hp.HpValue;
+ heavyArmorEquipped = PerkManager.IsEquipped(heavyArmorPerk);
+ godsLotionEquipped = PerkManager.IsEquipped(godsLotionPerk);
+ if (heavyArmorEquipped)
+ {
+ hp.maxHp *= PerkManager.instance.heavyArmor_HpMultiplyer;
+ playerUpgradeManager.PlayerHealthRegenerationMultiplyer *= PerkManager.instance.heavyArmor_SelfHealMultiplyer;
+ hp.Heal(float.MaxValue);
+ }
+ if (godsLotionEquipped)
+ {
+ delayTillRegenerationStarts *= PerkManager.instance.godsLotion_RegenDelayMultiplyer;
+ playerUpgradeManager.PlayerHealthRegenerationMultiplyer *= PerkManager.instance.godsLotion_RegenRateMultiplyer;
+ }
+ }
+
+ private void Update()
+ {
+ timeSinceLastTakenDamage += Time.deltaTime;
+ if (hp.HpValue < hpRemember)
+ {
+ timeSinceLastTakenDamage = 0f;
+ }
+ hpRemember = hp.HpValue;
+ if (timeSinceLastTakenDamage >= delayTillRegenerationStarts)
+ {
+ hp.Heal(HealingPerSecond * Time.deltaTime);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayerInteraction.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayerInteraction.cs
new file mode 100644
index 0000000..6a5411f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayerInteraction.cs
@@ -0,0 +1,254 @@
+using System.Collections.Generic;
+using Rewired;
+using UnityEngine;
+using UnityEngine.Events;
+
+public class PlayerInteraction : MonoBehaviour, ISaveLoad
+{
+ private int balance;
+
+ public float coinMagnetRadius = 10f;
+
+ public LayerMask coinLayer;
+
+ public float interactionRadius = 3f;
+
+ public LayerMask interactorLayer;
+
+ private ManualAttack manualAttack;
+
+ private ManualAttack autoAttack;
+
+ private int networth;
+
+ public PlayerCharacterAudio playerAudio;
+
+ public GameObject coinSpendFX;
+
+ public Transform coinSpendFXOrigin;
+
+ private TagManager tagManager;
+
+ private List<BuildingRangeIndicator> lastBuildingRangeIndicators = new List<BuildingRangeIndicator>();
+
+ [HideInInspector]
+ public UnityEvent<int> onBalanceGain = new UnityEvent<int>();
+
+ [HideInInspector]
+ public UnityEvent<int> onBalanceSpend = new UnityEvent<int>();
+
+ [HideInInspector]
+ public UnityEvent onFocusPaymentInteraction = new UnityEvent();
+
+ [HideInInspector]
+ public UnityEvent onUnfocusPaymentInteraction = new UnityEvent();
+
+ public static PlayerInteraction instance;
+
+ private InteractorBase focussedInteractor;
+
+ private Player input;
+
+ public int Networth => networth;
+
+ public ManualAttack ManualAttack => manualAttack;
+
+ public ManualAttack AutoAttack => autoAttack;
+
+ public bool IsFreeToCallNight
+ {
+ get
+ {
+ if (!LocalGamestate.Instance.PlayerFrozen && focussedInteractor == null && tagManager.CountObjectsWithTag(TagManager.ETag.CastleCenter) > 0 && TutorialManager.AllowStartingTheNight && !EnemySpawner.instance.MatchOver)
+ {
+ return LocalGamestate.Instance.CurrentState == LocalGamestate.State.InMatch;
+ }
+ return false;
+ }
+ }
+
+ public int Balance => balance;
+
+ public int TrueBalance => balance + TagManager.instance.coins.Count + CoinSpawner.AllCoinsLeftToBeSpawned;
+
+ public InteractorBase FocussedInteractor => focussedInteractor;
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ MatchSaveLoadHandler.TryLoadValue(guid, "balance", ref balance);
+ }
+
+ public void OnSave(string guid)
+ {
+ MatchSaveLoadHandler.SaveValue(guid, "balance", TrueBalance);
+ }
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ public void EquipWeapon(ManualAttack _manualAttack, ManualAttack _autoAttack)
+ {
+ manualAttack = _manualAttack;
+ playerAudio.OnWeaponEquip(manualAttack);
+ autoAttack = _autoAttack;
+ }
+
+ private void Start()
+ {
+ input = ReInput.players.GetPlayer(0);
+ tagManager = TagManager.instance;
+ }
+
+ private void Update()
+ {
+ FetchCoins();
+ FetchInteractors();
+ RunInteraction();
+ }
+
+ private void RunInteraction()
+ {
+ if (LocalGamestate.Instance.PlayerFrozen)
+ {
+ return;
+ }
+ if (input.GetButtonDown("Interact"))
+ {
+ if ((bool)focussedInteractor)
+ {
+ focussedInteractor.InteractionBegin(this);
+ }
+ else if ((bool)manualAttack)
+ {
+ manualAttack.TryToAttack();
+ }
+ }
+ if (input.GetButton("Interact") && (bool)focussedInteractor)
+ {
+ focussedInteractor.InteractionHold(this);
+ }
+ if (input.GetButtonUp("Interact") && (bool)focussedInteractor)
+ {
+ focussedInteractor.InteractionEnd(this);
+ }
+ if (input.GetButton("Preview Build Options"))
+ {
+ BuildingInteractor.displayAllBuildPreviews = true;
+ }
+ else
+ {
+ BuildingInteractor.displayAllBuildPreviews = false;
+ }
+ }
+
+ private void FetchInteractors()
+ {
+ if (input.GetButton("Call Night") || input.GetButton("Interact") || ((bool)focussedInteractor && focussedInteractor is BuildingInteractor && (focussedInteractor as BuildingInteractor).IsWaitingForChoice))
+ {
+ return;
+ }
+ Collider[] array = Physics.OverlapSphere(base.transform.position, interactionRadius, interactorLayer);
+ InteractorBase interactorBase = null;
+ BuildingRangeIndicator buildingRangeIndicator = null;
+ List<BuildingRangeIndicator> list = new List<BuildingRangeIndicator>();
+ float num = float.PositiveInfinity;
+ Collider[] array2 = array;
+ foreach (Collider collider in array2)
+ {
+ InteractorBase component = collider.GetComponent<InteractorBase>();
+ buildingRangeIndicator = collider.GetComponent<BuildingRangeIndicator>();
+ if ((bool)buildingRangeIndicator)
+ {
+ list.Add(buildingRangeIndicator);
+ }
+ if ((bool)component && component.CanBeInteractedWith)
+ {
+ float num2 = Vector3.Distance(base.transform.position, collider.ClosestPoint(base.transform.position));
+ if (num2 < num)
+ {
+ interactorBase = component;
+ num = num2;
+ }
+ }
+ }
+ if ((bool)focussedInteractor && focussedInteractor != interactorBase)
+ {
+ if (focussedInteractor is BuildingInteractor)
+ {
+ onUnfocusPaymentInteraction.Invoke();
+ }
+ focussedInteractor.Unfocus(this);
+ focussedInteractor = null;
+ }
+ if ((bool)interactorBase && interactorBase != focussedInteractor)
+ {
+ if (interactorBase is BuildingInteractor)
+ {
+ onFocusPaymentInteraction.Invoke();
+ }
+ interactorBase.Focus(this);
+ focussedInteractor = interactorBase;
+ }
+ foreach (BuildingRangeIndicator item in list)
+ {
+ if (!lastBuildingRangeIndicators.Contains(item))
+ {
+ item.Activate();
+ }
+ }
+ foreach (BuildingRangeIndicator lastBuildingRangeIndicator in lastBuildingRangeIndicators)
+ {
+ if (!list.Contains(lastBuildingRangeIndicator))
+ {
+ lastBuildingRangeIndicator.Deactivate();
+ }
+ }
+ lastBuildingRangeIndicators.Clear();
+ lastBuildingRangeIndicators.AddRange(list);
+ }
+
+ private void FetchCoins()
+ {
+ Collider[] array = Physics.OverlapSphere(base.transform.position, coinMagnetRadius, coinLayer);
+ for (int i = 0; i < array.Length; i++)
+ {
+ Coin component = array[i].GetComponent<Coin>();
+ if (component != null && component.IsFree)
+ {
+ component.SetTarget(this);
+ }
+ }
+ }
+
+ public void AddCoin(int amount = 1)
+ {
+ balance += amount;
+ networth += amount;
+ onBalanceGain.Invoke(amount);
+ }
+
+ public void SpendCoins(int amount)
+ {
+ balance -= amount;
+ onBalanceSpend.Invoke(amount);
+ Object.Instantiate(coinSpendFX, coinSpendFXOrigin.position, coinSpendFXOrigin.rotation, base.transform);
+ }
+
+ private void OnDrawGizmosSelected()
+ {
+ Gizmos.color = Color.blue;
+ Gizmos.DrawWireSphere(base.transform.position, interactionRadius);
+ Gizmos.color = Color.yellow;
+ Gizmos.DrawWireSphere(base.transform.position, coinMagnetRadius);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayerManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayerManager.cs
new file mode 100644
index 0000000..8fe94dd
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayerManager.cs
@@ -0,0 +1,68 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class PlayerManager : MonoBehaviour
+{
+ private static PlayerManager instance;
+
+ protected List<PlayerMovement> registeredPlayers = new List<PlayerMovement>();
+
+ public static PlayerManager Instance => instance;
+
+ public PlayerMovement[] RegisteredPlayers => registeredPlayers.ToArray();
+
+ private void Awake()
+ {
+ if (instance != null)
+ {
+ Object.Destroy(instance);
+ Debug.LogWarning("Found more than one player manager in scene. Destroyed old one.");
+ }
+ instance = this;
+ }
+
+ public static void RegisterPlayer(PlayerMovement player)
+ {
+ if (!instance)
+ {
+ Debug.Log("No PlayerManager exists in scene.");
+ }
+ else
+ {
+ instance.registeredPlayers.Add(player);
+ }
+ }
+
+ public static void UnregisterPlayer(PlayerMovement player)
+ {
+ if (!instance)
+ {
+ Debug.Log("No PlayerManager exists in scene.");
+ }
+ else
+ {
+ instance.registeredPlayers.Remove(player);
+ }
+ }
+
+ public static PlayerMovement GetClosestPlayer(Vector3 position)
+ {
+ if (!instance)
+ {
+ Debug.Log("No PlayerManager exists in scene.");
+ return null;
+ }
+ PlayerMovement result = null;
+ float num = float.PositiveInfinity;
+ foreach (PlayerMovement registeredPlayer in instance.registeredPlayers)
+ {
+ float num2 = Vector3.Distance(position, registeredPlayer.transform.position);
+ if (num2 < num)
+ {
+ num = num2;
+ result = registeredPlayer;
+ }
+ }
+ return result;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayerMovement.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayerMovement.cs
new file mode 100644
index 0000000..4a065f4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayerMovement.cs
@@ -0,0 +1,218 @@
+using System.Collections;
+using Pathfinding.RVO;
+using Rewired;
+using UnityEngine;
+
+[RequireComponent(typeof(CharacterController))]
+[RequireComponent(typeof(RVOController))]
+public class PlayerMovement : MonoBehaviour
+{
+ protected Vector3 startPosition;
+
+ public float speed = 14f;
+
+ public float speedDuringDay = 14f;
+
+ public float sprintSpeed = 23f;
+
+ public float sprintSpeedDuringDay = 23f;
+
+ public float moveSpeedWhenDead = 8f;
+
+ public float gravity = -19.62f;
+
+ public Transform meshParent;
+
+ public float maxMeshRotationSpeed = 360f;
+
+ public Animator meshAnimator;
+
+ public float yFallThroughMapDetection = -10f;
+
+ private Hp hp;
+
+ protected Transform viewTransform;
+
+ protected CharacterController controller;
+
+ protected Player input;
+
+ private Quaternion desiredMeshRotation;
+
+ private RVOController rvoController;
+
+ protected float yVelocity;
+
+ protected bool heavyArmorEquipped;
+
+ protected bool racingHorseEquipped;
+
+ private bool moving;
+
+ protected bool sprinting;
+
+ private bool sprintingToggledOn;
+
+ private bool dead;
+
+ public static PlayerMovement instance;
+
+ [SerializeField]
+ private Equippable heavyArmorPerk;
+
+ [SerializeField]
+ private Equippable warHorsePerk;
+
+ protected DayNightCycle dayNightCycle;
+
+ protected float slowedFor = -1f;
+
+ protected Vector3 velocity;
+
+ public bool Moving => moving;
+
+ public bool Sprinting => sprinting;
+
+ public bool Dead
+ {
+ get
+ {
+ return dead;
+ }
+ set
+ {
+ dead = value;
+ }
+ }
+
+ public Vector3 Velocity => velocity;
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ public void TeleportTo(Vector3 _position)
+ {
+ controller.enabled = false;
+ controller.transform.position = _position;
+ StartCoroutine(EnableControllerNextFrame(controller));
+ }
+
+ public virtual void Start()
+ {
+ startPosition = base.transform.position;
+ PlayerManager.RegisterPlayer(this);
+ viewTransform = Camera.main.transform;
+ controller = GetComponent<CharacterController>();
+ input = ReInput.players.GetPlayer(0);
+ rvoController = GetComponent<RVOController>();
+ hp = GetComponent<Hp>();
+ heavyArmorEquipped = PerkManager.IsEquipped(heavyArmorPerk);
+ racingHorseEquipped = PerkManager.IsEquipped(warHorsePerk);
+ dayNightCycle = DayNightCycle.Instance;
+ }
+
+ public void Slow(float duration)
+ {
+ slowedFor = Mathf.Max(duration, slowedFor);
+ }
+
+ private void Update()
+ {
+ Vector2 inputVector = new Vector2(input.GetAxis("Move Vertical"), input.GetAxis("Move Horizontal"));
+ if (input.GetButton("Move Towards Mouse"))
+ {
+ Vector3 mousePosition = Input.mousePosition;
+ Vector3 vector = new Vector3(Screen.width / 2, Screen.height / 2, 0f);
+ inputVector = new Vector2(mousePosition.y - vector.y, mousePosition.x - vector.x);
+ }
+ if (LocalGamestate.Instance.PlayerFrozen)
+ {
+ inputVector = Vector2.zero;
+ }
+ if (input.GetButtonDown("Sprint Toggle"))
+ {
+ sprintingToggledOn = !sprintingToggledOn;
+ }
+ if (sprintingToggledOn && input.GetButton("Sprint"))
+ {
+ sprintingToggledOn = false;
+ }
+ sprinting = (input.GetButton("Sprint") || sprintingToggledOn) && hp.HpPercentage >= 1f;
+ MoveScript(inputVector);
+ rvoController.velocity = velocity;
+ Vector3 vector2 = new Vector3(velocity.x, 0f, velocity.z);
+ moving = vector2.sqrMagnitude > 0.1f;
+ if (moving)
+ {
+ desiredMeshRotation = Quaternion.LookRotation(vector2.normalized, Vector3.up);
+ }
+ if (desiredMeshRotation != meshParent.rotation)
+ {
+ meshParent.rotation = Quaternion.RotateTowards(meshParent.rotation, desiredMeshRotation, maxMeshRotationSpeed * Time.deltaTime);
+ }
+ meshAnimator.SetBool("Moving", moving);
+ meshAnimator.SetBool("Sprinting", sprinting);
+ }
+
+ private void OnDisable()
+ {
+ meshAnimator.SetBool("Moving", value: false);
+ }
+
+ private IEnumerator EnableControllerNextFrame(CharacterController controller)
+ {
+ yield return new WaitForEndOfFrame();
+ controller.enabled = true;
+ }
+
+ public virtual void MoveScript(Vector2 inputVector)
+ {
+ Vector3 normalized = Vector3.ProjectOnPlane(viewTransform.forward, Vector3.up).normalized;
+ Vector3 normalized2 = Vector3.ProjectOnPlane(viewTransform.right, Vector3.up).normalized;
+ velocity = Vector3.zero;
+ velocity += normalized * inputVector.x;
+ velocity += normalized2 * inputVector.y;
+ velocity = Vector3.ClampMagnitude(velocity, 1f);
+ if (Dead)
+ {
+ slowedFor = -1f;
+ velocity *= moveSpeedWhenDead;
+ }
+ else
+ {
+ bool flag = dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Day;
+ velocity *= ((!sprinting) ? (flag ? speedDuringDay : speed) : (flag ? sprintSpeedDuringDay : sprintSpeed));
+ slowedFor -= Time.deltaTime;
+ velocity *= ((slowedFor > 0f) ? 0.33f : 1f);
+ if (heavyArmorEquipped && DayNightCycle.Instance.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ velocity *= PerkManager.instance.heavyArmor_SpeedMultiplyer;
+ }
+ if (racingHorseEquipped)
+ {
+ velocity *= PerkManager.instance.racingHorse_SpeedMultiplyer;
+ }
+ }
+ if (controller.enabled)
+ {
+ if (controller.isGrounded)
+ {
+ yVelocity = 0f;
+ }
+ else
+ {
+ yVelocity += gravity * Time.deltaTime;
+ }
+ velocity += Vector3.up * yVelocity;
+ controller.Move(velocity * Time.deltaTime);
+ if (base.transform.position.y < yFallThroughMapDetection)
+ {
+ velocity = Vector3.zero;
+ yVelocity = 0f;
+ TeleportTo(startPosition);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayerScept.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayerScept.cs
new file mode 100644
index 0000000..a68e2df
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayerScept.cs
@@ -0,0 +1,89 @@
+using System.Collections;
+using Rewired;
+using UnityEngine;
+
+public class PlayerScept : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ public GameObject loadoutParent;
+
+ public Transform scept;
+
+ public Transform scepterInteractionTarget;
+
+ public AnimationCurve inCurve;
+
+ public AnimationCurve outCurve;
+
+ public float inTime = 0.2f;
+
+ public float outTime = 0.4f;
+
+ private Player input;
+
+ private Vector3 initPos;
+
+ private void Start()
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ input = ReInput.players.GetPlayer(0);
+ initPos = scept.localPosition;
+ }
+
+ private void Update()
+ {
+ if (input.GetButtonDown("Interact"))
+ {
+ StopAllCoroutines();
+ StartCoroutine(AnimationIn());
+ }
+ if (input.GetButtonUp("Interact"))
+ {
+ StopAllCoroutines();
+ StartCoroutine(AnimationOut());
+ }
+ }
+
+ private IEnumerator AnimationIn()
+ {
+ float timer = 0f;
+ Vector3 startPos = scept.localPosition;
+ while (timer < inTime)
+ {
+ timer += Time.deltaTime;
+ scept.localPosition = Vector3.Lerp(startPos, scepterInteractionTarget.localPosition, inCurve.Evaluate(Mathf.InverseLerp(0f, inTime, timer)));
+ yield return null;
+ }
+ scept.localPosition = scepterInteractionTarget.localPosition;
+ }
+
+ private IEnumerator AnimationOut()
+ {
+ float timer = 0f;
+ _ = scept.localPosition;
+ while (timer < outTime)
+ {
+ timer += Time.deltaTime;
+ scept.localPosition = Vector3.Lerp(scept.localPosition, initPos, outCurve.Evaluate(Mathf.InverseLerp(0f, outTime, timer)));
+ yield return null;
+ }
+ scept.localPosition = initPos;
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ loadoutParent.SetActive(value: true);
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public void OnDusk()
+ {
+ loadoutParent.SetActive(value: false);
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayerUpgradeManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayerUpgradeManager.cs
new file mode 100644
index 0000000..7aa99a9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayerUpgradeManager.cs
@@ -0,0 +1,133 @@
+using System.Collections;
+using UnityEngine;
+
+public class PlayerUpgradeManager : MonoBehaviour, DayNightCycle.IDaytimeSensitive, ISaveLoad
+{
+ [SerializeField]
+ private Hp hp;
+
+ public static PlayerUpgradeManager instance;
+
+ private PerkManager perkManager;
+
+ private float playerDamageMultiplyer = 1f;
+
+ private float playerHealthRegenerationMultiplyer = 1f;
+
+ public bool assassinsTraining;
+
+ public bool godlyCurse;
+
+ public bool magicArmor;
+
+ public bool commander;
+
+ public float godlyCurseDamageMultiplyer = 1.5f;
+
+ private int damageIncreases;
+
+ public float PlayerDamageMultiplyer
+ {
+ get
+ {
+ if (!perkManager)
+ {
+ perkManager = PerkManager.instance;
+ }
+ if (perkManager.RiskTakerEquipped)
+ {
+ return Mathf.Lerp(perkManager.riskTakerMaxBonusDamageMultiplyer, 1f, hp.HpPercentage) * playerDamageMultiplyer;
+ }
+ return playerDamageMultiplyer;
+ }
+ set
+ {
+ playerDamageMultiplyer = value;
+ }
+ }
+
+ public float PlayerHealthRegenerationMultiplyer
+ {
+ get
+ {
+ return playerHealthRegenerationMultiplyer;
+ }
+ set
+ {
+ playerHealthRegenerationMultiplyer = value;
+ }
+ }
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ private void Start()
+ {
+ perkManager = PerkManager.instance;
+ if ((bool)DayNightCycle.Instance)
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ }
+ if (PerkManager.instance.CommanderModeActive)
+ {
+ playerDamageMultiplyer *= PerkManager.instance.commanderModeSelfDmgMulti;
+ }
+ if (PerkManager.instance.GlassCanonActive)
+ {
+ playerDamageMultiplyer *= PerkManager.instance.glassCanon_dmgMulti;
+ }
+ }
+
+ public void OnDusk()
+ {
+ GetStrongerIfInWarriorMode();
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ GetStrongerIfInWarriorMode();
+ }
+
+ public void GetStrongerIfInWarriorMode()
+ {
+ while (PerkManager.instance.WarriorModeActive && damageIncreases < EnemySpawner.instance.Wavenumber)
+ {
+ damageIncreases++;
+ playerDamageMultiplyer *= Mathf.Pow(PerkManager.instance.warriorModeSelfDmgMultiMax, 1f / (float)EnemySpawner.instance.WaveCount);
+ }
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ StartCoroutine(DelayLoadedGetStronger());
+ }
+
+ public void OnSave(string guid)
+ {
+ }
+
+ private IEnumerator DelayLoadedGetStronger()
+ {
+ yield return null;
+ yield return null;
+ GetStrongerIfInWarriorMode();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayerWeaponAudio.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayerWeaponAudio.cs
new file mode 100644
index 0000000..0e1d84f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayerWeaponAudio.cs
@@ -0,0 +1,63 @@
+using UnityEngine;
+
+public class PlayerWeaponAudio : MonoBehaviour
+{
+ public enum WeaponType
+ {
+ Sword,
+ Spear,
+ Bow,
+ LightningWand,
+ ShadowCodex
+ }
+
+ public ManualAttack autoWeapon;
+
+ public ManualAttack activeAbility;
+
+ public WeaponType weaponType;
+
+ public float pitchRange;
+
+ public float volume = 0.75f;
+
+ [HideInInspector]
+ private AudioSet.ClipArray attackSound;
+
+ private bool initialized;
+
+ public AudioSet.ClipArray AttackSound
+ {
+ get
+ {
+ if (!initialized)
+ {
+ Initialize();
+ }
+ return attackSound;
+ }
+ }
+
+ private void Initialize()
+ {
+ switch (weaponType)
+ {
+ case WeaponType.Bow:
+ attackSound = ThronefallAudioManager.Instance.audioContent.PlayerBow;
+ break;
+ case WeaponType.Spear:
+ attackSound = ThronefallAudioManager.Instance.audioContent.PlayerSpear;
+ break;
+ case WeaponType.Sword:
+ attackSound = ThronefallAudioManager.Instance.audioContent.PlayerSword;
+ break;
+ case WeaponType.LightningWand:
+ attackSound = ThronefallAudioManager.Instance.audioContent.PlayerLightningWand;
+ break;
+ case WeaponType.ShadowCodex:
+ attackSound = ThronefallAudioManager.Instance.audioContent.PlayerShadowCodex;
+ break;
+ }
+ initialized = true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PlayerWeaponVisuals.cs b/Thronefall_v1.57/Thronefall/Thronefall/PlayerWeaponVisuals.cs
new file mode 100644
index 0000000..85b6448
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PlayerWeaponVisuals.cs
@@ -0,0 +1,35 @@
+using UnityEngine;
+
+public class PlayerWeaponVisuals : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ private GameObject visuals;
+
+ public void Init(GameObject _visuals, ManualAttack _attack)
+ {
+ visuals = _visuals;
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ visuals.GetComponent<PlayerAttackAnimator>().AssignAttack(_attack);
+ if (TutorialManager.instance != null)
+ {
+ visuals.SetActive(value: true);
+ }
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ visuals.SetActive(value: false);
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public void OnDusk()
+ {
+ visuals.SetActive(value: true);
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PositionAnimation.cs b/Thronefall_v1.57/Thronefall/Thronefall/PositionAnimation.cs
new file mode 100644
index 0000000..c50408d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PositionAnimation.cs
@@ -0,0 +1,42 @@
+using System.Collections;
+using UnityEngine;
+
+public class PositionAnimation : OneShotAnimationBase
+{
+ public AnimationCurve curve;
+
+ public float duration = 0.75f;
+
+ public Vector3 targetPosition;
+
+ public Transform transformToAnimate;
+
+ private Vector3 initialPosition;
+
+ private void Start()
+ {
+ initialPosition = transformToAnimate.localPosition;
+ }
+
+ private IEnumerator Animate()
+ {
+ transformToAnimate.localPosition = initialPosition;
+ float timer = 0f;
+ while (timer < duration)
+ {
+ transformToAnimate.localPosition = Vector3.Lerp(initialPosition, targetPosition, curve.Evaluate(timer / duration));
+ timer += Time.deltaTime;
+ yield return null;
+ }
+ transformToAnimate.localPosition = Vector3.Lerp(initialPosition, targetPosition, curve.Evaluate(1f));
+ }
+
+ public override void Trigger()
+ {
+ if (base.gameObject.activeInHierarchy)
+ {
+ StopAllCoroutines();
+ StartCoroutine(Animate());
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PowerTowerPerk.cs b/Thronefall_v1.57/Thronefall/Thronefall/PowerTowerPerk.cs
new file mode 100644
index 0000000..09466d4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PowerTowerPerk.cs
@@ -0,0 +1,56 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class PowerTowerPerk : MonoBehaviour
+{
+ [SerializeField]
+ private Equippable powerTowerPerk;
+
+ [SerializeField]
+ private List<TagManager.ETag> mustHaveTags = new List<TagManager.ETag>();
+
+ [SerializeField]
+ private List<TagManager.ETag> mayNotHaveTags = new List<TagManager.ETag>();
+
+ private TagManager tagManager;
+
+ private float attackSpeedBonus;
+
+ private float nextRefreshIn = 0.2f;
+
+ private TaggedObject closestTower;
+
+ private void Start()
+ {
+ if (!PerkManager.IsEquipped(powerTowerPerk))
+ {
+ Object.Destroy(this);
+ return;
+ }
+ tagManager = TagManager.instance;
+ attackSpeedBonus = PerkManager.instance.powerTower_attackSpeedBonus;
+ }
+
+ private void Update()
+ {
+ nextRefreshIn -= Time.deltaTime;
+ if (nextRefreshIn <= 0f)
+ {
+ closestTower = tagManager.FindClosestTaggedObjectWithTags(base.transform.position, mustHaveTags, mayNotHaveTags);
+ nextRefreshIn = 0.2f;
+ }
+ if (closestTower != null)
+ {
+ AutoAttack[] componentsInChildren = closestTower.GetComponentsInChildren<AutoAttack>();
+ for (int i = 0; i < componentsInChildren.Length; i++)
+ {
+ componentsInChildren[i].ReduceCooldownBy(attackSpeedBonus * Time.deltaTime);
+ }
+ HotOilTower[] componentsInChildren2 = closestTower.GetComponentsInChildren<HotOilTower>();
+ for (int i = 0; i < componentsInChildren2.Length; i++)
+ {
+ componentsInChildren2[i].ReduceCooldownBy(attackSpeedBonus * Time.deltaTime);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PracticeTargetCoinDrop.cs b/Thronefall_v1.57/Thronefall/Thronefall/PracticeTargetCoinDrop.cs
new file mode 100644
index 0000000..760d9c2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PracticeTargetCoinDrop.cs
@@ -0,0 +1,33 @@
+using UnityEngine;
+
+public class PracticeTargetCoinDrop : MonoBehaviour
+{
+ private Hp hp;
+
+ private TagManager tagManager;
+
+ [SerializeField]
+ private int totalCoinsToDrop = 3;
+
+ private void Start()
+ {
+ hp = GetComponent<Hp>();
+ tagManager = TagManager.instance;
+ }
+
+ private void Update()
+ {
+ if (tagManager.CountAllTaggedObjectsWithTag(TagManager.ETag.PracticeTargets) <= totalCoinsToDrop)
+ {
+ hp.coinCount = 1;
+ }
+ }
+
+ private void OnDestroy()
+ {
+ if ((bool)hp && hp.HpValue <= 0f)
+ {
+ AchievementManager.UnlockAchievement(AchievementManager.Achievements.START_TUTORIAL);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PriorityAudioListener.cs b/Thronefall_v1.57/Thronefall/Thronefall/PriorityAudioListener.cs
new file mode 100644
index 0000000..127e5fb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PriorityAudioListener.cs
@@ -0,0 +1,27 @@
+using System.Collections;
+using UnityEngine;
+
+public class PriorityAudioListener : MonoBehaviour
+{
+ private void OnEnable()
+ {
+ StartCoroutine(ExecuteAfterTime());
+ }
+
+ private IEnumerator ExecuteAfterTime()
+ {
+ while (BackupAudioListener.Instance == null)
+ {
+ yield return null;
+ }
+ BackupAudioListener.Instance.EnableBackupListener(enable: false);
+ }
+
+ private void OnDisable()
+ {
+ if (BackupAudioListener.Instance != null)
+ {
+ BackupAudioListener.Instance.EnableBackupListener(enable: true);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ProductionBar.cs b/Thronefall_v1.57/Thronefall/Thronefall/ProductionBar.cs
new file mode 100644
index 0000000..2f838a1
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ProductionBar.cs
@@ -0,0 +1,23 @@
+using MPUIKIT;
+using UnityEngine;
+
+public class ProductionBar : MonoBehaviour
+{
+ [SerializeField]
+ private GameObject canvasParent;
+
+ [SerializeField]
+ private MPImage fill;
+
+ private float fillAmount = -1f;
+
+ public void UpdateVisual(float _fillAmount)
+ {
+ if (fillAmount != _fillAmount)
+ {
+ canvasParent.SetActive(_fillAmount > 0f);
+ fill.fillAmount = _fillAmount;
+ fillAmount = _fillAmount;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ProjectileAudio.cs b/Thronefall_v1.57/Thronefall/Thronefall/ProjectileAudio.cs
new file mode 100644
index 0000000..7390613
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ProjectileAudio.cs
@@ -0,0 +1,37 @@
+using UnityEngine;
+
+public class ProjectileAudio : MonoBehaviour
+{
+ public enum ProjectileType
+ {
+ Catapult
+ }
+
+ public AimbotProjectile target;
+
+ public AudioSource aSource;
+
+ public ProjectileType projectile;
+
+ public float pitchrange = 0.2f;
+
+ private void Start()
+ {
+ if (target != null)
+ {
+ target.onHit.AddListener(PlayImpact);
+ }
+ if (projectile == ProjectileType.Catapult)
+ {
+ aSource.clip = ThronefallAudioManager.Instance.audioContent.CatapultImpact.GetRandomClip();
+ }
+ aSource.pitch = Random.Range(1f - pitchrange, 1f + pitchrange);
+ }
+
+ private void PlayImpact()
+ {
+ aSource.Play();
+ aSource.transform.parent = null;
+ Object.Destroy(aSource.gameObject, aSource.clip.length);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ProjectileImpactParticles.cs b/Thronefall_v1.57/Thronefall/Thronefall/ProjectileImpactParticles.cs
new file mode 100644
index 0000000..6592a9b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ProjectileImpactParticles.cs
@@ -0,0 +1,22 @@
+using UnityEngine;
+
+public class ProjectileImpactParticles : MonoBehaviour
+{
+ public AimbotProjectile target;
+
+ public ParticleSystem particles;
+
+ private void Start()
+ {
+ if (target != null)
+ {
+ target.onHit.AddListener(Play);
+ }
+ }
+
+ private void Play()
+ {
+ particles.gameObject.transform.parent = null;
+ particles.Play();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ProjectileSpawnAudio.cs b/Thronefall_v1.57/Thronefall/Thronefall/ProjectileSpawnAudio.cs
new file mode 100644
index 0000000..de57603
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ProjectileSpawnAudio.cs
@@ -0,0 +1,11 @@
+using UnityEngine;
+
+public class ProjectileSpawnAudio : MonoBehaviour
+{
+ public ThronefallAudioManager.AudioOneShot oneShotType;
+
+ private void Start()
+ {
+ ThronefallAudioManager.WorldSpaceOneShot(oneShotType, base.transform.position);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/PushPlayer2D.cs b/Thronefall_v1.57/Thronefall/Thronefall/PushPlayer2D.cs
new file mode 100644
index 0000000..824a000
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/PushPlayer2D.cs
@@ -0,0 +1,28 @@
+using UnityEngine;
+
+public class PushPlayer2D : MonoBehaviour
+{
+ private PlayerMovement pm;
+
+ private Transform ptrans;
+
+ [SerializeField]
+ private float ensureDistance = 10f;
+
+ private void Start()
+ {
+ pm = PlayerMovement.instance;
+ ptrans = pm.transform;
+ }
+
+ private void Update()
+ {
+ Vector3 vector = new Vector3(ptrans.position.x - base.transform.position.x, 0f, ptrans.position.z - base.transform.position.z);
+ float magnitude = vector.magnitude;
+ if (magnitude < ensureDistance)
+ {
+ Vector3 normalized = vector.normalized;
+ pm.TeleportTo(ptrans.position + normalized * (ensureDistance - magnitude));
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Quest.cs b/Thronefall_v1.57/Thronefall/Thronefall/Quest.cs
new file mode 100644
index 0000000..afeeb3b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Quest.cs
@@ -0,0 +1,126 @@
+using System;
+using System.Collections.Generic;
+
+[Serializable]
+public class Quest
+{
+ public enum EType
+ {
+ BeatTheLevel = 0,
+ AchieveScoreOf = 2,
+ BeatTheLevelWith = 1,
+ BeatTheLevelWithout = 3
+ }
+
+ public EType questType;
+
+ public List<Equippable> beatTheLevelWith = new List<Equippable>();
+
+ public int achieveScoreOf;
+
+ public List<Equippable> beatTheLevelWithout = new List<Equippable>();
+
+ private bool IsBeatLevelWith => questType == EType.BeatTheLevelWith;
+
+ private bool IsAchieveScoreOf => questType == EType.AchieveScoreOf;
+
+ private bool IsBeatLevelWithout => questType == EType.BeatTheLevelWithout;
+
+ public bool CheckBeaten(LevelData _myLevelData)
+ {
+ List<Equippable> countQuestsAsIncompleteWith = PerkManager.instance.countQuestsAsIncompleteWith;
+ switch (questType)
+ {
+ case EType.BeatTheLevel:
+ return _myLevelData.beatenBest;
+ case EType.AchieveScoreOf:
+ return _myLevelData.highscoreBest >= achieveScoreOf;
+ case EType.BeatTheLevelWith:
+ {
+ for (int k = 0; k < _myLevelData.levelHasBeenBeatenWith.Count; k++)
+ {
+ List<Equippable> list2 = _myLevelData.levelHasBeenBeatenWith[k];
+ int num = beatTheLevelWith.Count;
+ for (int l = 0; l < list2.Count; l++)
+ {
+ if (beatTheLevelWith.Contains(list2[l]))
+ {
+ num--;
+ }
+ if (num <= 0 && !ContainsAnyItemsFromList(list2, countQuestsAsIncompleteWith))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ case EType.BeatTheLevelWithout:
+ {
+ for (int i = 0; i < _myLevelData.levelHasBeenBeatenWith.Count; i++)
+ {
+ List<Equippable> list = _myLevelData.levelHasBeenBeatenWith[i];
+ bool flag = true;
+ for (int j = 0; j < list.Count; j++)
+ {
+ if (beatTheLevelWithout.Contains(list[j]))
+ {
+ flag = false;
+ break;
+ }
+ }
+ if (flag && !ContainsAnyItemsFromList(list, countQuestsAsIncompleteWith))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ default:
+ return false;
+ }
+ }
+
+ private bool ContainsAnyItemsFromList(List<Equippable> mainList, List<Equippable> checkList)
+ {
+ foreach (Equippable check in checkList)
+ {
+ if (mainList.Contains(check))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public string GetMissionStatement()
+ {
+ string result = "";
+ switch (questType)
+ {
+ case EType.AchieveScoreOf:
+ result = TextTranslator.Translate("Achieve Score") + " " + achieveScoreOf;
+ break;
+ case EType.BeatTheLevel:
+ result = TextTranslator.Translate("Achieve Victory");
+ break;
+ case EType.BeatTheLevelWith:
+ result = TextTranslator.Translate("Achieve Victory With");
+ foreach (Equippable item in beatTheLevelWith)
+ {
+ result = result + " " + item.displayName + " +";
+ }
+ result = result.Remove(result.Length - 1, 1);
+ break;
+ case EType.BeatTheLevelWithout:
+ result = TextTranslator.Translate("Achieve Victory Without");
+ foreach (Equippable item2 in beatTheLevelWithout)
+ {
+ result = result + " " + item2.displayName + " +";
+ }
+ result = result.Remove(result.Length - 1, 1);
+ break;
+ }
+ return result;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/QuestConditionEquippable.cs b/Thronefall_v1.57/Thronefall/Thronefall/QuestConditionEquippable.cs
new file mode 100644
index 0000000..41c9d94
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/QuestConditionEquippable.cs
@@ -0,0 +1,33 @@
+using MPUIKIT;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class QuestConditionEquippable : MonoBehaviour
+{
+ public Color weaponBgColor;
+
+ public Color perkBgColor;
+
+ public Color mutatorBgColor;
+
+ public MPImageBasic background;
+
+ public Image icon;
+
+ public void SetData(Equippable data)
+ {
+ icon.sprite = data.icon;
+ if (data is EquippableWeapon)
+ {
+ background.color = weaponBgColor;
+ }
+ if (data is EquippablePerk)
+ {
+ background.color = perkBgColor;
+ }
+ if (data is EquippableMutation)
+ {
+ background.color = mutatorBgColor;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/QuestEntry.cs b/Thronefall_v1.57/Thronefall/Thronefall/QuestEntry.cs
new file mode 100644
index 0000000..b49695c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/QuestEntry.cs
@@ -0,0 +1,88 @@
+using TMPro;
+using UnityEngine;
+
+public class QuestEntry : MonoBehaviour
+{
+ public TextMeshProUGUI questText;
+
+ public TextMeshProUGUI numericalCondition;
+
+ public GameObject equippableConditionsParent;
+
+ public QuestConditionEquippable equippableConditionPrefab;
+
+ public CanvasGroup canvasGroup;
+
+ public void Init(Quest data, int index, bool completed)
+ {
+ string text = "<style=\"Body Bold Italic\">";
+ switch (index)
+ {
+ case 0:
+ text += "A.";
+ break;
+ case 1:
+ text += "B.";
+ break;
+ case 2:
+ text += "C.";
+ break;
+ case 3:
+ text += "D.";
+ break;
+ case 4:
+ text += "E.";
+ break;
+ case 5:
+ text += "F.";
+ break;
+ case 6:
+ text += "G.";
+ break;
+ case 7:
+ text += "H.";
+ break;
+ }
+ text += " ";
+ text += "<style=\"Body Light\">";
+ switch (data.questType)
+ {
+ case Quest.EType.AchieveScoreOf:
+ equippableConditionsParent.SetActive(value: false);
+ numericalCondition.gameObject.SetActive(value: true);
+ numericalCondition.text = data.achieveScoreOf.ToString();
+ text += TextTranslator.Translate("Quests/Achieve Score");
+ break;
+ case Quest.EType.BeatTheLevel:
+ equippableConditionsParent.SetActive(value: false);
+ numericalCondition.gameObject.SetActive(value: false);
+ text += TextTranslator.Translate("Quests/Achieve Victory");
+ break;
+ case Quest.EType.BeatTheLevelWith:
+ equippableConditionsParent.SetActive(value: true);
+ numericalCondition.gameObject.SetActive(value: false);
+ text += TextTranslator.Translate("Quests/Achieve Victory With");
+ foreach (Equippable item in data.beatTheLevelWith)
+ {
+ Object.Instantiate(equippableConditionPrefab, equippableConditionsParent.transform).SetData(item);
+ }
+ break;
+ case Quest.EType.BeatTheLevelWithout:
+ equippableConditionsParent.SetActive(value: true);
+ numericalCondition.gameObject.SetActive(value: false);
+ text += TextTranslator.Translate("Quests/Achieve Victory Without");
+ foreach (Equippable item2 in data.beatTheLevelWithout)
+ {
+ Object.Instantiate(equippableConditionPrefab, equippableConditionsParent.transform).SetData(item2);
+ }
+ break;
+ }
+ questText.text = text;
+ if (completed)
+ {
+ canvasGroup.alpha = 0.1f;
+ questText.text = questText.text.ToUpper();
+ questText.fontStyle = FontStyles.Strikethrough;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/QuestMenu.cs b/Thronefall_v1.57/Thronefall/Thronefall/QuestMenu.cs
new file mode 100644
index 0000000..df201d3
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/QuestMenu.cs
@@ -0,0 +1,21 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class QuestMenu : MonoBehaviour
+{
+ public void UpdateVisualization(LevelData _levelData, List<Quest> _quests)
+ {
+ for (int i = 0; i < base.transform.childCount; i++)
+ {
+ QuestTagUI component = base.transform.GetChild(i).GetComponent<QuestTagUI>();
+ if (i < _quests.Count)
+ {
+ component.UpdateVisualization(_quests[i], _levelData);
+ }
+ else
+ {
+ component.UpdateVisualization(null, null);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/QuestOverallProgressDisplay.cs b/Thronefall_v1.57/Thronefall/Thronefall/QuestOverallProgressDisplay.cs
new file mode 100644
index 0000000..19ecb60
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/QuestOverallProgressDisplay.cs
@@ -0,0 +1,15 @@
+using TMPro;
+using UnityEngine;
+
+public class QuestOverallProgressDisplay : MonoBehaviour
+{
+ public TextMeshProUGUI display;
+
+ private void Update()
+ {
+ if (!(LevelProgressManager.instance == null))
+ {
+ display.text = LevelProgressManager.instance.CrownsAchieved() + "/" + LevelProgressManager.instance.CrownsAvailabe();
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/QuestTagUI.cs b/Thronefall_v1.57/Thronefall/Thronefall/QuestTagUI.cs
new file mode 100644
index 0000000..0930a9c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/QuestTagUI.cs
@@ -0,0 +1,107 @@
+using TMPro;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class QuestTagUI : MonoBehaviour
+{
+ [Header("Setup")]
+ public Image completeImage;
+
+ public Color completeColor;
+
+ public Color incompleteColor;
+
+ public TMP_Text description;
+
+ public Image icon1;
+
+ public GameObject crossedOut1;
+
+ public Image icon2;
+
+ public GameObject crossedOut2;
+
+ public Image icon3;
+
+ public GameObject crossedOut3;
+
+ public TMP_Text goalNumber;
+
+ [Header("Quest Texts")]
+ public string completeLevel = "Achieve a victory.";
+
+ public string achieveScoreOf = "Achieve score:";
+
+ public string winWith = "Win with:";
+
+ public string winWithout = "Win without:";
+
+ public void UpdateVisualization(Quest _quest, LevelData _levelData)
+ {
+ if (_quest == null || _levelData == null)
+ {
+ base.gameObject.SetActive(value: false);
+ return;
+ }
+ base.gameObject.SetActive(value: true);
+ bool flag = _quest.CheckBeaten(_levelData);
+ completeImage.color = (flag ? completeColor : incompleteColor);
+ crossedOut1.SetActive(value: false);
+ crossedOut2.SetActive(value: false);
+ crossedOut3.SetActive(value: false);
+ icon1.gameObject.SetActive(value: false);
+ icon2.gameObject.SetActive(value: false);
+ icon3.gameObject.SetActive(value: false);
+ goalNumber.gameObject.SetActive(value: false);
+ switch (_quest.questType)
+ {
+ case Quest.EType.BeatTheLevel:
+ description.text = completeLevel;
+ break;
+ case Quest.EType.AchieveScoreOf:
+ description.text = achieveScoreOf;
+ goalNumber.gameObject.SetActive(value: true);
+ goalNumber.text = _quest.achieveScoreOf.ToString();
+ break;
+ case Quest.EType.BeatTheLevelWith:
+ icon1.gameObject.SetActive(_quest.beatTheLevelWith.Count > 0);
+ icon2.gameObject.SetActive(_quest.beatTheLevelWith.Count > 1);
+ icon3.gameObject.SetActive(_quest.beatTheLevelWith.Count > 2);
+ if (_quest.beatTheLevelWith.Count > 0)
+ {
+ icon1.sprite = _quest.beatTheLevelWith[0].icon;
+ }
+ if (_quest.beatTheLevelWith.Count > 1)
+ {
+ icon2.sprite = _quest.beatTheLevelWith[1].icon;
+ }
+ if (_quest.beatTheLevelWith.Count > 2)
+ {
+ icon3.sprite = _quest.beatTheLevelWith[2].icon;
+ }
+ description.text = winWith;
+ break;
+ case Quest.EType.BeatTheLevelWithout:
+ description.text = winWithout;
+ crossedOut1.SetActive(value: true);
+ crossedOut2.SetActive(value: true);
+ crossedOut3.SetActive(value: true);
+ icon1.gameObject.SetActive(_quest.beatTheLevelWithout.Count > 0);
+ icon2.gameObject.SetActive(_quest.beatTheLevelWithout.Count > 1);
+ icon3.gameObject.SetActive(_quest.beatTheLevelWithout.Count > 2);
+ if (_quest.beatTheLevelWithout.Count > 0)
+ {
+ icon1.sprite = _quest.beatTheLevelWithout[0].icon;
+ }
+ if (_quest.beatTheLevelWithout.Count > 1)
+ {
+ icon3.sprite = _quest.beatTheLevelWithout[1].icon;
+ }
+ if (_quest.beatTheLevelWithout.Count > 2)
+ {
+ icon3.sprite = _quest.beatTheLevelWithout[2].icon;
+ }
+ break;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/QuickslingBarrelRotator.cs b/Thronefall_v1.57/Thronefall/Thronefall/QuickslingBarrelRotator.cs
new file mode 100644
index 0000000..693df38
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/QuickslingBarrelRotator.cs
@@ -0,0 +1,40 @@
+using UnityEngine;
+
+public class QuickslingBarrelRotator : MonoBehaviour
+{
+ public Transform transformToRotate;
+
+ public AutoAttack attack;
+
+ public float attackSmoothTime = 0.05f;
+
+ private Vector3 desiredForward;
+
+ private Vector3 angularVelocityRef;
+
+ private float minSqVelocity = 1.5f;
+
+ private void Start()
+ {
+ if ((bool)attack)
+ {
+ attack.onAttackTriggered.AddListener(OnAttack);
+ }
+ desiredForward = transformToRotate.forward;
+ }
+
+ private void Update()
+ {
+ if (Vector3.Angle(transformToRotate.forward, desiredForward) > 3f)
+ {
+ transformToRotate.forward = Vector3.SmoothDamp(transformToRotate.forward, desiredForward, ref angularVelocityRef, attackSmoothTime);
+ }
+ }
+
+ private void OnAttack()
+ {
+ desiredForward = attack.LastTargetPosition - transformToRotate.position;
+ desiredForward.y = 0f;
+ desiredForward.Normalize();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/RacerRoll.cs b/Thronefall_v1.57/Thronefall/Thronefall/RacerRoll.cs
new file mode 100644
index 0000000..df24259
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/RacerRoll.cs
@@ -0,0 +1,16 @@
+using Pathfinding.RVO;
+using UnityEngine;
+
+public class RacerRoll : MonoBehaviour
+{
+ public RVOController rvo;
+
+ public float speedMultiplier = 4f;
+
+ public Transform targetTransform;
+
+ private void Update()
+ {
+ targetTransform.Rotate(rvo.velocity.sqrMagnitude * speedMultiplier * Time.deltaTime, 0f, 0f, Space.Self);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/RandomizeExtensionsForLists.cs b/Thronefall_v1.57/Thronefall/Thronefall/RandomizeExtensionsForLists.cs
new file mode 100644
index 0000000..9a81fe7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/RandomizeExtensionsForLists.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+
+public static class RandomizeExtensionsForLists
+{
+ public static void ETShuffle<T>(this IList<T> list, Random generator)
+ {
+ int num = list.Count;
+ while (num > 1)
+ {
+ num--;
+ int index = generator.Next(num + 1);
+ T value = list[index];
+ list[index] = list[num];
+ list[num] = value;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/RangeIndicatorHandler.cs b/Thronefall_v1.57/Thronefall/Thronefall/RangeIndicatorHandler.cs
new file mode 100644
index 0000000..975e8b6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/RangeIndicatorHandler.cs
@@ -0,0 +1,207 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class RangeIndicatorHandler : MonoBehaviour
+{
+ public class IndicatorHandle
+ {
+ public GameObject targetObject;
+
+ public Transform targetTransform;
+
+ public Material targetMaterial;
+
+ public float targetFade;
+
+ public IndicatorHandle(GameObject target)
+ {
+ targetObject = target;
+ targetTransform = target.transform;
+ targetMaterial = target.GetComponent<MeshRenderer>().material;
+ targetMaterial.SetFloat("_Intersection_Depth", 0f);
+ }
+ }
+
+ public enum IndicatorType
+ {
+ Built,
+ Preview,
+ Special
+ }
+
+ public const float FADE_SPEED = 1.75f;
+
+ public const float TARGET_DEPTH = 0.75f;
+
+ public static RangeIndicatorHandler instance;
+
+ public GameObject builtIndicatorPrefab;
+
+ public GameObject previewIndicatorPrefab;
+
+ public GameObject specialIndicatorPrefab;
+
+ private Dictionary<GameObject, IndicatorHandle> builtIndicators = new Dictionary<GameObject, IndicatorHandle>();
+
+ private Dictionary<GameObject, IndicatorHandle> previewIndicators = new Dictionary<GameObject, IndicatorHandle>();
+
+ private Dictionary<GameObject, IndicatorHandle> specialIndicators = new Dictionary<GameObject, IndicatorHandle>();
+
+ private List<GameObject> removeFromBuilt = new List<GameObject>();
+
+ private List<GameObject> removeFromPreview = new List<GameObject>();
+
+ private List<GameObject> removeFromSpecial = new List<GameObject>();
+
+ private void Awake()
+ {
+ if (instance != null)
+ {
+ Object.Destroy(this);
+ }
+ else
+ {
+ instance = this;
+ }
+ }
+
+ private void Update()
+ {
+ if (builtIndicators.Count == 0 && previewIndicators.Count == 0 && specialIndicators.Count == 0)
+ {
+ return;
+ }
+ removeFromBuilt.Clear();
+ removeFromPreview.Clear();
+ removeFromSpecial.Clear();
+ foreach (KeyValuePair<GameObject, IndicatorHandle> builtIndicator in builtIndicators)
+ {
+ float @float = builtIndicator.Value.targetMaterial.GetFloat("_Intersection_Depth");
+ if (@float == 0f && builtIndicator.Value.targetFade == 0f)
+ {
+ Object.Destroy(builtIndicator.Value.targetObject);
+ removeFromBuilt.Add(builtIndicator.Key);
+ }
+ else
+ {
+ @float = Mathf.MoveTowards(@float, builtIndicator.Value.targetFade, 1.75f * Time.deltaTime);
+ builtIndicator.Value.targetMaterial.SetFloat("_Intersection_Depth", @float);
+ }
+ }
+ foreach (KeyValuePair<GameObject, IndicatorHandle> previewIndicator in previewIndicators)
+ {
+ float float2 = previewIndicator.Value.targetMaterial.GetFloat("_Intersection_Depth");
+ if (float2 == 0f && previewIndicator.Value.targetFade == 0f)
+ {
+ Object.Destroy(previewIndicator.Value.targetObject);
+ removeFromPreview.Add(previewIndicator.Key);
+ }
+ else
+ {
+ float2 = Mathf.MoveTowards(float2, previewIndicator.Value.targetFade, 1.75f * Time.deltaTime);
+ previewIndicator.Value.targetMaterial.SetFloat("_Intersection_Depth", float2);
+ }
+ }
+ foreach (KeyValuePair<GameObject, IndicatorHandle> specialIndicator in specialIndicators)
+ {
+ float float3 = specialIndicator.Value.targetMaterial.GetFloat("_Intersection_Depth");
+ if (float3 == 0f && specialIndicator.Value.targetFade == 0f)
+ {
+ Object.Destroy(specialIndicator.Value.targetObject);
+ removeFromSpecial.Add(specialIndicator.Key);
+ }
+ else
+ {
+ float3 = Mathf.MoveTowards(float3, specialIndicator.Value.targetFade, 1.75f * Time.deltaTime);
+ specialIndicator.Value.targetMaterial.SetFloat("_Intersection_Depth", float3);
+ }
+ }
+ foreach (GameObject item in removeFromBuilt)
+ {
+ builtIndicators.Remove(item);
+ }
+ foreach (GameObject item2 in removeFromPreview)
+ {
+ previewIndicators.Remove(item2);
+ }
+ foreach (GameObject item3 in removeFromSpecial)
+ {
+ specialIndicators.Remove(item3);
+ }
+ }
+
+ public void ShowIndicator(Vector3 position, float range, GameObject sender, IndicatorType indicatorType)
+ {
+ Dictionary<GameObject, IndicatorHandle> dictionary = null;
+ GameObject original = null;
+ switch (indicatorType)
+ {
+ case IndicatorType.Built:
+ dictionary = builtIndicators;
+ original = builtIndicatorPrefab;
+ break;
+ case IndicatorType.Preview:
+ dictionary = previewIndicators;
+ original = previewIndicatorPrefab;
+ break;
+ case IndicatorType.Special:
+ dictionary = specialIndicators;
+ original = specialIndicatorPrefab;
+ break;
+ }
+ if (dictionary.ContainsKey(sender))
+ {
+ IndicatorHandle indicatorHandle = dictionary[sender];
+ indicatorHandle.targetObject.SetActive(value: true);
+ indicatorHandle.targetTransform.localScale = Vector3.one * range * 2f;
+ indicatorHandle.targetTransform.position = position;
+ indicatorHandle.targetFade = 0.75f;
+ }
+ else
+ {
+ IndicatorHandle indicatorHandle2 = new IndicatorHandle(Object.Instantiate(original, position, Quaternion.identity));
+ indicatorHandle2.targetTransform.localScale = Vector3.one * range * 2f;
+ indicatorHandle2.targetFade = 0.75f;
+ dictionary.Add(sender, indicatorHandle2);
+ }
+ }
+
+ public void HideIndicator(GameObject sender, IndicatorType indicatorType)
+ {
+ switch (indicatorType)
+ {
+ case IndicatorType.Built:
+ if (builtIndicators.ContainsKey(sender))
+ {
+ builtIndicators[sender].targetFade = 0f;
+ }
+ break;
+ case IndicatorType.Preview:
+ if (previewIndicators.ContainsKey(sender))
+ {
+ previewIndicators[sender].targetFade = 0f;
+ }
+ break;
+ case IndicatorType.Special:
+ if (specialIndicators.ContainsKey(sender))
+ {
+ specialIndicators[sender].targetFade = 0f;
+ }
+ break;
+ }
+ }
+
+ private void OnDisable()
+ {
+ foreach (KeyValuePair<GameObject, IndicatorHandle> builtIndicator in builtIndicators)
+ {
+ Object.Destroy(builtIndicator.Value.targetObject);
+ removeFromBuilt.Add(builtIndicator.Key);
+ }
+ foreach (KeyValuePair<GameObject, IndicatorHandle> previewIndicator in previewIndicators)
+ {
+ Object.Destroy(previewIndicator.Value.targetObject);
+ removeFromPreview.Add(previewIndicator.Key);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ReduceChildrensBuildRequirementIfPerk.cs b/Thronefall_v1.57/Thronefall/Thronefall/ReduceChildrensBuildRequirementIfPerk.cs
new file mode 100644
index 0000000..33ffbb6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ReduceChildrensBuildRequirementIfPerk.cs
@@ -0,0 +1,23 @@
+using UnityEngine;
+
+public class ReduceChildrensBuildRequirementIfPerk : MonoBehaviour
+{
+ [SerializeField]
+ private Equippable perk;
+
+ private void Update()
+ {
+ if (PerkManager.instance.CurrentlyEquipped.Contains(perk))
+ {
+ BuildSlot component = GetComponent<BuildSlot>();
+ foreach (BuildSlot item in component.IsRootOf)
+ {
+ if (item.ActivatorBuilding == component)
+ {
+ item.ActivatorLevel = Mathf.Max(0, item.ActivatorLevel - 1);
+ }
+ }
+ }
+ Object.Destroy(this);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ResetAudioSettings.cs b/Thronefall_v1.57/Thronefall/Thronefall/ResetAudioSettings.cs
new file mode 100644
index 0000000..23fde41
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ResetAudioSettings.cs
@@ -0,0 +1,13 @@
+using UnityEngine;
+
+public class ResetAudioSettings : MonoBehaviour
+{
+ public GameObject objToRefresh;
+
+ public void Trigger()
+ {
+ SettingsManager.Instance.ResetAudioSettings();
+ objToRefresh.SetActive(value: false);
+ objToRefresh.SetActive(value: true);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ResetControlsHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/ResetControlsHelper.cs
new file mode 100644
index 0000000..bdee568
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ResetControlsHelper.cs
@@ -0,0 +1,9 @@
+using UnityEngine;
+
+public class ResetControlsHelper : MonoBehaviour
+{
+ public void TriggerOpenPanel()
+ {
+ UIFrameManager.ShowResetControlsFrame();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ResolutionExtensions.cs b/Thronefall_v1.57/Thronefall/Thronefall/ResolutionExtensions.cs
new file mode 100644
index 0000000..989e12e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ResolutionExtensions.cs
@@ -0,0 +1,13 @@
+using UnityEngine;
+
+public static class ResolutionExtensions
+{
+ public static bool CompareResolutions(this Resolution resA, Resolution resB)
+ {
+ if (resA.width == resB.width)
+ {
+ return resA.height == resB.height;
+ }
+ return false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/RevivePanel.cs b/Thronefall_v1.57/Thronefall/Thronefall/RevivePanel.cs
new file mode 100644
index 0000000..d1e6c6e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/RevivePanel.cs
@@ -0,0 +1,29 @@
+using MPUIKIT;
+using TMPro;
+using UnityEngine;
+
+public class RevivePanel : MonoBehaviour
+{
+ public GameObject revivePanel;
+
+ public TMP_Text counterText;
+
+ public MPImage fill;
+
+ public AutoRevive playerReviveComponent;
+
+ private void Update()
+ {
+ float timeTillRevive = playerReviveComponent.TimeTillRevive;
+ if (timeTillRevive > 0f && LocalGamestate.Instance.CurrentState == LocalGamestate.State.InMatch)
+ {
+ revivePanel.SetActive(value: true);
+ counterText.text = Mathf.Floor(timeTillRevive).ToString();
+ fill.fillAmount = Mathf.InverseLerp(playerReviveComponent.reviveAfterBeingKnockedOutFor, 0f, timeTillRevive);
+ }
+ else
+ {
+ revivePanel.SetActive(value: false);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/RidingDamager.cs b/Thronefall_v1.57/Thronefall/Thronefall/RidingDamager.cs
new file mode 100644
index 0000000..4bb1b6d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/RidingDamager.cs
@@ -0,0 +1,81 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class RidingDamager : MonoBehaviour
+{
+ public Hp playerHp;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public float selfInflictedDamagePerHit = 1f;
+
+ public Equippable requiredUpgrade;
+
+ public LayerMask lmRecieveDamage;
+
+ public List<DamageModifyer> damage;
+
+ private BoxCollider myCollider;
+
+ private Collider[] tempColliders = new Collider[50];
+
+ public float cooldownPerObject = 4f;
+
+ private PlayerMovement playerMovement;
+
+ private PlayerUpgradeManager upgradeManager;
+
+ private BlacksmithUpgrades blacksmithUpgrades;
+
+ private List<TaggedObject> recentlyHit = new List<TaggedObject>();
+
+ private List<float> recentlyHitWhen = new List<float>();
+
+ private float time;
+
+ public float DamageMultiplyer => upgradeManager.PlayerDamageMultiplyer * blacksmithUpgrades.meleeDamage;
+
+ private void Start()
+ {
+ if (!PerkManager.IsEquipped(requiredUpgrade))
+ {
+ Object.Destroy(base.gameObject);
+ return;
+ }
+ myCollider = GetComponent<BoxCollider>();
+ playerMovement = GetComponentInParent<PlayerMovement>();
+ upgradeManager = PlayerUpgradeManager.instance;
+ blacksmithUpgrades = BlacksmithUpgrades.instance;
+ }
+
+ private void Update()
+ {
+ Vector3 center = base.transform.localToWorldMatrix.MultiplyPoint(myCollider.center);
+ Vector3 halfExtents = base.transform.localToWorldMatrix.MultiplyVector(myCollider.size);
+ if (playerMovement.Moving && playerMovement.enabled && playerHp.HpValue > 0f)
+ {
+ int num = Physics.OverlapBoxNonAlloc(center, halfExtents, tempColliders, base.transform.rotation, lmRecieveDamage);
+ for (int i = 0; i < num && !(tempColliders[i] == null); i++)
+ {
+ DealWithColliderHit(tempColliders[i]);
+ }
+ }
+ time += Time.deltaTime;
+ while (recentlyHitWhen.Count > 0 && time - recentlyHitWhen[0] > cooldownPerObject)
+ {
+ recentlyHitWhen.RemoveAt(0);
+ recentlyHit.RemoveAt(0);
+ }
+ }
+
+ private void DealWithColliderHit(Collider other)
+ {
+ TaggedObject componentInParent = other.GetComponentInParent<TaggedObject>();
+ if ((bool)componentInParent && !recentlyHit.Contains(componentInParent) && componentInParent.Tags.Contains(TagManager.ETag.EnemyOwned))
+ {
+ componentInParent.Hp.TakeDamage(Weapon.CalculateDamageGeneral(componentInParent, damage, DamageMultiplyer));
+ playerHp.TakeDamage(selfInflictedDamagePerHit * DamageMultiplyer);
+ recentlyHit.Add(componentInParent);
+ recentlyHitWhen.Add(time);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/RiverScroller.cs b/Thronefall_v1.57/Thronefall/Thronefall/RiverScroller.cs
new file mode 100644
index 0000000..65f9f3c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/RiverScroller.cs
@@ -0,0 +1,18 @@
+using UnityEngine;
+
+public class RiverScroller : MonoBehaviour
+{
+ public Material mat;
+
+ public float speed;
+
+ public string propertyName;
+
+ private float xOffset;
+
+ private void Update()
+ {
+ xOffset += Time.deltaTime * speed;
+ mat.SetTextureOffset(propertyName, new Vector2(xOffset, 0f));
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/RotateForwardToRVOVelocity.cs b/Thronefall_v1.57/Thronefall/Thronefall/RotateForwardToRVOVelocity.cs
new file mode 100644
index 0000000..3bbf35f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/RotateForwardToRVOVelocity.cs
@@ -0,0 +1,64 @@
+using UnityEngine;
+
+public class RotateForwardToRVOVelocity : MonoBehaviour
+{
+ public Transform transformToRotate;
+
+ public PathfindMovement target;
+
+ public AutoAttack attack;
+
+ public float regularSmoothTime = 0.1f;
+
+ public float attackSmoothTime = 0.05f;
+
+ private Vector3 desiredForward;
+
+ private Vector3 angularVelocityRef;
+
+ private float minSqVelocity = 1.5f;
+
+ private bool attackOverride;
+
+ private void Start()
+ {
+ if ((bool)attack)
+ {
+ attack.onAttackTriggered.AddListener(OnAttack);
+ }
+ desiredForward = transformToRotate.forward;
+ }
+
+ private void Update()
+ {
+ if ((bool)target && target.RVO.velocity.sqrMagnitude > minSqVelocity && !attackOverride)
+ {
+ desiredForward = target.RVO.velocity;
+ desiredForward.y = 0f;
+ desiredForward.Normalize();
+ }
+ if (Vector3.Angle(transformToRotate.forward, desiredForward) > 3f)
+ {
+ if (attackOverride)
+ {
+ transformToRotate.forward = Vector3.SmoothDamp(transformToRotate.forward, desiredForward, ref angularVelocityRef, attackSmoothTime);
+ }
+ else
+ {
+ transformToRotate.forward = Vector3.SmoothDamp(transformToRotate.forward, desiredForward, ref angularVelocityRef, regularSmoothTime);
+ }
+ }
+ else
+ {
+ attackOverride = false;
+ }
+ }
+
+ private void OnAttack()
+ {
+ desiredForward = attack.LastTargetPosition - transformToRotate.position;
+ desiredForward.y = 0f;
+ desiredForward.Normalize();
+ attackOverride = true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/RoyalForgeUpgrade.cs b/Thronefall_v1.57/Thronefall/Thronefall/RoyalForgeUpgrade.cs
new file mode 100644
index 0000000..d89a86c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/RoyalForgeUpgrade.cs
@@ -0,0 +1,203 @@
+using UnityEngine;
+
+public class RoyalForgeUpgrade : MonoBehaviour, DayNightCycle.IDaytimeSensitive, ISaveLoad
+{
+ public enum ERoyalForgeUpgrades
+ {
+ AutoAttackSpeed,
+ AdditionalHealth,
+ CooldownReduction,
+ OverallDamage
+ }
+
+ [SerializeField]
+ private BuildingInteractor buildingInteractor;
+
+ [SerializeField]
+ private ProductionBar productionBar;
+
+ [SerializeField]
+ private ERoyalForgeUpgrades upgrade;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ [SerializeField]
+ private float multiplyer = 1.2f;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ [SerializeField]
+ private int researchTime = 2;
+
+ [SerializeField]
+ private Equippable researchSpeedPerk;
+
+ private int researchTimeLeft;
+
+ private bool isInitializedForSaving;
+
+ private bool hasLoadedDataFromSave;
+
+ private bool bumpedResearchThisDawn;
+
+ private void Start()
+ {
+ if (!hasLoadedDataFromSave || researchTimeLeft > 0)
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ }
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ if (!base.gameObject.activeInHierarchy || bumpedResearchThisDawn)
+ {
+ return;
+ }
+ bumpedResearchThisDawn = true;
+ isInitializedForSaving = true;
+ if (!buildingInteractor.KnockedOutTonight)
+ {
+ researchTimeLeft--;
+ UpdateProgressBar();
+ if (researchTimeLeft <= 0)
+ {
+ productionBar.gameObject.SetActive(value: false);
+ buildingInteractor.showsHarvestDeniedCueEvenWithNoIncome = false;
+ ApplyUpgrade();
+ buildingInteractor.buildingIsCurrentlyBusyAndCantBeUpgraded = false;
+ buildingInteractor.UpdateInteractionState();
+ DayNightCycle.Instance.UnregisterDaytimeSensitiveObject(this);
+ }
+ }
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ private void ApplyUpgrade()
+ {
+ switch (upgrade)
+ {
+ case ERoyalForgeUpgrades.AutoAttackSpeed:
+ AutoAttackMulti(multiplyer);
+ break;
+ case ERoyalForgeUpgrades.AdditionalHealth:
+ {
+ PlayerMovement[] registeredPlayers = PlayerManager.Instance.RegisteredPlayers;
+ for (int i = 0; i < registeredPlayers.Length; i++)
+ {
+ Hp component = registeredPlayers[i].GetComponent<Hp>();
+ component.maxHp *= multiplyer;
+ component.Heal(float.MaxValue);
+ }
+ PlayerUpgradeManager.instance.PlayerHealthRegenerationMultiplyer *= multiplyer;
+ break;
+ }
+ case ERoyalForgeUpgrades.CooldownReduction:
+ ManualAttackMulti(multiplyer);
+ break;
+ case ERoyalForgeUpgrades.OverallDamage:
+ PlayerUpgradeManager.instance.PlayerDamageMultiplyer *= multiplyer;
+ break;
+ }
+ }
+
+ public static void ManualAttackMulti(float _multi)
+ {
+ if ((bool)PlayerInteraction.instance.ManualAttack)
+ {
+ if (PlayerInteraction.instance.ManualAttack.GetType() == typeof(StabMA))
+ {
+ ((StabMA)PlayerInteraction.instance.ManualAttack).maximumCooldownTime *= _multi;
+ }
+ else
+ {
+ PlayerInteraction.instance.ManualAttack.cooldownTime *= _multi;
+ }
+ }
+ }
+
+ public static void AutoAttackMulti(float _multi)
+ {
+ if ((bool)PlayerInteraction.instance.AutoAttack)
+ {
+ PlayerInteraction.instance.AutoAttack.cooldownTime *= _multi;
+ }
+ }
+
+ public void OnDusk()
+ {
+ bumpedResearchThisDawn = false;
+ }
+
+ private void OnEnable()
+ {
+ ManualLoad(GetComponentInParent<SaveLoadEntity>().GUID);
+ if (!hasLoadedDataFromSave)
+ {
+ researchTimeLeft = researchTime;
+ if (PerkManager.IsEquipped(researchSpeedPerk))
+ {
+ researchTimeLeft--;
+ }
+ UpdateProgressBar();
+ buildingInteractor.buildingIsCurrentlyBusyAndCantBeUpgraded = true;
+ buildingInteractor.UpdateInteractionState();
+ }
+ }
+
+ private void UpdateProgressBar()
+ {
+ productionBar.gameObject.SetActive(value: true);
+ productionBar.UpdateVisual(1f - (float)researchTimeLeft / (float)researchTime + 0.075f);
+ buildingInteractor.showsHarvestDeniedCueEvenWithNoIncome = true;
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnSave(string guid)
+ {
+ if (isInitializedForSaving)
+ {
+ MatchSaveLoadHandler.SaveValue(guid, base.transform.parent.gameObject.name + "_" + base.gameObject.name + "_researchTimeLeft", researchTimeLeft);
+ }
+ }
+
+ private void ManualLoad(string guid)
+ {
+ if (!MatchSaveLoadHandler.IsLoadingPermitted)
+ {
+ return;
+ }
+ hasLoadedDataFromSave = MatchSaveLoadHandler.TryLoadValue(guid, base.transform.parent.gameObject.name + "_" + base.gameObject.name + "_researchTimeLeft", ref researchTimeLeft);
+ if (hasLoadedDataFromSave)
+ {
+ if (researchTimeLeft > 0)
+ {
+ UpdateProgressBar();
+ buildingInteractor.buildingIsCurrentlyBusyAndCantBeUpgraded = true;
+ buildingInteractor.UpdateInteractionState();
+ }
+ else
+ {
+ ApplyUpgrade();
+ buildingInteractor.UpdateInteractionState();
+ researchTimeLeft = -10;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/RoyalForgeUpgrades.cs b/Thronefall_v1.57/Thronefall/Thronefall/RoyalForgeUpgrades.cs
new file mode 100644
index 0000000..9896c5a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/RoyalForgeUpgrades.cs
@@ -0,0 +1,27 @@
+using UnityEngine;
+
+public class RoyalForgeUpgrades : MonoBehaviour
+{
+ public static RoyalForgeUpgrades instance;
+
+ public float meleeDamage = 1f;
+
+ public float rangedDamage = 1f;
+
+ public float meleeResistance = 1f;
+
+ public float rangedResistance = 1f;
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SaveLoadEntity.cs b/Thronefall_v1.57/Thronefall/Thronefall/SaveLoadEntity.cs
new file mode 100644
index 0000000..8d17dad
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SaveLoadEntity.cs
@@ -0,0 +1,63 @@
+using System;
+using UnityEngine;
+
+public class SaveLoadEntity : MonoBehaviour
+{
+ [SerializeField]
+ private string guid = "";
+
+ public string GUID => guid;
+
+ public void AssignNewGUID()
+ {
+ guid = Guid.NewGuid().ToString();
+ }
+
+ public void ExecuteBeforeMainLoadPass()
+ {
+ if (guid.Length == 0)
+ {
+ Debug.LogError("NO GUID ASSIGNED", base.gameObject);
+ }
+ else if (base.gameObject.activeInHierarchy)
+ {
+ BroadcastMessage("OnBeforeMainLoadPass", guid);
+ }
+ }
+
+ public void ExecuteLoad()
+ {
+ if (guid.Length == 0)
+ {
+ Debug.LogError("NO GUID ASSIGNED", base.gameObject);
+ }
+ else if (base.gameObject.activeInHierarchy)
+ {
+ BroadcastMessage("OnLoad", guid);
+ }
+ }
+
+ public void ExecuteAfterMainLoadPass()
+ {
+ if (guid.Length == 0)
+ {
+ Debug.LogError("NO GUID ASSIGNED", base.gameObject);
+ }
+ else if (base.gameObject.activeInHierarchy)
+ {
+ BroadcastMessage("OnAfterMainLoadPass", guid);
+ }
+ }
+
+ public void ExecuteSave()
+ {
+ if (guid.Length == 0)
+ {
+ Debug.LogError("NO GUID ASSIGNED", base.gameObject);
+ }
+ else if (base.gameObject.activeInHierarchy)
+ {
+ BroadcastMessage("OnSave", guid);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SaveLoadManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/SaveLoadManager.cs
new file mode 100644
index 0000000..15779a7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SaveLoadManager.cs
@@ -0,0 +1,238 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using UnityEngine;
+
+public class SaveLoadManager : MonoBehaviour
+{
+ public static SaveLoadManager instance;
+
+ [SerializeField]
+ private int saveFileVersionNr = 1;
+
+ [SerializeField]
+ private string saveFileName = "ThroneSave.sav";
+
+ private List<string> saveData = new List<string>();
+
+ private string[] loadData;
+
+ private LevelProgressManager levelProgressManager;
+
+ private PerkManager perkManager;
+
+ [SerializeField]
+ private List<Equippable> allEquippablesID = new List<Equippable>();
+
+ private int iln;
+
+ private string line;
+
+ private string FullSaveFilePath => Path.Combine(Application.persistentDataPath, saveFileName);
+
+ private void Awake()
+ {
+ if ((bool)instance)
+ {
+ UnityEngine.Object.Destroy(base.gameObject);
+ return;
+ }
+ UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
+ instance = this;
+ }
+
+ private void Start()
+ {
+ LoadGame();
+ }
+
+ public void SaveGame()
+ {
+ if (!DebugController.SaveTheGame)
+ {
+ DebugLogInEditorOnly("Saving is not enabled!");
+ return;
+ }
+ saveData.Clear();
+ levelProgressManager = LevelProgressManager.instance;
+ perkManager = PerkManager.instance;
+ SaveSingle("Save File Version", saveFileVersionNr.ToString());
+ SaveSingle("Perk Level", perkManager.level.ToString());
+ SaveSingle("Perk XP", perkManager.xp.ToString());
+ SaveSingle("Eternal Trials Score", levelProgressManager.EternalTrialsHighscore.ToString());
+ foreach (KeyValuePair<string, LevelData> sceneNameToLevelDatum in levelProgressManager.SceneNameToLevelData)
+ {
+ string key = sceneNameToLevelDatum.Key;
+ LevelData value = sceneNameToLevelDatum.Value;
+ if (value.highscoreBest <= 0 && !value.beatenBest)
+ {
+ continue;
+ }
+ SaveSingle("Level", key);
+ SaveSingle("QuestsCompleteWhenLastOnMap", value.questsCompleteWhenLastVisitingMap.ToString());
+ SaveSingle("Beaten", value.beatenBest ? "1" : "0");
+ if (value.beatenBest)
+ {
+ AchievementManager.LevelBeaten(key);
+ }
+ SaveSingle("HighscoreV2", value.highscoreBest.ToString());
+ SaveList("NetworthV2 / Day", value.dayToDayNetworthBest);
+ SaveList("ScoreV2 / Day", value.dayToDayScoreBest);
+ foreach (List<Equippable> item in value.levelHasBeenBeatenWith)
+ {
+ List<string> list = new List<string>();
+ foreach (Equippable item2 in item)
+ {
+ if (!(item2 == null))
+ {
+ list.Add(item2.name);
+ }
+ }
+ SaveList("Beaten With", list);
+ }
+ }
+ File.WriteAllLines(FullSaveFilePath, saveData);
+ DebugLogInEditorOnly("Game Saved to " + FullSaveFilePath);
+ }
+
+ public void SaveSingle(string _key, string _data)
+ {
+ saveData.Add(_key);
+ saveData.Add(_data);
+ saveData.Add("");
+ }
+
+ public void SaveList<Type>(string _key, List<Type> _data)
+ {
+ saveData.Add(_key);
+ saveData.Add(_data.Count.ToString());
+ for (int i = 0; i < _data.Count; i++)
+ {
+ saveData.Add(_data[i].ToString());
+ }
+ saveData.Add("");
+ }
+
+ private void LoadGame()
+ {
+ levelProgressManager = LevelProgressManager.instance;
+ perkManager = PerkManager.instance;
+ if (DebugController.SaveLoadModeToUse == DebugController.SaveLoadMode.LoadEmptySaveFileOnStartup)
+ {
+ loadData = DebugController.instance.emptySaveFile.text.Split(new string[3] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
+ DebugLogInEditorOnly("Loading is not enabled!");
+ }
+ else if (DebugController.SaveLoadModeToUse == DebugController.SaveLoadMode.LoadMaxedOutSaveFileOnStartup)
+ {
+ loadData = DebugController.instance.maxedSaveFile.text.Split(new string[3] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
+ DebugLogInEditorOnly("Loading maxed out save file with everything unlocked!");
+ }
+ else
+ {
+ if (!File.Exists(FullSaveFilePath))
+ {
+ DebugLogInEditorOnly("No save file was found at " + FullSaveFilePath + " so the load process was canceled.");
+ return;
+ }
+ loadData = File.ReadAllLines(FullSaveFilePath);
+ }
+ LevelData levelData = null;
+ levelProgressManager.SceneNameToLevelData.Clear();
+ for (iln = 0; iln < loadData.Length; iln++)
+ {
+ line = loadData[iln];
+ switch (line)
+ {
+ case "Perk Level":
+ perkManager.level = int.Parse(ReadNextLn());
+ break;
+ case "Perk XP":
+ perkManager.xp = int.Parse(ReadNextLn());
+ break;
+ case "Level":
+ levelData = levelProgressManager.GetLevelDataForScene(ReadNextLn());
+ break;
+ case "Eternal Trials Score":
+ levelProgressManager.EternalTrialsHighscore = int.Parse(ReadNextLn());
+ break;
+ case "QuestsCompleteWhenLastOnMap":
+ if (levelData != null)
+ {
+ levelData.questsCompleteWhenLastVisitingMap = int.Parse(ReadNextLn());
+ }
+ break;
+ case "Beaten":
+ if (levelData != null)
+ {
+ levelData.beatenBest = ReadNextLn() == "1";
+ }
+ break;
+ case "HighscoreV2":
+ if (levelData != null)
+ {
+ levelData.highscoreBest = int.Parse(ReadNextLn());
+ }
+ break;
+ case "NetworthV2 / Day":
+ if (levelData != null)
+ {
+ int num = int.Parse(ReadNextLn());
+ levelData.dayToDayNetworthBest.Clear();
+ for (int l = 0; l < num; l++)
+ {
+ levelData.dayToDayNetworthBest.Add(int.Parse(ReadNextLn()));
+ }
+ }
+ break;
+ case "ScoreV2 / Day":
+ if (levelData != null)
+ {
+ int num = int.Parse(ReadNextLn());
+ levelData.dayToDayScoreBest.Clear();
+ for (int k = 0; k < num; k++)
+ {
+ levelData.dayToDayScoreBest.Add(int.Parse(ReadNextLn()));
+ }
+ }
+ break;
+ case "Beaten With":
+ {
+ if (levelData == null)
+ {
+ break;
+ }
+ int num = int.Parse(ReadNextLn());
+ List<Equippable> list = new List<Equippable>();
+ for (int i = 0; i < num; i++)
+ {
+ string text = ReadNextLn();
+ Equippable item = null;
+ for (int j = 0; j < allEquippablesID.Count; j++)
+ {
+ if (allEquippablesID[j].name == text)
+ {
+ item = allEquippablesID[j];
+ }
+ }
+ list.Add(item);
+ }
+ levelData.levelHasBeenBeatenWith.Add(list);
+ break;
+ }
+ }
+ }
+ perkManager.CallAfterLoadToUnlockPerksAndStuff();
+ DebugLogInEditorOnly("Loaded Game from " + FullSaveFilePath);
+ }
+
+ private string ReadNextLn()
+ {
+ iln++;
+ line = loadData[iln];
+ return line;
+ }
+
+ private void DebugLogInEditorOnly(string _log)
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ScaleAnimation.cs b/Thronefall_v1.57/Thronefall/Thronefall/ScaleAnimation.cs
new file mode 100644
index 0000000..4cd8dd7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ScaleAnimation.cs
@@ -0,0 +1,42 @@
+using System.Collections;
+using UnityEngine;
+
+public class ScaleAnimation : OneShotAnimationBase
+{
+ public AnimationCurve curve;
+
+ public float duration = 0.75f;
+
+ public float targetScale;
+
+ public Transform transformToAnimate;
+
+ private float initialScale = 1f;
+
+ private void Start()
+ {
+ initialScale = transformToAnimate.localScale.x;
+ }
+
+ private IEnumerator Animate()
+ {
+ transformToAnimate.localScale = Vector3.one * initialScale;
+ float timer = 0f;
+ while (timer < duration)
+ {
+ transformToAnimate.localScale = Vector3.one * Mathf.Lerp(initialScale, targetScale, curve.Evaluate(timer / duration));
+ timer += Time.deltaTime;
+ yield return null;
+ }
+ transformToAnimate.localScale = Vector3.one * Mathf.Lerp(initialScale, targetScale, curve.Evaluate(timer / duration));
+ }
+
+ public override void Trigger()
+ {
+ if (base.gameObject.activeInHierarchy)
+ {
+ StopAllCoroutines();
+ StartCoroutine(Animate());
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ScalePulse.cs b/Thronefall_v1.57/Thronefall/Thronefall/ScalePulse.cs
new file mode 100644
index 0000000..16d6934
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ScalePulse.cs
@@ -0,0 +1,18 @@
+using UnityEngine;
+
+public class ScalePulse : MonoBehaviour
+{
+ public AnimationCurve scaleCurve;
+
+ public float scaleIncrease = 0.4f;
+
+ public float pulseSpeed = 1f;
+
+ private float clock;
+
+ private void Update()
+ {
+ clock += Time.deltaTime * pulseSpeed;
+ base.transform.localScale = Vector3.one * (1f + scaleIncrease * scaleCurve.Evaluate(clock));
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SceneNameToLevelData.cs b/Thronefall_v1.57/Thronefall/Thronefall/SceneNameToLevelData.cs
new file mode 100644
index 0000000..7b8f84f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SceneNameToLevelData.cs
@@ -0,0 +1,6 @@
+using System;
+
+[Serializable]
+public class SceneNameToLevelData : UnitySerializedDictionary<string, LevelData>
+{
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SceneTransitionManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/SceneTransitionManager.cs
new file mode 100644
index 0000000..3ddb6a7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SceneTransitionManager.cs
@@ -0,0 +1,276 @@
+using System.Collections;
+using System.Collections.Generic;
+using TMPro;
+using UnityEngine;
+using UnityEngine.Events;
+using UnityEngine.SceneManagement;
+using UnityEngine.UI;
+
+public class SceneTransitionManager : MonoBehaviour
+{
+ public enum SceneState
+ {
+ MainMenu,
+ LevelSelect,
+ InGame
+ }
+
+ public static SceneTransitionManager instance;
+
+ public string uiScene = "_UI";
+
+ public string mainMenuScene = "_StartMenu";
+
+ public string levelSelectScene;
+
+ public Image placeholderCloudsTransition;
+
+ public TMP_Text loadingText;
+
+ public float cloudFadeInTime = 1f;
+
+ public float cloudFadeOutTime = 2f;
+
+ [HideInInspector]
+ public UnityEvent onSceneChange = new UnityEvent();
+
+ private SceneState currentSceneState;
+
+ private SceneState lastSceneState;
+
+ private int ingameScoreFromLastMatch;
+
+ private int goldBonusScoreFromLastMatch;
+
+ private int mutatorBonusScoreFromLastMatch;
+
+ private int noRetryBonusScoreFromLastMatch;
+
+ private string comingFromGameplayScene = "";
+
+ private int totalScoreFromLastMatch;
+
+ private bool totalScoreFromLastMatchIsNewPersonalRecord;
+
+ private LevelData levelDataFromLastMatch;
+
+ private bool sceneTransitionIsRunning;
+
+ private Color cloudsIn;
+
+ private Color cloudsOut;
+
+ private Coroutine currentTransition;
+
+ public SceneState CurrentSceneState => currentSceneState;
+
+ public SceneState LastSceneState => lastSceneState;
+
+ public int IngameScoreFromLastMatch => ingameScoreFromLastMatch;
+
+ public int GoldBonusScoreFromLastMatch => goldBonusScoreFromLastMatch;
+
+ public int MutatorBonusScoreFromLastMatch => mutatorBonusScoreFromLastMatch;
+
+ public int NoRetryBonusScoreFromLastMatch => noRetryBonusScoreFromLastMatch;
+
+ public int TotalScoreFromLastMatch => totalScoreFromLastMatch;
+
+ public bool TotalScoreFromLastMatchIsNewPersonalRecord => totalScoreFromLastMatchIsNewPersonalRecord;
+
+ public string ComingFromGameplayScene => comingFromGameplayScene;
+
+ public LevelData LevelDataFromLastMatch => levelDataFromLastMatch;
+
+ public bool SceneTransitionIsRunning => sceneTransitionIsRunning;
+
+ private void Awake()
+ {
+ if ((bool)instance)
+ {
+ Object.Destroy(base.gameObject);
+ return;
+ }
+ instance = this;
+ Object.DontDestroyOnLoad(base.transform.root.gameObject);
+ if (!SceneManager.GetSceneByName(uiScene).IsValid())
+ {
+ SceneManager.LoadScene(uiScene, LoadSceneMode.Additive);
+ }
+ cloudsIn = placeholderCloudsTransition.color;
+ cloudsOut = cloudsIn;
+ cloudsOut.a = 0f;
+ loadingText.alpha = 0f;
+ }
+
+ private void Start()
+ {
+ }
+
+ public void TransitionFromLevelSelectToLevel(string _levelname)
+ {
+ if (currentSceneState != SceneState.LevelSelect)
+ {
+ Debug.LogWarning("You should only transition to a specific level from the level selection scene.");
+ }
+ else
+ {
+ TransitionToScene(_levelname);
+ }
+ }
+
+ public void TransitionFromNullToLevel(string _levelname)
+ {
+ TransitionToScene(_levelname);
+ }
+
+ public void RestartCurrentLevel()
+ {
+ TransitionToScene(SceneManager.GetActiveScene().name);
+ }
+
+ private void SetComingFromSceneToCurrentScene()
+ {
+ comingFromGameplayScene = SceneManager.GetActiveScene().name;
+ if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.EternalTrial)
+ {
+ comingFromGameplayScene = "Eternal Trials";
+ }
+ }
+
+ public void TransitionFromGameplayToEndScreen(int _score, int _goldBonusScore, int _mutatorBonusScore, int _noRetriesBonusScore)
+ {
+ SetComingFromSceneToCurrentScene();
+ LevelData levelData = (levelDataFromLastMatch = LevelProgressManager.instance.GetLevelDataForScene(comingFromGameplayScene));
+ if (currentSceneState != SceneState.InGame)
+ {
+ Debug.LogWarning("You should only transition to the end screen from a gameply level.");
+ return;
+ }
+ ingameScoreFromLastMatch = _score;
+ goldBonusScoreFromLastMatch = _goldBonusScore;
+ mutatorBonusScoreFromLastMatch = _mutatorBonusScore;
+ noRetryBonusScoreFromLastMatch = _noRetriesBonusScore;
+ if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.Classic)
+ {
+ levelData.highscore = _score + _goldBonusScore + _mutatorBonusScore + _noRetriesBonusScore;
+ totalScoreFromLastMatch = levelData.highscore;
+ totalScoreFromLastMatchIsNewPersonalRecord = totalScoreFromLastMatch > levelData.highscoreBest;
+ }
+ else if (LocalGamestate.SelectedGameMode == LocalGamestate.GameMode.EternalTrial)
+ {
+ totalScoreFromLastMatch = _score + _goldBonusScore;
+ EternalTrialsRunManager.AddScore(totalScoreFromLastMatch);
+ }
+ UIFrameManager.TriggerEndOfMatch();
+ }
+
+ public void TransitionFromEndScreenToLevelSelect()
+ {
+ TransitionToScene(levelSelectScene);
+ }
+
+ private void TransitionToScene(string _scenename)
+ {
+ if (!sceneTransitionIsRunning)
+ {
+ lastSceneState = currentSceneState;
+ if (_scenename == levelSelectScene)
+ {
+ currentSceneState = SceneState.LevelSelect;
+ }
+ else if (_scenename == mainMenuScene)
+ {
+ currentSceneState = SceneState.MainMenu;
+ }
+ else
+ {
+ currentSceneState = SceneState.InGame;
+ }
+ onSceneChange.Invoke();
+ StartCoroutine(SceneTransitionAnimation(_scenename));
+ }
+ }
+
+ private float FadeFormula(float f)
+ {
+ return Mathf.Pow(f, 4f);
+ }
+
+ private IEnumerator SceneTransitionAnimation(string _scenename)
+ {
+ sceneTransitionIsRunning = true;
+ int sceneCount = SceneManager.sceneCount;
+ placeholderCloudsTransition.gameObject.SetActive(value: true);
+ float clock2 = 0f;
+ while (clock2 <= cloudFadeInTime)
+ {
+ float num = Mathf.Clamp(Time.unscaledDeltaTime, 0f, 0.1f);
+ clock2 += num;
+ placeholderCloudsTransition.color = Color.Lerp(cloudsOut, cloudsIn, 1f - FadeFormula(1f - clock2 / cloudFadeInTime));
+ loadingText.alpha = 1f - FadeFormula(1f - clock2 / cloudFadeInTime);
+ yield return null;
+ }
+ placeholderCloudsTransition.color = cloudsIn;
+ loadingText.alpha = 1f;
+ List<AsyncOperation> loadOperations = new List<AsyncOperation>();
+ if (sceneCount > 0)
+ {
+ for (int num2 = sceneCount - 1; num2 >= 0; num2--)
+ {
+ Scene sceneAt = SceneManager.GetSceneAt(num2);
+ if (sceneAt.name != uiScene)
+ {
+ loadOperations.Add(SceneManager.UnloadSceneAsync(sceneAt));
+ }
+ }
+ }
+ loadOperations.Add(SceneManager.LoadSceneAsync(_scenename, LoadSceneMode.Additive));
+ while (loadOperations.Count > 0)
+ {
+ for (int num3 = loadOperations.Count - 1; num3 >= 0; num3--)
+ {
+ if (loadOperations[num3].isDone)
+ {
+ loadOperations.RemoveAt(num3);
+ }
+ }
+ yield return null;
+ }
+ SceneManager.SetActiveScene(SceneManager.GetSceneByName(_scenename));
+ UIFrameManager.instance.CloseAllFrames();
+ if (_scenename == mainMenuScene)
+ {
+ UIFrameManager.instance.SwitchToTitleFrame();
+ }
+ clock2 = 0f;
+ while (clock2 <= cloudFadeOutTime)
+ {
+ float num4 = Mathf.Clamp(Time.unscaledDeltaTime, 0f, 0.1f);
+ clock2 += num4;
+ placeholderCloudsTransition.color = Color.Lerp(cloudsIn, cloudsOut, FadeFormula(clock2 / cloudFadeOutTime));
+ loadingText.alpha = 1f - FadeFormula(1f - clock2 / cloudFadeInTime);
+ yield return null;
+ }
+ placeholderCloudsTransition.color = cloudsOut;
+ loadingText.alpha = 0f;
+ placeholderCloudsTransition.gameObject.SetActive(value: false);
+ sceneTransitionIsRunning = false;
+ }
+
+ public void TransitionFromNullToLevelSelect()
+ {
+ TransitionToScene(levelSelectScene);
+ }
+
+ public void TransitionFromLevelToLevelSelect()
+ {
+ SetComingFromSceneToCurrentScene();
+ TransitionToScene(levelSelectScene);
+ }
+
+ public void TransitionToMainMenu()
+ {
+ TransitionToScene(mainMenuScene);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ScoreManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/ScoreManager.cs
new file mode 100644
index 0000000..f51625d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ScoreManager.cs
@@ -0,0 +1,209 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Events;
+
+public class ScoreManager : MonoBehaviour, DayNightCycle.IDaytimeSensitive, ISaveLoad
+{
+ private static ScoreManager instance;
+
+ private EnemySpawner enemySpawner;
+
+ [Min(0f)]
+ public int baseScorePerNight = 100;
+
+ [Min(0f)]
+ public int protectionScorePerNight = 200;
+
+ [Min(0f)]
+ public int timeScorePerNight = 200;
+
+ [Min(0f)]
+ public float timebonusMultiplier = 1f;
+
+ [Min(0f)]
+ public float timeBonusMinTime = 10f;
+
+ [Min(0f)]
+ public float timeBonusMaxTime = 120f;
+
+ [Min(0f)]
+ public float protectionScoreMultiplier = 1f;
+
+ [Range(1f, 2f)]
+ public float scoreExponent = 2f;
+
+ public float noRetryScoreMultiplier = 1.1f;
+
+ public float noRetryScoreMultiplierInMiniModes = 1.01f;
+
+ private int currentScore;
+
+ private List<TagManager.ETag> buildingTags = new List<TagManager.ETag>(new TagManager.ETag[2]
+ {
+ TagManager.ETag.Building,
+ TagManager.ETag.PlayerOwned
+ });
+
+ [HideInInspector]
+ public UnityEvent<int, int, float, int> OnNightScoreAdd = new UnityEvent<int, int, float, int>();
+
+ private bool tauntTheTiger;
+
+ private bool tauntTheTurtle;
+
+ private bool tauntTheFalcon;
+
+ private bool tauntTheRat;
+
+ private float scoreMultiplyerFromPerks;
+
+ public float victoryGoldBonusMultiplyer = 10f;
+
+ public static ScoreManager Instance => instance;
+
+ public int CurrentScore => currentScore;
+
+ public int VictoryGoldBonus => Mathf.CeilToInt((float)PlayerInteraction.instance.TrueBalance * victoryGoldBonusMultiplyer);
+
+ public int VictoryMutatorBonus
+ {
+ get
+ {
+ float num = 1f;
+ foreach (Equippable item in PerkManager.instance.CurrentlyEquipped)
+ {
+ if (item.GetType() == typeof(EquippableMutation))
+ {
+ num *= ((EquippableMutation)item).scoreMultiplyerOnWin;
+ }
+ }
+ return Mathf.CeilToInt((float)(currentScore + VictoryGoldBonus) * (num - 1f));
+ }
+ }
+
+ public int DefeatNoRetryBonus
+ {
+ get
+ {
+ if (MatchSaveLoadHandler.CurrentSave != null && MatchSaveLoadHandler.CurrentSave.hadRestarts)
+ {
+ return 0;
+ }
+ if (LevelProgressManager.instance.GetLevelInfoFromCurrentSceneName().contribution == LevelInfo.ProgressionContribution.Stars)
+ {
+ return Mathf.CeilToInt((float)currentScore * (noRetryScoreMultiplierInMiniModes - 1f));
+ }
+ return Mathf.CeilToInt((float)currentScore * (noRetryScoreMultiplier - 1f));
+ }
+ }
+
+ public int VictoryNoRetryBonus
+ {
+ get
+ {
+ if (MatchSaveLoadHandler.CurrentSave != null && MatchSaveLoadHandler.CurrentSave.hadRestarts)
+ {
+ return 0;
+ }
+ if (LevelProgressManager.instance.GetLevelInfoFromCurrentSceneName().contribution == LevelInfo.ProgressionContribution.Stars)
+ {
+ return Mathf.CeilToInt((float)(currentScore + VictoryGoldBonus + VictoryMutatorBonus) * (noRetryScoreMultiplierInMiniModes - 1f));
+ }
+ return Mathf.CeilToInt((float)(currentScore + VictoryGoldBonus + VictoryMutatorBonus) * (noRetryScoreMultiplier - 1f));
+ }
+ }
+
+ public int MaxScorePerNight => Mathf.RoundToInt((float)(baseScorePerNight + protectionScorePerNight + timeScorePerNight) * scoreMultiplyerFromPerks);
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ MatchSaveLoadHandler.TryLoadValue(guid, "currentScore", ref currentScore);
+ if (!EnemySpawner.instance || EnemySpawner.instance.WaveCount >= 2)
+ {
+ MatchSaveLoadHandler.CurrentSave.hadRestarts = true;
+ }
+ }
+
+ public void OnSave(string guid)
+ {
+ MatchSaveLoadHandler.SaveValue(guid, "currentScore", currentScore);
+ }
+
+ private void Awake()
+ {
+ if (instance != null)
+ {
+ Debug.LogWarning("More than one Scoremanger in Scene. Old Scoremanager destroyed.");
+ Object.Destroy(instance);
+ }
+ instance = this;
+ }
+
+ private void Start()
+ {
+ enemySpawner = EnemySpawner.instance;
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ scoreMultiplyerFromPerks = 1f;
+ }
+
+ public void CalculateEndOfNightScore()
+ {
+ int num = Mathf.RoundToInt((float)baseScorePerNight * scoreMultiplyerFromPerks);
+ int num2 = num;
+ float currentNightLength = DayNightCycle.Instance.CurrentNightLength;
+ float lastSpawnPeriodDuration = enemySpawner.LastSpawnPeriodDuration;
+ int num3 = Mathf.RoundToInt(Mathf.Pow(Mathf.InverseLerp(timeBonusMaxTime + lastSpawnPeriodDuration, timeBonusMinTime + lastSpawnPeriodDuration, currentNightLength), scoreExponent) * (float)timeScorePerNight * scoreMultiplyerFromPerks);
+ num2 += num3;
+ List<TaggedObject> list = new List<TaggedObject>();
+ TagManager.instance.FindAllTaggedObjectsWithTags(list, buildingTags, null);
+ int num4 = 0;
+ foreach (TaggedObject item in list)
+ {
+ BuildingInteractor componentInChildren = item.transform.parent.GetComponentInChildren<BuildingInteractor>(includeInactive: true);
+ if ((bool)componentInChildren && componentInChildren.KnockedOutTonight)
+ {
+ num4++;
+ }
+ }
+ float num5 = 1f - Mathf.InverseLerp(0f, list.Count, num4);
+ float arg = num5;
+ num5 = Mathf.Pow(num5, scoreExponent);
+ int num6 = Mathf.RoundToInt((float)protectionScorePerNight * num5 * scoreMultiplyerFromPerks);
+ num2 += num6;
+ currentScore += num2;
+ OnNightScoreAdd.Invoke(num, num3, arg, num6);
+ LevelData levelDataForActiveScene = LevelProgressManager.instance.GetLevelDataForActiveScene();
+ levelDataForActiveScene.highscore = currentScore;
+ levelDataForActiveScene.dayToDayScore.Add(currentScore);
+ }
+
+ public void OnDusk()
+ {
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ CalculateEndOfNightScore();
+ }
+
+ public void AddDebugPoints(int amount)
+ {
+ currentScore += amount;
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ScoreTag.cs b/Thronefall_v1.57/Thronefall/Thronefall/ScoreTag.cs
new file mode 100644
index 0000000..1d78442
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ScoreTag.cs
@@ -0,0 +1,21 @@
+using TMPro;
+using UnityEngine;
+
+public class ScoreTag : MonoBehaviour
+{
+ public GameObject highlight;
+
+ public TMP_Text rank;
+
+ public TMP_Text username;
+
+ public TMP_Text score;
+
+ public void SetNameAndScore(string _name, int _score, int _rank, bool isPlayer)
+ {
+ highlight.SetActive(isPlayer);
+ rank.text = _rank + ".";
+ username.text = _name;
+ score.text = _score.ToString();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ScreenMarker.cs b/Thronefall_v1.57/Thronefall/Thronefall/ScreenMarker.cs
new file mode 100644
index 0000000..f43cfc2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ScreenMarker.cs
@@ -0,0 +1,212 @@
+using MPUIKIT;
+using TMPro;
+using UnityEngine;
+
+public class ScreenMarker : MonoBehaviour
+{
+ [Header("Content")]
+ [SerializeField]
+ private Sprite showSprite;
+
+ [SerializeField]
+ private int showNumber;
+
+ [SerializeField]
+ private bool showElite;
+
+ [Header("Setup")]
+ [SerializeField]
+ private GameObject screenMarkerPrefab;
+
+ private GameObject myUiMarkerGameObject;
+
+ private EnemyScreenMarkerUIHelper uiMarkerData;
+
+ private RectTransform screenMarkerUI;
+
+ private Camera cam;
+
+ private MPImageBasic enemyIcon;
+
+ private TMP_Text enemyNumber;
+
+ private float myRandomVal;
+
+ private Vector2 unclampedScreenPos;
+
+ private Vector2 clampedScreenPos;
+
+ public bool rotateTowardsTargetWhenOffscreen;
+
+ public bool showWhenOnScreen = true;
+
+ public bool showWhenOffScreen = true;
+
+ public Rect checkOnScreenRect;
+
+ private bool onScreen;
+
+ public float MyRandomVal => myRandomVal;
+
+ public Vector2 UnclampedScreenPos
+ {
+ get
+ {
+ return unclampedScreenPos;
+ }
+ set
+ {
+ unclampedScreenPos = value;
+ }
+ }
+
+ public Vector2 ClampedScreenPos
+ {
+ get
+ {
+ return clampedScreenPos;
+ }
+ set
+ {
+ clampedScreenPos = value;
+ }
+ }
+
+ public bool OnScreen
+ {
+ get
+ {
+ return onScreen;
+ }
+ set
+ {
+ onScreen = value;
+ }
+ }
+
+ public Sprite Sprite => showSprite;
+
+ public bool Elite => showElite;
+
+ public int Number => showNumber;
+
+ public Vector2 Position
+ {
+ get
+ {
+ return screenMarkerUI.localPosition;
+ }
+ set
+ {
+ screenMarkerUI.localPosition = value;
+ }
+ }
+
+ public float ImageRotation
+ {
+ get
+ {
+ return enemyIcon.transform.rotation.z;
+ }
+ set
+ {
+ enemyIcon.transform.rotation = Quaternion.Euler(enemyIcon.transform.rotation.x, enemyIcon.transform.rotation.y, value);
+ }
+ }
+
+ public Rect Rect => screenMarkerUI.rect;
+
+ private void Start()
+ {
+ cam = Camera.main;
+ myUiMarkerGameObject = Object.Instantiate(screenMarkerPrefab, UIFrameManager.instance.OnScreenMarkerContainer);
+ uiMarkerData = myUiMarkerGameObject.GetComponent<EnemyScreenMarkerUIHelper>();
+ enemyIcon = uiMarkerData.enemyIcon;
+ enemyNumber = uiMarkerData.enemyNumber;
+ screenMarkerUI = (RectTransform)myUiMarkerGameObject.transform;
+ SetSprite(showSprite);
+ SetNumber(showNumber);
+ SetElite(showElite);
+ ScreenMarkerManager.instance.RegisterScreenMarker(this);
+ myRandomVal = Random.value;
+ SceneTransitionManager.instance.onSceneChange.AddListener(KillOnSceneChange);
+ }
+
+ public void SetSprite(Sprite _sprite)
+ {
+ if (!(_sprite == null))
+ {
+ showSprite = _sprite;
+ if ((bool)enemyIcon)
+ {
+ enemyIcon.sprite = _sprite;
+ }
+ }
+ }
+
+ public void Show(bool _show)
+ {
+ if (myUiMarkerGameObject.activeSelf != _show)
+ {
+ myUiMarkerGameObject.SetActive(_show);
+ }
+ }
+
+ public void SetElite(bool _elite)
+ {
+ showElite = _elite;
+ if ((bool)uiMarkerData)
+ {
+ uiMarkerData.SetElite(_elite);
+ }
+ }
+
+ public void SetNumber(int _number)
+ {
+ showNumber = _number;
+ if ((bool)enemyNumber)
+ {
+ enemyNumber.text = showNumber.ToString();
+ enemyNumber.enabled = showNumber > 0;
+ }
+ }
+
+ private void OnEnable()
+ {
+ if ((bool)myUiMarkerGameObject)
+ {
+ myUiMarkerGameObject.SetActive(value: true);
+ }
+ if ((bool)ScreenMarkerManager.instance)
+ {
+ ScreenMarkerManager.instance.RegisterScreenMarker(this);
+ }
+ }
+
+ private void OnDisable()
+ {
+ if ((bool)myUiMarkerGameObject)
+ {
+ myUiMarkerGameObject.SetActive(value: false);
+ }
+ if ((bool)ScreenMarkerManager.instance)
+ {
+ ScreenMarkerManager.instance.UnregisterScreenMarker(this);
+ }
+ }
+
+ private void OnDestroy()
+ {
+ if ((bool)myUiMarkerGameObject)
+ {
+ Object.Destroy(myUiMarkerGameObject);
+ }
+ ScreenMarkerManager.instance.UnregisterScreenMarker(this);
+ }
+
+ private void KillOnSceneChange()
+ {
+ Object.Destroy(myUiMarkerGameObject);
+ Object.Destroy(base.gameObject);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ScreenMarkerCanvasHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/ScreenMarkerCanvasHelper.cs
new file mode 100644
index 0000000..5f047c7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ScreenMarkerCanvasHelper.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class ScreenMarkerCanvasHelper : MonoBehaviour
+{
+ public static ScreenMarkerCanvasHelper instance;
+
+ [SerializeField]
+ private RectTransform ownRT;
+
+ public float Height => ownRT.sizeDelta.y;
+
+ private void Awake()
+ {
+ if (instance == null)
+ {
+ instance = this;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ScreenMarkerIcon.cs b/Thronefall_v1.57/Thronefall/Thronefall/ScreenMarkerIcon.cs
new file mode 100644
index 0000000..f126cfe
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ScreenMarkerIcon.cs
@@ -0,0 +1,12 @@
+using UnityEngine;
+
+public class ScreenMarkerIcon : MonoBehaviour
+{
+ public Sprite sprite;
+
+ public string locaKey;
+
+ public string UnitDescription => TextTranslator.Translate(locaKey);
+
+ public string UnitName => TextTranslator.Translate(locaKey + " Name");
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ScreenMarkerManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/ScreenMarkerManager.cs
new file mode 100644
index 0000000..155aae9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ScreenMarkerManager.cs
@@ -0,0 +1,284 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class ScreenMarkerManager : MonoBehaviour
+{
+ public enum MarkerMode
+ {
+ Direction,
+ ClampedPos
+ }
+
+ private class ComparePositionX : IComparer<ScreenMarker>
+ {
+ public int Compare(ScreenMarker a, ScreenMarker b)
+ {
+ if (!object.Equals(a.UnclampedScreenPos.x, b.UnclampedScreenPos.x))
+ {
+ return Comparer<float>.Default.Compare(a.UnclampedScreenPos.x, b.UnclampedScreenPos.x);
+ }
+ return Comparer<float>.Default.Compare(a.MyRandomVal - (float)a.Number, b.MyRandomVal - (float)b.Number);
+ }
+ }
+
+ private class ComparePositionY : IComparer<ScreenMarker>
+ {
+ public int Compare(ScreenMarker a, ScreenMarker b)
+ {
+ if (!object.Equals(a.UnclampedScreenPos.y, b.UnclampedScreenPos.y))
+ {
+ return Comparer<float>.Default.Compare(a.UnclampedScreenPos.y, b.UnclampedScreenPos.y);
+ }
+ return Comparer<float>.Default.Compare(a.MyRandomVal - (float)a.Number, b.MyRandomVal - (float)b.Number);
+ }
+ }
+
+ public static ScreenMarkerManager instance;
+
+ private List<ScreenMarker> screenMarkersActive = new List<ScreenMarker>();
+
+ private List<ScreenMarker> screenMarkersToShow = new List<ScreenMarker>();
+
+ private Dictionary<ScreenMarker, int> screenMarkerInGroup = new Dictionary<ScreenMarker, int>();
+
+ private List<List<ScreenMarker>> screenMarkerGroups = new List<List<ScreenMarker>>();
+
+ private Camera cam;
+
+ private float ratio;
+
+ private float clampY;
+
+ private float clampX;
+
+ private int frame;
+
+ [SerializeField]
+ private MarkerMode markerMode;
+
+ private float FIXED_CANVAS_HEIGHT => ScreenMarkerCanvasHelper.instance.Height;
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ private void Start()
+ {
+ cam = Camera.main;
+ UpdateCam();
+ }
+
+ private void UpdateCam()
+ {
+ ratio = cam.pixelRect.width / cam.pixelRect.height;
+ clampY = FIXED_CANVAS_HEIGHT / 2f;
+ clampX = FIXED_CANVAS_HEIGHT / 2f * ratio;
+ }
+
+ public void RegisterScreenMarker(ScreenMarker _sm)
+ {
+ if (!screenMarkersActive.Contains(_sm))
+ {
+ screenMarkersActive.Add(_sm);
+ }
+ }
+
+ public void UnregisterScreenMarker(ScreenMarker _sm)
+ {
+ if (screenMarkersActive.Contains(_sm))
+ {
+ screenMarkersActive.Remove(_sm);
+ }
+ }
+
+ private void Update()
+ {
+ frame++;
+ if (frame < 2)
+ {
+ return;
+ }
+ UpdateCam();
+ screenMarkersToShow.Clear();
+ for (int num = screenMarkersActive.Count - 1; num >= 0; num--)
+ {
+ UpdateMarkerPosition(screenMarkersActive[num]);
+ }
+ for (int i = 0; i < screenMarkerGroups.Count; i++)
+ {
+ screenMarkerGroups[i].Clear();
+ }
+ screenMarkerInGroup.Clear();
+ while (screenMarkerGroups.Count < screenMarkersToShow.Count)
+ {
+ screenMarkerGroups.Add(new List<ScreenMarker>());
+ }
+ for (int j = 0; j < screenMarkersToShow.Count; j++)
+ {
+ screenMarkerGroups[j].Add(screenMarkersToShow[j]);
+ screenMarkerInGroup.Add(screenMarkersToShow[j], j);
+ }
+ bool flag = true;
+ int num2 = 30;
+ while (flag && num2 > 0)
+ {
+ num2--;
+ bool flag2 = false;
+ for (int k = 0; k < screenMarkersToShow.Count; k++)
+ {
+ ScreenMarker screenMarker = screenMarkersToShow[k];
+ for (int l = k + 1; l < screenMarkersToShow.Count; l++)
+ {
+ ScreenMarker screenMarker2 = screenMarkersToShow[l];
+ if (!CheckOverlap(screenMarker, screenMarker2))
+ {
+ continue;
+ }
+ int num3 = screenMarkerInGroup[screenMarker];
+ int num4 = screenMarkerInGroup[screenMarker2];
+ if (num3 != num4)
+ {
+ flag2 = true;
+ for (int m = 0; m < screenMarkerGroups[num4].Count; m++)
+ {
+ ScreenMarker screenMarker3 = screenMarkerGroups[num4][m];
+ screenMarkerGroups[num4].Remove(screenMarker3);
+ screenMarkerGroups[num3].Add(screenMarker3);
+ screenMarkerInGroup[screenMarker3] = num3;
+ }
+ }
+ }
+ }
+ flag = flag2;
+ if (flag2)
+ {
+ for (int n = 0; n < screenMarkerGroups.Count; n++)
+ {
+ FormatGroup(screenMarkerGroups[n]);
+ }
+ }
+ }
+ for (int num5 = 0; num5 < screenMarkersToShow.Count; num5++)
+ {
+ ScreenMarker screenMarker4 = screenMarkersToShow[num5];
+ if (screenMarker4.rotateTowardsTargetWhenOffscreen)
+ {
+ if (screenMarker4.OnScreen)
+ {
+ screenMarker4.ImageRotation = 0f;
+ }
+ else
+ {
+ screenMarker4.ImageRotation = Vector2.SignedAngle(Vector2.down, screenMarker4.UnclampedScreenPos - screenMarker4.Position);
+ }
+ }
+ }
+ }
+
+ private bool CheckOverlap(ScreenMarker _sm1, ScreenMarker _sm2)
+ {
+ if (_sm1.Rect != _sm2.Rect)
+ {
+ return false;
+ }
+ if (_sm1.UnclampedScreenPos == _sm2.UnclampedScreenPos)
+ {
+ return true;
+ }
+ Rect rect = _sm1.Rect;
+ Rect rect2 = _sm2.Rect;
+ if (Mathf.Abs(_sm1.Position.x - _sm2.Position.x) > Mathf.Abs(rect.width + rect2.width) / 2f)
+ {
+ return false;
+ }
+ if (Mathf.Abs(_sm1.Position.y - _sm2.Position.y) > Mathf.Abs(rect.height + rect2.height) / 2f)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ private void FormatGroup(List<ScreenMarker> _group)
+ {
+ if (_group.Count <= 0)
+ {
+ return;
+ }
+ Vector2 zero = Vector2.zero;
+ float num = 0f;
+ float num2 = 0f;
+ float num3 = 0f;
+ float num4 = 0f;
+ for (int i = 0; i < _group.Count; i++)
+ {
+ zero += _group[i].ClampedScreenPos;
+ num3 += _group[i].Rect.width;
+ num4 += _group[i].Rect.height;
+ if (i > 0)
+ {
+ num -= _group[i].Rect.width / 2f;
+ num2 -= _group[i].Rect.height / 2f;
+ }
+ }
+ zero /= (float)_group.Count;
+ if (Mathf.Abs(zero.x / clampX) < Mathf.Abs(zero.y / clampY))
+ {
+ zero = new Vector2(Mathf.Clamp(zero.x, 0f - clampX + num3 / 2f, clampX - num3 / 2f), zero.y);
+ _group.Sort(new ComparePositionX());
+ for (int j = 0; j < _group.Count; j++)
+ {
+ _group[j].Position = zero + Vector2.right * (_group[j].Rect.width * (float)j + num);
+ }
+ }
+ else
+ {
+ zero = new Vector2(zero.x, Mathf.Clamp(zero.y, 0f - clampY + num4 / 2f, clampY - num4 / 2f));
+ _group.Sort(new ComparePositionY());
+ for (int k = 0; k < _group.Count; k++)
+ {
+ _group[k].Position = zero + Vector2.down * (_group[k].Rect.height * (float)k + num2);
+ }
+ }
+ }
+
+ public void UpdateMarkerPosition(ScreenMarker _sm)
+ {
+ float num = cam.pixelRect.height / FIXED_CANVAS_HEIGHT;
+ Vector3 vector = cam.WorldToScreenPoint(_sm.transform.position);
+ Vector2 vector3 = (_sm.UnclampedScreenPos = new Vector2(vector.x - cam.pixelRect.width * 0.5f, vector.y - cam.pixelRect.height * 0.5f) / num);
+ bool flag = true;
+ if (Mathf.Abs(vector3.y) > clampY - _sm.checkOnScreenRect.height / 2f)
+ {
+ flag = false;
+ }
+ else if (Mathf.Abs(vector3.x) > clampX - _sm.checkOnScreenRect.width / 2f)
+ {
+ flag = false;
+ }
+ _sm.OnScreen = flag;
+ if ((flag && _sm.showWhenOnScreen) || (!flag && _sm.showWhenOffScreen))
+ {
+ screenMarkersToShow.Add(_sm);
+ _sm.Show(_show: true);
+ if (markerMode == MarkerMode.Direction)
+ {
+ float num2 = (clampX - _sm.Rect.width / 2f) / Mathf.Abs(vector3.x);
+ float num3 = (clampY - _sm.Rect.height / 2f) / Mathf.Abs(vector3.y);
+ float num4 = Mathf.Min(num2, num3, 1f);
+ vector3 = new Vector2(vector3.x, vector3.y) * num4;
+ }
+ else
+ {
+ Rect rect = _sm.Rect;
+ vector3 = new Vector2(Mathf.Clamp(vector3.x, 0f - clampX + rect.width / 2f, clampX - rect.width / 2f), Mathf.Clamp(vector3.y, 0f - clampY + rect.height / 2f, clampY - rect.height / 2f));
+ }
+ _sm.Position = vector3;
+ _sm.ClampedScreenPos = vector3;
+ }
+ else
+ {
+ _sm.Show(_show: false);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ScrollArea.cs b/Thronefall_v1.57/Thronefall/Thronefall/ScrollArea.cs
new file mode 100644
index 0000000..935f546
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ScrollArea.cs
@@ -0,0 +1,119 @@
+using Rewired;
+using UnityEngine;
+
+public class ScrollArea : MonoBehaviour
+{
+ public UIFrame target;
+
+ [Range(0f, 1f)]
+ public float scrollValue;
+
+ public RectTransform mask;
+
+ public RectTransform content;
+
+ public RectTransform scrollBarBackground;
+
+ public RectTransform scrollBarBlock;
+
+ public int startToScrollAfterElement = 4;
+
+ public float dampTime = 0.5f;
+
+ private float endBuffer = 50f;
+
+ private Vector2 initialContentPosition;
+
+ private float desiredScrollValue;
+
+ private float scrollVelocityRef;
+
+ private Player input;
+
+ private void Start()
+ {
+ initialContentPosition = content.anchoredPosition;
+ input = ReInput.players.GetPlayer(0);
+ }
+
+ private void Update()
+ {
+ if (UIFrameManager.instance.ActiveFrame == target)
+ {
+ desiredScrollValue -= Input.mouseScrollDelta.y;
+ if (desiredScrollValue > 1f)
+ {
+ desiredScrollValue = 1f;
+ }
+ else if (desiredScrollValue < 0f)
+ {
+ desiredScrollValue = 0f;
+ }
+ }
+ endBuffer = mask.rect.height * 0.2f;
+ float num = content.rect.height - mask.rect.height;
+ if (num < 0f)
+ {
+ num = 0f;
+ }
+ if (num != 0f)
+ {
+ num += endBuffer;
+ }
+ if (num == 0f)
+ {
+ scrollBarBackground.gameObject.SetActive(value: false);
+ }
+ else
+ {
+ scrollBarBackground.gameObject.SetActive(value: true);
+ }
+ scrollBarBlock.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, scrollBarBackground.rect.height * (mask.rect.height / (content.rect.height + endBuffer)));
+ float num2 = scrollBarBackground.rect.height - scrollBarBlock.rect.height;
+ scrollValue = Mathf.SmoothDamp(scrollValue, desiredScrollValue, ref scrollVelocityRef, dampTime, float.PositiveInfinity, Time.unscaledDeltaTime);
+ content.anchoredPosition = new Vector2(initialContentPosition.x, initialContentPosition.y + num * scrollValue);
+ scrollBarBlock.anchoredPosition = new Vector2(0f, (0f - num2) * scrollValue);
+ }
+
+ public void OnNewSelection()
+ {
+ ScrollElementID component = target.CurrentSelection.GetComponent<ScrollElementID>();
+ if (component == null)
+ {
+ desiredScrollValue = 0f;
+ return;
+ }
+ int num = content.childCount - 1;
+ desiredScrollValue = Mathf.InverseLerp(startToScrollAfterElement, num, component.id);
+ }
+
+ public void OnDragStart()
+ {
+ desiredScrollValue = scrollValue;
+ }
+
+ public void OnDrag(Vector2 point)
+ {
+ SetValueByScreenPoint(point);
+ }
+
+ public void OnDragEnd()
+ {
+ }
+
+ public void SetValueByScreenPoint(Vector2 point)
+ {
+ RectTransformUtility.ScreenPointToLocalPointInRectangle(scrollBarBackground, input.controllers.Mouse.screenPosition, null, out point);
+ float height = scrollBarBackground.rect.height;
+ if (point.y < (0f - height) / 2f)
+ {
+ point.y = (0f - height) / 2f;
+ }
+ if (point.y > height / 2f)
+ {
+ point.y = height / 2f;
+ }
+ scrollValue = Mathf.InverseLerp(height / 2f, (0f - height) / 2f, point.y);
+ desiredScrollValue = scrollValue;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ScrollElementID.cs b/Thronefall_v1.57/Thronefall/Thronefall/ScrollElementID.cs
new file mode 100644
index 0000000..62a113c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ScrollElementID.cs
@@ -0,0 +1,6 @@
+using UnityEngine;
+
+public class ScrollElementID : MonoBehaviour
+{
+ public int id;
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SeasonTwoWaveGen.cs b/Thronefall_v1.57/Thronefall/Thronefall/SeasonTwoWaveGen.cs
new file mode 100644
index 0000000..fa8c057
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SeasonTwoWaveGen.cs
@@ -0,0 +1,389 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "New ET Settings", menuName = "SimpleSiege/Season2 Wave Gen")]
+public class SeasonTwoWaveGen : EternalWaveGenerator
+{
+ [SerializeField]
+ private EternalTrialEnemySet enemySet;
+
+ [SerializeField]
+ private int maxAmountOfUnitsPerWave = 200;
+
+ public List<int> _OUTgoldSpentOnEconomyBeforeNigh = new List<int>();
+
+ public List<int> _OUTgoldSpentOnDefenseBeforeNight = new List<int>();
+
+ public List<int> _OUTNetworthBeforeNight = new List<int>();
+
+ public List<int> _OUTgoldEarnedInNight = new List<int>();
+
+ public List<int> _OUTgoldDroppedInNight = new List<int>();
+
+ public List<string> _OUTBuildorder = new List<string>();
+
+ public List<int> _OUTDefensePower = new List<int>();
+
+ public override List<Wave> GenerateWaves(EnemySpawnLine[] _spawns, LevelInfo _levelInfo, int _stage, out int _startingGold, int _seed, int _waveCountOverride = -1)
+ {
+ System.Random random = new System.Random(_seed);
+ UnityEngine.Random.InitState(_seed);
+ _startingGold = random.Next(8, 26);
+ if (_stage >= 7)
+ {
+ _startingGold = random.Next(13, 26);
+ }
+ int num = Mathf.Min(_stage + 5, 10);
+ float num2 = Mathf.Pow(1.2f, _stage);
+ int n = Mathf.Clamp(3 + _stage, 3, 6) + ((_stage >= 5) ? 1 : 0);
+ float max = 0.4f;
+ float max2 = 0.5f;
+ List<EternalTrialEnemy> list = new List<EternalTrialEnemy>();
+ for (int i = 0; i < 2000; i++)
+ {
+ list = WaveGenUtility.GetRandomElements(enemySet.enemies, n, random);
+ int num3 = 0;
+ int num4 = 0;
+ int num5 = 0;
+ int num6 = 0;
+ foreach (EternalTrialEnemy item in list)
+ {
+ if (item.group == EternalTrialEnemy.EGroup.BreadAndButter)
+ {
+ num3++;
+ if (item.minDefenseInvestment <= 0f)
+ {
+ num6++;
+ }
+ }
+ if (item.group == EternalTrialEnemy.EGroup.Flavour)
+ {
+ num4++;
+ }
+ if (item.group == EternalTrialEnemy.EGroup.Flying)
+ {
+ num5++;
+ }
+ }
+ if (num6 > 0)
+ {
+ break;
+ }
+ }
+ list.ETShuffle(random);
+ string text = "LEVEL ENEMIES: ";
+ foreach (EternalTrialEnemy item2 in list)
+ {
+ text = text + item2.enemyPrefab.name + ", ";
+ }
+ Debug.Log(text);
+ float num7 = 0.2f;
+ int minGoldDrops = 3;
+ int maxGoldDrops = 40;
+ for (int j = 0; j < 100; j++)
+ {
+ EconomySimulator.SimulateEconomy(out _OUTgoldSpentOnEconomyBeforeNigh, out _OUTgoldSpentOnDefenseBeforeNight, out _OUTNetworthBeforeNight, out _OUTgoldEarnedInNight, out _OUTgoldDroppedInNight, out _OUTBuildorder, out _OUTDefensePower, _levelInfo.virtualBuildings, _startingGold, num7, minGoldDrops, maxGoldDrops, num);
+ if (num == _OUTgoldEarnedInNight.Count)
+ {
+ break;
+ }
+ if (_startingGold > 10)
+ {
+ _startingGold--;
+ }
+ num7 *= 0.9f;
+ }
+ num = _OUTgoldEarnedInNight.Count;
+ List<WaveDraft> list2 = new List<WaveDraft>();
+ int num8 = UnityEngine.Random.Range(0, list.Count);
+ int num9 = UnityEngine.Random.Range(0, list.Count);
+ for (int k = 0; k < num; k++)
+ {
+ WaveDraft waveDraft = new WaveDraft();
+ list2.Add(waveDraft);
+ waveDraft.targetDifficulty = (float)_OUTDefensePower[k] * 2f * num2 + 11f * Mathf.Clamp(num2, 1f, 1.75f);
+ if (_stage == 0)
+ {
+ waveDraft.targetDifficulty *= 0.9f;
+ }
+ else if (_stage == 2)
+ {
+ waveDraft.targetDifficulty *= Mathf.Pow(1.01f, k);
+ }
+ else if (_stage == 3)
+ {
+ waveDraft.targetDifficulty *= Mathf.Pow(1.02f, k);
+ }
+ else if (_stage == 4)
+ {
+ waveDraft.targetDifficulty *= Mathf.Pow(1.03f, k);
+ }
+ else if (_stage == 5)
+ {
+ waveDraft.targetDifficulty *= Mathf.Pow(1.04f, k);
+ }
+ else if (_stage >= 6)
+ {
+ waveDraft.targetDifficulty *= Mathf.Pow(1.05f, k);
+ }
+ waveDraft.defenseGoldSpent = _OUTgoldSpentOnDefenseBeforeNight[k];
+ waveDraft.goldToDropAtNight = _OUTgoldDroppedInNight[k];
+ _ = (float)k / (float)(num - 1);
+ int num10 = 1;
+ num10 = UnityEngine.Random.Range(1, Mathf.Clamp(k + 1, 1, list.Count - 1) + 1);
+ num10 = Mathf.Clamp(num10, 1, 5);
+ if (_stage >= 3 && k == 0)
+ {
+ num10 = UnityEngine.Random.Range(1, 3);
+ }
+ if (_stage >= 6 && k <= 1)
+ {
+ num10 = UnityEngine.Random.Range(1, 4);
+ }
+ if (_stage >= 7 && random.NextDouble() < 0.5)
+ {
+ num10 = Mathf.Max(2, num10);
+ }
+ for (int l = 0; l < list.Count; l++)
+ {
+ num8 = (num8 + 1) % list.Count;
+ EternalTrialEnemy eternalTrialEnemy = list[num8];
+ if (eternalTrialEnemy.group == EternalTrialEnemy.EGroup.BreadAndButter && (float)waveDraft.defenseGoldSpent >= eternalTrialEnemy.minDefenseInvestment)
+ {
+ waveDraft.enemiesToEncounter.Add(eternalTrialEnemy);
+ num10--;
+ break;
+ }
+ }
+ if (num10 <= 0)
+ {
+ continue;
+ }
+ for (int m = 0; m < list.Count; m++)
+ {
+ num9 = (num9 + 1) % list.Count;
+ EternalTrialEnemy eternalTrialEnemy2 = list[num9];
+ if (!waveDraft.enemiesToEncounter.Contains(eternalTrialEnemy2) && (float)waveDraft.defenseGoldSpent >= eternalTrialEnemy2.minDefenseInvestment)
+ {
+ waveDraft.enemiesToEncounter.Add(eternalTrialEnemy2);
+ num10--;
+ if (num10 <= 0)
+ {
+ break;
+ }
+ }
+ }
+ }
+ Dictionary<EternalTrialEnemy, List<EnemySpawnLine>> dictionary = new Dictionary<EternalTrialEnemy, List<EnemySpawnLine>>();
+ new Dictionary<EnemySpawnLine, float>();
+ foreach (EternalTrialEnemy item3 in list)
+ {
+ List<EnemySpawnLine> list3 = new List<EnemySpawnLine>(_spawns);
+ dictionary.Add(item3, list3);
+ for (int num11 = list3.Count - 1; num11 >= 0; num11--)
+ {
+ EnemySpawnLine enemySpawnLine = list3[num11];
+ if ((item3.flying && !enemySpawnLine.canSpawnFlying) || (item3.bigGround && !enemySpawnLine.canSpawnBigGround) || (item3.smallGround && !enemySpawnLine.canSpawnSmallGround))
+ {
+ list3.RemoveAt(num11);
+ }
+ }
+ list3.ETShuffle(random);
+ string text2 = "";
+ for (int num12 = 0; num12 < list3.Count; num12++)
+ {
+ text2 = text2 + list3[num12].transform.gameObject.name + ", ";
+ }
+ Debug.Log(item3.enemyPrefab.name + ": " + text2);
+ }
+ for (int num13 = 0; num13 < num; num13++)
+ {
+ float num14 = 0f;
+ float num15 = 0f;
+ float num16 = 0f;
+ WaveDraft waveDraft2 = list2[num13];
+ foreach (EternalTrialEnemy item4 in waveDraft2.enemiesToEncounter)
+ {
+ float num17 = UnityEngine.Random.Range(1f, 5f);
+ if (item4.group == EternalTrialEnemy.EGroup.BreadAndButter)
+ {
+ num14 += num17;
+ }
+ if (item4.group == EternalTrialEnemy.EGroup.Flavour)
+ {
+ num15 += num17;
+ }
+ if (item4.group == EternalTrialEnemy.EGroup.Flying)
+ {
+ num16 += num17;
+ }
+ waveDraft2.percentageOfDifficultyAllocatedToEnemy.Add(num17);
+ }
+ float num18 = num14 + num15 + num16;
+ float num19 = Mathf.Clamp(num15 / num18, 0f, max) * num18;
+ float num20 = Mathf.Clamp(num16 / num18, 0f, max2) * num18;
+ float num21 = num18 - num19 - num20;
+ float num22 = num19 / num15;
+ float num23 = num20 / num16;
+ float num24 = num21 / num14;
+ for (int num25 = 0; num25 < waveDraft2.enemiesToEncounter.Count; num25++)
+ {
+ EternalTrialEnemy eternalTrialEnemy3 = waveDraft2.enemiesToEncounter[num25];
+ if (eternalTrialEnemy3.group == EternalTrialEnemy.EGroup.Flavour)
+ {
+ waveDraft2.percentageOfDifficultyAllocatedToEnemy[num25] *= num22;
+ }
+ if (eternalTrialEnemy3.group == EternalTrialEnemy.EGroup.Flying)
+ {
+ waveDraft2.percentageOfDifficultyAllocatedToEnemy[num25] *= num23;
+ }
+ if (eternalTrialEnemy3.group == EternalTrialEnemy.EGroup.BreadAndButter)
+ {
+ waveDraft2.percentageOfDifficultyAllocatedToEnemy[num25] *= num24;
+ }
+ waveDraft2.percentageOfDifficultyAllocatedToEnemy[num25] /= num18;
+ }
+ string text3 = "Wave " + (num13 + 1) + ": ";
+ for (int num26 = 0; num26 < waveDraft2.enemiesToEncounter.Count; num26++)
+ {
+ EternalTrialEnemy eternalTrialEnemy4 = waveDraft2.enemiesToEncounter[num26];
+ text3 = text3 + eternalTrialEnemy4.enemyPrefab.name + "(" + waveDraft2.percentageOfDifficultyAllocatedToEnemy[num26] * 100f + "%), ";
+ }
+ Debug.Log(text3);
+ }
+ for (int num27 = 0; num27 < num; num27++)
+ {
+ WaveDraft waveDraft3 = list2[num27];
+ int num28 = 0;
+ int num29 = 0;
+ for (int num30 = 0; num30 < waveDraft3.enemiesToEncounter.Count; num30++)
+ {
+ float num31 = waveDraft3.targetDifficulty * waveDraft3.percentageOfDifficultyAllocatedToEnemy[num30];
+ int num32 = Mathf.Max(1, Mathf.RoundToInt(num31 / waveDraft3.enemiesToEncounter[num30].difficultyValue));
+ waveDraft3.enemyCountForEnemy.Add(num32);
+ waveDraft3.spawnInSpeedForEnemy.Add(1f);
+ waveDraft3.eliteEnemies.Add(item: false);
+ num28 += num32;
+ if (num28 >= 10)
+ {
+ num29++;
+ }
+ }
+ for (int num33 = 0; num33 < waveDraft3.enemiesToEncounter.Count; num33++)
+ {
+ if (num28 <= maxAmountOfUnitsPerWave)
+ {
+ break;
+ }
+ if (num29 <= 0)
+ {
+ break;
+ }
+ if (waveDraft3.enemyCountForEnemy[num33] >= 10)
+ {
+ int num34 = waveDraft3.enemyCountForEnemy[num33];
+ waveDraft3.enemyCountForEnemy[num33] = Mathf.RoundToInt((float)waveDraft3.enemyCountForEnemy[num33] / 6f);
+ waveDraft3.eliteEnemies[num33] = true;
+ num29--;
+ num28 -= num34 - waveDraft3.enemyCountForEnemy[num33];
+ }
+ }
+ for (int num35 = 0; num35 < 5; num35++)
+ {
+ for (int num36 = 0; num36 < waveDraft3.enemiesToEncounter.Count; num36++)
+ {
+ if (num28 <= maxAmountOfUnitsPerWave)
+ {
+ break;
+ }
+ if (waveDraft3.enemyCountForEnemy[num36] >= 20)
+ {
+ int num37 = waveDraft3.enemyCountForEnemy[num36];
+ waveDraft3.enemyCountForEnemy[num36] = Mathf.RoundToInt((float)waveDraft3.enemyCountForEnemy[num36] * 0.75f);
+ waveDraft3.spawnInSpeedForEnemy[num36] *= 2f;
+ num28 -= num37 - waveDraft3.enemyCountForEnemy[num36];
+ }
+ }
+ if (num28 <= maxAmountOfUnitsPerWave)
+ {
+ break;
+ }
+ }
+ string text4 = "Wave " + (num27 + 1) + ": ";
+ for (int num38 = 0; num38 < waveDraft3.enemiesToEncounter.Count; num38++)
+ {
+ EternalTrialEnemy eternalTrialEnemy5 = waveDraft3.enemiesToEncounter[num38];
+ text4 = text4 + eternalTrialEnemy5.enemyPrefab.name + "(x" + waveDraft3.enemyCountForEnemy[num38] + "), ";
+ }
+ Debug.Log(text4);
+ }
+ for (int num39 = 0; num39 < num; num39++)
+ {
+ WaveDraft waveDraft4 = list2[num39];
+ for (int num40 = 0; num40 < waveDraft4.enemiesToEncounter.Count; num40++)
+ {
+ List<EnemySpawnLine> list4 = new List<EnemySpawnLine>();
+ waveDraft4.enemySpawnLines.Add(list4);
+ EternalTrialEnemy eternalTrialEnemy6 = waveDraft4.enemiesToEncounter[num40];
+ int num41 = 1;
+ for (int num42 = 0; num42 < num39; num42++)
+ {
+ foreach (EternalTrialEnemy item5 in list2[num42].enemiesToEncounter)
+ {
+ if (item5 == eternalTrialEnemy6)
+ {
+ num41++;
+ }
+ }
+ }
+ List<EnemySpawnLine> list5 = dictionary[eternalTrialEnemy6];
+ for (int num43 = 0; num43 < num41 && num43 < list5.Count; num43++)
+ {
+ list4.Add(list5[num43]);
+ }
+ waveDraft4.enemiesPerSpawnLine.Add(WaveGenUtility.DistributeEnemies(waveDraft4.enemyCountForEnemy[num40], list4.Count));
+ }
+ }
+ for (int num44 = 0; num44 < num; num44++)
+ {
+ WaveDraft waveDraft5 = list2[num44];
+ waveDraft5.waveDuration = Mathf.Sqrt(waveDraft5.targetDifficulty);
+ }
+ List<Wave> list6 = new List<Wave>();
+ foreach (WaveDraft item6 in list2)
+ {
+ Wave wave = new Wave();
+ list6.Add(wave);
+ for (int num45 = 0; num45 < item6.enemiesToEncounter.Count; num45++)
+ {
+ EternalTrialEnemy eternalTrialEnemy7 = item6.enemiesToEncounter[num45];
+ _ = item6.enemyCountForEnemy[num45];
+ bool eliteEnemies = item6.eliteEnemies[num45];
+ float waveDuration = item6.waveDuration;
+ float num46 = item6.spawnInSpeedForEnemy[num45];
+ List<EnemySpawnLine> list7 = item6.enemySpawnLines[num45];
+ for (int num47 = 0; num47 < list7.Count; num47++)
+ {
+ Spawn spawn = new Spawn();
+ spawn.enemyPrefab = eternalTrialEnemy7.enemyPrefab;
+ spawn.count = item6.enemiesPerSpawnLine[num45][num47];
+ spawn.eliteEnemies = eliteEnemies;
+ spawn.delay = 0f;
+ spawn.interval = waveDuration / (float)Mathf.Max(1, spawn.count - 1) / num46;
+ spawn.spawnLine = list7[num47].transform;
+ spawn.goldCoins = 0;
+ if (spawn.count > 0)
+ {
+ wave.spawns.Add(spawn);
+ }
+ }
+ }
+ for (int num48 = item6.goldToDropAtNight; num48 > 0; num48--)
+ {
+ wave.spawns[UnityEngine.Random.Range(0, wave.spawns.Count)].goldCoins++;
+ }
+ }
+ return list6;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SelectUnitUI.cs b/Thronefall_v1.57/Thronefall/Thronefall/SelectUnitUI.cs
new file mode 100644
index 0000000..82863c7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SelectUnitUI.cs
@@ -0,0 +1,28 @@
+using MPUIKIT;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class SelectUnitUI : MonoBehaviour
+{
+ [SerializeField]
+ private GameObject canvas;
+
+ [SerializeField]
+ private Image image;
+
+ [SerializeField]
+ private MPImage mpImage;
+
+ private bool animating;
+
+ public void UpdateState(bool visible, Sprite sprite, float selectProgress)
+ {
+ if (selectProgress > 0.99f)
+ {
+ visible = false;
+ }
+ canvas.SetActive(visible);
+ image.sprite = sprite;
+ mpImage.fillAmount = selectProgress;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SelfDestructWhenInRangeOf.cs b/Thronefall_v1.57/Thronefall/Thronefall/SelfDestructWhenInRangeOf.cs
new file mode 100644
index 0000000..8ab0e29
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SelfDestructWhenInRangeOf.cs
@@ -0,0 +1,33 @@
+using UnityEngine;
+
+public class SelfDestructWhenInRangeOf : MonoBehaviour
+{
+ [SerializeField]
+ private TargetPriority selfDestructIfInRangeOf;
+
+ [SerializeField]
+ private float checkInterval = 0.5f;
+
+ private float timeTillNextCheck;
+
+ private Hp hp;
+
+ private void Start()
+ {
+ hp = GetComponent<Hp>();
+ timeTillNextCheck = checkInterval;
+ }
+
+ private void Update()
+ {
+ timeTillNextCheck -= Time.deltaTime;
+ if (timeTillNextCheck <= 0f)
+ {
+ timeTillNextCheck = checkInterval;
+ if (selfDestructIfInRangeOf.FindClosestTaggedObject(base.transform.position) != null && (bool)hp)
+ {
+ hp.TakeDamage(1E+09f);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SetStateWhenMacOSX.cs b/Thronefall_v1.57/Thronefall/Thronefall/SetStateWhenMacOSX.cs
new file mode 100644
index 0000000..6db5d60
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SetStateWhenMacOSX.cs
@@ -0,0 +1,13 @@
+using UnityEngine;
+
+public class SetStateWhenMacOSX : MonoBehaviour
+{
+ public bool activeOnMacOSX;
+
+ public bool activeElsewhere;
+
+ private void Awake()
+ {
+ base.gameObject.SetActive(activeElsewhere);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SetWidthToTarget.cs b/Thronefall_v1.57/Thronefall/Thronefall/SetWidthToTarget.cs
new file mode 100644
index 0000000..fa5c6b6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SetWidthToTarget.cs
@@ -0,0 +1,29 @@
+using UnityEngine;
+
+public class SetWidthToTarget : MonoBehaviour
+{
+ public RectTransform target;
+
+ public float padding;
+
+ public float minWidth = 800f;
+
+ private RectTransform rt;
+
+ private void Awake()
+ {
+ rt = GetComponent<RectTransform>();
+ if (rt.sizeDelta.x < minWidth)
+ {
+ rt.sizeDelta = new Vector2(minWidth, rt.sizeDelta.y);
+ }
+ }
+
+ private void Update()
+ {
+ if (target.sizeDelta.x + padding * 2f > minWidth && !Mathf.Approximately(rt.sizeDelta.x - padding * 2f, target.sizeDelta.x))
+ {
+ rt.sizeDelta = new Vector2(target.sizeDelta.x + padding * 2f, rt.sizeDelta.y);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsAntiAliasing.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsAntiAliasing.cs
new file mode 100644
index 0000000..e2a19a6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsAntiAliasing.cs
@@ -0,0 +1,26 @@
+using UnityEngine;
+
+public class SettingsAntiAliasing : MonoBehaviour
+{
+ public EnumSelector selector;
+
+ private void Start()
+ {
+ selector.onChange.AddListener(OnChange);
+ }
+
+ private void OnEnable()
+ {
+ selector.options.Clear();
+ selector.options.AddRange(new string[4] { "Disabled", "2x", "4x", "8x" });
+ if ((bool)SettingsManager.Instance)
+ {
+ selector.SetIndex(SettingsManager.AALevelToInt(SettingsManager.Instance.AntiAliasing));
+ }
+ }
+
+ private void OnChange()
+ {
+ SettingsManager.Instance.SetAntiAliasing(SettingsManager.IntToAALevel(selector.Index));
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsAudioVolume.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsAudioVolume.cs
new file mode 100644
index 0000000..cadeddb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsAudioVolume.cs
@@ -0,0 +1,26 @@
+using UnityEngine;
+
+public class SettingsAudioVolume : MonoBehaviour
+{
+ public TFUISlider target;
+
+ public SettingsManager.MixerChannel channel;
+
+ private void OnEnable()
+ {
+ if (SettingsManager.Instance != null)
+ {
+ target.SetValue(SettingsManager.Instance.GetAudioVolume(channel));
+ }
+ }
+
+ private void Start()
+ {
+ target.onChange.AddListener(OnChange);
+ }
+
+ private void OnChange()
+ {
+ SettingsManager.Instance.SetAudioValue(target.value, channel);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsFullscreen.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsFullscreen.cs
new file mode 100644
index 0000000..4d6ba9f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsFullscreen.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class SettingsFullscreen : MonoBehaviour
+{
+ public Checkbox checkbox;
+
+ public void OnApply()
+ {
+ SettingsManager.Instance.SetFullscreen(checkbox.state);
+ }
+
+ private void OnEnable()
+ {
+ if ((bool)SettingsManager.Instance)
+ {
+ checkbox.SetState(SettingsManager.Instance.Fullscreen);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsLanguage.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsLanguage.cs
new file mode 100644
index 0000000..57173ee
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsLanguage.cs
@@ -0,0 +1,32 @@
+using I2.Loc;
+using UnityEngine;
+
+public class SettingsLanguage : MonoBehaviour
+{
+ public EnumSelector selector;
+
+ private void Start()
+ {
+ selector.onChange.AddListener(OnChange);
+ }
+
+ private void OnEnable()
+ {
+ selector.options.Clear();
+ selector.options.AddRange(LocalizationManager.GetAllLanguages());
+ string currentLanguage = LocalizationManager.CurrentLanguage;
+ for (int i = 0; i < selector.options.Count; i++)
+ {
+ if (selector.options[i] == currentLanguage)
+ {
+ selector.SetIndex(i);
+ break;
+ }
+ }
+ }
+
+ private void OnChange()
+ {
+ LocalizationManager.CurrentLanguage = selector.options[selector.Index];
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsLanguageReset.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsLanguageReset.cs
new file mode 100644
index 0000000..776d9be
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsLanguageReset.cs
@@ -0,0 +1,14 @@
+using I2.Loc;
+using UnityEngine;
+
+public class SettingsLanguageReset : MonoBehaviour
+{
+ public GameObject objToRefresh;
+
+ public void ResetLanguage()
+ {
+ LocalizationManager.CurrentLanguage = LocalizationManager.GetCurrentDeviceLanguage();
+ objToRefresh.SetActive(value: false);
+ objToRefresh.SetActive(value: true);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsManager.cs
new file mode 100644
index 0000000..0496578
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsManager.cs
@@ -0,0 +1,443 @@
+using System.Collections;
+using System.Collections.Generic;
+using Rewired;
+using UnityEngine;
+using UnityEngine.Audio;
+using UnityEngine.Events;
+using UnityEngine.Rendering.Universal;
+
+public class SettingsManager : MonoBehaviour
+{
+ public enum MixerChannel
+ {
+ Master,
+ Music,
+ SFX,
+ Environment
+ }
+
+ private static SettingsManager instance;
+
+ public UniversalRenderPipelineAsset renderAsset;
+
+ public AudioMixer mixer;
+
+ [HideInInspector]
+ public UnityEvent onPPSettingsChange = new UnityEvent();
+
+ private bool fullscreen = true;
+
+ private bool vSync;
+
+ private Resolution currentResolution;
+
+ private bool postProcessing = true;
+
+ private MsaaQuality antiAliasing = MsaaQuality._4x;
+
+ private float renderscale = 1f;
+
+ private float volumeMaster;
+
+ private float volumeSFX;
+
+ private float volumeEnvironment;
+
+ private float volumeMusic;
+
+ private bool resetUnitFormationEveryMorning;
+
+ private bool useLargeInGameUI;
+
+ private bool winterMode;
+
+ private string VIDEO_INITIALIZED = "Video_Initialized";
+
+ private string VIDEO_RESOLUTION_WIDTH = "Video_ResWidth";
+
+ private string VIDEO_RESOLUTION_HEIGHT = "Video_ResHeight";
+
+ private string VIDEO_POSTPROCESSING = "Video_PostProcessing";
+
+ private string VIDEO_FULLSCREEN = "Video_Fullscreen";
+
+ private string VIDEO_VSYNC = "Video_Vsync";
+
+ private string VIDEO_ANTIALIASING = "Video_AntiAliasing";
+
+ private string VIDEO_RENDERSCALE = "Video_Renderscale";
+
+ private string AUDIO_INITIALIZED = "Audio_Initialized_1.1";
+
+ private string AUDIO_MASTER = "Audio_Master";
+
+ private string AUDIO_MUSIC = "Audio_Music";
+
+ private string AUDIO_SFX = "Audio_SFX";
+
+ private string AUDIO_ENVIRONMENT = "Audio_Environment";
+
+ private string MIXER_MASTER = "MasterVolume";
+
+ private string MIXER_MUSIC = "SettingsMusicVolume";
+
+ private string MIXER_SFX = "SettingsSFXVolume";
+
+ private string MIXER_ENVIRONMENT = "SettingsEnvironmentVolume";
+
+ private string GAMEPLAY_INITIALIZED = "Gameplay_Initialized_1.1";
+
+ private string GAMEPLAY_RESET_UNIS_EVERY_MORNING = "Gameplay_ResetUnitFormationEveryMorning";
+
+ private string GAMEPLAY_USE_LARGE_UI = "Gameplay_UseLargeInGameUI";
+
+ private string GAMEPLAY_WINTER_MODE = "Gameplay_WinterMode";
+
+ private bool isInDefferedControlsLoadingCoroutine;
+
+ public static SettingsManager Instance => instance;
+
+ public bool Fullscreen => fullscreen;
+
+ public bool VSync => vSync;
+
+ public Resolution CurrentResolution => currentResolution;
+
+ public bool PostProcessing => postProcessing;
+
+ public MsaaQuality AntiAliasing => antiAliasing;
+
+ public float Renderscale => renderscale;
+
+ public float VolumeMaster => volumeMaster;
+
+ public float VolumeSFX => volumeSFX;
+
+ public float VolumeEnvironment => volumeEnvironment;
+
+ public float VolumeMusic => volumeMusic;
+
+ public bool ResetUnitFormationEveryMorning => resetUnitFormationEveryMorning;
+
+ public bool UseLargeInGameUI => useLargeInGameUI;
+
+ public bool WinterMode => winterMode;
+
+ private void Awake()
+ {
+ if (instance != null)
+ {
+ Object.Destroy(base.gameObject);
+ }
+ else
+ {
+ instance = this;
+ }
+ }
+
+ private void Start()
+ {
+ LoadVideoSettingsFromPlayerPrefs();
+ LoadAudioSettingsFromPlayerPrefs();
+ LoadGameplaySettingsFromPlayerPrefs();
+ }
+
+ private void OnEnable()
+ {
+ StartCoroutine(LoadControlsConfigDeffered());
+ ReInput.ControllerConnectedEvent += OnControllerConnect;
+ }
+
+ private void OnDisable()
+ {
+ ReInput.ControllerDisconnectedEvent -= OnControllerConnect;
+ }
+
+ private void OnControllerConnect(ControllerStatusChangedEventArgs e)
+ {
+ StartCoroutine(LoadControlsConfigDeffered());
+ }
+
+ private IEnumerator LoadControlsConfigDeffered()
+ {
+ if (!isInDefferedControlsLoadingCoroutine)
+ {
+ isInDefferedControlsLoadingCoroutine = true;
+ yield return null;
+ ControlConfigSaveLoad.LoadControlConfigFromJson();
+ isInDefferedControlsLoadingCoroutine = false;
+ }
+ }
+
+ public void SetResolution(Resolution newRes)
+ {
+ List<Resolution> list = new List<Resolution>(Screen.resolutions);
+ bool flag = false;
+ foreach (Resolution item in list)
+ {
+ if (newRes.CompareResolutions(item))
+ {
+ flag = true;
+ break;
+ }
+ }
+ if (!flag)
+ {
+ newRes = Screen.currentResolution;
+ }
+ currentResolution = newRes;
+ FullScreenMode fullscreenMode = FullScreenMode.FullScreenWindow;
+ if (!fullscreen)
+ {
+ fullscreenMode = FullScreenMode.Windowed;
+ }
+ Screen.SetResolution(currentResolution.width, currentResolution.height, fullscreenMode, currentResolution.refreshRateRatio);
+ PlayerPrefs.SetInt(VIDEO_RESOLUTION_WIDTH, currentResolution.width);
+ PlayerPrefs.SetInt(VIDEO_RESOLUTION_HEIGHT, currentResolution.height);
+ }
+
+ public void SetVSync(bool active)
+ {
+ vSync = active;
+ if (active)
+ {
+ QualitySettings.vSyncCount = 1;
+ }
+ else
+ {
+ QualitySettings.vSyncCount = 0;
+ }
+ PlayerPrefs.SetInt(VIDEO_VSYNC, active ? 1 : 0);
+ }
+
+ public void SetPostProcessing(bool active)
+ {
+ postProcessing = active;
+ onPPSettingsChange.Invoke();
+ PlayerPrefs.SetInt(VIDEO_POSTPROCESSING, active ? 1 : 0);
+ }
+
+ public void SetAntiAliasing(MsaaQuality quality)
+ {
+ antiAliasing = quality;
+ renderAsset.msaaSampleCount = (int)antiAliasing;
+ PlayerPrefs.SetInt(VIDEO_ANTIALIASING, AALevelToInt(antiAliasing));
+ }
+
+ public void SetFullscreen(bool isFullscreen)
+ {
+ fullscreen = isFullscreen;
+ Screen.fullScreen = isFullscreen;
+ PlayerPrefs.SetInt(VIDEO_FULLSCREEN, isFullscreen ? 1 : 0);
+ }
+
+ public void SetShadowResolution(int res)
+ {
+ }
+
+ public void SetRenderscale(float scale)
+ {
+ renderscale = scale;
+ renderAsset.renderScale = renderscale;
+ PlayerPrefs.SetFloat(VIDEO_RENDERSCALE, renderscale);
+ }
+
+ public void SetAudioValue(float value, MixerChannel channel)
+ {
+ string text;
+ switch (channel)
+ {
+ case MixerChannel.Environment:
+ volumeEnvironment = value;
+ PlayerPrefs.SetFloat(AUDIO_ENVIRONMENT, value);
+ text = MIXER_ENVIRONMENT;
+ break;
+ case MixerChannel.Music:
+ volumeMusic = value;
+ PlayerPrefs.SetFloat(AUDIO_MUSIC, value);
+ text = MIXER_MUSIC;
+ break;
+ case MixerChannel.SFX:
+ volumeSFX = value;
+ PlayerPrefs.SetFloat(AUDIO_SFX, value);
+ text = MIXER_SFX;
+ break;
+ case MixerChannel.Master:
+ volumeMaster = value;
+ PlayerPrefs.SetFloat(AUDIO_MASTER, value);
+ text = MIXER_MASTER;
+ break;
+ default:
+ text = MIXER_MASTER;
+ break;
+ }
+ mixer.SetFloat(text, PercentageToAudioLogarithmic(value));
+ }
+
+ public float GetAudioVolume(MixerChannel channel)
+ {
+ return channel switch
+ {
+ MixerChannel.Environment => volumeEnvironment,
+ MixerChannel.Music => volumeMusic,
+ MixerChannel.SFX => volumeSFX,
+ MixerChannel.Master => volumeMaster,
+ _ => volumeMaster,
+ };
+ }
+
+ public static float PercentageToAudioLogarithmic(float value)
+ {
+ if ((double)value < 0.0001)
+ {
+ value = 0.0001f;
+ }
+ if (value > 1f)
+ {
+ value = 1f;
+ }
+ value = Mathf.Log10(value) * 20f;
+ return value;
+ }
+
+ public void SetResetUnitsInTheMorning(bool value)
+ {
+ resetUnitFormationEveryMorning = value;
+ PlayerPrefs.SetInt(GAMEPLAY_RESET_UNIS_EVERY_MORNING, value ? 1 : 0);
+ }
+
+ public void SetWinterMode(bool value)
+ {
+ winterMode = value;
+ PlayerPrefs.SetInt(GAMEPLAY_WINTER_MODE, value ? 1 : 0);
+ ColorAndLightManager colorAndLightManager = Object.FindObjectOfType<ColorAndLightManager>();
+ if (colorAndLightManager != null)
+ {
+ colorAndLightManager.OnWinterModeToggle();
+ }
+ }
+
+ public void SetUseLargetInGameUI(bool value)
+ {
+ useLargeInGameUI = value;
+ PlayerPrefs.SetInt(GAMEPLAY_USE_LARGE_UI, value ? 1 : 0);
+ }
+
+ public static int AALevelToInt(MsaaQuality level)
+ {
+ return level switch
+ {
+ MsaaQuality.Disabled => 0,
+ MsaaQuality._2x => 1,
+ MsaaQuality._4x => 2,
+ MsaaQuality._8x => 3,
+ _ => 0,
+ };
+ }
+
+ public static MsaaQuality IntToAALevel(int i)
+ {
+ return i switch
+ {
+ 0 => MsaaQuality.Disabled,
+ 1 => MsaaQuality._2x,
+ 2 => MsaaQuality._4x,
+ 3 => MsaaQuality._8x,
+ _ => MsaaQuality.Disabled,
+ };
+ }
+
+ private void InitializeVideoSettingsToPlayerPrefs()
+ {
+ Resolution resolution = Screen.resolutions[Screen.resolutions.Length - 1];
+ PlayerPrefs.SetInt(VIDEO_RESOLUTION_WIDTH, resolution.width);
+ PlayerPrefs.SetInt(VIDEO_RESOLUTION_HEIGHT, resolution.height);
+ PlayerPrefs.SetInt(VIDEO_FULLSCREEN, 1);
+ PlayerPrefs.SetInt(VIDEO_VSYNC, 0);
+ PlayerPrefs.SetInt(VIDEO_POSTPROCESSING, 1);
+ PlayerPrefs.SetInt(VIDEO_ANTIALIASING, AALevelToInt(MsaaQuality._4x));
+ PlayerPrefs.SetFloat(VIDEO_RENDERSCALE, 1f);
+ PlayerPrefs.SetInt(VIDEO_INITIALIZED, 1);
+ }
+
+ private void LoadVideoSettingsFromPlayerPrefs()
+ {
+ if (PlayerPrefs.GetInt(VIDEO_INITIALIZED) == 0)
+ {
+ InitializeVideoSettingsToPlayerPrefs();
+ }
+ Resolution resolution = default(Resolution);
+ resolution.width = PlayerPrefs.GetInt(VIDEO_RESOLUTION_WIDTH);
+ resolution.height = PlayerPrefs.GetInt(VIDEO_RESOLUTION_HEIGHT);
+ fullscreen = PlayerPrefs.GetInt(VIDEO_FULLSCREEN) != 0;
+ vSync = PlayerPrefs.GetInt(VIDEO_VSYNC) != 0;
+ renderscale = PlayerPrefs.GetFloat(VIDEO_RENDERSCALE);
+ SetVSync(vSync);
+ SetResolution(resolution);
+ SetPostProcessing(PlayerPrefs.GetInt(VIDEO_POSTPROCESSING) != 0);
+ SetAntiAliasing(IntToAALevel(PlayerPrefs.GetInt(VIDEO_ANTIALIASING)));
+ SetRenderscale(renderscale);
+ }
+
+ private void InitializeAudioSettingsToPlayerPrefs()
+ {
+ PlayerPrefs.SetFloat(AUDIO_MASTER, 1f);
+ PlayerPrefs.SetFloat(AUDIO_MUSIC, 1f);
+ PlayerPrefs.SetFloat(AUDIO_SFX, 1f);
+ PlayerPrefs.SetFloat(AUDIO_ENVIRONMENT, 1f);
+ PlayerPrefs.SetInt(AUDIO_INITIALIZED, 1);
+ }
+
+ private void LoadAudioSettingsFromPlayerPrefs()
+ {
+ if (PlayerPrefs.GetInt(AUDIO_INITIALIZED) == 0)
+ {
+ InitializeAudioSettingsToPlayerPrefs();
+ }
+ volumeMaster = PlayerPrefs.GetFloat(AUDIO_MASTER);
+ volumeMusic = PlayerPrefs.GetFloat(AUDIO_MUSIC);
+ volumeSFX = PlayerPrefs.GetFloat(AUDIO_SFX);
+ volumeEnvironment = PlayerPrefs.GetFloat(AUDIO_ENVIRONMENT);
+ SetAudioValue(volumeMaster, MixerChannel.Master);
+ SetAudioValue(volumeMusic, MixerChannel.Music);
+ SetAudioValue(volumeEnvironment, MixerChannel.Environment);
+ SetAudioValue(volumeSFX, MixerChannel.SFX);
+ }
+
+ private void InitializeGameplaySettingsToPlayerPrefs()
+ {
+ PlayerPrefs.SetInt(GAMEPLAY_RESET_UNIS_EVERY_MORNING, 1);
+ PlayerPrefs.SetInt(GAMEPLAY_USE_LARGE_UI, 0);
+ PlayerPrefs.SetInt(GAMEPLAY_WINTER_MODE, 0);
+ PlayerPrefs.SetInt(GAMEPLAY_INITIALIZED, 1);
+ }
+
+ private void LoadGameplaySettingsFromPlayerPrefs()
+ {
+ if (PlayerPrefs.GetInt(GAMEPLAY_INITIALIZED) == 0)
+ {
+ InitializeGameplaySettingsToPlayerPrefs();
+ }
+ resetUnitFormationEveryMorning = PlayerPrefs.GetInt(GAMEPLAY_RESET_UNIS_EVERY_MORNING) != 0;
+ useLargeInGameUI = PlayerPrefs.GetInt(GAMEPLAY_USE_LARGE_UI) != 0;
+ winterMode = PlayerPrefs.GetInt(GAMEPLAY_WINTER_MODE) != 0;
+ }
+
+ public void ResetVideoSettings()
+ {
+ InitializeVideoSettingsToPlayerPrefs();
+ LoadVideoSettingsFromPlayerPrefs();
+ }
+
+ public void ResetAudioSettings()
+ {
+ InitializeAudioSettingsToPlayerPrefs();
+ LoadAudioSettingsFromPlayerPrefs();
+ }
+
+ public void ResetGameplaySettings()
+ {
+ InitializeGameplaySettingsToPlayerPrefs();
+ LoadGameplaySettingsFromPlayerPrefs();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsPostProcessing.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsPostProcessing.cs
new file mode 100644
index 0000000..18c1991
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsPostProcessing.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class SettingsPostProcessing : MonoBehaviour
+{
+ public Checkbox checkbox;
+
+ public void OnApply()
+ {
+ SettingsManager.Instance.SetPostProcessing(checkbox.state);
+ }
+
+ private void OnEnable()
+ {
+ if ((bool)SettingsManager.Instance)
+ {
+ checkbox.SetState(SettingsManager.Instance.PostProcessing);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsPostProcessingHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsPostProcessingHelper.cs
new file mode 100644
index 0000000..a255c32
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsPostProcessingHelper.cs
@@ -0,0 +1,18 @@
+using UnityEngine;
+using UnityEngine.Rendering;
+
+public class SettingsPostProcessingHelper : MonoBehaviour
+{
+ public Volume target;
+
+ private void Start()
+ {
+ Refresh();
+ SettingsManager.Instance.onPPSettingsChange.AddListener(Refresh);
+ }
+
+ private void Refresh()
+ {
+ target.enabled = SettingsManager.Instance.PostProcessing;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsRenderScale.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsRenderScale.cs
new file mode 100644
index 0000000..de1aa86
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsRenderScale.cs
@@ -0,0 +1,24 @@
+using UnityEngine;
+
+public class SettingsRenderScale : MonoBehaviour
+{
+ public TFUISlider target;
+
+ private void OnEnable()
+ {
+ if (SettingsManager.Instance != null)
+ {
+ target.SetValue(SettingsManager.Instance.Renderscale);
+ }
+ }
+
+ private void Start()
+ {
+ target.onChange.AddListener(OnChange);
+ }
+
+ private void OnChange()
+ {
+ SettingsManager.Instance.SetRenderscale(target.value);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsResetUnitsMorning.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsResetUnitsMorning.cs
new file mode 100644
index 0000000..ea05686
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsResetUnitsMorning.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class SettingsResetUnitsMorning : MonoBehaviour
+{
+ public Checkbox checkbox;
+
+ public void OnApply()
+ {
+ SettingsManager.Instance.SetResetUnitsInTheMorning(checkbox.state);
+ }
+
+ private void OnEnable()
+ {
+ if ((bool)SettingsManager.Instance)
+ {
+ checkbox.SetState(SettingsManager.Instance.ResetUnitFormationEveryMorning);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsResetVideo.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsResetVideo.cs
new file mode 100644
index 0000000..cd3bc2e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsResetVideo.cs
@@ -0,0 +1,13 @@
+using UnityEngine;
+
+public class SettingsResetVideo : MonoBehaviour
+{
+ public GameObject objToRefresh;
+
+ public void ResetVideoSettings()
+ {
+ SettingsManager.Instance.ResetVideoSettings();
+ objToRefresh.SetActive(value: false);
+ objToRefresh.SetActive(value: true);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsResolution.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsResolution.cs
new file mode 100644
index 0000000..2edfee6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsResolution.cs
@@ -0,0 +1,41 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class SettingsResolution : MonoBehaviour
+{
+ public EnumSelector selector;
+
+ private Dictionary<int, Resolution> availableResolutions = new Dictionary<int, Resolution>();
+
+ private void Start()
+ {
+ selector.onChange.AddListener(ApplyResolution);
+ }
+
+ private void OnEnable()
+ {
+ selector.options.Clear();
+ availableResolutions.Clear();
+ int index = 0;
+ for (int i = 0; i < Screen.resolutions.Length; i++)
+ {
+ Resolution resolution = Screen.resolutions[i];
+ availableResolutions.Add(i, resolution);
+ string item = resolution.width + " x " + resolution.height + " @ " + resolution.refreshRateRatio.value.ToString("F0") + "Hz";
+ selector.options.Add(item);
+ if (resolution.CompareResolutions(SettingsManager.Instance.CurrentResolution))
+ {
+ index = i;
+ }
+ }
+ selector.SetIndex(index);
+ }
+
+ private void ApplyResolution()
+ {
+ if (availableResolutions.TryGetValue(selector.Index, out var value) && !value.CompareResolutions(SettingsManager.Instance.CurrentResolution))
+ {
+ SettingsManager.Instance.SetResolution(value);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsShadowResolution.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsShadowResolution.cs
new file mode 100644
index 0000000..d8bb6cb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsShadowResolution.cs
@@ -0,0 +1,26 @@
+using UnityEngine;
+
+public class SettingsShadowResolution : MonoBehaviour
+{
+ public EnumSelector selector;
+
+ private void Start()
+ {
+ selector.onChange.AddListener(OnChange);
+ }
+
+ private void OnEnable()
+ {
+ selector.options.Clear();
+ selector.options.AddRange(new string[5] { "256", "512", "1024", "2048", "4096" });
+ if ((bool)SettingsManager.Instance)
+ {
+ selector.SetIndex(SettingsManager.AALevelToInt(SettingsManager.Instance.AntiAliasing));
+ }
+ }
+
+ private void OnChange()
+ {
+ SettingsManager.Instance.SetAntiAliasing(SettingsManager.IntToAALevel(selector.Index));
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsUIHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsUIHelper.cs
new file mode 100644
index 0000000..1aa6e2b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsUIHelper.cs
@@ -0,0 +1,122 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class SettingsUIHelper : MonoBehaviour
+{
+ [Serializable]
+ public class SettingsTab
+ {
+ public TFUITextButton parentElement;
+
+ public GameObject contentParent;
+
+ public VerticalLayoutGroup childContainer;
+
+ public bool disableNavigationProcessing;
+
+ public void ComputeNavigationForSettingsTab()
+ {
+ if (disableNavigationProcessing)
+ {
+ return;
+ }
+ List<ThronefallUIElement> list = new List<ThronefallUIElement>();
+ foreach (Transform item in childContainer.transform)
+ {
+ list.Add(item.GetComponent<ThronefallUIElement>());
+ }
+ parentElement.botNav = list[0];
+ parentElement.topNav = list[list.Count - 1];
+ for (int i = 0; i < list.Count; i++)
+ {
+ ThronefallUIElement thronefallUIElement = list[i];
+ if (i == 0)
+ {
+ thronefallUIElement.topNav = parentElement;
+ }
+ else
+ {
+ thronefallUIElement.topNav = list[i - 1];
+ }
+ if (i == list.Count - 1)
+ {
+ thronefallUIElement.botNav = parentElement;
+ }
+ else
+ {
+ thronefallUIElement.botNav = list[i + 1];
+ }
+ }
+ }
+ }
+
+ public UIFrame targetFrame;
+
+ public SettingsTab videoTab;
+
+ public SettingsTab audioTab;
+
+ public SettingsTab gameplayTab;
+
+ public SettingsTab controlsTab;
+
+ public GameObject dimBG;
+
+ private SettingsTab currentSelectedTab;
+
+ private Dictionary<ThronefallUIElement, SettingsTab> allTabs = new Dictionary<ThronefallUIElement, SettingsTab>();
+
+ private void Awake()
+ {
+ allTabs.Add(videoTab.parentElement, videoTab);
+ allTabs.Add(audioTab.parentElement, audioTab);
+ allTabs.Add(gameplayTab.parentElement, gameplayTab);
+ allTabs.Add(controlsTab.parentElement, controlsTab);
+ videoTab.contentParent.SetActive(value: false);
+ audioTab.contentParent.SetActive(value: false);
+ gameplayTab.contentParent.SetActive(value: false);
+ controlsTab.contentParent.SetActive(value: false);
+ RecomputeAllNavigation();
+ }
+
+ private void RecomputeAllNavigation()
+ {
+ videoTab.ComputeNavigationForSettingsTab();
+ audioTab.ComputeNavigationForSettingsTab();
+ gameplayTab.ComputeNavigationForSettingsTab();
+ controlsTab.ComputeNavigationForSettingsTab();
+ }
+
+ public void OnShow()
+ {
+ if (SceneTransitionManager.instance.CurrentSceneState == SceneTransitionManager.SceneState.MainMenu)
+ {
+ dimBG.SetActive(value: false);
+ }
+ else
+ {
+ dimBG.SetActive(value: true);
+ }
+ }
+
+ public void OnSelect()
+ {
+ SettingsTab value = null;
+ if (allTabs.TryGetValue(targetFrame.CurrentSelection, out value))
+ {
+ if (currentSelectedTab != null)
+ {
+ currentSelectedTab.contentParent.SetActive(value: false);
+ currentSelectedTab.parentElement.applyOverrideStyle = false;
+ }
+ currentSelectedTab = value;
+ currentSelectedTab.contentParent.SetActive(value: true);
+ }
+ else if (currentSelectedTab != null)
+ {
+ currentSelectedTab.parentElement.applyOverrideStyle = true;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsUseLargeUI.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsUseLargeUI.cs
new file mode 100644
index 0000000..c7d4d22
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsUseLargeUI.cs
@@ -0,0 +1,22 @@
+using UnityEngine;
+
+public class SettingsUseLargeUI : MonoBehaviour
+{
+ public Checkbox checkbox;
+
+ public UIScaleHandler uiScaleHandler;
+
+ public void OnApply()
+ {
+ SettingsManager.Instance.SetUseLargetInGameUI(checkbox.state);
+ uiScaleHandler.Refresh();
+ }
+
+ private void OnEnable()
+ {
+ if ((bool)SettingsManager.Instance)
+ {
+ checkbox.SetState(SettingsManager.Instance.UseLargeInGameUI);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsVsync.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsVsync.cs
new file mode 100644
index 0000000..10e5f34
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsVsync.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class SettingsVsync : MonoBehaviour
+{
+ public Checkbox checkbox;
+
+ public void OnApply()
+ {
+ SettingsManager.Instance.SetVSync(checkbox.state);
+ }
+
+ private void OnEnable()
+ {
+ if ((bool)SettingsManager.Instance)
+ {
+ checkbox.SetState(SettingsManager.Instance.VSync);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SettingsWinterMode.cs b/Thronefall_v1.57/Thronefall/Thronefall/SettingsWinterMode.cs
new file mode 100644
index 0000000..80133dd
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SettingsWinterMode.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class SettingsWinterMode : MonoBehaviour
+{
+ public Checkbox checkbox;
+
+ public void OnApply()
+ {
+ SettingsManager.Instance.SetWinterMode(checkbox.state);
+ }
+
+ private void OnEnable()
+ {
+ if ((bool)SettingsManager.Instance)
+ {
+ checkbox.SetState(SettingsManager.Instance.WinterMode);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ShapeGroupFader.cs b/Thronefall_v1.57/Thronefall/Thronefall/ShapeGroupFader.cs
new file mode 100644
index 0000000..e1caf48
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ShapeGroupFader.cs
@@ -0,0 +1,31 @@
+using Shapes;
+using UnityEngine;
+
+public class ShapeGroupFader : MonoBehaviour
+{
+ public ShapeGroup target;
+
+ public float fadeTime = 1f;
+
+ public AnimationCurve fadeCurve;
+
+ private Color groupColor = Color.white;
+
+ private float clock;
+
+ private bool running = true;
+
+ private void Update()
+ {
+ if (running)
+ {
+ clock += Time.deltaTime;
+ groupColor.a = fadeCurve.Evaluate(Mathf.InverseLerp(0f, fadeTime, clock));
+ target.Color = groupColor;
+ if (clock >= fadeTime)
+ {
+ running = false;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SharpCornerMidigator.cs b/Thronefall_v1.57/Thronefall/Thronefall/SharpCornerMidigator.cs
new file mode 100644
index 0000000..66500db
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SharpCornerMidigator.cs
@@ -0,0 +1,46 @@
+using System.Collections.Generic;
+using Pathfinding;
+using UnityEngine;
+
+public class SharpCornerMidigator : MonoModifier
+{
+ public float extendCorners = 2f;
+
+ private List<Vector3> path;
+
+ private Vector3 pathPointLast;
+
+ private Vector2 toLastPoint;
+
+ private Vector2 toNextPoint;
+
+ private float angle;
+
+ private Vector2 normal2d;
+
+ private float strngth;
+
+ private Vector3 normal;
+
+ public override int Order => 100;
+
+ public override void Apply(Path _p)
+ {
+ if (_p.path != null && _p.path.Count != 0 && _p.vectorPath != null && _p.vectorPath.Count != 0)
+ {
+ path = _p.vectorPath;
+ pathPointLast = path[0];
+ for (int i = 1; i < path.Count - 1; i++)
+ {
+ toLastPoint = new Vector2(pathPointLast.x, pathPointLast.z) - new Vector2(path[i].x, path[i].z);
+ toNextPoint = new Vector2(path[i + 1].x, path[i + 1].z) - new Vector2(path[i].x, path[i].z);
+ angle = Vector2.Angle(toLastPoint, toNextPoint);
+ normal2d = -(toLastPoint.normalized + toNextPoint.normalized).normalized;
+ strngth = (180f - angle) / 180f;
+ normal = new Vector3(normal2d.x, 0f, normal2d.y);
+ pathPointLast = path[i];
+ path[i] += normal * strngth * extendCorners;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ShieldOnFirstDamaged.cs b/Thronefall_v1.57/Thronefall/Thronefall/ShieldOnFirstDamaged.cs
new file mode 100644
index 0000000..5bde293
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ShieldOnFirstDamaged.cs
@@ -0,0 +1,86 @@
+using UnityEngine;
+
+public class ShieldOnFirstDamaged : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ [SerializeField]
+ private Hp hpToShield;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float shieldDuration;
+
+ [SerializeField]
+ private GameObject shieldVisuals;
+
+ private float shiledHasBeenActiveFor;
+
+ private bool shieldActive;
+
+ private bool shieldAvailable;
+
+ private void Reset()
+ {
+ shieldActive = false;
+ shieldAvailable = true;
+ shiledHasBeenActiveFor = 0f;
+ SetShieldVisuals(_enabled: false);
+ }
+
+ private void Update()
+ {
+ if (shieldActive)
+ {
+ shiledHasBeenActiveFor += Time.deltaTime;
+ if (shiledHasBeenActiveFor >= shieldDuration)
+ {
+ shieldActive = false;
+ shieldAvailable = false;
+ hpToShield.invulnerable = false;
+ SetShieldVisuals(_enabled: false);
+ }
+ }
+ }
+
+ private void Start()
+ {
+ Reset();
+ hpToShield.OnReceiveDamage.AddListener(OnDamaged);
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ }
+
+ private void OnDamaged(bool dealtByPlayer)
+ {
+ if (shieldActive || shieldAvailable)
+ {
+ if (!shieldActive)
+ {
+ SetShieldVisuals(_enabled: true);
+ }
+ hpToShield.SetHpToMaxHp();
+ hpToShield.invulnerable = true;
+ shieldActive = true;
+ }
+ }
+
+ private void SetShieldVisuals(bool _enabled)
+ {
+ shieldVisuals.SetActive(_enabled);
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ Reset();
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public void OnDusk()
+ {
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Shrine.cs b/Thronefall_v1.57/Thronefall/Thronefall/Shrine.cs
new file mode 100644
index 0000000..581bd45
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Shrine.cs
@@ -0,0 +1,208 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class Shrine : MonoBehaviour, ISaveLoad
+{
+ public static TagManager tagManager;
+
+ private static List<TaggedObject> shrinesFound = new List<TaggedObject>();
+
+ private static List<TaggedObject> shrinesFoundB = new List<TaggedObject>();
+
+ private static List<TagManager.ETag> mustHaveTags = new List<TagManager.ETag>();
+
+ private static List<TagManager.ETag> mayNotHaveTags = new List<TagManager.ETag>();
+
+ [SerializeField]
+ private ProductionBar productionBar;
+
+ private float currentXp;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float maxXp = 1000f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float collectionRange = 10f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private int incomeOnceUnlocked = 2;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ private float strengthBonusOnAdditionalShrine = 1.2f;
+
+ [SerializeField]
+ private List<GameObject> disableOnComplete;
+
+ [SerializeField]
+ private List<GameObject> enableOnComplete;
+
+ [SerializeField]
+ private BuildSlot parentBuildSlot;
+
+ [SerializeField]
+ private Mesh replacementMesh;
+
+ [SerializeField]
+ private ParticleSystem upgradeParticles;
+
+ [SerializeField]
+ private ParticleSystem levelParticle;
+
+ private bool shrineHasBeenActivated;
+
+ public float CollectionRange => collectionRange;
+
+ public bool ShrineHasBeenActivated => shrineHasBeenActivated;
+
+ private void Start()
+ {
+ MakeProgressAndUpdateBar();
+ }
+
+ public void AdjustRequiredXp(float _multi)
+ {
+ maxXp *= _multi;
+ MakeProgressAndUpdateBar();
+ }
+
+ public void MakeProgressAndUpdateBar(float _xpGain = 0f)
+ {
+ if (!shrineHasBeenActivated)
+ {
+ currentXp += _xpGain;
+ levelParticle.Play();
+ if (currentXp >= maxXp)
+ {
+ ActivateShrine(_calledFromSaveLoad: false);
+ }
+ else
+ {
+ productionBar.UpdateVisual(currentXp / maxXp + 0.001f);
+ }
+ }
+ }
+
+ [ContextMenu("ACTIVATE")]
+ private void DebugActivate()
+ {
+ ActivateShrine(_calledFromSaveLoad: false);
+ }
+
+ private void ActivateShrine(bool _calledFromSaveLoad)
+ {
+ if (shrineHasBeenActivated && !_calledFromSaveLoad)
+ {
+ return;
+ }
+ if (tagManager == null)
+ {
+ tagManager = TagManager.instance;
+ }
+ upgradeParticles.Play();
+ foreach (GameObject item in disableOnComplete)
+ {
+ item.SetActive(value: false);
+ }
+ foreach (GameObject item2 in enableOnComplete)
+ {
+ item2.SetActive(value: true);
+ }
+ GetComponentInParent<BuildSlot>().GoldIncome += incomeOnceUnlocked;
+ parentBuildSlot.ReplaceMeshExternal(replacementMesh);
+ shrineHasBeenActivated = true;
+ if (mustHaveTags.Count != 1 || !tagManager)
+ {
+ tagManager = TagManager.instance;
+ mustHaveTags.Clear();
+ mustHaveTags.Add(TagManager.ETag.PlayerShrine);
+ mayNotHaveTags.Clear();
+ }
+ tagManager.FindAllTaggedObjectsWithTags(shrinesFoundB, mustHaveTags, mayNotHaveTags);
+ if (!_calledFromSaveLoad)
+ {
+ foreach (TaggedObject item3 in shrinesFoundB)
+ {
+ Shrine component = item3.GetComponent<Shrine>();
+ if (!(component == this) && component.ShrineHasBeenActivated)
+ {
+ UpgradeMyPower();
+ component.UpgradeMyPower();
+ }
+ }
+ return;
+ }
+ foreach (TaggedObject item4 in shrinesFoundB)
+ {
+ Shrine component2 = item4.GetComponent<Shrine>();
+ if (!(component2 == this) && component2.ShrineHasBeenActivated)
+ {
+ UpgradeMyPower();
+ }
+ }
+ }
+
+ public static void DeathOfUnitAt(Vector3 _position, float _unitsOriginalHealth)
+ {
+ if (!tagManager)
+ {
+ tagManager = TagManager.instance;
+ mustHaveTags.Clear();
+ mustHaveTags.Add(TagManager.ETag.PlayerShrine);
+ mayNotHaveTags.Clear();
+ }
+ tagManager.FindAllTaggedObjectsWithTags(shrinesFound, mustHaveTags, mayNotHaveTags);
+ foreach (TaggedObject item in shrinesFound)
+ {
+ Shrine shrine = item.Shrine;
+ if ((_position - shrine.transform.position).magnitude <= shrine.collectionRange)
+ {
+ shrine.MakeProgressAndUpdateBar(_unitsOriginalHealth);
+ }
+ }
+ }
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnSave(string guid)
+ {
+ MatchSaveLoadHandler.SaveValue(guid, "currentXp", currentXp);
+ MatchSaveLoadHandler.SaveValue(guid, "shrineHasBeenActivated", shrineHasBeenActivated);
+ }
+
+ public void OnLoad(string guid)
+ {
+ MatchSaveLoadHandler.TryLoadValue(guid, "currentXp", ref currentXp);
+ MatchSaveLoadHandler.TryLoadValue(guid, "shrineHasBeenActivated", ref shrineHasBeenActivated);
+ if (shrineHasBeenActivated)
+ {
+ StartCoroutine(ActivateShrineDelayedInSaveLoad());
+ }
+ }
+
+ private IEnumerator ActivateShrineDelayedInSaveLoad()
+ {
+ yield return null;
+ yield return null;
+ ActivateShrine(_calledFromSaveLoad: true);
+ }
+
+ public void UpgradeMyPower()
+ {
+ AutoAttack[] componentsInChildren = GetComponentsInChildren<AutoAttack>();
+ for (int i = 0; i < componentsInChildren.Length; i++)
+ {
+ componentsInChildren[i].DamageMultiplyer *= strengthBonusOnAdditionalShrine;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SimpleRotator.cs b/Thronefall_v1.57/Thronefall/Thronefall/SimpleRotator.cs
new file mode 100644
index 0000000..aa2d0b4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SimpleRotator.cs
@@ -0,0 +1,23 @@
+using UnityEngine;
+
+public class SimpleRotator : MonoBehaviour
+{
+ public Vector3 rotationDelta;
+
+ public Space relativeTo;
+
+ public bool randomYRotationOnEnable;
+
+ private void OnEnable()
+ {
+ if (randomYRotationOnEnable)
+ {
+ base.transform.Rotate(Vector3.up * Random.value * 360f, Space.World);
+ }
+ }
+
+ private void Update()
+ {
+ base.transform.Rotate(rotationDelta * Time.deltaTime, relativeTo);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SimpleUIScaler.cs b/Thronefall_v1.57/Thronefall/Thronefall/SimpleUIScaler.cs
new file mode 100644
index 0000000..348433a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SimpleUIScaler.cs
@@ -0,0 +1,43 @@
+using UnityEngine;
+
+public class SimpleUIScaler : MonoBehaviour
+{
+ public bool offsetPositionWhenLarge;
+
+ public Vector2 offset;
+
+ private Vector2 ogPosition;
+
+ private bool ogPositionBuffered;
+
+ private RectTransform bufferedRT;
+
+ private void OnEnable()
+ {
+ if (offsetPositionWhenLarge)
+ {
+ bufferedRT = GetComponent<RectTransform>();
+ if (!ogPositionBuffered)
+ {
+ ogPosition = bufferedRT.anchoredPosition;
+ ogPositionBuffered = true;
+ }
+ }
+ if (SettingsManager.Instance.UseLargeInGameUI)
+ {
+ if (offsetPositionWhenLarge)
+ {
+ bufferedRT.anchoredPosition = ogPosition + offset;
+ }
+ base.transform.localScale = Vector3.one * 1.5f;
+ }
+ else
+ {
+ if (offsetPositionWhenLarge)
+ {
+ bufferedRT.anchoredPosition = ogPosition;
+ }
+ base.transform.localScale = Vector3.one;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SimpleWalk.cs b/Thronefall_v1.57/Thronefall/Thronefall/SimpleWalk.cs
new file mode 100644
index 0000000..b6c7e54
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SimpleWalk.cs
@@ -0,0 +1,55 @@
+using Pathfinding.RVO;
+using UnityEngine;
+using UnityEngine.Events;
+
+public class SimpleWalk : MonoBehaviour
+{
+ public RVOController rvo;
+
+ public Transform animationRoot;
+
+ public float bounceHeight = 0.5f;
+
+ public AnimationCurve bounceCurve;
+
+ public float bounceSpeed = 1f;
+
+ private float bounceClock;
+
+ private float clockDelta;
+
+ private float velocitySqrtDeadzone = 0.15f;
+
+ [HideInInspector]
+ public UnityEvent onGroundContact = new UnityEvent();
+
+ private float lastGroundContactTimeStamp;
+
+ private Vector3 initialRootPos;
+
+ private void Start()
+ {
+ initialRootPos = animationRoot.localPosition;
+ bounceClock = Random.value;
+ }
+
+ private void Update()
+ {
+ if (rvo.velocity.sqrMagnitude > velocitySqrtDeadzone)
+ {
+ clockDelta = Time.deltaTime * bounceSpeed;
+ bounceClock += clockDelta;
+ animationRoot.transform.localPosition = Vector3.Lerp(initialRootPos, initialRootPos + Vector3.up * bounceHeight, bounceCurve.Evaluate(bounceClock));
+ if (bounceClock % 1f <= clockDelta && Mathf.Abs(bounceClock - lastGroundContactTimeStamp) > 0.5f)
+ {
+ lastGroundContactTimeStamp = bounceClock;
+ onGroundContact.Invoke();
+ }
+ }
+ else
+ {
+ animationRoot.transform.localPosition = initialRootPos;
+ bounceClock = 0f;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SizeRectangleToMeshBounds.cs b/Thronefall_v1.57/Thronefall/Thronefall/SizeRectangleToMeshBounds.cs
new file mode 100644
index 0000000..8962f24
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SizeRectangleToMeshBounds.cs
@@ -0,0 +1,20 @@
+using Shapes;
+using UnityEngine;
+
+[RequireComponent(typeof(Rectangle))]
+public class SizeRectangleToMeshBounds : MonoBehaviour
+{
+ public float xMargin = 1f;
+
+ public float yMargin = 1f;
+
+ public MeshFilter meshFilter;
+
+ [ContextMenu("RESIZE")]
+ private void OnEnable()
+ {
+ Rectangle component = GetComponent<Rectangle>();
+ component.Height = meshFilter.sharedMesh.bounds.size.y + 2f * yMargin;
+ component.Width = meshFilter.sharedMesh.bounds.size.x + 2f * xMargin;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SlowEffect.cs b/Thronefall_v1.57/Thronefall/Thronefall/SlowEffect.cs
new file mode 100644
index 0000000..276edd5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SlowEffect.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "Slow Effect", menuName = "SimpleSiege/Slow Effect")]
+public class SlowEffect : AdditionalWeaponEffectScript
+{
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Percentage)]
+ private float slowDuration = 2f;
+
+ public override void Effect(Hp _hpHit, TaggedObject _attacked, TaggedObject _attacker, Weapon _weapon, float _damageMultiplyer)
+ {
+ if ((bool)_hpHit.PathfindMovement)
+ {
+ _hpHit.PathfindMovement.Slow(slowDuration);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Spawn.cs b/Thronefall_v1.57/Thronefall/Thronefall/Spawn.cs
new file mode 100644
index 0000000..0644786
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Spawn.cs
@@ -0,0 +1,265 @@
+using System;
+using UnityEngine;
+
+[Serializable]
+public class Spawn
+{
+ public float delay;
+
+ public GameObject enemyPrefab;
+
+ public bool eliteEnemies;
+
+ public int count;
+
+ public float interval;
+
+ public Transform spawnLine;
+
+ public int goldCoins;
+
+ private int[] goldCoinsPerEnemy;
+
+ [HideInInspector]
+ public float waitBeforeNextSpawn;
+
+ private int spawnedUnits;
+
+ private bool finished;
+
+ private bool tauntTheTiger;
+
+ private bool tauntTheTurtle;
+
+ private bool tauntTheFalcon;
+
+ private bool antiAirTelescope;
+
+ private bool prayToWarGods;
+
+ private bool tauntTheGrowth;
+
+ private bool tauntTheRange;
+
+ private float addDmgGrowthDiffPerWave;
+
+ private float addHpGrowthDiffPerWave;
+
+ private Hp hpTemp;
+
+ public int SpawnedUnits => spawnedUnits;
+
+ public bool Finished => finished;
+
+ public Spawn()
+ {
+ }
+
+ public Spawn(GameObject _enemyPrefab, Transform _spawnLine, int _count = 1, float _interval = 0.5f, int _goldCoins = 0, float _delay = 0f, bool _eliteEnemies = false)
+ {
+ enemyPrefab = _enemyPrefab;
+ spawnLine = _spawnLine;
+ count = _count;
+ interval = _interval;
+ goldCoins = _goldCoins;
+ delay = _delay;
+ eliteEnemies = _eliteEnemies;
+ }
+
+ public void Reset(bool _resetGold = true)
+ {
+ tauntTheTiger = PerkManager.IsEquipped(PerkManager.instance.tigerGodPerk);
+ tauntTheTurtle = PerkManager.IsEquipped(PerkManager.instance.turtleGodPerk);
+ tauntTheFalcon = PerkManager.IsEquipped(PerkManager.instance.falconGodPerk);
+ antiAirTelescope = PerkManager.IsEquipped(PerkManager.instance.antiAirTelescope);
+ prayToWarGods = PerkManager.IsEquipped(PerkManager.instance.prayToWarGods);
+ tauntTheGrowth = PerkManager.instance.GrowthGodEquipped;
+ tauntTheRange = PerkManager.instance.RangeGodEquipped;
+ addDmgGrowthDiffPerWave = Mathf.Pow(PerkManager.instance.growthGodMaxDamageMulti, 1f / (float)Mathf.Max(1, EnemySpawner.instance.WaveCount - 1));
+ addHpGrowthDiffPerWave = Mathf.Pow(PerkManager.instance.growthGodMaxHpMulti, 1f / (float)Mathf.Max(1, EnemySpawner.instance.WaveCount - 1));
+ waitBeforeNextSpawn = delay;
+ spawnedUnits = 0;
+ finished = false;
+ goldCoinsPerEnemy = new int[count];
+ int num = goldCoins;
+ for (int i = 0; i < num; i++)
+ {
+ goldCoinsPerEnemy[UnityEngine.Random.Range(0, goldCoinsPerEnemy.Length)] = 0;
+ }
+ if (_resetGold)
+ {
+ for (int j = 0; j < num; j++)
+ {
+ goldCoinsPerEnemy[UnityEngine.Random.Range(0, goldCoinsPerEnemy.Length)]++;
+ }
+ }
+ }
+
+ public void Update()
+ {
+ if (finished)
+ {
+ return;
+ }
+ waitBeforeNextSpawn -= Time.deltaTime;
+ if (waitBeforeNextSpawn > 0f)
+ {
+ return;
+ }
+ waitBeforeNextSpawn = interval;
+ Vector3 randomPointOnSpawnLine = GetRandomPointOnSpawnLine(enemyPrefab.GetComponentInChildren<TaggedObject>().Tags.Contains(TagManager.ETag.Flying));
+ GameObject gameObject;
+ TaggedObject taggedObject;
+ if (enemyPrefab.scene.isLoaded)
+ {
+ gameObject = enemyPrefab;
+ taggedObject = enemyPrefab.GetComponentInChildren<TaggedObject>();
+ gameObject.SetActive(value: true);
+ }
+ else
+ {
+ gameObject = UnityEngine.Object.Instantiate(enemyPrefab, randomPointOnSpawnLine, Quaternion.identity);
+ taggedObject = gameObject.GetComponent<TaggedObject>();
+ EnemySpawnManager instance = EnemySpawnManager.instance;
+ if ((bool)instance.weaponOnSpawn)
+ {
+ instance.weaponOnSpawn.Attack(randomPointOnSpawnLine + Vector3.up * instance.weaponAttackHeight, null, Vector3.forward, taggedObject);
+ }
+ }
+ if (goldCoinsPerEnemy.Length > spawnedUnits)
+ {
+ gameObject.GetComponentInChildren<Hp>().coinCount = goldCoinsPerEnemy[spawnedUnits];
+ }
+ float num = 1f;
+ float num2 = 1f;
+ float num3 = 1f;
+ float num4 = 1f;
+ float num5 = 1f;
+ float num6 = 1f;
+ if (eliteEnemies)
+ {
+ num *= 4f;
+ num2 *= 3f;
+ MeshRenderer[] componentsInChildren = gameObject.GetComponentsInChildren<MeshRenderer>();
+ foreach (MeshRenderer meshRenderer in componentsInChildren)
+ {
+ if (meshRenderer.sharedMaterial.name == "Enemy")
+ {
+ meshRenderer.sharedMaterial = ColorAndLightManager.EliteEnemyMaterial;
+ }
+ }
+ }
+ if (tauntTheTurtle)
+ {
+ num *= PerkManager.instance.tauntTheTurtle_hpMultiplyer;
+ }
+ if (tauntTheTiger)
+ {
+ num2 *= PerkManager.instance.tauntTheTiger_damageMultiplyer;
+ }
+ if (tauntTheFalcon)
+ {
+ num4 *= PerkManager.instance.tauntTheFalcon_speedMultiplyer;
+ num5 *= PerkManager.instance.tauntTheFalcon_chasePlayerTimeMultiplyer;
+ }
+ if (antiAirTelescope && taggedObject.Tags.Contains(TagManager.ETag.Flying))
+ {
+ num *= PerkManager.instance.antiAir_helathMultiplyer;
+ num2 *= PerkManager.instance.antiAir_damageMultiplyer;
+ }
+ if (prayToWarGods)
+ {
+ num2 *= PerkManager.instance.prayWarGods_dmgMulti;
+ num *= PerkManager.instance.prayWarGods_hpMulti;
+ }
+ if (tauntTheGrowth)
+ {
+ num2 *= Mathf.Pow(addDmgGrowthDiffPerWave, EnemySpawner.instance.Wavenumber);
+ num *= Mathf.Pow(addHpGrowthDiffPerWave, EnemySpawner.instance.Wavenumber);
+ }
+ if (tauntTheRange && taggedObject.Tags.Contains(TagManager.ETag.RangedFighter) && !taggedObject.Tags.Contains(TagManager.ETag.Flying))
+ {
+ num *= PerkManager.instance.rangeGodHealthMultiplyer;
+ num2 *= PerkManager.instance.rangeGodDamageMultiplyer;
+ num3 *= PerkManager.instance.rangeGodAttackCooldownMultiplyer;
+ num4 *= PerkManager.instance.rangeGodMoveSpeedMultiplyer;
+ num6 *= PerkManager.instance.rangeGodRangeMultiplyer;
+ }
+ Hp componentInChildren = gameObject.GetComponentInChildren<Hp>();
+ componentInChildren.HpOriginal = componentInChildren.maxHp;
+ if (num != 1f && componentInChildren != null)
+ {
+ componentInChildren.maxHp *= num;
+ componentInChildren.SetHpToMaxHp();
+ }
+ if (num2 != 1f || num3 != 1f || num6 != 1f)
+ {
+ AutoAttack[] componentsInChildren2 = gameObject.GetComponentsInChildren<AutoAttack>();
+ foreach (AutoAttack autoAttack in componentsInChildren2)
+ {
+ autoAttack.DamageMultiplyer *= num2;
+ autoAttack.cooldownDuration *= num3;
+ if (num6 == 1f)
+ {
+ continue;
+ }
+ foreach (TargetPriority targetPriority in autoAttack.targetPriorities)
+ {
+ targetPriority.range *= num6;
+ }
+ }
+ }
+ if (num4 != 1f || num5 != 1f || num6 != 1f)
+ {
+ PathfindMovementEnemy[] componentsInChildren3 = gameObject.GetComponentsInChildren<PathfindMovementEnemy>();
+ foreach (PathfindMovementEnemy obj in componentsInChildren3)
+ {
+ obj.movementSpeed *= num4;
+ obj.agroTimeWhenAttackedByPlayer *= num5;
+ obj.keepDistanceOf *= num6;
+ }
+ }
+ spawnedUnits++;
+ if (spawnedUnits >= count)
+ {
+ finished = true;
+ }
+ }
+
+ public Vector3 GetRandomPointOnSpawnLine(bool flying)
+ {
+ float num = GetTotalSpawnLineLength() * UnityEngine.Random.value;
+ Vector3 vector = (flying ? (Vector3.up * 5f) : Vector3.zero);
+ float num2 = 0f;
+ for (int i = 0; i < spawnLine.childCount - 1; i++)
+ {
+ float magnitude = (spawnLine.GetChild(i).position - spawnLine.GetChild(i + 1).position).magnitude;
+ if (magnitude != 0f)
+ {
+ if (magnitude + num2 >= num)
+ {
+ num -= num2;
+ float t = num / magnitude;
+ Vector3 vector2 = Vector3.Lerp(spawnLine.GetChild(i).position, spawnLine.GetChild(i + 1).position, t);
+ return AstarPath.active.GetNearest(vector2 + vector).position;
+ }
+ num2 += magnitude;
+ }
+ }
+ if (spawnLine.childCount > 0)
+ {
+ return AstarPath.active.GetNearest(spawnLine.GetChild(0).position + vector).position;
+ }
+ return AstarPath.active.GetNearest(spawnLine.position + vector).position;
+ }
+
+ public float GetTotalSpawnLineLength()
+ {
+ float num = 0f;
+ for (int i = 0; i < spawnLine.childCount - 1; i++)
+ {
+ num += (spawnLine.GetChild(i).position - spawnLine.GetChild(i + 1).position).magnitude;
+ }
+ return num;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SpawnAttackAfter.cs b/Thronefall_v1.57/Thronefall/Thronefall/SpawnAttackAfter.cs
new file mode 100644
index 0000000..804804d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SpawnAttackAfter.cs
@@ -0,0 +1,67 @@
+using Shapes;
+using UnityEngine;
+
+public class SpawnAttackAfter : MonoBehaviour
+{
+ [SerializeField]
+ private Weapon spwanAttackOnDeath;
+
+ [SerializeField]
+ private float delay;
+
+ [SerializeField]
+ private Disc disc;
+
+ public ThronefallAudioManager.AudioOneShot sound;
+
+ [SerializeField]
+ private bool isPlayerAttack;
+
+ public float damageMultiplyer = 1f;
+
+ private float startRadius;
+
+ private float startDelay;
+
+ public Weapon SpwanAttackOnDeath
+ {
+ get
+ {
+ return spwanAttackOnDeath;
+ }
+ set
+ {
+ spwanAttackOnDeath = value;
+ }
+ }
+
+ private TaggedObject taggedObject { get; set; }
+
+ private void Start()
+ {
+ startRadius = disc.Radius;
+ startDelay = delay;
+ ThronefallAudioManager.WorldSpaceOneShot(sound, base.transform.position);
+ if (isPlayerAttack)
+ {
+ damageMultiplyer *= PlayerUpgradeManager.instance.PlayerDamageMultiplyer;
+ }
+ }
+
+ private void Update()
+ {
+ delay -= Time.deltaTime;
+ if (delay <= 0f)
+ {
+ if ((bool)spwanAttackOnDeath)
+ {
+ spwanAttackOnDeath.Attack(base.transform.position, null, Vector3.zero, taggedObject, damageMultiplyer);
+ }
+ Object.Destroy(base.gameObject);
+ }
+ else
+ {
+ disc.Radius = Mathf.Lerp(startRadius, 0f, delay / startDelay);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SpawnMA.cs b/Thronefall_v1.57/Thronefall/Thronefall/SpawnMA.cs
new file mode 100644
index 0000000..7cb62c0
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SpawnMA.cs
@@ -0,0 +1,15 @@
+using UnityEngine;
+
+public class SpawnMA : ManualAttack
+{
+ [SerializeField]
+ private GameObject spawnHere;
+
+ public override void Attack()
+ {
+ if ((bool)spawnHere)
+ {
+ Object.Instantiate(spawnHere, base.transform.position, spawnHere.transform.rotation);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SpinAnimation.cs b/Thronefall_v1.57/Thronefall/Thronefall/SpinAnimation.cs
new file mode 100644
index 0000000..6a4334b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SpinAnimation.cs
@@ -0,0 +1,45 @@
+using System.Collections;
+using UnityEngine;
+
+public class SpinAnimation : OneShotAnimationBase
+{
+ public AnimationCurve curve;
+
+ public float duration = 0.75f;
+
+ public Vector3 spinRotation;
+
+ public Transform transformToAnimate;
+
+ private Quaternion initialRotation;
+
+ private Quaternion targetRotation;
+
+ private void Start()
+ {
+ initialRotation = transformToAnimate.localRotation;
+ targetRotation = Quaternion.Euler(spinRotation.x, spinRotation.y, spinRotation.z);
+ }
+
+ private IEnumerator Animate()
+ {
+ transformToAnimate.localRotation = initialRotation;
+ float timer = 0f;
+ while (timer < duration)
+ {
+ transformToAnimate.localRotation = Quaternion.Euler(initialRotation.eulerAngles + spinRotation * (timer / duration));
+ timer += Time.deltaTime;
+ yield return null;
+ }
+ transformToAnimate.localRotation = initialRotation;
+ }
+
+ public override void Trigger()
+ {
+ if (base.gameObject.activeInHierarchy)
+ {
+ StopAllCoroutines();
+ StartCoroutine(Animate());
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SplashDamageArea.cs b/Thronefall_v1.57/Thronefall/Thronefall/SplashDamageArea.cs
new file mode 100644
index 0000000..84a27a9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SplashDamageArea.cs
@@ -0,0 +1,51 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class SplashDamageArea : MonoBehaviour
+{
+ public enum EShape
+ {
+ Sphere,
+ Box
+ }
+
+ public EShape shape;
+
+ public Vector3 boxSize;
+
+ public float sphereRadius;
+
+ public LayerMask layerMaskRecieveDamage;
+
+ private static Collider[] collidersTemp = new Collider[200];
+
+ private void OnDrawGizmosSelected()
+ {
+ if (shape == EShape.Box)
+ {
+ Gizmos.color = Color.red;
+ Gizmos.matrix = base.transform.localToWorldMatrix;
+ Gizmos.DrawWireCube(Vector3.zero, boxSize);
+ }
+ else
+ {
+ Gizmos.color = Color.red;
+ Gizmos.matrix = base.transform.localToWorldMatrix;
+ Gizmos.DrawWireSphere(Vector3.zero, sphereRadius);
+ }
+ }
+
+ public void AddReiveDamageHpScriptsInAreaToList(List<Hp> _listOfHpScripts)
+ {
+ int num = 0;
+ num = ((shape != EShape.Box) ? Physics.OverlapSphereNonAlloc(base.transform.position, sphereRadius, collidersTemp, layerMaskRecieveDamage) : Physics.OverlapBoxNonAlloc(base.transform.position, boxSize, collidersTemp, base.transform.rotation, layerMaskRecieveDamage));
+ for (int i = 0; i < num; i++)
+ {
+ Hp componentInParent = collidersTemp[i].GetComponentInParent<Hp>();
+ if (!(componentInParent == null) && !_listOfHpScripts.Contains(componentInParent))
+ {
+ _listOfHpScripts.Add(componentInParent);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/StabMA.cs b/Thronefall_v1.57/Thronefall/Thronefall/StabMA.cs
new file mode 100644
index 0000000..8a4bcc9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/StabMA.cs
@@ -0,0 +1,92 @@
+using UnityEngine;
+
+public class StabMA : ManualAttack
+{
+ public float maximumCooldownTime = 15f;
+
+ public float minimumCooldownPercentage = 0.2f;
+
+ private int targetsStabbed;
+
+ private AudioSet.ClipArray caSuccessfulHit;
+
+ private AudioSet.ClipArray caFailedHit;
+
+ public int TargetsStabeed => targetsStabbed;
+
+ public override void Start()
+ {
+ base.Start();
+ caSuccessfulHit = audioSet.PlayerBowStab;
+ caFailedHit = audioSet.PlayerBowStabMiss;
+ }
+
+ public override void Attack()
+ {
+ TaggedObject taggedObject = FindAttackTarget(_choosePreferredTargetIfPossible: true);
+ Hp hp = null;
+ if ((bool)taggedObject)
+ {
+ hp = taggedObject.Hp;
+ cooldownTime = maximumCooldownTime * (minimumCooldownPercentage + hp.HpPercentage * (1f - minimumCooldownPercentage));
+ cooldown = cooldownTime;
+ if (timedActivationPerfectly)
+ {
+ cooldown *= UpgradeAssassinsTraining.instance.cooldownMultiForPerfectlyTimedAttacks;
+ }
+ }
+ float num = 0f;
+ if ((bool)hp)
+ {
+ num = hp.HpValue;
+ }
+ weapon.Attack(base.transform.position + spawnAttackHeight * Vector3.up, hp, transformForAttackDirection.forward, myTaggedObj, base.AttackDamageMultiplyer);
+ if ((bool)hp)
+ {
+ if (num > hp.HpValue)
+ {
+ StabSuccessful();
+ }
+ else
+ {
+ StabMissed();
+ }
+ }
+ else if (num > 0f)
+ {
+ StabSuccessful();
+ }
+ else
+ {
+ StabMissed();
+ }
+ }
+
+ private void StabSuccessful()
+ {
+ audioManager.PlaySoundAsOneShot(caSuccessfulHit, 1f, Random.Range(0.9f, 1.1f), audioSet.mixGroupFX, 5);
+ targetsStabbed++;
+ }
+
+ private void StabMissed()
+ {
+ audioManager.PlaySoundAsOneShot(caFailedHit, 1f, Random.Range(0.9f, 1.1f), audioSet.mixGroupFX, 5);
+ }
+
+ public override TaggedObject FindAttackTarget(bool _choosePreferredTargetIfPossible = false)
+ {
+ if (_choosePreferredTargetIfPossible && (bool)preferredTarget && TagManager.instance.MeasureDistanceToTaggedObject(preferredTarget, base.transform.position) <= targetPriorities[0].range)
+ {
+ return preferredTarget;
+ }
+ for (int i = 0; i < targetPriorities.Count; i++)
+ {
+ TaggedObject taggedObject = targetPriorities[i].FindLowestHealthObjectInRange(base.transform.position, _excludeFullHealthTargets: false);
+ if (taggedObject != null)
+ {
+ return taggedObject;
+ }
+ }
+ return null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SteamManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/SteamManager.cs
new file mode 100644
index 0000000..fb2f904
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SteamManager.cs
@@ -0,0 +1,209 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using AOT;
+using Steamworks;
+using UnityEngine;
+using UnityEngine.Events;
+
+[DisallowMultipleComponent]
+public class SteamManager : MonoBehaviour
+{
+ public struct LeaderboardEntry
+ {
+ public string username;
+
+ public int score;
+ }
+
+ protected static bool s_EverInitialized = false;
+
+ protected static SteamManager s_instance;
+
+ protected bool m_bInitialized;
+
+ protected SteamAPIWarningMessageHook_t m_SteamAPIWarningMessageHook;
+
+ private static CallResult<LeaderboardFindResult_t> _findLeaderboardCallback = new CallResult<LeaderboardFindResult_t>();
+
+ public static int scoreToUpload = -1;
+
+ private static CallResult<LeaderboardScoresDownloaded_t> _downloadedScoresCallback = new CallResult<LeaderboardScoresDownloaded_t>();
+
+ public List<LeaderboardEntry> lastDownloadedLeaderboardEntires = new List<LeaderboardEntry>();
+
+ public UnityEvent OnLeaderboardDownloadCallbackComplete = new UnityEvent();
+
+ public static SteamManager Instance
+ {
+ get
+ {
+ if (s_instance == null)
+ {
+ return new GameObject("SteamManager").AddComponent<SteamManager>();
+ }
+ return s_instance;
+ }
+ }
+
+ public static bool Initialized => Instance.m_bInitialized;
+
+ [MonoPInvokeCallback(typeof(SteamAPIWarningMessageHook_t))]
+ protected static void SteamAPIDebugTextHook(int nSeverity, StringBuilder pchDebugText)
+ {
+ Debug.LogWarning(pchDebugText);
+ }
+
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
+ private static void InitOnPlayMode()
+ {
+ s_EverInitialized = false;
+ s_instance = null;
+ }
+
+ protected virtual void Awake()
+ {
+ if (s_instance != null)
+ {
+ UnityEngine.Object.Destroy(base.gameObject);
+ return;
+ }
+ s_instance = this;
+ scoreToUpload = -1;
+ if (s_EverInitialized)
+ {
+ throw new Exception("Tried to Initialize the SteamAPI twice in one session!");
+ }
+ UnityEngine.Object.DontDestroyOnLoad(base.transform.root.gameObject);
+ if (!Packsize.Test())
+ {
+ Debug.LogError("[Steamworks.NET] Packsize Test returned false, the wrong version of Steamworks.NET is being run in this platform.", this);
+ }
+ if (!DllCheck.Test())
+ {
+ Debug.LogError("[Steamworks.NET] DllCheck Test returned false, One or more of the Steamworks binaries seems to be the wrong version.", this);
+ }
+ try
+ {
+ if (SteamAPI.RestartAppIfNecessary(AppId_t.Invalid))
+ {
+ Debug.Log("[Steamworks.NET] Shutting down because RestartAppIfNecessary returned true. Steam will restart the application.");
+ Application.Quit();
+ return;
+ }
+ }
+ catch (DllNotFoundException ex)
+ {
+ Debug.Log("[Steamworks.NET] Could not load [lib]steam_api.dll/so/dylib. It's likely not in the correct location. Refer to the README for more details.\n" + ex, this);
+ Application.Quit();
+ return;
+ }
+ m_bInitialized = SteamAPI.Init();
+ if (!m_bInitialized)
+ {
+ Debug.Log("[Steamworks.NET] SteamAPI_Init() failed. This is likely the case because the Steam client is not running.", this);
+ }
+ else
+ {
+ s_EverInitialized = true;
+ }
+ }
+
+ protected virtual void OnEnable()
+ {
+ if (s_instance == null)
+ {
+ s_instance = this;
+ }
+ if (m_bInitialized && m_SteamAPIWarningMessageHook == null)
+ {
+ m_SteamAPIWarningMessageHook = SteamAPIDebugTextHook;
+ SteamClient.SetWarningMessageHook(m_SteamAPIWarningMessageHook);
+ }
+ }
+
+ protected virtual void OnDestroy()
+ {
+ if (!(s_instance != this))
+ {
+ s_instance = null;
+ if (m_bInitialized)
+ {
+ SteamAPI.Shutdown();
+ }
+ }
+ }
+
+ protected virtual void Update()
+ {
+ if (m_bInitialized)
+ {
+ SteamAPI.RunCallbacks();
+ }
+ }
+
+ public void UploadHighscore(int _score, string _leaderboardName)
+ {
+ if (Initialized)
+ {
+ if (scoreToUpload != -1)
+ {
+ Debug.LogError("You can't upload multiple scores symultaneously with the current system.");
+ return;
+ }
+ scoreToUpload = _score;
+ SteamAPICall_t hAPICall = SteamUserStats.FindOrCreateLeaderboard(_leaderboardName, ELeaderboardSortMethod.k_ELeaderboardSortMethodDescending, ELeaderboardDisplayType.k_ELeaderboardDisplayTypeNumeric);
+ _findLeaderboardCallback.Set(hAPICall, OnFindLeaderboardForUploadingScore);
+ }
+ }
+
+ public void OnFindLeaderboardForUploadingScore(LeaderboardFindResult_t _callback, bool _failure)
+ {
+ if (_failure)
+ {
+ scoreToUpload = -1;
+ return;
+ }
+ SteamUserStats.UploadLeaderboardScore(_callback.m_hSteamLeaderboard, ELeaderboardUploadScoreMethod.k_ELeaderboardUploadScoreMethodKeepBest, scoreToUpload, new int[0], 0);
+ scoreToUpload = -1;
+ }
+
+ public void DownloadFriendsHighscores(string _leaderboardName)
+ {
+ lastDownloadedLeaderboardEntires.Clear();
+ if (Initialized)
+ {
+ SteamAPICall_t hAPICall = SteamUserStats.FindLeaderboard(_leaderboardName);
+ _findLeaderboardCallback.Set(hAPICall, OnFindLeaderboardFodDownloadingFriendsScore);
+ }
+ }
+
+ public void OnFindLeaderboardFodDownloadingFriendsScore(LeaderboardFindResult_t _callback, bool _failure)
+ {
+ if (!_failure)
+ {
+ SteamAPICall_t hAPICall = SteamUserStats.DownloadLeaderboardEntries(_callback.m_hSteamLeaderboard, ELeaderboardDataRequest.k_ELeaderboardDataRequestFriends, 1, 100);
+ _downloadedScoresCallback.Set(hAPICall, OnDownloadedScores);
+ }
+ }
+
+ public void OnDownloadedScores(LeaderboardScoresDownloaded_t _callback, bool _failure)
+ {
+ if (_failure)
+ {
+ OnLeaderboardDownloadCallbackComplete.Invoke();
+ return;
+ }
+ SteamUserStats.GetLeaderboardName(_callback.m_hSteamLeaderboard);
+ int[] pDetails = new int[0];
+ for (int i = 0; i < _callback.m_cEntryCount; i++)
+ {
+ SteamUserStats.GetDownloadedLeaderboardEntry(_callback.m_hSteamLeaderboardEntries, i, out var pLeaderboardEntry, pDetails, 0);
+ LeaderboardEntry item = default(LeaderboardEntry);
+ item.username = SteamFriends.GetFriendPersonaName(pLeaderboardEntry.m_steamIDUser);
+ item.score = pLeaderboardEntry.m_nScore;
+ lastDownloadedLeaderboardEntires.Add(item);
+ }
+ OnLeaderboardDownloadCallbackComplete.Invoke();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/StringFloatSerializableDictionary.cs b/Thronefall_v1.57/Thronefall/Thronefall/StringFloatSerializableDictionary.cs
new file mode 100644
index 0000000..8ae8cdd
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/StringFloatSerializableDictionary.cs
@@ -0,0 +1,6 @@
+using System;
+
+[Serializable]
+public class StringFloatSerializableDictionary : UnitySerializedDictionary<string, string>
+{
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SuperSimpleOceanAnimation.cs b/Thronefall_v1.57/Thronefall/Thronefall/SuperSimpleOceanAnimation.cs
new file mode 100644
index 0000000..f30e181
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SuperSimpleOceanAnimation.cs
@@ -0,0 +1,47 @@
+using System;
+using UnityEngine;
+
+public class SuperSimpleOceanAnimation : MonoBehaviour
+{
+ private Vector3 startPosition;
+
+ private float time;
+
+ [SerializeField]
+ private Vector3 waveHeight;
+
+ [SerializeField]
+ private float waveFrequency = 0.5f;
+
+ [SerializeField]
+ private Vector3 waveSideways;
+
+ [SerializeField]
+ private float waveSidewaysFrequency = 0.5f;
+
+ [SerializeField]
+ private Material targetMaterial;
+
+ [SerializeField]
+ private float panSpeed = 2f;
+
+ private Vector2 offset;
+
+ private void Start()
+ {
+ startPosition = base.transform.position;
+ }
+
+ private void Update()
+ {
+ time += Time.deltaTime;
+ offset.x = time * panSpeed;
+ base.transform.position = startPosition;
+ base.transform.position += waveHeight * Mathf.Sin(time * waveFrequency * MathF.PI);
+ base.transform.position += waveSideways * Mathf.Sin(time * waveSidewaysFrequency * MathF.PI);
+ if (targetMaterial != null)
+ {
+ targetMaterial.SetTextureOffset("_BaseMap", offset);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SuperWaveGen.cs b/Thronefall_v1.57/Thronefall/Thronefall/SuperWaveGen.cs
new file mode 100644
index 0000000..574c46a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SuperWaveGen.cs
@@ -0,0 +1,1508 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "New ET Settings", menuName = "SimpleSiege/Super Wave Gen")]
+public class SuperWaveGen : EternalWaveGenerator
+{
+ public enum EStartingGold
+ {
+ LowEcoStart,
+ MediumEcoStart,
+ HighEcoStart,
+ SuperHighEcoStart,
+ GigaHighEcoStart
+ }
+
+ public enum EEnemyGoldDropRate
+ {
+ NoDropsExeptMinimum,
+ LowDroprate,
+ MediumDroprate,
+ HighDroprate
+ }
+
+ public enum EMinimumGoldGainPerNight
+ {
+ MinGoldSmall,
+ MinGoldNormal,
+ MinGoldBigger,
+ MinGoldBiggest,
+ MinGoldMassive
+ }
+
+ public enum EMaximumGoldGainPerNight
+ {
+ MaxGoldIsMinGold,
+ MaxGoldIsMinGoldx2,
+ MaxGoldIsMinGoldx3,
+ MaxGoldIsMinGoldx4,
+ MaxGoldUnlimited
+ }
+
+ public enum EEnemyPreselection
+ {
+ All_10,
+ RemoveRandoms_10,
+ NoFlying,
+ FlyingOnly,
+ MonstersOnly,
+ NoMonsters,
+ MeleeOnly,
+ RangedOnly,
+ NoSiege,
+ FastOnly,
+ NoFast,
+ VulnerableToSplashOnly,
+ NoVulnerableToSplash
+ }
+
+ public enum EEnemyTypesMode
+ {
+ FixedMonobattle_1,
+ VarietyMonobattle_4,
+ FixedDuobattle_8,
+ FixedTriobattle_10,
+ VarietyDuobattle_12,
+ VarietyTriobattle_10,
+ VarietyGrowbattle_16,
+ FixedGrowbattle_16
+ }
+
+ public enum ESpawnSelectMode
+ {
+ OneFixedRandom_1,
+ TwoFixedRandom_2,
+ ThreeFixedRandom_2,
+ OneVarietyRandom_2,
+ TwoVarietyRandom_3,
+ ThreeVarietyRandom_3,
+ OmegaRandomPerEnemy_3,
+ FixedGrowspawns_2,
+ VarietyGrowspawns_3,
+ AllSpawns_1
+ }
+
+ public enum ESpawnInDuration
+ {
+ Immediate,
+ ShortFlow,
+ MediumFlow,
+ LongFlow,
+ RandomFlow,
+ GrowingFlow
+ }
+
+ public enum EElitMode
+ {
+ OnlyToPreventOverpopulation_7,
+ OneRandomEliteSpawn,
+ PartialConversionSmall,
+ PartialConversionMedium,
+ PartialConversionBig,
+ PartialConversionRandom
+ }
+
+ public enum ESpawnInType
+ {
+ Normal,
+ TwoWaves,
+ ThreeWaves,
+ DynamicSmallGroups,
+ DynamicBigGroups,
+ RandomGroupsAndStreams,
+ OneSpawnAtATime,
+ OneSpawnAtATimeInWaves
+ }
+
+ public enum EDistributeDifficulty
+ {
+ EvenDifficulty_3,
+ EvenUnitCount,
+ EvenDifficultyAndUnitCountMixture_2,
+ SlightlyRandom,
+ VeryRandom
+ }
+
+ public enum EFinalWaveBonus
+ {
+ None,
+ AllSpawnsActive,
+ VeryLongWave,
+ VeryLongWaveWithAllSpawns,
+ AllSpawnsActivePlusNewEnemyType,
+ VeryLongWavePlusNewEnemyType,
+ VeryLongWaveWithAllSpawnsPlusNewEnemyType
+ }
+
+ [SerializeField]
+ private EternalTrialEnemySet enemySet;
+
+ [SerializeField]
+ private int maxAmountOfUnitsPerWave = 200;
+
+ private List<EternalTrialEnemy> shuffledEnemies;
+
+ private List<EnemySpawnLine> shuffledSpawns;
+
+ [SerializeField]
+ private bool randomizeEconomySettings;
+
+ [SerializeField]
+ private EStartingGold settingEStartingGold;
+
+ [SerializeField]
+ private EEnemyGoldDropRate settingEEnemyGoldDropRate;
+
+ [SerializeField]
+ private EMinimumGoldGainPerNight settingEMinimumGoldGainPerNight;
+
+ [SerializeField]
+ private EMaximumGoldGainPerNight settingEMaximumGoldGainPerNight;
+
+ [SerializeField]
+ private bool randomizeEnemiesAndSpanws;
+
+ [SerializeField]
+ private EEnemyPreselection settingEnemyPreselection;
+
+ [SerializeField]
+ private EEnemyTypesMode settingEnemiesToSpawn;
+
+ [SerializeField]
+ private ESpawnSelectMode settingSpawnToPick;
+
+ [SerializeField]
+ private ESpawnInDuration settingSpawnInDuration;
+
+ [SerializeField]
+ private EElitMode settingEliteMode;
+
+ [SerializeField]
+ private ESpawnInType settingESpawnInType;
+
+ [SerializeField]
+ private EDistributeDifficulty settingEDistributeDifficulty;
+
+ [SerializeField]
+ private EFinalWaveBonus settingEFinalWaveBonus;
+
+ [SerializeField]
+ private List<TagManager.ETag> counterableTags = new List<TagManager.ETag>();
+
+ public float[] tagsCountered;
+
+ public float[] targetDifficultyInNight;
+
+ public List<string>[] difficultyContributionsInNight;
+
+ public List<int> _OUTgoldSpentOnEconomyBeforeNigh = new List<int>();
+
+ public List<int> _OUTgoldSpentOnDefenseBeforeNight = new List<int>();
+
+ public List<int> _OUTNetworthBeforeNight = new List<int>();
+
+ public List<int> _OUTgoldEarnedInNight = new List<int>();
+
+ public List<int> _OUTgoldDroppedInNight = new List<int>();
+
+ public List<string> _OUTBuildorder = new List<string>();
+
+ public List<int> _OUTDefensePower = new List<int>();
+
+ private List<EternalTrialEnemy> removedEnemies;
+
+ private void RandomizeAllMetaParameters(int _stage)
+ {
+ settingEStartingGold = GetRandomEnumValue<EStartingGold>();
+ if (_stage >= 4 && settingEStartingGold == EStartingGold.LowEcoStart)
+ {
+ settingEStartingGold = EStartingGold.MediumEcoStart;
+ }
+ settingEEnemyGoldDropRate = GetRandomEnumValue<EEnemyGoldDropRate>();
+ settingEMinimumGoldGainPerNight = GetRandomEnumValue<EMinimumGoldGainPerNight>();
+ settingEMaximumGoldGainPerNight = GetRandomEnumValue<EMaximumGoldGainPerNight>();
+ settingEnemyPreselection = GetRandomEnumValueWithDistribution<EEnemyPreselection>();
+ settingEnemiesToSpawn = GetRandomEnumValueWithDistribution<EEnemyTypesMode>();
+ settingSpawnToPick = GetRandomEnumValueWithDistribution<ESpawnSelectMode>();
+ settingSpawnInDuration = GetRandomEnumValue<ESpawnInDuration>();
+ settingESpawnInType = GetRandomEnumValue<ESpawnInType>();
+ settingEliteMode = GetRandomEnumValueWithDistribution<EElitMode>();
+ settingEFinalWaveBonus = GetRandomEnumValue<EFinalWaveBonus>();
+ settingEDistributeDifficulty = GetRandomEnumValueWithDistribution<EDistributeDifficulty>();
+ if (_stage <= 1)
+ {
+ settingEFinalWaveBonus = EFinalWaveBonus.None;
+ if (settingSpawnInDuration == ESpawnInDuration.LongFlow)
+ {
+ settingSpawnInDuration = ESpawnInDuration.ShortFlow;
+ }
+ if (settingSpawnInDuration == ESpawnInDuration.RandomFlow)
+ {
+ settingSpawnInDuration = ESpawnInDuration.MediumFlow;
+ }
+ }
+ if (_stage <= 2)
+ {
+ settingEliteMode = EElitMode.OnlyToPreventOverpopulation_7;
+ }
+ if (_stage >= 6)
+ {
+ if (settingEDistributeDifficulty == EDistributeDifficulty.VeryRandom)
+ {
+ settingEDistributeDifficulty = EDistributeDifficulty.SlightlyRandom;
+ }
+ if (settingSpawnToPick == ESpawnSelectMode.OneFixedRandom_1)
+ {
+ settingSpawnToPick = ESpawnSelectMode.OneVarietyRandom_2;
+ }
+ if (settingEnemiesToSpawn == EEnemyTypesMode.FixedMonobattle_1)
+ {
+ settingEnemiesToSpawn = EEnemyTypesMode.FixedDuobattle_8;
+ }
+ if (settingEnemiesToSpawn == EEnemyTypesMode.VarietyMonobattle_4)
+ {
+ settingEnemiesToSpawn = EEnemyTypesMode.VarietyDuobattle_12;
+ }
+ }
+ }
+
+ public override string ReturnDebugInfoAboutWave(int _wave)
+ {
+ if (_wave < 0 || _wave >= difficultyContributionsInNight.Length)
+ {
+ return "";
+ }
+ string text = "";
+ foreach (string item in difficultyContributionsInNight[_wave])
+ {
+ text = text + item + "\n";
+ }
+ return text;
+ }
+
+ public override List<Wave> GenerateWaves(EnemySpawnLine[] _spawns, LevelInfo _levelInfo, int stage, out int startingGold, int seed, int waveCountOverride = -1)
+ {
+ System.Random random = new System.Random(seed);
+ UnityEngine.Random.InitState(seed);
+ RandomizeAllMetaParameters(stage);
+ tagsCountered = new float[counterableTags.Count];
+ foreach (EternalTrialEnemy enemy in enemySet.enemies)
+ {
+ enemy.DifficultyValueTemp = enemy.difficultyValue;
+ }
+ int num = 0;
+ switch (stage)
+ {
+ case 0:
+ num = 3;
+ if (UnityEngine.Random.value <= 0.5f)
+ {
+ num++;
+ }
+ break;
+ case 1:
+ num = 5;
+ if (UnityEngine.Random.value <= 0.5f)
+ {
+ num++;
+ }
+ break;
+ case 2:
+ num = 7;
+ if (UnityEngine.Random.value <= 0.5f)
+ {
+ num++;
+ }
+ break;
+ default:
+ num = 6 + stage;
+ break;
+ }
+ if (waveCountOverride > 0)
+ {
+ num = waveCountOverride;
+ }
+ startingGold = 0;
+ switch (settingEStartingGold)
+ {
+ case EStartingGold.LowEcoStart:
+ startingGold = 8;
+ break;
+ case EStartingGold.MediumEcoStart:
+ startingGold = 13;
+ break;
+ case EStartingGold.HighEcoStart:
+ startingGold = 18;
+ break;
+ case EStartingGold.SuperHighEcoStart:
+ startingGold = 23;
+ break;
+ case EStartingGold.GigaHighEcoStart:
+ startingGold = 28;
+ break;
+ }
+ startingGold += UnityEngine.Random.Range(-2, 3);
+ float goldDropRate = 0f;
+ switch (settingEEnemyGoldDropRate)
+ {
+ case EEnemyGoldDropRate.NoDropsExeptMinimum:
+ goldDropRate = 0f;
+ break;
+ case EEnemyGoldDropRate.LowDroprate:
+ goldDropRate = 9f / 160f;
+ break;
+ case EEnemyGoldDropRate.MediumDroprate:
+ goldDropRate = 0.1125f;
+ break;
+ case EEnemyGoldDropRate.HighDroprate:
+ goldDropRate = 0.225f;
+ break;
+ }
+ int num2 = 0;
+ switch (settingEMinimumGoldGainPerNight)
+ {
+ case EMinimumGoldGainPerNight.MinGoldSmall:
+ num2 = 2;
+ break;
+ case EMinimumGoldGainPerNight.MinGoldNormal:
+ num2 = 4;
+ break;
+ case EMinimumGoldGainPerNight.MinGoldBigger:
+ num2 = 6;
+ break;
+ case EMinimumGoldGainPerNight.MinGoldBiggest:
+ num2 = 8;
+ break;
+ case EMinimumGoldGainPerNight.MinGoldMassive:
+ num2 = 11;
+ break;
+ }
+ if (UnityEngine.Random.value <= 0.5f)
+ {
+ num2++;
+ }
+ int maxGoldDrops = 10000000;
+ switch (settingEMaximumGoldGainPerNight)
+ {
+ case EMaximumGoldGainPerNight.MaxGoldIsMinGold:
+ maxGoldDrops = num2;
+ break;
+ case EMaximumGoldGainPerNight.MaxGoldIsMinGoldx2:
+ maxGoldDrops = num2 * 2;
+ break;
+ case EMaximumGoldGainPerNight.MaxGoldIsMinGoldx3:
+ maxGoldDrops = num2 * 3;
+ break;
+ case EMaximumGoldGainPerNight.MaxGoldIsMinGoldx4:
+ maxGoldDrops = num2 * 4;
+ break;
+ case EMaximumGoldGainPerNight.MaxGoldUnlimited:
+ maxGoldDrops = 10000000;
+ break;
+ }
+ EconomySimulator.SimulateEconomy(out _OUTgoldSpentOnEconomyBeforeNigh, out _OUTgoldSpentOnDefenseBeforeNight, out _OUTNetworthBeforeNight, out _OUTgoldEarnedInNight, out _OUTgoldDroppedInNight, out _OUTBuildorder, out _OUTDefensePower, _levelInfo.virtualBuildings, startingGold, goldDropRate, num2, maxGoldDrops, num);
+ num = _OUTgoldEarnedInNight.Count;
+ targetDifficultyInNight = new float[num];
+ difficultyContributionsInNight = new List<string>[num];
+ for (int i = 0; i < difficultyContributionsInNight.Length; i++)
+ {
+ difficultyContributionsInNight[i] = new List<string>();
+ }
+ shuffledEnemies = new List<EternalTrialEnemy>(enemySet.enemies);
+ RemoveInvalidEnemiesFromShuffeledEnemeisAndShuffle(out removedEnemies, random);
+ shuffledSpawns = new List<EnemySpawnLine>(_spawns);
+ shuffledSpawns.ETShuffle(random);
+ List<Wave> list = new List<Wave>();
+ for (int j = 0; j < num; j++)
+ {
+ list.Add(GenerateWave(j, list, stage, out var _success, j == num - 1, random));
+ if (!_success && j > 1)
+ {
+ return GenerateWaves(_spawns, _levelInfo, stage, out startingGold, seed, j - 1);
+ }
+ }
+ return list;
+ }
+
+ private Wave GenerateWave(int _waveNr, List<Wave> _outPutWavesLookup, int _stage, out bool _success, bool _finalWave, System.Random randomGenerator)
+ {
+ Wave wave = new Wave();
+ int num = _OUTgoldDroppedInNight[_waveNr];
+ bool flag = false;
+ bool flag2 = false;
+ bool flag3 = false;
+ if (_finalWave)
+ {
+ switch (settingEFinalWaveBonus)
+ {
+ case EFinalWaveBonus.AllSpawnsActive:
+ flag = true;
+ break;
+ case EFinalWaveBonus.AllSpawnsActivePlusNewEnemyType:
+ flag = true;
+ flag3 = true;
+ break;
+ case EFinalWaveBonus.VeryLongWave:
+ flag2 = true;
+ break;
+ case EFinalWaveBonus.VeryLongWavePlusNewEnemyType:
+ flag2 = true;
+ flag3 = true;
+ break;
+ case EFinalWaveBonus.VeryLongWaveWithAllSpawns:
+ flag2 = true;
+ flag = true;
+ break;
+ case EFinalWaveBonus.VeryLongWaveWithAllSpawnsPlusNewEnemyType:
+ flag2 = true;
+ flag = true;
+ flag3 = true;
+ break;
+ }
+ }
+ List<EternalTrialEnemy> list = new List<EternalTrialEnemy>();
+ int _foundIndex;
+ switch (settingEnemiesToSpawn)
+ {
+ case EEnemyTypesMode.FixedMonobattle_1:
+ list.Add(FirstPossibleEnemyForWave(_waveNr, 0, out _foundIndex));
+ break;
+ case EEnemyTypesMode.FixedDuobattle_8:
+ list.Add(FirstPossibleEnemyForWave(_waveNr, 0, out _foundIndex));
+ list.Add(FirstPossibleEnemyForWave(_waveNr, _foundIndex + 1, out _foundIndex));
+ break;
+ case EEnemyTypesMode.FixedTriobattle_10:
+ list.Add(FirstPossibleEnemyForWave(_waveNr, 0, out _foundIndex));
+ list.Add(FirstPossibleEnemyForWave(_waveNr, _foundIndex + 1, out _foundIndex));
+ list.Add(FirstPossibleEnemyForWave(_waveNr, _foundIndex + 1, out _foundIndex));
+ break;
+ case EEnemyTypesMode.VarietyMonobattle_4:
+ shuffledEnemies.ETShuffle(randomGenerator);
+ list.Add(FirstPossibleEnemyForWave(_waveNr, 0, out _foundIndex));
+ break;
+ case EEnemyTypesMode.VarietyDuobattle_12:
+ shuffledEnemies.ETShuffle(randomGenerator);
+ list.Add(FirstPossibleEnemyForWave(_waveNr, 0, out _foundIndex));
+ list.Add(FirstPossibleEnemyForWave(_waveNr, _foundIndex + 1, out _foundIndex));
+ break;
+ case EEnemyTypesMode.VarietyTriobattle_10:
+ shuffledEnemies.ETShuffle(randomGenerator);
+ list.Add(FirstPossibleEnemyForWave(_waveNr, 0, out _foundIndex));
+ list.Add(FirstPossibleEnemyForWave(_waveNr, _foundIndex + 1, out _foundIndex));
+ list.Add(FirstPossibleEnemyForWave(_waveNr, _foundIndex + 1, out _foundIndex));
+ break;
+ case EEnemyTypesMode.FixedGrowbattle_16:
+ {
+ int num2 = Mathf.Clamp(_waveNr, 1, 7);
+ list.Add(FirstPossibleEnemyForWave(_waveNr, 0, out _foundIndex));
+ for (int j = 0; j < num2; j++)
+ {
+ list.Add(FirstPossibleEnemyForWave(_waveNr, _foundIndex + 1, out _foundIndex));
+ }
+ break;
+ }
+ case EEnemyTypesMode.VarietyGrowbattle_16:
+ {
+ shuffledEnemies.ETShuffle(randomGenerator);
+ int num2 = Mathf.Clamp(_waveNr, 1, 7);
+ list.Add(FirstPossibleEnemyForWave(_waveNr, 0, out _foundIndex));
+ for (int i = 0; i < num2; i++)
+ {
+ list.Add(FirstPossibleEnemyForWave(_waveNr, _foundIndex + 1, out _foundIndex));
+ }
+ break;
+ }
+ }
+ if (flag3)
+ {
+ shuffledEnemies.AddRange(removedEnemies);
+ shuffledEnemies.ETShuffle(randomGenerator);
+ foreach (EternalTrialEnemy shuffledEnemy in shuffledEnemies)
+ {
+ if (!list.Contains(shuffledEnemy))
+ {
+ list.Add(shuffledEnemy);
+ break;
+ }
+ }
+ }
+ list = list.Distinct().ToList();
+ if (list.Count <= 0)
+ {
+ list.Add(enemySet.enemies[0]);
+ }
+ bool flag4 = true;
+ foreach (EternalTrialEnemy item2 in list)
+ {
+ if (!item2.enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.Flying))
+ {
+ flag4 = false;
+ break;
+ }
+ }
+ if (flag4)
+ {
+ Debug.Log("Adding a ground enemy YO!");
+ foreach (EternalTrialEnemy shuffledEnemy2 in shuffledEnemies)
+ {
+ if (!shuffledEnemy2.enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.Flying))
+ {
+ Debug.Log("Adding a ground enemy YO!");
+ list.Add(shuffledEnemy2);
+ break;
+ }
+ }
+ }
+ foreach (EternalTrialEnemy item3 in list)
+ {
+ item3.TempSpawnLineList.Clear();
+ item3.TempSpawnLineTargetDifficulty.Clear();
+ item3.TempSpawnAmount.Clear();
+ item3.TempDropGold.Clear();
+ }
+ switch (settingSpawnToPick)
+ {
+ case ESpawnSelectMode.OneFixedRandom_1:
+ foreach (EternalTrialEnemy item4 in list)
+ {
+ item4.TempSpawnLineList.Add(FirstPossibleSpawnFor(item4, 0, out _foundIndex));
+ }
+ break;
+ case ESpawnSelectMode.TwoFixedRandom_2:
+ foreach (EternalTrialEnemy item5 in list)
+ {
+ item5.TempSpawnLineList.Add(FirstPossibleSpawnFor(item5, 0, out _foundIndex));
+ item5.TempSpawnLineList.Add(FirstPossibleSpawnFor(item5, _foundIndex + 1, out _foundIndex));
+ }
+ break;
+ case ESpawnSelectMode.ThreeFixedRandom_2:
+ foreach (EternalTrialEnemy item6 in list)
+ {
+ item6.TempSpawnLineList.Add(FirstPossibleSpawnFor(item6, 0, out _foundIndex));
+ item6.TempSpawnLineList.Add(FirstPossibleSpawnFor(item6, _foundIndex + 1, out _foundIndex));
+ item6.TempSpawnLineList.Add(FirstPossibleSpawnFor(item6, _foundIndex + 1, out _foundIndex));
+ }
+ break;
+ case ESpawnSelectMode.OneVarietyRandom_2:
+ shuffledSpawns.ETShuffle(randomGenerator);
+ foreach (EternalTrialEnemy item7 in list)
+ {
+ item7.TempSpawnLineList.Add(FirstPossibleSpawnFor(item7, 0, out _foundIndex));
+ }
+ break;
+ case ESpawnSelectMode.TwoVarietyRandom_3:
+ shuffledSpawns.ETShuffle(randomGenerator);
+ foreach (EternalTrialEnemy item8 in list)
+ {
+ item8.TempSpawnLineList.Add(FirstPossibleSpawnFor(item8, 0, out _foundIndex));
+ item8.TempSpawnLineList.Add(FirstPossibleSpawnFor(item8, _foundIndex + 1, out _foundIndex));
+ }
+ break;
+ case ESpawnSelectMode.ThreeVarietyRandom_3:
+ shuffledSpawns.ETShuffle(randomGenerator);
+ foreach (EternalTrialEnemy item9 in list)
+ {
+ item9.TempSpawnLineList.Add(FirstPossibleSpawnFor(item9, 0, out _foundIndex));
+ item9.TempSpawnLineList.Add(FirstPossibleSpawnFor(item9, _foundIndex + 1, out _foundIndex));
+ item9.TempSpawnLineList.Add(FirstPossibleSpawnFor(item9, _foundIndex + 1, out _foundIndex));
+ }
+ break;
+ case ESpawnSelectMode.OmegaRandomPerEnemy_3:
+ shuffledSpawns.ETShuffle(randomGenerator);
+ foreach (EternalTrialEnemy item10 in list)
+ {
+ foreach (EnemySpawnLine shuffledSpawn in shuffledSpawns)
+ {
+ if (IsPossibleSpawnLineFor(item10, shuffledSpawn))
+ {
+ item10.TempSpawnLineList.Add(shuffledSpawn);
+ }
+ }
+ List<EnemySpawnLine> list2 = item10.TempSpawnLineList;
+ RemoveRandomInstances(ref list2, randomGenerator);
+ }
+ break;
+ case ESpawnSelectMode.VarietyGrowspawns_3:
+ {
+ int num3 = Mathf.Max(1, _waveNr);
+ shuffledSpawns.ETShuffle(randomGenerator);
+ foreach (EternalTrialEnemy item11 in list)
+ {
+ foreach (EnemySpawnLine shuffledSpawn2 in shuffledSpawns)
+ {
+ if (IsPossibleSpawnLineFor(item11, shuffledSpawn2))
+ {
+ item11.TempSpawnLineList.Add(shuffledSpawn2);
+ }
+ }
+ List<EnemySpawnLine> tempSpawnLineList2 = item11.TempSpawnLineList;
+ while (tempSpawnLineList2.Count > num3)
+ {
+ tempSpawnLineList2.RemoveAt(tempSpawnLineList2.Count - 1);
+ }
+ }
+ break;
+ }
+ case ESpawnSelectMode.FixedGrowspawns_2:
+ {
+ int num3 = Mathf.Max(1, _waveNr);
+ foreach (EternalTrialEnemy item12 in list)
+ {
+ foreach (EnemySpawnLine shuffledSpawn3 in shuffledSpawns)
+ {
+ if (IsPossibleSpawnLineFor(item12, shuffledSpawn3))
+ {
+ item12.TempSpawnLineList.Add(shuffledSpawn3);
+ }
+ }
+ List<EnemySpawnLine> tempSpawnLineList = item12.TempSpawnLineList;
+ while (tempSpawnLineList.Count > num3)
+ {
+ tempSpawnLineList.RemoveAt(tempSpawnLineList.Count - 1);
+ }
+ }
+ break;
+ }
+ case ESpawnSelectMode.AllSpawns_1:
+ foreach (EternalTrialEnemy item13 in list)
+ {
+ foreach (EnemySpawnLine shuffledSpawn4 in shuffledSpawns)
+ {
+ if (IsPossibleSpawnLineFor(item13, shuffledSpawn4))
+ {
+ item13.TempSpawnLineList.Add(shuffledSpawn4);
+ }
+ }
+ }
+ break;
+ }
+ if (flag)
+ {
+ shuffledSpawns.ETShuffle(randomGenerator);
+ foreach (EternalTrialEnemy item14 in list)
+ {
+ item14.TempSpawnLineList.Clear();
+ foreach (EnemySpawnLine shuffledSpawn5 in shuffledSpawns)
+ {
+ if (IsPossibleSpawnLineFor(item14, shuffledSpawn5))
+ {
+ item14.TempSpawnLineList.Add(shuffledSpawn5);
+ }
+ }
+ List<EnemySpawnLine> list3 = item14.TempSpawnLineList;
+ RemoveRandomInstances(ref list3, randomGenerator);
+ }
+ }
+ float num4 = (float)_OUTDefensePower[_waveNr] * 2f + 11f;
+ difficultyContributionsInNight[_waveNr].Add(num4 + $" Base Difficulty from Expected Defense Gold Spent ({_OUTDefensePower[_waveNr]} Defense Power)");
+ float num5 = 1f;
+ float num6 = 1f;
+ switch (settingSpawnInDuration)
+ {
+ case ESpawnInDuration.Immediate:
+ num5 = 1f;
+ break;
+ case ESpawnInDuration.ShortFlow:
+ num5 = 5.5f + 4f * UnityEngine.Random.value;
+ break;
+ case ESpawnInDuration.MediumFlow:
+ num5 = 11.5f + 7f * UnityEngine.Random.value;
+ break;
+ case ESpawnInDuration.LongFlow:
+ num5 = 25f + 7f * UnityEngine.Random.value;
+ break;
+ case ESpawnInDuration.RandomFlow:
+ num5 = 1f + 30f * UnityEngine.Random.value;
+ if (UnityEngine.Random.value < 0.2f)
+ {
+ num5 = 2f;
+ }
+ break;
+ case ESpawnInDuration.GrowingFlow:
+ num5 = (float)_waveNr * 3f;
+ break;
+ }
+ if (flag2)
+ {
+ num5 = 40f + 140f * UnityEngine.Random.value;
+ }
+ num6 = 1f + num5 / 60f;
+ difficultyContributionsInNight[_waveNr].Add(num6 + "x From spawn duration (" + num5 + " sec)");
+ num4 *= num6;
+ List<EnemySpawnLine> list4 = new List<EnemySpawnLine>();
+ foreach (EternalTrialEnemy item15 in list)
+ {
+ foreach (EnemySpawnLine tempSpawnLine in item15.TempSpawnLineList)
+ {
+ if (!list4.Contains(tempSpawnLine))
+ {
+ list4.Add(tempSpawnLine);
+ }
+ }
+ }
+ float num7 = 0f;
+ int num8 = 0;
+ for (int k = 0; k < list4.Count; k++)
+ {
+ for (int l = k + 1; l < list4.Count; l++)
+ {
+ num8++;
+ EnemySpawnLine enemySpawnLine = list4[k];
+ EnemySpawnLine enemySpawnLine2 = list4[l];
+ num7 = ((!enemySpawnLine.mostlySharedAttackpaths.Contains(enemySpawnLine2) && !enemySpawnLine2.mostlySharedAttackpaths.Contains(enemySpawnLine)) ? ((!enemySpawnLine.mostlySeperatedAttackPaths.Contains(enemySpawnLine2) && !enemySpawnLine2.mostlySeperatedAttackPaths.Contains(enemySpawnLine)) ? (num7 + 0.9f) : (num7 + 0.8f)) : (num7 + 1f));
+ }
+ }
+ float num9 = ((num8 > 0) ? (num7 / (float)num8) : 1f);
+ float num10 = Mathf.Pow(0.98f, list4.Count - 2) * num9;
+ difficultyContributionsInNight[_waveNr].Add(num10 + "x From count (" + list4.Count + " spawns and average relationship strength of " + num9 + ")");
+ num4 *= num10;
+ float num11 = 0f;
+ foreach (EnemySpawnLine item16 in list4)
+ {
+ num11 += item16.DifficultyBudgetMultiplyer;
+ }
+ num11 /= (float)list4.Count;
+ difficultyContributionsInNight[_waveNr].Add(num11 + "x From spawn difficulty (e.g. proximity to base).");
+ num4 *= num11;
+ if (_waveNr == _outPutWavesLookup.Count - 1)
+ {
+ float num12 = 1.05f;
+ difficultyContributionsInNight[_waveNr].Add(num12 + "x From final night difficulty bonus.");
+ num4 *= num12;
+ }
+ int num13 = Mathf.Clamp(_stage, 0, 5);
+ int num14 = _stage - num13;
+ float num15 = Mathf.Pow(1.2f, num13 - 2) + (float)num14 * 0.3f;
+ difficultyContributionsInNight[_waveNr].Add(num15 + "x From current stage (stage " + _stage + ").");
+ num4 *= num15;
+ targetDifficultyInNight[_waveNr] = num4;
+ float num16 = 0f;
+ float num17 = 0f;
+ int num18 = 0;
+ int num19 = 0;
+ list.ETShuffle(randomGenerator);
+ float num20 = 0f;
+ foreach (EternalTrialEnemy item17 in list)
+ {
+ num20 += item17.difficultyValue;
+ }
+ float num21 = 1f;
+ for (int m = 0; m < list.Count; m++)
+ {
+ EternalTrialEnemy eternalTrialEnemy = list[m];
+ bool flag5 = m == list.Count - 1;
+ EDistributeDifficulty eDistributeDifficulty = settingEDistributeDifficulty;
+ if (_finalWave)
+ {
+ eDistributeDifficulty = EDistributeDifficulty.EvenDifficulty_3;
+ }
+ switch (eDistributeDifficulty)
+ {
+ case EDistributeDifficulty.EvenDifficulty_3:
+ eternalTrialEnemy.TempTargetDifficulty = num4 / (float)list.Count;
+ break;
+ case EDistributeDifficulty.EvenUnitCount:
+ {
+ float num22 = eternalTrialEnemy.difficultyValue / num20;
+ eternalTrialEnemy.TempTargetDifficulty = num4 * num22;
+ break;
+ }
+ case EDistributeDifficulty.EvenDifficultyAndUnitCountMixture_2:
+ {
+ float num22 = eternalTrialEnemy.difficultyValue / num20;
+ eternalTrialEnemy.TempTargetDifficulty = num4 * num22 * 0.5f + num4 / (float)list.Count * 0.5f;
+ break;
+ }
+ case EDistributeDifficulty.VeryRandom:
+ {
+ float num22 = UnityEngine.Random.value * num21;
+ if (flag5)
+ {
+ num22 = num21;
+ }
+ num21 -= num22;
+ eternalTrialEnemy.TempTargetDifficulty = num4 * num22;
+ break;
+ }
+ case EDistributeDifficulty.SlightlyRandom:
+ {
+ float num22 = UnityEngine.Random.value * num21;
+ if (flag5)
+ {
+ num22 = num21;
+ }
+ num21 -= num22;
+ eternalTrialEnemy.TempTargetDifficulty = num4 * num22 * 0.5f + num4 / (float)list.Count * 0.5f;
+ break;
+ }
+ }
+ float num23 = 0f;
+ foreach (EnemySpawnLine tempSpawnLine2 in eternalTrialEnemy.TempSpawnLineList)
+ {
+ _ = tempSpawnLine2;
+ float num24 = eternalTrialEnemy.TempTargetDifficulty / (float)eternalTrialEnemy.TempSpawnLineList.Count;
+ eternalTrialEnemy.TempSpawnLineTargetDifficulty.Add(num24);
+ int num25 = Mathf.Max(1, Mathf.RoundToInt(num24 / eternalTrialEnemy.DifficultyValueTemp));
+ num19 += num25;
+ eternalTrialEnemy.TempSpawnAmount.Add(num25);
+ float num26 = (float)num25 * eternalTrialEnemy.DifficultyValueTemp;
+ eternalTrialEnemy.TempSpawnLineActualDifficulty.Add(num26);
+ num23 += num26;
+ num17 += (float)num * (num24 / num4);
+ int num27 = Mathf.RoundToInt(num17);
+ num18 += num27;
+ num17 -= (float)num27;
+ eternalTrialEnemy.TempDropGold.Add(num27);
+ }
+ eternalTrialEnemy.TempActualDifficulty = num23;
+ num16 += num23;
+ }
+ foreach (EternalTrialEnemy item18 in list)
+ {
+ for (int n = 0; n < item18.TempSpawnLineList.Count; n++)
+ {
+ float num28 = item18.TempSpawnLineActualDifficulty[n];
+ float num29 = item18.TempSpawnLineTargetDifficulty[n];
+ num29 += num4 - num16;
+ if (num16 == num28 && num16 > num28)
+ {
+ continue;
+ }
+ int num30 = item18.TempSpawnAmount[n];
+ Tuple<float, int> tuple = AdjustSpawnDifficulty(item18, num29, num28);
+ int num31 = tuple.Item2 - num30;
+ if (num19 + num31 > 0)
+ {
+ num19 += num31;
+ item18.TempSpawnAmount[n] = tuple.Item2;
+ item18.TempSpawnLineActualDifficulty[n] = tuple.Item1;
+ item18.TempActualDifficulty = CalculateActualDifficulty(item18);
+ num16 = list.Sum((EternalTrialEnemy et) => et.TempActualDifficulty);
+ }
+ }
+ AdjustGoldAllocation(item18, list);
+ }
+ List<TagManager.ETag> list5 = new List<TagManager.ETag>();
+ foreach (EternalTrialEnemy item19 in list)
+ {
+ foreach (TagManager.ETag tag in item19.enemyPrefab.GetComponentInChildren<TaggedObject>().Tags)
+ {
+ if (!list5.Contains(tag) && counterableTags.Contains(tag))
+ {
+ list5.Add(tag);
+ }
+ }
+ }
+ float num32 = _OUTDefensePower[_waveNr];
+ if (_waveNr > 0)
+ {
+ num32 = _OUTDefensePower[_waveNr] - _OUTDefensePower[_waveNr - 1];
+ }
+ float num33 = num32 / (float)list5.Count;
+ for (int num34 = 0; num34 < counterableTags.Count; num34++)
+ {
+ if (list5.Contains(counterableTags[num34]))
+ {
+ tagsCountered[num34] += num33;
+ }
+ }
+ difficultyContributionsInNight[_waveNr].Add("---------------");
+ foreach (EternalTrialEnemy enemy in enemySet.enemies)
+ {
+ int num35 = 0;
+ foreach (TagManager.ETag tag2 in enemy.enemyPrefab.GetComponentInChildren<TaggedObject>().Tags)
+ {
+ int num36 = counterableTags.IndexOf(tag2);
+ if (num36 != -1)
+ {
+ num35 += (int)tagsCountered[num36];
+ }
+ }
+ float difficultyValue = enemy.difficultyValue;
+ enemy.DifficultyValueTemp = enemy.difficultyValue * Mathf.Clamp(Mathf.Pow(0.996f, num35), 0.4f, 1f);
+ difficultyContributionsInNight[_waveNr].Add(enemy.enemyPrefab.name + " difficulty reduced from " + difficultyValue + " to " + enemy.DifficultyValueTemp);
+ }
+ int num37 = 0;
+ foreach (EternalTrialEnemy item20 in list)
+ {
+ for (int num38 = 0; num38 < item20.TempSpawnLineList.Count; num38++)
+ {
+ if (item20.TempSpawnAmount[num38] > 0)
+ {
+ wave.spawns.Add(new Spawn(item20.enemyPrefab, item20.TempSpawnLineList[num38].SpawnLine, item20.TempSpawnAmount[num38], 0.2f, item20.TempDropGold[num38]));
+ num37 += item20.TempSpawnAmount[num38];
+ }
+ }
+ }
+ float num39 = 0f;
+ switch (settingEliteMode)
+ {
+ case EElitMode.OneRandomEliteSpawn:
+ {
+ List<Spawn> list6 = wave.spawns.Where((Spawn spawn) => spawn.count >= 10 && !spawn.eliteEnemies).ToList();
+ if (list6.Any())
+ {
+ Spawn spawn2 = list6[UnityEngine.Random.Range(0, list6.Count)];
+ spawn2.count = Mathf.RoundToInt((float)spawn2.count / 6f);
+ spawn2.interval *= 6f;
+ spawn2.eliteEnemies = true;
+ }
+ break;
+ }
+ case EElitMode.PartialConversionSmall:
+ num39 = 0.2f;
+ break;
+ case EElitMode.PartialConversionMedium:
+ num39 = 0.4f;
+ break;
+ case EElitMode.PartialConversionBig:
+ num39 = 0.6f;
+ break;
+ case EElitMode.PartialConversionRandom:
+ num39 = UnityEngine.Random.value * ((UnityEngine.Random.value < 0.25f) ? 0f : 1f);
+ break;
+ }
+ if (num39 > 0f)
+ {
+ for (int num40 = 0; num40 < wave.spawns.Count; num40++)
+ {
+ Spawn spawn3 = wave.spawns[num40];
+ if (!spawn3.eliteEnemies)
+ {
+ int num41 = Mathf.FloorToInt((float)spawn3.count * num39 / 6f) * 6;
+ int num42 = Mathf.FloorToInt((float)spawn3.goldCoins * num39);
+ if (num41 > 0)
+ {
+ spawn3.goldCoins -= num42;
+ spawn3.count -= num41;
+ Spawn item = new Spawn(spawn3.enemyPrefab, spawn3.spawnLine, num41 / 6, spawn3.interval * 6f, num42, spawn3.delay, _eliteEnemies: true);
+ wave.spawns.Add(item);
+ }
+ }
+ }
+ }
+ bool flag6 = false;
+ while (num37 > maxAmountOfUnitsPerWave)
+ {
+ Spawn spawn4 = null;
+ int index = -1;
+ for (int num43 = 0; num43 < wave.spawns.Count; num43++)
+ {
+ if ((spawn4 == null || wave.spawns[num43].count > spawn4.count) && !wave.spawns[num43].eliteEnemies)
+ {
+ spawn4 = wave.spawns[num43];
+ index = num43;
+ }
+ }
+ if (spawn4 == null || spawn4.count == 1)
+ {
+ flag6 = true;
+ break;
+ }
+ int num44 = Mathf.Max(1, spawn4.count / 6);
+ num37 -= spawn4.count;
+ num37 += num44;
+ spawn4.interval *= 6f;
+ spawn4.count = num44;
+ spawn4.eliteEnemies = true;
+ wave.spawns[index] = spawn4;
+ }
+ float lowestDelay = float.MaxValue;
+ int count = wave.spawns.Count;
+ float num45 = UnityEngine.Random.Range(0.05f, 0.45f);
+ float num46 = num5 / (float)count;
+ wave.spawns.ETShuffle(randomGenerator);
+ for (int num47 = 0; num47 < count; num47++)
+ {
+ Spawn spawn5 = wave.spawns[num47];
+ ESpawnInType eSpawnInType = settingESpawnInType;
+ if (num5 >= 45f)
+ {
+ if (UnityEngine.Random.value < 0.5f)
+ {
+ eSpawnInType = ESpawnInType.Normal;
+ }
+ else if (UnityEngine.Random.value < 0.5f)
+ {
+ eSpawnInType = ESpawnInType.DynamicSmallGroups;
+ }
+ else if (UnityEngine.Random.value < 0.5f)
+ {
+ eSpawnInType = ESpawnInType.OneSpawnAtATime;
+ }
+ }
+ switch (eSpawnInType)
+ {
+ case ESpawnInType.Normal:
+ CalculateSpawnParameters(spawn5.count, num5, ref lowestDelay, out spawn5.interval, out spawn5.delay);
+ break;
+ case ESpawnInType.TwoWaves:
+ SplitSpawns(wave.spawns, spawn5, 2, num5 * 0.1f, ref lowestDelay, num5);
+ break;
+ case ESpawnInType.ThreeWaves:
+ SplitSpawns(wave.spawns, spawn5, 3, num5 * 0.1f, ref lowestDelay, num5);
+ break;
+ case ESpawnInType.DynamicSmallGroups:
+ {
+ int num48 = 4 + UnityEngine.Random.Range(0, 3);
+ int targetSubSpawnCount = Mathf.Max(1, Mathf.RoundToInt(spawn5.count / num48));
+ float subSpawnDuration = num5 * num45 / (float)targetSubSpawnCount;
+ SplitSpawns(wave.spawns, spawn5, targetSubSpawnCount, subSpawnDuration, ref lowestDelay, num5);
+ break;
+ }
+ case ESpawnInType.DynamicBigGroups:
+ {
+ int num48 = 8 + UnityEngine.Random.Range(0, 10);
+ int targetSubSpawnCount = Mathf.Max(1, Mathf.RoundToInt(spawn5.count / num48));
+ float subSpawnDuration = num5 * num45 / (float)targetSubSpawnCount;
+ SplitSpawns(wave.spawns, spawn5, targetSubSpawnCount, subSpawnDuration, ref lowestDelay, num5);
+ break;
+ }
+ case ESpawnInType.RandomGroupsAndStreams:
+ {
+ int targetSubSpawnCount = UnityEngine.Random.Range(1, 6);
+ float subSpawnDuration = num5 * num45 / (float)targetSubSpawnCount;
+ SplitSpawns(wave.spawns, spawn5, targetSubSpawnCount, subSpawnDuration, ref lowestDelay, num5);
+ break;
+ }
+ case ESpawnInType.OneSpawnAtATime:
+ CalculateSpawnParameters(spawn5.count, num46, ref lowestDelay, out spawn5.interval, out spawn5.delay);
+ spawn5.delay += num46 * (float)num47;
+ break;
+ case ESpawnInType.OneSpawnAtATimeInWaves:
+ {
+ int targetSubSpawnCount = UnityEngine.Random.Range(2, 4);
+ SplitSpawns(wave.spawns, spawn5, targetSubSpawnCount, num46 * 0.1f, ref lowestDelay, num46, num46 * (float)num47);
+ break;
+ }
+ }
+ }
+ foreach (Spawn spawn6 in wave.spawns)
+ {
+ spawn6.delay -= lowestDelay;
+ }
+ if (num17 > 0.01f)
+ {
+ Debug.LogError("We did not drop all the gold. Thats bad. Leftover: " + num17);
+ }
+ if (num18 != num)
+ {
+ Debug.LogError("Dropped gold and gold to drop do not match: " + num18 + " - " + num);
+ }
+ int num49 = 0;
+ foreach (EternalTrialEnemy item21 in list)
+ {
+ num49 += CalculateTotalGoldDropped(item21);
+ }
+ if (num49 != num)
+ {
+ Debug.LogError("Gold check and gold to drop do not match: " + num49 + " - " + num);
+ }
+ _success = !flag6;
+ return wave;
+ }
+
+ private EternalTrialEnemy FirstPossibleEnemyForWave(int _waveNr, int _startIndex, out int _foundIndex)
+ {
+ _foundIndex = _startIndex % shuffledEnemies.Count;
+ int num = _foundIndex;
+ do
+ {
+ if (shuffledEnemies[_foundIndex].minDefenseInvestment <= (float)_OUTDefensePower[_waveNr])
+ {
+ return shuffledEnemies[_foundIndex];
+ }
+ _foundIndex = (_foundIndex + 1) % shuffledEnemies.Count;
+ }
+ while (_foundIndex != num);
+ return shuffledEnemies[num];
+ }
+
+ private EnemySpawnLine FirstPossibleSpawnFor(EternalTrialEnemy _enemy, int _startIndex, out int _foundIndex)
+ {
+ bool flying = _enemy.flying;
+ bool bigGround = _enemy.bigGround;
+ bool smallGround = _enemy.smallGround;
+ _foundIndex = _startIndex % shuffledSpawns.Count;
+ int num = _foundIndex;
+ do
+ {
+ if ((shuffledSpawns[_foundIndex].canSpawnBigGround || !bigGround) && (shuffledSpawns[_foundIndex].canSpawnFlying || !flying) && (shuffledSpawns[_foundIndex].canSpawnSmallGround || !smallGround))
+ {
+ return shuffledSpawns[_foundIndex];
+ }
+ _foundIndex = (_foundIndex + 1) % shuffledSpawns.Count;
+ }
+ while (_foundIndex != num);
+ return shuffledSpawns[num];
+ }
+
+ private bool IsPossibleSpawnLineFor(EternalTrialEnemy _enemy, EnemySpawnLine _line)
+ {
+ if ((_line.canSpawnBigGround || !_enemy.bigGround) && (_line.canSpawnFlying || !_enemy.flying) && (_line.canSpawnSmallGround || !_enemy.smallGround))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ private Tuple<float, int> AdjustSpawnDifficulty(EternalTrialEnemy et, float targetDiff, float currentDiff)
+ {
+ int num = Mathf.Max(0, Mathf.RoundToInt(targetDiff / et.DifficultyValueTemp));
+ float num2 = (float)num * et.DifficultyValueTemp;
+ if (Mathf.Abs(targetDiff - num2) < Mathf.Abs(targetDiff - currentDiff))
+ {
+ return new Tuple<float, int>(num2, num);
+ }
+ return new Tuple<float, int>(currentDiff, Mathf.RoundToInt(currentDiff / et.DifficultyValueTemp));
+ }
+
+ private void AdjustGoldAllocation(EternalTrialEnemy et, List<EternalTrialEnemy> enemyList)
+ {
+ if (et.TempSpawnAmount.All((int amount) => amount == 0))
+ {
+ int num = et.TempDropGold.Sum();
+ foreach (EternalTrialEnemy enemy in enemyList)
+ {
+ if (enemy == et || !enemy.TempSpawnAmount.Any((int amount) => amount > 0))
+ {
+ continue;
+ }
+ for (int i = 0; i < enemy.TempSpawnAmount.Count; i++)
+ {
+ if (num <= 0)
+ {
+ break;
+ }
+ if (enemy.TempSpawnAmount[i] > 0)
+ {
+ enemy.TempDropGold[i] += num;
+ num = 0;
+ }
+ }
+ }
+ for (int j = 0; j < et.TempDropGold.Count; j++)
+ {
+ et.TempDropGold[j] = 0;
+ }
+ return;
+ }
+ for (int k = 0; k < et.TempSpawnAmount.Count; k++)
+ {
+ if (et.TempSpawnAmount[k] != 0)
+ {
+ continue;
+ }
+ int num2 = et.TempDropGold[k];
+ et.TempDropGold[k] = 0;
+ for (int l = 0; l < et.TempSpawnAmount.Count; l++)
+ {
+ if (num2 <= 0)
+ {
+ break;
+ }
+ if (et.TempSpawnAmount[l] > 0)
+ {
+ et.TempDropGold[l] += num2;
+ num2 = 0;
+ }
+ }
+ }
+ }
+
+ private float CalculateActualDifficulty(EternalTrialEnemy et)
+ {
+ float num = 0f;
+ for (int i = 0; i < et.TempSpawnAmount.Count; i++)
+ {
+ num += (float)et.TempSpawnAmount[i] * et.DifficultyValueTemp;
+ }
+ return num;
+ }
+
+ private int CalculateTotalGoldDropped(EternalTrialEnemy et)
+ {
+ int num = 0;
+ for (int i = 0; i < et.TempSpawnAmount.Count; i++)
+ {
+ num += et.TempDropGold[i];
+ }
+ return num;
+ }
+
+ private static void RemoveRandomInstances<T>(ref List<T> list, System.Random rng)
+ {
+ int num = rng.Next(0, list.Count);
+ for (int i = 0; i < num; i++)
+ {
+ if (list.Count <= 1)
+ {
+ break;
+ }
+ int index = rng.Next(0, list.Count);
+ list.RemoveAt(index);
+ }
+ }
+
+ private void RemoveInvalidEnemiesFromShuffeledEnemeisAndShuffle(out List<EternalTrialEnemy> removedEnemies, System.Random randomGenerator)
+ {
+ shuffledEnemies.ETShuffle(randomGenerator);
+ removedEnemies = new List<EternalTrialEnemy>();
+ switch (settingEnemyPreselection)
+ {
+ case EEnemyPreselection.MonstersOnly:
+ {
+ for (int num6 = shuffledEnemies.Count - 1; num6 >= 0; num6--)
+ {
+ if (!shuffledEnemies[num6].enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.Monster))
+ {
+ removedEnemies.Add(shuffledEnemies[num6]);
+ shuffledEnemies.RemoveAt(num6);
+ }
+ }
+ break;
+ }
+ case EEnemyPreselection.NoMonsters:
+ {
+ for (int num10 = shuffledEnemies.Count - 1; num10 >= 0; num10--)
+ {
+ if (shuffledEnemies[num10].enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.Monster))
+ {
+ removedEnemies.Add(shuffledEnemies[num10]);
+ shuffledEnemies.RemoveAt(num10);
+ }
+ }
+ break;
+ }
+ case EEnemyPreselection.FastOnly:
+ {
+ for (int num2 = shuffledEnemies.Count - 1; num2 >= 0; num2--)
+ {
+ if (!shuffledEnemies[num2].enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.FastMoving))
+ {
+ removedEnemies.Add(shuffledEnemies[num2]);
+ shuffledEnemies.RemoveAt(num2);
+ }
+ }
+ break;
+ }
+ case EEnemyPreselection.NoFast:
+ {
+ for (int num8 = shuffledEnemies.Count - 1; num8 >= 0; num8--)
+ {
+ if (shuffledEnemies[num8].enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.FastMoving))
+ {
+ removedEnemies.Add(shuffledEnemies[num8]);
+ shuffledEnemies.RemoveAt(num8);
+ }
+ }
+ break;
+ }
+ case EEnemyPreselection.MeleeOnly:
+ {
+ for (int num4 = shuffledEnemies.Count - 1; num4 >= 0; num4--)
+ {
+ if (!shuffledEnemies[num4].enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.MeeleFighter))
+ {
+ removedEnemies.Add(shuffledEnemies[num4]);
+ shuffledEnemies.RemoveAt(num4);
+ }
+ }
+ break;
+ }
+ case EEnemyPreselection.RangedOnly:
+ {
+ for (int num11 = shuffledEnemies.Count - 1; num11 >= 0; num11--)
+ {
+ if (!shuffledEnemies[num11].enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.RangedFighter))
+ {
+ removedEnemies.Add(shuffledEnemies[num11]);
+ shuffledEnemies.RemoveAt(num11);
+ }
+ }
+ break;
+ }
+ case EEnemyPreselection.NoFlying:
+ {
+ for (int num9 = shuffledEnemies.Count - 1; num9 >= 0; num9--)
+ {
+ if (shuffledEnemies[num9].enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.Flying))
+ {
+ removedEnemies.Add(shuffledEnemies[num9]);
+ shuffledEnemies.RemoveAt(num9);
+ }
+ }
+ break;
+ }
+ case EEnemyPreselection.FlyingOnly:
+ {
+ for (int num7 = shuffledEnemies.Count - 1; num7 >= 0; num7--)
+ {
+ if (!shuffledEnemies[num7].enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.Flying))
+ {
+ removedEnemies.Add(shuffledEnemies[num7]);
+ shuffledEnemies.RemoveAt(num7);
+ }
+ }
+ break;
+ }
+ case EEnemyPreselection.NoSiege:
+ {
+ for (int num5 = shuffledEnemies.Count - 1; num5 >= 0; num5--)
+ {
+ if (shuffledEnemies[num5].enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.SiegeWeapon))
+ {
+ removedEnemies.Add(shuffledEnemies[num5]);
+ shuffledEnemies.RemoveAt(num5);
+ }
+ }
+ break;
+ }
+ case EEnemyPreselection.VulnerableToSplashOnly:
+ {
+ for (int num3 = shuffledEnemies.Count - 1; num3 >= 0; num3--)
+ {
+ if (!shuffledEnemies[num3].enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.NaturallyVulnerableToSplash))
+ {
+ removedEnemies.Add(shuffledEnemies[num3]);
+ shuffledEnemies.RemoveAt(num3);
+ }
+ }
+ break;
+ }
+ case EEnemyPreselection.NoVulnerableToSplash:
+ {
+ for (int num = shuffledEnemies.Count - 1; num >= 0; num--)
+ {
+ if (shuffledEnemies[num].enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.NaturallyVulnerableToSplash))
+ {
+ removedEnemies.Add(shuffledEnemies[num]);
+ shuffledEnemies.RemoveAt(num);
+ }
+ }
+ break;
+ }
+ case EEnemyPreselection.RemoveRandoms_10:
+ RemoveRandomInstances(ref shuffledEnemies, randomGenerator);
+ break;
+ }
+ bool flag = true;
+ foreach (EternalTrialEnemy shuffledEnemy in shuffledEnemies)
+ {
+ if (!shuffledEnemy.enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.Flying))
+ {
+ flag = false;
+ break;
+ }
+ }
+ if (!flag)
+ {
+ return;
+ }
+ foreach (EternalTrialEnemy removedEnemy in removedEnemies)
+ {
+ if (!removedEnemy.enemyPrefab.GetComponent<TaggedObject>().Tags.Contains(TagManager.ETag.Flying))
+ {
+ shuffledEnemies.Add(removedEnemy);
+ shuffledEnemies.ETShuffle(randomGenerator);
+ break;
+ }
+ }
+ }
+
+ private void CalculateSpawnParameters(int enemyCount, float spawnDuration, ref float lowestDelay, out float interval, out float delay)
+ {
+ interval = 0.02f;
+ delay = 0f;
+ if (enemyCount > 1)
+ {
+ interval = spawnDuration / (float)(enemyCount - 1);
+ }
+ else
+ {
+ delay = UnityEngine.Random.value * spawnDuration;
+ }
+ lowestDelay = Mathf.Min(lowestDelay, delay);
+ }
+
+ private int[] DistributeEvenly(int total, int divisions)
+ {
+ int[] array = new int[divisions];
+ int num = total / divisions;
+ int num2 = total % divisions;
+ for (int i = 0; i < divisions; i++)
+ {
+ array[i] = num + ((i < num2) ? 1 : 0);
+ }
+ return array;
+ }
+
+ private int SplitSpawns(List<Spawn> listToAddTo, Spawn spawnToSplit, int targetSubSpawnCount, float subSpawnDuration, ref float lowestDelay, float totalSpawnDuration, float addedDelay = 0f)
+ {
+ if (spawnToSplit.count <= 1)
+ {
+ CalculateSpawnParameters(spawnToSplit.count, totalSpawnDuration, ref lowestDelay, out spawnToSplit.interval, out spawnToSplit.delay);
+ spawnToSplit.delay += addedDelay;
+ return 0;
+ }
+ if (targetSubSpawnCount <= 1)
+ {
+ CalculateSpawnParameters(spawnToSplit.count, totalSpawnDuration, ref lowestDelay, out spawnToSplit.interval, out spawnToSplit.delay);
+ spawnToSplit.delay += addedDelay;
+ return 0;
+ }
+ if (targetSubSpawnCount > spawnToSplit.count)
+ {
+ targetSubSpawnCount = spawnToSplit.count;
+ }
+ int num = 0;
+ int[] array = DistributeEvenly(spawnToSplit.count, targetSubSpawnCount);
+ int[] array2 = DistributeEvenly(spawnToSplit.goldCoins, targetSubSpawnCount);
+ float num2 = (totalSpawnDuration - subSpawnDuration) / (float)(targetSubSpawnCount - 1);
+ CalculateSpawnParameters(array[0], subSpawnDuration, ref lowestDelay, out spawnToSplit.interval, out spawnToSplit.delay);
+ spawnToSplit.delay += addedDelay;
+ spawnToSplit.count = array[0];
+ spawnToSplit.goldCoins = array2[0];
+ for (int i = 1; i < targetSubSpawnCount; i++)
+ {
+ float num3 = num2 * (float)i;
+ CalculateSpawnParameters(array[i], subSpawnDuration, ref lowestDelay, out var interval, out var delay);
+ Spawn item = new Spawn(spawnToSplit.enemyPrefab, spawnToSplit.spawnLine, array[i], interval, array2[i], num3 + delay + addedDelay, spawnToSplit.eliteEnemies);
+ listToAddTo.Add(item);
+ num++;
+ }
+ return num;
+ }
+
+ public static T GetRandomEnumValue<T>() where T : Enum
+ {
+ Array values = Enum.GetValues(typeof(T));
+ return (T)values.GetValue(UnityEngine.Random.Range(0, values.Length));
+ }
+
+ public static T GetRandomEnumValueWithDistribution<T>() where T : Enum
+ {
+ Array values = Enum.GetValues(typeof(T));
+ List<T> list = new List<T>();
+ foreach (object item in values)
+ {
+ string text = item.ToString();
+ int num = text.LastIndexOf('_');
+ if (num > 0 && int.TryParse(text.Substring(num + 1), out var result))
+ {
+ for (int i = 0; i < result; i++)
+ {
+ list.Add((T)item);
+ }
+ }
+ else
+ {
+ list.Add((T)item);
+ }
+ }
+ int index = UnityEngine.Random.Range(0, list.Count);
+ return list[index];
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/SuspendPlayerCollisionUntilNoOverlap.cs b/Thronefall_v1.57/Thronefall/Thronefall/SuspendPlayerCollisionUntilNoOverlap.cs
new file mode 100644
index 0000000..5b41097
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/SuspendPlayerCollisionUntilNoOverlap.cs
@@ -0,0 +1,98 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class SuspendPlayerCollisionUntilNoOverlap : MonoBehaviour
+{
+ public bool triggerOnEnable = true;
+
+ public LayerMask scanLayer;
+
+ private List<Collider> targetColliders = new List<Collider>();
+
+ private Collider[] overlaps;
+
+ private bool suspended;
+
+ private CharacterController trackedTarget;
+
+ private const float EXTEND_PLAYER_RADIUS_MULTI = 3.5f;
+
+ private void Awake()
+ {
+ targetColliders.AddRange(GetComponentsInChildren<Collider>());
+ for (int num = targetColliders.Count - 1; num >= 0; num--)
+ {
+ if (targetColliders[num].isTrigger)
+ {
+ targetColliders.RemoveAt(num);
+ }
+ }
+ }
+
+ private void OnEnable()
+ {
+ if (triggerOnEnable)
+ {
+ Trigger();
+ }
+ }
+
+ public void Trigger()
+ {
+ if (!PlayerManager.Instance)
+ {
+ return;
+ }
+ suspended = true;
+ PlayerMovement closestPlayer = PlayerManager.GetClosestPlayer(base.transform.position);
+ if ((bool)closestPlayer)
+ {
+ trackedTarget = closestPlayer.GetComponent<CharacterController>();
+ }
+ foreach (Collider targetCollider in targetColliders)
+ {
+ targetCollider.isTrigger = true;
+ }
+ }
+
+ private void SwitchBack()
+ {
+ suspended = false;
+ foreach (Collider targetCollider in targetColliders)
+ {
+ targetCollider.isTrigger = false;
+ }
+ }
+
+ private void Update()
+ {
+ if (!suspended)
+ {
+ return;
+ }
+ if ((bool)trackedTarget)
+ {
+ float num = trackedTarget.height / 2f * 3.5f;
+ Vector3 point = trackedTarget.transform.position + Vector3.down * num;
+ Vector3 point2 = trackedTarget.transform.position + Vector3.up * num;
+ overlaps = Physics.OverlapCapsule(point, point2, trackedTarget.radius * 3.5f, scanLayer, QueryTriggerInteraction.Collide);
+ bool flag = true;
+ Collider[] array = overlaps;
+ foreach (Collider item in array)
+ {
+ if (targetColliders.Contains(item))
+ {
+ flag = false;
+ }
+ }
+ if (flag)
+ {
+ SwitchBack();
+ }
+ }
+ else
+ {
+ SwitchBack();
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUIAudioHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUIAudioHelper.cs
new file mode 100644
index 0000000..39c293e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUIAudioHelper.cs
@@ -0,0 +1,53 @@
+using UnityEngine;
+
+[RequireComponent(typeof(ThronefallUIElement))]
+public class TFUIAudioHelper : MonoBehaviour
+{
+ public bool playOnColdSelect;
+
+ public ThronefallAudioManager.AudioOneShot onSelect = ThronefallAudioManager.AudioOneShot.ButtonSelect;
+
+ public ThronefallAudioManager.AudioOneShot onApply = ThronefallAudioManager.AudioOneShot.ButtonApply;
+
+ private ThronefallUIElement tfui;
+
+ private bool selected
+ {
+ get
+ {
+ if (tfui.CurrentState == ThronefallUIElement.SelectionState.Selected || tfui.CurrentState == ThronefallUIElement.SelectionState.FocussedAndSelected)
+ {
+ if (tfui.PreviousState != ThronefallUIElement.SelectionState.FocussedAndSelected)
+ {
+ return tfui.PreviousState != ThronefallUIElement.SelectionState.Selected;
+ }
+ return false;
+ }
+ return false;
+ }
+ }
+
+ private void Start()
+ {
+ tfui = GetComponent<ThronefallUIElement>();
+ tfui.onApply.AddListener(PlayApply);
+ tfui.onSelectionStateChange.AddListener(PlaySelect);
+ if (selected && playOnColdSelect)
+ {
+ PlaySelect();
+ }
+ }
+
+ private void PlayApply()
+ {
+ ThronefallAudioManager.Oneshot(onApply);
+ }
+
+ private void PlaySelect()
+ {
+ if (selected)
+ {
+ ThronefallAudioManager.Oneshot(onSelect);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUIBlockoutElement.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUIBlockoutElement.cs
new file mode 100644
index 0000000..a0150ad
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUIBlockoutElement.cs
@@ -0,0 +1,44 @@
+using System;
+
+public class TFUIBlockoutElement : ThronefallUIElement
+{
+ public ThronefallUIElement target;
+
+ private void OnEnable()
+ {
+ botNav = target.botNav;
+ topNav = target.topNav;
+ rightNav = target.rightNav;
+ leftNav = target.leftNav;
+ }
+
+ protected override void OnApply()
+ {
+ target.Apply();
+ }
+
+ protected override void OnClear()
+ {
+ target.Clear();
+ }
+
+ protected override void OnFocus()
+ {
+ target.Focus();
+ }
+
+ protected override void OnFocusAndSelect()
+ {
+ target.FocusAndSelect();
+ }
+
+ protected override void OnHardStateSet(SelectionState selectionState)
+ {
+ throw new NotImplementedException();
+ }
+
+ protected override void OnSelect()
+ {
+ target.Select();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUICheckboxMouseCatcher.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUICheckboxMouseCatcher.cs
new file mode 100644
index 0000000..0fe58cb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUICheckboxMouseCatcher.cs
@@ -0,0 +1,43 @@
+using MPUIKIT;
+using UnityEngine;
+
+public class TFUICheckboxMouseCatcher : ThronefallUIElement
+{
+ public Checkbox target;
+
+ public MPImageBasic targetGraphic;
+
+ public Color defaultColor;
+
+ public Color highlightColor;
+
+ protected override void OnApply()
+ {
+ target.Toggle();
+ targetGraphic.color = highlightColor;
+ }
+
+ protected override void OnClear()
+ {
+ targetGraphic.color = defaultColor;
+ }
+
+ protected override void OnFocus()
+ {
+ targetGraphic.color = highlightColor;
+ }
+
+ protected override void OnFocusAndSelect()
+ {
+ targetGraphic.color = highlightColor;
+ }
+
+ protected override void OnHardStateSet(SelectionState selectionState)
+ {
+ }
+
+ protected override void OnSelect()
+ {
+ targetGraphic.color = highlightColor;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUIEnemy.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUIEnemy.cs
new file mode 100644
index 0000000..152f9e4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUIEnemy.cs
@@ -0,0 +1,250 @@
+using System;
+using MPUIKIT;
+using TMPro;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class TFUIEnemy : ThronefallUIElement
+{
+ [Serializable]
+ public class Style
+ {
+ public float scale = 1f;
+
+ public Color outlineColor;
+
+ public AnimationCurve animationCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
+
+ public float animationDuration = 0.5f;
+
+ public Style(Color outlineColor, AnimationCurve animationCurve, float animationDuration, float scale)
+ {
+ this.scale = scale;
+ this.outlineColor = outlineColor;
+ this.animationCurve = animationCurve;
+ this.animationDuration = animationDuration;
+ }
+ }
+
+ public class Animation
+ {
+ public TFUIEnemy target;
+
+ public Style startStyle;
+
+ public Style endStyle;
+
+ public float clock;
+
+ public Animation(Style startStyle, Style endStyle, TFUIEnemy target)
+ {
+ this.startStyle = startStyle;
+ this.endStyle = endStyle;
+ this.target = target;
+ target.ApplyStyle(startStyle);
+ target.currentAnimation = this;
+ }
+
+ public void Tick()
+ {
+ clock += Time.unscaledDeltaTime;
+ float num = Mathf.InverseLerp(0f, endStyle.animationDuration, clock);
+ float t = endStyle.animationCurve.Evaluate(num);
+ target.backgroundImg.OutlineColor = Color.Lerp(startStyle.outlineColor, endStyle.outlineColor, t);
+ target.backgroundEliteImg.OutlineColor = target.backgroundImg.OutlineColor;
+ target.numberBg.color = target.backgroundImg.OutlineColor;
+ target.backgroundImg.transform.localScale = Vector3.one * Mathf.LerpUnclamped(startStyle.scale, endStyle.scale, t);
+ if (num >= 1f)
+ {
+ target.ApplyStyle(endStyle);
+ target.currentAnimation = null;
+ }
+ }
+ }
+
+ public Color defaultBGColor;
+
+ public Color highlightBGColor;
+
+ public Color defaultIconColor;
+
+ public Color highlightIconColor;
+
+ private Color originalIconColor;
+
+ [SerializeField]
+ private MPImageBasic backgroundImg;
+
+ [SerializeField]
+ private MPImageBasic backgroundEliteImg;
+
+ [SerializeField]
+ private MPImageBasic numberBg;
+
+ private MPImageBasic originalBackground;
+
+ [SerializeField]
+ private Image iconImg;
+
+ [SerializeField]
+ private Sprite lockIcon;
+
+ public TextMeshProUGUI numberText;
+
+ public AnimationCurve defaultAnimationCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
+
+ public float defaultAnimationTime = 0.3f;
+
+ public Style focussedStyle;
+
+ public Style selectedStyle;
+
+ public Style focussedAndSelectedStyle;
+
+ private Style defaultStyle;
+
+ private bool defaultStyleInitialized;
+
+ private bool selectedForLoadout;
+
+ private Animation currentAnimation;
+
+ private WaveEnemyInfo enemyInfoData;
+
+ private bool locked;
+
+ public WaveEnemyInfo Data => enemyInfoData;
+
+ public bool Locked => locked;
+
+ public Image IconImg => iconImg;
+
+ public Color GetBackgroundColor
+ {
+ get
+ {
+ if (!selectedForLoadout)
+ {
+ return defaultBGColor;
+ }
+ return highlightBGColor;
+ }
+ }
+
+ public Color GetIconColor
+ {
+ get
+ {
+ if (!selectedForLoadout)
+ {
+ return defaultIconColor;
+ }
+ return highlightIconColor;
+ }
+ }
+
+ public Color GetDefaultOutlineColor()
+ {
+ if (defaultStyle != null)
+ {
+ return defaultStyle.outlineColor;
+ }
+ return Color.white;
+ }
+
+ private void Update()
+ {
+ if (currentAnimation != null)
+ {
+ currentAnimation.Tick();
+ }
+ }
+
+ protected override void OnApply()
+ {
+ }
+
+ protected override void OnClear()
+ {
+ new Animation(GetStyle(previousState), defaultStyle, this);
+ }
+
+ protected override void OnFocus()
+ {
+ new Animation(GetStyle(previousState), focussedStyle, this);
+ }
+
+ protected override void OnSelect()
+ {
+ new Animation(GetStyle(previousState), selectedStyle, this);
+ }
+
+ protected override void OnFocusAndSelect()
+ {
+ new Animation(GetStyle(previousState), focussedAndSelectedStyle, this);
+ }
+
+ protected override void OnHardStateSet(SelectionState selectionState)
+ {
+ currentAnimation = null;
+ ApplyStyle(GetStyle(selectionState));
+ }
+
+ protected Style GetStyle(SelectionState state)
+ {
+ if (!defaultStyleInitialized)
+ {
+ InitializeDefaultStyle();
+ }
+ return state switch
+ {
+ SelectionState.Default => defaultStyle,
+ SelectionState.Focussed => focussedStyle,
+ SelectionState.Selected => selectedStyle,
+ SelectionState.FocussedAndSelected => focussedAndSelectedStyle,
+ _ => defaultStyle,
+ };
+ }
+
+ private void ApplyStyle(Style style)
+ {
+ backgroundImg.OutlineColor = style.outlineColor;
+ backgroundEliteImg.OutlineColor = style.outlineColor;
+ numberBg.color = style.outlineColor;
+ backgroundImg.transform.localScale = Vector3.one * style.scale;
+ }
+
+ private void InitializeDefaultStyle()
+ {
+ defaultStyle = new Style(backgroundImg.OutlineColor, defaultAnimationCurve, defaultAnimationTime, 1f);
+ defaultStyleInitialized = true;
+ }
+
+ public void SetDataSimple(WaveEnemyInfo e)
+ {
+ if (originalBackground == null)
+ {
+ originalBackground = backgroundImg;
+ originalIconColor = defaultIconColor;
+ }
+ enemyInfoData = e;
+ iconImg.sprite = e.enemyIcon;
+ defaultBGColor = backgroundImg.color;
+ defaultIconColor = iconImg.color;
+ numberText.text = e.enemyCount.ToString();
+ backgroundEliteImg.enabled = e.eliteEnemy;
+ originalBackground.enabled = !e.eliteEnemy;
+ if (e.eliteEnemy)
+ {
+ backgroundImg = backgroundEliteImg;
+ iconImg.color = Color.yellow;
+ defaultIconColor = iconImg.color;
+ }
+ else
+ {
+ backgroundImg = originalBackground;
+ iconImg.color = originalIconColor;
+ defaultIconColor = iconImg.color;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUIEnumMouseCatcher.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUIEnumMouseCatcher.cs
new file mode 100644
index 0000000..e46eb62
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUIEnumMouseCatcher.cs
@@ -0,0 +1,51 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class TFUIEnumMouseCatcher : ThronefallUIElement
+{
+ public List<ThronefallUIElement> focusWhitelist = new List<ThronefallUIElement>();
+
+ public GameObject buttons;
+
+ private UIFrame targetFrame;
+
+ protected override void OnApply()
+ {
+ }
+
+ protected override void OnClear()
+ {
+ }
+
+ protected override void OnFocus()
+ {
+ buttons.SetActive(value: true);
+ targetFrame.onNewFocus.AddListener(ListenForUnfocus);
+ }
+
+ protected override void OnFocusAndSelect()
+ {
+ }
+
+ protected override void OnHardStateSet(SelectionState selectionState)
+ {
+ }
+
+ protected override void OnSelect()
+ {
+ }
+
+ private void Start()
+ {
+ targetFrame = GetComponentInParent<UIFrame>();
+ }
+
+ private void ListenForUnfocus()
+ {
+ if (!(targetFrame.CurrentFocus == this) && !focusWhitelist.Contains(targetFrame.CurrentFocus))
+ {
+ buttons.SetActive(value: false);
+ targetFrame.onNewFocus.RemoveListener(ListenForUnfocus);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUIEnumSelectorButton.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUIEnumSelectorButton.cs
new file mode 100644
index 0000000..c758c11
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUIEnumSelectorButton.cs
@@ -0,0 +1,40 @@
+using MPUIKIT;
+using UnityEngine;
+
+public class TFUIEnumSelectorButton : ThronefallUIElement
+{
+ public MPImage targetGraphic;
+
+ public Color defaultColor;
+
+ public Color highlightColor;
+
+ protected override void OnApply()
+ {
+ targetGraphic.color = highlightColor;
+ }
+
+ protected override void OnClear()
+ {
+ targetGraphic.color = defaultColor;
+ }
+
+ protected override void OnFocus()
+ {
+ targetGraphic.color = highlightColor;
+ }
+
+ protected override void OnFocusAndSelect()
+ {
+ targetGraphic.color = highlightColor;
+ }
+
+ protected override void OnHardStateSet(SelectionState selectionState)
+ {
+ }
+
+ protected override void OnSelect()
+ {
+ targetGraphic.color = highlightColor;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUIEquippable.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUIEquippable.cs
new file mode 100644
index 0000000..9573ebf
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUIEquippable.cs
@@ -0,0 +1,375 @@
+using System;
+using MPUIKIT;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class TFUIEquippable : ThronefallUIElement
+{
+ [Serializable]
+ public class Style
+ {
+ public float scale = 1f;
+
+ public Color outlineColor;
+
+ public AnimationCurve animationCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
+
+ public float animationDuration = 0.5f;
+
+ public Style(Color outlineColor, AnimationCurve animationCurve, float animationDuration, float scale)
+ {
+ this.scale = scale;
+ this.outlineColor = outlineColor;
+ this.animationCurve = animationCurve;
+ this.animationDuration = animationDuration;
+ }
+ }
+
+ public class Animation
+ {
+ public TFUIEquippable target;
+
+ public Style startStyle;
+
+ public Style endStyle;
+
+ public float clock;
+
+ public Animation(Style startStyle, Style endStyle, TFUIEquippable target)
+ {
+ this.startStyle = startStyle;
+ this.endStyle = endStyle;
+ this.target = target;
+ target.ApplyStyle(startStyle);
+ target.currentAnimation = this;
+ }
+
+ public void Tick()
+ {
+ clock += Time.unscaledDeltaTime;
+ float num = Mathf.InverseLerp(0f, endStyle.animationDuration, clock);
+ float t = endStyle.animationCurve.Evaluate(num);
+ target.backgroundImg.OutlineColor = Color.Lerp(startStyle.outlineColor, endStyle.outlineColor, t);
+ target.backgroundImg.transform.localScale = Vector3.one * Mathf.LerpUnclamped(startStyle.scale, endStyle.scale, t);
+ if (num >= 1f)
+ {
+ target.ApplyStyle(endStyle);
+ target.currentAnimation = null;
+ }
+ }
+ }
+
+ [SerializeField]
+ private Color weaponBgColor;
+
+ [SerializeField]
+ private Color perkBgColor;
+
+ [SerializeField]
+ private Color mutatorBgColor;
+
+ [SerializeField]
+ private Color lockedBgColor;
+
+ [SerializeField]
+ private Color lockedOutlineColor;
+
+ [SerializeField]
+ private Color weaponHighlightColor;
+
+ [SerializeField]
+ private Color perkHightlightColor;
+
+ [SerializeField]
+ private Color mutatorHighlightColor;
+
+ [SerializeField]
+ private Color etDefaultMid;
+
+ [SerializeField]
+ private Color etDefaultHigh;
+
+ [SerializeField]
+ private Color highlightIconColor;
+
+ public MPImageBasic backgroundImg;
+
+ public Image iconImg;
+
+ [SerializeField]
+ private Sprite lockIcon;
+
+ [SerializeField]
+ private bool additionalColorsForOutlineAndIcon;
+
+ [SerializeField]
+ private Color unpickedIconAndOutlineColor;
+
+ public AnimationCurve defaultAnimationCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
+
+ public float defaultAnimationTime = 0.3f;
+
+ public Style focussedStyle;
+
+ public Style selectedStyle;
+
+ public Style focussedAndSelectedStyle;
+
+ private Style defaultStyle;
+
+ private bool defaultStyleInitialized;
+
+ private bool selectedForLoadout;
+
+ private Animation currentAnimation;
+
+ private Equippable equippableData;
+
+ private Color highlightBGColor;
+
+ private Color defaultBGColor;
+
+ private Color defaultIconColor;
+
+ private bool locked;
+
+ public Equippable Data => equippableData;
+
+ private bool isWeapon => equippableData is EquippableWeapon;
+
+ private bool isPerk => equippableData is EquippablePerk;
+
+ private bool isMutator => equippableData is EquippableMutation;
+
+ public bool Locked => locked;
+
+ public Image IconImg => iconImg;
+
+ public Color GetBackgroundColor
+ {
+ get
+ {
+ if (!selectedForLoadout)
+ {
+ return defaultBGColor;
+ }
+ return highlightBGColor;
+ }
+ }
+
+ public Color GetIconColor
+ {
+ get
+ {
+ if (!selectedForLoadout)
+ {
+ return defaultIconColor;
+ }
+ return highlightIconColor;
+ }
+ }
+
+ public Color GetDefaultOutlineColor()
+ {
+ if (defaultStyle != null)
+ {
+ return defaultStyle.outlineColor;
+ }
+ return Color.white;
+ }
+
+ private void Update()
+ {
+ if (currentAnimation != null)
+ {
+ currentAnimation.Tick();
+ }
+ }
+
+ protected override void OnApply()
+ {
+ }
+
+ protected override void OnClear()
+ {
+ new Animation(GetStyle(previousState), defaultStyle, this);
+ }
+
+ protected override void OnFocus()
+ {
+ new Animation(GetStyle(previousState), focussedStyle, this);
+ }
+
+ protected override void OnSelect()
+ {
+ new Animation(GetStyle(previousState), selectedStyle, this);
+ }
+
+ protected override void OnFocusAndSelect()
+ {
+ new Animation(GetStyle(previousState), focussedAndSelectedStyle, this);
+ }
+
+ protected override void OnHardStateSet(SelectionState selectionState)
+ {
+ currentAnimation = null;
+ ApplyStyle(GetStyle(selectionState));
+ }
+
+ protected Style GetStyle(SelectionState state)
+ {
+ if (!defaultStyleInitialized)
+ {
+ InitializeDefaultStyle();
+ }
+ return state switch
+ {
+ SelectionState.Default => defaultStyle,
+ SelectionState.Focussed => focussedStyle,
+ SelectionState.Selected => selectedStyle,
+ SelectionState.FocussedAndSelected => focussedAndSelectedStyle,
+ _ => defaultStyle,
+ };
+ }
+
+ private void ApplyStyle(Style style)
+ {
+ if (backgroundImg == null)
+ {
+ Debug.LogError("backround is null", base.gameObject);
+ }
+ backgroundImg.OutlineColor = style.outlineColor;
+ backgroundImg.transform.localScale = Vector3.one * style.scale;
+ }
+
+ private void InitializeDefaultStyle()
+ {
+ defaultStyle = new Style(backgroundImg.OutlineColor, defaultAnimationCurve, defaultAnimationTime, 1f);
+ defaultStyleInitialized = true;
+ }
+
+ public void SetData(Equippable e, bool loadoutIsFixed, bool overrideShow = false, LevelInfo levelInfo = null)
+ {
+ equippableData = e;
+ bool flag = PerkManager.instance.UnlockedEquippables.Contains(e) || (loadoutIsFixed && levelInfo.fixedLoadout.Contains(e));
+ bool flag2 = loadoutIsFixed && !levelInfo.fixedLoadout.Contains(e);
+ if ((flag && !flag2) || overrideShow)
+ {
+ iconImg.sprite = e.icon;
+ if (isWeapon)
+ {
+ backgroundImg.color = weaponBgColor;
+ highlightBGColor = weaponHighlightColor;
+ }
+ if (isPerk)
+ {
+ backgroundImg.color = perkBgColor;
+ highlightBGColor = perkHightlightColor;
+ }
+ if (isMutator)
+ {
+ backgroundImg.color = mutatorBgColor;
+ highlightBGColor = mutatorHighlightColor;
+ }
+ }
+ else if (flag && flag2)
+ {
+ iconImg.sprite = e.icon;
+ iconImg.color = lockedOutlineColor;
+ backgroundImg.color = lockedBgColor;
+ backgroundImg.OutlineColor = lockedOutlineColor;
+ }
+ else
+ {
+ iconImg.sprite = lockIcon;
+ iconImg.color = lockedOutlineColor;
+ backgroundImg.color = lockedBgColor;
+ backgroundImg.OutlineColor = lockedOutlineColor;
+ locked = true;
+ }
+ defaultBGColor = backgroundImg.color;
+ defaultIconColor = iconImg.color;
+ }
+
+ public void SetDataEternalTrials(Equippable e)
+ {
+ equippableData = e;
+ bool flag = false;
+ EquippablePerk equippablePerk = e as EquippablePerk;
+ if (equippablePerk != null && EternalTrialsRunManager.CurrentRun.disabledPerks.Contains(equippablePerk))
+ {
+ flag = true;
+ }
+ if (!flag)
+ {
+ iconImg.sprite = e.icon;
+ if (isWeapon)
+ {
+ backgroundImg.color = weaponBgColor;
+ highlightBGColor = weaponHighlightColor;
+ }
+ if (isPerk)
+ {
+ backgroundImg.color = perkBgColor;
+ highlightBGColor = perkHightlightColor;
+ }
+ if (isMutator)
+ {
+ backgroundImg.color = mutatorBgColor;
+ highlightBGColor = mutatorHighlightColor;
+ }
+ iconImg.color = etDefaultMid;
+ highlightIconColor = etDefaultHigh;
+ backgroundImg.OutlineColor = etDefaultMid;
+ }
+ else
+ {
+ iconImg.sprite = e.icon;
+ iconImg.color = lockedOutlineColor;
+ highlightIconColor = lockedOutlineColor;
+ backgroundImg.OutlineColor = lockedOutlineColor;
+ backgroundImg.color = lockedBgColor;
+ highlightBGColor = lockedBgColor;
+ }
+ defaultBGColor = backgroundImg.color;
+ defaultIconColor = iconImg.color;
+ InitializeDefaultStyle();
+ }
+
+ public void SetDataSimple(Equippable e)
+ {
+ equippableData = e;
+ iconImg.sprite = e.icon;
+ if (isWeapon)
+ {
+ backgroundImg.color = weaponBgColor;
+ highlightBGColor = weaponHighlightColor;
+ }
+ if (isPerk)
+ {
+ backgroundImg.color = perkBgColor;
+ highlightBGColor = perkHightlightColor;
+ }
+ if (isMutator)
+ {
+ backgroundImg.color = mutatorBgColor;
+ highlightBGColor = mutatorHighlightColor;
+ }
+ defaultBGColor = backgroundImg.color;
+ defaultIconColor = iconImg.color;
+ }
+
+ public void Pick()
+ {
+ backgroundImg.color = highlightBGColor;
+ iconImg.color = highlightIconColor;
+ selectedForLoadout = true;
+ }
+
+ public void UnPick()
+ {
+ backgroundImg.color = defaultBGColor;
+ iconImg.color = defaultIconColor;
+ selectedForLoadout = false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUIFocusCatcher.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUIFocusCatcher.cs
new file mode 100644
index 0000000..bb66359
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUIFocusCatcher.cs
@@ -0,0 +1,26 @@
+public class TFUIFocusCatcher : ThronefallUIElement
+{
+ protected override void OnApply()
+ {
+ }
+
+ protected override void OnClear()
+ {
+ }
+
+ protected override void OnFocus()
+ {
+ }
+
+ protected override void OnFocusAndSelect()
+ {
+ }
+
+ protected override void OnHardStateSet(SelectionState selectionState)
+ {
+ }
+
+ protected override void OnSelect()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUIIncomeDisplay.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUIIncomeDisplay.cs
new file mode 100644
index 0000000..2af2966
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUIIncomeDisplay.cs
@@ -0,0 +1,92 @@
+using System.Collections.Generic;
+using I2.Loc;
+using TMPro;
+
+public class TFUIIncomeDisplay : TFUIPerklike
+{
+ public TextMeshProUGUI displayNumber;
+
+ private int iFromBuildings;
+
+ private int iFromBuildersGuild;
+
+ private int iFromTreasureHunter;
+
+ private int iFromEnemies;
+
+ private int currentIncome;
+
+ public int CurrentIncome => currentIncome;
+
+ public string GetTitle()
+ {
+ return LocalizationManager.GetTranslation("Menu/Gold Income");
+ }
+
+ public string GetDescription()
+ {
+ string text = "";
+ text += "\n";
+ text = text + LocalizationManager.GetTranslation("Menu/Income From Buildings") + " <sprite name=arrow_right> <sprite name=coin><style=Body Numerals>" + iFromBuildings + "</style>";
+ text += "\n";
+ if (iFromBuildersGuild > 0)
+ {
+ text = text + LocalizationManager.GetTranslation("Building/Castle Center Choice Builder's Guild") + " <sprite name=arrow_right> <sprite name=coin><style=Body Numerals>" + iFromBuildersGuild + "</style>";
+ text += "\n";
+ }
+ if (iFromTreasureHunter > 0)
+ {
+ text = text + LocalizationManager.GetTranslation("Equippable/Treasure Hunter") + " <sprite name=arrow_right> <sprite name=coin><style=Body Numerals>" + iFromTreasureHunter + "</style>";
+ text += "\n";
+ }
+ text = text + LocalizationManager.GetTranslation("Menu/Income From Enemies") + " <sprite name=arrow_right> <sprite name=coin><style=Body Numerals>" + iFromEnemies + "</style>";
+ return text + "\n";
+ }
+
+ public void UpdateData()
+ {
+ List<TaggedObject> list = new List<TaggedObject>();
+ TagManager.instance.FindAllTaggedObjectsWithTag(list, TagManager.ETag.Building);
+ List<BuildSlot> list2 = new List<BuildSlot>();
+ BuildSlot buildSlot = null;
+ foreach (TaggedObject item in list)
+ {
+ buildSlot = item.GetComponentInParent<BuildSlot>();
+ if ((bool)buildSlot && buildSlot.State == BuildSlot.BuildingState.Built)
+ {
+ list2.Add(buildSlot);
+ }
+ }
+ currentIncome = 0;
+ iFromBuildings = 0;
+ iFromBuildersGuild = 0;
+ iFromTreasureHunter = 0;
+ iFromEnemies = 0;
+ foreach (BuildSlot item2 in list2)
+ {
+ iFromBuildings += item2.GoldIncome;
+ }
+ if ((bool)DayNightCycle.Instance && DayNightCycle.Instance.CurrentTimestate == DayNightCycle.Timestate.Day && (bool)UpgradeBuildersGuild.Instance)
+ {
+ iFromBuildersGuild += UpgradeBuildersGuild.Instance.GetIncomeChangeIfNextUpgradeIsPossible();
+ }
+ if (PerkManager.instance.TreasureHunterActive && (bool)EnemySpawner.instance)
+ {
+ int num = EnemySpawner.instance.Wavenumber;
+ if (DayNightCycle.Instance.CurrentTimestate == DayNightCycle.Timestate.Day)
+ {
+ num++;
+ }
+ int amount = 0;
+ EnemySpawner.instance.GetTreasureHunterBonus(num, out amount);
+ iFromTreasureHunter += amount;
+ }
+ WaveInfo waveInfoForNextWave = EnemySpawner.GetWaveInfoForNextWave();
+ if (waveInfoForNextWave != null)
+ {
+ iFromEnemies += waveInfoForNextWave.goldReward;
+ }
+ currentIncome = iFromBuildings + iFromBuildersGuild + iFromTreasureHunter + iFromEnemies;
+ displayNumber.text = currentIncome.ToString();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUIPerklike.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUIPerklike.cs
new file mode 100644
index 0000000..a41652f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUIPerklike.cs
@@ -0,0 +1,161 @@
+using System;
+using MPUIKIT;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class TFUIPerklike : ThronefallUIElement
+{
+ [Serializable]
+ public class Style
+ {
+ public float scale = 1f;
+
+ public Color outlineColor;
+
+ public AnimationCurve animationCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
+
+ public float animationDuration = 0.5f;
+
+ public Style(Color outlineColor, AnimationCurve animationCurve, float animationDuration, float scale)
+ {
+ this.scale = scale;
+ this.outlineColor = outlineColor;
+ this.animationCurve = animationCurve;
+ this.animationDuration = animationDuration;
+ }
+ }
+
+ public class Animation
+ {
+ public TFUIPerklike target;
+
+ public Style startStyle;
+
+ public Style endStyle;
+
+ public float clock;
+
+ public Animation(Style startStyle, Style endStyle, TFUIPerklike target)
+ {
+ this.startStyle = startStyle;
+ this.endStyle = endStyle;
+ this.target = target;
+ target.ApplyStyle(startStyle);
+ target.currentAnimation = this;
+ }
+
+ public void Tick()
+ {
+ clock += Time.unscaledDeltaTime;
+ float num = Mathf.InverseLerp(0f, endStyle.animationDuration, clock);
+ float t = endStyle.animationCurve.Evaluate(num);
+ target.backgroundImg.OutlineColor = Color.Lerp(startStyle.outlineColor, endStyle.outlineColor, t);
+ target.backgroundImg.transform.localScale = Vector3.one * Mathf.LerpUnclamped(startStyle.scale, endStyle.scale, t);
+ if (num >= 1f)
+ {
+ target.ApplyStyle(endStyle);
+ target.currentAnimation = null;
+ }
+ }
+ }
+
+ [SerializeField]
+ private Color highlightIconColor;
+
+ public MPImageBasic backgroundImg;
+
+ public Image iconImg;
+
+ public AnimationCurve defaultAnimationCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
+
+ public float defaultAnimationTime = 0.3f;
+
+ public Style focussedStyle;
+
+ public Style selectedStyle;
+
+ public Style focussedAndSelectedStyle;
+
+ private Style defaultStyle;
+
+ private bool defaultStyleInitialized;
+
+ private Animation currentAnimation;
+
+ public Image IconImg => iconImg;
+
+ public Color GetDefaultOutlineColor()
+ {
+ if (defaultStyle != null)
+ {
+ return defaultStyle.outlineColor;
+ }
+ return Color.white;
+ }
+
+ private void Update()
+ {
+ if (currentAnimation != null)
+ {
+ currentAnimation.Tick();
+ }
+ }
+
+ protected override void OnApply()
+ {
+ }
+
+ protected override void OnClear()
+ {
+ new Animation(GetStyle(previousState), defaultStyle, this);
+ }
+
+ protected override void OnFocus()
+ {
+ new Animation(GetStyle(previousState), focussedStyle, this);
+ }
+
+ protected override void OnSelect()
+ {
+ new Animation(GetStyle(previousState), selectedStyle, this);
+ }
+
+ protected override void OnFocusAndSelect()
+ {
+ new Animation(GetStyle(previousState), focussedAndSelectedStyle, this);
+ }
+
+ protected override void OnHardStateSet(SelectionState selectionState)
+ {
+ currentAnimation = null;
+ ApplyStyle(GetStyle(selectionState));
+ }
+
+ protected Style GetStyle(SelectionState state)
+ {
+ if (!defaultStyleInitialized)
+ {
+ InitializeDefaultStyle();
+ }
+ return state switch
+ {
+ SelectionState.Default => defaultStyle,
+ SelectionState.Focussed => focussedStyle,
+ SelectionState.Selected => selectedStyle,
+ SelectionState.FocussedAndSelected => focussedAndSelectedStyle,
+ _ => defaultStyle,
+ };
+ }
+
+ private void ApplyStyle(Style style)
+ {
+ backgroundImg.OutlineColor = style.outlineColor;
+ backgroundImg.transform.localScale = Vector3.one * style.scale;
+ }
+
+ private void InitializeDefaultStyle()
+ {
+ defaultStyle = new Style(backgroundImg.OutlineColor, defaultAnimationCurve, defaultAnimationTime, 1f);
+ defaultStyleInitialized = true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUIScrollBar.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUIScrollBar.cs
new file mode 100644
index 0000000..6a069da
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUIScrollBar.cs
@@ -0,0 +1,51 @@
+using UnityEngine;
+
+public class TFUIScrollBar : ThronefallUIElement
+{
+ public ScrollArea target;
+
+ private bool focussed;
+
+ public override bool dragable => true;
+
+ protected override void OnApply()
+ {
+ }
+
+ protected override void OnClear()
+ {
+ focussed = false;
+ }
+
+ protected override void OnFocus()
+ {
+ focussed = true;
+ }
+
+ protected override void OnFocusAndSelect()
+ {
+ }
+
+ protected override void OnHardStateSet(SelectionState selectionState)
+ {
+ }
+
+ protected override void OnSelect()
+ {
+ }
+
+ public override void OnDragStart()
+ {
+ target.OnDragStart();
+ }
+
+ public override void OnDrag(Vector2 mousePosition)
+ {
+ target.OnDrag(mousePosition);
+ }
+
+ public override void OnDragEnd()
+ {
+ target.OnDragEnd();
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUISlider.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUISlider.cs
new file mode 100644
index 0000000..f48ea9e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUISlider.cs
@@ -0,0 +1,141 @@
+using MPUIKIT;
+using Rewired;
+using TMPro;
+using UnityEngine;
+using UnityEngine.Events;
+
+public class TFUISlider : MonoBehaviour
+{
+ public float minValue;
+
+ public float maxValue = 1f;
+
+ public float value = 1f;
+
+ public float increments = 0.1f;
+
+ public int displayFPPrecision = 1;
+
+ public ThronefallUIElement target;
+
+ public ThronefallUIElement.NavigationDirection increase;
+
+ public ThronefallUIElement.NavigationDirection decrease = ThronefallUIElement.NavigationDirection.Left;
+
+ public TextMeshProUGUI display;
+
+ public GameObject knob;
+
+ public GameObject tooltip;
+
+ public RectTransform backgroundRect;
+
+ public RectTransform fillRect;
+
+ public MPImageBasic fillImg;
+
+ public MPImageBasic knobImg;
+
+ public UnityEvent onChange;
+
+ public UnityEvent onNavigate;
+
+ private Player input;
+
+ private void Start()
+ {
+ target.onEmptyNavigate.AddListener(Navigate);
+ target.onSelectionStateChange.AddListener(ToggleSelectionUI);
+ input = ReInput.players.GetPlayer(0);
+ }
+
+ private void OnEnable()
+ {
+ ToggleSelectionUI();
+ }
+
+ private void UpdateDisplay()
+ {
+ fillRect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, backgroundRect.sizeDelta.x * Mathf.InverseLerp(minValue, maxValue, value));
+ display.text = value.ToString("F" + displayFPPrecision);
+ }
+
+ public void Navigate(ThronefallUIElement.NavigationDirection direction)
+ {
+ onNavigate.Invoke();
+ if (direction == increase)
+ {
+ value += increments;
+ }
+ else if (direction == decrease)
+ {
+ value -= increments;
+ }
+ if (value > maxValue)
+ {
+ value = maxValue;
+ }
+ if (value < minValue)
+ {
+ value = minValue;
+ }
+ UpdateDisplay();
+ onChange.Invoke();
+ }
+
+ public void Increase()
+ {
+ Navigate(increase);
+ }
+
+ public void Decrease()
+ {
+ Navigate(decrease);
+ }
+
+ public void OnTFUIStateChange()
+ {
+ }
+
+ public void SetValue(float v)
+ {
+ value = v;
+ if (value > maxValue)
+ {
+ value = maxValue;
+ }
+ if (value < minValue)
+ {
+ value = minValue;
+ }
+ UpdateDisplay();
+ }
+
+ public void SetValueByScreenPoint(Vector2 point)
+ {
+ RectTransformUtility.ScreenPointToLocalPointInRectangle(fillRect, input.controllers.Mouse.screenPosition, null, out point);
+ if (point.x < 0f)
+ {
+ point.x = 0f;
+ }
+ if (point.x > backgroundRect.sizeDelta.x)
+ {
+ point.x = backgroundRect.sizeDelta.x;
+ }
+ float t = Mathf.InverseLerp(0f, backgroundRect.sizeDelta.x, point.x);
+ int num = Mathf.RoundToInt(Mathf.Lerp(minValue, maxValue, t) / increments);
+ value = increments * (float)num;
+ UpdateDisplay();
+ onChange.Invoke();
+ }
+
+ private void ToggleSelectionUI()
+ {
+ bool active = target.CurrentState == ThronefallUIElement.SelectionState.FocussedAndSelected || target.CurrentState == ThronefallUIElement.SelectionState.Selected;
+ knob.SetActive(active);
+ if (tooltip != null)
+ {
+ tooltip.SetActive(active);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUISliderDragArea.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUISliderDragArea.cs
new file mode 100644
index 0000000..b19b0be
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUISliderDragArea.cs
@@ -0,0 +1,127 @@
+using MoreMountains.Feedbacks;
+using UnityEngine;
+
+public class TFUISliderDragArea : ThronefallUIElement
+{
+ public TFUISlider target;
+
+ public Color dragColor;
+
+ public MMF_Player onStartDrag;
+
+ public MMF_Player onEndDrag;
+
+ private Color defaultColor;
+
+ private bool colorInitialized;
+
+ private bool delayedDisable;
+
+ private bool inDrag;
+
+ private float afterDragCounter;
+
+ public override bool dragable => true;
+
+ protected override void OnApply()
+ {
+ }
+
+ private void Update()
+ {
+ if (!delayedDisable || inDrag)
+ {
+ return;
+ }
+ afterDragCounter += Time.unscaledDeltaTime;
+ if (afterDragCounter > 0.35f)
+ {
+ delayedDisable = false;
+ target.knob.SetActive(value: false);
+ if ((bool)target.tooltip)
+ {
+ target.tooltip.SetActive(value: false);
+ }
+ }
+ }
+
+ protected override void OnClear()
+ {
+ if (!inDrag)
+ {
+ target.knob.SetActive(value: false);
+ if ((bool)target.tooltip)
+ {
+ target.tooltip.SetActive(value: false);
+ }
+ }
+ else
+ {
+ delayedDisable = true;
+ afterDragCounter = 0f;
+ }
+ }
+
+ protected override void OnFocus()
+ {
+ delayedDisable = false;
+ target.knob.SetActive(value: true);
+ if ((bool)target.tooltip)
+ {
+ target.tooltip.SetActive(value: true);
+ }
+ }
+
+ protected override void OnFocusAndSelect()
+ {
+ }
+
+ protected override void OnHardStateSet(SelectionState selectionState)
+ {
+ }
+
+ protected override void OnSelect()
+ {
+ }
+
+ public override void OnDragStart()
+ {
+ inDrag = true;
+ onStartDrag.PlayFeedbacks();
+ if (!colorInitialized)
+ {
+ InitColor();
+ }
+ target.fillImg.color = dragColor;
+ target.knobImg.color = dragColor;
+ }
+
+ public override void OnDrag(Vector2 mousePosition)
+ {
+ target.SetValueByScreenPoint(mousePosition);
+ }
+
+ public override void OnDragEnd()
+ {
+ onEndDrag.PlayFeedbacks();
+ target.fillImg.color = defaultColor;
+ target.knobImg.color = defaultColor;
+ inDrag = false;
+ }
+
+ private void InitColor()
+ {
+ defaultColor = target.fillImg.color;
+ colorInitialized = true;
+ }
+
+ private void OnEnable()
+ {
+ if (!colorInitialized)
+ {
+ InitColor();
+ }
+ target.fillImg.color = defaultColor;
+ inDrag = false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUITextButton.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUITextButton.cs
new file mode 100644
index 0000000..a4968d3
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUITextButton.cs
@@ -0,0 +1,206 @@
+using System;
+using I2.Loc;
+using TMPro;
+using UnityEngine;
+
+[RequireComponent(typeof(TextMeshProUGUI))]
+public class TFUITextButton : ThronefallUIElement
+{
+ [Serializable]
+ public class Style
+ {
+ public Color color = Color.white;
+
+ public float fontSize = 30f;
+
+ public string prefix;
+
+ public string suffix;
+
+ public TMP_FontAsset font;
+
+ public AnimationCurve animationCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
+
+ public float animationDuration = 0.5f;
+
+ public Style(Color color, float fontSize, TMP_FontAsset font, AnimationCurve animationCurve, float animationDuration)
+ {
+ this.color = color;
+ this.fontSize = fontSize;
+ this.font = font;
+ this.animationCurve = animationCurve;
+ this.animationDuration = animationDuration;
+ }
+ }
+
+ public class Animation
+ {
+ public TFUITextButton target;
+
+ public Style startStyle;
+
+ public Style endStyle;
+
+ public float clock;
+
+ public Animation(Style startStyle, Style endStyle, TFUITextButton target)
+ {
+ this.startStyle = startStyle;
+ this.endStyle = endStyle;
+ this.target = target;
+ target.ApplyStyle(startStyle);
+ target.targetText.font = endStyle.font;
+ target.targetText.text = endStyle.prefix + target.originalString + endStyle.suffix;
+ target.currentAnimation = this;
+ }
+
+ public void Tick()
+ {
+ clock += Time.unscaledDeltaTime;
+ float num = Mathf.InverseLerp(0f, endStyle.animationDuration, clock);
+ float t = endStyle.animationCurve.Evaluate(num);
+ target.targetText.color = Color.Lerp(startStyle.color, endStyle.color, t);
+ target.targetText.fontSize = Mathf.LerpUnclamped(startStyle.fontSize, endStyle.fontSize, t);
+ if (num >= 1f)
+ {
+ target.ApplyStyle(endStyle);
+ target.currentAnimation = null;
+ }
+ }
+ }
+
+ private Style defaultStyle;
+
+ private bool defaultStyleInitialized;
+
+ public AnimationCurve defaultAnimationCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
+
+ public float defaultAnimationTime = 0.3f;
+
+ public Style focussedStyle;
+
+ public Style selectedStyle;
+
+ public Style focussedAndSelectedStyle;
+
+ public Style overrideStyle;
+
+ public bool applyOverrideStyle;
+
+ private TextMeshProUGUI targetText;
+
+ private string originalString;
+
+ private Animation currentAnimation;
+
+ private Localize locComponent;
+
+ private void Start()
+ {
+ locComponent = GetComponent<Localize>();
+ if (locComponent != null)
+ {
+ locComponent.LocalizeEvent.AddListener(UpdateOriginalStringLocalized);
+ }
+ }
+
+ private void Update()
+ {
+ if (currentAnimation != null)
+ {
+ currentAnimation.Tick();
+ }
+ }
+
+ protected Style GetStyle(SelectionState state)
+ {
+ if (!defaultStyleInitialized)
+ {
+ InitializeDefaultStyle();
+ }
+ return state switch
+ {
+ SelectionState.Default => defaultStyle,
+ SelectionState.Focussed => focussedStyle,
+ SelectionState.Selected => selectedStyle,
+ SelectionState.FocussedAndSelected => focussedAndSelectedStyle,
+ _ => defaultStyle,
+ };
+ }
+
+ protected override void OnApply()
+ {
+ }
+
+ protected override void OnClear()
+ {
+ new Animation(GetStyle(previousState), applyOverrideStyle ? overrideStyle : defaultStyle, this);
+ }
+
+ protected override void OnFocus()
+ {
+ new Animation(GetStyle(previousState), applyOverrideStyle ? overrideStyle : focussedStyle, this);
+ }
+
+ protected override void OnSelect()
+ {
+ new Animation(GetStyle(previousState), applyOverrideStyle ? overrideStyle : selectedStyle, this);
+ }
+
+ protected override void OnFocusAndSelect()
+ {
+ new Animation(GetStyle(previousState), applyOverrideStyle ? overrideStyle : focussedAndSelectedStyle, this);
+ }
+
+ protected override void OnHardStateSet(SelectionState selectionState)
+ {
+ currentAnimation = null;
+ ApplyStyle(GetStyle(selectionState));
+ }
+
+ private void ApplyStyle(Style style)
+ {
+ targetText.color = style.color;
+ targetText.fontSize = style.fontSize;
+ targetText.font = style.font;
+ targetText.text = style.prefix + originalString + style.suffix;
+ }
+
+ private void InitializeDefaultStyle()
+ {
+ if (!defaultStyleInitialized)
+ {
+ targetText = GetComponent<TextMeshProUGUI>();
+ UpdateOriginalStringLocalized();
+ defaultStyle = new Style(targetText.color, targetText.fontSize, targetText.font, defaultAnimationCurve, defaultAnimationTime);
+ defaultStyleInitialized = true;
+ }
+ }
+
+ private void UpdateOriginalStringLocalized()
+ {
+ if (locComponent == null)
+ {
+ locComponent = GetComponent<Localize>();
+ }
+ if (locComponent == null)
+ {
+ originalString = targetText.text;
+ }
+ else
+ {
+ originalString = TextTranslator.Translate(locComponent.Term);
+ }
+ }
+
+ public void SetOriginalString(string original)
+ {
+ if (!defaultStyleInitialized)
+ {
+ InitializeDefaultStyle();
+ }
+ originalString = original;
+ targetText.text = original;
+ OnHardStateSet(currentState);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TFUIUpgradeChoice.cs b/Thronefall_v1.57/Thronefall/Thronefall/TFUIUpgradeChoice.cs
new file mode 100644
index 0000000..ca38488
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TFUIUpgradeChoice.cs
@@ -0,0 +1,207 @@
+using System;
+using MPUIKIT;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class TFUIUpgradeChoice : ThronefallUIElement
+{
+ [Serializable]
+ public class Style
+ {
+ public float scale = 1f;
+
+ public Color outlineColor;
+
+ public Color bgColor;
+
+ public AnimationCurve animationCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
+
+ public float animationDuration = 0.5f;
+
+ public Style(Color outlineColor, Color bgColor, AnimationCurve animationCurve, float animationDuration, float scale)
+ {
+ this.scale = scale;
+ this.bgColor = bgColor;
+ this.outlineColor = outlineColor;
+ this.animationCurve = animationCurve;
+ this.animationDuration = animationDuration;
+ }
+ }
+
+ public class Animation
+ {
+ public TFUIUpgradeChoice target;
+
+ public Style startStyle;
+
+ public Style endStyle;
+
+ public float clock;
+
+ public Animation(Style startStyle, Style endStyle, TFUIUpgradeChoice target)
+ {
+ this.startStyle = startStyle;
+ this.endStyle = endStyle;
+ this.target = target;
+ target.ApplyStyle(startStyle);
+ target.currentAnimation = this;
+ }
+
+ public void Tick()
+ {
+ clock += Time.unscaledDeltaTime;
+ float num = Mathf.InverseLerp(0f, endStyle.animationDuration, clock);
+ float t = endStyle.animationCurve.Evaluate(num);
+ target.iconImg.color = Color.Lerp(startStyle.outlineColor, endStyle.outlineColor, t);
+ target.backgroundImg.color = Color.Lerp(startStyle.bgColor, endStyle.bgColor, t);
+ target.backgroundImg.OutlineColor = Color.Lerp(startStyle.outlineColor, endStyle.outlineColor, t);
+ target.backgroundImg.transform.localScale = Vector3.one * Mathf.LerpUnclamped(startStyle.scale, endStyle.scale, t);
+ if (num >= 1f)
+ {
+ target.ApplyStyle(endStyle);
+ target.currentAnimation = null;
+ }
+ }
+ }
+
+ [SerializeField]
+ private Color lockedBgColor;
+
+ [SerializeField]
+ private Color lockedOutlineColor;
+
+ [SerializeField]
+ private MPImageBasic backgroundImg;
+
+ [SerializeField]
+ private Image iconImg;
+
+ [SerializeField]
+ private Sprite lockIcon;
+
+ public AnimationCurve defaultAnimationCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
+
+ public float defaultAnimationTime = 0.3f;
+
+ public Style focussedStyle;
+
+ public Style selectedStyle;
+
+ public Style focussedAndSelectedStyle;
+
+ private Style defaultStyle;
+
+ private bool defaultStyleInitialized;
+
+ private Animation currentAnimation;
+
+ private Choice choiceData;
+
+ private Color defaultBgColor;
+
+ private Color defaultIconColor;
+
+ private bool locked;
+
+ public Choice Data => choiceData;
+
+ public bool Locked => locked;
+
+ public Image IconImg => iconImg;
+
+ private void Update()
+ {
+ if (currentAnimation != null)
+ {
+ currentAnimation.Tick();
+ }
+ }
+
+ protected override void OnApply()
+ {
+ }
+
+ protected override void OnClear()
+ {
+ new Animation(GetStyle(previousState), defaultStyle, this);
+ }
+
+ protected override void OnFocus()
+ {
+ new Animation(GetStyle(previousState), focussedStyle, this);
+ }
+
+ protected override void OnSelect()
+ {
+ new Animation(GetStyle(previousState), selectedStyle, this);
+ }
+
+ protected override void OnFocusAndSelect()
+ {
+ new Animation(GetStyle(previousState), focussedAndSelectedStyle, this);
+ }
+
+ protected override void OnHardStateSet(SelectionState selectionState)
+ {
+ currentAnimation = null;
+ ApplyStyle(GetStyle(selectionState));
+ }
+
+ protected Style GetStyle(SelectionState state)
+ {
+ if (!defaultStyleInitialized)
+ {
+ InitializeDefaultStyle();
+ }
+ return state switch
+ {
+ SelectionState.Default => defaultStyle,
+ SelectionState.Focussed => focussedStyle,
+ SelectionState.Selected => selectedStyle,
+ SelectionState.FocussedAndSelected => focussedAndSelectedStyle,
+ _ => defaultStyle,
+ };
+ }
+
+ private void ApplyStyle(Style style)
+ {
+ iconImg.color = style.outlineColor;
+ backgroundImg.color = style.bgColor;
+ backgroundImg.OutlineColor = style.outlineColor;
+ backgroundImg.transform.localScale = Vector3.one * style.scale;
+ }
+
+ private void InitializeDefaultStyle()
+ {
+ defaultBgColor = backgroundImg.color;
+ defaultIconColor = iconImg.color;
+ defaultStyle = new Style(backgroundImg.OutlineColor, backgroundImg.color, defaultAnimationCurve, defaultAnimationTime, 1f);
+ defaultStyleInitialized = true;
+ }
+
+ public void SetData(Choice _choice)
+ {
+ choiceData = _choice;
+ bool flag = true;
+ if (!_choice.CanBePicked)
+ {
+ flag = false;
+ }
+ if (_choice.disabledInThisMode)
+ {
+ flag = false;
+ }
+ if (flag)
+ {
+ iconImg.sprite = _choice.icon;
+ return;
+ }
+ iconImg.sprite = lockIcon;
+ iconImg.color = lockedOutlineColor;
+ backgroundImg.color = lockedBgColor;
+ backgroundImg.OutlineColor = lockedOutlineColor;
+ selectedStyle.bgColor = lockedBgColor;
+ selectedStyle.outlineColor = lockedOutlineColor;
+ locked = true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TagManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/TagManager.cs
new file mode 100644
index 0000000..55ed424
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TagManager.cs
@@ -0,0 +1,299 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+public class TagManager : MonoBehaviour
+{
+ public enum ETag
+ {
+ PlayerOwned,
+ EnemyOwned,
+ Player,
+ CastleCenter,
+ MeeleFighter,
+ RangedFighter,
+ Flying,
+ PlayerUnit,
+ Building,
+ SiegeWeapon,
+ AUTO_Alive,
+ AUTO_KnockedOutAndHealOnDawn,
+ Wall,
+ InfrastructureEconomy,
+ TakesReducedDamageFromPlayerAttacks,
+ PracticeTargets,
+ FastMoving,
+ ArmoredAgainstRanged,
+ VulnerableVsRanged,
+ Monster,
+ House,
+ WallOrTower,
+ AUTO_Commanded,
+ TakesIncreasedDamageFromTowers,
+ Tower,
+ AUTO_NoReviveNextMorning,
+ PlayerOwnedPriorityTarget,
+ BlockableEnemyProjectile,
+ Boss,
+ UselessWallThatDoesNotBlockPath,
+ Healer,
+ MagicProjectile,
+ NaturallyVulnerableToSplash,
+ NaturallyHighHealthTarget,
+ UnreachableForBigEnemiesDueToLevelDesign,
+ PlayerShrine,
+ VodooCursed,
+ PlayerHeroUnit,
+ FireAndExplosionResistant
+ }
+
+ public static TagManager instance;
+
+ [SerializeField]
+ private Dictionary<ETag, List<TaggedObject>> dictonaryOfListsOfTaggedObjects;
+
+ private List<TaggedObject> tempTaggedObjectList = new List<TaggedObject>();
+
+ private List<TaggedObject> bufferedPlayerUnits = new List<TaggedObject>();
+
+ private List<TaggedObject> bufferedEnemyUnits = new List<TaggedObject>();
+
+ private List<TaggedObject> bufferedPlayers = new List<TaggedObject>();
+
+ public List<BuildingInteractor> playerBuildingInteractors = new List<BuildingInteractor>();
+
+ public List<Coin> freeCoins = new List<Coin>();
+
+ public List<Coin> coins = new List<Coin>();
+
+ public IReadOnlyList<TaggedObject> PlayerUnits => bufferedPlayerUnits.AsReadOnly();
+
+ public IReadOnlyList<TaggedObject> EnemyUnits => bufferedEnemyUnits.AsReadOnly();
+
+ public IReadOnlyList<TaggedObject> Players => bufferedPlayers.AsReadOnly();
+
+ private void OnEnable()
+ {
+ instance = this;
+ dictonaryOfListsOfTaggedObjects = new Dictionary<ETag, List<TaggedObject>>();
+ for (int i = 0; i < Enum.GetValues(typeof(ETag)).Length; i++)
+ {
+ dictonaryOfListsOfTaggedObjects.Add((ETag)i, new List<TaggedObject>());
+ }
+ }
+
+ public void AddTaggedObject(TaggedObject _taggedObject)
+ {
+ foreach (ETag tag in _taggedObject.Tags)
+ {
+ AddTag(_taggedObject, tag);
+ if (tag == ETag.EnemyOwned)
+ {
+ bufferedEnemyUnits.Add(_taggedObject);
+ }
+ if (tag == ETag.PlayerUnit)
+ {
+ bufferedPlayerUnits.Add(_taggedObject);
+ }
+ if (tag == ETag.Player)
+ {
+ bufferedPlayers.Add(_taggedObject);
+ }
+ }
+ }
+
+ public void RemoveTaggedObject(TaggedObject _taggedObject)
+ {
+ if (bufferedEnemyUnits.Contains(_taggedObject))
+ {
+ bufferedEnemyUnits.Remove(_taggedObject);
+ }
+ if (bufferedPlayerUnits.Contains(_taggedObject))
+ {
+ bufferedPlayerUnits.Remove(_taggedObject);
+ }
+ foreach (ETag tag in _taggedObject.Tags)
+ {
+ RemoveTag(_taggedObject, tag);
+ }
+ }
+
+ public void AddTag(TaggedObject _taggedObject, ETag _tag)
+ {
+ List<TaggedObject> list = dictonaryOfListsOfTaggedObjects[_tag];
+ if (!list.Contains(_taggedObject))
+ {
+ list.Add(_taggedObject);
+ }
+ }
+
+ public void RemoveTag(TaggedObject _taggedObject, ETag _tag)
+ {
+ List<TaggedObject> list = dictonaryOfListsOfTaggedObjects[_tag];
+ if (list.Contains(_taggedObject))
+ {
+ list.Remove(_taggedObject);
+ }
+ }
+
+ public int CountObjectsWithTag(ETag _tag)
+ {
+ return dictonaryOfListsOfTaggedObjects[_tag].Count;
+ }
+
+ public void FindAllTaggedObjectsWithTags(List<TaggedObject> _listToPolulate, List<ETag> _mustHaveTags, List<ETag> _mayNotHaveTags)
+ {
+ _listToPolulate.Clear();
+ if (_mustHaveTags.Count <= 0)
+ {
+ return;
+ }
+ List<TaggedObject> list = null;
+ int num = int.MaxValue;
+ for (int i = 0; i < _mustHaveTags.Count; i++)
+ {
+ List<TaggedObject> list2 = dictonaryOfListsOfTaggedObjects[_mustHaveTags[i]];
+ if (list2.Count < num)
+ {
+ list = list2;
+ num = list2.Count;
+ }
+ }
+ if (list.Count == 0)
+ {
+ return;
+ }
+ for (int j = 0; j < list.Count; j++)
+ {
+ TaggedObject taggedObject = list[j];
+ List<ETag> tags = taggedObject.Tags;
+ bool flag = true;
+ if (_mustHaveTags != null)
+ {
+ for (int k = 0; k < _mustHaveTags.Count; k++)
+ {
+ if (!tags.Contains(_mustHaveTags[k]))
+ {
+ flag = false;
+ break;
+ }
+ }
+ }
+ if (_mayNotHaveTags != null)
+ {
+ for (int l = 0; l < _mayNotHaveTags.Count; l++)
+ {
+ if (tags.Contains(_mayNotHaveTags[l]))
+ {
+ flag = false;
+ break;
+ }
+ }
+ }
+ if (flag)
+ {
+ _listToPolulate.Add(taggedObject);
+ }
+ }
+ }
+
+ public void FindAllTaggedObjectsWithTag(List<TaggedObject> _listToPolulate, ETag _mustHaveTag)
+ {
+ _listToPolulate.Clear();
+ _listToPolulate.AddRange(dictonaryOfListsOfTaggedObjects[_mustHaveTag]);
+ }
+
+ public TaggedObject FindClosestTaggedObjectWithTags(Vector3 _position, List<ETag> _mustHaveTags, List<ETag> _mayNotHaveTags)
+ {
+ tempTaggedObjectList.Clear();
+ FindAllTaggedObjectsWithTags(tempTaggedObjectList, _mustHaveTags, _mayNotHaveTags);
+ TaggedObject result = null;
+ float num = float.MaxValue;
+ for (int i = 0; i < tempTaggedObjectList.Count; i++)
+ {
+ TaggedObject taggedObject = tempTaggedObjectList[i];
+ float num2 = MeasureDistanceToTaggedObject(taggedObject, _position);
+ if (num2 < num)
+ {
+ num = num2;
+ result = taggedObject;
+ }
+ }
+ return result;
+ }
+
+ public void FindClosestTaggedObjectsWithTags(Vector3 _position, List<ETag> _mustHaveTags, List<ETag> _mayNotHaveTags, TaggedObject[] _arrayToPopulate, float maxDistance)
+ {
+ for (int i = 0; i < _arrayToPopulate.Length; i++)
+ {
+ _arrayToPopulate[i] = null;
+ }
+ tempTaggedObjectList.Clear();
+ FindAllTaggedObjectsWithTags(tempTaggedObjectList, _mustHaveTags, _mayNotHaveTags);
+ var list = (from taggedObject in tempTaggedObjectList
+ select new
+ {
+ TaggedObject = taggedObject,
+ Distance = MeasureDistanceToTaggedObject(taggedObject, _position)
+ } into obj
+ where obj.Distance <= maxDistance
+ orderby obj.Distance
+ select obj).ToList();
+ for (int j = 0; j < _arrayToPopulate.Length && j < list.Count; j++)
+ {
+ _arrayToPopulate[j] = list[j].TaggedObject;
+ }
+ }
+
+ public void FindLowestHealthTaggedObjectsWithTags(Vector3 _position, List<ETag> _mustHaveTags, List<ETag> _mayNotHaveTags, TaggedObject[] _arrayToPopulate, float maxDistance, bool excludeFullHealthTargets)
+ {
+ for (int i = 0; i < _arrayToPopulate.Length; i++)
+ {
+ _arrayToPopulate[i] = null;
+ }
+ tempTaggedObjectList.Clear();
+ FindAllTaggedObjectsWithTags(tempTaggedObjectList, _mustHaveTags, _mayNotHaveTags);
+ foreach (TaggedObject tempTaggedObject in tempTaggedObjectList)
+ {
+ if (MeasureDistanceToTaggedObject(tempTaggedObject, _position) > maxDistance || (excludeFullHealthTargets && tempTaggedObject.Hp.HpPercentage >= 1f))
+ {
+ continue;
+ }
+ int num = -1;
+ float num2 = float.MaxValue;
+ for (int j = 0; j < _arrayToPopulate.Length; j++)
+ {
+ if (_arrayToPopulate[j] == null)
+ {
+ num = j;
+ break;
+ }
+ float hpPercentage = _arrayToPopulate[j].Hp.HpPercentage;
+ if (hpPercentage < num2)
+ {
+ num = j;
+ num2 = hpPercentage;
+ }
+ }
+ if (num != -1 && (num2 > tempTaggedObject.Hp.HpPercentage || _arrayToPopulate[num] == null))
+ {
+ _arrayToPopulate[num] = tempTaggedObject;
+ }
+ }
+ }
+
+ public float MeasureDistanceToTaggedObject(TaggedObject _taggedObj, Vector3 _pos)
+ {
+ if (_taggedObj.colliderForBigOjectsToMeasureDistance != null)
+ {
+ return (_taggedObj.colliderForBigOjectsToMeasureDistance.ClosestPoint(_pos) - _pos).magnitude;
+ }
+ return (_taggedObj.transform.position - _pos).magnitude;
+ }
+
+ public int CountAllTaggedObjectsWithTag(ETag _mustHaveTag)
+ {
+ return dictonaryOfListsOfTaggedObjects[_mustHaveTag].Count;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TaggedObject.cs b/Thronefall_v1.57/Thronefall/Thronefall/TaggedObject.cs
new file mode 100644
index 0000000..216ee35
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TaggedObject.cs
@@ -0,0 +1,102 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class TaggedObject : MonoBehaviour, ISaveLoad
+{
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private List<TagManager.ETag> tags = new List<TagManager.ETag>();
+
+ private TagManager tagManager;
+
+ private Hp hp;
+
+ public Collider colliderForBigOjectsToMeasureDistance;
+
+ private Shrine shrineCache;
+
+ public List<TagManager.ETag> Tags => tags;
+
+ public Hp Hp
+ {
+ get
+ {
+ if (!hp)
+ {
+ hp = GetComponent<Hp>();
+ }
+ return hp;
+ }
+ }
+
+ public Shrine Shrine
+ {
+ get
+ {
+ if ((bool)shrineCache)
+ {
+ return shrineCache;
+ }
+ return GetComponent<Shrine>();
+ }
+ }
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+
+ public void OnAfterMainLoadPass(string guid)
+ {
+ }
+
+ public void OnLoad(string guid)
+ {
+ TagManager.ETag[] value = new TagManager.ETag[0];
+ MatchSaveLoadHandler.TryLoadValue(guid, base.gameObject.name + "_tags", ref value);
+ if (value.Length != 0)
+ {
+ tags = new List<TagManager.ETag>(value);
+ }
+ }
+
+ public void OnSave(string guid)
+ {
+ MatchSaveLoadHandler.SaveValue(guid, base.gameObject.name + "_tags", tags.ToArray());
+ }
+
+ private void OnEnable()
+ {
+ if (tagManager == null)
+ {
+ tagManager = TagManager.instance;
+ }
+ tagManager.AddTaggedObject(this);
+ }
+
+ private void OnDisable()
+ {
+ if (tagManager == null)
+ {
+ tagManager = TagManager.instance;
+ }
+ tagManager.RemoveTaggedObject(this);
+ }
+
+ public void AddTag(TagManager.ETag _tag)
+ {
+ if (!tags.Contains(_tag))
+ {
+ tags.Add(_tag);
+ tagManager.AddTag(this, _tag);
+ }
+ }
+
+ public void RemoveTag(TagManager.ETag _tag)
+ {
+ if (tags.Contains(_tag))
+ {
+ tags.Remove(_tag);
+ tagManager.RemoveTag(this, _tag);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TargetPriority.cs b/Thronefall_v1.57/Thronefall/Thronefall/TargetPriority.cs
new file mode 100644
index 0000000..6f358ad
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TargetPriority.cs
@@ -0,0 +1,247 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+[Serializable]
+public class TargetPriority
+{
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public List<TagManager.ETag> mustHaveTags = new List<TagManager.ETag>();
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public List<TagManager.ETag> mayNotHaveTags = new List<TagManager.ETag>();
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public float range;
+
+ private List<TaggedObject> allTaggedObjects = new List<TaggedObject>();
+
+ private List<TaggedObject> objectsInRange = new List<TaggedObject>();
+
+ private TagManager tagManager;
+
+ public TaggedObject FindClosestTaggedObject(Vector3 _position)
+ {
+ TaggedObject taggedObject = TagManager.instance.FindClosestTaggedObjectWithTags(_position, mustHaveTags, mayNotHaveTags);
+ if (taggedObject == null)
+ {
+ return null;
+ }
+ float num = ((!(taggedObject.colliderForBigOjectsToMeasureDistance != null)) ? (taggedObject.transform.position - _position).magnitude : (taggedObject.colliderForBigOjectsToMeasureDistance.ClosestPoint(_position) - _position).magnitude);
+ if (num <= range)
+ {
+ return taggedObject;
+ }
+ return null;
+ }
+
+ public TaggedObject FindClosestTaggedObjectWithoutMaxDistanceCheck(Vector3 _position)
+ {
+ return TagManager.instance.FindClosestTaggedObjectWithTags(_position, mustHaveTags, mayNotHaveTags);
+ }
+
+ public void FindClosestTaggedObjects(Vector3 _position, TaggedObject[] _arrayToPopulate)
+ {
+ TagManager.instance.FindClosestTaggedObjectsWithTags(_position, mustHaveTags, mayNotHaveTags, _arrayToPopulate, range);
+ }
+
+ public void FindLowestHealthTaggedObjects(Vector3 _position, TaggedObject[] _arrayToPopulate, bool excludeFullHealthTargets)
+ {
+ TagManager.instance.FindLowestHealthTaggedObjectsWithTags(_position, mustHaveTags, mayNotHaveTags, _arrayToPopulate, range, excludeFullHealthTargets);
+ }
+
+ public TaggedObject FindHighestHealthObjectInRange(Vector3 _position)
+ {
+ tagManager = TagManager.instance;
+ allTaggedObjects.Clear();
+ tagManager.FindAllTaggedObjectsWithTags(allTaggedObjects, mustHaveTags, mayNotHaveTags);
+ TaggedObject result = null;
+ float num = 0f;
+ for (int i = 0; i < allTaggedObjects.Count; i++)
+ {
+ if (!(tagManager.MeasureDistanceToTaggedObject(allTaggedObjects[i], _position) > range))
+ {
+ Hp hp = allTaggedObjects[i].Hp;
+ if (hp.HpValue > num)
+ {
+ num = hp.HpValue;
+ result = allTaggedObjects[i];
+ }
+ }
+ }
+ return result;
+ }
+
+ public void FindHighestHealthObjectsInRange(Vector3 _position, TaggedObject[] _arrayToPopulate)
+ {
+ tagManager = TagManager.instance;
+ allTaggedObjects.Clear();
+ tagManager.FindAllTaggedObjectsWithTags(allTaggedObjects, mustHaveTags, mayNotHaveTags);
+ List<TaggedObject> list = (from obj in allTaggedObjects
+ where tagManager.MeasureDistanceToTaggedObject(obj, _position) <= range
+ orderby obj.Hp.HpValue descending
+ select obj).ToList();
+ int num = Mathf.Min(_arrayToPopulate.Length, list.Count);
+ for (int i = 0; i < num; i++)
+ {
+ _arrayToPopulate[i] = list[i];
+ }
+ }
+
+ public TaggedObject FindRandomObjectInRange(Vector3 _position)
+ {
+ tagManager = TagManager.instance;
+ allTaggedObjects.Clear();
+ tagManager.FindAllTaggedObjectsWithTags(allTaggedObjects, mustHaveTags, mayNotHaveTags);
+ TaggedObject result = null;
+ float num = 0f;
+ for (int i = 0; i < allTaggedObjects.Count; i++)
+ {
+ if (!(tagManager.MeasureDistanceToTaggedObject(allTaggedObjects[i], _position) > range))
+ {
+ float value = UnityEngine.Random.value;
+ if (value > num)
+ {
+ num = value;
+ result = allTaggedObjects[i];
+ }
+ }
+ }
+ return result;
+ }
+
+ public void FindRandomObjectsInRange(Vector3 _position, TaggedObject[] _arrayToPopulate)
+ {
+ tagManager = TagManager.instance;
+ tagManager.FindAllTaggedObjectsWithTags(allTaggedObjects, mustHaveTags, mayNotHaveTags);
+ allTaggedObjects.ETShuffle(new System.Random());
+ int num = 0;
+ foreach (TaggedObject allTaggedObject in allTaggedObjects)
+ {
+ if (tagManager.MeasureDistanceToTaggedObject(allTaggedObject, _position) <= range)
+ {
+ _arrayToPopulate[num] = allTaggedObject;
+ num++;
+ if (num >= _arrayToPopulate.Length)
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ public TaggedObject FindLowestHealthObjectInRange(Vector3 _position, bool _excludeFullHealthTargets = true)
+ {
+ tagManager = TagManager.instance;
+ allTaggedObjects.Clear();
+ tagManager.FindAllTaggedObjectsWithTags(allTaggedObjects, mustHaveTags, mayNotHaveTags);
+ TaggedObject result = null;
+ float num = 100f;
+ for (int i = 0; i < allTaggedObjects.Count; i++)
+ {
+ if (!(tagManager.MeasureDistanceToTaggedObject(allTaggedObjects[i], _position) > range))
+ {
+ Hp hp = allTaggedObjects[i].Hp;
+ if ((!_excludeFullHealthTargets || !(hp.HpPercentage >= 1f)) && hp.HpPercentage < num)
+ {
+ num = hp.HpPercentage;
+ result = allTaggedObjects[i];
+ }
+ }
+ }
+ return result;
+ }
+
+ public void FindLowestHealthObjectsInRange(Vector3 _position, TaggedObject[] _listToPopulate, bool _excludeFullHealthTargets = true)
+ {
+ tagManager = TagManager.instance;
+ allTaggedObjects.Clear();
+ tagManager.FindAllTaggedObjectsWithTags(allTaggedObjects, mustHaveTags, mayNotHaveTags);
+ List<TaggedObject> list = (from obj in allTaggedObjects
+ where tagManager.MeasureDistanceToTaggedObject(obj, _position) <= range && (!_excludeFullHealthTargets || !(obj.Hp.HpPercentage >= 1f))
+ orderby obj.Hp.HpPercentage
+ select obj).ToList();
+ int num = Mathf.Min(_listToPopulate.Length, list.Count);
+ for (int i = 0; i < num; i++)
+ {
+ _listToPopulate[i] = list[i];
+ }
+ }
+
+ public TaggedObject FindTaggedObject(Vector3 _position, out Vector3 _outPosition)
+ {
+ _outPosition = Vector3.zero;
+ TaggedObject taggedObject = TagManager.instance.FindClosestTaggedObjectWithTags(_position, mustHaveTags, mayNotHaveTags);
+ if (taggedObject == null)
+ {
+ return null;
+ }
+ float magnitude;
+ if (taggedObject.colliderForBigOjectsToMeasureDistance != null)
+ {
+ _outPosition = taggedObject.colliderForBigOjectsToMeasureDistance.ClosestPoint(_position);
+ magnitude = (_outPosition - _position).magnitude;
+ }
+ else
+ {
+ _outPosition = taggedObject.transform.position;
+ magnitude = (_outPosition - _position).magnitude;
+ }
+ if (magnitude <= range)
+ {
+ return taggedObject;
+ }
+ return null;
+ }
+
+ public TaggedObject FindTaggedObjectCloseToHome(Vector3 _position, Vector3 _home, float _homeRange, out Vector3 _outPosition)
+ {
+ _outPosition = Vector3.zero;
+ TaggedObject taggedObject = TagManager.instance.FindClosestTaggedObjectWithTags(_position, mustHaveTags, mayNotHaveTags);
+ if (taggedObject == null)
+ {
+ return null;
+ }
+ if (taggedObject.colliderForBigOjectsToMeasureDistance != null)
+ {
+ _outPosition = taggedObject.colliderForBigOjectsToMeasureDistance.ClosestPoint(_position);
+ }
+ else
+ {
+ _outPosition = taggedObject.transform.position;
+ }
+ float magnitude = (_outPosition - _position).magnitude;
+ _ = (_outPosition - _home).magnitude;
+ if (magnitude <= range)
+ {
+ return taggedObject;
+ }
+ return null;
+ }
+
+ public TaggedObject FindTaggedObjectCloseToHomeInHomeRange(Vector3 _position, Vector3 _home, float _homeRange, out Vector3 _outPosition)
+ {
+ _outPosition = Vector3.zero;
+ TaggedObject taggedObject = TagManager.instance.FindClosestTaggedObjectWithTags(_position, mustHaveTags, mayNotHaveTags);
+ if (taggedObject == null)
+ {
+ return null;
+ }
+ if (taggedObject.colliderForBigOjectsToMeasureDistance != null)
+ {
+ _outPosition = taggedObject.colliderForBigOjectsToMeasureDistance.ClosestPoint(_position);
+ }
+ else
+ {
+ _outPosition = taggedObject.transform.position;
+ }
+ float magnitude = (_outPosition - _position).magnitude;
+ float magnitude2 = (_outPosition - _home).magnitude;
+ if (magnitude <= range && magnitude2 <= _homeRange)
+ {
+ return taggedObject;
+ }
+ return null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TelePlayer.cs b/Thronefall_v1.57/Thronefall/Thronefall/TelePlayer.cs
new file mode 100644
index 0000000..3e013bd
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TelePlayer.cs
@@ -0,0 +1,66 @@
+using UnityEngine;
+
+public class TelePlayer : MonoBehaviour
+{
+ private LevelInteractor[] levelInteractors;
+
+ private BonusLevelInteractor[] bonusLevelInteractors;
+
+ private EternalTrialsInteractor eternalTrialsInteractor;
+
+ public PlayerMovement playerMovement;
+
+ public Vector3 spawnOnLevelOffsetPositon;
+
+ private int frame;
+
+ private void Start()
+ {
+ levelInteractors = GetComponentsInChildren<LevelInteractor>();
+ eternalTrialsInteractor = GetComponentInChildren<EternalTrialsInteractor>();
+ bonusLevelInteractors = GetComponentsInChildren<BonusLevelInteractor>();
+ }
+
+ private void Update()
+ {
+ frame++;
+ if (frame == 2)
+ {
+ MovePlayerToTheLevelYouCameFrom();
+ }
+ }
+
+ private void MovePlayerToTheLevelYouCameFrom()
+ {
+ SceneTransitionManager instance = SceneTransitionManager.instance;
+ if (!instance || instance.ComingFromGameplayScene == "")
+ {
+ return;
+ }
+ if (instance.ComingFromGameplayScene == "Eternal Trials")
+ {
+ playerMovement.TeleportTo(eternalTrialsInteractor.banner.transform.position + spawnOnLevelOffsetPositon);
+ return;
+ }
+ for (int i = 0; i < levelInteractors.Length; i++)
+ {
+ if (levelInteractors[i].levelInfo.sceneName == instance.ComingFromGameplayScene)
+ {
+ playerMovement.TeleportTo(levelInteractors[i].transform.position + spawnOnLevelOffsetPositon);
+ return;
+ }
+ }
+ for (int j = 0; j < bonusLevelInteractors.Length; j++)
+ {
+ LevelInfo[] levelsToPick = bonusLevelInteractors[j].levelsToPick;
+ for (int k = 0; k < levelsToPick.Length; k++)
+ {
+ if (levelsToPick[k].sceneName == instance.ComingFromGameplayScene)
+ {
+ playerMovement.TeleportTo(bonusLevelInteractors[j].transform.position + spawnOnLevelOffsetPositon);
+ return;
+ }
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TextBackgroundFitter.cs b/Thronefall_v1.57/Thronefall/Thronefall/TextBackgroundFitter.cs
new file mode 100644
index 0000000..34a9e73
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TextBackgroundFitter.cs
@@ -0,0 +1,24 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+public class TextBackgroundFitter : MonoBehaviour
+{
+ private RectTransform ownRT;
+
+ public RectTransform target;
+
+ public ContentSizeFitter csf;
+
+ public float horizontalPaddingPerSide;
+
+ public float verticalPaddingPerSide;
+
+ private void OnEnable()
+ {
+ ownRT = GetComponent<RectTransform>();
+ csf.enabled = false;
+ csf.enabled = true;
+ LayoutRebuilder.ForceRebuildLayoutImmediate(target);
+ ownRT.sizeDelta = new Vector2(target.sizeDelta.x + horizontalPaddingPerSide * 2f, target.sizeDelta.y + verticalPaddingPerSide * 2f);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TextMirror.cs b/Thronefall_v1.57/Thronefall/Thronefall/TextMirror.cs
new file mode 100644
index 0000000..f24676d
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TextMirror.cs
@@ -0,0 +1,14 @@
+using TMPro;
+using UnityEngine;
+
+public class TextMirror : MonoBehaviour
+{
+ public TextMeshProUGUI toMirror;
+
+ public TextMeshProUGUI ownTMP;
+
+ private void Update()
+ {
+ ownTMP.text = toMirror.text;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TextTranslator.cs b/Thronefall_v1.57/Thronefall/Thronefall/TextTranslator.cs
new file mode 100644
index 0000000..46c1fc9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TextTranslator.cs
@@ -0,0 +1,41 @@
+using System.Text.RegularExpressions;
+using I2.Loc;
+using UnityEngine;
+
+public class TextTranslator : MonoBehaviour
+{
+ [SerializeField]
+ private BalancingParameters balancingParameters;
+
+ public static TextTranslator instance;
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ public static string Translate(string locaKey, bool fixForRTL = true, int maxLineLenghtForRTL = 0, bool ignoreRTLNumbers = true, bool applyParameters = true)
+ {
+ try
+ {
+ string text = LocalizationManager.GetTranslation(locaKey, fixForRTL, maxLineLenghtForRTL, ignoreRTLNumbers, applyParameters);
+ foreach (Match item in new Regex("\\{(.+?)\\}").Matches(text))
+ {
+ string value = item.Groups[1].Value;
+ if (instance.balancingParameters.parameters.TryGetValue(value, out var value2))
+ {
+ text = text.Replace(item.Value, value2);
+ }
+ else
+ {
+ Debug.LogWarning("Key " + value + " not found in balancing parameters.");
+ }
+ }
+ return text;
+ }
+ catch
+ {
+ return locaKey;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ThronefallAudioManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/ThronefallAudioManager.cs
new file mode 100644
index 0000000..5fb0e1f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ThronefallAudioManager.cs
@@ -0,0 +1,348 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Audio;
+using UnityEngine.Events;
+
+public class ThronefallAudioManager : MonoBehaviour
+{
+ public class OneshotSource
+ {
+ public AudioSource aSource;
+
+ public bool available = true;
+
+ public OneshotSource(AudioSource audioSource)
+ {
+ aSource = audioSource;
+ }
+ }
+
+ public enum AudioOneShot
+ {
+ BuildingBuild,
+ BuildingUpgrade,
+ CoinslotFill,
+ CoinslotInteractionStart,
+ LastCoinslotFill,
+ CoinFillCancel,
+ NightSurvived,
+ BuildingRepair,
+ EismolochAppear,
+ EismolochSpawn,
+ ButtonSelect,
+ ButtonApply,
+ ButtonApplyHero,
+ CoinCollect,
+ BuildingStandardProjectile,
+ BallistaProjectile,
+ PlayerSwordBigHit,
+ EnemySpawn,
+ ShowWaveCount,
+ CloseWaveCount,
+ ShowTooltip,
+ None,
+ PlayerLightningWandActive
+ }
+
+ private static ThronefallAudioManager instance;
+
+ public readonly float oneshotAudioPoolSize = 15f;
+
+ public readonly float onshotAudioPoolRecycleTick = 0.3f;
+
+ private float oneshotSourceRecycleClock;
+
+ private List<OneshotSource> oneshotSourcePool = new List<OneshotSource>();
+
+ private OneshotSource bufferOneshotSource;
+
+ public AudioSet audioContent;
+
+ public AudioMixerGroup mgMusic;
+
+ public AudioMixerGroup mgSFX;
+
+ public AudioMixerGroup mgEnvironment;
+
+ [HideInInspector]
+ public UnityEvent onBuildingBuild = new UnityEvent();
+
+ private bool muted;
+
+ private float coinslotFillPitch = 1f;
+
+ private float coinslotFillPitchIncrease = 0.025f;
+
+ private OneshotSource coinslotFillBackground;
+
+ private float coinslotFillBackgroundClock;
+
+ private float coinslotTotalFillTime = 1f;
+
+ public static ThronefallAudioManager Instance => instance;
+
+ private void Awake()
+ {
+ if (instance != null)
+ {
+ Object.Destroy(base.gameObject);
+ return;
+ }
+ instance = this;
+ Object.DontDestroyOnLoad(base.gameObject);
+ AudioSource audioSource = null;
+ for (int i = 0; (float)i < oneshotAudioPoolSize; i++)
+ {
+ audioSource = new GameObject("Oneshot Source " + i).AddComponent<AudioSource>();
+ audioSource.transform.SetParent(base.transform);
+ audioSource.rolloffMode = AudioRolloffMode.Linear;
+ audioSource.minDistance = 1f;
+ audioSource.maxDistance = 80f;
+ audioSource.spatialBlend = 0f;
+ oneshotSourcePool.Add(new OneshotSource(audioSource));
+ }
+ }
+
+ private void Update()
+ {
+ oneshotSourceRecycleClock += Time.unscaledDeltaTime;
+ if (oneshotSourceRecycleClock > onshotAudioPoolRecycleTick)
+ {
+ RecycleOneshotSources();
+ }
+ if (coinslotFillBackground != null)
+ {
+ coinslotFillBackgroundClock += Time.deltaTime;
+ coinslotFillBackground.aSource.pitch = Mathf.Lerp(0.75f, 1f, coinslotFillBackgroundClock / coinslotTotalFillTime);
+ }
+ }
+
+ private void ProcessOneShotEvent(AudioOneShot oneshot, bool worldspace = false, Vector3 position = default(Vector3))
+ {
+ if (!muted)
+ {
+ switch (oneshot)
+ {
+ case AudioOneShot.CoinslotInteractionStart:
+ coinslotFillPitch = 1f;
+ PlaySoundAsOneShot(audioContent.CoinslotInteractionStart);
+ StopCoinfillBackground();
+ coinslotFillBackground = PlaySoundAsOneShot(audioContent.PayBackground, 0.2f, 0.75f);
+ break;
+ case AudioOneShot.CoinslotFill:
+ PlaySoundAsOneShot(audioContent.CoinslotFill, 1f, coinslotFillPitch);
+ coinslotFillPitch += coinslotFillPitchIncrease;
+ break;
+ case AudioOneShot.LastCoinslotFill:
+ PlaySoundAsOneShot(audioContent.LastCoinslotFill);
+ StopCoinfillBackground();
+ break;
+ case AudioOneShot.CoinFillCancel:
+ StopCoinfillBackground();
+ break;
+ case AudioOneShot.BuildingBuild:
+ onBuildingBuild.Invoke();
+ PlaySoundAsOneShot(audioContent.BuildingBuild, 1f, Random.Range(0.9f, 1.1f));
+ break;
+ case AudioOneShot.BuildingUpgrade:
+ PlaySoundAsOneShot(audioContent.BuildingUpgrade);
+ break;
+ case AudioOneShot.NightSurvived:
+ PlaySoundAsOneShot(audioContent.NightSurvived, 0.8f, 1f, null, 0);
+ break;
+ case AudioOneShot.BuildingRepair:
+ PlaySoundAsOneShot(audioContent.BuildingRepair);
+ break;
+ case AudioOneShot.EismolochAppear:
+ PlaySoundAsOneShot(audioContent.EismolochAppear.clips[Random.Range(0, audioContent.EismolochAppear.clips.Length)]);
+ break;
+ case AudioOneShot.EismolochSpawn:
+ PlaySoundAsOneShot(audioContent.EismolochSpawnUnits.clips[Random.Range(0, audioContent.EismolochSpawnUnits.clips.Length)], 1f, 1f, null, 0);
+ break;
+ case AudioOneShot.ButtonSelect:
+ PlaySoundAsOneShot(audioContent.ButtonSelect.GetRandomClip());
+ break;
+ case AudioOneShot.ButtonApply:
+ PlaySoundAsOneShot(audioContent.ButtonApply.GetRandomClip());
+ break;
+ case AudioOneShot.ButtonApplyHero:
+ PlaySoundAsOneShot(audioContent.ButtonApplyHero.GetRandomClip());
+ break;
+ case AudioOneShot.CoinCollect:
+ PlaySoundAsOneShot(audioContent.CoinCollect.GetRandomClip(), 1f, Random.Range(0.9f, 1.1f));
+ break;
+ case AudioOneShot.BuildingStandardProjectile:
+ PlaySoundAsOneShot(audioContent.TowerShot.GetRandomClip(), 0.5f, Random.Range(0.95f, 1.05f), null, 50, worldspace: true, position);
+ break;
+ case AudioOneShot.BallistaProjectile:
+ PlaySoundAsOneShot(audioContent.BallistaShot.GetRandomClip(), 1f, 1f, null, 30, worldspace: true, position);
+ break;
+ case AudioOneShot.PlayerSwordBigHit:
+ PlaySoundAsOneShot(audioContent.PlayerSwordBigHit, 1f, 1f, null, 1);
+ break;
+ case AudioOneShot.EnemySpawn:
+ PlaySoundAsOneShot(audioContent.EnemySpawn, 0.85f, Random.Range(0.95f, 1.05f), null, 140, worldspace: true, position);
+ break;
+ case AudioOneShot.ShowWaveCount:
+ PlaySoundAsOneShot(audioContent.ShowWaveCount, 0.5f);
+ break;
+ case AudioOneShot.CloseWaveCount:
+ PlaySoundAsOneShot(audioContent.CloseWaveCount);
+ break;
+ case AudioOneShot.ShowTooltip:
+ PlaySoundAsOneShot(audioContent.ShowTooltip, 0.3f);
+ break;
+ case AudioOneShot.PlayerLightningWandActive:
+ PlaySoundAsOneShot(audioContent.PlayerLightningWandActiveAbility, 0.6f, 1f, null, 1, worldspace: true, position);
+ break;
+ case AudioOneShot.None:
+ break;
+ }
+ }
+ }
+
+ public OneshotSource PlaySoundAsOneShot(AudioClip clip, float volume = 1f, float pitch = 1f, AudioMixerGroup mixerGroup = null, int priority = 128, bool worldspace = false, Vector3 position = default(Vector3))
+ {
+ if (mixerGroup == null)
+ {
+ mixerGroup = mgSFX;
+ }
+ bufferOneshotSource = GetFreeOneshotSource();
+ if (bufferOneshotSource == null)
+ {
+ return null;
+ }
+ if (worldspace)
+ {
+ bufferOneshotSource.aSource.transform.position = position;
+ bufferOneshotSource.aSource.spatialBlend = 1f;
+ }
+ else
+ {
+ bufferOneshotSource.aSource.spatialBlend = 0f;
+ }
+ bufferOneshotSource.aSource.volume = volume;
+ bufferOneshotSource.aSource.pitch = pitch;
+ bufferOneshotSource.aSource.outputAudioMixerGroup = mixerGroup;
+ bufferOneshotSource.aSource.priority = priority;
+ bufferOneshotSource.aSource.PlayOneShot(clip);
+ bufferOneshotSource.available = false;
+ return bufferOneshotSource;
+ }
+
+ public OneshotSource PlaySoundAsOneShot(AudioSet.ClipArray clips, float volume = 1f, float pitch = 1f, AudioMixerGroup mixerGroup = null, int priority = 128, bool worldspace = false, Vector3 position = default(Vector3))
+ {
+ if (clips == null)
+ {
+ return null;
+ }
+ if (clips.clips.Length == 0)
+ {
+ return null;
+ }
+ if (mixerGroup == null)
+ {
+ mixerGroup = mgSFX;
+ }
+ bufferOneshotSource = GetFreeOneshotSource();
+ if (bufferOneshotSource == null)
+ {
+ return null;
+ }
+ if (worldspace)
+ {
+ bufferOneshotSource.aSource.transform.position = position;
+ bufferOneshotSource.aSource.spatialBlend = 1f;
+ }
+ else
+ {
+ bufferOneshotSource.aSource.spatialBlend = 0f;
+ }
+ bufferOneshotSource.aSource.volume = volume;
+ bufferOneshotSource.aSource.pitch = pitch;
+ bufferOneshotSource.aSource.outputAudioMixerGroup = mixerGroup;
+ bufferOneshotSource.aSource.priority = priority;
+ bufferOneshotSource.aSource.PlayOneShot(clips.clips[Random.Range(0, clips.clips.Length)]);
+ bufferOneshotSource.available = false;
+ return bufferOneshotSource;
+ }
+
+ private OneshotSource GetFreeOneshotSource()
+ {
+ foreach (OneshotSource item in oneshotSourcePool)
+ {
+ if (item.available)
+ {
+ return item;
+ }
+ }
+ return oneshotSourcePool[0];
+ }
+
+ private void RecycleOneshotSources()
+ {
+ foreach (OneshotSource item in oneshotSourcePool)
+ {
+ if (!item.aSource.isPlaying)
+ {
+ item.available = true;
+ }
+ }
+ oneshotSourceRecycleClock = 0f;
+ }
+
+ private void StopCoinfillBackground()
+ {
+ if (coinslotFillBackground != null)
+ {
+ coinslotFillBackground.available = true;
+ coinslotFillBackground.aSource.Stop();
+ coinslotFillBackground = null;
+ coinslotFillBackgroundClock = 0f;
+ }
+ }
+
+ public void MakeSureCoinFillSoundIsNotPlayingAnymore()
+ {
+ StopCoinfillBackground();
+ }
+
+ public static void Oneshot(AudioOneShot oneshot)
+ {
+ if (instance != null)
+ {
+ instance.ProcessOneShotEvent(oneshot);
+ }
+ else
+ {
+ Debug.LogError("No Audio Manager");
+ }
+ }
+
+ public static void WorldSpaceOneShot(AudioOneShot oneshot, Vector3 position)
+ {
+ if (instance != null)
+ {
+ instance.ProcessOneShotEvent(oneshot, worldspace: true, position);
+ }
+ else
+ {
+ Debug.LogError("No Audio Manager");
+ }
+ }
+
+ public static void Mute()
+ {
+ instance.muted = true;
+ }
+
+ public static void Unmute()
+ {
+ instance.muted = false;
+ }
+
+ public static void SetCoinDisplayFillTime(float time)
+ {
+ instance.coinslotTotalFillTime = time;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/ThronefallUIElement.cs b/Thronefall_v1.57/Thronefall/Thronefall/ThronefallUIElement.cs
new file mode 100644
index 0000000..6f292fb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/ThronefallUIElement.cs
@@ -0,0 +1,168 @@
+using UnityEngine;
+using UnityEngine.Events;
+
+public abstract class ThronefallUIElement : MonoBehaviour
+{
+ public enum NavigationDirection
+ {
+ Right,
+ Left,
+ Up,
+ Down
+ }
+
+ public enum SelectionState
+ {
+ Default,
+ Focussed,
+ Selected,
+ FocussedAndSelected
+ }
+
+ protected SelectionState currentState;
+
+ protected SelectionState previousState;
+
+ public bool ignoreMouse;
+
+ public bool autoSelectOnFocus;
+
+ public bool cannotBeSelected;
+
+ public bool forceNavigateToDisabledElements;
+
+ public ThronefallUIElement leftNav;
+
+ public ThronefallUIElement rightNav;
+
+ public ThronefallUIElement topNav;
+
+ public ThronefallUIElement botNav;
+
+ public UnityEvent onSelectionStateChange = new UnityEvent();
+
+ public UnityEvent onApply = new UnityEvent();
+
+ public UnityEvent<NavigationDirection> onEmptyNavigate = new UnityEvent<NavigationDirection>();
+
+ public SelectionState CurrentState => currentState;
+
+ public SelectionState PreviousState => previousState;
+
+ public virtual bool dragable => false;
+
+ public void Apply()
+ {
+ if (!SceneTransitionManager.instance.SceneTransitionIsRunning)
+ {
+ onApply.Invoke();
+ OnApply();
+ }
+ }
+
+ public void Select()
+ {
+ SetState(SelectionState.Selected);
+ }
+
+ public void Focus()
+ {
+ SetState(SelectionState.Focussed);
+ }
+
+ public void FocusAndSelect()
+ {
+ SetState(SelectionState.FocussedAndSelected);
+ }
+
+ public void Clear()
+ {
+ SetState(SelectionState.Default);
+ }
+
+ public void HardStateSet(SelectionState selectionState)
+ {
+ currentState = selectionState;
+ previousState = selectionState;
+ OnHardStateSet(selectionState);
+ }
+
+ protected abstract void OnApply();
+
+ protected abstract void OnClear();
+
+ protected abstract void OnSelect();
+
+ protected abstract void OnFocus();
+
+ protected abstract void OnFocusAndSelect();
+
+ protected abstract void OnHardStateSet(SelectionState selectionState);
+
+ private void SetState(SelectionState state)
+ {
+ if (state != currentState)
+ {
+ previousState = currentState;
+ currentState = state;
+ switch (currentState)
+ {
+ case SelectionState.Default:
+ OnClear();
+ break;
+ case SelectionState.Focussed:
+ OnFocus();
+ break;
+ case SelectionState.Selected:
+ OnSelect();
+ break;
+ case SelectionState.FocussedAndSelected:
+ OnFocusAndSelect();
+ break;
+ }
+ onSelectionStateChange.Invoke();
+ }
+ }
+
+ public ThronefallUIElement TryNavigate(NavigationDirection direction)
+ {
+ if (SceneTransitionManager.instance.SceneTransitionIsRunning)
+ {
+ return this;
+ }
+ ThronefallUIElement thronefallUIElement = null;
+ switch (direction)
+ {
+ case NavigationDirection.Down:
+ thronefallUIElement = botNav;
+ break;
+ case NavigationDirection.Up:
+ thronefallUIElement = topNav;
+ break;
+ case NavigationDirection.Left:
+ thronefallUIElement = leftNav;
+ break;
+ case NavigationDirection.Right:
+ thronefallUIElement = rightNav;
+ break;
+ }
+ if ((bool)thronefallUIElement && !thronefallUIElement.gameObject.activeInHierarchy && !forceNavigateToDisabledElements)
+ {
+ return thronefallUIElement.TryNavigate(direction);
+ }
+ onEmptyNavigate.Invoke(direction);
+ return thronefallUIElement;
+ }
+
+ public virtual void OnDrag(Vector2 mousePosition)
+ {
+ }
+
+ public virtual void OnDragEnd()
+ {
+ }
+
+ public virtual void OnDragStart()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TieBreaker.cs b/Thronefall_v1.57/Thronefall/Thronefall/TieBreaker.cs
new file mode 100644
index 0000000..7a03073
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TieBreaker.cs
@@ -0,0 +1,111 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class TieBreaker : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ [SerializeField]
+ private float requiredTimeWithNoDeathsOrDestroyedBuildings = 30f;
+
+ [SerializeField]
+ private float damagePerSecond = 10f;
+
+ private List<TagManager.ETag> mustHaveBuildings = new List<TagManager.ETag>();
+
+ private List<TagManager.ETag> mayNotHaveBuildings = new List<TagManager.ETag>();
+
+ public static TieBreaker instance;
+
+ private EnemySpawner spawner;
+
+ private TagManager tagManager;
+
+ private bool active;
+
+ private int enemiesLeftRemember = -1;
+
+ private int buildingsLeftRemember = -1;
+
+ private float timeupForTieBreaker;
+
+ private bool tieBreakingActive;
+
+ private List<TaggedObject> findTemp = new List<TaggedObject>();
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ private void Start()
+ {
+ spawner = EnemySpawner.instance;
+ tagManager = TagManager.instance;
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ mustHaveBuildings.Add(TagManager.ETag.Building);
+ mustHaveBuildings.Add(TagManager.ETag.AUTO_Alive);
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+
+ public void OnDusk()
+ {
+ active = true;
+ enemiesLeftRemember = -1;
+ buildingsLeftRemember = -1;
+ timeupForTieBreaker = 0f;
+ tieBreakingActive = false;
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ active = false;
+ tieBreakingActive = false;
+ }
+
+ private void Update()
+ {
+ if (tieBreakingActive)
+ {
+ TieBreak();
+ }
+ else if (active && !spawner.SpawningInProgress)
+ {
+ timeupForTieBreaker += Time.deltaTime;
+ if (tagManager.CountAllTaggedObjectsWithTag(TagManager.ETag.Boss) > 0)
+ {
+ timeupForTieBreaker = 0f;
+ }
+ if (spawner.NumberOfEnemiesOnTheMap != enemiesLeftRemember)
+ {
+ timeupForTieBreaker = 0f;
+ enemiesLeftRemember = spawner.NumberOfEnemiesOnTheMap;
+ }
+ tagManager.FindAllTaggedObjectsWithTags(findTemp, mustHaveBuildings, mayNotHaveBuildings);
+ int count = findTemp.Count;
+ if (buildingsLeftRemember != count)
+ {
+ timeupForTieBreaker = 0f;
+ buildingsLeftRemember = count;
+ }
+ if (timeupForTieBreaker > requiredTimeWithNoDeathsOrDestroyedBuildings)
+ {
+ tieBreakingActive = true;
+ }
+ }
+ }
+
+ private void TieBreak()
+ {
+ tagManager.FindAllTaggedObjectsWithTag(findTemp, TagManager.ETag.EnemyOwned);
+ if (findTemp.Count > 0)
+ {
+ findTemp[0].Hp.TakeDamage(damagePerSecond * Time.deltaTime, null, causedByPlayer: false, invokeFeedbackEvents: false);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TimesensitiveLight.cs b/Thronefall_v1.57/Thronefall/Thronefall/TimesensitiveLight.cs
new file mode 100644
index 0000000..3f1fb05
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TimesensitiveLight.cs
@@ -0,0 +1,72 @@
+using System.Collections;
+using UnityEngine;
+
+[RequireComponent(typeof(Light))]
+public class TimesensitiveLight : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ public float dayIntensity = 1f;
+
+ public float nightIntensity;
+
+ public float blendTime = 3f;
+
+ private Light target;
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ StopAllCoroutines();
+ StartCoroutine(BlendToDay(blendTime));
+ }
+
+ public void OnDusk()
+ {
+ StopAllCoroutines();
+ StartCoroutine(BlendToNight(blendTime));
+ }
+
+ private void Start()
+ {
+ target = GetComponent<Light>();
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ if (DayNightCycle.Instance.CurrentTimestate == DayNightCycle.Timestate.Day)
+ {
+ StartCoroutine(BlendToDay(0f));
+ }
+ else
+ {
+ StartCoroutine(BlendToNight(0f));
+ }
+ }
+
+ private IEnumerator BlendToNight(float duration)
+ {
+ float timer = 0f;
+ while (timer <= duration)
+ {
+ timer += Time.deltaTime;
+ target.intensity = Mathf.Lerp(dayIntensity, nightIntensity, Mathf.InverseLerp(0f, duration, timer));
+ yield return null;
+ }
+ target.intensity = nightIntensity;
+ }
+
+ private IEnumerator BlendToDay(float duration)
+ {
+ float timer = 0f;
+ while (timer <= duration)
+ {
+ timer += Time.deltaTime;
+ target.intensity = Mathf.Lerp(nightIntensity, dayIntensity, Mathf.InverseLerp(0f, duration, timer));
+ yield return null;
+ }
+ target.intensity = dayIntensity;
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TitleScreenPopUpHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/TitleScreenPopUpHelper.cs
new file mode 100644
index 0000000..d5932b9
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TitleScreenPopUpHelper.cs
@@ -0,0 +1,50 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class TitleScreenPopUpHelper : MonoBehaviour
+{
+ public const string SHOW_ONCE_IDENTIFIER_PREFIX = "PopupShown_";
+
+ private int currentIndex;
+
+ public List<BeforeGamePopUp> popUpOrder = new List<BeforeGamePopUp>();
+
+ public void PopNext()
+ {
+ StartCoroutine(DelayedPopUp());
+ }
+
+ private IEnumerator DelayedPopUp()
+ {
+ yield return null;
+ try
+ {
+ if (currentIndex >= popUpOrder.Count)
+ {
+ yield break;
+ }
+ bool flag = true;
+ if (popUpOrder[currentIndex].onlyShowOnce)
+ {
+ if (PlayerPrefs.GetInt("PopupShown_" + popUpOrder[currentIndex].identifier) != 0)
+ {
+ flag = false;
+ }
+ else
+ {
+ PlayerPrefs.SetInt("PopupShown_" + popUpOrder[currentIndex].identifier, 1);
+ }
+ }
+ if (flag && popUpOrder[currentIndex].showInFullVersion)
+ {
+ UIFrameManager.instance.ChangeActiveFrameKeepOldVisible(popUpOrder[currentIndex].uiFrame);
+ }
+ currentIndex++;
+ }
+ catch
+ {
+ Debug.Log("There was a problem with the pop-ups in TitleScreenPopUpHelper.cs");
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TitleScreenUIHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/TitleScreenUIHelper.cs
new file mode 100644
index 0000000..84640c0
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TitleScreenUIHelper.cs
@@ -0,0 +1,32 @@
+using UnityEngine;
+
+public class TitleScreenUIHelper : MonoBehaviour
+{
+ [SerializeField]
+ private Equippable tutorialWeapon;
+
+ private float framesTillYouCanPlay = 4f;
+
+ private void Update()
+ {
+ framesTillYouCanPlay -= 1f;
+ }
+
+ public void ClickPlay()
+ {
+ if (!(framesTillYouCanPlay > 0f))
+ {
+ if (LevelProgressManager.instance.GetLevelDataForScene("Neuland(Tutorial)").highscoreBest > 0 || LevelProgressManager.instance.GetLevelDataForScene("Neuland(Tutorial)").beatenBest)
+ {
+ Debug.Log("Start game in level select as tutorial has already been played.");
+ SceneTransitionManager.instance.TransitionFromNullToLevelSelect();
+ return;
+ }
+ Debug.Log("Start it tutorial!");
+ PerkManager.instance.CurrentlyEquipped.Clear();
+ PerkManager.instance.CurrentlyEquipped.Add(tutorialWeapon);
+ LocalGamestate.SelectedGameMode = LocalGamestate.GameMode.Classic;
+ SceneTransitionManager.instance.TransitionFromNullToLevel("Neuland(Tutorial)");
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Tooltip.cs b/Thronefall_v1.57/Thronefall/Thronefall/Tooltip.cs
new file mode 100644
index 0000000..86091f7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Tooltip.cs
@@ -0,0 +1,63 @@
+using MoreMountains.Feedbacks;
+using TMPro;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class Tooltip : MonoBehaviour
+{
+ [SerializeField]
+ private TextMeshProUGUI content;
+
+ [SerializeField]
+ private RectTransform targetRect;
+
+ [SerializeField]
+ private MMF_Player onOpen;
+
+ [SerializeField]
+ private MMF_Player onClose;
+
+ [SerializeField]
+ private MMF_Player onUpdate;
+
+ public string currentText => content.text;
+
+ private void Awake()
+ {
+ base.transform.localScale = Vector3.zero;
+ content.text = "";
+ }
+
+ public void SetTooltip(string tooltipTxt)
+ {
+ if (tooltipTxt == content.text)
+ {
+ return;
+ }
+ onOpen.StopFeedbacks();
+ onClose.StopFeedbacks();
+ onUpdate.StopFeedbacks();
+ content.text = tooltipTxt;
+ if (tooltipTxt == "")
+ {
+ onClose.PlayFeedbacks();
+ return;
+ }
+ if (content.text == "")
+ {
+ onOpen.PlayFeedbacks();
+ }
+ else
+ {
+ onUpdate.PlayFeedbacks();
+ }
+ UpdateSize();
+ }
+
+ private void UpdateSize()
+ {
+ RectTransform component = GetComponent<RectTransform>();
+ LayoutRebuilder.ForceRebuildLayoutImmediate(targetRect);
+ component.sizeDelta = targetRect.sizeDelta;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TooltipManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/TooltipManager.cs
new file mode 100644
index 0000000..54be2e3
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TooltipManager.cs
@@ -0,0 +1,102 @@
+using UnityEngine;
+
+public class TooltipManager : MonoBehaviour
+{
+ public Tooltip targetTooltip;
+
+ private PlayerInteraction playerInteraction;
+
+ private string tutorialOverridePriority = "";
+
+ private string tutorialOverride = "";
+
+ private string nextTooltipText = "";
+
+ private InteractorBase lastFocus;
+
+ private int lastFocusLevel = -9999;
+
+ private bool interactorRefreshFlag;
+
+ public static TooltipManager instance;
+
+ public void SetTutorialOverride(string _text, bool _priorityText = true)
+ {
+ if (_priorityText)
+ {
+ tutorialOverridePriority = _text;
+ }
+ else
+ {
+ tutorialOverride = _text;
+ }
+ }
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ private void Start()
+ {
+ playerInteraction = PlayerInteraction.instance;
+ SceneTransitionManager.instance.onSceneChange.AddListener(ResetAfterSceneLoad);
+ }
+
+ private void ResetAfterSceneLoad()
+ {
+ tutorialOverride = "";
+ tutorialOverridePriority = "";
+ nextTooltipText = "";
+ }
+
+ private void Update()
+ {
+ if (playerInteraction != PlayerInteraction.instance)
+ {
+ playerInteraction = PlayerInteraction.instance;
+ }
+ if (playerInteraction == null)
+ {
+ return;
+ }
+ if (UIFrameManager.instance.ActiveFrame != null)
+ {
+ nextTooltipText = "";
+ interactorRefreshFlag = true;
+ }
+ else if (tutorialOverridePriority != "")
+ {
+ nextTooltipText = tutorialOverridePriority;
+ interactorRefreshFlag = true;
+ }
+ else if ((bool)playerInteraction.FocussedInteractor)
+ {
+ if (lastFocus != playerInteraction.FocussedInteractor || interactorRefreshFlag)
+ {
+ nextTooltipText = playerInteraction.FocussedInteractor.ReturnTooltip();
+ lastFocus = playerInteraction.FocussedInteractor;
+ interactorRefreshFlag = false;
+ }
+ }
+ else if (tutorialOverride != "")
+ {
+ nextTooltipText = tutorialOverride;
+ interactorRefreshFlag = true;
+ }
+ else
+ {
+ nextTooltipText = "";
+ lastFocus = null;
+ }
+ if (nextTooltipText != targetTooltip.currentText)
+ {
+ targetTooltip.SetTooltip(nextTooltipText);
+ }
+ }
+
+ public void SetInteractorRefreshFlag()
+ {
+ interactorRefreshFlag = true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TowerUpgrade.cs b/Thronefall_v1.57/Thronefall/Thronefall/TowerUpgrade.cs
new file mode 100644
index 0000000..27ed80f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TowerUpgrade.cs
@@ -0,0 +1,114 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class TowerUpgrade : MonoBehaviour
+{
+ [SerializeField]
+ private BuildSlot buildSlot;
+
+ [SerializeField]
+ private AutoAttackTower autoAttackTower;
+
+ [SerializeField]
+ private bool overrideTargetingMode;
+
+ [SerializeField]
+ private AutoAttackTower.ETargetingMode targetingMode;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ private float attackCooldownMulti = 1f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ private float rangeMulti = 1f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ private float projectileSpeedMulti = 1f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ private float damageMulti = 1f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private int additionalArrowsToShoot;
+
+ [SerializeField]
+ private Weapon replaceWeapon;
+
+ [SerializeField]
+ private bool changeToHealing;
+
+ [SerializeField]
+ private bool insertTargetPriority;
+
+ [SerializeField]
+ private TargetPriority targetPriority;
+
+ [Header("Move Spire Height")]
+ [SerializeField]
+ private Transform spireTransform;
+
+ [SerializeField]
+ private Transform healthBarTransform;
+
+ [SerializeField]
+ private float adjustHeight;
+
+ public float RangeMulti => rangeMulti;
+
+ private void OnEnable()
+ {
+ if (overrideTargetingMode)
+ {
+ autoAttackTower.targetingMode = targetingMode;
+ }
+ autoAttackTower.cooldownDuration *= attackCooldownMulti;
+ foreach (TargetPriority targetPriority in autoAttackTower.targetPriorities)
+ {
+ targetPriority.range *= rangeMulti;
+ }
+ autoAttackTower.ProjectileSpeedMultiplyer *= projectileSpeedMulti;
+ autoAttackTower.DamageMultiplyer *= damageMulti;
+ if (additionalArrowsToShoot > 0)
+ {
+ autoAttackTower.simultaneousProjectiles += additionalArrowsToShoot;
+ autoAttackTower.tempCollectionArray = new TaggedObject[autoAttackTower.simultaneousProjectiles];
+ }
+ if ((bool)replaceWeapon)
+ {
+ autoAttackTower.weapon = replaceWeapon;
+ }
+ if (changeToHealing)
+ {
+ foreach (TargetPriority targetPriority2 in autoAttackTower.targetPriorities)
+ {
+ List<TagManager.ETag> mustHaveTags = new List<TagManager.ETag>
+ {
+ TagManager.ETag.PlayerOwned,
+ TagManager.ETag.AUTO_Alive
+ };
+ List<TagManager.ETag> mayNotHaveTags = new List<TagManager.ETag> { TagManager.ETag.Building };
+ targetPriority2.mustHaveTags = mustHaveTags;
+ targetPriority2.mayNotHaveTags = mayNotHaveTags;
+ }
+ }
+ if (insertTargetPriority)
+ {
+ float range = autoAttackTower.targetPriorities[0].range;
+ autoAttackTower.targetPriorities.Insert(0, this.targetPriority);
+ autoAttackTower.targetPriorities[0].range = range;
+ }
+ if ((bool)spireTransform)
+ {
+ spireTransform.position += Vector3.up * adjustHeight;
+ }
+ if ((bool)healthBarTransform)
+ {
+ healthBarTransform.position += Vector3.up * adjustHeight;
+ }
+ Object.Destroy(this);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TransitionToSelectedLevelHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/TransitionToSelectedLevelHelper.cs
new file mode 100644
index 0000000..900ddcc
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TransitionToSelectedLevelHelper.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class TransitionToSelectedLevelHelper : MonoBehaviour
+{
+ public bool justRestartCurrentLevel;
+
+ public void TransitionToSelectedLevel()
+ {
+ LocalGamestate.SelectedGameMode = LocalGamestate.GameMode.Classic;
+ if (justRestartCurrentLevel)
+ {
+ SceneTransitionManager.instance.RestartCurrentLevel();
+ }
+ else
+ {
+ SceneTransitionManager.instance.TransitionFromLevelSelectToLevel(LevelInteractor.lastActiveLevelInfo.sceneName);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TreasureChestUIHelper.cs b/Thronefall_v1.57/Thronefall/Thronefall/TreasureChestUIHelper.cs
new file mode 100644
index 0000000..e0a7b5c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TreasureChestUIHelper.cs
@@ -0,0 +1,39 @@
+using TMPro;
+using UnityEngine;
+
+public class TreasureChestUIHelper : MonoBehaviour
+{
+ public Transform scaleTarget;
+
+ public TextMeshProUGUI balanceNumber;
+
+ public GameObject toggleParent;
+
+ private DayNightCycle dnc;
+
+ private LocalGamestate lgs;
+
+ private void Update()
+ {
+ if (dnc == null)
+ {
+ dnc = DayNightCycle.Instance;
+ }
+ if (lgs == null)
+ {
+ lgs = LocalGamestate.Instance;
+ }
+ if (dnc == null || lgs == null)
+ {
+ toggleParent.SetActive(value: false);
+ }
+ else if (dnc.CurrentTimestate == DayNightCycle.Timestate.Day && lgs.CurrentState == LocalGamestate.State.InMatch)
+ {
+ toggleParent.SetActive(value: true);
+ }
+ else
+ {
+ toggleParent.SetActive(value: false);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TreasuryUI.cs b/Thronefall_v1.57/Thronefall/Thronefall/TreasuryUI.cs
new file mode 100644
index 0000000..77981ba
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TreasuryUI.cs
@@ -0,0 +1,218 @@
+using System.Collections.Generic;
+using TMPro;
+using UnityEngine;
+
+public class TreasuryUI : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ public enum AnimationState
+ {
+ Off,
+ ScaleIn,
+ On,
+ ScaleOut,
+ WaitToScaleOut
+ }
+
+ public const int PHYSICAL_COIN_LIMIT = 200;
+
+ public Transform coinsParent;
+
+ public GameObject renderCamera;
+
+ public GameObject coinPrefab;
+
+ public Transform spawn;
+
+ public float removalInterval;
+
+ public float addInterval = 0.35f;
+
+ public float activationLifetime = 1f;
+
+ public AnimationCurve scaleCurve;
+
+ public float scaleAnimationSpeed;
+
+ private Transform scaleTarget;
+
+ public float waitTimeBeforeScaleOut = 0.3f;
+
+ private TextMeshProUGUI displayText;
+
+ public Animator treasureChestAnimator;
+
+ private List<GameObject> instantiatedCoins = new List<GameObject>();
+
+ private PlayerInteraction targetPlayer;
+
+ private int coinQeue;
+
+ private float addCounter;
+
+ private float removalCounter;
+
+ private float activationCounter;
+
+ private bool overrideActivation;
+
+ private AnimationState currentState;
+
+ private float scaleAnimationProgress;
+
+ private float scaleOutWaitClock;
+
+ private bool shouldBeActive
+ {
+ get
+ {
+ if (!(activationCounter > 0f))
+ {
+ return overrideActivation;
+ }
+ return true;
+ }
+ }
+
+ private void Start()
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ scaleTarget = UIFrameManager.instance.TreasureChest.scaleTarget;
+ displayText = UIFrameManager.instance.TreasureChest.balanceNumber;
+ targetPlayer = TagManager.instance.Players[0].GetComponent<PlayerInteraction>();
+ targetPlayer.onFocusPaymentInteraction.AddListener(LockActivation);
+ targetPlayer.onUnfocusPaymentInteraction.AddListener(UnlockActivation);
+ SetState(currentState);
+ }
+
+ private void SetState(AnimationState newState)
+ {
+ switch (newState)
+ {
+ case AnimationState.Off:
+ scaleTarget.localScale = Vector3.one * scaleCurve.Evaluate(0f);
+ scaleAnimationProgress = 0f;
+ break;
+ case AnimationState.On:
+ scaleTarget.localScale = Vector3.one * scaleCurve.Evaluate(1f);
+ scaleAnimationProgress = 1f;
+ treasureChestAnimator.SetBool("Open", value: true);
+ break;
+ case AnimationState.WaitToScaleOut:
+ treasureChestAnimator.SetBool("Open", value: false);
+ scaleOutWaitClock = 0f;
+ break;
+ }
+ currentState = newState;
+ }
+
+ private void Update()
+ {
+ if (addCounter > 0f)
+ {
+ addCounter -= Time.deltaTime;
+ }
+ if (removalCounter > 0f)
+ {
+ removalCounter -= Time.deltaTime;
+ }
+ if (activationCounter > 0f)
+ {
+ activationCounter -= Time.deltaTime;
+ }
+ coinQeue = Mathf.Min(targetPlayer.Balance - instantiatedCoins.Count, 200);
+ if (currentState != 0)
+ {
+ displayText.text = "<sprite name=\"coin\">" + targetPlayer.Balance;
+ }
+ if (coinQeue > 0 && addCounter <= 0f)
+ {
+ GameObject item = Object.Instantiate(coinPrefab, spawn.position, Random.rotation, coinsParent);
+ instantiatedCoins.Add(item);
+ addCounter = addInterval;
+ activationCounter = activationLifetime;
+ }
+ if (coinQeue < 0 && addCounter <= 0f)
+ {
+ GameObject obj = instantiatedCoins[instantiatedCoins.Count - 1];
+ instantiatedCoins.RemoveAt(instantiatedCoins.Count - 1);
+ Object.Destroy(obj);
+ removalCounter = removalInterval;
+ activationCounter = activationLifetime;
+ }
+ switch (currentState)
+ {
+ case AnimationState.Off:
+ if (shouldBeActive)
+ {
+ SetState(AnimationState.ScaleIn);
+ }
+ break;
+ case AnimationState.On:
+ if (!shouldBeActive)
+ {
+ SetState(AnimationState.WaitToScaleOut);
+ }
+ break;
+ case AnimationState.WaitToScaleOut:
+ scaleOutWaitClock += Time.deltaTime;
+ if (scaleOutWaitClock >= waitTimeBeforeScaleOut)
+ {
+ SetState(AnimationState.ScaleOut);
+ }
+ break;
+ case AnimationState.ScaleOut:
+ scaleAnimationProgress -= Time.deltaTime * scaleAnimationSpeed;
+ scaleTarget.localScale = Vector3.one * scaleCurve.Evaluate(scaleAnimationProgress);
+ if (scaleAnimationProgress <= 0f)
+ {
+ SetState(AnimationState.Off);
+ }
+ else if (shouldBeActive)
+ {
+ SetState(AnimationState.ScaleIn);
+ }
+ break;
+ case AnimationState.ScaleIn:
+ scaleAnimationProgress += Time.deltaTime * scaleAnimationSpeed;
+ scaleTarget.localScale = Vector3.one * scaleCurve.Evaluate(scaleAnimationProgress);
+ if (scaleAnimationProgress >= 1f)
+ {
+ SetState(AnimationState.On);
+ }
+ else if (!shouldBeActive)
+ {
+ SetState(AnimationState.ScaleIn);
+ }
+ break;
+ }
+ }
+
+ private void LockActivation()
+ {
+ overrideActivation = true;
+ }
+
+ private void UnlockActivation()
+ {
+ overrideActivation = false;
+ activationCounter = activationLifetime;
+ }
+
+ public void OnDusk()
+ {
+ renderCamera.SetActive(value: false);
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ renderCamera.SetActive(value: true);
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/TutorialManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/TutorialManager.cs
new file mode 100644
index 0000000..847a247
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/TutorialManager.cs
@@ -0,0 +1,662 @@
+using System.Collections.Generic;
+using I2.Loc;
+using Pathfinding.RVO;
+using UnityEngine;
+
+public class TutorialManager : MonoBehaviour
+{
+ public static TutorialManager instance;
+
+ private PlayerInteraction playerInteraction;
+
+ private DayNightCycle dayNightCycle;
+
+ private TooltipManager tooltipManager;
+
+ private TagManager tagManager;
+
+ private EnemySpawner enemySpawner;
+
+ private bool allowStartingTheNight = true;
+
+ private static readonly string LOCIDENTIFIER = "Tutorial/";
+
+ [SerializeField]
+ private Transform arrowMarkerTransform;
+
+ [SerializeField]
+ private ScreenMarker arrowMarker;
+
+ [SerializeField]
+ private Transform player;
+
+ [Header("When you're dead")]
+ [SerializeField]
+ private Hp playerHp;
+
+ [Header("Movement Tutorial")]
+ [SerializeField]
+ private RVOController playerRvo;
+
+ [SerializeField]
+ private float requiredMoveDist;
+
+ private bool playerHasLearnedHowToMove;
+
+ private bool destroyedPracticeTargets;
+
+ private bool playerDidSprint;
+
+ [Header("Build Castle Center")]
+ [SerializeField]
+ private BuildingInteractor caslteBuildInteractor;
+
+ private bool castleCenterBuilt;
+
+ private bool mayShowEnemySpawn;
+
+ [Header("Start The Night")]
+ private bool firstNightStarted;
+
+ [Header("First Night")]
+ [SerializeField]
+ private StabMA activeStabAttack;
+
+ [Header("Build Houses")]
+ [SerializeField]
+ private List<BuildSlot> houses;
+
+ private bool housesBuilt;
+
+ [Header("Start The 2nd Night")]
+ private bool secondNightStarted;
+
+ [Header("2nd Night")]
+ [Header("Collect Taxes")]
+ [SerializeField]
+ private List<BuildSlot> towers;
+
+ private bool towersBuilt;
+
+ [Header("Start The 3d Night")]
+ private bool thirdNightStarted;
+
+ [Header("Upgrade Castle Center")]
+ [SerializeField]
+ private BuildSlot caslteBuilSlot;
+
+ [SerializeField]
+ private GameObject royalTraining;
+
+ [SerializeField]
+ private GameObject buildersGuild;
+
+ private bool castleCenterUpgraded;
+
+ private bool fourthNightStarted;
+
+ [Header("It's up to you!")]
+ [SerializeField]
+ private BuildSlot barracks;
+
+ [SerializeField]
+ private CommandUnits command;
+
+ private bool commandingUnits;
+
+ private bool commandedUnits;
+
+ private bool triedHoldPosition;
+
+ [TextArea(1, 10)]
+ public string whileDead;
+
+ [TextArea(1, 10)]
+ public string howToMove;
+
+ [TextArea(1, 10)]
+ public string howToSprint;
+
+ [TextArea(1, 10)]
+ public string howToBuild;
+
+ [TextArea(1, 10)]
+ public string startTheNight;
+
+ [TextArea(1, 10)]
+ public string howToStartTheNight;
+
+ [TextArea(1, 10)]
+ public string tooExpensiveToBuild;
+
+ [TextArea(1, 10)]
+ public string tooExpensiveToUpgrade;
+
+ [TextArea(1, 10)]
+ public string tooExpensiveToUpgradeCastleCenter;
+
+ [TextArea(1, 10)]
+ public string firstNight;
+
+ [TextArea(1, 10)]
+ public string firstNightDone;
+
+ [TextArea(1, 10)]
+ public string buildHouses;
+
+ [TextArea(1, 10)]
+ public string startThe2ndNight;
+
+ [TextArea(1, 10)]
+ public string secondNight;
+
+ [TextArea(1, 10)]
+ public string buildTowers;
+
+ [TextArea(1, 10)]
+ public string startThe3ndNight;
+
+ [TextArea(1, 10)]
+ public string upgradeCastleCenter;
+
+ [TextArea(1, 10)]
+ public string howToUpgrade;
+
+ [TextArea(1, 10)]
+ public string chooseAnUpgrade;
+
+ [TextArea(1, 10)]
+ public string goodChoiceGeneric;
+
+ [TextArea(1, 10)]
+ public string goodChoiceRoyalTraining;
+
+ [TextArea(1, 10)]
+ public string goodChoiceBuildersGuild;
+
+ [TextArea(1, 10)]
+ public string itsUpToYou;
+
+ [TextArea(1, 10)]
+ public string maybeBuildBarracksSomeTime;
+
+ [TextArea(1, 10)]
+ public string tryToCommandYourUnits;
+
+ [TextArea(1, 10)]
+ public string makeThemHoldPosition;
+
+ [TextArea(1, 10)]
+ public string howToHeal;
+
+ [TextArea(1, 10)]
+ public string lastDay;
+
+ [TextArea(1, 10)]
+ public string lastNight;
+
+ private List<TaggedObject> findTaggedObjects = new List<TaggedObject>();
+
+ private List<TagManager.ETag> mustHaveTag = new List<TagManager.ETag>();
+
+ private List<TagManager.ETag> mayNotHaveTag = new List<TagManager.ETag>();
+
+ public static bool AllowStartingTheNight
+ {
+ get
+ {
+ if (!instance)
+ {
+ return true;
+ }
+ return instance.allowStartingTheNight;
+ }
+ }
+
+ public bool MayShowEnemySpawn => mayShowEnemySpawn;
+
+ private void SetArrowMarker(bool _enabled, Vector3 _pos, bool _offScreenOnly = false)
+ {
+ arrowMarkerTransform.gameObject.SetActive(_enabled);
+ arrowMarkerTransform.position = _pos + Vector3.up * 10f;
+ arrowMarker.showWhenOnScreen = !_offScreenOnly;
+ }
+
+ private void MarkNearestObjectWithTag(TagManager.ETag _tag, bool _offScreenOnly = false)
+ {
+ findTaggedObjects.Clear();
+ mustHaveTag.Clear();
+ mayNotHaveTag.Clear();
+ mustHaveTag.Add(_tag);
+ TagManager.instance.FindAllTaggedObjectsWithTags(findTaggedObjects, mustHaveTag, mayNotHaveTag);
+ if (findTaggedObjects.Count <= 0)
+ {
+ return;
+ }
+ TaggedObject taggedObject = null;
+ float num = float.MaxValue;
+ for (int i = 0; i < findTaggedObjects.Count; i++)
+ {
+ float magnitude = (player.transform.position - findTaggedObjects[i].transform.position).magnitude;
+ if (magnitude < num)
+ {
+ num = magnitude;
+ taggedObject = findTaggedObjects[i];
+ }
+ }
+ SetArrowMarker(_enabled: true, taggedObject.transform.position, _offScreenOnly);
+ }
+
+ private void MarkNearestUnbuiltBuilding(List<BuildSlot> _buildSlots)
+ {
+ List<BuildSlot> list = new List<BuildSlot>(_buildSlots);
+ for (int num = list.Count - 1; num >= 0; num--)
+ {
+ if (list[num].State == BuildSlot.BuildingState.Built)
+ {
+ list.RemoveAt(num);
+ }
+ else if (!list[num].gameObject.activeInHierarchy)
+ {
+ list.RemoveAt(num);
+ }
+ }
+ if (list.Count <= 0)
+ {
+ return;
+ }
+ BuildSlot buildSlot = null;
+ float num2 = float.MaxValue;
+ for (int i = 0; i < list.Count; i++)
+ {
+ float magnitude = (player.transform.position - list[i].transform.position).magnitude;
+ if (magnitude < num2)
+ {
+ num2 = magnitude;
+ buildSlot = list[i];
+ }
+ }
+ SetArrowMarker(_enabled: true, buildSlot.transform.position);
+ }
+
+ private void MarkNearestGoldCoin()
+ {
+ List<Coin> freeCoins = TagManager.instance.freeCoins;
+ if (freeCoins.Count <= 0)
+ {
+ return;
+ }
+ Coin coin = null;
+ float num = float.MaxValue;
+ for (int i = 0; i < freeCoins.Count; i++)
+ {
+ float magnitude = (player.transform.position - freeCoins[i].transform.position).magnitude;
+ if (magnitude < num)
+ {
+ num = magnitude;
+ coin = freeCoins[i];
+ }
+ }
+ SetArrowMarker(_enabled: true, coin.transform.position);
+ }
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ private void OnEnable()
+ {
+ LocalizationManager.OnLocalizeEvent += FetchLocalizedTexts;
+ }
+
+ private void OnDisable()
+ {
+ LocalizationManager.OnLocalizeEvent -= FetchLocalizedTexts;
+ }
+
+ private void Start()
+ {
+ dayNightCycle = DayNightCycle.Instance;
+ tooltipManager = TooltipManager.instance;
+ tagManager = TagManager.instance;
+ playerInteraction = PlayerInteraction.instance;
+ enemySpawner = EnemySpawner.instance;
+ FetchLocalizedTexts();
+ }
+
+ private void Update()
+ {
+ if (SceneTransitionManager.instance.SceneTransitionIsRunning)
+ {
+ return;
+ }
+ SetArrowMarker(_enabled: false, Vector3.zero);
+ tooltipManager.SetTutorialOverride("");
+ tooltipManager.SetTutorialOverride("", _priorityText: false);
+ if (playerHp.KnockedOut)
+ {
+ tooltipManager.SetTutorialOverride(whileDead);
+ return;
+ }
+ if (!playerHasLearnedHowToMove)
+ {
+ MarkNearestObjectWithTag(TagManager.ETag.PracticeTargets);
+ tooltipManager.SetTutorialOverride(howToMove);
+ requiredMoveDist -= playerRvo.velocity.magnitude * Time.deltaTime;
+ if (requiredMoveDist < 0f)
+ {
+ playerHasLearnedHowToMove = true;
+ }
+ return;
+ }
+ if (!destroyedPracticeTargets)
+ {
+ MarkNearestObjectWithTag(TagManager.ETag.PracticeTargets);
+ if (tagManager.CountAllTaggedObjectsWithTag(TagManager.ETag.PracticeTargets) <= 0)
+ {
+ destroyedPracticeTargets = true;
+ }
+ return;
+ }
+ if (tagManager.freeCoins.Count > 0 && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Day && enemySpawner.Wavenumber == -1 && enemySpawner.Wavenumber <= 3)
+ {
+ MarkNearestGoldCoin();
+ return;
+ }
+ if (!castleCenterBuilt)
+ {
+ if (PlayerManager.Instance.RegisteredPlayers[0].Sprinting)
+ {
+ playerDidSprint = true;
+ }
+ if (playerInteraction.FocussedInteractor == caslteBuildInteractor)
+ {
+ tooltipManager.SetTutorialOverride(howToBuild);
+ }
+ else
+ {
+ tooltipManager.SetTutorialOverride(howToSprint);
+ if (playerDidSprint)
+ {
+ SetArrowMarker(_enabled: true, caslteBuildInteractor.transform.position);
+ }
+ }
+ if (tagManager.CountAllTaggedObjectsWithTag(TagManager.ETag.Building) > 0)
+ {
+ castleCenterBuilt = true;
+ mayShowEnemySpawn = true;
+ enemySpawner.EnemySpawnersHornUnFocussed();
+ }
+ return;
+ }
+ if (playerInteraction.FocussedInteractor != null && playerInteraction.FocussedInteractor.GetType() == typeof(BuildingInteractor))
+ {
+ BuildingInteractor buildingInteractor = (BuildingInteractor)playerInteraction.FocussedInteractor;
+ if (buildingInteractor.targetBuilding.CanBeUpgraded && playerInteraction.Balance + CostDisplay.currentlyFilledCoinsFromLastActiveDisplay < buildingInteractor.targetBuilding.NextUpgradeOrBuildCost && !buildingInteractor.UpgradeCueVisible)
+ {
+ if (buildingInteractor.targetBuilding.State == BuildSlot.BuildingState.Blueprint)
+ {
+ tooltipManager.SetTutorialOverride(tooExpensiveToBuild);
+ }
+ else if (buildingInteractor.targetBuilding.GetComponentInChildren<TaggedObject>().Tags.Contains(TagManager.ETag.CastleCenter))
+ {
+ tooltipManager.SetTutorialOverride(tooExpensiveToUpgradeCastleCenter);
+ }
+ else
+ {
+ tooltipManager.SetTutorialOverride(tooExpensiveToUpgrade);
+ }
+ return;
+ }
+ }
+ if (!firstNightStarted)
+ {
+ tooltipManager.SetTutorialOverride(startTheNight);
+ if (dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ firstNightStarted = true;
+ }
+ return;
+ }
+ if (enemySpawner.Wavenumber == 0 && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ EnemySpawner.instance.InfinitelySpawning = activeStabAttack.TargetsStabeed < 3;
+ MarkNearestObjectWithTag(TagManager.ETag.EnemyOwned, _offScreenOnly: true);
+ allowStartingTheNight = false;
+ if (activeStabAttack.TargetsStabeed < 3)
+ {
+ tooltipManager.SetTutorialOverride(firstNight + " (" + activeStabAttack.TargetsStabeed + "/3)");
+ }
+ else
+ {
+ tooltipManager.SetTutorialOverride(firstNightDone);
+ }
+ return;
+ }
+ if (!housesBuilt && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Day)
+ {
+ MarkNearestUnbuiltBuilding(houses);
+ int num = tagManager.CountAllTaggedObjectsWithTag(TagManager.ETag.Building);
+ int num2 = num - 1;
+ tooltipManager.SetTutorialOverride(buildHouses + " (" + num2 + "/3)");
+ if (playerInteraction.FocussedInteractor != null && playerInteraction.FocussedInteractor.GetType() == typeof(BuildingInteractor))
+ {
+ SetArrowMarker(_enabled: false, Vector3.zero);
+ if (num2 == 0)
+ {
+ tooltipManager.SetTutorialOverride(howToBuild);
+ }
+ }
+ if (num >= 4)
+ {
+ housesBuilt = true;
+ }
+ return;
+ }
+ if (!secondNightStarted && housesBuilt)
+ {
+ allowStartingTheNight = true;
+ tooltipManager.SetTutorialOverride(startThe2ndNight);
+ if (dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ secondNightStarted = true;
+ }
+ return;
+ }
+ if (enemySpawner.Wavenumber == 1 && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ MarkNearestObjectWithTag(TagManager.ETag.EnemyOwned, _offScreenOnly: true);
+ allowStartingTheNight = false;
+ tooltipManager.SetTutorialOverride(secondNight);
+ return;
+ }
+ if (!towersBuilt && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Day)
+ {
+ if (dayNightCycle.AfterSunrise)
+ {
+ MarkNearestUnbuiltBuilding(towers);
+ if (playerInteraction.FocussedInteractor != null && playerInteraction.FocussedInteractor.GetType() == typeof(BuildingInteractor))
+ {
+ SetArrowMarker(_enabled: false, Vector3.zero);
+ }
+ int num3 = tagManager.CountAllTaggedObjectsWithTag(TagManager.ETag.Building) - 4;
+ tooltipManager.SetTutorialOverride(buildTowers + " (" + num3 + "/2)");
+ if (num3 >= 2)
+ {
+ towersBuilt = true;
+ }
+ }
+ return;
+ }
+ if (!thirdNightStarted && towersBuilt)
+ {
+ allowStartingTheNight = true;
+ tooltipManager.SetTutorialOverride(startThe3ndNight);
+ if (dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ thirdNightStarted = true;
+ }
+ return;
+ }
+ if (ChoiceManager.instance.ChoiceCoroutineRunning)
+ {
+ tooltipManager.SetTutorialOverride(chooseAnUpgrade);
+ return;
+ }
+ if (thirdNightStarted && !castleCenterUpgraded && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Day)
+ {
+ allowStartingTheNight = false;
+ if (!dayNightCycle.AfterSunrise)
+ {
+ return;
+ }
+ if (playerInteraction.FocussedInteractor == caslteBuildInteractor)
+ {
+ tooltipManager.SetTutorialOverride(howToUpgrade);
+ return;
+ }
+ SetArrowMarker(_enabled: true, caslteBuildInteractor.transform.position);
+ tooltipManager.SetTutorialOverride(upgradeCastleCenter);
+ if (caslteBuilSlot.Level == 2)
+ {
+ castleCenterUpgraded = true;
+ allowStartingTheNight = true;
+ }
+ return;
+ }
+ if (!fourthNightStarted && castleCenterUpgraded)
+ {
+ allowStartingTheNight = true;
+ if (royalTraining.activeInHierarchy)
+ {
+ tooltipManager.SetTutorialOverride(goodChoiceRoyalTraining);
+ }
+ else if (buildersGuild.activeInHierarchy)
+ {
+ tooltipManager.SetTutorialOverride(goodChoiceBuildersGuild);
+ }
+ else
+ {
+ tooltipManager.SetTutorialOverride(goodChoiceGeneric);
+ }
+ if (dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ fourthNightStarted = true;
+ }
+ return;
+ }
+ if (enemySpawner.Wavenumber == 3 && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ allowStartingTheNight = false;
+ return;
+ }
+ if (barracks.State == BuildSlot.BuildingState.Built && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Day)
+ {
+ if (!dayNightCycle.AfterSunrise)
+ {
+ return;
+ }
+ if (!commandedUnits)
+ {
+ if (command.commanding)
+ {
+ commandingUnits = true;
+ }
+ if (commandingUnits && !command.commanding)
+ {
+ commandedUnits = true;
+ }
+ tooltipManager.SetTutorialOverride(tryToCommandYourUnits);
+ return;
+ }
+ if (!triedHoldPosition)
+ {
+ foreach (TaggedObject playerUnit in TagManager.instance.PlayerUnits)
+ {
+ if (playerUnit.GetComponent<PathfindMovementPlayerunit>().HoldPosition)
+ {
+ triedHoldPosition = true;
+ }
+ }
+ tooltipManager.SetTutorialOverride(makeThemHoldPosition);
+ }
+ }
+ if (enemySpawner.Wavenumber == 3 && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Day)
+ {
+ if (dayNightCycle.AfterSunrise)
+ {
+ tooltipManager.SetTutorialOverride(itsUpToYou, _priorityText: false);
+ allowStartingTheNight = true;
+ }
+ }
+ else if (enemySpawner.Wavenumber == 4 && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ tooltipManager.SetTutorialOverride(howToHeal);
+ }
+ else if (enemySpawner.Wavenumber >= 4 && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Day && barracks.State != BuildSlot.BuildingState.Built && playerInteraction.Balance + CostDisplay.currentlyFilledCoinsFromLastActiveDisplay >= 4)
+ {
+ if (dayNightCycle.AfterSunrise)
+ {
+ tooltipManager.SetTutorialOverride(maybeBuildBarracksSomeTime, _priorityText: false);
+ if (playerInteraction.FocussedInteractor == null)
+ {
+ SetArrowMarker(_enabled: true, barracks.transform.position + Vector3.up * 3f);
+ }
+ }
+ }
+ else if (enemySpawner.Wavenumber == 5 && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ tooltipManager.SetTutorialOverride(howToHeal);
+ }
+ else if (enemySpawner.Wavenumber == 5 && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Day)
+ {
+ _ = dayNightCycle.AfterSunrise;
+ }
+ else if (enemySpawner.Wavenumber == 6 && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ tooltipManager.SetTutorialOverride(howToHeal);
+ }
+ else if (enemySpawner.Wavenumber == 6 && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Day)
+ {
+ tooltipManager.SetTutorialOverride(lastDay, _priorityText: false);
+ }
+ else if (enemySpawner.Wavenumber == 7 && dayNightCycle.CurrentTimestate == DayNightCycle.Timestate.Night)
+ {
+ tooltipManager.SetTutorialOverride(lastNight);
+ }
+ }
+
+ private void FetchLocalizedTexts()
+ {
+ whileDead = TextTranslator.Translate(LOCIDENTIFIER + "whileDead");
+ howToMove = TextTranslator.Translate(LOCIDENTIFIER + "howToMove");
+ howToSprint = TextTranslator.Translate(LOCIDENTIFIER + "howToSprint");
+ howToBuild = TextTranslator.Translate(LOCIDENTIFIER + "howToBuild");
+ startTheNight = TextTranslator.Translate(LOCIDENTIFIER + "startTheNight");
+ howToStartTheNight = TextTranslator.Translate(LOCIDENTIFIER + "howToStartTheNight");
+ tooExpensiveToBuild = TextTranslator.Translate(LOCIDENTIFIER + "tooExpensiveToBuild");
+ tooExpensiveToUpgrade = TextTranslator.Translate(LOCIDENTIFIER + "tooExpensiveToUpgrade");
+ tooExpensiveToUpgradeCastleCenter = TextTranslator.Translate(LOCIDENTIFIER + "tooExpensiveToUpgradeCastleCenter");
+ firstNight = TextTranslator.Translate(LOCIDENTIFIER + "firstNight");
+ firstNightDone = TextTranslator.Translate(LOCIDENTIFIER + "firstNightDone");
+ buildHouses = TextTranslator.Translate(LOCIDENTIFIER + "buildHouses");
+ startThe2ndNight = TextTranslator.Translate(LOCIDENTIFIER + "startThe2ndNight");
+ secondNight = TextTranslator.Translate(LOCIDENTIFIER + "secondNight");
+ buildTowers = TextTranslator.Translate(LOCIDENTIFIER + "buildTowers");
+ startThe3ndNight = TextTranslator.Translate(LOCIDENTIFIER + "startThe3ndNight");
+ upgradeCastleCenter = TextTranslator.Translate(LOCIDENTIFIER + "upgradeCastleCenter");
+ howToUpgrade = TextTranslator.Translate(LOCIDENTIFIER + "howToUpgrade");
+ chooseAnUpgrade = TextTranslator.Translate(LOCIDENTIFIER + "chooseAnUpgrade");
+ goodChoiceGeneric = TextTranslator.Translate(LOCIDENTIFIER + "goodChoiceGeneric");
+ goodChoiceRoyalTraining = TextTranslator.Translate(LOCIDENTIFIER + "goodChoiceRoyalTraining");
+ goodChoiceBuildersGuild = TextTranslator.Translate(LOCIDENTIFIER + "goodChoiceBuildersGuild");
+ itsUpToYou = TextTranslator.Translate(LOCIDENTIFIER + "itsUpToYou");
+ maybeBuildBarracksSomeTime = TextTranslator.Translate(LOCIDENTIFIER + "maybeBuildBarracksSomeTime");
+ tryToCommandYourUnits = TextTranslator.Translate(LOCIDENTIFIER + "tryToCommandYourUnits");
+ makeThemHoldPosition = TextTranslator.Translate(LOCIDENTIFIER + "makeThemHoldPosition");
+ howToHeal = TextTranslator.Translate(LOCIDENTIFIER + "howToHeal");
+ lastDay = TextTranslator.Translate(LOCIDENTIFIER + "lastDay");
+ lastNight = TextTranslator.Translate(LOCIDENTIFIER + "lastNight");
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UIBonusLevelSelect.cs b/Thronefall_v1.57/Thronefall/Thronefall/UIBonusLevelSelect.cs
new file mode 100644
index 0000000..ffa74f6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UIBonusLevelSelect.cs
@@ -0,0 +1,109 @@
+using System.Collections.Generic;
+using I2.Loc;
+using TMPro;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class UIBonusLevelSelect : MonoBehaviour
+{
+ public class LevelButtonPair
+ {
+ public ThronefallUIElement button;
+
+ public LevelInfo info;
+
+ public LevelButtonPair(ThronefallUIElement _button, LevelInfo _info)
+ {
+ button = _button;
+ info = _info;
+ }
+ }
+
+ public UIFrame frame;
+
+ public ThronefallUIElement buttonPrefab;
+
+ public Transform buttonParent;
+
+ public TextMeshProUGUI levelTitle;
+
+ public float untertitleSize = 20f;
+
+ public Color crownLocked;
+
+ public Color crownUnlocked;
+
+ private List<LevelButtonPair> levelButtonPairs = new List<LevelButtonPair>();
+
+ public void OnShow()
+ {
+ UpdateLevelTitle();
+ levelButtonPairs.Clear();
+ for (int num = buttonParent.childCount - 1; num >= 0; num--)
+ {
+ Object.Destroy(buttonParent.GetChild(num).gameObject);
+ }
+ LevelInfo[] levelsToPick = BonusLevelInteractor.lastSelected.levelsToPick;
+ foreach (LevelInfo levelInfo in levelsToPick)
+ {
+ ThronefallUIElement thronefallUIElement = Object.Instantiate(buttonPrefab, buttonParent);
+ thronefallUIElement.GetComponent<TextMeshProUGUI>().text = levelInfo.displaySubtitle;
+ int num2 = levelInfo.QuestsComplete();
+ Transform child = thronefallUIElement.transform.GetChild(0);
+ for (int j = 0; j < child.childCount; j++)
+ {
+ if (j >= num2)
+ {
+ child.GetChild(j).GetComponent<Image>().color = crownLocked;
+ }
+ else
+ {
+ child.GetChild(j).GetComponent<Image>().color = crownUnlocked;
+ }
+ }
+ levelButtonPairs.Add(new LevelButtonPair(thronefallUIElement, levelInfo));
+ }
+ for (int k = 0; k < levelButtonPairs.Count; k++)
+ {
+ int num3 = k - 1;
+ int num4 = k + 1;
+ if (num3 < 0)
+ {
+ num3 = levelButtonPairs.Count - 1;
+ }
+ if (num4 > levelButtonPairs.Count - 1)
+ {
+ num4 = 0;
+ }
+ levelButtonPairs[k].button.topNav = levelButtonPairs[num3].button;
+ levelButtonPairs[k].button.botNav = levelButtonPairs[num4].button;
+ }
+ frame.firstSelected = levelButtonPairs[0].button;
+ }
+
+ public void OnSelectionApplied()
+ {
+ ThronefallUIElement lastApplied = frame.LastApplied;
+ bool flag = false;
+ foreach (LevelButtonPair levelButtonPair in levelButtonPairs)
+ {
+ if (levelButtonPair.button == lastApplied)
+ {
+ flag = true;
+ LevelInteractor.lastActiveLevelInfo = levelButtonPair.info;
+ break;
+ }
+ }
+ if (flag)
+ {
+ UIFrameManager.ForceOpenLevelSelect();
+ }
+ }
+
+ public void UpdateLevelTitle()
+ {
+ levelTitle.text = BonusLevelInteractor.lastSelected.baseLevelInfo.displayName;
+ TextMeshProUGUI textMeshProUGUI = levelTitle;
+ textMeshProUGUI.text = textMeshProUGUI.text + "\n<size=" + untertitleSize + "><style=Subheader>" + LocalizationManager.GetTermTranslation("Menu/Bonus Modes") + "</size></style>";
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UIFrame.cs b/Thronefall_v1.57/Thronefall/Thronefall/UIFrame.cs
new file mode 100644
index 0000000..0dd4c08
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UIFrame.cs
@@ -0,0 +1,343 @@
+using System.Collections.Generic;
+using Rewired;
+using UnityEngine;
+using UnityEngine.Events;
+using UnityEngine.EventSystems;
+using UnityEngine.UI;
+
+public class UIFrame : MonoBehaviour
+{
+ public ThronefallUIElement firstSelected;
+
+ public bool storeLastSelectedElementInFrameStack = true;
+
+ public bool freezeTime;
+
+ public bool freezePlayer = true;
+
+ public bool canNotBeEscaped;
+
+ public UnityEvent onActivate = new UnityEvent();
+
+ public UnityEvent onNewFocus = new UnityEvent();
+
+ public UnityEvent onNewSelection = new UnityEvent();
+
+ public UnityEvent onApply = new UnityEvent();
+
+ private List<ThronefallUIElement> managedElements = new List<ThronefallUIElement>();
+
+ private UIFrameManager frameManager;
+
+ private ThronefallUIElement currentSelected;
+
+ private ThronefallUIElement currentFocus;
+
+ private ThronefallUIElement lastSelected;
+
+ private ThronefallUIElement currentDragTarget;
+
+ private Player input;
+
+ private GraphicRaycaster graphicRaycaster;
+
+ private PointerEventData pointerData = new PointerEventData(null);
+
+ private Vector2 lastFramePointerPosition;
+
+ private List<RaycastResult> pointerRayResults = new List<RaycastResult>();
+
+ private List<ThronefallUIElement> filteredPointerResults = new List<ThronefallUIElement>();
+
+ private ThronefallUIElement lastApplied;
+
+ private bool interactable = true;
+
+ private bool mouseSleeping;
+
+ public ThronefallUIElement CurrentSelection => currentSelected;
+
+ public ThronefallUIElement CurrentFocus => currentFocus;
+
+ public ThronefallUIElement LastApplied => lastApplied;
+
+ public bool Interactable => interactable;
+
+ private bool mouseApplyPossible
+ {
+ get
+ {
+ if (!(currentFocus != null) || currentFocus.ignoreMouse)
+ {
+ if (currentSelected != null && currentSelected.autoSelectOnFocus)
+ {
+ return !currentSelected.ignoreMouse;
+ }
+ return false;
+ }
+ return true;
+ }
+ }
+
+ public bool MouseSleeping => mouseSleeping;
+
+ private void Awake()
+ {
+ frameManager = GetComponentInParent<UIFrameManager>();
+ if (frameManager != null)
+ {
+ frameManager.RegisterFrame(this);
+ }
+ }
+
+ private void Start()
+ {
+ input = ReInput.players.GetPlayer(0);
+ graphicRaycaster = GetComponentInParent<GraphicRaycaster>();
+ }
+
+ private void Update()
+ {
+ if ((!(frameManager != null) || !(frameManager.ActiveFrame != this)) && interactable && !SceneTransitionManager.instance.SceneTransitionIsRunning)
+ {
+ HandleMouseNavigation();
+ HandleButtonNavigation();
+ }
+ }
+
+ private void HandleButtonNavigation()
+ {
+ if (input.GetButtonDown("Menu Apply"))
+ {
+ Apply();
+ }
+ else if (input.GetButtonRepeating("Menu Right"))
+ {
+ ControllerOrKeyboardNavigate(ThronefallUIElement.NavigationDirection.Right);
+ }
+ else if (input.GetButtonRepeating("Menu Left"))
+ {
+ ControllerOrKeyboardNavigate(ThronefallUIElement.NavigationDirection.Left);
+ }
+ else if (input.GetButtonRepeating("Menu Up"))
+ {
+ ControllerOrKeyboardNavigate(ThronefallUIElement.NavigationDirection.Up);
+ }
+ else if (input.GetButtonRepeating("Menu Down"))
+ {
+ ControllerOrKeyboardNavigate(ThronefallUIElement.NavigationDirection.Down);
+ }
+ }
+
+ private void HandleMouseNavigation()
+ {
+ if (!input.controllers.hasMouse || !Cursor.visible)
+ {
+ return;
+ }
+ lastFramePointerPosition = pointerData.position;
+ pointerData.position = input.controllers.Mouse.screenPosition;
+ if (mouseSleeping && object.Equals(lastFramePointerPosition, pointerData.position))
+ {
+ return;
+ }
+ mouseSleeping = false;
+ pointerRayResults.Clear();
+ graphicRaycaster.Raycast(pointerData, pointerRayResults);
+ filteredPointerResults.Clear();
+ foreach (RaycastResult pointerRayResult in pointerRayResults)
+ {
+ ThronefallUIElement component = pointerRayResult.gameObject.GetComponent<ThronefallUIElement>();
+ if (component != null && managedElements.Contains(component))
+ {
+ filteredPointerResults.Add(component);
+ }
+ }
+ if (filteredPointerResults.Count > 0 && !filteredPointerResults[0].ignoreMouse)
+ {
+ if (filteredPointerResults[0].autoSelectOnFocus)
+ {
+ if (filteredPointerResults[0] != currentSelected)
+ {
+ Select(filteredPointerResults[0]);
+ }
+ Focus(null);
+ }
+ else
+ {
+ Focus(filteredPointerResults[0]);
+ }
+ }
+ else
+ {
+ Focus(null);
+ }
+ if (input.controllers.Mouse.GetButtonDown(0) && filteredPointerResults.Count > 0 && mouseApplyPossible)
+ {
+ if (CurrentFocus != null)
+ {
+ Select(currentFocus);
+ }
+ Apply();
+ }
+ if (input.controllers.Mouse.GetButton(0) && currentDragTarget != null)
+ {
+ currentDragTarget.OnDrag(input.controllers.Mouse.screenPosition);
+ }
+ if (input.controllers.Mouse.GetButtonUp(0) && currentDragTarget != null)
+ {
+ currentDragTarget.OnDragEnd();
+ currentDragTarget = null;
+ }
+ }
+
+ private void ControllerOrKeyboardNavigate(ThronefallUIElement.NavigationDirection direction)
+ {
+ if (!(currentSelected == null))
+ {
+ mouseSleeping = true;
+ ThronefallUIElement thronefallUIElement = currentSelected.TryNavigate(direction);
+ if (thronefallUIElement != null)
+ {
+ Select(thronefallUIElement);
+ }
+ }
+ }
+
+ public void Select(ThronefallUIElement newSelection)
+ {
+ if (newSelection == currentSelected || newSelection.cannotBeSelected)
+ {
+ return;
+ }
+ lastSelected = currentSelected;
+ currentSelected = newSelection;
+ onNewSelection.Invoke();
+ if (lastSelected != null)
+ {
+ if (lastSelected == currentFocus)
+ {
+ lastSelected.Focus();
+ }
+ else
+ {
+ lastSelected.Clear();
+ }
+ }
+ if (newSelection != null)
+ {
+ if (newSelection == currentFocus)
+ {
+ newSelection.FocusAndSelect();
+ }
+ else
+ {
+ newSelection.Select();
+ }
+ }
+ }
+
+ private void Focus(ThronefallUIElement newFocus)
+ {
+ if (newFocus == currentFocus)
+ {
+ return;
+ }
+ if (currentFocus != null)
+ {
+ if (currentFocus == currentSelected)
+ {
+ currentFocus.Select();
+ }
+ else
+ {
+ currentFocus.Clear();
+ }
+ }
+ if (newFocus != null)
+ {
+ if (newFocus == currentSelected)
+ {
+ newFocus.FocusAndSelect();
+ }
+ else
+ {
+ newFocus.Focus();
+ }
+ }
+ currentFocus = newFocus;
+ onNewFocus.Invoke();
+ }
+
+ public void Activate(ThronefallUIElement _selected = null)
+ {
+ base.gameObject.SetActive(value: true);
+ interactable = true;
+ lastApplied = null;
+ currentFocus = null;
+ currentSelected = null;
+ onActivate.Invoke();
+ RefetchManagedElements();
+ foreach (ThronefallUIElement managedElement in managedElements)
+ {
+ managedElement.HardStateSet(ThronefallUIElement.SelectionState.Default);
+ }
+ ThronefallUIElement thronefallUIElement = _selected;
+ if (thronefallUIElement == null)
+ {
+ thronefallUIElement = firstSelected;
+ }
+ if (thronefallUIElement != null)
+ {
+ Select(thronefallUIElement);
+ }
+ }
+
+ public void Apply()
+ {
+ if (currentFocus != null && currentFocus.cannotBeSelected)
+ {
+ currentFocus.Apply();
+ lastApplied = currentFocus;
+ if (currentFocus.dragable)
+ {
+ currentDragTarget = CurrentFocus;
+ currentDragTarget.OnDragStart();
+ }
+ }
+ else
+ {
+ if (!(currentSelected != null))
+ {
+ return;
+ }
+ currentSelected.Apply();
+ lastApplied = currentSelected;
+ if (currentSelected.dragable)
+ {
+ currentDragTarget = currentSelected;
+ currentDragTarget.OnDragStart();
+ }
+ }
+ onApply.Invoke();
+ }
+
+ public void Deactivate(bool keepGameObjectActive = false)
+ {
+ interactable = false;
+ base.gameObject.SetActive(keepGameObjectActive);
+ foreach (ThronefallUIElement managedElement in managedElements)
+ {
+ if (managedElement != null)
+ {
+ managedElement.Clear();
+ }
+ }
+ }
+
+ public void RefetchManagedElements()
+ {
+ managedElements.Clear();
+ managedElements.AddRange(GetComponentsInChildren<ThronefallUIElement>(includeInactive: true));
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UIFrameManager.cs b/Thronefall_v1.57/Thronefall/Thronefall/UIFrameManager.cs
new file mode 100644
index 0000000..8b73bf4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UIFrameManager.cs
@@ -0,0 +1,406 @@
+using System.Collections.Generic;
+using Rewired;
+using UnityEngine;
+using UnityEngine.Events;
+using UnityEngine.SceneManagement;
+
+public class UIFrameManager : MonoBehaviour
+{
+ private struct FrameStackElement
+ {
+ public UIFrame frame;
+
+ public ThronefallUIElement selectedElement;
+
+ public FrameStackElement(UIFrame _frame, ThronefallUIElement _selectedElement = null)
+ {
+ frame = _frame;
+ selectedElement = _selectedElement;
+ }
+ }
+
+ public static UIFrameManager instance;
+
+ [SerializeField]
+ private Texture2D defaultCursor;
+
+ [SerializeField]
+ private float timeBeforeHideIdleCursor = 3f;
+
+ [SerializeField]
+ private string titleFrameSceneName = "_StartMenu";
+
+ [SerializeField]
+ private UIFrame titleFrame;
+
+ [SerializeField]
+ private UIFrame overworldPauseMenuFrame;
+
+ [SerializeField]
+ private UIFrame inMatchPauseMenuFrame;
+
+ [SerializeField]
+ private UIFrame levelSelectFrame;
+
+ [SerializeField]
+ private UIFrame bonusLevelSelectFrame;
+
+ [SerializeField]
+ private UIFrame eternalTrialsSelectFrame;
+
+ [SerializeField]
+ private UIFrame eternalTrialsLoadoutPickFrame;
+
+ [SerializeField]
+ private UIFrame endOfMatchFrame;
+
+ [SerializeField]
+ private UIFrame levelUpRewardFrame;
+
+ [SerializeField]
+ private UIFrame choiceFrame;
+
+ [SerializeField]
+ private UIFrame resetControlsFrame;
+
+ [SerializeField]
+ private UIFrame inmatchPerkSelectFrame;
+
+ private UIFrame activeFrame;
+
+ private List<UIFrame> frames = new List<UIFrame>();
+
+ private Player input;
+
+ private Stack<FrameStackElement> frameStack = new Stack<FrameStackElement>();
+
+ [SerializeField]
+ private RectTransform inGameUIContainer;
+
+ [SerializeField]
+ private RectTransform onScreenMarkerContainer;
+
+ [SerializeField]
+ private TreasureChestUIHelper treasureChest;
+
+ [SerializeField]
+ private EternalTrialsStageCountDisplay eternalTrialsStageDisplay;
+
+ [HideInInspector]
+ public UnityEvent onFrameOpen = new UnityEvent();
+
+ private SceneTransitionManager sceneTransitionManager;
+
+ private float idleCursorClock;
+
+ public UIFrame ActiveFrame => activeFrame;
+
+ public RectTransform InGameUIContainer => inGameUIContainer;
+
+ public RectTransform OnScreenMarkerContainer => onScreenMarkerContainer;
+
+ public TreasureChestUIHelper TreasureChest => treasureChest;
+
+ public EternalTrialsStageCountDisplay EternalTrialsStageDisplay => eternalTrialsStageDisplay;
+
+ private void Awake()
+ {
+ if (instance != null)
+ {
+ Object.Destroy(base.gameObject);
+ }
+ else
+ {
+ instance = this;
+ }
+ }
+
+ private void Start()
+ {
+ if (SceneManager.sceneCount <= 1)
+ {
+ SceneManager.LoadScene(titleFrameSceneName, LoadSceneMode.Additive);
+ }
+ foreach (UIFrame frame in frames)
+ {
+ frame.Deactivate();
+ }
+ if (IsSceneLoaded(titleFrameSceneName))
+ {
+ SwitchToTitleFrame();
+ }
+ input = ReInput.players.GetPlayer(0);
+ sceneTransitionManager = SceneTransitionManager.instance;
+ sceneTransitionManager.onSceneChange.AddListener(UpdateUIBasedOnCurrentScene);
+ UpdateUIBasedOnCurrentScene();
+ Cursor.SetCursor(defaultCursor, Vector2.zero, CursorMode.ForceSoftware);
+ }
+
+ public void SwitchToTitleFrame()
+ {
+ ChangeActiveFrame(titleFrame);
+ }
+
+ public bool IsSceneLoaded(string sceneName)
+ {
+ for (int i = 0; i < SceneManager.sceneCount; i++)
+ {
+ if (SceneManager.GetSceneAt(i).name == sceneName)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void Update()
+ {
+ if (sceneTransitionManager != null && sceneTransitionManager.SceneTransitionIsRunning)
+ {
+ return;
+ }
+ if (input.GetButtonDown("Pause Menu"))
+ {
+ OpenMenu();
+ }
+ else if (input.GetButtonDown("Cancel"))
+ {
+ Cancel();
+ }
+ if (input.controllers.hasMouse && (input.controllers.Mouse.screenPositionDelta.x > 0f || input.controllers.Mouse.screenPositionDelta.y > 0f))
+ {
+ idleCursorClock = 0f;
+ if (!Cursor.visible)
+ {
+ Cursor.visible = true;
+ }
+ }
+ if (activeFrame == null || activeFrame.CurrentSelection == null || activeFrame.MouseSleeping)
+ {
+ idleCursorClock += Time.unscaledDeltaTime;
+ }
+ if (idleCursorClock > timeBeforeHideIdleCursor && Cursor.visible)
+ {
+ Cursor.visible = false;
+ }
+ }
+
+ private void Cancel()
+ {
+ if (activeFrame != null && activeFrame != titleFrame && !activeFrame.canNotBeEscaped)
+ {
+ CloseActiveFrame();
+ }
+ }
+
+ private void OpenMenu()
+ {
+ if (activeFrame != null && !activeFrame.canNotBeEscaped)
+ {
+ CloseActiveFrame();
+ }
+ else if (activeFrame == null && SceneManager.GetSceneByName(SceneTransitionManager.instance.levelSelectScene).IsValid())
+ {
+ ChangeActiveFrame(overworldPauseMenuFrame);
+ }
+ else if (activeFrame == null)
+ {
+ ChangeActiveFrame(inMatchPauseMenuFrame);
+ }
+ }
+
+ public void RegisterFrame(UIFrame frame)
+ {
+ frames.Add(frame);
+ }
+
+ public void ChangeActiveFrame(UIFrame nextFrame)
+ {
+ ProcessFrameChange(nextFrame, writeOldFrameToStack: true);
+ }
+
+ public void ChangeActiveFrameKeepOldVisible(UIFrame nextFrame)
+ {
+ ProcessFrameChange(nextFrame, writeOldFrameToStack: true, keepOldFrameGameObjectActive: true);
+ }
+
+ private void ProcessFrameChange(UIFrame nextFrame, bool writeOldFrameToStack, bool keepOldFrameGameObjectActive = false, ThronefallUIElement firstSelected = null)
+ {
+ if (nextFrame != null)
+ {
+ if (LocalGamestate.Instance != null)
+ {
+ LocalGamestate.Instance.SetPlayerFreezeState(nextFrame.freezePlayer);
+ }
+ if (nextFrame.freezeTime)
+ {
+ Time.timeScale = 0f;
+ }
+ else
+ {
+ Time.timeScale = 1f;
+ }
+ if (activeFrame != null && writeOldFrameToStack)
+ {
+ frameStack.Push(new FrameStackElement(activeFrame, activeFrame.CurrentSelection));
+ }
+ onFrameOpen.Invoke();
+ }
+ else
+ {
+ if (LocalGamestate.Instance != null)
+ {
+ LocalGamestate.Instance.SetPlayerFreezeState(frozen: false);
+ }
+ Time.timeScale = 1f;
+ frameStack.Clear();
+ }
+ if (activeFrame != null)
+ {
+ if (activeFrame == choiceFrame && ChoiceManager.instance.ChoiceCoroutineWaiting)
+ {
+ ChoiceManager.instance.CancelChoice();
+ }
+ activeFrame.Deactivate(keepOldFrameGameObjectActive);
+ }
+ if (nextFrame != null)
+ {
+ nextFrame.Activate(firstSelected);
+ }
+ activeFrame = nextFrame;
+ }
+
+ public void CloseActiveFrame()
+ {
+ if (!(activeFrame != null))
+ {
+ return;
+ }
+ if (frameStack.Count > 0)
+ {
+ FrameStackElement frameStackElement = frameStack.Pop();
+ if (frameStackElement.frame.storeLastSelectedElementInFrameStack)
+ {
+ ProcessFrameChange(frameStackElement.frame, writeOldFrameToStack: false, keepOldFrameGameObjectActive: false, frameStackElement.selectedElement);
+ }
+ else
+ {
+ ProcessFrameChange(frameStackElement.frame, writeOldFrameToStack: false);
+ }
+ }
+ else
+ {
+ ChangeActiveFrame(null);
+ }
+ }
+
+ public void CloseAllFrames()
+ {
+ if (activeFrame != null)
+ {
+ frameStack.Clear();
+ ChangeActiveFrame(null);
+ }
+ }
+
+ public void ResetToTileScreen()
+ {
+ ProcessFrameChange(titleFrame, writeOldFrameToStack: false);
+ frameStack.Clear();
+ }
+
+ public void QuitToDesktop()
+ {
+ Application.Quit();
+ }
+
+ public static bool TryOpenLevelSelect()
+ {
+ if (instance.activeFrame != null)
+ {
+ return false;
+ }
+ instance.ChangeActiveFrame(instance.levelSelectFrame);
+ return true;
+ }
+
+ public static void ForceOpenLevelSelect()
+ {
+ if (!(instance.activeFrame == instance.levelSelectFrame))
+ {
+ instance.ChangeActiveFrame(instance.levelSelectFrame);
+ }
+ }
+
+ public static bool TryOpenBonusLevelSelect()
+ {
+ if (instance.activeFrame != null)
+ {
+ return false;
+ }
+ instance.ChangeActiveFrame(instance.bonusLevelSelectFrame);
+ return true;
+ }
+
+ public static bool TryOpenEternalTrialsSelect()
+ {
+ if (instance.activeFrame != null)
+ {
+ return false;
+ }
+ instance.ChangeActiveFrame(instance.eternalTrialsSelectFrame);
+ return true;
+ }
+
+ public static bool OpenEternalTrialsLoadoutPick()
+ {
+ instance.ChangeActiveFrame(instance.eternalTrialsLoadoutPickFrame);
+ return true;
+ }
+
+ public static bool OpenInMapPerkSelect()
+ {
+ instance.ChangeActiveFrame(instance.inmatchPerkSelectFrame);
+ return true;
+ }
+
+ public static void TriggerEndOfMatch()
+ {
+ instance.ProcessFrameChange(instance.endOfMatchFrame, writeOldFrameToStack: false);
+ }
+
+ public static void ShowLevelUpReward()
+ {
+ instance.ProcessFrameChange(instance.levelUpRewardFrame, writeOldFrameToStack: true, keepOldFrameGameObjectActive: true);
+ }
+
+ private void UpdateUIBasedOnCurrentScene()
+ {
+ switch (sceneTransitionManager.CurrentSceneState)
+ {
+ case SceneTransitionManager.SceneState.InGame:
+ treasureChest.gameObject.SetActive(value: true);
+ eternalTrialsStageDisplay.gameObject.SetActive(value: true);
+ eternalTrialsStageDisplay.Refresh();
+ break;
+ case SceneTransitionManager.SceneState.LevelSelect:
+ treasureChest.gameObject.SetActive(value: false);
+ eternalTrialsStageDisplay.gameObject.SetActive(value: false);
+ break;
+ case SceneTransitionManager.SceneState.MainMenu:
+ treasureChest.gameObject.SetActive(value: false);
+ eternalTrialsStageDisplay.gameObject.SetActive(value: false);
+ break;
+ }
+ }
+
+ public void PresentChoiceFrame()
+ {
+ ProcessFrameChange(choiceFrame, writeOldFrameToStack: false);
+ }
+
+ public static void ShowResetControlsFrame()
+ {
+ instance.ProcessFrameChange(instance.resetControlsFrame, writeOldFrameToStack: true, keepOldFrameGameObjectActive: true);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UIParentResizer.cs b/Thronefall_v1.57/Thronefall/Thronefall/UIParentResizer.cs
new file mode 100644
index 0000000..4044a15
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UIParentResizer.cs
@@ -0,0 +1,40 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class UIParentResizer : MonoBehaviour
+{
+ public enum Mode
+ {
+ Vertical
+ }
+
+ public Mode mode;
+
+ public float minHeight;
+
+ public float padding = 30f;
+
+ public List<RectTransform> observedElements;
+
+ private RectTransform ownRT;
+
+ public void Trigger()
+ {
+ if (ownRT == null)
+ {
+ ownRT = GetComponent<RectTransform>();
+ }
+ float num = 0f;
+ foreach (RectTransform observedElement in observedElements)
+ {
+ LayoutRebuilder.ForceRebuildLayoutImmediate(observedElement);
+ num += observedElement.sizeDelta.y;
+ }
+ if (num < minHeight)
+ {
+ num = minHeight;
+ }
+ ownRT.sizeDelta = new Vector2(ownRT.sizeDelta.x, num + 2f * padding);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UIScaleHandler.cs b/Thronefall_v1.57/Thronefall/Thronefall/UIScaleHandler.cs
new file mode 100644
index 0000000..0c36253
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UIScaleHandler.cs
@@ -0,0 +1,45 @@
+using UnityEngine;
+
+public class UIScaleHandler : MonoBehaviour
+{
+ public static bool useLargeUI;
+
+ public TooltipManager tooltipManager;
+
+ public GameObject defaultTooltipParent;
+
+ public Tooltip defaultTooltip;
+
+ public GameObject largeTooltipParent;
+
+ public Tooltip largeTooltip;
+
+ public RectTransform treasureChestParent;
+
+ public RectTransform coinCountParent;
+
+ private void Start()
+ {
+ Refresh();
+ }
+
+ public void Refresh()
+ {
+ if (SettingsManager.Instance.UseLargeInGameUI)
+ {
+ defaultTooltipParent.SetActive(value: false);
+ largeTooltipParent.SetActive(value: true);
+ tooltipManager.targetTooltip = largeTooltip;
+ treasureChestParent.localScale = Vector3.one * 1.25f;
+ coinCountParent.localScale = Vector3.one * 1.25f;
+ }
+ else
+ {
+ defaultTooltipParent.SetActive(value: true);
+ largeTooltipParent.SetActive(value: false);
+ tooltipManager.targetTooltip = defaultTooltip;
+ treasureChestParent.localScale = Vector3.one;
+ coinCountParent.localScale = Vector3.one;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UnitAttackAnimator.cs b/Thronefall_v1.57/Thronefall/Thronefall/UnitAttackAnimator.cs
new file mode 100644
index 0000000..01b95c2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UnitAttackAnimator.cs
@@ -0,0 +1,31 @@
+using UnityEngine;
+
+public class UnitAttackAnimator : MonoBehaviour
+{
+ public AutoAttack unit;
+
+ public OneShotAnimationBase attackAnimation;
+
+ public OneShotAnimationBase[] additionalAttackAnimations;
+
+ private void Start()
+ {
+ if ((bool)unit)
+ {
+ unit.onAttackTriggered.AddListener(OnAttack);
+ }
+ }
+
+ private void OnAttack()
+ {
+ if ((bool)attackAnimation)
+ {
+ attackAnimation.Trigger();
+ }
+ OneShotAnimationBase[] array = additionalAttackAnimations;
+ for (int i = 0; i < array.Length; i++)
+ {
+ array[i].Trigger();
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UnitAudio.cs b/Thronefall_v1.57/Thronefall/Thronefall/UnitAudio.cs
new file mode 100644
index 0000000..77f4b5e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UnitAudio.cs
@@ -0,0 +1,395 @@
+using Pathfinding.RVO;
+using UnityEngine;
+
+public class UnitAudio : MonoBehaviour
+{
+ public enum LocomotionMode
+ {
+ Bounce,
+ Rolling,
+ Perpetual
+ }
+
+ public enum OneshotType
+ {
+ TakeDamage,
+ Attack,
+ Die
+ }
+
+ public enum StepType
+ {
+ DefaultOnFoot,
+ Giant,
+ Fly,
+ SiegeRoll,
+ RacerRoll,
+ SquishyBounce,
+ ExploderRoll,
+ MonsterRider,
+ Slime,
+ FlyBig,
+ FlyWizzard
+ }
+
+ public enum DmgType
+ {
+ DefaultHumanoidOnFoot,
+ BigOrganic,
+ SmallOrganic,
+ Siege
+ }
+
+ public enum DeathType
+ {
+ DefaultHumanoidOnFoot,
+ BigOrganic,
+ Siege,
+ Exploder
+ }
+
+ public enum AttackType
+ {
+ DefaultSword,
+ MassiveBlunt,
+ FlyerSpit,
+ Flatbow,
+ Crossbow,
+ Catapult,
+ RacerBite,
+ HunterlingBite,
+ Ram,
+ Slime,
+ Healing,
+ Firespit,
+ Spear,
+ Wizard
+ }
+
+ public LocomotionMode locomotionMode;
+
+ public SimpleWalk walkSource;
+
+ public float maxSpeed = 4f;
+
+ public AudioSource stepSource;
+
+ public AudioSource sfxSource;
+
+ public AutoAttack attackTrigger;
+
+ public Hp hp;
+
+ public RVOController movementTrigger;
+
+ public StepType step;
+
+ [Range(0f, 1f)]
+ public float stepVolume = 0.5f;
+
+ public float stepPitchVariation = 0.1f;
+
+ public AttackType attack;
+
+ [Range(0f, 1f)]
+ public float attackVolume = 0.5f;
+
+ public float attackPitchVariation = 0.3f;
+
+ public DeathType death;
+
+ [Range(0f, 1f)]
+ public float deathVolume = 0.5f;
+
+ public float deathPitchVariation = 0.3f;
+
+ public DmgType dmg;
+
+ [Range(0f, 1f)]
+ public float dmgVolume = 0.5f;
+
+ public float dmgPitchVariation = 0.3f;
+
+ private int rollPriority = 80;
+
+ private int stepPriority = 110;
+
+ private int damagePriority = 20;
+
+ private int attackPriority = 10;
+
+ private int deathPriority = 3;
+
+ private AudioSet.ClipArray soundOnDmg;
+
+ private AudioSet.ClipArray soundOnAttack;
+
+ private AudioSet.ClipArray soundOnDeath;
+
+ private AudioSet.ClipArray soundOnStep;
+
+ private bool dead;
+
+ private bool isBounceLocomotion => locomotionMode == LocomotionMode.Bounce;
+
+ private bool isPerpetualLocomotion => locomotionMode == LocomotionMode.Perpetual;
+
+ private bool isRollingLocomotion => locomotionMode == LocomotionMode.Rolling;
+
+ private void Start()
+ {
+ if (locomotionMode == LocomotionMode.Bounce)
+ {
+ stepSource.priority = stepPriority;
+ }
+ else
+ {
+ stepSource.priority = rollPriority;
+ }
+ AudioSet audioContent = ThronefallAudioManager.Instance.audioContent;
+ switch (step)
+ {
+ case StepType.DefaultOnFoot:
+ soundOnStep = audioContent.DefaultOnFootStep;
+ break;
+ case StepType.Giant:
+ soundOnStep = audioContent.GiantStep;
+ break;
+ case StepType.Fly:
+ soundOnStep = audioContent.FlyingSmall;
+ break;
+ case StepType.FlyBig:
+ soundOnStep = audioContent.FlyingBig;
+ break;
+ case StepType.SiegeRoll:
+ soundOnStep = audioContent.SiegeRoll;
+ break;
+ case StepType.SquishyBounce:
+ soundOnStep = audioContent.SquishyBounce;
+ break;
+ case StepType.RacerRoll:
+ soundOnStep = audioContent.RacerRoll;
+ break;
+ case StepType.ExploderRoll:
+ soundOnStep = audioContent.ExploderRoll;
+ break;
+ case StepType.MonsterRider:
+ soundOnStep = audioContent.MonsterRiderGallop;
+ break;
+ case StepType.Slime:
+ soundOnStep = audioContent.SlimeStep;
+ break;
+ case StepType.FlyWizzard:
+ soundOnStep = audioContent.FlyingWizzard;
+ break;
+ }
+ switch (attack)
+ {
+ case AttackType.DefaultSword:
+ soundOnAttack = audioContent.DefaultSwordAttack;
+ break;
+ case AttackType.Spear:
+ soundOnAttack = audioContent.PlayerSpear;
+ break;
+ case AttackType.MassiveBlunt:
+ soundOnAttack = audioContent.MassiveBluntAttack;
+ break;
+ case AttackType.FlyerSpit:
+ soundOnAttack = audioContent.FlyerSpit;
+ break;
+ case AttackType.Crossbow:
+ soundOnAttack = audioContent.CrossbowShot;
+ break;
+ case AttackType.Flatbow:
+ soundOnAttack = audioContent.FlatbowShot;
+ break;
+ case AttackType.Catapult:
+ soundOnAttack = audioContent.CatapultShot;
+ break;
+ case AttackType.RacerBite:
+ soundOnAttack = audioContent.RacerBite;
+ break;
+ case AttackType.HunterlingBite:
+ soundOnAttack = audioContent.HunterlingBite;
+ break;
+ case AttackType.Firespit:
+ soundOnAttack = audioContent.FireSpit;
+ break;
+ case AttackType.Ram:
+ soundOnAttack = audioContent.Ram;
+ break;
+ case AttackType.Slime:
+ soundOnAttack = audioContent.SlimeSpit;
+ break;
+ case AttackType.Healing:
+ soundOnAttack = audioContent.HealingProjectile;
+ break;
+ case AttackType.Wizard:
+ soundOnAttack = audioContent.FlyingWizardCast;
+ break;
+ }
+ switch (dmg)
+ {
+ case DmgType.DefaultHumanoidOnFoot:
+ soundOnDmg = audioContent.DefaultHumanoidOnFootDamage;
+ break;
+ case DmgType.BigOrganic:
+ soundOnDmg = audioContent.BigOrganicDamage;
+ break;
+ case DmgType.SmallOrganic:
+ soundOnDmg = audioContent.SmallOrganicDamage;
+ break;
+ case DmgType.Siege:
+ soundOnDmg = audioContent.SiegeDamage;
+ break;
+ }
+ switch (death)
+ {
+ case DeathType.DefaultHumanoidOnFoot:
+ soundOnDeath = audioContent.DefaultHumanoidOnFootDeath;
+ break;
+ case DeathType.BigOrganic:
+ soundOnDeath = audioContent.BigOrganicDeath;
+ break;
+ case DeathType.Siege:
+ soundOnDeath = audioContent.SiegeDeath;
+ break;
+ case DeathType.Exploder:
+ soundOnDeath = audioContent.ExploderDeath;
+ break;
+ }
+ if ((bool)hp)
+ {
+ hp.OnKillOrKnockout.AddListener(PlayDeath);
+ hp.OnReceiveDamage.AddListener(PlayDMG);
+ hp.OnRevive.AddListener(Revive);
+ }
+ if ((bool)attackTrigger)
+ {
+ attackTrigger.onAttackTriggered.AddListener(PlayAttack);
+ }
+ switch (locomotionMode)
+ {
+ case LocomotionMode.Rolling:
+ stepSource.clip = soundOnStep.GetRandomClip();
+ stepSource.volume = stepVolume;
+ stepSource.loop = true;
+ stepSource.pitch = Random.Range(1f - stepPitchVariation, 1f + stepPitchVariation);
+ break;
+ case LocomotionMode.Perpetual:
+ stepSource.clip = soundOnStep.GetRandomClip();
+ stepSource.volume = stepVolume;
+ stepSource.loop = true;
+ stepSource.pitch = Random.Range(1f - stepPitchVariation, 1f + stepPitchVariation);
+ stepSource.Play();
+ break;
+ case LocomotionMode.Bounce:
+ if ((bool)walkSource)
+ {
+ walkSource.onGroundContact.AddListener(PlayStep);
+ }
+ break;
+ }
+ if (isRollingLocomotion)
+ {
+ maxSpeed *= maxSpeed;
+ }
+ }
+
+ private void Update()
+ {
+ if (dead)
+ {
+ return;
+ }
+ if (Time.timeScale < 0.1f)
+ {
+ stepSource.Pause();
+ }
+ else if (locomotionMode == LocomotionMode.Perpetual && !stepSource.isPlaying)
+ {
+ stepSource.Play();
+ }
+ else
+ {
+ if (locomotionMode != LocomotionMode.Rolling)
+ {
+ return;
+ }
+ if (movementTrigger.velocity.sqrMagnitude > 0.25f)
+ {
+ if (!stepSource.isPlaying)
+ {
+ stepSource.Play();
+ }
+ stepSource.volume = Mathf.Lerp(0f, stepVolume, movementTrigger.velocity.sqrMagnitude / maxSpeed);
+ }
+ else if (stepSource.isPlaying)
+ {
+ stepSource.Pause();
+ }
+ }
+ }
+
+ public void PlaySound(OneshotType soundType)
+ {
+ if (dead)
+ {
+ return;
+ }
+ switch (soundType)
+ {
+ case OneshotType.Attack:
+ sfxSource.priority = attackPriority;
+ sfxSource.pitch = Random.Range(1f - attackPitchVariation, 1f + attackPitchVariation);
+ sfxSource.PlayOneShot(soundOnAttack.GetRandomClip(), attackVolume);
+ break;
+ case OneshotType.TakeDamage:
+ if (!((double)hp.HpValue < 0.01))
+ {
+ sfxSource.priority = damagePriority;
+ sfxSource.pitch = Random.Range(1f - dmgPitchVariation, 1f + dmgPitchVariation);
+ sfxSource.PlayOneShot(soundOnDmg.GetRandomClip(), dmgVolume);
+ }
+ break;
+ case OneshotType.Die:
+ sfxSource.priority = deathPriority;
+ sfxSource.pitch = Random.Range(1f - deathPitchVariation, 1f + deathPitchVariation);
+ sfxSource.PlayOneShot(soundOnDeath.GetRandomClip(), deathVolume);
+ break;
+ }
+ }
+
+ private void PlayStep()
+ {
+ stepSource.priority = stepPriority;
+ stepSource.pitch = Random.Range(1f - stepPitchVariation, 1f + stepPitchVariation);
+ stepSource.PlayOneShot(soundOnStep.GetRandomClip(), stepVolume);
+ }
+
+ private void PlayAttack()
+ {
+ PlaySound(OneshotType.Attack);
+ }
+
+ private void PlayDMG(bool causedByPlayer)
+ {
+ PlaySound(OneshotType.TakeDamage);
+ }
+
+ private void PlayDeath()
+ {
+ PlaySound(OneshotType.Die);
+ dead = true;
+ if (!hp.getsKnockedOutInsteadOfDying)
+ {
+ sfxSource.transform.parent = null;
+ Object.Destroy(sfxSource.gameObject, 3f);
+ }
+ }
+
+ private void Revive()
+ {
+ dead = false;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UnitCommandRadiusAnimation.cs b/Thronefall_v1.57/Thronefall/Thronefall/UnitCommandRadiusAnimation.cs
new file mode 100644
index 0000000..91834e8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UnitCommandRadiusAnimation.cs
@@ -0,0 +1,68 @@
+using System.Collections;
+using UnityEngine;
+
+public class UnitCommandRadiusAnimation : MonoBehaviour
+{
+ public AnimationCurve animationCurve;
+
+ public AnimationCurve hideCurve;
+
+ public float animationTime;
+
+ public float hideTime = 0.25f;
+
+ private bool active;
+
+ public bool Active => active;
+
+ private void Start()
+ {
+ if (!active)
+ {
+ base.gameObject.SetActive(value: false);
+ }
+ }
+
+ public void Activate()
+ {
+ active = true;
+ StopAllCoroutines();
+ base.gameObject.SetActive(value: true);
+ StartCoroutine(AnimateShow());
+ }
+
+ public void Deactivate()
+ {
+ active = false;
+ if (base.gameObject.activeSelf)
+ {
+ StopAllCoroutines();
+ StartCoroutine(AnimateHide());
+ }
+ }
+
+ private IEnumerator AnimateShow()
+ {
+ float timer = 0f;
+ while (timer <= animationTime)
+ {
+ timer += Time.deltaTime;
+ base.transform.localScale = Vector3.one * animationCurve.Evaluate(Mathf.InverseLerp(0f, animationTime, timer));
+ yield return null;
+ }
+ base.transform.localScale = Vector3.one;
+ }
+
+ private IEnumerator AnimateHide()
+ {
+ float timer = 0f;
+ while (timer <= hideTime)
+ {
+ timer += Time.deltaTime;
+ base.transform.localScale = Vector3.one * hideCurve.Evaluate(Mathf.InverseLerp(0f, hideTime, timer));
+ yield return null;
+ }
+ base.transform.localScale = Vector3.zero;
+ base.gameObject.SetActive(value: false);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UnitDashJump.cs b/Thronefall_v1.57/Thronefall/Thronefall/UnitDashJump.cs
new file mode 100644
index 0000000..dce6e59
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UnitDashJump.cs
@@ -0,0 +1,137 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class UnitDashJump : MonoBehaviour
+{
+ private float nextJumpPossibleIn = 3f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float recheckInterval = 0.75f;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float jumpCooldown = 12f;
+
+ [SerializeField]
+ private AutoAttack autoAttack;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float minAttackJumpDistance;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private float maxAttackJumpDistance;
+
+ [SerializeField]
+ private float jumpDuration = 1f;
+
+ [SerializeField]
+ private float jumpHeight = 10f;
+
+ [SerializeField]
+ private List<TargetPriority> targetPriorities;
+
+ [SerializeField]
+ private Weapon weaponOnLanding;
+
+ [SerializeField]
+ private Transform aliveParent;
+
+ [SerializeField]
+ private GameObject meshParent;
+
+ [SerializeField]
+ private Hp hp;
+
+ [SerializeField]
+ private PathfindMovementPlayerunit unitMovement;
+
+ [SerializeField]
+ private TaggedObject taggedObject;
+
+ private bool dashJumpAnimRunning;
+
+ private void Start()
+ {
+ nextJumpPossibleIn = Random.value * recheckInterval;
+ }
+
+ private void Update()
+ {
+ if (dashJumpAnimRunning || !hp.Alive || unitMovement.FollowingPlayer)
+ {
+ return;
+ }
+ nextJumpPossibleIn -= Time.deltaTime;
+ if (nextJumpPossibleIn > 0f)
+ {
+ return;
+ }
+ nextJumpPossibleIn = recheckInterval;
+ TaggedObject taggedObject = AutoAttack.FindAutoAttackTarget(targetPriorities, base.transform.position);
+ if (!(taggedObject == null))
+ {
+ float magnitude = (taggedObject.transform.position - base.transform.position).magnitude;
+ if (!(magnitude < minAttackJumpDistance) && !(magnitude > maxAttackJumpDistance))
+ {
+ nextJumpPossibleIn = jumpCooldown;
+ StartCoroutine(DashJumpAnimation(taggedObject, magnitude));
+ }
+ }
+ }
+
+ private IEnumerator DashJumpAnimation(TaggedObject _objToAttack, float _distance)
+ {
+ dashJumpAnimRunning = true;
+ autoAttack.enabled = false;
+ hp.invulnerable = true;
+ bool unitHoldPosition = unitMovement.HoldPosition;
+ unitMovement.enabled = false;
+ Vector3 targetPosition2 = _objToAttack.transform.position;
+ Vector3 nearestGroundPosition = unitMovement.GetNearestGroundPosition(targetPosition2);
+ if ((nearestGroundPosition - targetPosition2).magnitude < 1f)
+ {
+ Vector3 startPos = base.transform.position;
+ targetPosition2 = nearestGroundPosition;
+ for (float t = 0f; t < 1f; t += Time.deltaTime / jumpDuration)
+ {
+ if ((bool)_objToAttack)
+ {
+ targetPosition2 = _objToAttack.transform.position;
+ }
+ float num = jumpHeight * ((0f - t) * t + t);
+ base.transform.position = Vector3.Lerp(startPos, targetPosition2, t) + jumpHeight * num * Vector3.up;
+ yield return null;
+ }
+ base.transform.position = targetPosition2;
+ if ((bool)_objToAttack)
+ {
+ Vector3 vector = base.transform.position + autoAttack.spawnAttackHeight * Vector3.up;
+ weaponOnLanding.Attack(vector, _objToAttack.Hp, _objToAttack.transform.position - vector, taggedObject, autoAttack.DamageMultiplyer);
+ }
+ }
+ unitMovement.enabled = true;
+ unitMovement.OriginalPathRequest();
+ unitMovement.HoldPosition = unitHoldPosition;
+ aliveParent.localRotation = Quaternion.identity;
+ aliveParent.localPosition = Vector3.zero;
+ dashJumpAnimRunning = false;
+ autoAttack.enabled = true;
+ hp.invulnerable = false;
+ }
+
+ private void InstantiateHere(GameObject _go)
+ {
+ if ((bool)_go)
+ {
+ FireArcherBurn component = Object.Instantiate(_go, base.transform.position, Quaternion.identity).GetComponent<FireArcherBurn>();
+ if ((bool)component)
+ {
+ component.DamageMultiplyer = GetComponent<AutoAttack>().DamageMultiplyer;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UnitProductionSelector.cs b/Thronefall_v1.57/Thronefall/Thronefall/UnitProductionSelector.cs
new file mode 100644
index 0000000..1b80e90
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UnitProductionSelector.cs
@@ -0,0 +1,114 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class UnitProductionSelector : MonoBehaviour
+{
+ [SerializeField]
+ private Sprite unitSprite;
+
+ [SerializeField]
+ private GameObject selectUnitUIPrefab;
+
+ [SerializeField]
+ private Collider measureDistanceCollider;
+
+ private float selectSpeed = 1f;
+
+ private float deselectSpeed = 1.5f;
+
+ public static List<UnitProductionSelector> allUnitProductionSelectors = new List<UnitProductionSelector>();
+
+ private SelectUnitUI mySelectUnitUI;
+
+ private float currentSelectProgress;
+
+ public static void Clear()
+ {
+ allUnitProductionSelectors.Clear();
+ }
+
+ private void OnEnable()
+ {
+ allUnitProductionSelectors.Add(this);
+ if (!mySelectUnitUI)
+ {
+ mySelectUnitUI = Object.Instantiate(selectUnitUIPrefab, base.transform).GetComponent<SelectUnitUI>();
+ mySelectUnitUI.transform.position = base.transform.parent.position;
+ }
+ }
+
+ private void OnDisable()
+ {
+ allUnitProductionSelectors.Add(this);
+ }
+
+ public static UnitProductionSelector FindClosestToPoint(Vector3 checkPosition, out float distanceFromCollider)
+ {
+ UnitProductionSelector result = null;
+ distanceFromCollider = float.MaxValue;
+ for (int num = allUnitProductionSelectors.Count - 1; num >= 0; num--)
+ {
+ if (allUnitProductionSelectors[num] == null)
+ {
+ allUnitProductionSelectors.RemoveAt(num);
+ }
+ else if (allUnitProductionSelectors[num].measureDistanceCollider.gameObject.activeInHierarchy)
+ {
+ float num2 = Vector3.Distance(checkPosition, allUnitProductionSelectors[num].measureDistanceCollider.ClosestPoint(checkPosition));
+ if (num2 < distanceFromCollider)
+ {
+ distanceFromCollider = num2;
+ result = allUnitProductionSelectors[num];
+ }
+ }
+ }
+ return result;
+ }
+
+ public static void CustomUpdate(UnitProductionSelector standingInSelectRangeOf, bool selectButtonPressed, bool _smartCommand)
+ {
+ foreach (UnitProductionSelector allUnitProductionSelector in allUnitProductionSelectors)
+ {
+ if (allUnitProductionSelector == null)
+ {
+ continue;
+ }
+ if (allUnitProductionSelector == standingInSelectRangeOf)
+ {
+ if (selectButtonPressed)
+ {
+ bool flag = allUnitProductionSelector.currentSelectProgress < 1f;
+ allUnitProductionSelector.currentSelectProgress += allUnitProductionSelector.selectSpeed * Time.deltaTime;
+ if (allUnitProductionSelector.currentSelectProgress >= 1f && flag)
+ {
+ allUnitProductionSelector.CommandAllMyUnits(_smartCommand);
+ }
+ }
+ else
+ {
+ allUnitProductionSelector.currentSelectProgress -= allUnitProductionSelector.deselectSpeed * Time.deltaTime;
+ }
+ allUnitProductionSelector.currentSelectProgress = Mathf.Clamp(allUnitProductionSelector.currentSelectProgress, 0f, 1f);
+ allUnitProductionSelector.mySelectUnitUI.UpdateState(visible: true, allUnitProductionSelector.unitSprite, allUnitProductionSelector.currentSelectProgress);
+ }
+ else
+ {
+ allUnitProductionSelector.currentSelectProgress = 0f;
+ allUnitProductionSelector.mySelectUnitUI.UpdateState(visible: false, null, 0f);
+ }
+ }
+ }
+
+ private void CommandAllMyUnits(bool _smartCommand)
+ {
+ for (int i = 0; i < base.transform.childCount; i++)
+ {
+ Transform child = base.transform.GetChild(i);
+ if (child.gameObject.activeInHierarchy)
+ {
+ TaggedObject component = child.GetComponent<TaggedObject>();
+ CommandUnits.instance.OnUnitAdd(component, _smartCommand);
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UnitRespawnerForBuildings.cs b/Thronefall_v1.57/Thronefall/Thronefall/UnitRespawnerForBuildings.cs
new file mode 100644
index 0000000..a405fb5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UnitRespawnerForBuildings.cs
@@ -0,0 +1,113 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class UnitRespawnerForBuildings : MonoBehaviour
+{
+ public Hp hp;
+
+ public List<Hp> units;
+
+ public List<float> timeToRespawnAUnitDependingOnLevel = new List<float>();
+
+ private float timeTillNextRespawn;
+
+ public BuildSlot myBuildSlot;
+
+ public TaggedObject taggedObject;
+
+ public ProductionBar productionBar;
+
+ [Header("Quick arrange units:")]
+ public Transform copyUnitPositionsFrom;
+
+ private bool gladiatorSchool;
+
+ private bool elliteWarriors;
+
+ private float gladiatorSchoolSpeed;
+
+ private float elliteWarriorSpeed;
+
+ private float totalTrainingSpeed = 1f;
+
+ [SerializeField]
+ private Equippable gladiatorSchoolPerk;
+
+ [SerializeField]
+ private Equippable elliteWarriorsPerk;
+
+ private bool godOfDeathActive;
+
+ private float ResetCooldownTime => timeToRespawnAUnitDependingOnLevel[Mathf.Clamp(myBuildSlot.Level, 0, timeToRespawnAUnitDependingOnLevel.Count - 1)];
+
+ private void Start()
+ {
+ godOfDeathActive = PerkManager.instance.GodOfDeathActive;
+ timeTillNextRespawn = ResetCooldownTime;
+ productionBar.UpdateVisual(0f);
+ gladiatorSchool = PerkManager.IsEquipped(gladiatorSchoolPerk);
+ elliteWarriors = PerkManager.IsEquipped(elliteWarriorsPerk);
+ gladiatorSchoolSpeed = PerkManager.instance.gladiatorSchool_TrainingSpeedMultiplyer;
+ elliteWarriorSpeed = PerkManager.instance.elliteWarriors_TrainingSpeedMultiplyer;
+ totalTrainingSpeed = 1f * (gladiatorSchool ? gladiatorSchoolSpeed : 1f) * (elliteWarriors ? elliteWarriorSpeed : 1f);
+ }
+
+ private void Update()
+ {
+ if (godOfDeathActive)
+ {
+ return;
+ }
+ if (hp.KnockedOut)
+ {
+ productionBar.UpdateVisual(0f);
+ }
+ else if (AtLeastOneUnitIsKnockedOut())
+ {
+ timeTillNextRespawn -= Time.deltaTime;
+ productionBar.UpdateVisual(1f - timeTillNextRespawn / ResetCooldownTime * totalTrainingSpeed);
+ if (timeTillNextRespawn <= 0f)
+ {
+ timeTillNextRespawn += ResetCooldownTime;
+ timeTillNextRespawn /= totalTrainingSpeed;
+ RespawnAKnockedOutUnit();
+ }
+ }
+ else
+ {
+ timeTillNextRespawn = ResetCooldownTime;
+ timeTillNextRespawn /= totalTrainingSpeed;
+ productionBar.UpdateVisual(0f);
+ }
+ }
+
+ private bool AtLeastOneUnitIsKnockedOut()
+ {
+ for (int i = 0; i < units.Count; i++)
+ {
+ Hp hp = units[i];
+ if (hp.gameObject.activeInHierarchy && hp.KnockedOut)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void RespawnAKnockedOutUnit()
+ {
+ for (int i = 0; i < units.Count; i++)
+ {
+ Hp hp = units[i];
+ if (hp.gameObject.activeInHierarchy && hp.KnockedOut)
+ {
+ hp.Revive();
+ PathfindMovementPlayerunit component = hp.GetComponent<PathfindMovementPlayerunit>();
+ Vector3 position = taggedObject.colliderForBigOjectsToMeasureDistance.ClosestPoint(component.HopePositionOriginal);
+ hp.transform.position = position;
+ component.SnapToNavmesh();
+ break;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UnitSpawnAppear.cs b/Thronefall_v1.57/Thronefall/Thronefall/UnitSpawnAppear.cs
new file mode 100644
index 0000000..514dcbb
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UnitSpawnAppear.cs
@@ -0,0 +1,36 @@
+using UnityEngine;
+
+public class UnitSpawnAppear : MonoBehaviour
+{
+ public AnimationCurve scaleCurve;
+
+ public float animationTime;
+
+ public float initialDelay;
+
+ public Transform target;
+
+ private float timer;
+
+ private float delay;
+
+ private void Awake()
+ {
+ target.localScale = Vector3.zero;
+ }
+
+ private void Update()
+ {
+ delay += Time.deltaTime;
+ if (!(delay < initialDelay))
+ {
+ timer += Time.deltaTime;
+ target.localScale = Vector3.one * scaleCurve.Evaluate(Mathf.InverseLerp(0f, animationTime, timer));
+ if (timer > animationTime)
+ {
+ base.transform.localScale = Vector3.one;
+ base.enabled = false;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UnitySerializedDictionary.cs b/Thronefall_v1.57/Thronefall/Thronefall/UnitySerializedDictionary.cs
new file mode 100644
index 0000000..3fc1906
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UnitySerializedDictionary.cs
@@ -0,0 +1,35 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public abstract class UnitySerializedDictionary<TKey, TValue> : Dictionary<TKey, TValue>, ISerializationCallbackReceiver
+{
+ [SerializeField]
+ [HideInInspector]
+ private List<TKey> keyData = new List<TKey>();
+
+ [SerializeField]
+ [HideInInspector]
+ private List<TValue> valueData = new List<TValue>();
+
+ void ISerializationCallbackReceiver.OnAfterDeserialize()
+ {
+ Clear();
+ for (int i = 0; i < keyData.Count && i < valueData.Count; i++)
+ {
+ base[keyData[i]] = valueData[i];
+ }
+ }
+
+ void ISerializationCallbackReceiver.OnBeforeSerialize()
+ {
+ keyData.Clear();
+ valueData.Clear();
+ using Enumerator enumerator = GetEnumerator();
+ while (enumerator.MoveNext())
+ {
+ KeyValuePair<TKey, TValue> current = enumerator.Current;
+ keyData.Add(current.Key);
+ valueData.Add(current.Value);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UnparentAndDestroyDelayedOnDeath.cs b/Thronefall_v1.57/Thronefall/Thronefall/UnparentAndDestroyDelayedOnDeath.cs
new file mode 100644
index 0000000..59b829e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UnparentAndDestroyDelayedOnDeath.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class UnparentAndDestroyDelayedOnDeath : MonoBehaviour
+{
+ public Hp target;
+
+ public float extraLifetime = 4f;
+
+ private void Start()
+ {
+ target.OnKillOrKnockout.AddListener(Trigger);
+ }
+
+ private void Trigger()
+ {
+ base.transform.parent = null;
+ Object.Destroy(base.gameObject, extraLifetime);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UnparentOnStart.cs b/Thronefall_v1.57/Thronefall/Thronefall/UnparentOnStart.cs
new file mode 100644
index 0000000..8cd5be0
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UnparentOnStart.cs
@@ -0,0 +1,9 @@
+using UnityEngine;
+
+public class UnparentOnStart : MonoBehaviour
+{
+ private void Start()
+ {
+ base.transform.parent = null;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UpgradeAssassinsTraining.cs b/Thronefall_v1.57/Thronefall/Thronefall/UpgradeAssassinsTraining.cs
new file mode 100644
index 0000000..05ee892
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UpgradeAssassinsTraining.cs
@@ -0,0 +1,36 @@
+using UnityEngine;
+
+public class UpgradeAssassinsTraining : MonoBehaviour
+{
+ public static UpgradeAssassinsTraining instance;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float autoAttackCooldownDurationMulti = 2f;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float manualAttackCooldownDurationMulti = 2f;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public float activationWindow = 0.5f;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float cooldownMultiForPerfectlyTimedAttacks = 0.5f;
+
+ private void OnEnable()
+ {
+ instance = this;
+ PlayerUpgradeManager.instance.assassinsTraining = true;
+ ManualAttack[] componentsInChildren = PlayerMovement.instance.gameObject.GetComponentsInChildren<ManualAttack>(includeInactive: true);
+ foreach (ManualAttack manualAttack in componentsInChildren)
+ {
+ if (manualAttack.autoAttack)
+ {
+ manualAttack.cooldownTime *= autoAttackCooldownDurationMulti;
+ }
+ else
+ {
+ manualAttack.cooldownTime *= manualAttackCooldownDurationMulti;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UpgradeBuildersGuild.cs b/Thronefall_v1.57/Thronefall/Thronefall/UpgradeBuildersGuild.cs
new file mode 100644
index 0000000..176041c
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UpgradeBuildersGuild.cs
@@ -0,0 +1,82 @@
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+public class UpgradeBuildersGuild : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ private static UpgradeBuildersGuild instance;
+
+ private List<TagManager.ETag> mustHaveTags = new List<TagManager.ETag>();
+
+ private List<TagManager.ETag> mayNotHaveTags = new List<TagManager.ETag>();
+
+ private List<TaggedObject> allHousesTaggedObjs = new List<TaggedObject>();
+
+ private List<TaggedObject> allHousesTaggedObjsSorted = new List<TaggedObject>();
+
+ public static UpgradeBuildersGuild Instance => instance;
+
+ private void OnEnable()
+ {
+ if (!mustHaveTags.Contains(TagManager.ETag.House))
+ {
+ mustHaveTags.Add(TagManager.ETag.House);
+ }
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ instance = this;
+ }
+
+ private void OnDisable()
+ {
+ instance = null;
+ }
+
+ public void OnDuskEarly()
+ {
+ UpgradeAHouse();
+ }
+
+ public void OnDusk()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ private void UpgradeAHouse()
+ {
+ TagManager.instance.FindAllTaggedObjectsWithTags(allHousesTaggedObjs, mustHaveTags, mayNotHaveTags);
+ allHousesTaggedObjsSorted = allHousesTaggedObjs.OrderBy((TaggedObject o) => (o.transform.position - base.transform.position).magnitude).ToList();
+ for (int i = 0; i < allHousesTaggedObjsSorted.Count; i++)
+ {
+ BuildSlot componentInParent = allHousesTaggedObjs[i].GetComponentInParent<BuildSlot>();
+ if (componentInParent.Level == 1)
+ {
+ componentInParent.TryToBuildOrUpgradeAndPay(null, _presentChoice: false);
+ break;
+ }
+ }
+ }
+
+ public int GetIncomeChangeIfNextUpgradeIsPossible()
+ {
+ int result = 0;
+ TagManager.instance.FindAllTaggedObjectsWithTags(allHousesTaggedObjs, mustHaveTags, mayNotHaveTags);
+ allHousesTaggedObjsSorted = allHousesTaggedObjs.OrderBy((TaggedObject o) => (o.transform.position - base.transform.position).magnitude).ToList();
+ for (int i = 0; i < allHousesTaggedObjsSorted.Count; i++)
+ {
+ BuildSlot componentInParent = allHousesTaggedObjs[i].GetComponentInParent<BuildSlot>();
+ if (componentInParent.Level == 1)
+ {
+ result = componentInParent.upgrades[componentInParent.Level].upgradeBranches[0].goldIncomeChange;
+ break;
+ }
+ }
+ return result;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UpgradeCastleUp.cs b/Thronefall_v1.57/Thronefall/Thronefall/UpgradeCastleUp.cs
new file mode 100644
index 0000000..fbff140
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UpgradeCastleUp.cs
@@ -0,0 +1,76 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class UpgradeCastleUp : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private int immediateWallAndTowerDiscount2 = 2;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ private int immediateWallAndTowerDiscount3 = 4;
+
+ private List<TagManager.ETag> mustHaveTags = new List<TagManager.ETag>();
+
+ private List<TagManager.ETag> mayNotHaveTags = new List<TagManager.ETag>();
+
+ private List<TaggedObject> allWallsAndTowers = new List<TaggedObject>();
+
+ private void OnEnable()
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ if (!LocalMatchSaveLoad.CurrentlyLoadingMatch)
+ {
+ mustHaveTags.Add(TagManager.ETag.WallOrTower);
+ DecreasePriceOfWallsAndTowers(immediateWallAndTowerDiscount2, immediateWallAndTowerDiscount3);
+ }
+ }
+
+ public void OnDusk()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ StartCoroutine(AfterSunriseDelayed());
+ }
+
+ public IEnumerator AfterSunriseDelayed()
+ {
+ yield return null;
+ }
+
+ private void DecreasePriceOfWallsAndTowers(int _reductionLvl2, int _reductionLvl3)
+ {
+ TagManager.instance.FindAllTaggedObjectsWithTags(allWallsAndTowers, mustHaveTags, mayNotHaveTags);
+ for (int i = 0; i < allWallsAndTowers.Count; i++)
+ {
+ BuildSlot componentInParent = allWallsAndTowers[i].GetComponentInParent<BuildSlot>();
+ if (!componentInParent.ActivatorUpgradesThis)
+ {
+ if (componentInParent.Level == 1)
+ {
+ componentInParent.NextUpgradeOrBuildCost = Mathf.Max(1, componentInParent.NextUpgradeOrBuildCost - _reductionLvl2);
+ }
+ if (componentInParent.Level == 2)
+ {
+ componentInParent.NextUpgradeOrBuildCost = Mathf.Max(1, componentInParent.NextUpgradeOrBuildCost - _reductionLvl3);
+ }
+ }
+ }
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+
+ public void OnBeforeMainLoadPass(string guid)
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UpgradeCommander.cs b/Thronefall_v1.57/Thronefall/Thronefall/UpgradeCommander.cs
new file mode 100644
index 0000000..e6488f6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UpgradeCommander.cs
@@ -0,0 +1,39 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class UpgradeCommander : MonoBehaviour
+{
+ public static UpgradeCommander instance;
+
+ private float cooldown;
+
+ private TagManager tagManager;
+
+ private Transform playerTransform;
+
+ private void OnEnable()
+ {
+ tagManager = TagManager.instance;
+ instance = this;
+ CommandUnits.instance.PlaceCommandedUnitsAndCalculateTargetPositions(_smartCommand: false);
+ CommandUnits.instance.commanding = false;
+ List<TaggedObject> list = new List<TaggedObject>();
+ List<PathfindMovementPlayerunit> list2 = new List<PathfindMovementPlayerunit>();
+ TagManager.instance.FindAllTaggedObjectsWithTag(list, TagManager.ETag.PlayerUnit);
+ foreach (TaggedObject item in list)
+ {
+ PathfindMovementPlayerunit component = item.GetComponent<PathfindMovementPlayerunit>();
+ if (component.HoldPosition)
+ {
+ list2.Add(component);
+ component.HoldPosition = false;
+ }
+ }
+ PlayerUpgradeManager.instance.commander = true;
+ foreach (PathfindMovementPlayerunit item2 in list2)
+ {
+ item2.HoldPosition = true;
+ }
+ playerTransform = PlayerUpgradeManager.instance.transform;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UpgradeGodlyCurse.cs b/Thronefall_v1.57/Thronefall/Thronefall/UpgradeGodlyCurse.cs
new file mode 100644
index 0000000..e1a6fc8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UpgradeGodlyCurse.cs
@@ -0,0 +1,9 @@
+using UnityEngine;
+
+public class UpgradeGodlyCurse : MonoBehaviour
+{
+ private void OnEnable()
+ {
+ PlayerUpgradeManager.instance.godlyCurse = true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UpgradeMagicArmor.cs b/Thronefall_v1.57/Thronefall/Thronefall/UpgradeMagicArmor.cs
new file mode 100644
index 0000000..8251e8b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UpgradeMagicArmor.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class UpgradeMagicArmor : MonoBehaviour
+{
+ public static UpgradeMagicArmor instance;
+
+ [BalancingParameter(BalancingParameter.EType.Default)]
+ public float damageAmount = 1f;
+
+ private void Awake()
+ {
+ instance = this;
+ }
+
+ private void OnEnable()
+ {
+ PlayerUpgradeManager.instance.magicArmor = true;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UpgradePlayerDmg.cs b/Thronefall_v1.57/Thronefall/Thronefall/UpgradePlayerDmg.cs
new file mode 100644
index 0000000..537a2c4
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UpgradePlayerDmg.cs
@@ -0,0 +1,12 @@
+using UnityEngine;
+
+public class UpgradePlayerDmg : MonoBehaviour
+{
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float damageMultiplyer;
+
+ private void OnEnable()
+ {
+ PlayerUpgradeManager.instance.PlayerDamageMultiplyer *= damageMultiplyer;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UpgradePlayerHp.cs b/Thronefall_v1.57/Thronefall/Thronefall/UpgradePlayerHp.cs
new file mode 100644
index 0000000..6fb58e8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UpgradePlayerHp.cs
@@ -0,0 +1,22 @@
+using UnityEngine;
+
+public class UpgradePlayerHp : MonoBehaviour
+{
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float healthMultiplyer;
+
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ public float heatlhRegenMultiplyer;
+
+ private void OnEnable()
+ {
+ PlayerMovement[] registeredPlayers = PlayerManager.Instance.RegisteredPlayers;
+ for (int i = 0; i < registeredPlayers.Length; i++)
+ {
+ Hp component = registeredPlayers[i].GetComponent<Hp>();
+ component.maxHp *= healthMultiplyer;
+ component.Heal(float.MaxValue);
+ }
+ PlayerUpgradeManager.instance.PlayerHealthRegenerationMultiplyer *= heatlhRegenMultiplyer;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/UpgradeUnitsOnEnable.cs b/Thronefall_v1.57/Thronefall/Thronefall/UpgradeUnitsOnEnable.cs
new file mode 100644
index 0000000..4fd69f8
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/UpgradeUnitsOnEnable.cs
@@ -0,0 +1,30 @@
+using UnityEngine;
+
+public class UpgradeUnitsOnEnable : MonoBehaviour
+{
+ [SerializeField]
+ private Hp[] units;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ private float healthMulti;
+
+ [SerializeField]
+ [BalancingParameter(BalancingParameter.EType.PercentageModifyer)]
+ private float attackMulti;
+
+ private void OnEnable()
+ {
+ Hp[] array = units;
+ foreach (Hp obj in array)
+ {
+ obj.maxHp *= healthMulti;
+ obj.Heal(100000000f);
+ AutoAttack[] components = obj.GetComponents<AutoAttack>();
+ for (int j = 0; j < components.Length; j++)
+ {
+ components[j].DamageMultiplyer *= attackMulti;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/VersionNumberDisplay.cs b/Thronefall_v1.57/Thronefall/Thronefall/VersionNumberDisplay.cs
new file mode 100644
index 0000000..90b50f0
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/VersionNumberDisplay.cs
@@ -0,0 +1,12 @@
+using TMPro;
+using UnityEngine;
+
+public class VersionNumberDisplay : MonoBehaviour
+{
+ public TextMeshProUGUI display;
+
+ private void OnEnable()
+ {
+ display.text = "version " + Application.version;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/VirtualBuilding.cs b/Thronefall_v1.57/Thronefall/Thronefall/VirtualBuilding.cs
new file mode 100644
index 0000000..bae1d9f
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/VirtualBuilding.cs
@@ -0,0 +1,113 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Events;
+
+[Serializable]
+public class VirtualBuilding
+{
+ public string name;
+
+ public bool built;
+
+ public bool builtReset;
+
+ public int cost;
+
+ public int costReset;
+
+ public List<int> requirementIndexes = new List<int>();
+
+ public int income;
+
+ public int incomeReset;
+
+ public UnityEvent callAfterIncome = new UnityEvent();
+
+ public float priority;
+
+ public float priorityReset;
+
+ public bool economicBuilding;
+
+ public int defensePower;
+
+ public int representingLevel;
+
+ public UnityAction ActionMillLowerIncome;
+
+ public UnityAction ActionShrineActivate;
+
+ public UnityAction ActionHarborIncreaseIncomeLvl1;
+
+ public BuildSlot RepresentingBuildSlot { get; set; }
+
+ public void Reset()
+ {
+ built = builtReset;
+ cost = costReset;
+ income = incomeReset;
+ priority = priorityReset;
+ }
+
+ public bool IsBuildable(int _withBudget, List<VirtualBuilding> _virtualBuildings)
+ {
+ if (built)
+ {
+ return false;
+ }
+ if (cost > _withBudget)
+ {
+ return false;
+ }
+ foreach (int requirementIndex in requirementIndexes)
+ {
+ try
+ {
+ if (!_virtualBuildings[requirementIndex].built)
+ {
+ return false;
+ }
+ }
+ catch
+ {
+ Debug.LogError("inx: " + requirementIndex + "\n_virtualBuildings.Count: " + _virtualBuildings.Count);
+ }
+ }
+ return true;
+ }
+
+ public VirtualBuilding()
+ {
+ ActionMillLowerIncome = MillLowerIncome;
+ ActionHarborIncreaseIncomeLvl1 = HarborIncreaseIncomeLvl1;
+ ActionShrineActivate = ShrineActivate;
+ }
+
+ public void MillLowerIncome()
+ {
+ income = Mathf.Max(1, income - 1);
+ }
+
+ public void ShrineActivate()
+ {
+ income = Mathf.Min(2, income + 1);
+ }
+
+ public void HarborIncreaseIncomeLvl1()
+ {
+ income = Mathf.Min(5, income + 1);
+ foreach (VirtualBuilding virtualBuilding in EconomySimulator.VirtualBuildings)
+ {
+ if (!(virtualBuilding.name != name) && virtualBuilding.representingLevel == representingLevel + 1 && virtualBuilding.requirementIndexes.Contains(EconomySimulator.VirtualBuildings.IndexOf(this)))
+ {
+ virtualBuilding.income = income;
+ if (virtualBuilding.income >= 4)
+ {
+ virtualBuilding.priority = 90f;
+ }
+ break;
+ }
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Wave.cs b/Thronefall_v1.57/Thronefall/Thronefall/Wave.cs
new file mode 100644
index 0000000..b6c203e
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Wave.cs
@@ -0,0 +1,153 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+[Serializable]
+public class Wave
+{
+ [TextArea]
+ public string warningText;
+
+ public List<Spawn> spawns = new List<Spawn>();
+
+ public Wave()
+ {
+ }
+
+ public Wave(List<Spawn> _spawns)
+ {
+ spawns = _spawns;
+ }
+
+ public Wave(Spawn _spawn)
+ {
+ spawns.Clear();
+ spawns.Add(_spawn);
+ }
+
+ public void Reset(bool _resetGold = true)
+ {
+ for (int i = 0; i < spawns.Count; i++)
+ {
+ spawns[i].Reset(_resetGold);
+ }
+ }
+
+ public void Update()
+ {
+ for (int i = 0; i < spawns.Count; i++)
+ {
+ spawns[i].Update();
+ }
+ }
+
+ public bool HasFinished()
+ {
+ int num = 0;
+ for (int i = 0; i < spawns.Count; i++)
+ {
+ if (spawns[i].Finished)
+ {
+ num++;
+ }
+ }
+ if (num >= spawns.Count)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ public void ReduceMaxDelayTillNextSpawn()
+ {
+ float num = 5f;
+ float num2 = float.MaxValue;
+ foreach (Spawn spawn in spawns)
+ {
+ if (!spawn.Finished)
+ {
+ num2 = Mathf.Min(num2, spawn.waitBeforeNextSpawn);
+ }
+ }
+ float num3 = Mathf.Max(0f, num2 - num);
+ foreach (Spawn spawn2 in spawns)
+ {
+ if (!spawn2.Finished)
+ {
+ spawn2.waitBeforeNextSpawn -= num3;
+ }
+ }
+ }
+
+ public void AddInfoToExisting(ref WaveInfo waveInfo)
+ {
+ foreach (Spawn spawn in spawns)
+ {
+ if (spawn.enemyPrefab == null)
+ {
+ continue;
+ }
+ ScreenMarkerIcon component = spawn.enemyPrefab.GetComponent<ScreenMarkerIcon>();
+ string unitDescription = component.UnitDescription;
+ string unitName = component.UnitName;
+ Sprite sprite = component.sprite;
+ WaveEnemyInfo waveEnemyInfo = null;
+ foreach (WaveEnemyInfo enemy in waveInfo.enemies)
+ {
+ if (enemy.enemyIcon == sprite && enemy.enemyName == unitName && enemy.eliteEnemy == spawn.eliteEnemies)
+ {
+ waveEnemyInfo = enemy;
+ break;
+ }
+ }
+ if (waveEnemyInfo == null)
+ {
+ waveEnemyInfo = new WaveEnemyInfo();
+ waveEnemyInfo.enemyDescription = unitDescription;
+ waveEnemyInfo.enemyName = unitName;
+ waveEnemyInfo.enemyIcon = sprite;
+ waveEnemyInfo.eliteEnemy = spawn.eliteEnemies;
+ waveInfo.enemies.Add(waveEnemyInfo);
+ }
+ waveInfo.goldReward += spawn.goldCoins;
+ waveEnemyInfo.enemyCount += spawn.count;
+ }
+ }
+
+ public WaveInfo GetWaveInfo()
+ {
+ WaveInfo waveInfo = new WaveInfo();
+ foreach (Spawn spawn in spawns)
+ {
+ if (spawn.enemyPrefab == null)
+ {
+ continue;
+ }
+ ScreenMarkerIcon component = spawn.enemyPrefab.GetComponent<ScreenMarkerIcon>();
+ string unitDescription = component.UnitDescription;
+ string unitName = component.UnitName;
+ Sprite sprite = component.sprite;
+ WaveEnemyInfo waveEnemyInfo = null;
+ foreach (WaveEnemyInfo enemy in waveInfo.enemies)
+ {
+ if (enemy.enemyIcon == sprite && enemy.enemyName == unitName && enemy.eliteEnemy == spawn.eliteEnemies)
+ {
+ waveEnemyInfo = enemy;
+ break;
+ }
+ }
+ if (waveEnemyInfo == null)
+ {
+ waveEnemyInfo = new WaveEnemyInfo();
+ waveEnemyInfo.enemyDescription = unitDescription;
+ waveEnemyInfo.enemyName = unitName;
+ waveEnemyInfo.enemyIcon = sprite;
+ waveEnemyInfo.eliteEnemy = spawn.eliteEnemies;
+ waveInfo.enemies.Add(waveEnemyInfo);
+ }
+ waveInfo.goldReward += spawn.goldCoins;
+ waveEnemyInfo.enemyCount += spawn.count;
+ }
+ return waveInfo;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/WaveCountPopUp.cs b/Thronefall_v1.57/Thronefall/Thronefall/WaveCountPopUp.cs
new file mode 100644
index 0000000..0ff4ff0
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/WaveCountPopUp.cs
@@ -0,0 +1,81 @@
+using System.Collections;
+using TMPro;
+using UnityEngine;
+
+public class WaveCountPopUp : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ public GameObject popup;
+
+ public AnimationCurve scaleCurve;
+
+ public float animationTime = 0.75f;
+
+ public float initialDelay = 0.5f;
+
+ public float showTime = 3f;
+
+ public TextMeshProUGUI targetText;
+
+ private bool inAnimation;
+
+ private void Start()
+ {
+ popup.SetActive(value: false);
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public void OnDusk()
+ {
+ if (!inAnimation)
+ {
+ StartCoroutine(PopUpAnimation());
+ }
+ }
+
+ private IEnumerator PopUpAnimation()
+ {
+ inAnimation = true;
+ popup.SetActive(value: true);
+ popup.transform.localScale = Vector3.zero;
+ float timer2 = 0f;
+ yield return new WaitForSeconds(initialDelay);
+ targetText.text = "<style=Body Numerals>" + (EnemySpawner.instance.Wavenumber + 1) + "</style><style=Body Bold>/</style><style=Body Numerals>" + EnemySpawner.instance.WaveCount;
+ StartCoroutine(PlaySoundDelayed());
+ while (timer2 < animationTime)
+ {
+ timer2 += Time.deltaTime;
+ popup.transform.localScale = Vector3.one * scaleCurve.Evaluate(Mathf.InverseLerp(0f, animationTime, timer2));
+ yield return null;
+ }
+ popup.transform.localScale = Vector3.one;
+ yield return new WaitForSeconds(showTime);
+ timer2 = 0f;
+ while (timer2 < animationTime)
+ {
+ timer2 += Time.deltaTime;
+ popup.transform.localScale = Vector3.one * scaleCurve.Evaluate(Mathf.InverseLerp(animationTime, 0f, timer2));
+ yield return null;
+ }
+ popup.transform.localScale = Vector3.zero;
+ popup.SetActive(value: false);
+ inAnimation = false;
+ }
+
+ private IEnumerator PlaySoundDelayed()
+ {
+ yield return new WaitForSeconds(0.1f);
+ ThronefallAudioManager.Oneshot(ThronefallAudioManager.AudioOneShot.ShowWaveCount);
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/WaveDescriptionUI.cs b/Thronefall_v1.57/Thronefall/Thronefall/WaveDescriptionUI.cs
new file mode 100644
index 0000000..2749729
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/WaveDescriptionUI.cs
@@ -0,0 +1,30 @@
+using UnityEngine;
+
+public class WaveDescriptionUI : MonoBehaviour, DayNightCycle.IDaytimeSensitive
+{
+ public GameObject waveDescriptionPanel;
+
+ private void Start()
+ {
+ DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this);
+ waveDescriptionPanel.SetActive(DayNightCycle.Instance.CurrentTimestate == DayNightCycle.Timestate.Day);
+ }
+
+ public void OnDawn_AfterSunrise()
+ {
+ waveDescriptionPanel.SetActive(value: true);
+ }
+
+ public void OnDusk()
+ {
+ waveDescriptionPanel.SetActive(value: false);
+ }
+
+ public void OnDawn_BeforeSunrise()
+ {
+ }
+
+ public void OnDuskEarly()
+ {
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/WaveDraft.cs b/Thronefall_v1.57/Thronefall/Thronefall/WaveDraft.cs
new file mode 100644
index 0000000..93122e6
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/WaveDraft.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+
+[Serializable]
+public class WaveDraft
+{
+ public List<EternalTrialEnemy> enemiesToEncounter = new List<EternalTrialEnemy>();
+
+ public List<float> percentageOfDifficultyAllocatedToEnemy = new List<float>();
+
+ public List<float> spawnInSpeedForEnemy = new List<float>();
+
+ public float targetDifficulty;
+
+ public int defenseGoldSpent;
+
+ public int goldToDropAtNight;
+
+ public List<int> enemyCountForEnemy = new List<int>();
+
+ public List<bool> eliteEnemies = new List<bool>();
+
+ public float waveDuration;
+
+ public List<List<EnemySpawnLine>> enemySpawnLines = new List<List<EnemySpawnLine>>();
+
+ public List<List<int>> enemiesPerSpawnLine = new List<List<int>>();
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/WaveEnemyInfo.cs b/Thronefall_v1.57/Thronefall/Thronefall/WaveEnemyInfo.cs
new file mode 100644
index 0000000..1186228
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/WaveEnemyInfo.cs
@@ -0,0 +1,16 @@
+using System;
+using UnityEngine;
+
+[Serializable]
+public class WaveEnemyInfo
+{
+ public Sprite enemyIcon;
+
+ public string enemyName;
+
+ public string enemyDescription;
+
+ public int enemyCount;
+
+ public bool eliteEnemy;
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/WaveGenUtility.cs b/Thronefall_v1.57/Thronefall/Thronefall/WaveGenUtility.cs
new file mode 100644
index 0000000..4ae0182
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/WaveGenUtility.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+public class WaveGenUtility
+{
+ public static List<T> GetRandomElements<T>(List<T> list, int n, System.Random random)
+ {
+ return list.OrderBy((T x) => random.Next()).Take(n).ToList();
+ }
+
+ public static List<int> DistributeEnemies(int totalEnemies, int spawnLineCount)
+ {
+ List<float> list = new List<float>();
+ List<int> list2 = new List<int>();
+ float num = 0f;
+ for (int i = 0; i < spawnLineCount; i++)
+ {
+ float num2 = UnityEngine.Random.Range(0.2f, 1f);
+ list.Add(num2);
+ num += num2;
+ }
+ list.Sort((float a, float b) => b.CompareTo(a));
+ int j = 0;
+ for (int k = 0; k < spawnLineCount; k++)
+ {
+ float num3 = list[k] / num;
+ int num4 = Mathf.FloorToInt((float)totalEnemies * num3);
+ list2.Add(num4);
+ j += num4;
+ }
+ for (; j < totalEnemies; j++)
+ {
+ list2[0]++;
+ }
+ return list2;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/WaveInfo.cs b/Thronefall_v1.57/Thronefall/Thronefall/WaveInfo.cs
new file mode 100644
index 0000000..3659328
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/WaveInfo.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+
+[Serializable]
+public class WaveInfo
+{
+ public int waveNumber;
+
+ public int outOfWaves;
+
+ public int goldReward;
+
+ public List<WaveEnemyInfo> enemies = new List<WaveEnemyInfo>();
+
+ public string ToDebugString()
+ {
+ string text = "";
+ text += $"Wave {waveNumber}/{outOfWaves}:\n\n";
+ foreach (WaveEnemyInfo enemy in enemies)
+ {
+ text += $"{enemy.enemyCount}x {enemy.enemyName}:\n";
+ text = text + enemy.enemyDescription + "\n\n";
+ }
+ return text;
+ }
+
+ private int[] DistributeEvenly(int total, int divisions)
+ {
+ int[] array = new int[divisions];
+ int num = total / divisions;
+ int num2 = total % divisions;
+ for (int i = 0; i < divisions; i++)
+ {
+ array[i] = num + ((i < num2) ? 1 : 0);
+ }
+ return array;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Weapon.cs b/Thronefall_v1.57/Thronefall/Thronefall/Weapon.cs
new file mode 100644
index 0000000..6a50921
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Weapon.cs
@@ -0,0 +1,249 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+[CreateAssetMenu(fileName = "Weapon", menuName = "SimpleSiege/Weapon")]
+public class Weapon : ScriptableObject
+{
+ public enum EFacingDirection
+ {
+ Uniform,
+ FaceVictim,
+ FaceAttacker,
+ Random
+ }
+
+ public enum EDamageAffectedByBlacksmithUpgrade
+ {
+ Null,
+ MultiplyBy_MeleeDamage,
+ MultiplyBy_RangedDamage,
+ DivideBy_MeleeResistance,
+ DivideBy_RangedResistance
+ }
+
+ [Header("Blacksmith Upgrades")]
+ public EDamageAffectedByBlacksmithUpgrade blacksmithEffect;
+
+ [Header("Aimbot Projectile Settings")]
+ public EFacingDirection projectileFacingDirection;
+
+ public float projectileSpeed;
+
+ public float projectileParabulaFactor;
+
+ public float projectileParabulaOffset;
+
+ public GameObject projectileVisuals;
+
+ public GameObject projectileImpactVisuals;
+
+ public float raycastLength = 1f;
+
+ public bool performRaycastBeforeShooting;
+
+ public LayerMask raycastBeforeShootingLayerMask;
+
+ public float maximumChaseRange = 10000f;
+
+ public float shootWithoutTargetRange = 20f;
+
+ public GameObject spawnOnGroundWhenTargetingGround;
+
+ public GameObject spawnInAirWhenTargetingAir;
+
+ [Header("Melee Attack Setting")]
+ public GameObject fxSpawnOnAttacker;
+
+ public bool parentFxToAttacker;
+
+ public GameObject fxSpawnOnVictim;
+
+ [Header("Damage")]
+ public bool isPlayerWeapon;
+
+ public List<DamageModifyer> directDamage;
+
+ public List<DamageModifyer> splashDamage;
+
+ public float slowsFastEnemiesFor;
+
+ private PlayerUpgradeManager playerUpgradeManager;
+
+ [Header("Bonus Effects")]
+ [SerializeField]
+ private List<AdditionalWeaponEffectScript> additionalWeaponEffects = new List<AdditionalWeaponEffectScript>();
+
+ private BlacksmithUpgrades blacksmithUpgrades;
+
+ public void Attack(Vector3 _attackOrigin, Hp _target, Vector3 _attackDirection, TaggedObject _attacker, float _finalDamageMultiplyer = 1f, float _projectileSpeedMultiplyer = 1f)
+ {
+ playerUpgradeManager = PlayerUpgradeManager.instance;
+ Vector3 vector = _attackOrigin + _attackDirection;
+ if ((bool)_target)
+ {
+ vector = ((!(_target.TaggedObj.colliderForBigOjectsToMeasureDistance != null)) ? (_target.transform.position + _target.hitFeedbackHeight * Vector3.up) : _target.TaggedObj.colliderForBigOjectsToMeasureDistance.ClosestPoint(_attackOrigin));
+ }
+ if (performRaycastBeforeShooting)
+ {
+ Physics.Raycast(_attackOrigin, vector - _attackOrigin, out var hitInfo, (vector - _attackOrigin).magnitude, raycastBeforeShootingLayerMask);
+ if ((bool)hitInfo.collider)
+ {
+ Hp componentInParent = hitInfo.collider.GetComponentInParent<Hp>();
+ if ((bool)componentInParent)
+ {
+ _target = componentInParent;
+ vector = ((!_target.TaggedObj.colliderForBigOjectsToMeasureDistance) ? (_target.transform.position + _target.hitFeedbackHeight * Vector3.up) : _target.TaggedObj.colliderForBigOjectsToMeasureDistance.ClosestPoint(_attackOrigin));
+ }
+ }
+ }
+ if (projectileSpeed > 0f && projectileVisuals != null)
+ {
+ AimbotProjectile component = Object.Instantiate(projectileVisuals, _attackOrigin, Quaternion.identity).GetComponent<AimbotProjectile>();
+ Vector3 backupTarget = Vector3.zero;
+ if (_target == null)
+ {
+ backupTarget = _attackOrigin + _attackDirection.normalized * shootWithoutTargetRange;
+ }
+ component.Fire(this, _target, maximumChaseRange, backupTarget, _attacker, _finalDamageMultiplyer, _projectileSpeedMultiplyer);
+ return;
+ }
+ if (fxSpawnOnAttacker != null)
+ {
+ SpawnAttackFx(fxSpawnOnAttacker, _attackOrigin, _attackOrigin, _target, vector, _attacker, _finalDamageMultiplyer, parentFxToAttacker);
+ }
+ if (fxSpawnOnVictim != null && _target != null)
+ {
+ SpawnAttackFx(fxSpawnOnVictim, vector, _attackOrigin, _target, vector, _attacker, _finalDamageMultiplyer);
+ }
+ DealDamage(_target, _finalDamageMultiplyer, _attacker);
+ }
+
+ private void SpawnAttackFx(GameObject _fxPrefab, Vector3 _spawnPosition, Vector3 _attackOrigin, Hp _target, Vector3 _attackPosition, TaggedObject _attacker, float _finalDamageMultiplyer = 1f, bool parentToAttacker = false)
+ {
+ Quaternion rotation = Quaternion.identity;
+ if (_attackPosition != _attackOrigin)
+ {
+ Vector3 vector = _attackPosition - _attackOrigin;
+ vector = new Vector3(vector.x, 0f, vector.z);
+ rotation = Quaternion.LookRotation(vector, Vector3.up);
+ }
+ Transform parent = null;
+ if (parentToAttacker)
+ {
+ parent = _attacker.transform;
+ }
+ GameObject fxWithSplashDamageAreas = Object.Instantiate(_fxPrefab, _spawnPosition, rotation, parent);
+ DealSplashDamage(fxWithSplashDamageAreas, _attacker, _finalDamageMultiplyer);
+ }
+
+ public void DealSplashDamage(GameObject _fxWithSplashDamageAreas, TaggedObject _attacker, float _finalDamageMultiplyer)
+ {
+ if (splashDamage.Count <= 0)
+ {
+ return;
+ }
+ SplashDamageArea[] componentsInChildren = _fxWithSplashDamageAreas.GetComponentsInChildren<SplashDamageArea>();
+ if (componentsInChildren.Length != 0)
+ {
+ List<Hp> list = new List<Hp>();
+ for (int i = 0; i < componentsInChildren.Length; i++)
+ {
+ componentsInChildren[i].AddReiveDamageHpScriptsInAreaToList(list);
+ }
+ for (int j = 0; j < list.Count; j++)
+ {
+ DealDamage(list[j], _finalDamageMultiplyer, _attacker, splashDamage: true);
+ }
+ }
+ }
+
+ public void DealDamage(Hp _target, float _finalDamageMultiplyer, TaggedObject _attacker, bool splashDamage = false)
+ {
+ if (!_target)
+ {
+ return;
+ }
+ TaggedObject taggedObj = _target.TaggedObj;
+ if (!taggedObj)
+ {
+ return;
+ }
+ float num = _finalDamageMultiplyer;
+ if (blacksmithUpgrades == null)
+ {
+ blacksmithUpgrades = BlacksmithUpgrades.instance;
+ }
+ switch (blacksmithEffect)
+ {
+ case EDamageAffectedByBlacksmithUpgrade.MultiplyBy_MeleeDamage:
+ num *= blacksmithUpgrades.meleeDamage;
+ break;
+ case EDamageAffectedByBlacksmithUpgrade.MultiplyBy_RangedDamage:
+ num *= blacksmithUpgrades.rangedDamage;
+ break;
+ case EDamageAffectedByBlacksmithUpgrade.DivideBy_MeleeResistance:
+ num /= blacksmithUpgrades.meleeResistance;
+ break;
+ case EDamageAffectedByBlacksmithUpgrade.DivideBy_RangedResistance:
+ num /= blacksmithUpgrades.rangedResistance;
+ break;
+ }
+ float hpValue = _target.HpValue;
+ float num2;
+ if (splashDamage)
+ {
+ num2 = CalculateSplashDamageOnTarget(taggedObj, num);
+ _target.TakeDamage(num2, _attacker, isPlayerWeapon);
+ }
+ else
+ {
+ num2 = CalculateDirectDamageOnTarget(taggedObj, num);
+ _target.TakeDamage(num2, _attacker, isPlayerWeapon);
+ }
+ if (num2 == 0f)
+ {
+ return;
+ }
+ foreach (AdditionalWeaponEffectScript additionalWeaponEffect in additionalWeaponEffects)
+ {
+ additionalWeaponEffect.Effect(_target, taggedObj, _attacker, this, _finalDamageMultiplyer);
+ }
+ if (taggedObj.Tags.Contains(TagManager.ETag.Player) && playerUpgradeManager.magicArmor && hpValue - _target.HpValue > 0f && (bool)_attacker)
+ {
+ if ((bool)_attacker.Hp)
+ {
+ _attacker.Hp.TakeDamage(UpgradeMagicArmor.instance.damageAmount, taggedObj, causedByPlayer: true);
+ }
+ else
+ {
+ Debug.LogError("Attacker.Hp is not set.");
+ }
+ }
+ if (slowsFastEnemiesFor >= 0f && taggedObj.Tags.Contains(TagManager.ETag.FastMoving) && (bool)_target.PathfindMovement)
+ {
+ if (PerkManager.instance.IceMagicActive)
+ {
+ _target.PathfindMovement.Slow(slowsFastEnemiesFor);
+ }
+ else
+ {
+ _target.PathfindMovement.Slow(slowsFastEnemiesFor);
+ }
+ }
+ }
+
+ public float CalculateDirectDamageOnTarget(TaggedObject _taggedObject, float _finalDamageMultiplyer = 1f)
+ {
+ return DamageModifyer.CalculateDamageOnTarget(_taggedObject, directDamage, _finalDamageMultiplyer);
+ }
+
+ public float CalculateSplashDamageOnTarget(TaggedObject _taggedObject, float _finalDamageMultiplyer = 1f)
+ {
+ return DamageModifyer.CalculateDamageOnTarget(_taggedObject, splashDamage, _finalDamageMultiplyer);
+ }
+
+ public static float CalculateDamageGeneral(TaggedObject _taggedObject, List<DamageModifyer> directDamage, float _finalDamageMultiplyer = 1f)
+ {
+ return DamageModifyer.CalculateDamageOnTarget(_taggedObject, directDamage, _finalDamageMultiplyer);
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/WeaponDamageDealer.cs b/Thronefall_v1.57/Thronefall/Thronefall/WeaponDamageDealer.cs
new file mode 100644
index 0000000..93db9e2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/WeaponDamageDealer.cs
@@ -0,0 +1,18 @@
+using UnityEngine;
+
+public class WeaponDamageDealer : MonoBehaviour
+{
+ protected float damageMultiplyer = 1f;
+
+ public float DamageMultiplyer
+ {
+ get
+ {
+ return damageMultiplyer;
+ }
+ set
+ {
+ damageMultiplyer = value;
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/WeaponEquipper.cs b/Thronefall_v1.57/Thronefall/Thronefall/WeaponEquipper.cs
new file mode 100644
index 0000000..cbaff00
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/WeaponEquipper.cs
@@ -0,0 +1,37 @@
+using UnityEngine;
+
+public class WeaponEquipper : MonoBehaviour
+{
+ public Equippable requiredWeapon;
+
+ public ManualAttack activeWeapon;
+
+ public ManualAttack passiveWeapon;
+
+ public GameObject visuals;
+
+ public PlayerAttackTargetFacer facer;
+
+ private void Start()
+ {
+ if (!PerkManager.IsEquipped(requiredWeapon))
+ {
+ Object.Destroy(base.gameObject);
+ return;
+ }
+ GetComponentInParent<PlayerInteraction>().EquipWeapon(activeWeapon, passiveWeapon);
+ GetComponentInParent<PlayerUpgradeManager>();
+ GetComponentInParent<PlayerAttack>().AssignManualAttack(activeWeapon);
+ base.gameObject.AddComponent<PlayerWeaponVisuals>().Init(visuals, passiveWeapon);
+ facer.AssignAttack(passiveWeapon);
+ Object.Destroy(this);
+ if (PerkManager.instance.LightMaterialsEquipped)
+ {
+ RoyalForgeUpgrade.AutoAttackMulti(PerkManager.instance.lightMaterialsCooldownMulti);
+ }
+ if (PerkManager.instance.SpellScrollActive)
+ {
+ RoyalForgeUpgrade.ManualAttackMulti(PerkManager.instance.spellScrollActiveCooldownMulti);
+ }
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/Wiggler.cs b/Thronefall_v1.57/Thronefall/Thronefall/Wiggler.cs
new file mode 100644
index 0000000..c287088
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/Wiggler.cs
@@ -0,0 +1,46 @@
+using UnityEngine;
+
+public class Wiggler : MonoBehaviour
+{
+ public Transform parentOverride;
+
+ [SerializeField]
+ private float acceleration = 50f;
+
+ [SerializeField]
+ [Range(0f, 1f)]
+ private float speedDamping = 0.5f;
+
+ [SerializeField]
+ private float positionDampingMultiplyer = 1f;
+
+ private Vector3 parentOffset;
+
+ public Vector3 velocity { get; set; }
+
+ private void Start()
+ {
+ if (parentOverride == null)
+ {
+ parentOverride = base.transform.parent;
+ }
+ parentOffset = Quaternion.Inverse(parentOverride.rotation) * (base.transform.position - parentOverride.position);
+ base.transform.SetParent(null);
+ }
+
+ private void Update()
+ {
+ if (!parentOverride)
+ {
+ Object.Destroy(base.gameObject);
+ return;
+ }
+ Vector3 vector = parentOverride.position + parentOverride.rotation * parentOffset;
+ base.transform.position = Vector3.Lerp(vector, base.transform.position, Mathf.Pow(speedDamping, Time.deltaTime * positionDampingMultiplyer));
+ Vector3 vector2 = vector - base.transform.position;
+ float num = Time.deltaTime * acceleration * vector2.magnitude;
+ velocity += vector2.normalized * num;
+ velocity *= Mathf.Pow(speedDamping, Time.deltaTime);
+ base.transform.position += velocity * Time.deltaTime;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/WigglerAnimatedVelocity.cs b/Thronefall_v1.57/Thronefall/Thronefall/WigglerAnimatedVelocity.cs
new file mode 100644
index 0000000..2106d1b
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/WigglerAnimatedVelocity.cs
@@ -0,0 +1,45 @@
+using UnityEngine;
+
+public class WigglerAnimatedVelocity : MonoBehaviour
+{
+ [SerializeField]
+ private int stateCondition = -1;
+
+ [SerializeField]
+ private Vector3 direction;
+
+ [SerializeField]
+ private float timeSpeed = 1f;
+
+ private Wiggler wiggler;
+
+ private float time;
+
+ private WigglerAnimationState wigglerAnimState;
+
+ private void Start()
+ {
+ wiggler = GetComponent<Wiggler>();
+ wigglerAnimState = wiggler.parentOverride.GetComponentInParent<WigglerAnimationState>();
+ time = Random.Range(0f, 1000f);
+ }
+
+ private void Update()
+ {
+ if (stateCondition == -1)
+ {
+ PerformUpdate();
+ }
+ else if ((bool)wigglerAnimState && wigglerAnimState.animationState == stateCondition)
+ {
+ PerformUpdate();
+ }
+ }
+
+ private void PerformUpdate()
+ {
+ time += Time.deltaTime * timeSpeed;
+ float num = Mathf.Sin(time) * Time.deltaTime;
+ wiggler.velocity += wiggler.parentOverride.rotation * direction * num;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/WigglerAnimationState.cs b/Thronefall_v1.57/Thronefall/Thronefall/WigglerAnimationState.cs
new file mode 100644
index 0000000..90266a7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/WigglerAnimationState.cs
@@ -0,0 +1,6 @@
+using UnityEngine;
+
+public class WigglerAnimationState : MonoBehaviour
+{
+ public int animationState = -1;
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/WigglerVelocity.cs b/Thronefall_v1.57/Thronefall/Thronefall/WigglerVelocity.cs
new file mode 100644
index 0000000..4c9f4a5
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/WigglerVelocity.cs
@@ -0,0 +1,40 @@
+using UnityEngine;
+
+public class WigglerVelocity : MonoBehaviour
+{
+ [SerializeField]
+ private int stateCondition = -1;
+
+ [SerializeField]
+ private Vector3 direction;
+
+ private Wiggler wiggler;
+
+ private float time;
+
+ private WigglerAnimationState wigglerAnimState;
+
+ private void Start()
+ {
+ wiggler = GetComponent<Wiggler>();
+ wigglerAnimState = wiggler.parentOverride.GetComponentInParent<WigglerAnimationState>();
+ time = Random.Range(0f, 1000f);
+ }
+
+ private void Update()
+ {
+ if (stateCondition == -1)
+ {
+ PerformUpdate();
+ }
+ else if ((bool)wigglerAnimState && wigglerAnimState.animationState == stateCondition)
+ {
+ PerformUpdate();
+ }
+ }
+
+ private void PerformUpdate()
+ {
+ wiggler.velocity += wiggler.parentOverride.rotation * direction * Time.deltaTime;
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/WishlistButton.cs b/Thronefall_v1.57/Thronefall/Thronefall/WishlistButton.cs
new file mode 100644
index 0000000..b4492ff
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/WishlistButton.cs
@@ -0,0 +1,9 @@
+using UnityEngine;
+
+public class WishlistButton : MonoBehaviour
+{
+ public void Wishlist()
+ {
+ Application.OpenURL("steam://openurl/https://store.steampowered.com/app/2239150/Thronefall/");
+ }
+}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall/__JobReflectionRegistrationOutput__296523972.cs b/Thronefall_v1.57/Thronefall/Thronefall/__JobReflectionRegistrationOutput__296523972.cs
new file mode 100644
index 0000000..ca8e3d2
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall/__JobReflectionRegistrationOutput__296523972.cs
@@ -0,0 +1,29 @@
+//using System;
+//using NGS.MeshFusionPro;
+//using Unity.Jobs;
+//using UnityEngine;
+
+//[Unity.Jobs.DOTSCompilerGenerated]
+//internal class __JobReflectionRegistrationOutput__296523972
+//{
+// public static void CreateJobReflectionData()
+// {
+// try
+// {
+// IJobParallelForExtensions.EarlyJobInit<JobsMeshMoverLW.MovePartsJob>();
+// IJobExtensions.EarlyJobInit<JobsMeshMoverLW.RecalculateBoundsJob>();
+// IJobParallelForExtensions.EarlyJobInit<JobsMeshMoverSTD.MovePartsJob>();
+// IJobExtensions.EarlyJobInit<JobsMeshMoverSTD.RecalculateBoundsJob>();
+// }
+// catch (Exception ex)
+// {
+// EarlyInitHelpers.JobReflectionDataCreationFailed(ex);
+// }
+// }
+
+// [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
+// public static void EarlyInit()
+// {
+// CreateJobReflectionData();
+// }
+//}
diff --git a/Thronefall_v1.57/Thronefall/Thronefall_1_57.csproj b/Thronefall_v1.57/Thronefall/Thronefall_1_57.csproj
new file mode 100644
index 0000000..1aab2c7
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall_1_57.csproj
@@ -0,0 +1,377 @@
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <AssemblyName>Assembly-CSharp</AssemblyName>
+ <GenerateAssemblyInfo>False</GenerateAssemblyInfo>
+ <TargetFramework>netstandard2.1</TargetFramework>
+ </PropertyGroup>
+ <PropertyGroup>
+ <LangVersion>11.0</LangVersion>
+ <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+ </PropertyGroup>
+ <PropertyGroup />
+ <ItemGroup>
+ <Reference Include="AstarPathfindingProject">
+ <HintPath>..\Game\Thronefall_Data\Managed\AstarPathfindingProject.dll</HintPath>
+ </Reference>
+ <Reference Include="Autodesk.Fbx">
+ <HintPath>..\Game\Thronefall_Data\Managed\Autodesk.Fbx.dll</HintPath>
+ </Reference>
+ <Reference Include="com.rlabrecque.steamworks.net">
+ <HintPath>..\Game\Thronefall_Data\Managed\com.rlabrecque.steamworks.net.dll</HintPath>
+ </Reference>
+ <Reference Include="FbxBuildTestAssets">
+ <HintPath>..\Game\Thronefall_Data\Managed\FbxBuildTestAssets.dll</HintPath>
+ </Reference>
+ <Reference Include="Lofelt.NiceVibrations">
+ <HintPath>..\Game\Thronefall_Data\Managed\Lofelt.NiceVibrations.dll</HintPath>
+ </Reference>
+ <Reference Include="Lofelt.NiceVibrations.Demo">
+ <HintPath>..\Game\Thronefall_Data\Managed\Lofelt.NiceVibrations.Demo.dll</HintPath>
+ </Reference>
+ <Reference Include="Mono.Security">
+ <HintPath>..\Game\Thronefall_Data\Managed\Mono.Security.dll</HintPath>
+ </Reference>
+ <Reference Include="MoreMountains.Feedbacks">
+ <HintPath>..\Game\Thronefall_Data\Managed\MoreMountains.Feedbacks.dll</HintPath>
+ </Reference>
+ <Reference Include="MoreMountains.Feedbacks.Cinemachine">
+ <HintPath>..\Game\Thronefall_Data\Managed\MoreMountains.Feedbacks.Cinemachine.dll</HintPath>
+ </Reference>
+ <Reference Include="MoreMountains.Feedbacks.HDRP">
+ <HintPath>..\Game\Thronefall_Data\Managed\MoreMountains.Feedbacks.HDRP.dll</HintPath>
+ </Reference>
+ <Reference Include="MoreMountains.Feedbacks.MMTools">
+ <HintPath>..\Game\Thronefall_Data\Managed\MoreMountains.Feedbacks.MMTools.dll</HintPath>
+ </Reference>
+ <Reference Include="MoreMountains.Feedbacks.NiceVibrations">
+ <HintPath>..\Game\Thronefall_Data\Managed\MoreMountains.Feedbacks.NiceVibrations.dll</HintPath>
+ </Reference>
+ <Reference Include="MoreMountains.Feedbacks.PostProcessing">
+ <HintPath>..\Game\Thronefall_Data\Managed\MoreMountains.Feedbacks.PostProcessing.dll</HintPath>
+ </Reference>
+ <Reference Include="MoreMountains.Feedbacks.TextMeshPro">
+ <HintPath>..\Game\Thronefall_Data\Managed\MoreMountains.Feedbacks.TextMeshPro.dll</HintPath>
+ </Reference>
+ <Reference Include="MoreMountains.Feedbacks.URP">
+ <HintPath>..\Game\Thronefall_Data\Managed\MoreMountains.Feedbacks.URP.dll</HintPath>
+ </Reference>
+ <Reference Include="MoreMountains.Tools">
+ <HintPath>..\Game\Thronefall_Data\Managed\MoreMountains.Tools.dll</HintPath>
+ </Reference>
+ <Reference Include="MPUIKit">
+ <HintPath>..\Game\Thronefall_Data\Managed\MPUIKit.dll</HintPath>
+ </Reference>
+ <Reference Include="Pathfinding.ClipperLib">
+ <HintPath>..\Game\Thronefall_Data\Managed\Pathfinding.ClipperLib.dll</HintPath>
+ </Reference>
+ <Reference Include="Pathfinding.Ionic.Zip.Reduced">
+ <HintPath>..\Game\Thronefall_Data\Managed\Pathfinding.Ionic.Zip.Reduced.dll</HintPath>
+ </Reference>
+ <Reference Include="Pathfinding.Poly2Tri">
+ <HintPath>..\Game\Thronefall_Data\Managed\Pathfinding.Poly2Tri.dll</HintPath>
+ </Reference>
+ <Reference Include="Rewired_Core">
+ <HintPath>..\Game\Thronefall_Data\Managed\Rewired_Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Rewired_Windows">
+ <HintPath>..\Game\Thronefall_Data\Managed\Rewired_Windows.dll</HintPath>
+ </Reference>
+ <Reference Include="Rewired_Windows_Functions">
+ <HintPath>..\Game\Thronefall_Data\Managed\Rewired_Windows_Functions.dll</HintPath>
+ </Reference>
+ <Reference Include="ShapesRuntime">
+ <HintPath>..\Game\Thronefall_Data\Managed\ShapesRuntime.dll</HintPath>
+ </Reference>
+ <Reference Include="Sirenix.OdinInspector.Attributes">
+ <HintPath>..\Game\Thronefall_Data\Managed\Sirenix.OdinInspector.Attributes.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Configuration">
+ <HintPath>..\Game\Thronefall_Data\Managed\System.Configuration.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <HintPath>..\Game\Thronefall_Data\Managed\System.Data.DataSetExtensions.dll</HintPath>
+ </Reference>
+ <Reference Include="System.EnterpriseServices">
+ <HintPath>..\Game\Thronefall_Data\Managed\System.EnterpriseServices.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Security">
+ <HintPath>..\Game\Thronefall_Data\Managed\System.Security.dll</HintPath>
+ </Reference>
+ <Reference Include="System.ServiceModel.Internals">
+ <HintPath>..\Game\Thronefall_Data\Managed\System.ServiceModel.Internals.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.AI.Navigation">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.AI.Navigation.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.Burst">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.Burst.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.Burst.Unsafe">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.Burst.Unsafe.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.Collections">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.Collections.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.Collections.LowLevel.ILSupport">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.Formats.Fbx.Runtime">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.Formats.Fbx.Runtime.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.Mathematics">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.Mathematics.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.Recorder">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.Recorder.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.Recorder.Base">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.Recorder.Base.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.RenderPipeline.Universal.ShaderLibrary">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.RenderPipelines.Core.Runtime">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.RenderPipelines.Core.ShaderLibrary">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.RenderPipelines.Universal.Config.Runtime">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.RenderPipelines.Universal.Config.Runtime.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.RenderPipelines.Universal.Runtime">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.RenderPipelines.Universal.Shaders">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.TextMeshPro">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.TextMeshPro.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.Timeline">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.Timeline.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.VisualScripting.Antlr3.Runtime">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.VisualScripting.Antlr3.Runtime.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.VisualScripting.Core">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.VisualScripting.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.VisualScripting.Flow">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.VisualScripting.Flow.dll</HintPath>
+ </Reference>
+ <Reference Include="Unity.VisualScripting.State">
+ <HintPath>..\Game\Thronefall_Data\Managed\Unity.VisualScripting.State.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.AccessibilityModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.AccessibilityModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.AIModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.AIModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.AndroidJNIModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.AndroidJNIModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.AnimationModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.AnimationModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.ARModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.ARModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.AssetBundleModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.AssetBundleModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.AudioModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.ClothModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.ClothModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.ClusterInputModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.ClusterInputModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.ClusterRendererModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.ClusterRendererModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.ContentLoadModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.ContentLoadModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.CoreModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.CrashReportingModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.CrashReportingModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.DirectorModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.DirectorModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.DSPGraphModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.DSPGraphModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.GameCenterModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.GameCenterModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.GIModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.GIModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.GridModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.GridModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.HotReloadModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.HotReloadModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.ImageConversionModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.ImageConversionModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.IMGUIModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.InputLegacyModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.InputModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.InputModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.JSONSerializeModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.JSONSerializeModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.LocalizationModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.LocalizationModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.NVIDIAModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.NVIDIAModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.ParticleSystemModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.ParticleSystemModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.PerformanceReportingModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.PerformanceReportingModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.Physics2DModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.Physics2DModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.PhysicsModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.ProfilerModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.ProfilerModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.PropertiesModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.PropertiesModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.ScreenCaptureModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.ScreenCaptureModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.SharedInternalsModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.SharedInternalsModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.SpriteMaskModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.SpriteMaskModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.SpriteShapeModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.SpriteShapeModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.StreamingModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.StreamingModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.SubstanceModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.SubstanceModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.SubsystemsModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.SubsystemsModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.TerrainModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.TerrainModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.TerrainPhysicsModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.TerrainPhysicsModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.TextCoreFontEngineModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.TextCoreFontEngineModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.TextCoreTextEngineModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.TextCoreTextEngineModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.TextRenderingModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.TilemapModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.TilemapModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.TLSModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.TLSModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UI">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.UI.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UIElementsModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.UIElementsModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UIModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.UIModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UmbraModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.UmbraModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UnityAnalyticsCommonModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.UnityAnalyticsCommonModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UnityAnalyticsModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.UnityAnalyticsModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UnityConnectModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.UnityConnectModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UnityCurlModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.UnityCurlModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UnityTestProtocolModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.UnityTestProtocolModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UnityWebRequestAssetBundleModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UnityWebRequestAudioModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UnityWebRequestModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.UnityWebRequestModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UnityWebRequestTextureModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UnityWebRequestWWWModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.VehiclesModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.VehiclesModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.VFXModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.VFXModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.VideoModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.VideoModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.VirtualTexturingModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.VirtualTexturingModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.VRModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.VRModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.WindModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.WindModule.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.XRModule">
+ <HintPath>..\Game\Thronefall_Data\Managed\UnityEngine.XRModule.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/Thronefall_v1.57/Thronefall/Thronefall_1_57.sln b/Thronefall_v1.57/Thronefall/Thronefall_1_57.sln
new file mode 100644
index 0000000..2ce1b8a
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/Thronefall_1_57.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.4.33213.308
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Thronefall_1_57", "Thronefall_1_57.csproj", "{B707595C-25D9-4831-BC78-46B0E2453590}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B707595C-25D9-4831-BC78-46B0E2453590}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B707595C-25D9-4831-BC78-46B0E2453590}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B707595C-25D9-4831-BC78-46B0E2453590}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B707595C-25D9-4831-BC78-46B0E2453590}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {E9BB9617-3E82-4306-A55A-EFD715D9A68B}
+ EndGlobalSection
+EndGlobal
diff --git a/Thronefall_v1.57/Thronefall/UnitySourceGeneratedAssemblyMonoScriptTypes_v1.cs b/Thronefall_v1.57/Thronefall/UnitySourceGeneratedAssemblyMonoScriptTypes_v1.cs
new file mode 100644
index 0000000..ad8c203
--- /dev/null
+++ b/Thronefall_v1.57/Thronefall/UnitySourceGeneratedAssemblyMonoScriptTypes_v1.cs
@@ -0,0 +1,5653 @@
+using System.CodeDom.Compiler;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+
+[CompilerGenerated]
+[EditorBrowsable(EditorBrowsableState.Never)]
+[GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)]
+internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
+{
+ private struct MonoScriptData
+ {
+ public byte[] FilePathsData;
+
+ public byte[] TypesData;
+
+ public int TotalTypes;
+
+ public int TotalFiles;
+
+ public bool IsEditorOnly;
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ private static MonoScriptData Get()
+ {
+ MonoScriptData result = default(MonoScriptData);
+ result.FilePathsData = new byte[35344]
+ {
+ 0, 0, 0, 1, 0, 0, 0, 47, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 65, 100, 100, 105, 116, 105,
+ 111, 110, 97, 108, 87, 101, 97, 112, 111, 110,
+ 69, 102, 102, 101, 99, 116, 83, 99, 114, 105,
+ 112, 116, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 38, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 65,
+ 102, 116, 101, 114, 77, 97, 116, 99, 104, 85,
+ 73, 77, 97, 110, 97, 103, 101, 114, 46, 99,
+ 115, 0, 0, 0, 2, 0, 0, 0, 35, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 65, 105, 109, 98, 111,
+ 116, 80, 114, 111, 106, 101, 99, 116, 105, 108,
+ 101, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 36, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 65, 110,
+ 99, 105, 101, 110, 116, 83, 104, 114, 105, 110,
+ 101, 80, 101, 114, 107, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 40, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 65, 110, 105, 109, 97, 116, 101, 83,
+ 105, 122, 101, 65, 110, 100, 68, 101, 115, 116,
+ 114, 111, 121, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 42, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 65, 110, 105, 109, 97, 116, 105, 111, 110, 92,
+ 66, 111, 97, 116, 65, 110, 105, 109, 97, 116,
+ 105, 111, 110, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 49, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 65, 110, 105, 109, 97, 116, 105, 111, 110, 92,
+ 66, 111, 115, 115, 101, 115, 92, 75, 101, 121,
+ 102, 114, 97, 109, 101, 100, 66, 111, 115, 115,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 44, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 65, 110, 105,
+ 109, 97, 116, 105, 111, 110, 92, 70, 114, 111,
+ 109, 84, 111, 65, 110, 105, 109, 97, 116, 105,
+ 111, 110, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 49, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 65,
+ 110, 105, 109, 97, 116, 105, 111, 110, 92, 79,
+ 110, 101, 83, 104, 111, 116, 65, 110, 105, 109,
+ 97, 116, 105, 111, 110, 66, 97, 115, 101, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 49,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 65, 110, 105, 109,
+ 97, 116, 105, 111, 110, 92, 80, 108, 97, 121,
+ 101, 114, 65, 116, 116, 97, 99, 107, 65, 110,
+ 105, 109, 97, 116, 111, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 52, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 65, 110, 105, 109, 97, 116, 105,
+ 111, 110, 92, 80, 108, 97, 121, 101, 114, 65,
+ 116, 116, 97, 99, 107, 84, 97, 114, 103, 101,
+ 116, 70, 97, 99, 101, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 40, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 65, 110, 105, 109, 97, 116, 105,
+ 111, 110, 92, 80, 108, 97, 121, 101, 114, 83,
+ 99, 101, 112, 116, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 46, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 65, 110, 105, 109, 97, 116, 105, 111, 110,
+ 92, 80, 111, 115, 105, 116, 105, 111, 110, 65,
+ 110, 105, 109, 97, 116, 105, 111, 110, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 66, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 65, 110, 105, 109, 97,
+ 116, 105, 111, 110, 92, 80, 114, 111, 99, 101,
+ 100, 117, 114, 97, 108, 65, 110, 105, 109, 92,
+ 75, 101, 101, 112, 82, 101, 108, 97, 116, 105,
+ 118, 101, 82, 111, 116, 97, 116, 105, 111, 110,
+ 84, 111, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 51, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 65,
+ 110, 105, 109, 97, 116, 105, 111, 110, 92, 80,
+ 114, 111, 99, 101, 100, 117, 114, 97, 108, 65,
+ 110, 105, 109, 92, 87, 105, 103, 103, 108, 101,
+ 114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 67, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 65, 110,
+ 105, 109, 97, 116, 105, 111, 110, 92, 80, 114,
+ 111, 99, 101, 100, 117, 114, 97, 108, 65, 110,
+ 105, 109, 92, 87, 105, 103, 103, 108, 101, 114,
+ 65, 110, 105, 109, 97, 116, 101, 100, 86, 101,
+ 108, 111, 99, 105, 116, 121, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 65, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 65, 110, 105, 109, 97, 116, 105,
+ 111, 110, 92, 80, 114, 111, 99, 101, 100, 117,
+ 114, 97, 108, 65, 110, 105, 109, 92, 87, 105,
+ 103, 103, 108, 101, 114, 65, 110, 105, 109, 97,
+ 116, 105, 111, 110, 83, 116, 97, 116, 101, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 59,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 65, 110, 105, 109,
+ 97, 116, 105, 111, 110, 92, 80, 114, 111, 99,
+ 101, 100, 117, 114, 97, 108, 65, 110, 105, 109,
+ 92, 87, 105, 103, 103, 108, 101, 114, 86, 101,
+ 108, 111, 99, 105, 116, 121, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 52, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 65, 110, 105, 109, 97, 116, 105,
+ 111, 110, 92, 81, 117, 105, 99, 107, 115, 108,
+ 105, 110, 103, 66, 97, 114, 114, 101, 108, 82,
+ 111, 116, 97, 116, 111, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 38, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 65, 110, 105, 109, 97, 116, 105,
+ 111, 110, 92, 82, 97, 99, 101, 114, 82, 111,
+ 108, 108, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 55, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 65,
+ 110, 105, 109, 97, 116, 105, 111, 110, 92, 82,
+ 111, 116, 97, 116, 101, 70, 111, 114, 119, 97,
+ 114, 100, 84, 111, 82, 86, 79, 86, 101, 108,
+ 111, 99, 105, 116, 121, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 43, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 65, 110, 105, 109, 97, 116, 105, 111,
+ 110, 92, 83, 99, 97, 108, 101, 65, 110, 105,
+ 109, 97, 116, 105, 111, 110, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 39, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 65, 110, 105, 109, 97, 116, 105,
+ 111, 110, 92, 83, 99, 97, 108, 101, 80, 117,
+ 108, 115, 101, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 42, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 65, 110, 105, 109, 97, 116, 105, 111, 110, 92,
+ 83, 105, 109, 112, 108, 101, 82, 111, 116, 97,
+ 116, 111, 114, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 39, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 65, 110, 105, 109, 97, 116, 105, 111, 110, 92,
+ 83, 105, 109, 112, 108, 101, 87, 97, 108, 107,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 42, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 65, 110, 105,
+ 109, 97, 116, 105, 111, 110, 92, 83, 112, 105,
+ 110, 65, 110, 105, 109, 97, 116, 105, 111, 110,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 54, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 65, 110, 105,
+ 109, 97, 116, 105, 111, 110, 92, 83, 117, 112,
+ 101, 114, 83, 105, 109, 112, 108, 101, 79, 99,
+ 101, 97, 110, 65, 110, 105, 109, 97, 116, 105,
+ 111, 110, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 47, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 65,
+ 110, 105, 109, 97, 116, 105, 111, 110, 92, 85,
+ 110, 105, 116, 65, 116, 116, 97, 99, 107, 65,
+ 110, 105, 109, 97, 116, 111, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 55, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 65, 110, 105, 109, 97, 116,
+ 105, 111, 110, 92, 85, 110, 105, 116, 67, 111,
+ 109, 109, 97, 110, 100, 82, 97, 100, 105, 117,
+ 115, 65, 110, 105, 109, 97, 116, 105, 111, 110,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 44, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 65, 110, 105,
+ 109, 97, 116, 105, 111, 110, 92, 85, 110, 105,
+ 116, 83, 112, 97, 119, 110, 65, 112, 112, 101,
+ 97, 114, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 37, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 65,
+ 112, 112, 108, 121, 72, 101, 114, 111, 85, 110,
+ 105, 116, 80, 101, 114, 107, 115, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 43, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 65, 117, 100, 105, 111, 92,
+ 65, 117, 100, 105, 111, 68, 97, 121, 78, 105,
+ 103, 104, 116, 70, 97, 100, 101, 114, 46, 99,
+ 115, 0, 0, 0, 2, 0, 0, 0, 33, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 65, 117, 100, 105, 111,
+ 92, 65, 117, 100, 105, 111, 83, 101, 116, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 44,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 65, 117, 100, 105,
+ 111, 92, 71, 108, 111, 98, 97, 108, 65, 117,
+ 100, 105, 111, 76, 105, 115, 116, 101, 110, 101,
+ 114, 46, 99, 115, 0, 0, 0, 2, 0, 0,
+ 0, 35, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 65, 117,
+ 100, 105, 111, 92, 76, 101, 118, 101, 108, 65,
+ 117, 100, 105, 111, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 44, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 65, 117, 100, 105, 111, 92, 79, 110, 101,
+ 83, 104, 111, 116, 65, 117, 100, 105, 111, 84,
+ 114, 105, 103, 103, 101, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 45, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 65, 117, 100, 105, 111, 92, 80,
+ 108, 97, 121, 101, 114, 67, 104, 97, 114, 97,
+ 99, 116, 101, 114, 65, 117, 100, 105, 111, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 42,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 65, 117, 100, 105,
+ 111, 92, 80, 108, 97, 121, 101, 114, 87, 101,
+ 97, 112, 111, 110, 65, 117, 100, 105, 111, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 48,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 65, 117, 100, 105,
+ 111, 92, 80, 108, 97, 121, 79, 110, 101, 83,
+ 104, 111, 116, 65, 102, 116, 101, 114, 83, 101,
+ 99, 111, 110, 100, 115, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 40, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 65, 117, 100, 105, 111, 92, 80, 114,
+ 111, 106, 101, 99, 116, 105, 108, 101, 65, 117,
+ 100, 105, 111, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 45, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 65, 117, 100, 105, 111, 92, 80, 114, 111, 106,
+ 101, 99, 116, 105, 108, 101, 83, 112, 97, 119,
+ 110, 65, 117, 100, 105, 111, 46, 99, 115, 0,
+ 0, 0, 2, 0, 0, 0, 47, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 65, 117, 100, 105, 111, 92, 84,
+ 104, 114, 111, 110, 101, 102, 97, 108, 108, 65,
+ 117, 100, 105, 111, 77, 97, 110, 97, 103, 101,
+ 114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 34, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 65, 117,
+ 100, 105, 111, 92, 85, 110, 105, 116, 65, 117,
+ 100, 105, 111, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 29, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 65, 117, 116, 111, 65, 116, 116, 97, 99, 107,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 42, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 65, 117, 116,
+ 111, 65, 116, 116, 97, 99, 107, 72, 105, 103,
+ 104, 101, 115, 116, 72, 101, 97, 108, 116, 104,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 41, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 65, 117, 116,
+ 111, 65, 116, 116, 97, 99, 107, 76, 111, 119,
+ 101, 115, 116, 72, 101, 97, 108, 116, 104, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 47,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 65, 117, 116, 111,
+ 65, 116, 116, 97, 99, 107, 76, 111, 119, 101,
+ 115, 116, 73, 110, 82, 97, 110, 103, 101, 77,
+ 117, 108, 116, 105, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 35, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 65, 117, 116, 111, 65, 116, 116, 97, 99,
+ 107, 82, 97, 110, 100, 111, 109, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 34, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 65, 117, 116, 111, 65, 116,
+ 116, 97, 99, 107, 84, 111, 119, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 39,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 65, 117, 116, 111,
+ 65, 116, 116, 97, 99, 107, 84, 119, 111, 84,
+ 97, 114, 103, 101, 116, 115, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 40, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 65, 117, 116, 111, 65, 116, 116,
+ 97, 99, 107, 87, 105, 116, 104, 87, 97, 114,
+ 110, 105, 110, 103, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 31, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 65, 117, 116, 111, 68, 97, 121, 78, 105,
+ 103, 104, 116, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 29, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 65, 117, 116, 111, 82, 101, 118, 105, 118, 101,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 45, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 65, 117, 116,
+ 111, 85, 112, 103, 114, 97, 100, 101, 66, 117,
+ 105, 108, 100, 105, 110, 103, 79, 110, 83, 116,
+ 97, 114, 116, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 38, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 66, 97, 99, 107, 117, 112, 65, 117, 100, 105,
+ 111, 76, 105, 115, 116, 101, 110, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 47,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 66, 97, 108, 97,
+ 110, 99, 105, 110, 103, 92, 66, 97, 108, 97,
+ 110, 99, 105, 110, 103, 80, 97, 114, 97, 109,
+ 101, 116, 101, 114, 46, 99, 115, 0, 0, 0,
+ 2, 0, 0, 0, 48, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 66, 97, 108, 97, 110, 99, 105, 110, 103,
+ 92, 66, 97, 108, 97, 110, 99, 105, 110, 103,
+ 80, 97, 114, 97, 109, 101, 116, 101, 114, 115,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 34, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 66, 97, 114,
+ 114, 105, 99, 97, 100, 101, 68, 97, 109, 97,
+ 103, 101, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 33, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 66,
+ 105, 108, 108, 98, 111, 97, 114, 100, 65, 108,
+ 105, 103, 110, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 36, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 66, 108, 97, 99, 107, 115, 109, 105, 116, 104,
+ 85, 112, 103, 114, 97, 100, 101, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 35, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 66, 108, 111, 99, 107, 80,
+ 114, 111, 106, 101, 99, 116, 105, 108, 101, 115,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 45, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 66, 117, 105,
+ 108, 100, 105, 110, 103, 68, 101, 115, 116, 114,
+ 117, 99, 116, 105, 111, 110, 72, 97, 110, 100,
+ 108, 101, 114, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 38, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 66, 117, 105, 108, 100, 105, 110, 103, 70, 88,
+ 80, 114, 111, 99, 101, 115, 115, 111, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 40,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 66, 117, 105, 108,
+ 100, 105, 110, 103, 77, 101, 115, 104, 101, 115,
+ 84, 114, 97, 99, 107, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 38, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 66, 117, 105, 108, 100, 105,
+ 110, 103, 77, 101, 115, 104, 84, 114, 97, 99,
+ 107, 101, 114, 46, 99, 115, 0, 0, 0, 3,
+ 0, 0, 0, 28, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 66, 117, 105, 108, 100, 83, 108, 111, 116, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 31,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 67, 97, 109, 101,
+ 114, 97, 66, 111, 117, 110, 100, 115, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 35, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 67, 97, 109, 101, 114,
+ 97, 67, 111, 110, 116, 114, 111, 108, 108, 101,
+ 114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 28, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 67, 97,
+ 109, 101, 114, 97, 82, 105, 103, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 23, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 67, 111, 105, 110, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 30, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 67, 111, 105, 110, 83,
+ 112, 97, 119, 110, 101, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 56, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 67, 111, 108, 111, 114, 32, 77,
+ 97, 110, 97, 103, 101, 109, 101, 110, 116, 92,
+ 67, 111, 108, 111, 114, 65, 110, 100, 76, 105,
+ 103, 104, 116, 77, 97, 110, 97, 103, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 47, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 67, 111, 108,
+ 111, 114, 32, 77, 97, 110, 97, 103, 101, 109,
+ 101, 110, 116, 92, 67, 111, 108, 111, 114, 115,
+ 99, 104, 101, 109, 101, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 57, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 67, 111, 108, 111, 114, 32, 77, 97,
+ 110, 97, 103, 101, 109, 101, 110, 116, 92, 68,
+ 97, 121, 116, 105, 109, 101, 83, 101, 110, 115,
+ 105, 116, 105, 118, 101, 76, 105, 103, 104, 116,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 30, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 67, 117, 114,
+ 115, 101, 69, 102, 102, 101, 99, 116, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 33, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 68, 97, 109, 97, 103,
+ 101, 77, 111, 100, 105, 102, 121, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 48,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 68, 97, 109, 97,
+ 103, 101, 80, 108, 97, 121, 101, 114, 87, 104,
+ 101, 110, 69, 110, 116, 101, 114, 105, 110, 103,
+ 82, 97, 110, 103, 101, 46, 99, 115, 0, 0,
+ 0, 2, 0, 0, 0, 32, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 68, 97, 121, 78, 105, 103, 104, 116,
+ 67, 121, 99, 108, 101, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 45, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 68, 97, 121, 116, 105, 109, 101, 83,
+ 101, 110, 115, 105, 116, 105, 118, 101, 65, 99,
+ 116, 105, 118, 97, 116, 105, 111, 110, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 39, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 68, 101, 98, 117, 103,
+ 92, 68, 97, 121, 116, 105, 109, 101, 68, 105,
+ 115, 112, 108, 97, 121, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 47, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 68, 101, 98, 117, 103, 92, 68, 101,
+ 98, 117, 103, 66, 117, 105, 108, 100, 105, 110,
+ 103, 68, 101, 115, 116, 114, 111, 121, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 41, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 68, 101, 98,
+ 117, 103, 92, 68, 101, 98, 117, 103, 67, 111,
+ 105, 110, 68, 105, 115, 112, 108, 97, 121, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 40,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 68, 101, 98, 117,
+ 103, 92, 68, 101, 98, 117, 103, 67, 111, 110,
+ 116, 114, 111, 108, 108, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 31, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 68, 101, 115, 116, 114, 111,
+ 121, 65, 102, 116, 101, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 43, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 68, 101, 115, 116, 114, 111, 121,
+ 79, 114, 68, 105, 115, 97, 98, 108, 101, 79,
+ 110, 69, 110, 97, 98, 108, 101, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 33, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 68, 105, 115, 97, 98, 108,
+ 101, 79, 110, 83, 116, 97, 114, 116, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 30, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 69, 108, 105, 116, 101,
+ 84, 111, 119, 101, 114, 115, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 36, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 69, 110, 97, 98, 108, 101, 65,
+ 108, 108, 67, 104, 105, 108, 100, 114, 101, 110,
+ 46, 99, 115, 0, 0, 0, 5, 0, 0, 0,
+ 31, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 69, 110, 101,
+ 109, 121, 83, 112, 97, 119, 110, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 68,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 69, 116, 101, 114,
+ 110, 97, 108, 32, 84, 114, 105, 97, 108, 115,
+ 92, 69, 99, 111, 110, 111, 109, 121, 32, 83,
+ 105, 109, 117, 108, 97, 116, 111, 114, 92, 69,
+ 99, 111, 110, 111, 109, 121, 83, 105, 109, 117,
+ 108, 97, 116, 111, 114, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 67, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 69, 116, 101, 114, 110, 97, 108, 32,
+ 84, 114, 105, 97, 108, 115, 92, 69, 99, 111,
+ 110, 111, 109, 121, 32, 83, 105, 109, 117, 108,
+ 97, 116, 111, 114, 92, 86, 105, 114, 116, 117,
+ 97, 108, 66, 117, 105, 108, 100, 105, 110, 103,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 48, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 69, 116, 101,
+ 114, 110, 97, 108, 32, 84, 114, 105, 97, 108,
+ 115, 92, 69, 110, 101, 109, 121, 83, 112, 97,
+ 119, 110, 76, 105, 110, 101, 46, 99, 115, 0,
+ 0, 0, 2, 0, 0, 0, 54, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 69, 116, 101, 114, 110, 97, 108,
+ 32, 84, 114, 105, 97, 108, 115, 92, 69, 116,
+ 101, 114, 110, 97, 108, 84, 114, 105, 97, 108,
+ 69, 110, 101, 109, 121, 83, 101, 116, 46, 99,
+ 115, 0, 0, 0, 4, 0, 0, 0, 57, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 69, 116, 101, 114, 110,
+ 97, 108, 32, 84, 114, 105, 97, 108, 115, 92,
+ 69, 116, 101, 114, 110, 97, 108, 84, 114, 105,
+ 97, 108, 115, 82, 117, 110, 77, 97, 110, 97,
+ 103, 101, 114, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 54, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 69, 116, 101, 114, 110, 97, 108, 32, 84, 114,
+ 105, 97, 108, 115, 92, 69, 116, 101, 114, 110,
+ 97, 108, 87, 97, 118, 101, 71, 101, 110, 101,
+ 114, 97, 116, 111, 114, 46, 99, 115, 0, 0,
+ 0, 2, 0, 0, 0, 68, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 69, 116, 101, 114, 110, 97, 108, 32,
+ 84, 114, 105, 97, 108, 115, 92, 87, 97, 118,
+ 101, 32, 71, 101, 110, 101, 114, 97, 116, 111,
+ 114, 115, 92, 80, 97, 117, 108, 115, 87, 97,
+ 118, 101, 71, 101, 110, 101, 114, 97, 116, 111,
+ 114, 46, 99, 115, 0, 0, 0, 2, 0, 0,
+ 0, 66, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 69, 116,
+ 101, 114, 110, 97, 108, 32, 84, 114, 105, 97,
+ 108, 115, 92, 87, 97, 118, 101, 32, 71, 101,
+ 110, 101, 114, 97, 116, 111, 114, 115, 92, 83,
+ 101, 97, 115, 111, 110, 84, 119, 111, 87, 97,
+ 118, 101, 71, 101, 110, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 62, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 69, 116, 101, 114, 110, 97, 108, 32,
+ 84, 114, 105, 97, 108, 115, 92, 87, 97, 118,
+ 101, 32, 71, 101, 110, 101, 114, 97, 116, 111,
+ 114, 115, 92, 83, 117, 112, 101, 114, 87, 97,
+ 118, 101, 71, 101, 110, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 48, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 69, 116, 101, 114, 110, 97, 108, 32,
+ 84, 114, 105, 97, 108, 115, 92, 87, 97, 118,
+ 101, 71, 101, 110, 85, 116, 105, 108, 105, 116,
+ 121, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 30, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 70, 97,
+ 107, 101, 67, 104, 105, 108, 100, 84, 111, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 33,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 70, 105, 114, 101,
+ 65, 114, 99, 104, 101, 114, 66, 117, 114, 110,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 33, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 70, 105, 115,
+ 104, 105, 110, 103, 72, 97, 114, 98, 111, 117,
+ 114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 40, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 70, 105,
+ 115, 104, 105, 110, 103, 72, 97, 114, 98, 111,
+ 117, 114, 85, 112, 103, 114, 97, 100, 101, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 34,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 70, 111, 108, 108,
+ 111, 119, 84, 114, 97, 110, 115, 102, 111, 114,
+ 109, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 41, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 70, 111,
+ 114, 99, 101, 67, 97, 109, 101, 114, 97, 80,
+ 111, 115, 79, 110, 69, 110, 97, 98, 108, 101,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 41, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 70, 114, 101,
+ 101, 122, 101, 80, 111, 115, 105, 116, 105, 111,
+ 110, 79, 110, 69, 110, 97, 98, 108, 101, 46,
+ 99, 115, 0, 0, 0, 2, 0, 0, 0, 39,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 70, 88, 92, 77,
+ 97, 116, 101, 114, 105, 97, 108, 70, 108, 97,
+ 115, 104, 101, 114, 70, 88, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 45, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 70, 88, 92, 79, 110, 68, 97,
+ 109, 97, 103, 101, 70, 101, 101, 100, 98, 97,
+ 99, 107, 72, 97, 110, 100, 108, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 37,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 70, 88, 92, 83,
+ 104, 97, 112, 101, 71, 114, 111, 117, 112, 70,
+ 97, 100, 101, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 54, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 70, 88, 92, 85, 110, 112, 97, 114, 101,
+ 110, 116, 65, 110, 100, 68, 101, 115, 116, 114,
+ 111, 121, 68, 101, 108, 97, 121, 101, 100, 79,
+ 110, 68, 101, 97, 116, 104, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 29, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 71, 97, 116, 101, 79, 112, 101,
+ 110, 101, 114, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 32, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 71, 108, 111, 98, 97, 108, 72, 101, 97, 108,
+ 105, 110, 103, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 28, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 72, 101, 97, 108, 116, 104, 98, 97, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 33,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 72, 101, 97, 108,
+ 116, 104, 98, 97, 114, 77, 117, 108, 116, 105,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 42, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 72, 101, 97,
+ 108, 116, 104, 83, 116, 101, 97, 108, 87, 101,
+ 97, 112, 111, 110, 69, 102, 102, 101, 99, 116,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 30, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 72, 111, 116,
+ 79, 105, 108, 84, 111, 119, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 21, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 72, 112, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 33, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 73, 110, 99, 111, 109, 101,
+ 77, 111, 100, 105, 102, 121, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 46, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 73, 110, 99, 114, 101,
+ 97, 115, 101, 65, 116, 116, 97, 99, 107, 83,
+ 112, 101, 101, 100, 79, 118, 101, 114, 84, 105,
+ 109, 101, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 38, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 73,
+ 110, 99, 114, 101, 97, 115, 101, 73, 110, 99,
+ 111, 109, 101, 68, 97, 105, 108, 121, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 31, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 73, 110, 118, 117, 108,
+ 110, 101, 114, 97, 98, 108, 101, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 39, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 76, 97, 117, 110, 99, 104,
+ 97, 98, 108, 101, 80, 114, 111, 106, 101, 99,
+ 116, 105, 108, 101, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 55, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 76, 101, 118, 101, 108, 32, 83, 101, 108,
+ 101, 99, 116, 92, 69, 116, 101, 114, 110, 97,
+ 108, 84, 114, 105, 97, 108, 115, 73, 110, 116,
+ 101, 114, 97, 99, 116, 111, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 47, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 76, 101, 118, 101, 108, 32,
+ 83, 101, 108, 101, 99, 116, 92, 76, 101, 118,
+ 101, 108, 73, 110, 116, 101, 114, 97, 99, 116,
+ 111, 114, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 50, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 76,
+ 101, 118, 101, 108, 32, 83, 101, 108, 101, 99,
+ 116, 92, 76, 101, 118, 101, 108, 83, 101, 108,
+ 101, 99, 116, 77, 97, 110, 97, 103, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 50, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 76, 101, 118,
+ 101, 108, 32, 83, 101, 108, 101, 99, 116, 92,
+ 80, 101, 114, 107, 83, 101, 108, 101, 99, 116,
+ 105, 111, 110, 71, 114, 111, 117, 112, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 49, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 76, 101, 118, 101, 108,
+ 32, 83, 101, 108, 101, 99, 116, 92, 80, 101,
+ 114, 107, 83, 101, 108, 101, 99, 116, 105, 111,
+ 110, 73, 116, 101, 109, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 47, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 76, 101, 118, 101, 108, 32, 83, 101,
+ 108, 101, 99, 116, 92, 80, 108, 97, 121, 76,
+ 101, 118, 101, 108, 66, 117, 116, 116, 111, 110,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 30, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 76, 101, 118,
+ 101, 108, 66, 111, 114, 100, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 28, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 76, 101, 118, 101, 108,
+ 73, 110, 102, 111, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 35, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 76, 105, 103, 104, 116, 110, 105, 110, 103,
+ 83, 116, 114, 105, 107, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 33, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 76, 105, 109, 105, 116, 68,
+ 101, 108, 116, 97, 84, 105, 109, 101, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 34, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 76, 105, 109, 105, 116,
+ 101, 100, 76, 105, 102, 101, 116, 105, 109, 101,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 33, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 76, 111, 97,
+ 100, 83, 99, 101, 110, 101, 79, 110, 84, 111,
+ 112, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 33, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 76, 111,
+ 99, 97, 108, 71, 97, 109, 101, 115, 116, 97,
+ 116, 101, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 46, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 77,
+ 97, 110, 97, 103, 101, 114, 115, 92, 65, 99,
+ 104, 105, 101, 118, 101, 109, 101, 110, 116, 77,
+ 97, 110, 97, 103, 101, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 46, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 77, 97, 110, 97, 103, 101, 114,
+ 115, 92, 66, 108, 97, 99, 107, 115, 109, 105,
+ 116, 104, 85, 112, 103, 114, 97, 100, 101, 115,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 49, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 77, 97, 110,
+ 97, 103, 101, 114, 115, 92, 67, 97, 110, 99,
+ 101, 108, 79, 114, 79, 112, 101, 110, 80, 97,
+ 117, 115, 101, 77, 101, 110, 117, 46, 99, 115,
+ 0, 0, 0, 2, 0, 0, 0, 41, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 77, 97, 110, 97, 103, 101,
+ 114, 115, 92, 67, 104, 111, 105, 99, 101, 77,
+ 97, 110, 97, 103, 101, 114, 46, 99, 115, 0,
+ 0, 0, 3, 0, 0, 0, 49, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 77, 97, 110, 97, 103, 101, 114,
+ 115, 92, 67, 111, 110, 116, 114, 111, 108, 67,
+ 111, 110, 102, 105, 103, 83, 97, 118, 101, 76,
+ 111, 97, 100, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 45, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 77, 97, 110, 97, 103, 101, 114, 115, 92, 69,
+ 110, 101, 109, 121, 83, 112, 97, 119, 110, 77,
+ 97, 110, 97, 103, 101, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 40, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 77, 97, 110, 97, 103, 101, 114,
+ 115, 92, 71, 80, 85, 73, 110, 115, 116, 97,
+ 110, 99, 101, 100, 46, 99, 115, 0, 0, 0,
+ 3, 0, 0, 0, 48, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 77, 97, 110, 97, 103, 101, 114, 115, 92,
+ 71, 80, 85, 73, 110, 115, 116, 97, 110, 99,
+ 105, 110, 103, 77, 97, 110, 97, 103, 101, 114,
+ 46, 99, 115, 0, 0, 0, 4, 0, 0, 0,
+ 48, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 77, 97, 110,
+ 97, 103, 101, 114, 115, 92, 76, 101, 118, 101,
+ 108, 80, 114, 111, 103, 114, 101, 115, 115, 77,
+ 97, 110, 97, 103, 101, 114, 46, 99, 115, 0,
+ 0, 0, 2, 0, 0, 0, 40, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 77, 97, 110, 97, 103, 101, 114,
+ 115, 92, 77, 117, 115, 105, 99, 77, 97, 110,
+ 97, 103, 101, 114, 46, 99, 115, 0, 0, 0,
+ 2, 0, 0, 0, 39, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 77, 97, 110, 97, 103, 101, 114, 115, 92,
+ 80, 101, 114, 107, 77, 97, 110, 97, 103, 101,
+ 114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 46, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 77, 97,
+ 110, 97, 103, 101, 114, 115, 92, 82, 111, 121,
+ 97, 108, 70, 111, 114, 103, 101, 85, 112, 103,
+ 114, 97, 100, 101, 115, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 43, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 77, 97, 110, 97, 103, 101, 114, 115,
+ 92, 83, 97, 118, 101, 76, 111, 97, 100, 77,
+ 97, 110, 97, 103, 101, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 50, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 77, 97, 110, 97, 103, 101, 114,
+ 115, 92, 83, 99, 101, 110, 101, 84, 114, 97,
+ 110, 115, 105, 116, 105, 111, 110, 77, 97, 110,
+ 97, 103, 101, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 42, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 77, 97, 110, 97, 103, 101, 114, 115, 92,
+ 84, 101, 120, 116, 84, 114, 97, 110, 115, 108,
+ 97, 116, 111, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 44, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 77, 97, 110, 117, 97, 108, 65, 116, 116,
+ 97, 99, 107, 92, 67, 117, 114, 115, 101, 66,
+ 108, 97, 115, 116, 77, 65, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 43, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 77, 97, 110, 117, 97, 108, 65,
+ 116, 116, 97, 99, 107, 92, 72, 101, 97, 108,
+ 66, 111, 111, 115, 116, 77, 65, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 47, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 77, 97, 110, 117, 97, 108,
+ 65, 116, 116, 97, 99, 107, 92, 76, 105, 103,
+ 104, 116, 110, 105, 110, 103, 87, 97, 110, 100,
+ 77, 65, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 44, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 77,
+ 97, 110, 117, 97, 108, 65, 116, 116, 97, 99,
+ 107, 92, 77, 97, 110, 117, 97, 108, 65, 116,
+ 116, 97, 99, 107, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 48, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 77, 97, 110, 117, 97, 108, 65, 116, 116,
+ 97, 99, 107, 92, 83, 112, 97, 119, 110, 65,
+ 116, 116, 97, 99, 107, 65, 102, 116, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 39, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 77, 97, 110,
+ 117, 97, 108, 65, 116, 116, 97, 99, 107, 92,
+ 83, 112, 97, 119, 110, 77, 65, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 38, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 77, 97, 110, 117, 97, 108,
+ 65, 116, 116, 97, 99, 107, 92, 83, 116, 97,
+ 98, 77, 65, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 34, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 77, 97, 112, 65, 99, 104, 105, 101, 118, 101,
+ 109, 101, 110, 116, 115, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 28, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 77, 105, 108, 108, 82, 111, 116, 111,
+ 114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 36, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 77, 105,
+ 108, 108, 95, 73, 109, 112, 114, 111, 118, 101,
+ 100, 80, 108, 111, 119, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 48, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 77, 105, 108, 108, 95, 73, 109, 112,
+ 114, 111, 118, 101, 109, 101, 110, 116, 69, 120,
+ 112, 108, 111, 115, 105, 118, 101, 84, 114, 97,
+ 112, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 46, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 77, 105,
+ 108, 108, 95, 73, 109, 112, 114, 111, 118, 101,
+ 109, 101, 110, 116, 87, 105, 110, 100, 83, 112,
+ 105, 114, 105, 116, 115, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 46, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 77, 105, 108, 108, 95, 73, 109, 112,
+ 114, 111, 118, 101, 109, 101, 110, 116, 95, 83,
+ 99, 97, 114, 101, 99, 114, 111, 119, 115, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 28,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 77, 105, 110, 101,
+ 83, 104, 97, 102, 116, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 26, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 77, 111, 108, 101, 109, 97, 110, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 36,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 78, 97, 118, 109,
+ 101, 115, 104, 66, 97, 107, 101, 72, 101, 108,
+ 112, 101, 114, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 28, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 78, 105, 103, 104, 116, 104, 111, 114, 110, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 29,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 78, 105, 103, 104,
+ 116, 76, 105, 103, 104, 116, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 48, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 80, 97, 116, 104, 102, 105, 110,
+ 100, 77, 111, 118, 101, 109, 101, 110, 116, 92,
+ 67, 111, 109, 109, 97, 110, 100, 85, 110, 105,
+ 116, 115, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 52, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 80,
+ 97, 116, 104, 102, 105, 110, 100, 77, 111, 118,
+ 101, 109, 101, 110, 116, 92, 80, 97, 116, 104,
+ 102, 105, 110, 100, 77, 111, 118, 101, 109, 101,
+ 110, 116, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 57, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 80,
+ 97, 116, 104, 102, 105, 110, 100, 77, 111, 118,
+ 101, 109, 101, 110, 116, 92, 80, 97, 116, 104,
+ 102, 105, 110, 100, 77, 111, 118, 101, 109, 101,
+ 110, 116, 69, 110, 101, 109, 121, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 62, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 80, 97, 116, 104, 102, 105,
+ 110, 100, 77, 111, 118, 101, 109, 101, 110, 116,
+ 92, 80, 97, 116, 104, 102, 105, 110, 100, 77,
+ 111, 118, 101, 109, 101, 110, 116, 80, 108, 97,
+ 121, 101, 114, 117, 110, 105, 116, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 63, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 80, 101, 114, 105, 111, 100,
+ 105, 99, 97, 108, 108, 121, 69, 110, 97, 98,
+ 108, 101, 65, 110, 100, 68, 105, 115, 97, 98,
+ 108, 101, 68, 117, 114, 105, 110, 103, 69, 110,
+ 101, 109, 121, 83, 112, 97, 119, 110, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 41, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 80, 101, 114, 107, 32,
+ 83, 121, 115, 116, 101, 109, 92, 69, 113, 117,
+ 105, 112, 112, 97, 98, 108, 101, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 56, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 80, 101, 114, 107, 32, 83,
+ 121, 115, 116, 101, 109, 92, 69, 113, 117, 105,
+ 112, 112, 97, 98, 108, 101, 66, 117, 105, 108,
+ 100, 105, 110, 103, 85, 112, 103, 114, 97, 100,
+ 101, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 49, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 80, 101,
+ 114, 107, 32, 83, 121, 115, 116, 101, 109, 92,
+ 69, 113, 117, 105, 112, 112, 97, 98, 108, 101,
+ 77, 117, 116, 97, 116, 105, 111, 110, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 45, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 80, 101, 114, 107, 32,
+ 83, 121, 115, 116, 101, 109, 92, 69, 113, 117,
+ 105, 112, 112, 97, 98, 108, 101, 80, 101, 114,
+ 107, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 47, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 80, 101,
+ 114, 107, 32, 83, 121, 115, 116, 101, 109, 92,
+ 69, 113, 117, 105, 112, 112, 97, 98, 108, 101,
+ 87, 101, 97, 112, 111, 110, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 40, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 80, 101, 114, 107, 32, 83, 121,
+ 115, 116, 101, 109, 92, 80, 101, 114, 107, 80,
+ 111, 105, 110, 116, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 39, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 80, 101, 114, 107, 67, 111, 111, 108, 100,
+ 111, 119, 110, 77, 111, 100, 105, 102, 121, 101,
+ 114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 35, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 80, 101,
+ 114, 107, 67, 111, 115, 116, 77, 111, 100, 105,
+ 102, 121, 101, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 47, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 80, 101, 114, 107, 68, 97, 109, 97, 103,
+ 101, 65, 117, 116, 111, 65, 116, 116, 97, 99,
+ 107, 77, 111, 100, 105, 102, 121, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 51,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 80, 101, 114, 107,
+ 68, 97, 109, 97, 103, 101, 77, 111, 100, 105,
+ 102, 121, 101, 114, 80, 108, 97, 121, 101, 114,
+ 117, 110, 105, 116, 65, 117, 116, 111, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 48, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 80, 101, 114, 107, 68,
+ 101, 115, 116, 114, 111, 121, 71, 97, 109, 101,
+ 79, 98, 106, 101, 99, 116, 77, 111, 100, 105,
+ 102, 121, 101, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 33, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 80, 101, 114, 107, 72, 112, 77, 111, 100,
+ 105, 102, 121, 101, 114, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 37, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 80, 101, 114, 107, 73, 110, 99, 111,
+ 109, 101, 77, 111, 100, 105, 102, 121, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 37, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 80, 101, 114,
+ 107, 73, 110, 100, 101, 115, 116, 114, 117, 99,
+ 116, 105, 98, 108, 101, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 40, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 80, 101, 114, 107, 80, 108, 97, 121,
+ 101, 114, 72, 101, 97, 108, 116, 104, 82, 101,
+ 103, 101, 110, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 36, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 80, 101, 114, 107, 82, 97, 110, 103, 101, 77,
+ 111, 100, 105, 102, 121, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 36, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 80, 101, 114, 107, 83, 112,
+ 101, 101, 100, 77, 111, 100, 105, 102, 121, 101,
+ 114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 37, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 80, 101,
+ 114, 107, 87, 101, 97, 112, 111, 110, 77, 111,
+ 100, 105, 102, 121, 101, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 31, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 80, 108, 97, 121, 101, 114, 65,
+ 116, 116, 97, 99, 107, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 37, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 80, 108, 97, 121, 101, 114, 66, 97,
+ 108, 108, 77, 111, 118, 101, 109, 101, 110, 116,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 32, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 80, 108, 97,
+ 121, 101, 114, 72, 112, 82, 101, 103, 101, 110,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 57, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 80, 108, 97,
+ 121, 101, 114, 73, 110, 116, 101, 114, 97, 99,
+ 116, 97, 98, 108, 101, 115, 92, 66, 117, 105,
+ 108, 100, 105, 110, 103, 73, 110, 116, 101, 114,
+ 97, 99, 116, 111, 114, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 53, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 80, 108, 97, 121, 101, 114, 73, 110,
+ 116, 101, 114, 97, 99, 116, 97, 98, 108, 101,
+ 115, 92, 73, 110, 116, 101, 114, 97, 99, 116,
+ 111, 114, 66, 97, 115, 101, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 75, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 80, 108, 97, 121, 101, 114, 73,
+ 110, 116, 101, 114, 97, 99, 116, 97, 98, 108,
+ 101, 115, 92, 76, 97, 117, 110, 99, 104, 97,
+ 98, 108, 101, 68, 101, 102, 101, 110, 115, 101,
+ 77, 101, 99, 104, 97, 110, 105, 115, 109, 73,
+ 110, 116, 101, 114, 97, 99, 116, 111, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 56,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 80, 108, 97, 121,
+ 101, 114, 73, 110, 116, 101, 114, 97, 99, 116,
+ 97, 98, 108, 101, 115, 92, 80, 108, 97, 121,
+ 101, 114, 73, 110, 116, 101, 114, 97, 99, 116,
+ 105, 111, 110, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 32, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 80, 108, 97, 121, 101, 114, 77, 97, 110, 97,
+ 103, 101, 114, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 33, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 80, 108, 97, 121, 101, 114, 77, 111, 118, 101,
+ 109, 101, 110, 116, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 57, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 80, 108, 97, 121, 101, 114, 85, 112, 103,
+ 114, 97, 100, 101, 92, 85, 112, 103, 114, 97,
+ 100, 101, 65, 115, 115, 97, 115, 115, 105, 110,
+ 115, 84, 114, 97, 105, 110, 105, 110, 103, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 53,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 80, 108, 97, 121,
+ 101, 114, 85, 112, 103, 114, 97, 100, 101, 92,
+ 85, 112, 103, 114, 97, 100, 101, 66, 117, 105,
+ 108, 100, 101, 114, 115, 71, 117, 105, 108, 100,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 48, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 80, 108, 97,
+ 121, 101, 114, 85, 112, 103, 114, 97, 100, 101,
+ 92, 85, 112, 103, 114, 97, 100, 101, 67, 97,
+ 115, 116, 108, 101, 85, 112, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 49, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 80, 108, 97, 121, 101, 114, 85,
+ 112, 103, 114, 97, 100, 101, 92, 85, 112, 103,
+ 114, 97, 100, 101, 67, 111, 109, 109, 97, 110,
+ 100, 101, 114, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 50, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 80, 108, 97, 121, 101, 114, 85, 112, 103, 114,
+ 97, 100, 101, 92, 85, 112, 103, 114, 97, 100,
+ 101, 71, 111, 100, 108, 121, 67, 117, 114, 115,
+ 101, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 50, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 80, 108,
+ 97, 121, 101, 114, 85, 112, 103, 114, 97, 100,
+ 101, 92, 85, 112, 103, 114, 97, 100, 101, 77,
+ 97, 103, 105, 99, 65, 114, 109, 111, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 49,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 80, 108, 97, 121,
+ 101, 114, 85, 112, 103, 114, 97, 100, 101, 92,
+ 85, 112, 103, 114, 97, 100, 101, 80, 108, 97,
+ 121, 101, 114, 68, 109, 103, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 48, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 80, 108, 97, 121, 101, 114, 85,
+ 112, 103, 114, 97, 100, 101, 92, 85, 112, 103,
+ 114, 97, 100, 101, 80, 108, 97, 121, 101, 114,
+ 72, 112, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 39, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 80,
+ 108, 97, 121, 101, 114, 85, 112, 103, 114, 97,
+ 100, 101, 77, 97, 110, 97, 103, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 38,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 80, 108, 97, 121,
+ 101, 114, 87, 101, 97, 112, 111, 110, 86, 105,
+ 115, 117, 97, 108, 115, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 35, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 80, 108, 97, 121, 77, 117, 115, 105,
+ 99, 79, 110, 83, 116, 97, 114, 116, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 33, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 80, 111, 119, 101, 114,
+ 84, 111, 119, 101, 114, 80, 101, 114, 107, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 41,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 80, 114, 97, 99,
+ 116, 105, 99, 101, 84, 97, 114, 103, 101, 116,
+ 67, 111, 105, 110, 68, 114, 111, 112, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 40, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 80, 114, 105, 111, 114,
+ 105, 116, 121, 65, 117, 100, 105, 111, 76, 105,
+ 115, 116, 101, 110, 101, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 32, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 80, 114, 111, 100, 117, 99, 116,
+ 105, 111, 110, 66, 97, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 44, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 80, 114, 111, 106, 101, 99, 116,
+ 105, 108, 101, 73, 109, 112, 97, 99, 116, 80,
+ 97, 114, 116, 105, 99, 108, 101, 115, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 31, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 80, 117, 115, 104, 80,
+ 108, 97, 121, 101, 114, 50, 68, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 31, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 81, 117, 101, 115, 116, 115,
+ 92, 81, 117, 101, 115, 116, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 56, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 82, 101, 100, 117, 99, 101, 67,
+ 104, 105, 108, 100, 114, 101, 110, 115, 66, 117,
+ 105, 108, 100, 82, 101, 113, 117, 105, 114, 101,
+ 109, 101, 110, 116, 73, 102, 80, 101, 114, 107,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 32, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 82, 105, 100,
+ 105, 110, 103, 68, 97, 109, 97, 103, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 36, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 82, 111, 121,
+ 97, 108, 70, 111, 114, 103, 101, 85, 112, 103,
+ 114, 97, 100, 101, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 37, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 83, 97, 118, 101, 76, 111, 97, 100, 92,
+ 73, 83, 97, 118, 101, 76, 111, 97, 100, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 46,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 83, 97, 118, 101,
+ 76, 111, 97, 100, 92, 76, 111, 99, 97, 108,
+ 77, 97, 116, 99, 104, 83, 97, 118, 101, 76,
+ 111, 97, 100, 46, 99, 115, 0, 0, 0, 3,
+ 0, 0, 0, 48, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 83, 97, 118, 101, 76, 111, 97, 100, 92, 77,
+ 97, 116, 99, 104, 83, 97, 118, 101, 76, 111,
+ 97, 100, 72, 97, 110, 100, 108, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 42,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 83, 97, 118, 101,
+ 76, 111, 97, 100, 92, 83, 97, 118, 101, 76,
+ 111, 97, 100, 69, 110, 116, 105, 116, 121, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 31,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 83, 99, 111, 114,
+ 101, 77, 97, 110, 97, 103, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 31, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 83, 99, 114, 101, 101,
+ 110, 77, 97, 114, 107, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 35, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 83, 99, 114, 101, 101, 110,
+ 77, 97, 114, 107, 101, 114, 73, 99, 111, 110,
+ 46, 99, 115, 0, 0, 0, 3, 0, 0, 0,
+ 38, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 83, 99, 114,
+ 101, 101, 110, 77, 97, 114, 107, 101, 114, 77,
+ 97, 110, 97, 103, 101, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 44, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 83, 101, 108, 102, 68, 101, 115,
+ 116, 114, 117, 99, 116, 87, 104, 101, 110, 73,
+ 110, 82, 97, 110, 103, 101, 79, 102, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 37, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 83, 101, 116, 83, 116,
+ 97, 116, 101, 87, 104, 101, 110, 77, 97, 99,
+ 79, 83, 88, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 46, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 83, 101, 116, 116, 105, 110, 103, 115, 92, 82,
+ 101, 115, 101, 116, 65, 117, 100, 105, 111, 83,
+ 101, 116, 116, 105, 110, 103, 115, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 48, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 83, 101, 116, 116, 105, 110,
+ 103, 115, 92, 83, 101, 116, 116, 105, 110, 103,
+ 115, 65, 110, 116, 105, 65, 108, 105, 97, 115,
+ 105, 110, 103, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 47, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 83, 101, 116, 116, 105, 110, 103, 115, 92, 83,
+ 101, 116, 116, 105, 110, 103, 115, 65, 117, 100,
+ 105, 111, 86, 111, 108, 117, 109, 101, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 46, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 83, 101, 116, 116, 105,
+ 110, 103, 115, 92, 83, 101, 116, 116, 105, 110,
+ 103, 115, 70, 117, 108, 108, 115, 99, 114, 101,
+ 101, 110, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 44, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 83,
+ 101, 116, 116, 105, 110, 103, 115, 92, 83, 101,
+ 116, 116, 105, 110, 103, 115, 76, 97, 110, 103,
+ 117, 97, 103, 101, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 49, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 83, 101, 116, 116, 105, 110, 103, 115, 92,
+ 83, 101, 116, 116, 105, 110, 103, 115, 76, 97,
+ 110, 103, 117, 97, 103, 101, 82, 101, 115, 101,
+ 116, 46, 99, 115, 0, 0, 0, 2, 0, 0,
+ 0, 43, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 83, 101,
+ 116, 116, 105, 110, 103, 115, 92, 83, 101, 116,
+ 116, 105, 110, 103, 115, 77, 97, 110, 97, 103,
+ 101, 114, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 50, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 83,
+ 101, 116, 116, 105, 110, 103, 115, 92, 83, 101,
+ 116, 116, 105, 110, 103, 115, 80, 111, 115, 116,
+ 80, 114, 111, 99, 101, 115, 115, 105, 110, 103,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 56, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 83, 101, 116,
+ 116, 105, 110, 103, 115, 92, 83, 101, 116, 116,
+ 105, 110, 103, 115, 80, 111, 115, 116, 80, 114,
+ 111, 99, 101, 115, 115, 105, 110, 103, 72, 101,
+ 108, 112, 101, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 47, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 83, 101, 116, 116, 105, 110, 103, 115, 92,
+ 83, 101, 116, 116, 105, 110, 103, 115, 82, 101,
+ 110, 100, 101, 114, 83, 99, 97, 108, 101, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 53,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 83, 101, 116, 116,
+ 105, 110, 103, 115, 92, 83, 101, 116, 116, 105,
+ 110, 103, 115, 82, 101, 115, 101, 116, 85, 110,
+ 105, 116, 115, 77, 111, 114, 110, 105, 110, 103,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 46, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 83, 101, 116,
+ 116, 105, 110, 103, 115, 92, 83, 101, 116, 116,
+ 105, 110, 103, 115, 82, 101, 115, 101, 116, 86,
+ 105, 100, 101, 111, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 46, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 83, 101, 116, 116, 105, 110, 103, 115, 92,
+ 83, 101, 116, 116, 105, 110, 103, 115, 82, 101,
+ 115, 111, 108, 117, 116, 105, 111, 110, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 52, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 83, 101, 116, 116, 105,
+ 110, 103, 115, 92, 83, 101, 116, 116, 105, 110,
+ 103, 115, 83, 104, 97, 100, 111, 119, 82, 101,
+ 115, 111, 108, 117, 116, 105, 111, 110, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 46, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 83, 101, 116, 116, 105,
+ 110, 103, 115, 92, 83, 101, 116, 116, 105, 110,
+ 103, 115, 85, 115, 101, 76, 97, 114, 103, 101,
+ 85, 73, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 41, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 83,
+ 101, 116, 116, 105, 110, 103, 115, 92, 83, 101,
+ 116, 116, 105, 110, 103, 115, 86, 115, 121, 110,
+ 99, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 46, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 83, 101,
+ 116, 116, 105, 110, 103, 115, 92, 83, 101, 116,
+ 116, 105, 110, 103, 115, 87, 105, 110, 116, 101,
+ 114, 77, 111, 100, 101, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 39, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 83, 104, 97, 114, 112, 67, 111, 114,
+ 110, 101, 114, 77, 105, 100, 105, 103, 97, 116,
+ 111, 114, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 39, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 83,
+ 104, 105, 101, 108, 100, 79, 110, 70, 105, 114,
+ 115, 116, 68, 97, 109, 97, 103, 101, 100, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 25,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 83, 104, 114, 105,
+ 110, 101, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 29, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 83,
+ 108, 111, 119, 69, 102, 102, 101, 99, 116, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 35,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 83, 112, 108, 97,
+ 115, 104, 68, 97, 109, 97, 103, 101, 65, 114,
+ 101, 97, 46, 99, 115, 0, 0, 0, 2, 0,
+ 0, 0, 46, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 83,
+ 116, 101, 97, 109, 119, 111, 114, 107, 115, 46,
+ 78, 69, 84, 92, 83, 116, 101, 97, 109, 77,
+ 97, 110, 97, 103, 101, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 55, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 83, 117, 115, 112, 101, 110, 100,
+ 80, 108, 97, 121, 101, 114, 67, 111, 108, 108,
+ 105, 115, 105, 111, 110, 85, 110, 116, 105, 108,
+ 78, 111, 79, 118, 101, 114, 108, 97, 112, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 31,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 84, 97, 103, 103,
+ 101, 100, 79, 98, 106, 101, 99, 116, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 29, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 84, 97, 103, 77, 97,
+ 110, 97, 103, 101, 114, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 33, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 84, 97, 114, 103, 101, 116, 80, 114,
+ 105, 111, 114, 105, 116, 121, 46, 99, 115, 0,
+ 0, 0, 3, 0, 0, 0, 34, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 84, 101, 99, 104, 92, 80, 97,
+ 116, 104, 77, 101, 115, 104, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 37, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 84, 101, 99, 104, 92,
+ 82, 105, 118, 101, 114, 83, 99, 114, 111, 108,
+ 108, 101, 114, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 29, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 84, 101, 108, 101, 80, 108, 97, 121, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 29, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 84, 105, 101,
+ 66, 114, 101, 97, 107, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 37, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 84, 105, 109, 101, 115, 101,
+ 110, 115, 105, 116, 105, 118, 101, 76, 105, 103,
+ 104, 116, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 33, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 84,
+ 111, 111, 108, 116, 105, 112, 77, 97, 110, 97,
+ 103, 101, 114, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 31, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 84, 111, 119, 101, 114, 85, 112, 103, 114, 97,
+ 100, 101, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 34, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 84,
+ 117, 116, 111, 114, 105, 97, 108, 77, 97, 110,
+ 97, 103, 101, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 64, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 85, 73, 92, 65, 110, 105, 109, 97, 116,
+ 105, 111, 110, 32, 83, 101, 113, 117, 101, 110,
+ 99, 101, 115, 92, 69, 116, 101, 114, 110, 97,
+ 108, 84, 114, 105, 97, 108, 115, 32, 68, 101,
+ 102, 101, 97, 116, 85, 73, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 64, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 85, 73, 92, 65, 110, 105, 109,
+ 97, 116, 105, 111, 110, 32, 83, 101, 113, 117,
+ 101, 110, 99, 101, 115, 92, 69, 116, 101, 114,
+ 110, 97, 108, 84, 114, 105, 97, 108, 115, 86,
+ 105, 99, 116, 111, 114, 121, 85, 73, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 62, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 65, 110,
+ 105, 109, 97, 116, 105, 111, 110, 32, 83, 101,
+ 113, 117, 101, 110, 99, 101, 115, 92, 73, 85,
+ 73, 65, 110, 105, 109, 97, 116, 105, 111, 110,
+ 83, 101, 113, 117, 101, 110, 99, 101, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 48, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 65, 112,
+ 112, 108, 121, 85, 112, 103, 114, 97, 100, 101,
+ 73, 110, 100, 105, 99, 97, 116, 111, 114, 67,
+ 111, 108, 111, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 45, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 85, 73, 92, 65, 116, 116, 97, 99, 107,
+ 67, 111, 111, 108, 100, 111, 119, 110, 65, 110,
+ 105, 109, 97, 116, 105, 111, 110, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 47, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 85, 73, 92, 66, 97, 99,
+ 107, 84, 111, 84, 105, 116, 108, 101, 115, 99,
+ 114, 101, 101, 110, 85, 73, 72, 101, 108, 112,
+ 101, 114, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 42, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 66, 111, 110, 117, 115, 76, 101, 118,
+ 101, 108, 73, 110, 116, 101, 114, 97, 99, 116,
+ 111, 114, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 44, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 66, 117, 105, 108, 100, 105, 110, 103,
+ 82, 97, 110, 103, 101, 73, 110, 100, 105, 99,
+ 97, 116, 111, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 30, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 85, 73, 92, 67, 104, 101, 99, 107, 98,
+ 111, 120, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 30, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 67, 104, 111, 105, 99, 101, 85, 73,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 41, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 73, 92,
+ 67, 104, 111, 105, 99, 101, 85, 73, 70, 114,
+ 97, 109, 101, 72, 101, 108, 112, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 30,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 73, 92, 67,
+ 111, 105, 110, 115, 108, 111, 116, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 38, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 85, 73, 92, 67, 111, 110,
+ 116, 114, 111, 108, 108, 101, 114, 80, 105, 99,
+ 107, 101, 114, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 38, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 85, 73, 92, 67, 111, 110, 116, 114, 111, 108,
+ 77, 97, 112, 66, 117, 116, 116, 111, 110, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 33,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 73, 92, 67,
+ 111, 115, 116, 68, 105, 115, 112, 108, 97, 121,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 36, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 73, 92,
+ 68, 97, 121, 67, 111, 117, 110, 116, 100, 111,
+ 119, 110, 85, 73, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 36, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 85, 73, 92, 68, 101, 109, 111, 81, 117,
+ 105, 116, 83, 119, 105, 116, 99, 104, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 45, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 68, 105,
+ 115, 97, 98, 108, 101, 66, 117, 116, 116, 111,
+ 110, 73, 110, 87, 97, 118, 101, 90, 101, 114,
+ 111, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 47, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 85, 73,
+ 92, 68, 121, 110, 97, 109, 105, 99, 76, 97,
+ 121, 111, 117, 116, 71, 114, 111, 117, 112, 83,
+ 112, 97, 99, 105, 110, 103, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 45, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 85, 73, 92, 69, 110, 100, 79,
+ 102, 77, 97, 116, 99, 104, 83, 99, 111, 114,
+ 101, 85, 73, 72, 101, 108, 112, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 34,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 73, 92, 69,
+ 110, 100, 79, 102, 77, 97, 116, 99, 104, 85,
+ 73, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 42, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 85, 73,
+ 92, 69, 110, 100, 115, 99, 114, 101, 101, 110,
+ 82, 101, 116, 114, 121, 72, 101, 108, 112, 101,
+ 114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 47, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 85, 73,
+ 92, 69, 110, 101, 109, 121, 83, 99, 114, 101,
+ 101, 110, 77, 97, 114, 107, 101, 114, 85, 73,
+ 72, 101, 108, 112, 101, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 34, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 85, 73, 92, 69, 110, 117, 109,
+ 83, 101, 108, 101, 99, 116, 111, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 49, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 69, 110,
+ 117, 109, 83, 101, 108, 101, 99, 116, 111, 114,
+ 66, 117, 116, 116, 111, 110, 65, 110, 105, 109,
+ 97, 116, 105, 111, 110, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 40, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 85, 73, 92, 69, 84, 67, 104, 111,
+ 105, 99, 101, 80, 105, 99, 107, 83, 99, 114,
+ 101, 101, 110, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 51, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 85, 73, 92, 69, 116, 101, 114, 110, 97, 108,
+ 84, 114, 105, 97, 108, 115, 72, 105, 103, 104,
+ 115, 99, 111, 114, 101, 80, 114, 101, 118, 105,
+ 101, 119, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 54, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 69, 116, 101, 114, 110, 97, 108, 84,
+ 114, 105, 97, 108, 115, 76, 111, 97, 100, 111,
+ 117, 116, 83, 99, 114, 101, 101, 110, 72, 101,
+ 108, 112, 101, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 45, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 85, 73, 92, 69, 116, 101, 114, 110, 97,
+ 108, 84, 114, 105, 97, 108, 115, 77, 97, 112,
+ 80, 114, 101, 118, 105, 101, 119, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 47, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 85, 73, 92, 69, 116, 101,
+ 114, 110, 97, 108, 84, 114, 105, 97, 108, 115,
+ 83, 101, 108, 101, 99, 116, 83, 99, 114, 101,
+ 101, 110, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 52, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 69, 116, 101, 114, 110, 97, 108, 84,
+ 114, 105, 97, 108, 115, 83, 116, 97, 103, 101,
+ 67, 111, 117, 110, 116, 68, 105, 115, 112, 108,
+ 97, 121, 46, 99, 115, 0, 0, 0, 2, 0,
+ 0, 0, 40, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 69, 84, 77, 97, 112, 67, 104, 111,
+ 105, 99, 101, 68, 105, 115, 112, 108, 97, 121,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 33, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 73, 92,
+ 71, 114, 97, 112, 104, 68, 114, 97, 119, 101,
+ 114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 40, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 85, 73,
+ 92, 72, 105, 103, 104, 115, 99, 111, 114, 101,
+ 80, 114, 101, 118, 105, 101, 119, 85, 73, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 36,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 73, 92, 72,
+ 105, 103, 104, 115, 99, 111, 114, 101, 84, 97,
+ 98, 108, 101, 46, 99, 115, 0, 0, 0, 2,
+ 0, 0, 0, 39, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 85, 73, 92, 73, 110, 71, 97, 109, 101, 80,
+ 111, 112, 85, 112, 72, 101, 108, 112, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 42, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 73, 92,
+ 73, 110, 71, 97, 109, 101, 82, 101, 115, 105,
+ 103, 110, 85, 73, 72, 101, 108, 112, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 41, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 73, 92,
+ 73, 110, 77, 97, 116, 99, 104, 82, 101, 115,
+ 105, 103, 110, 72, 101, 108, 112, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 33,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 73, 92, 75,
+ 101, 121, 82, 101, 98, 105, 110, 100, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 38, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 73, 92,
+ 76, 101, 118, 101, 108, 78, 97, 109, 101, 68,
+ 105, 115, 112, 108, 97, 121, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 46, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 85, 73, 92, 76, 101, 118, 101,
+ 108, 83, 101, 108, 101, 99, 116, 85, 73, 70,
+ 114, 97, 109, 101, 72, 101, 108, 112, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 44, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 73, 92,
+ 76, 101, 118, 101, 108, 85, 112, 83, 99, 114,
+ 101, 101, 110, 65, 110, 105, 109, 97, 116, 105,
+ 111, 110, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 37, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 76, 111, 97, 100, 111, 117, 116, 85,
+ 73, 72, 101, 108, 112, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 40, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 85, 73, 92, 76, 118, 108,
+ 83, 101, 108, 101, 99, 116, 84, 97, 98, 66,
+ 117, 116, 116, 111, 110, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 38, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 85, 73, 92, 77, 111, 100, 101, 82,
+ 117, 108, 101, 115, 68, 105, 115, 112, 108, 97,
+ 121, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 31, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 85, 73,
+ 92, 78, 105, 103, 104, 116, 67, 97, 108, 108,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 41, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 73, 92,
+ 78, 105, 103, 104, 116, 80, 114, 101, 118, 105,
+ 101, 119, 69, 108, 101, 109, 101, 110, 116, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 34,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 73, 92, 78,
+ 105, 103, 104, 116, 115, 99, 111, 114, 101, 85,
+ 73, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 43, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 85, 73,
+ 92, 80, 97, 117, 115, 101, 66, 97, 99, 107,
+ 84, 111, 77, 101, 110, 117, 72, 101, 108, 112,
+ 101, 114, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 42, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 80, 97, 117, 115, 101, 85, 73, 76,
+ 111, 97, 100, 111, 117, 116, 72, 101, 108, 112,
+ 101, 114, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 48, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 80, 101, 114, 107, 83, 101, 108, 101,
+ 99, 116, 105, 111, 110, 84, 111, 111, 108, 116,
+ 105, 112, 72, 101, 108, 112, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 42, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 80, 104,
+ 121, 115, 105, 99, 97, 108, 67, 111, 105, 110,
+ 65, 110, 105, 109, 97, 116, 111, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 46, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 81, 117,
+ 101, 115, 116, 67, 111, 110, 100, 105, 116, 105,
+ 111, 110, 69, 113, 117, 105, 112, 112, 97, 98,
+ 108, 101, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 32, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 81, 117, 101, 115, 116, 69, 110, 116,
+ 114, 121, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 31, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 81, 117, 101, 115, 116, 77, 101, 110,
+ 117, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 49, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 85, 73,
+ 92, 81, 117, 101, 115, 116, 79, 118, 101, 114,
+ 97, 108, 108, 80, 114, 111, 103, 114, 101, 115,
+ 115, 68, 105, 115, 112, 108, 97, 121, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 32, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 81, 117,
+ 101, 115, 116, 84, 97, 103, 85, 73, 46, 99,
+ 115, 0, 0, 0, 2, 0, 0, 0, 43, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 82, 97,
+ 110, 103, 101, 73, 110, 100, 105, 99, 97, 116,
+ 111, 114, 72, 97, 110, 100, 108, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 41,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 73, 92, 82,
+ 101, 115, 101, 116, 67, 111, 110, 116, 114, 111,
+ 108, 115, 72, 101, 108, 112, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 33, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 82, 101,
+ 118, 105, 118, 101, 80, 97, 110, 101, 108, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 30,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 73, 92, 83,
+ 99, 111, 114, 101, 84, 97, 103, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 46, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 85, 73, 92, 83, 99, 114,
+ 101, 101, 110, 77, 97, 114, 107, 101, 114, 67,
+ 97, 110, 118, 97, 115, 72, 101, 108, 112, 101,
+ 114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 32, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 85, 73,
+ 92, 83, 99, 114, 111, 108, 108, 65, 114, 101,
+ 97, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 37, 92, 65, 115, 115, 101, 116, 115, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 85, 73,
+ 92, 83, 99, 114, 111, 108, 108, 69, 108, 101,
+ 109, 101, 110, 116, 73, 68, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 34, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 85, 73, 92, 83, 101, 108, 101,
+ 99, 116, 85, 110, 105, 116, 85, 73, 46, 99,
+ 115, 0, 0, 0, 2, 0, 0, 0, 38, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 83, 101,
+ 116, 116, 105, 110, 103, 115, 85, 73, 72, 101,
+ 108, 112, 101, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 38, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 85, 73, 92, 83, 101, 116, 87, 105, 100,
+ 116, 104, 84, 111, 84, 97, 114, 103, 101, 116,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 36, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 73, 92,
+ 83, 105, 109, 112, 108, 101, 85, 73, 83, 99,
+ 97, 108, 101, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 47, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 85, 73, 92, 83, 105, 122, 101, 82, 101,
+ 99, 116, 97, 110, 103, 108, 101, 84, 111, 77,
+ 101, 115, 104, 66, 111, 117, 110, 100, 115, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 42,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 73, 92, 84,
+ 101, 120, 116, 66, 97, 99, 107, 103, 114, 111,
+ 117, 110, 100, 70, 105, 116, 116, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 32,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 73, 92, 84,
+ 101, 120, 116, 77, 105, 114, 114, 111, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 37,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 73, 92, 84,
+ 70, 85, 73, 65, 117, 100, 105, 111, 72, 101,
+ 108, 112, 101, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 41, 92, 65, 115, 115, 101,
+ 116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 85, 73, 92, 84, 70, 85, 73, 66, 108,
+ 111, 99, 107, 111, 117, 116, 69, 108, 101, 109,
+ 101, 110, 116, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 46, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 85, 73, 92, 84, 70, 85, 73, 67, 104, 101,
+ 99, 107, 98, 111, 120, 77, 111, 117, 115, 101,
+ 67, 97, 116, 99, 104, 101, 114, 46, 99, 115,
+ 0, 0, 0, 3, 0, 0, 0, 31, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 85, 73, 92, 84, 70, 85,
+ 73, 69, 110, 101, 109, 121, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 42, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 85, 73, 92, 84, 70, 85, 73,
+ 69, 110, 117, 109, 77, 111, 117, 115, 101, 67,
+ 97, 116, 99, 104, 101, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 44, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 85, 73, 92, 84, 70, 85, 73,
+ 69, 110, 117, 109, 83, 101, 108, 101, 99, 116,
+ 111, 114, 66, 117, 116, 116, 111, 110, 46, 99,
+ 115, 0, 0, 0, 3, 0, 0, 0, 36, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 84, 70,
+ 85, 73, 69, 113, 117, 105, 112, 112, 97, 98,
+ 108, 101, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 38, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 84, 70, 85, 73, 70, 111, 99, 117,
+ 115, 67, 97, 116, 99, 104, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 39, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 84, 70,
+ 85, 73, 73, 110, 99, 111, 109, 101, 68, 105,
+ 115, 112, 108, 97, 121, 46, 99, 115, 0, 0,
+ 0, 3, 0, 0, 0, 34, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 85, 73, 92, 84, 70, 85, 73, 80,
+ 101, 114, 107, 108, 105, 107, 101, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 35, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 85, 73, 92, 84, 70, 85,
+ 73, 83, 99, 114, 111, 108, 108, 66, 97, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 32, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 73, 92,
+ 84, 70, 85, 73, 83, 108, 105, 100, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 40, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 73, 92,
+ 84, 70, 85, 73, 83, 108, 105, 100, 101, 114,
+ 68, 114, 97, 103, 65, 114, 101, 97, 46, 99,
+ 115, 0, 0, 0, 3, 0, 0, 0, 36, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 84, 70,
+ 85, 73, 84, 101, 120, 116, 66, 117, 116, 116,
+ 111, 110, 46, 99, 115, 0, 0, 0, 3, 0,
+ 0, 0, 39, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 84, 70, 85, 73, 85, 112, 103, 114,
+ 97, 100, 101, 67, 104, 111, 105, 99, 101, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 41,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 73, 92, 84,
+ 104, 114, 111, 110, 101, 102, 97, 108, 108, 85,
+ 73, 69, 108, 101, 109, 101, 110, 116, 46, 99,
+ 115, 0, 0, 0, 2, 0, 0, 0, 44, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 84, 105,
+ 116, 108, 101, 83, 99, 114, 101, 101, 110, 80,
+ 111, 112, 85, 112, 72, 101, 108, 112, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 41, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 73, 92,
+ 84, 105, 116, 108, 101, 83, 99, 114, 101, 101,
+ 110, 85, 73, 72, 101, 108, 112, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 29,
+ 92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 73, 92, 84,
+ 111, 111, 108, 116, 105, 112, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 53, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 85, 73, 92, 84, 114, 97, 110,
+ 115, 105, 116, 105, 111, 110, 84, 111, 83, 101,
+ 108, 101, 99, 116, 101, 100, 76, 101, 118, 101,
+ 108, 72, 101, 108, 112, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 43, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 85, 73, 92, 84, 114, 101,
+ 97, 115, 117, 114, 101, 67, 104, 101, 115, 116,
+ 85, 73, 72, 101, 108, 112, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 32, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 84, 114,
+ 101, 97, 115, 117, 114, 121, 85, 73, 46, 99,
+ 115, 0, 0, 0, 2, 0, 0, 0, 40, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 73, 92, 85, 73,
+ 66, 111, 110, 117, 115, 76, 101, 118, 101, 108,
+ 83, 101, 108, 101, 99, 116, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 29, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 85, 73, 92, 85, 73, 70, 114,
+ 97, 109, 101, 46, 99, 115, 0, 0, 0, 2,
+ 0, 0, 0, 36, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 85, 73, 92, 85, 73, 70, 114, 97, 109, 101,
+ 77, 97, 110, 97, 103, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 37, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 85, 73, 92, 85, 73, 80,
+ 97, 114, 101, 110, 116, 82, 101, 115, 105, 122,
+ 101, 114, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 42, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 86, 101, 114, 115, 105, 111, 110, 78,
+ 117, 109, 98, 101, 114, 68, 105, 115, 112, 108,
+ 97, 121, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 36, 92, 65, 115, 115, 101, 116, 115,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 85,
+ 73, 92, 87, 97, 118, 101, 67, 111, 117, 110,
+ 116, 80, 111, 112, 85, 112, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 39, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 85, 73, 92, 87, 97, 118, 101,
+ 68, 101, 115, 99, 114, 105, 112, 116, 105, 111,
+ 110, 85, 73, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 36, 92, 65, 115, 115, 101, 116,
+ 115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 85, 73, 92, 87, 105, 115, 104, 108, 105, 115,
+ 116, 66, 117, 116, 116, 111, 110, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 33, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 85, 73, 83, 99, 97, 108,
+ 101, 72, 97, 110, 100, 108, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 31, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 110, 105, 116, 68,
+ 97, 115, 104, 74, 117, 109, 112, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 41, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 85, 110, 105, 116, 80, 114,
+ 111, 100, 117, 99, 116, 105, 111, 110, 83, 101,
+ 108, 101, 99, 116, 111, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 44, 92, 65, 115,
+ 115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 85, 110, 105, 116, 82, 101, 115,
+ 112, 97, 119, 110, 101, 114, 70, 111, 114, 66,
+ 117, 105, 108, 100, 105, 110, 103, 115, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 34, 92,
+ 65, 115, 115, 101, 116, 115, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 110, 112, 97, 114,
+ 101, 110, 116, 79, 110, 83, 116, 97, 114, 116,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 39, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 112, 103,
+ 114, 97, 100, 101, 85, 110, 105, 116, 115, 79,
+ 110, 69, 110, 97, 98, 108, 101, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 25, 92, 65,
+ 115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 87, 101, 97, 112, 111, 110,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 37, 92, 65, 115, 115, 101, 116, 115, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 87, 101, 97,
+ 112, 111, 110, 68, 97, 109, 97, 103, 101, 68,
+ 101, 97, 108, 101, 114, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 33, 92, 65, 115, 115,
+ 101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 87, 101, 97, 112, 111, 110, 69, 113,
+ 117, 105, 112, 112, 101, 114, 46, 99, 115, 0,
+ 0, 0, 3, 0, 0, 0, 39, 92, 65, 115,
+ 115, 101, 116, 115, 92, 84, 104, 105, 114, 100,
+ 80, 97, 114, 116, 121, 92, 65, 114, 97, 84,
+ 114, 97, 105, 108, 92, 65, 114, 97, 84, 114,
+ 97, 105, 108, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 43, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 65, 114, 97, 84, 114, 97, 105,
+ 108, 92, 69, 108, 97, 115, 116, 105, 99, 65,
+ 114, 114, 97, 121, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 54, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 65, 114, 97, 84, 114, 97,
+ 105, 108, 92, 72, 101, 108, 112, 101, 114, 83,
+ 99, 114, 105, 112, 116, 115, 92, 66, 97, 107,
+ 101, 84, 114, 97, 105, 108, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 59, 92, 65, 115,
+ 115, 101, 116, 115, 92, 84, 104, 105, 114, 100,
+ 80, 97, 114, 116, 121, 92, 65, 114, 97, 84,
+ 114, 97, 105, 108, 92, 72, 101, 108, 112, 101,
+ 114, 83, 99, 114, 105, 112, 116, 115, 92, 67,
+ 111, 108, 111, 114, 70, 114, 111, 109, 83, 112,
+ 101, 101, 100, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 58, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 65, 114, 97, 84, 114, 97, 105,
+ 108, 92, 72, 101, 108, 112, 101, 114, 83, 99,
+ 114, 105, 112, 116, 115, 92, 69, 108, 101, 99,
+ 116, 114, 105, 99, 97, 108, 65, 114, 99, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 54,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 65,
+ 114, 97, 84, 114, 97, 105, 108, 92, 72, 101,
+ 108, 112, 101, 114, 83, 99, 114, 105, 112, 116,
+ 115, 92, 84, 105, 114, 101, 84, 114, 97, 99,
+ 107, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 43, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 65, 114, 97, 84, 114, 97, 105, 108, 92,
+ 84, 114, 97, 105, 108, 83, 101, 99, 116, 105,
+ 111, 110, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 48, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 70, 108, 97, 116, 75, 105, 116, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 85, 118,
+ 83, 99, 114, 111, 108, 108, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 89, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 70, 108,
+ 97, 116, 75, 105, 116, 92, 91, 82, 101, 110,
+ 100, 101, 114, 32, 80, 105, 112, 101, 108, 105,
+ 110, 101, 93, 32, 85, 82, 80, 92, 82, 101,
+ 110, 100, 101, 114, 70, 101, 97, 116, 117, 114,
+ 101, 115, 92, 67, 111, 109, 109, 111, 110, 92,
+ 66, 108, 105, 116, 84, 101, 120, 116, 117, 114,
+ 101, 80, 97, 115, 115, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 81, 92, 65, 115, 115,
+ 101, 116, 115, 92, 84, 104, 105, 114, 100, 80,
+ 97, 114, 116, 121, 92, 70, 108, 97, 116, 75,
+ 105, 116, 92, 91, 82, 101, 110, 100, 101, 114,
+ 32, 80, 105, 112, 101, 108, 105, 110, 101, 93,
+ 32, 85, 82, 80, 92, 82, 101, 110, 100, 101,
+ 114, 70, 101, 97, 116, 117, 114, 101, 115, 92,
+ 70, 111, 103, 92, 70, 108, 97, 116, 75, 105,
+ 116, 70, 111, 103, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 82, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 70, 108, 97, 116, 75, 105,
+ 116, 92, 91, 82, 101, 110, 100, 101, 114, 32,
+ 80, 105, 112, 101, 108, 105, 110, 101, 93, 32,
+ 85, 82, 80, 92, 82, 101, 110, 100, 101, 114,
+ 70, 101, 97, 116, 117, 114, 101, 115, 92, 70,
+ 111, 103, 92, 70, 111, 103, 83, 101, 116, 116,
+ 105, 110, 103, 115, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 89, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 70, 108, 97, 116, 75, 105,
+ 116, 92, 91, 82, 101, 110, 100, 101, 114, 32,
+ 80, 105, 112, 101, 108, 105, 110, 101, 93, 32,
+ 85, 82, 80, 92, 82, 101, 110, 100, 101, 114,
+ 70, 101, 97, 116, 117, 114, 101, 115, 92, 79,
+ 117, 116, 108, 105, 110, 101, 92, 70, 108, 97,
+ 116, 75, 105, 116, 79, 117, 116, 108, 105, 110,
+ 101, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 90, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 70, 108, 97, 116, 75, 105, 116, 92, 91,
+ 82, 101, 110, 100, 101, 114, 32, 80, 105, 112,
+ 101, 108, 105, 110, 101, 93, 32, 85, 82, 80,
+ 92, 82, 101, 110, 100, 101, 114, 70, 101, 97,
+ 116, 117, 114, 101, 115, 92, 79, 117, 116, 108,
+ 105, 110, 101, 92, 79, 117, 116, 108, 105, 110,
+ 101, 83, 101, 116, 116, 105, 110, 103, 115, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 74,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 70,
+ 108, 97, 116, 75, 105, 116, 92, 91, 82, 101,
+ 110, 100, 101, 114, 32, 80, 105, 112, 101, 108,
+ 105, 110, 101, 93, 32, 85, 82, 80, 92, 87,
+ 97, 116, 101, 114, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 66, 117, 111, 121, 97, 110, 99,
+ 121, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 82, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 73, 50, 92, 76, 111, 99, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 92, 69, 120, 97,
+ 109, 112, 108, 101, 115, 92, 67, 111, 109, 109,
+ 111, 110, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 67, 97, 108, 108, 98, 97, 99, 107, 78,
+ 111, 116, 105, 102, 105, 99, 97, 116, 105, 111,
+ 110, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 84, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 73, 50, 92, 76, 111, 99, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 92, 69, 120, 97,
+ 109, 112, 108, 101, 115, 92, 67, 111, 109, 109,
+ 111, 110, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 69, 120, 97, 109, 112, 108, 101, 95, 67,
+ 104, 97, 110, 103, 101, 76, 97, 110, 103, 117,
+ 97, 103, 101, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 85, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 73, 50, 92, 76, 111, 99, 97,
+ 108, 105, 122, 97, 116, 105, 111, 110, 92, 69,
+ 120, 97, 109, 112, 108, 101, 115, 92, 67, 111,
+ 109, 109, 111, 110, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 69, 120, 97, 109, 112, 108, 101,
+ 95, 76, 111, 99, 97, 108, 105, 122, 101, 100,
+ 83, 116, 114, 105, 110, 103, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 85, 92, 65, 115,
+ 115, 101, 116, 115, 92, 84, 104, 105, 114, 100,
+ 80, 97, 114, 116, 121, 92, 73, 50, 92, 76,
+ 111, 99, 97, 108, 105, 122, 97, 116, 105, 111,
+ 110, 92, 69, 120, 97, 109, 112, 108, 101, 115,
+ 92, 67, 111, 109, 109, 111, 110, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 71, 108, 111, 98,
+ 97, 108, 80, 97, 114, 97, 109, 101, 116, 101,
+ 114, 115, 69, 120, 97, 109, 112, 108, 101, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 81,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 73,
+ 50, 92, 76, 111, 99, 97, 108, 105, 122, 97,
+ 116, 105, 111, 110, 92, 69, 120, 97, 109, 112,
+ 108, 101, 115, 92, 67, 111, 109, 109, 111, 110,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 82,
+ 101, 97, 108, 84, 105, 109, 101, 84, 114, 97,
+ 110, 115, 108, 97, 116, 105, 111, 110, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 84, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 73, 50,
+ 92, 76, 111, 99, 97, 108, 105, 122, 97, 116,
+ 105, 111, 110, 92, 69, 120, 97, 109, 112, 108,
+ 101, 115, 92, 67, 111, 109, 109, 111, 110, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 82, 101,
+ 103, 105, 115, 116, 101, 114, 66, 117, 110, 100,
+ 108, 101, 115, 77, 97, 110, 97, 103, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 76, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 73, 50, 92, 76, 111, 99, 97, 108, 105, 122,
+ 97, 116, 105, 111, 110, 92, 69, 120, 97, 109,
+ 112, 108, 101, 115, 92, 67, 111, 109, 109, 111,
+ 110, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 84, 111, 103, 103, 108, 101, 76, 97, 110, 103,
+ 117, 97, 103, 101, 46, 99, 115, 0, 0, 0,
+ 3, 0, 0, 0, 77, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 73, 50, 92, 76, 111, 99,
+ 97, 108, 105, 122, 97, 116, 105, 111, 110, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 67, 111,
+ 110, 102, 105, 103, 117, 114, 97, 98, 108, 101,
+ 115, 92, 80, 101, 114, 115, 105, 115, 116, 101,
+ 110, 116, 83, 116, 111, 114, 97, 103, 101, 46,
+ 99, 115, 0, 0, 0, 2, 0, 0, 0, 81,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 73,
+ 50, 92, 76, 111, 99, 97, 108, 105, 122, 97,
+ 116, 105, 111, 110, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 67, 111, 110, 102, 105, 103, 117,
+ 114, 97, 98, 108, 101, 115, 92, 83, 112, 101,
+ 99, 105, 97, 108, 105, 122, 97, 116, 105, 111,
+ 110, 77, 97, 110, 97, 103, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 59, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 73, 50,
+ 92, 76, 111, 99, 97, 108, 105, 122, 97, 116,
+ 105, 111, 110, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 69, 118, 101, 110, 116, 67, 97, 108,
+ 108, 98, 97, 99, 107, 46, 99, 115, 0, 0,
+ 0, 2, 0, 0, 0, 68, 92, 65, 115, 115,
+ 101, 116, 115, 92, 84, 104, 105, 114, 100, 80,
+ 97, 114, 116, 121, 92, 73, 50, 92, 76, 111,
+ 99, 97, 108, 105, 122, 97, 116, 105, 111, 110,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 71,
+ 111, 111, 103, 108, 101, 92, 71, 111, 111, 103,
+ 108, 101, 76, 97, 110, 103, 117, 97, 103, 101,
+ 115, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 70, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 73, 50, 92, 76, 111, 99, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 71, 111, 111, 103, 108,
+ 101, 92, 71, 111, 111, 103, 108, 101, 84, 114,
+ 97, 110, 115, 108, 97, 116, 105, 111, 110, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 75,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 73,
+ 50, 92, 76, 111, 99, 97, 108, 105, 122, 97,
+ 116, 105, 111, 110, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 71, 111, 111, 103, 108, 101, 92,
+ 71, 111, 111, 103, 108, 101, 84, 114, 97, 110,
+ 115, 108, 97, 116, 105, 111, 110, 95, 80, 111,
+ 115, 116, 46, 99, 115, 0, 0, 0, 2, 0,
+ 0, 0, 78, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 73, 50, 92, 76, 111, 99, 97, 108,
+ 105, 122, 97, 116, 105, 111, 110, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 71, 111, 111, 103,
+ 108, 101, 92, 71, 111, 111, 103, 108, 101, 84,
+ 114, 97, 110, 115, 108, 97, 116, 105, 111, 110,
+ 95, 81, 117, 101, 114, 105, 101, 115, 46, 99,
+ 115, 0, 0, 0, 6, 0, 0, 0, 63, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 73, 50,
+ 92, 76, 111, 99, 97, 108, 105, 122, 97, 116,
+ 105, 111, 110, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 71, 111, 111, 103, 108, 101, 92, 83,
+ 105, 109, 112, 108, 101, 74, 83, 79, 78, 46,
+ 99, 115, 0, 0, 0, 2, 0, 0, 0, 67,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 73,
+ 50, 92, 76, 111, 99, 97, 108, 105, 122, 97,
+ 116, 105, 111, 110, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 71, 111, 111, 103, 108, 101, 92,
+ 84, 114, 97, 110, 115, 108, 97, 116, 105, 111,
+ 110, 74, 111, 98, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 71, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 73, 50, 92, 76, 111, 99,
+ 97, 108, 105, 122, 97, 116, 105, 111, 110, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 71, 111,
+ 111, 103, 108, 101, 92, 84, 114, 97, 110, 115,
+ 108, 97, 116, 105, 111, 110, 74, 111, 98, 95,
+ 71, 69, 84, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 72, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 73, 50, 92, 76, 111, 99, 97,
+ 108, 105, 122, 97, 116, 105, 111, 110, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 71, 111, 111,
+ 103, 108, 101, 92, 84, 114, 97, 110, 115, 108,
+ 97, 116, 105, 111, 110, 74, 111, 98, 95, 77,
+ 97, 105, 110, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 72, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 73, 50, 92, 76, 111, 99, 97,
+ 108, 105, 122, 97, 116, 105, 111, 110, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 71, 111, 111,
+ 103, 108, 101, 92, 84, 114, 97, 110, 115, 108,
+ 97, 116, 105, 111, 110, 74, 111, 98, 95, 80,
+ 79, 83, 84, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 71, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 73, 50, 92, 76, 111, 99, 97,
+ 108, 105, 122, 97, 116, 105, 111, 110, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 71, 111, 111,
+ 103, 108, 101, 92, 84, 114, 97, 110, 115, 108,
+ 97, 116, 105, 111, 110, 74, 111, 98, 95, 87,
+ 69, 66, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 58, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 73, 50, 92, 76, 111, 99, 97, 108,
+ 105, 122, 97, 116, 105, 111, 110, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 76, 97, 110, 103,
+ 117, 97, 103, 101, 68, 97, 116, 97, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 75, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 73, 50,
+ 92, 76, 111, 99, 97, 108, 105, 122, 97, 116,
+ 105, 111, 110, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 76, 97, 110, 103, 117, 97, 103, 101,
+ 83, 111, 117, 114, 99, 101, 92, 76, 97, 110,
+ 103, 117, 97, 103, 101, 83, 111, 117, 114, 99,
+ 101, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 80, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 73, 50, 92, 76, 111, 99, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 76, 97, 110, 103, 117,
+ 97, 103, 101, 83, 111, 117, 114, 99, 101, 92,
+ 76, 97, 110, 103, 117, 97, 103, 101, 83, 111,
+ 117, 114, 99, 101, 65, 115, 115, 101, 116, 46,
+ 99, 115, 0, 0, 0, 2, 0, 0, 0, 79,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 73,
+ 50, 92, 76, 111, 99, 97, 108, 105, 122, 97,
+ 116, 105, 111, 110, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 76, 97, 110, 103, 117, 97, 103,
+ 101, 83, 111, 117, 114, 99, 101, 92, 76, 97,
+ 110, 103, 117, 97, 103, 101, 83, 111, 117, 114,
+ 99, 101, 68, 97, 116, 97, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 86, 92, 65, 115,
+ 115, 101, 116, 115, 92, 84, 104, 105, 114, 100,
+ 80, 97, 114, 116, 121, 92, 73, 50, 92, 76,
+ 111, 99, 97, 108, 105, 122, 97, 116, 105, 111,
+ 110, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 76, 97, 110, 103, 117, 97, 103, 101, 83, 111,
+ 117, 114, 99, 101, 92, 76, 97, 110, 103, 117,
+ 97, 103, 101, 83, 111, 117, 114, 99, 101, 68,
+ 97, 116, 97, 95, 65, 115, 115, 101, 116, 115,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 90, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 73, 50, 92, 76, 111, 99, 97, 108, 105, 122,
+ 97, 116, 105, 111, 110, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 76, 97, 110, 103, 117, 97,
+ 103, 101, 83, 111, 117, 114, 99, 101, 92, 76,
+ 97, 110, 103, 117, 97, 103, 101, 83, 111, 117,
+ 114, 99, 101, 68, 97, 116, 97, 95, 69, 120,
+ 112, 111, 114, 116, 95, 67, 83, 86, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 93, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 73, 50,
+ 92, 76, 111, 99, 97, 108, 105, 122, 97, 116,
+ 105, 111, 110, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 76, 97, 110, 103, 117, 97, 103, 101,
+ 83, 111, 117, 114, 99, 101, 92, 76, 97, 110,
+ 103, 117, 97, 103, 101, 83, 111, 117, 114, 99,
+ 101, 68, 97, 116, 97, 95, 69, 120, 112, 111,
+ 114, 116, 95, 71, 111, 111, 103, 108, 101, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 90,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 73,
+ 50, 92, 76, 111, 99, 97, 108, 105, 122, 97,
+ 116, 105, 111, 110, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 76, 97, 110, 103, 117, 97, 103,
+ 101, 83, 111, 117, 114, 99, 101, 92, 76, 97,
+ 110, 103, 117, 97, 103, 101, 83, 111, 117, 114,
+ 99, 101, 68, 97, 116, 97, 95, 73, 109, 112,
+ 111, 114, 116, 95, 67, 83, 86, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 93, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 73, 50, 92,
+ 76, 111, 99, 97, 108, 105, 122, 97, 116, 105,
+ 111, 110, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 76, 97, 110, 103, 117, 97, 103, 101, 83,
+ 111, 117, 114, 99, 101, 92, 76, 97, 110, 103,
+ 117, 97, 103, 101, 83, 111, 117, 114, 99, 101,
+ 68, 97, 116, 97, 95, 73, 109, 112, 111, 114,
+ 116, 95, 71, 111, 111, 103, 108, 101, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 89, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 73, 50,
+ 92, 76, 111, 99, 97, 108, 105, 122, 97, 116,
+ 105, 111, 110, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 76, 97, 110, 103, 117, 97, 103, 101,
+ 83, 111, 117, 114, 99, 101, 92, 76, 97, 110,
+ 103, 117, 97, 103, 101, 83, 111, 117, 114, 99,
+ 101, 68, 97, 116, 97, 95, 76, 97, 110, 103,
+ 117, 97, 103, 101, 115, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 84, 92, 65, 115, 115,
+ 101, 116, 115, 92, 84, 104, 105, 114, 100, 80,
+ 97, 114, 116, 121, 92, 73, 50, 92, 76, 111,
+ 99, 97, 108, 105, 122, 97, 116, 105, 111, 110,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 76,
+ 97, 110, 103, 117, 97, 103, 101, 83, 111, 117,
+ 114, 99, 101, 92, 76, 97, 110, 103, 117, 97,
+ 103, 101, 83, 111, 117, 114, 99, 101, 68, 97,
+ 116, 97, 95, 77, 105, 115, 99, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 85, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 73, 50, 92,
+ 76, 111, 99, 97, 108, 105, 122, 97, 116, 105,
+ 111, 110, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 76, 97, 110, 103, 117, 97, 103, 101, 83,
+ 111, 117, 114, 99, 101, 92, 76, 97, 110, 103,
+ 117, 97, 103, 101, 83, 111, 117, 114, 99, 101,
+ 68, 97, 116, 97, 95, 84, 101, 114, 109, 115,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 64, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 73, 50, 92, 76, 111, 99, 97, 108, 105, 122,
+ 97, 116, 105, 111, 110, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 76, 111, 99, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 82, 101, 97, 100,
+ 101, 114, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 54, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 73, 50, 92, 76, 111, 99, 97, 108,
+ 105, 122, 97, 116, 105, 111, 110, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 76, 111, 99, 97,
+ 108, 105, 122, 101, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 62, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 73, 50, 92, 76, 111, 99,
+ 97, 108, 105, 122, 97, 116, 105, 111, 110, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 76, 111,
+ 99, 97, 108, 105, 122, 101, 68, 114, 111, 112,
+ 100, 111, 119, 110, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 73, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 73, 50, 92, 76, 111, 99,
+ 97, 108, 105, 122, 97, 116, 105, 111, 110, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 77, 97,
+ 110, 97, 103, 101, 114, 92, 76, 111, 99, 97,
+ 108, 105, 122, 97, 116, 105, 111, 110, 77, 97,
+ 110, 97, 103, 101, 114, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 82, 92, 65, 115, 115,
+ 101, 116, 115, 92, 84, 104, 105, 114, 100, 80,
+ 97, 114, 116, 121, 92, 73, 50, 92, 76, 111,
+ 99, 97, 108, 105, 122, 97, 116, 105, 111, 110,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 77,
+ 97, 110, 97, 103, 101, 114, 92, 76, 111, 99,
+ 97, 108, 105, 122, 97, 116, 105, 111, 110, 77,
+ 97, 110, 97, 103, 101, 114, 95, 76, 97, 110,
+ 103, 117, 97, 103, 101, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 84, 92, 65, 115, 115,
+ 101, 116, 115, 92, 84, 104, 105, 114, 100, 80,
+ 97, 114, 116, 121, 92, 73, 50, 92, 76, 111,
+ 99, 97, 108, 105, 122, 97, 116, 105, 111, 110,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 77,
+ 97, 110, 97, 103, 101, 114, 92, 76, 111, 99,
+ 97, 108, 105, 122, 97, 116, 105, 111, 110, 77,
+ 97, 110, 97, 103, 101, 114, 95, 80, 97, 114,
+ 97, 109, 101, 116, 101, 114, 115, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 77, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 73, 50, 92,
+ 76, 111, 99, 97, 108, 105, 122, 97, 116, 105,
+ 111, 110, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 77, 97, 110, 97, 103, 101, 114, 92, 76,
+ 111, 99, 97, 108, 105, 122, 97, 116, 105, 111,
+ 110, 77, 97, 110, 97, 103, 101, 114, 95, 82,
+ 84, 76, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 81, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 73, 50, 92, 76, 111, 99, 97, 108,
+ 105, 122, 97, 116, 105, 111, 110, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 77, 97, 110, 97,
+ 103, 101, 114, 92, 76, 111, 99, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 77, 97, 110, 97,
+ 103, 101, 114, 95, 83, 111, 117, 114, 99, 101,
+ 115, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 88, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 73, 50, 92, 76, 111, 99, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 77, 97, 110, 97, 103,
+ 101, 114, 92, 76, 111, 99, 97, 108, 105, 122,
+ 97, 116, 105, 111, 110, 77, 97, 110, 97, 103,
+ 101, 114, 95, 83, 121, 115, 116, 101, 109, 76,
+ 97, 110, 103, 117, 97, 103, 101, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 81, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 73, 50, 92,
+ 76, 111, 99, 97, 108, 105, 122, 97, 116, 105,
+ 111, 110, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 77, 97, 110, 97, 103, 101, 114, 92, 76,
+ 111, 99, 97, 108, 105, 122, 97, 116, 105, 111,
+ 110, 77, 97, 110, 97, 103, 101, 114, 95, 84,
+ 97, 114, 103, 101, 116, 115, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 85, 92, 65, 115,
+ 115, 101, 116, 115, 92, 84, 104, 105, 114, 100,
+ 80, 97, 114, 116, 121, 92, 73, 50, 92, 76,
+ 111, 99, 97, 108, 105, 122, 97, 116, 105, 111,
+ 110, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 77, 97, 110, 97, 103, 101, 114, 92, 76, 111,
+ 99, 97, 108, 105, 122, 97, 116, 105, 111, 110,
+ 77, 97, 110, 97, 103, 101, 114, 95, 84, 114,
+ 97, 110, 115, 108, 97, 116, 105, 111, 110, 46,
+ 99, 115, 0, 0, 0, 2, 0, 0, 0, 69,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 73,
+ 50, 92, 76, 111, 99, 97, 108, 105, 122, 97,
+ 116, 105, 111, 110, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 84, 97, 114, 103, 101, 116, 115,
+ 92, 73, 76, 111, 99, 97, 108, 105, 122, 101,
+ 84, 97, 114, 103, 101, 116, 46, 99, 115, 0,
+ 0, 0, 3, 0, 0, 0, 73, 92, 65, 115,
+ 115, 101, 116, 115, 92, 84, 104, 105, 114, 100,
+ 80, 97, 114, 116, 121, 92, 73, 50, 92, 76,
+ 111, 99, 97, 108, 105, 122, 97, 116, 105, 111,
+ 110, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 84, 97, 114, 103, 101, 116, 115, 92, 73, 76,
+ 111, 99, 97, 108, 105, 122, 101, 84, 97, 114,
+ 103, 101, 116, 68, 101, 115, 99, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 86, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 73, 50, 92,
+ 76, 111, 99, 97, 108, 105, 122, 97, 116, 105,
+ 111, 110, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 84, 97, 114, 103, 101, 116, 115, 92, 76,
+ 111, 99, 97, 108, 105, 122, 101, 84, 97, 114,
+ 103, 101, 116, 95, 84, 101, 120, 116, 77, 101,
+ 115, 104, 80, 114, 111, 95, 76, 97, 98, 101,
+ 108, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 85, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 73, 50, 92, 76, 111, 99, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 84, 97, 114, 103, 101,
+ 116, 115, 92, 76, 111, 99, 97, 108, 105, 122,
+ 101, 84, 97, 114, 103, 101, 116, 95, 84, 101,
+ 120, 116, 77, 101, 115, 104, 80, 114, 111, 95,
+ 85, 71, 85, 73, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 94, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 73, 50, 92, 76, 111, 99,
+ 97, 108, 105, 122, 97, 116, 105, 111, 110, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 84, 97,
+ 114, 103, 101, 116, 115, 92, 76, 111, 99, 97,
+ 108, 105, 122, 101, 84, 97, 114, 103, 101, 116,
+ 95, 85, 110, 105, 116, 121, 83, 116, 97, 110,
+ 100, 97, 114, 100, 95, 65, 117, 100, 105, 111,
+ 83, 111, 117, 114, 99, 101, 46, 99, 115, 0,
+ 0, 0, 2, 0, 0, 0, 88, 92, 65, 115,
+ 115, 101, 116, 115, 92, 84, 104, 105, 114, 100,
+ 80, 97, 114, 116, 121, 92, 73, 50, 92, 76,
+ 111, 99, 97, 108, 105, 122, 97, 116, 105, 111,
+ 110, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 84, 97, 114, 103, 101, 116, 115, 92, 76, 111,
+ 99, 97, 108, 105, 122, 101, 84, 97, 114, 103,
+ 101, 116, 95, 85, 110, 105, 116, 121, 83, 116,
+ 97, 110, 100, 97, 114, 100, 95, 67, 104, 105,
+ 108, 100, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 95, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 73, 50, 92, 76, 111, 99, 97, 108,
+ 105, 122, 97, 116, 105, 111, 110, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 84, 97, 114, 103,
+ 101, 116, 115, 92, 76, 111, 99, 97, 108, 105,
+ 122, 101, 84, 97, 114, 103, 101, 116, 95, 85,
+ 110, 105, 116, 121, 83, 116, 97, 110, 100, 97,
+ 114, 100, 95, 77, 101, 115, 104, 82, 101, 110,
+ 100, 101, 114, 101, 114, 46, 99, 115, 0, 0,
+ 0, 2, 0, 0, 0, 89, 92, 65, 115, 115,
+ 101, 116, 115, 92, 84, 104, 105, 114, 100, 80,
+ 97, 114, 116, 121, 92, 73, 50, 92, 76, 111,
+ 99, 97, 108, 105, 122, 97, 116, 105, 111, 110,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 84,
+ 97, 114, 103, 101, 116, 115, 92, 76, 111, 99,
+ 97, 108, 105, 122, 101, 84, 97, 114, 103, 101,
+ 116, 95, 85, 110, 105, 116, 121, 83, 116, 97,
+ 110, 100, 97, 114, 100, 95, 80, 114, 101, 102,
+ 97, 98, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 97, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 73, 50, 92, 76, 111, 99, 97, 108,
+ 105, 122, 97, 116, 105, 111, 110, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 84, 97, 114, 103,
+ 101, 116, 115, 92, 76, 111, 99, 97, 108, 105,
+ 122, 101, 84, 97, 114, 103, 101, 116, 95, 85,
+ 110, 105, 116, 121, 83, 116, 97, 110, 100, 97,
+ 114, 100, 95, 83, 112, 114, 105, 116, 101, 82,
+ 101, 110, 100, 101, 114, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 91, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 73, 50, 92,
+ 76, 111, 99, 97, 108, 105, 122, 97, 116, 105,
+ 111, 110, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 84, 97, 114, 103, 101, 116, 115, 92, 76,
+ 111, 99, 97, 108, 105, 122, 101, 84, 97, 114,
+ 103, 101, 116, 95, 85, 110, 105, 116, 121, 83,
+ 116, 97, 110, 100, 97, 114, 100, 95, 84, 101,
+ 120, 116, 77, 101, 115, 104, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 94, 92, 65, 115,
+ 115, 101, 116, 115, 92, 84, 104, 105, 114, 100,
+ 80, 97, 114, 116, 121, 92, 73, 50, 92, 76,
+ 111, 99, 97, 108, 105, 122, 97, 116, 105, 111,
+ 110, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 84, 97, 114, 103, 101, 116, 115, 92, 76, 111,
+ 99, 97, 108, 105, 122, 101, 84, 97, 114, 103,
+ 101, 116, 95, 85, 110, 105, 116, 121, 83, 116,
+ 97, 110, 100, 97, 114, 100, 95, 86, 105, 100,
+ 101, 111, 80, 108, 97, 121, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 82, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 73, 50,
+ 92, 76, 111, 99, 97, 108, 105, 122, 97, 116,
+ 105, 111, 110, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 84, 97, 114, 103, 101, 116, 115, 92,
+ 76, 111, 99, 97, 108, 105, 122, 101, 84, 97,
+ 114, 103, 101, 116, 95, 85, 110, 105, 116, 121,
+ 85, 73, 95, 73, 109, 97, 103, 101, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 85, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 73, 50,
+ 92, 76, 111, 99, 97, 108, 105, 122, 97, 116,
+ 105, 111, 110, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 84, 97, 114, 103, 101, 116, 115, 92,
+ 76, 111, 99, 97, 108, 105, 122, 101, 84, 97,
+ 114, 103, 101, 116, 95, 85, 110, 105, 116, 121,
+ 85, 73, 95, 82, 97, 119, 73, 109, 97, 103,
+ 101, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 81, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 73, 50, 92, 76, 111, 99, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 84, 97, 114, 103, 101,
+ 116, 115, 92, 76, 111, 99, 97, 108, 105, 122,
+ 101, 84, 97, 114, 103, 101, 116, 95, 85, 110,
+ 105, 116, 121, 85, 73, 95, 84, 101, 120, 116,
+ 46, 99, 115, 0, 0, 0, 2, 0, 0, 0,
+ 54, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 73, 50, 92, 76, 111, 99, 97, 108, 105, 122,
+ 97, 116, 105, 111, 110, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 84, 101, 114, 109, 68, 97,
+ 116, 97, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 73, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 73, 50, 92, 76, 111, 99, 97, 108,
+ 105, 122, 97, 116, 105, 111, 110, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 116, 105, 108,
+ 115, 92, 65, 117, 116, 111, 67, 104, 97, 110,
+ 103, 101, 67, 117, 108, 116, 117, 114, 101, 73,
+ 110, 102, 111, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 68, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 73, 50, 92, 76, 111, 99, 97,
+ 108, 105, 122, 97, 116, 105, 111, 110, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 116, 105,
+ 108, 115, 92, 67, 111, 114, 111, 117, 116, 105,
+ 110, 101, 77, 97, 110, 97, 103, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 74,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 73,
+ 50, 92, 76, 111, 99, 97, 108, 105, 122, 97,
+ 116, 105, 111, 110, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 85, 116, 105, 108, 115, 92, 67,
+ 117, 115, 116, 111, 109, 76, 111, 99, 97, 108,
+ 105, 122, 101, 67, 97, 108, 108, 98, 97, 99,
+ 107, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 62, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 73, 50, 92, 76, 111, 99, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 116, 105, 108, 115,
+ 92, 72, 105, 110, 100, 105, 70, 105, 120, 101,
+ 114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 59, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 73, 50, 92, 76, 111, 99, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 116, 105, 108, 115,
+ 92, 73, 50, 85, 116, 105, 108, 115, 46, 99,
+ 115, 0, 0, 0, 3, 0, 0, 0, 77, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 73, 50,
+ 92, 76, 111, 99, 97, 108, 105, 122, 97, 116,
+ 105, 111, 110, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 85, 116, 105, 108, 115, 92, 76, 111,
+ 99, 97, 108, 105, 122, 97, 116, 105, 111, 110,
+ 80, 97, 114, 97, 109, 115, 77, 97, 110, 97,
+ 103, 101, 114, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 67, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 73, 50, 92, 76, 111, 99, 97,
+ 108, 105, 122, 97, 116, 105, 111, 110, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 116, 105,
+ 108, 115, 92, 76, 111, 99, 97, 108, 105, 122,
+ 101, 100, 83, 116, 114, 105, 110, 103, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 88, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 73, 50,
+ 92, 76, 111, 99, 97, 108, 105, 122, 97, 116,
+ 105, 111, 110, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 85, 116, 105, 108, 115, 92, 82, 101,
+ 103, 105, 115, 116, 101, 114, 67, 97, 108, 108,
+ 98, 97, 99, 107, 95, 65, 108, 108, 111, 119,
+ 83, 121, 110, 99, 70, 114, 111, 109, 71, 111,
+ 111, 103, 108, 101, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 76, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 73, 50, 92, 76, 111, 99,
+ 97, 108, 105, 122, 97, 116, 105, 111, 110, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 85, 116,
+ 105, 108, 115, 92, 82, 101, 103, 105, 115, 116,
+ 101, 114, 71, 108, 111, 98, 97, 108, 80, 97,
+ 114, 97, 109, 101, 116, 101, 114, 115, 46, 99,
+ 115, 0, 0, 0, 2, 0, 0, 0, 67, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 73, 50,
+ 92, 76, 111, 99, 97, 108, 105, 122, 97, 116,
+ 105, 111, 110, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 85, 116, 105, 108, 115, 92, 82, 101,
+ 115, 111, 117, 114, 99, 101, 77, 97, 110, 97,
+ 103, 101, 114, 46, 99, 115, 0, 0, 0, 5,
+ 0, 0, 0, 60, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 73, 50, 92, 76, 111, 99, 97,
+ 108, 105, 122, 97, 116, 105, 111, 110, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 85, 116, 105,
+ 108, 115, 92, 82, 84, 76, 70, 105, 120, 101,
+ 114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 63, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 73, 50, 92, 76, 111, 99, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 116, 105, 108, 115,
+ 92, 83, 101, 116, 76, 97, 110, 103, 117, 97,
+ 103, 101, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 71, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 73, 50, 92, 76, 111, 99, 97, 108,
+ 105, 122, 97, 116, 105, 111, 110, 92, 83, 99,
+ 114, 105, 112, 116, 115, 92, 85, 116, 105, 108,
+ 115, 92, 83, 101, 116, 76, 97, 110, 103, 117,
+ 97, 103, 101, 68, 114, 111, 112, 100, 111, 119,
+ 110, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 68, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 73, 50, 92, 76, 111, 99, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 85, 116, 105, 108, 115,
+ 92, 83, 116, 114, 105, 110, 103, 79, 98, 102,
+ 117, 115, 99, 97, 116, 111, 114, 46, 99, 115,
+ 0, 0, 0, 3, 0, 0, 0, 68, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 92, 67, 111, 114, 101, 92, 49, 46, 68, 97,
+ 116, 97, 83, 116, 114, 117, 99, 116, 117, 114,
+ 101, 115, 92, 66, 105, 110, 97, 114, 121, 84,
+ 114, 101, 101, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 95, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 92, 67, 111, 114,
+ 101, 92, 49, 48, 46, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 83, 111, 117, 114, 99,
+ 101, 84, 114, 97, 99, 107, 101, 114, 92, 83,
+ 111, 117, 114, 99, 101, 84, 114, 97, 99, 107,
+ 101, 114, 92, 83, 111, 117, 114, 99, 101, 84,
+ 114, 97, 99, 107, 101, 114, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 116, 92, 65, 115,
+ 115, 101, 116, 115, 92, 84, 104, 105, 114, 100,
+ 80, 97, 114, 116, 121, 92, 77, 101, 115, 104,
+ 70, 117, 115, 105, 111, 110, 80, 114, 111, 92,
+ 67, 111, 114, 101, 92, 49, 48, 46, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 83, 111,
+ 117, 114, 99, 101, 84, 114, 97, 99, 107, 101,
+ 114, 92, 83, 111, 117, 114, 99, 101, 84, 114,
+ 97, 99, 107, 101, 114, 92, 83, 116, 114, 97,
+ 116, 101, 103, 105, 101, 115, 92, 73, 83, 111,
+ 117, 114, 99, 101, 84, 114, 97, 99, 107, 105,
+ 110, 103, 83, 116, 114, 97, 116, 101, 103, 121,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 118, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 92, 67, 111, 114, 101, 92, 49,
+ 48, 46, 77, 101, 115, 104, 70, 117, 115, 105,
+ 111, 110, 83, 111, 117, 114, 99, 101, 84, 114,
+ 97, 99, 107, 101, 114, 92, 83, 111, 117, 114,
+ 99, 101, 84, 114, 97, 99, 107, 101, 114, 92,
+ 83, 116, 114, 97, 116, 101, 103, 105, 101, 115,
+ 92, 82, 105, 103, 105, 100, 98, 111, 100, 121,
+ 84, 114, 97, 99, 107, 105, 110, 103, 83, 116,
+ 114, 97, 116, 101, 103, 121, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 118, 92, 65, 115,
+ 115, 101, 116, 115, 92, 84, 104, 105, 114, 100,
+ 80, 97, 114, 116, 121, 92, 77, 101, 115, 104,
+ 70, 117, 115, 105, 111, 110, 80, 114, 111, 92,
+ 67, 111, 114, 101, 92, 49, 48, 46, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 83, 111,
+ 117, 114, 99, 101, 84, 114, 97, 99, 107, 101,
+ 114, 92, 83, 111, 117, 114, 99, 101, 84, 114,
+ 97, 99, 107, 101, 114, 92, 83, 116, 114, 97,
+ 116, 101, 103, 105, 101, 115, 92, 84, 114, 97,
+ 110, 115, 102, 111, 114, 109, 84, 114, 97, 99,
+ 107, 105, 110, 103, 83, 116, 114, 97, 116, 101,
+ 103, 121, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 75, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 77, 101, 115, 104, 70, 117, 115, 105,
+ 111, 110, 80, 114, 111, 92, 67, 111, 114, 101,
+ 92, 50, 46, 77, 101, 115, 104, 84, 111, 111,
+ 108, 115, 92, 68, 97, 116, 97, 92, 76, 105,
+ 103, 104, 116, 119, 101, 105, 103, 104, 116, 86,
+ 101, 114, 116, 101, 120, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 73, 92, 65, 115, 115,
+ 101, 116, 115, 92, 84, 104, 105, 114, 100, 80,
+ 97, 114, 116, 121, 92, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 80, 114, 111, 92, 67,
+ 111, 114, 101, 92, 50, 46, 77, 101, 115, 104,
+ 84, 111, 111, 108, 115, 92, 68, 97, 116, 97,
+ 92, 77, 101, 115, 104, 67, 111, 109, 98, 105,
+ 110, 101, 73, 110, 102, 111, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 73, 92, 65, 115,
+ 115, 101, 116, 115, 92, 84, 104, 105, 114, 100,
+ 80, 97, 114, 116, 121, 92, 77, 101, 115, 104,
+ 70, 117, 115, 105, 111, 110, 80, 114, 111, 92,
+ 67, 111, 114, 101, 92, 50, 46, 77, 101, 115,
+ 104, 84, 111, 111, 108, 115, 92, 68, 97, 116,
+ 97, 92, 77, 101, 115, 104, 67, 117, 116, 116,
+ 105, 110, 103, 73, 110, 102, 111, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 77, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 92, 67, 111, 114, 101, 92, 50, 46, 77, 101,
+ 115, 104, 84, 111, 111, 108, 115, 92, 73, 110,
+ 116, 101, 114, 102, 97, 99, 101, 115, 92, 73,
+ 77, 101, 115, 104, 67, 111, 109, 98, 105, 110,
+ 101, 114, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 75, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 77, 101, 115, 104, 70, 117, 115, 105,
+ 111, 110, 80, 114, 111, 92, 67, 111, 114, 101,
+ 92, 50, 46, 77, 101, 115, 104, 84, 111, 111,
+ 108, 115, 92, 73, 110, 116, 101, 114, 102, 97,
+ 99, 101, 115, 92, 73, 77, 101, 115, 104, 67,
+ 117, 116, 116, 101, 114, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 88, 92, 65, 115, 115,
+ 101, 116, 115, 92, 84, 104, 105, 114, 100, 80,
+ 97, 114, 116, 121, 92, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 80, 114, 111, 92, 67,
+ 111, 114, 101, 92, 50, 46, 77, 101, 115, 104,
+ 84, 111, 111, 108, 115, 92, 76, 111, 103, 105,
+ 99, 92, 77, 101, 115, 104, 67, 111, 109, 98,
+ 105, 110, 101, 114, 92, 77, 101, 115, 104, 67,
+ 111, 109, 98, 105, 110, 101, 114, 66, 97, 115,
+ 101, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 92, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 92, 67, 111, 114, 101, 92,
+ 50, 46, 77, 101, 115, 104, 84, 111, 111, 108,
+ 115, 92, 76, 111, 103, 105, 99, 92, 77, 101,
+ 115, 104, 67, 111, 109, 98, 105, 110, 101, 114,
+ 92, 77, 101, 115, 104, 67, 111, 109, 98, 105,
+ 110, 101, 114, 83, 105, 109, 112, 108, 101, 76,
+ 87, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 93, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 92, 67, 111, 114, 101, 92,
+ 50, 46, 77, 101, 115, 104, 84, 111, 111, 108,
+ 115, 92, 76, 111, 103, 105, 99, 92, 77, 101,
+ 115, 104, 67, 111, 109, 98, 105, 110, 101, 114,
+ 92, 77, 101, 115, 104, 67, 111, 109, 98, 105,
+ 110, 101, 114, 83, 105, 109, 112, 108, 101, 83,
+ 84, 68, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 88, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 77, 101, 115, 104, 70, 117, 115, 105,
+ 111, 110, 80, 114, 111, 92, 67, 111, 114, 101,
+ 92, 50, 46, 77, 101, 115, 104, 84, 111, 111,
+ 108, 115, 92, 76, 111, 103, 105, 99, 92, 77,
+ 101, 115, 104, 67, 117, 116, 116, 101, 114, 92,
+ 77, 101, 115, 104, 67, 117, 116, 116, 101, 114,
+ 83, 105, 109, 112, 108, 101, 76, 87, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 89, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 92, 67, 111, 114, 101, 92, 50, 46, 77,
+ 101, 115, 104, 84, 111, 111, 108, 115, 92, 76,
+ 111, 103, 105, 99, 92, 77, 101, 115, 104, 67,
+ 117, 116, 116, 101, 114, 92, 77, 101, 115, 104,
+ 67, 117, 116, 116, 101, 114, 83, 105, 109, 112,
+ 108, 101, 83, 84, 68, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 92, 92, 65, 115, 115,
+ 101, 116, 115, 92, 84, 104, 105, 114, 100, 80,
+ 97, 114, 116, 121, 92, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 80, 114, 111, 92, 67,
+ 111, 114, 101, 92, 50, 46, 77, 101, 115, 104,
+ 84, 111, 111, 108, 115, 92, 76, 111, 103, 105,
+ 99, 92, 77, 101, 115, 104, 83, 101, 112, 97,
+ 114, 97, 116, 111, 114, 92, 77, 101, 115, 104,
+ 83, 101, 112, 97, 114, 97, 116, 111, 114, 83,
+ 105, 109, 112, 108, 101, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 80, 92, 65, 115, 115,
+ 101, 116, 115, 92, 84, 104, 105, 114, 100, 80,
+ 97, 114, 116, 121, 92, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 80, 114, 111, 92, 67,
+ 111, 114, 101, 92, 50, 46, 77, 101, 115, 104,
+ 84, 111, 111, 108, 115, 92, 76, 111, 103, 105,
+ 99, 92, 85, 116, 105, 108, 92, 86, 101, 114,
+ 116, 101, 120, 66, 117, 102, 102, 101, 114, 85,
+ 116, 105, 108, 46, 99, 115, 0, 0, 0, 2,
+ 0, 0, 0, 74, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 92, 67, 111, 114,
+ 101, 92, 51, 46, 67, 111, 109, 98, 105, 110,
+ 101, 100, 77, 101, 115, 104, 92, 76, 111, 103,
+ 105, 99, 92, 67, 111, 109, 98, 105, 110, 101,
+ 100, 77, 101, 115, 104, 46, 99, 115, 0, 0,
+ 0, 2, 0, 0, 0, 78, 92, 65, 115, 115,
+ 101, 116, 115, 92, 84, 104, 105, 114, 100, 80,
+ 97, 114, 116, 121, 92, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 80, 114, 111, 92, 67,
+ 111, 114, 101, 92, 51, 46, 67, 111, 109, 98,
+ 105, 110, 101, 100, 77, 101, 115, 104, 92, 76,
+ 111, 103, 105, 99, 92, 67, 111, 109, 98, 105,
+ 110, 101, 100, 77, 101, 115, 104, 68, 97, 116,
+ 97, 46, 99, 115, 0, 0, 0, 2, 0, 0,
+ 0, 78, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 92, 67, 111, 114, 101, 92,
+ 51, 46, 67, 111, 109, 98, 105, 110, 101, 100,
+ 77, 101, 115, 104, 92, 76, 111, 103, 105, 99,
+ 92, 67, 111, 109, 98, 105, 110, 101, 100, 77,
+ 101, 115, 104, 80, 97, 114, 116, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 89, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 92, 67, 111, 114, 101, 92, 51, 46, 67, 111,
+ 109, 98, 105, 110, 101, 100, 77, 101, 115, 104,
+ 92, 77, 101, 115, 104, 68, 97, 116, 97, 86,
+ 97, 114, 105, 97, 110, 116, 115, 92, 77, 101,
+ 115, 104, 68, 97, 116, 97, 76, 105, 115, 116,
+ 115, 83, 84, 68, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 95, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 77, 101, 115, 104, 70, 117,
+ 115, 105, 111, 110, 80, 114, 111, 92, 67, 111,
+ 114, 101, 92, 51, 46, 67, 111, 109, 98, 105,
+ 110, 101, 100, 77, 101, 115, 104, 92, 77, 101,
+ 115, 104, 68, 97, 116, 97, 86, 97, 114, 105,
+ 97, 110, 116, 115, 92, 77, 101, 115, 104, 68,
+ 97, 116, 97, 78, 97, 116, 105, 118, 101, 65,
+ 114, 114, 97, 121, 115, 76, 87, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 96, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 92, 67, 111, 114, 101, 92, 51, 46, 67, 111,
+ 109, 98, 105, 110, 101, 100, 77, 101, 115, 104,
+ 92, 77, 101, 115, 104, 68, 97, 116, 97, 86,
+ 97, 114, 105, 97, 110, 116, 115, 92, 77, 101,
+ 115, 104, 68, 97, 116, 97, 78, 97, 116, 105,
+ 118, 101, 65, 114, 114, 97, 121, 115, 83, 84,
+ 68, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 78, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 92, 67, 111, 114, 101, 92,
+ 52, 46, 67, 111, 109, 98, 105, 110, 101, 100,
+ 77, 101, 115, 104, 77, 111, 118, 101, 114, 92,
+ 68, 97, 116, 97, 92, 80, 97, 114, 116, 77,
+ 111, 118, 101, 73, 110, 102, 111, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 95, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 92, 67, 111, 114, 101, 92, 52, 46, 67, 111,
+ 109, 98, 105, 110, 101, 100, 77, 101, 115, 104,
+ 77, 111, 118, 101, 114, 92, 73, 110, 116, 101,
+ 114, 102, 97, 99, 101, 115, 92, 73, 65, 115,
+ 121, 110, 99, 67, 111, 109, 98, 105, 110, 101,
+ 100, 77, 101, 115, 104, 77, 111, 118, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 90, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 92, 67, 111, 114, 101, 92, 52,
+ 46, 67, 111, 109, 98, 105, 110, 101, 100, 77,
+ 101, 115, 104, 77, 111, 118, 101, 114, 92, 73,
+ 110, 116, 101, 114, 102, 97, 99, 101, 115, 92,
+ 73, 67, 111, 109, 98, 105, 110, 101, 100, 77,
+ 101, 115, 104, 77, 111, 118, 101, 114, 46, 99,
+ 115, 0, 0, 0, 3, 0, 0, 0, 82, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 92, 67, 111, 114, 101, 92, 52, 46, 67,
+ 111, 109, 98, 105, 110, 101, 100, 77, 101, 115,
+ 104, 77, 111, 118, 101, 114, 92, 76, 111, 103,
+ 105, 99, 92, 74, 111, 98, 115, 77, 101, 115,
+ 104, 77, 111, 118, 101, 114, 76, 87, 46, 99,
+ 115, 0, 0, 0, 3, 0, 0, 0, 83, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 92, 67, 111, 114, 101, 92, 52, 46, 67,
+ 111, 109, 98, 105, 110, 101, 100, 77, 101, 115,
+ 104, 77, 111, 118, 101, 114, 92, 76, 111, 103,
+ 105, 99, 92, 74, 111, 98, 115, 77, 101, 115,
+ 104, 77, 111, 118, 101, 114, 83, 84, 68, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 85,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 92, 67, 111, 114, 101, 92, 52, 46,
+ 67, 111, 109, 98, 105, 110, 101, 100, 77, 101,
+ 115, 104, 77, 111, 118, 101, 114, 92, 76, 111,
+ 103, 105, 99, 92, 83, 105, 109, 112, 108, 101,
+ 77, 101, 115, 104, 77, 111, 118, 101, 114, 83,
+ 84, 68, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 82, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 77, 101, 115, 104, 70, 117, 115, 105,
+ 111, 110, 80, 114, 111, 92, 67, 111, 114, 101,
+ 92, 53, 46, 70, 97, 99, 116, 111, 114, 121,
+ 92, 73, 110, 116, 101, 114, 102, 97, 99, 101,
+ 115, 92, 73, 67, 111, 109, 98, 105, 110, 101,
+ 100, 77, 101, 115, 104, 70, 97, 99, 116, 111,
+ 114, 121, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 79, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 77, 101, 115, 104, 70, 117, 115, 105,
+ 111, 110, 80, 114, 111, 92, 67, 111, 114, 101,
+ 92, 53, 46, 70, 97, 99, 116, 111, 114, 121,
+ 92, 73, 110, 116, 101, 114, 102, 97, 99, 101,
+ 115, 92, 73, 77, 101, 115, 104, 84, 111, 111,
+ 108, 115, 70, 97, 99, 116, 111, 114, 121, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 89,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 92, 67, 111, 114, 101, 92, 53, 46,
+ 70, 97, 99, 116, 111, 114, 121, 92, 73, 110,
+ 116, 101, 114, 102, 97, 99, 101, 115, 92, 73,
+ 77, 111, 118, 97, 98, 108, 101, 67, 111, 109,
+ 98, 105, 110, 101, 100, 77, 101, 115, 104, 70,
+ 97, 99, 116, 111, 114, 121, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 76, 92, 65, 115,
+ 115, 101, 116, 115, 92, 84, 104, 105, 114, 100,
+ 80, 97, 114, 116, 121, 92, 77, 101, 115, 104,
+ 70, 117, 115, 105, 111, 110, 80, 114, 111, 92,
+ 67, 111, 114, 101, 92, 53, 46, 70, 97, 99,
+ 116, 111, 114, 121, 92, 76, 111, 103, 105, 99,
+ 92, 67, 111, 109, 98, 105, 110, 101, 100, 77,
+ 101, 115, 104, 70, 97, 99, 116, 111, 114, 121,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 96, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 92, 67, 111, 114, 101, 92, 53,
+ 46, 70, 97, 99, 116, 111, 114, 121, 92, 76,
+ 111, 103, 105, 99, 92, 77, 101, 115, 104, 84,
+ 111, 111, 108, 115, 70, 97, 99, 116, 111, 114,
+ 105, 101, 115, 92, 83, 105, 109, 112, 108, 101,
+ 84, 111, 111, 108, 115, 76, 87, 70, 97, 99,
+ 116, 111, 114, 121, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 97, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 77, 101, 115, 104, 70, 117,
+ 115, 105, 111, 110, 80, 114, 111, 92, 67, 111,
+ 114, 101, 92, 53, 46, 70, 97, 99, 116, 111,
+ 114, 121, 92, 76, 111, 103, 105, 99, 92, 77,
+ 101, 115, 104, 84, 111, 111, 108, 115, 70, 97,
+ 99, 116, 111, 114, 105, 101, 115, 92, 83, 105,
+ 109, 112, 108, 101, 84, 111, 111, 108, 115, 83,
+ 84, 68, 70, 97, 99, 116, 111, 114, 121, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 102,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 92, 67, 111, 114, 101, 92, 53, 46,
+ 70, 97, 99, 116, 111, 114, 121, 92, 76, 111,
+ 103, 105, 99, 92, 77, 111, 118, 97, 98, 108,
+ 101, 77, 101, 115, 104, 70, 97, 99, 116, 111,
+ 114, 105, 101, 115, 92, 74, 111, 98, 115, 77,
+ 111, 118, 97, 98, 108, 101, 77, 101, 115, 104,
+ 76, 87, 70, 97, 99, 116, 111, 114, 121, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 103,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 92, 67, 111, 114, 101, 92, 53, 46,
+ 70, 97, 99, 116, 111, 114, 121, 92, 76, 111,
+ 103, 105, 99, 92, 77, 111, 118, 97, 98, 108,
+ 101, 77, 101, 115, 104, 70, 97, 99, 116, 111,
+ 114, 105, 101, 115, 92, 74, 111, 98, 115, 77,
+ 111, 118, 97, 98, 108, 101, 77, 101, 115, 104,
+ 83, 84, 68, 70, 97, 99, 116, 111, 114, 121,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 105, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 92, 67, 111, 114, 101, 92, 53,
+ 46, 70, 97, 99, 116, 111, 114, 121, 92, 76,
+ 111, 103, 105, 99, 92, 77, 111, 118, 97, 98,
+ 108, 101, 77, 101, 115, 104, 70, 97, 99, 116,
+ 111, 114, 105, 101, 115, 92, 83, 105, 109, 112,
+ 108, 101, 77, 111, 118, 97, 98, 108, 101, 77,
+ 101, 115, 104, 83, 84, 68, 70, 97, 99, 116,
+ 111, 114, 121, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 79, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 92, 67, 111, 114,
+ 101, 92, 54, 46, 67, 111, 109, 98, 105, 110,
+ 101, 100, 79, 98, 106, 101, 99, 116, 92, 68,
+ 97, 116, 97, 92, 82, 101, 110, 100, 101, 114,
+ 101, 114, 83, 101, 116, 116, 105, 110, 103, 115,
+ 46, 99, 115, 0, 0, 0, 2, 0, 0, 0,
+ 84, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 92, 67, 111, 114, 101, 92, 54,
+ 46, 67, 111, 109, 98, 105, 110, 101, 100, 79,
+ 98, 106, 101, 99, 116, 92, 73, 110, 116, 101,
+ 114, 102, 97, 99, 101, 115, 92, 73, 67, 111,
+ 109, 98, 105, 110, 101, 100, 79, 98, 106, 101,
+ 99, 116, 46, 99, 115, 0, 0, 0, 2, 0,
+ 0, 0, 88, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 77, 101, 115, 104, 70, 117, 115, 105,
+ 111, 110, 80, 114, 111, 92, 67, 111, 114, 101,
+ 92, 54, 46, 67, 111, 109, 98, 105, 110, 101,
+ 100, 79, 98, 106, 101, 99, 116, 92, 73, 110,
+ 116, 101, 114, 102, 97, 99, 101, 115, 92, 73,
+ 67, 111, 109, 98, 105, 110, 101, 100, 79, 98,
+ 106, 101, 99, 116, 80, 97, 114, 116, 46, 99,
+ 115, 0, 0, 0, 2, 0, 0, 0, 83, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 92, 67, 111, 114, 101, 92, 54, 46, 67,
+ 111, 109, 98, 105, 110, 101, 100, 79, 98, 106,
+ 101, 99, 116, 92, 73, 110, 116, 101, 114, 102,
+ 97, 99, 101, 115, 92, 73, 67, 111, 109, 98,
+ 105, 110, 101, 83, 111, 117, 114, 99, 101, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 83,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 92, 67, 111, 114, 101, 92, 54, 46,
+ 67, 111, 109, 98, 105, 110, 101, 100, 79, 98,
+ 106, 101, 99, 116, 92, 76, 111, 103, 105, 99,
+ 92, 66, 97, 115, 101, 92, 67, 111, 109, 98,
+ 105, 110, 101, 100, 79, 98, 106, 101, 99, 116,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 87, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 92, 67, 111, 114, 101, 92, 54,
+ 46, 67, 111, 109, 98, 105, 110, 101, 100, 79,
+ 98, 106, 101, 99, 116, 92, 76, 111, 103, 105,
+ 99, 92, 66, 97, 115, 101, 92, 67, 111, 109,
+ 98, 105, 110, 101, 100, 79, 98, 106, 101, 99,
+ 116, 80, 97, 114, 116, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 82, 92, 65, 115, 115,
+ 101, 116, 115, 92, 84, 104, 105, 114, 100, 80,
+ 97, 114, 116, 121, 92, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 80, 114, 111, 92, 67,
+ 111, 114, 101, 92, 54, 46, 67, 111, 109, 98,
+ 105, 110, 101, 100, 79, 98, 106, 101, 99, 116,
+ 92, 76, 111, 103, 105, 99, 92, 66, 97, 115,
+ 101, 92, 67, 111, 109, 98, 105, 110, 101, 83,
+ 111, 117, 114, 99, 101, 46, 99, 115, 0, 0,
+ 0, 1, 0, 0, 0, 93, 92, 65, 115, 115,
+ 101, 116, 115, 92, 84, 104, 105, 114, 100, 80,
+ 97, 114, 116, 121, 92, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 80, 114, 111, 92, 67,
+ 111, 114, 101, 92, 54, 46, 67, 111, 109, 98,
+ 105, 110, 101, 100, 79, 98, 106, 101, 99, 116,
+ 92, 76, 111, 103, 105, 99, 92, 68, 121, 110,
+ 97, 109, 105, 99, 92, 68, 121, 110, 97, 109,
+ 105, 99, 67, 111, 109, 98, 105, 110, 101, 100,
+ 79, 98, 106, 101, 99, 116, 46, 99, 115, 0,
+ 0, 0, 2, 0, 0, 0, 97, 92, 65, 115,
+ 115, 101, 116, 115, 92, 84, 104, 105, 114, 100,
+ 80, 97, 114, 116, 121, 92, 77, 101, 115, 104,
+ 70, 117, 115, 105, 111, 110, 80, 114, 111, 92,
+ 67, 111, 114, 101, 92, 54, 46, 67, 111, 109,
+ 98, 105, 110, 101, 100, 79, 98, 106, 101, 99,
+ 116, 92, 76, 111, 103, 105, 99, 92, 68, 121,
+ 110, 97, 109, 105, 99, 92, 68, 121, 110, 97,
+ 109, 105, 99, 67, 111, 109, 98, 105, 110, 101,
+ 100, 79, 98, 106, 101, 99, 116, 80, 97, 114,
+ 116, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 92, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 92, 67, 111, 114, 101, 92,
+ 54, 46, 67, 111, 109, 98, 105, 110, 101, 100,
+ 79, 98, 106, 101, 99, 116, 92, 76, 111, 103,
+ 105, 99, 92, 68, 121, 110, 97, 109, 105, 99,
+ 92, 68, 121, 110, 97, 109, 105, 99, 67, 111,
+ 109, 98, 105, 110, 101, 83, 111, 117, 114, 99,
+ 101, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 85, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 92, 67, 111, 114, 101, 92,
+ 55, 46, 79, 98, 106, 101, 99, 116, 115, 67,
+ 111, 109, 98, 105, 110, 101, 114, 92, 66, 97,
+ 115, 101, 92, 67, 111, 109, 98, 105, 110, 101,
+ 100, 79, 98, 106, 101, 99, 116, 77, 97, 116,
+ 99, 104, 101, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 79, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 77, 101, 115, 104, 70, 117,
+ 115, 105, 111, 110, 80, 114, 111, 92, 67, 111,
+ 114, 101, 92, 55, 46, 79, 98, 106, 101, 99,
+ 116, 115, 67, 111, 109, 98, 105, 110, 101, 114,
+ 92, 66, 97, 115, 101, 92, 79, 98, 106, 101,
+ 99, 116, 115, 67, 111, 109, 98, 105, 110, 101,
+ 114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 81, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 92, 67, 111, 114, 101, 92,
+ 55, 46, 79, 98, 106, 101, 99, 116, 115, 67,
+ 111, 109, 98, 105, 110, 101, 114, 92, 68, 121,
+ 110, 97, 109, 105, 99, 79, 98, 106, 101, 99,
+ 116, 115, 67, 111, 109, 98, 105, 110, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 76, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 92, 67, 111, 114, 101, 92, 55,
+ 46, 79, 98, 106, 101, 99, 116, 115, 67, 111,
+ 109, 98, 105, 110, 101, 114, 92, 76, 79, 68,
+ 71, 114, 111, 117, 112, 115, 67, 111, 109, 98,
+ 105, 110, 101, 114, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 91, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 77, 101, 115, 104, 70, 117,
+ 115, 105, 111, 110, 80, 114, 111, 92, 67, 111,
+ 114, 101, 92, 55, 46, 79, 98, 106, 101, 99,
+ 116, 115, 67, 111, 109, 98, 105, 110, 101, 114,
+ 92, 77, 97, 116, 99, 104, 101, 114, 115, 92,
+ 67, 111, 109, 98, 105, 110, 101, 100, 76, 79,
+ 68, 71, 114, 111, 117, 112, 77, 97, 116, 99,
+ 104, 101, 114, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 96, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 92, 67, 111, 114,
+ 101, 92, 55, 46, 79, 98, 106, 101, 99, 116,
+ 115, 67, 111, 109, 98, 105, 110, 101, 114, 92,
+ 77, 97, 116, 99, 104, 101, 114, 115, 92, 68,
+ 121, 110, 97, 109, 105, 99, 67, 111, 109, 98,
+ 105, 110, 101, 100, 79, 98, 106, 101, 99, 116,
+ 77, 97, 116, 99, 104, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 95, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 92, 67, 111, 114, 101, 92, 55, 46, 79, 98,
+ 106, 101, 99, 116, 115, 67, 111, 109, 98, 105,
+ 110, 101, 114, 92, 77, 97, 116, 99, 104, 101,
+ 114, 115, 92, 83, 116, 97, 116, 105, 99, 67,
+ 111, 109, 98, 105, 110, 101, 100, 79, 98, 106,
+ 101, 99, 116, 77, 97, 116, 99, 104, 101, 114,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 80, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 92, 67, 111, 114, 101, 92, 55,
+ 46, 79, 98, 106, 101, 99, 116, 115, 67, 111,
+ 109, 98, 105, 110, 101, 114, 92, 83, 116, 97,
+ 116, 105, 99, 79, 98, 106, 101, 99, 116, 115,
+ 67, 111, 109, 98, 105, 110, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 83, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 92, 67, 111, 114, 101, 92, 55, 46, 79,
+ 98, 106, 101, 99, 116, 115, 67, 111, 109, 98,
+ 105, 110, 101, 114, 92, 85, 110, 105, 118, 101,
+ 114, 115, 97, 108, 79, 98, 106, 101, 99, 116,
+ 115, 67, 111, 109, 98, 105, 110, 101, 114, 46,
+ 99, 115, 0, 0, 0, 2, 0, 0, 0, 76,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 92, 67, 111, 114, 101, 92, 56, 46,
+ 67, 111, 109, 98, 105, 110, 101, 100, 76, 79,
+ 68, 71, 114, 111, 117, 112, 92, 67, 111, 109,
+ 98, 105, 110, 101, 100, 76, 79, 68, 71, 114,
+ 111, 117, 112, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 80, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 92, 67, 111, 114,
+ 101, 92, 56, 46, 67, 111, 109, 98, 105, 110,
+ 101, 100, 76, 79, 68, 71, 114, 111, 117, 112,
+ 92, 67, 111, 109, 98, 105, 110, 101, 100, 76,
+ 79, 68, 71, 114, 111, 117, 112, 80, 97, 114,
+ 116, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 81, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 92, 67, 111, 114, 101, 92,
+ 56, 46, 67, 111, 109, 98, 105, 110, 101, 100,
+ 76, 79, 68, 71, 114, 111, 117, 112, 92, 76,
+ 79, 68, 71, 114, 111, 117, 112, 67, 111, 109,
+ 98, 105, 110, 101, 83, 111, 117, 114, 99, 101,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 76, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 92, 67, 111, 114, 101, 92, 56,
+ 46, 67, 111, 109, 98, 105, 110, 101, 100, 76,
+ 79, 68, 71, 114, 111, 117, 112, 92, 76, 79,
+ 68, 71, 114, 111, 117, 112, 83, 101, 116, 116,
+ 105, 110, 103, 115, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 89, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 77, 101, 115, 104, 70, 117,
+ 115, 105, 111, 110, 80, 114, 111, 92, 67, 111,
+ 114, 101, 92, 57, 46, 82, 117, 110, 116, 105,
+ 109, 101, 77, 101, 115, 104, 70, 117, 115, 105,
+ 111, 110, 92, 67, 111, 109, 98, 105, 110, 101,
+ 84, 114, 101, 101, 92, 66, 105, 110, 97, 114,
+ 121, 84, 114, 101, 101, 68, 114, 97, 119, 101,
+ 114, 46, 99, 115, 0, 0, 0, 2, 0, 0,
+ 0, 84, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 92, 67, 111, 114, 101, 92,
+ 57, 46, 82, 117, 110, 116, 105, 109, 101, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 92,
+ 67, 111, 109, 98, 105, 110, 101, 84, 114, 101,
+ 101, 92, 67, 111, 109, 98, 105, 110, 101, 84,
+ 114, 101, 101, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 89, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 92, 67, 111, 114,
+ 101, 92, 57, 46, 82, 117, 110, 116, 105, 109,
+ 101, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 92, 67, 111, 110, 116, 114, 111, 108, 108,
+ 101, 114, 92, 82, 117, 110, 116, 105, 109, 101,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 99, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 92, 67, 111, 114, 101, 92, 57,
+ 46, 82, 117, 110, 116, 105, 109, 101, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 92, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 83,
+ 111, 117, 114, 99, 101, 92, 66, 97, 115, 101,
+ 92, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 83, 111, 117, 114, 99, 101, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 101, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 92, 67, 111, 114, 101, 92, 57, 46, 82, 117,
+ 110, 116, 105, 109, 101, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 92, 77, 101, 115, 104,
+ 70, 117, 115, 105, 111, 110, 83, 111, 117, 114,
+ 99, 101, 92, 68, 121, 110, 97, 109, 105, 99,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 83, 111, 117, 114, 99, 101, 46, 99, 115, 0,
+ 0, 0, 1, 0, 0, 0, 97, 92, 65, 115,
+ 115, 101, 116, 115, 92, 84, 104, 105, 114, 100,
+ 80, 97, 114, 116, 121, 92, 77, 101, 115, 104,
+ 70, 117, 115, 105, 111, 110, 80, 114, 111, 92,
+ 67, 111, 114, 101, 92, 57, 46, 82, 117, 110,
+ 116, 105, 109, 101, 77, 101, 115, 104, 70, 117,
+ 115, 105, 111, 110, 92, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 83, 111, 117, 114, 99,
+ 101, 92, 76, 79, 68, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 83, 111, 117, 114, 99,
+ 101, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 100, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 92, 67, 111, 114, 101, 92,
+ 57, 46, 82, 117, 110, 116, 105, 109, 101, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 92,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 83, 111, 117, 114, 99, 101, 92, 83, 116, 97,
+ 116, 105, 99, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 83, 111, 117, 114, 99, 101, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 61,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 92, 67, 111, 114, 101, 92, 72, 101,
+ 108, 112, 101, 114, 115, 92, 66, 111, 117, 110,
+ 100, 115, 72, 101, 108, 112, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 61, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 92, 67, 111, 114, 101, 92, 72, 101, 108,
+ 112, 101, 114, 115, 92, 77, 97, 116, 114, 105,
+ 120, 72, 101, 108, 112, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 63, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 92, 67, 111, 114, 101, 92, 72, 101, 108, 112,
+ 101, 114, 115, 92, 82, 101, 110, 100, 101, 114,
+ 101, 114, 72, 101, 108, 112, 101, 114, 46, 99,
+ 115, 0, 0, 0, 9, 0, 0, 0, 86, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 82, 101,
+ 119, 105, 114, 101, 100, 92, 69, 120, 97, 109,
+ 112, 108, 101, 115, 92, 67, 111, 110, 116, 114,
+ 111, 108, 82, 101, 109, 97, 112, 112, 105, 110,
+ 103, 49, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 67, 111, 110, 116, 114, 111, 108, 82, 101,
+ 109, 97, 112, 112, 105, 110, 103, 68, 101, 109,
+ 111, 49, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 94, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 82, 101, 119, 105, 114, 101, 100, 92,
+ 69, 120, 97, 109, 112, 108, 101, 115, 92, 67,
+ 117, 115, 116, 111, 109, 67, 111, 110, 116, 114,
+ 111, 108, 108, 101, 114, 115, 84, 105, 108, 116,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 67,
+ 117, 115, 116, 111, 109, 67, 111, 110, 116, 114,
+ 111, 108, 108, 101, 114, 115, 84, 105, 108, 116,
+ 68, 101, 109, 111, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 90, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 82, 101, 119, 105, 114, 101,
+ 100, 92, 69, 120, 97, 109, 112, 108, 101, 115,
+ 92, 67, 117, 115, 116, 111, 109, 67, 111, 110,
+ 116, 114, 111, 108, 108, 101, 114, 115, 84, 111,
+ 117, 99, 104, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 67, 117, 115, 116, 111, 109, 67, 111,
+ 110, 116, 114, 111, 108, 108, 101, 114, 68, 101,
+ 109, 111, 46, 99, 115, 0, 0, 0, 1, 0,
+ 0, 0, 97, 92, 65, 115, 115, 101, 116, 115,
+ 92, 84, 104, 105, 114, 100, 80, 97, 114, 116,
+ 121, 92, 82, 101, 119, 105, 114, 101, 100, 92,
+ 69, 120, 97, 109, 112, 108, 101, 115, 92, 67,
+ 117, 115, 116, 111, 109, 67, 111, 110, 116, 114,
+ 111, 108, 108, 101, 114, 115, 84, 111, 117, 99,
+ 104, 92, 83, 99, 114, 105, 112, 116, 115, 92,
+ 67, 117, 115, 116, 111, 109, 67, 111, 110, 116,
+ 114, 111, 108, 108, 101, 114, 68, 101, 109, 111,
+ 95, 80, 108, 97, 121, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 88, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 82, 101, 119,
+ 105, 114, 101, 100, 92, 69, 120, 97, 109, 112,
+ 108, 101, 115, 92, 67, 117, 115, 116, 111, 109,
+ 67, 111, 110, 116, 114, 111, 108, 108, 101, 114,
+ 115, 84, 111, 117, 99, 104, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 84, 111, 117, 99, 104,
+ 66, 117, 116, 116, 111, 110, 69, 120, 97, 109,
+ 112, 108, 101, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 90, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 82, 101, 119, 105, 114, 101, 100,
+ 92, 69, 120, 97, 109, 112, 108, 101, 115, 92,
+ 67, 117, 115, 116, 111, 109, 67, 111, 110, 116,
+ 114, 111, 108, 108, 101, 114, 115, 84, 111, 117,
+ 99, 104, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 84, 111, 117, 99, 104, 74, 111, 121, 115,
+ 116, 105, 99, 107, 69, 120, 97, 109, 112, 108,
+ 101, 46, 99, 115, 0, 0, 0, 2, 0, 0,
+ 0, 105, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 82, 101, 119, 105, 114, 101, 100, 92, 69,
+ 120, 97, 109, 112, 108, 101, 115, 92, 68, 117,
+ 97, 108, 83, 104, 111, 99, 107, 52, 83, 112,
+ 101, 99, 105, 97, 108, 70, 101, 97, 116, 117,
+ 114, 101, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 68, 117, 97, 108, 83, 104, 111, 99,
+ 107, 52, 83, 112, 101, 99, 105, 97, 108, 70,
+ 101, 97, 116, 117, 114, 101, 115, 69, 120, 97,
+ 109, 112, 108, 101, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 86, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 82, 101, 119, 105, 114, 101,
+ 100, 92, 69, 120, 97, 109, 112, 108, 101, 115,
+ 92, 69, 105, 103, 104, 116, 80, 108, 97, 121,
+ 101, 114, 115, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 69, 105, 103, 104, 116, 80, 108, 97,
+ 121, 101, 114, 115, 69, 120, 97, 109, 112, 108,
+ 101, 95, 80, 108, 97, 121, 101, 114, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 112, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 82, 101,
+ 119, 105, 114, 101, 100, 92, 69, 120, 97, 109,
+ 112, 108, 101, 115, 92, 70, 97, 108, 108, 98,
+ 97, 99, 107, 74, 111, 121, 115, 116, 105, 99,
+ 107, 73, 100, 101, 110, 116, 105, 102, 105, 99,
+ 97, 116, 105, 111, 110, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 70, 97, 108, 108, 98, 97,
+ 99, 107, 74, 111, 121, 115, 116, 105, 99, 107,
+ 73, 100, 101, 110, 116, 105, 102, 105, 99, 97,
+ 116, 105, 111, 110, 68, 101, 109, 111, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 83, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 82, 101,
+ 119, 105, 114, 101, 100, 92, 69, 120, 97, 109,
+ 112, 108, 101, 115, 92, 71, 97, 109, 101, 112,
+ 97, 100, 84, 101, 109, 112, 108, 97, 116, 101,
+ 85, 73, 92, 83, 99, 114, 105, 112, 116, 115,
+ 92, 67, 111, 110, 116, 114, 111, 108, 108, 101,
+ 114, 85, 73, 69, 102, 102, 101, 99, 116, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 84,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 82,
+ 101, 119, 105, 114, 101, 100, 92, 69, 120, 97,
+ 109, 112, 108, 101, 115, 92, 71, 97, 109, 101,
+ 112, 97, 100, 84, 101, 109, 112, 108, 97, 116,
+ 101, 85, 73, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 67, 111, 110, 116, 114, 111, 108, 108,
+ 101, 114, 85, 73, 69, 108, 101, 109, 101, 110,
+ 116, 46, 99, 115, 0, 0, 0, 3, 0, 0,
+ 0, 82, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 82, 101, 119, 105, 114, 101, 100, 92, 69,
+ 120, 97, 109, 112, 108, 101, 115, 92, 71, 97,
+ 109, 101, 112, 97, 100, 84, 101, 109, 112, 108,
+ 97, 116, 101, 85, 73, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 71, 97, 109, 101, 112, 97,
+ 100, 84, 101, 109, 112, 108, 97, 116, 101, 85,
+ 73, 46, 99, 115, 0, 0, 0, 1, 0, 0,
+ 0, 89, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 82, 101, 119, 105, 114, 101, 100, 92, 69,
+ 120, 97, 109, 112, 108, 101, 115, 92, 80, 108,
+ 97, 121, 101, 114, 77, 111, 117, 115, 101, 83,
+ 112, 114, 105, 116, 101, 92, 83, 99, 114, 105,
+ 112, 116, 115, 92, 80, 108, 97, 121, 101, 114,
+ 77, 111, 117, 115, 101, 83, 112, 114, 105, 116,
+ 101, 69, 120, 97, 109, 112, 108, 101, 46, 99,
+ 115, 0, 0, 0, 1, 0, 0, 0, 98, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 82, 101,
+ 119, 105, 114, 101, 100, 92, 69, 120, 97, 109,
+ 112, 108, 101, 115, 92, 80, 108, 97, 121, 101,
+ 114, 77, 111, 117, 115, 101, 85, 110, 105, 116,
+ 121, 85, 73, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 80, 108, 97, 121, 101, 114, 80, 111,
+ 105, 110, 116, 101, 114, 69, 118, 101, 110, 116,
+ 72, 97, 110, 100, 108, 101, 114, 69, 120, 97,
+ 109, 112, 108, 101, 46, 99, 115, 0, 0, 0,
+ 1, 0, 0, 0, 75, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 82, 101, 119, 105, 114, 101,
+ 100, 92, 69, 120, 97, 109, 112, 108, 101, 115,
+ 92, 80, 108, 97, 121, 101, 114, 77, 111, 117,
+ 115, 101, 85, 110, 105, 116, 121, 85, 73, 92,
+ 83, 99, 114, 105, 112, 116, 115, 92, 85, 73,
+ 80, 111, 105, 110, 116, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 104, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 82, 101, 119,
+ 105, 114, 101, 100, 92, 69, 120, 97, 109, 112,
+ 108, 101, 115, 92, 80, 114, 101, 115, 115, 65,
+ 110, 121, 66, 117, 116, 116, 111, 110, 84, 111,
+ 74, 111, 105, 110, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 80, 114, 101, 115, 115, 65, 110,
+ 121, 66, 117, 116, 116, 111, 110, 84, 111, 74,
+ 111, 105, 110, 69, 120, 97, 109, 112, 108, 101,
+ 95, 65, 115, 115, 105, 103, 110, 101, 114, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 106,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 82,
+ 101, 119, 105, 114, 101, 100, 92, 69, 120, 97,
+ 109, 112, 108, 101, 115, 92, 80, 114, 101, 115,
+ 115, 65, 110, 121, 66, 117, 116, 116, 111, 110,
+ 84, 111, 74, 111, 105, 110, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 80, 114, 101, 115, 115,
+ 65, 110, 121, 66, 117, 116, 116, 111, 110, 84,
+ 111, 74, 111, 105, 110, 69, 120, 97, 109, 112,
+ 108, 101, 95, 71, 97, 109, 101, 80, 108, 97,
+ 121, 101, 114, 46, 99, 115, 0, 0, 0, 2,
+ 0, 0, 0, 96, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 82, 101, 119, 105, 114, 101, 100,
+ 92, 69, 120, 97, 109, 112, 108, 101, 115, 92,
+ 80, 114, 101, 115, 115, 83, 116, 97, 114, 116,
+ 84, 111, 74, 111, 105, 110, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 80, 114, 101, 115, 115,
+ 83, 116, 97, 114, 116, 84, 111, 74, 111, 105,
+ 110, 69, 120, 97, 109, 112, 108, 101, 95, 65,
+ 115, 115, 105, 103, 110, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 98, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 82, 101, 119,
+ 105, 114, 101, 100, 92, 69, 120, 97, 109, 112,
+ 108, 101, 115, 92, 80, 114, 101, 115, 115, 83,
+ 116, 97, 114, 116, 84, 111, 74, 111, 105, 110,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 80,
+ 114, 101, 115, 115, 83, 116, 97, 114, 116, 84,
+ 111, 74, 111, 105, 110, 69, 120, 97, 109, 112,
+ 108, 101, 95, 71, 97, 109, 101, 80, 108, 97,
+ 121, 101, 114, 46, 99, 115, 0, 0, 0, 1,
+ 0, 0, 0, 60, 92, 65, 115, 115, 101, 116,
+ 115, 92, 84, 104, 105, 114, 100, 80, 97, 114,
+ 116, 121, 92, 82, 101, 119, 105, 114, 101, 100,
+ 92, 69, 120, 97, 109, 112, 108, 101, 115, 92,
+ 83, 104, 97, 114, 101, 100, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 66, 117, 108, 108, 101,
+ 116, 46, 99, 115, 0, 0, 0, 3, 0, 0,
+ 0, 120, 92, 65, 115, 115, 101, 116, 115, 92,
+ 84, 104, 105, 114, 100, 80, 97, 114, 116, 121,
+ 92, 82, 101, 119, 105, 114, 101, 100, 92, 69,
+ 120, 97, 109, 112, 108, 101, 115, 92, 83, 105,
+ 109, 112, 108, 101, 67, 111, 109, 98, 105, 110,
+ 101, 100, 75, 101, 121, 98, 111, 97, 114, 100,
+ 77, 111, 117, 115, 101, 82, 101, 109, 97, 112,
+ 112, 105, 110, 103, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 83, 105, 109, 112, 108, 101, 67,
+ 111, 109, 98, 105, 110, 101, 100, 75, 101, 121,
+ 98, 111, 97, 114, 100, 77, 111, 117, 115, 101,
+ 82, 101, 109, 97, 112, 112, 105, 110, 103, 46,
+ 99, 115, 0, 0, 0, 2, 0, 0, 0, 92,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 82,
+ 101, 119, 105, 114, 101, 100, 92, 69, 120, 97,
+ 109, 112, 108, 101, 115, 92, 83, 105, 109, 112,
+ 108, 101, 67, 111, 110, 116, 114, 111, 108, 82,
+ 101, 109, 97, 112, 112, 105, 110, 103, 92, 83,
+ 99, 114, 105, 112, 116, 115, 92, 83, 105, 109,
+ 112, 108, 101, 67, 111, 110, 116, 114, 111, 108,
+ 82, 101, 109, 97, 112, 112, 105, 110, 103, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 72,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 82,
+ 101, 119, 105, 114, 101, 100, 92, 73, 110, 116,
+ 101, 103, 114, 97, 116, 105, 111, 110, 92, 85,
+ 110, 105, 116, 121, 85, 73, 92, 80, 108, 97,
+ 121, 101, 114, 80, 111, 105, 110, 116, 101, 114,
+ 69, 118, 101, 110, 116, 68, 97, 116, 97, 46,
+ 99, 115, 0, 0, 0, 1, 0, 0, 0, 68,
+ 92, 65, 115, 115, 101, 116, 115, 92, 84, 104,
+ 105, 114, 100, 80, 97, 114, 116, 121, 92, 82,
+ 101, 119, 105, 114, 101, 100, 92, 73, 110, 116,
+ 101, 103, 114, 97, 116, 105, 111, 110, 92, 85,
+ 110, 105, 116, 121, 85, 73, 92, 82, 101, 119,
+ 105, 114, 101, 100, 69, 118, 101, 110, 116, 83,
+ 121, 115, 116, 101, 109, 46, 99, 115, 0, 0,
+ 0, 5, 0, 0, 0, 75, 92, 65, 115, 115,
+ 101, 116, 115, 92, 84, 104, 105, 114, 100, 80,
+ 97, 114, 116, 121, 92, 82, 101, 119, 105, 114,
+ 101, 100, 92, 73, 110, 116, 101, 103, 114, 97,
+ 116, 105, 111, 110, 92, 85, 110, 105, 116, 121,
+ 85, 73, 92, 82, 101, 119, 105, 114, 101, 100,
+ 80, 111, 105, 110, 116, 101, 114, 73, 110, 112,
+ 117, 116, 77, 111, 100, 117, 108, 101, 46, 99,
+ 115, 0, 0, 0, 2, 0, 0, 0, 78, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 82, 101,
+ 119, 105, 114, 101, 100, 92, 73, 110, 116, 101,
+ 103, 114, 97, 116, 105, 111, 110, 92, 85, 110,
+ 105, 116, 121, 85, 73, 92, 82, 101, 119, 105,
+ 114, 101, 100, 83, 116, 97, 110, 100, 97, 108,
+ 111, 110, 101, 73, 110, 112, 117, 116, 77, 111,
+ 100, 117, 108, 101, 46, 99, 115, 0, 0, 0,
+ 13, 0, 0, 0, 86, 92, 65, 115, 115, 101,
+ 116, 115, 92, 84, 104, 105, 114, 100, 80, 97,
+ 114, 116, 121, 92, 82, 101, 119, 105, 114, 101,
+ 100, 92, 73, 110, 116, 101, 114, 110, 97, 108,
+ 92, 83, 99, 114, 105, 112, 116, 115, 92, 67,
+ 111, 110, 116, 114, 111, 108, 108, 101, 114, 84,
+ 101, 109, 112, 108, 97, 116, 101, 115, 92, 67,
+ 111, 110, 116, 114, 111, 108, 108, 101, 114, 84,
+ 101, 109, 112, 108, 97, 116, 101, 115, 46, 99,
+ 115, 0, 0, 0, 5, 0, 0, 0, 84, 92,
+ 65, 115, 115, 101, 116, 115, 92, 84, 104, 105,
+ 114, 100, 80, 97, 114, 116, 121, 92, 82, 101,
+ 119, 105, 114, 101, 100, 92, 73, 110, 116, 101,
+ 114, 110, 97, 108, 92, 83, 99, 114, 105, 112,
+ 116, 115, 92, 68, 97, 116, 97, 83, 116, 111,
+ 114, 97, 103, 101, 92, 85, 115, 101, 114, 68,
+ 97, 116, 97, 83, 116, 111, 114, 101, 95, 80,
+ 108, 97, 121, 101, 114, 80, 114, 101, 102, 115,
+ 46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
+ 59, 92, 65, 115, 115, 101, 116, 115, 92, 84,
+ 104, 105, 114, 100, 80, 97, 114, 116, 121, 92,
+ 82, 101, 119, 105, 114, 101, 100, 92, 73, 110,
+ 116, 101, 114, 110, 97, 108, 92, 83, 99, 114,
+ 105, 112, 116, 115, 92, 73, 110, 112, 117, 116,
+ 77, 97, 110, 97, 103, 101, 114, 46, 99, 115,
+ 0, 0, 0, 1, 0, 0, 0, 65, 92, 65,
+ 115, 115, 101, 116, 115, 92, 84, 104, 105, 114,
+ 100, 80, 97, 114, 116, 121, 92, 82, 101, 119,
+ 105, 114, 101, 100, 92, 73, 110, 116, 101, 114,
+ 110, 97, 108, 92, 83, 99, 114, 105, 112, 116,
+ 115, 92, 77, 105, 115, 99, 92, 69, 120, 116,
+ 101, 114, 110, 97, 108, 84, 111, 111, 108, 115,
+ 46, 99, 115, 0, 0, 0, 3, 0, 0, 0,
+ 53, 92, 65, 115, 115, 101, 116, 115, 92, 86,
+ 105, 115, 117, 97, 108, 115, 92, 67, 117, 115,
+ 116, 111, 109, 82, 101, 110, 100, 101, 114, 80,
+ 97, 115, 115, 92, 67, 117, 115, 116, 111, 109,
+ 80, 111, 115, 116, 80, 114, 111, 99, 101, 115,
+ 115, 46, 99, 115
+ };
+ result.TypesData = new byte[20800]
+ {
+ 0, 0, 0, 0, 29, 124, 65, 100, 100, 105,
+ 116, 105, 111, 110, 97, 108, 87, 101, 97, 112,
+ 111, 110, 69, 102, 102, 101, 99, 116, 83, 99,
+ 114, 105, 112, 116, 0, 0, 0, 0, 20, 124,
+ 65, 102, 116, 101, 114, 77, 97, 116, 99, 104,
+ 85, 73, 77, 97, 110, 97, 103, 101, 114, 0,
+ 0, 0, 0, 17, 124, 65, 105, 109, 98, 111,
+ 116, 80, 114, 111, 106, 101, 99, 116, 105, 108,
+ 101, 0, 0, 0, 0, 45, 65, 105, 109, 98,
+ 111, 116, 80, 114, 111, 106, 101, 99, 116, 105,
+ 108, 101, 124, 71, 97, 109, 101, 79, 98, 106,
+ 101, 99, 116, 84, 111, 68, 101, 115, 116, 114,
+ 111, 121, 65, 102, 116, 101, 114, 84, 105, 109,
+ 101, 0, 0, 0, 0, 18, 124, 65, 110, 99,
+ 105, 101, 110, 116, 83, 104, 114, 105, 110, 101,
+ 80, 101, 114, 107, 0, 0, 0, 0, 22, 124,
+ 65, 110, 105, 109, 97, 116, 101, 83, 105, 122,
+ 101, 65, 110, 100, 68, 101, 115, 116, 114, 111,
+ 121, 0, 0, 0, 0, 14, 124, 66, 111, 97,
+ 116, 65, 110, 105, 109, 97, 116, 105, 111, 110,
+ 0, 0, 0, 0, 14, 124, 75, 101, 121, 102,
+ 114, 97, 109, 101, 100, 66, 111, 115, 115, 0,
+ 0, 0, 0, 16, 124, 70, 114, 111, 109, 84,
+ 111, 65, 110, 105, 109, 97, 116, 105, 111, 110,
+ 0, 0, 0, 0, 21, 124, 79, 110, 101, 83,
+ 104, 111, 116, 65, 110, 105, 109, 97, 116, 105,
+ 111, 110, 66, 97, 115, 101, 0, 0, 0, 0,
+ 21, 124, 80, 108, 97, 121, 101, 114, 65, 116,
+ 116, 97, 99, 107, 65, 110, 105, 109, 97, 116,
+ 111, 114, 0, 0, 0, 0, 24, 124, 80, 108,
+ 97, 121, 101, 114, 65, 116, 116, 97, 99, 107,
+ 84, 97, 114, 103, 101, 116, 70, 97, 99, 101,
+ 114, 0, 0, 0, 0, 12, 124, 80, 108, 97,
+ 121, 101, 114, 83, 99, 101, 112, 116, 0, 0,
+ 0, 0, 18, 124, 80, 111, 115, 105, 116, 105,
+ 111, 110, 65, 110, 105, 109, 97, 116, 105, 111,
+ 110, 0, 0, 0, 0, 23, 124, 75, 101, 101,
+ 112, 82, 101, 108, 97, 116, 105, 118, 101, 82,
+ 111, 116, 97, 116, 105, 111, 110, 84, 111, 0,
+ 0, 0, 0, 8, 124, 87, 105, 103, 103, 108,
+ 101, 114, 0, 0, 0, 0, 24, 124, 87, 105,
+ 103, 103, 108, 101, 114, 65, 110, 105, 109, 97,
+ 116, 101, 100, 86, 101, 108, 111, 99, 105, 116,
+ 121, 0, 0, 0, 0, 22, 124, 87, 105, 103,
+ 103, 108, 101, 114, 65, 110, 105, 109, 97, 116,
+ 105, 111, 110, 83, 116, 97, 116, 101, 0, 0,
+ 0, 0, 16, 124, 87, 105, 103, 103, 108, 101,
+ 114, 86, 101, 108, 111, 99, 105, 116, 121, 0,
+ 0, 0, 0, 24, 124, 81, 117, 105, 99, 107,
+ 115, 108, 105, 110, 103, 66, 97, 114, 114, 101,
+ 108, 82, 111, 116, 97, 116, 111, 114, 0, 0,
+ 0, 0, 10, 124, 82, 97, 99, 101, 114, 82,
+ 111, 108, 108, 0, 0, 0, 0, 27, 124, 82,
+ 111, 116, 97, 116, 101, 70, 111, 114, 119, 97,
+ 114, 100, 84, 111, 82, 86, 79, 86, 101, 108,
+ 111, 99, 105, 116, 121, 0, 0, 0, 0, 15,
+ 124, 83, 99, 97, 108, 101, 65, 110, 105, 109,
+ 97, 116, 105, 111, 110, 0, 0, 0, 0, 11,
+ 124, 83, 99, 97, 108, 101, 80, 117, 108, 115,
+ 101, 0, 0, 0, 0, 14, 124, 83, 105, 109,
+ 112, 108, 101, 82, 111, 116, 97, 116, 111, 114,
+ 0, 0, 0, 0, 11, 124, 83, 105, 109, 112,
+ 108, 101, 87, 97, 108, 107, 0, 0, 0, 0,
+ 14, 124, 83, 112, 105, 110, 65, 110, 105, 109,
+ 97, 116, 105, 111, 110, 0, 0, 0, 0, 26,
+ 124, 83, 117, 112, 101, 114, 83, 105, 109, 112,
+ 108, 101, 79, 99, 101, 97, 110, 65, 110, 105,
+ 109, 97, 116, 105, 111, 110, 0, 0, 0, 0,
+ 19, 124, 85, 110, 105, 116, 65, 116, 116, 97,
+ 99, 107, 65, 110, 105, 109, 97, 116, 111, 114,
+ 0, 0, 0, 0, 27, 124, 85, 110, 105, 116,
+ 67, 111, 109, 109, 97, 110, 100, 82, 97, 100,
+ 105, 117, 115, 65, 110, 105, 109, 97, 116, 105,
+ 111, 110, 0, 0, 0, 0, 16, 124, 85, 110,
+ 105, 116, 83, 112, 97, 119, 110, 65, 112, 112,
+ 101, 97, 114, 0, 0, 0, 0, 19, 124, 65,
+ 112, 112, 108, 121, 72, 101, 114, 111, 85, 110,
+ 105, 116, 80, 101, 114, 107, 115, 0, 0, 0,
+ 0, 19, 124, 65, 117, 100, 105, 111, 68, 97,
+ 121, 78, 105, 103, 104, 116, 70, 97, 100, 101,
+ 114, 0, 0, 0, 0, 9, 124, 65, 117, 100,
+ 105, 111, 83, 101, 116, 0, 0, 0, 0, 18,
+ 65, 117, 100, 105, 111, 83, 101, 116, 124, 67,
+ 108, 105, 112, 65, 114, 114, 97, 121, 0, 0,
+ 0, 0, 20, 124, 71, 108, 111, 98, 97, 108,
+ 65, 117, 100, 105, 111, 76, 105, 115, 116, 101,
+ 110, 101, 114, 0, 0, 0, 0, 11, 124, 76,
+ 101, 118, 101, 108, 65, 117, 100, 105, 111, 0,
+ 0, 0, 0, 34, 76, 101, 118, 101, 108, 65,
+ 117, 100, 105, 111, 124, 67, 105, 118, 105, 108,
+ 105, 115, 97, 116, 105, 111, 110, 65, 117, 100,
+ 105, 111, 83, 111, 117, 114, 99, 101, 0, 0,
+ 0, 0, 43, 77, 111, 114, 101, 77, 111, 117,
+ 110, 116, 97, 105, 110, 115, 46, 70, 101, 101,
+ 100, 98, 97, 99, 107, 115, 124, 79, 110, 101,
+ 83, 104, 111, 116, 65, 117, 100, 105, 111, 84,
+ 114, 105, 103, 103, 101, 114, 0, 0, 0, 0,
+ 21, 124, 80, 108, 97, 121, 101, 114, 67, 104,
+ 97, 114, 97, 99, 116, 101, 114, 65, 117, 100,
+ 105, 111, 0, 0, 0, 0, 18, 124, 80, 108,
+ 97, 121, 101, 114, 87, 101, 97, 112, 111, 110,
+ 65, 117, 100, 105, 111, 0, 0, 0, 0, 24,
+ 124, 80, 108, 97, 121, 79, 110, 101, 83, 104,
+ 111, 116, 65, 102, 116, 101, 114, 83, 101, 99,
+ 111, 110, 100, 115, 0, 0, 0, 0, 16, 124,
+ 80, 114, 111, 106, 101, 99, 116, 105, 108, 101,
+ 65, 117, 100, 105, 111, 0, 0, 0, 0, 21,
+ 124, 80, 114, 111, 106, 101, 99, 116, 105, 108,
+ 101, 83, 112, 97, 119, 110, 65, 117, 100, 105,
+ 111, 0, 0, 0, 0, 23, 124, 84, 104, 114,
+ 111, 110, 101, 102, 97, 108, 108, 65, 117, 100,
+ 105, 111, 77, 97, 110, 97, 103, 101, 114, 0,
+ 0, 0, 0, 36, 84, 104, 114, 111, 110, 101,
+ 102, 97, 108, 108, 65, 117, 100, 105, 111, 77,
+ 97, 110, 97, 103, 101, 114, 124, 79, 110, 101,
+ 115, 104, 111, 116, 83, 111, 117, 114, 99, 101,
+ 0, 0, 0, 0, 10, 124, 85, 110, 105, 116,
+ 65, 117, 100, 105, 111, 0, 0, 0, 0, 11,
+ 124, 65, 117, 116, 111, 65, 116, 116, 97, 99,
+ 107, 0, 0, 0, 0, 24, 124, 65, 117, 116,
+ 111, 65, 116, 116, 97, 99, 107, 72, 105, 103,
+ 104, 101, 115, 116, 72, 101, 97, 108, 116, 104,
+ 0, 0, 0, 0, 23, 124, 65, 117, 116, 111,
+ 65, 116, 116, 97, 99, 107, 76, 111, 119, 101,
+ 115, 116, 72, 101, 97, 108, 116, 104, 0, 0,
+ 0, 0, 29, 124, 65, 117, 116, 111, 65, 116,
+ 116, 97, 99, 107, 76, 111, 119, 101, 115, 116,
+ 73, 110, 82, 97, 110, 103, 101, 77, 117, 108,
+ 116, 105, 0, 0, 0, 0, 17, 124, 65, 117,
+ 116, 111, 65, 116, 116, 97, 99, 107, 82, 97,
+ 110, 100, 111, 109, 0, 0, 0, 0, 16, 124,
+ 65, 117, 116, 111, 65, 116, 116, 97, 99, 107,
+ 84, 111, 119, 101, 114, 0, 0, 0, 0, 21,
+ 124, 65, 117, 116, 111, 65, 116, 116, 97, 99,
+ 107, 84, 119, 111, 84, 97, 114, 103, 101, 116,
+ 115, 0, 0, 0, 0, 22, 124, 65, 117, 116,
+ 111, 65, 116, 116, 97, 99, 107, 87, 105, 116,
+ 104, 87, 97, 114, 110, 105, 110, 103, 0, 0,
+ 0, 0, 13, 124, 65, 117, 116, 111, 68, 97,
+ 121, 78, 105, 103, 104, 116, 0, 0, 0, 0,
+ 11, 124, 65, 117, 116, 111, 82, 101, 118, 105,
+ 118, 101, 0, 0, 0, 0, 27, 124, 65, 117,
+ 116, 111, 85, 112, 103, 114, 97, 100, 101, 66,
+ 117, 105, 108, 100, 105, 110, 103, 79, 110, 83,
+ 116, 97, 114, 116, 0, 0, 0, 0, 20, 124,
+ 66, 97, 99, 107, 117, 112, 65, 117, 100, 105,
+ 111, 76, 105, 115, 116, 101, 110, 101, 114, 0,
+ 0, 0, 0, 19, 124, 66, 97, 108, 97, 110,
+ 99, 105, 110, 103, 80, 97, 114, 97, 109, 101,
+ 116, 101, 114, 0, 0, 0, 0, 20, 124, 66,
+ 97, 108, 97, 110, 99, 105, 110, 103, 80, 97,
+ 114, 97, 109, 101, 116, 101, 114, 115, 0, 0,
+ 0, 0, 34, 124, 83, 116, 114, 105, 110, 103,
+ 70, 108, 111, 97, 116, 83, 101, 114, 105, 97,
+ 108, 105, 122, 97, 98, 108, 101, 68, 105, 99,
+ 116, 105, 111, 110, 97, 114, 121, 0, 0, 0,
+ 0, 16, 124, 66, 97, 114, 114, 105, 99, 97,
+ 100, 101, 68, 97, 109, 97, 103, 101, 0, 0,
+ 0, 0, 15, 124, 66, 105, 108, 108, 98, 111,
+ 97, 114, 100, 65, 108, 105, 103, 110, 0, 0,
+ 0, 0, 18, 124, 66, 108, 97, 99, 107, 115,
+ 109, 105, 116, 104, 85, 112, 103, 114, 97, 100,
+ 101, 0, 0, 0, 0, 17, 124, 66, 108, 111,
+ 99, 107, 80, 114, 111, 106, 101, 99, 116, 105,
+ 108, 101, 115, 0, 0, 0, 0, 27, 124, 66,
+ 117, 105, 108, 100, 105, 110, 103, 68, 101, 115,
+ 116, 114, 117, 99, 116, 105, 111, 110, 72, 97,
+ 110, 100, 108, 101, 114, 0, 0, 0, 0, 20,
+ 124, 66, 117, 105, 108, 100, 105, 110, 103, 70,
+ 88, 80, 114, 111, 99, 101, 115, 115, 111, 114,
+ 0, 0, 0, 0, 22, 124, 66, 117, 105, 108,
+ 100, 105, 110, 103, 77, 101, 115, 104, 101, 115,
+ 84, 114, 97, 99, 107, 101, 114, 0, 0, 0,
+ 0, 20, 124, 66, 117, 105, 108, 100, 105, 110,
+ 103, 77, 101, 115, 104, 84, 114, 97, 99, 107,
+ 101, 114, 0, 0, 0, 0, 10, 124, 66, 117,
+ 105, 108, 100, 83, 108, 111, 116, 0, 0, 0,
+ 0, 17, 66, 117, 105, 108, 100, 83, 108, 111,
+ 116, 124, 85, 112, 103, 114, 97, 100, 101, 0,
+ 0, 0, 0, 23, 66, 117, 105, 108, 100, 83,
+ 108, 111, 116, 124, 85, 112, 103, 114, 97, 100,
+ 101, 66, 114, 97, 110, 99, 104, 0, 0, 0,
+ 0, 13, 124, 67, 97, 109, 101, 114, 97, 66,
+ 111, 117, 110, 100, 115, 0, 0, 0, 0, 17,
+ 124, 67, 97, 109, 101, 114, 97, 67, 111, 110,
+ 116, 114, 111, 108, 108, 101, 114, 0, 0, 0,
+ 0, 10, 124, 67, 97, 109, 101, 114, 97, 82,
+ 105, 103, 0, 0, 0, 0, 5, 124, 67, 111,
+ 105, 110, 0, 0, 0, 0, 12, 124, 67, 111,
+ 105, 110, 83, 112, 97, 119, 110, 101, 114, 0,
+ 0, 0, 0, 21, 124, 67, 111, 108, 111, 114,
+ 65, 110, 100, 76, 105, 103, 104, 116, 77, 97,
+ 110, 97, 103, 101, 114, 0, 0, 0, 0, 12,
+ 124, 67, 111, 108, 111, 114, 115, 99, 104, 101,
+ 109, 101, 0, 0, 0, 0, 22, 124, 68, 97,
+ 121, 116, 105, 109, 101, 83, 101, 110, 115, 105,
+ 116, 105, 118, 101, 76, 105, 103, 104, 116, 0,
+ 0, 0, 0, 12, 124, 67, 117, 114, 115, 101,
+ 69, 102, 102, 101, 99, 116, 0, 0, 0, 0,
+ 15, 124, 68, 97, 109, 97, 103, 101, 77, 111,
+ 100, 105, 102, 121, 101, 114, 0, 0, 0, 0,
+ 30, 124, 68, 97, 109, 97, 103, 101, 80, 108,
+ 97, 121, 101, 114, 87, 104, 101, 110, 69, 110,
+ 116, 101, 114, 105, 110, 103, 82, 97, 110, 103,
+ 101, 0, 0, 0, 0, 14, 124, 68, 97, 121,
+ 78, 105, 103, 104, 116, 67, 121, 99, 108, 101,
+ 0, 0, 0, 0, 31, 68, 97, 121, 78, 105,
+ 103, 104, 116, 67, 121, 99, 108, 101, 124, 73,
+ 68, 97, 121, 116, 105, 109, 101, 83, 101, 110,
+ 115, 105, 116, 105, 118, 101, 0, 0, 0, 0,
+ 27, 124, 68, 97, 121, 116, 105, 109, 101, 83,
+ 101, 110, 115, 105, 116, 105, 118, 101, 65, 99,
+ 116, 105, 118, 97, 116, 105, 111, 110, 0, 0,
+ 0, 0, 15, 124, 68, 97, 121, 116, 105, 109,
+ 101, 68, 105, 115, 112, 108, 97, 121, 0, 0,
+ 0, 0, 23, 124, 68, 101, 98, 117, 103, 66,
+ 117, 105, 108, 100, 105, 110, 103, 68, 101, 115,
+ 116, 114, 111, 121, 101, 114, 0, 0, 0, 0,
+ 17, 124, 68, 101, 98, 117, 103, 67, 111, 105,
+ 110, 68, 105, 115, 112, 108, 97, 121, 0, 0,
+ 0, 0, 16, 124, 68, 101, 98, 117, 103, 67,
+ 111, 110, 116, 114, 111, 108, 108, 101, 114, 0,
+ 0, 0, 0, 13, 124, 68, 101, 115, 116, 114,
+ 111, 121, 65, 102, 116, 101, 114, 0, 0, 0,
+ 0, 25, 124, 68, 101, 115, 116, 114, 111, 121,
+ 79, 114, 68, 105, 115, 97, 98, 108, 101, 79,
+ 110, 69, 110, 97, 98, 108, 101, 0, 0, 0,
+ 0, 15, 124, 68, 105, 115, 97, 98, 108, 101,
+ 79, 110, 83, 116, 97, 114, 116, 0, 0, 0,
+ 0, 12, 124, 69, 108, 105, 116, 101, 84, 111,
+ 119, 101, 114, 115, 0, 0, 0, 0, 18, 124,
+ 69, 110, 97, 98, 108, 101, 65, 108, 108, 67,
+ 104, 105, 108, 100, 114, 101, 110, 0, 0, 0,
+ 0, 13, 124, 69, 110, 101, 109, 121, 83, 112,
+ 97, 119, 110, 101, 114, 0, 0, 0, 0, 5,
+ 124, 87, 97, 118, 101, 0, 0, 0, 0, 6,
+ 124, 83, 112, 97, 119, 110, 0, 0, 0, 0,
+ 9, 124, 87, 97, 118, 101, 73, 110, 102, 111,
+ 0, 0, 0, 0, 14, 124, 87, 97, 118, 101,
+ 69, 110, 101, 109, 121, 73, 110, 102, 111, 0,
+ 0, 0, 0, 17, 124, 69, 99, 111, 110, 111,
+ 109, 121, 83, 105, 109, 117, 108, 97, 116, 111,
+ 114, 0, 0, 0, 0, 16, 124, 86, 105, 114,
+ 116, 117, 97, 108, 66, 117, 105, 108, 100, 105,
+ 110, 103, 0, 0, 0, 0, 15, 124, 69, 110,
+ 101, 109, 121, 83, 112, 97, 119, 110, 76, 105,
+ 110, 101, 0, 0, 0, 0, 21, 124, 69, 116,
+ 101, 114, 110, 97, 108, 84, 114, 105, 97, 108,
+ 69, 110, 101, 109, 121, 83, 101, 116, 0, 0,
+ 0, 0, 18, 124, 69, 116, 101, 114, 110, 97,
+ 108, 84, 114, 105, 97, 108, 69, 110, 101, 109,
+ 121, 0, 0, 0, 0, 24, 124, 69, 116, 101,
+ 114, 110, 97, 108, 84, 114, 105, 97, 108, 115,
+ 82, 117, 110, 77, 97, 110, 97, 103, 101, 114,
+ 0, 0, 0, 0, 17, 124, 69, 116, 101, 114,
+ 110, 97, 108, 84, 114, 105, 97, 108, 115, 82,
+ 117, 110, 0, 0, 0, 0, 10, 124, 77, 97,
+ 112, 67, 104, 111, 105, 99, 101, 0, 0, 0,
+ 0, 28, 124, 82, 97, 110, 100, 111, 109, 105,
+ 122, 101, 69, 120, 116, 101, 110, 115, 105, 111,
+ 110, 115, 70, 111, 114, 76, 105, 115, 116, 115,
+ 0, 0, 0, 0, 21, 124, 69, 116, 101, 114,
+ 110, 97, 108, 87, 97, 118, 101, 71, 101, 110,
+ 101, 114, 97, 116, 111, 114, 0, 0, 0, 0,
+ 19, 124, 80, 97, 117, 108, 115, 87, 97, 118,
+ 101, 71, 101, 110, 101, 114, 97, 116, 111, 114,
+ 0, 0, 0, 0, 34, 80, 97, 117, 108, 115,
+ 87, 97, 118, 101, 71, 101, 110, 101, 114, 97,
+ 116, 111, 114, 124, 69, 110, 101, 109, 121, 83,
+ 112, 97, 119, 110, 71, 114, 111, 117, 112, 0,
+ 0, 0, 0, 17, 124, 83, 101, 97, 115, 111,
+ 110, 84, 119, 111, 87, 97, 118, 101, 71, 101,
+ 110, 0, 0, 0, 0, 10, 124, 87, 97, 118,
+ 101, 68, 114, 97, 102, 116, 0, 0, 0, 0,
+ 13, 124, 83, 117, 112, 101, 114, 87, 97, 118,
+ 101, 71, 101, 110, 0, 0, 0, 0, 15, 124,
+ 87, 97, 118, 101, 71, 101, 110, 85, 116, 105,
+ 108, 105, 116, 121, 0, 0, 0, 0, 12, 124,
+ 70, 97, 107, 101, 67, 104, 105, 108, 100, 84,
+ 111, 0, 0, 0, 0, 15, 124, 70, 105, 114,
+ 101, 65, 114, 99, 104, 101, 114, 66, 117, 114,
+ 110, 0, 0, 0, 0, 15, 124, 70, 105, 115,
+ 104, 105, 110, 103, 72, 97, 114, 98, 111, 117,
+ 114, 0, 0, 0, 0, 22, 124, 70, 105, 115,
+ 104, 105, 110, 103, 72, 97, 114, 98, 111, 117,
+ 114, 85, 112, 103, 114, 97, 100, 101, 0, 0,
+ 0, 0, 16, 124, 70, 111, 108, 108, 111, 119,
+ 84, 114, 97, 110, 115, 102, 111, 114, 109, 0,
+ 0, 0, 0, 23, 124, 70, 111, 114, 99, 101,
+ 67, 97, 109, 101, 114, 97, 80, 111, 115, 79,
+ 110, 69, 110, 97, 98, 108, 101, 0, 0, 0,
+ 0, 23, 124, 70, 114, 101, 101, 122, 101, 80,
+ 111, 115, 105, 116, 105, 111, 110, 79, 110, 69,
+ 110, 97, 98, 108, 101, 0, 0, 0, 0, 18,
+ 124, 77, 97, 116, 101, 114, 105, 97, 108, 70,
+ 108, 97, 115, 104, 101, 114, 70, 88, 0, 0,
+ 0, 0, 38, 77, 97, 116, 101, 114, 105, 97,
+ 108, 70, 108, 97, 115, 104, 101, 114, 70, 88,
+ 124, 82, 101, 110, 100, 101, 114, 101, 114, 77,
+ 97, 116, 101, 114, 105, 97, 108, 80, 97, 105,
+ 114, 0, 0, 0, 0, 24, 124, 79, 110, 68,
+ 97, 109, 97, 103, 101, 70, 101, 101, 100, 98,
+ 97, 99, 107, 72, 97, 110, 100, 108, 101, 114,
+ 0, 0, 0, 0, 16, 124, 83, 104, 97, 112,
+ 101, 71, 114, 111, 117, 112, 70, 97, 100, 101,
+ 114, 0, 0, 0, 0, 33, 124, 85, 110, 112,
+ 97, 114, 101, 110, 116, 65, 110, 100, 68, 101,
+ 115, 116, 114, 111, 121, 68, 101, 108, 97, 121,
+ 101, 100, 79, 110, 68, 101, 97, 116, 104, 0,
+ 0, 0, 0, 11, 124, 71, 97, 116, 101, 79,
+ 112, 101, 110, 101, 114, 0, 0, 0, 0, 14,
+ 124, 71, 108, 111, 98, 97, 108, 72, 101, 97,
+ 108, 105, 110, 103, 0, 0, 0, 0, 10, 124,
+ 72, 101, 97, 108, 116, 104, 98, 97, 114, 0,
+ 0, 0, 0, 15, 124, 72, 101, 97, 108, 116,
+ 104, 98, 97, 114, 77, 117, 108, 116, 105, 0,
+ 0, 0, 0, 24, 124, 72, 101, 97, 108, 116,
+ 104, 83, 116, 101, 97, 108, 87, 101, 97, 112,
+ 111, 110, 69, 102, 102, 101, 99, 116, 0, 0,
+ 0, 0, 12, 124, 72, 111, 116, 79, 105, 108,
+ 84, 111, 119, 101, 114, 0, 0, 0, 0, 3,
+ 124, 72, 112, 0, 0, 0, 0, 15, 124, 73,
+ 110, 99, 111, 109, 101, 77, 111, 100, 105, 102,
+ 121, 101, 114, 0, 0, 0, 0, 28, 124, 73,
+ 110, 99, 114, 101, 97, 115, 101, 65, 116, 116,
+ 97, 99, 107, 83, 112, 101, 101, 100, 79, 118,
+ 101, 114, 84, 105, 109, 101, 0, 0, 0, 0,
+ 20, 124, 73, 110, 99, 114, 101, 97, 115, 101,
+ 73, 110, 99, 111, 109, 101, 68, 97, 105, 108,
+ 121, 0, 0, 0, 0, 13, 124, 73, 110, 118,
+ 117, 108, 110, 101, 114, 97, 98, 108, 101, 0,
+ 0, 0, 0, 21, 124, 76, 97, 117, 110, 99,
+ 104, 97, 98, 108, 101, 80, 114, 111, 106, 101,
+ 99, 116, 105, 108, 101, 0, 0, 0, 0, 24,
+ 124, 69, 116, 101, 114, 110, 97, 108, 84, 114,
+ 105, 97, 108, 115, 73, 110, 116, 101, 114, 97,
+ 99, 116, 111, 114, 0, 0, 0, 0, 16, 124,
+ 76, 101, 118, 101, 108, 73, 110, 116, 101, 114,
+ 97, 99, 116, 111, 114, 0, 0, 0, 0, 19,
+ 124, 76, 101, 118, 101, 108, 83, 101, 108, 101,
+ 99, 116, 77, 97, 110, 97, 103, 101, 114, 0,
+ 0, 0, 0, 19, 124, 80, 101, 114, 107, 83,
+ 101, 108, 101, 99, 116, 105, 111, 110, 71, 114,
+ 111, 117, 112, 0, 0, 0, 0, 18, 124, 80,
+ 101, 114, 107, 83, 101, 108, 101, 99, 116, 105,
+ 111, 110, 73, 116, 101, 109, 0, 0, 0, 0,
+ 16, 124, 80, 108, 97, 121, 76, 101, 118, 101,
+ 108, 66, 117, 116, 116, 111, 110, 0, 0, 0,
+ 0, 12, 124, 76, 101, 118, 101, 108, 66, 111,
+ 114, 100, 101, 114, 0, 0, 0, 0, 10, 124,
+ 76, 101, 118, 101, 108, 73, 110, 102, 111, 0,
+ 0, 0, 0, 17, 124, 76, 105, 103, 104, 116,
+ 110, 105, 110, 103, 83, 116, 114, 105, 107, 101,
+ 114, 0, 0, 0, 0, 15, 124, 76, 105, 109,
+ 105, 116, 68, 101, 108, 116, 97, 84, 105, 109,
+ 101, 0, 0, 0, 0, 16, 124, 76, 105, 109,
+ 105, 116, 101, 100, 76, 105, 102, 101, 116, 105,
+ 109, 101, 0, 0, 0, 0, 15, 124, 76, 111,
+ 97, 100, 83, 99, 101, 110, 101, 79, 110, 84,
+ 111, 112, 0, 0, 0, 0, 15, 124, 76, 111,
+ 99, 97, 108, 71, 97, 109, 101, 115, 116, 97,
+ 116, 101, 0, 0, 0, 0, 19, 124, 65, 99,
+ 104, 105, 101, 118, 101, 109, 101, 110, 116, 77,
+ 97, 110, 97, 103, 101, 114, 0, 0, 0, 0,
+ 19, 124, 66, 108, 97, 99, 107, 115, 109, 105,
+ 116, 104, 85, 112, 103, 114, 97, 100, 101, 115,
+ 0, 0, 0, 0, 22, 124, 67, 97, 110, 99,
+ 101, 108, 79, 114, 79, 112, 101, 110, 80, 97,
+ 117, 115, 101, 77, 101, 110, 117, 0, 0, 0,
+ 0, 14, 124, 67, 104, 111, 105, 99, 101, 77,
+ 97, 110, 97, 103, 101, 114, 0, 0, 0, 0,
+ 7, 124, 67, 104, 111, 105, 99, 101, 0, 0,
+ 0, 0, 22, 124, 67, 111, 110, 116, 114, 111,
+ 108, 67, 111, 110, 102, 105, 103, 83, 97, 118,
+ 101, 76, 111, 97, 100, 0, 0, 0, 0, 14,
+ 124, 67, 111, 110, 116, 114, 111, 108, 67, 111,
+ 110, 102, 105, 103, 0, 0, 0, 0, 28, 67,
+ 111, 110, 116, 114, 111, 108, 67, 111, 110, 102,
+ 105, 103, 124, 67, 111, 110, 116, 114, 111, 108,
+ 108, 101, 114, 68, 97, 116, 97, 0, 0, 0,
+ 0, 18, 124, 69, 110, 101, 109, 121, 83, 112,
+ 97, 119, 110, 77, 97, 110, 97, 103, 101, 114,
+ 0, 0, 0, 0, 13, 124, 71, 80, 85, 73,
+ 110, 115, 116, 97, 110, 99, 101, 100, 0, 0,
+ 0, 0, 21, 124, 71, 80, 85, 73, 110, 115,
+ 116, 97, 110, 99, 105, 110, 103, 77, 97, 110,
+ 97, 103, 101, 114, 0, 0, 0, 0, 37, 71,
+ 80, 85, 73, 110, 115, 116, 97, 110, 99, 105,
+ 110, 103, 77, 97, 110, 97, 103, 101, 114, 124,
+ 77, 97, 116, 101, 114, 105, 97, 108, 77, 101,
+ 115, 104, 80, 97, 105, 114, 0, 0, 0, 0,
+ 40, 71, 80, 85, 73, 110, 115, 116, 97, 110,
+ 99, 105, 110, 103, 77, 97, 110, 97, 103, 101,
+ 114, 124, 84, 114, 97, 110, 115, 102, 111, 114,
+ 109, 77, 97, 116, 114, 105, 120, 80, 97, 105,
+ 114, 0, 0, 0, 0, 21, 124, 76, 101, 118,
+ 101, 108, 80, 114, 111, 103, 114, 101, 115, 115,
+ 77, 97, 110, 97, 103, 101, 114, 0, 0, 0,
+ 0, 10, 124, 76, 101, 118, 101, 108, 68, 97,
+ 116, 97, 0, 0, 0, 0, 26, 124, 85, 110,
+ 105, 116, 121, 83, 101, 114, 105, 97, 108, 105,
+ 122, 101, 100, 68, 105, 99, 116, 105, 111, 110,
+ 97, 114, 121, 0, 0, 0, 0, 21, 124, 83,
+ 99, 101, 110, 101, 78, 97, 109, 101, 84, 111,
+ 76, 101, 118, 101, 108, 68, 97, 116, 97, 0,
+ 0, 0, 0, 13, 124, 77, 117, 115, 105, 99,
+ 77, 97, 110, 97, 103, 101, 114, 0, 0, 0,
+ 0, 27, 77, 117, 115, 105, 99, 77, 97, 110,
+ 97, 103, 101, 114, 124, 79, 118, 101, 114, 114,
+ 105, 100, 101, 86, 111, 108, 117, 109, 101, 0,
+ 0, 0, 0, 12, 124, 80, 101, 114, 107, 77,
+ 97, 110, 97, 103, 101, 114, 0, 0, 0, 0,
+ 10, 124, 77, 101, 116, 97, 76, 101, 118, 101,
+ 108, 0, 0, 0, 0, 19, 124, 82, 111, 121,
+ 97, 108, 70, 111, 114, 103, 101, 85, 112, 103,
+ 114, 97, 100, 101, 115, 0, 0, 0, 0, 16,
+ 124, 83, 97, 118, 101, 76, 111, 97, 100, 77,
+ 97, 110, 97, 103, 101, 114, 0, 0, 0, 0,
+ 23, 124, 83, 99, 101, 110, 101, 84, 114, 97,
+ 110, 115, 105, 116, 105, 111, 110, 77, 97, 110,
+ 97, 103, 101, 114, 0, 0, 0, 0, 15, 124,
+ 84, 101, 120, 116, 84, 114, 97, 110, 115, 108,
+ 97, 116, 111, 114, 0, 0, 0, 0, 13, 124,
+ 67, 117, 114, 115, 101, 66, 108, 97, 115, 116,
+ 77, 65, 0, 0, 0, 0, 12, 124, 72, 101,
+ 97, 108, 66, 111, 111, 115, 116, 77, 65, 0,
+ 0, 0, 0, 16, 124, 76, 105, 103, 104, 116,
+ 110, 105, 110, 103, 87, 97, 110, 100, 77, 65,
+ 0, 0, 0, 0, 13, 124, 77, 97, 110, 117,
+ 97, 108, 65, 116, 116, 97, 99, 107, 0, 0,
+ 0, 0, 17, 124, 83, 112, 97, 119, 110, 65,
+ 116, 116, 97, 99, 107, 65, 102, 116, 101, 114,
+ 0, 0, 0, 0, 8, 124, 83, 112, 97, 119,
+ 110, 77, 65, 0, 0, 0, 0, 7, 124, 83,
+ 116, 97, 98, 77, 65, 0, 0, 0, 0, 16,
+ 124, 77, 97, 112, 65, 99, 104, 105, 101, 118,
+ 101, 109, 101, 110, 116, 115, 0, 0, 0, 0,
+ 10, 124, 77, 105, 108, 108, 82, 111, 116, 111,
+ 114, 0, 0, 0, 0, 18, 124, 77, 105, 108,
+ 108, 95, 73, 109, 112, 114, 111, 118, 101, 100,
+ 80, 108, 111, 119, 0, 0, 0, 0, 30, 124,
+ 77, 105, 108, 108, 95, 73, 109, 112, 114, 111,
+ 118, 101, 109, 101, 110, 116, 69, 120, 112, 108,
+ 111, 115, 105, 118, 101, 84, 114, 97, 112, 0,
+ 0, 0, 0, 28, 124, 77, 105, 108, 108, 95,
+ 73, 109, 112, 114, 111, 118, 101, 109, 101, 110,
+ 116, 87, 105, 110, 100, 83, 112, 105, 114, 105,
+ 116, 115, 0, 0, 0, 0, 28, 124, 77, 105,
+ 108, 108, 95, 73, 109, 112, 114, 111, 118, 101,
+ 109, 101, 110, 116, 95, 83, 99, 97, 114, 101,
+ 99, 114, 111, 119, 115, 0, 0, 0, 0, 10,
+ 124, 77, 105, 110, 101, 83, 104, 97, 102, 116,
+ 0, 0, 0, 0, 8, 124, 77, 111, 108, 101,
+ 109, 97, 110, 0, 0, 0, 0, 18, 124, 78,
+ 97, 118, 109, 101, 115, 104, 66, 97, 107, 101,
+ 72, 101, 108, 112, 101, 114, 0, 0, 0, 0,
+ 10, 124, 78, 105, 103, 104, 116, 104, 111, 114,
+ 110, 0, 0, 0, 0, 11, 124, 78, 105, 103,
+ 104, 116, 76, 105, 103, 104, 116, 0, 0, 0,
+ 0, 13, 124, 67, 111, 109, 109, 97, 110, 100,
+ 85, 110, 105, 116, 115, 0, 0, 0, 0, 17,
+ 124, 80, 97, 116, 104, 102, 105, 110, 100, 77,
+ 111, 118, 101, 109, 101, 110, 116, 0, 0, 0,
+ 0, 22, 124, 80, 97, 116, 104, 102, 105, 110,
+ 100, 77, 111, 118, 101, 109, 101, 110, 116, 69,
+ 110, 101, 109, 121, 0, 0, 0, 0, 27, 124,
+ 80, 97, 116, 104, 102, 105, 110, 100, 77, 111,
+ 118, 101, 109, 101, 110, 116, 80, 108, 97, 121,
+ 101, 114, 117, 110, 105, 116, 0, 0, 0, 0,
+ 45, 124, 80, 101, 114, 105, 111, 100, 105, 99,
+ 97, 108, 108, 121, 69, 110, 97, 98, 108, 101,
+ 65, 110, 100, 68, 105, 115, 97, 98, 108, 101,
+ 68, 117, 114, 105, 110, 103, 69, 110, 101, 109,
+ 121, 83, 112, 97, 119, 110, 0, 0, 0, 0,
+ 11, 124, 69, 113, 117, 105, 112, 112, 97, 98,
+ 108, 101, 0, 0, 0, 0, 26, 124, 69, 113,
+ 117, 105, 112, 112, 97, 98, 108, 101, 66, 117,
+ 105, 108, 100, 105, 110, 103, 85, 112, 103, 114,
+ 97, 100, 101, 0, 0, 0, 0, 19, 124, 69,
+ 113, 117, 105, 112, 112, 97, 98, 108, 101, 77,
+ 117, 116, 97, 116, 105, 111, 110, 0, 0, 0,
+ 0, 15, 124, 69, 113, 117, 105, 112, 112, 97,
+ 98, 108, 101, 80, 101, 114, 107, 0, 0, 0,
+ 0, 17, 124, 69, 113, 117, 105, 112, 112, 97,
+ 98, 108, 101, 87, 101, 97, 112, 111, 110, 0,
+ 0, 0, 0, 10, 124, 80, 101, 114, 107, 80,
+ 111, 105, 110, 116, 0, 0, 0, 0, 21, 124,
+ 80, 101, 114, 107, 67, 111, 111, 108, 100, 111,
+ 119, 110, 77, 111, 100, 105, 102, 121, 101, 114,
+ 0, 0, 0, 0, 17, 124, 80, 101, 114, 107,
+ 67, 111, 115, 116, 77, 111, 100, 105, 102, 121,
+ 101, 114, 0, 0, 0, 0, 29, 124, 80, 101,
+ 114, 107, 68, 97, 109, 97, 103, 101, 65, 117,
+ 116, 111, 65, 116, 116, 97, 99, 107, 77, 111,
+ 100, 105, 102, 121, 101, 114, 0, 0, 0, 0,
+ 33, 124, 80, 101, 114, 107, 68, 97, 109, 97,
+ 103, 101, 77, 111, 100, 105, 102, 121, 101, 114,
+ 80, 108, 97, 121, 101, 114, 117, 110, 105, 116,
+ 65, 117, 116, 111, 0, 0, 0, 0, 30, 124,
+ 80, 101, 114, 107, 68, 101, 115, 116, 114, 111,
+ 121, 71, 97, 109, 101, 79, 98, 106, 101, 99,
+ 116, 77, 111, 100, 105, 102, 121, 101, 114, 0,
+ 0, 0, 0, 15, 124, 80, 101, 114, 107, 72,
+ 112, 77, 111, 100, 105, 102, 121, 101, 114, 0,
+ 0, 0, 0, 19, 124, 80, 101, 114, 107, 73,
+ 110, 99, 111, 109, 101, 77, 111, 100, 105, 102,
+ 121, 101, 114, 0, 0, 0, 0, 19, 124, 80,
+ 101, 114, 107, 73, 110, 100, 101, 115, 116, 114,
+ 117, 99, 116, 105, 98, 108, 101, 0, 0, 0,
+ 0, 22, 124, 80, 101, 114, 107, 80, 108, 97,
+ 121, 101, 114, 72, 101, 97, 108, 116, 104, 82,
+ 101, 103, 101, 110, 0, 0, 0, 0, 18, 124,
+ 80, 101, 114, 107, 82, 97, 110, 103, 101, 77,
+ 111, 100, 105, 102, 121, 101, 114, 0, 0, 0,
+ 0, 18, 124, 80, 101, 114, 107, 83, 112, 101,
+ 101, 100, 77, 111, 100, 105, 102, 121, 101, 114,
+ 0, 0, 0, 0, 19, 124, 80, 101, 114, 107,
+ 87, 101, 97, 112, 111, 110, 77, 111, 100, 105,
+ 102, 121, 101, 114, 0, 0, 0, 0, 13, 124,
+ 80, 108, 97, 121, 101, 114, 65, 116, 116, 97,
+ 99, 107, 0, 0, 0, 0, 19, 124, 80, 108,
+ 97, 121, 101, 114, 66, 97, 108, 108, 77, 111,
+ 118, 101, 109, 101, 110, 116, 0, 0, 0, 0,
+ 14, 124, 80, 108, 97, 121, 101, 114, 72, 112,
+ 82, 101, 103, 101, 110, 0, 0, 0, 0, 19,
+ 124, 66, 117, 105, 108, 100, 105, 110, 103, 73,
+ 110, 116, 101, 114, 97, 99, 116, 111, 114, 0,
+ 0, 0, 0, 15, 124, 73, 110, 116, 101, 114,
+ 97, 99, 116, 111, 114, 66, 97, 115, 101, 0,
+ 0, 0, 0, 37, 124, 76, 97, 117, 110, 99,
+ 104, 97, 98, 108, 101, 68, 101, 102, 101, 110,
+ 115, 101, 77, 101, 99, 104, 97, 110, 105, 115,
+ 109, 73, 110, 116, 101, 114, 97, 99, 116, 111,
+ 114, 0, 0, 0, 0, 18, 124, 80, 108, 97,
+ 121, 101, 114, 73, 110, 116, 101, 114, 97, 99,
+ 116, 105, 111, 110, 0, 0, 0, 0, 14, 124,
+ 80, 108, 97, 121, 101, 114, 77, 97, 110, 97,
+ 103, 101, 114, 0, 0, 0, 0, 15, 124, 80,
+ 108, 97, 121, 101, 114, 77, 111, 118, 101, 109,
+ 101, 110, 116, 0, 0, 0, 0, 25, 124, 85,
+ 112, 103, 114, 97, 100, 101, 65, 115, 115, 97,
+ 115, 115, 105, 110, 115, 84, 114, 97, 105, 110,
+ 105, 110, 103, 0, 0, 0, 0, 21, 124, 85,
+ 112, 103, 114, 97, 100, 101, 66, 117, 105, 108,
+ 100, 101, 114, 115, 71, 117, 105, 108, 100, 0,
+ 0, 0, 0, 16, 124, 85, 112, 103, 114, 97,
+ 100, 101, 67, 97, 115, 116, 108, 101, 85, 112,
+ 0, 0, 0, 0, 17, 124, 85, 112, 103, 114,
+ 97, 100, 101, 67, 111, 109, 109, 97, 110, 100,
+ 101, 114, 0, 0, 0, 0, 18, 124, 85, 112,
+ 103, 114, 97, 100, 101, 71, 111, 100, 108, 121,
+ 67, 117, 114, 115, 101, 0, 0, 0, 0, 18,
+ 124, 85, 112, 103, 114, 97, 100, 101, 77, 97,
+ 103, 105, 99, 65, 114, 109, 111, 114, 0, 0,
+ 0, 0, 17, 124, 85, 112, 103, 114, 97, 100,
+ 101, 80, 108, 97, 121, 101, 114, 68, 109, 103,
+ 0, 0, 0, 0, 16, 124, 85, 112, 103, 114,
+ 97, 100, 101, 80, 108, 97, 121, 101, 114, 72,
+ 112, 0, 0, 0, 0, 21, 124, 80, 108, 97,
+ 121, 101, 114, 85, 112, 103, 114, 97, 100, 101,
+ 77, 97, 110, 97, 103, 101, 114, 0, 0, 0,
+ 0, 20, 124, 80, 108, 97, 121, 101, 114, 87,
+ 101, 97, 112, 111, 110, 86, 105, 115, 117, 97,
+ 108, 115, 0, 0, 0, 0, 17, 124, 80, 108,
+ 97, 121, 77, 117, 115, 105, 99, 79, 110, 83,
+ 116, 97, 114, 116, 0, 0, 0, 0, 15, 124,
+ 80, 111, 119, 101, 114, 84, 111, 119, 101, 114,
+ 80, 101, 114, 107, 0, 0, 0, 0, 23, 124,
+ 80, 114, 97, 99, 116, 105, 99, 101, 84, 97,
+ 114, 103, 101, 116, 67, 111, 105, 110, 68, 114,
+ 111, 112, 0, 0, 0, 0, 22, 124, 80, 114,
+ 105, 111, 114, 105, 116, 121, 65, 117, 100, 105,
+ 111, 76, 105, 115, 116, 101, 110, 101, 114, 0,
+ 0, 0, 0, 14, 124, 80, 114, 111, 100, 117,
+ 99, 116, 105, 111, 110, 66, 97, 114, 0, 0,
+ 0, 0, 26, 124, 80, 114, 111, 106, 101, 99,
+ 116, 105, 108, 101, 73, 109, 112, 97, 99, 116,
+ 80, 97, 114, 116, 105, 99, 108, 101, 115, 0,
+ 0, 0, 0, 13, 124, 80, 117, 115, 104, 80,
+ 108, 97, 121, 101, 114, 50, 68, 0, 0, 0,
+ 0, 6, 124, 81, 117, 101, 115, 116, 0, 0,
+ 0, 0, 38, 124, 82, 101, 100, 117, 99, 101,
+ 67, 104, 105, 108, 100, 114, 101, 110, 115, 66,
+ 117, 105, 108, 100, 82, 101, 113, 117, 105, 114,
+ 101, 109, 101, 110, 116, 73, 102, 80, 101, 114,
+ 107, 0, 0, 0, 0, 14, 124, 82, 105, 100,
+ 105, 110, 103, 68, 97, 109, 97, 103, 101, 114,
+ 0, 0, 0, 0, 18, 124, 82, 111, 121, 97,
+ 108, 70, 111, 114, 103, 101, 85, 112, 103, 114,
+ 97, 100, 101, 0, 0, 0, 0, 10, 124, 73,
+ 83, 97, 118, 101, 76, 111, 97, 100, 0, 0,
+ 0, 0, 19, 124, 76, 111, 99, 97, 108, 77,
+ 97, 116, 99, 104, 83, 97, 118, 101, 76, 111,
+ 97, 100, 0, 0, 0, 0, 21, 124, 77, 97,
+ 116, 99, 104, 83, 97, 118, 101, 76, 111, 97,
+ 100, 72, 97, 110, 100, 108, 101, 114, 0, 0,
+ 0, 0, 10, 124, 77, 97, 116, 99, 104, 83,
+ 97, 118, 101, 0, 0, 0, 0, 37, 77, 97,
+ 116, 99, 104, 83, 97, 118, 101, 124, 83, 101,
+ 114, 105, 97, 108, 105, 122, 97, 98, 108, 101,
+ 68, 105, 99, 116, 105, 111, 110, 97, 114, 121,
+ 86, 97, 108, 117, 101, 0, 0, 0, 0, 15,
+ 124, 83, 97, 118, 101, 76, 111, 97, 100, 69,
+ 110, 116, 105, 116, 121, 0, 0, 0, 0, 13,
+ 124, 83, 99, 111, 114, 101, 77, 97, 110, 97,
+ 103, 101, 114, 0, 0, 0, 0, 13, 124, 83,
+ 99, 114, 101, 101, 110, 77, 97, 114, 107, 101,
+ 114, 0, 0, 0, 0, 17, 124, 83, 99, 114,
+ 101, 101, 110, 77, 97, 114, 107, 101, 114, 73,
+ 99, 111, 110, 0, 0, 0, 0, 20, 124, 83,
+ 99, 114, 101, 101, 110, 77, 97, 114, 107, 101,
+ 114, 77, 97, 110, 97, 103, 101, 114, 0, 0,
+ 0, 0, 36, 83, 99, 114, 101, 101, 110, 77,
+ 97, 114, 107, 101, 114, 77, 97, 110, 97, 103,
+ 101, 114, 124, 67, 111, 109, 112, 97, 114, 101,
+ 80, 111, 115, 105, 116, 105, 111, 110, 88, 0,
+ 0, 0, 0, 36, 83, 99, 114, 101, 101, 110,
+ 77, 97, 114, 107, 101, 114, 77, 97, 110, 97,
+ 103, 101, 114, 124, 67, 111, 109, 112, 97, 114,
+ 101, 80, 111, 115, 105, 116, 105, 111, 110, 89,
+ 0, 0, 0, 0, 26, 124, 83, 101, 108, 102,
+ 68, 101, 115, 116, 114, 117, 99, 116, 87, 104,
+ 101, 110, 73, 110, 82, 97, 110, 103, 101, 79,
+ 102, 0, 0, 0, 0, 19, 124, 83, 101, 116,
+ 83, 116, 97, 116, 101, 87, 104, 101, 110, 77,
+ 97, 99, 79, 83, 88, 0, 0, 0, 0, 19,
+ 124, 82, 101, 115, 101, 116, 65, 117, 100, 105,
+ 111, 83, 101, 116, 116, 105, 110, 103, 115, 0,
+ 0, 0, 0, 21, 124, 83, 101, 116, 116, 105,
+ 110, 103, 115, 65, 110, 116, 105, 65, 108, 105,
+ 97, 115, 105, 110, 103, 0, 0, 0, 0, 20,
+ 124, 83, 101, 116, 116, 105, 110, 103, 115, 65,
+ 117, 100, 105, 111, 86, 111, 108, 117, 109, 101,
+ 0, 0, 0, 0, 19, 124, 83, 101, 116, 116,
+ 105, 110, 103, 115, 70, 117, 108, 108, 115, 99,
+ 114, 101, 101, 110, 0, 0, 0, 0, 17, 124,
+ 83, 101, 116, 116, 105, 110, 103, 115, 76, 97,
+ 110, 103, 117, 97, 103, 101, 0, 0, 0, 0,
+ 22, 124, 83, 101, 116, 116, 105, 110, 103, 115,
+ 76, 97, 110, 103, 117, 97, 103, 101, 82, 101,
+ 115, 101, 116, 0, 0, 0, 0, 16, 124, 83,
+ 101, 116, 116, 105, 110, 103, 115, 77, 97, 110,
+ 97, 103, 101, 114, 0, 0, 0, 0, 21, 124,
+ 82, 101, 115, 111, 108, 117, 116, 105, 111, 110,
+ 69, 120, 116, 101, 110, 115, 105, 111, 110, 115,
+ 0, 0, 0, 0, 23, 124, 83, 101, 116, 116,
+ 105, 110, 103, 115, 80, 111, 115, 116, 80, 114,
+ 111, 99, 101, 115, 115, 105, 110, 103, 0, 0,
+ 0, 0, 29, 124, 83, 101, 116, 116, 105, 110,
+ 103, 115, 80, 111, 115, 116, 80, 114, 111, 99,
+ 101, 115, 115, 105, 110, 103, 72, 101, 108, 112,
+ 101, 114, 0, 0, 0, 0, 20, 124, 83, 101,
+ 116, 116, 105, 110, 103, 115, 82, 101, 110, 100,
+ 101, 114, 83, 99, 97, 108, 101, 0, 0, 0,
+ 0, 26, 124, 83, 101, 116, 116, 105, 110, 103,
+ 115, 82, 101, 115, 101, 116, 85, 110, 105, 116,
+ 115, 77, 111, 114, 110, 105, 110, 103, 0, 0,
+ 0, 0, 19, 124, 83, 101, 116, 116, 105, 110,
+ 103, 115, 82, 101, 115, 101, 116, 86, 105, 100,
+ 101, 111, 0, 0, 0, 0, 19, 124, 83, 101,
+ 116, 116, 105, 110, 103, 115, 82, 101, 115, 111,
+ 108, 117, 116, 105, 111, 110, 0, 0, 0, 0,
+ 25, 124, 83, 101, 116, 116, 105, 110, 103, 115,
+ 83, 104, 97, 100, 111, 119, 82, 101, 115, 111,
+ 108, 117, 116, 105, 111, 110, 0, 0, 0, 0,
+ 19, 124, 83, 101, 116, 116, 105, 110, 103, 115,
+ 85, 115, 101, 76, 97, 114, 103, 101, 85, 73,
+ 0, 0, 0, 0, 14, 124, 83, 101, 116, 116,
+ 105, 110, 103, 115, 86, 115, 121, 110, 99, 0,
+ 0, 0, 0, 19, 124, 83, 101, 116, 116, 105,
+ 110, 103, 115, 87, 105, 110, 116, 101, 114, 77,
+ 111, 100, 101, 0, 0, 0, 0, 21, 124, 83,
+ 104, 97, 114, 112, 67, 111, 114, 110, 101, 114,
+ 77, 105, 100, 105, 103, 97, 116, 111, 114, 0,
+ 0, 0, 0, 21, 124, 83, 104, 105, 101, 108,
+ 100, 79, 110, 70, 105, 114, 115, 116, 68, 97,
+ 109, 97, 103, 101, 100, 0, 0, 0, 0, 7,
+ 124, 83, 104, 114, 105, 110, 101, 0, 0, 0,
+ 0, 11, 124, 83, 108, 111, 119, 69, 102, 102,
+ 101, 99, 116, 0, 0, 0, 0, 17, 124, 83,
+ 112, 108, 97, 115, 104, 68, 97, 109, 97, 103,
+ 101, 65, 114, 101, 97, 0, 0, 0, 0, 13,
+ 124, 83, 116, 101, 97, 109, 77, 97, 110, 97,
+ 103, 101, 114, 0, 0, 0, 0, 29, 83, 116,
+ 101, 97, 109, 77, 97, 110, 97, 103, 101, 114,
+ 124, 76, 101, 97, 100, 101, 114, 98, 111, 97,
+ 114, 100, 69, 110, 116, 114, 121, 0, 0, 0,
+ 0, 37, 124, 83, 117, 115, 112, 101, 110, 100,
+ 80, 108, 97, 121, 101, 114, 67, 111, 108, 108,
+ 105, 115, 105, 111, 110, 85, 110, 116, 105, 108,
+ 78, 111, 79, 118, 101, 114, 108, 97, 112, 0,
+ 0, 0, 0, 13, 124, 84, 97, 103, 103, 101,
+ 100, 79, 98, 106, 101, 99, 116, 0, 0, 0,
+ 0, 11, 124, 84, 97, 103, 77, 97, 110, 97,
+ 103, 101, 114, 0, 0, 0, 0, 15, 124, 84,
+ 97, 114, 103, 101, 116, 80, 114, 105, 111, 114,
+ 105, 116, 121, 0, 0, 0, 0, 11, 124, 80,
+ 97, 116, 104, 77, 101, 115, 104, 101, 114, 0,
+ 0, 0, 0, 20, 80, 97, 116, 104, 77, 101,
+ 115, 104, 101, 114, 124, 80, 97, 116, 104, 80,
+ 111, 105, 110, 116, 0, 0, 0, 0, 13, 124,
+ 70, 97, 107, 101, 84, 114, 97, 110, 115, 111,
+ 114, 109, 0, 0, 0, 0, 14, 124, 82, 105,
+ 118, 101, 114, 83, 99, 114, 111, 108, 108, 101,
+ 114, 0, 0, 0, 0, 11, 124, 84, 101, 108,
+ 101, 80, 108, 97, 121, 101, 114, 0, 0, 0,
+ 0, 11, 124, 84, 105, 101, 66, 114, 101, 97,
+ 107, 101, 114, 0, 0, 0, 0, 19, 124, 84,
+ 105, 109, 101, 115, 101, 110, 115, 105, 116, 105,
+ 118, 101, 76, 105, 103, 104, 116, 0, 0, 0,
+ 0, 15, 124, 84, 111, 111, 108, 116, 105, 112,
+ 77, 97, 110, 97, 103, 101, 114, 0, 0, 0,
+ 0, 13, 124, 84, 111, 119, 101, 114, 85, 112,
+ 103, 114, 97, 100, 101, 0, 0, 0, 0, 16,
+ 124, 84, 117, 116, 111, 114, 105, 97, 108, 77,
+ 97, 110, 97, 103, 101, 114, 0, 0, 0, 0,
+ 22, 124, 69, 116, 101, 114, 110, 97, 108, 84,
+ 114, 105, 97, 108, 115, 68, 101, 102, 101, 97,
+ 116, 85, 73, 0, 0, 0, 0, 23, 124, 69,
+ 116, 101, 114, 110, 97, 108, 84, 114, 105, 97,
+ 108, 115, 86, 105, 99, 116, 111, 114, 121, 85,
+ 73, 0, 0, 0, 0, 21, 124, 73, 85, 73,
+ 65, 110, 105, 109, 97, 116, 105, 111, 110, 83,
+ 101, 113, 117, 101, 110, 99, 101, 0, 0, 0,
+ 0, 27, 124, 65, 112, 112, 108, 121, 85, 112,
+ 103, 114, 97, 100, 101, 73, 110, 100, 105, 99,
+ 97, 116, 111, 114, 67, 111, 108, 111, 114, 0,
+ 0, 0, 0, 24, 124, 65, 116, 116, 97, 99,
+ 107, 67, 111, 111, 108, 100, 111, 119, 110, 65,
+ 110, 105, 109, 97, 116, 105, 111, 110, 0, 0,
+ 0, 0, 26, 124, 66, 97, 99, 107, 84, 111,
+ 84, 105, 116, 108, 101, 115, 99, 114, 101, 101,
+ 110, 85, 73, 72, 101, 108, 112, 101, 114, 0,
+ 0, 0, 0, 21, 124, 66, 111, 110, 117, 115,
+ 76, 101, 118, 101, 108, 73, 110, 116, 101, 114,
+ 97, 99, 116, 111, 114, 0, 0, 0, 0, 23,
+ 124, 66, 117, 105, 108, 100, 105, 110, 103, 82,
+ 97, 110, 103, 101, 73, 110, 100, 105, 99, 97,
+ 116, 111, 114, 0, 0, 0, 0, 9, 124, 67,
+ 104, 101, 99, 107, 98, 111, 120, 0, 0, 0,
+ 0, 9, 124, 67, 104, 111, 105, 99, 101, 85,
+ 73, 0, 0, 0, 0, 20, 124, 67, 104, 111,
+ 105, 99, 101, 85, 73, 70, 114, 97, 109, 101,
+ 72, 101, 108, 112, 101, 114, 0, 0, 0, 0,
+ 9, 124, 67, 111, 105, 110, 115, 108, 111, 116,
+ 0, 0, 0, 0, 17, 124, 67, 111, 110, 116,
+ 114, 111, 108, 108, 101, 114, 80, 105, 99, 107,
+ 101, 114, 0, 0, 0, 0, 17, 124, 67, 111,
+ 110, 116, 114, 111, 108, 77, 97, 112, 66, 117,
+ 116, 116, 111, 110, 0, 0, 0, 0, 12, 124,
+ 67, 111, 115, 116, 68, 105, 115, 112, 108, 97,
+ 121, 0, 0, 0, 0, 15, 124, 68, 97, 121,
+ 67, 111, 117, 110, 116, 100, 111, 119, 110, 85,
+ 73, 0, 0, 0, 0, 15, 124, 68, 101, 109,
+ 111, 81, 117, 105, 116, 83, 119, 105, 116, 99,
+ 104, 0, 0, 0, 0, 24, 124, 68, 105, 115,
+ 97, 98, 108, 101, 66, 117, 116, 116, 111, 110,
+ 73, 110, 87, 97, 118, 101, 90, 101, 114, 111,
+ 0, 0, 0, 0, 26, 124, 68, 121, 110, 97,
+ 109, 105, 99, 76, 97, 121, 111, 117, 116, 71,
+ 114, 111, 117, 112, 83, 112, 97, 99, 105, 110,
+ 103, 0, 0, 0, 0, 24, 124, 69, 110, 100,
+ 79, 102, 77, 97, 116, 99, 104, 83, 99, 111,
+ 114, 101, 85, 73, 72, 101, 108, 112, 101, 114,
+ 0, 0, 0, 0, 13, 124, 69, 110, 100, 79,
+ 102, 77, 97, 116, 99, 104, 85, 73, 0, 0,
+ 0, 0, 21, 124, 69, 110, 100, 115, 99, 114,
+ 101, 101, 110, 82, 101, 116, 114, 121, 72, 101,
+ 108, 112, 101, 114, 0, 0, 0, 0, 26, 124,
+ 69, 110, 101, 109, 121, 83, 99, 114, 101, 101,
+ 110, 77, 97, 114, 107, 101, 114, 85, 73, 72,
+ 101, 108, 112, 101, 114, 0, 0, 0, 0, 13,
+ 124, 69, 110, 117, 109, 83, 101, 108, 101, 99,
+ 116, 111, 114, 0, 0, 0, 0, 28, 124, 69,
+ 110, 117, 109, 83, 101, 108, 101, 99, 116, 111,
+ 114, 66, 117, 116, 116, 111, 110, 65, 110, 105,
+ 109, 97, 116, 105, 111, 110, 0, 0, 0, 0,
+ 19, 124, 69, 84, 67, 104, 111, 105, 99, 101,
+ 80, 105, 99, 107, 83, 99, 114, 101, 101, 110,
+ 0, 0, 0, 0, 30, 124, 69, 116, 101, 114,
+ 110, 97, 108, 84, 114, 105, 97, 108, 115, 72,
+ 105, 103, 104, 115, 99, 111, 114, 101, 80, 114,
+ 101, 118, 105, 101, 119, 0, 0, 0, 0, 33,
+ 124, 69, 116, 101, 114, 110, 97, 108, 84, 114,
+ 105, 97, 108, 115, 76, 111, 97, 100, 111, 117,
+ 116, 83, 99, 114, 101, 101, 110, 72, 101, 108,
+ 112, 101, 114, 0, 0, 0, 0, 24, 124, 69,
+ 116, 101, 114, 110, 97, 108, 84, 114, 105, 97,
+ 108, 115, 77, 97, 112, 80, 114, 101, 118, 105,
+ 101, 119, 0, 0, 0, 0, 26, 124, 69, 116,
+ 101, 114, 110, 97, 108, 84, 114, 105, 97, 108,
+ 115, 83, 101, 108, 101, 99, 116, 83, 99, 114,
+ 101, 101, 110, 0, 0, 0, 0, 31, 124, 69,
+ 116, 101, 114, 110, 97, 108, 84, 114, 105, 97,
+ 108, 115, 83, 116, 97, 103, 101, 67, 111, 117,
+ 110, 116, 68, 105, 115, 112, 108, 97, 121, 0,
+ 0, 0, 0, 19, 124, 69, 84, 77, 97, 112,
+ 67, 104, 111, 105, 99, 101, 68, 105, 115, 112,
+ 108, 97, 121, 0, 0, 0, 0, 26, 69, 84,
+ 77, 97, 112, 67, 104, 111, 105, 99, 101, 68,
+ 105, 115, 112, 108, 97, 121, 124, 77, 97, 112,
+ 73, 99, 111, 110, 0, 0, 0, 0, 12, 124,
+ 71, 114, 97, 112, 104, 68, 114, 97, 119, 101,
+ 114, 0, 0, 0, 0, 19, 124, 72, 105, 103,
+ 104, 115, 99, 111, 114, 101, 80, 114, 101, 118,
+ 105, 101, 119, 85, 73, 0, 0, 0, 0, 15,
+ 124, 72, 105, 103, 104, 115, 99, 111, 114, 101,
+ 84, 97, 98, 108, 101, 0, 0, 0, 0, 18,
+ 124, 73, 110, 71, 97, 109, 101, 80, 111, 112,
+ 85, 112, 72, 101, 108, 112, 101, 114, 0, 0,
+ 0, 0, 12, 124, 73, 110, 71, 97, 109, 101,
+ 80, 111, 112, 85, 112, 0, 0, 0, 0, 21,
+ 124, 73, 110, 71, 97, 109, 101, 82, 101, 115,
+ 105, 103, 110, 85, 73, 72, 101, 108, 112, 101,
+ 114, 0, 0, 0, 0, 20, 124, 73, 110, 77,
+ 97, 116, 99, 104, 82, 101, 115, 105, 103, 110,
+ 72, 101, 108, 112, 101, 114, 0, 0, 0, 0,
+ 12, 124, 75, 101, 121, 82, 101, 98, 105, 110,
+ 100, 101, 114, 0, 0, 0, 0, 17, 124, 76,
+ 101, 118, 101, 108, 78, 97, 109, 101, 68, 105,
+ 115, 112, 108, 97, 121, 0, 0, 0, 0, 25,
+ 124, 76, 101, 118, 101, 108, 83, 101, 108, 101,
+ 99, 116, 85, 73, 70, 114, 97, 109, 101, 72,
+ 101, 108, 112, 101, 114, 0, 0, 0, 0, 23,
+ 124, 76, 101, 118, 101, 108, 85, 112, 83, 99,
+ 114, 101, 101, 110, 65, 110, 105, 109, 97, 116,
+ 105, 111, 110, 0, 0, 0, 0, 16, 124, 76,
+ 111, 97, 100, 111, 117, 116, 85, 73, 72, 101,
+ 108, 112, 101, 114, 0, 0, 0, 0, 19, 124,
+ 76, 118, 108, 83, 101, 108, 101, 99, 116, 84,
+ 97, 98, 66, 117, 116, 116, 111, 110, 0, 0,
+ 0, 0, 17, 124, 77, 111, 100, 101, 82, 117,
+ 108, 101, 115, 68, 105, 115, 112, 108, 97, 121,
+ 0, 0, 0, 0, 10, 124, 78, 105, 103, 104,
+ 116, 67, 97, 108, 108, 0, 0, 0, 0, 20,
+ 124, 78, 105, 103, 104, 116, 80, 114, 101, 118,
+ 105, 101, 119, 69, 108, 101, 109, 101, 110, 116,
+ 0, 0, 0, 0, 13, 124, 78, 105, 103, 104,
+ 116, 115, 99, 111, 114, 101, 85, 73, 0, 0,
+ 0, 0, 22, 124, 80, 97, 117, 115, 101, 66,
+ 97, 99, 107, 84, 111, 77, 101, 110, 117, 72,
+ 101, 108, 112, 101, 114, 0, 0, 0, 0, 21,
+ 124, 80, 97, 117, 115, 101, 85, 73, 76, 111,
+ 97, 100, 111, 117, 116, 72, 101, 108, 112, 101,
+ 114, 0, 0, 0, 0, 27, 124, 80, 101, 114,
+ 107, 83, 101, 108, 101, 99, 116, 105, 111, 110,
+ 84, 111, 111, 108, 116, 105, 112, 72, 101, 108,
+ 112, 101, 114, 0, 0, 0, 0, 21, 124, 80,
+ 104, 121, 115, 105, 99, 97, 108, 67, 111, 105,
+ 110, 65, 110, 105, 109, 97, 116, 111, 114, 0,
+ 0, 0, 0, 25, 124, 81, 117, 101, 115, 116,
+ 67, 111, 110, 100, 105, 116, 105, 111, 110, 69,
+ 113, 117, 105, 112, 112, 97, 98, 108, 101, 0,
+ 0, 0, 0, 11, 124, 81, 117, 101, 115, 116,
+ 69, 110, 116, 114, 121, 0, 0, 0, 0, 10,
+ 124, 81, 117, 101, 115, 116, 77, 101, 110, 117,
+ 0, 0, 0, 0, 28, 124, 81, 117, 101, 115,
+ 116, 79, 118, 101, 114, 97, 108, 108, 80, 114,
+ 111, 103, 114, 101, 115, 115, 68, 105, 115, 112,
+ 108, 97, 121, 0, 0, 0, 0, 11, 124, 81,
+ 117, 101, 115, 116, 84, 97, 103, 85, 73, 0,
+ 0, 0, 0, 22, 124, 82, 97, 110, 103, 101,
+ 73, 110, 100, 105, 99, 97, 116, 111, 114, 72,
+ 97, 110, 100, 108, 101, 114, 0, 0, 0, 0,
+ 37, 82, 97, 110, 103, 101, 73, 110, 100, 105,
+ 99, 97, 116, 111, 114, 72, 97, 110, 100, 108,
+ 101, 114, 124, 73, 110, 100, 105, 99, 97, 116,
+ 111, 114, 72, 97, 110, 100, 108, 101, 0, 0,
+ 0, 0, 20, 124, 82, 101, 115, 101, 116, 67,
+ 111, 110, 116, 114, 111, 108, 115, 72, 101, 108,
+ 112, 101, 114, 0, 0, 0, 0, 12, 124, 82,
+ 101, 118, 105, 118, 101, 80, 97, 110, 101, 108,
+ 0, 0, 0, 0, 9, 124, 83, 99, 111, 114,
+ 101, 84, 97, 103, 0, 0, 0, 0, 25, 124,
+ 83, 99, 114, 101, 101, 110, 77, 97, 114, 107,
+ 101, 114, 67, 97, 110, 118, 97, 115, 72, 101,
+ 108, 112, 101, 114, 0, 0, 0, 0, 11, 124,
+ 83, 99, 114, 111, 108, 108, 65, 114, 101, 97,
+ 0, 0, 0, 0, 16, 124, 83, 99, 114, 111,
+ 108, 108, 69, 108, 101, 109, 101, 110, 116, 73,
+ 68, 0, 0, 0, 0, 13, 124, 83, 101, 108,
+ 101, 99, 116, 85, 110, 105, 116, 85, 73, 0,
+ 0, 0, 0, 17, 124, 83, 101, 116, 116, 105,
+ 110, 103, 115, 85, 73, 72, 101, 108, 112, 101,
+ 114, 0, 0, 0, 0, 28, 83, 101, 116, 116,
+ 105, 110, 103, 115, 85, 73, 72, 101, 108, 112,
+ 101, 114, 124, 83, 101, 116, 116, 105, 110, 103,
+ 115, 84, 97, 98, 0, 0, 0, 0, 17, 124,
+ 83, 101, 116, 87, 105, 100, 116, 104, 84, 111,
+ 84, 97, 114, 103, 101, 116, 0, 0, 0, 0,
+ 15, 124, 83, 105, 109, 112, 108, 101, 85, 73,
+ 83, 99, 97, 108, 101, 114, 0, 0, 0, 0,
+ 26, 124, 83, 105, 122, 101, 82, 101, 99, 116,
+ 97, 110, 103, 108, 101, 84, 111, 77, 101, 115,
+ 104, 66, 111, 117, 110, 100, 115, 0, 0, 0,
+ 0, 21, 124, 84, 101, 120, 116, 66, 97, 99,
+ 107, 103, 114, 111, 117, 110, 100, 70, 105, 116,
+ 116, 101, 114, 0, 0, 0, 0, 11, 124, 84,
+ 101, 120, 116, 77, 105, 114, 114, 111, 114, 0,
+ 0, 0, 0, 16, 124, 84, 70, 85, 73, 65,
+ 117, 100, 105, 111, 72, 101, 108, 112, 101, 114,
+ 0, 0, 0, 0, 20, 124, 84, 70, 85, 73,
+ 66, 108, 111, 99, 107, 111, 117, 116, 69, 108,
+ 101, 109, 101, 110, 116, 0, 0, 0, 0, 25,
+ 124, 84, 70, 85, 73, 67, 104, 101, 99, 107,
+ 98, 111, 120, 77, 111, 117, 115, 101, 67, 97,
+ 116, 99, 104, 101, 114, 0, 0, 0, 0, 10,
+ 124, 84, 70, 85, 73, 69, 110, 101, 109, 121,
+ 0, 0, 0, 0, 15, 84, 70, 85, 73, 69,
+ 110, 101, 109, 121, 124, 83, 116, 121, 108, 101,
+ 0, 0, 0, 0, 19, 84, 70, 85, 73, 69,
+ 110, 101, 109, 121, 124, 65, 110, 105, 109, 97,
+ 116, 105, 111, 110, 0, 0, 0, 0, 21, 124,
+ 84, 70, 85, 73, 69, 110, 117, 109, 77, 111,
+ 117, 115, 101, 67, 97, 116, 99, 104, 101, 114,
+ 0, 0, 0, 0, 23, 124, 84, 70, 85, 73,
+ 69, 110, 117, 109, 83, 101, 108, 101, 99, 116,
+ 111, 114, 66, 117, 116, 116, 111, 110, 0, 0,
+ 0, 0, 15, 124, 84, 70, 85, 73, 69, 113,
+ 117, 105, 112, 112, 97, 98, 108, 101, 0, 0,
+ 0, 0, 20, 84, 70, 85, 73, 69, 113, 117,
+ 105, 112, 112, 97, 98, 108, 101, 124, 83, 116,
+ 121, 108, 101, 0, 0, 0, 0, 24, 84, 70,
+ 85, 73, 69, 113, 117, 105, 112, 112, 97, 98,
+ 108, 101, 124, 65, 110, 105, 109, 97, 116, 105,
+ 111, 110, 0, 0, 0, 0, 17, 124, 84, 70,
+ 85, 73, 70, 111, 99, 117, 115, 67, 97, 116,
+ 99, 104, 101, 114, 0, 0, 0, 0, 18, 124,
+ 84, 70, 85, 73, 73, 110, 99, 111, 109, 101,
+ 68, 105, 115, 112, 108, 97, 121, 0, 0, 0,
+ 0, 13, 124, 84, 70, 85, 73, 80, 101, 114,
+ 107, 108, 105, 107, 101, 0, 0, 0, 0, 18,
+ 84, 70, 85, 73, 80, 101, 114, 107, 108, 105,
+ 107, 101, 124, 83, 116, 121, 108, 101, 0, 0,
+ 0, 0, 22, 84, 70, 85, 73, 80, 101, 114,
+ 107, 108, 105, 107, 101, 124, 65, 110, 105, 109,
+ 97, 116, 105, 111, 110, 0, 0, 0, 0, 14,
+ 124, 84, 70, 85, 73, 83, 99, 114, 111, 108,
+ 108, 66, 97, 114, 0, 0, 0, 0, 11, 124,
+ 84, 70, 85, 73, 83, 108, 105, 100, 101, 114,
+ 0, 0, 0, 0, 19, 124, 84, 70, 85, 73,
+ 83, 108, 105, 100, 101, 114, 68, 114, 97, 103,
+ 65, 114, 101, 97, 0, 0, 0, 0, 15, 124,
+ 84, 70, 85, 73, 84, 101, 120, 116, 66, 117,
+ 116, 116, 111, 110, 0, 0, 0, 0, 20, 84,
+ 70, 85, 73, 84, 101, 120, 116, 66, 117, 116,
+ 116, 111, 110, 124, 83, 116, 121, 108, 101, 0,
+ 0, 0, 0, 24, 84, 70, 85, 73, 84, 101,
+ 120, 116, 66, 117, 116, 116, 111, 110, 124, 65,
+ 110, 105, 109, 97, 116, 105, 111, 110, 0, 0,
+ 0, 0, 18, 124, 84, 70, 85, 73, 85, 112,
+ 103, 114, 97, 100, 101, 67, 104, 111, 105, 99,
+ 101, 0, 0, 0, 0, 23, 84, 70, 85, 73,
+ 85, 112, 103, 114, 97, 100, 101, 67, 104, 111,
+ 105, 99, 101, 124, 83, 116, 121, 108, 101, 0,
+ 0, 0, 0, 27, 84, 70, 85, 73, 85, 112,
+ 103, 114, 97, 100, 101, 67, 104, 111, 105, 99,
+ 101, 124, 65, 110, 105, 109, 97, 116, 105, 111,
+ 110, 0, 0, 0, 0, 20, 124, 84, 104, 114,
+ 111, 110, 101, 102, 97, 108, 108, 85, 73, 69,
+ 108, 101, 109, 101, 110, 116, 0, 0, 0, 0,
+ 23, 124, 84, 105, 116, 108, 101, 83, 99, 114,
+ 101, 101, 110, 80, 111, 112, 85, 112, 72, 101,
+ 108, 112, 101, 114, 0, 0, 0, 0, 16, 124,
+ 66, 101, 102, 111, 114, 101, 71, 97, 109, 101,
+ 80, 111, 112, 85, 112, 0, 0, 0, 0, 20,
+ 124, 84, 105, 116, 108, 101, 83, 99, 114, 101,
+ 101, 110, 85, 73, 72, 101, 108, 112, 101, 114,
+ 0, 0, 0, 0, 8, 124, 84, 111, 111, 108,
+ 116, 105, 112, 0, 0, 0, 0, 32, 124, 84,
+ 114, 97, 110, 115, 105, 116, 105, 111, 110, 84,
+ 111, 83, 101, 108, 101, 99, 116, 101, 100, 76,
+ 101, 118, 101, 108, 72, 101, 108, 112, 101, 114,
+ 0, 0, 0, 0, 22, 124, 84, 114, 101, 97,
+ 115, 117, 114, 101, 67, 104, 101, 115, 116, 85,
+ 73, 72, 101, 108, 112, 101, 114, 0, 0, 0,
+ 0, 11, 124, 84, 114, 101, 97, 115, 117, 114,
+ 121, 85, 73, 0, 0, 0, 0, 19, 124, 85,
+ 73, 66, 111, 110, 117, 115, 76, 101, 118, 101,
+ 108, 83, 101, 108, 101, 99, 116, 0, 0, 0,
+ 0, 34, 85, 73, 66, 111, 110, 117, 115, 76,
+ 101, 118, 101, 108, 83, 101, 108, 101, 99, 116,
+ 124, 76, 101, 118, 101, 108, 66, 117, 116, 116,
+ 111, 110, 80, 97, 105, 114, 0, 0, 0, 0,
+ 8, 124, 85, 73, 70, 114, 97, 109, 101, 0,
+ 0, 0, 0, 15, 124, 85, 73, 70, 114, 97,
+ 109, 101, 77, 97, 110, 97, 103, 101, 114, 0,
+ 0, 0, 0, 32, 85, 73, 70, 114, 97, 109,
+ 101, 77, 97, 110, 97, 103, 101, 114, 124, 70,
+ 114, 97, 109, 101, 83, 116, 97, 99, 107, 69,
+ 108, 101, 109, 101, 110, 116, 0, 0, 0, 0,
+ 16, 124, 85, 73, 80, 97, 114, 101, 110, 116,
+ 82, 101, 115, 105, 122, 101, 114, 0, 0, 0,
+ 0, 21, 124, 86, 101, 114, 115, 105, 111, 110,
+ 78, 117, 109, 98, 101, 114, 68, 105, 115, 112,
+ 108, 97, 121, 0, 0, 0, 0, 15, 124, 87,
+ 97, 118, 101, 67, 111, 117, 110, 116, 80, 111,
+ 112, 85, 112, 0, 0, 0, 0, 18, 124, 87,
+ 97, 118, 101, 68, 101, 115, 99, 114, 105, 112,
+ 116, 105, 111, 110, 85, 73, 0, 0, 0, 0,
+ 15, 124, 87, 105, 115, 104, 108, 105, 115, 116,
+ 66, 117, 116, 116, 111, 110, 0, 0, 0, 0,
+ 15, 124, 85, 73, 83, 99, 97, 108, 101, 72,
+ 97, 110, 100, 108, 101, 114, 0, 0, 0, 0,
+ 13, 124, 85, 110, 105, 116, 68, 97, 115, 104,
+ 74, 117, 109, 112, 0, 0, 0, 0, 23, 124,
+ 85, 110, 105, 116, 80, 114, 111, 100, 117, 99,
+ 116, 105, 111, 110, 83, 101, 108, 101, 99, 116,
+ 111, 114, 0, 0, 0, 0, 26, 124, 85, 110,
+ 105, 116, 82, 101, 115, 112, 97, 119, 110, 101,
+ 114, 70, 111, 114, 66, 117, 105, 108, 100, 105,
+ 110, 103, 115, 0, 0, 0, 0, 16, 124, 85,
+ 110, 112, 97, 114, 101, 110, 116, 79, 110, 83,
+ 116, 97, 114, 116, 0, 0, 0, 0, 21, 124,
+ 85, 112, 103, 114, 97, 100, 101, 85, 110, 105,
+ 116, 115, 79, 110, 69, 110, 97, 98, 108, 101,
+ 0, 0, 0, 0, 7, 124, 87, 101, 97, 112,
+ 111, 110, 0, 0, 0, 0, 19, 124, 87, 101,
+ 97, 112, 111, 110, 68, 97, 109, 97, 103, 101,
+ 68, 101, 97, 108, 101, 114, 0, 0, 0, 0,
+ 15, 124, 87, 101, 97, 112, 111, 110, 69, 113,
+ 117, 105, 112, 112, 101, 114, 0, 0, 0, 0,
+ 12, 65, 114, 97, 124, 65, 114, 97, 84, 114,
+ 97, 105, 108, 0, 0, 0, 0, 23, 65, 114,
+ 97, 46, 65, 114, 97, 84, 114, 97, 105, 108,
+ 124, 67, 117, 114, 118, 101, 70, 114, 97, 109,
+ 101, 0, 0, 0, 0, 18, 65, 114, 97, 46,
+ 65, 114, 97, 84, 114, 97, 105, 108, 124, 80,
+ 111, 105, 110, 116, 0, 0, 0, 0, 16, 65,
+ 114, 97, 124, 69, 108, 97, 115, 116, 105, 99,
+ 65, 114, 114, 97, 121, 0, 0, 0, 0, 10,
+ 124, 66, 97, 107, 101, 84, 114, 97, 105, 108,
+ 0, 0, 0, 0, 18, 65, 114, 97, 124, 67,
+ 111, 108, 111, 114, 70, 114, 111, 109, 83, 112,
+ 101, 101, 100, 0, 0, 0, 0, 17, 65, 114,
+ 97, 124, 69, 108, 101, 99, 116, 114, 105, 99,
+ 97, 108, 65, 114, 99, 0, 0, 0, 0, 13,
+ 65, 114, 97, 124, 84, 105, 114, 101, 84, 114,
+ 97, 99, 107, 0, 0, 0, 0, 16, 65, 114,
+ 97, 124, 84, 114, 97, 105, 108, 83, 101, 99,
+ 116, 105, 111, 110, 0, 0, 0, 0, 18, 70,
+ 108, 97, 116, 75, 105, 116, 124, 85, 118, 83,
+ 99, 114, 111, 108, 108, 101, 114, 0, 0, 0,
+ 0, 23, 70, 108, 97, 116, 75, 105, 116, 124,
+ 66, 108, 105, 116, 84, 101, 120, 116, 117, 114,
+ 101, 80, 97, 115, 115, 0, 0, 0, 0, 18,
+ 70, 108, 97, 116, 75, 105, 116, 124, 70, 108,
+ 97, 116, 75, 105, 116, 70, 111, 103, 0, 0,
+ 0, 0, 19, 70, 108, 97, 116, 75, 105, 116,
+ 124, 70, 111, 103, 83, 101, 116, 116, 105, 110,
+ 103, 115, 0, 0, 0, 0, 22, 70, 108, 97,
+ 116, 75, 105, 116, 124, 70, 108, 97, 116, 75,
+ 105, 116, 79, 117, 116, 108, 105, 110, 101, 0,
+ 0, 0, 0, 23, 70, 108, 97, 116, 75, 105,
+ 116, 124, 79, 117, 116, 108, 105, 110, 101, 83,
+ 101, 116, 116, 105, 110, 103, 115, 0, 0, 0,
+ 0, 16, 70, 108, 97, 116, 75, 105, 116, 124,
+ 66, 117, 111, 121, 97, 110, 99, 121, 0, 0,
+ 0, 0, 27, 73, 50, 46, 76, 111, 99, 124,
+ 67, 97, 108, 108, 98, 97, 99, 107, 78, 111,
+ 116, 105, 102, 105, 99, 97, 116, 105, 111, 110,
+ 0, 0, 0, 0, 29, 73, 50, 46, 76, 111,
+ 99, 124, 69, 120, 97, 109, 112, 108, 101, 95,
+ 67, 104, 97, 110, 103, 101, 76, 97, 110, 103,
+ 117, 97, 103, 101, 0, 0, 0, 0, 30, 73,
+ 50, 46, 76, 111, 99, 124, 69, 120, 97, 109,
+ 112, 108, 101, 95, 76, 111, 99, 97, 108, 105,
+ 122, 101, 100, 83, 116, 114, 105, 110, 103, 0,
+ 0, 0, 0, 30, 73, 50, 46, 76, 111, 99,
+ 124, 71, 108, 111, 98, 97, 108, 80, 97, 114,
+ 97, 109, 101, 116, 101, 114, 115, 69, 120, 97,
+ 109, 112, 108, 101, 0, 0, 0, 0, 26, 73,
+ 50, 46, 76, 111, 99, 124, 82, 101, 97, 108,
+ 84, 105, 109, 101, 84, 114, 97, 110, 115, 108,
+ 97, 116, 105, 111, 110, 0, 0, 0, 0, 29,
+ 73, 50, 46, 76, 111, 99, 124, 82, 101, 103,
+ 105, 115, 116, 101, 114, 66, 117, 110, 100, 108,
+ 101, 115, 77, 97, 110, 97, 103, 101, 114, 0,
+ 0, 0, 0, 21, 73, 50, 46, 76, 111, 99,
+ 124, 84, 111, 103, 103, 108, 101, 76, 97, 110,
+ 103, 117, 97, 103, 101, 0, 0, 0, 0, 24,
+ 73, 50, 46, 76, 111, 99, 124, 80, 101, 114,
+ 115, 105, 115, 116, 101, 110, 116, 83, 116, 111,
+ 114, 97, 103, 101, 0, 0, 0, 0, 30, 73,
+ 50, 46, 76, 111, 99, 124, 73, 50, 66, 97,
+ 115, 101, 80, 101, 114, 115, 105, 115, 116, 101,
+ 110, 116, 83, 116, 111, 114, 97, 103, 101, 0,
+ 0, 0, 0, 32, 73, 50, 46, 76, 111, 99,
+ 124, 73, 50, 67, 117, 115, 116, 111, 109, 80,
+ 101, 114, 115, 105, 115, 116, 101, 110, 116, 83,
+ 116, 111, 114, 97, 103, 101, 0, 0, 0, 0,
+ 32, 73, 50, 46, 76, 111, 99, 124, 66, 97,
+ 115, 101, 83, 112, 101, 99, 105, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 77, 97, 110, 97,
+ 103, 101, 114, 0, 0, 0, 0, 28, 73, 50,
+ 46, 76, 111, 99, 124, 83, 112, 101, 99, 105,
+ 97, 108, 105, 122, 97, 116, 105, 111, 110, 77,
+ 97, 110, 97, 103, 101, 114, 0, 0, 0, 0,
+ 20, 73, 50, 46, 76, 111, 99, 124, 69, 118,
+ 101, 110, 116, 67, 97, 108, 108, 98, 97, 99,
+ 107, 0, 0, 0, 0, 22, 73, 50, 46, 76,
+ 111, 99, 124, 71, 111, 111, 103, 108, 101, 76,
+ 97, 110, 103, 117, 97, 103, 101, 115, 0, 0,
+ 0, 0, 38, 73, 50, 46, 76, 111, 99, 46,
+ 71, 111, 111, 103, 108, 101, 76, 97, 110, 103,
+ 117, 97, 103, 101, 115, 124, 76, 97, 110, 103,
+ 117, 97, 103, 101, 67, 111, 100, 101, 68, 101,
+ 102, 1, 0, 0, 0, 24, 73, 50, 46, 76,
+ 111, 99, 124, 71, 111, 111, 103, 108, 101, 84,
+ 114, 97, 110, 115, 108, 97, 116, 105, 111, 110,
+ 1, 0, 0, 0, 24, 73, 50, 46, 76, 111,
+ 99, 124, 71, 111, 111, 103, 108, 101, 84, 114,
+ 97, 110, 115, 108, 97, 116, 105, 111, 110, 0,
+ 0, 0, 0, 23, 73, 50, 46, 76, 111, 99,
+ 124, 84, 114, 97, 110, 115, 108, 97, 116, 105,
+ 111, 110, 81, 117, 101, 114, 121, 1, 0, 0,
+ 0, 24, 73, 50, 46, 76, 111, 99, 124, 71,
+ 111, 111, 103, 108, 101, 84, 114, 97, 110, 115,
+ 108, 97, 116, 105, 111, 110, 0, 0, 0, 0,
+ 26, 73, 50, 46, 76, 111, 99, 46, 83, 105,
+ 109, 112, 108, 101, 74, 83, 79, 78, 124, 74,
+ 83, 79, 78, 78, 111, 100, 101, 0, 0, 0,
+ 0, 27, 73, 50, 46, 76, 111, 99, 46, 83,
+ 105, 109, 112, 108, 101, 74, 83, 79, 78, 124,
+ 74, 83, 79, 78, 65, 114, 114, 97, 121, 0,
+ 0, 0, 0, 27, 73, 50, 46, 76, 111, 99,
+ 46, 83, 105, 109, 112, 108, 101, 74, 83, 79,
+ 78, 124, 74, 83, 79, 78, 67, 108, 97, 115,
+ 115, 0, 0, 0, 0, 26, 73, 50, 46, 76,
+ 111, 99, 46, 83, 105, 109, 112, 108, 101, 74,
+ 83, 79, 78, 124, 74, 83, 79, 78, 68, 97,
+ 116, 97, 0, 0, 0, 0, 33, 73, 50, 46,
+ 76, 111, 99, 46, 83, 105, 109, 112, 108, 101,
+ 74, 83, 79, 78, 124, 74, 83, 79, 78, 76,
+ 97, 122, 121, 67, 114, 101, 97, 116, 111, 114,
+ 0, 0, 0, 0, 22, 73, 50, 46, 76, 111,
+ 99, 46, 83, 105, 109, 112, 108, 101, 74, 83,
+ 79, 78, 124, 74, 83, 79, 78, 0, 0, 0,
+ 0, 21, 73, 50, 46, 76, 111, 99, 124, 84,
+ 114, 97, 110, 115, 108, 97, 116, 105, 111, 110,
+ 74, 111, 98, 0, 0, 0, 0, 25, 73, 50,
+ 46, 76, 111, 99, 124, 84, 114, 97, 110, 115,
+ 108, 97, 116, 105, 111, 110, 74, 111, 98, 95,
+ 87, 87, 87, 0, 0, 0, 0, 25, 73, 50,
+ 46, 76, 111, 99, 124, 84, 114, 97, 110, 115,
+ 108, 97, 116, 105, 111, 110, 74, 111, 98, 95,
+ 71, 69, 84, 0, 0, 0, 0, 26, 73, 50,
+ 46, 76, 111, 99, 124, 84, 114, 97, 110, 115,
+ 108, 97, 116, 105, 111, 110, 74, 111, 98, 95,
+ 77, 97, 105, 110, 0, 0, 0, 0, 26, 73,
+ 50, 46, 76, 111, 99, 124, 84, 114, 97, 110,
+ 115, 108, 97, 116, 105, 111, 110, 74, 111, 98,
+ 95, 80, 79, 83, 84, 0, 0, 0, 0, 25,
+ 73, 50, 46, 76, 111, 99, 124, 84, 114, 97,
+ 110, 115, 108, 97, 116, 105, 111, 110, 74, 111,
+ 98, 95, 87, 69, 66, 0, 0, 0, 0, 19,
+ 73, 50, 46, 76, 111, 99, 124, 76, 97, 110,
+ 103, 117, 97, 103, 101, 68, 97, 116, 97, 0,
+ 0, 0, 0, 21, 73, 50, 46, 76, 111, 99,
+ 124, 76, 97, 110, 103, 117, 97, 103, 101, 83,
+ 111, 117, 114, 99, 101, 0, 0, 0, 0, 26,
+ 73, 50, 46, 76, 111, 99, 124, 76, 97, 110,
+ 103, 117, 97, 103, 101, 83, 111, 117, 114, 99,
+ 101, 65, 115, 115, 101, 116, 0, 0, 0, 0,
+ 22, 73, 50, 46, 76, 111, 99, 124, 73, 76,
+ 97, 110, 103, 117, 97, 103, 101, 83, 111, 117,
+ 114, 99, 101, 1, 0, 0, 0, 25, 73, 50,
+ 46, 76, 111, 99, 124, 76, 97, 110, 103, 117,
+ 97, 103, 101, 83, 111, 117, 114, 99, 101, 68,
+ 97, 116, 97, 1, 0, 0, 0, 25, 73, 50,
+ 46, 76, 111, 99, 124, 76, 97, 110, 103, 117,
+ 97, 103, 101, 83, 111, 117, 114, 99, 101, 68,
+ 97, 116, 97, 1, 0, 0, 0, 25, 73, 50,
+ 46, 76, 111, 99, 124, 76, 97, 110, 103, 117,
+ 97, 103, 101, 83, 111, 117, 114, 99, 101, 68,
+ 97, 116, 97, 1, 0, 0, 0, 25, 73, 50,
+ 46, 76, 111, 99, 124, 76, 97, 110, 103, 117,
+ 97, 103, 101, 83, 111, 117, 114, 99, 101, 68,
+ 97, 116, 97, 1, 0, 0, 0, 25, 73, 50,
+ 46, 76, 111, 99, 124, 76, 97, 110, 103, 117,
+ 97, 103, 101, 83, 111, 117, 114, 99, 101, 68,
+ 97, 116, 97, 1, 0, 0, 0, 25, 73, 50,
+ 46, 76, 111, 99, 124, 76, 97, 110, 103, 117,
+ 97, 103, 101, 83, 111, 117, 114, 99, 101, 68,
+ 97, 116, 97, 1, 0, 0, 0, 25, 73, 50,
+ 46, 76, 111, 99, 124, 76, 97, 110, 103, 117,
+ 97, 103, 101, 83, 111, 117, 114, 99, 101, 68,
+ 97, 116, 97, 1, 0, 0, 0, 25, 73, 50,
+ 46, 76, 111, 99, 124, 76, 97, 110, 103, 117,
+ 97, 103, 101, 83, 111, 117, 114, 99, 101, 68,
+ 97, 116, 97, 1, 0, 0, 0, 25, 73, 50,
+ 46, 76, 111, 99, 124, 76, 97, 110, 103, 117,
+ 97, 103, 101, 83, 111, 117, 114, 99, 101, 68,
+ 97, 116, 97, 0, 0, 0, 0, 25, 73, 50,
+ 46, 76, 111, 99, 124, 76, 111, 99, 97, 108,
+ 105, 122, 97, 116, 105, 111, 110, 82, 101, 97,
+ 100, 101, 114, 0, 0, 0, 0, 15, 73, 50,
+ 46, 76, 111, 99, 124, 76, 111, 99, 97, 108,
+ 105, 122, 101, 0, 0, 0, 0, 23, 73, 50,
+ 46, 76, 111, 99, 124, 76, 111, 99, 97, 108,
+ 105, 122, 101, 68, 114, 111, 112, 100, 111, 119,
+ 110, 1, 0, 0, 0, 26, 73, 50, 46, 76,
+ 111, 99, 124, 76, 111, 99, 97, 108, 105, 122,
+ 97, 116, 105, 111, 110, 77, 97, 110, 97, 103,
+ 101, 114, 1, 0, 0, 0, 26, 73, 50, 46,
+ 76, 111, 99, 124, 76, 111, 99, 97, 108, 105,
+ 122, 97, 116, 105, 111, 110, 77, 97, 110, 97,
+ 103, 101, 114, 1, 0, 0, 0, 26, 73, 50,
+ 46, 76, 111, 99, 124, 76, 111, 99, 97, 108,
+ 105, 122, 97, 116, 105, 111, 110, 77, 97, 110,
+ 97, 103, 101, 114, 1, 0, 0, 0, 26, 73,
+ 50, 46, 76, 111, 99, 124, 76, 111, 99, 97,
+ 108, 105, 122, 97, 116, 105, 111, 110, 77, 97,
+ 110, 97, 103, 101, 114, 1, 0, 0, 0, 26,
+ 73, 50, 46, 76, 111, 99, 124, 76, 111, 99,
+ 97, 108, 105, 122, 97, 116, 105, 111, 110, 77,
+ 97, 110, 97, 103, 101, 114, 1, 0, 0, 0,
+ 26, 73, 50, 46, 76, 111, 99, 124, 76, 111,
+ 99, 97, 108, 105, 122, 97, 116, 105, 111, 110,
+ 77, 97, 110, 97, 103, 101, 114, 1, 0, 0,
+ 0, 26, 73, 50, 46, 76, 111, 99, 124, 76,
+ 111, 99, 97, 108, 105, 122, 97, 116, 105, 111,
+ 110, 77, 97, 110, 97, 103, 101, 114, 1, 0,
+ 0, 0, 26, 73, 50, 46, 76, 111, 99, 124,
+ 76, 111, 99, 97, 108, 105, 122, 97, 116, 105,
+ 111, 110, 77, 97, 110, 97, 103, 101, 114, 0,
+ 0, 0, 0, 22, 73, 50, 46, 76, 111, 99,
+ 124, 73, 76, 111, 99, 97, 108, 105, 122, 101,
+ 84, 97, 114, 103, 101, 116, 0, 0, 0, 0,
+ 21, 73, 50, 46, 76, 111, 99, 124, 76, 111,
+ 99, 97, 108, 105, 122, 101, 84, 97, 114, 103,
+ 101, 116, 0, 0, 0, 0, 32, 73, 50, 46,
+ 76, 111, 99, 124, 73, 76, 111, 99, 97, 108,
+ 105, 122, 101, 84, 97, 114, 103, 101, 116, 68,
+ 101, 115, 99, 114, 105, 112, 116, 111, 114, 0,
+ 0, 0, 0, 25, 73, 50, 46, 76, 111, 99,
+ 124, 76, 111, 99, 97, 108, 105, 122, 101, 84,
+ 97, 114, 103, 101, 116, 68, 101, 115, 99, 0,
+ 0, 0, 0, 30, 73, 50, 46, 76, 111, 99,
+ 124, 76, 111, 99, 97, 108, 105, 122, 101, 84,
+ 97, 114, 103, 101, 116, 68, 101, 115, 99, 95,
+ 84, 121, 112, 101, 0, 0, 0, 0, 39, 73,
+ 50, 46, 76, 111, 99, 124, 76, 111, 99, 97,
+ 108, 105, 122, 101, 84, 97, 114, 103, 101, 116,
+ 95, 84, 101, 120, 116, 77, 101, 115, 104, 80,
+ 114, 111, 95, 76, 97, 98, 101, 108, 0, 0,
+ 0, 0, 38, 73, 50, 46, 76, 111, 99, 124,
+ 76, 111, 99, 97, 108, 105, 122, 101, 84, 97,
+ 114, 103, 101, 116, 95, 84, 101, 120, 116, 77,
+ 101, 115, 104, 80, 114, 111, 95, 85, 71, 85,
+ 73, 0, 0, 0, 0, 47, 73, 50, 46, 76,
+ 111, 99, 124, 76, 111, 99, 97, 108, 105, 122,
+ 101, 84, 97, 114, 103, 101, 116, 95, 85, 110,
+ 105, 116, 121, 83, 116, 97, 110, 100, 97, 114,
+ 100, 95, 65, 117, 100, 105, 111, 83, 111, 117,
+ 114, 99, 101, 0, 0, 0, 0, 31, 73, 50,
+ 46, 76, 111, 99, 124, 76, 111, 99, 97, 108,
+ 105, 122, 101, 84, 97, 114, 103, 101, 116, 68,
+ 101, 115, 99, 95, 67, 104, 105, 108, 100, 0,
+ 0, 0, 0, 41, 73, 50, 46, 76, 111, 99,
+ 124, 76, 111, 99, 97, 108, 105, 122, 101, 84,
+ 97, 114, 103, 101, 116, 95, 85, 110, 105, 116,
+ 121, 83, 116, 97, 110, 100, 97, 114, 100, 95,
+ 67, 104, 105, 108, 100, 0, 0, 0, 0, 48,
+ 73, 50, 46, 76, 111, 99, 124, 76, 111, 99,
+ 97, 108, 105, 122, 101, 84, 97, 114, 103, 101,
+ 116, 95, 85, 110, 105, 116, 121, 83, 116, 97,
+ 110, 100, 97, 114, 100, 95, 77, 101, 115, 104,
+ 82, 101, 110, 100, 101, 114, 101, 114, 0, 0,
+ 0, 0, 32, 73, 50, 46, 76, 111, 99, 124,
+ 76, 111, 99, 97, 108, 105, 122, 101, 84, 97,
+ 114, 103, 101, 116, 68, 101, 115, 99, 95, 80,
+ 114, 101, 102, 97, 98, 0, 0, 0, 0, 42,
+ 73, 50, 46, 76, 111, 99, 124, 76, 111, 99,
+ 97, 108, 105, 122, 101, 84, 97, 114, 103, 101,
+ 116, 95, 85, 110, 105, 116, 121, 83, 116, 97,
+ 110, 100, 97, 114, 100, 95, 80, 114, 101, 102,
+ 97, 98, 0, 0, 0, 0, 50, 73, 50, 46,
+ 76, 111, 99, 124, 76, 111, 99, 97, 108, 105,
+ 122, 101, 84, 97, 114, 103, 101, 116, 95, 85,
+ 110, 105, 116, 121, 83, 116, 97, 110, 100, 97,
+ 114, 100, 95, 83, 112, 114, 105, 116, 101, 82,
+ 101, 110, 100, 101, 114, 101, 114, 0, 0, 0,
+ 0, 44, 73, 50, 46, 76, 111, 99, 124, 76,
+ 111, 99, 97, 108, 105, 122, 101, 84, 97, 114,
+ 103, 101, 116, 95, 85, 110, 105, 116, 121, 83,
+ 116, 97, 110, 100, 97, 114, 100, 95, 84, 101,
+ 120, 116, 77, 101, 115, 104, 0, 0, 0, 0,
+ 47, 73, 50, 46, 76, 111, 99, 124, 76, 111,
+ 99, 97, 108, 105, 122, 101, 84, 97, 114, 103,
+ 101, 116, 95, 85, 110, 105, 116, 121, 83, 116,
+ 97, 110, 100, 97, 114, 100, 95, 86, 105, 100,
+ 101, 111, 80, 108, 97, 121, 101, 114, 0, 0,
+ 0, 0, 35, 73, 50, 46, 76, 111, 99, 124,
+ 76, 111, 99, 97, 108, 105, 122, 101, 84, 97,
+ 114, 103, 101, 116, 95, 85, 110, 105, 116, 121,
+ 85, 73, 95, 73, 109, 97, 103, 101, 0, 0,
+ 0, 0, 38, 73, 50, 46, 76, 111, 99, 124,
+ 76, 111, 99, 97, 108, 105, 122, 101, 84, 97,
+ 114, 103, 101, 116, 95, 85, 110, 105, 116, 121,
+ 85, 73, 95, 82, 97, 119, 73, 109, 97, 103,
+ 101, 0, 0, 0, 0, 34, 73, 50, 46, 76,
+ 111, 99, 124, 76, 111, 99, 97, 108, 105, 122,
+ 101, 84, 97, 114, 103, 101, 116, 95, 85, 110,
+ 105, 116, 121, 85, 73, 95, 84, 101, 120, 116,
+ 0, 0, 0, 0, 15, 73, 50, 46, 76, 111,
+ 99, 124, 84, 101, 114, 109, 68, 97, 116, 97,
+ 0, 0, 0, 0, 17, 73, 50, 46, 76, 111,
+ 99, 124, 84, 101, 114, 109, 115, 80, 111, 112,
+ 117, 112, 0, 0, 0, 0, 28, 73, 50, 46,
+ 76, 111, 99, 124, 65, 117, 116, 111, 67, 104,
+ 97, 110, 103, 101, 67, 117, 108, 116, 117, 114,
+ 101, 73, 110, 102, 111, 0, 0, 0, 0, 23,
+ 73, 50, 46, 76, 111, 99, 124, 67, 111, 114,
+ 111, 117, 116, 105, 110, 101, 77, 97, 110, 97,
+ 103, 101, 114, 0, 0, 0, 0, 29, 73, 50,
+ 46, 76, 111, 99, 124, 67, 117, 115, 116, 111,
+ 109, 76, 111, 99, 97, 108, 105, 122, 101, 67,
+ 97, 108, 108, 98, 97, 99, 107, 0, 0, 0,
+ 0, 17, 73, 50, 46, 76, 111, 99, 124, 72,
+ 105, 110, 100, 105, 70, 105, 120, 101, 114, 0,
+ 0, 0, 0, 14, 73, 50, 46, 76, 111, 99,
+ 124, 73, 50, 85, 116, 105, 108, 115, 0, 0,
+ 0, 0, 33, 73, 50, 46, 76, 111, 99, 124,
+ 73, 76, 111, 99, 97, 108, 105, 122, 97, 116,
+ 105, 111, 110, 80, 97, 114, 97, 109, 115, 77,
+ 97, 110, 97, 103, 101, 114, 0, 0, 0, 0,
+ 32, 73, 50, 46, 76, 111, 99, 124, 76, 111,
+ 99, 97, 108, 105, 122, 97, 116, 105, 111, 110,
+ 80, 97, 114, 97, 109, 115, 77, 97, 110, 97,
+ 103, 101, 114, 0, 0, 0, 0, 43, 73, 50,
+ 46, 76, 111, 99, 46, 76, 111, 99, 97, 108,
+ 105, 122, 97, 116, 105, 111, 110, 80, 97, 114,
+ 97, 109, 115, 77, 97, 110, 97, 103, 101, 114,
+ 124, 80, 97, 114, 97, 109, 86, 97, 108, 117,
+ 101, 0, 0, 0, 0, 22, 73, 50, 46, 76,
+ 111, 99, 124, 76, 111, 99, 97, 108, 105, 122,
+ 101, 100, 83, 116, 114, 105, 110, 103, 0, 0,
+ 0, 0, 43, 73, 50, 46, 76, 111, 99, 124,
+ 82, 101, 103, 105, 115, 116, 101, 114, 67, 97,
+ 108, 108, 98, 97, 99, 107, 95, 65, 108, 108,
+ 111, 119, 83, 121, 110, 99, 70, 114, 111, 109,
+ 71, 111, 111, 103, 108, 101, 0, 0, 0, 0,
+ 31, 73, 50, 46, 76, 111, 99, 124, 82, 101,
+ 103, 105, 115, 116, 101, 114, 71, 108, 111, 98,
+ 97, 108, 80, 97, 114, 97, 109, 101, 116, 101,
+ 114, 115, 0, 0, 0, 0, 31, 73, 50, 46,
+ 76, 111, 99, 124, 73, 82, 101, 115, 111, 117,
+ 114, 99, 101, 77, 97, 110, 97, 103, 101, 114,
+ 95, 66, 117, 110, 100, 108, 101, 115, 0, 0,
+ 0, 0, 22, 73, 50, 46, 76, 111, 99, 124,
+ 82, 101, 115, 111, 117, 114, 99, 101, 77, 97,
+ 110, 97, 103, 101, 114, 0, 0, 0, 0, 15,
+ 73, 50, 46, 76, 111, 99, 124, 82, 84, 76,
+ 70, 105, 120, 101, 114, 0, 0, 0, 0, 20,
+ 73, 50, 46, 76, 111, 99, 124, 65, 114, 97,
+ 98, 105, 99, 77, 97, 112, 112, 105, 110, 103,
+ 0, 0, 0, 0, 18, 73, 50, 46, 76, 111,
+ 99, 124, 65, 114, 97, 98, 105, 99, 84, 97,
+ 98, 108, 101, 0, 0, 0, 0, 23, 73, 50,
+ 46, 76, 111, 99, 124, 84, 97, 115, 104, 107,
+ 101, 101, 108, 76, 111, 99, 97, 116, 105, 111,
+ 110, 0, 0, 0, 0, 19, 73, 50, 46, 76,
+ 111, 99, 124, 82, 84, 76, 70, 105, 120, 101,
+ 114, 84, 111, 111, 108, 0, 0, 0, 0, 18,
+ 73, 50, 46, 76, 111, 99, 124, 83, 101, 116,
+ 76, 97, 110, 103, 117, 97, 103, 101, 0, 0,
+ 0, 0, 26, 73, 50, 46, 76, 111, 99, 124,
+ 83, 101, 116, 76, 97, 110, 103, 117, 97, 103,
+ 101, 68, 114, 111, 112, 100, 111, 119, 110, 0,
+ 0, 0, 0, 22, 73, 50, 46, 76, 111, 99,
+ 124, 83, 116, 114, 105, 110, 103, 79, 98, 102,
+ 117, 99, 97, 116, 111, 114, 0, 0, 0, 0,
+ 28, 78, 71, 83, 46, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 80, 114, 111, 124, 66,
+ 105, 110, 97, 114, 121, 84, 114, 101, 101, 0,
+ 0, 0, 0, 33, 78, 71, 83, 46, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 124, 73, 66, 105, 110, 97, 114, 121, 84,
+ 114, 101, 101, 78, 111, 100, 101, 0, 0, 0,
+ 0, 32, 78, 71, 83, 46, 77, 101, 115, 104,
+ 70, 117, 115, 105, 111, 110, 80, 114, 111, 124,
+ 66, 105, 110, 97, 114, 121, 84, 114, 101, 101,
+ 78, 111, 100, 101, 0, 0, 0, 0, 31, 78,
+ 71, 83, 46, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 124, 83, 111, 117,
+ 114, 99, 101, 84, 114, 97, 99, 107, 101, 114,
+ 0, 0, 0, 0, 41, 78, 71, 83, 46, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 124, 73, 83, 111, 117, 114, 99, 101,
+ 84, 114, 97, 99, 107, 105, 110, 103, 83, 116,
+ 114, 97, 116, 101, 103, 121, 0, 0, 0, 0,
+ 43, 78, 71, 83, 46, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 80, 114, 111, 124, 82,
+ 105, 103, 105, 100, 98, 111, 100, 121, 84, 114,
+ 97, 99, 107, 105, 110, 103, 83, 116, 114, 97,
+ 116, 101, 103, 121, 0, 0, 0, 0, 43, 78,
+ 71, 83, 46, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 124, 84, 114, 97,
+ 110, 115, 102, 111, 114, 109, 84, 114, 97, 99,
+ 107, 105, 110, 103, 83, 116, 114, 97, 116, 101,
+ 103, 121, 0, 0, 0, 0, 35, 78, 71, 83,
+ 46, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 124, 76, 105, 103, 104, 116,
+ 119, 101, 105, 103, 104, 116, 86, 101, 114, 116,
+ 101, 120, 0, 0, 0, 0, 33, 78, 71, 83,
+ 46, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 124, 77, 101, 115, 104, 67,
+ 111, 109, 98, 105, 110, 101, 73, 110, 102, 111,
+ 0, 0, 0, 0, 33, 78, 71, 83, 46, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 124, 77, 101, 115, 104, 67, 117, 116,
+ 116, 105, 110, 103, 73, 110, 102, 111, 0, 0,
+ 0, 0, 31, 78, 71, 83, 46, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 124, 73, 77, 101, 115, 104, 67, 111, 109, 98,
+ 105, 110, 101, 114, 0, 0, 0, 0, 29, 78,
+ 71, 83, 46, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 124, 73, 77, 101,
+ 115, 104, 67, 117, 116, 116, 101, 114, 0, 0,
+ 0, 0, 34, 78, 71, 83, 46, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 124, 77, 101, 115, 104, 67, 111, 109, 98, 105,
+ 110, 101, 114, 66, 97, 115, 101, 0, 0, 0,
+ 0, 38, 78, 71, 83, 46, 77, 101, 115, 104,
+ 70, 117, 115, 105, 111, 110, 80, 114, 111, 124,
+ 77, 101, 115, 104, 67, 111, 109, 98, 105, 110,
+ 101, 114, 83, 105, 109, 112, 108, 101, 76, 87,
+ 0, 0, 0, 0, 39, 78, 71, 83, 46, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 124, 77, 101, 115, 104, 67, 111, 109,
+ 98, 105, 110, 101, 114, 83, 105, 109, 112, 108,
+ 101, 83, 84, 68, 0, 0, 0, 0, 36, 78,
+ 71, 83, 46, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 124, 77, 101, 115,
+ 104, 67, 117, 116, 116, 101, 114, 83, 105, 109,
+ 112, 108, 101, 76, 87, 0, 0, 0, 0, 37,
+ 78, 71, 83, 46, 77, 101, 115, 104, 70, 117,
+ 115, 105, 111, 110, 80, 114, 111, 124, 77, 101,
+ 115, 104, 67, 117, 116, 116, 101, 114, 83, 105,
+ 109, 112, 108, 101, 83, 84, 68, 0, 0, 0,
+ 0, 37, 78, 71, 83, 46, 77, 101, 115, 104,
+ 70, 117, 115, 105, 111, 110, 80, 114, 111, 124,
+ 77, 101, 115, 104, 83, 101, 112, 97, 114, 97,
+ 116, 111, 114, 83, 105, 109, 112, 108, 101, 0,
+ 0, 0, 0, 34, 78, 71, 83, 46, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 124, 86, 101, 114, 116, 101, 120, 66, 117,
+ 102, 102, 101, 114, 85, 116, 105, 108, 1, 0,
+ 0, 0, 30, 78, 71, 83, 46, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 124, 67, 111, 109, 98, 105, 110, 101, 100, 77,
+ 101, 115, 104, 1, 0, 0, 0, 30, 78, 71,
+ 83, 46, 77, 101, 115, 104, 70, 117, 115, 105,
+ 111, 110, 80, 114, 111, 124, 67, 111, 109, 98,
+ 105, 110, 101, 100, 77, 101, 115, 104, 0, 0,
+ 0, 0, 34, 78, 71, 83, 46, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 124, 67, 111, 109, 98, 105, 110, 101, 100, 77,
+ 101, 115, 104, 68, 97, 116, 97, 0, 0, 0,
+ 0, 42, 78, 71, 83, 46, 77, 101, 115, 104,
+ 70, 117, 115, 105, 111, 110, 80, 114, 111, 124,
+ 67, 111, 109, 98, 105, 110, 101, 100, 77, 101,
+ 115, 104, 68, 97, 116, 97, 73, 110, 116, 101,
+ 114, 110, 97, 108, 0, 0, 0, 0, 34, 78,
+ 71, 83, 46, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 124, 67, 111, 109,
+ 98, 105, 110, 101, 100, 77, 101, 115, 104, 80,
+ 97, 114, 116, 0, 0, 0, 0, 42, 78, 71,
+ 83, 46, 77, 101, 115, 104, 70, 117, 115, 105,
+ 111, 110, 80, 114, 111, 124, 67, 111, 109, 98,
+ 105, 110, 101, 100, 77, 101, 115, 104, 80, 97,
+ 114, 116, 73, 110, 116, 101, 114, 110, 97, 108,
+ 0, 0, 0, 0, 34, 78, 71, 83, 46, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 124, 77, 101, 115, 104, 68, 97, 116,
+ 97, 76, 105, 115, 116, 115, 83, 84, 68, 0,
+ 0, 0, 0, 40, 78, 71, 83, 46, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 124, 77, 101, 115, 104, 68, 97, 116, 97,
+ 78, 97, 116, 105, 118, 101, 65, 114, 114, 97,
+ 121, 115, 76, 87, 0, 0, 0, 0, 41, 78,
+ 71, 83, 46, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 124, 77, 101, 115,
+ 104, 68, 97, 116, 97, 78, 97, 116, 105, 118,
+ 101, 65, 114, 114, 97, 121, 115, 83, 84, 68,
+ 0, 0, 0, 0, 30, 78, 71, 83, 46, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 124, 80, 97, 114, 116, 77, 111, 118,
+ 101, 73, 110, 102, 111, 0, 0, 0, 0, 41,
+ 78, 71, 83, 46, 77, 101, 115, 104, 70, 117,
+ 115, 105, 111, 110, 80, 114, 111, 124, 73, 65,
+ 115, 121, 110, 99, 67, 111, 109, 98, 105, 110,
+ 101, 100, 77, 101, 115, 104, 77, 111, 118, 101,
+ 114, 0, 0, 0, 0, 36, 78, 71, 83, 46,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 124, 73, 67, 111, 109, 98, 105,
+ 110, 101, 100, 77, 101, 115, 104, 77, 111, 118,
+ 101, 114, 0, 0, 0, 0, 33, 78, 71, 83,
+ 46, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 124, 74, 111, 98, 115, 77,
+ 101, 115, 104, 77, 111, 118, 101, 114, 76, 87,
+ 0, 0, 0, 0, 46, 78, 71, 83, 46, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 46, 74, 111, 98, 115, 77, 101, 115,
+ 104, 77, 111, 118, 101, 114, 76, 87, 124, 77,
+ 111, 118, 101, 80, 97, 114, 116, 115, 74, 111,
+ 98, 0, 0, 0, 0, 54, 78, 71, 83, 46,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 46, 74, 111, 98, 115, 77, 101,
+ 115, 104, 77, 111, 118, 101, 114, 76, 87, 124,
+ 82, 101, 99, 97, 108, 99, 117, 108, 97, 116,
+ 101, 66, 111, 117, 110, 100, 115, 74, 111, 98,
+ 0, 0, 0, 0, 34, 78, 71, 83, 46, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 124, 74, 111, 98, 115, 77, 101, 115,
+ 104, 77, 111, 118, 101, 114, 83, 84, 68, 0,
+ 0, 0, 0, 47, 78, 71, 83, 46, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 46, 74, 111, 98, 115, 77, 101, 115, 104,
+ 77, 111, 118, 101, 114, 83, 84, 68, 124, 77,
+ 111, 118, 101, 80, 97, 114, 116, 115, 74, 111,
+ 98, 0, 0, 0, 0, 55, 78, 71, 83, 46,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 46, 74, 111, 98, 115, 77, 101,
+ 115, 104, 77, 111, 118, 101, 114, 83, 84, 68,
+ 124, 82, 101, 99, 97, 108, 99, 117, 108, 97,
+ 116, 101, 66, 111, 117, 110, 100, 115, 74, 111,
+ 98, 0, 0, 0, 0, 36, 78, 71, 83, 46,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 124, 83, 105, 109, 112, 108, 101,
+ 77, 101, 115, 104, 77, 111, 118, 101, 114, 83,
+ 84, 68, 0, 0, 0, 0, 38, 78, 71, 83,
+ 46, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 124, 73, 67, 111, 109, 98,
+ 105, 110, 101, 100, 77, 101, 115, 104, 70, 97,
+ 99, 116, 111, 114, 121, 0, 0, 0, 0, 35,
+ 78, 71, 83, 46, 77, 101, 115, 104, 70, 117,
+ 115, 105, 111, 110, 80, 114, 111, 124, 73, 77,
+ 101, 115, 104, 84, 111, 111, 108, 115, 70, 97,
+ 99, 116, 111, 114, 121, 0, 0, 0, 0, 45,
+ 78, 71, 83, 46, 77, 101, 115, 104, 70, 117,
+ 115, 105, 111, 110, 80, 114, 111, 124, 73, 77,
+ 111, 118, 97, 98, 108, 101, 67, 111, 109, 98,
+ 105, 110, 101, 100, 77, 101, 115, 104, 70, 97,
+ 99, 116, 111, 114, 121, 0, 0, 0, 0, 37,
+ 78, 71, 83, 46, 77, 101, 115, 104, 70, 117,
+ 115, 105, 111, 110, 80, 114, 111, 124, 67, 111,
+ 109, 98, 105, 110, 101, 100, 77, 101, 115, 104,
+ 70, 97, 99, 116, 111, 114, 121, 0, 0, 0,
+ 0, 38, 78, 71, 83, 46, 77, 101, 115, 104,
+ 70, 117, 115, 105, 111, 110, 80, 114, 111, 124,
+ 83, 105, 109, 112, 108, 101, 84, 111, 111, 108,
+ 115, 76, 87, 70, 97, 99, 116, 111, 114, 121,
+ 0, 0, 0, 0, 39, 78, 71, 83, 46, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 124, 83, 105, 109, 112, 108, 101, 84,
+ 111, 111, 108, 115, 83, 84, 68, 70, 97, 99,
+ 116, 111, 114, 121, 0, 0, 0, 0, 42, 78,
+ 71, 83, 46, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 124, 74, 111, 98,
+ 115, 77, 111, 118, 97, 98, 108, 101, 77, 101,
+ 115, 104, 76, 87, 70, 97, 99, 116, 111, 114,
+ 121, 0, 0, 0, 0, 43, 78, 71, 83, 46,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 124, 74, 111, 98, 115, 77, 111,
+ 118, 97, 98, 108, 101, 77, 101, 115, 104, 83,
+ 84, 68, 70, 97, 99, 116, 111, 114, 121, 0,
+ 0, 0, 0, 45, 78, 71, 83, 46, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 124, 83, 105, 109, 112, 108, 101, 77, 111,
+ 118, 97, 98, 108, 101, 77, 101, 115, 104, 83,
+ 84, 68, 70, 97, 99, 116, 111, 114, 121, 0,
+ 0, 0, 0, 34, 78, 71, 83, 46, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 124, 82, 101, 110, 100, 101, 114, 101, 114,
+ 83, 101, 116, 116, 105, 110, 103, 115, 1, 0,
+ 0, 0, 33, 78, 71, 83, 46, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 124, 73, 67, 111, 109, 98, 105, 110, 101, 100,
+ 79, 98, 106, 101, 99, 116, 1, 0, 0, 0,
+ 33, 78, 71, 83, 46, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 80, 114, 111, 124, 73,
+ 67, 111, 109, 98, 105, 110, 101, 100, 79, 98,
+ 106, 101, 99, 116, 1, 0, 0, 0, 37, 78,
+ 71, 83, 46, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 124, 73, 67, 111,
+ 109, 98, 105, 110, 101, 100, 79, 98, 106, 101,
+ 99, 116, 80, 97, 114, 116, 1, 0, 0, 0,
+ 37, 78, 71, 83, 46, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 80, 114, 111, 124, 73,
+ 67, 111, 109, 98, 105, 110, 101, 100, 79, 98,
+ 106, 101, 99, 116, 80, 97, 114, 116, 1, 0,
+ 0, 0, 32, 78, 71, 83, 46, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 124, 73, 67, 111, 109, 98, 105, 110, 101, 83,
+ 111, 117, 114, 99, 101, 1, 0, 0, 0, 32,
+ 78, 71, 83, 46, 77, 101, 115, 104, 70, 117,
+ 115, 105, 111, 110, 80, 114, 111, 124, 73, 67,
+ 111, 109, 98, 105, 110, 101, 83, 111, 117, 114,
+ 99, 101, 0, 0, 0, 0, 32, 78, 71, 83,
+ 46, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 124, 67, 111, 109, 98, 105,
+ 110, 101, 100, 79, 98, 106, 101, 99, 116, 0,
+ 0, 0, 0, 36, 78, 71, 83, 46, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 124, 67, 111, 109, 98, 105, 110, 101, 100,
+ 79, 98, 106, 101, 99, 116, 80, 97, 114, 116,
+ 0, 0, 0, 0, 31, 78, 71, 83, 46, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 124, 67, 111, 109, 98, 105, 110, 101,
+ 83, 111, 117, 114, 99, 101, 0, 0, 0, 0,
+ 39, 78, 71, 83, 46, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 80, 114, 111, 124, 68,
+ 121, 110, 97, 109, 105, 99, 67, 111, 109, 98,
+ 105, 110, 101, 100, 79, 98, 106, 101, 99, 116,
+ 0, 0, 0, 0, 43, 78, 71, 83, 46, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 124, 68, 121, 110, 97, 109, 105, 99,
+ 67, 111, 109, 98, 105, 110, 101, 100, 79, 98,
+ 106, 101, 99, 116, 80, 97, 114, 116, 0, 0,
+ 0, 0, 51, 78, 71, 83, 46, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 124, 68, 121, 110, 97, 109, 105, 99, 67, 111,
+ 109, 98, 105, 110, 101, 100, 79, 98, 106, 101,
+ 99, 116, 80, 97, 114, 116, 73, 110, 116, 101,
+ 114, 110, 97, 108, 0, 0, 0, 0, 38, 78,
+ 71, 83, 46, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 124, 68, 121, 110,
+ 97, 109, 105, 99, 67, 111, 109, 98, 105, 110,
+ 101, 83, 111, 117, 114, 99, 101, 0, 0, 0,
+ 0, 39, 78, 71, 83, 46, 77, 101, 115, 104,
+ 70, 117, 115, 105, 111, 110, 80, 114, 111, 124,
+ 67, 111, 109, 98, 105, 110, 101, 100, 79, 98,
+ 106, 101, 99, 116, 77, 97, 116, 99, 104, 101,
+ 114, 0, 0, 0, 0, 33, 78, 71, 83, 46,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 124, 79, 98, 106, 101, 99, 116,
+ 115, 67, 111, 109, 98, 105, 110, 101, 114, 0,
+ 0, 0, 0, 40, 78, 71, 83, 46, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 124, 68, 121, 110, 97, 109, 105, 99, 79,
+ 98, 106, 101, 99, 116, 115, 67, 111, 109, 98,
+ 105, 110, 101, 114, 0, 0, 0, 0, 35, 78,
+ 71, 83, 46, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 124, 76, 79, 68,
+ 71, 114, 111, 117, 112, 115, 67, 111, 109, 98,
+ 105, 110, 101, 114, 0, 0, 0, 0, 41, 78,
+ 71, 83, 46, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 124, 67, 111, 109,
+ 98, 105, 110, 101, 100, 76, 79, 68, 71, 114,
+ 111, 117, 112, 77, 97, 116, 99, 104, 101, 114,
+ 0, 0, 0, 0, 46, 78, 71, 83, 46, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 80,
+ 114, 111, 124, 68, 121, 110, 97, 109, 105, 99,
+ 67, 111, 109, 98, 105, 110, 101, 100, 79, 98,
+ 106, 101, 99, 116, 77, 97, 116, 99, 104, 101,
+ 114, 0, 0, 0, 0, 45, 78, 71, 83, 46,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 124, 83, 116, 97, 116, 105, 99,
+ 67, 111, 109, 98, 105, 110, 101, 100, 79, 98,
+ 106, 101, 99, 116, 77, 97, 116, 99, 104, 101,
+ 114, 0, 0, 0, 0, 39, 78, 71, 83, 46,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 124, 83, 116, 97, 116, 105, 99,
+ 79, 98, 106, 101, 99, 116, 115, 67, 111, 109,
+ 98, 105, 110, 101, 114, 0, 0, 0, 0, 42,
+ 78, 71, 83, 46, 77, 101, 115, 104, 70, 117,
+ 115, 105, 111, 110, 80, 114, 111, 124, 85, 110,
+ 105, 118, 101, 114, 115, 97, 108, 79, 98, 106,
+ 101, 99, 116, 115, 67, 111, 109, 98, 105, 110,
+ 101, 114, 0, 0, 0, 0, 34, 78, 71, 83,
+ 46, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 124, 67, 111, 109, 98, 105,
+ 110, 101, 100, 76, 79, 68, 71, 114, 111, 117,
+ 112, 0, 0, 0, 0, 56, 78, 71, 83, 46,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 46, 67, 111, 109, 98, 105, 110,
+ 101, 100, 76, 79, 68, 71, 114, 111, 117, 112,
+ 124, 76, 101, 118, 101, 108, 79, 102, 68, 101,
+ 116, 97, 105, 108, 67, 111, 109, 98, 105, 110,
+ 101, 114, 0, 0, 0, 0, 38, 78, 71, 83,
+ 46, 77, 101, 115, 104, 70, 117, 115, 105, 111,
+ 110, 80, 114, 111, 124, 67, 111, 109, 98, 105,
+ 110, 101, 100, 76, 79, 68, 71, 114, 111, 117,
+ 112, 80, 97, 114, 116, 0, 0, 0, 0, 39,
+ 78, 71, 83, 46, 77, 101, 115, 104, 70, 117,
+ 115, 105, 111, 110, 80, 114, 111, 124, 76, 79,
+ 68, 71, 114, 111, 117, 112, 67, 111, 109, 98,
+ 105, 110, 101, 83, 111, 117, 114, 99, 101, 0,
+ 0, 0, 0, 34, 78, 71, 83, 46, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 124, 76, 79, 68, 71, 114, 111, 117, 112,
+ 83, 101, 116, 116, 105, 110, 103, 115, 0, 0,
+ 0, 0, 34, 78, 71, 83, 46, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 124, 66, 105, 110, 97, 114, 121, 84, 114, 101,
+ 101, 68, 114, 97, 119, 101, 114, 0, 0, 0,
+ 0, 29, 78, 71, 83, 46, 77, 101, 115, 104,
+ 70, 117, 115, 105, 111, 110, 80, 114, 111, 124,
+ 67, 111, 109, 98, 105, 110, 101, 84, 114, 101,
+ 101, 0, 0, 0, 0, 33, 78, 71, 83, 46,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 124, 67, 111, 109, 98, 105, 110,
+ 101, 84, 114, 101, 101, 78, 111, 100, 101, 0,
+ 0, 0, 0, 35, 78, 71, 83, 46, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 124, 82, 117, 110, 116, 105, 109, 101, 77,
+ 101, 115, 104, 70, 117, 115, 105, 111, 110, 0,
+ 0, 0, 0, 34, 78, 71, 83, 46, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 80, 114,
+ 111, 124, 77, 101, 115, 104, 70, 117, 115, 105,
+ 111, 110, 83, 111, 117, 114, 99, 101, 0, 0,
+ 0, 0, 41, 78, 71, 83, 46, 77, 101, 115,
+ 104, 70, 117, 115, 105, 111, 110, 80, 114, 111,
+ 124, 68, 121, 110, 97, 109, 105, 99, 77, 101,
+ 115, 104, 70, 117, 115, 105, 111, 110, 83, 111,
+ 117, 114, 99, 101, 0, 0, 0, 0, 37, 78,
+ 71, 83, 46, 77, 101, 115, 104, 70, 117, 115,
+ 105, 111, 110, 80, 114, 111, 124, 76, 79, 68,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 83, 111, 117, 114, 99, 101, 0, 0, 0, 0,
+ 40, 78, 71, 83, 46, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 80, 114, 111, 124, 83,
+ 116, 97, 116, 105, 99, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 83, 111, 117, 114, 99,
+ 101, 0, 0, 0, 0, 30, 78, 71, 83, 46,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 124, 66, 111, 117, 110, 100, 115,
+ 72, 101, 108, 112, 101, 114, 0, 0, 0, 0,
+ 30, 78, 71, 83, 46, 77, 101, 115, 104, 70,
+ 117, 115, 105, 111, 110, 80, 114, 111, 124, 77,
+ 97, 116, 114, 105, 120, 72, 101, 108, 112, 101,
+ 114, 0, 0, 0, 0, 32, 78, 71, 83, 46,
+ 77, 101, 115, 104, 70, 117, 115, 105, 111, 110,
+ 80, 114, 111, 124, 82, 101, 110, 100, 101, 114,
+ 101, 114, 72, 101, 108, 112, 101, 114, 0, 0,
+ 0, 0, 35, 82, 101, 119, 105, 114, 101, 100,
+ 46, 68, 101, 109, 111, 115, 124, 67, 111, 110,
+ 116, 114, 111, 108, 82, 101, 109, 97, 112, 112,
+ 105, 110, 103, 68, 101, 109, 111, 49, 0, 0,
+ 0, 0, 55, 82, 101, 119, 105, 114, 101, 100,
+ 46, 68, 101, 109, 111, 115, 46, 67, 111, 110,
+ 116, 114, 111, 108, 82, 101, 109, 97, 112, 112,
+ 105, 110, 103, 68, 101, 109, 111, 49, 124, 67,
+ 111, 110, 116, 114, 111, 108, 108, 101, 114, 83,
+ 101, 108, 101, 99, 116, 105, 111, 110, 0, 0,
+ 0, 0, 48, 82, 101, 119, 105, 114, 101, 100,
+ 46, 68, 101, 109, 111, 115, 46, 67, 111, 110,
+ 116, 114, 111, 108, 82, 101, 109, 97, 112, 112,
+ 105, 110, 103, 68, 101, 109, 111, 49, 124, 68,
+ 105, 97, 108, 111, 103, 72, 101, 108, 112, 101,
+ 114, 0, 0, 0, 0, 46, 82, 101, 119, 105,
+ 114, 101, 100, 46, 68, 101, 109, 111, 115, 46,
+ 67, 111, 110, 116, 114, 111, 108, 82, 101, 109,
+ 97, 112, 112, 105, 110, 103, 68, 101, 109, 111,
+ 49, 124, 81, 117, 101, 117, 101, 69, 110, 116,
+ 114, 121, 0, 0, 0, 0, 60, 82, 101, 119,
+ 105, 114, 101, 100, 46, 68, 101, 109, 111, 115,
+ 46, 67, 111, 110, 116, 114, 111, 108, 82, 101,
+ 109, 97, 112, 112, 105, 110, 103, 68, 101, 109,
+ 111, 49, 124, 74, 111, 121, 115, 116, 105, 99,
+ 107, 65, 115, 115, 105, 103, 110, 109, 101, 110,
+ 116, 67, 104, 97, 110, 103, 101, 0, 0, 0,
+ 0, 59, 82, 101, 119, 105, 114, 101, 100, 46,
+ 68, 101, 109, 111, 115, 46, 67, 111, 110, 116,
+ 114, 111, 108, 82, 101, 109, 97, 112, 112, 105,
+ 110, 103, 68, 101, 109, 111, 49, 124, 69, 108,
+ 101, 109, 101, 110, 116, 65, 115, 115, 105, 103,
+ 110, 109, 101, 110, 116, 67, 104, 97, 110, 103,
+ 101, 0, 0, 0, 0, 66, 82, 101, 119, 105,
+ 114, 101, 100, 46, 68, 101, 109, 111, 115, 46,
+ 67, 111, 110, 116, 114, 111, 108, 82, 101, 109,
+ 97, 112, 112, 105, 110, 103, 68, 101, 109, 111,
+ 49, 124, 70, 97, 108, 108, 98, 97, 99, 107,
+ 74, 111, 121, 115, 116, 105, 99, 107, 73, 100,
+ 101, 110, 116, 105, 102, 105, 99, 97, 116, 105,
+ 111, 110, 0, 0, 0, 0, 47, 82, 101, 119,
+ 105, 114, 101, 100, 46, 68, 101, 109, 111, 115,
+ 46, 67, 111, 110, 116, 114, 111, 108, 82, 101,
+ 109, 97, 112, 112, 105, 110, 103, 68, 101, 109,
+ 111, 49, 124, 67, 97, 108, 105, 98, 114, 97,
+ 116, 105, 111, 110, 0, 0, 0, 0, 52, 82,
+ 101, 119, 105, 114, 101, 100, 46, 68, 101, 109,
+ 111, 115, 46, 67, 111, 110, 116, 114, 111, 108,
+ 82, 101, 109, 97, 112, 112, 105, 110, 103, 68,
+ 101, 109, 111, 49, 124, 87, 105, 110, 100, 111,
+ 119, 80, 114, 111, 112, 101, 114, 116, 105, 101,
+ 115, 0, 0, 0, 0, 39, 82, 101, 119, 105,
+ 114, 101, 100, 46, 68, 101, 109, 111, 115, 124,
+ 67, 117, 115, 116, 111, 109, 67, 111, 110, 116,
+ 114, 111, 108, 108, 101, 114, 115, 84, 105, 108,
+ 116, 68, 101, 109, 111, 0, 0, 0, 0, 34,
+ 82, 101, 119, 105, 114, 101, 100, 46, 68, 101,
+ 109, 111, 115, 124, 67, 117, 115, 116, 111, 109,
+ 67, 111, 110, 116, 114, 111, 108, 108, 101, 114,
+ 68, 101, 109, 111, 0, 0, 0, 0, 41, 82,
+ 101, 119, 105, 114, 101, 100, 46, 68, 101, 109,
+ 111, 115, 124, 67, 117, 115, 116, 111, 109, 67,
+ 111, 110, 116, 114, 111, 108, 108, 101, 114, 68,
+ 101, 109, 111, 95, 80, 108, 97, 121, 101, 114,
+ 0, 0, 0, 0, 32, 82, 101, 119, 105, 114,
+ 101, 100, 46, 68, 101, 109, 111, 115, 124, 84,
+ 111, 117, 99, 104, 66, 117, 116, 116, 111, 110,
+ 69, 120, 97, 109, 112, 108, 101, 0, 0, 0,
+ 0, 34, 82, 101, 119, 105, 114, 101, 100, 46,
+ 68, 101, 109, 111, 115, 124, 84, 111, 117, 99,
+ 104, 74, 111, 121, 115, 116, 105, 99, 107, 69,
+ 120, 97, 109, 112, 108, 101, 0, 0, 0, 0,
+ 46, 82, 101, 119, 105, 114, 101, 100, 46, 68,
+ 101, 109, 111, 115, 124, 68, 117, 97, 108, 83,
+ 104, 111, 99, 107, 52, 83, 112, 101, 99, 105,
+ 97, 108, 70, 101, 97, 116, 117, 114, 101, 115,
+ 69, 120, 97, 109, 112, 108, 101, 0, 0, 0,
+ 0, 52, 82, 101, 119, 105, 114, 101, 100, 46,
+ 68, 101, 109, 111, 115, 46, 68, 117, 97, 108,
+ 83, 104, 111, 99, 107, 52, 83, 112, 101, 99,
+ 105, 97, 108, 70, 101, 97, 116, 117, 114, 101,
+ 115, 69, 120, 97, 109, 112, 108, 101, 124, 84,
+ 111, 117, 99, 104, 0, 0, 0, 0, 40, 82,
+ 101, 119, 105, 114, 101, 100, 46, 68, 101, 109,
+ 111, 115, 124, 69, 105, 103, 104, 116, 80, 108,
+ 97, 121, 101, 114, 115, 69, 120, 97, 109, 112,
+ 108, 101, 95, 80, 108, 97, 121, 101, 114, 0,
+ 0, 0, 0, 48, 82, 101, 119, 105, 114, 101,
+ 100, 46, 68, 101, 109, 111, 115, 124, 70, 97,
+ 108, 108, 98, 97, 99, 107, 74, 111, 121, 115,
+ 116, 105, 99, 107, 73, 100, 101, 110, 116, 105,
+ 102, 105, 99, 97, 116, 105, 111, 110, 68, 101,
+ 109, 111, 0, 0, 0, 0, 50, 82, 101, 119,
+ 105, 114, 101, 100, 46, 68, 101, 109, 111, 115,
+ 46, 71, 97, 109, 101, 112, 97, 100, 84, 101,
+ 109, 112, 108, 97, 116, 101, 85, 73, 124, 67,
+ 111, 110, 116, 114, 111, 108, 108, 101, 114, 85,
+ 73, 69, 102, 102, 101, 99, 116, 0, 0, 0,
+ 0, 51, 82, 101, 119, 105, 114, 101, 100, 46,
+ 68, 101, 109, 111, 115, 46, 71, 97, 109, 101,
+ 112, 97, 100, 84, 101, 109, 112, 108, 97, 116,
+ 101, 85, 73, 124, 67, 111, 110, 116, 114, 111,
+ 108, 108, 101, 114, 85, 73, 69, 108, 101, 109,
+ 101, 110, 116, 0, 0, 0, 0, 49, 82, 101,
+ 119, 105, 114, 101, 100, 46, 68, 101, 109, 111,
+ 115, 46, 71, 97, 109, 101, 112, 97, 100, 84,
+ 101, 109, 112, 108, 97, 116, 101, 85, 73, 124,
+ 71, 97, 109, 101, 112, 97, 100, 84, 101, 109,
+ 112, 108, 97, 116, 101, 85, 73, 0, 0, 0,
+ 0, 55, 82, 101, 119, 105, 114, 101, 100, 46,
+ 68, 101, 109, 111, 115, 46, 71, 97, 109, 101,
+ 112, 97, 100, 84, 101, 109, 112, 108, 97, 116,
+ 101, 85, 73, 46, 71, 97, 109, 101, 112, 97,
+ 100, 84, 101, 109, 112, 108, 97, 116, 101, 85,
+ 73, 124, 83, 116, 105, 99, 107, 0, 0, 0,
+ 0, 59, 82, 101, 119, 105, 114, 101, 100, 46,
+ 68, 101, 109, 111, 115, 46, 71, 97, 109, 101,
+ 112, 97, 100, 84, 101, 109, 112, 108, 97, 116,
+ 101, 85, 73, 46, 71, 97, 109, 101, 112, 97,
+ 100, 84, 101, 109, 112, 108, 97, 116, 101, 85,
+ 73, 124, 85, 73, 69, 108, 101, 109, 101, 110,
+ 116, 0, 0, 0, 0, 38, 82, 101, 119, 105,
+ 114, 101, 100, 46, 68, 101, 109, 111, 115, 124,
+ 80, 108, 97, 121, 101, 114, 77, 111, 117, 115,
+ 101, 83, 112, 114, 105, 116, 101, 69, 120, 97,
+ 109, 112, 108, 101, 0, 0, 0, 0, 46, 82,
+ 101, 119, 105, 114, 101, 100, 46, 68, 101, 109,
+ 111, 115, 124, 80, 108, 97, 121, 101, 114, 80,
+ 111, 105, 110, 116, 101, 114, 69, 118, 101, 110,
+ 116, 72, 97, 110, 100, 108, 101, 114, 69, 120,
+ 97, 109, 112, 108, 101, 0, 0, 0, 0, 23,
+ 82, 101, 119, 105, 114, 101, 100, 46, 68, 101,
+ 109, 111, 115, 124, 85, 73, 80, 111, 105, 110,
+ 116, 101, 114, 0, 0, 0, 0, 50, 82, 101,
+ 119, 105, 114, 101, 100, 46, 68, 101, 109, 111,
+ 115, 124, 80, 114, 101, 115, 115, 65, 110, 121,
+ 66, 117, 116, 116, 111, 110, 84, 111, 74, 111,
+ 105, 110, 69, 120, 97, 109, 112, 108, 101, 95,
+ 65, 115, 115, 105, 103, 110, 101, 114, 0, 0,
+ 0, 0, 52, 82, 101, 119, 105, 114, 101, 100,
+ 46, 68, 101, 109, 111, 115, 124, 80, 114, 101,
+ 115, 115, 65, 110, 121, 66, 117, 116, 116, 111,
+ 110, 84, 111, 74, 111, 105, 110, 69, 120, 97,
+ 109, 112, 108, 101, 95, 71, 97, 109, 101, 80,
+ 108, 97, 121, 101, 114, 0, 0, 0, 0, 46,
+ 82, 101, 119, 105, 114, 101, 100, 46, 68, 101,
+ 109, 111, 115, 124, 80, 114, 101, 115, 115, 83,
+ 116, 97, 114, 116, 84, 111, 74, 111, 105, 110,
+ 69, 120, 97, 109, 112, 108, 101, 95, 65, 115,
+ 115, 105, 103, 110, 101, 114, 0, 0, 0, 0,
+ 56, 82, 101, 119, 105, 114, 101, 100, 46, 68,
+ 101, 109, 111, 115, 46, 80, 114, 101, 115, 115,
+ 83, 116, 97, 114, 116, 84, 111, 74, 111, 105,
+ 110, 69, 120, 97, 109, 112, 108, 101, 95, 65,
+ 115, 115, 105, 103, 110, 101, 114, 124, 80, 108,
+ 97, 121, 101, 114, 77, 97, 112, 0, 0, 0,
+ 0, 48, 82, 101, 119, 105, 114, 101, 100, 46,
+ 68, 101, 109, 111, 115, 124, 80, 114, 101, 115,
+ 115, 83, 116, 97, 114, 116, 84, 111, 74, 111,
+ 105, 110, 69, 120, 97, 109, 112, 108, 101, 95,
+ 71, 97, 109, 101, 80, 108, 97, 121, 101, 114,
+ 0, 0, 0, 0, 20, 82, 101, 119, 105, 114,
+ 101, 100, 46, 68, 101, 109, 111, 115, 124, 66,
+ 117, 108, 108, 101, 116, 0, 0, 0, 0, 50,
+ 82, 101, 119, 105, 114, 101, 100, 46, 68, 101,
+ 109, 111, 115, 124, 83, 105, 109, 112, 108, 101,
+ 67, 111, 109, 98, 105, 110, 101, 100, 75, 101,
+ 121, 98, 111, 97, 114, 100, 77, 111, 117, 115,
+ 101, 82, 101, 109, 97, 112, 112, 105, 110, 103,
+ 0, 0, 0, 0, 54, 82, 101, 119, 105, 114,
+ 101, 100, 46, 68, 101, 109, 111, 115, 46, 83,
+ 105, 109, 112, 108, 101, 67, 111, 109, 98, 105,
+ 110, 101, 100, 75, 101, 121, 98, 111, 97, 114,
+ 100, 77, 111, 117, 115, 101, 82, 101, 109, 97,
+ 112, 112, 105, 110, 103, 124, 82, 111, 119, 0,
+ 0, 0, 0, 64, 82, 101, 119, 105, 114, 101,
+ 100, 46, 68, 101, 109, 111, 115, 46, 83, 105,
+ 109, 112, 108, 101, 67, 111, 109, 98, 105, 110,
+ 101, 100, 75, 101, 121, 98, 111, 97, 114, 100,
+ 77, 111, 117, 115, 101, 82, 101, 109, 97, 112,
+ 112, 105, 110, 103, 124, 84, 97, 114, 103, 101,
+ 116, 77, 97, 112, 112, 105, 110, 103, 0, 0,
+ 0, 0, 36, 82, 101, 119, 105, 114, 101, 100,
+ 46, 68, 101, 109, 111, 115, 124, 83, 105, 109,
+ 112, 108, 101, 67, 111, 110, 116, 114, 111, 108,
+ 82, 101, 109, 97, 112, 112, 105, 110, 103, 0,
+ 0, 0, 0, 40, 82, 101, 119, 105, 114, 101,
+ 100, 46, 68, 101, 109, 111, 115, 46, 83, 105,
+ 109, 112, 108, 101, 67, 111, 110, 116, 114, 111,
+ 108, 82, 101, 109, 97, 112, 112, 105, 110, 103,
+ 124, 82, 111, 119, 0, 0, 0, 0, 50, 82,
+ 101, 119, 105, 114, 101, 100, 46, 73, 110, 116,
+ 101, 103, 114, 97, 116, 105, 111, 110, 46, 85,
+ 110, 105, 116, 121, 85, 73, 124, 80, 108, 97,
+ 121, 101, 114, 80, 111, 105, 110, 116, 101, 114,
+ 69, 118, 101, 110, 116, 68, 97, 116, 97, 0,
+ 0, 0, 0, 46, 82, 101, 119, 105, 114, 101,
+ 100, 46, 73, 110, 116, 101, 103, 114, 97, 116,
+ 105, 111, 110, 46, 85, 110, 105, 116, 121, 85,
+ 73, 124, 82, 101, 119, 105, 114, 101, 100, 69,
+ 118, 101, 110, 116, 83, 121, 115, 116, 101, 109,
+ 0, 0, 0, 0, 53, 82, 101, 119, 105, 114,
+ 101, 100, 46, 73, 110, 116, 101, 103, 114, 97,
+ 116, 105, 111, 110, 46, 85, 110, 105, 116, 121,
+ 85, 73, 124, 82, 101, 119, 105, 114, 101, 100,
+ 80, 111, 105, 110, 116, 101, 114, 73, 110, 112,
+ 117, 116, 77, 111, 100, 117, 108, 101, 0, 0,
+ 0, 0, 64, 82, 101, 119, 105, 114, 101, 100,
+ 46, 73, 110, 116, 101, 103, 114, 97, 116, 105,
+ 111, 110, 46, 85, 110, 105, 116, 121, 85, 73,
+ 46, 82, 101, 119, 105, 114, 101, 100, 80, 111,
+ 105, 110, 116, 101, 114, 73, 110, 112, 117, 116,
+ 77, 111, 100, 117, 108, 101, 124, 77, 111, 117,
+ 115, 101, 83, 116, 97, 116, 101, 0, 0, 0,
+ 0, 74, 82, 101, 119, 105, 114, 101, 100, 46,
+ 73, 110, 116, 101, 103, 114, 97, 116, 105, 111,
+ 110, 46, 85, 110, 105, 116, 121, 85, 73, 46,
+ 82, 101, 119, 105, 114, 101, 100, 80, 111, 105,
+ 110, 116, 101, 114, 73, 110, 112, 117, 116, 77,
+ 111, 100, 117, 108, 101, 124, 77, 111, 117, 115,
+ 101, 66, 117, 116, 116, 111, 110, 69, 118, 101,
+ 110, 116, 68, 97, 116, 97, 0, 0, 0, 0,
+ 65, 82, 101, 119, 105, 114, 101, 100, 46, 73,
+ 110, 116, 101, 103, 114, 97, 116, 105, 111, 110,
+ 46, 85, 110, 105, 116, 121, 85, 73, 46, 82,
+ 101, 119, 105, 114, 101, 100, 80, 111, 105, 110,
+ 116, 101, 114, 73, 110, 112, 117, 116, 77, 111,
+ 100, 117, 108, 101, 124, 66, 117, 116, 116, 111,
+ 110, 83, 116, 97, 116, 101, 0, 0, 0, 0,
+ 70, 82, 101, 119, 105, 114, 101, 100, 46, 73,
+ 110, 116, 101, 103, 114, 97, 116, 105, 111, 110,
+ 46, 85, 110, 105, 116, 121, 85, 73, 46, 82,
+ 101, 119, 105, 114, 101, 100, 80, 111, 105, 110,
+ 116, 101, 114, 73, 110, 112, 117, 116, 77, 111,
+ 100, 117, 108, 101, 124, 85, 110, 105, 116, 121,
+ 73, 110, 112, 117, 116, 83, 111, 117, 114, 99,
+ 101, 0, 0, 0, 0, 56, 82, 101, 119, 105,
+ 114, 101, 100, 46, 73, 110, 116, 101, 103, 114,
+ 97, 116, 105, 111, 110, 46, 85, 110, 105, 116,
+ 121, 85, 73, 124, 82, 101, 119, 105, 114, 101,
+ 100, 83, 116, 97, 110, 100, 97, 108, 111, 110,
+ 101, 73, 110, 112, 117, 116, 77, 111, 100, 117,
+ 108, 101, 0, 0, 0, 0, 70, 82, 101, 119,
+ 105, 114, 101, 100, 46, 73, 110, 116, 101, 103,
+ 114, 97, 116, 105, 111, 110, 46, 85, 110, 105,
+ 116, 121, 85, 73, 46, 82, 101, 119, 105, 114,
+ 101, 100, 83, 116, 97, 110, 100, 97, 108, 111,
+ 110, 101, 73, 110, 112, 117, 116, 77, 111, 100,
+ 117, 108, 101, 124, 80, 108, 97, 121, 101, 114,
+ 83, 101, 116, 116, 105, 110, 103, 0, 0, 0,
+ 0, 24, 82, 101, 119, 105, 114, 101, 100, 124,
+ 73, 71, 97, 109, 101, 112, 97, 100, 84, 101,
+ 109, 112, 108, 97, 116, 101, 0, 0, 0, 0,
+ 28, 82, 101, 119, 105, 114, 101, 100, 124, 73,
+ 82, 97, 99, 105, 110, 103, 87, 104, 101, 101,
+ 108, 84, 101, 109, 112, 108, 97, 116, 101, 0,
+ 0, 0, 0, 22, 82, 101, 119, 105, 114, 101,
+ 100, 124, 73, 72, 79, 84, 65, 83, 84, 101,
+ 109, 112, 108, 97, 116, 101, 0, 0, 0, 0,
+ 27, 82, 101, 119, 105, 114, 101, 100, 124, 73,
+ 70, 108, 105, 103, 104, 116, 89, 111, 107, 101,
+ 84, 101, 109, 112, 108, 97, 116, 101, 0, 0,
+ 0, 0, 29, 82, 101, 119, 105, 114, 101, 100,
+ 124, 73, 70, 108, 105, 103, 104, 116, 80, 101,
+ 100, 97, 108, 115, 84, 101, 109, 112, 108, 97,
+ 116, 101, 0, 0, 0, 0, 33, 82, 101, 119,
+ 105, 114, 101, 100, 124, 73, 83, 105, 120, 68,
+ 111, 102, 67, 111, 110, 116, 114, 111, 108, 108,
+ 101, 114, 84, 101, 109, 112, 108, 97, 116, 101,
+ 0, 0, 0, 0, 23, 82, 101, 119, 105, 114,
+ 101, 100, 124, 71, 97, 109, 101, 112, 97, 100,
+ 84, 101, 109, 112, 108, 97, 116, 101, 0, 0,
+ 0, 0, 27, 82, 101, 119, 105, 114, 101, 100,
+ 124, 82, 97, 99, 105, 110, 103, 87, 104, 101,
+ 101, 108, 84, 101, 109, 112, 108, 97, 116, 101,
+ 0, 0, 0, 0, 21, 82, 101, 119, 105, 114,
+ 101, 100, 124, 72, 79, 84, 65, 83, 84, 101,
+ 109, 112, 108, 97, 116, 101, 0, 0, 0, 0,
+ 26, 82, 101, 119, 105, 114, 101, 100, 124, 70,
+ 108, 105, 103, 104, 116, 89, 111, 107, 101, 84,
+ 101, 109, 112, 108, 97, 116, 101, 0, 0, 0,
+ 0, 28, 82, 101, 119, 105, 114, 101, 100, 124,
+ 70, 108, 105, 103, 104, 116, 80, 101, 100, 97,
+ 108, 115, 84, 101, 109, 112, 108, 97, 116, 101,
+ 0, 0, 0, 0, 32, 82, 101, 119, 105, 114,
+ 101, 100, 124, 83, 105, 120, 68, 111, 102, 67,
+ 111, 110, 116, 114, 111, 108, 108, 101, 114, 84,
+ 101, 109, 112, 108, 97, 116, 101, 0, 0, 0,
+ 0, 42, 82, 101, 119, 105, 114, 101, 100, 46,
+ 73, 110, 116, 101, 114, 110, 97, 108, 124, 67,
+ 111, 110, 116, 114, 111, 108, 108, 101, 114, 84,
+ 101, 109, 112, 108, 97, 116, 101, 70, 97, 99,
+ 116, 111, 114, 121, 0, 0, 0, 0, 38, 82,
+ 101, 119, 105, 114, 101, 100, 46, 68, 97, 116,
+ 97, 124, 85, 115, 101, 114, 68, 97, 116, 97,
+ 83, 116, 111, 114, 101, 95, 80, 108, 97, 121,
+ 101, 114, 80, 114, 101, 102, 115, 0, 0, 0,
+ 0, 67, 82, 101, 119, 105, 114, 101, 100, 46,
+ 68, 97, 116, 97, 46, 85, 115, 101, 114, 68,
+ 97, 116, 97, 83, 116, 111, 114, 101, 95, 80,
+ 108, 97, 121, 101, 114, 80, 114, 101, 102, 115,
+ 124, 67, 111, 110, 116, 114, 111, 108, 108, 101,
+ 114, 65, 115, 115, 105, 103, 110, 109, 101, 110,
+ 116, 83, 97, 118, 101, 73, 110, 102, 111, 0,
+ 0, 0, 0, 78, 82, 101, 119, 105, 114, 101,
+ 100, 46, 68, 97, 116, 97, 46, 85, 115, 101,
+ 114, 68, 97, 116, 97, 83, 116, 111, 114, 101,
+ 95, 80, 108, 97, 121, 101, 114, 80, 114, 101,
+ 102, 115, 43, 67, 111, 110, 116, 114, 111, 108,
+ 108, 101, 114, 65, 115, 115, 105, 103, 110, 109,
+ 101, 110, 116, 83, 97, 118, 101, 73, 110, 102,
+ 111, 124, 80, 108, 97, 121, 101, 114, 73, 110,
+ 102, 111, 0, 0, 0, 0, 80, 82, 101, 119,
+ 105, 114, 101, 100, 46, 68, 97, 116, 97, 46,
+ 85, 115, 101, 114, 68, 97, 116, 97, 83, 116,
+ 111, 114, 101, 95, 80, 108, 97, 121, 101, 114,
+ 80, 114, 101, 102, 115, 43, 67, 111, 110, 116,
+ 114, 111, 108, 108, 101, 114, 65, 115, 115, 105,
+ 103, 110, 109, 101, 110, 116, 83, 97, 118, 101,
+ 73, 110, 102, 111, 124, 74, 111, 121, 115, 116,
+ 105, 99, 107, 73, 110, 102, 111, 0, 0, 0,
+ 0, 68, 82, 101, 119, 105, 114, 101, 100, 46,
+ 68, 97, 116, 97, 46, 85, 115, 101, 114, 68,
+ 97, 116, 97, 83, 116, 111, 114, 101, 95, 80,
+ 108, 97, 121, 101, 114, 80, 114, 101, 102, 115,
+ 124, 74, 111, 121, 115, 116, 105, 99, 107, 65,
+ 115, 115, 105, 103, 110, 109, 101, 110, 116, 72,
+ 105, 115, 116, 111, 114, 121, 73, 110, 102, 111,
+ 0, 0, 0, 0, 20, 82, 101, 119, 105, 114,
+ 101, 100, 124, 73, 110, 112, 117, 116, 77, 97,
+ 110, 97, 103, 101, 114, 0, 0, 0, 0, 27,
+ 82, 101, 119, 105, 114, 101, 100, 46, 85, 116,
+ 105, 108, 115, 124, 69, 120, 116, 101, 114, 110,
+ 97, 108, 84, 111, 111, 108, 115, 0, 0, 0,
+ 0, 18, 124, 67, 117, 115, 116, 111, 109, 80,
+ 111, 115, 116, 80, 114, 111, 99, 101, 115, 115,
+ 0, 0, 0, 0, 34, 67, 117, 115, 116, 111,
+ 109, 80, 111, 115, 116, 80, 114, 111, 99, 101,
+ 115, 115, 124, 67, 117, 115, 116, 111, 109, 82,
+ 101, 110, 100, 101, 114, 80, 97, 115, 115, 0,
+ 0, 0, 0, 26, 67, 117, 115, 116, 111, 109,
+ 80, 111, 115, 116, 80, 114, 111, 99, 101, 115,
+ 115, 124, 83, 101, 116, 116, 105, 110, 103, 115
+ };
+ result.TotalFiles = 564;
+ result.TotalTypes = 698;
+ result.IsEditorOnly = false;
+ return result;
+ }
+}