Half-coded Yari's AI but im not convinced -- I want yari to act as a turret, not copy player (which also creates a bug, if u quickly stop shooting after tear out)
This commit is contained in:
parent
d5011aabc4
commit
e8187c6c20
41
main.lua
41
main.lua
|
@ -13,8 +13,10 @@ local Room = Room
|
||||||
-- * Make sure tear properly scales with player.ShotSpeed
|
-- * Make sure tear properly scales with player.ShotSpeed
|
||||||
--
|
--
|
||||||
-- [Mommy of Two]:
|
-- [Mommy of Two]:
|
||||||
-- * Baby Ariel and Baby Yari behaviour
|
-- [DONE] Baby Ariel whole sprite
|
||||||
-- * Baby Ariel whole sprite, finish Yari's one too.
|
-- [DONE] Baby Yari behaviour
|
||||||
|
-- * do Ariel behaviour
|
||||||
|
-- * finish Yari's one too.
|
||||||
-- * Code in Best Friends Forever Interaction!!
|
-- * Code in Best Friends Forever Interaction!!
|
||||||
--
|
--
|
||||||
-- [Drake Soul]:
|
-- [Drake Soul]:
|
||||||
|
@ -217,25 +219,23 @@ Lore:AddCallback( ModCallbacks.MC_POST_PLAYER_INIT, Lore.PostPlayerInit );
|
||||||
Lore:AddCallback(ModCallbacks.MC_FAMILIAR_INIT, Lore.GetBabyAriel, FamiliarVariant.BABY_ARIEL)
|
Lore:AddCallback(ModCallbacks.MC_FAMILIAR_INIT, Lore.GetBabyAriel, FamiliarVariant.BABY_ARIEL)
|
||||||
-- do ur thing baby succubus gal
|
-- do ur thing baby succubus gal
|
||||||
function Lore:UpdateBabyAriel(Ariel)
|
function Lore:UpdateBabyAriel(Ariel)
|
||||||
|
Ariel:FollowParent()
|
||||||
end
|
end
|
||||||
Lore:AddCallback(ModCallbacks.MC_FAMILIAR_UPDATE, Lore.UpdateBabyAriel, FamiliarVariant.BABY_ARIEL)
|
Lore:AddCallback(ModCallbacks.MC_FAMILIAR_UPDATE, Lore.UpdateBabyAriel, FamiliarVariant.BABY_ARIEL)
|
||||||
|
|
||||||
-- BABY YARI
|
-- BABY YARI
|
||||||
function Lore:GetBabyYari(Yari)
|
function Lore:GetBabyYari(Yari)
|
||||||
-- ariel:copy()
|
-- ariel:copy()
|
||||||
-- mommy:be_kissed()
|
Yari.FireCooldown = 1
|
||||||
end
|
end
|
||||||
Lore:AddCallback(ModCallbacks.MC_FAMILIAR_INIT,Lore.GetBabyYari, FamiliarVariant.BABY_YARI)
|
Lore:AddCallback(ModCallbacks.MC_FAMILIAR_INIT,Lore.GetBabyYari, FamiliarVariant.BABY_YARI)
|
||||||
|
|
||||||
function Lore:UpdateBabyYari(Yari)
|
function Lore:UpdateBabyYari(Yari)
|
||||||
local player = Isaac.GetPlayer(0)
|
local player = Isaac.GetPlayer(0)
|
||||||
local data = Yari:GetData()
|
Yari:PickEnemyTarget(400,5)
|
||||||
local sprite = Yari:GetSprite()
|
Yari:Shoot()
|
||||||
local FireDir = player:GetFireDirection()
|
|
||||||
local MoveDir = player:GetMovementDirection()
|
local MoveDir = player:GetMovementDirection()
|
||||||
|
Yari:FollowParent()
|
||||||
--if FireDir == Direction.NO_DIRECTION or data.Cooldown > 0 then
|
|
||||||
Yari:FollowParents()
|
|
||||||
end
|
end
|
||||||
Lore:AddCallback(ModCallbacks.MC_FAMILIAR_UPDATE, Lore.UpdateBabyYari, FamiliarVariant.BABY_YARI)
|
Lore:AddCallback(ModCallbacks.MC_FAMILIAR_UPDATE, Lore.UpdateBabyYari, FamiliarVariant.BABY_YARI)
|
||||||
|
|
||||||
|
@ -274,26 +274,27 @@ function Lore:PlayerUpdate( player )
|
||||||
end
|
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)
|
||||||
if cacheFlag == CacheFlag.CACHE_FAMILIARS then
|
if cacheFlag == CacheFlag.CACHE_FAMILIARS then
|
||||||
|
|
||||||
local BabyArielCount = 0
|
|
||||||
local BabyYariCount = 0
|
|
||||||
local BabyLilDrakeCount = 0
|
|
||||||
|
|
||||||
for _, entity in pairs(Isaac.GetRoomEntities()) do
|
for _, entity in pairs(Isaac.GetRoomEntities()) do
|
||||||
if EntityType == EntityType.ENTITY_FAMILIAR then
|
if EntityType == EntityType.ENTITY_FAMILIAR then
|
||||||
if entity.Variant == FamliarVariant.BABY_ARIEL then
|
if entity.Variant == FamliarVariant.BABY_ARIEL then
|
||||||
BabyArielCount = BabyArielCount + 1
|
BabyArielCount = BabyArielCount + 1
|
||||||
end
|
elseif entity.Variant == FamliarVariant.BABY_YARI then
|
||||||
if entity.Variant == FamliarVariant.BABY_YARI then
|
|
||||||
BabyYariCount = BabyYariCount + 1
|
BabyYariCount = BabyYariCount + 1
|
||||||
end
|
elseif entity.Variant == FamliarVariant.LIL_DRAKE then
|
||||||
if entity.Variant == FamliarVariant.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)
|
||||||
|
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
|
while player:GetCollectibleNum(CollectibleType.COLLECTIBLE_MOMMY_OF_TWO) > BabyArielCount do
|
||||||
SpawnFollower(FamiliarVariant.BABY_ARIEL, player)
|
SpawnFollower(FamiliarVariant.BABY_ARIEL, player)
|
||||||
BabyArielCount = BabyArielCount + 1
|
BabyArielCount = BabyArielCount + 1
|
||||||
|
@ -340,6 +341,10 @@ Lore:AddCallback(ModCallbacks.MC_POST_FIRE_TEAR, function(_, tear)
|
||||||
local finalTear = lookout:Rotated(at):Resized(player.ShotSpeed*10)
|
local finalTear = lookout:Rotated(at):Resized(player.ShotSpeed*10)
|
||||||
local tearCopy = tear.Variant
|
local tearCopy = tear.Variant
|
||||||
Isaac.Spawn(EntityType.ENTITY_TEAR, tearCopy, 0, player.Position, finalTear, player):ToTear()
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue