Fixed INFINTY YARIELS bug - Cos of this, Yari and Ariel are now independent items (wont be added at pools)

- The duo item grants both items on pickup, then is removed.

Fixed Multiple PlayerInit instances (Its not playerInit now, but on new 
game start)

Continued the separation between costume layers, next push probably.
This commit is contained in:
UndeadMaelys 2021-01-07 10:11:45 +01:00
parent c5a7b01985
commit 7e236dc81e
9 changed files with 94 additions and 62 deletions

View File

@ -78,11 +78,21 @@
maxcharges="4" maxcharges="4"
/> />
<familiar name="Mommy of Two" <passive name="Mommy of Two"
description="Sweet, adorable, mischievous!" description="Sweet, adorable, mischievous!"
gfx="mommy_of_two.png" gfx="mommy_of_two.png"
/> />
<familiar name="Mommy of Two Ariel"
description="Sweet, adorable, mischievous!"
gfx="mommy_of_two_ariel.png"
/>
<familiar name="Mommy of Two Yari"
description="Sweet, adorable, mischievous!"
gfx="mommy_of_two_yari.png"
/>
<familiar name="Scaly Egg" <familiar name="Scaly Egg"
description="A warming companion." description="A warming companion."
gfx="scaly_egg.png" gfx="scaly_egg.png"

140
main.lua
View File

