diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt index 47a522393..35455c300 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt @@ -859,6 +859,12 @@ private fun items(provider: MatteryLanguageProvider) { add(MItems.ENERGY_SWORD, "desc3", "Always strikes surrounding enemies with full damage if empowered") add(MItems.ENERGY_SWORD, "desc4", "Does not benefit from Sweeping Edge enchantment") + add(MItems.FALLING_SUN, "◄ Falling Sun ►") + add(MItems.FALLING_SUN, "desc", "Prototype weapon, needs power to operate") + add(MItems.FALLING_SUN, "desc2", "Deals extra damage to androids when empowered") + add(MItems.FALLING_SUN, "desc3", "Always strikes surrounding enemies with full damage if empowered") + add(MItems.FALLING_SUN, "desc4", "Does not benefit from Sweeping Edge enchantment") + add(MItems.PORTABLE_CONDENSATION_DRIVE, "Portable Condensation Drive") add(MItems.PORTABLE_DENSE_CONDENSATION_DRIVE, "Portable Dense Condensation Drive") add(MItems.TRITANIUM_ORE_CLUMP, "Raw Tritanium") diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt index fd30292c9..f0bb29256 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt @@ -852,6 +852,12 @@ private fun items(provider: MatteryLanguageProvider) { add(MItems.ENERGY_SWORD, "desc3", "Всегда наносит полный урон по площади если имеет заряд") add(MItems.ENERGY_SWORD, "desc4", "Зачарование 'Разящий клинок' не имеет никакого эффекта на данном оружии") + add(MItems.FALLING_SUN, "◄ Падающее Солнце ►") + add(MItems.FALLING_SUN, "desc", "Прототип,требует энергию для работы") + add(MItems.FALLING_SUN, "desc2", "Наносит дополнительный урон андроидам если имеет заряд") + add(MItems.FALLING_SUN, "desc3", "Всегда наносит полный урон по площади если имеет заряд") + add(MItems.FALLING_SUN, "desc4", "Зачарование 'Разящий клинок' не имеет никакого эффекта на данном оружии") + add(MItems.PORTABLE_CONDENSATION_DRIVE, "Portable Condensation Drive") add(MItems.PORTABLE_DENSE_CONDENSATION_DRIVE, "Portable Dense Condensation Drive") add(MItems.TRITANIUM_ORE_CLUMP, "Рудный тритан") diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/config/ToolsConfig.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/config/ToolsConfig.kt index f6aadb631..81039877d 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/config/ToolsConfig.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/config/ToolsConfig.kt @@ -1,12 +1,14 @@ package ru.dbotthepony.mc.otm.config import ru.dbotthepony.mc.otm.item.weapon.EnergySwordItem +import ru.dbotthepony.mc.otm.item.weapon.FallingSunItem object ToolsConfig : AbstractConfig("tools") { val AXES_BREAK_LEAVES_INSTANTLY: Boolean by builder.define("AXES_BREAK_LEAVES_INSTANTLY", true) init { EnergySwordItem.registerConfig(builder) + FallingSunItem.registerConfig(builder) } object ExplosiveHammer { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/FallingSunItem.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/FallingSunItem.kt new file mode 100644 index 000000000..b9275fdff --- /dev/null +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/weapon/FallingSunItem.kt @@ -0,0 +1,232 @@ +package ru.dbotthepony.mc.otm.item.weapon + +import net.minecraft.core.BlockPos +import net.minecraft.core.component.DataComponents +import net.minecraft.tags.BlockTags +import net.minecraft.world.entity.EquipmentSlotGroup +import net.minecraft.world.entity.LivingEntity +import net.minecraft.world.entity.ai.attributes.AttributeModifier +import net.minecraft.world.entity.ai.attributes.Attributes +import net.minecraft.world.entity.player.Player +import net.minecraft.world.item.ItemStack +import net.minecraft.world.item.Rarity +import net.minecraft.world.item.component.ItemAttributeModifiers +import net.minecraft.world.level.Level +import net.minecraft.world.level.block.Blocks +import net.minecraft.world.level.block.state.BlockState +import net.neoforged.neoforge.capabilities.Capabilities +import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent +import net.neoforged.neoforge.common.ItemAbilities +import net.neoforged.neoforge.common.ItemAbility +import net.neoforged.neoforge.common.ModConfigSpec +import ru.dbotthepony.mc.otm.OverdriveThatMatters +import ru.dbotthepony.mc.otm.capability.MatteryCapability +import ru.dbotthepony.mc.otm.capability.energy.EnergyConsumerItem +import ru.dbotthepony.mc.otm.capability.energy.extractEnergyExact +import ru.dbotthepony.mc.otm.capability.energy.getBarColor +import ru.dbotthepony.mc.otm.capability.energy.getBarWidth +import ru.dbotthepony.mc.otm.capability.matteryEnergy +import ru.dbotthepony.mc.otm.capability.matteryPlayer +import ru.dbotthepony.mc.otm.core.ResourceLocation +import ru.dbotthepony.mc.otm.core.damageType +import ru.dbotthepony.mc.otm.core.math.Decimal +import ru.dbotthepony.mc.otm.core.math.DecimalConfigValue +import ru.dbotthepony.mc.otm.core.math.defineDecimal +import ru.dbotthepony.mc.otm.core.math.nextVariance +import ru.dbotthepony.mc.otm.core.otmRandom +import ru.dbotthepony.mc.otm.core.util.WriteOnce +import ru.dbotthepony.mc.otm.item.MatteryItem +import ru.dbotthepony.mc.otm.item.addSimpleDescription +import ru.dbotthepony.mc.otm.registry.CapabilitiesRegisterListener +import ru.dbotthepony.mc.otm.registry.MDamageTypes +import ru.dbotthepony.mc.otm.registry.MatteryDamageSource + +class FallingSunItem : MatteryItem(Properties().stacksTo(1).rarity(Rarity.EPIC)), CapabilitiesRegisterListener { + private val chargedAttributes: ItemAttributeModifiers + private val dischargedAttributes: ItemAttributeModifiers + + init { + var builder = ItemAttributeModifiers.builder() + + builder.add(Attributes.ATTACK_DAMAGE, AttributeModifier(BASE_ATTACK_DAMAGE_ID, 13.0, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) + builder.add(Attributes.ATTACK_SPEED, AttributeModifier(BASE_ATTACK_SPEED_ID, -3.2, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) + builder.add(Attributes.SWEEPING_DAMAGE_RATIO, AttributeModifier(ResourceLocation(OverdriveThatMatters.MOD_ID, "energy_sword_sweeping_edge"), 1.0, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) + + chargedAttributes = builder.build() + builder = ItemAttributeModifiers.builder() + + builder.add(Attributes.ATTACK_DAMAGE, AttributeModifier(BASE_ATTACK_DAMAGE_ID, 5.5, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) + builder.add(Attributes.ATTACK_SPEED, AttributeModifier(BASE_ATTACK_SPEED_ID, -3.2, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) + dischargedAttributes = builder.build() + } + + override fun isEnchantable(p_41456_: ItemStack): Boolean { + return p_41456_.count == 1 + } + + override fun getEnchantmentValue(stack: ItemStack): Int { + return 12 + } + + override fun getDestroySpeed(itemStack: ItemStack, blockState: BlockState): Float { + val energy = itemStack.getCapability(MatteryCapability.ITEM_ENERGY) ?: return 1f + + if (blockState.`is`(Blocks.COBWEB)) { + return if (energy.batteryLevel < COBWEB_POWER_COST) 2f else 25f + } else if (blockState.`is`(BlockTags.SWORD_EFFICIENT)) { + return if (energy.batteryLevel < PLANT_POWER_COST) 1.5f else 8f + } else { + return 1f + } + } + + override fun canAttackBlock(p_41441_: BlockState, p_41442_: Level, p_41443_: BlockPos, p_41444_: Player): Boolean { + return !p_41444_.isCreative + } + + override fun hurtEnemy(itemStack: ItemStack, victim: LivingEntity, attacker: LivingEntity): Boolean { + if (attacker is Player && attacker.isCreative) { + victim.matteryPlayer?.let { + if (it.isAndroid) { + victim.invulnerableTime = 0 + victim.hurt(MatteryDamageSource(attacker.level().registryAccess().damageType(MDamageTypes.EMP), attacker, itemStack), 8f) + } + } + + return true + } + + itemStack.getCapability(MatteryCapability.ITEM_ENERGY)?.let { + if (it.extractEnergyExact(ENERGY_PER_SWING, false)) { + it.extractEnergy(attacker.level().otmRandom.nextVariance(ENERGY_PER_SWING_VARIANCE), false) + victim.matteryPlayer?.let { + if (it.isAndroid && it.androidEnergy.extractEnergyExact(ENERGY_ZAP, false)) { + it.androidEnergy.extractEnergy(attacker.level().otmRandom.nextVariance(ENERGY_ZAP_VARIANCE), false) + victim.hurt(MatteryDamageSource(attacker.level().registryAccess().damageType(MDamageTypes.EMP), attacker, itemStack), 8f) + } + } + } + } + + return true + } + + override fun isBarVisible(p_150899_: ItemStack): Boolean { + return p_150899_.matteryEnergy != null + } + + override fun getBarWidth(p_150900_: ItemStack): Int { + return p_150900_.matteryEnergy?.getBarWidth() ?: super.getBarWidth(p_150900_) + } + + override fun getBarColor(p_150901_: ItemStack): Int { + return p_150901_.matteryEnergy?.getBarColor() ?: super.getBarColor(p_150901_) + } + + init { + tooltips.itemEnergy() + + addSimpleDescription() + addSimpleDescription("2") + addSimpleDescription("3") + addSimpleDescription("4") + } + + override fun mineBlock( + itemStack: ItemStack, + p_41417_: Level, + blockState: BlockState, + p_41419_: BlockPos, + user: LivingEntity + ): Boolean { + if (blockState.getDestroySpeed(p_41417_, p_41419_) > 0f && (user !is Player || !user.isCreative)) { + val energy = itemStack.matteryEnergy + + if (blockState.`is`(BlockTags.SWORD_EFFICIENT)) { + if (energy?.extractEnergyExact(PLANT_POWER_COST, false) == true) + energy.extractEnergyExact(user.level().otmRandom.nextVariance(PLANT_POWER_COST_VARIANCE), false) + } + + if (blockState.`is`(Blocks.COBWEB)) { + if (energy?.extractEnergyExact(COBWEB_POWER_COST, false) == true) + energy.extractEnergyExact(user.level().otmRandom.nextVariance(COBWEB_POWER_COST_VARIANCE), false) + } + } + + return true + } + + override fun isCorrectToolForDrops(stack: ItemStack, state: BlockState): Boolean { + val energy = stack.matteryEnergy ?: return super.isCorrectToolForDrops(stack, state) + + if (state.`is`(BlockTags.SWORD_EFFICIENT) && energy.batteryLevel >= PLANT_POWER_COST) + return true + else if (state.`is`(Blocks.COBWEB) && energy.batteryLevel >= COBWEB_POWER_COST) + return true + + return super.isCorrectToolForDrops(stack, state) + } + + private fun cap(stack: ItemStack) = EnergyConsumerItem(stack, MAX_ENERGY) + + override fun registerCapabilities(event: RegisterCapabilitiesEvent) { + event.registerItem(MatteryCapability.ITEM_ENERGY, { o, _ -> cap(o) }, this) + event.registerItem(Capabilities.EnergyStorage.ITEM, { o, _ -> cap(o) }, this) + } + + override fun getDefaultAttributeModifiers(stack: ItemStack): ItemAttributeModifiers { + val energy = cap(stack) + + if (energy.batteryLevel >= ENERGY_PER_SWING) { + return chargedAttributes + } + + return dischargedAttributes + } + + override fun canPerformAction(stack: ItemStack, toolAction: ItemAbility): Boolean { + if (cap(stack).extractEnergyExact(ENERGY_PER_SWING, true)) { + return ItemAbilities.DEFAULT_SWORD_ACTIONS.contains(toolAction) + } + + return false + } + + companion object { + val MAX_ENERGY get() = _MAX_ENERGY.get() + val ENERGY_ZAP get() = _ENERGY_ZAP.get() + val ENERGY_ZAP_VARIANCE get() = _ENERGY_ZAP_VARIANCE.get() + val ENERGY_PER_SWING get() = _ENERGY_PER_SWING.get() + val ENERGY_PER_SWING_VARIANCE get() = _ENERGY_PER_SWING_VARIANCE.get() + val COBWEB_POWER_COST get() = _COBWEB_POWER_COST.get() + val COBWEB_POWER_COST_VARIANCE get() = _COBWEB_POWER_COST_VARIANCE.get() + val PLANT_POWER_COST get() = _PLANT_POWER_COST.get() + val PLANT_POWER_COST_VARIANCE get() = _PLANT_POWER_COST_VARIANCE.get() + + private var _MAX_ENERGY: DecimalConfigValue by WriteOnce() + private var _ENERGY_ZAP: DecimalConfigValue by WriteOnce() + private var _ENERGY_ZAP_VARIANCE: DecimalConfigValue by WriteOnce() + private var _ENERGY_PER_SWING: DecimalConfigValue by WriteOnce() + private var _ENERGY_PER_SWING_VARIANCE: DecimalConfigValue by WriteOnce() + private var _COBWEB_POWER_COST: DecimalConfigValue by WriteOnce() + private var _COBWEB_POWER_COST_VARIANCE: DecimalConfigValue by WriteOnce() + private var _PLANT_POWER_COST: DecimalConfigValue by WriteOnce() + private var _PLANT_POWER_COST_VARIANCE: DecimalConfigValue by WriteOnce() + + fun registerConfig(builder: ModConfigSpec.Builder) { + builder.comment("Falling Sun values").push("FallingSun") + + _MAX_ENERGY = builder.defineDecimal("MAX_ENERGY", Decimal(3_500_000), Decimal.ZERO) + _ENERGY_ZAP = builder.comment("Extra energy required when hitting androids").defineDecimal("ENERGY_ZAP", Decimal(4_000), Decimal.ZERO) + _ENERGY_ZAP_VARIANCE = builder.comment("Random deviation from ENERGY_ZAP").defineDecimal("ENERGY_ZAP_VARIANCE", Decimal(1200), Decimal.ZERO) + _ENERGY_PER_SWING = builder.defineDecimal("ENERGY_PER_SWING", Decimal(3_000), Decimal.ZERO) + _ENERGY_PER_SWING_VARIANCE = builder.comment("Random deviation from ENERGY_PER_SWING").defineDecimal("ENERGY_PER_SWING_VARIANCE", Decimal(600), Decimal.ZERO) + _COBWEB_POWER_COST = builder.defineDecimal("COBWEB_POWER_COST", Decimal(2_500), Decimal.ZERO) + _COBWEB_POWER_COST_VARIANCE = builder.comment("Random deviation from COBWEB_POWER_COST").defineDecimal("COBWEB_POWER_COST_VARIANCE", Decimal(500), Decimal.ZERO) + _PLANT_POWER_COST = builder.defineDecimal("PLANT_POWER_COST", Decimal(500), Decimal.ZERO) + _PLANT_POWER_COST_VARIANCE = builder.comment("Random deviation from PLANT_POWER_COST").defineDecimal("PLANT_POWER_COST_VARIANCE", Decimal(100), Decimal.ZERO) + + builder.pop() + } + } +} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt index a3612f1f0..a283cc490 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MNames.kt @@ -194,6 +194,7 @@ object MNames { const val TRITANIUM_SHIELD = "tritanium_shield" const val ENERGY_SWORD = "energy_sword" + const val FALLING_SUN = "falling_sun" const val PLASMA_RIFLE = "plasma_rifle" diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt index cd58f1a2d..b0a70f9d3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt @@ -42,6 +42,7 @@ import ru.dbotthepony.mc.otm.core.math.Decimal import ru.dbotthepony.mc.otm.isClient import ru.dbotthepony.mc.otm.item.armor.TritaniumArmorItem import ru.dbotthepony.mc.otm.item.weapon.EnergySwordItem +import ru.dbotthepony.mc.otm.item.weapon.FallingSunItem import ru.dbotthepony.mc.otm.registry.game.MItems import ru.dbotthepony.mc.otm.registry.game.MStats import ru.dbotthepony.mc.otm.registry.objects.ColoredDecorativeBlock @@ -284,6 +285,14 @@ object MRegistry : IBlockItemRegistryAcceptor { } } + ItemProperties.register(MItems.FALLING_SUN, ResourceLocation(OverdriveThatMatters.MOD_ID, "is_powered")) { stack, _, _, _ -> + if ((stack.matteryEnergy?.batteryLevel ?: Decimal.ZERO) >= FallingSunItem.ENERGY_PER_SWING) { + 1f + } else { + 0f + } + } + ItemProperties.register(MItems.EXPLOSIVE_HAMMER, ResourceLocation(OverdriveThatMatters.MOD_ID, "is_primed")) { stack, level, entity, _ -> if (MItems.EXPLOSIVE_HAMMER.isPrimed(stack) || entity == null) { 1f diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt index 82de7fba6..fd87871a6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt @@ -72,6 +72,7 @@ import ru.dbotthepony.mc.otm.item.tool.ExplosiveHammerItem import ru.dbotthepony.mc.otm.item.tool.MatteryAxeItem import ru.dbotthepony.mc.otm.item.tool.RedstoneInteractorItem import ru.dbotthepony.mc.otm.item.weapon.EnergySwordItem +import ru.dbotthepony.mc.otm.item.weapon.FallingSunItem import ru.dbotthepony.mc.otm.item.weapon.WitheredSteelSwordItem import ru.dbotthepony.mc.otm.registry.MDeferredRegister import ru.dbotthepony.mc.otm.registry.MItemTags @@ -407,6 +408,7 @@ object MItems { val EXPLOSIVE_HAMMER: ExplosiveHammerItem by registry.register("explosive_hammer") { ExplosiveHammerItem() } val ENERGY_SWORD: Item by registry.register(MNames.ENERGY_SWORD) { EnergySwordItem() } + val FALLING_SUN: Item by registry.register(MNames.FALLING_SUN) { FallingSunItem() } val WITHERED_STEEL_SWORD: Item by registry.register(MNames.WITHERED_STEEL_SWORD) { WitheredSteelSwordItem(Item.Properties().durability(420)) } diff --git a/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun.json b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun.json new file mode 100644 index 000000000..cf79584ea --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun.json @@ -0,0 +1,22 @@ +{ + "loader": "neoforge:separate_transforms", + "gui_light": "front", + "base": + { + "parent": "overdrive_that_matters:item/falling_sun_unpowered" + }, + "perspectives": { + "gui": { + "parent": "overdrive_that_matters:item/falling_sun_inventory" + }, + "fixed": { + "parent": "overdrive_that_matters:item/falling_sun_inventory" + }, + "ground": { + "parent": "overdrive_that_matters:item/falling_sun_inventory" + } + }, + "overrides": [ + { "predicate": { "overdrive_that_matters:is_powered": 1.0 }, "model": "overdrive_that_matters:item/falling_sun_powered" } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_inventory.json b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_inventory.json new file mode 100644 index 000000000..4a768a3b1 --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "overdrive_that_matters:item/falling_sun_icon" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_powered.json b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_powered.json new file mode 100644 index 000000000..58eb91a45 --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_powered.json @@ -0,0 +1,241 @@ +{ + "loader": "neoforge:separate_transforms", + "gui_light": "front", + "base": + { + "texture_size": [32, 32], + "textures": { + "0": "overdrive_that_matters:item/falling_sun", + "1": "overdrive_that_matters:item/falling_sun_charge", + "particle": "overdrive_that_matters:item/falling_sun" + }, + "elements": [ + { + "name": "frame", + "from": [7.999, 8, 9.6], + "to": [8.002, 22, 11.6], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 11, 10.6]}, + "faces": { + "east": {"uv": [11.5, 0, 10.5, 7], "texture": "#0"}, + "west": {"uv": [10.5, 0, 11.5, 7], "texture": "#0"} + } + }, + { + "name": "frame", + "from": [8, 22, 9.6], + "to": [8, 29, 11.6], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8, 22, 9.6]}, + "faces": { + "east": {"uv": [12.5, 0, 11.5, 3.5], "texture": "#0"}, + "west": {"uv": [11.5, 0, 12.5, 3.5], "texture": "#0"} + } + }, + { + "name": "cap", + "from": [7.4, 6, 7.6], + "to": [8.6, 11, 9.6], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, 7, 7.6]}, + "faces": { + "north": {"uv": [7.5, 4, 8, 6.5], "texture": "#0"}, + "east": {"uv": [9, 4, 8, 6.5], "texture": "#0"}, + "south": {"uv": [9, 4, 9.5, 6.5], "texture": "#0"}, + "west": {"uv": [8, 4, 9, 6.5], "texture": "#0"}, + "up": {"uv": [8, 3.5, 9, 4], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "handle", + "from": [7, -5, 4], + "to": [9, -4, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7, -5, 7]}, + "faces": { + "north": {"uv": [8, 10, 9, 10.5], "texture": "#0"}, + "east": {"uv": [7.5, 7, 8, 10], "rotation": 270, "texture": "#0"}, + "south": {"uv": [8, 6.5, 9, 7], "texture": "#0"}, + "west": {"uv": [7.5, 7, 8, 10], "rotation": 90, "texture": "#0"}, + "up": {"uv": [8, 7, 9, 10], "rotation": 180, "texture": "#0"}, + "down": {"uv": [9, 7, 10, 10], "texture": "#0"} + } + }, + { + "name": "handle", + "from": [8, -4, 4.6], + "to": [8, 3, 7.6], + "rotation": {"angle": 0, "axis": "y", "origin": [6, -3, 5.6]}, + "faces": { + "east": {"uv": [9, 0, 10.5, 3.5], "texture": "#0"}, + "west": {"uv": [10.5, 0, 9, 3.5], "texture": "#0"} + } + }, + { + "name": "handle", + "from": [7.5, -4, 7.2], + "to": [8.5, 3, 9.2], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, -3, 7.2]}, + "faces": { + "north": {"uv": [7, 0, 7.5, 3.5], "texture": "#0"}, + "east": {"uv": [8.5, 0, 7.5, 3.5], "texture": "#0"}, + "south": {"uv": [8.5, 0, 9, 3.5], "texture": "#0"}, + "west": {"uv": [7.5, 0, 8.5, 3.5], "texture": "#0"} + } + }, + { + "name": "guard", + "from": [6.5, 5, 4], + "to": [9.5, 6, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 5, 7]}, + "faces": { + "north": {"uv": [4, 8, 5.5, 8.5], "texture": "#0"}, + "east": {"uv": [3.5, 5, 4, 8], "rotation": 270, "texture": "#0"}, + "south": {"uv": [4, 4.5, 5.5, 5], "rotation": 180, "texture": "#0"}, + "west": {"uv": [5.5, 5, 6, 8], "rotation": 90, "texture": "#0"}, + "up": {"uv": [4, 5, 5.5, 8], "rotation": 180, "texture": "#0"}, + "down": {"uv": [6, 5, 7.5, 8], "texture": "#0"} + } + }, + { + "name": "guard", + "from": [6.5, 3, 4], + "to": [9.5, 4, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 3, 7]}, + "faces": { + "north": {"uv": [4, 8, 5.5, 8.5], "texture": "#0"}, + "east": {"uv": [3.5, 5, 4, 8], "rotation": 270, "texture": "#0"}, + "south": {"uv": [4, 4.5, 5.5, 5], "rotation": 180, "texture": "#0"}, + "west": {"uv": [5.5, 5, 6, 8], "rotation": 90, "texture": "#0"}, + "up": {"uv": [4, 5, 5.5, 8], "rotation": 180, "texture": "#0"}, + "down": {"uv": [6, 5, 7.5, 8], "texture": "#0"} + } + }, + { + "name": "blade", + "from": [7.5, 4, 4.5], + "to": [8.5, 22, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 6, 5.5]}, + "faces": { + "north": {"uv": [0, 0.5, 0.5, 9.5], "texture": "#0"}, + "east": {"uv": [3, 0.5, 0.5, 9.5], "texture": "#0"}, + "south": {"uv": [3, 0.5, 3.5, 9.5], "texture": "#0"}, + "west": {"uv": [0.5, 0.5, 3, 9.5], "texture": "#0"}, + "up": {"uv": [0.5, 0, 3, 0.5], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "blade", + "from": [7.501, 22.001, 4.501], + "to": [8.499, 29.999, 9.499], + "rotation": {"angle": 22.5, "axis": "x", "origin": [7.5, 22, 4.5]}, + "faces": { + "north": {"uv": [3.5, 0.5, 4, 4.5], "texture": "#0"}, + "east": {"uv": [6.5, 0.5, 4, 4.5], "texture": "#0"}, + "south": {"uv": [6.5, 0.5, 7, 4.5], "texture": "#0"}, + "west": {"uv": [4, 0.5, 6.5, 4.5], "texture": "#0"}, + "up": {"uv": [4, 0, 6.5, 0.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [7.501, 26.801, 8.601], + "to": [8.499, 25.799, 9.699], + "rotation": {"angle": 22.5, "axis": "x", "origin": [7.5, 26.8, 8.6]}, + "faces": { + "north": {"uv": [4.5, 1.5, 5, 2], "texture": "#0"}, + "south": {"uv": [5.5, 1.5, 6, 2], "texture": "#0"}, + "up": {"uv": [5, 2, 5.5, 2.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [5, 1, 5.5, 1.5], "texture": "#0"} + } + }, + { + "name": "charge", + "from": [7.6, 6, 3.8], + "to": [8.4, 22, 10.2], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, 12, 4]}, + "faces": { + "north": {"uv": [4, 4, 4.5, 12], "texture": "#1"}, + "east": {"uv": [1, 4, 4, 12], "texture": "#1"}, + "south": {"uv": [7.5, 4, 8, 12], "texture": "#1"}, + "west": {"uv": [4.5, 4, 7.5, 12], "texture": "#1"} + } + }, + { + "name": "charge", + "from": [7.6, 21.9, 3.8], + "to": [8.4, 30.8, 10.2], + "rotation": {"angle": 22.5, "axis": "x", "origin": [6.5, 22, 4]}, + "faces": { + "north": {"uv": [4, 2.5, 4.5, 5], "texture": "#1"}, + "east": {"uv": [1, 2.5, 4, 5], "texture": "#1"}, + "south": {"uv": [7.5, 2.5, 8, 5], "texture": "#1"}, + "west": {"uv": [4.5, 2.5, 7.5, 5], "texture": "#1"}, + "up": {"uv": [3.5, 0.5, 6, 1], "rotation": 90, "texture": "#1"} + } + }, + { + "name": "battery", + "from": [7.5, 7, 9.6], + "to": [8.5, 8, 11.6], + "rotation": {"angle": -22.5, "axis": "x", "origin": [7.5, 7, 9.6]}, + "faces": { + "east": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 270, "texture": "#0"}, + "south": {"uv": [12.5, 0, 13, 0.5], "texture": "#0"}, + "west": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 90, "texture": "#0"}, + "up": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [12.5, 0.5, 13, 1.5], "texture": "#0"} + } + }, + { + "name": "battery", + "from": [7.5, 9, 9.6], + "to": [8.5, 10, 11.6], + "rotation": {"angle": -22.5, "axis": "x", "origin": [7.5, 9, 9.6]}, + "faces": { + "east": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 270, "texture": "#0"}, + "south": {"uv": [12.5, 0, 13, 0.5], "texture": "#0"}, + "west": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 90, "texture": "#0"}, + "up": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [12.5, 0.5, 13, 1.5], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [0, 5.75, 1.25] + }, + "thirdperson_lefthand": { + "translation": [0, 5.75, 1.25] + }, + "firstperson_righthand": { + "rotation": [-35, 0, 0], + "translation": [1.5, 1.5, -3.5] + }, + "firstperson_lefthand": { + "rotation": [-35, 0, 0], + "translation": [1.5, 0, -3.5] + }, + "ground": { + "rotation": [-60, 0, 0], + "translation": [0, 2, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [0, 90, 0], + "translation": [0, -1.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "head": { + "rotation": [-127, 0, 0], + "translation": [0, 12.25, 0] + } + } + }, + "perspectives": { + "gui": { + "parent": "overdrive_that_matters:item/falling_sun_inventory" + }, + "fixed": { + "parent": "overdrive_that_matters:item/falling_sun_inventory" + }, + "ground": { + "parent": "overdrive_that_matters:item/falling_sun_inventory" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_unpowered.json b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_unpowered.json new file mode 100644 index 000000000..e31c94612 --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/models/item/falling_sun_unpowered.json @@ -0,0 +1,200 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "0": "overdrive_that_matters:item/falling_sun", + "particle": "overdrive_that_matters:item/falling_sun" + }, + "elements": [ + { + "name": "frame", + "from": [7.999, 8, 9.6], + "to": [8.002, 22, 11.6], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 11, 10.6]}, + "faces": { + "east": {"uv": [11.5, 0, 10.5, 7], "texture": "#0"}, + "west": {"uv": [10.5, 0, 11.5, 7], "texture": "#0"} + } + }, + { + "name": "frame", + "from": [8, 22, 9.6], + "to": [8, 29, 11.6], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8, 22, 9.6]}, + "faces": { + "east": {"uv": [12.5, 0, 11.5, 3.5], "texture": "#0"}, + "west": {"uv": [11.5, 0, 12.5, 3.5], "texture": "#0"} + } + }, + { + "name": "cap", + "from": [7.4, 6, 7.6], + "to": [8.6, 11, 9.6], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, 7, 7.6]}, + "faces": { + "north": {"uv": [7.5, 4, 8, 6.5], "texture": "#0"}, + "east": {"uv": [9, 4, 8, 6.5], "texture": "#0"}, + "south": {"uv": [9, 4, 9.5, 6.5], "texture": "#0"}, + "west": {"uv": [8, 4, 9, 6.5], "texture": "#0"}, + "up": {"uv": [8, 3.5, 9, 4], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "handle", + "from": [7, -5, 4], + "to": [9, -4, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7, -5, 7]}, + "faces": { + "north": {"uv": [8, 10, 9, 10.5], "texture": "#0"}, + "east": {"uv": [7.5, 7, 8, 10], "rotation": 270, "texture": "#0"}, + "south": {"uv": [8, 6.5, 9, 7], "texture": "#0"}, + "west": {"uv": [7.5, 7, 8, 10], "rotation": 90, "texture": "#0"}, + "up": {"uv": [8, 7, 9, 10], "rotation": 180, "texture": "#0"}, + "down": {"uv": [9, 7, 10, 10], "texture": "#0"} + } + }, + { + "name": "handle", + "from": [8, -4, 4.6], + "to": [8, 3, 7.6], + "rotation": {"angle": 0, "axis": "y", "origin": [6, -3, 5.6]}, + "faces": { + "east": {"uv": [9, 0, 10.5, 3.5], "texture": "#0"}, + "west": {"uv": [10.5, 0, 9, 3.5], "texture": "#0"} + } + }, + { + "name": "handle", + "from": [7.5, -4, 7.2], + "to": [8.5, 3, 9.2], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, -3, 7.2]}, + "faces": { + "north": {"uv": [7, 0, 7.5, 3.5], "texture": "#0"}, + "east": {"uv": [8.5, 0, 7.5, 3.5], "texture": "#0"}, + "south": {"uv": [8.5, 0, 9, 3.5], "texture": "#0"}, + "west": {"uv": [7.5, 0, 8.5, 3.5], "texture": "#0"} + } + }, + { + "name": "guard", + "from": [6.5, 5, 4], + "to": [9.5, 6, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 5, 7]}, + "faces": { + "north": {"uv": [4, 8, 5.5, 8.5], "texture": "#0"}, + "east": {"uv": [3.5, 5, 4, 8], "rotation": 270, "texture": "#0"}, + "south": {"uv": [4, 4.5, 5.5, 5], "rotation": 180, "texture": "#0"}, + "west": {"uv": [5.5, 5, 6, 8], "rotation": 90, "texture": "#0"}, + "up": {"uv": [4, 5, 5.5, 8], "rotation": 180, "texture": "#0"}, + "down": {"uv": [6, 5, 7.5, 8], "texture": "#0"} + } + }, + { + "name": "guard", + "from": [6.5, 3, 4], + "to": [9.5, 4, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 3, 7]}, + "faces": { + "north": {"uv": [4, 8, 5.5, 8.5], "texture": "#0"}, + "east": {"uv": [3.5, 5, 4, 8], "rotation": 270, "texture": "#0"}, + "south": {"uv": [4, 4.5, 5.5, 5], "rotation": 180, "texture": "#0"}, + "west": {"uv": [5.5, 5, 6, 8], "rotation": 90, "texture": "#0"}, + "up": {"uv": [4, 5, 5.5, 8], "rotation": 180, "texture": "#0"}, + "down": {"uv": [6, 5, 7.5, 8], "texture": "#0"} + } + }, + { + "name": "blade", + "from": [7.5, 4, 4.5], + "to": [8.5, 22, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 6, 5.5]}, + "faces": { + "north": {"uv": [0, 0.5, 0.5, 9.5], "texture": "#0"}, + "east": {"uv": [3, 0.5, 0.5, 9.5], "texture": "#0"}, + "south": {"uv": [3, 0.5, 3.5, 9.5], "texture": "#0"}, + "west": {"uv": [0.5, 0.5, 3, 9.5], "texture": "#0"}, + "up": {"uv": [0.5, 0, 3, 0.5], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "blade", + "from": [7.501, 22.001, 4.501], + "to": [8.499, 29.999, 9.499], + "rotation": {"angle": 22.5, "axis": "x", "origin": [7.5, 22, 4.5]}, + "faces": { + "north": {"uv": [3.5, 0.5, 4, 4.5], "texture": "#0"}, + "east": {"uv": [6.5, 0.5, 4, 4.5], "texture": "#0"}, + "south": {"uv": [6.5, 0.5, 7, 4.5], "texture": "#0"}, + "west": {"uv": [4, 0.5, 6.5, 4.5], "texture": "#0"}, + "up": {"uv": [4, 0, 6.5, 0.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [7.501, 26.801, 8.601], + "to": [8.499, 25.799, 9.699], + "rotation": {"angle": 22.5, "axis": "x", "origin": [7.5, 26.8, 8.6]}, + "faces": { + "north": {"uv": [4.5, 1.5, 5, 2], "texture": "#0"}, + "south": {"uv": [5.5, 1.5, 6, 2], "texture": "#0"}, + "up": {"uv": [5, 2, 5.5, 2.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [5, 1, 5.5, 1.5], "texture": "#0"} + } + }, + { + "name": "battery", + "from": [7.5, 6.5, 8.6], + "to": [8.5, 7.5, 10.6], + "rotation": {"angle": -22.5, "axis": "x", "origin": [7.5, 6.5, 8.6]}, + "faces": { + "east": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 270, "texture": "#0"}, + "south": {"uv": [12.5, 0, 13, 0.5], "texture": "#0"}, + "west": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 90, "texture": "#0"}, + "up": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [12.5, 0.5, 13, 1.5], "texture": "#0"} + } + }, + { + "name": "battery", + "from": [7.5, 8.5, 8.6], + "to": [8.5, 9.5, 10.6], + "rotation": {"angle": -22.5, "axis": "x", "origin": [7.5, 8.5, 8.6]}, + "faces": { + "east": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 270, "texture": "#0"}, + "south": {"uv": [12.5, 0, 13, 0.5], "texture": "#0"}, + "west": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 90, "texture": "#0"}, + "up": {"uv": [12.5, 0.5, 13, 1.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [12.5, 0.5, 13, 1.5], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [0, 5.75, 1.25] + }, + "thirdperson_lefthand": { + "translation": [0, 5.75, 1.25] + }, + "firstperson_righthand": { + "rotation": [-35, 0, 0], + "translation": [1.5, 1.5, -3.5] + }, + "firstperson_lefthand": { + "rotation": [-35, 0, 0], + "translation": [1.5, 0, -3.5] + }, + "ground": { + "rotation": [-60, 0, 0], + "translation": [0, 2, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [0, 90, 0], + "translation": [0, -1.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "head": { + "rotation": [-127, 0, 0], + "translation": [0, 12.25, 0] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun.png b/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun.png new file mode 100644 index 000000000..5b17b3744 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_charge.png b/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_charge.png new file mode 100644 index 000000000..7d507edad Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_charge.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_charge.png.mcmeta b/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_charge.png.mcmeta new file mode 100644 index 000000000..b14454b15 --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_charge.png.mcmeta @@ -0,0 +1 @@ +{ "animation": { "frametime": 1 } } \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_icon.png b/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_icon.png new file mode 100644 index 000000000..b9e3bc6e7 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/item/falling_sun_icon.png differ diff --git a/src/main/resources/data/overdrive_that_matters/weapon_attributes/falling_sun.json b/src/main/resources/data/overdrive_that_matters/weapon_attributes/falling_sun.json new file mode 100644 index 000000000..5747a9708 --- /dev/null +++ b/src/main/resources/data/overdrive_that_matters/weapon_attributes/falling_sun.json @@ -0,0 +1,40 @@ +{ + "attributes": { + "range_bonus": 0.25, + "two_handed": true, + "pose": "bettercombat:pose_two_handed_katana", + "category": "claymore", + "attacks": [ + { + "hitbox": "HORIZONTAL_PLANE", + "damage_multiplier": 0.75, + "angle": 120, + "upswing": 0.5, + "animation": "bettercombat:two_handed_slash_horizontal_right", + "swing_sound": { + "id": "bettercombat:scythe_slash" + } + }, + { + "hitbox": "HORIZONTAL_PLANE", + "damage_multiplier": 0.75, + "angle": 120, + "upswing": 0.5, + "animation": "bettercombat:two_handed_slash_horizontal_left", + "swing_sound": { + "id": "bettercombat:scythe_slash" + } + }, + { + "hitbox": "VERTICAL_PLANE", + "damage_multiplier": 1, + "angle": 120, + "upswing": 0.8, + "animation": "bettercombat:two_handed_slash_vertical_right", + "swing_sound": { + "id": "bettercombat:scythe_slash" + } + } + ] + } +} \ No newline at end of file