comparison Player.cpp @ 469:0dbf780e247f

CompareVariable part 1
author Ritor1
date Mon, 25 Feb 2013 17:27:27 +0600
parents 17c90e543e28
children d4ea2d382004 81410c3feebc
comparison
equal deleted inserted replaced
468:8822405efad2 469:0dbf780e247f
7699 } 7699 }
7700 7700
7701 7701
7702 7702
7703 //----- (00449BB4) -------------------------------------------------------- 7703 //----- (00449BB4) --------------------------------------------------------
7704 char Player::CompareVariable(enum VariableType var, signed int a1) 7704 char Player::CompareVariable(enum VariableType VarNum, signed int pValue)
7705 { 7705 {
7706 Player *v3; // esi@1 7706 Player *v3; // esi@1
7707 signed int v4; // edi@1 7707 signed int v4; // edi@1
7708 unsigned int v5; // eax@8 7708 unsigned int v5; // eax@8
7709 int v6; // eax@9 7709 int v6; // eax@9
7729 ITEM_EQUIP_TYPE v26; // ebx@155 7729 ITEM_EQUIP_TYPE v26; // ebx@155
7730 char *v27; // edi@155 7730 char *v27; // edi@155
7731 int v28; // ebx@161 7731 int v28; // ebx@161
7732 int v29; // eax@161 7732 int v29; // eax@161
7733 7733
7734 v6 = 0;
7734 v3 = this; 7735 v3 = this;
7735 v4 = -1; 7736 v4 = -1;
7736 if ( var > VAR_AutoNotes ) 7737 if ( VarNum > VAR_AutoNotes )
7737 { 7738 {
7738 switch ( var ) 7739 switch ( VarNum )
7739 { 7740 {
7740 case VAR_Invisible: 7741 case VAR_Invisible:
7741 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0 7742 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0
7742 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime) > 0) ) 7743 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime) > 0) )
7743 goto _return_true; 7744 return true;
7744 goto _cmp_against_arg; 7745 return v4 >= pValue;
7745 case VAR_NumDeaths: 7746 case VAR_NumDeaths:
7746 v4 = pParty->uNumDeaths; 7747 v4 = pParty->uNumDeaths;
7747 goto _cmp_against_arg; 7748 return v4 >= pValue;
7748 case VAR_NumBounties: 7749 case VAR_NumBounties:
7749 v4 = pParty->uNumBountiesCollected; 7750 v4 = pParty->uNumBountiesCollected;
7750 goto _cmp_against_arg; 7751 return v4 >= pValue;
7751 case VAR_PrisonTerms: 7752 case VAR_PrisonTerms:
7752 v4 = pParty->uNumPrisonTerms; 7753 v4 = pParty->uNumPrisonTerms;
7753 goto _cmp_against_arg; 7754 return v4 >= pValue;
7754 case VAR_ArenaWinsPage: 7755 case VAR_ArenaWinsPage:
7755 v4 = (unsigned __int8)pParty->uNumArenaPageWins; 7756 v4 = (unsigned __int8)pParty->uNumArenaPageWins;
7756 goto _cmp_against_arg; 7757 return v4 >= pValue;
7757 case VAR_ArenaWinsSquire: 7758 case VAR_ArenaWinsSquire:
7758 v4 = (unsigned __int8)pParty->uNumArenaSquireWins; 7759 v4 = (unsigned __int8)pParty->uNumArenaSquireWins;
7759 goto _cmp_against_arg; 7760 return v4 >= pValue;
7760 case VAR_ArenaWinsKnight: 7761 case VAR_ArenaWinsKnight:
7761 v4 = (unsigned __int8)pParty->uNumArenaKnightWins; 7762 v4 = (unsigned __int8)pParty->uNumArenaKnightWins;
7762 goto _cmp_against_arg; 7763 return v4 >= pValue;
7763 case VAR_ArenaWinsLord: 7764 case VAR_ArenaWinsLord:
7764 v4 = (unsigned __int8)pParty->uNumArenaLordWins; 7765 v4 = (unsigned __int8)pParty->uNumArenaLordWins;
7765 goto _cmp_against_arg; 7766 return v4 >= pValue;
7766 case VAR_ReputationInCurrentLocation: 7767 case VAR_ReputationInCurrentLocation:
7767 v19 = &pOutdoor->ddm; 7768 v19 = &pOutdoor->ddm;
7768 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) 7769 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
7769 v19 = &pIndoor->dlv; 7770 v19 = &pIndoor->dlv;
7770 v20 = v19->uReputation >= a1; 7771 v6 = v19->uReputation >= pValue;
7771 goto _return; 7772 return v6;
7772 case VAR_History_28|VAR_Sex: 7773 case VAR_History_28|VAR_Sex:
7773 v21 = &pOutdoor->ddm; 7774 v21 = &pOutdoor->ddm;
7774 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) 7775 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
7775 v21 = &pIndoor->dlv; 7776 v21 = &pIndoor->dlv;
7776 v20 = v21->field_C_alert == a1; 7777 v6 = v21->field_C_alert == pValue;
7777 _return:
7778 LOBYTE(v6) = v20;
7779 return v6; 7778 return v6;
7780 case VAR_MonthEquals2|VAR_Sex: 7779 case VAR_MonthEquals2|VAR_Sex:
7781 case VAR_MonthEquals2|VAR_Class: 7780 case VAR_MonthEquals2|VAR_Class:
7782 case VAR_Counter1: 7781 case VAR_Counter1:
7783 case VAR_Counter2: 7782 case VAR_Counter2:
7785 case VAR_Counter4: 7784 case VAR_Counter4:
7786 case VAR_Counter5: 7785 case VAR_Counter5:
7787 case VAR_Counter6: 7786 case VAR_Counter6:
7788 case VAR_Counter7: 7787 case VAR_Counter7:
7789 case VAR_Counter8: 7788 case VAR_Counter8:
7790 v22 = *(int *)&stru_AA1058[3].pSounds[8 * var + 44304]; 7789 v22 = *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44304];
7791 if ( v22 | *(int *)&stru_AA1058[3].pSounds[8 * var + 44300] 7790 if ( v22 | *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44300]
7792 && (signed __int64)(__PAIR__(v22, *(int *)&stru_AA1058[3].pSounds[8 * var + 44300]) 7791 && (signed __int64)(__PAIR__(v22, *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44300])
7793 + (signed __int64)((double)(460800 * a1) * 0.033333335)) <= (signed __int64)pParty->uTimePlayed ) 7792 + (signed __int64)((double)(460800 * pValue) * 0.033333335)) <= (signed __int64)pParty->uTimePlayed )
7794 goto _return_true; 7793 return true;
7795 goto _return_false; 7794 return false;
7796 case VAR_NumSkillPoints: 7795 case VAR_NumSkillPoints:
7797 v4 = this->uSkillPoints; 7796 v4 = this->uSkillPoints;
7798 goto _cmp_against_arg; 7797 return v4 >= pValue;
7799 case VAR_CircusPrises: 7798 case VAR_CircusPrises:
7800 v4 = 0; 7799 v4 = 0;
7801 v23 = pParty->pPlayers;//[0].pInventoryItems; 7800 v23 = pParty->pPlayers;//[0].pInventoryItems;
7802 do 7801 do
7803 { 7802 {
7804 v24 = v23->pInventoryItems; 7803 v24 = v23->pInventoryItems;
7805 v25 = 138; 7804 v25 = 138;
7806 do 7805 do
7807 { 7806 {
7808 switch ( v24->uItemID ) 7807 switch ( v24->uItemID )
7809 { 7808 {
7822 } 7821 }
7823 while ( v25 ); 7822 while ( v25 );
7824 ++v23; 7823 ++v23;
7825 } 7824 }
7826 while ( v23 <= &pParty->pPlayers[3] ); 7825 while ( v23 <= &pParty->pPlayers[3] );
7827 goto _cmp_against_arg; 7826 return v4 >= pValue;
7828 case VAR_MonthEquals2: 7827 case VAR_MonthEquals2:
7829 v17 = pParty->uCurrentMonth == a1; 7828 v6 = pParty->uCurrentMonth == pValue;
7830 goto _return2; 7829 return v6;
7831 case VAR_IsFlying: 7830 case VAR_IsFlying:
7832 if ( pParty->bFlying 7831 if ( pParty->bFlying
7833 && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0 7832 && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0
7834 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime) > 0) ) 7833 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime) > 0) )
7835 goto _return_true; 7834 return true;
7836 goto _return_false; 7835 return false;
7837 case VAR_HiredNPCHasSpeciality: 7836 case VAR_HiredNPCHasSpeciality:
7838 LOBYTE(v6) = CheckHiredNPCSpeciality(a1); 7837 LOBYTE(v6) = CheckHiredNPCSpeciality(pValue);
7839 return v6; 7838 return v6;
7840 case VAR_NPCs2: 7839 case VAR_NPCs2:
7841 return pNPCStats->pNewNPCData[a1].Hired(); 7840 return pNPCStats->pNewNPCData[pValue].Hired();
7842 case VAR_MonthEquals|VAR_CurrentSP: 7841 case VAR_MonthEquals|VAR_CurrentSP:
7843 v13 = 0x80u >> ((signed __int16)a1 - 1) % 8; 7842 v13 = 0x80u >> ((signed __int16)a1 - 1) % 8;
7844 v14 = this->field_1A50[((signed __int16)a1 - 1) >> 3]; 7843 v14 = this->field_1A50[((signed __int16)a1 - 1) >> 3];
7845 goto LABEL_108; 7844 if ( !((unsigned __int8)v13 & v14) )
7845 return v4 >= pValue;
7846 v4 = pValue;
7847 return v4 >= pValue;
7846 case VAR_ItemEquipped: 7848 case VAR_ItemEquipped:
7847 v26 = (ITEM_EQUIP_TYPE)0; 7849 v26 = (ITEM_EQUIP_TYPE)0;
7848 v27 = (char *)&this->pEquipment; 7850 v27 = (char *)&this->pEquipment;
7849 break; 7851 break;
7850 case VAR_GoldInBank: 7852 case VAR_GoldInBank:
7851 v4 = pParty->uNumGoldInBank; 7853 v4 = pParty->uNumGoldInBank;
7852 goto _cmp_against_arg; 7854 return v4 >= pValue;
7853 case VAR_ThieverySkill|0x80: 7855 case VAR_ThieverySkill|0x80:
7854 v28 = GetActualMight(); 7856 v28 = GetActualMight();
7855 v29 = v3->GetBaseStrength(); 7857 v29 = v3->GetBaseStrength();
7856 goto LABEL_168; 7858 goto LABEL_168;
7857 case VAR_DisarmTrapSkill|0x80: 7859 case VAR_DisarmTrapSkill|0x80:
7880 LABEL_168: 7882 LABEL_168:
7881 v10 = __OFSUB__(v28, v29); 7883 v10 = __OFSUB__(v28, v29);
7882 v9 = v28 - v29 < 0; 7884 v9 = v28 - v29 < 0;
7883 LABEL_169: 7885 LABEL_169:
7884 if ( v9 ^ v10 ) 7886 if ( v9 ^ v10 )
7885 goto _cmp_against_arg; 7887 return v4 >= pValue;
7886 goto _return_true; 7888 return true;
7887 default: 7889 default:
7888 goto _cmp_against_arg; 7890 return v4 >= pValue;
7889 } 7891 }
7890 while ( !v3->HasItemEquipped(v26) 7892 while ( !v3->HasItemEquipped(v26)
7891 || *(int *)&v3->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v27 + 5] != a1 ) 7893 || *(int *)&v3->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v27 + 5] != pValue )
7892 { 7894 {
7893 v26 = (ITEM_EQUIP_TYPE)((int)v26 + 1); 7895 v26 = (ITEM_EQUIP_TYPE)((int)v26 + 1);
7894 v27 += 4; 7896 v27 += 4;
7895 if ( (signed int)v26 >= 16 ) 7897 if ( (signed int)v26 >= 16 )
7896 { 7898 return false;
7897 _return_false: 7899 }
7898 LOBYTE(v6) = 0; 7900 return true;
7899 return v6; 7901 }
7900 } 7902 if ( VarNum == VAR_AutoNotes )
7901 }
7902 goto _return_true;
7903 }
7904 if ( var == VAR_AutoNotes )
7905 { 7903 {
7906 v13 = 0x80u >> ((signed __int16)(a1 - 1) - 1) % 8; 7904 v13 = 0x80u >> ((signed __int16)(a1 - 1) - 1) % 8;
7907 v14 = pParty->_autonote_bits[((signed __int16)(a1 - 1) - 1) >> 3]; 7905 v14 = pParty->_autonote_bits[((signed __int16)(a1 - 1) - 1) >> 3];
7908 LABEL_108:
7909 if ( !((unsigned __int8)v13 & v14) ) 7906 if ( !((unsigned __int8)v13 & v14) )
7910 goto _cmp_against_arg; 7907 return v4 >= pValue;
7911 goto LABEL_109; 7908 v4 = pValue;
7912 } 7909 return v4 >= pValue;
7913 if ( var <= VAR_BaseLuck ) 7910 }
7914 { 7911 if ( VarNum <= VAR_BaseLuck )
7915 if ( var != VAR_BaseLuck ) 7912 {
7916 { 7913 if ( VarNum != VAR_BaseLuck )
7917 switch ( var ) 7914 {
7915 switch ( VarNum )
7918 { 7916 {
7919 case VAR_Hour: 7917 case VAR_Hour:
7920 if ( (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60 % 24 == a1 ) 7918 if ( (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60 % 24 == pValue )
7921 goto _return_true; 7919 return true;
7922 goto _return_false; 7920 return false;
7923 case VAR_DayOfYear: 7921 case VAR_DayOfYear:
7924 v5 = (unsigned int)((signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60) / 0x18 7922 v5 = (unsigned int)((signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60) / 0x18 % 0x150 + 1;
7925 % 0x150 7923 v6 = v5 == pValue;
7926 + 1; 7924 return v6;
7927 goto LABEL_9;
7928 case VAR_DayOfWeek: 7925 case VAR_DayOfWeek:
7929 v5 = (unsigned int)((signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60) / 0x18 7926 v5 = (unsigned int)((signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60) / 0x18 % 7;
7930 % 7; 7927 v6 = v5 == pValue;
7931 LABEL_9:
7932 LOBYTE(v6) = v5 == a1;
7933 return v6; 7928 return v6;
7934 case VAR_Sex: 7929 case VAR_Sex:
7935 v7 = (CHARACTER_RACE)this->uSex; 7930 if ( pValue == (CHARACTER_RACE)this->uSex )
7936 goto _cmp_against_arg2; 7931 return true;
7932 return v4 >= pValue;
7937 case VAR_Class: 7933 case VAR_Class:
7938 v7 = (CHARACTER_RACE)this->classType; 7934 v7 = (CHARACTER_RACE)this->classType;
7939 goto _cmp_against_arg2; 7935 if ( pValue == v7 )
7936 return true;
7937 return v4 >= pValue;
7940 case VAR_Race: 7938 case VAR_Race:
7941 v7 = GetRace(); 7939 v7 = GetRace();
7942 _cmp_against_arg2: 7940 if ( pValue == v7 )
7943 if ( a1 == v7 ) 7941 return true;
7944 goto _return_true; 7942 return v4 >= pValue;
7945 goto _cmp_against_arg;
7946 case VAR_CurrentHP: 7943 case VAR_CurrentHP:
7947 v4 = this->sHealth; 7944 v4 = this->sHealth;
7948 goto _cmp_against_arg; 7945 return v4 >= pValue;
7949 case VAR_MaxHP: 7946 case VAR_MaxHP:
7950 v8 = GetMaxHealth(); 7947 v8 = GetMaxHealth();
7951 v10 = __OFSUB__(v3->sHealth, v8); 7948 v10 = __OFSUB__(v3->sHealth, v8);
7952 v9 = v3->sHealth - v8 < 0; 7949 v9 = v3->sHealth - v8 < 0;
7953 goto LABEL_169; 7950 goto LABEL_169;
7954 case VAR_CurrentSP: 7951 case VAR_CurrentSP:
7955 v4 = this->sMana; 7952 v4 = this->sMana;
7956 goto _cmp_against_arg; 7953 return v4 >= pValue;
7957 case VAR_MaxSP: 7954 case VAR_MaxSP:
7958 v11 = GetMaxMana(); 7955 v11 = GetMaxMana();
7959 v10 = __OFSUB__(v3->sMana, v11); 7956 v10 = __OFSUB__(v3->sMana, v11);
7960 v9 = v3->sMana - v11 < 0; 7957 v9 = v3->sMana - v11 < 0;
7961 goto LABEL_169; 7958 goto LABEL_169;
7962 case VAR_ActualAC: 7959 case VAR_ActualAC:
7963 v12 = GetActualAC(); 7960 v12 = GetActualAC();
7964 goto _j_cmp_against_arg; 7961 goto _j_cmp_against_arg;
7965 case VAR_ACModifier: 7962 case VAR_ACModifier:
7966 v4 = this->sACModifier; 7963 v4 = this->sACModifier;
7967 goto _cmp_against_arg; 7964 return v4 >= pValue;
7968 case VAR_BaseLevel: 7965 case VAR_BaseLevel:
7969 v4 = this->uLevel; 7966 v4 = this->uLevel;
7970 goto _cmp_against_arg; 7967 return v4 >= pValue;
7971 case VAR_LevelModifier: 7968 case VAR_LevelModifier:
7972 v4 = this->sLevelModifier; 7969 v4 = this->sLevelModifier;
7973 goto _cmp_against_arg; 7970 return v4 >= pValue;
7974 case VAR_Age: 7971 case VAR_Age:
7975 v12 = GetActualAge(); 7972 v12 = GetActualAge();
7976 goto _j_cmp_against_arg; 7973 goto _j_cmp_against_arg;
7977 case VAR_Award: 7974 case VAR_Award:
7978 v13 = 0x80u >> ((signed __int16)a1 - 1) % 8; 7975 v13 = 0x80u >> ((signed __int16)a1 - 1) % 8;
7979 v14 = this->field_152[((signed __int16)a1 - 1) >> 3]; 7976 v14 = this->field_152[((signed __int16)a1 - 1) >> 3];
7980 goto LABEL_108; 7977 if ( !((unsigned __int8)v13 & v14) )
7978 return v4 >= pValue;
7979 v4 = pValue;
7980 return v4 >= pValue;
7981 case VAR_Experience: 7981 case VAR_Experience:
7982 v4 = LODWORD(this->uExperience); 7982 v4 = LODWORD(this->uExperience);
7983 goto _cmp_against_arg; 7983 return v4 >= pValue;
7984 case VAR_QBits_QuestsDone: 7984 case VAR_QBits_QuestsDone:
7985 v13 = 0x80u >> ((signed __int16)a1 - 1) % 8; 7985 v13 = 0x80u >> (pValue - 1) % 8;
7986 v14 = pParty->_award_bits[((signed __int16)a1 - 1) >> 3]; 7986 v14 = pParty->_award_bits[(pValue - 1) >> 3];
7987 goto LABEL_108; 7987 if ( !((unsigned __int8)v13 & v14) )
7988 return false;
7989 return true;
7988 case VAR_PlayerItemInHands: 7990 case VAR_PlayerItemInHands:
7989 v15 = 0; 7991 v15 = 0;
7990 v16 = v3->pInventoryItems; 7992 v16 = v3->pInventoryItems;
7991 break; 7993 break;
7992 case VAR_FixedGold: 7994 case VAR_FixedGold:
7993 v4 = pParty->uNumGold; 7995 v4 = pParty->uNumGold;
7994 goto _cmp_against_arg; 7996 return v4 >= pValue;
7995 case VAR_MightBonus: 7997 case VAR_MightBonus:
7996 v4 = this->uMightBonus; 7998 v4 = this->uMightBonus;
7997 goto _cmp_against_arg; 7999 return v4 >= pValue;
7998 case VAR_IntellectBonus: 8000 case VAR_IntellectBonus:
7999 v4 = this->uIntelligenceBonus; 8001 v4 = this->uIntelligenceBonus;
8000 goto _cmp_against_arg; 8002 return v4 >= pValue;
8001 case VAR_PersonalityBonus: 8003 case VAR_PersonalityBonus:
8002 v4 = this->uWillpowerBonus; 8004 v4 = this->uWillpowerBonus;
8003 goto _cmp_against_arg; 8005 return v4 >= pValue;
8004 case VAR_EnduranceBonus: 8006 case VAR_EnduranceBonus:
8005 v4 = this->uEnduranceBonus; 8007 v4 = this->uEnduranceBonus;
8006 goto _cmp_against_arg; 8008 return v4 >= pValue;
8007 case VAR_SpeedBonus: 8009 case VAR_SpeedBonus:
8008 v4 = this->uSpeedBonus; 8010 v4 = this->uSpeedBonus;
8009 goto _cmp_against_arg; 8011 return v4 >= pValue;
8010 case VAR_AccuracyBonus: 8012 case VAR_AccuracyBonus:
8011 v4 = this->uAccuracyBonus; 8013 v4 = this->uAccuracyBonus;
8012 goto _cmp_against_arg; 8014 return v4 >= pValue;
8013 case VAR_LuckBonus: 8015 case VAR_LuckBonus:
8014 v4 = this->uLuckBonus; 8016 v4 = this->uLuckBonus;
8015 goto _cmp_against_arg; 8017 return v4 >= pValue;
8016 case VAR_BaseMight: 8018 case VAR_BaseMight:
8017 v4 = this->uMight; 8019 v4 = this->uMight;
8018 goto _cmp_against_arg; 8020 return v4 >= pValue;
8019 case VAR_BaseIntellect: 8021 case VAR_BaseIntellect:
8020 v4 = this->uIntelligence; 8022 v4 = this->uIntelligence;
8021 goto _cmp_against_arg; 8023 return v4 >= pValue;
8022 case VAR_BasePersonality: 8024 case VAR_BasePersonality:
8023 v4 = this->uWillpower; 8025 v4 = this->uWillpower;
8024 goto _cmp_against_arg; 8026 return v4 >= pValue;
8025 case VAR_BaseEndurance: 8027 case VAR_BaseEndurance:
8026 v4 = this->uEndurance; 8028 v4 = this->uEndurance;
8027 goto _cmp_against_arg; 8029 return v4 >= pValue;
8028 case VAR_BaseSpeed: 8030 case VAR_BaseSpeed:
8029 v4 = this->uSpeed; 8031 v4 = this->uSpeed;
8030 goto _cmp_against_arg; 8032 return v4 >= pValue;
8031 case VAR_BaseAccuracy: 8033 case VAR_BaseAccuracy:
8032 v4 = this->uAccuracy; 8034 v4 = this->uAccuracy;
8033 goto _cmp_against_arg; 8035 return v4 >= pValue;
8034 case VAR_FixedFood: 8036 case VAR_FixedFood:
8035 v4 = pParty->uNumFoodRations; 8037 v4 = pParty->uNumFoodRations;
8036 goto _cmp_against_arg; 8038 return v4 >= pValue;
8037 default: 8039 default:
8038 goto _cmp_against_arg; 8040 return v4 >= pValue;
8039 } 8041 }
8040 while ( v16->uItemID != a1 ) 8042 while ( v16->uItemID != pValue )
8041 { 8043 {
8042 ++v15; 8044 ++v15;
8043 ++v16; 8045 ++v16;
8044 if ( v15 >= 138 ) 8046 if ( v15 >= 138 )
8045 { 8047 {
8046 v17 = pParty->pPickedItem.uItemID == a1; 8048 v6 = pParty->pPickedItem.uItemID == pValue;
8047 _return2:
8048 LOBYTE(v6) = v17;
8049 return v6; 8049 return v6;
8050 } 8050 }
8051 } 8051 }
8052 _return_true: 8052 return true;
8053 LOBYTE(v6) = 1;
8054 return v6;
8055 } 8053 }
8056 v4 = this->uLuck; 8054 v4 = this->uLuck;
8057 goto _cmp_against_arg; 8055 return v4 >= pValue;
8058 } 8056 }
8059 if ( var <= VAR_MagicResistance ) 8057 if ( VarNum <= VAR_MagicResistance )
8060 { 8058 {
8061 if ( var == VAR_MagicResistance ) 8059 if ( VarNum == VAR_MagicResistance )
8062 { 8060 {
8063 v4 = this->sResMagicBase; 8061 v4 = this->sResMagicBase;
8064 } 8062 }
8065 else 8063 else
8066 { 8064 {
8067 switch ( var ) 8065 switch ( VarNum )
8068 { 8066 {
8069 case VAR_FireResistance: 8067 case VAR_FireResistance:
8070 v4 = this->sResFireBase; 8068 v4 = this->sResFireBase;
8071 goto _cmp_against_arg; 8069 return v4 >= pValue;
8072 case VAR_AirResistance: 8070 case VAR_AirResistance:
8073 v4 = this->sResAirBase; 8071 v4 = this->sResAirBase;
8074 goto _cmp_against_arg; 8072 return v4 >= pValue;
8075 case VAR_WaterResistance: 8073 case VAR_WaterResistance:
8076 v4 = this->sResWaterBase; 8074 v4 = this->sResWaterBase;
8077 goto _cmp_against_arg; 8075 return v4 >= pValue;
8078 case VAR_EarthResistance: 8076 case VAR_EarthResistance:
8079 v4 = this->sResEarthBase; 8077 v4 = this->sResEarthBase;
8080 goto _cmp_against_arg; 8078 return v4 >= pValue;
8081 case VAR_SpiritResistance: 8079 case VAR_SpiritResistance:
8082 v4 = this->sResSpiritBase; 8080 v4 = this->sResSpiritBase;
8083 goto _cmp_against_arg; 8081 return v4 >= pValue;
8084 case VAR_MindResistance: 8082 case VAR_MindResistance:
8085 v4 = this->sResMindBase; 8083 v4 = this->sResMindBase;
8086 goto _cmp_against_arg; 8084 return v4 >= pValue;
8087 case VAR_BodyResistance: 8085 case VAR_BodyResistance:
8088 v4 = this->sResBodyBase; 8086 v4 = this->sResBodyBase;
8089 goto _cmp_against_arg; 8087 return v4 >= pValue;
8090 case VAR_LightResistance: 8088 case VAR_LightResistance:
8091 v4 = this->sResLightBase; 8089 v4 = this->sResLightBase;
8092 goto _cmp_against_arg; 8090 return v4 >= pValue;
8093 case VAR_DarkResistance: 8091 case VAR_DarkResistance:
8094 v4 = this->sResDarkBase; 8092 v4 = this->sResDarkBase;
8095 goto _cmp_against_arg; 8093 return v4 >= pValue;
8096 case VAR_ActualMight: 8094 case VAR_ActualMight:
8097 v12 = GetActualMight(); 8095 v12 = GetActualMight();
8098 goto _j_cmp_against_arg; 8096 goto _j_cmp_against_arg;
8099 case VAR_ActualIntellect: 8097 case VAR_ActualIntellect:
8100 v12 = GetActualIntelligence(); 8098 v12 = GetActualIntelligence();
8115 v12 = GetActualLuck(); 8113 v12 = GetActualLuck();
8116 _j_cmp_against_arg: 8114 _j_cmp_against_arg:
8117 v4 = v12; 8115 v4 = v12;
8118 break; 8116 break;
8119 default: 8117 default:
8120 goto _cmp_against_arg; 8118 return v4 >= pValue;
8121 } 8119 }
8122 } 8120 }
8123 goto _cmp_against_arg; 8121 return v4 >= pValue;
8124 } 8122 }
8125 if ( var <= VAR_DisarmTrapSkill ) 8123 if ( VarNum <= VAR_DisarmTrapSkill )
8126 { 8124 {
8127 if ( var != VAR_DisarmTrapSkill ) 8125 if ( VarNum != VAR_DisarmTrapSkill )
8128 { 8126 {
8129 if ( var <= VAR_MindResistanceBonus ) 8127 if ( VarNum <= VAR_MindResistanceBonus )
8130 { 8128 {
8131 switch ( var ) 8129 switch ( VarNum )
8132 { 8130 {
8133 case VAR_MindResistanceBonus: 8131 case VAR_MindResistanceBonus:
8134 v4 = this->sResMindBonus; 8132 v4 = this->sResMindBonus;
8135 break; 8133 break;
8136 case VAR_FireResistanceBonus: 8134 case VAR_FireResistanceBonus:
8147 break; 8145 break;
8148 case VAR_SpiritResistanceBonus: 8146 case VAR_SpiritResistanceBonus:
8149 v4 = this->sResSpiritBonus; 8147 v4 = this->sResSpiritBonus;
8150 break; 8148 break;
8151 } 8149 }
8152 goto _cmp_against_arg; 8150 return v4 >= pValue;
8153 } 8151 }
8154 if ( var == VAR_BodyResistanceBonus ) 8152 if ( VarNum == VAR_BodyResistanceBonus )
8155 { 8153 {
8156 v4 = this->sResBodyBonus; 8154 v4 = this->sResBodyBonus;
8157 goto _cmp_against_arg; 8155 return v4 >= pValue;
8158 } 8156 }
8159 if ( var == VAR_LightResistanceBonus ) 8157 if ( VarNum == VAR_LightResistanceBonus )
8160 { 8158 {
8161 v4 = this->sResLightBonus; 8159 v4 = this->sResLightBonus;
8162 goto _cmp_against_arg; 8160 return v4 >= pValue;
8163 } 8161 }
8164 if ( var == VAR_DarkResistanceBonus ) 8162 if ( VarNum == VAR_DarkResistanceBonus )
8165 { 8163 {
8166 v4 = this->sResDarkBonus; 8164 v4 = this->sResDarkBonus;
8167 goto _cmp_against_arg; 8165 return v4 >= pValue;
8168 } 8166 }
8169 if ( var == VAR_MagicResistanceBonus ) 8167 if ( VarNum == VAR_MagicResistanceBonus )
8170 { 8168 {
8171 v4 = this->sResMagicBonus; 8169 v4 = this->sResMagicBonus;
8172 goto _cmp_against_arg; 8170 return v4 >= pValue;
8173 } 8171 }
8174 if ( var <= VAR_MagicResistanceBonus || var > VAR_DiplomacySkill ) 8172 if ( VarNum <= VAR_MagicResistanceBonus || VarNum > VAR_DiplomacySkill )
8175 goto _cmp_against_arg; 8173 return v4 >= pValue;
8176 } 8174 }
8177 LABEL_90: 8175 LABEL_90:
8178 v18 = *((short *)&this->pConditions[16] + var); 8176 v18 = *((short *)&this->pConditions[16] + VarNum);
8179 if ( a1 <= 63 ) 8177 if ( pValue <= 63 )
8180 v4 = v18 & 0x3F; 8178 v4 = v18 & 0x3F;
8181 else 8179 else
8182 v4 = a1 & v18; 8180 v4 = pValue & v18;
8183 goto _cmp_against_arg; 8181 return v4 >= pValue;
8184 } 8182 }
8185 if ( var == 104 ) 8183 if ( VarNum == 104 )
8186 goto LABEL_90; 8184 goto LABEL_90;
8187 if ( (signed int)var <= 104 ) 8185 if ( (signed int)VarNum <= 104 )
8188 goto _cmp_against_arg; 8186 return v4 >= pValue;
8189 if ( (signed int)var > 0x79 ) 8187 if ( (signed int)VarNum > 0x79 )
8190 { 8188 {
8191 if ( var != 122 ) 8189 if ( VarNum != 122 )
8192 { 8190 {
8193 if ( (signed int)var > 122 && var <= VAR_ActiveSpells ) 8191 if ( (signed int)VarNum > 122 && VarNum <= VAR_ActiveSpells )
8194 v4 = (unsigned __int8)byte_5E4C15[var]; 8192 v4 = (unsigned __int8)byte_5E4C15[VarNum];
8195 goto _cmp_against_arg; 8193 return v4 >= pValue;
8196 } 8194 }
8197 v4 = GetMajorConditionIdx(); 8195 v4 = GetMajorConditionIdx();
8198 if ( v4 != 18 ) 8196 if ( v4 != 18 )
8199 { 8197 {
8200 _cmp_against_arg: 8198 return v4 >= pValue;
8201 LOBYTE(v6) = v4 >= a1; 8199 }
8202 return v6; 8200 v4 = pValue;
8203 } 8201 return v4 >= pValue;
8204 LABEL_109: 8202 }
8205 v4 = a1; 8203 return *((int *)this + 2 * VarNum - 210);
8206 goto _cmp_against_arg;
8207 }
8208 return *((int *)this + 2 * var - 210);
8209 } 8204 }
8210 8205
8211 8206
8212 //----- (0044A5CB) -------------------------------------------------------- 8207 //----- (0044A5CB) --------------------------------------------------------
8213 void Player::SetVariable(enum VariableType var, signed int a3) 8208 void Player::SetVariable(enum VariableType var, signed int a3)