Skip to content

Conversation

TaranDahl
Copy link
Contributor

Attack technos underground

  • Now, you can enable projectiles to attack technos underground.

In rulesmd.ini:

[SOMEPROJECTILE]      ; Projectile
AU=false              ; boolean

Damage technos underground

  • Now you can make the warhead damage technos underground!
    • To allow weapons to target underground technos, you need AU.
  • Notice that if the projectile detonates underground, its animation effect may look strange.
    • You can use [SOMEWARHEAD] -> PlayAnimUnderground=false to prevent the warhead animation from playing when the projectile detonates underground.
    • You can also use [SOMEWARHEAD] -> PlayAnimAboveSurface=true to make the warhead animation play on the ground directly above when the projectile detonates underground.

In rulesmd.ini:

[SOMEWARHEAD]                         ; WarheadType
AffectsUnderground=false              ; boolean
PlayAnimUnderground=true              ; boolean
PlayAnimAboveSurface=false            ; boolean,

@TaranDahl TaranDahl added ❓New feature ⚙️T1 T1 maintainer review is sufficient labels Sep 15, 2025
Copy link

github-actions bot commented Sep 15, 2025

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.

@Coronia
Copy link
Contributor

Coronia commented Sep 18, 2025

According to our test, only Inviso projectiles can effectively penetrate ground and hit underground units. Others will all explode when impact the ground, while still able to damage underground units if CellSpread is large enough.

This is a hardcoded thing so it's fine to keep it as it is, but it should be noted in the doc.

@Coronia Coronia requested a review from CrimRecya September 18, 2025 03:09
@Coronia Coronia added the Tested label Sep 18, 2025
Copy link
Contributor

@CrimRecya CrimRecya left a comment

Choose a reason for hiding this comment

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

LGTM

```

```{note}
Only vanilla projectiles with `Inviso=yes` set or [Phobos projectiles](#projectile-trajectories) with `SubjectToGround=yes` enabled can go beneath the ground. Otherwise, the projectile will be forced to detonate upon hitting the ground.
Copy link
Contributor

Choose a reason for hiding this comment

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

Besides Inviso, maybe only Straight with Trajectory.Straight.SubjectToGround=false and Bombard with Trajectory.Bombard.SubjectToGround=false can hit.

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 thought you were planning to add SubjectToGround for other types of trajectories?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not very accurate. Even after the update, SubjectToGround still only affects the selection of attacking area. Just in Straight and Bombard, because their judgment criteria are simple, allowing them to penetrate the ground will not cause any problems.

Comment on lines 992 to 997
if (TechnoExt::ExtMap.Find(pItem)->UndergroundTracked)
ScenarioExt::Global()->UndergroundTracker.Remove(pItem);

if (TechnoExt::ExtMap.Find(pItem)->SpecialTracked)
ScenarioExt::Global()->SpecialTracker.Remove(pItem);

Copy link
Contributor

Choose a reason for hiding this comment

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

You can place these in TechnoExt::ExtData::~ExtData()

	if (this->UndergroundTracked)
		ScenarioExt::Global()->UndergroundTracker.Remove(pThis);

	if (this->SpecialTracked)
		ScenarioExt::Global()->SpecialTracker.Remove(pThis);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓New feature ⚙️T1 T1 maintainer review is sufficient Tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants