11package io .luna .game .model .mob .combat ;
22
3+ import engine .combat .prayer .CombatPrayer ;
4+ import io .luna .game .model .item .Equipment ;
35import io .luna .game .model .mob .Mob ;
6+ import io .luna .game .model .mob .Player ;
7+ import io .luna .game .model .mob .Skill ;
48import io .luna .game .model .mob .block .Hit .HitType ;
59import io .luna .util .RandomUtils ;
610
@@ -11,8 +15,24 @@ public static CombatDamage simple(int damage, HitType hitType, CombatDamageType
1115 }
1216
1317 // apply damage based on target
14- public static CombatDamage calculated (Mob target , HitType hitType , CombatDamageType damageType ) {
15- int maxHit = -1 ;
18+ public static CombatDamage calculated (Mob target , Mob source , HitType hitType , CombatDamageType damageType ) {
19+ int maxHit = 1 ;
20+
21+ if (source instanceof Player ) {
22+ Player p = source .asPlr ();
23+ double equipmentStrengthBonus = p .getEquipment ().getBonus (Equipment .EquipmentBonus .STRENGTH );
24+ double strength = p .skill (Skill .STRENGTH ).getStaticLevel ();
25+ if (p .getCombat ().getPrayers ().isActive (CombatPrayer .BURST_OF_STRENGTH )) {
26+ strength *= 1.05d ;
27+ } else if (p .getCombat ().getPrayers ().isActive (CombatPrayer .SUPERHUMAN_STRENGTH )) {
28+ strength *= 1.1d ;
29+ } else if (p .getCombat ().getPrayers ().isActive (CombatPrayer .ULTIMATE_STRENGTH )) {
30+ strength *= 1.15d ;
31+ }
32+ strength += 8d ;
33+ maxHit = (int )(0.5d + strength * ((equipmentStrengthBonus + 64d )/640d ));
34+ }
35+
1636 return new CombatDamage (RandomUtils .inclusive (maxHit ), hitType , damageType );
1737 }
1838
0 commit comments