Exemple #1
0
    void OnAttackSucc(FighterEvent e)
    {
        BaseBuff buff = BuffFactory.GetBuffByID(BuffID, skillLevel);

        card.attacker.AddBuff(buff);
        card.Actions.Add(SkillStartAction.GetAction(card.ID, skillID, GetTargetID(card)));
    }
Exemple #2
0
 /// <summary>
 /// Deep copy from another hero info.
 /// </summary>
 /// <param name="other">Other.</param>
 public void DeepCopy(HeroInfo other, Dictionary <Hero, Hero> heroMap)
 {
     m_health      = other.m_health;
     m_moveRange   = other.m_moveRange;
     m_attackRange = other.m_attackRange;
     m_attack      = other.m_attack;
     m_agile       = other.m_agile;
     m_direction   = other.m_direction;
     m_attackType  = other.m_attackType;
     m_teamColor   = other.m_teamColor;
     if (other.history != null)
     {
         foreach (HistoryStep step in other.history)
         {
             history.Add(new HistoryStep(step, heroMap));
         }
     }
     if (other.buffList != null)
     {
         foreach (Buff buff in other.buffList)
         {
             buffList.Add(BuffFactory.CreateBuffFrom(buff, heroMap));
         }
     }
 }
Exemple #3
0
 public RiotFrag()
 {
     buffs.Add(BuffFactory.GetBuff((int)BuffType.AttackNumUp, LV, true));
     buffs.Add(BuffFactory.GetBuff((int)BuffType.Bloodsucking, LV, true));
     buffs.Add(BuffFactory.GetBuff((int)BuffType.HPDown, LV, true));
     buffs.Add(BuffFactory.GetBuff((int)BuffType.DamageableUp, LV, true));
 }
Exemple #4
0
 public WindFrag()
 {
     buffs.Add(BuffFactory.GetBuff((int)BuffType.UpSpeed, 2, true));
     buffs.Add(BuffFactory.GetBuff((int)BuffType.UpSpikeRate, LV, true));
     buffs.Add(BuffFactory.GetBuff((int)BuffType.GetTwoSegmentJump, LV, true));
     buffs.Add(BuffFactory.GetBuff((int)BuffType.HPDown, 1, true)); // 50%
 }
 public void ResolveCombatEffects(AttackResult p_result, EEquipSlots p_attackHand, Monster p_target)
 {
     if (p_result.Result == EResultType.CRITICAL_HIT)
     {
         BaseItem itemAt = m_character.Equipment.GetItemAt(p_attackHand);
         List <SkillEffectStaticData> requiredSkillEffects = GetRequiredSkillEffects(itemAt);
         foreach (SkillEffectStaticData skillEffectStaticData in requiredSkillEffects)
         {
             if (skillEffectStaticData.Condition == ESkillEffectCondition.CRITICAL_HIT)
             {
                 if (skillEffectStaticData.Type == ESkillEffectType.STUN_MONSTER)
                 {
                     MonsterBuffMaceStun p_buff = (MonsterBuffMaceStun)BuffFactory.CreateMonsterBuff(EMonsterBuffType.MACE_STUN, 0f);
                     p_target.AddBuff(p_buff);
                     m_character.FightHandler.FeedActionLog(skillEffectStaticData);
                 }
             }
             else if (skillEffectStaticData.Condition == ESkillEffectCondition.FIRST_CRITICAL_HIT && skillEffectStaticData.Type == ESkillEffectType.APPLY_GASH && !m_criticalStrikeCounter.Contains(skillEffectStaticData.Type))
             {
                 MonsterBuffGash p_buff2 = (MonsterBuffGash)BuffFactory.CreateMonsterBuff(EMonsterBuffType.GASH, p_result.DamageDone);
                 p_target.AddBuff(p_buff2);
                 m_character.FightHandler.FeedActionLog(skillEffectStaticData);
                 m_criticalStrikeCounter.Add(skillEffectStaticData.Type);
             }
         }
     }
 }
 public override void DoEffect(Monster p_monster, Character p_target, SpellEventArgs p_spellArgs)
 {
     if (p_monster != null && !p_monster.BuffHandler.HasBuff(EMonsterBuffType.FLICKERING_LIGHT))
     {
         p_monster.AddBuff(BuffFactory.CreateMonsterBuff(EMonsterBuffType.FLICKERING_LIGHT, p_monster.MagicPower, m_level));
         m_cooldown = 3;
     }
 }
 public void Setup()
 {
     character             = new BattleCharacter();
     character.Skills      = new List <ISkill>();
     character.Stats       = new Stats();
     character.ActiveBuffs = new List <ActiveBuff>();
     activeBuff            = BuffFactory.GetActiveBuff(new TestBuff(), character);
 }
