Compare commits

..

No commits in common. 'develop' and 'feature/farm_fight_loop' have entirely different histories.

@ -14,9 +14,5 @@ position = Vector2(23, -96)
scale = Vector2(0.547474, 0.547474) scale = Vector2(0.547474, 0.547474)
texture = SubResource("AtlasTexture_ane0o") texture = SubResource("AtlasTexture_ane0o")
[node name="CollisionShape2D" parent="TargetSelection/Click" index="0"]
position = Vector2(25.215, -195)
scale = Vector2(0.72370636, 1)
[node name="Sprite2D" parent="TargetSelection/HoverIndicator" index="0"] [node name="Sprite2D" parent="TargetSelection/HoverIndicator" index="0"]
position = Vector2(0.84, -126) position = Vector2(1, -126)

@ -186,8 +186,8 @@ directories/tres_directory={
[display] [display]
window/size/viewport_width=1920 window/size/viewport_width=1980
window/size/viewport_height=1080 window/size/viewport_height=1020
window/stretch/mode="viewport" window/stretch/mode="viewport"
window/stretch/aspect="keep_height" window/stretch/aspect="keep_height"

@ -12,7 +12,6 @@ public class TargetSelectActionDetail : FighterAction.FighterActionDetail
// settings // settings
public required bool selectEnemy; public required bool selectEnemy;
public required bool selectAlly; public required bool selectAlly;
public required bool aliveOnly;
public VisualRange visualRange = VisualRange.Single; public VisualRange visualRange = VisualRange.Single;
// result // result

@ -13,8 +13,7 @@ public class AllyAttackAction : FighterAction
public TargetSelectActionDetail targetSelect = new() public TargetSelectActionDetail targetSelect = new()
{ {
selectEnemy = true, selectEnemy = true,
selectAlly = false, selectAlly = false
aliveOnly = true
}; };
public MinigameActionDetail minigameDetail = new(); public MinigameActionDetail minigameDetail = new();

@ -117,13 +117,11 @@ public partial class AllFightersVisual : Node
if (targetDetail.selectEnemy) if (targetDetail.selectEnemy)
_fighterVisuals _fighterVisuals
.Where(kv => kv.Key.IsInFormation(HappeningData.enemyFighterFormation)) .Where(kv => kv.Key.IsInFormation(HappeningData.enemyFighterFormation))
.Where(kv => !targetDetail.aliveOnly || kv.Key.IsAlive())// if aliveOnly: take where IsAlive
.ForEach(kv => kv.Value.SetTargetSelectionActive(true)); .ForEach(kv => kv.Value.SetTargetSelectionActive(true));
if (targetDetail.selectAlly) if (targetDetail.selectAlly)
_fighterVisuals _fighterVisuals
.Where(kv => kv.Key.IsInFormation(HappeningData.allyFighterFormation)) .Where(kv => kv.Key.IsInFormation(HappeningData.allyFighterFormation))
.Where(kv => !targetDetail.aliveOnly || kv.Key.IsAlive())// if aliveOnly: take where IsAlive
.ForEach(kv => kv.Value.SetTargetSelectionActive(true)); .ForEach(kv => kv.Value.SetTargetSelectionActive(true));
} }

@ -307,11 +307,6 @@ public partial class FightHappening : Node
HappeningData.enemyFighterFormation.SetFighterAtPosition(emptySlotIndex, fighter); HappeningData.enemyFighterFormation.SetFighterAtPosition(emptySlotIndex, fighter);
HappeningData.fighterTurn.AddAsLast(fighter); HappeningData.fighterTurn.AddAsLast(fighter);
} }
if (GD.RandRange(0, 2) != 0) // 2/3 chance for vesna to start
{
HappeningData.fighterTurn.SpinBack();
}
} }
private void ExecuteNextFighter() private void ExecuteNextFighter()

@ -99,23 +99,6 @@ public class FighterTurn : IEnumerable<FightWorld.Fighter>
return false; return false;
} }
/// <summary>
/// Sets the current one back
/// This is an expensive operation, because the entire data structure needs to be circled
/// </summary>
public void SpinBack()
{
if (_currentNode == null) return;
var node = _currentNode;
while (node.next != _currentNode)
{
node = node.next;
}
_currentNode = node;
}
public IEnumerator<FightWorld.Fighter> GetEnumerator() public IEnumerator<FightWorld.Fighter> GetEnumerator()
{ {
if (_currentNode == null) return Enumerable.Empty<FightWorld.Fighter>().GetEnumerator(); if (_currentNode == null) return Enumerable.Empty<FightWorld.Fighter>().GetEnumerator();

@ -9,15 +9,9 @@ public partial class SwitchSceneOnFightEnd : Node
public void OnFightStateEnter(FightHappening.FightState to) public void OnFightStateEnter(FightHappening.FightState to)
{ {
if (to is FightHappening.FightState.PlayerWin ) if (to is FightHappening.FightState.PlayerWin
or FightHappening.FightState.EnemyWin)
_ = SwitchSceneAfterTime(2.0f); _ = SwitchSceneAfterTime(2.0f);
if (to is FightHappening.FightState.EnemyWin)
{
_fightSceneSwitcher.ExitFight();
_fightSceneSwitcher.ExitFightWorld();
}
} }
private async Task SwitchSceneAfterTime(float seconds) private async Task SwitchSceneAfterTime(float seconds)

Loading…
Cancel
Save