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

Pre-release v1.0.0.0 #3

Open
wants to merge 14 commits into
base: development
Choose a base branch
from
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [1.0.0.0] - {waiting-for-modhub}
- Ported from LS22
- Initial Release
56 changes: 34 additions & 22 deletions FS25_BeesRevamp/modDesc.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<modDesc descVersion="92">
<author>Peppie84</author>
<version>1.0.0.0</version>
<title>
<en>Bees Revamp</en>
</title>
<description>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<modDesc descVersion="94">
<author>Peppie84</author>
<version>1.0.0.0</version>
<title>
<en>Bees Revamp</en>
</title>
<description>
<en><![CDATA[
With this mod, bees in Farming Simulator become more realistic and a bit more complex but also more productive.

Expand All @@ -26,10 +26,14 @@ Most questions can be answered by the in-game help of this mod.
- Prices of the beehives have been adjusted
- Honey sales price has been adjusted

Yield bonus for: Canola, Sunflower
Yield bonus for: Canola, Sunflower Cotton and Soybean

Additional supported bee hives:
- Pack Of Beehives by BarT
- Beehives Pack by Zoli708

For more information, help, and reporting issues please visit <a href='https://github.com/Peppie84/FS25_BeesRevamp'>GitHub</a>.
]]></en>
]]></en>
<de><![CDATA[
Mit dieser Mod werden die Bienen im Landwirtschafts-Simulator realistischer und auch etwas komplexer aber dafür auch ertragreicher.

Expand All @@ -50,10 +54,14 @@ Bitte schau Dir die Ingame-Hilfe zu dieser Mod an. Sie kann die meisten Fragen b
- Preise der Bienenstöcke wurden angepasst
- Honigverkaufspreis wurde angepasst

Ertragsbonus für: Raps, Sonnenblume
Ertragsbonus für: Raps, Sonnenblume, Baumwolle und Sojabohne

Zusätzlich unterstützte Bienenstöcke:
- Bienenstock-Pack von BarT
- Bienenstock-Paket von Zoli708

Weitere Informationen, Hilfe und Probleme melden findest Du unter <a href='https://github.com/Peppie84/FS22_BeesRevamp'>GitHub</a>.
]]></de>
]]></de>
<it><![CDATA[
Con questa mod, le api in Farming Simulator diventano più realistiche e un po' più complesse ma anche più produttive.

Expand All @@ -74,15 +82,19 @@ La maggior parte delle domande può essere risolta dall'aiuto in-game di questa
- I prezzi degli alveari sono stati regolati
- Il prezzo di vendita del miele è stato regolato

Bonus di resa per: Colza, Girasole
Bonus di resa per: Colza, Girasole, Cotone e Fagiolo di soia

Ulteriori alveari supportati:
- Pack Of Beehives by BarT
- Beehives Pack by Zoli708

Per ulteriori informazioni, aiuto e segnalazione di problemi, visita <a href='https://github.com/Peppie84/FS22_BeesRevamp'>GitHub</a>.
]]></it>
</description>
<iconFilename>icon_BeesRevamp.dds</iconFilename>
<multiplayer supported="true" />
<extraSourceFiles>
<sourceFile filename="src/main.lua" />
</extraSourceFiles>
<l10n filenamePrefix="translations/translation" />
</modDesc>
]]></it>
</description>
<iconFilename>icon_BeesRevamp.dds</iconFilename>
<multiplayer supported="true" />
<extraSourceFiles>
<sourceFile filename="src/main.lua" />
</extraSourceFiles>
<l10n filenamePrefix="translations/translation" />
</modDesc>
12 changes: 12 additions & 0 deletions FS25_BeesRevamp/src/beecare.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ end
function BeeCare.registerOverwrittenFunctions(placeableType)
SpecializationUtil.registerOverwrittenFunction(placeableType, 'updateInfo', BeeCare.updateInfo)
SpecializationUtil.registerOverwrittenFunction(placeableType, 'updateBeehiveState', BeeCare.updateBeehiveState)
SpecializationUtil.registerOverwrittenFunction(placeableType, "canBuy", BeeCare.canBuy)
end

-------------------------------------------------------------------------------
Expand Down Expand Up @@ -550,3 +551,14 @@ function BeeCare:updateInfo(overwrittenFunc, infoTable)

overwrittenFunc(self, infoTable)
end

---Can buy
function BeeCare:canBuy(overwrittenFunc)
local spec = self.spec_beecare

if spec.environment.currentSeason == Season.WINTER or spec.environment.currentSeason == Season.AUTUMN then
return false, g_brUtils:getModText('beesrevamp_beecare_warning_hive_placement_only_in_spring_and_summer')
end

return overwrittenFunc(self)
end
35 changes: 15 additions & 20 deletions FS25_BeesRevamp/src/beehivesystemextended.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function BeehiveSystemExtended:updateState()
self.isProductionActive = true

local isRaining = environment.weather:getIsRaining()
local isTemperaturToFly = environment.weather:getCurrentTemperature() > 10
local isTemperaturToFly = environment.weather:getCurrentTemperature() >= 10
local isSunOn = environment.isSunOn
local isWinterSeason = environment.currentSeason == Season.WINTER

Expand Down Expand Up @@ -112,7 +112,7 @@ function BeehiveSystemExtended:getBeehiveInfluenceFactorAt(wx, wz)
return 0
end

local totalFieldArea = farmLand.totalFieldArea or farmLand.areaInHa
local totalFieldArea = (farmLand.field ~= nil and farmLand.field.areaHa) or farmLand.areaInHa or farmLand.totalFieldArea
if totalFieldArea == nil then
return 0
end
Expand Down Expand Up @@ -167,11 +167,6 @@ function BeehiveSystemExtended:addFieldInfoExtension()
)
end

function BeehiveSystemExtended:onFieldDataUpdateFinished(data)
g_brUtils:logDebug('BeehiveSystemExtended:onFieldDataUpdateFinished')
self.requestedFieldData = true
end

---BeehiveSystemExtended:updateFieldInfoOverPopulation
---@param fieldInfo any
---@param startWorldX any
Expand All @@ -182,15 +177,15 @@ end
---@param heightWorldZ any
---@param isColorBlindMode any
function BeehiveSystemExtended:updateFieldInfoOverPopulation(fieldInfo, startWorldX, startWorldZ, widthWorldX, widthWorldZ, heightWorldX, heightWorldZ, isColorBlindMode)
if g_farmlandManager:getOwnerIdAtWorldPosition(startWorldX, startWorldZ) ~= self.mission.player.farmId then
if g_farmlandManager:getOwnerIdAtWorldPosition(startWorldX, startWorldZ) ~= g_localPlayer.farmId then
return nil
end

local player = g_currentMission.player
local positionX, positionY, positionZ = g_localPlayer.getPosition()

local farmLand = g_farmlandManager:getFarmlandAtWorldPosition(
player.baseInformation.lastPositionX,
player.baseInformation.lastPositionZ
positionX,
positionZ
)

if farmLand == nil then
Expand Down Expand Up @@ -230,11 +225,12 @@ end
---@param heightWorldZ any
---@param isColorBlindMode any
function BeehiveSystemExtended:updateFieldInfoDisplayBeeBonus(fieldInfo, startWorldX, startWorldZ, widthWorldX, widthWorldZ, heightWorldX, heightWorldZ, isColorBlindMode)
local player = self.mission.player
if g_farmlandManager:getOwnerIdAtWorldPosition(startWorldX, startWorldZ) ~= player.farmId then
if g_farmlandManager:getOwnerIdAtWorldPosition(startWorldX, startWorldZ) ~= g_localPlayer.farmId then
return nil
end

local positionX, positionY, positionZ = g_localPlayer.getPosition()

