mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-08 06:26:43 +01:00
Added awkward gems
This commit is contained in:
parent
322419970b
commit
4033b48e24
3 changed files with 70 additions and 0 deletions
|
@ -0,0 +1,63 @@
|
|||
package com.minelittlepony.unicopia.spell;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.minelittlepony.util.shape.Sphere;
|
||||
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public class SpellAwkward extends AbstractSpell {
|
||||
|
||||
private final List<String> names = Lists.newArrayList(EnumParticleTypes.getParticleNames());
|
||||
|
||||
private final int max = names.size();
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "awkward";
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpellAffinity getAffinity() {
|
||||
return SpellAffinity.NEUTRAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTint() {
|
||||
return 0x248712;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(ICaster<?> source, int level) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(ICaster<?> source, int level) {
|
||||
source.spawnParticles(new Sphere(false, (1 + level) * 8), 10, pos -> {
|
||||
int index = (int)MathHelper.nextDouble(source.getWorld().rand, 0, max);
|
||||
|
||||
EnumParticleTypes type = EnumParticleTypes.getByName(names.get(index));
|
||||
|
||||
if (shouldSpawnParticle(type)) {
|
||||
int[] arguments = new int[type.getArgumentCount()];
|
||||
|
||||
source.getWorld().spawnParticle(type, pos.x, pos.y, pos.z, 0, 0, 0, arguments);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected boolean shouldSpawnParticle(EnumParticleTypes type) {
|
||||
switch (type) {
|
||||
case BARRIER:
|
||||
case SMOKE_LARGE:
|
||||
case MOB_APPEARANCE:
|
||||
case EXPLOSION_HUGE:
|
||||
case EXPLOSION_LARGE:
|
||||
case EXPLOSION_NORMAL: return false;
|
||||
default: return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -39,6 +39,7 @@ public class SpellRegistry {
|
|||
registerSpell(SpellVortex::new);
|
||||
registerSpell(SpellDisguise::new);
|
||||
registerSpell(SpellNecromancy::new);
|
||||
registerSpell(SpellAwkward::new);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
|
|
@ -33,6 +33,9 @@ item.corrupted_gem.enchanted.name=Fractured Gem of %s
|
|||
spell.shield.name=Defense
|
||||
spell.shield.tagline=Protection I
|
||||
|
||||
spell.awkward.name=Awkwardness
|
||||
spell.awkward.tagline=*Derp*
|
||||
|
||||
spell.portal.name=Transportation
|
||||
spell.portal.tagline=Teleportation I
|
||||
|
||||
|
@ -51,6 +54,9 @@ spell.ice.tagline=Ice I
|
|||
curse.shield.name=Repulsion
|
||||
curse.shield.tagline=Hostility I
|
||||
|
||||
curse.awkward.name=Awkwardness
|
||||
curse.awkward.tagline=*Derp*
|
||||
|
||||
curse.vortex.name=Suffering
|
||||
curse.vortex.tagline=Torture I
|
||||
|
||||
|
|
Loading…
Reference in a new issue