本文整理汇总了C#中Mobile.CanSee方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.CanSee方法的具体用法?C# Mobile.CanSee怎么用?C# Mobile.CanSee使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile
的用法示例。
在下文中一共展示了Mobile.CanSee方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Target
public void Target( Mobile tinker, Mobile assembly )
{
if ( Deleted || !tinker.CanSee( this ) )
return;
int number = -1;
if ( !tinker.CanSee( assembly ) )
{
number = 500237; // Target can not be seen.
}
else if ( assembly.Hits == assembly.HitsMax )
{
number = 1044281; // That being is not damaged!
}
else
{
if ( !tinker.BeginAction( typeof( AssemblyRepairKit ) ) )
{
number = 500310;// You are busy with something else
}
else
{
TimeSpan duration = TimeSpan.FromSeconds( 8 );
InternalTimer t = new InternalTimer( this, tinker, assembly, duration );
t.Start();
tinker.SendMessage( "You begin to repair the assembly" );
return;
}
}
tinker.SendLocalizedMessage( number );
}
示例2: OnHit
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{
ClearCurrentAbility(attacker);
attacker.SendLocalizedMessage(1060084); // You attack with lightning speed!
defender.SendLocalizedMessage(1060085); // Your attacker strikes with lightning speed!
defender.PlaySound(0x3BB);
defender.FixedEffect(0x37B9, 244, 25);
// Swing again:
// If no combatant, wrong map, one of us is a ghost, or cannot see, or deleted, then stop combat
if (defender == null || defender.Deleted || attacker.Deleted || defender.Map != attacker.Map || !defender.Alive || !attacker.Alive || !attacker.CanSee(defender))
{
attacker.Combatant = null;
return;
}
IWeapon weapon = attacker.Weapon;
if (weapon == null)
return;
if (!attacker.InRange(defender, weapon.MaxRange))
return;
if (attacker.InLOS(defender))
{
BaseWeapon.InDoubleStrike = true;
attacker.RevealingAction();
attacker.NextCombatTime = DateTime.Now + weapon.OnSwing(attacker, defender);
BaseWeapon.InDoubleStrike = false;
}
}
示例3: SendMessageTo
private void SendMessageTo( Mobile to, string text, int hue )
{
if ( Deleted || !to.CanSee( this ) )
return;
to.Send( new Network.UnicodeMessage( Serial, ItemID, Network.MessageType.Regular, hue, 3, "ENU", "", text ) );
}
示例4: OnMovement
public override void OnMovement(Mobile m, Point3D oldLocation)
{
if (DateTime.UtcNow >= LastSpit && m.InRange(Location, 6) && m.CanSee(this))
{
PublicOverheadMessage(MessageType.Emote, 61, true, "*spits*");
Effects.PlaySound(m.Location, m.Map, 0x19C);
Timer.DelayCall(
TimeSpan.FromMilliseconds(100),
() =>
{
int bloodID = Utility.RandomMinMax(4650, 4655);
new MovingEffectInfo(this, m, m.Map, bloodID, 60).MovingImpact(
info =>
{
var blood = new Blood
{
Name = "slime",
ItemID = bloodID,
Hue = 61
};
blood.MoveToWorld(info.Target.Location, info.Map);
Effects.PlaySound(info.Target, info.Map, 0x028);
});
});
LastSpit = DateTime.UtcNow + TimeSpan.FromSeconds(10);
}
base.OnMovement(m, oldLocation);
}
示例5: SendMessageTo
private void SendMessageTo( Mobile to, int number, int hue )
{
if ( Deleted || !to.CanSee( this ) )
return;
to.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, hue, 3, number, "", "" ) );
}
示例6: SendMessageTo
private void SendMessageTo(Mobile to, string text, int hue)
{
if (Deleted || !to.CanSee(this))
return;
to.Send(new UnicodeMessage(Serial, ItemID, MessageType.Regular, hue, 3, to.Language, "", text));
}
示例7: Grab_OnTarget
private static void Grab_OnTarget(Mobile from, object target)
{
if (!from.Alive || !from.CanSee(target) || !(target is Container))
return;
bool canLoot = false;
Container cont = (Container)target;
if (target is Corpse)
{
Corpse c = (Corpse)target;
if (c.Owner == null || c.Killer == null) //unable to determine cause of death
{
canLoot = true;
}
if (c.Owner is PlayerMobile)
{
canLoot = false;
from.SendMessage("You cannot loot a player corpse.");
}
else if (c.Owner is BaseCreature && !(c.Owner is PlayerMobile)) //it's a monster corpse: do you have looting rights?
{
BaseCreature bc = (BaseCreature)c.Owner;
List<DamageStore> lootingRights = BaseCreature.GetLootingRights(bc.DamageEntries, bc.HitsMax);
Mobile master = bc.GetMaster();
if (master != null && master == from) //if it's your pet, you always have the right
canLoot = true;
for (int i = 0; !canLoot && i < lootingRights.Count; i++)
{
if (lootingRights[i].m_Mobile != from)
continue;
canLoot = lootingRights[i].m_HasRight;
}
if (!canLoot)
from.SendMessage("You do not have the right to loot from that corpse.");
}
else
{
canLoot = false;
from.SendMessage("You cannot loot that corpse.");
}
}
else
{
canLoot = false;
from.SendMessage("You cannot loot that!");
}
if (canLoot)
GrabLoot(from, cont);
}
示例8: Scissor
public bool Scissor( Mobile from, Scissors scissors )
{
if ( Deleted || !from.CanSee( this ) ) return false;
base.ScissorHelper( from, new Bandage(), 1 );
return true;
}
示例9: Scissor
public override bool Scissor( Mobile from, Scissors scissors )
{
if ( Deleted || !from.CanSee( this ) ) return false;
base.ScissorHelper( from, new Leather(), 1 );
return true;
}
示例10: Scissor
public bool Scissor(Mobile from, Scissors scissors)
{
if (this.Deleted || !from.CanSee(this))
return false;
base.ScissorHelper(from, new Bone(), Utility.RandomMinMax(3, 5));
return true;
}
示例11: Scissor
public bool Scissor(Mobile from, Scissors scissors)
{
if (this.Deleted || !from.CanSee(this))
return false;
base.ScissorHelper(from, new Cloth(), 50);
return true;
}
示例12: OnSingleClick
public override void OnSingleClick( Mobile from )
{
base.OnSingleClick( from );
if ( Deleted || !from.CanSee( this ) )
return;
//if ( m_Account == null || from.Account != m_Account )
LabelTo( from, 38, 1149839 ); // * Non-Transferable Account Bound Item *
}
示例13: Scissor
public bool Scissor( Mobile from, Scissors scissors )
{
if ( Deleted || !from.CanSee( this ) ) return false;
Cloth c = new Cloth();
c.Hue = this.Hue;
base.ScissorHelper( from, c, 50 );
return true;
}
示例14: Scissor
public bool Scissor( Mobile from, Scissors scissors )
{
if ( Deleted || !from.CanSee( this ) )
return false;
from.SendLocalizedMessage( 1008117 ); // You cut the material into bandages and place them in your backpack.
base.ScissorHelper( from, new Bandage(), 1 );
return true;
}
示例15: Scissor
public bool Scissor( Mobile from, Scissors scissors )
{
if ( Deleted || !from.CanSee( this ) ) return false;
//base.ScissorHelper( from, new Bandage(), 1 );
this.Consume( 1 );
Bandage give = new Bandage();
give.Hue = this.Hue;
from.AddToBackpack( give );
return true;
}