Skip to content

Commit f93670a

Browse files
cornerloanLifeHckr
authored andcommitted
First event added
I don't see any reasons why this shouldnt work, but I haven't tested it
1 parent b353299 commit f93670a

3 files changed

Lines changed: 40 additions & 10 deletions

File tree

Classes/Events/EventDatabase.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,23 @@ public partial class EventDatabase
2323
{
2424
() =>
2525
{
26-
GD.Print("You chose to fight");
26+
int randIndex = StageProducer.GlobalRng.RandiRange(
27+
0,
28+
StageProducer.PlayerStats.CurNotes.Length
29+
);
30+
StageProducer.PlayerStats.RemoveNote(randIndex);
2731
},
2832
() =>
2933
{
30-
GD.Print("You chose to run");
34+
int randIndex = StageProducer.GlobalRng.RandiRange(
35+
0,
36+
StageProducer.PlayerStats.CurRelics.Length
37+
);
38+
StageProducer.PlayerStats.RemoveRelic(randIndex);
3139
},
3240
() =>
3341
{
34-
GD.Print("You chose to Mysterious third option");
42+
StageProducer.PlayerStats.Money = (int)StageProducer.PlayerStats.Money / 2;
3543
},
3644
},
3745
GD.Load<Texture2D>("res://Classes/Events/Assets/TEMP.png")

Globals/Translations/Translations.csv

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ TUTORIAL_FINAL_2,"As a refresher: Hit notes to build a combo and fill the bar. W
128128
TUTORIAL_FINAL_3,"Good luck! I believe in you.",(TODO)
129129
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)
130130
EVENT_CONTINUE_BUTTON,"Continue",(TODO)
131-
EVENT_EVENT1_DESC,"A wild creature appears in the forest.",(TODO)
132-
EVENT_EVENT1_OPTION1,Fight,(TODO)
133-
EVENT_EVENT1_OPTION2,Run,(TODO)
134-
EVENT_EVENT1_OPTION3,Mysterious Third Option,(TODO)
135-
EVENT_EVENT1_OUTCOME1,"You chose to fight.",(TODO)
136-
EVENT_EVENT1_OUTCOME2,"You chose to run.",(TODO)
137-
EVENT_EVENT1_OUTCOME3,"You chose the third option.",(TODO)
131+
EVENT_EVENT1_DESC,"A bandit approaches you.",(TODO)
132+
EVENT_EVENT1_OPTION1,"Give them a random note",(TODO)
133+
EVENT_EVENT1_OPTION2,"Give them a random relic",(TODO)
134+
EVENT_EVENT1_OPTION3,"Give them half your gold",(TODO)
135+
EVENT_EVENT1_OUTCOME1,"You got robbed of a random note.",(TODO)
136+
EVENT_EVENT1_OUTCOME2,"You got robbed of a random relic.",(TODO)
137+
EVENT_EVENT1_OUTCOME3,"You got robbed of half your gold.",(TODO)

Scenes/Puppets/Scripts/PlayerStats.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,30 @@ public void AddRelic(RelicTemplate relic)
4242
Scribe.RemoveRelicFromPool(relic);
4343
}
4444

45+
public void RemoveRelic(int index)
46+
{
47+
if (index < 0 || index >= CurRelics.Length)
48+
{
49+
GD.Print("index out of range");
50+
return;
51+
}
52+
53+
CurRelics = CurRelics.Where((_, i) => i != index).ToArray();
54+
}
55+
4556
public void AddNote(Note nSelection)
4657
{
4758
CurNotes = CurNotes.Append(nSelection).ToArray();
4859
}
60+
61+
public void RemoveNote(int index)
62+
{
63+
if (index < 0 || index >= CurNotes.Length)
64+
{
65+
GD.Print("index out of range");
66+
return;
67+
}
68+
69+
CurNotes = CurNotes.Where((_, i) => i != index).ToArray();
70+
}
4971
}

0 commit comments

Comments
 (0)