Skip to content

Commit

Permalink
Merge pull request #21 from RimNauts/main
Browse files Browse the repository at this point in the history
Minor update
  • Loading branch information
sindre0830 authored Jan 27, 2023
2 parents 30ac10c + cea2fa9 commit 9d83bb1
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 17 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/major-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ jobs:
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: "sindre0830"
DISCORD_AVATAR: "https://i.imgur.com/cEgyvGu.jpg"
TAG: ${{ steps.tag.outputs.new_tag }}
ROLE_ID: ${{ secrets.DISCORD_ROLE }}
with:
args: "**{{ TAG }}** New major update is out! Check out the changelog here <https://github.com/RimNauts/RimNauts2/releases/tag/{{ TAG }}> <@&1067088830999560212>"
args: "**{{ TAG }}** New major update is out! Check out the changelog here <https://github.com/RimNauts/RimNauts2/releases/tag/{{ TAG }}> <@&{{ ROLE_ID }}>"

- name: Send Changelog file to Discord server
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK }}
filename: Changelog.md
11 changes: 8 additions & 3 deletions .github/workflows/minor-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ jobs:
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: "sindre0830"
DISCORD_AVATAR: "https://i.imgur.com/cEgyvGu.jpg"
TAG: ${{ steps.tag.outputs.new_tag }}
ROLE_ID: ${{ secrets.DISCORD_ROLE }}
with:
args: "**{{ TAG }}** New update is out! Check out the changelog here <https://github.com/RimNauts/RimNauts2/releases/tag/{{ TAG }}> <@&1067088830999560212>"
args: "**{{ TAG }}** New update is out! Check out the changelog here <https://github.com/RimNauts/RimNauts2/releases/tag/{{ TAG }}> <@&{{ ROLE_ID }}>"

- name: Send Changelog file to Discord server
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK }}
filename: Changelog.md
11 changes: 8 additions & 3 deletions .github/workflows/patch-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ jobs:
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: "sindre0830"
DISCORD_AVATAR: "https://i.imgur.com/cEgyvGu.jpg"
TAG: ${{ steps.tag.outputs.new_tag }}
ROLE_ID: ${{ secrets.DISCORD_ROLE }}
with:
args: "**{{ TAG }}** New bug fix is out! Check out the changelog here <https://github.com/RimNauts/RimNauts2/releases/tag/{{ TAG }}> <@&1067088830999560212>"
args: "**{{ TAG }}** New bug fix is out! Check out the changelog here <https://github.com/RimNauts/RimNauts2/releases/tag/{{ TAG }}> <@&{{ ROLE_ID }}>"

- name: Send Changelog file to Discord server
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK }}
filename: Changelog.md
Binary file modified Assemblies/RimNauts2.dll
Binary file not shown.
4 changes: 3 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Changelog
- Change devmode requirement to godmode
- Increase chance of raids to happen in space
- Force raiders in space to be industrial tech or higher
- Force every raider in space to use a spacesuit
29 changes: 23 additions & 6 deletions Source/RimNauts2/RimNauts2/Biome/IncidentWorker_CanFireNow.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using HarmonyLib;
using System.Collections.Generic;
using Verse;

namespace RimNauts2 {
[HarmonyPatch(typeof(RimWorld.IncidentWorker), "CanFireNow")]
[HarmonyLib.HarmonyPatch(typeof(RimWorld.IncidentWorker), "CanFireNow")]
public class IncidentWorker_CanFireNow {
public static void Postfix(ref RimWorld.IncidentWorker __instance, RimWorld.IncidentParms parms, ref bool __result) {
if (parms.forced) return;
try {
if (!__result) return;
bool incident_not_on_satellite = !Find.WorldGrid[parms.target.Tile].biome.defName.Contains("RimNauts2");
Expand All @@ -15,13 +16,29 @@ public static void Postfix(ref RimWorld.IncidentWorker __instance, RimWorld.Inci
}
}

[HarmonyPatch(typeof(RimWorld.PawnsArrivalModeWorker), nameof(RimWorld.PawnsArrivalModeWorker.CanUseWith))]
[HarmonyLib.HarmonyPatch(typeof(RimWorld.PawnsArrivalModeWorker), nameof(RimWorld.PawnsArrivalModeWorker.CanUseWith))]
public class PawnsArrivalModeWorker_CanUseWith_Patch {
public static void Postfix(RimWorld.IncidentParms parms, ref bool __result) {
public static void Postfix(RimWorld.IncidentParms parms, ref RimWorld.PawnsArrivalModeWorker __instance, bool __result) {
if (__result && Find.WorldGrid[parms.target.Tile].biome.defName.Contains("RimNauts2")) {
if (parms.raidArrivalMode.minTechLevel >= RimWorld.TechLevel.Industrial) {
__result = false;
__instance.def.minTechLevel = RimWorld.TechLevel.Industrial;
}
}
}

[HarmonyLib.HarmonyPatch(typeof(RimWorld.PawnGroupMakerUtility), nameof(RimWorld.PawnGroupMakerUtility.GeneratePawns))]
public class PawnGroupMakerUtility_GeneratePawns {
public static IEnumerable<Pawn> Postfix(IEnumerable<Pawn> __result, RimWorld.PawnGroupMakerParms parms, bool warnOnZeroResults) {
bool no_oxygen = Universum.Utilities.Cache.allowed_utility(Find.WorldGrid[parms.tile].biome, "Universum.vacuum_suffocation");
bool decompression = Universum.Utilities.Cache.allowed_utility(Find.WorldGrid[parms.tile].biome, "Universum.vacuum_decompression");
bool requires_spacesuit = no_oxygen || decompression;
foreach (Pawn pawn in __result) {
if (requires_spacesuit) {
RimWorld.Apparel space_helmet = (RimWorld.Apparel) ThingMaker.MakeThing(ThingDef.Named("RimNauts2_Apparel_SpaceSuit_Head"));
RimWorld.Apparel space_suit = (RimWorld.Apparel) ThingMaker.MakeThing(ThingDef.Named("RimNauts2_Apparel_SpaceSuit_Body"));
pawn.apparel.Wear(space_helmet, false);
pawn.apparel.Wear(space_suit, false);
}
yield return pawn;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/RimNauts2/RimNauts2/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace RimNauts2 {
public static class Info {
public static readonly string name = "RimNauts 2";
public static readonly string version = "3.3.0";
public static readonly string version = "3.4.0";
}

public static class Style {
Expand Down
4 changes: 4 additions & 0 deletions Source/RimNauts2/RimNauts2/RimNauts2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Universum">
<HintPath>..\..\..\..\Universum-Beta\Assemblies\Universum.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Biome\BiomeWorker_Satellite.cs" />
Expand Down

0 comments on commit 9d83bb1

Please sign in to comment.