Exemplo n.º 1
0
        public void AddBareboneDamage(BareboneDamage bareboneDamage)
        {
            if (bareboneDamage == null)
            {
                return;
            }

            bareboneDamages.Add(bareboneDamage);
        }
Exemplo n.º 2
0
        public BareboneDamage Copy(BareboneDamage bareboneDamage)
        {
            BareboneDamage tmp = new BareboneDamage();

            tmp.maximumDamage  = bareboneDamage.maximumDamage;
            tmp.minimumDamage  = bareboneDamage.minimumDamage;
            tmp.damageOvertime = bareboneDamage.damageOvertime;
            tmp.damageType     = bareboneDamage.damageType;
            tmp.damageProcess  = bareboneDamage.damageProcess;
            tmp.name           = bareboneDamage.Name;
            tmp.tickCount      = bareboneDamage.tickCount;

            return(tmp);
        }
Exemplo n.º 3
0
        // Collision to Check who's getting hit.
        public void OnTriggerEnter(Collider other)
        {
            BareboneObject receiver = other.transform.GetComponent <BareboneObject>();

            // if Weapon is not active
            if (!this.active)
            {
                return;
            }
            //Check if the hit item is an Object
            if (!receiver)
            {
                return;
            }
            if (receiver.Team != team)
            {
                // if Collision isLiving
                if (receiver.ObjectType == ObjectType.Living)
                {
                    Parameters parameters = new Parameters();
                    parameters.Initialize();
                    // Adds all the Damage the weapon can send
                    for (int i = 0; i < bareboneDamages.Count; i++)
                    {
                        BareboneDamage damage = new BareboneDamage();
                        parameters.AddParameter <BareboneDamage>("DamageType" + i, new BareboneDamage().Copy(bareboneDamages[0]));
                    }
                    // Checks if the weapon has an owner, if so, the owner is also passed as a parameter.
                    if (Owner != null)
                    {
                        if (Owner.GetComponent <BareboneCharacter>())
                        {
                            parameters.AddParameter <BareboneCharacter>("DamageDealer", Owner);
                        }
                    }
                    // Add Effects
                    receiver.ReceiveDamage(parameters);
                    active = false;
                }
            }
            if (environmentWeapon)
            {
                StartCoroutine(ResetActive());
            }
        }