How did you calculate this? I see Short Sword's StrengthModifier value (90) and Mithril's Strength value (200), but how did you find the formula (and the "/ 2000" part)?
long item::GetBlockModifier() const
{
if(!IsShield(0))
return GetSize() * GetRoundness() << 1;
else
return GetSize() * GetRoundness() << 2;
}
double arm::GetBlockValue() const { return GetToHitValue() * GetWielded()->GetBlockModifier() / 10000; }when the game calculates the BlockValue of an arm, for blocking.int item::GetStrengthValue() const
{
return long(GetStrengthModifier()) * GetMainMaterial()->GetStrengthValue() / 2000;
}
if(RAND() % int(100 + WeaponToHitValue / BlockValue / (1 << BlocksSinceLastTurn) * (100 + Success)) < 100) then (block)
double arm::GetWieldedToHitValue() const
{
int HitStrength = GetWieldedHitStrength();
if(HitStrength <= 0)
return 0;
citem* Wielded = GetWielded();
double Base = 2e-11
* Min(HitStrength, 10)
* GetHumanoidMaster()->GetCWeaponSkill(Wielded->GetWeaponCategory())->GetBonus()
* GetCurrentSWeaponSkillBonus()
* Master->GetMoveEase()
* (10000. / (1000 + Wielded->GetWeight()) + Wielded->GetTHVBonus());
double ThisToHit = GetAttribute(DEXTERITY) * sqrt(2.5 * Master->GetAttribute(PERCEPTION));
const arm* PairArm = GetPairArm();
if(PairArm && PairArm->IsUsable())
{
citem* PairWielded = PairArm->GetWielded();
if(!PairWielded)
{
if(Wielded->IsTwoHanded() && !Wielded->IsShield(Master))
return Base * (ThisToHit + PairArm->GetAttribute(DEXTERITY)
* sqrt(2.5 * Master->GetAttribute(PERCEPTION))) / 2;
}
else if(!Wielded->IsShield(Master) && !PairWielded->IsShield(Master))
return Base * ThisToHit / (1.0 + (500.0 + PairWielded->GetWeight())
/ (1000.0 + (Wielded->GetWeight() << 1)));
}
return Base * ThisToHit;
}
int arm::GetBlockCapability() const
Min(HitStrength, 10) * Wielded->GetStrengthValue() * GetHumanoidMaster()->GetCWeaponSkill(Wielded->GetWeaponCategory())->GetBonus() * (*GetCurrentSWeaponSkill())->GetBonus() / 10000000;
Block Capability = 10 * 9 * 1400 * 1450 / 10000000
= 18.27
...
magicmushroom
{
...
ClassStates = GAS_IMMUNITY;
...
}
...