1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-03-03 14:53:01 +02:00

Merge pull request #914 from theorangeangle/vanilla_sprinkles

Added Rocky Road as a map, fixed car body feature.
This commit is contained in:
theorangeangle 2019-05-21 21:07:21 -05:00 committed by GitHub
commit b85d1bca35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 6 deletions

View File

@ -0,0 +1,24 @@
local b = require 'map_gen.shared.builders'
require 'map_gen.shared.car_body'
local RS = require 'map_gen.shared.redmew_surface'
local MGSP = require 'resources.map_gen_settings'
local ScenarioInfo = require 'features.gui.info'
local loot = require 'map_gen.shared.loot_items'
ScenarioInfo.set_map_name('Rocky Road')
ScenarioInfo.set_map_description(
'We want a vanilla map, they said.\nYou might get the vanilla terrain,\nBut not the vanilla character! Enjoy driving yourself crazy with this one :D'
)
ScenarioInfo.add_map_extra_info('Players stuck in cars, day/night cycle modified to make solar a pain.')
RS.set_map_gen_settings(
{
MGSP.cliff_high
}
)
local map = b.full_shape
map = b.apply_entity(map, loot)
return map

View File

@ -1,10 +1,11 @@
local Event = require 'utils.event'
require 'map_gen.shared.redmew_surface'
local drivers_group = 'Drivers'
local random = math.random
local function transfer_body(player)
-- Remove the player from their character and place them in a car.
--Place player in a car.
local surface = player.surface
local force = player.force
local pos = force.get_spawn_position(surface)
@ -12,11 +13,6 @@ local function transfer_body(player)
-- Choose a random direction for the car to face
local dir = random(0, 7)
-- Remove the players' character
if player.character then
player.character.destroy()
end
--Find a place for a car, place a car, and place fuel+ammo in it
local car_pos = surface.find_non_colliding_position('car', pos, 0, 3)
local car = surface.create_entity {name = 'car', position = car_pos, direction = dir, force = force}