feat: refonte vita
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Kazhnuz 2024-09-16 19:28:07 +02:00
parent ed6e1e6a47
commit 5cf1a8fcfc
8 changed files with 45 additions and 11 deletions

View file

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

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,20 @@
local VitaHolder = Object:extend()
function VitaHolder:new(key, datas)
self.key = key
self.datas = datas
self.commands = {}
end
function VitaHolder:applyCommand(command, args)
self.commands[command] = args
end
function VitaHolder:reduce(level, mode)
local stat = (self.commands.base + (self.commands.add or 0))
stat = stat * (level+1)
stat = stat + (self.commands.bonus or 0)
return math.floor(stat)
end
return VitaHolder

View file

@ -7,6 +7,7 @@ local StatHolder = require "classes.dataholders.statholder"
local CompetenceHolder = require "classes.dataholders.competenceholder"
local ArmesHolder = require "classes.dataholders.armesholder"
local ArmureHolder = require "classes.dataholders.armureholder"
local VitaHolder = require "classes.dataholders.vitaholder"
local BoostHolder = require "classes.dataholders.boostholder"
@ -66,6 +67,8 @@ function DataList.getHolder(key, value)
return ArmureHolder(key, value)
elseif (value.dataType == "armes") then
return ArmesHolder(key, value)
elseif (value.dataType == "vita") then
return VitaHolder(key, value)
end
return SimpleHolder(key, value)
end

View file

@ -2,3 +2,14 @@ local datas = {}
datas.hp = {1, 1, 2, 3, 4, 5, 6}
datas.competences = {10, 30, 30, 50, 50, 70}
datas.stats = {
[0] = {base = 40, malus = {20, 30, 30}, bonus = {50, 50, 60}},
[1] = {base = 50, malus = {20, 30, 40}, bonus = {60, 70, 80}},
[2] = {base = 50, malus = {30, 30, 40}, bonus = {70, 80, 80}},
[3] = {base = 50, malus = {30, 30, 40}, bonus = {80, 80, 100}}, -- Potentiel
[4] = {base = 50, malus = {30, 40, 40}, bonus = {80, 80, 120}},
[5] = {base = 50, malus = {30, 40, 40}, bonus = {80, 100, 140}}, -- Potentiel+
[6] = {base = 60, malus = {30, 40, 50}, bonus = {80, 120, 150}},
[7] = {base = 60, malus = {30, 40, 50}, bonus = {80, 130, 180}}, -- Supérieur au max des joueurs
[8] = {base = 60, malus = {40, 40, 50}, bonus = {120, 150, 200}},
}

View file

@ -7,9 +7,9 @@ datas.stats = {
[1] = {base = 50, malus = {20, 30, 40}, bonus = {60, 70, 80}},
[2] = {base = 50, malus = {30, 30, 40}, bonus = {70, 80, 80}},
[3] = {base = 50, malus = {30, 30, 40}, bonus = {80, 80, 100}}, -- Potentiel
[4] = {base = 50, malus = {30, 30, 40}, bonus = {80, 80, 120}},
[5] = {base = 50, malus = {30, 30, 40}, bonus = {80, 100, 140}}, -- Potentiel+
[6] = {base = 50, malus = {30, 30, 40}, bonus = {80, 120, 150}},
[7] = {base = 50, malus = {30, 30, 40}, bonus = {80, 80, 180}}, -- Supérieur au max des joueurs
[8] = {base = 50, malus = {30, 30, 40}, bonus = {80, 80, 200}},
[4] = {base = 50, malus = {30, 40, 40}, bonus = {80, 80, 120}},
[5] = {base = 50, malus = {30, 40, 40}, bonus = {80, 100, 140}}, -- Potentiel+
[6] = {base = 60, malus = {30, 40, 50}, bonus = {80, 120, 150}},
[7] = {base = 60, malus = {30, 40, 50}, bonus = {80, 130, 180}}, -- Supérieur au max des joueurs
[8] = {base = 60, malus = {40, 40, 50}, bonus = {120, 150, 200}},
}

View file

@ -35,7 +35,7 @@ local function addListCommands(name, value)
end
for key, value in pairs(struct) do
if (value.dataType == "stat" or value.dataType == "armure") then
if (value.dataType == "stat" or value.dataType == "armure" or value.dataType == "vita") then
addStatCommands(key, value)
elseif (value.dataType == "list") then
addListCommands(key, value)

View file

@ -19,8 +19,8 @@ return {
dis= {dataType= "stat", modulo= 5, default= 50, max=255, min=10, to="stats.dis"},
rel= {dataType= "stat", modulo= 5, default= 50, max=255, min=10, to="stats.rel"},
per= {dataType= "stat", modulo= 5, default= 50, max=255, min=10, to="stats.per"},
pv= {dataType= "stat", modulo= 1, default= 12, max=9999999, min=1, to="vita.pv", lvl=1},
pe= {dataType= "stat", modulo= 1, default= 12, max=9999999, min=1, to="vita.pe", lvl=1},
pv= {dataType= "vita", modulo= 1, default= 12, max=9999999, min=1, to="vita.pv", lvl=1},
pe= {dataType= "vita", modulo= 1, default= 12, max=9999999, min=1, to="vita.pe", lvl=1},
eclat= {dataType= "stat", modulo= 1, default= 10, max=200, min=1, to="vita.eclat"},
armurephy= {dataType= "armure", modulo= 1, default= 0, max=9999999, min=0, to="armure.phy"},
armurepsy= {dataType= "armure", modulo= 1, default= 0, max=9999999, min=0, to="armure.psy"},