tboi-creativelore/main.lua

102 lines
4.6 KiB
Lua

local Lore = RegisterMod( "thecreativelore", 1 );
--[[ CHARACTERS ]]
-- Ariel
local ARIEL_NAME = "TCL01_Ariel";
local ARIEL_TYPE = Isaac.GetPlayerTypeByName(ARIEL_NAME);
local ARIEL_STATS = {
MoveSpeedNaturalBonus = 0.10,
MoveSpeedNaturalMultiplier = 0.9,
DamageNaturalMultiplier = 0.70,
ShotSpeedNaturalMultiplier = 0.8,
MaxFireDelayNaturalMultiplier = 1.0,
MaxFireDelayNaturalExponent = 0.9,
TearHeightBonus = 12,
};
local ARIEL_HEAD = Isaac.GetCostumeIdByPath("gfx/characters/players/01_Ariel_Head.anm2")
-- Nerielle
local NERIELLE_NAME = "TCL02_Nerielle";
local NERIELLE_TYPE = Isaac.GetPlayerTypeByName(NERIELLE_NAME);
local NERIELLE_STATS = {
MoveSpeedNaturalBonus = 0.10,
MoveSpeedNaturalMultiplier = 0.9,
DamageNaturalMultiplier = 0.70,
ShotSpeedNaturalMultiplier = 0.8,
MaxFireDelayNaturalMultiplier = 1.0,
MaxFireDelayNaturalExponent = 0.9,
TearHeightBonus = 12,
};
local NERIELLE_HEAD = Isaac.GetCostumeIdByPath("gfx/characters/players/02_Nerielle_Head.anm2")
function Lore:PostPlayerInit( player )
if player:GetPlayerType() == ARIEL_TYPE then
player:AddNullCostume( ARIEL_HEAD );
end
if player:GetPlayerType() == NERIELLE_TYPE then
player:AddNullCostume( NERIELLE_HEAD );
end
end
Lore:AddCallback( ModCallbacks.MC_POST_PLAYER_INIT, Lore.PostPlayerInit );
--[[ Stats ]]
function Lore:EvaluateCache( player, cacheFlag )
local player = Isaac.GetPlayer(0) -- get the player entity
if player:GetPlayerType() == ARIEL_TYPE then
--[[ if cacheFlag == CacheFlag.CACHE_SPEED then
player.MoveSpeed = player.Mññº
moveSpeed * ARIEL_STATS.MoveSpeedNaturalMultiplier + ARIEL_STATS.MoveSpeedNaturalBonus;
elseif cacheFlag == CacheFlag.CACHE_SHOTSPEED then
player.ShotSpeed = player.ShotSpeed * ARIEL_STATS.ShotSpeedNaturalMultiplier;
elseif cacheFlag == CacheFlag.CACHE_DAMAGE then
player.Damage = player.Damage * ARIEL_STATS.DamageNaturalMultiplier;
elseif cacheFlag == CacheFlag.CACHE_FIREDELAY then
player.MaxFireDelay = math.floor( math.max( 1, player.MaxFireDelay * ARIEL_STATS.MaxFireDelayNaturalMultiplier ) ^ ARIEL_STATS.MaxFireDelayNaturalExponent );
elseif cacheFlag == CacheFlag.CACHE_RANGE then
player.TearHeight = player.TearHeight + ARIEL_STATS.TearHeightBonus;
elseif cacheFlag == CacheFlag.CACHE_TEARCOLOR then
--player.TearColor = GAPPI_COLOR;
--Player.LaserColor = GAPPI_COLOR;
end]]
if cacheFlag == CacheFlag.CACHE_FLYING then
player.CanFly = 1
end
end
if player:GetPlayerType() == NERIELLE_TYPE then
--[[ if cacheFlag == CacheFlag.CACHE_SPEED then
player.MoveSpeed = player.Mññº
moveSpeed * ARIEL_STATS.MoveSpeedNaturalMultiplier + ARIEL_STATS.MoveSpeedNaturalBonus;
elseif cacheFlag == CacheFlag.CACHE_SHOTSPEED then
player.ShotSpeed = player.ShotSpeed * ARIEL_STATS.ShotSpeedNaturalMultiplier;
elseif cacheFlag == CacheFlag.CACHE_DAMAGE then
player.Damage = player.Damage * ARIEL_STATS.DamageNaturalMultiplier;
elseif cacheFlag == CacheFlag.CACHE_FIREDELAY then
player.MaxFireDelay = math.floor( math.max( 1, player.MaxFireDelay * ARIEL_STATS.MaxFireDelayNaturalMultiplier ) ^ ARIEL_STATS.MaxFireDelayNaturalExponent );
elseif cacheFlag == CacheFlag.CACHE_RANGE then
player.TearHeight = player.TearHeight + ARIEL_STATS.TearHeightBonus;
elseif cacheFlag == CacheFlag.CACHE_TEARCOLOR then
--player.TearColor = GAPPI_COLOR;
--Player.LaserColor = GAPPI_COLOR;
end]]
if cacheFlag == CacheFlag.CACHE_FLYING then
player.CanFly = 1
end
end
end
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: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)