Skip to content

Commit f57a4a5

Browse files
committed
Move foresight to parry
1 parent 93ae84b commit f57a4a5

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
use super::*;
2+
3+
#[skyline::hook(replace = FighterUtil::get_just_shield_se)]
4+
unsafe extern "C" fn get_just_shield_se(fighter_kind: i32) -> u64 {
5+
match fighter_kind {
6+
0x3c => hash40("se_ryu_guard_just"),
7+
0x3d => hash40("se_ken_guard_just"),
8+
0x5b => hash40("se_elight_escapeforesight01"),
9+
_ => hash40("se_common_justshield")
10+
}
11+
}
12+
13+
pub fn install() {
14+
skyline::install_hooks!(
15+
get_just_shield_se
16+
);
17+
}

fighters/common/src/function_hooks/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pub mod shotos;
2626
pub mod aura;
2727
pub mod sound;
2828
mod fighterspecializer;
29+
mod fighter_util;
2930

3031
#[repr(C)]
3132
pub struct TempModule {
@@ -761,6 +762,7 @@ pub fn install() {
761762
aura::install();
762763
sound::install();
763764
fighterspecializer::install();
765+
fighter_util::install();
764766

765767
unsafe {
766768
// Handles getting rid of the kill zoom

fighters/elight/src/acmd/other.rs

+41
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,45 @@ unsafe fn escape_air_slide_game(fighter: &mut L2CAgentBase) {
167167
}
168168
}
169169

170+
#[acmd_script( agent = "elight", script = "effect_justshieldoff", category = ACMD_EFFECT , low_priority)]
171+
unsafe fn just_shield_off_effect(fighter: &mut L2CAgentBase) {
172+
let lua_state = fighter.lua_state_agent;
173+
let boma = fighter.boma();
174+
if is_excute(fighter) {
175+
ColorBlendModule::set_disable_camera_depth_influence(boma, true);
176+
COL_PRI(fighter, 250);
177+
FLASH(fighter, 0, 0.1, 0.6, 0.8);
178+
fighter.clear_lua_stack();
179+
lua_args!(fighter, -1, 0, 0);
180+
sv_animcmd::FLASH_SET_DIRECTION(fighter.lua_state_agent);
181+
EFFECT(fighter, Hash40::new("elight_foresight2"), Hash40::new("top"), 0, 7.5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, true);
182+
EFFECT(fighter, Hash40::new("elight_foresight_lensflare"), Hash40::new("top"), 0, 7.5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, false);
183+
EFFECT_FOLLOW(fighter, Hash40::new("elight_foresight_body"), Hash40::new("hip"), 2, 0, 0, 0, 0, 90, 1, true);
184+
}
185+
wait(lua_state, 3.0);
186+
if is_excute(fighter) {
187+
FLASH_FRM(fighter, 6, 0, 0.1, 0.6, 0);
188+
}
189+
wait(lua_state, 6.0);
190+
if is_excute(fighter) {
191+
COL_NORMAL(fighter);
192+
ColorBlendModule::set_disable_camera_depth_influence(boma, false);
193+
}
194+
}
195+
196+
#[acmd_script( agent = "elight", script = "sound_justshieldoff", category = ACMD_SOUND , low_priority)]
197+
unsafe fn just_shield_off_sound(fighter: &mut L2CAgentBase) {
198+
let lua_state = fighter.lua_state_agent;
199+
let boma = fighter.boma();
200+
if is_excute(fighter) {
201+
let rand = sv_math::rand(hash40("fighter"), 10);
202+
if rand < 3 {
203+
PLAY_SEQUENCE(fighter, Hash40::new("seq_elight_rnd_foresight"));
204+
}
205+
PLAY_SE(fighter, Hash40::new("se_elight_escapeforesight01"));
206+
}
207+
}
208+
170209
pub fn install() {
171210
install_acmd_scripts!(
172211
dash_sound,
@@ -177,6 +216,8 @@ pub fn install() {
177216
damageflytop_sound,
178217
escape_air_game,
179218
escape_air_slide_game,
219+
just_shield_off_effect,
220+
just_shield_off_sound
180221
);
181222
}
182223

0 commit comments

Comments
 (0)