What's the formula for Block?

Solution 1:

The formula, according to game's script is game.global.soldierCurrentBlock = Math.floor((game.global.block * (game.jobs.Trainer.owned * (game.jobs.Trainer.modifier / 100)) + game.global.block) * trimpsFighting);

Breakdown of the code:
game.global.block = number of gyms * block per gym
game.jobs.Train.owned = number of trainers
(game.jobs.Trainer.modifier/100) = percentage of trainer block increase, i.e if it's 25% then put 0.25 here
trimpsFighting = the number of trimps fighting

Solution 2:

The formula without Heirlooms is:

trainer_percentage = 100*(0.2 + 0.05*traintacular)
block_per_gym = 6*(1.04 + gymystic*0.01)^gyms

block = trimps*(shield_base*shield_lvl + gyms*block_per_gym)*(1 + trainers*trainer_percentage/100)

Example

Let's say I have 5298 trimps: trimps = 5298;

Trimps

My shield is level 3 and has a base block of 6.09e4: shield_lvl = 3 and shield_base = 6.09e4;

Shield

I have 107 gyms which give 9571 block each: gyms = 109 and block_per_gym = 9571;

Gyms

And I have 170 trainers giving +55% block each: trainers = 174 and trainer_percentage = 55;

Trainers

Then my total block is given by:

block = trimps*(shield_base*shield_lvl + gyms*block_per_gym)*(1 + trainers*trainer_percentage/100)
block = 5298*(6.09e4*3 + 109*9571)*(1 + 174*55/100)

Which gives 6.28069e+11.

Block