Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Classes/Notes/Note.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public Note(
?? (
(BD, source, Timing) =>
{
BD.GetTarget(this).TakeDamage(source._baseVal);
BD.GetTarget(this).TakeDamage((int)Timing * source._baseVal);
}
);
_baseVal = baseVal;
Expand Down Expand Up @@ -67,4 +67,9 @@ public Note Clone()
);
return newNote;
}

public int GetBaseVal()
{
return _baseVal;
}
}
28 changes: 18 additions & 10 deletions Globals/Scribe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class Scribe : Node
1,
(director, note, timing) =>
{
director.Player.TakeDamage(3 - (int)timing);
director.Player.TakeDamage((3 - (int)timing) * note.GetBaseVal());
}
),
new Note(
Expand All @@ -32,7 +32,9 @@ public partial class Scribe : Node
1,
(director, note, timing) =>
{
director.Enemy.TakeDamage((int)timing);
if (timing == Timing.Miss)
return;
director.Enemy.TakeDamage((int)timing * note.GetBaseVal());
}
),
new Note(
Expand All @@ -41,12 +43,12 @@ public partial class Scribe : Node
"Basic player note, deals double damage to enemy.",
GD.Load<Texture2D>("res://Classes/Notes/assets/double_note.png"),
null,
1,
2,
(director, note, timing) =>
{
// can change later, but I want it like this instead of changing base
// in case we have some relic that messes with timing
director.Enemy.TakeDamage(2 * (int)timing);
if (timing == Timing.Miss)
return;
director.Enemy.TakeDamage(note.GetBaseVal() * (int)timing);
}
),
new Note(
Expand All @@ -58,7 +60,9 @@ public partial class Scribe : Node
1,
(director, note, timing) =>
{
director.Player.Heal((int)timing);
if (timing == Timing.Miss)
return;
director.Player.Heal((int)timing * note.GetBaseVal());
}
),
new Note(
Expand All @@ -70,8 +74,10 @@ public partial class Scribe : Node
1,
(director, note, timing) =>
{
director.Player.Heal((int)timing);
director.Enemy.TakeDamage((int)timing);
if (timing == Timing.Miss)
return;
director.Player.Heal((int)timing * note.GetBaseVal());
director.Enemy.TakeDamage((int)timing * note.GetBaseVal());
}
),
new Note(
Expand All @@ -83,7 +89,9 @@ public partial class Scribe : Node
1,
(director, note, timing) =>
{
director.Enemy.TakeDamage((int)timing);
if (timing == Timing.Miss)
return;
director.Enemy.TakeDamage((int)timing + note.GetBaseVal());
},
0.25f
),
Expand Down
4 changes: 4 additions & 0 deletions Globals/translations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ INVENTORY_TAB_NOTES,Notes,乐谱
INVENTORY_TAB_RELICS,Relics,遗物
OPTIONS_VOLUME_LABEL,Master Volume,最终音量设置
OPTIONS_CONTRAST_LABEL,High Contrast,高对比度模式
HOW_TO_PLAY,How to Play,如何游玩
HOW_TO_PLAY_BLOCK1,"Hit notes to\nbuild combo","点击音符\n以建立连击"
HOW_TO_PLAY_BLOCK2,"Place notes when\ncombo is full","当连击满\n时放置音符"
HOW_TO_PLAY_BLOCK3,"Only placed notes\nhave effects","只有已放置\n的音符才有效"
3 changes: 0 additions & 3 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ window/stretch/scale_mode="integer"

project/assembly_name="Funk Engine"

[game]


[input]

