fix(bunsik): 새 손님 자리를 돌아가며 골라 2층·구석 자리도 쓰이게, 실내에서는 수레 네온 간판을 빼서 천장 관통 방지, 경제 수치표 개편
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,29 +10,27 @@ local World = require(Server.World)
|
||||
local Npc = require(Server.Npc)
|
||||
local PlotController = require(Server.PlotController)
|
||||
local PlotBuilder = require(Server.PlotBuilder)
|
||||
local PlotLayout = require(Server.PlotLayout)
|
||||
local Data = require(Server.Data)
|
||||
local Floor = require(game:GetService("ReplicatedStorage").Shared.Floor)
|
||||
|
||||
local slots = World.build()
|
||||
Npc.preload()
|
||||
|
||||
local function shop(slot, bought: number, withChar: boolean)
|
||||
local data = table.clone(Data.TEMPLATE)
|
||||
-- 예전 구매 수(bought)로 크기를 정하고, 단계(stage)·디자인을 맞춘 가게를 짓습니다.
|
||||
local function shop(slot, bought: number, stage: number, design: string, withChar: boolean, extra: number?)
|
||||
local data: any = table.clone(Data.TEMPLATE)
|
||||
data.PurchaseIdCache = {}
|
||||
data.Bought = bought
|
||||
data.TutorialDone = true
|
||||
local char: Model? = nil
|
||||
if withChar then
|
||||
char = Players:CreateHumanoidModelFromDescription(Instance.new("HumanoidDescription"), Enum.HumanoidRigType.R15)
|
||||
local c = char :: Model
|
||||
c.Parent = workspace
|
||||
local root = c:FindFirstChild("HumanoidRootPart") :: BasePart
|
||||
root.Anchored = true
|
||||
local pos = PlotBuilder.world(slot.cf, PlotLayout.STOVE + Vector3.new(0, 0, 4.5))
|
||||
c:PivotTo(CFrame.lookAt(pos + Vector3.new(0, 3, 0), pos + Vector3.new(0, 3, 10)))
|
||||
end
|
||||
Data.migrate(data, 1)
|
||||
data.Levels.Stage = stage - 1
|
||||
data.Levels.Staff = 1
|
||||
data.Staff = { Cook = 1, Server = 1, Promoter = 1 }
|
||||
data.Design = design
|
||||
data.Money = 1e9
|
||||
local owner = Instance.new("Folder")
|
||||
owner.Parent = ServerScriptService
|
||||
local char: Model? = nil
|
||||
local c = PlotController.new(slot, owner, {
|
||||
userId = slot.index,
|
||||
displayName = "Player" .. slot.index,
|
||||
@@ -42,29 +40,46 @@ local function shop(slot, bought: number, withChar: boolean)
|
||||
return char
|
||||
end,
|
||||
})
|
||||
c:setDesignOwned(design, true)
|
||||
c:setDesign(design)
|
||||
for _ = 1, extra or 0 do
|
||||
c:buyTable()
|
||||
c:buySeat(nil)
|
||||
end
|
||||
c:buyDecor("Plant")
|
||||
c:buyDecor("Balloons")
|
||||
c:buyDecor("Teddy")
|
||||
if withChar then
|
||||
char = Players:CreateHumanoidModelFromDescription(Instance.new("HumanoidDescription"), Enum.HumanoidRigType.R15)
|
||||
local cm = char :: Model
|
||||
cm.Parent = workspace
|
||||
local root = cm:FindFirstChild("HumanoidRootPart") :: BasePart
|
||||
root.Anchored = true
|
||||
local pos = PlotBuilder.stallPoint(slot.refs, Floor.STOVE_FRONT)
|
||||
local look = PlotBuilder.stallPoint(slot.refs, { x = 0, z = 12 })
|
||||
cm:PivotTo(CFrame.lookAt(pos + Vector3.new(0, 3, 0), look + Vector3.new(0, 3, 0)))
|
||||
end
|
||||
-- 손님을 채우고 몇 명은 먹는 중으로
|
||||
local t = 0
|
||||
for _ = 1, 400 do
|
||||
for _ = 1, 300 do
|
||||
t += 0.1
|
||||
c:update(t)
|
||||
end
|
||||
local n = 0
|
||||
for id, cust in c.shop.customers do
|
||||
if cust.state == "waiting" and n < 2 then
|
||||
c.shop.hand = { cust.menu }
|
||||
c:serve(id)
|
||||
n += 1
|
||||
end
|
||||
end
|
||||
if withChar then
|
||||
c.shop.counter = {}
|
||||
c:cook()
|
||||
end
|
||||
return c
|
||||
end
|
||||
|
||||
shop(slots[2], #require(game:GetService("ReplicatedStorage").Shared.Economy).PURCHASES, true)
|
||||
shop(slots[1], 6, false)
|
||||
shop(slots[3], 0, false)
|
||||
local mode = "all"
|
||||
shop(slots[1], 6, 1, "Basic", true, 1)
|
||||
shop(slots[2], 20, 2, "Candy", false, 2)
|
||||
shop(slots[3], 20, 3, "Hanok", false, 6)
|
||||
shop(slots[4], 14, 2, "Brick", false, 1)
|
||||
shop(slots[5], 14, 2, "Mint", false, 1)
|
||||
shop(slots[6], 20, 3, "Basic", false, 6)
|
||||
print("mode", mode)
|
||||
task.wait(0.5)
|
||||
|
||||
local parts = {}
|
||||
|
||||
Reference in New Issue
Block a user