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 static HitBoxGroup FindHitBoxGroup(string groupName, Transform modelTransform) { if (!modelTransform) { return(null); } HitBoxGroup result = null; List <HitBoxGroup> gameObjectComponents = GetComponentsCache <HitBoxGroup> .GetGameObjectComponents(modelTransform.gameObject); int i = 0; int count = gameObjectComponents.Count; while (i < count) { if (gameObjectComponents[i].groupName == groupName) { result = gameObjectComponents[i]; break; } i++; } GetComponentsCache <HitBoxGroup> .ReturnBuffer(gameObjectComponents); return(result); }
//private StyleSystem.StyleComponent styleComponent; public override void OnEnter() { base.OnEnter(); this.duration = this.baseDuration / this.attackSpeedStat; this.hasFired = false; this.animator = base.GetModelAnimator(); //this.styleComponent = base.GetComponent<StyleSystem.StyleComponent>(); base.StartAimMode(0.5f + this.duration, false); base.PlayCrossfade("Gesture, Override", "Crush", "Crush.playbackRate", this.duration, 0.05f); HitBoxGroup hitBoxGroup = null; Transform modelTransform = base.GetModelTransform(); if (modelTransform) { hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Crush"); } this.attack = new OverlapAttack(); this.attack.attacker = base.gameObject; this.attack.inflictor = base.gameObject; this.attack.teamIndex = base.GetTeam(); this.attack.damage = Crush.damageCoefficient * this.damageStat; this.attack.procCoefficient = 1; this.attack.hitEffectPrefab = Loader.SwingChargedFist.overchargeImpactEffectPrefab; this.attack.forceVector = Vector3.zero; this.attack.pushAwayForce = 1f; this.attack.hitBoxGroup = hitBoxGroup; this.attack.isCrit = base.RollCrit(); }
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); }
public override void OnEnter() { base.OnEnter(); this.duration = AirSlamAlt.leapDuration / (0.5f + (0.5f * this.attackSpeedStat)); this.hasFired = false; this.hasLanded = false; this.animator = base.GetModelAnimator(); this.swordController = base.GetComponent <PaladinSwordController>(); base.skillLocator.secondary.DeductStock(1); Vector3 direction = base.GetAimRay().direction; if (base.isAuthority) { base.characterBody.isSprinting = true; base.characterMotor.velocity *= 0.1f; base.SmallHop(base.characterMotor, AirSlamAlt.hopVelocity); } base.characterBody.bodyFlags |= CharacterBody.BodyFlags.IgnoreFallDamage; HitBoxGroup hitBoxGroup = null; Transform modelTransform = base.GetModelTransform(); string hitboxString = "LeapStrike"; if (modelTransform) { hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxString); } base.PlayAnimation("FullBody, Override", "LeapSlam2", "Whirlwind.playbackRate", this.duration * 1.5f); Util.PlaySound(Modules.Sounds.Lunge, base.gameObject); Util.PlaySound(Modules.Sounds.Cloth2, base.gameObject); this.swordController.airSlamStacks++; float dmg = AirSlam.damageCoefficient; this.attack = new OverlapAttack(); this.attack.damageType = DamageType.Stun1s; this.attack.attacker = base.gameObject; this.attack.inflictor = base.gameObject; this.attack.teamIndex = base.GetTeam(); this.attack.damage = ((0.5f + (0.5f * this.swordController.airSlamStacks)) * dmg) * this.damageStat; this.attack.procCoefficient = 1; this.attack.hitEffectPrefab = this.swordController.hitEffect; this.attack.forceVector = -Vector3.up * 6000f; this.attack.pushAwayForce = 500f; this.attack.hitBoxGroup = hitBoxGroup; this.attack.isCrit = base.RollCrit(); this.attack.impactSound = Modules.Assets.swordHitSoundEventL.index; if (this.swordController.isBlunt) { this.attack.impactSound = Modules.Assets.batHitSoundEventL.index; } }
public override void OnEnter() { base.OnEnter(); this.animator = base.GetModelAnimator(); this.hasFired = false; if (base.characterBody.HasBuff(Survivor.Buffs.overpowerBuff)) { this.duration = SharpClaws.baseDuration / (this.attackSpeedStat * Overpower.attackSpeedMult); } else { this.duration = SharpClaws.baseDuration / this.attackSpeedStat; } // yay strafe animations // kind of glitchy still so i leave out for this patch // StartAimMode(2); base.characterDirection.forward = base.GetAimRay().direction; if (animator.GetBool("attackSwitch")) { this.animator.SetBool("attackSwitch", false); this.hitBoxGroup = base.FindHitBoxGroup("LeftClaw"); } else { this.animator.SetBool("attackSwitch", true); this.hitBoxGroup = base.FindHitBoxGroup("RightClaw"); } attack = new OverlapAttack { attacker = base.gameObject, inflictor = base.gameObject, damage = base.damageStat * SharpClaws.damageCoefficient, damageColorIndex = DamageColorIndex.Default, damageType = DamageType.Generic, isCrit = Util.CheckRoll(this.critStat, this.characterBody.master), hitEffectPrefab = Resources.Load <GameObject>("prefabs/effects/impacteffects/ImpactImpSwipe"), hitBoxGroup = hitBoxGroup, impactSound = Survivor.Sounds.hitNetworkSoundEventDef.index, procChainMask = default(ProcChainMask), procCoefficient = SharpClaws.procCoefficient, forceVector = Vector3.zero, pushAwayForce = 400f, teamIndex = base.GetTeam(), }; Util.PlayAttackSpeedSound(Core.Assets.SwingSound, base.gameObject, this.attackSpeedStat); base.PlayAnimation("Gesture, Override", "Attack", "Attack.playbackRate", this.duration); if (ClientScene.readyConnection != null) { Core.Utils.PlayAnimationOnOtherClients(base.gameObject, "Gesture, Override", "Attack", this.duration, true); } Core.Utils.RemoveNetworkedTimedBuff(base.gameObject, Survivor.Buffs.overpowerBuff, 1); }
public override void OnEnter() { base.OnEnter(); this.duration = this.baseDuration / this.attackSpeedStat; this.hasFired = false; this.animator = base.GetModelAnimator(); this.swordController = base.GetComponent <PaladinSwordController>(); base.StartAimMode(0.5f + this.duration, false); base.characterBody.isSprinting = false; base.skillLocator.secondary.DeductStock(1); if (this.swordController) { this.swordController.attacking = true; } HitBoxGroup hitBoxGroup = null; Transform modelTransform = base.GetModelTransform(); if (NetworkServer.active) { base.characterBody.AddBuff(RoR2Content.Buffs.Slow50); } string hitboxString = "SpinSlash"; if (this.swordController && this.swordController.swordActive) { hitboxString = "SpinSlashLarge"; } if (modelTransform) { hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxString); } base.PlayAnimation("FullBody, Override", "GroundSweepContinuous", "Whirlwind.playbackRate", this.duration * 1.1f); Util.PlaySound(Modules.Sounds.Cloth3, base.gameObject); this.attack = new OverlapAttack(); this.attack.damageType = DamageType.Stun1s; this.attack.attacker = base.gameObject; this.attack.inflictor = base.gameObject; this.attack.teamIndex = base.GetTeam(); this.attack.damage = GroundSweepAlt.damageCoefficient * this.damageStat; this.attack.procCoefficient = 1; this.attack.hitEffectPrefab = this.swordController.hitEffect; this.attack.forceVector = Vector3.up * 1600f; this.attack.pushAwayForce = -1500f; this.attack.hitBoxGroup = hitBoxGroup; this.attack.isCrit = base.RollCrit(); this.attack.impactSound = Modules.Assets.swordHitSoundEventM.index; if (this.swordController.isBlunt) { this.attack.impactSound = Modules.Assets.batHitSoundEventM.index; } }
public override void OnEnter() { base.OnEnter(); if (TTGL_SurvivorPlugin.rideMeExtendedInstalled) { TTGL_SurvivorPlugin.ExitSeat(base.gameObject); } if (NetworkServer.active) { base.characterBody.AddBuff(Buffs.HiddenInvincibility); } if (base.isAuthority) { m_TrajectoryNodeCount = TrajectoryNodes != null ? TrajectoryNodes.Length : 0; if (m_TrajectoryNodeCount > CurrentNodeIndex) { var nextNode = TrajectoryNodes[CurrentNodeIndex]; m_CurrentTarget = nextNode.Item1; } } this.cancelled = true; Util.PlaySound(EvisDash.beginSoundString, base.gameObject); base.characterMotor.useGravity = false; var childLocator = base.GetModelChildLocator(); this.rootTransform = childLocator.FindChild("LagganArmature"); base.PlayCrossfade("FullBody, Override", "LagannImpact3", 0.2f); this.CreateBlinkEffect(Util.GetCorePosition(base.gameObject)); HitBoxGroup hitBoxGroup = null; Transform modelTransform = base.GetModelTransform(); if (modelTransform) { hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == c_HitboxGroupName); } this.overlapAttack = new OverlapAttack { attacker = base.gameObject, damage = damageCoefficient * base.characterBody.damage, pushAwayForce = this.pushForce, isCrit = base.RollCrit(), damageColorIndex = DamageColorIndex.Default, inflictor = base.gameObject, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, teamIndex = base.characterBody.teamComponent.teamIndex, hitBoxGroup = hitBoxGroup, hitEffectPrefab = Modules.Assets.punchImpactEffect, impactSound = Modules.Assets.drillRushHitSoundEvent.index, }; }
public override void OnEnter() { base.OnEnter(); if (TTGL_SurvivorPlugin.rideMeExtendedInstalled) { TTGL_SurvivorPlugin.ExpulseAnyRider(base.gameObject); TTGL_SurvivorPlugin.ExitSeat(base.gameObject); } this.animator = base.GetModelAnimator(); if (base.isGrounded) { base.PlayCrossfade("FullBody, Override", "LagannBurrowerStrikeBurrow", this.playbackRateString, burrowingDuration, 0.2f); DisplayMound(); } else { falling = true; fell = true; base.PlayCrossfade("FullBody, Override", "LagannBurrowerStrikeFall", 0.2f); if (NetworkServer.active) { base.characterBody.AddBuff(RoR2Content.Buffs.HiddenInvincibility); } if (base.isAuthority) { base.characterMotor.onMovementHit += this.OnMovementHit; base.characterMotor.velocity.y = GroundSlam.initialVerticalVelocity; } } HitBoxGroup hitBoxGroup = null; Transform modelTransform = base.GetModelTransform(); if (modelTransform) { hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "LagannImpactHitbox"); } this.attack = new OverlapAttack { attacker = base.gameObject, damage = PrepareLagannBurrowerStrike.damageCoefficient * base.characterBody.damage, pushAwayForce = 300f, isCrit = base.RollCrit(), damageColorIndex = DamageColorIndex.Default, inflictor = base.gameObject, procChainMask = default(ProcChainMask), procCoefficient = 1f, teamIndex = base.characterBody.teamComponent.teamIndex, hitBoxGroup = hitBoxGroup, hitEffectPrefab = Modules.Assets.punchImpactEffect, impactSound = Modules.Assets.drillRushHitSoundEvent.index, }; }
// Token: 0x06002BB2 RID: 11186 RVA: 0x000B88AC File Offset: 0x000B6AAC public override void OnEnter() { base.OnEnter(); this.duration = this.baseDuration; if (base.isAuthority) { if (base.inputBank) { this.idealDirection = base.inputBank.aimDirection; this.idealDirection.y = 0f; } this.UpdateDirection(); } if (base.modelLocator) { base.modelLocator.normalizeToFloor = true; } if (this.startEffectPrefab && base.characterBody) { EffectManager.SpawnEffect(this.startEffectPrefab, new EffectData { origin = base.characterBody.corePosition }, false); } if (base.characterDirection) { base.characterDirection.forward = this.idealDirection; } Util.PlaySound(ToolbotDash.startSoundString, base.gameObject); base.PlayCrossfade("Body", "BoxModeEnter", 0.1f); base.PlayCrossfade("Stance, Override", "PutAwayGun", 0.1f); base.modelAnimator.SetFloat("aimWeight", 0f); if (NetworkServer.active) { base.characterBody.AddBuff(BuffIndex.ArmorBoost); } HitBoxGroup hitBoxGroup = null; Transform modelTransform = base.GetModelTransform(); if (modelTransform) { hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Charge"); } this.attack = new OverlapAttack(); this.attack.attacker = base.gameObject; this.attack.inflictor = base.gameObject; this.attack.teamIndex = TeamComponent.GetObjectTeam(this.attack.attacker); this.attack.damage = ToolbotDash.chargeDamageCoefficient * this.damageStat; this.attack.hitEffectPrefab = ToolbotDash.impactEffectPrefab; this.attack.forceVector = Vector3.up * ToolbotDash.upwardForceMagnitude; this.attack.pushAwayForce = ToolbotDash.awayForceMagnitude; this.attack.hitBoxGroup = hitBoxGroup; this.attack.isCrit = base.RollCrit(); }
/// private List<HealthComponent> victimsStruck = new List<HealthComponent>(); public override void OnEnter() { base.OnEnter(); this.duration = ShoulderBash.baseDuration; this.shieldCancel = false; base.characterBody.isSprinting = true; Util.PlayScaledSound(Croco.Leap.leapSoundString, base.gameObject, 1.75f); if (base.isAuthority && base.inputBank && base.characterDirection) { this.forwardDirection = ((base.inputBank.moveVector == Vector3.zero) ? base.characterDirection.forward : base.inputBank.moveVector).normalized; } this.RecalculateSpeed(); if (base.characterMotor && base.characterDirection) { base.characterMotor.velocity.y *= 0.5f; base.characterMotor.velocity = this.forwardDirection * this.dashSpeed; } Vector3 b = base.characterMotor ? base.characterMotor.velocity : Vector3.zero; this.previousPosition = base.transform.position - b; HitBoxGroup hitBoxGroup = null; Transform modelTransform = base.GetModelTransform(); if (modelTransform) { hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "HeadH"); } //hitBoxGroup = Array.Find<HitBoxGroup>(modelTransform.GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "HeadH"); this.attack = new OverlapAttack(); this.attack.attacker = base.gameObject; this.attack.inflictor = base.gameObject; this.attack.teamIndex = base.GetTeam(); this.attack.damage = ShoulderBash.chargeDamageCoefficient * this.damageStat; this.attack.hitEffectPrefab = Loader.SwingChargedFist.overchargeImpactEffectPrefab; this.attack.forceVector = Vector3.up * Toolbot.ToolbotDash.upwardForceMagnitude; this.attack.pushAwayForce = Toolbot.ToolbotDash.awayForceMagnitude; this.attack.hitBoxGroup = hitBoxGroup; this.attack.isCrit = base.RollCrit(); // if (base.isAuthority) EffectManager.SimpleMuzzleFlash(EnforcerPlugin.Assets.shoulderBashFX, base.gameObject, "ShieldHitbox", true); }
public override void OnEnter() { base.OnEnter(); this.animator = base.GetModelAnimator(); var childLocator = base.GetModelChildLocator(); this.rootTransform = childLocator.FindChild("LagganArmature"); base.characterMotor.Motor.SetPosition(this.spawnLocation + (this.spawnRotation * 4f)); base.PlayAnimation("FullBody, Override", "BurrowerStrikePop", this.playbackRateString, LagannBurrowerStrike.maxDuration); HitBoxGroup hitBoxGroup = null; Transform modelTransform = base.GetModelTransform(); if (modelTransform) { hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "LagannImpactHitbox"); } this.attack = new OverlapAttack { attacker = base.gameObject, damage = PrepareLagannBurrowerStrike.damageCoefficient * base.characterBody.damage, damageType = DamageType.BypassArmor, pushAwayForce = 300f, isCrit = base.RollCrit(), damageColorIndex = DamageColorIndex.WeakPoint, inflictor = base.gameObject, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, teamIndex = base.characterBody.teamComponent.teamIndex, hitBoxGroup = hitBoxGroup, hitEffectPrefab = Modules.Assets.punchImpactEffect, impactSound = Modules.Assets.drillRushHitSoundEvent.index, }; base.characterMotor.useGravity = false; if (NetworkServer.active) { base.characterBody.AddBuff(RoR2Content.Buffs.HiddenInvincibility); } if (base.isAuthority) { base.characterMotor.onMovementHit += this.OnMovementHit; } EffectManager.SpawnEffect(Assets.earthMoundEffect, new EffectData { origin = this.spawnLocation, rotation = Util.QuaternionSafeLookRotation(this.spawnRotation) * Quaternion.Euler(new Vector3(90, 0, 0)) }, false); }
public override void OnEnter() { base.OnEnter(); this.tracker = base.GetComponent <HenryTracker>(); this.target = this.tracker.GetTrackingTarget(); if (base.characterBody) { base.characterBody.bodyFlags |= CharacterBody.BodyFlags.IgnoreFallDamage; } if (base.isGrounded) { base.SmallHop(base.characterMotor, 10f); } if (this.target && this.target.healthComponent && this.target.healthComponent.alive) { this.targetIsValid = true; } HitBoxGroup hitBoxGroup = null; Transform modelTransform = base.GetModelTransform(); if (modelTransform) { hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Punch"); } this.attack = new OverlapAttack(); this.attack.damageType = DamageType.Generic; this.attack.attacker = base.gameObject; this.attack.inflictor = base.gameObject; this.attack.teamIndex = base.GetTeam(); this.attack.damage = DashPunch.damageCoefficient * this.damageStat; this.attack.procCoefficient = DashPunch.procCoefficient; this.attack.hitEffectPrefab = DashPunch.hitEffectPrefab; this.attack.hitBoxGroup = hitBoxGroup; this.attack.isCrit = base.RollCrit(); this.attack.impactSound = DashPunch.impactSound.index; this.attack.pushAwayForce = DashPunch.pushForce * 0.2f; Util.PlaySound("HenryStinger", base.gameObject); base.PlayAnimation("FullBody, Override", "DashPunch"); if (base.isGrounded) { EffectManager.SimpleEffect(Modules.Assets.dustEffect, base.characterBody.footPosition, base.transform.rotation, false); } }
internal static void SetupHitbox(GameObject prefab, Transform hitboxTransform, string hitboxName) { HitBoxGroup hitBoxGroup = prefab.AddComponent <HitBoxGroup>(); HitBox hitBox = hitboxTransform.gameObject.AddComponent <HitBox>(); hitboxTransform.gameObject.layer = LayerIndex.projectile.intVal; hitBoxGroup.hitBoxes = new HitBox[] { hitBox }; hitBoxGroup.groupName = hitboxName; }
// Token: 0x06002E10 RID: 11792 RVA: 0x000C40A0 File Offset: 0x000C22A0 protected override void AuthorityModifyOverlapAttack(OverlapAttack overlapAttack) { base.AuthorityModifyOverlapAttack(overlapAttack); overlapAttack.damage = this.damageCoefficient * this.damageStat + this.bonusDamage; overlapAttack.forceVector = base.characterMotor.velocity + base.GetAimRay().direction *Mathf.Lerp(this.minPunchForce, this.maxPunchForce, this.charge); if (base.fixedAge + Time.fixedDeltaTime >= this.duration) { HitBoxGroup hitBoxGroup = base.FindHitBoxGroup("PunchLollypop"); if (hitBoxGroup) { this.hitBoxGroup = hitBoxGroup; overlapAttack.hitBoxGroup = hitBoxGroup; } } }
internal static void SetupHitbox(GameObject prefab, string hitboxName, params Transform[] hitboxTransforms) { HitBoxGroup hitBoxGroup = prefab.AddComponent <HitBoxGroup>(); List <HitBox> hitBoxes = new List <HitBox>(); foreach (Transform i in hitboxTransforms) { HitBox hitBox = i.gameObject.AddComponent <HitBox>(); i.gameObject.layer = LayerIndex.projectile.intVal; hitBoxes.Add(hitBox); } hitBoxGroup.hitBoxes = hitBoxes.ToArray(); hitBoxGroup.groupName = hitboxName; }
public void init(HitBoxGroup hitboxGroup_, HitboxRevealer hitboxPrefab_, GameObject attacker) { hitboxGroup = hitboxGroup_; _hitboxPrefab = hitboxPrefab_; if (attacker) { CharacterBody bod = attacker.GetComponent <CharacterBody>(); if (bod) { _isMerc = checkMerc((int)bod.bodyIndex); } } initVisaulizinators(); }
protected override OverlapAttack CreateAttack(HitBoxGroup hitBoxGroup) { var attack = new OverlapAttack(); attack.damageType = DamageType.BypassArmor; attack.attacker = base.gameObject; attack.inflictor = base.gameObject; attack.teamIndex = base.GetTeam(); attack.damage = c_DamageCoefficient * baseDamageCoeficient * this.damageStat; attack.procCoefficient = procCoefficient; attack.hitEffectPrefab = this.hitEffectPrefab; attack.forceVector = Vector3.zero; attack.pushAwayForce = 0f; attack.hitBoxGroup = hitBoxGroup; attack.isCrit = base.RollCrit(); attack.impactSound = this.impactSound; return(attack); }
private void wheresthebeef(CharacterBody bod) { HitBoxGroup hitboxGroup = bod.modelLocator.modelTransform.GetComponent <HitBoxGroup>(); if (hitboxGroup == null || hitboxGroup.groupName != "Slash") { Debug.LogWarning("couldn't get croco's slashHitbox. probably got changed?. aborting"); } Transform hitboxTransform = hitboxGroup.hitBoxes[0].transform; hitboxTransform.localScale = cfg_newHitboxScale; hitboxTransform.localPosition = cfg_newHtboxPosition; if (cfg_keepVisuals) { return; } ChildLocator childLocator = bod.modelLocator.modelTransform.GetComponent <ChildLocator>(); Transform slash1 = childLocator.FindChild("Slash1"); slash1.localPosition = new Vector3(0, 10.26f, 1); slash1.localRotation = Quaternion.Euler(60, 300, 3.4f); slash1.localScale = new Vector3(1.2f, 1, 1); Transform slash2 = childLocator.FindChild("Slash2"); slash2.localPosition = new Vector3(0, 10.26f, 1); slash2.localRotation = Quaternion.Euler(300, 247, 3.4f); slash2.localScale = new Vector3(1.2f, 1, 1); Transform slash3 = childLocator.FindChild("Slash3"); slash3.localPosition = new Vector3(0, 10.26f, 6); slash3.localRotation = Quaternion.Euler(282, 180, 90); Transform mouth = childLocator.FindChild("MouthMuzzle"); mouth.localScale = new Vector3(1.2f, 1, 1.2f); }
// Token: 0x06004013 RID: 16403 RVA: 0x0010C7BC File Offset: 0x0010A9BC private void ResetOverlapAttack() { if (!this.hitboxGroup) { Transform modelTransform = base.GetModelTransform(); if (modelTransform) { this.hitboxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "HeadCh"); } } this.attack = new OverlapAttack(); this.attack.attacker = base.gameObject; this.attack.inflictor = base.gameObject; this.attack.teamIndex = TeamComponent.GetObjectTeam(this.attack.attacker); this.attack.damage = ChargeAgu.damageCoefficient * this.damageStat; this.attack.forceVector = Vector3.up * 1f; this.attack.pushAwayForce = 1f; this.attack.hitBoxGroup = this.hitboxGroup; }
public void OnEnter() { this.overlapAttack = new OverlapAttack(); this.overlapAttack.attacker = base.gameObject; this.overlapAttack.inflictor = base.gameObject; this.overlapAttack.teamIndex = TeamComponent.GetObjectTeam(this.overlapAttack.attacker); this.overlapAttack.damage = FireBuzzsaw.damageCoefficientPerSecond * this.damageStat / FireBuzzsaw.baseFireFrequency; this.overlapAttack.procCoefficient = FireBuzzsaw.procCoefficientPerSecond / FireBuzzsaw.baseFireFrequency; if (base.characterDirection && base.inputBank) { base.characterDirection.forward = base.inputBank.aimDirection; } if (FireBuzzsaw.impactEffectPrefab) { this.overlapAttack.hitEffectPrefab = FireBuzzsaw.impactEffectPrefab; } Util.PlaySound(Uppercut.enterSoundString, base.gameObject); this.PlayAnim(); this.overlapAttack.hitBoxGroup = HitBoxGroup.FindByGroupName(modelTransform.gameObject, groupName); }
protected virtual void SetupHitbox(GameObject prefab, Transform hitboxTransform, string hitboxGroupName) { HitBoxGroup hitBoxGroup = null; var hitBoxGroups = prefab.GetComponents <HitBoxGroup>(); if (hitBoxGroups != null) { hitBoxGroup = hitBoxGroups.FirstOrDefault((x) => x.groupName == hitboxGroupName); } if (hitBoxGroup == null) { hitBoxGroup = prefab.AddComponent <HitBoxGroup>(); hitBoxGroup.groupName = hitboxGroupName; } List <HitBox> hitBoxes = (hitBoxGroup.hitBoxes != null) ? hitBoxGroup.hitBoxes.ToList() : new List <HitBox>(); HitBox hitBox = hitboxTransform.gameObject.AddComponent <HitBox>(); hitboxTransform.gameObject.layer = LayerIndex.projectile.intVal; hitBoxes.Add(hitBox); hitBoxGroup.hitBoxes = hitBoxes.ToArray(); }
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; }
public override void OnEnter() { base.OnEnter(); this.duration = this.CalcDuration(); if (this.duration <= Time.fixedDeltaTime * 2f) { this.forceFire = true; } base.StartAimMode(2f, false); Util.PlaySound(this.beginStateSoundString, base.gameObject); this.animator = base.GetModelAnimator(); if (base.isAuthority) { this.isCritAuthority = base.RollCrit(); this.hitBoxGroup = base.FindHitBoxGroup(this.GetHitBoxGroupName()); if (this.hitBoxGroup) { OverlapAttack overlapAttack = new OverlapAttack(); overlapAttack.attacker = base.gameObject; overlapAttack.damage = this.damageCoefficient * this.damageStat; overlapAttack.damageColorIndex = DamageColorIndex.Default; overlapAttack.damageType = DamageType.Generic; overlapAttack.forceVector = this.forceVector; overlapAttack.hitBoxGroup = this.hitBoxGroup; overlapAttack.hitEffectPrefab = this.hitEffectPrefab; NetworkSoundEventDef networkSoundEventDef = this.impactSound; overlapAttack.impactSound = ((networkSoundEventDef != null) ? networkSoundEventDef.index : NetworkSoundEventIndex.Invalid); overlapAttack.inflictor = base.gameObject; overlapAttack.isCrit = this.isCritAuthority; overlapAttack.procChainMask = default; overlapAttack.pushAwayForce = this.pushAwayForce; overlapAttack.procCoefficient = this.procCoefficient; overlapAttack.teamIndex = base.GetTeam(); this.overlapAttack = overlapAttack; } } this.PlayAnimation(); }
public override void OnSkillLeveledUp(int level, CharacterBody characterBody, SkillDef skillDef) { base.OnSkillLeveledUp(level, characterBody, skillDef); Chat.AddMessage("SlashBlade"); HitBoxGroup hitboxGroup = characterBody.modelLocator.modelTransform.GetComponent <HitBoxGroup>(); if (hitboxGroup == null || hitboxGroup.groupName != "SlashBlade") { Debug.LogWarning("didn't get Bandit's slashHitbox. probably got changed?. aborting"); return; } Transform hitboxTransform = hitboxGroup.hitBoxes[0].transform; if (originalHitboxScale == Vector3.zero) { originalHitboxScale = hitboxTransform.localScale; } hitboxTransform.localScale = new Vector3(MultScaling(originalHitboxScale.x, 0.2f, level), MultScaling(originalHitboxScale.y, 0.2f, level), MultScaling(originalHitboxScale.z, 0.3f, level)); }
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); }
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); }
public override void OnEnter() { base.OnEnter(); this.duration = SpinningSlashOld.baseDuration / this.attackSpeedStat; this.hasFired = false; Util.PlayAttackSpeedSound(EntityStates.Merc.GroundLight.finisherAttackSoundString, base.gameObject, 0.5f); base.PlayAnimation("FullBody, Override", "SpinSlash", "Whirlwind.playbackRate", this.duration); EffectManager.SimpleMuzzleFlash(Modules.Assets.spinningSlashFX, base.gameObject, "SwingCenter", true); HitBoxGroup hitBoxGroup = null; Transform modelTransform = base.GetModelTransform(); if (modelTransform) { hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "SpinSlash"); } this.attack = new OverlapAttack(); this.attack.attacker = base.gameObject; this.attack.inflictor = base.gameObject; this.attack.teamIndex = base.GetTeam(); this.attack.damageType = DamageType.Stun1s; this.attack.damage = SpinSlashOld.chargeDamageCoefficient * this.damageStat; this.attack.hitEffectPrefab = Modules.Assets.hitFX; this.attack.forceVector = Vector3.up * EntityStates.Toolbot.ToolbotDash.upwardForceMagnitude; this.attack.pushAwayForce = EntityStates.Toolbot.ToolbotDash.awayForceMagnitude; this.attack.hitBoxGroup = hitBoxGroup; this.attack.isCrit = base.RollCrit(); if (base.characterMotor) { base.SmallHop(base.characterMotor, 16f); } }
protected abstract OverlapAttack CreateAttack(HitBoxGroup hitBoxGroup);
public override void OnEnter() { base.OnEnter(); this.duration = this.baseDuration / this.attackSpeedStat; this.earlyExitDuration = this.duration * Slash.earlyExitTime; this.hasFired = false; this.cancelling = false; this.animator = base.GetModelAnimator(); this.swordController = base.GetComponent <PaladinSwordController>(); base.StartAimMode(0.5f + this.duration, false); base.characterBody.isSprinting = false; this.inCombo = false; if (this.swordController) { this.swordController.attacking = true; } HitBoxGroup hitBoxGroup = null; Transform modelTransform = base.GetModelTransform(); if (modelTransform) { hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Sword"); } if (this.swingIndex > 1) { this.swingIndex = 0; this.inCombo = true; } Util.PlaySound(Modules.Sounds.Cloth1, base.gameObject); string animString = "Slash" + (1 + swingIndex).ToString(); if (this.inCombo) { if (!this.animator.GetBool("isMoving") && this.animator.GetBool("isGrounded")) { base.PlayCrossfade("FullBody, Override", "SlashCombo1", "Slash.playbackRate", this.duration, 0.05f); } base.PlayCrossfade("Gesture, Override", "SlashCombo1", "Slash.playbackRate", this.duration, 0.05f); } else { if (!this.animator.GetBool("isMoving") && this.animator.GetBool("isGrounded")) { base.PlayCrossfade("FullBody, Override", animString, "Slash.playbackRate", this.duration, 0.05f); } base.PlayCrossfade("Gesture, Override", animString, "Slash.playbackRate", this.duration, 0.05f); } float dmg = Slash.damageCoefficient; this.attack = new OverlapAttack(); this.attack.damageType = DamageType.Generic; this.attack.attacker = base.gameObject; this.attack.inflictor = base.gameObject; this.attack.teamIndex = base.GetTeam(); this.attack.damage = dmg * this.damageStat; this.attack.procCoefficient = 1; this.attack.hitEffectPrefab = this.swordController.hitEffect; this.attack.forceVector = Vector3.zero; this.attack.pushAwayForce = 750f; this.attack.hitBoxGroup = hitBoxGroup; this.attack.isCrit = base.RollCrit(); }