How do i apply a debuff on hit?


#1

this really should be simple but im missing the clue. i tried finding the poisoned undead weapons but couldnt find them, tried checking out the fire arrows but those or complicated and either im missing something or never say something like “chace to trigger on hit” or simmilar…

how on earths name does this work/where do i check? the (de)bufs themselves make sense. i just dont know how to bestow them on people XD


#2

It’s located in the Mixins of the Undead.json for inflictable debuffs.

stonehearth>mixins>undead>undead.json

Text of just the debuff in the Undead.Json.
  "stonehearth:buffs": {
     "inflictable_debuffs": {
        "infection": {
           "uri": "stonehearth:buffs:undead_infection",
           "chance": 0.5
        }
     }
  }
Whole Undead.json file

{
“type”: “mixin”,
“mixins”: “stonehearth:mixins:monster”,
“entity_data”: {
“stonehearth:combat”: {
“no_shuffle”: true
},
“stonehearth:buffs”: {
“inflictable_debuffs”: {
“infection”: {
“uri”: “stonehearth:buffs:undead_infection”,
“chance”: 0.5
}
}
}
}
}


#3

you absolute hero! thanks!


#4

No problem man! I have spent hundreds of hours in the Stonehearth game folder, let alone the Json files trying to put together things. If you need anything just hit me up!


#5

connsider yourself taken up on that offer :smiley: now just to think of what to ask you… lol.


#6

@pigeonman or anyone who knows:
how would i translate this to an item-based-apply-on-hit though?

im looking at the worker outfits and they have:

 "stonehearth:equipment_piece": {
         "slot": "torso",
         "render_type": "merge_with_model",
         "roles": "worker_job",
         "ilevel": 2,
         "injected_buffs": [
            "stonehearth:buffs:devoted",
            "stonehearth:buffs:weather:cold_resist"
         ],
         "equip_effect": "stonehearth:effects:weapon_level_up"
      }

where the injected_buffs is ofc the interesting bit. but my brain doesnt see a way to put

"stonehearth:buffs": {
         "inflictable_debuffs": {
            "infection": {
               "uri": "stonehearth:buffs:undead_infection",
               "chance": 0.5
            }
         }

or simmilar in there.
@Relyss maybe? you were on a roll last night :stuck_out_tongue:

or is inflicatble_debuffs something i can put straight on the item itsself under components?

my current thoughts would be make a buff, that gives inflicatble _debuffs to the hearthling but im not sure if im on the right track with that


#7

Have you seen my crusader mod? (it is outdated and probably not working, but the code for this stuff should still be valid).

I made an ability for the crusader which would inflict a debuff (not visible in the unit frame, but had a vfx) only to the undead.

You just have to put in inside the entity_data of the equipment piece, like in the original file where you found that code (it could be in the default weapon json file, or it could be in a skill file like in this example):

crusader_holy_punch_manual.json:

{
   "type": "entity",
   "components": {
      "stonehearth:equipment_piece": {}
   },
   "entity_data": {
      "stonehearth:combat:melee_attacks": [
         {
            "name": "holy_punch",
            "effect": "holy_punch",
            "active_frame": 20,
            "cooldown": 2000,
            "priority": 1,
            "bonus_dmg_multiplier": 1.0
         }
      ],	
      "stonehearth:buffs": {
         "inflictable_debuffs": {
            "infection": {
               "uri": "crusader:buffs:crusader:holy_light",
               "chance": 0.5
            }
         }
      }
   }
}

For the undeads the inflictable debuff seems to be in a mixin on their base file, so it would inflict the debuff no matter the weapon they’re using, but I assume you want to restrict it to a certain job or something.


#8

was exactly what i was looking for, and hoping, really, but i did not suspect it to be this simple :stuck_out_tongue:

i found it in the mix-ins for the undead, thats why it confuse me because it gave it to the “wielder” not the “weapon”. but seems the weapon works fine,

also yeah ive seen that one some time ago! i always liked the idea behind, it, maybe not so much the bright-white aesthetic though so i never tried it.
-mind if i scavenge that punch animation? or does that no longer work?-


#9

I want to redo the punch animation, honestly. I’m not good at animating.

I made this mod based on Goldmetal’s design so I wanted it to be as close as possible to her design, and always asked for permission.

Ah, it’s probably broken anyway (pre-toes and attrovercog bones), I don’t think I remade it yet.


#10

look kindly at @No_Name, he’s the resident animation wizard/sorcerer.
i think i already asked him for a punch as is anyway :stuck_out_tongue: (more fightign stuff in general i can mix in among the default anims to make fighting a bit more lively)

if only i had more time for modding, would have wanted to be able to animate myself…


#11

also @Relyss is the “infection” part of that code fixed/important, or is it more like in the cubemitter stuff more a name for humans to read?


#12

Yeah, it should be just an identifier. You can change it if you want.


#13

project thunder hammer succes, i can report that a lighting strike on hit is the coolest shit ever. :stuck_out_tongue: