delverengine icon indicating copy to clipboard operation
delverengine copied to clipboard

Items as Keys and Currencies

Open Drakensin opened this issue 3 years ago • 9 comments

Just wanna leave the idea here. Would be interesting to have a way to have items be used as both a Key and Currency. The use cases for this would be like for example:

A simple use would be:

  • Finding a key to a door, using the key and having the key stay in your inventory

A unique use would be:

  • Potion Maker: Needing 3 items to make a potion (Goblin eye, Blood from a Bandit and a Skull)

Drakensin avatar Mar 04 '21 17:03 Drakensin

Okay, I think this would be heavily driven by some JSON representation when modding. So how would that look like?

PythooonUser avatar Mar 05 '21 20:03 PythooonUser

Okay, I think this would be heavily driven by some JSON representation when modding. So how would that look like?

I am having issues trying to simplify what you said. cant give much info.

Drakensin avatar Mar 10 '21 13:03 Drakensin

Hey, I just want to know how a modder would use this feature?

So I had a look at the current shop implementation (taken from the delver community mods repository).

You define a shop with some items:

{
  "class": "com.interrupt.dungeoneer.entities.triggers.TriggeredShop",
  "items": [
    {
      "class": "com.interrupt.helpers.ShopItem",
      "item": {
        "class": "com.interrupt.dungeoneer.entities.items.Food"
      },
      "cost": "50"
    }
  ]
}

And the important bit is that we define a property cost that represents the required amount of gold.

I guess the work needed to be done here is to change this part, i.e. to allow the modder to define something else as cost other than just gold.

{
    "cost": {
        "gold": 100,
        "items": [
            {
                "item": "class name or other identifier",
                "amount": 2
            }
        ]
    }
}

I think there are two main issues:

  • Keeping backward compatibility
  • Identifying the item used as the cost

Additionally, we would need to ask the player for stuff in his inventory.

PythooonUser avatar Mar 10 '21 19:03 PythooonUser

@joshuaskelly is suggesting something like the following:

{
    "requires": {
        "type": "ANY",
        "requirements": [
            {
                "class":"fqn.GoldRequirement",
                "type": "GREATER_THAN",
                "amount": 1000
            },
            {
                "class":"fqn.TagRequirement",
                "type": "GREATER_THAN_EQUAL",
                "tag": "event ticket",
                "count": 1
            }
        ]
    }
}

Where we can chain requirements etc.

PythooonUser avatar Mar 10 '21 19:03 PythooonUser

@PythooonUser if I was to make something out of it, having things combined like 3 ingredients for a potion for example, this can also be a easy way for people to make a crafting system. Allowing modders to make unique things that can only be crafted. this would show much of a challenge with a reward at the end.

Drakensin avatar Mar 10 '21 20:03 Drakensin

Another thing, how would the shop overlay look like? How would one communicate the necessary item? Using a sprite? Showing the name on hover? Doors also would need to have an overlay?

PythooonUser avatar Mar 14 '21 10:03 PythooonUser

Pushed out the first prototype at feature/211-Door-With-Requirement, when people want to try it out.

PythooonUser avatar Mar 14 '21 12:03 PythooonUser

Pushed out the first prototype at feature/211-Door-With-Requirement, when people want to try it out.

Hey @PythooonUser - Got a question. Is this feature up to date with the master branch? Asking because I am looking at using it for a project. :)

HeadClot avatar Apr 18 '21 20:04 HeadClot

Hey @HeadClot, I haven't touched this branch in a while. But I don't think there are merge conflicts with master.

Please go ahead and copy what you like :)

On Discord we discussed these changes and for now we think that this specific usecase can be handled with the existing mod content.

PythooonUser avatar Apr 18 '21 20:04 PythooonUser