本文整理汇总了C#中ZyGames.Tianjiexing.Model.GameUser类的典型用法代码示例。如果您正苦于以下问题:C# GameUser类的具体用法?C# GameUser怎么用?C# GameUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GameUser类属于ZyGames.Tianjiexing.Model命名空间,在下文中一共展示了GameUser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:rongxiong,项目名称:Scut,代码行数:26,代码来源:Action1215.cs
示例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;
}
开发者ID:rongxiong,项目名称:Scut,代码行数:36,代码来源:Action4301.cs
示例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;
}
开发者ID:0jpq0,项目名称:Scut,代码行数:30,代码来源:Action7004.cs
示例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);
}
开发者ID:0jpq0,项目名称:Scut,代码行数:26,代码来源:PlotHelper.cs
示例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);
}
}
}
开发者ID:wf15271760803,项目名称:Scut-samples,代码行数:29,代码来源:RankingHelper.cs
示例6: RankNotice
/// <summary>
/// 排行榜公告
/// </summary>
public static void RankNotice(GameUser user)
{
RankLvNotice(user);
RankObtionNotice(user);
RankCoinNotice(user);
RankCombatNumNotice(user);
}
开发者ID:daneric,项目名称:Scut-samples,代码行数:10,代码来源:NoticeHelper.cs
示例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);
}
}
}
开发者ID:jinfei426,项目名称:Scut,代码行数:28,代码来源:ActivitiesAward.cs
示例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;
}
开发者ID:jinfei426,项目名称:Scut,代码行数:8,代码来源:Action2001.cs
示例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;
}
开发者ID:daneric,项目名称:Scut-samples,代码行数:14,代码来源:CombatFactory.cs
示例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;
}
开发者ID:daneric,项目名称:Scut-samples,代码行数:14,代码来源:CombatFactory.cs
示例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;
}
开发者ID:daneric,项目名称:Scut-samples,代码行数:15,代码来源:CombatFactory.cs
示例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;
}
开发者ID:0jpq0,项目名称:Scut,代码行数:15,代码来源:Action1257.cs
示例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;
}
开发者ID:rongxiong,项目名称:Scut,代码行数:64,代码来源:Action1606.cs
示例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();
}
开发者ID:daneric,项目名称:Scut-samples,代码行数:16,代码来源:PaymentService.cs
示例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;
}
开发者ID:jinfei426,项目名称:Scut,代码行数:15,代码来源:CrystalHelper.cs
示例16: AddSparePart
public static short _currMaxLv = ObjectExtend.ToShort(ConfigEnvSet.GetInt("User.CurrMaxLv")); //玩家最大等级
#endregion Fields
#region Methods
/// <summary>
/// 增加灵件
/// </summary>
public static bool AddSparePart(GameUser user, UserSparePart sparePart)
{
int currNum = user.SparePartList.FindAll(m => string.IsNullOrEmpty(m.UserItemID)).Count;
if (currNum < user.UserExtend.SparePartGridNum)
{
user.AppendSparePart(sparePart);
UserLogHelper.AppendSparePartLog(user.UserID, sparePart, 1);
return true;
}
return false;
}
开发者ID:rongxiong,项目名称:Scut,代码行数:20,代码来源:UserHelper.cs
示例17: IsUp
public static bool IsUp(int magicID, int magicLv, GameUser user)
{
bool result = true;
int upLv = MathUtils.Addition(magicLv, 1, int.MaxValue);
MagicLvInfo magicLvInfo = new ConfigCacheSet<MagicLvInfo>().FindKey(magicID, upLv);
if (magicLvInfo == null || magicLvInfo.EscalateMinLv > user.UserLv || magicLvInfo.ExpNum > user.ExpNum)
{
result = false;
}
return result;
}
开发者ID:rongxiong,项目名称:Scut,代码行数:11,代码来源:Action1501.cs
示例18: CheckUserPlotLayerNum
/// <summary>
/// 天地劫副本层数
/// </summary>
/// <param name="user"></param>
public static void CheckUserPlotLayerNum(GameUser user)
{
PlotInfo plotInfo = UserHelper.CheckUserPlotKalpa(user);
if (user != null && plotInfo != null)
{
//最高层
if (user.UserExtend != null && user.UserExtend.MaxLayerNum == 0)
{
user.UserExtend.MaxLayerNum = plotInfo.LayerNum;
//user.Update();
}
}
}
开发者ID:rongxiong,项目名称:Scut,代码行数:17,代码来源:Action1210.cs
示例19: SendAllowTask
/// <summary>
/// 下发任务
/// </summary>
/// <param name="user"></param>
/// <param name="taskID"></param>
public static List<UserTask> SendAllowTask(GameUser user, int taskID)
{
List<UserTask> userTaskList = new List<UserTask>();
var cacheSet = new GameDataCacheSet<UserTask>();
UserTask preTask = cacheSet.FindKey(user.UserID, taskID);
if (taskID > 0 && preTask != null && (preTask.TaskState != TaskState.Close || preTask.TaskType == TaskType.Offset))
{
return userTaskList;
}
if (taskID == 0 && cacheSet.FindAll(user.UserID, m => m.TaskType < TaskType.Daily).Count > 0)
{
return userTaskList;
}
IList<StoryTaskInfo> taskList = StoryTaskInfo.GetNextTask(taskID);
bool isSend = true;
foreach (StoryTaskInfo taskInfo in taskList)
{
if (taskInfo.CountryID != CountryType.None && user.CountryID != taskInfo.CountryID)
{
continue;
}
UserTask userTask = cacheSet.FindKey(user.UserID, taskInfo.TaskID);
if (userTask == null)
{
userTask = new UserTask
{
TaskID = taskInfo.TaskID,
UserID = user.UserID,
TaskType = taskInfo.TaskType,
TaskState = taskInfo.TaskLv <= user.UserLv ? TaskState.AllowTake : TaskState.NoTake,
CompleteNum = 0,
CreateDate = DateTime.Now
};
cacheSet.Add(userTask);
userTask = cacheSet.FindKey(user.UserID, taskInfo.TaskID);
userTaskList.Add(userTask);
}
else
{
//判断是否已下发过
isSend = false;
break;
}
}
if (isSend)
{
return userTaskList;
}
return new List<UserTask>();
}
开发者ID:jinfei426,项目名称:Scut,代码行数:56,代码来源:TaskHelper.cs
示例20: AddBack
/// <summary>
/// 初始化背包
/// </summary>
/// <param name="userID"></param>
/// <returns></returns>
public static void AddBack(GameUser user)
{
var cacheSet = new PersonalCacheStruct<UserPack>();
var cacheSetBackPack = new ShareCacheStruct<BackpackConfigInfo>();
var userPack = cacheSet.FindKey(user.UserID);
if (userPack == null)
{
userPack = new UserPack();
userPack.UserID = user.UserID.ToInt();
userPack.CreateDate = DateTime.Now;
var backpackConfig = cacheSetBackPack.FindKey(BackpackType.ZhuangBei);
if (backpackConfig != null)
{
var packType = new PackType();
packType.BackpackType = BackpackType.ZhuangBei;
packType.OpenNum = 0;
packType.Position = backpackConfig.DefaultNum;
}
backpackConfig = cacheSetBackPack.FindKey(BackpackType.YongBing);
if (backpackConfig != null)
{
var packType = new PackType();
packType.BackpackType = BackpackType.YongBing;
packType.OpenNum = 0;
packType.Position = backpackConfig.DefaultNum;
}
backpackConfig = cacheSetBackPack.FindKey(BackpackType.HunJi);
if (backpackConfig != null)
{
var packType = new PackType();
packType.BackpackType = BackpackType.HunJi;
packType.OpenNum = 0;
packType.Position = backpackConfig.DefaultNum;
}
backpackConfig = cacheSetBackPack.FindKey(BackpackType.BeiBao);
if (backpackConfig != null)
{
var packType = new PackType();
packType.BackpackType = BackpackType.BeiBao;
packType.OpenNum = 0;
packType.Position = backpackConfig.DefaultNum;
user.GridNum = MathUtils.Addition(user.GridNum, backpackConfig.DefaultNum);
}
}
}
开发者ID:daneric,项目名称:Scut-samples,代码行数:56,代码来源:BackPackHelper.cs
注:本文中的ZyGames.Tianjiexing.Model.GameUser类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论