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 RearmSingleTrap(SmartEntity selectedBuilding) { bool flag = TrapUtils.RearmTrapForClient(selectedBuilding); if (flag) { TrapUtils.SendRearmTrapServerCommand(new List <SmartEntity> { selectedBuilding }); } }
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 $Invoke9(long instance, long *args) { return(GCHandledObjects.ObjectToGCHandle(TrapUtils.RearmTrapForClient((Entity)GCHandledObjects.GCHandleToObject(*args)))); }