本文整理汇总了C#中SagaDB.Actors.Actor类的典型用法代码示例。如果您正苦于以下问题:C# Actor类的具体用法?C# Actor怎么用?C# Actor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Actor类属于SagaDB.Actors命名空间,在下文中一共展示了Actor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Proc
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args)
{
if (sActor.type == ActorType.PC)
{
ActorPC pc = (ActorPC)sActor;
ActorEventHandlers.PC_EventHandler eh = (ActorEventHandlers.PC_EventHandler)pc.e;
if (!SkillHandler.CheckSkillSP(pc, args.skillID))
{
SkillHandler.SetSkillFailed(ref args);
return;
}
Mob mob = (Mob)dActor.e;
args.damage = 0;
args.isCritical = Map.SkillArgs.AttackResult.Nodamage;// This skill is not for attacking
if (!mob.Hate.ContainsKey(pc.id))
{
SkillHandler.SetSkillFailed(ref args);
return;
}
SkillHandler.AddSkillEXP(ref pc, (uint)args.skillID, 3);
ushort value = GetHateReduction(args);
if (mob.Hate[pc.id] > value) mob.Hate[pc.id] -= (byte)value;
else mob.Hate[pc.id] = 0;
}
//TODO:
//20% Sadness status on enemy
}
示例2: Proc
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args)
{
ActorPC pc = (ActorPC)sActor;
ActorEventHandlers.PC_EventHandler eh = (ActorEventHandlers.PC_EventHandler)pc.e;
if (sActor.type == ActorType.PC)
{
if (!SkillHandler.CheckSkillSP(pc, args.skillID))
{
SkillHandler.SetSkillFailed(ref args);
return;
}
args.damage = 0;
args.isCritical = Map.SkillArgs.AttackResult.Nodamage;// This skill is not for attacking
byte level = (byte)(args.skillID - baseID + 1);
SkillHandler.AddSkillEXP(ref pc, (uint)args.skillID, 3);
if (!pc.Tasks.ContainsKey("ActDead"))
{
Tasks.PassiveSkillStatus t = new SagaMap.Tasks.PassiveSkillStatus(level);
args.failed = true;
pc.Tasks.Add("ActDead", t);
SkillHandler.AddStatusIcon(pc, (uint)args.skillID, 0);
}
else
{
args.failed = false;
pc.Tasks.Remove("ActDead");
SkillHandler.RemoveStatusIcon(pc, (uint)args.skillID);
}
}
}
示例3: Proc
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args)
{
ActorPC pc = (ActorPC)sActor;
ActorEventHandlers.PC_EventHandler eh = (ActorEventHandlers.PC_EventHandler)pc.e;
if (sActor.type == ActorType.PC)
{
if (!SkillHandler.CheckSkillSP(pc, args.skillID))
{
SkillHandler.SetSkillFailed(ref args);
return;
}
}
else//currently cannot be cast on player
{
SkillHandler.SetSkillFailed(ref args);
return;
}
args.damage = 0;
args.isCritical = Map.SkillArgs.AttackResult.Nodamage;// This skill is not for attacking
if (!pc.BattleStatus.Additions.ContainsKey("BayonetStance"))
{
SkillHandler.ApplyAddition(pc, new Additions.Global.DefaultStance(args.skillID, pc, "BayonetStance"));
args.failed = true;
}
else
{
args.failed = false;
SkillHandler.RemoveAddition(pc, pc.BattleStatus.Additions["BayonetStance"]);
}
}
示例4: Proc
public static void Proc(ref Actor sActor, ref Actor dActor, ref Map.SkillArgs args)
{
byte level;
ActorPC pc = (ActorPC)sActor;
ActorEventHandlers.PC_EventHandler eh = (ActorEventHandlers.PC_EventHandler)pc.e;
Tasks.PassiveSkillStatus ss;
level = (byte)(args.skillID - baseID + 1);
switch (SkillHandler.AddPassiveStatus(pc, "MentalPower", 3, out ss, new PassiveSkillStatus.DeactivateFunc(Deactivate)))
{
case PassiveStatusAddResult.WeaponMissMatch:
if (ss != null)
{
BonusHandler.Instance.SkillAddAddition(pc, (uint)(baseID + ss.level - 1), true);
}
break;
case PassiveStatusAddResult.Updated:
BonusHandler.Instance.SkillAddAddition(pc, (uint)(baseID + ss.level - 1), true);
BonusHandler.Instance.SkillAddAddition(pc, (uint)args.skillID, false);
ss.level = level;
break;
case PassiveStatusAddResult.OK:
ss.level = level;
BonusHandler.Instance.SkillAddAddition(pc, (uint)args.skillID, false);
break;
}
}
示例5: MobAttack
public MobAttack(Mob mob, int aDelay, Actor dActor)
{
this.dueTime = 0;
this.period = aDelay;
this.mob = mob;
this.dActor = dActor;
}
示例6: Proc
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args)
{
args.damage = 0;
args.isCritical = 0;
bool ifActivate = (SagaDB.Items.WeaponFactory.GetActiveWeapon((ActorPC)sActor).type == 2);
SkillHandler.ApplyAddition(dActor, new Additions.Global.DefaultPassiveSkill(args.skillID, dActor, "LongSwordMastery", ifActivate));
}
示例7: Proc
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args)
{
if (sActor.type == ActorType.PC)
{
ActorPC pc = (ActorPC)sActor;
if (pc.SP < SkillFactory.GetSkill((uint)args.skillID).sp)
{
args.damage = 0;
args.isCritical = Map.SkillArgs.AttackResult.Miss;
args.failed = true;
return;
}
else
{
ActorEventHandlers.PC_EventHandler eh = (ActorEventHandlers.PC_EventHandler)pc.e;
pc.SP -= (ushort)SkillFactory.GetSkill((uint)args.skillID).sp;
pc.LP += 1;
if (pc.LP > 5) pc.LP = 5;
eh.C.SendCharStatus(0);
}
}
args.damage = 0;
args.isCritical = SkillHandler.CalcCrit(sActor,dActor, args, SkillHandler.AttackType.Physical);
if (args.isCritical != Map.SkillArgs.AttackResult.Miss && args.isCritical != Map.SkillArgs.AttackResult.Block)
{
ActorPC targetPC = (ActorPC)sActor;
args.damage = CalcDamage(sActor, dActor, args);
}
if (args.damage <= 0) args.damage = 1;
SkillHandler.PhysicalAttack(ref sActor, ref dActor, args.damage, SkillHandler.AttackElements.HOLY, ref args);
}
示例8: Proc
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args)
{
ActorPC pc = (ActorPC)sActor;
ActorEventHandlers.PC_EventHandler eh = (SagaMap.ActorEventHandlers.PC_EventHandler)pc.e;
if (sActor.type == ActorType.PC)
{
if (!SkillHandler.CheckSkillSP(pc, args.skillID))
{
SkillHandler.SetSkillFailed(ref args);
return;
}
args.damage = 0;
args.isCritical = Map.SkillArgs.AttackResult.Heal;
ActorPC targetPC;
args.damage = CalcDamage(sActor, dActor, args);
if (dActor.type == ActorType.PC)
{
targetPC = (ActorPC)dActor;
eh = (SagaMap.ActorEventHandlers.PC_EventHandler)targetPC.e;
targetPC.HP += (ushort)args.damage;
eh.C.SendSkillEffect(SkillFactory.GetSkill((uint)args.skillID).addition, SkillEffects.HP, args.damage);
if (targetPC.HP > targetPC.maxHP) targetPC.HP = targetPC.maxHP;
eh.C.SendCharStatus(0);
}
}
}
示例9: Proc
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args)
{
ActorPC pc=(ActorPC)sActor;
args.damage = 0;
args.isCritical = 0;
SkillHandler.ApplyAddition(dActor, new Additions.Global.DefaultPassiveSkill(args.skillID, dActor, "StrongMind", true));
}
示例10: Proc
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args)
{
if (sActor.type == ActorType.PC)
{
ActorPC pc = (ActorPC)sActor;
if (!SkillHandler.CheckSkillSP(pc, args.skillID))
{
SkillHandler.SetSkillFailed(ref args);
return;
}
SkillHandler.GainLP(pc, args.skillID);
args.damage = 0;
args.isCritical = SkillHandler.CalcCrit(sActor, dActor, args, SkillHandler.AttackType.Magical);
if (args.isCritical != Map.SkillArgs.AttackResult.Miss && args.isCritical != Map.SkillArgs.AttackResult.Block)
{
uint MDamage;
uint FireDamage;
args.damage = CalcDamage(sActor, dActor, args);
MDamage = SkillHandler.MagicalAttack(ref sActor, ref dActor, args.damage, SkillHandler.AttackElements.NEUTRAL, ref args);
args.damage = CalcFireDamage(sActor, dActor, args);
FireDamage = SkillHandler.MagicalAttack(ref sActor, ref dActor, args.damage, SkillHandler.AttackElements.FIRE, ref args);
args.damage = MDamage + FireDamage;
}
}
}
示例11: Proc
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args)
{
byte level;
ActorPC pc=(ActorPC)sActor;
Tasks.PassiveSkillStatus ss;
args.damage = 0;
args.isCritical = 0;
level = (byte)(args.skillID - baseID + 1);
switch (SkillHandler.AddPassiveStatus(pc, "WhiteShortSwordMastery", 1, out ss, new PassiveSkillStatus.DeactivateFunc(Deactivate)))
{
case PassiveStatusAddResult.WeaponMissMatch:
if (ss != null)
{
BonusHandler.Instance.SkillAddAddition(pc, (uint)(baseID + ss.level - 1), true);
}
break;
case PassiveStatusAddResult.Updated:
BonusHandler.Instance.SkillAddAddition(pc, (uint)(baseID + ss.level - 1), true);
BonusHandler.Instance.SkillAddAddition(pc, (uint)args.skillID, false);
ss.level = level;
break;
case PassiveStatusAddResult.OK:
ss.level = level;
BonusHandler.Instance.SkillAddAddition(pc, (uint)args.skillID, false);
break;
}
}
示例12: Proc
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args)
{
if (sActor.type == ActorType.PC)
{
ActorPC pc = (ActorPC)sActor;
if (!SkillHandler.CheckSkillSP(pc, args.skillID))
{
SkillHandler.SetSkillFailed(ref args);
return;
}
args.damage = 0;
args.isCritical = SkillHandler.CalcCrit(sActor, dActor, args, SkillHandler.AttackType.Physical);
if (args.isCritical != Map.SkillArgs.AttackResult.Miss && args.isCritical != Map.SkillArgs.AttackResult.Block)
{
if (dActor.type == ActorType.NPC)
{
ActorNPC npc = (ActorNPC)dActor;
if (npc.npcType >= 10000 && npc.npcType < 50000)
{
Mob mob = (Mob)npc.e;
if (mob.Hate.ContainsKey(sActor.id))
mob.Hate[sActor.id] = 65535;
else
mob.Hate.Add(sActor.id, 65535);
}
}
}
}
}
示例13: Callback
public static void Callback(Actor client)
{
try
{
Tasks.PassiveSkillStatus ss;
ActorEventHandlers.PC_EventHandler eh = (SagaMap.ActorEventHandlers.PC_EventHandler)client.e;
ss = (PassiveSkillStatus)client.Tasks["VenomCoat"];
if (ss.dueTime > 0)
{
if (client.type == ActorType.PC)
{
eh.C.SendBattleStatus();
}
ss.dueTime--;
}
else
{
SkillHandler.RemoveStatusIcon(client, (uint)(1457400 + ss.level));
client.BattleStatus.atkskill -= CalcDamage(ss.level);
eh.C.SendBattleStatus();
ss.Deactivate();
client.Tasks.Remove("VenomCoat");
ss = null;
}
}
catch (Exception) { }
}
示例14: DefaultPassiveSkill
/// <summary>
/// Constructor for Addition: Short Sword Mastery
/// </summary>
/// <param name="id">Skill ID</param>
/// <param name="actor">Actor, which this addition get attached to</param>
public DefaultPassiveSkill(SkillIDs id, Actor actor,string name, bool ifActivate)
{
this.Name = name;
this.skillID = id;
this.AttachedActor = actor;
this.activate = ifActivate;
}
示例15: CalcDamage
private static uint CalcDamage(Actor sActor,Actor dActor,Map.SkillArgs args)
{
byte level = (byte)(args.skillID - baseID + 1);
ActorPC pc = (ActorPC)sActor;
int dmg = 0;
switch (pc.LP)
{
case 1:
dmg = 7 + level;
break;
case 2:
dmg = 13 + level * 2;
break;
case 3:
dmg = 21 + level * 3;
break;
case 4:
dmg = 29 + level * 4;
break;
case 5:
dmg = 37 + level * 5;
break;
}
return (uint)(sActor.BattleStatus.atk + dmg);
}