Skip to content

Commit

Permalink
Everything is broken, except for Pennino
Browse files Browse the repository at this point in the history
  • Loading branch information
Gimbardo committed Nov 12, 2024
1 parent 854681c commit dc8079b
Show file tree
Hide file tree
Showing 12 changed files with 210 additions and 76 deletions.
44 changes: 44 additions & 0 deletions _includes/statistics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

| Class & Subclass | Background | Race | Alignment | Level |
|:----------------:| :--------: | :--: | :-------: | :---: |
| [[[CLASS]] [[SUBCLASS_SHORT]]]([[CLASS_URL]]) | [[[BACKGROUND]]]([[BACKGROUND_URL]]) | [[[RACE]]]([[RACE_URL]]) | [[ALIGNMENT]] | [[LVL]] |

{% assign image_url= "sheets/" | append: page.title | append: ".webp" | remove:" " %}

{% picture {{image_url}} center --alt {{page.title}} --parent class="w-50" %}

---

## Statistics

| | | |
| --------------- | ---------------------- | ------------- |
| Proficiency: [[PROF]] | Passive Perception: [[PP]] | Initative: [[Initiative]] |
| Hit Points: [[HP]] | Armor Class: [[CA]] | Speed: [[SPEED]] |

| | | | | |
| :----------: |:-----------:| :-: | :----------: | :---------: |
| Strength | **[[STR_MOD]]** ([[STR]]) | | Intelligence | **[[INT_MOD]]** ([[INT]]) |
| Dexterity | **[[DEX_MOD]]** ([[DEX]]) | | Wisdom | **[[WIS_MOD]]** ([[WIS]]) |
| Constitution | **[[CON_MOD]]** ([[CON]]) | | Charisma | **[[CHA_MOD]]** ([[CHA]]) |

| Saving Throws | Modifier |
| :------------------ | :------: |
| Strength | **[[STR_ST]]** |
| Dexterity | **[[DEX_ST]]** |
| Constitution | **[[CON_ST]]** |
| Intelligence | **[[INT_ST]]** |
| Wisdom | **[[WIS_ST]]** |
| Charisma | **[[CHA_ST]]** |

| Skills | Modifier | | Skills | Modifier |
| :--------------- | :------: | :-: | :------------- | :------------------: |
| Acrobatics | [[Acrobatics]] | | Medicine | [[Medicine]] |
| Animal Handling | [[AnimalHandling]] | | Nature | [[Nature]] |
| Arcana | [[Arcana]] | | Perception | [[Perception]] |
| Athletics | [[Athletics]] | | Performance | [[Performance]] |
| Deception | [[Deception]] | | Persuasion | [[Persuasion]] |
| History | [[History]] | | Religion | [[Religion]] |
| Insight | [[Insight]] | | SleightOfHand | [[SleightOfHand]] |
| Intimidation | [[Intimidation]] | | Stealth | [[Stealth]] |
| Investigation | [[Investigation]] | | Survival | [[Survival]] |
7 changes: 5 additions & 2 deletions _layouts/sheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
src="https://capsule-render.vercel.app/api?type=waving&color=0:{{page.primary_color}},100:{{page.secondary_color}}&text={{page.title}}&fontSize=60&&fontColor={{page.title_font_color}}"
/>
<div class="content">
{% markdown %}
{% include statistics.md %}
{% endmarkdown %}
{{content}}
{% include spells-tooltip.html %}
</div>
Expand All @@ -16,8 +19,8 @@
</main>
{% include category-modal.html%}
</body>
<script src="{{site.baseurl}}/assets/js/stats_sub.js"></script>
<script src="{{site.baseurl}}/assets/js/spells.js"></script>
<script src="/assets/js/stats_sub.js"></script>
<script src="/assets/js/spells.js"></script>
<script>
substitute_stats("{{page.title}}")
.then(() => init_tooltip())
Expand Down
13 changes: 13 additions & 0 deletions _plugins/markdown.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Jekyll
class MarkdownBlock < Liquid::Block
def initialize(tag_name, text, tokens)
super
end
require "kramdown"
def render(context)
content = super
"#{Kramdown::Document.new(content).to_html}"
end
end
end
Liquid::Template.register_tag('markdown', Jekyll::MarkdownBlock)
76 changes: 26 additions & 50 deletions all_collections/_sheets/Pennino.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,6 @@ title_font_color: f6f1f4
categories: [Bard, Kenku]
---

