mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-11-01 07:56:04 +00:00
Parsing table ok
This commit is contained in:
parent
32931b71df
commit
1e48b89ca5
2 changed files with 42 additions and 16 deletions
|
|
@ -262,21 +262,14 @@ namespace AideDeJeu.Tools
|
||||||
}
|
}
|
||||||
else if(block is Markdig.Extensions.Tables.Table)
|
else if(block is Markdig.Extensions.Tables.Table)
|
||||||
{
|
{
|
||||||
var table = block as Markdig.Extensions.Tables.Table;
|
var tableBlock = block as Markdig.Extensions.Tables.Table;
|
||||||
foreach(var blockrow in table)
|
var table = tableBlock.ToTable();
|
||||||
{
|
monster.Strength = table["FOR"].FirstOrDefault();
|
||||||
var row = blockrow as Markdig.Extensions.Tables.TableRow;
|
monster.Dexterity = table["DEX"].FirstOrDefault();
|
||||||
foreach(var blockcell in row)
|
monster.Constitution = table["CON"].FirstOrDefault();
|
||||||
{
|
monster.Intelligence = table["INT"].FirstOrDefault();
|
||||||
var cell = blockcell as Markdig.Extensions.Tables.TableCell;
|
monster.Wisdom = table["SAG"].FirstOrDefault();
|
||||||
foreach(var blockpar in cell)
|
monster.Charisma = table["CHA"].FirstOrDefault();
|
||||||
{
|
|
||||||
var par = blockpar as Markdig.Syntax.ParagraphBlock;
|
|
||||||
Debug.WriteLine(par.ToParagraphString());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -342,6 +335,37 @@ namespace AideDeJeu.Tools
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Dictionary<string, List<string>> ToTable(this Markdig.Extensions.Tables.Table tableBlock)
|
||||||
|
{
|
||||||
|
var table = new Dictionary<string, List<string>>();
|
||||||
|
var indexes = new Dictionary<int, string>();
|
||||||
|
foreach (var blockrow in tableBlock)
|
||||||
|
{
|
||||||
|
var row = blockrow as Markdig.Extensions.Tables.TableRow;
|
||||||
|
int indexCol = 0;
|
||||||
|
foreach (var blockcell in row)
|
||||||
|
{
|
||||||
|
var cell = blockcell as Markdig.Extensions.Tables.TableCell;
|
||||||
|
foreach (var blockpar in cell)
|
||||||
|
{
|
||||||
|
var par = blockpar as Markdig.Syntax.ParagraphBlock;
|
||||||
|
var name = par.ToParagraphString().Trim();
|
||||||
|
if (row.IsHeader)
|
||||||
|
{
|
||||||
|
indexes[indexCol] = name;
|
||||||
|
table[name] = new List<string>();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table[indexes[indexCol]].Add(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
indexCol++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return table;
|
||||||
|
}
|
||||||
|
|
||||||
public static string ToMarkdownString(this IEnumerable<Spell> spells)
|
public static string ToMarkdownString(this IEnumerable<Spell> spells)
|
||||||
{
|
{
|
||||||
var md = string.Empty;
|
var md = string.Empty;
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,9 @@ Touché : 11 (2d8+3) dégâts contondants (constriction).
|
||||||
|
|
||||||
Si la cible est une créature de taille M ou plus petite, elle est empoignée (évasion DD 14). L'abothid a deux tentacules dont chacun peut empoigner une cible.
|
Si la cible est une créature de taille M ou plus petite, elle est empoignée (évasion DD 14). L'abothid a deux tentacules dont chacun peut empoigner une cible.
|
||||||
|
|
||||||
**_Dard de langue._** Attaque d'arme au corps à corps (basée sur la Dextérité) : +7 pour toucher, allonge 1,50 m, une cible. Touché : 6 (1d6+2) dégâts perçants.
|
**_Dard de langue._** Attaque d'arme au corps à corps (basée sur la Dextérité) : +7 pour toucher, allonge 1,50 m, une cible.
|
||||||
|
|
||||||
|
Touché : 6 (1d6+2) dégâts perçants.
|
||||||
|
|
||||||
Si la cible est une créature humanoïde, elle doit réussir un jet de sauvegarde de Constitution (DD 14) sous peine d'être infectée par une maladie : l'injection d'un minuscule œuf d'abothid.
|
Si la cible est une créature humanoïde, elle doit réussir un jet de sauvegarde de Constitution (DD 14) sous peine d'être infectée par une maladie : l'injection d'un minuscule œuf d'abothid.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue