本文整理汇总了C#中ZyGames.Tianjiexing.Model.GameUser类的典型用法代码示例。如果您正苦于以下问题:C# GameUser类的具体用法?C# GameUser怎么用?C# GameUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GameUser类属于ZyGames.Tianjiexing.Model命名空间,在下文中一共展示了GameUser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOpenGoldNum
public static int GetOpenGoldNum(int enableNum, int userGridNum)
{
int latticeSpar = 0; //开启每个格子的价格
int Sum = 0;
int Sub = 0;
int minGridNum = new GameUser().SparePartMinGridNum;
int subGridNum = MathUtils.Subtraction(enableNum, minGridNum, 0);
int minusNum = MathUtils.Subtraction(userGridNum, minGridNum, 0);
for (int i = 1; i <= subGridNum; i++)
{
if (i == 0) latticeSpar = 0;
if (i == 1) latticeSpar = 2;
if (i >= 2) latticeSpar = i * 2;
Sum += latticeSpar;
}
for (int j = 0; j <= minusNum; j++)
{
if (j == 0) latticeSpar = 0;
if (j == 1) latticeSpar = 2;
if (j >= 2) latticeSpar = j * 2;
Sub += latticeSpar;
}
return MathUtils.Subtraction(Sum, Sub, 0);
}
示例2: CheckUserPlotHurdleNum
/// <summary>
/// 天地劫副本关数
/// </summary>
/// <param name="user"></param>
public static int CheckUserPlotHurdleNum(GameUser user)
{
int hurdleNum = 0;
PlotInfo plotInfo = CheckUserPlotKalpa(user);
if (plotInfo != null)
{
UserDailyRestrain dailyRestrain = new GameDataCacheSet<UserDailyRestrain>().FindKey(user.UserID);
if (dailyRestrain != null && dailyRestrain.UserExtend != null && dailyRestrain.UserExtend.KalpaDate.Date == DateTime.Now.Date)
{
hurdleNum = user.UserExtend.HurdleNum;
}
else
{
hurdleNum = plotInfo.PlotSeqNo;
if (user.UserExtend != null && hurdleNum > 0)
{
user.UserExtend.UpdateNotify(obj =>
{
user.UserExtend.HurdleNum = hurdleNum;
return true;
});
//user.Update();
}
}
}
else
{
hurdleNum = 1;
}
return hurdleNum;
}
示例3: IsBeiBaoFull
//判断背包是否已满
public static bool IsBeiBaoFull(GameUser user, int itembaseId)
{
ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(itembaseId);
if (itemInfo != null)
{
var package = UserItemPackage.Get(user.UserID);
//查找出所有已用的格子
var userItemArray = package.ItemPackage.FindAll(m => !m.IsRemove && m.ItemStatus == ItemStatus.BeiBao);
//查找出已用格子中是相同物品格子的数量
var itemmountArray = package.ItemPackage.FindAll(m => !m.IsRemove && m.ItemStatus == ItemStatus.BeiBao && m.ItemID == itembaseId);
int totalNum = 0;
//累加所有的该物品的数量
foreach (UserItemInfo userItemInfo in itemmountArray)
{
totalNum = MathUtils.Addition(totalNum, userItemInfo.Num);
}
//是否有空余位置
int mount = totalNum % itemInfo.PackMaxNum;
if (userItemArray.Count >= user.GridNum && mount == 0)
{
return true;
}
}
return false;
}
示例4: AddExprerience
public static void AddExprerience(GameUser user, int experience)
{
string userID = user.UserID;
var userEmbattleList = new GameDataCacheSet<UserEmbattle>().FindAll(userID, m => m.MagicID == user.UseMagicID);
HashSet<int> generalHash = new HashSet<int>();
foreach (UserEmbattle userEmbattle in userEmbattleList)
{
//wuzf 8-18 修复多个相同佣兵阵形数据
if (generalHash.Contains(userEmbattle.GeneralID))
{
userEmbattle.GeneralID = 0;
//userEmbattle.Update();
continue;
}
else
{
generalHash.Add(userEmbattle.GeneralID);
}
//UserGeneral userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(userID, userEmbattle.GeneralID);
//if (userGeneral != null)
//{
// userGeneral.CurrExperience = MathUtils.Addition(userGeneral.CurrExperience, experience);
//}
}
//UserHelper.UserGeneralExp(user.UserID, experience);
}
示例5: DailySportsRankPrize
/// <summary>
/// 竞技场每日奖励
/// </summary>
/// <param name="user"></param>
public static void DailySportsRankPrize(GameUser user)
{
UserDailyRestrain dailyRestrain = new GameDataCacheSet<UserDailyRestrain>().FindKey(user.UserID);
if (IsGainSportsReward(user.UserID) && dailyRestrain != null && dailyRestrain.UserExtend != null)
{
//var envSet = ServerEnvSet.Get(ServerEnvKey.JingJiChangReward, "");
SportsRewardInfo sportsInfo = new ConfigCacheSet<SportsRewardInfo>().FindKey(dailyRestrain.UserExtend.UserRankID);
//if (envSet != null && sportsInfo != null && envSet.ToDateTime().Date > dailyRestrain.Funtion11.Date &&
// dailyRestrain.UserExtend.UserRankID > 0)
if (sportsInfo != null && DateTime.Now.Date != dailyRestrain.Funtion11.Date &&
dailyRestrain.UserExtend.UserRankID > 0)
{
dailyRestrain.Funtion11 = DateTime.Now;
dailyRestrain.UserExtend.UserRankID = 0;
user.SportsIntegral = MathUtils.Addition(user.SportsIntegral, sportsInfo.RewardObtian,
int.MaxValue);
user.GameCoin = MathUtils.Addition(user.GameCoin, sportsInfo.RewardGoin, int.MaxValue);
string sportContent = string.Format(LanguageManager.GetLang().St5106_JingJiChangRankReward,
sportsInfo.RewardObtian, sportsInfo.RewardGoin);
var chatService = new TjxChatService();
chatService.SystemSendWhisper(user, sportContent);
}
}
}
示例6: RankNotice
/// <summary>
/// 排行榜公告
/// </summary>
public static void RankNotice(GameUser user)
{
RankLvNotice(user);
RankObtionNotice(user);
RankCoinNotice(user);
RankCombatNumNotice(user);
}
示例7: FathersDay
/// <summary>
/// 父亲节奖励
/// </summary>
public static void FathersDay(GameUser user)
{
short energyNum = 30;
int obtainNum = 50;
int gameGoin = 20000;
string fatherTime = "2012-06-17 00:00:00";
DateTime fatherDate = DateTime.Parse(fatherTime);
UserDailyRestrain dailyRestrain = new GameDataCacheSet<UserDailyRestrain>().FindKey(user.UserID);
if (dailyRestrain != null && dailyRestrain.Funtion13 < 1)
{
if (DateTime.Now.Date == fatherDate.Date)
{
dailyRestrain.Funtion13 = 1;
//dailyRestrain.Update();
user.EnergyNum = MathUtils.Addition(user.EnergyNum, energyNum, short.MaxValue);
user.ObtainNum = MathUtils.Addition(user.ObtainNum, obtainNum, int.MaxValue);
user.GameCoin = MathUtils.Addition(user.GameCoin, gameGoin, int.MaxValue);
//user.Update();
string content = string.Format(LanguageManager.GetLang().St_FathersDay,
energyNum, obtainNum,
gameGoin);
new TjxChatService().SystemSendWhisper(user, content);
}
}
}
示例8: TakeAction
public override bool TakeAction()
{
_gameUser = new GameDataCacheSet<GameUser>().FindKey(ContextUser.UserID);
_cityInfoArray = new ConfigCacheSet<CityInfo>().FindAll(c => c.CityType == 0 &&
c.MinLv <= _gameUser.UserLv &&
((int)c.CountryID == 0 || c.CountryID == ContextUser.CountryID));
return true;
}
示例9: TriggerArchaeologyPlot
/// <summary>
/// 考古战役
/// </summary>
/// <param name="user"></param>
/// <param name="plotNpcID"></param>
/// <returns></returns>
public static ISingleCombat TriggerArchaeologyPlot(GameUser user, int plotNpcID)
{
ICombatController controller = new TjxCombatController();
ISingleCombat plotCombater = controller.GetSingleCombat(CombatType.KaoGuPlot);
plotCombater.SetAttack(new UserEmbattleQueue(user.UserID, user.UseMagicID));
plotCombater.SetDefend(new MonsterQueue(plotNpcID));
return plotCombater;
}
示例10: TriggerSJTPlot
/// <summary>
/// 圣吉塔战役
/// </summary>
/// <param name="user"></param>
/// <param name="plotNpcID"></param>
/// <returns></returns>
public static ISingleCombat TriggerSJTPlot(GameUser user, int plotNpcID, double difficultNum)
{
ICombatController controller = new TjxCombatController();
ISingleCombat plotCombater = controller.GetSingleCombat(CombatType.ShengJiTa);
plotCombater.SetAttack(new UserEmbattleQueue(user.UserID, user.UseMagicID));
plotCombater.SetDefend(new MonsterQueue(plotNpcID, difficultNum));
return plotCombater;
}
示例11: TriggerPlot
/// <summary>
/// 副本战役
/// </summary>
/// <param name="user"></param>
/// <param name="plotNpcID"></param>
/// <returns></returns>
public static ISingleCombat TriggerPlot(GameUser user, int plotNpcID)
{
//TrumpAbilityAttack.CombatTrumpLift(user.UserID); //法宝每战斗M次就扣除N点寿命
ICombatController controller = new TjxCombatController();
ISingleCombat plotCombater = controller.GetSingleCombat(CombatType.Plot);
plotCombater.SetAttack(new UserEmbattleQueue(user.UserID, user.UseMagicID));
plotCombater.SetDefend(new MonsterQueue(plotNpcID));
return plotCombater;
}
示例12: IsMeet
/// <summary>
/// 是否满足培养条件
/// </summary>
/// <param name="user"></param>
/// <param name="culTure"></param>
/// <returns></returns>
public static bool IsMeet(GameUser user, EnchantCulTure culTure)
{
if ((culTure.CultureType == EnchantCultureType.Ordinary && user.UserExtend != null && user.UserExtend.MoJingNum >= culTure.MoJingNum)
|| (user.GoldNum >= culTure.GoldNum && culTure.CultureType != EnchantCultureType.Ordinary))
{
return true;
}
return false;
}
示例13: GetNoviceActivities
/// <summary>
/// 新手礼包
/// </summary>
/// <param name="user"></param>
/// <param name="item"></param>
/// <param name="noviceActivities"></param>
/// <returns></returns>
public static bool GetNoviceActivities(GameUser user, UserItemInfo item, NoviceActivities noviceActivities)
{
List<NoviceReward> noviceArray = noviceActivities.Reward.ToList();
var package = UserItemPackage.Get(user.UserID);
var userItemArray = package.ItemPackage.FindAll(m => !m.IsRemove && m.ItemStatus == ItemStatus.BeiBao);
int subPackNum = MathUtils.Subtraction(user.GridNum, MathUtils.Subtraction(userItemArray.Count, 5, 0), 0);
if (noviceArray.Count > subPackNum)
{
return false;
}
bool isupdate = false;
foreach (NoviceReward reward in noviceArray)
{
if (reward.Type == 1)
{
isupdate = true;
user.EnergyNum = MathUtils.Addition(user.EnergyNum, (short)reward.Num, short.MaxValue);
}
if (reward.Type == 2)
{
isupdate = true;
user.GameCoin = MathUtils.Addition(user.GameCoin, reward.Num, int.MaxValue);
}
else if (reward.Type == 3)
{
ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(reward.Reward);
UserGeneral userGeneral = UserGeneral.GetMainGeneral(user.UserID);
if (itemInfo.ItemType == ItemType.ZhuangBei && !itemInfo.CheckCareer(userGeneral.CareerID))
{
continue;
}
UserItemHelper.AddUserItem(user.UserID, itemInfo.ItemID, reward.Num);
}
else if (reward.Type == 4)
{
//晶石
isupdate = true;
user.GiftGold = MathUtils.Addition(user.GiftGold, reward.Num, int.MaxValue);
}
}
UserItemHelper.UseUserItem(user.UserID, item.ItemID, 1);
if (isupdate)
{
//user.Update();
}
if (item.ItemID == 5000 || item.ItemID == 5001 ||
item.ItemID == 5002 || item.ItemID == 5003)
{
int itemID = MathUtils.Addition(item.ItemID, 1, int.MaxValue);
UserItemHelper.AddUserItem(user.UserID, itemID, 1);
}
return true;
}
示例14: Trigger
/// <summary>
/// 获取个人元宝
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
public static void Trigger(GameUser user)
{
var trigger = new PaymentTrigger(GetPayment);
trigger.BeginInvoke(user.GameId, user.ServerId, user.Pid, user.UserID, null, null);
int vipLv;
int vipGold = MathUtils.Addition(user.PayGold, user.ExtGold, int.MaxValue);
List<VipLvInfo> vipLvArray = new ShareCacheStruct<VipLvInfo>().FindAll(u => u.PayGold <= vipGold);
vipLv = vipLvArray.Count > 0 ? vipLvArray[vipLvArray.Count - 1].VipLv : (short)0;
user.VipLv = vipLv;
//user.Update();
}
示例15: CheckAllowCrystall
/// <summary>
/// 检查是否能猎命
/// </summary>
/// <returns></returns>
public static bool CheckAllowCrystall(GameUser user)
{
var package = UserCrystalPackage.Get(user.UserID);
int currNum = 0;
if (package != null)
{
currNum = package.CrystalPackage.FindAll(m => m.IsSale == 1).Count;
currNum += user.GrayCrystalList == null ? 0 : user.GrayCrystalList.Count;
}
return currNum < _crystalGridNum;
}