Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/Rhythia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ public static void RegisterModifiers()
new AutoplayModifier(),
new GhostModifier(),
new StrobeModifier(),
new FlickerModifier(),
new ChaosModifier(),
new VortexModifier(),
new EarthquakeModifier(),
Expand Down
32 changes: 32 additions & 0 deletions scripts/game/modifiers/FlickerModifier.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Godot;

public class FlickerModifier : Modifier, IObjectRenderModifier<Note>
{
public override string Name => "Flicker";

public override Color Color => new(0xc5ff54ff);

public override bool Rankable => true;

public override double ScoreMultiplier => 1.035;

public void ModifyRenderObject(Note note, Attempt attempt)
{
double at = attempt.Settings.ApproachTime;

if (attempt.Progress / 600 / attempt.Speed % at >= at / 2)
{
if (note.Index % 2 == 0)
{
note.Opacity = 0;
}
}
else
{
if (note.Index % 2 != 0)
{
note.Opacity = 0;
}
}
}
}
1 change: 1 addition & 0 deletions scripts/game/modifiers/FlickerModifier.cs.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://ciktlcnrkha2t
3 changes: 3 additions & 0 deletions scripts/map/Replay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ public Replay(string path)
case "Chaos":
Modifiers.Add(new ChaosModifier());
break;
case "Flicker":
Modifiers.Add(new FlickerModifier());
break;
case "Earthquake":
Modifiers.Add(new EarthquakeModifier());
break;
Expand Down
1 change: 1 addition & 0 deletions scripts/skinning/SkinManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public static void Load()
skin.ModAutoplayImage = loadTexture("modifiers/autoplay.png");
skin.ModGhostImage = loadTexture("modifiers/ghost.png");
skin.ModStrobeImage = loadTexture("modifiers/strobe.png");
skin.ModFlickerImage = loadTexture("modifiers/flicker.png");
skin.ModChaosImage = loadTexture("modifiers/chaos.png");
skin.ModVortexImage = loadTexture("modifiers/vortex.png");
skin.ModEarthquakeImage = loadTexture("modifiers/earthquake.png");
Expand Down
2 changes: 2 additions & 0 deletions scripts/skinning/SkinProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ public partial class SkinProfile : RefCounted

public ImageTexture ModStrobeImage { get; set; } = new();

public ImageTexture ModFlickerImage { get; set; } = new();

public ImageTexture ModChaosImage { get; set; } = new();

public ImageTexture ModVortexImage { get; set; } = new();
Expand Down
23 changes: 13 additions & 10 deletions scripts/util/Misc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public static Texture2D GetModIcon(string mod)
case "Strobe":
tex = skin.ModStrobeImage;
break;
case "Flicker":
tex = skin.ModFlickerImage;
break;
case "Chaos":
tex = skin.ModChaosImage;
break;
Expand Down Expand Up @@ -135,16 +138,16 @@ public static Image LoadImageFromBuffer(byte[] buffer)

Logger.Log(
$"""
Couldn't load image from buffer
Type: {(
isPng ? "PNG"
: isJpeg ? "JPG"
: isBmp ? "BMP"
: isWebp ? "WEBP"
: "Unknown"
)};
Size: {buffer.Length}
"""
Couldn't load image from buffer
Type: {(
isPng ? "PNG"
: isJpeg ? "JPG"
: isBmp ? "BMP"
: isWebp ? "WEBP"
: "Unknown"
)};
Size: {buffer.Length}
"""
);

return null;
Expand Down
Binary file added user/skins/default/modifiers/flicker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions user/skins/default/modifiers/flicker.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://2m10xon10iom"
path="res://.godot/imported/flicker.png-3ba39ce84c8a00d35a038c87c6c47ae2.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://user/skins/default/modifiers/flicker.png"
dest_files=["res://.godot/imported/flicker.png-3ba39ce84c8a00d35a038c87c6c47ae2.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Loading