Пример #1
0
        public override bool SupplySth(PeEntity entity, CSAssembly asAssembly)
        {
            // check self
            float _curOwn = entity.GetAttribute(AttribType.Energy);

            if (_curOwn > Energy_Percent_min)
            {
                return(false);
            }

            //check package
            List <ItemObject> objs = entity.GetEquipObjs(EeqSelect.energy);

            if (objs != null && objs.Count > 0)
            {
                for (int i = 0; i < objs.Count; i++)
                {
                    Energy energy = objs[i].GetCmpt <Energy>();
                    if (energy != null && energy.floatValue.percent > Energy_Percent_min)
                    {
                        return(false);
                    }
                }
            }

            //find In csstorage
            return(NpcSupply.CsStrargeSupplyExchangeBattery(entity, asAssembly, objs, costId, Energy_num));
        }
Пример #2
0
        public override bool SupplySth(PeEntity entity, CSAssembly asAssembly)
        {
            // find in package
            int _curOwn = entity.GetItemCount(costId);

            if (_curOwn > BULLET_Supply_min)
            {
                return(false);
            }

            //find In csstorage
            return(NpcSupply.CsStorageSupply(entity, asAssembly, costId, BULLET_Supply_once));
        }
Пример #3
0
        public void OnCSAttackEnmey(PeEntity entity, PeEntity enmey)
        {
            bool canAttcak = PETools.PEUtil.CanAttackReputation(entity, enmey);

            if (canAttcak)
            {
                mCSnpcTeam.OnAlertInform(enmey);

                if (mCScreator != null)
                {
                    NpcSupply.SupplyNpcsByCSAssembly(mCSNpcs, mCScreator.Assembly, ESupplyType.Ammo);
                }
            }
        }