Example #1
0
    public SaveProfile(int id, int lvl, int essence, int essenceStored, float timePlayed, int numberOfDeaths,
                       List <string> itemsInInventory, List <int> itemInInventoryAmounts, List <string> itemsInHubChest, List <int> itemInHubChestAmounts,
                       Dictionary <string, int> enemyKillCount, List <int> checkpoints, int lastHubPortalID, bool hubUnloked,
                       bool dashUnlocked, bool midAirDashUnlocked, bool downwardAttackUnlocked, bool wallJumpingUnlocked, int maxJumpCount,
                       float dashDistance, float minDelayBetweenDashes, int maxMidairDashesCount, float invincibilityFrameTime,
                       HubSaveState hubSaveState)
    {
        this.id                     = id;
        this.lvl                    = lvl;
        this.essence                = essence;
        this.essenceStored          = essenceStored;
        this.timePlayed             = timePlayed;
        this.numberOfDeaths         = numberOfDeaths;
        this.itemsInInventory       = itemsInInventory;
        this.itemInInventoryAmounts = itemInInventoryAmounts;
        this.itemsInHubChest        = itemsInHubChest;
        this.itemInHubChestAmounts  = itemInHubChestAmounts;
        this.enemyKillCount         = enemyKillCount;
        this.checkpoints            = checkpoints;
        this.hubUnloked             = hubUnloked;
        this.lastHubPortalID        = lastHubPortalID;

        this.dashUnlocked           = dashUnlocked;
        this.midAirDashUnlocked     = midAirDashUnlocked;
        this.downwardAttackUnlocked = downwardAttackUnlocked;
        this.wallJumpingUnlocked    = wallJumpingUnlocked;
        this.maxJumpCount           = maxJumpCount;
        this.dashDistance           = dashDistance;
        this.minDelayBetweenDashes  = minDelayBetweenDashes;
        this.maxMidairDashesCount   = maxMidairDashesCount;
        this.invincibilityFrameTime = invincibilityFrameTime;

        this.hubSaveState = hubSaveState;
    }
Example #2
0
 public void LoadHub(HubSaveState hubSaveState)
 {
     for (int i = 0; i < portals.Count; i++)
     {
         portals[i].SetActive(hubSaveState.portalsUnlocked[i]);
     }
     smithNPC.SetActive(hubSaveState.smithUnlocked);
     essenceCollector.SetActive(hubSaveState.essenceCollectorUnlocked);
 }
Example #3
0
    public void LoadFromProfile(SaveProfile profile)
    {
        currentProfileID = profile.id;
        timePlayed       = profile.timePlayed;
        level            = profile.lvl;
        essence          = profile.essence;
        storedEssence    = profile.essenceStored;
        numberOfDeaths   = profile.numberOfDeaths;
        lastHubPortalID  = profile.lastHubPortalID;
        hubUnloked       = profile.hubUnloked;
        enemyKillCount   = profile.enemyKillCount != null ? profile.enemyKillCount : new Dictionary <string, int>();
        checkpoints      = profile.checkpoints;
        numberOfDeaths   = profile.numberOfDeaths;

        playerMovement.dashUnlocked           = profile.dashUnlocked;
        playerMovement.midAirDashUnlocked     = profile.midAirDashUnlocked;
        playerMovement.downwardAttackUnlocked = profile.downwardAttackUnlocked;
        playerMovement.wallJumpingUnlocked    = profile.wallJumpingUnlocked;
        playerMovement.maxJumpCount           = profile.maxJumpCount;
        playerMovement.dashDistance           = profile.dashDistance;
        playerMovement.minDelayBetweenDashes  = profile.minDelayBetweenDashes;
        playerMovement.maxMidairDashesCount   = profile.maxMidairDashesCount;
        playerMovement.invincibilityFrameTime = profile.invincibilityFrameTime;

        hubSaveState = profile.hubSaveState;
        SetItemStats();
        CalculateLevelUpPrice();
        statusGUI.UpdateEssenceText();
        statusGUI.UpdateHealthbar();
        statusGUI.UpdateInventoryStats();
        statusGUI.UpdateLevelText();

        // cia tik pavyzdys kaip gauti kill count, gali istrint ar uzkomentuoti
        print("EnemyKillCounts: ");
        print("Executioner: " + GetEnemyKillCount(typeof(AI_Executioner)));
        print("male naga: " + GetEnemyKillCount(typeof(AI_MaleNaga)));
        print("male naga enraged: " + GetEnemyKillCount(typeof(AI_MaleNagaEnraged)));
        print("female naga: " + GetEnemyKillCount(typeof(AI_FemaleNaga)));
        print("female naga enraged: " + GetEnemyKillCount(typeof(AI_FemaleNagaEnraged)));
        print("fire golem: " + GetEnemyKillCount(typeof(AI_FireGolem)));
        print("ghoul: " + GetEnemyKillCount(typeof(AI_Ghoul)));
        print("imp: " + GetEnemyKillCount(typeof(AI_Imp)));
        print("necromancer: " + GetEnemyKillCount(typeof(AI_Necromancer)));
        print("slug: " + GetEnemyKillCount(typeof(AI_Slug)));
    }
Example #4
0
    public HubSaveState DefaultSaveState()
    {
        HubSaveState hubSaveState = new HubSaveState();

        return(hubSaveState);
    }