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
47 changes: 37 additions & 10 deletions Classes/MapAreas/MapLevels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,26 @@ public MapConfig AddSetRoom(int height, Stages roomType)
return this;
}

public const int NumStages = 2;

public static readonly Stages[] StagsToRoll = new[] { Stages.Battle, Stages.Chest };
public static readonly Stages[] StagesToRoll = new[]
{
Stages.Battle,
Stages.Chest,
Stages.Elite,
Stages.Event,
Stages.Shop,
};

/// <summary>
/// The odds for each stage to appear in a non-set room position.
/// </summary>
public float[] StageOdds = new float[2];
public float[] StageOdds = new float[5];

public MapConfig(int width, int height, int paths, float[] odds)
{
Width = width;
Height = height;
Paths = paths;
for (int i = 0; i < NumStages; i++)
for (int i = 0; i < StagesToRoll.Length; i++)
{
StageOdds[i] = odds[i];
}
Expand Down Expand Up @@ -75,6 +80,7 @@ private MapLevels(
int[] battleSongs,
int[] eliteSongs,
int[] bossSongs,
int[] eventIds,
int nextLevelId = -1,
string backgroundPath = "res://SharedAssets/BackGround_Full.png"
)
Expand All @@ -84,6 +90,7 @@ private MapLevels(
NormalBattles = battleSongs;
EliteBattles = eliteSongs;
BossBattles = bossSongs;
EventIds = eventIds;
NextLevel = nextLevelId;
BackgroundPath = backgroundPath;
}
Expand All @@ -97,18 +104,38 @@ private MapLevels(
public int[] NormalBattles { get; private set; }
public int[] EliteBattles { get; private set; }
public int[] BossBattles { get; private set; }
public int[] EventIds { get; private set; }

#region Preset Levels
private static readonly MapConfig FirstMapConfig = new MapConfig(7, 6, 3, [10, 1])
private static readonly MapConfig FirstMapConfig = new MapConfig(7, 7, 3, [10, 2, 5, 6, 5])
.AddSetRoom(3, Stages.Chest)
.AddMinHeight(Stages.Chest, 2);
.AddMinHeight(Stages.Chest, 2)
.AddMinHeight(Stages.Shop, 3)
.AddMinHeight(Stages.Elite, 3);

private static readonly MapConfig CityMapConfig = new MapConfig(9, 10, 5, [12, 1, 5, 5, 4])
.AddSetRoom(2, Stages.Chest)
.AddSetRoom(4, Stages.Shop)
.AddMinHeight(Stages.Chest, 1)
.AddMinHeight(Stages.Shop, 3)
.AddMinHeight(Stages.Elite, 2);

private static readonly MapConfig TutorialMapConfig = new MapConfig(1, 2, 1, [10, 0]);
private static readonly MapConfig TutorialMapConfig = new MapConfig(1, 2, 1, [10, 0, 0, 0, 0]);

private static readonly MapLevels[] PresetLevels = new[]
{
new MapLevels(0, TutorialMapConfig, [4], [], [5], 1),
new MapLevels(1, FirstMapConfig, [1, 2, 3], [], [0], -1),
new MapLevels(0, TutorialMapConfig, [4], [0], [5], [], 1),
new MapLevels(1, FirstMapConfig, [1, 2], [3], [0], [], 2),
new MapLevels(
2,
CityMapConfig,
[1, 2],
[3],
[0],
[],
-1,
"res://SharedAssets/BackGround_City.png"
),
};
#endregion

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

importer="texture"
type="CompressedTexture2D"
uid="uid://c6gaprxxf71mm"
path="res://.godot/imported/Note_BossBlood.png-867ef730738d75280fbaf251b1d84cde.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Classes/Notes/Assets/Note_BossBlood.png"
dest_files=["res://.godot/imported/Note_BossBlood.png-867ef730738d75280fbaf251b1d84cde.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 modified 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.
Binary file added Classes/Notes/Assets/Note_Parasifly.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_Parasifly.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://b5rpamdpcjrbj"
path="res://.godot/imported/Note_Parasifly.png-3e72dc1cfeaf988046fea33e3d40a914.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Classes/Notes/Assets/Note_Parasifly.png"
dest_files=["res://.godot/imported/Note_Parasifly.png-3e72dc1cfeaf988046fea33e3d40a914.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
2 changes: 1 addition & 1 deletion Classes/StatusEffects/StatusEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public StatusEffect InitStatus(
return this;
}

public StatusEffect GetInstance(int count = 1)
public StatusEffect CreateInstance(int count = 1)
{
StatusEffect result = GD.Load<PackedScene>(LoadPath).Instantiate<StatusEffect>();
result.SetCount(count);
Expand Down
7 changes: 6 additions & 1 deletion Globals/FunkEngineNameSpace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ public enum Stages
{
Battle = 0,
Chest = 1,
Elite = 2,
Event = 3,
Shop = 4,
Boss,
Quit,
Map,
Expand Down Expand Up @@ -288,6 +291,7 @@ public class MapGrid
private int[,] _map;
private Room[] _rooms;
private int _curIdx;
public int Width { get; private set; }

public Room[] GetRooms()
{
Expand Down Expand Up @@ -327,6 +331,7 @@ public void AddChild(int newIdx)
*/
public void InitMapGrid(MapLevels.MapConfig curConfig)
{
Width = curConfig.Width;
_curIdx = 0;
_rooms = [];
_map = new int[curConfig.Width, curConfig.Height]; //x,y
Expand Down Expand Up @@ -387,7 +392,7 @@ private Stages PickRoomType(int x, int y, MapLevels.MapConfig curConfig)
}
}
int idx = (int)StageProducer.GlobalRng.RandWeighted(validRooms);
return MapLevels.MapConfig.StagsToRoll[idx];
return MapLevels.MapConfig.StagesToRoll[idx];
}

//Asserts that if there is a room at the same x, but y+1 they are connected
Expand Down
33 changes: 30 additions & 3 deletions Globals/Scribe.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FunkEngine;
Expand Down Expand Up @@ -96,7 +97,7 @@ public partial class Scribe : Node
{
if (timing == Timing.Miss)
return;
director.AddStatus(Targetting.Player, StatusEffect.Block.GetInstance()); //todo: should scale with timing????
director.AddStatus(Targetting.Player, StatusEffect.Block.CreateInstance()); //todo: should scale with timing????
}
),
new Note(
Expand Down Expand Up @@ -135,7 +136,7 @@ public partial class Scribe : Node
{
if (timing == Timing.Miss)
return;
director.AddStatus(Targetting.First, StatusEffect.Poison.GetInstance((int)timing));
director.AddStatus(Targetting.First, StatusEffect.Poison, (int)timing);
}
),
new Note(
Expand Down Expand Up @@ -178,6 +179,32 @@ public partial class Scribe : Node
);
}
),
new Note(
13,
"Parasifly",
GD.Load<Texture2D>("res://Classes/Notes/Assets/Note_Parasifly.png"),
1,
(director, note, timing) =>
{
int amt = Math.Max((3 - (int)timing) * note.GetBaseVal(), 0);
director.AddStatus(Targetting.All, StatusEffect.Block, amt);
}
),
new Note(
14,
"BossBlood",
GD.Load<Texture2D>("res://Classes/Notes/Assets/Note_BossBlood.png"),
2,
(director, note, timing) =>
{
int dmg = (3 - (int)timing) * note.GetBaseVal();
director.DealDamage(note, dmg, note.Owner);
if (dmg > 0)
note.Owner.Heal((3 - (int)timing));
},
default,
Targetting.Player
),
};

public static readonly RelicTemplate[] RelicDictionary = new[]
Expand Down Expand Up @@ -395,7 +422,7 @@ public partial class Scribe : Node
e is BattleDirector.Harbinger.OnDamageInstanceArgs dmgArgs
&& dmgArgs.Dmg.Target == e.BD.Player
&& dmgArgs.Dmg.Damage > 0
&& e.BD.Player.HasStatus(StatusEffect.Block.GetInstance())
&& e.BD.Player.HasStatus(StatusEffect.Block.CreateInstance())
)
{
e.BD.DealDamage(Targetting.First, val, null);
Expand Down
16 changes: 16 additions & 0 deletions Globals/StageProducer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public void PreloadScene(int nextRoomIdx)
Config = MakeBattleConfig(nextStage, nextRoomIdx);
switch (nextStage)
{
case Stages.Elite:
case Stages.Battle:
case Stages.Boss:
_loadTask = Task.Run(() =>
Expand All @@ -140,6 +141,8 @@ public void PreloadScene(int nextRoomIdx)
.Instantiate<Node>();
});
break;
case Stages.Shop:
case Stages.Event:
case Stages.Chest:
_loadTask = Task.Run(() =>
{
Expand All @@ -163,6 +166,9 @@ public void TransitionStage(Stages nextStage, int nextRoomIdx = -1)
break;
case Stages.Battle: //Currently these are only ever entered from map. Be aware if we change
case Stages.Boss: //this, scenes either need to be preloaded first, or a different setup is needed.
case Stages.Event:
case Stages.Elite:
case Stages.Shop:
case Stages.Chest:
_loadTask.Wait(); //Should always finish by the time it gets here, this guarantees it.
GetTree().GetCurrentScene().Free();
Expand Down Expand Up @@ -218,13 +224,22 @@ private BattleConfig MakeBattleConfig(Stages nextRoom, int nextRoomIdx)
.SongDictionary[CurLevel.NormalBattles[songIdx]]
.EnemyScenePath;
break;
case Stages.Elite:
int elitIdx = stageRng.RandiRange(0, CurLevel.EliteBattles.Length - 1);
result.CurSong = Scribe.SongDictionary[CurLevel.EliteBattles[elitIdx]];
result.EnemyScenePath = Scribe
.SongDictionary[CurLevel.EliteBattles[elitIdx]]
.EnemyScenePath;
break;
case Stages.Boss:
int bossIdx = stageRng.RandiRange(0, CurLevel.BossBattles.Length - 1);
result.CurSong = Scribe.SongDictionary[CurLevel.BossBattles[bossIdx]];
result.EnemyScenePath = Scribe
.SongDictionary[CurLevel.BossBattles[bossIdx]]
.EnemyScenePath;
break;
case Stages.Event:
case Stages.Shop:
case Stages.Chest:
break;
default:
Expand Down Expand Up @@ -260,6 +275,7 @@ public static bool IsMoreLevels()

public void ProgressLevels()
{
GD.Print(CurLevel.Id);
CurLevel = CurLevel.GetNextLevel();

Map = new();
Expand Down
13 changes: 8 additions & 5 deletions Scenes/BattleDirector/Scripts/BattleDirector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,16 +371,19 @@ public void DealDamage(Targetting targetting, int damage, PuppetTemplate source)
}
}

public void AddStatus(Targetting targetting, StatusEffect status)
public void AddStatus(Targetting targetting, StatusEffect status, int amount = 1)
{
if (amount == 0)
return;
PuppetTemplate[] targets = GetTargets(targetting);
foreach (PuppetTemplate target in targets)
{
target.AddStatusEffect(status);
StatusEffect eff = status.CreateInstance(amount);
if (!target.AddStatusEffect(eff))
continue;
eff.StatusEnd += RemoveStatus; //If new status, add effect events
AddEvent(eff);
}

status.StatusEnd += RemoveStatus;
AddEvent(status);
}

public void RemoveStatus(StatusEffect status)
Expand Down
Binary file added Scenes/Maps/Assets/EliteIcon.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 Scenes/Maps/Assets/EliteIcon.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bo6pprsk2p8fn"
path="res://.godot/imported/EliteIcon.png-3fb4b7e324eb40bf5441f47b2b3a396b.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Scenes/Maps/Assets/EliteIcon.png"
dest_files=["res://.godot/imported/EliteIcon.png-3fb4b7e324eb40bf5441f47b2b3a396b.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 Scenes/Maps/Assets/EventIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading