Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Hard Mode.sln
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31129.286
# Visual Studio Version 17
VisualStudioVersion = 17.14.37216.2 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hard Mode", "Hard Mode\Hard Mode.csproj", "{A5FB1CFA-EF8A-494F-880E-60DC1E2316CB}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hard Mode", "Hard Mode\Hard Mode.csproj", "{A4BF1638-4220-32CF-417E-1789654201D9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A5FB1CFA-EF8A-494F-880E-60DC1E2316CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A5FB1CFA-EF8A-494F-880E-60DC1E2316CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5FB1CFA-EF8A-494F-880E-60DC1E2316CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5FB1CFA-EF8A-494F-880E-60DC1E2316CB}.Release|Any CPU.Build.0 = Release|Any CPU
{A4BF1638-4220-32CF-417E-1789654201D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4BF1638-4220-32CF-417E-1789654201D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4BF1638-4220-32CF-417E-1789654201D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4BF1638-4220-32CF-417E-1789654201D9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2E4AB110-33E5-4F25-9B47-B9E46530ED4B}
SolutionGuid = {162D9A83-391A-450B-B69D-CA64F21951DF}
EndGlobalSection
EndGlobal
9 changes: 7 additions & 2 deletions Hard Mode/DataSaver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Hard_Mode
{
internal class DataSaver : PMLSaveData
{
public override uint VersionID => 160;
public override uint VersionID => 180;

public override string Identifier()
{
Expand All @@ -18,7 +18,7 @@ public override void LoadData(byte[] Data, uint VersionID)
{
using (BinaryReader binaryReader = new BinaryReader(dataStream))
{
if (VersionID <= 140)
if (VersionID >= 140)
{
Options.FogOfWar = binaryReader.ReadBoolean();
Options.DangerousReactor = binaryReader.ReadBoolean();
Expand All @@ -29,6 +29,10 @@ public override void LoadData(byte[] Data, uint VersionID)
{
Options.AdvancedCloak = binaryReader.ReadBoolean();
}
if (VersionID >= 180)
{
Options.ScalingToPlayerShipLevel = binaryReader.ReadBoolean();
}
}
}
}
Expand All @@ -44,6 +48,7 @@ public override byte[] SaveData()
binaryWriter.Write(Options.WeakReactor);
binaryWriter.Write(Options.SpinningCycpher);
binaryWriter.Write(Options.AdvancedCloak);
binaryWriter.Write(Options.ScalingToPlayerShipLevel);
}
return stream.ToArray();
}
Expand Down
2 changes: 1 addition & 1 deletion Hard Mode/Enemies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static int Postfix(int __result, PLPersistantShipInfo inPersistantShipInfo, int
if (PLServer.Instance != null && inPersistantShipInfo != null)
{
PLRand shipDeterministicRand = PLShipInfoBase.GetShipDeterministicRand(inPersistantShipInfo, 30 + offset);
__result = Mathf.RoundToInt(PLServer.Instance.ChaosLevel * shipDeterministicRand.Next(0.5f, 0.9f) * shipDeterministicRand.Next(0.5f, 0.9f) * PLGlobal.Instance.Galaxy.GenerationSettings.EnemyShipPowerScalar + PLEncounterManager.Instance.PlayerShip.GetCombatLevel() / 20);
__result = Mathf.RoundToInt(PLServer.Instance.ChaosLevel * shipDeterministicRand.Next(0.5f, 0.9f) * shipDeterministicRand.Next(0.5f, 0.9f) * PLGlobal.Instance.Galaxy.GenerationSettings.EnemyShipPowerScalar + (Options.ScalingToPlayerShipLevel ? 1 : 0) * PLEncounterManager.Instance.PlayerShip.GetCombatLevel() / 20);
return __result;
}
__result = 0;
Expand Down
142 changes: 12 additions & 130 deletions Hard Mode/Hard Mode.csproj
Original file line number Diff line number Diff line change
@@ -1,142 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\OpenSesame.Net.Compilers.Toolset.3.7.0\build\OpenSesame.Net.Compilers.Toolset.props" Condition="Exists('..\packages\OpenSesame.Net.Compilers.Toolset.3.7.0\build\OpenSesame.Net.Compilers.Toolset.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A5FB1CFA-EF8A-494F-880E-60DC1E2316CB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFramework>net472</TargetFramework>
<RootNamespace>Hard_Mode</RootNamespace>
<AssemblyName>Hard Mode</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<Compile Include="AbyssCampaing.cs" />
<Compile Include="Advanced Cloak.cs" />
<Compile Include="AOG Campaing.cs" />
<Compile Include="Better Biscuit Race.cs" />
<Compile Include="Better Mines.cs" />
<Compile Include="Commands.cs" />
<Compile Include="CU Campaing.cs" />
<Compile Include="Custom AI.cs" />
<Compile Include="Custom Bounty Hunters.cs" />
<Compile Include="CypherSpinning.cs" />
<Compile Include="Enemies.cs" />
<Compile Include="Crimes.cs" />
<Compile Include="Enemy Warp.cs" />
<Compile Include="Fire.cs" />
<Compile Include="Fog of War.cs" />
<Compile Include="Galaxy.cs" />
<Compile Include="LiarsDiceAI.cs" />
<Compile Include="Options.cs" />
<Compile Include="Mod.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Reactor.cs" />
<Compile Include="DataSaver.cs" />
<Compile Include="Sector Commanders.cs" />
<Compile Include="Shields.cs" />
<Compile Include="Starting Components.cs" />
<Compile Include="Update.cs" />
<Compile Include="Warp Guardian.cs" />
<Compile Include="WD Campaing.cs" />
<PackageReference Include="Lib.Harmony" Version="2.2.2">
<IncludeAssets>compile</IncludeAssets>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="PulsarLostColony.GameLibs" Version="1.2.7.2" />
</ItemGroup>

<ItemGroup>
<Reference Include="0Harmony">
<HintPath>lib\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ACTk.Runtime">
<HintPath>lib\ACTk.Runtime.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>lib\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="AstarPathfindingProject">
<HintPath>lib\AstarPathfindingProject.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="CrewAILibraryBuild">
<HintPath>lib\CrewAILibraryBuild.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Photon3Unity3D">
<HintPath>lib\Photon3Unity3D.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PulsarModLoader">
<HintPath>lib\PulsarModLoader.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine">
<HintPath>lib\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>lib\UnityEngine.AnimationModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>lib\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>lib\UnityEngine.IMGUIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.ParticleSystemModule">
<HintPath>lib\UnityEngine.ParticleSystemModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>lib\UnityEngine.PhysicsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>lib\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="lib\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>SET PLUGIN_DIR="C:\Program Files (x86)\Steam\steamapps\common\PULSARLostColony\Mods\"

IF EXIST %25PLUGIN_DIR%25 (
ECHO Copying DLLs to Plugins directory...
XCOPY /Y /F "$(TargetPath)" %25PLUGIN_DIR%25
)</PostBuildEvent>
</PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Este projeto faz referência a pacotes do NuGet que não estão presentes neste computador. Use a Restauração de Pacotes do NuGet para baixá-los. Para obter mais informações, consulte http://go.microsoft.com/fwlink/?LinkID=322105. O arquivo ausente é {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\OpenSesame.Net.Compilers.Toolset.3.7.0\build\OpenSesame.Net.Compilers.Toolset.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\OpenSesame.Net.Compilers.Toolset.3.7.0\build\OpenSesame.Net.Compilers.Toolset.props'))" />
</Target>
</Project>
</Project>
4 changes: 2 additions & 2 deletions Hard Mode/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ namespace Hard_Mode
public class Mod : PulsarMod
{

public override string Version => "1.6.1";
public override string Version => "1.6.2";

public override string Author => "EngBot, Pokegustavo, Mest, Craziness924, 18107, sugarbuzz1";
public override string Author => "EngBot, Pokegustavo, Mest, Craziness924, 18107, sugarbuzz1, OnHyex";

public override string ShortDescription => "Makes your game a nightmare";

Expand Down
9 changes: 9 additions & 0 deletions Hard Mode/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Options //For all future options
public static bool WeakReactor = false;
public static bool SpinningCycpher = false;
public static bool AdvancedCloak = false;
public static bool ScalingToPlayerShipLevel = true;
}
internal class Config : ModSettingsMenu
{
Expand All @@ -39,6 +40,8 @@ public override void Draw()
GUILayout.Label("Makes Cyphers slowly spin");
Options.AdvancedCloak = GUILayout.Toggle(Options.AdvancedCloak, "Advanced Cloak");
GUILayout.Label("Revamps the cloaking system");
Options.ScalingToPlayerShipLevel = GUILayout.Toggle(Options.ScalingToPlayerShipLevel, "Scaling Enemies From Player Strength");
GUILayout.Label("Enables the enemy ships and crew scaling based off the strength of your ship");
}
}

Expand All @@ -52,13 +55,18 @@ public override void HandleRPC(object[] arguments, PhotonMessageInfo sender)
Options.WeakReactor = (bool)arguments[3];
Options.SpinningCycpher = (bool)arguments[4];
Options.AdvancedCloak = (bool)arguments[5];
Options.ScalingToPlayerShipLevel = (bool)arguments[6];
}
}
[HarmonyPatch(typeof(PLServer), "ServerSendClientStarmap")]
class UpdateMap //Updates the galaxy to the clients
{
static void Postfix(PhotonMessageInfo pmi)
{
if (!Options.FogOfWar)
{
return;
}
foreach (PLSectorInfo sector in PLGlobal.Instance.Galaxy.AllSectorInfos.Values)
{
if (sector.Discovered)
Expand Down Expand Up @@ -86,6 +94,7 @@ static void Postfix()
Options.DangerousReactor = false;
Options.WeakReactor = false;
Options.SpinningCycpher = false;
Options.ScalingToPlayerShipLevel = false;
}
else
{
Expand Down
36 changes: 0 additions & 36 deletions Hard Mode/Properties/AssemblyInfo.cs

This file was deleted.

33 changes: 22 additions & 11 deletions Hard Mode/Update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace Hard_Mode
[HarmonyPatch(typeof(PLShipInfoBase), "Update")]
class Update
{
public static float HardModeSettingsSyncTime = 0;
public static float timer = 1;
public static float LastGalaxySync = Time.time;
static void Postfix(PLShipInfoBase __instance)
Expand All @@ -37,16 +38,22 @@ static void Postfix(PLShipInfoBase __instance)
Custom_Bounty_Hunters.BountyHunterBalance.MinCombatLevel = 1.2f + PLServer.Instance.ChaosLevel / 15;
Custom_Bounty_Hunters.RelicHunterBalance.MaxCombatLevel = 1.5f + PLServer.Instance.ChaosLevel / 5;
Custom_Bounty_Hunters.RelicHunterBalance.MinCombatLevel = 1.2f + PLServer.Instance.ChaosLevel / 10;
ModMessage.SendRPC("modders.hardmode", "Hard_Mode.ReciveOptions", PhotonTargets.Others, new object[] //This is responsible to send the options to all clients
if (Time.time - HardModeSettingsSyncTime > 5)
{
Options.FogOfWar,
Options.DangerousReactor,
Options.MasterHasMod,
Options.WeakReactor,
Options.SpinningCycpher,
Options.AdvancedCloak,
});
if (Time.time - LastGalaxySync > 30 && PLServer.GetCurrentSector().VisualIndication != ESectorVisualIndication.ABYSS)//Syncs the discovered sectors with all clients every 30 seconds
HardModeSettingsSyncTime = Time.time;
ModMessage.SendRPC("modders.hardmode", "Hard_Mode.ReciveOptions", PhotonTargets.Others, new object[] //This is responsible to send the options to all clients
{
Options.FogOfWar,
Options.DangerousReactor,
Options.MasterHasMod,
Options.WeakReactor,
Options.SpinningCycpher,
Options.AdvancedCloak,
Options.ScalingToPlayerShipLevel,
});
}

if (Options.FogOfWar && Time.time - LastGalaxySync > 30 && PLServer.GetCurrentSector().VisualIndication != ESectorVisualIndication.ABYSS)//Syncs the discovered sectors with all clients every 30 seconds
{
foreach (PLSectorInfo sector in PLGlobal.Instance.Galaxy.AllSectorInfos.Values)
{
Expand Down Expand Up @@ -88,8 +95,10 @@ static void Postfix(PLShipInfoBase __instance)
}
if(PLServer.GetCurrentSector().VisualIndication != ESectorVisualIndication.ABYSS)
{
foreach (PLShipInfoBase ship in FindObjectsOfType(typeof(PLShipInfoBase)))
foreach (PLShipInfoBase ship in PLEncounterManager.Instance.AllShips.Values)
{
if (ship is null)
continue;
if (!(ship is PLHighRollersShipInfo) && ship.MyStats != null && ship.ShipTypeID != EShipType.E_ACADEMY)
{
if (!ship.IsDrone && !ship.IsInfected && ship.ShipTypeID != EShipType.E_CIVILIAN_FUEL && !__instance.InWarp) //This makes all boardable ships with the shields offline lose 10% of integrity per second
Expand All @@ -114,8 +123,10 @@ static void Postfix(PLShipInfoBase __instance)
}
if (!ship.GetIsPlayerShip() && ship.ShipTypeID != EShipType.E_CIVILIAN_FUEL && ship.ShipTypeID != EShipType.E_BEACON && !ship.HasModifier(EShipModifierType.CORRUPTED)) //This should make attacking one ship all it's friends will attack you (execpt beacon)
{
foreach (PLShipInfoBase Allied in FindObjectsOfType(typeof(PLShipInfoBase)))
foreach (PLShipInfoBase Allied in PLEncounterManager.Instance.AllShips.Values)
{
if (Allied is null)
continue;
if (!(Allied is PLHighRollersShipInfo) && Allied.ShipTypeID != EShipType.E_ACADEMY && Allied.MyStats != null && Allied.FactionID == ship.FactionID && !Allied.HostileShips.Contains(ship.ShipID) && Allied.ShipTypeID != EShipType.E_BEACON && !Allied.HasModifier(EShipModifierType.CORRUPTED))
{
if (Allied.GetIsPlayerShip())
Expand Down
Binary file removed Hard Mode/lib/0Harmony.dll
Binary file not shown.
Binary file removed Hard Mode/lib/ACTk.Runtime.dll
Binary file not shown.
Binary file removed Hard Mode/lib/Assembly-CSharp.dll
Binary file not shown.
Binary file removed Hard Mode/lib/AstarPathfindingProject.dll
Binary file not shown.
Binary file removed Hard Mode/lib/CrewAILibraryBuild.dll
Binary file not shown.
Binary file removed Hard Mode/lib/Photon3Unity3D.dll
Binary file not shown.
Binary file modified Hard Mode/lib/PulsarModLoader.dll
Binary file not shown.
Binary file removed Hard Mode/lib/UnityEngine.AnimationModule.dll
Binary file not shown.
Binary file removed Hard Mode/lib/UnityEngine.CoreModule.dll
Binary file not shown.
Binary file removed Hard Mode/lib/UnityEngine.IMGUIModule.dll
Binary file not shown.
Binary file removed Hard Mode/lib/UnityEngine.ParticleSystemModule.dll
Binary file not shown.
Binary file removed Hard Mode/lib/UnityEngine.PhysicsModule.dll
Binary file not shown.
Binary file removed Hard Mode/lib/UnityEngine.UI.dll
Binary file not shown.
Binary file removed Hard Mode/lib/UnityEngine.dll
Binary file not shown.