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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.GatherSoul
#
# @todo:ÉèÖþۻêÐÂ
# @author hxp
# @date 2024-07-12
# @version 1.0
#
# ÏêϸÃèÊö: ÉèÖþۻêÐÂ
#
#-------------------------------------------------------------------------------
#"""Version = 2024-07-12 16:30"""
#-------------------------------------------------------------------------------
 
import GameWorld
import ChConfig
import IpyGameDataPY
import PlayerGatherTheSoul
import PlayerControl
 
#---------------------------------------------------------------------
#Âß¼­ÊµÏÖ
## GMÃüÁîÖ´ÐÐÈë¿Ú
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param paramList ²ÎÊýÁбí [index,1True]
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer, paramList):
    if not paramList:
        GameWorld.DebugAnswer(curPlayer, "ÖØÖÃËùÓоۻê: GahterSoul 0")
        GameWorld.DebugAnswer(curPlayer, "ÉèÖþۻêµÈ¼¶: GahterSoul ¾Û»êID µÈ¼¶")
        return
    
    value1 = paramList[0]
    if value1 == 0:
        # Ð¶ÏÂËùÓÐÏâǶ
        for holeNum in range(1, 1 + IpyGameDataPY.GetFuncCfg("GatherTheSoulHole", 1)):
            soulID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GatherTheSoulHoleID % holeNum)
            if soulID:
                PlayerGatherTheSoul.OnGatherTheSoulTakeoff(curPlayer, soulID)
                
        # ÖØÖÃËùÓеȼ¶
        resetSoulIDList = []
        ipyDataMgr = IpyGameDataPY.IPY_Data()
        for index in range(ipyDataMgr.GetGatherTheSoulCount()):
            ipyData = ipyDataMgr.GetGatherTheSoulByIndex(index)
            soulID = ipyData.GetSoulID()
            if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GatherTheSoulLV % soulID):
                resetSoulIDList.append(soulID)
                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GatherTheSoulLV % soulID, 0)
                
        PlayerGatherTheSoul.Sync_SoulInfo(curPlayer, resetSoulIDList)
        PlayerGatherTheSoul.RefreshGatherTheSoulAttr(curPlayer, True)
        
    else:
        soulID = value1
        soulLV = paramList[1] if len(paramList) > 1 else 1
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GatherTheSoulLV % soulID, soulLV)
        PlayerGatherTheSoul.Sync_SoulInfo(curPlayer, [soulID])
        PlayerGatherTheSoul.RefreshGatherTheSoulAttr(curPlayer, True)
    return