Draft: Ajout d'un bestiaire #109

Open
kazhnuz wants to merge 6 commits from bestiaire into main
20 changed files with 56 additions and 36 deletions
Showing only changes of commit fcea7f2e4b - Show all commits

View file

@ -1 +1 @@
[{"nom":"Animaux","folder":"animaux","list":[{"nom":"Belier","categorie":"biologique","type":"bête","level":1},{"nom":"Chien","categorie":"biologique","type":"bête","level":0},{"nom":"Petit Chien","categorie":"biologique","type":"bête","level":0},{"nom":"Loup","categorie":"biologique","type":"bête","level":5},{"nom":"Chef-Loup","categorie":"biologique","type":"bête","level":6},{"nom":"Loup Géant","categorie":"biologique","type":"bête","level":9},{"nom":"Cheval","categorie":"biologique","type":"bête","level":3},{"nom":"Chèvre","categorie":"biologique","type":"bête","level":1},{"nom":"Chat","categorie":"biologique","type":"bête","level":0},{"nom":"Lynx","categorie":"biologique","type":"bête","level":3},{"nom":"Fauve","categorie":"biologique","type":"bête","level":7},{"nom":"Lion géant","categorie":"biologique","type":"bête","level":10},{"nom":"Ours","categorie":"biologique","type":"bête","level":8},{"nom":"Rat","categorie":"biologique","type":"bête","level":0},{"nom":"Chauve souris","categorie":"biologique","type":"aerien","level":1},{"nom":"Gros rat","categorie":"biologique","type":"bête","level":2},{"nom":"Nuée de rats","categorie":"biologique","type":"bête","level":3},{"nom":"Nuée de chauve souris","categorie":"biologique","type":"aerien","level":4},{"nom":"Rat pestiféré","categorie":"biologique","type":"bête","level":4},{"nom":"Rat géant","categorie":"biologique","type":"bête","level":4},{"nom":"Chauve souris vampire","categorie":"biologique","type":"aerien","level":4},{"nom":"Rat géant pestiféré","categorie":"biologique","type":"bête","level":5},{"nom":"Nuée de rats pestiféré","categorie":"biologique","type":"bête","level":7},{"nom":"Nuée de chauve souris vampire","categorie":"biologique","type":"aerien","level":7},{"nom":"Renard","categorie":"biologique","type":"bête","level":2},{"nom":"Vache","categorie":"biologique","type":"bête","level":3}],"description":"Des animaux génériques et communs (ou moins communs)"},{"nom":"Démons et enfer","folder":"demons","list":[{"nom":"Chien des enfers","categorie":"biologique","type":"bête","level":1},{"nom":"Chihuahua infernal","categorie":"biologique","type":"bête","level":1},{"nom":"Loup des enfers","categorie":"biologique","type":"bête","level":7},{"nom":"Chef-Loup des enfers","categorie":"biologique","type":"bête","level":8},{"nom":"Loup du pandémonium","categorie":"biologique","type":"bête","level":11},{"nom":"Loup Géant du pandémonium","categorie":"biologique","type":"bête","level":15}],"description":"Créatures des enfers et satanistes"}] [{"list":[{"level":0,"type":"bête","rang":"E","nom":"Belier","categorie":"biologique"},{"level":0,"type":"bête","rang":"E","nom":"Chien","categorie":"biologique"},{"level":0,"type":"bête","rang":"E","nom":"Petit Chien","categorie":"biologique"},{"level":2,"type":"bête","rang":"C","nom":"Loup","categorie":"biologique"},{"level":3,"type":"bête","rang":"B","nom":"Chef-Loup","categorie":"biologique"},{"level":4,"type":"bête","rang":"A","nom":"Loup Géant","categorie":"biologique"},{"level":2,"type":"bête","rang":"C","nom":"Cheval","categorie":"biologique"},{"level":0,"type":"bête","rang":"E","nom":"Chèvre","categorie":"biologique"},{"level":0,"type":"bête","rang":"E","nom":"Chat","categorie":"biologique"},{"level":1,"type":"bête","rang":"D","nom":"Lynx","categorie":"biologique"},{"level":3,"type":"bête","rang":"B","nom":"Fauve","categorie":"biologique"},{"level":4,"type":"bête","rang":"A","nom":"Lion géant","categorie":"biologique"},{"level":3,"type":"bête","rang":"B","nom":"Ours","categorie":"biologique"},{"level":0,"type":"bête","rang":"E","nom":"Rat","categorie":"biologique"},{"level":1,"type":"aerien","rang":"D","nom":"Chauve souris","categorie":"biologique"},{"level":1,"type":"bête","rang":"D","nom":"Gros rat","categorie":"biologique"},{"level":1,"type":"bête","rang":"D","nom":"Nuée de rats","categorie":"biologique"},{"level":1,"type":"aerien","rang":"D","nom":"Nuée de chauve souris","categorie":"biologique"},{"level":1,"type":"bête","rang":"D","nom":"Rat pestiféré","categorie":"biologique"},{"level":2,"type":"bête","rang":"C","nom":"Rat géant","categorie":"biologique"},{"level":2,"type":"aerien","rang":"C","nom":"Chauve souris vampire","categorie":"biologique"},{"level":3,"type":"bête","rang":"B","nom":"Rat géant pestiféré","categorie":"biologique"},{"level":3,"type":"bête","rang":"B","nom":"Nuée de rats pestiféré","categorie":"biologique"},{"level":3,"type":"aerien","rang":"B","nom":"Nuée de chauve souris vampire","categorie":"biologique"},{"level":1,"type":"bête","rang":"D","nom":"Renard","categorie":"biologique"},{"level":2,"type":"bête","rang":"C","nom":"Vache","categorie":"biologique"}],"nom":"Animaux","folder":"animaux","description":"Des animaux génériques et communs (ou moins communs)"},{"list":[{"level":2,"type":"bête","rang":"C","nom":"Chihuahua infernal","categorie":"biologique"},{"level":2,"type":"bête","rang":"C","nom":"Chien des enfers","categorie":"biologique"},{"level":3,"type":"bête","rang":"B","nom":"Loup des enfers","categorie":"biologique"},{"level":4,"type":"bête","rang":"A","nom":"Chef-Loup des enfers","categorie":"biologique"},{"level":5,"type":"bête","rang":"S","nom":"Loup du pandémonium","categorie":"biologique"}],"nom":"Démons et enfer","folder":"demons","description":"Créatures des enfers et satanistes"}]

