Exemplo n.º 1
0
        public Judgement CreateJudgemnet()
        {
            if (MaxId < 1)
                MaxId = 1;

            Judgement jud = new Judgement();
            jud.ID = ++MaxId;
            jud.IsNew = true;
            return jud;
        }
Exemplo n.º 2
0
            private void onScoringModeChanged(ValueChangedEvent <ScoringMode> mode)
            {
                difficultyCancellationSource?.Cancel();
                difficultyCancellationSource = null;

                if (score.Beatmap == null)
                {
                    Value = score.TotalScore;
                    return;
                }

                int    beatmapMaxCombo;
                double accuracy = score.Accuracy;

                if (score.IsLegacyScore)
                {
                    if (score.RulesetID == 3)
                    {
                        // In osu!stable, a full-GREAT score has 100% accuracy in mania. Along with a full combo, the score becomes indistinguishable from a full-PERFECT score.
                        // To get around this, recalculate accuracy based on the hit statistics.
                        // Note: This cannot be applied universally to all legacy scores, as some rulesets (e.g. catch) group multiple judgements together.
                        double maxBaseScore = score.Statistics.Select(kvp => kvp.Value).Sum() * Judgement.ToNumericResult(HitResult.Perfect);
                        double baseScore    = score.Statistics.Select(kvp => Judgement.ToNumericResult(kvp.Key) * kvp.Value).Sum();
                        if (maxBaseScore > 0)
                        {
                            accuracy = baseScore / maxBaseScore;
                        }
                    }

                    // This score is guaranteed to be an osu!stable score.
                    // The combo must be determined through either the beatmap's max combo value or the difficulty calculator, as lazer's scoring has changed and the score statistics cannot be used.
                    if (score.Beatmap.MaxCombo == null)
                    {
                        if (score.Beatmap.ID == 0 || difficulties == null)
                        {
                            // We don't have enough information (max combo) to compute the score, so use the provided score.
                            Value = score.TotalScore;
                            return;
                        }

                        // We can compute the max combo locally after the async beatmap difficulty computation.
                        difficultyBindable = difficulties().GetBindableDifficulty(score.Beatmap, score.Ruleset, score.Mods, (difficultyCancellationSource = new CancellationTokenSource()).Token);
                        difficultyBindable.BindValueChanged(d =>
                        {
                            if (d.NewValue is StarDifficulty diff)
                            {
                                updateScore(diff.MaxCombo, accuracy);
                            }
                        }, true);

                        return;
                    }

                    beatmapMaxCombo = score.Beatmap.MaxCombo.Value;
                }
                else
                {
                    // This score is guaranteed to be an osu!lazer score.
                    // The combo must be determined through the score's statistics, as both the beatmap's max combo and the difficulty calculator will provide osu!stable combo values.
                    beatmapMaxCombo = Enum.GetValues(typeof(HitResult)).OfType <HitResult>().Where(r => r.AffectsCombo()).Select(r => score.Statistics.GetOrDefault(r)).Sum();
                }

                updateScore(beatmapMaxCombo, accuracy);
            }
 public OsuHitCircleJudgementResult(HitObject hitObject, Judgement judgement)
     : base(hitObject, judgement)
 {
 }
Exemplo n.º 4
0
 protected override JudgementResult CreateResult(Judgement judgement) => new OsuJudgementResult(judgement);
