Making missions provide rounded rewards
Posted: Fri Nov 24, 2017 5:18 pm
So I'm trying my hand at my very first SE mod (hoping to assist with development at some point if I can).
What I'd like to do is make missions provide rounded (whole dollar) amounts for a reward. Mainly because I figure it'll be a simple change, and also because it seems weird that people would be giving cent amounts on a bulletin board. Starting with the Taxi module, I found this line:
This seems pretty straightforward even for someone not versed in Lua, so I added a line.
As expected, taxi missions now give a whole dollar amount!
If I were to do this on all the mission types and make a pull request would it be accepted? Related, how can I make the BBS and ads not show the .00 on the reward amount, to make this visually consistent?
What I'd like to do is make missions provide rounded (whole dollar) amounts for a reward. Mainly because I figure it'll be a simple change, and also because it seems weird that people would be giving cent amounts on a bulletin board. Starting with the Taxi module, I found this line:
Code: Select all
local makeAdvert = function (station)
...
reward = ((dist / max_taxi_dist) * typical_reward * (group / 2) * (1+risk) * (1+3*urgency) * Engine.rand:Number(0.8,1.2))
Code: Select all
local makeAdvert = function (station)
...
reward = ((dist / max_taxi_dist) * typical_reward * (group / 2) * (1+risk) * (1+3*urgency) * Engine.rand:Number(0.8,1.2))
reward = math.ceil(reward)
If I were to do this on all the mission types and make a pull request would it be accepted? Related, how can I make the BBS and ads not show the .00 on the reward amount, to make this visually consistent?