コード例 #1
0
        public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource)
        {
            if (this.player.whoAmI != Main.myPlayer)
            {
                return;
            }

            if (Main.netMode == NetmodeID.MultiplayerClient && pvp)
            {
                TerrariaMobaUtils.MobaKill(damageSource.SourcePlayerIndex);
            }
            else
            {
                TerrariaMobaUtils.MobaKill(PlayerLastHurt);
            }
        }
コード例 #2
0
        public int GetYPos()
        {
            int posX = (int)projectile.Bottom.X;
            int posY = (int)projectile.Bottom.Y;

            if (TerrariaMobaUtils.TileIsSolidOrPlatform(posX / 16, posY / 16))
            {
                while (TerrariaMobaUtils.TileIsSolidOrPlatform(posX / 16, posY / 16))
                {
                    posY -= 1;
                }
            }
            else
            {
                while (!TerrariaMobaUtils.TileIsSolidOrPlatform(posX / 16, posY / 16))
                {
                    posY += 1;
                }
            }
            return(posY);
        }