Boost mode damage without SF_MACHINE? [Solved!]

Aidenmash

Swaggalicious!
Yo, Is there a way I can make my mod character damage enemies within boost mode, but without using SF_MACHINE? I'm not a fan of the alternate properties that SF_MACHINE gives you (Explosions on death, particles, etc), but i still want my boost mode to damage enemies.
 
this should work
Lua:
-- Code for activating boost mode
if self.boostModeActive then
  -- Code for boost mode effects/actions

  -- Damage enemies within boost mode
  for _, enemy in ipairs(enemies) do
    enemy:TakeDamage(damageAmount)
  end
end
Remember to adjust the code to fit your mod characters specific implementation and variables
 
As Metal's Dashmode also breaks spikes, here's a lua for that.
Code:
//Normal stuff
addHook("MobjCollide", function(mobj, playermobj)
    if playermobj.skin == "player" and playermobj.player.dashmode >= 3*TICRATE and mobj.flags & MF_ENEMY then
        P_KillMobj(mobj, playermobj, playermobj)
    end
end)

addHook("MobjCollide", function(mobj, playermobj)
    if playermobj.skin == "player" and playermobj.player.dashmode >= 3*TICRATE and mobj.flags & MF_MONITOR then
        P_KillMobj(mobj, playermobj, playermobj)
    end
end)

//Spikes
addHook("MobjCollide", function(mobj, playermobj)
    if playermobj.skin == "player" and playermobj.player.dashmode >= 3*TICRATE  then
        P_KillMobj(mobj, playermobj, playermobj)
    end
end, MT_SPIKE)

addHook("MobjCollide", function(mobj, playermobj)
    if playermobj.skin == "bluestreak" and playermobj.player.dashmode >= 3*TICRATE  then
        P_KillMobj(mobj, playermobj, playermobj)
    end
end, MT_WALLSPIKE)
 
this should work
Lua:
-- Code for activating boost mode
if self.boostModeActive then
  -- Code for boost mode effects/actions

  -- Damage enemies within boost mode
  for _, enemy in ipairs(enemies) do
    enemy:TakeDamage(damageAmount)
  end
end
Remember to adjust the code to fit your mod characters specific implementation and variables

ChatGPT does not understand the BLUA API and 99% of the time will not output usable code - this will not work. If you know how to fix its output, do so before suggesting it as help to other people; if you do not, then don't use it for yourself or for others. It is not a substitute to learning Lua.
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top