Beispiel #1
0
        public override bool TryCast(NebulaObject source, PlayerSkill skill, out Hashtable info)
        {
            info = new Hashtable();

            float hpRestorePc = skill.GetFloatInput("hp_restore_pc");
            float maxHpPc     = skill.GetFloatInput("max_hp_pc");

            bool mastery = RollMastery(source);

            if (mastery)
            {
                maxHpPc     *= 2;
                hpRestorePc *= 2;
            }

            var   damagable  = source.Damagable();
            float restoredHp = hpRestorePc * damagable.baseMaximumHealth;

            damagable.RestoreHealth(source, restoredHp);

            var skills = source.Skills();

            Buff buff = new Buff(skill.data.Id.ToString(), source, Common.BonusType.increase_max_hp_on_pc, -1, maxHpPc, () => {
                return(true);
            }, skill.data.Id);

            source.Bonuses().SetBuff(buff, source);
            return(true);
        }
Beispiel #2
0
        public override bool TryCast(NebulaObject source, PlayerSkill skill, out Hashtable info)
        {
            info = new Hashtable();
            var targetObject = source.Target().targetObject;

            if (!targetObject)
            {
                return(false);
            }

            float moveDmgPc = skill.GetFloatInput("move_dmg_pc");
            float time      = skill.GetFloatInput("time");

            bool mastery = RollMastery(source);

            if (mastery)
            {
                time *= 2;
            }

            if (targetObject.IsPlayer() && targetObject.Raceable().race == source.Raceable().race)
            {
                if (source.transform.DistanceTo(targetObject.transform) <= source.Weapon().optimalDistance)
                {
                    source.Skills().Set404(time, moveDmgPc);
                    info.Add((int)SPC.Id, targetObject.Id);
                    return(true);
                }
            }
            return(false);
        }
Beispiel #3
0
        public override bool TryCast(NebulaObject source, PlayerSkill skill, out Hashtable info)
        {
            info = new Hashtable();

            if (NotEnemyCheck(source, skill, info))
            {
                ResetCounter();
                return(false);
            }


            var dmgMult = skill.GetFloatInput("dmg_mult");
            var hpPc    = skill.GetFloatInput("hp_pc");
            var hpTime  = skill.GetFloatInput("hp_time");

            mUseCounter++;
            if (source.Skills().lastSkill != skill.data.Id)
            {
                mUseCounter = 0;
            }

            mUseCounter = Mathf.Clamp(mUseCounter, 0, 2);
            dmgMult     = ModifyDamageMult(dmgMult);

            bool mastery = RollMastery(source);

            if (mastery)
            {
                dmgMult *= 2;
                hpTime  *= 2;
            }

            var           sourceWeapon = source.Weapon();
            var           targetObject = source.Target().targetObject;
            WeaponHitInfo hit;
            var           shot = sourceWeapon.Fire(out hit, skill.data.Id, dmgMult);

            if (hit.normalOrMissed)
            {
                Buff buff = new Buff(skill.id, null, Common.BonusType.increase_healing_speed_on_pc, hpTime, hpPc);
                source.Bonuses().SetBuff(buff, source);
                source.MmoMessage().SendShot(Common.EventReceiver.OwnerAndSubscriber, shot);
                return(true);
            }
            else
            {
                source.MmoMessage().SendShot(Common.EventReceiver.ItemOwner, shot);
                return(false);
            }
        }
Beispiel #4
0
        public override bool TryCast(NebulaObject source, PlayerSkill skill, out Hashtable info)
        {
            info = new Hashtable();
            float hpPc    = skill.GetDataInput <float>("hp_pc", 0f);
            float hpTime  = skill.GetDataInput <float>("hp_time", 0f);
            bool  mastery = RollMastery(source);

            if (mastery)
            {
                hpTime *= 2;
            }
            source.Skills().Set3F7(hpTime, hpPc);
            return(true);
        }
Beispiel #5
0
        private void SetEnergyDebuff(NebulaObject target, int skillID, float energyMOD)
        {
            string buffID = target.Id + skillID;

            if (target != null)
            {
                if (target.Skills() && target.Bonuses())
                {
                    Buff buff = new Buff(buffID, target, BonusType.decrease_max_energy_on_cnt, -1, energyMOD, () => true, skillID);

                    target.GetComponent <PlayerBonuses>().SetBuff(buff, buff.owner);
                }
            }
        }