Advertisement
AnonKot

BetterDamageForIsaac

Mar 28th, 2024
530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | Gaming | 0 0
  1. --by kitiketov
  2.  
  3. local mod = RegisterMod("BetterDamage",1)
  4.  
  5.  
  6. function mod:WriteDamage(type,damageAmount)
  7.     local file = io.open("gameinfo.txt", "w")
  8.     if file then
  9.         file:write(type.."/".. damageAmount .. "/"..os.time(os.date("*t")).."\n")
  10.         file:close()
  11.     end
  12. end
  13.  
  14. function mod:TakingDamage(entity, damageAmount, damageFlags, damageSource, damageCountdownFrames)
  15.     local player = Isaac.GetPlayer(0)
  16.     if player:IsDead() then
  17.         return
  18.     end
  19.    
  20.     -- Isaac.ConsoleOutput("DmG"..damageAmount.."\n")
  21.     mod:WriteDamage("shock",damageAmount)
  22.    
  23. end
  24.  
  25. function mod:UsingHolyEffect(id,volume,frameDelay,loop,pitch,pan)
  26.     -- Isaac.ConsoleOutput("Holy\n")
  27.     mod:WriteDamage("vibro",1)
  28.    
  29. end
  30.    
  31. mod:AddCallback(ModCallbacks.MC_PRE_SFX_PLAY, mod.UsingHolyEffect, SoundEffect.SOUND_HOLY_MANTLE)
  32. mod:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, mod.TakingDamage, EntityType.ENTITY_PLAYER)
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement