예제 #1
0
    public void Awake()
    {
        gameplay      = Gameplay.Instance();
        tavern        = Tavern.Instance();
        mousePosition = MousePosition.Instance();
        infoPopup     = InfoPopup.Instance();

        selected = false;
    }
예제 #2
0
    public void LoadTavernInformation()
    {
        ClearInformation();

        EnablePopup();

        txtName.text      = "Tavern";
        txtLevel.text     = "LV " + Tavern.Instance().level.ToString();
        txtDamage.text    = "Cost to Level";
        txtSpeed.text     = "Up the tavern";
        txtAbilities.text = Tavern.Instance().levelUpCost.ToString() + " Gold";
    }
예제 #3
0
    public void LoadHeroInformation(int argument)
    {
        ClearInformation();

        EnablePopup();

        tavernLevel = Tavern.Instance().level;

        XMLNode heroXML = heroesXML[argument] as XMLNode;

        string className = heroXML.GetValue("@class");

        XMLNode levelXML = heroXML.GetNodeList("levels>0>level")[tavernLevel] as XMLNode;

        Debug.Log(className);

        txtRange.text  = "Range: " + levelXML.GetValue("@range");
        txtDamage.text = "Damage: " + levelXML.GetValue("@damage");
        txtSpeed.text  = "Speed: " + levelXML.GetValue("@speed");
        txtHealth.text = "Health: " + levelXML.GetValue("@health");
        txtLevel.text  = "LV " + tavernLevel.ToString();
        txtName.text   = className;
    }
예제 #4
0
    public void Birth(string target)
    {
        activated = false;
        canPoison = false;

        gameplay = Gameplay.Instance();

        tavern = Tavern.Instance();

        strJob = target;

        AssignClass();

        transform.Find("Collider").GetComponent <BoxCollider>().enabled = false;

        XMLNodeList heroesXML = gameplay.xml.GetNodeList("doc>0>units>0>heroes>0>hero");

        heroXML = heroesXML[intJob] as XMLNode;

        levelsXML = heroXML.GetNodeList("levels>0>level");

        transform.parent = GameObject.Find("Heroes").transform;

        safe = false;

        status = "Fine";

        maxNumberOfTargets = 1;
        focusIndex         = 0;

        clericHealCooldown = 90;
        battlecryCooldown  = 360;
        stealthCooldown    = 360;

        transform.position = new Vector3(mousePosition.x, mousePosition.y + 60f, -20f);

        lv = Tavern.Instance().level - 1;
        LevelUp();

        firstName = firstNames[intJob, Random.Range(0, firstNames.GetLength(1))];
        lastName  = lastNames[intJob, Random.Range(0, lastNames.GetLength(1))];

        GameObject obj;

        obj = Instantiate(Resources.Load("CI", typeof(GameObject)) as GameObject) as GameObject;
        obj.transform.parent        = transform;
        obj.transform.localPosition = Vector3.zero;

        TextMesh textMesh;

        textMesh      = obj.transform.Find("Name").GetComponent <TextMesh>();
        textMesh.text = firstName + " " + lastName;

        healthBar      = obj.transform.Find("Health/Bar").gameObject;
        healthBarWidth = healthBar.transform.localScale.x;

        gameplay.heroes.Add(this);
        index = gameplay.heroes.IndexOf(this);

        name = name.Split("("[0])[0];
    }