整理一下

This commit is contained in:
2025-08-21 15:39:46 +08:00
parent 82b663c891
commit d0d125d095
65 changed files with 64 additions and 152 deletions

View File

@@ -1,59 +0,0 @@
using RimWorld;
using System;
using UnityEngine;
using Verse;
namespace WulaFallenEmpire
{
// =========================================================================
// 1. 抽象的引擎父类 (Abstract Base Class)
// 它现在通过完全重写 DrawAt 方法来获得对绘制逻辑的控制权。
// =========================================================================
public abstract class Building_Wula_Engine_Base : Building_GravEngine
{
// 契约:所有子类都必须提供一个用于绘制的能量球贴图。
// 这个部分保持不变。
protected abstract CachedMaterial OrbMat { get; }
// **关键修正**: 完全重写 DrawAt 方法
protected override void DrawAt(Vector3 drawLoc, bool flip = false)
{
// --- 第 1 部分:复制父类的 `base.DrawAt(drawLoc, flip)` 逻辑 ---
// 这会负责绘制建筑本身的基础图形。
base.DrawAt(drawLoc, flip);
// --- 第 2 部分:复制并修改 `Building_GravEngine` 的绘制逻辑 ---
if (base.Spawned)
{
// 这是原版引擎的“悬浮”动画逻辑,我们将其完整保留。
if (Find.TickManager.TicksGame >= cooldownCompleteTick)
{
drawLoc.z += 0.5f * (1f + Mathf.Sin((float)Math.PI * 2f * (float)GenTicks.TicksGame / 500f)) * 0.3f;
}
// 这是原版引擎的高度微调,我们也保留。
drawLoc.y += 0.03658537f;
// 设置缩放,这部分也来自原版代码。
Vector3 s = new Vector3(def.graphicData.drawSize.x, 1f, def.graphicData.drawSize.y);
// **最终修改**: 使用我们自己的 OrbMat 属性,而不是父类的私有变量!
// 这使得子类可以自由决定能量球的外观。
Graphics.DrawMesh(MeshPool.plane10Back, Matrix4x4.TRS(drawLoc, base.Rotation.AsQuat, s), this.OrbMat.Material, 0);
}
}
}
// =========================================================================
// 2. 具体的暗能量引擎子类 (Concrete Child Class)
// 这个类完全不需要修改,它已经正确地实现了父类的要求。
// =========================================================================
[StaticConstructorOnStartup]
public class Building_Wula_DarkEnergy_Engine : Building_Wula_Engine_Base
{
private static readonly CachedMaterial _darkEnergyOrbMat = new CachedMaterial("Wula/Building/Wula_DarkEnergy_Engine_Orb", ShaderDatabase.Cutout);
protected override CachedMaterial OrbMat => _darkEnergyOrbMat;
}
}

View File

