暂存
This commit is contained in:
Binary file not shown.
@@ -70,7 +70,22 @@
|
|||||||
<workSpeedStat>ResearchSpeedFactor</workSpeedStat>
|
<workSpeedStat>ResearchSpeedFactor</workSpeedStat>
|
||||||
</li>
|
</li>
|
||||||
<li Class="ArachnaeSwarm.CompProperties_Morphable">
|
<li Class="ArachnaeSwarm.CompProperties_Morphable">
|
||||||
|
<!-- 休息速度增益,例如1.0代表200%的速度 -->
|
||||||
<restGainMultiplier>1.0</restGainMultiplier>
|
<restGainMultiplier>1.0</restGainMultiplier>
|
||||||
|
|
||||||
|
<!-- 操作按钮的自定义标签 -->
|
||||||
|
<gizmoLabel>离开织座</gizmoLabel>
|
||||||
|
|
||||||
|
<!-- 操作按钮的自定义描述 -->
|
||||||
|
<gizmoDesc>使织域种离开织座。</gizmoDesc>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
操作按钮的自定义图标路径。
|
||||||
|
路径相对于"Textures"文件夹。
|
||||||
|
例如,如果你的图标在 "YourMod/Textures/UI/Icons/Revert.png",路径就是 "UI/Icons/Revert"。
|
||||||
|
游戏会自动处理.png扩展名。
|
||||||
|
-->
|
||||||
|
<gizmoIconPath>UI/Commands/EggSpew</gizmoIconPath>
|
||||||
</li>
|
</li>
|
||||||
<li Class="ArachnaeSwarm.CompProperties_RefuelableNutrition">
|
<li Class="ArachnaeSwarm.CompProperties_RefuelableNutrition">
|
||||||
<fuelFilter>
|
<fuelFilter>
|
||||||
|
|||||||
@@ -223,7 +223,19 @@ namespace ArachnaeSwarm
|
|||||||
// 计算将要对 Pawn 造成的伤害
|
// 计算将要对 Pawn 造成的伤害
|
||||||
float damageProportion = dinfo.Amount / this.def.statBases.GetStatValueFromList(StatDefOf.MaxHitPoints, 1f);
|
float damageProportion = dinfo.Amount / this.def.statBases.GetStatValueFromList(StatDefOf.MaxHitPoints, 1f);
|
||||||
float pawnDamage = pawn.MaxHitPoints * damageProportion;
|
float pawnDamage = pawn.MaxHitPoints * damageProportion;
|
||||||
DamageInfo pawnDinfo = new DamageInfo(dinfo.Def, pawnDamage, dinfo.ArmorPenetrationInt, dinfo.Angle, dinfo.Instigator, null, dinfo.Weapon, dinfo.Category, dinfo.IntendedTarget);
|
|
||||||
|
// 关键修复:创建一个新的、干净的DamageInfo,不指定hitPart,让游戏自动选择有效的部位
|
||||||
|
DamageInfo pawnDinfo = new DamageInfo(
|
||||||
|
def: dinfo.Def,
|
||||||
|
amount: pawnDamage,
|
||||||
|
armorPenetration: dinfo.ArmorPenetrationInt,
|
||||||
|
angle: dinfo.Angle,
|
||||||
|
instigator: dinfo.Instigator,
|
||||||
|
hitPart: null, // 明确设为null,防止继承无效上下文
|
||||||
|
weapon: dinfo.Weapon,
|
||||||
|
category: dinfo.Category,
|
||||||
|
intendedTarget: dinfo.IntendedTarget
|
||||||
|
);
|
||||||
|
|
||||||
// 调用统一的转换方法,它会处理建筑的移除、Pawn的生成和状态同步
|
// 调用统一的转换方法,它会处理建筑的移除、Pawn的生成和状态同步
|
||||||
compMorphable.TransformBackToPawn();
|
compMorphable.TransformBackToPawn();
|
||||||
|
|||||||
@@ -28,13 +28,21 @@ namespace ArachnaeSwarm
|
|||||||
{
|
{
|
||||||
if (parent.Faction == Faction.OfPlayer && storedPawn != null)
|
if (parent.Faction == Faction.OfPlayer && storedPawn != null)
|
||||||
{
|
{
|
||||||
yield return new Command_Action
|
Command_Action command = new Command_Action();
|
||||||
|
command.defaultLabel = Props.gizmoLabel;
|
||||||
|
command.defaultDesc = Props.gizmoDesc;
|
||||||
|
command.action = () => { TransformBackToPawn(); };
|
||||||
|
|
||||||
|
if (!Props.gizmoIconPath.NullOrEmpty())
|
||||||
{
|
{
|
||||||
defaultLabel = "恢复人形",
|
command.icon = ContentFinder<UnityEngine.Texture2D>.Get(Props.gizmoIconPath);
|
||||||
defaultDesc = "将此建筑恢复为人形。",
|
}
|
||||||
icon = TexCommand.ReleaseAnimals, // TODO: Replace with a proper icon
|
else
|
||||||
action = () => { TransformBackToPawn(); }
|
{
|
||||||
};
|
command.icon = TexCommand.ReleaseAnimals; // Fallback icon
|
||||||
|
}
|
||||||
|
|
||||||
|
yield return command;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,12 @@ namespace ArachnaeSwarm
|
|||||||
{
|
{
|
||||||
public class CompProperties_Morphable : CompProperties
|
public class CompProperties_Morphable : CompProperties
|
||||||
{
|
{
|
||||||
public float restGainMultiplier = 1f; // Default to 1.0 if not specified in XML
|
public float restGainMultiplier = 1f;
|
||||||
|
|
||||||
|
// Gizmo properties
|
||||||
|
public string gizmoLabel = "离开织座";
|
||||||
|
public string gizmoDesc = "使织域种离开织座。";
|
||||||
|
public string gizmoIconPath;
|
||||||
|
|
||||||
public CompProperties_Morphable()
|
public CompProperties_Morphable()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user