From 88c96531b95cd619ef188f7fd8cf414ecb6d30ba Mon Sep 17 00:00:00 2001 From: MewMew <=> Date: Tue, 4 Dec 2018 00:52:07 +0100 Subject: [PATCH] Fish Defender Boss Waves, Score color floating text --- control.lua | 6 +++--- maps/fish_defender.lua | 21 ++++++++++++++------- maps/fish_defender_kaboomsticks.lua | 2 +- score.lua | 7 ++++++- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/control.lua b/control.lua index 960c62a0..a1071c7d 100644 --- a/control.lua +++ b/control.lua @@ -9,17 +9,17 @@ require "player_list" require "poll" require "score" ---require "maps.tools.cheat_mode" +require "maps.tools.cheat_mode" ---- enable maps here ---- -require "maps.biter_battles" +--require "maps.biter_battles" --require "maps.cave_miner" --require "maps.deep_jungle" --require "maps.lost_desert" --require "maps.labyrinth" --require "maps.spaghettorio" --require "maps.spiral_troopers" ---require "maps.fish_defender" +require "maps.fish_defender" --require "maps.crossing" --require "maps.spooky_forest" --require "maps.empty_map" diff --git a/maps/fish_defender.lua b/maps/fish_defender.lua index 99458434..439091f4 100644 --- a/maps/fish_defender.lua +++ b/maps/fish_defender.lua @@ -7,13 +7,17 @@ local map_functions = require "maps.tools.map_functions" local math_random = math.random local insert = table.insert local wave_interval = 3600 --interval between waves in ticks -local biter_count_limit = 3600 --maximum biters on the east side of the map, next wave will be delayed if the maximum has been reached +local biter_count_limit = 2400 --maximum biters on the east side of the map, next wave will be delayed if the maximum has been reached local boss_waves = { [50] = {{name = "big-biter", count = 3}}, [100] = {{name = "behemoth-biter", count = 1}}, - [200] = {{name = "behemoth-biter", count = 3}, {name = "behemoth-spitter", count = 6}}, - [300] = {{name = "behemoth-biter", count = 8}, {name = "behemoth-spitter", count = 16}}, - [400] = {{name = "behemoth-biter", count = 16}, {name = "behemoth-spitter", count = 32}} + [150] = {{name = "behemoth-spitter", count = 4}, {name = "big-spitter", count = 16}}, + [200] = {{name = "behemoth-biter", count = 4}, {name = "behemoth-spitter", count = 2}}, + [250] = {{name = "behemoth-biter", count = 8}, {name = "behemoth-spitter", count = 4}}, + [300] = {{name = "behemoth-biter", count = 12}, {name = "behemoth-spitter", count = 6}}, + [350] = {{name = "behemoth-biter", count = 16}, {name = "behemoth-spitter", count = 8}}, + [400] = {{name = "behemoth-biter", count = 20}, {name = "behemoth-spitter", count = 10}}, + [450] = {{name = "behemoth-biter", count = 24}, {name = "behemoth-spitter", count = 12}} } local function shuffle(tbl) @@ -249,6 +253,7 @@ local function spawn_boss_units(surface) if not boss_waves[global.wave_count] then return end if global.wave_count == 50 then game.print("The Big Biter Gang", {r = 0.7, g = 0.1, b = 0.1}) end if global.wave_count == 100 then game.print("Biterzilla", {r = 0.7, g = 0.1, b = 0.1}) end + if global.wave_count == 150 then game.print("The Spitter Squad", {r = 0.7, g = 0.1, b = 0.1}) end local position = {x = 216, y = 0} local biter_group = surface.create_unit_group({position = position}) for _, entry in pairs(boss_waves[global.wave_count]) do @@ -349,7 +354,7 @@ local function biter_attack_wave() global.wave_count = global.wave_count + 1 end - if global.wave_count % 100 == 0 or global.wave_count == 50 then + if global.wave_count % 50 == 0 then game.print("Boss Wave " .. global.wave_count, {r = 0.7, g = 0.1, b = 0.1}) global.attack_wave_threat = global.wave_count * 10 spawn_boss_units(surface) @@ -872,14 +877,16 @@ local function on_player_joined_game(event) game.forces["player"].technologies["gun-turret-damage-5"].enabled = false game.forces["player"].technologies["gun-turret-damage-6"].enabled = false game.forces["player"].technologies["gun-turret-damage-7"].enabled = false + game.forces["player"].technologies["laser-turret-speed-6"].enabled = false + game.forces["player"].technologies["laser-turret-speed-7"].enabled = false game.forces.player.set_ammo_damage_modifier("shotgun-shell", 0.5) global.entity_limits = { ["gun-turret"] = {placed = 1, limit = 1, str = "gun turret", slot_price = 100}, - ["laser-turret"] = {placed = 0, limit = 1, str = "laser turret", slot_price = 250}, + ["laser-turret"] = {placed = 0, limit = 1, str = "laser turret", slot_price = 300}, ["artillery-turret"] = {placed = 0, limit = 1, str = "artillery turret", slot_price = 500}, - ["flamethrower-turret"] = {placed = 0, limit = 0, str = "flamethrower turret", slot_price = 50000}, + ["flamethrower-turret"] = {placed = 0, limit = 0, str = "flamethrower turret", slot_price = 35000}, ["land-mine"] = {placed = 0, limit = 1, str = "mine", slot_price = 1} } diff --git a/maps/fish_defender_kaboomsticks.lua b/maps/fish_defender_kaboomsticks.lua index a9eb2f03..0ceeba6b 100644 --- a/maps/fish_defender_kaboomsticks.lua +++ b/maps/fish_defender_kaboomsticks.lua @@ -5,7 +5,7 @@ local event = require 'utils.event' local damage_per_explosive = 100 local empty_tile_damage_decay = 100 -local out_of_map_tile_health = 1500 +local out_of_map_tile_health = 150000 local circle_coordinates = { [1] = {{x = 0, y = 0}}, diff --git a/score.lua b/score.lua index 6ace0851..5658cba9 100644 --- a/score.lua +++ b/score.lua @@ -377,6 +377,7 @@ local function on_entity_died(event) if score_table[event.entity.name] then local show_floating_text = false + local color = {r=0.98, g=0.66, b=0.22} --Award all players near a worm score if #proximity_list > 0 then @@ -399,6 +400,10 @@ local function on_entity_died(event) else global.score[event.force.name].players[player.name].killscore = global.score[event.force.name].players[player.name].killscore + score_table[event.entity.name] end + color = player.color + color.r = color.r * 0.6 + 0.4 + color.g = color.g * 0.6 + 0.4 + color.b = color.b * 0.6 + 0.4 end end @@ -422,7 +427,7 @@ local function on_entity_died(event) end if show_floating_text == true then - event.entity.surface.create_entity({name = "flying-text", position = event.entity.position, text = tostring(score_table[event.entity.name]), color = {r=0.98, g=0.66, b=0.22}}) + event.entity.surface.create_entity({name = "flying-text", position = event.entity.position, text = tostring(score_table[event.entity.name]), color = color}) end end end