Skip to content

Commit

Permalink
Merge Space Race into Code Base :D
Browse files Browse the repository at this point in the history
Space Race is still very much a [WIP] and should be treated as such. Many features need to be added, but it is being merged in its current state to allow for easier internal integration. The map is in a playable state, and includes a configuration file. 

A list of future ideas and features to implement can be found at #996 and it should be notes that this is still a "high priority" project.
  • Loading branch information
theorangeangle authored Mar 2, 2020
2 parents d45009d + 6347833 commit 092f30c
Show file tree
Hide file tree
Showing 28 changed files with 3,953 additions and 18 deletions.
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ stds.factorio_control = {
"get_entity_by_tag",
"get_map_exchange_string",
"get_player",
"get_surface",
"help",
"is_demo",
"is_multiplayer",
Expand Down
2 changes: 1 addition & 1 deletion control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ if config.redmew_settings.enabled then
require 'features.gui.redmew_settings'
end

require 'features.snake.control'
--require 'features.snake.control'

-- Debug-only modules
if _DEBUG then
Expand Down
35 changes: 23 additions & 12 deletions features/player_create.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,20 @@ local function player_created(event)
gui.top.style = 'slot_table_spacing_horizontal_flow'
gui.left.style = 'slot_table_spacing_vertical_flow'

if not config.cutscene then
Public.show_start_up(player)
end

local character = player.character
if not character or not character.valid then
return
end

local player_insert = player.insert

for _, item in pairs(config.starting_items) do
player_insert(item)
end
if not config.cutscene then
Public.show_start_up(player)
end
end

Event.add(defines.events.on_player_created, player_created)
Expand Down Expand Up @@ -89,6 +95,20 @@ if _CHEATS then
player.cheat_mode = true
local cheats = config.cheats

if not memory.forces_initialized[force.name] then
force.manual_mining_speed_modifier = cheats.manual_mining_speed_modifier
force.character_inventory_slots_bonus = cheats.character_inventory_slots_bonus
force.character_running_speed_modifier = cheats.character_running_speed_modifier
force.character_health_bonus = cheats.character_health_bonus
end

memory.forces_initialized[force.name] = true

local character = player.character
if not character or not character.valid then
return
end

local player_insert = player.insert

if cheats.start_with_power_armor then
Expand All @@ -114,15 +134,6 @@ if _CHEATS then
for _, item in pairs(cheats.starting_items) do
player_insert(item)
end

if not memory.forces_initialized[force.name] then
force.manual_mining_speed_modifier = cheats.manual_mining_speed_modifier
force.character_inventory_slots_bonus = cheats.character_inventory_slots_bonus
force.character_running_speed_modifier = cheats.character_running_speed_modifier
force.character_health_bonus = cheats.character_health_bonus
end

memory.forces_initialized[force.name] = true
end

Event.add(defines.events.on_player_created, player_created_cheat_mode)
Expand Down
2 changes: 1 addition & 1 deletion features/snake/game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ local function make_board()
if x == 0 or x == size or y == 0 or y == size then
tile_name = 'deepwater'
elseif x % 2 == 1 and y % 2 == 1 then
tile_name = 'grass-1'
tile_name = 'landfill'
else
tile_name = 'water'
end
Expand Down
2 changes: 1 addition & 1 deletion features/turret_active_delay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ entity_built_callback =

if entity.health == 0 then
entity.active = true
entity.die('enemy')
entity.die('neutral')
return
end

Expand Down
Binary file added map_gen/data/.source_images/death-icon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added map_gen/data/.source_images/heath-icon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 092f30c

Please sign in to comment.