@@ -1,26 +0,0 @@
using Verse;
using RimWorld;
using System.Collections.Generic;
namespace ConfigurableHellsphereCannon
{
public class ExplosionParameters : DefModExtension
{
public float explosionRadius = 4.9f;
public SoundDef explosionSound = null;
public ThingDef postExplosionSpawnThingDef = null;
public float postExplosionSpawnChance = 0f;
public int postExplosionSpawnThingCount = 1;
public GasType? postExplosionGasType = null;
public bool applyDamageToExplosionCellsNeighbors = false;
public ThingDef preExplosionSpawnThingDef = null;
public float preExplosionSpawnChance = 0f;
public int preExplosionSpawnThingCount = 1;
public bool damageFalloff = false;
public ThingDef filth = null;
public bool doVisualEffects = true;
public float screenShakeFactor = 1f;
public bool doSoundEffects = true;
public bool doHitEffects = true;
}
}

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -69,19 +68,18 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="CompChargingBed.cs" />
<Compile Include="CompCleave.cs" />
<Compile Include="CompAutoMechCarrier.cs" />
<Compile Include="CompProperties_AutoMechCarrier.cs" />
<Compile Include="PawnProductionEntry.cs" />
<Compile Include="CompAbilityEffect_GiveSwitchHediff.cs" />
<Compile Include="CompAbilityEffect_RemoveSwitchHediff.cs" />
<Compile Include="Building_Wula_DarkEnergy_Engine.cs" />
<Compile Include="WULA_Energy\CompChargingBed.cs" />
<Compile Include="Verb\CompCleave.cs" />
<Compile Include="WULA_AutoMechCarrier\CompAutoMechCarrier.cs" />
<Compile Include="WULA_AutoMechCarrier\CompProperties_AutoMechCarrier.cs" />
<Compile Include="WULA_AutoMechCarrier\PawnProductionEntry.cs" />
<Compile Include="Cinder_WeaponSwitch\CompAbilityEffect_GiveSwitchHediff.cs" />
<Compile Include="Cinder_WeaponSwitch\CompAbilityEffect_RemoveSwitchHediff.cs" />
<Compile Include="CompApparelInterceptor.cs" />
<Compile Include="CompCustomUniqueWeapon.cs" />
<Compile Include="CompProperties_CustomUniqueWeapon.cs" />
<Compile Include="CompMaintenancePod.cs" />
<Compile Include="CompWulaRitualSpot.cs" />
<Compile Include="WULA_CustomUniqueWeapon\CompCustomUniqueWeapon.cs" />
<Compile Include="WULA_CustomUniqueWeapon\CompProperties_CustomUniqueWeapon.cs" />
<Compile Include="WULA_Maintenance\CompMaintenancePod.cs" />
<Compile Include="WULA_PsychicRitual\CompWulaRitualSpot.cs" />
<Compile Include="CompPsychicScaling.cs" />
<Compile Include="CompUseEffect_FixAllHealthConditions.cs" />
<Compile Include="CompUseEffect_PassionTrainer.cs" />
@@ -107,78 +105,77 @@
<Compile Include="HarmonyPatches\NoBloodForWulaPatch.cs" />
<Compile Include="HarmonyPatches\Patch_CaravanInventoryUtility_FindShuttle.cs" />
<Compile Include="HediffComp_RegenerateBackstory.cs" />
<Compile Include="HediffComp_WulaCharging.cs" />
<Compile Include="IngestPatch.cs" />
<Compile Include="JobDriver_FeedWulaPatient.cs" />
<Compile Include="JobDriver_EnterMaintenancePod.cs" />
<Compile Include="JobDriver_HaulToMaintenancePod.cs" />
<Compile Include="JobDriver_IngestWulaEnergy.cs" />
<Compile Include="JobGiver_WulaGetEnergy.cs" />
<Compile Include="JobGiver_WulaPackEnergy.cs" />
<Compile Include="Job_Maintenance.cs" />
<Compile Include="JobGiverDefExtension_WulaPackEnergy.cs" />
<Compile Include="LightningBombardment.cs" />
<Compile Include="MechanitorPatch.cs" />
<Compile Include="MentalBreakWorker_BrokenPersonality.cs" />
<Compile Include="MentalState_BrokenPersonality.cs" />
<Compile Include="MentalStateDefExtension_BrokenPersonality.cs" />
<Compile Include="Need_WulaEnergy.cs" />
<Compile Include="NeedDefExtension_Energy.cs" />
<Compile Include="Projectile_WulaPenetrating.cs" />
<Compile Include="Projectile_WulaBeam.cs" />
<Compile Include="Projectile_TrackingBullet.cs" />
<Compile Include="TrackingBulletDef.cs" />
<Compile Include="ExplosiveTrackingBulletDef.cs" />
<Compile Include="Projectile_ExplosiveTrackingBullet.cs" />
<Compile Include="WULA_Energy\HediffComp_WulaCharging.cs" />
<Compile Include="HarmonyPatches\IngestPatch.cs" />
<Compile Include="WULA_Energy\JobDriver_FeedWulaPatient.cs" />
<Compile Include="WULA_Maintenance\JobDriver_EnterMaintenancePod.cs" />
<Compile Include="WULA_Maintenance\JobDriver_HaulToMaintenancePod.cs" />
<Compile Include="WULA_Energy\JobDriver_IngestWulaEnergy.cs" />
<Compile Include="WULA_Energy\JobGiver_WulaGetEnergy.cs" />
<Compile Include="WULA_Energy\JobGiver_WulaPackEnergy.cs" />
<Compile Include="WULA_Maintenance\Job_Maintenance.cs" />
<Compile Include="WULA_Energy\JobGiverDefExtension_WulaPackEnergy.cs" />
<Compile Include="Ability\LightningBombardment.cs" />
<Compile Include="HarmonyPatches\MechanitorPatch.cs" />
<Compile Include="WULA_BrokenPersonality\MentalBreakWorker_BrokenPersonality.cs" />
<Compile Include="WULA_BrokenPersonality\MentalState_BrokenPersonality.cs" />
<Compile Include="WULA_BrokenPersonality\MentalStateDefExtension_BrokenPersonality.cs" />
<Compile Include="WULA_Energy\Need_WulaEnergy.cs" />
<Compile Include="WULA_Energy\NeedDefExtension_Energy.cs" />
<Compile Include="Projectiles\Projectile_WulaPenetrating.cs" />
<Compile Include="Projectiles\Projectile_WulaBeam.cs" />
<Compile Include="Projectiles\Projectile_TrackingBullet.cs" />
<Compile Include="Projectiles\TrackingBulletDef.cs" />
<Compile Include="Projectiles\ExplosiveTrackingBulletDef.cs" />
<Compile Include="Projectiles\Projectile_ExplosiveTrackingBullet.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PsychicRitual_TechOffering.cs" />
<Compile Include="PsychicRitualDef_AddHediff.cs" />
<Compile Include="PsychicRitualToil_AddHediff.cs" />
<Compile Include="WULA_PsychicRitual\PsychicRitual_TechOffering.cs" />
<Compile Include="WULA_PsychicRitual\PsychicRitualDef_AddHediff.cs" />
<Compile Include="WULA_PsychicRitual\PsychicRitualToil_AddHediff.cs" />
<Compile Include="MoharHediffs\HediffCompProperties_Spawner.cs" />
<Compile Include="MoharHediffs\HediffComp_Spawner.cs" />
<Compile Include="MoharHediffs\Tools.cs" />
<Compile Include="RitualTagExtension.cs" />
<Compile Include="PsychicRitualDef_Wula.cs" />
<Compile Include="PsychicRitualDef_WulaBase.cs" />
<Compile Include="PsychicRitualToil_GatherForInvocation_Wula.cs" />
<Compile Include="WULA_PsychicRitual\RitualTagExtension.cs" />
<Compile Include="WULA_PsychicRitual\PsychicRitualDef_Wula.cs" />
<Compile Include="WULA_PsychicRitual\PsychicRitualDef_WulaBase.cs" />
<Compile Include="WULA_PsychicRitual\PsychicRitualToil_GatherForInvocation_Wula.cs" />
<Compile Include="Recipe_AdministerWulaMechRepairKit.cs" />
<Compile Include="SectionLayer_WulaHull.cs" />
<Compile Include="ThingDefExtension_EnergySource.cs" />
<Compile Include="TimedExplosion.cs" />
<Compile Include="Verb\ExplosionParameters.cs" />
<Compile Include="Verb\Projectile_ConfigurableHellsphereCannon.cs" />
<Compile Include="Verb\ProperShotgun.cs" />
<Compile Include="Verb\ShootArc.cs" />
<Compile Include="Verb\Trackingbullet.cs" />
<Compile Include="WULA_Energy\ThingDefExtension_EnergySource.cs" />
<Compile Include="HediffComp_TimedExplosion.cs" />
<Compile Include="Projectiles\Projectile_ConfigurableHellsphereCannon.cs" />
<Compile Include="Verb\Verb_ShootShotgun.cs" />
<Compile Include="Verb\Verb_ShootArc.cs" />
<Compile Include="Projectiles\Projectile_CruiseMissile.cs" />
<Compile Include="Verb\Verb_ShootBeamExplosive.cs" />
<Compile Include="Verb\VerbPropertiesExplosiveBeam.cs" />
<Compile Include="Verb\Verb_MeleeAttack_Cleave.cs" />
<Compile Include="WorkGiver_FeedWulaPatient.cs" />
<Compile Include="WorkGiver_Warden_DeliverEnergy.cs" />
<Compile Include="WorkGiver_Warden_FeedWula.cs" />
<Compile Include="WorkGiverDefExtension_FeedWula.cs" />
<Compile Include="WulaCaravanEnergyDef.cs" />
<Compile Include="WULA_Energy\WorkGiver_FeedWulaPatient.cs" />
<Compile Include="WULA_Energy\WorkGiver_Warden_DeliverEnergy.cs" />
<Compile Include="WULA_Energy\WorkGiver_Warden_FeedWula.cs" />
<Compile Include="WULA_Energy\WorkGiverDefExtension_FeedWula.cs" />
<Compile Include="WULA_Energy\WulaCaravanEnergyDef.cs" />
<Compile Include="WulaFallenEmpireMod.cs" />
<Compile Include="WulaStatDefOf.cs" />
<Compile Include="Building_MaintenancePod.cs" />
<Compile Include="HediffComp_MaintenanceNeed.cs" />
<Compile Include="WULA_Energy\WulaStatDefOf.cs" />
<Compile Include="WULA_Maintenance\Building_MaintenancePod.cs" />
<Compile Include="WULA_Maintenance\HediffComp_MaintenanceNeed.cs" />
<Compile Include="HediffComp_DamageResponse.cs" />
<Compile Include="JobDefOf_WULA.cs" />
<Compile Include="WULA_Maintenance\JobDefOf_WULA.cs" />
<Compile Include="ThingDefOf_WULA.cs" />
<Compile Include="WeaponSwitch.cs" />
<Compile Include="Cinder_WeaponSwitch\WeaponSwitch.cs" />
<Compile Include="Verb\CompMultiStrike.cs" />
<Compile Include="Verb\Verb_MeleeAttack_MultiStrike.cs" />
<Compile Include="Projectile_ExplosiveWithTrail.cs" />
<Compile Include="BulletWithTrail.cs" />
<Compile Include="ArmedShuttleIncoming.cs" />
<Compile Include="Building_ArmedShuttle.cs" />
<Compile Include="Projectiles\Projectile_ExplosiveWithTrail.cs" />
<Compile Include="Projectiles\BulletWithTrail.cs" />
<Compile Include="WULA_Shuttle\ArmedShuttleIncoming.cs" />
<Compile Include="WULA_Shuttle\Building_ArmedShuttle.cs" />
<Compile Include="HarmonyPatches\Patch_DropCellFinder_SkyfallerCanLandAt.cs" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 自定义清理任务删除obj文件夹中的临时文件 -->
<Target Name="CleanDebugFiles" AfterTargets="Build">
<RemoveDir Directories="$(ProjectDir)obj\Debug" />
<RemoveDir Directories="$(ProjectDir)obj\Release" />
</Target
>
</Target>
</Project>