Esempio n. 1
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.duration      = this.baseDuration / this.attackSpeedStat;
            this.earlyExitTime = this.baseEarlyExitTime / this.attackSpeedStat;
            this.hasFired      = false;
            this.animator      = base.GetModelAnimator();
            base.StartAimMode(0.5f + this.duration, false);
            base.characterBody.outOfCombatStopwatch = 0f;
            this.animator.SetBool("attacking", true);

            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == this.hitboxName);
            }

            this.PlayAttackAnimation();

            this.attack                 = new OverlapAttack();
            this.attack.damageType      = this.damageType;
            this.attack.attacker        = base.gameObject;
            this.attack.inflictor       = base.gameObject;
            this.attack.teamIndex       = base.GetTeam();
            this.attack.damage          = this.damageCoefficient * this.damageStat;
            this.attack.procCoefficient = this.procCoefficient;
            this.attack.hitEffectPrefab = this.hitEffectPrefab;
            this.attack.forceVector     = this.bonusForce;
            this.attack.pushAwayForce   = this.pushForce;
            this.attack.hitBoxGroup     = hitBoxGroup;
            this.attack.isCrit          = base.RollCrit();
            this.attack.impactSound     = this.impactSound;
        }
        public override void OnEnter()
        {
            base.OnEnter();
            base.characterBody.SetAimTimer(2f);
            this.hitEffectPrefab = Modules.Assets.punchImpactEffect;
            this.impactSound     = Modules.Assets.drillRushHitSoundEvent.index;

            this.duration      = this.baseDuration / this.attackSpeedStat;
            this.earlyExitTime = this.baseEarlyExitTime / this.attackSpeedStat;
            this.hasFired      = false;
            this.animator      = base.GetModelAnimator();


            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == this.hitboxName);
            }
            var childLocator = this.GetModelChildLocator();

            this.pullOrigin        = childLocator.FindChild(this.hitboxName);
            this.pullStrengthCurve = AnimationCurve.EaseInOut(0.1f, 0f, 1f, 1f);

            this.PlayAttackAnimation();

            this.attack = CreateAttack(hitBoxGroup);
        }
 // Token: 0x060026F8 RID: 9976 RVA: 0x000A9B12 File Offset: 0x000A7D12
 public static void EmitSoundServer(NetworkSoundEventIndex networkSoundEventIndex, NetworkIdentity networkIdentity)
 {
     EntitySoundManager.sharedMessage.networkIdentity        = networkIdentity;
     EntitySoundManager.sharedMessage.networkSoundEventIndex = networkSoundEventIndex;
     NetworkServer.SendByChannelToAll(EntitySoundManager.messageType, EntitySoundManager.sharedMessage, EntitySoundManager.channel.intVal);
     EntitySoundManager.sharedMessage.Clear();
 }
Esempio n. 4
0
 // Token: 0x06000566 RID: 1382 RVA: 0x00015F1A File Offset: 0x0001411A
 public static void SimpleSoundEffect(NetworkSoundEventIndex soundEventIndex, Vector3 position, bool transmit)
 {
     EffectManager.SpawnEffect(null, new EffectData
     {
         origin = position,
         networkSoundEventIndex = soundEventIndex
     }, transmit);
 }
 // Token: 0x06002716 RID: 10006 RVA: 0x000A9FCF File Offset: 0x000A81CF
 public static uint GetAkIdFromNetworkSoundEventIndex(NetworkSoundEventIndex eventIndex)
 {
     if (eventIndex == NetworkSoundEventIndex.Invalid)
     {
         return(0U);
     }
     return(NetworkSoundEventCatalog.entries[(int)eventIndex].akId);
 }
        // Token: 0x0600271A RID: 10010 RVA: 0x000AA00E File Offset: 0x000A820E
        public static string GetEventNameFromNetworkIndex(NetworkSoundEventIndex networkSoundEventIndex)
        {
            NetworkSoundEventDef safe = HGArrayUtilities.GetSafe <NetworkSoundEventDef>(NetworkSoundEventCatalog.entries, (int)networkSoundEventIndex);

            if (safe == null)
            {
                return(null);
            }
            return(safe.eventName);
        }
        // Token: 0x060026F7 RID: 9975 RVA: 0x000A9ACC File Offset: 0x000A7CCC
        public static void EmitSoundServer(NetworkSoundEventIndex networkSoundEventIndex, GameObject gameObject)
        {
            NetworkIdentity component = gameObject.GetComponent <NetworkIdentity>();

            if (!component)
            {
                Debug.LogWarningFormat("Cannot emit sound \"{0}\" on object \"{1}\": Object has no NetworkIdentity.", new object[]
                {
                    NetworkSoundEventCatalog.GetAkIdFromNetworkSoundEventIndex(networkSoundEventIndex),
                    gameObject
                });
                return;
            }
            EntitySoundManager.EmitSoundServer(networkSoundEventIndex, component);
        }
        // Token: 0x060026F6 RID: 9974 RVA: 0x000A9A84 File Offset: 0x000A7C84
        public static void EmitSoundServer(AkEventIdArg akEventId, GameObject gameObject)
        {
            NetworkSoundEventIndex networkSoundEventIndex = NetworkSoundEventCatalog.FindNetworkSoundEventIndex(akEventId);

            if (networkSoundEventIndex == NetworkSoundEventIndex.Invalid)
            {
                Debug.LogWarningFormat("Cannot emit sound \"{0}\" on object \"{1}\": Event is not registered in NetworkSoundEventCatalog.", new object[]
                {
                    akEventId.id,
                    gameObject
                });
                return;
            }
            EntitySoundManager.EmitSoundServer(networkSoundEventIndex, gameObject);
        }
