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 optional "vest only" variants of armor #202

Open
caligari87 opened this issue Jun 8, 2023 · 1 comment
Open

Add optional "vest only" variants of armor #202

caligari87 opened this issue Jun 8, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@caligari87
Copy link
Member

Feature Notes

  • Identical to Green and Blue armor in terms of penetration protection.
  • Would only cover torso hits.
  • 70% less bulky overall, both variants packable
  • Optionally can spawn in place of stock armor, in backpacks only, or neither.

Possible roadblocks

  • Finding / replicating old vest-only position calcs (looks like around June 2019)
  • Making sure armor correctly handles stacking logic

If this works maybe separate leg and helmet armor items as well

@caligari87 caligari87 added the enhancement New feature or request label Jun 8, 2023
@caligari87 caligari87 self-assigned this Jun 8, 2023
@caligari87
Copy link
Member Author

Looks like this block is what controls the calculated "armor level" alv based on the impact position and some randomness.

//which is just a vest not a bubble...
if(
	inflictor
	&&inflictor.default.bmissile
){
	double impactheight=inflictor.pos.z+inflictor.height*0.5;
	double shoulderheight=victim.pos.z+victim.height-16;
	double waistheight=victim.pos.z+victim.height*0.4;
	double impactangle=absangle(victim.angle,victim.angleto(inflictor));
	if(impactangle>90)impactangle=180-impactangle;
	bool shouldhitflesh=(
		impactheight>shoulderheight
		||impactheight<waistheight
		||impactangle>80
	)?!random(0,5):!random(0,31);
	if(shouldhitflesh)alv=0;
	else if(impactangle>80)alv=random(1,alv);
}

Likely TODO: Make a PR to virtualize the calculation of the armor level. Once that's done, theoretically all I need to do is inherit from the desired armor and change the return of that function (changing names and refids)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant