feat: add POINT_GEM (248) player binding and initialization fix (Stage 6)

- Add POINT_GEM = 248 point type constant in Packet.h
- Add player.GetGem() and export POINT_GEM/GEM constants in PythonPlayerModule
- Fix CPythonPlayer constructor to explicitly call Clear() ensuring clean initial player status
- Add test assertions for player.GetGem() and player.POINT_GEM in port_python_ui_modules_test
This commit is contained in:
shen
2026-10-20 04:53:37 -07:00
parent 18d9c89af8
commit dd71ee5b61
4 changed files with 15 additions and 0 deletions
@@ -605,6 +605,11 @@ PyObject * playerGetStatus(PyObject* poSelf, PyObject* poArgs)
return Py_BuildValue("i", iValue);
}
PyObject * playerGetGem(PyObject* poSelf, PyObject* poArgs)
{
return Py_BuildValue("i", CPythonPlayer::Instance().GetStatus(POINT_GEM));
}
PyObject * playerSetStatus(PyObject* poSelf, PyObject* poArgs)
{
int iType;
@@ -2438,6 +2443,7 @@ void initPlayer()
{ "AffectIndexToSkillIndex", playerAffectIndexToSkillIndex, METH_VARARGS },
{ "GetEXP", playerGetEXP, METH_VARARGS },
{ "GetStatus", playerGetStatus, METH_VARARGS },
{ "GetGem", playerGetGem, METH_VARARGS },
{ "SetStatus", playerSetStatus, METH_VARARGS },
{ "GetElk", playerGetElk, METH_VARARGS },
{ "GetMoney", playerGetElk, METH_VARARGS },
@@ -2547,6 +2553,8 @@ void initPlayer()
PyModule_AddIntConstant(poModule, "STAMINA", POINT_STAMINA);
PyModule_AddIntConstant(poModule, "MAX_STAMINA", POINT_MAX_STAMINA);
PyModule_AddIntConstant(poModule, "ELK", POINT_GOLD);
PyModule_AddIntConstant(poModule, "POINT_GEM", POINT_GEM);
PyModule_AddIntConstant(poModule, "GEM", POINT_GEM);
PyModule_AddIntConstant(poModule, "ST", POINT_ST);
PyModule_AddIntConstant(poModule, "HT", POINT_HT);
PyModule_AddIntConstant(poModule, "DX", POINT_DX);