// 注册单个战斗按钮
maplebirch.combat.CombatAction.reg({
id: "custom_attack",
actionType: "leftaction",
cond: (ctx) => V.player.health > 0 && V.player.hasWeapon,
display: (ctx) => (V.player.weaponType === "sword" ? "剑击" : "攻击"),
value: "customAttack",
color: "white",
difficulty: "简单",
combatType: "Default",
order: 0,
});
// 同一按钮在多个部位显示:actionType 使用数组
maplebirch.combat.CombatAction.reg({
id: "dual_strike",
actionType: ["leftaction", "rightaction"],
cond: (ctx) => V.player.health > 0,
display: "双手斩击",
value: "dualStrike",
color: "red",
difficulty: "双手同时攻击",
combatType: "Default",
order: 0,
});
// 注册多个战斗按钮
maplebirch.combat.CombatAction.reg(
{
id: "defensive_stance",
actionType: "rightaction",
cond: (ctx) => V.player.stamina >= 20,
display: "防御姿态",
value: "defensiveStance",
color: "blue",
difficulty: "中等",
combatType: "Default",
},
{
id: "healing_potion",
actionType: "mouthaction",
cond: (ctx) => V.player.inventory.healing_potion > 0,
display: (ctx) => `治疗药水 (剩余: ${V.player.inventory.healing_potion})`,
value: "useHealingPotion",
color: "green",
difficulty: "容易",
combatType: "Default",
},
);