Do you know a code that can do my request ?

  • Yes i have

    Votes: 0 0.0%
  • No i don't

    Votes: 0 0.0%

  • Total voters
    0

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
8
First Language
Français
Primarily Uses
Hi Everyone !

I'm using Yanfly Plugins (Battle Core, Buff and Sate etc...)

I'm trying to do a state that win stacks and each stack will up the user's critical chance, up his attack but lower his hit rate.

My state is "Alcohol" i put Yanfly confusion's code from Pokemon for the user to have a chance to hit himself. But my state of alcohol will increase Critical rate, buff his Attack and lower his hit rate. So more he drinks more he have critical chances and stronger he is but less he can hit his target (because he's drunk as hell and he can't see nothing)

So, my code here is

<Custom Apply Effect>

target.addStateCounter(stateId, 1);

</Custom Apply Effect>



<Custom Action Start Effect>

// Calculate the confusion success rate

var confuseRate = 0.17;

// Check RNG if it passed

if (Math.random() < confuseRate) {

// Get the confusion skill for the user to perform

var confusionSkill = 5;

// Start the animation

user.startAnimation(63);

// Get the user's current action

var action = user.currentAction();

// Set it to the confusion skill

action.setSkill(confusionSkill);

}

</Custom Action Start Effect>


And i know that now what is missing is to add critical chance multiply by my number of stacks, a code for buffing his Attack for some turns AND my Hit Rate divided my number of stacks too.

Thanks in advance for your help and sorry for my english, if some sentences are weird it's only because i'm french.
 

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
8
First Language
Français
Primarily Uses
I tried also to do something like

<Custom Apply Effect>

user._drunk = user._drunk || 0;

// Increase the drunk stack by 1

user._drunk += 1;

user._drunk = Math.min(user._drunk, 6);

user.setStateCounter(stateId, user._drunk);

</Custom Apply Effect>



<Custom Action Start Effect>

// Calculate the confusion success rate

var confuseRate = 0.17;

// Check RNG if it passed

if (Math.random() < confuseRate) {

// Get the confusion skill for the user to perform

var confusionSkill = 5;

// Start the animation

user.startAnimation(63);

// Get the user's current action

var action = user.currentAction();

// Set it to the confusion skill

action.setSkill(confusionSkill);

}

</Custom Action Start Effect>

And now i need to set the critical rate multiply by the number of "user._drunk" stacks. Lower Hit rate by number of "user._drunk" stacks and add an Attack's buff for like 3/5 turns.

Im still trying many ways like user.cri= (15 / 100) * user._drunk but i don't get it ^^ and i can't really find the code for that, same with hit rate.
Then buff i think will be user.addBuff(2,5) ?

Thanks in advance
 

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
8
First Language
Français
Primarily Uses
So,

Im responding again for myself, for thoose who want to do the same i figure it out by myself (and proud of it)

SO, for making a drunking state that everytime you drink more, you buff Yourself, increase Critical but low your Hit Rate and have a chance to hit yourself this is the code i use (but you can take off the buff and add it by normal skill command)

<Custom Apply Effect>

user._drunk = user._drunk || 0;

// Increase the drunk stack by 1

user._drunk += 1;

user._drunk = Math.min(user._drunk, 3);

user.setStateCounter(stateId, user._drunk);

user.addBuff (2,5);

user.addBuff (2,5);

user.addCri(0.33 * user._drunk);

user.minusHit(0.15 * user._drunk);

</Custom Apply Effect>



<Custom Action Start Effect>

// Calculate the confusion success rate

var confuseRate = 0.17;

// Check RNG if it passed

if (Math.random() < confuseRate) {

// Get the confusion skill for the user to perform

var confusionSkill = 454;

// Start the animation

user.startAnimation(63);

// Get the user's current action

var action = user.currentAction();

// Set it to the confusion skill

action.setSkill(confusionSkill);

}

</Custom Action Start Effect>



<Custom Leave Effect>

// Set the user's stockpile stack to 0

user._drunk = 0;

// Update the state counter for the stockpile stack

user.setStateCounter(stateId, user._drunk);

</Custom Leave Effect>

Have a nice day and don't drink too much, just a few ;)
 

Latest Threads

Latest Posts

Latest Profile Posts

Hi everyone! Enjoying this nice long weekend. How are you all doing? :)
I just successfully tested having events check if specific actors are in a particular party slot and then changing image to match. This will let me make scenes take into account who is in the party at the time and arrange them accordingly - this is important since I'll have extra actors beyond current party. The script used is the same from MV and is compatible with my current core plugin setup in MZ. Thank goodness.
That awkward moment when you're talking about thinking about writing a limited shop stock plugin for MZ and then find out you already wrote one...last May. My memory is so bad.
When I open my project and I'm like, hell yeah.
Some drawings I made in Lapis, one day I intend to involve them in some RPG Maker project.
* maybe two wall frames
*or some sprite flower tiara, or maybe it inspires someone to do something.
bdd19b62e539d17b3b00cc3d63034f7d.jpg

fcca5c8471b34483da8e032cfe579275.jpg

Forum statistics

Threads
118,426
Messages
1,115,860
Members
155,378
Latest member
TrashWizard
Top