Пример #1
0
    public override void ApplyMomentoData(object obj)
    {
        if (obj != null)
        {
            GameObject go = (GameObject)obj;
            if (go != null)
            {
                ResourceDependentObject resourceComp = go.GetComponent <ResourceDependentObject>();
                Backpack     backPackComp            = go.GetComponent <Player>().BackPack;
                PlayerSkills pSkills = go.GetComponent <Player>().PlayerSkills;

                if (resourceComp != null && backPackComp != null && pSkills != null)
                {
                    resourceComp.MyResourceStore = mResourceStore;

                    pSkills = mPlayerSkills;

                    // Repopulate the inventory items.
                    for (int i = 0; i < mBackPack.Count; i++)
                    {
                        backPackComp.Pouches[i].InventoryItems = mBackPack[i];
                        backPackComp.Pouches[i].Slots          = mBackPack[i].Count;
                    }
                    base.ApplyMomentoData(resourceComp.gameObject);
                }
            }
        }
    }
Пример #2
0
 public PlayerMomento()
 {
     mResourceStore = new List <ResourceStore>();
     mBackPack      = new List <List <InventoryItem> >();
     mPrefabName    = sPrefabName;
     mPlayerSkills  = new PlayerSkills();
 }
Пример #3
0
    public override void UpdateMomentoData(object obj, string prefabName)
    {
        if (obj != null)
        {
            GameObject go = (GameObject)obj;
            if (go != null)
            {
                ResourceDependentObject resourceComp = go.GetComponent <ResourceDependentObject>();
                Backpack backPackComp = go.GetComponent <Player>().BackPack;
                mPlayerSkills = go.GetComponent <Player>().PlayerSkills;

                if (resourceComp != null && backPackComp != null)
                {
                    mResourceStore = resourceComp.MyResourceStore;

                    // Copy over the inventory items.
                    mBackPack = new List <List <InventoryItem> >();
                    for (int i = 0; i < backPackComp.Pouches.Count; i++)
                    {
                        mBackPack.Add(backPackComp.Pouches[i].InventoryItems);
                    }

                    base.UpdateMomentoData(go, prefabName);
                }
            }
        }
    }
Пример #4
0
    public List <PlayerSkill> survivingSkills = new List <PlayerSkill>();   // Player surviving skills. This is the static reference used by all the other components.

    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
    }
Пример #5
0
    void UpdateSkillsResources()
    {
        skillsGroup.GetChild(0).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentContractsTier().ToString();
        skillsGroup.GetChild(0).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextContractsUpgradeCostsAsString();

        skillsGroup.GetChild(1).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentCurrencyTier().ToString();
        skillsGroup.GetChild(1).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextCurrencyUpgradeCostsAsString();

        skillsGroup.GetChild(2).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentEfficiencyTier().ToString();
        skillsGroup.GetChild(2).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextEfficiencyUpgradeCostsAsString();

        skillsGroup.GetChild(3).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentEnergyTier().ToString();
        skillsGroup.GetChild(3).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextEnergyUpgradeCostsAsString();

        skillsGroup.GetChild(4).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentBuildingMaterialsTier().ToString();
        skillsGroup.GetChild(4).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextBuildingMaterialsUpgradeCostsAsString();

        skillsGroup.GetChild(5).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentToolPartsTier().ToString();
        skillsGroup.GetChild(5).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextToolPartsUpgradeCostsAsString();

        skillsGroup.GetChild(6).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentBookPagesTier().ToString();
        skillsGroup.GetChild(6).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextBookPagesUpgradeCostsAsString();

        skillsGroup.GetChild(7).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentLumberTreesTier().ToString();
        skillsGroup.GetChild(7).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextLumberTreesUpgradeCostsAsString();

        skillsGroup.GetChild(8).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentLumberLogsTier().ToString();
        skillsGroup.GetChild(8).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextLumberLogsUpgradeCostsAsString();

        skillsGroup.GetChild(9).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentLumberFirewoodTier().ToString();
        skillsGroup.GetChild(9).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextLumberFirewoodUpgradeCostsAsString();
    }
