File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,6 +99,30 @@ func TestApplyBootstrapStaticActorNormalAttackClampsFormulaDamageToMinimumOne(t
9999 }
100100}
101101
102+ func TestApplyBootstrapStaticActorNormalAttackClampsOverMaxRuntimeHPBeforeDamage (t * testing.T ) {
103+ const profile = "practice_overmax_wolf"
104+ if ! RegisterStaticActorCombatProfile (profile , StaticActorCombatProfileDefaults {
105+ MaxHP : 20 ,
106+ AttackValue : 7 ,
107+ DefenseValue : 3 ,
108+ RespawnDelay : PracticeMobBootstrapRespawnDelay ,
109+ }) {
110+ t .Fatalf ("expected %q profile registration with formula stats to succeed" , profile )
111+ }
112+ t .Cleanup (func () { UnregisterStaticActorCombatProfileForTest (profile ) })
113+
114+ nextHP , hpPercent , ok := ApplyBootstrapStaticActorNormalAttack (profile , 25 )
115+ if ! ok {
116+ t .Fatal ("expected registered formula profile normal attack to support over-max runtime HP by clamping first" )
117+ }
118+ if nextHP != 16 {
119+ t .Fatalf ("expected over-max runtime HP to clamp to max HP before 4 damage, got next HP %d" , nextHP )
120+ }
121+ if hpPercent != 80 {
122+ t .Fatalf ("expected over-max runtime HP attack to report 80 percent after clamp and damage, got %d" , hpPercent )
123+ }
124+ }
125+
102126func TestBootstrapStaticActorRespawnDelayReturnsTrainingDummyBootstrapDelay (t * testing.T ) {
103127 delay , ok := BootstrapStaticActorRespawnDelay (StaticActorCombatKindTrainingDummy )
104128 if ! ok {
You can’t perform that action at this time.
0 commit comments