File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,8 @@ public function battle($creatureId)
7272 protected function battleWin ($ hero , $ opponent )
7373 {
7474 $ goldDrop = $ opponent ->getGoldDrop ();
75- $ expEarned = ceil (($ opponent ->experience ) + ($ opponent ->experience * 0.04 * $ hero ->learning_level ));
75+
76+ $ expEarned = $ this ->expEarned ($ opponent ->experience , $ hero ->learning_level );
7677
7778 if ($ hero ->level >= ($ opponent ->level + 5 )) {
7879 $ expEarned /= 3 ;
@@ -102,6 +103,13 @@ protected function battleLoss($hero, $opponent)
102103 ];
103104 }
104105
106+ private function expEarned ($ expEarned , $ learningLevel )
107+ {
108+ return (int )round (
109+ ceil (($ expEarned ) + ($ expEarned * 0.05 * $ learningLevel ))
110+ );
111+ }
112+
105113 protected function getCreature ($ creatureId )
106114 {
107115 return $ this ->creatures ->find ($ creatureId );
You can’t perform that action at this time.
0 commit comments