Skip to content

Commit

Permalink
fix flashlight
Browse files Browse the repository at this point in the history
  • Loading branch information
Flutterish committed Nov 6, 2022
1 parent ba6b532 commit b99d0e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions Hitokori/Mods/HitokoriModFlashlight.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Framework.Utils;
using osu.Game.Rulesets.Hitokori.Objects.Base;
using osu.Game.Rulesets.Hitokori.UI;
using osu.Game.Rulesets.Mods;
Expand Down Expand Up @@ -32,26 +33,22 @@ public HitokoriFlashlight ( HitokoriModFlashlight mod ) : base( mod ) {

protected override string FragmentShader => "CircularFlashlight";

private float getSizeFor ( int combo ) {
protected override float GetComboScaleFor ( int combo ) {
if ( combo > 200 )
return 0.8f;
else if ( combo > 100 )
return 0.9f;
else
return 1;
return Interpolation.ValueAt( combo, 1, 0.8f, 0, 200 );
}

HitokoriPlayfield Playfield;
public void Update ( Playfield playfield ) {
Playfield = playfield as HitokoriPlayfield;

FlashlightPosition = Playfield.Hitokori.Hi.ToSpaceOfOtherDrawable( Vector2.Zero, Playfield );
FlashlightSize = new Vector2( FLASHLIGHT_SIZE * (float)comboModifier.Value );
}

Bindable<double> comboModifier = new();
protected override void OnComboChange ( ValueChangedEvent<int> e ) {
this.TransformBindableTo( comboModifier, getSizeFor( e.NewValue ), FLASHLIGHT_FADE_DURATION );
protected override void UpdateFlashlightSize ( float size ) {
this.TransformTo( nameof( FlashlightSize ), new Vector2( 0, size * FLASHLIGHT_SIZE ), FLASHLIGHT_FADE_DURATION );
}
}

Expand Down
2 changes: 1 addition & 1 deletion Hitokori/osu.Game.Rulesets.Hitokori.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ppy.osu.Game" Version="2022.927.0" />
<PackageReference Include="ppy.osu.Game" Version="2022.1101.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit b99d0e4

Please sign in to comment.