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)); }