Skip to content
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

Fix mechanic not being persistent #5306

Merged
merged 3 commits into from
Jan 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions data/modules/BreakdownServicing/BreakdownServicing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ local onChat = function (form, ref, option)
if option == 0 then
-- Initial proposal
form:SetTitle(ad.title)
form:SetFace(Character.New({ female = ad.isfemale, seed = ad.faceseed, name = ad.name }))
form:SetFace(ad.mechanic)
-- Replace token with details of last service (which might have
-- been seconds ago)
form:SetMessage(string.interp(message, {
Expand All @@ -151,7 +151,7 @@ local onChat = function (form, ref, option)
-- Yes please, service my engine
form:Clear()
form:SetTitle(ad.title)
form:SetFace(Character.New({ female = ad.isfemale, seed = ad.faceseed, name = ad.name }))
form:SetFace(ad.mechanic)
if Game.player:GetMoney() >= price then -- We did check earlier, but...
-- Say thanks
form:SetMessage(ad.response)
Expand Down Expand Up @@ -187,26 +187,23 @@ end
local onCreateBB = function (station)
local rand = Rand.New(station.seed + seedbump)
local n = rand:Integer(1,#flavours)
local isfemale = rand:Integer(1) == 1
local name = NameGen.FullName(isfemale,rand)
local mechanic = Character.New({seed=rand:Integer()})

local ad = {
name = name,
isfemale = isfemale,
mechanic = mechanic,
-- Only replace tokens which are not subject to further change
title = string.interp(flavours[n].title, {
name = station.label,
proprietor = name,
proprietor = mechanic.name,
}),
intro = string.interp(flavours[n].intro, {
name = station.label,
proprietor = name,
proprietor = mechanic.name,
}),
price = flavours[n].price,
yesplease = flavours[n].yesplease,
response = flavours[n].response,
station = station,
faceseed = rand:Integer(),
strength = flavours[n].strength,
baseprice = flavours[n].baseprice *rand:Number(0.8,1.2), -- A little per-station flavouring
}
Expand Down