コード例 #1
0
 private void InitializeStats()
 {
     level           = PlayerPrefs.GetInt("level");
     strength        = PlayerPrefs.GetInt("str");
     defence         = PlayerPrefs.GetInt("def");
     maxHealth       = PlayerPrefs.GetInt("hp");
     currentHealth   = maxHealth;
     currentExp      = PlayerPrefs.GetInt("exp");
     expForNextLevel = (int)Mathf.Ceil(Mathf.Pow(level, 3.0F) * 0.03f + Mathf.Pow(level, 2.0f) * 0.1f + level * 50);
     StatsUIManager.InitPlayerStats(strength, defence, maxHealth); // update the UI
 }
コード例 #2
0
    // Use this for initialization
    protected override void Start()
    {
        GameManager.instance.AddPlayerToManager(this);

        //Get a component reference to the Player's animator component
        animator = GetComponent <Animator>();

        statsUIManager = FindObjectOfType <StatsUIManager>();

        InitializeStats();
    }
コード例 #3
0
    private bool moved = false;    // a trigger to flip for starting coroutine

    // Use this for initialization
    protected override void Start()
    {
        base.Start();

        SetLevel(GameManager.getLevel());

        //Register this enemy with our instance of GameManager by adding it to a list of Enemy objects.
        //This allows the GameManager to issue movement commands.
        GameManager.instance.AddEnemyToList(this);

        //Get and store a reference to the attached Animator component.
        animator = GetComponent <Animator>();

        puzzleManager  = FindObjectOfType <PuzzleManager>();
        statsUIManager = FindObjectOfType <StatsUIManager>();
    }
コード例 #4
0
    public static PuzzleControllerInterface[] puzzleControllers; // this holds the puzzle controllers

/*    // HAAAAAX. As in hacks :3
 *  public bool hack_Ulti_On;
 *  public bool hack_init_tutorials;
 *  public bool hack_init_everything;
 */
    // Use this for initialization
    void Awake()
    {
        if (instance == null) // check if instance already exists
        {
            instance = this;  // if not, set instance to this
        }

        else if (instance != this) // if instance already exists and is not this
        {
            Destroy(gameObject);   // then destroy it. enforcing singleton
        }

        playerAtkPuzSolved  = 0;
        playerDefPuzSolved  = 0;
        playerUltiPuzSolved = false;
        enemyAtkPuzSolved   = 0;
        enemyDefPuzSolved   = 0;
        currentActivePuzzle = 1;

        //    checkHacks(); // check if any hacks on, and update accordingly

        // go to player prefs to get skills equipped information,
        // and pass into function to turn the string into array of int to find puzzles equipped
        puzzles = new int[3];
        Formulas.StringToIntArray(PlayerPrefs.GetString("skillsEquipped"), puzzles);
        // get number of puzzles
        if (puzzles[2] == 0)
        {
            noOfPuzzles = 2;
        }
        else
        {
            noOfPuzzles = 3;
        }

        // Instantiate the puzzles we need
        InstantiatePuzzles();

        // get the stats UI manager script and set up the UI
        statsUIManagerScript = GetComponent <StatsUIManager>();
        statsUIManagerScript.Setup();

        gameManager = FindObjectOfType <GameManager>();

        // get the controllers of each puzzle
        GetControllers();
    }
コード例 #5
0
    public void SetLevel(int lvl)
    {
        level = lvl;
        // this is just for prototype.
        // TODO : in future, make stats database, or some formula
        // =ROUNDDOWN(lvl^3*0.09 + lvl^2*0.08 + 1)
        strength = (int)Mathf.Floor(Mathf.Pow(lvl, 3) * 0.09f + Mathf.Pow(lvl, 2) * 0.08f + 1f);
        // =ROUNDDOWN(lvl^3*0.08 + lvl^2*0.07 + 1)
        defence = (int)Mathf.Floor(Mathf.Pow(lvl, 3) * 0.08f + Mathf.Pow(lvl, 2) * 0.07f + 1f);
        // =ROUNDUP(lvl^4*0.09 + 50)
        maxHealth     = (int)Mathf.Ceil(Mathf.Pow(lvl, 4) * 0.09f + 18f);
        currentHealth = maxHealth;
        StatsUIManager.InitEnemyValues(strength, defence, maxHealth); // update UI

        // setting hard values for now. will need to come up with formula or something later
        solvingSpeed      = 8.0f; // attemps to solve at every 8 second
        solvingRate       = 100;  // has a 100% chance to solve the puzzle at every attempt.
        puzzlePreferrence = 90;   // has a 90% chance to solve attack puzzle and 10% for defence
    }
コード例 #6
0
ファイル: Champion.cs プロジェクト: fantazac/LoL_Sandbox
    protected override void Start()
    {
        if (IsLocalChampion())
        {
            AbilityLevelUpUIManager = transform.parent.GetComponentInChildren <AbilityLevelUpUIManager>();
            AbilityTimeBarUIManager = transform.parent.GetComponentInChildren <AbilityTimeBarUIManager>();
            AbilityUIManager        = transform.parent.GetComponentInChildren <AbilityUIManager>();
            BuffUIManager[] buffUIManagers = transform.parent.GetComponentsInChildren <BuffUIManager>();
            BuffUIManager   = buffUIManagers[0];
            DebuffUIManager = buffUIManagers[1];
            BuffManager.SetUIManagers(BuffUIManager, DebuffUIManager);
            HealthBarManager = transform.parent.GetComponentInChildren <HealthBarManager>();
            LevelUIManager   = transform.parent.GetComponentInChildren <LevelUIManager>();
            LevelUIManager.SetPortraitSprite(Resources.Load <Sprite>(championPortraitPath));
            LevelUIManager.SetLevel(LevelManager.Level);
            StatsUIManager = gameObject.AddComponent <StatsUIManager>();
        }

        base.Start();
    }