2021-04-08 20:09:59 +08:00
|
|
|
|
using Cal.DataTable;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
public class AddSpecialGoodsEffect : GoodsEffect
|
|
|
|
|
{
|
|
|
|
|
public override string Init(Unit unit, GoodsBase goodsBase,bool isLock =false)
|
|
|
|
|
{
|
|
|
|
|
base.unit = unit;
|
|
|
|
|
GoodsBase = goodsBase;
|
|
|
|
|
return Run();
|
|
|
|
|
}
|
|
|
|
|
private string Run()
|
|
|
|
|
{
|
2021-04-11 19:50:39 +08:00
|
|
|
|
NumericComponent num = unit.GetComponent<NumericComponent>();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < GoodsBase.GoodsArr.Length; i++)
|
|
|
|
|
{
|
2021-04-11 19:50:39 +08:00
|
|
|
|
GoodsBase.Goods goods = GoodsBase.GoodsArr[i];
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (goods.Goods_Id == 0) continue;
|
|
|
|
|
if (MathHelper.IsHit(goods.Goods_Probability))
|
|
|
|
|
{
|
|
|
|
|
int count = goods.Goods_Count;
|
|
|
|
|
if (count == 0)
|
|
|
|
|
count = 250;//RandomHelper.RandomNumber(1, 501);
|
|
|
|
|
BagHelper.AddItem(unit, goods.Goods_Id, count, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return string.Empty;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public override async ETVoid Execute()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
await ETTask.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|