• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Creature类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: PlayerEquipsItem

	public void PlayerEquipsItem(Creature creature, Item item)
	{
		// Give Ranged Attack when equipping a (cross)bow
		if ((item.HasTag("/bow/|/bow01/|/crossbow/")) && !creature.Skills.Has(SkillId.RangedAttack))
			creature.Skills.Give(SkillId.RangedAttack, SkillRank.Novice);

		// Give Dice Tossing When equiping Dice
		if ((item.HasTag("/dice/")) && !creature.Skills.Has(SkillId.DiceTossing))
			creature.Skills.Give(SkillId.DiceTossing, SkillRank.Novice);

		// Give Playing Instrument when equipping an instrument
		if ((item.HasTag("/instrument/")) && !creature.Skills.Has(SkillId.PlayingInstrument))
			creature.Skills.Give(SkillId.PlayingInstrument, SkillRank.Novice);

		// Give Potion Making when equipping a Potion Concoction Kit
		if ((item.HasTag("/potion_making/kit/")) && !creature.Skills.Has(SkillId.PotionMaking))
			creature.Skills.Give(SkillId.PotionMaking, SkillRank.Novice);

		// Give Handicraft when equipping a Handicraft Kit
		if ((item.HasTag("/handicraft_kit/")) && !creature.Skills.Has(SkillId.Handicraft))
			creature.Skills.Give(SkillId.Handicraft, SkillRank.RF);

		// Give Tailoring when equipping a Tailoring Kit
		if ((item.HasTag("/tailor/kit/")) && !creature.Skills.Has(SkillId.Tailoring))
			creature.Skills.Give(SkillId.Tailoring, SkillRank.Novice);

		// Give Blacksmithing when equipping a Blacksmith Hammer
		if ((item.HasTag("/tool/blacksmith/")) && !creature.Skills.Has(SkillId.Blacksmithing))
			creature.Skills.Give(SkillId.Blacksmithing, SkillRank.Novice);
	}
开发者ID:tkiapril,项目名称:aura,代码行数:30,代码来源:on_equip.cs


示例2: Equip

        public bool Equip(Creature user)
        {
            LogFile.Log.LogEntryDebug("Book equipped", LogDebugLevel.Medium);

            Game.Dungeon.Player.PlotItemsFound++;

            //This is plot equipment

            //Give player story. Mention level up if one will occur.
            if (Game.Dungeon.Player.PlayItemMovies)
            {
                Screen.Instance.PlayMovie("plotbook", true);
            }

            //Messages
            Game.MessageQueue.AddMessage("Levelled up!");

            //Level up?
            Game.Dungeon.Player.LevelUp();

            //Add move?
            //Game.Dungeon.LearnMove(new SpecialMoves.VaultBackstab());
            //Screen.Instance.PlayMovie("vaultbackstab", false);

            //Add any equipped (actually permanent) effects
            //Game.Dungeon.Player.Speed += 10;

            return true;
        }
开发者ID:Sinellil,项目名称:roguelike-cs,代码行数:29,代码来源:Book.cs


示例3: Init

    public override void Init(Creature ownerCreature, Weapon weapon, Weapon.FiringDesc targetAngle)
    {
        base.Init(ownerCreature, weapon, targetAngle);

        transform.parent = ownerCreature.WeaponHolder.transform;
        transform.localPosition = Vector3.zero;
    }
开发者ID:yakolla,项目名称:MarineVsAlien,代码行数:7,代码来源:MeleeBullet.cs


示例4: Use

        public bool Use(Creature user)
        {
            //Currently healing is implemented as a player effect so we need to check the user is a player
            Player player = user as Player;

            //Not a player
            if (player == null)
            {
                return false;
            }

            //Add a message
            Game.MessageQueue.AddMessage("You drink the potion.");

            //Apply the speed up effect to the player
            //Duration note 100 is normally 1 turn for a non-sped up player

            int duration = 30 * Creature.turnTicks + Game.Random.Next(50 * Creature.turnTicks);
            int speedUpAmount = 75 + Game.Random.Next(50);

            player.AddEffect(new PlayerEffects.SpeedUp(duration, speedUpAmount));

            //This uses up the potion
            usedUp = true;

            return true;
        }