@ -136,6 +136,8 @@ CollectibleType.COLLECTIBLE_DRAGON_MARK = Isaac.GetItemIdByName("Dragon Mark")
-- Familiar Mommy of Two -- Familiar Mommy of Two
CollectibleType.COLLECTIBLE_MOMMY_OF_TWO = Isaac.GetItemIdByName("Mommy of Two") CollectibleType.COLLECTIBLE_MOMMY_OF_TWO = Isaac.GetItemIdByName("Mommy of Two")
CollectibleType.COLLECTIBLE_MOMMY_OF_TWO_ARIEL = Isaac.GetItemIdByName("Mommy of Two Ariel")
CollectibleType.COLLECTIBLE_MOMMY_OF_TWO_YARI = Isaac.GetItemIdByName("Mommy of Two Yari")
FamiliarVariant.BABY_ARIEL = Isaac.GetEntityVariantByName("Baby Ariel") FamiliarVariant.BABY_ARIEL = Isaac.GetEntityVariantByName("Baby Ariel")
FamiliarVariant.BABY_YARI = Isaac.GetEntityVariantByName("Baby Yari") FamiliarVariant.BABY_YARI = Isaac.GetEntityVariantByName("Baby Yari")
@ -194,22 +196,46 @@ local SIVE_STATS = {
local SIVE_HEAD = Isaac.GetCostumeIdByPath("gfx/characters/players/03_Sive_Head.anm2") local SIVE_HEAD = Isaac.GetCostumeIdByPath("gfx/characters/players/03_Sive_Head.anm2")
-- ON PLAYER INIT!! -- GIVE EM STUFF -- ON PLAYER INIT!! -- GIVE EM STUFF
function Lore:PostPlayerInit( player ) function Lore:PlayerTypesProperties( resumedGame )
if player:GetPlayerType() == ARIEL_TYPE then if resumedGame == false then
player:AddNullCostume( ARIEL_HEAD ); print("New Game!")
player:AddCollectible( CollectibleType.COLLECTIBLE_SUCCUBUS_CHARM, 0, 0); local player = Isaac.GetPlayer(0)
end if player:GetPlayerType() == ARIEL_TYPE then
if player:GetPlayerType() == NERIELLE_TYPE then print("Initializing player: Ariel")
player:AddNullCostume( NERIELLE_HEAD );
end player:AddNullCostume( ARIEL_HEAD );
if player:GetPlayerType() == SIVE_TYPE then print("> Costume: ARIEL_HEAD")
player:AddNullCostume( SIVE_HEAD );
player.SpriteScale = Vector(1.5,1.5); print("> Items:")
player:AddCollectible( CollectibleType.COLLECTIBLE_MOMMY_OF_TWO, 0, 0); player:AddCollectible( CollectibleType.COLLECTIBLE_SUCCUBUS_CHARM, 0, 0);
player:AddCollectible( CollectibleType.COLLECTIBLE_YALE_HORNS, 0, 0); print(" - Succubus Charm")
end
if player:GetPlayerType() == NERIELLE_TYPE then
print("Initializing player: Nerielle")
print("> Costume: ARIEL_HEAD")
player:AddNullCostume( NERIELLE_HEAD );
end
if player:GetPlayerType() == SIVE_TYPE then
print("Initializing player: Sive")
print("> Costume: SIVE_HEAD")
player:AddNullCostume( SIVE_HEAD );
print("> Scale: (1.5, 1.5)")
player.SpriteScale = Vector(1.5,1.5);
print("> Items:")
player:AddCollectible( CollectibleType.COLLECTIBLE_YALE_HORNS, 0, 0);
print(" - Yale Horns")
player:AddCollectible( CollectibleType.COLLECTIBLE_MOMMY_OF_TWO_YARI, 0, 0);
player:AddCollectible( CollectibleType.COLLECTIBLE_MOMMY_OF_TWO_ARIEL, 0, 0);
print(" - Mommy of Two")
end
end end
end end
Lore:AddCallback( ModCallbacks.MC_POST_PLAYER_INIT, Lore.PostPlayerInit ); Lore:AddCallback( ModCallbacks.MC_POST_GAME_STARTED, Lore.PlayerTypesProperties );
-- STUFF FOR ENTITIES -- STUFF FOR ENTITIES
-- BABY ARIEL! -- BABY ARIEL!
@ -247,6 +273,31 @@ Lore:AddCallback( ModCallbacks.MC_POST_PLAYER_INIT, Lore.PostPlayerInit );
-- STUFF FOR ITEMS -- STUFF FOR ITEMS
-- Passive
function Lore:PassiveYaleHorns(tear)
local player = Isaac.GetPlayer(0) -- get the player entity
if player:HasCollectible(CollectibleType.COLLECTIBLE_YALE_HORNS) == true then
if yaleTearCount == nil then
yaleTearCount = 0
end
yaleTearCount = yaleTearCount + 1
if yaleTearCount == 3 then
yaleTearCount = 0;
local lookout = Vector(1,0)
local at = math.random(1,180)
local finalTear = lookout:Rotated(at):Resized(player.ShotSpeed*10)
local tearCopy = tear.Variant
local newTear = Isaac.Spawn(EntityType.ENTITY_TEAR, tearCopy, 0, player.Position, finalTear, player):ToTear()
newTear:SetColor(player.TearColor, 0, 200, 0, 0)
local finalTear = lookout:Rotated(at+180):Resized(player.ShotSpeed*10)
local tearCopy = tear.Variant
local newTear = Isaac.Spawn(EntityType.ENTITY_TEAR, tearCopy, 0, player.Position, finalTear, player):ToTear()
newTear:SetColor(player.TearColor, 0, 200, 0, 0)
end
end
end
Lore:AddCallback(ModCallbacks.MC_POST_FIRE_TEAR, Lore.PassiveYaleHorns)
-- Active -- Active
function Lore:ActivateSuccubusCharm(_Type, RNG) function Lore:ActivateSuccubusCharm(_Type, RNG)
local player = Isaac.GetPlayer(0) local player = Isaac.GetPlayer(0)
@ -275,33 +326,34 @@ end
Lore:AddCallback( ModCallbacks.MC_POST_PLAYER_UPDATE, Lore.PlayerUpdate ); Lore:AddCallback( ModCallbacks.MC_POST_PLAYER_UPDATE, Lore.PlayerUpdate );
local BabyArielCount = 0
local BabyYariCount = 0
local BabyLilDrakeCount = 0
function Lore:onCache( player, cacheFlag) function Lore:onCache( player, cacheFlag)
BabyArielCount = 0
BabyYariCount = 0
BabyLilDrakeCount = 0
if cacheFlag == CacheFlag.CACHE_FAMILIARS then if cacheFlag == CacheFlag.CACHE_FAMILIARS then
for _, entity in pairs(Isaac.GetRoomEntities()) do for _, entity in pairs(Isaac.GetRoomEntities()) do
if EntityType == EntityType.ENTITY_FAMILIAR then if entity.Type == EntityType.ENTITY_FAMILIAR then
if entity.Variant == FamliarVariant.BABY_ARIEL then print(entity.Type, entity.Variant)
if entity.Variant == FamiliarVariant.BABY_ARIEL then
BabyArielCount = BabyArielCount + 1 BabyArielCount = BabyArielCount + 1
elseif entity.Variant == FamliarVariant.BABY_YARI then end
if entity.Variant == FamiliarVariant.BABY_YARI then
BabyYariCount = BabyYariCount + 1 BabyYariCount = BabyYariCount + 1
elseif entity.Variant == FamliarVariant.LIL_DRAKE then end
if entity.Variant == FamiliarVariant.LIL_DRAKE then
LilDrakeCount = LilDrakeCount + 1 LilDrakeCount = LilDrakeCount + 1
end end
end end
end end
print("FAMILIAR DATA ON INIT")
print(" [Ariel] FamiliarVariant:",FamiliarVariant.BABY_ARIEL," Count: ",BabyArielCount) while player:GetCollectibleNum(CollectibleType.COLLECTIBLE_MOMMY_OF_TWO_ARIEL) > BabyArielCount do
print(" [Yari] FamiliarVariant:",FamiliarVariant.BABY_YARI," Count: ",BabyYariCount)
print("[Lil Drake] FamiliarVariant:",FamiliarVariant.LIL_DRAKE," Count: ",BabyLilDrakeCount)
while player:GetCollectibleNum(CollectibleType.COLLECTIBLE_MOMMY_OF_TWO) > BabyArielCount do
SpawnFollower(FamiliarVariant.BABY_ARIEL, player)
BabyArielCount = BabyArielCount + 1 BabyArielCount = BabyArielCount + 1
SpawnFollower(FamiliarVariant.BABY_ARIEL, player)
end end
while player:GetCollectibleNum(CollectibleType.COLLECTIBLE_MOMMY_OF_TWO) > BabyYariCount do while player:GetCollectibleNum(CollectibleType.COLLECTIBLE_MOMMY_OF_TWO_YARI) > BabyYariCount do
SpawnFollower(FamiliarVariant.BABY_YARI, player)
BabyYariCount = BabyYariCount + 1 BabyYariCount = BabyYariCount + 1
SpawnFollower(FamiliarVariant.BABY_YARI, player)
end end
while player:GetCollectibleNum(CollectibleType.COLLECTIBLE_SCALY_EGG) > BabyLilDrakeCount do while player:GetCollectibleNum(CollectibleType.COLLECTIBLE_SCALY_EGG) > BabyLilDrakeCount do
SpawnFollower(FamiliarVariant.LIL_DRAKE, player) SpawnFollower(FamiliarVariant.LIL_DRAKE, player)
@ -326,33 +378,3 @@ function Lore:EvaluateCache( player, cacheFlag )
end end
end end
Lore:AddCallback(ModCallbacks.MC_EVALUATE_CACHE, Lore.EvaluateCache ); Lore:AddCallback(ModCallbacks.MC_EVALUATE_CACHE, Lore.EvaluateCache );
Lore:AddCallback(ModCallbacks.MC_POST_FIRE_TEAR, function(_, tear)
local player = Isaac.GetPlayer(0) -- get the player entity
if player:HasCollectible(CollectibleType.COLLECTIBLE_YALE_HORNS) == true then
if yaleTearCount == nil then
yaleTearCount = 0
end
yaleTearCount = yaleTearCount + 1
if yaleTearCount == 3 then
yaleTearCount = 0;
local lookout = player:GetAimDirection()
local at = math.random(-180,179)
local finalTear = lookout:Rotated(at):Resized(player.ShotSpeed*10)
local tearCopy = tear.Variant
Isaac.Spawn(EntityType.ENTITY_TEAR, tearCopy, 0, player.Position, finalTear, player):ToTear()
local finalTear = lookout:Rotated(at+180):Resized(player.ShotSpeed*10)
local tearCopy = tear.Variant
Isaac.Spawn(EntityType.ENTITY_TEAR, tearCopy, 0, player.Position, finalTear, player):ToTear()
end
end
if player:GetPlayerType() == ARIEL_TYPE then
tear.TearFlags = tear.TearFlags | TearFlags.TEAR_CHARM -- add slowing effect to the tear
end
if player:GetPlayerType() == NERIELLE_TYPE then
tear.TearFlags = tear.TearFlags | TearFlags.TEAR_BURN -- add slowing effect to the tear
end
end)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,8 +1,8 @@
<AnimatedActor> <AnimatedActor>
<Info CreatedBy="robot" CreatedOn="04/01/2021 21:03:00" Version="104" Fps="30"/> <Info CreatedBy="robot" CreatedOn="07/01/2021 2:42:23" Version="105" Fps="30"/>
<Content> <Content>
<Spritesheets> <Spritesheets>
<Spritesheet Path="03_Sive_HypnotizingHornyHair.png" Id="0"/> <Spritesheet Path="03_Sive_LavenderPrettyHair.png" Id="0"/>
</Spritesheets> </Spritesheets>
<Layers> <Layers>
<Layer Name="head0" Id="0" SpritesheetId="0"/> <Layer Name="head0" Id="0" SpritesheetId="0"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B