当前位置: 首页>>代码示例>>C#>>正文


C# Terraria.Player类代码示例

本文整理汇总了C#中Terraria.Player的典型用法代码示例。如果您正苦于以下问题:C# Player类的具体用法?C# Player怎么用?C# Player使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Player类属于Terraria命名空间,在下文中一共展示了Player类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Shoot

 public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
 {
     Vector2 direction = new Vector2(speedX, speedY);
     direction.Normalize();
     position += direction * item.width;
     return true;
 }
开发者ID:Eldrazi,项目名称:Pletharia,代码行数:7,代码来源:SuperSapphireStaff.cs

示例2: GetLightPosition

		private Vector2 GetLightPosition(Player player)
		{
			Vector2 position = Main.screenPosition;
			position.X += Main.mouseX;
			position.Y += player.gravDir == 1 ? Main.mouseY : Main.screenHeight - Main.mouseY;
			return position;
		}
开发者ID:DrakoGlyph,项目名称:tModLoader,代码行数:7,代码来源:SparklingSphere.cs

示例3: DamagePVP

        /// <summary>
        /// When a <see cref="Player" /> in PvP is damaged by the <see cref="Projectile" />.
        /// </summary>
        /// <param name="p">The <see cref="Player" /> that got damaged.</param>
        /// <param name="dir">In which direction the <see cref="Player"/> got hit.</param>
        /// <param name="dmg">The damage dealt to the <see cref="Player" />.</param>
        /// <param name="crit">Wether it was a critical hit or not.</param>
        /// <param name="cMult">The damage multiplier of a critical hit.</param>
        public override void DamagePVP(Player p, int dir, ref int dmg, ref bool crit, ref float cMult)
        {
            base.DamagePVP(p, dir, ref dmg, ref crit, ref cMult);

            if (Main.rand.Next(3) == 0)
                p.AddBuff(20, 300);
        }
开发者ID:RainbowDashGaming,项目名称:Terraria-Avalon-MODIFIED,代码行数:15,代码来源:Sporalash+Ball.cs

示例4: PostLoad

        public static void PostLoad(Player p)
        {
            magicFindBonus = 0f; //Reset bonus

            oldHealth = p.statLifeMax;
            oldMana = p.statManaMax;
        }
开发者ID:ThentyZ,项目名称:tConfig-Mods,代码行数:7,代码来源:Player.cs

示例5: MeleeEffects

 public override void MeleeEffects(Player player, Rectangle hitbox)
 {
     if (Main.rand.Next(3) == 0)
     {
     int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, mod.DustType("CCSparkle"));
     }
 }
开发者ID:MountainDrew8,项目名称:CalamityMod,代码行数:7,代码来源:CatastropheClaymore.cs

示例6: ArmorSetBonus

        /// <summary>
        /// 
        /// </summary>
        /// <param name="p"></param>
        public override void ArmorSetBonus(Player p)
        {
            Main.dust[Dust.NewDust(p.position, p.width, p.height, 27, 0, 0, 200, Color.Purple, 1.0f)].noGravity = true;

            p.setBonus = "The Dark Matter has spread";
            p.invis = true;
        }
开发者ID:RainbowDashGaming,项目名称:Terraria-Avalon-MODIFIED,代码行数:11,代码来源:Dark+Matter+Chest.cs

示例7: TSPlayer

 protected TSPlayer(String playerName)
 {
     TilesDestroyed = new Dictionary<Vector2, Tile>();
     Index = -1;
     FakePlayer = new Player { name = playerName, whoAmi = -1 };
     Group = new Group("null");
 }
开发者ID:grimfandango,项目名称:TShock,代码行数:7,代码来源:TSPlayer.cs

示例8: UpdateVanitySet

		public virtual void UpdateVanitySet(Player player)
		{
			if (item != null)
			{
				item.UpdateVanitySet(player);
			}
		}
开发者ID:DrakoGlyph,项目名称:tModLoader,代码行数:7,代码来源:EquipTexture.cs

示例9: ArmorSetShadows

		public virtual void ArmorSetShadows(Player player, ref bool longTrail, ref bool smallPulse, ref bool largePulse, ref bool shortTrail)
		{
			if (item != null)
			{
				item.ArmorSetShadows(player, ref longTrail, ref smallPulse, ref largePulse, ref shortTrail);
			}
		}
开发者ID:DrakoGlyph,项目名称:tModLoader,代码行数:7,代码来源:EquipTexture.cs

示例10: OnHitPlayer

 public override void OnHitPlayer(Player player, int damage, bool crit)
 {
     if(Main.expertMode || Main.rand.Next(2) == 0)
     {
     player.AddBuff(BuffID.OnFire, 600, true);
     }
 }
开发者ID:digitalseraphim,项目名称:tModLoader,代码行数:7,代码来源:AbominationRun.cs

示例11: UpdateVanity

		public virtual void UpdateVanity(Player player, EquipType type)
		{
			if (item != null)
			{
				item.UpdateVanity(player, type);
			}
		}
开发者ID:DrakoGlyph,项目名称:tModLoader,代码行数:7,代码来源:EquipTexture.cs

示例12: UpdateAccessory

        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            player.accRunSpeed = 6.75f;
            player.rocketBoots = 3;
            player.moveSpeed += 0.08f;
            player.iceSkate = true;

            if ((player.mount == null || player.mount.Type == 0 || !player.mount.Active) && !player.wet)
            {
                int minX = (int)(player.position.X / 16) - 1;
                int maxX = (int)(player.position.X / 16) + 3;
                int y = (int)(player.position.Y / 16) + 3;
                for (int x = minX; x < maxX; ++x)
                {
                    Tile tile = Main.tile[x, y];
                    if (tile.liquidType() == Tile.Liquid_Water && tile.liquid > 25 && !tile.active())
                    {
                        tile.active(true);
                        tile.type = TileID.BreakableIce;
                        tile.inActive(false);

                        Main.PlaySound(19, (int)player.position.X, (int)player.position.Y, 1);
                        Main.tile[x, y].liquid = 0;

                        WorldGen.SquareTileFrame(x, y, true);
                    }
                }
            }
        }
开发者ID:Eldrazi,项目名称:Gyrolite,代码行数:29,代码来源:FreezingBoots.cs

示例13: ReadCustomData

 internal static void ReadCustomData(Player player, BinaryReader reader)
 {
     int count = reader.ReadUInt16();
     for (int k = 0; k < count; k++)
     {
         string modName = reader.ReadString();
         string name = reader.ReadString();
         byte[] data = reader.ReadBytes(reader.ReadUInt16());
         Mod mod = ModLoader.GetMod(modName);
         ModPlayer modPlayer = mod == null ? null : player.GetModPlayer(mod, name);
         if (modPlayer != null)
         {
             using (MemoryStream stream = new MemoryStream(data))
             {
                 using (BinaryReader customReader = new BinaryReader(stream))
                 {
                     modPlayer.LoadCustomData(customReader);
                 }
             }
             if (modName == "ModLoader" && name == "MysteryPlayer")
             {
                 ((MysteryPlayer)modPlayer).RestoreData(player);
             }
         }
         else
         {
             ModPlayer mystery = player.GetModPlayer(ModLoader.GetMod("ModLoader"), "MysteryPlayer");
             ((MysteryPlayer)mystery).AddData(modName, name, data);
         }
     }
 }
开发者ID:trekko727,项目名称:tModLoader,代码行数:31,代码来源:PlayerIO.cs

示例14: OnHitNPC

 public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
 {
     if(!target.boss)
     {
     target.velocity.Y -= 5;
     }
 }
开发者ID:ColinAV516,项目名称:EnergyMod,代码行数:7,代码来源:SoaringBat.cs

示例15: UpdateFrame

        public override bool UpdateFrame(Player player, int state, Vector2 velocity)
        {
            cool++;
            Vector2 position = Main.screenPosition;
            position.X += Main.mouseX;
            position.Y += Main.mouseY;
            Vector2 vector = Vector2.Subtract(position,player.position);
            if (velocity.Length() > 2f)
            {
                player.gravity = 0;
            }
            else
            {
                player.gravity = Player.defaultGravity;
            }
            if(cool > 60)
            {
                Main.NewText("X: "+vector.X +"  y: "+vector.Y);

            }

            player.position.Y += vector.Y > 5f ? 2.5f : vector.Y / 2;
            player.position.X += vector.X > 5f * player.direction ? 2.5f * player.direction : vector.X / 2;
            //vector = Vector2.Normalize(vector);
            //if (cool > 60)
            //{
            //    Main.NewText("X: " + vector.X + "  y: " + vector.Y);
            //    cool = 0;
            //}
            //player.position.Y += vector.Y * 2f;
            //player.position.X += vector.X;

            return true;
        }
开发者ID:itamargreen,项目名称:Terraria1,代码行数:34,代码来源:Car.cs


注:本文中的Terraria.Player类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。