Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.70 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using Microsoft.Xna.Framework;
  4. using Microsoft.Xna.Framework.Graphics;
  5. using Terraria;
  6. using Terraria.Localization;
  7. using Terraria.ModLoader;
  8. using Terraria.ID;
  9.  
  10. using static Terraria.ModLoader.ModContent;
  11.  
  12. namespace Skyanull
  13. {
  14.     public class ItemTweaks : GlobalItem
  15.     {
  16.         public override void SetDefaults(Item item)
  17.         {
  18.             {
  19.                 const string GladiatorSet = "skyanull_gladiator";
  20.                 const string ObsidianSet = "skyanull_obsidian";
  21.  
  22.                 switch (item.type)
  23.                 {
  24.                     case ItemID.GladiatorHelmet:
  25.                         {
  26.                             item.rare = 1;
  27.                             item.defense = 4;
  28.                         }
  29.                         return;
  30.                     case ItemID.GladiatorBreastplate:
  31.                         {
  32.                             item.rare = 1;
  33.                             item.defense = 6;
  34.                         }
  35.                         return;
  36.                     case ItemID.GladiatorLeggings:
  37.                         {
  38.                             item.rare = 1;
  39.                             item.defense = 4;
  40.                         }
  41.                         return;
  42.                     case ItemID.ObsidianHelm:
  43.                         {
  44.                             item.rare = 1;
  45.                             item.defense = 3;
  46.                         }
  47.                         return;
  48.                     case ItemID.ObsidianShirt:
  49.                         {
  50.                             item.rare = 1;
  51.                         }
  52.                         return;
  53.                     case ItemID.ObsidianPants:
  54.                         {
  55.                             item.rare = 1;
  56.                         }
  57.                         return;
  58.                 }
  59.             }
  60.         }
  61.         public override void UpdateEquip(Item item, Player player)
  62.         {
  63.             switch (item.type)
  64.             {
  65.                 case ItemID.GladiatorHelmet:
  66.                 case ItemID.GladiatorBreastplate:
  67.                 case ItemID.GladiatorLeggings:
  68.                     player.meleeDamage += 0.05f;
  69.                     player.meleeSpeed += 0.04f;
  70.                     return;
  71.                 case ItemID.ObsidianHelm:
  72.                 case ItemID.ObsidianShirt:
  73.                 case ItemID.ObsidianPants:
  74.                     player.bulletDamage += 0.04f;
  75.                     player.rangedCrit += 3;
  76.                     return;
  77.                 case ItemID.MeteorHelmet:
  78.                 case ItemID.MeteorSuit:
  79.                 case ItemID.MeteorLeggings:
  80.                     player.magicDamage -= 0.07f;
  81.                     return;
  82.             }
  83.         }
  84.         public override string IsArmorSet(Item head, Item body, Item legs)
  85.         {
  86.             if (head.type == ItemID.GladiatorHelmet && body.type == ItemID.GladiatorBreastplate && legs.type == ItemID.GladiatorLeggings)
  87.                 return GladiatorSet;
  88.  
  89.             if (head.type == ItemID.ObsidianHelm && body.type == ItemID.ObsidianShirt && legs.type == ItemID.ObsidianPants)
  90.                 return ObsidianSet;
  91.  
  92.             return base.IsArmorSet(head, body, legs);
  93.         }
  94.         public override void UpdateArmorSet(Player player, string armorSet)
  95.         {
  96.                 if (armorSet == GladiatorSet)
  97.                 {
  98.                     player.setBonus = ("Reduced knockback");
  99.                     knockbackResist = 0.5f;
  100.                 }
  101.                 else if (armorSet == ObsidianSet)
  102.                 {
  103.                     player.setBonus = ("Gives a chance to dodge attacks");
  104.                     player.blackBelt = true;
  105.                 }
  106.             }
  107.             public override void ArmorSetShadows(Player player, string armorSet)
  108.             {
  109.                 if (armorSet == ObsidianSet)
  110.                     player.armorEffectDrawShadow = true;
  111.             }
  112.         }
  113.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement