Skip to content

Commit 0b9f3ac

Browse files
committed
yay
back sideb
1 parent 41c78bc commit 0b9f3ac

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed

dynamic/src/consts.rs

+1
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,7 @@ pub mod vars {
942942
pub mod instance {
943943
// flags
944944
pub const TRAIL_EFFECT: i32 = 0x0100;
945+
pub const REVERSE_SIDEB: i32 = 0x0101;
945946
}
946947
}
947948

fighters/roy/src/acmd/specials.rs

+6
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,12 @@ unsafe fn roy_special_air_n_end3_game(fighter: &mut L2CAgentBase) {
330330
unsafe fn game_specials1(fighter: &mut L2CAgentBase) {
331331
let lua_state = fighter.lua_state_agent;
332332
let boma = fighter.boma();
333+
334+
frame(lua_state, 1.0);
335+
if is_excute(fighter) {
336+
VarModule::off_flag(fighter.battle_object, vars::roy::instance::REVERSE_SIDEB);
337+
}
338+
333339
frame(lua_state, 6.0);
334340
if is_excute(fighter) {
335341
ATTACK(fighter, 0, 0, Hash40::new("colonells"), 5.0, 60, 25, 0, 50, 2.34, 0.0, 0.0, 0.0, None, None, None, 0.9, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_F, false, 3, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_cutup"), *ATTACK_SOUND_LEVEL_M, *COLLISION_SOUND_ATTR_ROY_HIT, *ATTACK_REGION_SWORD);

fighters/roy/src/opff.rs

+26
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@ utils::import_noreturn!(common::opff::fighter_common_opff);
33
use super::*;
44
use globals::*;
55

6+
pub unsafe fn double_edge_dance_backwards(fighter: &mut L2CFighterCommon) {
7+
if StatusModule::status_kind(fighter.module_accessor) == *FIGHTER_ROY_STATUS_KIND_SPECIAL_S3 {
8+
if StatusModule::situation_kind(fighter.module_accessor) == *SITUATION_KIND_GROUND {
9+
if WorkModule::is_flag(fighter.module_accessor, *FIGHTER_MARTH_STATUS_SPECIAL_S_FLAG_MOTION_CHANGE_ENABLE) {
10+
let lrc = PostureModule::lr(fighter.module_accessor);
11+
let stick_x = ControlModule::get_stick_x(fighter.module_accessor);
12+
if lrc == 1.0 && stick_x < 0.0 && ControlModule::check_button_on(fighter.module_accessor, *CONTROL_PAD_BUTTON_SPECIAL){
13+
} else if lrc == -1.0 && stick_x > 0.0 && ControlModule::check_button_on(fighter.module_accessor, *CONTROL_PAD_BUTTON_SPECIAL) {
14+
VarModule::on_flag(fighter.battle_object, vars::roy::instance::REVERSE_SIDEB);
15+
}
16+
}
17+
}
18+
else if StatusModule::situation_kind(fighter.module_accessor) == *SITUATION_KIND_AIR {
19+
if WorkModule::is_flag(fighter.module_accessor, *FIGHTER_MARTH_STATUS_SPECIAL_S_FLAG_MOTION_CHANGE_ENABLE) {
20+
let lrc = PostureModule::lr(fighter.module_accessor);
21+
let stick_x = ControlModule::get_stick_x(fighter.module_accessor);
22+
if lrc == 1.0 && stick_x < 0.0 && ControlModule::check_button_on(fighter.module_accessor, *CONTROL_PAD_BUTTON_SPECIAL) {
23+
VarModule::on_flag(fighter.battle_object, vars::roy::instance::REVERSE_SIDEB);
24+
} else if lrc == -1.0 && stick_x > 0.0 && ControlModule::check_button_on(fighter.module_accessor, *CONTROL_PAD_BUTTON_SPECIAL) {
25+
VarModule::on_flag(fighter.battle_object, vars::roy::instance::REVERSE_SIDEB);
26+
}
27+
}
28+
}
29+
}
30+
}
631

732
pub unsafe fn double_edge_dance_vertical_momentum(boma: &mut BattleObjectModuleAccessor){
833
let fighter_gravity = KineticModule::get_energy(boma, *FIGHTER_KINETIC_ENERGY_ID_GRAVITY) as *mut FighterKineticEnergyGravity;
@@ -103,6 +128,7 @@ unsafe fn fastfall_specials(fighter: &mut L2CFighterCommon) {
103128

104129
pub unsafe fn moveset(fighter: &mut L2CFighterCommon, boma: &mut BattleObjectModuleAccessor, id: usize, cat: [i32 ; 4], status_kind: i32, situation_kind: i32, motion_kind: u64, stick_x: f32, stick_y: f32, facing: f32, frame: f32) {
105130
double_edge_dance_vertical_momentum(boma);
131+
double_edge_dance_backwards(fighter);
106132
double_edge_dance_during_hitlag(fighter);
107133
up_special_proper_landing(fighter);
108134
fastfall_specials(fighter);

fighters/roy/src/status.rs

+43
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use globals::*;
55
pub fn install() {
66
install_status_scripts!(
77
init_specials,
8+
special_s_back
89
);
910
}
1011

@@ -15,6 +16,40 @@ pub fn set_gravity_delay_resume_frame(energy: *mut FighterKineticEnergyGravity,
1516
}
1617
}
1718

19+
#[status_script(agent = "roy", status = FIGHTER_ROY_STATUS_KIND_SPECIAL_S4, condition = LUA_SCRIPT_STATUS_FUNC_STATUS_MAIN)]
20+
pub unsafe fn special_s_back(fighter: &mut L2CFighterCommon) -> L2CValue {
21+
if VarModule::is_flag(fighter.battle_object, vars::roy::instance::REVERSE_SIDEB) {
22+
let lrc = PostureModule::lr(fighter.module_accessor);
23+
let stick_x = ControlModule::get_stick_x(fighter.module_accessor);
24+
25+
if fighter.global_table[SITUATION_KIND] == SITUATION_KIND_GROUND {
26+
MotionModule::change_motion_inherit_frame(fighter.module_accessor, Hash40::new("special_s4_back"), 0.0, 1.0, 0.0, false, false);
27+
VarModule::off_flag(fighter.battle_object, vars::roy::instance::REVERSE_SIDEB);
28+
29+
if lrc == 1.0 && stick_x < 0.0 {
30+
PostureModule::set_lr(fighter.module_accessor, -1.0);
31+
} else if lrc == -1.0 && stick_x > 0.0 {
32+
PostureModule::set_lr(fighter.module_accessor, 1.0);
33+
}
34+
35+
return 0.into();
36+
} else {
37+
MotionModule::change_motion_inherit_frame(fighter.module_accessor, Hash40::new("special_air_s4_back"), 0.0, 1.0, 0.0, false, false);
38+
VarModule::off_flag(fighter.battle_object, vars::roy::instance::REVERSE_SIDEB);
39+
40+
if lrc == 1.0 && stick_x < 0.0 {
41+
PostureModule::set_lr(fighter.module_accessor, -1.0);
42+
} else if lrc == -1.0 && stick_x > 0.0 {
43+
PostureModule::set_lr(fighter.module_accessor, 1.0);
44+
}
45+
46+
return 0.into();
47+
}
48+
}
49+
50+
original!(fighter)
51+
}
52+
1853
#[status_script(agent = "roy", status = FIGHTER_STATUS_KIND_SPECIAL_S, condition = LUA_SCRIPT_STATUS_FUNC_INIT_STATUS)]
1954
pub unsafe fn init_specials(fighter: &mut L2CFighterCommon, arg: u64) -> L2CValue {
2055
let fighter_kind = WorkModule::get_int(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_INT_KIND);
@@ -76,6 +111,10 @@ pub unsafe fn init_specials(fighter: &mut L2CFighterCommon, arg: u64) -> L2CValu
76111
smash::app::lua_bind::KineticEnergy::enable(motion_energy);
77112
smash::app::lua_bind::KineticModule::unable_energy(fighter.module_accessor, *FIGHTER_KINETIC_ENERGY_ID_STOP);
78113
smash::app::lua_bind::KineticModule::unable_energy(fighter.module_accessor, *FIGHTER_KINETIC_ENERGY_ID_GRAVITY);
114+
115+
if VarModule::is_flag(fighter.battle_object, vars::roy::instance::REVERSE_SIDEB) {
116+
MotionModule::change_motion(fighter.module_accessor, Hash40::new("special_s4_back"), 0.0, 1.0, false, 0.0, false, false);
117+
}
79118
}
80119
else if current_situation_kind == *SITUATION_KIND_AIR {
81120
let reset_speed_2f = smash::phx::Vector2f { x: 0.0, y: 0.0 };
@@ -84,6 +123,10 @@ pub unsafe fn init_specials(fighter: &mut L2CFighterCommon, arg: u64) -> L2CValu
84123
smash::app::lua_bind::KineticEnergy::reset_energy(gravity_energy, *ENERGY_GRAVITY_RESET_TYPE_GRAVITY, &reset_speed_2f, &reset_speed_3f, fighter.module_accessor);
85124
smash::app::lua_bind::KineticEnergy::enable(stop_energy);
86125
smash::app::lua_bind::KineticEnergy::enable(gravity_energy);
126+
127+
if VarModule::is_flag(fighter.battle_object, vars::roy::instance::REVERSE_SIDEB) {
128+
MotionModule::change_motion(fighter.module_accessor, Hash40::new("special_air_s4_back"), 0.0, 1.0, false, 0.0, false, false);
129+
}
87130
}
88131
}
89132
KineticModule::unable_energy(fighter.module_accessor, *FIGHTER_KINETIC_ENERGY_ID_CONTROL);

0 commit comments

Comments
 (0)