Beispiel #1
0
    //Dot伤害
    public void Hurt(DotBuff buff)
    {
        if (buff.getDamage() == 0)
        {
            return;
        }

        float tempRand = MyTools.ins.getRandom(0, 100);

        if (tempRand >= buff.dotRate)
        {
            MyTools.ins.ShowDotHurt(this, buff, false);
            return;
        }


        //这里本应该计算自身免伤,该版本忽略TODO
        float inDamage = buff.getDamage() * 1f;

        //记录受到的伤害
        this.curHurtDamage += inDamage;
        totalhurtDamage    += curHurtDamage;
        curTroops           = Mathf.Max(0, curTroops - inDamage);


        HurtEvent hurtEvent = new HurtEvent(buff.skill.army.name, buff.skill.name, inDamage);

        hurtEventList.Add(hurtEvent);
        MyTools.ins.ShowDotHurt(this, buff, true);
    }
Beispiel #2
0
    public override BuffClass Clone()
    {
        //int tempCurrentRound = 0;
        //(Skill skill, string name,SwitchRule switchRule, int maxRound, float dotRate, float dotDamage, TargetType target)
        DotBuff temp = new DotBuff(this);

        //  MyTools.ppp(temp.ToString());
        return(temp);
    }
Beispiel #3
0
    public DotBuff(DotBuff seed)
    {
        this.skill        = seed.skill;
        this.maxRound     = seed.maxRound;
        this.currentRound = this.maxRound;
        this.dotRate      = seed.dotRate;
        this.dotDamage    = seed.dotDamage;
        this.effectName   = seed.effectName;
        this.targetType   = seed.targetType;
        this.switchRule   = seed.switchRule;

        this.switchWeight = getDamage();

        this.buffType = seed.buffType;
    }
Beispiel #4
0
    public void ShowDotHurt(Army defender, DotBuff buff, bool hit)
    {
        if (GameConst.CanShowText() == false)
        {
            return;
        }

        string temp = "";

        if (hit)
        {
            temp = "" + "<color=" + GameConst.Color.redColor + "【" + defender.name + "】 </color>由于" + buff.skill.army.name +
                   "【" + buff.skill.name + "】施加的" + buff.effectName + "效果损失了<color=" + GameConst.Color.yellowColor + buff.dotDamage.ToString("0.0") +
                   "</color>" + "兵力 (" + defender.getCount().ToString("0") + ") [剩" + buff.currentRound + "回合]";
        }
        else
        {
            temp = "" + "<color=" + buff.skill.army.color + "【" + buff.skill.army.name + "】</color>" + "【" + buff.skill.name + "】的" + buff.effectName +
                   "对 <color=" + defender.color + "【" + defender.name + "】" + " </color>没有生效";
        }

        Append(temp);
    }
