Skip to content

Commit a5e54f0

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into mewtwo-tp-jump
2 parents 562c8a6 + 359add8 commit a5e54f0

File tree

123 files changed

+2985
-2261
lines changed

Some content is hidden

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

123 files changed

+2985
-2261
lines changed

dynamic/src/consts.rs

+46-19
Original file line numberDiff line numberDiff line change
@@ -180,38 +180,41 @@ pub mod vars {
180180

181181
pub const DISABLE_CSTICK_BUFFER_ROLL_OOS: i32 = 0x0064;
182182

183+
pub const IS_INIT: i32 = 0x0065;
184+
185+
pub const IS_FLOAT: i32 = 0x0066;
186+
183187
// ints
184188

185189
pub const LAST_ATTACK_RECEIVER_ENTRY_ID: i32 = 0x0000;
186190

187191
pub const COSTUME_SLOT_NUMBER: i32 = 0x0001; // Unironically why does this need to exist? We have WorkModule.
188192

189-
pub const FLOAT_TIMER: i32 = 0x0002;
190-
pub const FLOAT_DURATION: i32 = 0x0003;
191-
pub const FLOAT_STYLE: i32 = 0x0004;
193+
pub const FLOAT_DURATION: i32 = 0x0002;
194+
pub const FLOAT_STATUS_KIND: i32 = 0x0003;
192195

193-
pub const HITFALL_BUFFER: i32 = 0x0005;
196+
pub const HITFALL_BUFFER: i32 = 0x0004;
194197

195-
pub const JUMP_SQUAT_FRAME: i32 = 0x0006;
198+
pub const JUMP_SQUAT_FRAME: i32 = 0x0005;
196199

197-
pub const GIMMICK_TIMER: i32 = 0x0007;
200+
pub const GIMMICK_TIMER: i32 = 0x0006;
198201

199-
pub const AIR_ESCAPE_MAGNET_FRAME: i32 = 0x0008;
202+
pub const AIR_ESCAPE_MAGNET_FRAME: i32 = 0x0007;
200203

201-
pub const CSTICK_LIFE: i32 = 0x0009;
204+
pub const CSTICK_LIFE: i32 = 0x0008;
202205

203-
pub const AGT_USED_COUNTER: i32 = 0x000A;
206+
pub const AGT_USED_COUNTER: i32 = 0x0009;
204207

205-
pub const CLIFF_XLU_FRAME: i32 = 0x000B;
206-
pub const LAST_ATTACK_HITBOX_ID: i32 = 0x000C;
207-
pub const SHIELD_EFFECT_HANDLE: i32 = 0x000D;
208+
pub const CLIFF_XLU_FRAME: i32 = 0x000A;
209+
pub const LAST_ATTACK_HITBOX_ID: i32 = 0x000B;
210+
pub const SHIELD_EFFECT_HANDLE: i32 = 0x000C;
208211

209-
pub const FRAME_COUNTER: i32 = 0x000E;
212+
pub const FRAME_COUNTER: i32 = 0x000D;
210213

211-
pub const LEFT_STICK_FLICK_X: i32 = 0x000F;
212-
pub const LEFT_STICK_FLICK_Y: i32 = 0x0010;
214+
pub const LEFT_STICK_FLICK_X: i32 = 0x000E;
215+
pub const LEFT_STICK_FLICK_Y: i32 = 0x000F;
213216

214-
pub const LEDGE_ID: i32 = 0x0011;
217+
pub const LEDGE_ID: i32 = 0x0010;
215218

216219
// floats
217220

@@ -282,10 +285,16 @@ pub mod vars {
282285

283286
pub const CSTICK_IRAR: i32 = 0x1000;
284287

288+
pub const FLOAT_INHERIT_AERIAL: i32 = 0x1000;
289+
285290
// ints
286291

287292
pub const DOWN_STAND_FB_KIND: i32 = 0x1000;
288293

294+
pub const FLOAT_FRAME: i32 = 0x1000;
295+
pub const FLOAT_ENABLE_UNIQ: i32 = 0x1001;
296+
pub const FLOAT_MTRANS: i32 = 0x1002;
297+
289298
// floats
290299

291300
pub const INITIAL_KNOCKBACK_VEL_X: i32 = 0x1000;
@@ -954,9 +963,12 @@ pub mod vars {
954963
pub const ELWIND1_CANCEL: i32 = 0x1100;
955964
}
956965
pub mod instance {
957-
//flags
966+
// flags
958967
pub const THUNDER_CHARGE: i32 = 0x0100;
959968
pub const UP_SPECIAL_FREEFALL: i32 = 0x0101;
969+
970+
// ints
971+
pub const LEVIN_AERIAL_LENIENCY: i32 = 0x0100;
960972
}
961973
}
962974

@@ -992,6 +1004,10 @@ pub mod vars {
9921004
// flags
9931005
pub const TRAIL_EFFECT: i32 = 0x0100;
9941006
}
1007+
pub mod status {
1008+
// flags
1009+
pub const SIDE_B_REVERSE : i32 = 0x1150;
1010+
}
9951011
}
9961012

