Exemplo n.º 1
0
    public void SetStartingStats()
    {
        assetsLib = GameObject.Find("Assets").GetComponent <AssetsLibrary>();
        //for npc
        if (team == 2)
        {
            float f = gi.wave;

            System.Random random  = new System.Random();
            int           attMult = random.Next(10, 25);
            int           hpMult  = random.Next(10, 25);
            int           defMult = random.Next(10, 25);

            float attLv = (1 + (gi.wave * attMult) / 8) * 1.4f;
            float hpLv  = (1 + (gi.wave * hpMult) / 8) * 1.4f;
            float defLv = (1 + (gi.wave * defMult) / 12) * 1.4f;

            int lv = 0;
            lv = Mathf.RoundToInt(attLv);
            passiveSkills[0].SetLevel(lv);

            lv = Mathf.RoundToInt(hpLv);
            passiveSkills[3].SetLevel(lv);

            lv = Mathf.RoundToInt(defLv);
            passiveSkills[1].SetLevel(lv);

            invStats.SetRandomItemStats();
        }

        CalculateAll();
    }
Exemplo n.º 2
0
    // Use this for initialization
    public void SetTimer()
    {
        pcon      = gameObject.transform.parent.parent.parent.GetComponent <PlayerController>();
        AssetsLib = GameObject.FindGameObjectWithTag("Assets").GetComponent <AssetsLibrary>();
        float cooldownInSeconds = pcon.pinfo.GetAttackTimer();

        attTimer = pcon.pinfo.stats.attackCooldown;
    }
Exemplo n.º 3
0
 public static void UnmarkBars()
 {
     for (int i = 0; i < hiscoreBar.Length; i++)
     {
         AssetsLibrary al = GameObject.FindGameObjectWithTag("Assets").GetComponent <AssetsLibrary>();
         hiscoreBar[i].sprite = al.hiscoreBar[0];
     }
 }
Exemplo n.º 4
0
    public void Activate()
    {
        AssetsLibrary al        = GameObject.FindGameObjectWithTag("Assets").GetComponent <AssetsLibrary>();
        Vector2       placeHere = pinfo.GetPos();

        al.CreateFireball(placeHere);
        StartCooldown();
        pinfo.stats.DecreaseMana(mpCost);
    }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     assetsLib = GameObject.FindGameObjectWithTag("Assets").GetComponent <AssetsLibrary>();
     markBox   = gameObject.transform.GetChild(2).gameObject.GetComponent <SpriteRenderer>();
     trav      = GetComponent <TravelerController>();
     hpcon     = gameObject.transform.GetChild(1).gameObject.GetComponent <HealthbarController>();
     pinfo     = new PlayerInfo(2, hpcon);
     ec        = gameObject.GetComponent <EnemyControllerNew>();
     attTimer  = ec.pinfo.stats.attackCooldown;
     gi.ec.Add(ec);
 }
Exemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        spawner = GameObject.Find("Assets").GetComponent <Spawner>();
        plr     = gameObject.transform.parent.gameObject;
        assets  = GameObject.Find("Assets").GetComponent <AssetsLibrary>();
        if (plr.name == "Player")
        {
            pcon = gameObject.transform.parent.GetComponent <PlayerController>();
        }
        else if (plr.name != "Player")
        {
            ec = gameObject.transform.parent.GetComponent <EnemyControllerNew>();
        }

        spRe = gameObject.GetComponent <SpriteRenderer>();
    }
Exemplo n.º 7
0
    public static void SetTargetUnit(PlayerInfo pinfo, SpriteRenderer markBox)
    {
        AssetsLibrary assetsLib = GameObject.FindGameObjectWithTag("Assets").GetComponent <AssetsLibrary>();

        Target.target = pinfo;

        if (Target.markBox != null)
        {
            Target.markBox.sprite = assetsLib.markBox[0];
        }

        Target.markBox = markBox;

        if (Target.markBox != null)
        {
            markBox.sprite = assetsLib.markBox[1];
        }
    }
Exemplo n.º 8
0
    public void RaiseWave()
    {
        Spawner sp = GetComponent <Spawner>();

        if (sp.enabled == false)
        {
            sp.enabled = true;
        }

        if (gi.canContinue == true)
        {
            sm.RaiseWave();
            pinfo.CalculateAll();
            pinfo.hpCon.RefreshHpBar();
            AssetsLibrary al = gameObject.GetComponent <AssetsLibrary>();
            al.SetContinueButtonStatus(false);
            al.SetSaveButtonStatus(false);
            gi.canContinue = false;
        }
    }
Exemplo n.º 9
0
    // Use this for initialization
    void Start()
    {
        //PlayerController pcon = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>();
        assetsLib = GameObject.FindGameObjectWithTag("Assets").GetComponent <AssetsLibrary>();

        cooldownText[0] = gameObject.transform.GetChild(0).GetChild(1).gameObject.GetComponent <Text>();
        cooldownText[1] = gameObject.transform.GetChild(1).GetChild(1).gameObject.GetComponent <Text>();
        cooldownImg[0]  = gameObject.transform.GetChild(0).GetChild(0).gameObject.GetComponent <Image>();
        cooldownImg[1]  = gameObject.transform.GetChild(1).GetChild(0).gameObject.GetComponent <Image>();

        potCooldownText[0] = gameObject.transform.GetChild(2).GetChild(2).gameObject.GetComponent <Text>();
        potCooldownText[1] = gameObject.transform.GetChild(3).GetChild(2).gameObject.GetComponent <Text>();
        potBlockImg[0]     = gameObject.transform.GetChild(2).GetChild(1).gameObject.GetComponent <Image>();
        potBlockImg[1]     = gameObject.transform.GetChild(3).GetChild(1).gameObject.GetComponent <Image>();

        potAmountText[0] = gameObject.transform.GetChild(2).GetChild(0).gameObject.GetComponent <Text>();
        potAmountText[1] = gameObject.transform.GetChild(3).GetChild(0).gameObject.GetComponent <Text>();

        potionCooldown[0] = new TimerEC(3);
        potionCooldown[1] = new TimerEC(3);

        RefreshPotsAmountText();
    }
Exemplo n.º 10
0
 // Use this for initialization
 void Start()
 {
     pcon      = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>();
     assetsLib = GameObject.Find("Assets").GetComponent <AssetsLibrary>();
     image     = GetComponent <Image>();
 }
Exemplo n.º 11
0
    public static void MarkNewScore(int i)
    {
        AssetsLibrary al = GameObject.FindGameObjectWithTag("Assets").GetComponent <AssetsLibrary>();

        hiscoreBar[i].sprite = al.hiscoreBar[1];
    }
Exemplo n.º 12
0
	// Use this for initialization
	void Start () {
        assetsLib = GameObject.Find("Assets").GetComponent<AssetsLibrary>();
        spr = GetComponent<Image>();
	}
Exemplo n.º 13
0
 void SetRefs()
 {
     assetsLib = GameObject.Find("Assets").GetComponent <AssetsLibrary>();
     pcon      = GameObject.Find("Player").GetComponent <PlayerController>();
     SetItemImageRefs();
 }