I'm trying to figure out a way to make certain weapons cause certain effects. For instance, let's say I have a character equipped with a weapon that has the Attack Elements of Physical and Darkness. I attack an enemy that is of the Darkness element, such as a Ghost or a Demon. Your intended damage from the attack heals the enemy by the same amount instead of decreasing it. How do I go about setting this up?
If I have more questions relating to other effects I want weapons to have, can I post them here?
I actually have a series of lunatic codes for Yanfly's damage core that will do exactly what you want to do.
Unfortunately, I'm at work, and can't access them right now, so I can't copy and paste the information until later tonight. If you are super hungry to get into it though, my most recent posted game is unencrypted and you can take a look at the code in the skills.json. If you're interested, it's in the in progress projects section ("RMRandomizer" is the place holder name).
How I managed it was by setting up states on applicable enemies to reflect what attributes they had (Immunities, vulnerabilities, half damage etc) then the damage code checks the enemy for those states, and then runs the modified damage code. Some is handled with pre-evals to check if the damage should be healing instead.
The advantage of this method is there is literally no limit to the number of interactions you can have, so your multi-elemental weapon type can strike and amplify multiple vulnerabilities.
Caethyril: With regards to Element Core, I found that it didn't always work and never could nail down why. Not everyone will have my experience with it, and I encourage people to try different approaches, it may work just fine for the task at hand.
NickPat: As for how to learn Javascript: The forums have some great resources. The next step is writing out exactly what you want your formula to do, and then to look at how to implement it.
Once you know what you want to do, as yourself: Is this fun, and is it worth the time to figure it out? If the answer is yes, then ask: what is the easiest, simplest way to do this?
The script call database is your best friend, particularly if you want to get into slightly obscure conditional checks. I still have to look up every single thing I do in javascript, and reference Stackexchange/Github and other code libraries for examples and solutions all the time.
Ultimately do not be afraid of plugins. Use them liberally to save yourself time and energy. I've found with the damage end of things that Yanfly's Damage Core, Buff and States Core, Skills Core, and a smattering of others are always super useful.
Don't let the good (a plugin that does 90% of what you want) be the enemy of the great (your dream ideal that is 100% what you want).
Home finally: Here's the pre-eval code:
<Pre-Damage Eval> //fireabsorb
if(b.isStateAffected(72)){ //this is the fire absorb state that I assign to enemies/things that grant fire absorb
value =-value; //flips the damage value, so it now heals instead of damages.
}
</Pre-Damage Eval>