Exemplo n.º 5
0
 public double Get(Judgement type)
 => type switch
 {
Exemplo n.º 6
0
 protected override JudgementResult CreateResult(Judgement judgement) => new CatchJudgementResult(HitObject, judgement);
 protected DirectConclusion(Judgement premice)
 {
     _premice = premice;
 }
Exemplo n.º 8
0
        public bool SaveSettings()
        {
            int rowIndex = 0;
            MessageDisplay msgDisplay = CreateMessageDisplay("logourl", "description");

            int[] oldJudgement = StringUtil.Split<int>(_Request.Get("judgementids", Method.Post));
            Judgement temp;
            JudgementCollection judgements = new JudgementCollection();

            foreach (int j in oldJudgement)
            {
                temp = new Judgement();
                temp.ID = j;
                temp.Description = _Request.Get("description." + j, Method.Post);
                temp.LogoUrlSrc = _Request.Get("logourl." + j, Method.Post);
                temp.IsNew = _Request.Get<bool>("isnew." + j, Method.Post, false);
                ValidateJudgment(temp, msgDisplay, rowIndex);
                rowIndex++;
                judgements.Add(temp);
            }



            //客户端无脚本  
            if (_Request.Get("newjudgements", Method.Post) != null
                && _Request.Get("newjudgements", Method.Post).Contains("{0}"))
            {
                temp = JudgementSettings.CreateJudgemnet();
                temp.LogoUrlSrc = _Request.Get("logourl.new.{0}", Method.Post);
                temp.Description = _Request.Get("description.new.{0}", Method.Post);

                if (string.IsNullOrEmpty(temp.Description) && string.IsNullOrEmpty(temp.LogoUrl)) judgements.Add(temp);
            }
            else
            {
                oldJudgement = StringUtil.Split<int>(_Request.Get("newjudgements", Method.Post));
                foreach (int j in oldJudgement)
                {
                    temp = JudgementSettings.CreateJudgemnet();
                    temp.LogoUrlSrc = _Request.Get("logourl.new." + j, Method.Post);
                    temp.Description = _Request.Get("description.new." + j, Method.Post);
                    ValidateJudgment(temp, msgDisplay, rowIndex);
                    rowIndex++;
                    judgements.Add(temp);
                }
            }


            if (!msgDisplay.HasAnyError())
            {
                JudgementSettings.Judgements = judgements;
                foreach (Judgement j in judgements) { j.IsNew = false; }
                SettingManager.SaveSettings(JudgementSettings);
            }
            else
            {
                this.m_Judgements = judgements;
                msgDisplay.AddError(new DataNoSaveError());
            }

            return true;
        }
Exemplo n.º 9
0
 public DrawableManiaJudgement(Judgement judgement)
     : base(judgement)
 {
     JudgementText.TextSize = 25;
 }
Exemplo n.º 10
0
 public void Judge(Judgement judge) => Add(CalScoreDelta(Combo.Count) * (4 - (int)judge));
Exemplo n.º 11
0
        public void TestFormJudgement()
        {
            /*
             *  We'll need a new outcome which generates new actors into the world
             */
            var Agents = new List <Agent>()
            {
                new Agent()
                {
                    Name = "Usurper",
                    Tags = new List <string>()
                    {
                        "Ambitious"
                    }
                },
                new Agent()
                {
                    Name = "King",
                    Tags = new List <string>()
                    {
                        "Unjust", "Rich"
                    }
                },
                new Agent()
                {
                    Name = "Witness",
                    Tags = new List <string>()
                    {
                        "Ambitious", "Greedy"
                    },
                    Relationships = new Dictionary <string, Relationship>()
                    {
                        { "King", new Relationship()
                          {
                              Actor    = "King",
                              Opinions = new List <Opinion>()
                              {
                                  new Opinion()
                                  {
                                      Judgement = "Rich",
                                      Reason    = "Because he's the king, duh."
                                  }
                              }
                          } }
                    }
                }
            };
            World world = new World()
            {
                WorldDoc = new JObject()
                {
                    { "Agents", JToken.FromObject(Agents) }
                }
            };
            // Loads the judgement data for envy
            Judgement judgement = JsonConvert.DeserializeObject <Judgement>(File.ReadAllText(Basedir + "envy.json"));

            /*
             *  Its imporatant to note than when a judgement is being calculated, it's from the perspective
             *  of the witness.  Regardless of if the Tyrant actually posesses the 'unjust' trait, the witness
             *  is drawing from their current relationship to make the judgement.  If the witness doesn't actually
             *  have a relationship to the
             */
            Occurrence occurence = new Occurrence()
            {
                Description = "The ambitious Usurper siezes the throne from the unjust King!",
                Actor       = "Usurper",
                Target      = "King",
                Witness     = "Witness",
                ActorRole   = new Role()
                {
                    Actions = new List <string>()
                    {
                        "Dethrone"
                    },
                    Upholds = new List <string>()
                    {
                        "Power"
                    },
                    Forsakes = new List <string>()
                    {
                    },
                },
                TargetRole = new Role()
                {
                    Actions = new List <string>()
                    {
                    },
                    Upholds = new List <string>()
                    {
                    },
                    Forsakes = new List <string>()
                    {
                    },
                }
            };

            // Judge the occurence from the point of view of the witness
            world = judgement.FormJudgement("Witness", occurence, world);
            Agent judge = world.WorldDoc.SelectToken("$..Agents[?(@.Name == 'Witness')]").ToObject <Agent>();

            // The judge should now have two relationships, one the actor and the target
            Assert.IsTrue(judge.Relationships.Count == 2);

            // The judge's relationships should include one which has the envy tag
            Assert.IsTrue(
                judge.Relationships["Usurper"].Opinions.Exists(opinion => {
                return(opinion.Judgement == "Envy");
            })
                );
        }
Exemplo n.º 12
0
 public void Judge(Judgement judge)
 {
     Text = judge.ToString();
     SetColor(_colorPerJudgement[(int)judge]);
     _onTextChanged.Invoke();
 }
Exemplo n.º 13
0
 public TauJudgementResult(HitObject hitObject, Judgement judgement)
     : base(hitObject, judgement)
 {
 }
Exemplo n.º 14
0
 /// <summary>
 /// Creates a new judgement text.
 /// </summary>
 /// <param name="judgedObject">The object which is being judged.</param>
 /// <param name="judgement">The judgement to visualise.</param>
 public DrawableTaikoJudgement(DrawableHitObject judgedObject, Judgement judgement)
     : base(judgement)
 {
     JudgedObject = judgedObject;
 }
Exemplo n.º 15
0
 protected override JudgementResult CreateResult(Judgement judgement) => new OsuSpinnerJudgementResult(HitObject, judgement);
 public OsuSpinnerJudgementResult(HitObject hitObject, Judgement judgement)
     : base(hitObject, judgement)
 {
 }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        ProgrammingContestDataContextHandler pcdch = new ProgrammingContestDataContextHandler();
        ContestSetting contestSetting = pcdch.ContestSetting.GetById(Convert.ToInt64(Session["ContestID"].ToString()));
        DateTime nowDateTime = DateTime.Now;

        if (nowDateTime >= contestSetting.StartTime && nowDateTime <= contestSetting.EndTime)
        {
            if (fuSubmit.FileName.ToLower().EndsWith(".exe"))
            {
                Solution solution = new Solution();
                solution.FileName = fuSubmit.FileName;
                solution.ContestId = Convert.ToInt64(Session["ContestID"].ToString());
                solution.Problem = pcdch.Problems.GetById(Convert.ToInt64(ViewState["ProblemId"].ToString()));
                solution.ProblemId = Convert.ToInt64(ViewState["ProblemId"].ToString());
                solution.time = DateTime.Now;
                solution.User = pcdch.Users.GetByName(Session["User"].ToString());
                solution.UserId = pcdch.Users.GetByName(Session["User"].ToString()).ID;
                solution.Result = pcdch.Result.GetByName("Pending");
                solution.ResultId = pcdch.Result.GetByName("Pending").ID;

                pcdch.ProgrammingContestDatabase.Solutions.InsertOnSubmit(solution);
                pcdch.ProgrammingContestDatabase.SubmitChanges();

                string path = Server.MapPath("Solution");
                path += "\\" + solution.UserId.ToString();
                DirectoryInfo df = new DirectoryInfo(path);

                if (!df.Exists)
                    df.Create();

                path += "\\" + solution.ProblemId.ToString();

                df = new DirectoryInfo(path);

                if (!df.Exists)
                    df.Create();

                path += "\\" + solution.ID.ToString();

                df = new DirectoryInfo(path);

                if (!df.Exists)
                    df.Create();

                string codePath = path + "\\" + fuCode.FileName;
                path += "\\" + solution.FileName;
                FileInfo fi = new FileInfo(path);

                if (fi.Exists)
                    fi.Delete();
                fuSubmit.SaveAs(path);
                fuCode.SaveAs(codePath);

                solution.SolutionFileName = "Solution" + "/" + solution.UserId.ToString() + "/" + solution.ProblemId.ToString() + "/" + solution.ID.ToString() + "/" + fuCode.FileName;
                pcdch.ProgrammingContestDatabase.SubmitChanges();

                Problem prob = pcdch.Problems.GetById(solution.ProblemId);

                string inputJudgeFile = Server.MapPath("JudgeSolution");
                inputJudgeFile += "\\" + prob.ID.ToString() + "\\" + prob.InputFile;
                FileInfo rrr1 = new FileInfo(inputJudgeFile);

                if (rrr1.Exists)
                {
                    fi = new FileInfo(path);
                    string contestInputFile = fi.DirectoryName + "\\" + prob.InputFile;
                    rrr1.CopyTo(contestInputFile, true);
                    string contestOutputFile = fi.DirectoryName + "\\" + prob.OutputFile;

                    string outputJudgeFile = Server.MapPath("JudgeSolution");
                    outputJudgeFile += "\\" + prob.ID.ToString() + "\\" + prob.OutputFile;

                    rrr1 = new FileInfo(outputJudgeFile);

                    if (rrr1.Exists)
                    {
                        Judgement judge = new Judgement(path, contestOutputFile, contestInputFile, outputJudgeFile, solution.ID, prob.ID);

                        JudgeManager.Instance.AddSolution(judge);
                        //Thread thread = new Thread(judge.GoToJudgement);
                        //thread.Start();

                    }
                }

                Response.Redirect(HttpContext.Current.Request.Url.ToString());
            }
            else
                ltlErrorMessage.Text = "*You have to select an exe file.";
        }
        else
            Response.Redirect("Rank.aspx");
    }
