Implement Striker Mode. Many many bugfixes and continued improvements to

the Artifact Ability System
This commit is contained in:
sigonasr2 2016-07-13 23:51:37 -05:00
parent c9c8906b5d
commit eab2feb56c
7 changed files with 563 additions and 373 deletions

Binary file not shown.

View File

@ -77,7 +77,7 @@ public class AwakenedArtifact {
if (totalval>=1000) { if (totalval>=1000) {
//LEVEL UP! //LEVEL UP!
ItemStack item = addLV(artifact,totalval/1000, p); ItemStack item = addLV(artifact,totalval/1000, p);
item = setEXP(item,totalval-1000); item = setEXP(item,totalval%1000);
item = addAP(item,1); item = addAP(item,1);
double potentialred = 10.0d; double potentialred = 10.0d;
potentialred/=1+(ArtifactAbility.calculateValue(ArtifactAbility.PRESERVATION, artifact.getEnchantmentLevel(Enchantment.LUCK), ArtifactAbility.getEnchantmentLevel(ArtifactAbility.PRESERVATION, artifact))/100d); potentialred/=1+(ArtifactAbility.calculateValue(ArtifactAbility.PRESERVATION, artifact.getEnchantmentLevel(Enchantment.LUCK), ArtifactAbility.getEnchantmentLevel(ArtifactAbility.PRESERVATION, artifact))/100d);

View File

@ -39,8 +39,8 @@ public enum ArtifactAbility {
new double[]{1.0,1.0,0.9,0.9,0.8,0.8,0.7,0.7,0.6,0.5},100,1,UpgradePath.WEAPON), new double[]{1.0,1.0,0.9,0.9,0.8,0.8,0.7,0.7,0.6,0.5},100,1,UpgradePath.WEAPON),
CRIT_DMG("Crit Damage","Critical Strikes deal [VAL]% damage.",new double[]{210.0,210.0,210.0,210.0,210.0,210.0,210.0,210.0,210.0,210.0}, CRIT_DMG("Crit Damage","Critical Strikes deal [VAL]% damage.",new double[]{210.0,210.0,210.0,210.0,210.0,210.0,210.0,210.0,210.0,210.0},
new double[]{5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0},100,1,UpgradePath.WEAPON), new double[]{5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0},100,1,UpgradePath.WEAPON),
HIGHWINDER("Highwinder","While moving, you deal [VAL] extra damage for every 1m of speed.",new double[]{0.1,0.125,0.150,0.175,0.2,0.225,0.250,0.275,0.3,0.35}, HIGHWINDER("Highwinder","While moving fast or sprinting, you deal [VAL] extra damage for every 1m of speed.",new double[]{0.18,0.225,0.27,0.315,0.36,0.405,0.45,0.495,0.54,0.61},
new double[]{0.7,0.675,0.65,0.625,0.6,0.575,0.55,0.525,0.5,0.475},100,15,UpgradePath.WEAPON), new double[]{0.675,0.65,0.625,0.6,0.575,0.55,0.525,0.5,0.475,0.45},100,15,UpgradePath.WEAPON),
//Bow Abilities //Bow Abilities
MARKSMAN("Marksman","Increases headshot hitbox size by [VAL]% .",new double[]{10.0,15,20,25,30,35,40,45,50,55}, MARKSMAN("Marksman","Increases headshot hitbox size by [VAL]% .",new double[]{10.0,15,20,25,30,35,40,45,50,55},
@ -66,8 +66,8 @@ public enum ArtifactAbility {
new double[]{4.0,3.85,3.70,3.55,3.40,3.25,3.10,2.95,2.80,2.65},100,1,UpgradePath.ARMOR), new double[]{4.0,3.85,3.70,3.55,3.40,3.25,3.10,2.95,2.80,2.65},100,1,UpgradePath.ARMOR),
SHADOWWALKER("Shadow Walker",ChatColor.GRAY+"Increases your speed in dark areas. Damage Reduction increases by [VAL]% in dark areas. Dodge chance increases by [DODGEVAL]% in dark areas.",new double[]{5,5,5,5,5,5,5,5,5,5}, SHADOWWALKER("Shadow Walker",ChatColor.GRAY+"Increases your speed in dark areas. Damage Reduction increases by [VAL]% in dark areas. Dodge chance increases by [DODGEVAL]% in dark areas.",new double[]{5,5,5,5,5,5,5,5,5,5},
new double[]{1.5,1.4,1.3,1.2,1.1,1.0,0.9,0.8,0.7,0.55},100,10,UpgradePath.ARMOR), new double[]{1.5,1.4,1.3,1.2,1.1,1.0,0.9,0.8,0.7,0.55},100,10,UpgradePath.ARMOR),
SURVIVOR("Survivor",ChatColor.GRAY+"[Unimplemented] Taking fatal damage will not kill you and instead consume this ability, removes all debuffs, and restoring your health.",new double[]{-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0}, /*SURVIVOR("Survivor",ChatColor.GRAY+"[Unimplemented] Taking fatal damage will not kill you and instead consume this ability, removes all debuffs, and restoring your health.",new double[]{-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0},
new double[]{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},1,1000,UpgradePath.ARMOR), new double[]{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},1,1000,UpgradePath.ARMOR),*/
DODGE("Dodge",ChatColor.GRAY+"You have a [VAL]% chance to dodge incoming damage from any damage source.",new double[]{0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55}, DODGE("Dodge",ChatColor.GRAY+"You have a [VAL]% chance to dodge incoming damage from any damage source.",new double[]{0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55},
new double[]{1.0,1.0,1.0,0.8,0.7,0.6,0.5,0.4,0.3,0.2},100,40,UpgradePath.ARMOR), new double[]{1.0,1.0,1.0,0.8,0.7,0.6,0.5,0.4,0.3,0.2},100,40,UpgradePath.ARMOR),
GRACEFULDODGE("Graceful Dodge","Whenever a dodge occurs, you will gain [VAL] seconds of invulnerability.",new double[]{0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.5}, GRACEFULDODGE("Graceful Dodge","Whenever a dodge occurs, you will gain [VAL] seconds of invulnerability.",new double[]{0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.5},
@ -542,7 +542,7 @@ public enum ArtifactAbility {
text=DisplayAbility(HEALTH_REGEN,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");} text=DisplayAbility(HEALTH_REGEN,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
text=DisplayAbility(STATUS_EFFECT_RESISTANCE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");} text=DisplayAbility(STATUS_EFFECT_RESISTANCE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
text=DisplayAbility(SHADOWWALKER,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");} text=DisplayAbility(SHADOWWALKER,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
text=DisplayAbility(SURVIVOR,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");} //text=DisplayAbility(SURVIVOR,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
text=DisplayAbility(DODGE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");} text=DisplayAbility(DODGE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
text=DisplayAbility(GRACEFULDODGE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");} text=DisplayAbility(GRACEFULDODGE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
} else } else

View File

@ -32,6 +32,7 @@ import com.google.common.collect.Iterables;
import sig.plugin.TwosideKeeper.Artifact; import sig.plugin.TwosideKeeper.Artifact;
import sig.plugin.TwosideKeeper.AwakenedArtifact; import sig.plugin.TwosideKeeper.AwakenedArtifact;
import sig.plugin.TwosideKeeper.MonsterController; import sig.plugin.TwosideKeeper.MonsterController;
import sig.plugin.TwosideKeeper.PlayerStructure;
import sig.plugin.TwosideKeeper.TwosideKeeper; import sig.plugin.TwosideKeeper.TwosideKeeper;
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility; import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility;
import sig.plugin.TwosideKeeper.HelperStructures.WorldShop; import sig.plugin.TwosideKeeper.HelperStructures.WorldShop;
@ -179,10 +180,10 @@ public class GenericFunctions {
int breaks_remaining=-1; int breaks_remaining=-1;
int loreline=-1; int loreline=-1;
for (int i=0;i<item_meta.getLore().size();i++) { for (int i=0;i<item_meta.getLore().size();i++) {
TwosideKeeper.log("Line is "+item_meta.getLore().get(i),2); TwosideKeeper.log("Line is "+item_meta.getLore().get(i),4);
TwosideKeeper.log("Checking for "+ChatColor.GRAY+"Breaks Remaining: "+((!isObscure)?ChatColor.YELLOW:ChatColor.MAGIC),2); TwosideKeeper.log("Checking for "+ChatColor.GRAY+"Breaks Remaining: "+((!isObscure)?ChatColor.YELLOW:ChatColor.MAGIC),4);
if (item_meta.getLore().get(i).contains(ChatColor.GRAY+"Breaks Remaining: "+((!isObscure)?ChatColor.YELLOW:ChatColor.MAGIC))) { if (item_meta.getLore().get(i).contains(ChatColor.GRAY+"Breaks Remaining: "+((!isObscure)?ChatColor.YELLOW:ChatColor.MAGIC))) {
TwosideKeeper.log("Line is "+item_meta.getLore().get(i),2); TwosideKeeper.log("Line is "+item_meta.getLore().get(i),3);
loreline = i; loreline = i;
break; break;
} }
@ -1716,13 +1717,24 @@ public class GenericFunctions {
} }
} }
public static boolean isDefender(LivingEntity p) { public static boolean isDefender(Player p) {
if (p.getEquipment().getItemInMainHand()!=null && p.getEquipment().getItemInMainHand().getType()==Material.SHIELD) { if (p.getEquipment().getItemInMainHand()!=null && p.getEquipment().getItemInMainHand().getType()==Material.SHIELD) {
return true; return true;
} else { } else {
return false; return false;
} }
} }
public static boolean isStriker(Player p) {
if (p.getEquipment().getItemInMainHand()!=null && p.getEquipment().getItemInMainHand().getType().toString().contains("SWORD") &&
p.getInventory().getExtraContents()[0]==null) {
return true;
} else {
return false;
}
}
public static boolean holdingNoShield(Player p) {
return p.getInventory().getExtraContents()[0]==null;
}
public static boolean isRareItem(ItemStack it) { public static boolean isRareItem(ItemStack it) {
if (((it.getItemMeta().hasDisplayName() && (it.getItemMeta().getDisplayName().contains("Mega") || if (((it.getItemMeta().hasDisplayName() && (it.getItemMeta().getDisplayName().contains("Mega") ||
@ -2060,6 +2072,12 @@ public class GenericFunctions {
p.isOnGround() && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=4) { p.isOnGround() && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=4) {
dodgechance+=0.01*p.getEquipment().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK); dodgechance+=0.01*p.getEquipment().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK);
} }
PlayerStructure pd = (PlayerStructure)TwosideKeeper.playerdata.get(p.getUniqueId());
if (isStriker(p) &&
pd.velocity>0) {
dodgechance+=0.2;
}
return dodgechance; return dodgechance;
} }
@ -2107,7 +2125,7 @@ public class GenericFunctions {
} }
public static void DealDamageToMob(double dmg, LivingEntity target, LivingEntity damager, boolean truedmg) { public static void DealDamageToMob(double dmg, LivingEntity target, LivingEntity damager, boolean truedmg) {
if (damager!=null && (target instanceof Monster)) { if (damager!=null && (target instanceof Monster) && !target.isDead()) {
Monster m = (Monster)target; Monster m = (Monster)target;
m.setTarget(damager); m.setTarget(damager);
} }
@ -2122,19 +2140,38 @@ public class GenericFunctions {
Monster m = (Monster)target; Monster m = (Monster)target;
m.setTarget(damager); m.setTarget(damager);
} }
if (target.getHealth()>dmg) { if (target.getHealth()>finaldmg) {
target.setHealth(target.getHealth()-dmg); target.setHealth(target.getHealth()-finaldmg);
if (damager!=null) { if (damager!=null) {
target.damage(0.01); target.damage(0.01);
if (target instanceof Monster) {
Monster m = (Monster)target;
m.setTarget(damager);
}
} else { } else {
target.damage(0.01,damager); target.damage(0.01,damager);
} }
} else { } else {
target.setHealth(0); if (target instanceof Monster) {
Monster m = (Monster)target;
m.setTarget(damager);
}
target.setHealth(0.0001);
target.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
if (damager!=null) { if (damager!=null) {
target.damage(0.01); target.damage(0.1);
if (target instanceof Monster) {
Monster m = (Monster)target;
m.setTarget(damager);
}
if (!(target instanceof Player)) {
target.setHealth(0.0);
}
} else { } else {
target.damage(0.01,damager); target.damage(0.1,damager);
if (!(target instanceof Player)) {
target.setHealth(0.0);
}
} }
} }
} }

View File

@ -54,9 +54,12 @@ public class PlayerStructure {
public boolean sounds_enabled=true; public boolean sounds_enabled=true;
public double velocity; public double velocity;
public long last_deathmark=TwosideKeeper.getServerTickTime(); public long last_deathmark=TwosideKeeper.getServerTickTime();
public long last_shovelspell=TwosideKeeper.getServerTickTime(); public long last_shovelspell=TwosideKeeper.getServerTickTime()+300;
public int swordcombo=0; public int swordcombo=0;
public long last_swordhit=TwosideKeeper.getServerTickTime(); public long last_swordhit=TwosideKeeper.getServerTickTime();
public long last_strikerspell=TwosideKeeper.getServerTickTime();
public boolean highwinder=false;
public double highwinderdmg=0.0;
public double prev_weapondmg=0.0; public double prev_weapondmg=0.0;
public double prev_buffdmg=0.0; public double prev_buffdmg=0.0;
@ -90,9 +93,12 @@ public class PlayerStructure {
this.sounds_enabled=true; this.sounds_enabled=true;
this.debuffcount=0; this.debuffcount=0;
this.last_deathmark=TwosideKeeper.getServerTickTime(); this.last_deathmark=TwosideKeeper.getServerTickTime();
this.last_shovelspell=TwosideKeeper.getServerTickTime(); this.last_shovelspell=TwosideKeeper.getServerTickTime()+300;
this.swordcombo=0; this.swordcombo=0;
this.last_swordhit=TwosideKeeper.getServerTickTime(); this.last_swordhit=TwosideKeeper.getServerTickTime();
this.highwinder=false;
this.highwinderdmg=0.0;
this.last_strikerspell=TwosideKeeper.getServerTickTime();
//Set defaults first, in case this is a new user. //Set defaults first, in case this is a new user.
loadConfig(); loadConfig();

File diff suppressed because it is too large Load Diff

View File

@ -131,6 +131,12 @@ public final class TwosideKeeperAPI {
public static double getModifiedDamage(double dmg_amt, LivingEntity p) { public static double getModifiedDamage(double dmg_amt, LivingEntity p) {
return TwosideKeeper.CalculateDamageReduction(dmg_amt, p, p); return TwosideKeeper.CalculateDamageReduction(dmg_amt, p, p);
} }
public static void DealModifiedDamageToEntity(int dmg, LivingEntity damager, LivingEntity target) {
GenericFunctions.DealDamageToMob(dmg, target, damager, false);
}
public static void DealTrueDamageToEntity(int dmg, LivingEntity damager, LivingEntity target) {
GenericFunctions.DealDamageToMob(dmg, target, damager, true);
}
public static void DealModifiedDamageToEntity(ItemStack weapon, LivingEntity damager, LivingEntity target) { public static void DealModifiedDamageToEntity(ItemStack weapon, LivingEntity damager, LivingEntity target) {
TwosideKeeper.DealDamageToMob(weapon, damager, target); TwosideKeeper.DealDamageToMob(weapon, damager, target);
} }