Skip to content

Commit 511be2b

Browse files
Merge pull request #52 from Project-Funk-Engine/Sprint-2
Sprint 2 Complete
2 parents 2db3f63 + 6f0e415 commit 511be2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2290
-571
lines changed

Classes/Note.cs

Lines changed: 0 additions & 18 deletions
This file was deleted.

Classes/Notes/Note.cs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System;
2+
using FunkEngine;
3+
using Godot;
4+
5+
/**
6+
* @class Note
7+
* @brief Data structure class for holding data and methods for a battle time note. WIP
8+
*/
9+
public partial class Note : Resource
10+
{
11+
public PuppetTemplate Owner;
12+
public string Name;
13+
private int _baseVal;
14+
private Action<BattleDirector, Note, Timing> NoteEffect; //TODO: Where/How to deal with timing.
15+
16+
public string Tooltip;
17+
public Texture2D Texture;
18+
19+
public Note(
20+
string name,
21+
string tooltip,
22+
Texture2D texture = null,
23+
PuppetTemplate owner = null,
24+
int baseVal = 1,
25+
Action<BattleDirector, Note, Timing> noteEffect = null
26+
)
27+
{
28+
Name = name;
29+
Owner = owner;
30+
NoteEffect =
31+
noteEffect
32+
?? (
33+
(BD, source, Timing) =>
34+
{
35+
BD.GetTarget(this).TakeDamage(source._baseVal);
36+
}
37+
);
38+
_baseVal = baseVal;
39+
Texture = texture;
40+
Tooltip = tooltip;
41+
}
42+
43+
public void OnHit(BattleDirector BD, Timing timing)
44+
{
45+
NoteEffect(BD, this, timing);
46+
}
47+
48+
public Note Clone()
49+
{
50+
//Eventually could look into something more robust, but for now shallow copy is preferable.
51+
//We only would want val and name to be copied by value
52+
Note newNote = new Note(Name, Tooltip, Texture, Owner, _baseVal, NoteEffect);
53+
return newNote;
54+
}
55+
}
637 Bytes
Loading

scenes/NoteManager/assets/right-arrow.png.import renamed to Classes/Notes/assets/double_note.png.import

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
importer="texture"
44
type="CompressedTexture2D"
5-
uid="uid://bucvj4fquqpkr"
6-
path="res://.godot/imported/right-arrow.png-b3005485b42777a77a9d39fbba48875d.ctex"
5+
uid="uid://caw70lr5e1yiq"
6+
path="res://.godot/imported/double_note.png-1b788aee0b7f76d502303d178d821d3b.ctex"
77
metadata={
88
"vram_texture": false
99
}
1010

1111
[deps]
1212

13-
source_file="res://scenes/NoteManager/assets/right-arrow.png"
14-
dest_files=["res://.godot/imported/right-arrow.png-b3005485b42777a77a9d39fbba48875d.ctex"]
13+
source_file="res://Classes/Notes/assets/double_note.png"
14+
dest_files=["res://.godot/imported/double_note.png-1b788aee0b7f76d502303d178d821d3b.ctex"]
1515

1616
[params]
1717

612 Bytes
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://c3chrsxrulapd"
6+
path="res://.godot/imported/single_note.png-edadc3d6779f4cc26ac823d186717719.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://Classes/Notes/assets/single_note.png"
14+
dest_files=["res://.godot/imported/single_note.png-edadc3d6779f4cc26ac823d186717719.ctex"]
15+
16+
[params]
17+
18+
compress/mode=0
19+
compress/high_quality=false
20+
compress/lossy_quality=0.7
21+
compress/hdr_compression=1
22+
compress/normal_map=0
23+
compress/channel_pack=0
24+
mipmaps/generate=false
25+
mipmaps/limit=-1
26+
roughness/mode=0
27+
roughness/src_normal=""
28+
process/fix_alpha_border=true
29+
process/premult_alpha=false
30+
process/normal_map_invert_y=false
31+
process/hdr_as_srgb=false
32+
process/hdr_clamp_exposure=false
33+
process/size_limit=0
34+
detect_3d/compress_to=1

Classes/Relics/RelicEffect.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
using FunkEngine;
3+
using Godot;
4+
5+
public partial class RelicEffect : IBattleEvent
6+
{
7+
private BattleEffectTrigger Trigger { get; set; }
8+
public int BaseValue;
9+
private Action<BattleDirector, int> OnRelicEffect;
10+
11+
public RelicEffect(
12+
BattleEffectTrigger trigger,
13+
int val,
14+
Action<BattleDirector, int> onRelicEffect
15+
)
16+
{
17+
BaseValue = val;
18+
Trigger = trigger;
19+
OnRelicEffect = onRelicEffect;
20+
}
21+
22+
public void OnTrigger(BattleDirector battleDirector)
23+
{
24+
OnRelicEffect(battleDirector, BaseValue);
25+
}
26+
27+
public BattleEffectTrigger GetTrigger()
28+
{
29+
return Trigger;
30+
}
31+
}

Classes/Relics/RelicTemplate.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
using FunkEngine;
3+
using Godot;
4+
5+
public partial class RelicTemplate : Resource
6+
{
7+
public RelicEffect[] Effects;
8+
public string Name;
9+
10+
public Texture2D Texture;
11+
public string Tooltip;
12+
13+
public RelicTemplate(
14+
string name = "",
15+
string tooltip = "",
16+
Texture2D texture = null,
17+
RelicEffect[] EffectTags = null
18+
)
19+
{
20+
Effects = EffectTags;
21+
Name = name;
22+
Tooltip = tooltip;
23+
Texture = texture;
24+
}
25+
26+
public RelicTemplate Clone()
27+
{
28+
RelicTemplate newRelic = new RelicTemplate(Name, Tooltip, Texture, Effects);
29+
return newRelic;
30+
}
31+
}
703 Bytes
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://csjx2hb4tdlw8"
6+
path="res://.godot/imported/relic_Breakfast.png-c1b968058adbb855fcf957a2aec74dc2.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://Classes/Relics/assets/relic_Breakfast.png"
14+
dest_files=["res://.godot/imported/relic_Breakfast.png-c1b968058adbb855fcf957a2aec74dc2.ctex"]
15+
16+
[params]
17+
18+
compress/mode=0
19+
compress/high_quality=false
20+
compress/lossy_quality=0.7
21+
compress/hdr_compression=1
22+
compress/normal_map=0
23+
compress/channel_pack=0
24+
mipmaps/generate=false
25+
mipmaps/limit=-1
26+
roughness/mode=0
27+
roughness/src_normal=""
28+
process/fix_alpha_border=true
29+
process/premult_alpha=false
30+
process/normal_map_invert_y=false
31+
process/hdr_as_srgb=false
32+
process/hdr_clamp_exposure=false
33+
process/size_limit=0
34+
detect_3d/compress_to=1

0 commit comments

Comments
 (0)