Skip to content

Commit

Permalink
Merge pull request #24 from Zereff06/cap_shadow_beam
Browse files Browse the repository at this point in the history
useful focus shadow beam
  • Loading branch information
Dream-Master authored Jan 15, 2023
2 parents 2ee65a2 + 73bf026 commit 9412931
Showing 1 changed file with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@

public class ItemFocusShadowbeam extends ItemModKamiFocus {

private static final AspectList visUsage = new AspectList().add(Aspect.ORDER, 25).add(Aspect.ENTROPY, 25).add(Aspect.AIR, 15);
private static final AspectList visUsage = new AspectList().add(Aspect.ORDER, 500).add(Aspect.ENTROPY, 500).add(Aspect.AIR, 300);

private static final int DAMAGE = 100;

public ItemFocusShadowbeam() {
super();

EntityRegistry.registerModEntity(Beam.class, "ShadowbeamStaffBeam", 0, ThaumicTinkerer.instance, 0, 0, false);
}

public String getSortingHelper(ItemStack itemstack)
{
return "TTKSH" + super.getSortingHelper(itemstack);
Expand All @@ -52,7 +54,7 @@ public String getSortingHelper(ItemStack itemstack)
@Override
public void onUsingFocusTick(ItemStack stack, EntityPlayer player, int count) {
ItemWandCasting wand = (ItemWandCasting) stack.getItem();
int potency = wand.getFocusPotency(stack); //TODO verify effect
int potency = wand.getFocusPotency(stack);

if (!player.worldObj.isRemote && wand.consumeAllVis(stack, player, getVisCost(stack), true, false)) {

Expand Down Expand Up @@ -83,22 +85,22 @@ public int getFocusColor(ItemStack stack) {
public AspectList getVisCost(ItemStack stack) {
return visUsage;
}

@Override
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemstack, int rank)
{
switch (rank)
{
case 1:
return new FocusUpgradeType[] { FocusUpgradeType.frugal/*, FocusUpgradeType.potency*/};
case 2:
return new FocusUpgradeType[] { FocusUpgradeType.frugal/*, FocusUpgradeType.potency*/};
case 3:
return new FocusUpgradeType[] { FocusUpgradeType.frugal/*, FocusUpgradeType.potency*/};
case 4:
return new FocusUpgradeType[] { FocusUpgradeType.frugal/*, FocusUpgradeType.potency*/};
case 5:
return new FocusUpgradeType[] { FocusUpgradeType.frugal/*, FocusUpgradeType.potency*/};
case 1:
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency};
case 2:
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency};
case 3:
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency};
case 4:
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency};
case 5:
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency};
}
return null;
}
Expand Down Expand Up @@ -180,7 +182,7 @@ public static class Beam extends EntityThrowable {
private int initialOffset = 2;
private int length = 298;
private int maxTicks = initialOffset + length;
private int size = 4;
private int size = 2;

private int potency;
private Vector3 movementVector;
Expand Down Expand Up @@ -234,8 +236,10 @@ protected void onImpact(MovingObjectPosition movingobjectposition) {
return;

if (movingobjectposition.entityHit != null) {
if ((MinecraftServer.getServer().isPVPEnabled() || !(movingobjectposition.entityHit instanceof EntityPlayer)) && movingobjectposition.entityHit != getThrower() && getThrower() instanceof EntityPlayer && !movingobjectposition.entityHit.worldObj.isRemote)
movingobjectposition.entityHit.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) getThrower()), 8 + potency);
if ((MinecraftServer.getServer().isPVPEnabled() || !(movingobjectposition.entityHit instanceof EntityPlayer)) && movingobjectposition.entityHit != getThrower() && getThrower() instanceof EntityPlayer && !movingobjectposition.entityHit.worldObj.isRemote) {
int fullDamage = (potency>0)? (int) (DAMAGE + DAMAGE * (0.2 * potency)): DAMAGE;
movingobjectposition.entityHit.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) getThrower()), fullDamage);
}
return;
}

Expand Down

0 comments on commit 9412931

Please sign in to comment.