Teleportationstrank: yellow potions open the portal window

- Every yellow potion (potion kind 5, all stages) is a Teleportationstrank:
  drinking it posts the teleporter's event to the busy dialog with the
  hero's known portals; the potion is used up only when the hero teleports
  from that window (closing it keeps the potion)
- Names replaced in every game text (ReplaceInTexts), so item names and the
  bottom bar's quick-select tooltip read Teleportationstrank; GameText reads
  the game's own text
- HeroIndex / HeroInventory moved to skillslots for shared use
- docs/teleport-potion.md; walking animation after loading noted in todo

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-17 04:04:21 +02:00
1 parent 6ca96d54b4
commit 46a08e97e9
13 files changed
+368 -22

No files matched your search

+10
View File
@@ -14,6 +14,7 @@ constexpr uint32_t kObjectUsedUp = 0x8000000; // kObjectFlags: set by cPotion3D
// The item type table at *0xaa9564 (ecx of ItemPotionKind).
constexpr uint32_t kItemTypeTable = 0x00aa9564;
constexpr uint32_t kItemTypeCount = 0x7e60; // types 1..0x7e5f (bounds check in 0x428700)
// ItemPotionKind (0x43f630): the potion kind (1..5, the bottom bar's potion
// slots; 1 = healing) of item type `type`, 0 if it is no potion.
@@ -46,6 +47,15 @@ inline bool ItemIsConsumable(uint32_t type) {
return reinterpret_cast<bool(__stdcall*)(uint32_t)>(0x0043f5f0)(type);
}
// 0x428700 (thiscall on the type table, (type), ret 4): the text id of the
// item type's name (entry +0x20), which cItemBase::GetName (0x44a420) shows
// unless the object has its own (+0x3c).
inline uint32_t ItemNameText(uint32_t type) {
using Fn = uint32_t(__fastcall*)(void* table, void* edx, uint32_t type);
void* table = *reinterpret_cast<void**>(kItemTypeTable);
return table ? reinterpret_cast<Fn>(0x00428700)(table, nullptr, type) : 0;
}
inline uint32_t ItemType(const void* item) {
return *reinterpret_cast<const uint32_t*>(static_cast<const uint8_t*>(item) + kItemType);
}