Skip to content

Commit

Permalink
Dizzy changes part3
Browse files Browse the repository at this point in the history
#561
- added notHitBy to dizzy states
- new constant: Super.LifeToDizzyPointsMul (works like Default.LifeToDizzyPointsMul, but for super moves)
  • Loading branch information
K4thos committed Jun 14, 2022
1 parent 40eb6fc commit d34d969
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
3 changes: 2 additions & 1 deletion data/common.const
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Default.Attack.LifeToPowerMul = 0.7 ; multiplier for power the attacker gets whe
Default.GetHit.LifeToPowerMul = 0.6 ; multiplier for power the receiver gets when an attack successfully hits (overridden by givepower HitDef option)
Super.TargetDefenceMul = 1.5 ; multiplier for how much damage a super does when you combo into it (ignored if SuperPause p2defmul option is set)
Default.LifeToGuardPointsMul = -1.5 ; multiplier for guard points the receiver gets when an attack is blocked (overridden by guardpoints HitDef option)
Default.LifeToDizzyPointsMul = -1.8 ; multiplier for dizzy points the receiver gets when an attack successfully hits (overridden by dizzypoints HitDef option)
Default.LifeToDizzyPointsMul = -1.8 ; multiplier for dizzy points the receiver gets when a normal/special attack successfully hits (overridden by dizzypoints HitDef option)
Super.LifeToDizzyPointsMul = 0 ; multiplier for dizzy points the receiver gets when a super attack successfully hits (overridden by dizzypoints HitDef option)
Default.LifeToRedLifeMul = 0.25 ; multiplier for red life the receiver gets when an attack successfully hits (overridden by redlife HitDef option)
Default.IgnoreDefeatedEnemies = 1 ; prevents EnemyNear from redirecting defeated enemies (toggle)
Input.PauseOnHitPause = 1 ; controls if inputs should be retained during hit pause
Expand Down
14 changes: 10 additions & 4 deletions data/dizzy.zss
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ if !dizzy {
dizzySet{value: 1}
}

notHitBy{value: SCA}

if time = 0 {
if stateType = S {
if anim > const(AnimStandOrAirHitLow_light) {
Expand Down Expand Up @@ -149,6 +151,7 @@ if !dizzy {

if time = 0 {
afterImageTime{time: 0}
notHitBy{value: SCA; time: 1}
if selfAnimExist(const(AnimAirFall_hitUpDiagonal)) {
changeAnim{value: const(AnimAirFall_hitUpDiagonal)}
}
Expand All @@ -162,6 +165,11 @@ if anim = [const(AnimAirFall), const(AnimAirFall_hitUpDiagonal)] {
}
}

# AnimHitGround + AnimGetUp
if anim != [const(AnimAirFall), const(AnimAirFall_hitUpDiagonal)] {
notHitBy{value: SCA}
}

persistent(0) if animTime = 0 && anim = const(AnimHittingGroundFromFall) {
changeAnim{value: const(AnimBounceIntoAir)}
}
Expand Down Expand Up @@ -222,6 +230,8 @@ if (animTime = 0 && anim = [const(AnimGetUpFromLieDown), const(AnimGetUpFromLieD
changeState{value: const(StateDizzy)}
}

notHitBy{value: SCA; time: 1}

#===============================================================================
# StateDizzy
#===============================================================================
Expand Down Expand Up @@ -269,10 +279,6 @@ if !const(Default.Enable.Dizzy) || isHelper || teamSide = 0 {
dizzyPointsSet{value: dizzyPointsMax}
mapSet{map: "_iksys_dizzyPointsCounter"; value: 0}
} else if roundState = 2 && alive {
# Hyper attacks don't affect dizzy points
ignoreHitPause if hitDefAttr = SCA, HA {
assertSpecial{flag: nodizzypointsdamage}
}
# Upon hit
ignoreHitPause if moveType = H {
mapSet{map: "_iksys_dizzyPointsCounter"; value: 120}
Expand Down
12 changes: 9 additions & 3 deletions src/char.go
Original file line number Diff line number Diff line change
Expand Up @@ -1957,7 +1957,8 @@ func (c *Char) load(def string) error {
gi.constants["default.gethit.lifetopowermul"] = 0.6
gi.constants["super.targetdefencemul"] = 1.5
gi.constants["default.lifetoguardpointsmul"] = -1.5
gi.constants["default.lifetodizzypointsmul"] = 0
gi.constants["default.lifetodizzypointsmul"] = -1.8
gi.constants["super.lifetodizzypointsmul"] = 0
gi.constants["default.lifetoredlifemul"] = 0.25
gi.constants["default.ignoredefeatedenemies"] = 1
gi.constants["input.pauseonhitpause"] = 1
Expand Down Expand Up @@ -3766,8 +3767,13 @@ func (c *Char) setHitdefDefault(hd *HitDef, proj bool) {
int32(c.gi().constants["default.gethit.lifetopowermul"]*float32(hd.hitdamage)))
ifierrset(&hd.guardgivepower,
int32(c.gi().constants["default.gethit.lifetopowermul"]*float32(hd.hitdamage)*0.5))
ifierrset(&hd.dizzypoints,
int32(c.gi().constants["default.lifetodizzypointsmul"]*float32(hd.hitdamage)*c.attackMul))
if hd.attr&int32(AT_AH) != 0 {
ifierrset(&hd.dizzypoints,
int32(c.gi().constants["super.lifetodizzypointsmul"]*float32(hd.hitdamage)*c.attackMul))
} else {
ifierrset(&hd.dizzypoints,
int32(c.gi().constants["default.lifetodizzypointsmul"]*float32(hd.hitdamage)*c.attackMul))
}
ifierrset(&hd.guardpoints,
int32(c.gi().constants["default.lifetoguardpointsmul"]*float32(hd.hitdamage)*c.attackMul))
ifierrset(&hd.redlife,
Expand Down

0 comments on commit d34d969

Please sign in to comment.