PC How to add a debuff on equip

Thingerthing

Terrarian
Here's the idea I'm trying to do. I'm trying to make a weapon that's strong, but removes some health.

So I tried this first

Code:
        public override void UpdateEquip(Player player)
        {
            player.statLifeMax2 -= 75;
        }

Didn't work. Then I searched. Alot. I couldn't find anything like this as every search result I found wasn't related to this problem at all. So I'm asking you people.

How do I make the item I'm trying to make?
 
Do you want your weapon to drain health from the player or just want it to reduce max hp? Or just apply debuff?
First case :
C#:
int lifeCounter;

public override HoldItem(Player player){
    lifeCounter++;
    while(lifeCounter > 10){
        lifecounter -= 10;
        player.statLife--;
    }
}
This will deal 6 damage per second to the player. You can also
Second case :
Code:
public override HoldItem(Player player){
    player.statLifeMax2 -= 50;
}
This will temporarily reduce holder's max hp by 50.
Or you can just :
Code:
public override HoldItem(Player player){
    player.addBuff(BuffID.Venom, 2);
}
This will constatntly inflict venom debuff while the player is holding your item.
 
Back
Top Bottom