Okay, I managed to get some progress. I found a solution to make the bomb able to get hit without changing its state. Basically, the player spawns an invisible helper with the same hitbox as the bomb and as soon as this helper gets created it spawns its own helper, which is the bomb's visual animation. I used the BindToParent sctrl to attach the visual helper to the invisible one. The invisible one now can enter a different state when hit without changing the visual helper's state, dragging the visible helper along with it. The visual helper when it reaches the end of its animation it will explode, the explosion being a state with a HitDef. It works fine so far, but I don't know how to make the bomb increase the received hit's velocities a little bit to make it feel lighter. Here's the code for the get hit state I made:
Code:
[Statedef 1151]
type = A
physics = N
movetype = H
anim = 1150
ctrl = 0
[State 1151, VelAdd]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)
[State 1151, HitVelSet]
type = HitVelSet
trigger1 = !Time
x = 1
y = 1
[State 1151, End]
type = selfstate
trigger1 = vel y > 0 && pos y >= -10
value = 1152
[State 1151, DestroySelf]
type = DestroySelf
trigger1 = NumHelper(1050) < 1
If I made some mistakes here, let me know.
Bookmarks