/// <summary>挑战失败,验证挑战次数</summary> public ASObject CheckChallengCount(tg_duplicate_checkpoint checkpoint, BaseTowerPass towerpass, int blood) { var aso = new ASObject(); if (!Variable.OnlinePlayer.ContainsKey(checkpoint.user_id)) { return(aso); } var session = Variable.OnlinePlayer[checkpoint.user_id] as TGGSession; var userextend = session.Player.UserExtend.CloneEntity(); userextend.challenge_count--; userextend.Update(); session.Player.UserExtend = userextend; if (userextend.challenge_count <= 0) { if (Common.GetInstance().CheckWatchmenRight(towerpass.watchmen, checkpoint)) { checkpoint.dekaron = (int)DuplicateRightType.NORIGHT; } else { checkpoint.state = (int)DuplicateClearanceType.CLEARANCE_FAIL; } checkpoint.Update(); aso = BulidData((int)ResultType.SUCCESS, null, null, (int)FightResultType.LOSE, checkpoint.blood, (int)DuplicateRightType.NORIGHT); return(aso); } checkpoint.blood = session.Player.Role.Kind.att_life; return(GetChalleng(userextend.npc_refresh_count, towerpass, checkpoint)); }
/// <summary>返回最新塔主信息</summary> public tg_duplicate_checkpoint BecomeTower(int rolelife, tg_duplicate_checkpoint checkpoint) { checkpoint.tower_site = checkpoint.site; checkpoint.blood = rolelife; //血量回满 checkpoint.dekaron = (int)DuplicateRightType.HAVERIGHT; return(checkpoint); }
/// <summary>处理爬塔信息</summary> private ASObject CheckResult(tg_duplicate_checkpoint tower, List <int> _position, int loc) { var _record = ConvertToList(tower.all_cards); var value = _record[loc - 1]; //获取玩家卡牌图案 _position[loc - 1] = value; //更新翻牌信息 var nloc = RandomPosition(_position); var nvalue = _record[nloc]; _position[nloc] = nvalue; tower.select_position = ConvertToString(_position); //npc翻牌后更新牌位置 var rule = Variable.BASE_TOWERTEA.FirstOrDefault(m => m.myIcon == value && m.enemyIcon == nvalue); if (rule == null) { return(Result((int)ResultType.BASE_TABLE_ERROR)); //验证数据 } tower.npc_tea += rule.enemyScore; if (tower.npc_tea > 10) { tower.npc_tea = 10; } tower.user_tea += rule.myScore; if (tower.user_tea > 10) { tower.user_tea = 10; //验证玩家星数是否超过上限 } return(IsClearance(tower, _position, loc, nloc, value, nvalue)); }
/// <summary>还有挑战次数,返回当前层</summary> /// <param name="count">翻将次数</param> /// <param name="towerpass">当前层基表数据</param> /// <param name="checkpoint">爬塔实体</param> /// <returns></returns> private ASObject GetChalleng(int count, BaseTowerPass towerpass, tg_duplicate_checkpoint checkpoint) { var aso = new ASObject(); var towervo = new TowerPassVo(); if (towerpass.enemyType == (int)DuplicateEnemyType.FIGHTING) { var npcid = Common.GetInstance().GetNpcId(checkpoint); var npclist = Common.GetInstance().GetNpcList(checkpoint); towervo = EntityToVo.ToTowerPassVo(checkpoint, towerpass.enemyType, npcid, count, npclist); if (Common.GetInstance().CheckWatchmenRight(towerpass.watchmen, checkpoint)) { var tower = tg_duplicate_checkpoint.GetEntityByTowerSite(checkpoint.site); var wahtchmen = tg_user.GetUsersById(tower.user_id); if (wahtchmen != null) { var uservo = Common.GetInstance().ConvertUser(wahtchmen); aso = BulidData((int)ResultType.SUCCESS, uservo, towervo, (int)FightResultType.LOSE, checkpoint.blood, checkpoint.dekaron); return(aso); } } } else { towervo = EntityToVo.ToTowerPassVo(checkpoint, towerpass.enemyType, towerpass.enemyId, count, null); } aso = BulidData((int)ResultType.SUCCESS, null, towervo, (int)FightResultType.LOSE, checkpoint.blood, (int)DuplicateRightType.NORIGHT); Common.GetInstance().CheckpointUpdate(checkpoint); return(aso); }
/// <summary>下一关卡信息</summary> public TowerPassVo TowerPassMessage(int count, ref tg_duplicate_checkpoint checkpoint) { var site = checkpoint.site; var towerpass = Variable.BASE_TOWERPASS.FirstOrDefault(m => m.pass == site); if (towerpass == null) { return(null); } var nextpass = Variable.BASE_TOWERPASS.FirstOrDefault(m => m.id == towerpass.nextId); if (nextpass == null) { return(null); } var towervo = new TowerPassVo(); if (nextpass.enemyType == (int)DuplicateEnemyType.SMALL_GAME) { checkpoint.site = nextpass.pass; towervo = EntityToVo.ToTowerPassVo(checkpoint, nextpass.enemyType, nextpass.enemyId, count, null); } else { var npcid = RefreshNpc(nextpass.pass); checkpoint.npcids = npcid; checkpoint.site = nextpass.pass; var npclist = GetNpcList(checkpoint); towervo = EntityToVo.ToTowerPassVo(checkpoint, nextpass.enemyType, Convert.ToInt32(npcid), count, npclist); } return(towervo); }
/// <summary>开始闯关</summary> private ASObject BeginClearance(tg_duplicate_checkpoint tower, string cards, int tlevel) { var game = Variable.BASE_TOWERGAME.FirstOrDefault(m => m.pass == tower.site); if (game == null) { return(Result((int)ResultType.BASE_TABLE_ERROR)); } tower.npc_tea = game.enemyHp; if (tlevel >= 2) //判断玩家的初始星星数量 { var count = tlevel / 2; tower.user_tea = game.myHp + count; } else { tower.user_tea = game.myHp; } tower.state = (int)DuplicateClearanceType.CLEARANCE_FIGHTING; var photo = InitPosition(); tower.select_position = ConvertToString(photo); //初始化记录翻开的图案 var list = RandomPhoto(cards); tower.all_cards = ConvertToString(list); if (!tg_duplicate_checkpoint.UpdateSite(tower)) { return(Result((int)ResultType.DATABASE_ERROR)); //初始化游戏信息 } return(new ASObject(Common.GetInstance().TeaBuildData((int)ResultType.SUCCESS, tower.npc_tea, tower.user_tea, photo))); }
/// <summary>返回闯关成功信息</summary> public ASObject CheckPointResult(int enemytype, int enemyid, tg_duplicate_checkpoint checkpoint, int ncount, int fcount) { var aso = new ASObject(Common.GetInstance().BulidData((int)ResultType.SUCCESS, checkpoint, enemytype, enemyid, ncount, fcount, null, (int)DuplicateRightType.NORIGHT)); return(aso); }
/// <summary>挑战守护者验证</summary> public bool CheckWatchmenRight(int watchstate, tg_duplicate_checkpoint checkpoint) { if (watchstate == (int)DuplicateTargetType.WATCHMEM && checkpoint.state == (int)DuplicateClearanceType.CLEARANCE_SUCCESS) { return(true); } return(false); }
/// <summary>返回玩家自己是守护者的信息</summary> private ASObject ReturnWatchMen(tg_user user, int enemytype, int enemyid, tg_duplicate_checkpoint checkpoint, int ncount, int fcount) { var uservo = Common.GetInstance().ConvertUser(user); var aso = new ASObject(Common.GetInstance().BulidData((int)ResultType.SUCCESS, checkpoint, enemytype, enemyid, ncount, fcount, uservo, checkpoint.dekaron)); return(aso); }
/// <summary>第一次开始闯关</summary> private ASObject ClearanceBegin(tg_duplicate_checkpoint tower) { if (!string.IsNullOrEmpty(tower.calculate_star)) { tower.calculate_star = ""; } tower.state = (int)DuplicateClearanceType.CLEARANCE_FIGHTING; return(!tg_duplicate_checkpoint.UpdateSite(tower) ? Error((int)ResultType.DATABASE_ERROR) : new ASObject(Common.GetInstance().CalculateBuildData((int)ResultType.SUCCESS, tower.calculate_star))); }
/// <summary>添加爬塔信息</summary> private bool InsertTower(Int64 userid, int site) { var tower = new tg_duplicate_checkpoint { user_id = userid, blood = 1000, state = (int)DuplicateClearanceType.CLEARANCE_UNBEGIN, site = site }; return(tower.Insert() > 0); }
/// <summary>清空当前关卡数据</summary> public void CheckpointUpdate(tg_duplicate_checkpoint checkpoint) { checkpoint.ninjutsu_star = null; checkpoint.calculate_star = null; checkpoint.npc_tea = 0; checkpoint.user_tea = 0; checkpoint.user_blood = 0; checkpoint.npc_blood = 0; checkpoint.select_position = null; checkpoint.all_cards = null; checkpoint.state = (int)DuplicateClearanceType.CLEARANCE_UNBEGIN; checkpoint.Update(); }
/// <summary>验证是否可以挑战改关卡</summary> private bool CheckSiteResult(tg_duplicate_checkpoint checkpoint, BaseTowerPass pass) { if (pass.enemyType != (int)DuplicateEnemyType.FIGHTING) { result = (int)ResultType.TOWER_NPC_NORIGHT; return(false); } if (checkpoint.state == (int)DuplicateClearanceType.CLEARANCE_FAIL || checkpoint.blood <= 0) { result = (int)ResultType.CHALLENGE_FAIL; return(false); } return(true); }
/// <summary>挑战怪物</summary> /// <param name="checkpoint">爬塔实体</param> /// <param name="towerid">塔主用户id</param> /// <param name="count">翻将次数</param> /// <param name="towersite">守护者层</param> private void FightMonster(tg_duplicate_checkpoint checkpoint, int towersite, int highsite) { var role = tg_role.GetEntityByUserId(checkpoint.user_id); var user = tg_user.GetUsersById(checkpoint.user_id); var userextend = tg_user_extend.GetByUserId(checkpoint.user_id); if (role == null || user == null || userextend == null) { return; } if (towersite == (int)DuplicateTargetType.WATCHMEM) { checkpoint.blood = role.att_life; //血回满 var tower = tg_duplicate_checkpoint.GetEntityByTowerSite(checkpoint.site); if (tower == null) { checkpoint = Common.GetInstance().BecomeTower(role.att_life, checkpoint); if (checkpoint.site == highsite) { var uservo = Common.GetInstance().ConvertUser(user); checkpoint.state = (int)DuplicateClearanceType.CLEARANCE_SUCCESS; checkpoint.Update(); var _towervo = EntityToVo.ToTowerPassVo(checkpoint, 0, 0, userextend.npc_refresh_count, null); CheckpointDarePush(checkpoint.user_id, uservo, _towervo, (int)FightResultType.WIN, checkpoint.blood, (int)DuplicateRightType.NORIGHT); return; } } else { var wahtchmen = tg_user.GetUsersById(tower.user_id); var uservo = Common.GetInstance().ConvertUser(wahtchmen); checkpoint.state = (int)DuplicateClearanceType.CLEARANCE_SUCCESS; checkpoint.Update(); CheckpointDarePush(checkpoint.user_id, uservo, null, (int)FightResultType.WIN, checkpoint.blood, checkpoint.dekaron); return; } } var towervo = Common.GetInstance().TowerPassMessage(userextend.npc_refresh_count, ref checkpoint); if (towervo == null) { return; } //checkpoint.npcids = null; Common.GetInstance().CheckpointUpdate(checkpoint); CheckpointDarePush(checkpoint.user_id, null, towervo, (int)FightResultType.WIN, checkpoint.blood, (int)DuplicateRightType.NORIGHT); }
/// <summary>组装TowerPassVo </summary> /// <param name="model">爬塔实体</param> /// <param name="enemytype">挑战类型</param> /// <param name="enemyid">挑战npcid</param> /// <param name="challengenum">挑战次数</param> /// <param name="npclist">挑战怪物集合</param> /// <returns>前端TowerPassVo</returns> public static TowerPassVo ToTowerPassVo(tg_duplicate_checkpoint model, int enemytype, int enemyid, int challengenum, List <int> npclist) { var towerpass = Variable.BASE_TOWERPASS.FirstOrDefault(m => m.pass == model.site); return(new TowerPassVo() { id = model == null ? 1 : model.id, baseid = towerpass == null ? 1 : towerpass.id, enemyType = enemytype, enemyId = enemyid, challengeNum = challengenum, refreshEnemyId = npclist, towerHost = model.tower_site, }); }
/// <summary>验证挑战怪物难度</summary> private bool CheckDifficult(int npcid, ref tg_duplicate_checkpoint checkpoint) { var towerenemy = Variable.BASE_TOWERENEMY.FirstOrDefault(m => m.id == npcid); if (towerenemy == null) { return(false); } if (towerenemy.difficulty == (int)DuplicateDifficultyType.CENTER || towerenemy.difficulty == (int)DuplicateDifficultyType.LOW) { checkpoint.dekaron = (int)DuplicateRightType.NORIGHT; } return(true); }
/// <summary>获取npc</summary> public int GetNpcId(tg_duplicate_checkpoint checkpoint) { int npcid; if (checkpoint.npcids == null) { npcid = Convert.ToInt32(RefreshNpc(checkpoint.site)); checkpoint.npcids = npcid.ToString(); checkpoint.Update(); } else { npcid = GetNpc(checkpoint); } return(npcid); }
/// <summary>获取当前关卡npcid</summary> public int GetNpc(tg_duplicate_checkpoint checkpoint) { if (checkpoint.npcids != null) { if (checkpoint.npcids.Contains("_")) { var npcids = checkpoint.npcids.Split('_'); if (npcids.Length == 2) { return(Convert.ToInt32(npcids[1])); } return(Convert.ToInt32(npcids[2])); } return(Convert.ToInt32(checkpoint.npcids)); } return(0); }
/// <summary>更新关卡信息</summary> private bool UpdateTower(tg_duplicate_checkpoint tower, int site) { tower.site = site; tower.ninjutsu_star = null; tower.calculate_star = null; tower.state = (int)DuplicateClearanceType.CLEARANCE_UNBEGIN; tower.npcids = null; tower.npc_tea = 0; tower.user_tea = 0; tower.dekaron = 0; tower.blood = 1000; tower.user_blood = 0; tower.npc_blood = 0; tower.select_position = null; tower.all_cards = null; return(tower.Update() > 0); }
/// <summary>判断当层怪物是否刷新完</summary> private bool CheckRefreshCount(tg_duplicate_checkpoint checkpoint, ref List <BaseTowerEnemy> towerenemys) { var ids = new List <int>(); var npcs = Variable.BASE_TOWERENEMY.Where(m => m.pass == checkpoint.site).ToList(); if (npcs.Any()) { if (checkpoint.npcids != null) { if (checkpoint.npcids.Contains("_")) { var npcids = checkpoint.npcids.Split('_'); if (npcids.Length == npcs.Count) { return(false); } ids.Add(Convert.ToInt32(npcids[0])); ids.Add(Convert.ToInt32(npcids[1])); foreach (var item in npcs) { var te = ids.FirstOrDefault(m => m == item.id); if (te == 0) { towerenemys.Add(item); } } return(true); } ids.Add(Convert.ToInt32(checkpoint.npcids)); foreach (var item in npcs) { var te = ids.FirstOrDefault(m => m == item.id); if (te == 0) { towerenemys.Add(item); } } } } else { return(false); } return(true); }
/// <summary>获取气血值</summary> private tg_duplicate_checkpoint CheckpointUpdate(tg_duplicate_checkpoint checkpoint, BaseTowerGame towergame, int level) { checkpoint.user_blood = towergame.myHp; checkpoint.npc_blood = towergame.enemyHp; var blood = level - 3;//3:辩才技能3级有额外气血值 if (blood > 0) { checkpoint.user_blood += blood; } if (checkpoint.user_blood > 10) //10:最高气血值 { checkpoint.user_blood = 10; } return(checkpoint); }
/// <summary>验证分数结果</summary> private bool CheckResult(tg_user user, int passaward, ref tg_duplicate_checkpoint checkpoint) { if (checkpoint.user_blood == 0 || checkpoint.npc_blood == 0) { if (checkpoint.user_blood == 0) { checkpoint.state = (int)DuplicateClearanceType.CLEARANCE_FAIL; return(false); } checkpoint.state = (int)DuplicateClearanceType.CLEARANCE_SUCCESS; var _fame = user.fame; user.fame = tg_user.IsFameMax(user.fame, passaward); user.Update(); Common.GetInstance().RewardsToUser(user, (int)GoodsType.TYPE_FAME); Common.GetInstance().LogOperate(user.id, _fame, passaward, user.fame, (int)DuplicateCommand.TOWER_CHECKPOINT_ELOQUENCE_GAME); return(false); } return(true); }
/// <summary>验证挑战守护者的权利</summary> private bool CheckWatchMen(tg_duplicate_checkpoint checkpoint, BaseTowerPass towerpass) { if (towerpass.watchmen != (int)DuplicateTowerType.TOWER)//验证是否达到守护者关卡 { result = (int)ResultType.TOWER_WATCHMEN_NO_OPEN; return(false); } if (checkpoint.dekaron != (int)DuplicateRightType.HAVERIGHT && checkpoint.state != (int)DuplicateClearanceType.CLEARANCE_SUCCESS) //验证是否有权挑战守护者 { result = (int)ResultType.TOWER_WATCHMEN_FIGHT_NORIGHT; return(false); } if (checkpoint.site == checkpoint.tower_site) { result = (int)ResultType.TOWER_NOFIGHT_MYSELF; return(false); } return(true); }
/// <summary>摇出来的数字不相同</summary> public ASObject UnSuccess(tg_duplicate_checkpoint tower, int nxing, int result) { tower.calculate_star = Common.GetInstance().StarsUpdate(tower.calculate_star, result); //更新星星位置及数量 if (Common.GetInstance().StarsCount(tower.calculate_star, result) >= nxing) //判断是否结束爬塔 { //通关失败 tower.state = (int)DuplicateClearanceType.CLEARANCE_FAIL; if (!tg_duplicate_checkpoint.UpdateSite(tower)) { return(Error((int)ResultType.DATABASE_ERROR)); } TOWER_CHECKPOINT_DARE_PUSH.GetInstance().CommandStart(tower.user_id, tower.site, (int)DuplicateClearanceType.CLEARANCE_FAIL); return(new ASObject(Common.GetInstance().CalculateBuildData((int)ResultType.SUCCESS, tower.calculate_star))); } //继续游戏 return(!tg_duplicate_checkpoint.UpdateSite(tower) ? Error((int)ResultType.DATABASE_ERROR) : new ASObject(Common.GetInstance().CalculateBuildData((int)ResultType.SUCCESS, tower.calculate_star))); }
/// <summary>判定是否通关</summary> private ASObject IsClearance(tg_duplicate_checkpoint tower, List <int> pInfo, int loc, int nloc, int photo, int nphoto) { var clearance = Variable.BASE_TOWERPASS.FirstOrDefault(m => m.pass == tower.site); if (clearance == null || string.IsNullOrEmpty(clearance.passAward)) //验证基表信息 { return(Result((int)ResultType.BASE_TABLE_ERROR)); } var reward = clearance.passAward; if (tower.user_tea <= 0) //通关失败 { if (!AcquireReward(tower, reward, (int)DuplicateClearanceType.CLEARANCE_FAIL)) { return(Result((int)ResultType.DATABASE_ERROR)); } } else { if (tower.npc_tea <= 0) //通关成功 { if (!AcquireReward(tower, reward, (int)DuplicateClearanceType.CLEARANCE_SUCCESS)) { return(Result((int)ResultType.DATABASE_ERROR)); } } else { if (!CheckCards(pInfo).Any()) //通关成功 { if (!AcquireReward(tower, reward, (int)DuplicateClearanceType.CLEARANCE_SUCCESS)) { return(Result((int)ResultType.DATABASE_ERROR)); } } if (!tg_duplicate_checkpoint.UpdateSite(tower)) { return(Result((int)ResultType.DATABASE_ERROR)); } } } return(new ASObject(Common.GetInstance().TeaFlopData((int)ResultType.SUCCESS, tower.npc_tea, tower.user_tea, loc, photo, nloc + 1, nphoto))); }
/// <summary>组装数据</summary> public Dictionary <String, Object> BulidData(int result, tg_duplicate_checkpoint model, int enemytype, int enemyid, int challengenum) { var npclist = new List <int>(); if (model != null) { if (model.npcids != null) { npclist = GetNpcList(model); } } var dic = new Dictionary <string, object> { { "result", result }, { "towerpass", model == null?null:EntityToVo.ToTowerPassVo(model, enemytype, enemyid, challengenum, npclist) }, }; return(dic); }
/// <summary>挑战守护者</summary> /// <param name="checkpoint">爬塔实体</param> /// <param name="count">翻将次数</param> /// <param name="highsite">最高层数</param> private void FightWatchMen(tg_duplicate_checkpoint checkpoint, int highsite) { var role = tg_role.GetEntityByUserId(checkpoint.user_id); var user = tg_user.GetUsersById(checkpoint.user_id); var userextend = tg_user_extend.GetByUserId(checkpoint.user_id); if (role == null || user == null || userextend == null) { return; } var tower = tg_duplicate_checkpoint.GetEntityByTowerSite(checkpoint.site); checkpoint = Common.GetInstance().BecomeTower(role.att_life, checkpoint); if (checkpoint.site == highsite) { var uservo = Common.GetInstance().ConvertUser(user); checkpoint.state = (int)DuplicateClearanceType.CLEARANCE_SUCCESS; checkpoint.Update(); var _towervo = EntityToVo.ToTowerPassVo(checkpoint, 0, 0, userextend.npc_refresh_count, null); CheckpointDarePush(checkpoint.user_id, uservo, _towervo, (int)FightResultType.WIN, checkpoint.blood, (int)DuplicateRightType.NORIGHT); } else { var towervo = Common.GetInstance().TowerPassMessage(userextend.npc_refresh_count, ref checkpoint); if (towervo == null) { return; } Common.GetInstance().CheckpointUpdate(checkpoint); CheckpointDarePush(checkpoint.user_id, null, towervo, (int)FightResultType.WIN, checkpoint.blood, (int)DuplicateRightType.NORIGHT); } if (tower == null) { return; } tower.tower_site = 0; tower.Update(); SendMessage(tower.user_id); }
/// <summary> /// 获取npc集合 /// </summary> public List <int> GetNpcList(tg_duplicate_checkpoint model) { var npclist = new List <int>(); if (model == null) { return(npclist); } var towerpass = Variable.BASE_TOWERPASS.FirstOrDefault(m => m.pass == model.site); if (towerpass == null) { return(npclist); } if (towerpass.enemyType == (int)DuplicateEnemyType.FIGHTING) { npclist = NpcsSplit(model); } return(npclist); }
/// <summary>再次进入爬塔界面</summary> /// <param name="checkpoint">爬塔实体</param> /// <param name="ncount">翻将次数</param> /// <param name="fcount">挑战次数</param> /// <param name="enemytype">挑战类型</param> /// <param name="enemyid">挑战对象</param> /// <returns></returns> private ASObject FightAgain(tg_duplicate_checkpoint checkpoint, int ncount, int fcount) { var aso = new ASObject(); var user = tg_user.GetUsersById(checkpoint.user_id); var towerpass = Variable.BASE_TOWERPASS.FirstOrDefault(m => m.pass == checkpoint.site); var rule = Variable.BASE_RULE.FirstOrDefault(m => m.id == "9009"); if (user == null || towerpass == null || rule == null) { return(Error((int)ResultType.NO_DATA)); } var enemytype = towerpass.enemyType; var enemyid = towerpass.enemyId; if (checkpoint.state == (int)DuplicateClearanceType.CLEARANCE_FAIL) //当层通关失败 { if (fcount > 0) { aso = ChallengeAgain(ncount, fcount, enemytype, enemyid, checkpoint); return(aso); } } if (enemytype == (int)DuplicateEnemyType.SMALL_GAME) //验证关卡类型 { aso = CheckPointResult(enemytype, enemyid, checkpoint, ncount, fcount); } else { if (checkpoint.site == Convert.ToInt32(rule.value) && checkpoint.tower_site == Convert.ToInt32(rule.value)) { aso = ReturnWatchMen(user, enemytype, enemyid, checkpoint, ncount, fcount); } else { aso = ReturnNpc(ncount, fcount, checkpoint); } } return(aso); }
/// <summary>返回挑战怪物层或守护者信息</summary> private ASObject ReturnNpc(int ncount, int fcount, tg_duplicate_checkpoint checkpoint) { var towerpass = Variable.BASE_TOWERPASS.FirstOrDefault(m => m.pass == checkpoint.site); var rule = Variable.BASE_RULE.FirstOrDefault(m => m.id == "9009"); if (towerpass == null || rule == null) { return(Error((int)ResultType.BASE_TABLE_ERROR)); } var npcid = Common.GetInstance().GetNpcId(checkpoint); if (Common.GetInstance().CheckWatchmenRight(towerpass.watchmen, checkpoint)) { var tower = tg_duplicate_checkpoint.GetEntityByTowerSite(checkpoint.site); if (tower != null) { var wahtchmen = tg_user.GetUsersById(tower.user_id); var uservo = Common.GetInstance().ConvertUser(wahtchmen); return(new ASObject(Common.GetInstance().BulidData((int)ResultType.SUCCESS, checkpoint, towerpass.enemyType, npcid, ncount, fcount, uservo, checkpoint.dekaron))); } var role = tg_role.GetEntityByUserId(checkpoint.user_id); checkpoint = Common.GetInstance().BecomeTower(role.att_life, checkpoint); if (checkpoint.site == Convert.ToInt32(rule.value)) { var user = tg_user.GetUsersById(checkpoint.user_id); checkpoint.Save(); return(ReturnWatchMen(user, towerpass.enemyType, npcid, checkpoint, ncount, fcount)); } var towervo = Common.GetInstance().TowerPassMessage(ncount, ref checkpoint); Common.GetInstance().CheckpointUpdate(checkpoint); return(new ASObject(Common.GetInstance().BulidData((int)ResultType.SUCCESS, fcount, towervo, null, (int)DuplicateRightType.NORIGHT))); } return(CheckPointResult(towerpass.enemyType, npcid, checkpoint, ncount, fcount)); }