Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Mod = RegisterMod("Julien Gonzalez", 1)
- local game = Game()
- -- stuff for the Julien character
- local Julien = {
- HasCostume = false, -- for his costume
- DAMAGE = 1.05, -- relative to Isaac's base stats.
- SPEED = 0.1,
- SHOTSPEED = 0.80,
- TEARHEIGHT = 0,
- TEARFALLINGSPEED = 0,
- LUCK = 1,
- FLYING = false,
- TEARFLAG = 0, -- 0 is default
- TEARCOLOR = Color(1.0, 1.0, 1.0, 1.0, 0, 0, 0) -- Color(1.0, 1.0, 1.0, 1.0, 0, 0, 0) is default
- }
- local Harbinger = {
- HasCostume = false, -- for his costume
- DAMAGE = 1.05, -- relative to Isaac's base stats.
- SPEED = 0.1,
- SHOTSPEED = 0.80,
- TEARHEIGHT = 0,
- TEARFALLINGSPEED = 0,
- LUCK = 1,
- FLYING = true,
- TEARFLAG = 0, -- 0 is default
- TEARCOLOR = Color(1.0, 1.0, 1.0, 1.0, 0, 0, 0) -- Color(1.0, 1.0, 1.0, 1.0, 0, 0, 0) is default
- }
- local has = {
- HairCostume = false,
- -- HarbingerCostume = false,
- HairCostumeWhite = false
- -- Revived = false, -- for the reviving ability
- -- Items = false -- keep track of Harbingers item effects
- }
- Mod.JULIENS_HAIR = Isaac.GetCostumeIdByPath("gfx/characters/juliens_hair.anm2") -- anm for the hair/not sure if it has to be assigned to Mod
- Mod.HARBINGERS_HAIR = Isaac.GetCostumeIdByPath("gfx/characters/harbingers_hair.anm2")
- function Mod:onInit(player)
- if player:GetName() == "Julien" -- based on the name in the player.xml file
- and has.HairCostume == false then -- doesn't have the costume yet
- has.HairCostume = true -- has costume
- player:AddNullCostume(Mod.JULIENS_HAIR)
- -- Harbinger
- elseif player:GetName() == "Harbinger" -- based on the name in the player.xml file
- and has.HairCostumeWhite == false then -- doesn't have the costume yet
- has.HairCostumeWhite = true -- has costume
- player:AddNullCostume(Mod.HARBINGERS_HAIR)
- player:GetEffect():AddCollectibleEffect(CollectibleType.COLLECTIBLE_MONSTROS_LUNG, true) -- add Monstro's Lung
- end
- -- check if it is not one of two characters
- if not (player:GetName() == "Julien") -- not Julien
- and has.HairCostume == true then -- but has the hair
- has.HairCostume = false -- shouldn't have the costume
- player:TryRemoveNullCostume(Mod.JULIENS_HAIR)
- end
- -- Harbinger
- if not (player:GetName() == "Harbinger") -- not Julien
- and has.HairCostumeWhite == true then -- but has the hair
- has.HairCostumeWhite = false -- shouldn't have the costume
- player:TryRemoveNullCostume(Mod.HARBINGERS_HAIR)
- end
- end
- Mod:AddCallback(ModCallbacks.MC_POST_PLAYER_INIT, Mod.onInit) -- called when the player is initialized
- function Mod:onUpdate(player)
- if player:GetName() == "Harbinger" then
- -- now we look for tears
- for _, entity in pairs(Isaac.GetRoomEntities()) do
- local tearData = entity:GetData()
- local sprite = entity:GetSprite()
- if entity.Type == EntityType.ENTITY_TEAR then
- local tear = entity:ToTear()
- if tearData.NewTear == nil --will always be nil at the beginning
- tearData.NewTear = 0 -- set tearData.NewTear to 0
- -- make Fire Mind tears
- tear:ChangeVariant(TearVariant.FIRE_MIND)
- tear.TearFlags = tear.TearFlags | TearFlags.FLAG_FIRE -- Fire Mind effect
- tear.CollisionDamage = tear.CollisionDamage
- tear:SetSize(tear.Size, Vector(1,1), 8)
- end
- end
- end
- end
- end
- Mod:AddCallback(ModCallbacks.MC_POST_PEFFECT_UPDATE, Mod.onUpdate) -- called when the game is updated
- function Mod:onCache(player, cacheFlag)
- if player:GetName() == "Julien" then
- if cacheFlag == CacheFlag.CACHE_DAMAGE then
- player.Damage = player.Damage * Julien.DAMAGE
- end
- if cacheFlag == CacheFlag.CACHE_SHOTSPEED then
- player.ShotSpeed = player.ShotSpeed * Julien*SHOTSPEED
- end
- if cacheFlag == CacheFlag.CACHE_RANGE then
- player.TearHeight = player.TearHeight - Julien.TEARHEIGHT
- player.TearFallingSpeed = player.TearFallingSpeed + Julien.TEARFALLINGSPEED
- end
- if cacheFlag == CacheFlag.CACHE_SPEED then
- player.MoveSpeed = player.MoveSpeed + Julien.SPEED
- end
- if cacheFlag == CacheFlag.CACHE_LUCK then
- player.Luck = player.Luck + Julien.LUCK
- end
- if cacheFlag == CacheFlag.CACHE_FLYING and Julien.FLYING then
- player.CanFly = true
- end
- if cacheFlag == CacheFlag.CACHE_TEARFLAG then
- player.TearFlags = player.TearFlags | Julien.TEARFLAG
- end
- if cacheFlag == CacheFlag.CACHE_TEARCOLOR then
- player.TearColor = Julien.TEARCOLOR
- end
- end
- end
- Mod:AddCallback(ModCallbacks.MC_EVALUATE_CACHE, Mod.onCache)
Advertisement
Add Comment
Please, Sign In to add comment