本文整理汇总了C#中System.Variant.GetVariantOrDefault方法的典型用法代码示例。如果您正苦于以下问题:C# Variant.GetVariantOrDefault方法的具体用法?C# Variant.GetVariantOrDefault怎么用?C# Variant.GetVariantOrDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Variant
的用法示例。
在下文中一共展示了Variant.GetVariantOrDefault方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Apc
public Apc(Variant config)
{
ID = config.GetStringOrDefault("_id");
this.Name = config.GetStringOrDefault("Name");
Name = config.GetStringOrDefault("Name");
m_value = config.GetVariantOrDefault("Value");
m_life = new PlayerProperty();
if (m_value != null)
{
m_life.Add(m_value);
this.Level = m_value.GetIntOrDefault("Level");
}
this.ApcType = FighterType.APC;
Variant ui = config.GetVariantOrDefault("UI");
if (ui != null)
{
this.Skin = ui.GetStringOrDefault("Skin");
string apcType = ui.GetStringOrDefault("Type");
if (apcType == "BB")
{
this.ApcType = FighterType.BB;
}
else if (apcType == "Boss")
{
this.ApcType = FighterType.Boss;
}
}
}
示例2: HideApc
public HideApc(Variant config)
: base(config)
{
ID = config.GetStringOrDefault("_id");
Variant v = config.GetVariantOrDefault("Value");
if (v != null)
{
SceneID = v.GetStringOrDefault("SceneID");
Range = RangeHelper.NewRectangle(v["Range"] as Variant, true);
}
}
示例3: Box
public Box(Variant config)
{
ID = config.GetStringOrDefault("_id");
Name = config.GetStringOrDefault("Name");
m_value = config.GetVariantOrDefault("Value");
if (m_value != null)
{
this.SceneID = m_value.GetStringOrDefault("SceneID");
this.GoodsID = m_value.GetStringOrDefault("GoodsID");
this.OpenMS = m_value.GetIntOrDefault("OpenMS");
this.GrowSecond = m_value.GetIntOrDefault("GrowSecond");
this.MaxOpen = m_value.GetIntOrDefault("MaxOpen");
m_range = RangeHelper.NewRectangle(m_value.GetVariantOrDefault("Range"), true);
}
Variant ui = config.GetVariantOrDefault("UI");
if (ui != null)
{
this.Skin = ui.GetStringOrDefault("Skin");
}
if (this.GrowSecond <= 0)
{
this.GrowSecond = 30;
}
}
示例4: ScenePin
public ScenePin(Variant gc)
{
_id = gc.GetStringOrDefault("_id");
_autoPath = (gc.GetStringOrDefault("SubType") == "4");
Variant v = gc.GetVariantOrDefault("Value");
if (v != null)
{
_sceneA = v.GetStringOrDefault("SceneID");
_x = v.GetIntOrDefault("X");
_y = v.GetIntOrDefault("Y");
m_destination = new Destination(
v.GetStringOrDefault("SceneB"),
v.GetIntOrDefault("BX"),
v.GetIntOrDefault("BY")
);
const int s = 4;
m_range = new Rectangle(_x - s, _y - s, 2 * s, 2 * s);
}
}
示例5: CreatePlayerProperty
public static PlayerProperty CreatePlayerProperty(Variant v)
{
PlayerProperty life = new PlayerProperty();
life.LiLiang = v.GetIntOrDefault("LiLiang");
life.TiZhi = v.GetIntOrDefault("TiZhi");
life.ZhiLi = v.GetIntOrDefault("ZhiLi");
life.JingShen = v.GetIntOrDefault("JingShen");
life.KangShangHai = v.GetIntOrDefault("KangShangHai");
//-----------------------
life.WuLiXiShou = v.GetDoubleOrDefault("WuLiXiShou");
life.MoFaXiShou = v.GetDoubleOrDefault("MoFaXiShou");
life.FanJiLv = v.GetDoubleOrDefault("FanJiLv");
life.HeJiLv = v.GetDoubleOrDefault("HeJiLv");
life.TaoPaoLv = v.GetDoubleOrDefault("TaoPaoLv");
life.BaoJiShangHai = v.GetDoubleOrDefault("BaoJiShangHai");
life.HeJiShangHai = v.GetDoubleOrDefault("HeJiShangHai");
life.SuDu = v.GetIntOrDefault("SuDu");
life.BaoJi = v.GetIntOrDefault("BaoJi");
life.MingZhong = v.GetIntOrDefault("MingZhong");
life.ShanBi = v.GetIntOrDefault("ShanBi");
life.BaoJiLv = v.GetDoubleOrDefault("BaoJiLv");
life.MingZhongLv = v.GetDoubleOrDefault("MingZhongLv");
life.ShanBiLv = v.GetDoubleOrDefault("ShanBiLv");
//----------------------------------
life.ShengMing = v.GetVariantOrDefault("ShengMing").GetIntOrDefault("M");
life.MoFa = v.GetVariantOrDefault("MoFa").GetIntOrDefault("M");
life.GongJi = v.GetVariantOrDefault("GongJi").GetIntOrDefault("V");
life.MoFaGongJi = v.GetVariantOrDefault("MoFaGongJi").GetIntOrDefault("V");
life.FangYu = v.GetVariantOrDefault("FangYu").GetIntOrDefault("V");
life.MoFaFangYu = v.GetVariantOrDefault("MoFaFangYu").GetIntOrDefault("V");
return life;
}
示例6: checkCondition
/// <summary>
/// 检查对象是否满足条件
/// </summary>
/// <param name="f"></param>
/// <param name="condition"></param>
/// <returns></returns>
static bool checkCondition(FightObject f, Variant condition, int round)
{
Variant caseHp = condition.GetVariantOrDefault("CaseHP");
Variant caseMp = condition.GetVariantOrDefault("CaseMP");
IList caseBuff = condition.GetValueOrDefault<IList>("CaseBuff");
IList caseRound = condition.GetValueOrDefault<IList>("CaseRound");
if (caseHp != null)
{
double a = caseHp.GetDoubleOrDefault("A");
double b = caseHp.GetDoubleOrDefault("B");
if (a > 0 && a < 1) //百分比
{
double test = (f.HP * 1.0) / f.Life.ShengMing;
if (test <= a || test > b)
{
return false;
}
}
else
{
if (f.HP <= a || f.HP > b)
{
return false;
}
}
}
if (caseMp != null)
{
double a = caseMp.GetDoubleOrDefault("A");
double b = caseMp.GetDoubleOrDefault("B");
if (a > 0 && a < 1) //百分比
{
double test = (f.MP * 1.0) / f.Life.MoFa;
if (test <= a || test > b)
{
return false;
}
}
else
{
if (f.MP <= a || f.MP > b)
{
return false;
}
}
}
if (caseBuff != null)
{
bool find = false;
foreach (var b in f.Buffers)
{
if (caseBuff.Contains(b.ID))
{
find = true;
break;
}
}
if (!find) return false;
}
if (caseRound != null && caseRound.Count > 0)
{
return caseRound.Contains(round);
}
return true;
}
示例7: CreateEmailValue
/// <summary>
/// 邮件相关信息
/// </summary>
/// <param name="playerid">发件人</param>
/// <param name="name">发件人名称</param>
/// <param name="receiveid">接收人</param>
/// <param name="receivename">接收者名称</param>
/// <param name="d">邮件内容</param>
/// <returns></returns>
public static Variant CreateEmailValue(string playerid, string name, string receiveid, string receivename, Variant d)
{
Variant v = new Variant();
v.Add("SendID", playerid);
v.Add("SendName", name);
v.Add("ReceiveID", receiveid);
v.Add("ReceiveName", receivename);
v.Add("Content", d.GetValue<object>("mailMess"));
DateTime dt = DateTime.UtcNow;
v.Add("UpdateDate", dt);
//邮件有效天数
int day = Convert.ToInt32(TipManager.GetMessage(EmailReturn.HameDay));
v.Add("EndDate", dt.AddDays(day));
int IsHave = 0;
if (d.ContainsKey("moneyGoods"))
{
Variant money = d.GetVariantOrDefault("moneyGoods");
if (money.ContainsKey("Coin"))
{
v.Add("Coin", money.GetIntOrDefault("Coin"));
IsHave = money.GetIntOrDefault("Coin") > 0 ? 1 : 0;
}
else
{
v.Add("Coin", 0);
}
if (money.ContainsKey("Score"))
{
v.Add("Score", money.GetIntOrDefault("Score"));
IsHave = money.GetIntOrDefault("Score") > 0 ? 1 : 0;
}
else
{
v.Add("Score", 0);
}
}
else
{
v.Add("Coin", 0);
v.Add("Score", 0);
}
if (d.ContainsKey("goodsList"))
{
List<Variant> list = new List<Variant>();
IList goodsList = d.GetValue<IList>("goodsList");
foreach (Variant msg in goodsList)
{
GameConfig gc = GameConfigAccess.Instance.FindOneById(msg.GetStringOrDefault("E"));
string goodsType = string.Empty;
int sort = 0;
if (gc != null)
{
goodsType = gc.Value.GetStringOrDefault("GoodsType");
sort = gc.Value.GetIntOrDefault("Sort");
}
else
{
if (gc == null)
{
Goods g = GoodsAccess.Instance.FindOneById(msg.GetStringOrDefault("E"));
if (g != null)
{
goodsType = g.Value.GetStringOrDefault("GoodsType");
sort = g.Value.GetIntOrDefault("Sort");
}
else
{
if (g == null)
{
//查询是否是宠物
Pet pet = PetAccess.Instance.FindOneById(msg.GetStringOrDefault("E"));
if (pet != null)
{
goodsType = "Pet";
sort = pet.Value.GetIntOrDefault("Sort");
}
}
}
}
}
if (goodsType == string.Empty)
continue;
Variant gs = new Variant();
gs.Add("SoleID", msg.GetStringOrDefault("E"));
gs.Add("GoodsID", msg.GetStringOrDefault("G"));
gs.Add("Number", msg.GetIntOrDefault("A"));
gs.Add("GoodsType", goodsType);
gs.Add("Sort", sort);
//.........这里部分代码省略.........
示例8: GetAffix
/// <summary>
/// 得到装被附加属性
/// </summary>
/// <param name="affix">附加属性</param>
/// <param name="v">产生的附加属性</param>
public static void GetAffix(Variant affix, Variant v)
{
if (affix == null)
return;
int min = affix.GetIntOrDefault("Min");
int max = affix.GetIntOrDefault("Max");
if (min > max)
return;
Variant lift = affix.GetVariantOrDefault("Life");
if (lift == null)
return;
foreach (var item in lift)
{
if (v.ContainsKey(item.Key))
continue;
Variant tmp = (Variant)item.Value;
if (tmp == null)
continue;
int m = tmp.GetIntOrDefault("Min");
int n = tmp.GetIntOrDefault("Max");
double range = tmp.GetDoubleOrDefault("Range");
if (NumberRandom.RandomHit(range))
{
//表示成功
v.Add(item.Key, NumberRandom.Next(m, n + 1));
if (v.Count >= max)
break;
}
}
if (lift.Count > min && v.Count < min)
{
//回调
GetAffix(affix, v);
}
}
示例9: NowAward
/// <summary>
/// 领取奖励
/// </summary>
/// <param name="note"></param>
/// <param name="part">活动</param>
private static void NowAward(UserNote note, Variant part)
{
int index = note.GetInt32(2);
string soleid = note.PlayerID + part.GetStringOrDefault("ID");
PartBase model = PartAccess.Instance.FindOneById(soleid);
if (model == null)
{
model = new PartBase();
model.ID = soleid;
model.Name = part.GetStringOrDefault("Name");
model.SubType = part.GetStringOrDefault("SubType");
model.Created = DateTime.UtcNow;
model.PlayerID = note.PlayerID;
model.PartID = part.GetStringOrDefault("ID");
model.Value = new Variant();
}
Variant v = part.GetVariantOrDefault("Value");
if (v == null)
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part6));
return;
}
DateTime dt = DateTime.Now;
string name = dt.ToString("yyyyddMM");
if (model.Value.ContainsKey(name))
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part5));
return;
}
Variant dayaward = v.GetVariantOrDefault("DayAward");
if (dayaward == null)
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part6));
return;
}
Variant info = null;
foreach (var tt in dayaward)
{
string[] strs = tt.Key.Split('-');
int min = Convert.ToInt32(strs[0]);
int max = Convert.ToInt32(strs[1]);
if (note.Player.Level >= min && note.Player.Level <= max)
{
info = tt.Value as Variant;
break;
}
}
if (info == null)
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part6));
return;
}
IList ls = info.GetValue<IList>(note.Player.RoleID + "" + note.Player.Sex);
if (ls == null)
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part6));
return;
}
Variant goods = ls[index] as Variant;
Dictionary<string, Variant> dic = PartAccess.Instance.GetPartAward(goods);
PlayerEx b0 = note.Player.B0;
if (BurdenManager.IsFullBurden(b0, dic))
{
//包袱满不能领取
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part7));
return;
}
model.Value[name] = dt;
string t = dayaward.GetStringOrDefault("T");
string m = dayaward.GetStringOrDefault("M");
if (model.Save())
{
Dictionary<string, int> gos = note.Player.AddGoods(dic, GoodsSource.Yellow);
note.Call(PartCommand.PartExchangeR, true, TipManager.GetMessage(PartReturn.Part15));
PartApprise(note, gos, t, m, false);
}
else
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part14));
}
}
示例10: CheckScene
/// <summary>
/// 场景限制
/// </summary>
/// <param name="player"></param>
/// <param name="limit"></param>
/// <returns></returns>
private static int CheckScene(Player player, Variant limit)
{
Variant sceneLimit = limit.GetVariantOrDefault("Scene");
if (sceneLimit != null)
{
string needScene = sceneLimit.GetStringOrDefault("SceneID");
if (!string.IsNullOrEmpty(needScene))
{
if (player.SceneID != needScene)
{
return GoodsReturn.NoSex;
}
#region 区域限制
//Variant r = sceneLimit.GetVariantOrDefault("P");
//if (r != null)
//{
// int x = r.GetIntOrDefault("X");
// int y = r.GetIntOrDefault("Y");
// int w = r.GetIntOrDefault("W");
// int h = r.GetIntOrDefault("H");
// if (note.Player.X < x || note.Player.Y < y || note.Player.X > x + w || note.Player.Y > y + h)
// {
// player.UseGoodsR( false, TipAccess.GetMessage(GoodsReturn.NoSex));
// return false;
// }
//}
#endregion
}
}
return 0;
}
示例11: GetDouleExp
/// <summary>
/// 获取双倍经验系数
/// </summary>
/// <param name="v"></param>
/// <returns></returns>
protected virtual double GetDouleExp(Variant v)
{
if (v == null) return 0;
Variant exp = v.GetVariantOrDefault("RExp");
if (exp == null) return 0;
if (exp.GetDateTimeOrDefault("T") >= DateTime.UtcNow)
{
return exp.GetDoubleOrDefault("A");
}
return 0;
}
示例12: Yellow
/// <summary>
/// 黄钻奖励
/// </summary>
/// <param name="note"></param>
/// <param name="part"></param>
/// <returns></returns>
private static void Yellow(UserNote note, Variant part)
{
//note.Player.Yellow = 81;
string msg = note.GetString(1);
string id = part.GetStringOrDefault("ID");
string name = part.GetStringOrDefault("Name");
string subtype = part.GetStringOrDefault("SubType");
string soleid = note.Player.UserID + id;
PartBase model = PartAccess.Instance.FindOneById(soleid);
if (model == null)
{
model = new PartBase();
model.ID = soleid;
model.Name = name;
model.SubType = subtype;
model.Created = DateTime.UtcNow;
model.PlayerID = note.Player.UserID;
model.PartID = id;
model.Value = new Variant();
}
Variant info = model.Value;
DateTime dt = DateTime.UtcNow;
Variant v = part.GetVariantOrDefault("Value");
if (v == null)
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part6));
return;
}
Variant award = v.GetVariantOrDefault("Award");
if (award == null)
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part6));
return;
}
if (note.Player.Yellow <= 0)
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part14));
return;
}
if (msg == "n")
{
//表示领取年费奖励
if (note.Player.Yellow % 10 != 1)
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part16));
return;
}
}
else
{
//int lv = 0;
//if (!int.TryParse(msg, out lv))
//{
// note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part11));
// return;
//}
//得到黄钻等级
msg = (note.Player.Yellow / 10).ToString();
}
if (info.ContainsKey(msg))
{
DateTime awardTime = info.GetDateTimeOrDefault(msg);
//表示今日已经领取
if (awardTime.ToLocalTime().Date == dt.ToLocalTime().Date)
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part5));
return;
}
}
IList select = award.GetValue<IList>(msg);
if (select == null)
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part14));
return;
}
Variant goods = select[0] as Variant;
if (goods == null)
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part14));
return;
}
Dictionary<string, Variant> dic = PartAccess.Instance.GetPartAward(goods);
if (dic.Count == 0)
//.........这里部分代码省略.........
示例13: PlayerRank
/// <summary>
/// 等级排行(冠军赛),老区用户奖励
/// </summary>
/// <param name="note"></param>
/// <param name="part"></param>
private static void PlayerRank(UserNote note, Variant part)
{
string msg = note.GetString(1);
int index = note.GetInt32(2);
string rs = note.Player.RoleID + note.Player.Sex;
string subtype = part.GetStringOrDefault("SubType");
Variant config = part.GetVariantOrDefault("Value");
if (config == null)
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part6));
return;
}
Variant award = null;
Variant tmp = null;
int oldpid = 0;
int ranking = 0;
string tableName = "";
if (subtype == PartType.LevelSupp)
{
//tableName = "PlayerOld";
tableName = config.GetStringOrDefault("TableName");
//判断是不是老服用户
ranking = PlayerSortAccess.Instance.PlayerOld(note.Player.UserID, tableName, out oldpid);
if (ranking == 0)
{
//非老区用户不能领取该奖励
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part9));
return;
}
else if (ranking == -1)
{
//该奖励已经领取,不能重复领取
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part5));
return;
}
award = config.GetVariantOrDefault("Award");
foreach (var item in award)
{
string[] strs = item.Key.Split('-');
int min = Convert.ToInt32(strs[0]);
int max = Convert.ToInt32(strs[1]);
if (ranking >= min && ranking <= max)
{
tmp = item.Value as Variant;
msg = item.Key;
break;
}
}
}
else
{
List<string> awardType = new List<string>()
{
"MonthAward",
"WeekAward",
"DayAward"
};
if (!awardType.Contains(msg))
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part10));
return;
}
award = config.GetVariantOrDefault(msg);
if (award == null)
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part10));
return;
}
string str = PlayerSortAccess.Instance.GetTableName(msg);
if (string.IsNullOrEmpty(str))
{
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part10));
return;
}
tableName = "Player" + str;
if (PlayerSortAccess.Instance.IsAward(note.Player, tableName, msg))
{
//该项活动奖励已经参加
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part5));
return;
}
//得到排行
ranking = PlayerSortAccess.Instance.GetMyRank(note.Player, tableName);
if (ranking <= 0)
//.........这里部分代码省略.........
示例14: PartAward
/// <summary>
/// 充值奖励
/// </summary>
/// <param name="note"></param>
/// <param name="part"></param>
private static void PartAward(UserNote note, Variant part)
{
string msg = note.GetString(1);
int index = note.GetInt32(2);
string id = part.GetStringOrDefault("ID");
string name = part.GetStringOrDefault("Name");
string subtype = part.GetStringOrDefault("SubType");
string soleid = note.PlayerID + id;
//取得到活动信息
PartBase model = PartAccess.Instance.FindOneById(soleid);
if (model == null)
{
model = new PartBase();
model.ID = note.PlayerID + id;
model.Name = name;
model.SubType = subtype;
model.Created = DateTime.UtcNow;
model.PlayerID = note.PlayerID;
model.PartID = id;
model.Value = new Variant();
}
Variant info = model.Value;
int cur = 0;
int num = 0;
if (subtype == PartType.CoinAchieve || subtype == PartType.CoinSupp)
{
num = Convert.ToInt32(msg);
cur = info.GetIntOrDefault("Cur");
if (cur < num)
{
//活动其间充值金额不足
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part4));
return;
}
//不能重复领取
if (subtype == PartType.CoinAchieve)
{
if (info.ContainsKey(msg))
{
//该项活动已经领取,不能重复领取
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part5));
return;
}
}
}
string rs = note.Player.RoleID + note.Player.Sex;
Variant config = part.GetVariantOrDefault("Value");
if (config == null)
{
//活动配置数据不正确
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part6));
return;
}
Variant award = config.GetVariantOrDefault("Award");
if (award == null)
{
//活动配置数据不正确
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part6));
return;
}
Variant tmp = null;
//选择的奖励
if (subtype == PartType.LevelAchieve)
{
if (info.Count > 0)
{
//该项活动已经领取,不能重复领取
note.Call(PartCommand.PartExchangeR, false, TipManager.GetMessage(PartReturn.Part5));
return;
}
foreach (var item in award)
{
string[] strs = item.Key.Split('-');
int min = Convert.ToInt32(strs[0]);
int max = Convert.ToInt32(strs[1]);
if (note.Player.Level >= min && note.Player.Level <= max)
{
tmp = item.Value as Variant;
break;
}
}
}
else
{
tmp = award.GetVariantOrDefault(msg);
}
//.........这里部分代码省略.........
示例15: CreateAction
private void CreateAction(FightObject[] targetTeam, Variant v, int fightCount)
{
int actionType = v.GetIntOrDefault("ActionType");
FightAction action = new FightAction((ActionType)actionType, this.ID, 0);
action.Parameter = v.GetStringOrDefault("Parameter");
action.SkillLev = v.GetIntOrDefault("Level", 1);
//Target 1 自己
//Target 2 队友n
//Target 3 敌人n
//Target 4 随机友方(n)
//Target 5 随机敌人(n)
//Target 6 血量最少的敌人(n)
int actionTarget = v.GetIntOrDefault("ActionTarget");
if (actionTarget <= 1)
{
action.Target = this.ID;
}
else if (actionTarget == 4 || actionTarget == 2)
{
int index = Sinan.Extensions.NumberRandom.Next(Team.Length);
action.Target = Team[index].ID;
}
else if (actionTarget == 5 || actionTarget == 3)
{
int index = Sinan.Extensions.NumberRandom.Next(targetTeam.Length);
action.Target = targetTeam[index].ID;
}
else if (actionTarget == 6)
{
int min = Int32.MaxValue;
foreach (var target in targetTeam)
{
if (target.HP > 0 && target.HP < min)
{
action.Target = target.ID;
}
}
}
else
{
action.Target = string.Empty;
}
action.Say = NewTalk(v.GetVariantOrDefault("Talk"));
action.FightCount = fightCount;
this.m_action = action;
}