Skip to content

Commit a2cda5a

Browse files
authored
Merge pull request #2227 from HDR-Development/olimar-rework
Pikmin Rework
2 parents e99816a + 4945d55 commit a2cda5a

25 files changed

+1117
-525
lines changed

dynamic/src/consts.rs

+1
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,7 @@ pub mod vars {
891891

892892
pub mod pikmin {
893893
pub mod instance {
894+
// flags
894895
pub const SPECIAL_HI_CANCEL_ESCAPE_AIR: i32 = 0x0100;
895896
}
896897
}

fighters/pikmin/src/acmd/aerials.rs

+90-148
Large diffs are not rendered by default.

fighters/pikmin/src/acmd/ground.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
use super::*;
32

43

@@ -28,7 +27,6 @@ unsafe fn pikmin_attack_11_game(fighter: &mut L2CAgentBase) {
2827
}
2928
}
3029

31-
3230
#[acmd_script(agent = "pikmin", script = "game_attack12" , category = ACMD_GAME , low_priority)]
3331
unsafe fn pikmin_attack_12_game(fighter: &mut L2CAgentBase) {
3432
let lua_state = fighter.lua_state_agent;
@@ -45,7 +43,6 @@ unsafe fn pikmin_attack_12_game(fighter: &mut L2CAgentBase) {
4543
}
4644
}
4745

48-
4946
#[acmd_script( agent = "pikmin", script = "game_attackdash" , category = ACMD_GAME , low_priority)]
5047
unsafe fn pikmin_attack_dash_game(fighter: &mut L2CAgentBase) {
5148
let lua_state = fighter.lua_state_agent;
@@ -64,7 +61,6 @@ unsafe fn pikmin_attack_dash_game(fighter: &mut L2CAgentBase) {
6461
}
6562
}
6663

