Skip to content

Commit af636c7

Browse files
cornerloanLifeHckr
authored andcommitted
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.
1 parent 046b9ff commit af636c7

22 files changed

Lines changed: 191 additions & 41 deletions

File tree

Classes/Notes/Note.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@ 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+
2123
public Note(
2224
int id,
2325
string name,
2426
Texture2D texture = null,
2527
int baseVal = 1,
2628
Action<BattleDirector, Note, Timing> noteEffect = null,
2729
float costModifier = 1.0f,
28-
Targetting targetType = Targetting.First
30+
Targetting targetType = Targetting.First,
31+
string description = null
2932
)
3033
{
3134
Id = id;
@@ -35,6 +38,7 @@ public Note(
3538
Texture = texture;
3639
CostModifier = costModifier;
3740
TargetType = targetType;
41+
Description = description;
3842
}
3943

4044
public void OnHit(BattleDirector BD, Timing timing)

Globals/Scribe.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ public partial class Scribe : Node
150150
if (timing == Timing.Perfect)
151151
dmg = 0;
152152
director.DealDamage(Targetting.Player, dmg, note.Owner);
153-
}
153+
},
154+
description: "GWS_NOTE_DESCRIPTION"
154155
),
155156
new Note(
156157
11,
@@ -188,7 +189,8 @@ public partial class Scribe : Node
188189
{
189190
int amt = Math.Max((3 - (int)timing) * note.GetBaseVal(), 0);
190191
director.AddStatus(Targetting.All, StatusEffect.Block, amt);
191-
}
192+
},
193+
description: "PARASIFLY_NOTE_DESCRIPTION"
192194
),
193195
new Note(
194196
14,
@@ -203,7 +205,8 @@ public partial class Scribe : Node
203205
note.Owner.Heal((3 - (int)timing));
204206
},
205207
default,
206-
Targetting.Player
208+
Targetting.Player,
209+
"BOSSBLOOD_NOTE_DESCRIPTION"
207210
),
208211
new Note(
209212
15,
@@ -216,7 +219,8 @@ public partial class Scribe : Node
216219
return;
217220
int amt = Math.Max((3 - (int)timing) * note.GetBaseVal(), 1);
218221
director.AddStatus(Targetting.Player, StatusEffect.Poison, amt);
219-
}
222+
},
223+
description: "SPIDER_NOTE_DESCRIPTION"
220224
),
221225
new Note(
222226
16,
@@ -229,7 +233,8 @@ public partial class Scribe : Node
229233
if (timing == Timing.Perfect)
230234
dmg = 0;
231235
director.DealDamage(Targetting.Player, dmg, note.Owner);
232-
}
236+
},
237+
description: "LWS_NOTE_DESCRIPTION"
233238
),
234239
new Note(
235240
17,
@@ -242,7 +247,8 @@ public partial class Scribe : Node
242247
return;
243248
int amt = Math.Max((3 - (int)timing) * note.GetBaseVal(), 1);
244249
director.AddStatus(Targetting.Player, StatusEffect.Poison, amt);
245-
}
250+
},
251+
description: "MUSHROOM_NOTE_DESCRIPTION"
246252
),
247253
new Note(
248254
18,

Globals/Translations/Translations.csv

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,23 @@ CREDITS_ADDITIONAL_ART,Art,额外美术
206206
CREDITS_ADDITIONAL_HELP,Additional Help,额外协助
207207
CREDITS_OTHER_PLAYTESTERS,All our other playtesters,以及所有其他测试玩家
208208
CREDITS_SPECIAL_THANKS,Special Thanks,特别鸣谢
209-
CREDITS_THANKS_PLAYERS,And to you the player!,以及屏幕前的你!
209+
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,玩家根据时机中毒
228+

Scenes/BattleDirector/BattleScene.tscn

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[gd_scene load_steps=13 format=3 uid="uid://b0mrgr7h0ty1y"]
1+
[gd_scene load_steps=14 format=3 uid="uid://b0mrgr7h0ty1y"]
22

33
[ext_resource type="Script" uid="uid://bttu0wmy2fp64" path="res://Scenes/BattleDirector/Scripts/BattleDirector.cs" id="1_jmdo1"]
44
[ext_resource type="Script" uid="uid://pl57giqyhckb" path="res://Scenes/UI/Scripts/MenuModule.cs" id="2_ka0ws"]
@@ -10,6 +10,7 @@
1010
[ext_resource type="Script" uid="uid://cp6t6haqyef7o" path="res://Scenes/AreaBasedBackground.cs" id="7_6k2qj"]
1111
[ext_resource type="Texture2D" uid="uid://dbjotl0v1ymia" path="res://SharedAssets/BattleFrame1.png" id="7_klvil"]
1212
[ext_resource type="Theme" uid="uid://d37e3tpsbxwak" path="res://Scenes/UI/Assets/GeneralTheme.tres" id="8_62qim"]
13+
[ext_resource type="PackedScene" uid="uid://bejjkejyeffek" path="res://Scenes/BattleDirector/EnemyDescriptions.tscn" id="11_gbbxr"]
1314

1415
[sub_resource type="Gradient" id="Gradient_8uy3a"]
1516
offsets = PackedFloat32Array(0, 0.766234, 1)
@@ -20,7 +21,7 @@ gradient = SubResource("Gradient_8uy3a")
2021
fill_from = Vector2(1, 0)
2122
fill_to = Vector2(0.738532, 1)
2223

23-
[node name="ProtoBattleDirector" type="Node2D" node_paths=PackedStringArray("PuppetMarkers", "_countdownLabel", "CD", "CM", "DW", "NPB", "Audio", "FocusedButton")]
24+
[node name="ProtoBattleDirector" type="Node2D" node_paths=PackedStringArray("PuppetMarkers", "_countdownLabel", "CD", "CM", "DW", "NPB", "Audio", "Descriptions", "FocusedButton")]
2425
process_mode = 1
2526
script = ExtResource("1_jmdo1")
2627
PuppetMarkers = [NodePath("PlayerMarker"), NodePath("Enemy1Marker"), NodePath("Enemy2Marker"), NodePath("Enemy3Marker")]
@@ -30,6 +31,7 @@ CM = NodePath("VPContainer")
3031
DW = NodePath("3D/SubViewport/3DWizard")
3132
NPB = NodePath("NotePlacementBar")
3233
Audio = NodePath("AudioStreamPlayer")
34+
Descriptions = NodePath("EnemyDescriptions")
3335
FocusedButton = NodePath("StartButton")
3436
metadata/_edit_lock_ = true
3537

@@ -142,3 +144,10 @@ theme_override_constants/shadow_offset_y = 3
142144
theme_override_constants/shadow_outline_size = 3
143145
theme_override_font_sizes/font_size = 64
144146
text = "5"
147+
148+
[node name="EnemyDescriptions" parent="." instance=ExtResource("11_gbbxr")]
149+
z_index = 1
150+
offset_left = 559.0
151+
offset_top = 177.0
152+
offset_right = 559.0
153+
offset_bottom = 177.0
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[gd_scene load_steps=3 format=3 uid="uid://bejjkejyeffek"]
2+
3+
[ext_resource type="Script" uid="uid://da8no3g3kbob7" path="res://Scenes/BattleDirector/Scripts/EnemyDescriptions.cs" id="1_r3tcc"]
4+
[ext_resource type="Texture2D" uid="uid://djd6iw2g84bba" path="res://Scenes/UI/Assets/UI_CenterFrame.png" id="2_mg2uj"]
5+
6+
[node name="EnemyDescriptions" type="Control" node_paths=PackedStringArray("DescriptionsContainer")]
7+
layout_mode = 3
8+
anchors_preset = 15
9+
anchor_right = 1.0
10+
anchor_bottom = 1.0
11+
grow_horizontal = 2
12+
grow_vertical = 2
13+
script = ExtResource("1_r3tcc")
14+
DescriptionsContainer = NodePath("VBoxContainer")
15+
16+
[node name="UiCenterFrame" type="Sprite2D" parent="."]
17+
scale = Vector2(0.84375, 3.5)
18+
texture = ExtResource("2_mg2uj")
19+
centered = false
20+
21+
[node name="VBoxContainer" type="VBoxContainer" parent="."]
22+
layout_mode = 0
23+
offset_left = 8.0
24+
offset_top = 15.0
25+
offset_right = 75.0
26+
offset_bottom = 168.0

Scenes/BattleDirector/Scripts/BattleDirector.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public partial class BattleDirector : Node2D
3434
[Export]
3535
private AudioStreamPlayer Audio;
3636

37+
[Export]
38+
private EnemyDescriptions Descriptions;
39+
3740
[Export]
3841
public Button FocusedButton; //Initial start button
3942

@@ -201,6 +204,7 @@ private void InitEnemies()
201204
_enemies[i] = enemy;
202205
AddEnemyEffects(enemy);
203206
}
207+
Descriptions.Setup(_enemies[0]);
204208
}
205209