Пример #6
0
        private void PlayerSkills_OnExperienceChanged_Global(PlayerSkills skills, uint experience)
        {
            var player = GetUnturnedPlayer(skills.player) !;
            var @event = new UnturnedPlayerExperienceUpdatedEvent(player, experience);

            Emit(@event);
        }
Пример #7
0
    private void OnEnable()
    {
        // Reload skills database
        SkillDatabase.LoadSkills();
        skillNames = SkillDatabase.FindSkills(string.Empty);

        PlayerSkills  playerSkills      = target as PlayerSkills;
        List <string> invalidSkillNames = new List <string>();

        if (playerSkills.skillNames == null)
        {
            playerSkills.skillNames = new string[0];
        }
        foreach (string skillName in playerSkills.skillNames)
        {
            if (skillNames.Contains(skillName))
            {
                skillNames.Remove(skillName);
            }
            else
            {
                invalidSkillNames.Add(skillName);
            }
        }
        List <string> newSkillNames = new List <string>();

        newSkillNames.AddRange(playerSkills.skillNames);
        foreach (string invalidSkillName in invalidSkillNames)
        {
            newSkillNames.Remove(invalidSkillName);
        }
        playerSkills.skillNames = newSkillNames.ToArray();
    }
Пример #8
0
    void Update()
    {
        GameObject player = Player.player;

        if (!player)
        {
            return;
        }

        PlayerSkills skills = player.GetComponent <PlayerSkills>();

        // instantiate/destroy enough slots
        UIUtils.BalancePrefabs(slotPrefab.gameObject, skills.buffs.Count, transform);

        // refresh all
        for (int i = 0; i < skills.buffs.Count; ++i)
        {
            UIBuffSlot slot = transform.GetChild(i).GetComponent <UIBuffSlot>();

            // refresh
            slot.image.color     = Color.white;
            slot.image.sprite    = skills.buffs[i].image;
            slot.tooltip.text    = skills.buffs[i].ToolTip();
            slot.slider.maxValue = skills.buffs[i].buffTime;
            slot.slider.value    = skills.buffs[i].BuffTimeRemaining();
        }
    }
Пример #9
0
 public static void AddContract(LumberContract toAdd)
 {
     if (activeContracts.Count < PlayerSkills.GetMaxActiveContractsValue())
     {
         activeContracts.Add(toAdd);
     }
 }
        private void Add()
        {
            if (IsSkillChecked)
            {
                if (SelectedSkill != null)
                {
                    PlayerSkills.Add(new PlayerSkillViewModel(SelectedSkill, 0));
                    SkillPoints = SkillPoints - SelectedSkill.Cost;
                    Skills.Remove(SelectedSkill);
                    SelectedSkill = null;
                }
            }
            else
            {
                if (SelectedFeat != null)
                {
                    PlayerFeats.Add(new PlayerFeatViewModel(SelectedFeat, 0));
                    FeatPoints = FeatPoints - SelectedFeat.Cost;
                    Feats.Remove(SelectedFeat);
                    SelectedFeat = null;
                }
            }

            Refresh();
        }
Пример #11
0
    // Use this for initialization
    void Start()
    {
        battleController = GameObject.FindGameObjectWithTag("BattleController").GetComponent <BattleController>();
        playerSkills     = GetComponent <PlayerSkills>();
        currentSkills    = new SkillDescriptor[battleController.playerCommandButtons.Count];

        foreach (ActorCombatController actor in battleController.playerActors)
        {
            fingerPointers.Add(actor, GameObject.Instantiate(fingerPointerTemplate));
            fingerPointers[actor].transform.position = actor.transform.Find("pointerLocation").position;
            Vector3 scaleInvert = fingerPointers[actor].transform.localScale;
            scaleInvert.x *= -1;
            fingerPointers[actor].transform.localScale = scaleInvert;
        }

        foreach (ActorCombatController actor in battleController.enemyActors)
        {
            fingerPointers.Add(actor, GameObject.Instantiate(fingerPointerTemplate));
            fingerPointers[actor].transform.position = actor.transform.Find("pointerLocation").position;
        }

        foreach (ActorCombatController actor in fingerPointers.Keys)
        {
            fingerPointers[actor].SetActive(false);
        }
    }
Пример #12
0
    void LoadBuffs(SqliteConnection connection, PlayerSkills skills)
    {
        // load buffs
        // note: no check if we have learned the skill for that buff
        //       since buffs may come from other people too
        List <List <object> > table = ExecuteReader(connection, "SELECT name, level, buffTimeEnd FROM character_buffs WHERE character=@character", new SqliteParameter("@character", skills.name));

        foreach (List <object> row in table)
        {
            string buffName = (string)row[0];
            if (ScriptableSkill.dict.TryGetValue(buffName, out ScriptableSkill skillData))
            {
                // make sure that 1 <= level <= maxlevel (in case we removed a skill
                // level etc)
                int  level = Mathf.Clamp(Convert.ToInt32((long)row[1]), 1, skillData.maxLevel);
                Buff buff  = new Buff((BuffSkill)skillData, level);
                // buffTimeEnd is based on Time.time, which will be
                // different when restarting a server, hence why we saved
                // them as just the remaining times. so let's convert them
                // back again.
                buff.buffTimeEnd = (float)row[2] + Time.time;
                skills.buffs.Add(buff);
            }
            else
            {
                Debug.LogWarning("LoadBuffs: skipped buff " + skillData.name + " for " + skills.name + " because it doesn't exist anymore. If it wasn't removed intentionally then make sure it's in the Resources folder.");
            }
        }
    }
Пример #13
0
    void Awake()
    {
        GameObject player = GameObject.Find("player");

        unlockedSkills = player.GetComponentInChildren <PlayerSkills>();
        equippedSkills = player.GetComponentInChildren <EquippedSkills>();
    }
Пример #14
0
 void LoadBuffs(PlayerSkills skills)
 {
     // load buffs
     // note: no check if we have learned the skill for that buff
     //       since buffs may come from other people too
     foreach (character_buffs row in connection.Query <character_buffs>("SELECT * FROM character_buffs WHERE character=?", skills.name))
     {
         if (ScriptableSkill.All.TryGetValue(row.name.GetStableHashCode(), out ScriptableSkill skillData))
         {
             // make sure that 1 <= level <= maxlevel (in case we removed a skill
             // level etc)
             int  level = Mathf.Clamp(row.level, 1, skillData.maxLevel);
             Buff buff  = new Buff((BuffSkill)skillData, level);
             // buffTimeEnd is based on NetworkTime.time, which will be
             // different when restarting a server, hence why we saved
             // them as just the remaining times. so let's convert them
             // back again.
             buff.buffTimeEnd = row.buffTimeEnd + NetworkTime.time;
             skills.buffs.Add(buff);
         }
         else
         {
             Debug.LogWarning("LoadBuffs: skipped buff " + row.name + " for " + skills.name + " because it doesn't exist anymore. If it wasn't removed intentionally then make sure it's in the Resources folder.");
         }
     }
 }
        private void Remove()
        {
            if (IsSkillChecked)
            {
                if (SelectedPlayerSkill != null)
                {
                    Skills.Add(SelectedPlayerSkill.Skill);
                    SkillPoints = SkillPoints + SelectedPlayerSkill.Skill.Cost;
                    PlayerSkills.Remove(SelectedPlayerSkill);
                    SelectedPlayerSkill = null;
                }
            }
            else
            {
                if (SelectedPlayerFeat != null)
                {
                    Feats.Add(SelectedPlayerFeat.Feat);
                    FeatPoints = FeatPoints + SelectedPlayerFeat.Feat.Cost;
                    PlayerFeats.Remove(SelectedPlayerFeat);
                    SelectedPlayerFeat = null;
                }
            }

            Refresh();
        }
