diff --git a/Classes/MapAreas/MapLevels.cs b/Classes/MapAreas/MapLevels.cs index 16d7fa2e..96aacc86 100644 --- a/Classes/MapAreas/MapLevels.cs +++ b/Classes/MapAreas/MapLevels.cs @@ -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, + }; /// /// The odds for each stage to appear in a non-set room position. /// - 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]; } @@ -75,6 +80,7 @@ private MapLevels( int[] battleSongs, int[] eliteSongs, int[] bossSongs, + int[] eventIds, int nextLevelId = -1, string backgroundPath = "res://SharedAssets/BackGround_Full.png" ) @@ -84,6 +90,7 @@ private MapLevels( NormalBattles = battleSongs; EliteBattles = eliteSongs; BossBattles = bossSongs; + EventIds = eventIds; NextLevel = nextLevelId; BackgroundPath = backgroundPath; } @@ -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 diff --git a/Classes/Notes/Assets/Note_BossBlood.png b/Classes/Notes/Assets/Note_BossBlood.png new file mode 100644 index 00000000..4c9fef7f Binary files /dev/null and b/Classes/Notes/Assets/Note_BossBlood.png differ diff --git a/Classes/Notes/Assets/Note_BossBlood.png.import b/Classes/Notes/Assets/Note_BossBlood.png.import new file mode 100644 index 00000000..e2d09d8d --- /dev/null +++ b/Classes/Notes/Assets/Note_BossBlood.png.import @@ -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 diff --git a/Classes/Notes/Assets/Note_GWS.png b/Classes/Notes/Assets/Note_GWS.png index be47556e..204ecab9 100644 Binary files a/Classes/Notes/Assets/Note_GWS.png and b/Classes/Notes/Assets/Note_GWS.png differ diff --git a/Classes/Notes/Assets/Note_Parasifly.png b/Classes/Notes/Assets/Note_Parasifly.png new file mode 100644 index 00000000..67599c7d Binary files /dev/null and b/Classes/Notes/Assets/Note_Parasifly.png differ diff --git a/Classes/Notes/Assets/Note_Parasifly.png.import b/Classes/Notes/Assets/Note_Parasifly.png.import new file mode 100644 index 00000000..79bcc03b --- /dev/null +++ b/Classes/Notes/Assets/Note_Parasifly.png.import @@ -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 diff --git a/Classes/StatusEffects/StatusEffect.cs b/Classes/StatusEffects/StatusEffect.cs index 5229e49f..e36ed1db 100644 --- a/Classes/StatusEffects/StatusEffect.cs +++ b/Classes/StatusEffects/StatusEffect.cs @@ -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(LoadPath).Instantiate(); result.SetCount(count); diff --git a/Globals/FunkEngineNameSpace.cs b/Globals/FunkEngineNameSpace.cs index f9d87b60..7f76605f 100644 --- a/Globals/FunkEngineNameSpace.cs +++ b/Globals/FunkEngineNameSpace.cs @@ -259,6 +259,9 @@ public enum Stages { Battle = 0, Chest = 1, + Elite = 2, + Event = 3, + Shop = 4, Boss, Quit, Map, @@ -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() { @@ -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 @@ -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 diff --git a/Globals/Scribe.cs b/Globals/Scribe.cs index edcc0e14..6e8a498d 100644 --- a/Globals/Scribe.cs +++ b/Globals/Scribe.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using FunkEngine; @@ -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( @@ -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( @@ -178,6 +179,32 @@ public partial class Scribe : Node ); } ), + new Note( + 13, + "Parasifly", + GD.Load("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("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[] @@ -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); diff --git a/Globals/StageProducer.cs b/Globals/StageProducer.cs index c3a01789..f228f83e 100644 --- a/Globals/StageProducer.cs +++ b/Globals/StageProducer.cs @@ -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(() => @@ -140,6 +141,8 @@ public void PreloadScene(int nextRoomIdx) .Instantiate(); }); break; + case Stages.Shop: + case Stages.Event: case Stages.Chest: _loadTask = Task.Run(() => { @@ -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(); @@ -218,6 +224,13 @@ 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]]; @@ -225,6 +238,8 @@ private BattleConfig MakeBattleConfig(Stages nextRoom, int nextRoomIdx) .SongDictionary[CurLevel.BossBattles[bossIdx]] .EnemyScenePath; break; + case Stages.Event: + case Stages.Shop: case Stages.Chest: break; default: @@ -260,6 +275,7 @@ public static bool IsMoreLevels() public void ProgressLevels() { + GD.Print(CurLevel.Id); CurLevel = CurLevel.GetNextLevel(); Map = new(); diff --git a/Scenes/BattleDirector/Scripts/BattleDirector.cs b/Scenes/BattleDirector/Scripts/BattleDirector.cs index 4a228c1f..1b137ba5 100644 --- a/Scenes/BattleDirector/Scripts/BattleDirector.cs +++ b/Scenes/BattleDirector/Scripts/BattleDirector.cs @@ -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) diff --git a/Scenes/Maps/Assets/EliteIcon.png b/Scenes/Maps/Assets/EliteIcon.png new file mode 100644 index 00000000..05374404 Binary files /dev/null and b/Scenes/Maps/Assets/EliteIcon.png differ diff --git a/Scenes/Maps/Assets/EliteIcon.png.import b/Scenes/Maps/Assets/EliteIcon.png.import new file mode 100644 index 00000000..4b35faab --- /dev/null +++ b/Scenes/Maps/Assets/EliteIcon.png.import @@ -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 diff --git a/Scenes/Maps/Assets/EventIcon.png b/Scenes/Maps/Assets/EventIcon.png new file mode 100644 index 00000000..07ae24cf Binary files /dev/null and b/Scenes/Maps/Assets/EventIcon.png differ diff --git a/Scenes/Maps/Assets/EventIcon.png.import b/Scenes/Maps/Assets/EventIcon.png.import new file mode 100644 index 00000000..3aa726f8 --- /dev/null +++ b/Scenes/Maps/Assets/EventIcon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bi08ruf8ld4mn" +path="res://.godot/imported/EventIcon.png-59b4b2ec31a8401aaa31d4b2033bc7ef.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Scenes/Maps/Assets/EventIcon.png" +dest_files=["res://.godot/imported/EventIcon.png-59b4b2ec31a8401aaa31d4b2033bc7ef.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 diff --git a/Scenes/Maps/Assets/FirstIcon.png b/Scenes/Maps/Assets/FirstIcon.png new file mode 100644 index 00000000..0c25138c Binary files /dev/null and b/Scenes/Maps/Assets/FirstIcon.png differ diff --git a/Scenes/Maps/Assets/FirstIcon.png.import b/Scenes/Maps/Assets/FirstIcon.png.import new file mode 100644 index 00000000..e0dac93f --- /dev/null +++ b/Scenes/Maps/Assets/FirstIcon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dxiceak20m0l7" +path="res://.godot/imported/FirstIcon.png-51362bbefd81dee000fc3aedbade09ac.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Scenes/Maps/Assets/FirstIcon.png" +dest_files=["res://.godot/imported/FirstIcon.png-51362bbefd81dee000fc3aedbade09ac.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 diff --git a/Scenes/Maps/Assets/ShopIcon.png b/Scenes/Maps/Assets/ShopIcon.png new file mode 100644 index 00000000..47c478cc Binary files /dev/null and b/Scenes/Maps/Assets/ShopIcon.png differ diff --git a/Scenes/Maps/Assets/ShopIcon.png.import b/Scenes/Maps/Assets/ShopIcon.png.import new file mode 100644 index 00000000..70de0b02 --- /dev/null +++ b/Scenes/Maps/Assets/ShopIcon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://thmkt407eqbo" +path="res://.godot/imported/ShopIcon.png-db80b24a389b2b47bc99151013ec8cd6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Scenes/Maps/Assets/ShopIcon.png" +dest_files=["res://.godot/imported/ShopIcon.png-db80b24a389b2b47bc99151013ec8cd6.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 diff --git a/Scenes/Maps/Assets/StartIcon.png b/Scenes/Maps/Assets/StartIcon.png new file mode 100644 index 00000000..3b5e9135 Binary files /dev/null and b/Scenes/Maps/Assets/StartIcon.png differ diff --git a/Scenes/Maps/Assets/StartIcon.png.import b/Scenes/Maps/Assets/StartIcon.png.import new file mode 100644 index 00000000..3bbd35d8 --- /dev/null +++ b/Scenes/Maps/Assets/StartIcon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cyip3p5s5pav5" +path="res://.godot/imported/StartIcon.png-7b0cc3340e736d4b2b89804cd6171f26.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Scenes/Maps/Assets/StartIcon.png" +dest_files=["res://.godot/imported/StartIcon.png-7b0cc3340e736d4b2b89804cd6171f26.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 diff --git a/Scenes/Maps/Cartographer.tscn b/Scenes/Maps/Cartographer.tscn index 157ca73d..77d92b06 100644 --- a/Scenes/Maps/Cartographer.tscn +++ b/Scenes/Maps/Cartographer.tscn @@ -18,6 +18,7 @@ Camera = NodePath("TheView") top_level = true anchor_mode = 0 limit_top = -10 +limit_bottom = 530 [node name="UI" type="CanvasLayer" parent="." node_paths=PackedStringArray("CurSceneNode")] script = ExtResource("2_cl7v0") @@ -25,10 +26,15 @@ CurSceneNode = NodePath("..") [node name="BG" type="TextureRect" parent="."] modulate = Color(0.462, 0.462, 0.66, 1) -offset_left = -557.0 -offset_top = -84.0 -offset_right = 83.0 -offset_bottom = 96.0 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -320.0 +offset_top = -10.0 +offset_right = 320.0 +offset_bottom = 170.0 +grow_horizontal = 2 +grow_vertical = 2 scale = Vector2(3, 3) texture = ExtResource("2_5g6at") script = ExtResource("5_taedj") diff --git a/Scenes/Maps/InBetween.tscn b/Scenes/Maps/InBetween.tscn index 7d57aa3f..7a3629ff 100644 --- a/Scenes/Maps/InBetween.tscn +++ b/Scenes/Maps/InBetween.tscn @@ -20,5 +20,5 @@ offset_bottom = 284.0 theme = ExtResource("2_dapxv") text = "INBETWEEN_CONTINUE" script = ExtResource("3_35xdc") -ScenePath = 4 +ScenePath = 7 _startFocused = true diff --git a/Scenes/Maps/Scripts/Cartographer.cs b/Scenes/Maps/Scripts/Cartographer.cs index b60a8a17..6e84bd20 100644 --- a/Scenes/Maps/Scripts/Cartographer.cs +++ b/Scenes/Maps/Scripts/Cartographer.cs @@ -24,14 +24,15 @@ public partial class Cartographer : Node2D private Button _focusedButton; - private static readonly Dictionary StageIcons = new Dictionary< - Stages, - Texture2D - > + private static readonly Dictionary StageIcons = new() { { Stages.Battle, GD.Load("res://Scenes/Maps/Assets/BattleIcon.png") }, + { Stages.Elite, GD.Load("res://Scenes/Maps/Assets/EliteIcon.png") }, { Stages.Boss, GD.Load("res://Scenes/Maps/Assets/BossIcon.png") }, { Stages.Chest, GD.Load("res://Scenes/Maps/Assets/ChestIcon.png") }, + { Stages.Shop, GD.Load("res://Scenes/Maps/Assets/ShopIcon.png") }, + { Stages.Event, GD.Load("res://Scenes/Maps/Assets/EventIcon.png") }, + { Stages.Map, GD.Load("res://Scenes/Maps/Assets/FirstIcon.png") }, }; public override void _Ready() @@ -54,7 +55,7 @@ public override void _EnterTree() private Vector2 GetPosition(int x, int y) { - return new Vector2((float)x * 640 / 8 + 32, y * 48 + 16); + return new Vector2((float)(x + 1) * 640 / (StageProducer.Map.Width + 1), y * 48 + 16); } private void DrawMap() @@ -117,16 +118,20 @@ private void DrawMapSprite(MapGrid.Room room) } newButton.Icon = StageIcons[room.Type]; + if (room.Y == 0) + newButton.Icon = StageIcons[Stages.Map]; newButton.ZIndex = 1; newButton.Position = GetPosition(room.X, room.Y) - newButton.Size / 2; if (room == StageProducer.GetCurRoom()) { PlayerSprite.Position = newButton.Position + newButton.Size * .5f; - Camera.Position -= //TODO: Better camera matching for areas. + Camera.Position -= ( (GetViewportRect().Size / 2) - (newButton.Position + newButton.Size * .5f) - ).Normalized() * 20; + ).Normalized() + * room.X + * 48; } } diff --git a/Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs b/Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs index 632287ae..1adfff0d 100644 --- a/Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs +++ b/Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs @@ -11,6 +11,7 @@ public override void _Ready() MaxHealth = 225; CurrentHealth = MaxHealth; BaseMoney = 15; + InitialNote = (14, 3); base._Ready(); var enemTween = CreateTween(); enemTween.TweenProperty(Sprite, "position", Vector2.Down * 5, 1f).AsRelative(); @@ -29,6 +30,7 @@ public override void _Ready() (e, eff, val) => { eff.Owner.Heal(val); + e.BD.RandApplyNote(eff.Owner, 14, 1); } ), }; diff --git a/Scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs b/Scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs index ed783142..cd26339a 100644 --- a/Scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs +++ b/Scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs @@ -1,4 +1,4 @@ -using System; +using FunkEngine; using Godot; public partial class P_Parasifly : EnemyPuppet @@ -11,6 +11,7 @@ public override void _Ready() MaxHealth = 100; CurrentHealth = MaxHealth; BaseMoney = 5; + InitialNote = (13, 2); base._Ready(); var enemTween = CreateTween(); enemTween.TweenProperty(Sprite, "position", Vector2.Down * 2, 2f).AsRelative(); @@ -19,5 +20,35 @@ public override void _Ready() enemTween.SetEase(Tween.EaseType.In); enemTween.SetLoops(); enemTween.Play(); + + BattleEvents = new EnemyEffect[] + { + new EnemyEffect( + this, + BattleEffectTrigger.OnBattleStart, + 1, + (e, eff, _) => + { + e.BD.RandApplyNote(eff.Owner, 13, 1); + } + ), + new EnemyEffect( + this, + BattleEffectTrigger.OnDamageInstance, + 3, + (e, eff, val) => + { + if ( + val <= 0 + || e is not BattleDirector.Harbinger.OnDamageInstanceArgs dArgs + || dArgs.Dmg.Target != eff.Owner + || dArgs.Dmg.Damage < dArgs.Dmg.Target.GetCurrentHealth() + ) + return; + e.BD.AddStatus(Targetting.All, StatusEffect.Block, val); + eff.Value = 0; + } + ), + }; } } diff --git a/Scenes/Puppets/Scripts/PuppetTemplate.cs b/Scenes/Puppets/Scripts/PuppetTemplate.cs index 9f69c969..09b7caec 100644 --- a/Scenes/Puppets/Scripts/PuppetTemplate.cs +++ b/Scenes/Puppets/Scripts/PuppetTemplate.cs @@ -170,6 +170,8 @@ public int GetCurrentHealth() /// public bool AddStatusEffect(StatusEffect effect) { + if (CurrentHealth <= 0) + return false; int index = StatusEffects.FindIndex(sEff => sEff.StatusName == effect.StatusName); if (index != -1) //If status of same name -> stack -> return false { diff --git a/Scenes/UI/Inventory.tscn b/Scenes/UI/Inventory.tscn index dde8d6c5..4e031711 100644 --- a/Scenes/UI/Inventory.tscn +++ b/Scenes/UI/Inventory.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=5 format=3 uid="uid://be6fb2sr5i515"] +[gd_scene load_steps=6 format=3 uid="uid://be6fb2sr5i515"] [ext_resource type="Script" uid="uid://kqa0ovjph1hd" path="res://Scenes/UI/Scripts/Inventory.cs" id="1_8rcwd"] [ext_resource type="Texture2D" uid="uid://ck16vyh1q68ri" path="res://Scenes/UI/Assets/UI_ForestBackground.png" id="2_s6pj7"] [ext_resource type="Texture2D" uid="uid://8u3xvcma81d" path="res://Scenes/UI/Assets/UI_CrystalFrame.png" id="3_s6pj7"] [ext_resource type="Texture2D" uid="uid://burj10os057fx" path="res://Scenes/UI/Assets/UI_CrystalFrameInset.png" id="4_b6trj"] +[ext_resource type="Texture2D" uid="uid://dyt1cvag13aik" path="res://SharedAssets/Money.png" id="5_si1x5"] [node name="Inventory" type="Control" node_paths=PackedStringArray("_relics", "_notes", "_description", "_tabs", "_moneyLabel")] process_mode = 1 @@ -18,7 +19,7 @@ _relics = NodePath("MarginContainer/InvenVBox/Tabs/INVENTORY_TAB_RELICS/MarginCo _notes = NodePath("MarginContainer/InvenVBox/Tabs/INVENTORY_TAB_NOTES/MarginContainer/NotesBox/NotesGrid") _description = NodePath("MarginContainer/InvenVBox/DescBox/DescMargin/MarginContainer/Description") _tabs = NodePath("MarginContainer/InvenVBox/Tabs") -_moneyLabel = NodePath("MoneyContainer/MoneyFrame/MarginContainer/MoneyLabel") +_moneyLabel = NodePath("MoneyContainer/MoneyFrame/MarginContainer/HBoxContainer/MoneyLabel") [node name="Background" type="NinePatchRect" parent="."] self_modulate = Color(1, 1, 1, 0.75) @@ -199,9 +200,24 @@ grow_horizontal = 2 grow_vertical = 2 theme_override_constants/margin_right = 8 -[node name="MoneyLabel" type="Label" parent="MoneyContainer/MoneyFrame/MarginContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="MoneyContainer/MoneyFrame/MarginContainer"] layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="MoneyContainer/MoneyFrame/MarginContainer/HBoxContainer"] +layout_mode = 2 +theme_override_constants/margin_left = 6 + +[node name="TextureRect" type="TextureRect" parent="MoneyContainer/MoneyFrame/MarginContainer/HBoxContainer/MarginContainer"] +layout_mode = 2 +size_flags_vertical = 4 +texture = ExtResource("5_si1x5") + +[node name="MoneyLabel" type="Label" parent="MoneyContainer/MoneyFrame/MarginContainer/HBoxContainer"] +custom_minimum_size = Vector2(91, 0) +layout_mode = 2 +size_flags_horizontal = 10 size_flags_vertical = 1 text = "0" horizontal_alignment = 2 vertical_alignment = 1 +clip_text = true diff --git a/Scenes/UI/ScoreScreen.tscn b/Scenes/UI/ScoreScreen.tscn index 30ff0c18..5fa20eb6 100644 --- a/Scenes/UI/ScoreScreen.tscn +++ b/Scenes/UI/ScoreScreen.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=6 format=3 uid="uid://d3ulgssit1dcv"] +[gd_scene load_steps=7 format=3 uid="uid://d3ulgssit1dcv"] [ext_resource type="Script" uid="uid://b5bw86d25uwdd" path="res://Scenes/UI/Scripts/ScoringScreen.cs" id="1_ma4hf"] [ext_resource type="Texture2D" uid="uid://ck16vyh1q68ri" path="res://Scenes/UI/Assets/UI_ForestBackground.png" id="1_ws5ov"] [ext_resource type="Texture2D" uid="uid://8u3xvcma81d" path="res://Scenes/UI/Assets/UI_CrystalFrame.png" id="2_usavq"] [ext_resource type="Texture2D" uid="uid://burj10os057fx" path="res://Scenes/UI/Assets/UI_CrystalFrameInset.png" id="3_usavq"] [ext_resource type="Theme" uid="uid://d37e3tpsbxwak" path="res://Scenes/UI/Assets/GeneralTheme.tres" id="4_1rsqt"] +[ext_resource type="Texture2D" uid="uid://dyt1cvag13aik" path="res://SharedAssets/Money.png" id="5_0mn6u"] [node name="ScoreScreen" type="CanvasLayer" node_paths=PackedStringArray("_styleLabel", "_styleAmount", "_perfectsLabel", "_perfectsAmount", "_placedLabel", "_placedAmount", "_totalLabel", "_totalAmount", "_relicLabel", "_relicAmount", "_acceptButton")] process_mode = 3 @@ -16,7 +17,7 @@ _perfectsAmount = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContaine _placedLabel = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/LabelMargin/LabelVbox/PlacedLabel") _placedAmount = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/ScoreMargin/LabelVbox/PlacedLabel") _totalLabel = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/LabelMargin/LabelVbox/TotalLabel") -_totalAmount = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/ScoreMargin/LabelVbox/TotalLabel") +_totalAmount = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/ScoreMargin/LabelVbox/HBoxContainer/TotalLabel") _relicLabel = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/LabelMargin/LabelVbox/RelicLabel") _relicAmount = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/ScoreMargin/LabelVbox/RelicLabel") _acceptButton = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/ButtonMargin/AcceptButton") @@ -196,8 +197,18 @@ horizontal_alignment = 2 layout_mode = 2 horizontal_alignment = 2 -[node name="TotalLabel" type="Label" parent="Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/ScoreMargin/LabelVbox"] +[node name="HBoxContainer" type="HBoxContainer" parent="Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/ScoreMargin/LabelVbox"] layout_mode = 2 + +[node name="MoneyIcon" type="TextureRect" parent="Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/ScoreMargin/LabelVbox/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 0 +size_flags_vertical = 4 +texture = ExtResource("5_0mn6u") + +[node name="TotalLabel" type="Label" parent="Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/ScoreMargin/LabelVbox/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 10 text = "999" horizontal_alignment = 2 diff --git a/Scenes/UI/Scripts/RewardSelect.cs b/Scenes/UI/Scripts/RewardSelect.cs index 4d39ca83..a00cdf8c 100644 --- a/Scenes/UI/Scripts/RewardSelect.cs +++ b/Scenes/UI/Scripts/RewardSelect.cs @@ -71,20 +71,32 @@ private void AddButton(IDisplayable displayable) private void GenerateSelection() { - if (_roomType == Stages.Battle) + switch (_roomType) { - GenerateNoteChoices(_amount); - } - else - { - GenerateRelicChoices(_amount); + case Stages.Battle: + GenerateNoteChoices(_amount); + break; + case Stages.Boss: + GenerateRelicChoices(_amount, [1, 5, 5, 5, 0]); + break; + default: + GenerateRelicChoices(_amount); + break; } } - private void GenerateRelicChoices(int amount = 1) + private void GenerateRelicChoices(int amount = 1, int[] addedOdds = null) { if (amount < 1) GD.PushError("Error: In RewardSelect: amount < 1"); + int[] fullOdds = new int[_player.RarityOdds.Length]; + bool extraOdds = addedOdds != null && addedOdds.Length == _player.RarityOdds.Length; + for (int i = 0; i < _player.RarityOdds.Length; i++) + { + fullOdds[i] = _player.RarityOdds[i]; + if (extraOdds) + fullOdds[i] += addedOdds[i]; + } _rChoices = Scribe.GetRandomRelics( amount, StageProducer.CurRoom + 10 * _curRerolls, diff --git a/Scenes/UI/TitleScreen/TitleScreen.tscn b/Scenes/UI/TitleScreen/TitleScreen.tscn index d16c8ea4..4eff8c85 100644 --- a/Scenes/UI/TitleScreen/TitleScreen.tscn +++ b/Scenes/UI/TitleScreen/TitleScreen.tscn @@ -183,7 +183,7 @@ theme = ExtResource("13_v0au1") theme_override_font_sizes/font_size = 24 text = "TITLE_START" script = ExtResource("2_7f3m6") -ScenePath = 4 +ScenePath = 7 _startFocused = true [node name="MarginContainer3" type="MarginContainer" parent="VBoxContainer/HBoxContainer"] @@ -206,7 +206,7 @@ theme = ExtResource("13_v0au1") theme_override_font_sizes/font_size = 24 text = "TITLE_CONTINUE" script = ExtResource("2_7f3m6") -ScenePath = 5 +ScenePath = 8 [node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer"] layout_mode = 2 @@ -227,7 +227,7 @@ theme = ExtResource("13_v0au1") theme_override_font_sizes/font_size = 24 text = "TITLE_QUIT" script = ExtResource("2_7f3m6") -ScenePath = 3 +ScenePath = 6 [node name="OptionsMargin" type="MarginContainer" parent="VBoxContainer"] layout_mode = 2 diff --git a/SharedAssets/BackGround_City.png b/SharedAssets/BackGround_City.png new file mode 100644 index 00000000..42206dee Binary files /dev/null and b/SharedAssets/BackGround_City.png differ diff --git a/SharedAssets/BackGround_City.png.import b/SharedAssets/BackGround_City.png.import new file mode 100644 index 00000000..cdb64a4b --- /dev/null +++ b/SharedAssets/BackGround_City.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bct14w72jt3gv" +path="res://.godot/imported/BackGround_City.png-d23ac72f201ffb7936eaec08855f457c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://SharedAssets/BackGround_City.png" +dest_files=["res://.godot/imported/BackGround_City.png-d23ac72f201ffb7936eaec08855f457c.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 diff --git a/SharedAssets/Money.png b/SharedAssets/Money.png new file mode 100644 index 00000000..c49cef32 Binary files /dev/null and b/SharedAssets/Money.png differ diff --git a/SharedAssets/Money.png.import b/SharedAssets/Money.png.import new file mode 100644 index 00000000..14bf2de1 --- /dev/null +++ b/SharedAssets/Money.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dyt1cvag13aik" +path="res://.godot/imported/Money.png-067f5c3b789c8217e2c81c86c031e2f0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://SharedAssets/Money.png" +dest_files=["res://.godot/imported/Money.png-067f5c3b789c8217e2c81c86c031e2f0.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