diff --git a/1.6/1.6/Assemblies/ArachnaeSwarm.dll b/1.6/1.6/Assemblies/ArachnaeSwarm.dll index 6215955..b51d6a3 100644 Binary files a/1.6/1.6/Assemblies/ArachnaeSwarm.dll and b/1.6/1.6/Assemblies/ArachnaeSwarm.dll differ diff --git a/1.6/1.6/Defs/AbilityDefs/Ability_Flyover.xml b/1.6/1.6/Defs/AbilityDefs/Ability_Flyover.xml index 33c8711..07f2d42 100644 --- a/1.6/1.6/Defs/AbilityDefs/Ability_Flyover.xml +++ b/1.6/1.6/Defs/AbilityDefs/Ability_Flyover.xml @@ -1,10 +1,9 @@ - ARA_SpawnFlyOverTest - - 测试召唤不同类型的飞越物体 + + 召唤虫巢母舰,启动攻击事件链(测试用) ArachnaeSwarm/UI/Abilities/ARA_Ability_Morph 1 Misc12 @@ -33,11 +32,10 @@ - ARA_Spawn_ARA_HiveCorvette_Rocket - 召唤天巫种兽虫,高速掠过战场,使用其迅捷天灾炮对目标区域发起打击。在飞行期间,它会使用血链棘刺炮打击遇到的敌人。 + 召唤天巫种兽虫,高速掠过战场,使用其迅捷天灾炮对目标区域发起打击。\n\n在飞行期间,它会使用血链棘刺炮打击遇到的敌人,由于攻击区间较少,血链棘刺炮只能打击前7个遇到的目标。 ArachnaeSwarm/UI/Abilities/ARA_Ability_Morph 1 Misc12 @@ -84,11 +82,10 @@ - ARA_Spawn_ARA_HiveCorvette_Bombardment - - 召唤天巫种兽虫,慢速掠过战场,对大范围目标区域进行酸团轰炸。在飞行期间,它会使用血链棘刺炮打击遇到的敌人。 + + 召唤天巫种兽虫,慢速掠过战场,对大范围目标区域进行酸团轰炸。\n\n在飞行期间,它会使用血链棘刺炮打击遇到的所有敌人。 ArachnaeSwarm/UI/Abilities/ARA_Ability_Morph 1 Misc12 @@ -106,6 +103,11 @@ +
  • + ARA_HiveCorvette_Entity + 120 + 1 +
  • ARA_HiveCorvette_Bombardment GroundStrafing diff --git a/1.6/1.6/Defs/Thing_Misc/ARA_Flyover_Item.xml b/1.6/1.6/Defs/Thing_Misc/ARA_Flyover_Item.xml index 46cfda6..2a3ae99 100644 --- a/1.6/1.6/Defs/Thing_Misc/ARA_Flyover_Item.xml +++ b/1.6/1.6/Defs/Thing_Misc/ARA_Flyover_Item.xml @@ -1,5 +1,79 @@ + + ARA_HiveCorvette_Building + + 天巫种兽虫 + Building_PassengerShuttle + true + Building + 50 + true + PassThroughOnly + 0.5 + (5,5) + true + (0.56, 0.62, 0.9) + 1 + + ArachnaeSwarm/FlyOverThing/ARA_HiveCorvette_Shadow + Graphic_Single + TransparentPostLight + (5,5) + (195,195,195,255) + + + 600 + 0.5 + 36000 + 125 + 0.65 + + Normal + ARA_Buildings + 6 + + 250 + 150 + 6 + 1 + + true + + + true + false + East + true + Light + BulletImpact_Metal + true + RealtimeOnly + ConstructMetal + true + + BuildingDestroyed_Metal_Big + true + true + + +
  • + ARA_HiveCorvette_Entity + 1 + PassengerShuttleLeaving +
  • +
    + +
  • PlaceWorker_NotUnderRoof
  • +
    + 2600 + + + ARA_HiveCorvette_Entity + + 什么?这是个记录数量用的thingdef,你不应该在任何场合下看到这个。 + + ARA_HiveShip diff --git a/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/.suo b/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/.suo index d72ac2a..8a0f789 100644 Binary files a/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/.suo and b/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/.suo differ diff --git a/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/DocumentLayout.json b/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/DocumentLayout.json index a08cb2d..b60b58f 100644 --- a/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/DocumentLayout.json +++ b/Source/ArachnaeSwarm/.vs/ArachnaeSwarm/v17/DocumentLayout.json @@ -1,41 +1,57 @@ { "Version": 1, - "WorkspaceRootPath": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\", + "WorkspaceRootPath": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\", "Documents": [ { - "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|e:\\steamlibrary\\steamapps\\common\\rimworld\\mods\\arachnaeswarm\\source\\arachnaeswarm\\flyover\\ara_sectorsurveillance\\compsectorsurveillance.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|d:\\steamlibrary\\steamapps\\common\\rimworld\\mods\\arachnaeswarm\\source\\arachnaeswarm\\flyover\\ara_aircrafthangar\\worldcomponent_aircraftmanager.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:flyover\\ara_aircrafthangar\\worldcomponent_aircraftmanager.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|d:\\steamlibrary\\steamapps\\common\\rimworld\\mods\\arachnaeswarm\\source\\arachnaeswarm\\flyover\\ara_aircrafthangar\\compaircrafthangar.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:flyover\\ara_aircrafthangar\\compaircrafthangar.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|d:\\steamlibrary\\steamapps\\common\\rimworld\\mods\\arachnaeswarm\\source\\arachnaeswarm\\flyover\\ara_aircrafthangar\\compabilityeffect_aircraftstrike.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:flyover\\ara_aircrafthangar\\compabilityeffect_aircraftstrike.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|d:\\steamlibrary\\steamapps\\common\\rimworld\\mods\\arachnaeswarm\\source\\arachnaeswarm\\building_comps\\comprefuelablenutrition.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:building_comps\\comprefuelablenutrition.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|d:\\steamlibrary\\steamapps\\common\\rimworld\\mods\\arachnaeswarm\\source\\arachnaeswarm\\flyover\\ara_sectorsurveillance\\compsectorsurveillance.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:flyover\\ara_sectorsurveillance\\compsectorsurveillance.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, { - "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\ara_groundstrafing\\compgroundstrafing.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:flyover\\ara_groundstrafing\\compgroundstrafing.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\thingclassflyover.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\thingclassflyover.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:flyover\\thingclassflyover.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, { - "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\ara_spawnflyover\\compabilityeffect_spawnflyover.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\ara_spawnflyover\\compabilityeffect_spawnflyover.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:flyover\\ara_spawnflyover\\compabilityeffect_spawnflyover.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, { - "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\ara_spawnflyover\\compproperties_abilityspawnflyover.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|d:\\steamlibrary\\steamapps\\common\\rimworld\\mods\\arachnaeswarm\\source\\arachnaeswarm\\flyover\\ara_spawnflyover\\compproperties_abilityspawnflyover.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:flyover\\ara_spawnflyover\\compproperties_abilityspawnflyover.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, { - "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\ara_flyoverescort\\compflyoverescort.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\ara_groundstrafing\\compgroundstrafing.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:flyover\\ara_groundstrafing\\compgroundstrafing.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\ara_flyoverescort\\compflyoverescort.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:flyover\\ara_flyoverescort\\compflyoverescort.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, { - "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\ara_flyoverescort\\compproperties_flyoverescort.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\ara_flyoverescort\\compproperties_flyoverescort.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:flyover\\ara_flyoverescort\\compproperties_flyoverescort.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, { - "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\ara_shipartillery\\compshipartillery.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\ara_shipartillery\\compshipartillery.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:flyover\\ara_shipartillery\\compshipartillery.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, { - "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\ara_shipartillery\\compproperties_shipartillery.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "AbsoluteMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\flyover\\ara_shipartillery\\compproperties_shipartillery.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{EAE0DB6B-E282-C812-7F5A-6D13E9D24581}|ArachnaeSwarm.csproj|solutionrelative:flyover\\ara_shipartillery\\compproperties_shipartillery.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" } ], @@ -46,81 +62,135 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 1, + "SelectedChildIndex": 4, "Children": [ { "$type": "Bookmark", "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" }, + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "CompAircraftHangar.cs", + "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_AircraftHangar\\CompAircraftHangar.cs", + "RelativeDocumentMoniker": "Flyover\\ARA_AircraftHangar\\CompAircraftHangar.cs", + "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_AircraftHangar\\CompAircraftHangar.cs", + "RelativeToolTip": "Flyover\\ARA_AircraftHangar\\CompAircraftHangar.cs", + "ViewState": "AgIAAEoAAAAAAAAAAAAswFkAAAAdAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-10-29T06:31:52.619Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 3, + "Title": "CompRefuelableNutrition.cs", + "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Building_Comps\\CompRefuelableNutrition.cs", + "RelativeDocumentMoniker": "Building_Comps\\CompRefuelableNutrition.cs", + "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Building_Comps\\CompRefuelableNutrition.cs", + "RelativeToolTip": "Building_Comps\\CompRefuelableNutrition.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAAUAAAAXAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-10-29T06:31:46.148Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "CompAbilityEffect_AircraftStrike.cs", + "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_AircraftHangar\\CompAbilityEffect_AircraftStrike.cs", + "RelativeDocumentMoniker": "Flyover\\ARA_AircraftHangar\\CompAbilityEffect_AircraftStrike.cs", + "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_AircraftHangar\\CompAbilityEffect_AircraftStrike.cs", + "RelativeToolTip": "Flyover\\ARA_AircraftHangar\\CompAbilityEffect_AircraftStrike.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAACMAAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-10-29T06:30:49.523Z", + "EditorCaption": "" + }, { "$type": "Document", "DocumentIndex": 0, + "Title": "WorldComponent_AircraftManager.cs", + "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_AircraftHangar\\WorldComponent_AircraftManager.cs", + "RelativeDocumentMoniker": "Flyover\\ARA_AircraftHangar\\WorldComponent_AircraftManager.cs", + "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_AircraftHangar\\WorldComponent_AircraftManager.cs", + "RelativeToolTip": "Flyover\\ARA_AircraftHangar\\WorldComponent_AircraftManager.cs", + "ViewState": "AgIAAKsAAAAAAAAAAAAowBEAAAASAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-10-29T06:30:44.854Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 4, "Title": "CompSectorSurveillance.cs", - "DocumentMoniker": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_SectorSurveillance\\CompSectorSurveillance.cs", + "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_SectorSurveillance\\CompSectorSurveillance.cs", "RelativeDocumentMoniker": "Flyover\\ARA_SectorSurveillance\\CompSectorSurveillance.cs", - "ToolTip": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_SectorSurveillance\\CompSectorSurveillance.cs", + "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_SectorSurveillance\\CompSectorSurveillance.cs", "RelativeToolTip": "Flyover\\ARA_SectorSurveillance\\CompSectorSurveillance.cs", - "ViewState": "AgIAAAAAAAAAAAAAAAAAACwCAAAOAAAAAAAAAA==", + "ViewState": "AgIAAMYAAAAAAAAAAAAqwNUAAAARAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2025-10-29T02:30:42.063Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 1, + "DocumentIndex": 8, "Title": "CompGroundStrafing.cs", - "DocumentMoniker": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_GroundStrafing\\CompGroundStrafing.cs", + "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_GroundStrafing\\CompGroundStrafing.cs", "RelativeDocumentMoniker": "Flyover\\ARA_GroundStrafing\\CompGroundStrafing.cs", - "ToolTip": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_GroundStrafing\\CompGroundStrafing.cs", + "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_GroundStrafing\\CompGroundStrafing.cs", "RelativeToolTip": "Flyover\\ARA_GroundStrafing\\CompGroundStrafing.cs", "ViewState": "AgIAAB0AAAAAAAAAAAAQwCYAAABFAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2025-10-28T16:19:23.118Z", + "WhenOpened": "2025-10-28T16:19:23.118Z" + }, + { + "$type": "Document", + "DocumentIndex": 6, + "Title": "CompAbilityEffect_SpawnFlyOver.cs", + "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_SpawnFlyOver\\CompAbilityEffect_SpawnFlyOver.cs", + "RelativeDocumentMoniker": "Flyover\\ARA_SpawnFlyOver\\CompAbilityEffect_SpawnFlyOver.cs", + "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_SpawnFlyOver\\CompAbilityEffect_SpawnFlyOver.cs", + "RelativeToolTip": "Flyover\\ARA_SpawnFlyOver\\CompAbilityEffect_SpawnFlyOver.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAABYAAABOAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-10-28T14:51:14.836Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 3, - "Title": "CompAbilityEffect_SpawnFlyOver.cs", - "DocumentMoniker": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_SpawnFlyOver\\CompAbilityEffect_SpawnFlyOver.cs", - "RelativeDocumentMoniker": "Flyover\\ARA_SpawnFlyOver\\CompAbilityEffect_SpawnFlyOver.cs", - "ToolTip": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_SpawnFlyOver\\CompAbilityEffect_SpawnFlyOver.cs", - "RelativeToolTip": "Flyover\\ARA_SpawnFlyOver\\CompAbilityEffect_SpawnFlyOver.cs", - "ViewState": "AgIAAAAAAAAAAAAAAAAAABYAAABOAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2025-10-28T14:51:14.836Z" - }, - { - "$type": "Document", - "DocumentIndex": 4, + "DocumentIndex": 7, "Title": "CompProperties_AbilitySpawnFlyOver.cs", - "DocumentMoniker": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_SpawnFlyOver\\CompProperties_AbilitySpawnFlyOver.cs", + "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_SpawnFlyOver\\CompProperties_AbilitySpawnFlyOver.cs", "RelativeDocumentMoniker": "Flyover\\ARA_SpawnFlyOver\\CompProperties_AbilitySpawnFlyOver.cs", - "ToolTip": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_SpawnFlyOver\\CompProperties_AbilitySpawnFlyOver.cs", + "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_SpawnFlyOver\\CompProperties_AbilitySpawnFlyOver.cs", "RelativeToolTip": "Flyover\\ARA_SpawnFlyOver\\CompProperties_AbilitySpawnFlyOver.cs", "ViewState": "AgIAABgAAAAAAAAAAAAswDQAAAAAAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2025-10-28T13:51:12.201Z" - }, - { - "$type": "Document", - "DocumentIndex": 2, - "Title": "ThingclassFlyOver.cs", - "DocumentMoniker": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ThingclassFlyOver.cs", - "RelativeDocumentMoniker": "Flyover\\ThingclassFlyOver.cs", - "ToolTip": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ThingclassFlyOver.cs", - "RelativeToolTip": "Flyover\\ThingclassFlyOver.cs", - "ViewState": "AgIAAAkCAAAAAAAAAAAqwCYCAAB/AAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2025-10-28T09:09:22.03Z" + "WhenOpened": "2025-10-28T13:51:12.201Z", + "EditorCaption": "" }, { "$type": "Document", "DocumentIndex": 5, + "Title": "ThingclassFlyOver.cs", + "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ThingclassFlyOver.cs", + "RelativeDocumentMoniker": "Flyover\\ThingclassFlyOver.cs", + "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ThingclassFlyOver.cs", + "RelativeToolTip": "Flyover\\ThingclassFlyOver.cs", + "ViewState": "AgIAAAkCAAAAAAAAAAAqwCYCAAB/AAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-10-28T09:09:22.03Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 9, "Title": "CompFlyOverEscort.cs", - "DocumentMoniker": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_FlyOverEscort\\CompFlyOverEscort.cs", + "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_FlyOverEscort\\CompFlyOverEscort.cs", "RelativeDocumentMoniker": "Flyover\\ARA_FlyOverEscort\\CompFlyOverEscort.cs", - "ToolTip": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_FlyOverEscort\\CompFlyOverEscort.cs", + "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_FlyOverEscort\\CompFlyOverEscort.cs", "RelativeToolTip": "Flyover\\ARA_FlyOverEscort\\CompFlyOverEscort.cs", "ViewState": "AgIAAKYBAAAAAAAAAAAWwNEBAAAAAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", @@ -128,11 +198,11 @@ }, { "$type": "Document", - "DocumentIndex": 6, + "DocumentIndex": 10, "Title": "CompProperties_FlyOverEscort.cs", - "DocumentMoniker": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_FlyOverEscort\\CompProperties_FlyOverEscort.cs", + "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_FlyOverEscort\\CompProperties_FlyOverEscort.cs", "RelativeDocumentMoniker": "Flyover\\ARA_FlyOverEscort\\CompProperties_FlyOverEscort.cs", - "ToolTip": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_FlyOverEscort\\CompProperties_FlyOverEscort.cs", + "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_FlyOverEscort\\CompProperties_FlyOverEscort.cs", "RelativeToolTip": "Flyover\\ARA_FlyOverEscort\\CompProperties_FlyOverEscort.cs", "ViewState": "AgIAAAAAAAAAAAAAAAAAABgAAAAPAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", @@ -140,11 +210,11 @@ }, { "$type": "Document", - "DocumentIndex": 8, + "DocumentIndex": 12, "Title": "CompProperties_ShipArtillery.cs", - "DocumentMoniker": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_ShipArtillery\\CompProperties_ShipArtillery.cs", + "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_ShipArtillery\\CompProperties_ShipArtillery.cs", "RelativeDocumentMoniker": "Flyover\\ARA_ShipArtillery\\CompProperties_ShipArtillery.cs", - "ToolTip": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_ShipArtillery\\CompProperties_ShipArtillery.cs", + "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_ShipArtillery\\CompProperties_ShipArtillery.cs", "RelativeToolTip": "Flyover\\ARA_ShipArtillery\\CompProperties_ShipArtillery.cs", "ViewState": "AgIAAAAAAAAAAAAAAAAAAA8AAAAhAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", @@ -152,11 +222,11 @@ }, { "$type": "Document", - "DocumentIndex": 7, + "DocumentIndex": 11, "Title": "CompShipArtillery.cs", - "DocumentMoniker": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_ShipArtillery\\CompShipArtillery.cs", + "DocumentMoniker": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_ShipArtillery\\CompShipArtillery.cs", "RelativeDocumentMoniker": "Flyover\\ARA_ShipArtillery\\CompShipArtillery.cs", - "ToolTip": "E:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_ShipArtillery\\CompShipArtillery.cs", + "ToolTip": "D:\\SteamLibrary\\steamapps\\common\\RimWorld\\Mods\\ArachnaeSwarm\\Source\\ArachnaeSwarm\\Flyover\\ARA_ShipArtillery\\CompShipArtillery.cs", "RelativeToolTip": "Flyover\\ARA_ShipArtillery\\CompShipArtillery.cs", "ViewState": "AgIAALEAAAAAAAAAAAAywNEAAABcAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", diff --git a/Source/ArachnaeSwarm/ArachnaeSwarm.csproj b/Source/ArachnaeSwarm/ArachnaeSwarm.csproj index 4a5a491..516b680 100644 --- a/Source/ArachnaeSwarm/ArachnaeSwarm.csproj +++ b/Source/ArachnaeSwarm/ArachnaeSwarm.csproj @@ -138,6 +138,9 @@ + + + diff --git a/Source/ArachnaeSwarm/Flyover/ARA_AircraftHangar/CompAbilityEffect_AircraftStrike.cs b/Source/ArachnaeSwarm/Flyover/ARA_AircraftHangar/CompAbilityEffect_AircraftStrike.cs new file mode 100644 index 0000000..6cfeab0 --- /dev/null +++ b/Source/ArachnaeSwarm/Flyover/ARA_AircraftHangar/CompAbilityEffect_AircraftStrike.cs @@ -0,0 +1,90 @@ +using RimWorld; +using Verse; +using RimWorld.Planet; +using System.Collections.Generic; + +namespace ArachnaeSwarm +{ + public class CompProperties_AircraftStrike : CompProperties_AbilityEffect + { + public ThingDef requiredAircraftType; // 需要的战机类型 + public int aircraftCooldownTicks = 60000; // 战机冷却时间(默认1天) + public int aircraftsPerUse = 1; // 每次使用消耗的战机数量 + + public CompProperties_AircraftStrike() + { + compClass = typeof(CompAbilityEffect_AircraftStrike); + } + } + + public class CompAbilityEffect_AircraftStrike : CompAbilityEffect + { + public new CompProperties_AircraftStrike Props => (CompProperties_AircraftStrike)props; + + public override void Apply(LocalTargetInfo target, LocalTargetInfo dest) + { + base.Apply(target, dest); + + // 获取全局战机管理器 + WorldComponent_AircraftManager aircraftManager = Find.World.GetComponent(); + + if (aircraftManager == null) + { + Log.Error("Aircraft manager not found!"); + return; + } + + // 检查并消耗战机 + if (aircraftManager.TryUseAircraft(Props.requiredAircraftType, Props.aircraftsPerUse, parent.pawn.Faction, Props.aircraftCooldownTicks)) + { + // 执行打击效果 + ExecuteStrikeEffect(target); + + Messages.Message($"Aircraft strike initiated: {Props.requiredAircraftType.LabelCap}", MessageTypeDefOf.PositiveEvent); + } + else + { + Messages.Message($"No available aircraft: {Props.requiredAircraftType.LabelCap}", MessageTypeDefOf.NegativeEvent); + } + } + + private void ExecuteStrikeEffect(LocalTargetInfo target) + { + // 这里实现具体的打击效果 + // 例如:轰炸、空投、侦察等 + + // 示例:在目标位置创建爆炸效果 + GenExplosion.DoExplosion( + target.Cell, + parent.pawn.Map, + radius: 3.5f, + DamageDefOf.Bomb, + instigator: parent.pawn, + damAmount: 50 + ); + } + + public override bool CanApplyOn(LocalTargetInfo target, LocalTargetInfo dest) + { + // 检查是否有可用的战机 + WorldComponent_AircraftManager aircraftManager = Find.World.GetComponent(); + + return base.CanApplyOn(target, dest) && + aircraftManager != null && + aircraftManager.HasAvailableAircraft(Props.requiredAircraftType, Props.aircraftsPerUse, parent.pawn.Faction); + } + + public override string ExtraLabelMouseAttachment(LocalTargetInfo target) + { + WorldComponent_AircraftManager aircraftManager = Find.World.GetComponent(); + + if (aircraftManager != null) + { + int available = aircraftManager.GetAvailableAircraftCount(Props.requiredAircraftType, parent.pawn.Faction); + return $"Available {Props.requiredAircraftType.LabelCap}: {available}"; + } + + return base.ExtraLabelMouseAttachment(target); + } + } +} diff --git a/Source/ArachnaeSwarm/Flyover/ARA_AircraftHangar/CompAircraftHangar.cs b/Source/ArachnaeSwarm/Flyover/ARA_AircraftHangar/CompAircraftHangar.cs new file mode 100644 index 0000000..07a6998 --- /dev/null +++ b/Source/ArachnaeSwarm/Flyover/ARA_AircraftHangar/CompAircraftHangar.cs @@ -0,0 +1,99 @@ +using RimWorld; +using Verse; +using System.Collections.Generic; +using RimWorld.Planet; + +namespace ArachnaeSwarm +{ + public class CompProperties_AircraftHangar : CompProperties + { + public ThingDef aircraftDef; // 对应的战机定义 + public int aircraftCount = 1; // 起飞后提供的战机数量 + public ThingDef skyfallerLeaving; // 起飞时的天空坠落者效果 + + public CompProperties_AircraftHangar() + { + compClass = typeof(CompAircraftHangar); + } + } + + public class CompAircraftHangar : ThingComp + { + public CompProperties_AircraftHangar Props => (CompProperties_AircraftHangar)props; + + public override IEnumerable CompGetGizmosExtra() + { + foreach (Gizmo gizmo in base.CompGetGizmosExtra()) + { + yield return gizmo; + } + + // 起飞命令 + Command_Action launchCommand = new Command_Action + { + defaultLabel = "Launch Aircraft", + defaultDesc = "Launch aircraft for orbital support", + icon = TexCommand.Attack, + action = LaunchAircraft + }; + + // 检查条件:建筑完好 + if (parent.HitPoints <= 0) + { + launchCommand.Disable("Hangar damaged"); + } + + yield return launchCommand; + } + + private void LaunchAircraft() + { + // 获取全局战机管理器 + WorldComponent_AircraftManager aircraftManager = Find.World.GetComponent(); + + if (aircraftManager == null) + { + Log.Error("Aircraft manager not found!"); + return; + } + + // 立即向全局管理器注册战机(在创建 Skyfaller 之前) + aircraftManager.AddAircraft(Props.aircraftDef, Props.aircraftCount, parent.Faction); + + // 显示消息 + Messages.Message($"Aircraft launched: {Props.aircraftCount}x {Props.aircraftDef.LabelCap}", MessageTypeDefOf.PositiveEvent); + + // 创建起飞效果(仅视觉效果) + if (Props.skyfallerLeaving != null) + { + CreateTakeoffEffect(); + } + else + { + // 如果没有定义 Skyfaller,直接销毁建筑 + parent.Destroy(); + } + } + + private void CreateTakeoffEffect() + { + // 创建起飞天空坠落者 + Skyfaller skyfaller = SkyfallerMaker.MakeSkyfaller(Props.skyfallerLeaving, parent); + + // 设置起飞位置(建筑当前位置) + IntVec3 takeoffPos = parent.Position; + + // 生成 Skyfaller + GenSpawn.Spawn(skyfaller, takeoffPos, parent.Map); + + // 立即销毁原建筑(Skyfaller 只是视觉效果) + parent.Destroy(); + } + + public override void PostExposeData() + { + base.PostExposeData(); + // 不需要保存状态,因为建筑起飞后就销毁了 + } + } +} diff --git a/Source/ArachnaeSwarm/Flyover/ARA_AircraftHangar/WorldComponent_AircraftManager.cs b/Source/ArachnaeSwarm/Flyover/ARA_AircraftHangar/WorldComponent_AircraftManager.cs new file mode 100644 index 0000000..99c8b72 --- /dev/null +++ b/Source/ArachnaeSwarm/Flyover/ARA_AircraftHangar/WorldComponent_AircraftManager.cs @@ -0,0 +1,258 @@ +using RimWorld; +using Verse; +using System.Collections.Generic; +using RimWorld.Planet; +using System.Linq; + +namespace ArachnaeSwarm +{ + public class WorldComponent_AircraftManager : WorldComponent + { + private Dictionary> factionAircraftData = + new Dictionary>(); + + private List cooldownEvents = new List(); + + public WorldComponent_AircraftManager(World world) : base(world) { } + + // 战机派系数据类 + private class AircraftFactionData : IExposable + { + public int totalCount; // 总战机数量 + public int availableCount; // 可用战机数量 + + public void ExposeData() + { + Scribe_Values.Look(ref totalCount, "totalCount"); + Scribe_Values.Look(ref availableCount, "availableCount"); + } + } + + // 冷却事件类 + private class AircraftCooldownEvent : IExposable + { + public Faction faction; + public ThingDef aircraftDef; + public int endTick; + public int aircraftCount; // 冷却中的战机数量 + + public void ExposeData() + { + Scribe_References.Look(ref faction, "faction"); + Scribe_Defs.Look(ref aircraftDef, "aircraftDef"); + Scribe_Values.Look(ref endTick, "endTick"); + Scribe_Values.Look(ref aircraftCount, "aircraftCount"); + } + } + + // 用于序列化的包装类 + private class SerializableFactionAircraftData : IExposable + { + public Faction faction; + public ThingDef aircraftDef; + public AircraftFactionData data; + + public void ExposeData() + { + Scribe_References.Look(ref faction, "faction"); + Scribe_Defs.Look(ref aircraftDef, "aircraftDef"); + Scribe_Deep.Look(ref data, "data"); + } + } + + public override void ExposeData() + { + base.ExposeData(); + + // 保存派系战机数据 + List serializableData = new List(); + + if (Scribe.mode == LoadSaveMode.Saving) + { + // 将字典数据转换为可序列化的列表 + foreach (var factionPair in factionAircraftData) + { + foreach (var aircraftPair in factionPair.Value) + { + serializableData.Add(new SerializableFactionAircraftData + { + faction = factionPair.Key, + aircraftDef = aircraftPair.Key, + data = aircraftPair.Value + }); + } + } + } + + Scribe_Collections.Look(ref serializableData, "factionAircraftData", LookMode.Deep); + + if (Scribe.mode == LoadSaveMode.LoadingVars) + { + // 从序列化数据重建字典 + factionAircraftData.Clear(); + if (serializableData != null) + { + foreach (var item in serializableData) + { + if (item.faction != null && item.aircraftDef != null && item.data != null) + { + if (!factionAircraftData.ContainsKey(item.faction)) + { + factionAircraftData[item.faction] = new Dictionary(); + } + factionAircraftData[item.faction][item.aircraftDef] = item.data; + } + } + } + } + + // 保存冷却事件 - 显式指定泛型类型 + Scribe_Collections.Look(ref cooldownEvents, "cooldownEvents", LookMode.Deep); + } + + public override void WorldComponentTick() + { + base.WorldComponentTick(); + + // 处理冷却事件 + int currentTick = Find.TickManager.TicksAbs; + for (int i = cooldownEvents.Count - 1; i >= 0; i--) + { + AircraftCooldownEvent cooldownEvent = cooldownEvents[i]; + + if (currentTick >= cooldownEvent.endTick) + { + // 冷却结束,恢复战机可用性 + RestoreAircraftAfterCooldown(cooldownEvent); + cooldownEvents.RemoveAt(i); + } + } + } + + // 添加战机到派系 + public void AddAircraft(ThingDef aircraftDef, int count, Faction faction) + { + if (faction == null) + { + Log.Error("Attempted to add aircraft to null faction"); + return; + } + + if (!factionAircraftData.ContainsKey(faction)) + { + factionAircraftData[faction] = new Dictionary(); + } + + if (!factionAircraftData[faction].ContainsKey(aircraftDef)) + { + factionAircraftData[faction][aircraftDef] = new AircraftFactionData(); + } + + var data = factionAircraftData[faction][aircraftDef]; + data.totalCount += count; + data.availableCount += count; + } + + // 尝试使用战机 + public bool TryUseAircraft(ThingDef aircraftDef, int count, Faction faction, int cooldownTicks) + { + if (!HasAvailableAircraft(aircraftDef, count, faction)) + return false; + + var data = factionAircraftData[faction][aircraftDef]; + data.availableCount -= count; + + // 创建冷却事件 + AircraftCooldownEvent cooldownEvent = new AircraftCooldownEvent + { + faction = faction, + aircraftDef = aircraftDef, + endTick = Find.TickManager.TicksAbs + cooldownTicks, + aircraftCount = count + }; + + cooldownEvents.Add(cooldownEvent); + + return true; + } + + // 检查是否有可用战机 + public bool HasAvailableAircraft(ThingDef aircraftDef, int count, Faction faction) + { + return factionAircraftData.ContainsKey(faction) && + factionAircraftData[faction].ContainsKey(aircraftDef) && + factionAircraftData[faction][aircraftDef].availableCount >= count; + } + + // 获取可用战机数量 + public int GetAvailableAircraftCount(ThingDef aircraftDef, Faction faction) + { + if (factionAircraftData.ContainsKey(faction) && + factionAircraftData[faction].ContainsKey(aircraftDef)) + { + return factionAircraftData[faction][aircraftDef].availableCount; + } + return 0; + } + + // 获取总战机数量 + public int GetTotalAircraftCount(ThingDef aircraftDef, Faction faction) + { + if (factionAircraftData.ContainsKey(faction) && + factionAircraftData[faction].ContainsKey(aircraftDef)) + { + return factionAircraftData[faction][aircraftDef].totalCount; + } + return 0; + } + + // 冷却结束后恢复战机 + private void RestoreAircraftAfterCooldown(AircraftCooldownEvent cooldownEvent) + { + if (cooldownEvent.faction != null && + factionAircraftData.ContainsKey(cooldownEvent.faction) && + factionAircraftData[cooldownEvent.faction].ContainsKey(cooldownEvent.aircraftDef)) + { + var data = factionAircraftData[cooldownEvent.faction][cooldownEvent.aircraftDef]; + data.availableCount += cooldownEvent.aircraftCount; + + // 可选:显示冷却结束消息 + if (cooldownEvent.aircraftDef != null) + { + Messages.Message($"{cooldownEvent.aircraftDef.LabelCap} cooldown ended", MessageTypeDefOf.PositiveEvent); + } + } + } + + // 获取战机状态信息(用于调试或UI显示) + public string GetAircraftStatus(Faction faction) + { + if (!factionAircraftData.ContainsKey(faction)) + return "No aircraft"; + + var status = new List(); + foreach (var kvp in factionAircraftData[faction]) + { + var data = kvp.Value; + int inCooldown = data.totalCount - data.availableCount; + status.Add($"{kvp.Key.LabelCap}: {data.availableCount}/{data.totalCount} (In cooldown: {inCooldown})"); + } + + return string.Join("\n", status); + } + + // 获取冷却中的战机数量 + public int GetCooldownAircraftCount(ThingDef aircraftDef, Faction faction) + { + int totalCooldown = 0; + foreach (var cooldownEvent in cooldownEvents) + { + if (cooldownEvent.faction == faction && cooldownEvent.aircraftDef == aircraftDef) + { + totalCooldown += cooldownEvent.aircraftCount; + } + } + return totalCooldown; + } + } +}