Skip to content

Commit

Permalink
Merge pull request #7 from abaines/Combat-Robot-Artillery-Projectile
Browse files Browse the repository at this point in the history
Combat robot artillery projectile
  • Loading branch information
abaines committed Sep 27, 2020
2 parents a52affb + 8a5e8ec commit 0afc361
Show file tree
Hide file tree
Showing 18 changed files with 186 additions and 5 deletions.
6 changes: 6 additions & 0 deletions changelog.txt
@@ -1,4 +1,10 @@
---------------------------------------------------------------------------------------------------
Version: 0.5.19
Date: 2020-09-27
Changes:
- [WIP] Defender Artillery Ammo
- Graphics! 🎨
---------------------------------------------------------------------------------------------------
Version: 0.5.18
Date: 2020-09-14
Changes:
Expand Down
2 changes: 2 additions & 0 deletions data.lua
Expand Up @@ -2,6 +2,8 @@

-- data.lua

require("prototypes.combat-robot-misc")
require("prototypes.combat-robot-weapon")
require("prototypes.derpy-artillery-ammo")
require("prototypes.derpy-artillery-gun")
require("prototypes.derpy-cluster-artillery-misc")
Expand Down
Binary file added graphics/defender-ammo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icons/artillery-shell.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icons/artillery-turret.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icons/cluster-grenade.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icons/defender.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icons/poison-capsule.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/light-artillery.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion info.json
@@ -1,6 +1,6 @@
{
"name": "lightArtillery",
"version": "0.5.18",
"version": "0.5.19",
"title": "Light Artillery",
"author": "Kizrak",
"contact": "",
Expand Down
3 changes: 3 additions & 0 deletions locale/en/locale.cfg
@@ -1,6 +1,7 @@
[entity-name]
derpy-artillery=Light Artillery
poison-cloud-artillery-projectile-2=Orange Poison Cloud
la-defender=[WIP] Defender++

[entity-description]
derpy-artillery=Extra long range weapon targetting enemy structures.
Expand All @@ -11,6 +12,7 @@ derpy-artillery-gun=Light Artillery Gun
derpy-artillery-ammo=Light Artillery Ammo
derpy-cluster-artillery-ammo=BLU-3 PineAPple Shell
poison-capsule-artillery-ammo=Orange Poison Artillery Ammo
la-combat-robot-artillery-shell=[WIP] Defender Artillery Ammo

[item-description]
derpy-artillery=Extra long range weapon targetting enemy structures.
Expand All @@ -31,6 +33,7 @@ poison-capsule-artillery-recipe=!!!!!!!!!!!!!!!!!!!! recipe-name !!!!!!!!!!!!!!!
derpy-artillery=Light Artillery
derpy-cluster-artillery-research=AB Cluster Artillery
poison-capsule-artillery-research=Orange Poison Artillery
la-combat-robot-artillery-shell-research=[WIP] Defender Artillery

[technology-description]
derpy-artillery=Give access to super long range Light Artillery.
Expand Down
73 changes: 73 additions & 0 deletions prototypes/combat-robot-misc.lua
@@ -0,0 +1,73 @@
-- Kizrak

-- prototypes\combat-robot-misc.lua

local sb = serpent.block -- luacheck: ignore 211

---------------------------------------------------------------------------------------------------

-- item/shell/ammo
-- research
-- recipe

-- item the player carries
local ammo = table.deepcopy(data.raw["ammo"]["artillery-shell"])

ammo.name = "la-combat-robot-artillery-shell"
ammo.ammo_type.action.action_delivery.projectile="la-combat-robot-projectile-1"
ammo.stack_size = 10
ammo.icon = "__lightArtillery__/graphics/icons/defender.png"
ammo.icon_mipmaps = 1

data:extend{ammo}
log("ammo:\n"..sb(ammo))

---------------------------------------------------------------------------------------------------

local recipe = {
enabled = false,
energy_required = 20,
ingredients = {
{"derpy-artillery-ammo",1},
{"defender-capsule",1},
{"repair-pack",1},
{type="fluid", name="water", amount=5},
},
category = "advanced-crafting",
name = "la-combat-robot-artillery-shell-recipe",
result = "la-combat-robot-artillery-shell",
type = "recipe"
}

data:extend{recipe}
log("recipe:\n"..sb(recipe))

---------------------------------------------------------------------------------------------------

local technology = {
effects = {{
recipe = "la-combat-robot-artillery-shell-recipe",
type = "unlock-recipe"
}},
icon = "__lightArtillery__/graphics/defender-ammo.png",
icon_size = 128,
name = "la-combat-robot-artillery-shell-research",
prerequisites = {
"combat-robotics",
"derpy-artillery"
},
type = "technology",
unit = {
count = 5,
ingredients = {
{"automation-science-pack",1},
{"logistic-science-pack",1},
{"military-science-pack",1},
},
time = 5
}
}

data:extend{technology}
log("technology:\n"..sb(technology))

91 changes: 91 additions & 0 deletions prototypes/combat-robot-weapon.lua
@@ -0,0 +1,91 @@
-- Kizrak

-- prototypes\combat-robot-weapon.lua

local sb = serpent.block -- luacheck: ignore 211

---------------------------------------------------------------------------------------------------

-- projectile/artillery-projectile
-- damage/robot
-- actions & triggers

-- thing that flies through air and does damage
local artillery_projectile = table.deepcopy(data.raw["artillery-projectile"]["artillery-projectile"])

artillery_projectile.name = "la-combat-robot-projectile-1"

artillery_projectile.action.action_delivery.target_effects = {
{
action = {
action_delivery = {
target_effects = {
{
damage = {
amount = 4,
type = "electric"
},
type = "damage"
},
},
type = "instant"
},
radius = 8,
type = "area"
},
type = "nested-result"
},
{
initial_height = 0,
max_radius = 3.5,
offset_deviation = { { -4, -4 }, { 4, 4 } },
repeat_count = 240,
smoke_name = "artillery-smoke",
speed_from_center = 0.05,
speed_from_center_deviation = 0.005,
type = "create-trivial-smoke"
},
{
entity_name = "big-artillery-explosion",
type = "create-entity"
},
{
type = "create-entity",
show_in_tooltip = true,
entity_name = "la-defender",
offset_deviation = {{-4, -4}, {4, 4}},
},
}

data:extend{artillery_projectile}
--log("artillery_projectile.action:\n"..sb(artillery_projectile.action))

---------------------------------------------------------------------------------------------------

local defender = table.deepcopy(data.raw["combat-robot"]["defender"])

defender.name = "la-defender"
defender.follows_player = false
defender.range_from_player = nil
defender.speed = 0
defender.friction = 1

data:extend{defender}

local defenderL = table.deepcopy(defender)

defenderL.destroy_action.action_delivery.source_effects = nil
defenderL.attack_parameters.sound = nil

defenderL.damaged_trigger_effect = nil
defenderL.dying_trigger_effect = nil
defenderL.collision_box = nil

defenderL.idle = nil
defenderL.in_motion = nil
defenderL.shadow_idle = nil
defenderL.shadow_in_motion = nil
defenderL.water_reflection = nil

log("defender:\n"..sb(defenderL))

2 changes: 2 additions & 0 deletions prototypes/derpy-artillery-ammo.lua
Expand Up @@ -10,6 +10,8 @@ local derpyArtilleryAmmo = table.deepcopy(data.raw["ammo"]["artillery-shell"])
derpyArtilleryAmmo.name = "derpy-artillery-ammo"
derpyArtilleryAmmo.ammo_type.action.action_delivery.projectile="derpy-artillery-projectile"
derpyArtilleryAmmo.stack_size = 20
derpyArtilleryAmmo.icon = "__lightArtillery__/graphics/icons/artillery-shell.png"
derpyArtilleryAmmo.icon_mipmaps = 1

data:extend{derpyArtilleryAmmo}

Expand Down
2 changes: 2 additions & 0 deletions prototypes/derpy-artillery-gun.lua
Expand Up @@ -41,6 +41,8 @@ local derpyArtilleryItem = table.deepcopy(data.raw["item"]["artillery-turret"])
derpyArtilleryItem.name = "derpy-artillery"
derpyArtilleryItem.place_result = "derpy-artillery"
derpyArtilleryItem.stack_size = 1
derpyArtilleryItem.icon = "__lightArtillery__/graphics/icons/artillery-turret.png"
derpyArtilleryItem.icon_mipmaps = 1

data:extend{derpyArtilleryItem}

Expand Down
2 changes: 2 additions & 0 deletions prototypes/derpy-cluster-artillery-misc.lua
Expand Up @@ -53,6 +53,8 @@ local derpyArtilleryAmmo = table.deepcopy(data.raw["ammo"]["artillery-shell"])
derpyArtilleryAmmo.name = "derpy-cluster-artillery-ammo"
derpyArtilleryAmmo.ammo_type.action.action_delivery.projectile="derpy-cluster-artillery-projectile-1"
derpyArtilleryAmmo.stack_size = 20
derpyArtilleryAmmo.icon = "__lightArtillery__/graphics/icons/cluster-grenade.png"
derpyArtilleryAmmo.icon_mipmaps = 1

data:extend{derpyArtilleryAmmo}

Expand Down
6 changes: 3 additions & 3 deletions prototypes/poison-artillery-misc.lua
Expand Up @@ -16,7 +16,7 @@ local technology = {
name = "poison-capsule-artillery-research",
prerequisites = {
"military-3",
"derpy-artillery"
"la-combat-robot-artillery-shell-research"
},
type = "technology",
unit = {
Expand Down Expand Up @@ -74,8 +74,8 @@ local ammo = {
category = "artillery-shell",
target_type = "position"
},
icon = "__base__/graphics/icons/artillery-shell.png",
icon_mipmaps = 4,
icon = "__lightArtillery__/graphics/icons/poison-capsule.png",
icon_mipmaps = 1,
icon_size = 64,
name = "poison-capsule-artillery-ammo",
order = "d[explosive-cannon-shell]-d[artillery]",
Expand Down
2 changes: 1 addition & 1 deletion prototypes/technology.lua
Expand Up @@ -7,7 +7,7 @@
-- add a new research that unlocks two recicpes
local lightArtilleryResearch = table.deepcopy(data.raw.technology["military-2"])
lightArtilleryResearch.name = "derpy-artillery"
lightArtilleryResearch.icon = "__base__/graphics/technology/artillery.png"
lightArtilleryResearch.icon = "__lightArtillery__/graphics/light-artillery.png"
lightArtilleryResearch.unit.count = 5
lightArtilleryResearch.unit.time = 5

Expand Down

0 comments on commit 0afc361

Please sign in to comment.