Skip to content

Commit 1d75814

Browse files
authored
Merge pull request #103 from Project-Funk-Engine/game-balance
Game balance
2 parents 56167f5 + 14d7212 commit 1d75814

File tree

16 files changed

+306
-21
lines changed

16 files changed

+306
-21
lines changed

Classes/Notes/Note.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public Note(
3737
?? (
3838
(BD, source, Timing) =>
3939
{
40-
BD.GetTarget(this).TakeDamage(source._baseVal);
40+
BD.GetTarget(this).TakeDamage((int)Timing * source._baseVal);
4141
}
4242
);
4343
_baseVal = baseVal;
@@ -67,4 +67,9 @@ public Note Clone()
6767
);
6868
return newNote;
6969
}
70+
71+
public int GetBaseVal()
72+
{
73+
return _baseVal;
74+
}
7075
}

Globals/Scribe.cs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public partial class Scribe : Node
2020
1,
2121
(director, note, timing) =>
2222
{
23-
director.Player.TakeDamage(3 - (int)timing);
23+
director.Player.TakeDamage((3 - (int)timing) * note.GetBaseVal());
2424
}
2525
),
2626
new Note(
@@ -32,7 +32,9 @@ public partial class Scribe : Node
3232
1,
3333
(director, note, timing) =>
3434
{
35-
director.Enemy.TakeDamage((int)timing);
35+
if (timing == Timing.Miss)
36+
return;
37+
director.Enemy.TakeDamage((int)timing * note.GetBaseVal());
3638
}
3739
),
3840
new Note(
@@ -41,12 +43,12 @@ public partial class Scribe : Node
4143
"Basic player note, deals double damage to enemy.",
4244
GD.Load<Texture2D>("res://Classes/Notes/assets/double_note.png"),
4345
null,
44-
1,
46+
2,
4547
(director, note, timing) =>
4648
{
47-
// can change later, but I want it like this instead of changing base
48-
// in case we have some relic that messes with timing
49-
director.Enemy.TakeDamage(2 * (int)timing);
49+
if (timing == Timing.Miss)
50+
return;
51+
director.Enemy.TakeDamage(note.GetBaseVal() * (int)timing);
5052
}
5153
),
5254
new Note(
@@ -58,7 +60,9 @@ public partial class Scribe : Node
5860
1,
5961
(director, note, timing) =>
6062
{
61-
director.Player.Heal((int)timing);
63+
if (timing == Timing.Miss)
64+
return;
65+
director.Player.Heal((int)timing * note.GetBaseVal());
6266
}
6367
),
6468
new Note(
@@ -70,8 +74,10 @@ public partial class Scribe : Node
7074
1,
7175
(director, note, timing) =>
7276
{
73-
director.Player.Heal((int)timing);
74-
director.Enemy.TakeDamage((int)timing);
77+
if (timing == Timing.Miss)
78+
return;
79+
director.Player.Heal((int)timing * note.GetBaseVal());
80+
director.Enemy.TakeDamage((int)timing * note.GetBaseVal());
7581
}
7682
),
7783
new Note(
@@ -83,7 +89,9 @@ public partial class Scribe : Node
8389
1,
8490
(director, note, timing) =>
8591
{
86-
director.Enemy.TakeDamage((int)timing);
92+
if (timing == Timing.Miss)
93+
return;
94+
director.Enemy.TakeDamage((int)timing + note.GetBaseVal());
8795
},
8896
0.25f
8997
),

Globals/translations.csv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,7 @@ INVENTORY_TAB_NOTES,Notes,乐谱
5454
INVENTORY_TAB_RELICS,Relics,遗物
5555
OPTIONS_VOLUME_LABEL,Master Volume,最终音量设置
5656
OPTIONS_CONTRAST_LABEL,High Contrast,高对比度模式
57+
HOW_TO_PLAY,How to Play,如何游玩
58+
HOW_TO_PLAY_BLOCK1,"Hit notes to\nbuild combo","点击音符\n以建立连击"
59+
HOW_TO_PLAY_BLOCK2,"Place notes when\ncombo is full","当连击满\n时放置音符"
60+
HOW_TO_PLAY_BLOCK3,"Only placed notes\nhave effects","只有已放置\n的音符才有效"

project.godot

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ window/stretch/scale_mode="integer"
3737

3838
project/assembly_name="Funk Engine"
3939

40-
[game]
41-
42-
4340
[input]
4441