if (g_currentMission.environment.timeUpdateTime-self.lastFieldUpdateCache) > 1000 then
return nil
end
Expand All @@ -248,8 +244,8 @@ function BeehiveSystemExtended:updateFieldInfoDisplayBeeBonus(fieldInfo, startWo
local fruitYieldBonus = self:getYieldBonusByFruitName(fruitType.name)

local beeHiveYieldBonusAtPlayerPosition = g_currentMission.beehiveSystem:getBeehiveInfluenceFactorAt(
player.baseInformation.lastPositionX,
player.baseInformation.lastPositionZ
positionX,
positionZ
) * fruitType.beeYieldBonusPercentage

fieldInfo.beeHiveYieldBonusAtPlayerPosition = beeHiveYieldBonusAtPlayerPosition
Expand All @@ -275,7 +271,7 @@ end
---@param isColorBlindMode any
function BeehiveSystemExtended:updateFieldInfoDisplayInfluenced(fieldInfo, startWorldX, startWorldZ, widthWorldX, widthWorldZ,
heightWorldX, heightWorldZ, isColorBlindMode)
if g_farmlandManager:getOwnerIdAtWorldPosition(startWorldX, startWorldZ) ~= self.mission.player.farmId then
if g_farmlandManager:getOwnerIdAtWorldPosition(startWorldX, startWorldZ) ~= g_localPlayer.farmId then
return nil
end

Expand Down Expand Up @@ -305,16 +301,15 @@ end
---@param data table
---@param box table InfoBox
function BeehiveSystemExtended:fieldAddField(data, box)
local player = g_currentMission.hud.player
local positionX, positionY, positionZ = player.getPosition()
local positionX, positionY, positionZ = g_localPlayer.getPosition()

if g_farmlandManager:getOwnerIdAtWorldPosition(positionX, positionZ) ~= player.farmId then
if g_farmlandManager:getOwnerIdAtWorldPosition(positionX, positionZ) ~= g_localPlayer.farmId then
return
end

local beehiveSystemExtended = g_currentMission.beehiveSystem
local fruitTypeIndex = data.lastFruitTypeIndex
if fruitTypeIndex == nil then
if fruitTypeIndex == nil or fruitTypeIndex == 0 then
return
end

Expand Down
20 changes: 19 additions & 1 deletion FS25_BeesRevamp/src/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,21 @@ local function load(mission)
['e549aec41dae800a1b62573075a17b13'] = 500, -- Stock lvl 3
['bff790c871a3f21560dc4578d45911f1'] = 4000, -- Stock lvl 4
['6a07bd8c629f80689ce6a79e67693da5'] = 16000, -- Stock lvl 5
['4b9a66f00ce22d729192c5d6cc9bbffd'] = 2800, -- https://farming-simulator.com/mod.php?mod_id=304970&title=fs2025
['79d09dea1ea492013c71e700f6373914'] = 3200, -- https://farming-simulator.com/mod.php?mod_id=304970&title=fs2025
['9f1b9ed23bd55b4eccff4283c8190114'] = 200, -- https://farming-simulator.com/mod.php?mod_id=304970&title=fs2025
['9ad5df30c2f68bf7ac24b1e05fc5cbbd'] = 400, -- https://farming-simulator.com/mod.php?mod_id=304970&title=fs2025
['98cdfe4ea9e2f01dac978f2892daef26'] = 200, -- https://farming-simulator.com/mod.php?mod_id=304020&title=fs2025
['c4011d0e68dc43435cd5ba4c042365ce'] = 1150, -- https://farming-simulator.com/mod.php?mod_id=304020&title=fs2025
['5f8c5339e645b43380da721a356ca8b7'] = 450, -- https://farming-simulator.com/mod.php?mod_id=304020&title=fs2025
['c1ced218e3b359f60ce4d4f38ebee163'] = 250, -- https://farming-simulator.com/mod.php?mod_id=304020&title=fs2025
['d89223518ac45b268ff5807ce19131a8'] = 320, -- https://farming-simulator.com/mod.php?mod_id=304020&title=fs2025
['9fff11e7e8c17b430f0b9a6ccf49c864'] = 400, -- https://farming-simulator.com/mod.php?mod_id=304020&title=fs2025
},
PATCHLIST_YIELD_BONUS = {
['CANOLA'] = {
['yieldBonus'] = 0.3,
['hivesPerHa'] = 3
['hivesPerHa'] = 4
},
['SUNFLOWER'] = {
['yieldBonus'] = 0.8,
Expand All @@ -57,6 +67,14 @@ local function load(mission)
['yieldBonus'] = 0,
['hivesPerHa'] = 0
},
['COTTON'] = {
['yieldBonus'] = 0.35,
['hivesPerHa'] = 3
},
['SOYBEAN'] = {
['yieldBonus'] = 0.18,
['hivesPerHa'] = 2
},
}
}

Expand Down
17 changes: 7 additions & 10 deletions FS25_BeesRevamp/src/placeablebeehiveextended.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@
PlaceableBeehiveExtended = {
MOD_NAME = g_currentModName or 'unknown',
PATCHLIST_HIVE_COUNT_ON_RUNTIME = {
['fdbb92d36d913c6951195749a923ced0'] = 1, -- LS25 Stock BeeHiveGeneric1
['617aab6ddd64e931d7cb2615a6dcfd88'] = 12, -- LS25 Stock BeeHiveGeneric2
['a46e311e30b2c796bb535a79130880ef'] = 1, -- LS25 Stock Beehive01
['5a463aa504452e923b9366803b897035'] = 4, -- LS25 Stock Beehive02
['314b6994bff1068a180931d8f8d0aca4'] = 1, -- LS25 Stock Beehive03
['11213f68a4fd2d7020e13aeca9e9d236'] = 1, -- Stock lvl 1
['215ebd1eab110e0bf84b958df9cf6695'] = 1, -- Stock lvl 2
['e549aec41dae800a1b62573075a17b13'] = 1, -- Stock lvl 3
['bff790c871a3f21560dc4578d45911f1'] = 10, -- Stock lvl 4
['6a07bd8c629f80689ce6a79e67693da5'] = 33, -- Stock lvl 5
['617aab6ddd64e931d7cb2615a6dcfd88'] = 12, -- LS25 Stock BeeHiveGeneric2
['5a463aa504452e923b9366803b897035'] = 4, -- LS25 Stock Beehive02
['bff790c871a3f21560dc4578d45911f1'] = 10, -- Stock lvl 4
['6a07bd8c629f80689ce6a79e67693da5'] = 33, -- Stock lvl 5
['79d09dea1ea492013c71e700f6373914'] = 10, -- https://farming-simulator.com/mod.php?mod_id=304970&title=fs2025
['4b9a66f00ce22d729192c5d6cc9bbffd'] = 7, -- https://farming-simulator.com/mod.php?mod_id=304970&title=fs2025
['c4011d0e68dc43435cd5ba4c042365ce'] = 4, -- https://farming-simulator.com/mod.php?mod_id=242870&title=fs2022
},
NECTAR_PER_BEE_IN_MILLILITER = 0.05, -- 50ul (mikroliter)
BEE_FLIGHTS_PER_HOUR = 2.0,
Expand Down
Loading