hxp
2024-10-29 328648da94a07437fc46024f3e9b7e48c2e2ae38
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.Couple
#
# @todo:°éÂÂ
# @author hxp
# @date 2021-11-17
# @version 1.0
#
# ÏêϸÃèÊö: °éÂÂ
#
#-------------------------------------------------------------------------------
#"""Version = 2021-11-17 15:00"""
#-------------------------------------------------------------------------------
 
import GameWorld
import PyDataManager
import PlayerLove
import PyGameData
 
import time
 
def __Help(curPlayer):
    GameWorld.DebugAnswer(curPlayer, "---------- %s" % GameWorld.GetCurrentDataTimeStr())
    GameWorld.DebugAnswer(curPlayer, "Çå³ý°éÂÂ: Couple 0")
    GameWorld.DebugAnswer(curPlayer, "ÖØÖÃÆ¸Àñ: Couple 0 1")
    GameWorld.DebugAnswer(curPlayer, "ÉèÖóÉÇ×: Couple 1 °éÂÂID [¿ÉѡƸÀñID]")
    GameWorld.DebugAnswer(curPlayer, "ÉèÇ×ÃܶÈ: Couple 2 Ä¿±êID Ç×ÃܶÈ")
    GameWorld.DebugAnswer(curPlayer, "Ôö¼ÓÃܶÈ: Couple 3 Ä¿±êID Ç×ÃܶÈ")
    GameWorld.DebugAnswer(curPlayer, "Ìí¼ÓϲÑç: Couple 4 Æ¸ÀñID Ñç»á¸öÊý")
    return
 
#Âß¼­ÊµÏÖ
## Ö´ÐÐÂß¼­
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param gmList [cmdIndex gmAccID msg]
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer, gmList):
    
    if not gmList:
        __Help(curPlayer)
        return
    
    playerID = curPlayer.GetPlayerID()
    coupleMgr = PyDataManager.GetDBPyCoupleManager()
    couple = coupleMgr.GetCouple(playerID)
    
    value1 = gmList[0]
    if value1 == 0:
        # Àë»é
        if len(gmList) == 1:
            PlayerLove.__DoMarryBreakLogic(couple, playerID)
            GameWorld.DebugAnswer(curPlayer, "Çå³ý°éÂÂOK!")
            return
        
        value2 = gmList[1]
        # ÖØÖÃÆ¸Àñ
        if value2 == 1:
            if not couple:
                GameWorld.DebugAnswer(curPlayer, "ûÓаéÂÂ!")
                return
            couple.coupleData.BridePriceState = 0
            PlayerLove.Sync_CoupleInfo(curPlayer)
            GameWorld.DebugAnswer(curPlayer, "ÖØÖÃÆ¸ÀñOK!")
            
        return
    
    # ÉèÖóÉÇ×
    elif value1 == 1:
        tagPlayerID = gmList[1] if len(gmList) > 1 else 0
        if not tagPlayerID or tagPlayerID == playerID:
            GameWorld.DebugAnswer(curPlayer, "·Ç·¨°éÂÂÍæ¼ÒID:%s,playerID=%s" % (tagPlayerID, playerID))
            return
        if couple:
            if couple.GetCoupleID(playerID) != tagPlayerID:
                GameWorld.DebugAnswer(curPlayer, "ÒÑÓаéÂÂ! coupleID=%s" % couple.GetCoupleID(playerID))
                return
        tagCouple = coupleMgr.GetCouple(tagPlayerID)
        if tagCouple:
            if tagCouple.GetCoupleID(tagPlayerID) != playerID:
                GameWorld.DebugAnswer(curPlayer, "¶Ô·½ÒÑÓаéÂÂ! tagCoupleID=%s" % tagCouple.GetCoupleID(tagPlayerID))
                return
        
        bridePriceID = gmList[2] if len(gmList) > 2 else 1
        
        reqData = PlayerLove.MarryReq()
        reqData.playerIDA = tagPlayerID
        reqData.playerIDB = playerID
        reqData.bridePriceID = bridePriceID
        reqData.reqTime = int(time.time())
        PyGameData.g_marryReqInfo[tagPlayerID] = reqData
        
        reqPlayer = GameWorld.GetPlayerManager().FindPlayerByID(tagPlayerID)
        isOK = PlayerLove.__DoMarryResponse(curPlayer, playerID, reqPlayer, tagPlayerID, 1)
        GameWorld.DebugAnswer(curPlayer, "ÉèÖð顾%s¡¿ %s" % (tagPlayerID, isOK))
        return
    
    # ÉèÖÃÇ×ÃܶÈ
    elif value1 == 2 and len(gmList) >= 3:
        tagPlayerID = gmList[1]
        setValue = gmList[2]
        if not tagPlayerID or tagPlayerID == playerID:
            GameWorld.DebugAnswer(curPlayer, "Íæ¼ÒID²»ÄÜÉèÖÃÇ×ÃܶÈ:%s,playerID=%s" % (tagPlayerID, playerID))
            return
        intimacys = PyDataManager.GetIntimacyManager().GetIntimacys(playerID)
        updIntimacy = intimacys.SetIntimacy(curPlayer, tagPlayerID, setValue)
        GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÄ¿±ê¡¾%s¡¿Ç×ÃܶÈ: %s" % (tagPlayerID, updIntimacy))
        
    # Ôö¼ÓÇ×ÃܶÈ
    elif value1 == 3 and len(gmList) >= 3:
        tagPlayerID = gmList[1]
        addValue = gmList[2]
        if not tagPlayerID or tagPlayerID == playerID:
            GameWorld.DebugAnswer(curPlayer, "Íæ¼ÒID²»ÄÜÔö¼ÓÇ×ÃܶÈ:%s,playerID=%s" % (tagPlayerID, playerID))
            return
        PyDataManager.GetIntimacyManager().AddIntimacyBoth(playerID, tagPlayerID, addValue)
        intimacys = PyDataManager.GetIntimacyManager().GetIntimacys(playerID)
        if intimacys:
            GameWorld.DebugAnswer(curPlayer, "¸üÐÂÄ¿±ê¡¾%s¡¿Ç×ÃܶÈ: %s" % (tagPlayerID, intimacys.GetTagIntimacy(tagPlayerID)))
 
    # Ôö¼ÓÇ×ÃܶÈ
    elif value1 == 4:
        bridePriceID = gmList[1] if len(gmList) > 1 else 1
        addCount = gmList[2] if len(gmList) > 2 else 1
        addCount = PlayerLove.GMAddCandy(curPlayer, bridePriceID, addCount)
        GameWorld.DebugAnswer(curPlayer, "Ìí¼ÓϲÑçÊý:%s" % addCount)
    else:
        __Help(curPlayer)
        return
    
    return