本文整理汇总了C#中Entities.AddStatusEffect1方法的典型用法代码示例。如果您正苦于以下问题:C# Entities.AddStatusEffect1方法的具体用法?C# Entities.AddStatusEffect1怎么用?C# Entities.AddStatusEffect1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entities
的用法示例。
在下文中一共展示了Entities.AddStatusEffect1方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public static void Create(Entities.GameClient client, Packets.TeamActionPacket packet)
{
if (packet.EntityUID != client.EntityUID)
return;
if (client.Team != null)
return;
client.Team = new Team();
client.Team.Leader = client.EntityUID;
if (client.Team.Members.TryAdd(client.EntityUID, client))
{
using (var create = new Packets.TeamActionPacket())
{
create.EntityUID = client.EntityUID;
create.Action = Enums.TeamAction.Leader;
client.Send(create);
create.Action = Enums.TeamAction.Create;
client.Send(create);
}
client.AddStatusEffect1(Enums.Effect1.TeamLeader, 0);
}
else
{
client.Team = null;
}
}
示例2: Handle
public static bool Handle(Entities.GameClient client, UseSpellPacket usespell)
{
if (!client.Equipments.Contains(Enums.ItemLocation.Steed))
return false;
if (client.ContainsFlag1(Enums.Effect1.Riding))
client.RemoveFlag1(Enums.Effect1.Riding);
else if (client.Stamina < 100)
return false;
else
client.AddStatusEffect1(Enums.Effect1.Riding);
using (var vigor = new Packets.SteedVigorPacket())
{
vigor.Type = 2;
vigor.Amount = 9001;
client.Send(vigor);
}
usespell.AddTarget(client.EntityUID, 0);
return true;
}
示例3: Attack
public bool Attack(Entities.BattlePet opponent, Entities.BattlePet target, bool ForceDamage = false, double FDamage = 0)
{
if (ForceDamage)
{
if (FDamage < 1)
FDamage = 1;
target.HP -= (int)FDamage;
opponent.Battle.UpdateScreen();
Send(target, (uint)FDamage);
if (target.HP < 0)
{
opponent.Battle.Finish(opponent);
return false;
}
return true;
}
double Evolve = (double)(opponent.EvolveState + 1);
double SkillPower = (double)this.Power;
double Power = (double)opponent.Power;
double Level = (double)opponent.Level;
double Damage = (Evolve * (Power + (SkillPower + ((SkillPower / 100) * Level))));
double TEvolve = (double)(target.EvolveState + 1);
double TPower = (double)target.Power;
double TLevel = (double)target.Level;
double Defense = (TEvolve * (TPower + ((TPower / 100) * TLevel)));
if (State == Enums.PetState.ChanceDoubleDamage ||
State == Enums.PetState.TurnAttack ||
State == Enums.PetState.TurnDoubleAttack ||
State != Enums.PetState.ChanceDoubleDamage &&
State != Enums.PetState.TurnAttack &&
State != Enums.PetState.TurnDoubleAttack &&
State != Enums.PetState.None &&
Calculations.BasicCalculations.ChanceSuccess(StateChance))
{
switch (State)
{
case Enums.PetState.Absorb:
{
Defense = 0;
Damage = ((target.HP / 100) * SkillPower);
opponent.HP += (int)Damage;
break;
}
case Enums.PetState.ChanceDoubleDamage:
{
byte HitCount = 0;
int Chance = (int)StateChance;
Damage -= Defense;
if (Damage < 1)
Damage = 1;
while (Calculations.BasicCalculations.ChanceSuccess(Chance) && HitCount < 2)
{
target.HP -= (int)Damage;
opponent.Battle.UpdateScreen();
Send(target, (uint)Damage);
if (target.HP < 0)
{
opponent.Battle.Finish(opponent);
return false;
}
HitCount++;
Chance /= 2;
}
return true;
}
case Enums.PetState.Sleep:
{
if (target.State != Enums.PetState.None)
return false;
target.State = State;
target.AddStatusEffect1(Enums.Effect1.PartiallyInvisible);
opponent.Battle.UpdateScreen();
return false;
}
case Enums.PetState.Reflect:
{
double ReturnDamage = ((Damage / 100) * SkillPower);
if (!Attack(target, opponent, true, ReturnDamage))
return false;
break;
}
case Enums.PetState.Confuse:
{
if (target.State != Enums.PetState.None)
return false;
target.State = State;
target.AddStatusEffect1(Enums.Effect1.Confused);
opponent.Battle.UpdateScreen();
break;
}
case Enums.PetState.Freezing:
{
if (target.State != Enums.PetState.None)
//.........这里部分代码省略.........
示例4: Use2
public void Use2(Entities.BossMonster boss, Entities.GameClient target)
{
if (!target.Alive)
return;
#region SkillAnimation + Power
if (RealSkill != -1)
{
var usespell = new Packets.UseSpellPacket();
usespell.EntityUID = boss.EntityUID;
usespell.SpellID = (ushort)RealSkill;
usespell.SpellX = boss.X;
usespell.SpellY = boss.Y;
usespell.SpellLevel = RealSkilllevel;
if (PercentTageEffect != -1)
{
int damage = (target.HP / PercentTageEffect);
usespell.AddTarget(target.EntityUID, (uint)damage);
target.HP -= damage;
if (target.HP <= 0)
{
Packets.Interaction.Battle.Combat.Kill(boss, target, (uint)damage);
}
}
else if (DamageEffect > 0)
{
int damage = ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(DamageEffect / 2, DamageEffect);
usespell.AddTarget(target.EntityUID, (uint)damage);
target.HP -= damage;
if (target.HP <= 0)
{
Packets.Interaction.Battle.Combat.Kill(boss, target, (uint)damage);
}
}
else
usespell.AddTarget(target.EntityUID, 0);
boss.Screen.UpdateScreen(usespell);
}
else
{
using (var interact = new Packets.InteractionPacket())
{
interact.Action = Enums.InteractAction.Attack;
interact.EntityUID = boss.EntityUID;
interact.TargetUID = target.EntityUID;
interact.UnPacked = true;
interact.X = target.X;
interact.Y = target.Y;
if (PercentTageEffect != -1)
{
int damage = (target.HP / PercentTageEffect);
interact.Data = (uint)damage;
target.HP -= damage;
if (target.HP <= 0)
{
Packets.Interaction.Battle.Combat.Kill(boss, target, (uint)damage);
}
}
else if (DamageEffect > 0)
{
int damage = ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(DamageEffect / 2, DamageEffect);
interact.Data = (uint)damage;
target.HP -= damage;
if (target.HP <= 0)
{
Packets.Interaction.Battle.Combat.Kill(boss, target, (uint)damage);
}
}
else
interact.Data = 0;
boss.Screen.UpdateScreen(interact);
}
}
#endregion
#region Freeze
if (Freeze)
{
target.AddStatusEffect1(Enums.Effect1.IceBlock, FreezeTime);
}
#endregion
#region Paralyze
if (Paralyzed)
{
target.ParalyzeClient(ParalyzeTime);
}
#endregion
}