Commit e22ded1bb23b14cc8e894a9ea692281d20301486

Authored by zhouhaihai
1 parent e7c3d3da

被动技奖励

Showing 1 changed file with 13 additions and 6 deletions   Show diff stats
@@ -642,16 +642,13 @@ function Adv:over(success, rewardRatio, overType) @@ -642,16 +642,13 @@ function Adv:over(success, rewardRatio, overType)
642 end 642 end
643 local chapterData = csvdb["adv_chapterCsv"][self.chapterId] 643 local chapterData = csvdb["adv_chapterCsv"][self.chapterId]
644 -- 扣除的东西给积分 644 -- 扣除的东西给积分
645 - local reward = self.owner:getProperty("advItems"):toNumMap()  
646 local addScore = 0 645 local addScore = 0
647 - for itemId, count in pairs(reward) do 646 + for itemId, count in pairs(self.owner:getProperty("advItems"):toNumMap()) do
648 local itemCsv = csvdb["itemCsv"][itemId] 647 local itemCsv = csvdb["itemCsv"][itemId]
649 if not itemCsv then 648 if not itemCsv then
650 print("ERROR: no itemId in ItemCsv : ", itemId) 649 print("ERROR: no itemId in ItemCsv : ", itemId)
651 elseif itemCsv.type == ItemType.AdvItem then 650 elseif itemCsv.type == ItemType.AdvItem then
652 addScore = addScore + count * itemCsv.advScore 651 addScore = addScore + count * itemCsv.advScore
653 - else  
654 - reward[itemId] = math.ceil(count * rewardRatio / 100)  
655 end 652 end
656 end 653 end
657 self:scoreChange(AdvScoreType.ItemBack, addScore) 654 self:scoreChange(AdvScoreType.ItemBack, addScore)
@@ -662,10 +659,20 @@ function Adv:over(success, rewardRatio, overType) @@ -662,10 +659,20 @@ function Adv:over(success, rewardRatio, overType)
662 local scoreReward = math.floor(score / chapterData.scoreAward) 659 local scoreReward = math.floor(score / chapterData.scoreAward)
663 self.owner:award({[ItemId.OldCoin] = scoreReward}) 660 self.owner:award({[ItemId.OldCoin] = scoreReward})
664 661
665 - reward = self.owner:award(reward)  
666 - 662 + -- 被动技会影响奖励
667 self.battle.player:triggerPassive(Passive.ADV_OVER, {score = score, level = self.level}) 663 self.battle.player:triggerPassive(Passive.ADV_OVER, {score = score, level = self.level})
668 664
  665 + local reward = {}
  666 + for itemId, count in pairs(self.owner:getProperty("advItems"):toNumMap()) do
  667 + local itemCsv = csvdb["itemCsv"][itemId]
  668 + if not itemCsv then
  669 + print("ERROR: no itemId in ItemCsv : ", itemId)
  670 + elseif itemCsv.type ~= ItemType.AdvItem then
  671 + reward[itemId] = math.ceil(count * rewardRatio / 100)
  672 + end
  673 + end
  674 + reward = self.owner:award(reward)
  675 +
669 if success then 676 if success then
670 self.owner:checkTaskEnter("AdvPass", {id = self.chapterId, level = self.level, score = score}) 677 self.owner:checkTaskEnter("AdvPass", {id = self.chapterId, level = self.level, score = score})
671 678