Skip to content

Commit b8c8829

Browse files
committed
Merge branch 'dev' into wuboy-misc-2
2 parents 00ee900 + 978feed commit b8c8829

File tree

15 files changed

+131
-276
lines changed

15 files changed

+131
-276
lines changed

Cargo.toml

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = ["crates/*", "dynamic", "fighters/*", "hdr-macros", "utils"]
2+
members = ["dynamic", "fighters/*", "hdr-macros", "utils"]
33

44
resolver = "2"
55

@@ -226,10 +226,6 @@ smashline.workspace = true
226226
skyline-web = { workspace = true, optional = true }
227227
utils.workspace = true
228228

229-
[build-dependencies]
230-
build-tools = { path = "crates/build-tools" }
231-
hdr-macros.workspace = true
232-
233229
[features]
234230
default = [
235231
"bayonetta",

build.rs

-15
This file was deleted.

crates/build-tools/Cargo.toml

-12
This file was deleted.

crates/build-tools/src/lib.rs

-48
This file was deleted.

crates/build-tools/src/main.rs

-7
This file was deleted.

dynamic/src/consts.rs

+6
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,12 @@ pub mod vars {
904904
// flags
905905
pub const SPECIAL_HI_CANCEL_ESCAPE_AIR: i32 = 0x0100;
906906
}
907+
pub mod status {
908+
// flags
909+
pub const SPECIAL_S_PIKMIN_DETONATE_IS_ATTACK_LAST_FRAME: i32 = 0x1100;
910+
// ints
911+
pub const SPECIAL_S_PIKMIN_DETONATE_TIMER: i32 = 0x1101;
912+
}
907913
}
908914

