Exemple #1
0
    } //旅人的怀表,可用

    public void Avalon(Move m)
    {
        int   pos;
        Point p;

        pos = magiccore.getPos();
        p   = magiccore.getPoint(pos);
        if (p.color == PointColor.blue)
        {
            magiccore.setHP(magiccore.getHP() + 2);
        }
    }  //阿瓦隆,可用
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        //显示ATK和DEF
        ATK.GetComponent <Text>().text = "ATK: " + magic.getATK().ToString();
        DEF.GetComponent <Text>().text = "DEF: " + magic.getDEF().ToString();
        HP.GetComponent <Text>().text  = "HP:" + magic.getHP().ToString();
        //测试monster,获取血量等
        monster0.GetComponentInChildren <Text>().text = monster0.GetComponent <Monster>().monsterHP.ToString();
        //绘制连线颜色
        drawLineColor();

        //设定skill的内容
        skillContent();

        //设定skill的状态
        skillStatus();

        //检查线上的信息
        lineStatus();

        //监听函数
        if (magic.getFlag() == ClickFlag.defencer)
        {
            startButton.GetComponent <Image>().color = Color.green;
        }
        else
        {
            startButton.GetComponent <Image>().color = Color.red;
        }

        //说明框位置跟随
        showState.transform.position =
            new Vector3((int)Input.mousePosition.x - (int)width * showState.transform.localScale.x / 2 + 0.1f,
                        (int)Input.mousePosition.y + (int)height * showState.transform.localScale.y / 2 + 0.1f, 0);

        //检测怪物是否活着
        for (int i = 0; i < 4; ++i)
        {
            if (magic.isMonsterLive(i))
            {
                break;
            }
            if (i == 3 && !isShow)
            {
                gameOver.SetActive(true);
                GameObject.Find("tool").GetComponentInChildren <Text>().text = Ibuff.iName.ToString();
                isShow = true;
            }
        }
        if (overCount == 0)
        {
            overCount = -1;
            MapMain.Instance.SceneEnd(true);
            canvas.SetActive(false);
        }
    }
Exemple #3
0
 void Exit()
 {
     if (mc.getHP() < 0)
     {
         showLast.GetComponentInChildren <Text>().text = "你的生命值太低了,已经死亡了!";
         Invoke("dead", 2);
     }
     else
     {
         this.gameObject.SetActive(false);
         MapMain.Instance.SceneEnd(true);
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (mc == null)
     {
         mc = MagicCore.Instance;
     }
     if (Hp != null)
     {
         Hp.text = mc.getHP().ToString();
     }
     if (Attack != null)
     {
         Attack.text = mc.getMaxATK().ToString();
     }
     if (Defend != null)
     {
         Defend.text = mc.getMaxDEF().ToString();
     }
 }
 public void ChoseThree()
 {
     //TODO
     //增加攻击的接口
     MC.setHP(MC.getHP() - 15);
 }
 public void ChoseTwo()
 {
     MC.setHP(MC.getHP() - bloodRedeuce2);
     Debug.Log("2");
 }
Exemple #7
0
 /// <summary>
 /// 回合开始时,ATK + 3,HP - 3,永久发动
 /// </summary>
 void doPotency()
 {
     magic.setATK(magic.getATK() + 3);
     magic.setHP(magic.getHP() - 3);
 }
Exemple #8
0
 /// <summary>
 /// 愤怒:伤害倍率随着生命值降低升高
 /// </summary>
 /// <param name="magic"></param>
 void beS9(ref Magic magic)
 {
     magic.skill.addcount = (int)((float)magicCore.getHP() / (float)magicCore.getMaxHP() * 10.0f);
 }
Exemple #9
0
    // Update is called once per frame
    void Update()
    {
        //显示ATK
        ATK.GetComponent <Text>().text = "ATK: " + magic.getATK().ToString();
        HP.GetComponent <Text>().text  = "HP:" + magic.getHP().ToString();
        //测试monster,获取血量等
        //monster0.GetComponentInChildren<Text>().text = monster0.GetComponent<Monster>().monsterHP.ToString();
        //绘制连线颜色
        drawLineColor();

        //设定skill的内容
        skillContent();

        //设定skill的状态
        skillStatus();

        //检查线上的信息
        lineStatus();

        //设定节点位置指示器
        mPosDetect.transform.position = pointGameObjectlist[magic.getPos()].transform.position;

        //监听函数
        if (magic.getFlag() == ClickFlag.defencer)
        {
            startButton.GetComponent <Image>().color         = Color.green;
            startButton.GetComponentInChildren <Text>().text = "冥想";
        }
        else
        {
            startButton.GetComponent <Image>().color         = Color.red;
            startButton.GetComponentInChildren <Text>().text = "防御";
        }

        //检测怪物是否活着
        for (int i = 0; i < 4; ++i)
        {
            if (magic.isMonsterLive(i))
            {
                break;
            }
            if (i == 3 && !isShow)
            {
                Sprite   nowSprite   = new Sprite();
                string[] lines       = Itemtext.text.Split("\n"[0]);
                string   englishName = null;
                for (int j = 0; j < lines.Length; ++j)
                {
                    string[] parts = lines[j].Split(" "[0]);
                    if (parts[1] == Ibuff.iName.ToString())
                    {
                        englishName = parts[0];
                        break;
                    }
                }
                //foreach (Sprite sp in LoadResources.Instance.itemSp.itemSprite)
                //{
                //    if (sp.name == englishName)
                //    {
                //        nowSprite = sp;
                //    }
                //}
                nowSprite = LoadResources.Instance.itemSp.nameToSprite(englishName);
                gameOver.SetActive(true);
                GameObject.Find("tool").GetComponentInChildren <Text>().text  = Ibuff.iName.ToString();
                GameObject.Find("tool (1)").GetComponent <Image>().sprite     = nowSprite;
                GameObject.Find("skill").GetComponentInChildren <Text>().text = sklist.name.ToString();
                isShow = true;
            }
        }
        if (overCount == 0)
        {
            overCount = -1;
            MapMain.Instance.SceneEnd(true);
            canvas.SetActive(false);
        }


        //检测人物是否活着
        if (magic.getHP() <= 0)
        {
            GameObject.Find("Death").transform.localScale = new Vector3(1, 1, 1);
            Destroy(GameObject.Find("Canvas"));
            magic.initMagic();
        }


        //控制特效刷新
        EFController.Instance.Update();

        //道具查看与更新
        itemupdate();
        //更新buff
        buffupdate();

        //刷新怪物血量
        for (int i = 0; i < monsterList.transform.childCount; ++i)
        {
            if (magic.isMonsterLive(i))
            {
                monsterList.transform.GetChild(i).GetComponentInChildren <Text>().text =
                    magic.getMonsterList()[int.Parse(monsterList.transform.GetChild(i).name)].monsterHP.ToString();
            }
            else
            {
                monsterList.transform.GetChild(i).GetComponentInChildren <Text>().text = "0";
            }
        }
    }