Skip to content

Commit dd25bfc

Browse files
committed
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.
1 parent a899a7b commit dd25bfc

20 files changed

Lines changed: 109 additions & 108 deletions

File tree

Classes/Notes/Note.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@ public partial class Note : Resource, IDisplayable
1818
public const double TimingMax = 0.5d; //The max range for a note to be timed is its beat +/- this const
1919
public Texture2D Texture { get; set; }
2020

21-
public string Description;
22-
2321
public Note(
2422
int id,
2523
string name,
2624
Texture2D texture = null,
2725
int baseVal = 1,
2826
Action<BattleDirector, Note, Timing> noteEffect = null,
2927
float costModifier = 1.0f,
30-
Targetting targetType = Targetting.First,
31-
string description = null
28+
Targetting targetType = Targetting.First
3229
)
3330
{
3431
Id = id;
@@ -38,7 +35,6 @@ public Note(
3835
Texture = texture;
3936
CostModifier = costModifier;
4037
TargetType = targetType;
41-
Description = description;
4238
}
4339

4440
public void OnHit(BattleDirector BD, Timing timing)

Globals/Scribe.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ public partial class Scribe : Node
150150
if (timing == Timing.Perfect)
151151
dmg = 0;
152152
director.DealDamage(Targetting.Player, dmg, note.Owner);
153-
},
154-
description: "GWS_NOTE_DESCRIPTION"
153+
}
155154
),
156155
new Note(
157156
11,
@@ -189,8 +188,7 @@ public partial class Scribe : Node
189188
{
190189
int amt = Math.Max((3 - (int)timing) * note.GetBaseVal(), 0);
191190
director.AddStatus(Targetting.All, StatusEffect.Block, amt);
192-
},
193-
description: "PARASIFLY_NOTE_DESCRIPTION"
191+
}
194192
),
195193
new Note(
196194
14,
@@ -205,8 +203,7 @@ public partial class Scribe : Node
205203
note.Owner.Heal((3 - (int)timing));
206204
},
207205
default,
208-
Targetting.Player,
209-
"BOSSBLOOD_NOTE_DESCRIPTION"
206+
Targetting.Player
210207
),
211208
new Note(
212209
15,
@@ -219,8 +216,7 @@ public partial class Scribe : Node
219216
return;
220217
int amt = Math.Max((3 - (int)timing) * note.GetBaseVal(), 1);
221218
director.AddStatus(Targetting.Player, StatusEffect.Poison, amt);
222-
},
223-
description: "SPIDER_NOTE_DESCRIPTION"
219+
}
224220
),
225221
new Note(
226222
16,
@@ -233,8 +229,7 @@ public partial class Scribe : Node
233229
if (timing == Timing.Perfect)
234230
dmg = 0;
235231
director.DealDamage(Targetting.Player, dmg, note.Owner);
236-
},
237-
description: "LWS_NOTE_DESCRIPTION"
232+
}
238233
),
239234
new Note(
240235
17,
@@ -247,8 +242,7 @@ public partial class Scribe : Node
247242
return;
248243
int amt = Math.Max((3 - (int)timing) * note.GetBaseVal(), 1);
249244
director.AddStatus(Targetting.Player, StatusEffect.Poison, amt);
250-
},
251-
description: "MUSHROOM_NOTE_DESCRIPTION"
245+
}
252246
),
253247
new Note(
254248
18,

Globals/Translations/Translations.csv

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -207,21 +207,21 @@ CREDITS_ADDITIONAL_HELP,Additional Help,额外协助
207207
CREDITS_OTHER_PLAYTESTERS,All our other playtesters,以及所有其他测试玩家
208208
CREDITS_SPECIAL_THANKS,Special Thanks,特别鸣谢
209209
CREDITS_THANKS_PLAYERS,And to you the player!,以及屏幕前的你!
210-
BOSSBLOOD_EFFECT1,"Heal {0} and convert a basic note into a Blood note","每循环治疗 {0} 点生命,并将一个普通音符转化为血之音符"
211-
CYBERFOX_EFFECT1,Gains one dodge,获得一次闪避
212-
EFFIGY_EFFECT1,Only takes 1 damage at a time,每次只受到1点伤害
213-
EFFIGY_EFFECT2,Sets player's health to 1 if defeated,被击败时将玩家的生命值设为1
214-
HOLOGRAEME_EFFECT1,Player only plays every other loop,玩家每隔一轮行动一次
215-
HOLOGRAEME_EFFECT2,Holograeme only has 1 health,Holograeme 只有1点生命值
216-
KEYTHULU_EFFECT1,"Keythulu will kill the player after {0} loops","Keythulu 会在 {0} 个循环后杀死玩家"
217-
LWS_EFFECT1,Converts a basic note into a Lesser Wolf Spirit note,将一个普通音符转化为小狼灵音符
218-
PARASIFLY_EFFECT1,Parasifly gains block the first time fatal damage is dealt,Parasifly 在首次受到致命伤害时获得格挡
219-
STRAWMAN_EFFECT1,Player cannot take fatal damage,玩家不会受到致命伤害
220-
GWS_EFFECT1,Adds Greater Wolf Spirit notes after the first loop,第一轮后添加大狼灵音符
221-
TURTLE_EFFECT1,Gains one block and removes some of player's charge,获得一层格挡并移除玩家的一些能量
222-
GWS_NOTE_DESCRIPTION,"Deals double damage plus the number of loops","造成双倍双倍伤害,并附加当前循环数值"
223-
PARASIFLY_NOTE_DESCRIPTION,Parasifly gains block based on timing,Parasifly 根据时机获得格挡
224-
BOSSBLOOD_NOTE_DESCRIPTION,Blood heals based on timing,血液根据时机恢复生命
225-
SPIDER_NOTE_DESCRIPTION,Player gets poisoned based on timing,玩家根据时机中毒
226-
LWS_NOTE_DESCRIPTION,Deals damage plus half the number of loops,造成伤害并额外附加一半的循环次数
227-
MUSHROOM_NOTE_DESCRIPTION,Player gets poisoned based on timing,玩家根据时机中毒
210+
BOSSBLOOD_EFFECT1,"Heal and convert a basic note into a Blood note.","每循环治疗 点生命,并将一个普通音符转化为血之音符"
211+
CYBERFOX_EFFECT1,Gains one dodge.,获得一次闪避
212+
EFFIGY_EFFECT1,Only takes 1 damage at a time.,每次只受到1点伤害
213+
EFFIGY_EFFECT2,Sets player's health to 1 if defeated.,被击败时将玩家的生命值设为1
214+
HOLOGRAEME_EFFECT1,Player only plays every other loop.,玩家每隔一轮行动一次
215+
HOLOGRAEME_EFFECT2,"Holograeme only has 1 health, and is immune to relic damage.","全息格莱姆仅有1点生命值,且免疫遗物伤害。"
216+
KEYTHULU_EFFECT1,"Every loop mindcrush ticks down by one, when it reaches zero, the player is defeated.","每次循环,心灵碾压计数会减1。当计数归零时,玩家即被击败。"
217+
LWS_EFFECT1,Converts an empty note into a Lesser Wolf Snake note.,将一个基础音符转化为次级狼蛇音符。
218+
PARASIFLY_EFFECT1,All enemies gains block the first time fatal damage is dealt.,首次受到致命伤害时,所有敌人获得格挡。
219+
STRAWMAN_EFFECT1,Player cannot take fatal damage.,玩家不会受到致命伤害
220+
GWS_EFFECT1,Adds Greater Wolf Snake notes after the first loop.,首次循环后,添加高级狼蛇音符。
221+
TURTLE_EFFECT1,Gains one block and drains some of player's charge to heal.,获得一层格挡,并消耗玩家部分充能以进行治疗。
222+
GWS_NOTE_DESCRIPTION,"If timed badly, deals high damage to the player. Damage increases each loop.","若时机不佳,则对玩家造成高额伤害,且伤害随每次循环递增。"
223+
PARASIFLY_NOTE_DESCRIPTION,Parasifly gains block if timed badly.,若时机不佳,寄生蝇获得格挡。
224+
BOSSBLOOD_NOTE_DESCRIPTION,Boss Blood heals if timed badly.,若时机不佳,首领之血会进行治疗。
225+
SPIDER_NOTE_DESCRIPTION,Player gets poisoned if timed badly.,若时机不佳,玩家会中毒。
226+
LWS_NOTE_DESCRIPTION,"If timed badly, deals damage to the player. Damage increases each loop.","若时机不佳,则对玩家造成伤害,且伤害随每次循环递增。"
227+
MUSHROOM_NOTE_DESCRIPTION,Player gets poisoned if timed badly.,若时机不佳,玩家会中毒。
-532 Bytes
Loading
-444 Bytes
Loading

Scenes/BattleDirector/BattleScene.tscn

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ offset_bottom = 360.0
102102
texture = ExtResource("7_klvil")
103103

104104
[node name="StartButton" type="Button" parent="."]
105-
offset_left = 185.0
105+
offset_left = 190.0
106106
offset_top = 200.0
107-
offset_right = 445.0
107+
offset_right = 450.0
108108
offset_bottom = 248.0
109109
theme = ExtResource("8_62qim")
110110
text = "BATTLE_ROOM_BEGIN_BUTTON"
@@ -146,8 +146,12 @@ theme_override_font_sizes/font_size = 64
146146
text = "5"
147147

148148
[node name="EnemyDescriptions" parent="." instance=ExtResource("11_gbbxr")]
149-
z_index = 1
150-
offset_left = 170.0
151-
offset_top = 248.0
152-
offset_right = 170.0
153-
offset_bottom = 248.0
149+
anchors_preset = 0
150+
anchor_right = 0.0
151+
anchor_bottom = 0.0
152+
offset_left = 320.0
153+
offset_top = 183.0
154+
offset_right = 320.0
155+
offset_bottom = 183.0
156+
grow_horizontal = 1
157+
grow_vertical = 1

Scenes/BattleDirector/EnemyDescriptions.tscn

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,41 @@ anchor_right = 1.0
1010
anchor_bottom = 1.0
1111
grow_horizontal = 2
1212
grow_vertical = 2
13+
mouse_filter = 2
1314
script = ExtResource("1_r3tcc")
14-
DescriptionsContainer = NodePath("VBoxContainer")
15+
DescriptionsContainer = NodePath("Center/MarginContainer/MarginContainer/VBoxContainer")
1516

16-
[node name="UiCenterFrame" type="Sprite2D" parent="."]
17-
scale = Vector2(3.02083, 1.88462)
17+
[node name="Center" type="CenterContainer" parent="."]
18+
layout_mode = 1
19+
anchors_preset = 15
20+
anchor_right = 1.0
21+
anchor_bottom = 1.0
22+
grow_horizontal = 2
23+
grow_vertical = 2
24+
mouse_filter = 2
25+
26+
[node name="MarginContainer" type="MarginContainer" parent="Center"]
27+
layout_mode = 2
28+
mouse_filter = 2
29+
theme_override_constants/margin_top = 230
30+
31+
[node name="UiCenterFrame" type="NinePatchRect" parent="Center/MarginContainer"]
32+
custom_minimum_size = Vector2(280, 80)
33+
layout_mode = 2
1834
texture = ExtResource("2_mg2uj")
19-
centered = false
35+
patch_margin_left = 12
36+
patch_margin_top = 12
37+
patch_margin_right = 12
38+
patch_margin_bottom = 12
39+
40+
[node name="MarginContainer" type="MarginContainer" parent="Center/MarginContainer"]
41+
layout_mode = 2
42+
mouse_filter = 2
43+
theme_override_constants/margin_left = 8
44+
theme_override_constants/margin_top = 6
45+
theme_override_constants/margin_right = 8
46+
theme_override_constants/margin_bottom = 6
2047

21-
[node name="VBoxContainer" type="VBoxContainer" parent="."]
22-
layout_mode = 0
23-
offset_left = 15.0
24-
offset_top = 6.0
25-
offset_right = 275.0
26-
offset_bottom = 91.0
48+
[node name="VBoxContainer" type="VBoxContainer" parent="Center/MarginContainer/MarginContainer"]
49+
layout_mode = 2
50+
mouse_filter = 2

Scenes/BattleDirector/Scripts/BattleDirector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public partial class BattleDirector : Node2D
3535
private AudioStreamPlayer Audio;
3636

3737
[Export]
38-
private EnemyDescriptions Descriptions;
38+
public EnemyDescriptions Descriptions;
3939

4040
[Export]
4141
public Button FocusedButton; //Initial start button

Scenes/BattleDirector/Scripts/EnemyDescriptions.cs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ public partial class EnemyDescriptions : Control
1717
"res://Scenes/BattleDirector/Assets/BattleEndSymbol.png";
1818

1919
private bool _isVisible = false;
20+
private const string TranslationKeySuffix = "_NOTE_DESCRIPTION";
2021

2122
public void Setup(EnemyPuppet enemy)
2223
{
23-
if (enemy.InitialNote != (0, 0))
24+
if (enemy.InitialNote.Amount > 0)
2425
{
25-
string desc = Scribe.NoteDictionary[enemy.InitialNote.NoteId].Description;
26+
string desc = NoteDescBuilder(Scribe.NoteDictionary[enemy.InitialNote.NoteId].Name);
2627
AddDescriptionRow(Scribe.NoteDictionary[enemy.InitialNote.NoteId].Texture, desc);
2728
_isVisible = true;
2829
}
2930

3031
foreach (var effect in enemy.GetBattleEvents())
3132
{
32-
if (effect.Description != null)
33-
{
34-
Texture2D icon = GetTriggerIcon(effect.GetTrigger());
35-
AddDescriptionRow(icon, effect.Description);
36-
_isVisible = true;
37-
}
33+
if (effect.Description == null)
34+
continue;
35+
Texture2D icon = GetTriggerIcon(effect.GetTrigger());
36+
AddDescriptionRow(icon, effect.Description);
37+
_isVisible = true;
3838
}
3939

4040
Visible = _isVisible;
@@ -46,17 +46,23 @@ private void AddDescriptionRow(Texture2D iconTexture, string text)
4646

4747
TextureRect icon = new TextureRect();
4848
icon.Texture = iconTexture;
49+
icon.StretchMode = TextureRect.StretchModeEnum.Keep;
4950

5051
Label desc = new Label();
5152
desc.Text = text;
52-
desc.SizeFlagsHorizontal = Control.SizeFlags.ExpandFill;
53+
desc.SizeFlagsHorizontal = SizeFlags.ExpandFill;
5354
desc.AutowrapMode = TextServer.AutowrapMode.WordSmart;
5455

5556
hbox.AddChild(icon);
5657
hbox.AddChild(desc);
5758
DescriptionsContainer.AddChild(hbox);
5859
}
5960

61+
private string NoteDescBuilder(string noteName)
62+
{
63+
return noteName.ToUpper() + TranslationKeySuffix;
64+
}
65+
6066
private Texture2D GetTriggerIcon(BattleEffectTrigger trigger)
6167
{
6268
//TODO: add more as we get more enemy effect triggers

Scenes/BattleDirector/Tutorial/Toriel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ public void OnPlaceDialogue4()
341341
public void BossDialogue()
342342
{
343343
_dialogueBox.Visible = true;
344+
_currentDirector.Descriptions.Visible = false;
344345
GetTree().SetPause(true);
345346
_currentDirector.FocusedButton.Visible = false;
346347
_dialogueLabel.Text = Tr("TUTORIAL_BOSS");
@@ -355,6 +356,7 @@ public void BossDialogueReady()
355356
GetTree().SetPause(false);
356357
_currentDirector.FocusedButton.Visible = true;
357358
_currentDirector.FocusedButton.GrabFocus();
359+
_currentDirector.Descriptions.Visible = true;
358360
}
359361
#endregion
360362
}

0 commit comments

Comments
 (0)