909915
pub mod ptrainer {

fighters/pikmin/src/pikmin/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ impl From<i32> for PikminInfo {
1919
fn from(other: i32) -> Self {
2020
match other {
2121
0 => PikminInfo { // Red
22-
dmg: 1.0,
22+
dmg: 1.05,
2323
shield_dmg: 0.25,
2424
angle: 0,
2525
hitlag: 1.0,
2626
attr: Hash40::new("collision_attr_fire"),
2727
attr_special: Hash40::new("collision_attr_fire"),
2828
sound: *COLLISION_SOUND_ATTR_FIRE,
2929
color: Vector3f{x: 1.0, y: 0.05, z: 0.0},
30-
cling_frame: 30 * 4
30+
cling_frame: 5
3131
},
3232
1 => PikminInfo { // yellow
3333
dmg: 0.94,
@@ -38,7 +38,7 @@ impl From<i32> for PikminInfo {
3838
attr_special: Hash40::new("collision_attr_paralyze"),
3939
sound: *COLLISION_SOUND_ATTR_ELEC,
4040
color: Vector3f{x: 1.0, y: 1.0, z: 0.14},
41-
cling_frame: 30 * 6
41+
cling_frame: 7
4242
},
4343
2 => PikminInfo { // Blue
4444
dmg: 1.0,
@@ -49,7 +49,7 @@ impl From<i32> for PikminInfo {
4949
attr_special: Hash40::new("collision_attr_water"),
5050
sound: *COLLISION_SOUND_ATTR_WATER,
5151
color: Vector3f{x: 0.1, y: 0.4, z: 1.0},
52-
cling_frame: 30 * 4
52+
cling_frame: 5
5353
},
5454
3 => PikminInfo { // White
5555
dmg: 0.75,
@@ -60,7 +60,7 @@ impl From<i32> for PikminInfo {
6060
attr_special: Hash40::new("collision_attr_flower"),
6161
sound: *COLLISION_SOUND_ATTR_FIRE,
6262
color: Vector3f{x: 1.0, y: 1.0, z: 1.0},
63-
cling_frame: 30 * 2
63+
cling_frame: 3
6464
},
6565
_ => PikminInfo { // Violet (Rock), also default
6666
dmg: 1.2,
@@ -71,7 +71,7 @@ impl From<i32> for PikminInfo {
7171
attr_special: Hash40::new("collision_attr_normal"),
7272
sound: *COLLISION_SOUND_ATTR_KICK,
7373
color: Vector3f{x: 0.36, y: 0.0, z: 1.0},
74-
cling_frame: 30 * 999
74+
cling_frame: 999
7575
},
7676
}
7777
}

fighters/pikmin/src/pikmin/status.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ pub unsafe fn special_s_cling_main(fighter: &mut L2CFighterCommon) -> L2CValue {
3131
let founder_power_mul_status = AttackModule::power_mul_status(founder_module_accessor);
3232
AttackModule::set_power_mul_status(fighter.module_accessor, founder_power_mul_status);
3333
}
34+
35+
let variation = fighter.get_int(*WEAPON_PIKMIN_PIKMIN_INSTANCE_WORK_ID_INT_VARIATION);
36+
let p = PikminInfo::from(variation);
37+
VarModule::set_int(fighter.battle_object, vars::pikmin::status::SPECIAL_S_PIKMIN_DETONATE_TIMER, 0);
38+
VarModule::off_flag(fighter.battle_object, vars::pikmin::status::SPECIAL_S_PIKMIN_DETONATE_IS_ATTACK_LAST_FRAME);
39+
3440
fighter.fastshift(L2CValue::Ptr(special_s_cling_main_loop as *const () as _))
3541
}
3642

@@ -40,8 +46,14 @@ unsafe extern "C" fn special_s_cling_main_loop(fighter: &mut L2CFighterCommon) -
4046
fighter.set_int(clatter_time as i32, *WEAPON_PIKMIN_PIKMIN_STATUS_SPECIAL_S_WORK_INT_CLATTER_TIME);
4147
let variation = fighter.get_int(*WEAPON_PIKMIN_PIKMIN_INSTANCE_WORK_ID_INT_VARIATION);
4248
let p = PikminInfo::from(variation);
43-
if fighter.status_frame() >= p.cling_frame
44-
&& frame >= 17.0 {
49+
50+
let is_attack = AttackModule::is_attack(fighter.module_accessor, 0, false);
51+
if is_attack && !VarModule::is_flag(fighter.battle_object, vars::pikmin::status::SPECIAL_S_PIKMIN_DETONATE_IS_ATTACK_LAST_FRAME) {
52+
VarModule::inc_int(fighter.battle_object, vars::pikmin::status::SPECIAL_S_PIKMIN_DETONATE_TIMER);
53+
}
54+
VarModule::set_flag(fighter.battle_object, vars::pikmin::status::SPECIAL_S_PIKMIN_DETONATE_IS_ATTACK_LAST_FRAME, is_attack);
55+
56+
if VarModule::get_int(fighter.battle_object, vars::pikmin::status::SPECIAL_S_PIKMIN_DETONATE_TIMER) >= p.cling_frame{
4557
fighter.change_status(WEAPON_PIKMIN_PIKMIN_STATUS_KIND_SPECIAL_S_CLING_REMOVE.into(), false.into());
4658
return 1.into();
4759
}

hdr-macros/src/lib.rs

+1-19
Original file line numberDiff line numberDiff line change
@@ -255,32 +255,14 @@ pub fn agent_params(item: TokenStream) -> TokenStream {
255255
}
256256
};
257257

258-
let path = Path::new(file!()).strip_prefix("hdr-macros").unwrap();
259-
let path = Path::new(env!("CARGO_MANIFEST_DIR")).join(path);
260-
let parent = match path.parent() {
261-
Some(parent) => parent,
262-
None => {
263-
return syn::Error::new(literal.span(), "Failed to get parent of current path.")
264-
.into_compile_error()
265-
.into()
266-
}
267-
};
268-
269-
let rom_path = parent.join("../../romfs/build/");
270-
271258
let mut output = String::new();
272259
for line in data.lines() {
273260
let line = line.trim_start();
274261
if !line.starts_with("#") {
275262
if let Some((agent, file)) = line.split_once(":") {
276263
let agent = agent.trim_start().trim_end();
277264
let file = file.trim_start().trim_end();
278-
if let Ok(metadata) = std::fs::metadata(rom_path.join(file)) {
279-
writeln!(output, "fighter_kind_{}:{}:{}", agent, file, metadata.len())
280-
.expect("Unknown error writing to output!");
281-
} else {
282-
panic!("Missing romfs file {}", file);
283-
}
265+
let _ = writeln!(output, "fighter_kind_{}:{}", agent, file);
284266
}
285267
}
286268
}

romfs/agent_params.txt

+38-38
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
luigi: fighter/luigi/param/hdr.prc
2-
pikmin: fighter/pikmin/param/hdr.prc
3-
lucas: fighter/lucas/param/hdr.prc
4-
lucario: fighter/lucario/param/hdr.prc
5-
pichu: fighter/pichu/param/hdr.prc
6-
ike: fighter/ike/param/hdr.prc
7-
donkey: fighter/donkey/param/hdr.prc
8-
dolly: fighter/dolly/param/hdr.prc
9-
chrom: fighter/chrom/param/hdr.prc
10-
captain: fighter/captain/param/hdr.prc
11-
pacman: fighter/pacman/param/hdr.prc
12-
mario: fighter/mario/param/hdr.prc
13-
mariod: fighter/mariod/param/hdr.prc
14-
link: fighter/link/param/hdr.prc
15-
simon: fighter/simon/param/hdr.prc
16-
richter: fighter/richter/param/hdr.prc
17-
koopajr: fighter/koopajr/param/hdr.prc
18-
demon: fighter/demon/param/hdr.prc
19-
samus: fighter/samus/param/hdr.prc
20-
samusd: fighter/samusd/param/hdr.prc
21-
edge: fighter/edge/param/hdr.prc
22-
szerosuit: fighter/szerosuit/param/hdr.prc
23-
pit: fighter/pit/param/hdr.prc
24-
pitb: fighter/pitb/param/hdr.prc
25-
toonlink: fighter/toonlink/param/hdr.prc
26-
younglink: fighter/younglink/param/hdr.prc
27-
daisy: fighter/daisy/param/hdr.prc
28-
miiswordsman: fighter/miiswordsman/param/hdr.prc
29-
duckhunt: fighter/duckhunt/param/hdr.prc
30-
krool: fighter/krool/param/hdr.prc
31-
ganon: fighter/ganon/param/hdr.prc
32-
miifighter: fighter/miifighter/param/hdr.prc
33-
sheik: fighter/sheik/param/hdr.prc
34-
miigunner: fighter/miigunner/param/hdr.prc
35-
falco: fighter/falco/param/hdr.prc
36-
ness: fighter/ness/param/hdr.prc
37-
ryu: fighter/ryu/param/hdr.prc
38-
ken: fighter/ken/param/hdr.prc
1+
luigi: fighter/luigi/param/hdr.xml
2+
pikmin: fighter/pikmin/param/hdr.xml
3+
lucas: fighter/lucas/param/hdr.xml
4+
lucario: fighter/lucario/param/hdr.xml
5+
pichu: fighter/pichu/param/hdr.xml
6+
ike: fighter/ike/param/hdr.xml
7+
donkey: fighter/donkey/param/hdr.xml
8+
dolly: fighter/dolly/param/hdr.xml
9+
chrom: fighter/chrom/param/hdr.xml
10+
captain: fighter/captain/param/hdr.xml
11+
pacman: fighter/pacman/param/hdr.xml
12+
mario: fighter/mario/param/hdr.xml
13+
mariod: fighter/mariod/param/hdr.xml
14+
link: fighter/link/param/hdr.xml
15+
simon: fighter/simon/param/hdr.xml
16+
richter: fighter/richter/param/hdr.xml
17+
koopajr: fighter/koopajr/param/hdr.xml
18+
demon: fighter/demon/param/hdr.xml
19+
samus: fighter/samus/param/hdr.xml
20+
samusd: fighter/samusd/param/hdr.xml
21+
edge: fighter/edge/param/hdr.xml
22+
szerosuit: fighter/szerosuit/param/hdr.xml
23+
pit: fighter/pit/param/hdr.xml
24+
pitb: fighter/pitb/param/hdr.xml
25+
toonlink: fighter/toonlink/param/hdr.xml
26+
younglink: fighter/younglink/param/hdr.xml
27+
daisy: fighter/daisy/param/hdr.xml
28+
miiswordsman: fighter/miiswordsman/param/hdr.xml
29+
duckhunt: fighter/duckhunt/param/hdr.xml
30+
krool: fighter/krool/param/hdr.xml
31+
ganon: fighter/ganon/param/hdr.xml
32+
miifighter: fighter/miifighter/param/hdr.xml
33+
sheik: fighter/sheik/param/hdr.xml
34+
miigunner: fighter/miigunner/param/hdr.xml
35+
falco: fighter/falco/param/hdr.xml
36+
ness: fighter/ness/param/hdr.xml
37+
ryu: fighter/ryu/param/hdr.xml
38+
ken: fighter/ken/param/hdr.xml

0 commit comments

Comments
 (0)