Skip to content

Modify Ammo on impact #1687

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

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

Conversation

FS-21
Copy link
Contributor

@FS-21 FS-21 commented May 29, 2025

  • Warheads can now modify ammo of the affected objects.

In rulesmd.ini:

[SOMEWARHEAD]   ; Warhead
AmmoModifier=0  ; integer

Copy link

github-actions bot commented May 29, 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.

Copy link
Contributor

@Starkku Starkku left a comment

Choose a reason for hiding this comment

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

Looks okay except for couple of small things.

@NetsuNegi
Copy link
Contributor

Ammo may be a concise and clear tag

@FS-21
Copy link
Contributor Author

FS-21 commented May 30, 2025

Ammo may be a concise and clear tag

What do you mean, reuse the tag name for the warhead tag? I don't remember if Ammo was used by someone else before in WH

@mevitar
Copy link

mevitar commented May 30, 2025

So does this mean that TransferTypes, and other attempts to make warheads modify ammo, were truly abandoned?
Not because i'm agaisnt this, just want to make sure that someone won't revive those older attempts and redo what this does.

@Metadorius
Copy link
Member

TransferTypes have been lost in dev limbo even though they're much better than random one-off non-systematic modifiers.

@Coronia Coronia added ❓New feature ⚙️T1 T1 maintainer review is sufficient Needs discussion labels Jun 2, 2025
@Starkku Starkku force-pushed the develop branch 2 times, most recently from b429215 to 280b1c8 Compare June 29, 2025 19:13
@@ -211,6 +212,9 @@ void WarheadTypeExt::ExtData::DetonateOnOneUnit(HouseClass* pHouse, TechnoClass*
if (this->Crit_CurrentChance > 0.0 && (!this->Crit_SuppressWhenIntercepted || !bulletWasIntercepted))
this->ApplyCrit(pHouse, pTarget, pOwner);

if (this->AmmoModifier != 0)
ApplyAmmoModifier(pTarget, pHouse, pBulletExt);
Copy link
Contributor

Choose a reason for hiding this comment

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

this->ApplyAmmoModifier(...);

@@ -650,3 +654,12 @@ double WarheadTypeExt::ExtData::GetCritChance(TechnoClass* pFirer) const

return critChance + extraChance;
}

void WarheadTypeExt::ExtData::ApplyAmmoModifier(TechnoClass* pTarget, HouseClass* pInvokerHouse, BulletExt::ExtData* pBulletExt)
Copy link
Contributor

Choose a reason for hiding this comment

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

BulletExt::ExtData* pBulletExt doesn't seem to have been used.

@@ -192,7 +193,7 @@ void WarheadTypeExt::ExtData::Detonate(TechnoClass* pOwner, HouseClass* pHouse,
}
}

void WarheadTypeExt::ExtData::DetonateOnOneUnit(HouseClass* pHouse, TechnoClass* pTarget, TechnoClass* pOwner, bool bulletWasIntercepted)
void WarheadTypeExt::ExtData::DetonateOnOneUnit(HouseClass* pHouse, TechnoClass* pTarget, TechnoClass* pOwner, bool bulletWasIntercepted, BulletExt::ExtData* pBulletExt)
Copy link
Contributor

Choose a reason for hiding this comment

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

So it's the same here.

@@ -12,6 +12,7 @@
#include <Ext/Anim/Body.h>
#include <Ext/Bullet/Body.h>
#include <Ext/BulletType/Body.h>
#include <Ext/WeaponType/Body.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

It also doesn't seem to be used.

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

Successfully merging this pull request may close these issues.

7 participants