Jump to content

Electric attack and monster


Recommended Posts

I would like to make a monster attack having the same effect than the Morning Star (more damage on wet target). I tried to look at volt goat code, but they seems to use a shock attack rather than multiply damage when the target is wet. Any advice ?

Link to comment
Share on other sites

In SGlightninggoat.lua, you see this code:

if inst.charged then
	inst.components.combat:DoAttack(inst.sg.statemem.target, nil, nil, "electric")
else
	inst.components.combat:DoAttack(inst.sg.statemem.target)
end

The "electric" part determines the stimuli of the attack. If it is electric, then there will be a certain amount of bonus damage if the target is wet.

Link to comment
Share on other sites

Also the shock damage that you see defined in lightninggoat.lua is the damage that you receive when you attack a charged lightninggoat, which is why it is called in OnAttacked. The DoAttack call in SGlightninggoat.lua on the other hand is when the lightninggoat itself attacks.

Edited by Joachim
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...