Skip to content

Commit 50666b2

Browse files
authored
Merge pull request #206 from Tiagobuzzz/codex/adicionar-novos-sistemas-religiosos-e-fanáticos
2 parents b28749f + ef1267e commit 50666b2

File tree

6 files changed

+168
-0
lines changed

6 files changed

+168
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
namespace UltraWorldAI.Religion;
5+
6+
public static class FaithReactivitySystem
7+
{
8+
public static readonly Dictionary<string, float> FanaticismByCulture = new();
9+
10+
public static void RegisterMiracle(string culture)
11+
{
12+
if (!FanaticismByCulture.ContainsKey(culture))
13+
FanaticismByCulture[culture] = 0f;
14+
15+
FanaticismByCulture[culture] += 0.25f;
16+
17+
if (FanaticismByCulture[culture] >= 1f)
18+
{
19+
Console.WriteLine($"\u26A0\uFE0F ALERTA: Fanatismo extremo em {culture} \u2192 comportamento radicalizado, inquisi\u00e7\u00f5es ou cruzadas poss\u00edveis.");
20+
}
21+
else
22+
{
23+
Console.WriteLine($"\uD83D\uDE96 {culture} se torna mais fervorosa ap\u00f3s testemunhar um milagre.");
24+
}
25+
}
26+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
namespace UltraWorldAI.Religion;
5+
6+
public enum ProphetStatus
7+
{
8+
Vivo,
9+
Martir,
10+
Venerado,
11+
Santo
12+
}
13+
14+
public class Prophet
15+
{
16+
public string Name = string.Empty;
17+
public string Culture = string.Empty;
18+
public ProphetStatus Status = ProphetStatus.Vivo;
19+
public int MiraclesPerformed;
20+
public int PersecutionLevel;
21+
}
22+
23+
public static class ProphetSystem
24+
{
25+
public static readonly List<Prophet> AllProphets = new();
26+
27+
public static void RegisterProphet(string name, string culture)
28+
{
29+
AllProphets.Add(new Prophet { Name = name, Culture = culture });
30+
}
31+
32+
public static void UpdateProphetStatus(Prophet prophet)
33+
{
34+
if (prophet.Status == ProphetStatus.Martir && prophet.MiraclesPerformed >= 3)
35+
{
36+
prophet.Status = ProphetStatus.Venerado;
37+
}
38+
else if (prophet.MiraclesPerformed >= 6)
39+
{
40+
prophet.Status = ProphetStatus.Santo;
41+
}
42+
else if (prophet.PersecutionLevel > 5)
43+
{
44+
prophet.Status = ProphetStatus.Martir;
45+
}
46+
47+
Console.WriteLine($"\uD83D\uDD2E {prophet.Name} agora \u00e9 reconhecido como: {prophet.Status}");
48+
}
49+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using UltraWorldAI.Territory;
4+
5+
namespace UltraWorldAI.Religion;
6+
7+
public class HolyArtifact
8+
{
9+
public string Name = string.Empty;
10+
public string Effect = string.Empty;
11+
public string Origin = string.Empty;
12+
public bool IsHeresy;
13+
}
14+
15+
public static class SacredSystem
16+
{
17+
public static readonly List<HolyArtifact> Artifacts = new();
18+
19+
public static void CreateArtifact(string name, string effect, string origin, bool isHeresy = false)
20+
{
21+
Artifacts.Add(new HolyArtifact
22+
{
23+
Name = name,
24+
Effect = effect,
25+
Origin = origin,
26+
IsHeresy = isHeresy
27+
});
28+
29+
Console.WriteLine($"\uD83D\uDD11 Artefato {(isHeresy ? "her\u00e9tico" : "sagrado")} criado: {name} \u2192 {effect}");
30+
}
31+
32+
public static void DesignatePilgrimageSite(string name, string location)
33+
{
34+
Console.WriteLine($"\uD83D\uDEB6 Local de peregrina\u00e7\u00e3o criado: {name} em {location}");
35+
SacredSpace.SanctifyRegion(location);
36+
}
37+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using UltraWorldAI.Religion;
2+
using Xunit;
3+
4+
public class FaithReactivitySystemTests
5+
{
6+
[Fact]
7+
public void RegisterMiracleIncreasesFanaticism()
8+
{
9+
FaithReactivitySystem.FanaticismByCulture.Clear();
10+
FaithReactivitySystem.RegisterMiracle("Arkhim");
11+
FaithReactivitySystem.RegisterMiracle("Arkhim");
12+
13+
Assert.True(FaithReactivitySystem.FanaticismByCulture["Arkhim"] >= 0.5f);
14+
}
15+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using UltraWorldAI.Religion;
2+
using Xunit;
3+
4+
public class ProphetSystemTests
5+
{
6+
[Fact]
7+
public void UpdateProphetStatusTransitionsThroughStages()
8+
{
9+
ProphetSystem.AllProphets.Clear();
10+
ProphetSystem.RegisterProphet("Kael", "Arkhim");
11+
var prophet = ProphetSystem.AllProphets[0];
12+
prophet.PersecutionLevel = 6;
13+
ProphetSystem.UpdateProphetStatus(prophet);
14+
Assert.Equal(ProphetStatus.Martir, prophet.Status);
15+
16+
prophet.MiraclesPerformed = 3;
17+
ProphetSystem.UpdateProphetStatus(prophet);
18+
Assert.Equal(ProphetStatus.Venerado, prophet.Status);
19+
20+
prophet.MiraclesPerformed = 6;
21+
ProphetSystem.UpdateProphetStatus(prophet);
22+
Assert.Equal(ProphetStatus.Santo, prophet.Status);
23+
}
24+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using UltraWorldAI.Religion;
2+
using UltraWorldAI.Territory;
3+
using Xunit;
4+
5+
public class SacredSystemTests
6+
{
7+
[Fact]
8+
public void CreateArtifactAndDesignateSiteWorks()
9+
{
10+
SacredSystem.Artifacts.Clear();
11+
SacredSystem.CreateArtifact("Chave", "Desperta o deus", "Templo");
12+
SacredSystem.DesignatePilgrimageSite("Lago", "Arkhim");
13+
14+
Assert.Single(SacredSystem.Artifacts);
15+
Assert.True(SacredSpace.IsSacred("Arkhim"));
16+
}
17+
}

0 commit comments

Comments
 (0)