Exemplo n.º 1
0
        public static void Proc(EntModItem item, NPC target, int damage)
        {
            int   statloss = 0;
            float basestat = item.realstat;

reproc:
            float stat = statloss == 0?basestat:(basestat - (100 * statloss)) / (statloss + 1);

            if (stat >= Main.rand.NextFloat(0, 100))
            {
                int stattype = Entropy.StatTypeCalc(item.dmgratio);

                /*if(stattype == 0){
                 *      target.AddBuff(ModContent.BuffType("SlashProc"), 600);
                 * }else if(stattype == 1){
                 *      target.AddBuff(ModContent.BuffType("SlashProc"), 600);
                 * }else if(stattype == 2){
                 *      target.AddBuff(ModContent.BuffType("SlashProc"), 600);
                 * }else{*/
                //if(Entropy.dmgtypes[stattype] == "Slash" && !target.HasBuff(ModContent.BuffType(Entropy.dmgtypes[stattype]+"Proc")))target.AddBuff(ModContent.BuffType(Entropy.dmgtypes[stattype]+"Proc"), 1);
                //Main.NewText(Entropy.dmgtypes[stattype]+"Proc");
                //target.AddBuff(ModContent.BuffType(Entropy.dmgtypes[stattype]+"Proc"), (int)(item.item.damage*0.35));
                BuffBase buff = BuffBase.GetFromIndex(target, stattype, damage, Main.player[item.item.owner]);
                EntropyGlobalNPC.AddBuff(buff);
                //Main.NewText(buff);
                //Dust.NewDust(target.Center - new Vector2(0,target.height/2),0,0,mod.DustType(Entropy.dmgtypes[stattype]+"ProcDust"));
                //}
            }
            if (item.reproc && (stat - 100) > 0)
            {
                statloss++;
                goto reproc;
            }
        }
Exemplo n.º 2
0
 public override void ModifyHitItem(Player attacker, EntModItem item, NPC target, ref int damage, ref bool crit, ref float[] dr)
 {
     item.addElement(type, amount);
     if (crit)
     {
         AddBuff(BuffBase.GetFromIndex(target, type, damage / 3, attacker));
     }
 }
Exemplo n.º 3
0
        static bool canUseCheck(Item it, Item item)
        {
            if (it.IsAir)
            {
                return(true);
            }
            EntModItemMod mit   = it?.modItem as EntModItemMod;
            EntModItem    mitem = item?.modItem as EntModItem;

            return(mit.CanApply(mitem));
        }
Exemplo n.º 4
0
        public float comboget()
        {
            EntModItem emi = player.HeldItem.modItem as EntModItem;
            float      ch  = 5;
            float      cd  = 0.5f;

            if (emi != null)
            {
                ch = emi.combohits;
                cd = emi.comboDMG;
            }
            return(EntModItem.comboMult(combocounter, ch, cd));
        }
Exemplo n.º 5
0
 public float comboget(float ch, float cd)
 {
     return(EntModItem.comboMult(combocounter, ch, cd));
 }
Exemplo n.º 6
0
 public virtual void ModifyHitItem(Player attacker, EntModItem item, NPC target, ref int damage, ref bool crit, ref float[] dr)
 {
 }