public void Test()
        {
            NebulaObject obj = CreateObject();

            Update(0.1f, 3, obj);
            OutComponents(obj);
            obj.AddComponent <ThirdComponent>();
            Update(0.1f, 3, obj);
            OutComponents(obj);
            obj.RemoveComponent <ThirdComponent>();
            Update(0.1f, 3, obj);
            OutComponents(obj);
            obj.AddComponent <FourComponent>();
            Update(0.1f, 3, obj);
            OutComponents(obj);
            obj.RemoveComponent <ThirdComponent>();
            Update(0.1f, 3, obj);
            OutComponents(obj);
        }
Esempio n. 2
0
        public override bool TryCast(NebulaObject source, PlayerSkill skill, out Hashtable info)
        {
            info = new Hashtable();

            var skillComponent = source.GetComponent <Skill_000007DB_Component>();

            if (skillComponent)
            {
                skillComponent.SetSkill(skill.data);
            }
            else
            {
                skillComponent = source.AddComponent <Skill_000007DB_Component>();
                skillComponent.SetSkill(skill.data);
            }
            return(true);
        }
Esempio n. 3
0
        public override bool TryCast(NebulaObject source, PlayerSkill skill, out Hashtable info)
        {
            info = new Hashtable();
            if (NotEnemyCheck(source, skill, info))
            {
                return(false);
            }

            var sourceWeapon = source.Weapon();
            var targetObject = source.Target().targetObject;

            float damageMult = skill.GetFloatInput("dmg_mult");

            bool mastery = RollMastery(source);

            if (mastery)
            {
                damageMult *= 2;
            }

            WeaponHitInfo hit;
            var           shot = sourceWeapon.Fire(out hit, skill.data.Id, damageMult);

            if (hit.normalOrMissed)
            {
                Vector3 center         = (source.transform.position + targetObject.transform.position) * 0.5f;
                float   radius         = source.transform.DistanceTo(targetObject.transform) * 0.5f;
                var     skillComponent = source.GetComponent <Skill_0000045E_Component>();
                if (skillComponent == null)
                {
                    skillComponent = source.AddComponent <Skill_0000045E_Component>();
                }

                skillComponent.SetSkill(center, radius, skill.data);
                source.MmoMessage().SendShot(Common.EventReceiver.OwnerAndSubscriber, shot);
                return(true);
            }
            else
            {
                source.MmoMessage().SendShot(Common.EventReceiver.ItemOwner, shot);
                return(false);
            }
        }