public Interaction(Agent source, Agent target, StatAdjustment adjustment, BuffEffect? effect = null) { Source = source; Target = target; this.adjustment = adjustment; this.effect = effect; }
public BuffEffect m_ControlBuffEffect;//控制特效 //根据buffid 创建单位特效 public void CreateBuffSpecial(Protomsg.BuffDatas buffdata) { //Debug.Log("------- CreateBuffSpecial :" + buffdata.TypeID+ " "+ Tool.GetTime()); BuffEffect buffeffect = BuffEffect.CreateBuffEffect(buffdata, this); if (buffeffect != null) { m_BuffEffects[buffdata.TypeID] = buffeffect; } else { //Debug.Log("------- CreateBuffSpecial : faild" + buffdata.TypeID + " " + m_BuffEffects); } //switch (typeid) //{ // case 4: // m_Mode.GetComponent<UnityEntitySpecial>().AddWhite(); // break; //} }
public void CopyConditionals(BuffEffect be) { foreach (Conditional conditional in conditionalsRequired) { be.conditionalsRequired.Add(conditional.Copy()); } }
public override void InitPanel(BuffEffect effect) { skillEffect = effect as LearnSkillBuffEffect; PopulateJobList(skillEffect.jobToChange, jobSelect); PopulateSkilJobList(skillEffect.skillToLearn, skillEffect.jobToChange, skillSelect); }
public void AddState(BuffEffect Buff) { switch (Buff.CastInfos.EffectType) { case EffectEnum.Invisible: Buff.Target.Fight.SendToFight(new GameActionMessage((int)EffectEnum.Invisible, this.myFighter.ActorId, this.myFighter.ActorId + "," + Buff.Duration)); this.myStates.Add(FighterStateEnum.STATE_INVISIBLE, Buff); return; case EffectEnum.ReflectSpell: this.myStates.Add(FighterStateEnum.STATE_REFLECT_SPELL, Buff); return; case EffectEnum.MaximizeEffects: this.myStates.Add(FighterStateEnum.STATE_MAXIMIZE_EFFECTS, Buff); return; case EffectEnum.MinimizeEffects: this.myStates.Add(FighterStateEnum.STATE_MINIMIZE_EFFECTS, Buff); return; default: Buff.Target.Fight.SendToFight(new GameActionMessage((int)EffectEnum.AddState, this.myFighter.ActorId, this.myFighter.ActorId + "," + Buff.CastInfos.Value3 + ",1")); break; } //TODO System.ArgumentException: An item with the same key has already been added. this.myStates.Add((FighterStateEnum)Buff.CastInfos.Value3, Buff); }
public void DelState(BuffEffect Buff) { switch (Buff.CastInfos.EffectType) { case EffectEnum.Invisible: Buff.Target.Fight.SendToFight(new GameActionMessage((int)EffectEnum.Invisible, this.myFighter.ActorId, this.myFighter.ActorId.ToString())); Buff.Target.Fight.SendToFight(new GameActionMessage((int)GameActionTypeEnum.MAP_TELEPORT, this.myFighter.ActorId, this.myFighter.ActorId + "," + this.myFighter.CellId)); this.myStates.Remove(FighterStateEnum.STATE_INVISIBLE); return; case EffectEnum.ReflectSpell: this.myStates.Remove(FighterStateEnum.STATE_REFLECT_SPELL); return; case EffectEnum.MaximizeEffects: this.myStates.Remove(FighterStateEnum.STATE_MAXIMIZE_EFFECTS); return; case EffectEnum.MinimizeEffects: this.myStates.Remove(FighterStateEnum.STATE_MINIMIZE_EFFECTS); return; default: Buff.Target.Fight.SendToFight(new GameActionMessage((int)EffectEnum.AddState, this.myFighter.ActorId, this.myFighter.ActorId + "," + Buff.CastInfos.Value3 + ",0")); break; } this.myStates.Remove((FighterStateEnum)Buff.CastInfos.Value3); }
public void PerformBuff() { var effect = new BuffEffect("TestHpBuff"); var interaction = new Interaction(tower, creep, adjustment, effect); interaction.Apply(); Assert.AreEqual(204.0f, creep.GetStatValue("Hp")); }
internal bool HasEffect(BuffEffect effect) { if (this.Effects.TryGetValue(effect, out int val)) { return(val > 1); } return(false); }
internal void RemoveEffect(BuffEffect effect) { Debug.LogFormat("[{0}].RemoveEffect {1}", this.Owner.Name, effect); if (this.Effects[effect] > 0) { this.Effects[effect]--; } }
public void Constructor() { var effect = new BuffEffect("TestHpBuff"); var interaction = new Interaction(tower, creep, adjustment, effect); Assert.AreEqual(tower, interaction.Source); Assert.AreEqual(creep, interaction.Target); }
internal void RemoveEffect(BuffEffect effect) { Log.InfoFormat("[{0}].RemoveEffect", this.Owner.Name, effect); if (this.Effects[effect] > 0) { this.Effects[effect]--; } }
public void SettingsConstructor() { var goldBuff = new BuffEffect("TestGoldBuff"); Assert.AreEqual("Gold", goldBuff.Attribute); Assert.AreEqual(2.0f, goldBuff.Multiplier); Assert.AreEqual(-3.0f, goldBuff.Addition); Assert.AreEqual(5.0f, goldBuff.Duration); }
public BuffEffect get_effect(PlayerStruct info){ BuffEffect effect = new BuffEffect(); effect.value[BuffEnum.ATK] = info.atk * effects[BuffEnum.ATK] / 100; effect.value[BuffEnum.DEF] = info.def * effects[BuffEnum.DEF] / 100; effect.value[BuffEnum.MATK] = info.matk * effects[BuffEnum.MATK] / 100; effect.value[BuffEnum.MDEF] = info.mdef * effects[BuffEnum.MDEF] / 100; return effect; }
private static void BuffAllCreepsToDropMoreGold() { var creeps = EntitiesRunner.Current.GetEntitiesOfType <Creep>(); var payday = new BuffEffect("PiggyBankPayDayGoldMultiplier"); foreach (var creep in creeps) { creep.ApplyBuff(payday); } }
public override void InitPanel(BuffEffect e) { this.effect = e as ApplyBuffOnTurnStartEffect; PopulateBuffSelections(effect.buffToApply, dropDown); dropDown.droptDown.onValueChanged.AddListener(delegate { Save(); }); }
public void Constructor() { var stat = new Stat(100.0f); var effect = new BuffEffect("TestGoldBuff"); var buff = new Buff(stat, effect); Assert.AreEqual(stat, buff.Stat); Assert.AreEqual(effect, buff.Effect); Assert.AreEqual(0, buff.Elapsed); }
public BuffEffect(BuffEffect e) { EffectName = e.EffectName; EffectDurationType = e.EffectDurationType; Duration = e.Duration; BuffType = e.BuffType; amount = e.amount; StaticShellDistance = e.StaticShellDistance; }
public override void InitPanel(BuffEffect effect) { eff = effect as ScalingStatBuffEffect; PopulateStatsContainerType(eff.containerToChange.ToString(), containerToCHange); PopulateStatsContainerType(eff.containerTypeBasis.ToString(), containterTypeBasis); POpulateStatTypes(eff.statTypeToChange.ToString(), stattypeCHange); POpulateStatTypes(eff.statTypeBasis.ToString(), statTypeBasis); }
public Buff(int buffId, string name, int groupId, BuffCategory category, BuffEffect effect, int level, int duration) { Id = buffId; Name = name; GroupId = groupId; Category = category; Effect = effect; Level = level; ReceiveTime = DateTime.Now; }
/// <summary> /// Shows the buff list. /// </summary> public void ShowBuffList() { for (int i = 0; i < abilityEditor.buffs.Count; i++) { BuffEffect eff = abilityEditor.buffs[i]; EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Buff Name:", GUILayout.MaxWidth(155)); eff.EffectName = EditorGUILayout.TextField(eff.EffectName); if (GUILayout.Button("Delete Buff", GUILayout.MaxWidth(100))) { abilityEditor.buffs.RemoveAt(i); i--; } else { EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); eff.BuffType = (BuffEffect.Buff)EditorGUILayout.EnumPopup("Buff Type", eff.BuffType); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); eff.EffectDurationType = (StatusEffect.EffectDuration)EditorGUILayout.EnumPopup("Buff Duration Type", eff.EffectDurationType); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); if (eff.EffectDurationType == StatusEffect.EffectDuration.OverTime) { EditorGUILayout.LabelField("Buff Duration (In Turns)"); eff.Duration = Mathf.Clamp(EditorGUILayout.IntField(eff.Duration), 1, 10); } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); if (eff.BuffType == BuffEffect.Buff.Heal) { EditorGUILayout.LabelField("Total Heal Amount"); eff.amount = (float)EditorGUILayout.IntField((int)eff.amount); } else if (eff.BuffType == BuffEffect.Buff.Absorb) { EditorGUILayout.LabelField("Total Absorb Amount"); eff.amount = (float)EditorGUILayout.IntField((int)eff.amount); } else if (eff.BuffType == BuffEffect.Buff.MovementIncrease) { EditorGUILayout.LabelField("Total MS Increase Amount"); eff.amount = (float)EditorGUILayout.IntField((int)eff.amount); } EditorGUILayout.EndHorizontal(); if (eff.BuffType == BuffEffect.Buff.StaticShell) { eff.StaticShellDistance = EditorGUILayout.IntField("Static Shell AOE: ", eff.StaticShellDistance); } } EditorGUILayout.LabelField("___________________________________________________________________________"); } }
public bool HasBuffEffect(BuffEffect buffe) { foreach (var b in Buffs) { if ((b.Value.Buff.Spell as Buff).BuffEffect == buffe) { return(true); } } return(false); }
public override void InitPanel(BuffEffect effect) { ondeath = effect as SkillOnDeathBuffEffect; PopulateSkillList(ondeath.skillID, dropdown); useOnKiller.onValueChanged.AddListener ( delegate { Save(); } ); }
internal void AddEffect(BuffEffect effect) { Debug.LogFormat("[{0}].AddEffect {1}", this.Owner.Name, effect); if (!this.Effects.ContainsKey(effect)) { this.Effects[effect] = 1; } else { this.Effects[effect]++; } }
/// <summary> /// BuffEffectのeffectTurnを1ターン経過させる /// </summary> /// <param name="buff">1ターン経過させるBuffEffect</param> public void ElapseTurn(BuffEffect buff) { if (buff == null) { return; } buff.EffectTurn--; if (buff.EffectTurn < 1) { buff = null; } }
internal void AddBuffEffect(BuffEffect effect) { Log.InfoFormat("[{0}].AddBuffEffect", this.Owner.Name, effect); if (!this.Effects.ContainsKey(effect)) { this.Effects[effect] = 1; } else { this.Effects[effect]++; } }
/// <summary> /// Lower or remove duration of all existing buffs /// </summary> protected void DecrementBuffs() { for (int i = 0; i < buffs.Count; i++) //Reduce durations of all debuffs and remove if they hit 0 { BuffEffect effect = buffs [i]; effect.Duration--; if (effect.Duration <= 0) { buffs.Remove(effect); i--; } } }
void HandleStaticShell(BuffEffect e) { if (!hasStaticShell) { hasStaticShell = true; } if (e.Duration == 1) { hasStaticShell = false; AbilityActivator.ActivateStaticShell(e); } }
public void AddBuff(BuffEffect buffEffect, float timeToComplete) { GameObject buffObject = Instantiate(BuffPrefab); buffObject.transform.SetParent(Parent.transform); buffObject.transform.localPosition = Vector3.zero; buffObject.transform.localScale = Vector3.one; Buffs buff = buffObject.GetComponent <Buffs>(); buff.TimeToComplete = timeToComplete; buff.BuffEffect = buffEffect; StartCoroutine(buff.Begin()); }
public override void InitPanel(BuffEffect e) { effect = e as AuraBuffEffect; PopulateBuffSelections(effect.buffToApply, dropDown); range.text = effect.range + ""; dropDown.droptDown.onValueChanged.AddListener(delegate { Save(); }); range.onValueChanged.AddListener(delegate { Save(); }); }
private void buffEffectbmdToolStripMenuItem1_Click(object sender, EventArgs e) { string fpath = OpenDialog(); if (string.IsNullOrEmpty(fpath)) { return; } BuffEffect Decoder = new BuffEffect(fpath, BmdFile.FileType.BuffEffect); ClientEditor editor = new ClientEditor(Decoder, false); editor.Show(); }
public void ApplyBuff(BuffEffect effect) { if (effect.Attribute == null) { return; } Stat buffedStat; if (!Stats.TryGetValue(effect.Attribute, out buffedStat)) { return; } buffedStat.ApplyBuff(effect); buffs.Add(new Buff(buffedStat, effect)); }
private static void SetUnreacheableTile(this GameLevel level, Vector2D position, TowerType type) { var pathfinding = level.GetPathFinding(); var index = (int)(position.X + position.Y * level.Size.Width); level.MapData[index] = LevelTileType.Blocked; pathfinding.SetUnreachableAndUpdate(index); var towerProperties = ContentLoader.Load <TowerPropertiesXml>(Xml.TowerProperties.ToString()); var buff = new BuffEffect(Player.Current.Avatar.GetType().Name + "RangeMultiplier"); var range = towerProperties.Get(type).Range; range *= buff.Multiplier > 0.0f ? buff.Multiplier : 1.0f; pathfinding.UpdateWeightInAdjacentNodes(position, (int)range, 100); }
public BuffEffect get_buff_effect() { BuffEffect totalEffect = new BuffEffect(); foreach(BattleBuff buff in buffData){ BuffEffect effect = buff.get_effect(info); foreach(BuffEnum ability in System.Enum.GetValues(typeof(BuffEnum))){ totalEffect.value[ability] += effect.value[ability]; } } return totalEffect; }
public Buff(Stat stat, BuffEffect effect) { Stat = stat; Effect = effect; }