Пример #16
0
    void Update()
    {
        if (TimeManager.paused)
        {
            return;
        }

        maxEnergyValue          = PlayerSkills.GetMaxEnergyValue();
        currentEnergyValue      = (float)PlayerEnergy.GetCurrentEnergyValue() / maxEnergyValue;
        energyRadial.fillAmount = currentEnergyValue;
        energyRadial.color      = Color.Lerp(Color.red, Color.green, currentEnergyValue);
        energyText.text         = (currentEnergyValue * maxEnergyValue).ToString();

        if (!SceneManager.GetActiveScene().name.Equals("MainCabin"))
        {
            if (((Input.GetButton("ToolWheel") && !toolWheelIsOpen) || (Input.GetButtonUp("ToolWheel") && toolWheelIsOpen)) && !MenuManager.currentMenuManager.IsInMenu())
            {
                ToggleToolWheel();
            }
        }
        else
        {
            if (!toolsDisabledInside)
            {
                toolIconGroup.parent.transform.parent.gameObject.SetActive(false);
                toolsDisabledInside = true;
            }
        }

        DebugPanel.Log("Current Tool: ", "Player HUD", PlayerTools.GetCurrentlyEquippedToolIndex());
        DebugPanel.Log("Current Tool (manager)", "Player HUD", ToolManager.GetCurrentToolIndex());
    }
Пример #17
0
        public void UnlockSkill(PlayerSkills skill)
        {
            int index = (int)skill;

            skillsUnlocked[index] = true;
            skillsEnabled[index]  = CheckSkillEnabledOnUnlock(skill);
        }
Пример #18
0
    // Use this for initialization
    protected override void Start()
    {
        // NAO CODIFICAR NESSA AREA. SOMENTE SE NECESSARIO
        base.Start();
        // Codifique daqui para baixo;

        myCamera = Camera.main;
        base.CharacterType = ENUMERATORS.Character.CharacterTypeEnum.Player;

        // Initialize o controle de skills
        PlayerSkillSet = new PlayerSkills();
        PlayerSkillSet.InitializePlayerSkills(this);

        CurrentGranade = null;

        _laserLineRenderer = GetComponent<LineRenderer>();

        if (_laserLineRenderer != null)
        {
            _laserLineRenderer.enabled = true;
            _laserPoint = new GameObject(string.Concat(this.name, "LaserSpotLight"), typeof(Light));
            _laserPoint.transform.SetParent(this.gameObject.transform);
            _laserPointLight = _laserPoint.GetComponent<Light>();
            _laserPointLight.type = LightType.Spot;
            _laserPointLight.enabled = true;
            _laserPointLight.shadows = LightShadows.None;
            _laserPointLight.color = _laserLineRenderer.material.GetColor("_EmissionColor");
            _laserPointLight.spotAngle = 20f;
            _laserPointLight.intensity = 4.5f;
            _laserPointLight.range = 1f;
            _laserPointLight.bounceIntensity = 0;

        }
    }
Пример #19
0
    private void PlayerSkillsLoading()
    {
        Data_Base.Connection();
        string sqlQuery = "SELECT stuff_abilities_temp.id, stuff_abilities_temp.type, stuff_abilities_temp.ability_name, " +
                          "stuff_abilities_temp.cooldown, stuff_abilities_temp.duration, stuff_abilities_temp.description FROM stuff_abilities_temp";

        sql_data = Data_Base.SQL_Query(sqlQuery);
        while (sql_data.Read())
        {
            PlayerSkills Skill_data = new PlayerSkills();

            sql_num       = 0;
            Skill_data.id = sql_data.GetInt32(sql_num);
            sql_num++;
            Skill_data.type = sql_data.GetString(sql_num);
            sql_num++;
            Skill_data.ability_name = sql_data.GetString(sql_num);
            sql_num++;
            Skill_data.cooldown = sql_data.GetInt32(sql_num);
            sql_num++;
            Skill_data.duration = sql_data.GetInt32(sql_num);
            sql_num++;
            Skill_data.description = sql_data.GetString(sql_num);

            PlayerStats.skillData.Add(Skill_data);
        }
        sql_data.Close();
        sql_data = null;
        End_loading();
    }
Пример #20
0
 static void Postfix(PlayerSkills __instance, uint __state)
 {
     if (__instance.experience != __state)
     {
         OnExperienceUpdated?.Invoke(__instance.player, __instance.experience);
     }
 }
Пример #21
0
    public void OnHit()
    {
        if (invincible)
        {
            return;
        }

        // If there are no active skills, game over.
        if (activeSkills.Count <= 0)
        {
            Die();
        }
        else
        {
            animator.SetTrigger("Hitted");

            int          randomSkillIndex = UnityEngine.Random.Range(0, activeSkills.Count);
            PlayerSkills skill            = activeSkills[randomSkillIndex];
            activeSkills.RemoveAt(randomSkillIndex);

            LoseSkill(skill);

            StartCoroutine(InvincibilityTimer());
        }
    }
Пример #22
0
        public void OnEnemyDeath(PlayerSkills mySkills)
        {
            int skillID = SkillExecutor.SkilIDFromHexString("00000439");
            var skill   = mySkills.GetSkillById(skillID);

            if (skill == null || skill.IsEmpty)
            {
                return;
            }

            float critDmgPc   = skill.GetFloatInput("crit_dmg_pc");
            float critDmgTime = skill.GetFloatInput("crit_dmg_time");
            int   stackCount  = skill.GetIntInput("stack_count");

            bool mastery = RollMastery(mySkills.nebulaObject);

            if (mastery)
            {
                critDmgTime *= 2;
            }


            int buffsCount = mySkills.bonuses.GetBuffCountWithTag(Common.BonusType.increase_crit_damage_on_pc, skillID);


            if (buffsCount < stackCount)
            {
                Buff newBuff = new Buff(Guid.NewGuid().ToString(), null, Common.BonusType.increase_crit_damage_on_pc, critDmgTime, critDmgPc);
                newBuff.SetTag(skillID);
                mySkills.bonuses.SetBuff(newBuff, mySkills.nebulaObject);
            }
            s_Log.InfoFormat("439.OnEnemyDeath()->critdmg% = {0}, critdmgtime={1}, stackcnt={2}, buffscnt={3}, bonustotal={4}".Color(LogColor.orange),
                             critDmgPc, critDmgTime, stackCount, buffsCount, mySkills.bonuses.critDamagePcBonus);
        }
Пример #23
0
    // Start is called before the first frame update
    void Start()
    {
        controller = GetComponent <CharacterController>();

        skills    = GetComponent <PlayerSkills>();
        stats     = GetComponent <PlayerStats>();
        moveSpeed = stats.movementSpeed.GetCalculatedStatValue() / 10.0f;
        walkSpeed = moveSpeed / 10f * 5f;
        runSpeed  = moveSpeed / 10f * 7f;
        //HP = stats.HP.GetCalculatedStatValue();
        //strength = stats.strength.GetCalculatedStatValue();
        //defense = stats.defense.GetCalculatedStatValue();
        audioSource = GetComponent <AudioSource>();
        //energySkill1 = skills.lightning;
        //energySkill2 = skills.warcry;
        //staminaSkill = skills.invisibility;

        LoadPlayerSaveData();
        ApplyPlayerSelection();
        anim         = GetComponentInChildren <Animator>();
        animEvent    = GetComponentInChildren <PlayerAnimateEvent>();
        sword        = GetComponentInChildren <Sword>();
        sword.Damage = 10;
        loaded       = true;
    }
