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
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
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)
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)