123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524 |
- import Common
- from LocalModel import BaZi, SiZhuWeiZhi, SiZhu, ShenSha
- from model import Tianyiguiren, ShenshaTips, Zaisha, Shishenzhilu, Tiangan, Dashe, Yima, Zhangsheng, Huagai, Taohua
- def check_shenshas(bazi: BaZi):
- # 带new的都是按新版本神煞计算的,目前暂时采用的神煞都是新版本计算的
- __check_new_yangren(bazi)
- # 这里计算的是广义桃花
- __check_new_taohua(bazi)
- __check_new_yima(bazi)
- def __check_new_yangren(bazi: BaZi):
- key = "羊刃"
- tip = "冲羊刃影响健康"
- riyuan = bazi.riGan.text
- if riyuan in ["甲", "乙"]:
- __fill_data_in_bazi("卯", key, tip, bazi)
- elif riyuan in ["丙", "丁"]:
- __fill_data_in_bazi("午", key, tip, bazi)
- elif riyuan in ["戊", "己"]:
- __fill_data_in_bazi("午", key, tip, bazi)
- elif riyuan in ["庚", "辛"]:
- __fill_data_in_bazi("酉", key, tip, bazi)
- elif riyuan in ["壬", "癸"]:
- __fill_data_in_bazi("子", key, tip, bazi)
- def __check_new_taohua(bazi: BaZi):
- key = "桃花"
- tip = ""
- __fill_data_in_bazi("子", key, tip, bazi)
- __fill_data_in_bazi("午", key, tip, bazi)
- __fill_data_in_bazi("卯", key, tip, bazi)
- __fill_data_in_bazi("酉", key, tip, bazi)
- def __check_new_yima(bazi: BaZi):
- key = "驿马"
- tip = "冲坐支驿马为灾"
- __fill_data_in_bazi("申", key, tip, bazi)
- __fill_data_in_bazi("寅", key, tip, bazi)
- __fill_data_in_bazi("巳", key, tip, bazi)
- __fill_data_in_bazi("亥", key, tip, bazi)
- def __check_new_kuigang(bazi: BaZi):
- key = "魁罡"
- texts = [["庚", "辰"], ["戊", "辰"], ["辰", "戌"], ["庚", "辰"]]
- zhus = [SiZhuWeiZhi.nianzhu.value, SiZhuWeiZhi.yuezhu.value, SiZhuWeiZhi.rizhu.value, SiZhuWeiZhi.shizhu.value]
- for zhu in zhus:
- tgdz = bazi.getTianGanDiZhiByZhu(zhu)
- # bazi.shenshaInfo.fenbu[wz].append(info)
- def __fill_data_in_bazi(key: str, name: str, tip: str, bazi: BaZi):
- for sz in bazi.sizhu_dizhis():
- if sz.text == key:
- wz = Common.get_weizhi_of_zhu(sz.weiZhi)
- info = ShenSha(name, tip)
- bazi.shenshaInfo.fenbu[wz].append(info)
- def __check_tianyiguiren(bazi: BaZi):
- key = "天乙贵人"
- dts = Tianyiguiren.select().where(Tianyiguiren.niangan == bazi.nianGan.text)
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
- if len(dts) > 0:
- for dt in dts:
- if bazi.nianZhi.text == dt.dizhi:
- wz = SiZhuWeiZhi.nianzhu
- bazi.add_shensha(wz, key, tip)
- if bazi.yueZhi.text == dt.dizhi:
- wz = SiZhuWeiZhi.yuezhu
- bazi.add_shensha(wz, key, tip)
- if bazi.riZhi.text == dt.dizhi:
- wz = SiZhuWeiZhi.rizhu
- bazi.add_shensha(wz, key, tip)
- if bazi.shiZhi.text == dt.dizhi:
- wz = SiZhuWeiZhi.shizhu
- bazi.add_shensha(wz, key, tip)
- dts2 = Tianyiguiren.select().where(Tianyiguiren.rigan == bazi.riGan.text)
- if len(dts2) > 0:
- for dt in dts2:
- if bazi.nianZhi.text == dt.dizhi:
- wz = SiZhuWeiZhi.nianzhu
- bazi.add_shensha(wz, key, tip)
- if bazi.yueZhi.text == dt.dizhi:
- wz = SiZhuWeiZhi.yuezhu
- bazi.add_shensha(wz, key, tip)
- if bazi.riZhi.text == dt.dizhi:
- wz = SiZhuWeiZhi.rizhu
- bazi.add_shensha(wz, key, tip)
- if bazi.shiZhi.text == dt.dizhi:
- wz = SiZhuWeiZhi.shizhu
- bazi.add_shensha(wz, key, tip)
- def __check_zaisha(bazi: BaZi):
- key = "灾煞"
- dts = Zaisha.select().where(Zaisha.nianzhi == bazi.nianZhi.text)
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
- if len(dts) > 0:
- for dt in dts:
- if bazi.yueZhi.text == dt.dizhi:
- wz = SiZhuWeiZhi.yuezhu
- dz = SiZhuWeiZhi.yuezhi
- bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
- if bazi.riZhi.text == dt.dizhi:
- wz = SiZhuWeiZhi.rizhu
- dz = SiZhuWeiZhi.rizhi
- bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
- if bazi.shiZhi.text == dt.dizhi:
- wz = SiZhuWeiZhi.shizhu
- dz = SiZhuWeiZhi.shizhi
- bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
- dts2 = Zaisha.select().where(Zaisha.rizhi == bazi.riZhi.text)
- if len(dts2) > 0:
- for dt in dts2:
- wz = SiZhuWeiZhi.unknown
- if bazi.nianZhi.text == dt.dizhi:
- wz = SiZhuWeiZhi.nianzhu
- dz = SiZhuWeiZhi.nianzhi
- bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
- if bazi.yueZhi.text == dt.dizhi:
- wz = SiZhuWeiZhi.yuezhu
- dz = SiZhuWeiZhi.yuezhi
- bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
- if bazi.shiZhi.text == dt.dizhi:
- wz = SiZhuWeiZhi.shizhu
- dz = SiZhuWeiZhi.shizhi
- bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
- def __check_wenchangxing(bazi: BaZi):
- key = "文昌星"
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
- if bazi.nianGan.shiShen == "食":
- dts = Shishenzhilu.select().where(Shishenzhilu.tiangan == bazi.nianGan.text)
- if len(dts) > 0:
- if bazi.nianZhi.text == dts[0].dizhi:
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
- if bazi.yueGan.shiShen == "食":
- dts = Shishenzhilu.select().where(Shishenzhilu.tiangan == bazi.yueGan.text)
- if len(dts) > 0:
- if bazi.yueZhi.text == dts[0].dizhi:
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
- if bazi.shiGan.shiShen == "食":
- dts = Shishenzhilu.select().where(Shishenzhilu.tiangan == bazi.shiGan.text)
- if len(dts) > 0:
- if bazi.shiZhi.text == dts[0].dizhi:
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
- def __check_lushen(bazi: BaZi):
- key = "禄神"
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
- dts1 = Tiangan.select().where(Tiangan.name == bazi.nianGan.text)
- if len(dts1) > 0:
- if bazi.nianZhi.text == dts1[0].linguan:
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
- dts2 = Tiangan.select().where(Tiangan.name == bazi.yueGan.text)
- if len(dts2) > 0:
- if bazi.yueZhi.text == dts2[0].linguan:
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
- dts3 = Tiangan.select().where(Tiangan.name == bazi.riGan.text)
- if len(dts3) > 0:
- if bazi.riZhi.text == dts3[0].linguan:
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
- dts4 = Tiangan.select().where(Tiangan.name == bazi.shiGan.text)
- if len(dts4) > 0:
- if bazi.shiZhi.text == dts4[0].linguan:
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
- def __check_kuigang(bazi: BaZi):
- key = "魁罡"
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
- if bazi.nianGan.text == "庚" and bazi.nianZhi.text == "戌":
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
- if bazi.nianGan.text == "庚" and bazi.nianZhi.text == "辰":
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
- if bazi.nianGan.text == "戊" and bazi.nianZhi.text == "戌":
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
- if bazi.nianGan.text == "壬" and bazi.nianZhi.text == "辰":
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
- if bazi.yueGan.text == "庚" and bazi.yueZhi.text == "戌":
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
- if bazi.yueGan.text == "庚" and bazi.yueZhi.text == "辰":
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
- if bazi.yueGan.text == "戊" and bazi.yueZhi.text == "戌":
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
- if bazi.yueGan.text == "壬" and bazi.yueZhi.text == "辰":
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
- if bazi.riGan.text == "庚" and bazi.riZhi.text == "戌":
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
- if bazi.riGan.text == "庚" and bazi.riZhi.text == "辰":
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
- if bazi.riGan.text == "戊" and bazi.riZhi.text == "戌":
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
- if bazi.riGan.text == "壬" and bazi.riZhi.text == "辰":
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
- if bazi.shiGan.text == "庚" and bazi.shiZhi.text == "戌":
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
- if bazi.shiGan.text == "庚" and bazi.shiZhi.text == "辰":
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
- if bazi.shiGan.text == "戊" and bazi.shiZhi.text == "戌":
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
- if bazi.shiGan.text == "壬" and bazi.shiZhi.text == "辰":
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
- def __check_dashe(bazi: BaZi):
- key = "大赦"
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
- dts = Dashe.select().where(Dashe.rigan == bazi.riGan.text)
- if len(dts) > 0:
- if bazi.nianGan.text == dts[0].tiangan and bazi.nianZhi.text == dts[0].dizhi:
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
- if bazi.yueGan.text == dts[0].tiangan and bazi.yueZhi.text == dts[0].dizhi:
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
- if bazi.shiGan.text == dts[0].tiangan and bazi.shiZhi.text == dts[0].dizhi:
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
- def __check_yima(bazi: BaZi):
- key = "驿马"
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
- dts1 = Yima.select().where(Yima.dizhi == bazi.nianZhi.text)
- if len(dts1) > 0:
- if bazi.yueZhi.text == dts1[0].chong:
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
- if bazi.riZhi.text == dts1[0].chong:
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
- if bazi.shiZhi.text == dts1[0].chong:
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
- dts2 = Yima.select().where(Yima.dizhi == bazi.riZhi.text)
- if len(dts2) > 0:
- if bazi.nianZhi.text == dts2[0].chong:
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
- if bazi.yueZhi.text == dts2[0].chong:
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
- if bazi.shiZhi.text == dts2[0].chong:
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
- def __check_jiangxing(bazi: BaZi):
- key = "将星"
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
- ary = ["子", "午", "卯", "酉"]
- if ary.__contains__(bazi.nianZhi.text):
- wz = SiZhuWeiZhi.nianzhu
- dz = SiZhuWeiZhi.nianzhi
- bazi.add_shensha(wz, key, tip, __get_jiangxing_effect(bazi, dz))
- if ary.__contains__(bazi.yueZhi.text):
- wz = SiZhuWeiZhi.yuezhu
- dz = SiZhuWeiZhi.yuezhi
- bazi.add_shensha(wz, key, tip, __get_jiangxing_effect(bazi, dz))
- if ary.__contains__(bazi.riZhi.text):
- wz = SiZhuWeiZhi.rizhu
- dz = SiZhuWeiZhi.rizhi
- bazi.add_shensha(wz, key, tip, __get_jiangxing_effect(bazi, dz))
- if ary.__contains__(bazi.shiZhi.text):
- wz = SiZhuWeiZhi.shizhu
- dz = SiZhuWeiZhi.shizhi
- bazi.add_shensha(wz, key, tip, __get_jiangxing_effect(bazi, dz))
- def __check_yangren(bazi: BaZi):
- key = "羊刃"
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
- if bazi.nianZhi.shiShen == "劫":
- dts = Zhangsheng.select().where(Zhangsheng.tiangan == bazi.riGan.text, Zhangsheng.dizhi == bazi.nianZhi.text)
- if len(dts) > 0:
- if dts[0].zhangsheng == "帝":
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
- if bazi.yueZhi.shiShen == "劫":
- dts = Zhangsheng.select().where(Zhangsheng.tiangan == bazi.riGan.text, Zhangsheng.dizhi == bazi.yueZhi.text)
- if len(dts) > 0:
- if dts[0].zhangsheng == "帝":
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
- if bazi.riZhi.shiShen == "劫":
- dts = Zhangsheng.select().where(Zhangsheng.tiangan == bazi.riGan.text, Zhangsheng.dizhi == bazi.riZhi.text)
- if len(dts) > 0:
- if dts[0].zhangsheng == "帝":
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
- if bazi.shiZhi.shiShen == "劫":
- dts = Zhangsheng.select().where(Zhangsheng.tiangan == bazi.riGan.text, Zhangsheng.dizhi == bazi.shiZhi.text)
- if len(dts) > 0:
- if dts[0].zhangsheng == "帝":
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
- def __check_diwang(bazi: BaZi):
- key = "地网"
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
- if bazi.nianZhi.text == "辰" or bazi.nianZhi.text == "戌":
- if bazi.yueZhi.text == "巳" or bazi.yueZhi.text == "亥":
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
- if bazi.riZhi.text == "巳" or bazi.riZhi.text == "亥":
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
- if bazi.shiZhi.text == "巳" or bazi.shiZhi.text == "亥":
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
- if bazi.riZhi.text == "辰" or bazi.riZhi.text == "戌":
- if bazi.nianZhi.text == "巳" or bazi.nianZhi.text == "亥":
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
- if bazi.yueZhi.text == "巳" or bazi.yueZhi.text == "亥":
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
- if bazi.shiZhi.text == "巳" or bazi.shiZhi.text == "亥":
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
- def __check_huagai(bazi: BaZi):
- key = "华盖"
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
- dt1 = Huagai.select().where(Huagai.nianzhi == bazi.nianZhi.text)
- if len(dt1) > 0:
- if bazi.yueZhi.text == dt1[0].dizhi:
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
- if bazi.riZhi.text == dt1[0].dizhi:
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
- if bazi.shiZhi.text == dt1[0].dizhi:
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
- dt2 = Huagai.select().where(Huagai.rizhi == bazi.riZhi.text)
- if len(dt2) > 0:
- if bazi.nianZhi.text == dt2[0].dizhi:
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
- if bazi.yueZhi.text == dt2[0].dizhi:
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
- if bazi.shiZhi.text == dt2[0].dizhi:
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
- def __check_taohua(bazi: BaZi):
- key = "桃花"
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
- dts1 = Taohua.select().where(Taohua.nianzhi == bazi.nianZhi.text)
- if len(dts1) > 0:
- if bazi.yueZhi.text == dts1[0].dizhi:
- wz = SiZhuWeiZhi.yuezhu
- dz = SiZhuWeiZhi.yuezhi
- zhu = bazi.yueZhi
- gan = bazi.yueGan
- zhuStr = "月柱"
- bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
- if bazi.riZhi.text == dts1[0].dizhi:
- wz = SiZhuWeiZhi.rizhu
- dz = SiZhuWeiZhi.rizhi
- zhu = bazi.riZhi
- gan = bazi.riGan
- zhuStr = "日柱"
- bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
- if bazi.shiZhi.text == dts1[0].dizhi:
- wz = SiZhuWeiZhi.shizhu
- dz = SiZhuWeiZhi.shizhi
- zhu = bazi.shiZhi
- gan = bazi.shiGan
- zhuStr = "时柱"
- bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
- dts2 = Taohua.select().where(Taohua.rizhi == bazi.riZhi.text)
- if len(dts2) > 0:
- if bazi.nianZhi.text == dts2[0].dizhi:
- wz = SiZhuWeiZhi.nianzhu
- dz = SiZhuWeiZhi.nianzhi
- zhu = bazi.nianZhi
- gan = bazi.nianGan
- zhuStr = "年柱"
- bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
- if bazi.yueZhi.text == dts2[0].dizhi:
- wz = SiZhuWeiZhi.yuezhu
- dz = SiZhuWeiZhi.yuezhi
- zhu = bazi.yueZhi
- gan = bazi.yueGan
- zhuStr = "月柱"
- bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
- if bazi.shiZhi.text == dts2[0].dizhi:
- wz = SiZhuWeiZhi.shizhu
- dz = SiZhuWeiZhi.shizhi
- zhu = bazi.shiZhi
- gan = bazi.shiGan
- zhuStr = "时柱"
- bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
- def __get_jiangxing_effect(bazi: BaZi, wz: SiZhuWeiZhi):
- eft = None
- if bazi.hasGaoNeng("子午冲", wz):
- eft = "冲中神为灾(子午冲)"
- elif bazi.hasGaoNeng("卯酉冲", wz):
- eft = "冲中神为灾(卯酉冲)"
- return eft
- def __get_zaisha_effect(bazi: BaZi, wz: SiZhuWeiZhi):
- return __get_jiangxing_effect(bazi, wz)
- def __get_taohua_effect(bazi: BaZi, zhu: SiZhu, gan: SiZhu, wzOfZhu: SiZhuWeiZhi, wzOfZhi: SiZhuWeiZhi, zhuStr: str):
- result = None
- effects = []
- # 落生旺之地(同柱长生1-5位置)
- shengwang = ["生", "沐", "冠", "临", "帝"]
- if zhu.tongzhuZhangSheng in shengwang:
- eft1 = "桃花落生旺之地:男命姿容俊美,好美色;女命风情万种,异性缘佳(" + zhuStr + ")。"
- if not eft1 in effects:
- effects.append(eft1)
- # 见水
- if zhu.wuXing == "水":
- eft2 = "桃花见水:生理欲望强,两性关系混乱(" + zhuStr + ")。"
- if not eft2 in effects:
- effects.append(eft2)
- # 落时支
- if zhu == bazi.shiZhi:
- eft3 = "桃花落门户:墙外桃花,易犯桃花劫(" + zhuStr + ")。"
- if not eft3 in effects:
- effects.append(eft3)
- # 时支且伤官
- if zhu == bazi.shiZhi and zhu.shiShen == "伤":
- eft4 = "时支桃花落伤官:多夫,婚姻不美满(" + zhuStr + ")。"
- if not eft4 in effects:
- effects.append(eft4)
- # 落年月柱
- if zhu == bazi.nianZhi or zhu == bazi.yueZhi:
- eft5 = "内桃花:夫妻恩爱(" + zhuStr + ")。"
- if not eft5 in effects:
- effects.append(eft5)
- # 落日柱
- if zhu == bazi.riZhi:
- eft6 = "日柱桃花:夫妻纠纷多,易吵架(" + zhuStr + ")。"
- if not eft6 in effects:
- effects.append(eft6)
- # 和七杀同柱
- if zhu.shiShen == "杀" or gan.shiShen == "杀":
- eft7 = "和七杀同柱:情人多,欲望强。女命易产生情色交易,男命易得女贵人相助。身弱女命易被迫堕入风尘,男命易因欲望犯罪(" + zhuStr + ")。"
- if not eft7 in effects:
- effects.append(eft7)
- # 和禄神同柱
- if bazi.hasShenSha("禄神", wzOfZhu):
- eft8 = "和禄神同柱:异性缘好(" + zhuStr + ")。"
- if not eft8 in effects:
- effects.append(eft8)
- # 和羊刃同柱
- if bazi.hasShenSha("羊刃", wzOfZhu):
- eft9 = "和羊刃同柱:容易招惹风波(" + zhuStr + ")。"
- if not eft9 in effects:
- effects.append(eft9)
- # 和空亡同柱
- if bazi.hasShenSha("空亡", wzOfZhu):
- eft10 = "和空亡同柱:人缘欠缺,一生多苦情(" + zhuStr + ")。"
- if not eft10 in effects:
- effects.append(eft10)
- # 带刑,这里的zhu实际上传入的是地支
- if bazi.hasGaoNengKey("刑", wzOfZhi):
- eft11 = "桃花带刑:容易婚变(" + zhuStr + ")。"
- if not eft11 in effects:
- effects.append(eft11)
- # 与正印正官同柱
- yinguan = False
- if zhu.shiShen == "印" or gan.shiShen == "印":
- yinguan = True
- elif zhu.shiShen == "官" or gan.shiShen == "官":
- yinguan = True
- if yinguan is True:
- eft12 = "和官印同柱:有自控力,约束性强,不至于滥情(" + zhuStr + ")。"
- if not eft12 in effects:
- effects.append(eft12)
- # 与食神同柱
- if zhu.shiShen == "食" or gan.shiShen == "食":
- eft13 = "和食神同柱:把欲望转化为文学、艺术才华(" + zhuStr + ")。"
- if not eft13 in effects:
- effects.append(eft13)
- # 与伤官同柱
- if zhu.shiShen == "伤" or gan.shiShen == "伤":
- eft14 = "和伤官同柱:欲望强,喜新厌旧,容易自恃才貌,追求时髦,对感情不在乎(" + zhuStr + ")。"
- if not eft14 in effects:
- effects.append(eft14)
- # 与劫财同柱
- if zhu.shiShen == "劫" or gan.shiShen == "劫":
- eft15 = "和劫财同柱:容易横刀夺爱,敢爱敢恨,争风吃醋(" + zhuStr + ")。"
- if not eft15 in effects:
- effects.append(eft15)
- # 与偏印同柱
- if zhu.shiShen == "枭" or gan.shiShen == "枭":
- eft16 = "和偏印同柱:容易生理欲望强,同性相恋(" + zhuStr + ")。"
- if not eft16 in effects:
- effects.append(eft16)
- # 与比肩同柱
- if zhu.shiShen == "比" or gan.shiShen == "比":
- eft17 = "和比肩同柱:容易孤芳自赏,自己喜欢上自己,单身主义(" + zhuStr + ")。"
- if not eft17 in effects:
- effects.append(eft17)
- if len(effects) > 0:
- result = ""
- for s in effects:
- result += s + "\n"
- return result
|