コード例 #1
0
ファイル: LootBoxModel.cs プロジェクト: bkane/lootquest
    public LootBoxModel()
    {
        if (Instance != null)
        {
            Debug.LogWarning("Replacing the current model!");
        }
        Instance = this;

        List <Units> unitTypes = Enum.GetValues(typeof(Units)).Cast <Units>().ToList();

        Resources = new Dictionary <Units, Resource>();
        for (int i = 0; i < unitTypes.Count; i++)
        {
            Units type = unitTypes[i];
            Resources.Add(type, new Resource(type, 0));
        }

        UpgradeManager          = new UpgradeManager(this);
        UpgradeManager.IsActive = true;
        Time = new TimeModel(this);

        Life          = new LifeModel(this);
        Life.IsActive = true;

        Job          = new JobModel(this);
        Job.IsActive = false;

        MacGuffinQuest          = new MacGuffinQuest(this);
        MacGuffinQuest.IsActive = false;

        Influencer          = new InfluencerModel(this);
        Influencer.IsActive = false;

        Studio          = new StudioModel(this);
        Studio.IsActive = false;

        Public          = new PublicModel(this);
        Public.IsActive = false;

        SetInitialState();

#if DEBUG
        if (UnlockAllViews)
        {
            Life.IsActive           = true;
            UpgradeManager.IsActive = true;
            Job.IsActive            = true;
            MacGuffinQuest.IsActive = true;
            Influencer.IsActive     = true;
            Studio.IsActive         = true;
            Public.IsActive         = true;
        }
#endif
    }
コード例 #2
0
ファイル: StudioModel.cs プロジェクト: bkane/lootquest
 public StudioModel(LootBoxModel model)
 {
     this.model = model;
 }
コード例 #3
0
    public void CheckAchievements()
    {
        Debug.Log("Checking achievements...");

        if (!Client.IsValid)
        {
            Debug.Log("Steam connection is not valid at the moment. Achievement unlock is not possible. Are you logged in to Steam?");
        }

        LootBoxModel model = LootBoxModel.Instance;

        //Money
        if (model.Resources[Units.TotalMoneyEarned].Amount >= 1000)
        {
            Debug.LogFormat("TotalMoneyEarned: {0} >= 1000. Awarding ACH_EARN_1K", model.Resources[Units.TotalMoneyEarned].Amount);
            UnlockAchievement(ACH_EARN_1K);
        }

        if (model.Resources[Units.TotalMoneyEarned].Amount >= 1000000)
        {
            Debug.LogFormat("TotalMoneyEarned: {0} >= 1000000. Awarding ACH_EARN_1M", model.Resources[Units.TotalMoneyEarned].Amount);
            UnlockAchievement(ACH_EARN_1M);
        }

        if (model.Resources[Units.TotalMoneyEarned].Amount >= 1.3e12f)
        {
            Debug.LogFormat("TotalMoneyEarned: {0} >= 1.3e12f. Awarding ACH_EARN_CANADA", model.Resources[Units.TotalMoneyEarned].Amount);
            UnlockAchievement(ACH_EARN_CANADA);
        }


        //Clicks
        if (model.Resources[Units.Click].Amount >= 250)
        {
            Debug.LogFormat("Clicks: {0} >= 250. Awarding ACH_CLICK_250", model.Resources[Units.Click].Amount);
            UnlockAchievement(ACH_CLICK_250);
        }

        if (model.Resources[Units.Click].Amount >= 1000)
        {
            Debug.LogFormat("Clicks: {0} >= 1000. Awarding ACH_CLICK_1000", model.Resources[Units.Click].Amount);
            UnlockAchievement(ACH_CLICK_1000);
        }

        if (model.Resources[Units.Click].Amount >= 5000)
        {
            Debug.LogFormat("Clicks: {0} >= 5000. Awarding ACH_CLICK_5000", model.Resources[Units.Click].Amount);
            UnlockAchievement(ACH_CLICK_5000);
        }


        //Followers
        if (model.Resources[Units.Follower].Amount >= 1000)
        {
            Debug.LogFormat("Followers: {0} >= 1000. Awarding ACH_FOLLOWERS_1000", model.Resources[Units.Follower].Amount);
            UnlockAchievement(ACH_FOLLOWERS_1000);
        }

        if (model.Resources[Units.Follower].Amount >= 100000)
        {
            Debug.LogFormat("Followers: {0} >= 100000. Awarding ACH_FOLLOWERS_100K", model.Resources[Units.Follower].Amount);
            UnlockAchievement(ACH_FOLLOWERS_100K);
        }

        if (model.Resources[Units.Follower].Amount >= 1000000)
        {
            Debug.LogFormat("Followers: {0} >= 1000000. Awarding ACH_FOLLOWERS_1M", model.Resources[Units.Follower].Amount);
            UnlockAchievement(ACH_FOLLOWERS_1M);
        }


        //Games
        if (model.Resources[Units.ReleasedGame].Amount >= 10)
        {
            Debug.LogFormat("ReleasedGames: {0} >= 10. Awarding ACH_GAMES_10", model.Resources[Units.ReleasedGame].Amount);
            UnlockAchievement(ACH_GAMES_10);
        }

        if (model.Resources[Units.ReleasedGame].Amount >= 25)
        {
            Debug.LogFormat("ReleasedGames: {0} >= 25. Awarding ACH_GAMES_25", model.Resources[Units.ReleasedGame].Amount);
            UnlockAchievement(ACH_GAMES_25);
        }

        if (model.Resources[Units.ReleasedGame].Amount >= 50)
        {
            Debug.LogFormat("ReleasedGames: {0} >= 50. Awarding ACH_GAMES_50", model.Resources[Units.ReleasedGame].Amount);
            UnlockAchievement(ACH_GAMES_50);
        }

        //Quitters
        if (model.Studio.DidDevsQuit)
        {
            Debug.Log("DevsQuit: true. Awarding ACH_QUITTERS");
            UnlockAchievement(ACH_QUITTERS);
        }

        //Pride
        model.UpgradeManager.CheckForAllUpgradeAchievement();

        //Accomplishment
        if (model.UpgradeManager.IsPurchased(Upgrade.EUpgradeType.PurchaseMacGuffinQuestSourceCode))
        {
            UnlockAchievement(ACH_ACCOMPLISHMENT);
        }

        Debug.Log("Achievement check complete.");
    }
コード例 #4
0
 public InfluencerModel(LootBoxModel model)
 {
     this.model = model;
 }
コード例 #5
0
ファイル: JobModel.cs プロジェクト: bkane/lootquest
 public JobModel(LootBoxModel model)
 {
     this.model = model;
 }
コード例 #6
0
 public PublicModel(LootBoxModel model)
 {
     this.model = model;
 }
コード例 #7
0
 public MacGuffinQuest(LootBoxModel model)
 {
     this.Model = model;
 }
コード例 #8
0
 public LifeModel(LootBoxModel model)
 {
     this.model = model;
 }
コード例 #9
0
 public TimeModel(LootBoxModel model)
 {
     this.model = model;
     startTime  = DateTime.Now;
 }