Fix up warnings (mostly loss of data cast warnings). When an ability gets interrupted, the key is required to be depressed before another cast attempt can be made. Added collision layer tiles to a few tiles in 1-1 due to ability to walk out-of-bounds.
This commit is contained in:
+10
-10
@@ -82,10 +82,10 @@ void ItemInfo::InitializeItems(){
|
||||
scriptName=DATA["ItemDatabase"][key.first][keyName].GetString();
|
||||
}else
|
||||
if(keyName=="Cast Time"){
|
||||
castTime=DATA["ItemDatabase"][key.first][keyName].GetReal();
|
||||
castTime=float(DATA["ItemDatabase"][key.first][keyName].GetReal());
|
||||
}else
|
||||
if(keyName=="Cooldown Time"){
|
||||
castTime=DATA["ItemDatabase"][key.first][keyName].GetReal();
|
||||
castTime=float(DATA["ItemDatabase"][key.first][keyName].GetReal());
|
||||
}else{ //THis is a custom override modifier for a script. NO-OP
|
||||
}
|
||||
}
|
||||
@@ -131,8 +131,8 @@ int ItemProps::GetIntProp(std::string prop){
|
||||
else return (*scriptProps)[prop].GetInt();
|
||||
};
|
||||
float ItemProps::GetFloatProp(std::string prop){
|
||||
if(customProps->HasProperty(prop)) return (*customProps)[prop].GetReal();
|
||||
else return (*scriptProps)[prop].GetReal();
|
||||
if(customProps->HasProperty(prop)) return float((*customProps)[prop].GetReal());
|
||||
else return float((*scriptProps)[prop].GetReal());
|
||||
};
|
||||
std::string ItemProps::GetStringProp(std::string prop){
|
||||
if(customProps->HasProperty(prop)) return (*customProps)[prop].GetString();
|
||||
@@ -142,9 +142,9 @@ std::string ItemProps::GetStringProp(std::string prop){
|
||||
void ItemInfo::InitializeScripts(){
|
||||
ITEM_SCRIPTS["Restore"]=[](Crawler*game,ItemProps props){
|
||||
game->GetPlayer()->Heal(props.GetIntProp("HP Restore"));
|
||||
game->GetPlayer()->Heal(game->GetPlayer()->GetMaxHealth()*props.GetIntProp("HP % Restore")/100.f);
|
||||
game->GetPlayer()->Heal(int(game->GetPlayer()->GetMaxHealth()*props.GetIntProp("HP % Restore")/100.f));
|
||||
game->GetPlayer()->RestoreMana(props.GetIntProp("MP Restore"));
|
||||
game->GetPlayer()->RestoreMana(game->GetPlayer()->GetMaxMana()*props.GetIntProp("MP % Restore")/100.f);
|
||||
game->GetPlayer()->RestoreMana(int(game->GetPlayer()->GetMaxMana()*props.GetIntProp("MP % Restore")/100.f));
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -337,7 +337,7 @@ void Inventory::Clear(ITCategory itemCategory){
|
||||
if(itemCategory=="Monster Loot"||itemCategory=="Stage Loot"){//These do not affect the actual inventory, we just clear the lists.
|
||||
itemQuantity=item.Amt();
|
||||
}
|
||||
RemoveItem(item.Name(),itemCategory,itemQuantity);
|
||||
RemoveItem(item.Name(),itemCategory,uint32_t(itemQuantity));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ bool Item::operator==(const Item&rhs)const{
|
||||
}
|
||||
|
||||
ItemOverlay::ItemOverlay(ItemInfo item)
|
||||
:it(item),width("ItemDrop.Item Drop Scale"_F*24+4+game->GetTextSizeProp(item.Name()).x*0.5){
|
||||
:it(item),width("ItemDrop.Item Drop Scale"_F*24+4+game->GetTextSizeProp(item.Name()).x*0.5f){
|
||||
xOffset=-width;
|
||||
}
|
||||
|
||||
@@ -364,11 +364,11 @@ void ItemOverlay::Draw(){
|
||||
for(ItemOverlay&item:items){
|
||||
vf2d pos={item.xOffset,96.f+counter*10};
|
||||
Pixel darkCol=Menu::GetCurrentTheme().GetButtonCol();
|
||||
Pixel lightCol=Menu::GetCurrentTheme().GetButtonCol()*1.2;
|
||||
Pixel lightCol=Menu::GetCurrentTheme().GetButtonCol()*1.2f;
|
||||
game->GradientFillRectDecal(pos,{item.width,8},darkCol,darkCol,darkCol,lightCol);
|
||||
game->DrawRectDecal(pos,{item.width,8},Menu::GetCurrentTheme().GetHighlightCol());
|
||||
game->DrawDecal(pos,item.it.Decal(),{itemScale,itemScale});
|
||||
game->DrawShadowStringPropDecal(pos+vf2d{itemScale*24+2,2},item.it.Name(),WHITE,BLACK,{0.5,0.7});
|
||||
game->DrawShadowStringPropDecal(pos+vf2d{itemScale*24+2,2},item.it.Name(),WHITE,BLACK,{0.5f,0.7f});
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user