mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Use hitpoints in medical extension (#4494)
This commit is contained in:
parent
a54aec72bc
commit
b4ab15bb47
BIN
ace_medical.dll
BIN
ace_medical.dll
Binary file not shown.
@ -78,7 +78,7 @@ namespace ace {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (highestSpot == NULL) {
|
if (highestSpot == NULL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int c = 0;
|
int c = 0;
|
||||||
@ -94,10 +94,10 @@ namespace ace {
|
|||||||
{
|
{
|
||||||
injuryToAdd = highestSpot;
|
injuryToAdd = highestSpot;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int indexNewInjuryToAdd = rand() % information.size();
|
int indexNewInjuryToAdd = rand() % information.size();
|
||||||
injuryToAdd = information.at(indexNewInjuryToAdd);
|
injuryToAdd = information.at(indexNewInjuryToAdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bodyPartID = selection;
|
int bodyPartID = selection;
|
||||||
@ -105,7 +105,7 @@ namespace ace {
|
|||||||
{
|
{
|
||||||
bodyPartID = rand() % 6;
|
bodyPartID = rand() % 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
injuries::OpenWound newWound(woundID++, injuryToAdd->ID, bodyPartID, 1, injuryToAdd->bloodLoss, injuryToAdd->pain);
|
injuries::OpenWound newWound(woundID++, injuryToAdd->ID, bodyPartID, 1, injuryToAdd->bloodLoss, injuryToAdd->pain);
|
||||||
injuriesToAdd.push_back(newWound);
|
injuriesToAdd.push_back(newWound);
|
||||||
}
|
}
|
||||||
@ -202,14 +202,14 @@ namespace ace {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int handleDamage::SelectionToNumber(const std::string& selectionName)
|
int handleDamage::SelectionToNumber(const std::string& hitpointName)
|
||||||
{
|
{
|
||||||
// TODO use dynamic selections instead
|
// TODO use dynamic selections instead
|
||||||
std::vector<std::string> selections = { "head", "body", "hand_l", "hand_r", "leg_l", "leg_r" };
|
std::vector<std::string> hitpoints = { "Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg" };
|
||||||
std::vector<std::string>::iterator it = find(selections.begin(), selections.end(), selectionName);
|
std::vector<std::string>::iterator it = find(hitpoints.begin(), hitpoints.end(), hitpointName);
|
||||||
if (it != selections.end())
|
if (it != hitpoints.end())
|
||||||
{
|
{
|
||||||
return it - selections.begin();
|
return it - hitpoints.begin();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user