67-
6864
pub fn install() {
6965
install_acmd_scripts!(
7066
pikmin_attack_11_game,

fighters/pikmin/src/acmd/mod.rs

-69
Original file line numberDiff line numberDiff line change
@@ -9,75 +9,6 @@ mod specials;
99
mod throws;
1010
mod tilts;
1111

12-
#[repr(C)]
13-
pub struct PikminInfo {
14-
damage: f32,
15-
kbg: i32,
16-
bkb: i32,
17-
shield_damage: f32,
18-
hitlag: f32,
19-
attr: &'static str,
20-
sound: i32,
21-
delta_angle: u64
22-
}
23-
24-
impl From<i32> for PikminInfo {
25-
fn from(other: i32) -> Self {
26-
match other {
27-
0 => PikminInfo { // Red
28-
damage: 1.0,
29-
kbg: 8,
30-
bkb: 0,
31-
shield_damage: 0.1,
32-
delta_angle: 0,
33-
hitlag: 1.1,
34-
attr: "collision_attr_fire",
35-
sound: *COLLISION_SOUND_ATTR_FIRE
36-
},
37-
1 => PikminInfo { // yellow
38-
damage: 0.75,
39-
kbg: 0,
40-
bkb: 0,
41-
shield_damage: 0.0,
42-
delta_angle: 8,
43-
hitlag: 1.0,
44-
attr: "collision_attr_elec",
45-
sound: *COLLISION_SOUND_ATTR_ELEC
46-
},
47-
2 => PikminInfo { // Blue
48-
damage: 0.8,
49-
kbg: 0,
50-
bkb: 0,
51-
shield_damage: 0.0,
52-
delta_angle: 5,
53-
hitlag: 1.0,
54-
attr: "collision_attr_water",
55-
sound: *COLLISION_SOUND_ATTR_WATER
56-
},
57-
3 => PikminInfo { // White
58-
damage: 0.6,
59-
kbg: 0,
60-
bkb: 0,
61-
shield_damage: 0.75,
62-
delta_angle: 8,
63-
hitlag: 1.0,
64-
attr: "collision_attr_purple",
65-
sound: *COLLISION_SOUND_ATTR_FIRE
66-
},
67-
_ => PikminInfo { // Violet (Rock), also default
68-
damage: 0.8,
69-
kbg: 0,
70-
bkb: 0,
71-
shield_damage: 0.5,
72-
delta_angle: 0,
73-
hitlag: 1.2,
74-
attr: "collision_attr_normal",
75-
sound: *COLLISION_SOUND_ATTR_KICK
76-
},
77-
}
78-
}
79-
}
80-
8112
pub fn install() {
8213
aerials::install();
8314
tilts::install();

fighters/pikmin/src/acmd/smashes.rs

-108
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,8 @@
11

22
use super::*;
33

4-
macro_rules! smash_attacks_common {
5-
($fighter:ident) => {{
6-
let lua_state = $fighter.lua_state_agent;
7-
let boma = $fighter.boma();
8-
frame(lua_state, 1.0);
9-
HitModule::set_status_all(boma, app::HitStatus(*HIT_STATUS_XLU), 0);
10-
original!($fighter);
11-
HitModule::set_status_all(boma, app::HitStatus(*HIT_STATUS_NORMAL), 0);
12-
}}
13-
}
14-
15-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attackhi4" , category = ACMD_GAME , low_priority)]
16-
unsafe fn game_attackhi4(fighter: &mut L2CAgentBase) {
17-
smash_attacks_common!(fighter);
18-
}
19-
20-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attackhi4_b" , category = ACMD_GAME , low_priority)]
21-
unsafe fn game_attackhi4_b(fighter: &mut L2CAgentBase) {
22-
smash_attacks_common!(fighter);
23-
}
24-
25-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attackhi4_y" , category = ACMD_GAME , low_priority)]
26-
unsafe fn game_attackhi4_y(fighter: &mut L2CAgentBase) {
27-
smash_attacks_common!(fighter);
28-
}
29-
30-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attackhi4_w" , category = ACMD_GAME , low_priority)]
31-
unsafe fn game_attackhi4_w(fighter: &mut L2CAgentBase) {
32-
smash_attacks_common!(fighter);
33-
}
34-
35-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attackhi4_v" , category = ACMD_GAME , low_priority)]
36-
unsafe fn game_attackhi4_v(fighter: &mut L2CAgentBase) {
37-
smash_attacks_common!(fighter);
38-
}
39-
40-
41-
42-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attacks4" , category = ACMD_GAME , low_priority)]
43-
unsafe fn game_attacks4(fighter: &mut L2CAgentBase) {
44-
smash_attacks_common!(fighter);
45-
}
46-
47-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attacks4_b" , category = ACMD_GAME , low_priority)]
48-
unsafe fn game_attacks4_b(fighter: &mut L2CAgentBase) {
49-
smash_attacks_common!(fighter);
50-
}
51-
52-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attacks4_y" , category = ACMD_GAME , low_priority)]
53-
unsafe fn game_attacks4_y(fighter: &mut L2CAgentBase) {
54-
smash_attacks_common!(fighter);
55-
}
56-
57-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attacks4_w" , category = ACMD_GAME , low_priority)]
58-
unsafe fn game_attacks4_w(fighter: &mut L2CAgentBase) {
59-
smash_attacks_common!(fighter);
60-
}
61-
62-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attacks4_v" , category = ACMD_GAME , low_priority)]
63-
unsafe fn game_attacks4_v(fighter: &mut L2CAgentBase) {
64-
smash_attacks_common!(fighter);
65-
}
66-
67-
68-
69-
70-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attacklw4" , category = ACMD_GAME , low_priority)]
71-
unsafe fn game_attacklw4(fighter: &mut L2CAgentBase) {
72-
smash_attacks_common!(fighter);
73-
}
74-
75-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attacklw4_b" , category = ACMD_GAME , low_priority)]
76-
unsafe fn game_attacklw4_b(fighter: &mut L2CAgentBase) {
77-
smash_attacks_common!(fighter);
78-
}
79-
80-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attacklw4_y" , category = ACMD_GAME , low_priority)]
81-
unsafe fn game_attacklw4_y(fighter: &mut L2CAgentBase) {
82-
smash_attacks_common!(fighter);
83-
}
84-
85-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attacklw4_w" , category = ACMD_GAME , low_priority)]
86-
unsafe fn game_attacklw4_w(fighter: &mut L2CAgentBase) {
87-
smash_attacks_common!(fighter);
88-
}
89-
90-
#[acmd_script( agent = "pikmin_pikmin", script = "game_attacklw4_v" , category = ACMD_GAME , low_priority)]
91-
unsafe fn game_attacklw4_v(fighter: &mut L2CAgentBase) {
92-
smash_attacks_common!(fighter);
93-
}
94-
954
pub fn install() {
965
install_acmd_scripts!(
97-
game_attackhi4,
98-
game_attackhi4_b,
99-
game_attackhi4_y,
100-
game_attackhi4_w,
101-
game_attackhi4_v,
102-
103-
game_attacks4,
104-
game_attacks4_b,
105-
game_attacks4_y,
106-
game_attacks4_w,
107-
game_attacks4_v,
108-
109-
game_attacklw4,
110-
game_attacklw4_b,
111-
game_attacklw4_y,
112-
game_attacklw4_w,
113-
game_attacklw4_v,
1146
);
1157
}
1168

0 commit comments

Comments
 (0)