Skip to content

Commit a2467b8

Browse files
authored
Merge pull request #2259 from HDR-Development/olimar-rework
Olimar Bugfixes
2 parents 169fa26 + 6da3356 commit a2467b8

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

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
}

romfs/source/fighter/pikmin/param/vl.prcxml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<hash40 index="2">dummy</hash40>
1818
<hash40 index="3">dummy</hash40>
1919
</list>
20-
<list hash="param_pikmin_particular">
20+
<list hash="param_pikmin">
2121
<struct index="0">
2222
<int hash="special_s_lever_clatter_frame">0</int>
2323
<int hash="special_s_damage_remove_rate">0</int>

0 commit comments

Comments
 (0)