Exemple #8
0
        public void TestSpeedUp()
        {
            var buff = new BuffFactory();
            var y    = buff.getPowerUp(2, 2, PowerUpType.Speed);
            var x    = new SpeedUp(2, 2);

            Assert.True(y.GetType() == x.GetType() && y.X == x.X && y.Y == x.Y);
        }
Exemple #9
0
 public ShockFrag()
 {
     ID = 2;
     //BuffIds.Add((int)BuffType.AttackMakeBlowout);
     //BuffIds.Add((int)BuffType.SlowDown);
     buffs.Add(BuffFactory.GetBuff((int)BuffType.AttackMakeBlowout, LV, true));
     buffs.Add(BuffFactory.GetBuff((int)BuffType.GetTwoSegmentJump, LV, true));
 }
Exemple #10
0
 // 攻击成功后提示攻击力
 void OnAttackSucc(FighterEvent e)
 {
     if (card.lastAttackValue > 0)
     {
         card.Actions.Add(SkillStartAction.GetAction(card.ID, skillID, GetTargetID(card)));
         BaseBuff buff = BuffFactory.GetBuffByID(BuffID, skillLevel);
         card.target.AddBuff(buff);
     }
 }
Exemple #11
0
 public override void SkillEnter()
 {
     MSkillStatus = SkillStatusEnum.Ready;
     CD           = 15;
     DurationTime = 5;
     SkillIcon    = Resources.Load <Sprite>("SkillIcon/WindHelpFire");
     buffs.Add(BuffFactory.GetBuff((int)BuffType.UpSpikeRate, 9, true));
     buffs.Add(BuffFactory.GetBuff((int)BuffType.AttackNumUp, 3, true));
 }
 public override void BuffOnEnter(GameObject obj)
 {
     Over     = false;
     TClass   = obj.GetComponent <Status>();
     liveTime = 10;
     TakeBuff = BuffFactory.GetBuff(2, 1);
     TClass.AddAttackCarryingBuff(TakeBuff);
     Over = false;
 }
 private void _addBuff()
 {
     if (_getBuffs != null)
     {
         foreach (var buff in _getBuffs)
         {
             BuffFactory.AddBuff(EntityManager, Entity, buff.GetType().FullName, buff);
         }
     }
 }
Exemple #14
0
        public string TryAddBuff(int tmplId, int lev, bool isRefreshProperty = true)
        {
            var buff = BuffFactory.Creat(tmplId, lev);

            if (buff == null)
            {
                return("buff has not been registered:" + tmplId);
            }
            return(TryAddBuff(buff, isRefreshProperty));
        }
Exemple #15
0
        public string TryAddBuff <T>(int lev, bool isRefreshProperty = true) where T : Buff
        {
            var buff = BuffFactory.Creat <T>(lev);

            if (buff == null)
            {
                return("buff has not been registered:" + typeof(T).Name);
            }
            return(TryAddBuff(buff, isRefreshProperty));
        }
Exemple #16
0
        public void AddBuff(IBuff buff)
        {
            var alreadyHasBuff = ActiveBuffs.Where(b => b.Buff.GetType() == buff.GetType()).Any();

            if (!alreadyHasBuff)
            {
                var activeBuff = BuffFactory.GetActiveBuff(buff, this);
                activeBuff.Trigger <IBuffApplyTrigger>();
                ActiveBuffs.Add(activeBuff);
            }
        }
 private void InitBuffValues(EMonsterBuffType p_buffType)
 {
     for (Int32 i = 0; i < 10; i++)
     {
         MonsterBuff monsterBuff = BuffFactory.CreateMonsterBuff(p_buffType, GetValueForLevel(i + 1, false));
         for (Int32 j = 0; j < 3; j++)
         {
             m_buffValues[i, j] = monsterBuff.GetBuffValueForTooltip(j);
         }
     }
 }
 public override void HandleAttacks(List <Attack> p_attackList, Monster p_monster, Character p_character, Boolean p_isMagic)
 {
     if (!p_monster.BuffHandler.HasBuff(EMonsterBuffType.SHADOW_CLOAK))
     {
         MonsterBuffShadowCloak p_buff = (MonsterBuffShadowCloak)BuffFactory.CreateMonsterBuff(EMonsterBuffType.SHADOW_CLOAK, 1f, m_level);
         p_monster.AddBuff(p_buff);
         AbilityTriggeredEventArgs p_args = new AbilityTriggeredEventArgs(p_monster, this);
         LegacyLogic.Instance.EventManager.InvokeEvent(this, EEventType.ENTITY_ABILITY_ADDED, new AbilityEventArgs(p_monster, this));
         p_monster.AbilityHandler.AddEntry(m_executionPhase, p_args);
     }
 }