Exemplo n.º 18
0
 public override string ToString() => $"{Type} (Score:{Judgement.NumericResultFor(this)} HP:{Judgement.HealthPointIncreaseFor(this)} {Judgement})";
Exemplo n.º 19
0
 protected override HitResult GetSimulatedHitResult(Judgement judgement)
 {
     // Users are not expected to attain perfect judgements for all notes due to the tighter hit window.
     return(judgement.MaxResult == HitResult.Perfect ? HitResult.Great : judgement.MaxResult);
 }
 public void AddSolution(Judgement j)
 {
     allSolution.Add(j);
 }
Exemplo n.º 21
0
 public DrawableOsuJudgement(Judgement judgement, DrawableHitObject judgedObject)
     : base(judgement, judgedObject)
 {
 }
Exemplo n.º 22
0
 public DivaJudgementResult(DivaHitObject hitObject, Judgement judgement)
     : base(hitObject, judgement)
 {
 }
Exemplo n.º 23
0
 private void onJudgement(DrawableHitObject judgedObject, Judgement judgement) => catcherArea.OnJudgement((DrawableCatchHitObject)judgedObject, judgement);
Exemplo n.º 24
0
 public OsuJudgementResult(Judgement judgement)
     : base(judgement)
 {
 }
        private void PulseRotattion()
        {
            //actions=auto_attack
            //actions+=/rebuke
            //actions+=/potion,name=old_war,if=(buff.bloodlust.react|buff.avenging_wrath.up|buff.crusade.up&buff.crusade.remains<25|target.time_to_die<=40)
            //actions+=/use_item,name=faulty_countermeasure,if=(buff.avenging_wrath.up|buff.crusade.up)
            //actions+=/blood_fury
            //actions+=/berserking
            //actions+=/arcane_torrent,if=holy_power<5&(buff.crusade.up|buff.avenging_wrath.up|time<2)
            //actions+=/judgment,if=time<2
            //actions+=/blade_of_justice,if=time<2&(equipped.137048|race.blood_elf)
            //actions+=/divine_hammer,if=time<2&(equipped.137048|race.blood_elf)
            //actions+=/wake_of_ashes,if=holy_power<=1&time<2
            //actions+=/holy_wrath
            //actions+=/avenging_wrath
            //actions+=/shield_of_vengeance
            //actions+=/crusade,if=holy_power>=5&!equipped.137048|((equipped.137048|race.blood_elf)&time<2|time>2&holy_power>=4)

            //actions+=/execution_sentence,if=spell_targets.divine_storm<=3&(cooldown.judgment.remains<gcd*4.5|debuff.judgment.remains>gcd*4.67)&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*2)
            if (TalentExecutionSentence && CanCastFinisher3hp)
            {
                if (TargetsDivineStorm <= 3 && (Judgement.SpellCooldownRemaining < Gcd * 4.5 || JudgementDebuff.TargetDebuffRemaining > Gcd * 4.67) &&
                    (!TalentCrusade || Crusade.SpellCooldownRemaining > Gcd * 2))
                {
                    if (ExecutionSentence.SpellCanCast && InMeleeRange)
                    {
                        ExecutionSentence.Cast();
                        return;
                    }
                }
            }


            //actions+=/divine_storm,if=debuff.judgment.up&spell_targets.divine_storm>=2&buff.divine_purpose.up&buff.divine_purpose.remains<gcd*2
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && TargetsDivineStorm >= 2 && DivinePurpose.PlayerBuff && DivinePurpose.PlayerBuffRemaining < Gcd * 2)
                {
                    if (DivineStorm.SpellCanCastBlind && InMeleeRange)
                    {
                        DivineStorm.Cast();
                        return;
                    }
                }
            }

            //actions+=/divine_storm,if=debuff.judgment.up&spell_targets.divine_storm>=2&holy_power>=5&buff.divine_purpose.react
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && TargetsDivineStorm >= 2 && HolyPower >= 5 && DivinePurpose.PlayerBuff)
                {
                    if (DivineStorm.SpellCanCastBlind && InMeleeRange)
                    {
                        DivineStorm.Cast();
                        return;
                    }
                }
            }

            //actions+=/divine_storm,if=debuff.judgment.up&spell_targets.divine_storm>=2&holy_power>=3&buff.crusade.up&(buff.crusade.stack<15|buff.bloodlust.up)
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && TargetsDivineStorm >= 2 && HolyPower >= 3 && Crusade.PlayerBuff && (Crusade.PlayerBuffStacks < 15 || BloodLustUp))
                {
                    if (DivineStorm.SpellCanCastBlind && InMeleeRange)
                    {
                        DivineStorm.Cast();
                        return;
                    }
                }
            }

            //actions+=/divine_storm,if=debuff.judgment.up&spell_targets.divine_storm>=2&holy_power>=5&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*3)
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && TargetsDivineStorm >= 2 && HolyPower >= 5 && (!TalentCrusade || Crusade.PlayerBuffRemaining > Gcd * 3))
                {
                    if (DivineStorm.SpellCanCastBlind && InMeleeRange)
                    {
                        DivineStorm.Cast();
                        return;
                    }
                }
            }

            //actions+=/templars_verdict,if=debuff.judgment.up&buff.divine_purpose.up&buff.divine_purpose.remains<gcd*2
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && DivinePurpose.PlayerBuff && DivinePurpose.PlayerBuffRemaining < Gcd * 2)
                {
                    if (TemplarVerdict.SpellCanCast && InMeleeRange)
                    {
                        TemplarVerdict.Cast();
                        return;
                    }
                }
            }

            //actions+=/templars_verdict,if=debuff.judgment.up&holy_power>=5&buff.divine_purpose.react
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && HolyPower >= 5 && DivinePurpose.PlayerBuff)
                {
                    if (TemplarVerdict.SpellCanCast && InMeleeRange)
                    {
                        TemplarVerdict.Cast();
                        return;
                    }
                }
            }

            //actions+=/templars_verdict,if=debuff.judgment.up&holy_power>=3&buff.crusade.up&(buff.crusade.stack<15|buff.bloodlust.up)
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && HolyPower >= 3 && Crusade.PlayerBuff && (Crusade.PlayerBuffStacks < 15 || BloodLustUp))
                {
                    if (TemplarVerdict.SpellCanCast && InMeleeRange)
                    {
                        TemplarVerdict.Cast();
                        return;
                    }
                }
            }

            //actions+=/templars_verdict,if=debuff.judgment.up&holy_power>=5&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*3)
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && HolyPower >= 5 && (!TalentCrusade || Crusade.SpellCooldownRemaining > Gcd * 3))
                {
                    if (TemplarVerdict.SpellCanCast && InMeleeRange)
                    {
                        TemplarVerdict.Cast();
                        return;
                    }
                }
            }

            //actions+=/divine_storm,if=debuff.judgment.up&holy_power>=3&spell_targets.divine_storm>=2&(cooldown.wake_of_ashes.remains<gcd*2&artifact.wake_of_ashes.enabled|buff.whisper_of_the_nathrezim.up&buff.whisper_of_the_nathrezim.remains<gcd)&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*4)
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && HolyPower >= 3 && TargetsDivineStorm >= 2 &&
                    (WakeOfAshes.SpellCooldownRemaining < Gcd * 2 /*&& true*/ || WhisperOfTheNathrezim.PlayerBuff && WhisperOfTheNathrezim.PlayerBuffRemaining < Gcd) &&
                    (!TalentCrusade || Crusade.SpellCooldownRemaining > Gcd * 4))
                {
                    if (DivineStorm.SpellCanCastBlind && InMeleeRange)
                    {
                        DivineStorm.Cast();
                        return;
                    }
                }
            }

            //actions+=/templars_verdict,if=debuff.judgment.up&holy_power>=3&(cooldown.wake_of_ashes.remains<gcd*2&artifact.wake_of_ashes.enabled|buff.whisper_of_the_nathrezim.up&buff.whisper_of_the_nathrezim.remains<gcd)&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*4)
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && HolyPower >= 3 &&
                    (WakeOfAshes.SpellCooldownRemaining < Gcd * 2 /*&& true*/ || WhisperOfTheNathrezim.PlayerBuff && WhisperOfTheNathrezim.PlayerBuffRemaining < Gcd) &&
                    (!TalentCrusade || Crusade.SpellCooldownRemaining > Gcd * 4))
                {
                    if (TemplarVerdict.SpellCanCast && InMeleeRange)
                    {
                        TemplarVerdict.Cast();
                        return;
                    }
                }
            }

            //actions+=/wake_of_ashes,if=holy_power=0|holy_power=1&(cooldown.blade_of_justice.remains>gcd|cooldown.divine_hammer.remains>gcd)|holy_power=2&(cooldown.zeal.charges_fractional<=0.65|cooldown.crusader_strike.charges_fractional<=0.65)
            if (HolyPower <= 1 && (BladeOfJustice.SpellCooldownRemaining > Gcd || DivineHammer.SpellCooldownRemaining > Gcd) ||
                HolyPower == 2 && (Zeal.SpellChargesFractional <= 0.65 || CrusaderStrike.SpellChargesFractional <= 0.65))
            {
                if (WakeOfAshes.SpellCanCastBlind && InMeleeRange)
                {
                    WakeOfAshes.Cast();
                    return;
                }
            }

            //actions+=/blade_of_justice,if=holy_power<=3&buff.whisper_of_the_nathrezim.up&buff.whisper_of_the_nathrezim.remains>gcd&buff.whisper_of_the_nathrezim.remains<gcd*3&debuff.judgment.up&debuff.judgment.remains>gcd*2
            if (!TalentDivineHammer)
            {
                if (HolyPower <= 3 && WhisperOfTheNathrezim.PlayerBuff && WhisperOfTheNathrezim.PlayerBuffRemaining > Gcd && WhisperOfTheNathrezim.PlayerBuffRemaining < Gcd * 3 &&
                    JudgementDebuff.TargetDebuff && JudgementDebuff.TargetDebuffRemaining > Gcd * 2)
                {
                    if (BladeOfJustice.SpellCanCast)
                    {
                        BladeOfJustice.Cast();
                        return;
                    }
                }
            }

            //actions+=/divine_hammer,if=holy_power<=3&buff.whisper_of_the_nathrezim.up&buff.whisper_of_the_nathrezim.remains>gcd&buff.whisper_of_the_nathrezim.remains<gcd*3&debuff.judgment.up&debuff.judgment.remains>gcd*2
            if (TalentDivineHammer)
            {
                if (HolyPower <= 3 && WhisperOfTheNathrezim.PlayerBuff && WhisperOfTheNathrezim.PlayerBuffRemaining > Gcd && WhisperOfTheNathrezim.PlayerBuffRemaining < Gcd * 3 &&
                    JudgementDebuff.TargetDebuff && JudgementDebuff.TargetDebuffRemaining > Gcd * 2)
                {
                    if (DivineHammer.SpellCanCastBlind && InMeleeRange)
                    {
                        DivineHammer.Cast();
                        return;
                    }
                }
            }

            //actions+=/blade_of_justice,if=talent.blade_of_wrath.enabled&holy_power<=3
            if (!TalentDivineHammer)
            {
                if (TalentBladeOfWrath && HolyPower <= 3)
                {
                    if (BladeOfJustice.SpellCanCast)
                    {
                        BladeOfJustice.Cast();
                        return;
                    }
                }
            }

            //actions+=/zeal,if=charges=2&holy_power<=4
            if (TalentZeal)
            {
                if (Zeal.SpellCharges == 2 && HolyPower <= 4)
                {
                    if (Zeal.SpellCanCastBlind && InMeleeRange)
                    {
                        Zeal.Cast();
                        return;
                    }
                }
            }

            //actions+=/crusader_strike,if=charges=2&holy_power<=4
            if (!TalentZeal)
            {
                if (CrusaderStrike.SpellCharges == 2 && HolyPower <= 4)
                {
                    if (CrusaderStrike.SpellCanCastBlind && InMeleeRange)
                    {
                        CrusaderStrike.Cast();
                        return;
                    }
                }
            }

            //actions+=/blade_of_justice,if=holy_power<=2|(holy_power<=3&(cooldown.zeal.charges_fractional<=1.34|cooldown.crusader_strike.charges_fractional<=1.34))
            if (!TalentDivineHammer)
            {
                if (HolyPower <= 2 || (HolyPower <= 3 && (Zeal.SpellChargesFractional <= 1.34 || CrusaderStrike.SpellChargesFractional <= 1.34)))
                {
                    if (BladeOfJustice.SpellCanCast)
                    {
                        BladeOfJustice.Cast();
                        return;
                    }
                }
            }

            //actions+=/divine_hammer,if=holy_power<=2|(holy_power<=3&(cooldown.zeal.charges_fractional<=1.34|cooldown.crusader_strike.charges_fractional<=1.34))
            if (TalentDivineHammer)
            {
                if (HolyPower <= 2 || (HolyPower <= 3 && (Zeal.SpellChargesFractional <= 1.34 || CrusaderStrike.SpellChargesFractional <= 1.34)))
                {
                    if (DivineHammer.SpellCanCastBlind && InMeleeRange)
                    {
                        DivineHammer.Cast();
                        return;
                    }
                }
            }

            //actions+=/judgment,if=holy_power>=3|((cooldown.zeal.charges_fractional<=1.67|cooldown.crusader_strike.charges_fractional<=1.67)&(cooldown.divine_hammer.remains>gcd|cooldown.blade_of_justice.remains>gcd))|(talent.greater_judgment.enabled&target.health.pct>50)
            if (HolyPower >= 3 ||
                ((Zeal.SpellChargesFractional <= 1.67 || CrusaderStrike.SpellChargesFractional <= 1.67) &&
                 (DivineHammer.SpellCooldownRemaining > Gcd || BladeOfJustice.SpellCooldownRemaining > Gcd)) || (TalentGreaterJudgment && WoW.TargetHealthPercent > 50))
            {
                if (Judgement.SpellCanCast && InMeleeRange)
                {
                    Judgement.Cast();
                    return;
                }
            }

            //actions+=/consecration
            if (TalentConsecration)
            {
                if (true)
                {
                    if (Consecration.SpellCanCastBlind && InMeleeRange)
                    {
                        Consecration.Cast();
                        return;
                    }
                }
            }

            //actions+=/divine_storm,if=debuff.judgment.up&spell_targets.divine_storm>=2&buff.divine_purpose.react
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && TargetsDivineStorm >= 2 && DivinePurpose.PlayerBuff)
                {
                    if (DivineStorm.SpellCanCastBlind && InMeleeRange)
                    {
                        DivineStorm.Cast();
                        return;
                    }
                }
            }

            //actions+=/divine_storm,if=debuff.judgment.up&spell_targets.divine_storm>=2&buff.the_fires_of_justice.react&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*3)
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && TargetsDivineStorm >= 2 && TheFiresOfJustice.PlayerBuff && (!TalentCrusade || Crusade.SpellCooldownRemaining > Gcd * 3))
                {
                    if (DivineStorm.SpellCanCastBlind && InMeleeRange)
                    {
                        DivineStorm.Cast();
                        return;
                    }
                }
            }

            //actions+=/divine_storm,if=debuff.judgment.up&spell_targets.divine_storm>=2&(holy_power>=4|((cooldown.zeal.charges_fractional<=1.34|cooldown.crusader_strike.charges_fractional<=1.34)&(cooldown.divine_hammer.remains>gcd|cooldown.blade_of_justice.remains>gcd)))&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*4)
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && TargetsDivineStorm >= 2 &&
                    (HolyPower >= 4 ||
                     ((Zeal.SpellChargesFractional <= 1.34 || CrusaderStrike.SpellChargesFractional <= 1.34) &&
                      (DivineHammer.SpellCooldownRemaining > Gcd || BladeOfJustice.SpellCooldownRemaining > Gcd))) && (!TalentCrusade || Crusade.SpellCooldownRemaining > Gcd * 4))
                {
                    if (DivineStorm.SpellCanCastBlind && InMeleeRange)
                    {
                        DivineStorm.Cast();
                        return;
                    }
                }
            }

            //actions+=/templars_verdict,if=debuff.judgment.up&buff.divine_purpose.react
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && DivinePurpose.PlayerBuff)
                {
                    if (TemplarVerdict.SpellCanCast && InMeleeRange)
                    {
                        TemplarVerdict.Cast();
                        return;
                    }
                }
            }

            //actions+=/templars_verdict,if=debuff.judgment.up&buff.the_fires_of_justice.react&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*3)
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && TheFiresOfJustice.PlayerBuff && (!TalentCrusade || Crusade.SpellCooldownRemaining > Gcd * 3))
                {
                    if (TemplarVerdict.SpellCanCast && InMeleeRange)
                    {
                        TemplarVerdict.Cast();
                        return;
                    }
                }
            }

            //actions+=/templars_verdict,if=debuff.judgment.up&(holy_power>=4|((cooldown.zeal.charges_fractional<=1.34|cooldown.crusader_strike.charges_fractional<=1.34)&(cooldown.divine_hammer.remains>gcd|cooldown.blade_of_justice.remains>gcd)))&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*4)
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff &&
                    (HolyPower >= 4 ||
                     ((Zeal.SpellChargesFractional <= 1.34 || CrusaderStrike.SpellChargesFractional <= 1.34) &&
                      (DivineHammer.SpellCooldownRemaining > Gcd || BladeOfJustice.SpellCooldownRemaining > Gcd))) && (!TalentCrusade || Crusade.SpellCooldownRemaining > Gcd * 4))
                {
                    if (TemplarVerdict.SpellCanCast && InMeleeRange)
                    {
                        TemplarVerdict.Cast();
                        return;
                    }
                }
            }

            //actions+=/zeal,if=holy_power<=4
            if (TalentZeal)
            {
                if (HolyPower <= 4)
                {
                    if (Zeal.SpellCanCastBlind && InMeleeRange)
                    {
                        Zeal.Cast();
                        return;
                    }
                }
            }


            //actions+=/crusader_strike,if=holy_power<=4
            if (!TalentZeal)
            {
                if (HolyPower <= 4)
                {
                    if (CrusaderStrike.SpellCanCast && InMeleeRange)
                    {
                        CrusaderStrike.Cast();
                        return;
                    }
                }
            }


            //actions+=/divine_storm,if=debuff.judgment.up&holy_power>=3&spell_targets.divine_storm>=2&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*5)
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && HolyPower >= 3 && TargetsDivineStorm >= 2 && (!TalentCrusade || Crusade.SpellCooldownRemaining > Gcd * 5))
                {
                    if (DivineStorm.SpellCanCastBlind && InMeleeRange)
                    {
                        DivineStorm.Cast();
                        return;
                    }
                }
            }

            //actions+=/templars_verdict,if=debuff.judgment.up&holy_power>=3&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*5)
            if (CanCastFinisher3hp)
            {
                if (JudgementDebuff.TargetDebuff && HolyPower >= 3 && (!TalentCrusade || Crusade.SpellCooldownRemaining > Gcd * 5))
                {
                    if (TemplarVerdict.SpellCanCast && InMeleeRange)
                    {
                        TemplarVerdict.Cast();
                    }
                }
            }
        }
