Ejemplo n.º 1
0
 public void ShouKanPincer()
 {
     //上场大杀四方
     if (!BuffContrllor.ContainEffect(this, eBuff_Effect.Attack_BAN))
     {
         CheckPincer(0);
     }
 }
    IEnumerator phaseMain1()
    {
        //准备阶段处理
        BuffContrllor.Deal_Effect(Main.Inst, false, eBuffEvent.Phase_Main1);
        yield return(new WaitUntil(Main.Inst.isStageClear));

        yield return(null);
    }
Ejemplo n.º 3
0
    //走棋
    virtual public void moveChess(Chess moving_chess, ChessContainer targetContainer, bool trigger_strike)
    {
        /*  移动耗牌
         * if (Data.MOVE_COST_HANDCARD)
         * {
         * CardContainer cdc;
         * GameObject[] cdcs;
         * ArrayList hand;
         * if (turn_player == ePlayer.Player1)
         * {
         * cdc = cardcont_p1[0].GetComponent<CardContainer>();
         * cdcs = cardcont_p1;
         * hand = player_1.hand_cards;
         * } else
         * {
         * cdc = cardcont_p2[0].GetComponent<CardContainer>();
         * cdcs = cardcont_p2;
         * hand = player_2.hand_cards;
         * }
         * if (cdc.gameObject.transform.childCount <= 0)
         * {
         * return;
         * }
         * Card card = cdc.gameObject.transform.GetChild(0).gameObject.GetComponent<Card>();
         * if (!judgeSelectCard(card))
         * return;
         * removeCard(card);
         * setHand(hand, cdcs);
         * }*/

        moving_chess.container.removeChess();
        targetContainer.appendChess(moving_chess);

        //驱散迷雾 随设计改变而无效
        //BKTools.FogLift(moving_chess.container.number, moving_chess.attribute.spd + GameRule.Default_PvE_Fog_Lift_Range, GameRule.Default_PvE_Fog_Lift_Range, new int[] { (int)moving_chess.belong });
        //攻击
        if (trigger_strike && !BuffContrllor.ContainEffect(moving_chess, eBuff_Effect.Attack_BAN))
        {
            moving_chess.CheckStrike(0);
        }
        //卡牌信息显示
        Main.Inst.clearCardInfo();
        //TODO 流程控制更新
        //		Main.Instance.b_setchess = true;
        //		Main.Instance.now_phase = ePhase.Battle;
        //		Main.Instance.b_phase_trigger = true;//从战斗阶段往主要阶段2

        //清除移动操作暴击
        Main.Inst.b_moving_chess = false;        //应该已经没用了
        Chess.clear_Moveable_Area();
        //清理所有移动标记(上面谁写的,都是错别字!
        foreach (var item in Main.Inst.chess_grids)
        {
            item.Value.clearMoveFlag();
        }

        CheckMoveEvent(moving_chess, nextPhaseDefault);
    }
Ejemplo n.º 4
0
 public void DeadLogicBefore(DeadInfo dead_info)
 {
     belong = dead_info.turn_to.belong;
     BuffContrllor.removeAll(this);
     if (Main.Inst.lv_ctrl.map_data.my_type == eMapType.PvP_2P)
     {
         Main.Inst.overturn_list.Add(this);
         my_state = eChessState.Deading;
     }
 }
Ejemplo n.º 5
0
    void TurnEnd_Buff()
    {
        BuffContrllor.Deal_Effect(Main.Inst, true, eBuffEvent.Phase_End);
//		int buffcount = 0, buff_duration_count = 0;
//		foreach (Chess c in Main.Instance.list_chess) {
//			foreach (BKKZ.Buff item in c.my_buffs) {
//				buffcount++;
//				buff_duration_count += item.my_Duration;
//			}
//		}
    }
    IEnumerator phasePrepare()
    {
        //玩家单位所在地重新驱散一次迷雾 2017年11月25日00:59:19 骑士失去主动驱散迷雾的能力
        //foreach (var item in Main.Inst.dic_chess) {
        //    if (item.Value.belong>ePlayer.None && item.Value.belong<=ePlayer.Player4) {
        //        BKTools.FogLift(item.Value.container.number, item.Value.attribute.spd+GameRule.Default_PvE_Fog_Lift_Range, GameRule.Default_PvE_Fog_Lift_Range,new int[]{(int)item.Value.belong});
        //    }
        //}

        //准备阶段处理
        BuffContrllor.Deal_Effect(Main.Inst, false, eBuffEvent.Phase_Prepare);
        yield return(new WaitUntil(Main.Inst.isStageClear));

        GoNext();
        yield return(null);
    }
