public virtual void AddEffect(ISkillEffect effect) { foreach (IGameUnit unit in units) { unit.GetUnitSkill().AddSkillEffect(effect); } }
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); } } } }
public virtual void RemoveEffect(ISkillEffect effect) { long source = effect.GetSource(); string key = effect.GetKey(); RemoveEffect(source, key); }
public virtual void RemoveEffect(ISkillEffect effect) { foreach (IGameUnit unit in units) { unit.GetUnitSkill().RemoveSkillEffect(effect); } }
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); }
// コンストラクタ 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); }
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(); } }
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); }
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; } } }
public virtual List<BattleFighter> getTargets(ISkillEffect effect) { return effect.EnemyEffect ? enemyList : friendList; }
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); }
public virtual void SetEffect(ISkillEffect effect) { this.effect = effect; }
public virtual void RemoveSkillEffect(ISkillEffect effect) { this.effects.RemoveEffect(effect); }
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) { }