diff --git a/1.6/1.6/Assemblies/ArachnaeSwarm.dll b/1.6/1.6/Assemblies/ArachnaeSwarm.dll
index 2dc8609..eb0f396 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/Thing_building/ARA_NutrientNetworkBuilding.xml b/1.6/1.6/Defs/Thing_building/ARA_NutrientNetworkBuilding.xml
index b747be1..6ca19e8 100644
--- a/1.6/1.6/Defs/Thing_building/ARA_NutrientNetworkBuilding.xml
+++ b/1.6/1.6/Defs/Thing_building/ARA_NutrientNetworkBuilding.xml
@@ -46,6 +46,7 @@
ARA_GrowthVat
ARA_MorphableResearchBench
ARANutrientDispenser
+ ARA_WormholePortal_A
80
10
@@ -61,6 +62,7 @@
ARA_GrowthVat
ARA_MorphableResearchBench
ARANutrientDispenser
+ ARA_WormholePortal_A
80
ArachnaeSwarm/Building/Nutrition_Pie
diff --git a/1.6/1.6/Defs/Thing_building/ARA_WormholeDefs.xml b/1.6/1.6/Defs/Thing_building/ARA_WormholeDefs.xml
index 995fca1..c6dcd9d 100644
--- a/1.6/1.6/Defs/Thing_building/ARA_WormholeDefs.xml
+++ b/1.6/1.6/Defs/Thing_building/ARA_WormholeDefs.xml
@@ -11,7 +11,7 @@
ArachnaeSwarm/Building/ARA_Wormhole_A
Graphic_Single
CutoutComplex
- (2.2,2.2)
+ (4,4)
(1.6, 0.5, 1.6)
(0,0,-0.1)
@@ -21,19 +21,23 @@
Impassable
Normal
Building
- 50
- 250
+ 1000
8000
0.5
100
(2,2)
- 100
- 6
+ 50
+
+ 7.0
+ 14
+ (220,210,171,0)
+ true
+
500.0
@@ -49,13 +53,20 @@
2.5
+
+
+
+ ARA_NutrientNetworkTower
+
+
ARA_Buildings
+ ARA_Creep
false
- Message_FleshbeastsDiscovered
+ TraversePitGate
@@ -69,7 +80,7 @@
ArachnaeSwarm/Building/ARA_Wormhole_B
Graphic_Single
CutoutComplex
- (2.2,2.2)
+ (4,4)
(1.6, 0.5, 1.6)
(0,0,-0.1)
@@ -78,16 +89,22 @@
Building
Impassable
- 250
+ 500
0.5
(2,2)
+
+ 7.0
+ 14
+ (220,210,171,0)
+ true
+
None
- Message_FleshbeastsDiscovered
+ TraversePitGate
diff --git a/1.6/1.6/Languages/ChineseSimplified (简体中文)/Keyed/Wormhole_Keys.xml b/1.6/1.6/Languages/ChineseSimplified (简体中文)/Keyed/Wormhole_Keys.xml
index 12fc1e7..4d13d58 100644
--- a/1.6/1.6/Languages/ChineseSimplified (简体中文)/Keyed/Wormhole_Keys.xml
+++ b/1.6/1.6/Languages/ChineseSimplified (简体中文)/Keyed/Wormhole_Keys.xml
@@ -5,5 +5,6 @@
部署虫洞传送门
选择一名驾驶员来启动一个B端传送门。
没有可用的驾驶员
+ 无人驾驶发射
\ No newline at end of file
diff --git a/Source/ArachnaeSwarm/Wormhole/CompLaunchableWormhole.cs b/Source/ArachnaeSwarm/Wormhole/CompLaunchableWormhole.cs
index f66755d..c0ae9c1 100644
--- a/Source/ArachnaeSwarm/Wormhole/CompLaunchableWormhole.cs
+++ b/Source/ArachnaeSwarm/Wormhole/CompLaunchableWormhole.cs
@@ -62,6 +62,10 @@ namespace ArachnaeSwarm
}
options.Add(new FloatMenuOption(p.LabelCap, pilotAction));
}
+
+ // Add force launch option
+ options.Add(new FloatMenuOption("ForceLaunch".Translate(), () => StartChoosingDestination(null)));
+
Find.WindowStack.Add(new FloatMenu(options));
};
@@ -100,24 +104,47 @@ namespace ArachnaeSwarm
return false;
}
+ var mapParent = Find.WorldObjects.MapParentAt(t.Tile);
+
+ if (mapParent != null && mapParent.HasMap)
+ {
+ // Has map, let player choose local destination
+ StartChoosingLocalDestination(mapParent.Map, pilot, t.Tile, distance);
+ }
+ else
+ {
+ // No map, deploy to center
+ Launch(t.Tile, pilot, distance, IntVec3.Invalid);
+ }
+
+ return true;
+ }
+
+ private void StartChoosingLocalDestination(Map map, Pawn pilot, int tile, int distance)
+ {
+ CameraJumper.TryJump(new GlobalTargetInfo(map.Center, map));
+ Find.Targeter.BeginTargeting(TargetingParameters.ForDropPodsDestination(), localTarget =>
+ {
+ Launch(tile, pilot, distance, localTarget.Cell);
+ });
+ }
+
+ private void Launch(int destinationTile, Pawn pilot, int distance, IntVec3 arrivalCell)
+ {
float fuelCost = distance * Props.fuelPerTile;
refuelableComp.ConsumeFuel(fuelCost);
- // Despawn pilot from the source map
- pilot.DeSpawn();
+ if(pilot != null) pilot.DeSpawn();
EffecterDefOf.Skip_Entry.Spawn(this.parent.Position, this.parent.Map);
- // Create the traveling object
var travelingWormhole = (TravelingWormhole)WorldObjectMaker.MakeWorldObject(DefDatabase.GetNamed("ARA_TravelingWormhole"));
travelingWormhole.sourcePortal = this.PortalA;
- travelingWormhole.StartMove(parent.Map.Tile, t.Tile, pilot);
+ travelingWormhole.StartMove(parent.Map.Tile, destinationTile, pilot, arrivalCell);
Find.WorldObjects.Add(travelingWormhole);
PortalA.status = WormholePortalStatus.Deploying;
-
- return true;
}
}
diff --git a/Source/ArachnaeSwarm/Wormhole/TravelingWormhole.cs b/Source/ArachnaeSwarm/Wormhole/TravelingWormhole.cs
index daf4c90..e037f1a 100644
--- a/Source/ArachnaeSwarm/Wormhole/TravelingWormhole.cs
+++ b/Source/ArachnaeSwarm/Wormhole/TravelingWormhole.cs
@@ -18,6 +18,8 @@ namespace ArachnaeSwarm
private ThingOwner contents;
+ public IntVec3 specificArrivalCell = IntVec3.Invalid;
+
public override Material Material => def.Material;
public override Vector3 DrawPos => Vector3.Slerp(
@@ -38,15 +40,17 @@ namespace ArachnaeSwarm
Scribe_Values.Look(ref initialTile, "initialTile", 0);
Scribe_Values.Look(ref traveledPct, "traveledPct", 0f);
Scribe_Deep.Look(ref contents, "contents", this);
+ Scribe_Values.Look(ref specificArrivalCell, "specificArrivalCell", IntVec3.Invalid);
}
-
- public void StartMove(int startTile, int destTile, Pawn pilot)
+
+ public void StartMove(int startTile, int destTile, Pawn pilot, IntVec3 arrivalCell)
{
initialTile = startTile;
destinationTile = destTile;
this.Tile = startTile;
- contents.TryAdd(pilot, true);
+ this.specificArrivalCell = arrivalCell;
+ if (pilot != null) contents.TryAdd(pilot, true);
}
protected override void Tick()
@@ -63,31 +67,27 @@ namespace ArachnaeSwarm
private void Arrived()
{
- if (contents.Any)
+ Map targetMap = GetOrGenerateMapUtility.GetOrGenerateMap(destinationTile, WorldObjectDefOf.Camp);
+ IntVec3 cell = specificArrivalCell.IsValid ? specificArrivalCell : DropCellFinder.RandomDropSpot(targetMap);
+ Building_WormholePortal_B portalB = (Building_WormholePortal_B)ThingMaker.MakeThing(ThingDef.Named("ARA_WormholePortal_B"));
+ GenSpawn.Spawn(portalB, cell, targetMap, WipeMode.Vanish);
+
+ Pawn pilot = contents.FirstOrDefault() as Pawn;
+ if (pilot != null)
{
- Pawn pilot = contents.First() as Pawn;
- if (pilot != null)
- {
- Map targetMap = GetOrGenerateMapUtility.GetOrGenerateMap(destinationTile, WorldObjectDefOf.Camp);
-
- Building_WormholePortal_B portalB = (Building_WormholePortal_B)ThingMaker.MakeThing(ThingDef.Named("ARA_WormholePortal_B"));
- IntVec3 cell = DropCellFinder.RandomDropSpot(targetMap);
- GenSpawn.Spawn(portalB, cell, targetMap, WipeMode.Vanish);
-
- IntVec3 pilotSpawnCell = CellFinder.RandomClosewalkCellNear(portalB.Position, targetMap, 5);
- GenSpawn.Spawn(pilot, pilotSpawnCell, targetMap, WipeMode.Vanish);
-
- contents.Remove(pilot);
-
- EffecterDefOf.Skip_Exit.Spawn(cell, targetMap);
-
- if (sourcePortal != null && !sourcePortal.Destroyed)
- {
- sourcePortal.SetLinkedPortal(portalB); // This sets status to Linked
- portalB.SetLinkedPortal(sourcePortal);
- }
- }
+ IntVec3 pilotSpawnCell = CellFinder.RandomClosewalkCellNear(portalB.Position, targetMap, 5);
+ GenSpawn.Spawn(pilot, pilotSpawnCell, targetMap, WipeMode.Vanish);
+ contents.Remove(pilot);
}
+
+ EffecterDefOf.Skip_Exit.Spawn(cell, targetMap);
+
+ if (sourcePortal != null && !sourcePortal.Destroyed)
+ {
+ sourcePortal.SetLinkedPortal(portalB);
+ portalB.SetLinkedPortal(sourcePortal);
+ }
+
Find.WorldObjects.Remove(this);
}
diff --git a/非公开资源/Content/Textures/Building/神秘坑道虫.psd b/非公开资源/Content/Textures/Building/神秘坑道虫.psd
new file mode 100644
index 0000000..08008b2
Binary files /dev/null and b/非公开资源/Content/Textures/Building/神秘坑道虫.psd differ