Skip to content

Commit

Permalink
Merge pull request #2229 from potsmugen/p2fix
Browse files Browse the repository at this point in the history
fix: P2 enemy, power sounds, time over perfects
  • Loading branch information
K4thos authored Jan 4, 2025
2 parents d9a5f75 + 3c9ee92 commit 067a7a2
Show file tree
Hide file tree
Showing 6 changed files with 218 additions and 236 deletions.
1 change: 0 additions & 1 deletion data/common.const
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Default.Enable.Tag = 1

; Backward compatibility toggles
Default.LegacyGameDistanceSpec = 1 ; 1 prevents GameWidth/GameHeight from being affected by stage zoom for mugenversion 1.0 chars
Default.IgnoreDefeatedEnemies = 1 ; 1 prevents EnemyNear from redirecting defeated enemies
Input.PauseOnHitPause = 1 ; 1 makes inputs to be retained during hit pause

; Rules
Expand Down
46 changes: 18 additions & 28 deletions src/bytecode.go
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ func (be BytecodeExp) run(c *Char) BytecodeValue {
sys.bcStack.Push(BytecodeSF())
i += int(*(*int32)(unsafe.Pointer(&be[i]))) + 4
case OC_enemynear:
if c = c.enemyNear(sys.bcStack.Pop().ToI()); c != nil {
if c = c.enemyNearTrigger(sys.bcStack.Pop().ToI()); c != nil {
i += 4
continue
}
Expand Down Expand Up @@ -2180,48 +2180,38 @@ func (be BytecodeExp) run_const(c *Char, i *int, oc *Char) {
*i += 4
case OC_const_p2name:
p2 := c.p2()
sys.bcStack.PushB(p2 != nil && p2.gi().nameLow ==
sys.stringPool[sys.workingState.playerNo].List[*(*int32)(
unsafe.Pointer(&be[*i]))])
sys.bcStack.PushB(p2 != nil &&
p2.gi().nameLow == sys.stringPool[sys.workingState.playerNo].List[*(*int32)(unsafe.Pointer(&be[*i]))])
*i += 4
case OC_const_p3name:
p3 := c.partner(0, false)
sys.bcStack.PushB(p3 != nil && p3.gi().nameLow ==
sys.stringPool[sys.workingState.playerNo].List[*(*int32)(
unsafe.Pointer(&be[*i]))])
sys.bcStack.PushB(p3 != nil &&
p3.gi().nameLow == sys.stringPool[sys.workingState.playerNo].List[*(*int32)(unsafe.Pointer(&be[*i]))])
*i += 4
case OC_const_p4name:
p4 := sys.charList.enemyNear(c, 1, true, true, false)
sys.bcStack.PushB(p4 != nil && !(p4.scf(SCF_ko) && p4.scf(SCF_over)) &&
p4.gi().nameLow ==
sys.stringPool[sys.workingState.playerNo].List[*(*int32)(
unsafe.Pointer(&be[*i]))])
p4 := sys.charList.enemyNear(c, 1, true, false)
sys.bcStack.PushB(p4 != nil &&
p4.gi().nameLow == sys.stringPool[sys.workingState.playerNo].List[*(*int32)(unsafe.Pointer(&be[*i]))])
*i += 4
case OC_const_p5name:
p5 := c.partner(1, false)
sys.bcStack.PushB(p5 != nil && p5.gi().nameLow ==
sys.stringPool[sys.workingState.playerNo].List[*(*int32)(
unsafe.Pointer(&be[*i]))])
sys.bcStack.PushB(p5 != nil &&
p5.gi().nameLow == sys.stringPool[sys.workingState.playerNo].List[*(*int32)(unsafe.Pointer(&be[*i]))])
*i += 4
case OC_const_p6name:
p6 := sys.charList.enemyNear(c, 2, true, true, false)
sys.bcStack.PushB(p6 != nil && !(p6.scf(SCF_ko) && p6.scf(SCF_over)) &&
p6.gi().nameLow ==
sys.stringPool[sys.workingState.playerNo].List[*(*int32)(
unsafe.Pointer(&be[*i]))])
p6 := sys.charList.enemyNear(c, 2, true, false)
sys.bcStack.PushB(p6 != nil &&
p6.gi().nameLow == sys.stringPool[sys.workingState.playerNo].List[*(*int32)(unsafe.Pointer(&be[*i]))])
*i += 4
case OC_const_p7name:
p7 := c.partner(2, false)
sys.bcStack.PushB(p7 != nil && p7.gi().nameLow ==
sys.stringPool[sys.workingState.playerNo].List[*(*int32)(
unsafe.Pointer(&be[*i]))])
sys.bcStack.PushB(p7 != nil &&
p7.gi().nameLow == sys.stringPool[sys.workingState.playerNo].List[*(*int32)(unsafe.Pointer(&be[*i]))])
*i += 4
case OC_const_p8name:
p8 := sys.charList.enemyNear(c, 3, true, true, false)
sys.bcStack.PushB(p8 != nil && !(p8.scf(SCF_ko) && p8.scf(SCF_over)) &&
p8.gi().nameLow ==
sys.stringPool[sys.workingState.playerNo].List[*(*int32)(
unsafe.Pointer(&be[*i]))])
p8 := sys.charList.enemyNear(c, 3, true, false)
sys.bcStack.PushB(p8 != nil &&
p8.gi().nameLow == sys.stringPool[sys.workingState.playerNo].List[*(*int32)(unsafe.Pointer(&be[*i]))])
*i += 4
case OC_const_stagevar_info_name:
sys.bcStack.PushB(sys.stage.nameLow ==
Expand Down
Loading

0 comments on commit 067a7a2

Please sign in to comment.