Add Technology:addEffect
This commit is contained in:
parent
b9b7b515cc
commit
22c5f9ddc7
3 changed files with 31 additions and 20 deletions
|
@ -1,10 +1,15 @@
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 0.0.3
|
Version: 0.0.4
|
||||||
Date: 02.02.2025
|
Date: 13.02.2025
|
||||||
Changes:
|
Changes:
|
||||||
- Prevent duplicate entries when adding a recipe to a technology
|
- Add Technology:addEffect
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 0.0.2
|
Version: 0.0.3
|
||||||
Date: 07.01.2025
|
Date: 02.02.2025
|
||||||
Changes:
|
Changes:
|
||||||
|
- Prevent duplicate entries when adding a recipe to a technology
|
||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 0.0.2
|
||||||
|
Date: 07.01.2025
|
||||||
|
Changes:
|
||||||
- Add Technology class
|
- Add Technology class
|
|
@ -140,6 +140,12 @@ function Technology:addRecipe(recipeName)
|
||||||
table.insert(self.prototype.effects, { type = "unlock-recipe", recipe = recipeName })
|
table.insert(self.prototype.effects, { type = "unlock-recipe", recipe = recipeName })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Adds an effect to the technology
|
||||||
|
--- @param effect table The effect to add
|
||||||
|
function Technology:addEffect(effect)
|
||||||
|
table.insert(self.prototype.effects, effect)
|
||||||
|
end
|
||||||
|
|
||||||
--- Removes a recipe unlock from the technology
|
--- Removes a recipe unlock from the technology
|
||||||
--- @param recipeName string The name of the recipe to remove
|
--- @param recipeName string The name of the recipe to remove
|
||||||
function Technology:removeRecipe(recipeName)
|
function Technology:removeRecipe(recipeName)
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "cf-lib",
|
"name": "cf-lib",
|
||||||
"version": "0.0.3",
|
"version": "0.0.4",
|
||||||
"title": "cackling fiends library",
|
"title": "cackling fiends library",
|
||||||
"description": "Because I'd like to have my own library :-)",
|
"description": "Because I'd like to have my own library :-)",
|
||||||
"author": "cackling fiend",
|
"author": "cackling fiend",
|
||||||
"homepage": "",
|
"homepage": "",
|
||||||
"factorio_version": "2.0",
|
"factorio_version": "2.0",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"base"
|
"base"
|
||||||
]
|
]
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue