MeatwareMonster / MoreDefenses

MIT License
2 stars 4 forks source link

fix: Allow the same prefab for many turret configs #2

Open Pyetrek opened 2 years ago

Pyetrek commented 2 years ago

Fix bug that did not allow you to use the same prefab for multiple different turret configs. Now you can specify turrets with different resource costs and damage values, but utilize the already provided prefabs many times.

An example of using the same prefab is shown below

[
  {
    "name": "Ballista",
    "bundleName": "turrets",
    "prefabPath": "Assets/_Project/Prefabs/MMBallista.prefab",
    "description": "Shoots a projectile dealing damage. Able to hit flying monsters",
    "pieceTable": "Hammer",
    "enabled": true,
    "type": "Projectile",
    "fireInterval": 2,
    "pierceDamage": 16,
    "range": 20,
    "canShootFlying": true,
    "resources": [
      {
        "item": "Bronze",
        "amount": 10
      },
      {
        "item": "RoundLog",
        "amount": 20
      }
    ]
  },
  {
    "name": "Improved Ballista",
    "bundleName": "turrets",
    "prefabPath": "Assets/_Project/Prefabs/MMBallista.prefab",
    "description": "Shoots a projectile dealing damage. Able to hit flying monsters",
    "pieceTable": "Hammer",
    "enabled": true,
    "type": "Projectile",
    "fireInterval": 2,
    "pierceDamage": 30,
    "range": 20,
    "canShootFlying": true,
    "resources": [
      {
        "item": "Iron",
        "amount": 20
      },
      {
        "item": "FineWood",
        "amount": 20
      }
    ]
  }
]