Skip to content

Commit 0069a09

Browse files
committed
Added loose change
Also appears on the score screen as a flat addition to income
1 parent f526687 commit 0069a09

6 files changed

Lines changed: 84 additions & 3 deletions

File tree

1.13 KB
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://bocp4uhgovyv1"
6+
path="res://.godot/imported/Relic_LooseChange.png-496af612042666a7f384e1eb8d4167ce.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://Classes/Relics/Assets/Relic_LooseChange.png"
14+
dest_files=["res://.godot/imported/Relic_LooseChange.png-496af612042666a7f384e1eb8d4167ce.ctex"]
15+
16+
[params]
17+
18+
compress/mode=0
19+
compress/high_quality=false
20+
compress/lossy_quality=0.7
21+
compress/hdr_compression=1
22+
compress/normal_map=0
23+
compress/channel_pack=0
24+
mipmaps/generate=false
25+
mipmaps/limit=-1
26+
roughness/mode=0
27+
roughness/src_normal=""
28+
process/fix_alpha_border=true
29+
process/premult_alpha=false
30+
process/normal_map_invert_y=false
31+
process/hdr_as_srgb=false
32+
process/hdr_clamp_exposure=false
33+
process/size_limit=0
34+
detect_3d/compress_to=1

Globals/Scribe.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,23 @@ public partial class Scribe : Node
332332
),
333333
}
334334
),
335+
new RelicTemplate(
336+
10,
337+
"Loose Change",
338+
Rarity.Common,
339+
GD.Load<Texture2D>("res://Classes/Relics/Assets/Relic_LooseChange.png"),
340+
new RelicEffect[]
341+
{
342+
new RelicEffect(
343+
BattleEffectTrigger.OnBattleEnd,
344+
10,
345+
(e, self, val) =>
346+
{
347+
StageProducer.PlayerStats.Money += val;
348+
}
349+
),
350+
}
351+
),
335352
};
336353

337354
public static readonly SongTemplate[] SongDictionary = new[] //Generalize and make pools for areas/room types

Globals/Translations/Translations.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,5 @@ TUTORIAL_PLACE_6,"Now go ahead, place a note in the bottom lane!",(TODO)
107107
TUTORIAL_FINAL_1,"Good job, you placed a note! You either healed yourself, or dealt damage. I can't tell I'm just a Strawman.",(TODO)
108108
TUTORIAL_FINAL_2,"As a refresher: Hit notes to build a combo and fill the bar. When the bar is full, press one of your buttons for a lane that doesn't have a note at the current beat. Notes in the chart will loop around. Keep it up to win.",(TODO)
109109
TUTORIAL_FINAL_3,"Good luck! I believe in you.",(TODO)
110-
TUTORIAL_BOSS,"This may take some getting used to, but death is ok in the grand scheme of things. Just have some patience with yourself, you'll learn in the end.",(TODO)
110+
TUTORIAL_BOSS,"This may take some getting used to, but death is ok in the grand scheme of things. Just have some patience with yourself, you'll learn in the end.",(TODO)
111+
RELIC_PLACED,"Loose Change income:","零钱收入:"

Scenes/UI/ScoreScreen.tscn

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[ext_resource type="Texture2D" uid="uid://burj10os057fx" path="res://Scenes/UI/Assets/UI_CrystalFrameInset.png" id="3_usavq"]
77
[ext_resource type="Theme" uid="uid://d37e3tpsbxwak" path="res://Scenes/UI/Assets/GeneralTheme.tres" id="4_1rsqt"]
88

