def cast(self): is_stun = utils.rnd() < self.skill(0, 2.0/3, 20, base_skill_level = 0) self.dest.damage(self.src.stats["matk"], source=self.src, log=u"{source:f} бросает молот в {target:f}, нанося {damage} урона!%s" % (u" {target:f} оглушен!" if is_stun else "")) if is_stun: self.add_effect(effect.get("Buff", self.name, "stun", 1), 3) self.need_msg = False
def from_user(fight, user, team_id): ''' Создание файтера из пользователя. User user - пользователь. int team_id - номер команды. ''' f = Fighter(fight) f._type = "user" f.have_deck = True f.alive = True f.user_id = user.id f.team_id = team_id f.deck = list(chain.from_iterable((Card.create(id) for i in range(count)) for id, count in user["deck"].dict.iteritems())) f.name = user.name f.image = user.image f.level = user["level"] f.base_stats = {} for key in ["atk", "def", "matk", "mdef", "hp_max"]: f.base_stats[key] = f.stats[key] = user[key] for sk in user['skills'].keys(): key = 'skill_' + sk f.base_stats[key] = f.stats[key] = user['skills'][sk] if fight._type == "training": f.hp = user["hp_max"] else: user.update_hp() f.hp = int(user.hp) f.effects = [] for eff, limit in user["effects"]: f.add_effect(effect.get(eff.id, *eff.args), 99, f) f.stats["max_hand"] = 6 shuffle(f.deck) f.hand = [] f.draw(5) f.mana = 0 return f
def cast(self): if self.src.move and "atk_target" in self.src.move: st = self.src.stats.cur['atk'] for i in range(1 + self.mana): self.src.attack(self.src.fight.fighter_by_id(self.src.move["atk_target"])) self.src.stats.cur['atk'] *= self.skill(0.4, 0.75, 20, base_skill_level = 0) self.src.mana = 0 self.add_effect(effect.get('Stun'), 1)
def from_mob(fight, mob, team_id): f = Fighter(fight) f._type = "mob" f.have_deck = False f.alive = True f.mob_id = mob.id f.team_id = team_id f.name = mob.name f.image = mob.image f.level = mob.level f.stats.base.update(mob.stats) f.base_stats = dict(mob.stats) f.stats.reset() f.hp = f.stats["hp_max"] f.effects = [] for eff in mob.effects: f.add_effect(effect.get(eff), 99, f) f.hand = [] f.deck = [] f.mana = 0 return f
def cast(self): self.add_effect(effect.get("Mult", self.name, "mdef", 100), 1)
def cast(self): self.dest.stats.add("shield", round(self.src.stats["mdef"] * self.skill(0.5, 1))) self.add_effect(effect.get("Reflect", 100, round(self.src.stats["mdef"] * self.skill(0.5, 1))), 2)
def use(self, u): u.add_effect(effect.get('Buff', self.name, self.stat, self.q(), 'potion'), 30 * 60)
def trigger(self, user): user.add_effect(effect.get("Curse"), 300)
def trigger(self, user): user.add_effect(effect.get("Poison"), 300)
def cast(self): self.add_effect(effect.get('Protect'), 5)
def cast(self): self.dest.stats.mult('crit_bonus', 2) self.add_effect(effect.get("Buff", self.name, "crit", 100), 1)
def cast(self): self.add_effect(effect.get("Buff", self.name, "vampire", 100), 2) self.add_effect(effect.get("Mult", self.name, "def", 0.5), 2)
def cast(self): self.add_effect(effect.get("Mult", self.name, "atk", 2), 2)
def cast(self): self.add_effect(effect.get('AtkTeamUp'), 5)
def cast(self): self.dest.damage(int(self.src.stats["matk"] * 0.6), source = self.src, magic=True, log = (u"{source:f} применяет {spell:s} на {target:f}, нанося {damage} урона и поджигая {target:f}!", {"spell": self.js_link()})) self.add_effect(effect.get("Buff", self.name, "hp_regen", -int(self.src.stats["matk"] * 0.3), "Burn"), 3)
def cast(self): self.add_effect(effect.get("Mult", self.name, "matk", self.skill(2, 3)), 3) self.add_effect(effect.get("Mult", self.name, "atk", 0), 3)
def cast(self): self.add_effect(effect.get('Buff', self.name, 'dodge', self.skill(50, 90)), 3)