Exemple #19
0
    protected override void _DoSkill(BaseFighter target)
    {
        // 卡牌存在,攻击卡牌
        target.OnSkillHurt(this, damage);

        // 判定成功增加Buff
        if (target.canDoSkill && BuffID > 0 && !target.IsDead && Random.Range(0, 100) < rate)
        {
            BaseBuff buff = BuffFactory.GetBuffByID(BuffID, skillLevel);
            (target as CardFighter).AddBuff(buff);
        }
    }
        private void AddTimeStopBuff(List <Object> p_targets)
        {
            MonsterBuff p_buff = BuffFactory.CreateMonsterBuff(EMonsterBuffType.TIME_STOP, 1f);

            foreach (Object obj in p_targets)
            {
                Monster monster = obj as Monster;
                if (monster != null && !monster.BuffHandler.HasBuff(EMonsterBuffType.TIME_STOP))
                {
                    monster.BuffHandler.AddBuff(p_buff);
                }
            }
        }
Exemple #21
0
    private string imagePath;           //图片路径

    public Skill()
    {
        this.buffFactory  = new BuffFactory();
        this.skillType    = 0;
        this.skillID      = 0;
        this.power        = 0;
        this.multiple     = 0;
        this.costBlue     = 0;
        this.skillName    = "技能基类";
        this.targetNumber = 0;
        this.attackCount  = 0;
        this.skillInfo    = "无";
    }
        private void RemoveTimeStopBuff()
        {
            m_targetBuffer.Clear();
            MonsterBuff p_buff = BuffFactory.CreateMonsterBuff(EMonsterBuffType.TIME_STOP, 1f);

            foreach (Monster monster in LegacyLogic.Instance.WorldManager.GetObjectsByTypeIterator <Monster>())
            {
                if (monster.BuffHandler.HasBuff(EMonsterBuffType.TIME_STOP))
                {
                    monster.BuffHandler.RemoveBuff(p_buff);
                }
            }
        }
        internal Boolean CanAddBuff(EMonsterBuffType p_buffType)
        {
            MonsterBuff monsterBuff = BuffFactory.CreateMonsterBuff(p_buffType, 1f);

            foreach (MonsterAbilityBase monsterAbilityBase in m_abilities)
            {
                if (monsterAbilityBase.IsForbiddenBuff(monsterBuff.StaticID, m_owner, true))
                {
                    return(false);
                }
            }
            return(true);
        }
Exemple #24
0
    private List <Skill> skills;                      //技能列表
                                                      // 数据 {skill1,skill2,skill3...}



    //初始化
    public Person(int personID, string personName, int blood, int blue, int physicsAttack, int specialAttack, int speed, int physicsDefense, int specialDefense, int lv, int currentExperience, int bloodGrowth, int specialAttackGrowth, int physicsAttackGrowth, int speedGrowth, int physicsDefenseGrowth, int specialDefenseGrowth, int blueGrowth, string attackAniPath, int imageType, int experience, int money)
    {
        //buffs
        this.buffs                = new List <Buff> {
        };
        this.skills               = new List <Skill> {
        };
        this.personID             = personID;
        this.personName           = personName;
        this.blood                = blood;
        this.bloodMax             = blood;
        this.blue                 = blue;
        this.blueMax              = blue;
        this.physicsAttack        = physicsAttack;
        this.specialAttack        = specialAttack;
        this.speed                = speed;
        this.physicsDefense       = physicsDefense;
        this.specialDefense       = specialDefense;
        this.bloodGrowth          = bloodGrowth;
        this.blueGrowth           = blueGrowth;
        this.physicsAttackGrowth  = physicsAttackGrowth;
        this.physicsAttackGrowth  = physicsAttackGrowth;
        this.speedGrowth          = speedGrowth;
        this.physicsDefenseGrowth = physicsDefenseGrowth;
        this.specialDefenseGrowth = specialDefenseGrowth;
        this.lv = lv;
        this.currentExperience = currentExperience;
        this.experienceList    = new ExperienceList();
        this.experienceMax     = CalculateExperienceMax();  //级经验上限公式待定....
        this.attackAniPath     = attackAniPath;
        this.imageType         = imageType;
        this.experience        = experience;
        this.money             = money;
        this.buffFactory       = new BuffFactory();
        this.skillFactory      = new SkillFactory();
        // 添加技能
        this.skills.Add(this.skillFactory.CreateSkill("普通攻击"));
        this.skills.Add(this.skillFactory.CreateSkill("无操作"));

        //初始化装备
        this.inventory = new Dictionary <string, Equipment> {
            { "Heads", null },
            { "Top", null },
            { "Bottom", null },
            { "Weapon", null },
            { "Armor", null },
            { "Accessorie", null },
        };

        //待添加...
    }