Ejemplo n.º 7
0
    IEnumerator CheckLineCoroutine(float delay, bool isStrike)
    {
        Main.Inst.addDancer("checkline");
        yield return(new WaitForSeconds(delay));

        ArrayList search_list = new ArrayList();
        ArrayList result_list = new ArrayList();
        bool      check       = false;
        Chess     partner     = null;

        Main.Inst.b_battbe_phase_pincer_over = true;//偷懒 如果有夹击会自动取消
        for (int i = 0; i < 6; i++)
        {
            check = Main.Inst.dPincers[i](this, belong, ref search_list, ref partner, ref result_list, isStrike);
            if (isStrike)
            {
                partner = this;
            }


            if (search_list.Count > 0 && check)
            {
                if (!BuffContrllor.ContainEffect(partner, eBuff_Effect.Attack_BAN))
                {
                    StartCoroutine(play_pincer_attack(search_list, partner));
                }
            }
            search_list.Clear();
            check = false;
        }
        //         if (result_list.Count>0){
        //             StartCoroutine(OppoList(result_list, partner));
        //             yield return new WaitForSeconds(1);
        //         }
        search_list.Clear();
        result_list.Clear();
        //夹击结束标志,必须等待夹击完成
        //Main.Instance.battbe_phase_pincer_over = true;
        Main.Inst.redDancer("checkline");
        yield return(null);
    }
Ejemplo n.º 8
0
    // Update is called once per frame
    void Update()
    {
        if (list_buffs_add.Count > 0)
        {
            //             BuffAdder[] adds = new BuffAdder[list_buffs_add.Count];
            //             list_buffs_add.CopyTo(adds);
            //             list_buffs_add.Clear();
            //             //异步添加BUFF
            //             foreach (BuffAdder buff_id in adds)
            //             {
            //                 //做法修改后不再需要判断重复
            //     //             if (my_buffs.ContainsKey(buff_id))
            //     //             {
            //     //                 Debug.Log("加buff失败,找不到buff,ID:" + buff_id);
            //     //                 return;
            //     //             } else if (!my_buffs.ContainsKey(buff_id))
            //                 {
            //                     Buff new_buff = new Buff();
            //                     new_buff.stand_side = buff_id.from;
            //                     new_buff.my_buff_info = Data.Inst.buff_data[buff_id.id];
            //                     new_buff.my_Duration = new_buff.my_buff_info.duration;
            //                     my_buffs.Add(new_buff);
            //                     new_buff.owner_ch = this;
            //                     new_buff.owner = this;
            //
            //                     BuffContrllor.analyseBuff_Effect(new_buff, eBuffEvent.Buff_Add);
            //                 }
            //                 Main.Instance.redDancer("chess_buff_adder");
            //             }
            BuffContrllor.addBuff(ref list_buffs_add, this, this, null, "chess_buff_adder");
        }

        //轮流播放特效
        playNextVFX();

        //依次执行ToDoList,完成AI行动
        DealTDList();
    }
Ejemplo n.º 9
0
    virtual public void StartMoveChess(Chess c)
    {
        //if (Main.Inst.Action_Chance>0)
        //{
        //TODO overlay
        //当被施加不可移动BUFF时跳出
        if (BuffContrllor.ContainEffect(c, eBuff_Effect.Move_BAN))
        {
            return;
        }

        Main.Inst.setCardInfo(c.attribute.card_id, c);
        if (c.belong != Main.Inst.turn_player)
        {
            return;
        }

        Chess.clear_Moveable_Area();
        c.show_movable_area();
        Main.Inst.b_moving_chess = true;
        Main.Inst.moving_chess   = c;
        Main.Inst.showUnmovableArea(Main.Inst.turn_player);
        //}
    }