From 2840646473c8cbbfca69dac0251ac13a0ea65c72 Mon Sep 17 00:00:00 2001 From: Maximilien Rigaut Date: Fri, 24 Jan 2020 00:34:32 +0100 Subject: [PATCH] Fixed the gen At last --- feuille_sysd10.html | 2166 +++++++++++++++++++++++++++++++----------- helpers/base.py | 604 ++++++++++++ helpers/cyberpnk.txt | 161 ++-- helpers/gen.html | 1320 +++++++++++++++---------- helpers/gencss.css | 290 +++++- helpers/generator.py | 83 +- helpers/light.txt | 6 +- style.css | 31 +- 8 files changed, 3493 insertions(+), 1168 deletions(-) create mode 100644 helpers/base.py diff --git a/feuille_sysd10.html b/feuille_sysd10.html index cdbf90c..67522a8 100644 --- a/feuille_sysd10.html +++ b/feuille_sysd10.html @@ -161,7 +161,7 @@
-
+

@@ -294,183 +294,1320 @@

- - - - + + + +
-
- - - - -
- -

Compétences générales

-
- - - - - -
-
- -
- -

Compétences sociales

-
- - - - - -
-
- -
- -

Compétences Intellectuelles

-
- - - - - -
-
- + + + + +
+ +

Combat

+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+
+
+ +

Physiques

+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+
+
+ +

Implants

+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+
+
+ +

Pilotage

+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
- - +
-
- - -
-

Compétences magiques

-
- - - - - -
-
- + + + +
+ +

Techniques

+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+
+
+ +

Connaissances

+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+
+
+ +

Culture Générale

+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
- - +
- - - - - - -
- - - - - + - + - - - > - ∀ -
- - - - - - - -
- - - - - -
- - - - - -
- - - - - - - - -
- - - - + +
+ +

Sociales

+ + + + + - -
- -
- - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - -
- - - - + + + - -
-
- - -
- - - + - - - > - ∀ -
- - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - -
- - - - + + + - -
-
- - -
. - - ∘ - ∀ - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - -
- - - - + + + - -
+ +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
- -
- - -
- - -
- - -
- - +
+ +

Clandestines