| Class & Subclass | Background | Race | Alignment | Level |
|:----------------:| :--------: | :--: | :-------: | :---: |
| [Bard Road](https://5e.tools/classes.html#bard_phb,state:sub-road-hwcs=b1) | [Criminal](https://5e.tools/backgrounds.html#criminal_phb) | [Kenku](https://5e.tools/races.html#kenku_mpmm) | Neutral Good | [[LVL]] |

<div align="center">
<img src="/assets/img/Pennino.jpg" alt="Pennino" title="Pennino" width="70%">
</div>

---

## Statistics

| | | |
| --------------- | ---------------------- | ------------- |
| Proficiency: [[PROF]] | Passive Perception: [[PP]] | Initative: [[Initiative]] |
| Hit Points: [[HP]] | Armor Class: [[CA]] | Speed: 30ft |

| | | | | |
| :----------: |:-----------:| :-: | :----------: | :---------: |
| Strength | **[[STR_MOD]]** ([[STR]]) | | Intelligence | **[[INT_MOD]]** ([[INT]]) |
| Dexterity | **[[DEX_MOD]]** ([[DEX]]) | | Wisdom | **[[WIS_MOD]]** ([[WIS]]) |
| Constitution | **[[CON_MOD]]** ([[CON]]) | | Charisma | **[[CHA_MOD]]** ([[CHA]]) |

| Saving Throws | Modifier |
| :------------------ | :------: |
| Strength | **[[STR_ST]]** |
| Dexterity | **[[DEX_ST]]** |
| Constitution | **[[CON_ST]]** |
| Intelligence | **[[INT_ST]]** |
| Wisdom | **[[WIS_ST]]** |
| Charisma | **[[CHA_ST]]** |

| Skills | Modifier | | Skills | Modifier |
| :--------------- | :------: | :-: | :------------- | :------------------: |
| Acrobatics | [[Acrobatics]] | | Medicine | [[Medicine]] |
| Animal Handling | [[AnimalHandling]] | | Nature | [[Nature]] |
| Arcana | [[Arcana]] | | Perception | [[Perception]] |
| Athletics | [[Athletics]] | | Performance | [[Performance]] |
| Deception | [[Deception]] | | Persuasion | [[Persuasion]] |
| History | [[History]] | | Religion | [[Religion]] |
| Insight | [[Insight]] | | SleightOfHand | [[SleightOfHand]] |
| Intimidation | [[Intimidation]] | | Stealth | [[Stealth]] |
| Investigation | [[Investigation]] | | Survival | [[Survival]] |


**Other Proficiencies**:
- thieves tools
- herbalism kits (subclass)
Expand All @@ -70,21 +25,35 @@ categories: [Bard, Kenku]

## Features and Traits

### Race

- **Base Stats** (11, 13, 16, 13, 17, 17)
- **Languages**: Common, Elvish, Dwarvish, Gnomish
- **Ability Score**: (+1 Dex, +1 Wisdom, +1 Charisma)
- **Ability Score Improvement**: (+2 Wisdom)
- **Criminal Contact**: You have a reliable and trustworthy contact who acts as your liaison to a network of other criminals. You know how to get messages to and from your contact, even over great distances; specifically, you know the local messengers, corrupt caravan masters, and seedy sailors who can deliver messages for you.
- **Expert Duplication**: When you copy writing or craftwork produced by yourself or someone else, you have advantage on any ability checks you make to produce an exact duplicate.
- **Kenku Recall**: (prof Survival Insight) When you make an ability check using any skill in which you have proficiency, you can give yourself advantage on the check before rolling the d20 (Charges = Proficiency, Recharge on Long Rest)
- **Mimicry** You can accurately mimic sounds you have heard, including voices. A creature that hears the sounds you make can tell they are imitations only with a successful Wisdom (Insight) check against a DC of 8 + proficiency + Charisma.

### Class

- **Ability Score Improvements**:
- +1 Wisdom, +1 Int
- [Telekinetic](https://2014.5e.tools/feats.html#telekinetic_tce), +1 Wisdom
- **Bardic Inspiration** D8
- **Jack of all Trades** half proficiency for rolls without proficiency
- **Song of Rest** D6
- **Bonus Proficiencies** Herbalism Kits, 2 Languages, 1 Skill
- **Wanderer's Lore**: When a creature has a Bardic Inspiration die granted by you, they may make a single Arcana, History, Nature, or Religion check with advantage. The creature may choose whether or not to add the Bardic Inspiration die to this roll.
- **Expertise** (2) Perception, Deception
- **Font Of Inspiration**: Recover Inspiration on short rest
- **Countercharm**:

### Feats

- **Telekinetic**:
- Mage Hand cantrip: no components, invisible, range +30 feet. Spellcasting ability Wisdom.
- Bonus Action, you can telekinetically shove one creature you can see within 30 feet of you Target Strength saving throw (DC 8 + [[PROF]] + [[WIS_MOD]]) or be moved 5 feet toward you or away from you. A creature can willingly fail this save.

## Tricks

Expand Down Expand Up @@ -117,24 +86,31 @@ Pennino è un Kenku dal manto nero, che indossa una mantellina bianco-gialla. Po

| Cantrips |
| --------------------------------------------------------------------- |
| [Mage Hand](https://5e.tools/spells.html#mage%20hand_phb) |
| [Vicious Mockery](https://5e.tools/spells.html#vicious%20mockery_phb) |
| [Mending](https://5e.tools/spells.html#mending_phb) |
| [Mage Hand](https://5e.tools/spells.html#mage%20hand_phb) (Telekinetic) |

**Telekinetic Mage Hand**: No Components, Invisible, +30feet range, Wisdom Modifier

| 1st level (4 slots) |
| ------------ |
| [Healing Word](https://5e.tools/spells.html#healing%20word_phb)|
| [Cure Wounds](https://5e.tools/spells.html#cure%20wounds_phb) |
| [Dissonant Whispers](https://5e.tools/spells.html#dissonant%20whispers_phb) |
| [Tasha's Hideous Laughter](https://5e.tools/spells.html#tasha's%20hideous%20laughter_phb) |
| [Speak with Animals](https://2014.5e.tools/spells.html#speak%20with%20animals_phb) |

| 2nd level (3 slots) |
| -------------------- |
| [Cloud of Daggers](https://5e.tools/spells.html#cloud%20of%20daggers_phb) |
| [Silence](https://5e.tools/spells.html#silence_phb) |
| [Knock](https://2014.5e.tools/spells.html#knock_phb) |

| 3rd level (3 slots) |
| -------------------- |
| [Mass Healing Word](https://5e.tools/spells.html#mass%20healing%20word_phb) |
| [Speak with Plants](https://2014.5e.tools/spells.html#speak%20with%20plants_phb) |
| [Enemies Abound](https://5e.tools/spells.html#enemies%20abound_xge) |
| [Speak With Dead](https://5e.tools/spells.html#speak%20with%20dead_phb) |
| [Speak with Dead](https://5e.tools/spells.html#speak%20with%20dead_phb) |

| 4th level (2 slots) |
| -------------------- |
| [Compulsion](https://2014.5e.tools/spells.html#compulsion_phb) |
4 changes: 4 additions & 0 deletions assets/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,7 @@ hr {
border-right: none !important;
margin-bottom: 1.75rem !important;
}

.w-50 {
width: 50%
}
2 changes: 1 addition & 1 deletion assets/css/post.css
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,4 @@ li {
border: none;
padding: 5px 10px;
cursor: pointer;
}
}
Binary file removed assets/img/Pennino.jpg
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file added assets/img/sheets/Pennino.webp
Binary file not shown.
129 changes: 108 additions & 21 deletions assets/js/stats_sub.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

stats_map = {
"STR": stat("Strength", ["Athletics"]),
"DEX": stat("Dexterity", ["Acrobatics", "SleightOfHand", "Stealth", "Initiative"]),
Expand All @@ -14,45 +13,52 @@ function stat(name, skills) {

let proficiency = 0

function substitute_stats(title) {

return fetch('/assets/json/' + title + ".json")
.then((response) => response.json())
.then((json) => json_substitute(json))
.catch(function(error) {
console.log("Can't read JSON stat file" + error);
})
async function substitute_stats(title) {
try {
const response = await fetch('/assets/json/' + title + ".json");
const data_file = await response.json();
const substitution_map = prepare_json(data_file);
const class_map = await class_info(data_file)
const background_map = await background_info(data_file)
const race_map = await race_info(data_file)
json_substitute({...substitution_map, ...class_map, ...background_map, ...race_map});
} catch (error) {
console.log("Can't read JSON stat file" + error);
}
}

function json_substitute(stats_file){
proficiency = Math.ceil(stats_file["LVL"]/4)+1
substitution_map = {
"LVL": stats_file["LVL"],
function prepare_json(data_file){
proficiency = Math.ceil(data_file["LVL"]/4)+1
let substitution_map = {
"LVL": data_file["LVL"],
"PROF": proficiency,
"CA": stats_file["CA"]
"CA": data_file["CA"]
}

for(let stat in stats_map) {
base_mod = stat_mod(stats_file[stat])
substitution_map[stat] = stats_file[stat]
base_mod = stat_mod(data_file[stat])
substitution_map[stat] = data_file[stat]
substitution_map[stat+"_MOD"] = base_mod
substitution_map[stat+"_ST"] = st_mod(base_mod, stats_file, stat)
substitution_map[stat+"_ST"] = st_mod(base_mod, data_file, stat)

for(let skill of stats_map[stat]["skills"]){
substitution_map[skill] = skill_mod(base_mod, stats_file, skill)
substitution_map[skill] = skill_mod(base_mod, data_file, skill)
}
substitution_map
}
substitution_map["PP"] = substitution_map['Perception']+10
substitution_map["HP"] = stats_file["HP"] || calc_hp(stats_file["LVL"], substitution_map["CON_MOD"], stats_file["HITDICE"])
substitution_map["HP"] = data_file["HP"] || calc_hp(data_file["LVL"], substitution_map["CON_MOD"], data_file["HITDICE"])

if(stats_file["SpellcastingAbility"]) {
stat = stats_file["SpellcastingAbility"]
if(data_file["SpellcastingAbility"]) {
stat = data_file["SpellcastingAbility"]
substitution_map["SPELL_AB"] = stats_map[stat]["name"]
substitution_map["SPELL_DC"] = 8 + proficiency + substitution_map[stat+"_MOD"]
substitution_map["SPELL_ATK"] = proficiency + substitution_map[stat+"_MOD"]
}
return {...data_file, ...substitution_map}
}

function json_substitute(substitution_map){
for(let key in substitution_map) {
value = substitution_map[key]
document.body.innerHTML = document.body.innerHTML.split(build_keyword(key)).join(value);
Expand Down Expand Up @@ -91,3 +97,84 @@ function build_keyword(key) {
function signed(n) {
return (n<=0?"-":"+") + n
}

// Class

async function class_info(data_file){
let data = {}
let class_url = `https://2014.5e.tools/data/class/fluff-class-${data_file?.CLASS?.toLowerCase()}.json`
await fetch(class_url)
.then((response) => response.json())
.then((json) => data = json_class_info(json, data_file))
.catch(function(error) {
console.log("Can't read this class' JSON" + error);
})
return data
}

function json_class_info(json, data_file) {
let giuseppe = json["classFluff"][0]
let subclass = json["subclassFluff"].filter((subclass) => {
return [subclass["name"].toLowerCase(), subclass["shortName"].toLowerCase()].includes(data_file["SUBCLASS"].toLowerCase())
})[0]

return {
CLASS_URL: `https://5e.tools/classes.html#${giuseppe["name"].toLowerCase()}_${giuseppe["source"].toLowerCase()},state:sub-${subclass["shortName"].toLowerCase()}-${subclass["source"].toLowerCase()}=b1`,
CLASS: giuseppe["name"],
SUBCLASS_SHORT: subclass["shortName"],
SUBCLASS: subclass["name"]
}
}

// Background

async function background_info(data_file) {
let data = {}
let background_url = `https://2014.5e.tools/data/backgrounds.json`
await fetch(background_url)
.then((response) => response.json())
.then((json) => data = json_background_info(json, data_file))
.catch(function(error) {
console.log("Can't read this background's JSON" + error);
})
return data
}

function json_background_info(json, data_file) {
let background = json["background"].filter((background) => {
return background["name"].toLowerCase() === data_file["BACKGROUND"].toLowerCase()
})[0]

return {
BACKGROUND: background["name"],
BACKGROUND_URL: `https://5e.tools/backgrounds.html#${background["name"].toLowerCase()}_${background["source"].toLowerCase()}`
}
}

// Race

async function race_info(data_file) {
let data = {}
let race_url = `https://2014.5e.tools/data/races.json`
await fetch(race_url)
.then((response) => response.json())
.then((json) => data = json_race_info(json, data_file))
.catch(function(error) {
console.log("Can't read this race's JSON" + error);
})
return data
}

function json_race_info(json, data_file) {
let race = json["race"].filter((race) => {
filter_name = race["name"].toLowerCase() === data_file["RACE"].toLowerCase()
if(!data_file["RACE_SOURCE"])
return filter_name
filter_source = race["source"].toLowerCase() === data_file["RACE_SOURCE"].toLowerCase()
return filter_name && filter_source
})[0]

return {
RACE_URL: `https://2014.5e.tools/races.html#${race["name"].toLowerCase()}_${race["source"].toLowerCase()}`
}
}
Loading

0 comments on commit dc8079b

Please sign in to comment.