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); }
public static void OnPayMeForCurrencyResultForMultiTrap(object result, object cookie) { if (GameUtils.HandleSoftCurrencyFlow(result, cookie)) { TrapUtils.RearmAllTraps(); } }
public static void OnPayMeForCurrencyResultSingleTrap(object result, object cookie) { SmartEntity selectedBuilding = Service.BuildingController.SelectedBuilding; if (GameUtils.HandleSoftCurrencyFlow(result, cookie)) { TrapUtils.RearmSingleTrap(selectedBuilding); } }
public static void RearmSingleTrap(SmartEntity selectedBuilding) { bool flag = TrapUtils.RearmTrapForClient(selectedBuilding); if (flag) { TrapUtils.SendRearmTrapServerCommand(new List <SmartEntity> { selectedBuilding }); } }
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++; } }
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); }
public unsafe static long $Invoke10(long instance, long *args) { TrapUtils.SendRearmTrapServerCommand((List <Entity>)GCHandledObjects.GCHandleToObject(*args)); return(-1L); }
public unsafe static long $Invoke9(long instance, long *args) { return(GCHandledObjects.ObjectToGCHandle(TrapUtils.RearmTrapForClient((Entity)GCHandledObjects.GCHandleToObject(*args)))); }
public unsafe static long $Invoke8(long instance, long *args) { TrapUtils.RearmSingleTrap((Entity)GCHandledObjects.GCHandleToObject(*args)); return(-1L); }
public unsafe static long $Invoke7(long instance, long *args) { TrapUtils.RearmAllTraps(); return(-1L); }
public unsafe static long $Invoke6(long instance, long *args) { return(GCHandledObjects.ObjectToGCHandle(TrapUtils.ParseEventData((TrapEventType)(*(int *)args), Marshal.PtrToStringUni(*(IntPtr *)(args + 1))))); }
public unsafe static long $Invoke5(long instance, long *args) { return(GCHandledObjects.ObjectToGCHandle(TrapUtils.ParseConditions(Marshal.PtrToStringUni(*(IntPtr *)args)))); }
public unsafe static long $Invoke3(long instance, long *args) { TrapUtils.OnPayMeForCurrencyResultSingleTrap(GCHandledObjects.GCHandleToObject(*args), GCHandledObjects.GCHandleToObject(args[1])); return(-1L); }
public unsafe static long $Invoke1(long instance, long *args) { return(GCHandledObjects.ObjectToGCHandle(TrapUtils.IsCurrentPlayerInDefensiveBattle((IState)GCHandledObjects.GCHandleToObject(*args)))); }
public unsafe static long $Invoke0(long instance, long *args) { return(GCHandledObjects.ObjectToGCHandle(TrapUtils.GetRearmableTraps())); }