I'm working on a combat system with timed inputs for blocking. Due to various complications and whatnot, I'm now in a position where I apply 2 states when the timed input was hit correctly.
This makes it so that both my characters can block, but one character only blocks 25% of damage, while the other blocks all damage. Both states are applied in the action sequence code to the target of the enemy attack, but each actor is state resistant to the other actor's block state.
This has worked fine for single hit attacks. Today I wanted to make a 2 hit attack, and suddenly it's not working correctly anymore. The state is properly applied on the first block, but not on the second. Curiously if you don't block the first hit, the second block applies the state as intended and I don't know why it does that.
As you can see in the code above, the block condition is the same code for both instances of the hit. The sequence itself works (The block motion, animations and screen shake all play out as intended), but the damage gets applied on the second hit regardless and the state is not applied.
In the gif you can see on the scuffed hud how the state gets applied and removed as it should on the first block, and nothing on the second...
I hope someone has any smart ideas to solve this.
This makes it so that both my characters can block, but one character only blocks 25% of damage, while the other blocks all damage. Both states are applied in the action sequence code to the target of the enemy attack, but each actor is state resistant to the other actor's block state.
This has worked fine for single hit attacks. Today I wanted to make a 2 hit attack, and suddenly it's not working correctly anymore. The state is properly applied on the first block, but not on the second. Curiously if you don't block the first hit, the second block applies the state as intended and I don't know why it does that.
<Max Mastery Level: 0>
<custom target eval>
var targetActor = $gameParty.members().reduce(function(prevActor, currActor) {
return prevActor.tp > currActor.tp ? prevActor : currActor;
});
targets.push(targetActor);
</custom target eval>
<setup action>
camera focus: user, center, 0
zoom: 120%, 20
wait: 20
immortal: targets, true
</setup action>
<target action>
se: Jump2
PROJECTILE ANIMATION 78: START user, GOAL user, START OFFSET -0 +0, GOAL OFFSET -0 +0
move user: target, front, 40, offset x +60
jump user: 200%, 40
motion evade: user
wait: 10
CHANGE VARIABLE 100 = 0
start sequence input: ok, 100
wait: 10
animation 56: target
animation 13: target
wait: 25
end sequence input
motion swing: user
wait: 13
if $gameVariables.value(100) > 10
add state 28, 29: target
eval: target.battler().setFrame("missile", 1);
se: Block Hit
animation 29: target
action effect
shake screen: 5, 5, 8
eval: target.battler().setFrame("missile", 1);
wait: 10
remove state 28, 29: target
eval: target.battler().removeMaxFrame()
else
animation 160: target
action effect
immortal: targets, false
flash screen: 255, 0, 0, 80, 10
color break: intensity 40, duration 10
shake screen: 5, 5, 8
if (target.name() === 'Dunstan')
common event: 12
else
common event: 13
end
CHANGE VARIABLE 100 = 0
start sequence input: ok, 100
animation 56: target
animation 13: target
wait: 15
motion thrust: user
wait: 13
end sequence input
if $gameVariables.value(100) > 0
add state 28, 29: target
eval: target.battler().setFrame("missile", 1);
se: Block Hit
animation 29: target
action effect
shake screen: 5, 5, 8
eval: target.battler().setFrame("missile", 1);
wait: 10
remove state 28, 29: target
eval: target.battler().removeMaxFrame()
else
animation 160: target
action effect
immortal: targets, false
flash screen: 255, 0, 0, 80, 10
color break: intensity 40, duration 10
shake screen: 5, 5, 8
if (target.name() === 'Dunstan')
common event: 12
else
common event: 13
end
wait: 20
move user: return, 20
motion walk: user
face user: backward
wait: 20
face user: forward
</target action>
<finish action>
perform finish
wait for movement
wait for effect
wait for camera
</finish action>
<custom target eval>
var targetActor = $gameParty.members().reduce(function(prevActor, currActor) {
return prevActor.tp > currActor.tp ? prevActor : currActor;
});
targets.push(targetActor);
</custom target eval>
<setup action>
camera focus: user, center, 0
zoom: 120%, 20
wait: 20
immortal: targets, true
</setup action>
<target action>
se: Jump2
PROJECTILE ANIMATION 78: START user, GOAL user, START OFFSET -0 +0, GOAL OFFSET -0 +0
move user: target, front, 40, offset x +60
jump user: 200%, 40
motion evade: user
wait: 10
CHANGE VARIABLE 100 = 0
start sequence input: ok, 100
wait: 10
animation 56: target
animation 13: target
wait: 25
end sequence input
motion swing: user
wait: 13
if $gameVariables.value(100) > 10
add state 28, 29: target
eval: target.battler().setFrame("missile", 1);
se: Block Hit
animation 29: target
action effect
shake screen: 5, 5, 8
eval: target.battler().setFrame("missile", 1);
wait: 10
remove state 28, 29: target
eval: target.battler().removeMaxFrame()
else
animation 160: target
action effect
immortal: targets, false
flash screen: 255, 0, 0, 80, 10
color break: intensity 40, duration 10
shake screen: 5, 5, 8
if (target.name() === 'Dunstan')
common event: 12
else
common event: 13
end
CHANGE VARIABLE 100 = 0
start sequence input: ok, 100
animation 56: target
animation 13: target
wait: 15
motion thrust: user
wait: 13
end sequence input
if $gameVariables.value(100) > 0
add state 28, 29: target
eval: target.battler().setFrame("missile", 1);
se: Block Hit
animation 29: target
action effect
shake screen: 5, 5, 8
eval: target.battler().setFrame("missile", 1);
wait: 10
remove state 28, 29: target
eval: target.battler().removeMaxFrame()
else
animation 160: target
action effect
immortal: targets, false
flash screen: 255, 0, 0, 80, 10
color break: intensity 40, duration 10
shake screen: 5, 5, 8
if (target.name() === 'Dunstan')
common event: 12
else
common event: 13
end
wait: 20
move user: return, 20
motion walk: user
face user: backward
wait: 20
face user: forward
</target action>
<finish action>
perform finish
wait for movement
wait for effect
wait for camera
</finish action>
As you can see in the code above, the block condition is the same code for both instances of the hit. The sequence itself works (The block motion, animations and screen shake all play out as intended), but the damage gets applied on the second hit regardless and the state is not applied.
In the gif you can see on the scuffed hud how the state gets applied and removed as it should on the first block, and nothing on the second...
I hope someone has any smart ideas to solve this.