Skip to content

Commit e203dc0

Browse files
committed
2.0.1: spearmaster 2 handed, mod description
1 parent 1ad2599 commit e203dc0

File tree

6 files changed

+80
-15
lines changed

6 files changed

+80
-15
lines changed

PlayerHooks.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private void PlayerHooks()
4141
// In movement if it's true we can keep walking into walls, which shouldn't happen
4242
IL.Player.MovementUpdate += Player_AppendToIsSlugpupCheck;
4343

44-
// False in SlugcatGrab if we have using both arms enabled
44+
// False in SlugcatGrab if we have using both arms enabled or if were spearmaster and we want to pick up a spear
4545
IL.Player.SlugcatGrab += Player_SlugcatGrabAppendToIsSlugpupCheck;
4646

4747
// Add so we get correct hand positions
@@ -290,7 +290,8 @@ private void Player_SlugcatGrabAppendToIsSlugpupCheck(ILContext il)
290290
c.Index += 2;
291291
// Insert the condition directly after get_isSlugpup
292292
c.Emit(OpCodes.Ldarg_0);
293-
c.EmitDelegate((Player player) => !Options.UseBothHands.Value);
293+
c.Emit(OpCodes.Ldarg_1);
294+
c.EmitDelegate(GetHandsCanGrabAnyway);
294295
c.Emit(OpCodes.And);
295296
}
296297
}
@@ -300,6 +301,19 @@ private void Player_SlugcatGrabAppendToIsSlugpupCheck(ILContext il)
300301
}
301302
}
302303