ui_accept={
Expand Down
9 changes: 8 additions & 1 deletion scenes/BattleDirector/scripts/BattleDirector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ private bool PlayerAddNote(ArrowType type, int beat)
{
if (!NotePlacementBar.CanPlaceNote())
return false;
if (!CD.AddNoteToLane(type, beat % CM.BeatsPerLoop, NotePlacementBar.PlacedNote(), false))
if (
!CD.AddNoteToLane(
type,
beat % CM.BeatsPerLoop,
NotePlacementBar.PlacedNote(this),
false
)
) //TODO: Remove passing BD into NPB
return false;
NotePlaced?.Invoke(this);
return true;
Expand Down
4 changes: 2 additions & 2 deletions scenes/BattleDirector/scripts/Conductor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ public bool AddNoteToLane(ArrowType type, int beat, Note note, bool isActive = t
{
beat %= CM.BeatsPerLoop;
Note newNote = note.Clone();
if (beat == 0 || _laneData[(int)type][beat] != null)
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
return false;

NoteArrow arrow;
if (isActive) //Currently an enemy note.
if (isActive) //Currently isActive means an enemy note.
{
arrow = CM.AddArrowToLane(type, beat, newNote);
}
Expand Down
8 changes: 6 additions & 2 deletions scenes/BattleDirector/scripts/NotePlacementBar.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FunkEngine;
using Godot;

public partial class NotePlacementBar : Node
Expand Down Expand Up @@ -183,13 +184,16 @@ public void IncreaseCharge(int amount = 1)
}

// Placing a note resets the note placement bar
public Note PlacedNote()
public Note PlacedNote(BattleDirector BD)
{
_currentBarValue -= (int)(_currentNoteInstance.CostModifier * MaxValue);

UpdateNotePlacementBar(_currentBarValue);
//fullBarParticles.Emitting = false;
return GetNote(Input.IsActionPressed("Secondary"));

Note placedNote = GetNote(Input.IsActionPressed("Secondary"));
placedNote?.OnHit(BD, Timing.Okay); //Hardcode for now, eventually the note itself could have its default
return placedNote;
}

public bool CanPlaceNote()
Expand Down
12 changes: 12 additions & 0 deletions scenes/Options/OptionsMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public partial class OptionsMenu : CanvasLayer
[Export]
private CheckBox _highContrastToggle;

[Export]
private Button _howToPlayButton;

private const float MinVolumeVal = 50f;

public override void _Ready()
Expand All @@ -36,6 +39,7 @@ public override void _Ready()
_closeButton.Pressed += CloseMenu;
_controlsButton.Pressed += OpenControls;
_highContrastToggle.Toggled += HighContrastChanged;
_howToPlayButton.Pressed += OpenHowToPlay;
}

public override void _Process(double delta) //TODO: Better method for returning focus
Expand Down Expand Up @@ -98,4 +102,12 @@ private void HighContrastChanged(bool toggled)
StageProducer.ContrastFilter.Visible = toggled;
SaveSystem.UpdateConfig(SaveSystem.ConfigSettings.HighContrast, toggled);
}

private void OpenHowToPlay()
{
HowToPlay howtoPlay = GD.Load<PackedScene>("res://scenes/UI/HowToPlay.tscn")
.Instantiate<HowToPlay>();
AddChild(howtoPlay);
howtoPlay.OpenMenu(this);
}
}
9 changes: 7 additions & 2 deletions scenes/Options/OptionsMenu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
[ext_resource type="Script" path="res://scenes/Options/scripts/LanguageSelection.cs" id="1_qyvkw"]
[ext_resource type="Script" path="res://scenes/Options/OptionsMenu.cs" id="1_yjq7i"]

[node name="OptionsMenu" type="CanvasLayer" node_paths=PackedStringArray("_focused", "_volumeSlider", "_closeButton", "_controlsButton", "_highContrastToggle")]
[node name="OptionsMenu" type="CanvasLayer" node_paths=PackedStringArray("_focused", "_volumeSlider", "_closeButton", "_controlsButton", "_highContrastToggle", "_howToPlayButton")]
process_mode = 3
script = ExtResource("1_yjq7i")
_focused = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/LanguageSelection")
_volumeSlider = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/Container/Volume")
_closeButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/TitleButton")
_controlsButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/ControlsButton")
_highContrastToggle = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HBoxContainer/CheckBox")
_howToPlayButton = NodePath("Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer/HowToPlayButton")

[node name="Control" type="Control" parent="."]
layout_mode = 3
Expand Down Expand Up @@ -59,7 +60,7 @@ theme_override_constants/margin_bottom = 10
custom_minimum_size = Vector2(240, 0)
layout_mode = 2
size_flags_horizontal = 0
theme_override_constants/separation = 25
theme_override_constants/separation = 18
alignment = 1

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

[node name="HowToPlayButton" type="Button" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "HOW_TO_PLAY"

[node name="TitleButton" type="Button" parent="Control/CenterContainer/MarginContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "CONTROLS_RETURN_BUTTON"
2 changes: 2 additions & 0 deletions scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public partial class P_BossBlood : EnemyPuppet
{
public override void _Ready()
{
_currentHealth = 100;
_maxHealth = 100;
base._Ready();
var enemTween = CreateTween();
enemTween.TweenProperty(Sprite, "position", Vector2.Down * 5, 1f).AsRelative();
Expand Down
2 changes: 2 additions & 0 deletions scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ public partial class P_Parasifly : EnemyPuppet
{
public override void _Ready()
{
_currentHealth = 50;
_maxHealth = 50;
base._Ready();
var enemTween = CreateTween();
enemTween.TweenProperty(Sprite, "position", Vector2.Down * 2, 2f).AsRelative();
Expand Down
2 changes: 2 additions & 0 deletions scenes/Puppets/Enemies/TheGWS/P_TheGWS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ public partial class P_TheGWS : EnemyPuppet
{
public override void _Ready()
{
_currentHealth = 75;
_maxHealth = 75;
base._Ready();
var enemTween = CreateTween();
enemTween.TweenProperty(Sprite, "position", Vector2.Down * 10, 3f).AsRelative();
Expand Down
42 changes: 42 additions & 0 deletions scenes/UI/HowToPlay.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System;
using Godot;

public partial class HowToPlay : Node2D
{
[Export]
private Button _returnButton;

private Node _previousScene;
private ProcessModeEnum _previousProcessMode;

// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
_returnButton.Pressed += CloseMenu;
}

// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta) { }

public void OpenMenu(Node prevScene)
{
_previousScene = prevScene;
_previousProcessMode = _previousScene.GetProcessMode();
prevScene.ProcessMode = ProcessModeEnum.Disabled;
}

private void CloseMenu()
{
_previousScene.ProcessMode = _previousProcessMode;
QueueFree();
}

public override void _Input(InputEvent @event)
{
if (@event.IsActionPressed("ui_cancel"))
{
CloseMenu();
GetViewport().SetInputAsHandled();
}
}
}
Loading