Skip to content

Commit d428db5

Browse files
authored
Merge pull request #2527 from Alceris/overridemissing
feat: Add MissOnOverride parameter to HitDef.
2 parents 02d0483 + 620262a commit d428db5

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

src/bytecode.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6701,6 +6701,7 @@ const (
67016701
hitDef_p1stateno
67026702
hitDef_p2stateno
67036703
hitDef_p2getp1state
6704+
hitDef_missonoverride
67046705
hitDef_p1sprpriority
67056706
hitDef_p2sprpriority
67066707
hitDef_forcestand
@@ -6872,6 +6873,8 @@ func (sc hitDef) runSub(c *Char, hd *HitDef, paramID byte, exp []BytecodeExp) bo
68726873
hd.p2getp1state = true
68736874
case hitDef_p2getp1state:
68746875
hd.p2getp1state = exp[0].evalB(c)
6876+
case hitDef_missonoverride:
6877+
hd.missonoverride = Btoi(exp[0].evalB(c))
68756878
case hitDef_p1sprpriority:
68766879
hd.p1sprpriority = exp[0].evalI(c)
68776880
case hitDef_p2sprpriority:

src/char.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ type HitDef struct {
575575
p1stateno int32
576576
p2stateno int32
577577
p2getp1state bool
578+
missonoverride int32
578579
forcestand int32
579580
forcecrouch int32
580581
ground_fall bool
@@ -693,6 +694,7 @@ func (hd *HitDef) clear(c *Char, localscl float32) {
693694
p1sprpriority: 1,
694695
p1stateno: -1,
695696
p2stateno: -1,
697+
missonoverride: -1,
696698
forcestand: IErr,
697699
forcecrouch: IErr,
698700
guard_dist_x: hd.guard_dist_x, // These default to no change
@@ -8607,8 +8609,8 @@ func (c *Char) hitResultCheck(getter *Char, proj *Projectile) (hitResult int32)
86078609
}
86088610
}
86098611
// Miss if using p2stateno and HitOverride together
8610-
if !isProjectile && Abs(hitResult) == 1 &&
8611-
(hd.p2stateno >= 0 || hd.p1stateno >= 0) {
8612+
if hd.missonoverride == 1 || (hd.missonoverride == -1 && !isProjectile && Abs(hitResult) == 1 &&
8613+
(hd.p2stateno >= 0 || hd.p1stateno >= 0)) {
86128614
return 0
86138615
}
86148616
if ho.stateno >= 0 || ho.keepState {

src/compiler_functions.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,10 @@ func (c *Compiler) hitDefSub(is IniSection, sc *StateControllerBase) error {
17931793
hitDef_p2getp1state, VT_Bool, 1, false); err != nil {
17941794
return err
17951795
}
1796+
if err := c.paramValue(is, sc, "missonoverride",
1797+
hitDef_missonoverride, VT_Bool, 1, false); err != nil {
1798+
return err
1799+
}
17961800
b := false
17971801
if err := c.stateParam(is, "p1sprpriority", false, func(data string) error {
17981802
b = true

0 commit comments

Comments
 (0)