Пример #24
0
 void Awake()
 {
     if (Instance)
     {
         Destroy(gameObject);
     }
     else
     {
         DontDestroyOnLoad(gameObject);
         Instance = this;
     }
     xp                        = 100;
     fireBallRange             = new CharacterStat(30); //initial range = 15
     fireBallCooldown          = new CharacterStat(2);  //initial cooldown = 2 seconds
     fireBallDamage            = new CharacterStat(15); //inital damage of 20
     fireBallProjectilesNumber = new CharacterStat(1);  //only one projectile in the beginning
     chainRange                = new CharacterStat(25); //initial range = 25
     chainCooldown             = new CharacterStat(2);  //initial cooldown = 2 seconds
     chainDamage               = new CharacterStat(10); //inital damage of 5
     chainNumberBounces        = new CharacterStat(2);  //initial 2 bounces
     poisonRange               = new CharacterStat(20); //initial range = 20
     poisonCooldown            = new CharacterStat(2);  //initial cooldown = 2 seconds
     poisonDamage              = new CharacterStat(10); //inital damage of 5
     poisonTime                = new CharacterStat(2);  //initial time = 2 seconds
     fireBallNodes             = new Dictionary <string, SkillTreeNode>();
     chainNodes                = new Dictionary <string, SkillTreeNode>();
     poisonNodes               = new Dictionary <string, SkillTreeNode>();
 }
Пример #25
0
    public void DmgCollision(float damage)
    {
        StatModifier collisionDmg = new StatModifier(damage, StatModType.Flat);

        health.AddModifier(collisionDmg);

        if (health.Value <= 0)
        {
            PlayerSkills ps = (PlayerSkills)player.GetComponent(typeof(PlayerSkills));
            ps.GainXP(xp);
            if (boss != "")
            {
                Debug.Log("Pronto passaste, toma lá os ECTs...");
                player.GetComponent <PlayerStats>().CompleteUC(boss);
                GameObject.Find("GameManager").GetComponent <GameManager>().BossResult("Won");
                if (boss == "ALGE")
                {
                    GameObject.Find("door9").GetComponent <AudioSource>().Stop();
                }
                else if (boss == "FPRO")
                {
                    GameObject.Find("door11").GetComponent <AudioSource>().Stop();
                }

                GameObject.Find("Teleporter").GetComponent <Teleporter>().Leave();
            }
            Destroy(gameObject);
        }
    }
Пример #26
0
 private void Start()
 {
     cam          = Camera.main;
     motor        = GetComponent <PlayerMotor>();
     combat       = GetComponent <CharacterCombat>();
     playerSkills = PlayerManager.instance.player.gameObject.GetComponentInParent <PlayerSkills>();
 }
    void Start()
    {
        animator        = GetComponent <Animator>();
        prevMouseX      = Input.GetAxis("Mouse X");
        speedMultiplier = 1f;

        wallClip = Camera.main.transform.parent.parent.GetComponent <ProtectCameraFromWallClip>();
        lookCam  = Camera.main.transform.parent.parent.GetComponent <FreeLookCam>();

        targetInfoCanvas = TargetInfo.GetComponent <CanvasGroup>();

        playerSkills = PlayerSkills.Current;

        DisableTargetInfo();

        TalkIndicator.SetActive(false);
        EnableHud();
        DisableConversationUI();

        IsNotBusy = true;

        playerCharController = GetComponent <CharacterController>();

        AttackAudio.volume = 0;
    }
Пример #28
0
 // Use this for initialization
 protected virtual void Start()
 {
     playerSkills  = GetComponent <PlayerSkills>();
     battleManager = BattleManager.instance;
     battleManager.onTurnChange += onTurnChange;
     uiManager = UIManager.instance;
     animator  = GetComponentInChildren <Animator>();
 }
        internal static void InternalOnExperienceChanged(PlayerSkills skills, uint oldExperience)
        {
            BasePlayerEvents instance = skills.GetComponent <BasePlayerEvents>();
            BasePlayer       rp       = skills.player.ToBasePlayer();

            OnPlayerUpdateExperience.TryInvoke(rp, skills.experience);
            instance.OnUpdateExperience.TryInvoke(rp, skills.experience);
        }
Пример #30
0
 void OnPlayerGainSkill(PlayerSkills skillGained)
 {
     if (skill != skillGained)
     {
         return;
     }
     image.sprite = activeSprite;
 }
Пример #31
0
 void OnPlayerLoseSkill(PlayerSkills skillLost)
 {
     if (skill != skillLost)
     {
         return;
     }
     image.sprite = inactiveSprite;
 }
