示例#1
0
    def absolute_sell_price(self):

        if self.is_useless:
            gold_amount = 1 + int(f.normal_loot_cost_at_lvl(self.level))
        else:
            gold_amount = 1 + int(f.sell_artifact_price(self.level) * self.rarity.cost)

        return gold_amount
示例#2
0
    def absolute_sell_price(self):

        if self.is_useless:
            gold_amount = 1 + int(f.normal_loot_cost_at_lvl(self.level))
        else:
            gold_amount = 1 + int(
                f.sell_artifact_price(self.level) * self.rarity.cost)

        return gold_amount
示例#3
0
    def use_money(self, task, action, hero, critical): # pylint: disable=W0613
        coins = int(math.ceil(f.normal_loot_cost_at_lvl(hero.level)*random.uniform(*c.ANGEL_HELP_CRIT_MONEY_FRACTION)))

        if critical:
            coins *= c.ANGEL_HELP_CRIT_MONEY_MULTIPLIER
            hero.change_money(MONEY_SOURCE.EARNED_FROM_HELP, coins)
            hero.add_message('angel_ability_money_crit', hero=hero, coins=coins)
        else:
            hero.change_money(MONEY_SOURCE.EARNED_FROM_HELP, coins)
            hero.add_message('angel_ability_money', hero=hero, coins=coins)

        return task.logic_result(next_step=ComplexChangeTask.STEP.SUCCESS)
示例#4
0
    def use_money(self, task, action, hero, critical): # pylint: disable=W0613
        coins = int(math.ceil(f.normal_loot_cost_at_lvl(hero.level)*random.uniform(*c.ANGEL_HELP_CRIT_MONEY_FRACTION)))

        if critical:
            coins *= c.ANGEL_HELP_CRIT_MONEY_MULTIPLIER
            hero.change_money(MONEY_SOURCE.EARNED_FROM_HELP, coins)
            hero.add_message('angel_ability_money_crit', hero=hero, coins=coins)
        else:
            hero.change_money(MONEY_SOURCE.EARNED_FROM_HELP, coins)
            hero.add_message('angel_ability_money', hero=hero, coins=coins)

        return task.logic_result(next_step=ComplexChangeTask.STEP.SUCCESS)
示例#5
0
 def test_normal_loot_cost_at_lvl(self):
     self.assertEqual(f.normal_loot_cost_at_lvl(1), 1)
     self.assertEqual(f.normal_loot_cost_at_lvl(10), 9)
     self.assertEqual(f.normal_loot_cost_at_lvl(25), 13)
     self.assertEqual(f.normal_loot_cost_at_lvl(50), 15)
     self.assertEqual(f.normal_loot_cost_at_lvl(100), 18)
示例#6
0
 def test_normal_loot_cost_at_lvl(self):
     self.assertEqual(f.normal_loot_cost_at_lvl(1), 1)
     self.assertEqual(f.normal_loot_cost_at_lvl(10), 9)
     self.assertEqual(f.normal_loot_cost_at_lvl(25), 13)
     self.assertEqual(f.normal_loot_cost_at_lvl(50), 15)
     self.assertEqual(f.normal_loot_cost_at_lvl(100), 18)