RMMV Weapon Bonus Damage for a Class?

DarkPlasmaBall

Veteran
Veteran
Joined
Apr 29, 2020
Messages
81
Reaction score
1
First Language
English
Primarily Uses
RMMV
Hi everyone,

I'm creating a game with multiple classes. Two of the classes - let's call them Soldier and Warrior - can use both swords and axes (as per the Equip Weapon traits), but I'd like the Soldier to do bonus damage (say, 120% damage) when holding a sword specifically, as opposed to an axe, while the Warrior gets bonus damage if he chooses to wield an axe instead of a sword. Is it possible to do this, where certain classes do more damage with their "ideal" weapon class, than if they chose a different weapon class? The idea is that the sword is stronger in the hands of a Soldier than a Warrior, and the axe is stronger in the hands of a Warrior than a Soldier. Thanks!
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,375
Reaction score
1,552
First Language
English
Primarily Uses
RMMV
Are you using any plugins or just out-of-the-box MV?
 

DarkPlasmaBall

Veteran
Veteran
Joined
Apr 29, 2020
Messages
81
Reaction score
1
First Language
English
Primarily Uses
RMMV
I'm using a bunch of plug-ins (especially Yanfly ones), so I'm certainly open to tinkering with more plug-ins if they can provide a solution for the class-weapon issue :)
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,375
Reaction score
1,552
First Language
English
Primarily Uses
RMMV
You can achieve this using Buffs & States Core and Autopassive States. For example, give the sword user a passive state called "sword bonus" or something, with the following notetag:

Code:
<custom confirm effect>
if (user.weapons().some(weapon => weapon.wtypeId === 3)) {
  value *= 1.2;
}
</custom confirm effect>
 
Last edited:

DarkPlasmaBall

Veteran
Veteran
Joined
Apr 29, 2020
Messages
81
Reaction score
1
First Language
English
Primarily Uses
RMMV
You can achieve this using Buffs & States Core and Autopassive States. For example, give the sword user a passive state called "sword bonus" or something, with the following notetag:

Code:
<custom confirm effect>
if (user.weapons().some(weapon => weapon.wtypeId === id of sword type)) {
  value *= 1.2;
}
</custom confirm effect>
Thank you, I have those plug-ins! I'm very new to the code, so please bare with me.

First, where would I paste that notetag - in the weapons that will be giving a boost to a certain class, or in the classes that will be receiving the specific boost?

Second, what parts of that script am I specifically editing with the relevant information (either class number or weapon number)?

