Esempio n. 1
0
 //end rush gamemode game
 void Rush_EndGame(string motivation)
 {
     PlayerLevelManager.AddExp(score); // add score to player experince
     gmOverMenu.gameObject.SetActive(true);
     gmOverMenu.Rush_InfoPreset(score, motivation);
     StopGame();
 }
Esempio n. 2
0
        // Start is called before the first frame update
        void Start()
        {
            player      = Player.instance;
            playerLevel = PlayerLevelManager.instance;

            statsWindow.SetActive(false);
        }
Esempio n. 3
0
 //end the game
 void EndGame()
 {
     PlayerLevelManager.AddExp(score); // add score to player experince
     _ref.gmOverMenu.gameObject.SetActive(true);
     //gmOverMenu.SetInfo(GameMode, timer);
     _ref.gmOverMenu.TimeAttack_InfoPeset(timer);
     StopGame();
 }
Esempio n. 4
0
 void Awake()
 {
     Debug.Log(controls);
     controls = new PlayerHubInput();
     Debug.Log(controls);
     controls.Player.SetCallbacks(this);
     playerLevelManager = new PlayerLevelManager(levelScale);
 }
        new_xp;     // Кол-во опыта для нового уровня

    private void Awake()
    {
        player_level_manager = this;
        player_lvl           = GlobalData.GetInt("PlayerLvl");
        current_xp           = GlobalData.GetInt("PlayerXP");
        new_xp = (int)CalculatePlayerXP();

        ClassicDifficultSystem.player_level_manager = this; // Кэшируем скрипт
    }
Esempio n. 6
0
 public override void OnDeath()
 {
     if (dropItems.Count > 0 && dropRate > UnityEngine.Random.value)
     {
         GameObject dropItem = dropItems[UnityEngine.Random.Range(0, dropItems.Count)];
         GameObject item     = Instantiate(dropItem, transform.position, Quaternion.identity);
     }
     PlayerLevelManager.addExp(exp);
     Destroy(this.gameObject);
 }
Esempio n. 7
0
    void Start()
    {
        PlayerManager playerManager;

        playerManager      = WindyFramework.FrameworkEntry.GetComponent <PlayerManager>();
        playerLevelManager = playerManager.playerLevelManager;
        EventManager eventManager;

        eventManager = WindyFramework.FrameworkEntry.GetComponent <EventManager>();
        eventManager.Subscribe(EventsId.MOUSE_LEFT_BUTTON_CLICKED, OnClick);
    }
Esempio n. 8
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(this);
            return;
        }

        onLevelUp += () => print("Level up");
    }
Esempio n. 9
0
    // Use this for initialization
    void Start()
    {
        instance = this.gameObject;

        direction = inicialDirection;

        boneCounterText       = boneCounter.GetComponent <Text> ();
        mergedBoneCounterText = mergedBoneCounter.GetComponent <Text> ();

        invulnerableTimeStamp = 0;

        maxLife     = baseStats.maxLife;
        speed       = baseStats.speed;
        magicDamage = baseStats.initialMagicDamage;
        stabDamage  = baseStats.initialMeleeDamage;

        meleeAttackCooldown  = baseStats.meleeAttackCooldown;
        rangedAttackCooldown = baseStats.rangedAttackCooldown;

        currentLife = maxLife;

        levelManager = GetComponent <PlayerLevelManager>();

        DefineCharacterStats();

        animator.runtimeAnimatorController = characterStats.animatorController;

        GameObject firingPointsParent = Instantiate(characterStats.firingPointsPrefab, transform);

        upFiringPoint    = firingPointsParent.transform.Find("UpFiringPoint");
        downFiringPoint  = firingPointsParent.transform.Find("DownFiringPoint");
        rightFiringPoint = firingPointsParent.transform.Find("RightFiringPoint");

        upRightFiringPoint   = firingPointsParent.transform.Find("UpRightFiringPoint");
        downRightFiringPoint = firingPointsParent.transform.Find("DownRightFiringPoint");

        if (representsPlayer == RepresentsPlayer.Player1)
        {
            magicProjectilePrefab = characterStats.projectilePrefab;
            meleeAttackPrefab     = characterStats.meleeAttackPrefab;
        }
        else
        {
            magicProjectilePrefab = characterStats.projectilePrefabPlayer2;
            meleeAttackPrefab     = characterStats.meleeAttackPrefabPlayer2;
        }

        DefineAnimationLengths();
    }
