Skip to content

Commit

Permalink
11.3.1 release, updated to tModLoader v0.10.0.01
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidPack committed Jun 9, 2017
1 parent dbcd0dc commit 73d3922
Show file tree
Hide file tree
Showing 197 changed files with 1,148 additions and 497 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ script:
- echo "Mod Browser version is $version"
- export gitVersion=`git describe --abbrev=0 --tags`
- echo "git version is $gitVersion"
- if [[ "$version" = "$gitVersion" ]]; then echo "Version does match, no need to push release"; Deploy=no; else echo "Version does not match, need to push release"; git config --global user.email "builds@travis-ci.com"; git config --global user.name "Travis CI"; git tag $version -a -m "TravisCI Autogenerated Release"; git push --quiet https://$GH_REPO_TOKEN@github.com/JavidPack/BossChecklist $version > /dev/null 2>&1; Deploy=yes; fi
- if [[ "$version" = "$gitVersion" ]]; then echo "Version does match, no need to push release"; Deploy=no; else echo "Version does not match, need to push release"; git config --global user.email "builds@travis-ci.com"; git config --global user.name "Travis CI"; git tag $version -a -m "TravisCI Autogenerated Release"; Deploy=yes; fi
- echo $Deploy

before_deploy:
Expand Down
2 changes: 1 addition & 1 deletion Backgrounds/CrystalUgBgStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class CrystalUgBgStyle : ModUgBgStyle
{
public override bool ChooseBgStyle()
{
return Main.LocalPlayer.GetModPlayer<CrystalPlayer>(mod).ZoneCrystal;
return Main.LocalPlayer.GetModPlayer<CrystalPlayer>().ZoneCrystal;
}

public override void FillTextureArray(int[] textureSlots)
Expand Down
8 changes: 4 additions & 4 deletions Buffs/CrystalCharm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public class CrystalCharm : ModBuff
{
public override void SetDefaults()
{
Main.buffName[Type] = "Resonance";
Main.buffTip[Type] = "+1% magic damage";
DisplayName.SetDefault("Resonance");
Description.SetDefault("+1% magic damage");
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
longerExpertDebuff = false;
Expand All @@ -17,13 +17,13 @@ public override void SetDefaults()
public override void Update(Player player, ref int buffIndex)
{
//Increase magic damage based on current stacks
player.magicDamage *= (float)(1 + (player.GetModPlayer<CrystalPlayer>(mod).crystalCharmStacks * .01));
player.magicDamage *= (float)(1 + (player.GetModPlayer<CrystalPlayer>().crystalCharmStacks * .01));
}

public override void ModifyBuffTip(ref string tip, ref int rare)
{
//Use of myPlayer is OK, as buff tips are not visible by other players
tip = "+" + Main.LocalPlayer.GetModPlayer<CrystalPlayer>(mod).crystalCharmStacks + "% magic damage";
tip = "+" + Main.LocalPlayer.GetModPlayer<CrystalPlayer>().crystalCharmStacks + "% magic damage";
}
}
}
4 changes: 2 additions & 2 deletions Buffs/CrystalHealing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public class CrystalHealing : ModBuff
{
public override void SetDefaults()
{
Main.buffName[Type] = "Crystal Healing";
Main.buffTip[Type] = "I feel refreshed!";
DisplayName.SetDefault("Crystal Healing");
Description.SetDefault("I feel refreshed!");
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
longerExpertDebuff = false;
Expand Down
4 changes: 2 additions & 2 deletions Buffs/CrystalLeak.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public class CrystalLeak : ModBuff
{
public override void SetDefaults()
{
Main.buffName[Type] = "Crystal Leak";
Main.buffTip[Type] = "Creates dangerous crystals";
DisplayName.SetDefault("Crystal Leak");
Description.SetDefault("Creates dangerous crystals");
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
longerExpertDebuff = false;
Expand Down
4 changes: 2 additions & 2 deletions Buffs/DragonBoost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public class DragonFury : ModBuff
{
public override void SetDefaults()
{
Main.buffName[Type] = "Dragon Fury";
Main.buffTip[Type] = "'RYUUGAWA GA TEKI WO KURAU'";
DisplayName.SetDefault("Dragon Fury");
Description.SetDefault("'RYUUGAWA GA TEKI WO KURAU'");
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
longerExpertDebuff = false;
Expand Down
6 changes: 3 additions & 3 deletions Buffs/Dustbreak.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ public class Dustbreak : ModBuff
{
public override void SetDefaults()
{
Main.buffName[Type] = "Dustbreak";
Main.buffTip[Type] = "+20% critical strike damage";
DisplayName.SetDefault("Dustbreak");
Description.SetDefault("+20% critical strike damage");
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
longerExpertDebuff = false;
}

public override void Update(Player player, ref int buffIndex)
{
player.GetModPlayer<CrystalPlayer>(mod).critDmgMult += 0.2f;
player.GetModPlayer<CrystalPlayer>().critDmgMult += 0.2f;
}
}
}
4 changes: 2 additions & 2 deletions Buffs/GraniteBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public class GraniteBuff : ModBuff
{
public override void SetDefaults()
{
Main.buffName[Type] = "Granite Skin";
Main.buffTip[Type] = "Hard as a rock";
DisplayName.SetDefault("Granite Skin");
Description.SetDefault("Hard as a rock");
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
longerExpertDebuff = false;
Expand Down
4 changes: 2 additions & 2 deletions Buffs/MarbleBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public class MarbleBuff : ModBuff
{
public override void SetDefaults()
{
Main.buffName[Type] = "Marble Aura";
Main.buffTip[Type] = "Light as a feather";
DisplayName.SetDefault("Marble Aura");
Description.SetDefault("Light as a feather");
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
longerExpertDebuff = false;
Expand Down
4 changes: 2 additions & 2 deletions Buffs/QuartzDisease.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ public class QuartzDisease : ModBuff
{
public override void SetDefaults()
{
Main.buffName[Type] = "Quartz Disease";
Main.buffTip[Type] = "'Keter.'";
DisplayName.SetDefault("Quartz Disease");
Description.SetDefault("'Keter.'");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
Expand Down
4 changes: 2 additions & 2 deletions Buffs/ThrowingBoost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public class ThrowingBoost : ModBuff
{
public override void SetDefaults()
{
Main.buffName[Type] = "Throwing Boost";
Main.buffTip[Type] = "+10% throwing damage";
DisplayName.SetDefault("Throwing Boost");
Description.SetDefault("+10% throwing damage");
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
longerExpertDebuff = false;
Expand Down
4 changes: 2 additions & 2 deletions Buffs/Twilight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public class Twilight : ModBuff
{
public override void SetDefaults()
{
Main.buffName[Type] = "Twilight";
Main.buffTip[Type] = "+7% damage at night";
DisplayName.SetDefault("Twilight");
Description.SetDefault("+7% damage at night");
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
longerExpertDebuff = false;
Expand Down
4 changes: 2 additions & 2 deletions CrystalPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ public override Texture2D GetMapBackgroundImage()

public override bool CustomBiomesMatch(Player other)
{
CrystalPlayer modOther = other.GetModPlayer<CrystalPlayer>(mod);
CrystalPlayer modOther = other.GetModPlayer<CrystalPlayer>();
return ZoneCrystal == modOther.ZoneCrystal;
}

public override void CopyCustomBiomesTo(Player other)
{
CrystalPlayer modOther = other.GetModPlayer<CrystalPlayer>(mod);
CrystalPlayer modOther = other.GetModPlayer<CrystalPlayer>();
modOther.ZoneCrystal = ZoneCrystal;
}

Expand Down
103 changes: 81 additions & 22 deletions CrystalWorld.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CrystiliumMod.Tiles;
using Microsoft.Xna.Framework;
using System.Collections.Generic;
using Terraria;
using Terraria.GameContent.Generation;
Expand All @@ -11,9 +12,12 @@ namespace CrystiliumMod
public class CrystalWorld : ModWorld
{
public static int CrystalTiles = 0;
private static List<Point> BiomeCenters;

public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
{
BiomeCenters = new List<Point>();

int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies"));
if (ShiniesIndex == -1)
{
Expand Down Expand Up @@ -52,10 +56,43 @@ public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWei
}
}*/


/*bool placeSuccessful = false;
Tile tileResult;
int x;
int y;
int maxTries = 10000;
int tries = 0;
int successes = 0;
WorldGen.digTunnel(Xvalue + 400, Yvalue + 400, 0, 0, WorldGen.genRand.Next(15, 18), WorldGen.genRand.Next(14, 17), false);
while(tries < maxTries && successes < 5)
{
x = Xvalue + WorldGen.genRand.Next(350, 450);
y = Yvalue + WorldGen.genRand.Next(350, 450);
WorldGen.PlaceChest(x, y, (ushort)mod.TileType<Tiles.CrystalChest>(), false, 2);
tileResult = Main.tile[x, y];
placeSuccessful = tileResult.active() && tileResult.type == mod.TileType<Tiles.CrystalChest>();
if (placeSuccessful) successes++;
tries++;
}*/

int x;
int y;
int maxTries = 20000;
int tries = 0;
int successes = 0;

WorldGen.digTunnel(Xvalue + 400, Yvalue + 400, 0, 0, WorldGen.genRand.Next(15, 18), WorldGen.genRand.Next(14, 17), false);
for (int C = 0; C < 400; C++)
while (tries < maxTries && successes < 5)
{
WorldGen.PlaceChest(Xvalue + WorldGen.genRand.Next(350, 450), Yvalue + WorldGen.genRand.Next(350, 450), (ushort)mod.TileType<Tiles.CrystalChest>(), false, 2);
x = Xvalue + WorldGen.genRand.Next(350, 450);
y = Yvalue + WorldGen.genRand.Next(350, 450);
if (WorldGen.PlaceChest(x, y, (ushort)mod.TileType<Tiles.CrystalChest>(), false, 2) != -1)
{
successes++;
}
tries++;
}
for (int C = 0; C < 40; C++)
{
Expand Down Expand Up @@ -91,29 +128,51 @@ public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWei
WorldGen.TileRunner(Xore, Yore, (double)WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(3, 6), mod.TileType<RadiantOre>(), false, 0f, 0f, false, true);
}
}
for (int X1 = -4; X1 < 10; X1++)


BiomeCenters.Add(new Point(XvalueMid, YvalueMid));
}
}));

int LihzahrdAltarsIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Lihzahrd Altars"));
if (LihzahrdAltarsIndex == -1)
{
// Lihzahrd Altars pass removed by some other mod.
return;
}
tasks.Insert(LihzahrdAltarsIndex, new PassLegacy("CrystalBiomeGenFountain", delegate (GenerationProgress progress)
{
progress.Message = "Polishing more crystals";

if (BiomeCenters != null)
{
foreach (var center in BiomeCenters)
{
for (int Y1 = 0; Y1 < 7; Y1++)
int XvalueMid = center.X;
int YvalueMid = center.Y;

for (int X1 = -4; X1 < 10; X1++)
{
WorldGen.KillTile(XvalueMid + X1, YvalueMid - Y1);
WorldGen.PlaceTile(XvalueMid + X1, YvalueMid, mod.TileType<FountainBlock>());
for (int Y1 = 0; Y1 < 7; Y1++)
{
WorldGen.KillTile(XvalueMid + X1, YvalueMid - Y1);
}
WorldGen.PlaceTile(XvalueMid + X1, YvalueMid, mod.TileType<FountainBlock>(), forced: true);
}
for (int X1 = -2; X1 < 8; X1++)
{
WorldGen.PlaceTile(XvalueMid + X1, YvalueMid + 1, mod.TileType<CrystalBlock>());
}
for (int X1 = -1; X1 < 7; X1++)
{
WorldGen.PlaceTile(XvalueMid + X1, YvalueMid + 2, mod.TileType<CrystalBlock>());
}
WorldGen.PlaceObject(XvalueMid, YvalueMid - 6, mod.TileType<Fountain>());
WorldGen.PlaceObject(XvalueMid - 1, YvalueMid - 1, TileID.Lamps, false, 5); // Style 5 Lamp is FrozenLamp
WorldGen.PlaceObject(XvalueMid - 4, YvalueMid - 1, mod.TileType<Crystal>());
WorldGen.PlaceObject(XvalueMid + 7, YvalueMid - 1, mod.TileType<Crystal>());
WorldGen.PlaceObject(XvalueMid + 6, YvalueMid - 1, TileID.Lamps, false, 5);
}
for (int X1 = -2; X1 < 8; X1++)
{
WorldGen.PlaceTile(XvalueMid + X1, YvalueMid + 1, mod.TileType<CrystalBlock>());
}
for (int X1 = -1; X1 < 7; X1++)
{
WorldGen.PlaceTile(XvalueMid + X1, YvalueMid + 2, mod.TileType<CrystalBlock>());
}
WorldGen.PlaceObject(XvalueMid, YvalueMid - 1, mod.TileType<Fountain>());
WorldGen.PlaceObject(XvalueMid, YvalueMid - 6, mod.TileType<Fountain>());
WorldGen.PlaceObject(XvalueMid + 1, YvalueMid - 6, mod.TileType<Fountain>());
WorldGen.PlaceObject(XvalueMid - 1, YvalueMid - 1, TileID.Lamps, false, 5); // Style 5 Lamp is FrozenLamp
WorldGen.PlaceObject(XvalueMid - 4, YvalueMid - 1, mod.TileType<Crystal>());
WorldGen.PlaceObject(XvalueMid + 7, YvalueMid - 1, mod.TileType<Crystal>());
WorldGen.PlaceObject(XvalueMid + 6, YvalueMid - 1, TileID.Lamps, false, 5);
}
}));
}
Expand Down Expand Up @@ -167,7 +226,7 @@ public override void PostWorldGen()

public override void ResetNearbyTileEffects()
{
CrystalPlayer modPlayer = Main.LocalPlayer.GetModPlayer<CrystalPlayer>(mod);
CrystalPlayer modPlayer = Main.LocalPlayer.GetModPlayer<CrystalPlayer>();
modPlayer.crystalFountain = false;
CrystalTiles = 0;
}
Expand Down
11 changes: 7 additions & 4 deletions CrystiliumMod.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
Expand All @@ -10,15 +11,17 @@ public class CrystiliumMod : Mod

public CrystiliumMod()
{
// We need this for the worldgen chest fix.
if (ModLoader.version < new Version(0, 10, 0, 1))
{
throw new Exception("\nThis mod uses functionality only present in the latest tModLoader. Please update tModLoader to use this mod\n\n");
}

instance = this;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(this);
recipe.AddIngredient(ItemType<Items.CrystalBottle>());
recipe.needWater = true;
recipe.SetResult(ItemType<Items.CrystalBottleWater>());
}

public override void UpdateMusic(ref int music)
Expand Down
Loading

0 comments on commit 73d3922

Please sign in to comment.