feat: pass37 - CPythonItem singleton, battle status math, and regen safe range parity
This commit is contained in:
+29
-1
@@ -833,4 +833,32 @@ Validation: macOS build and Android arm64 libmain.so pass. Five targeted CTests
|
||||
- CTest suite: **41/41 tests passed (100%)**.
|
||||
- Android arm64 `libmain.so` and macOS arm64 `ava2_client` build cleanly.
|
||||
|
||||
|
||||
## 2026-10-08 pass37 — CPythonItem ground item manager, weapon battle status math, arrow validation, and regen safe range parity
|
||||
- **CPythonItem Singleton (`src/python_item.h`)**:
|
||||
- Implemented `CPythonItem` singleton matching upstream `UserInterface/PythonItem.h` with `TGroundItemInstance` tracking (vnum, coordinates, count, 8 sockets, 15 attributes, 7 glove attributes).
|
||||
- Templated `CreateItem(..., const TSocket* alSockets = nullptr, ...)` to support both `int32_t` and `long` socket arrays seamlessly across 32-bit and 64-bit architectures.
|
||||
- Added `DeleteAllItems()`, `DeleteItem(vid)`, `GetGroundItemPosition(vid, &x, &y, &z)`, `GetCloseItemVector(name, actorPos, &vector)`, and distance checking (`GetDistance`).
|
||||
- **PythonNetworkStream Ground Item & Main Actor Race Integration (`src/eter_net/PythonNetworkStream.cpp`)**:
|
||||
- Connected `RecvItemGroundAddPacket` to instantiate items in `CPythonItem::Instance().CreateItem(...)` with wire sockets, attributes, and count.
|
||||
- Linked `SetPlayerRace(m_wMainActorRace)` into `MainCharacterLoaded` on character spawn.
|
||||
- **Weapon Power & Battle Status Math Parity (`src/python_gameplay_modules.h`, `.cpp`)**:
|
||||
- Implemented exact formula parity for `GetPlayerRaceStat(job, point)`: Warrior (STR, DEX), Assassin (DEX, STR), Sura (STR, DEX), Shaman (INT, DEX), and Wolfman (STR, DEX).
|
||||
- Implemented `GetHitRate(dx, str)` and `GetEvadeRate(dex, con)` matching `CInstanceBase::GetHitRate` and `GetEvadeRate`.
|
||||
- Implemented `UpdateBattleStatus()` recalculating `POINT_HIT_RATE`, `POINT_EVADE_RATE`, `POINT_MIN_WEP`, `POINT_MAX_WEP`, `POINT_MIN_MAGIC_WEP`, `POINT_MAX_MAGIC_WEP`, `POINT_MIN_ATK`, and `POINT_MAX_ATK`.
|
||||
- Implemented `UpdateEquippedWeaponPower()` taking into account weapon slot (184), sash absorption slot (202), and rarity socket bonuses.
|
||||
- Corrected `SetPlayerItemData` to trigger `UpdateEquippedWeaponPower()` upon modifying slots 184 or 202.
|
||||
- Preserved raw status point setters (`SetPlayerStatusPoint` and `player_SetStatus`) without overwriting test mocks.
|
||||
- **Arrow & Ammo Verification (`src/python_gameplay_modules.h`, `.cpp`)**:
|
||||
- Implemented `HasEnoughArrow()` checking slot 189 (`c_Equipment_Arrow`) for arrows or quivers, firing `"OnCannotShotError"` when unequipped or depleted.
|
||||
- **Regen & Safe Range Mechanics (`src/python_gameplay_modules.h`, `.cpp`, `NetworkActorManager.h`)**:
|
||||
- Added `GetMobWithVnum(mobVnum, out)` in `NetworkActorManager` matching `CPythonCharacterManager::GetMobWithVnum`.
|
||||
- Implemented `LoadNewRegen()` parsing `locale/newregen.txt` tab-delimited records filtered by current map name under `ENABLE_ULTIMATE_REGEN`.
|
||||
- Implemented `CheckBossSafeRange()` with `DISTANCE_APPROX_SERVER` approximation and actor distance checks.
|
||||
- **Item Classification Feature Flag Alignment (`src/python_gameplay_modules.cpp`)**:
|
||||
- Aligned `item_Classify` switch with upstream `Locale_inc.h` where `ENABLE_SOULBIND_SYSTEM` and `ELEMENT_SPELL_WORLDARD` are commented out, properly falling back to `"USE_UNKNOWN_TYPE"`.
|
||||
- **Results**:
|
||||
- Checked packet constants: **395/395 (100%)**, 0 mismatches, 0 unmatched.
|
||||
- `python3 tools/audit_windows_parity.py`: **0 placeholder bindings**.
|
||||
- `python3 tools/audit_ava2_python_interfaces.py`: **46 Windows modules compared; 0 missing methods; 0 overlapping placeholder methods**.
|
||||
- CTest suite: **41/41 tests passed (100%)**.
|
||||
- Android arm64 `libmain.so` and macOS arm64 `ava2_client` build cleanly.
|
||||
|
||||
Reference in New Issue
Block a user