If it makes it easier, let's suppose that I'd like both a Broadsword (Weapon ID#0001) and a Great Sword (Weapon ID#0002) to do 120% damage when equipped only by the 5th class in my list: Soldier (Class ID#0005). I see the 1.2 stands for 120%, but where exactly do I customize the notetag based on the above IDs? Would you mind editing your above generic script with the specific numbers in this example, so I can see what one case would look like?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,375
Reaction score
1,552
First Language
English
Primarily Uses
RMMV
You put the notetag in the "sword bonus" state. Then in the class notebox for Soldier, you put <passive state: id of whatever the sword bonus state is>

I can edit my code with the specific numbers if you can tell me what the ID of your "sword" weapon type is.
 

DarkPlasmaBall

Veteran
Veteran
Joined
Apr 29, 2020
Messages
81
Reaction score
1
First Language
English
Primarily Uses
RMMV
Ah gotcha, so it's not the ID of the specific sword, but rather the Weapon Type ID# in the "Type" tab wherever Sword is listed? Let's suppose that the Sword type is 3rd on that list, after daggers and bows, so that the Weapons column says "03 Sword".
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,375
Reaction score
1,552
First Language
English
Primarily Uses
RMMV
Okay, I've edited it with the ID. Basically any actor with that passive state applied will deal 120% damage with a sword-type weapon equipped. You can do the same for other weapon types by making a new passive state for the actor you want to give the bonus to and changing the weapon type ID.
 

DarkPlasmaBall

Veteran
Veteran
Joined
Apr 29, 2020
Messages
81
Reaction score
1
First Language
English
Primarily Uses
RMMV
Okay I think I understand it. I'll make a new state in the State tab (it'll be State #43, as I have plenty of other buffs and debuffs already there), I paste the notetag that already has the specific Sword Type ID# (3) that you already edited into the script, I name the state "Sword Boost" or whatever as a label that reminds me of what it does, and I can leave the rest of the General Settings and Traits blank for that new state?

And then in the Soldier class, I insert the new notetag of " <passive state: 43> ", which will only activate its 120% boost if the condition of "Holding a sword" is met, and not any other weapons, right?

And, in general, can this also be applied to Actors, or is it just for specific Classes?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,375
Reaction score
1,552
First Language
English
Primarily Uses
RMMV
You can apply it to specific actors or specific classes. And yeah, that's all you need setup-wise.

The check for any of the weapons being wtypeID 3 is what makes it "holding a sword". You have to have at least one sword for it to apply, no other weapon type will cause the effect.
 

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,406
Reaction score
4,805
First Language
English
Primarily Uses
RMVXA
Looks good, but I think you would need to make sure that it's a Physical Hit before applying the value *= 1.2; otherwise you'll also give the swordsman a 20% bonus to his healing and fire spells, for example. My apologies if I'm wrong about this and worrying you unnecessarily.
 

DarkPlasmaBall

Veteran
Veteran
Joined
Apr 29, 2020
Messages
81
Reaction score
1
First Language
English
Primarily Uses
RMMV
That's a good point... I'd obviously want *only the physical damage* to be boosted, not *everything the Soldier does while holding a sword (e.g., magic spells too)*. Any idea how the notetag could be further modified to work for only the physical hits?
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,115
Reaction score
517
First Language
English
Primarily Uses
RMMV
You can another condition in the if statement

this.isPhysical()

put && between the two
 

DarkPlasmaBall

Veteran
Veteran
Joined
Apr 29, 2020
Messages
81
Reaction score
1
First Language
English
Primarily Uses
RMMV
You can another condition in the if statement

this.isPhysical()

put && between the two
So like this?

<custom confirm effect>
if (user.weapons().some(weapon => weapon.wtypeId === 3) && this.isPhysical()) {
value *= 1.2;
}
</custom confirm effect>

1. Two & symbols?
2. Is the spacing right?
3. Also, this is referring to the "Hit Type" of the attack/skill, right? I have 3 different Hit Types: Certain Hit, Physical Attack, and Magic Attack. Or is this in reference to the Element of the attack/skill, or something else?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,375
Reaction score
1,552
First Language
English
Primarily Uses
RMMV
So like this?

<custom confirm effect>
if (user.weapons().some(weapon => weapon.wtypeId === 3) && this.isPhysical()) {
value *= 1.2;
}
</custom confirm effect>

1. Two & symbols?
2. Is the spacing right?
3. Also, this is referring to the "Hit Type" of the attack/skill, right? I have 3 different Hit Types: Certain Hit, Physical Attack, and Magic Attack. Or is this in reference to the Element of the attack/skill, or something else?
1. Yes. 2. Yep. 3. It refers to hit type, yeah. If you want to include the "Physical" element you'll need another tweak.
 

DarkPlasmaBall

Veteran
Veteran
Joined
Apr 29, 2020
Messages
81
Reaction score
1
First Language
English
Primarily Uses
RMMV
Great! I'm assuming if I change "this.isPhysical())" to "this.isMagical())", it'll work strictly for any of the Class's Skills with the Hit Type "Magical Attack", right? What would I change it to if I wanted it to work strictly for any "Certain Hit"? "this.isCertain())" ? "this.isCertainHit())" ?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,375
Reaction score
1,552
First Language
English
Primarily Uses
RMMV
Your assumption is correct.

Code:
this.isCertainHit()
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Stream will be live shortly with some Darkest Dungeon! Feel free to drop by!
I made a battle results screen for my minigame.. any feedback? :)
Things I thought would never happen but just did: I needed to use my snow shovel. In August. In the Northern Hemisphere.
So I finished Cupcake, now I need to figure out my next project!
Do I pick up one of my incomplete games?
Do I start something entirely new???
The possibilities are endless!
Am I the only one who keeps thinking TPBS means "Turn Press Battle System" and not "Time Progress Battle System?"

Forum statistics

Threads
100,678
Messages
978,348
Members
132,301
Latest member
Rumplestiller
Top