private void AddEliteMaterials(On.RoR2.CharacterBody.orig_FixedUpdate orig, RoR2.CharacterBody self) { if (self.HasBuff(EliteBuffIndex) && !self.GetComponent <HyperchargedBuffTracker>()) { var modelLocator = self.modelLocator; if (modelLocator) { var modelTransform = self.modelLocator.modelTransform; if (modelTransform) { var model = self.modelLocator.modelTransform.GetComponent <RoR2.CharacterModel>(); if (model) { var hyperchargedBuffTracker = self.gameObject.AddComponent <HyperchargedBuffTracker>(); hyperchargedBuffTracker.Body = self; TemporaryOverlay overlay = self.modelLocator.modelTransform.gameObject.AddComponent <RoR2.TemporaryOverlay>(); overlay.duration = float.PositiveInfinity; overlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); overlay.animateShaderAlpha = true; overlay.destroyComponentOnEnd = true; overlay.originalMaterial = EliteMaterial; overlay.AddToCharacerModel(model); hyperchargedBuffTracker.Overlay = overlay; } } } } orig(self); }
public override void OnEnter() { base.OnEnter(); this.duration = this.baseDuration; this.hasFallen = false; this.cometParticle = base.GetModelChildLocator().FindChild("CometEffect").GetComponentInChildren <ParticleSystem>(); base.characterBody.bodyFlags |= CharacterBody.BodyFlags.IgnoreFallDamage; if (base.isAuthority) { base.characterMotor.velocity *= 0.2f; base.characterMotor.rootMotion.y += 0.5f; base.characterMotor.velocity.y = 35; base.gameObject.layer = LayerIndex.fakeActor.intVal; base.characterMotor.Motor.RebuildCollidableLayers(); } Transform modelTransform = base.GetModelTransform(); if (modelTransform) { TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = this.duration; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matDoppelganger"); temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>()); } base.PlayAnimation("FullBody, Override", "FallingCometStart", "ToTheStars.playbackRate", 1f); Util.PlayAttackSpeedSound(Croco.Leap.leapSoundString, base.gameObject, 0.75f); }
private void CharacterModel_UpdateOverlays(On.RoR2.CharacterModel.orig_UpdateOverlays orig, CharacterModel self) { orig(self); if (self) { if (self.body && self.body.HasBuff(Modules.Buffs.torporDebuff)) { var torporController = self.body.GetComponent <Misc.PaladinTorporTracker>(); if (!torporController) { torporController = self.body.gameObject.AddComponent <Misc.PaladinTorporTracker>(); } else { return; } torporController.Body = self.body; TemporaryOverlay overlay = self.gameObject.AddComponent <RoR2.TemporaryOverlay>(); overlay.duration = float.PositiveInfinity; overlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); overlay.animateShaderAlpha = true; overlay.destroyComponentOnEnd = true; overlay.originalMaterial = Resources.Load <Material>("Materials/matDoppelganger"); overlay.AddToCharacerModel(self); torporController.Overlay = overlay; } } }
private static void CharacterModel_UpdateOverlays(On.RoR2.CharacterModel.orig_UpdateOverlays orig, CharacterModel self) { orig(self); if (self) { if (self.body && self.body.HasBuff(Charm)) { var isCharmed = self.body.GetComponent <IsCharmed>(); if (isCharmed && !isCharmed.Overlay) { TemporaryOverlay overlay = self.gameObject.AddComponent <TemporaryOverlay>(); overlay.duration = float.PositiveInfinity; overlay.alphaCurve = AnimationCurve.Constant(0f, 0f, 0.54f); overlay.animateShaderAlpha = true; overlay.destroyComponentOnEnd = true; overlay.originalMaterial = assetBundle.LoadAsset <Material>("Assets/Textures/Materials/Overlays/Charmed.mat"); overlay.AddToCharacerModel(self); isCharmed.Overlay = overlay; } else { return; } } } }
// Token: 0x06000674 RID: 1652 RVA: 0x0001E610 File Offset: 0x0001C810 public override void OnExit() { this.CreateBlinkEffect(base.transform.position); this.modelTransform = base.GetModelTransform(); if (this.modelTransform) { TemporaryOverlay temporaryOverlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 0.6f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matHuntressFlashBright"); temporaryOverlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); TemporaryOverlay temporaryOverlay2 = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay2.duration = 0.7f; temporaryOverlay2.animateShaderAlpha = true; temporaryOverlay2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay2.destroyComponentOnEnd = true; temporaryOverlay2.originalMaterial = Resources.Load <Material>("Materials/matHuntressFlashExpanded"); temporaryOverlay2.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); } if (this.characterModel) { this.characterModel.invisibilityCount--; } if (this.hurtboxGroup) { HurtBoxGroup hurtBoxGroup = this.hurtboxGroup; int hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter - 1; hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter; } base.OnExit(); }
private void FireShockwave() { if (!this.hasFired) { this.hasFired = true; if (NetworkServer.active) { base.characterBody.RemoveBuff(Modules.Buffs.armorBuff); } AkSoundEngine.StopPlayingID(this.soundID); Vector3 position = base.transform.position; Util.PlaySound("UNUNUN", base.gameObject); if (FireMegaNova.novaEffectPrefab) { EffectManager.SimpleMuzzleFlash(FireMegaNova.novaEffectPrefab, base.gameObject, "Chest", false); } Transform modelTransform = base.GetModelTransform(); if (modelTransform) { TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 3f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matVagrantEnergized"); temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>()); } if (base.isAuthority) { new BlastAttack { attacker = base.gameObject, baseDamage = this.storedDamage, baseForce = FireMegaNova.novaForce, bonusForce = Vector3.zero, attackerFiltering = AttackerFiltering.NeverHit, crit = base.RollCrit(), damageColorIndex = DamageColorIndex.Default, damageType = DamageType.Generic, falloffModel = BlastAttack.FalloffModel.None, inflictor = base.gameObject, position = position, procChainMask = default(ProcChainMask), procCoefficient = 1f, radius = this.shockwaveRadius, losType = BlastAttack.LoSType.NearestHit, teamIndex = base.teamComponent.teamIndex, impactEffect = EffectCatalog.FindEffectIndexFromPrefab(FireMegaNova.novaImpactEffectPrefab) }.Fire(); } } }
// Token: 0x0600050F RID: 1295 RVA: 0x00015B04 File Offset: 0x00013D04 public override void FixedUpdate() { base.FixedUpdate(); this.stopwatch += Time.fixedDeltaTime; this.attackStopwatch += Time.fixedDeltaTime; float num = 1f / Evis.damageFrequency / this.attackSpeedStat; if (this.attackStopwatch >= num) { this.attackStopwatch -= num; HurtBox hurtBox = this.SearchForTarget(); if (hurtBox) { Util.PlayScaledSound(Evis.slashSoundString, base.gameObject, Evis.slashPitch); Util.PlaySound(Evis.dashSoundString, base.gameObject); Util.PlaySound(Evis.impactSoundString, base.gameObject); HurtBoxGroup hurtBoxGroup = hurtBox.hurtBoxGroup; HurtBox hurtBox2 = hurtBoxGroup.hurtBoxes[UnityEngine.Random.Range(0, hurtBoxGroup.hurtBoxes.Length - 1)]; if (hurtBox2) { DamageInfo damageInfo = new DamageInfo(); damageInfo.damage = Evis.damageCoefficient * this.damageStat; damageInfo.attacker = base.gameObject; damageInfo.procCoefficient = Evis.procCoefficient; damageInfo.position = hurtBox2.transform.position; damageInfo.crit = this.crit; hurtBox2.healthComponent.TakeDamage(damageInfo); GlobalEventManager.instance.OnHitEnemy(damageInfo, hurtBox2.healthComponent.gameObject); GlobalEventManager.instance.OnHitAll(damageInfo, hurtBox2.healthComponent.gameObject); Vector3 position = hurtBox2.transform.position; Vector2 normalized = UnityEngine.Random.insideUnitCircle.normalized; Vector3 normal = new Vector3(normalized.x, 0f, normalized.y); EffectManager.instance.SimpleImpactEffect(Evis.hitEffectPrefab, position, normal, false); Transform transform = hurtBox.hurtBoxGroup.transform; TemporaryOverlay temporaryOverlay = transform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = num; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matMercEvisTarget"); temporaryOverlay.AddToCharacerModel(transform.GetComponent <CharacterModel>()); } } else if (base.isAuthority && this.stopwatch > Evis.minimumDuration) { this.outer.SetNextStateToMain(); } } if (base.characterMotor) { base.characterMotor.velocity = Vector3.zero; } if (this.stopwatch >= Evis.duration && base.isAuthority) { this.outer.SetNextStateToMain(); } }
// Token: 0x06002D67 RID: 11623 RVA: 0x000C009C File Offset: 0x000BE29C public override void FixedUpdate() { base.FixedUpdate(); this.stopwatch += Time.fixedDeltaTime; if (this.stopwatch > EvisDash.dashPrepDuration && !this.isDashing) { this.isDashing = true; this.dashVector = base.inputBank.aimDirection; this.CreateBlinkEffect(Util.GetCorePosition(base.gameObject)); base.PlayCrossfade("FullBody, Override", "EvisLoop", 0.1f); if (this.modelTransform) { TemporaryOverlay temporaryOverlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 0.6f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matHuntressFlashBright"); temporaryOverlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); TemporaryOverlay temporaryOverlay2 = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay2.duration = 0.7f; temporaryOverlay2.animateShaderAlpha = true; temporaryOverlay2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay2.destroyComponentOnEnd = true; temporaryOverlay2.originalMaterial = Resources.Load <Material>("Materials/matHuntressFlashExpanded"); temporaryOverlay2.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); } } bool flag = this.stopwatch >= EvisDash.dashDuration + EvisDash.dashPrepDuration; if (this.isDashing) { if (base.characterMotor && base.characterDirection) { base.characterMotor.rootMotion += this.dashVector * (this.moveSpeedStat * EvisDash.speedCoefficient * Time.fixedDeltaTime); } if (base.isAuthority) { Collider[] array = Physics.OverlapSphere(base.transform.position, base.characterBody.radius + EvisDash.overlapSphereRadius * (flag ? EvisDash.lollypopFactor : 1f), LayerIndex.entityPrecise.mask); for (int i = 0; i < array.Length; i++) { HurtBox component = array[i].GetComponent <HurtBox>(); if (component && component.healthComponent != base.healthComponent) { Evis nextState = new Evis(); this.outer.SetNextState(nextState); return; } } } } if (flag && base.isAuthority) { this.outer.SetNextStateToMain(); } }
public CharacterMaster SummonHeretic(GameObject summonerBodyObject, Vector3 spawnPosition) { if (!NetworkServer.active) { Debug.LogWarning("[Server] function 'SummonHeretic(UnityEngine.GameObject)' called on client"); return(null); } MasterSummon masterSummon = new MasterSummon { masterPrefab = MasterCatalog.FindMasterPrefab("HereticMonsterMaster"), position = spawnPosition, rotation = Quaternion.identity, summonerBodyObject = summonerBodyObject, ignoreTeamMemberLimit = true, useAmbientLevel = new bool?(true), }; CharacterMaster characterMaster = masterSummon.Perform(); if (characterMaster) { GameObject bodyObject = characterMaster.GetBodyObject(); if (bodyObject) { ModelLocator component = bodyObject.GetComponent <ModelLocator>(); if (component && component.modelTransform) { TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 0.5f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matSummonDrone"); temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent <CharacterModel>()); } var inventory = characterMaster.inventory; if (inventory) { inventory.CopyItemsFrom(summonerBodyObject.GetComponent <CharacterBody>().inventory); } } } if (characterMaster && characterMaster.bodyInstanceObject) { characterMaster.GetBody().AddTimedBuff(RoR2Content.Buffs.Immune, 3f); GameObject gameObject = Resources.Load <GameObject>("Prefabs/Effects/HippoRezEffect"); if (gameObject) { EffectManager.SpawnEffect(gameObject, new EffectData { origin = spawnPosition, rotation = characterMaster.bodyInstanceObject.transform.rotation }, true); } } return(characterMaster); }
// Token: 0x060005CE RID: 1486 RVA: 0x0001A824 File Offset: 0x00018A24 private void Detonate() { Vector3 position = base.transform.position; Util.PlaySound(FireMegaNova.novaSoundString, base.gameObject); if (FireMegaNova.novaEffectPrefab) { EffectManager.instance.SimpleMuzzleFlash(FireMegaNova.novaEffectPrefab, base.gameObject, "NovaCenter", false); } Transform modelTransform = base.GetModelTransform(); if (modelTransform) { TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 3f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matVagrantEnergized"); temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>()); } if (base.isAuthority) { BullseyeSearch bullseyeSearch = new BullseyeSearch(); bullseyeSearch.filterByLoS = true; bullseyeSearch.maxDistanceFilter = this.novaRadius; bullseyeSearch.searchOrigin = position; bullseyeSearch.sortMode = BullseyeSearch.SortMode.Distance; bullseyeSearch.teamMaskFilter = TeamMask.allButNeutral; bullseyeSearch.teamMaskFilter.RemoveTeam(base.teamComponent.teamIndex); bullseyeSearch.RefreshCandidates(); bullseyeSearch.queryTriggerInteraction = QueryTriggerInteraction.Collide; List <HurtBox> list = bullseyeSearch.GetResults().ToList <HurtBox>(); if (list.Count > 0) { DamageInfo damageInfo = new DamageInfo(); damageInfo.damage = this.damageStat * FireMegaNova.novaDamageCoefficient; damageInfo.attacker = base.gameObject; damageInfo.procCoefficient = 1f; damageInfo.crit = Util.CheckRoll(this.critStat, base.characterBody.master); for (int i = 0; i < list.Count; i++) { HurtBox hurtBox = list[i]; HealthComponent healthComponent = hurtBox.healthComponent; if (healthComponent) { damageInfo.force = FireMegaNova.novaForce * (healthComponent.transform.position - position).normalized; damageInfo.position = hurtBox.transform.position; EffectManager.instance.SimpleImpactEffect(FireMegaNova.novaImpactEffectPrefab, hurtBox.transform.position, Vector3.up, true); healthComponent.TakeDamage(damageInfo); } } } } }
public override void OnEnter() { base.OnEnter(); bool flag = base.characterBody; bool flag2 = flag; if (flag2) { base.characterBody.AddTimedBuff(Buffs.TemplarOverdriveBuff, 3f); } EffectManager.SimpleMuzzleFlash(FireTarball.effectPrefab, base.gameObject, "Root", false); RoR2.EffectManager.SpawnEffect(LegacyResourcesAPI.Load <GameObject>("Prefabs/Effects/ImpactEffects/ExplosivePotExplosion"), new RoR2.EffectData { origin = base.characterBody.corePosition, scale = 12f }, true); BlastAttack blastAttack = new BlastAttack { attacker = base.gameObject, inflictor = base.gameObject, teamIndex = base.teamComponent.teamIndex, baseForce = TemplarOverdrive.pushForce, bonusForce = Vector3.zero, position = base.transform.position, radius = 12f, falloffModel = BlastAttack.FalloffModel.None, crit = false, baseDamage = 0f, procCoefficient = 0f, damageType = DamageType.ClayGoo }; blastAttack.Fire(); this.modelTransform = base.GetModelTransform(); bool flag3 = this.modelTransform; bool flag4 = flag3; if (flag4) { TemporaryOverlay temporaryOverlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 8f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = LegacyResourcesAPI.Load <Material>("Materials/matClayGooDebuff"); temporaryOverlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); } Util.PlayAttackSpeedSound(FireTarball.attackSoundString, base.gameObject, 0.75f); this.outer.SetNextStateToMain(); }
// Token: 0x06002EA5 RID: 11941 RVA: 0x000C6560 File Offset: 0x000C4760 private void Detonate() { Vector3 position = base.transform.position; Util.PlaySound(FireMegaNova.novaSoundString, base.gameObject); if (FireMegaNova.novaEffectPrefab) { EffectManager.SimpleMuzzleFlash(FireMegaNova.novaEffectPrefab, base.gameObject, "NovaCenter", false); } Transform modelTransform = base.GetModelTransform(); if (modelTransform) { TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 3f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matVagrantEnergized"); temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>()); } if (NetworkServer.active) { new BlastAttack { attacker = base.gameObject, baseDamage = this.damageStat * FireMegaNova.novaDamageCoefficient, baseForce = FireMegaNova.novaForce, bonusForce = Vector3.zero, canHurtAttacker = false, crit = base.characterBody.RollCrit(), damageColorIndex = DamageColorIndex.Default, damageType = DamageType.Generic, falloffModel = BlastAttack.FalloffModel.None, inflictor = base.gameObject, position = position, procChainMask = default(ProcChainMask), procCoefficient = 3f, radius = this.novaRadius, losType = BlastAttack.LoSType.NearestHit, teamIndex = base.teamComponent.teamIndex, impactEffect = EffectCatalog.FindEffectIndexFromPrefab(FireMegaNova.novaImpactEffectPrefab) }.Fire(); } }
public CharacterMaster SummonMage(GameObject summonerBody, Vector3 spawnPosition) { if (!NetworkServer.active) { return(null); } Inventory summonerInventory = summonerBody.GetComponent <CharacterBody>()?.inventory ? summonerBody.GetComponent <CharacterBody>().inventory : null; MasterSummon masterSummon = new MasterSummon { masterPrefab = MageMasterPrefab, position = spawnPosition, rotation = Quaternion.identity, summonerBodyObject = summonerBody ?? null, ignoreTeamMemberLimit = true, useAmbientLevel = new bool?(true), inventoryToCopy = cfgCopyInventory.Value ? summonerInventory : null, }; CharacterMaster characterMaster = masterSummon.Perform(); if (characterMaster) { DontDestroyOnLoad(characterMaster); if (characterMaster.inventory) { characterMaster.inventory.GiveItem(RoR2Content.Items.ExtraLife, cfgLives.Value); } GameObject bodyObject = characterMaster.GetBodyObject(); if (bodyObject) { ModelLocator component = bodyObject.GetComponent <ModelLocator>(); if (component && component.modelTransform) { TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 0.5f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matSummonDrone"); temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent <CharacterModel>()); } } } return(characterMaster); }
public override void OnEnter() { this.baseDuration = 15f; this.overrideDuration = 15f; this.muzzleflashEffectPrefab = Resources.Load <GameObject>("Prefabs/Effects/ImpactEffects/ExplosionSolarFlare"); this.projectilePrefab = null; this.castSoundString = Modules.Sounds.CastTorpor; this.swordController = base.gameObject.GetComponent <PaladinSwordController>(); base.OnEnter(); if (NetworkServer.active) { Vector3?vector = this.sunSpawnPosition; float oldMinDistance = ChannelSun.sunPlacementMinDistance; float oldIdealAltitude = ChannelSun.sunPlacementIdealAltitudeBonus; ChannelSun.sunPlacementMinDistance = 0f; ChannelSun.sunPlacementIdealAltitudeBonus = 0f; this.sunSpawnPosition = this.swordController.sunPosition + Vector3.up;//((vector != null) ? vector : ChannelSun.FindSunSpawnPosition(this.spellPosition)); if (this.sunSpawnPosition != null) { this.sunInstance = this.CreateSun(this.sunSpawnPosition.Value); } ChannelSun.sunPlacementMinDistance = oldMinDistance; ChannelSun.sunPlacementIdealAltitudeBonus = oldIdealAltitude; } Transform modelTransform = base.GetModelTransform(); if (modelTransform) { TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = this.baseDuration; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matGrandparentTeleportOutBoom"); temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>()); } }
public override void OnEnter() { base.OnEnter(); base.characterBody.isSprinting = true; this.duration = DashForwardOld.baseDuration; Util.PlayScaledSound(EntityStates.Croco.Leap.leapSoundString, base.gameObject, 1.75f); base.PlayAnimation("FullBody, Override", "DashForward", "Whirlwind.playbackRate", this.duration); 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 = this.forwardDirection * this.dashSpeed; base.characterMotor.velocity.y = 0f; } Transform modelTransform = base.GetModelTransform(); if (modelTransform) { TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 0.75f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matDoppelganger"); temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>()); } if (NetworkServer.active) { base.characterBody.AddBuff(BuffIndex.HiddenInvincibility); } Vector3 b = base.characterMotor ? base.characterMotor.velocity : Vector3.zero; this.previousPosition = base.transform.position - b; }
public CharacterMaster SummonDrone(GameObject bodyPrefab, Vector3 spawnPosition, EquipmentIndex equipmentIndex = EquipmentIndex.None) { if (!NetworkServer.active) { Debug.LogWarning("[Server] function 'RoR2.CharacterMaster RoR2.MithrixSpawnsDronesActivator::SummonMaster(UnityEngine.GameObject)' called on client"); return(null); } MasterSummon masterSummon = new MasterSummon { masterPrefab = masterPrefab, position = spawnPosition, rotation = Quaternion.identity, summonerBodyObject = bodyPrefab, ignoreTeamMemberLimit = true, useAmbientLevel = new bool?(true), }; CharacterMaster characterMaster = masterSummon.Perform(); if (characterMaster) { GameObject bodyObject = characterMaster.GetBodyObject(); if (bodyObject) { ModelLocator component = bodyObject.GetComponent <ModelLocator>(); if (component && component.modelTransform) { TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 0.5f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matSummonDrone"); temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent <CharacterModel>()); } var inventory = characterMaster.inventory; if (inventory) { inventory.SetEquipmentIndex(equipmentIndex); } } } return(characterMaster); }
public override void OnEnter() { base.OnEnter(); if (base.isAuthority) { base.GetComponent <HANDOverclockController>().EnableOverclock(); new BlastAttack { attacker = base.gameObject, inflictor = base.gameObject, teamIndex = TeamComponent.GetObjectTeam(base.gameObject), baseDamage = this.damageStat * 1.5f, baseForce = -30, position = base.modelLocator.transform.position, radius = 15, procCoefficient = 0f, falloffModel = BlastAttack.FalloffModel.None, damageType = DamageType.Stun1s, crit = RollCrit() }.Fire(); if (OVERCLOCK.hitEffectPrefab) { EffectManager.SpawnEffect(OVERCLOCK.hitEffectPrefab, new EffectData { origin = base.transform.position, scale = 15 }, false); } this.modelTransform = GetModelTransform(); if (this.modelTransform) { TemporaryOverlay temporaryOverlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = base.GetComponent <HANDOverclockController>().maxDuration; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matMercEnergized"); temporaryOverlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); } } }
private void CharacterModel_UpdateOverlays(On.RoR2.CharacterModel.orig_UpdateOverlays orig, CharacterModel self) { orig(self); if (self && self.body) { var isJammed = self.body.GetComponent <IsJammed>(); if (isJammed && !isJammed.Overlay) { TemporaryOverlay overlay = self.gameObject.AddComponent <TemporaryOverlay>(); overlay.duration = float.PositiveInfinity; overlay.alphaCurve = AnimationCurve.Constant(0f, 0f, 0.54f); overlay.animateShaderAlpha = true; overlay.destroyComponentOnEnd = true; overlay.originalMaterial = Resources.Load <Material>("Materials/matFullCrit"); overlay.AddToCharacerModel(self); isJammed.Overlay = overlay; } return; } }
public override void OnEnter() { base.OnEnter(); this.duration = Revenge.baseDuration;// / this.attackSpeedStat; this.lastHealth = base.healthComponent.combinedHealth; this.modelAnimator = base.GetModelAnimator(); base.PlayAnimation("FullBody, Override", "RevengeEntry", "Revenge.playbackRate", this.duration * 0.1f); if (NetworkServer.active) { base.characterBody.AddBuff(Modules.Buffs.armorBuff); } Transform modelTransform = base.GetModelTransform(); if (modelTransform) { TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = this.duration; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matDoppelganger"); temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>()); } if (this.modelAnimator) { this.modelAnimator.SetFloat(AnimationParameters.aimWeight, 0f); } this.chargeEffectInstance = GameObject.Instantiate(new EntityStates.ImpBossMonster.BlinkState().blinkDestinationPrefab, base.gameObject.transform); this.chargeEffectInstance.transform.position = base.characterBody.corePosition; this.chargeEffectInstance.GetComponent <ScaleParticleSystemDuration>().newDuration = this.duration; this.areaIndicator = this.chargeEffectInstance.transform.Find("Particles").Find("AreaIndicator"); base.cameraTargetParams.cameraParams = Modules.CameraParams.chargeCameraParams; this.chargeEffectInstance.GetComponentInChildren <PostProcessDuration>().maxDuration = this.duration; }
// Token: 0x06000512 RID: 1298 RVA: 0x00015E2C File Offset: 0x0001402C public override void OnExit() { Util.PlaySound(Evis.endSoundString, base.gameObject); this.CreateBlinkEffect(Util.GetCorePosition(base.gameObject)); this.modelTransform = base.GetModelTransform(); if (this.modelTransform) { TemporaryOverlay temporaryOverlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 0.6f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matMercEvisTarget"); temporaryOverlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); TemporaryOverlay temporaryOverlay2 = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay2.duration = 0.7f; temporaryOverlay2.animateShaderAlpha = true; temporaryOverlay2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay2.destroyComponentOnEnd = true; temporaryOverlay2.originalMaterial = Resources.Load <Material>("Materials/matHuntressFlashExpanded"); temporaryOverlay2.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); } if (this.characterModel) { this.characterModel.invisibilityCount--; } if (this.hurtboxGroup) { HurtBoxGroup hurtBoxGroup = this.hurtboxGroup; int hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter - 1; hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter; } if (base.cameraTargetParams) { base.cameraTargetParams.aimMode = CameraTargetParams.AimType.Standard; } Util.PlaySound(Evis.endSoundString, base.gameObject); base.SmallHop(base.characterMotor, Evis.smallHopVelocity); base.OnExit(); }
// Token: 0x06002D62 RID: 11618 RVA: 0x000BFDCC File Offset: 0x000BDFCC public override void OnExit() { Util.PlaySound(Evis.endSoundString, base.gameObject); this.CreateBlinkEffect(Util.GetCorePosition(base.gameObject)); this.modelTransform = base.GetModelTransform(); if (this.modelTransform) { TemporaryOverlay temporaryOverlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 0.6f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matMercEvisTarget"); temporaryOverlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); TemporaryOverlay temporaryOverlay2 = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay2.duration = 0.7f; temporaryOverlay2.animateShaderAlpha = true; temporaryOverlay2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay2.destroyComponentOnEnd = true; temporaryOverlay2.originalMaterial = Resources.Load <Material>("Materials/matHuntressFlashExpanded"); temporaryOverlay2.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); } if (this.characterModel) { this.characterModel.invisibilityCount--; } if (base.cameraTargetParams) { base.cameraTargetParams.aimMode = CameraTargetParams.AimType.Standard; } if (NetworkServer.active) { base.characterBody.RemoveBuff(BuffIndex.HiddenInvincibility); base.characterBody.AddTimedBuff(BuffIndex.HiddenInvincibility, Evis.lingeringInvincibilityDuration); } Util.PlaySound(Evis.endSoundString, base.gameObject); base.SmallHop(base.characterMotor, Evis.smallHopVelocity); base.OnExit(); }
public override void OnExit() { if (!this.outer.destroying) { this.CreateBlinkEffect(Util.GetCorePosition(base.gameObject)); if (this.modelTransform) { TemporaryOverlay temporaryOverlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 0.6f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matHuntressFlashBright"); temporaryOverlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); TemporaryOverlay temporaryOverlay2 = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay2.duration = 0.7f; temporaryOverlay2.animateShaderAlpha = true; temporaryOverlay2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay2.destroyComponentOnEnd = true; temporaryOverlay2.originalMaterial = Resources.Load <Material>("Materials/matHuntressFlashExpanded"); temporaryOverlay2.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); } } if (this.characterModel) { this.characterModel.invisibilityCount--; } if (this.hurtBoxGroup) { hurtBoxGroup.hurtBoxesDeactivatorCounter -= 1; } if (this.characterMotor) { this.characterMotor.velocity = entryVelocity; } base.OnExit(); }
public override void OnEnter() { base.OnEnter(); base.StartAimMode(0.6f, false); Transform modelTransform = base.GetModelTransform(); if (modelTransform) { TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = this.chargeDuration; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matOnFire"); temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>()); } Ray aimRay = base.GetAimRay(); if (base.isAuthority) { Vector3 direct = aimRay.direction; Vector2 move = new Vector2(characterMotor.moveDirection.x, characterMotor.moveDirection.z); Vector2 aim = new Vector2(aimRay.direction.x, aimRay.direction.z); float forward = Vector2.Dot(move, aim.normalized); Vector2 aimO = new Vector2(aimRay.direction.z, -1 * aimRay.direction.x); float right = Vector2.Dot(move, aimO.normalized); Quaternion major = Quaternion.FromToRotation(left, direct); chargeInstance = Object.Instantiate <GameObject>(chargePrefab, aimRay.origin, transform.rotation * major); chargeInstance.transform.localScale *= 0.0125f; } base.PlayAnimation("Gesture, Override", "DrillChargeStart"); Util.PlaySound(DiggerPlugin.Sounds.DrillChargeStart, base.gameObject); }
public override void OnExit() { if (!this.outer.destroying) { //Util.PlaySound(this.endSoundString, base.gameObject); //this.CreateBlinkEffect(Util.GetCorePosition(base.gameObject)); if (this.modelTransform) { TemporaryOverlay overlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); overlay.duration = 0.6f; overlay.animateShaderAlpha = true; overlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); overlay.destroyComponentOnEnd = true; overlay.originalMaterial = Resources.Load <Material>("Materials/matHuntressFlashBright"); overlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); } } if (this.swordController) { this.swordController.attacking = false; } if (NetworkServer.active) { base.characterBody.RemoveBuff(RoR2Content.Buffs.HiddenInvincibility); } if (base.isAuthority) { base.healthComponent.AddBarrierAuthority(StaticValues.dashBarrierAmount * base.healthComponent.fullBarrier); } base.PlayAnimation("FullBody, Override", "BufferEmpty"); base.OnExit(); }
public void OnExit() { if (!outer.destroying) { Util.PlaySound(BlinkState.endSoundString, gameObject); CreateBlinkEffect(Util.GetCorePosition(gameObject)); modelTransform = GetModelTransform(); if (modelTransform) { TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 0.6f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matHuntressFlashBright"); temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>()); TemporaryOverlay temporaryOverlay2 = modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay2.duration = 0.7f; temporaryOverlay2.animateShaderAlpha = true; temporaryOverlay2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay2.destroyComponentOnEnd = true; temporaryOverlay2.originalMaterial = Resources.Load <Material>("Materials/matHuntressFlashExpanded"); temporaryOverlay2.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>()); } } if (characterModel) { characterModel.invisibilityCount--; } if (hurtboxGroup) { HurtBoxGroup hurtBoxGroup = hurtboxGroup; int hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter - 1; hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter; } base.OnExit(); }
private void SummonDrone(CharacterBody ownerBody, GameObject droneMasterPrefab, int counter = 1) { if (!ownerBody || !droneMasterPrefab) { Log.Warning("Machines.SummonDrone: ownerBody or droneMasterPrefab is null. Cancel drone summon."); return; } CharacterMaster characterMaster = new MasterSummon { masterPrefab = droneMasterPrefab, position = ownerBody.transform.position - (ownerBody.transform.forward.normalized * counter) + (.25f * counter * Vector3.up), rotation = ownerBody.transform.rotation, summonerBodyObject = ownerBody.gameObject, ignoreTeamMemberLimit = true, useAmbientLevel = true }.Perform(); if (characterMaster) { GameObject bodyObject = characterMaster.GetBodyObject(); if (bodyObject) { ModelLocator component = bodyObject.GetComponent <ModelLocator>(); if (component && component.modelTransform) { TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 0.5f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = summonDroneMaterial; temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent <CharacterModel>()); } } RepositionGroundedDrones(characterMaster.GetBody(), ownerBody.transform.position); } }
// Token: 0x06000005 RID: 5 RVA: 0x00002318 File Offset: 0x00000518 public override void OnExit() { bool flag = !this.outer.destroying; if (flag) { bool flag2 = this.goodPlacement; if (flag2) { base.PlayAnimation("Gesture, Additive", "FireWall"); Util.PlaySound(fireSoundString, base.gameObject); bool flag3 = this.areaIndicatorInstance && base.isAuthority; if (flag3) { Vector3 forward = this.areaIndicatorInstance.transform.forward; forward.y = 0f; forward.Normalize(); //Vector3 vector = Vector3.Cross(Vector3.up, forward); this.modelTransform = base.GetModelTransform(); bool flag5 = this.modelTransform; if (flag5) { this.characterModel = this.modelTransform.GetComponent <CharacterModel>(); this.hurtboxGroup = this.modelTransform.GetComponent <HurtBoxGroup>(); } bool flag6 = this.characterModel; if (flag6) { this.characterModel.invisibilityCount++; } bool flag7 = this.hurtboxGroup; if (flag7) { HurtBoxGroup hurtBoxGroup = this.hurtboxGroup; int hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter + 1; hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter; } this.CreateBlinkEffect(Util.GetCorePosition(base.gameObject)); bool flag8 = base.characterMotor; if (flag8) { base.characterMotor.velocity = Vector3.zero; Reflection.SetFieldValue <Vector3>(base.characterMotor.Motor, "_internalTransientPosition", this.areaIndicatorInstance.transform.position + this.raycastHit.normal); } bool flag9 = !this.outer.destroying; if (flag9) { Util.PlaySound(this.endSoundString, base.gameObject); this.CreateBlinkEffect(Util.GetCorePosition(base.gameObject)); this.modelTransform = base.GetModelTransform(); bool flag10 = this.modelTransform; if (flag10) { TemporaryOverlay temporaryOverlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 0.6f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matHuntressFlashBright"); temporaryOverlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); TemporaryOverlay temporaryOverlay2 = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay2.duration = 0.7f; temporaryOverlay2.animateShaderAlpha = true; temporaryOverlay2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay2.destroyComponentOnEnd = true; temporaryOverlay2.originalMaterial = Resources.Load <Material>("Materials/matHuntressFlashExpanded"); temporaryOverlay2.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); } } bool flag11 = this.characterModel; if (flag11) { this.characterModel.invisibilityCount--; } bool flag12 = this.hurtboxGroup; if (flag12) { HurtBoxGroup hurtBoxGroup2 = this.hurtboxGroup; int hurtBoxesDeactivatorCounter2 = hurtBoxGroup2.hurtBoxesDeactivatorCounter - 1; hurtBoxGroup2.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter2; } var characterBody = this.characterBody; if (characterBody) { var inventory = characterBody.inventory; if (inventory) { int scarfCount = inventory.GetItemCount(BloodiedScarf.instance.catalogIndex); int debuffStacks = characterBody.GetBuffCount(BloodiedScarf.ScarfVuln); if (debuffStacks > 0) { characterBody.ClearTimedBuffs(BloodiedScarf.ScarfVuln); } for (uint i = 0; i < scarfCount; i++) { characterBody.AddTimedBuff(BloodiedScarf.ScarfVuln, 1f); } } } } } else { base.skillLocator.utility.AddOneStock(); base.PlayCrossfade("Gesture, Additive", "BufferEmpty", 0.2f); } } EntityState.Destroy(this.areaIndicatorInstance.gameObject); base.characterBody.crosshairPrefab = this.cachedCrosshairPrefab; base.OnExit(); }
// Token: 0x06000508 RID: 1288 RVA: 0x000155C4 File Offset: 0x000137C4 public override void FixedUpdate() { base.FixedUpdate(); base.characterDirection.forward = this.dashVector; if (this.stopwatch > Assaulter.dashPrepDuration / this.attackSpeedStat && !this.isDashing) { this.isDashing = true; this.dashVector = base.inputBank.aimDirection; this.CreateDashEffect(); base.PlayCrossfade("FullBody, Override", "AssaulterLoop", 0.1f); base.gameObject.layer = LayerIndex.fakeActor.intVal; base.characterMotor.Motor.RebuildCollidableLayers(); if (this.hurtboxGroup) { HurtBoxGroup hurtBoxGroup = this.hurtboxGroup; int hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter + 1; hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter; } if (this.modelTransform) { TemporaryOverlay temporaryOverlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = 0.7f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matMercEnergized"); temporaryOverlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); } } if (!this.isDashing) { this.stopwatch += Time.fixedDeltaTime; } else if (base.isAuthority) { base.characterMotor.velocity = Vector3.zero; if (!this.inHitPause) { bool flag = this.overlapAttack.Fire(null); this.stopwatch += Time.fixedDeltaTime; if (flag) { Util.PlaySound(Assaulter.impactSoundString, base.gameObject); if (!this.hasHit) { this.hasHit = true; if (this.dashSkill) { this.dashSkill.AddHit(); } } this.inHitPause = true; this.hitPauseTimer = Assaulter.hitPauseDuration / this.attackSpeedStat; if (this.modelTransform) { TemporaryOverlay temporaryOverlay2 = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay2.duration = Assaulter.hitPauseDuration / this.attackSpeedStat; temporaryOverlay2.animateShaderAlpha = true; temporaryOverlay2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay2.destroyComponentOnEnd = true; temporaryOverlay2.originalMaterial = Resources.Load <Material>("Materials/matMercEvisTarget"); temporaryOverlay2.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); } } base.characterMotor.rootMotion += this.dashVector * this.moveSpeedStat * Assaulter.speedCoefficient * Time.fixedDeltaTime; } else { this.hitPauseTimer -= Time.fixedDeltaTime; if (this.hitPauseTimer < 0f) { this.inHitPause = false; } } } if (this.stopwatch >= Assaulter.dashDuration + Assaulter.dashPrepDuration / this.attackSpeedStat && base.isAuthority) { this.outer.SetNextStateToMain(); } }
public override void OnEnter() { base.OnEnter(); this.animator = base.GetModelAnimator(); this.modelTransform = base.GetModelTransform(); this.isClay = false; if (NetworkServer.active) { base.characterBody.AddBuff(BuffIndex.HiddenInvincibility); } //this shouldn't be hardcoded in but i really just cba if (base.characterBody.skinIndex == 3) { this.isClay = true; } if (this.isClay) { base.PlayAnimation("Body", "SpawnClay", "Spawn.playbackRate", SpawnState.duration); Util.PlaySound(EntityStates.ClayBruiserMonster.SpawnState.spawnSoundString, base.gameObject); EffectManager.SimpleMuzzleFlash(EntityStates.ClayBruiserMonster.SpawnState.spawnEffectPrefab, base.gameObject, "Base", false); if (this.modelTransform) { TemporaryOverlay overlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); overlay.duration = SpawnState.duration; overlay.animateShaderAlpha = true; overlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); overlay.destroyComponentOnEnd = true; overlay.originalMaterial = Resources.Load <Material>("Materials/matClayGooDebuff"); overlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); PrintController printController = this.modelTransform.gameObject.AddComponent <PrintController>(); printController.printTime = EntityStates.ClayBruiserMonster.SpawnState.printDuration; printController.enabled = true; printController.startingPrintHeight = 0.3f; printController.maxPrintHeight = 0.3f; printController.startingPrintBias = EntityStates.ClayBruiserMonster.SpawnState.startingPrintBias; printController.maxPrintBias = EntityStates.ClayBruiserMonster.SpawnState.maxPrintBias; printController.disableWhenFinished = true; printController.printCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f); } } else { base.PlayAnimation("Body", "Spawn", "Spawn.playbackRate", SpawnState.duration); Util.PlaySound(EntityStates.ParentMonster.SpawnState.spawnSoundString, base.gameObject); base.GetModelChildLocator().FindChild("SpawnEffect").gameObject.SetActive(true); if (this.modelTransform) { TemporaryOverlay overlay = this.modelTransform.gameObject.AddComponent <TemporaryOverlay>(); overlay.duration = SpawnState.duration * 0.75f; overlay.animateShaderAlpha = true; overlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); overlay.destroyComponentOnEnd = true; overlay.originalMaterial = Resources.Load <Material>("Materials/matHuntressFlashBright"); overlay.AddToCharacerModel(this.modelTransform.GetComponent <CharacterModel>()); PrintController printController = this.modelTransform.gameObject.AddComponent <PrintController>(); printController.printTime = EntityStates.ClayBruiserMonster.SpawnState.printDuration; printController.enabled = true; printController.startingPrintHeight = 0.3f; printController.maxPrintHeight = 0.3f; printController.startingPrintBias = EntityStates.ClayBruiserMonster.SpawnState.startingPrintBias; printController.maxPrintBias = EntityStates.ClayBruiserMonster.SpawnState.maxPrintBias; printController.disableWhenFinished = true; printController.printCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f); } } if (this.animator) { this.animator.SetFloat(AnimationParameters.aimWeight, 0f); } if (base.characterBody) { Transform modelTransform = base.GetModelTransform(); if (modelTransform) { modelTransform.GetComponent <CharacterModel>().baseRendererInfos[0].defaultMaterial.SetFloat("_EmPower", StaticValues.maxSwordGlow); } } }
//private StyleSystem.StyleComponent styleComponent; public override void OnEnter() { base.OnEnter(); this.duration = this.baseDuration; Ray aimRay = base.GetAimRay(); //this.styleComponent = base.GetComponent<StyleSystem.StyleComponent>(); base.characterMotor.disableAirControlUntilCollision = false; base.GetModelChildLocator().FindChild("DrillChargeEffect").GetComponent <ParticleSystem>().Play(); Transform modelTransform = base.GetModelTransform(); if (modelTransform) { TemporaryOverlay temporaryOverlay = modelTransform.gameObject.AddComponent <TemporaryOverlay>(); temporaryOverlay.duration = this.duration; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 15f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = Resources.Load <Material>("Materials/matOnFire"); temporaryOverlay.AddToCharacerModel(modelTransform.GetComponent <CharacterModel>()); } //bool flag = false; //float angle = Vector3.Angle(new Vector3(0, -1, 0), aimRay.direction); //if (angle > 120) flag = true; this.type = 0; if (charged > 8) { this.type = 1; base.GetModelAnimator().SetFloat("DrillCharge.offset", Util.Remap(base.characterMotor.velocity.y, -70, 70, -1, 1)); base.PlayAnimation("FullBody, Override", "DrillCharge"); /*if (flag) * { * this.type = 1; * base.PlayAnimation("FullBody, Override", "DrillChargeVertical", "Spin.playbackRate", 5f); * } * else * { * this.type = 2; * base.PlayAnimation("FullBody, Override", "DrillChargeHorizontal", "Spin.playbackRate", 5f); * }*/ } else { base.PlayAnimation("FullBody, Override", "DrillChargeShort"); } if (NetworkServer.active) { base.characterBody.AddBuff(RoR2Content.Buffs.HiddenInvincibility); } Util.PlaySound(DiggerPlugin.Sounds.DrillCharge, base.gameObject); if (base.isAuthority) { blastAttack = new BlastAttack { radius = 10f, procCoefficient = 1, position = aimRay.origin, attacker = base.gameObject, crit = Util.CheckRoll(base.characterBody.crit, base.characterBody.master), baseDamage = base.characterBody.damage * DrillCharge.damageCoefficient, falloffModel = BlastAttack.FalloffModel.None, baseForce = 3f, damageType = DamageType.Generic, attackerFiltering = AttackerFiltering.NeverHit, }; blastAttack.teamIndex = TeamComponent.GetObjectTeam(blastAttack.attacker); effectData = new EffectData(); effectData.scale = 1.5f; effectData.color = new Color32(234, 234, 127, 100); base.characterMotor.velocity += 75 * aimRay.direction; } }