ExcludeMinionsFromResurrection Mod Call

This commit is contained in:
Dominic authored and Cameron Ewell committed 2021-01-31 14:40:04 -05:00
1 parent a8d876f364
commit e50ced3688
1 file changed
+11
+11
View File
@@ -4,6 +4,8 @@ using CalamityMod.Items;
using CalamityMod.Projectiles;
using CalamityMod.World;
using System;
using System.Collections.Generic;
using System.Linq;
using Terraria;
namespace CalamityMod
@@ -1749,6 +1751,15 @@ namespace CalamityMod
}
return eventActive;
case "ExcludeMinionsFromResurrection":
// This assumes all arguments after the calling command name are projectile types.
IEnumerable<object> secondaryArguments = args.Skip(1);
if (secondaryArguments.Any(argument => !(argument is int)))
return new ArgumentException("ERROR: All arguments after the calling command to \"ExcludeMinionsFromResurrection\" must be ints.");
CalamityLists.MinionsToNotResurrectList.AddRange(secondaryArguments.Select(argument => Convert.ToInt32(argument)));
break;
default:
return new ArgumentException("ERROR: Invalid method name.");
}