示例#1
0
 public override void destroy()
 {
     base.destroy();
     skillData      = null;
     _unitSkillData = null;
     uiSlot         = null;
     skillInfo      = null;
     player         = null;
     mon            = null;
 }
示例#2
0
    public override void clear()
    {
        base.clear();

        _nowSelectedSkillData = null;

        if (decal != null)
        {
            GameManager.me.characterManager.setMonsterHeroTargetingDecal(decal);
        }

        decal = null;
    }
    void setTargetIsMePoint(HeroSkillData skillData, out float heroPoint, out float unitPoint)
    {
        heroPoint = 0;
        unitPoint = 0;
        switch (skillData.skillType)
        {
        case Skill.Type.HEAL:
            unitPoint = targetingPointMyUnitChecker.attr[2];
            break;

        case Skill.Type.BUFF:
            unitPoint = targetingPointMyUnitChecker.attr[3];
            break;
        }
    }
示例#4
0
    void initTargetingDecal()
    {
        _nowSelectedSkillData = mon.skillSlots[_nowSelectedAISlot.ai.actionSkill2].skillData;

        if (_nowSelectedSkillData.targetType == Skill.TargetType.ENEMY)
        {
            switch (_nowSelectedSkillData.targeting)
            {
            case TargetingData.NONE:
                break;

            case TargetingData.FIXED_1:
                decal.init(TargetingDecal.DecalType.Circle, (float)_nowSelectedSkillData.targetAttr[1] * 0.005f, false, true, _nowSelectedAISlot.ai.actionSkillDelay);                //checkSkillTarget(true));
                decal.setColor(Color.red);
                decal.skillExeType = _nowSelectedSkillData.exeData.type;
                break;

            case TargetingData.AUTOMATIC_2:
                decal.init(TargetingDecal.DecalType.Circle, 1.0f, false, checkSkillTarget(false), _nowSelectedAISlot.ai.actionSkillDelay);
                decal.setColor(Color.red);
                decal.skillExeType = _nowSelectedSkillData.exeData.type;
                break;

            case TargetingData.FORWARD_LINEAR_3:

                if (mon.isVisible)
                {
                    decal.init(TargetingDecal.DecalType.Arrow, 1.0f, false, checkSkillTarget(false), -1.0f);
                    decal.setColor(Color.red);
                    decal.skillExeType = _nowSelectedSkillData.exeData.type;
                }
                else
                {
                    decal.visible = false;
                }

                break;
            }
        }
        else
        {
            decal.visible = false;
        }

        _setTarget    = false;
        _decalVisible = false;
    }
    void setTargetIsEnemyPoint(HeroSkillData skillData, out float heroPoint, out float unitPoint)
    {
        heroPoint = 0;
        unitPoint = 0;
        switch (skillData.skillType)
        {
        case Skill.Type.ATTACK:
            heroPoint = targetingPointHeroChecker.attr[0];
            unitPoint = targetingPointEnemyUnitChecker.attr[0];
            break;

        case Skill.Type.DEBUFF:
            heroPoint = targetingPointHeroChecker.attr[1];
            unitPoint = targetingPointEnemyUnitChecker.attr[1];
            break;
        }
    }
