At 0 Rep. the value is doubled.
At 5,000 Rep. the value remains the same.
At 20,000 Rep. the value is halved.
The Snippet:
mob
var/Reputation=5000
proc
ChangeRep(_Val)
Reputation = min(max(Reputation + _Val, 0), 2e4)
RepCost(_Value)
var/tmp/Nval = 5000-Reputation
Nval *= Reputation <= 5e3 ? 0.02 : 0.01 / 3
return _Value + round((_Value/100)*Nval)
And to test it:
mob/verb
//Pass a negative value to subtract Rep.
Change_Rep(var/N as num)
ChangeRep(N)
src << "Reputation: [Reputation]"
CheckValue(var/N as num)
src << "\nReputation: [Reputation]"
src << "Original Value: [N]"
src << "New Value: [RepCost(N)]"
EDIT: Updated ChangeRep() proc with Kaiochao's ammendment, and RepCost() thanks to Albro.
You don't need _Op because all you have to do is send a negative number as _Val.
As far as processing efficiency, I don't know which is better, so here's another method for that: