diff --git a/1.6/1.6/Assemblies/ArachnaeSwarm.dll b/1.6/1.6/Assemblies/ArachnaeSwarm.dll index f8f740d..00ad5f9 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/HediffDefs/ARA_HediffDef_Terrain.xml b/1.6/1.6/Defs/HediffDefs/ARA_HediffDef_Terrain.xml index 0a5cfa6..bab3244 100644 --- a/1.6/1.6/Defs/HediffDefs/ARA_HediffDef_Terrain.xml +++ b/1.6/1.6/Defs/HediffDefs/ARA_HediffDef_Terrain.xml @@ -59,7 +59,8 @@ 这只阿拉克捏督虫所着织物使其获得了治疗他人的能力。 HediffWithComps - 0.02 + 1.0 + 1.0 0.01 false diff --git a/1.6/1.6/Defs/Thing_Plant/ARA_Plant.xml b/1.6/1.6/Defs/Thing_Plant/ARA_Plant.xml index 8b4ae5d..7c1bff7 100644 --- a/1.6/1.6/Defs/Thing_Plant/ARA_Plant.xml +++ b/1.6/1.6/Defs/Thing_Plant/ARA_Plant.xml @@ -33,12 +33,95 @@ + + + ARA_AcidlingTrapPlant + + ArachnaeSwarm.Plant_Transforming + 一种只能在阿拉克涅菌毯上生长的奇特植物,几乎不消耗肥力即可通过菌毯的营养管道茁壮生长,并转换成阿拉克涅酸爆茧。 + + 85 + 4 + 0.2 + + + Things/Plant/Glowstool + Graphic_Random + + true + 10 + + 0.05 + 0.05 + 10 + 10 + ARA_CreepFungus + +
  • Ground
  • +
    + +
  • ARA_Creep
  • +
    + 0.3~0.8 + +
  • ARA_Technology_8CPE
  • +
    +
    + +
  • + Arachnae_AcidlingTrap + 0.8 +
  • +
    +
    + + + ARA_BeeSpikePlant + + ArachnaeSwarm.Plant_Transforming + 一种只能在阿拉克涅菌毯上生长的奇特植物,几乎不消耗肥力即可通过菌毯的营养管道茁壮生长,并转换成蜂刺射手。 + + 85 + 4 + 0.2 + + + Things/Plant/Glowstool + Graphic_Random + + true + 10 + + 0.05 + 0.05 + 10 + 10 + ARA_CreepFungus + +
  • Ground
  • +
    + +
  • ARA_Creep
  • +
    + 0.3~0.8 + +
  • ARA_Technology_8CPE
  • +
    +
    + +
  • + ARA_Turret_Beespikeshooter + 0.8 +
  • +
    +
    + ARA_CreepFungus 从菌毯奇花上收获的真菌。可以直接生吃,但烹饪后味道更佳。 - Things/Item/Resource/PlantFoodRaw/RawFungus + Things/Item/Resource/PlantFoodRaw/RawFungus 1.1 diff --git a/1.6/1.6/Defs/Thing_building/ARA_SwarmTurret.xml b/1.6/1.6/Defs/Thing_building/ARA_SwarmTurret.xml index 4920896..0ff7cc2 100644 --- a/1.6/1.6/Defs/Thing_building/ARA_SwarmTurret.xml +++ b/1.6/1.6/Defs/Thing_building/ARA_SwarmTurret.xml @@ -39,10 +39,10 @@ ArachnaeSwarm.Filth_Toxic
  • - ARA_AcidCoverd - 0.1 - 240 + 240
  • @@ -91,6 +91,119 @@ + + ARA_Turret_Beespikeshooter + + 射出毒刺的小炮塔. + Building_TurretGun + MapMeshAndRealTime + + Things/Building/TacticalTurret/TacticalTurret_Base + Graphic_Single + + (0.2,0.2,0.6,0.6) + + + (0.27,0.25,0.27) + (0,0,0) + + (1.2, 1.2) + + Building + false + false + + 100 + 0.7 + 1800 + 8 + -20 + 0.96 + + Normal + +
  • +
  • +
  • + 弹药 + 弹药 + 缺少弹药 + + +
  • ARA_DummyAmmo
  • + + + 100 + 1 + 1 + true + true + +
  • + 10 + 寿命 + 这种半植物生命的寿命转瞬即逝。 + true +
  • +
    + PassThroughOnly + 50 + 0.4 + true + + 40 + + Light + + 45 + true + ARA_Gun_Beespikeshooter + 0.5 + 2.4 + false + false + 1.2 + + +
  • PlaceWorker_TurretTop
  • +
  • PlaceWorker_ShowTurretRadius
  • +
    + Misc2 +
    + + + ARA_Gun_Beespikeshooter + + 会发射小毒刺的组织. + + Things/Building/TacticalTurret/TacticalTurret_Top + Graphic_Single + + + 0.77 + 0.70 + 0.45 + 0.24 + 4.8 + 0 + 5 + 0 + + +
  • + Verb_Shoot + Bullet_ARA_RW_Basic_Fist_Needle_Gun + 0 + 19.9 + 2 + 2 + SpitterSpit + 9 + 1 +
  • +
    +
    + ARA_AutoSniperCannon @@ -181,7 +294,7 @@ 0 - 4 Gun_ARA_AutoSniperCannonTurret @@ -192,8 +305,8 @@ ARA_Creep 8 - - Gun_ARA_AutoSniperCannonTurret + Gun_ARA_AutoSniperCannonTurret 血链千兆机炮. @@ -317,7 +430,7 @@ 0 - 4 @@ -344,7 +457,7 @@
  • - ArachnaeSwarm.Verb_ShootConsumeNutrition + Verb_Shoot ArachnaeBase_Race_Acidling_Proj 3 2 diff --git a/Source/ArachnaeSwarm/ArachnaeSwarm.csproj b/Source/ArachnaeSwarm/ArachnaeSwarm.csproj index 103e521..3815be1 100644 --- a/Source/ArachnaeSwarm/ArachnaeSwarm.csproj +++ b/Source/ArachnaeSwarm/ArachnaeSwarm.csproj @@ -189,6 +189,7 @@ + diff --git a/Source/ArachnaeSwarm/Plants/Plant_Transforming.cs b/Source/ArachnaeSwarm/Plants/Plant_Transforming.cs new file mode 100644 index 0000000..5287c0e --- /dev/null +++ b/Source/ArachnaeSwarm/Plants/Plant_Transforming.cs @@ -0,0 +1,75 @@ +using RimWorld; +using Verse; + +namespace ArachnaeSwarm +{ + // Define a DefModExtension to hold our custom properties in XML + public class PlantTransformExtension : DefModExtension + { + public ThingDef buildingDef; + public float transformAtGrowth = 0.8f; + } + + public class Plant_Transforming : Plant + { + private PlantTransformExtension extension; + private bool transformed = false; + + // Caching the extension for performance + public PlantTransformExtension Extension + { + get + { + if (extension == null) + { + extension = this.def.GetModExtension(); + } + return extension; + } + } + + public override void ExposeData() + { + base.ExposeData(); + Scribe_Values.Look(ref transformed, "transformed", false); + } + + public override void TickLong() + { + base.TickLong(); // Execute base plant logic first + + if (transformed || this.Destroyed || Extension == null) + { + return; + } + + if (this.Growth >= Extension.transformAtGrowth) + { + TryTransform(); + transformed = true; + } + } + + private void TryTransform() + { + if (this.Destroyed || Extension.buildingDef == null) return; + + Map map = this.Map; + IntVec3 position = this.Position; + + Faction factionToSet = null; + Zone zone = map.zoneManager.ZoneAt(position); + if (zone is Zone_Growing) factionToSet = Faction.OfPlayer; + if (factionToSet == null && map.IsPlayerHome) factionToSet = Faction.OfPlayer; + + Thing building = ThingMaker.MakeThing(Extension.buildingDef, null); + if (factionToSet != null && building.def.CanHaveFaction) + { + building.SetFaction(factionToSet); + } + + this.Destroy(DestroyMode.Vanish); + GenSpawn.Spawn(building, position, map, WipeMode.Vanish); + } + } +} \ No newline at end of file