9-
[node name="ScoreScreen" type="CanvasLayer" node_paths=PackedStringArray("_styleLabel", "_styleAmount", "_perfectsLabel", "_perfectsAmount", "_placedLabel", "_placedAmount", "_totalLabel", "_totalAmount", "_acceptButton")]
9+
[node name="ScoreScreen" type="CanvasLayer" node_paths=PackedStringArray("_styleLabel", "_styleAmount", "_perfectsLabel", "_perfectsAmount", "_placedLabel", "_placedAmount", "_totalLabel", "_totalAmount", "_relicLabel", "_relicAmount", "_acceptButton")]
1010
process_mode = 3
1111
script = ExtResource("1_ma4hf")
1212
_styleLabel = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/LabelMargin/LabelVbox/StyleLabel")
@@ -17,6 +17,8 @@ _placedLabel = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/B
1717
_placedAmount = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/ScoreMargin/LabelVbox/PlacedLabel")
1818
_totalLabel = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/LabelMargin/LabelVbox/TotalLabel")
1919
_totalAmount = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/ScoreMargin/LabelVbox/TotalLabel")
20+
_relicLabel = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/LabelMargin/LabelVbox/RelicLabel")
21+
_relicAmount = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/ScoreMargin/LabelVbox/RelicLabel")
2022
_acceptButton = NodePath("Bg/WindowMargin/PanelBg/VBoxContainer/ButtonMargin/AcceptButton")
2123

2224
[node name="Bg" type="NinePatchRect" parent="."]
@@ -144,6 +146,10 @@ text = "SCORING_PERFECTS"
144146
layout_mode = 2
145147
text = "SCORING_PLACED"
146148

149+
[node name="RelicLabel" type="Label" parent="Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/LabelMargin/LabelVbox"]
150+
layout_mode = 2
151+
text = "RELIC_PLACED"
152+
147153
[node name="Placeholder" type="Label" parent="Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/LabelMargin/LabelVbox"]
148154
layout_mode = 2
149155

@@ -181,6 +187,11 @@ layout_mode = 2
181187
text = "999"
182188
horizontal_alignment = 2
183189

190+
[node name="RelicLabel" type="Label" parent="Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/ScoreMargin/LabelVbox"]
191+
layout_mode = 2
192+
text = "999"
193+
horizontal_alignment = 2
194+
184195
[node name="Placeholder" type="Label" parent="Bg/WindowMargin/PanelBg/VBoxContainer/MarginContainer/BottomPanelBg/HBoxContainer/ScoreMargin/LabelVbox"]
185196
layout_mode = 2
186197
horizontal_alignment = 2

Scenes/UI/Scripts/ScoringScreen.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Linq;
23
using Godot;
34

45
public partial class ScoringScreen : CanvasLayer
@@ -70,20 +71,36 @@ public void SetEndHp(float amount)
7071
[Export]
7172
private Label _totalAmount;
7273

74+
[Export]
75+
private Label _relicLabel;
76+
77+
[Export]
78+
private Label _relicAmount;
79+
7380
[Export]
7481
private Button _acceptButton;
7582

7683
private int _totalBaseMoney;
7784
private float _perfectMulti;
7885
private float _placedMulti;
79-
private int FinalMoney => (int)(_totalBaseMoney * _perfectMulti * _placedMulti);
86+
private bool _hasChange;
87+
private int _changeAmount = Scribe.RelicDictionary[10].Effects[0].Value;
88+
private int FinalMoney =>
89+
(int)(_totalBaseMoney * _perfectMulti * _placedMulti) + (_hasChange ? _changeAmount : 0);
8090

8191
public delegate void FinishedHandler();
8292
public event FinishedHandler Finished;
8393

8494
public override void _Ready()
8595
{
8696
_acceptButton.Pressed += FinishScoring;
97+
98+
_hasChange = StageProducer.PlayerStats.CurRelics.Contains(Scribe.RelicDictionary[10]);
99+
if (!_hasChange)
100+
{
101+
_relicLabel.Visible = false;
102+
_relicAmount.Visible = false;
103+
}
87104
}
88105

89106
public override void _Process(double delta)
@@ -127,6 +144,7 @@ private void DrawScoreLabels()
127144
_styleAmount.Text = $"{_totalBaseMoney}";
128145
_perfectsAmount.Text = $"X{_perfectMulti:0.00}";
129146
_placedAmount.Text = $"X{_placedMulti:0.00}";
147+
_relicAmount.Text = $"+{_changeAmount}";
130148
_totalAmount.Text = $"{FinalMoney}";
131149
}
132150

0 commit comments

Comments
 (0)