-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
42 additions
and
19 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ce/PokeWorld/PokeWorld/Harmony_Patching/PawnGroupKindWorker_Normal_GeneratePawns_Patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using RimWorld; | ||
using Verse; | ||
using UnityEngine; | ||
using HarmonyLib; | ||
|
||
namespace PokeWorld | ||
{ | ||
/* | ||
[HarmonyPatch(typeof(PawnGroupKindWorker_Normal))] | ||
[HarmonyPatch("GeneratePawns")] | ||
class PawnGroupKindWorker_Normal_GeneratePawns_Patch | ||
{ | ||
public static void postfix(PawnGroupMakerParms __0, PawnGroupMaker __1, List<Pawn> __2, bool __3) | ||
{ | ||
Log.Error("1"); | ||
if (PokeWorldSettings.allowPokemonInRaid && __2.Any() && (__0.raidStrategy == null || __0.raidStrategy != DefDatabase<RaidStrategyDef>.GetNamed("Siege"))) | ||
{ | ||
int maxPokes = (int)Rand.Range(__2.Count / 4f, __2.Count / 2f); | ||
for (int i = 0; i < maxPokes; i++) | ||
{ | ||
PawnKindDef kind = DefDatabase<PawnKindDef>.AllDefs.Where((PawnKindDef x) => x.race.HasComp(typeof(CompPokemon)) && PokeWorldSettings.GenerationAllowed(x.race.GetCompProperties<CompProperties_Pokemon>().generation) && !x.race.GetCompProperties<CompProperties_Pokemon>().attributes.Contains(PokemonAttribute.Baby) && !x.race.GetCompProperties<CompProperties_Pokemon>().attributes.Contains(PokemonAttribute.Fossil) && !x.race.GetCompProperties<CompProperties_Pokemon>().attributes.Contains(PokemonAttribute.Legendary) && !x.race.GetCompProperties<CompProperties_Pokemon>().attributes.Contains(PokemonAttribute.Particular)).RandomElementByWeight((PawnKindDef x) => 1 / x.race.GetCompProperties<CompProperties_Pokemon>().rarity); | ||
Pawn pawn = PawnGenerator.GeneratePawn(kind, __0.faction); | ||
__2.Add(pawn); | ||
} | ||
} | ||
} | ||
} | ||
*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Source/PokeWorld/PokeWorld/obj/Debug/PokeWorld.csproj.CoreCompileInputs.cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
8c70cf5f84b32b2c2e41a39f40dc001a360214be | ||
1a86222b168386ef6d165307b9964b6e4592104c |
Binary file not shown.