存天巢种

This commit is contained in:
2025-09-09 14:56:06 +08:00
parent b1a0a35b94
commit 6694ff2d62
10 changed files with 129 additions and 26 deletions

Binary file not shown.

View File

@@ -244,6 +244,42 @@
</projectile>
</ThingDef>
<AbilityDef>
<defName>ARA_BaseRace_Skyhive_Launcher</defName>
<label>天巢种喷射巢</label>
<description>将三只阿拉克涅天巢种辅虫发射到目标身上,天巢种将附着到敌人身上撕咬,脱落后仍然能继续对敌人展开攻击。</description>
<iconPath>UI/Commands/EggSpew</iconPath>
<cooldownTicksRange>5000</cooldownTicksRange>
<aiCanUse>true</aiCanUse>
<displayOrder>300</displayOrder>
<displayGizmoWhileUndrafted>true</displayGizmoWhileUndrafted>
<disableGizmoWhileUndrafted>false</disableGizmoWhileUndrafted>
<warmupStartSound>AcidSpray_Warmup</warmupStartSound>
<charges>3</charges>
<cooldownPerCharge>true</cooldownPerCharge>
<verbProperties>
<verbClass>Verb_CastAbility</verbClass>
<range>24</range>
<warmupTime>1</warmupTime>
<soundCast>AcidSpray_Resolve</soundCast>
<violent>false</violent>
<targetParams>
<canTargetPawns>True</canTargetPawns>
</targetParams>
</verbProperties>
<comps>
<li Class="ArachnaeSwarm.CompProperties_AbilityLaunchMultiProjectile">
<projectileDef>Bullet_ARA_RW_Basic_SkyHive_Gun</projectileDef>
<numProjectiles>3</numProjectiles>
</li>
<li Class="ArachnaeSwarm.CompProperties_AbilityNeedCost">
<needDef>Food</needDef>
<needCost>0.5</needCost>
<failMessage>营养值不足,需要进食</failMessage>
</li>
</comps>
</AbilityDef>
<AbilityDef>
<defName>ARA_Ability_Possess</defName>
<label>原虫种突袭寄生</label>

View File

@@ -47,12 +47,11 @@
<DamageDef ParentName="Bite">
<defName>ARA_SkyhiveBite</defName>
<label>天巢种撕咬</label>
<additionalHediffs>
<additionalHediffsThisPart>
<li>
<hediff>ARA_SkyhiveBite</hediff>
<severityPerDamageDealt>0.1</severityPerDamageDealt>
</li>
</additionalHediffs>
</additionalHediffsThisPart>
</DamageDef>
</Defs>

View File

@@ -88,10 +88,11 @@
<HediffDef>
<defName>ARA_SkyhiveBite</defName>
<label>天巢种虫族附着</label>
<description>一只可爱的天巢种阿拉克涅虫族咬到了你的身上.这不会有太大问题...对吧?</description>
<description>一只可爱的天巢种阿拉克涅虫族咬到了你的身上,虫虫会不停的咬你直到从你身上脱离。这不会有太大问题...对吧?</description>
<!--<tendable>false</tendable> Must be removed via surgery -->
<displayWound>true</displayWound>
<!--<displayWound>true</displayWound>-->
<hediffClass>ArachnaeSwarm.HediffCurseFlame</hediffClass>
<defaultLabelColor>(0.6, 0.4, 0.8)</defaultLabelColor>
<comps>
<li Class="HediffCompProperties_Disappears">
<disappearsAfterTicks>1200</disappearsAfterTicks>
@@ -99,13 +100,14 @@
<li Class="HediffCompProperties_DisappearsOnDeath"/>
<li Class="ArachnaeSwarm.HediffCompProperties_SpawnPawnOnRemoved">
<pawnKindDef>ArachnaeBase_Race_Skyhive</pawnKindDef>
<fixedBiologicalAge>0</fixedBiologicalAge>
</li>
</comps>
<modExtensions>
<li Class="ArachnaeSwarm.CurseFlameModExt">
<damageDefName>Bite</damageDefName>
<damageRange>3~5</damageRange>
<damageIntervalTicks>100</damageIntervalTicks>
<damageIntervalTicks>300</damageIntervalTicks>
</li>
</modExtensions>
<stages>
@@ -113,6 +115,5 @@
<painOffset>0.05</painOffset>
</li>
</stages>
<comps />
</HediffDef>
</Defs>

View File

