Last active
February 9, 2017 16:47
-
-
Save intercaetera/8905fb2ac66adc2731227308662f2007 to your computer and use it in GitHub Desktop.
2 odcinek
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ItemPools> | |
<Pool Name="treasure"> | |
<Item Name="Carpet Bombing" Weight="1000" DecreaseBy="1" RemoveOn="0.1" /> | |
</Pool> | |
</ItemPools> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<items gfxroot="gfx/items/" version="1"> | |
<active description="Fire in the hole" gfx="Collectibles_CarpetBombing.png" maxcharges="4" name="Carpet Bombing" /> | |
</items> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local tutorial = RegisterMod("Tutorial", 1) | |
local tutorial_item = Isaac.GetItemIdByName("Carpet Bombing") | |
tutorial.isFiring = false | |
tutorial.frameCounter = 0 | |
tutorial.frequency = 2 | |
tutorial.limit = 50 | |
function tutorial:useItem() | |
self.isFiring = true | |
end | |
function tutorial:handleTimer() | |
if(self.isFiring == false) then | |
return false | |
else | |
if self.frameCounter % self.frequency == 0 then | |
local pos = Vector(math.random(0,1280), math.random(0,960)) | |
Isaac.Explode(pos, Isaac.GetPlayer(0), 100) | |
if self.frameCounter / self.limit == self.frequency then | |
self.isFiring = false | |
self.frameCounter = 0 | |
end | |
end | |
self.frameCounter = self.frameCounter + 1 | |
end | |
end | |
function tutorial:stopDamage(entity) | |
if(self.isFiring == true and entity == Isaac.GetPlayer(0)) then | |
return false | |
end | |
end | |
tutorial:AddCallback(ModCallbacks.MC_POST_UPDATE, tutorial.handleTimer) | |
tutorial:AddCallback(ModCallbacks.MC_USE_ITEM, tutorial.useItem, tutorial_item) | |
tutorial:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, tutorial.stopDamage) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<metadata> | |
<name>tutorial</name> | |
<directory>tutorial</directory> | |
<description/> | |
<version>1.0</version> | |
<visibility/> | |
</metadata> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment