Add a debuff if another debuff is present

Status
Not open for further replies.

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I know how to check if a state is present, and if it is, to add another state e.g.

if b.state?(29); then; b.add_state(49); end;

and had thought that the same structure would apply for checking if a debuff is present, and if it is, then adding another one, lasting 6 turns. So I have
if b.debuff?(3); then; b.add_debuff(2, 6); end;

but that doesn't work. Does anyone know what the syntax should be?

Thank you.
 

Faherya

The Knight of the Sad Figure
Veteran
Joined
Jul 25, 2013
Messages
254
Reaction score
582
First Language
Portuguese
Primarily Uses
RMVXA
Would not a "debuff" be the same as a state? Or do you speak of the weakening of a certain attribute? At least that's how I always did it. For example, this command:


I create states with the same functions to allow me greater control. Soon its formula would be simpler: if b.state? (x); then; b.add_state (y); end; Depending on the debuff, you can also check if the character's attribute is less than normal (reduced defense, for example) and then apply the new debuff status. I'm sorry for not testing before commenting, I just formatted the notebook and I'm still downloading the program.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Yes you are right I could do that, and if no other option is available that is what I'll do. But I was hoping to save a lot of time, as I've already used debuffs in several places and didn't want to have to go back and find them all to change them. It's so easy to miss some.
 

Faherya

The Knight of the Sad Figure
Veteran
Joined
Jul 25, 2013
Messages
254
Reaction score
582
First Language
Portuguese
Primarily Uses
RMVXA
Apparently the problem is just in the condition, right? If you only use add_debuff (param_id, turns), does it work? If I'm not mistaken, the script that handles this data is the Game_Battler. I'm looking for how it recognizes debuffs already applied, but as I do not know how to program I need to go testing command by command to know what it is. As soon as I find I edit the comment here.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Yes, the condition seems to be the issue. I have no problem using the add-debuff on its own, and in fact use it quite extensively.

It might be better to do a new post - edits to existing posts don't show up as notifications, so I might miss your amendment.
 

Faherya

The Knight of the Sad Figure
Veteran
Joined
Jul 25, 2013
Messages
254
Reaction score
582
First Language
Portuguese
Primarily Uses
RMVXA
I got it. The debuff IDs start with zero, so your formula is correct, but you may be checking for the wrong ID. I used the following:

If b.debuff? (0); b.add_debuff (3, 6); end;

If the "Reduce HP Maximum" debuff is applied, include "Reduce Defense" on the target. See the test. The "Defender" command is applying the ID 0 debuff. The enemy skill uses the above formula and, fulfilling the conditions, applies the ID 3 debuff:


This is the default skill. The "Defending" status that it applies has not been changed.
 
Last edited:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
You are a star! I'd forgotten about the debuff IDs starting at zero.
Thank you so much for your time and trouble. I am very grateful.
 

Faherya

The Knight of the Sad Figure
Veteran
Joined
Jul 25, 2013
Messages
254
Reaction score
582
First Language
Portuguese
Primarily Uses
RMVXA
You are welcome. And, helping you, I learned a little about these commands in the damage calculations. :kaojoy:
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
So, a win-win then, which is nice.

[closed]IgnoreMe[/closed]
 
Status
Not open for further replies.

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,045
Members
137,569
Latest member
Shtelsky
Top