Template:ProjectileLifetimeDescription

From Noita Wiki
Jump to navigation Jump to search


This currently is designed only to describe lifetimes of added projectiles, not lifetime modifications from modifiers.

WIP. The current approach has an override for things like Magic Guard so that it could be mechanically applied across numeric infobox parameters for single-kind-of-projectile spells, but doesn't handle Intense Concentrated Light except maybe also via an override. Also, it may need a sanity check for when there are no projectile(-like thing)s, though the logic there may belong in the infobox since it determines whether there is the Lifetime line there at all.

BUG. Probably handles base -1 + alternative case wrong.

May want to handle LifetimeComponent randomness min & max. There may not be any vanilla projectile-like things with randomness, but there are modifiers. It seemed cleaner to have modifiers be rendered separately, but maybe there is some refactoring or reconsideration to do here.


Expect: override is missing or string. If missing or all (breaking) whitespace, then:

  • Expect: either base or alternative is non-missing
  • Expect: base is missing or numeric
  • Expect: randomness is missing or numeric
  • Expect: alternative is missing or numeric
  • Expect: alternativeReason is missing or a string such as "LifetimeComponent" or "MagicXRayComponent" (but is currently not rendered)

Examples

{{ProjectileLifetimeDescription|base=40}}

40


{{ProjectileLifetimeDescription|base=-1}}

infinite (-1)


{{ProjectileLifetimeDescription|base=40|randomness=7}}

[33..47]


{{ProjectileLifetimeDescription|base=40|randomness=7|alternative=100|alternativeReason=LifetimeComponent}}

[33..47] capped at 100


{{ProjectileLifetimeDescription|base=9999999|alternative=720|alternativeReason=LifetimeComponent}}

capped at 720 (from 9999999)


{{ProjectileLifetimeDescription|base=10|randomness=5|alternative=4|alternativeReason=LifetimeComponent}}

capped at 4 (from [5..15])


{{ProjectileLifetimeDescription|base=10|randomness=5|alternative=5|alternativeReason=LifetimeComponent}}

[5..15] capped at 5


{{ProjectileLifetimeDescription|alternative=50|alternativeReason=LifetimeComponent}}

fixed at 50


{{ProjectileLifetimeDescription|override=either 30 or 80}}

either 30 or 80