1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

crashsite 0.2.2

This commit is contained in:
grilledham 2018-07-31 11:51:02 +01:00
parent 77e7fc4f31
commit fa362ba34b
9 changed files with 40 additions and 108 deletions

View File

@ -322,77 +322,6 @@ local function toggle_tp_mode(cmd)
end
end
global.old_force = {}
global.force_toggle_init = true
local function forcetoggle(cmd)
if not (game.player and game.player.admin and game.player.character) then
cant_run(cmd.name)
return
end
if global.force_toggle_init then
game.forces.enemy.research_all_technologies() --avoids losing logstics slot configuration
global.force_toggle_init = false
end
-- save the logistics slots
local slots = {}
local slot_counts = game.player.character.request_slot_count
if game.player.character.request_slot_count > 0 then
for i = 1, slot_counts do
local slot = game.player.character.get_request_slot(i)
if slot ~= nil then
table.insert(slots, slot)
end
end
end
if game.player.force.name == 'enemy' then
local old_force = global.old_force[game.player.name]
if not old_force then
game.player.force = 'player'
game.player.print("You're are now on the player force.")
else
if game.forces[old_force] then
game.player.force = old_force
else
game.player.force = 'player'
end
end
else
--Put roboports into inventory
local inv = game.player.get_inventory(defines.inventory.player_armor)
if inv[1].valid_for_read then
local name = inv[1].name
if name:match('power') or name:match('modular') then
local equips = inv[1].grid.equipment
for _, equip in pairs(equips) do
if
equip.name == 'personal-roboport-equipment' or equip.name == 'personal-roboport-mk2-equipment' or
equip.name == 'personal-laser-defense-equipment'
then
if game.player.insert {name = equip.name} == 0 then
game.player.surface.spill_item_stack(game.player.position, {name = equip.name})
end
inv[1].grid.take(equip)
end
end
end
end
global.old_force[game.player.name] = game.player.force.name
game.player.force = 'enemy'
end
game.player.print('You are now on the ' .. game.player.force.name .. ' force.')
-- Attempt to rebuild the request slots
if game.player.character.request_slot_count > 0 then
for _, slot in ipairs(slots) do
game.player.character.set_request_slot(slot, _)
end
end
end
local function get_group()
local group = game.permissions.get_group('Banned')
if not group then
@ -648,7 +577,7 @@ commands.add_command(
'Toggles tp mode. When on place a ghost entity to teleport there (Admins only)',
toggle_tp_mode
)
commands.add_command('forcetoggle', 'Toggles the players force between player and enemy (Admins only)', forcetoggle)
commands.add_command('tempban', '<player> <minutes> Temporarily bans a player (Admins only)', tempban)
commands.add_command(
'spyshot',

View File

@ -53,6 +53,7 @@ local medium_chemical_factory = require 'map_gen.presets.crash_site.outpost_data
local big_chemical_factory = require 'map_gen.presets.crash_site.outpost_data.big_chemical_factory'
local stage1 = {
small_iron_plate_factory,
small_iron_plate_factory,
small_copper_plate_factory,
small_gear_factory,
@ -278,8 +279,8 @@ local worms = {
'big-worm-turret'
}
local max_spawner_chance = 1 / 128
local spawner_chance_factor = 1 / (128 * 512)
local max_spawner_chance = 1 / 160
local spawner_chance_factor = 1 / (160 * 512)
local max_worm_chance = 1 / 32
local worm_chance_factor = 1 / (32 * 512)
@ -303,7 +304,7 @@ local function enemy(x, y, world)
end
end
local worm_chance = d - 128
local worm_chance = d - 144
if worm_chance > 0 then
worm_chance = worm_chance * worm_chance_factor
@ -404,7 +405,7 @@ for r = 1, 50 do
end
local ore_grid = b.grid_pattern_full_overlap(ore_pattern, 50, 50, 64, 64)
ore_grid = b.choose(b.rectangle(196), b.no_entity, ore_grid)
ore_grid = b.choose(b.rectangle(138), b.no_entity, ore_grid)
local map = b.if_else(outposts, enemy_shape)
--map = b.change_tile(map, true, 'grass-1')

View File

@ -22,7 +22,7 @@ local factory = {
callback = ob.magic_item_crafting_callback,
data = {
furance_item = {name = 'copper-ore', count = 100},
output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 512, item = 'copper-plate'}
output = {min_rate = 3 / 60, distance_factor = 1.5 / 60 / 512, item = 'copper-plate'}
}
}

View File

@ -24,7 +24,7 @@ local factory = {
callback = ob.magic_item_crafting_callback,
data = {
furance_item = {name = 'iron-ore', count = 100},
output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 512, item = 'iron-plate'}
output = {min_rate = 3 / 60, distance_factor = 1.5 / 60 / 512, item = 'iron-plate'}
}
}
@ -32,7 +32,7 @@ local factory_b = {
callback = ob.magic_item_crafting_callback,
data = {
furance_item = {name = 'iron-plate', count = 100},
output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 512, item = 'steel-plate'}
output = {min_rate = 3 / 60, distance_factor = 1.5 / 60 / 512, item = 'steel-plate'}
}
}

