Skip to content

Commit

Permalink
Beginnings of 0.10- The Etherial Update
Browse files Browse the repository at this point in the history
Adding the Etherial dimension, and many other changes
  • Loading branch information
Laugic committed Nov 12, 2017
1 parent 1d166f3 commit 46ea888
Show file tree
Hide file tree
Showing 154 changed files with 3,349 additions and 186 deletions.
Binary file added Backgrounds/ExampleBiomeSurfaceClose.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Backgrounds/ExampleBiomeSurfaceFar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Backgrounds/ExampleBiomeSurfaceMid0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Backgrounds/ExampleBiomeSurfaceMid1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Backgrounds/ExampleBiomeSurfaceMid2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Backgrounds/ExampleBiomeSurfaceMid3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Buffs/TV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions Dusts/Etherial.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;

namespace Laugicality.Dusts
{
public class Etherial : ModDust
{
public override void OnSpawn(Dust dust)
{
dust.velocity *= 0.2f;
dust.noGravity = true;
dust.noLight = true;
dust.scale *= 2.0f;
}

public override bool Update(Dust dust)
{
dust.position += dust.velocity;
dust.rotation += dust.velocity.X * 0.15f;
dust.scale *= 0.99f;
if (dust.scale < 1f)
{
dust.active = false;
}
return false;
}
}
}
Binary file added Dusts/Etherial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions Etherial/EtherialBkg.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Laugicality;

namespace Laugicality.Etherial
{
public class EtherialBkg : ModNPC
{
public int id = 0;
public int life = 0;

public override void SetStaticDefaults()
{
DisplayName.SetDefault("");
}

public override void SetDefaults()
{
life = 16;
//npc.frameWidth = 40;
//npc.frameHeight = 34;
npc.width = 40;
npc.height = 34;
npc.damage = 0;
npc.defense = 12;
npc.lifeMax = 99999;
npc.value = 60f;
npc.knockBackResist = 0f;
npc.aiStyle = 0;
npc.lavaImmune = true;
npc.noGravity = true;
npc.noTileCollide = true;
npc.friendly = true;
npc.dontTakeDamage = true;
music = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/Etherial");
}

public override void AI()
{
life -= 1;
if (life == 0)
npc.life = 0;
}

}
}
Binary file added Etherial/EtherialBkg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
145 changes: 145 additions & 0 deletions Etherial/EtherialVisuals.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Laugicality;
using Laugicality.NPCs;
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;

namespace Laugicality.Etherial
{
public class EtherialShader : ScreenShaderData
{
private int YIndex;

public EtherialShader(string passName)
: base(passName)
{
}

private void UpdateYIndex()
{
int YType = ModLoader.GetMod("Laugicality").NPCType("EtherialBkg");
if (YIndex >= 0 && Main.npc[YIndex].active && Main.npc[YIndex].type == YType)
{
return;
}
YIndex = -1;
for (int i = 0; i < Main.npc.Length; i++)
{
if (Main.npc[i].active && Main.npc[i].type == YType)
{
YIndex = i;
break;
}
}
}

public override void Apply()
{
UpdateYIndex();
if (YIndex != -1)
{
UseTargetPosition(Main.npc[YIndex].Center);
}
base.Apply();
}
}

public class EtherialVisual : CustomSky
{
private bool isActive = false;
private float intensity = 0f;
private int YIndex = -1;

public override void Update(GameTime gameTime)
{
if (isActive && intensity < 1f)
{
intensity += 0.01f;
}
else if (!isActive && intensity > 0f)
{
intensity -= 0.01f;
}
}

private float GetIntensity()
{
if (this.UpdateYIndex())
{
float x = 0f;
if (this.YIndex != -1)
{
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[this.YIndex].Center);
}
return (1f - Utils.SmoothStep(3000f, 6000f, x)) * 0.66f;
}
return 0.66f;
}

public override Color OnTileColor(Color inColor)
{
float intensity = this.GetIntensity();
return new Color(Vector4.Lerp(new Vector4(0.5f, 0.8f, 1f, 1f), inColor.ToVector4(), 1f - intensity));
}

private bool UpdateYIndex()
{
int YType = ModLoader.GetMod("Laugicality").NPCType("EtherialBkg");
if (YIndex >= 0 && Main.npc[YIndex].active && Main.npc[YIndex].type == YType)
{
return true;
}
YIndex = -1;
for (int i = 0; i < Main.npc.Length; i++)
{
if (Main.npc[i].active && Main.npc[i].type == YType)
{
YIndex = i;
break;
}
}
//this.DoGIndex = DoGIndex;
return YIndex != -1;
}

public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
{
if (maxDepth >= 0 && minDepth < 0)
{
float intensity = this.GetIntensity();
spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Color(77, 19, 0) * intensity);
}
}