4542
ui_accept={

scenes/BattleDirector/scripts/BattleDirector.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ private bool PlayerAddNote(ArrowType type, int beat)
4343
{
4444
if (!NotePlacementBar.CanPlaceNote())
4545
return false;
46-
if (!CD.AddNoteToLane(type, beat % CM.BeatsPerLoop, NotePlacementBar.PlacedNote(), false))
46+
if (
47+
!CD.AddNoteToLane(
48+
type,
49+
beat % CM.BeatsPerLoop,
50+
NotePlacementBar.PlacedNote(this),
51+
false
52+
)
53+
) //TODO: Remove passing BD into NPB
4754
return false;
4855
NotePlaced?.Invoke(this);
4956
return true;

scenes/BattleDirector/scripts/Conductor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ public bool AddNoteToLane(ArrowType type, int beat, Note note, bool isActive = t
4545
{
4646
beat %= CM.BeatsPerLoop;
4747
Note newNote = note.Clone();
48-
if (beat == 0 || _laneData[(int)type][beat] != null)
48+
if (beat == 0 || _laneData[(int)type][beat] != null) //TODO: Double check if this is still necessary, doesn't seem to matter for player placed notes
4949
return false;
5050

5151
NoteArrow arrow;
52-
if (isActive) //Currently an enemy note.
52+
if (isActive) //Currently isActive means an enemy note.
5353
{
5454
arrow = CM.AddArrowToLane(type, beat, newNote);
5555
}

scenes/BattleDirector/scripts/NotePlacementBar.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using FunkEngine;
45
using Godot;
56

67
public partial class NotePlacementBar : Node
@@ -183,13 +184,16 @@ public void IncreaseCharge(int amount = 1)
183184
}
184185

185186
// Placing a note resets the note placement bar
186-
public Note PlacedNote()
187+
public Note PlacedNote(BattleDirector BD)
187188
{
188189
_currentBarValue -= (int)(_currentNoteInstance.CostModifier * MaxValue);
189190

190191
UpdateNotePlacementBar(_currentBarValue);
191192
//fullBarParticles.Emitting = false;
192-
return GetNote(Input.IsActionPressed("Secondary"));
193+
194+
Note placedNote = GetNote(Input.IsActionPressed("Secondary"));
195+
placedNote?.OnHit(BD, Timing.Okay); //Hardcode for now, eventually the note itself could have its default
196+
return placedNote;
193197
}
194198

195199
public bool CanPlaceNote()

scenes/Options/OptionsMenu.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ public partial class OptionsMenu : CanvasLayer
2121
[Export]
2222
private CheckBox _highContrastToggle;
2323

24+
[Export]
25+
private Button _howToPlayButton;
26+
2427
private const float MinVolumeVal = 50f;
2528

2629
public override void _Ready()
@@ -36,6 +39,7 @@ public override void _Ready()
3639
_closeButton.Pressed += CloseMenu;
3740
_controlsButton.Pressed += OpenControls;
3841
_highContrastToggle.Toggled += HighContrastChanged;
42+
_howToPlayButton.Pressed += OpenHowToPlay;
3943
}
4044

4145
public override void _Process(double delta) //TODO: Better method for returning focus
@@ -98,4 +102,12 @@ private void HighContrastChanged(bool toggled)
98102
StageProducer.ContrastFilter.Visible = toggled;
99103
SaveSystem.UpdateConfig(SaveSystem.ConfigSettings.HighContrast, toggled);
100104
}
105+
106+
private void OpenHowToPlay()
107+
{
108+
HowToPlay howtoPlay = GD.Load<PackedScene>("res://scenes/UI/HowToPlay.tscn")
109+
.Instantiate<HowToPlay>();
110+
AddChild(howtoPlay);
111+
howtoPlay.OpenMenu(this);
112+
}
101113
}

scenes/Options/OptionsMenu.tscn

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
[ext_resource type="Script" path="res://scenes/Options/scripts/LanguageSelection.cs" id="1_qyvkw"]
44
[ext_resource type="Script" path="res://scenes/Options/OptionsMenu.cs" id="1_yjq7i"]
55

6-
[node name="OptionsMenu" type="CanvasLayer" node_paths=PackedStringArray("_focused", "_volumeSlider", "_closeButton", "_controlsButton", "_highContrastToggle")]
6+
[node name="OptionsMenu" type="CanvasLayer" node_paths=PackedStringArray("_focused", "_volumeSlider", "_closeButton", "_controlsButton", "_highContrastToggle", "_howToPlayButton")]
77
process_mode = 3
88
script = ExtResource("1_yjq7i")
99
_focused = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/LanguageSelection")
1010
_volumeSlider = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/Container/Volume")
1111
_closeButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/TitleButton")
1212
_controlsButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/ControlsButton")
1313
_highContrastToggle = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HBoxContainer/CheckBox")
14+
_howToPlayButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HowToPlayButton")
1415

1516
[node name="Control" type="Control" parent="."]
1617
layout_mode = 3
@@ -59,7 +60,7 @@ theme_override_constants/margin_bottom = 10
5960
custom_minimum_size = Vector2(240, 0)
6061
layout_mode = 2
6162
size_flags_horizontal = 0
62-
theme_override_constants/separation = 25
63+
theme_override_constants/separation = 18
6364
alignment = 1
6465

6566
[node name="Title" type="Label" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
@@ -112,6 +113,10 @@ script = ExtResource("1_qyvkw")
112113
layout_mode = 2
113114
text = "TITLE_CONTROLS"
114115

116+
[node name="HowToPlayButton" type="Button" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
117+
layout_mode = 2
118+
text = "HOW_TO_PLAY"
119+
115120
[node name="TitleButton" type="Button" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
116121
layout_mode = 2
117122
text = "CONTROLS_RETURN_BUTTON"

scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ public partial class P_BossBlood : EnemyPuppet
77
{
88
public override void _Ready()
99
{
10+
_currentHealth = 100;
11+
_maxHealth = 100;
1012
base._Ready();
1113
var enemTween = CreateTween();
1214
enemTween.TweenProperty(Sprite, "position", Vector2.Down * 5, 1f).AsRelative();

0 commit comments

Comments
 (0)