parent
6a52395cbb
commit
59cbd79f85
@ -0,0 +1,5 @@
|
||||
[gd_scene format=3 uid="uid://dw6hyqtfehxqr"]
|
||||
|
||||
[node name="BackgroundMusicPlayer" type="AudioStreamPlayer"]
|
||||
autoplay = true
|
||||
bus = &"Music"
|
@ -1,21 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public partial class BattleActionMenu : VBoxContainer
|
||||
{
|
||||
public VBoxContainer? DynamicActions;
|
||||
|
||||
public Button? ItemActionButton;
|
||||
|
||||
public Button? SkillActionButton;
|
||||
|
||||
public Button? CommandActionButton;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
this.GetUniqueNode(ref ItemActionButton, nameof(ItemActionButton));
|
||||
this.GetUniqueNode(ref DynamicActions, nameof(DynamicActions));
|
||||
this.GetUniqueNode(ref SkillActionButton, nameof(SkillActionButton));
|
||||
this.GetUniqueNode(ref CommandActionButton, nameof(CommandActionButton));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bktklsml5d0jg"]
|
||||
|
||||
[ext_resource type="Script" path="res://Components/BattleActionMenu.cs" id="1_0bfmk"]
|
||||
|
||||
[node name="BattleActionMenu" type="VBoxContainer"]
|
||||
anchors_preset = 4
|
||||
anchor_top = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_top = -15.5
|
||||
offset_right = 40.0
|
||||
offset_bottom = 15.5
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_0bfmk")
|
||||
|
||||
[node name="ItemActionButton" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "物品"
|
||||
|
||||
[node name="DynamicActions" type="VBoxContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SkillActionButton" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "技能"
|
||||
|
||||
[node name="CommandActionButton" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "指挥"
|
@ -1,49 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public partial class BattleHUD : Control
|
||||
{
|
||||
public Vector2 LastMousePressedPosition;
|
||||
|
||||
public Label? BattleTimeLabel;
|
||||
|
||||
public Popup? PauseMenuPopup;
|
||||
|
||||
public Popup? SettingsMenuPopup;
|
||||
|
||||
public BattleActionMenu? BattleActionMenu;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
this.GetUniqueNode(ref BattleTimeLabel, nameof(BattleTimeLabel));
|
||||
this.GetUniqueNode(ref PauseMenuPopup, nameof(PauseMenuPopup));
|
||||
this.GetUniqueNode(ref SettingsMenuPopup, nameof(SettingsMenuPopup));
|
||||
this.GetUniqueNode(ref BattleActionMenu, nameof(BattleActionMenu));
|
||||
}
|
||||
|
||||
public override void _GuiInput(InputEvent @event)
|
||||
{
|
||||
if (@event is InputEventMouseButton mouseButtonEvent)
|
||||
{
|
||||
if (mouseButtonEvent.Pressed)
|
||||
{
|
||||
LastMousePressedPosition = mouseButtonEvent.Position;
|
||||
var battleActionMenuRect = new Rect2(BattleActionMenu!.Position, BattleActionMenu.Size);
|
||||
if (!battleActionMenuRect.HasPoint(LastMousePressedPosition))
|
||||
{
|
||||
BattleActionMenu.Visible = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowActionMenu(Vector2 position)
|
||||
{
|
||||
if (!BattleActionMenu!.Visible)
|
||||
{
|
||||
BattleActionMenu.Position = position;
|
||||
BattleActionMenu.Visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,89 +0,0 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dyyrp4px1km16"]
|
||||
|
||||
[ext_resource type="Script" path="res://Components/BattleHUD.cs" id="1_12a1x"]
|
||||
[ext_resource type="PackedScene" path="res://Components/SettingsMenuPopup.tscn" id="2_t66a0"]
|
||||
[ext_resource type="PackedScene" uid="uid://bktklsml5d0jg" path="res://Components/BattleActionMenu.tscn" id="3_0nyue"]
|
||||
|
||||
[node name="BattleHUD" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 1
|
||||
script = ExtResource("1_12a1x")
|
||||
|
||||
[node name="BattleTimeLabel" type="Label" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
offset_right = 41.0
|
||||
offset_bottom = 26.0
|
||||
text = "00:00"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="PauseBattleButton" type="Button" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -20.0
|
||||
offset_top = -23.0
|
||||
offset_right = 20.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
focus_mode = 0
|
||||
text = "按下 Space 暂停时间"
|
||||
|
||||
[node name="PauseMenuPopup" type="Popup" parent="."]
|
||||
unique_name_in_owner = true
|
||||
size = Vector2i(242, 306)
|
||||
borderless = false
|
||||
|
||||
[node name="PauseMenu" type="VBoxContainer" parent="PauseMenuPopup"]
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -86.0
|
||||
offset_top = -50.5
|
||||
offset_right = 86.0
|
||||
offset_bottom = 50.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
|
||||
[node name="ResumeBattleButton" type="Button" parent="PauseMenuPopup/PauseMenu"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "继续战斗"
|
||||
|
||||
[node name="SettingsMenuButton" type="Button" parent="PauseMenuPopup/PauseMenu"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "游戏设置"
|
||||
|
||||
[node name="EscapeFromBattleButton" type="Button" parent="PauseMenuPopup/PauseMenu"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "退出战斗"
|
||||
|
||||
[node name="SettingsMenuPopup" parent="." instance=ExtResource("2_t66a0")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
borderless = false
|
||||
|
||||
[node name="BattleActionMenu" parent="." instance=ExtResource("3_0nyue")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
anchors_preset = 0
|
||||
anchor_top = 0.0
|
||||
anchor_bottom = 0.0
|
||||
offset_top = 0.0
|
||||
offset_bottom = 31.0
|
||||
grow_vertical = 1
|
@ -1,35 +0,0 @@
|
||||
[gd_scene format=3 uid="uid://blobono0y4pqs"]
|
||||
|
||||
[node name="PreBattleMenu" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -20.0
|
||||
offset_top = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 20.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="PrepareForBattleButton" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "战前准备"
|
||||
|
||||
[node name="BeginBattleButton" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "开始战斗"
|
||||
|
||||
[node name="EscapeFromBattleButton" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "逃跑"
|
@ -1,7 +1,6 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public class GameSave
|
||||
public record class GameSave
|
||||
{
|
||||
public List<Character> Characters = new();
|
||||
}
|
||||
}
|
||||
|
@ -1,32 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public static class BattleGoals
|
||||
{
|
||||
public static readonly Goal<BattleContext> Escape = new()
|
||||
{
|
||||
Name = "保命要紧",
|
||||
BasePriority = -50
|
||||
};
|
||||
|
||||
public static readonly Goal<BattleContext> SelfRegulatory = new()
|
||||
{
|
||||
Name = "自律行动",
|
||||
BasePriority = 0
|
||||
};
|
||||
|
||||
public static readonly Goal<BattleContext> FollowOrder = new()
|
||||
{
|
||||
Name = "服从指令",
|
||||
BasePriority = 50
|
||||
};
|
||||
|
||||
public static List<Goal<BattleContext>> AllGoals()
|
||||
{
|
||||
return new() {
|
||||
Escape,
|
||||
SelfRegulatory,
|
||||
FollowOrder
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public static class Characters
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public abstract class Action
|
||||
{
|
||||
public string Name = string.Empty;
|
||||
|
||||
public ActionTargetTypes TargetType;
|
||||
|
||||
public List<IActionTarget> Targets = new();
|
||||
|
||||
public IActionTarget? Target => Targets.Count > 0 ? Targets[0] : null;
|
||||
}
|
||||
|
||||
public enum ActionTargetTypes
|
||||
{
|
||||
None,
|
||||
Single,
|
||||
Multiple
|
||||
}
|
||||
|
||||
public interface IActionTarget
|
||||
{
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public class Character
|
||||
{
|
||||
public string FamilyName = string.Empty;
|
||||
|
||||
public string GivenName = string.Empty;
|
||||
|
||||
public string Name => FamilyName + GivenName;
|
||||
|
||||
public int HealthPoint;
|
||||
|
||||
public int MaxHealthPoint;
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public abstract class Effect
|
||||
{
|
||||
public string Name = string.Empty;
|
||||
|
||||
public string Description = string.Empty;
|
||||
|
||||
public abstract void Perform(Character character);
|
||||
}
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public class Goal<TContext> where TContext : IGoalContext
|
||||
{
|
||||
public string Name = string.Empty;
|
||||
|
||||
public int BasePriority;
|
||||
|
||||
public List<GoalValidityModifier<TContext>> ValidityModifiers = new();
|
||||
|
||||
public List<GoalPriorityModifier<TContext>> PriorityModifiers = new();
|
||||
|
||||
public bool IsValid()
|
||||
{
|
||||
return ValidityModifiers.All(modifier => modifier.Execute());
|
||||
}
|
||||
|
||||
public int Priority()
|
||||
{
|
||||
return BasePriority + PriorityModifiers.Sum(modifier => modifier.Execute());
|
||||
}
|
||||
}
|
||||
|
||||
public interface IGoalContext
|
||||
{
|
||||
IList<Action> ListActions();
|
||||
}
|
||||
|
||||
public abstract class GoalModifier<TContext>
|
||||
{
|
||||
public string Name = string.Empty;
|
||||
|
||||
public TContext Context;
|
||||
|
||||
protected GoalModifier(TContext context)
|
||||
{
|
||||
Context = context;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class GoalValidityModifier<TContext> : GoalModifier<TContext>
|
||||
{
|
||||
protected GoalValidityModifier(TContext context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
public abstract bool Execute();
|
||||
}
|
||||
|
||||
public abstract class GoalPriorityModifier<TContext> : GoalModifier<TContext>
|
||||
{
|
||||
protected GoalPriorityModifier(TContext context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
public abstract int Execute();
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public class Plan
|
||||
{
|
||||
public readonly List<Action> Actions = new();
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public abstract class Planner<TContext> where TContext : IGoalContext
|
||||
{
|
||||
public TContext Context;
|
||||
|
||||
public Planner(TContext context)
|
||||
{
|
||||
Context = context;
|
||||
}
|
||||
|
||||
public abstract Plan MakePlan();
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CMSGame
|
||||
{
|
||||
public abstract class Skill
|
||||
{
|
||||
public string Name = string.Empty;
|
||||
|
||||
public List<Effect> Effects = new();
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CMSGame
|
||||
{
|
||||
public class Battle
|
||||
{
|
||||
public List<BattleParty> Parties = new();
|
||||
|
||||
public BattleParty Attacker;
|
||||
|
||||
public BattleParty Defender;
|
||||
|
||||
public BattleParty PlayerParty;
|
||||
|
||||
public Battle(BattleParty attacker, BattleParty defender, BattleParty playerParty)
|
||||
{
|
||||
Attacker = attacker;
|
||||
Defender = defender;
|
||||
PlayerParty = playerParty;
|
||||
}
|
||||
|
||||
public void Begin()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public class BattleCharacter
|
||||
{
|
||||
public List<Goal<BattleContext>> Goals = new();
|
||||
|
||||
public Character Character;
|
||||
|
||||
public BattleCharacter(Character character)
|
||||
{
|
||||
Character = character;
|
||||
EstablishGoals();
|
||||
}
|
||||
|
||||
private void EstablishGoals()
|
||||
{
|
||||
Goals = BattleGoals.AllGoals();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public class BattleContext : IGoalContext
|
||||
{
|
||||
public IList<Action> ListActions()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
/// <summary>
|
||||
/// 2D 战场
|
||||
/// </summary>
|
||||
public class BattleField
|
||||
{
|
||||
/// <summary>战场宽度</summary>
|
||||
public int Width = 20;
|
||||
|
||||
/// <summary>战场长度</summary>
|
||||
public int Length = 100;
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
/// <summary>
|
||||
/// 2D 战场坐标
|
||||
/// </summary>
|
||||
public class BattleFieldPosition
|
||||
{
|
||||
/// <summary>
|
||||
/// 坐标点相对于 2D 摄像机镜头所在竖直平面的距离
|
||||
/// </summary>
|
||||
public int Depth;
|
||||
|
||||
/// <summary>
|
||||
/// 坐标点相对于 2D 摄像机初始对准位置的偏移量
|
||||
/// </summary>
|
||||
public int Offset;
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CMSGame
|
||||
{
|
||||
public class BattleParty
|
||||
{
|
||||
public bool IsAttacker;
|
||||
|
||||
public bool IsDefender;
|
||||
|
||||
public bool IsPlayerParty;
|
||||
|
||||
public List<BattleCharacter> Characters = new();
|
||||
}
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public partial class BattleCharacterNode : CharacterBody3D
|
||||
{
|
||||
[Signal]
|
||||
public delegate void MousePressedEventHandler(Vector3 position);
|
||||
|
||||
[Export]
|
||||
public Texture SpriteTexture = new();
|
||||
|
||||
public BattleFieldPosition? BattleFieldPosition;
|
||||
|
||||
public Character? Character;
|
||||
|
||||
public Sprite3D? Sprite3D;
|
||||
|
||||
public Label3D? StatusLabel;
|
||||
|
||||
public int ActionPoint;
|
||||
|
||||
public double ActionPointGathering;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
this.GetUniqueNode(ref Sprite3D, nameof(Sprite3D));
|
||||
this.GetUniqueNode(ref StatusLabel, nameof(StatusLabel));
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
UpdateStatus(delta);
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
public void UpdateStatus(double delta)
|
||||
{
|
||||
ActionPointGathering += delta;
|
||||
ActionPoint += (int)ActionPointGathering / 10;
|
||||
ActionPointGathering %= 10;
|
||||
}
|
||||
|
||||
public void UpdateUI()
|
||||
{
|
||||
StatusLabel!.Text = $"HP {Character!.HealthPoint}/{Character.MaxHealthPoint}\nAP {ActionPoint}";
|
||||
}
|
||||
|
||||
public override void _InputEvent(Camera3D camera, InputEvent @event, Vector3 position, Vector3 normal, int shapeIdx)
|
||||
{
|
||||
if (@event is InputEventMouseButton mouseButtonEvent)
|
||||
{
|
||||
if (mouseButtonEvent.Pressed)
|
||||
{
|
||||
EmitSignal(SignalName.MousePressed, position);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dje5jk73mjb6a"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cnilysgmgw8n4" path="res://Temp/Characters/1_19.png" id="1_o3tjt"]
|
||||
[ext_resource type="Script" path="res://Nodes/BattleCharacterNode.cs" id="2_vbdi8"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_r28jb"]
|
||||
size = Vector3(0.84, 1.46, 0.17)
|
||||
|
||||
[node name="BattleCharacter" type="CharacterBody3D"]
|
||||
script = ExtResource("2_vbdi8")
|
||||
|
||||
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.23, 0)
|
||||
shape = SubResource("BoxShape3D_r28jb")
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
|
||||
shaded = true
|
||||
alpha_cut = 2
|
||||
texture = ExtResource("1_o3tjt")
|
||||
|
||||
[node name="StatusLabel" type="Label3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.74, 0)
|
||||
text = "状态标签"
|
||||
vertical_alignment = 2
|
||||
autowrap_mode = 3
|
@ -1,82 +1,6 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public partial class BattleScene : Node3D
|
||||
public partial class BattleScene : Node2D
|
||||
{
|
||||
public BattleHUD? HUD;
|
||||
|
||||
public Popup? PauseMenuPopup;
|
||||
|
||||
public Popup? SettingsMenuPopup;
|
||||
|
||||
public double Time;
|
||||
|
||||
public bool IsPause = false;
|
||||
|
||||
private bool IsPauseBeforePauseMenuPopup = false;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
this.GetUniqueNode(ref HUD, nameof(HUD));
|
||||
PauseMenuPopup = HUD!.PauseMenuPopup;
|
||||
SettingsMenuPopup = HUD.SettingsMenuPopup;
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (!IsPause)
|
||||
{
|
||||
Time += delta;
|
||||
}
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
public override void _UnhandledInput(InputEvent input)
|
||||
{
|
||||
if (input.IsActionPressed("battle_pause_toggle"))
|
||||
{
|
||||
TogglePauseBattle();
|
||||
}
|
||||
else if (input.IsActionPressed("battle_pause"))
|
||||
{
|
||||
ShowPauseMenu();
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateUI()
|
||||
{
|
||||
HUD!.BattleTimeLabel!.Text = TimeHelper.FormatTime(Time);
|
||||
}
|
||||
|
||||
private void TogglePauseBattle()
|
||||
{
|
||||
IsPause = !IsPause;
|
||||
}
|
||||
|
||||
private void ShowPauseMenu()
|
||||
{
|
||||
IsPauseBeforePauseMenuPopup = IsPause;
|
||||
IsPause = true;
|
||||
PauseMenuPopup!.PopupCentered();
|
||||
}
|
||||
|
||||
private void On_PauseBattleButton_Pressed()
|
||||
{
|
||||
TogglePauseBattle();
|
||||
}
|
||||
|
||||
private void On_PauseMenuPopup_PopupHide()
|
||||
{
|
||||
IsPause = IsPauseBeforePauseMenuPopup;
|
||||
}
|
||||
|
||||
private void On_ResumeBattleButton_Pressed()
|
||||
{
|
||||
PauseMenuPopup!.Hide();
|
||||
}
|
||||
|
||||
private void On_SettingsMenuButton_Pressed()
|
||||
{
|
||||
SettingsMenuPopup!.PopupCentered();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public partial class BattleSceneTest : Node3D
|
||||
{
|
||||
public BattleScene? BattleScene;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
BattleScene = GetNode<BattleScene>("BattleScene");
|
||||
}
|
||||
|
||||
public void On_BattleCharacter_MousePressed(Vector3 _)
|
||||
{
|
||||
BattleScene!.HUD!.ShowActionMenu(BattleScene.HUD.LastMousePressedPosition);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://dgi0d8jybvlk0"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cp6aa655vykt1" path="res://Scenes/BattleScene.tscn" id="1_fdqdi"]
|
||||
[ext_resource type="Script" path="res://Tests/BattleSceneTest.cs" id="1_tuul4"]
|
||||
[ext_resource type="PackedScene" uid="uid://dje5jk73mjb6a" path="res://Nodes/BattleCharacterNode.tscn" id="3_nau0d"]
|
||||
[ext_resource type="Texture2D" uid="uid://w6qckexp2he1" path="res://Temp/Characters/2_73.png" id="4_jnah0"]
|
||||
[ext_resource type="Texture2D" uid="uid://du6o3upum6lkr" path="res://Temp/Characters/3_0.png" id="5_4vahd"]
|
||||
[ext_resource type="Texture2D" uid="uid://cl11bl8lcnwha" path="res://Temp/Characters/4_2.png" id="6_6563q"]
|
||||
[ext_resource type="Texture2D" uid="uid://dc27ugd4sik7m" path="res://Temp/Characters/5_4.png" id="7_a35tl"]
|
||||
[ext_resource type="Texture2D" uid="uid://cl8nkrx2bk76n" path="res://Temp/Characters/6_1.png" id="8_oklwm"]
|
||||
[ext_resource type="Texture2D" uid="uid://ch0pdjtnr3y7r" path="res://Temp/Characters/7.png" id="9_wor4w"]
|
||||
|
||||
[node name="BattleSceneTest" type="Node3D"]
|
||||
script = ExtResource("1_tuul4")
|
||||
|
||||
[node name="BattleScene" parent="." instance=ExtResource("1_fdqdi")]
|
||||
|
||||
[node name="BattleCharacter" parent="BattleScene/Characters" index="0" instance=ExtResource("3_nau0d")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.1026, 0.524168, -2.96058)
|
||||
|
||||
[node name="BattleCharacter2" parent="BattleScene/Characters" index="1" instance=ExtResource("3_nau0d")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.25622, 0.524168, -2.87261)
|
||||
|
||||
[node name="Sprite3D" parent="BattleScene/Characters/BattleCharacter2" index="2"]
|
||||
texture = ExtResource("4_jnah0")
|
||||
|
||||
[node name="BattleCharacter3" parent="BattleScene/Characters" index="2" instance=ExtResource("3_nau0d")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.524168, -4.12488)
|
||||
|
||||
[node name="Sprite3D" parent="BattleScene/Characters/BattleCharacter3" index="2"]
|
||||
texture = ExtResource("5_4vahd")
|
||||
|
||||
[node name="BattleCharacter4" parent="BattleScene/Characters" index="3" instance=ExtResource("3_nau0d")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.737777, 0.524168, -3.35854)
|
||||
|
||||
[node name="Sprite3D" parent="BattleScene/Characters/BattleCharacter4" index="2"]
|
||||
texture = ExtResource("6_6563q")
|
||||
|
||||
[node name="BattleCharacter5" parent="BattleScene/Characters" index="4" instance=ExtResource("3_nau0d")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.6372, 0.524168, -3.47228)
|
||||
|
||||
[node name="Sprite3D" parent="BattleScene/Characters/BattleCharacter5" index="2"]
|
||||
texture = ExtResource("7_a35tl")
|
||||
|
||||
[node name="BattleCharacter6" parent="BattleScene/Characters" index="5" instance=ExtResource("3_nau0d")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.27585, 0.524168, -5.80874)
|
||||
|
||||
[node name="Sprite3D" parent="BattleScene/Characters/BattleCharacter6" index="2"]
|
||||
texture = ExtResource("8_oklwm")
|
||||
|
||||
[node name="BattleCharacter7" parent="BattleScene/Characters" index="6" instance=ExtResource("3_nau0d")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.44713, 0.524168, -12.3572)
|
||||
|
||||
[node name="Sprite3D" parent="BattleScene/Characters/BattleCharacter7" index="2"]
|
||||
texture = ExtResource("9_wor4w")
|
||||
|
||||
[editable path="BattleScene"]
|
||||
[editable path="BattleScene/Characters/BattleCharacter2"]
|
||||
[editable path="BattleScene/Characters/BattleCharacter3"]
|
||||
[editable path="BattleScene/Characters/BattleCharacter4"]
|
||||
[editable path="BattleScene/Characters/BattleCharacter5"]
|
||||
[editable path="BattleScene/Characters/BattleCharacter6"]
|
||||
[editable path="BattleScene/Characters/BattleCharacter7"]
|
@ -1,16 +0,0 @@
|
||||
namespace CMSGame
|
||||
{
|
||||
public static class GameSaves
|
||||
{
|
||||
public static readonly GameSave Demo1 = new()
|
||||
{
|
||||
Characters = new() {
|
||||
new Character {
|
||||
FamilyName = "腾",
|
||||
GivenName = "牧心",
|
||||
HealthPoint = 80
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
[gd_resource type="Theme" load_steps=2 format=3 uid="uid://cn55cr5w4yy3n"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://tfubgavtu25o" path="res://Assets/Fonts/Tiejili/TiejiliSC-Regular.otf" id="1_usckb"]
|
||||
|
||||
[resource]
|
||||
default_font = ExtResource("1_usckb")
|
||||
default_font_size = 32
|
@ -0,0 +1,9 @@
|
||||
[gd_resource type="AudioBusLayout" format=3 uid="uid://ca3y006advrdf"]
|
||||
|
||||
[resource]
|
||||
bus/1/name = &"Music"
|
||||
bus/1/solo = false
|
||||
bus/1/mute = false
|
||||
bus/1/bypass_fx = false
|
||||
bus/1/volume_db = 0.0
|
||||
bus/1/send = &"Master"
|
Loading…
Reference in new issue