Exemple #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);
        }
Exemple #2
0
 public static void OnPayMeForCurrencyResultForMultiTrap(object result, object cookie)
 {
     if (GameUtils.HandleSoftCurrencyFlow(result, cookie))
     {
         TrapUtils.RearmAllTraps();
     }
 }
Exemple #3
0
        public static void OnPayMeForCurrencyResultSingleTrap(object result, object cookie)
        {
            SmartEntity selectedBuilding = Service.BuildingController.SelectedBuilding;

            if (GameUtils.HandleSoftCurrencyFlow(result, cookie))
            {
                TrapUtils.RearmSingleTrap(selectedBuilding);
            }
        }
Exemple #4
0
        public static void RearmSingleTrap(SmartEntity selectedBuilding)
        {
            bool flag = TrapUtils.RearmTrapForClient(selectedBuilding);

            if (flag)
            {
                TrapUtils.SendRearmTrapServerCommand(new List <SmartEntity>
                {
                    selectedBuilding
                });
            }
        }
Exemple #5
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++;
            }
        }
Exemple #6
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);
        }
Exemple #7
0
 public unsafe static long $Invoke10(long instance, long *args)
 {
     TrapUtils.SendRearmTrapServerCommand((List <Entity>)GCHandledObjects.GCHandleToObject(*args));
     return(-1L);
 }
Exemple #8
0
 public unsafe static long $Invoke9(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(TrapUtils.RearmTrapForClient((Entity)GCHandledObjects.GCHandleToObject(*args))));
 }
Exemple #9
0
 public unsafe static long $Invoke8(long instance, long *args)
 {
     TrapUtils.RearmSingleTrap((Entity)GCHandledObjects.GCHandleToObject(*args));
     return(-1L);
 }
Exemple #10
0
 public unsafe static long $Invoke7(long instance, long *args)
 {
     TrapUtils.RearmAllTraps();
     return(-1L);
 }
Exemple #11
0
 public unsafe static long $Invoke6(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(TrapUtils.ParseEventData((TrapEventType)(*(int *)args), Marshal.PtrToStringUni(*(IntPtr *)(args + 1)))));
 }
Exemple #12
0
 public unsafe static long $Invoke5(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(TrapUtils.ParseConditions(Marshal.PtrToStringUni(*(IntPtr *)args))));
 }
Exemple #13
0
 public unsafe static long $Invoke3(long instance, long *args)
 {
     TrapUtils.OnPayMeForCurrencyResultSingleTrap(GCHandledObjects.GCHandleToObject(*args), GCHandledObjects.GCHandleToObject(args[1]));
     return(-1L);
 }
Exemple #14
0
 public unsafe static long $Invoke1(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(TrapUtils.IsCurrentPlayerInDefensiveBattle((IState)GCHandledObjects.GCHandleToObject(*args))));
 }
Exemple #15
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(TrapUtils.GetRearmableTraps()));
 }