@@ -254,6 +254,9 @@
</categories>
</li>
</backstoryFiltersOverride>
<abilities>
<li>ARA_BaseRace_Skyhive_Launcher</li>
</abilities>
<abilities>
</abilities>
<apparelTags>
@@ -368,24 +371,25 @@
<defName>ArachnaeBase_Race_Skyhive</defName>
<label>阿拉克涅天巢种</label>
<race>ArachnaeBase_Race_Skyhive</race>
<flyingAnimationFramePathPrefix>Things/Pawn/Animal/Goose/Goose_Flying_</flyingAnimationFramePathPrefix>
<flyingAnimationDrawSize>1.35</flyingAnimationDrawSize>
<flyingAnimationFrameCount>2</flyingAnimationFrameCount>
<flyingAnimationFramePathPrefix>Things/Pawn/Insect/Locust/LocustFlying/Locust_Flying_</flyingAnimationFramePathPrefix>
<flyingAnimationFrameCount>5</flyingAnimationFrameCount>
<flyingAnimationTicksPerFrame>2</flyingAnimationTicksPerFrame>
<flyingAnimationInheritColors>false</flyingAnimationInheritColors>
<flyingAnimationDrawSize>1</flyingAnimationDrawSize>
<flyingAnimationDrawSizeIsMultiplier>false</flyingAnimationDrawSizeIsMultiplier>
<flyingAnimationInheritColors>true</flyingAnimationInheritColors>
<lifeStages>
<li>
<bodyGraphicData>
<texPath>Things/Pawn/Animal/Spelopede/Spelopede</texPath>
<texPath>Things/Pawn/Insect/Locust/Locust</texPath>
<drawSize>1</drawSize>
<color>(156,148,125)</color>
<color>(145,140,109)</color>
<shadowData>
<volume>(0.4, 0.5, 0.37)</volume>
<offset>(0,0,-0.15)</offset>
<volume>(0.2, 0.3, 0.2)</volume>
<offset>(0,0,0)</offset>
</shadowData>
</bodyGraphicData>
<dessicatedBodyGraphicData>
<texPath>Things/Pawn/Animal/Spelopede/Dessicated_Spelopede</texPath>
<texPath>Things/Pawn/Insect/Locust/Dessicated_Locust</texPath>
<drawSize>1</drawSize>
</dessicatedBodyGraphicData>
</li>

View File

@@ -632,7 +632,7 @@
<li Class="CompProperties_DrugAddict"/> -->
</comps>
</AlienRace.ThingDef_AlienRace>
<AlienRace.ThingDef_AlienRace Name="ARA_NodeBase_Huge" ParentName="ARA_NodeBase">
<AlienRace.ThingDef_AlienRace Name="ARA_NodeBase_Huge" ParentName="ARA_NodeBase" Abstract="True">
<alienRace>
<generalSettings>
<!-- 各种零件定义 -->

View File

@@ -34,7 +34,6 @@
<hasStandardCommand>true</hasStandardCommand>
<forceNormalTimeSpeed>false</forceNormalTimeSpeed>
<warmupTime>1.0</warmupTime>
<forcedMissRadius>1</forcedMissRadius>
<defaultProjectile>Bullet_ARA_RW_Basic_SkyHive_Gun</defaultProjectile>
<isMortar>true</isMortar>
<requireLineOfSight>false</requireLineOfSight>
@@ -64,10 +63,10 @@
<label>天巢种</label>
<graphicData>
<graphicClass>Graphic_Single_AgeSecs</graphicClass>
<texPath>Things/Pawn/Animal/Spelopede/Spelopede_north</texPath>
<texPath>Things/Pawn/Insect/Locust/Locust_north</texPath>
<color>(156,148,125)</color>
<drawSize>(1,1)</drawSize>
<shaderType>MoteGlow</shaderType>
<shaderType>TransparentPostLight</shaderType>
</graphicData>
<uiIconScale>0.8</uiIconScale>
<thingClass>ArachnaeSwarm.Projectile_TrackingBullet</thingClass>
@@ -75,25 +74,24 @@
<useGraphicClass>True</useGraphicClass>
<shadowSize>1</shadowSize>
<damageDef>ARA_SkyhiveBite</damageDef>
<spinRate>20</spinRate>
<damageAmountBase>20</damageAmountBase>
<speed>15</speed>
<speed>25</speed>
<arcHeightFactor>1</arcHeightFactor>
<flyOverhead>true</flyOverhead>
</projectile>
<modExtensions>
<li Class="ArachnaeSwarm.TrackingBulletDef">
<!-- 追踪速度,数值越高,转向越快,追踪能力越强 -->
<homingSpeed>1.5</homingSpeed>
<homingSpeed>0.75</homingSpeed>
<!-- 初始发射时的随机散射角度(左右各多少度) -->
<initRotateAngle>15</initRotateAngle>
<initRotateAngle>35</initRotateAngle>
<!-- 失去目标后多少 Tick 后自毁,可以是一个范围,如 "120~180" -->
<destroyTicksAfterLosingTrack>150</destroyTicksAfterLosingTrack>
<!-- 子弹离目标多近时就直接判定为命中 -->
<impactThreshold>0.5</impactThreshold>
<impactThreshold>2.1</impactThreshold>
</li>
<li Class="ArachnaeSwarm.ShotgunExtension">
<pelletCount>3</pelletCount>

