Hello,
I'm trying to create sort of a cursed armor. It increases the character's ATK, but every attack (normal attack or skill) has a chance to prevent the player from attacking again for 1 round. The original idea was to deactivate the player's ability to attack or use any skills, but still be able to use items. I suppose that's not possible, so the second option would be to have a state that makes the target unable to perform any action, like stun or sleep, which lasts for 1 round, and has a chance to be applied on skill use once the specific armor is equipped.
The problem here is that all the options to apply a state only work on the skill's target, not the skill's user. Is there any way to apply a state to the skill user, even though the user is not the target?
Attack on enemy applies state to attacker, possible?
● ARCHIVED · READ-ONLY
-
-
Possible, with or without plugin. But it is better with plugin.
Without plugin, you can use your damage formula like:
Code:Where x is your state ID you want to add to the attacker.a.atk * 4 - b.def * 2; a.addState(x) -
Possible, with or without plugin. But it is better with plugin.
Without plugin, you can use your damage formula like:
Code:Where x is your state ID you want to add to the attacker.a.atk * 4 - b.def * 2; a.addState(x)
Hm, I wasn't aware that you could do that in a damage formular. Guess I do need a plugin though, considering you can't add a damage formula to an armor. Can you recommend any? -
Sure. There are some useful plugins from Yanfly:
Buffs & States Core
State Categories
Auto Passive States
Using Buffs & States Core and Auto Passive States is the best way to make your armor, but it requires some knowledge of Javascripts. -
Sure. There are some useful plugins from Yanfly:
Buffs & States Core
State Categories
Auto Passive States
Using Buffs & States Core and Auto Passive States is the best way to make your armor, but it requires some knowledge of Javascripts.
Thanks a lot for recommending those plugins.
I managed to do it using Buffs & States Core and Auto Passive States. The armor now adds 2 passive states. State 1 acts on every turn end, determining a random number. State 2 activates if a specific number occurs and stuns the player for 1 turn. Kinda wish I could make a battle info appear when state 2 occurs, but I'm glad it works this way. -
@Raen Andaleio
Do you mean have a message pop up at the start of the actor's turn if they're afflicted with the state?
You can try the following in the state's notebox:
Code:<Custom Action Start Effect> if (state.message1) { var msg = '<CENTER>' + user.name() + state.message1; logWindow.addText(msg); } </Custom Action Start Effect>
And put the text you want in the line "If an actor is inflicted with the state." -
@boikish I just tried it, it doesn't seem to do anything.
I also tried different time tags and to put it in the first state that creates the random number:
Code:However, that didn't do anything either. The text would not show.<Custom Action End Effect> $gameVariables.setValue(3, Math.floor((Math.random()*10)+1)); if($gameVariables.value(3) == 5){ var msg = '<CENTER>' + user.name() + state.message1; logWindow.addText(msg); } </Custom Action End Effect> -
@Raen Andaleio
Okay, so you can accomplish this by doing the following.
In the passive skill that is added by equipping the armor, write the following:
Code:<Custom Action End Effect> var chanceCurse = Math.random(); { if (chanceCurse < 0.01) { user.addState(59); user.startAnimation(55); var logWindow = SceneManager._scene._logWindow; if (state.message4) { var msg = '<CENTER>' + user.name() + state.message4; logWindow.addText(msg); } BattleManager.actionWaitForAnimation(); logWindow.push('clear'); } } </Custom Action End Effect>
The bold items must be changed to match what you want. The chanceCurse is a percentage. So .5 = 50%, .8 = 80%, etc.
The addState is the curse state.
The startAnimation will show an animation if the curse happens.
In the "if the state is removed" messages box, write " has been cursed."
This means if the curse effect occurs, the message will display.
Then, in the Curse state, make it active for 2 Turns with the restriction "Cannot Move."
Sorry my code is a little sloppy, but it should work. Works fine on mine!