-
-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BBS advert for soldout commodity #5059
Conversation
By the way, in Frontier, when you jumped into a system, you could query each station for list of commodity prices (for a fee of $5, I think), through Comms. Would be cool if we could do the same, and also get stock, so then you might guess which station has one of these adverts, if they have 0t. Just throwing it out there. |
If there's light lag, then it would be odd for you to get the info instantaneously though. Although I guess it would be doable if the info is broadcasted, and that cryptocurrency thing is what the money is. You'd get it instantly, the price deducted, but the recipient will get the money when the signal arrives. |
OK, except for debug outputs that should be removed/commented out, this PR is done. I've re-written it now, so the module knows nothing about what a system imports anymore, it only check for 0 stocked commodities on each station and with 50% chance spawns a "wanted will pay double" advert on the BBS. I ran this in Sol, with the changes suggested in #5074, (with the much lowered probability to be sold out of imported goods) The Spaceport.lua reports it made 0 stock for these stations:
which resulted in a single advert in each of the stations listed above, including Tomm's (i.e. even though it had sold out on two commodities) (Now I hope the random number generator, |
Two thoughts here: first of all, code doesn't look too terrible, maybe a few more comments needed to explain in the absence of debug messages but otherwise good. Secondly, I would suggest dropping the |
I've had the same thought, actually. I might not get around to it until next week though. |
0b27a79
to
59826b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks very clean! I have a few extremely minor nitpicks, but otherwise this is good to go.
Game.player:RemoveEquip(ad.commodity, max) | ||
Game.player:AddMoney(ad.price * max) | ||
ad.amount = ad.amount - max | ||
form:SetMessage(ad.message .. "\n\n" .. string.interp(l.AMOUNT, {amount = ad.amount})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you'd like the "buy max" option to only offer the Hang Up button, just add this here:
if ad.amount == 0 then
form:RemoveAdvertOnClose()
end
return
This will prevent any of the Sell buttons being added to the form, and will remove the ad from the bulletin board if it's empty.
If there are any commodities that are sold out (e.g. major imports), then 50% chance of generating a BBS advert with buyer offering twice the price, for some fixed amount of the commodity.
@Web-eWorks thanks Btw, I could point out that this module does not, currently, have the ability to add several adverts for the same commodity, that could be done as a next step, offering different prices, but I think this will do for now. I'll add this to transifex now as well (just a reminder to myself) |
Intro
In frontier one would often have the habit to check the BBS for special "WANTED" adverts before selling the commodity on the market exchange. Especially if the station had 0t in stock.
About this Pioneer BBS advert
This module selects a major import and with a fairly low probability (for now 10% adds one advert, and zeros out the stock of that commodity in the commodity market).
There's only one flavor because this advert will be rare, so slight rewording of it will not make a difference.
This is in some way similar to #2753, but that one announces where the market is sold out globally, to all neighboring systems, (and offers a larger multiple than x2), where as this advert is as brief as can be.
Advert uses "$" icon for now (could alternatively use the shopping cart icon)
To-Do
Please don't look at the code, it's messy