Modular Stat Getter Example/Feature Request Thread Thing (Skill Ideas Work)

TL;DR Give me some (stupid or not) stat changing mechanic ideas, and I will implement them for you (using MSG). Skill ideas are valid. Feel free to simply ask questions too.


Part 1: Modular Stat Getters

FE8U ONLY. Still WIP (meaning main thread is not updated yet). No README yet. Currently aimed at somewhat experienced users (read: people who know their way around buildfiles and EA macros).

Links:

There used to be a doc. But It is outdated. Will update it when am not lazy.

What MSG allows you to do now: define Stat Getters (HP (Max & Current), Power, Skill, Speed, Def, Res, Luck, Mov & Con (thanks Teq), Aid) and computations during Battle Calculations (Attack, Defense, Hit, Avoid, Crit, Dodge and Lethality chance; through integration with some Battle Calc Loop).

What I want MSG to also do in the future: Modify Growth Rates (Apparenly Teq already has done quite a bit of work towards that again, so thanks again), maybe more.

MSG comes with integrated support for Circlesā€™ Skill System (but /!\ an older version of MSG comes with the Skill System, so please be careful until integration is completed both ways).

MSG also comes with a module similar to Vennoā€™s Passive Stat Boost hack (allows items to bring stat boosts even when not equipped).


Part 2: Example/Feature Request Thread Thing

Ok so hereā€™s the part where you come into play! Give me some stupid (or, even better, non stupid) ideas about mechanics that change one unitā€™s stats in some way, and from your idea will I come up with a way to implement it using only MSG macros.

If you just want to ask a question about this hack you can too, Iā€™d be happy to answer.


Example:

For each red unit (1) in 2-5 range of each allied unit in 1-2 range of a unit (2), increase (2)'s luck by (1)'s level.

EA Code
pLckModifiers:
    POIN /* whatever boring modifiers */ prAddLevelOfEachRedUnitInRange2To5OfEachAllyInRange1To2
WORD 0

prAddLevelOfEachRedUnitInRange2To5OfEachAllyInRange1To2:
    rForEachUnitInRange(0, 2) // range 0-2, 0 excluded
        rIfUnitsAreAllied
            rForEachUnitInRange(1, 5) // range 1-5, 1 excluded
                rIfUnitHasAllegience(UA_RED)
                    rAdd(rUByteAt(UNIT_LEVEL))

(Ok I know this is quite the complicated example, I just wanted to show off what MSG could do ok?)

Another Example:

Halve Strength & Defense when poisoned

EA Code
pStrModifiers:
    POIN /* whatevs */ prHalveIfPoisoned
WORD 0

pDefModifers:
    POIN /* whatevs */ prHalveIfPoisoned
WORD 0

prHalveIfPoisoned:
    rIfUnitHasStatus(0x01) // 0x01 is poison status
         rHalved

By opening this, I hope two things: for you to understand a bit more how to make dem silly stat modifiers (through the magic of examples), and for me to get ideas and opinions about what I could add in future releases of MSG.


Part 3: (Skill Ideas Work)

As stated before, this integrates well with circlesā€™ skill system. So Skill Ideas as Example Requests are valid.

(I am currently working on integrating new!MSG into Circlesā€™ Skill System. Which means that maybe probably new!MSG will get included in future releases of the Skill System given I donate enough (I mean old!MSG is already in so ĀÆ\_(惄)_/ĀÆ). Which means that to anyone interested into using it (the skill system), this (new!MSG) will probably become relevant)

1 Like

Funky tile shapes, such as an H shape, an X, an arbitrarily-large + shape, or like

Things like ā€œMag +2 per enemy in the areaā€, or ā€œAll units in the area gain a base N and an additional X per unit in the areaā€; ā€œAllies in the area gain Hit/Crit if affected by any status (positive or negative)ā€

Or, perhaps, a bit more interestingly / complicated / messy ā€œAll allies in the area gain stats as if they have an additional support level with all allies in the areaā€-- which would admittedly require checking the area twice, to make sure that the units are in the area and also that the two allies are within range of eachother for support bonuses.

Are those complex/stupid enough challenge sets
(because those are things I actually was planning on using at at least one point in project refinement)

Note that the results of shape-based range effects can be wierd if the given shape is not symmetrical by central symmetry. 2WBā€™s shape here is so itā€™s okay.

[area = The shape in the image]
ā€œMag +2 per enemy in the areaā€

I misunderstood that one at first, so I made a version where all enemies in the area would get +2 mag:

(Also thereā€™s an error: Origin of shape should be 2 2, not 3 3, fixed in the other pastes)

The one that actually fulfills what was asked (itā€™s simpler too):

[area = Same]
ā€œAll units in the area gain a base N and an additional X per unit in the areaā€

ā€œAllies in the area gain Hit/Crit if affected by any status (positive or negative)ā€

Iā€™m afraid I donā€™t understand that one.

ā€œAll allies in the area gain stats as if they have an additional support level with all allies in the areaā€

What I needed to add to MSG to make those work:

  • rForEachUnitInRangeTemplate to support wierder range shapes
  • rAddUnitsSupportBonuses to support support-like bonuses
  • Make rForEachUnit work ā€œrecursivelyā€ (not really actual recursion but ye) (Somehow the hardest one of the three)

I also got to fix some bugs and rearrange some things in the process.
The updated version is not up yet (will do later tonight).

(MSG will be officially updated once I manage to get it fully integrated with the Skill System again)

[quote=ā€œStanH, post:3, topic:2526ā€]
Iā€™m afraid I donā€™t understand that one.
[/quote]If affected by Poison / Stone / Dancer Ring.

#define rHalved "rRShiftConst(1)"
This isnā€™t quite accurate. Itā€™d not an arithmetic right shift for when the stat is negative. The *Proper* Way to Divide By Two
(At the very least, I am experiencing that negative stats function)

But Coloorz! An arithmetic right shift by 1 (which is what this is) is still a division by 2! The one difference with standard signed integer division is that instead of rounding towards 0 it rounds down.

(In all seriousness, itā€™s probably still not proper behaviour and youā€™re right in noting that)

(Maybe I should go back to update/rewrite this (and more importantly some doc) at some point)

edit:

here you go
// not tested (sorry)

prHalve: {
    rCallSequence(_prAddSign _prShift)

_prAddSign:
    rSub
        rRShiftConst(31) // either -1 (neg) or 0 (pos)

_prShift:
    rRShiftConst(1)
}

#undef rHalved
#define rHalved "rCallOther(prHalve)"

MSG Helpers sure are the embodiment of simplicity and straightforwardness

2 Likes