View File

@@ -155,6 +155,10 @@
<Compile Include="CompProperties_PawnFlight.cs" />
<Compile Include="HarmonyPatches.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="CompAbilityEffect_LaunchMultiProjectile.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="Abilities\CompAbilityEffect_TrackingCharge.cs" />
<Compile Include="Abilities\CompProperties_TrackingCharge.cs" />
@@ -164,6 +168,19 @@
<ItemGroup>
<Compile Include="HediffComp_SpawnPawnOnRemoved.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="Projectiles\BulletWithTrail.cs" />
<Compile Include="Projectiles\ExplosiveTrackingBulletDef.cs" />
<Compile Include="Projectiles\Projectile_ConfigurableHellsphereCannon.cs" />
<Compile Include="Projectiles\Projectile_CruiseMissile.cs" />
<Compile Include="Projectiles\Projectile_ExplosiveTrackingBullet.cs" />
<Compile Include="Projectiles\Projectile_ExplosiveWithTrail.cs" />
<Compile Include="Projectiles\Projectile_TrackingBullet.cs" />
<Compile Include="Projectiles\Projectile_WulaPenetratingBeam.cs" />
<Compile Include="Projectiles\Projectile_WulaPenetratingBullet.cs" />
<Compile Include="Projectiles\TrackingBulletDef.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 自定义清理任务删除obj文件夹中的临时文件 -->
<Target Name="CleanDebugFiles" AfterTargets="Build">

View File

@@ -0,0 +1,44 @@
using Verse;
using RimWorld;
namespace ArachnaeSwarm
{
public class CompProperties_AbilityLaunchMultiProjectile : CompProperties_AbilityLaunchProjectile
{
public int numProjectiles = 1;
public CompProperties_AbilityLaunchMultiProjectile()
{
compClass = typeof(CompAbilityEffect_LaunchMultiProjectile);
}
}
public class CompAbilityEffect_LaunchMultiProjectile : CompAbilityEffect
{
public new CompProperties_AbilityLaunchMultiProjectile Props => (CompProperties_AbilityLaunchMultiProjectile)props;
public override void Apply(LocalTargetInfo target, LocalTargetInfo dest)
{
base.Apply(target, dest);
for (int i = 0; i < Props.numProjectiles; i++)
{
LaunchProjectile(target);
}
}
private void LaunchProjectile(LocalTargetInfo target)
{
if (Props.projectileDef != null)
{
Pawn pawn = parent.pawn;
Projectile projectile = (Projectile)GenSpawn.Spawn(Props.projectileDef, pawn.Position, pawn.Map);
projectile.Launch(pawn, pawn.DrawPos, target, target, ProjectileHitFlags.IntendedTarget, parent.verb.preventFriendlyFire);
}
}
public override bool AICanTargetNow(LocalTargetInfo target)
{
return target.Pawn != null;
}
}
}

View File

@@ -10,6 +10,8 @@ namespace ArachnaeSwarm
public class HediffCompProperties_SpawnPawnOnRemoved : HediffCompProperties
{
public PawnKindDef pawnKindDef;
public float? fixedBiologicalAge; // 新增用于XML配置的固定生物年龄
public FloatRange? biologicalAgeRange; // 新增用于XML配置的生物年龄范围
public HediffCompProperties_SpawnPawnOnRemoved()
{
@@ -61,7 +63,9 @@ namespace ArachnaeSwarm
faction: this.casterFaction, // Use the stored faction
context: PawnGenerationContext.NonPlayer,
tile: -1,
forceGenerateNewPawn: true
forceGenerateNewPawn: true,
fixedBiologicalAge: Props.fixedBiologicalAge, // 使用XML配置的固定生物年龄
biologicalAgeRange: Props.biologicalAgeRange // 使用XML配置的生物年龄范围
));
if (newPawn != null)