Line endings: LF everywhere

.gitattributes forces LF (CRLF only for .bat/.cmd), core.autocrlf is off;
files that differed only by CRLF are normalized.
This commit is contained in:
cthangover committed 2026-10-21 13:29:42 +02:00
1 parent 18616852e1
commit ad57e6e634
6 files changed
+1345 -1315

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
# Line endings: LF everywhere, on every OS, whatever core.autocrlf says.
* text=auto eol=lf
# cmd.exe misreads labels and goto in LF batch files, so they stay CRLF.
*.bat text eol=crlf
*.cmd text eol=crlf
# Binaries: never converted, never diffed as text.
*.png binary
*.jpg binary
*.jpeg binary
*.webp binary
*.svg text
*.ogg binary
*.wav binary
*.mp3 binary
*.ttf binary
*.otf binary
*.woff binary
*.woff2 binary
*.dll binary
*.so binary
*.dylib binary
*.pdb binary
*.exe binary
*.zip binary
*.pck binary
*.moc3 binary
*.res binary
*.scn binary
+37 -37
View File
@@ -1,37 +1,37 @@
# Godot 4.x # Godot 4.x
.godot/ .godot/
.idea/ .idea/
sdk/ sdk/
bin/ bin/
obj/ obj/
#ai #ai
.omo/ .omo/
.opencode/ .opencode/
gen/ gen/
obj/ obj/
bin/ bin/
*.tres~ *.tres~
*.tscn~ *.tscn~
# GDScript LSP # GDScript LSP
.godot/ .godot/
# Export # Export
*.exe *.exe
*.dmg *.dmg
*.apk *.apk
*.aab *.aab
*.pck *.pck
*.zip *.zip
*.log *.log
# OS # OS
.DS_Store .DS_Store
Thumbs.db Thumbs.db
# Editor # Editor
*.import *.import
*.godot.uid *.godot.uid
+56 -56
View File
@@ -1,56 +1,56 @@
using Cthangover.Core.Cards.StatusEffect; using Cthangover.Core.Cards.StatusEffect;
using Cthangover.Core.Characters; using Cthangover.Core.Characters;
using Cthangover.Core.Utils; using Cthangover.Core.Utils;
using Godot; using Godot;
namespace Cthangover.FFBattle.Actions namespace Cthangover.FFBattle.Actions
{ {
/// <summary> /// <summary>
/// Executes a physical attack action. Calculates damage as /// Executes a physical attack action. Calculates damage as
/// <c>action.Attack × user.Attack</c>, then routes through /// <c>action.Attack × user.Attack</c>, then routes through
/// <see cref="StatusEffectQueue.OnDealDamage"/> and /// <see cref="StatusEffectQueue.OnDealDamage"/> and
/// <see cref="StatusEffectQueue.OnTakeDamage"/> for status-effect /// <see cref="StatusEffectQueue.OnTakeDamage"/> for status-effect
/// hooks. Subtraction is applied defence-first: <see cref="CharacterAttributes.Defence"/> /// hooks. Subtraction is applied defence-first: <see cref="CharacterAttributes.Defence"/>
/// absorbs damage point-for-point before health is reduced. /// absorbs damage point-for-point before health is reduced.
/// Registered under ID <c>"physics/attack"</c>. /// Registered under ID <c>"physics/attack"</c>.
/// </summary> /// </summary>
public class FFDamageExecutor : ActionBase public class FFDamageExecutor : ActionBase
{ {
/// <summary>Hub registry key for this executor.</summary> /// <summary>Hub registry key for this executor.</summary>
public override string ID => "FFDamageExecutor"; public override string ID => "FFDamageExecutor";
/// <summary>Applies attack damage with status hooks and defence absorption; consumes the action's required points.</summary> /// <summary>Applies attack damage with status hooks and defence absorption; consumes the action's required points.</summary>
public override ChangedAttributes Execute(ActionCharacter action, Character user, Character target) public override ChangedAttributes Execute(ActionCharacter action, Character user, Character target)
{ {
if (target == null || user == null || !CheckRequiredAndUsePoint(action, user)) if (target == null || user == null || !CheckRequiredAndUsePoint(action, user))
return new ChangedAttributes { Result = false }; return new ChangedAttributes { Result = false };
var damageDelta = Mathf.RoundToInt(action.GetFloat("Attack", 1f) * user.Attributes.Attack.Value); var damageDelta = Mathf.RoundToInt(action.GetFloat("Attack", 1f) * user.Attributes.Attack.Value);
StatusEffectService.Of(target).OnTakeDamage(user, ref damageDelta); StatusEffectService.Of(target).OnTakeDamage(user, ref damageDelta);
StatusEffectService.Of(user).OnDealDamage(target, ref damageDelta); StatusEffectService.Of(user).OnDealDamage(target, ref damageDelta);
var defenceDelta = 0; var defenceDelta = 0;
var ignoreArmor = user.HasPassiveEffect("IgnoreArmor"); var ignoreArmor = user.HasPassiveEffect("IgnoreArmor");
if (!ignoreArmor && target.Attributes.Defence.Value > 0) if (!ignoreArmor && target.Attributes.Defence.Value > 0)
{ {
defenceDelta = target.Attributes.Defence.Value >= damageDelta defenceDelta = target.Attributes.Defence.Value >= damageDelta
? damageDelta ? damageDelta
: target.Attributes.Defence.Value; : target.Attributes.Defence.Value;
damageDelta -= defenceDelta; damageDelta -= defenceDelta;
} }
target.Attributes.Defence.Value -= defenceDelta; target.Attributes.Defence.Value -= defenceDelta;
target.Attributes.Health.Value -= damageDelta; target.Attributes.Health.Value -= damageDelta;
GameLogger.Log("FF_BATTLE", GameLogger.Log("FF_BATTLE",
$"{user.Name} attacks {target.Name}: damage={damageDelta} defence={defenceDelta}", $"{user.Name} attacks {target.Name}: damage={damageDelta} defence={defenceDelta}",
LogLevel.Debug); LogLevel.Debug);
return new ChangedAttributes return new ChangedAttributes
{ {
Result = true, Result = true,
Target = { Damage = damageDelta, Defence = -defenceDelta } Target = { Damage = damageDelta, Defence = -defenceDelta }
}; };
} }
} }
} }
+34 -34
View File
@@ -1,34 +1,34 @@
using Cthangover.Core.Characters; using Cthangover.Core.Characters;
using Cthangover.Core.Utils; using Cthangover.Core.Utils;
namespace Cthangover.FFBattle.Actions namespace Cthangover.FFBattle.Actions
{ {
/// <summary> /// <summary>
/// Executes a defensive action (buff/barrier). Increases the target's /// Executes a defensive action (buff/barrier). Increases the target's
/// <see cref="CharacterAttributes.Defence"/> by the value stored in /// <see cref="CharacterAttributes.Defence"/> by the value stored in
/// the <c>"Defence"</c> property on the action (default 4). /// the <c>"Defence"</c> property on the action (default 4).
/// Defence acts as a shield against incoming physical damage in the /// Defence acts as a shield against incoming physical damage in the
/// <see cref="FFDamageExecutor"/>. Registered under ID <c>"physics/defence"</c>. /// <see cref="FFDamageExecutor"/>. Registered under ID <c>"physics/defence"</c>.
/// </summary> /// </summary>
public class FFDefenceExecutor : ActionBase public class FFDefenceExecutor : ActionBase
{ {
/// <summary>Hub registry key for this executor.</summary> /// <summary>Hub registry key for this executor.</summary>
public override string ID => "FFDefenceExecutor"; public override string ID => "FFDefenceExecutor";
/// <summary>Adds the action's "Defence" value (default 4) to the target's defence shield.</summary> /// <summary>Adds the action's "Defence" value (default 4) to the target's defence shield.</summary>
public override ChangedAttributes Execute(ActionCharacter action, Character user, Character target) public override ChangedAttributes Execute(ActionCharacter action, Character user, Character target)
{ {
if (target == null || user == null || !CheckRequiredAndUsePoint(action, user)) if (target == null || user == null || !CheckRequiredAndUsePoint(action, user))
return new ChangedAttributes { Result = false }; return new ChangedAttributes { Result = false };
var defenceDelta = action.GetInt("Defence", 4); var defenceDelta = action.GetInt("Defence", 4);
target.Attributes.Defence.Value += defenceDelta; target.Attributes.Defence.Value += defenceDelta;
GameLogger.Log("FF_BATTLE", GameLogger.Log("FF_BATTLE",
$"{user.Name} defends → +{defenceDelta} defence for {target?.Name}", $"{user.Name} defends → +{defenceDelta} defence for {target?.Name}",
LogLevel.Debug); LogLevel.Debug);
return new ChangedAttributes { Result = true, Target = { Defence = defenceDelta } }; return new ChangedAttributes { Result = true, Target = { Defence = defenceDelta } };
} }
} }
} }
+37 -37
View File
@@ -1,37 +1,37 @@
using Cthangover.Core.Cards.StatusEffect; using Cthangover.Core.Cards.StatusEffect;
using Cthangover.Core.Characters; using Cthangover.Core.Characters;
using Cthangover.Core.Utils; using Cthangover.Core.Utils;
namespace Cthangover.FFBattle.Actions namespace Cthangover.FFBattle.Actions
{ {
/// <summary> /// <summary>
/// Applies a stun status effect to the target for a configurable number of turns. /// Applies a stun status effect to the target for a configurable number of turns.
/// Reads the turn count from the <c>"Turn"</c> property on the action (default 3). /// Reads the turn count from the <c>"Turn"</c> property on the action (default 3).
/// Stunned characters are skipped during turn iteration in /// Stunned characters are skipped during turn iteration in
/// <see cref="FFBattleCore.TryNextCharacterOrEndTurn"/> and /// <see cref="FFBattleCore.TryNextCharacterOrEndTurn"/> and
/// <see cref="FFBattleCore.RunEnemyTurn"/>. Registered under ID <c>"physics/stun"</c>. /// <see cref="FFBattleCore.RunEnemyTurn"/>. Registered under ID <c>"physics/stun"</c>.
/// </summary> /// </summary>
public class FFStunExecutor : ActionBase public class FFStunExecutor : ActionBase
{ {
/// <summary>Hub registry key for this executor.</summary> /// <summary>Hub registry key for this executor.</summary>
public override string ID => "FFStunExecutor"; public override string ID => "FFStunExecutor";
/// <summary>Adds the stun effect for the action's "Turn" count (default 3); stun-immune targets consume the points but stay un-stunned.</summary> /// <summary>Adds the stun effect for the action's "Turn" count (default 3); stun-immune targets consume the points but stay un-stunned.</summary>
public override ChangedAttributes Execute(ActionCharacter action, Character user, Character target) public override ChangedAttributes Execute(ActionCharacter action, Character user, Character target)
{ {
if (target == null || user == null || !CheckRequiredAndUsePoint(action, user)) if (target == null || user == null || !CheckRequiredAndUsePoint(action, user))
return new ChangedAttributes { Result = false }; return new ChangedAttributes { Result = false };
if (target.HasPassiveEffect("StunImmune")) if (target.HasPassiveEffect("StunImmune"))
return new ChangedAttributes { Result = true }; return new ChangedAttributes { Result = true };
var turns = action.GetInt("Turn", 3); var turns = action.GetInt("Turn", 3);
StatusEffectService.Of(target).Add("effect/physics/stun", turns); StatusEffectService.Of(target).Add("effect/physics/stun", turns);
GameLogger.Log("FF_BATTLE", GameLogger.Log("FF_BATTLE",
$"{user.Name} stuns {target.Name} for {turns} turns", $"{user.Name} stuns {target.Name} for {turns} turns",
LogLevel.Debug); LogLevel.Debug);
return new ChangedAttributes { Result = true }; return new ChangedAttributes { Result = true };
} }
} }
} }
+1151 -1151
View File
File diff suppressed because it is too large. Load diff