Only One Status Affliction At A Time

Broken_squirrel

Veteran
Veteran
Joined
Nov 14, 2016
Messages
36
Reaction score
1
First Language
English
Primarily Uses
Hello everyone,


What is the best way to implement a system where status afflictions like poison can only affect one character at a time? For example, when a new status affliction is applied it overrides the old one and it simply disappears.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Your question is a bit confusing - the thread title and the example seem to indicate you only want a character to be able to have one status affliction at a time.  But your first sentence seems to indicate you only want a status affect to be applied to a single character at a time.  Can you clarify which one you mean?
 

Squirrelzone

Expert at being lazy
Veteran
Joined
Aug 13, 2016
Messages
51
Reaction score
2
First Language
English
Primarily Uses
I can only guess that what you have to do is make everything that afflicts a status "cure all status" first, so there is no status, and then they get poisoned.
 
Last edited by a moderator:

Squirrelzone

Expert at being lazy
Veteran
Joined
Aug 13, 2016
Messages
51
Reaction score
2
First Language
English
Primarily Uses
Your question is a bit confusing - the thread title and the example seem to indicate you only want a character to be able to have one status affliction at a time.  But your first sentence seems to indicate you only want a status affect to be applied to a single character at a time.  Can you clarify which one you mean?
what he means is that a character can only have one status affect. Read the second sentence and ignore the first one.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
The first sentence is a clear contradiction.  How do you know the first one is to be ignored, and not the second?
 

Euphony

Veteran
Veteran
Joined
Mar 13, 2012
Messages
552
Reaction score
1,223
First Language
English
Primarily Uses
RMVXA
If you want a state to only affect a single character just go to the skill that inflicts said state, and make sure Scope is set to One Enemy.


If you want a character to only have one state at a time go through each of your states and add a Trait that says, if this state is applied, it cures all other states. Say your states are Poison, Blind, and Paralysis - you would add a Trait to your Poison state that has a 100% chance of curing Blind and Paralysis.



Either way, pretty simple solution~
 
Last edited by a moderator:

Broken_squirrel

Veteran
Veteran
Joined
Nov 14, 2016
Messages
36
Reaction score
1
First Language
English
Primarily Uses
Perhaps an example will help clarify things. I'm sorry if my explanation was confusing. 


Example: A battle starts and there is a bat against the player's party. The first character in the player's party casts a spell to apply poison to the bat. The bat is now poisoned and the effect lasts 4 turns. The next character in the player's party casts a spell that applies paralysis.  It paralyzes the bat but the poison effect is removed since only one character can have one status affliction at a given time. 
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
If a skill has a status effect, will it ALWAYS be applied?  Is there a chance the skill itself might hit but the state not be applied?


If it's guaranteed that a state will be applied, you could just put this in the damage formula of any skill that applies one of these states:


b.clearStates(); .....


where ... is the actual damage formula.  


That will just remove any states the target already has.  However, it would remove ALL states, so you'd want to be sure that's what you're after.  If there are any "good" states you want them to keep, you'd have to take a different approach.
 

Broken_squirrel

Veteran
Veteran
Joined
Nov 14, 2016
Messages
36
Reaction score
1
First Language
English
Primarily Uses
Clearing all states would probably not work in my case. The current project I'm working on uses states that grant the user new skills. (The "good" states you mentioned.)


Also, this project has guaranteed status effect application skills and skills that apply status effects by chance. 
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
So you need to have a way to differentiate between the 'good' states and the 'bad' ones - the ones you want to be removed, and the ones you want to keep.


If you put <keep> in the note tags of all the good ones, something like this might work:


b.states().forEach(function(state) { if (!$dataStates[state].meta.keep) { b.removeState(state); }; ); ...


with the actual damage formula at the end.


I haven't tested this.  If it gives you an error, please post what is in the console.
 

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,864
Messages
1,017,056
Members
137,573
Latest member
nikisknight
Top