Elin:Code Analysis/Faith: Difference between revisions

 
Line 91: Line 91:
num2 /= 10;
num2 /= 10;
}
}
num2 *= (t.LV * 2 + 100) / 100;
num2 = num2 * (100 + Mathf.Min(t.LV * 2, 100) + (t.HasElement(757) ? 50 : 0)) / 100;  
return Mathf.Max(num2, 1) * num;
return Mathf.Max(num2, 1) * num;
}
}
Line 110: Line 110:
** Because the decayed check is done after the 0 offer value check, you won't get 0 offer value if your item is only rotten, but lablled.
** Because the decayed check is done after the 0 offer value check, you won't get 0 offer value if your item is only rotten, but lablled.
** For example a labelled, 0.7s non-rotten meat will generate a offer value of 70.
** For example a labelled, 0.7s non-rotten meat will generate a offer value of 70.
* The offer value will '''increase by 2%''' per each level of the item. (See in resource/things/LV. Meat and most items are LV 1, most equipments range from 10-20, rarest at lv 60)
* The final value is modified by the following:
** ...At least that is what SUPPOSED TO HAPPEN! Because C# treat divide operator between two integers as round down to an int, instead of creating a float number, this code basically does ABSOLUTELY NOTHING when LV < 50.
** The offer value will '''increase by 2%''' per each level of the item, at most 100% (for LV 50). (See in resource/things/LV. Meat and most items are LV 1, most equipments range from 10-20, rarest at lv 60)
*** <s>...At least that is what SUPPOSED TO HAPPEN! Because C# treat divide operator between two integers as round down to an int, instead of creating a float number, this code basically does ABSOLUTELY NOTHING when LV < 50.</s>
*** This is confirmed to be a bug, and was fixed in EA23.62 Nightly Hotfix 1.
** A further 50% additive modifier is applied if "Just cooked" state is on the offering item.
<syntaxhighlight lang="c#" line="1">
<syntaxhighlight lang="c#" line="1">
public void _OnOffer(Chara c, Thing t, int takeoverMod = 0)
public void _OnOffer(Chara c, Thing t, int takeoverMod = 0)
381

edits