Mindustry icon indicating copy to clipboard operation
Mindustry copied to clipboard

Add `DamageSource` and `DamageEvent`

Open way-zer opened this issue 4 years ago • 10 comments

Add new interface DamageSource, Building/Unit/Bullet/StatusEffect extends it. And some special type. Make all damage function accept DamageSource. No BREAKCHANGE, all old functions using DamageSource.Unknown, and set deprecated

If your pull request is not translation or serverlist-related, read the list of requirements below and check each box:

  • [x] I have read the contribution guidelines.
  • [x] I have ensured that my code compiles, if applicable.
  • [x] I have ensured that any new features in this PR function correctly in-game, if applicable.

way-zer avatar Mar 02 '22 14:03 way-zer

I can't merge this in right now, as it conflicts with private branch changes.

Anuken avatar Mar 02 '22 15:03 Anuken

hissss image

MEEPofFaith avatar Mar 03 '22 05:03 MEEPofFaith

hissss image

idea auto import.... wait anuke finish his private branch.

way-zer avatar Mar 03 '22 05:03 way-zer

~~why are they in TitleCase and not camelCase~~ image

MEEPofFaith avatar Mar 03 '22 19:03 MEEPofFaith

~why are they in TitleCase and not camelCase~ image

~may because i'm used to kotlin object, which is singleton class, using TitleCase.~

way-zer avatar Mar 04 '22 04:03 way-zer

private branch conflict tag when, would probably make it easier to go and find all prs like these after v7 releases

mse-k avatar Mar 06 '22 19:03 mse-k

No, that wouldn't help at all.

Anuken avatar Mar 06 '22 19:03 Anuken

How about this pr? Would it be merged if i adapt it to v136?

way-zer avatar Jul 25 '22 08:07 way-zer

I'd rather not look at this right now, while internal changes are still occurring rather frequently.

Anuken avatar Jul 28 '22 15:07 Anuken

It will modify all function about damage, which will be a big change even no break-change(with deprecated). So It may be harder to change when release beta/stable.

way-zer avatar Jul 29 '22 07:07 way-zer

I've thought about this some more and I don't think it should be added at all. It's significantly more API breakage and maintenance burden for a feature most won't use.

Anuken avatar Oct 01 '22 21:10 Anuken