mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 16:54:06 +00:00
Added the 4 challenge achievements and a special one.
This commit is contained in:
1 parent
266e3587db
commit
f0eb8c279c
8 files changed
+51
-6
No files matched your search
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.achievement;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraftforge.common.AchievementPage;
|
||||
@@ -51,9 +52,10 @@ public final class ModAchievements {
|
||||
public static Achievement signalFlareStun;
|
||||
public static Achievement l20ShardUse;
|
||||
public static Achievement gaiaGuardianNoArmor;
|
||||
public static Achievement terrasteelWills;
|
||||
public static Achievement rankSSPick;
|
||||
|
||||
public static Achievement desuGun;
|
||||
|
||||
public static void init() {
|
||||
flowerPickup = new AchievementMod(LibAchievementNames.FLOWER_PICKUP, 0, 0, new ItemStack(ModBlocks.flower, 1, 6), null);
|
||||
lexiconUse = new AchievementMod(LibAchievementNames.LEXICON_USE, 1, 1, ModItems.lexicon, flowerPickup);
|
||||
@@ -81,6 +83,15 @@ public final class ModAchievements {
|
||||
spawnerMoverUse = new AchievementMod(LibAchievementNames.SPAWNER_MOVER_USE, -1, 5, ModItems.spawnerMover, gaiaGuardianKill);
|
||||
tiaraWings = new AchievementMod(LibAchievementNames.TIARA_WINGS, -1, 3, ModItems.flightTiara, gaiaGuardianKill);
|
||||
|
||||
signalFlareStun = new AchievementMod(LibAchievementNames.SIGNAL_FLARE_STUN, -3, -3, ModItems.signalFlare, null).setSpecial();
|
||||
l20ShardUse = new AchievementMod(LibAchievementNames.L20_SHARD_USE, -5, -1, ModItems.laputaShard, null).setSpecial();
|
||||
gaiaGuardianNoArmor = new AchievementMod(LibAchievementNames.GAIA_GUARDIAN_NO_ARMOR, -5, -3, new ItemStack(Items.skull, 1, 3), null).setSpecial();
|
||||
rankSSPick = new AchievementMod(LibAchievementNames.RANK_SS_PICK, -3, -1, ModItems.terraPick, null).setSpecial();
|
||||
|
||||
ItemStack desu = new ItemStack(ModItems.manaGun);
|
||||
desu.setStackDisplayName("desu gun");
|
||||
desuGun = new AchievementMod(LibAchievementNames.DESU_GUN, -8, -2, desu, null).setSpecial();
|
||||
|
||||
botaniaPage = new AchievementPage(LibMisc.MOD_NAME, AchievementMod.achievements.toArray(new Achievement[AchievementMod.achievements.size()]));
|
||||
AchievementPage.registerAchievementPage(botaniaPage);
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
|
||||
boolean spawnLandmines = false;
|
||||
boolean spawnPixies = false;
|
||||
boolean anyWithArmor = false;
|
||||
|
||||
public EntityDoppleganger(World par1World) {
|
||||
super(par1World);
|
||||
@@ -258,8 +259,11 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
public void onDeath(DamageSource p_70645_1_) {
|
||||
super.onDeath(p_70645_1_);
|
||||
EntityLivingBase entitylivingbase = this.func_94060_bK();
|
||||
if(entitylivingbase instanceof EntityPlayer)
|
||||
if(entitylivingbase instanceof EntityPlayer) {
|
||||
((EntityPlayer) entitylivingbase).addStat(ModAchievements.gaiaGuardianKill, 1);
|
||||
if(!anyWithArmor)
|
||||
((EntityPlayer) entitylivingbase).addStat(ModAchievements.gaiaGuardianNoArmor, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -313,6 +317,9 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
if(players.isEmpty() && !worldObj.playerEntities.isEmpty())
|
||||
setDead();
|
||||
else for(EntityPlayer player : players) {
|
||||
if(player.inventory.armorInventory[0] != null || player.inventory.armorInventory[1] != null || player.inventory.armorInventory[2] != null || player.inventory.armorInventory[3] != null)
|
||||
anyWithArmor = true;
|
||||
|
||||
List<PotionEffect> remove = new ArrayList();
|
||||
Collection<PotionEffect> active = player.getActivePotionEffects();
|
||||
for(PotionEffect effect : active)
|
||||
|
||||
@@ -29,6 +29,7 @@ import vazkii.botania.api.mana.BurstProperties;
|
||||
import vazkii.botania.api.mana.ILaputaImmobile;
|
||||
import vazkii.botania.api.mana.ILensEffect;
|
||||
import vazkii.botania.api.mana.ITinyPlanetExcempt;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.entity.EntityManaBurst;
|
||||
@@ -75,6 +76,8 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet
|
||||
par3World.playSound(par4 + 0.5D, par5 + 0.5D, par6 + 0.5D, "botania:laputaStart", 1.0F + par3World.rand.nextFloat(), par3World.rand.nextFloat() * 0.7F + 1.3F, false);
|
||||
spawnBurstFirst(par3World, par4, par5, par6, par1ItemStack);
|
||||
par1ItemStack.stackSize--;
|
||||
if(par1ItemStack.getItemDamage() == 19)
|
||||
par2EntityPlayer.addStat(ModAchievements.l20ShardUse, 1);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -90,6 +90,8 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem {
|
||||
if(!par2World.isRemote) {
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "botania:manaBlaster", 0.6F, 1F);
|
||||
par3EntityPlayer.addStat(ModAchievements.manaBlasterShoot, 1);
|
||||
if(isSugoiKawaiiDesuNe(par1ItemStack))
|
||||
par3EntityPlayer.addStat(ModAchievements.desuGun, 1);
|
||||
par2World.spawnEntityInWorld(burst);
|
||||
} else {
|
||||
par3EntityPlayer.swingItem();
|
||||
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.entity.EntitySignalFlare;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
@@ -65,11 +66,17 @@ public class ItemSignalFlare extends ItemMod {
|
||||
|
||||
par2World.spawnEntityInWorld(flare);
|
||||
|
||||
int stunned = 0;
|
||||
int range = 5;
|
||||
List<EntityLivingBase> entities = par2World.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX - range, par3EntityPlayer.posY - range, par3EntityPlayer.posZ - range, par3EntityPlayer.posX + range, par3EntityPlayer.posY + range, par3EntityPlayer.posZ + range));
|
||||
for(EntityLivingBase entity : entities)
|
||||
if(entity != par3EntityPlayer && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer() == null || MinecraftServer.getServer().isPVPEnabled()))
|
||||
if(entity != par3EntityPlayer && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer() == null || MinecraftServer.getServer().isPVPEnabled())) {
|
||||
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 50, 5));
|
||||
stunned++;
|
||||
}
|
||||
|
||||
if(stunned >= 100)
|
||||
par3EntityPlayer.addStat(ModAchievements.signalFlareStun, 1);
|
||||
}
|
||||
par1ItemStack.damageItem(200, par3EntityPlayer);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.crafting.recipe.TerraPickTippingRecipe;
|
||||
import vazkii.botania.common.item.ItemSpark;
|
||||
@@ -145,7 +146,9 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem {
|
||||
return false;
|
||||
|
||||
ToolCommons.removeBlocksInIteration(player, stack, world, x, y, z, doX ? -range : 0, doY ? -1 : 0, doZ ? -range : 0, doX ? range + 1 : 1, doY ? rangeY * 2 : 1, doZ ? range + 1 : 1, null, MATERIALS, silk, fortune, isTipped(stack));
|
||||
|
||||
if(level == 5)
|
||||
player.addStat(ModAchievements.rankSSPick, 1);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,8 @@ public final class LibAchievementNames {
|
||||
public static final String SIGNAL_FLARE_STUN = "signalFlareStun";
|
||||
public static final String L20_SHARD_USE = "l20ShardUse";
|
||||
public static final String GAIA_GUARDIAN_NO_ARMOR = "gaiaGuardianNoArmor";
|
||||
public static final String TERRASTEEL_WILLS = "terrasteelWills";
|
||||
public static final String RANK_SS_PICK = "rankSSPick";
|
||||
|
||||
public static final String DESU_GUN = "desuGun";
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user