File diff suppressed because one or more lines are too long

View file

@ -23,7 +23,8 @@ end
function BoostHolder:apply() function BoostHolder:apply()
for key, value in pairs(self.table) do for key, value in pairs(self.table) do
self.parent:addToHolder(key, "lvl", self:getValue(key, value)) -- TODO : a changer entièrement
self.parent:addToHolder(key, "lvl", self:getValue(key, value * 2))
end end
end end

View file

@ -10,6 +10,8 @@ local ArmureHolder = require "classes.dataholders.armureholder"
local BoostHolder = require "classes.dataholders.boostholder" local BoostHolder = require "classes.dataholders.boostholder"
local rank = require "levels.ranks"
function RawData.fromLine(line) function RawData.fromLine(line)
line = utils.removeComment(line) line = utils.removeComment(line)
if (#line == 0) then if (#line == 0) then
@ -135,6 +137,12 @@ function DataList:reduce()
if (self.forcedName ~= nil) then if (self.forcedName ~= nil) then
self.reducedList["name"] = self.forcedName self.reducedList["name"] = self.forcedName
end end
if (level > 6) then
print("[WARNING] Les niveaux au dessus de 6 ne sont pas encore implémentés (" .. self.reducedList["name"] .. ":" .. level .. ")")
end
self.reducedList["rang"] = rank[math.min(level + 1, #rank)]
end end
function DataList:addToReducedList(key, data) function DataList:addToReducedList(key, data)
@ -162,7 +170,7 @@ function DataList:prepareJson(simplercreatures, creatures, parent)
self.reducedList.parent = parent self.reducedList.parent = parent
table.insert(simplercreatures, {nom = self.reducedList.name, level = self.reducedList.level, type = self.reducedList.type, categorie = self.reducedList.categorie}) table.insert(simplercreatures, {nom = self.reducedList.name, rang = self.reducedList.rang, level = self.reducedList.level, type = self.reducedList.type, categorie = self.reducedList.categorie})
table.insert(creatures, self.reducedList) table.insert(creatures, self.reducedList)
end end

View file

@ -1,6 +1,6 @@
type;bete type;bete
mixins;bases/corps/quadripede mixins;bases/corps/quadripede
level;1 level;0
name;Belier name;Belier
// 4 boosts de stats // 4 boosts de stats

View file

@ -1,5 +1,5 @@
beast;Chien;0;generique/canides beast;Chien;0;generique/canides
beast;Petit Chien;0;generique/canides;bases/tailles/petit beast;Petit Chien;0;generique/canides;bases/tailles/petit
beast;Loup;5;generique/canides beast;Loup;2;generique/canides
beast;Chef-Loup;6;generique/canides beast;Chef-Loup;3;generique/canides
beast;Loup Géant;9;generique/canides;bases/tailles/grand beast;Loup Géant;4;generique/canides;bases/tailles/grand

View file

@ -1,7 +1,7 @@
type;bete type;bete
mixins;bases/corps/quadripede mixins;bases/corps/quadripede
mixins;bases/tailles/grand mixins;bases/tailles/grand
level;3 level;2
name;Cheval name;Cheval
// 4 boosts de stats // 4 boosts de stats

View file

@ -1,6 +1,6 @@
type;bete type;bete
mixins;bases/corps/quadripede mixins;bases/corps/quadripede
level;1 level;0
name;Chèvre name;Chèvre
// 4 boosts de stats // 4 boosts de stats

View file

@ -1,4 +1,4 @@
beast;Chat;0;generique/felides;bases/tailles/petit beast;Chat;0;generique/felides;bases/tailles/petit
beast;Lynx;3;generique/felides beast;Lynx;1;generique/felides
beast;Fauve;7;generique/felides beast;Fauve;3;generique/felides
beast;Lion géant;10;generique/felides;bases/tailles/grand beast;Lion géant;4;generique/felides;bases/tailles/grand

View file

@ -1,3 +1,3 @@
mixins;generique/ursides mixins;generique/ursides
level;8 level;3
name;Ours name;Ours

View file

@ -1,11 +1,11 @@
beast;Rat;0;generique/rat beast;Rat;0;generique/rat
beast;Chauve souris;1;generique/rat;types/aerien beast;Chauve souris;1;generique/rat;types/aerien
beast;Gros rat;2;generique/rat;bases/tailles/petit beast;Gros rat;1;generique/rat;bases/tailles/petit
beast;Nuée de rats;3;generique/rat;bases/special/nuee beast;Nuée de rats;1;generique/rat;bases/special/nuee
beast;Nuée de chauve souris;4;generique/rat;types/aerien beast;Nuée de chauve souris;1;generique/rat;types/aerien
beast;Rat pestiféré;4;generique/rat;bases/special/pestilent beast;Rat pestiféré;1;generique/rat;bases/special/pestilent
beast;Rat géant;4;generique/rat beast;Rat géant;2;generique/rat
beast;Chauve souris vampire;4;generique/rat;types/aerien;bases/special/vampirisme beast;Chauve souris vampire;2;generique/rat;types/aerien;bases/special/vampirisme
beast;Rat géant pestiféré;5;generique/rat;generique/rat;bases/special/pestilent beast;Rat géant pestiféré;3;generique/rat;generique/rat;bases/special/pestilent
beast;Nuée de rats pestiféré;7;generique/rat;bases/special/nuee;bases/special/pestilent beast;Nuée de rats pestiféré;3;generique/rat;bases/special/nuee;bases/special/pestilent
beast;Nuée de chauve souris vampire;7;generique/rat;types/aerien;bases/special/nuee;bases/special/vampirisme beast;Nuée de chauve souris vampire;3;generique/rat;types/aerien;bases/special/nuee;bases/special/vampirisme

View file

@ -1,6 +1,6 @@
type;bete type;bete
mixins;bases/corps/quadripede mixins;bases/corps/quadripede
level;2 level;1
name;Renard name;Renard
// 4 boosts de stats // 4 boosts de stats

View file

@ -1,7 +1,7 @@
type;bete type;bete
mixins;bases/corps/quadripede mixins;bases/corps/quadripede
mixins;bases/tailles/grand mixins;bases/tailles/grand
level;3 level;2
name;Vache name;Vache
// 4 boosts de stats // 4 boosts de stats

View file

@ -1,6 +1,5 @@
beast;Chien des enfers;1;generique/canides beast;Chihuahua infernal;2;generique/canides;bases/tailles/petit;bases/special/demons-betes
beast;Chihuahua infernal;1;generique/canides;bases/tailles/petit;bases/special/demons-betes beast;Chien des enfers;2;generique/canides
beast;Loup des enfers;7;generique/canides;bases/special/demons-betes beast;Loup des enfers;3;generique/canides;bases/special/demons-betes
beast;Chef-Loup des enfers;8;generique/canides;bases/special/demons-betes beast;Chef-Loup des enfers;4;generique/canides;bases/special/demons-betes
beast;Loup du pandémonium;11;generique/canides;bases/tailles/grand beast;Loup du pandémonium;5;generique/canides;bases/tailles/grand;bases/special/demons-betes
beast;Loup Géant du pandémonium;15;generique/canides;bases/tailles/grand;bases/special/demons-betes

View file

@ -0,0 +1,4 @@
local datas = {}
datas.hp = {1, 1, 2, 3, 4, 5, 6}
datas.competences = {10, 30, 30, 50, 50, 70}

7
bestiaire/levels/pnj.lua Normal file
View file

@ -0,0 +1,7 @@
local datas = {}
datas.hp = {1, 1, 2, 3, 4, 5, 6}
datas.competences = {10, 30, 30, 50, 50, 70}
datas.stats = {
high = 80; -- La statistique max "naturel", peut être dépassé par les stats de base, mais ne peut aller au dessus
}

View file

@ -0,0 +1 @@
return {"E", "D", "C", "B", "A", "S", "X", "", "", "--"}

View file

@ -12,7 +12,7 @@ parent: Bestiaire
<table class="dataTables"> <table class="dataTables">
<thead> <thead>
<tr> <tr>
<th>Niveau</th> <th>Rang</th>
<th>Nom</th> <th>Nom</th>
<th>Type</th> <th>Type</th>
<th>Catégorie</th> <th>Catégorie</th>
@ -22,7 +22,7 @@ parent: Bestiaire
<tbody> <tbody>
{%- for creature in creatures -%} {%- for creature in creatures -%}
<tr> <tr>
<td>{{ creature.level }} </td> <td><span aria-hidden="true" style="opacity:0;position:absolute;">({{ creature.level }})</span> {{ creature.rang }} </td>
<td> <a href="/mobs/bestiaire/creatures/{{ creature.name | slugify }}">{{ creature.name }}</a> </td> <td> <a href="/mobs/bestiaire/creatures/{{ creature.name | slugify }}">{{ creature.name }}</a> </td>
<td>{{ creature.type }} </td> <td>{{ creature.type }} </td>
<td>{{ creature.categorie }} </td> <td>{{ creature.categorie }} </td>

View file

@ -10,7 +10,7 @@ parent: "{{ creature.parent }}"
# {{ creature.name }} # {{ creature.name }}
Créature de type {{ creature.type }}, dans la catégorie *{{ creature.categorie }}*, de niveau {{ creature.level }} et dans le groupe « {{ creature.parent }} ». Créature de type {{ creature.type }}, dans la catégorie *{{ creature.categorie }}*, de rang {{ creature.rang }} et dans le groupe « {{ creature.parent }} ».
| Pression | Faiblesses | Résistences | Immunités | | Pression | Faiblesses | Résistences | Immunités |
|:-:|:-:|:-:|:-:| |:-:|:-:|:-:|:-:|

View file

@ -20,7 +20,7 @@ title: {{ bestiaire.nom }}
<table class="dataTables"> <table class="dataTables">
<thead> <thead>
<tr> <tr>
<th>Niveau</th> <th>Rang</th>
<th>Nom</th> <th>Nom</th>
<th>Type</th> <th>Type</th>
<th>Catégorie</th> <th>Catégorie</th>
@ -30,7 +30,7 @@ title: {{ bestiaire.nom }}
<tbody> <tbody>
{%- for creature in bestiaire.list -%} {%- for creature in bestiaire.list -%}
<tr> <tr>
<td>{{ creature.level }} </td> <td><span aria-hidden="true" style="opacity:0;position:absolute;">({{ creature.level }})</span> {{ creature.rang }} </td>
<td> <a href="/mobs/bestiaire/creatures/{{ creature.nom | slugify }}">{{ creature.nom }}</a> </td> <td> <a href="/mobs/bestiaire/creatures/{{ creature.nom | slugify }}">{{ creature.nom }}</a> </td>
<td>{{ creature.type }} </td> <td>{{ creature.type }} </td>
<td>{{ creature.categorie }} </td> <td>{{ creature.categorie }} </td>