9971013
pub mod shotos {
@@ -1105,8 +1121,7 @@ pub mod vars {
11051121
pub const ATTACK_12_INTO_S3: i32 = 0x0100;
11061122
pub const COMBO_PLUS_GROUND: i32 = 0x0101;
11071123
pub const COMBO_PLUS_AIR: i32 = 0x0102;
1108-
pub const CYCLE_MAGIC: i32 = 0x0103; // used to properly cycle Sora's HUD to fire in training mode
1109-
pub const ATTACK_LW4_REBOUND: i32 = 0x0104;
1124+
pub const ATTACK_LW4_REBOUND: i32 = 0x0103;
11101125

11111126
// floats
11121127
pub const JUMP_CANCEL_MOMENTUM_HANDLER: i32 = 0x0100;
@@ -1476,6 +1491,10 @@ pub mod statuses {
14761491
pub const SPECIAL_HI_FINISH2: i32 = 0x1F1;
14771492
}
14781493

1494+
pub mod samusd {
1495+
pub const FLOAT: i32 = 0x1F6;
1496+
}
1497+
14791498
pub mod falco {
14801499
pub const SPECIAL_LW_LOOP: i32 = 0x1e8;
14811500
pub const SPECIAL_LW_END: i32 = 0x1e9;
@@ -1489,6 +1508,14 @@ pub mod statuses {
14891508
pub const SPECIAL_N_FLOAT: i32 = 0x1EC;
14901509
}
14911510

1511+
pub mod mewtwo {
1512+
pub const FLOAT: i32 = 0x1E9;
1513+
}
1514+
1515+
pub mod reflet {
1516+
pub const FLOAT: i32 = 0x1FD;
1517+
}
1518+
14921519
pub mod ryu {
14931520
pub const AIR_DASH: i32 = 0x202;
14941521
}

dynamic/src/ext.rs

+14-137
Original file line numberDiff line numberDiff line change
@@ -1519,142 +1519,19 @@ pub struct MappedInputs {
15191519
pub rstick_y: i8,
15201520
}
15211521

1522-
pub type StatusFunc = unsafe extern "C" fn(&mut L2CFighterCommon) -> L2CValue;
1523-
15241522
#[repr(C)]
1525-
pub struct StatusInfo {
1526-
pub pre: Option<StatusFunc>,
1527-
pub main: Option<StatusFunc>,
1528-
pub end: Option<StatusFunc>,
1529-
pub init: Option<StatusFunc>,
1530-
pub exec: Option<StatusFunc>,
1531-
pub exec_stop: Option<StatusFunc>,
1532-
pub exec_post: Option<StatusFunc>,
1533-
pub exit: Option<StatusFunc>,
1534-
pub map_correction: Option<StatusFunc>,
1535-
pub fix_camera: Option<StatusFunc>,
1536-
pub fix_pos_slow: Option<StatusFunc>,
1537-
pub check_damage: Option<StatusFunc>,
1538-
pub check_attack: Option<StatusFunc>,
1539-
pub on_change_lr: Option<StatusFunc>,
1540-
pub leave_stop: Option<StatusFunc>,
1541-
pub notify_event_gimmick: Option<StatusFunc>,
1542-
pub calc_param: Option<StatusFunc>,
1543-
}
1544-
1545-
impl StatusInfo {
1546-
pub fn new() -> StatusInfo {
1547-
StatusInfo {
1548-
pre: None,
1549-
main: None,
1550-
end: None,
1551-
init: None,
1552-
exec: None,
1553-
exec_stop: None,
1554-
exec_post: None,
1555-
exit: None,
1556-
map_correction: None,
1557-
fix_camera: None,
1558-
fix_pos_slow: None,
1559-
check_damage: None,
1560-
check_attack: None,
1561-
on_change_lr: None,
1562-
leave_stop: None,
1563-
notify_event_gimmick: None,
1564-
calc_param: None,
1565-
}
1566-
}
1567-
1568-
pub fn with_pre(mut self, pre: StatusFunc) -> Self {
1569-
self.pre = Some(pre);
1570-
self
1571-
}
1572-
1573-
pub fn with_main(mut self, main: StatusFunc) -> Self {
1574-
self.main = Some(main);
1575-
self
1576-
}
1577-
1578-
pub fn with_end(mut self, end: StatusFunc) -> Self {
1579-
self.end = Some(end);
1580-
self
1581-
}
1582-
1583-
pub fn with_init(mut self, init: StatusFunc) -> Self {
1584-
self.init = Some(init);
1585-
self
1586-
}
1587-
1588-
pub fn with_exec(mut self, exec: StatusFunc) -> Self {
1589-
self.exec = Some(exec);
1590-
self
1591-
}
1592-
1593-
pub fn with_exec_stop(mut self, exec_stop: StatusFunc) -> Self {
1594-
self.exec_stop = Some(exec_stop);
1595-
self
1596-
}
1597-
1598-
pub fn with_exec_post(mut self, exec_post: StatusFunc) -> Self {
1599-
self.exec_post = Some(exec_post);
1600-
self
1601-
}
1602-
1603-
pub fn with_exit(mut self, exit: StatusFunc) -> Self {
1604-
self.exit = Some(exit);
1605-
self
1606-
}
1607-
1608-
pub fn with_map_correction(mut self, map_correction: StatusFunc) -> Self {
1609-
self.map_correction = Some(map_correction);
1610-
self
1611-
}
1612-
1613-
pub fn with_fix_camera(mut self, fix_camera: StatusFunc) -> Self {
1614-
self.fix_camera = Some(fix_camera);
1615-
self
1616-
}
1617-
1618-
pub fn with_fix_pos_slow(mut self, fix_pos_slow: StatusFunc) -> Self {
1619-
self.fix_pos_slow = Some(fix_pos_slow);
1620-
self
1621-
}
1622-
1623-
pub fn with_check_damage(mut self, check_damage: StatusFunc) -> Self {
1624-
self.check_damage = Some(check_damage);
1625-
self
1626-
}
1627-
1628-
pub fn with_check_attack(mut self, check_attack: StatusFunc) -> Self {
1629-
self.check_attack = Some(check_attack);
1630-
self
1631-
}
1632-
1633-
pub fn with_on_change_lr(mut self, on_change_lr: StatusFunc) -> Self {
1634-
self.on_change_lr = Some(on_change_lr);
1635-
self
1636-
}
1637-
1638-
pub fn with_leave_stop(mut self, leave_stop: StatusFunc) -> Self {
1639-
self.leave_stop = Some(leave_stop);
1640-
self
1641-
}
1642-
1643-
pub fn with_notify_event_gimmick(mut self, notify_event_gimmick: StatusFunc) -> Self {
1644-
self.notify_event_gimmick = Some(notify_event_gimmick);
1645-
self
1646-
}
1647-
1648-
pub fn with_calc_param(mut self, calc_param: StatusFunc) -> Self {
1649-
self.calc_param = Some(calc_param);
1650-
self
1651-
}
1652-
}
1653-
1654-
pub fn is_hdr_available() -> bool {
1655-
let mut symbol = 0usize;
1656-
unsafe {
1657-
skyline::nn::ro::LookupSymbol(&mut symbol, "hdr_is_available\0".as_ptr());
1658-
}
1659-
symbol != 0
1523+
pub struct CollisionLog {
1524+
pub next: *mut CollisionLog,
1525+
pub end: *mut CollisionLog,
1526+
pub location: Vector3f,
1527+
pub padding_0: u32,
1528+
pub padding_1: u32,
1529+
pub opponent_battle_object_id: u32,
1530+
pub padding_2: [u8;7],
1531+
pub collision_kind: u8,
1532+
pub receiver_part_id: u8,
1533+
pub collider_part_id: u8,
1534+
pub receiver_id: u8,
1535+
pub collider_id: u8,
1536+
pub padding_3: [u8;10]
16601537
}

fighters/common/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ smashline = { git = "https://github.com/HDR-Development/smashline.git" }
1313
utils = { package = "dynamic", path = "../../dynamic" }
1414
ninput = { git = "https://github.com/blu-dev/ninput" }
1515
interpolation = "0.2.0" # for f32::lerp
16-
smash2 = { package = "smash", git = "https://github.com/blu-dev/smash-rs" }
16+
smash_rs = { package = "smash", git = "https://github.com/blu-dev/smash-rs" }
1717
rand = { git = "https://github.com/skyline-rs/rand" }

fighters/common/src/function_hooks/attack.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::arch::asm;
44
use utils::game_modes::CustomMode;
55

66
#[skyline::hook(offset = 0x3dc180)]
7-
unsafe fn attack_module_set_attack(module: u64, id: i32, group: i32, data: &mut smash2::app::AttackData) {
7+
unsafe fn attack_module_set_attack(module: u64, id: i32, group: i32, data: &mut smash_rs::app::AttackData) {
88
let boma = *(module as *mut *mut BattleObjectModuleAccessor).add(1);
99

1010
// if a hitbox does not intentionally trip 100% of time, remove random trip chance
@@ -21,31 +21,31 @@ unsafe fn attack_module_set_attack(module: u64, id: i32, group: i32, data: &mut
2121
data.r_eff = 50; // KBG
2222
data.r_add = 55; // BKB
2323
data.sub_shield = 0; // shield damage modifier
24-
data.lr_check = smash2::app::AttackLRCheck::Pos; // always allow reverse hit
24+
data.lr_check = smash_rs::app::AttackLRCheck::Pos; // always allow reverse hit
2525
}
2626
if (*boma).is_status(*FIGHTER_STATUS_KIND_SLIP_STAND_ATTACK) {
2727
data.power = 5.0;
2828
data.vector = 361;
2929
data.r_eff = 50;
3030
data.r_add = 55;
3131
data.sub_shield = 0;
32-
data.lr_check = smash2::app::AttackLRCheck::Pos;
32+
data.lr_check = smash_rs::app::AttackLRCheck::Pos;
3333
}
3434
if (*boma).is_status(*FIGHTER_STATUS_KIND_CLIFF_ATTACK) {
3535
data.power = 8.0;
3636
data.vector = 361;
3737
data.r_eff = 50;
3838
data.r_add = 45;
3939
data.sub_shield = 0;
40-
data.lr_check = smash2::app::AttackLRCheck::Pos;
40+
data.lr_check = smash_rs::app::AttackLRCheck::Pos;
4141
}
4242
if (*boma).is_status(*FIGHTER_STATUS_KIND_CATCH_ATTACK) {
4343
if !VarModule::is_flag((*boma).object(), vars::common::status::PUMMEL_OVERRIDE_GLOBAL_STATS) {
4444
data.stop_frame = 3.5; // hitlag mul
4545
}
4646
}
4747
}
48-
48+
4949
call_original!(module, id, group, data)
5050
}
5151

fighters/common/src/function_hooks/energy/control.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ unsafe fn control_update(energy: &mut FighterKineticEnergyControl, boma: &mut Ba
136136
0.0
137137
};
138138

139-
let mut change_y = energy.accel.y;
140-
141139
use EnergyControllerResetType::*;
142140

143141
let mut do_standard_accel = true;
@@ -213,7 +211,7 @@ unsafe fn control_update(energy: &mut FighterKineticEnergyControl, boma: &mut Ba
213211
// If stick is at neutral
214212
do_standard_accel = false;
215213
energy.accel.x = 0.0;
216-
energy.accel.y = change_y;
214+
energy.accel.y = 0.0;
217215
energy.speed_max.x = 0.0;
218216
0.0
219217
} else {
@@ -230,8 +228,8 @@ unsafe fn control_update(energy: &mut FighterKineticEnergyControl, boma: &mut Ba
230228
}
231229
},
232230
Free => {
233-
change_y = accel_add_y * stick.y.signum() + stick.y * energy.accel_mul_y;
234-
energy.speed_max.y = stick.y * energy.speed_max.y;
231+
energy.accel.y = accel_add_y * stick.y.signum() + stick.y * energy.accel_mul_y;
232+
energy.speed_max.y = stick.y.abs() * energy.speed_max.y;
235233
accel_add_x * stick.x.signum() + stick.x * energy.accel_mul_x
236234
},
237235
ItemLift => loop {

0 commit comments

Comments
 (0)