Thread:FixSRwiki/@comment-46261745-20201012171553/@comment-46261745-20201013124315

I believe I found it all, but it would there are a few things around it that I didn't fully explore. Would be great if you wanted to double check and give it a look. I'll lay out what I found here:

In 合戦／初期化, it sets the initial damage values as 1/10th of total troop count for the battle, for both sides:

aa = 合戦兵力取得(1) + 合戦兵力取得(2);

◆被害総数１ = aa / 10;

◆被害総数２ = aa / 10;

Then in 合戦_戦闘処理 it uses some neat coding technique to pass the n防御側ダメージ into and out of the damage calculation, taking the final value of DDD from there (ref lint? no idea what that means, but seems to mean that)

It then simply adds that to the total damage for the defending side, and same thing for attacking side a few lines later:

if (◆合戦味方ターン == 1)     {

◆被害総数１ += n防御側ダメージ;

◆被害総数２ += n攻撃側ダメージ;

}

if (◆合戦味方ターン == 2)     {

◆被害総数１ += n攻撃側ダメージ;

◆被害総数２ += n防御側ダメージ;     }

}

This then gets called when doing the attack animation in 戦果取得 called from tagBattle::damage, where it basically just %gizes those damage variables

aa = ◆被害総数１ + ◆被害総数２;

▲戦果１ = ％取得関数(aa, ◆被害総数１);

▲戦果２ = ％取得関数(aa, ◆被害総数２);

▲戦果１ = (▲戦果１ + ◆戦果補正１) - ◆戦果補正２;

▲戦果２ = (▲戦果２ + ◆戦果補正２) - ◆戦果補正１;

So, as the wiki already seemed to indicate,  it's not the change in battle rating that's calculated, it's the final value of battle rating that continues to be tracked throughout the battle. As you can see, it takes into account the battle effect within this formula though, so the battle effect is basically a fixed % addition to that side's battle rating (before division by total troops).

Since battle effect is also used to calculate the actual damage in physical and magical damage, that means it's taken into account twice, right?