Beispiel #5
0
    private Skill ChooseSkill(Army army, string name)
    {
        Skill   tempSkll = null;
        DotBuff dotBuff  = null;

        string[] skillNameArray = { "声东击西", "水淹七军", "溃堤",   "危崖困军", "长坂之吼",
                                    "驱虎吞狼", "玄武巨流", "焰焚箕轸", "楚歌四起", "黄天当立",
                                    "逆反毒杀", "复誓业火", "密谋定蜀", "冢虎",   "增援",  "养精蓄锐",
                                    "安抚军心", "火烧连营", "毒泉",   "火辎" };
        int      index = 0;

        for (int i = 0; i < skillNameArray.Length; i++)
        {
            if (skillNameArray[i].Equals(name))
            {
                index = i;
            }
        }

        switch (index)
        {
        case 0:
            //  tempSkll= new Skill("声东击西", 50f, 1, 12, 231);
            break;

        case 1:
            tempSkll = new Skill(army, "水淹七军", SkillType.ACTIVE, 50, 1, 22, 205);
            break;

        case 2:
            tempSkll = new Skill(army, "溃堤", SkillType.ACTIVE, 45, 0, 22, 79.8f);
            break;

        case 3:
            tempSkll = new Skill(army, "危崖困军", SkillType.ACTIVE, 50, 1, 22, 210);
            break;

        case 5:
            tempSkll = new Skill(army, "驱虎吞狼", SkillType.ACTIVE, 30f, 0, 33, 143);
            dotBuff  = new DotBuff(tempSkll, "围困", SwitchRule.SWITCH, 1, 100, 0, TargetType.ENEMY);
            tempSkll.AddBuff(dotBuff);
            break;

        case 7:
            tempSkll = new Skill(army, "焰焚箕轸", SkillType.ACTIVE, 50f, 1, 23, 119);
            dotBuff  = new DotBuff(tempSkll, "燃烧", SwitchRule.SWITCH, 1, 100, 119, TargetType.ENEMY);
            tempSkll.AddBuff(dotBuff);
            break;

        case 8:
            tempSkll = new Skill(army, "楚歌四起", SkillType.ACTIVE, 50f, 1, 23, 0);
            dotBuff  = new DotBuff(tempSkll, "恐慌", SwitchRule.SWITCH, 2, 100, 127, TargetType.ENEMY);
            tempSkll.AddBuff(dotBuff);
            break;

        case 9:
            tempSkll = new Skill(army, "黄天当立", SkillType.ACTIVE, 35f, 1, 33, 176);
            dotBuff  = new DotBuff(tempSkll, "妖术", SwitchRule.SWITCH, 2, 100, 96, TargetType.ENEMY);
            tempSkll.AddBuff(dotBuff);
            break;

        case 10:
            tempSkll = new Skill(army, "逆反毒杀", SkillType.ACTIVE, 35f, 0, 12, 0);
            dotBuff  = new DotBuff(tempSkll, "恐慌", SwitchRule.SWITCH, 2, 100, 83, TargetType.ENEMY);
            tempSkll.AddBuff(dotBuff);
            break;

        case 11:
            tempSkll = new Skill(army, "复誓业火", SkillType.ACTIVE, 45f, 0, 22, 0);
            dotBuff  = new DotBuff(tempSkll, "燃烧", SwitchRule.SWITCH, 2, 100, 133, TargetType.ENEMY);
            tempSkll.AddBuff(dotBuff);
            break;

        case 12:
            tempSkll = new Skill(army, "密谋定蜀", SkillType.ACTIVE, 35f, 0, 22, 0);
            dotBuff  = new DotBuff(tempSkll, "恐慌", SwitchRule.SWITCH, 2, 100, 115, TargetType.ENEMY);
            tempSkll.AddBuff(dotBuff);
            break;

        case 13:
            tempSkll = new Skill(army, "冢虎", SkillType.ACTIVE, 35f, 0, 12, 150);
            break;

        case 14:
            tempSkll = new Skill(army, "增援", SkillType.ACTIVE, 45f, 1, 22, 198);
            break;

        case 15:
            tempSkll = new Skill(army, "养精蓄锐", SkillType.ACTIVE, 45f, 1, 22, 0);
            dotBuff  = new DotBuff(tempSkll, "休整", SwitchRule.SWITCH, 2, 100, 122, TargetType.ENEMY);
            tempSkll.AddBuff(dotBuff);
            break;

        case 16:
            tempSkll = new Skill(army, "安抚军心", SkillType.ACTIVE, 35f, 0, 22, 108);
            break;

        case 17:
            tempSkll = new Skill(army, "火烧连营", SkillType.ACTIVE, 35f, 1, 33, 92);
            Skill tempSkll2 = new Skill(army, "", SkillType.ACTIVE, 50f, 0, 33, 133);
            Skill tempSkll3 = new Skill(army, "", SkillType.ACTIVE, 100f, 0, 33, 0);
            dotBuff = new DotBuff(tempSkll, "燃烧", SwitchRule.SWITCH, 2, 50, 76, TargetType.ENEMY);
            tempSkll3.AddBuff(dotBuff);
            tempSkll.subSkillList.Add(tempSkll2);
            tempSkll.subSkillList.Add(tempSkll3);
            break;

        case 18:
            tempSkll = new Skill(army, "毒泉", SkillType.ACTIVE, 50f, 1, 22, 0);
            dotBuff  = new DotBuff(tempSkll, "恐慌", SwitchRule.SWITCH, 2, 100, 85, TargetType.ENEMY);
            tempSkll.AddBuff(dotBuff);
            break;

        case 19:
            tempSkll = new Skill(army, "火辎", SkillType.ACTIVE, 50f, 1, 22, 75);
            dotBuff  = new DotBuff(tempSkll, "燃烧", SwitchRule.SWITCH, 1, 100, 75, TargetType.ENEMY);
            tempSkll.AddBuff(dotBuff);
            break;
        }

        return(tempSkll);
    }