示例#1
0
        public void excAction(m_fight_attack_toc fightVO, Animal src, Animal[] dests, bool isSelf)
        {
            float curTime = Time.time;

            updateFightUnitPos(src,fightVO);
            if (src != null) {
                if (src is Monster) {
                    //(src as Monster).delayAttackKey = LoopManager.setTimeout(attack, actionVO.delay * 33, [src, actionVO.type, fightVO.dir, fightVO.skillid, fightVO.target_id, isSelf]);
                } else {
                    string type = "attack";
                    attack(src, type, fightVO.dir, fightVO.skillid, fightVO.target_id, isSelf);
                }
            }
        }
示例#2
0
 public static Animal[] getDest(m_fight_attack_toc fightVO)
 {
     Animal[] dests = new Animal[fightVO.result.Length];
     p_attack_result result;
     Animal dest;
     int leftHP;
     for (int i = fightVO.result.Length - 1; i >= 0; i--)
     {
         result = fightVO.result[i] as p_attack_result;
         dest = SceneUnitMgr.getUnit(result.dest_id) as Animal;
         if (dest != null) {
             dests[i] = dest;
         }
     }
     return dests;
 }
示例#3
0
 private void onFightWork(m_fight_attack_toc vo)
 {
     throw new NotImplementedException();
 }
示例#4
0
 public void onfight(m_fight_attack_toc vo)
 {
     bool isSelf = (vo.src_id == myRoleID || Math.Floor(vo.src_id / 100) * 100 == myRoleID); //代替vo.return_self
     showFightEffect(vo, isSelf);
 }
示例#5
0
 //更正发起者位置
 private void updateFightUnitPos(SceneUnit src,m_fight_attack_toc fightVO)
 {
     if (src != null && fightVO.src_pos > 0) { //更正发起者位置
         Vector3 pos = new Vector3();
         pos = TileUitls.getFlatCenterByPosWithVertor3(fightVO.src_pos,pos);
         src.resetPos(pos);
     }
 }
示例#6
0
 private void showFightEffect(m_fight_attack_toc fightVO, bool isSelf)
 {
     Animal src = FightMgr.getSrc(fightVO); //施法者
     Animal[] dests = FightMgr.getDest(fightVO); //受创者数组
     excAction(fightVO, src, dests, isSelf);
     //excEffect(fightVO, src, dests, isSelf);
 }
示例#7
0
 public static Animal getSrc(m_fight_attack_toc fightVO)
 {
     return SceneUnitMgr.getUnit(fightVO.src_id) as Animal;
 }