开发者ID:Sinellil,项目名称:roguelike-cs,代码行数:27,代码来源:PotionMajSpeedUp.cs


示例5: Use

        public bool Use(Creature user)
        {
            //Currently healing is implemented as a player effect so we need to check the user is a player
            Player player = user as Player;

            //Not a player
            if (player == null)
            {
                return false;
            }

            Game.MessageQueue.AddMessage("You eat the berry.");

            //Apply the healing effect to the player

            int delta = (int)Math.Ceiling(Game.Dungeon.Player.MaxHitpointsStat / 4.0);
            if (delta < 10)
                delta = 10;

            int healing = 10 + Game.Random.Next(delta);
            player.AddEffect(new PlayerEffects.Healing(healing));

            //Add a message

            //This uses up the potion
            usedUp = true;

            return true;
        }
开发者ID:Sinellil,项目名称:roguelike-cs,代码行数:29,代码来源:Potion.cs


示例6: Debug

 private void Debug(ref Creature Creature_Editor)
 {
     Layout.Bool("Player", ref Creature_Editor.Player);
     Layout.Float("Storey", ref Creature_Editor.Storey);
     Layout.Float("Height", ref Creature_Editor.Height);
     EditorGUILayout.PropertyField(AI,true);
 }
开发者ID:phoenixanimations,项目名称:Port-02,代码行数:7,代码来源:Creature_GUI.cs


示例7: Use

    public override bool Use(Creature obj)
    {
        switch(RefItemID)
        {
        case 21:
            obj.WeaponHolder.ActiveWeaponSkillFire(Const.NuclearRefItemId, obj.transform.eulerAngles.y);
            break;
        case 22:
            return obj.ApplyMachoSkill();
        case 23:
            return obj.ApplyHealingSkill();
        case 24:
            return obj.ApplyDamageMultiplySkill();
        case 25:
            Weapon weapon = obj.WeaponHolder.GetPassiveSkillWeapon(130);
            if (weapon != null)
            {
                weapon.LevelUp();
            }
            else
            {
                obj.EquipPassiveSkillWeapon(new ItemWeaponData(130), new RefMob.WeaponDesc());
            }
            break;

        }
        return true;
    }
开发者ID:yakolla,项目名称:MarineVsAlien,代码行数:28,代码来源:ItemSkillData.cs


示例8: CalculateCost

        public void CalculateCost(TileMap tileMap, Creature creature, Point endPoint,byte additionalCost, bool improved)
        {
            //H = Math.Max(Math.Abs(Position.X - endPoint.X), Math.Abs(Position.Y - endPoint.Y)) * 30;
            //   H = (Math.Abs(Position.X - endPoint.X) + Math.Abs(Position.Y - endPoint.Y))*10;
            //H = Math.Abs(Position.X - endPoint.X) + Math.Abs(Position.Y - endPoint.Y);
            if(false)
            if (!improved)
            {
                int xDistance = Math.Abs(PositionX - endPoint.X);
                int yDistance = Math.Abs(PositionY - endPoint.Y);
                if (xDistance > yDistance)
                    H = 14 * yDistance + 10 * (xDistance - yDistance);
                else
                    H = 14 * xDistance + 10 * (yDistance - xDistance);
            }
            else
                H = 0;

             //   H = (Math.Abs(PositionX - endPoint.X) - Math.Abs(PositionY - endPoint.Y)) * 10;

            if (Parent != null)
                if (type)
                    G = Parent.G + 10;
                else
                    G = Parent.G + 14;
            else
                G = 0;
            Cost = G + H;//+ (tileMap[PositionX, PositionY] != CellType.Ladder ? 10000 : 0) + additionalCost
                  // + (tileMap[PositionX, PositionY + 1] == CellType.Wall ? 0 : 5000);

            //  if (creature != null)
            //   Cost += (int)(100 / creature.Body.GetWalkSpeed(creature.Map.terrain[PositionX, PositionY]));
        }
开发者ID:mokujin,项目名称:DN,代码行数:33,代码来源:WayPoint.cs


示例9: Cast

 public void Cast(Creature caster)
 {
     if (OnCast != null)
     {
         OnCast(caster);
     }
 }
开发者ID:drawpixel,项目名称:DHunter,代码行数:7,代码来源:Skill.cs


