q
@@ -13,7 +13,7 @@
|
||||
</descriptions>
|
||||
<options>
|
||||
<li>
|
||||
<label>请求协助</label>
|
||||
<label>再见</label>
|
||||
<useCustomColors>true</useCustomColors>
|
||||
<normalColor>(255,255,255,255)</normalColor>
|
||||
<hoverColor>(157,201,185,195)</hoverColor>
|
||||
@@ -23,24 +23,6 @@
|
||||
<li>
|
||||
<effects>
|
||||
<li Class="WulaFallenEmpire.Effect_CloseDialog" />
|
||||
<li Class="WulaFallenEmpire.Effect_TriggerRaid">
|
||||
<letterLabel>增援</letterLabel>
|
||||
<letterText>乌拉帝国 行星封锁机关的一支分队正在接近。</letterText>
|
||||
<points>10000</points>
|
||||
<faction>Wula_PIA_Legion_Faction</faction>
|
||||
<raidStrategy>ImmediateAttack</raidStrategy>
|
||||
<raidArrivalMode>EdgeDrop</raidArrivalMode>
|
||||
<groupKind>Combat</groupKind>
|
||||
<pawnGroupMakers>
|
||||
<li>
|
||||
<kindDef>Combat</kindDef>
|
||||
<commonality>100</commonality>
|
||||
<options>
|
||||
<Wula_PawnKind>10</Wula_PawnKind>
|
||||
</options>
|
||||
</li>
|
||||
</pawnGroupMakers>
|
||||
</li>
|
||||
</effects>
|
||||
</li>
|
||||
</optionEffects>
|
||||
@@ -91,4 +73,4 @@
|
||||
</li>
|
||||
</options>
|
||||
</WulaFallenEmpire.EventDef>
|
||||
</Defs>
|
||||
</Defs>
|
||||
@@ -180,6 +180,17 @@
|
||||
<offDays>8</offDays>
|
||||
<numIncidentsRange>1</numIncidentsRange>
|
||||
</li>
|
||||
|
||||
<li Class="WulaFallenEmpire.StorytellerComp_SingleOnceFixed_FactionFilter">
|
||||
<incident>WULA_GiveQuest_Intro_Spy</incident>
|
||||
<fireAfterDaysPassed>6</fireAfterDaysPassed>
|
||||
<excludedFactionTypes>
|
||||
<li>WULA_Awakened_Synth</li>
|
||||
</excludedFactionTypes>
|
||||
<!-- <allowedFactionTypes>
|
||||
<li>WULA_Awakened_Synth</li>
|
||||
</allowedFactionTypes> -->
|
||||
</li>
|
||||
</comps>
|
||||
</StorytellerDef>
|
||||
</Defs>
|
||||
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 20 KiB |
@@ -0,0 +1,63 @@
|
||||
using System.Collections.Generic;
|
||||
using RimWorld;
|
||||
using Verse;
|
||||
|
||||
namespace WulaFallenEmpire
|
||||
{
|
||||
public class StorytellerComp_SingleOnceFixed_FactionFilter : StorytellerComp_SingleOnceFixed
|
||||
{
|
||||
private StorytellerCompProperties_SingleOnceFixed_FactionFilter PropsFilter => (StorytellerCompProperties_SingleOnceFixed_FactionFilter)props;
|
||||
|
||||
public override IEnumerable<FiringIncident> MakeIntervalIncidents(IIncidentTarget target)
|
||||
{
|
||||
// 检查派系过滤条件
|
||||
if (!CheckFactionFilter())
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
// 调用父类的逻辑
|
||||
foreach (var incident in base.MakeIntervalIncidents(target))
|
||||
{
|
||||
yield return incident;
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckFactionFilter()
|
||||
{
|
||||
if (Faction.OfPlayer == null)
|
||||
return false;
|
||||
|
||||
var playerFactionDef = Faction.OfPlayer.def;
|
||||
|
||||
// 优先检查白名单:如果白名单有内容,只有白名单内的派系才能触发
|
||||
if (PropsFilter.allowedFactionTypes != null && PropsFilter.allowedFactionTypes.Count > 0)
|
||||
{
|
||||
return PropsFilter.allowedFactionTypes.Contains(playerFactionDef);
|
||||
}
|
||||
|
||||
// 然后检查黑名单:如果黑名单有内容,黑名单内的派系不能触发
|
||||
if (PropsFilter.excludedFactionTypes != null && PropsFilter.excludedFactionTypes.Count > 0)
|
||||
{
|
||||
return !PropsFilter.excludedFactionTypes.Contains(playerFactionDef);
|
||||
}
|
||||
|
||||
// 如果既没有白名单也没有黑名单,所有派系都能触发
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class StorytellerCompProperties_SingleOnceFixed_FactionFilter : StorytellerCompProperties_SingleOnceFixed
|
||||
{
|
||||
// 黑名单:这些派系类型不会触发事件
|
||||
public List<FactionDef> excludedFactionTypes;
|
||||
|
||||
// 白名单:只有这些派系类型会触发事件(优先级高于黑名单)
|
||||
public List<FactionDef> allowedFactionTypes;
|
||||
|
||||
public StorytellerCompProperties_SingleOnceFixed_FactionFilter()
|
||||
{
|
||||
compClass = typeof(StorytellerComp_SingleOnceFixed_FactionFilter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -207,6 +207,7 @@
|
||||
<Compile Include="Stat\StatWorker_Energy.cs" />
|
||||
<Compile Include="Stat\StatWorker_Maintenance.cs" />
|
||||
<Compile Include="Stat\StatWorker_NanoRepair.cs" />
|
||||
<Compile Include="Storyteller\StorytellerComp_SingleOnceFixed_FactionFilter.cs" />
|
||||
<Compile Include="ThingComp\CompAndPatch_GiveHediffOnShot.cs" />
|
||||
<Compile Include="ThingComp\CompApparelInterceptor.cs" />
|
||||
<Compile Include="ThingComp\CompPsychicScaling.cs" />
|
||||
|
||||