예제 #1
0
    /** 判断是否有单个物品位置(核心) */
    protected override bool doHasItemPlaceC(int id, int num, ItemData data)
    {
        ItemConfig config;

        if (data != null)
        {
            data.makeConfig();
            config = data.config;
        }
        else
        {
            config = ItemConfig.get(id);
        }

        //自动使用道具
        if (config.type == ItemType.Tool && config.passEnterBag)
        {
            return(true);
        }

        int totalNum = _itemNums.get(id);

        //超出总上限
        if (config.totalPlusMax > 0 && (totalNum + num) > config.totalPlusMax)
        {
            return(false);
        }

        return(true);
    }
예제 #2
0
파일: Unit.cs 프로젝트: shineTeam7/home3
    public void makeSimpleUnitData(UnitSimpleData re)
    {
        re.instanceID = instanceID;
        re.identity   = (UnitIdentityData)_data.identity.clone();

        if (re.pos == null)
        {
            re.pos = (UnitPosData)_data.pos.clone();
        }
        else
        {
            re.pos.copy(_data.pos);
        }

        if (re.attributes == null)
        {
            re.attributes = new IntIntMap();
        }
        else
        {
            re.attributes.clear();
        }

        if (_data.fight != null)
        {
            IntIntMap dic = _data.fight.attributes;

            foreach (int k in AttributeControl.attribute.simpleUnitList)
            {
                re.attributes.put(k, dic.get(k));
            }
        }
    }
예제 #3
0
 /** 获取某页数据(调用) */
 private void getOnePage(int page)
 {
     /** 未到时间 */
     if (_lockDic.get(page) > 0)
     {
         _needSendSet.add(page);
     }
     else
     {
         _lockDic.put(page, Global.pageToolShowCD);
         sendGet(page);
     }
 }
