mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-02-03 13:11:21 +02:00
renamed fish_market.lua to market.lua and market_item to currency
This commit is contained in:
parent
3ab26ea014
commit
1eebea55e8
@ -1,7 +1,7 @@
|
||||
_DEBUG = false
|
||||
_CHEATS = false
|
||||
_DUMP_ENV = false
|
||||
local market_item = 'coin'
|
||||
local currency = 'coin'
|
||||
|
||||
global.config = {
|
||||
-- adds a GUI listing the scenario features, the rules, and the details of the current map
|
||||
@ -60,6 +60,7 @@ global.config = {
|
||||
-- adds a fish market
|
||||
fish_market = {
|
||||
enabled = true,
|
||||
currency = currency,
|
||||
},
|
||||
-- adds anti-nuke griefing
|
||||
nuke_control = {
|
||||
@ -164,7 +165,7 @@ global.config = {
|
||||
player_rewards = {
|
||||
enabled = true,
|
||||
-- the token to use for rewards
|
||||
token = market_item,
|
||||
token = currency,
|
||||
-- rewards players for looking through the info tabs
|
||||
info_player_reward = true,
|
||||
},
|
||||
|
@ -59,10 +59,10 @@ end
|
||||
if config.walkabout.enabled then
|
||||
require 'features.walkabout'
|
||||
end
|
||||
if global.config.performance.enabled then
|
||||
if config.performance.enabled then
|
||||
require 'features.performance'
|
||||
end
|
||||
if global.config.hail_hydra.enabled then
|
||||
if config.hail_hydra.enabled then
|
||||
require 'features.hail_hydra'
|
||||
end
|
||||
|
||||
|
@ -11,6 +11,7 @@ local pairs = pairs
|
||||
local random = math.random
|
||||
local format = string.format
|
||||
local get_random = table.get_random
|
||||
local currency = global.config.fish_market.currency
|
||||
|
||||
local running_speed_boost_messages = {
|
||||
'%s found the lost Dragon Scroll and got a lv.1 speed boost!',
|
||||
@ -43,14 +44,14 @@ local function spawn_market(_, player)
|
||||
Retailer.set_item('fish_market', prototype)
|
||||
end
|
||||
|
||||
force.add_chart_tag(surface, {icon = {type = 'item', name = 'coin'}, position = pos, text = 'Market'})
|
||||
force.add_chart_tag(surface, {icon = {type = 'item', name = currency}, position = pos, text = 'Market'})
|
||||
end
|
||||
|
||||
local function fish_earned(event, amount)
|
||||
local player_index = event.player_index
|
||||
local player = Game.get_player_by_index(player_index)
|
||||
|
||||
local stack = {name = 'coin', count = amount}
|
||||
local stack = {name = currency, count = amount}
|
||||
local inserted = player.insert(stack)
|
||||
|
||||
local diff = amount - inserted
|
||||
@ -88,7 +89,7 @@ local entity_drop_amount = {
|
||||
}
|
||||
|
||||
local spill_items = Token.register(function(data)
|
||||
data.surface.spill_item_stack(data.position, {name = 'coin', count = data.count}, true)
|
||||
data.surface.spill_item_stack(data.position, {name = currency, count = data.count}, true)
|
||||
end)
|
||||
|
||||
local function fish_drop_entity_died(event)
|
||||
@ -225,14 +226,14 @@ local function player_created(event)
|
||||
end
|
||||
|
||||
local count = global.config.player_rewards.info_player_reward and 1 or 10
|
||||
player.insert {name = 'coin', count = count}
|
||||
player.insert {name = currency, count = count}
|
||||
end
|
||||
|
||||
Command.add(
|
||||
'market',
|
||||
{
|
||||
description = 'Places a market near you.',
|
||||
admin_only = true
|
||||
admin_only = true,
|
||||
},
|
||||
spawn_market
|
||||
)
|
@ -1,6 +1,6 @@
|
||||
-- Map by Jayefuu & grilledham for Thanksgiving 2018
|
||||
-- For Thanksgiving themed messages and jokes change line 28 of fish_market.lua to:
|
||||
-- local fish_market_bonus_message = require 'resources.turkey_messages'
|
||||
-- For Thanksgiving themed messages and jokes change line 9 of market.lua to:
|
||||
-- local market_bonus_message = require 'resources.turkey_messages'
|
||||
|
||||
local b = require 'map_gen.shared.builders'
|
||||
local Random = require 'map_gen.shared.random'
|
||||
|
@ -5,7 +5,7 @@ local Command = require 'utils.command'
|
||||
local format = string.format
|
||||
|
||||
local Public = {}
|
||||
local reward_token = {global.config.player_rewards.token} or {'coin'}
|
||||
local reward_token = {global.config.player_rewards.token} or {global.config.market.currency} or {'coin'}
|
||||
|
||||
Global.register({
|
||||
reward_token = reward_token,
|
||||
|
Loading…
x
Reference in New Issue
Block a user