1
This commit is contained in:
Binary file not shown.
@@ -98,16 +98,6 @@
|
||||
<li>ManipulationLimbCore</li>
|
||||
</tags>
|
||||
</BodyPartDef>
|
||||
<BodyPartDef>
|
||||
<defName>WULA_Mobile_Bunker_Bodypart</defName>
|
||||
<label>地堡外壳</label>
|
||||
<hitPoints>250</hitPoints>
|
||||
<permanentInjuryChanceFactor>0</permanentInjuryChanceFactor>
|
||||
<skinCovered>false</skinCovered>
|
||||
<!-- <solid>true</solid> -->
|
||||
<frostbiteVulnerability>1</frostbiteVulnerability>
|
||||
<bleedRate>0</bleedRate>
|
||||
</BodyPartDef>
|
||||
<BodyPartDef>
|
||||
<defName>WULA_Shield_Field_Maintainer_Bodypart</defName>
|
||||
<label>反射盾发生器</label>
|
||||
|
||||
@@ -94,4 +94,97 @@
|
||||
</li>
|
||||
</hediffWounds> -->
|
||||
</FleshTypeDef>
|
||||
<FleshTypeDef>
|
||||
<defName>Wula_Mechunit_Fleshtype</defName>
|
||||
<corpseCategory>CorpsesMechanoid</corpseCategory>
|
||||
<damageEffecter>Damage_HitMechanoid</damageEffecter>
|
||||
<isOrganic>false</isOrganic>
|
||||
<genericWounds>
|
||||
<li>
|
||||
<texture>Things/Pawn/Wounds/WoundMechA</texture>
|
||||
</li>
|
||||
<li>
|
||||
<texture>Things/Pawn/Wounds/WoundMechB</texture>
|
||||
</li>
|
||||
<li>
|
||||
<texture>Things/Pawn/Wounds/WoundMechC</texture>
|
||||
</li>
|
||||
</genericWounds>
|
||||
<bandagedWounds>
|
||||
<li>
|
||||
<texture>Wula/Things/WulaSpecies/Wounds/WULA_Species_Wound_None</texture>
|
||||
</li>
|
||||
<!-- <li>
|
||||
<texture>Things/Pawn/Wounds/BandagedB</texture>
|
||||
</li>
|
||||
<li>
|
||||
<texture>Things/Pawn/Wounds/BandagedC</texture>
|
||||
</li> -->
|
||||
</bandagedWounds>
|
||||
<!-- <hediffWounds>
|
||||
<li MayRequire="Ludeon.RimWorld.Ideology">
|
||||
<hediff>Scarification</hediff>
|
||||
<wounds>
|
||||
<li>
|
||||
<texture>Things/Pawn/Wounds/ScarificationA</texture>
|
||||
<tintWithSkinColor>true</tintWithSkinColor>
|
||||
<displayOverApparel>false</displayOverApparel>
|
||||
<displayPermanent>false</displayPermanent>
|
||||
<drawOffsetSouth>(0, 0.001, -0.24)</drawOffsetSouth>
|
||||
<drawOffsetEastWest>(-0.03, 0.001, -0.24)</drawOffsetEastWest>
|
||||
</li>
|
||||
<li>
|
||||
<texture>Things/Pawn/Wounds/ScarificationB</texture>
|
||||
<tintWithSkinColor>true</tintWithSkinColor>
|
||||
<displayOverApparel>false</displayOverApparel>
|
||||
<displayPermanent>false</displayPermanent>
|
||||
<drawOffsetSouth>(0, 0.001, -0.24)</drawOffsetSouth>
|
||||
<drawOffsetEastWest>(-0.03, 0.001, -0.24)</drawOffsetEastWest>
|
||||
</li>
|
||||
<li>
|
||||
<texture>Things/Pawn/Wounds/ScarificationC</texture>
|
||||
<tintWithSkinColor>true</tintWithSkinColor>
|
||||
<displayOverApparel>false</displayOverApparel>
|
||||
<displayPermanent>false</displayPermanent>
|
||||
<drawOffsetSouth>(0, 0.001, -0.24)</drawOffsetSouth>
|
||||
<drawOffsetEastWest>(-0.03, 0.001, -0.24)</drawOffsetEastWest>
|
||||
</li>
|
||||
</wounds>
|
||||
</li>
|
||||
<li>
|
||||
<hediff>MissingBodyPart</hediff>
|
||||
<wounds>
|
||||
<li>
|
||||
<textureSouth>Things/Pawn/Wounds/MissingEye_Scar_south</textureSouth>
|
||||
<textureNorth>Things/Pawn/Wounds/MissingEye_Scar_south</textureNorth>
|
||||
<textureEast>Things/Pawn/Wounds/MissingEye_Scar_east</textureEast>
|
||||
<textureWest>Things/Pawn/Wounds/MissingEye_Scar_east</textureWest>
|
||||
<flipWest>true</flipWest>
|
||||
<onlyOnPart>Eye</onlyOnPart>
|
||||
<flipOnWoundAnchorTag>LeftEye</flipOnWoundAnchorTag>
|
||||
<flipOnRotation>South</flipOnRotation>
|
||||
<tintWithSkinColor>true</tintWithSkinColor>
|
||||
<missingBodyPartFresh>false</missingBodyPartFresh>
|
||||
<scale>0.7</scale>
|
||||
<drawOffsetSouth>(0, -0.001, -0.24)</drawOffsetSouth>
|
||||
<drawOffsetEastWest>(0, -0.001, -0.24)</drawOffsetEastWest>
|
||||
</li>
|
||||
<li>
|
||||
<textureSouth>Things/Pawn/Wounds/MissingEye_Fresh</textureSouth>
|
||||
<textureNorth>Things/Pawn/Wounds/MissingEye_Fresh</textureNorth>
|
||||
<textureEast>Things/Pawn/Wounds/MissingEye_Fresh</textureEast>
|
||||
<textureWest>Things/Pawn/Wounds/MissingEye_Fresh</textureWest>
|
||||
<flipWest>true</flipWest>
|
||||
<onlyOnPart>Eye</onlyOnPart>
|
||||
<flipOnWoundAnchorTag>LeftEye</flipOnWoundAnchorTag>
|
||||
<flipOnRotation>South</flipOnRotation>
|
||||
<missingBodyPartFresh>true</missingBodyPartFresh>
|
||||
<scale>0.7</scale>
|
||||
<drawOffsetSouth>(0, -0.001, -0.24)</drawOffsetSouth>
|
||||
<drawOffsetEastWest>(0, -0.001, -0.24)</drawOffsetEastWest>
|
||||
</li>
|
||||
</wounds>
|
||||
</li>
|
||||
</hediffWounds> -->
|
||||
</FleshTypeDef>
|
||||
</Defs>
|
||||
|
||||
@@ -13,4 +13,10 @@
|
||||
<drawSize>1</drawSize>
|
||||
</silhouetteGraphicData>
|
||||
</LifeStageDef>
|
||||
<LifeStageDef>
|
||||
<defName>Wula_Mechunit_LifeStage</defName>
|
||||
<label>机兵</label>
|
||||
<visible>true</visible>
|
||||
<milkable>false</milkable>
|
||||
</LifeStageDef>
|
||||
</Defs>
|
||||
@@ -270,32 +270,6 @@
|
||||
<controlGroupPortraitZoom>0.7</controlGroupPortraitZoom>
|
||||
</PawnKindDef>
|
||||
|
||||
<PawnKindDef ParentName="HeavyMechanoidKind">
|
||||
<defName>WULA_Mobile_Bunker</defName> <!-- 修改了defName以避免冲突 -->
|
||||
<label>BUk-1"地堡猫猫"</label>
|
||||
<race>WULA_Mobile_Bunker</race>
|
||||
<allowInMechClusters>false</allowInMechClusters>
|
||||
<defaultFactionType>PlayerColony</defaultFactionType>
|
||||
<canMeleeAttack>false</canMeleeAttack>
|
||||
<combatPower>200</combatPower>
|
||||
|
||||
<lifeStages>
|
||||
<li>
|
||||
<bodyGraphicData>
|
||||
<texPath>Wula/Things/WULA_Mobile_Bunker/Bodies/Naked_Thin</texPath>
|
||||
<maskPath>Wula/Things/WULA_Cat/AllegianceOverlays/None</maskPath>
|
||||
<shaderType>CutoutWithOverlay</shaderType>
|
||||
<graphicClass>Graphic_Multi</graphicClass>
|
||||
<drawSize>3.4</drawSize>
|
||||
<shadowData>
|
||||
<volume>(1.4, 1.8, 1.4)</volume>
|
||||
</shadowData>
|
||||
</bodyGraphicData>
|
||||
</li>
|
||||
</lifeStages>
|
||||
|
||||
<controlGroupPortraitZoom>0.7</controlGroupPortraitZoom>
|
||||
</PawnKindDef>
|
||||
<PawnKindDef ParentName="HeavyMechanoidKind">
|
||||
<defName>Wula_Mech_Mobile_Factory</defName> <!-- 修改了defName以避免冲突 -->
|
||||
<label>MFm-2"陆行舰"</label>
|
||||
|
||||
@@ -1099,133 +1099,6 @@
|
||||
</comps>
|
||||
</AlienRace.ThingDef_AlienRace>
|
||||
|
||||
<!-- 大型机械族 -->
|
||||
<AlienRace.ThingDef_AlienRace ParentName="WULA_BaseMechanoid">
|
||||
<defName>WULA_Mobile_Bunker</defName> <!-- 修改了defName以避免冲突 -->
|
||||
<label>BUk-1"地堡猫猫"</label>
|
||||
<description>四只猫猫在抬着地堡移动,虽然很难相信但是事实就是这样的。在地堡的射击窗里还有另外的两只乌拉猫猫,它们会操纵地堡的机枪向外射击。\n\n猫猫可以放下地堡,然后一股脑地钻进去,这会让地堡重新变为建筑。</description>
|
||||
<alienRace>
|
||||
<raceRestriction>
|
||||
<onlyUseRaceRestrictedApparel>true</onlyUseRaceRestrictedApparel>
|
||||
<onlyUseRaceRestrictedWeapons>true</onlyUseRaceRestrictedWeapons>
|
||||
</raceRestriction>
|
||||
<compatibility>
|
||||
<isFlesh>false</isFlesh>
|
||||
</compatibility>
|
||||
</alienRace>
|
||||
<statBases>
|
||||
<BandwidthCost>1</BandwidthCost>
|
||||
<MoveSpeed>3</MoveSpeed>
|
||||
<ArmorRating_Sharp>0.75</ArmorRating_Sharp>
|
||||
<ArmorRating_Blunt>0.75</ArmorRating_Blunt>
|
||||
<ArmorRating_Heat>0.75</ArmorRating_Heat>
|
||||
</statBases>
|
||||
<race>
|
||||
<!-- <body>WULA_Mobile_Bunker_Body</body> -->
|
||||
<baseBodySize>5</baseBodySize>
|
||||
<lifeStageAges>
|
||||
<li>
|
||||
<def>MechanoidFullyFormed</def>
|
||||
<minAge>0</minAge>
|
||||
<soundCall>Pawn_Wula_Mech_Mobile_Factory_Call</soundCall>
|
||||
</li>
|
||||
</lifeStageAges>
|
||||
<baseHealthScale>2</baseHealthScale>
|
||||
<mechWeightClass>Heavy</mechWeightClass>
|
||||
</race>
|
||||
<tools Inherit="False">
|
||||
<li>
|
||||
<label>碾压</label>
|
||||
<capacities>
|
||||
<li>Blunt</li>
|
||||
</capacities>
|
||||
<power>360</power>
|
||||
<cooldownTime>8</cooldownTime>
|
||||
<linkedBodyPartsGroup>Torso</linkedBodyPartsGroup>
|
||||
<ensureLinkedBodyPartsGroupAlwaysUsable>true</ensureLinkedBodyPartsGroupAlwaysUsable>
|
||||
</li>
|
||||
</tools>
|
||||
<comps>
|
||||
<li Class="WulaFallenEmpire.CompProperties_MultiTurretGun">
|
||||
<ID>0</ID>
|
||||
<turretDef>WULA_Cat_Bunker_TurretGun</turretDef>
|
||||
<!-- <angleOffset>-90</angleOffset> -->
|
||||
<renderNodeProperties>
|
||||
<li>
|
||||
<nodeClass>PawnRenderNode_TurretGun</nodeClass>
|
||||
<workerClass>PawnRenderNodeWorker_TurretGun</workerClass>
|
||||
<parentTagDef>Body</parentTagDef>
|
||||
<overrideMeshSize>(2, 2)</overrideMeshSize>
|
||||
<baseLayer>20</baseLayer>
|
||||
<pawnType>Any</pawnType>
|
||||
<drawData>
|
||||
<dataNorth>
|
||||
<rotationOffset>-90</rotationOffset>
|
||||
<offset>(-1, 0, -1.45)</offset>
|
||||
<flip>true</flip>
|
||||
<layer>-5</layer>
|
||||
</dataNorth>
|
||||
<dataEast>
|
||||
<rotationOffset>90</rotationOffset>
|
||||
<layer>-5</layer>
|
||||
<offset>(3.25, 0, -1)</offset>
|
||||
</dataEast>
|
||||
<dataSouth>
|
||||
<rotationOffset>-90</rotationOffset>
|
||||
<offset>(1.5, 0, -1.45)</offset>
|
||||
</dataSouth>
|
||||
<dataWest>
|
||||
<rotationOffset>90</rotationOffset>
|
||||
<offset>(-3.25, 0, -1)</offset>
|
||||
</dataWest>
|
||||
</drawData>
|
||||
</li>
|
||||
</renderNodeProperties>
|
||||
</li>
|
||||
<li Class="WulaFallenEmpire.CompProperties_MultiTurretGun">
|
||||
<ID>1</ID>
|
||||
<turretDef>WULA_Cat_Bunker_TurretGun</turretDef>
|
||||
<!-- <angleOffset>-90</angleOffset> -->
|
||||
<renderNodeProperties>
|
||||
<li>
|
||||
<nodeClass>PawnRenderNode_TurretGun</nodeClass>
|
||||
<workerClass>PawnRenderNodeWorker_TurretGun</workerClass>
|
||||
<parentTagDef>Body</parentTagDef>
|
||||
<overrideMeshSize>(2, 2)</overrideMeshSize>
|
||||
<baseLayer>20</baseLayer>
|
||||
<pawnType>Any</pawnType>
|
||||
<drawData>
|
||||
<dataNorth>
|
||||
<rotationOffset>-90</rotationOffset>
|
||||
<offset>(1, 0, -1.45)</offset>
|
||||
<layer>-5</layer>
|
||||
</dataNorth>
|
||||
<dataEast>
|
||||
<rotationOffset>-90</rotationOffset>
|
||||
<offset>(3.25, 0, -1)</offset>
|
||||
</dataEast>
|
||||
<dataSouth>
|
||||
<rotationOffset>-90</rotationOffset>
|
||||
<offset>(-1.6, 0, -1.45)</offset>
|
||||
</dataSouth>
|
||||
<dataWest>
|
||||
<rotationOffset>90</rotationOffset>
|
||||
<offset>(-3.25, 0, -1)</offset>
|
||||
<layer>-5</layer>
|
||||
</dataWest>
|
||||
</drawData>
|
||||
</li>
|
||||
</renderNodeProperties>
|
||||
</li>
|
||||
<!-- 转换回建筑组件 -->
|
||||
<li Class="WulaFallenEmpire.CompProperties_TransformIntoBuilding">
|
||||
<targetBuildingDef>WULA_Cat_Bunker</targetBuildingDef>
|
||||
<gizmoLabel>部署为乌拉猫猫地堡</gizmoLabel>
|
||||
<gizmoDesc>乌拉猫猫们把地堡扔在地上然后钻进去,重新转变为建筑。每一次转变为建筑后,都会有24小时的冷却时间,在此期间不允许重新变为BUk-1"地堡猫猫"。</gizmoDesc>
|
||||
<gizmoIconPath>Wula/UI/Commands/WULA_BunkerCat</gizmoIconPath>
|
||||
</li>
|
||||
</comps>
|
||||
</AlienRace.ThingDef_AlienRace>
|
||||
<AlienRace.ThingDef_AlienRace ParentName="WULA_BaseMechanoid">
|
||||
<defName>Wula_AI_Heavy_Panzer</defName> <!-- 修改了defName以避免冲突 -->
|
||||
<label>HAp-6"战车"</label>
|
||||
|
||||
454
1.6/1.6/Defs/ThingDefs_Races/WULA_Mechunit_Race.xml
Normal file
454
1.6/1.6/Defs/ThingDefs_Races/WULA_Mechunit_Race.xml
Normal file
@@ -0,0 +1,454 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
<ThingDef ParentName="BasePawn" Name="Wula_MechunitBase" Abstract="True">
|
||||
<!-- 重要!这个新的thingclass代表其是一台机甲,如果遗漏,接下来的内容都无法生效! -->
|
||||
<thingClass>WulaFallenEmpire.Wulamechunit</thingClass>
|
||||
<defaultPlacingRot>North</defaultPlacingRot>
|
||||
<soundImpactDefault>BulletImpact_Metal</soundImpactDefault>
|
||||
<altitudeLayer>Pawn</altitudeLayer>
|
||||
<tradeability>None</tradeability>
|
||||
<statBases>
|
||||
<StaggerDurationFactor>0</StaggerDurationFactor>
|
||||
<ComfyTemperatureMin>-99999</ComfyTemperatureMin>
|
||||
<ComfyTemperatureMax>99999</ComfyTemperatureMax>
|
||||
<Wildness>0</Wildness>
|
||||
<FilthRate>0</FilthRate>
|
||||
<CrawlSpeed>0</CrawlSpeed>
|
||||
<LeatherAmount>0</LeatherAmount>
|
||||
<MeatAmount>0</MeatAmount>
|
||||
<Flammability>0</Flammability>
|
||||
<ToxicResistance>1</ToxicResistance>
|
||||
<PsychicSensitivity>0</PsychicSensitivity>
|
||||
<InjuryHealingFactor>0</InjuryHealingFactor>
|
||||
<ToxicEnvironmentResistance>1</ToxicEnvironmentResistance>
|
||||
<VacuumResistance MayRequire="Ludeon.RimWorld.Odyssey">1</VacuumResistance>
|
||||
</statBases>
|
||||
<race>
|
||||
<trainability>None</trainability>
|
||||
<fleshType>Wula_Mechunit_Fleshtype</fleshType>
|
||||
<intelligence>ToolUser</intelligence>
|
||||
<hasCorpse>true</hasCorpse>
|
||||
<needsRest>false</needsRest>
|
||||
<hasGenders>false</hasGenders>
|
||||
<nameGenerator MayRequire="Ludeon.RimWorld.Biotech">NamerMech</nameGenerator>
|
||||
<isImmuneToInfections>true</isImmuneToInfections>
|
||||
<lifeStageAges>
|
||||
<li>
|
||||
<def>Wula_Mechunit_LifeStage</def>
|
||||
<minAge>0</minAge>
|
||||
<!-- <soundWounded>Pawn_Spelopede_Pain</soundWounded> -->
|
||||
<!-- <soundDeath>Pawn_Spelopede_Death</soundDeath> -->
|
||||
<!-- <soundCall>Pawn_Spelopede_Call</soundCall> -->
|
||||
<!-- <soundAngry>Pawn_Spelopede_Angry</soundAngry> -->
|
||||
</li>
|
||||
</lifeStageAges>
|
||||
</race>
|
||||
<tools>
|
||||
<li>
|
||||
<label>hoof</label>
|
||||
<capacities>
|
||||
<li>Blunt</li>
|
||||
<li>Poke</li>
|
||||
</capacities>
|
||||
<power>8</power>
|
||||
<cooldownTime>2</cooldownTime>
|
||||
<linkedBodyPartsGroup>Legs</linkedBodyPartsGroup>
|
||||
<chanceFactor>0.1</chanceFactor>
|
||||
</li>
|
||||
</tools>
|
||||
<!-- 实际上,机甲并没有needs,不过如果你希望为其专门写一个新的needs,倒也不是不行 -->
|
||||
<inspectorTabs Inherit="false">
|
||||
<li>WulaFallenEmpire.ITab_MechSkills</li>
|
||||
<li>ITab_Pawn_Health</li>
|
||||
<li>ITab_Pawn_Needs</li>
|
||||
<li>ITab_Pawn_Gear</li>
|
||||
<li>ITab_Pawn_Log</li>
|
||||
</inspectorTabs>
|
||||
</ThingDef>
|
||||
|
||||
<AlienRace.ThingDef_AlienRace ParentName="WULA_BaseMechanoid">
|
||||
<defName>Wula_AI_Heavy_Panzer</defName> <!-- 修改了defName以避免冲突 -->
|
||||
<label>HAp-6"战车"</label>
|
||||
<description></description>
|
||||
<uiIconPath>Wula/Things/Wula_AI_Heavy_Panzer/Wula_AI_Heavy_Panzer_Icon</uiIconPath>
|
||||
<alienRace>
|
||||
<raceRestriction>
|
||||
<weaponList>
|
||||
<li>Wula_AI_Heavy_Panzer_Main_Weapon</li>
|
||||
</weaponList>
|
||||
<onlyUseRaceRestrictedApparel>true</onlyUseRaceRestrictedApparel>
|
||||
<onlyUseRaceRestrictedWeapons>true</onlyUseRaceRestrictedWeapons>
|
||||
</raceRestriction>
|
||||
<compatibility>
|
||||
<isFlesh>false</isFlesh>
|
||||
</compatibility>
|
||||
</alienRace>
|
||||
<statBases>
|
||||
<BandwidthCost>1</BandwidthCost>
|
||||
<MoveSpeed>2</MoveSpeed>
|
||||
<EnergyShieldEnergyMax>2</EnergyShieldEnergyMax>
|
||||
<StaggerDurationFactor>0</StaggerDurationFactor>
|
||||
|
||||
<MaxFlightTime>9999</MaxFlightTime>
|
||||
<FlightCooldown>0</FlightCooldown>
|
||||
|
||||
<ArmorRating_Sharp>1</ArmorRating_Sharp>
|
||||
<ArmorRating_Blunt>1</ArmorRating_Blunt>
|
||||
<ArmorRating_Heat>2</ArmorRating_Heat>
|
||||
</statBases>
|
||||
<costList Inherit="False">
|
||||
<WULA_Alloy>300</WULA_Alloy>
|
||||
<WULA_Charge_Cube>18</WULA_Charge_Cube>
|
||||
<ComponentSpacer>2</ComponentSpacer>
|
||||
</costList>
|
||||
<race>
|
||||
<body>WULA_AI_Heavy_Panzer_Body</body>
|
||||
<baseBodySize>20</baseBodySize>
|
||||
<lifeStageAges>
|
||||
<li>
|
||||
<def>MechanoidFullyFormed</def>
|
||||
<minAge>0</minAge>
|
||||
<soundCall>Pawn_Wula_AI_Heavy_Panzer_Call</soundCall>
|
||||
</li>
|
||||
</lifeStageAges>
|
||||
<baseHealthScale>10</baseHealthScale>
|
||||
|
||||
<flightStartChanceOnJobStart>1</flightStartChanceOnJobStart>
|
||||
<mechWeightClass>Heavy</mechWeightClass>
|
||||
<!-- <thinkTreeConstant>WarUrchinConstant</thinkTreeConstant> -->
|
||||
</race>
|
||||
<tools Inherit="False">
|
||||
<li>
|
||||
<label>碾压</label>
|
||||
<capacities>
|
||||
<li>Blunt</li>
|
||||
</capacities>
|
||||
<power>360</power>
|
||||
<cooldownTime>8</cooldownTime>
|
||||
<linkedBodyPartsGroup>Torso</linkedBodyPartsGroup>
|
||||
<ensureLinkedBodyPartsGroupAlwaysUsable>true</ensureLinkedBodyPartsGroupAlwaysUsable>
|
||||
</li>
|
||||
</tools>
|
||||
<comps>
|
||||
<li Class="WulaFallenEmpire.CompProperties_MultiTurretGun">
|
||||
<ID>0</ID>
|
||||
<turretDef>Wula_AI_Heavy_Panzer_Turret_Weapon</turretDef>
|
||||
<!-- <angleOffset>-90</angleOffset> -->
|
||||
<renderNodeProperties>
|
||||
<li>
|
||||
<nodeClass>PawnRenderNode_TurretGun</nodeClass>
|
||||
<workerClass>PawnRenderNodeWorker_TurretGun</workerClass>
|
||||
<parentTagDef>Body</parentTagDef>
|
||||
<overrideMeshSize>(7, 7)</overrideMeshSize>
|
||||
<baseLayer>20</baseLayer>
|
||||
<pawnType>Any</pawnType>
|
||||
<drawData>
|
||||
<dataNorth>
|
||||
<rotationOffset>-90</rotationOffset>
|
||||
</dataNorth>
|
||||
<dataEast>
|
||||
<rotationOffset>-90</rotationOffset>
|
||||
</dataEast>
|
||||
<dataSouth>
|
||||
<rotationOffset>-90</rotationOffset>
|
||||
</dataSouth>
|
||||
<dataWest>
|
||||
<rotationOffset>90</rotationOffset>
|
||||
</dataWest>
|
||||
</drawData>
|
||||
</li>
|
||||
</renderNodeProperties>
|
||||
</li>
|
||||
<li Class="CompProperties_Shield">
|
||||
<startingTicksToReset>36000</startingTicksToReset><!-- 10 mins -->
|
||||
<minDrawSize>5.2</minDrawSize>
|
||||
<maxDrawSize>5.4</maxDrawSize>
|
||||
<energyLossPerDamage>0.02</energyLossPerDamage>
|
||||
<energyOnReset>4.0</energyOnReset>
|
||||
<blocksRangedWeapons>false</blocksRangedWeapons>
|
||||
</li>
|
||||
<!-- 飞行组件 -->
|
||||
<li Class="WulaFallenEmpire.CompProperties_PawnFlight">
|
||||
|
||||
<!-- 飞行触发条件:仅在征召时飞行 -->
|
||||
<flightCondition>Drafted</flightCondition>
|
||||
|
||||
<!-- 链接到我们刚刚创建的 AnimationDef -->
|
||||
<flyingAnimationNorth>WULA_Hover_FlyNorth</flyingAnimationNorth>
|
||||
<flyingAnimationEast>WULA_Hover_FlyEast</flyingAnimationEast>
|
||||
<flyingAnimationSouth>WULA_Hover_FlySouth</flyingAnimationSouth>
|
||||
</li>
|
||||
<li Class="WulaFallenEmpire.CompProperties_AreaDamage">
|
||||
<radius>1.5</radius>
|
||||
<damageIntervalTicks>30</damageIntervalTicks>
|
||||
<damageDef>Crush</damageDef>
|
||||
<damageAmount>3</damageAmount>
|
||||
<scaleWithPsychicSensitivity>false</scaleWithPsychicSensitivity>
|
||||
<affectFriendly>false</affectFriendly>
|
||||
<affectNeutral>false</affectNeutral>
|
||||
<affectHostile>true</affectHostile>
|
||||
<affectBuildings>false</affectBuildings>
|
||||
<ignoreFactionRelations>false</ignoreFactionRelations>
|
||||
<startEnabled>false</startEnabled>
|
||||
<toggleLabel>碾压伤害</toggleLabel>
|
||||
<toggleDescription>HAp-6"战车"可以将舰身稍微下沉一些并创造低压区,以碾压靠近的敌军——这同时会使得它伤害附近所有的散落物品。</toggleDescription>
|
||||
<toggleIconPath>Wula/UI/Commands/Wula_Mech_Mobile_Factory_AreaDamage</toggleIconPath>
|
||||
</li>
|
||||
</comps>
|
||||
</AlienRace.ThingDef_AlienRace>
|
||||
<ThingDef ParentName="Wula_MechunitBase">
|
||||
<defName>Wula_Basic_Panzer</defName>
|
||||
<label>DHM70-Rampart</label>
|
||||
<description>乌拉帝国的中型战争机械,以悬浮的方式穿梭于战场之上,使用破坏力巨大的自动炮和车体臼炮打击敌方,是乌拉帝国前锋部队的中流砥柱。</description>
|
||||
<statBases>
|
||||
<MoveSpeed>3.25</MoveSpeed>
|
||||
<MarketValue>17500</MarketValue>
|
||||
<MeleeDodgeChance>0.35</MeleeDodgeChance>
|
||||
<ArmorRating_Blunt>1.25</ArmorRating_Blunt>
|
||||
<ArmorRating_Sharp>1.25</ArmorRating_Sharp>
|
||||
<ArmorRating_Heat>1.5</ArmorRating_Heat>
|
||||
|
||||
<!-- 圣化镀层的数值,伤害*穿甲率低于此数值将被直接抵挡 -->
|
||||
<!-- value of the Sanctified Armour, damage * armor piercing rate below which will be directly resisted -->
|
||||
<DD_MechArmor>2</DD_MechArmor>
|
||||
</statBases>
|
||||
<race>
|
||||
<body>DD_Race_DHM69_Scythe_Body</body>
|
||||
<thinkTreeMain>DD_Battle_Mech_With_3_Pilot</thinkTreeMain>
|
||||
<baseBodySize>10</baseBodySize>
|
||||
<baseHealthScale>5</baseHealthScale>
|
||||
</race>
|
||||
<butcherProducts Inherit="False">
|
||||
<Steel>500</Steel>
|
||||
<Plasteel>300</Plasteel>
|
||||
<ComponentIndustrial>12</ComponentIndustrial>
|
||||
</butcherProducts>
|
||||
<comps>
|
||||
<li Class="DivineDiurganate.CompProperties_MechPilotHolder">
|
||||
<maxPilots>3</maxPilots>
|
||||
<pilotWorkTag>MechPilot</pilotWorkTag>
|
||||
|
||||
<ejectPilotHealthPercentThreshold>0.1</ejectPilotHealthPercentThreshold>
|
||||
|
||||
<summonPilotIcon>DivineDiurganate/UI/Commands/DD_Enter_Mech</summonPilotIcon>
|
||||
<ejectPilotIcon>DivineDiurganate/UI/Commands/DD_Exit_Mech</ejectPilotIcon>
|
||||
</li>
|
||||
<li Class="DivineDiurganate.CompProperties_MechFuel">
|
||||
<fuelType>Chemfuel</fuelType>
|
||||
<fuelCapacity>70</fuelCapacity>
|
||||
<dailyFuelConsumption>35</dailyFuelConsumption>
|
||||
|
||||
<refuelSpeedFactor>1</refuelSpeedFactor>
|
||||
<refuelDuration>240</refuelDuration>
|
||||
|
||||
<fuelBarColor>(0.6, 0.5, 0.4)</fuelBarColor>
|
||||
|
||||
<allowAutoRefuel>true</allowAutoRefuel>
|
||||
<autoRefuelThreshold>1</autoRefuelThreshold>
|
||||
|
||||
<shutdownWhenEmpty>true</shutdownWhenEmpty>
|
||||
</li>
|
||||
<li Class="DivineDiurganate.CompProperties_MechRepairable">
|
||||
<allowAutoRepair>true</allowAutoRepair>
|
||||
<healthPercentThreshold>1</healthPercentThreshold>
|
||||
|
||||
<repairAmountPerCycle>10</repairAmountPerCycle>
|
||||
|
||||
<repairSound></repairSound>
|
||||
<repairEffect>ConstructMetal</repairEffect>
|
||||
</li>
|
||||
<li Class="DivineDiurganate.CompProperties_MechInherentWeapon">
|
||||
<weaponDef>DD_DHM70_Rampart_Mech_Weapon</weaponDef>
|
||||
</li>
|
||||
<li Class="DivineDiurganate.CompProperties_MechDefaultPilot">
|
||||
<enableForNonPlayerFaction>true</enableForNonPlayerFaction>
|
||||
<enableForPlayerFaction>false</enableForPlayerFaction>
|
||||
|
||||
<defaultPilotChance>1.0</defaultPilotChance>
|
||||
<spawnOnlyIfNoPilot>true</spawnOnlyIfNoPilot>
|
||||
<replaceExistingPilots>false</replaceExistingPilots>
|
||||
<maxDefaultPilots>3</maxDefaultPilots>
|
||||
|
||||
<defaultPilots>
|
||||
<li>
|
||||
<pawnKind>DD_Ratkin_Pilot</pawnKind>
|
||||
<weight>1</weight>
|
||||
<required>false</required>
|
||||
</li>
|
||||
</defaultPilots>
|
||||
</li>
|
||||
<li Class="DivineDiurganate.CompProperties_MechSkillInheritance">
|
||||
<baseSkillLevelWhenNoPilot>0</baseSkillLevelWhenNoPilot>
|
||||
<skillMultiplierForPilots>1</skillMultiplierForPilots>
|
||||
</li>
|
||||
|
||||
<li Class="DivineDiurganate.CompProperties_MoteEmitterNorthward">
|
||||
<moteDef>DD_Mote_MechBlackSmoke</moteDef>
|
||||
<emitIntervalTicks>30</emitIntervalTicks>
|
||||
<emitIntervalMovingTicks>20</emitIntervalMovingTicks>
|
||||
<moveSpeed>1.5</moveSpeed>
|
||||
<lifetimeTicks>10</lifetimeTicks>
|
||||
<scale>0.25</scale>
|
||||
<offset>(0.85,0,2.25)</offset>
|
||||
</li>
|
||||
<li Class="DivineDiurganate.CompProperties_MoteEmitterNorthward">
|
||||
<moteDef>DD_Mote_MechBlackSmoke</moteDef>
|
||||
<emitIntervalTicks>30</emitIntervalTicks>
|
||||
<emitIntervalMovingTicks>20</emitIntervalMovingTicks>
|
||||
<moveSpeed>1.5</moveSpeed>
|
||||
<lifetimeTicks>10</lifetimeTicks>
|
||||
<scale>0.25</scale>
|
||||
<offset>(-0.85,0,2.25)</offset>
|
||||
</li>
|
||||
|
||||
<li Class="DivineDiurganate.CompProperties_MechMovementSound">
|
||||
<movementSound>DD_DHM70_Rampart_Mech_Moving_Sound</movementSound>
|
||||
</li>
|
||||
|
||||
<li Class="DivineDiurganate.CompProperties_MechSelfDestruct">
|
||||
<healthPercentThreshold>0.1</healthPercentThreshold> <!-- 15%血量时自毁 -->
|
||||
<wickTicks>120~180</wickTicks>
|
||||
<drawWick>true</drawWick>
|
||||
|
||||
<!-- 爆炸参数 -->
|
||||
<explosiveRadius>11.5</explosiveRadius>
|
||||
<explosiveDamageType>Flame</explosiveDamageType>
|
||||
<damageAmountBase>5</damageAmountBase>
|
||||
<armorPenetrationBase>2</armorPenetrationBase>
|
||||
<chanceToStartFire>0.25</chanceToStartFire>
|
||||
<damageFalloff>true</damageFalloff>
|
||||
<doVisualEffects>true</doVisualEffects>
|
||||
<doSoundEffects>true</doSoundEffects>
|
||||
<propagationSpeed>1</propagationSpeed>
|
||||
|
||||
<!-- 爆炸效果 -->
|
||||
<!-- <explosionEffect>Explosion</explosionEffect> -->
|
||||
<explosionSound>Explosion_Bomb</explosionSound>
|
||||
|
||||
<!-- 触发条件 -->
|
||||
<triggerOnDeath>true</triggerOnDeath>
|
||||
<triggerOnHealthThreshold>true</triggerOnHealthThreshold>
|
||||
<chanceNeverExplode>0</chanceNeverExplode> <!-- 5%几率永不爆炸 -->
|
||||
</li>
|
||||
|
||||
<li Class="DivineDiurganate.CompProperties_MultiTurretGun">
|
||||
<ID>0</ID>
|
||||
<turretDef>DD_DHM69_Scythe_MG_Turret</turretDef>
|
||||
<renderNodeProperties>
|
||||
<li>
|
||||
<nodeClass>PawnRenderNode_TurretGun</nodeClass>
|
||||
<workerClass>PawnRenderNodeWorker_TurretGun</workerClass>
|
||||
<parentTagDef>Body</parentTagDef>
|
||||
<overrideMeshSize>(2, 2)</overrideMeshSize>
|
||||
<baseLayer>20</baseLayer>
|
||||
<pawnType>Any</pawnType>
|
||||
</li>
|
||||
</renderNodeProperties>
|
||||
</li>
|
||||
<li Class="DivineDiurganate.CompProperties_MultiTurretGun">
|
||||
<ID>1</ID>
|
||||
<turretDef>DD_DHM69_Scythe_MG_Turret</turretDef>
|
||||
<renderNodeProperties>
|
||||
<li>
|
||||
<nodeClass>PawnRenderNode_TurretGun</nodeClass>
|
||||
<workerClass>PawnRenderNodeWorker_TurretGun</workerClass>
|
||||
<parentTagDef>Body</parentTagDef>
|
||||
<overrideMeshSize>(2, 2)</overrideMeshSize>
|
||||
<baseLayer>20</baseLayer>
|
||||
<pawnType>Any</pawnType>
|
||||
</li>
|
||||
</renderNodeProperties>
|
||||
</li>
|
||||
<li Class="DivineDiurganate.CompProperties_MultiTurretGun">
|
||||
<ID>2</ID>
|
||||
<turretDef>DD_DHM69_Scythe_MG_Turret</turretDef>
|
||||
<renderNodeProperties>
|
||||
<li>
|
||||
<nodeClass>PawnRenderNode_TurretGun</nodeClass>
|
||||
<workerClass>PawnRenderNodeWorker_TurretGun</workerClass>
|
||||
<parentTagDef>Body</parentTagDef>
|
||||
<overrideMeshSize>(2, 2)</overrideMeshSize>
|
||||
<baseLayer>20</baseLayer>
|
||||
<pawnType>Any</pawnType>
|
||||
</li>
|
||||
</renderNodeProperties>
|
||||
</li>
|
||||
|
||||
<li Class="DivineDiurganate.CompProperties_HediffGiverByKind">
|
||||
<!-- 调试模式 -->
|
||||
<debugMode>false</debugMode>
|
||||
|
||||
<!-- 默认配置(当没有特定PawnKind匹配时使用) -->
|
||||
<defaultHediffs>
|
||||
</defaultHediffs>
|
||||
<defaultAddChance>1</defaultAddChance>
|
||||
<defaultAllowDuplicates>false</defaultAllowDuplicates>
|
||||
|
||||
<!-- PawnKind特定配置 -->
|
||||
<pawnKindHediffs>
|
||||
<!-- Soldier类型的特定hediff -->
|
||||
<li>
|
||||
<pawnKind>DD_DHM70_Rampart_Mech_Prototype</pawnKind>
|
||||
<hediffs>
|
||||
<li>DD_MechPrototype</li>
|
||||
</hediffs>
|
||||
<addChance>1.0</addChance>
|
||||
<allowDuplicates>false</allowDuplicates>
|
||||
</li>
|
||||
</pawnKindHediffs>
|
||||
</li>
|
||||
</comps>
|
||||
</ThingDef>
|
||||
<PawnKindDef>
|
||||
<defName>DD_DHM70_Rampart_Mech</defName>
|
||||
<label>DHM70-Rampart</label>
|
||||
<race>DD_DHM70_Rampart_Mech</race>
|
||||
<defaultFactionType>PlayerColony</defaultFactionType>
|
||||
<forceDeathOnDowned>false</forceDeathOnDowned>
|
||||
<forceNoDeathNotification>false</forceNoDeathNotification>
|
||||
<collidesWithPawns>false</collidesWithPawns>
|
||||
<combatPower>800</combatPower>
|
||||
<weaponTags>
|
||||
<li>DD_DHM70_Rampart_Mech_Weapon</li>
|
||||
</weaponTags>
|
||||
<weaponMoney>99999~99999</weaponMoney>
|
||||
<lifeStages>
|
||||
<li>
|
||||
<bodyGraphicData>
|
||||
<texPath>DivineDiurganate/Things/DD_DHM70_Rampart/Naked_Thin</texPath>
|
||||
<drawSize>6.5</drawSize>
|
||||
<shadowData>
|
||||
<volume>(2 ,2, 0.8)</volume>
|
||||
<offset>(0,0,-0.15)</offset>
|
||||
</shadowData>
|
||||
</bodyGraphicData>
|
||||
</li>
|
||||
</lifeStages>
|
||||
</PawnKindDef>
|
||||
<PawnKindDef>
|
||||
<defName>DD_DHM70_Rampart_Mech_Prototype</defName>
|
||||
<label>DHM70-Rampart Prototype</label>
|
||||
<race>DD_DHM70_Rampart_Mech</race>
|
||||
<defaultFactionType>PlayerColony</defaultFactionType>
|
||||
<forceDeathOnDowned>false</forceDeathOnDowned>
|
||||
<forceNoDeathNotification>false</forceNoDeathNotification>
|
||||
<collidesWithPawns>false</collidesWithPawns>
|
||||
<combatPower>900</combatPower>
|
||||
<weaponTags>
|
||||
<li>DD_DHM70_Rampart_Mech_Weapon</li>
|
||||
</weaponTags>
|
||||
<weaponMoney>99999~99999</weaponMoney>
|
||||
<lifeStages>
|
||||
<li>
|
||||
<bodyGraphicData>
|
||||
<texPath>DivineDiurganate/Things/DD_DHM70_Rampart/Prototype</texPath>
|
||||
<drawSize>6.5</drawSize>
|
||||
<shadowData>
|
||||
<volume>(2 ,2, 0.8)</volume>
|
||||
<offset>(0,0,-0.15)</offset>
|
||||
</shadowData>
|
||||
</bodyGraphicData>
|
||||
</li>
|
||||
</lifeStages>
|
||||
</PawnKindDef>
|
||||
</Defs>
|
||||
443
Source/WulaFallenEmpire/ITab/ITab_MechSkills.cs
Normal file
443
Source/WulaFallenEmpire/ITab/ITab_MechSkills.cs
Normal file
@@ -0,0 +1,443 @@
|
||||
// File: ITab_MechSkills.cs
|
||||
using RimWorld;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Verse;
|
||||
|
||||
namespace WulaFallenEmpire
|
||||
{
|
||||
/// <summary>
|
||||
/// 专业版:使用网格系统布局
|
||||
/// </summary>
|
||||
public class ITab_MechSkills : ITab
|
||||
{
|
||||
private Vector2 scrollPosition = Vector2.zero;
|
||||
private string nameBuffer = "";
|
||||
private bool isRenaming = false;
|
||||
|
||||
// 网格系统参数
|
||||
private const float GridSize = 8f;
|
||||
private const float HeaderRows = 4; // 头部占4行
|
||||
private const float PilotRows = 4; // 驾驶员信息占3行
|
||||
private const float TitleRows = 2; // 技能标题占1行
|
||||
private const float SkillRows = 18; // 技能区域占20行
|
||||
|
||||
public ITab_MechSkills()
|
||||
{
|
||||
this.size = new Vector2(520f, 600f);
|
||||
this.labelKey = "DD_MechSkills".Translate();
|
||||
}
|
||||
|
||||
protected override void FillTab()
|
||||
{
|
||||
var pawn = SelPawn;
|
||||
if (pawn == null)
|
||||
return;
|
||||
|
||||
if (pawn.TryGetComp<CompMechSkillInheritance>() == null)
|
||||
{
|
||||
DrawError("DD_NoMechSkillComps".Translate());
|
||||
return;
|
||||
}
|
||||
|
||||
DrawGridLayout(pawn);
|
||||
}
|
||||
|
||||
private void DrawGridLayout(Pawn pawn)
|
||||
{
|
||||
// 创建网格
|
||||
float rowHeight = size.y / (HeaderRows + PilotRows + TitleRows + SkillRows);
|
||||
|
||||
// 1. 头部区域
|
||||
Rect headerRect = new Rect(0, 0, size.x, rowHeight * HeaderRows);
|
||||
DrawGridHeader(headerRect, pawn, rowHeight);
|
||||
|
||||
// 2. 驾驶员区域
|
||||
float curY = headerRect.yMax;
|
||||
var pilotComp = pawn.TryGetComp<CompMechPilotHolder>();
|
||||
|
||||
if (pilotComp != null)
|
||||
{
|
||||
Rect pilotRect = new Rect(0, curY, size.x, rowHeight * PilotRows);
|
||||
DrawGridPilot(pilotRect, pilotComp, rowHeight);
|
||||
curY = pilotRect.yMax;
|
||||
}
|
||||
else
|
||||
{
|
||||
curY += rowHeight; // 空一行
|
||||
}
|
||||
|
||||
// 3. 技能区域
|
||||
Rect skillsRect = new Rect(0, curY, size.x, size.y - curY);
|
||||
DrawGridSkills(skillsRect, pawn, rowHeight);
|
||||
}
|
||||
private void DrawGridHeader(Rect rect, Pawn pawn, float rowHeight)
|
||||
{
|
||||
Widgets.DrawMenuSection(rect);
|
||||
|
||||
// 使用网格定位
|
||||
float padding = rowHeight * 0.5f;
|
||||
|
||||
if (isRenaming)
|
||||
{
|
||||
DrawRenameMode(rect, pawn, rowHeight, padding);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawNormalMode(rect, pawn, rowHeight, padding);
|
||||
}
|
||||
|
||||
// 状态行(第3-4行)- 始终显示
|
||||
DrawStatusLine(rect, pawn, rowHeight, padding);
|
||||
|
||||
Text.Anchor = TextAnchor.UpperLeft;
|
||||
}
|
||||
private void DrawRenameMode(Rect rect, Pawn pawn, float rowHeight, float padding)
|
||||
{
|
||||
Text.Font = GameFont.Medium;
|
||||
Text.Anchor = TextAnchor.MiddleLeft;
|
||||
|
||||
// 计算输入框和按钮的总宽度
|
||||
float totalWidth = rect.width - padding * 2;
|
||||
float buttonWidth = 85f; // 每个按钮85像素
|
||||
float spacing = 10f; // 按钮间距
|
||||
|
||||
// 计算可用宽度(减去按钮宽度)
|
||||
float availableWidth = totalWidth - (buttonWidth * 2 + spacing);
|
||||
|
||||
// 输入框
|
||||
Rect inputRect = new Rect(
|
||||
padding,
|
||||
padding,
|
||||
availableWidth,
|
||||
rowHeight * 1.5f
|
||||
);
|
||||
|
||||
nameBuffer = nameBuffer ?? pawn.Name?.ToStringShort ?? pawn.LabelShort;
|
||||
nameBuffer = Widgets.TextField(inputRect, nameBuffer);
|
||||
|
||||
// 确认按钮
|
||||
Rect confirmRect = new Rect(
|
||||
inputRect.xMax + spacing,
|
||||
inputRect.y,
|
||||
buttonWidth,
|
||||
inputRect.height
|
||||
);
|
||||
|
||||
// 取消按钮
|
||||
Rect cancelRect = new Rect(
|
||||
confirmRect.xMax + spacing,
|
||||
inputRect.y,
|
||||
buttonWidth,
|
||||
inputRect.height
|
||||
);
|
||||
|
||||
// 绘制按钮
|
||||
if (Widgets.ButtonText(confirmRect, "OK".Translate()))
|
||||
{
|
||||
if (pawn != null && !string.IsNullOrEmpty(nameBuffer))
|
||||
{
|
||||
pawn.Name = new NameSingle(nameBuffer, false);
|
||||
isRenaming = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (Widgets.ButtonText(cancelRect, "Cancel".Translate()))
|
||||
{
|
||||
isRenaming = false;
|
||||
}
|
||||
|
||||
// 添加回车键支持
|
||||
if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Return)
|
||||
{
|
||||
if (pawn != null && !string.IsNullOrEmpty(nameBuffer))
|
||||
{
|
||||
pawn.Name = new NameSingle(nameBuffer, false);
|
||||
isRenaming = false;
|
||||
Event.current.Use();
|
||||
}
|
||||
}
|
||||
|
||||
if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Escape)
|
||||
{
|
||||
isRenaming = false;
|
||||
Event.current.Use();
|
||||
}
|
||||
}
|
||||
private void DrawNormalMode(Rect rect, Pawn pawn, float rowHeight, float padding)
|
||||
{
|
||||
Text.Font = GameFont.Medium;
|
||||
Text.Anchor = TextAnchor.MiddleLeft;
|
||||
|
||||
// 名称行(第1-2行)
|
||||
Rect nameRect = new Rect(
|
||||
padding,
|
||||
padding,
|
||||
rect.width * 0.5f - padding * 2,
|
||||
rowHeight * 1.5f
|
||||
);
|
||||
|
||||
Widgets.Label(nameRect, pawn.Name?.ToStringShort ?? pawn.LabelShort);
|
||||
|
||||
// 重命名按钮(右对齐)
|
||||
if (pawn.Faction?.IsPlayer == true)
|
||||
{
|
||||
// 计算按钮宽度
|
||||
float renameButtonWidth = 100f;
|
||||
|
||||
Rect renameRect = new Rect(
|
||||
rect.width - padding - renameButtonWidth,
|
||||
padding,
|
||||
renameButtonWidth,
|
||||
rowHeight * 1.5f
|
||||
);
|
||||
|
||||
if (Widgets.ButtonText(renameRect, "Rename".Translate()))
|
||||
{
|
||||
isRenaming = true;
|
||||
nameBuffer = pawn.Name?.ToStringShort ?? pawn.LabelShort;
|
||||
}
|
||||
}
|
||||
}
|
||||
private void DrawStatusLine(Rect rect, Pawn pawn, float rowHeight, float padding)
|
||||
{
|
||||
Text.Font = GameFont.Small;
|
||||
GUI.color = new Color(0.8f, 0.8f, 0.8f);
|
||||
|
||||
// 状态行的y坐标取决于是否在重命名模式
|
||||
float statusY;
|
||||
if (isRenaming)
|
||||
{
|
||||
// 重命名模式下,状态行在输入框下方
|
||||
statusY = padding + rowHeight * 1.5f + padding * 0.5f;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 正常模式下,状态行在名称标签下方
|
||||
statusY = padding + rowHeight * 1.5f + padding * 0.5f;
|
||||
}
|
||||
|
||||
// 确保状态行不会超出头部区域
|
||||
Rect statusRect = new Rect(
|
||||
padding,
|
||||
statusY,
|
||||
rect.width - padding * 2,
|
||||
rowHeight * 1.5f
|
||||
);
|
||||
|
||||
string status = GetStatus(pawn);
|
||||
string type = "DD_Mech".Translate();
|
||||
Widgets.Label(statusRect, $"{type} | {status}");
|
||||
|
||||
GUI.color = Color.white;
|
||||
}
|
||||
|
||||
private void DrawGridPilot(Rect rect, CompMechPilotHolder pilotComp, float rowHeight)
|
||||
{
|
||||
float padding = rowHeight * 0.5f;
|
||||
|
||||
Widgets.DrawBox(rect);
|
||||
Widgets.DrawBoxSolid(rect, new Color(0.15f, 0.15f, 0.15f, 0.3f));
|
||||
|
||||
// 标题
|
||||
Rect titleRect = new Rect(
|
||||
padding,
|
||||
rect.y + padding,
|
||||
rect.width - padding * 2,
|
||||
rowHeight + 5f
|
||||
);
|
||||
|
||||
Text.Font = GameFont.Medium;
|
||||
Widgets.Label(titleRect, "DD_PilotTitle".Translate());
|
||||
Text.Font = GameFont.Small;
|
||||
|
||||
// 内容
|
||||
Rect contentRect = new Rect(
|
||||
padding,
|
||||
titleRect.yMax + padding * 0.5f,
|
||||
rect.width - padding * 2,
|
||||
rowHeight * 1.5f
|
||||
);
|
||||
|
||||
if (pilotComp.HasPilots)
|
||||
{
|
||||
var pilots = pilotComp.GetPilots();
|
||||
List<string> pilotNames = new List<string>();
|
||||
foreach (var pilot in pilots)
|
||||
{
|
||||
if (pilot != null) pilotNames.Add(pilot.LabelShort);
|
||||
}
|
||||
var pilotNamelist = string.Join(", ", pilotNames);
|
||||
Widgets.Label(contentRect, $"DD_PilotInfo".Translate(pilotNamelist));
|
||||
}
|
||||
else
|
||||
{
|
||||
GUI.color = Color.gray;
|
||||
Widgets.Label(contentRect, "DD_NoPilotShort".Translate());
|
||||
GUI.color = Color.white;
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawGridSkills(Rect rect, Pawn pawn, float rowHeight)
|
||||
{
|
||||
Widgets.DrawMenuSection(rect);
|
||||
|
||||
float padding = rowHeight * 0.5f;
|
||||
|
||||
// 标题
|
||||
Rect titleRect = new Rect(
|
||||
padding,
|
||||
rect.y + padding,
|
||||
rect.width - padding * 2,
|
||||
rowHeight + 5f
|
||||
);
|
||||
|
||||
Text.Font = GameFont.Medium;
|
||||
Widgets.Label(titleRect, "Skills".Translate());
|
||||
Text.Font = GameFont.Small;
|
||||
|
||||
// 技能列表区域
|
||||
Rect skillsArea = new Rect(
|
||||
0,
|
||||
titleRect.yMax + padding,
|
||||
rect.width,
|
||||
rect.height - (titleRect.yMax - rect.y) - padding
|
||||
);
|
||||
|
||||
if (pawn.skills == null || pawn.skills.skills.Count == 0)
|
||||
{
|
||||
GUI.color = Color.gray;
|
||||
Widgets.Label(skillsArea.ContractedBy(padding * 2), "DD_MechNoSkill".Translate());
|
||||
GUI.color = Color.white;
|
||||
return;
|
||||
}
|
||||
|
||||
// 滚动区域
|
||||
float skillHeight = rowHeight * 1.2f;
|
||||
float viewHeight = pawn.skills.skills.Count * skillHeight + padding * 2;
|
||||
|
||||
Rect viewRect = new Rect(0, 0, skillsArea.width - 16f, viewHeight);
|
||||
Widgets.BeginScrollView(skillsArea, ref scrollPosition, viewRect);
|
||||
|
||||
float curY = 0;
|
||||
foreach (var skill in pawn.skills.skills)
|
||||
{
|
||||
if (skill == null || skill.TotallyDisabled)
|
||||
continue;
|
||||
|
||||
Rect skillRect = new Rect(
|
||||
padding,
|
||||
curY,
|
||||
viewRect.width - padding * 2,
|
||||
skillHeight
|
||||
);
|
||||
|
||||
DrawGridSkill(skillRect, skill, rowHeight);
|
||||
curY += skillHeight + padding * 0.3f;
|
||||
}
|
||||
|
||||
Widgets.EndScrollView();
|
||||
}
|
||||
|
||||
private void DrawGridSkill(Rect rect, SkillRecord skill, float rowHeight)
|
||||
{
|
||||
// 背景
|
||||
if (Mouse.IsOver(rect))
|
||||
{
|
||||
Widgets.DrawHighlight(rect);
|
||||
}
|
||||
|
||||
// 布局:名称 | 进度条 | 等级
|
||||
float nameWidth = rect.width * 0.35f;
|
||||
float barWidth = rect.width * 0.45f;
|
||||
float levelWidth = rect.width * 0.2f;
|
||||
|
||||
// 名称
|
||||
Rect nameRect = new Rect(rect.x, rect.y, nameWidth, rect.height);
|
||||
Text.Anchor = TextAnchor.MiddleLeft;
|
||||
Widgets.Label(nameRect, skill.def.LabelCap);
|
||||
|
||||
// 进度条
|
||||
Rect barRect = new Rect(
|
||||
nameRect.xMax + rowHeight * 0.5f,
|
||||
rect.y + (rect.height - 12f) / 2f,
|
||||
barWidth - rowHeight,
|
||||
12f
|
||||
);
|
||||
Widgets.FillableBar(barRect, skill.Level / 20f);
|
||||
|
||||
// 等级
|
||||
Rect levelRect = new Rect(barRect.xMax + rowHeight * 0.5f, rect.y, levelWidth, rect.height);
|
||||
Text.Anchor = TextAnchor.MiddleRight;
|
||||
Widgets.Label(levelRect, $"Lv.{skill.Level}");
|
||||
|
||||
Text.Anchor = TextAnchor.UpperLeft;
|
||||
|
||||
// 工具提示
|
||||
if (Mouse.IsOver(rect))
|
||||
{
|
||||
TooltipHandler.TipRegion(rect,
|
||||
$"<b>{skill.def.LabelCap}</b>\n" +
|
||||
$"{skill.def.description}");
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawRenameButtons(Rect rect)
|
||||
{
|
||||
float buttonWidth = rect.width / 2 - 2.5f;
|
||||
|
||||
Rect confirmRect = new Rect(rect.x, rect.y, buttonWidth, rect.height);
|
||||
if (Widgets.ButtonText(confirmRect, "OK".Translate()))
|
||||
{
|
||||
var pawn = SelPawn;
|
||||
if (pawn != null && !string.IsNullOrEmpty(nameBuffer))
|
||||
{
|
||||
pawn.Name = new NameSingle(nameBuffer, false);
|
||||
isRenaming = false;
|
||||
}
|
||||
}
|
||||
|
||||
Rect cancelRect = new Rect(confirmRect.xMax + 5f, rect.y, buttonWidth, rect.height);
|
||||
if (Widgets.ButtonText(cancelRect, "Cancel".Translate()))
|
||||
{
|
||||
isRenaming = false;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetStatus(Pawn pawn)
|
||||
{
|
||||
if (pawn.Downed) return "Downed".Translate();
|
||||
if (pawn.Dead) return "Dead".Translate();
|
||||
if (pawn.Drafted) return "CommandDraftLabel".Translate();
|
||||
|
||||
var pilotComp = pawn.TryGetComp<CompMechPilotHolder>();
|
||||
if (pilotComp == null || !pilotComp.HasPilots)
|
||||
return "DD_NoPilot".Translate();
|
||||
|
||||
return "DD_Operational".Translate();
|
||||
}
|
||||
|
||||
private void DrawError(string message)
|
||||
{
|
||||
Rect rect = new Rect(0, 0, size.x, size.y);
|
||||
Widgets.DrawMenuSection(rect);
|
||||
|
||||
Text.Anchor = TextAnchor.MiddleCenter;
|
||||
Text.Font = GameFont.Medium;
|
||||
GUI.color = Color.yellow;
|
||||
Widgets.Label(rect.ContractedBy(30f), message);
|
||||
GUI.color = Color.white;
|
||||
Text.Font = GameFont.Small;
|
||||
Text.Anchor = TextAnchor.UpperLeft;
|
||||
}
|
||||
|
||||
public override bool IsVisible
|
||||
{
|
||||
get
|
||||
{
|
||||
var pawn = SelPawn;
|
||||
return pawn != null && pawn.TryGetComp<CompMechSkillInheritance>() != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,16 @@
|
||||
<ItemGroup>
|
||||
<!-- 第一部分:基础类和组件 -->
|
||||
<Compile Include="HediffComp\WULA_DamageResponse\HediffComp_DamageResponse.cs" />
|
||||
<Compile Include="HediffComp\WULA_DisappearWithEffect\HediffCompProperties_DisappearWithEffect.cs" />
|
||||
<Compile Include="HediffComp\WULA_GiveHediffsInRangeToRace\HediffCompProperties_GiveHediffsInRangeToRace.cs" />
|
||||
<Compile Include="HediffComp\WULA_GiveHediffsInRangeToRace\HediffComp_GiveHediffsInRangeToRace.cs" />
|
||||
<Compile Include="HediffComp\WULA_NanoRepair\HediffCompProperties_NanoRepair.cs" />
|
||||
<Compile Include="HediffComp\WULA_RegenerateBackstory\HediffComp_RegenerateBackstory.cs" />
|
||||
<Compile Include="HediffComp\WULA_SwitchableHediff\HediffCompProperties_SwitchableHediff.cs" />
|
||||
<Compile Include="HediffComp\WULA_SyncedWithMech\HediffCompProperties_SyncedWithMech.cs" />
|
||||
<Compile Include="HediffComp\WULA_TimedExplosion\HediffComp_TimedExplosion.cs" />
|
||||
<Compile Include="ITab\ITab_MechSkills.cs" />
|
||||
<Compile Include="Pawn\WULA_PawnRenderExtra\Comp_PawnRenderExtra.cs" />
|
||||
<Compile Include="WulaFallenEmpireMod.cs" />
|
||||
<Compile Include="WulaFallenEmpireSettings.cs" />
|
||||
<Compile Include="WulaLog.cs" />
|
||||
@@ -317,13 +326,6 @@
|
||||
<Compile Include="HarmonyPatches\WULA_TurretForceTargetable\CompForceTargetable.cs" />
|
||||
<Compile Include="HarmonyPatches\WULA_TurretForceTargetable\Patch_ForceTargetable.cs" />
|
||||
<!-- HediffComp 相关 -->
|
||||
<Compile Include="HediffComp\HediffCompProperties_DisappearWithEffect.cs" />
|
||||
<Compile Include="HediffComp\HediffCompProperties_GiveHediffsInRangeToRace.cs" />
|
||||
<Compile Include="HediffComp\HediffCompProperties_NanoRepair.cs" />
|
||||
<Compile Include="HediffComp\HediffCompProperties_SwitchableHediff.cs" />
|
||||
<Compile Include="HediffComp\HediffComp_GiveHediffsInRangeToRace.cs" />
|
||||
<Compile Include="HediffComp\HediffComp_RegenerateBackstory.cs" />
|
||||
<Compile Include="HediffComp\HediffComp_TimedExplosion.cs" />
|
||||
<Compile Include="HediffComp\WULA_HediffComp_TopTurret\HediffComp_TopTurret.cs" />
|
||||
<Compile Include="HediffComp\WULA_HediffDamgeShield\DRMDamageShield.cs" />
|
||||
<Compile Include="HediffComp\WULA_HediffDamgeShield\Hediff_DamageShield.cs" />
|
||||
@@ -334,7 +336,6 @@
|
||||
<Compile Include="Job\JobDriver_InspectBuilding.cs" />
|
||||
<Compile Include="Job\JobGiver_InspectBuilding.cs" />
|
||||
<!-- Pawn 相关 -->
|
||||
<Compile Include="Pawn\Comp_PawnRenderExtra.cs" />
|
||||
<Compile Include="Pawn\Mechunit.cs" />
|
||||
<Compile Include="Pawn\WULA_AutoMechCarrier\CompAutoMechCarrier.cs" />
|
||||
<Compile Include="Pawn\WULA_AutoMechCarrier\CompProperties_AutoMechCarrier.cs" />
|
||||
|
||||
Reference in New Issue
Block a user