v1.2.1
This commit is contained in:
1 parent
eef0a7d2a0
commit
f5378eaa38
16 files changed
+661
-89
No files matched your search
@@ -10,18 +10,124 @@ import net.neoforged.neoforge.common.ModConfigSpec;
|
||||
public class Config {
|
||||
public static final ModConfigSpec SPEC;
|
||||
|
||||
public static final ModConfigSpec.DoubleValue ENCHANTED_SWORD_DAMAGE;
|
||||
public static final ModConfigSpec.IntValue ENCHANTED_SWORD_LIFETIME;
|
||||
public static final ModConfigSpec.DoubleValue ENCHANTED_SWORD_SPEED;
|
||||
|
||||
public static final ModConfigSpec.IntValue BEE_KEEPER_MAX_BEES;
|
||||
public static final ModConfigSpec.IntValue BEE_KEEPER_CONFUSION_DURATION;
|
||||
public static final ModConfigSpec.DoubleValue BEE_KEEPER_BEE_DAMAGE;
|
||||
|
||||
public static final ModConfigSpec.DoubleValue STARFURY_DAMAGE;
|
||||
public static final ModConfigSpec.DoubleValue STARFURY_MAX_RANGE;
|
||||
public static final ModConfigSpec.DoubleValue STARFURY_SPEED;
|
||||
|
||||
public static final ModConfigSpec.DoubleValue SEEDLER_NUT_GRAVITY;
|
||||
public static final ModConfigSpec.DoubleValue SEEDLER_NUT_BOUNCE;
|
||||
public static final ModConfigSpec.DoubleValue SEEDLER_NUT_INITIAL_SPEED;
|
||||
public static final ModConfigSpec.DoubleValue SEEDLER_THORN_DAMAGE;
|
||||
public static final ModConfigSpec.IntValue SEEDLER_THORN_LIFETIME;
|
||||
public static final ModConfigSpec.DoubleValue SEEDLER_THORN_SPEED;
|
||||
|
||||
public static final ModConfigSpec.IntValue HORSEMANS_BLADE_ROTATE_RANGE;
|
||||
public static final ModConfigSpec.IntValue HORSEMANS_BLADE_MAX_HIT_COUNT;
|
||||
public static final ModConfigSpec.DoubleValue HORSEMANS_BLADE_DAMAGE;
|
||||
public static final ModConfigSpec.DoubleValue HORSEMANS_PUMPKIN_SPAWN_RANGE;
|
||||
public static final ModConfigSpec.DoubleValue HORSEMANS_PUMPKIN_SPEED;
|
||||
public static final ModConfigSpec.DoubleValue HORSEMANS_PUMPKIN_DAMAGE;
|
||||
public static final ModConfigSpec.DoubleValue HORSEMANS_PUMPKIN_MAX_TARGET_RANGE;
|
||||
|
||||
public static final ModConfigSpec.DoubleValue INFLUX_WAVER_DAMAGE;
|
||||
public static final ModConfigSpec.IntValue INFLUX_WAVER_MAX_COUNT;
|
||||
public static final ModConfigSpec.DoubleValue INFLUX_WAVER_SPEED;
|
||||
public static final ModConfigSpec.DoubleValue INFLUX_WAVER_SPAWN_RANGE;
|
||||
public static final ModConfigSpec.DoubleValue INFLUX_WAVER_TARGET_RANGE;
|
||||
|
||||
public static final ModConfigSpec.DoubleValue STAR_WRATH_DAMAGE;
|
||||
public static final ModConfigSpec.DoubleValue STAR_WRATH_SPEED;
|
||||
public static final ModConfigSpec.DoubleValue STAR_WRATH_MAX_RANGE;
|
||||
|
||||
public static final ModConfigSpec.DoubleValue MEOWMERE_DAMAGE;
|
||||
public static final ModConfigSpec.DoubleValue MEOWMERE_GRAVITY;
|
||||
public static final ModConfigSpec.DoubleValue MEOWMERE_INITIAL_SPEED;
|
||||
|
||||
public static final ModConfigSpec.BooleanValue TERRA_PROJECTILE_ALIGN_TO_BLADE;
|
||||
public static final ModConfigSpec.IntValue TERRA_BLADE_ROTATE_RANGE;
|
||||
public static final ModConfigSpec.IntValue TERRA_PROJECTILE_ROTATE_RANGE;
|
||||
public static final ModConfigSpec.IntValue TERRA_BLADE_MAX_HIT_COUNT;
|
||||
public static final ModConfigSpec.DoubleValue TERRA_BLADE_DAMAGE;
|
||||
public static final ModConfigSpec.DoubleValue TERRA_PROJECTILE_DAMAGE;
|
||||
public static final ModConfigSpec.DoubleValue TERRA_PROJECTILE_SPEED;
|
||||
public static final ModConfigSpec.IntValue TERRA_PROJECTILE_LIFETIME;
|
||||
public static final ModConfigSpec.DoubleValue TERRA_PROJECTILE_DAMAGE_DECAY;
|
||||
|
||||
public static final ModConfigSpec.DoubleValue ZENITH_DAMAGE;
|
||||
public static final ModConfigSpec.DoubleValue ZENITH_MAX_RANGE;
|
||||
public static final ModConfigSpec.DoubleValue ZENITH_TRAIL_B;
|
||||
public static final ModConfigSpec.IntValue ZENITH_TRAIL_OFFSET;
|
||||
public static final ModConfigSpec.IntValue ZENITH_WEAPON_COUNT;
|
||||
public static final ModConfigSpec.DoubleValue ZENITH_BOUNDING_BOX_SIZE;
|
||||
public static final ModConfigSpec.IntValue ZENITH_CYCLE;
|
||||
public static final ModConfigSpec.DoubleValue ZENITH_SCALE;
|
||||
public static final ModConfigSpec.DoubleValue ZENITH_TRAIL_ALPHA;
|
||||
public static final ModConfigSpec.IntValue ZENITH_TRAIL_MAX_LENGTH;
|
||||
|
||||
public static double enchantedSwordDamage;
|
||||
public static int enchantedSwordLifetime;
|
||||
public static double enchantedSwordSpeed;
|
||||
|
||||
public static int beeKeeperMaxBees;
|
||||
public static int beeKeeperConfusionDuration;
|
||||
public static double beeKeeperBeeDamage;
|
||||
|
||||
public static double starfuryDamage;
|
||||
public static double starfuryMaxRange;
|
||||
public static double starfurySpeed;
|
||||
|
||||
public static double seedlerNutGravity;
|
||||
public static double seedlerNutBounce;
|
||||
public static double seedlerNutInitialSpeed;
|
||||
public static double seedlerThornDamage;
|
||||
public static int seedlerThornLifetime;
|
||||
public static double seedlerThornSpeed;
|
||||
|
||||
public static int horsemansBladeRotateRange;
|
||||
public static int horsemansBladeMaxHitCount;
|
||||
public static double horsemansBladeDamage;
|
||||
public static double horsemansPumpkinSpawnRange;
|
||||
public static double horsemansPumpkinSpeed;
|
||||
public static double horsemansPumpkinDamage;
|
||||
public static double horsemansPumpkinMaxTargetRange;
|
||||
|
||||
public static double influxWaverDamage;
|
||||
public static int influxWaverMaxCount;
|
||||
public static double influxWaverSpeed;
|
||||
public static double influxWaverSpawnRange;
|
||||
public static double influxWaverTargetRange;
|
||||
|
||||
public static double starWrathDamage;
|
||||
public static double starWrathSpeed;
|
||||
public static double starWrathMaxRange;
|
||||
|
||||
public static double meowmereDamage;
|
||||
public static double meowmereGravity;
|
||||
public static double meowmereInitialSpeed;
|
||||
|
||||
public static boolean terraProjectileAlignToBlade;
|
||||
public static int terraBladeRotateRange;
|
||||
public static int terraProjectileRotateRange;
|
||||
public static int terraBladeMaxHitCount;
|
||||
public static double terraBladeDamage;
|
||||
public static double terraProjectileDamage;
|
||||
public static double terraProjectileSpeed;
|
||||
public static int terraProjectileLifetime;
|
||||
public static double terraProjectileDamageDecay;
|
||||
|
||||
public static double zenithDamage;
|
||||
public static double zenithMaxRange;
|
||||
public static double zenithTrailB;
|
||||
public static int zenithTrailOffset;
|
||||
public static int zenithWeaponCount;
|
||||
public static double zenithBoundingBoxSize;
|
||||
public static int zenithCycle;
|
||||
public static double zenithScale;
|
||||
@@ -31,11 +137,224 @@ public class Config {
|
||||
static {
|
||||
ModConfigSpec.Builder builder = new ModConfigSpec.Builder();
|
||||
|
||||
builder.push("enchanted_sword_settings");
|
||||
|
||||
ENCHANTED_SWORD_DAMAGE = builder
|
||||
.comment("弹射伤害")
|
||||
.defineInRange("enchanted_sword_damage", 4.0, 0, 2147483647);
|
||||
|
||||
ENCHANTED_SWORD_LIFETIME = builder
|
||||
.comment("弹射持续时间")
|
||||
.defineInRange("enchanted_sword_lifetime", 60, 1, 1200);
|
||||
|
||||
ENCHANTED_SWORD_SPEED = builder
|
||||
.comment("弹射速度")
|
||||
.defineInRange("enchanted_sword_speed", 1.0, 0, 10);
|
||||
|
||||
builder.pop();
|
||||
|
||||
|
||||
builder.push("bee_keeper_settings");
|
||||
|
||||
BEE_KEEPER_MAX_BEES = builder
|
||||
.comment("最大蜜蜂生成数量")
|
||||
.defineInRange("bee_keeper_max_bees", 3, 0, 10);
|
||||
|
||||
BEE_KEEPER_CONFUSION_DURATION = builder
|
||||
.comment("困惑持续时间")
|
||||
.defineInRange("bee_keeper_confusion_duration", 40, 0, 1200);
|
||||
|
||||
BEE_KEEPER_BEE_DAMAGE = builder
|
||||
.comment("蜜蜂的攻击伤害")
|
||||
.defineInRange("bee_keeper_bee_damage", 2.0, 0, 2147483647);
|
||||
|
||||
builder.pop();
|
||||
|
||||
|
||||
builder.push("starfury_settings");
|
||||
|
||||
STARFURY_DAMAGE = builder
|
||||
.comment("弹射伤害")
|
||||
.defineInRange("starfury_damage", 6.0, 0, 2147483647);
|
||||
|
||||
STARFURY_MAX_RANGE = builder
|
||||
.comment("最大范围")
|
||||
.defineInRange("starfury_max_range", 24.0, 1.0, 1024.0);
|
||||
|
||||
STARFURY_SPEED = builder
|
||||
.comment("弹射速度")
|
||||
.defineInRange("starfury_speed", 2.0, 0, 10);
|
||||
|
||||
builder.pop();
|
||||
|
||||
|
||||
builder.push("seedler_settings");
|
||||
|
||||
SEEDLER_NUT_GRAVITY = builder
|
||||
.comment("坚果重力")
|
||||
.defineInRange("seedler_nut_gravity", 0.075, 0.0, 1.0);
|
||||
|
||||
SEEDLER_NUT_BOUNCE = builder
|
||||
.comment("坚果弹力")
|
||||
.defineInRange("seedler_nut_bounce", 0.5, 0.0, 1.0);
|
||||
|
||||
SEEDLER_NUT_INITIAL_SPEED = builder
|
||||
.comment("坚果初速度")
|
||||
.defineInRange("seedler_nut_initial_speed", 0.75, 0, 10.0);
|
||||
|
||||
SEEDLER_THORN_DAMAGE = builder
|
||||
.comment("荆棘伤害")
|
||||
.defineInRange("seedler_thorn_damage", 2.0, 0, 2147483647);
|
||||
|
||||
SEEDLER_THORN_LIFETIME = builder
|
||||
.comment("荆棘持续时间")
|
||||
.defineInRange("seedler_thorn_lifetime", 30, 1, 1200);
|
||||
|
||||
SEEDLER_THORN_SPEED = builder
|
||||
.comment("荆棘速度")
|
||||
.defineInRange("seedler_thorn_speed", 2.0, 0, 10);
|
||||
|
||||
builder.pop();
|
||||
|
||||
|
||||
builder.push("horsemans_blade_settings");
|
||||
|
||||
HORSEMANS_BLADE_ROTATE_RANGE = builder
|
||||
.comment("刀光偏转角范围")
|
||||
.defineInRange("horsemans_blade_rotate_range", 45, 0, 90);
|
||||
|
||||
HORSEMANS_BLADE_MAX_HIT_COUNT = builder
|
||||
.comment("刀光单次最大击中生物数量")
|
||||
.defineInRange("horsemans_blade_max_hit_count", 3, 0, 100);
|
||||
|
||||
HORSEMANS_BLADE_DAMAGE = builder
|
||||
.comment("刀光伤害")
|
||||
.defineInRange("horsemans_blade_damage", 15.0, 0, 2147483647.0);
|
||||
|
||||
HORSEMANS_PUMPKIN_SPAWN_RANGE = builder
|
||||
.comment("南瓜生成范围")
|
||||
.defineInRange("horsemans_pumpkin_spawn_range", 16.0, 1.0, 64.0);
|
||||
|
||||
HORSEMANS_PUMPKIN_SPEED = builder
|
||||
.comment("南瓜速度")
|
||||
.defineInRange("horsemans_pumpkin_speed", 0.5, 0, 10);
|
||||
|
||||
HORSEMANS_PUMPKIN_DAMAGE = builder
|
||||
.comment("南瓜伤害")
|
||||
.defineInRange("horsemans_pumpkin_damage", 15.0, 0, 2147483647.0);
|
||||
|
||||
HORSEMANS_PUMPKIN_MAX_TARGET_RANGE = builder
|
||||
.comment("南瓜最大寻敌范围")
|
||||
.defineInRange("horsemans_pumpkin_max_target_range", 32.0, 1.0, 64.0);
|
||||
|
||||
builder.pop();
|
||||
|
||||
|
||||
builder.push("influx_waver_settings");
|
||||
|
||||
INFLUX_WAVER_DAMAGE = builder
|
||||
.comment("弹射伤害")
|
||||
.defineInRange("influx_waver_damage", 12.0, 0, 2147483647.0);
|
||||
|
||||
INFLUX_WAVER_MAX_COUNT = builder
|
||||
.comment("弹射最大生成数量")
|
||||
.defineInRange("influx_waver_max_count", 2, 0, 10);
|
||||
|
||||
INFLUX_WAVER_SPEED = builder
|
||||
.comment("弹射速度")
|
||||
.defineInRange("influx_waver_speed", 1.0, 0, 10);
|
||||
|
||||
INFLUX_WAVER_SPAWN_RANGE = builder
|
||||
.comment("弹射生成范围")
|
||||
.defineInRange("influx_waver_spawn_range", 8.0, 1.0, 64.0);
|
||||
|
||||
INFLUX_WAVER_TARGET_RANGE = builder
|
||||
.comment("弹射寻敌范围")
|
||||
.defineInRange("influx_waver_target_range", 24.0, 1.0, 64.0);
|
||||
|
||||
builder.pop();
|
||||
|
||||
|
||||
builder.push("star_wrath_settings");
|
||||
|
||||
STAR_WRATH_DAMAGE = builder
|
||||
.comment("弹射伤害")
|
||||
.defineInRange("star_wrath_damage", 16.0, 0, 2147483647.0);
|
||||
|
||||
STAR_WRATH_SPEED = builder
|
||||
.comment("弹射速度")
|
||||
.defineInRange("star_wrath_speed", 2.0, 0, 10);
|
||||
|
||||
STAR_WRATH_MAX_RANGE = builder
|
||||
.comment("最大范围")
|
||||
.defineInRange("star_wrath_max_range", 48.0, 1.0, 1024.0);
|
||||
|
||||
builder.pop();
|
||||
|
||||
|
||||
builder.push("meowmere_settings");
|
||||
|
||||
MEOWMERE_DAMAGE = builder
|
||||
.comment("弹射伤害")
|
||||
.defineInRange("meowmere_damage", 20.0, 0, 2147483647.0);
|
||||
|
||||
MEOWMERE_GRAVITY = builder
|
||||
.comment("弹射重力")
|
||||
.defineInRange("meowmere_gravity", 0.025, 0.0, 1.0);
|
||||
|
||||
MEOWMERE_INITIAL_SPEED = builder
|
||||
.comment("弹射初速度")
|
||||
.defineInRange("meowmere_initial_speed", 1.5, 0, 10);
|
||||
|
||||
builder.pop();
|
||||
|
||||
|
||||
builder.push("terra_blade_settings");
|
||||
|
||||
TERRA_PROJECTILE_ALIGN_TO_BLADE = builder
|
||||
.comment("弹射是否匹配刀光方向")
|
||||
.define("terra_projectile_align_to_blade", true);
|
||||
|
||||
TERRA_BLADE_ROTATE_RANGE = builder
|
||||
.comment("刀光偏转角范围")
|
||||
.defineInRange("terra_blade_rotate_range", 30, 0, 90);
|
||||
|
||||
TERRA_PROJECTILE_ROTATE_RANGE = builder
|
||||
.comment("弹射偏转角范围")
|
||||
.defineInRange("terra_projectile_rotate_range", 30, 0, 90);
|
||||
|
||||
TERRA_BLADE_MAX_HIT_COUNT = builder
|
||||
.comment("刀光单次最大击中生物数量")
|
||||
.defineInRange("terra_blade_max_hit_count", 3, 0, 100);
|
||||
|
||||
TERRA_BLADE_DAMAGE = builder
|
||||
.comment("刀光伤害")
|
||||
.defineInRange("terra_blade_damage", 11.0, 0, 2147483647.0);
|
||||
|
||||
TERRA_PROJECTILE_DAMAGE = builder
|
||||
.comment("弹射伤害")
|
||||
.defineInRange("terra_projectile_damage", 11.0, 0, 2147483647.0);
|
||||
|
||||
TERRA_PROJECTILE_SPEED = builder
|
||||
.comment("弹射速度")
|
||||
.defineInRange("terra_projectile_speed", 2.0, 0, 10);
|
||||
|
||||
TERRA_PROJECTILE_LIFETIME = builder
|
||||
.comment("弹射持续时间")
|
||||
.defineInRange("terra_projectile_lifetime", 60, 1, 1200);
|
||||
|
||||
TERRA_PROJECTILE_DAMAGE_DECAY = builder
|
||||
.comment("弹射伤害递减系数")
|
||||
.defineInRange("terra_projectile_damage_decay", 0.75, 0.0, 1.0);
|
||||
|
||||
builder.pop();
|
||||
|
||||
|
||||
builder.push("zenith_settings");
|
||||
|
||||
ZENITH_DAMAGE = builder
|
||||
.comment("弹射单次伤害x-2x")
|
||||
.defineInRange("zenith_damage", 4.0, 1.0, 114514.0);
|
||||
.defineInRange("zenith_damage", 4.0, 1.0, 2147483647);
|
||||
|
||||
ZENITH_MAX_RANGE = builder
|
||||
.comment("最大范围(2a)")
|
||||
@@ -45,6 +364,14 @@ public class Config {
|
||||
.comment("椭圆轨道半短轴(b)")
|
||||
.defineInRange("zenith_trail_b", 4.0, 0.1, 512.0);
|
||||
|
||||
ZENITH_TRAIL_OFFSET = builder
|
||||
.comment("轨道偏转角范围")
|
||||
.defineInRange("zenith_trail_offset", 30, 0, 90);
|
||||
|
||||
ZENITH_WEAPON_COUNT = builder
|
||||
.comment("单把武器实际数量")
|
||||
.defineInRange("zenith_weapon_count", 3, 1, 3);
|
||||
|
||||
ZENITH_BOUNDING_BOX_SIZE = builder
|
||||
.comment("弹射碰撞箱大小")
|
||||
.defineInRange("zenith_bounding_box_size", 1.5, 0.1, 4.0);
|
||||
@@ -73,9 +400,53 @@ public class Config {
|
||||
@SubscribeEvent
|
||||
static void onLoad(final ModConfigEvent event) {
|
||||
if(event.getConfig().getSpec() == SPEC) {
|
||||
enchantedSwordDamage = ENCHANTED_SWORD_DAMAGE.get();
|
||||
enchantedSwordLifetime = ENCHANTED_SWORD_LIFETIME.get();
|
||||
enchantedSwordSpeed = ENCHANTED_SWORD_SPEED.get();
|
||||
beeKeeperMaxBees = BEE_KEEPER_MAX_BEES.get();
|
||||
beeKeeperConfusionDuration = BEE_KEEPER_CONFUSION_DURATION.get();
|
||||
beeKeeperBeeDamage = BEE_KEEPER_BEE_DAMAGE.get();
|
||||
starfuryDamage = STARFURY_DAMAGE.get();
|
||||
starfuryMaxRange = STARFURY_MAX_RANGE.get();
|
||||
starfurySpeed = STARFURY_SPEED.get();
|
||||
seedlerNutGravity = SEEDLER_NUT_GRAVITY.get();
|
||||
seedlerNutBounce = SEEDLER_NUT_BOUNCE.get();
|
||||
seedlerNutInitialSpeed = SEEDLER_NUT_INITIAL_SPEED.get();
|
||||
seedlerThornDamage = SEEDLER_THORN_DAMAGE.get();
|
||||
seedlerThornLifetime = SEEDLER_THORN_LIFETIME.get();
|
||||
seedlerThornSpeed = SEEDLER_THORN_SPEED.get();
|
||||
horsemansBladeRotateRange = HORSEMANS_BLADE_ROTATE_RANGE.get();
|
||||
horsemansBladeMaxHitCount = HORSEMANS_BLADE_MAX_HIT_COUNT.get();
|
||||
horsemansBladeDamage = HORSEMANS_BLADE_DAMAGE.get();
|
||||
horsemansPumpkinSpawnRange = HORSEMANS_PUMPKIN_SPAWN_RANGE.get();
|
||||
horsemansPumpkinSpeed = HORSEMANS_PUMPKIN_SPEED.get();
|
||||
horsemansPumpkinDamage = HORSEMANS_PUMPKIN_DAMAGE.get();
|
||||
horsemansPumpkinMaxTargetRange = HORSEMANS_PUMPKIN_MAX_TARGET_RANGE.get();
|
||||
influxWaverDamage = INFLUX_WAVER_DAMAGE.get();
|
||||
influxWaverMaxCount = INFLUX_WAVER_MAX_COUNT.get();
|
||||
influxWaverSpeed = INFLUX_WAVER_SPEED.get();
|
||||
influxWaverSpawnRange = INFLUX_WAVER_SPAWN_RANGE.get();
|
||||
influxWaverTargetRange = INFLUX_WAVER_TARGET_RANGE.get();
|
||||
starWrathDamage = STAR_WRATH_DAMAGE.get();
|
||||
starWrathSpeed = STAR_WRATH_SPEED.get();
|
||||
starWrathMaxRange = STAR_WRATH_MAX_RANGE.get();
|
||||
meowmereDamage = MEOWMERE_DAMAGE.get();
|
||||
meowmereGravity = MEOWMERE_GRAVITY.get();
|
||||
meowmereInitialSpeed = MEOWMERE_INITIAL_SPEED.get();
|
||||
terraProjectileAlignToBlade = TERRA_PROJECTILE_ALIGN_TO_BLADE.get();
|
||||
terraBladeRotateRange = TERRA_BLADE_ROTATE_RANGE.get();
|
||||
terraProjectileRotateRange = TERRA_PROJECTILE_ROTATE_RANGE.get();
|
||||
terraBladeMaxHitCount = TERRA_BLADE_MAX_HIT_COUNT.get();
|
||||
terraBladeDamage = TERRA_BLADE_DAMAGE.get();
|
||||
terraProjectileDamage = TERRA_PROJECTILE_DAMAGE.get();
|
||||
terraProjectileSpeed = TERRA_PROJECTILE_SPEED.get();
|
||||
terraProjectileLifetime = TERRA_PROJECTILE_LIFETIME.get();
|
||||
terraProjectileDamageDecay = TERRA_PROJECTILE_DAMAGE_DECAY.get();
|
||||
zenithDamage = ZENITH_DAMAGE.get();
|
||||
zenithMaxRange = ZENITH_MAX_RANGE.get();
|
||||
zenithTrailB = ZENITH_TRAIL_B.get();
|
||||
zenithTrailOffset = ZENITH_TRAIL_OFFSET.get();
|
||||
zenithWeaponCount = ZENITH_WEAPON_COUNT.get();
|
||||
zenithBoundingBoxSize = ZENITH_BOUNDING_BOX_SIZE.get();
|
||||
zenithCycle = ZENITH_CYCLE.get();
|
||||
zenithScale = ZENITH_SCALE.get();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lzxnone.terraria.entity.summon;
|
||||
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.utils.MathUtil;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@@ -121,7 +122,7 @@ public class BeeSummon extends Bee {
|
||||
public boolean doHurtTarget(Entity target) {
|
||||
if(owner == null) return false;
|
||||
DamageSource damageSource = this.damageSources().mobAttack(owner);
|
||||
boolean isHurt = target.hurt(damageSource, (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE));
|
||||
boolean isHurt = target.hurt(damageSource, (float) Config.beeKeeperBeeDamage);
|
||||
|
||||
if(isHurt) {
|
||||
this.customAttackCount++;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lzxnone.terraria.item.weapon.melee;
|
||||
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.effect.ModEffects;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
@@ -49,11 +50,12 @@ public class BeeKeeper extends SwordItem {
|
||||
if(target instanceof LivingEntity livingTarget && FilterUtil.createLivingTargetFilter(player).test(livingTarget)) {
|
||||
livingTarget.addEffect(new MobEffectInstance(
|
||||
ModEffects.CONFUSED,
|
||||
40,
|
||||
Config.beeKeeperConfusionDuration,
|
||||
0
|
||||
));
|
||||
}
|
||||
int count = player.level().random.nextInt(3) + 1;
|
||||
|
||||
int count = Config.beeKeeperMaxBees > 0 ? player.level().random.nextInt(Config.beeKeeperMaxBees) + 1 : 0;
|
||||
while(count-- > 0) {
|
||||
BeeSummon bee = ModEntities.BEE_SUMMON.get().create(player.level());
|
||||
if(bee != null) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lzxnone.terraria.item.weapon.melee;
|
||||
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
@@ -69,7 +70,7 @@ public class EnchantedSword extends SwordItem {
|
||||
Entity owner = projectile.getOwner();
|
||||
if(owner == null) return;
|
||||
if(!FilterUtil.createLivingTargetFilter(owner).test(target) || !(owner instanceof Player player)) return;
|
||||
if(target.hurt(projectile.damageSources().playerAttack(player), 5.5f)) {
|
||||
if(target.hurt(projectile.damageSources().playerAttack(player), (float) Config.enchantedSwordDamage)) {
|
||||
target.invulnerableTime = 5;
|
||||
ParticleUtil.addParticles(
|
||||
(ServerLevel) projectile.level(), ModParticles.COLORFUL_PARTICLE,
|
||||
@@ -113,7 +114,8 @@ public class EnchantedSword extends SwordItem {
|
||||
projectile.getEntityData().set(StaticProjectile.RZP, 45);
|
||||
projectile.getEntityData().set(StaticProjectile.RYPS, 10);
|
||||
projectile.getEntityData().set(StaticProjectile.GLOW, true);
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Z, "t");
|
||||
projectile.getEntityData().set(StaticProjectile.LIFETIME, Config.enchantedSwordLifetime);
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Z, String.format("%.3f*t", Config.enchantedSwordSpeed));
|
||||
|
||||
projectile.setDeltaMovement(MathUtil.toVec3(dirs[0]));
|
||||
level.addFreshEntity(projectile);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lzxnone.terraria.item.weapon.melee;
|
||||
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
@@ -59,12 +60,8 @@ public class InfluxWaver extends SwordItem {
|
||||
));
|
||||
}
|
||||
|
||||
public static final int MAX_SUMMON_COUNT = 2;
|
||||
public static final double SPEED = 1.0;
|
||||
public static final float FADE_OUT = 0.1f;
|
||||
public static final float FRICTION = 0.1f;
|
||||
public static final float SUMMON_RADIUS = 8.0f;
|
||||
public static final float SEARCH_RADIUS = 24.0f;
|
||||
|
||||
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
|
||||
@Override
|
||||
@@ -110,20 +107,20 @@ public class InfluxWaver extends SwordItem {
|
||||
checkEntity = false;
|
||||
}else {
|
||||
if(idx == 0) {
|
||||
summon.setDeltaMovement(summon.getLookAngle().normalize().scale(SPEED));
|
||||
summon.setDeltaMovement(summon.getLookAngle().normalize().scale(Config.influxWaverSpeed));
|
||||
}else {
|
||||
checkBlock = false;
|
||||
if(customData.contains("target")) {
|
||||
Entity target = summon.level().getEntity(customData.getInt("target"));
|
||||
if(target == null || !target.isAlive()) {
|
||||
summon.setDeltaMovement(summon.getLookAngle().normalize().scale(SPEED));
|
||||
summon.setDeltaMovement(summon.getLookAngle().normalize().scale(Config.influxWaverSpeed));
|
||||
checkEntity = false;
|
||||
}else {
|
||||
Vec3 targetPos = new Vec3(target.getX(), target.getY() + target.getBbHeight() / 2, target.getZ());
|
||||
summon.setDeltaMovement(targetPos.subtract(summon.position()).normalize().scale(SPEED));
|
||||
summon.setDeltaMovement(targetPos.subtract(summon.position()).normalize().scale(Config.influxWaverSpeed));
|
||||
}
|
||||
}else {
|
||||
summon.setDeltaMovement(summon.getLookAngle().normalize().scale(SPEED));
|
||||
summon.setDeltaMovement(summon.getLookAngle().normalize().scale(Config.influxWaverSpeed));
|
||||
checkEntity = false;
|
||||
}
|
||||
}
|
||||
@@ -155,7 +152,7 @@ public class InfluxWaver extends SwordItem {
|
||||
Entity target = customData.contains("target") ? summon.level().getEntity(customData.getInt("target")) : null;
|
||||
if(target != null && !hitTarget.getUUID().equals(target.getUUID())) return;
|
||||
if(hitTarget instanceof LivingEntity livingEntity && summon.getOwner() instanceof Player player && FilterUtil.createLivingTargetFilter(player).test(livingEntity)) {
|
||||
if(livingEntity.hurt(summon.damageSources().playerAttack(player), 12.0f)) {
|
||||
if(livingEntity.hurt(summon.damageSources().playerAttack(player), (float) Config.influxWaverDamage)) {
|
||||
livingEntity.invulnerableTime = 2;
|
||||
}
|
||||
customData.putBoolean("dead", false);
|
||||
@@ -171,12 +168,12 @@ public class InfluxWaver extends SwordItem {
|
||||
public void onDied(StaticSummon summon) {
|
||||
if(!summon.level().isClientSide()) {
|
||||
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
|
||||
if(customData.contains("dead") && !customData.getBoolean("dead") && customData.contains("idx") && customData.getInt("idx") < MAX_SUMMON_COUNT) {
|
||||
if(customData.contains("dead") && !customData.getBoolean("dead") && customData.contains("idx") && customData.getInt("idx") < Config.influxWaverMaxCount) {
|
||||
if(summon.getOwner() instanceof Player player) {
|
||||
Entity target = InfluxWaver.search(player, summon.position());
|
||||
if(target != null) {
|
||||
Vec3 targetPos = new Vec3(target.getX(), target.getY() + target.getBbHeight() / 2, target.getZ());
|
||||
Vec3 summonPos = MathUtil.getRandomPosOnRadius(targetPos, SUMMON_RADIUS);
|
||||
Vec3 summonPos = MathUtil.getRandomPosOnRadius(targetPos, Config.influxWaverSpawnRange);
|
||||
InfluxWaver.summon(player, summonPos, targetPos.subtract(summonPos).normalize(), target, customData.getInt("idx") + 1);
|
||||
}
|
||||
}
|
||||
@@ -207,6 +204,7 @@ public class InfluxWaver extends SwordItem {
|
||||
summon.getEntityData().set(StaticSummon.RXP, -90);
|
||||
summon.getEntityData().set(StaticSummon.RZP, -135);
|
||||
summon.getEntityData().set(StaticSummon.GLOW, true);
|
||||
summon.getEntityData().set(StaticSummon.LIFETIME, 300);
|
||||
summon.setNoGravity(true);
|
||||
summon.noPhysics = true;
|
||||
|
||||
@@ -220,8 +218,8 @@ public class InfluxWaver extends SwordItem {
|
||||
|
||||
public static Entity search(Player player, Vec3 pos) {
|
||||
AABB searchBox = new AABB(
|
||||
pos.x - SEARCH_RADIUS, pos.y - SEARCH_RADIUS, pos.z - SEARCH_RADIUS,
|
||||
pos.x + SEARCH_RADIUS, pos.y + SEARCH_RADIUS, pos.z + SEARCH_RADIUS
|
||||
pos.x - Config.influxWaverTargetRange, pos.y - Config.influxWaverTargetRange, pos.z - Config.influxWaverTargetRange,
|
||||
pos.x + Config.influxWaverTargetRange, pos.y + Config.influxWaverTargetRange, pos.z + Config.influxWaverTargetRange
|
||||
);
|
||||
List<Monster> entities = player.level().getEntitiesOfClass(
|
||||
Monster.class,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lzxnone.terraria.item.weapon.melee;
|
||||
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
@@ -73,9 +74,6 @@ public class Meowmere extends SwordItem {
|
||||
}
|
||||
);
|
||||
|
||||
public static final double GRAVITY = 0.025; //重力
|
||||
public static final double VZ = 1.5;
|
||||
|
||||
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
|
||||
public static final ResourceLocation RES = ResourceLocation.parse("lzxnoneterraria:textures/vfx/rainbow.png");
|
||||
public static final int MAX_LENGTH = 100;
|
||||
@@ -136,7 +134,7 @@ public class Meowmere extends SwordItem {
|
||||
public void tick(StaticSummon summon) {
|
||||
this.checkBeforeTick(summon);
|
||||
Vec3 motion = summon.getDeltaMovement();
|
||||
motion = motion.add(0, -GRAVITY, 0);
|
||||
motion = motion.add(0, -Config.meowmereGravity, 0);
|
||||
Vec3 up = MathUtil.toVec3(MathUtil.computeCoordinateSystem(motion.toVector3f(), 0)[1]).normalize();
|
||||
|
||||
summon.trailPositions.addFirst(summon.position().add(up.scale(0.5)));
|
||||
@@ -149,7 +147,7 @@ public class Meowmere extends SwordItem {
|
||||
if(entityHitResult != null) {
|
||||
Entity target = entityHitResult.getEntity();
|
||||
if(summon.getOwner() instanceof Player player && target instanceof LivingEntity livingEntity) {
|
||||
if(livingEntity.hurt(summon.damageSources().playerAttack(player), 20.0f)) {
|
||||
if(livingEntity.hurt(summon.damageSources().playerAttack(player), (float) Config.meowmereDamage)) {
|
||||
if(customData.contains("hitEntity") && customData.getInt("hitEntity") < 4) {
|
||||
customData.putInt("hitEntity", customData.getInt("hitEntity") + 1);
|
||||
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
|
||||
@@ -202,7 +200,7 @@ public class Meowmere extends SwordItem {
|
||||
),
|
||||
FilterUtil.createLivingTargetFilter(summon.getOwner())
|
||||
);
|
||||
for(LivingEntity livingEntity : hitEntities) livingEntity.hurt(summon.damageSources().playerAttack(player), 20.0f);
|
||||
for(LivingEntity livingEntity : hitEntities) livingEntity.hurt(summon.damageSources().playerAttack(player), (float) Config.meowmereDamage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,7 +294,7 @@ public class Meowmere extends SwordItem {
|
||||
float[] xyRot = MathUtil.computeXYRot(dirs[0], dirs[1]);
|
||||
summon.setXRot(xyRot[0]);
|
||||
summon.setYRot(xyRot[1]);
|
||||
summon.setDeltaMovement(player.getLookAngle().normalize().scale(VZ));
|
||||
summon.setDeltaMovement(player.getLookAngle().normalize().scale(Config.meowmereInitialSpeed));
|
||||
level.addFreshEntity(summon);
|
||||
}else {
|
||||
ParticleUtil.addParticles(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lzxnone.terraria.item.weapon.melee;
|
||||
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
@@ -49,22 +50,18 @@ public class Seedler extends SwordItem {
|
||||
));
|
||||
}
|
||||
|
||||
public static final double GRAVITY = 0.075; //重力
|
||||
public static final double BOUNCINESS = 0.5;
|
||||
public static final double VZ = 0.75;
|
||||
|
||||
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
|
||||
@Override
|
||||
public void tick(StaticSummon summon) {
|
||||
this.checkBeforeTick(summon);
|
||||
Vec3 motion = summon.getDeltaMovement();
|
||||
motion = motion.add(0, -GRAVITY, 0);
|
||||
motion = motion.add(0, -Config.seedlerNutGravity, 0);
|
||||
|
||||
EntityHitResult entityHitResult = CollisionUtil.checkEntityHit(summon, summon.position().add(motion));
|
||||
if(entityHitResult != null) {
|
||||
Entity target = entityHitResult.getEntity();
|
||||
if(summon.getOwner() instanceof Player player && target instanceof LivingEntity livingEntity) {
|
||||
if(livingEntity.hurt(summon.damageSources().playerAttack(player), 7.0f)) {
|
||||
if(livingEntity.hurt(summon.damageSources().playerAttack(player), (float) Config.seedlerThornDamage)) {
|
||||
livingEntity.invulnerableTime = 2;
|
||||
}
|
||||
}
|
||||
@@ -81,15 +78,15 @@ public class Seedler extends SwordItem {
|
||||
double mz = motion.z;
|
||||
|
||||
switch(face.getAxis()) {
|
||||
case X -> mx = -mx * BOUNCINESS;
|
||||
case Y -> my = -my * BOUNCINESS;
|
||||
case Z -> mz = -mz * BOUNCINESS;
|
||||
case X -> mx = -mx * Config.seedlerNutBounce;
|
||||
case Y -> my = -my * Config.seedlerNutBounce;
|
||||
case Z -> mz = -mz * Config.seedlerNutBounce;
|
||||
}
|
||||
|
||||
if(face == Direction.UP && Math.abs(my) < 0.1) {
|
||||
my = 0;
|
||||
mx *= BOUNCINESS;
|
||||
mz *= BOUNCINESS;
|
||||
mx *= Config.seedlerNutBounce;
|
||||
mz *= Config.seedlerNutBounce;
|
||||
}
|
||||
|
||||
motion = new Vec3(mx, my, mz);
|
||||
@@ -135,8 +132,8 @@ public class Seedler extends SwordItem {
|
||||
proj.getEntityData().set(StaticProjectile.SCALE_X, 0.5f);
|
||||
proj.getEntityData().set(StaticProjectile.SCALE_Y, 0.5f);
|
||||
proj.getEntityData().set(StaticProjectile.RXP, 90);
|
||||
proj.getEntityData().set(StaticProjectile.LIFETIME, 30);
|
||||
proj.getEntityData().set(StaticProjectile.EXPRESSION_Z, "t*2");
|
||||
proj.getEntityData().set(StaticProjectile.LIFETIME, Config.seedlerThornLifetime);
|
||||
proj.getEntityData().set(StaticProjectile.EXPRESSION_Z, String.format("%.3f*t", Config.seedlerThornSpeed));
|
||||
|
||||
proj.setDeltaMovement(MathUtil.toVec3(dirs[0]));
|
||||
summon.level().addFreshEntity(proj);
|
||||
@@ -180,7 +177,7 @@ public class Seedler extends SwordItem {
|
||||
Entity owner = projectile.getOwner();
|
||||
if(owner == null) return;
|
||||
if(!FilterUtil.createLivingTargetFilter(owner).test(target) || !(owner instanceof Player player)) return;
|
||||
if(target.hurt(projectile.damageSources().playerAttack(player), 7f)) {
|
||||
if(target.hurt(projectile.damageSources().playerAttack(player), (float) Config.seedlerThornDamage)) {
|
||||
target.invulnerableTime = 2;
|
||||
onDied(projectile);
|
||||
}
|
||||
@@ -220,7 +217,7 @@ public class Seedler extends SwordItem {
|
||||
float[] xyRot = MathUtil.computeXYRot(dirs[0], dirs[1]);
|
||||
summon.setXRot(xyRot[0]);
|
||||
summon.setYRot(xyRot[1]);
|
||||
summon.setDeltaMovement(player.getLookAngle().normalize().scale(VZ));
|
||||
summon.setDeltaMovement(player.getLookAngle().normalize().scale(Config.seedlerNutInitialSpeed));
|
||||
level.addFreshEntity(summon);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lzxnone.terraria.item.weapon.melee;
|
||||
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
@@ -84,7 +85,7 @@ public class StarWrath extends SwordItem {
|
||||
if(result.getEntity() instanceof LivingEntity target) {
|
||||
Entity owner = projectile.getOwner();
|
||||
if(!FilterUtil.createLivingTargetFilter(owner).test(target) || !(owner instanceof Player player)) return;
|
||||
if(target.hurt(projectile.damageSources().playerAttack(player), 16f)) {
|
||||
if(target.hurt(projectile.damageSources().playerAttack(player), (float) Config.starWrathDamage)) {
|
||||
target.invulnerableTime = 2;
|
||||
}
|
||||
}
|
||||
@@ -136,7 +137,6 @@ public class StarWrath extends SwordItem {
|
||||
}
|
||||
};
|
||||
|
||||
public static final double MAX_RANGE = 48.0;
|
||||
public static final double HEIGHT = 20.0;
|
||||
public static final double DELTA_HEIGHT = 10.0;
|
||||
public static final double SPAWN_OFFSET = 10.0;
|
||||
@@ -148,7 +148,7 @@ public class StarWrath extends SwordItem {
|
||||
ItemStack itemstack = player.getItemInHand(hand);
|
||||
if(!level.isClientSide()) {
|
||||
for(int i = 0;i < SPAWN_COUNT;i++) {
|
||||
Vec3 targetPos = MathUtil.getCrosshairPos(player, level, MAX_RANGE);
|
||||
Vec3 targetPos = MathUtil.getCrosshairPos(player, level, Config.starWrathMaxRange);
|
||||
|
||||
Vec3 spawnPos = new Vec3(
|
||||
targetPos.x + SPAWN_OFFSET * (Math.random() * 2 - 1),
|
||||
@@ -180,10 +180,10 @@ public class StarWrath extends SwordItem {
|
||||
projectile.getEntityData().set(StaticProjectile.GLOW, true);
|
||||
projectile.getEntityData().set(StaticProjectile.RXP, 90);
|
||||
projectile.getEntityData().set(StaticProjectile.RZP, 90);
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Z, "t*2");
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Z, String.format("%.3f*t", Config.starWrathSpeed));
|
||||
|
||||
CompoundTag customData = new CompoundTag();
|
||||
customData.putInt("targetLifetime", (int) Math.round(targetPos.distanceTo(spawnPos) / 2.0D));
|
||||
customData.putInt("targetLifetime", (int) Math.round(targetPos.distanceTo(spawnPos) / Config.starWrathSpeed));
|
||||
projectile.getEntityData().set(StaticProjectile.CUSTOM_DATA, customData);
|
||||
|
||||
projectile.setDeltaMovement(MathUtil.toVec3(dirs[0]));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lzxnone.terraria.item.weapon.melee;
|
||||
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
@@ -64,7 +65,7 @@ public class Starfury extends SwordItem {
|
||||
Entity owner = projectile.getOwner();
|
||||
if(owner == null) return;
|
||||
if(!FilterUtil.createLivingTargetFilter(owner).test(target) || !(owner instanceof Player player)) return;
|
||||
if(target.hurt(projectile.damageSources().playerAttack(player), 8f)) {
|
||||
if(target.hurt(projectile.damageSources().playerAttack(player), (float) Config.starfuryDamage)) {
|
||||
target.invulnerableTime = 5;
|
||||
}
|
||||
}
|
||||
@@ -105,7 +106,6 @@ public class Starfury extends SwordItem {
|
||||
}
|
||||
};
|
||||
|
||||
public static final double MAX_RANGE = 24.0;
|
||||
public static final double HEIGHT = 20.0;
|
||||
public static final double SPAWN_OFFSET = 5.0;
|
||||
|
||||
@@ -113,7 +113,7 @@ public class Starfury extends SwordItem {
|
||||
public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand hand) {
|
||||
ItemStack itemstack = player.getItemInHand(hand);
|
||||
if(!level.isClientSide()) {
|
||||
Vec3 targetPos = MathUtil.getCrosshairPos(player, level, MAX_RANGE);
|
||||
Vec3 targetPos = MathUtil.getCrosshairPos(player, level, Config.starfuryMaxRange);
|
||||
|
||||
Vec3 spawnPos = new Vec3(
|
||||
targetPos.x + SPAWN_OFFSET * (Math.random() * 2 - 1),
|
||||
@@ -139,10 +139,10 @@ public class Starfury extends SwordItem {
|
||||
projectile.getEntityData().set(StaticProjectile.GLOW, true);
|
||||
projectile.getEntityData().set(StaticProjectile.RXP, 90);
|
||||
projectile.getEntityData().set(StaticProjectile.RZP, 90);
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Z, "t*2");
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Z, String.format("%.3f*t", Config.starfurySpeed));
|
||||
|
||||
CompoundTag customData = new CompoundTag();
|
||||
customData.putInt("targetLifetime", (int) Math.floor(targetPos.distanceTo(spawnPos) / 2.0D));
|
||||
customData.putInt("targetLifetime", (int) Math.floor(targetPos.distanceTo(spawnPos) / Config.starfurySpeed));
|
||||
projectile.getEntityData().set(StaticProjectile.CUSTOM_DATA, customData);
|
||||
|
||||
projectile.setDeltaMovement(MathUtil.toVec3(dirs[0]));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lzxnone.terraria.item.weapon.melee;
|
||||
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
@@ -92,8 +93,6 @@ public class TerraBlade extends SwordItem {
|
||||
);
|
||||
|
||||
public static final ISwordBeamBehavior SWORD_BEAM_BEHAVIOR = new ISwordBeamBehavior() {
|
||||
public static final int MAX_HIT_ENTITY_COUNT = 3;
|
||||
|
||||
@Override
|
||||
public void onMoving(SwordBeam beam) {
|
||||
if(beam.currentPosition == null) return;
|
||||
@@ -111,8 +110,8 @@ public class TerraBlade extends SwordItem {
|
||||
CompoundTag custom_data = beam.getEntityData().get(SwordBeam.CUSTOM_DATA);
|
||||
if(custom_data.contains("hitEntityCount")) {
|
||||
int count = custom_data.getInt("hitEntityCount");
|
||||
if(count < MAX_HIT_ENTITY_COUNT) {
|
||||
if(target.hurt(beam.level().damageSources().playerAttack(player), 11.0f)) {
|
||||
if(count < Config.terraBladeMaxHitCount) {
|
||||
if(target.hurt(beam.level().damageSources().playerAttack(player), (float) Config.terraBladeDamage)) {
|
||||
target.invulnerableTime = 20;
|
||||
count++;
|
||||
custom_data.putInt("hitEntityCount", count);
|
||||
@@ -127,8 +126,10 @@ public class TerraBlade extends SwordItem {
|
||||
@Override
|
||||
public void generate(Entity entity, CompoundTag beamData) {
|
||||
//beamData.putBoolean("right", entity.getRandom().nextInt(2) == 0);
|
||||
int randomAngle = (int) (Config.terraBladeRotateRange * (Math.random() * 2 - 1));
|
||||
beamData.putInt("rotate", randomAngle);
|
||||
ISwordBeamBehavior.super.generate(entity, beamData);
|
||||
if(entity instanceof Player player) summon(player);
|
||||
if(entity instanceof Player player) summon(player, randomAngle);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -144,11 +145,6 @@ public class TerraBlade extends SwordItem {
|
||||
public static final float FADE_IN = 0.33f;
|
||||
public static final float FADE_OUT = 0.67f;
|
||||
|
||||
public static final double SPEED = 2;
|
||||
public static final float DAMAGE = 11;
|
||||
public static final float DAMAGE_PUNISHMENT = 0.75f;
|
||||
|
||||
|
||||
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
|
||||
@Override
|
||||
public void render(Entity entity, float entityYaw, float partialTick,
|
||||
@@ -402,9 +398,9 @@ public class TerraBlade extends SwordItem {
|
||||
if(!customData.contains("dead")) {
|
||||
float progress = summon.getEntityData().get(StaticSummon.AGE) / (float) summon.getEntityData().get(StaticSummon.LIFETIME);
|
||||
if(progress > FADE_IN) {
|
||||
summon.setDeltaMovement(summon.getLookAngle().normalize().scale(SPEED - SPEED * (progress - FADE_IN) / (1.0f - FADE_IN)));
|
||||
summon.setDeltaMovement(summon.getLookAngle().normalize().scale(Config.terraProjectileSpeed - Config.terraProjectileSpeed * (progress - FADE_IN) / (1.0f - FADE_IN)));
|
||||
}else {
|
||||
summon.setDeltaMovement(summon.getLookAngle().normalize().scale(SPEED));
|
||||
summon.setDeltaMovement(summon.getLookAngle().normalize().scale(Config.terraProjectileSpeed));
|
||||
}
|
||||
}else {
|
||||
summon.setDeltaMovement(summon.getLookAngle().normalize().scale(0.1));
|
||||
@@ -425,7 +421,7 @@ public class TerraBlade extends SwordItem {
|
||||
int count = customData.getInt("hitCount");
|
||||
List<LivingEntity> targets = summon.level().getEntitiesOfClass(LivingEntity.class, summon.getBoundingBox(), FilterUtil.createTargetFilter(summon, summon.getOwner()));
|
||||
for(LivingEntity target : targets) {
|
||||
if(target.hurt(summon.damageSources().playerAttack(player), DAMAGE * (float) Math.pow(DAMAGE_PUNISHMENT, count))) {
|
||||
if(target.hurt(summon.damageSources().playerAttack(player), (float) Config.terraProjectileDamage * (float) Math.pow(Config.terraProjectileDamageDecay, count))) {
|
||||
count++;
|
||||
ParticleUtil.addParticles(
|
||||
(ServerLevel) summon.level(), ModParticles.TERRA_BEAM_HIT_PARTICLE.get(),
|
||||
@@ -473,18 +469,18 @@ public class TerraBlade extends SwordItem {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
|
||||
}
|
||||
};
|
||||
|
||||
public static void summon(Player player) {
|
||||
public static void summon(Player player, int randomAngle) {
|
||||
StaticSummon summon = new StaticSummon(ModEntities.STATIC_SUMMON.get(), player.level());
|
||||
summon.setOwner(player);
|
||||
Vec3 pos = new Vec3(player.getX(), player.getEyeY() - 0.1, player.getZ());
|
||||
summon.setPos(pos);
|
||||
|
||||
int randomAngle = (int) ((Math.random() * 2 - 1) * 60);
|
||||
if(!Config.terraProjectileAlignToBlade) randomAngle = (int) (Config.terraProjectileRotateRange * (Math.random() * 2 - 1));
|
||||
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
|
||||
dirs = MathUtil.rotateCoordinateSystem(dirs[0], dirs[2], randomAngle);
|
||||
float[] xyRot = MathUtil.computeXYRot(dirs[0], dirs[1]);
|
||||
@@ -495,7 +491,7 @@ public class TerraBlade extends SwordItem {
|
||||
|
||||
summon.getEntityData().set(StaticSummon.BEHAVIOR, StaticSummonBehaviors.TERRA_BLADE_BEAM);
|
||||
summon.getEntityData().set(StaticSummon.RENDER_MODE, "custom");
|
||||
summon.getEntityData().set(StaticSummon.LIFETIME, 40);
|
||||
summon.getEntityData().set(StaticSummon.LIFETIME, Config.terraProjectileLifetime);
|
||||
summon.getEntityData().set(StaticSummon.RZP, randomAngle);
|
||||
summon.getEntityData().set(StaticSummon.GLOW, true);
|
||||
summon.setNoGravity(true);
|
||||
@@ -533,7 +529,7 @@ public class TerraBlade extends SwordItem {
|
||||
customData.putFloat("rightZ", dirs[2].z);
|
||||
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
|
||||
|
||||
summon.setDeltaMovement(player.getLookAngle().normalize().scale(SPEED));
|
||||
summon.setDeltaMovement(player.getLookAngle().normalize().scale(Config.terraProjectileSpeed));
|
||||
|
||||
player.level().addFreshEntity(summon);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lzxnone.terraria.item.weapon.melee;
|
||||
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
import com.lzxnone.terraria.entity.ModEntities;
|
||||
@@ -91,9 +92,6 @@ public class TheHorsemansBlade extends SwordItem {
|
||||
);
|
||||
|
||||
public static final ISwordBeamBehavior SWORD_BEAM_BEHAVIOR = new ISwordBeamBehavior() {
|
||||
public static final int MAX_HIT_ENTITY_COUNT = 3;
|
||||
public static final float RANGE = 16.0f;
|
||||
|
||||
@Override
|
||||
public void onMoving(SwordBeam beam) {
|
||||
if(beam.currentPosition == null) return;
|
||||
@@ -111,8 +109,8 @@ public class TheHorsemansBlade extends SwordItem {
|
||||
CompoundTag custom_data = beam.getEntityData().get(SwordBeam.CUSTOM_DATA);
|
||||
if(custom_data.contains("hitEntityCount")) {
|
||||
int count = custom_data.getInt("hitEntityCount");
|
||||
if(count < MAX_HIT_ENTITY_COUNT) {
|
||||
if(target.hurt(beam.level().damageSources().playerAttack(player), 15.0f)) {
|
||||
if(count < Config.horsemansBladeMaxHitCount) {
|
||||
if(target.hurt(beam.level().damageSources().playerAttack(player), (float) Config.horsemansBladeDamage)) {
|
||||
target.invulnerableTime = 20;
|
||||
count++;
|
||||
custom_data.putInt("hitEntityCount", count);
|
||||
@@ -122,7 +120,7 @@ public class TheHorsemansBlade extends SwordItem {
|
||||
Entity entity = beam.getOwner();
|
||||
if(entity == null) return;
|
||||
summon.setOwner(entity);
|
||||
Vec3 pos = MathUtil.getRandomPosInRadius(entity.position(), RANGE);
|
||||
Vec3 pos = MathUtil.getRandomPosInRadius(entity.position(), Config.horsemansPumpkinSpawnRange);
|
||||
summon.setPos(pos);
|
||||
|
||||
float[] xyRot = MathUtil.computeXYRot(MathUtil.toVector3f(target.position().subtract(pos)));
|
||||
@@ -157,7 +155,7 @@ public class TheHorsemansBlade extends SwordItem {
|
||||
|
||||
@Override
|
||||
public void generate(Entity entity, CompoundTag beamData) {
|
||||
beamData.putInt("rotate", (int) (45 * (Math.random() * 2 - 1)));
|
||||
beamData.putInt("rotate", (int) (Config.horsemansBladeRotateRange * (Math.random() * 2 - 1)));
|
||||
//beamData.putBoolean("right", entity.getRandom().nextInt(2) == 0);
|
||||
ISwordBeamBehavior.super.generate(entity, beamData);
|
||||
}
|
||||
@@ -202,9 +200,6 @@ public class TheHorsemansBlade extends SwordItem {
|
||||
}
|
||||
|
||||
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
|
||||
public static final double SPEED = 0.5;
|
||||
public static final float DAMAGE = 15.0f;
|
||||
public static final float RANGE = 32.0f;
|
||||
@Override
|
||||
public void tick(StaticSummon summon) {
|
||||
this.checkBeforeTick(summon);
|
||||
@@ -223,7 +218,7 @@ public class TheHorsemansBlade extends SwordItem {
|
||||
if(target == null) {
|
||||
List<Monster> targets = summon.level().getEntitiesOfClass(
|
||||
Monster.class,
|
||||
AABB.ofSize(summon.position(), RANGE * 2, RANGE * 2, RANGE * 2),
|
||||
AABB.ofSize(summon.position(), Config.horsemansPumpkinMaxTargetRange * 2, Config.horsemansPumpkinMaxTargetRange * 2, Config.horsemansPumpkinMaxTargetRange * 2),
|
||||
FilterUtil.createMonsterFilter(summon.getOwner())
|
||||
);
|
||||
targets.sort(Comparator.comparingDouble(e -> e.distanceToSqr(summon.position())));
|
||||
@@ -240,18 +235,18 @@ public class TheHorsemansBlade extends SwordItem {
|
||||
Vec3 selfPos = summon.position();
|
||||
Vec3 dir = targetPos.subtract(selfPos).normalize();
|
||||
|
||||
summon.setDeltaMovement(dir.scale(SPEED));
|
||||
summon.setDeltaMovement(dir.scale(Config.horsemansPumpkinSpeed));
|
||||
|
||||
float[] xyRot = MathUtil.computeXYRot(MathUtil.toVector3f(dir));
|
||||
summon.setXRot(xyRot[0]);
|
||||
summon.setYRot(xyRot[1]);
|
||||
|
||||
if(selfPos.distanceToSqr(targetPos) < 2.0D) {
|
||||
if(summon.getOwner() instanceof Player player && FilterUtil.createLivingTargetFilter(player).test(target) && target.hurt(summon.damageSources().playerAttack(player), DAMAGE)) onDied(summon);
|
||||
if(summon.getOwner() instanceof Player player && FilterUtil.createLivingTargetFilter(player).test(target) && target.hurt(summon.damageSources().playerAttack(player), (float) Config.horsemansPumpkinDamage)) onDied(summon);
|
||||
}
|
||||
}else {
|
||||
Vec3 dir = summon.getLookAngle().normalize();
|
||||
summon.setDeltaMovement(dir.scale(SPEED));
|
||||
summon.setDeltaMovement(dir.scale(Config.horsemansPumpkinSpeed));
|
||||
}
|
||||
|
||||
if(!summon.level().isClientSide()) {
|
||||
@@ -272,7 +267,7 @@ public class TheHorsemansBlade extends SwordItem {
|
||||
for(Entity hitEntity : hitEntities) {
|
||||
if(target != null && hitEntity.getUUID() == target.getUUID()) continue;
|
||||
if(summon.getOwner() instanceof Player player) {
|
||||
if(hitEntity.hurt(summon.damageSources().playerAttack(player), DAMAGE)) {
|
||||
if(hitEntity.hurt(summon.damageSources().playerAttack(player), (float) Config.horsemansPumpkinDamage)) {
|
||||
hitEntity.invulnerableTime = 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class TrueCopperShortsword extends SwordItem {
|
||||
|
||||
public static void summon(Player player) {
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
|
||||
int randomAngle = (int) ((Math.random() * 2 - 1) * 30);
|
||||
int randomAngle = (int) ((Math.random() * 2 - 1) * Config.zenithTrailOffset);
|
||||
dirs = MathUtil.rotateCoordinateSystem(dirs[0], dirs[2], randomAngle);
|
||||
|
||||
Vec3 pos = (player.getBoundingBox().getCenter()).add(MathUtil.toVec3(dirs[0]).scale(-2));
|
||||
@@ -52,7 +52,7 @@ public class TrueCopperShortsword extends SwordItem {
|
||||
double w = Math.PI * 2 / (double) cycle;
|
||||
if(player.getRandom().nextInt(2) == 0) w = -w;
|
||||
|
||||
for(int i = 0;i < 3;i++) {
|
||||
for(int i = 0;i < Config.zenithWeaponCount;i++) {
|
||||
StaticProjectile projectile = new StaticProjectile(ModEntities.STATIC_PROJECTILE.get(), player.level());
|
||||
projectile.setOwner(player);
|
||||
|
||||
|
||||
@@ -370,7 +370,7 @@ public class Zenith extends SwordItem {
|
||||
|
||||
public static void summon(Player player, boolean isFirst) {
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
|
||||
int randomAngle = (int) ((Math.random() * 2 - 1) * 30);
|
||||
int randomAngle = (int) ((Math.random() * 2 - 1) * Config.zenithTrailOffset);
|
||||
dirs = MathUtil.rotateCoordinateSystem(dirs[0], dirs[2], randomAngle);
|
||||
|
||||
Vec3 pos = (player.getBoundingBox().getCenter()).add(MathUtil.toVec3(dirs[0]).scale(-2));
|
||||
@@ -384,7 +384,7 @@ public class Zenith extends SwordItem {
|
||||
|
||||
int randomIndex = isFirst ? getWeapons().length - 1 : player.getRandom().nextInt(getWeapons().length);
|
||||
|
||||
for(int i = 0;i < 3;i++) {
|
||||
for(int i = 0;i < Config.zenithWeaponCount;i++) {
|
||||
StaticProjectile projectile = new StaticProjectile(ModEntities.STATIC_PROJECTILE.get(), player.level());
|
||||
projectile.setOwner(player);
|
||||
|
||||
|
||||
Reference in new issue
Block a user