Exemplo n.º 26
0
 protected override JudgementResult CreateResult(HitObject hitObject, Judgement judgement) =>
 new DivaJudgementResult((DivaHitObject)hitObject, judgement);
Exemplo n.º 27
0
 /// <summary>
 /// Triggered when a new <see cref="Judgement"/> occurs on a <see cref="DrawableHitObject"/>.
 /// </summary>
 /// <param name="judgedObject">The object that <paramref name="judgement"/> occured for.</param>
 /// <param name="judgement">The <see cref="Judgement"/> that occurred.</param>
 public virtual void OnJudgement(DrawableHitObject judgedObject, Judgement judgement)
 {
 }
Exemplo n.º 28
0
 protected override JudgementResult CreateResult(HitObject hitObject, Judgement judgement) => new OsuJudgementResult(hitObject, judgement);
Exemplo n.º 29
0
        public static void ConvertJudgements()
        {

            string sql = @"

IF EXISTS (SELECT * FROM sysobjects WHERE [type] = N'U' AND [name] = N'bbsMax_Judgements') BEGIN
    SELECT * FROM bbsMax_Judgements;
END
ELSE
    SELECT -9999 AS JudgementID;
";
            JudgementSettings setting = new JudgementSettings();
            JudgementCollection judgements = new JudgementCollection();

            using (SqlConnection connection = new SqlConnection(Settings.Current.IConnectionString))
            {
                connection.Open();
                SqlCommand command = new SqlCommand(sql, connection);
                command.CommandTimeout = 60;
                try
                {
                    bool hasCreateErrorLog = false;
                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            int id = reader.GetInt32(reader.GetOrdinal("JudgementID"));

                            if (id == -9999)
                                return;

                            Judgement judgement = new Judgement();
                            judgement.ID = id;
                            judgement.Description = reader.GetString(reader.GetOrdinal("JudgementDescription"));
                            //judgement.LogoUrlSrc = reader.GetString(reader.GetOrdinal("Url"));


                            string imgUrl = reader.GetString(reader.GetOrdinal("JudgementLogoUrl")).Replace("\\", "/").Trim();


                            int i = imgUrl.LastIndexOf("/") + 1;

                            string iconName = string.Empty;
                            if (imgUrl.Length > i)
                            {
                                iconName = imgUrl.Substring(i, imgUrl.Length - i);


                                string targetDir = MaxLabs.bbsMax.UrlUtil.JoinUrl(MaxLabs.bbsMax.Globals.ApplicationPath, "/max-assets/icon-judgement/");
                                string targetIconUrl = targetDir + iconName;

                                imgUrl = MaxLabs.bbsMax.UrlUtil.JoinUrl(MaxLabs.bbsMax.Globals.ApplicationPath, imgUrl);
                                if (File.Exists(imgUrl))
                                {
                                    if (File.Exists(targetIconUrl))
                                    {
                                    }
                                    else
                                    {
                                        try
                                        {
                                            if (Directory.Exists(targetDir) == false)
                                                Directory.CreateDirectory(targetDir);
                                            File.Move(imgUrl, targetIconUrl);
                                        }
                                        catch
                                        {
                                            if (hasCreateErrorLog == false)
                                            {
                                                hasCreateErrorLog = true;
                                                ErrorMessages.Add("�ƶ��������ͼ��ʧ��,���ֶ��ѡ�/Images/Judgements/��Ŀ¼�µ�����ͼ�긴�Ƶ���/max-assets/icon-judgement/��Ŀ¼��");
                                            }
                                        }
                                    }
                                }

                                judgement.LogoUrlSrc = "~/max-assets/icon-judgement/" + iconName;
                            }
                            else
                                judgement.LogoUrlSrc = string.Empty;

                            judgements.Add(judgement);

                            if (setting.MaxId < judgement.ID)
                                setting.MaxId = judgement.ID;
                        }
                    }

                    setting.Judgements = judgements;

                    sql = @"
UPDATE bx_Settings SET [Value] = @SettingString WHERE TypeName = 'MaxLabs.bbsMax.Settings.JudgementSettings' AND [Key] = '*';
IF @@ROWCOUNT = 0
    INSERT INTO bx_Settings ([Key], [Value], [TypeName]) VALUES ('*', @SettingString, 'MaxLabs.bbsMax.Settings.JudgementSettings');


DROP TABLE bbsMax_Judgements;
";
                    command.CommandText = sql;

                    SqlParameter param = new SqlParameter("@SettingString", SqlDbType.NText);
                    param.Value = setting.ToString();
                    command.Parameters.Add(param);

                    command.ExecuteNonQuery();


                }
                catch (Exception ex)
                {
                    CreateLog(ex);
                    throw new Exception("�����������ͼ������ʧ��" + ex.Message + sql);
                }
                finally
                {
                    connection.Close();
                }
            }
        }
