Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local PriestMod = RegisterMod("Priest", 1)
- local firemage = Isaac.GetItemIdByName("Firemage")
- local player = Isaac.GetPlayer(0)
- local altershotspeed = 0
- local frames_passed = 0
- local frames_passed2 = 0
- local geschossen = false
- local countdownbasezeit = 1.5
- local grundscale = nil
- local firedelay = player.FireDelay
- local aufladezeit = 1
- function PriestMod:rechner()
- aufladezeit = math.ceil((player.FireDelay*(-1)) * 55 * (countdownbasezeit-0.2))
- countdownzeit = math.ceil((firedelay*(-1)) * countdownbasezeit * 55)
- end
- PriestMod:AddCallback(ModCallbacks.MC_POST_UPDATE, PriestMod.rechner)
- function PriestMod:Spielstart()
- local start = Game():GetFrameCount()
- if start == 1 then
- geschossen = false
- gedruekt = false
- frames_passed = 0
- frames_passed2 = 0
- end
- end
- PriestMod:AddCallback(ModCallbacks.MC_POST_UPDATE, PriestMod.Spielstart)
- function PriestMod:pfeiltastendruck(player, hook, but)
- player = Isaac.GetPlayer(0)
- if geschossen == true and (but == ButtonAction.ACTION_SHOOTUP or but == ButtonAction.ACTION_SHOOTLEFT or but == ButtonAction.ACTION_SHOOTRIGHT or but == ButtonAction.ACTION_SHOOTDOWN) then
- return false
- end
- end
- PriestMod:AddCallback(ModCallbacks.MC_INPUT_ACTION, PriestMod.pfeiltastendruck, InputHook.IS_ACTION_PRESSED)
- function PriestMod:Itemaufheben()
- grundscale = tear.Scale
- altershotspeed = player.ShotSpeed
- player.ShotSpeed = 0
- end
- PriestMod:AddCallback(ModCallbacks.MC_EVALUATE_CACHE, PriestMod.Itemaufheben)
- function PriestMod:Traene()
- player = Isaac.GetPlayer(0)
- entities = Isaac.GetRoomEntities()
- if player:HasCollectible(firemage) and geschossen == false then
- for i = 1, #entities do
- teartest = entities[i]:ToTear()
- if teartest ~= nil then
- if teartest.Parent.Type == EntityType.ENTITY_PLAYER then
- teartest.FallingSpeed = 0
- teartest.FallingAcceleration = -0.1
- geschossen = true
- return teartest
- end
- end
- end
- end
- end
- PriestMod:AddCallback(ModCallbacks.MC_POST_UPDATE, PriestMod.Traene)
- function PriestMod:Traeneposition()
- player = Isaac.GetPlayer(0)
- if player:HasCollectible(firemage) and geschossen == true then
- tear = PriestMod.Traene()
- aimdir = player:GetAimDirection()
- tear.Position = Vector(player.Position.X, player.Position.Y) + aimdir*30
- end
- end
- PriestMod:AddCallback(ModCallbacks.MC_POST_UPDATE, PriestMod.Traeneposition)
- function PriestMod:aufladen()
- player = Isaac.GetPlayer(0)
- if player:HasCollectible(firemage) and geschossen == true then
- frames_passed2 = frames_passed2 + 1
- if frames_passed2 == math.ceil(aufladezeit/5) then
- tear.Scale = grundscale/3
- Isaac.DebugString("Scalestufe: 1")
- end
- if frames_passed2 == math.ceil((aufladezeit*2)/5) then
- tear.Scale = grundscale/2
- Isaac.DebugString("Scalestufe: 2")
- end
- if frames_passed2 == math.ceil((aufladezeit*3)/5) then
- tear.Scale = grundscale
- Isaac.DebugString("Scalestufe: 3")
- end
- if frames_passed2 == math.ceil((aufladezeit*4)/5) then
- tear.Scale = grundscale*2
- Isaac.DebugString("Scalestufe: 4")
- end
- if frames_passed2 == aufladezeit then
- tear.Scale = grundscale*3
- Isaac.DebugString("Scalestufe: 5")
- shotspeedvector = Vector(1, 1)
- tear:AddVelocity(shotspeedvector)
- frames_passed2 = 0
- end
- end
- end
- PriestMod:AddCallback(ModCallbacks.MC_POST_UPDATE, PriestMod.aufladen)
- function PriestMod:countdown()
- player = Isaac.GetPlayer(0)
- if player:HasCollectible(firemage) and geschossen == true then
- frames_passed = frames_passed + 1
- Isaac.DebugString("countdownzeit: " .. countdownzeit .. " | " .. frames_passed)
- if frames_passed == countdownzeit then
- geschossen = false
- frames_passed = 0
- end
- end
- end
- PriestMod:AddCallback(ModCallbacks.MC_POST_UPDATE, PriestMod.countdown)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement