Ejemplo n.º 1
0
        ///  <summary>
        /// 验证是否出发地形效果
        ///  </summary>
        ///  <param name="fight"></param>
        ///  <param name="attackrole"></param>
        ///  <param name="rolevo"></param>
        /// <param name="role"></param>
        /// <returns></returns>
        private bool CheckArea(DefenseRoles role, WarFight fight, AttackRoles attackrole, WarFightRoleVo rolevo)
        {
            var type = (int)WarFightSkillType.Area;
            var area = fight.Area.FirstOrDefault(q => q.X == role.X && q.Y == role.Y);

            if (area == null)
            {
                return(false);
            }
            var effectstring = fight.Weather == (int)WeatherType.Rain ? area.raineffect : area.suneffect;

            if (effectstring == "")
            {
                return(false);
            }

            var effects = WarSkillEffect.GetEffectStringInit(effectstring, true);

            if (area.type == (int)AreaType.陷阱)
            {
                type = (int)WarFightSkillType.Trap;
            }
            DefenseRoleEffectsAdd(role, effects, attackrole, rolevo, type);
            fight.Area.Remove(area);
            return(true);
        }
Ejemplo n.º 2
0
        private static WarFightSkill BuildNinjaSkill(int skillid, int level = 1)
        {
            var skill = Variable.BASE_FIGHTSKILL.FirstOrDefault(m => m.id == skillid && m.typeSub == (int)FightSkillType.BATTLES);
            var temp  = Variable.BASE_FIGHTSKILLEFFECT.FirstOrDefault(m => m.skillid == skillid && m.level == level);

            if (skill == null || temp == null)
            {
                return(new WarFightSkill());
            }
            return(new WarFightSkill
            {
                type = skill.type == (int)SkillType.ESOTERICA ? WarFightSkillType.NinjaSkill : WarFightSkillType.NinjaMystery,
                FightSkillEffects = WarSkillEffect.GetEffectStringInit(temp.effects, false),
                effectBaseInfo = BuildData(temp),
                Condition = temp.condition != null?temp.condition.Split('|').ToList() : null,
            });
        }
Ejemplo n.º 3
0
        private static WarFightSkill BuildSkill(int skillid, int level = 1)
        {
            var skill = Variable.BASE_HEZHANSKILL.FirstOrDefault(m => m.id == skillid);
            var temp  = Variable.BASE_HEZHANSKILLEFFECT.FirstOrDefault(m => m.skillid == skillid && m.level == level);

            if (skill == null || temp == null)
            {
                return(new WarFightSkill());
            }
            return(new WarFightSkill
            {
                type = GetType(skill.type),
                FightSkillEffects = WarSkillEffect.GetEffectStringInit(temp.effects, false),
                effectBaseInfo = temp,
                Condition = temp.condition.Split('|').ToList(),
            });
        }