Exemplo n.º 30
0
 /// <summary>
 /// Notifies subscribers of <see cref="NewJudgement"/> that a new judgement has occurred.
 /// </summary>
 /// <param name="judgement">The judgement to notify subscribers of.</param>
 protected void NotifyNewJudgement(Judgement judgement)
 {
     NewJudgement?.Invoke(judgement);
 }
Exemplo n.º 31
0
        /// <summary>
        /// Retrieves the total score of a <see cref="ScoreInfo"/> in the given <see cref="ScoringMode"/>.
        /// </summary>
        /// <param name="score">The <see cref="ScoreInfo"/> to calculate the total score of.</param>
        /// <param name="mode">The <see cref="ScoringMode"/> to return the total score as.</param>
        /// <param name="cancellationToken">A <see cref="CancellationToken"/> to cancel the process.</param>
        /// <returns>The total score.</returns>
        public async Task <long> GetTotalScoreAsync([NotNull] ScoreInfo score, ScoringMode mode = ScoringMode.Standardised, CancellationToken cancellationToken = default)
        {
            // TODO: This is required for playlist aggregate scores. They should likely not be getting here in the first place.
            if (string.IsNullOrEmpty(score.BeatmapInfo.Hash))
            {
                return(score.TotalScore);
            }

            int    beatmapMaxCombo;
            double accuracy = score.Accuracy;

            if (score.IsLegacyScore)
            {
                if (score.RulesetID == 3)
                {
                    // In osu!stable, a full-GREAT score has 100% accuracy in mania. Along with a full combo, the score becomes indistinguishable from a full-PERFECT score.
                    // To get around this, recalculate accuracy based on the hit statistics.
                    // Note: This cannot be applied universally to all legacy scores, as some rulesets (e.g. catch) group multiple judgements together.
                    double maxBaseScore = score.Statistics.Select(kvp => kvp.Value).Sum() * Judgement.ToNumericResult(HitResult.Perfect);
                    double baseScore    = score.Statistics.Select(kvp => Judgement.ToNumericResult(kvp.Key) * kvp.Value).Sum();
                    if (maxBaseScore > 0)
                    {
                        accuracy = baseScore / maxBaseScore;
                    }
                }

                // This score is guaranteed to be an osu!stable score.
                // The combo must be determined through either the beatmap's max combo value or the difficulty calculator, as lazer's scoring has changed and the score statistics cannot be used.
                if (score.BeatmapInfo.MaxCombo != null)
                {
                    beatmapMaxCombo = score.BeatmapInfo.MaxCombo.Value;
                }
                else
                {
                    if (difficulties == null)
                    {
                        return(score.TotalScore);
                    }

                    // We can compute the max combo locally after the async beatmap difficulty computation.
                    var difficulty = await difficulties().GetDifficultyAsync(score.BeatmapInfo, score.Ruleset, score.Mods, cancellationToken).ConfigureAwait(false);

                    // Something failed during difficulty calculation. Fall back to provided score.
                    if (difficulty == null)
                    {
                        return(score.TotalScore);
                    }

                    beatmapMaxCombo = difficulty.Value.MaxCombo;
                }
            }
            else
            {
                // This is guaranteed to be a non-legacy score.
                // The combo must be determined through the score's statistics, as both the beatmap's max combo and the difficulty calculator will provide osu!stable combo values.
                beatmapMaxCombo = Enum.GetValues(typeof(HitResult)).OfType <HitResult>().Where(r => r.AffectsCombo()).Select(r => score.Statistics.GetValueOrDefault(r)).Sum();
            }

            if (beatmapMaxCombo == 0)
            {
                return(0);
            }

            var ruleset        = score.Ruleset.CreateInstance();
            var scoreProcessor = ruleset.CreateScoreProcessor();

            scoreProcessor.Mods.Value = score.Mods;

            return((long)Math.Round(scoreProcessor.GetScore(mode, accuracy, (double)score.MaxCombo / beatmapMaxCombo, score.Statistics)));
        }
Exemplo n.º 32
0
 internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement)
 {
     getStageByColumn(((ManiaHitObject)judgedObject.HitObject).Column).OnJudgement(judgedObject, judgement);
 }
Exemplo n.º 33
0
 /// <summary>
 ///     Adds a judgement to the score and recalculates the score.
 /// </summary>
 public abstract void CalculateScore(Judgement judgement);
Exemplo n.º 34
0
        private void ValidateJudgment(Judgement jud, MessageDisplay msgDisp, int rowindex)
        {

            if (string.IsNullOrEmpty(jud.Description))
            {
                msgDisp.AddError(new CustomError("description", rowindex, Lang_Error.Judgement_EmptyDescriptionError));
            }

            if (string.IsNullOrEmpty(jud.LogoUrl))
            {
                msgDisp.AddError(new CustomError("logourl", rowindex, Lang_Error.Judgement_EmptyLogoUrlError));
            }
        }
Exemplo n.º 35
0
 /// <summary>
 /// Creates the <see cref="JudgementResult"/> that represents the scoring result for this <see cref="DrawableHitObject"/>.
 /// </summary>
 /// <param name="judgement">The <see cref="Judgement"/> that provides the scoring information.</param>
 protected virtual JudgementResult CreateResult(Judgement judgement) => new JudgementResult(judgement);
