public PowerInfo(ExportEntry export, bool isCorrectedPackage) { PowerName = export.ObjectName; if (!MapPowerType(export) && !IsWhitelistedPower(export)) { // Whitelisted powers bypass this check // Powers that do not list a capability type are subclasses. We will not support using these IsUsable = false; return; } if (!IsWhitelistedPower(PowerName) && // Forced blacklist after whitelist ( PowerName.Contains("Ammo") || PowerName.Contains("Base") || PowerName.Contains("FirstAid") || PowerName.Contains("Player") || PowerName.Contains("GunshipRocket") || (PowerName.Contains("NPC") && PowerName != "SFXPower_CombatDrone_NPC") || // this technically should be used, but too lazy to write algo to figure it out PowerName.Contains("Player") || PowerName.Contains("Zaeed") || // Only use player version. The normal one doesn't throw the grenade PowerName.Contains("HuskTesla") || PowerName.Contains("Kasumi") || // Depends on her AI PowerName.Contains("CombatDroneDeath") || // Crashes the game PowerName.Contains("DeathChoir") || // Buggy on non-praetorian, maybe crashes game? PowerName.Contains("Varren") || // Don't use this PowerName.Contains("Lift_TwrMwA") || // Not sure what this does, but culling itCrashes the game, maybe PowerName.Contains("Crush") || // Don't let enemies use this, it won't do anything useful for the most part PowerName == "SFXPower_MechDog" || // dunno what this is PowerName == "SFXPower_CombatDroneAttack" || // Combat drone only PowerName == "SFXPower_HeavyMechExplosion" || // This is not actually used and doesn't seem to work but is on some pawns PowerName == "SFXPower_CombatDrone" || // Player version is way too OP. Enforce NPC version PowerName.Contains("Dominate") // This is pointless against player squad ) ) { IsUsable = false; return; // Do not use ammo or base powers as they're player only in the usable code } PackageFileName = Path.GetFileName(export.FileRef.FilePath); PackageName = export.ParentName; SourceUIndex = export.UIndex; var hasShaderCache = export.FileRef.FindExport("SeekFreeShaderCache") != null; RequiresStartupPackage = hasShaderCache && !export.FileRef.FilePath.Contains("Startup", StringComparison.InvariantCultureIgnoreCase); ImportOnly = hasShaderCache; IsCorrectedPackage = isCorrectedPackage; if (hasShaderCache && !IsWhitelistedPower(export)) { IsUsable = false; // only allow whitelisted DLC powers } SetupDependencies(export); }
public Talent(ExportEntry powerClass, bool isEvolution = false) { PowerExport = powerClass; IsEvolution = isEvolution; var baseClass = powerClass; var baseClassObj = baseClass.GetDefaults().GetProperty <ObjectProperty>("EvolvedPowerClass1"); while (baseClassObj == null || baseClassObj.Value == 0) { baseClass = (ExportEntry)baseClass.SuperClass; baseClassObj = baseClass.GetDefaults().GetProperty <ObjectProperty>("EvolvedPowerClass1"); } BasePower = baseClass; if (BasePower.ObjectName.Name.Contains("Passive")) { IsPassive = true; } else { var baseName = baseClass.GetDefaults().GetProperty <NameProperty>("BaseName"); while (baseName == null) { baseClass = (ExportEntry)baseClass.SuperClass; baseName = baseClass.GetDefaults().GetProperty <NameProperty>("BaseName"); } BaseName = baseName.Value.Name; } // Setup name var superDefaults = PowerExport.GetDefaults(); var displayNameProps = superDefaults.GetProperties(); var superProps = displayNameProps; var displayName = superProps.GetProp <StringRefProperty>("DisplayName"); while (displayName == null) { superDefaults = ((superDefaults.Class as ExportEntry).SuperClass as ExportEntry).GetDefaults(); superProps = superDefaults.GetProperties(); superProps.GetProp <StringRefProperty>("DisplayName"); displayName = superProps.GetProp <StringRefProperty>("DisplayName"); } PowerName = TLKHandler.TLKLookupByLang(displayName.Value, "INT"); if (IsEvolution) { // Setup the blurb var blurbDesc = TLKHandler.TLKLookupByLang(displayNameProps.GetProp <StringRefProperty>("TalentDescription").Value, "INT").Split('\n')[0]; EvolvedBlurb = $"{PowerName}: {blurbDesc}"; } IsAmmoPower = PowerName.Contains("Ammo"); IsCombatPower = !IsAmmoPower && !IsPassive; }