Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Items as Keys and Currencies #211

Open
Drakensin opened this issue Mar 4, 2021 · 9 comments
Open

Items as Keys and Currencies #211

Drakensin opened this issue Mar 4, 2021 · 9 comments
Labels
proposal A proposed feature that needs further consideration

Comments

@Drakensin
Copy link

Drakensin commented Mar 4, 2021

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)
@joshuaskelly joshuaskelly added feature New feature or request proposal A proposed feature that needs further consideration and removed feature New feature or request labels Mar 5, 2021
@PythooonUser
Copy link
Contributor

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

@Drakensin
Copy link
Author

Drakensin commented Mar 10, 2021

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.

@PythooonUser
Copy link
Contributor

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
Copy link
Contributor

@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.

@Drakensin
Copy link
Author

@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.

@PythooonUser
Copy link
Contributor

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
Copy link
Contributor

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

@HeadClot
Copy link
Contributor

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. :)

@PythooonUser
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal A proposed feature that needs further consideration
Projects
None yet
Development

No branches or pull requests

4 participants