304+
// Inverted ifs because we need to not pass the slugpup if check, not go inside it
305+
private bool GetHandsCanGrabAnyway(Player player, PhysicalObject obj)
306+
{
307+
if (Options.SpearmasterTwoHanded.Value && player.SlugCatClass == MoreSlugcatsEnums.SlugcatStatsName.Spear &&
308+
obj is Spear && IsHoldingSpear(player)) return false;
309+
return !Options.UseBothHands.Value;
310+
}
311+
312+
private bool IsHoldingSpear(Player player)
313+
{
314+
return player.grasps[0]?.grabbed is Spear || player.grasps[1]?.grabbed is Spear;
315+
}
316+
303317
private void Player_AppendPupCheck(ILContext il)
304318
{
305319
//351 0328 isinst Player

PluginInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
internal static class PluginInfo {
22
public const string PluginGUID = "amione.Pupifier";
33
public const string PluginName = "Pupifier";
4-
public const string PluginVersion = "2.0.0";
4+
public const string PluginVersion = "2.0.1";
55
}

Pupifier.csproj

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,33 @@
33
<TargetFramework>net48</TargetFramework>
44
<AssemblyName>amione.Pupifier</AssemblyName>
55
<Product>Pupifier</Product>
6-
<ProductDescription>Pupifier is a mod that allows you to become a slugpup in Rain World! This mod enhances your gameplay experience by enabling you to transform into a slugpup, offering a unique perspective and new challenges. Additionally, this mod was made for Rain Meadow but works normally as well!</ProductDescription>
7-
<ModVersion>2.0.0</ModVersion>
6+
<ProductDescription>
7+
Lets you become a slugpup in Rain World with a push of a button (dynamic in-game transform), with meadow support. This mod was made specifically for meadow but works for non-meadow as well
8+
9+
Known issues
10+
11+
- Meadow issues are not related to my mod (grabbing players and breaking if you go thru a pipe, piggybacking desync)
12+
- Report any issues please!
13+
14+
Features
15+
16+
- Transform into a slugpup (Works in Rain Meadow)
17+
- Change your stats based on slugpup relativity
18+
- Works with modded slugcats as wellCredits
19+
20+
Credits
21+
22+
- amione - Creator
23+
- youbitchoc - For helping in development
24+
- henpemaz - For Rain Meadow
25+
- Maxi Mol - For Mouse Drag code
26+
- LDani, simichan1227 - For testing the s**t out of my mod (It was kinda encouraging)
27+
28+
Report Issues on github please! https://github.com/xamionex/Pupifier/issues/new
29+
Steam doesn't give me notifications for comments on my own mods for some reason,
30+
so I might not see your comment because I need to literally go to the mod page to see it, and I'm not doing that every day.
31+
</ProductDescription>
32+
<ModVersion>2.0.1</ModVersion>
833
<Version>2.0.8</Version>
934
<LangVersion>10.0</LangVersion>
1035
<Nullable>enable</Nullable>

PupifierOptions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public partial class PupifierOptions : OptionInterface
2828
public readonly Configurable<float> ActionJumpPowerFac;
2929
public readonly Configurable<bool> DisableBeingGrabbed;
3030
public readonly Configurable<bool> UseBothHands;
31+
public readonly Configurable<bool> SpearmasterTwoHanded;
3132

3233
public PupifierOptions()
3334
{
@@ -54,6 +55,7 @@ public PupifierOptions()
5455
// Toggles tab
5556
DisableBeingGrabbed = config.Bind(nameof(DisableBeingGrabbed), false, new ConfigurableInfo("If enabled, you can't be grabbed", null, "", "Disable being Grabbed"));
5657
UseBothHands = config.Bind(nameof(UseBothHands), false, new ConfigurableInfo("If enabled, you can use both hands as a pup", null, "", "Enable using both hands"));
58+
SpearmasterTwoHanded = config.Bind(nameof(SpearmasterTwoHanded), true, new ConfigurableInfo("If enabled, you can use both hands for spears as spearmaster", null, "", "Spearmaster can hold 2 spears"));
5759

5860
// Experimental tab
5961
ModAutoDisabledToggle = config.Bind(nameof(ModAutoDisabledToggle), false, new ConfigurableInfo("If true, Pupifier will not disable itself when other mods are found. This requires a restart", null, "", "Allow Incompatible Mods (Requires Restart)"));
@@ -125,6 +127,7 @@ public override void Initialize()
125127
sepr = 30f;
126128
AddCheckbox(DisableBeingGrabbed, new Vector2(x, y -= sepr), softYellow, softYellow, softYellow);
127129
AddCheckbox(UseBothHands, new Vector2(x, y -= sepr), softYellow, softYellow, softYellow);
130+
AddCheckbox(SpearmasterTwoHanded, new Vector2(x, y -= sepr), softYellow, softYellow, softYellow);
128131

129132
/**************** Experimental ****************/
130133
curTab++;

pupifier/modinfo.json

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,35 @@
11
{
22
"id": "amione.Pupifier",
33
"name": "Pupifier",
4-
"version": "2.0.0",
4+
"version": "2.0.1",
55
"target_game_version": "v1.9.15",
66
"authors": "amione - Creator, youbitchoc - For helping in development, henpemaz - For Rain Meadow, Maxi Mol - For Mouse Drag code, LDani, simichan1227 - For testing the s**t out of my mod (It was kinda encouraging)",
7-
"description": "Pupifier is a mod that allows you to become a slugpup in Rain World! This mod enhances your gameplay experience by enabling you to transform into a slugpup, offering a unique perspective and new challenges. Additionally, this mod was made for Rain Meadow but works normally as well!",
7+
"description": "
8+
Lets you become a slugpup in Rain World with a push of a button (dynamic in-game transform), with meadow support. This mod was made specifically for meadow but works for non-meadow as well
9+
10+
Known issues
11+
12+
- Meadow issues are not related to my mod (grabbing players and breaking if you go thru a pipe, piggybacking desync)
13+
- Report any issues please!
14+
15+
Features
16+
17+
- Transform into a slugpup (Works in Rain Meadow)
18+
- Change your stats based on slugpup relativity
19+
- Works with modded slugcats as wellCredits
20+
21+
Credits
22+
23+
- amione - Creator
24+
- youbitchoc - For helping in development
25+
- henpemaz - For Rain Meadow
26+
- Maxi Mol - For Mouse Drag code
27+
- LDani, simichan1227 - For testing the s**t out of my mod (It was kinda encouraging)
28+
29+
Report Issues on github please! https://github.com/xamionex/Pupifier/issues/new
30+
Steam doesn't give me notifications for comments on my own mods for some reason,
31+
so I might not see your comment because I need to literally go to the mod page to see it, and I'm not doing that every day.
32+
",
833
"requirements": ["moreslugcats"],
934
"requirements_names": [],
1035
"checksum_override_version": true

readme.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# Pupifier
22

3-
Pupifier is a mod that allows you to become a slugpup in Rain Meadow! This mod enhances your gameplay experience by enabling you to transform into a slugpup, offering a unique perspective and new challenges.
3+
Lets you become a slugpup in Rain World with a push of a button (dynamic in-game transform), with meadow support. This mod was made specifically for meadow but works for non-meadow as well
44

55
## Known issues
66

7-
- Meadow issues are not related to my mod (grabbing players and breaking if you go thru a pipe...)
7+
- Meadow issues are not related to my mod (grabbing players and breaking if you go thru a pipe, piggybacking desync)
88
- Report any issues please!
99

1010
## Features
1111

12-
- Transform into a slugpup in Rain Meadow.
12+
- Transform into a slugpup (Works in Rain Meadow)
1313
- Change your stats based on slugpup relativity
14+
- Works with modded slugcats as well
1415

1516
## Installation
1617

@@ -22,9 +23,7 @@ Pupifier is a mod that allows you to become a slugpup in Rain Meadow! This mod e
2223
## Requirements
2324

2425
- Game version: v1.9.15
25-
- Required Mods:
26-
- henpemaz_rainmeadow
27-
- moreslugcats
26+
- Required Mods: moreslugcats
2827

2928
## Credits
3029

@@ -40,6 +39,5 @@ This mod is provided as-is, without any express or implied warranties. Use at yo
4039

4140
## Support
4241

43-
If you encounter any issues or have questions, feel free to reach out to the community or contribute to the development of the mod.
44-
42+
If you encounter any issues or have questions, feel free to reach out or contribute to the development of the mod.
4543
Enjoy your time as a slugpup in Rain Meadow!

0 commit comments

Comments
 (0)