Esempio n. 9
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.spiralEnergy    = base.GetComponent <SpiralEnergyComponent>();
            this.muzzleString    = swingIndex % 2 == 0 ? "LeftDrillMuzzle" : "RightDrillMuzzle";
            this.hitEffectPrefab = Modules.Assets.punchImpactEffect;
            this.impactSound     = Modules.Assets.drillRushHitSoundEvent.index;

            this.duration      = this.baseDuration / this.attackSpeedStat;
            this.earlyExitTime = this.baseEarlyExitTime / this.attackSpeedStat;
            this.hasFired      = false;
            this.animator      = base.GetModelAnimator();
            base.StartAimMode(0.5f + this.duration, false);


            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == this.hitboxName);
            }

            this.PlayAttackAnimation();

            this.attack                 = new OverlapAttack();
            this.attack.damageType      = this.damageType;
            this.attack.attacker        = base.gameObject;
            this.attack.inflictor       = base.gameObject;
            this.attack.teamIndex       = base.GetTeam();
            this.attack.damage          = damageCoefficient * this.damageStat;
            this.attack.procCoefficient = procCoefficient;
            this.attack.hitEffectPrefab = this.hitEffectPrefab;
            this.attack.forceVector     = this.bonusForce;
            this.attack.pushAwayForce   = this.pushForce;
            this.attack.hitBoxGroup     = hitBoxGroup;
            this.attack.isCrit          = base.RollCrit();
            this.attack.impactSound     = this.impactSound;
        }
Esempio n. 10
0
        public override void OnEnter()
        {
            base.OnEnter();
            if (NetworkServer.active)
            {
                var spiralEnergyComponent = base.characterBody.GetComponent <SpiralEnergyComponent>();
                if (spiralEnergyComponent)
                {
                    spiralEnergyComponent.NetworkEnergy -= energyCost;
                }
            }
            this.baseDuration      = 3.0f;
            this.attackStartTime   = 0.33f;
            this.attackEndTime     = 0.75f;
            this.baseEarlyExitTime = 0.25f;
            this.hitStopDuration   = 0.115f;
            this.hitEffectPrefab   = Modules.Assets.punchImpactEffect;
            this.impactSound       = Modules.Assets.drillRushHitSoundEvent.index;

            this.duration      = this.baseDuration / this.attackSpeedStat;
            this.earlyExitTime = this.baseEarlyExitTime / this.attackSpeedStat;
            this.hasFired      = false;
            this.animator      = base.GetModelAnimator();


            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == this.hitboxName);
            }

            this.PlayAttackAnimation();

            this.attack = CreateAttack(hitBoxGroup);
        }
Esempio n. 11
0
        public override void OnEnter()
        {
            base.OnEnter();
            damageWindows = new List <Tuple <float, float> >();
            damageWindows.Add(new Tuple <float, float>(0.25f, 0.30f));
            damageWindows.Add(new Tuple <float, float>(0.37f, 0.42f));
            damageWindows.Add(new Tuple <float, float>(0.49f, 0.80f));
            this.baseDuration    = 4.0f;
            this.hitStopDuration = 0.115f;
            base.characterBody.SetAimTimer(2f);
            this.hitEffectPrefab = Modules.Assets.punchImpactEffect;
            this.impactSound     = Modules.Assets.drillRushHitSoundEvent.index;

            this.duration = this.baseDuration / this.attackSpeedStat;
            this.hasFired = false;
            this.animator = base.GetModelAnimator();


            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == this.hitboxName);
            }
            var childLocator = this.GetModelChildLocator();

            this.pullOrigin        = childLocator.FindChild(this.hitboxName);
            this.pullRadius        = 20f;
            this.pullStrengthCurve = AnimationCurve.EaseInOut(0.1f, 0f, 1f, 1f);
            this.pullForce         = 80f;

            this.PlayAttackAnimation();

            this.attack = CreateAttack(hitBoxGroup);
        }
 // Token: 0x06002717 RID: 10007 RVA: 0x0000D703 File Offset: 0x0000B903
 public static void WriteNetworkSoundEventIndex(this NetworkWriter writer, NetworkSoundEventIndex networkSoundEventIndex)
 {
     writer.WritePackedUInt32((uint)(networkSoundEventIndex + 1));
 }
Esempio n. 13
0
 // Token: 0x06002726 RID: 10022 RVA: 0x000AA198 File Offset: 0x000A8398
 public static void EmitSoundServer(NetworkSoundEventIndex networkSoundEventIndex, Vector3 position)
 {
     PointSoundManager.sharedMessage.soundEventIndex = networkSoundEventIndex;
     PointSoundManager.sharedMessage.position        = position;
     NetworkServer.SendByChannelToAll(72, PointSoundManager.sharedMessage, PointSoundManager.channel.intVal);
 }