本文整理汇总了C#中Server.MirObjects.PlayerObject类的典型用法代码示例。如果您正苦于以下问题:C# PlayerObject类的具体用法?C# PlayerObject怎么用?C# PlayerObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlayerObject类属于Server.MirObjects命名空间,在下文中一共展示了PlayerObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PriceRate
public float PriceRate(PlayerObject player, bool baseRate = false)
{
if (Conq == null || baseRate) return Info.Rate / 100F;
if (player.MyGuild != null && player.MyGuild.Guildindex == Conq.Owner)
return Info.Rate / 100F;
else
return (((Info.Rate / 100F) * Conq.npcRate) + Info.Rate) / 100F;
}
示例2: Reporting
public Reporting(PlayerObject player)
{
Player = player;
string baseDir = Settings.ReportPath + player.Name;
if (!Directory.Exists(baseDir))
Directory.CreateDirectory(baseDir);
_baseDir = baseDir;
}
示例3: GuildObject
public GuildObject(PlayerObject owner, string name)
{
Name = name;
Rank Owner = new Rank() { Name = "Leader", Options = (RankOptions)255 , Index = 0};
GuildMember Leader = new GuildMember() { name = owner.Info.Name, Player = owner, Id = owner.Info.Index, LastLogin = Envir.Now, Online = true};
Owner.Members.Add(Leader);
Ranks.Add(Owner);
Membercount++;
NeedSave = true;
if (Level < Settings.Guild_ExperienceList.Count)
MaxExperience = Settings.Guild_ExperienceList[Level];
if (Level < Settings.Guild_MembercapList.Count)
MemberCap = Settings.Guild_MembercapList[Level];
}
示例4: Add
public virtual void Add(PlayerObject player)
{
if (Race == ObjectType.Player)
{
PlayerObject me = (PlayerObject)this;
player.Enqueue(me.GetInfoEx(player));
}
else
player.Enqueue(GetInfo());
}
示例5: MemberDeleted
public void MemberDeleted(string name, PlayerObject formermember, bool kickself)
{
PlayerObject player = null;
for (int i = 0; i < Ranks.Count; i++)
for (int j = 0; j < Ranks[i].Members.Count; j++)
{
if ((Ranks[i].Members[j].Player != null) && (Ranks[i].Members[j].Player != formermember))
{
player = (PlayerObject)Ranks[i].Members[j].Player;
player.Enqueue(new ServerPackets.GuildMemberChange() { Name = name, Status = (byte)(kickself ? 4:3) });
player.GuildMembersChanged = true;
}
}
if (formermember != null)
{
formermember.Info.GuildIndex = -1;
formermember.MyGuild = null;
formermember.MyGuildRank = null;
formermember.ReceiveChat(kickself ? "You have left your guild." : "You have been removed from your guild.", ChatType.Guild);
formermember.Enqueue(new ServerPackets.GuildStatus() { GuildName = "", GuildRankName = "", MyOptions = (RankOptions)0 });
formermember.BroadcastInfo();
}
}
示例6: Broadcast
public void Broadcast(Packet p, Point location, PlayerObject Player)
{
if (p == null) return;
if (Functions.InRange(location, Player.CurrentLocation, Globals.DataRange))
{
Player.Enqueue(p);
}
}
示例7: IsFriendlyTarget
public override bool IsFriendlyTarget(PlayerObject ally)
{
if (Master == null) return false;
if (Master == ally) return true;
switch (ally.AMode)
{
case AttackMode.Group:
return Master.GroupMembers != null && Master.GroupMembers.Contains(ally);
case AttackMode.Guild:
return false;
case AttackMode.EnemyGuild:
return true;
case AttackMode.RedBrown:
return Master.PKPoints < 200 & Envir.Time > Master.BrownTime;
}
return true;
}
示例8: Add
public override void Add(PlayerObject player)
{
player.Enqueue(GetInfo());
SendHealth(player);
}
示例9: IsAttackTarget
public override bool IsAttackTarget(PlayerObject attacker)
{
throw new NotSupportedException();
}
示例10: SendHealth
public override void SendHealth(PlayerObject player)
{
throw new NotSupportedException();
}
示例11: Attacked
public override int Attacked(PlayerObject attacker, int damage, DefenceType type = DefenceType.ACAgility, bool damageWeapon = true)
{
return 0;
}
示例12: IsFriendlyTarget
public override bool IsFriendlyTarget(PlayerObject ally)
{
return true;
}
示例13: MountInfo
public MountInfo(PlayerObject ob)
{
Player = ob;
}
示例14: NewMember
public void NewMember(PlayerObject newmember)
{
if (Ranks.Count < 2)
Ranks.Add(new Rank() { Name = "Members", Index = 1});
Rank currentrank = Ranks[Ranks.Count - 1];
GuildMember Member = new GuildMember() { name = newmember.Info.Name, Player = newmember, Id = newmember.Info.Index, LastLogin = Envir.Now, Online = true };
currentrank.Members.Add(Member);
PlayerLogged(newmember, true, true);
Membercount++;
NeedSave = true;
}
示例15: SendGuildStatus
public void SendGuildStatus(PlayerObject member)
{
member.Enqueue(new ServerPackets.GuildStatus()
{
GuildName = Name,
GuildRankName = member.MyGuildRank != null? member.MyGuildRank.Name: "",
Experience = Experience,
MaxExperience = MaxExperience,
MemberCount = Membercount,
MaxMembers = MemberCap,
Gold = Gold,
Level = Level,
Voting = Voting,
SparePoints = SparePoints,
ItemCount = (byte)StoredItems.Length,
BuffCount = (byte)0,//(byte)BuffList.Count,
MyOptions = member.MyGuildRank != null? member.MyGuildRank.Options: (RankOptions)0,
MyRankId = member.MyGuildRank != null? member.MyGuildRank.Index: 256
});
}