Skip to content

Commit c3922dc

Browse files
authored
Merge pull request #192 from Tiagobuzzz/codex/expandir-sistemas-estéticos-com-novas-funções
2 parents 9bbd562 + 9299331 commit c3922dc

File tree

8 files changed

+73
-0
lines changed

8 files changed

+73
-0
lines changed

src/UltraWorldAI/DivineBeing.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class DivineBeing
3434
public string Appearance { get; set; } = string.Empty;
3535
public string SacredSymbol { get; set; } = string.Empty;
3636
public string Agenda { get; set; } = string.Empty;
37+
public string Mood { get; set; } = "Neutro";
3738
public Dictionary<string, float> Traits { get; } = new();
3839
public List<string> Demands { get; } = new();
3940
public List<string> Miracles { get; } = new();

src/UltraWorldAI/Module15/DynamicMusicSystem.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using UltraWorldAI.World;
5+
using UltraWorldAI;
46

57
namespace UltraWorldAI.Module15;
68

@@ -37,4 +39,16 @@ public static void CreateSong(string title, string composer, string emotion, flo
3739
.OrderByDescending(s => s.HarmonyComplexity + s.LyricalIntensity)
3840
.FirstOrDefault();
3941
}
42+
43+
public static void ApplyToCity(Song song, World.Settlement settlement)
44+
{
45+
settlement.Mood = song.EmotionalState;
46+
Console.WriteLine($"\uD83C\uDFBC {song.Title} afetou o humor de {settlement.Name} para {song.EmotionalState}");
47+
}
48+
49+
public static void ApplyToGod(Song song, DivineBeing god)
50+
{
51+
god.Mood = song.EmotionalState;
52+
Console.WriteLine($"\uD83C\uDFBC {song.Title} tocado para {god.Name} agora está com humor {song.EmotionalState}");
53+
}
4054
}

src/UltraWorldAI/Module15/InheritedStyleSystem.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,12 @@ public static void AddStyle(string culture, string symbol, List<string> traits)
2525

2626
Console.WriteLine($"\uD83E\uDDE6 Estilo herdado: {culture} | S\u00edmbolo: {symbol} | Influ\u00eancia: {string.Join(", ", traits)}");
2727
}
28+
public static void Inherit(string parent, string child)
29+
{
30+
var style = Styles.Find(s => s.Culture == parent);
31+
if (style != null)
32+
{
33+
AddStyle(child, style.AestheticSymbol, new List<string>(style.InfluencedTraits));
34+
}
35+
}
2836
}

src/UltraWorldAI/Module15/MagicalArtEffectSystem.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using UltraWorldAI.World;
34

45
namespace UltraWorldAI.Module15;
56

@@ -29,4 +30,14 @@ public static void CreateMagicalArt(string title, string creator, string medium,
2930

3031
Console.WriteLine($"\uD83E\uDD84 Arte m\u00e1gica: {title} | Efeito: {effect} | Ritual? {ritual}");
3132
}
33+
34+
public static void ApplyEffect(string title, string region)
35+
{
36+
var art = Artworks.Find(a => a.Title == title);
37+
if (art != null)
38+
{
39+
WorldImpactSystem.ApplyImpact(title, region, "cultura");
40+
Console.WriteLine($"\uD83E\uDD84 {title} afetou {region} com {art.Effect}");
41+
}
42+
}
3243
}

src/UltraWorldAI/World/RaceSettlementDistributor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class Settlement
1414
public int Population { get; set; }
1515
public int HousingUnits { get; set; }
1616
public string ArchitectureStyle { get; set; } = "Comum";
17+
public string Mood { get; set; } = "Neutro";
1718
}
1819

1920
public static class RaceSettlementDistributor

tests/UltraWorldAI.Tests/DynamicMusicSystemTests.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using UltraWorldAI.Module15;
2+
using UltraWorldAI.World;
3+
using UltraWorldAI;
24
using Xunit;
35

46
public class DynamicMusicSystemTests
@@ -10,4 +12,20 @@ public void CreateSongAddsSong()
1012
DynamicMusicSystem.CreateSong("Melodia", "Ana", "Feliz", 0.8f, 0.9f);
1113
Assert.Contains(DynamicMusicSystem.Songs, s => s.Title == "Melodia" && s.Composer == "Ana" && s.EmotionalState == "Feliz");
1214
}
15+
16+
[Fact]
17+
public void ApplySongChangesMoods()
18+
{
19+
DynamicMusicSystem.Songs.Clear();
20+
var song = new Song { Title = "Tristeza", Composer = "B", EmotionalState = "Triste" };
21+
DynamicMusicSystem.Songs.Add(song);
22+
var city = new UltraWorldAI.World.Settlement { Name = "Lira" };
23+
var god = new DivineBeing { Name = "Lumina" };
24+
25+
DynamicMusicSystem.ApplyToCity(song, city);
26+
DynamicMusicSystem.ApplyToGod(song, god);
27+
28+
Assert.Equal("Triste", city.Mood);
29+
Assert.Equal("Triste", god.Mood);
30+
}
1331
}

tests/UltraWorldAI.Tests/InheritedStyleSystemTests.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,13 @@ public void AddStyleRegistersStyle()
1111
InheritedStyleSystem.AddStyle("Tribo", "Simbolo", new List<string>{"Roupas"});
1212
Assert.Contains(InheritedStyleSystem.Styles, s => s.Culture == "Tribo" && s.AestheticSymbol == "Simbolo" && s.InfluencedTraits.Contains("Roupas"));
1313
}
14+
15+
[Fact]
16+
public void InheritCopiesParentStyle()
17+
{
18+
InheritedStyleSystem.Styles.Clear();
19+
InheritedStyleSystem.AddStyle("Pai", "Totem", new List<string>{"Música"});
20+
InheritedStyleSystem.Inherit("Pai", "Filho");
21+
Assert.Contains(InheritedStyleSystem.Styles, s => s.Culture == "Filho" && s.AestheticSymbol == "Totem");
22+
}
1423
}

tests/UltraWorldAI.Tests/MagicalArtEffectSystemTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using UltraWorldAI.Module15;
2+
using UltraWorldAI.World;
23
using Xunit;
34

45
public class MagicalArtEffectSystemTests
@@ -10,4 +11,14 @@ public void CreateMagicalArtAddsArtwork()
1011
MagicalArtEffectSystem.CreateMagicalArt("Obra", "Ana", "Escultura", "Curar", true);
1112
Assert.Contains(MagicalArtEffectSystem.Artworks, a => a.Title == "Obra" && a.Creator == "Ana" && a.RequiresRitual);
1213
}
14+
15+
[Fact]
16+
public void ApplyEffectRecordsImpact()
17+
{
18+
MagicalArtEffectSystem.Artworks.Clear();
19+
WorldImpactSystem.Impacts.Clear();
20+
MagicalArtEffectSystem.CreateMagicalArt("Sopro", "Ana", "Pintura", "Chuva", false);
21+
MagicalArtEffectSystem.ApplyEffect("Sopro", "Vale");
22+
Assert.Contains(WorldImpactSystem.Impacts, i => i.TechName == "Sopro" && i.Region == "Vale");
23+
}
1324
}

0 commit comments

Comments
 (0)