コード例 #1
0
        private void OnMeleeHit(EntityUid uid, EnergySwordComponent comp, MeleeHitEvent args)
        {
            if (!comp.Activated)
            {
                return;
            }

            // Overrides basic blunt damage with burn+slash as set in yaml
            args.BonusDamage = comp.LitDamageBonus;
        }
コード例 #2
0
        private void ApplyBoxerModifiers(EntityUid uid, BoxerComponent component, MeleeHitEvent args)
        {
            if (component.UnarmedModifiers == default !)
            {
                Logger.Warning("BoxerComponent on " + uid + " couldn't get damage modifiers. Know that adding components with damage modifiers through VV or similar is unsupported.");
                return;
            }

            args.ModifiersList.Add(component.UnarmedModifiers);
        }
コード例 #3
0
        private void OnMeleeHit(EntityUid uid, StunbatonComponent component, MeleeHitEvent args)
        {
            if (!component.Activated)
            {
                return;
            }

            // Don't apply damage if it's activated; just do stamina damage.
            args.BonusDamage -= args.BaseDamage;
        }
コード例 #4
0
        private void OnFlashMeleeHit(EntityUid uid, FlashComponent comp, MeleeHitEvent args)
        {
            if (!UseFlash(comp, args.User))
            {
                return;
            }

            args.Handled = true;
            foreach (var e in args.HitEntities)
            {
                Flash(e, args.User, uid, comp.FlashDuration, comp.SlowTo);
            }
        }
コード例 #5
0
ファイル: FlashSystem.cs プロジェクト: Jaxii/space-station-14
        public void OnMeleeHit(EntityUid uid, FlashComponent comp, MeleeHitEvent args)
        {
            if (!UseFlash(comp, args.User))
            {
                return;
            }

            args.Handled = true;
            foreach (IEntity e in args.HitEntities)
            {
                FlashEntity(e, args.User, comp.FlashDuration, comp.SlowTo);
            }
        }
コード例 #6
0
        private void OnMeleeHit(EntityUid uid, ZombieComponent component, MeleeHitEvent args)
        {
            if (!EntityManager.TryGetComponent <ZombieComponent>(args.User, out var zombieComp))
            {
                return;
            }

            if (!args.HitEntities.Any())
            {
                return;
            }

            foreach (EntityUid entity in args.HitEntities)
            {
                if (args.User == entity)
                {
                    continue;
                }

                if (!TryComp <MobStateComponent>(entity, out var mobState) || HasComp <DroneComponent>(entity))
                {
                    continue;
                }

                if (HasComp <DiseaseCarrierComponent>(entity) && _robustRandom.Prob(GetZombieInfectionChance(entity, component)))
                {
                    _disease.TryAddDisease(entity, "ActiveZombieVirus");
                }

                if (HasComp <ZombieComponent>(entity))
                {
                    args.BonusDamage = -args.BaseDamage * zombieComp.OtherZombieDamageCoefficient;
                }

                if ((mobState.IsDead() || mobState.IsCritical()) &&
                    !HasComp <ZombieComponent>(entity))
                {
                    _zombify.ZombifyEntity(entity);
                    args.BonusDamage = -args.BaseDamage;
                }
                else if (mobState.IsAlive()) //heals when zombies bite live entities
                {
                    var healingSolution = new Solution();
                    healingSolution.AddReagent("Bicaridine", 1.00); //if OP, reduce/change chem
                    _bloodstream.TryAddToChemicals(args.User, healingSolution);
                }
            }
        }
コード例 #7
0
        private void OnMeleeHit(EntityUid uid, StunbatonComponent comp, MeleeHitEvent args)
        {
            if (!comp.Activated || !args.HitEntities.Any())
            {
                return;
            }

            if (!EntityManager.TryGetComponent <PowerCellSlotComponent>(uid, out var slot) || slot.Cell == null || !slot.Cell.TryUseCharge(comp.EnergyPerUse))
            {
                return;
            }

            foreach (IEntity entity in args.HitEntities)
            {
                StunEntity(entity, comp);
            }
        }
コード例 #8
0
        private void OnMeleeHit(EntityUid uid, StunbatonComponent comp, MeleeHitEvent args)
        {
            if (!comp.Activated || !args.HitEntities.Any())
            {
                return;
            }

            if (!_cellSystem.TryGetBatteryFromSlot(uid, out var battery) || !battery.TryUseCharge(comp.EnergyPerUse))
            {
                return;
            }

            foreach (EntityUid entity in args.HitEntities)
            {
                StunEntity(entity, comp);
            }
        }
コード例 #9
0
        private void OnMeleeHit(EntityUid uid, StunbatonComponent comp, MeleeHitEvent args)
        {
            if (!comp.Activated || !args.HitEntities.Any() || args.Handled)
            {
                return;
            }

            if (!TryComp <BatteryComponent>(uid, out var battery) || !battery.TryUseCharge(comp.EnergyPerUse))
            {
                return;
            }

            foreach (EntityUid entity in args.HitEntities)
            {
                StunEntity(entity, comp);
                SendPowerPulse(entity, args.User, uid);
            }

            // No combat should occur if we successfully stunned.
            args.Handled = true;
        }