@myclaw163/clawclaw-cli 0.7.9 → 0.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/QUICKSTART_OTHER.md +2 -2
- package/docs/configuration.md +1 -1
- package/package.json +1 -1
- package/scripts/check-skill-command-surface.mjs +2 -0
- package/skills/clawclaw/SKILL.md +64 -43
- package/skills/clawclaw/references/CHATTERBOX.md +1 -1
- package/skills/clawclaw/references/CLAUDE-CODE-MONITOR.md +2 -2
- package/skills/clawclaw/references/COMMANDS.md +31 -19
- package/skills/clawclaw/references/GAME-MECHANICS.md +3 -3
- package/skills/clawclaw/references/STRATEGIES.md +1 -1
- package/skills/clawclaw/references/STREAM.md +3 -3
- package/src/cli.ts +7 -1
- package/src/commands/communication.test.ts +14 -3
- package/src/commands/communication.ts +12 -4
- package/src/commands/game/index.test.ts +198 -1
- package/src/commands/game/index.ts +229 -4
- package/src/commands/load.test.ts +68 -1
- package/src/commands/load.ts +26 -3
- package/src/pipeline/event-format.test.ts +0 -21
- package/src/pipeline/event-format.ts +0 -33
- package/src/pipeline/event-hints.test.ts +2 -5
- package/src/pipeline/event-hints.ts +0 -17
- package/src/pipeline/game-sync-event-normalization.test.ts +1 -12
- package/src/pipeline/game-sync-event-normalization.ts +0 -13
- package/src/runtime/clawclaw/plugins/strategy/strategy-action.ts +11 -4
- package/src/runtime/clawclaw-event-catalog.ts +0 -2
- package/src/sdk/action.ts +9 -8
- package/src/sdk/strategy-plugin/index.test.ts +3 -3
- package/src/sdk/strategy-plugin/index.ts +25 -24
- package/src/strategies/custom-module.test.ts +1 -1
- package/src/strategies/game-utils.test.ts +8 -8
- package/src/strategies/game-utils.ts +39 -28
- package/src/strategies/goals/crab-octopus-reflexes.ts +11 -7
- package/src/strategies/goals/hide-top.ts +2 -1
- package/src/strategies/goals/kill-target-goal.ts +2 -1
- package/src/strategies/goals/kill-target-top.ts +3 -3
- package/src/strategies/goals/lone-kill-core.ts +3 -1
- package/src/strategies/goals/task-kill-report-top.ts +2 -1
- package/src/strategies/goals/warrior-shrimp-top.ts +2 -1
|
@@ -34,8 +34,9 @@ export class KillVisibleTargetGoal extends Goal {
|
|
|
34
34
|
|
|
35
35
|
if (d <= killCommitRange(state.you.role)) {
|
|
36
36
|
if (canUseKill(state)) {
|
|
37
|
+
if (target.seat == null || target.seat <= 0) return [];
|
|
37
38
|
ctx.notifications.push(`发现追杀目标${target.name},出刀!`);
|
|
38
|
-
return [strategyDecision(Action.kill(target.
|
|
39
|
+
return [strategyDecision(Action.kill(target.seat), playerStrategyIntent(target, '追杀', 'acting'))];
|
|
39
40
|
}
|
|
40
41
|
if (d > LONE_FOLLOW_DISTANCE) {
|
|
41
42
|
return [strategyDecision(Action.move({ x: target.x, y: target.y }), playerStrategyIntent(target, '追杀', 'moving'))];
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
pursueVisibleTarget,
|
|
16
16
|
setStrategyIntent,
|
|
17
17
|
strategyPlayerLabel,
|
|
18
|
+
targetSeat,
|
|
18
19
|
} from '../game-utils.js';
|
|
19
20
|
import type { BehaviorDecision, StrategyContext } from '../types.js';
|
|
20
21
|
import { Goal } from './goal.js';
|
|
@@ -92,9 +93,8 @@ export class KillTargetTop extends Goal {
|
|
|
92
93
|
|
|
93
94
|
private isValidTarget(t: string, state: GameState, ctx: StrategyContext): boolean {
|
|
94
95
|
if (!isTargetAlive(state, t, ctx)) return false;
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
return !ctx.teammates.has(resolvedName);
|
|
96
|
+
const seat = targetSeat(t, ctx);
|
|
97
|
+
return !(seat != null && ctx.teammates.has(String(seat)));
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
private allTargetsDeadInState(state: GameState, ctx: StrategyContext): boolean {
|
|
@@ -76,7 +76,9 @@ export class LoneKillCore {
|
|
|
76
76
|
const d = target.distance ?? dist(state.you.x, state.you.y, target.x, target.y);
|
|
77
77
|
if (d <= killCommitRange(state.you.role) && canUseKill(state)) {
|
|
78
78
|
ctx.notifications.push(`发现落单目标${target.name},出刀!`);
|
|
79
|
-
|
|
79
|
+
if (target.seat != null && target.seat > 0) {
|
|
80
|
+
return strategyDecision(Action.kill(target.seat), playerStrategyIntent(target, '追杀', 'acting'));
|
|
81
|
+
}
|
|
80
82
|
}
|
|
81
83
|
if (d > killCommitRange(state.you.role)) ctx.notifications.push(`发现落单目标${target.name},正在靠近!`);
|
|
82
84
|
return strategyDecision(Action.move({ x: target.x, y: target.y }), playerStrategyIntent(target, '追杀', 'moving'));
|
|
@@ -64,8 +64,9 @@ export class TaskKillReportTop extends Goal {
|
|
|
64
64
|
|
|
65
65
|
if (nearest.dist <= killCommitRange(state.you.role) && killReady) {
|
|
66
66
|
ctx.notifications.push(`嫌疑目标${nearest.player.name}在攻击范围内,出刀!`);
|
|
67
|
+
if (nearest.player.seat == null || nearest.player.seat <= 0) return this.emitDecisions(state, ctx, [], URGENT_GOAL_PRIORITY);
|
|
67
68
|
return this.emitDecisions(state, ctx, [strategyDecision(
|
|
68
|
-
Action.kill(nearest.player.
|
|
69
|
+
Action.kill(nearest.player.seat),
|
|
69
70
|
playerStrategyIntent(nearest.player, '追杀', 'acting'),
|
|
70
71
|
)], URGENT_GOAL_PRIORITY);
|
|
71
72
|
}
|
|
@@ -87,7 +87,8 @@ export class WarriorShrimpTop extends Goal {
|
|
|
87
87
|
?? (CORPSE_SCENE_KILL_ENABLED ? this.nearestKillable(state, ctx, visible, false) : null);
|
|
88
88
|
if (victim) {
|
|
89
89
|
this.clearSub();
|
|
90
|
-
|
|
90
|
+
if (victim.seat == null || victim.seat <= 0) return [];
|
|
91
|
+
return [strategyDecision(Action.kill(victim.seat), playerStrategyIntent(victim, '追杀', 'acting'))];
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
|