public override float GetCloudAlpha()
{
return 0f;
}

public override void Activate(Vector2 position, params object[] args)
{
isActive = true;
}

public override void Deactivate(params object[] args)
{
isActive = false;
}

public override void Reset()
{
isActive = false;
}

public override bool IsActive()
{
return isActive || intensity > 0f;
}
}
}
2 changes: 1 addition & 1 deletion Items/Accessories/GreaterHealingGem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class GreaterHealingGem : ModItem
{
public override void SetStaticDefaults()
{
Tooltip.SetDefault("+150 Max Life");
Tooltip.SetDefault("+150 Max Life \nGives 1 minute of Potion Sickness");
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Accessories/HealingCrystal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class HealingCrystal : ModItem
{
public override void SetStaticDefaults()
{
Tooltip.SetDefault("+150 Max Life");
Tooltip.SetDefault("+150 Max Life \nGives 1 minute of Potion Sickness");
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Accessories/HealingGem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class HealingGem : ModItem
{
public override void SetStaticDefaults()
{
Tooltip.SetDefault("+100 Max Life");
Tooltip.SetDefault("+100 Max Life \nGives 1 minute of Potion Sickness");
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Accessories/LesserHealingGem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class LesserHealingGem : ModItem
{
public override void SetStaticDefaults()
{
Tooltip.SetDefault("+50 Max Life");
Tooltip.SetDefault("+50 Max Life \nGives 1 minute of Potion Sickness");
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Accessories/MegaHealingStone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class MegaHealingStone : ModItem
{
public override void SetStaticDefaults()
{
Tooltip.SetDefault("+350 Max Life");
Tooltip.SetDefault("+350 Max Life \nGives 1 minute of Potion Sickness");
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Accessories/SuperHealingGem .cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class SuperHealingGem : ModItem
{
public override void SetStaticDefaults()
{
Tooltip.SetDefault("+200 Max Life");
Tooltip.SetDefault("+200 Max Life \nGives 1 minute of Potion Sickness");
}

public override void SetDefaults()
Expand Down
39 changes: 39 additions & 0 deletions Items/Consumables/EtherialEnergy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Laugicality.Items.Consumables
{
public class EtherialEnergy : ModItem
{
public override void SetStaticDefaults()
{
Tooltip.SetDefault("Imbues your body with Etherial energy");
}
public override void SetDefaults()
{
item.width = 24;
item.height = 24;
item.maxStack = 1;
item.rare = 1;
item.useAnimation = 45;
item.useTime = 45;
item.useStyle = 4;
item.UseSound = SoundID.Item4;
item.consumable = true;
}

public override bool CanUseItem(Player player)
{
var modPlayer = Main.LocalPlayer.GetModPlayer<LaugicalityPlayer>(mod);
return !modPlayer.etherialSlot;
}

public override bool UseItem(Player player)
{
var modPlayer = Main.LocalPlayer.GetModPlayer<LaugicalityPlayer>(mod);
modPlayer.etherialSlot = true;
return true;
}
}
}
Binary file added Items/Consumables/EtherialEnergy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions Items/Loot/BrainOfEtheria.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using Terraria;
using Terraria.ModLoader;

namespace Laugicality.Items.Loot
{
public class BrainOfEtheria : ModItem
{
public override void SetStaticDefaults()
{
Tooltip.SetDefault("+1 to all Mystic powers while in the Etherial");
}

public override void SetDefaults()
{
item.width = 24;
item.height = 24;
item.value = 100;
item.rare = 2;
item.accessory = true;
item.expert = true;
//item.defense = 1000;
//item.lifeRegen = 19;
}

public override void UpdateAccessory(Player player, bool hideVisual)
{
var modPlayer = Main.LocalPlayer.GetModPlayer<LaugicalityPlayer>(mod);
if (modPlayer.etherial)
{
modPlayer.conjurationPower += 1;
modPlayer.illusionPower += 1;
modPlayer.destructionPower += 1;
}
}
/*
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(2328, 4);
recipe.AddTile(null, "AlchemicalInfuser");
recipe.SetResult(this);
recipe.AddRecipe();
}*/
}
}
Binary file added Items/Loot/BrainOfEtheria.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 46ea888

Please sign in to comment.