Codechange:Renaming BusyBee's to BeeReward's.
This commit is contained in:
4
Makefile
4
Makefile
@@ -1,4 +1,4 @@
|
|||||||
# Busy Bee Makefile
|
# Bee Reward Makefile
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
PROJECT_NAME = BusyBee
|
PROJECT_NAME = BeeReward
|
||||||
|
|
||||||
SOURCES = *.nut
|
SOURCES = *.nut
|
||||||
VERSION_NUT = version.nut
|
VERSION_NUT = version.nut
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
[musa]
|
[musa]
|
||||||
type = Game Script
|
type = Game Script
|
||||||
name = BusyBee
|
name = BeeReward
|
||||||
|
|
||||||
# The version is inserted by the Makefile
|
# The version is inserted by the Makefile
|
||||||
version =
|
version =
|
||||||
|
|
||||||
description_file = bananas_description.txt
|
description_file = bananas_description.txt
|
||||||
url = http://dev.openttdcoop.org/projects/busy-bee-gs
|
url = http://dev.openttdcoop.org/projects/bee-awards
|
||||||
license = GPL v2
|
license = GPL v2
|
||||||
tags = cargo, challenge, goal, cooperative
|
tags = cargo, challenge, goal, cooperative, reward
|
||||||
openttd_minimum_supported_version = 1.4.2
|
openttd_minimum_supported_version = 1.4.2
|
||||||
openttd_maximum_supported_version =
|
openttd_maximum_supported_version =
|
||||||
|
|
||||||
# SuperLib_for_NoGo-36.tar
|
# SuperLib_for_NoGo-36.tar
|
||||||
dependencies =
|
dependencies =
|
||||||
|
|
||||||
authors = alberth, andythenorth
|
authors = alberth, andythenorth, jottyfan
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
BusyBee continuously gives you new goals for transportation. It's meant for long-term fun; as such there is no ultimate goal to achieve.
|
BeeReward is a fork of Busy Bee. It continuously gives you new goals for transportation, and can give rewards in the form of money for achieving it. There is no ultimate goal to achieve.
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
#
|
#
|
||||||
# This file is part of BusyBee, which is a GameScript for OpenTTD
|
# This file is part of BeeReward, which is a GameScript for OpenTTD
|
||||||
# Copyright (C) 2014-2015 alberth / andythenorth
|
# Copyright (C) 2014-2015 alberth / andythenorth
|
||||||
#
|
#
|
||||||
# BusyBee is free software; you can redistribute it and/or modify it
|
# BeeReward is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by
|
# under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; version 2 of the License
|
# the Free Software Foundation; version 2 of the License
|
||||||
#
|
#
|
||||||
# BusyBee is distributed in the hope that it will be useful,
|
# BeeReward is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with BusyBee; If not, see <http://www.gnu.org/licenses/> or
|
# along with BeeReward; If not, see <http://www.gnu.org/licenses/> or
|
||||||
# write to the Free Software Foundation, Inc., 51 Franklin Street,
|
# write to the Free Software Foundation, Inc., 51 Franklin Street,
|
||||||
# Fifth Floor, Boston, MA 02110-1301 USA.
|
# Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of BusyBee, which is a GameScript for OpenTTD
|
* This file is part of BeeReward, which is a GameScript for OpenTTD
|
||||||
* Copyright (C) 2014-2015 alberth / andythenorth
|
* Copyright (C) 2014-2015 alberth / andythenorth
|
||||||
*
|
*
|
||||||
* BusyBee is free software; you can redistribute it and/or modify it
|
* BeeReward is free software; you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by
|
* under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License
|
* the Free Software Foundation; version 2 of the License
|
||||||
*
|
*
|
||||||
* BusyBee is distributed in the hope that it will be useful,
|
* BeeReward is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with BusyBee; If not, see <http://www.gnu.org/licenses/> or
|
* along with BeeReward; If not, see <http://www.gnu.org/licenses/> or
|
||||||
* write to the Free Software Foundation, Inc., 51 Franklin Street,
|
* write to the Free Software Foundation, Inc., 51 Franklin Street,
|
||||||
* Fifth Floor, Boston, MA 02110-1301 USA.
|
* Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|||||||
22
info.nut
22
info.nut
@@ -1,18 +1,18 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of BusyBee, which is a GameScript for OpenTTD
|
* This file is part of BeeReward, which is a GameScript for OpenTTD
|
||||||
* Copyright (C) 2014-2015 alberth / andythenorth
|
* Copyright (C) 2014-2015 alberth / andythenorth / jottyfan
|
||||||
*
|
*
|
||||||
* BusyBee is free software; you can redistribute it and/or modify it
|
* BeeReward is free software; you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by
|
* under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License
|
* the Free Software Foundation; version 2 of the License
|
||||||
*
|
*
|
||||||
* BusyBee is distributed in the hope that it will be useful,
|
* BeeReward is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with BusyBee; If not, see <http://www.gnu.org/licenses/> or
|
* along with BeeReward; If not, see <http://www.gnu.org/licenses/> or
|
||||||
* write to the Free Software Foundation, Inc., 51 Franklin Street,
|
* write to the Free Software Foundation, Inc., 51 Franklin Street,
|
||||||
* Fifth Floor, Boston, MA 02110-1301 USA.
|
* Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
@@ -24,13 +24,13 @@ PROGRAM_VERSION <- Syntax error, set by 'make bundle'.
|
|||||||
PROGRAM_DATE <- Syntax error, set by 'make bundle'.
|
PROGRAM_DATE <- Syntax error, set by 'make bundle'.
|
||||||
PROGRAM_NAME <- Syntax error, set by 'make bundle'.
|
PROGRAM_NAME <- Syntax error, set by 'make bundle'.
|
||||||
|
|
||||||
class BusyBeeInfo extends GSInfo {
|
class BeeRewardInfo extends GSInfo {
|
||||||
function GetAuthor() { return "alberth & andythenorth, reward by jottyfan"; }
|
function GetAuthor() { return "alberth, andythenorth, jottyfan"; }
|
||||||
function GetName() { return "Bee Reward"; } // Old: return PROGRAM_NAME;
|
function GetName() { return "Bee Reward"; } // Old: return PROGRAM_NAME;
|
||||||
function GetDescription() { return "Make connection, transport cargo, recieve reward"; }
|
function GetDescription() { return "Make connection, transport cargo, receive reward"; }
|
||||||
function GetVersion() { return PROGRAM_VERSION + SAVEGAME_VERSION * 100000; }
|
function GetVersion() { return PROGRAM_VERSION + SAVEGAME_VERSION * 100000; }
|
||||||
function GetDate() { return PROGRAM_DATE; }
|
function GetDate() { return PROGRAM_DATE; }
|
||||||
function CreateInstance() { return "BusyBeeClass"; }
|
function CreateInstance() { return "BeeRewardClass"; }
|
||||||
function GetShortName() { return "BREW"; }
|
function GetShortName() { return "BREW"; }
|
||||||
function GetAPIVersion() { return "1.5"; }
|
function GetAPIVersion() { return "1.5"; }
|
||||||
function GetUrl() { return "http://dev.openttdcoop.org/projects/bee-awards"; }
|
function GetUrl() { return "http://dev.openttdcoop.org/projects/bee-awards"; }
|
||||||
@@ -38,7 +38,7 @@ class BusyBeeInfo extends GSInfo {
|
|||||||
function GetSettings();
|
function GetSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
function BusyBeeInfo::GetSettings()
|
function BeeRewardInfo::GetSettings()
|
||||||
{
|
{
|
||||||
GSInfo.AddSetting({name="num_goals",
|
GSInfo.AddSetting({name="num_goals",
|
||||||
description="Number of goals for a company (1-10)",
|
description="Number of goals for a company (1-10)",
|
||||||
@@ -127,4 +127,4 @@ function BusyBeeInfo::GetSettings()
|
|||||||
flags=GSInfo.CONFIG_INGAME});
|
flags=GSInfo.CONFIG_INGAME});
|
||||||
}
|
}
|
||||||
|
|
||||||
RegisterGS(BusyBeeInfo());
|
RegisterGS(BeeRewardInfo());
|
||||||
|
|||||||
54
main.nut
54
main.nut
@@ -1,18 +1,18 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of BusyBee, which is a GameScript for OpenTTD
|
* This file is part of BeeReward, which is a GameScript for OpenTTD
|
||||||
* Copyright (C) 2014-2015 alberth / andythenorth
|
* Copyright (C) 2014-2015 alberth / andythenorth
|
||||||
*
|
*
|
||||||
* BusyBee is free software; you can redistribute it and/or modify it
|
* BeeReward is free software; you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by
|
* under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; version 2 of the License
|
* the Free Software Foundation; version 2 of the License
|
||||||
*
|
*
|
||||||
* BusyBee is distributed in the hope that it will be useful,
|
* BeeReward is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with BusyBee; If not, see <http://www.gnu.org/licenses/> or
|
* along with BeeReward; If not, see <http://www.gnu.org/licenses/> or
|
||||||
* write to the Free Software Foundation, Inc., 51 Franklin Street,
|
* write to the Free Software Foundation, Inc., 51 Franklin Street,
|
||||||
* Fifth Floor, Boston, MA 02110-1301 USA.
|
* Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
@@ -22,7 +22,7 @@ require("company.nut");
|
|||||||
// Cargo description.
|
// Cargo description.
|
||||||
class Cargo
|
class Cargo
|
||||||
{
|
{
|
||||||
index = null; ///< Index of the cargo in the cargo table (#BusyBeeClass.cargoes).
|
index = null; ///< Index of the cargo in the cargo table (#BeeRewardClass.cargoes).
|
||||||
cid = null; ///< Id of the cargo in GRF.
|
cid = null; ///< Id of the cargo in GRF.
|
||||||
freight = null; ///< Whether the cargo is considered to be freight.
|
freight = null; ///< Whether the cargo is considered to be freight.
|
||||||
effect = null; ///< Town effect (One of #GSCargo.TownEffect).
|
effect = null; ///< Town effect (One of #GSCargo.TownEffect).
|
||||||
@@ -53,7 +53,7 @@ function Cargo::GetWeight(effect)
|
|||||||
// ************************************************************************
|
// ************************************************************************
|
||||||
// ************************************************************************
|
// ************************************************************************
|
||||||
|
|
||||||
class BusyBeeClass extends GSController
|
class BeeRewardClass extends GSController
|
||||||
{
|
{
|
||||||
cargoes = null; ///< Cargoes of the game (index -> 'cid' number, 'freight' boolean, 'effect' on town).
|
cargoes = null; ///< Cargoes of the game (index -> 'cid' number, 'freight' boolean, 'effect' on town).
|
||||||
num_cargoes = 0; ///< Number of cargoes in 'this.cargoes'.
|
num_cargoes = 0; ///< Number of cargoes in 'this.cargoes'.
|
||||||
@@ -68,7 +68,7 @@ class BusyBeeClass extends GSController
|
|||||||
function Start();
|
function Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
function BusyBeeClass::Load(version, data)
|
function BeeRewardClass::Load(version, data)
|
||||||
{
|
{
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
this.Initialize();
|
this.Initialize();
|
||||||
@@ -79,7 +79,7 @@ function BusyBeeClass::Load(version, data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function BusyBeeClass::Save()
|
function BeeRewardClass::Save()
|
||||||
{
|
{
|
||||||
local result = {};
|
local result = {};
|
||||||
foreach (comp_id, cdata in this.companies) {
|
foreach (comp_id, cdata in this.companies) {
|
||||||
@@ -90,7 +90,7 @@ function BusyBeeClass::Save()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialize core data of the script.
|
// Initialize core data of the script.
|
||||||
function BusyBeeClass::Initialize()
|
function BeeRewardClass::Initialize()
|
||||||
{
|
{
|
||||||
if (this.companies != null) return; // Already initialized.
|
if (this.companies != null) return; // Already initialized.
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ function BusyBeeClass::Initialize()
|
|||||||
// @param cargo_index Cargo index (index in this.cargoes).
|
// @param cargo_index Cargo index (index in this.cargoes).
|
||||||
// @return List of resources that produce the requested cargo, list of
|
// @return List of resources that produce the requested cargo, list of
|
||||||
// 'ind' or 'town' number, 'prod' produced amount, 'transp' transported amount, and 'loc' location.
|
// 'ind' or 'town' number, 'prod' produced amount, 'transp' transported amount, and 'loc' location.
|
||||||
function BusyBeeClass::FindSources(cargo_index)
|
function BeeRewardClass::FindSources(cargo_index)
|
||||||
{
|
{
|
||||||
local cargo = this.cargoes[cargo_index];
|
local cargo = this.cargoes[cargo_index];
|
||||||
local num_sources = 0;
|
local num_sources = 0;
|
||||||
@@ -167,7 +167,7 @@ function BusyBeeClass::FindSources(cargo_index)
|
|||||||
// @param cargo_index Cargo index (index in this.cargoes).
|
// @param cargo_index Cargo index (index in this.cargoes).
|
||||||
// @param company Company to inspect.
|
// @param company Company to inspect.
|
||||||
// @return A list of destinations, tables 'ind' or 'town' id, and a 'loc' location.
|
// @return A list of destinations, tables 'ind' or 'town' id, and a 'loc' location.
|
||||||
function BusyBeeClass::FindDestinations(cargo_index, company)
|
function BeeRewardClass::FindDestinations(cargo_index, company)
|
||||||
{
|
{
|
||||||
local cargo = this.cargoes[cargo_index];
|
local cargo = this.cargoes[cargo_index];
|
||||||
local num_dests = 0;
|
local num_dests = 0;
|
||||||
@@ -218,18 +218,18 @@ function BusyBeeClass::FindDestinations(cargo_index, company)
|
|||||||
// @param desired Desired distance.
|
// @param desired Desired distance.
|
||||||
// @param actual Actual distance.
|
// @param actual Actual distance.
|
||||||
// @return Score for the distance.
|
// @return Score for the distance.
|
||||||
function BusyBeeClass::GetDistanceScore(desired, actual)
|
function BeeRewardClass::GetDistanceScore(desired, actual)
|
||||||
{
|
{
|
||||||
if (actual < desired) return 1000 - 3 * (desired - actual); // Too close gets punished hard.
|
if (actual < desired) return 1000 - 3 * (desired - actual); // Too close gets punished hard.
|
||||||
return 1000 - (actual - desired);
|
return 1000 - (actual - desired);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to find a challenge for a given cargo and a desired distance.
|
// Try to find a challenge for a given cargo and a desired distance.
|
||||||
// @param cargo_index Index in BusyBeeClass.cargoes.
|
// @param cargo_index Index in BeeRewardClass.cargoes.
|
||||||
// @param distance Desired distance between source and target.
|
// @param distance Desired distance between source and target.
|
||||||
// @param comp_id Company to find a challenge for.
|
// @param comp_id Company to find a challenge for.
|
||||||
// @return Best accepting industry to use, or 'null' if no industry-pair found.
|
// @return Best accepting industry to use, or 'null' if no industry-pair found.
|
||||||
function BusyBeeClass::FindChallenge(cargo_index, distance, comp_id)
|
function BeeRewardClass::FindChallenge(cargo_index, distance, comp_id)
|
||||||
{
|
{
|
||||||
local prods = this.FindSources(cargo_index);
|
local prods = this.FindSources(cargo_index);
|
||||||
if (prods.len() == 0) return null;
|
if (prods.len() == 0) return null;
|
||||||
@@ -266,7 +266,7 @@ function BusyBeeClass::FindChallenge(cargo_index, distance, comp_id)
|
|||||||
|
|
||||||
// Select the next cargo to use for a goal.
|
// Select the next cargo to use for a goal.
|
||||||
// @return The index of the cargo to use in this.cargoes.
|
// @return The index of the cargo to use in this.cargoes.
|
||||||
function BusyBeeClass::SelectCargo()
|
function BeeRewardClass::SelectCargo()
|
||||||
{
|
{
|
||||||
local remaining = GSBase.RandRange(this.sum_weight);
|
local remaining = GSBase.RandRange(this.sum_weight);
|
||||||
local cargo_index = 0;
|
local cargo_index = 0;
|
||||||
@@ -280,7 +280,7 @@ function BusyBeeClass::SelectCargo()
|
|||||||
|
|
||||||
// Try to add a goal for a company.
|
// Try to add a goal for a company.
|
||||||
// @param comp_id Company to find a challenge for.
|
// @param comp_id Company to find a challenge for.
|
||||||
function BusyBeeClass::CreateChallenge(comp_id)
|
function BeeRewardClass::CreateChallenge(comp_id)
|
||||||
{
|
{
|
||||||
local cdata = this.companies[comp_id];
|
local cdata = this.companies[comp_id];
|
||||||
local cargomp = GSController.GetSetting("cargo_mp");
|
local cargomp = GSController.GetSetting("cargo_mp");
|
||||||
@@ -320,7 +320,7 @@ function BusyBeeClass::CreateChallenge(comp_id)
|
|||||||
|
|
||||||
// Process events that arrived.
|
// Process events that arrived.
|
||||||
// @return Table with 'force_goal' bool to force goal updating.
|
// @return Table with 'force_goal' bool to force goal updating.
|
||||||
function BusyBeeClass::ProcessEvents()
|
function BeeRewardClass::ProcessEvents()
|
||||||
{
|
{
|
||||||
local force_goal = false;
|
local force_goal = false;
|
||||||
while (GSEventController.IsEventWaiting()) {
|
while (GSEventController.IsEventWaiting()) {
|
||||||
@@ -362,7 +362,7 @@ function BusyBeeClass::ProcessEvents()
|
|||||||
|
|
||||||
// Check if new goals should be created.
|
// Check if new goals should be created.
|
||||||
// @return Table with 'more_goals_needed' boolean, and 'force_monitor' to force updating.
|
// @return Table with 'more_goals_needed' boolean, and 'force_monitor' to force updating.
|
||||||
function BusyBeeClass::TryAddNewGoal()
|
function BeeRewardClass::TryAddNewGoal()
|
||||||
{
|
{
|
||||||
local force_monitor=false;
|
local force_monitor=false;
|
||||||
|
|
||||||
@@ -391,7 +391,7 @@ function BusyBeeClass::TryAddNewGoal()
|
|||||||
// Update progress on existing monitored goals, add monitoring for new goals, and drop monitors for removed goals.
|
// Update progress on existing monitored goals, add monitoring for new goals, and drop monitors for removed goals.
|
||||||
// @param old_cmon Monitored deliveries (or 'null' if first call).
|
// @param old_cmon Monitored deliveries (or 'null' if first call).
|
||||||
// @return Table 'cmon' with the new monitored deliveries, 'finished_goals' boolean when there exist goals that are completed.
|
// @return Table 'cmon' with the new monitored deliveries, 'finished_goals' boolean when there exist goals that are completed.
|
||||||
function BusyBeeClass::UpdateDeliveries(old_cmon)
|
function BeeRewardClass::UpdateDeliveries(old_cmon)
|
||||||
{
|
{
|
||||||
if (old_cmon == null) { // First run, clear any old monitoring.
|
if (old_cmon == null) { // First run, clear any old monitoring.
|
||||||
GSCargoMonitor.StopAllMonitoring();
|
GSCargoMonitor.StopAllMonitoring();
|
||||||
@@ -421,7 +421,7 @@ function BusyBeeClass::UpdateDeliveries(old_cmon)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The script data got loaded from file, check it against the game.
|
// The script data got loaded from file, check it against the game.
|
||||||
function BusyBeeClass::CompaniesPostLoadCheck()
|
function BeeRewardClass::CompaniesPostLoadCheck()
|
||||||
{
|
{
|
||||||
// Check companies.
|
// Check companies.
|
||||||
for (local comp_id = GSCompany.COMPANY_FIRST; comp_id <= GSCompany.COMPANY_LAST; comp_id++) {
|
for (local comp_id = GSCompany.COMPANY_FIRST; comp_id <= GSCompany.COMPANY_LAST; comp_id++) {
|
||||||
@@ -446,7 +446,7 @@ function BusyBeeClass::CompaniesPostLoadCheck()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function BusyBeeClass::Start()
|
function BeeRewardClass::Start()
|
||||||
{
|
{
|
||||||
this.Initialize();
|
this.Initialize();
|
||||||
this.Sleep(1); // Wait for the game to start.
|
this.Sleep(1); // Wait for the game to start.
|
||||||
@@ -525,7 +525,7 @@ function BusyBeeClass::Start()
|
|||||||
// Fill company monitors with monitored amounts.
|
// Fill company monitors with monitored amounts.
|
||||||
// @param [inout] cmon Table of 'comp_id' number to 'cargo_id' number to
|
// @param [inout] cmon Table of 'comp_id' number to 'cargo_id' number to
|
||||||
// 'ind' and/or 'town' to resource indices to 'null'.
|
// 'ind' and/or 'town' to resource indices to 'null'.
|
||||||
function BusyBeeClass::FillMonitors(cmon)
|
function BeeRewardClass::FillMonitors(cmon)
|
||||||
{
|
{
|
||||||
foreach (comp_id, mon in cmon) {
|
foreach (comp_id, mon in cmon) {
|
||||||
foreach (cargo_id, rmon in mon) {
|
foreach (cargo_id, rmon in mon) {
|
||||||
@@ -555,7 +555,7 @@ function BusyBeeClass::FillMonitors(cmon)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function BusyBeeClass::UpdateCompanyMonitors(old_cmon, cmon)
|
function BeeRewardClass::UpdateCompanyMonitors(old_cmon, cmon)
|
||||||
{
|
{
|
||||||
foreach (comp_id, old_mon in old_cmon) {
|
foreach (comp_id, old_mon in old_cmon) {
|
||||||
if (comp_id in cmon) {
|
if (comp_id in cmon) {
|
||||||
@@ -566,7 +566,7 @@ function BusyBeeClass::UpdateCompanyMonitors(old_cmon, cmon)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function BusyBeeClass::UpdateCargoMonitors(comp_id, old_mon, mon)
|
function BeeRewardClass::UpdateCargoMonitors(comp_id, old_mon, mon)
|
||||||
{
|
{
|
||||||
foreach (cargo_id, old_rmon in old_mon) {
|
foreach (cargo_id, old_rmon in old_mon) {
|
||||||
if (cargo_id in mon) {
|
if (cargo_id in mon) {
|
||||||
@@ -577,7 +577,7 @@ function BusyBeeClass::UpdateCargoMonitors(comp_id, old_mon, mon)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function BusyBeeClass::UpdateResourceMonitors(comp_id, cargo_id, old_rmon, rmon)
|
function BeeRewardClass::UpdateResourceMonitors(comp_id, cargo_id, old_rmon, rmon)
|
||||||
{
|
{
|
||||||
if ("town" in old_rmon) {
|
if ("town" in old_rmon) {
|
||||||
if ("town" in rmon) {
|
if ("town" in rmon) {
|
||||||
@@ -595,7 +595,7 @@ function BusyBeeClass::UpdateResourceMonitors(comp_id, cargo_id, old_rmon, rmon)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function BusyBeeClass::UpdateTownMonitors(comp_id, cargo_id, old_tmon, tmon)
|
function BeeRewardClass::UpdateTownMonitors(comp_id, cargo_id, old_tmon, tmon)
|
||||||
{
|
{
|
||||||
foreach (town_id, _ in old_tmon) {
|
foreach (town_id, _ in old_tmon) {
|
||||||
if (!(town_id in tmon)) {
|
if (!(town_id in tmon)) {
|
||||||
@@ -607,7 +607,7 @@ function BusyBeeClass::UpdateTownMonitors(comp_id, cargo_id, old_tmon, tmon)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function BusyBeeClass::UpdateIndMonitors(comp_id, cargo_id, old_imon, imon)
|
function BeeRewardClass::UpdateIndMonitors(comp_id, cargo_id, old_imon, imon)
|
||||||
{
|
{
|
||||||
foreach (ind_id, _ in old_imon) {
|
foreach (ind_id, _ in old_imon) {
|
||||||
if (!(ind_id in imon)) {
|
if (!(ind_id in imon)) {
|
||||||
|
|||||||
44
readme.txt
44
readme.txt
@@ -1,32 +1,32 @@
|
|||||||
===============
|
=================
|
||||||
Busy Bee readme
|
Bee Reward readme
|
||||||
===============
|
=================
|
||||||
|
|
||||||
Manual for the really Busy Bees
|
Manual for the really impatient Bees
|
||||||
===============================
|
====================================
|
||||||
|
|
||||||
- Activate the game script,
|
- Activate the game script,
|
||||||
- Start new game,
|
- Start new game,
|
||||||
- Pick a goal from the goal window to do,
|
- Pick a goal from the goal window to do,
|
||||||
- Make a connection from a supplier to the given destination for the requested
|
- Make a connection from a supplier to the given destination for the requested
|
||||||
cargo type,
|
cargo type,
|
||||||
- Transport the cargo,
|
- Transport the cargo, get reward,
|
||||||
- Pick next goal to connect.
|
- Pick next goal to connect.
|
||||||
|
|
||||||
|
|
||||||
Manual for the less Busy Bees
|
Manual for the less impatient bees
|
||||||
=============================
|
==================================
|
||||||
|
|
||||||
Busy Bee is a game script for OpenTTD 1.5 or newer.
|
Bee Reward is a game script for OpenTTD 1.5 or newer.
|
||||||
|
|
||||||
The script gives a number of goals to achieve (number of goals can be set by a
|
The script gives a number of goals to achieve (number of goals can be set by a
|
||||||
parameter). It requests a given amount of cargo of a given type to deliver to a
|
parameter). It requests a given amount of cargo of a given type to deliver to a
|
||||||
given destination within a time frame. You have to build the transport
|
given destination, where the first amount should arrive within a time frame.
|
||||||
connection, and deliver the requested amount. When that is done, the goal is
|
You have to build the transport connection, and deliver the requested amount.
|
||||||
considered to be fulfilled. It is removed from the list, and a new goal is
|
When that is done, the goal is considered to be fulfilled. It is removed from
|
||||||
created (may take a while) for you to fulfill.
|
the list, and a new goal is created (may take a while) for you to fulfill.
|
||||||
|
|
||||||
You don't get anything when you fulfill the goal. There is also no penalty for
|
You can configure how much you get for completing a goal. There is no penalty for
|
||||||
failing to achieve a goal. The purpose of the timer is to get rid of obsolete
|
failing to achieve a goal. The purpose of the timer is to get rid of obsolete
|
||||||
or unreachable goals. Since the timer is reset when new cargo is detected, you
|
or unreachable goals. Since the timer is reset when new cargo is detected, you
|
||||||
can take as long as you like to complete the goal, as long as you deliver
|
can take as long as you like to complete the goal, as long as you deliver
|
||||||
@@ -36,14 +36,10 @@ something regularly.
|
|||||||
Features
|
Features
|
||||||
========
|
========
|
||||||
|
|
||||||
Busy Bee RC2
|
Bee Reward 1
|
||||||
- Clickable news (with sufficiently new OpenTTD).
|
- Set the balance between town and industrial cargo goals.
|
||||||
- Goal timer gets reset to its original length on delivery of cargo.
|
- Set the amount of reward for completing a goal.
|
||||||
- Added options to set the weight of passengers, mail, or town-effect cargoes,
|
- Forked from Busy Bee RC2
|
||||||
to give them a higher chance of being picked as goal.
|
|
||||||
|
|
||||||
Busy Bee RC1
|
|
||||||
- Initial release
|
|
||||||
|
|
||||||
Translations
|
Translations
|
||||||
============
|
============
|
||||||
@@ -65,8 +61,8 @@ We thank the following people for their contributed translations:
|
|||||||
License
|
License
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Busy Bee
|
Bee Reward
|
||||||
Copyright (C) 2015 andythenorth and alberth
|
Copyright (C) 2015 andythenorth, alberth, jottyfan
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
the terms of the GNU General Public License version 2 as published by the Free
|
the terms of the GNU General Public License version 2 as published by the Free
|
||||||
|
|||||||
Reference in New Issue
Block a user