Esempio n. 1
0
    //public Dictionary<string, Dictionary<string, int>> CurrentEnemykills;
    //public Dictionary<string, int> CurrentWeaponKills;
    //public Dictionary<string, int> CurrentWeaponScores;
    //public Dictionary<string, int> CurrentPowerUps;

    //public Dictionary<string, Dictionary<string, int>> MaxEnemyWeaponKills;
    //public Dictionary<string, int> MaxEnemyKills;
    //public Dictionary<string, int> MaxWeaponKills;
    //public Dictionary<string, int> MaxWeaponScores;

    //public Dictionary<string, Dictionary<string, int>> LifetimeEnemyKills;
    //public Dictionary<string, int> LifetimeWeaponKills;
    //public Dictionary<string, int> LifetimeWeaponScores;

    //public Dictionary<string, int> MaxWeaponSwitches;
    //public Dictionary<string, int> LifetimeWeaponSwitches;

    //public Dictionary<string, int> MaxWeaponUsedAtLevel;


    //public Dictionary<string, int> MaxPowerUps;
    public void ShowOverallStats()
    {
        string disp = "";

        disp += "Most Enemies Defeated : " + m_st.maxKills + "  \t \t \t| Most Weapon Kills (one life): " + m_st.MaxValString(m_st.MaxWeaponKills) + " : " + m_st.MaxVal(m_st.MaxWeaponKills) + "\n";
        disp += "Total Enemies Defeated : " + m_st.SumStat(m_st.LifetimeEnemyKills) + "   \t \t \t| Most Weapon Kills (all time): " + m_st.MaxValString(m_st.LifetimeWeaponKills) + " : " + m_st.MaxVal(m_st.LifetimeWeaponKills) + "\n";
        disp += "Highest Score : " + m_st.maxScore + "     \t \t \t \t \t \t| Highest Score Weapon: " + m_st.MaxValString(m_st.MaxWeaponScores) + " : " + m_st.MaxVal(m_st.MaxWeaponScores) + " points \n";
        disp += "Most Switches (one life) : " + m_st.maxSwitches + "   \t \t \t| Most Used Weapon: " + m_st.MaxValString(m_st.LifetimeWeaponSwitches) + " : " + m_st.MaxVal(m_st.LifetimeWeaponSwitches) + " times \n";
        disp += "Highest Level : " + m_st.MaxVal(m_st.MaxWeaponUsedAtLevel) + "\n";

        StatDisplay.text = disp;
        Message.text     = "Click on a Weapon to Show it's Stats.";
    }
Esempio n. 2
0
    public bool CheckAchievementMet()
    {
        StatTracker st       = FindObjectOfType <StatTracker>();
        string      withName = "";

        if (WithObject != null)
        {
            if (WithObject.GetComponent <Score>() != null)
            {
                withName = WithObject.GetComponent <Score>().TrackName;
            }
            else if (WithObject.GetComponent <WeaponStats>() != null)
            {
                withName = WithObject.GetComponent <WeaponStats>().name;
            }
        }
        if (typeOfAchievement == AchievementType.SCORE)
        {
            if (InOneLife)
            {
                if (WithObject == null)
                {
                    return(st.maxScore > value);
                }
                else
                {
                    return(st.IsAchievementMet(st.MaxWeaponScores, withName, (int)value));
                }
            }
            else
            {
                if (WithObject == null)
                {
                    return(st.SumStat(st.LifetimeWeaponScores) >= value);
                }
                else
                {
                    return(st.IsAchievementMet(st.LifetimeWeaponScores, withName, (int)value));
                }
            }
        }
        else if (typeOfAchievement == AchievementType.WEAPON_KILLS)
        {
            if (InOneLife)
            {
                if (WithObject == null)
                {
                    return(st.maxKills >= value);
                }
                else
                {
                    return(st.IsAchievementMet(st.MaxWeaponKills, withName, (int)value));
                }
            }
            else
            {
                if (WithObject == null)
                {
                    return(st.SumStat(st.LifetimeWeaponKills) >= value);
                }
                else
                {
                    return(st.IsAchievementMet(st.LifetimeWeaponScores, withName, (int)value));
                }
            }
        }
        else if (typeOfAchievement == AchievementType.LEVEL)
        {
            if (WithObject == null)
            {
                return(st.MaxVal(st.MaxWeaponUsedAtLevel) >= value);
            }
            else
            {
                return(st.IsAchievementMet(st.MaxWeaponUsedAtLevel, withName, (int)value));
            }
        }
        else if (typeOfAchievement == AchievementType.WEAPON_SWITCHES)
        {
            if (InOneLife)
            {
                if (WithObject == null)
                {
                    return(false);
                }
                else
                {
                    return(st.IsAchievementMet(st.MaxWeaponSwitches, withName, (int)value));
                }
            }
            else
            {
                if (WithObject == null)
                {
                    return(st.SumStat(st.LifetimeWeaponSwitches) >= value);
                }
                else
                {
                    return(st.IsAchievementMet(st.LifetimeWeaponSwitches, withName, (int)value));
                }
            }
        }
        else if (typeOfAchievement == AchievementType.ENEMY_KILLED)
        {
            if (InOneLife)
            {
                if (WithObject == null)
                {
                    return(st.maxKills >= value);
                }
                else
                {
                    if (WithObject2 != null)
                    {
                        return(st.IsAchievementMet(st.MaxEnemyWeaponKills, withName, WithObject2.GetComponent <WeaponStats>().name, (int)value));
                    }
                    else
                    {
                        return(st.IsAchievementMet(st.MaxEnemyKills, withName, (int)value));
                    }
                }
            }
            else
            {
                if (WithObject == null)
                {
                    return(st.SumStat(st.LifetimeEnemyKills) >= value);
                }
                else
                {
                    if (WithObject2 != null)
                    {
                        return(st.IsAchievementMet(st.LifetimeEnemyKills, withName, WithObject2.GetComponent <WeaponStats>().name, (int)value));
                    }
                    else
                    {
                        return(st.IsAchievementMet(st.LifetimeEnemyKills, withName, (int)value));
                    }
                }
            }
        }
        else if (typeOfAchievement == AchievementType.POWER_UP)
        {
            if (WithObject == null)
            {
                return(false);
            }
            else
            {
                return(st.IsAchievementMet(st.MaxPowerUps, WithObject.GetComponent <PowerUpBase>().PowerUpID, (int)value));
            }
        }
        return(false);
    }