Battle Brothers

File information

Last updated

Original upload

Created by

Oltopeteeh

Uploaded by

Oltopeteeh

Virus scan

Safe to use

About this mod

Each armor +20% cost, stamina penalty +5 armor. Money's and upgrade recipe for body and head armor.

Permissions and credits
Changelogs
Change basic formula of cost: added dependence on stats.

Each Armor (Condition) for Body = +20% cost (5 armor = x2, next tier).
Each Stamina Penalty = +5 armor (without influence of cost).

Each Resolve (Bravery) = +80% cost (=4 armor).
Each +% Resolve = +100% cost (=5 armor, next tier).

Stamina penalty = -1 initiative and fatigue (brawny: -30% penalty, some weapon have 200-250% armor damage, etc.).
In theory, there should be a triple here, or even a deuce, but I try to keep the numbers from the canon.
Therefore, 5 is left, which also sometimes flashes in the calculations, albeit less often than 4-, or 6+, for very light armor, like a magic robe 40, -1, with a price of a miserable 100 coins, although the noble tunic has a price of 500 coins , the same 40 armor and -2 stamina. This is not normal and I am trying to fix it with a mod.


Armor for Head /2 (8k instead 16k).
1 Stamina Penalty (Body) => -1 Intitiative (Head), -2 SP (B) => -1 SP (H).

____
Example of code
____

//1 //8-16 (12 u3+9)
///a //legend_sackcloth_tattered, 5, 5  //mod 5-0/15-1  //Tattered Sackcloth

::mods_hookNewObject("items/legend_armor/cloth/legend_sackcloth_tattered",function(o){if(o.m.Value== 5 &&o.m.ConditionMax== 5 ){
local lv=1; o.m.StaminaModifier= -0 -this.Math.rand(0,1); o.m.Condition=this.Math.rand(0,5)+lv*5-o.m.StaminaModifier*5; o.m.ConditionMax=o.m.Condition; o.m.Value=this.Math.round(this.Math.pow(2,2+lv+(o.m.ConditionMax-lv*5+o.m.StaminaModifier*5)*0.2));
}});


//b2//legend_armor_hauberk_full_named, 5000, 125-150, -9-13  //m 135-17/150-19, but +25%= 126/145

::mods_hookNewObject("items/legend_armor/chain/legend_armor_hauberk_full_named", function(o) { if (o.m.Value == 5000 && o.m.StaminaModifier <= -9 && o.m.StaminaModifier >= -13){
local lv=10; o.m.StaminaModifier= -17 -this.Math.rand(0,2); o.m.Condition=this.Math.rand(0,5)+lv*5-o.m.StaminaModifier*5; o.m.ConditionMax=o.m.Condition; o.m.Value=this.Math.round(this.Math.pow(2,2+lv+(o.m.ConditionMax-lv*5+o.m.StaminaModifier*5)*0.2));
}});


//b//legend_armor_cloak_emperors, 15000, 30/40, -3, b+5"/10% //mod 25-3/40-5, b+9/10% (35-1, b9%) //_max

::mods_hookNewObject("items/legend_armor/named/legend_armor_cloak_emperors",function(o){if(o.m.Value== 15000 &&o.m.Condition>= 30 &&o.m.Condition<= 40 ){
local lv=11; local rnd=this.Math.rand(0,2); o.m.StaminaModifier= -4 -this.Math.rand(0,2); o.m.Condition= 5+this.Math.rand(0,5)-o.m.StaminaModifier*5;
if (rnd == 0){ o.m.BraveryMult = 1.08; o.m.Condition += 10 }
else if (rnd == 1){ o.m.BraveryMult = 1.09; o.m.Condition += 5 }
else{ o.m.BraveryMult = 1.1 }
o.m.ConditionMax=o.m.Condition; o.m.Value=this.Math.round(this.Math.pow(2,2+lv+(o.m.ConditionMax- 15 +rnd*5 +o.m.StaminaModifier*5)*0.2));
}});

// 9 nm+ //1024-2048 (1536 u. 384 +1152)
//legend_helmet_enclave_bevor, 750, 95, -7  //m 95-5/110-6, r+9/10  //Bevor

