Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #priority 500
- import crafttweaker.entity.IEntityLivingBase;
- import crafttweaker.player.IPlayer;
- import crafttweaker.item.IItemStack;
- import crafttweaker.data.IData;
- import crafttweaker.entity.AttributeInstance;
- import crafttweaker.entity.Attribute;
- import crafttweaker.entity.AttributeModifier;
- function playerModifier(player as IPlayer) {
- val playerEntity as IEntityLivingBase = player;
- val playerAttribute as AttributeInstance = playerEntity.getAttribute("generic.attackDamage");
- val damageBoostUUID as string = "f264a9eb-a8f8-4cfb-bea5-0dcc296a29dd";
- val damageBoostModifier as AttributeModifier = AttributeModifier.createModifier("effect.damageBoost 3", 12.0, 0, damageBoostUUID);
- if (wearingFullSetAndCharged(player) == true) {
- if !(playerAttribute.hasModifier(damageBoostModifier) == true) {
- playerAttribute.applyModifier(damageBoostModifier);
- }
- } else {
- if playerAttribute.hasModifier(damageBoostModifier) == true {
- playerAttribute.removeModifier(damageBoostUUID);
- }
- }
- }
- function wearingFullSetAndCharged(player as IPlayer) as bool {
- if ((!(isNull(player.getInventoryStack(39)))) && (!(isNull(player.getInventoryStack(38)))) && (!(isNull(player.getInventoryStack(37)))) && (!(isNull(player.getInventoryStack(36))))) {
- val armorArray = {
- 1 : player.getInventoryStack(39),
- 2 : player.getInventoryStack(38),
- 3 : player.getInventoryStack(37),
- 4 : player.getInventoryStack(36)
- } as IItemStack[int];
- val tagArray = {
- 1 : {head : armorArray[1].tag},
- 2 : {torso : armorArray[2].tag},
- 3 : {legs : armorArray[3].tag},
- 4 : {feet : armorArray[4].tag}
- } as IData[int];
- if (((armorArray[1].definition.id).matches("powersuits:powerarmor_head"))
- && ((armorArray[2].definition.id).matches("powersuits:powerarmor_torso"))
- && ((armorArray[3].definition.id).matches("powersuits:powerarmor_legs"))
- && ((armorArray[4].definition.id).matches("powersuits:powerarmor_feet"))) {
- if ((!(isNull(tagArray[1].head.MMModItem.currEnergy)))
- && (!(isNull(tagArray[2].torso.MMModItem.currEnergy)))
- && (!(isNull(tagArray[3].legs.MMModItem.currEnergy)))
- && (!(isNull(tagArray[4].feet.MMModItem.currEnergy)))) {
- return true;
- } else {
- return false;
- }
- }
- if (((armorArray[1].definition.id).matches("redstonearsenal:armor.helmet_flux"))
- && ((armorArray[2].definition.id).matches("redstonearsenal:armor.plate_flux"))
- && ((armorArray[3].definition.id).matches("redstonearsenal:armor.legs_flux"))
- && ((armorArray[4].definition.id).matches("redstonearsenal:armor.boots_flux"))) {
- if (((tagArray[1].head.Energy) as int > 0)
- && ((tagArray[2].torso.Energy) as int > 0)
- && ((tagArray[3].legs.Energy) as int > 0)
- && ((tagArray[4].feet.Energy) as int > 0)) {
- return true;
- } else {
- return false;
- }
- }
- }
- return false;
- }
- events.onPlayerTick(function (event as PlayerTickEvent) {
- if (event.phase == "START") {
- playerModifier(event.player);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment