tModLoader All Damage(Mod compatibility mod)

Gortart

Terrarian
All Damage acts as a bridge between mods that
1. Adds all damage/crit up.
2. Adds custom damage type.
e.g. All damage up potion from some small mod might not grant damage up for thorium's symphonic and radiant damage.

All Damage aims to fix this issue.

You can download this mod from mod browser.
This mod is now deprecated. Modders, please use Player.allDamage and Player.GetWeaponCrit(Item, ref int) instead.

How to use.
1. Normal players.
You don't have to do anything other than downloading and enabling this mod with other mods that support it. It has 0 impact to the game if no other mod supports it.
Please delete this mod. It doesn't do anything now.

2. Modders who wants to support other damage types in their own all damage/crit up item.
This mod uses Mod.Call() for communication.
Code:
ModLoader.GetMod("AllDamage").Call(new object[]{"Damage", player, amount }) // this will return debug string
This is a typical example of how to use this mod. Make sure it is loaded before calling it.
Code:
// something like this
if (AllDamageLoaded) {
    ModLoader.GetMod("AllDamage").Call(new object[]{"Damage", player, amount });
} else {
    player.meleeDamage += amount;
    player.rangedDamage += amount;
    player.magicDamage += amount;
    player.minionDamage += amount;
    player.thrownDamage += amount;
}
All Damage should take care of vanilla damages too.
Critical bonus is same, but just replace "Damage" with "Crit".
Now deprecated!

3. Modders who wants to support other mods' all damage/crit up item in their custom damage types.
Code:
float allDamageBonus = (float) ModLoader.GetMod("AllDamage").Call(new object[]{"DamageREQ", player})
This is a typical example of how to use this mod. This call will return float(int if it is critical bonus) if it ran succesfully, or it will return debug string.
This should be called as late as possible to ensure that other mods have time to add all damage.
Critical bonus is same, but just replace "DamageREQ" with "CritREQ".

Now deprecated!

Supported mods
All damage supports 4 mods out of the box. (only applies damage/crit ups yet)
Thorium tModLoader - The Thorium Mod
Enigma tModLoader - The Enigma Mod
Battle Rods tModLoader - Unusacies' Battle Rods Mod - Use special fishing rods as weapons!
Dragon Ball Terraria tModLoader - Dragon Ball Terraria
If you want your mod to be supported, either use Mod.Call() or contact me. Also let me know so I can put your mod here.
Now deprecated!


Mods that support this mod
Upgraded Accessories tModLoader - Upgraded Accessories
Potion Charms https://forums.terraria.org/index.php?threads/potion-charms.72154/
If you want support this mod let me know so I can put your mod here.
These mods now use Player.allDamage and Player.GetWeaponCirt(Item, ref int) instead!


Changelog
0.1
Initial release
0.1.1
Fixed incompatability with Dragon Ball Terraria.
0.2
Now deprecated.
 
Last edited:
I simply wanted to thank you for this. I will be using this for my own mod, Terraria Overload, in order to add greater compatibility with other mods. I will update you with a link for the mod post when there will be one, if you want.

Thanks a lot!
 
I simply wanted to thank you for this. I will be using this for my own mod, Terraria Overload, in order to add greater compatibility with other mods. I will update you with a link for the mod post when there will be one, if you want.

Thanks a lot!
Just a note as one of the devs of Dragon Ball Terraria, due to refactoring in our recent update a few of our fields have been renamed, so it's broken this mod. Thanks for supporting us out of the box as well :D
 
Just a note as one of the devs of Dragon Ball Terraria, due to refactoring in our recent update a few of our fields have been renamed, so it's broken this mod. Thanks for supporting us out of the box as well :D
Thanks for letting me know. It is now updated.
I simply wanted to thank you for this. I will be using this for my own mod, Terraria Overload, in order to add greater compatibility with other mods. I will update you with a link for the mod post when there will be one, if you want.

Thanks a lot!
I'm glad that this mod is getting attention. Good luck with your mod.
 
If I wanted to add an item to my mod that grants all damage and have it affect, say true damage in thorium and all similar custom damage types, what would be the best way to go about it? I'm kinda new to this.
 
If I wanted to add an item to my mod that grants all damage and have it affect, say true damage in thorium and all similar custom damage types, what would be the best way to go about it? I'm kinda new to this.
You have to get the instance of this mod and use Mod.Call().

Code:
// something like this
if (YourModName.AllDamageLoaded) { // if all damage is loaded. Check if all damage is loaded by calling Modloader.GetMod("AllDamage") and compare it to null in the Mod.Load().
    ModLoader.GetMod("AllDamage").Call(new object[]{"Damage", player, amount }); //"Damage" string shouldn't be changed. player is the player instance and amount is the amount of damage increase.
} else { // if all damage is not loaded, you would have to manually do this.
    player.meleeDamage += amount;
    player.rangedDamage += amount;
    player.magicDamage += amount;
    player.minionDamage += amount;
    player.thrownDamage += amount;
}

Let me know if you need more explanation.
And FYI, thorium's true damage has no way to boost.
 
Back
Top Bottom