[RMMV] THIS SHOULD BE REALLY SIMPLE....

Posts

Pages: 1
Yanfly plugin YEP_X_ChangeBattleEquip adds the option for a character to change their equipment in battle. Cool. It even lets you set a cooldown time on how long you have to wait before you change equipment again. Even better. But, changing your equipment doesn't use your turn. So, for instance, Tseng can switch from his SMG to his katana and then act immediately with his katana. I simply want switching weapons to use a turn.

Relevant plugins:
Yanfly Battle Engine Core
Yanfly Equip Core
Yanfly BattleSys ATB

I'm having trouble even executing a decent workaround for this because the Equip command is just that, it's a battle command, not a skill, which shuts down all of the ideas that immediately came to mind for a workaround (if it was tied to a skill, I could have that skill put an invisible 1-turn "stun" on the user).
Put this as a mini plugin after YEP_X_ChangeBattleEquip to make using the equip command add a state:

CCCBEUT_Scene_Battle_commandChangeBattleEquip = Scene_Battle.prototype.commandChangeBattleEquip
Scene_Battle.prototype.commandChangeBattleEquip = function() {
    CCCBEUT_Scene_Battle_commandChangeBattleEquip.call(this);
    var a = BattleManager.actor();
    if(a) {
        a.addState(12);
        if(!a.canInput()) {
            this.selectNextCommand();
        }
    }    
}


Make state 12 a "cannot move" restriction with auto remove at turn end, duration 1 turn. Or edit the script to use another state.

You could make the state do something else like give an ATK debuff or HIT% penalty instead of losing the turn.

Another way to do it would be to force an action choice - this example will force selection of the "wait" skill in the default database. With the default battle system, it doesn't work well because the player can use "X" to go back to the previous actor, but for ATB it might do the job.

CCCBEUT_Scene_Battle_commandChangeBattleEquip = Scene_Battle.prototype.commandChangeBattleEquip
Scene_Battle.prototype.commandChangeBattleEquip = function() {
    CCCBEUT_Scene_Battle_commandChangeBattleEquip.call(this);
    var a = BattleManager.actor();
    if(a) {
        BattleManager.inputtingAction().setSkill(7);
        this.selectNextCommand();
    }
}
Thank you! Someone on the other website made me a little scriptlet. But still thank you v much. <3

BECAUSE IT REALLY DOENS'T WARRANT ITS OWN THREAD:
How difficult would it be to adjust it so that an armor's Defense bonus is only applied against Critical Hits. Critical Resistance chance is very mysterious, but I think it's close to what I'm looking for but not quite there. In this project Critical Hit = Headshot so having helmets protect only against headshots would be pretty sweet. I have no idea if it'd be challenging or trivial to do.
Hmmm, I'd look at the "applyCritical" function for this.
Game_Action.prototype.applyCritical = function(damage) {
    return damage * 3;
};


The default critical hit damage is 3x damage. Simple enough.
So I'd have helmets change the multiplier to a smaller number.
e.g. if you're wearing a helmet, you suffer 1.5x damage instead of 3x.

Unfortunately, that function doesn't take the target as a parameter, which makes it a bit messy. Might be worth looking at YEP_DamageCore to reduce the amount of code you write.

Once you have a target, the target may be a Game_Actor (which has equipment) or a Game_Enemy (which does not). So you'd end up using a database note tag or something to indicate which enemies have helmets. (or ignore them and apply this bonus only to PCs)

For an actor, target.equips() will return a list of everything equipped. Go through each of those and check if it has the critical protection flag (probably a database note-tag applied to helmets but not to bandanas or hats)

Sorry for being vague, it's not that hard but will need a small script.
YEP_X_CriticalControl would also make it easier, as it gives a critical damage formula that includes the target.
Pages: 1