Exemplo n.º 36
0
    // Use this for initialization
    void Start()
    {
        currentHealth = maxHealth;

        //Initialize Abilities - TODO Should this be done statically?
        dStrike = new Decisive_Strike();
        dStrike.setScript(this);
        courage = new Courage();
        courage.setScript(this);
        judgement = new Judgement();
        judgement.setScript(this);
        dJustice = new Demacian_Justice();
        dJustice.setScript(this);
        valor = new Valor();
        valor.setScript(this);

        IconWidth = judgementTexture.width;
        IconHeight = judgementTexture.height;

        //Initially not running
        running = false;

        idling = true;

        a = gameObject.GetComponent(typeof(Animation)) as Animation;

        originalRotation = transform.localRotation;
        spinning = false;

        alive = true;
    }
Exemplo n.º 37
0
 /// <summary>
 /// Creates the <see cref="JudgementResult"/> that represents the scoring result for a <see cref="HitObject"/>.
 /// </summary>
 /// <param name="hitObject">The <see cref="HitObject"/> which was judged.</param>
 /// <param name="judgement">The <see cref="Judgement"/> that provides the scoring information.</param>
 protected virtual JudgementResult CreateResult(HitObject hitObject, Judgement judgement) => new JudgementResult(hitObject, judgement);
Exemplo n.º 38
0
 protected DirectConclusion()
 {
     _premice = new Judgement();
     _type = new DirectConclusionType();
 }
Exemplo n.º 39
0
    public void SpawnVFXOnResolve(NoteObject note,
                                  Judgement judgement)
    {
        // Even if judgement is Miss or Break, we still need
        // to despawn ongoing VFX, if any.

        switch (note.note.type)
        {
        case NoteType.Basic:
        case NoteType.ChainHead:
        case NoteType.ChainNode:
            switch (judgement)
            {
            case Judgement.RainbowMax:
            case Judgement.Max:
                SpawnPrefabAt(explosionMax, note);
                break;

            case Judgement.Cool:
                SpawnPrefabAt(explosionCool, note);
                break;

            case Judgement.Good:
                SpawnPrefabAt(explosionGood, note);
                break;
            }
            break;

        case NoteType.Hold:
            if (holdNoteToOngoingHeadVfx.ContainsKey(note))
            {
                Destroy(holdNoteToOngoingHeadVfx[note]);
                holdNoteToOngoingHeadVfx.Remove(note);
            }
            if (holdNoteToOngoingTrailVfx.ContainsKey(note))
            {
                Destroy(holdNoteToOngoingTrailVfx[note]);
                holdNoteToOngoingTrailVfx.Remove(note);
            }
            if (judgement != Judgement.Miss &&
                judgement != Judgement.Break)
            {
                SpawnPrefabAt(holdComplete,
                              note.GetComponent <NoteAppearance>()
                              .GetDurationTrailEndPosition());
            }
            break;

        case NoteType.Drag:
            if (dragNoteToOngoingVfx.ContainsKey(note))
            {
                Destroy(dragNoteToOngoingVfx[note]);
                dragNoteToOngoingVfx.Remove(note);
            }
            if (judgement != Judgement.Miss &&
                judgement != Judgement.Break)
            {
                SpawnPrefabAt(dragComplete,
                              note.GetComponent <NoteAppearance>()
                              .GetCurveEndPosition());
            }
            break;

        case NoteType.RepeatHead:
            if (judgement == Judgement.Miss ||
                judgement == Judgement.Break)
            {
                break;
            }
            SpawnPrefabAt(repeatHead, note);
            break;

        case NoteType.Repeat:
            if (judgement == Judgement.Miss ||
                judgement == Judgement.Break)
            {
                break;
            }
            SpawnPrefabAt(repeatNote, note);
            SpawnPrefabAt(repeatHead,
                          note.GetComponent <NoteAppearance>()
                          .GetRepeatHead().GetComponent <NoteObject>());
            break;

        case NoteType.RepeatHeadHold:
            if (holdNoteToOngoingHeadVfx.ContainsKey(note))
            {
                Destroy(holdNoteToOngoingHeadVfx[note]);
                holdNoteToOngoingHeadVfx.Remove(note);
            }
            if (holdNoteToOngoingTrailVfx.ContainsKey(note))
            {
                Destroy(holdNoteToOngoingTrailVfx[note]);
                holdNoteToOngoingTrailVfx.Remove(note);
            }
            if (judgement != Judgement.Miss &&
                judgement != Judgement.Break)
            {
                SpawnPrefabAt(repeatHoldComplete,
                              note.GetComponent <NoteAppearance>()
                              .GetDurationTrailEndPosition());
            }
            break;

        case NoteType.RepeatHold:
            NoteObject repeatHeadNote = note
                                        .GetComponent <NoteAppearance>()
                                        .GetRepeatHead().GetComponent <NoteObject>();
            if (holdNoteToOngoingHeadVfx
                .ContainsKey(repeatHeadNote))
            {
                Destroy(holdNoteToOngoingHeadVfx
                        [repeatHeadNote]);
                holdNoteToOngoingHeadVfx.Remove(
                    repeatHeadNote);
            }
            if (holdNoteToOngoingTrailVfx.ContainsKey(note))
            {
                Destroy(holdNoteToOngoingTrailVfx[note]);
                holdNoteToOngoingTrailVfx.Remove(note);
            }
            if (judgement != Judgement.Miss &&
                judgement != Judgement.Break)
            {
                SpawnPrefabAt(repeatHoldComplete,
                              note.GetComponent <NoteAppearance>()
                              .GetDurationTrailEndPosition());
            }
            break;
        }
    }
