Beispiel #1
0
 /// <summary>
 /// 边格挡发生时,给与怪物防御值的伤害,如果怪物死亡,回复全部魔力
 /// </summary>
 /// <param name="sorce"></param>
 void doFireRoad(Defen defen)
 {
     //防御怪物攻击时,给与节点魔力5倍的伤害,如果怪物死亡,回复全部魔力
     if (defen.plID > 0 && defen.plID < magic.getPoint().Count)
     {
         magic.doAttackToMonster(defen.sorce, 1, 5 * magic.getPoint(defen.plID).MaxMagic);
         if (!magic.isMonsterLive(defen.sorce))
         {
             magic.getPoint(defen.plID).magic = magic.getPoint(defen.plID).MaxMagic;
         }
     }
 }
Beispiel #2
0
 // Update is called once per frame
 void Update()
 {
     //判断状态,确定节点是否显示,以及其魔力值等
     if (magic.getPoint(id).MaxMagic == 0)
     {
         spriteRenderer.sprite = null;
     }
     else if (!magic.getPointBroked(id))
     {
         textMesh.text = magic.getPoint(id).MaxMagic.ToString();
     }
     //节点颜色初始化
     spriteRenderer.color = toPointColor(magic.getPointColor(id));
 }
 // Update is called once per frame
 void Update()
 {
     //判断状态,确定节点是否显示,以及其魔力值等
     if (magic.getPoint(id).MaxMagic == 0)
     {
         Color color = toPointColor(magic.getPointColor(id));
         spriteRenderer.color = new Color(color.r, color.g, color.b, 0.5f);
     }
     else if (!magic.getPointBroked(id))
     {
         spriteRenderer.color = toPointColor(magic.getPointColor(id));
         textMesh.text        = magic.getPoint(id).MaxMagic.ToString();
     }
     //节点颜色初始化
 }
Beispiel #4
0
    public void InitLine()
    {
        List <Line>  lineList = magic.getLine();
        List <Point> Plist    = magic.getPoint();

        foreach (Line l in lineList)
        {
            //获取两端节点
            int p1 = l.p1;
            int p2 = l.p2;
            //查询节点坐标
            Vector3 pos1 = GameObject.FindGameObjectWithTag(p1.ToString()).transform.position;
            Vector3 pos2 = GameObject.FindGameObjectWithTag(p2.ToString()).transform.position;
            //生成线
            linePerb.GetComponent <LineRenderer>().SetPosition(0, pos1);
            linePerb.GetComponent <LineRenderer>().SetPosition(1, pos2);


            GameObject lineP = GameObject.Instantiate(linePerb);
            lineP.gameObject.layer = 8;
            lineP.transform.parent = lines.transform;
            lineP.SetActive(false);
            lineGameObjectlist.Add(lineP);

            if (Plist[p1].MaxMagic != 0 && Plist[p2].MaxMagic != 0)
            {
                lineP.SetActive(true);
            }
        }
    }
Beispiel #5
0
    // Update is called once per frame
    void Update()
    {
        magic = MagicCore.Instance;
        pList = magic.getPoint();

        pointStatus();
        //判断状态,确定节点是否显示,以及其魔力值等
        if (magic.getPoint(int.Parse(this.tag)).MaxMagic == 0)
        {
            this.GetComponent <SpriteRenderer>().sprite = null;
        }
        else if (!magic.getPointBroked(int.Parse(this.tag)))
        {
            this.GetComponentInChildren <TextMesh>().text =
                magic.getPoint(int.Parse(this.tag)).magic + "/" + magic.getPoint(int.Parse(this.tag)).MaxMagic;
            this.GetComponent <SpriteRenderer>().sprite = oldSprite;
        }
        //节点颜色初始化
        this.GetComponent <SpriteRenderer>().color = toPointColor(magic.getPointColor(int.Parse(this.tag)));
        if (magic.isDefencer(int.Parse(this.tag)))
        {
            this.GetComponent <SpriteRenderer>().color = Color.gray;
        }
        //当前节点变大
        if (magic.getPos() == int.Parse(this.tag))
        {
            this.transform.localScale = new Vector3(5, 5, 0);
        }
        else
        {
            this.transform.localScale = new Vector3(3, 3, 0);
        }

        //空白处按右键,取消所有操作
        if (Input.GetMouseButton(1) && Clickcontrol.isDrag)
        {
            magic.RclickP(-1);
            Clickcontrol.isDrag = false;
        }
    }
Beispiel #6
0
    // Use this for initialization
    void Start()
    {
        magic = MagicCore.Instance;
        lineGameObjectlist  = new List <GameObject>();
        pointGameObjectlist = new List <GameObject>();
        instance            = node;
        lineList            = magic.getLine();
        Plist = magic.getPoint();
        //初始化节点位置
        InitPointPos();

        //初始化连线
        InitLine();

        //初始化花纹
        InitFigure();
    }
Beispiel #7
0
 public void alchemyE(Move m)
 {
     if (magiccore.getPoint(m.pEnd) != magiccore.getPoint(m.pStart))
     {
         doingbuff.count += 1;
         if (doingbuff.count == doingbuff.maxCount)
         {
             int dam;
             dam = 8;
             magiccore.doAOEToMonster(dam, 1);
             doingbuff.count = 0;
         }
     }
 }//炼金阵,可用
Beispiel #8
0
    /// <summary>
    /// 冰封装甲:为施法路径上的所有节点添加保护状态
    /// </summary>
    /// <param name="magic"></param>
    void FrostArmor(ref Magic magic)
    {
        int pS = magic.magicRoute[0];
        int pE = magic.magicRoute[1];

        List <Move>  route = magicCore.getRoute();
        List <Point> plist = magicCore.getPoint();

        for (int i = pS; i <= pE; ++i)
        {
            int pindex = route[i].pEnd;
            plist[pindex].isProtected = true;
        }
    }
