Exemple #1
0
        public bool SetSelectObjsAtk(PeEntity npc, AttackType type)
        {
            AddSelectObjsAtk(npc, FilterAtkObjs(type, npc.GetEquipObjs(EeqSelect.combat)));

            ItemObject curobj = npc.motionEquipment.PEHoldAbleEqObj;
            EeqSelect  curEq  = SelectItem.GetEquipSelect(curobj);

            bool IsNeedTakeOff = (curobj != null && curobj.protoData.weaponInfo != null && curobj.protoData.weaponInfo.attackModes[0].type == AttackType.Ranged) ? true : false;
            bool canAttack     = SelectItem.EquipCanAttack(npc, curobj);

            if (IsNeedTakeOff && !canAttack)
            {
                SelectItem.TakeOffEquip(npc);
            }

            if (curEq == EeqSelect.combat && curobj.protoData.weaponInfo.attackModes[0].type == type && canAttack)
            {
                AddSeclectObjAtk(curobj);
            }

            return(_hasSelectsAtkEq.Count > 0);
        }
Exemple #2
0
        public ItemObject GetBetterAtkObj(PeEntity npc, Enemy enemy)
        {
            List <EvaluateInfo> infos = EvaluateMgr.Evaluates(npc, enemy, _hasSelectsAtkEq);

            if (infos == null || infos.Count <= 0)
            {
                //在水中需要收回当前装备的武器(如果远程 INFOS可能是0个,此时应用拳头)
                if (npc.biologyViewCmpt != null && !npc.biologyViewCmpt.monoPhyCtrl.Equals(null) && npc.biologyViewCmpt.monoPhyCtrl.feetInWater)
                {
                    SelectItem.TakeOffEquip(npc);
                }

                return(null);
            }
            ;
            if (infos.Count == 1)
            {
                _BetterAtkObj = infos[0].ItemObj;
                return(_BetterAtkObj);
            }

            EvaluateInfo tmpInfo = infos[0];

            for (int i = 1; i < infos.Count; i++)
            {
                if (tmpInfo.EvaluateValue < infos[i].EvaluateValue)
                {
                    tmpInfo = infos[i];
                }

                EvaluateMgr.Recyle(infos[i]);
            }

            _BetterAtkObj = tmpInfo.ItemObj;
            return(_BetterAtkObj);
        }