206210
public override void _Process(double delta)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Godot;
4+
5+
public partial class EnemyDescriptions : Node
6+
{
7+
public List<string> Descriptions = new List<string>();
8+
9+
[Export]
10+
private VBoxContainer DescriptionsContainer;
11+
12+
public void Setup(EnemyPuppet enemy)
13+
{
14+
if (enemy.InitialNote != (0, 0))
15+
Descriptions.Add(Scribe.NoteDictionary[enemy.InitialNote.NoteId].Description);
16+
17+
foreach (var effect in enemy.GetBattleEvents())
18+
{
19+
if (effect.Description != null)
20+
Descriptions.Add(effect.Description);
21+
}
22+
23+
foreach (var description in Descriptions)
24+
{
25+
HBoxContainer hbox = new HBoxContainer();
26+
27+
Sprite2D icon = new Sprite2D();
28+
icon.Texture = Scribe.NoteDictionary[enemy.InitialNote.NoteId].Texture;
29+
30+
Label desc = new Label();
31+
desc.Text = description;
32+
desc.SizeFlagsHorizontal = Control.SizeFlags.ExpandFill;
33+
desc.AutowrapMode = TextServer.AutowrapMode.WordSmart;
34+
35+
hbox.AddChild(icon);
36+
hbox.AddChild(desc);
37+
DescriptionsContainer.AddChild(hbox);
38+
}
39+
}
40+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://da8no3g3kbob7

Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,23 @@ public override void _Ready()
2121
enemTween.SetLoops();
2222
enemTween.Play();
2323

24+
const int effect1Val = 30;
25+
2426
BattleEvents = new EnemyEffect[]
2527
{
2628
new EnemyEffect(
2729
this,
2830
BattleEffectTrigger.OnLoop,
29-
30,
31+
effect1Val,
3032
(e, eff, val) =>
3133
{
3234
eff.Owner.Heal(val);
3335
e.BD.RandApplyNote(eff.Owner, 14, 1);
34-
}
36+
},
37+
string.Format(
38+
TranslationServer.Translate("BOSSBLOOD_EFFECT1"),
39+
effect1Val.ToString()
40+
)
3541
),
3642
new EnemyEffect(
3743
this,
@@ -48,7 +54,8 @@ public override void _Ready()
4854
{
4955
SteamWhisperer.PopAchievement("actOneComp");
5056
}
51-
}
57+
},
58+
null
5259
),
5360
};
5461
}

Scenes/Puppets/Enemies/CyberFox/P_CyberFox.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public override void _Ready()
4040
{
4141
e.BD.AddStatus(Targetting.First, StatusEffect.Dodge, 1);
4242
_effectNode.TriggerGlitch(1f);
43-
}
43+
},
44+
"CYBERFOX_EFFECT1"
4445
),
4546
};
4647
}

0 commit comments

Comments
 (0)