예제 #1
0
 public void Update(float deltaTime)
 {
     if (active)
     {
         WeaponDamage dmgPerSec = new WeaponDamage(m_TimedDamageType);
         dmgPerSec.SetBaseTypeDamage(damagePerSecond * deltaTime);
         InputDamage inpDamage = new InputDamage(null, dmgPerSec);
         mTarget.ReceiveDamage(inpDamage);
         mTimer -= deltaTime;
         if (mTimer <= 0f)
         {
             active = false;
         }
     }
 }
예제 #2
0
        private void ApplyDamage(ref WeaponHitInfo hit, DamagableObject target, float damageMult, bool useDamageMultSelfAsDamage, InputDamage inputDamage)
        {
            inputDamage.Mult(damageMult * Rand.NormalNumber(0.8f, 1.2f));

            if (useDamageMultSelfAsDamage)
            {
                WeaponDamage dmg = new WeaponDamage(inputDamage.weaponBaseType, 0, 0, 0);
                dmg.SetBaseTypeDamage(damageMult);
                inputDamage.CopyValues(dmg);
            }

            if (cachedSkills)
            {
                cachedSkills.ModifyDamage(target, inputDamage);
            }

            int  level    = 1;
            byte workshop = (byte)Workshop.Arlen;
            byte race     = (byte)Race.None;

            level    = cachedCharacter.level;
            workshop = cachedCharacter.workshop;

            RaceableObject raceable = nebulaObject.Raceable();

            if (raceable)
            {
                race = raceable.race;
            }

            var copy = inputDamage.CreateCopy();

            if (false == ReflectDamage(target, ref hit, inputDamage))
            {
                target.ReceiveDamage(inputDamage);
                StartDamageDron(target, inputDamage.CreateCopy(), workshop, level, race);
            }
            hit.SetRemainTargetHp(target.health);

            if (m_Achievments != null)
            {
                m_Achievments.OnMakeDamage(copy);
            }
        }
예제 #3
0
        private void StartDamageDron(DamagableObject targetObject, WeaponDamage inputDamage, byte workshop, int level, byte race)
        {
            if (nebulaObject.IsPlayer())
            {
                if (mPassiveBonuses != null && mPassiveBonuses.damageDronTier > 0)
                {
                    WeaponDamage dronDamage = new WeaponDamage();
                    dronDamage.SetFromDamage(inputDamage);
                    dronDamage.Mult(mPassiveBonuses.damageDronBonus);

                    InputDamage inpDamage = new InputDamage(nebulaObject, dronDamage);
                    targetObject.ReceiveDamage(inpDamage);

                    Hashtable dronInfo = new Hashtable {
                        { (int)SPC.Target, targetObject.nebulaObject.Id },
                        { (int)SPC.TargetType, targetObject.nebulaObject.Type },
                        { (int)SPC.Damage, dronDamage.totalDamage }
                    };
                    mMessage.SendDamageDron(dronInfo);
                }
            }
        }