Add working brothel building

This commit is contained in:
Lucas 2020-04-13 21:21:22 +02:00
parent a7fb4d140d
commit eb6db5aed9
9 changed files with 124 additions and 3264 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -2,8 +2,8 @@ local BrothelSystemMod = foundation.createMod();
-- Monuments (brothel)
BrothelSystemMod:dofile("scripts/brothel/monument.lua")
-- Buildings (brothel)
BrothelSystemMod:dofile("scripts/brothel/building.lua")
-- Jobs
BrothelSystemMod:dofile("scripts/jobs.lua")

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -7,40 +7,32 @@ BrothelSystemMod:registerAssetProcessor("models/brothel.fbx", {
DataType = "BUILDING_ASSET_PROCESSOR"
})
-- Register all mithril factory building parts and their properties
-- Register all brothel building parts and their properties
BrothelSystemMod:dofile("scripts/brothel/building_parts.lua")
-- Register the brothel monument
BrothelSystemMod:register({
DataType = "MONUMENT",
--Déclare que l'objet que l'on crée appartient à la class BUILDING
DataType = "BUILDING",
--Déclare la classe de l'objet que l'on crée
Id = "BROTHEL",
Name = "BROTHEL_NAME",
Description = "BROTHEL_DESC",
BuildingType = BUILDING_TYPE.MONUMENT,
--Renseigne le champ Building Type. cela va permettre de classer l'objet dans les menus
BuildingType = "GENERAL",
BuildingPartSetList = {
{
Name = "BROTHEL_CORE",
BuildingPartList = { "BROTHEL" }
},
{
Name = "ENTRANCE",
BuildingPartList = {
"BROTHEL_DOOR_A_PART"
BuildingPartList = { "BROTHEL_WORKPLACE_PART"
}
}
}
},
RequiredPartList = {
-- Necessarily a list of 'MONUMENT_REQUIRED_PART_PAIR', no need to specify the DataType of each element of the list
{ Category = "CORE", Quantity = 1 },
{ Category = "DOOR", Quantity = 1 }
},
IsManuallyUnlocked = true,
IsDestructible = true,
IsEditable = true,
IsClearTrees = true
})
BrothelSystemMod:register({
DataType = "UNLOCKABLE_BUILDING",
Id = "UNLOCKABLE_BROTHEL",

View file

@ -1,106 +1,55 @@
local BrothelSystemMod = ...
------------------------------BROTHEL---------------------------------
------------------------------BROTHEL WORKPLACE---------------------------------
-----------------------------------MODEL----------------------------------------
-- Register core prefab nodes
BrothelSystemMod:registerAssetId("models/brothel.fbx/Prefab/Brothel/Core/RootPart", "BROTHEL_CORE_ROOT_PREFAB")
BrothelSystemMod:registerAssetId("models/brothel.fbx/Prefab/Brothel/Core/TopPart", "BROTHEL_CORE_TOP_PREFAB")
BrothelSystemMod:registerAssetId("models/brothel.fbx/Prefab/Brothel/Core/Tiling1Part", "BROTHEL_CORE_TILING1_PREFAB")
BrothelSystemMod:registerAssetId("models/brothel.fbx/Prefab/Brothel/Core/Tiling2Part", "BROTHEL_CORE_TILING2_PREFAB")
BrothelSystemMod:registerAssetId("models/brothel.fbx/Prefab/Brothel/Core/Tiling3Part", "BROTHEL_CORE_TILING3_PREFAB")
BrothelSystemMod:registerAssetId("models/brothel.fbx/Prefab/Brothel", "BROTHEL_CORE_PREFAB")
BrothelSystemMod:registerPrefabComponent("models/brothel.fbx/Prefab/Brothel",
{
DataType = "COMP_BUILDING_PART",
HasBuildingZone = true,
BuildingZone = { 3, 3 }
})
-- Register door prefab nodes
BrothelSystemMod:registerAssetId("models/brothel.fbx/Prefab/Brothel/DoorAPart", "BROTHEL_DOOR_A_PREFAB")
--------------------------------------------------------------------------
-- Create default building part registering function
function registerDefaultBuildingPart(_nodePrefix)
BrothelSystemMod:register({
-- Register the brothel workplace part
BrothelSystemMod:register({
DataType = "BUILDING_PART",
Id = _nodePrefix .. "_PART",
Mover = { DataType = "BUILDING_PART_MOVER" },
ConstructorData = { DataType = "BUILDING_CONSTRUCTOR_DEFAULT", CoreObjectPrefab = _nodePrefix .. "_PREFAB" }
})
end
Id = "BROTHEL_WORKPLACE_PART",
ConstructorData = {
DataType = "BUILDING_CONSTRUCTOR_DEFAULT",
CoreObjectPrefab = "BROTHEL_CORE_PREFAB"
},
--Ca c'est pour déclarer le visuel de construction si il y en a un !
ConstructionVisual = "BROTHEL_CORE_PREFAB",
Cost = {
UpkeepCost = {
{ Resource = "GOLD", Quantity = 1 }
},
RessourcesNeeded = {
{ Resource = "WOOD", Quantity = 5 }
}
},
AssetBuildingFunction = "BROTHEL_FUNCTION"
})
local defaultNodePrefixList = {
"BROTHEL_CORE_TOP",
"BROTHEL_CORE_TILING1",
"BROTHEL_CORE_TILING2",
"BROTHEL_CORE_TILING3"
}
-- Register simple building part assets
for i, nodePrefix in ipairs(defaultNodePrefixList) do
registerDefaultBuildingPart(nodePrefix)
end
--------------------------------------------------------------------------
-----------------------------------FUNCTION----------------------------------------
BrothelSystemMod:register({
DataType = "BUILDING_FUNCTION_WORKPLACE",
Id = "BROTHEL_CORE_FUNCTION",
WorkerCapacity = 4,
RelatedJob = { Job = "TRANSPORTER", Behavior = "WORK_BEHAVIOR" },
ResourceProduced = { -- Necessarily a list of 'RESOURCE_QUANTITY_PAIR', no need to specify the DataType
{ Resource = "BARREL", Quantity = 5 }
Id = "BROTHEL_FUNCTION",
WorkerCapacity = 5,
RelatedJob = {
Job = "HOOKER", Behavior = "WORK_BEHAVIOR"
},
InputInventoryCapacity = {
{ Resource = "WOOLEN_CLOTH", Quantity = 50 }
},
ResourceListNeeded = {
{ Resource = "WOOLEN_CLOTH", Quantity = 1 }
},
ResourceProduced = {
{ Resource = "BARREL", Quantity = 1 }
}
})
-- Register the brothel core part
BrothelSystemMod:register({
DataType = "BUILDING_PART",
Id = "BROTHEL",
Name = "BROTHEL_NAME",
Description = "BROTHEL_DESC",
Category = "CORE",
Mover = { DataType = "BUILDING_PART_MOVER_INSTANCE" },
ConstructorData = {
DataType = "BUILDING_CONSTRUCTOR_SCALER", -- Since there are different types of building constructor, 'DataType' is necessary here
CoreObjectPrefab = "BROTHEL_CORE_ROOT_PREFAB",
EndPart = "BROTHEL_CORE_TOP_PART",
FillerList = {
"BROTHEL_CORE_TILING1_PART",
"BROTHEL_CORE_TILING2_PART",
"BROTHEL_CORE_TILING3_PART"
},
BasementFillerList = {
"BROTHEL_CORE_TILING1_PART",
"BROTHEL_CORE_TILING2_PART",
"BROTHEL_CORE_TILING3_PART"
},
},
BuildingFunction = "BROTHEL_CORE_FUNCTION",
Cost = {
UpkeepCost = { -- List of RESOURCE_QUANTITY_PAIR
{ Resource = "GOLD", Quantity = 3 }
},
RessourcesNeeded = { -- List of RESOURCE_QUANTITY_PAIR
{ Resource = "WOOD", Quantity = 30 },
{ Resource = "STONE", Quantity = 20 }
}
}
})
-- Register the brothel door A part
BrothelSystemMod:register({
DataType = "BUILDING_PART",
Id = "BROTHEL_DOOR_A_PART",
Name = "BROTHEL_DOOR_A_NAME",
Description = "BROTHEL_DOOR_A_DESC",
Category = "DOOR",
Mover = { DataType = "BUILDING_PART_MOVER_INSTANCE" },
ConstructorData = {
DataType = "BUILDING_CONSTRUCTOR_DEFAULT",
CoreObjectPrefab = "BROTHEL_DOOR_A_PREFAB"
},
Cost = {
RessourcesNeeded = { -- List of RESOURCE_QUANTITY_PAIR
{ Resource = "WOOD", Quantity = 5 }
}
}
})

View file

@ -1,27 +1,13 @@
local mod = ...
local BrothelSystemMod = ...
-- Register mithril miner job
mod:register({
BrothelSystemMod:register({
DataType = "JOB",
Id = "MITHRIL_MINER",
JobName = "MITHRIL_MINER_NAME",
JobDescription = "MITHRIL_MINER_DESC",
Id = "HOOKER",
JobName = "HOOKER_NAME",
JobDescription = "HOOKER_DESC",
CharacterSetup = {
WorkAnimation = AGENT_ANIMATION.MINE,
},
IsLockedByDefault = true,
UseWorkplaceBehavior = true,
AssetJobProgression = "DEFAULT_JOB_PROGRESSION"
})
-- Register mithril artisan job (used here to craft chainmails AND necklaces)
mod:register({
DataType = "JOB",
Id = "MITHRIL_ARTISAN",
JobName = "MITHRIL_ARTISAN_NAME",
JobDescription = "MITHRIL_ARTISAN_DESC",
CharacterSetup = {
WorkAnimation = AGENT_ANIMATION.SMITHING,
WorkAnimation = AGENT_ANIMATION.IDLE,
},
IsLockedByDefault = true,
UseWorkplaceBehavior = true,