mingyu-core 0.1.8 → 0.1.9
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/dist/bazi/baziAnalysis.d.ts.map +1 -1
- package/dist/bazi/baziAnalysis.js +0 -2
- package/dist/bazi/baziAnalysis.js.map +1 -1
- package/dist/bazi/baziAnalysisFormatter.d.ts.map +1 -1
- package/dist/bazi/baziAnalysisFormatter.js +9 -0
- package/dist/bazi/baziAnalysisFormatter.js.map +1 -1
- package/dist/bazi/baziCalculator.d.ts.map +1 -1
- package/dist/bazi/baziCalculator.js +61 -3
- package/dist/bazi/baziCalculator.js.map +1 -1
- package/dist/bazi/baziConditionMatchers/branchMatchers.d.ts +1 -0
- package/dist/bazi/baziConditionMatchers/branchMatchers.d.ts.map +1 -1
- package/dist/bazi/baziConditionMatchers/branchMatchers.js +13 -1
- package/dist/bazi/baziConditionMatchers/branchMatchers.js.map +1 -1
- package/dist/bazi/baziConditionMatchers/index.d.ts.map +1 -1
- package/dist/bazi/baziConditionMatchers/index.js +4 -2
- package/dist/bazi/baziConditionMatchers/index.js.map +1 -1
- package/dist/bazi/baziConditionMatchers/stemMatchers.d.ts +1 -0
- package/dist/bazi/baziConditionMatchers/stemMatchers.d.ts.map +1 -1
- package/dist/bazi/baziConditionMatchers/stemMatchers.js +7 -3
- package/dist/bazi/baziConditionMatchers/stemMatchers.js.map +1 -1
- package/dist/bazi/baziEnhancement/classicPatterns.d.ts.map +1 -1
- package/dist/bazi/baziEnhancement/classicPatterns.js +31 -11
- package/dist/bazi/baziEnhancement/classicPatterns.js.map +1 -1
- package/dist/bazi/baziPromptEnhancement.d.ts.map +1 -1
- package/dist/bazi/baziPromptEnhancement.js +49 -0
- package/dist/bazi/baziPromptEnhancement.js.map +1 -1
- package/dist/bazi/baziShenSha/helpers/dayRules.d.ts +0 -3
- package/dist/bazi/baziShenSha/helpers/dayRules.d.ts.map +1 -1
- package/dist/bazi/baziShenSha/helpers/dayRules.js +101 -56
- package/dist/bazi/baziShenSha/helpers/dayRules.js.map +1 -1
- package/dist/bazi/baziShenSha/helpers/disasterRules.d.ts +0 -3
- package/dist/bazi/baziShenSha/helpers/disasterRules.d.ts.map +1 -1
- package/dist/bazi/baziShenSha/helpers/disasterRules.js +745 -23
- package/dist/bazi/baziShenSha/helpers/disasterRules.js.map +1 -1
- package/dist/bazi/baziShenSha/helpers/globalRules.d.ts +0 -6
- package/dist/bazi/baziShenSha/helpers/globalRules.d.ts.map +1 -1
- package/dist/bazi/baziShenSha/helpers/globalRules.js +48 -16
- package/dist/bazi/baziShenSha/helpers/globalRules.js.map +1 -1
- package/dist/bazi/baziShenSha/helpers/luRules.d.ts +0 -3
- package/dist/bazi/baziShenSha/helpers/luRules.d.ts.map +1 -1
- package/dist/bazi/baziShenSha/helpers/luRules.js +266 -37
- package/dist/bazi/baziShenSha/helpers/luRules.js.map +1 -1
- package/dist/bazi/baziShenSha/helpers/marriageRules.d.ts +0 -3
- package/dist/bazi/baziShenSha/helpers/marriageRules.d.ts.map +1 -1
- package/dist/bazi/baziShenSha/helpers/marriageRules.js +5 -7
- package/dist/bazi/baziShenSha/helpers/marriageRules.js.map +1 -1
- package/dist/bazi/baziShenSha/helpers/nobleRules.d.ts +0 -3
- package/dist/bazi/baziShenSha/helpers/nobleRules.d.ts.map +1 -1
- package/dist/bazi/baziShenSha/helpers/nobleRules.js +208 -41
- package/dist/bazi/baziShenSha/helpers/nobleRules.js.map +1 -1
- package/dist/bazi/baziShenSha/helpers/tenGodAnalysis.d.ts +0 -4
- package/dist/bazi/baziShenSha/helpers/tenGodAnalysis.d.ts.map +1 -1
- package/dist/bazi/baziShenSha/helpers/tenGodAnalysis.js +0 -8
- package/dist/bazi/baziShenSha/helpers/tenGodAnalysis.js.map +1 -1
- package/dist/bazi/baziShenSha/index.d.ts +0 -20
- package/dist/bazi/baziShenSha/index.d.ts.map +1 -1
- package/dist/bazi/baziShenSha/index.js +0 -20
- package/dist/bazi/baziShenSha/index.js.map +1 -1
- package/dist/bazi/baziShenSha/variants.d.ts +0 -3
- package/dist/bazi/baziShenSha/variants.d.ts.map +1 -1
- package/dist/bazi/baziShenSha/variants.js.map +1 -1
- package/dist/bazi/baziShenShaData.d.ts +0 -20
- package/dist/bazi/baziShenShaData.d.ts.map +1 -1
- package/dist/bazi/baziShenShaData.js +286 -34
- package/dist/bazi/baziShenShaData.js.map +1 -1
- package/dist/bazi/baziStrengthAnalyzer.d.ts.map +1 -1
- package/dist/bazi/baziStrengthAnalyzer.js +8 -9
- package/dist/bazi/baziStrengthAnalyzer.js.map +1 -1
- package/dist/bazi/baziTypes.d.ts +16 -0
- package/dist/bazi/baziTypes.d.ts.map +1 -1
- package/dist/bazi/baziTypes.js.map +1 -1
- package/dist/bazi/chinaDst.d.ts +36 -0
- package/dist/bazi/chinaDst.d.ts.map +1 -0
- package/dist/bazi/chinaDst.js +86 -0
- package/dist/bazi/chinaDst.js.map +1 -0
- package/dist/bazi/index.d.ts +4 -0
- package/dist/bazi/index.d.ts.map +1 -1
- package/dist/bazi/index.js +2 -1
- package/dist/bazi/index.js.map +1 -1
- package/dist/bazi/lifeStageAnalysis.d.ts.map +1 -1
- package/dist/bazi/lifeStageAnalysis.js +0 -3
- package/dist/bazi/lifeStageAnalysis.js.map +1 -1
- package/dist/bazi/nayinAnalysis.d.ts.map +1 -1
- package/dist/bazi/nayinAnalysis.js +0 -1
- package/dist/bazi/nayinAnalysis.js.map +1 -1
- package/dist/bazi/paipanWarnings.d.ts +25 -0
- package/dist/bazi/paipanWarnings.d.ts.map +1 -0
- package/dist/bazi/paipanWarnings.js +124 -0
- package/dist/bazi/paipanWarnings.js.map +1 -0
- package/dist/bazi/relationStructure.d.ts.map +1 -1
- package/dist/bazi/relationStructure.js +0 -4
- package/dist/bazi/relationStructure.js.map +1 -1
- package/dist/bazi/stemRootAnalysis.d.ts.map +1 -1
- package/dist/bazi/stemRootAnalysis.js +26 -16
- package/dist/bazi/stemRootAnalysis.js.map +1 -1
- package/dist/bazi/usefulGodPlacement.d.ts.map +1 -1
- package/dist/bazi/usefulGodPlacement.js +0 -2
- package/dist/bazi/usefulGodPlacement.js.map +1 -1
- package/dist/divination/algorithms/_shared/index.d.ts +1 -1
- package/dist/divination/algorithms/_shared/index.d.ts.map +1 -1
- package/dist/divination/algorithms/_shared/index.js +1 -1
- package/dist/divination/algorithms/_shared/index.js.map +1 -1
- package/dist/divination/algorithms/_shared/wuxing.d.ts +9 -8
- package/dist/divination/algorithms/_shared/wuxing.d.ts.map +1 -1
- package/dist/divination/algorithms/_shared/wuxing.js +40 -18
- package/dist/divination/algorithms/_shared/wuxing.js.map +1 -1
- package/dist/divination/algorithms/almanac.d.ts +2 -2
- package/dist/divination/algorithms/almanac.d.ts.map +1 -1
- package/dist/divination/algorithms/almanac.js +197 -32
- package/dist/divination/algorithms/almanac.js.map +1 -1
- package/dist/divination/algorithms/lenormand.js +2 -2
- package/dist/divination/algorithms/liuren/helpers/lessons.d.ts.map +1 -1
- package/dist/divination/algorithms/liuren/helpers/lessons.js +11 -7
- package/dist/divination/algorithms/liuren/helpers/lessons.js.map +1 -1
- package/dist/divination/algorithms/liuren/helpers/transmission.d.ts +6 -0
- package/dist/divination/algorithms/liuren/helpers/transmission.d.ts.map +1 -1
- package/dist/divination/algorithms/liuren/helpers/transmission.js +38 -0
- package/dist/divination/algorithms/liuren/helpers/transmission.js.map +1 -1
- package/dist/divination/algorithms/liuren/index.d.ts.map +1 -1
- package/dist/divination/algorithms/liuren/index.js +17 -14
- package/dist/divination/algorithms/liuren/index.js.map +1 -1
- package/dist/divination/algorithms/liuyao.d.ts +57 -0
- package/dist/divination/algorithms/liuyao.d.ts.map +1 -1
- package/dist/divination/algorithms/liuyao.js +221 -50
- package/dist/divination/algorithms/liuyao.js.map +1 -1
- package/dist/divination/algorithms/meihua/helpers/methods.d.ts +2 -2
- package/dist/divination/algorithms/meihua/helpers/methods.d.ts.map +1 -1
- package/dist/divination/algorithms/meihua/helpers/methods.js +47 -7
- package/dist/divination/algorithms/meihua/helpers/methods.js.map +1 -1
- package/dist/divination/algorithms/meihua/index.d.ts.map +1 -1
- package/dist/divination/algorithms/meihua/index.js +22 -15
- package/dist/divination/algorithms/meihua/index.js.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/_constants.d.ts +2 -4
- package/dist/divination/algorithms/qimen/helpers/_constants.d.ts.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/_constants.js +3 -5
- package/dist/divination/algorithms/qimen/helpers/_constants.js.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/classic-patterns.d.ts +15 -7
- package/dist/divination/algorithms/qimen/helpers/classic-patterns.d.ts.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/classic-patterns.js +814 -127
- package/dist/divination/algorithms/qimen/helpers/classic-patterns.js.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/directions.d.ts +4 -3
- package/dist/divination/algorithms/qimen/helpers/directions.d.ts.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/directions.js +16 -9
- package/dist/divination/algorithms/qimen/helpers/directions.js.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/jushu-extended.d.ts +7 -6
- package/dist/divination/algorithms/qimen/helpers/jushu-extended.d.ts.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/jushu-extended.js +55 -24
- package/dist/divination/algorithms/qimen/helpers/jushu-extended.js.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/jushu.d.ts +20 -13
- package/dist/divination/algorithms/qimen/helpers/jushu.d.ts.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/jushu.js +96 -61
- package/dist/divination/algorithms/qimen/helpers/jushu.js.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/layout.d.ts +1 -1
- package/dist/divination/algorithms/qimen/helpers/layout.d.ts.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/layout.js +18 -24
- package/dist/divination/algorithms/qimen/helpers/layout.js.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/pattern-combos.d.ts +12 -0
- package/dist/divination/algorithms/qimen/helpers/pattern-combos.d.ts.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/pattern-combos.js +1558 -9
- package/dist/divination/algorithms/qimen/helpers/pattern-combos.js.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/patterns.d.ts +6 -5
- package/dist/divination/algorithms/qimen/helpers/patterns.d.ts.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/patterns.js +74 -22
- package/dist/divination/algorithms/qimen/helpers/patterns.js.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/stem-pair-patterns.d.ts +8 -1
- package/dist/divination/algorithms/qimen/helpers/stem-pair-patterns.d.ts.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/stem-pair-patterns.js +731 -67
- package/dist/divination/algorithms/qimen/helpers/stem-pair-patterns.js.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/ying-qi.d.ts +10 -6
- package/dist/divination/algorithms/qimen/helpers/ying-qi.d.ts.map +1 -1
- package/dist/divination/algorithms/qimen/helpers/ying-qi.js +58 -25
- package/dist/divination/algorithms/qimen/helpers/ying-qi.js.map +1 -1
- package/dist/divination/algorithms/qimen/index.d.ts.map +1 -1
- package/dist/divination/algorithms/qimen/index.js +89 -18
- package/dist/divination/algorithms/qimen/index.js.map +1 -1
- package/dist/divination/algorithms/xiaoliuren.d.ts +1 -1
- package/dist/divination/algorithms/xiaoliuren.js +12 -12
- package/dist/divination/algorithms/xiaoliuren.js.map +1 -1
- package/dist/divination/config.d.ts +41 -0
- package/dist/divination/config.d.ts.map +1 -0
- package/dist/divination/config.js +111 -0
- package/dist/divination/config.js.map +1 -0
- package/dist/divination/divination-data.d.ts.map +1 -1
- package/dist/divination/divination-data.js +2 -4
- package/dist/divination/divination-data.js.map +1 -1
- package/dist/divination/engine/liuren-template.d.ts +4 -0
- package/dist/divination/engine/liuren-template.d.ts.map +1 -0
- package/dist/divination/engine/liuren-template.js +39 -0
- package/dist/divination/engine/liuren-template.js.map +1 -0
- package/dist/divination/engine/liuyao-template.d.ts +3 -0
- package/dist/divination/engine/liuyao-template.d.ts.map +1 -0
- package/dist/divination/engine/liuyao-template.js +46 -0
- package/dist/divination/engine/liuyao-template.js.map +1 -0
- package/dist/divination/engine/method-text.d.ts +6 -0
- package/dist/divination/engine/method-text.d.ts.map +1 -0
- package/dist/divination/engine/method-text.js +105 -0
- package/dist/divination/engine/method-text.js.map +1 -0
- package/dist/divination/share-text.d.ts +2 -0
- package/dist/divination/share-text.d.ts.map +1 -0
- package/dist/divination/share-text.js +8 -0
- package/dist/divination/share-text.js.map +1 -0
- package/dist/types/divination.d.ts +44 -0
- package/dist/types/divination.d.ts.map +1 -1
- package/dist/ziwei/iztro/build-analysis-payload/index.d.ts.map +1 -1
- package/dist/ziwei/iztro/build-analysis-payload/index.js +7 -1
- package/dist/ziwei/iztro/build-analysis-payload/index.js.map +1 -1
- package/dist/ziwei/iztro/pattern-detection.d.ts +4 -2
- package/dist/ziwei/iztro/pattern-detection.d.ts.map +1 -1
- package/dist/ziwei/iztro/pattern-detection.js +1300 -184
- package/dist/ziwei/iztro/pattern-detection.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,62 @@
|
|
|
5
5
|
*
|
|
6
6
|
* 这里只输出结构化算法结果,不生成应用层报告、评分报告或具体场景话术。
|
|
7
7
|
*/
|
|
8
|
+
import { auspiciousDoors, branchElements, diPanPalaces, doorElements, difficultDoors, difficultGods, branches, isControlling, isGenerating, starElements, supportiveGods, tiangan, } from './_constants.js';
|
|
9
|
+
const stemPressureRules = {
|
|
10
|
+
甲: { stemElement: '木', palaceElement: '金', palaces: [6, 7], issue: '木被金克' },
|
|
11
|
+
乙: { stemElement: '木', palaceElement: '金', palaces: [6, 7], issue: '木被金克' },
|
|
12
|
+
丙: { stemElement: '火', palaceElement: '水', palaces: [1], issue: '火被水克' },
|
|
13
|
+
丁: { stemElement: '火', palaceElement: '水', palaces: [1], issue: '火被水克' },
|
|
14
|
+
戊: { stemElement: '土', palaceElement: '木', palaces: [3, 4], issue: '土被木克' },
|
|
15
|
+
己: { stemElement: '土', palaceElement: '木', palaces: [3, 4], issue: '土被木克' },
|
|
16
|
+
庚: { stemElement: '金', palaceElement: '火', palaces: [9], issue: '金被火克' },
|
|
17
|
+
辛: { stemElement: '金', palaceElement: '火', palaces: [9], issue: '金被火克' },
|
|
18
|
+
壬: { stemElement: '水', palaceElement: '土', palaces: [2, 8], issue: '水被土克' },
|
|
19
|
+
癸: { stemElement: '水', palaceElement: '土', palaces: [2, 8], issue: '水被土克' },
|
|
20
|
+
};
|
|
21
|
+
const stemObjectClues = {
|
|
22
|
+
甲: '主木性直瘦、青蓝,兼丝麻布帛花果',
|
|
23
|
+
乙: '主木性直瘦、青蓝,兼丝麻布帛花果',
|
|
24
|
+
丙: '主火性尖斜华彩、赤紫,兼文书羽毛',
|
|
25
|
+
丁: '主火性尖斜华彩、赤紫,兼文书羽毛',
|
|
26
|
+
戊: '主土性方厚盘旋,兼沙土陶瓷',
|
|
27
|
+
己: '主土性方厚盘旋,兼沙土陶瓷',
|
|
28
|
+
庚: '主金性圆坚洁白,兼铁石有声',
|
|
29
|
+
辛: '主金性圆坚洁白,兼铁石有声',
|
|
30
|
+
壬: '主水族纹曲、苍黑,兼鳞甲珍珠',
|
|
31
|
+
癸: '主水族纹曲、苍黑,兼鳞甲珍珠',
|
|
32
|
+
};
|
|
33
|
+
const starObjectClues = {
|
|
34
|
+
天蓬: '主白色水象',
|
|
35
|
+
天芮: '主黑色土象',
|
|
36
|
+
天冲: '主碧色木象',
|
|
37
|
+
天辅: '主绿色木象',
|
|
38
|
+
天禽: '主黄色土象',
|
|
39
|
+
天心: '主白色金象',
|
|
40
|
+
天柱: '主赤色金象',
|
|
41
|
+
天任: '主白黄土象',
|
|
42
|
+
天英: '主紫赤火象',
|
|
43
|
+
};
|
|
44
|
+
const godObjectClues = {
|
|
45
|
+
值符: '主贵物财帛、首领之物',
|
|
46
|
+
螣蛇: '主怪异虚花、歪斜之物',
|
|
47
|
+
太阴: '主雕琢文书、羽毛飞物',
|
|
48
|
+
六合: '主布帛果实、两体交连',
|
|
49
|
+
白虎: '主伤损金石、锋芒破危',
|
|
50
|
+
玄武: '主水族胎形、字迹纹曲、秽污之物',
|
|
51
|
+
九地: '主深藏旧物、神祇暗昧',
|
|
52
|
+
九天: '主利器盘旋、有声有足、光亮之物',
|
|
53
|
+
};
|
|
54
|
+
const doorObjectClues = {
|
|
55
|
+
休门: '主坑坎包裹、休息聚藏',
|
|
56
|
+
生门: '主初成高大、发生隆起',
|
|
57
|
+
伤门: '主转动有声、震动捕获',
|
|
58
|
+
杜门: '主闭塞难通、未成隐藏',
|
|
59
|
+
景门: '主华彩光芒、投书发扬',
|
|
60
|
+
死门: '主废缺不活、吊死行刑',
|
|
61
|
+
惊门: '主损伤缺口、歪斜惊惶',
|
|
62
|
+
开门: '主通利刚健、圆转能动',
|
|
63
|
+
};
|
|
8
64
|
function hasName(patterns, name) {
|
|
9
65
|
return patterns.some((pattern) => pattern.name === name);
|
|
10
66
|
}
|
|
@@ -14,6 +70,489 @@ function hasTag(tags, tag) {
|
|
|
14
70
|
function getPalaceName(jiuGongGe, palace) {
|
|
15
71
|
return jiuGongGe.find((item) => item.gong === palace)?.name || `${palace}宫`;
|
|
16
72
|
}
|
|
73
|
+
function getPalace(jiuGongGe, palace) {
|
|
74
|
+
if (!palace)
|
|
75
|
+
return undefined;
|
|
76
|
+
return jiuGongGe.find((item) => item.gong === palace);
|
|
77
|
+
}
|
|
78
|
+
function findStarPalace(jiuGongGe, star) {
|
|
79
|
+
if (!star)
|
|
80
|
+
return undefined;
|
|
81
|
+
return jiuGongGe.find((item) => item.tianPan.star === star);
|
|
82
|
+
}
|
|
83
|
+
function findDoorPalace(jiuGongGe, door) {
|
|
84
|
+
if (!door)
|
|
85
|
+
return undefined;
|
|
86
|
+
return jiuGongGe.find((item) => item.renPan.door === door);
|
|
87
|
+
}
|
|
88
|
+
function findGodPalace(jiuGongGe, god) {
|
|
89
|
+
return jiuGongGe.find((item) => item.shenPan.god === god);
|
|
90
|
+
}
|
|
91
|
+
function findTianStemPalace(jiuGongGe, stem) {
|
|
92
|
+
if (!stem)
|
|
93
|
+
return undefined;
|
|
94
|
+
return jiuGongGe.find((item) => item.tianPan.stem === stem);
|
|
95
|
+
}
|
|
96
|
+
function getDoorSeasonQiState(doorElement, monthElement) {
|
|
97
|
+
if (!doorElement || !monthElement)
|
|
98
|
+
return undefined;
|
|
99
|
+
if (doorElement === monthElement)
|
|
100
|
+
return '旺';
|
|
101
|
+
if (isGenerating(doorElement, monthElement))
|
|
102
|
+
return '相';
|
|
103
|
+
if (isControlling(doorElement, monthElement))
|
|
104
|
+
return '休';
|
|
105
|
+
if (isControlling(monthElement, doorElement))
|
|
106
|
+
return '囚';
|
|
107
|
+
if (isGenerating(monthElement, doorElement))
|
|
108
|
+
return '废';
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
const branchOppositeMap = {
|
|
112
|
+
子: '午',
|
|
113
|
+
丑: '未',
|
|
114
|
+
寅: '申',
|
|
115
|
+
卯: '酉',
|
|
116
|
+
辰: '戌',
|
|
117
|
+
巳: '亥',
|
|
118
|
+
午: '子',
|
|
119
|
+
未: '丑',
|
|
120
|
+
申: '寅',
|
|
121
|
+
酉: '卯',
|
|
122
|
+
戌: '辰',
|
|
123
|
+
亥: '巳',
|
|
124
|
+
};
|
|
125
|
+
const palaceOppositeMap = {
|
|
126
|
+
1: 9,
|
|
127
|
+
2: 8,
|
|
128
|
+
3: 7,
|
|
129
|
+
4: 6,
|
|
130
|
+
6: 4,
|
|
131
|
+
7: 3,
|
|
132
|
+
8: 2,
|
|
133
|
+
9: 1,
|
|
134
|
+
};
|
|
135
|
+
const yangHourStems = new Set(['甲', '乙', '丙', '丁', '戊']);
|
|
136
|
+
const yinHourStems = new Set(['己', '庚', '辛', '壬', '癸']);
|
|
137
|
+
const mengBranches = new Set(['寅', '巳', '申', '亥']);
|
|
138
|
+
const zhongBranches = new Set(['子', '卯', '午', '酉']);
|
|
139
|
+
const jiBranches = new Set(['丑', '辰', '未', '戌']);
|
|
140
|
+
const eightGods = new Set([...supportiveGods, ...difficultGods]);
|
|
141
|
+
const yangStars = new Set(['天蓬', '天任', '天冲', '天辅', '天禽']);
|
|
142
|
+
const yinStars = new Set(['天英', '天芮', '天柱', '天心']);
|
|
143
|
+
const zhiFuOpenPalaces = new Set([1, 8, 3, 4]);
|
|
144
|
+
const zhiFuClosedPalaces = new Set([9, 2, 7, 6]);
|
|
145
|
+
const xingDeBySolarTerm = {
|
|
146
|
+
冬至: { baseTerm: '冬至', deBranch: '卯', xingBranch: '酉' },
|
|
147
|
+
小寒: { baseTerm: '冬至', deBranch: '卯', xingBranch: '酉' },
|
|
148
|
+
大寒: { baseTerm: '冬至', deBranch: '卯', xingBranch: '酉' },
|
|
149
|
+
立春: { baseTerm: '立春', deBranch: '辰', xingBranch: '戌' },
|
|
150
|
+
雨水: { baseTerm: '立春', deBranch: '辰', xingBranch: '戌' },
|
|
151
|
+
惊蛰: { baseTerm: '立春', deBranch: '辰', xingBranch: '戌' },
|
|
152
|
+
春分: { baseTerm: '春分', deBranch: '午', xingBranch: '子' },
|
|
153
|
+
清明: { baseTerm: '春分', deBranch: '午', xingBranch: '子' },
|
|
154
|
+
谷雨: { baseTerm: '春分', deBranch: '午', xingBranch: '子' },
|
|
155
|
+
立夏: { baseTerm: '立夏', deBranch: '未', xingBranch: '丑' },
|
|
156
|
+
小满: { baseTerm: '立夏', deBranch: '未', xingBranch: '丑' },
|
|
157
|
+
芒种: { baseTerm: '立夏', deBranch: '未', xingBranch: '丑' },
|
|
158
|
+
夏至: { baseTerm: '夏至', deBranch: '酉', xingBranch: '卯' },
|
|
159
|
+
小暑: { baseTerm: '夏至', deBranch: '酉', xingBranch: '卯' },
|
|
160
|
+
大暑: { baseTerm: '夏至', deBranch: '酉', xingBranch: '卯' },
|
|
161
|
+
立秋: { baseTerm: '立秋', deBranch: '戌', xingBranch: '辰' },
|
|
162
|
+
处暑: { baseTerm: '立秋', deBranch: '戌', xingBranch: '辰' },
|
|
163
|
+
白露: { baseTerm: '立秋', deBranch: '戌', xingBranch: '辰' },
|
|
164
|
+
秋分: { baseTerm: '秋分', deBranch: '子', xingBranch: '午' },
|
|
165
|
+
寒露: { baseTerm: '秋分', deBranch: '子', xingBranch: '午' },
|
|
166
|
+
霜降: { baseTerm: '秋分', deBranch: '子', xingBranch: '午' },
|
|
167
|
+
立冬: { baseTerm: '立冬', deBranch: '丑', xingBranch: '未' },
|
|
168
|
+
小雪: { baseTerm: '立冬', deBranch: '丑', xingBranch: '未' },
|
|
169
|
+
大雪: { baseTerm: '立冬', deBranch: '丑', xingBranch: '未' },
|
|
170
|
+
};
|
|
171
|
+
const sanJiaByXun = {
|
|
172
|
+
甲寅: '孟甲',
|
|
173
|
+
甲申: '孟甲',
|
|
174
|
+
甲子: '仲甲',
|
|
175
|
+
甲午: '仲甲',
|
|
176
|
+
甲辰: '季甲',
|
|
177
|
+
甲戌: '季甲',
|
|
178
|
+
};
|
|
179
|
+
const youDuBranchByDayStem = {
|
|
180
|
+
甲: '丑',
|
|
181
|
+
己: '丑',
|
|
182
|
+
乙: '子',
|
|
183
|
+
庚: '子',
|
|
184
|
+
丙: '寅',
|
|
185
|
+
辛: '寅',
|
|
186
|
+
丁: '巳',
|
|
187
|
+
壬: '巳',
|
|
188
|
+
戊: '申',
|
|
189
|
+
癸: '申',
|
|
190
|
+
};
|
|
191
|
+
const attackAvoidanceByDayStem = {
|
|
192
|
+
甲: { direction: '正西', palaces: [7] },
|
|
193
|
+
乙: { direction: '正西', palaces: [7] },
|
|
194
|
+
丙: { direction: '正北', palaces: [1] },
|
|
195
|
+
丁: { direction: '正北', palaces: [1] },
|
|
196
|
+
戊: { direction: '正东', palaces: [3] },
|
|
197
|
+
己: { direction: '正东', palaces: [3] },
|
|
198
|
+
庚: { direction: '正南', palaces: [9] },
|
|
199
|
+
辛: { direction: '正南', palaces: [9] },
|
|
200
|
+
壬: { direction: '四维', palaces: [8, 4, 2, 6] },
|
|
201
|
+
癸: { direction: '四维', palaces: [8, 4, 2, 6] },
|
|
202
|
+
};
|
|
203
|
+
const xiongBranchByMonthBranch = {
|
|
204
|
+
寅: '寅',
|
|
205
|
+
卯: '寅',
|
|
206
|
+
辰: '寅',
|
|
207
|
+
巳: '巳',
|
|
208
|
+
午: '巳',
|
|
209
|
+
未: '巳',
|
|
210
|
+
申: '申',
|
|
211
|
+
酉: '申',
|
|
212
|
+
戌: '申',
|
|
213
|
+
亥: '亥',
|
|
214
|
+
子: '亥',
|
|
215
|
+
丑: '亥',
|
|
216
|
+
};
|
|
217
|
+
const wuJiangDirectionByDayBranch = {
|
|
218
|
+
寅: { direction: '东方', palace: 3 },
|
|
219
|
+
午: { direction: '东方', palace: 3 },
|
|
220
|
+
戌: { direction: '东方', palace: 3 },
|
|
221
|
+
亥: { direction: '南方', palace: 9 },
|
|
222
|
+
卯: { direction: '南方', palace: 9 },
|
|
223
|
+
未: { direction: '南方', palace: 9 },
|
|
224
|
+
申: { direction: '西方', palace: 7 },
|
|
225
|
+
子: { direction: '西方', palace: 7 },
|
|
226
|
+
辰: { direction: '西方', palace: 7 },
|
|
227
|
+
巳: { direction: '北方', palace: 1 },
|
|
228
|
+
酉: { direction: '北方', palace: 1 },
|
|
229
|
+
丑: { direction: '北方', palace: 1 },
|
|
230
|
+
};
|
|
231
|
+
const daJiangJunBranchByYearBranch = {
|
|
232
|
+
寅: '巳',
|
|
233
|
+
卯: '巳',
|
|
234
|
+
辰: '巳',
|
|
235
|
+
巳: '卯',
|
|
236
|
+
午: '卯',
|
|
237
|
+
未: '卯',
|
|
238
|
+
申: '午',
|
|
239
|
+
酉: '午',
|
|
240
|
+
戌: '午',
|
|
241
|
+
亥: '酉',
|
|
242
|
+
子: '酉',
|
|
243
|
+
丑: '酉',
|
|
244
|
+
};
|
|
245
|
+
const shiZhongJiangXingHourByDayBranch = {
|
|
246
|
+
申: '卯',
|
|
247
|
+
子: '卯',
|
|
248
|
+
辰: '卯',
|
|
249
|
+
巳: '子',
|
|
250
|
+
酉: '子',
|
|
251
|
+
丑: '子',
|
|
252
|
+
亥: '午',
|
|
253
|
+
卯: '午',
|
|
254
|
+
未: '午',
|
|
255
|
+
寅: '酉',
|
|
256
|
+
午: '酉',
|
|
257
|
+
戌: '酉',
|
|
258
|
+
};
|
|
259
|
+
const tianMuDiErByXun = {
|
|
260
|
+
甲子: { tianMu: { ganZhi: '庚午', branch: '午' }, diEr: { ganZhi: '戊辰', branch: '辰' } },
|
|
261
|
+
甲戌: { tianMu: { ganZhi: '庚辰', branch: '辰' }, diEr: { ganZhi: '戊寅', branch: '寅' } },
|
|
262
|
+
甲申: { tianMu: { ganZhi: '庚寅', branch: '寅' }, diEr: { ganZhi: '戊子', branch: '子' } },
|
|
263
|
+
甲午: { tianMu: { ganZhi: '庚子', branch: '子' }, diEr: { ganZhi: '戊戌', branch: '戌' } },
|
|
264
|
+
甲辰: { tianMu: { ganZhi: '庚戌', branch: '戌' }, diEr: { ganZhi: '戊申', branch: '申' } },
|
|
265
|
+
甲寅: { tianMu: { ganZhi: '庚申', branch: '申' }, diEr: { ganZhi: '戊午', branch: '午' } },
|
|
266
|
+
};
|
|
267
|
+
const dunJiaStemByXun = {
|
|
268
|
+
甲子: '戊',
|
|
269
|
+
甲戌: '己',
|
|
270
|
+
甲申: '庚',
|
|
271
|
+
甲午: '辛',
|
|
272
|
+
甲辰: '壬',
|
|
273
|
+
甲寅: '癸',
|
|
274
|
+
};
|
|
275
|
+
const guXuByXun = {
|
|
276
|
+
甲子: { gu: ['戌', '亥'], xu: ['辰', '巳'] },
|
|
277
|
+
甲戌: { gu: ['申', '酉'], xu: ['寅', '卯'] },
|
|
278
|
+
甲申: { gu: ['午', '未'], xu: ['子', '丑'] },
|
|
279
|
+
甲午: { gu: ['辰', '巳'], xu: ['戌', '亥'] },
|
|
280
|
+
甲辰: { gu: ['寅', '卯'], xu: ['申', '酉'] },
|
|
281
|
+
甲寅: { gu: ['子', '丑'], xu: ['午', '未'] },
|
|
282
|
+
};
|
|
283
|
+
const monthGeneralByMonthBranch = {
|
|
284
|
+
寅: '亥',
|
|
285
|
+
卯: '戌',
|
|
286
|
+
辰: '酉',
|
|
287
|
+
巳: '申',
|
|
288
|
+
午: '未',
|
|
289
|
+
未: '午',
|
|
290
|
+
申: '巳',
|
|
291
|
+
酉: '辰',
|
|
292
|
+
戌: '卯',
|
|
293
|
+
亥: '寅',
|
|
294
|
+
子: '丑',
|
|
295
|
+
丑: '子',
|
|
296
|
+
};
|
|
297
|
+
const tianSanMenTargets = [
|
|
298
|
+
{ name: '太冲', branch: '卯' },
|
|
299
|
+
{ name: '小吉', branch: '未' },
|
|
300
|
+
{ name: '从魁', branch: '酉' },
|
|
301
|
+
];
|
|
302
|
+
const tianMaTargets = [{ name: '太冲天马', branch: '卯' }];
|
|
303
|
+
const tianGangTargets = [{ name: '斗星天罡', branch: '辰' }];
|
|
304
|
+
const tingTingBaiJianTargets = {
|
|
305
|
+
tingTing: [{ name: '亭亭(神后)', branch: '子' }],
|
|
306
|
+
baiJian: [
|
|
307
|
+
{ name: '白奸功曹', branch: '寅' },
|
|
308
|
+
{ name: '白奸胜光', branch: '午' },
|
|
309
|
+
{ name: '白奸天罡', branch: '辰' },
|
|
310
|
+
],
|
|
311
|
+
};
|
|
312
|
+
const earthPrivateDoorGenerals = [
|
|
313
|
+
'贵人',
|
|
314
|
+
'螣蛇',
|
|
315
|
+
'朱雀',
|
|
316
|
+
'六合',
|
|
317
|
+
'勾陈',
|
|
318
|
+
'青龙',
|
|
319
|
+
'天空',
|
|
320
|
+
'白虎',
|
|
321
|
+
'太常',
|
|
322
|
+
'玄武',
|
|
323
|
+
'太阴',
|
|
324
|
+
'天后',
|
|
325
|
+
];
|
|
326
|
+
const earthPrivateDoorTargets = new Set(['六合', '太常', '太阴']);
|
|
327
|
+
const yangNobleDayBranches = new Set(['子', '丑', '寅', '卯', '辰', '巳']);
|
|
328
|
+
const nobleForwardGroundBranches = new Set(['亥', '子', '丑', '寅', '卯', '辰']);
|
|
329
|
+
const yangNobleBranchByDayStem = {
|
|
330
|
+
甲: '未',
|
|
331
|
+
乙: '申',
|
|
332
|
+
丙: '酉',
|
|
333
|
+
丁: '亥',
|
|
334
|
+
戊: '丑',
|
|
335
|
+
己: '子',
|
|
336
|
+
庚: '丑',
|
|
337
|
+
辛: '寅',
|
|
338
|
+
壬: '卯',
|
|
339
|
+
癸: '巳',
|
|
340
|
+
};
|
|
341
|
+
const yinNobleBranchByDayStem = {
|
|
342
|
+
甲: '丑',
|
|
343
|
+
乙: '子',
|
|
344
|
+
丙: '亥',
|
|
345
|
+
丁: '酉',
|
|
346
|
+
戊: '未',
|
|
347
|
+
己: '申',
|
|
348
|
+
庚: '未',
|
|
349
|
+
辛: '午',
|
|
350
|
+
壬: '巳',
|
|
351
|
+
癸: '卯',
|
|
352
|
+
};
|
|
353
|
+
const diSiHuOffsets = [
|
|
354
|
+
{ name: '除', offset: 1 },
|
|
355
|
+
{ name: '定', offset: 4 },
|
|
356
|
+
{ name: '危', offset: 7 },
|
|
357
|
+
{ name: '开', offset: 10 },
|
|
358
|
+
];
|
|
359
|
+
const xunZhongDiBingDay = {
|
|
360
|
+
丙寅: { xun: '甲子旬', branch: '寅' },
|
|
361
|
+
丙子: { xun: '甲戌旬', branch: '子' },
|
|
362
|
+
丙戌: { xun: '甲申旬', branch: '戌' },
|
|
363
|
+
丙申: { xun: '甲午旬', branch: '申' },
|
|
364
|
+
丙午: { xun: '甲辰旬', branch: '午' },
|
|
365
|
+
丙辰: { xun: '甲寅旬', branch: '辰' },
|
|
366
|
+
};
|
|
367
|
+
function getPalaceByBranch(jiuGongGe, branch) {
|
|
368
|
+
return getPalace(jiuGongGe, diPanPalaces[branch]);
|
|
369
|
+
}
|
|
370
|
+
function getBranchPalaceLabels(jiuGongGe, branchList) {
|
|
371
|
+
const labels = branchList.map((branch) => {
|
|
372
|
+
const palace = getPalaceByBranch(jiuGongGe, branch);
|
|
373
|
+
return palace ? `${branch}支${palace.name}` : undefined;
|
|
374
|
+
});
|
|
375
|
+
if (labels.some((label) => !label))
|
|
376
|
+
return undefined;
|
|
377
|
+
return labels;
|
|
378
|
+
}
|
|
379
|
+
function getNamedBranchPalaceLabels(jiuGongGe, branchList) {
|
|
380
|
+
const labels = branchList.map((item) => {
|
|
381
|
+
const palace = getPalaceByBranch(jiuGongGe, item.branch);
|
|
382
|
+
return palace ? `${item.name}在${item.branch}支${palace.name}` : undefined;
|
|
383
|
+
});
|
|
384
|
+
if (labels.some((label) => !label))
|
|
385
|
+
return undefined;
|
|
386
|
+
return labels;
|
|
387
|
+
}
|
|
388
|
+
function getXunShouGanZhi(ganZhi) {
|
|
389
|
+
if (!ganZhi)
|
|
390
|
+
return undefined;
|
|
391
|
+
const stemIndex = tiangan.indexOf(ganZhi.charAt(0));
|
|
392
|
+
const branchIndex = branches.indexOf(ganZhi.charAt(1));
|
|
393
|
+
if (stemIndex === -1 || branchIndex === -1)
|
|
394
|
+
return undefined;
|
|
395
|
+
return `甲${branches[(branchIndex - stemIndex + 12) % 12]}`;
|
|
396
|
+
}
|
|
397
|
+
function getStarPolarity(star) {
|
|
398
|
+
if (!star)
|
|
399
|
+
return undefined;
|
|
400
|
+
if (yangStars.has(star))
|
|
401
|
+
return '阳星';
|
|
402
|
+
if (yinStars.has(star))
|
|
403
|
+
return '阴星';
|
|
404
|
+
return undefined;
|
|
405
|
+
}
|
|
406
|
+
function getXingDeOpenCloseState(hourBranch, xingDe, polarity) {
|
|
407
|
+
const isYangStar = polarity === '阳星';
|
|
408
|
+
if (hourBranch === xingDe.deBranch) {
|
|
409
|
+
return {
|
|
410
|
+
gateState: '德在门',
|
|
411
|
+
openClose: isYangStar ? '尽开' : '半开',
|
|
412
|
+
advice: '宜动宜战',
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
if (hourBranch === xingDe.xingBranch) {
|
|
416
|
+
return {
|
|
417
|
+
gateState: '刑在门',
|
|
418
|
+
openClose: isYangStar ? '半阖' : '尽阖',
|
|
419
|
+
advice: '宜静宜守',
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
return {
|
|
423
|
+
gateState: '不当刑德',
|
|
424
|
+
openClose: isYangStar ? '开' : '阖',
|
|
425
|
+
advice: isYangStar ? '偏客动、宜主动取势' : '偏主守、宜静守审势',
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
function getMonthGeneralGroundBranch(monthBranch, hourBranch, targetBranch) {
|
|
429
|
+
if (!monthBranch || !hourBranch || !targetBranch)
|
|
430
|
+
return undefined;
|
|
431
|
+
const monthGeneral = monthGeneralByMonthBranch[monthBranch];
|
|
432
|
+
const monthGeneralIndex = branches.indexOf(monthGeneral);
|
|
433
|
+
const hourIndex = branches.indexOf(hourBranch);
|
|
434
|
+
const targetIndex = branches.indexOf(targetBranch);
|
|
435
|
+
if (!monthGeneral || monthGeneralIndex === -1 || hourIndex === -1 || targetIndex === -1) {
|
|
436
|
+
return undefined;
|
|
437
|
+
}
|
|
438
|
+
return {
|
|
439
|
+
monthGeneral,
|
|
440
|
+
branch: branches[(hourIndex + targetIndex - monthGeneralIndex + 12) % 12],
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
function getMonthGeneralTargetLabels(jiuGongGe, targets, monthBranch, hourBranch) {
|
|
444
|
+
if (!monthBranch || !hourBranch)
|
|
445
|
+
return undefined;
|
|
446
|
+
const monthGeneral = monthGeneralByMonthBranch[monthBranch];
|
|
447
|
+
const monthGeneralIndex = branches.indexOf(monthGeneral);
|
|
448
|
+
const hourIndex = branches.indexOf(hourBranch);
|
|
449
|
+
if (!monthGeneral || monthGeneralIndex === -1 || hourIndex === -1)
|
|
450
|
+
return undefined;
|
|
451
|
+
const targetBranches = targets.map((target) => {
|
|
452
|
+
const targetIndex = branches.indexOf(target.branch);
|
|
453
|
+
return {
|
|
454
|
+
name: target.name,
|
|
455
|
+
branch: branches[(hourIndex + targetIndex - monthGeneralIndex + 12) % 12],
|
|
456
|
+
};
|
|
457
|
+
});
|
|
458
|
+
const labels = getNamedBranchPalaceLabels(jiuGongGe, targetBranches);
|
|
459
|
+
return labels
|
|
460
|
+
? { monthGeneral, labels, targetBranches: targetBranches.map((item) => item.branch) }
|
|
461
|
+
: undefined;
|
|
462
|
+
}
|
|
463
|
+
function getEarthPrivateDoorLabels(jiuGongGe, dayStem, dayBranch, monthBranch, hourBranch) {
|
|
464
|
+
if (!dayStem || !dayBranch || !monthBranch || !hourBranch)
|
|
465
|
+
return undefined;
|
|
466
|
+
if (!branches.includes(dayBranch))
|
|
467
|
+
return undefined;
|
|
468
|
+
const nobleType = yangNobleDayBranches.has(dayBranch) ? '阳贵' : '阴贵';
|
|
469
|
+
const nobleBranch = nobleType === '阳贵'
|
|
470
|
+
? yangNobleBranchByDayStem[dayStem]
|
|
471
|
+
: yinNobleBranchByDayStem[dayStem];
|
|
472
|
+
const nobleGround = getMonthGeneralGroundBranch(monthBranch, hourBranch, nobleBranch);
|
|
473
|
+
const nobleGroundIndex = nobleGround ? branches.indexOf(nobleGround.branch) : -1;
|
|
474
|
+
const nobleGroundPalace = nobleGround
|
|
475
|
+
? getPalaceByBranch(jiuGongGe, nobleGround.branch)
|
|
476
|
+
: undefined;
|
|
477
|
+
if (!nobleBranch || !nobleGround || nobleGroundIndex === -1 || !nobleGroundPalace) {
|
|
478
|
+
return undefined;
|
|
479
|
+
}
|
|
480
|
+
const isForward = nobleForwardGroundBranches.has(nobleGround.branch);
|
|
481
|
+
const labels = earthPrivateDoorGenerals
|
|
482
|
+
.map((general, step) => {
|
|
483
|
+
if (!earthPrivateDoorTargets.has(general))
|
|
484
|
+
return undefined;
|
|
485
|
+
const branchIndex = isForward
|
|
486
|
+
? (nobleGroundIndex + step) % 12
|
|
487
|
+
: (nobleGroundIndex - step + 12) % 12;
|
|
488
|
+
const branch = branches[branchIndex];
|
|
489
|
+
const palace = getPalaceByBranch(jiuGongGe, branch);
|
|
490
|
+
return palace ? `${general}在${branch}支${palace.name}` : undefined;
|
|
491
|
+
})
|
|
492
|
+
.filter(Boolean);
|
|
493
|
+
if (labels.length !== earthPrivateDoorTargets.size)
|
|
494
|
+
return undefined;
|
|
495
|
+
return {
|
|
496
|
+
monthGeneral: nobleGround.monthGeneral,
|
|
497
|
+
nobleType,
|
|
498
|
+
nobleBranch,
|
|
499
|
+
nobleGroundBranch: nobleGround.branch,
|
|
500
|
+
nobleGroundPalace,
|
|
501
|
+
direction: isForward ? '顺行' : '逆行',
|
|
502
|
+
labels: labels,
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
function getTianSanMenLabels(jiuGongGe, monthBranch, hourBranch) {
|
|
506
|
+
return getMonthGeneralTargetLabels(jiuGongGe, tianSanMenTargets, monthBranch, hourBranch);
|
|
507
|
+
}
|
|
508
|
+
function getTianMaLabels(jiuGongGe, monthBranch, hourBranch) {
|
|
509
|
+
return getMonthGeneralTargetLabels(jiuGongGe, tianMaTargets, monthBranch, hourBranch);
|
|
510
|
+
}
|
|
511
|
+
function getTianGangLabels(jiuGongGe, monthBranch, hourBranch) {
|
|
512
|
+
return getMonthGeneralTargetLabels(jiuGongGe, tianGangTargets, monthBranch, hourBranch);
|
|
513
|
+
}
|
|
514
|
+
function getMengZhongJiRoute(branch) {
|
|
515
|
+
if (mengBranches.has(branch))
|
|
516
|
+
return { position: '孟', route: '左路通' };
|
|
517
|
+
if (zhongBranches.has(branch))
|
|
518
|
+
return { position: '仲', route: '中道通' };
|
|
519
|
+
if (jiBranches.has(branch))
|
|
520
|
+
return { position: '季', route: '右路通' };
|
|
521
|
+
return undefined;
|
|
522
|
+
}
|
|
523
|
+
function getDiSiHuLabels(jiuGongGe, hourBranch) {
|
|
524
|
+
if (!hourBranch)
|
|
525
|
+
return undefined;
|
|
526
|
+
const hourIndex = branches.indexOf(hourBranch);
|
|
527
|
+
if (hourIndex === -1)
|
|
528
|
+
return undefined;
|
|
529
|
+
return getNamedBranchPalaceLabels(jiuGongGe, diSiHuOffsets.map((item) => ({
|
|
530
|
+
name: item.name,
|
|
531
|
+
branch: branches[(hourIndex + item.offset) % 12],
|
|
532
|
+
})));
|
|
533
|
+
}
|
|
534
|
+
function getTingTingBaiJianLabels(jiuGongGe, monthBranch, hourBranch) {
|
|
535
|
+
const tingTing = getMonthGeneralTargetLabels(jiuGongGe, tingTingBaiJianTargets.tingTing, monthBranch, hourBranch);
|
|
536
|
+
const baiJian = getMonthGeneralTargetLabels(jiuGongGe, tingTingBaiJianTargets.baiJian, monthBranch, hourBranch);
|
|
537
|
+
if (!tingTing || !baiJian || tingTing.monthGeneral !== baiJian.monthGeneral)
|
|
538
|
+
return undefined;
|
|
539
|
+
return {
|
|
540
|
+
monthGeneral: tingTing.monthGeneral,
|
|
541
|
+
tingTing: tingTing.labels,
|
|
542
|
+
baiJian: baiJian.labels,
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
function hasDoorGodCombo(palace, doors, gods) {
|
|
546
|
+
if (!palace)
|
|
547
|
+
return false;
|
|
548
|
+
return doors.includes(palace.renPan.door) && gods.includes(palace.shenPan.god);
|
|
549
|
+
}
|
|
550
|
+
function getDoorGodSource(palace) {
|
|
551
|
+
return `${palace.renPan.door}、${palace.shenPan.god}`;
|
|
552
|
+
}
|
|
553
|
+
function isMenPoTagForPalace(tag, palace) {
|
|
554
|
+
return tag.startsWith('门迫') && tag.includes(`(${palace.name}`);
|
|
555
|
+
}
|
|
17
556
|
function pushPalaceCombos(ctx, out) {
|
|
18
557
|
const patterns = ctx.classicPatterns || [];
|
|
19
558
|
const voidPalaces = new Set((ctx.voidPalaces || []).map((item) => item.palace));
|
|
@@ -119,16 +658,53 @@ function pushNamedCombos(ctx, out) {
|
|
|
119
658
|
.map((pattern) => pattern.name),
|
|
120
659
|
});
|
|
121
660
|
}
|
|
122
|
-
|
|
661
|
+
const baihuBad = patterns.find((pattern) => {
|
|
662
|
+
if (pattern.name !== '白虎猖狂')
|
|
663
|
+
return false;
|
|
664
|
+
return hasDoorGodCombo(getPalace(ctx.jiuGongGe, pattern.palace), difficultDoors, difficultGods);
|
|
665
|
+
});
|
|
666
|
+
if (baihuBad) {
|
|
667
|
+
const palace = getPalace(ctx.jiuGongGe, baihuBad.palace);
|
|
123
668
|
out.push({
|
|
124
669
|
key: 'combo:baihuPlusKill',
|
|
125
670
|
name: '白虎助凶',
|
|
126
671
|
tone: 'super-bad',
|
|
127
672
|
score: -12,
|
|
128
|
-
summary: '
|
|
129
|
-
|
|
673
|
+
summary: `${palace?.name || ''}白虎猖狂叠加凶门凶神,凶象加重。`,
|
|
674
|
+
palace: baihuBad.palace,
|
|
675
|
+
sources: ['白虎猖狂', palace ? getDoorGodSource(palace) : '凶门凶神'],
|
|
130
676
|
});
|
|
131
677
|
}
|
|
678
|
+
const baihuPatterns = patterns.filter((pattern) => pattern.name === '白虎猖狂' && pattern.palace);
|
|
679
|
+
for (const pattern of baihuPatterns) {
|
|
680
|
+
const palace = getPalace(ctx.jiuGongGe, pattern.palace);
|
|
681
|
+
const door = palace?.renPan.door;
|
|
682
|
+
if (!palace || !door)
|
|
683
|
+
continue;
|
|
684
|
+
if (door === '开门' || door === '惊门') {
|
|
685
|
+
out.push({
|
|
686
|
+
key: `combo:baihuKaiJing:${palace.gong}`,
|
|
687
|
+
name: '白虎会开惊',
|
|
688
|
+
tone: 'mixed',
|
|
689
|
+
score: 0,
|
|
690
|
+
summary: `${palace.name}白虎猖狂同宫${door},合“会开惊动神位”,辛金得门气助,客势更锐;偏兵事强攻参考,不替代通用吉凶评分。`,
|
|
691
|
+
palace: palace.gong,
|
|
692
|
+
sources: ['白虎猖狂', `${palace.name}${door}`],
|
|
693
|
+
});
|
|
694
|
+
continue;
|
|
695
|
+
}
|
|
696
|
+
if (door === '休门') {
|
|
697
|
+
out.push({
|
|
698
|
+
key: `combo:baihuXiuMen:${palace.gong}`,
|
|
699
|
+
name: '白虎逢休门',
|
|
700
|
+
tone: 'mixed',
|
|
701
|
+
score: 0,
|
|
702
|
+
summary: `${palace.name}白虎猖狂同宫休门,乙奇得水助而辛金泄气,主客交锋胜败趋平;偏兵事缓和参考,不替代通用吉凶评分。`,
|
|
703
|
+
palace: palace.gong,
|
|
704
|
+
sources: ['白虎猖狂', `${palace.name}休门`],
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
}
|
|
132
708
|
if (hasName(patterns, '月奇悖师') && hasName(patterns, '月奇入墓')) {
|
|
133
709
|
out.push({
|
|
134
710
|
key: 'combo:bingDoubleBad',
|
|
@@ -149,6 +725,36 @@ function pushNamedCombos(ctx, out) {
|
|
|
149
725
|
sources: ['太白入荧', '荧入太白'],
|
|
150
726
|
});
|
|
151
727
|
}
|
|
728
|
+
const dingRenPatterns = patterns.filter((pattern) => pattern.name === '丁壬化木' && pattern.palace);
|
|
729
|
+
for (const pattern of dingRenPatterns) {
|
|
730
|
+
const palace = getPalace(ctx.jiuGongGe, pattern.palace);
|
|
731
|
+
const door = palace?.renPan.door;
|
|
732
|
+
if (!palace || !door)
|
|
733
|
+
continue;
|
|
734
|
+
if (door === '伤门' || door === '杜门') {
|
|
735
|
+
out.push({
|
|
736
|
+
key: `combo:dingRenBlocked:${palace.gong}`,
|
|
737
|
+
name: '丁壬逢伤杜',
|
|
738
|
+
tone: 'mixed',
|
|
739
|
+
score: 0,
|
|
740
|
+
summary: `${palace.name}丁壬化木同宫${door},虽曰相生,但${door === '伤门' ? '防伤害牵连' : '防闭塞难通'},不宜强用;偏逃亡、隐遁和兵事用门参考,不作通用吉凶评分。`,
|
|
741
|
+
palace: palace.gong,
|
|
742
|
+
sources: ['丁壬化木', `${palace.name}${door}`],
|
|
743
|
+
});
|
|
744
|
+
continue;
|
|
745
|
+
}
|
|
746
|
+
if (door === '生门') {
|
|
747
|
+
out.push({
|
|
748
|
+
key: `combo:dingRenShengMen:${palace.gong}`,
|
|
749
|
+
name: '丁壬生门利遁',
|
|
750
|
+
tone: 'mixed',
|
|
751
|
+
score: 0,
|
|
752
|
+
summary: `${palace.name}丁壬化木同宫生门,合“逃亡绝迹者逢之最利,生门吉助足成功”;偏逃亡、隐遁和避难参考,不作通用吉凶评分。`,
|
|
753
|
+
palace: palace.gong,
|
|
754
|
+
sources: ['丁壬化木', `${palace.name}生门`],
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
}
|
|
152
758
|
if (hasName(patterns, '玉女守门') &&
|
|
153
759
|
patterns.some((pattern) => ['人遁', '地遁'].includes(pattern.name))) {
|
|
154
760
|
out.push({
|
|
@@ -194,24 +800,34 @@ function pushNamedCombos(ctx, out) {
|
|
|
194
800
|
],
|
|
195
801
|
});
|
|
196
802
|
}
|
|
197
|
-
|
|
803
|
+
const menPoBadPalace = ctx.jiuGongGe.find((palace) => tags.some((tag) => isMenPoTagForPalace(tag, palace)) &&
|
|
804
|
+
hasDoorGodCombo(palace, difficultDoors, difficultGods));
|
|
805
|
+
if (menPoBadPalace) {
|
|
198
806
|
out.push({
|
|
199
807
|
key: 'combo:menpoPlusBad',
|
|
200
808
|
name: '迫上加凶',
|
|
201
809
|
tone: 'super-bad',
|
|
202
810
|
score: -9,
|
|
203
|
-
summary:
|
|
204
|
-
|
|
811
|
+
summary: `${menPoBadPalace.name}门迫叠加凶门凶神,行动受压且环境不利。`,
|
|
812
|
+
palace: menPoBadPalace.gong,
|
|
813
|
+
sources: ['门迫', getDoorGodSource(menPoBadPalace)],
|
|
205
814
|
});
|
|
206
815
|
}
|
|
207
|
-
|
|
816
|
+
const luckyQi = patterns.find((pattern) => {
|
|
817
|
+
if (!pattern.name.endsWith('奇得使'))
|
|
818
|
+
return false;
|
|
819
|
+
return hasDoorGodCombo(getPalace(ctx.jiuGongGe, pattern.palace), auspiciousDoors, supportiveGods);
|
|
820
|
+
});
|
|
821
|
+
if (luckyQi) {
|
|
822
|
+
const palace = getPalace(ctx.jiuGongGe, luckyQi.palace);
|
|
208
823
|
out.push({
|
|
209
824
|
key: 'combo:luckPlusQi',
|
|
210
825
|
name: '吉门三奇',
|
|
211
826
|
tone: 'super-good',
|
|
212
827
|
score: 12,
|
|
213
|
-
summary: '
|
|
214
|
-
|
|
828
|
+
summary: `${palace?.name || ''}吉门吉神叠三奇得使,助力与关键资源同时出现。`,
|
|
829
|
+
palace: luckyQi.palace,
|
|
830
|
+
sources: [palace ? getDoorGodSource(palace) : '吉门吉神', luckyQi.name],
|
|
215
831
|
});
|
|
216
832
|
}
|
|
217
833
|
if (hasTag(tags, '伏吟') && ctx.horseStar) {
|
|
@@ -234,11 +850,944 @@ function pushNamedCombos(ctx, out) {
|
|
|
234
850
|
sources: ['反吟', '驿马'],
|
|
235
851
|
});
|
|
236
852
|
}
|
|
853
|
+
const qingLongReturningPatterns = patterns.filter((pattern) => pattern.name === '青龙返首' && pattern.palace);
|
|
854
|
+
for (const pattern of qingLongReturningPatterns) {
|
|
855
|
+
const palace = getPalace(ctx.jiuGongGe, pattern.palace);
|
|
856
|
+
if (!palace)
|
|
857
|
+
continue;
|
|
858
|
+
out.push({
|
|
859
|
+
key: `combo:qinglongReturningHost:${palace.gong}`,
|
|
860
|
+
name: '青龙返首利主',
|
|
861
|
+
tone: 'mixed',
|
|
862
|
+
score: 0,
|
|
863
|
+
summary: `${palace.name}青龙返首,合“甲加丙利为主”,宜后应、伏藏、暗渡;偏兵事主客参考,不替代通用吉格评分。`,
|
|
864
|
+
palace: palace.gong,
|
|
865
|
+
sources: ['青龙返首', `${palace.name}`],
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
const flyingBirdPatterns = patterns.filter((pattern) => pattern.name === '飞鸟跌穴' && pattern.palace);
|
|
869
|
+
for (const pattern of flyingBirdPatterns) {
|
|
870
|
+
const palace = getPalace(ctx.jiuGongGe, pattern.palace);
|
|
871
|
+
if (!palace)
|
|
872
|
+
continue;
|
|
873
|
+
out.push({
|
|
874
|
+
key: `combo:flyingBirdGuest:${palace.gong}`,
|
|
875
|
+
name: '飞鸟跌穴利客',
|
|
876
|
+
tone: 'mixed',
|
|
877
|
+
score: 0,
|
|
878
|
+
summary: `${palace.name}飞鸟跌穴,合“丙加甲利为客”,宜主动前征、扬势而进;偏兵事主客参考,不替代通用吉格评分。`,
|
|
879
|
+
palace: palace.gong,
|
|
880
|
+
sources: ['飞鸟跌穴', `${palace.name}`],
|
|
881
|
+
});
|
|
882
|
+
if (palace.renPan.door === '生门') {
|
|
883
|
+
out.push({
|
|
884
|
+
key: `combo:flyingBirdShengMen:${palace.gong}`,
|
|
885
|
+
name: '飞鸟会生门',
|
|
886
|
+
tone: 'mixed',
|
|
887
|
+
score: 0,
|
|
888
|
+
summary: `${palace.name}飞鸟跌穴同宫生门,合“会合生门相助,则坐生击死,一战百胜”;偏兵事助胜参考,不重复加算通用吉格评分。`,
|
|
889
|
+
palace: palace.gong,
|
|
890
|
+
sources: ['飞鸟跌穴', `${palace.name}生门`],
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
const zhuqueToujiangPatterns = patterns.filter((pattern) => pattern.name === '朱雀投江' && pattern.palace);
|
|
895
|
+
for (const pattern of zhuqueToujiangPatterns) {
|
|
896
|
+
const palace = getPalace(ctx.jiuGongGe, pattern.palace);
|
|
897
|
+
if (!palace)
|
|
898
|
+
continue;
|
|
899
|
+
out.push({
|
|
900
|
+
key: `combo:zhuqueToujiangHost:${palace.gong}`,
|
|
901
|
+
name: '朱雀投江利主',
|
|
902
|
+
tone: 'mixed',
|
|
903
|
+
score: 0,
|
|
904
|
+
summary: `${palace.name}朱雀投江,合“遇交战,主胜客败”;若先发攻人而转为客,则防强行取败、将士刑伤。偏兵事主客参考,不替代通用凶格评分。`,
|
|
905
|
+
palace: palace.gong,
|
|
906
|
+
sources: ['朱雀投江', `${palace.name}`],
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
const tengsheYaoyaoPatterns = patterns.filter((pattern) => pattern.name === '螣蛇夭矫' && pattern.palace);
|
|
910
|
+
const wuPalace = findTianStemPalace(ctx.jiuGongGe, '戊');
|
|
911
|
+
const jiPalace = findTianStemPalace(ctx.jiuGongGe, '己');
|
|
912
|
+
for (const pattern of tengsheYaoyaoPatterns) {
|
|
913
|
+
const palace = getPalace(ctx.jiuGongGe, pattern.palace);
|
|
914
|
+
if (!palace)
|
|
915
|
+
continue;
|
|
916
|
+
out.push({
|
|
917
|
+
key: `combo:tengsheYaoyaoHold:${palace.gong}`,
|
|
918
|
+
name: '螣蛇夭矫宜守',
|
|
919
|
+
tone: 'mixed',
|
|
920
|
+
score: 0,
|
|
921
|
+
summary: `${palace.name}螣蛇夭矫,合“主军宜固守”;遇敌勿轻战,亦合“蛇矫为客者不害”的活诀,偏兵事主客与守避参考,不替代通用凶格评分。`,
|
|
922
|
+
palace: palace.gong,
|
|
923
|
+
sources: ['螣蛇夭矫', `${palace.name}`],
|
|
924
|
+
});
|
|
925
|
+
if (wuPalace && jiPalace) {
|
|
926
|
+
out.push({
|
|
927
|
+
key: `combo:tengsheMoveWuJi:${palace.gong}:${wuPalace.gong}:${jiPalace.gong}`,
|
|
928
|
+
name: '螣蛇迁戊己',
|
|
929
|
+
tone: 'mixed',
|
|
930
|
+
score: 0,
|
|
931
|
+
summary: `${palace.name}螣蛇夭矫,古法急迁甲子戊、甲戌己两土宫;本盘取天盘戊所在${wuPalace.name}、天盘己所在${jiPalace.name},以土制癸水,偏避兵迁营参考,不作通用吉凶评分。`,
|
|
932
|
+
palace: palace.gong,
|
|
933
|
+
sources: [
|
|
934
|
+
'螣蛇夭矫',
|
|
935
|
+
`甲子戊:天盘戊${wuPalace.name}`,
|
|
936
|
+
`甲戌己:天盘己${jiPalace.name}`,
|
|
937
|
+
],
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
function pushXingDeKaiHeCombo(ctx, out) {
|
|
943
|
+
const xingDe = ctx.solarTerm ? xingDeBySolarTerm[ctx.solarTerm] : undefined;
|
|
944
|
+
const polarity = getStarPolarity(ctx.zhiFu);
|
|
945
|
+
if (!ctx.solarTerm || !ctx.hourBranch || !ctx.zhiFu || !xingDe || !polarity)
|
|
946
|
+
return;
|
|
947
|
+
const dePalace = getPalaceByBranch(ctx.jiuGongGe, xingDe.deBranch);
|
|
948
|
+
const xingPalace = getPalaceByBranch(ctx.jiuGongGe, xingDe.xingBranch);
|
|
949
|
+
if (!dePalace || !xingPalace)
|
|
950
|
+
return;
|
|
951
|
+
const hourGanZhi = ctx.hourGanZhi || (ctx.hourStem && ctx.hourBranch ? `${ctx.hourStem}${ctx.hourBranch}` : '');
|
|
952
|
+
const xunShouGanZhi = getXunShouGanZhi(hourGanZhi);
|
|
953
|
+
const sanJia = xunShouGanZhi ? sanJiaByXun[xunShouGanZhi] : undefined;
|
|
954
|
+
const hourLabel = hourGanZhi ? `${hourGanZhi}时` : `${ctx.hourBranch}时`;
|
|
955
|
+
const state = getXingDeOpenCloseState(ctx.hourBranch, xingDe, polarity);
|
|
956
|
+
const sanJiaText = hourGanZhi && xunShouGanZhi && sanJia
|
|
957
|
+
? `${hourGanZhi}属${xunShouGanZhi}旬(${sanJia}),`
|
|
958
|
+
: '';
|
|
959
|
+
out.push({
|
|
960
|
+
key: `combo:xingDeKaiHe:${ctx.solarTerm}:${ctx.hourBranch}:${ctx.zhiFu}`,
|
|
961
|
+
name: '刑德开阖',
|
|
962
|
+
tone: 'mixed',
|
|
963
|
+
score: 0,
|
|
964
|
+
summary: `${ctx.solarTerm}属${xingDe.baseTerm}三气,德在${xingDe.deBranch}、刑在${xingDe.xingBranch};${sanJiaText}${hourLabel}支${ctx.hourBranch}为${state.gateState},值符${ctx.zhiFu}为${polarity},判为${state.openClose},${state.advice}。坐阳德取${xingDe.deBranch}支${dePalace.name},击阴刑取${xingDe.xingBranch}支${xingPalace.name};偏三甲兵事、主客与动静参考,不作通用吉凶评分。`,
|
|
965
|
+
sources: [
|
|
966
|
+
`${ctx.solarTerm}属${xingDe.baseTerm}三气:德在${xingDe.deBranch}、刑在${xingDe.xingBranch}`,
|
|
967
|
+
`${hourLabel}:${state.gateState},${state.openClose}`,
|
|
968
|
+
`值符${ctx.zhiFu}为${polarity}`,
|
|
969
|
+
`坐阳德:${xingDe.deBranch}支${dePalace.name}`,
|
|
970
|
+
`击阴刑:${xingDe.xingBranch}支${xingPalace.name}`,
|
|
971
|
+
...(hourGanZhi && xunShouGanZhi && sanJia
|
|
972
|
+
? [`${hourGanZhi}属${xunShouGanZhi}旬:${sanJia}`]
|
|
973
|
+
: []),
|
|
974
|
+
],
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
function getStarPalaceHostGuestEntries(jiuGongGe) {
|
|
978
|
+
const entries = [];
|
|
979
|
+
for (const palace of jiuGongGe) {
|
|
980
|
+
const star = palace.tianPan.star;
|
|
981
|
+
const starElement = starElements[star];
|
|
982
|
+
const palaceElement = palace.element;
|
|
983
|
+
if (!star || !starElement || !palaceElement)
|
|
984
|
+
continue;
|
|
985
|
+
if (starElement === palaceElement) {
|
|
986
|
+
entries.push({
|
|
987
|
+
gong: palace.gong,
|
|
988
|
+
palaceName: palace.name,
|
|
989
|
+
palaceElement,
|
|
990
|
+
star,
|
|
991
|
+
starElement,
|
|
992
|
+
relation: '星宫比和',
|
|
993
|
+
advice: '势均',
|
|
994
|
+
});
|
|
995
|
+
continue;
|
|
996
|
+
}
|
|
997
|
+
if (isGenerating(palaceElement, starElement)) {
|
|
998
|
+
entries.push({
|
|
999
|
+
gong: palace.gong,
|
|
1000
|
+
palaceName: palace.name,
|
|
1001
|
+
palaceElement,
|
|
1002
|
+
star,
|
|
1003
|
+
starElement,
|
|
1004
|
+
relation: '宫生星',
|
|
1005
|
+
advice: '利客',
|
|
1006
|
+
});
|
|
1007
|
+
continue;
|
|
1008
|
+
}
|
|
1009
|
+
if (isGenerating(starElement, palaceElement)) {
|
|
1010
|
+
entries.push({
|
|
1011
|
+
gong: palace.gong,
|
|
1012
|
+
palaceName: palace.name,
|
|
1013
|
+
palaceElement,
|
|
1014
|
+
star,
|
|
1015
|
+
starElement,
|
|
1016
|
+
relation: '星生宫',
|
|
1017
|
+
advice: '利主',
|
|
1018
|
+
});
|
|
1019
|
+
continue;
|
|
1020
|
+
}
|
|
1021
|
+
if (isControlling(starElement, palaceElement)) {
|
|
1022
|
+
entries.push({
|
|
1023
|
+
gong: palace.gong,
|
|
1024
|
+
palaceName: palace.name,
|
|
1025
|
+
palaceElement,
|
|
1026
|
+
star,
|
|
1027
|
+
starElement,
|
|
1028
|
+
relation: '星克宫',
|
|
1029
|
+
advice: '利客',
|
|
1030
|
+
});
|
|
1031
|
+
continue;
|
|
1032
|
+
}
|
|
1033
|
+
if (isControlling(palaceElement, starElement)) {
|
|
1034
|
+
entries.push({
|
|
1035
|
+
gong: palace.gong,
|
|
1036
|
+
palaceName: palace.name,
|
|
1037
|
+
palaceElement,
|
|
1038
|
+
star,
|
|
1039
|
+
starElement,
|
|
1040
|
+
relation: '宫克星',
|
|
1041
|
+
advice: '利主',
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
return entries;
|
|
1046
|
+
}
|
|
1047
|
+
function pushStarPalaceHostGuestCombo(ctx, out) {
|
|
1048
|
+
const entries = getStarPalaceHostGuestEntries(ctx.jiuGongGe);
|
|
1049
|
+
if (!entries.length)
|
|
1050
|
+
return;
|
|
1051
|
+
const entryTexts = entries.map((entry) => `${entry.star}${entry.starElement}落${entry.palaceName}(${entry.palaceElement}),${entry.relation},${entry.advice}`);
|
|
1052
|
+
out.push({
|
|
1053
|
+
key: `combo:starPalaceHostGuest:${entries
|
|
1054
|
+
.map((entry) => `${entry.gong}${entry.relation}`)
|
|
1055
|
+
.join(':')}`,
|
|
1056
|
+
name: '星宫主客',
|
|
1057
|
+
tone: 'mixed',
|
|
1058
|
+
score: 0,
|
|
1059
|
+
summary: `九星与落宫形成主客取向:${entryTexts.join(';')}。宫为主,星为客;此为兵事主客强弱参考,不作通用吉凶评分。`,
|
|
1060
|
+
palace: entries.length === 1 ? entries[0].gong : undefined,
|
|
1061
|
+
sources: entryTexts,
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1064
|
+
function getDoorPalaceHostGuestEntries(jiuGongGe) {
|
|
1065
|
+
const entries = [];
|
|
1066
|
+
for (const palace of jiuGongGe) {
|
|
1067
|
+
const door = palace.renPan.door;
|
|
1068
|
+
const doorElement = doorElements[door];
|
|
1069
|
+
const palaceElement = palace.element;
|
|
1070
|
+
if (!door || !doorElement || !palaceElement)
|
|
1071
|
+
continue;
|
|
1072
|
+
if (doorElement === palaceElement) {
|
|
1073
|
+
entries.push({
|
|
1074
|
+
gong: palace.gong,
|
|
1075
|
+
palaceName: palace.name,
|
|
1076
|
+
palaceElement,
|
|
1077
|
+
door,
|
|
1078
|
+
doorElement,
|
|
1079
|
+
relation: '门宫比和',
|
|
1080
|
+
advice: '势均',
|
|
1081
|
+
});
|
|
1082
|
+
continue;
|
|
1083
|
+
}
|
|
1084
|
+
if (isGenerating(palaceElement, doorElement)) {
|
|
1085
|
+
entries.push({
|
|
1086
|
+
gong: palace.gong,
|
|
1087
|
+
palaceName: palace.name,
|
|
1088
|
+
palaceElement,
|
|
1089
|
+
door,
|
|
1090
|
+
doorElement,
|
|
1091
|
+
relation: '宫生门',
|
|
1092
|
+
advice: '利客',
|
|
1093
|
+
});
|
|
1094
|
+
continue;
|
|
1095
|
+
}
|
|
1096
|
+
if (isGenerating(doorElement, palaceElement)) {
|
|
1097
|
+
entries.push({
|
|
1098
|
+
gong: palace.gong,
|
|
1099
|
+
palaceName: palace.name,
|
|
1100
|
+
palaceElement,
|
|
1101
|
+
door,
|
|
1102
|
+
doorElement,
|
|
1103
|
+
relation: '门生宫',
|
|
1104
|
+
advice: '利主',
|
|
1105
|
+
});
|
|
1106
|
+
continue;
|
|
1107
|
+
}
|
|
1108
|
+
if (isControlling(doorElement, palaceElement)) {
|
|
1109
|
+
entries.push({
|
|
1110
|
+
gong: palace.gong,
|
|
1111
|
+
palaceName: palace.name,
|
|
1112
|
+
palaceElement,
|
|
1113
|
+
door,
|
|
1114
|
+
doorElement,
|
|
1115
|
+
relation: '门克宫',
|
|
1116
|
+
advice: '利客',
|
|
1117
|
+
});
|
|
1118
|
+
continue;
|
|
1119
|
+
}
|
|
1120
|
+
if (isControlling(palaceElement, doorElement)) {
|
|
1121
|
+
entries.push({
|
|
1122
|
+
gong: palace.gong,
|
|
1123
|
+
palaceName: palace.name,
|
|
1124
|
+
palaceElement,
|
|
1125
|
+
door,
|
|
1126
|
+
doorElement,
|
|
1127
|
+
relation: '宫克门',
|
|
1128
|
+
advice: '利主',
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
return entries;
|
|
1133
|
+
}
|
|
1134
|
+
function pushDoorPalaceHostGuestCombo(ctx, out) {
|
|
1135
|
+
const entries = getDoorPalaceHostGuestEntries(ctx.jiuGongGe);
|
|
1136
|
+
if (!entries.length)
|
|
1137
|
+
return;
|
|
1138
|
+
const entryTexts = entries.map((entry) => `${entry.door}${entry.doorElement}落${entry.palaceName}(${entry.palaceElement}),${entry.relation},${entry.advice}`);
|
|
1139
|
+
out.push({
|
|
1140
|
+
key: `combo:doorPalaceHostGuest:${entries
|
|
1141
|
+
.map((entry) => `${entry.gong}${entry.relation}`)
|
|
1142
|
+
.join(':')}`,
|
|
1143
|
+
name: '门宫主客',
|
|
1144
|
+
tone: 'mixed',
|
|
1145
|
+
score: 0,
|
|
1146
|
+
summary: `八门与落宫形成主客取向:${entryTexts.join(';')}。宫为主,门为客;此为兵事主客强弱参考,不作通用吉凶评分。`,
|
|
1147
|
+
palace: entries.length === 1 ? entries[0].gong : undefined,
|
|
1148
|
+
sources: entryTexts,
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
function isHostGuestControlRelation(relation) {
|
|
1152
|
+
return relation.includes('克');
|
|
1153
|
+
}
|
|
1154
|
+
function isHostGuestGeneratingRelation(relation) {
|
|
1155
|
+
return relation.includes('生');
|
|
1156
|
+
}
|
|
1157
|
+
function pushStarDoorHostGuestInjuryCombo(ctx, out) {
|
|
1158
|
+
const starEntries = getStarPalaceHostGuestEntries(ctx.jiuGongGe);
|
|
1159
|
+
const doorEntriesByGong = new Map(getDoorPalaceHostGuestEntries(ctx.jiuGongGe).map((entry) => [entry.gong, entry]));
|
|
1160
|
+
const injuryEntries = starEntries.flatMap((starEntry) => {
|
|
1161
|
+
const doorEntry = doorEntriesByGong.get(starEntry.gong);
|
|
1162
|
+
if (!doorEntry)
|
|
1163
|
+
return [];
|
|
1164
|
+
const starIsControl = isHostGuestControlRelation(starEntry.relation);
|
|
1165
|
+
const doorIsControl = isHostGuestControlRelation(doorEntry.relation);
|
|
1166
|
+
const starIsGenerating = isHostGuestGeneratingRelation(starEntry.relation);
|
|
1167
|
+
const doorIsGenerating = isHostGuestGeneratingRelation(doorEntry.relation);
|
|
1168
|
+
if (!((starIsControl && doorIsGenerating) || (starIsGenerating && doorIsControl))) {
|
|
1169
|
+
return [];
|
|
1170
|
+
}
|
|
1171
|
+
return [
|
|
1172
|
+
{
|
|
1173
|
+
gong: starEntry.gong,
|
|
1174
|
+
palaceName: starEntry.palaceName,
|
|
1175
|
+
starText: `${starEntry.star}${starEntry.starElement}${starEntry.relation}${starEntry.advice}`,
|
|
1176
|
+
doorText: `${doorEntry.door}${doorEntry.doorElement}${doorEntry.relation}${doorEntry.advice}`,
|
|
1177
|
+
},
|
|
1178
|
+
];
|
|
1179
|
+
});
|
|
1180
|
+
if (!injuryEntries.length)
|
|
1181
|
+
return;
|
|
1182
|
+
const entryTexts = injuryEntries.map((entry) => `${entry.palaceName}:${entry.starText},${entry.doorText}`);
|
|
1183
|
+
out.push({
|
|
1184
|
+
key: `combo:starDoorHostGuestInjury:${injuryEntries
|
|
1185
|
+
.map((entry) => entry.gong)
|
|
1186
|
+
.join(':')}`,
|
|
1187
|
+
name: '星门主客互伤',
|
|
1188
|
+
tone: 'mixed',
|
|
1189
|
+
score: 0,
|
|
1190
|
+
summary: `同宫星门与宫形成一克一生:${entryTexts.join(';')}。宫为主,星门为客;合“一克一生,主客互伤”,偏兵事主客冲突参考,不作通用吉凶评分。`,
|
|
1191
|
+
palace: injuryEntries.length === 1 ? injuryEntries[0].gong : undefined,
|
|
1192
|
+
sources: entryTexts,
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1195
|
+
function pushDoorSeasonQiCombo(ctx, out) {
|
|
1196
|
+
const monthElement = ctx.monthBranch ? branchElements[ctx.monthBranch] : undefined;
|
|
1197
|
+
if (!ctx.monthBranch || !monthElement)
|
|
1198
|
+
return;
|
|
1199
|
+
const entries = ctx.jiuGongGe
|
|
1200
|
+
.map((palace) => {
|
|
1201
|
+
const door = palace.renPan.door;
|
|
1202
|
+
const doorElement = doorElements[door];
|
|
1203
|
+
const state = doorElement ? getDoorSeasonQiState(doorElement, monthElement) : undefined;
|
|
1204
|
+
if (!door || !doorElement || !state)
|
|
1205
|
+
return undefined;
|
|
1206
|
+
return {
|
|
1207
|
+
gong: palace.gong,
|
|
1208
|
+
text: `${palace.name}${door}属${doorElement}为${state}`,
|
|
1209
|
+
};
|
|
1210
|
+
})
|
|
1211
|
+
.filter((entry) => Boolean(entry));
|
|
1212
|
+
if (!entries.length)
|
|
1213
|
+
return;
|
|
1214
|
+
out.push({
|
|
1215
|
+
key: `combo:doorSeasonQi:${ctx.monthBranch}:${entries
|
|
1216
|
+
.map((entry) => entry.gong)
|
|
1217
|
+
.join(':')}`,
|
|
1218
|
+
name: '八门余气',
|
|
1219
|
+
tone: 'mixed',
|
|
1220
|
+
score: 0,
|
|
1221
|
+
summary: `${ctx.monthBranch}月属${monthElement},八门余气为:${entries
|
|
1222
|
+
.map((entry) => entry.text)
|
|
1223
|
+
.join(';')}。合“当时者为旺,我生者为相,我克者为休,克我者为囚,生我者为废”;偏用门旺衰和兵事进退参考,不作通用吉凶评分。`,
|
|
1224
|
+
sources: [
|
|
1225
|
+
`${ctx.monthBranch}月属${monthElement}`,
|
|
1226
|
+
...entries.map((entry) => entry.text),
|
|
1227
|
+
],
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1230
|
+
function pushObjectClueCombo(ctx, out) {
|
|
1231
|
+
const entries = ctx.jiuGongGe
|
|
1232
|
+
.map((palace) => {
|
|
1233
|
+
const clues = [];
|
|
1234
|
+
const stem = palace.tianPan.stem;
|
|
1235
|
+
const star = palace.tianPan.star;
|
|
1236
|
+
const god = palace.shenPan.god;
|
|
1237
|
+
const door = palace.renPan.door;
|
|
1238
|
+
if (stemObjectClues[stem])
|
|
1239
|
+
clues.push(`天盘${stem}${stemObjectClues[stem]}`);
|
|
1240
|
+
if (starObjectClues[star])
|
|
1241
|
+
clues.push(`${star}${starObjectClues[star]}`);
|
|
1242
|
+
if (godObjectClues[god])
|
|
1243
|
+
clues.push(`${god}${godObjectClues[god]}`);
|
|
1244
|
+
if (doorObjectClues[door])
|
|
1245
|
+
clues.push(`${door}${doorObjectClues[door]}`);
|
|
1246
|
+
if (!clues.length)
|
|
1247
|
+
return undefined;
|
|
1248
|
+
return {
|
|
1249
|
+
gong: palace.gong,
|
|
1250
|
+
key: `${palace.gong}${stem || ''}${star || ''}${god || ''}${door || ''}`,
|
|
1251
|
+
text: `${palace.name}:${clues.join(';')}`,
|
|
1252
|
+
};
|
|
1253
|
+
})
|
|
1254
|
+
.filter((entry) => Boolean(entry));
|
|
1255
|
+
if (!entries.length)
|
|
1256
|
+
return;
|
|
1257
|
+
out.push({
|
|
1258
|
+
key: `combo:objectClues:${entries.map((entry) => entry.key).join(':')}`,
|
|
1259
|
+
name: '射覆物象克应',
|
|
1260
|
+
tone: 'mixed',
|
|
1261
|
+
score: 0,
|
|
1262
|
+
summary: `按天盘干、九星、八神、八门取射覆物象:${entries
|
|
1263
|
+
.map((entry) => entry.text)
|
|
1264
|
+
.join(';')}。偏物形、颜色、材质、状态线索参考,不作通用吉凶评分。`,
|
|
1265
|
+
palace: entries.length === 1 ? entries[0].gong : undefined,
|
|
1266
|
+
sources: entries.map((entry) => entry.text),
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
function pushStemPressureCombo(ctx, out) {
|
|
1270
|
+
const entries = ctx.jiuGongGe
|
|
1271
|
+
.map((palace) => {
|
|
1272
|
+
const stem = palace.tianPan.stem;
|
|
1273
|
+
const rule = stemPressureRules[stem];
|
|
1274
|
+
if (!stem || !rule || !rule.palaces.includes(palace.gong))
|
|
1275
|
+
return undefined;
|
|
1276
|
+
return {
|
|
1277
|
+
gong: palace.gong,
|
|
1278
|
+
text: `${palace.name}天盘${stem}属${rule.stemElement}临${rule.palaceElement}宫,${rule.issue}`,
|
|
1279
|
+
};
|
|
1280
|
+
})
|
|
1281
|
+
.filter((entry) => Boolean(entry));
|
|
1282
|
+
if (!entries.length)
|
|
1283
|
+
return;
|
|
1284
|
+
out.push({
|
|
1285
|
+
key: `combo:stemPressure:${entries.map((entry) => entry.gong).join(':')}`,
|
|
1286
|
+
name: '十干迫制',
|
|
1287
|
+
tone: 'mixed',
|
|
1288
|
+
score: 0,
|
|
1289
|
+
summary: `奇仪临受克之宫:${entries
|
|
1290
|
+
.map((entry) => entry.text)
|
|
1291
|
+
.join(';')}。合“甲乙金宫、丙丁坎内、戊己惧杜伤、庚辛离上、壬癸生死方”的十干迫制口径;需再合旺衰强弱判断,只作命宫、奇仪受制证据参考,不作通用吉凶评分。`,
|
|
1292
|
+
palace: entries.length === 1 ? entries[0].gong : undefined,
|
|
1293
|
+
sources: entries.map((entry) => entry.text),
|
|
1294
|
+
});
|
|
1295
|
+
}
|
|
1296
|
+
function pushStrategicDirectionCombos(ctx, out) {
|
|
1297
|
+
const tianYiPalace = findStarPalace(ctx.jiuGongGe, ctx.zhiFu);
|
|
1298
|
+
const jiuTianPalace = findGodPalace(ctx.jiuGongGe, '九天');
|
|
1299
|
+
const shengMenPalace = findDoorPalace(ctx.jiuGongGe, '生门');
|
|
1300
|
+
if (tianYiPalace) {
|
|
1301
|
+
const openCloseState = zhiFuOpenPalaces.has(tianYiPalace.gong)
|
|
1302
|
+
? {
|
|
1303
|
+
name: '开通',
|
|
1304
|
+
advice: '逢开利以有为,宜主动推进',
|
|
1305
|
+
}
|
|
1306
|
+
: zhiFuClosedPalaces.has(tianYiPalace.gong)
|
|
1307
|
+
? {
|
|
1308
|
+
name: '闭塞',
|
|
1309
|
+
advice: '值闭尤宜静默,宜守势等待',
|
|
1310
|
+
}
|
|
1311
|
+
: undefined;
|
|
1312
|
+
if (openCloseState) {
|
|
1313
|
+
out.push({
|
|
1314
|
+
key: `combo:zhiFuOpenClose:${tianYiPalace.gong}`,
|
|
1315
|
+
name: '值符开通闭塞',
|
|
1316
|
+
tone: 'mixed',
|
|
1317
|
+
score: 0,
|
|
1318
|
+
summary: `值符星${ctx.zhiFu}落${tianYiPalace.name},符临${tianYiPalace.gong}宫为${openCloseState.name};${openCloseState.advice}。此为《奇门宝鉴御定》开合时机参考,不作通用吉凶评分。`,
|
|
1319
|
+
palace: tianYiPalace.gong,
|
|
1320
|
+
sources: [
|
|
1321
|
+
`值符星${ctx.zhiFu}落${tianYiPalace.name}`,
|
|
1322
|
+
`${tianYiPalace.gong}宫:${openCloseState.name}`,
|
|
1323
|
+
],
|
|
1324
|
+
});
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
if (tianYiPalace && jiuTianPalace && shengMenPalace) {
|
|
1328
|
+
out.push({
|
|
1329
|
+
key: 'combo:sanShengDi',
|
|
1330
|
+
name: '三胜地',
|
|
1331
|
+
tone: 'super-good',
|
|
1332
|
+
score: 10,
|
|
1333
|
+
summary: `值符星落${tianYiPalace.name}、九天在${jiuTianPalace.name}、生门在${shengMenPalace.name},为三胜所取之地,可作为争取主动与择方参考。`,
|
|
1334
|
+
sources: [
|
|
1335
|
+
`值符星${ctx.zhiFu}落${tianYiPalace.name}`,
|
|
1336
|
+
`九天在${jiuTianPalace.name}`,
|
|
1337
|
+
`生门在${shengMenPalace.name}`,
|
|
1338
|
+
],
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
const tianYiOppositePalace = tianYiPalace
|
|
1342
|
+
? getPalace(ctx.jiuGongGe, palaceOppositeMap[tianYiPalace.gong])
|
|
1343
|
+
: undefined;
|
|
1344
|
+
if (tianYiPalace && tianYiOppositePalace) {
|
|
1345
|
+
out.push({
|
|
1346
|
+
key: 'combo:tianYiJiChong',
|
|
1347
|
+
name: '天乙击冲',
|
|
1348
|
+
tone: 'mixed',
|
|
1349
|
+
score: 0,
|
|
1350
|
+
summary: `值符星${ctx.zhiFu}落${tianYiPalace.name}为天乙宫,兵事宜居其方、击其对冲${tianYiOppositePalace.name};此为坐击取向参考,不作通用吉凶评分。`,
|
|
1351
|
+
palace: tianYiPalace.gong,
|
|
1352
|
+
sources: [
|
|
1353
|
+
`天乙宫:${tianYiPalace.name}`,
|
|
1354
|
+
`对冲:${tianYiOppositePalace.name}`,
|
|
1355
|
+
],
|
|
1356
|
+
});
|
|
1357
|
+
}
|
|
1358
|
+
const jiuDiPalace = findGodPalace(ctx.jiuGongGe, '九地');
|
|
1359
|
+
const zhiShiPalace = findDoorPalace(ctx.jiuGongGe, ctx.zhiShi);
|
|
1360
|
+
if (tianYiPalace && jiuTianPalace && shengMenPalace && jiuDiPalace && zhiShiPalace) {
|
|
1361
|
+
out.push({
|
|
1362
|
+
key: 'combo:wuBuJi',
|
|
1363
|
+
name: '五不击',
|
|
1364
|
+
tone: 'mixed',
|
|
1365
|
+
score: 0,
|
|
1366
|
+
summary: '值符星、九天、生门、九地和值使所在宫为五不击,偏兵事攻守禁忌;宜据守借势,不宜把这些方位作为攻击对象。',
|
|
1367
|
+
sources: [
|
|
1368
|
+
`天乙宫:${tianYiPalace.name}`,
|
|
1369
|
+
`九天:${jiuTianPalace.name}`,
|
|
1370
|
+
`生门:${shengMenPalace.name}`,
|
|
1371
|
+
`九地:${jiuDiPalace.name}`,
|
|
1372
|
+
`值使${ctx.zhiShi}:${zhiShiPalace.name}`,
|
|
1373
|
+
],
|
|
1374
|
+
});
|
|
1375
|
+
}
|
|
1376
|
+
if (zhiShiPalace?.gong === 3) {
|
|
1377
|
+
out.push({
|
|
1378
|
+
key: 'combo:quSan',
|
|
1379
|
+
name: '趋三',
|
|
1380
|
+
tone: 'super-good',
|
|
1381
|
+
score: 6,
|
|
1382
|
+
summary: `值使${ctx.zhiShi}到${zhiShiPalace.name},合“值使到震宜向之”之法,可作为取向与出行择方参考。`,
|
|
1383
|
+
palace: zhiShiPalace.gong,
|
|
1384
|
+
sources: [`值使${ctx.zhiShi}落${zhiShiPalace.name}`],
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
if (zhiShiPalace?.gong === 4) {
|
|
1388
|
+
out.push({
|
|
1389
|
+
key: 'combo:biWu',
|
|
1390
|
+
name: '避五',
|
|
1391
|
+
tone: 'mixed',
|
|
1392
|
+
score: 0,
|
|
1393
|
+
summary: `值使${ctx.zhiShi}到${zhiShiPalace.name},合“值使到巽宫宜去之”之法,偏择方避让参考,不作通用凶方扣分。`,
|
|
1394
|
+
palace: zhiShiPalace.gong,
|
|
1395
|
+
sources: [`值使${ctx.zhiShi}落${zhiShiPalace.name}`],
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1398
|
+
if (ctx.zhiShi && zhiShiPalace?.shenPan.god && eightGods.has(zhiShiPalace.shenPan.god)) {
|
|
1399
|
+
out.push({
|
|
1400
|
+
key: `combo:baJiangHuiMen:${zhiShiPalace.gong}`,
|
|
1401
|
+
name: '八将会门',
|
|
1402
|
+
tone: 'mixed',
|
|
1403
|
+
score: 0,
|
|
1404
|
+
summary: `值使${ctx.zhiShi}落${zhiShiPalace.name},上临${zhiShiPalace.shenPan.god},为${zhiShiPalace.shenPan.god}会${ctx.zhiShi};古法收用天盘不用地盘,偏天时、行兵、捕捉等场景参考,不作通用吉凶评分。`,
|
|
1405
|
+
palace: zhiShiPalace.gong,
|
|
1406
|
+
sources: [
|
|
1407
|
+
`值使${ctx.zhiShi}:${zhiShiPalace.name}`,
|
|
1408
|
+
`${zhiShiPalace.shenPan.god}会${ctx.zhiShi}`,
|
|
1409
|
+
],
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
const youDuBranch = ctx.dayStem ? youDuBranchByDayStem[ctx.dayStem] : undefined;
|
|
1413
|
+
const luDuBranch = youDuBranch ? branchOppositeMap[youDuBranch] : undefined;
|
|
1414
|
+
const youDuPalace = youDuBranch ? getPalaceByBranch(ctx.jiuGongGe, youDuBranch) : undefined;
|
|
1415
|
+
const luDuPalace = luDuBranch ? getPalaceByBranch(ctx.jiuGongGe, luDuBranch) : undefined;
|
|
1416
|
+
if (youDuBranch && luDuBranch && youDuPalace && luDuPalace) {
|
|
1417
|
+
out.push({
|
|
1418
|
+
key: 'combo:youDuLuDu',
|
|
1419
|
+
name: '游都鲁都',
|
|
1420
|
+
tone: 'mixed',
|
|
1421
|
+
score: 0,
|
|
1422
|
+
summary: `${ctx.dayStem}日游都在${youDuBranch}支${youDuPalace.name},对冲鲁都在${luDuBranch}支${luDuPalace.name},偏兵事背击与择方参考,不作通用吉凶评分。`,
|
|
1423
|
+
sources: [
|
|
1424
|
+
`${ctx.dayStem}日游都:${youDuBranch}支${youDuPalace.name}`,
|
|
1425
|
+
`鲁都:${luDuBranch}支${luDuPalace.name}`,
|
|
1426
|
+
],
|
|
1427
|
+
});
|
|
1428
|
+
}
|
|
1429
|
+
const xunShouGanZhi = getXunShouGanZhi(ctx.activeGanZhi);
|
|
1430
|
+
const tianMuDiEr = xunShouGanZhi ? tianMuDiErByXun[xunShouGanZhi] : undefined;
|
|
1431
|
+
const tianMuPalace = tianMuDiEr
|
|
1432
|
+
? getPalaceByBranch(ctx.jiuGongGe, tianMuDiEr.tianMu.branch)
|
|
1433
|
+
: undefined;
|
|
1434
|
+
const diErPalace = tianMuDiEr
|
|
1435
|
+
? getPalaceByBranch(ctx.jiuGongGe, tianMuDiEr.diEr.branch)
|
|
1436
|
+
: undefined;
|
|
1437
|
+
if (ctx.activeGanZhi && xunShouGanZhi && tianMuDiEr && tianMuPalace && diErPalace) {
|
|
1438
|
+
out.push({
|
|
1439
|
+
key: 'combo:tianMuDiEr',
|
|
1440
|
+
name: '天目地耳',
|
|
1441
|
+
tone: 'mixed',
|
|
1442
|
+
score: 0,
|
|
1443
|
+
summary: `${ctx.activeGanZhi}属${xunShouGanZhi}旬,天目为${tianMuDiEr.tianMu.ganZhi}(${tianMuPalace.name}),地耳为${tianMuDiEr.diEr.ganZhi}(${diErPalace.name}),偏兵事“背天目击地耳”参考,不作通用吉凶评分。`,
|
|
1444
|
+
sources: [
|
|
1445
|
+
`${xunShouGanZhi}旬天目:${tianMuDiEr.tianMu.ganZhi}${tianMuPalace.name}`,
|
|
1446
|
+
`${xunShouGanZhi}旬地耳:${tianMuDiEr.diEr.ganZhi}${diErPalace.name}`,
|
|
1447
|
+
],
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
const guXu = xunShouGanZhi ? guXuByXun[xunShouGanZhi] : undefined;
|
|
1451
|
+
const guLabels = guXu ? getBranchPalaceLabels(ctx.jiuGongGe, guXu.gu) : undefined;
|
|
1452
|
+
const xuLabels = guXu ? getBranchPalaceLabels(ctx.jiuGongGe, guXu.xu) : undefined;
|
|
1453
|
+
if (ctx.activeGanZhi && xunShouGanZhi && guXu && guLabels && xuLabels) {
|
|
1454
|
+
out.push({
|
|
1455
|
+
key: 'combo:xunGuXu',
|
|
1456
|
+
name: '孤虚',
|
|
1457
|
+
tone: 'mixed',
|
|
1458
|
+
score: 0,
|
|
1459
|
+
summary: `${ctx.activeGanZhi}属${xunShouGanZhi}旬,孤在${guLabels.join('、')},虚在${xuLabels.join('、')};偏兵事“背孤击虚”、博弈坐向与远行避忌参考,不作通用吉凶评分。`,
|
|
1460
|
+
sources: [
|
|
1461
|
+
`${xunShouGanZhi}旬孤:${guLabels.join('、')}`,
|
|
1462
|
+
`${xunShouGanZhi}旬虚:${xuLabels.join('、')}`,
|
|
1463
|
+
],
|
|
1464
|
+
});
|
|
1465
|
+
}
|
|
1466
|
+
const tianMa = getTianMaLabels(ctx.jiuGongGe, ctx.monthBranch, ctx.hourBranch);
|
|
1467
|
+
if (ctx.monthBranch && ctx.hourBranch && tianMa) {
|
|
1468
|
+
out.push({
|
|
1469
|
+
key: 'combo:tianMaDirection',
|
|
1470
|
+
name: '天马方',
|
|
1471
|
+
tone: 'mixed',
|
|
1472
|
+
score: 0,
|
|
1473
|
+
summary: `${ctx.monthBranch}月${ctx.hourBranch}时以月将${tianMa.monthGeneral}加时支,顺数至卯为太冲天马方:${tianMa.labels.join('、')};偏急难逃避与出行择方参考,不作通用吉凶评分。`,
|
|
1474
|
+
sources: [`天马方:${tianMa.labels.join('、')}`],
|
|
1475
|
+
});
|
|
1476
|
+
}
|
|
1477
|
+
const tianGang = getTianGangLabels(ctx.jiuGongGe, ctx.monthBranch, ctx.hourBranch);
|
|
1478
|
+
if (ctx.monthBranch && ctx.hourBranch && tianGang) {
|
|
1479
|
+
out.push({
|
|
1480
|
+
key: 'combo:tianGangTime',
|
|
1481
|
+
name: '天罡时',
|
|
1482
|
+
tone: 'mixed',
|
|
1483
|
+
score: 0,
|
|
1484
|
+
summary: `${ctx.monthBranch}月${ctx.hourBranch}时以月将${tianGang.monthGeneral}加时支,上盘天罡所临为斗星方:${tianGang.labels.join('、')};偏行兵破阵与择方参考,不作通用吉凶评分。`,
|
|
1485
|
+
sources: [`斗星方:${tianGang.labels.join('、')}`],
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1488
|
+
const tianGangBranch = tianGang?.targetBranches[0];
|
|
1489
|
+
const tianGangPalace = tianGangBranch
|
|
1490
|
+
? getPalaceByBranch(ctx.jiuGongGe, tianGangBranch)
|
|
1491
|
+
: undefined;
|
|
1492
|
+
const lostRoute = tianGangBranch ? getMengZhongJiRoute(tianGangBranch) : undefined;
|
|
1493
|
+
if (ctx.monthBranch &&
|
|
1494
|
+
ctx.hourBranch &&
|
|
1495
|
+
tianGang &&
|
|
1496
|
+
tianGangBranch &&
|
|
1497
|
+
tianGangPalace &&
|
|
1498
|
+
lostRoute) {
|
|
1499
|
+
out.push({
|
|
1500
|
+
key: 'combo:lostRoute',
|
|
1501
|
+
name: '迷路法',
|
|
1502
|
+
tone: 'mixed',
|
|
1503
|
+
score: 0,
|
|
1504
|
+
summary: `${ctx.monthBranch}月${ctx.hourBranch}时以月将${tianGang.monthGeneral}加时支,天罡临${tianGangBranch}支${tianGangPalace.name},属${lostRoute.position}位,${lostRoute.route};偏行军迷路、择道参考,不作通用吉凶评分。`,
|
|
1505
|
+
palace: tianGangPalace.gong,
|
|
1506
|
+
sources: [
|
|
1507
|
+
`天罡:${tianGangBranch}支${tianGangPalace.name}`,
|
|
1508
|
+
`天罡加${lostRoute.position}:${lostRoute.route}`,
|
|
1509
|
+
],
|
|
1510
|
+
});
|
|
1511
|
+
}
|
|
1512
|
+
const tianSanMen = getTianSanMenLabels(ctx.jiuGongGe, ctx.monthBranch, ctx.hourBranch);
|
|
1513
|
+
const diSiHuLabels = ctx.monthBranch && ctx.hourBranch ? getDiSiHuLabels(ctx.jiuGongGe, ctx.hourBranch) : undefined;
|
|
1514
|
+
if (ctx.monthBranch && ctx.hourBranch && tianSanMen && diSiHuLabels) {
|
|
1515
|
+
out.push({
|
|
1516
|
+
key: 'combo:tianSanMenDiSiHu',
|
|
1517
|
+
name: '天三门地四户',
|
|
1518
|
+
tone: 'mixed',
|
|
1519
|
+
score: 0,
|
|
1520
|
+
summary: `${ctx.monthBranch}月${ctx.hourBranch}时以月将${tianSanMen.monthGeneral}加时支,天三门为${tianSanMen.labels.join('、')};以月建加时支,地四户为${diSiHuLabels.join('、')};偏出行、避难与择方参考,遇三奇吉门更佳,不作通用吉凶评分。`,
|
|
1521
|
+
sources: [
|
|
1522
|
+
`天三门:${tianSanMen.labels.join('、')}`,
|
|
1523
|
+
`地四户:${diSiHuLabels.join('、')}`,
|
|
1524
|
+
],
|
|
1525
|
+
});
|
|
1526
|
+
}
|
|
1527
|
+
const dayStem = ctx.dayStem || ctx.dayGanZhi?.charAt(0);
|
|
1528
|
+
const dayBranch = ctx.dayBranch || ctx.dayGanZhi?.charAt(1);
|
|
1529
|
+
const earthPrivateDoor = getEarthPrivateDoorLabels(ctx.jiuGongGe, dayStem, dayBranch, ctx.monthBranch, ctx.hourBranch);
|
|
1530
|
+
if (dayStem && dayBranch && ctx.monthBranch && ctx.hourBranch && earthPrivateDoor) {
|
|
1531
|
+
out.push({
|
|
1532
|
+
key: 'combo:earthPrivateDoor',
|
|
1533
|
+
name: '地私门',
|
|
1534
|
+
tone: 'mixed',
|
|
1535
|
+
score: 0,
|
|
1536
|
+
summary: `${dayStem}${dayBranch}日取${earthPrivateDoor.nobleType}${earthPrivateDoor.nobleBranch},${ctx.monthBranch}月${ctx.hourBranch}时以月将${earthPrivateDoor.monthGeneral}加时支,贵人落${earthPrivateDoor.nobleGroundBranch}支${earthPrivateDoor.nobleGroundPalace.name},${earthPrivateDoor.direction}排十二天将,地私门为${earthPrivateDoor.labels.join('、')};偏出行、隐避与败军出走参考,遇奇门相照更佳,不作通用吉凶评分。`,
|
|
1537
|
+
sources: [
|
|
1538
|
+
`${dayStem}${dayBranch}日${earthPrivateDoor.nobleType}${earthPrivateDoor.nobleBranch}`,
|
|
1539
|
+
`贵人落${earthPrivateDoor.nobleGroundBranch}支${earthPrivateDoor.nobleGroundPalace.name}${earthPrivateDoor.direction}`,
|
|
1540
|
+
`地私门:${earthPrivateDoor.labels.join('、')}`,
|
|
1541
|
+
],
|
|
1542
|
+
});
|
|
1543
|
+
}
|
|
1544
|
+
const tingTingBaiJian = getTingTingBaiJianLabels(ctx.jiuGongGe, ctx.monthBranch, ctx.hourBranch);
|
|
1545
|
+
if (ctx.monthBranch && ctx.hourBranch && tingTingBaiJian) {
|
|
1546
|
+
out.push({
|
|
1547
|
+
key: 'combo:tingTingBaiJian',
|
|
1548
|
+
name: '亭亭白奸',
|
|
1549
|
+
tone: 'mixed',
|
|
1550
|
+
score: 0,
|
|
1551
|
+
summary: `${ctx.monthBranch}月${ctx.hourBranch}时以月将${tingTingBaiJian.monthGeneral}加时支,神后所临为亭亭方:${tingTingBaiJian.tingTing.join('、')};功曹、胜光、天罡所临为白奸方:${tingTingBaiJian.baiJian.join('、')};合于巳亥宜战,格于寅申宜守,其余偏“背亭亭击白奸”参考,不作通用吉凶评分。`,
|
|
1552
|
+
sources: [
|
|
1553
|
+
`亭亭方:${tingTingBaiJian.tingTing.join('、')}`,
|
|
1554
|
+
`白奸方:${tingTingBaiJian.baiJian.join('、')}`,
|
|
1555
|
+
],
|
|
1556
|
+
});
|
|
1557
|
+
}
|
|
1558
|
+
const qingLongStem = xunShouGanZhi ? dunJiaStemByXun[xunShouGanZhi] : undefined;
|
|
1559
|
+
const tianMenPalace = findTianStemPalace(ctx.jiuGongGe, '戊');
|
|
1560
|
+
const diHuPalace = findTianStemPalace(ctx.jiuGongGe, '己');
|
|
1561
|
+
const guoTaiYinPalace = findTianStemPalace(ctx.jiuGongGe, '丁');
|
|
1562
|
+
const qingLongPalace = findTianStemPalace(ctx.jiuGongGe, qingLongStem);
|
|
1563
|
+
if (ctx.activeGanZhi &&
|
|
1564
|
+
xunShouGanZhi &&
|
|
1565
|
+
qingLongStem &&
|
|
1566
|
+
tianMenPalace &&
|
|
1567
|
+
diHuPalace &&
|
|
1568
|
+
guoTaiYinPalace &&
|
|
1569
|
+
qingLongPalace) {
|
|
1570
|
+
out.push({
|
|
1571
|
+
key: 'combo:tianMenDiHuTaiYinQingLong',
|
|
1572
|
+
name: '天门地户太阴青龙',
|
|
1573
|
+
tone: 'mixed',
|
|
1574
|
+
score: 0,
|
|
1575
|
+
summary: `${ctx.activeGanZhi}属${xunShouGanZhi}旬,出天门取天盘戊所在${tianMenPalace.name},入地户取天盘己所在${diHuPalace.name},过太阴取天盘丁所在${guoTaiYinPalace.name},居青龙取本旬六甲遁${qingLongStem}所在${qingLongPalace.name};偏出行避难与兵事用方参考,不作通用吉凶评分。`,
|
|
1576
|
+
sources: [
|
|
1577
|
+
`天门:天盘戊${tianMenPalace.name}`,
|
|
1578
|
+
`地户:天盘己${diHuPalace.name}`,
|
|
1579
|
+
`太阴:天盘丁${guoTaiYinPalace.name}`,
|
|
1580
|
+
`青龙:${xunShouGanZhi}旬六甲遁${qingLongStem}${qingLongPalace.name}`,
|
|
1581
|
+
],
|
|
1582
|
+
});
|
|
1583
|
+
}
|
|
1584
|
+
const campRolePalaces = qingLongStem
|
|
1585
|
+
? [
|
|
1586
|
+
{ role: '大将', label: `本旬六甲遁${qingLongStem}`, palace: qingLongPalace },
|
|
1587
|
+
{ role: '旗鼓', label: '天盘乙', palace: findTianStemPalace(ctx.jiuGongGe, '乙') },
|
|
1588
|
+
{ role: '士卒', label: '天盘丙', palace: findTianStemPalace(ctx.jiuGongGe, '丙') },
|
|
1589
|
+
{ role: '伏兵', label: '天盘丁', palace: guoTaiYinPalace },
|
|
1590
|
+
{ role: '判断', label: '天盘辛', palace: findTianStemPalace(ctx.jiuGongGe, '辛') },
|
|
1591
|
+
{ role: '囚系粮储', label: '天盘壬', palace: findTianStemPalace(ctx.jiuGongGe, '壬') },
|
|
1592
|
+
{ role: '所藏', label: '天盘癸', palace: findTianStemPalace(ctx.jiuGongGe, '癸') },
|
|
1593
|
+
]
|
|
1594
|
+
: [];
|
|
1595
|
+
if (ctx.activeGanZhi &&
|
|
1596
|
+
xunShouGanZhi &&
|
|
1597
|
+
qingLongStem &&
|
|
1598
|
+
campRolePalaces.length > 0 &&
|
|
1599
|
+
campRolePalaces.every((item) => item.palace)) {
|
|
1600
|
+
const roleLabels = campRolePalaces.map((item) => `${item.role}取${item.label}所在${item.palace?.name}`);
|
|
1601
|
+
out.push({
|
|
1602
|
+
key: 'combo:campLayout',
|
|
1603
|
+
name: '下营法',
|
|
1604
|
+
tone: 'mixed',
|
|
1605
|
+
score: 0,
|
|
1606
|
+
summary: `${ctx.activeGanZhi}属${xunShouGanZhi}旬,${roleLabels.join(',')};偏行军下营分工参考,不作通用吉凶评分。`,
|
|
1607
|
+
sources: roleLabels,
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1610
|
+
if (ctx.hourStem && (yangHourStems.has(ctx.hourStem) || yinHourStems.has(ctx.hourStem))) {
|
|
1611
|
+
const isYangHour = yangHourStems.has(ctx.hourStem);
|
|
1612
|
+
out.push({
|
|
1613
|
+
key: 'combo:yangYinHourHostGuest',
|
|
1614
|
+
name: '五阳五阴主客',
|
|
1615
|
+
tone: 'mixed',
|
|
1616
|
+
score: 0,
|
|
1617
|
+
summary: isYangHour
|
|
1618
|
+
? `${ctx.hourStem}时属五阳时,兵事利客、宜先举;用局重看天盘奇仪星门是否强盛,不作通用吉凶评分。`
|
|
1619
|
+
: `${ctx.hourStem}时属五阴时,兵事利主、宜后应;用局重看地盘奇仪星门是否强盛,不作通用吉凶评分。`,
|
|
1620
|
+
sources: [
|
|
1621
|
+
isYangHour
|
|
1622
|
+
? `${ctx.hourStem}时为五阳时:利客先举`
|
|
1623
|
+
: `${ctx.hourStem}时为五阴时:利主后应`,
|
|
1624
|
+
],
|
|
1625
|
+
});
|
|
1626
|
+
}
|
|
1627
|
+
const dayGanZhi = ctx.dayGanZhi || (ctx.dayStem && ctx.dayBranch ? `${ctx.dayStem}${ctx.dayBranch}` : undefined);
|
|
1628
|
+
const diBing = dayGanZhi ? xunZhongDiBingDay[dayGanZhi] : undefined;
|
|
1629
|
+
if (dayGanZhi && diBing) {
|
|
1630
|
+
out.push({
|
|
1631
|
+
key: 'combo:xunZhongDiBingDay',
|
|
1632
|
+
name: '旬中地丙日',
|
|
1633
|
+
tone: 'mixed',
|
|
1634
|
+
score: 0,
|
|
1635
|
+
summary: `${dayGanZhi}为${diBing.xun}${diBing.branch}日,合“旬中地丙日”,偏兵事用日避忌;将兵者不宜用,不作通用吉凶评分。`,
|
|
1636
|
+
sources: [`${diBing.xun}${diBing.branch}日:旬中地丙日`],
|
|
1637
|
+
});
|
|
1638
|
+
}
|
|
1639
|
+
const daJiangJunBranch = ctx.yearBranch ? daJiangJunBranchByYearBranch[ctx.yearBranch] : undefined;
|
|
1640
|
+
const daJiangJunPalace = daJiangJunBranch
|
|
1641
|
+
? getPalaceByBranch(ctx.jiuGongGe, daJiangJunBranch)
|
|
1642
|
+
: undefined;
|
|
1643
|
+
if (ctx.yearBranch && daJiangJunBranch && daJiangJunPalace) {
|
|
1644
|
+
out.push({
|
|
1645
|
+
key: 'combo:daJiangJunDirection',
|
|
1646
|
+
name: '大将军方',
|
|
1647
|
+
tone: 'mixed',
|
|
1648
|
+
score: 0,
|
|
1649
|
+
summary: `${ctx.yearBranch}年大将军在${daJiangJunBranch}支${daJiangJunPalace.name},偏兵事背击与避犯参考,不作通用吉凶评分。`,
|
|
1650
|
+
palace: daJiangJunPalace.gong,
|
|
1651
|
+
sources: [`${ctx.yearBranch}年大将军:${daJiangJunBranch}支${daJiangJunPalace.name}`],
|
|
1652
|
+
});
|
|
1653
|
+
}
|
|
1654
|
+
const taiSuiPalace = ctx.yearBranch ? getPalaceByBranch(ctx.jiuGongGe, ctx.yearBranch) : undefined;
|
|
1655
|
+
if (ctx.yearBranch && taiSuiPalace) {
|
|
1656
|
+
out.push({
|
|
1657
|
+
key: 'combo:taiSuiDirection',
|
|
1658
|
+
name: '太岁方',
|
|
1659
|
+
tone: 'mixed',
|
|
1660
|
+
score: 0,
|
|
1661
|
+
summary: `${ctx.yearBranch}年太岁在地盘${ctx.yearBranch}支${taiSuiPalace.name},偏兵事背击与避犯参考,不作通用吉凶评分。`,
|
|
1662
|
+
palace: taiSuiPalace.gong,
|
|
1663
|
+
sources: [`太岁:地盘${ctx.yearBranch}支${taiSuiPalace.name}`],
|
|
1664
|
+
});
|
|
1665
|
+
}
|
|
1666
|
+
const yueJianPalace = ctx.monthBranch
|
|
1667
|
+
? getPalaceByBranch(ctx.jiuGongGe, ctx.monthBranch)
|
|
1668
|
+
: undefined;
|
|
1669
|
+
if (ctx.monthBranch && yueJianPalace) {
|
|
1670
|
+
out.push({
|
|
1671
|
+
key: 'combo:yueJianDirection',
|
|
1672
|
+
name: '月建方',
|
|
1673
|
+
tone: 'mixed',
|
|
1674
|
+
score: 0,
|
|
1675
|
+
summary: `${ctx.monthBranch}月月建在地盘${ctx.monthBranch}支${yueJianPalace.name},偏兵事背击与避犯参考,不作通用吉凶评分。`,
|
|
1676
|
+
palace: yueJianPalace.gong,
|
|
1677
|
+
sources: [`月建:地盘${ctx.monthBranch}支${yueJianPalace.name}`],
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
1680
|
+
const taiYinPalace = findGodPalace(ctx.jiuGongGe, '太阴');
|
|
1681
|
+
if (taiYinPalace) {
|
|
1682
|
+
out.push({
|
|
1683
|
+
key: 'combo:taiYinDirection',
|
|
1684
|
+
name: '太阴方',
|
|
1685
|
+
tone: 'mixed',
|
|
1686
|
+
score: 0,
|
|
1687
|
+
summary: `八神太阴在${taiYinPalace.name},偏兵事背击、伏藏与避犯参考,不作通用吉凶评分。`,
|
|
1688
|
+
palace: taiYinPalace.gong,
|
|
1689
|
+
sources: [`太阴:八神太阴宫${taiYinPalace.name}`],
|
|
1690
|
+
});
|
|
1691
|
+
}
|
|
1692
|
+
const liuHePalace = findGodPalace(ctx.jiuGongGe, '六合');
|
|
1693
|
+
if (jiuTianPalace && jiuDiPalace && taiYinPalace && liuHePalace) {
|
|
1694
|
+
out.push({
|
|
1695
|
+
key: 'combo:fourGodDirections',
|
|
1696
|
+
name: '四神用方',
|
|
1697
|
+
tone: 'mixed',
|
|
1698
|
+
score: 0,
|
|
1699
|
+
summary: `九天在${jiuTianPalace.name}宜扬兵,九地在${jiuDiPalace.name}宜潜藏立营,太阴在${taiYinPalace.name}宜伏兵,六合在${liuHePalace.name}宜逃形谋议;偏兵事与隐遁取向参考,不作通用吉凶评分。`,
|
|
1700
|
+
sources: [
|
|
1701
|
+
`九天:${jiuTianPalace.name}扬兵`,
|
|
1702
|
+
`九地:${jiuDiPalace.name}潜藏立营`,
|
|
1703
|
+
`太阴:${taiYinPalace.name}伏兵`,
|
|
1704
|
+
`六合:${liuHePalace.name}逃形谋议`,
|
|
1705
|
+
],
|
|
1706
|
+
});
|
|
1707
|
+
}
|
|
1708
|
+
const heKuiPalace = getPalaceByBranch(ctx.jiuGongGe, '戌');
|
|
1709
|
+
if (heKuiPalace) {
|
|
1710
|
+
out.push({
|
|
1711
|
+
key: 'combo:heKuiDirection',
|
|
1712
|
+
name: '河魁方',
|
|
1713
|
+
tone: 'mixed',
|
|
1714
|
+
score: 0,
|
|
1715
|
+
summary: `河魁为戌支,落地盘戌支${heKuiPalace.name},偏兵事背击与避犯参考,不作通用吉凶评分。`,
|
|
1716
|
+
palace: heKuiPalace.gong,
|
|
1717
|
+
sources: [`河魁:戌支${heKuiPalace.name}`],
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1720
|
+
const wuJiang = ctx.dayBranch ? wuJiangDirectionByDayBranch[ctx.dayBranch] : undefined;
|
|
1721
|
+
if (ctx.dayBranch && wuJiang) {
|
|
1722
|
+
const palaceName = getPalaceName(ctx.jiuGongGe, wuJiang.palace);
|
|
1723
|
+
out.push({
|
|
1724
|
+
key: 'combo:wuJiangDirection',
|
|
1725
|
+
name: '五将方',
|
|
1726
|
+
tone: 'mixed',
|
|
1727
|
+
score: 0,
|
|
1728
|
+
summary: `${ctx.dayBranch}日五将方在${wuJiang.direction}(${palaceName}),偏兵事遇敌避犯与择利反击参考,不作通用吉凶评分。`,
|
|
1729
|
+
palace: wuJiang.palace,
|
|
1730
|
+
sources: [`${ctx.dayBranch}日五将方:${wuJiang.direction}${palaceName}`],
|
|
1731
|
+
});
|
|
1732
|
+
}
|
|
1733
|
+
const shiZhongHour = ctx.dayBranch
|
|
1734
|
+
? shiZhongJiangXingHourByDayBranch[ctx.dayBranch]
|
|
1735
|
+
: undefined;
|
|
1736
|
+
if (ctx.dayBranch && ctx.hourBranch && shiZhongHour === ctx.hourBranch) {
|
|
1737
|
+
out.push({
|
|
1738
|
+
key: 'combo:shiZhongJiangXing',
|
|
1739
|
+
name: '时中将星',
|
|
1740
|
+
tone: 'mixed',
|
|
1741
|
+
score: 0,
|
|
1742
|
+
summary: `${ctx.dayBranch}日逢${ctx.hourBranch}时,为时中将星,偏兵事择时参考,不作通用吉凶评分。`,
|
|
1743
|
+
sources: [`${ctx.dayBranch}日${ctx.hourBranch}时:时中将星`],
|
|
1744
|
+
});
|
|
1745
|
+
}
|
|
1746
|
+
const xiongBranch = ctx.monthBranch ? xiongBranchByMonthBranch[ctx.monthBranch] : undefined;
|
|
1747
|
+
const ciBranch = xiongBranch ? branchOppositeMap[xiongBranch] : undefined;
|
|
1748
|
+
const xiongPalace = xiongBranch ? getPalaceByBranch(ctx.jiuGongGe, xiongBranch) : undefined;
|
|
1749
|
+
const ciPalace = ciBranch ? getPalaceByBranch(ctx.jiuGongGe, ciBranch) : undefined;
|
|
1750
|
+
if (ctx.monthBranch && xiongBranch && ciBranch && xiongPalace && ciPalace) {
|
|
1751
|
+
out.push({
|
|
1752
|
+
key: 'combo:xiongCiDirection',
|
|
1753
|
+
name: '雄雌方',
|
|
1754
|
+
tone: 'mixed',
|
|
1755
|
+
score: 0,
|
|
1756
|
+
summary: `${ctx.monthBranch}月以${xiongBranch}支${xiongPalace.name}为雄,对冲${ciBranch}支${ciPalace.name}为雌,偏兵事“背雄击雌”参考,不作通用吉凶评分。`,
|
|
1757
|
+
sources: [
|
|
1758
|
+
`${ctx.monthBranch}月雄方:${xiongBranch}支${xiongPalace.name}`,
|
|
1759
|
+
`雌方:${ciBranch}支${ciPalace.name}`,
|
|
1760
|
+
],
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1763
|
+
const attackAvoidance = ctx.dayStem ? attackAvoidanceByDayStem[ctx.dayStem] : undefined;
|
|
1764
|
+
if (attackAvoidance) {
|
|
1765
|
+
const palaceNames = attackAvoidance.palaces.map((palace) => getPalaceName(ctx.jiuGongGe, palace));
|
|
1766
|
+
out.push({
|
|
1767
|
+
key: 'combo:dayStemAttackAvoidance',
|
|
1768
|
+
name: '日干攻方避忌',
|
|
1769
|
+
tone: 'mixed',
|
|
1770
|
+
score: 0,
|
|
1771
|
+
summary: `${ctx.dayStem}日不宜攻${attackAvoidance.direction}(${palaceNames.join('、')}),偏兵事攻方避忌;只作攻守参考,不作通用吉凶评分。`,
|
|
1772
|
+
sources: [
|
|
1773
|
+
`${ctx.dayStem}日不宜攻${attackAvoidance.direction}`,
|
|
1774
|
+
`避攻宫位:${palaceNames.join('、')}`,
|
|
1775
|
+
],
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
237
1778
|
}
|
|
238
1779
|
export function detectQimenPatternCombos(ctx) {
|
|
239
1780
|
const out = [];
|
|
240
1781
|
pushPalaceCombos(ctx, out);
|
|
241
1782
|
pushNamedCombos(ctx, out);
|
|
1783
|
+
pushXingDeKaiHeCombo(ctx, out);
|
|
1784
|
+
pushStarPalaceHostGuestCombo(ctx, out);
|
|
1785
|
+
pushDoorPalaceHostGuestCombo(ctx, out);
|
|
1786
|
+
pushStarDoorHostGuestInjuryCombo(ctx, out);
|
|
1787
|
+
pushDoorSeasonQiCombo(ctx, out);
|
|
1788
|
+
pushObjectClueCombo(ctx, out);
|
|
1789
|
+
pushStemPressureCombo(ctx, out);
|
|
1790
|
+
pushStrategicDirectionCombos(ctx, out);
|
|
242
1791
|
const seen = new Set();
|
|
243
1792
|
return out.filter((combo) => {
|
|
244
1793
|
if (seen.has(combo.key))
|