public float range_score(ScoreTarget weight_target){
			if (is_overflow){
				//Overflowing baskets are automatic fails.
				return weight_target.range_penalty;
			}
			return weight_target.range_value(weight);
		}
Exemplo n.º 2
0
    public void Win()
    {
        if (win || gameOver)
        {
            return;
        }
        win = true;

        WinScreen ws = FindObjectOfType <WinScreen>(true);

        if (ws)
        {
            ws.gameObject.SetActive(true);
        }

        if (ScoreTarget.GetAchieved("gold"))
        {
            sfxSource.PlayOneShot(goldClip);
        }
        else if (ScoreTarget.GetAchieved("silver"))
        {
            sfxSource.PlayOneShot(silverClip);
        }
        else if (ScoreTarget.GetAchieved("bronze"))
        {
            sfxSource.PlayOneShot(bronzeClip);
        }
        else
        {
            sfxSource.PlayOneShot(winClip);
        }
    }
Exemplo n.º 3
0
    private void Update()
    {
        Player player = Player.Find();

        if (player)
        {
            int score = player.GetScore();
            ScoreTarget.CheckTargets(score);
        }
    }
Exemplo n.º 4
0
        protected override void OnProcessOutputSchema(MutableObject newSchema)
        {
            // We don't modify the input schema in adapters... We may derive values from input schemas, but adapters always send a novel schema...

            var oneMutable = TurnSubmissionIntoMutable(new SubmissionScore(), new TeamScores(), Color.magenta);

            var mutableCollection = new List <MutableObject> {
                oneMutable
            };

            ScoreTarget.SetValue(mutableCollection, newSchema);
            IndexField.SetValue(1, newSchema);

            Router.TransmitAllSchema(newSchema);
        }
    private void OnTriggerEnter(Collider col)
    {
        switch (col.tag)
        {
        case "Curb":
            ScoreTarget.UpdateScore(-1);
            ScoreTarget.UpdateRank(0, -1, 0, 0);
            ScoreTarget.UpdateMessege("Trzymaj się drogi!");
            break;

        case "Pedestrian":
            ScoreTarget.UpdateScore(-10);
            ScoreTarget.UpdateRank(-10, 0, 0, 0);
            ScoreTarget.UpdateMessege("Uważaj na pieszych !!!");

            break;

        case "Target":
            ScoreTarget.UpdateScore(10);
            ScoreTarget.UpdateRank(0, 0, 10, 0);
            ScoreTarget.UpdateMessege("Punkt kontrolny ");

            break;

        case "Sign":
            ScoreTarget.UpdateScore(-1);
            ScoreTarget.UpdateRank(0, 0, 0, -1);
            ScoreTarget.UpdateMessege("Słup ;)");
            break;

        case "Car":
            ScoreTarget.UpdateScore(-5);
            ScoreTarget.UpdateRank(0, 0, 0, -1);
            ScoreTarget.UpdateMessege("Kolizja ");

            break;

        case "Boundry":

            SceneManager.LoadScene(2);
            ScoreTarget.ShowRank();
            break;
        }
    }
Exemplo n.º 6
0
    void GenerateLevel()
    {
        // Select level
        // NOTE: not correct, just to prevent crashing for now
        Level level = levels[GameControl.level % levels.Length];

        // Populate target score table
        ScoreTarget.SetTarget("gold", level.goldScore);
        ScoreTarget.SetTarget("silver", level.silverScore);
        ScoreTarget.SetTarget("bronze", level.bronzeScore);

        // Populate map
        Texture2D map = level.groundMap;

        for (int x = 0; x < map.width; x++)
        {
            for (int y = 0; y < map.height; y++)
            {
                GenerateTile(map, x, y);
            }
        }
    }
Exemplo n.º 7
0
        private VisualPayload ParseData()
        {
            //var randomGen = new Random(1337);

            var mutablesList = new List <MutableObject>();

            foreach (var team in ScoreFromJsonFilter.LoadedTeams)
            {
                //var teamColor = ColorUtility.HsvtoRgb((float)randomGen.NextDouble(), .8f, 1f);

                var teamColor = TeamColorPalette.ColorFromIndex(team.TeamID);

                foreach (var entry in team.SubmissionScores)
                {
                    var newMutable = TurnSubmissionIntoMutable(entry, team, teamColor);

                    mutablesList.Add(newMutable);
                }
            }

            ScoreTarget.SetValue(mutablesList, Payload.Data);

            var groupId = GroupId.GetFirstValue(Payload.Data);

            var index = (DataShare.ContainsKey(groupId)
                ? DataShare[groupId]
                : 0);

            if (groupId != "")
            {
                DataShare[groupId] = index + 1;
            }

            IndexField.SetValue(index, Payload.Data);

            return(Payload);
        }
		public float total_score(ScoreTarget weight_target){
			return flat_score(weight_target) + range_score(weight_target);
		}
Exemplo n.º 9
0
        internal override void IncreaseScoreHit(IncreaseScoreType value, HitObject h)
        {
            IncreaseScoreType scoringValue = value;

            if (scoringValue > 0)
            {
                scoringValue &= IncreaseScoreType.HitValuesOnly;
            }

            if (value < 0)
            {
                if (ModManager.CheckActive(Mods.NoFail))
                {
                    CurrentScore.CurrentCombo = (ushort)(ComboCounter.HitCombo = 0);
                    CurrentScore.CountMiss++;
                    return;
                }
                else
                {
                    player.DoPass();
                    return;
                }
            }

            CurrentScore.MaxCombo     = Math.Max(CurrentScore.MaxCombo, ++ComboCounter.HitCombo);
            CurrentScore.CurrentCombo = (ushort)ComboCounter.HitCombo;

            ScoreTarget ts = CurrentScore as ScoreTarget;

            float hitAccuracy = ((HitCircleOsuTarget)h).TargetAccuracy;

            ts.PositionTotal += hitAccuracy;

            int scoreMax = 0;

            switch (scoringValue)
            {
            case IncreaseScoreType.Hit300:
            case IncreaseScoreType.Hit300m:
            case IncreaseScoreType.Hit300k:
            case IncreaseScoreType.Hit300g:
                scoreMax = 300;
                CurrentScore.Count300++;
                break;

            case IncreaseScoreType.Hit100:
            case IncreaseScoreType.Hit100m:
            case IncreaseScoreType.Hit100k:
                scoreMax = 100;
                CurrentScore.Count100++;
                break;

            case IncreaseScoreType.Hit50:
                scoreMax = 50;
                CurrentScore.Count50++;
                break;
            }

            h.scoreValue = scoreMax;

            //todo: this should include some equation of distance over time, rather than current bpm.
            CurrentScore.TotalScore += (int)(hitAccuracy * scoreMax * AudioEngine.CurrentBPM / 120);
        }