dninemfive / wn-mfw

WARNO mod framework.
MIT License
0 stars 0 forks source link

Automate application of unit traits #3

Open dninemfive opened 1 month ago

dninemfive commented 1 month ago

Currently, the unit trait icons in-game are controlled across multiple areas: the actual icons are specified by the Specialties member of the UI module, while the actual implementation is either in the Capacite module for certain traits, or in arbitrary other locations depending on the trait. For example, the ERA trait is just an extra 1 HP in the base damage module, while the False Flag trait removes the Dangerousness property.

This should be generally defined using something which defines an icon, name, description, and two callables, one which applies the trait and one which un-applies it. The latter might not be possible to define, for example in the case of False Flag, where the Dangerousness is not necessarily known once that module is removed.

This would make issues such as dninemfive/wn-9id#1 and dninemfive/wn-9id#21 much easier to implement.

dninemfive commented 1 month ago

The idea of callables on units could be generalized a bit further - for example, a one-call way to make a unit (not) a transport unit or (not) a command unit would be very useful.

dninemfive commented 4 days ago

Should try breaking this up into several sub-components rather than developing a holistic approach at first. Namely:

dninemfive commented 4 days ago

Traits implemented by capacites, according to my analysis:

dninemfive commented 3 days ago

TODO: some kind of check to prevent adding a trait multiple times or removing it multiple times?

edit: done with 52caeb2.