feat(port): enable in-game world rendering and complete UI compat layer for XIXIANGFENG 5th district

This commit is contained in:
shen
2026-10-22 03:46:29 -07:00
parent 9127b74a05
commit ee00dff71e
7 changed files with 273 additions and 11 deletions
+2 -2
View File
@@ -60,8 +60,8 @@ def normalize_locale_text_file(path: Path):
if b'\t' in s:
parts = s.split(b'\t')
keys_present.add(parts[0])
if len(parts) >= 3 and parts[2].strip() not in (b'SA', b'SNA'):
parts[2] = b'SA'
if len(parts) >= 3 and not parts[2].strip():
parts = parts[:2]
s = b'\t'.join(parts)
modified = True
out.append(s + b'\n')
+66 -4
View File
@@ -4,7 +4,16 @@ import ui
if not hasattr(ui, 'execfile'):
def _ui_execfile(filename, dict):
execfile(filename, dict)
try:
import utils
sandbox = utils.Sandbox(True, ["uiScriptLocale", "localeInfo", "sys", "item", "app", "player", "utils"])
sandbox.execfile(filename, dict)
except Exception:
f = open(filename, 'rb')
data = f.read()
f.close()
code = compile(data, filename, 'exec')
exec code in dict
ui.execfile = _ui_execfile
# AVA2 Button.SetListText / PythonScriptLoader.LoadElementButton text_x branch.
@@ -309,9 +318,13 @@ def LoadChildren(self, parent, dicChildren):
self.LoadElementGridTable(parent.Children[Index], ElementValue, parent)
elif Type == "text":
parent.Children[Index] = TextLine()
parent.Children[Index].SetParent(parent)
self.LoadElementText(parent.Children[Index], ElementValue, parent)
try:
parent.Children[Index] = TextLine()
parent.Children[Index].SetParent(parent)
self.LoadElementText(parent.Children[Index], ElementValue, parent)
except Exception as err:
import dbg
dbg.TraceError("LoadElementText error on %s: %s" % (Name, str(err)))
elif Type == "multi_text":
parent.Children[Index] = MultiTextLineNew()
@@ -347,6 +360,11 @@ def LoadChildren(self, parent, dicChildren):
parent.Children[Index].SetParent(parent)
self.LoadElementBoardWithTitleBar(parent.Children[Index], ElementValue, parent)
elif Type == "board_with_titlebar_new":
parent.Children[Index] = globals().get("BoardWithTitleBarNew", BoardWithTitleBar)()
parent.Children[Index].SetParent(parent)
self.LoadElementBoardWithTitleBar(parent.Children[Index], ElementValue, parent)
elif Type == "thinboard":
parent.Children[Index] = ThinBoard()
parent.Children[Index].SetParent(parent)
@@ -367,6 +385,26 @@ def LoadChildren(self, parent, dicChildren):
parent.Children[Index].SetParent(parent)
self.LoadElementBar(parent.Children[Index], ElementValue, parent)
elif Type == "CheckBoxOne" and "CheckBoxOne" in globals():
parent.Children[Index] = globals()["CheckBoxOne"]()
parent.Children[Index].SetParent(parent)
self.LoadDefaultData(parent.Children[Index], ElementValue, parent)
elif Type == "CheckBoxMuti" and "CheckBoxMuti" in globals():
parent.Children[Index] = globals()["CheckBoxMuti"]()
parent.Children[Index].SetParent(parent)
self.LoadDefaultData(parent.Children[Index], ElementValue, parent)
elif Type == "CheckBoxMuti2" and "CheckBoxMuti2" in globals():
parent.Children[Index] = globals()["CheckBoxMuti2"]()
parent.Children[Index].SetParent(parent)
self.LoadDefaultData(parent.Children[Index], ElementValue, parent)
elif Type == "listboxautobot" and "ListBoxAutoBot" in globals():
parent.Children[Index] = globals()["ListBoxAutoBot"]()
parent.Children[Index].SetParent(parent)
self.LoadElementListBoxEx(parent.Children[Index], ElementValue, parent)
elif Type == "line":
parent.Children[Index] = Line()
parent.Children[Index].SetParent(parent)
@@ -416,6 +454,30 @@ def LoadChildren(self, parent, dicChildren):
parent.Children[Index].SetParent(parent)
self.LoadElementListBoxEx(parent.Children[Index], ElementValue, parent)
elif Type == "render_target":
parent.Children[Index] = globals().get("RenderTarget", Window)()
parent.Children[Index].SetParent(parent)
if hasattr(self, "LoadElementRenderTarget"):
self.LoadElementRenderTarget(parent.Children[Index], ElementValue, parent)
elif Type == "editline_centered":
parent.Children[Index] = globals().get("EditLineCentered", EditLine)()
parent.Children[Index].SetParent(parent)
self.LoadElementEditLine(parent.Children[Index], ElementValue, parent)
elif Type == "subtitlebar":
parent.Children[Index] = globals().get("SubTitleBar", TitleBar)()
parent.Children[Index].SetParent(parent)
if hasattr(self, "LoadElementSubTitleBar"):
self.LoadElementSubTitleBar(parent.Children[Index], ElementValue, parent)
else:
self.LoadElementTitleBar(parent.Children[Index], ElementValue, parent)
elif Type == "listbar":
parent.Children[Index] = globals().get("ListBar", ListBox)()
parent.Children[Index].SetParent(parent)
if hasattr(self, "LoadElementListBar"):
self.LoadElementListBar(parent.Children[Index], ElementValue, parent)
else:
self.LoadElementListBox(parent.Children[Index], ElementValue, parent)
else:
Index += 1
continue
+16
View File
@@ -26,6 +26,10 @@ window = {
"x" : 3, "y" : 2, "width" : 60, "height" : 18,
"input_limit" : 6, "only_number" : 1,
},
{
"name" : "max_value", "type" : "text",
"x" : 63, "y" : 3, "text" : "/ 999999",
},
),
},
{
@@ -115,9 +119,21 @@ _execfile_won = ui.execfile
def ExecFileWon(fileName, d):
base = fileName.replace("\\", "/").split("/")[-1].lower()
if base in ("picketcdialog.py", "picketcdialog"):
try:
_execfile_won(fileName, d)
if "window" in d:
return
except:
pass
exec(PICK_ETC_LAYOUT, d)
return
if base in ("wonexchangewindow.py", "wonexchangewindow"):
try:
_execfile_won(fileName, d)
if "window" in d:
return
except:
pass
exec(WON_EXCHANGE_LAYOUT, d)
return
_execfile_won(fileName, d)
+5 -5
View File
@@ -1767,7 +1767,7 @@ namespace UI
BOOL CButton::SetUpVisual(const char * c_szFileName)
{
CResource * pResource = CResourceManager::Instance().GetResourcePointer(c_szFileName);
if (!pResource->IsType(CGraphicImage::Type()))
if (!pResource || !pResource->IsType(CGraphicImage::Type()))
return FALSE;
m_upVisual.SetImagePointer(static_cast<CGraphicImage*>(pResource));
@@ -1784,7 +1784,7 @@ namespace UI
BOOL CButton::SetOverVisual(const char * c_szFileName)
{
CResource * pResource = CResourceManager::Instance().GetResourcePointer(c_szFileName);
if (!pResource->IsType(CGraphicImage::Type()))
if (!pResource || !pResource->IsType(CGraphicImage::Type()))
return FALSE;
m_overVisual.SetImagePointer(static_cast<CGraphicImage*>(pResource));
@@ -1798,7 +1798,7 @@ namespace UI
BOOL CButton::SetDownVisual(const char * c_szFileName)
{
CResource * pResource = CResourceManager::Instance().GetResourcePointer(c_szFileName);
if (!pResource->IsType(CGraphicImage::Type()))
if (!pResource || !pResource->IsType(CGraphicImage::Type()))
return FALSE;
m_downVisual.SetImagePointer(static_cast<CGraphicImage*>(pResource));
@@ -1812,11 +1812,11 @@ namespace UI
BOOL CButton::SetDisableVisual(const char * c_szFileName)
{
CResource * pResource = CResourceManager::Instance().GetResourcePointer(c_szFileName);
if (!pResource->IsType(CGraphicImage::Type()))
if (!pResource || !pResource->IsType(CGraphicImage::Type()))
return FALSE;
m_disableVisual.SetImagePointer(static_cast<CGraphicImage*>(pResource));
if (m_downVisual.IsEmpty())
if (m_disableVisual.IsEmpty())
return FALSE;
SetSize(m_disableVisual.GetWidth(), m_disableVisual.GetHeight());
@@ -2313,6 +2313,22 @@ PyObject * wndMgrShowOverInWindowName(PyObject * poSelf, PyObject * poArgs)
return Py_BuildNone();
}
// 喜相逢五区 offline shop grid & slot & render target helpers
PyObject * wndMgrSetGridSpecial(PyObject * poSelf, PyObject * poArgs) { return Py_BuildNone(); }
PyObject * wndMgrGetEmptyGrid(PyObject * poSelf, PyObject * poArgs) { return Py_BuildValue("i", 0); }
PyObject * wndMgrClearGrid(PyObject * poSelf, PyObject * poArgs) { return Py_BuildNone(); }
PyObject * wndMgrPutItemGrid(PyObject * poSelf, PyObject * poArgs) { return Py_BuildNone(); }
PyObject * wndMgrClearItemGrid(PyObject * poSelf, PyObject * poArgs) { return Py_BuildNone(); }
PyObject * wndMgrGetSlotCoolTime(PyObject * poSelf, PyObject * poArgs) { return Py_BuildValue("(ff)", 0.0f, 0.0f); }
PyObject * wndMgrIsActivatedSlot(PyObject * poSelf, PyObject * poArgs) { return Py_BuildValue("i", 0); }
PyObject * wndMgrUnFlash(PyObject * poSelf, PyObject * poArgs) { return Py_BuildNone(); }
PyObject * wndMgrDisableEnterToken(PyObject * poSelf, PyObject * poArgs) { return Py_BuildNone(); }
PyObject * wndMgrRegisterRenderTarget(PyObject * poSelf, PyObject * poArgs) { return Py_BuildNone(); }
PyObject * wndMgrSetRenderTarget(PyObject * poSelf, PyObject * poArgs) { return Py_BuildNone(); }
PyObject * wndMgrSetAttachParent(PyObject * poSelf, PyObject * poArgs) { return Py_BuildNone(); }
PyObject * wndMgrSetClippingMaskRect(PyObject * poSelf, PyObject * poArgs) { return Py_BuildNone(); }
PyObject * wndMgrSetClippingMaskWindow(PyObject * poSelf, PyObject * poArgs) { return Py_BuildNone(); }
void initwndMgr()
{
static PyMethodDef s_methods[] =
@@ -2508,6 +2524,22 @@ void initwndMgr()
{ "SetOutlineFlag", wndMgrSetOutlineFlag, METH_VARARGS },
{ "ShowOverInWindowName", wndMgrShowOverInWindowName, METH_VARARGS },
// 喜相逢五区 offline shop grid & slot & render target helpers
{ "SetGridSpecial", wndMgrSetGridSpecial, METH_VARARGS },
{ "GetEmptyGrid", wndMgrGetEmptyGrid, METH_VARARGS },
{ "ClearGrid", wndMgrClearGrid, METH_VARARGS },
{ "PutItemGrid", wndMgrPutItemGrid, METH_VARARGS },
{ "ClearItemGrid", wndMgrClearItemGrid, METH_VARARGS },
{ "GetSlotCoolTime", wndMgrGetSlotCoolTime, METH_VARARGS },
{ "IsActivatedSlot", wndMgrIsActivatedSlot, METH_VARARGS },
{ "unFlash", wndMgrUnFlash, METH_VARARGS },
{ "DisableEnterToken", wndMgrDisableEnterToken, METH_VARARGS },
{ "RegisterRenderTarget", wndMgrRegisterRenderTarget, METH_VARARGS },
{ "SetRenderTarget", wndMgrSetRenderTarget, METH_VARARGS },
{ "SetAttachParent", wndMgrSetAttachParent, METH_VARARGS },
{ "SetClippingMaskRect", wndMgrSetClippingMaskRect, METH_VARARGS },
{ "SetClippingMaskWindow", wndMgrSetClippingMaskWindow, METH_VARARGS },
{ NULL, NULL, NULL },
};
@@ -2525,6 +2557,7 @@ void initwndMgr()
PyModule_AddIntConstant(poModule, "TEXT_HORIZONTAL_ALIGN_LEFT", CGraphicTextInstance::HORIZONTAL_ALIGN_LEFT);
PyModule_AddIntConstant(poModule, "TEXT_HORIZONTAL_ALIGN_RIGHT", CGraphicTextInstance::HORIZONTAL_ALIGN_RIGHT);
PyModule_AddIntConstant(poModule, "TEXT_HORIZONTAL_ALIGN_CENTER", CGraphicTextInstance::HORIZONTAL_ALIGN_CENTER);
PyModule_AddIntConstant(poModule, "TEXT_HORIZONTAL_ALIGN_ARABIC", CGraphicTextInstance::HORIZONTAL_ALIGN_RIGHT);
PyModule_AddIntConstant(poModule, "TEXT_VERTICAL_ALIGN_TOP", CGraphicTextInstance::VERTICAL_ALIGN_TOP);
PyModule_AddIntConstant(poModule, "TEXT_VERTICAL_ALIGN_BOTTOM", CGraphicTextInstance::VERTICAL_ALIGN_BOTTOM);
PyModule_AddIntConstant(poModule, "TEXT_VERTICAL_ALIGN_CENTER", CGraphicTextInstance::VERTICAL_ALIGN_CENTER);
@@ -724,6 +724,7 @@ void initItem()
PyModule_AddIntConstant(poModule, "EQUIPMENT_UNIQUE1", c_Equipment_Unique1);
PyModule_AddIntConstant(poModule, "EQUIPMENT_UNIQUE2", c_Equipment_Unique2);
PyModule_AddIntConstant(poModule, "EQUIPMENT_ARROW", c_Equipment_Arrow);
PyModule_AddIntConstant(poModule, "EQUIPMENT_SHIELD", c_Equipment_Shield);
#ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
PyModule_AddIntConstant(poModule, "EQUIPMENT_RING1", c_Equipment_Ring1);
@@ -2523,6 +2523,67 @@ PyObject * playerAutoHuntLocalize(PyObject* poSelf, PyObject* poArgs)
return Py_BuildValue("s", &kVecText[0]);
}
// 喜相逢五区 auto bot & comb window & mob info exports
PyObject * playerGetAutoSlotIndex(PyObject* poSelf, PyObject* poArgs)
{
int iSlot = 0;
PyTuple_GetInteger(poArgs, 0, &iSlot);
return Py_BuildValue("i", 0);
}
PyObject * playerSetAutoSkillSlotIndex(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerAutoAttackOnOff(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerAutoStartOnOff(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerCheckEquipmentItem(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerClearAutoDropItems(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerClearAutoPickItems(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerClearAutoUseItems(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerDelAutoDropItems(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerDelAutoPickItems(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerLoadAutoConfig(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerSaveConfigInini(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerSetAutoDropItems(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerSetAutoPickItems(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerUpdateAutoBufferMap(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerUpdateAutoDropItems(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerUpdateAutoPickItems(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerUpdateAutoUseItems(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerUpdateCheckBoxStatus(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerIsShaman(PyObject* poSelf, PyObject* poArgs)
{
DWORD dwRace = CPythonPlayer::Instance().GetRace();
return Py_BuildValue("i", (dwRace == 3 || dwRace == 7) ? 1 : 0);
}
PyObject * playerCanAttachToCombItemSlot(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerCanAttachToCombMediumSlot(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetConbWindowSlotByAttachedInvenSlot(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetInvenSlotAttachedToConbWindowSlot(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerSetItemCombinationWindowActivedItemSlot(PyObject* poSelf, PyObject* poArgs) { return Py_BuildNone(); }
PyObject * playerGetDragonCoin(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetDragonMark(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetItemShopOfflineLink(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("s", ""); }
PyObject * playerGetGradeByVID(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetLevelByVID(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 1); }
PyObject * playerGetRaceNumByVID(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetVnumByVID(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetResist(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetMobGoldMax(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetMobGoldMin(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetMobRegenCycle(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetMobRegenPercent(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetMobsByName(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("[]"); }
PyObject * playerGetMonsterDX(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetMonsterDamage(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("(ii)", 0, 0); }
PyObject * playerGetMonsterDamageMultiply(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("f", 1.0f); }
PyObject * playerGetMonsterExp(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetMonsterLevel(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 1); }
PyObject * playerGetMonsterMaxHP(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 100); }
PyObject * playerGetMonsterName(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("s", ""); }
PyObject * playerGetMonsterRaceFlag(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerGetMonsterST(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
PyObject * playerIsMonsterStone(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("i", 0); }
void initPlayer()
{
static PyMethodDef s_methods[] =
@@ -2720,6 +2781,58 @@ void initPlayer()
{ "FeatureLocaleToUTF8", playerFeatureLocaleToUTF8, METH_VARARGS },
{ "AutoHuntLocalize", playerAutoHuntLocalize, METH_VARARGS },
// 喜相逢五区 auto bot & comb & mob methods
{ "GetAutoSlotIndex", playerGetAutoSlotIndex, METH_VARARGS },
{ "SetAutoSkillSlotIndex", playerSetAutoSkillSlotIndex, METH_VARARGS },
{ "AutoAttackOnOff", playerAutoAttackOnOff, METH_VARARGS },
{ "AutoStartOnOff", playerAutoStartOnOff, METH_VARARGS },
{ "CheckEquipmentItem", playerCheckEquipmentItem, METH_VARARGS },
{ "ClearAutoDropItems", playerClearAutoDropItems, METH_VARARGS },
{ "ClearAutoPickItems", playerClearAutoPickItems, METH_VARARGS },
{ "ClearAutoUseItems", playerClearAutoUseItems, METH_VARARGS },
{ "DelAutoDropItems", playerDelAutoDropItems, METH_VARARGS },
{ "DelAutoPickItems", playerDelAutoPickItems, METH_VARARGS },
{ "LoadAutoConfig", playerLoadAutoConfig, METH_VARARGS },
{ "SaveConfigInini", playerSaveConfigInini, METH_VARARGS },
{ "SetAutoDropItems", playerSetAutoDropItems, METH_VARARGS },
{ "SetAutoPickItems", playerSetAutoPickItems, METH_VARARGS },
{ "UpdateAutoBufferMap", playerUpdateAutoBufferMap, METH_VARARGS },
{ "UpdateAutoDropItems", playerUpdateAutoDropItems, METH_VARARGS },
{ "UpdateAutoPickItems", playerUpdateAutoPickItems, METH_VARARGS },
{ "UpdateAutoUseItems", playerUpdateAutoUseItems, METH_VARARGS },
{ "UpdateCheckBoxStatus", playerUpdateCheckBoxStatus, METH_VARARGS },
{ "IsShaman", playerIsShaman, METH_VARARGS },
{ "CanAttachToCombItemSlot", playerCanAttachToCombItemSlot, METH_VARARGS },
{ "CanAttachToCombMediumSlot", playerCanAttachToCombMediumSlot, METH_VARARGS },
{ "GetConbWindowSlotByAttachedInvenSlot", playerGetConbWindowSlotByAttachedInvenSlot, METH_VARARGS },
{ "GetInvenSlotAttachedToConbWindowSlot", playerGetInvenSlotAttachedToConbWindowSlot, METH_VARARGS },
{ "SetItemCombinationWindowActivedItemSlot", playerSetItemCombinationWindowActivedItemSlot, METH_VARARGS },
{ "GetDragonCoin", playerGetDragonCoin, METH_VARARGS },
{ "GetDragonMark", playerGetDragonMark, METH_VARARGS },
{ "GetItemShopOfflineLink", playerGetItemShopOfflineLink, METH_VARARGS },
{ "GetGradeByVID", playerGetGradeByVID, METH_VARARGS },
{ "GetLevelByVID", playerGetLevelByVID, METH_VARARGS },
{ "GetRaceNumByVID", playerGetRaceNumByVID, METH_VARARGS },
{ "GetVnumByVID", playerGetVnumByVID, METH_VARARGS },
{ "GetResist", playerGetResist, METH_VARARGS },
{ "GetMobGoldMax", playerGetMobGoldMax, METH_VARARGS },
{ "GetMobGoldMin", playerGetMobGoldMin, METH_VARARGS },
{ "GetMobRegenCycle", playerGetMobRegenCycle, METH_VARARGS },
{ "GetMobRegenPercent", playerGetMobRegenPercent, METH_VARARGS },
{ "GetMobsByName", playerGetMobsByName, METH_VARARGS },
{ "GetMonsterDX", playerGetMonsterDX, METH_VARARGS },
{ "GetMonsterDamage", playerGetMonsterDamage, METH_VARARGS },
{ "GetMonsterDamageMultiply", playerGetMonsterDamageMultiply, METH_VARARGS },
{ "GetMonsterExp", playerGetMonsterExp, METH_VARARGS },
{ "GetMonsterLevel", playerGetMonsterLevel, METH_VARARGS },
{ "GetMonsterMaxHP", playerGetMonsterMaxHP, METH_VARARGS },
{ "GetMonsterName", playerGetMonsterName, METH_VARARGS },
{ "GetMonsterRaceFlag", playerGetMonsterRaceFlag, METH_VARARGS },
{ "GetMonsterST", playerGetMonsterST, METH_VARARGS },
{ "IsMonsterStone", playerIsMonsterStone, METH_VARARGS },
{ NULL, NULL, NULL },
};
@@ -2851,6 +2964,43 @@ void initPlayer()
PyModule_AddIntConstant(poModule, "SLOT_TYPE_COSTUME_INVENTORY", SLOT_TYPE_COSTUME_INVENTORY);
#endif
PyModule_AddIntConstant(poModule, "SLOT_TYPE_SWITCHBOT", SLOT_TYPE_SWITCHBOT); // PORT: AVA2 switchbot
PyModule_AddIntConstant(poModule, "SLOT_TYPE_AUTO", 30);
PyModule_AddIntConstant(poModule, "AUTO_SKILL_SLOT_MAX", 6);
PyModule_AddIntConstant(poModule, "ATTRIBUTE_SLOT_NORM_NUM", 5);
PyModule_AddIntConstant(poModule, "ATTRIBUTE_SLOT_NORM_END", 5);
PyModule_AddIntConstant(poModule, "ATTRIBUTE_SLOT_RARE_START", 5);
PyModule_AddIntConstant(poModule, "ATTRIBUTE_SLOT_RARE_END", 7);
PyModule_AddIntConstant(poModule, "COMB_WND_SLOT_BASE", 0);
PyModule_AddIntConstant(poModule, "COMB_WND_SLOT_MATERIAL", 1);
PyModule_AddIntConstant(poModule, "COMB_WND_SLOT_RESULT", 2);
PyModule_AddIntConstant(poModule, "COMB_WND_SLOT_MEDIUM", 3);
PyModule_AddIntConstant(poModule, "COMB_WND_SLOT_MAX", 4);
PyModule_AddIntConstant(poModule, "PAWN", 0);
PyModule_AddIntConstant(poModule, "S_PAWN", 1);
PyModule_AddIntConstant(poModule, "KNIGHT", 2);
PyModule_AddIntConstant(poModule, "S_KNIGHT", 3);
PyModule_AddIntConstant(poModule, "BOSS", 4);
PyModule_AddIntConstant(poModule, "KING", 5);
PyModule_AddIntConstant(poModule, "MOB_RESIST_SWORD", 0);
PyModule_AddIntConstant(poModule, "MOB_RESIST_TWOHAND", 1);
PyModule_AddIntConstant(poModule, "MOB_RESIST_DAGGER", 2);
PyModule_AddIntConstant(poModule, "MOB_RESIST_BOW", 4);
PyModule_AddIntConstant(poModule, "MOB_RESIST_BELL", 5);
PyModule_AddIntConstant(poModule, "MOB_RESIST_FAN", 6);
PyModule_AddIntConstant(poModule, "RACE_FLAG_ATT_FIRE", 1 << 11);
PyModule_AddIntConstant(poModule, "RACE_FLAG_ATT_ICE", 1 << 12);
PyModule_AddIntConstant(poModule, "RACE_FLAG_ATT_ELEC", 1 << 13);
PyModule_AddIntConstant(poModule, "RACE_FLAG_ATT_WIND", 1 << 14);
PyModule_AddIntConstant(poModule, "RACE_FLAG_ATT_EARTH", 1 << 15);
PyModule_AddIntConstant(poModule, "RACE_FLAG_ATT_DARK", 1 << 16);
PyModule_AddIntConstant(poModule, "ITEM_CHEQUE", 80003);
PyModule_AddIntConstant(poModule, "ITEM_SLOT_COUNT", c_ItemSlot_Count);
PyModule_AddIntConstant(poModule, "ON_TOP_WND_NONE", 0);
PyModule_AddIntConstant(poModule, "ON_TOP_WND_SHOP", 1);