diff --git a/1.6/1.6/Assemblies/ArachnaeSwarm.dll b/1.6/1.6/Assemblies/ArachnaeSwarm.dll index f969eda..d3de441 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_NutrientDispenser.xml b/1.6/1.6/Defs/Thing_building/ARA_NutrientDispenser.xml index a8d52bd..8237893 100644 --- a/1.6/1.6/Defs/Thing_building/ARA_NutrientDispenser.xml +++ b/1.6/1.6/Defs/Thing_building/ARA_NutrientDispenser.xml @@ -1,83 +1,6 @@ - - ARANutrientDispenser - - 一个生产阿拉克涅蜜晶糕的虫虫巢穴。通过分解虫蜜来生产可食用的蜜晶糕。 - ArachnaeSwarm.Building_ARANutrientDispenser - - Things/Building/Production/NutrientDispenser - Graphic_Multi - (232,255,191) - CutoutComplex - (3,4) - - (0.02,0.25,2.96,2.85) - Damage/Corner - Damage/Corner - - - (2.87,0.75,3.05) - (0,0,0.38) - - - Building - Impassable - 150 - 1.0 - - 250 - 2000 - 0.5 - - (3,4) - - 50 - - Normal - ARA_Creep - -
  • - 10.0 - - -
  • ARA_InsectJelly
  • - - - 虫蜜 - true - true - true - -
  • - -
  • ARA_NutrientNetworkTower
  • - - - -
  • - CompPowerPlant - -1 - false -
  • -
    - -
  • - ARA_NutrientPasteMeal - 1.25 - DispensePaste -
  • -
    - - true - - (0,0,3) - true - ARA_Buildings - -
  • NutrientPaste
  • -
    -
    +
    \ No newline at end of file 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 6ca19e8..f87af60 100644 --- a/1.6/1.6/Defs/Thing_building/ARA_NutrientNetworkBuilding.xml +++ b/1.6/1.6/Defs/Thing_building/ARA_NutrientNetworkBuilding.xml @@ -47,6 +47,8 @@
  • ARA_MorphableResearchBench
  • ARANutrientDispenser
  • ARA_WormholePortal_A
  • +
  • ARA_Acidling_AutoMortar
  • +
  • CatastropheMissileSilo
  • 80 10 @@ -63,6 +65,8 @@
  • ARA_MorphableResearchBench
  • ARANutrientDispenser
  • ARA_WormholePortal_A
  • +
  • ARA_Acidling_AutoMortar
  • +
  • CatastropheMissileSilo
  • 80 ArachnaeSwarm/Building/Nutrition_Pie @@ -392,7 +396,7 @@
  • Corpses
  • - 50 + 25 25 true @@ -463,7 +467,7 @@
  • - 10.0 + 5.0
  • ARA_InsectJelly
  • @@ -482,7 +486,7 @@
  • ARA_BioforgeIncubator_Thing
  • 10 - 20 + 20 0.05 0.1 @@ -506,4 +510,83 @@ + + ARANutrientDispenser + + 一个生产阿拉克涅蜜晶糕的虫虫巢穴。通过分解虫蜜来生产可食用的蜜晶糕。 + ArachnaeSwarm.Building_ARANutrientDispenser + + Things/Building/Production/NutrientDispenser + Graphic_Multi + (232,255,191) + CutoutComplex + (3,4) + + (0.02,0.25,2.96,2.85) + Damage/Corner + Damage/Corner + + + (2.87,0.75,3.05) + (0,0,0.38) + + + Building + Impassable + 150 + 1.0 + + 250 + 2000 + 0.5 + + (3,4) + + 50 + + Normal + ARA_Creep + +
  • + 10.0 + + +
  • ARA_InsectJelly
  • + + + 虫蜜 + true + true + true + +
  • + +
  • ARA_NutrientNetworkTower
  • + + + +
  • + CompPowerPlant + -1 + false +
  • +
    + +
  • + ARA_NutrientPasteMeal + 1.25 + DispensePaste +
  • +
    + + true + + (0,0,3) + true + ARA_Buildings + +
  • NutrientPaste
  • +
    +
    + \ No newline at end of file diff --git a/1.6/1.6/Defs/Thing_building/ARA_ThingDef_Building_CatastropheMissileSilo.xml b/1.6/1.6/Defs/Thing_building/ARA_SwarmTurret.xml similarity index 58% rename from 1.6/1.6/Defs/Thing_building/ARA_ThingDef_Building_CatastropheMissileSilo.xml rename to 1.6/1.6/Defs/Thing_building/ARA_SwarmTurret.xml index 40e75e2..8c5185c 100644 --- a/1.6/1.6/Defs/Thing_building/ARA_ThingDef_Building_CatastropheMissileSilo.xml +++ b/1.6/1.6/Defs/Thing_building/ARA_SwarmTurret.xml @@ -1,6 +1,158 @@ - + - + + + + ARA_Acidling_AutoMortar + + 一个投射酸爆种的巢穴. + Building_TurretGun + MapMeshAndRealTime + true + true + + ArachnaeSwarm/Building/ARA_CatastropheMissileSilo_Base + Graphic_Single + (3,3) + (0,0,-0.1) + + (-0.13,-0.87,-0.1) + (0.5,0.4,1.05) + + + true + Building + false + (3,3) + PassThroughOnly + 50 + 0.4 + Normal + Heavy + +
  • +
  • + 5.0 + + +
  • ARA_InsectJelly
  • + + + 虫蜜 + true + true + true + +
  • + 弹药 + 弹药 + 缺少弹药 + + + 30 + 0 + 1 + true + true +
  • +
  • + 300 + 0.5 + 600 + 1 +
  • +
  • +
  • + ARA_InsectCreep + 6 +
  • +
  • + +
  • ARA_NutrientNetworkTower
  • + + +
    + + 260 + 0 + 30 + 0.9 + -20 + + +
  • + Flame + 0 +
  • +
    + 4 + + +
  • Artillery
  • +
    + ARA_Acidling_Artillery_AutoMortar + 10.0 + 3.0 +
    + ARA_Buildings + ARA_Creep + 8 +
    + + + ARA_Acidling_Artillery_AutoMortar + + + ArachnaeSwarm/Building/ARA_Turret + Graphic_Single + + 1.25 + +
  • Artillery_BaseDestroyer
  • +
    + +
  • + ArachnaeSwarm.Verb_ShootConsumeNutrition + ArachnaeBase_Race_Acidling_Proj + 10 + 3 + 2 + 500 + 3 + 16 + Mortar_LaunchA + GunTail_Light + 16 + false + 0.5 + + true + +
  • +
    +
    + + + ArachnaeBase_Race_Acidling_Proj + + Projectile_SpawnsPawnZeroAge + Wula/Things/WULA_Attack_Cat/WULA_Cat_Thin_south + + Things/Pawn/Animal/Spelopede/Spelopede + Graphic_Multi + + + 41 + ArachnaeBase_Race_Acidling + true + ARA_AcidBurn + 10 + true + MortarRound_Ambient + + + + CatastropheMissileSilo 阿拉克涅虫族所进化出的终极生物武器之一。它由大量没有自主意识的高度特化器官共同构成,骇人的酸烧炮可以发射令生灵闻风丧胆的天灾酸烧导弹。作为复合型防御系统,它既可以向本地的目标发射导弹,也可以向远处的威胁实施精确打击。 @@ -10,7 +162,7 @@ ArachnaeSwarm/Building/ARA_CatastropheMissileSilo_Base Graphic_Single (5,5) - (0,0,-0.1) + (0,0,0.5) (1.5,0.35,1.4) (0,0,-0.05) @@ -30,6 +182,18 @@ Normal +
  • + 5.0 + + +
  • ARA_InsectJelly
  • + + + 虫蜜 + true + true + true +
  • 导弹 导弹 @@ -45,6 +209,12 @@ true true
  • +
  • + 300 + 20 + 6000 + 1 +
  • @@ -52,19 +222,28 @@ ARA_InsectCreep 8
  • +
  • + +
  • ARA_NutrientNetworkTower
  • + +
    CatastropheMissile_Weapon 15.0 - 5.0 + 7.0 + (0,1.2)
  • Artillery
  • + + 50 + ARA_Buildings - 8 + 12 + ARA_Creep -
  • ShipbuildingBasics
  • @@ -118,7 +297,7 @@ 10.9 ARA_Filth_SpentAcid 1 - 2 + 1 30~60 MortarBomb_Explode ARA_Shell_AcidSpitImpact @@ -144,7 +323,7 @@ 80 true ARA_Filth_SpentAcid - 2 + 1 ARA_Shell_AcidSpitImpact 60 false @@ -182,6 +361,46 @@
    + + Projectile_CatastropheMissile_Fake + + ArachnaeSwarm.Projectile_CruiseMissile + + Graphic_Single_AgeSecs + Things/Projectile/FleshmassSpitterProjectileSheet + (3,3) + MoteGlow + + + True + 1 + ARA_AcidBurn + 0 + 80 + true + + +
  • + true + false + 0.01 + 1 + 5 + 0.05 + 0.05 + 1.5 +
  • +
    + +
  • + Shell_AcidSpitStream +
  • +
  • + Shell_AcidSpitLaunched +
  • +
    +
    + ARA_Filth_SpentAcid @@ -198,7 +417,7 @@ true - 1~3 + 0.5~1 true 70 true @@ -257,45 +476,5 @@ - - - Projectile_CatastropheMissile_Fake - - ArachnaeSwarm.Projectile_CruiseMissile - - Graphic_Single_AgeSecs - Things/Projectile/FleshmassSpitterProjectileSheet - (3,3) - MoteGlow - - - True - 1 - ARA_AcidBurn - 0 - 80 - true - - -
  • - true - false - 0.01 - 1 - 5 - 0.05 - 0.05 - 1.5 -
  • -
    - -
  • - Shell_AcidSpitStream -
  • -
  • - Shell_AcidSpitLaunched -
  • -
    -
    - - \ No newline at end of file + + diff --git a/1.6/1.6/Languages/ChineseSimplified (简体中文)/Keyed/Converter_Keys.xml b/1.6/1.6/Languages/ChineseSimplified (简体中文)/Keyed/Converter_Keys.xml new file mode 100644 index 0000000..ccb6e92 --- /dev/null +++ b/1.6/1.6/Languages/ChineseSimplified (简体中文)/Keyed/Converter_Keys.xml @@ -0,0 +1,18 @@ + + + + + 错误:缺少组件 + + 状态 + 下次转换 + + 缺少营养 + 弹药已满 + 组装中 + + + 装填中: {0} / {1} + 组装中: {0} / {1} + + \ No newline at end of file diff --git a/Content/Textures/ArachnaeSwarm/Building/ARA_Turret.png b/Content/Textures/ArachnaeSwarm/Building/ARA_Turret.png new file mode 100644 index 0000000..87ca973 Binary files /dev/null and b/Content/Textures/ArachnaeSwarm/Building/ARA_Turret.png differ diff --git a/Source/ArachnaeSwarm/ArachnaeSwarm.csproj b/Source/ArachnaeSwarm/ArachnaeSwarm.csproj index dbb9672..f90716f 100644 --- a/Source/ArachnaeSwarm/ArachnaeSwarm.csproj +++ b/Source/ArachnaeSwarm/ArachnaeSwarm.csproj @@ -128,6 +128,7 @@ + @@ -203,6 +204,7 @@ + diff --git a/Source/ArachnaeSwarm/Building_Comps/ARA_CompInteractiveProducer/CompRefuelableNutrition.cs b/Source/ArachnaeSwarm/Building_Comps/ARA_CompInteractiveProducer/CompRefuelableNutrition.cs index f3f8362..3d0283c 100644 --- a/Source/ArachnaeSwarm/Building_Comps/ARA_CompInteractiveProducer/CompRefuelableNutrition.cs +++ b/Source/ArachnaeSwarm/Building_Comps/ARA_CompInteractiveProducer/CompRefuelableNutrition.cs @@ -76,7 +76,8 @@ namespace ArachnaeSwarm public override string CompInspectStringExtra() { - string text = Props.FuelLabel + ": " + Fuel.ToStringDecimalIfSmall() + " / " + Props.fuelCapacity.ToStringDecimalIfSmall(); + string fuelLabel = string.IsNullOrEmpty(Props.FuelLabel) ? "Nutrition" : Props.FuelLabel; + string text = fuelLabel + ": " + Fuel.ToStringDecimalIfSmall() + " / " + Props.fuelCapacity.ToStringDecimalIfSmall(); if (currentConsumptionRate > 0f && HasFuel) { diff --git a/Source/ArachnaeSwarm/Building_Comps/CompNutritionToFuelConverter.cs b/Source/ArachnaeSwarm/Building_Comps/CompNutritionToFuelConverter.cs new file mode 100644 index 0000000..e2da56b --- /dev/null +++ b/Source/ArachnaeSwarm/Building_Comps/CompNutritionToFuelConverter.cs @@ -0,0 +1,125 @@ +using RimWorld; +using Verse; + +namespace ArachnaeSwarm +{ + public class CompProperties_NutritionToFuelConverter : CompProperties + { + public int checkInterval = 240; + public float nutritionCost = 20f; + public int workAmount = 6000; + public float fuelAmount = 1f; + + public CompProperties_NutritionToFuelConverter() + { + compClass = typeof(CompNutritionToFuelConverter); + } + } + + public class CompNutritionToFuelConverter : ThingComp + { + private CompRefuelableNutrition nutritionComp; + private CompRefuelable fuelComp; + + public float nutritionProgress = 0f; + public float workProgress = 0f; + + private CompProperties_NutritionToFuelConverter Props => (CompProperties_NutritionToFuelConverter)props; + + public override void PostSpawnSetup(bool respawningAfterLoad) + { + base.PostSpawnSetup(respawningAfterLoad); + nutritionComp = parent.GetComp(); + fuelComp = parent.GetComp(); + + if (nutritionComp == null) + { + Log.Error($"[ArachnaeSwarm] {parent.def.defName} has CompNutritionToFuelConverter but no CompRefuelableNutrition."); + } + if (fuelComp == null) + { + Log.Error($"[ArachnaeSwarm] {parent.def.defName} has CompNutritionToFuelConverter but no CompRefuelable."); + } + } + + public override void PostExposeData() + { + base.PostExposeData(); + Scribe_Values.Look(ref nutritionProgress, "nutritionProgress", 0f); + Scribe_Values.Look(ref workProgress, "workProgress", 0f); + } + + public override void CompTick() + { + base.CompTick(); + if (parent.IsHashIntervalTick(Props.checkInterval)) + { + TryProcess(); + } + } + + private void TryProcess() + { + if (fuelComp == null || fuelComp.IsFull) + { + return; + } + + // Stage 1: Gather nutrition + if (nutritionProgress < Props.nutritionCost) + { + if (nutritionComp != null && nutritionComp.Fuel > 0) + { + float needed = Props.nutritionCost - nutritionProgress; + float canTake = System.Math.Min(needed, nutritionComp.Fuel); + nutritionComp.ConsumeFuel(canTake); + nutritionProgress += canTake; + } + // Reset work progress if we are still gathering nutrition + workProgress = 0; + return; + } + + // Stage 2: Process work + workProgress += Props.checkInterval; + + // Stage 3: Finish crafting + if (workProgress >= Props.workAmount) + { + int unitsToCraft = (int)(workProgress / Props.workAmount); + float totalFuel = unitsToCraft * Props.fuelAmount; + float spaceInTank = fuelComp.Props.fuelCapacity - fuelComp.Fuel; + + if (totalFuel > spaceInTank) + { + totalFuel = spaceInTank; + unitsToCraft = (int)(totalFuel / Props.fuelAmount); + } + + if (unitsToCraft > 0) + { + fuelComp.Refuel(unitsToCraft * Props.fuelAmount); + nutritionProgress -= unitsToCraft * Props.nutritionCost; + workProgress -= unitsToCraft * Props.workAmount; + } + } + } + + public override string CompInspectStringExtra() + { + if (fuelComp == null) return null; + + if (fuelComp.IsFull) + { + return "ARA_NutritionConverter_State_TankFull".Translate(); + } + + if (nutritionProgress < Props.nutritionCost) + { + return "ARA_NutritionConverter_Gathering".Translate(nutritionProgress.ToString("F1"), Props.nutritionCost); + } + + return "ARA_NutritionConverter_Working".Translate(workProgress.ToString("F0"), Props.workAmount); + } + } +} \ No newline at end of file diff --git a/Source/ArachnaeSwarm/Verbs/Verb_ShootConsumeNutrition.cs b/Source/ArachnaeSwarm/Verbs/Verb_ShootConsumeNutrition.cs new file mode 100644 index 0000000..95ce941 --- /dev/null +++ b/Source/ArachnaeSwarm/Verbs/Verb_ShootConsumeNutrition.cs @@ -0,0 +1,41 @@ +using RimWorld; +using Verse; + +namespace ArachnaeSwarm +{ + public class Verb_ShootConsumeNutrition : Verb_Shoot + { + public override bool Available() + { + if (!base.Available()) + { + return false; + } + + if (verbProps.consumeFuelPerShot > 0f) + { + CompRefuelableNutrition comp = caster.TryGetComp(); + if (comp != null && comp.Fuel < verbProps.consumeFuelPerShot) + { + return false; + } + } + + return true; + } + + public override void WarmupComplete() + { + // This is a bit of a workaround. The base WarmupComplete calls TryCastNextBurstShot, + // which in turn calls the base Verb's fuel consumption logic before we can intervene. + // So we consume fuel here, and the base call will find it already consumed. + // This relies on the fact that TryCastNextBurstShot in the base Verb class checks fuel again. + if (verbProps.consumeFuelPerShot > 0f) + { + caster.TryGetComp()?.ConsumeFuel(verbProps.consumeFuelPerShot); + } + + base.WarmupComplete(); + } + } +} \ No newline at end of file