Пример #32
0
 void Start()
 {
     _skillselect = skillupdate.GetComponent<PlayerSkills> ();
     img = gameObject.GetComponent<Image>();
     if(btn == null)
         btn = gameObject.GetComponent<UnityEngine.UI.Button>();
     if (disableOnStart) {
         leftTime = 0f;
         img.fillAmount = 1f;		}
 }
Пример #33
0
    // Use this for initialization
    void Start()
    {
        INVULNERABLE = false;

        switch (PlayerPrefs.GetString("Difficulty"))
        {
            case "Easy":
                WaveSystem.GameDifficulty = Difficulty.Easy;
                break;
            case "Normal":
                WaveSystem.GameDifficulty = Difficulty.Normal;
                break;
            case "Hard":
                WaveSystem.GameDifficulty = Difficulty.Hard;
                break;
            default:
                WaveSystem.GameDifficulty = Difficulty.Easy;
                break;
        }

        anim = GetComponent<Animator>();
        currentAtkState = anim.GetCurrentAnimatorStateInfo (player_StateAttackLayer);

        inputHandler = new InputHandler();
        IsAuraActive = false;

        //LevelSystem = new LevelSystem();
        //Skills = LevelSystem.GetPlayerSkills();
        //Skills.AddSkillPoint();
        Skills = new PlayerSkills (Equipment, audio, Accept, Reject);
        Skills.AddSkillPoints (WaveSystem.GameDifficulty);

        //get the proper amount of lives
        Lives = WaveSystem.LivesPerDifficulty[(int)WaveSystem.GameDifficulty];

        renderer.material.color = Color.red;
        knockback = new Vector3();
        Mass = 10f;

        Score = 0;

        Physics.IgnoreLayerCollision (9, 9);

        PlayerAnimation.animation["attack"].speed = 2.5f;
    }
Пример #34
0
 // Use this for initialization
 void Start()
 {
     playerSkills = GetComponent<PlayerSkills>();
 }
Пример #35
0
 // Use this for initialization
 void Start()
 {
     ausou = GetComponent<AudioSource>();
     lastTime = -1000f;
     playerSkills = transform.parent.GetComponent<PlayerSkills> ();
 }
Пример #36
0
 // Use this for initialization
 void Start()
 {
     _skillselect = skillbringin.GetComponent<PlayerSkills> ();
 }
Пример #37
0
 // Use this for initialization
 void Start()
 {
     aura = GameObject.FindGameObjectWithTag("PlayerAura").GetComponent<PlayerSkills>();
 }