Beispiel #9
0
    // Update is called once per frame
    void Update()
    {
        magic = MagicCore.Instance;
        pList = magic.getPoint();



        //判断状态,确定节点是否显示,以及其魔力值等
        if (magic.getPoint(int.Parse(this.tag)).MaxMagic == 0)
        {
            this.GetComponent <SpriteRenderer>().sprite = null;
        }
        else if (!magic.getPointBroked(int.Parse(this.tag)))
        {
            this.transform.GetChild(0).GetComponent <TextMesh>().text =
                magic.getPoint(int.Parse(this.tag)).magic.ToString();
            if (magic.getPoint(int.Parse(this.tag)).isProtected)
            {
                this.transform.GetChild(0).GetComponent <TextMesh>().color = Color.blue;
            }
            else
            {
                this.transform.GetChild(0).GetComponent <TextMesh>().color = Color.white;
            }
            this.GetComponent <SpriteRenderer>().sprite = oldSprite;
        }

        pointStatus();

        //节点颜色初始化
        this.GetComponent <SpriteRenderer>().color = toPointColor(magic.getPointColor(int.Parse(this.tag)));
        if (magic.getPoint(int.Parse(this.tag)).isActivity)
        {
            if (magic.getPointColor(int.Parse(this.tag)) == PointColor.black)
            {
                this.transform.GetChild(1).localScale = new Vector3(0.05f, 0.05f, 0);
            }
            if (magic.getPointColor(int.Parse(this.tag)) == PointColor.blue)
            {
                this.transform.GetChild(2).localScale = new Vector3(0.05f, 0.05f, 0);
            }
            if (magic.getPointColor(int.Parse(this.tag)) == PointColor.red)
            {
                this.transform.GetChild(3).localScale = new Vector3(0.05f, 0.05f, 0);
            }
            if (magic.getPointColor(int.Parse(this.tag)) == PointColor.white)
            {
                this.transform.GetChild(4).localScale = new Vector3(0.05f, 0.05f, 0);
            }
            if (magic.getPointColor(int.Parse(this.tag)) == PointColor.yellow)
            {
                this.transform.GetChild(5).localScale = new Vector3(0.05f, 0.05f, 0);
            }
        }
        else
        {
            this.transform.GetChild(1).localScale = new Vector3(0, 0, 0);
            this.transform.GetChild(2).localScale = new Vector3(0, 0, 0);
            this.transform.GetChild(3).localScale = new Vector3(0, 0, 0);
            this.transform.GetChild(4).localScale = new Vector3(0, 0, 0);
            this.transform.GetChild(5).localScale = new Vector3(0, 0, 0);
        }
        if (magic.isDefencer(int.Parse(this.tag)))
        {
            this.GetComponent <SpriteRenderer>().color = Color.gray;
        }

        if (magic.getFlag() != ClickFlag.wait)
        {
            ////当前节点变大
            //if (magic.getPos() == int.Parse(this.tag))
            //    this.transform.localScale = new Vector3(3, 3, 0);
            //else
            //    this.transform.localScale = new Vector3(2, 2, 0);
        }

        //空白处按右键,取消所有操作
        if (Input.GetMouseButton(1) && Clickcontrol.isDrag)
        {
            magic.RclickP(-1);
            Clickcontrol.isDrag = false;
        }
    }
Beispiel #10
0
    public void InitLine()
    {
        List <Line>  lineList = magic.getLine();
        List <Point> Plist    = magic.getPoint();

        foreach (Line l in lineList)
        {
            //获取两端节点
            int p1 = l.p1;
            int p2 = l.p2;
            //查询节点坐标
            Vector3 pos1 = GameObject.FindGameObjectWithTag(p1.ToString()).transform.position;
            Vector3 pos2 = GameObject.FindGameObjectWithTag(p2.ToString()).transform.position;
            //生成线
            linePerb.GetComponent <LineRenderer>().SetPosition(0, pos1);
            linePerb.GetComponent <LineRenderer>().SetPosition(1, pos2);

            linePerb.GetComponentInChildren <ParticleSystem>().Pause();
            GameObject lineP = GameObject.Instantiate(linePerb);
            lineP.transform.parent = lines.transform;

            lineGameObjectlist.Add(lineP);
        }

        //特效测试
        for (int i = 0; i < 6; ++i)
        {
            Line l = lineList[i];
            EFController.Instance.NewLineCreatAnimation(pointGameObjectlist[l.p1], pointGameObjectlist[l.p2], lineGameObjectlist[i], 0, 30);
        }
        for (int i = 6; i < 24; ++i)
        {
            Line l = lineList[i];
            EFController.Instance.NewLineCreatAnimation(pointGameObjectlist[l.p1], pointGameObjectlist[l.p2], lineGameObjectlist[i], 40, 25);
        }
        for (int i = 24; i < 39; ++i)
        {
            Line l = lineList[i];
            EFController.Instance.NewLineCreatAnimation(pointGameObjectlist[l.p1], pointGameObjectlist[l.p2], lineGameObjectlist[i], 75, 20);
        }

        EFController.Instance.NewRingCreatAnimation(nodes.transform.GetChild(0).gameObject, 105, 25, 0.95f, 0.8f);
        //if(magic.getPoint(16).MaxMagic > 0 || magic.getPoint(17).MaxMagic > 0 || magic.getPoint(18).MaxMagic > 0)
        EFController.Instance.NewRingCreatAnimation(nodes.transform.GetChild(1).gameObject, 100, 25, 2.4f, 0.8f);
    }