示例10: Equip

        public bool Equip(Creature user)
        {
            LogFile.Log.LogEntryDebug("Boots equipped", LogDebugLevel.Medium);

            Game.Dungeon.Player.PlotItemsFound++;

            //This is plot equipment

            //Give player story. Mention level up if one will occur.

            if (Game.Dungeon.Player.PlayItemMovies)
            {
                Screen.Instance.PlayMovie("plotboots", true);
                Screen.Instance.PlayMovie("wallvault", false);
            }

            //Messages
            //Game.MessageQueue.AddMessage("Levelled up!");
            Game.MessageQueue.AddMessage("Learnt Charge Attack!");

            //Screen.Instance.PlayMovie("plotboots", true);

            //Level up?
            //Game.Dungeon.Player.LevelUp();

            //Add move?
            Game.Dungeon.LearnMove(new SpecialMoves.ChargeAttack());
            //Screen.Instance.PlayMovie("wallvault", false);

            //Add permanent speed increase
            //Game.Dungeon.Player.Speed += 10;

            return true;
        }
开发者ID:Sinellil,项目名称:roguelike-cs,代码行数:34,代码来源:Boots.cs


示例11: CalculateCost

        public void CalculateCost(Creature creature, Point endPoint, bool improved)
        {
            //H = Math.Max(Math.Abs(Position.X - endPoint.X), Math.Abs(Position.Y - endPoint.Y)) * 30;
            //   H = (Math.Abs(Position.X - endPoint.X) + Math.Abs(Position.Y - endPoint.Y))*10;
            //H = Math.Abs(Position.X - endPoint.X) + Math.Abs(Position.Y - endPoint.Y);

            if (!improved)
            {
                int xDistance = Math.Abs(PositionX - endPoint.X);
                int yDistance = Math.Abs(PositionY - endPoint.Y);
                if (xDistance > yDistance)
                    H = 14 * yDistance + 10 * (xDistance - yDistance);
                else
                    H = 14 * xDistance + 10 * (yDistance - xDistance);
            }
            else
                H = 0;

            if (Parent != null)
                if (type)
                    G = Parent.G + 10;
                else
                    G = Parent.G + 14;
            else
                G = 0;
            Cost = G + H;
              //  if (creature != null)
             //   Cost += (int)(100 / creature.Body.GetWalkSpeed(creature.Map.terrain[PositionX, PositionY]));
        }
开发者ID:dvdking,项目名称:PeoplePolder,代码行数:29,代码来源:WayPoint.cs


示例12: addCreature

 public void addCreature(Creature cr)
 {
     creatures.Add(cr);
     if (creatures.Count > 1) {
         Console.WriteLine((creatures[creatures.Count-2] as Creature).name + " позвал " + (creatures[creatures.Count-1] as Creature).name + "\n");
     }
 }
开发者ID:kolombet,项目名称:labs,代码行数:7,代码来源:task5.cs


示例13: OnCollisionEnter2D

	void OnCollisionEnter2D(Collision2D col){
		collisionCreature = col.gameObject.GetComponent<Creature>();

		if(collisionCreature && !died){
			collisionCreature.TakeDamage(Random.Range(5, 25));
		}
	}
开发者ID:pravusjif,项目名称:PravusUnityTests,代码行数:7,代码来源:Creature.cs


示例14: OnPlayerEntersRegion

	public void OnPlayerEntersRegion(Creature creature)
	{
		if (!creature.IsPlayer)
			return;

		// Set BGM if there is one set for creature's region, this will
		// replace BGMs set before.
		Track track;
		if (_regions.TryGetValue(creature.RegionId, out track))
		{
			Send.SetBgm(creature, track.FileName, track.Repeat);
			_playerStorage[creature.EntityId] = track.FileName;
			return;
		}

		// If no BGM is available for the new region, but one was set before,
		// unset it.
		lock (_playerStorage)
		{
			if (_playerStorage.ContainsKey(creature.EntityId))
			{
				Send.UnsetBgm(creature, _playerStorage[creature.EntityId]);
				_playerStorage.Remove(creature.EntityId);
			}
		}
	}
开发者ID:aura-project,项目名称:aura,代码行数:26,代码来源:custom_bgm.cs