Esempio n. 10
0
    //Initializes the game for each level.
    void InitGame()
    {
        //SceneManager.LoadScene("menu");
        vertExtent = Camera.main.orthographicSize;
        horzExtent = vertExtent * Screen.width / Screen.height;

        // set player status variables
        playerStatus.maxHp                  = 100f;
        playerStatus.currentHp              = 100f;
        playerStatus.maxChargeBarValue      = 1000f;
        playerStatus.currentChargeBarValue  = 0f;
        playerStatus.chargeCoolDownDuration = 3f;
        playerStatus.chargeBarIncreaseRate  = 5f;
        playerStatus.chargeBarDecreaseRate  = 10f;
        playerStatus.shootCoolDownDuration  = 0.2f;
        playerStatus.invincibleDuration     = 2f;
        playerStatus.currentAttackType      = PlayerAttackType.Shoot;

        // set weapon status variables
        weaponStatus.bulletDamage       = 10f;
        weaponStatus.bulletSpeed        = 15f;
        weaponStatus.swordDamage        = 10f;
        weaponStatus.swordRepelForce    = 10f;
        weaponStatus.chargeBulletDamage = 50f;
        weaponStatus.chargeBulletSpeed  = 10f;
        weaponStatus.chargeSwordDamage  = 100f;
        weaponStatus.chargeSwordSpeed   = 3f;

        mouseInputStatus = MouseInputState.Attack;

        gameState = GameState.Tutorial;

        playerLevelManager = new PlayerLevelManager();
        playerLevelManager.SetVitalityToLevel(1);
        playerLevelManager.SetSkillToLevel(1);
        playerLevelManager.SetStrengthToLevel(1);

        coin = 1000;
        wave = 1;

        SetCoinText(coin);
        SetWaveText(wave);
        SetPlayerLevelText(playerLevelManager.playerLevel);
    }
Esempio n. 11
0
    private HashSet <AbstractCreature> lastTargets; // Used to keep targets betwen turns

    void Awake()
    {
        SpawnPlayer();
        rb2d         = GetComponent <Rigidbody2D>();
        skillHandler = GetComponent <SkillHandler>();
        keysFound    = new HashSet <string>();
        animator     = GetComponent <Animator>();
        PlayerLevelManager.Init(this, playerUIController);
        switch (playerClass)
        {
        case PlayerClass.Warrior:
            gameObject.AddComponent(typeof(BasicMelee));
            gameObject.AddComponent(typeof(SlamAttack));
            gameObject.AddComponent(typeof(WeakeningShout));
            gameObject.AddComponent(typeof(Whirlwind));
            break;

        case PlayerClass.Wizard:
            gameObject.AddComponent(typeof(Fireball));
            //gameObject.AddComponent(typeof(GraspingRoots));
            gameObject.AddComponent(typeof(LavaWave));
            gameObject.AddComponent(typeof(ManaShield));
            gameObject.AddComponent(typeof(StunningStrike));
            break;

        case PlayerClass.Ranger:
            gameObject.AddComponent(typeof(BasicRanged));
            gameObject.AddComponent(typeof(RicochetArrow));
            gameObject.AddComponent(typeof(ImmolationArrow));
            //gameObject.AddComponent(typeof(TacticalReposition));
            //gameObject.AddComponent(typeof(ThrowTrap));
            gameObject.AddComponent(typeof(Volley));
            break;
        }
        skillHandler.InitSkills();
    }
 // Use this for initialization
 void Start()
 {
     PlayerLevelManager.GetSaveData();
     PlayerLevelManager.CalculateExpForNextLevel();
 }
 private void Awake()
 {
     _instance = this;
 }