- Joined
- Feb 9, 2015
- Messages
- 30
- Reaction score
- 6
- First Language
- English
- Primarily Uses
- RMMV
In my game, I am utilizing Fallen Angel Olivia's Boost Point System with some effects from Yanfly's Skill Core.
Namely, if an attack hits an enemy's weakness or scores a critical hit, you gain a boost point. This has worked so far with normal skills using the following scripting for a basic fire skill:
Where FIRE is the 7th element in the database, and MAGIC is 2nd (using Multiple elements from YEP)
And this basic slash-type skill:
Where SLASH is the 3rd element in the DB.
So my issue is coming in where I am trying to set basic attacks to also trigger this effect by
1st: Getting the type of weapon the user has equipped
2nd Running the same if else, add BP code
The 1st part is supposed to be achieved by applying a state on the actor that has equipped a weapon type (i.e element 50= slashweapon, 51 = Crushweapon state etc.), which is working. After assessing the state, I subtract the equip state element stored in a variable called atkTyp by 47 to equal the element weakness (50-47=3, 3 = Slash Element etc.)
But anytime I use this script:
No BP is generated, even on scoring a critical hit.
Are the if else statements at the beginning interfering with the last statements?
Any ideas/ help?
Namely, if an attack hits an enemy's weakness or scores a critical hit, you gain a boost point. This has worked so far with normal skills using the following scripting for a basic fire skill:
Code:
<Post-Damage Eval>
if (target.elementRate(2) > 1) {
user.gainStoredBP(1);
} else if (target.elementRate(7) > 1) {
user.gainStoredBP(1);
}
</Post-Damage Eval>
And this basic slash-type skill:
Code:
<Post-Damage Eval>
if (target.result().critical) {
user.gainStoredBP(1);
} else if (target.elementRate(3) > 1) {
user.gainStoredBP(1);
}
</Post-Damage Eval>
Where SLASH is the 3rd element in the DB.
So my issue is coming in where I am trying to set basic attacks to also trigger this effect by
1st: Getting the type of weapon the user has equipped
2nd Running the same if else, add BP code
The 1st part is supposed to be achieved by applying a state on the actor that has equipped a weapon type (i.e element 50= slashweapon, 51 = Crushweapon state etc.), which is working. After assessing the state, I subtract the equip state element stored in a variable called atkTyp by 47 to equal the element weakness (50-47=3, 3 = Slash Element etc.)
But anytime I use this script:
Code:
<Post-Damage Eval>
if (user.isStateAffected(50) {
var atkTyp = 50;
var atkTyp = atkTyp - 47;
} else if (user.isStateAffected(51) {
var atkTyp = 51;
var atkTyp = atkTyp - 47;
} else if (user.isStateAffected(52) {
var atkTyp = 52;
var atkTyp = atkTyp - 47;
} else if (user.isStateAffected(53) {
var atkTyp = 53;
var atkTyp = atkTyp - 47;
}
if (target.result().critical) {
user.gainStoredBP(1);
} else if (target.elementRate(atkTyp) > 1) {
user.gainStoredBP(1);
}
</Post-Damage Eval>
No BP is generated, even on scoring a critical hit.
Are the if else statements at the beginning interfering with the last statements?
Any ideas/ help?