示例15: OnCreatureFinishedProductionOrCollection

	public void OnCreatureFinishedProductionOrCollection(Creature creature, bool success)
	{
		// the Butterfingers
		// Show if failed collecting or production something 5 times in a
		// rown, give it at 10 fails in a row.
		// ------------------------------------------------------------------
		if (creature.Titles.IsUsable(20))
			return;

		if (success)
		{
			creature.Vars.Temp["ButterfingerFailCounter"] = 0;
			return;
		}

		if (creature.Vars.Temp["ButterfingerFailCounter"] == null)
			creature.Vars.Temp["ButterfingerFailCounter"] = 0;

		var count = (int)creature.Vars.Temp["ButterfingerFailCounter"];
		count++;

		if (count >= 10)
		{
			creature.Titles.Enable(20);
			count = 0;
		}
		else if (count >= 5)
		{
			creature.Titles.Show(20);
		}

		creature.Vars.Temp["ButterfingerFailCounter"] = count;
	}
开发者ID:aura-project,项目名称:aura,代码行数:33,代码来源:titles.cs


示例16: Use

        public bool Use(Creature user)
        {
            //Currently healing is implemented as a player effect so we need to check the user is a player
            Player player = user as Player;

            //Not a player
            if (player == null)
            {
                return false;
            }

            //Add a message
            Game.MessageQueue.AddMessage("You eat the berry.");

            //Apply the healing effect to the player
            //Duration note 100 is normally 1 turn for a non-sped up player

            int duration = 10 * Creature.turnTicks + Game.Random.Next(20 * Creature.turnTicks);
            int toHitUp = 1 + Game.Random.Next(3);

            player.AddEffect(new PlayerEffects.ToHitUp(duration, toHitUp));

            //This uses up the potion
            usedUp = true;

            return true;
        }
开发者ID:Sinellil,项目名称:roguelike-cs,代码行数:27,代码来源:PotionToHitUp.cs


示例17: Awake

 void Awake()
 {
     Rigidbody = GetComponent<Rigidbody>();
     CapsuleCollider = GetComponent<CapsuleCollider>();
     Creature = GetComponent<Creature>();
     TargetPosition = transform.position;
 }
开发者ID:eduardolm87,项目名称:thingseatthingsjam,代码行数:7,代码来源:Locomotor.cs


示例18: Init

    public override void Init(Creature ownerCreature, Weapon weapon, Weapon.FiringDesc targetAngle)
    {
        base.Init(ownerCreature, weapon, targetAngle);

        m_weapon = weapon as GuidedRocketLauncher;
        m_selfDestoryTime = Time.time + 5f;
    }
开发者ID:yakolla,项目名称:MarineVsAlien,代码行数:7,代码来源:GuidedRocketLauncherBullet.cs


示例19: OnUse

	public override void OnUse(Creature creature, Item item, string parameter)
	{
		var rnd = RandomProvider.Get();
		var rndItem = Item.GetRandomDrop(rnd, items);

		creature.AcquireItem(rndItem);
	}
开发者ID:aura-project,项目名称:aura,代码行数:7,代码来源:93951_permanent_tail_gachapon.cs


示例20: Equip

        public bool Equip(Creature user)
        {
            LogFile.Log.LogEntryDebug("FragGrenade equipped", LogDebugLevel.Medium);

            //Give player story. Mention level up if one will occur.

            if (Game.Dungeon.Player.PlayItemMovies)
            {
                //Screen.Instance.PlayMovie("plotbadge", true);
                //Screen.Instance.PlayMovie("multiattack", false);
            }

            //Messages
            //Game.MessageQueue.AddMessage("A fine short sword - good for slicing and dicing.");

            //Screen.Instance.PlayMovie("plotbadge", true);

            //Level up?
            //Game.Dungeon.Player.LevelUp();

            //Add move?
            //Game.Dungeon.LearnMove(new SpecialMoves.MultiAttack());
            //Screen.Instance.PlayMovie("multiattack", false);

            //Add any equipped (actually permanent) effectsf
            //Game.Dungeon.Player.Speed += 10;

            return true;
        }
开发者ID:Sinellil,项目名称:roguelike-cs,代码行数:29,代码来源:FragGrenade.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Credential类代码示例发布时间:2022-05-24
下一篇:
C# CreationContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap