コード例 #1
0
 public override bool ConsumeItem(Item item, Player player)
 {
     if (item.thrown)
     {
         return(TrapDamageItems.SavingChanceMethod(player));
     }
     else
     {
         return(true);
     }
 }
コード例 #2
0
        public override GlobalItem Clone(Item item, Item itemClone)
        {
            TrapDamageItems myClone = (TrapDamageItems)base.Clone(item, itemClone);

            myClone.armorbreak         = armorbreak;
            myClone.damage2            = damage2;
            myClone.throweruserate     = throweruserate;
            myClone.thrownvelocity     = thrownvelocity;
            myClone.thrownsavingchance = thrownsavingchance;
            myClone.apocochance        = apocochance;
            myClone.greed               = greed;
            myClone.damageacc           = damageacc;
            myClone.damagecrit          = damagecrit;
            myClone.apocochancestrength = apocochancestrength;
            return(myClone);
        }
コード例 #3
0
        public override void Apply(Item item)
        {
            TrapDamageItems myitem = item.GetGlobalItem <TrapDamageItems>();

            myitem.armorbreak         = armorbreak;
            myitem.damage2            = damage;
            myitem.throweruserate     = throweruserate;
            myitem.thrownvelocity     = thrownvelocity;
            myitem.thrownsavingchance = throwersavingchance;
            myitem.apocochance        = apocochance;
            myitem.greed               = greed;
            myitem.damageacc           = damageacc;
            myitem.damagecrit          = damagecrit;
            myitem.apocochancestrength = apocochancestrength;

            /*if (item.damage > 0)
             * {
             * item.damage = (int)(item.damage * (1f + damage));
             * }*/
            //myitem.damage = damage;
        }
コード例 #4
0
        public override void Apply(Item item)
        {
            Main.NewText("UBER PREFIX!!!");
            TrapDamageItems myitem = item.GetGlobalItem <TrapDamageItems>();

            if (item.damage > 0)
            {
                item.damage += (int)(item.damage * uber[0]);
            }
            myitem.damageacc += uber[0];
            if (item.knockBack > 0)
            {
                item.knockBack += uber[1];
            }
            if (item.useTime > 0)
            {
                item.useTime      = (int)(item.useTime / (1 + uber[2]));
                item.useAnimation = (int)(item.useTime / (1 + uber[2]));
            }
            item.scale = (int)(item.scale * (1 + uber[3]));
            if (item.shoot > 0)
            {
                item.shootSpeed += uber[4];
            }
            if (item.mana > 0)
            {
                item.mana = (int)(item.mana / (1 + uber[5]));
            }
            item.crit         += (int)uber[6];
            myitem.damagecrit += (int)uber[6];

            int itt = Projectile.NewProjectile(Main.LocalPlayer.Center, new Vector2(0, -5), ProjectileID.FireworkFountainRainbow, 0, 0);

            Main.projectile[itt].timeLeft = 90;
            base.Apply(item);
        }