Example #1
0
 public virtual void AddEffect(ISkillEffect effect)
 {
     foreach (IGameUnit unit in units)
     {
         unit.GetUnitSkill().AddSkillEffect(effect);
     }
 }
Example #2
0
        public virtual void Effect(ISkillArgs args)
        {
            ISkillEffect newE = SelectHighest();

            if (current == null)
            {
                if (newE != null)
                {
                    current = newE;
                    current.Effect(args);
                }
            }
            else
            {
                if (newE == null)
                {
                    current.Resume(args);
                    current = newE;
                }
                else
                {
                    if (newE.GetLevel() != current.GetLevel())
                    {
                        current.Resume(args);
                        current = newE;
                        current.Effect(args);
                    }
                }
            }
        }
Example #3
0
        public virtual void RemoveEffect(ISkillEffect effect)
        {
            long   source = effect.GetSource();
            string key    = effect.GetKey();

            RemoveEffect(source, key);
        }
Example #4
0
 public virtual void RemoveEffect(ISkillEffect effect)
 {
     foreach (IGameUnit unit in units)
     {
         unit.GetUnitSkill().RemoveSkillEffect(effect);
     }
 }
Example #5
0
 public virtual void AddEffect(ISkillEffect effect)
 {
     if (!map.ContainsKey(effect.GetKey()))
     {
         map[effect.GetKey()] = new EffectSet();
     }
     map[effect.GetKey()].AddSkillEffect(effect);
 }
 public void registerEffect(ISkillEffect effect)
 {
     this._effectList.Add(effect);
     if ( this._effectCodes.IndexOf(effect.getCode()) != -1 )
     {
         this._effectCodes.Add(effect.getCode());
     }
 }
 /// <summary>
 /// 创建 技能效果
 /// </summary>
 /// <param name="skillData"></param>
 /// <returns></returns>
 public static ISkillEffect[] CreatSkillEffect(SkillData skillData)
 {
     ISkillEffect[] skillEffects = new ISkillEffect[skillData.EffectFunc.Length];
     for (int i = 0; i < skillData.EffectFunc.Length; i++)
     {
         string address = "Knight.Skill." + skillData.EffectFunc[i];
         skillEffects[i] = CreatInterface <ISkillEffect>(address);
     }
     return(skillEffects);
 }
Example #8
0
 // コンストラクタ
 public Skill(SkillEntity entity)
 {
     gameSide     = entity.gameSide;
     target       = entity.target;
     timing       = entity.timing;
     lifeTimeSpan = entity.lifeTimeSpan;
     type         = entity.type;
     argument     = entity.argument;
     skillEffect  = SkillEffectFactory.Create(type);
 }
Example #9
0
        public virtual void AddSkillEffect(ISkillEffect effct)
        {
            ISkillEffect old = this.effects[effct.GetSource()];

            if (old == null || old.GetLevel() <= effct.GetLevel())
            {
                this.effects[effct.GetSource()] = effct;
                this.key = effct.GetKey();
                this.timeMap[GetEffectKey(effct)] = Runtime.CurrentTimeMillis();
            }
        }
Example #10
0
        private ISkillEffect SelectHighest()
        {
            int          max  = 0;
            ISkillEffect maxE = null;

            foreach (ISkillEffect se in effects.Values)
            {
                if (se.GetLevel() > max)
                {
                    max  = se.GetLevel();
                    maxE = se;
                }
            }
            return(maxE);
        }
Example #11
0
 protected virtual void OnIntersectTarget(IItemOfInterest itemOfInterest)
 {
     if (!string.IsNullOrEmpty(Extensions.AddComponentOnUse))
     {
         ISkillEffect effect = (ISkillEffect)itemOfInterest.gameObject.AddComponent(Type.GetType("Frontiers.World.Gameplay." + Extensions.AddComponentOnUse));
         //UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(itemOfInterest.gameObject, "Assets/Scripts/Skills/RangedSkill.cs (52,45)", Extensions.AddComponentOnUse);
         if (effect != null)
         {
             effect.ParentSkill  = this;
             effect.RTEffectTime = EffectTime;
             if (Effects.SpawnFXOnTarget)
             {
                 effect.TargetFXObject = itemOfInterest;
             }
             else
             {
                 effect.TargetFXObject = Caster;
             }
             effect.FXOnUpdate       = Effects.FXOnSuccess;
             effect.RTUpdateInterval = Extensions.SkillUpdateInterval;
         }
     }
 }
Example #12
0
		public virtual List<BattleFighter> getTargets(ISkillEffect effect)
		{
			return effect.EnemyEffect ? enemyList : friendList;
		}
Example #13
0
 private string GetEffectKey(ISkillEffect effct)
 {
     return(effct.GetKey() + "_" + effct.GetSource() + "_" + effct.GetLevel());
 }
		protected internal virtual bool ratioEffect(ISkillEffect effect)
		{
			return MathUtils.randomRate(effect.Ratio, BattleConstants.BATTLE_RATIO_BASE);
		}
Example #15
0
 public virtual void SetEffect(ISkillEffect effect)
 {
     this.effect = effect;
 }
Example #16
0
 public virtual void RemoveSkillEffect(ISkillEffect effect)
 {
     this.effects.RemoveEffect(effect);
 }
Example #17
0
 public virtual void AddSkillEffect(ISkillEffect effect)
 {
     this.effects.AddEffect(effect);
 }
 public void addEffect(ISkillEffect effect)
 {
     this._effectList.Add(effect);
 }
 public void pushEffect(ILuaState luaState,ISkillEffect effect)
 {
     if ( effect == null || effect.getRef() == 0 )
     {
         luaState.PushNil();
     }
     else
     {
         luaState.RawGetI(LuaDef.LUA_REGISTRYINDEX, effect.getRef());
     }
 }
 protected BaseViewModelSkillEffect(ISkillEffect effect, byte maxLevel)
     : this(effect.Level, maxLevel)
 {
 }