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

Projectile subject to ground check before firing #1291

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

CrimRecya
Copy link
Contributor

This is a feature split from #1261 .
It may have similarities with other parts.

If set SubjectToGround to true ,it will predict will predict the height of the connecting straight line from the bullet's source coordinates to target coordinates. If the predicted height is lower than the ground height of the current predicted position, the firer will also consider targets blocked by such obstacles as out of range and will attempt to reposition themselves.

In rulesmd.ini:

[SOMEPROJECTILE]              ; Projectile
SubjectToGround=false         ; boolean

Copy link

github-actions bot commented Jul 7, 2024

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.


const int extraHeight = pTechno->GetHeight();

if (extraHeight > 200)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

height for a cell is 208, which is used by vanilla as the condition of air and ground. This one should probably be changed as well

const int passengerIndex = -weaponIndex - 1;

for (int i = 0; i < passengerIndex && currentPassenger; i++)
currentPassenger = abstract_cast<FootClass*>(currentPassenger->NextObject);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

	for (int i = 0; i < passengerIndex && currentPassenger; i++)
	{
		currentPassenger = abstract_cast<FootClass*>(currentPassenger->NextObject);
	}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not necessary because it's only one line here and it's clear enough

@@ -683,6 +683,7 @@ Shrapnel.UseWeaponTargeting=false ; boolean

- It is now possible to make projectiles consider either land or water as obstacles that block their path by setting `SubjectToLand/Water` to true, respectively. Weapons firing such projectiles will consider targets blocked by such obstacles as out of range and will attempt to reposition themselves so they can fire without being blocked by the said obstacles before firing and if `SubjectToLand/Water.Detonate` is set to true, the projectiles will detonate if they somehow manage to collide with the said obstacles.
- `Level=true` projectiles detonate on tiles belonging to non-water tilesets by default, but will not consider such tiles as true obstacles. This behaviour can be overridden by setting these keys.
- As for `SubjectToGround`, if set it to true ,it will predict will predict the height of the connecting straight line from the bullet's source coordinates to target coordinates. If the predicted height is lower than the ground height of the current predicted position, the firer will also consider targets blocked by such obstacles as out of range and will attempt to reposition themselves.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate 'will predict`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get this.

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.

3 participants