Skip to content

Commit

Permalink
.gitattribファイルでの改行コードの指定が間違っていた
Browse files Browse the repository at this point in the history
csファイルの改行コードをlfに変更
シーン内でノードの参照を行うとエクスポート時に参照が失われる場合がったため、できるだけ参照を行わないように変更した
v1.2.2
  • Loading branch information
SHIRAISHI authored and SHIRAISHI committed Nov 10, 2024
1 parent cbe0001 commit 7de9d77
Show file tree
Hide file tree
Showing 57 changed files with 485 additions and 557 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.cs text eol=crlf diff=csharp
*.cs text eol=lf diff=csharp

*.import text eol=lf
*.tscn text eol=lf
Expand Down
16 changes: 8 additions & 8 deletions Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"profiles": {
"godot debug": {
"commandName": "Executable",
"executablePath": "C:\\Programs\\Godot_v4.3-stable_mono_win64\\Godot_v4.3-stable_mono_win64.exe",
"commandLineArgs": "-path --verbose",
"workingDirectory": ".",
"nativeDebugging": false
}
"godot debug": {
"commandName": "Executable",
"executablePath": "C:\\Programs\\Godot_v4.3-stable_mono_win64\\Godot_v4.3-stable_mono_win64.exe",
"commandLineArgs": "-path --verbose",
"workingDirectory": ".",
"nativeDebugging": false
}
}
}
}
20 changes: 3 additions & 17 deletions command/StageEntryPoint.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Godot;
using tmfos.door;
using tmfos.mob;
using tmfos.player;
using tmfos.stage;
using tmfos.trigger;

namespace tmfos.command;

Expand All @@ -24,12 +24,6 @@ public partial class StageEntryPoint : Node2D
[Export]
public DirectionType Direction { get; set; } = DirectionType.Left;

/// <summary>
/// 開始時に停止するトリガー
/// </summary>
[Export]
public TriggerArea2D CommandTrigger { get; set; }

public override void _Ready()
{
base._Ready();
Expand All @@ -45,17 +39,9 @@ public void SetPlayerStartPosition(Player player)
player.Direction = Direction;
player.Position = GlobalPosition;

if (CommandTrigger is not null)
{
CommandTrigger.Disable = true;
}
}

public void EnableCollidableArea(Area2D node)
{
if (node is EventFinder finder && finder.EventNode2D is Player)
if (GetParent() is Warp warp)
{
CommandTrigger.Disable = false;
warp.DisableWarp();
}
}
}
11 changes: 3 additions & 8 deletions command/UpdateSavePointDoorNoCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,12 @@ public partial class UpdateSavePointDoorNoCommand : CommandNode
[Export]
public int DestDoorNo { get; set; }

[Export]
public SavePoint ParentSavePoint { get; set; }

public override void DoCommand(Node node, bool flag)
{
if (ParentSavePoint is null)
if (GetParent() is SavePoint savePoint)
{
return;
StageData stageData = GetNode<GameData>("/root/GameData").GetStageData();
stageData.DoorNo = savePoint.DoorNo;
}

StageData stageData = GetNode<GameData>("/root/GameData").GetStageData();
stageData.DoorNo = ParentSavePoint.DoorNo;
}
}
4 changes: 1 addition & 3 deletions command/change_tentacle_head_target_command.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@

[ext_resource type="Script" path="res://command/ChangeTentacleHeadTargetCommand.cs" id="1_53cfg"]

[node name="ChangeTentacleHeadTargetCommand" type="Node" node_paths=PackedStringArray("Head", "Target")]
[node name="ChangeTentacleHeadTargetCommand" type="Node"]
script = ExtResource("1_53cfg")
Head = NodePath("")
Target = NodePath("")
1 change: 0 additions & 1 deletion command/light.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ script = ExtResource("1_6dydd")

[node name="PointLight2D" type="PointLight2D" parent="."]
visible = false
energy = 0.3
blend_mode = 2
texture = ExtResource("2_1vioq")

Expand Down
2 changes: 1 addition & 1 deletion command/reset_timer_command.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=2 format=3 uid="uid://1hg3jp42rmmj"]
[gd_scene load_steps=2 format=3 uid="uid://dnubvgc50546i"]

[ext_resource type="Script" path="res://command/ResetTimerTriggerCommand.cs" id="1_mjqmf"]

Expand Down
25 changes: 25 additions & 0 deletions door/Warp.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Godot;
using tmfos.player;
using tmfos.trigger;

namespace tmfos.door;

/// <summary>
/// ステージ間移動の出入り口
/// </summary>
public partial class Warp : Gateway
{
public void EnableWarp(Area2D node)
{
if (node is EventFinder finder && finder.EventNode2D is Player)
{
Disable = false;
}
}

internal void DisableWarp()
{
Disable = true;
_ = Connect(Area2D.SignalName.AreaExited, new Callable(this, MethodName.EnableWarp));
}
}
3 changes: 1 addition & 2 deletions door/save_point.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ SeName = "save_point"

[node name="ResetPlayerLifeTimeCommand" parent="." instance=ExtResource("7_6s2y6")]

