Skip to content
Merged
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
8 changes: 4 additions & 4 deletions Classes/Notes/Note.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
* @class Note
* @brief Data structure class for holding data and methods for a battle time note. WIP
*/
public partial class Note : Resource
public partial class Note : Resource, IDisplayable
{
public PuppetTemplate Owner;
public string Name;
public string Name { get; set; }
private int _baseVal;
public float CostModifier { get; private set; }
private Action<BattleDirector, Note, Timing> NoteEffect; //TODO: Where/How to deal with timing.

public string Tooltip;
public Texture2D Texture;
public string Tooltip { get; set; }
public Texture2D Texture { get; set; }

public Note(
string name,
Expand Down
8 changes: 4 additions & 4 deletions Classes/Relics/RelicTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
using FunkEngine;
using Godot;

public partial class RelicTemplate : Resource
public partial class RelicTemplate : Resource, IDisplayable
{
public RelicEffect[] Effects;
public string Name;
public string Name { get; set; }

public Texture2D Texture;
public string Tooltip;
public Texture2D Texture { get; set; }
public string Tooltip { get; set; }

public RelicTemplate(
string name = "",
Expand Down
Binary file added Classes/Relics/assets/Auroboros.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Classes/Relics/assets/Auroboros.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cqlrv1vra4mbn"
path="res://.godot/imported/Auroboros.png-27bfe2114f3955a0f6ef5ceb4e65adbf.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Classes/Relics/assets/Auroboros.png"
dest_files=["res://.godot/imported/Auroboros.png-27bfe2114f3955a0f6ef5ceb4e65adbf.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Binary file added Classes/Relics/assets/Colorboros.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Classes/Relics/assets/Colorboros.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://ccd6pskxcwpxg"
path="res://.godot/imported/Colorboros.png-56197d792c620150c773fb4ecce6289c.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Classes/Relics/assets/Colorboros.png"
dest_files=["res://.godot/imported/Colorboros.png-56197d792c620150c773fb4ecce6289c.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
8 changes: 8 additions & 0 deletions Globals/FunkEngineNameSpace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public enum BattleEffectTrigger
NoteHit,
SelfNoteHit,
OnPickup,
OnLoop,
}

public enum Stages
Expand Down Expand Up @@ -191,3 +192,10 @@ public interface IBattleEvent
void OnTrigger(BattleDirector BD);
BattleEffectTrigger GetTrigger();
}

public interface IDisplayable
{
string Name { get; set; }
string Tooltip { get; set; }
Texture2D Texture { get; set; }
}
51 changes: 49 additions & 2 deletions Globals/Scribe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public partial class Scribe : Node
),
new RelicTemplate(
"Good Vibes",
"Good vibes, heals the player whenever they place a note.", //TODO: Description can include the relics values?
"Heals the player whenever they place a note.",
GD.Load<Texture2D>("res://Classes/Relics/assets/relic_GoodVibes.png"),
new RelicEffect[]
{
Expand All @@ -117,14 +117,46 @@ public partial class Scribe : Node
),
}
),
new RelicTemplate(
"Auroboros",
"Bigger number, better person. Increases combo multiplier every riff.",
GD.Load<Texture2D>("res://Classes/Relics/assets/Auroboros.png"),
new RelicEffect[]
{
new RelicEffect(
BattleEffectTrigger.OnLoop,
1,
(director, val) =>
{
director.NotePlacementBar.IncreaseBonusMult(val);
}
),
}
),
new RelicTemplate(
"Colorboros",
"Taste the rainbow. Charges the freestyle bar every riff.",
GD.Load<Texture2D>("res://Classes/Relics/assets/Colorboros.png"),
new RelicEffect[]
{
new RelicEffect(
BattleEffectTrigger.OnLoop,
20,
(director, val) =>
{
director.NotePlacementBar.IncreaseCharge(val);
}
),
}
),
};

//TODO: Item pool(s)

public static RelicTemplate[] GetRandomRelics(RelicTemplate[] ownedRelics, int count)
{
var availableRelics = Scribe
.RelicDictionary.Where(r => !ownedRelics.Any(o => o.Name == r.Name))
.RelicDictionary.Where(r => ownedRelics.All(o => o.Name != r.Name))
.ToArray();

availableRelics = availableRelics
Expand All @@ -139,4 +171,19 @@ public static RelicTemplate[] GetRandomRelics(RelicTemplate[] ownedRelics, int c
}
return availableRelics;
}

public static Note[] GetRandomRewardNotes(int count)
{
var availableNotes = Scribe
.NoteDictionary.Where(r => r.Name.Contains("Player")) //TODO: Classifications/pools
.ToArray();

availableNotes = availableNotes
.OrderBy(_ => StageProducer.GlobalRng.Randi())
.Take(count)
.Select(r => r.Clone())
.ToArray();

return availableNotes;
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ Current team members include:

#### Attributions:
First Song: <a href="https://freesound.org/people/Magntron/sounds/335571/" title="gameMusic">gameMusic by Magntron - freesound.org</a>
Input buttons by <a href="https://thoseawesomeguys.com/prompts/" title="inputkeys">Nicolae (Xelu) Berbece</a>
Input buttons by <a href="https://thoseawesomeguys.com/prompts/" title="inputkeys">Nicolae (Xelu) Berbece</a>
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ project/assembly_name="Funk Engine"

[game]

input_scheme="QWERT"
input_scheme="ARROWS"

[input]

Expand Down
44 changes: 42 additions & 2 deletions scenes/BattleDirector/NotePlacementBar.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=9 format=3 uid="uid://duhiilcv4tat3"]
[gd_scene load_steps=12 format=3 uid="uid://duhiilcv4tat3"]

[ext_resource type="Script" path="res://scenes/BattleDirector/scripts/NotePlacementBar.cs" id="1_456es"]
[ext_resource type="Texture2D" uid="uid://cnyr5usjdv0ni" path="res://scenes/BattleDirector/assets/temp_note_queue.png" id="2_3tw16"]
Expand All @@ -23,7 +23,33 @@ width = 32
height = 98
fill_to = Vector2(0, 1)

[node name="NotePlacementBar" type="Control" node_paths=PackedStringArray("notePlacementBar", "currentComboMultText", "_currentNote", "_nextNote", "fullBarParticles")]
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_fy2uu"]
lifetime_randomness = 0.32
particle_flag_disable_z = true
emission_shape = 3
emission_box_extents = Vector3(40, 5, 1)
inherit_velocity_ratio = 1.0
direction = Vector3(0, 1, 0)
spread = 13.548
initial_velocity_min = 124.08
initial_velocity_max = 176.41
gravity = Vector3(0, 98, 0)
scale_min = 2.0
scale_max = 3.0
turbulence_noise_strength = 0.1
turbulence_noise_scale = 5.0
turbulence_influence_min = 0.0
turbulence_influence_max = 0.018

[sub_resource type="Gradient" id="Gradient_2uknl"]
offsets = PackedFloat32Array(0)
colors = PackedColorArray(0.46, 0.2162, 0.39905, 1)

[sub_resource type="GradientTexture1D" id="GradientTexture1D_d62c7"]
gradient = SubResource("Gradient_2uknl")
width = 1

[node name="NotePlacementBar" type="Control" node_paths=PackedStringArray("notePlacementBar", "currentComboMultText", "_particles", "_currentNote", "_nextNote", "fullBarParticles")]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
Expand All @@ -33,6 +59,7 @@ grow_vertical = 2
script = ExtResource("1_456es")
notePlacementBar = NodePath("ProgressBar")
currentComboMultText = NodePath("TextEdit")
_particles = NodePath("ProgressBar/Rock")
_currentNote = NodePath("NoteQueueSprite/NextNote")
_nextNote = NodePath("NoteQueueSprite/CurrentNote")
fullBarParticles = NodePath("ProgressBar/CPUParticles2D")
Expand All @@ -48,6 +75,18 @@ texture_under = SubResource("GradientTexture2D_hhds4")
texture_progress = SubResource("GradientTexture2D_0bqho")
texture_progress_offset = Vector2(1, 1)

[node name="Rock" type="GPUParticles2D" parent="ProgressBar"]
z_index = 1
position = Vector2(-1, -32)
emitting = false
amount = 22
process_material = SubResource("ParticleProcessMaterial_fy2uu")
texture = SubResource("GradientTexture1D_d62c7")
lifetime = 2.0
preprocess = 0.1
explosiveness = 0.3
randomness = 0.05

[node name="CPUParticles2D" type="CPUParticles2D" parent="ProgressBar"]
position = Vector2(14, 98)
emitting = false
Expand All @@ -63,6 +102,7 @@ color = Color(1, 1, 0.0745098, 1)

[node name="TextEdit" type="TextEdit" parent="."]
z_as_relative = false
custom_minimum_size = Vector2(80, 35)
layout_mode = 0
offset_right = 80.0
offset_bottom = 35.0
Expand Down
20 changes: 17 additions & 3 deletions scenes/BattleDirector/scripts/BattleDirector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class BattleDirector : Node2D
private ChartManager CM;

[Export]
private NotePlacementBar NotePlacementBar;
public NotePlacementBar NotePlacementBar;

[Export]
private Conductor CD;
Expand All @@ -29,6 +29,7 @@ public partial class BattleDirector : Node2D
private AudioStreamPlayer Audio;

private double _timingInterval = .1; //secs, maybe make somewhat note dependent
private double _lastBeat;

private SongData _curSong;

Expand Down Expand Up @@ -125,7 +126,11 @@ private void EndBattle()
public override void _Process(double delta)
{
TimeKeeper.CurrentTime = Audio.GetPlaybackPosition();
CD.CheckMiss();
double realBeat = TimeKeeper.CurrentTime / (60 / (double)TimeKeeper.Bpm) % CM.BeatsPerLoop;
CD.CheckMiss(realBeat);
if (realBeat < _lastBeat)
ChartLooped?.Invoke(this);
_lastBeat = realBeat;
}
#endregion

Expand Down Expand Up @@ -217,7 +222,10 @@ private void CheckBattleStatus(PuppetTemplate puppet)

private void ShowRewardSelection(int amount)
{
RewardSelect.CreateSelection(this, Player.Stats, amount).Selected += EndBattle;
string type = "Note";
if (StageProducer.Config.RoomType == Stages.Boss)
type = "Relic";
RewardSelect.CreateSelection(this, Player.Stats, amount, type).Selected += EndBattle;
}

#endregion
Expand All @@ -227,6 +235,9 @@ private void ShowRewardSelection(int amount)
private delegate void NotePlacedHandler(BattleDirector BD);
private event NotePlacedHandler NotePlaced;

private delegate void ChartLoopHandler(BattleDirector BD);
private event ChartLoopHandler ChartLooped;

private void EventizeRelics()
{
foreach (var relic in Player.Stats.CurRelics)
Expand All @@ -238,6 +249,9 @@ private void EventizeRelics()
case BattleEffectTrigger.NotePlaced:
NotePlaced += effect.OnTrigger;
break;
case BattleEffectTrigger.OnLoop:
ChartLooped += effect.OnTrigger;
break;
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions scenes/BattleDirector/scripts/Conductor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,9 @@ private void AddExampleNotes()
}

//Check all lanes for misses from missed inputs
public void CheckMiss()
public void CheckMiss(double realBeat)
{
//On current beat, if prev beat is active and not inputted
double realBeat = TimeKeeper.CurrentTime / (60 / (double)TimeKeeper.Bpm) % CM.BeatsPerLoop;
for (int i = 0; i < _laneData.Length; i++)
{
if (
Expand Down
Loading