Ejemplo n.º 1
0
    public AttackInfo Attack(CharacterEntity target, float pAtkRate = 1f, float mAtkRate = 1f, int hitCount = 1, int fixDamage = 0)
    {
        if (target == null)
        {
            return(null);
        }
        self.ApplySkillAndBuff(CustomSkill.TriggerType.fight);
        var        attributes = self.GetTotalAttributes();
        AttackInfo info       = target.ReceiveDamage(self,
                                                     Mathf.CeilToInt(attributes.pAtk * pAtkRate),
                                                     Mathf.CeilToInt(attributes.mAtk * mAtkRate),
                                                     (int)attributes.acc,
                                                     attributes.exp_critChance,
                                                     attributes.exp_critDamageRate,
                                                     hitCount,
                                                     fixDamage);

        if (info.gedang)
        {
            self.ApplySkillAndBuff(CustomSkill.TriggerType.beigedang);
        }
        if (info.baoji)
        {
            self.ApplySkillAndBuff(CustomSkill.TriggerType.beibaoji);
        }
        if (info.shanbi)
        {
            self.ApplySkillAndBuff(CustomSkill.TriggerType.beimiss);
        }
        FriensAttack();
        return(info);
    }