protected void Update() { PlayerController player = (GameManager.Instance.PrimaryPlayer); if (player.CurrentGun == this.gun) { bool yeah = player.Velocity.magnitude > 0.05f; if (!yeah) { //Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(player.sprite); Material outlineMaterial1 = SpriteOutlineManager.GetOutlineMaterial(gun.sprite); //outlineMaterial.SetColor("_OverrideColor", new Color(20f, 20f, 42f)); outlineMaterial1.SetColor("_OverrideColor", new Color(20f, 20f, 42f)); } else { //Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(player.sprite); Material outlineMaterial1 = SpriteOutlineManager.GetOutlineMaterial(gun.sprite); //outlineMaterial.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); outlineMaterial1.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); } } else { //Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(player.sprite); Material outlineMaterial1 = SpriteOutlineManager.GetOutlineMaterial(gun.sprite); //outlineMaterial.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); outlineMaterial1.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); } }
private void UseBoost(PlayerController player, float num, bool fatal, HealthHaver spapi) { Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(Owner.sprite); outlineMaterial.SetColor("_OverrideColor", new Color(0f, 0f, 0f, 0f)); RemoveStat(PlayerStats.StatType.Damage); }
IEnumerator LevelUpEffect(PlayerController player) { bool on = false; Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(player.sprite); Color orig = outlineMaterial.GetColor("_OverrideColor"); for (int i = 0; i <= 6; i++) { on = !on; if (on) { outlineMaterial.SetColor("_OverrideColor", onColor); } else { outlineMaterial.SetColor("_OverrideColor", orig); } if (i == 6) { break; } yield return(new WaitForSeconds(.2f)); } outlineMaterial.SetColor("_OverrideColor", orig); blinking = false; }
public override void Update() { base.Update(); Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(base.LastOwner.sprite); if (base.LastOwner.CurrentGoop != null) { this.currentGoop = base.LastOwner.CurrentGoop == EasyGoopDefinitions.BlobulonGoopDef ? true : false; } else { this.currentGoop = false; } if (currentGoop != lastGoop && outlineMaterial != null) { this.RemoveStat(PlayerStats.StatType.Damage); this.DisableVFX(base.LastOwner); if (currentGoop) { this.AddStat(PlayerStats.StatType.Damage, 0.5f, StatModifier.ModifyMethod.ADDITIVE); outlineMaterial.SetColor("_OverrideColor", new Color(99f, 99f, 0f)); } } base.LastOwner.stats.RecalculateStats(base.LastOwner, true, false); this.lastGoop = this.currentGoop; }
public void Awake() { this.m_gun = base.GetComponent <Gun>(); if (this.m_gun.CurrentOwner is PlayerController) { this.m_player = this.m_gun.CurrentOwner as PlayerController; } this.m_VFXBody = new GameObject(); UnityEngine.Object.DontDestroyOnLoad(this.m_VFXBody); this.m_GunVFXCollection = SpriteBuilder.ConstructCollection(m_VFXBody, "HeatGaugeVFX_Collection"); UnityEngine.Object.DontDestroyOnLoad(this.m_GunVFXCollection); this.m_HeatGaugeEmpty = SpriteBuilder.AddSpriteToCollection("Items/Resources/VFX/HeatGauge/heat_gauge_empty", this.m_GunVFXCollection); this.m_HeatGauge1 = SpriteBuilder.AddSpriteToCollection("Items/Resources/VFX/HeatGauge/heat_gauge_1", this.m_GunVFXCollection); this.m_HeatGauge2 = SpriteBuilder.AddSpriteToCollection("Items/Resources/VFX/HeatGauge/heat_gauge_2", this.m_GunVFXCollection); this.m_HeatGauge3 = SpriteBuilder.AddSpriteToCollection("Items/Resources/VFX/HeatGauge/heat_gauge_3", this.m_GunVFXCollection); this.m_HeatGauge4 = SpriteBuilder.AddSpriteToCollection("Items/Resources/VFX/HeatGauge/heat_gauge_4", this.m_GunVFXCollection); this.m_HeatGauge5 = SpriteBuilder.AddSpriteToCollection("Items/Resources/VFX/HeatGauge/heat_gauge_5", this.m_GunVFXCollection); this.m_HeatGauge6 = SpriteBuilder.AddSpriteToCollection("Items/Resources/VFX/HeatGauge/heat_gauge_6", this.m_GunVFXCollection); this.m_HeatGauge7 = SpriteBuilder.AddSpriteToCollection("Items/Resources/VFX/HeatGauge/heat_gauge_7", this.m_GunVFXCollection); this.m_HeatGauge8 = SpriteBuilder.AddSpriteToCollection("Items/Resources/VFX/HeatGauge/heat_gauge_8", this.m_GunVFXCollection); this.m_HeatGauge9 = SpriteBuilder.AddSpriteToCollection("Items/Resources/VFX/HeatGauge/heat_gauge_9", this.m_GunVFXCollection); this.m_HeatGauge10 = SpriteBuilder.AddSpriteToCollection("Items/Resources/VFX/HeatGauge/heat_gauge_10", this.m_GunVFXCollection); this.m_HeatGauge1 = SpriteBuilder.AddSpriteToCollection("Items/Resources/VFX/HeatGauge/heat_gauge_full", this.m_GunVFXCollection); this.m_gun.OnPostFired += this.AddHeat; this.m_outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(this.m_gun.sprite); this.m_outlineMaterial.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); }
private void DisableVFX(PlayerController user) { if (user) { Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(user.sprite); outlineMaterial.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); } }
public override void OnPostFired(PlayerController player, Gun gun) { AkSoundEngine.PostEvent("Stop_WPN_All", base.gameObject); gun.PreventNormalFireAudio = true; AkSoundEngine.PostEvent("Play_BOSS_agunim_move_01", base.gameObject); targetPoint = player.unadjustedAimPoint; if (shotcountcontroller == 1) { Projectile projectile1 = ((Gun)ETGMod.Databases.Items[9]).DefaultModule.projectiles[0]; GameObject gameObject1 = SpawnManager.SpawnProjectile(projectile1.gameObject, player.sprite.WorldCenter, Quaternion.Euler(0f, 0f, (player.CurrentGun == null) ? 0f : player.CurrentGun.CurrentAngle), true); Projectile component1 = gameObject1.GetComponent <Projectile>(); BounceProjModifier bounce = component1.GetComponent <BounceProjModifier>(); bounce.chanceToDieOnBounce = 0; bounce.numberOfBounces = 6; PierceProjModifier stab = component1.GetComponent <PierceProjModifier>(); stab.MaxBossImpacts = 4; stab.penetration = 6; bool flag = component1 != null; if (flag) { component1.Owner = player; component1.Shooter = player.specRigidbody; component1.baseData.speed = 10f; component1.baseData.range *= 1f; component1.baseData.damage = 12f; component1.angularVelocity = 1000f; component1.projectileHitHealth = 50; component1.collidesWithProjectiles = true; component1.AdditionalScaleMultiplier = 1.2f; component1.pierceMinorBreakables = true; component1.HasDefaultTint = true; component1.DefaultTintColor = UnityEngine.Color.cyan; } current_ball = component1; shotcountcontroller = 0; Material outline = SpriteOutlineManager.GetOutlineMaterial(gun.sprite); outline.SetColor("_OverrideColor", new Color(63f, 236f, 165f)); } else { Vector2 vector = current_ball.sprite.WorldCenter; Vector2 Aim = player.unadjustedAimPoint; current_ball.SendInDirection(Aim - vector, false, true); foreach (var projectile in GetBullets()) { projectile.baseData.speed = projectile.baseData.speed + 5; projectile.baseData.damage = projectile.baseData.damage * 1.75f; projectile.angularVelocity = projectile.angularVelocity * -1; projectile.Update(); projectile.UpdateSpeed(); } } }
private void KillBoost(PlayerController player) { if (!hasBoost) { hasBoost = true; AddStat(PlayerStats.StatType.Damage, 1.5f, StatModifier.ModifyMethod.MULTIPLICATIVE); Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(Owner.sprite); outlineMaterial.SetColor("_OverrideColor", new Color(252f, 56f, 56f, 50f)); } }
private void EnableVFX(PlayerController Owner) { //Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(Owner.sprite); //outlineMaterial.SetColor("_OverrideColor", new Color(76f, 252f, 252f)); //Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(Owner.sprite); //outlineMaterial.SetColor("_OverrideColor", new Color(0.3f, 0.988f, 0.988f)); Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(Owner.sprite); outlineMaterial.SetColor("_OverrideColor", new Color(0f, 1f, 0f)); }
private void Proj(Projectile projectile) { float i = UnityEngine.Random.value; if (i < .05f) { projectile.baseData.damage = 75; Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(projectile.sprite); outlineMaterial.SetColor("_OverrideColor", new Color(252f, 56f, 56f, 50f)); } }
private void EnableVfx() { AkSoundEngine.PostEvent("Play_ITM_Macho_Brace_Active_01", this.gameObject); this.m_currentSprunSpinVfx = Toolbox.CreateSprenSpun(this.m_owner.CenterPosition); this.m_currentSprunSpinVfx.transform.parent = this.m_owner.transform; this.m_currentSprunSpinVfx.GetComponent <Toolbox.SprenSpunBehaviour>().ChangeDirection(Toolbox.SprenSpunBehaviour.SprenSpunRotateType.BACKWARDS); Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(this.m_owner.sprite); if (outlineMaterial != null) { outlineMaterial.SetColor("_OverrideColor", new Color(144f, 246f, 180f)); } }
private void DoPlayerFocus(AIActor actor) { if (actor != null || actor.healthHaver.IsAlive) { actor.healthHaver.AllDamageMultiplier -= .25f; Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(actor.sprite); outlineMaterial.SetColor("_OverrideColor", new Color(0, 0, 0)); } if (Owner != null) { Owner.specRigidbody.OnPreRigidbodyCollision += ReflectProjectile; } }
public override DebrisObject Drop(PlayerController player) { DebrisObject debrisObject = base.Drop(player); debrisObject.GetComponent <Bladelust>().m_pickedUpThisRun = true; Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(Owner.sprite); outlineMaterial.SetColor("_OverrideColor", new Color(0f, 0f, 0f, 0f)); player.OnKilledEnemy -= KillBoost; player.OnDealtDamageContext -= UseBoost; RemoveStat(PlayerStats.StatType.Damage); return(debrisObject); }
public override void OnReloadPressed(PlayerController player, Gun gun, bool bSOMETHING) { if (gun.IsReloading && this.HasReloaded) { AkSoundEngine.PostEvent("Stop_WPN_All", base.gameObject); HasReloaded = false; base.OnReloadPressed(player, gun, bSOMETHING); Material outline = SpriteOutlineManager.GetOutlineMaterial(gun.sprite); outline.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); shotcountcontroller = 1; } }
private void goopBoost() { if (base.Owner) { Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(base.Owner.sprite); this.goop = base.m_owner.CurrentGoop; bool flag1 = this.goop == this.goopLast; if (!flag1 && outlineMaterial != null) { this.RemoveStat(PlayerStats.StatType.Damage); this.RemoveStat(PlayerStats.StatType.RateOfFire); this.RemoveStat(PlayerStats.StatType.ReloadSpeed); this.RemoveStat(PlayerStats.StatType.AdditionalShotPiercing); this.RemoveStat(PlayerStats.StatType.EnemyProjectileSpeedMultiplier); this.DisableVFX(base.Owner); bool flag2 = this.goop == goopDefs[0]; if (flag2) { this.AddStat(PlayerStats.StatType.Damage, 1.5f, StatModifier.ModifyMethod.MULTIPLICATIVE); outlineMaterial.SetColor("_OverrideColor", new Color(255f, 0f, 0f, 50f)); } bool flag3 = this.goop == goopDefs[1]; if (flag3) { this.AddStat(PlayerStats.StatType.ReloadSpeed, 0.5f, StatModifier.ModifyMethod.MULTIPLICATIVE); outlineMaterial.SetColor("_OverrideColor", new Color(0f, 128f, 0f, 50f)); } bool flag4 = this.goop == goopDefs[2]; if (flag4) { this.AddStat(PlayerStats.StatType.RateOfFire, 1.5f, StatModifier.ModifyMethod.MULTIPLICATIVE); outlineMaterial.SetColor("_OverrideColor", new Color(0f, 0f, 255f, 50f)); } bool flag5 = this.goop == goopDefs[3]; if (flag5) { this.AddStat(PlayerStats.StatType.AdditionalShotPiercing, 1f, StatModifier.ModifyMethod.ADDITIVE); outlineMaterial.SetColor("_OverrideColor", new Color32(212, 58, 58, 255)); } bool flag6 = this.goop == goopDefs[4]; if (flag6) { this.AddStat(PlayerStats.StatType.EnemyProjectileSpeedMultiplier, 0.5f, StatModifier.ModifyMethod.MULTIPLICATIVE); outlineMaterial.SetColor("_OverrideColor", new Color(255f, 255f, 0f, 50f)); } base.Owner.stats.RecalculateStats(base.Owner, true, false); this.goopLast = this.goop; } } }
private void DisableVfx() { AkSoundEngine.PostEvent("Play_ITM_Macho_Brace_Fade_01", this.gameObject); if (this.m_currentSprunSpinVfx != null) { Destroy(this.m_currentSprunSpinVfx); } Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(this.m_owner.sprite); if (outlineMaterial != null) { outlineMaterial.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); } }
public void EnableMachoVFX(PlayerController target) { if (this.m_destroyVFXSemaphore == 0) { Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(target.sprite); if (outlineMaterial != null) { outlineMaterial.SetColor("_OverrideColor", new Color(99f, 99f, 0f)); } if (EasyVFXDatabase.MachoBraceOverheadVFX && !this.m_instanceVFX) { this.m_instanceVFX = target.PlayEffectOnActor(EasyVFXDatabase.MachoBraceOverheadVFX, new Vector3(0f, 1.375f, 0f), true, true, false); } } }
private void DoEnemyFocus(AIActor actor) { Owner.specRigidbody.OnPreRigidbodyCollision -= ReflectProjectile; if (actor != null || actor.healthHaver.IsAlive) { actor.healthHaver.AllDamageMultiplier += .25f; Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(actor.sprite); Color specialPink = new Color(254, 126, 229, 50f); outlineMaterial.SetColor("_OverrideColor", specialPink); } else { DoPlayerFocus(actor); } }
// The select enemy method. This gets called when an enemy is hit with a regular projectile. void SelectEnemy(AIActor target) { DeselectEnemy(); // Deselect the current enemy if one is selected. // Give it a nice white outline. Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(target.sprite); if (outlineMaterial != null) { outlineMaterial.SetColor("_OverrideColor", new Color(60f, 60f, 60f)); } CreateOminousSkull(target); // Creates the damage indicator skull above the enemy's head highlightedEnemy = target; // Sets the targeted enemy variable }
private void HandlePreCollision(SpeculativeRigidbody myRigidbody, PixelCollider myPixelCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherPixelCollider) { bool flag = otherRigidbody && otherRigidbody.healthHaver; if (flag) { if (myRigidbody.projectile.baseData.damage > otherRigidbody.healthHaver.GetCurrentHealth()) { this.extraDamage = myRigidbody.projectile.baseData.damage - otherRigidbody.healthHaver.GetCurrentHealth(); this.hasExtraDamage = true; Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(base.Owner.sprite); outlineMaterial.SetColor("_OverrideColor", new Color32(120, 190, 85, 50)); } } }
void Update() { if (!this.gun.PreventNormalFireAudio) // Make it so the gun doesn't make any regular sound { this.gun.PreventNormalFireAudio = true; } // This happens if the player has the gun held. if (gun.CurrentOwner is PlayerController owner) { // If the player has the Hyperspeed Swing synergy, set their gun's fps to 30. Otherwise set it back to 20 bool hasSynergy = owner.PlayerHasActiveSynergy("Hyperspeed Swing"); int fps = (int)gun.spriteAnimator.GetClipByName(gun.shootAnimation).fps; if (fps == 20 && hasSynergy) { GunExt.SetAnimationFPS(gun, 30); } else if (fps == 30 && !hasSynergy) { GunExt.SetAnimationFPS(gun, 20); } // This section checks to see if the shoot button was pressed, and if it was, sets the clicked variable to true var input = BraveInput.GetInstanceForPlayer(owner.PlayerIDX); if (input.ActiveActions.ShootAction.State == true && input.ActiveActions.ShootAction.LastState == false) { clicked = true; } if (gun.IsReloading) // If the gun is reloading (aka just combo killed an enemy), set clicked to false so the shooting animation stops { clicked = false; } // This code checks to see if an enemy is targeted, and if it is, give it a bright white outline. if (highlightedEnemy != null) { Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(highlightedEnemy.sprite); if (outlineMaterial != null) { outlineMaterial.SetColor("_OverrideColor", new Color(60f, 60f, 60f)); } } } else { DeselectEnemy(); // If the gun isn't held by the player, deselect an enemy if one is selected. } }
private void ReflectProjectile(SpeculativeRigidbody myRigidbody, PixelCollider myPixelCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherPixelCollider) { Projectile component = otherRigidbody.GetComponent <Projectile>(); if (component != null && !(component.Owner is PlayerController)) { if (UnityEngine.Random.value < .16f) { PassiveReflectItem.ReflectBullet(component, true, Owner.specRigidbody.gameActor, 40f, 1f, .5f, 0f); PhysicsEngine.SkipCollision = true; Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(component.sprite); Color specialPink = new Color(254, 126, 229, 50f); outlineMaterial.SetColor("_OverrideColor", specialPink); } } }
public void DisableMachoVFX(PlayerController target) { if (this.m_destroyVFXSemaphore == 0) { Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(target.sprite); if (outlineMaterial != null) { outlineMaterial.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); } if (!this.m_hasUsedShot) { } if (this.m_instanceVFX) { SpawnManager.Despawn(this.m_instanceVFX); this.m_instanceVFX = null; } } }
private void Movement() { AngVel = Owner.NonZeroLastCommandedDirection.ToAngle(); Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(Owner.sprite); if (AngVel == AngVelLast) { return; } RemoveStat(PlayerStats.StatType.ProjectileSpeed); RemoveStat(PlayerStats.StatType.Damage); RemoveStat(PlayerStats.StatType.RateOfFire); RemoveStat(PlayerStats.StatType.ReloadSpeed); this.DisableVFX(Owner); if (AngVel == 0f) { AddStat(PlayerStats.StatType.ProjectileSpeed, 1.3f, StatModifier.ModifyMethod.MULTIPLICATIVE); outlineMaterial.SetColor("_OverrideColor", new Color(54f, 208f, 255f, 50f)); } if (AngVel == 90f) { AddStat(PlayerStats.StatType.RateOfFire, 1.3f, StatModifier.ModifyMethod.MULTIPLICATIVE); outlineMaterial.SetColor("_OverrideColor", new Color(232f, 255f, 54f, 50f)); } if (AngVel == -180f) { AddStat(PlayerStats.StatType.Damage, 1.3f, StatModifier.ModifyMethod.MULTIPLICATIVE); outlineMaterial.SetColor("_OverrideColor", new Color(252f, 56f, 56f, 50f)); } if (AngVel == -90f) { AddStat(PlayerStats.StatType.ReloadSpeed, .7f, StatModifier.ModifyMethod.MULTIPLICATIVE); outlineMaterial.SetColor("_OverrideColor", new Color(54f, 255f, 121f, 50f)); } this.Owner.stats.RecalculateStats(Owner, true); AngVelLast = AngVel; }
void DeselectEnemy() { assaultLevel = -1; // Set your assault level back to -1 (meaning pre-dashed) since if theres no selected enemy there should be no combo if (highlightedEnemy != null) // This only happens if an enemy is currently selected { // Set it's outline back to black Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(highlightedEnemy.sprite); if (outlineMaterial != null) { outlineMaterial.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); } // Fade out the damage indicator skull if the enemy has one var skull = highlightedEnemy.GetComponent <SkullController>(); if (skull != null) { skull.FadeOut(); } highlightedEnemy = null; // Set the targeted enemy variable to null } }
//This block of code allows us to change the reload sounds. protected void Update() { if (gun.CurrentOwner) { if (!gun.PreventNormalFireAudio) { this.gun.PreventNormalFireAudio = true; } if (!gun.IsReloading && !HasReloaded) { this.HasReloaded = true; } if (gun.IsFiring) { Material outline = SpriteOutlineManager.GetOutlineMaterial(this.gun.sprite); outline.SetColor("_OverrideColor", new Color(195f, 191f, 191f)); } else { Material outline = SpriteOutlineManager.GetOutlineMaterial(this.gun.sprite); outline.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); } } }
private void StartVFX(PlayerController user) { Material outline = SpriteOutlineManager.GetOutlineMaterial(user.sprite); outline.SetColor("_OverrideColor", new Color(63f, 236f, 165f)); }
private void EnableVFX(PlayerController user) { Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(user.sprite); outlineMaterial.SetColor("_OverrideColor", new Color(76f, 252f, 252f)); }
private void EnableVFX(PlayerController Owner) { Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(Owner.sprite); outlineMaterial.SetColor("_OverrideColor", new Color(0f, 1f, 0f)); }
private void StopVFX(AIActor user) { Material outline = SpriteOutlineManager.GetOutlineMaterial(user.sprite); outline.SetColor("_OverrideColor", new Color(0f, 0f, 0f)); }