::mods_hookNewObject("items/legend_helmets/hood/legend_helmet_enclave_bevor",function(o){if(o.m.Value== 750 &&o.m.ConditionMax== 95 &&o.m.StaminaModifier== -7 ){
local lv= 9; o.m.StaminaModifier= -5; o.m.InitiativeModifier= -0; o.m.Vision=this.Math.rand(0,0)*-1; o.m.ResolveModifier=this.Math.rand(0,1)+lv-o.m.Vision; local randS=this.Math.rand(0,2); if(randS==1){o.m.InitiativeModifier-=1} else if (randS==2){o.m.StaminaModifier-=1}
o.m.Condition=this.Math.rand(0,5)+lv*5-o.m.StaminaModifier*10-o.m.InitiativeModifier*5; o.m.ConditionMax=o.m.Condition; o.m.Value=this.Math.round(this.Math.pow(2,1+lv+(o.m.ConditionMax-lv*5+o.m.StaminaModifier*10+o.m.InitiativeModifier*5+(o.m.ResolveModifier-lv+o.m.Vision)*5)*0.2));
}});


Note: named armor have very minor stamina penalty for it cost.
I add normal num (from normal item).
Example: 23-25 vs 31-33 for top plate (legend_armor_plate_full_greaves_named, L 10000, 185-225, -23-25 //mod 210-225, -31-33 //add 8)


____
Recipe
____

Add money's recipe of Lv11 layer armor (body and head), but upgrade: work in progress, because new patch of Legend strong change it and I don't want broken this balance.

Add upgrade recipe: 3 prev tier armor + 50% cost = armor next tier.

Add finalize recipe: 2 armor Lv11 (8k-16k dinar) + 4k dinar = armor Lv11 with max stats (16k).
If you lucky and already get 16k version in recipe normal Lv11, this operation not need :-)

____
1.1.8.4
____
Cost = x2 for tier (start: t1 with 8 dinar, end - t12 with 16384 dinar).


====
Know issue
====
  • Mod data not saved when loading.

Add temp solution: "(de)serialize" command for Value, ConditionMax in "item" file. Stamina Penalty in armor file.
Serious drawback of solution: likely need to start new game, save will be irreversibly changed by "extra" data, disabling mod make save broken.




====
Archive
====
Spoiler:  
Show

____
1.1.6.5
____
(Cloth, Tabard, Cloak: ok. Chain, Plate: work). 
Back vanila formula (5/5 for armor / stamina penalty), because chain and plate have many overnumbered armor with stamina penalty.

//legend_sackcloth_tattered, 5, 5, -0 //mod: 8/15, 5-0/15-1
::mods_hookNewObject("items/legend_armor/cloth/legend_sackcloth_tattered", function(o) { if (o.m.Value == 5 && o.m.ConditionMax == 5)
{   local level = 1; o.m.StaminaModifier = -0 -this.Math.rand(0,1); o.m.Condition = this.Math.rand(0,5)+(level-o.m.StaminaModifier)*5; o.m.ConditionMax = o.m.Condition;
o.m.Value = this.Math.round(7.8125*this.Math.pow(2,(o.m.ConditionMax-(level-o.m.StaminaModifier)*5)*0.2)); }
});


//legend_tunic_noble_named, 1500, 46/56, -0-2 //m 2000/4000, 45-0/60-2  //tn 500, 40 -2 //40 (+10%..25%) 44,50
::mods_hookNewObject("items/legend_armor/cloth/legend_tunic_noble_named", function(o) { if (o.m.Value == 1500)
{   o.m.StaminaModifier = this.Math.rand(0,2) * -1;
o.m.Condition = this.Math.rand(45,50) -o.m.StaminaModifier*5; o.m.ConditionMax = o.m.Condition;
o.m.Value = this.Math.round(2000 *this.Math.pow(2,(o.m.ConditionMax -45 +o.m.StaminaModifier*5)*0.2)); }
});


//legend_armor_cloak_emperors, 15000, 30/40, -3, b+5"/10%  //mod 8000/16000, 25-3/40-5, b10%; maybe 50-6 for b+8%;

::mods_hookNewObject("items/legend_armor/named/legend_armor_cloak_emperors", function(o) { if (o.m.Value == 15000)
{
local randomize = this.Math.rand(0,2);
o.m.StaminaModifier = this.Math.rand(4,6) * -1;
o.m.Condition = 5 -o.m.StaminaModifier*5 + this.Math.rand(0,5);
if (randomize == 0) { o.m.BraveryMult = 1.08; o.m.Condition += 10 }
else if (randomize == 1) { o.m.BraveryMult = 1.09; o.m.Condition +=  5 }
else { o.m.BraveryMult = 1.1 }
o.m.ConditionMax = o.m.Condition;
o.m.Value = this.Math.round(8000 *this.Math.pow(2,(o.m.ConditionMax- 5 +o.m.StaminaModifier*5 +randomize*5 -10 )*0.2));
}
});


____
1.13
____
Add Cloak, layer 4 (temp: not named).

