#include "classes.h" // 00722a80 ItemConfig_Item::ItemConfig_Item() { ItemConfig_Item *tail; this->type = 0; this->id = 0; (this->name)._buf[0] = '\0'; (this->name)._buf[1] = '\0'; (this->name)._buf[2] = '\0'; (this->name)._buf[3] = '\0'; (this->name)._size = 0; (this->name)._capacity = 0xf; (this->desc)._buf[0] = '\0'; (this->desc)._buf[1] = '\0'; (this->desc)._buf[2] = '\0'; (this->desc)._buf[3] = '\0'; (this->desc)._size = 0; (this->desc)._capacity = 0xf; (this->gfxFilename)._buf[0] = '\0'; (this->gfxFilename)._buf[1] = '\0'; (this->gfxFilename)._buf[2] = '\0'; (this->gfxFilename)._buf[3] = '\0'; (this->gfxFilename)._size = 0; (this->gfxFilename)._capacity = 0xf; this->achievementId = 0; this->cacheFlags = 0; this->addMaxhearts = 0; this->addHearts = 0; this->addSoulHearts = 0; this->addBlackHearts = 0; this->addBombs = 0; this->addKeys = 0; this->addCoins = 0; this->maxCharges = 0; this->maxCooldown = 0; this->devilprice = 1; this->shopPrice = 0xf; (this->costume).id = 0; (this->costume).anm2Path._buf[0] = '\0'; (this->costume).anm2Path._buf[1] = '\0'; (this->costume).anm2Path._buf[2] = '\0'; (this->costume).anm2Path._buf[3] = '\0'; (this->costume).anm2Path._size = 0; (this->costume).anm2Path._capacity = 0xf; (this->costume).priority = 0; (this->costume).hasOverlay = 0; (this->costume).isFlying = 0; (this->costume).hasSkinAlt = 0; (this->costume).skinColor = -1; *GHIDRA_CAST(&(this->costume).overwriteColor) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&((this->costume))) + 0x2a))) = 0; this->chargeType = 0; this->special = 0; this->passiveCache = 0; this->addCostumeOnPickup = 1; this->hidden = 0; this->persistentEffect = 0; this->clearEffectsOnRemove = 1; *GHIDRA_CAST(&this->tags) = 0; *GHIDRA_CAST((GHIDRA_INT(&this->tags) + 4)) = 0; this->quality = 0; this->craftingQuality = 0; this->_initCharge = -1; this[1].type = 0; this[1].id = 0; this[1].name._buf[0] = '\0'; this[1].name._buf[1] = '\0'; this[1].name._buf[2] = '\0'; this[1].name._buf[3] = '\0'; tail = this + 1; (tail->name)._buf[4] = '\0'; (tail->name)._buf[5] = '\0'; (tail->name)._buf[6] = '\0'; (tail->name)._buf[7] = '\0'; tail = this + 1; (tail->name)._buf[8] = -1; (tail->name)._buf[9] = -1; (tail->name)._buf[10] = -1; (tail->name)._buf[0xb] = -1; tail = this + 1; (tail->name)._buf[0xc] = '\0'; (tail->name)._buf[0xd] = '\0'; (tail->name)._buf[0xe] = '\0'; (tail->name)._buf[0xf] = '\0'; return this; } // 00722c10 ItemConfig_Item::~ItemConfig_Item() { void *ownedCostume; ownedCostume = (void *)this[1].type; if (ownedCostume != (void *)0x0) { (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(ownedCostume) + 0x174)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(ownedCostume) + 0x15c)))))->msvc::string::_Tidy_deallocate(); operator_delete(ownedCostume,0x198); this[1].type = 0; } FUN_00731160(); (GHIDRA_CAST(((this->costume).anm2Path._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST(((this->gfxFilename)._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST(((this->desc)._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST(((this->name)._buf)))->msvc::string::_Tidy_deallocate(); return; } // 0072ff10 std_string * ItemConfig_Item::GetLocalizedName(std_string *outName, int language) { std_string *text; std_string *textEnd; int resolvedLanguage; char *ch; StringTable *stringTable; if ((this->name)._size == 0) { outName->_buf[0] = '\0'; outName->_buf[1] = '\0'; outName->_buf[2] = '\0'; outName->_buf[3] = '\0'; outName->_size = 0; outName->_capacity = 0xf; outName->_buf[0] = '\0'; outName->_size = 0; outName->_buf[0] = '\0'; return outName; } resolvedLanguage = language; if (language == 0x14) { resolvedLanguage = *GHIDRA_CAST(&g_manager->_stringTable); } text = &this->name; if (0xf < (this->name)._capacity) { text = *GHIDRA_CAST(text->_buf); } stringTable = &g_manager->_stringTable; if (text->_buf[0] == '#') { language = language & 0xffffff; StringTable::get_string (stringTable,GHIDRA_CAST("Items"),resolvedLanguage,GHIDRA_CAST((text->_buf + 1)), GHIDRA_CAST((GHIDRA_INT(&language) + 3))); if ((*GHIDRA_CAST((GHIDRA_CAST(&(language)) + 0x3))) == '\0') { language = language & 0xffffff; text = (std_string *) StringTable::get_string (stringTable,GHIDRA_CAST("Items"),resolvedLanguage,GHIDRA_CAST((text->_buf + 1)), GHIDRA_CAST((GHIDRA_INT(&language) + 3))); } } outName->_buf[0] = '\0'; outName->_buf[1] = '\0'; outName->_buf[2] = '\0'; outName->_buf[3] = '\0'; outName->_size = 0; outName->_capacity = 0xf; outName->_buf[0] = '\0'; textEnd = text; do { ch = textEnd->_buf; textEnd = GHIDRA_CAST((textEnd->_buf + 1)); } while (*ch != '\0'); (GHIDRA_CAST((outName->_buf)))->msvc::string::assign(GHIDRA_CAST(text),GHIDRA_INT(textEnd) - GHIDRA_INT((text->_buf + 1))); return outName; } // 007307b0 uint8_t ItemConfig_Item::is_mom_item() { int iVar1; iVar1 = this->type; if (((iVar1 != 1) && (iVar1 != 3)) && (iVar1 != 4)) { switchD_007307de_caseD_20: return 0; } iVar1 = this->id; if (iVar1 < 0x164) { if (iVar1 != 0x163) { switch(iVar1) { case 0x1d: case 0x1e: case 0x1f: case 0x37: case 0x6e: case 0x72: case 199: case 200: case 0xd9: case 0xe4: break; default: goto switchD_007307de_caseD_20; } } } else if ((iVar1 != 0x1fc) && (iVar1 != 0x2dc)) { return 0; } return 1; }