+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
- -
+ +
@@ -927,7 +2014,6 @@ {{#rollWasFumble() result}} {{result}}-{{base}} {{/rollWasFumble() result}} - - +
diff --git a/helpers/base.py b/helpers/base.py new file mode 100644 index 0000000..e164924 --- /dev/null +++ b/helpers/base.py @@ -0,0 +1,604 @@ +head=""" + + +""" +script=""" +""" +header=""" +
+
+ +
+ +
+
+
+
+

Ressources

+ + + + + + + + + + + + + + + + + +

Points de Vie

Points de Fatigue

Dégats aggravés

+
+
+ + + +
+ + + + + + + + +

Points de compétence :

Utilisés + +
Restants
+
+
+
+
+

Caractéristiques

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracValeurBonusLancer
Force
Agilité
Perception
Charisme
+
+
+

 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracValeurBonusLancer
Intelligence
Volonté
Psyché
Chance
+
+
+
+""" + +footer=""" +
+ + + + + + {{#rollWasCrit() result}} + + {{/rollWasCrit() result}} + {{#^rollWasCrit() result}} + {{#rollWasFumble() result}} + {{#rollGreater() result 1}} + + {{/rollGreater() result 1}} + {{#rollBetween() result 0 1}} + + {{/rollBetween() result 0 1}} + {{#rollLess() result 0}} + + {{/rollLess() result 0}} + {{/rollWasFumble() result}} + {{#^rollWasFumble() result}} + {{#rollGreater() result 1}} + + {{/rollGreater() result 1}} + {{#rollBetween() result 0 1}} + + {{/rollBetween() result 0 1}} + {{#rollLess() result 0}} + + {{/rollLess() result 0}} + {{/^rollWasFumble() result}} + {{/^rollWasCrit() result}} + +
{{name}} — {{roll_name}}
Test au d{{dice_name}} seuil {{threshold}}
Critique ! {{result}}x2 degrés de réussiteÉchec critique ! {{result}}/2 degrés de réussiteÉchec critique ! {{result}}/2 degré de réussiteÉchec critique ! {{result}}x2 degrés d'échec{{result}} degrés de réussite{{result}} degré de réussite{{result}} degrés d'échec
+
+ + + + +
{{name}} — {{roll_name}}
1d10+{{value}} = {{result}} + {{#rollWasCrit() result}} + +{{base}} + {{/rollWasCrit() result}} + {{#rollWasFumble() result}} + {{result}}-{{base}} + {{/rollWasFumble() result}} +
+
+""" +css_footer="""input.sheet-tab{ + -moz-appearance: none; + width:150px; + height: 20px; + top: 5px; + left: 6px; + margin: 5px; + cursor: pointer; + z-index: 1; + content: attr(title); +} +input.sheet-tab::before{ + -moz-appearance: none; + content: attr(title); + border-radius:.5em; + border:2px solid black; + text-align: center; + display: inline-block; + background: black; + color:white; + width: 150px; + height: 20px; + font-size: 18px; +} +input.sheet-tab:checked::before{ + -moz-appearance: none; + background:#CCCCCC; + color:black; + border-radius:.5em; + border:2px solid black; +} + +input.sheet-small_tab{ + -moz-appearance: none; + width:120px; + height: 20px; + cursor: pointer; + z-index: 1; + margin:5px; +} +input.sheet-small_tab::before{ + -moz-appearance: none; + content: attr(title); + border-radius:.5em; + text-align: center; + display: inline-block; + color:white; + background:black; + border:2px solid black; + width: 120px; + height:20px; + font-size: 14px; +} +input.sheet-small_tab:checked::before{ + -moz-appearance: none; + border:2px solid black; + background:#CCCCCC; + color:black; + border-radius:.5em; +} + +input.sheet-skill_name{ + -moz-appearance: none; + width:400px; +} +input.sheet-skill_hidden{ + visibility: hidden; +} +div.sheet-tab-content{ + border-top-color: #000; + margin: 2px 0 0 0; +} +select.sheet-skill_select{ + width:55px; + margin-bottom:-1px; +} +select.sheet-dice_select{ + width:85px; + margin-bottom:-1px; +} +.sheet-trait{ + width: 30px; +} +.sheet-numberbox { + width: 50px; +} + +.sheet-rolltemplate-d10init table, +.sheet-rolltemplate-d10skillcheck table { + border-radius: 6px; + width:100%; + padding:0px; + margin:0px; + padding: 2px; + border: 1px solid; + background-color: #ffffff; + border-width: 1px; + border-style: solid; + border-color: #000; + border-image-source: none; +} +.sheet-rolltemplate-d10init .sheet-roll-title, +.sheet-rolltemplate-d10init th, +.sheet-rolltemplate-d10skillcheck .sheet-roll-title, +.sheet-rolltemplate-d10skillcheck th { + color: rgb(42, 42, 42); + padding:0px; + margin:0px; + padding-left: 5px; + font-size: 1.2em; + text-align: left; + font-family: "Times New Roman", Times, serif; + font-variant: small-caps; + text-transform: capitalize; + border-width: 0px; +} +.sheet-rolltemplate-d10init .sheet-roll-attr, +.sheet-rolltemplate-d10skillcheck .sheet-roll-attr{ + color: #555555; + font-size: 1em; + font-style: italic; + padding:0px; + margin:0px; + padding-left: 9px; + border-width: 0px; + margin-top: -10px; +} +.sheet-rolltemplate-d10init .sheet-roll-sucess, +.sheet-rolltemplate-d10skillcheck .sheet-roll-sucess , +.sheet-rolltemplate-d10skillcheck .sheet-roll-fail { + padding:0px; + margin:0px; + border-width: 0px; + padding-left: 5px; +} +.sheet-rolltemplate-d10skillcheck .sheet-roll-crit { + padding:0px; + margin:0px; + border-width: 0px; + padding-left: 5px; + background-color:#b0d6ad; +} +.sheet-rolltemplate-d10skillcheck .sheet-roll-fumble { + padding-left: 5px; + border-width: 0px; + background-color:#d6adad; +} +.sheet-rolltemplate-d10init .sheet-inline, +.sheet-rolltemplate-d10init .inlinerollresult, +.sheet-rolltemplate-d10skillcheck .sheet-inline, +.sheet-rolltemplate-d10skillcheck .inlinerollresult { + background-color: transparent; + border: none; + font-weight: bold; + padding:0px; + font-family: "Times New Roman", Times, serif; +} +.sheet-rolltemplate-d10skillcheck .sheet-inline.sheet-fullcrit, +.sheet-rolltemplate-d10skillcheck .inlinerollresult.fullcrit { + color: #3FB315; + border: none; +} +.sheet-rolltemplate-d10skillcheck .sheet-inline.sheet-fullfail, +.sheet-rolltemplate-d10skillcheck .inlinerollresult.fullfail { + color: #B31515; + border: none; +} +.sheet-rolltemplate-d10skillcheck .inlinerollresult.importantroll { + color: #4A57ED; + border: none; +} + +.sheet-rolltemplate-d10fight-blob{ + border-radius: 6px; + border: 1px solid #898989; + z-index: 1; +} +.sheet-rolltemplate-d10fight table{ + padding:0px; + margin:0px; + text-align: left; + width:100%; + border:none; + cellpadding:3px; + cellspacing:0px; +} +.sheet-rolltemplate-d10fight .sheet-sum{ + padding:0px; + margin:0px; + border:none; + text-align: right; + padding-right:10px; +} +.sheet-rolltemplate-d10fight .sheet-sucess, +.sheet-rolltemplate-d10fight .sheet-line{ + padding:0px; + margin:0px; + padding-left: 3px; + border:none; +} +.sheet-rolltemplate-d10fight .sheet-critical{ + padding:0px; + margin:0px; + border:none; + padding-left: 3px; + border-radius: 4px; + background-color:#b0d6ad; +} +.sheet-rolltemplate-d10fight .sheet-hit{ + padding:0px; + margin:0px; + padding-left: 3px; + border-radius: 4px; + background-color:#b0d6ad; + border:none; +} +.sheet-rolltemplate-d10fight .sheet-miss{ + padding:0px; + margin:0px; + padding-left: 3px; + border:none; + border-radius: 4px; + background-color:#d6adad; +} +.sheet-rolltemplate-d10fight .sheet-name{ + padding:0px; + padding-left: 3px; + margin:0px; + border:none; + border-radius: 4px; + border-bottom-left-radius: 2px; + border-bottom-right-radius: 2px; + background-color: #999999; +} +.sheet-rolltemplate-d10fight .sheet-additional{ + padding:0px; + margin:0px; + border:none; + padding-left:10px; +} +.sheet-rolltemplate-d10fight-grey{ + color: #999999; +} +.sheet-rolltemplate-d10fight-green{ + color: #009900; +} +.sheet-rolltemplate-d10fight a, +.sheet-rolltemplate-d10fight a[href^="!"], +.sheet-rolltemplate-d10fight a[href^="~"]{ + text-align:right; + background-color: #999999; !important +} +""" diff --git a/helpers/cyberpnk.txt b/helpers/cyberpnk.txt index a22a1f9..37ca4ec 100644 --- a/helpers/cyberpnk.txt +++ b/helpers/cyberpnk.txt @@ -1,126 +1,125 @@ @ Physique -+ Compétences de combat -- : Armes à feu -- : Armes d'assaut -- : Armes de poing ++ Combat +- Armes à feu +- ⇥ Armes d'assaut +- ⇥ Armes de poing - Armes Lourdes -- : Projectiles autopropulsés -- : Armement laser +- ⇥ Projectiles autopropulsés +- ⇥ Armement laser - Artillerie - : Guidage de missiles - : Systemes de défences - : Balistique superlative + ⇥ Guidage de missiles + ⇥ Systemes de défences + ⇥ Balistique superlative - Combat à Mains Nues - : Neo Kwon Do - : Zero-G + ⇥ Neo Kwon Do + ⇥ Zero-G - Combat Armé - : Armes Contandantes - : Armes Tranchantes + ⇥ Armes Contandantes + ⇥ Armes Tranchantes - Maniement des Explosifs -+ Compétences physiques ++ Physiques - Athlétisme -- : Aerien -- : Terrestre -- : Maritime -- : Zero G +- ⇥ Aerien +- ⇥ Terrestre +- ⇥ Maritime +- ⇥ Zero G - Survie -- : Environnement Sauvage -- : Environnement Urbain -- : Environnement Spacial +- ⇥ Environnement Sauvage +- ⇥ Environnement Urbain +- ⇥ Environnement Spacial -+ Utilisation d’implants ++ Implants - Utilisation de Cyberware -- : Utilisation de Neuro Accelerateurs -- : Utilisation d'Interfaces de tir -- : Overdrive Physique +- ⇥ Utilisation de Neuro Accelerateurs +- ⇥ Utilisation d'Interfaces de tir +- ⇥ Overdrive Physique -+ Compétences de Pilotage ++ Pilotage - Pilotage athmosphérique -- : Pilotage de Chasseurs -- : Pilotage de Navettes +- ⇥ Pilotage de Chasseurs +- ⇥ Pilotage de Navettes - Vehicules Terestres -- : Vehicules Legers -- : Vehicules Lourds -- : Véhicules de Course +- ⇥ Vehicules Legers +- ⇥ Vehicules Lourds +- ⇥ Véhicules de Course - Vaisseaux Spatiaux -- : Batiments légers -- : Batiments lourds -- : Batiments super lourds +- ⇥ Batiments légers +- ⇥ Batiments lourds +- ⇥ Batiments super lourds @ Intelectuelles - -+ Compétences Techniques ++ Techniques - Biotech -- : Chirurgie d’implants +- ⇥ Chirurgie d’implants - Electronique -- : Interconnection des systèmes -- : Verrous magnétiques +- ⇥ Interconnection des systèmes +- ⇥ Verrous magnétiques - Informatique -- : Hardware -- : Software -- : Systèmes embarqués -- Mecanique -- : Réacteurs à Fusion -- : Réacteurs à Fission -- : Compensateurs d'Inertie -- : Technologie Lightfold -- : Systèmes de Survie -- : Systemes de Propultion +- ⇥ Hardware +- ⇥ Software +- ⇥ Systèmes embarqués +- Mécanique +- ⇥ Réacteurs à Fusion +- ⇥ Réacteurs à Fission +- ⇥ Compensateurs d'Inertie +- ⇥ Technologie Lightfold +- ⇥ Systèmes de Survie +- ⇥ Systemes de Propultion - Prospection stellaire -- : Corps stellaires -- : Excavation planetaire +- ⇥ Corps stellaires +- ⇥ Excavation planetaire + Connaissances - Bioware -- : Implants Céphaliens -- : Implants Corporels +- ⇥ Implants Céphaliens +- ⇥ Implants Corporels - Médecine -- : Soins Intensifs -- : Cybernetisation +- ⇥ Soins Intensifs +- ⇥ Cybernetisation - Sciences -- : Astromathématiques -- : Biologie -- : Xenobiologie -- : Mathématiques -- : Physique/Chimie -- : Lightfold -- : Sociologie +- ⇥ Astromathématiques +- ⇥ Biologie +- ⇥ Xenobiologie +- ⇥ Mathématiques +- ⇥ Physique/Chimie +- ⇥ Lightfold +- ⇥ Sociologie + Culture Générale - Instruction Civique -- : Administratif/Politique/Droit -- : Finances -- : Psychologie +- ⇥ Administratif/Politique/Droit +- ⇥ Finances +- ⇥ Psychologie - Théorie Militaire -- : Tactique -- : Stratégie +- ⇥ Tactique +- ⇥ Stratégie @ Social -+ Compétences Sociales ++ Sociales - Etiquette -- : Alpha Centauri -- : Eridani -- : Banard -- : Tau -- : Sirius -- : C.I.C. -- : Sol -- : Pègre +- ⇥ Alpha Centauri +- ⇥ Eridani +- ⇥ Banard +- ⇥ Tau +- ⇥ Sirius +- ⇥ C.I.C. +- ⇥ Sol +- ⇥ Pègre - Interrogation -- : Intimidation +- ⇥ Intimidation - Commandement - Négociation - Baratin -+ Competences Clandestines ++ Clandestines - Discretion - Crochetage - Informations - Larcin - Marchés noirs -- : Acquisition d’Objets -- : Acquisition d’Informations +- ⇥ Acquisition d’Objets +- ⇥ Acquisition d’Informations -+ Contacts et Réputations ++ Contacts . Contacts diff --git a/helpers/gen.html b/helpers/gen.html index 94c664b..ee03a6e 100644 --- a/helpers/gen.html +++ b/helpers/gen.html @@ -1,21 +1,316 @@ + + + + + +
+
+ +
+ +
+
+
+
+

Ressources

+ + + + + + + + + + + + + + + + + +

Points de Vie

Points de Fatigue

Dégats aggravés

+
+
+ + + +
+ + + + + + + + +

Points de compétence :

Utilisés + +
Restants
+
+
+
+
+

Caractéristiques

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracValeurBonusLancer
Force
Agilité
Perception
Charisme
+
+
+

 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaracValeurBonusLancer
Intelligence
Volonté
Psyché
Chance
+
+
+
+
-
- - - - -
-
- -

Compétences de combat

- - + + + + +
+ +

Combat

+ + - - + - +
- - + + - - + - +
- - + + - - + - +
- + - - + - +
- - + + - - + - +
- - + + - - + - +
- + - - + - +
- + - - + - +
- + - - + - +
- + - - + - +
-
- -

Compétences physiques

+
+ +

Physiques

- + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
-
- -

Utilisation d’implants

+
+ +

Implants

- + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
-
- -

Compétences de Pilotage

+
+ +

Pilotage

- + - - + - +
- - + + - - + - +
- - + + - - + - +
- + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
+
-
- - - -
-
- -

Compétences Techniques

+ + + +
+ +

Techniques

- + - - + - +
- - + + - - + - +
- + - - + - +
- - + + - - + - +
- - + + - - + - +
- + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- + - - + - +
- - + + - - + - +
- - + + - - + - +
-
+

Connaissances

@@ -956,11 +1250,11 @@
- - + + - - + - +
- - + + - - + - +
- + - - + - +
- - + + - - + - +
- - + + - - + - +
@@ -1058,11 +1352,11 @@
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
-
+

Culture Générale

- + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- + - - + - +
- - + + - - + - +
- - + + - - + - +
+
-
- - - -
-
- -

Compétences Sociales

+ + + +
+ +

Sociales

- + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- - + + - - + - +
- + - - + - +
- - + + - - + - +
- + - - + - +
- + - - + - +
- + - - + - +
-
- -

Competences Clandestines

+
+ +

Clandestines

- + - - + - +
- + - - + - +
- + - - + - +
- + - - + - +
- + - - + - +
- - + + - - + - +
- - + + - - + - +
-
- -

Contacts et Réputations

+
+ +

Contacts

+ +
+ + + + + +
+
+ +
+ + + + + + {{#rollWasCrit() result}} + + {{/rollWasCrit() result}} + {{#^rollWasCrit() result}} + {{#rollWasFumble() result}} + {{#rollGreater() result 1}} + + {{/rollGreater() result 1}} + {{#rollBetween() result 0 1}} + + {{/rollBetween() result 0 1}} + {{#rollLess() result 0}} + + {{/rollLess() result 0}} + {{/rollWasFumble() result}} + {{#^rollWasFumble() result}} + {{#rollGreater() result 1}} + + {{/rollGreater() result 1}} + {{#rollBetween() result 0 1}} + + {{/rollBetween() result 0 1}} + {{#rollLess() result 0}} + + {{/rollLess() result 0}} + {{/^rollWasFumble() result}} + {{/^rollWasCrit() result}} + +
{{name}} — {{roll_name}}
Test au d{{dice_name}} seuil {{threshold}}
Critique ! {{result}}x2 degrés de réussiteÉchec critique ! {{result}}/2 degrés de réussiteÉchec critique ! {{result}}/2 degré de réussiteÉchec critique ! {{result}}x2 degrés d'échec{{result}} degrés de réussite{{result}} degré de réussite{{result}} degrés d'échec
+
+ + + + +
{{name}} — {{roll_name}}
1d10+{{value}} = {{result}} + {{#rollWasCrit() result}} + +{{base}} + {{/rollWasCrit() result}} + {{#rollWasFumble() result}} + {{result}}-{{base}} + {{/rollWasFumble() result}} +
+
diff --git a/helpers/gencss.css b/helpers/gencss.css index 5d67c3a..a3d3b99 100644 --- a/helpers/gencss.css +++ b/helpers/gencss.css @@ -2,20 +2,276 @@ div.sheet-tab-content { display: none; } input.sheet-tab1:checked ~ div.sheet-tab1, input.sheet-tab2:checked ~ div.sheet-tab2, input.sheet-tab3:checked ~ div.sheet-tab3 -{display: block;} - -input.sheet-physique1:checked ~ div.sheet-physique1, -input.sheet-physique2:checked ~ div.sheet-physique2, -input.sheet-physique3:checked ~ div.sheet-physique3, -input.sheet-physique4:checked ~ div.sheet-physique4 -{display: block;} - -input.sheet-intelectuelles1:checked ~ div.sheet-intelectuelles1, -input.sheet-intelectuelles2:checked ~ div.sheet-intelectuelles2, -input.sheet-intelectuelles3:checked ~ div.sheet-intelectuelles3 -{display: block;} - -input.sheet-social1:checked ~ div.sheet-social1, -input.sheet-social2:checked ~ div.sheet-social2, -input.sheet-social3:checked ~ div.sheet-social3 -{display: block;} +{ + display: block; +} +input.sheet-secondary_physique_tab1:checked ~ div.sheet-secondary_physique_tab1, +input.sheet-secondary_physique_tab2:checked ~ div.sheet-secondary_physique_tab2, +input.sheet-secondary_physique_tab3:checked ~ div.sheet-secondary_physique_tab3, +input.sheet-secondary_physique_tab4:checked ~ div.sheet-secondary_physique_tab4 +{ + display: block; +} +input.sheet-secondary_intelectuelles_tab1:checked ~ div.sheet-secondary_intelectuelles_tab1, +input.sheet-secondary_intelectuelles_tab2:checked ~ div.sheet-secondary_intelectuelles_tab2, +input.sheet-secondary_intelectuelles_tab3:checked ~ div.sheet-secondary_intelectuelles_tab3 +{ + display: block; +} +input.sheet-secondary_social_tab1:checked ~ div.sheet-secondary_social_tab1, +input.sheet-secondary_social_tab2:checked ~ div.sheet-secondary_social_tab2, +input.sheet-secondary_social_tab3:checked ~ div.sheet-secondary_social_tab3 +{ + display: block; +}input.sheet-tab{ + -moz-appearance: none; + width:150px; + height: 20px; + top: 5px; + left: 6px; + margin: 5px; + cursor: pointer; + z-index: 1; + content: attr(title); +} +input.sheet-tab::before{ + -moz-appearance: none; + content: attr(title); + border-radius:.5em; + border:2px solid black; + text-align: center; + display: inline-block; + background: black; + color:white; + width: 150px; + height: 20px; + font-size: 18px; +} +input.sheet-tab:checked::before{ + -moz-appearance: none; + background:#CCCCCC; + color:black; + border-radius:.5em; + border:2px solid black; +} + +input.sheet-small_tab{ + -moz-appearance: none; + width:120px; + height: 20px; + cursor: pointer; + z-index: 1; + margin:5px; +} +input.sheet-small_tab::before{ + -moz-appearance: none; + content: attr(title); + border-radius:.5em; + text-align: center; + display: inline-block; + color:white; + background:black; + border:2px solid black; + width: 120px; + height:20px; + font-size: 14px; +} +input.sheet-small_tab:checked::before{ + -moz-appearance: none; + border:2px solid black; + background:#CCCCCC; + color:black; + border-radius:.5em; +} + +input.sheet-skill_name{ + -moz-appearance: none; + width:400px; +} +input.sheet-skill_hidden{ + visibility: hidden; +} +div.sheet-tab-content{ + border-top-color: #000; + margin: 2px 0 0 0; +} +select.sheet-skill_select{ + width:55px; + margin-bottom:-1px; +} +select.sheet-dice_select{ + width:85px; + margin-bottom:-1px; +} +.sheet-trait{ + width: 30px; +} +.sheet-numberbox { + width: 50px; +} + +.sheet-rolltemplate-d10init table, +.sheet-rolltemplate-d10skillcheck table { + border-radius: 6px; + width:100%; + padding:0px; + margin:0px; + padding: 2px; + border: 1px solid; + background-color: #ffffff; + border-width: 1px; + border-style: solid; + border-color: #000; + border-image-source: none; +} +.sheet-rolltemplate-d10init .sheet-roll-title, +.sheet-rolltemplate-d10init th, +.sheet-rolltemplate-d10skillcheck .sheet-roll-title, +.sheet-rolltemplate-d10skillcheck th { + color: rgb(42, 42, 42); + padding:0px; + margin:0px; + padding-left: 5px; + font-size: 1.2em; + text-align: left; + font-family: "Times New Roman", Times, serif; + font-variant: small-caps; + text-transform: capitalize; + border-width: 0px; +} +.sheet-rolltemplate-d10init .sheet-roll-attr, +.sheet-rolltemplate-d10skillcheck .sheet-roll-attr{ + color: #555555; + font-size: 1em; + font-style: italic; + padding:0px; + margin:0px; + padding-left: 9px; + border-width: 0px; + margin-top: -10px; +} +.sheet-rolltemplate-d10init .sheet-roll-sucess, +.sheet-rolltemplate-d10skillcheck .sheet-roll-sucess , +.sheet-rolltemplate-d10skillcheck .sheet-roll-fail { + padding:0px; + margin:0px; + border-width: 0px; + padding-left: 5px; +} +.sheet-rolltemplate-d10skillcheck .sheet-roll-crit { + padding:0px; + margin:0px; + border-width: 0px; + padding-left: 5px; + background-color:#b0d6ad; +} +.sheet-rolltemplate-d10skillcheck .sheet-roll-fumble { + padding-left: 5px; + border-width: 0px; + background-color:#d6adad; +} +.sheet-rolltemplate-d10init .sheet-inline, +.sheet-rolltemplate-d10init .inlinerollresult, +.sheet-rolltemplate-d10skillcheck .sheet-inline, +.sheet-rolltemplate-d10skillcheck .inlinerollresult { + background-color: transparent; + border: none; + font-weight: bold; + padding:0px; + font-family: "Times New Roman", Times, serif; +} +.sheet-rolltemplate-d10skillcheck .sheet-inline.sheet-fullcrit, +.sheet-rolltemplate-d10skillcheck .inlinerollresult.fullcrit { + color: #3FB315; + border: none; +} +.sheet-rolltemplate-d10skillcheck .sheet-inline.sheet-fullfail, +.sheet-rolltemplate-d10skillcheck .inlinerollresult.fullfail { + color: #B31515; + border: none; +} +.sheet-rolltemplate-d10skillcheck .inlinerollresult.importantroll { + color: #4A57ED; + border: none; +} + +.sheet-rolltemplate-d10fight-blob{ + border-radius: 6px; + border: 1px solid #898989; + z-index: 1; +} +.sheet-rolltemplate-d10fight table{ + padding:0px; + margin:0px; + text-align: left; + width:100%; + border:none; + cellpadding:3px; + cellspacing:0px; +} +.sheet-rolltemplate-d10fight .sheet-sum{ + padding:0px; + margin:0px; + border:none; + text-align: right; + padding-right:10px; +} +.sheet-rolltemplate-d10fight .sheet-sucess, +.sheet-rolltemplate-d10fight .sheet-line{ + padding:0px; + margin:0px; + padding-left: 3px; + border:none; +} +.sheet-rolltemplate-d10fight .sheet-critical{ + padding:0px; + margin:0px; + border:none; + padding-left: 3px; + border-radius: 4px; + background-color:#b0d6ad; +} +.sheet-rolltemplate-d10fight .sheet-hit{ + padding:0px; + margin:0px; + padding-left: 3px; + border-radius: 4px; + background-color:#b0d6ad; + border:none; +} +.sheet-rolltemplate-d10fight .sheet-miss{ + padding:0px; + margin:0px; + padding-left: 3px; + border:none; + border-radius: 4px; + background-color:#d6adad; +} +.sheet-rolltemplate-d10fight .sheet-name{ + padding:0px; + padding-left: 3px; + margin:0px; + border:none; + border-radius: 4px; + border-bottom-left-radius: 2px; + border-bottom-right-radius: 2px; + background-color: #999999; +} +.sheet-rolltemplate-d10fight .sheet-additional{ + padding:0px; + margin:0px; + border:none; + padding-left:10px; +} +.sheet-rolltemplate-d10fight-grey{ + color: #999999; +} +.sheet-rolltemplate-d10fight-green{ + color: #009900; +} +.sheet-rolltemplate-d10fight a, +.sheet-rolltemplate-d10fight a[href^="!"], +.sheet-rolltemplate-d10fight a[href^="~"]{ + text-align:right; + background-color: #999999; !important +} diff --git a/helpers/generator.py b/helpers/generator.py index fdfffdb..e290ac2 100644 --- a/helpers/generator.py +++ b/helpers/generator.py @@ -4,11 +4,13 @@ # content skills sections and others from a file, on the long run, it should be able to content the whole sheet import argparse, sys, os -from unidecode import unidecode +import string +# from unidecode import unidecode # import unicode def remove_non_ascii(text): - return unidecode(text) + return "".join([c for c in text if c in string.ascii_letters]).strip(" ") + # return unidecode(text) class Node(object): """Generic Node.""" @@ -59,14 +61,13 @@ class Root(Node): for child in self.children: ret+="\ninput.sheet-tab{node.number}:checked ~ div.sheet-tab{node.number},".format(node=child) ret=ret[:-1] - ret+="\n{display: block;}\n" + ret+="\n{\n display: block;\n}" for child in self.children: ret+=child.css() return ret class Tab(Node): """Tab node, contains""" - def __init__(self, name,nb): super(Tab, self).__init__(name,nb) @@ -74,29 +75,30 @@ class Tab(Node): return '\n'.format(self=self) def content(self): - ret='
\n
\n'.format(self=self) # And add all content + ret='\n
\n'.format(self=self) # And add all content for child in self.children: ret+=child.header() - ret+="
\n" for child in self.children: ret+=child.content() return ret + def css(self): ret=" " for child in self.children: - ret+="\ninput.sheet-{node.pname}{child.number}:checked ~ div.sheet-{node.pname}{child.number},".format(child=child,node=self) + ret+="\ninput.sheet-secondary_{node.pname}_tab{child.number}:checked ~ div.sheet-secondary_{node.pname}_tab{child.number},".format(child=child,node=self) ret=ret[:-1] - ret+="\n{display: block;}\n" + ret+="\n{\n display: block;\n}" return ret + class SubTab(Node): def __init__(self,name,nb): super(SubTab,self).__init__(name,nb) def header(self): - return """ \n""".format(self=self) + return """ \n""".format(self=self) def content(self): - ret= '
\n'.format(self=self) + ret= '
\n'.format(self=self) ret+=" \n

{self.name}

\n".format(self=self) for child in self.children: ret+=child.content() @@ -130,28 +132,35 @@ class Skill(Node):
\n""".format(self=self) return ret -# - # - #

Compétences Intellectuelles

- #
- # - # - # - # - # - #
- #
+class Repeating(Node): + """Repeating section""" + def __init__(self, name,nb): + super(Repeating, self).__init__(name,nb) + + def content(self): + ret=""" +
+ + + + + +
+
\n""".format(node=self) + return ret if __name__ == '__main__': # filen=sys.argv[1] @@ -162,7 +171,7 @@ if __name__ == '__main__': def parse(filen): root=Root() active_tab,active_subtab=None,None - tab_nb,subtab_nb,skill_nb=1,1,1 + tab_nb,subtab_nb,skill_nb,repeating_nb=1,1,1,1 try: with open(filen,encoding="utf-8") as f: for line in f.readlines(): @@ -180,11 +189,21 @@ if __name__ == '__main__': tech_content=Skill(line[1:-1],skill_nb) active_subtab.addchild(tech_content) skill_nb+=1 + elif line[0]==".": + tech_content=Repeating(line[1:-1],repeating_nb) + active_subtab.addchild(tech_content) + repeating_nb+=1 except FileNotFoundError: print(filen,"was not found") return root root=parse(filen) + import base with open(output,"w",encoding="utf-8") as f: + f.write(base.head) + f.write(base.script) + f.write(base.header) f.write(root.content()) + f.write(base.footer) with open(outcss,"w",encoding="utf-8") as f: f.write(root.css()) + f.write(base.css_footer) diff --git a/helpers/light.txt b/helpers/light.txt index 9c069a3..16e7aae 100644 --- a/helpers/light.txt +++ b/helpers/light.txt @@ -1,3 +1,5 @@ @ Physique -+ Compétences de combat -- : Armes à feu ++ Combat +- Armes à feu ++ Soc +- Charisme diff --git a/style.css b/style.css index 79f3e10..98e55df 100644 --- a/style.css +++ b/style.css @@ -3,29 +3,26 @@ input.sheet-tab1:checked ~ div.sheet-tab1, input.sheet-tab2:checked ~ div.sheet-tab2, input.sheet-tab3:checked ~ div.sheet-tab3 { - display: block; + display: block; } -input.sheet-secondary_tab1:checked ~ div.sheet-secondary_tab1, -input.sheet-secondary_tab2:checked ~ div.sheet-secondary_tab2, -input.sheet-secondary_tab3:checked ~ div.sheet-secondary_tab3, -input.sheet-secondary_tab4:checked ~ div.sheet-secondary_tab4, -input.sheet-secondary_tab5:checked ~ div.sheet-secondary_tab5 +input.sheet-secondary_physique_tab1:checked ~ div.sheet-secondary_physique_tab1, +input.sheet-secondary_physique_tab2:checked ~ div.sheet-secondary_physique_tab2, +input.sheet-secondary_physique_tab3:checked ~ div.sheet-secondary_physique_tab3, +input.sheet-secondary_physique_tab4:checked ~ div.sheet-secondary_physique_tab4 { - display:block; + display: block; } -input.sheet-secondary_magic_tab1:checked ~ div.sheet-secondary_magic_tab1, -input.sheet-secondary_magic_tab2:checked ~ div.sheet-secondary_magic_tab2, -input.sheet-secondary_magic_tab3:checked ~ div.sheet-secondary_magic_tab3, -input.sheet-secondary_magic_tab4:checked ~ div.sheet-secondary_magic_tab4, -input.sheet-secondary_magic_tab5:checked ~ div.sheet-secondary_magic_tab5 +input.sheet-secondary_intelectuelles_tab1:checked ~ div.sheet-secondary_intelectuelles_tab1, +input.sheet-secondary_intelectuelles_tab2:checked ~ div.sheet-secondary_intelectuelles_tab2, +input.sheet-secondary_intelectuelles_tab3:checked ~ div.sheet-secondary_intelectuelles_tab3 { - display:block; + display: block; } -input.sheet-secondary_skills_tab1:checked ~ div.sheet-secondary_skills_tab1, -input.sheet-secondary_skills_tab2:checked ~ div.sheet-secondary_skills_tab2, -input.sheet-secondary_skills_tab3:checked ~ div.sheet-secondary_skills_tab3 +input.sheet-secondary_social_tab1:checked ~ div.sheet-secondary_social_tab1, +input.sheet-secondary_social_tab2:checked ~ div.sheet-secondary_social_tab2, +input.sheet-secondary_social_tab3:checked ~ div.sheet-secondary_social_tab3 { - display:block; + display: block; } input.sheet-tab{