Пример #38
0
    // Use this for initialization
    void Start()
    {
        panel = transform.GetChild (0);
        upgradeButton = transform.GetChild (1);

        skill = GameObject.FindGameObjectWithTag ("Skill").GetComponent<PlayerSkills> ();
        player = GameObject.FindGameObjectWithTag ("Player").GetComponent<Player> ();
        skillBar = GameObject.FindGameObjectWithTag ("SkillBar").transform;
        tooltip = GameObject.FindGameObjectWithTag ("Tooltip").transform.GetChild(0).transform;
        tooltipTitle = tooltip.GetChild (0).GetChild (0).GetComponent<Text>();
        tooltipDesc = tooltip.GetChild (1).GetChild (0).GetComponent<Text>();

        Skill1Col1 = skill.transform.GetChild (0).GetComponent<Skill>();
        Skill1Col2 = skill.transform.GetChild (1).GetComponent<Skill>();
        Skill1Col3 = skill.transform.GetChild (2).GetComponent<Skill>();
        Skill2Col1 = skill.transform.GetChild (3).GetComponent<Skill>();
        Skill2Col2 = skill.transform.GetChild (4).GetComponent<Skill>();
        Skill2Col3 = skill.transform.GetChild (5).GetComponent<Skill>();
        Skill3Col1 = skill.transform.GetChild (6).GetComponent<Skill>();
        //Skill3Col2 = skill.transform.GetChild (7).GetComponent<Skill>();
        Skill3Col3 = skill.transform.GetChild (8).GetComponent<Skill>();

        skillQ = skillBar.GetChild (0).GetComponent<Image>();
        skillW = skillBar.GetChild (1).GetComponent<Image>();
        skillE = skillBar.GetChild (2).GetComponent<Image>();
        skillR = skillBar.GetChild (3).GetComponent<Image>();
        skillRightMouse = skillBar.GetChild (4).GetComponent<Image>();

        lvl1Col1 = panel.GetChild (1).GetChild(0).GetChild (1).GetChild (0).GetComponent<Text> ();
        lvl1Col2 = panel.GetChild (1).GetChild(0).GetChild (1).GetChild (1).GetComponent<Text> ();
        lvl1Col3 = panel.GetChild (1).GetChild(0).GetChild (1).GetChild (2).GetComponent<Text> ();

        lvl2Col1 = panel.GetChild (1).GetChild(2).GetChild (1).GetChild (0).GetComponent<Text> ();
        lvl2Col2 = panel.GetChild (1).GetChild(2).GetChild (1).GetChild (1).GetComponent<Text> ();
        lvl2Col3 = panel.GetChild (1).GetChild(2).GetChild (1).GetChild (2).GetComponent<Text> ();

        lvl3Col1 = panel.GetChild (1).GetChild(4).GetChild (1).GetChild (0).GetComponent<Text> ();
        lvl3Col2 = panel.GetChild (1).GetChild(4).GetChild (1).GetChild (1).GetComponent<Text> ();
        lvl3Col3 = panel.GetChild (1).GetChild(4).GetChild (1).GetChild (2).GetComponent<Text> ();

        img1Col1 = panel.GetChild (1).GetChild(0).GetChild (0).GetChild (0).GetComponent<Image> ();
        img1Col2 = panel.GetChild (1).GetChild(0).GetChild (0).GetChild (1).GetComponent<Image> ();
        img1Col3 = panel.GetChild (1).GetChild(0).GetChild (0).GetChild (2).GetComponent<Image> ();

        img2Col1 = panel.GetChild (1).GetChild(2).GetChild (0).GetChild (0).GetComponent<Image> ();
        img2Col2 = panel.GetChild (1).GetChild(2).GetChild (0).GetChild (1).GetComponent<Image> ();
        img2Col3 = panel.GetChild (1).GetChild(2).GetChild (0).GetChild (2).GetComponent<Image> ();

        img3Col1 = panel.GetChild (1).GetChild(4).GetChild (0).GetChild (0).GetComponent<Image> ();
        img3Col2 = panel.GetChild (1).GetChild(4).GetChild (0).GetChild (1).GetComponent<Image> ();
        img3Col3 = panel.GetChild (1).GetChild(4).GetChild (0).GetChild (2).GetComponent<Image> ();

        freePoints = panel.GetChild (2).GetChild (1).GetComponent<Text> ();
        UpdateSkills ();
        StartCoroutine (UpdatePoints ());
    }
Пример #39
0
 void Awake()
 {
     skills = GetComponent<PlayerSkills>();
     skillInUse = false;
 }
Пример #40
0
 // Use this for initialization
 void Start()
 {
     _skillselect = skillupdate.GetComponent<PlayerSkills> ();
 }
Пример #41
0
 void Start()
 {
     agent = GetComponent<NavMeshAgent> ();
     animator = GetComponent<Animator> ();
     target_enemy = null;
     target_equip = null;
     equipped = null;
     ui_maya = GameObject.FindGameObjectWithTag ("Maya UI").GetComponent<UIMaya> ();
     ui_enemy = GameObject.FindGameObjectWithTag ("Enemy UI").GetComponent<UIEnemy> ();
     weapon_holder = GameObject.FindGameObjectWithTag ("WeaponHolder").transform;
     ui_enemy.Enable (false);
     StartCoroutine (UIUpdate ());
     StartCoroutine (RegenHP ());
     StartCoroutine (RegenMana ());
     skills = GameObject.FindGameObjectWithTag ("Skill").GetComponent<PlayerSkills> ();
     life_steal = skills.transform.GetChild (4);
     level_up_particles = transform.GetChild (7).GetComponent<ParticleSystem> ();;
 }