MAYDAY

Here is the low down.

I have a sprite with 4 pattern attack animations. The attack for melee is different from the attack with a bow. I have my melee weapon attack set up so when I click the left mouse button, TouchInput.isTriggered(), It starts the 4 pattern animation and on the 4th pattern, the end of the swing,  it will check for contact. That works but I can't get the bow attack down. The 4 step animation is like this for bows:

1)  raise bow slightly

2)  bow is raised and drawn back

3)  arrow is released 

4)  lower bow

I am trying to get this attack to work so when TouchInput.isPressed(), pattern 1 and 2 play and then stops and when TouchInput.isReleased(), pattern 3 and 4 play. I can achieve the first half where it stops at pattern 2 with the bow drawn but I cant seem to get the last 2 steps to play on release.

This is how the melee attack is set up:

Game_Player.prototype.meleeAttackEnd = function() { if ($gamePlayer.pattern() === 4) { this.playerReset(); };};Game_Player.prototype.meleeAttackStart = function() { this.actionInProgress(true); $gamePlayer.setWalkAnime(false); playerBlockX = 12; playerMaxPattern = 5; $gamePlayer.resetPattern(); $gamePlayer.setStepAnime(true); this.meleeAttackEnd(); };
Code:
Game_Player.prototype.updateCombat = function() {                                                        // Unarmed    if (this.checkEquipmentSlot(0).wtypeId === null) {                                                // Melee One Hand    } else if (this.checkEquipmentSlot(0).wtypeId <= 30) {        if (this._actionInProgress === false) {            if (TouchInput.isTriggered()) {                this.meleeAttackStart();              };        } else {            this.meleeAttackEnd();        };                                                // Bow    } else if (this.checkEquipmentSlot(0).wtypeId >= 60) {

@#$% it.

Original thread: https://forums.rpgmakerweb.com/threads/mayday.53854/