Skip to content

Commit

Permalink
減算カウンタが正しく動作していなかったのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
TORISOUP committed May 24, 2017
1 parent ad27d6e commit 6f5aee9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Inferno/InfernoScripts/InfernoCore/InfernoScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ protected InfernoScript()
{
foreach (var c in _counterList)
{
c.Update(Interval);
c.Update(100);
}
//完了状態にあるタイマを全て削除
_counterList.RemoveAll(x => x.IsCompleted);
Expand Down
11 changes: 6 additions & 5 deletions Inferno/InfernoScripts/Parupunte/ParupunteCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ protected override void Setup()

OnRecievedInfernoEvent
.OfType<IEventMessage, IsonoMessage>()
.Where(c => IsonoMethod(c.Command, true))
.ThrottleFirst(TimeSpan.FromSeconds(5), InfernoScriptScheduler)
.Retry()
.Subscribe();
.Subscribe(c => IsonoMethod(c.Command, false));

#endregion EventHook

Expand Down Expand Up @@ -156,27 +157,27 @@ protected override void Setup()

}

private bool IsonoMethod(string command)
private bool IsonoMethod(string command, bool isDryRun)
{
var c = command;

if (c.Contains("とまれ"))
{
ParupunteStop();
if (isDryRun) ParupunteStop();
return true;
}

if (IsActive) return false;

if (c.Contains("ぱるぷんて"))
{
ParupunteStart(ChooseParupounteScript());
if (isDryRun) ParupunteStart(ChooseParupounteScript());
return true;
}

var result = IsonoParupunteScripts.Keys.FirstOrDefault(x => command.Contains(x));
if (string.IsNullOrEmpty(result) || !IsonoParupunteScripts.ContainsKey(result)) return false;
ParupunteStart(IsonoParupunteScripts[result]);
if (isDryRun) ParupunteStart(IsonoParupunteScripts[result]);
return true;
}

Expand Down

0 comments on commit 6f5aee9

Please sign in to comment.