예제 #4
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        UnitAvatarData mData = (UnitAvatarData)data;

        if (this.modelID != mData.modelID)
        {
            return(false);
        }

        if (mData.parts != null)
        {
            if (this.parts == null)
            {
                return(false);
            }
            if (this.parts.size() != mData.parts.size())
            {
                return(false);
            }
            IntIntMap partsR = mData.parts;
            if (!this.parts.isEmpty())
            {
                int   partsKFreeValue = this.parts.getFreeValue();
                int[] partsKKeys      = this.parts.getKeys();
                int[] partsVValues    = this.parts.getValues();
                for (int partsKI = partsKKeys.Length - 1; partsKI >= 0; --partsKI)
                {
                    int partsK = partsKKeys[partsKI];
                    if (partsK != partsKFreeValue)
                    {
                        int partsV = partsVValues[partsKI];
                        int partsU = partsR.get(partsK);
                        if (partsV != partsU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.parts != null)
            {
                return(false);
            }
        }

        return(true);
    }
예제 #5
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        if (!base.toDataEquals(data))
        {
            return(false);
        }

        GameAuctionToolData mData = (GameAuctionToolData)data;

        if (mData.itemPriceDic != null)
        {
            if (this.itemPriceDic == null)
            {
                return(false);
            }
            if (this.itemPriceDic.size() != mData.itemPriceDic.size())
            {
                return(false);
            }
            IntIntMap itemPriceDicR = mData.itemPriceDic;
            if (!this.itemPriceDic.isEmpty())
            {
                int   itemPriceDicKFreeValue = this.itemPriceDic.getFreeValue();
                int[] itemPriceDicKKeys      = this.itemPriceDic.getKeys();
                int[] itemPriceDicVValues    = this.itemPriceDic.getValues();
                for (int itemPriceDicKI = itemPriceDicKKeys.Length - 1; itemPriceDicKI >= 0; --itemPriceDicKI)
                {
                    int itemPriceDicK = itemPriceDicKKeys[itemPriceDicKI];
                    if (itemPriceDicK != itemPriceDicKFreeValue)
                    {
                        int itemPriceDicV = itemPriceDicVValues[itemPriceDicKI];
                        int itemPriceDicU = itemPriceDicR.get(itemPriceDicK);
                        if (itemPriceDicV != itemPriceDicU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.itemPriceDic != null)
            {
                return(false);
            }
        }

        return(true);
    }
예제 #6
0
    /** 移除特效 */
    public void removeEffect(int id)
    {
        int num = _effectNumDic.get(id);

        if (num <= 0)
        {
            return;
        }

        _effectNumDic.put(id, --num);

        EffectConfig config = EffectConfig.get(id);

        //还超
        if (config.plusMax > 0 && num >= config.plusMax)
        {
            return;
        }

        SList <UnitEffect> unitEffects = _effectList;
        UnitEffect         effect;

        for (int i = 0, len = unitEffects.length(); i < len; ++i)
        {
            effect = unitEffects[i];

            //是
            if (effect.id == id)
            {
                unitEffects.remove(i);
                effect.dispose();
                GameC.pool.unitEffectPool.back(effect);
                break;
            }
        }
    }
예제 #7
0
    protected void modelLoadOver(GameObject obj)
    {
        if (!_unit.enabled)
        {
            return;
        }

        _modelReady = true;

        onModelLoadOver(_showModelID, obj);

        foreach (var kv in _partReady.entrySet())
        {
            onPartLoadOver(kv.key, _partDic.get(kv.key), kv.value);
        }
    }
예제 #8
0
    /** 设置职位 */
    public void setTitle(long memberID, int title)
    {
        int canSetTitle = RoleGroupTitleConfig.get(_selfData.title).canSetTitle;

        if (canSetTitle <= 0 || canSetTitle > title)
        {
            me.warnLog("设置职位时,没有权限", _selfData.title, title);
            return;
        }

        PlayerRoleGroupMemberData member = getMember(memberID);

        if (member == null)
        {
            me.warnLog("设置职位时,找不到目标成员", memberID);
            return;
        }

        if (member.title == RoleGroupTitleType.Leader || title == RoleGroupTitleType.Leader)
        {
            me.warnLog("设置职位时,不能设置队长", memberID, title);
            return;
        }

        if (member.title < canSetTitle)
        {
            me.warnLog("设置职位时,没有权限2", _selfData.title, member.title);
            return;
        }

        if (member.title == title)
        {
            me.warnLog("设置职位时,当前已是该职位", _selfData.title, member.title);
            return;
        }

        int num = RoleGroupTitleConfig.get(title).num;

        //超过数目
        if (num > 0 && _memberTitleCount.get(title) >= num)
        {
            me.warnLog("设置职位时,超过容纳数目", title);
            return;
        }

        me.send(FuncSetTitleRoleGroupRequest.create(_funcID, groupID, memberID, title));
    }
예제 #9
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        RoleAttributeData mData = (RoleAttributeData)data;

        if (mData.attributes != null)
        {
            if (this.attributes == null)
            {
                return(false);
            }
            if (this.attributes.size() != mData.attributes.size())
            {
                return(false);
            }
            IntIntMap attributesR = mData.attributes;
            if (!this.attributes.isEmpty())
            {
                int   attributesKFreeValue = this.attributes.getFreeValue();
                int[] attributesKKeys      = this.attributes.getKeys();
                int[] attributesVValues    = this.attributes.getValues();
                for (int attributesKI = attributesKKeys.Length - 1; attributesKI >= 0; --attributesKI)
                {
                    int attributesK = attributesKKeys[attributesKI];
                    if (attributesK != attributesKFreeValue)
                    {
                        int attributesV = attributesVValues[attributesKI];
                        int attributesU = attributesR.get(attributesK);
                        if (attributesV != attributesU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.attributes != null)
            {
                return(false);
            }
        }

        return(true);
    }
예제 #10
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        MUnitCacheData mData = (MUnitCacheData)data;

        if (mData.currentAttributes != null)
        {
            if (this.currentAttributes == null)
            {
                return(false);
            }
            if (this.currentAttributes.size() != mData.currentAttributes.size())
            {
                return(false);
            }
            IntIntMap currentAttributesR = mData.currentAttributes;
            if (!this.currentAttributes.isEmpty())
            {
                int   currentAttributesKFreeValue = this.currentAttributes.getFreeValue();
                int[] currentAttributesKKeys      = this.currentAttributes.getKeys();
                int[] currentAttributesVValues    = this.currentAttributes.getValues();
                for (int currentAttributesKI = currentAttributesKKeys.Length - 1; currentAttributesKI >= 0; --currentAttributesKI)
                {
                    int currentAttributesK = currentAttributesKKeys[currentAttributesKI];
                    if (currentAttributesK != currentAttributesKFreeValue)
                    {
                        int currentAttributesV = currentAttributesVValues[currentAttributesKI];
                        int currentAttributesU = currentAttributesR.get(currentAttributesK);
                        if (currentAttributesV != currentAttributesU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.currentAttributes != null)
            {
                return(false);
            }
        }

        if (mData.buffs != null)
        {
            if (this.buffs == null)
            {
                return(false);
            }
            if (this.buffs.size() != mData.buffs.size())
            {
                return(false);
            }
            IntObjectMap <BuffData> buffsR = mData.buffs;
            if (!this.buffs.isEmpty())
            {
                int        buffsKFreeValue = this.buffs.getFreeValue();
                int[]      buffsKKeys      = this.buffs.getKeys();
                BuffData[] buffsVValues    = this.buffs.getValues();
                for (int buffsKI = buffsKKeys.Length - 1; buffsKI >= 0; --buffsKI)
                {
                    int buffsK = buffsKKeys[buffsKI];
                    if (buffsK != buffsKFreeValue)
                    {
                        BuffData buffsV = buffsVValues[buffsKI];
                        BuffData buffsU = buffsR.get(buffsK);
                        if (buffsU != null)
                        {
                            if (buffsV == null)
                            {
                                return(false);
                            }
                            if (!buffsV.dataEquals(buffsU))
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            if (buffsV != null)
                            {
                                return(false);
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if (this.buffs != null)
            {
                return(false);
            }
        }

        if (mData.cds != null)
        {
            if (this.cds == null)
            {
                return(false);
            }
            if (this.cds.size() != mData.cds.size())
            {
                return(false);
            }
            IntObjectMap <CDData> cdsR = mData.cds;
            if (!this.cds.isEmpty())
            {
                int      cdsKFreeValue = this.cds.getFreeValue();
                int[]    cdsKKeys      = this.cds.getKeys();
                CDData[] cdsVValues    = this.cds.getValues();
                for (int cdsKI = cdsKKeys.Length - 1; cdsKI >= 0; --cdsKI)
                {
                    int cdsK = cdsKKeys[cdsKI];
                    if (cdsK != cdsKFreeValue)
                    {
                        CDData cdsV = cdsVValues[cdsKI];
                        CDData cdsU = cdsR.get(cdsK);
                        if (cdsU != null)
                        {
                            if (cdsV == null)
                            {
                                return(false);
                            }
                            if (!cdsV.dataEquals(cdsU))
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            if (cdsV != null)
                            {
                                return(false);
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if (this.cds != null)
            {
                return(false);
            }
        }

        if (this.cacheTime != mData.cacheTime)
        {
            return(false);
        }

        return(true);
    }
예제 #11
0
    private CDData toStartOneCD(CDConfig config, int time)
    {
        int id = config.id;
        int groupChangePercent = 0;
        int groupChangeValue   = 0;

        //千分比和数值均累加
        foreach (int gv in config.groups)
        {
            groupChangePercent += _groupCDChangePercents.get(gv);
            groupChangeValue   += _groupCDChangeValues.get(gv);
        }

        int timeMax = (int)(time * ((1000f + groupChangePercent) / 1000f) + groupChangeValue);

        CDData data = null;

        if (timeMax > 0)
        {
            CDData oldData;

            if ((oldData = _cds.get(id)) == null)
            {
                data        = new CDData();
                data.id     = id;
                data.config = config;

                _cds.put(data.id, data);
            }
            else
            {
                data = oldData;
            }

            data.timePass = 0;
            data.timeMax  = timeMax;

            foreach (int gv in config.groups)
            {
                //计数加1
                if (oldData == null)
                {
                    _groupCDCount.addValue(gv, 1);
                }

                CDData oldMax = _groupMaxCDs.get(gv);

                if (oldMax == null || oldMax.getLastTime() < timeMax)
                {
                    _groupMaxCDs.put(gv, data);
                }

                //新的
                if (oldMax == null)
                {
                    _parent.onStartGroupCD(gv);
                }
            }
        }

        return(data);
    }
예제 #12
0
    /** 增加当前组CD时间经过(cd减少) */
    public void addGroupTimePass(int groupID, int value)
    {
        if (value == 0)
        {
            return;
        }

        if (_cds.isEmpty())
        {
            return;
        }

        bool has = false;
        //只添加,触发还是基于onTen

        IntIntMap groupCDCount = _groupCDCount;

        bool needReCount = false;

        CDData[] values = _cds.getValues();
        CDData   data;
        int      vv;

        for (int i = values.Length - 1; i >= 0; --i)
        {
            if ((data = values[i]) != null)
            {
                if (data.config.hasGroup(groupID))
                {
                    has = true;

                    vv = (data.timePass) + value;

                    if (vv > data.timeMax)
                    {
                        vv = data.timeMax;
                    }

                    if (vv < 0)
                    {
                        vv = 0;
                    }

                    data.timePass = vv;

                    if (data.config.groups.Length > 1)
                    {
                        foreach (int gv in data.config.groups)
                        {
                            if (gv != groupID)
                            {
                                //不止这个
                                if (groupCDCount.get(gv) > 1)
                                {
                                    needReCount = true;
                                }
                            }
                        }
                    }
                }
            }
        }

        if (has)
        {
            if (needReCount)
            {
                reCountGroupCDMax();
            }

            _parent.onCDChange();
        }
    }
예제 #13
0
 /** 获取某probID的使用技能几率值 */
 public int getUseSkillProb(int probID)
 {
     return(SkillProbConfig.get(probID).value + _skillProbChanges.get(probID));
 }
예제 #14
0
    private BuffData addOneBuff(int id, int level, int adderInstanceID, BuffData eData)
    {
        BuffConfig config = BuffConfig.get(id);

        //先看忽略
        foreach (int v in config.groups)
        {
            if (_ignoreBuffGroupDic.get(v) > 0)
            {
                return(null);
            }
        }

        BuffData re;
        BuffData oldData;
        BuffData data;

        switch (config.plusType)
        {
        case BuffPlusType.Normal:
        {
            if ((oldData = _buffDatasByID.get(id)) != null)
            {
                //新的等级更高
                if (level > oldData.level)
                {
                    toRemoveBuff(oldData);
                    toAddBuff(re = toCreateBuff(id, level, adderInstanceID, eData));
                }
                else
                {
                    toRefreshBuff(re = oldData);
                }
            }
            else
            {
                toAddBuff(re = toCreateBuff(id, level, adderInstanceID, eData));
            }
        }
        break;

        case BuffPlusType.Replace:
        {
            if ((oldData = _buffDatasByID.get(id)) != null)
            {
                toRemoveBuff(oldData);
            }

            toAddBuff(re = toCreateBuff(id, level, adderInstanceID, eData));
        }
        break;

        case BuffPlusType.AllExist:
        {
            IntObjectMap <BuffData> dic = _buffDatasForAllExist.get(id);

            if (dic == null)
            {
                toAddBuff(re = toCreateBuff(id, level, adderInstanceID, eData));
            }
            else
            {
                if (config.plusMax > 0 && dic.size() >= config.plusMax)
                {
                    BuffData temp = null;

                    BuffData[] values = dic.getValues();

                    for (int i = values.Length - 1; i >= 0; --i)
                    {
                        if ((data = values[i]) != null)
                        {
                            if (temp == null)
                            {
                                temp = data;
                            }
                            else if (data.instanceID < temp.instanceID)                                  //更小
                            {
                                temp = data;
                            }
                        }
                    }

                    //删了最早的
                    if (temp != null)
                    {
                        toRemoveBuff(temp);
                    }
                }

                toAddBuff(re = toCreateBuff(id, level, adderInstanceID, eData));
            }
        }

        break;

        case BuffPlusType.AddFloor:
        {
            if ((oldData = _buffDatasByID.get(id)) != null)
            {
                //新的等级更高
                if (level > oldData.level)
                {
                    toRemoveBuff(oldData);
                    re = toCreateBuff(id, level, adderInstanceID, eData);
                    //继承层数
                    re.lastNum = oldData.lastNum;

                    toAddBuff(re);
                }
                else
                {
                    //没满级
                    if (oldData.lastNum < config.plusMax)
                    {
                        //加
                        oldData.lastNum++;

                        refreshOneBuffAttributeVar(oldData);

                        //刷新buff时间
                        toRefreshBuff(re = oldData);

                        //到达上限
                        if (oldData.lastNum == config.plusMax)
                        {
                            doPlusMaxActions(oldData);
                        }
                    }
                    else
                    {
                        re = oldData;

                        if (oldData.levelConfig.lastTime > 0)
                        {
                            //刷新buff时间
                            toRefreshBuff(oldData);
                        }
                    }
                }
            }
            else
            {
                toAddBuff(re = toCreateBuff(id, level, adderInstanceID, eData));
            }
        }
        break;

        default:
        {
            re = null;
            Ctrl.throwError("不支持的buff plusType", config.plusType);
        }
        break;
        }

        return(re);
    }
예제 #15
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        KeepSaveData mData = (KeepSaveData)data;

        if (mData.booleanDic != null)
        {
            if (this.booleanDic == null)
            {
                return(false);
            }
            if (this.booleanDic.size() != mData.booleanDic.size())
            {
                return(false);
            }
            IntBooleanMap booleanDicR = mData.booleanDic;
            if (!this.booleanDic.isEmpty())
            {
                int    booleanDicKFreeValue = this.booleanDic.getFreeValue();
                int[]  booleanDicKKeys      = this.booleanDic.getKeys();
                bool[] booleanDicVValues    = this.booleanDic.getValues();
                for (int booleanDicKI = booleanDicKKeys.Length - 1; booleanDicKI >= 0; --booleanDicKI)
                {
                    int booleanDicK = booleanDicKKeys[booleanDicKI];
                    if (booleanDicK != booleanDicKFreeValue)
                    {
                        bool booleanDicV = booleanDicVValues[booleanDicKI];
                        bool booleanDicU = booleanDicR.get(booleanDicK);
                        if (booleanDicV != booleanDicU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.booleanDic != null)
            {
                return(false);
            }
        }

        if (mData.intDic != null)
        {
            if (this.intDic == null)
            {
                return(false);
            }
            if (this.intDic.size() != mData.intDic.size())
            {
                return(false);
            }
            IntIntMap intDicR = mData.intDic;
            if (!this.intDic.isEmpty())
            {
                int   intDicKFreeValue = this.intDic.getFreeValue();
                int[] intDicKKeys      = this.intDic.getKeys();
                int[] intDicVValues    = this.intDic.getValues();
                for (int intDicKI = intDicKKeys.Length - 1; intDicKI >= 0; --intDicKI)
                {
                    int intDicK = intDicKKeys[intDicKI];
                    if (intDicK != intDicKFreeValue)
                    {
                        int intDicV = intDicVValues[intDicKI];
                        int intDicU = intDicR.get(intDicK);
                        if (intDicV != intDicU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.intDic != null)
            {
                return(false);
            }
        }

        if (mData.longDic != null)
        {
            if (this.longDic == null)
            {
                return(false);
            }
            if (this.longDic.size() != mData.longDic.size())
            {
                return(false);
            }
            IntLongMap longDicR = mData.longDic;
            if (!this.longDic.isEmpty())
            {
                int    longDicKFreeValue = this.longDic.getFreeValue();
                int[]  longDicKKeys      = this.longDic.getKeys();
                long[] longDicVValues    = this.longDic.getValues();
                for (int longDicKI = longDicKKeys.Length - 1; longDicKI >= 0; --longDicKI)
                {
                    int longDicK = longDicKKeys[longDicKI];
                    if (longDicK != longDicKFreeValue)
                    {
                        long longDicV = longDicVValues[longDicKI];
                        long longDicU = longDicR.get(longDicK);
                        if (longDicV != longDicU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.longDic != null)
            {
                return(false);
            }
        }

        if (mData.stringDic != null)
        {
            if (this.stringDic == null)
            {
                return(false);
            }
            if (this.stringDic.size() != mData.stringDic.size())
            {
                return(false);
            }
            SMap <string, string> stringDicR = mData.stringDic;
            if (!this.stringDic.isEmpty())
            {
                string[] stringDicKKeys   = this.stringDic.getKeys();
                string[] stringDicVValues = this.stringDic.getValues();
                for (int stringDicKI = stringDicKKeys.Length - 1; stringDicKI >= 0; --stringDicKI)
                {
                    string stringDicK = stringDicKKeys[stringDicKI];
                    if (stringDicK != null)
                    {
                        string stringDicV = stringDicVValues[stringDicKI];
                        string stringDicU = stringDicR.get(stringDicK);
                        if (stringDicV != stringDicU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.stringDic != null)
            {
                return(false);
            }
        }

        return(true);
    }
예제 #16
0
    /** 是否可穿戴装备 */
    public bool canPutOnEquip(int slot, ItemData data, bool needNotice)
    {
        if (!isSlotEnabled(slot))
        {
            if (needNotice)
            {
                me.warnLog("装备位置未开放", slot);
            }

            return(false);
        }

        if (data.config.type != ItemType.Equip)
        {
            if (needNotice)
            {
                me.warnLog("不是装备", data.id);
            }

            return(false);
        }

        if (getEquip(slot) != null)
        {
            if (needNotice)
            {
                me.warnLog("装备位置已存在", slot);
            }

            return(false);
        }

        if (data.config.isUnique && _equipNumDic.get(data.id) > 0)
        {
            if (needNotice)
            {
                me.warnLog("已存在唯一装备", data.id);
            }

            return(false);
        }

        //类型不匹配
        if (EquipSlotTypeConfig.get(slot).equipType != data.config.secondType)
        {
            if (needNotice)
            {
                me.warnLog("装备类型不匹配", data.id);
            }

            return(false);
        }

        //不满足使用条件
        if (!me.role.checkRoleConditions(data.config.useConditions, needNotice))
        {
            return(false);
        }

        return(true);
    }
예제 #17
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        UnitFightData mData = (UnitFightData)data;

        if (mData.status != null)
        {
            if (this.status == null)
            {
                return(false);
            }
            if (this.status.size() != mData.status.size())
            {
                return(false);
            }
            IntBooleanMap statusR = mData.status;
            if (!this.status.isEmpty())
            {
                int    statusKFreeValue = this.status.getFreeValue();
                int[]  statusKKeys      = this.status.getKeys();
                bool[] statusVValues    = this.status.getValues();
                for (int statusKI = statusKKeys.Length - 1; statusKI >= 0; --statusKI)
                {
                    int statusK = statusKKeys[statusKI];
                    if (statusK != statusKFreeValue)
                    {
                        bool statusV = statusVValues[statusKI];
                        bool statusU = statusR.get(statusK);
                        if (statusV != statusU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.status != null)
            {
                return(false);
            }
        }

        if (mData.attributes != null)
        {
            if (this.attributes == null)
            {
                return(false);
            }
            if (this.attributes.size() != mData.attributes.size())
            {
                return(false);
            }
            IntIntMap attributesR = mData.attributes;
            if (!this.attributes.isEmpty())
            {
                int   attributesKFreeValue = this.attributes.getFreeValue();
                int[] attributesKKeys      = this.attributes.getKeys();
                int[] attributesVValues    = this.attributes.getValues();
                for (int attributesKI = attributesKKeys.Length - 1; attributesKI >= 0; --attributesKI)
                {
                    int attributesK = attributesKKeys[attributesKI];
                    if (attributesK != attributesKFreeValue)
                    {
                        int attributesV = attributesVValues[attributesKI];
                        int attributesU = attributesR.get(attributesK);
                        if (attributesV != attributesU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.attributes != null)
            {
                return(false);
            }
        }

        if (mData.skills != null)
        {
            if (this.skills == null)
            {
                return(false);
            }
            if (this.skills.size() != mData.skills.size())
            {
                return(false);
            }
            IntObjectMap <SkillData> skillsR = mData.skills;
            if (!this.skills.isEmpty())
            {
                int         skillsKFreeValue = this.skills.getFreeValue();
                int[]       skillsKKeys      = this.skills.getKeys();
                SkillData[] skillsVValues    = this.skills.getValues();
                for (int skillsKI = skillsKKeys.Length - 1; skillsKI >= 0; --skillsKI)
                {
                    int skillsK = skillsKKeys[skillsKI];
                    if (skillsK != skillsKFreeValue)
                    {
                        SkillData skillsV = skillsVValues[skillsKI];
                        SkillData skillsU = skillsR.get(skillsK);
                        if (skillsU != null)
                        {
                            if (skillsV == null)
                            {
                                return(false);
                            }
                            if (!skillsV.dataEquals(skillsU))
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            if (skillsV != null)
                            {
                                return(false);
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if (this.skills != null)
            {
                return(false);
            }
        }

        if (mData.buffs != null)
        {
            if (this.buffs == null)
            {
                return(false);
            }
            if (this.buffs.size() != mData.buffs.size())
            {
                return(false);
            }
            IntObjectMap <BuffData> buffsR = mData.buffs;
            if (!this.buffs.isEmpty())
            {
                int        buffsKFreeValue = this.buffs.getFreeValue();
                int[]      buffsKKeys      = this.buffs.getKeys();
                BuffData[] buffsVValues    = this.buffs.getValues();
                for (int buffsKI = buffsKKeys.Length - 1; buffsKI >= 0; --buffsKI)
                {
                    int buffsK = buffsKKeys[buffsKI];
                    if (buffsK != buffsKFreeValue)
                    {
                        BuffData buffsV = buffsVValues[buffsKI];
                        BuffData buffsU = buffsR.get(buffsK);
                        if (buffsU != null)
                        {
                            if (buffsV == null)
                            {
                                return(false);
                            }
                            if (!buffsV.dataEquals(buffsU))
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            if (buffsV != null)
                            {
                                return(false);
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if (this.buffs != null)
            {
                return(false);
            }
        }

        if (mData.cds != null)
        {
            if (this.cds == null)
            {
                return(false);
            }
            if (this.cds.size() != mData.cds.size())
            {
                return(false);
            }
            IntObjectMap <CDData> cdsR = mData.cds;
            if (!this.cds.isEmpty())
            {
                int      cdsKFreeValue = this.cds.getFreeValue();
                int[]    cdsKKeys      = this.cds.getKeys();
                CDData[] cdsVValues    = this.cds.getValues();
                for (int cdsKI = cdsKKeys.Length - 1; cdsKI >= 0; --cdsKI)
                {
                    int cdsK = cdsKKeys[cdsKI];
                    if (cdsK != cdsKFreeValue)
                    {
                        CDData cdsV = cdsVValues[cdsKI];
                        CDData cdsU = cdsR.get(cdsK);
                        if (cdsU != null)
                        {
                            if (cdsV == null)
                            {
                                return(false);
                            }
                            if (!cdsV.dataEquals(cdsU))
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            if (cdsV != null)
                            {
                                return(false);
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if (this.cds != null)
            {
                return(false);
            }
        }

        return(true);
    }
예제 #18
0
    /** 获取某技能的替换ID(没有返回原ID) */
    public int getSkillReplaceID(int skillID)
    {
        int re = _skillReplaceDic.get(skillID);

        return(re > 0 ? re : skillID);
    }
예제 #19
0
    //hit

    /** 打击每帧 */
    protected void bulletHitFrame()
    {
        if (_config.attackID <= 0)
        {
            return;
        }

        //自己不能控制伤害
        if (!_unit.isSelfDriveAttackHapen())
        {
            return;
        }

        //不该走到这里
        if (BaseC.constlist.bulletCast_isSimpleBullet(_levelConfig.castType))
        {
            return;
        }

        SList <Unit> tempUnitList;

        getFrameHittedUnits(tempUnitList = _tempUnitList);

        if (tempUnitList.isEmpty())
        {
            return;
        }

        //是否可吸收
        bool canAbsorb = !_config.cantAbsorb;

        int eachHitMax      = _levelConfig.eachHitNum;
        int maxInfluenceNum = _levelConfig.maxInfluenceNum;

        IntIntMap hitTargetNums = _hitTargetNums;

        foreach (Unit unit in tempUnitList)
        {
            int instanceID = unit.instanceID;

            //打击次数内
            if (eachHitMax == 0 || hitTargetNums.get(instanceID) < eachHitMax)
            {
                //吸收子弹
                if (canAbsorb && unit.fight.getStatusLogic().getStatus(StatusType.AbsorbBullet))
                {
                    bulletOverInitiative();
                    return;
                }

                if (_hitEnabled)
                {
                    AttackData aData = _unit.fight.createAttackData(_config.attackID, _data.level, SkillTargetData.createByTargetUnit(instanceID));

                    aData.isBulletFirstHit = hitTargetNums.isEmpty();

                    hitTargetNums.addValue(instanceID, 1);

                    _scene.fight.executeAndReleaseAttack(aData);

                    //到达上限了
                    if (maxInfluenceNum > 0 && hitTargetNums.size() >= maxInfluenceNum)
                    {
                        _hitEnabled = false;

                        if (!_config.keepAtMaxHit)
                        {
                            bulletOverInitiative();
                        }

                        return;
                    }
                }
            }
        }

        _tempUnitList.clear();
    }
예제 #20
0
    /// <summary>
    /// 是否数据一致
    /// </summary>
    protected override bool toDataEquals(BaseData data)
    {
        QuestPartData mData = (QuestPartData)data;

        if (this.clientTaskInstanceIDIndex != mData.clientTaskInstanceIDIndex)
        {
            return(false);
        }

        if (mData.accepts != null)
        {
            if (this.accepts == null)
            {
                return(false);
            }
            if (this.accepts.size() != mData.accepts.size())
            {
                return(false);
            }
            IntObjectMap <QuestData> acceptsR = mData.accepts;
            if (!this.accepts.isEmpty())
            {
                int         acceptsKFreeValue = this.accepts.getFreeValue();
                int[]       acceptsKKeys      = this.accepts.getKeys();
                QuestData[] acceptsVValues    = this.accepts.getValues();
                for (int acceptsKI = acceptsKKeys.Length - 1; acceptsKI >= 0; --acceptsKI)
                {
                    int acceptsK = acceptsKKeys[acceptsKI];
                    if (acceptsK != acceptsKFreeValue)
                    {
                        QuestData acceptsV = acceptsVValues[acceptsKI];
                        QuestData acceptsU = acceptsR.get(acceptsK);
                        if (acceptsU != null)
                        {
                            if (acceptsV == null)
                            {
                                return(false);
                            }
                            if (!acceptsV.dataEquals(acceptsU))
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            if (acceptsV != null)
                            {
                                return(false);
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if (this.accepts != null)
            {
                return(false);
            }
        }

        if (mData.completeLines != null)
        {
            if (this.completeLines == null)
            {
                return(false);
            }
            if (this.completeLines.size() != mData.completeLines.size())
            {
                return(false);
            }
            IntIntMap completeLinesR = mData.completeLines;
            if (!this.completeLines.isEmpty())
            {
                int   completeLinesKFreeValue = this.completeLines.getFreeValue();
                int[] completeLinesKKeys      = this.completeLines.getKeys();
                int[] completeLinesVValues    = this.completeLines.getValues();
                for (int completeLinesKI = completeLinesKKeys.Length - 1; completeLinesKI >= 0; --completeLinesKI)
                {
                    int completeLinesK = completeLinesKKeys[completeLinesKI];
                    if (completeLinesK != completeLinesKFreeValue)
                    {
                        int completeLinesV = completeLinesVValues[completeLinesKI];
                        int completeLinesU = completeLinesR.get(completeLinesK);
                        if (completeLinesV != completeLinesU)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.completeLines != null)
            {
                return(false);
            }
        }

        if (mData.completeIDs != null)
        {
            if (this.completeIDs == null)
            {
                return(false);
            }
            if (this.completeIDs.size() != mData.completeIDs.size())
            {
                return(false);
            }
            IntSet completeIDsR = mData.completeIDs;
            if (!this.completeIDs.isEmpty())
            {
                int   completeIDsVFreeValue = this.completeIDs.getFreeValue();
                int[] completeIDsVKeys      = this.completeIDs.getKeys();
                for (int completeIDsVI = completeIDsVKeys.Length - 1; completeIDsVI >= 0; --completeIDsVI)
                {
                    int completeIDsV = completeIDsVKeys[completeIDsVI];
                    if (completeIDsV != completeIDsVFreeValue)
                    {
                        if (!completeIDsR.contains(completeIDsV))
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
            if (this.completeIDs != null)
            {
                return(false);
            }
        }

        if (mData.completeQuestsDic != null)
        {
            if (this.completeQuestsDic == null)
            {
                return(false);
            }
            if (this.completeQuestsDic.size() != mData.completeQuestsDic.size())
            {
                return(false);
            }
            IntObjectMap <QuestCompleteData> completeQuestsDicR = mData.completeQuestsDic;
            if (!this.completeQuestsDic.isEmpty())
            {
                int   completeQuestsDicKFreeValue            = this.completeQuestsDic.getFreeValue();
                int[] completeQuestsDicKKeys                 = this.completeQuestsDic.getKeys();
                QuestCompleteData[] completeQuestsDicVValues = this.completeQuestsDic.getValues();
                for (int completeQuestsDicKI = completeQuestsDicKKeys.Length - 1; completeQuestsDicKI >= 0; --completeQuestsDicKI)
                {
                    int completeQuestsDicK = completeQuestsDicKKeys[completeQuestsDicKI];
                    if (completeQuestsDicK != completeQuestsDicKFreeValue)
                    {
                        QuestCompleteData completeQuestsDicV = completeQuestsDicVValues[completeQuestsDicKI];
                        QuestCompleteData completeQuestsDicU = completeQuestsDicR.get(completeQuestsDicK);
                        if (completeQuestsDicU != null)
                        {
                            if (completeQuestsDicV == null)
                            {
                                return(false);
                            }
                            if (!completeQuestsDicV.dataEquals(completeQuestsDicU))
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            if (completeQuestsDicV != null)
                            {
                                return(false);
                            }
                        }
                    }
                }
            }
        }
        else
        {
            if (this.completeQuestsDic != null)
            {
                return(false);
            }
        }

        return(true);
    }