本文整理汇总了C#中Creature类的典型用法代码示例。如果您正苦于以下问题:C# Creature类的具体用法?C# Creature怎么用?C# Creature使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Creature类属于命名空间,在下文中一共展示了Creature类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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]));
}
示例9: Cast
public void Cast(Creature caster)
{
if (OnCast != null)
{
OnCast(caster);
}
}
示例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;
}
示例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]));
}
示例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");
}
}
示例13: OnCollisionEnter2D
void OnCollisionEnter2D(Collision2D col){
collisionCreature = col.gameObject.GetComponent<Creature>();
if(collisionCreature && !died){
collisionCreature.TakeDamage(Random.Range(5, 25));
}
}
示例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);
}
}
}
示例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;
}