Skip to content

Commit

Permalink
fix: updated to work with newest version of unbound
Browse files Browse the repository at this point in the history
  • Loading branch information
pdcook committed Jun 18, 2021
1 parent 93315cb commit c4c5ce1
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 38 deletions.
Binary file modified PCE.dll
Binary file not shown.
58 changes: 34 additions & 24 deletions PCE/PCE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace PCE
{
[BepInDependency("com.willis.rounds.unbound", BepInDependency.DependencyFlags.HardDependency)]
[BepInDependency("pykess.rounds.plugins.playerjumppatch", BepInDependency.DependencyFlags.HardDependency)]
[BepInPlugin("pykess.rounds.plugins.pykesscardexpansion", "Pykess's Card Expansion (PCE)", "0.1.7.1")]
[BepInPlugin("pykess.rounds.plugins.pykesscardexpansion", "Pykess's Card Expansion (PCE)", "0.1.7.2")]
[BepInProcess("Rounds.exe")]
public class PCE : BaseUnityPlugin
{
Expand Down Expand Up @@ -55,37 +55,47 @@ private void Start()
CustomCard.BuildCard<CloseQuartersCard>();
CustomCard.BuildCard<DiscombobulateCard>();

GameModeManager.AddHook(GameModeHooks.HookBattleStart, (gm) => CommitMurders());
GameModeManager.AddHook(GameModeHooks.HookBattleStart, (gm) => ResetGravity());

GameModeManager.AddHook(GameModeHooks.HookBattleStart, (gm) =>
}

private IEnumerator CommitMurders()
{
Player[] players = PlayerManager.instance.players.ToArray();
for (int j = 0; j < players.Length; j++)
{
Player[] players = PlayerManager.instance.players.ToArray();
for (int j = 0; j < players.Length; j++)
// commit any pending murders
if (players[j].data.stats.GetAdditionalData().murder >= 1)
{
// clear player gravity effects on respawn
if (players[j].GetComponent<GravityEffect>() != null)
{
players[j].GetComponent<GravityEffect>().Destroy();
}

// commit any pending murders
if (players[j].data.stats.GetAdditionalData().murder >= 1)
players[j].data.stats.GetAdditionalData().murder--;
Player oppPlayer = PlayerManager.instance.GetOtherPlayer(players[j]);
Unbound.Instance.ExecuteAfterSeconds(2f, delegate
{
players[j].data.stats.GetAdditionalData().murder--;
Player oppPlayer = PlayerManager.instance.GetOtherPlayer(players[j]);
Unbound.Instance.ExecuteAfterSeconds(2f, delegate
oppPlayer.data.view.RPC("RPCA_Die", RpcTarget.All, new object[]
{
oppPlayer.data.view.RPC("RPCA_Die", RpcTarget.All, new object[]
{
new Vector2(0, 1)
});

new Vector2(0, 1)
});
}
}

});

});
}
}
yield break;
}
private IEnumerator ResetGravity()
{
Player[] players = PlayerManager.instance.players.ToArray();
for (int j = 0; j < players.Length; j++)
{
// clear player gravity effects on respawn
if (players[j].GetComponent<GravityEffect>() != null)
{
players[j].GetComponent<GravityEffect>().Destroy();
}
}
yield break;
}

private const string ModId = "pykess.rounds.plugins.pykesscardexpansion";

private const string ModName = "Pykess's Card Expansion (PCE)";
Expand Down
17 changes: 7 additions & 10 deletions PCE/PCE.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@

<ItemGroup>
<Reference Include="0Harmony">
<HintPath>Libs\0Harmony.dll</HintPath>
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ROUNDS\BepInEx\core\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>Libs\Assembly-CSharp.dll</HintPath>
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ROUNDS\Rounds_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="BepInEx">
<HintPath>Libs\BepInEx.dll</HintPath>
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ROUNDS\BepInEx\core\BepInEx.dll</HintPath>
</Reference>
<Reference Include="BepInEx.Harmony">
<HintPath>Libs\BepInEx.Harmony.dll</HintPath>
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ROUNDS\BepInEx\core\BepInEx.Harmony.dll</HintPath>
</Reference>
<Reference Include="InControl">
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ROUNDS\Rounds_Data\Managed\InControl.dll</HintPath>
Expand Down Expand Up @@ -59,23 +59,20 @@
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ROUNDS\BepInEx\plugins\UnboundLib.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>Libs\UnityEngine.dll</HintPath>
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ROUNDS\Rounds_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AssetBundleModule">
<HintPath>Libs\UnityEngine.AssetBundleModule.dll</HintPath>
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ROUNDS\Rounds_Data\Managed\UnityEngine.AssetBundleModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>Libs\UnityEngine.CoreModule.dll</HintPath>
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ROUNDS\Rounds_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ParticleSystemModule">
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ROUNDS\Rounds_Data\Managed\UnityEngine.ParticleSystemModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Physics2DModule">
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ROUNDS\Rounds_Data\Managed\UnityEngine.Physics2DModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ROUNDS\Rounds_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ This is a BepInEx compatible mod for Rounds that adds a number of new cards to t

A massive thanks to the people who helped me learn how to mod, especially Ascyst, Willis, and Tilastokeskus.

## Installation Instructions
## Easy Installation Instructions
---------------------------------

Download [r2modman](https://rounds.thunderstore.io/package/ebkr/r2modman/), set up a Rounds profile, and add `PCE` to the profile. All dependencies will be automatically installed. Just click `Start Modded` to start playing!

## Manual Installation Instructions
----------------------------
1. Install BepInEx, you can find it [here](https://discord.gg/tAQxJbV9RG).
1. Install BepInEx, you can find it [here](https://rounds.thunderstore.io/package/BepInEx/BepInExPack_ROUNDS/).

2. Install the *newest versions* of [UnboundLib and MMHOOK](https://github.com/Rounds-Modding/UnboundLib/releases).

3. Copy `PCE.dll` to `/path/to/Steam/steamapps/common/ROUNDS/BepInEx/plugins/`
3. Install `PlayerJumpPatch` which you can find [here](https://rounds.thunderstore.io/package/Pykess/PlayerJumpPatch/).

4. Copy `PCE.dll` to `/path/to/Steam/steamapps/common/ROUNDS/BepInEx/plugins/`

### Version Notes
-----------------
Expand Down Expand Up @@ -96,6 +103,8 @@ A massive thanks to the people who helped me learn how to mod, especially Ascyst

- v0.1.7.1: moved PlayerJump Patch to separate utility mod

- v0.1.7.2: bugfix - updated Gamemode hooks to be compatible with newest version of unbound

### Suggestions, Bug Reports, and Troubleshooting
-------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "PCE",
"version_number": "1.7.1",
"version_number": "1.7.2",
"website_url": "https://github.com/pdcook/PCE",
"description": "Adds a number of new cards to the game",
"dependencies": [
Expand Down

0 comments on commit c4c5ce1

Please sign in to comment.