← Back to all addons

Species & Element & Ability Specific 🪄🔥

Posted by Mr.Titan on May 11, 2025 at 12:48 AM

GameplayExperimentalFeature3.0 Verified
water 6 fire 2 nature 2 ❄️ 1

Easy feature to add species (undead, human,..) and element (fire, water,…) to your game, and includes abilities that trigger only for specific elements, such as:

    • 10% chance critical agains fire enemies*
    • +10% damage agains undead *

*How to make this example in the Examples section bellow *

*In the video in attachment i have (100% chance 70damage to all water types) *

Setup

  • Import the files (CreatureTypeSheet.cs; ElementTypeSheet) into runtime->database->character->types)
  • (optional) export zip and import the sprites into sprites folder

Changes

AssetMenuIndexer.cs


        public const string Mythril2D_CreatureTypes = Mythril2D + "Characters/Types/Creature Type";
        public const string Mythril2D_ElementTypes = Mythril2D + "Characters/Types/Element Type";

AEffect.cs

        protected struct EffectData
        {
            public EEffectTargetFlags targetFlags; //add this
            public CreatureTypeSheet creatureType; //add this
          ....
        }

Replace the method IsTargetValidBasedOnFlags with:

`csharp
 private bool IsTargetValidBasedOnFlags(CharacterBase target)
 {
     return
         //flags
         (m_effectData.targetFlags.HasFlag(EEffectTargetFlags.Anything) ||
         m_effectData.targetFlags.HasFlag(EEffectTargetFlags.Self) && target == m_effectData.source ||
         m_effectData.targetFlags.HasFlag(EEffectTargetFlags.Allies) && CombatSolver.AreAllies(m_effectData.source, target) ||
         m_effectData.targetFlags.HasFlag(EEffectTargetFlags.Enemies) && CombatSolver.AreEnemies(m_effectData.source, target)) &&
         //creature type
         (m_effectData.creatureType == null || m_effectData.creatureType == target.characterSheet.creatureType) &&
         //Element type
         (m_effectData.elementType == null || m_effectData.elementType == target.characterSheet.elementType);
 }

** CONTINUE IN THE COMMENTS**

CharacterSheet.cs

Add the following properties:


        [SerializeField] private CreatureTypeSheet m_creatureType;
        [SerializeField] private ElementTypeSheet m_elementType;


        public CreatureTypeSheet creatureType => m_creatureType;
        public ElementTypeSheet elementType => m_elementType;

Make it happen

  • Create in database->characters->types two folder (creature types, element types)
  • Inside each create as many types as you want
  • open characters and set the types you want (creature, element, or both!)
    • Note: i’ve set the slime (animal) and water slide with (animal, water)
  • Open or create an ability, add an effect to it or change an already existing one and set creature and/or type ou want for the ability.

#Examples In these examples i use the Quick Shot which comes with Mythril already, i just add the effects to it.

*Basically you’l have 2 effects, the normal one (if it exists) and the one that sets these conditional abilities. So for example a sword will always do damage, but you want “extra” damage for specific conditions.

10% chance critical agains water enemies*

*Note: the failure rate it’s set to 0.9 (90%) because it’s not rate of success but failure, so you need to have that in consideration

+10 damage agains undead*

Note: put the “Critical behaviour to “Default i forgot that ^_^

💬 Comments (3)

Gyvr May 11, 2025 at 01:32 AM
Actually insane work! Love this m2d partyparrot 🔥
Dolph [Arithmyth] Dec 02, 2025 at 07:43 PM
@Mr.Titan can’t wait to try this out – looks like a perfect fit for what I’m going for. Does the effect the player triggers dictate the elemental type of damage being assigned to the enemy? Also, is it possible to set it so that each enemy only takes damage from a specific element? I’m working on a math-based game for my son and want him to have to solve a simple addition problem to learn which element the enemy is vulnerable to 🙂
Dolph [Arithmyth] Dec 09, 2025 at 02:08 PM
Just for the benefit of others, I found this didn’t work out of the box. There are some typos in the provided code which need to be corrected for the correct class name and such, and not all the files mentioned are provided. I did eventually get it to work, but it took some effort. In the end, if the elemental damage doesn’t match, then the projectile will go right through the enemy, which isn’t exactly what I was looking for. I ended up adding a simple elemental enumeration on the damage descriptor and base character, and if they don’t match then the damage solver considers it a miss. It was fairly simple and worked well for me. Just sharing it here for the benefit of others.
💡 1

Want to continue the conversation?