[node name="UpdateSavePointDoorNoCommand" parent="." node_paths=PackedStringArray("ParentSavePoint") instance=ExtResource("8_b2nrd")]
ParentSavePoint = NodePath("")
[node name="UpdateSavePointDoorNoCommand" parent="." instance=ExtResource("8_b2nrd")]

[node name="StateSaveCommand" parent="." instance=ExtResource("8_0kbx6")]

Expand Down
9 changes: 3 additions & 6 deletions door/transparency_warp.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene load_steps=6 format=3 uid="uid://0k7eapnlceja"]

[ext_resource type="Script" path="res://door/Gateway.cs" id="1_ujfy7"]
[ext_resource type="Script" path="res://door/Warp.cs" id="1_kr7d6"]
[ext_resource type="PackedScene" uid="uid://dvyr6w1fjtr25" path="res://command/stage_entry_point.tscn" id="2_i7qoi"]
[ext_resource type="PackedScene" uid="uid://ctmg15jks4p00" path="res://command/save_player_life_time_command.tscn" id="7_sdqdb"]
[ext_resource type="PackedScene" uid="uid://colbvavuo7wh" path="res://command/change_stage_command.tscn" id="9_s0c5a"]
Expand All @@ -10,18 +10,15 @@
[node name="TransparencyWarp" type="Area2D"]
collision_layer = 65536
collision_mask = 32768
script = ExtResource("1_ujfy7")
script = ExtResource("1_kr7d6")
Stateful = false
OneTime = false

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_lhsey")

[node name="StageEntryPoint" parent="." node_paths=PackedStringArray("CommandTrigger") instance=ExtResource("2_i7qoi")]
CommandTrigger = NodePath("..")
[node name="StageEntryPoint" parent="." instance=ExtResource("2_i7qoi")]

[node name="SavePlayerLifeTimeCommand" parent="." instance=ExtResource("7_sdqdb")]

[node name="ChangeStageCommand" parent="." instance=ExtResource("9_s0c5a")]

[connection signal="area_exited" from="." to="StageEntryPoint" method="EnableCollidableArea"]
13 changes: 13 additions & 0 deletions enemy/DragonHeadEnemy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace tmfos.enemy;