Exemplo n.º 40
0
    // Use this for initialization
    void Start()
    {
        //Initialize Abilities - TODO Should this be done statically?
        dStrike = new Decisive_Strike();
        dStrike.setScript(this);
        courage = new Courage();
        courage.setScript(this);
        judgement = new Judgement();
        judgement.setScript(this);
        dJustice = new Demacian_Justice();
        dJustice.setScript(this);
        valor = new Valor();
        valor.setScript(this);

        level = 1;

        IconWidth = judgementTexture.width;
        IconHeight = judgementTexture.height;

        //Initially not running
        running = false;

        idling = true;

        a = gameObject.GetComponent(typeof(Animation)) as Animation;

        originalRotation = transform.localRotation;
        spinning = false;

        alive = true;

        inventory = new Item[inventorySize];

        TwoHandedSword startingSword = new TwoHandedSword();
        startingSword.randomizeWeapon(1, 1);
        awardItem(startingSword);

        Helm startingHelm = new Helm();
        startingHelm.randomizeArmor(1, 1);
        awardItem(startingHelm);

        Chest startingChest = new Chest();
        startingChest.randomizeArmor(1, 1);
        awardItem(startingChest);

        Gloves startingGloves = new Gloves();
        startingGloves.randomizeArmor(1, 1);
        awardItem(startingGloves);

        Boots startingBoots = new Boots();
        startingBoots.randomizeArmor(1, 1);
        awardItem(startingBoots);

        checkpointTexture = Resources.Load("CheckpointTexture/CheckpointMaybe") as Texture2D;
        playerPortrait = Resources.Load("CheckpointTexture/garen_circle") as Texture2D;
        playerManaTexture = Resources.Load("PlayerTextures/mana") as Texture2D;

        leftClickOverlay = Resources.Load("InstructionPage/leftclick") as Texture2D;
        rightClickOverlay = Resources.Load("InstructionPage/rightclick") as Texture2D;

        winTexture = Resources.Load("GUITextures/victoryFull") as Texture2D;
        lossTexture = Resources.Load("GUITextures/defeatFull") as Texture2D;
        continueButton = Resources.Load("InstructionPage/Continue") as Texture2D;
        continueButtonHighlighted = Resources.Load("InstructionPage/Continue2") as Texture2D;

        equipment = new Item[5]; //TODO decide on size

        equipmentRect = new Rect(50, 50, 300, 300);
        inventoryRect = new Rect(Screen.width - 350, 50, 300, Mathf.Ceil(inventorySize / 6) * 50 + 20);
        confirmRect = new Rect((Screen.width / 2) - 150, Screen.height / 4, 300, 300);
        continueRect = new Rect((Screen.width / 2) - (continueButton.width / 2), Screen.height * (3.0f/4.0f), continueButton.width, continueButton.height);

        movementSpeed = 1;

        recalculateStats();

        if(PlayerPrefs.GetString("IsSaveGame") == "true"){
            name = PlayerPrefs.GetString("SaveFileName");
            Load();
        }

        currentHealth = maxHealth;

        Save();
    }
    private void ReJudge(long id)
    {
        ProgrammingContestDataContextHandler pcdch = new ProgrammingContestDataContextHandler();
        Solution solution = pcdch.Solution.GetById(id);
        solution.Result = pcdch.Result.GetByName("Pending");
        solution.ResultId = pcdch.Result.GetByName("Pending").ID;

        string rejudge = "";
        string path = Server.MapPath("../Solution");
        path += "\\" + solution.UserId.ToString();
        path += "\\" + solution.ProblemId.ToString();
        path += "\\" + solution.ID.ToString();
        rejudge = path;
        path += "\\" + solution.FileName;

        Problem prob = pcdch.Problems.GetById(solution.ProblemId);

        string inputJudgeFile = Server.MapPath("../JudgeSolution");
        inputJudgeFile += "\\" + prob.ID.ToString() + "\\" + prob.InputFile;
        FileInfo rrr1 = new FileInfo(inputJudgeFile);

        pcdch.ProgrammingContestDatabase.SubmitChanges();

        if (rrr1.Exists)
        {
            FileInfo fi = new FileInfo(path);
            string contestInputFile = rejudge + "\\" + prob.InputFile;
            rrr1.CopyTo(contestInputFile, true);
            string contestOutputFile = rejudge + "\\" + prob.OutputFile;

            string outputJudgeFile = Server.MapPath("../JudgeSolution");
            outputJudgeFile += "\\" + prob.ID.ToString() + "\\" + prob.OutputFile;

            rrr1 = new FileInfo(outputJudgeFile);

            if (rrr1.Exists)
            {
                Judgement judge = new Judgement(path, contestOutputFile, contestInputFile, outputJudgeFile, solution.ID, prob.ID);

                JudgeManager.Instance.AddSolution(judge);
                //Thread thread = new Thread(judge.GoToJudgement);
                //thread.Start();
            }
        }
        Response.Redirect(HttpContext.Current.Request.Url.ToString());
    }