1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-29 22:45:44 +00:00

Reparsing des propriétés

This commit is contained in:
Yan Maniez 2018-06-18 23:21:16 +02:00
parent 77728265dd
commit 36a43fe7b6
2 changed files with 144 additions and 42 deletions

View file

@ -241,48 +241,150 @@ namespace AideDeJeu.Tools
var paragraphBlock = ininblock as Markdig.Syntax.ParagraphBlock;
//DumpParagraphBlock(paragraphBlock);
var str = paragraphBlock.Inline.ToContainerString();
var match = regex.Match(str);
var key = match.Groups["key"].Value;
var value = match.Groups["value"].Value;
switch (key)
//var match = regex.Match(str);
//var key = match.Groups["key"].Value;
//var value = match.Groups["value"].Value;
//switch (key)
//{
//case "NameVO":
// monster.NameVO = value;
// break;
//case "SizeAlignment":
if(str.StartsWith("Classe d'armure "))
{
case "NameVO":
monster.NameVO = value;
break;
case "SizeAlignment":
{
var regexx = new Regex("(?<type>.*) de taille (?<size>.*), (?<alignment>.*)");
var matchh = regexx.Match(value);
monster.Alignment = matchh.Groups["alignment"].Value;
monster.Size = matchh.Groups["size"].Value;
monster.Type = matchh.Groups["type"].Value;
}
break;
case "ArmorClass":
monster.ArmorClass = value;
break;
case "HitPoints":
monster.HitPoints = value;
break;
case "Speed":
monster.Speed = value;
break;
case "SavingThrows":
monster.SavingThrows = value;
break;
case "Skills":
monster.Skills = value ;
break;
case "Senses":
monster.Senses = value;
break;
case "Languages":
monster.Languages = value;
break;
case "Challenge":
monster.Challenge = value;
break;
monster.ArmorClass = str;
}
else if (str.StartsWith("Points de vie "))
{
monster.HitPoints = str;
}
else if (str.StartsWith("Vitesse "))
{
monster.Speed = str;
}
else if (str.StartsWith("Résistance aux dégâts "))
{
monster.DamageResistances = str;
}
else if (str.StartsWith("Résistances aux dégâts "))
{
monster.DamageResistances = str;
}
else if (str.StartsWith("Résistance contre les dégâts "))
{
monster.DamageResistances = str;
}
else if (str.StartsWith("Résistances contre les dégâts "))
{
monster.DamageResistances = str;
}
else if (str.StartsWith("Immunité contre les dégâts "))
{
monster.DamageImmunities = str;
}
else if (str.StartsWith("Immunité contre des dégâts "))
{
monster.DamageImmunities = str;
}
else if (str.StartsWith("Immunité aux dégâts "))
{
monster.DamageImmunities = str;
}
else if (str.StartsWith("Immunité à l'état "))
{
monster.ConditionImmunities = str;
}
else if (str.StartsWith("Immunités à l'état "))
{
monster.ConditionImmunities = str;
}
else if (str.StartsWith("Immunité contre l'état "))
{
monster.ConditionImmunities = str;
}
else if (str.StartsWith("Immunité contre les états "))
{
monster.ConditionImmunities = str;
}
else if (str.StartsWith("Immunités contre les états "))
{
monster.ConditionImmunities = str;
}
else if (str.StartsWith("Vulnérabilité "))
{
monster.DamageVulnerabilities = str;
}
else if (str.StartsWith("Sens "))
{
monster.Senses = str;
}
else if (str.StartsWith("Langue "))
{
monster.Languages = str;
}
else if (str.StartsWith("Dangerosité "))
{
monster.Challenge = str;
}
else if (str.StartsWith("Jets de sauvegarde "))
{
monster.Challenge = str;
}
else if (str.StartsWith("Jet de sauvegarde "))
{
monster.Challenge = str;
}
else if (str.StartsWith("Compétences "))
{
monster.Skills = str;
}
else if (str.StartsWith("Compétence "))
{
monster.Skills = str;
}
else if (str.StartsWith("Langues "))
{
monster.Languages = str;
}
else
{
if (monster.Alignment != null)
{
App.Current.MainPage.DisplayAlert("Erreur de parsing", str, "OK");
}
//Debug.Assert(monster.Alignment == null, str);
var regexx = new Regex("(?<type>.*) de taille (?<size>.*), (?<alignment>.*)");
var matchh = regexx.Match(str);
monster.Alignment = matchh.Groups["alignment"].Value;
monster.Size = matchh.Groups["size"].Value;
monster.Type = matchh.Groups["type"].Value;
}
//break;
// if(str.st "ArmorClass":
// monster.ArmorClass = value;
// break;
// case "HitPoints":
// monster.HitPoints = value;
// break;
// case "Speed":
// monster.Speed = value;
// break;
// case "SavingThrows":
// monster.SavingThrows = value;
// break;
// case "Skills":
// monster.Skills = value ;
// break;
// case "Senses":
// monster.Senses = value;
// break;
// case "Languages":
// monster.Languages = value;
// break;
// case "Challenge":
// monster.Challenge = value;
// break;
//}
}
}

View file

@ -587,7 +587,7 @@ plus 3 (1d6) dégâts de feu.
| --- | --- | --- | --- | --- | --- |
|10 (+0)| 8 (-1)|16 (+3)| 3 (-4)|10 (+0)| 6 (-2)|
- Immunité contre l'étatà terre
- Immunité contre l'état à terre
- Sens vision dans le noir 18 m, Perception passive 10
- Langue —
- Dangerosité 2 (450 PX)
@ -10287,7 +10287,7 @@ Touché : 4 (1d4+2) dégâts perforants.
## Capacités
- Immunité limitée à la magie. Le rakshasa ne peut
* Immunité limitée à la magie. Le rakshasa ne peut
pas être affecté ou détecté par des sorts de niveau 6
ou moins, à moins qu'il ne le souhaite. Il obtient un
avantage lors des jets de sauvegarde contre tous les