当前位置: 首页>>代码示例>>C#>>正文


C# Actors.Actor类代码示例

本文整理汇总了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
        }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:28,代码来源:AppealSympathy.cs

示例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);
         }
     }
 }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:30,代码来源:ActDead.cs

示例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"]);
     }
 }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:30,代码来源:BayonetStance.cs

示例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;
     }
 }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:26,代码来源:MentalPower.cs

示例5: MobAttack

 public MobAttack(Mob mob, int aDelay, Actor dActor)
 {
     this.dueTime = 0;
     this.period = aDelay;
     this.mob = mob;
     this.dActor = dActor;
 }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:7,代码来源:MobAttack.cs

示例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));
 }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:7,代码来源:LongSwordMastery.cs

示例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);
 }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:31,代码来源:SinisterStrike.cs

示例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);
         }
     }
 }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:26,代码来源:Heal.cs

示例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));
 }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:7,代码来源:StrongMind.cs

示例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;
         }
     }
 }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:25,代码来源:FireBolt.cs

示例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;
      }
 }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:27,代码来源:WhiteShortSwordMastery.cs

示例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);
                 }
             }
         }
     }
 }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:29,代码来源:LuringShot.cs

示例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) { }
 }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:27,代码来源:VenomCoat.cs

示例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;
 }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:12,代码来源:DefaultPassiveSkill.cs

示例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);
 }
开发者ID:Willyham,项目名称:SagaRO2,代码行数:25,代码来源:CourageousAssault.cs


注:本文中的SagaDB.Actors.Actor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。