Attacking a battler with a state to inflict state

kartacha

Veteran
Veteran
Joined
Aug 16, 2013
Messages
81
Reaction score
6
First Language
Bulgarian
Primarily Uses
RMMZ
Posting this in a separate thread as I remember this was the prefered way back in the day (not sure if things are different now)

How can I make it so that when a party member attacks an enemy with a certain state (or vise versa) to have a chance to get a certain state or another effect themself.

My main concept is that I want to make a shield that can either damage the enemy, inflict some bad state or something like that. An example would be Shiver Armor in Diablo II.
 

Milennin

"With a bang and a boom!"
Veteran
Joined
Feb 7, 2013
Messages
2,511
Reaction score
1,642
First Language
English
Primarily Uses
RMMV
For a 100% chance, just add this in front of the damage formula:
Code:
if (b.isStateAffected(16)) b.addState(21);
Those numbers being the States as they're listed in the database, so check your project which ones they should be.

If it's a chance for different things to happen, I'd just inflict an invisible state with the skill, have the skill link to a common event that checks each enemy whether they have the state + skill state, and if so run the chances for stuff to happen.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
554
Reaction score
229
First Language
english
Primarily Uses
RMMV
formula can have % chances too using Math.randomInt(100)+1 < X as part of an "if" formula.
i prefer < (less then) so that X is the % chance you want instead of > (greater than) which would make X be the % chance to fail
 

kartacha

Veteran
Veteran
Joined
Aug 16, 2013
Messages
81
Reaction score
6
First Language
Bulgarian
Primarily Uses
RMMZ
For a 100% chance, just add this in front of the damage formula:
Code:
if (b.isStateAffected(16)) b.addState(21);
Those numbers being the States as they're listed in the database, so check your project which ones they should be.

If it's a chance for different things to happen, I'd just inflict an invisible state with the skill, have the skill link to a common event that checks each enemy whether they have the state + skill state, and if so run the chances for stuff to happen.
Do I need to add these in all attacking skills for all of the states that will be able to pass a state if a battler is under attack? :o
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top