@@ -6278,7 +6278,7 @@ func (c *Char) getOwnChannels(chNo int32) (found []*SoundChannel) {
62786278}
62796279
62806280func (c * Char ) playSound (params * PlaySndParams ) {
6281- if params .group < 0 {
6281+ if params .group < 0 || sys . noCharSoundFlg {
62826282 return
62836283 }
62846284 current_ffx := params .ffx
@@ -8492,6 +8492,29 @@ func (c *Char) targetDrop(excludeid int32, excludechar int32, keepone bool) {
84928492 }
84938493}
84948494
8495+ // We do the extra steps to prevent the internal multiplication by 100 from exposing garbage float digits
8496+ // https://github.com/ikemen-engine/Ikemen-GO/issues/1386
8497+ func (c * Char ) attackTrigger () float32 {
8498+ // Do the multiplication in float64
8499+ base := float64 (c .gi ().attackBase )
8500+ mul := float64 (c .attackMul [0 ])
8501+ result := base * mul
8502+
8503+ // Snap to a 3-decimal grid to kill the garbage (e.g. 120.000008 -> 120.0)
8504+ // 3 because default attack/defence values have 3 significant digits
8505+ cleaned := math .Round (result * 1e3 ) / 1e3
8506+
8507+ return float32 (cleaned )
8508+ }
8509+
8510+ // See attackTrigger()
8511+ func (c * Char ) defenceTrigger () float32 {
8512+ def := float64 (c .finalDefense )
8513+ result := def * 100
8514+ clean := math .Round (result * 1e3 ) / 1e3
8515+ return float32 (clean )
8516+ }
8517+
84958518// Process raw damage into the value that will actually be used
84968519// Calculations are done in float64 for the sake of precision
84978520func (c * Char ) computeDamage (damage float64 , kill , absolute bool , atkmul float32 , attacker * Char , bounds bool ) int32 {
@@ -11565,7 +11588,7 @@ func (c *Char) actionPrepare() {
1156511588 if c .alive () || c .ss .no != 5150 || c .numPartner () == 0 {
1156611589 c .setCSF (CSF_screenbound | CSF_movecamera_x | CSF_movecamera_y )
1156711590 }
11568- if sys .roundState () > 0 && (c .alive () || c .numPartner () == 0 ) {
11591+ if sys .roundState () > 0 && sys . roundState () < 4 && (c .alive () || c .numPartner () == 0 ) {
1156911592 c .setCSF (CSF_playerpush )
1157011593 }
1157111594 }
0 commit comments