• 0 Posts
  • 37 Comments
Joined 11 months ago
cake
Cake day: December 2nd, 2023

help-circle













  • It’s hard to give advice about how code should be structured, since there’s many ways of accomplishing the same things, but you’re doing the right thing by thinking about scalability before you get too deep to change it.

    You could try separating eacg trigger condition into their own functions, so that if an OnAttack gets triggered it will only check and loop through OnAttack abilities.

    Something like:

    OnAttack.connect( CheckOnAttack )
    OnDamaged.connect( CheckOnDamaged )
    
    func CheckOnAttack( ATTACK_TYPE ):
              match ATTACK_TYPE:
                      ....
    
    func CheckOnDamaged( DAMAGE_TYPE ):
             match DAMAGE_TYPE:
                      ....