View File

@ -22,7 +22,7 @@ local factory = {
callback = ob.magic_item_crafting_callback,
data = {
furance_item = 'copper-ore',
output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 512, item = 'copper-plate'}
output = {min_rate = 3 / 60, distance_factor = 1.5 / 60 / 512, item = 'copper-plate'}
}
}

View File

@ -22,7 +22,7 @@ local factory = {
callback = ob.magic_item_crafting_callback,
data = {
furance_item = 'iron-ore',
output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 512, item = 'iron-plate'}
output = {min_rate = 3 / 60, distance_factor = 1.5 / 60 / 512, item = 'iron-plate'}
}
}

View File

@ -22,7 +22,7 @@ local factory = {
callback = ob.magic_item_crafting_callback,
data = {
furance_item = 'copper-ore',
output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 512, item = 'copper-plate'}
output = {min_rate = 3 / 60, distance_factor = 1.5 / 60 / 512, item = 'copper-plate'}
}
}

View File

@ -22,7 +22,7 @@ local factory = {
callback = ob.magic_item_crafting_callback,
data = {
furance_item = 'iron-ore',
output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 512, item = 'iron-plate'}
output = {min_rate = 3 / 60, distance_factor = 1.5 / 60 / 512, item = 'iron-plate'}
}
}

View File

@ -1,10 +1,10 @@
local Global = require 'utils.global'
--local Global = require 'utils.global'
local Event = require 'utils.event'
local player_ammo_starting_modifiers = {
['artillery-shell'] = -0.75,
['biological'] = -0.5,
['bullet'] = -0.5,
['bullet'] = -0.25,
['cannon-shell'] = -0.75,
['capsule'] = -0.5,
['combat-robot-beam'] = -0.5,
@ -20,6 +20,31 @@ local player_ammo_starting_modifiers = {
['shotgun-shell'] = -0.5
}
local player_ammo_research_modifiers = {
['artillery-shell'] = -0.75,
['biological'] = -0.5,
['bullet'] = -0.5,
['cannon-shell'] = -0.75,
['capsule'] = -0.5,
['combat-robot-beam'] = -0.5,
['combat-robot-laser'] = -0.5,
['electric'] = -0.6,
['flamethrower'] = -0.75,
['grenade'] = -0.5,
['landmine'] = -0.5,
['laser-turret'] = -0.75,
['melee'] = -0.5,
['railgun'] = -0.5,
['rocket'] = -0.5,
['shotgun-shell'] = -0.5
}
local player_turrets_research_modifiers = {
['gun-turret'] = -0.65,
--['laser-turret'] = -0.75,
['flamethrower-turret'] = -0.75
}
local enemy_ammo_starting_modifiers = {
['artillery-shell'] = 0,
['biological'] = 0,
@ -58,30 +83,7 @@ local enemy_ammo_evolution_modifiers = {
--['shotgun-shell'] = 1
}
local player_ammo_research_modifiers = {
['artillery-shell'] = -0.75,
['biological'] = -0.5,
['bullet'] = -0.5,
['cannon-shell'] = -0.75,
['capsule'] = -0.5,
['combat-robot-beam'] = -0.5,
['combat-robot-laser'] = -0.5,
['electric'] = -0.6,
['flamethrower'] = -0.75,
['grenade'] = -0.5,
['landmine'] = -0.5,
['laser-turret'] = -0.75,
['melee'] = -0.5,
['railgun'] = -0.5,
['rocket'] = -0.5,
['shotgun-shell'] = -0.5
}
local player_turrets_research_modifiers = {
['gun-turret'] = -0.65,
--['laser-turret'] = -0.75,
['flamethrower-turret'] = -0.75
}
local function init_weapon_damage()
local forces = game.forces