Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an API to allow mods to adjust breast behavior when armor is worn #17

Merged
merged 3 commits into from Mar 17, 2022

Conversation

pupnewfster
Copy link
Collaborator

@pupnewfster pupnewfster commented Mar 16, 2022

Exposed an API to allow mods to tweak various settings when their armor is being worn. See IGenderArmor javadocs for details

Changes:

  • Made breathing take armor's physics resistance into account
  • Made breast bounce intensity take armor's physics resistance into account

Additionally this PR also does a little minor cleanup to GenderLayer:

  • Inlining one small method
  • Removing a method I forgot to remove previously when I inlined it.
  • Moving the armor check for breathingAnimation to before any calculation of it is done (to avoid having to calculate that stuff) and also making it so that the check for being able to breathe under water using mojang's util method to check effects to avoid having to update it if they add more and also making it so that if the player's head is in a bubble column it counts as them being able to breathe (as that increases a player's breath)
  • Removing not instanceof ElytraItem check as a class cannot be both an instanceof ArmorItem and an instanceof ElytraItem
  • Fixed rendering that I accidentally broke in a previous PR when batching things in relation to rendering of the left breast when it can actually be seen under armor

@WildfireRomeo
Copy link
Owner

Default armor resistance values I'd recommend

This depends on whether or not 1 is equal to NO resistance (full motion), and 0 is full resistance:
public static final SimpleGenderArmor FALLBACK = new SimpleGenderArmor(0.5);
public static final SimpleGenderArmor LEATHER = new SimpleGenderArmor(0.7);
public static final SimpleGenderArmor CHAIN_MAIL = new SimpleGenderArmor(0.5);
public static final SimpleGenderArmor GOLD = new SimpleGenderArmor(0);
public static final SimpleGenderArmor IRON = new SimpleGenderArmor(0);
public static final SimpleGenderArmor DIAMOND = new SimpleGenderArmor(0);
public static final SimpleGenderArmor NETHERITE = new SimpleGenderArmor(0);

Maybe change Gold armor as well to something other than zero just to switch it up?

Tightness Comment

Regarding "tightness", are you referencing how "tight" around the breasts the armor is (like scaling the armor breasts)? I don't see a problem with adding this personally. For example, it could be tighter for leather armor or something with a similar material.

Breathing animation TODO

yeah, the breathing animation could play if the value is <= 0.5 or something. Would have to see it working properly to make a definitive answer.

Will add onto this PR comments section if I find anything else worth mentioning.

@pupnewfster
Copy link
Collaborator Author

I was initially thinking 0 is no resistance and 1 is full resistance (but I can just flip the numbers you gave).

In regards to tightness I was more thinking something similar to say how sports bras act in that they basically push the breasts against you further so they end up appearing smaller or something (though I am unsure how to best implement this math wise).

And I will mess around a bit with the breathing animation's todo then to see what looks reasonable as a rough cutoff point.

…a armors and make breathing only happen below a certain physics threshold. Also fix having accidentally broken rendering of left breast when wearing armor that lets you see the breast such as chainmail
@pupnewfster
Copy link
Collaborator Author

Okay, I made a few changes and it seems to be working decently now (I also fixed a bug I found that I introduced in an earlier PR by accident in relation to rendering of the left breast when wearing things like chainmail)l. I still need to go ahead and make the docs in IGenderArmor a bit nicer and potentially try to implement a form of "tightness" if you think that is a good idea. (Though truth be told I am not quite sure how I would actually go about implementing it [other than maybe just having it slightly shrink the target breast size?])

@WildfireRomeo
Copy link
Owner

If you don't know how to implement the tightness thing then I'd just say hold off for now. It wouldn't be a super important thing. I don't know the best way to implement it either honestly

@pupnewfster
Copy link
Collaborator Author

Sounds good, I probably will experiment with it a little later today as I have a couple ideas how it might work and if not then I will just remove the comments I put on it, fixup the docs on the API side of things and mark this PR as ready for review.

@pupnewfster
Copy link
Collaborator Author

Okay, I think this is basically ready for review. Only thing we may want to adjust is tightness of values and stuff for vanilla armor. I added some tightness to leather and a tiny bit to chainmail but I can remove those if you wish or change how they are done.

One other thing I noticed but didn't change as I am not sure it is a bug or not, is in GenderLayer if preBreastSize != bSize the adjusted sizes for the breasts and armor has armor starting at texV 17 instead of what it is initialized to at 19. Not sure if one of those two numbers is incorrect but figured I would point it out.

@pupnewfster pupnewfster marked this pull request as ready for review March 17, 2022 21:45
@WildfireRomeo
Copy link
Owner

I don't see any problems with this PR in terms of the API stuff, do you think I should merge it or wait for any other changes (if you had anything planned)?

Oh, and I looked into the breast sizes for armor, this is the correct format.
lBoobArmor = new BreastModelBox(64, 32, 16, 17, -4F, 0.0F, 0F, 4, 5, 3, 0.0F, false);
rBoobArmor = new BreastModelBox(64, 32, 20, 17, 0, 0.0F, 0F, 4, 5, 3, 0.0F, false);
17 was correct, 19 wasn't. Though, I can fix this after the PR merge myself if need be.

@pupnewfster
Copy link
Collaborator Author

Should it be 17 for the initial setting as well (and then remove the secondary updating of it)?

And you can go ahead and merge this unless you want me to make the change you mentioned to 17 myself. I do have one more set of changes planned in relation to config data validation, but that is a bit out of scope of this PR so I likely will open one for that tomorrow.

@WildfireRomeo
Copy link
Owner

WildfireRomeo commented Mar 17, 2022

The initial setting of it is already 17 for me, but yeah I noticed that recalculating that on armor resize isn't necessary, only the resizing of the actual breasts need to be recalculated. I'll merge and fix it in my own commit.

EDIT: I lied, I forget I changed the initial setting to test it. facepalms

@WildfireRomeo WildfireRomeo merged commit c7ccd58 into WildfireRomeo:forge-1.18.2 Mar 17, 2022
@pupnewfster pupnewfster deleted the feat_api branch March 17, 2022 23:16
WildfireRomeo added a commit that referenced this pull request Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants