Beispiel #1
0
        public static void RearmAllTraps()
        {
            int num;
            int num2;
            int num3;

            TrapUtils.GetRearmAllTrapsCost(out num, out num2, out num3);
            if (!GameUtils.CanAffordCredits(num) || !GameUtils.CanAffordMaterials(num2) || !GameUtils.CanAffordContraband(num3))
            {
                int    arg_51_0 = num;
                int    arg_51_1 = num2;
                int    arg_51_2 = num3;
                string arg_51_3 = "Rearm_All_Traps";
                if (TrapUtils.< > f__mg$cache0 == null)
                {
                    TrapUtils.< > f__mg$cache0 = new OnScreenModalResult(TrapUtils.OnPayMeForCurrencyResultForMultiTrap);
                }
                PayMeScreen.ShowIfNotEnoughCurrency(arg_51_0, arg_51_1, arg_51_2, arg_51_3, TrapUtils.< > f__mg$cache0);
                return;
            }
            List <SmartEntity> rearmableTraps = TrapUtils.GetRearmableTraps();
            int i     = 0;
            int count = rearmableTraps.Count;

            while (i < count)
            {
                TrapUtils.RearmTrapForClient(rearmableTraps[i]);
                i++;
            }
            TrapUtils.SendRearmTrapServerCommand(rearmableTraps);
        }
Beispiel #2
0
        public static void GetRearmAllTrapsCost(out int creditsCost, out int materialsCost, out int contrabandCost)
        {
            creditsCost    = 0;
            materialsCost  = 0;
            contrabandCost = 0;
            StaticDataController staticDataController = Service.StaticDataController;
            List <SmartEntity>   rearmableTraps       = TrapUtils.GetRearmableTraps();
            int i     = 0;
            int count = rearmableTraps.Count;

            while (i < count)
            {
                TrapTypeVO trapTypeVO = staticDataController.Get <TrapTypeVO>(rearmableTraps[i].BuildingComp.BuildingType.TrapUid);
                creditsCost    += trapTypeVO.RearmCreditsCost;
                materialsCost  += trapTypeVO.RearmMaterialsCost;
                contrabandCost += trapTypeVO.RearmContrabandCost;
                i++;
            }
        }
Beispiel #3
0
        public static void RearmAllTraps()
        {
            int credits;
            int materials;
            int contraband;

            TrapUtils.GetRearmAllTrapsCost(out credits, out materials, out contraband);
            if (!GameUtils.CanAffordCredits(credits) || !GameUtils.CanAffordMaterials(materials) || !GameUtils.CanAffordContraband(contraband))
            {
                PayMeScreen.ShowIfNotEnoughCurrency(credits, materials, contraband, "Rearm_All_Traps", new OnScreenModalResult(TrapUtils.OnPayMeForCurrencyResultForMultiTrap));
                return;
            }
            List <Entity> rearmableTraps = TrapUtils.GetRearmableTraps();
            int           i     = 0;
            int           count = rearmableTraps.Count;

            while (i < count)
            {
                TrapUtils.RearmTrapForClient(rearmableTraps[i]);
                i++;
            }
            TrapUtils.SendRearmTrapServerCommand(rearmableTraps);
        }
Beispiel #4
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(TrapUtils.GetRearmableTraps()));
 }