From af636c73fbd982cec7f678b8ff55a60e90b1d318 Mon Sep 17 00:00:00 2001 From: cornerloan Date: Tue, 17 Jun 2025 01:19:04 -0700 Subject: [PATCH 1/4] Initial implementation The enemy descriptions class should be working but the box is small so it doesn't look good. Also the icons need to be different than just the note icon. Such as making the loop icon for loop type effects. --- Classes/Notes/Note.cs | 6 ++- Globals/Scribe.cs | 18 ++++++--- Globals/Translations/Translations.csv | 21 +++++++++- Scenes/BattleDirector/BattleScene.tscn | 13 +++++- Scenes/BattleDirector/EnemyDescriptions.tscn | 26 ++++++++++++ .../BattleDirector/Scripts/BattleDirector.cs | 4 ++ .../Scripts/EnemyDescriptions.cs | 40 +++++++++++++++++++ .../Scripts/EnemyDescriptions.cs.uid | 1 + .../Puppets/Enemies/BossBlood/P_BossBlood.cs | 13 ++++-- Scenes/Puppets/Enemies/CyberFox/P_CyberFox.cs | 3 +- Scenes/Puppets/Enemies/Effigy/P_Effigy.cs | 12 ++++-- Scenes/Puppets/Enemies/EnemyEffect.cs | 5 ++- .../Enemies/Holograeme/P_Holograeme.cs | 12 ++++-- Scenes/Puppets/Enemies/Keythulu/P_Keythulu.cs | 16 ++++++-- Scenes/Puppets/Enemies/LWS/P_LWS.cs | 3 +- Scenes/Puppets/Enemies/Midriff/P_Midriff.cs | 3 +- Scenes/Puppets/Enemies/Mushroom/P_Mushroom.cs | 3 +- .../Puppets/Enemies/Parasifly/P_Parasifly.cs | 6 ++- Scenes/Puppets/Enemies/Spider/P_Spider.cs | 3 +- Scenes/Puppets/Enemies/Strawman/P_Strawman.cs | 18 ++++++--- Scenes/Puppets/Enemies/TheGWS/P_TheGWS.cs | 3 +- Scenes/Puppets/Enemies/Turtle/P_Turtle.cs | 3 +- 22 files changed, 191 insertions(+), 41 deletions(-) create mode 100644 Scenes/BattleDirector/EnemyDescriptions.tscn create mode 100644 Scenes/BattleDirector/Scripts/EnemyDescriptions.cs create mode 100644 Scenes/BattleDirector/Scripts/EnemyDescriptions.cs.uid diff --git a/Classes/Notes/Note.cs b/Classes/Notes/Note.cs index 3dc196e3..4751118b 100644 --- a/Classes/Notes/Note.cs +++ b/Classes/Notes/Note.cs @@ -18,6 +18,8 @@ public partial class Note : Resource, IDisplayable public const double TimingMax = 0.5d; //The max range for a note to be timed is its beat +/- this const public Texture2D Texture { get; set; } + public string Description; + public Note( int id, string name, @@ -25,7 +27,8 @@ public Note( int baseVal = 1, Action noteEffect = null, float costModifier = 1.0f, - Targetting targetType = Targetting.First + Targetting targetType = Targetting.First, + string description = null ) { Id = id; @@ -35,6 +38,7 @@ public Note( Texture = texture; CostModifier = costModifier; TargetType = targetType; + Description = description; } public void OnHit(BattleDirector BD, Timing timing) diff --git a/Globals/Scribe.cs b/Globals/Scribe.cs index 80f0a6d2..068cfd17 100644 --- a/Globals/Scribe.cs +++ b/Globals/Scribe.cs @@ -150,7 +150,8 @@ public partial class Scribe : Node if (timing == Timing.Perfect) dmg = 0; director.DealDamage(Targetting.Player, dmg, note.Owner); - } + }, + description: "GWS_NOTE_DESCRIPTION" ), new Note( 11, @@ -188,7 +189,8 @@ public partial class Scribe : Node { int amt = Math.Max((3 - (int)timing) * note.GetBaseVal(), 0); director.AddStatus(Targetting.All, StatusEffect.Block, amt); - } + }, + description: "PARASIFLY_NOTE_DESCRIPTION" ), new Note( 14, @@ -203,7 +205,8 @@ public partial class Scribe : Node note.Owner.Heal((3 - (int)timing)); }, default, - Targetting.Player + Targetting.Player, + "BOSSBLOOD_NOTE_DESCRIPTION" ), new Note( 15, @@ -216,7 +219,8 @@ public partial class Scribe : Node return; int amt = Math.Max((3 - (int)timing) * note.GetBaseVal(), 1); director.AddStatus(Targetting.Player, StatusEffect.Poison, amt); - } + }, + description: "SPIDER_NOTE_DESCRIPTION" ), new Note( 16, @@ -229,7 +233,8 @@ public partial class Scribe : Node if (timing == Timing.Perfect) dmg = 0; director.DealDamage(Targetting.Player, dmg, note.Owner); - } + }, + description: "LWS_NOTE_DESCRIPTION" ), new Note( 17, @@ -242,7 +247,8 @@ public partial class Scribe : Node return; int amt = Math.Max((3 - (int)timing) * note.GetBaseVal(), 1); director.AddStatus(Targetting.Player, StatusEffect.Poison, amt); - } + }, + description: "MUSHROOM_NOTE_DESCRIPTION" ), new Note( 18, diff --git a/Globals/Translations/Translations.csv b/Globals/Translations/Translations.csv index 47d68594..98ccef4e 100644 --- a/Globals/Translations/Translations.csv +++ b/Globals/Translations/Translations.csv @@ -206,4 +206,23 @@ CREDITS_ADDITIONAL_ART,Art,额外美术 CREDITS_ADDITIONAL_HELP,Additional Help,额外协助 CREDITS_OTHER_PLAYTESTERS,All our other playtesters,以及所有其他测试玩家 CREDITS_SPECIAL_THANKS,Special Thanks,特别鸣谢 -CREDITS_THANKS_PLAYERS,And to you the player!,以及屏幕前的你! \ No newline at end of file +CREDITS_THANKS_PLAYERS,And to you the player!,以及屏幕前的你! +BOSSBLOOD_EFFECT1,"Heal {0} and convert a basic note into a Blood note","每循环治疗 {0} 点生命,并将一个普通音符转化为血之音符" +CYBERFOX_EFFECT1,Gains one dodge,获得一次闪避 +EFFIGY_EFFECT1,Only takes 1 damage at a time,每次只受到1点伤害 +EFFIGY_EFFECT2,Sets player's health to 1 if defeated,被击败时将玩家的生命值设为1 +HOLOGRAEME_EFFECT1,Player only plays every other loop,玩家每隔一轮行动一次 +HOLOGRAEME_EFFECT2,Holograeme only has 1 health,Holograeme 只有1点生命值 +KEYTHULU_EFFECT1,"Keythulu will kill the player after {0} loops","Keythulu 会在 {0} 个循环后杀死玩家" +LWS_EFFECT1,Converts a basic note into a Lesser Wolf Spirit note,将一个普通音符转化为小狼灵音符 +PARASIFLY_EFFECT1,Parasifly gains block the first time fatal damage is dealt,Parasifly 在首次受到致命伤害时获得格挡 +STRAWMAN_EFFECT1,Player cannot take fatal damage,玩家不会受到致命伤害 +GWS_EFFECT1,Adds Greater Wolf Spirit notes after the first loop,第一轮后添加大狼灵音符 +TURTLE_EFFECT1,Gains one block and removes some of player's charge,获得一层格挡并移除玩家的一些能量 +GWS_NOTE_DESCRIPTION,"Deals double damage plus the number of loops","造成双倍双倍伤害,并附加当前循环数值" +PARASIFLY_NOTE_DESCRIPTION,Parasifly gains block based on timing,Parasifly 根据时机获得格挡 +BOSSBLOOD_NOTE_DESCRIPTION,Blood heals based on timing,血液根据时机恢复生命 +SPIDER_NOTE_DESCRIPTION,Player gets poisoned based on timing,玩家根据时机中毒 +LWS_NOTE_DESCRIPTION,Deals damage plus half the number of loops,造成伤害并额外附加一半的循环次数 +MUSHROOM_NOTE_DESCRIPTION,Player gets poisoned based on timing,玩家根据时机中毒 + diff --git a/Scenes/BattleDirector/BattleScene.tscn b/Scenes/BattleDirector/BattleScene.tscn index 2e60464c..5ddeac30 100644 --- a/Scenes/BattleDirector/BattleScene.tscn +++ b/Scenes/BattleDirector/BattleScene.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 format=3 uid="uid://b0mrgr7h0ty1y"] +[gd_scene load_steps=14 format=3 uid="uid://b0mrgr7h0ty1y"] [ext_resource type="Script" uid="uid://bttu0wmy2fp64" path="res://Scenes/BattleDirector/Scripts/BattleDirector.cs" id="1_jmdo1"] [ext_resource type="Script" uid="uid://pl57giqyhckb" path="res://Scenes/UI/Scripts/MenuModule.cs" id="2_ka0ws"] @@ -10,6 +10,7 @@ [ext_resource type="Script" uid="uid://cp6t6haqyef7o" path="res://Scenes/AreaBasedBackground.cs" id="7_6k2qj"] [ext_resource type="Texture2D" uid="uid://dbjotl0v1ymia" path="res://SharedAssets/BattleFrame1.png" id="7_klvil"] [ext_resource type="Theme" uid="uid://d37e3tpsbxwak" path="res://Scenes/UI/Assets/GeneralTheme.tres" id="8_62qim"] +[ext_resource type="PackedScene" uid="uid://bejjkejyeffek" path="res://Scenes/BattleDirector/EnemyDescriptions.tscn" id="11_gbbxr"] [sub_resource type="Gradient" id="Gradient_8uy3a"] offsets = PackedFloat32Array(0, 0.766234, 1) @@ -20,7 +21,7 @@ gradient = SubResource("Gradient_8uy3a") fill_from = Vector2(1, 0) fill_to = Vector2(0.738532, 1) -[node name="ProtoBattleDirector" type="Node2D" node_paths=PackedStringArray("PuppetMarkers", "_countdownLabel", "CD", "CM", "DW", "NPB", "Audio", "FocusedButton")] +[node name="ProtoBattleDirector" type="Node2D" node_paths=PackedStringArray("PuppetMarkers", "_countdownLabel", "CD", "CM", "DW", "NPB", "Audio", "Descriptions", "FocusedButton")] process_mode = 1 script = ExtResource("1_jmdo1") PuppetMarkers = [NodePath("PlayerMarker"), NodePath("Enemy1Marker"), NodePath("Enemy2Marker"), NodePath("Enemy3Marker")] @@ -30,6 +31,7 @@ CM = NodePath("VPContainer") DW = NodePath("3D/SubViewport/3DWizard") NPB = NodePath("NotePlacementBar") Audio = NodePath("AudioStreamPlayer") +Descriptions = NodePath("EnemyDescriptions") FocusedButton = NodePath("StartButton") metadata/_edit_lock_ = true @@ -142,3 +144,10 @@ theme_override_constants/shadow_offset_y = 3 theme_override_constants/shadow_outline_size = 3 theme_override_font_sizes/font_size = 64 text = "5" + +[node name="EnemyDescriptions" parent="." instance=ExtResource("11_gbbxr")] +z_index = 1 +offset_left = 559.0 +offset_top = 177.0 +offset_right = 559.0 +offset_bottom = 177.0 diff --git a/Scenes/BattleDirector/EnemyDescriptions.tscn b/Scenes/BattleDirector/EnemyDescriptions.tscn new file mode 100644 index 00000000..5310d9c0 --- /dev/null +++ b/Scenes/BattleDirector/EnemyDescriptions.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=3 format=3 uid="uid://bejjkejyeffek"] + +[ext_resource type="Script" uid="uid://da8no3g3kbob7" path="res://Scenes/BattleDirector/Scripts/EnemyDescriptions.cs" id="1_r3tcc"] +[ext_resource type="Texture2D" uid="uid://djd6iw2g84bba" path="res://Scenes/UI/Assets/UI_CenterFrame.png" id="2_mg2uj"] + +[node name="EnemyDescriptions" type="Control" node_paths=PackedStringArray("DescriptionsContainer")] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_r3tcc") +DescriptionsContainer = NodePath("VBoxContainer") + +[node name="UiCenterFrame" type="Sprite2D" parent="."] +scale = Vector2(0.84375, 3.5) +texture = ExtResource("2_mg2uj") +centered = false + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 0 +offset_left = 8.0 +offset_top = 15.0 +offset_right = 75.0 +offset_bottom = 168.0 diff --git a/Scenes/BattleDirector/Scripts/BattleDirector.cs b/Scenes/BattleDirector/Scripts/BattleDirector.cs index 1040f01e..e36f2fee 100644 --- a/Scenes/BattleDirector/Scripts/BattleDirector.cs +++ b/Scenes/BattleDirector/Scripts/BattleDirector.cs @@ -34,6 +34,9 @@ public partial class BattleDirector : Node2D [Export] private AudioStreamPlayer Audio; + [Export] + private EnemyDescriptions Descriptions; + [Export] public Button FocusedButton; //Initial start button @@ -201,6 +204,7 @@ private void InitEnemies() _enemies[i] = enemy; AddEnemyEffects(enemy); } + Descriptions.Setup(_enemies[0]); } public override void _Process(double delta) diff --git a/Scenes/BattleDirector/Scripts/EnemyDescriptions.cs b/Scenes/BattleDirector/Scripts/EnemyDescriptions.cs new file mode 100644 index 00000000..fbf83787 --- /dev/null +++ b/Scenes/BattleDirector/Scripts/EnemyDescriptions.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using Godot; + +public partial class EnemyDescriptions : Node +{ + public List Descriptions = new List(); + + [Export] + private VBoxContainer DescriptionsContainer; + + public void Setup(EnemyPuppet enemy) + { + if (enemy.InitialNote != (0, 0)) + Descriptions.Add(Scribe.NoteDictionary[enemy.InitialNote.NoteId].Description); + + foreach (var effect in enemy.GetBattleEvents()) + { + if (effect.Description != null) + Descriptions.Add(effect.Description); + } + + foreach (var description in Descriptions) + { + HBoxContainer hbox = new HBoxContainer(); + + Sprite2D icon = new Sprite2D(); + icon.Texture = Scribe.NoteDictionary[enemy.InitialNote.NoteId].Texture; + + Label desc = new Label(); + desc.Text = description; + desc.SizeFlagsHorizontal = Control.SizeFlags.ExpandFill; + desc.AutowrapMode = TextServer.AutowrapMode.WordSmart; + + hbox.AddChild(icon); + hbox.AddChild(desc); + DescriptionsContainer.AddChild(hbox); + } + } +} diff --git a/Scenes/BattleDirector/Scripts/EnemyDescriptions.cs.uid b/Scenes/BattleDirector/Scripts/EnemyDescriptions.cs.uid new file mode 100644 index 00000000..3a488050 --- /dev/null +++ b/Scenes/BattleDirector/Scripts/EnemyDescriptions.cs.uid @@ -0,0 +1 @@ +uid://da8no3g3kbob7 diff --git a/Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs b/Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs index bd4748c1..3ede883e 100644 --- a/Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs +++ b/Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs @@ -21,17 +21,23 @@ public override void _Ready() enemTween.SetLoops(); enemTween.Play(); + const int effect1Val = 30; + BattleEvents = new EnemyEffect[] { new EnemyEffect( this, BattleEffectTrigger.OnLoop, - 30, + effect1Val, (e, eff, val) => { eff.Owner.Heal(val); e.BD.RandApplyNote(eff.Owner, 14, 1); - } + }, + string.Format( + TranslationServer.Translate("BOSSBLOOD_EFFECT1"), + effect1Val.ToString() + ) ), new EnemyEffect( this, @@ -48,7 +54,8 @@ public override void _Ready() { SteamWhisperer.PopAchievement("actOneComp"); } - } + }, + null ), }; } diff --git a/Scenes/Puppets/Enemies/CyberFox/P_CyberFox.cs b/Scenes/Puppets/Enemies/CyberFox/P_CyberFox.cs index d1099374..ea08af13 100644 --- a/Scenes/Puppets/Enemies/CyberFox/P_CyberFox.cs +++ b/Scenes/Puppets/Enemies/CyberFox/P_CyberFox.cs @@ -40,7 +40,8 @@ public override void _Ready() { e.BD.AddStatus(Targetting.First, StatusEffect.Dodge, 1); _effectNode.TriggerGlitch(1f); - } + }, + "CYBERFOX_EFFECT1" ), }; } diff --git a/Scenes/Puppets/Enemies/Effigy/P_Effigy.cs b/Scenes/Puppets/Enemies/Effigy/P_Effigy.cs index 8cd0e024..77975bcf 100644 --- a/Scenes/Puppets/Enemies/Effigy/P_Effigy.cs +++ b/Scenes/Puppets/Enemies/Effigy/P_Effigy.cs @@ -29,7 +29,8 @@ public override void _Ready() dArgs.Dmg.ModifyDamage(-dArgs.Dmg.Damage + 1); if (dArgs.Dmg.Source != null) dArgs.Dmg.Source.TakeDamage(new DamageInstance(1, null, dArgs.Dmg.Source)); - } + }, + "EFFIGY_EFFECT1" ), new EnemyEffect( this, @@ -38,7 +39,8 @@ public override void _Ready() (e, _, _) => { e.BD.DealDamage(Targetting.Player, e.BD.Player.GetCurrentHealth() - 1, null); - } + }, + "EFFECT_EFFECT2" ), new EnemyEffect( this, @@ -48,7 +50,8 @@ public override void _Ready() { _tutorialInstance = Toriel.AttachNewToriel(e.BD); _tutorialInstance.BossDialogue(); - } + }, + null ), new EnemyEffect( this, @@ -67,7 +70,8 @@ public override void _Ready() _tutorialInstance.FromBoss = true; _tutorialInstance.OnPlaceDialogue3(); } - } + }, + null ), }; } diff --git a/Scenes/Puppets/Enemies/EnemyEffect.cs b/Scenes/Puppets/Enemies/EnemyEffect.cs index 8fb1bc1d..7b8a866a 100644 --- a/Scenes/Puppets/Enemies/EnemyEffect.cs +++ b/Scenes/Puppets/Enemies/EnemyEffect.cs @@ -8,12 +8,14 @@ public class EnemyEffect : IBattleEvent private int _baseValue; public int Value; private Action _onEnemyEffect; + public string Description { get; private set; } public EnemyEffect( EnemyPuppet owner, BattleEffectTrigger trigger, int val, - Action onEnemyEffect + Action onEnemyEffect, + string description ) { Owner = owner; @@ -21,6 +23,7 @@ Action onEnemyEffect Value = _baseValue; Trigger = trigger; _onEnemyEffect = onEnemyEffect; + Description = description; } public void OnTrigger(BattleEventArgs e) diff --git a/Scenes/Puppets/Enemies/Holograeme/P_Holograeme.cs b/Scenes/Puppets/Enemies/Holograeme/P_Holograeme.cs index 468906b9..98c8fccc 100644 --- a/Scenes/Puppets/Enemies/Holograeme/P_Holograeme.cs +++ b/Scenes/Puppets/Enemies/Holograeme/P_Holograeme.cs @@ -46,7 +46,8 @@ public override void _Ready() BattleDirector.PlayerDisabled = true; BattleDirector.VerticalScrollRotation = 0f; e.BD.AddStatus(Targetting.Player, StatusEffect.Disable); - } + }, + "HOLOGRAEME_EFFECT1" ), new EnemyEffect( this, @@ -69,7 +70,8 @@ public override void _Ready() BattleDirector.AutoPlay = false; Scribe.NoteDictionary[0].Texture = GD.Load(NoteCoverPath); } - } + }, + null ), new EnemyEffect( this, @@ -81,7 +83,8 @@ public override void _Ready() { TweenDir(nArgs.Type); } - } + }, + null ), new EnemyEffect( this, @@ -98,7 +101,8 @@ e is not BattleDirector.Harbinger.OnDamageInstanceArgs dArgs { dArgs.Dmg.ModifyDamage(0, 0); } - } + }, + "HOLOGRAEME_EFFECT2" ), }; } diff --git a/Scenes/Puppets/Enemies/Keythulu/P_Keythulu.cs b/Scenes/Puppets/Enemies/Keythulu/P_Keythulu.cs index 1f721d92..c76a8dc4 100644 --- a/Scenes/Puppets/Enemies/Keythulu/P_Keythulu.cs +++ b/Scenes/Puppets/Enemies/Keythulu/P_Keythulu.cs @@ -27,16 +27,22 @@ public override void _Ready() enemTween.SetLoops(); enemTween.Play(); + const int effect1Val = 6; + BattleEvents = new EnemyEffect[] { new EnemyEffect( this, BattleEffectTrigger.OnBattleStart, - 6, + effect1Val, (e, eff, val) => { e.BD.AddStatus(Targetting.Player, StatusEffect.MindCrush, val); - } + }, + string.Format( + TranslationServer.Translate("KEYTHULU_EFFECT1"), + effect1Val.ToString() + ) ), new EnemyEffect( this, @@ -57,7 +63,8 @@ public override void _Ready() _effectSprite.Visible = false; }) ); - } + }, + null ), new EnemyEffect( this, @@ -78,7 +85,8 @@ public override void _Ready() SteamWhisperer.PopAchievement("actTwoComp"); StageProducer.UpdatePersistantValues(StageProducer.PersistKeys.HasWon, 1); } - } + }, + null ), }; } diff --git a/Scenes/Puppets/Enemies/LWS/P_LWS.cs b/Scenes/Puppets/Enemies/LWS/P_LWS.cs index 4da24ce9..25264cf8 100644 --- a/Scenes/Puppets/Enemies/LWS/P_LWS.cs +++ b/Scenes/Puppets/Enemies/LWS/P_LWS.cs @@ -30,7 +30,8 @@ public override void _Ready() (e, eff, val) => { e.BD.RandApplyNote(eff.Owner, InitialNote.NoteId, val); - } + }, + "LWS_EFFECT1" ), }; } diff --git a/Scenes/Puppets/Enemies/Midriff/P_Midriff.cs b/Scenes/Puppets/Enemies/Midriff/P_Midriff.cs index 7ec69dce..eff77845 100644 --- a/Scenes/Puppets/Enemies/Midriff/P_Midriff.cs +++ b/Scenes/Puppets/Enemies/Midriff/P_Midriff.cs @@ -33,7 +33,8 @@ public override void _Ready() MaxHealth += val; CurrentHealth = MaxHealth; BaseMoney += val / 10; - } + }, + null ), }; } diff --git a/Scenes/Puppets/Enemies/Mushroom/P_Mushroom.cs b/Scenes/Puppets/Enemies/Mushroom/P_Mushroom.cs index 4ad1ce8c..56c7b408 100644 --- a/Scenes/Puppets/Enemies/Mushroom/P_Mushroom.cs +++ b/Scenes/Puppets/Enemies/Mushroom/P_Mushroom.cs @@ -23,7 +23,8 @@ public override void _Ready() (e, eff, _) => { e.BD.RandApplyNote(eff.Owner, 17, 1); - } + }, + null ), }; } diff --git a/Scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs b/Scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs index bf27cee0..a711b8ee 100644 --- a/Scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs +++ b/Scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs @@ -30,7 +30,8 @@ public override void _Ready() (e, eff, _) => { e.BD.RandApplyNote(eff.Owner, 13, 1); - } + }, + null ), new EnemyEffect( this, @@ -47,7 +48,8 @@ public override void _Ready() return; e.BD.AddStatus(Targetting.All, StatusEffect.Block, val); eff.Value = 0; - } + }, + "PARASIFLY_EFFECT1" ), }; } diff --git a/Scenes/Puppets/Enemies/Spider/P_Spider.cs b/Scenes/Puppets/Enemies/Spider/P_Spider.cs index 9febd0bd..d4c70e17 100644 --- a/Scenes/Puppets/Enemies/Spider/P_Spider.cs +++ b/Scenes/Puppets/Enemies/Spider/P_Spider.cs @@ -23,7 +23,8 @@ public override void _Ready() (e, eff, _) => { e.BD.RandApplyNote(eff.Owner, 15, 1); - } + }, + null ), }; } diff --git a/Scenes/Puppets/Enemies/Strawman/P_Strawman.cs b/Scenes/Puppets/Enemies/Strawman/P_Strawman.cs index 7e58022e..146b376e 100644 --- a/Scenes/Puppets/Enemies/Strawman/P_Strawman.cs +++ b/Scenes/Puppets/Enemies/Strawman/P_Strawman.cs @@ -26,7 +26,8 @@ public override void _Ready() { _tutorialInstance = Toriel.AttachNewToriel(e.BD); _tutorialInstance.IntroDialogue(); - } + }, + null ), new EnemyEffect( this, @@ -47,7 +48,8 @@ public override void _Ready() _tutorialInstance.NoDying(); eff.Value--; } - } + }, + "STRAWMAN_EFFECT1" ), new EnemyEffect( this, @@ -61,7 +63,8 @@ public override void _Ready() { _tutorialInstance.LoopDialogue(); } - } + }, + null ), new EnemyEffect( this, @@ -77,7 +80,8 @@ public override void _Ready() return; eff.Value = 0; _tutorialInstance.PlaceDialogue1(); - } + }, + null ), new EnemyEffect( this, @@ -86,7 +90,8 @@ public override void _Ready() (_, _, _) => { _tutorialInstance.CallDeferred(nameof(_tutorialInstance.OnPlaceDialogue1)); - } + }, + null ), new EnemyEffect( this, @@ -107,7 +112,8 @@ public override void _Ready() ); SteamWhisperer.PopAchievement("tutorial"); } - } + }, + null ), }; } diff --git a/Scenes/Puppets/Enemies/TheGWS/P_TheGWS.cs b/Scenes/Puppets/Enemies/TheGWS/P_TheGWS.cs index b119fdbd..ee4830fd 100644 --- a/Scenes/Puppets/Enemies/TheGWS/P_TheGWS.cs +++ b/Scenes/Puppets/Enemies/TheGWS/P_TheGWS.cs @@ -54,7 +54,8 @@ public override void _Ready() eff.Owner ); eff.Value = 0; - } + }, + "GWS_EFFECT1" ), }; } diff --git a/Scenes/Puppets/Enemies/Turtle/P_Turtle.cs b/Scenes/Puppets/Enemies/Turtle/P_Turtle.cs index 70ebe332..e2c992bf 100644 --- a/Scenes/Puppets/Enemies/Turtle/P_Turtle.cs +++ b/Scenes/Puppets/Enemies/Turtle/P_Turtle.cs @@ -35,7 +35,8 @@ public override void _Ready() //gain block based on val e.BD.AddStatus(Targetting.First, StatusEffect.Block, val); - } + }, + "TURTLE_EFFECT1" ), }; } From 8026e742ed0eded323665a54938b96c180ed5e73 Mon Sep 17 00:00:00 2001 From: cornerloan Date: Wed, 18 Jun 2025 17:59:59 -0700 Subject: [PATCH 2/4] Finished except for temp icons I don't have it set up for every BattleEffectTrigger, so as we use more triggers we need to edit GetTriggerIcon() in EnemyDescriptions.cs --- Globals/Translations/Translations.csv | 1 - .../BattleDirector/Assets/BattleEndSymbol.png | Bin 0 -> 1035 bytes .../Assets/BattleEndSymbol.png.import | 34 +++++++++ .../Assets/BattleStartSymbol.png | Bin 0 -> 1056 bytes .../Assets/BattleStartSymbol.png.import | 34 +++++++++ .../Assets/DamageInstanceSymbol.png | Bin 0 -> 418 bytes .../Assets/DamageInstanceSymbol.png.import | 34 +++++++++ Scenes/BattleDirector/Assets/LoopSymbol.png | Bin 0 -> 1074 bytes .../Assets/LoopSymbol.png.import | 34 +++++++++ Scenes/BattleDirector/BattleScene.tscn | 16 ++--- Scenes/BattleDirector/EnemyDescriptions.tscn | 10 +-- .../BattleDirector/Scripts/BattleDirector.cs | 1 + .../Scripts/EnemyDescriptions.cs | 68 +++++++++++++----- Scenes/Puppets/Enemies/Effigy/P_Effigy.cs | 2 +- 14 files changed, 201 insertions(+), 33 deletions(-) create mode 100644 Scenes/BattleDirector/Assets/BattleEndSymbol.png create mode 100644 Scenes/BattleDirector/Assets/BattleEndSymbol.png.import create mode 100644 Scenes/BattleDirector/Assets/BattleStartSymbol.png create mode 100644 Scenes/BattleDirector/Assets/BattleStartSymbol.png.import create mode 100644 Scenes/BattleDirector/Assets/DamageInstanceSymbol.png create mode 100644 Scenes/BattleDirector/Assets/DamageInstanceSymbol.png.import create mode 100644 Scenes/BattleDirector/Assets/LoopSymbol.png create mode 100644 Scenes/BattleDirector/Assets/LoopSymbol.png.import diff --git a/Globals/Translations/Translations.csv b/Globals/Translations/Translations.csv index 98ccef4e..8ae4dddc 100644 --- a/Globals/Translations/Translations.csv +++ b/Globals/Translations/Translations.csv @@ -225,4 +225,3 @@ BOSSBLOOD_NOTE_DESCRIPTION,Blood heals based on timing,血液根据时机恢复 SPIDER_NOTE_DESCRIPTION,Player gets poisoned based on timing,玩家根据时机中毒 LWS_NOTE_DESCRIPTION,Deals damage plus half the number of loops,造成伤害并额外附加一半的循环次数 MUSHROOM_NOTE_DESCRIPTION,Player gets poisoned based on timing,玩家根据时机中毒 - diff --git a/Scenes/BattleDirector/Assets/BattleEndSymbol.png b/Scenes/BattleDirector/Assets/BattleEndSymbol.png new file mode 100644 index 0000000000000000000000000000000000000000..3d53cfe8e2943c3b5cfb42459cd45ff7bce72d6e GIT binary patch literal 1035 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=DjSL74G){)!Z!hW5;mh>{3jAFJg2T)o7U{G?R9irfOAY6b=y z`-+0Zwic-?7f?V97Du6s&rHqo20xNy} z^73-Ma$~*xqI7*jOG`_A10#JSBVC{h-Qvo;lEez#ykcdj0WPV<$wiq3C7Jno3Lpa$ zlk!VTY?Vq&GgGY664OkRQc_HHlM;&?lhyW@wd>!DAO0Ae5_~vRAT6t@W8SQD ziX9W1Yj~zTaJcDrX^E#~_Jsb&tvi?(FiNJJnRdpmbA#u;JtyZgL@vvp@^*DHtBc9R z(88j*r=-23*sY@l%1?b&V|z5^t;@}QLEH2_H3gf)x9RimdpxZ%qGh9Bkiu~WkM9Tn z<_OBvu%|rq-Pm-X?R&?A>kofQweUC8d{xWeqsj5eIL?Oo$lWVnv{<48=1qO;vhyAH zKaqy(N7)jjH_5(xy}GH0;r5n-Ki%`((htmTdU&94ZBBgKrQ-4p!Sfi`wa1;GxJ`s% z%3E!LXAiu8EXaxP-9KaI%$_|C~wND_#Eric4a5Wwk1>{zOJS>{)8dfpr^=kX zDszR6RJNof@D`{i$Ql!lvI6;>1s;*b3=DjSL74G){)!Z!hW5;mh>{3jAFJg2T)o7U{G?R9irfOAY6b=y z`-+0Zwic-?7f?V97Du6s&rHqo20xNy} z^73-Ma$~*xqI7*jOG`_A10#JSBVC{h-Qvo;lEez#ykcdj0WPV<$wiq3C7Jno3Lpa$ zlk!VTY?Vq&GgGY664OkRQc_HHlM;16p;7M!F`9@p6~(&ib(m_Zz2{r2_=95p4Enn*kC~pXWjhgbV%pmW zq0{e~EnS@v&ie4ok7L^!D;{S_UDxT&784TBXf|IL`DNd2;=eC%lNabQQUQhP4!;?r`+m;AeW#-ulfll33k*Zlc9d)k|pxT1-tmOf$3bGWng z@7!AxUzMvCI%Zt0i)}iinDgsf-M6w=Pft&nmh$MmhDfjJzJ2~GKd$YVW&A&A;w{e@ ziE!ab>Y)v%9M`nwNQ$#BQ>or#!KNy?C`wjqan!_H%kuXeQ8U{x^XK$aKYrc%@ylv% zc?Zwhf90(lD`QWbj(^;!>pnI5ePRJ;?`nC)J59eP-V(NHacukbrgj3)$4_s+8FgAW wOqMj*w~zhdw@qhx7wFw}5521HS0nw8>HH+62TR)Tvw*Uxr>mdKI;Vst04`dw^#A|> literal 0 HcmV?d00001 diff --git a/Scenes/BattleDirector/Assets/BattleStartSymbol.png.import b/Scenes/BattleDirector/Assets/BattleStartSymbol.png.import new file mode 100644 index 00000000..8bf06276 --- /dev/null +++ b/Scenes/BattleDirector/Assets/BattleStartSymbol.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c5r2idc5x21ro" +path="res://.godot/imported/BattleStartSymbol.png-a8cb230df43bb6721a2442dfafc1c8b6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Scenes/BattleDirector/Assets/BattleStartSymbol.png" +dest_files=["res://.godot/imported/BattleStartSymbol.png-a8cb230df43bb6721a2442dfafc1c8b6.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/BattleDirector/Assets/DamageInstanceSymbol.png b/Scenes/BattleDirector/Assets/DamageInstanceSymbol.png new file mode 100644 index 0000000000000000000000000000000000000000..8e2fbe4609fa8225dc0886ed5557f7b3a013afa9 GIT binary patch literal 418 zcmV;T0bTxyP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0XIoRK~z{r?N(6^ z!XOOw9`FaA!MphBC3X+vHN1xh*{7UA)6%Y`&SaY#iwQ4T0xv+{+R}13H2ede?s!T* zJS<-gy9-D@o~sK;E_TVs7k)1EECA-@kvpw9GdH$Z^OJ!FTkId0n zc?gC1a34EoGRPnvLi0|001UDiS(6PF90=P&z`&dF)5nYP+^}yJta2Ly;X}_c&UsSi z1BGb#ky(%!OClowO#tUYk-YH=pFX!L=%(x`ASbNlH-lVL34vYH&@dUgpv=MI>bDk9 zz>@lJ!4;1>9dtOTblCmuI;nbCj^!FIEyI9PfEeb`aH$^Ix2ywNSOK3+2fQ-sk>3UA zu4j{q1q^c%qB>w*0m$VSQkTao2mq8JPy({CTaj$~?XZ@BhK5>r161cgt~E#^VE_OC M07*qoM6N<$f_Dn2U;qFB literal 0 HcmV?d00001 diff --git a/Scenes/BattleDirector/Assets/DamageInstanceSymbol.png.import b/Scenes/BattleDirector/Assets/DamageInstanceSymbol.png.import new file mode 100644 index 00000000..a6a8bb92 --- /dev/null +++ b/Scenes/BattleDirector/Assets/DamageInstanceSymbol.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dosjbiqlrb3cr" +path="res://.godot/imported/DamageInstanceSymbol.png-9cd27c768e2ba03d6c47f5ac093aa1d8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Scenes/BattleDirector/Assets/DamageInstanceSymbol.png" +dest_files=["res://.godot/imported/DamageInstanceSymbol.png-9cd27c768e2ba03d6c47f5ac093aa1d8.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/BattleDirector/Assets/LoopSymbol.png b/Scenes/BattleDirector/Assets/LoopSymbol.png new file mode 100644 index 0000000000000000000000000000000000000000..7968557b9e4fc444a68861a32ff293c039499a61 GIT binary patch literal 1074 zcmV-21kL-2P)EX>4Tx04R}tkv&MmKpe$iQ?()$K?{mFWT>6&q9Tr^ibb$c+6t{Ym|XfHG-*gu zTpR`0f`cE6RR9%C|}6A ztZ?4qtX68Qbx;1nU_o2XaGmBD5?DkMDTt6!!v-p_5T#Wk#YCF+;~xG|$DbmXOs)+u za?GO&6_Voz|AXJ%n#HL}Hz^ngx?gPjV;l(V0?oQ@e;?a+^91le16NwxUu^)hpQP8@ zTKEVU*aj}H+nT%wT zL`sys=JD>{&ffk#)9UXBrZsZA%>mmh00006VoOIv0673W07ZVa$YTHi010qNS#tmY z3ljhU3ljkVnw%H_000McNliru=>`%P2{jhiK*0b20xwBKK~z}7?U%o6Q&AX(pOaPu z?cy)A6oOEd4ptB+p<2iw6uWftA5aumCvkOjR}mN2P7W>(-AhYEgceDRBa)fO8#lUx7O$G*tblmO7+K9dZ4n`a0@cSEthA;#?`_-X$f8 ziKaT!=c_oPzEXdv*Y?>vla#HHw-JR9Hi6r~OW=F%K9G?_9e9u>w!i^nKwv;%Kwv^;6z*F^TzdknYSd%EL(>;7ntLnUZyhr(_ zWA0rD>MZaq9&a0;fVG6P5jX)%cFZ+^1>ipL5V+9AnhTtX*1e5Y;9lDkUR75z`n#t3 zK04oCu@Y+*I$iOkx}1?jBgNWv!*Z+@(sUYE7u21oadOmC?D>W|r+$d*)h=Tv<{nQv z+$4!HU?k`` sfl3IWnTNn|2Et3g9IzfjFmEUP4N156 Descriptions = new List(); - [Export] private VBoxContainer DescriptionsContainer; + private const string _loopIconPath = "res://Scenes/BattleDirector/Assets/LoopSymbol.png"; + private const string _damageInstanceIconPath = + "res://Scenes/BattleDirector/Assets/DamageInstanceSymbol.png"; + private const string _battleStartIconPath = + "res://Scenes/BattleDirector/Assets/BattleStartSymbol.png"; + private const string _battleEndIconPath = + "res://Scenes/BattleDirector/Assets/BattleEndSymbol.png"; + + private bool _isVisible = false; + public void Setup(EnemyPuppet enemy) { if (enemy.InitialNote != (0, 0)) - Descriptions.Add(Scribe.NoteDictionary[enemy.InitialNote.NoteId].Description); + { + string desc = Scribe.NoteDictionary[enemy.InitialNote.NoteId].Description; + AddDescriptionRow(Scribe.NoteDictionary[enemy.InitialNote.NoteId].Texture, desc); + _isVisible = true; + } foreach (var effect in enemy.GetBattleEvents()) { if (effect.Description != null) - Descriptions.Add(effect.Description); + { + Texture2D icon = GetTriggerIcon(effect.GetTrigger()); + AddDescriptionRow(icon, effect.Description); + _isVisible = true; + } } - foreach (var description in Descriptions) - { - HBoxContainer hbox = new HBoxContainer(); + Visible = _isVisible; + } - Sprite2D icon = new Sprite2D(); - icon.Texture = Scribe.NoteDictionary[enemy.InitialNote.NoteId].Texture; + private void AddDescriptionRow(Texture2D iconTexture, string text) + { + HBoxContainer hbox = new HBoxContainer(); - Label desc = new Label(); - desc.Text = description; - desc.SizeFlagsHorizontal = Control.SizeFlags.ExpandFill; - desc.AutowrapMode = TextServer.AutowrapMode.WordSmart; + TextureRect icon = new TextureRect(); + icon.Texture = iconTexture; - hbox.AddChild(icon); - hbox.AddChild(desc); - DescriptionsContainer.AddChild(hbox); - } + Label desc = new Label(); + desc.Text = text; + desc.SizeFlagsHorizontal = Control.SizeFlags.ExpandFill; + desc.AutowrapMode = TextServer.AutowrapMode.WordSmart; + + hbox.AddChild(icon); + hbox.AddChild(desc); + DescriptionsContainer.AddChild(hbox); + } + + private Texture2D GetTriggerIcon(BattleEffectTrigger trigger) + { + //TODO: add more as we get more enemy effect triggers + return trigger switch + { + BattleEffectTrigger.OnLoop => GD.Load(_loopIconPath), + BattleEffectTrigger.OnDamageInstance => GD.Load(_damageInstanceIconPath), + BattleEffectTrigger.OnBattleStart => GD.Load(_battleStartIconPath), + BattleEffectTrigger.OnBattleEnd => GD.Load(_battleEndIconPath), + _ => null, + }; } } diff --git a/Scenes/Puppets/Enemies/Effigy/P_Effigy.cs b/Scenes/Puppets/Enemies/Effigy/P_Effigy.cs index 77975bcf..97df135c 100644 --- a/Scenes/Puppets/Enemies/Effigy/P_Effigy.cs +++ b/Scenes/Puppets/Enemies/Effigy/P_Effigy.cs @@ -40,7 +40,7 @@ public override void _Ready() { e.BD.DealDamage(Targetting.Player, e.BD.Player.GetCurrentHealth() - 1, null); }, - "EFFECT_EFFECT2" + "EFFIGY_EFFECT2" ), new EnemyEffect( this, From a899a7bb8d0bb36f6586ff3cb13c11c7abf9cd68 Mon Sep 17 00:00:00 2001 From: cornerloan Date: Thu, 19 Jun 2025 15:04:49 -0700 Subject: [PATCH 3/4] Updated temp arts --- .../BattleDirector/Assets/BattleEndSymbol.png | Bin 1035 -> 663 bytes .../Assets/BattleStartSymbol.png | Bin 1056 -> 688 bytes .../Assets/DamageInstanceSymbol.png | Bin 418 -> 700 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/Scenes/BattleDirector/Assets/BattleEndSymbol.png b/Scenes/BattleDirector/Assets/BattleEndSymbol.png index 3d53cfe8e2943c3b5cfb42459cd45ff7bce72d6e..b340c343719b80ec1372f060521c042297fe18a2 100644 GIT binary patch delta 198 zcmV;%06G7Q2$uzrNeaOL01m+cxRGn^u~U@+e*l?DL_t(oN9~re4S+BV1RqwQrDXq! zC~27isz+cFJ0dYc!dHPEan}Xl?{spIVjZVV&Po`T+5EnF;HjKg5$dv5PPB;ZqLrNF zB9g<_a*~R;4ZP$;MqFOJ<>VZ3JiH|*jOgX!Z6Y87A|L`HAOgN~9TV>e^@oIbMMybv zFadCgNXelEpkYK#4l4i+A~ZQl0#FfQ$pZk`0ko_b^51&aufNeaUN01m?e$8V@)u~U@+e*z6jL_t(oN9~p|a@#NvMgQ^&NC&tg zeFpIw7CW&^uSuyKL2;WiB%S4JkOxQ=vI@`%XZR@qNF+y*CE3Y1Gkg`f02jLp5PyN0 z_rPA?FT5!@wZ8=~`ON@8ggHnz9XyBE#m1Yw8QDy+@;bNaeXs8q!|_vOQ^QpdW@>_n zf1aAoA&8NKd<>T0K-o^xq)8cTkdNbqxC5X88Dz|s%sz>*NxrP;CI;e^?L^tWQnoKiDG`HLwl5F9#Krt0Nb>1{EMDOXTY0+;lOdNY+r`bb9b;)o&m0hUeA%X6abX%D-h=3 zOZcE{UyZ+*nVGo}Z}R36QN{Ko)8ImaK;i&VVc-)TzOUMjgAIzeWncAt_esk_XM@2+9wT zE^X1Rzh5E)fS}Pw*%e_E+pck^CrmmK=0sKj_?G4(b=EU8|0BNv_yG{^S-u8C00000 LNkvXXu0mjfIjaQ{ diff --git a/Scenes/BattleDirector/Assets/BattleStartSymbol.png b/Scenes/BattleDirector/Assets/BattleStartSymbol.png index 3dbfd020fe6cc4c122005d7e516315d251a0cc37..84a88910c36cf42747776e5ac64d578b1a3f60eb 100644 GIT binary patch delta 223 zcmV<503iRM2(Sf^NeaOL01m+cxRGn^u~U@+e*m&cL_t(oNA1%~3WGopMbVB+$$A2= zRd7AoN;0~kERg=yD+lq86v20dwv>PGVQ-$>>%;YX-4D-H{YLD#O%166NCjyIP&A|) zKv9rk0L?rfxvgFf{|Bhp7rs4b$P}7NH)# Zqc7EfWFoO2G@$?h002ovPDHLkV1n*_TK)h4 delta 594 zcmV-Y0d+bf7P1}L>kR}bDDo(A6vHdG}%Wnn%qzXuW+Ce0Z4x4Un)cg zj{xVvmRBHL{B9xs^zCDyE&y(VEq1|{e}Zs}H}8OOHa2|<;tt}oaW##v@A1C?LSEhg zs^V_bbNy6M9#GXS-2O#RgF6sxsd(YEHm+I3)N9+@#b-e4)axO-BLx8Cnk59=`=Tz4 zYnH@kxs;Xi!*^_!OLgkExy%BAE1Zb00n{hiv8f9iK7 zaY1O+eqDmhA#D2ge)e|i<;#$kWa95A6pb~$zE33h*0`E8|5B0KNn99L6Ot!YfXYFv zg=`rY2c{%@yf_9W8KPPpDx+GF+NN*3#3nYdnfaH>`1;!T`Z}F=hzza%cZCS4UC7H{ zJAjiJFuuMA;r6o44WKUF gM^)7)PJA2w0?(2n;G~D&1ONa407*qoM6N<$f?Hi9NdN!< diff --git a/Scenes/BattleDirector/Assets/DamageInstanceSymbol.png b/Scenes/BattleDirector/Assets/DamageInstanceSymbol.png index 8e2fbe4609fa8225dc0886ed5557f7b3a013afa9..506c22395784f942293ac3ddae996fc48e263b85 100644 GIT binary patch literal 700 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=Dh+L6~vJ#O${~4egmB5hW46K32*3xq68y`AMmI6}bgK)eHls47YguJQ{>uF6ifOi{PD zbs{}UK3djZt>nqvW6s4qD1-ZCERRDRmN*N_31y=g{ z<>lpi<;HsXMd|v6mX?v90`zGE;%B09k2gXakl<5wp<;IRwdJb`TMuUx6%m z$bfLw>YfYXG<;+u=y z81Ge=*L@0WaXY86;8OR6Q<85RVs>rbqql6@JH?>5jeQw)P4n(Nn(A%G_h;#xFoxca j&`;h;J+5szX4(}@Nljs*BF-y8DUiX_)z4*}Q$iB}k_Gps delta 354 zcmV-o0iFK51)>9xNq@rt01m?e$8V@)0003uNkliGoI%sluBFaon;VM>FIfUFK;PQZayT^n1D@`9NY$BXgYux}QuavK8SL(ehJc~a&Bg=qMZS&$e@A|n4y z0OvxHyzvU3KDR39rtB#oC#>Z+gIrSyfnC$kFd4d_%)#R7w-!*qlKOAK6^}X{bU3JV z*!}D}sd`wB3UAu4j{q1q^c%qB>w* z0m$VSQkTao2mq8JPy({CTaj$~?XZ@BhK5>r161cgt~E#^VE_OC07*qoM6N<$f_+b& AAOHXW From dd25bfc0c4cd30a74bd86a09d0181b1724538dff Mon Sep 17 00:00:00 2001 From: LifeHckr Date: Fri, 20 Jun 2025 19:23:54 -0700 Subject: [PATCH 4/4] Minor Refinements Removed Description on Note class to build translation key. Made description for enemy effect an optional parameter. Adjusted translations for accuracy. Removed effect description from Strawman to not compete screen space with arrow input guides. Better set up description box in controls. --- Classes/Notes/Note.cs | 6 +-- Globals/Scribe.cs | 18 +++---- Globals/Translations/Translations.csv | 36 +++++++------- .../BattleDirector/Assets/BattleEndSymbol.png | Bin 663 -> 131 bytes Scenes/BattleDirector/Assets/LoopSymbol.png | Bin 1074 -> 630 bytes Scenes/BattleDirector/BattleScene.tscn | 18 ++++--- Scenes/BattleDirector/EnemyDescriptions.tscn | 44 ++++++++++++++---- .../BattleDirector/Scripts/BattleDirector.cs | 2 +- .../Scripts/EnemyDescriptions.cs | 24 ++++++---- Scenes/BattleDirector/Tutorial/Toriel.cs | 2 + .../Puppets/Enemies/BossBlood/P_BossBlood.cs | 12 ++--- Scenes/Puppets/Enemies/Effigy/P_Effigy.cs | 6 +-- Scenes/Puppets/Enemies/EnemyEffect.cs | 2 +- .../Enemies/Holograeme/P_Holograeme.cs | 6 +-- Scenes/Puppets/Enemies/Keythulu/P_Keythulu.cs | 11 ++--- Scenes/Puppets/Enemies/Midriff/P_Midriff.cs | 3 +- Scenes/Puppets/Enemies/Mushroom/P_Mushroom.cs | 3 +- .../Puppets/Enemies/Parasifly/P_Parasifly.cs | 3 +- Scenes/Puppets/Enemies/Spider/P_Spider.cs | 3 +- Scenes/Puppets/Enemies/Strawman/P_Strawman.cs | 18 +++---- 20 files changed, 109 insertions(+), 108 deletions(-) diff --git a/Classes/Notes/Note.cs b/Classes/Notes/Note.cs index 4751118b..3dc196e3 100644 --- a/Classes/Notes/Note.cs +++ b/Classes/Notes/Note.cs @@ -18,8 +18,6 @@ public partial class Note : Resource, IDisplayable public const double TimingMax = 0.5d; //The max range for a note to be timed is its beat +/- this const public Texture2D Texture { get; set; } - public string Description; - public Note( int id, string name, @@ -27,8 +25,7 @@ public Note( int baseVal = 1, Action noteEffect = null, float costModifier = 1.0f, - Targetting targetType = Targetting.First, - string description = null + Targetting targetType = Targetting.First ) { Id = id; @@ -38,7 +35,6 @@ public Note( Texture = texture; CostModifier = costModifier; TargetType = targetType; - Description = description; } public void OnHit(BattleDirector BD, Timing timing) diff --git a/Globals/Scribe.cs b/Globals/Scribe.cs index 068cfd17..80f0a6d2 100644 --- a/Globals/Scribe.cs +++ b/Globals/Scribe.cs @@ -150,8 +150,7 @@ public partial class Scribe : Node if (timing == Timing.Perfect) dmg = 0; director.DealDamage(Targetting.Player, dmg, note.Owner); - }, - description: "GWS_NOTE_DESCRIPTION" + } ), new Note( 11, @@ -189,8 +188,7 @@ public partial class Scribe : Node { int amt = Math.Max((3 - (int)timing) * note.GetBaseVal(), 0); director.AddStatus(Targetting.All, StatusEffect.Block, amt); - }, - description: "PARASIFLY_NOTE_DESCRIPTION" + } ), new Note( 14, @@ -205,8 +203,7 @@ public partial class Scribe : Node note.Owner.Heal((3 - (int)timing)); }, default, - Targetting.Player, - "BOSSBLOOD_NOTE_DESCRIPTION" + Targetting.Player ), new Note( 15, @@ -219,8 +216,7 @@ public partial class Scribe : Node return; int amt = Math.Max((3 - (int)timing) * note.GetBaseVal(), 1); director.AddStatus(Targetting.Player, StatusEffect.Poison, amt); - }, - description: "SPIDER_NOTE_DESCRIPTION" + } ), new Note( 16, @@ -233,8 +229,7 @@ public partial class Scribe : Node if (timing == Timing.Perfect) dmg = 0; director.DealDamage(Targetting.Player, dmg, note.Owner); - }, - description: "LWS_NOTE_DESCRIPTION" + } ), new Note( 17, @@ -247,8 +242,7 @@ public partial class Scribe : Node return; int amt = Math.Max((3 - (int)timing) * note.GetBaseVal(), 1); director.AddStatus(Targetting.Player, StatusEffect.Poison, amt); - }, - description: "MUSHROOM_NOTE_DESCRIPTION" + } ), new Note( 18, diff --git a/Globals/Translations/Translations.csv b/Globals/Translations/Translations.csv index 8ae4dddc..58738268 100644 --- a/Globals/Translations/Translations.csv +++ b/Globals/Translations/Translations.csv @@ -207,21 +207,21 @@ CREDITS_ADDITIONAL_HELP,Additional Help,额外协助 CREDITS_OTHER_PLAYTESTERS,All our other playtesters,以及所有其他测试玩家 CREDITS_SPECIAL_THANKS,Special Thanks,特别鸣谢 CREDITS_THANKS_PLAYERS,And to you the player!,以及屏幕前的你! -BOSSBLOOD_EFFECT1,"Heal {0} and convert a basic note into a Blood note","每循环治疗 {0} 点生命,并将一个普通音符转化为血之音符" -CYBERFOX_EFFECT1,Gains one dodge,获得一次闪避 -EFFIGY_EFFECT1,Only takes 1 damage at a time,每次只受到1点伤害 -EFFIGY_EFFECT2,Sets player's health to 1 if defeated,被击败时将玩家的生命值设为1 -HOLOGRAEME_EFFECT1,Player only plays every other loop,玩家每隔一轮行动一次 -HOLOGRAEME_EFFECT2,Holograeme only has 1 health,Holograeme 只有1点生命值 -KEYTHULU_EFFECT1,"Keythulu will kill the player after {0} loops","Keythulu 会在 {0} 个循环后杀死玩家" -LWS_EFFECT1,Converts a basic note into a Lesser Wolf Spirit note,将一个普通音符转化为小狼灵音符 -PARASIFLY_EFFECT1,Parasifly gains block the first time fatal damage is dealt,Parasifly 在首次受到致命伤害时获得格挡 -STRAWMAN_EFFECT1,Player cannot take fatal damage,玩家不会受到致命伤害 -GWS_EFFECT1,Adds Greater Wolf Spirit notes after the first loop,第一轮后添加大狼灵音符 -TURTLE_EFFECT1,Gains one block and removes some of player's charge,获得一层格挡并移除玩家的一些能量 -GWS_NOTE_DESCRIPTION,"Deals double damage plus the number of loops","造成双倍双倍伤害,并附加当前循环数值" -PARASIFLY_NOTE_DESCRIPTION,Parasifly gains block based on timing,Parasifly 根据时机获得格挡 -BOSSBLOOD_NOTE_DESCRIPTION,Blood heals based on timing,血液根据时机恢复生命 -SPIDER_NOTE_DESCRIPTION,Player gets poisoned based on timing,玩家根据时机中毒 -LWS_NOTE_DESCRIPTION,Deals damage plus half the number of loops,造成伤害并额外附加一半的循环次数 -MUSHROOM_NOTE_DESCRIPTION,Player gets poisoned based on timing,玩家根据时机中毒 +BOSSBLOOD_EFFECT1,"Heal and convert a basic note into a Blood note.","每循环治疗 点生命,并将一个普通音符转化为血之音符。" +CYBERFOX_EFFECT1,Gains one dodge.,获得一次闪避。 +EFFIGY_EFFECT1,Only takes 1 damage at a time.,每次只受到1点伤害。 +EFFIGY_EFFECT2,Sets player's health to 1 if defeated.,被击败时将玩家的生命值设为1。 +HOLOGRAEME_EFFECT1,Player only plays every other loop.,玩家每隔一轮行动一次。 +HOLOGRAEME_EFFECT2,"Holograeme only has 1 health, and is immune to relic damage.","全息格莱姆仅有1点生命值,且免疫遗物伤害。" +KEYTHULU_EFFECT1,"Every loop mindcrush ticks down by one, when it reaches zero, the player is defeated.","每次循环,心灵碾压计数会减1。当计数归零时,玩家即被击败。" +LWS_EFFECT1,Converts an empty note into a Lesser Wolf Snake note.,将一个基础音符转化为次级狼蛇音符。 +PARASIFLY_EFFECT1,All enemies gains block the first time fatal damage is dealt.,首次受到致命伤害时,所有敌人获得格挡。 +STRAWMAN_EFFECT1,Player cannot take fatal damage.,玩家不会受到致命伤害。 +GWS_EFFECT1,Adds Greater Wolf Snake notes after the first loop.,首次循环后,添加高级狼蛇音符。 +TURTLE_EFFECT1,Gains one block and drains some of player's charge to heal.,获得一层格挡,并消耗玩家部分充能以进行治疗。 +GWS_NOTE_DESCRIPTION,"If timed badly, deals high damage to the player. Damage increases each loop.","若时机不佳,则对玩家造成高额伤害,且伤害随每次循环递增。" +PARASIFLY_NOTE_DESCRIPTION,Parasifly gains block if timed badly.,若时机不佳,寄生蝇获得格挡。 +BOSSBLOOD_NOTE_DESCRIPTION,Boss Blood heals if timed badly.,若时机不佳,首领之血会进行治疗。 +SPIDER_NOTE_DESCRIPTION,Player gets poisoned if timed badly.,若时机不佳,玩家会中毒。 +LWS_NOTE_DESCRIPTION,"If timed badly, deals damage to the player. Damage increases each loop.","若时机不佳,则对玩家造成伤害,且伤害随每次循环递增。" +MUSHROOM_NOTE_DESCRIPTION,Player gets poisoned if timed badly.,若时机不佳,玩家会中毒。 \ No newline at end of file diff --git a/Scenes/BattleDirector/Assets/BattleEndSymbol.png b/Scenes/BattleDirector/Assets/BattleEndSymbol.png index b340c343719b80ec1372f060521c042297fe18a2..a4beda98b042254ffe1d58671f8da8dc9812828f 100644 GIT binary patch delta 89 zcmbQv+RQk?Fv!-^#W5tJ_3gQZq6`8Iu7PV7bbXue5pwnblZbn9{NIQ71(w|JUY0O?pPuw(fPqP3`_fo69-H)@28npO`njxgN@xNAV6Y;M literal 663 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=Dh+L6~vJ#O${~4egmB5hW46K32*3xq68y`AMmI6}bgK)eHls47YguJQ{>uF6ifOi{PD zbs{}UK3djZt>nqvW6s4qD1-ZCERRDRmN*N_31y=g{ z<>lpi<;HsXMd|v6mX?v90`zGE;%B09k2gXakl<5wp<;IRwdJb`TMuUx6%m z$bf*_a#LWl4O_rp7WBJcJt4^$_FdwL`%P2{jhiK*0b20xwBKK~z}7?U%o6Q&AX(pOaPu?cy)A6oOEd4ptB+ zp<2iw6uWftA5aumCvkOjR}mN2P7W>(-AhYEgF|BY=C)7oI zLrblj4U4f>=)8YKSJX-$Nw(wuW=0Z~ShEn+8^8;o^JuRVT*(&FM=DdyfKC5efqI@9N?IHJB% zf2h~?**lYzt&q17g%CD@+rUfUd+t7vkwhJMkR`Uj0b_qaU_f9%U_hWR0_tV;(VuVm z0i3{CY`IU=L;s3^d+cul$AG)QQ}t-SJ~r)GlPIgxJ$z29>b!cqNBO2>?p+A#EbuHI zZyTS0wS=<~H~~y{%r$@o;6CsWxX{I#3!I78y^U4iUfUC1RaY|lyQca+I^SNg5^EMZ zUGb#4oRNP-BgNWv!*Z+@(sUYE7u21oadOmC?D>W|r+$d*)h=Tv<{nQv+$4!HU?k``fl3IWnTNn| l2Et3g9IzfjFmEUP4N156 0) { - string desc = Scribe.NoteDictionary[enemy.InitialNote.NoteId].Description; + string desc = NoteDescBuilder(Scribe.NoteDictionary[enemy.InitialNote.NoteId].Name); AddDescriptionRow(Scribe.NoteDictionary[enemy.InitialNote.NoteId].Texture, desc); _isVisible = true; } foreach (var effect in enemy.GetBattleEvents()) { - if (effect.Description != null) - { - Texture2D icon = GetTriggerIcon(effect.GetTrigger()); - AddDescriptionRow(icon, effect.Description); - _isVisible = true; - } + if (effect.Description == null) + continue; + Texture2D icon = GetTriggerIcon(effect.GetTrigger()); + AddDescriptionRow(icon, effect.Description); + _isVisible = true; } Visible = _isVisible; @@ -46,10 +46,11 @@ private void AddDescriptionRow(Texture2D iconTexture, string text) TextureRect icon = new TextureRect(); icon.Texture = iconTexture; + icon.StretchMode = TextureRect.StretchModeEnum.Keep; Label desc = new Label(); desc.Text = text; - desc.SizeFlagsHorizontal = Control.SizeFlags.ExpandFill; + desc.SizeFlagsHorizontal = SizeFlags.ExpandFill; desc.AutowrapMode = TextServer.AutowrapMode.WordSmart; hbox.AddChild(icon); @@ -57,6 +58,11 @@ private void AddDescriptionRow(Texture2D iconTexture, string text) DescriptionsContainer.AddChild(hbox); } + private string NoteDescBuilder(string noteName) + { + return noteName.ToUpper() + TranslationKeySuffix; + } + private Texture2D GetTriggerIcon(BattleEffectTrigger trigger) { //TODO: add more as we get more enemy effect triggers diff --git a/Scenes/BattleDirector/Tutorial/Toriel.cs b/Scenes/BattleDirector/Tutorial/Toriel.cs index d175c80a..bc4ed1ce 100644 --- a/Scenes/BattleDirector/Tutorial/Toriel.cs +++ b/Scenes/BattleDirector/Tutorial/Toriel.cs @@ -341,6 +341,7 @@ public void OnPlaceDialogue4() public void BossDialogue() { _dialogueBox.Visible = true; + _currentDirector.Descriptions.Visible = false; GetTree().SetPause(true); _currentDirector.FocusedButton.Visible = false; _dialogueLabel.Text = Tr("TUTORIAL_BOSS"); @@ -355,6 +356,7 @@ public void BossDialogueReady() GetTree().SetPause(false); _currentDirector.FocusedButton.Visible = true; _currentDirector.FocusedButton.GrabFocus(); + _currentDirector.Descriptions.Visible = true; } #endregion } diff --git a/Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs b/Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs index 3ede883e..0fc7033e 100644 --- a/Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs +++ b/Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs @@ -21,23 +21,18 @@ public override void _Ready() enemTween.SetLoops(); enemTween.Play(); - const int effect1Val = 30; - BattleEvents = new EnemyEffect[] { new EnemyEffect( this, BattleEffectTrigger.OnLoop, - effect1Val, + 30, (e, eff, val) => { eff.Owner.Heal(val); e.BD.RandApplyNote(eff.Owner, 14, 1); }, - string.Format( - TranslationServer.Translate("BOSSBLOOD_EFFECT1"), - effect1Val.ToString() - ) + "BOSSBLOOD_EFFECT1" ), new EnemyEffect( this, @@ -54,8 +49,7 @@ public override void _Ready() { SteamWhisperer.PopAchievement("actOneComp"); } - }, - null + } ), }; } diff --git a/Scenes/Puppets/Enemies/Effigy/P_Effigy.cs b/Scenes/Puppets/Enemies/Effigy/P_Effigy.cs index 97df135c..1944bae1 100644 --- a/Scenes/Puppets/Enemies/Effigy/P_Effigy.cs +++ b/Scenes/Puppets/Enemies/Effigy/P_Effigy.cs @@ -50,8 +50,7 @@ public override void _Ready() { _tutorialInstance = Toriel.AttachNewToriel(e.BD); _tutorialInstance.BossDialogue(); - }, - null + } ), new EnemyEffect( this, @@ -70,8 +69,7 @@ public override void _Ready() _tutorialInstance.FromBoss = true; _tutorialInstance.OnPlaceDialogue3(); } - }, - null + } ), }; } diff --git a/Scenes/Puppets/Enemies/EnemyEffect.cs b/Scenes/Puppets/Enemies/EnemyEffect.cs index 7b8a866a..6bd8724f 100644 --- a/Scenes/Puppets/Enemies/EnemyEffect.cs +++ b/Scenes/Puppets/Enemies/EnemyEffect.cs @@ -15,7 +15,7 @@ public EnemyEffect( BattleEffectTrigger trigger, int val, Action onEnemyEffect, - string description + string description = null ) { Owner = owner; diff --git a/Scenes/Puppets/Enemies/Holograeme/P_Holograeme.cs b/Scenes/Puppets/Enemies/Holograeme/P_Holograeme.cs index 98c8fccc..988b630c 100644 --- a/Scenes/Puppets/Enemies/Holograeme/P_Holograeme.cs +++ b/Scenes/Puppets/Enemies/Holograeme/P_Holograeme.cs @@ -70,8 +70,7 @@ public override void _Ready() BattleDirector.AutoPlay = false; Scribe.NoteDictionary[0].Texture = GD.Load(NoteCoverPath); } - }, - null + } ), new EnemyEffect( this, @@ -83,8 +82,7 @@ public override void _Ready() { TweenDir(nArgs.Type); } - }, - null + } ), new EnemyEffect( this, diff --git a/Scenes/Puppets/Enemies/Keythulu/P_Keythulu.cs b/Scenes/Puppets/Enemies/Keythulu/P_Keythulu.cs index c76a8dc4..b22e5c0e 100644 --- a/Scenes/Puppets/Enemies/Keythulu/P_Keythulu.cs +++ b/Scenes/Puppets/Enemies/Keythulu/P_Keythulu.cs @@ -39,10 +39,7 @@ public override void _Ready() { e.BD.AddStatus(Targetting.Player, StatusEffect.MindCrush, val); }, - string.Format( - TranslationServer.Translate("KEYTHULU_EFFECT1"), - effect1Val.ToString() - ) + "KEYTHULU_EFFECT1" ), new EnemyEffect( this, @@ -63,8 +60,7 @@ public override void _Ready() _effectSprite.Visible = false; }) ); - }, - null + } ), new EnemyEffect( this, @@ -85,8 +81,7 @@ public override void _Ready() SteamWhisperer.PopAchievement("actTwoComp"); StageProducer.UpdatePersistantValues(StageProducer.PersistKeys.HasWon, 1); } - }, - null + } ), }; } diff --git a/Scenes/Puppets/Enemies/Midriff/P_Midriff.cs b/Scenes/Puppets/Enemies/Midriff/P_Midriff.cs index eff77845..7ec69dce 100644 --- a/Scenes/Puppets/Enemies/Midriff/P_Midriff.cs +++ b/Scenes/Puppets/Enemies/Midriff/P_Midriff.cs @@ -33,8 +33,7 @@ public override void _Ready() MaxHealth += val; CurrentHealth = MaxHealth; BaseMoney += val / 10; - }, - null + } ), }; } diff --git a/Scenes/Puppets/Enemies/Mushroom/P_Mushroom.cs b/Scenes/Puppets/Enemies/Mushroom/P_Mushroom.cs index 56c7b408..4ad1ce8c 100644 --- a/Scenes/Puppets/Enemies/Mushroom/P_Mushroom.cs +++ b/Scenes/Puppets/Enemies/Mushroom/P_Mushroom.cs @@ -23,8 +23,7 @@ public override void _Ready() (e, eff, _) => { e.BD.RandApplyNote(eff.Owner, 17, 1); - }, - null + } ), }; } diff --git a/Scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs b/Scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs index a711b8ee..e3d42576 100644 --- a/Scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs +++ b/Scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs @@ -30,8 +30,7 @@ public override void _Ready() (e, eff, _) => { e.BD.RandApplyNote(eff.Owner, 13, 1); - }, - null + } ), new EnemyEffect( this, diff --git a/Scenes/Puppets/Enemies/Spider/P_Spider.cs b/Scenes/Puppets/Enemies/Spider/P_Spider.cs index d4c70e17..9febd0bd 100644 --- a/Scenes/Puppets/Enemies/Spider/P_Spider.cs +++ b/Scenes/Puppets/Enemies/Spider/P_Spider.cs @@ -23,8 +23,7 @@ public override void _Ready() (e, eff, _) => { e.BD.RandApplyNote(eff.Owner, 15, 1); - }, - null + } ), }; } diff --git a/Scenes/Puppets/Enemies/Strawman/P_Strawman.cs b/Scenes/Puppets/Enemies/Strawman/P_Strawman.cs index 146b376e..7e58022e 100644 --- a/Scenes/Puppets/Enemies/Strawman/P_Strawman.cs +++ b/Scenes/Puppets/Enemies/Strawman/P_Strawman.cs @@ -26,8 +26,7 @@ public override void _Ready() { _tutorialInstance = Toriel.AttachNewToriel(e.BD); _tutorialInstance.IntroDialogue(); - }, - null + } ), new EnemyEffect( this, @@ -48,8 +47,7 @@ public override void _Ready() _tutorialInstance.NoDying(); eff.Value--; } - }, - "STRAWMAN_EFFECT1" + } ), new EnemyEffect( this, @@ -63,8 +61,7 @@ public override void _Ready() { _tutorialInstance.LoopDialogue(); } - }, - null + } ), new EnemyEffect( this, @@ -80,8 +77,7 @@ public override void _Ready() return; eff.Value = 0; _tutorialInstance.PlaceDialogue1(); - }, - null + } ), new EnemyEffect( this, @@ -90,8 +86,7 @@ public override void _Ready() (_, _, _) => { _tutorialInstance.CallDeferred(nameof(_tutorialInstance.OnPlaceDialogue1)); - }, - null + } ), new EnemyEffect( this, @@ -112,8 +107,7 @@ public override void _Ready() ); SteamWhisperer.PopAchievement("tutorial"); } - }, - null + } ), }; }