Added Sound effect configuration and implementation.
This commit is contained in:
@@ -110,6 +110,7 @@ void ItemInfo::InitializeItems(){
|
||||
Stats minStats;
|
||||
Stats maxStats;
|
||||
bool useDuringCast=false;
|
||||
EventName useSound;
|
||||
for(auto&[itemKey,itemValue]:data[key].GetKeys()){
|
||||
std::string keyName=itemKey;
|
||||
if(keyName=="Description"){
|
||||
@@ -145,6 +146,9 @@ void ItemInfo::InitializeItems(){
|
||||
}else
|
||||
if(keyName=="SellValue"){
|
||||
sellValue=data[key][keyName].GetInt();
|
||||
}else
|
||||
if(keyName=="UseSound"){
|
||||
useSound=data[key][keyName].GetString();
|
||||
}else{ //THis is a custom override modifier for a script. NO-OP
|
||||
}
|
||||
}
|
||||
@@ -230,6 +234,7 @@ void ItemInfo::InitializeItems(){
|
||||
it.buyValue=buyValue;
|
||||
it.sellValue=sellValue;
|
||||
it.useDuringCast=useDuringCast;
|
||||
it.useSound=useSound;
|
||||
if(slot.size()>0){
|
||||
for(std::string&s:slot){
|
||||
if(!nameToEquipSlot.count(s))ERR("WARNING! Tried to add item "<<it.name<<" to slot "<<s<<" which doesn't exist!");
|
||||
@@ -1097,4 +1102,11 @@ Stats ItemInfo::RandomizeStats(){
|
||||
|
||||
const bool Item::HasRandomizedStats()const{
|
||||
return randomizedStats.size()>0;
|
||||
}
|
||||
|
||||
const EventName&ItemInfo::UseSound()const{
|
||||
return useSound;
|
||||
}
|
||||
const EventName&Item::UseSound()const{
|
||||
return it->UseSound();
|
||||
}
|
||||
Reference in New Issue
Block a user