示例#6
0
    public virtual void setData(Monster monster, GameIDData heroSkillInfo, UIPlaySkillSlot inputUiSlot = null)
    {
        uiSlot   = inputUiSlot;
        mon      = monster;
        exeCount = 0;
        player   = null;

        if (heroSkillInfo != null)
        {
            skillInfo = heroSkillInfo;

            if (mon.isPlayer && heroSkillInfo.transcendData != null)
            {
                skillData = heroSkillInfo.skillData.clone();
                heroSkillInfo.transcendData.apply(skillData, heroSkillInfo.transcendLevel);
            }
            else
            {
                skillData = heroSkillInfo.skillData;
                skillData.exeData.init(AttackData.AttackerType.Hero, AttackData.AttackType.Skill, skillData);
            }

            useMp = skillData.mp;

            if (skillData.coolTime <= 0.1f)
            {
                maxCoolTime = 0.0f;
            }
            else
            {
                maxCoolTime = skillData.coolTime;
            }

            coolTime = maxCoolTime;

            chargingTimeLimit = skillData.getChargingTime(heroSkillInfo.reinforceLevel);
        }
    }
    float getScoreByMonsterType(HeroSkillData skillData, Monster mon)
    {
        if (mon.isHero)
        {
            if (skillData.skillType == Skill.Type.ATTACK)
            {
                if (mon.hpPer < 0.2f)
                {
                    return(100.0f);
                }
                else
                {
                    ++targetHeroNum;
                }
            }
        }
        else
        {
            ++targetUnitNum;
        }

        return(0);
    }