Exemple #25
0
 public void AddMonsterBuff(Monster p_target, EMonsterBuffType p_monsterBuff, Single p_magicFactor)
 {
     if (p_target != null)
     {
         Character   selectedCharacter = LegacyLogic.Instance.WorldManager.Party.SelectedCharacter;
         MonsterBuff monsterBuff       = BuffFactory.CreateMonsterBuff(p_monsterBuff, p_magicFactor);
         monsterBuff.Causer = selectedCharacter;
         p_target.AddBuff(monsterBuff);
         if (SINGLE_TARGET_BUFFS.Contains(p_monsterBuff))
         {
             SingleTargetBuff(monsterBuff, p_target);
         }
     }
 }
Exemple #26
0
    public void Update()
    {
        if (nowWaitTime >= waitTime)
        {
            nowWaitTime = 0;
            GameObject bullet1 = Instantiate(bullet);
            bullet1.transform.position = transform.position;
            bullet1.GetComponent <RangeWeaponBullet>().Set(3, 10, Vector2.right, new List <IBuff> {
                BuffFactory.GetBuff(2)
            });
        }

        nowWaitTime += Time.deltaTime;
    }
Exemple #27
0
 public Damage(Damage other, Dictionary <Hero, Hero> heroMap)
 {
     damage = other.damage;
     type   = other.type;
     caster = heroMap [other.caster];
     target = new SimBlock(other.target);
     if (other.buffs != null)
     {
         buffs = new Buff[other.buffs.Length];
         for (int i = 0; i < other.buffs.Length; ++i)
         {
             buffs [i] = BuffFactory.CreateBuffFrom(other.buffs [i], heroMap);
         }
     }
 }
Exemple #28
0
        public override void DoEffect(Monster p_monster, Character p_target, SpellEventArgs p_spellArgs)
        {
            GridSlot             slot     = LegacyLogic.Instance.MapLoader.Grid.GetSlot(p_monster.Position);
            IList <MovingEntity> entities = slot.Entities;

            for (Int32 i = 0; i < entities.Count; i++)
            {
                if (entities[i] is Monster)
                {
                    Monster monster = (Monster)entities[i];
                    monster.AddBuff(BuffFactory.CreateMonsterBuff(EMonsterBuffType.BATTLESPIRIT, p_monster.MagicPower, m_level));
                }
            }
            m_cooldown = 3;
        }
Exemple #29
0
        protected Skill(uint instanceId, Character caster, BuffFactory buffFactory, SkillLoopableElementFactory loopableElementFactory,
                        Environment environment, Config config)
        {
            this.instanceId             = instanceId;
            this.caster                 = caster;
            this.buffFactory            = buffFactory;
            this.loopableElementFactory = loopableElementFactory;
            this.environment            = environment;
            this.config                 = config;

            duration             = config.Duration();
            channelingDuration   = config.ChannelingDuration();
            stateBindingDuration = config.StateBindingDuration();
            // DLog.Log("debug skill " + config.ShowSkillId() + " instance " + instanceId);
        }
        private void _addBuff()
        {
            if (_getKeys != null)
            {
                foreach (var key in _getKeys)
                {
                    var buff = _getBlackboard.Get <IBuffDataComponent>(key);

                    if (buff != null)
                    {
                        BuffFactory.AddBuff(EntityManager, Entity, buff.GetType().FullName, buff);
                    }
                }
            }
        }