存天巢种
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user