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
Binary file added Classes/Notes/Assets/Note_GWS.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/Notes/Assets/Note_GWS.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bqng2uofbio1x"
path="res://.godot/imported/Note_GWS.png-374fb66d7b5ccdab1c51d6ad3d49769c.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Classes/Notes/Assets/Note_GWS.png"
dest_files=["res://.godot/imported/Note_GWS.png-374fb66d7b5ccdab1c51d6ad3d49769c.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
19 changes: 7 additions & 12 deletions Classes/Notes/Note.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public Note(
int id,
string name,
Texture2D texture = null,
PuppetTemplate owner = null,
int baseVal = 1,
Action<BattleDirector, Note, Timing> noteEffect = null,
float costModifier = 1.0f,
Expand All @@ -31,7 +30,6 @@ public Note(
{
Id = id;
Name = name;
Owner = owner;
NoteEffect = noteEffect;
_baseVal = baseVal;
Texture = texture;
Expand All @@ -44,20 +42,17 @@ public void OnHit(BattleDirector BD, Timing timing)
NoteEffect(BD, this, timing);
}

public Note SetOwner(PuppetTemplate owner)
{
Owner = owner;
return this;
}

public Note Clone()
{
//Eventually could look into something more robust, but for now shallow copy is preferable.
//We only would want val and name to be copied by value
Note newNote = new Note(
Id,
Name,
Texture,
Owner,
_baseVal,
NoteEffect,
CostModifier,
TargetType
);
Note newNote = new Note(Id, Name, Texture, _baseVal, NoteEffect, CostModifier, TargetType);
return newNote;
}

Expand Down
14 changes: 13 additions & 1 deletion Globals/FunkEngineNameSpace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public ArrowData(ArrowType type, Beat beat, Note note, double length = 0)
public Beat Beat;
public readonly double Length; //in beats, should never be >= loop
public readonly ArrowType Type;
public readonly Note NoteRef = null;
public Note NoteRef { get; private set; } = null;

public static ArrowData Placeholder { get; private set; } =
new(default, default, new Note(-1, ""));
Expand All @@ -66,6 +66,18 @@ public ArrowData BeatFromLength()
return this;
}

public static ArrowData SetNote(ArrowData arrowData, Note note)
{
arrowData.NoteRef = note;
return arrowData;
}

public ArrowData IncDecLoop(int amount)
{
Beat.IncDecLoop(amount);
return this;
}

public bool Equals(ArrowData other)
{
return Beat.Equals(other.Beat) && Type == other.Type;
Expand Down
23 changes: 13 additions & 10 deletions Globals/Scribe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public partial class Scribe : Node
0,
"EnemyBase",
null,
null,
1,
(director, note, timing) =>
{
Expand All @@ -29,7 +28,6 @@ public partial class Scribe : Node
1,
"PlayerBase",
GD.Load<Texture2D>("res://Classes/Notes/Assets/Note_PlayerBasic.png"),
null,
4,
(director, note, timing) =>
{
Expand All @@ -42,7 +40,6 @@ public partial class Scribe : Node
2,
"PlayerDouble",
GD.Load<Texture2D>("res://Classes/Notes/Assets/Note_PlayerDouble.png"),
null,
8,
(director, note, timing) =>
{
Expand All @@ -55,7 +52,6 @@ public partial class Scribe : Node
3,
"PlayerHeal",
GD.Load<Texture2D>("res://Classes/Notes/Assets/Note_PlayerHeal.png"),
null,
1,
(director, note, timing) =>
{
Expand All @@ -68,7 +64,6 @@ public partial class Scribe : Node
4,
"PlayerVampire",
GD.Load<Texture2D>("res://Classes/Notes/Assets/Note_PlayerVampire.png"),
null,
3,
(director, note, timing) =>
{
Expand All @@ -83,7 +78,6 @@ public partial class Scribe : Node
5,
"PlayerQuarter",
GD.Load<Texture2D>("res://Classes/Notes/Assets/Note_PlayerQuarter.png"),
null,
3,
(director, note, timing) =>
{
Expand All @@ -97,7 +91,6 @@ public partial class Scribe : Node
6,
"PlayerBlock",
GD.Load<Texture2D>("res://Classes/Notes/Assets/Note_PlayerBlock.png"),
null,
1,
(director, note, timing) =>
{
Expand All @@ -110,7 +103,6 @@ public partial class Scribe : Node
7,
"PlayerExplosive",
GD.Load<Texture2D>("res://Classes/Notes/Assets/Note_PlayerExplosive.png"),
null,
4,
(director, note, timing) =>
{
Expand All @@ -125,7 +117,6 @@ public partial class Scribe : Node
8,
"PlayerEcho",
GD.Load<Texture2D>("res://Classes/Notes/Assets/Note_PlayerEcho.png"),
null,
4,
(director, note, timing) =>
{
Expand All @@ -139,7 +130,6 @@ public partial class Scribe : Node
9,
"PlayerPoison",
GD.Load<Texture2D>("res://Classes/Notes/Assets/Note_PlayerPoison.png"),
null,
1,
(director, note, timing) =>
{
Expand All @@ -148,6 +138,19 @@ public partial class Scribe : Node
director.AddStatus(Targetting.First, StatusEffect.Poison.GetInstance((int)timing));
}
),
new Note(
10,
"GWS",
GD.Load<Texture2D>("res://Classes/Notes/Assets/Note_GWS.png"),
1,
(director, note, timing) =>
{
int dmg = 2 * (3 - (int)timing) * note.GetBaseVal() + TimeKeeper.LastBeat.Loop; //Double an enemy base plus the loop num, unless perfect
if (timing == Timing.Perfect)
dmg = 0;
director.DealDamage(Targetting.Player, dmg, note.Owner);
}
),
};

public static readonly RelicTemplate[] RelicDictionary = new[]
Expand Down
18 changes: 16 additions & 2 deletions Scenes/BattleDirector/Scripts/BattleDirector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public override void _Ready()
InitPlayer();
InitEnemies();
InitScoringGuide();
CD.Initialize(curSong);
CD.Initialize(curSong, _enemies);
CD.NoteInputEvent += OnTimedInput;

FocusedButton.GrabFocus();
Expand Down Expand Up @@ -214,12 +214,26 @@ public bool PlayerAddNote(ArrowType type, Beat beat)
Note noteToPlace = NPB.NotePlaced();
noteToPlace.OnHit(this, Timing.Okay);

CD.AddPlayerNote(noteToPlace, type, beat);
CD.AddPlayerNote(noteToPlace.SetOwner(Player), type, beat);
Harbinger.Instance.InvokeNotePlaced(new ArrowData(type, beat, noteToPlace));
Harbinger.Instance.InvokeNoteHit(noteToPlace, Timing.Okay); //TODO: test how this feels? maybe take it out later
return true;
}

public bool EnemyAddNote(ArrowType type, Beat beat, Note noteRef, float len, EnemyPuppet enemy)
{
noteRef.SetOwner(enemy);
Beat realBeat = TimeKeeper.GetBeatFromTime(Audio.GetPlaybackPosition());
return CD.AddConcurrentNote(realBeat, noteRef, type, beat.IncDecLoop(realBeat.Loop), len);
}

public void RandApplyNote(PuppetTemplate owner, int noteId, int amount)
{
if (owner == null || noteId > Scribe.NoteDictionary.Length || amount < 1)
return;
CD.SetRandBaseNoteToType(owner, (noteId, amount));
}

//Only called from CD signal when a note is processed
private void OnTimedInput(ArrowData data, double beatDif)
{
Expand Down
Loading