tAPI Getting Started with Modding

Status
Not open for further replies.
How would I make a debuff that destroys all items in your inventory or that you are wearing that has a max stacking capability of one, except for a certain, predetermined item that if you do not have, the buff will give to you?

I am trying to make a cursed amulet that essentially acts as a hardmode, where all armor/weapons (except for multiple stacking weapons, like the light disc) are destroyed, except for a cursed sword that you are given, and if you do not have the sword but you have the debuff, the sword will be given to you again.
 
How would I make a debuff that destroys all items in your inventory or that you are wearing that has a max stacking capability of one, except for a certain, predetermined item that if you do not have, the buff will give to you?

I am trying to make a cursed amulet that essentially acts as a hardmode, where all armor/weapons (except for multiple stacking weapons, like the light disc) are destroyed, except for a cursed sword that you are given, and if you do not have the sword but you have the debuff, the sword will be given to you again.

You probably shouldn't make an item that destroys other ones.
 
YEah, maybe not...

I really want a downside for using this sword. Like, a long term downside.

Can I set the player's Max HP to 1 if the sword is in the inventory?
 
YEah, maybe not...

I really want a downside for using this sword. Like, a long term downside.

Can I set the player's Max HP to 1 if the sword is in the inventory?

It's very hard to code. Instead, you could have the sword be OP, and when you damage an enemy, something bad will happen to you.
 
Code:
RuggedExplorer.cs  (32,49) 
  'MundusNovum.NPCs.RuggedExplorer.SetChat()': not all code paths return a value
        public override string SetChat()
 
Code:
RuggedExplorer.cs  (32,49)
  'MundusNovum.NPCs.RuggedExplorer.SetChat()': not all code paths return a value
        public override string SetChat()
You need to make sure that your SetChat method will always return a string, no matter which if statements it goes through.
 
None of my .CS files have ANY affect on my game :*(
Everything runs fine, but no item effects activate, even yours!
I don't know what to do.
 
How do I make an item with multiple recipes?
You add a comma after the first recipe, then add your second one. Here's an example from my mod:
Code:
    "recipes":
    [{
        "items": {"Adamantite Forge": 1, "Bluemagic:PuriumOre": 60},
        "tiles": ["Mythril Anvil"],
        "creates": 1
    },
    {
        "items": {"Titanium Forge": 1, "Bluemagic:PuriumOre": 60},
        "tiles": ["Mythril Anvil"],
        "creates": 1
    }]
 
You add a comma after the first recipe, then add your second one. Here's an example from my mod:
Code:
    "recipes":
    [{
        "items": {"Adamantite Forge": 1, "Bluemagic:PuriumOre": 60},
        "tiles": ["Mythril Anvil"],
        "creates": 1
    },
    {
        "items": {"Titanium Forge": 1, "Bluemagic:PuriumOre": 60},
        "tiles": ["Mythril Anvil"],
        "creates": 1
    }]
Thank you! I was making an alloy for my mod that needed iron and since lead can replace iron I wanted to do that and I wasn't sure how :p
 
Thank you! I was making an alloy for my mod that needed iron and since lead can replace iron I wanted to do that and I wasn't sure how :p

If you want Iron and lead to be interswitchable...
Code:
    "recipes":
    [{
        "items": {"Adamantite Forge": 1, "g:Tier2Bar": 60},
        "tiles": ["Mythril Anvil"],
        "creates": 1
    }]

g:Tier2Bar basically means you can use Iron or Lead.
 
Status
Not open for further replies.
Back
Top Bottom