Example #1
0
 public void Out()
 {
     Skill1.GetComponent <SkillSet> ().UseThis(false);
     Skill2.GetComponent <SkillSet> ().UseThis(false);
     Skill3.GetComponent <SkillSet> ().UseThis(false);
     Skill4.GetComponent <SkillSet> ().UseThis(false);
 }
    // Use this for initialization
    void Awake()
    {
        Instance      = this;
        shootFireBall = GetComponentInChildren <ShootFireBall> ();

        playerHealth   = GetComponent <PlayerHealth> ();
        playerMana     = GetComponent <PlayerMana> ();
        playerMovement = GetComponent <PlayerMovement> ();
        orbControl     = GetComponentInChildren <OrbControl> ();
        skill1Text     = Skill1.GetComponentsInChildren <Text> ();
        skill2Text     = Skill2.GetComponentsInChildren <Text> ();
        skill3Text     = Skill3.GetComponentsInChildren <Text> ();
        skill1Image    = Skill1.GetComponentInChildren <Image> ();
        skill2Image    = Skill2.GetComponentInChildren <Image> ();
        skill3Image    = Skill3.GetComponentInChildren <Image> ();
        skill1Button   = Skill1.GetComponent <Button> ();
        skill2Button   = Skill2.GetComponent <Button> ();
        skill3Button   = Skill3.GetComponent <Button> ();

        skillValues.Add(new KeyValuePair <string, int> ("Explosion Size", 1));
        skillValues.Add(new KeyValuePair <string, int> ("FireBolt Damage", 1));
        skillValues.Add(new KeyValuePair <string, int> ("FireBall", 0));
        skillValues.Add(new KeyValuePair <string, int> ("Health Up", 1));
        skillValues.Add(new KeyValuePair <string, int> ("Mana Up", 1));
        skillValues.Add(new KeyValuePair <string, int> ("Mana Recovery Rate", 1));
        skillValues.Add(new KeyValuePair <string, int> ("Walking Speed", 1));

        skillText = new string[] { "Radius +0.5 \r\nMana Cost +0.1", "SpellDamage +10 \r\nManaCost +0.2",
                                   "New Skill: FireBall\r\nPress 1 to use", "Max Health +20", "Max Mana +20", "Recovery Rate +0.2", "Speed +0.2" };

        eventAdded   = false;
        currentLevel = 1;
    }
Example #3
0
 void Reset()
 {
     HPBar.sprite = (ControlRole == 0) ? HPBar1 : HPBar2;
     Skill1.GetComponent <MSBC>().SetInfo(ControlRole);
     Skill2.GetComponent <MSBC>().SetInfo(ControlRole);
     Skill3.GetComponent <MSBC>().SetInfo(ControlRole);
     ba.Ability = (ControlRole == 0) ? Ability1 : Ability2;
 }
Example #4
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetMouseButtonDown(0) && ClickAttack != null)
     {
         PlayerStatus.MainAttack = ClickAttack;
     }
     if (Input.GetKeyDown(KeyCode.Q) && Skill1.GetComponent <SkillSet>().CanUse)
     {
         Skill1.GetComponent <SkillSet> ().UseThis(true);
         PlayerStatus.MainAttack = Skill1;
     }
     else if (Input.GetKeyDown(KeyCode.E) && Skill2.GetComponent <SkillSet>().CanUse)
     {
         Skill2.GetComponent <SkillSet> ().UseThis(true);
         PlayerStatus.MainAttack = Skill2;
     }
     else if (Input.GetKeyDown(KeyCode.R) && Skill3.GetComponent <SkillSet>().CanUse)
     {
         Skill3.GetComponent <SkillSet> ().UseThis(true);
         PlayerStatus.MainAttack = Skill3;
     }
 }
    void Awake()
    {
        k_Manager = this;

        plantedFriends      = new List <List <int> > ();
        currentSkillList    = new List <GameObject> ();
        listedSkillManagers = new List <GameObject> ();

        playersOnline = new List <PlayerOnline> ();
        ItemImages    = Resources.LoadAll <Sprite>("RPG_inventory_icons");
        Backgrounds   = Resources.LoadAll <Sprite>("Backgrounds");

//		Stats = GameObject.FindGameObjectWithTag ("Stats");
//		PositionOverview = GameObject.FindGameObjectWithTag ("Positions");

//		Inventorys = GameObject.FindGameObjectWithTag ("InventorySlot");
//		CharacterSlot = GameObject.FindGameObjectWithTag ("CharacterSlots");
//		BackpackSlot = GameObject.FindGameObjectWithTag ("Backpack");
        k_player = GameObject.FindGameObjectWithTag("Player");
        k_player.GetComponent <Player> ().sceneloaded = true;
        pre_Item           = Resources.Load("Item") as GameObject;
        pre_FriendPosition = Resources.Load("FriendPositionImage") as GameObject;

        currentCharacter = k_player.GetComponent <Player> ().Characters [0];

        if (k_player.gameObject.GetComponent <Player>().OutstandingLoot.Count > 0)
        {
            LootPanel.SetActive(true);
            ApplyLoot();
        }

        Skills     = new GameObject[4];
        Skills [0] = Skill1;
        Skill1.GetComponent <SkillManager> ().id = 0;
        Skills [1] = Skill2;
        Skill2.GetComponent <SkillManager> ().id = 1;
        Skills [2] = Skill3;
        Skill3.GetComponent <SkillManager> ().id = 2;
        Skills [3] = Skill4;
        Skill4.GetComponent <SkillManager> ().id = 3;

        Positions = new GameObject[17];

        for (int i = 0; i < PositionOverview.transform.childCount; i++)
        {
            Positions [i] = PositionOverview.transform.GetChild(i).gameObject;
        }
        Positions [16] = GameObject.FindGameObjectWithTag("CharacterPositionSlot");

        InventorySlots = new GameObject[36];
        for (int i = 0; i < Inventorys.transform.childCount; i++)
        {
            InventorySlots [i] = Inventorys.transform.GetChild(i).gameObject;
        }

        CharacterSlots = new GameObject[10];
        for (int i = 1; i < CharacterSlot.transform.childCount - 1; i++)
        {
            CharacterSlots [i - 1] = CharacterSlot.transform.GetChild(i).gameObject;
        }

        BackpackSlots = new GameObject[8];
        for (int i = 0; i < BackpackSlot.transform.childCount; i++)
        {
            BackpackSlots [i] = BackpackSlot.transform.GetChild(i).gameObject;
        }

        pre_PlayerOnline = Resources.Load("PlayerOnline") as GameObject;
        PlayerPanel      = GameObject.FindGameObjectWithTag("PlayerOnline");

        SkillList = new GameObject[10];

        SkillList [0] = Skill_Start;
        SkillList [1] = Skill_First1;
        SkillList [2] = Skill_First2;
        SkillList [3] = Skill_Second1;
        SkillList [4] = Skill_Second2;
        SkillList [5] = Skill_Third1;
        SkillList [6] = Skill_Third2;
        SkillList [7] = Skill_Ultimate1;
        SkillList [8] = Skill_Ultimate2;
        SkillList [9] = Skill_Ultimate3;

        InstantiateItems();
        InstatiatePositionItems();

        this.SkillPoints = 20;

        SkillStats = new GameObject[4];

        for (int i = 0; i < SkillStats.Length; i++)
        {
            SkillStats [i] = SkillStat.transform.GetChild(i).gameObject;
        }
    }