____
1.12
____
Add Tabard, layer 3 (test rebalance, recipe for money, upgrade recipe with prev.tier armor x2 and half cost).
1.121
Trying to fix icon for named recipe. Temp: ignore variant of armor in icon.

____
1.1
____
Test formula of cost armor 6/4 stamina penalty (vanila balance: 5/5, my mod: 6/4, sum: same 10 armor per tier, but more logic in number, , so far only for base layer of armor - "cloth").

____
1.0
____
Gambeson randomize (max as wolf gambeson).


====
Recipe
====

Add money's recipe of named.
Cloth: tunic and gambeson (3000 dinar, selfcost: 1000-2000, depending on stats, instead hardcode 1500).


====
Stats (example)
====

Named Tunic:
  • min: 1000 dinar, 48 armor, -0 stamina;
  • max: 2000, 58, -1;
  • vanila: 1500, 46-56, -2-0.

Formula:
local randomize2 = this.Math.rand(0,1);
o.m.Condition = this.Math.rand(48,54) +randomize2*4; o.m.ConditionMax = o.m.Condition;
o.m.StaminaModifier = -0 -randomize2;
o.m.Value = this.Math.round(500 *this.Math.pow(2,1+(o.m.ConditionMax - 48 -randomize2*4)*0.1667));

Example: 48,-0 and 52,-1 have same cost 1000, because stamina-1 = armor 4, this not influence on cost.

___
Named Gambeson:
  • min: 1000 dinar, 76-80 armor, -8 stamina;
  • max: 2000, 90, -9;
  • vanila: 1500, 75-90, -6-4.

Formula:
local randomize2 = this.Math.rand(0,1);
o.m.Condition = this.Math.rand(48,54)+32 +randomize2*4; o.m.ConditionMax = o.m.Condition;
o.m.StaminaModifier = -8 -randomize2; //1f=4a
o.m.Value = this.Math.round(500 *this.Math.pow(2,1+(o.m.ConditionMax -48-32 -randomize2*4)*0.1667));

Example: 80,-8 and 84,-9 have same cost 1000, because stamina-1 = armor 4.

____
Named Tabard:
  • min: 2000 dinar, 18+ armor, -0 stamina, +9% bravery;
  • max: 4000 dinar, 24 armor, -1 stamina, +10% bravery.
local randomize1 = this.Math.rand(0,1); local randomizeB = this.Math.rand(0,1);
o.m.BraveryMult = 1.09 +randomizeB*0.01;
o.m.Condition = this.Math.rand(18,20) +randomize1*4; o.m.ConditionMax = o.m.Condition; //18,20..24
o.m.StaminaModifier = -0 -randomize1;
o.m.Value = this.Math.round(1000 *this.Math.pow(2,1+(o.m.ConditionMax- 18 -randomize1*4 +randomizeB*4 )*0.16667));

____
1.01
____
Add hooks for small change of wolf gambeson (for future work, example, named gambeson: armor 75..90 -> 80..90; +-10, not 15, as named tunic).

____
1.0
____
Small random stat (0-5) for Gambeson (except wolf) and -1 fatigue (wolf -2), cost is scaled (250-300).

Add small random stat (0-5, tiny bonus from named item mechanic) for Gambeson (except wolf) and fatigue cost = 7 for Gambeson (8->7, wolf 9->7, for balance with other armor, example, surcoat: 55-6).

Because almost all types of gambeson (except wolf) have 65 armor, -8 stamina penalty and price 250 coins.
Wolf: 70, -9, 300.
I added this range to the other much more numerous (for balance high tier armor), bonus based on the named item mechanic.

Other armor have minus stamina ~ condition/10 (except very heavy or very light armor).
But named gambeson have 75 .. 90 armor and -4(!!!) .. -6 penalty. This not normal.
I reduce extra penalty for gambeson (-1, as other item, for balance).


____
List (scaled cost from stats, variant fix value for future plan on named):
____

250, 65, -7 (almost basic for legend mod).
260, 66, -7 (and etc. "+10", "+1" for step).
270, 67, -7.
280, 68, -7.
290, 69, -7.
300, 70, -7 (wolf and top gambeson with mod).


====
Mod without hooks:
====

\items\legend_armor\cloth\

  • legend_gambeson.nut
  • legend_gambeson_plain.nut

  • legend_southern_gambeson.nut
  • legend_southern_split_gambeson.nut

____
Changes:
____

//add for create()
this.randomizeValues();

//add
function randomizeValues()
{
local randomize = this.Math.rand(0, 5);
this.m.Condition = 65 + randomize; this.m.ConditionMax = this.m.Condition;
this.m.Value = this.Math.floor(250 * (1 + randomize * 0.04));
}

//mod
this.m.StaminaModifier = -7; //8