comparison Monsters.cpp @ 1205:8c02e6f74b29

arrays to std::arrays phase 2 - mm7_data.h converted
author Grumpy7
date Sun, 09 Jun 2013 00:30:48 +0200
parents 29a8defbad9e
children b237a61e61d3
comparison
equal deleted inserted replaced
1204:832f09144726 1205:8c02e6f74b29
166 } 166 }
167 else if ( !_stricmp(tbl->pProperties[0], "Hammerhands") ) 167 else if ( !_stricmp(tbl->pProperties[0], "Hammerhands") )
168 return 73; 168 return 73;
169 else 169 else
170 { 170 {
171 sprintf(pTmpBuf, "Unknown monster spell %s", tbl->pProperties[0]); 171 sprintf(pTmpBuf.data(), "Unknown monster spell %s", tbl->pProperties[0]);
172 MessageBoxA(nullptr, pTmpBuf, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:1562", 0); 172 MessageBoxA(nullptr, pTmpBuf.data(), "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:1562", 0);
173 ++*next_token; 173 ++*next_token;
174 return 0; 174 return 0;
175 } 175 }
176 } 176 }
177 177
1085 { 1085 {
1086 pInfos[curr_rec_num].uSpecialAbilityType=2; 1086 pInfos[curr_rec_num].uSpecialAbilityType=2;
1087 if ( parsed_field.uPropCount > 1 ) 1087 if ( parsed_field.uPropCount > 1 )
1088 { 1088 {
1089 pTmpBuf[0] = 0; 1089 pTmpBuf[0] = 0;
1090 strcpy(pTmpBuf, parsed_field.pProperties[2]); 1090 strcpy(pTmpBuf.data(), parsed_field.pProperties[2]);
1091 if ( parsed_field.uPropCount > 2 ) 1091 if ( parsed_field.uPropCount > 2 )
1092 { 1092 {
1093 int prop_cnt = 3; 1093 int prop_cnt = 3;
1094 if ( parsed_field.uPropCount > 3 ) 1094 if ( parsed_field.uPropCount > 3 )
1095 { 1095 {
1096 do 1096 do
1097 { 1097 {
1098 strcat(pTmpBuf, " "); 1098 strcat(pTmpBuf.data(), " ");
1099 char test_char = parsed_field.pProperties[prop_cnt][0]; 1099 char test_char = parsed_field.pProperties[prop_cnt][0];
1100 strcat(pTmpBuf, parsed_field.pProperties[prop_cnt]); 1100 strcat(pTmpBuf.data(), parsed_field.pProperties[prop_cnt]);
1101 if ( prop_cnt == (parsed_field.uPropCount - 1) ) 1101 if ( prop_cnt == (parsed_field.uPropCount - 1) )
1102 { 1102 {
1103 switch (tolower(test_char)) 1103 switch (tolower(test_char))
1104 { 1104 {
1105 case 'a': pInfos[curr_rec_num].uSpecialAbilityDamageDiceRolls = 1; break; 1105 case 'a': pInfos[curr_rec_num].uSpecialAbilityDamageDiceRolls = 1; break;
1119 { 1119 {
1120 pInfos[curr_rec_num].uSpecialAbilityDamageDiceRolls = 0; 1120 pInfos[curr_rec_num].uSpecialAbilityDamageDiceRolls = 0;
1121 } 1121 }
1122 if ( pMonsterList->uNumMonsters ) 1122 if ( pMonsterList->uNumMonsters )
1123 { 1123 {
1124 pInfos[curr_rec_num].field_3C_some_special_attack = pMonsterList->GetMonsterIDByName(pTmpBuf) + 1; 1124 pInfos[curr_rec_num].field_3C_some_special_attack = pMonsterList->GetMonsterIDByName(pTmpBuf.data()) + 1;
1125 if ( pInfos[curr_rec_num].field_3C_some_special_attack == -1 ) 1125 if ( pInfos[curr_rec_num].field_3C_some_special_attack == -1 )
1126 { 1126 {
1127 sprintf(Src, "Can't create random monster: '%s' See MapStats!", pTmpBuf); 1127 sprintf(Src, "Can't create random monster: '%s' See MapStats!", pTmpBuf);
1128 MessageBoxA(nullptr, Src, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:2239", 0); 1128 MessageBoxA(nullptr, Src, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:2239", 0);
1129 } 1129 }