/// <summary>
/// 竜の頭敵
/// </summary>
public partial class DragonHeadEnemy : PathFollowEnemy
{
public override void Damaged()
{

base.Damaged();
}
}
12 changes: 6 additions & 6 deletions enemy/EroMaidEnemy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ namespace tmfos.enemy;
/// </summary>
public partial class EroMaidEnemy : Enemy
{
[Export]
public Node2D EntryPoints { get; set; }

private Node2D _entryPoint;
private bool _lastOnFloor;
private int _entryCount = 0;
private int _drillCount = 0;
Expand All @@ -21,10 +19,12 @@ public partial class EroMaidEnemy : Enemy
public override void _Ready()
{
base._Ready();
// todo: グループのほうがいいかも?
_entryPoint = GetNode<Node2D>("%EntryPoint");
GetNode<TextureProgressBar>("%HUD/BossLife").MaxValue = Life;
GetNode<TextureProgressBar>("%HUD/BossLife").Value = Life;
_marker = GetNode<Marker2D>("ExcitationtMarker2D");
_entryCount = EntryPoints is null ? 0 : EntryPoints.GetChildCount();
_entryCount = _entryPoint is null ? 0 : _entryPoint.GetChildCount();
}

public override void InitializeNode()
Expand Down Expand Up @@ -84,7 +84,7 @@ private Vector2 NormalAction(double delta, Vector2 velocity)
public override void RemoveNode()
{
// 死亡時は除去される
if (MobState is MobStateType.Dead || EntryPoints is null)
if (MobState is MobStateType.Dead || _entryPoint is null)
{
base.RemoveNode();
return;
Expand Down Expand Up @@ -136,7 +136,7 @@ public void Warp()
{
Velocity = Vector2.Zero;
RandomNumberGenerator random = new();
Marker2D point = EntryPoints.GetNode<Marker2D>(string.Format("Marker2D{0:#}", random.RandiRange(1, _entryCount)));
Marker2D point = _entryPoint.GetNode<Marker2D>(string.Format("Marker2D{0:#}", random.RandiRange(1, _entryCount)));
Position = point.GlobalPosition;
Direction = Lib.GetLRDirection(Position, m_player.Position);
_shot = random.RandiRange(1, 4) == 1;
Expand Down
21 changes: 10 additions & 11 deletions enemy/MaidRobot1Enemy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,23 @@ public partial class MaidRobot1Enemy : Enemy
[Export]
public float ShotWait { get; set; } = 1.5f;

[Export]
public Node2D EntryPoints { get; set; }

[Export]
public Node2D DrillPoints { get; set; }

private Node2D _entryPoint;
private Node2D _drillPoint;
private bool _lastOnFloor;
private int _entryCount = 0;
private int _drillCount = 0;

public override void _Ready()
{
base._Ready();
// todo: グループのほうがいいかも?
_entryPoint = GetNode<Node2D>("%EntryPoint");
_drillPoint = GetNode<Node2D>("%DrillPoint");
_entryCount = _entryPoint is null ? 0 : _entryPoint.GetChildCount();
_drillCount = _drillPoint is null ? 0 : _drillPoint.GetChildCount();
GetNode<Timer>("DrillTimer").WaitTime = ShotWait;
GetNode<TextureProgressBar>("%HUD/BossLife").MaxValue = Life;
GetNode<TextureProgressBar>("%HUD/BossLife").Value = Life;
_entryCount = EntryPoints is null ? 0 : EntryPoints.GetChildCount();
_drillCount = DrillPoints is null ? 0 : DrillPoints.GetChildCount();
}

public override void InitializeNode()
Expand Down Expand Up @@ -92,7 +91,7 @@ private Vector2 NormalAction(double delta, Vector2 velocity)
public override void RemoveNode()
{
// 死亡時は除去される
if (MobState is MobStateType.Dead || EntryPoints is null)
if (MobState is MobStateType.Dead || _entryPoint is null)
{
GetNode<MaidRobot2Enemy>("../MaidRobot2Enemy").Start();
base.RemoveNode();
Expand All @@ -101,7 +100,7 @@ public override void RemoveNode()

// 画面外に出たがまだ死んではいないので復帰させる
RandomNumberGenerator random = new();
Marker2D point = EntryPoints.GetNode<Marker2D>(string.Format("Marker2D{0:#}", random.RandiRange(1, _entryCount)));
Marker2D point = _entryPoint.GetNode<Marker2D>(string.Format("Marker2D{0:#}", random.RandiRange(1, _entryCount)));
Position = point.GlobalPosition;
Direction = Lib.GetLRDirection(Position, m_player.Position);
ChangeSprite("walk", Direction);
Expand All @@ -113,7 +112,7 @@ public void ShotDrill()

for (int i = 0; i < 3; i++)
{
DrillPoints.GetNode<EnemySpawner>($"DrillShot{random.RandiRange(1, _drillCount)}").SpawnEnemy();
_drillPoint.GetNode<EnemySpawner>($"DrillShot{random.RandiRange(1, _drillCount)}").SpawnEnemy();
}
}

Expand Down
19 changes: 9 additions & 10 deletions enemy/MaidRobot2Enemy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ public partial class MaidRobot2Enemy : Enemy
[Export]
public float JumpWait { get; set; } = 3f;

[Export]
public Node2D EntryPoints { get; set; }

[Export]
public Node2D DrillPoints { get; set; }

private Node2D _bigEntryPoint;
private Node2D _bigDrillPoint;
private bool _lastOnFloor;
private int _entryCount = 0;
private int _drillCount = 0;
Expand All @@ -30,10 +26,13 @@ public partial class MaidRobot2Enemy : Enemy
public override void _Ready()
{
base._Ready();
// todo: グループのほうがいいかも?
_bigEntryPoint = GetNode<Node2D>("%BigEntryPoint");
_bigDrillPoint = GetNode<Node2D>("%BigDrillPoint");
_entryCount = _bigEntryPoint is null ? 0 : _bigEntryPoint.GetChildCount();
_drillCount = _bigDrillPoint is null ? 0 : _bigDrillPoint.GetChildCount();
GetNode<Timer>("DrillTimer").WaitTime = ShotWait;
GetNode<Timer>("JumpTimer").WaitTime = JumpWait;
_entryCount = EntryPoints is null ? 0 : EntryPoints.GetChildCount();
_drillCount = DrillPoints is null ? 0 : DrillPoints.GetChildCount();
}

public override void InitializeNode()
Expand Down Expand Up @@ -97,7 +96,7 @@ public void ShotDrill()
return;
}

DrillPoints.GetNode<EnemySpawner>($"DrillShot{drill}").SpawnEnemy();
_bigDrillPoint.GetNode<EnemySpawner>($"DrillShot{drill}").SpawnEnemy();
}

public override void Dead()
Expand Down Expand Up @@ -139,7 +138,7 @@ public void Respawn()
Velocity = Vector2.Zero;
RandomNumberGenerator random = new();
_entryPoint = random.RandiRange(3, 2 + _entryCount);
Marker2D point = EntryPoints.GetNode<Marker2D>(string.Format("Marker2D{0:#}", _entryPoint));
Marker2D point = _bigEntryPoint.GetNode<Marker2D>(string.Format("Marker2D{0:#}", _entryPoint));
Position = point.GlobalPosition;
}
}
13 changes: 0 additions & 13 deletions enemy/PathFollowEnemy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ public partial class PathFollowEnemy : DurableShot
[Export]
public string FlyingSe { get; set; }

[Export]
public bool DamagedExecCommand { get; set; } = false;

private Vector2 _velocity = Vector2.Zero;
private Vector2 _lastPosition;
private Vector2 _deadPosition;
Expand Down Expand Up @@ -180,14 +177,4 @@ public override void Timeup()
_velocity = Vector2.Zero;
SetCollisionMaskValue(4, false);
}

public override void Damaged()
{
base.Damaged();

if (DamagedExecCommand)
{
Lib.ExecCommands(this, null, true);
}
}
}
Loading

0 comments on commit 7de9d77

Please sign in to comment.