예제 #1
0
        public override void ModifyBuffTip(ref string tip, ref int rare)
        {
            tip = "";
            FishPlayer pl = Main.player[Main.myPlayer].GetModPlayer <FishPlayer>(mod);

            if (pl.hasAnyBaitBuffs())
            {
                tip += Description.GetTranslation(Language.ActiveCulture) + "\n";
                for (int i = 0; i < pl.baitBuff.Length; i++)
                {
                    if (pl.baitBuff[i] > 0)
                    {
                        tip += Lang.GetBuffName(pl.baitBuff[i]) + "\n";
                    }
                }
                tip += "\n";
            }
            if (pl.hasAnyBaitDebuffs())
            {
                tip += "You are inflicting the following Debuffs:" + "\n";
                for (int i = 0; i < pl.baitDebuff.Length; i++)
                {
                    if (pl.baitDebuff[i] > 0)
                    {
                        tip += Lang.GetBuffName(pl.baitDebuff[i]) + "\n";
                    }
                }
            }
        }
예제 #2
0
        public override void OnHitPvp(Player target, int damage, bool crit)
        {
            FishPlayer        pl    = Main.player[projectile.owner].GetModPlayer <FishPlayer>();
            PoweredBaitDebuff pbdbf = mod.GetBuff <PoweredBaitDebuff>();

            if (pl.hasAnyBaitDebuffs())
            {
                target.AddBuff(pbdbf.Type, 120);
                FishPlayer    tpl     = target.GetModPlayer <FishPlayer>();
                List <Player> players = new List <Player>();
                players.Add(Main.player[projectile.owner]);
                List <int> debuffs = pbdbf.getBaitDebuffsFromPlayers(players);
                pbdbf.addAllBuffsToList(tpl, debuffs);
            }
        }
예제 #3
0
        public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
        {
            FishPlayer        pl    = Main.player[projectile.owner].GetModPlayer <FishPlayer>();
            PoweredBaitDebuff pbdbf = mod.GetBuff <PoweredBaitDebuff>();

            if (pl.hasAnyBaitDebuffs())
            {
                target.AddBuff(pbdbf.Type, 120);
                FishGlobalNPC gnpc    = target.GetGlobalNPC <FishGlobalNPC>();
                List <Player> players = new List <Player>();
                players.Add(Main.player[projectile.owner]);
                List <int> debuffs = pbdbf.getBaitDebuffsFromPlayers(players);
                pbdbf.addAllBuffsToList(target, gnpc, debuffs);
            }
        }
예제 #4
0
        public virtual void applyDamageAndDebuffs(NPC npc, Player player)
        {
            FishPlayer fOwner = player.GetModPlayer <FishPlayer>();
            int        pbdbf  = mod.BuffType <PoweredBaitDebuff>();

            if (fOwner.hasAnyBaitDebuffs())
            {
                // ErrorLogger.Log("Adding Powered Bait Debuff from player " + fOwner.player.whoAmI);
                npc.AddBuff(pbdbf, 120);
                //fOwner.updateBaits();
                //ErrorLogger.Log("Added debuff");
            }
            if (bobTime() > 0)
            {
                if (timeSinceLastBob <= 0)
                {
                    timeSinceLastBob = bobTime();
                    damageNPC(npc);
                    bobsSinceAttatched++;
                }
                timeSinceLastBob--;
            }
        }