Add in illegal stat buff checks and asserts when adding to an unsupported stat buff for both monsters and players. 77/77 tests passing.
This commit is contained in:
@@ -932,9 +932,11 @@ void Player::AddBuff(BuffType type,float duration,float intensity){
|
||||
buffList.push_back(Buff{type,duration,intensity});
|
||||
}
|
||||
void Player::AddBuff(BuffType type,float duration,float intensity,std::set<ItemAttribute>attr){
|
||||
if(type==STAT_UP)std::for_each(attr.begin(),attr.end(),[](const ItemAttribute&attr){if(attr.ActualName()!="Health"&&attr.ActualName()!="Health %"&&attr.ActualName()!="Attack"&&attr.ActualName()!="Attack %"&&attr.ActualName()!="Defense"&&attr.ActualName()!="Defense %"&&attr.ActualName()!="CDR")ERR(std::format("WARNING! Stat Up Attribute type {} is NOT IMPLEMENTED!",attr.ActualName()));});
|
||||
buffList.push_back(Buff{type,duration,intensity,attr});
|
||||
}
|
||||
void Player::AddBuff(BuffType type,float duration,float intensity,std::set<std::string>attr){
|
||||
if(type==STAT_UP)std::for_each(attr.begin(),attr.end(),[](const std::string&attr){if(attr!="Health"&&attr!="Health %"&&attr!="Attack"&&attr!="Attack %"&&attr!="Defense"&&attr!="Defense %"&&attr!="CDR")ERR(std::format("WARNING! Stat Up Attribute type {} is NOT IMPLEMENTED!",attr));});
|
||||
buffList.push_back(Buff{type,duration,intensity,attr});
|
||||
}
|
||||
void Player::AddBuff(BuffType type,float duration,float intensity,float timeBetweenTicks,std::function<void(AiL*,int)>repeatAction){
|
||||
|
||||
Reference in New Issue
Block a user