예제 #1
0
 public SkillCastResult(RoleInstance sprite, RoleInstance target, BattleZhaoshiInstance tzhaoshi, int targetx, int targety)
 {
     //self = new SkillCastRoleEffect(sprite);
     r1            = sprite;
     r2            = target;
     zhaoshi       = tzhaoshi;
     skilltarget_x = targetx;
     skilltarget_y = targety;
 }
예제 #2
0
 void InitAllRole()
 {
     //创建所有角色
     foreach (var r in ConfigTable.GetAll <Jyx2Role>())
     {
         var role = new RoleInstance(r.Id);
         _instance.AllRoles.Add(role);
     }
 }
예제 #3
0
        /// <summary>
        /// 返回角色技能的施展距离
        /// </summary>
        /// <param name="zhaoshi"></param>
        /// <param name="source"></param>
        /// <returns></returns>
        public int GetCastSize(BattleZhaoshiInstance zhaoshi, RoleInstance source)
        {
            if (zhaoshi.GetCastSize() == 0)
            {
                return(0);
            }
            var castsize = PreCastSizeAdjust(zhaoshi, source);

            castsize = PostRoleCastSizeAdjust(castsize, source);
            return(castsize);
        }
예제 #4
0
        //判断角色是不是最后一个行动的 如果是最后一个行动的 其实不能等待
        public bool IsLastRole(RoleInstance role)
        {
            int index = Roles.IndexOf(role);

            index++;
            if (index >= Roles.Count)
            {
                return(true);
            }
            RoleInstance nextRole = Roles[index];

            return(nextRole.isActed);
        }
예제 #5
0
 //角色选择之后
 public void OnActioned(RoleInstance role)
 {
     if (role.isWaiting)
     {
         role.isWaiting = false;
         return;
     }
     role.isActed = true;
     role.sp     -= GameConst.ACTION_SP;
     //插入到末尾
     Roles.Remove(role);
     Roles.Add(role);
 }
예제 #6
0
 //增加一个战斗角色
 public void AddBattleRole(RoleInstance role, BattleBlockVector pos, int team, bool isAI)
 {
     role.View.GetAnimator().SetFloat("speed", 0);
     role.BattleModel = this;
     role.Pos         = pos;
     role.team        = team;
     role.isAI        = isAI;
     role.isActed     = false;
     role.isWaiting   = false;
     if (!Roles.Contains(role))
     {
         Roles.Add(role);
     }
 }
예제 #7
0
        RoleInstance GetNextRoleInTurnBase()//回合制
        {
            RoleInstance role = Roles[0];

            while (role.IsDead())
            {
                if (role.View != null)
                {
                    GameObject.Destroy(role.View.gameObject);
                }
                Roles.RemoveAt(0);
                role = Roles[0];
            }

            if (role.isActed) //全部都行动过了
            {
                ResetAct();
                SortRole();
                role = Roles[0];
                return(role);
            }
            return(role);
        }
예제 #8
0
 public AttributeHelper(RoleInstance Owner)
 {
     owner = Owner;
 }
예제 #9
0
        /// <summary>
        /// 获取技能施展范围
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="zhaoshi"></param>
        /// <param name="source"></param>
        /// <returns></returns>
        public List <BattleBlockVector> GetSkillCastBlocks(int x, int y, BattleZhaoshiInstance zhaoshi, RoleInstance source)
        {
            var rst = new List <BattleBlockVector>();

            var castSize = 0;

            //TODO:反击逻辑 by Cherubinxxx
            //if (isFanji)
            //    size = GetFanjiCastSize(zhaoshi, battleRole);
            //else
            castSize = GetCastSize(zhaoshi, source);

            var covertype = zhaoshi.GetCoverType();

            if (covertype == SkillCoverType.LINE || covertype == SkillCoverType.FAN || covertype == SkillCoverType.FRONT)
            {
                foreach (var loc in GetNearBlocks(x, y))
                {
                    rst.Add(new BattleBlockVector(loc.X, loc.Y));
                }
                return(rst);
            }

            rst.Add(new BattleBlockVector(x, y));
            if (castSize == 0)
            {
                return(rst);
            }

            foreach (var loc in GetNearBlocks(x, y, castSize))
            {
                rst.Add(new BattleBlockVector(loc.X, loc.Y));
            }
            return(rst);
        }
예제 #10
0
 /// <summary>
 /// 角色施展技能距离确定前调整距离
 /// </summary>
 /// <param name="castsize"></param>
 /// <param name="source"></param>
 /// <returns></returns>
 public static int PostRoleCastSizeAdjust(int castsize, RoleInstance source)
 {
     return(castsize);
 }
예제 #11
0
        /// <summary>
        /// 角色施展技能前调整距离
        /// </summary>
        /// <param name="zhaoshi"></param>
        /// <param name="source"></param>
        /// <returns></returns>
        public static int PreCastSizeAdjust(BattleZhaoshiInstance zhaoshi, RoleInstance source)
        {
            var castsize = zhaoshi.GetCastSize();

            return(castsize);
        }