Phase2.1 添加武器tag配置和数据表定义
This commit is contained in:
@@ -5,8 +5,7 @@ namespace SepCore.UI
|
||||
public class ShopGoodsSelection
|
||||
{
|
||||
public GoodsType GoodsType;
|
||||
public int PropId;
|
||||
public WeaponType WeaponType;
|
||||
public int RefId;
|
||||
public int Price;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace SepCore.UI
|
||||
|
||||
if (goodsConfig.GoodsType == GoodsType.Prop)
|
||||
{
|
||||
PropConfig propConfig = GameEntry.Luban.Get<PropConfig>(goodsConfig.PropId);
|
||||
PropConfig propConfig = GameEntry.Luban.Get<PropConfig>(goodsConfig.RefId);
|
||||
int basePrice = propConfig.Price;
|
||||
|
||||
price = CalculateRandomizedPrice(basePrice, priceRandomPercent);
|
||||
@@ -177,7 +177,7 @@ namespace SepCore.UI
|
||||
}
|
||||
else if (goodsConfig.GoodsType == GoodsType.Weapon)
|
||||
{
|
||||
WeaponConfig weaponConfig = GameEntry.Luban.Get<WeaponConfig>((int)goodsConfig.WeaponType);
|
||||
WeaponConfig weaponConfig = GameEntry.Luban.Get<WeaponConfig>(goodsConfig.RefId);
|
||||
int basePrice = weaponConfig.Price;
|
||||
|
||||
price = CalculateRandomizedPrice(basePrice, priceRandomPercent);
|
||||
@@ -197,8 +197,7 @@ namespace SepCore.UI
|
||||
_selections.Add(new ShopGoodsSelection
|
||||
{
|
||||
GoodsType = goodsConfig.GoodsType,
|
||||
PropId = goodsConfig.PropId,
|
||||
WeaponType = goodsConfig.WeaponType,
|
||||
RefId = goodsConfig.RefId,
|
||||
Price = price
|
||||
});
|
||||
|
||||
@@ -253,14 +252,14 @@ namespace SepCore.UI
|
||||
|
||||
if (goods.GoodsType == GoodsType.Prop)
|
||||
{
|
||||
PropConfig propConfig = GameEntry.Luban.Get<PropConfig>(goods.PropId);
|
||||
PropConfig propConfig = GameEntry.Luban.Get<PropConfig>(goods.RefId);
|
||||
rarity = propConfig.Rarity;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (goods.GoodsType == GoodsType.Weapon)
|
||||
{
|
||||
WeaponConfig weaponConfig = GameEntry.Luban.Get<WeaponConfig>((int)goods.WeaponType);
|
||||
WeaponConfig weaponConfig = GameEntry.Luban.Get<WeaponConfig>(goods.RefId);
|
||||
rarity = weaponConfig.Rarity;
|
||||
return true;
|
||||
}
|
||||
@@ -285,7 +284,7 @@ namespace SepCore.UI
|
||||
{
|
||||
if (goods.GoodsType == GoodsType.Prop)
|
||||
{
|
||||
PropConfig propConfig = GameEntry.Luban.Get<PropConfig>(goods.PropId);
|
||||
PropConfig propConfig = GameEntry.Luban.Get<PropConfig>(goods.RefId);
|
||||
_player.AddProp(new PropItem(propConfig));
|
||||
return new DisplayItemRawData
|
||||
{
|
||||
@@ -303,7 +302,7 @@ namespace SepCore.UI
|
||||
return null;
|
||||
}
|
||||
|
||||
WeaponConfig weaponConfig = GameEntry.Luban.Get<WeaponConfig>((int)goods.WeaponType);
|
||||
WeaponConfig weaponConfig = GameEntry.Luban.Get<WeaponConfig>(goods.RefId);
|
||||
int id = GameEntry.Entity.NextId();
|
||||
var weaponData = EntityDataFactory.Create(id, weaponConfig, _player.Id, CampType.Player);
|
||||
|
||||
@@ -311,7 +310,7 @@ namespace SepCore.UI
|
||||
if (weapon == null)
|
||||
{
|
||||
Log.Warning(
|
||||
$"ShopFormUseCase::ApplyGoodsPurchase: Show weapon failed, weapon type id = {goods.WeaponType}");
|
||||
$"ShopFormUseCase::ApplyGoodsPurchase: Show weapon failed, weapon type id = {goods.RefId}");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user