示例#8
0
    public HeroSkillData clone(HeroSkillData inputData = null)
    {
        HeroSkillData hd;

        if (inputData == null)
        {
            hd = new HeroSkillData();
        }
        else
        {
            hd = inputData;
        }

        hd.grade                = this.grade;
        hd.minChargingTime      = this.minChargingTime;
        hd.maxChargingTime      = this.maxChargingTime;
        hd.isChargingTimeSingle = this.isChargingTimeSingle;
        hd.coolTime             = this.coolTime;
        hd.hasCoolTime          = this.hasCoolTime;
        hd.mp = this.mp;

        hd.isMonsterSkill = this.isMonsterSkill;
        hd.skillDataType  = this.skillDataType;

        hd.hasShotEffect = this.hasShotEffect;
        hd.colorEffectId = this.colorEffectId;

        hd.isPassiveSkill = this.isPassiveSkill;

        hd.isBook = this.isBook;

        hd.linkResourceType = this.linkResourceType;
        hd.linkResource     = this.linkResource;

        hd.baseId = this.baseId;
        hd.isBase = this.isBase;

        hd.id   = this.id;
        hd.name = this.name;

        hd.baseLevel = this.baseLevel;

        hd.skillType = this.skillType;

        hd.targetType = this.targetType;

        hd.checkMissChance = this.checkMissChance;

        int len = this.successChance.Length;

        hd.successChance = new int[len][];

        for (int i = 0; i < len; ++i)
        {
            if (this.successChance[i] == null)
            {
                hd.successChance[i] = null;
            }
            else
            {
                hd.successChance[i] = new int[this.successChance[i].Length];
                for (int j = 0; j < hd.successChance[i].Length; ++j)
                {
                    hd.successChance[i][j] = this.successChance[i][j];
                }
            }
        }


        len = this.successValueType.Length;
        hd.successValueType = new GameValueType.Type[len];

        for (int i = 0; i < len; ++i)
        {
            hd.successValueType[i] = this.successValueType[i];
        }

        hd.exeType = this.exeType;

        hd.exeData = this.exeData.clone();

        hd.targeting = this.targeting;

        hd.coolTimeStartDelay = this.coolTimeStartDelay;

        hd.isTargetingForward = this.isTargetingForward;

        hd.transcendData = this.transcendData;

        hd.description = "";

        if (this.targetAttr != null)
        {
            hd.targetAttr = new Xint[this.targetAttr.Length];
            Array.Copy(this.targetAttr, hd.targetAttr, this.targetAttr.Length);
        }
        else
        {
            hd.targetAttr = null;
        }

        switch (targeting)
        {
        case TargetingData.FIXED_1:
        case TargetingData.AUTOMATIC_2:

            hd.targetAttr    = new Xint[2];
            hd.targetAttr[0] = this.targetAttr[0];
            hd.targetAttr[1] = this.targetAttr[1];

            break;

        default:
            hd.targetAttr = null;
            break;
        }

        hd.setTargetingChecker2();

        len = this.skillEffects.Length;

        hd.skillEffects = new SkillEffectData[len];

        for (int i = 0; i < len; ++i)
        {
            hd.skillEffects[i] = this.skillEffects[i].clone(hd);
        }

        hd.totalEffectNum = this.totalEffectNum;

        hd.isChangeSideSkill = this.isChangeSideSkill;

        hd.baseIdWithoutRare = this.baseIdWithoutRare;

        return(hd);
    }
    //unit : ATK_ATTR1,ATK_ATTR2,ATK_ATTR3,ATK_ATTR4,ATK_ATTR5,ATK_ATTR6,ATK_ATTR7,MOVE_SPEED,ATK_RANGE,ATK_SPEED,ATK_PHYSIC,ATK_MAGIC,DEF_PHYSIC,DEF_MAGIC,HP

    //skill : COOLTIME,MP,
    //E_ATTR1,E_ATTR2,E_ATTR3,E_ATTR4,E_ATTR5,E_ATTR6,E_ATTR7,
    //T_ATTR1,T_ATTR2,
    //SUCCESS_CHANCE_1,E1_ATTR1,E1_ATTR2,SUCCESS_CHANCE_2,E2_ATTR1,E2_ATTR2,SUCCESS_CHANCE_3,E3_ATTR1,E3_ATTR2,SUCCESS_CHANCE_4,E4_ATTR1,E4_ATTR2

    //HD: HPMAX,MPMAX,MP_RECOVERY,DEF_MAGIC,SKILL_SP_DISCOUNT,1-2_SKILL_ATK_UP,3_SKILL_UP,4-9_SKILL_TIME_UP
    //BD: HPMAX,SPMAX,SP_RECOVERY,DEF_PHYSIC,SUMMON_SP_PER,UNIT_HP_UP,UNIT_DEF_UP
    //WP: MPMAX,MP_RECOVERY,ATK_PHYSIC,ATK_MAGIC,SKILL_SP_DISCOUNT,1-2_SKILL_ATK_UP,3_SKILL_UP,4-9_SKILL_TIME_UP,ATK_RANGE,ATK_SPEED,ATTR1,ATTR2,ATTR3,ATTR4,ATTR5,ATTR6,ATTR7
    //RD: SPMAX,SP_RECOVERY,SPEED,SUMMON_SP_PER,UNIT_HP_UP,UNIT_DEF_UP

    public void apply(HeroSkillData hd, int[] tLevel)
    {
        if (tLevel == null)
        {
            return;
        }

        hd.exeData.init(AttackData.AttackerType.Hero, AttackData.AttackType.Skill, hd, this, tLevel, true);

        for (int i = 0; i < 4; ++i)
        {
            if (tLevel[i] == 0)
            {
                continue;
            }

            int attrIndex = getAttrIndex(i);

            switch (attrIndex)
            {
            case WSATTR.COOLTIME_I:
                hd.coolTime = applyRateValue(hd.coolTime, tLevel[i], i);
                break;

            case WSATTR.MP_I:
                hd.mp = applyRateValue(hd.mp.Get(), tLevel[i], i);
                break;

            case  WSATTR.E_ATTR1_I:
                hd.exeData.attrOriginal[0] = applyRateValue(hd.exeData.attrOriginal[0].Get(), tLevel[i], i);
                hd.exeData.attr[0]         = hd.exeData.attrOriginal[0];
                break;

            case  WSATTR.E_ATTR2_I:
                hd.exeData.attrOriginal[1] = applyRateValue(hd.exeData.attrOriginal[1].Get(), tLevel[i], i);
                hd.exeData.attr[1]         = hd.exeData.attrOriginal[1];
                break;

            case  WSATTR.E_ATTR3_I:
                hd.exeData.attrOriginal[2] = applyRateValue(hd.exeData.attrOriginal[2].Get(), tLevel[i], i);
                hd.exeData.attr[2]         = hd.exeData.attrOriginal[2];
                break;

            case  WSATTR.E_ATTR4_I:
                hd.exeData.attrOriginal[3] = applyRateValue(hd.exeData.attrOriginal[3].Get(), tLevel[i], i);
                hd.exeData.attr[3]         = hd.exeData.attrOriginal[3];
                break;

            case  WSATTR.E_ATTR5_I:
                hd.exeData.attrOriginal[4] = applyRateValue(hd.exeData.attrOriginal[4].Get(), tLevel[i], i);
                hd.exeData.attr[4]         = hd.exeData.attrOriginal[4];
                break;

            case  WSATTR.E_ATTR6_I:
                hd.exeData.attrOriginal[5] = applyRateValue(hd.exeData.attrOriginal[5].Get(), tLevel[i], i);
                hd.exeData.attr[5]         = hd.exeData.attrOriginal[5];
                break;

            case  WSATTR.E_ATTR7_I:
                hd.exeData.attrOriginal[6] = applyRateValue(hd.exeData.attrOriginal[6].Get(), tLevel[i], i);
                hd.exeData.attr[6]         = hd.exeData.attrOriginal[6];
                break;

            case  WSATTR.T_ATTR1_I:
                hd.targetAttr[0] = applyRateValue(hd.targetAttr[0].Get(), tLevel[i], i);
                break;

            case  WSATTR.T_ATTR2_I:
                hd.targetAttr[1] = applyRateValue(hd.targetAttr[1].Get(), tLevel[i], i);
                break;

            case  WSATTR.SUCCESS_CHANCE_1_I:
                hd.successChance[0] = applyRateValueToArray(hd.successChance[0], tLevel[i], i);
                break;

            case  WSATTR.E1_ATTR1_I:
                hd.skillEffects[0].attr[0] = applyRateValueToArray(hd.skillEffects[0].attr[0], tLevel[i], i);
                break;

            case  WSATTR.E1_ATTR2_I:
                hd.skillEffects[0].attr[1] = applyRateValueToArray(hd.skillEffects[0].attr[1], tLevel[i], i);
                break;

            case  WSATTR.SUCCESS_CHANCE_2_I:
                hd.successChance[1] = applyRateValueToArray(hd.successChance[1], tLevel[i], i);
                break;

            case  WSATTR.E2_ATTR1_I:
                hd.skillEffects[1].attr[0] = applyRateValueToArray(hd.skillEffects[1].attr[0], tLevel[i], i);
                break;

            case  WSATTR.E2_ATTR2_I:
                hd.skillEffects[1].attr[1] = applyRateValueToArray(hd.skillEffects[1].attr[1], tLevel[i], i);
                break;


            case  WSATTR.SUCCESS_CHANCE_3_I:
                hd.successChance[2] = applyRateValueToArray(hd.successChance[2], tLevel[i], i);
                break;

            case  WSATTR.E3_ATTR1_I:
                hd.skillEffects[2].attr[0] = applyRateValueToArray(hd.skillEffects[2].attr[0], tLevel[i], i);
                break;

            case  WSATTR.E3_ATTR2_I:
                hd.skillEffects[2].attr[1] = applyRateValueToArray(hd.skillEffects[2].attr[1], tLevel[i], i);
                break;

            case  WSATTR.SUCCESS_CHANCE_4_I:
                hd.successChance[3] = applyRateValueToArray(hd.successChance[3], tLevel[i], i);
                break;

            case  WSATTR.E4_ATTR1_I:
                hd.skillEffects[3].attr[0] = applyRateValueToArray(hd.skillEffects[3].attr[0], tLevel[i], i);
                break;

            case  WSATTR.E4_ATTR2_I:
                hd.skillEffects[3].attr[1] = applyRateValueToArray(hd.skillEffects[3].attr[1], tLevel[i], i);
                break;
            }
        }
    }
示例#10
0
 public void loadEffectFromHeroSkillData(HeroSkillData hd)
 {
     loadEffectByBulletPatternIdAndAttackType(hd.resource, hd.exeData.type);
     loadEffectFromSkillEffect(hd.skillEffects);
 }