Skip to content

Commit 44fa7c1

Browse files
committed
fighters can now enter throw states from grab idle
1 parent f541351 commit 44fa7c1

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

canon_collision/src/entity/fighters/player.rs

+17-2
Original file line numberDiff line numberDiff line change
@@ -1232,8 +1232,23 @@ impl Player {
12321232

12331233
fn grabbing_idle_action(&mut self, context: &mut StepContext, state: &ActionState) -> Option<ActionResult> {
12341234
self.apply_friction(context.entity_def, state);
1235-
1236-
if state.frame_no_restart > 60 { // TODO: additionally check if grabbed player is still in a grabbed state
1235+
if (context.input[0].stick_x <= -0.66 && context.input[1].stick_x > -0.66)
1236+
|| (context.input[0].c_stick_x <= -0.66 && context.input[1].c_stick_x > -0.66) {
1237+
ActionResult::set_action(PlayerAction::Fthrow)
1238+
}
1239+
else if (context.input[0].stick_x >= 0.66 && context.input[1].stick_x < 0.66)
1240+
|| (context.input[0].c_stick_x >= 0.66 && context.input[1].c_stick_x < 0.66) {
1241+
ActionResult::set_action(PlayerAction::Fthrow)
1242+
}
1243+
else if (context.input[0].stick_y >= 0.66 && context.input[1].stick_y < 0.66)
1244+
|| (context.input[0].c_stick_y >= 0.66 && context.input[1].c_stick_y < 0.66) {
1245+
ActionResult::set_action(PlayerAction::Uthrow)
1246+
}
1247+
else if (context.input[0].stick_y <= -0.66 && context.input[1].stick_y > -0.66)
1248+
|| (context.input[0].c_stick_y <= -0.66 && context.input[1].c_stick_y > -0.66) {
1249+
ActionResult::set_action(PlayerAction::Dthrow)
1250+
}
1251+
else if state.frame_no_restart > 60 { // TODO: additionally check if grabbed player is still in a grabbed state
12371252
ActionResult::set_action(PlayerAction::GrabbingEnd)
12381253
} else {
12391254
None

0 commit comments

Comments
 (0)