Skip to content

Commit 057eb99

Browse files
authored
Merge branch 'milestone-2' into EventRooms
2 parents d3d3088 + db5c9b6 commit 057eb99

285 files changed

Lines changed: 16246 additions & 26 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
487 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://c6gaprxxf71mm"
6+
path="res://.godot/imported/Note_BossBlood.png-867ef730738d75280fbaf251b1d84cde.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://Classes/Notes/Assets/Note_BossBlood.png"
14+
dest_files=["res://.godot/imported/Note_BossBlood.png-867ef730738d75280fbaf251b1d84cde.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/Notes/Assets/Note_GWS.png

-152 Bytes
Loading
427 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://b5rpamdpcjrbj"
6+
path="res://.godot/imported/Note_Parasifly.png-3e72dc1cfeaf988046fea33e3d40a914.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://Classes/Notes/Assets/Note_Parasifly.png"
14+
dest_files=["res://.godot/imported/Note_Parasifly.png-3e72dc1cfeaf988046fea33e3d40a914.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/StatusEffects/StatusEffect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public StatusEffect InitStatus(
116116
return this;
117117
}
118118

119-
public StatusEffect GetInstance(int count = 1)
119+
public StatusEffect CreateInstance(int count = 1)
120120
{
121121
StatusEffect result = GD.Load<PackedScene>(LoadPath).Instantiate<StatusEffect>();
122122
result.SetCount(count);

Globals/Scribe.cs

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Collections.Generic;
23
using System.Linq;
34
using FunkEngine;
@@ -96,7 +97,7 @@ public partial class Scribe : Node
9697
{
9798
if (timing == Timing.Miss)
9899
return;
99-
director.AddStatus(Targetting.Player, StatusEffect.Block.GetInstance()); //todo: should scale with timing????
100+
director.AddStatus(Targetting.Player, StatusEffect.Block.CreateInstance()); //todo: should scale with timing????
100101
}
101102
),
102103
new Note(
@@ -135,7 +136,7 @@ public partial class Scribe : Node
135136
{
136137
if (timing == Timing.Miss)
137138
return;
138-
director.AddStatus(Targetting.First, StatusEffect.Poison.GetInstance((int)timing));
139+
director.AddStatus(Targetting.First, StatusEffect.Poison, (int)timing);
139140
}
140141
),
141142
new Note(
@@ -178,6 +179,32 @@ public partial class Scribe : Node
178179
);
179180
}
180181
),
182+
new Note(
183+
13,
184+
"Parasifly",
185+
GD.Load<Texture2D>("res://Classes/Notes/Assets/Note_Parasifly.png"),
186+
1,
187+
(director, note, timing) =>
188+
{
189+
int amt = Math.Max((3 - (int)timing) * note.GetBaseVal(), 0);
190+
director.AddStatus(Targetting.All, StatusEffect.Block, amt);
191+
}
192+
),
193+
new Note(
194+
14,
195+
"BossBlood",
196+
GD.Load<Texture2D>("res://Classes/Notes/Assets/Note_BossBlood.png"),
197+
2,
198+
(director, note, timing) =>
199+
{
200+
int dmg = (3 - (int)timing) * note.GetBaseVal();
201+
director.DealDamage(note, dmg, note.Owner);
202+
if (dmg > 0)
203+
note.Owner.Heal((3 - (int)timing));
204+
},
205+
default,
206+
Targetting.Player
207+
),
181208
};
182209

183210
public static readonly RelicTemplate[] RelicDictionary = new[]
@@ -395,7 +422,7 @@ public partial class Scribe : Node
395422
e is BattleDirector.Harbinger.OnDamageInstanceArgs dmgArgs
396423
&& dmgArgs.Dmg.Target == e.BD.Player
397424
&& dmgArgs.Dmg.Damage > 0
398-
&& e.BD.Player.HasStatus(StatusEffect.Block.GetInstance())
425+
&& e.BD.Player.HasStatus(StatusEffect.Block.CreateInstance())
399426
)
400427
{
401428
e.BD.DealDamage(Targetting.First, val, null);

Globals/StageProducer.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
using System;
21
using System.Threading.Tasks;
32
using FunkEngine;
4-
using FunkEngine.Classes.MidiMaestro;
53
using Godot;
4+
using GodotSteam;
65

76
/**
87
* <summary>StageProducer: Handles scene transitions and persistent gameplay data.</summary>
@@ -142,13 +141,19 @@ public void PreloadScene(int nextRoomIdx)
142141
.Instantiate<Node>();
143142
});
144143
break;
145-
case Stages.Shop:
146144
case Stages.Event:
147145
_loadTask = Task.Run(() =>
148146
{
149147
_preloadStage = GD.Load<PackedScene>(EventScene.LoadPath).Instantiate<Node>();
150148
});
151149
break;
150+
case Stages.Shop:
151+
_loadTask = Task.Run(() =>
152+
{
153+
_preloadStage = GD.Load<PackedScene>(ShopScene.LoadPath).Instantiate<Node>();
154+
});
155+
break;
156+
case Stages.Event:
152157
case Stages.Chest:
153158
_loadTask = Task.Run(() =>
154159
{
@@ -261,7 +266,7 @@ public override void _Input(InputEvent @event)
261266
{
262267
//Consume controller input, if window out of focus.
263268
//This handles ui_input, other scenes need to consume their own.
264-
if (!GetWindow().HasFocus())
269+
if (ControlSettings.IsOutOfFocus(this))
265270
{
266271
GetViewport().SetInputAsHandled();
267272
return;

Globals/SteamWhisperer.cs

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
using Godot;
2+
using GodotSteam;
3+
4+
public partial class SteamWhisperer : Node
5+
{
6+
private const uint AppId = 3647600;
7+
8+
public static bool IsOverlayActive = false;
9+
10+
private static int placedNotes = 0;
11+
12+
public override void _EnterTree()
13+
{
14+
OS.SetEnvironment("SteamAppId", AppId.ToString());
15+
OS.SetEnvironment("SteamGameId", AppId.ToString());
16+
}
17+
18+
public override void _ExitTree()
19+
{
20+
if (!Steam.IsSteamRunning())
21+
return;
22+
Steam.StoreStats();
23+
GD.Print("SW: Steam shut down.");
24+
}
25+
26+
public override void _Ready()
27+
{
28+
if (!Steam.SteamInit(AppId, true))
29+
{
30+
GD.PrintErr(
31+
"SW: here was an error initializing Steam. No Steam features will be available."
32+
);
33+
return;
34+
}
35+
36+
GD.Print("SW: Steam initialized successfully.");
37+
Steam.OverlayToggled += (active, _, _) =>
38+
{
39+
IsOverlayActive = active;
40+
};
41+
42+
//Pull in stats
43+
placedNotes = Steam.GetStatInt("NotesPlaced");
44+
GD.Print($"SW: Placed notes: {placedNotes}");
45+
46+
//Uncomment this to reset your achievements/stats. There's no confirmation so...
47+
//ResetAll();
48+
}
49+
50+
//TODO: This might fail sometimes? IDK, need to look into it
51+
public static bool PopAchievement(string id)
52+
{
53+
if (!Steam.IsSteamRunning())
54+
{
55+
return false;
56+
}
57+
58+
if (Steam.SetAchievement(id) && Steam.StoreStats())
59+
{
60+
GD.Print($"SW: Unlocked {id}.");
61+
return true;
62+
}
63+
64+
GD.PrintErr($"SW: Failed to set achievement {id}.");
65+
return false;
66+
}
67+
68+
//Should make this more generic, but we only have one stat
69+
public static bool IncrementNoteCount()
70+
{
71+
if (!Steam.IsSteamRunning())
72+
{
73+
return false;
74+
}
75+
76+
placedNotes++;
77+
78+
if (Steam.SetStatInt("NotesPlaced", placedNotes) && Steam.StoreStats())
79+
{
80+
GD.Print($"SW: Incremented placed notes to {placedNotes}.");
81+
return true;
82+
}
83+
GD.PrintErr($"SW: Failed to increment placed notes to {placedNotes}.");
84+
return false;
85+
}
86+
87+
//For Debugging purposes. Resets all stats/ achievements
88+
private static void ResetAll()
89+
{
90+
if (!Steam.IsSteamRunning())
91+
{
92+
return;
93+
}
94+
95+
Steam.ResetAllStats(true);
96+
Steam.StoreStats();
97+
GD.Print("SW: All stats reset.");
98+
}
99+
}

Globals/SteamWhisperer.cs.uid

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://bt4f7m5qx106a

0 commit comments

Comments
 (0)