Skip to content

Commit 76847c1

Browse files
committed
falco, fox, & donkey
1 parent df9ab88 commit 76847c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+974
-881
lines changed

Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,13 @@ default = [
240240
# "demon",
241241
# "diddy",
242242
# "dolly",
243-
# "donkey",
243+
"donkey",
244244
# "duckhunt",
245245
# "edge",
246246
# "eflame",
247247
# "elight",
248-
# "falco",
249-
# "fox",
248+
"falco",
249+
"fox",
250250
# "gamewatch",
251251
# "ganon",
252252
# "gaogaen",

dynamic/src/consts.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1436,8 +1436,8 @@ pub mod statuses {
14361436
}
14371437

14381438
pub mod falco {
1439-
pub const SPECIAL_LW_LOOP: i32 = 0;
1440-
pub const SPECIAL_LW_END: i32 = 1;
1439+
pub const SPECIAL_LW_LOOP: i32 = 0x1e8;
1440+
pub const SPECIAL_LW_END: i32 = 0x1e9;
14411441
}
14421442

14431443
pub mod gamewatch {

fighters/common/src/general_statuses/airdodge.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use globals::*;
66

77
pub fn install() {
88
skyline::nro::add_hook(nro_hook);
9-
Agent::new("common")
9+
Agent::new("fighter")
1010
.status(Pre, *FIGHTER_STATUS_KIND_ESCAPE_AIR, status_pre_EscapeAir)
1111
.status(Main, *FIGHTER_STATUS_KIND_ESCAPE_AIR, status_EscapeAir)
1212
.status(End, *FIGHTER_STATUS_KIND_ESCAPE_AIR, status_end_EscapeAir)

fighters/common/src/general_statuses/attack/attackdash.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn nro_hook(info: &skyline::nro::NroInfo) {
1414
}
1515
pub fn install() {
1616
skyline::nro::add_hook(nro_hook);
17-
Agent::new("common")
17+
Agent::new("fighter")
1818
.status(Main, *FIGHTER_STATUS_KIND_ATTACK_DASH, status_AttackDash)
1919
.install();
2020
}

fighters/common/src/general_statuses/attack/attackx4.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use globals::*;
55

66
pub fn install() {
77
skyline::nro::add_hook(nro_hook);
8-
Agent::new("common")
8+
Agent::new("fighter")
99
.status(End, *FIGHTER_STATUS_KIND_ATTACK_HI4_START, status_end_AttackHi4Start)
1010
.status(End, *FIGHTER_STATUS_KIND_ATTACK_LW4_START, status_end_AttackLw4Start)
1111
.install();

fighters/common/src/general_statuses/damageflyreflect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use globals::*;
55

66

77
pub fn install() {
8-
Agent::new("common")
8+
Agent::new("fighter")
99
.status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY, damage_fly_end)
1010
.status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY_REFLECT_D, damage_fly_reflect_d_end)
1111
.status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY_REFLECT_JUMP_BOARD, damage_fly_reflect_jump_board_end)

fighters/common/src/general_statuses/jump.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use globals::*;
66

77
pub fn install() {
88
skyline::nro::add_hook(nro_hook);
9-
Agent::new("common")
9+
Agent::new("fighter")
1010
.status(Main, *FIGHTER_STATUS_KIND_JUMP, status_Jump)
1111
.status(Pre, *FIGHTER_STATUS_KIND_JUMP, status_pre_Jump)
1212
.install();

fighters/common/src/general_statuses/jumpsquat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use globals::*;
55

66
pub fn install() {
77
skyline::nro::add_hook(nro_hook);
8-
Agent::new("common")
8+
Agent::new("fighter")
99
.status(Exec, *FIGHTER_STATUS_KIND_JUMP_SQUAT, status_exec_JumpSquat)
1010
.status(End, *FIGHTER_STATUS_KIND_JUMP_SQUAT, status_end_JumpSquat)
1111
.status(Main, *FIGHTER_STATUS_KIND_JUMP_SQUAT, status_JumpSquat)

fighters/common/src/general_statuses/run.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ fn nro_info(info: &skyline::nro::NroInfo) {
218218

219219
pub fn install() {
220220
skyline::nro::add_hook(nro_info);
221-
Agent::new("common")
221+
Agent::new("fighter")
222222
.status(Pre, *FIGHTER_STATUS_KIND_RUN, status_pre_run)
223223
.status(Main, *FIGHTER_STATUS_KIND_RUN, status_run)
224224
.status(Main, *FIGHTER_STATUS_KIND_RUN_BRAKE, status_runbrake)

fighters/common/src/general_statuses/turn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fn nro_hook(info: &skyline::nro::NroInfo) {
205205

206206
pub fn install() {
207207
skyline::nro::add_hook(nro_hook);
208-
Agent::new("common")
208+
Agent::new("fighter")
209209
.status(Main, *FIGHTER_STATUS_KIND_TURN, status_turn)
210210
.status(End, *FIGHTER_STATUS_KIND_TURN, status_end_turn)
211211
.install();

fighters/common/src/general_statuses/walk.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn nro_hook(info: &skyline::nro::NroInfo) {
139139
pub fn install() {
140140
skyline::nro::add_hook(nro_hook);
141141

142-
Agent::new("common")
142+
Agent::new("fighter")
143143
.status(Pre, *FIGHTER_STATUS_KIND_WALK, status_pre_walk)
144144
.status(Main, *FIGHTER_STATUS_KIND_WALK, status_walk)
145145
.install();

fighters/common/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub fn install() {
4040
function_hooks::install();
4141
opff::install();
4242

43-
Agent::new("common")
43+
Agent::new("fighter")
4444
.on_init(common_init)
4545
.install();
4646
}

fighters/common/src/misc.rs

+23-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ unsafe fn shield_pushback_analog(ctx: &skyline::hooks::InlineCtx) {
7979
}
8080

8181
pub fn install() {
82-
smashline::Agent::new("common")
82+
smashline::Agent::new("fighter")
8383
.on_start(fighter_reset)
8484
.install();
8585
// skyline::patching::Patch::in_text(0x6417f4).nop();
@@ -100,6 +100,7 @@ pub fn install() {
100100
//set_hit_team_hook,
101101
hero_rng_hook,
102102
psych_up_hit,
103+
donkey_link_event,
103104
);
104105
skyline::install_hooks!(
105106
krool_belly_damage_hook,
@@ -198,6 +199,27 @@ pub unsafe fn hero_rng_hook(fighter: *mut BattleObject) {
198199
hero_rng_hook_impl(fighter);
199200
}
200201

202+
#[skyline::hook(offset = 0x993ec0)]
203+
pub unsafe extern "C" fn donkey_link_event(vtable: u64, fighter: &mut Fighter, event: &mut smash2::app::LinkEvent) -> u64 {
204+
// param_3 + 0x10
205+
if event.link_event_kind.0 == hash40("capture") {
206+
// println!("hi");
207+
let capture_event : &mut smash2::app::LinkEventCapture = std::mem::transmute(event);
208+
let module_accessor = fighter.battle_object.module_accessor;
209+
if StatusModule::status_kind(module_accessor) == *FIGHTER_STATUS_KIND_SPECIAL_LW {
210+
// param_3[0x28]
211+
capture_event.result = true;
212+
// capture_event.constraint = false;
213+
// param_3 + 0x30
214+
capture_event.node = smash2::phx::Hash40::new("throw");
215+
StatusModule::change_status_request(module_accessor, *FIGHTER_STATUS_KIND_CATCH_PULL, false);
216+
return 0;
217+
}
218+
return 1;
219+
}
220+
original!()(vtable, fighter, event)
221+
}
222+
201223
#[skyline::hook(offset = 0x853df0)]
202224
pub unsafe fn psych_up_hit() {
203225
// do nothing

fighters/common/src/opff/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pub unsafe fn moveset_edits(fighter: &mut L2CFighterCommon, info: &FrameInfo) {
128128
pub fn install() {
129129
// Reserved for common OPFF to be placed on exec status
130130
// rather than main status (default behavior)
131-
Agent::new("common")
131+
Agent::new("fighter")
132132
.on_line(Main, decrease_knockdown_bounce_heights)
133133
.on_line(Main, left_stick_flick_counter)
134134
.install();

fighters/donkey/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ utils = { package = "dynamic", path = "../../dynamic" }
1010
skyline = "0.2.1"
1111
skyline_smash = { git = "https://github.com/blu-dev/skyline-smash", features = ["weak_l2cvalue"] }
1212
smash_script = { git = "https://github.com/blu-dev/smash-script", branch = "development" }
13-
smashline = { git = "https://github.com/blu-dev/smashline", branch = "development" }
13+
smashline = { git = "https://github.com/HDR-Development/smashline" }
1414
smash2 = { package = "smash", git = "https://github.com/blu-dev/smash-rs" }

fighters/donkey/src/acmd/aerials.rs

+35-33
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
use super::*;
33

44

5-
#[acmd_script( agent = "donkey", script = "game_attackairn" , category = ACMD_GAME , low_priority)]
6-
unsafe fn attack_air_n(fighter: &mut L2CAgentBase) {
5+
6+
unsafe extern "C" fn attack_air_n(fighter: &mut L2CAgentBase) {
77
let lua_state = fighter.lua_state_agent;
88
let boma = fighter.boma();
99
frame(lua_state, 1.0);
@@ -35,8 +35,8 @@ unsafe fn attack_air_n(fighter: &mut L2CAgentBase) {
3535
}
3636

3737

38-
#[acmd_script( agent = "donkey", script = "expression_attackairn", category = ACMD_EXPRESSION, low_priority )]
39-
unsafe fn attack_air_n_expression(fighter: &mut L2CAgentBase) {
38+
39+
unsafe extern "C" fn attack_air_n_expression(fighter: &mut L2CAgentBase) {
4040
let lua_state = fighter.lua_state_agent;
4141
let boma = fighter.boma();
4242
frame(lua_state, 8.0);
@@ -54,8 +54,8 @@ unsafe fn attack_air_n_expression(fighter: &mut L2CAgentBase) {
5454
}
5555

5656

57-
#[acmd_script( agent = "donkey", script = "game_attackairf" , category = ACMD_GAME , low_priority)]
58-
unsafe fn attack_air_f(fighter: &mut L2CAgentBase) {
57+
58+
unsafe extern "C" fn attack_air_f(fighter: &mut L2CAgentBase) {
5959
let lua_state = fighter.lua_state_agent;
6060
let boma = fighter.boma();
6161
if is_excute(fighter) {
@@ -89,8 +89,8 @@ unsafe fn attack_air_f(fighter: &mut L2CAgentBase) {
8989

9090
}
9191

92-
#[acmd_script( agent = "donkey", script = "game_attackairb" , category = ACMD_GAME , low_priority)]
93-
unsafe fn attack_air_b(fighter: &mut L2CAgentBase) {
92+
93+
unsafe extern "C" fn attack_air_b(fighter: &mut L2CAgentBase) {
9494
let lua_state = fighter.lua_state_agent;
9595
let boma = fighter.boma();
9696

@@ -118,8 +118,8 @@ unsafe fn attack_air_b(fighter: &mut L2CAgentBase) {
118118

119119
}
120120

121-
#[acmd_script( agent = "donkey", script = "effect_attackairhi" , category = ACMD_EFFECT , low_priority)]
122-
unsafe fn donkey_attack_air_hi_effect(fighter: &mut L2CAgentBase) {
121+
122+
unsafe extern "C" fn donkey_attack_air_hi_effect(fighter: &mut L2CAgentBase) {
123123
let lua_state = fighter.lua_state_agent;
124124
let boma = fighter.boma();
125125
frame(lua_state, 5.0);
@@ -134,8 +134,8 @@ unsafe fn donkey_attack_air_hi_effect(fighter: &mut L2CAgentBase) {
134134
}
135135

136136

137-
#[acmd_script( agent = "donkey", script = "effect_attackairb" , category = ACMD_EFFECT , low_priority)]
138-
unsafe fn donkey_attack_air_b_effect(fighter: &mut L2CAgentBase) {
137+
138+
unsafe extern "C" fn donkey_attack_air_b_effect(fighter: &mut L2CAgentBase) {
139139
let lua_state = fighter.lua_state_agent;
140140
let boma = fighter.boma();
141141
frame(lua_state,6.0);
@@ -149,8 +149,8 @@ unsafe fn donkey_attack_air_b_effect(fighter: &mut L2CAgentBase) {
149149

150150
}
151151

152-
#[acmd_script( agent = "donkey", script = "game_attackairhi" , category = ACMD_GAME , low_priority)]
153-
unsafe fn attack_air_hi(fighter: &mut L2CAgentBase) {
152+
153+
unsafe extern "C" fn attack_air_hi(fighter: &mut L2CAgentBase) {
154154
let lua_state = fighter.lua_state_agent;
155155
let boma = fighter.boma();
156156
frame(lua_state, 1.0);
@@ -181,8 +181,8 @@ unsafe fn attack_air_hi(fighter: &mut L2CAgentBase) {
181181

182182
}
183183

184-
#[acmd_script( agent = "donkey", script = "expression_attackairhi", category = ACMD_EXPRESSION, low_priority )]
185-
unsafe fn attack_air_hi_expression(fighter: &mut L2CAgentBase) {
184+
185+
unsafe extern "C" fn attack_air_hi_expression(fighter: &mut L2CAgentBase) {
186186
let lua_state = fighter.lua_state_agent;
187187
let boma = fighter.boma();
188188
frame(lua_state, 4.0);
@@ -195,8 +195,8 @@ unsafe fn attack_air_hi_expression(fighter: &mut L2CAgentBase) {
195195
}
196196
}
197197

198-
#[acmd_script( agent = "donkey", script = "game_attackairlw" , category = ACMD_GAME , low_priority)]
199-
unsafe fn attack_air_lw(fighter: &mut L2CAgentBase) {
198+
199+
unsafe extern "C" fn attack_air_lw(fighter: &mut L2CAgentBase) {
200200
let lua_state = fighter.lua_state_agent;
201201
let boma = fighter.boma();
202202
frame(lua_state, 3.0);
@@ -227,8 +227,8 @@ unsafe fn attack_air_lw(fighter: &mut L2CAgentBase) {
227227

228228
}
229229

230-
#[acmd_script( agent = "donkey", script = "effect_attackairlw", category = ACMD_EFFECT, low_priority )]
231-
unsafe fn donkey_attack_air_lw_effect(fighter: &mut L2CAgentBase) {
230+
231+
unsafe extern "C" fn donkey_attack_air_lw_effect(fighter: &mut L2CAgentBase) {
232232
let lua_state = fighter.lua_state_agent;
233233
let boma = fighter.boma();
234234
frame(lua_state, 9.0);
@@ -245,18 +245,20 @@ unsafe fn donkey_attack_air_lw_effect(fighter: &mut L2CAgentBase) {
245245
}
246246
}
247247

248+
249+
250+
248251
pub fn install() {
249-
install_acmd_scripts!(
250-
attack_air_n,
251-
attack_air_n_expression,
252-
attack_air_f,
253-
attack_air_b,
254-
attack_air_hi,
255-
attack_air_hi_expression,
256-
attack_air_lw,
257-
donkey_attack_air_b_effect,
258-
donkey_attack_air_hi_effect,
259-
donkey_attack_air_lw_effect,
260-
);
252+
smashline::Agent::new("donkey")
253+
.acmd("game_attackairn", attack_air_n)
254+
.acmd("expression_attackairn", attack_air_n_expression)
255+
.acmd("game_attackairf", attack_air_f)
256+
.acmd("game_attackairb", attack_air_b)
257+
.acmd("effect_attackairhi", donkey_attack_air_hi_effect)
258+
.acmd("effect_attackairb", donkey_attack_air_b_effect)
259+
.acmd("game_attackairhi", attack_air_hi)
260+
.acmd("expression_attackairhi", attack_air_hi_expression)
261+
.acmd("game_attackairlw", attack_air_lw)
262+
.acmd("effect_attackairlw", donkey_attack_air_lw_effect)
263+
.install();
261264
}
262-

0 commit comments

Comments
 (0)