Skip to content

Commit

Permalink
Merge pull request #5306 from zonkmachine/mechanic
Browse files Browse the repository at this point in the history
Fix mechanic not being persistent
  • Loading branch information
Webster Sheets authored Jan 10, 2022
2 parents f2783d0 + 8371b93 commit c74ddc3
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions data/modules/BreakdownServicing/BreakdownServicing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,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 @@ -152,7 +152,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 @@ -188,26 +188,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
n = n
Expand Down

0 comments on commit c74ddc3

Please sign in to comment.