void Awake() { m_character = GameObject.FindWithTag("Player"); tumores = new List <Repair>(); enemies = new List <Repair>(); //blinkWarning = GameObject.FindObjectOfType<Blink>(); GameObject warning = GameObject.FindGameObjectWithTag("Warning"); if (warning == null) { Debug.Log("Warning is null."); } blinkWarning = warning.GetComponent <Blink>(); if (blinkWarning == null) { Debug.Log("blinkWarning is null."); } //GameObject miniPlayer = GameObject.FindWithTag("MiniPlayer"); GameObject miniPlayer = GameObject.FindGameObjectWithTag("MiniPlayer"); if (miniPlayer == null) { Debug.Log("MiniPlayer is null."); } blinkPlayer = miniPlayer.GetComponent <Blink>(); if (blinkPlayer == null) { Debug.Log("blinkPlayer is null."); } //blinkPlayer.StopBlink(false); buttonSquencer = GameObject.FindObjectOfType <ButtonSequencer>(); countDown = GameObject.FindObjectOfType <CountDown>(); scoreManager = GameObject.FindObjectOfType <ScoreManager>(); }
public void Initialise(PlayerReader playerReader, RequirementFactory requirementFactory, ILogger logger) { Pull.Initialise(playerReader, requirementFactory, logger); Combat.Initialise(playerReader, requirementFactory, logger); Adhoc.Initialise(playerReader, requirementFactory, logger); Parallel.Initialise(playerReader, requirementFactory, logger); ShapeshiftForm.ForEach(i => i.Initialise(playerReader, requirementFactory, logger)); Interact.Key = InteractKey; Interact.Initialise(playerReader, requirementFactory, logger); Blink.Initialise(playerReader, requirementFactory, logger); TargetLastTarget.Key = TargetLastTargetKey; TargetLastTarget.Initialise(playerReader, requirementFactory, logger); GatherFindKeys.ForEach(key => { GatherFindKeyConfig.Add(new KeyAction { Key = key }); GatherFindKeyConfig.Last().Initialise(playerReader, requirementFactory, logger); }); }
// This is to make sure that the values can be tweaked in the editor while playing private void CheckForEditorChanges() { if (blinking) { // instantiate blinking blinkScript = GameObject.FindObjectOfType <Blink>(); if (blinkScript == null) { blinkScript = this.gameObject.AddComponent <Blink>(); } } if (previousCurveAngle != curveAngle || previousCurveMaxLenght != curveMaxLenght || previousCurveNodeLenght != curveNodeDistance) { Debug.Log("CurveTeleporter: Values changed, reinstantiated variables"); levels = 0; foreach (GameObject node in nodeObjects) { GameObject.Destroy(node); } nodeObjects.Clear(); int maxNumberOfNodes = (int)Mathf.Ceil(curveMaxLenght / curveNodeDistance); for (int i = 1; i <= maxNumberOfNodes; i++) { GameObject newNode = (GameObject)GameObject.Instantiate(curveGraphicTemplate); newNode.name = "Node" + i.ToString(); newNode.transform.SetParent(raycastCurve.transform); nodeObjects.Add(newNode); } } previousCurveAngle = curveAngle; previousCurveMaxLenght = curveMaxLenght; previousCurveNodeLenght = curveNodeDistance; }
public void SetPositionLaserPost(Vector3 pos, bool onRightSide) { m_IsOnRight = onRightSide; this.transform.position = pos; m_TargetPosition = pos; // get vector based on screen percentage laser takes up Vector3 laserVector = ScreenUtilities.GetWSofSSPosition(m_LaserLength, 0.0f); Vector3 centerScreenVector = ScreenUtilities.GetWSofSSPosition(0.0f, 0.0f); laserVector = centerScreenVector - laserVector; m_LaserBlinkInstance = Instantiate( m_LaserBlinkPrefab, this.transform.position, Quaternion.identity, this.transform); // orient laser based on if it is on left or right side of screen. if (onRightSide) { this.transform.localRotation = Quaternion.Euler(0, 0, 180.0f); m_LaserBlinkInstance.transform.localRotation = Quaternion.Euler(0, 0, 180.0f); m_TargetPosition += laserVector; } else { this.transform.localRotation = Quaternion.Euler(0, 0, 0); m_LaserBlinkInstance.transform.localRotation = Quaternion.Euler(0, 0, 180.0f); m_TargetPosition -= laserVector; } // move original position of laser m_LineRenderer.SetPosition(0, this.transform.position); m_LineRenderer.SetPosition(1, this.transform.position); }
public override async Task ExecuteAsync(CancellationToken token) { try { if (Config.Target.Value.SelectedValue.Contains("Lock") && Context.TargetSelector.IsActive && (!CanExecute || EnemyHero == null || !EnemyHero.IsValid || !EnemyHero.IsAlive)) { EnemyHero = Context.TargetSelector.Active.GetTargets().FirstOrDefault() as Hero; } else if (Config.Target.Value.SelectedValue.Contains("Default") && Context.TargetSelector.IsActive) { EnemyHero = Context.TargetSelector.Active.GetTargets().FirstOrDefault() as Hero; } var Silenced = UnitExtensions.IsSilenced(base.Owner); var SliderData = this.Config.UseBlink.Item.GetValue <Slider>().Value; var IsInvis = Ensage.SDK.Extensions.UnitExtensions.IsInvisible(this.Owner); if (EnemyHero != null && !EnemyHero.IsInvulnerable()) { if (!Silenced && this.Config.AbilityToggler.Value.IsEnabled(this.QAbi.Ability.Name) && this.Owner.IsMelee && !IsInvis && this.Owner.IsInAttackRange(EnemyHero, 350) && !this.Owner.IsInRange(EnemyHero, 150)) { this.QAbi.Ability.ToggleAbility(); await Await.Delay(this.GetAbilityDelay(base.Owner, QAbi), token); } if (!Silenced && this.Config.AbilityToggler.Value.IsEnabled(this.QAbi.Ability.Name) && !IsInvis && this.Owner.IsRanged && this.Owner.IsInRange(EnemyHero, 150)) { this.QAbi.Ability.ToggleAbility(); await Await.Delay(this.GetAbilityDelay(base.Owner, QAbi), token); } if (!Silenced && !this.Owner.IsInAttackRange(EnemyHero) && !IsInvis && this.Owner.IsRanged) { this.QAbi.Ability.ToggleAbility(); await Await.Delay(this.GetAbilityDelay(base.Owner, QAbi), token); } if (this.Blink != null && this.Blink.CanBeCasted && Owner.Distance2D(EnemyHero) <= 1200 + SliderData && !IsInvis && !(this.Owner.Distance2D(EnemyHero) <= 400) && this.Config.ItemToggler2.Value.IsEnabled(this.Blink.Item.Name)) { var l = (this.Owner.Distance2D(EnemyHero) - SliderData) / SliderData; var posA = this.Owner.Position; var posB = EnemyHero.Position; var x = (posA.X + (l * posB.X)) / (1 + l); var y = (posA.Y + (l * posB.Y)) / (1 + l); var position = new Vector3((int)x, (int)y, posA.Z); this.Blink.UseAbility(position); await Await.Delay(Blink.GetCastDelay(position), token); } if (!UnitExtensions.IsMagicImmune(EnemyHero)) { if (!Silenced && this.WAbi != null && this.WAbi.CanBeCasted && !IsInvis && this.WAbi.CanHit(EnemyHero) && this.Config.AbilityToggler.Value.IsEnabled(this.WAbi.Ability.Name)) { this.WAbi.UseAbility(); await Await.Delay(WAbi.GetCastDelay(), token); } if (!Silenced && this.EAbi != null && this.EAbi.CanBeCasted && !IsInvis && this.EAbi.CanHit(EnemyHero) && this.Config.AbilityToggler.Value.IsEnabled(this.EAbi.Ability.Name)) { this.EAbi.UseAbility(EnemyHero); await Await.Delay(EAbi.GetCastDelay(), token); } if (!Silenced && this.RAbi != null && this.RAbi.CanBeCasted && !IsInvis && this.Owner.IsAttacking() && this.Config.AbilityToggler.Value.IsEnabled(this.RAbi.Ability.Name)) { this.RAbi.UseAbility(); await Await.Delay(EAbi.GetCastDelay(), token); } if (this.BloodThorn != null && this.BloodThorn.CanBeCasted && !IsInvis && this.Owner.IsInAttackRange(EnemyHero) && !this.Owner.IsAttacking() && this.Config.ItemToggler.Value.IsEnabled(this.BloodThorn.Item.Name)) { this.BloodThorn.UseAbility(EnemyHero); await Await.Delay(BloodThorn.GetCastDelay(EnemyHero), token); } if (this.Medalion1 != null && this.Medalion1.CanBeCasted && !IsInvis && this.Owner.IsInAttackRange(EnemyHero) && !this.Owner.IsAttacking() && this.Config.ItemToggler.Value.IsEnabled(this.Medalion1.Item.Name)) { this.Medalion1.UseAbility(EnemyHero); await Await.Delay(Medalion1.GetCastDelay(EnemyHero), token); } if (this.Medallion2 != null && this.Medallion2.CanBeCasted && !IsInvis && this.Owner.IsInAttackRange(EnemyHero) && !this.Owner.IsAttacking() && this.Config.ItemToggler.Value.IsEnabled(this.Medallion2.Item.Name)) { this.Medallion2.UseAbility(EnemyHero); await Await.Delay(Medallion2.GetCastDelay(EnemyHero), token); } if (this.SheepStick != null && this.SheepStick.CanBeCasted && !IsInvis && this.Owner.IsInAttackRange(EnemyHero) && this.Config.ItemToggler.Value.IsEnabled(this.SheepStick.Item.Name)) { this.SheepStick.UseAbility(EnemyHero); await Await.Delay(SheepStick.GetCastDelay(EnemyHero), token); } if (this.DiffBlade != null && this.DiffBlade.CanBeCasted && !IsInvis && this.Owner.IsInAttackRange(EnemyHero) && this.Config.ItemToggler.Value.IsEnabled(DiffBlade.Item.Name)) { this.DiffBlade.UseAbility(EnemyHero); await Await.Delay(DiffBlade.GetCastDelay(EnemyHero), token); } if (this.Orchid != null && this.Orchid.CanBeCasted && !IsInvis && this.Owner.IsInAttackRange(EnemyHero) && this.Config.ItemToggler.Value.IsEnabled(Orchid.Item.Name)) { this.Orchid.UseAbility(EnemyHero); await Await.Delay(Orchid.GetCastDelay(EnemyHero), token); } if (this.Mjollnir != null && this.Mjollnir.CanBeCasted && !IsInvis && this.Owner.IsInAttackRange(EnemyHero) && this.Config.ItemToggler2.Value.IsEnabled(Mjollnir.Item.Name)) { this.Mjollnir.UseAbility(this.Owner); await Await.Delay(Mjollnir.GetCastDelay(), token); } if (this.Heavens_Halberd != null && this.Heavens_Halberd.CanBeCasted && !IsInvis && this.Owner.IsInAttackRange(EnemyHero) && this.Config.ItemToggler2.Value.IsEnabled(Heavens_Halberd.Item.Name)) { this.Heavens_Halberd.UseAbility(EnemyHero); await Await.Delay(Heavens_Halberd.GetCastDelay(), token); } if (this.Invis_Sword != null && this.Invis_Sword.CanBeCasted && !IsInvis && !this.Owner.IsInRange(EnemyHero, 1000) && !this.Owner.IsAttacking() && this.Config.ItemToggler2.Value.IsEnabled(Invis_Sword.Item.Name)) { this.Invis_Sword.UseAbility(); await Await.Delay(Invis_Sword.GetCastDelay(), token); } if (this.Silver_Edge != null && this.Silver_Edge.CanBeCasted && !IsInvis && !this.Owner.IsInRange(EnemyHero, 1000) && !this.Owner.IsAttacking() && this.Config.ItemToggler2.Value.IsEnabled(Silver_Edge.Item.Name)) { this.Silver_Edge.UseAbility(); await Await.Delay(Silver_Edge.GetCastDelay(), token); } } if (this.Mask_Of_Madness != null && this.Mask_Of_Madness.CanBeCasted && !IsInvis && this.Config.ItemToggler2.Value.IsEnabled(Mask_Of_Madness.Item.Name)) { if (Config.MomUsage.Value.SelectedValue.Contains("Melee Form") && this.Owner.IsMelee && !this.EAbi.CanBeCasted && !this.RAbi.CanBeCasted) { this.Mask_Of_Madness.UseAbility(); await Await.Delay(Mask_Of_Madness.GetCastDelay(), token); } else if (Config.MomUsage.Value.SelectedValue.Contains("Ranged Form") && this.Owner.IsRanged && !this.WAbi.CanBeCasted && !this.RAbi.CanBeCasted) { this.Mask_Of_Madness.UseAbility(); await Await.Delay(Mask_Of_Madness.GetCastDelay(), token); } } if (EnemyHero != null && (EnemyHero.IsInvulnerable() || UnitExtensions.IsAttackImmune(EnemyHero))) { Orbwalker.Move(Game.MousePosition); } else if (EnemyHero != null) { Orbwalker.OrbwalkTo(EnemyHero); } } else { Orbwalker.Move(Game.MousePosition); } } catch (TaskCanceledException) { // canceled } catch (Exception e) { Log.Error(e); } }
private void Awake() { _destructibleComponent = GetComponent <Destructible>(); _blinkComponent = GetComponent <Blink>(); }
// Use this for initialization public void Awake() { DontDestroyOnLoad(transform.gameObject); EquipmentFactory = new equipmentFactory(); if (Application.loadedLevelName == "setup") { previousScene = "setup"; Application.LoadLevel("OverworldBaseCamp"); } InfernalSpawn = (GameObject)Resources.Load("Enemy Prefabs/InfernalEnemy", typeof(GameObject)); #region ability initialization Abilities = new Dictionary<string, Ability>(); // Attack type, damage type, range, angle, cooldown, damagemod, resource cost #region player abilities #region spammed abilities Abilities["fireball"] = new Fireball(AttackType.PROJECTILE, DamageType.FIRE, 10.0f, 0.0f, 0.0f, 10.0f, 0f, "fireball", "Fireball", FireballExplosion); Abilities["shadowbolt"] = new Shadowbolt(AttackType.HONINGPROJECTILE, DamageType.SHADOW, 10.0f, 0.0f, 0.0f, 1.0f, 0f, "shadowbolt", "Shadowbolt", ShadowboltExplosion); Abilities["improvedshadowbolt"] = new ImprovedShadowbolt(AttackType.HONINGPROJECTILE, DamageType.SHADOW, 10.0f, 0.0f, 0.0f, 1.0f, 0f, "improvedshadowbolt", "Improved Shadowbolt", ShadowboltExplosion); Abilities["poisonbolt"] = new Poisonbolt(AttackType.HONINGPROJECTILE, DamageType.POISON, 10.0f, 0.0f, 0.0f, 10.0f, 0f, "poisonbolt", "poisonbolt", FireballExplosion); Abilities["bloodbolt"] = new Bloodbolt(AttackType.HONINGPROJECTILE, DamageType.PHYSICAL, 10.0f, 0.0f, 0.0f, 10.0f, 0f, "bloodbolt", "bloodbolt", FireballExplosion); Abilities["chaosbolt"] = new Chaosbolt(AttackType.HONINGPROJECTILE, DamageType.FIRE, 10.0f, 0.0f, 0.0f, 10.0f, 0f, "chaosbolt", "chaosbolt", ChaosboltExplosion); Abilities["chaosbarragebolt"] = new ChaosBarrageBolt(AttackType.HONINGPROJECTILE, DamageType.FIRE, 10.0f, 0.0f, 0.0f, 10.0f, 0f, "chaosbarragebolt", "chaosbarragebolt", ChaosboltExplosion); Abilities["icebolt"] = new IceBolt(AttackType.PROJECTILE, DamageType.WATER, 8f, 0f, 0.0f, 10.0f, 0f, "icebolt", "Ice Bolt", IceBoltParticles); Abilities["cleave"] = new Cleave(AttackType.MELEE, DamageType.PHYSICAL, 3.0f, 45.0f, 0.0f, 5.0f, 0f, "cleave", "Cleave", CleaveParticles); Abilities["arrow"] = new Arrow(AttackType.PROJECTILE, DamageType.PHYSICAL, 8.0f, 0.0f, 0.0f, 5.0f, 0f, "arrow", "Arrow", ArrowParticles); #endregion #region buff abilities Abilities["chaosbarrage"] = new ChaosBarrageAbility(AttackType.STATUS, DamageType.NONE, 10.0f, 0.0f, 0.0f, 0.0f, 0, "chaosbarrage", "Chaos Barrage", ChaosBarrageParticles); Abilities["fireballbarrage"] = new FireballBarrageAbility(AttackType.STATUS, DamageType.NONE, 10.0f, 0.0f, 30.0f, 0.0f, 100f, "fireballbarrage", "Fireball Barrage", FireballBarrageParticles); Abilities["rootability"] = new RootAbility(AttackType.STATUS, DamageType.NONE, 10.0f, 360.0f, 15.0f, 0.0f, 0f, "rootability", "Root Ability", null); #endregion Abilities["groundslam"] = new Hadouken(AttackType.PBAOE, DamageType.AIR, 5.0f, 360.0f, 10.0f, 10.0f, 25.0f, "groundslam", "Ground Slam", HadoukenParticles); Abilities["deathgrip"] = new Deathgrip(AttackType.PBAOE, DamageType.SHADOW, 5.0f, 360.0f, 0.0f, 15.0f, 25.0f, "deathgrip", "AoE Deathgrip", DeathgripParticles); Abilities["fusrodah"] = new Fusrodah(AttackType.PBAOE, DamageType.AIR, 5.0f, 45.0f, 5.0f, 10.0f, 20.0f, "fusrodah", "Fus Roh Dah", FusRoDahParticles); Abilities["flamestrike"] = new Flamestrike(AttackType.PBAOE, DamageType.FIRE, 5.0f, 360.0f, 5.0f, 1000.0f, 25.0f, "flamestrike", "Flamestrike", FlamestrikeParticles); Abilities["bladewaltz"] = new BladeWaltz(AttackType.PBAOE, DamageType.PHYSICAL, 5.0f, 360.0f, 30.0f, 0f, 50.0f, "bladewaltz", "Blade Waltz", BladeWaltzParticles); Abilities["erenwaltz"] = new ErenWaltz(AttackType.PBAOE, DamageType.PHYSICAL, 5.0f, 360.0f, 0.0f, 5.0f, 0f, "erenwaltz", "Eren Waltz", BladeWaltzParticles); Abilities["firemine"] = new FireMine(AttackType.PROJECTILE, DamageType.FIRE, 5.0f, 360.0f, 4.0f, 200.0f, 10f, "firemine", "Fire Mine", FiremineParticles); Abilities["GETOVERHERE"] = new GETOVERHERE(AttackType.PROJECTILE, DamageType.SHADOW, 4.0f, 0.0f, 0.0f, 0.1f, 10f, "GETOVERHERE", "Shadow Pull", GETOVERHEREParticles); Abilities["normalmine"] = new NormalMine(AttackType.PROJECTILE, DamageType.PHYSICAL, 5.0f, 360.0f, 4.0f, 1.0f, 10f, "normalmine", "Mine", MineParticles); Abilities["blinkstrike"] = new BlinkStrike(AttackType.PROJECTILE, DamageType.SHADOW, 4.0f, 1.0f, 0.0f, 5.0f, 10f, "blinkstrike", "Blink Strike", BlinkStrikeExplosion); Abilities["blink"] = new Blink(AttackType.GROUNDTARGET, DamageType.NONE, 5.0f, 0.0f, 7.0f, 0.0f, 25f, "blink", "Blink", BlinkParticles); Abilities["shockmine"] = new ShockMine(AttackType.PROJECTILE, DamageType.PHYSICAL, 7.0f, 360.0f, 3.0f, 30.0f, 5f, "shockmine", "Shock Mine", ShockMineProjectile); Abilities["aoefreeze"] = new AOEfreeze(AttackType.PBAOE, DamageType.WATER, 5.0f, 360f, 15f, 1f, 30f, "aoefreeze", "Flashfreeze", AOEFreezeParticles); Abilities["onhitnormal"] = new OnHitNormal(AttackType.MELEE, DamageType.PHYSICAL, 0.0f, 0.0f, 0.0f, 0.0f, 0f, "onhitnormal", "On Hit Normal", OnHitNormalParticles); Abilities["onhitsworddrop"] = new OnHitSwordDrop(AttackType.MELEE, DamageType.PHYSICAL, 0f, 0f, 0f, 0f, 0f, "onhitsworddrop", "Sword Drop OnHit", OnHitSwordDropObject); Abilities["fireballturret"] = new FireballTurret(AttackType.PROJECTILE, DamageType.NONE, 10.0f, 360.0f, 2.0f, 0.0f, 40f, "fireballturret", "Fireball Turret", FireballTurretParticles); Abilities["fireballturretfireball"] = new FireballTurretFireball(AttackType.PROJECTILE, DamageType.FIRE, 10.0f, 0.0f, 0.0f, 5.0f, 0f, "fireballturretfireball", "Fireball Turret Fireball", FireballExplosion); Abilities["frozenorb"] = new FrozenOrb(AttackType.PROJECTILE, DamageType.NONE, 5.0f, 360.0f, 8.0f, 0.0f, 30f, "frozenorb", "Frozen Orb", FrozenOrbParticles); Abilities["frozenorbicebolt"] = new IceBolt(AttackType.PROJECTILE, DamageType.WATER, 8f, 0f, 0.0f, 0f, 0f, "frozenorbicebolt", "Frozen Orb Ice Bolt", IceBoltParticles); Abilities["boomerangblade"] = new BoomerangBlade(AttackType.PROJECTILE, DamageType.PHYSICAL, 5f, 0f, 4.0f, 0f, 20f, "boomerangblade", "Boomerang Blade", BoomerangBladeExplosion); Abilities["boomerangbladereturn"] = new BoomerangBladeReturn(AttackType.HONINGPROJECTILE, DamageType.PHYSICAL, 0.0f, 0.0f, 0.0f, 0.0f, 0f, "boomerangbladereturn", "Boomerang Blade(returning)", BoomerangBladeExplosion); Abilities["axethrow"] = new AxeThrow(AttackType.PROJECTILE, DamageType.PHYSICAL, 5.0f, 0.0f, 2.0f, 0.0f, 3f, "axethrow", "Axe Throw", AxeThrowExplosion); Abilities["frostnova"] = new FrostNova(AttackType.PBAOE, DamageType.WATER, 7f, 360f, 20f, 0f, 60f, "frostnova", "Frost Nova", IceBoltParticles); Abilities["shieldbreaker"] = new ShieldBreaker(AttackType.PBAOE, DamageType.PHYSICAL, 10f, 15f, 0.0f, 5f, 20f, "shieldbreaker", "Shieldbreaker", ShieldBreakerParticles); Abilities["dropdasteel"] = new DropDaSteel(AttackType.STATUS, DamageType.NONE, 0f, 0f, 32f, 0f, 0f, "dropdasteel", "Drop Da Steel", dropdasteelparticles); Abilities["dervishdeathgrip"] = new Deathgrip(AttackType.PBAOE, DamageType.NONE, 3f, 360f, 0f, 0f, 0f, "dervishdeathgrip", "Dervish Deathgrip", DeathgripParticles); Abilities["infernalfireball"] = new InfernalFireball(AttackType.HONINGPROJECTILE, DamageType.FIRE, 5.0f, 360.0f, 5.0f, 30.0f, 0f, "infernalfireball", "Infernal Fireball", InfernalFireballExplosion); Abilities["whirlwind"] = new Whirlwind(AttackType.GROUNDTARGET, DamageType.PHYSICAL, 3.0f, 360.0f, 0.0f, 10.0f, 0f, "whirlwind", "Whirlwind", OnHitNormalParticles); Abilities["dervish"] = new Dervish(AttackType.GROUNDTARGET, DamageType.PHYSICAL, 5f, 360f, 0.0f, 10f, 100f, "dervish", "Dervish", OnHitNormalParticles); Abilities["bossinfernalfireball"] = new BossInfernalFireball(AttackType.HONINGPROJECTILE, DamageType.FIRE, 5.0f, 360.0f, 5.0f, 30.0f, 0f, "bossinfernalfireball", "Boss Infernal Fireball", BossInfernalFireballExplosion); //Abilities["healorb"] = new HealOrb(AttackType.PROJECTILE, DamageType.NONE, 5.0f, 360.0f, 0.0f, 0.0f, "healorb", "Heal Orb", HealOrbExplosion); Abilities["deathanddecay"] = new DeathAndDecay(AttackType.GROUNDTARGET, DamageType.SHADOW, 5.0f, 360.0f, 0.0f, 1.0f, 0f, "deathanddecay", "Death and Decay", DeathAndDecaySpawn); Abilities["shadowfury"] = new Shadowfury(AttackType.GROUNDTARGET, DamageType.SHADOW, 3.0f, 360.0f, 0.0f, 1.0f, 0f, "shadowfury", "Shadowfury", ShadowfurySpawn); Abilities["shadowtrap"] = new Shadowtrap(AttackType.GROUNDTARGET, DamageType.SHADOW, 3.0f, 360.0f, 0.0f, 0.0f, 0f, "shadowtrap", "Shadowtrap", ShadowtrapSpawn); #endregion #region enemy abilities Abilities["enemyfireball"] = new Fireball(AttackType.PROJECTILE, DamageType.FIRE, 10.0f, 0.0f, 4f, 10.0f, 0f, "enemyfireball", "Enemy Fireball", FireballExplosion); Abilities["enemycleaveslow"] = new Cleave(AttackType.MELEE, DamageType.PHYSICAL, 3.0f, 45.0f, 3.0f, 5.0f, 0f, "cleave", "Cleave", CleaveParticles); Abilities["enemycleavenormal"] = new Cleave(AttackType.MELEE, DamageType.PHYSICAL, 3.0f, 45.0f, 2f, 2.5f, 0f, "cleave", "Cleave", CleaveParticles); Abilities["enemycleavefast"] = new Cleave(AttackType.MELEE, DamageType.PHYSICAL, 3.0f, 45.0f, 1.0f, 1.0f, 0f, "cleave", "Cleave", CleaveParticles); Abilities["enemydeathgrip"] = new Deathgrip(AttackType.PBAOE, DamageType.SHADOW, 10.0f, 360.0f, 10.0f, 0.0f, 0.0f, "enemydeathgrip", "Enemy Deathgrip", DeathgripParticles); Abilities["bossfireball"] = new BossFireball(AttackType.PROJECTILE, DamageType.FIRE, 10.0f, 0.0f, 5.0f, 10.0f, 0f, "bossfireball", "Boss Fireball", BossInfernalFireballExplosion); Abilities["bossflamestrike"] = new BossFlamestrike(AttackType.PBAOE, DamageType.FIRE, 10.0f, 360.0f, 10.0f, 10.0f, 0.0f, "bossflamestrike", "Boss Flamestrike", BossFlamestrikeParticles); Abilities["enemywhirlwind"] = new Whirlwind(AttackType.GROUNDTARGET, DamageType.PHYSICAL, 3.0f, 360.0f, 8.0f, 5.0f, 0f, "enemywhirlwind", "Enemy Whirlwind", OnHitNormalParticles); #endregion #endregion }
void Awake() { blink = GetComponent <Blink>(); heal = GetComponent <Heal>(); immunity = GetComponent <Immunity>(); }
void CallFuncTest() { btn_text.text = "点击停止"; var action = Sequence.Create( CallFunc.Create(CallBackO, "延时0.5秒"), DelayTime.Create(0.5f), CallFunc.Create(CallBackO, "图片移动"), MoveTo.Create(1f, 200, 100).InitSubjectTransform(image.transform), MoveTo.Create(1f, 0, 0).InitSubjectTransform(image.transform), CallFunc.Create(CallBackO, "颜色渐变"), ColorTo.Create(0.5f, 1, 0, 0, 1f).InitSubjectComponent(image), ColorTo.Create(0.5f, 0, 1, 0, 1f).InitSubjectComponent(image), ColorTo.Create(0.5f, 0, 0, 1, 1f).InitSubjectComponent(image), CallFunc.Create(CallBackO, "颜色reset"), ColorTo.Create(0.5f, 1, 1, 1, 1).InitSubjectComponent(image), CallFunc.Create(CallBackO, "渐隐"), FadeOut.Create(1f).InitSubjectComponent(image), CallFunc.Create(CallBackO, "渐出"), FadeIn.Create(1f).InitSubjectComponent(image), CallFunc.Create(CallBackO, "1秒闪烁5次"), Blink.Create(1f, 5), CallFunc.Create(CallBackO, "二阶贝塞尔曲线"), BezierTo.Create(2.0f, new Vector3(200, 100, 0), new Vector3(-100, 50, 0), new Vector3(100, 80, 0)).InitSubjectTransform(image.transform), CallFunc.Create(CallBackO, "移动回原点"), MoveTo.Create(1f, 0, 0).InitSubjectTransform(image.transform), CallFunc.Create(CallBackO, "边移动边放大"), Spawn.Create(MoveTo.Create(1.0f, 200, 100f), ScaleTo.Create(1.0f, 3.0f, 3.0f, 3.0f)), CallFunc.Create(CallBackO, "缩放位置回原位"), Spawn.Create(MoveTo.Create(1.0f, 0, 0), ScaleTo.Create(1.0f, 1f, 1f, 1f)), NumberBy.Create(2.0f, "数字跳跃,从100到200:{0:f2}", 100, 100).InitSubjectComponent(text), DelayTime.Create(0.5f), NumberTo.Create(2.0f, "数字跳跃,从200到0:{0:f2}", 200, 0).InitSubjectComponent(text), DelayTime.Create(0.5f), CallFunc.Create(CallBackO, "Image Filled"), FillAmountTo.Create(1.5f, 0f).InitSubjectComponent(image), FillAmountTo.Create(1.5f, 1.0f).InitSubjectComponent(image), CallFunc.Create(CallBackO, "reset"), CallFunc.Create(CallBackO, "旋转 放大2倍,复原。重复3次"), Repeat.Create(Spawn.Create( RotationBy.Create(1.0f, 0, 0, 360f), Sequence.Create( ScaleTo.Create(0.5f, 2.0f, 2.0f, 2.0f), ScaleTo.Create(0.5f, 1.0f, 1.0f, 1.0f))).InitSubjectTransform(image.transform), 3), ExtraAction.Create() ); float toX = 300f; var easeAction = Sequence.Create( CallFunc.Create(CallBackO, "变速运动演示,图一正常,图二是变速运动"), DelayTime.Create(1f), CallFunc.Create(CallBackO, "当前变速是EaseIn"), DelayTime.Create(0.5f), Spawn.Create( MoveBy.Create(1.0f, toX, 0f, 0f).InitSubjectTransform(image.transform), EaseIn.Create(MoveBy.Create(1.0f, toX, 0f, 0f).InitSubjectTransform(image2.transform), 3f)), CallFunc.Create(CallBackO, "复位"), Spawn.Create( MoveBy.Create(1.0f, -toX, 0f, 0f).InitSubjectTransform(image.transform), EaseIn.Create(MoveBy.Create(1.0f, -toX, 0f, 0f).InitSubjectTransform(image2.transform), 3f)), CallFunc.Create(CallBackO, "当前变速是EaseOut"), DelayTime.Create(0.5f), Spawn.Create( MoveBy.Create(1.0f, toX, 0f, 0f).InitSubjectTransform(image.transform), EaseOut.Create(MoveBy.Create(1.0f, toX, 0f, 0f).InitSubjectTransform(image2.transform), 3f)), CallFunc.Create(CallBackO, "复位"), Spawn.Create( MoveBy.Create(1.0f, -toX, 0f, 0f).InitSubjectTransform(image.transform), EaseOut.Create(MoveBy.Create(1.0f, -toX, 0f, 0f).InitSubjectTransform(image2.transform), 3f)), CallFunc.Create(CallBackO, "当前变速是EaseInOut"), DelayTime.Create(0.5f), Spawn.Create( MoveBy.Create(1.0f, toX, 0f, 0f).InitSubjectTransform(image.transform), EaseInOut.Create(MoveBy.Create(1.0f, toX, 0f, 0f).InitSubjectTransform(image2.transform), 3f)), CallFunc.Create(CallBackO, "复位"), Spawn.Create( MoveBy.Create(1.0f, -toX, 0f, 0f).InitSubjectTransform(image.transform), EaseInOut.Create(MoveBy.Create(1.0f, -toX, 0f, 0f).InitSubjectTransform(image2.transform), 3f)), CallFunc.Create(CallBackO, "变速运动未完待续"), DelayTime.Create(1f), ExtraAction.Create() ); CCActionManager.Instance.AddAction(Sequence.Create(action, easeAction, CallFunc.Create(CallBackEnd)), transform); }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody2D>(); blink = GetComponent <Blink>(); }
public override bool Decide(StateMachine controller) { if (controller.skillController.Casting) { return(true); } var skills = controller.skillController.skills; var distance = controller.target.transform.position - controller.transform.position; List <int> availableSkillsId = new List <int>(); Blink blink = null; Nova nova = null; for (int i = 0; i < skills.Count; i++) { if (controller.skillController.cooldowns[i] <= 0) { if (distance.magnitude <= skills[i].minRangeToTarget || skills[i].minRangeToTarget == 0) { availableSkillsId.Add(i); } if (skills[i].exactSkillType == ExactSkillType.Nova) { nova = (Nova)skills[i]; availableSkillsId.Remove(i); } if (skills[i].exactSkillType == ExactSkillType.Blink) { blink = (Blink)skills[i]; availableSkillsId.Remove(i); } } } if (nova != null) { if (distance.magnitude <= nova.radius) { controller.skill = nova; return(true); } } if (blink != null) { float blinkRange = (controller.transform.position.normalized + controller.transform.forward.normalized * blink.rangeMultiplier).magnitude; Debug.Log(blinkRange); if (distance.magnitude >= blinkRange) { controller.skill = blink; return(true); } } if (availableSkillsId.Count > 0) { int randomIndex = availableSkillsId[Random.Range(0, availableSkillsId.Count)]; controller.skill = skills[randomIndex]; return(true); } return(false); }
private void Start() { myBlink = FindObjectOfType <Blink>(); blinkAnim.SetTrigger("OpenEye"); }
private void Awake() { blink = GetComponent <Blink>(); hit = GetComponent <Hit>(); }
void OnStateChange() { currentStatus = appStatus.GetState(); string statusMessage; string mode_msg; switch (currentStatus) { case AppState.Status.INTRO_1: statusMessage = "Welcome to Registrate. Press the 'A' button on the controller"; mode_msg = "Introduction"; moveControls.SetActive(false); aText.text = "Next"; bText.text = "Back"; break; case AppState.Status.INTRO_2: statusMessage = "The controls are displayed in the bottom left corner."; mode_msg = "Introduction"; moveControls.SetActive(false); aText.text = "Next"; bText.text = "Back"; Blink.BlinkTwiceAsync(controlTips); break; case AppState.Status.INTRO_3: statusMessage = "To access the settings and map, \n press the menu button"; mode_msg = "Introduction"; moveControls.SetActive(false); aText.text = "Next"; bText.text = "Back"; break; case AppState.Status.EXPLORATION: statusMessage = "Now, walk around the scene to \n initialize device tracking. When you are done press 'Next'"; mode_msg = "Exploration"; moveControls.SetActive(false); aText.text = "Next"; bText.text = "Back"; break; case AppState.Status.FIND_MARKER: statusMessage = "Find the marker indicated \n by the blinking object on the map \n For best alignment, view at slight angle."; mode_msg = "Find Marker"; moveControls.SetActive(false); aText.text = "Next"; bText.text = "Back"; break; case AppState.Status.FIND_TARGET: statusMessage = "Place the target at the position indicated \n by the blinking circle on the map "; mode_msg = "Find Target"; moveControls.SetActive(false); aText.text = "Place"; bText.text = "Back"; break; case AppState.Status.ADJUST_ROTATIONY: //statusMessage = "Rotate the target horizontally, so that it is facing you."; statusMessage = "Adjust each axis of the target \n until it aligns with the bracket. \n change the axis on the directional pad"; mode_msg = "Rotate Y Axis"; aText.text = "Confirm"; bText.text = "Reset"; moveControls.SetActive(true); upArrow.SetActive(false); downArrow.SetActive(false); rightArrow.SetActive(true); leftArrow.SetActive(true); if (!tipsSeen) { Blink.BlinkTwiceAsync(moveControls); tipsSeen = true; } break; case AppState.Status.ADJUST_ROTATIONX: //statusMessage = "Rotate the target vertically"; statusMessage = "Adjust each axis of the target \n until it aligns with the bracket. \n change the axis on the directional pad"; mode_msg = "Rotate X Axis"; moveControls.SetActive(true); aText.text = "Confirm"; bText.text = "Reset"; moveControls.SetActive(true); upArrow.SetActive(true); downArrow.SetActive(true); rightArrow.SetActive(false); leftArrow.SetActive(false); break; case AppState.Status.ADJUST_NORMAL: //statusMessage = "Adjust the position of the target."; statusMessage = "Adjust each axis of the target \n until it aligns with the bracket. \n change the axis on the directional pad"; mode_msg = "Translate Surface Axes"; moveControls.SetActive(true); aText.text = "Confirm"; bText.text = "Reset"; moveControls.SetActive(true); upArrow.SetActive(true); downArrow.SetActive(true); rightArrow.SetActive(true); leftArrow.SetActive(true); break; case AppState.Status.ADJUST_DEPTH: //statusMessage = "Adjust the depth of the target."; statusMessage = "Tip: View target from the side to better judge depth."; mode_msg = "Translate Depth"; moveControls.SetActive(true); aText.text = "Confirm"; bText.text = "Reset"; moveControls.SetActive(true); upArrow.SetActive(true); downArrow.SetActive(true); rightArrow.SetActive(false); leftArrow.SetActive(false); break; case AppState.Status.CONFIRM_MARKER: statusMessage = "Rescan the indicated marker to save \n Marker/Target pairs"; mode_msg = "Confirm Markers"; moveControls.SetActive(false); aText.text = "Confirm"; bText.text = "Back"; break; case AppState.Status.ALIGNMENT_READY: statusMessage = "When you are ready, press A to confirm alignment"; mode_msg = "Alignment Ready"; moveControls.SetActive(false); aText.text = "Confirm"; bText.text = "Back"; break; case AppState.Status.ALIGNED: statusMessage = "Cabin successfully aligned"; mode_msg = "Aligned"; aVisual.SetActive(false); bVisual.SetActive(false); break; case AppState.Status.FAILED: statusMessage = "Could not find cabin in scene. Reset to try again."; mode_msg = "Failed"; aVisual.SetActive(false); bVisual.SetActive(false); break; default: statusMessage = ""; mode_msg = ""; break; } statusMsg.text = statusMessage; mode.text = mode_msg; }
protected void Awake() { animator = transform.FindChild("zombie").GetComponent<Animator>(); blink = transform.FindChild("zombie").GetComponent<Blink>(); }
// data at index [0] int isDragging // data at index [1] float x // data at index [2] float y // data at index [3] int isPinching // data at index [4] float z scale // data at index [5] int isTwisting // data at index [6] float z rotation (euler) // data at index [7] int IsDoubleTapped //void FixedUpdate() { // if (isPinchingFlag) { // puppetBaseObject.transform.localScale = new Vector3(storeScale.x*scale,storeScale.y*scale,storeScale.z*scale); // // } // //} public override void OnOSCMessageReceived(UniOSCEventArgs args) { OscMessage msg = (OscMessage)args.Packet; if (msg.Data.Count < 1) { return; } // isdragging if ((int)msg.Data[0] == 1) // isdragging { if (isDraggingEnabled == true) { if (transformToMove == null) { return; } //Debug.Log("isDragging = true;"); float x = transformToMove.transform.position.x; float y = transformToMove.transform.position.y; float z = transformToMove.transform.position.z; //Debug.Log("isDragging: "+(int)msg.Data[0]); //Debug.Log("X: "+(float)msg.Data[1]); //Debug.Log("Y: "+(float)msg.Data[2]); //Debug.Log("isPinching: "+(int)msg.Data[3]); //Debug.Log("Z Scale: "+(float)msg.Data[4]); //Debug.Log("isTwisting: "+(int)msg.Data[5]); //Debug.Log("z rotation: "+(float)msg.Data[6]); //Debug.Log("IsDoubleTapped: "+(int)msg.Data[7]); x = (float)msg.Data[1]; y = (float)msg.Data[2]; z = transformToMove.transform.position.z; // this is designed to detect if the dragged object is a controller (iskinematic = true ) // if the dragged object is physics based - disable then restore this. rb2D = (Rigidbody2D)transformToMove.gameObject.GetComponent(typeof(Rigidbody2D)); if (rb2D != null) { if (rb2D.isKinematic == false) // we're just checking if the dragged object is a controller or part of the physics system { isKinematicOriginalState = false; rb2D.isKinematic = true; } } storePosition = new Vector3(x, y, z); transformToMove.transform.position = storePosition; } } else // not dragging { if (rb2D != null) // this will only be set after a drag. { if (isKinematicOriginalState == false) { isKinematicOriginalState = true; rb2D.isKinematic = false; } } } // isPinching int isPinching = (int)msg.Data[3]; if (isPinchingEnabled == true) { if (isPinching == 1) { //isPinchingFlag = true; scale = (float)msg.Data[4]; //Debug.Log("isPinching = true; Scale = "+scale); storeScale = puppetBaseObject.transform.localScale; puppetBaseObject.transform.localScale = new Vector3(scale, scale, scale); } else //isPinchingFlag = false; { } } // isTwisting int isTwisting = (int)msg.Data[5]; if (isTwistingEnabled == true) { if (isTwisting == 1) { rotation = (float)msg.Data[6]; //Debug.Log("isTwisting = true;"+rotation); storeRotation = transformToMove.eulerAngles; transformToMove.eulerAngles = new Vector3(storeRotation.x, storeRotation.y, rotation); } } // isDoubleTapped int isDoubleTapped = (int)msg.Data[7]; if (isDoubleTappingEnabled == true) { if (isDoubleTapped == 1) { //Debug.Log("isDoubleTapped = true;"); // call a function //QuickPinch myPinch = (QuickPinch)transformToMove.gameObject.GetComponent(typeof(QuickPinch)); //Debug.Log(myPinch.quickActionName.ToString();) // hard code the feature you wish to enact on double tap if (puppetBaseObject.name == "PuppetRoot_IIM_Bird_Spring_Network_MT" || puppetBaseObject.name == "PuppetRoot_IIM_Bird_Spring_Network_MT_small") { Blink myBlink = (Blink)puppetBaseObject.GetComponent(typeof(Blink)); myBlink.SFX_ShortBlink(); } if (doubleTapToFlip == true) { FlipMe2D flipMe = (FlipMe2D)puppetBaseObject.GetComponent(typeof(FlipMe2D)); flipMe.FlipViaScaleForRemoteControl(puppetBaseObject); //Debug.Log("isDoubleTapped = true; In doubleTapToFlipClause"); } } } }
IEnumerator CheckTasks() { yield return(new WaitForSeconds(2f)); GameObject win = GameObject.Find("Distribution Window"); Destroy(win); Task[] tasks = taskCreator.tasks; SetWinNum(tasks.Length); District[] districts = distMan.districts; string winOrLose = ""; string goal = ""; int taskNum = 0; foreach (Task task in tasks) { District currDist = null; foreach (District district in districts) { if (district.name.Equals(task.GetDistrict(), StringComparison.InvariantCultureIgnoreCase)) { currDist = district; } } //print(task.GetDistrict() + " = " + currDist.name + "?"); //print(task.GetGoal() + " " + task.GetScore() + ", " + currDist.name + ": " + currDist.GetResource(task.GetResource())); //if (task.GetResource().Contains("Power")) { goal = task.GetGoal().Trim(); //print("(" + goal + ") equals 'Allocate'? " + (goal == "Allocate")); //print("(" + goal + ") equals 'Don't Allocate'? " + (goal == "Don't Allocate")); if (task.GetGoal().Equals("Don't Allocate")) { if (task.GetScore() >= currDist.GetResource(task.GetResource())) { winOrLose = "Win"; } else { winOrLose = "Lose"; } } else if (task.GetGoal().Equals("Allocate")) { if (task.GetScore() <= currDist.GetResource(task.GetResource())) { winOrLose = "Win"; } else { winOrLose = "Lose"; } } if (winOrLose.Equals("Win")) { Blink blink = GameObject.Find(currDist.name.ToUpper() + " Menu Bar Background").GetComponent <Blink>(); blink.BlinkWin(); if (!arbeauOff) { taskCreator.SpawnArbeauWinLose(taskNum, winOrLose); } } else if (winOrLose.Equals("Lose")) { foreach (District district in distMan.districts) { if (currDist.name.Equals(district.name, StringComparison.InvariantCultureIgnoreCase)) { if (district.GetUnrest() >= 5) { district.CloseDistrict(); //print(district.name + "is closed"); Blink blink = GameObject.Find(currDist.name.ToUpper() + " Menu Bar Background").GetComponent <Blink>(); blink.SetClose(); int closeIndex; closeMap.TryGetValue(currDist.name, out closeIndex); taskCreator.SpawnArbeauClose(closeIndex); closedCnt++; print("closedCnt: " + closedCnt); } else { Blink blink = GameObject.Find(currDist.name.ToUpper() + " Menu Bar Background").GetComponent <Blink>(); blink.BlinkLose(); if (!arbeauOff) { taskCreator.SpawnArbeauWinLose(taskNum, winOrLose); } } district.IncrementUnrest(); } } } winOrLose = ""; taskNum++; //} } //print("increment round"); round++; }
public virtual void Awake() { blink = GetComponent <Blink>(); }
private static void Game_OnUpdate(EventArgs args) { _me = ObjectManager.LocalHero; if (!Game.IsInGame || _me == null || _me.ClassID != ClassID.CDOTA_Unit_Hero_Lina) { return; } if (Game.IsPaused || Game.IsChatOpen) { return; } _menuValue = Menu.Item("enabledAbilities").GetValue <AbilityToggler>(); _slider = Menu.Item("distance").GetValue <Slider>().Value; Q = _me.Spellbook.Spell1; W = _me.Spellbook.Spell2; R = _me.Spellbook.Spell4; Dagon = _me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon")); Hex = _me.FindItem("item_sheepstick"); Ethereal = _me.FindItem("item_ethereal_blade"); Veil = _me.FindItem("item_veil_of_discord"); Orchid = _me.FindItem("item_orchid"); Shiva = _me.FindItem("item_shivas_guard"); Eul = _me.FindItem("item_cyclone"); Blink = _me.FindItem("item_blink"); if (!Game.IsKeyDown(Menu.Item("Cooombo").GetValue <KeyBind>().Key)) { _targetActive = false; return; } if (!_targetActive) { _target = _me.ClosestToMouseTarget(300); _targetActive = true; } else { var modifHex = _target.Modifiers.Where(y => y.Name == "modifier_sheepstick_debuff") .DefaultIfEmpty(null) .FirstOrDefault(); var modifEul = _target.Modifiers.Where(y => y.Name == "modifier_eul_cyclone").DefaultIfEmpty(null).FirstOrDefault(); if (_target == null || !_target.IsAlive || _target.IsIllusion || _target.IsMagicImmune()) { return; } if (Blink != null && Blink.CanBeCasted() && _me.Distance2D(_target) > _slider + 100 && _menuValue.IsEnabled("item_blink") && Utils.SleepCheck("blink")) { Blink.UseAbility(PositionCalc(_me, _target, _slider)); Utils.Sleep(150 + Game.Ping, "blink"); } else if (Eul != null && Eul.CanBeCasted() && Utils.SleepCheck("eul") && _menuValue.IsEnabled("item_cyclone") && Utils.SleepCheck("blink")) { Eul.UseAbility(_target); Utils.Sleep(4000 + Game.Ping, "eul"); } else if (Eul == null || Eul.Cooldown > 0 || !_menuValue.IsEnabled("item_cyclone")) { if (Orchid != null && Orchid.CanBeCasted() && Utils.SleepCheck("orchid") && modifEul == null && _menuValue.IsEnabled("item_orchid")) { Orchid.UseAbility(_target); Utils.Sleep(150 + Game.Ping, "orchid"); } else if (Shiva != null && Shiva.CanBeCasted() && Utils.SleepCheck("shiva") && modifEul == null && _menuValue.IsEnabled("item_shivas_guard")) { Shiva.UseAbility(); Utils.Sleep(150 + Game.Ping, "shiva"); } else if (Veil != null && Veil.CanBeCasted() && Utils.SleepCheck("veil") && modifEul == null && _menuValue.IsEnabled("item_veil_of_discord")) { Veil.UseAbility(_target.Position); Utils.Sleep(150 + Game.Ping, "veil"); } else if (Ethereal != null && Ethereal.CanBeCasted() && Utils.SleepCheck("ethereal") && modifEul == null && _menuValue.IsEnabled("item_ethereal_blade")) { Ethereal.UseAbility(_target); Utils.Sleep(150 + Game.Ping, "ethereal"); } else if (Dagon != null && Dagon.CanBeCasted() && Utils.SleepCheck("dagon") && modifEul == null) { Dagon.UseAbility(_target); Utils.Sleep(150 + Game.Ping, "dagon"); } else if (Hex != null && Hex.CanBeCasted() && Utils.SleepCheck("hex") && !_target.IsStunned() && Utils.SleepCheck("eul") && _menuValue.IsEnabled("item_sheepstick")) { Hex.UseAbility(_target); Utils.Sleep(150 + Game.Ping, "hex"); } else if (W != null && W.CanBeCasted() && Utils.SleepCheck("w") && (modifEul != null && modifEul.RemainingTime <= W.GetCastDelay(_me, _target, true) + 0.5 || modifHex != null && modifHex.RemainingTime <= W.GetCastDelay(_me, _target, true) + 0.5 || (Hex == null || !_menuValue.IsEnabled("item_sheepstick") || Hex.Cooldown > 0) && (Eul == null || !_menuValue.IsEnabled("item_cyclone") || Eul.Cooldown < 20 && Eul.Cooldown > 0))) { W.UseAbility(W.GetPrediction(_target, W.GetCastDelay(_me, _target))); Utils.Sleep(150 + Game.Ping, "w"); } else if (Q != null && Q.CanBeCasted() && Utils.SleepCheck("q") && modifEul == null) { Q.UseAbility(_target); Utils.Sleep(150 + Game.Ping, "q"); } else if (R != null && R.CanBeCasted() && Utils.SleepCheck("r") && modifEul == null) { R.UseAbility(_target); Utils.Sleep(150 + Game.Ping, "r"); } else if (!_me.IsChanneling() && NothingCanCast() && !_target.IsAttackImmune() && Utils.SleepCheck("attack")) { _me.Attack(_target); Utils.Sleep(1000 + Game.Ping, "attack"); } } } }
public override async Task ExecuteAsync(CancellationToken token) { if (TargetSelector.IsActive) { Target = TargetSelector.Active.GetTargets().FirstOrDefault(); } if (Target != null) { if (Output.Unit != null && Output.AoeTargetsHit.Count >= (Config.AmountItem.Value == 1 ? 0 : Config.AmountItem.Value) && (BlackHole == null || !BlackHole.Ability.IsChanneling)) { Elsecount = 0; // Blink if (Blink != null && BlackHole != null && BlackHole.IsReady && Owner.Distance2D(Output.CastPosition) <= Blink.CastRange + (Lens != null ? Lens.GetCastRange() : 0) && Config.ItemsToggler.Value.IsEnabled(Blink.Item.Name) && Blink.CanBeCasted && Owner.Distance2D(Output.CastPosition) >= 400) { Blink.UseAbility(Output.CastPosition); await Await.Delay(Blink.GetCastDelay(Target.Position), token); } if (Blink == null || !Blink.CanBeCasted || !Config.ItemsToggler.Value.IsEnabled(Blink.Item.Name) || Owner.Distance2D(Output.CastPosition) <= 400) { UseItem(token); } // BlackHole if (BlackHole != null && Config.AbilityToggler.Value.IsEnabled(BlackHole.Ability.Name) && BlackHole.CanBeCasted && Elsecount == 6) { BlackHole.UseAbility(Output.CastPosition); await Await.Delay(BlackHole.GetCastDelay(Output.CastPosition), token); } else { Elsecount += 1; } // Refresher if (Refresher != null && Config.ItemsToggler.Value.IsEnabled(Refresher.Item.Name) && Refresher.CanBeCasted && BlackHole != null && !BlackHole.CanBeCasted && !BlackHole.Ability.IsChanneling && Elsecount == 7) { Refresher.UseAbility(); await Await.Delay(Refresher.GetCastDelay(), token); } } if (Target.IsAttackImmune() || Target.IsInvulnerable() && (BlackHole == null || !BlackHole.Ability.IsChanneling)) { Orbwalker.Move(Game.MousePosition); } else if (BlackHole == null || !BlackHole.Ability.IsChanneling) { Orbwalker.OrbwalkTo(Target); } } else if (BlackHole == null || !BlackHole.Ability.IsChanneling) { Orbwalker.Move(Game.MousePosition); } }
public void ResolveRocketCollisionWithObstacle(Obstacle obstacle) { Blink.PlayInInstance(); }
public AwaitBlinkOrMove(Blink blink, AwaitMoveToTarget move) { this.blink = blink; this.move = move; }
public override void Show() { GUIStyle spellButton = new GUIStyle(); spellButton.fontSize = 17; spellButton.alignment = TextAnchor.UpperCenter; spellButton.normal.textColor = Color.black; width = 75; height = 75; offset = 15; textOffset = 12.5f; ShowButton(new Rect(offset, Screen.height - height, width, height), GameResources.Fireball, Fireball.Instance().Cooldown, Fireball.Instance().CooldownTimeElapsed, null, spellButton); ShowButton(new Rect(offset * 2 + width, Screen.height - height, width, height), GameResources.Blink, Blink.Instance().Cooldown, Blink.Instance().CooldownTimeElapsed, null, spellButton); ShowPreview("Character 1"); }
public AwaitBlinkOrMove(Hero me, Func <int> engageRange) { this.blink = new Blink(me, engageRange); this.move = new AwaitMoveToTarget(me, engageRange); }
private void UpdateManager_IngameUpdate() { var target = TargetSelector.CurrentTarget; if (target == null || !target.IsAlive || target.IsEnchanted()) { return; } if (!OrbWalkerSleeper.Sleeping) { OrbwalkerManager.OrbwalkTo(target, GameManager.MousePosition); OrbWalkerSleeper.Sleep(200); return; } if (AbilitySleeper.Sleeping || localHero.IsRooted()) { return; } var distanceToTarget = localHero.Distance2D(target); var blinkRange = Blink?.Range; //blink logic if (Blink != null && Blink.CanBeCasted()) { if (Roll.CanBeCasted() && blinkRange < distanceToTarget && blinkRange + Roll.Range > distanceToTarget && Blink.UseAbility(target)) { Stone.Sleeper.Sleep(300); Roll.Sleeper.Sleep(300); AbilitySleeper.Sleep(200); return; } if (!Roll.CanBeCasted() && distanceToTarget > blinkRange / 3 && distanceToTarget < blinkRange && Blink.UseAbility(target)) { Stone.Sleeper.Sleep(300); Roll.Sleeper.Sleep(300); AbilitySleeper.Sleep(200); return; } } if (VeilOfDiscord != null && VeilOfDiscord.UseAbility(target)) { AbilitySleeper.Sleep(100); return; } if (Hex != null && Hex.UseAbility(target)) { AbilitySleeper.Sleep(100); return; } if (Abyssal != null && Abyssal.UseAbility(target)) { AbilitySleeper.Sleep(100); return; } if (target.IsMagicImmune()) { return; } var firstStoneNearEnemy = StoneExtensions.FirstUnitInRange(target.Position, StoneExtensions.StoneName, 500); var firstStoneNearHero = StoneExtensions.FirstUnitInRange(localHero.Position, StoneExtensions.StoneName, 250); // roll logic if (Roll.CanBeCasted()) { var rudePredict = target.IsMoving ? target.InFront(150) : target.Position; var prediction = Smash.GetPrediction(target); var distToPredict = prediction.Distance2D(localHero.Position); if (firstStoneNearHero == null && firstStoneNearEnemy == null && !target.IsInvulnerable() && !context.AutoPushInTowerDirection.CanPushInTower && distToPredict < 600f && Grip.CanBeCasted() && Smash.CanBeCasted() && Stone.UseAbility(localHero.Position.Extend(rudePredict, 100))) { Blink?.Sleeper.Sleep(300); Grip.Sleeper.Sleep(distToPredict / Grip.Speed * 1000); Stone.Sleeper.Sleep(500); Roll.Sleeper.Sleep(300 + distToPredict / Grip.Speed * 1000); AbilitySleeper.Sleep(100); return; } var stoneBetween = StoneExtensions.FirstUnitBetween(localHero.Position, rudePredict, StoneExtensions.StoneName, 250, 350); if (firstStoneNearEnemy != null && firstStoneNearEnemy.Distance2D(localHero) < 1000f && stoneBetween == null && Grip.UseAbility(firstStoneNearEnemy.Position)) { Blink?.Sleeper.Sleep(300); AbilitySleeper.Sleep(100); return; } else if (firstStoneNearEnemy == null && distToPredict < 900f && !target.IsInvulnerable() && stoneBetween == null && !localHero.IsInRollPhase() && Grip.CanBeCasted() && Stone.UseAbility(rudePredict)) { Blink?.Sleeper.Sleep(300); Stone.Sleeper.Sleep(500); AbilitySleeper.Sleep(200); return; } if (!localHero.IsInRollPhase() && Roll.UseAbility(target)) { Smash.Sleeper.Sleep(1000); Blink?.Sleeper.Sleep(300); AbilitySleeper.Sleep(800); return; } } var intersectingStone = EntityManager.GetEntities <Unit>() .FirstOrDefault(x => x.Distance2D(target) < Grip.Range && x.Name == StoneExtensions.StoneName && x.IsAlive && StoneExtensions.FirstUnitBetween(localHero.Position, x.Position, target.Name, 200, Grip.Range) == target); if (intersectingStone != null && !target.IsInvulnerable() && Grip.UseAbility(intersectingStone.Position)) { Smash.Sleeper.Sleep(intersectingStone.Distance2D(localHero) / Grip.Speed * 1100); AbilitySleeper.Sleep(200); return; } if (Orchid != null && Orchid.UseAbility(target)) { AbilitySleeper.Sleep(100); return; } if (Halberd != null && Halberd.UseAbility(target)) { AbilitySleeper.Sleep(100); return; } if (Shivas != null && Shivas.UseAbility(target)) { AbilitySleeper.Sleep(100); return; } if (distanceToTarget < Smash.Range * 0.4f && !target.IsInvulnerable() && Smash.UseAbilityOnStone(target)) { AbilitySleeper.Sleep(200); return; } if (distanceToTarget < Smash.Range * 0.4f && !localHero.IsInRollPhase() && !target.IsInvulnerable() && Grip.CanBeCasted() && Smash.CanBeCasted() && Stone.UseAbility()) { Stone.Sleeper.Sleep(300); AbilitySleeper.Sleep(200); return; } if (distanceToTarget < Smash.Range * 0.4f && firstStoneNearHero == null && !target.IsInvulnerable() && (Grip.Base.Cooldown > Smash.Base.CooldownLength || (!Grip.CanBeCasted() && Grip.Base.Cooldown == 0)) && !localHero.IsInRollPhase() && Smash.CanBeCasted() && !context.AutoPushInTowerDirection.CanPushInTower && Stone.UseAbility()) { Stone.Sleeper.Sleep(300); AbilitySleeper.Sleep(100); return; } if (SpiritVessel != null && SpiritVessel.UseAbility(target)) { AbilitySleeper.Sleep(100); return; } }
public override async Task ExecuteAsync(CancellationToken token) { try { if (Config.Target.Value.SelectedValue.Contains("Lock") && Context.TargetSelector.IsActive && (!CanExecute || EnemyHero == null || !EnemyHero.IsValid || !EnemyHero.IsAlive)) { EnemyHero = Context.TargetSelector.Active.GetTargets().FirstOrDefault() as Hero; } else if (Config.Target.Value.SelectedValue.Contains("Default") && Context.TargetSelector.IsActive) { EnemyHero = Context.TargetSelector.Active.GetTargets().FirstOrDefault() as Hero; } var Silenced = UnitExtensions.IsSilenced(base.Owner); var SliderData = this.Config.UseBlink.Item.GetValue <Slider>().Value; var IsInvis = Ensage.SDK.Extensions.UnitExtensions.IsInvisible(this.Owner); var WAbiCasted = Ensage.SDK.Extensions.UnitExtensions.HasModifier(Owner, "modifier_dark_willow_shadow_realm_buff"); var QAbiTargets = EntityManager <Hero> .Entities.OrderBy(x => x == EnemyHero).Where(x => x.IsValid && x.IsVisible && x.Team != Owner.Team && !x.IsIllusion && !UnitExtensions.IsMagicImmune(x)).ToList(); if (EnemyHero != null && !EnemyHero.IsInvulnerable() && !UnitExtensions.IsMagicImmune(EnemyHero)) { if (this.QAbi.CanBeCasted && this.QAbi != null && !Silenced && this.Config.AbilityToggler.Value.IsEnabled(this.QAbi.Ability.Name) && this.QAbi.CanHit(EnemyHero) && !IsInvis) { QAbi.UseAbility(EnemyHero.Position); /// await Await.Delay(QAbi.GetCastDelay(EnemyHero.Position), token); await Await.Delay(this.GetAbilityDelay(this.Owner, QAbi), token); } if (!Silenced && this.EAbi != null && this.Config.AbilityToggler.Value.IsEnabled(this.EAbi.Ability.Name) && this.EAbi.CanBeCasted && !IsInvis && this.EAbi.CanHit(EnemyHero)) { this.EAbi.Ability.UseAbility(EnemyHero); await Await.Delay(this.GetAbilityDelay(this.Owner, EAbi), token); } if (!Silenced && this.DAbi != null && !IsInvis && this.Owner.IsInRange(EnemyHero, 300) && !IsInvis && this.DAbi.CanBeCasted && this.Config.AbilityToggler.Value.IsEnabled(this.DAbi.Ability.Name)) { this.DAbi.Ability.UseAbility(); await Await.Delay(this.GetAbilityDelay(this.Owner, DAbi), token); } // // // // // // if (this.Blink != null && this.Blink.CanBeCasted && Owner.Distance2D(EnemyHero) <= 1200 + SliderData && !IsInvis && !(this.Owner.Distance2D(EnemyHero) <= 400) && this.Config.ItemToggler2.Value.IsEnabled(this.Blink.Item.Name)) { var l = (this.Owner.Distance2D(EnemyHero) - SliderData) / SliderData; var posA = this.Owner.Position; var posB = EnemyHero.Position; var x = (posA.X + (l * posB.X)) / (1 + l); var y = (posA.Y + (l * posB.Y)) / (1 + l); var position = new Vector3((int)x, (int)y, posA.Z); this.Blink.UseAbility(position); await Await.Delay(Blink.GetCastDelay(position), token); } if (!UnitExtensions.IsMagicImmune(EnemyHero)) { if (this.BloodThorn != null && this.BloodThorn.CanBeCasted && !IsInvis && !this.Owner.IsAttacking() && this.Config.ItemToggler.Value.IsEnabled(this.BloodThorn.Item.Name)) { this.BloodThorn.UseAbility(EnemyHero); await Await.Delay(BloodThorn.GetCastDelay(EnemyHero), token); } if (this.Medalion1 != null && this.Medalion1.CanBeCasted && !IsInvis && this.Owner.IsInAttackRange(EnemyHero) && !this.Owner.IsAttacking() && this.Config.ItemToggler.Value.IsEnabled(this.Medalion1.Item.Name)) { this.Medalion1.UseAbility(EnemyHero); await Await.Delay(Medalion1.GetCastDelay(EnemyHero), token); } if (this.Medallion2 != null && this.Medallion2.CanBeCasted && !IsInvis && this.Owner.IsInAttackRange(EnemyHero) && !this.Owner.IsAttacking() && this.Config.ItemToggler.Value.IsEnabled(this.Medallion2.Item.Name)) { this.Medallion2.UseAbility(EnemyHero); await Await.Delay(Medallion2.GetCastDelay(EnemyHero), token); } if (this.SheepStick != null && this.SheepStick.CanBeCasted && !IsInvis && this.Config.ItemToggler.Value.IsEnabled(this.SheepStick.Item.Name)) { this.SheepStick.UseAbility(EnemyHero); await Await.Delay(SheepStick.GetCastDelay(EnemyHero), token); } if (this.Orchid != null && this.Orchid.CanBeCasted && !IsInvis && this.Config.ItemToggler.Value.IsEnabled(Orchid.Item.Name)) { this.Orchid.UseAbility(EnemyHero); await Await.Delay(Orchid.GetCastDelay(EnemyHero), token); } if (this.Mjollnir != null && this.Mjollnir.CanBeCasted && !IsInvis && this.Owner.IsInAttackRange(EnemyHero) && this.Config.ItemToggler2.Value.IsEnabled(Mjollnir.Item.Name)) { this.Mjollnir.UseAbility(this.Owner); await Await.Delay(Mjollnir.GetCastDelay(), token); } if (this.Veil_Of_Discord != null && this.Veil_Of_Discord.CanBeCasted && !IsInvis && this.Config.ItemToggler2.Value.IsEnabled(Veil_Of_Discord.Item.Name)) { this.Veil_Of_Discord.UseAbility(EnemyHero.Position); await Await.Delay(Veil_Of_Discord.GetCastDelay(), token); } if (this.Rod_Of_Atos != null && this.Rod_Of_Atos.CanBeCasted && !IsInvis && this.Config.ItemToggler2.Value.IsEnabled(Rod_Of_Atos.Item.Name)) { this.Rod_Of_Atos.UseAbility(EnemyHero); await Await.Delay(Rod_Of_Atos.GetCastDelay(), token); } } if (EnemyHero != null && (EnemyHero.IsInvulnerable() || UnitExtensions.IsAttackImmune(EnemyHero))) { Orbwalker.Move(Game.MousePosition); } else if (EnemyHero != null) { Orbwalker.OrbwalkTo(EnemyHero); } } else { Orbwalker.Move(Game.MousePosition); } } catch (TaskCanceledException) { // canceled } catch (Exception e) { Log.Error(e); } }
void OnStateChange() { currentStatus = appStatus.GetState(); string statusMessage; string mode_msg; switch (currentStatus) { case AppState.Status.ADJUST_ROTATIONY: statusMessage = "For best results, view the cube from every angle."; statusMessage = "A"; mode_msg = "Rotate Y Axis"; aText.text = "Confirm"; bText.text = "Reset"; moveControls.SetActive(true); upArrow.SetActive(false); downArrow.SetActive(false); rightArrow.SetActive(true); leftArrow.SetActive(true); if (!tipsSeen) { Blink.BlinkTwiceAsync(moveControls); tipsSeen = true; } break; case AppState.Status.ADJUST_Y: //statusMessage = "Rotate the target vertically"; statusMessage = "For best results, view the cube from every angle."; mode_msg = "Translate Height"; moveControls.SetActive(true); aText.text = "Place"; bText.text = "Reset"; moveControls.SetActive(true); upArrow.SetActive(true); downArrow.SetActive(true); rightArrow.SetActive(false); leftArrow.SetActive(false); break; case AppState.Status.ADJUST_X: //statusMessage = "Adjust the position of the target."; statusMessage = "For best results, view the cube from every angle."; mode_msg = "Translate X Axis"; moveControls.SetActive(true); aText.text = "Place"; bText.text = "Reset"; moveControls.SetActive(true); upArrow.SetActive(true); downArrow.SetActive(true); rightArrow.SetActive(true); leftArrow.SetActive(true); break; case AppState.Status.ADJUST_Z: //statusMessage = "Adjust the depth of the target."; statusMessage = "For best results, view the cube from every angle."; mode_msg = "Translate Z Axis "; moveControls.SetActive(true); aText.text = "Place"; bText.text = "Reset"; moveControls.SetActive(true); upArrow.SetActive(true); downArrow.SetActive(true); rightArrow.SetActive(false); leftArrow.SetActive(false); break; default: statusMessage = ""; mode_msg = ""; break; } statusMsg.text = statusMessage; mode.text = mode_msg; }
// Use this for initialization void Start() { blinker = GameObject.FindObjectOfType<Blink>(); }
/// <summary> /// Sets global blink mode /// </summary> /// <param name="blink">Choices are off, 1/2 Hz, 1 Hz or 2 Hz (2 Hz appears to do nothing currently)</param> public void SetBlink(Blink blink) { var blinkCommand = BLINK_CMD | BLINK_DISPLAY_ON | (int)blink; connection.Write((byte)blinkCommand); }
void FixedUpdate() { if (Game.State == GameState.GAME) { if (CurrentTime <= CastingTime) { CurrentTime += Time.deltaTime; } else { IsCasting = false; CurrentTime = 0; } Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit2D hit = Physics2D.Raycast(ray.origin, ray.direction, 200); if (hit) { MousePosition = new Vector3(hit.point.x, hit.point.y); } if (!Game.Rectangles[0].Contains(transform.position)) { Hp -= Time.deltaTime * 10; } for (int i = 0; i < Game.SpellList.Count; i++) { if (Game.SpellList[i].CooldownTimeElapsed < Game.SpellList[i].Cooldown) { Game.SpellList[i].CooldownTimeElapsed += Time.deltaTime; } } if (Hp <= 0) { Game.PlayerList.Remove(this); GameObject.Destroy(this.transform.gameObject); } if (IsControllable) { float x = 0; float y = 0; bool change = false; if (Input.GetKey(KeyCode.A)) { x -= Speed; change = true; } if (Input.GetKey(KeyCode.D)) { x += Speed; change = true; } if (Input.GetKey(KeyCode.W)) { y += Speed; change = true; } if (Input.GetKey(KeyCode.S)) { y -= Speed; change = true; } Direction = new Vector2(x, y); if (change) { this.rigidbody2D.velocity = Direction; Client.Send(Message.GetBytes(new Message(MESSAGE_TYPE.REQUEST_MOVE, Client.login, new object[] { Direction.x, Direction.y }))); } else { this.rigidbody2D.velocity = new Vector2(0, 0); } if (Input.GetKey(KeyCode.Z)) { CurrentSpell = Fireball.Instance(); if (CurrentSpell.CooldownTimeElapsed >= CurrentSpell.Cooldown) { Invoke("SpellCallback", CurrentSpell.Casttime); IsControllable = false; IsCasting = true; CurrentTime = 0; CastingTime = CurrentSpell.Casttime; this.rigidbody2D.velocity = new Vector2(0, 0); } else { CurrentSpell = null; } } if (Input.GetKey(KeyCode.X)) { CurrentSpell = Blink.Instance(); if (CurrentSpell.CooldownTimeElapsed >= CurrentSpell.Cooldown) { Invoke("SpellCallback", CurrentSpell.Casttime); this.rigidbody2D.velocity = new Vector2(0, 0); } else { CurrentSpell = null; } } } } }
private void Awake() { blink = GetComponent <Blink>(); animator = GetComponent <Animator>(); }
public void WeaponAttack() { if (spellSlot1rdy == true && player_.DieOnce == false) { switch (CurrentWeapon) { case 0: spellSlotCD = 0.5f; break; case 1: WeaponSpider spell = Weapons[CurrentWeapon].GetComponent <WeaponSpider>(); spellSlotCD = spell.cooldown; GameObject spider1 = Instantiate(spell.ItemObject, transform.position, transform.rotation, transform); GameObject spider2 = Instantiate(spell.ItemObject, transform.position, transform.rotation, transform); spider1.transform.position += spider1.transform.right * 2; spider2.transform.position += spider2.transform.right * -2; spider1.transform.parent = null; spider2.transform.parent = null; break; case 2: Blink spell2 = Weapons[CurrentWeapon].GetComponent <Blink>(); Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit) && hit.collider.gameObject.tag == "Floor" || hit.collider.gameObject.tag == "Monster" || hit.collider.gameObject.tag == "Token" || hit.collider.gameObject.tag == "Door") { TelePortDoor = false; Tele1Effect = Instantiate(TelePortEffect, Player1.transform.position, Player1.transform.rotation); Tele1Effect.transform.parent = Player1.transform; ParticleSystem Tele1Effect2 = Instantiate(TelePortEffect, hit.point, Player1.transform.rotation); TeleLoc = hit.point; Destroy(Tele1Effect.transform.gameObject, 3.1f); Destroy(Tele1Effect2.transform.gameObject, 3.1f); Invoke("TelePortPlayer", 1f); spellSlotCD = spell2.cooldown; } else { spellSlotCD = 0.5f; } break; case 3: Blink spell3 = Weapons[CurrentWeapon].GetComponent <Blink>(); Ray ray2 = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit2; if (Physics.Raycast(ray2, out hit2)) { // Code Here. Vector3 Pos = new Vector3(Player1.transform.position.x, 1.5f, Player1.transform.position.z); Player1.transform.LookAt(hit2.point); GameObject PoolObj = Instantiate(spell3.ItemObject, Pos + Player1.transform.forward * 4, transform.rotation, transform); PoolObj.transform.parent = null; PoolObj.transform.localScale = new Vector3(1, 1, 1); PoolObj.GetComponent <BigBoyFire>().PoolNumb = 10; PoolObj.GetComponent <BigBoyFire>().PlayerCasting = true; PoolObj.GetComponent <BigBoyFire>().duration = 3f; PoolObj.GetComponent <BigBoyFire>().damage = 1f; spellSlotCD = spell3.cooldown; } else { spellSlotCD = 0.5f; } break; case 4: Blink spell4 = Weapons[CurrentWeapon].GetComponent <Blink>(); // Code Here. float OrbFacing = transform.rotation.eulerAngles.x; float attackTimer = 0; for (int i = 0; i < 5; i++) { GameObject P1 = Instantiate(spell4.ItemObject, transform); player_.SpellsCastInThisRoom.Add(P1); P1.transform.Rotate(0, OrbFacing, 0); P1.transform.position = new Vector3(transform.position.x, 3, transform.position.z) + P1.transform.forward * 1.5f; P1.GetComponent <OldKingAttack3>().FloatUpTimer += attackTimer; P1.GetComponent <OldKingAttack3>().damage = 1; P1.GetComponent <OldKingAttack3>().PlayerCast = true; OrbFacing += 72; //360/5 attackTimer += 0.2f; } spellSlotCD = spell4.cooldown; break; case 5: Blink spell5 = Weapons[CurrentWeapon].GetComponent <Blink>(); player_.BlobWeaponEquppied = true; player_.W5.SetActive(true); player_.BlobWeaponObject = spell5.ItemObject; spellSlotCD = spell5.cooldown; break; case 6: Blink spell6 = Weapons[CurrentWeapon].GetComponent <Blink>(); player_.TimeStaffCDS(); player_.ResetCDVis(spell6.ItemObject); spellSlotCD = spell6.cooldown; break; case 7: Blink spell7 = Weapons[CurrentWeapon].GetComponent <Blink>(); Collider[] cols = Physics.OverlapSphere(transform.position, 35); bool AnySpells = false; foreach (Collider c in cols) { Monster e = c.GetComponent <Monster>(); if (e != null && e.tag == "Monster") { AnySpells = true; //Monster enemy = e.GetComponent<Monster>(); GameObject test123 = Instantiate(spell7.ItemObject, transform.position, transform.rotation, transform); SpellProjectile Frostmeteor = test123.GetComponent <SpellProjectile>(); Frostmeteor.projectilespeed = 30; Frostmeteor.damage = 1; Frostmeteor.FrostBoltSlow = true; Frostmeteor.SlowDuration = 3f; Frostmeteor.SlowPercent = 1.4f; Frostmeteor.aoeSizeMeteor = 3f; Frostmeteor.FrostStaff = true; Frostmeteor.spellCastLocation = e.transform.position; Frostmeteor.transform.position = new Vector3(transform.position.x, 20, transform.position.z); player_.SpellsCastInThisRoom.Add(test123); } } if (!AnySpells) { GameObject test12345 = Instantiate(spell7.ItemObject, transform.position, transform.rotation, transform); SpellProjectile Frostmeteor = test12345.GetComponent <SpellProjectile>(); Frostmeteor.projectilespeed = 15; Frostmeteor.damage = 1; Frostmeteor.FrostBoltSlow = true; Frostmeteor.SlowDuration = 3f; Frostmeteor.SlowPercent = 1.4f; Frostmeteor.aoeSizeMeteor = 3f; Frostmeteor.FrostStaff = true; Frostmeteor.spellCastLocation = transform.position; Frostmeteor.transform.position = new Vector3(transform.position.x, 20, transform.position.z); player_.SpellsCastInThisRoom.Add(test12345); } spellSlotCD = spell7.cooldown; break; case 8: Blink spell8 = Weapons[CurrentWeapon].GetComponent <Blink>(); GameObject test1234 = Instantiate(spell8.ItemObject, transform.position, transform.rotation, transform); test1234.transform.parent = null; Destroy(test1234, 1f); Collider[] cols2 = Physics.OverlapSphere(transform.position, 10); foreach (Collider c in cols2) { Monster e = c.GetComponent <Monster>(); if (e != null && e.tag == "Monster") { Monster enemy = e.GetComponent <Monster>(); enemy.Slow(true, 2, 1.25f); Vector3 directionF = (enemy.transform.position - transform.position).normalized; enemy.CancelInvoke("StopPush"); enemy.TakeDamage(1); enemy.pushDir = directionF; enemy.pushed = true; } } spellSlotCD = spell8.cooldown; break; case 9: // Blink spell9 = Weapons[CurrentWeapon].GetComponent<Blink>(); Spellbook SB_ = FindObjectOfType <Spellbook>(); CastSpell CS_ = FindObjectOfType <CastSpell>(); int curS = CastSpell.FindObjectOfType <CastSpell>().currentSlot; CS_.MadWeapon = true; SB_.LeveloneSpell(Random.Range(1, 4)); SB_.LeveltwoSpell(Random.Range(0, 4)); SB_.LevelthreeSpell(Random.Range(0, 5)); SB_.LevelfourSpell(Random.Range(0, 4)); SB_.LevelfiveSpell(Random.Range(0, 4)); SB_.LevelsixSpell(Random.Range(0, 6)); Ray ray3 = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit3; if (Physics.Raycast(ray3, out hit3)) { CS_.spellCastLocation = hit3.point; Vector3 targetPosition = hit3.point; Vector3 direction = (targetPosition - Player1.transform.position).normalized; Quaternion lookRotation = Quaternion.LookRotation(new Vector3(direction.x, 0, direction.z)); // flattens the vector3 Player1.transform.rotation = Quaternion.Slerp(transform.rotation, lookRotation, Time.deltaTime * 999f); } CS_.CastCurrentSpell(); CS_.MadWeapon = false; switch (curS) { case 1: SB_.SlotOne(); break; case 2: SB_.SlotTwo(); break; case 3: SB_.SlotThree(); break; } // spellSlotCD = spell9.cooldown; break; } CD1 = spellSlotCD; CD1_ = spellSlotCD; } }
protected void Awake() { animator = transform.FindChild("zombie").GetComponent <Animator>(); blink = transform.FindChild("zombie").GetComponent <Blink>(); }
public void FillStats() { Fireball.Instance().SetValues(); Blink.Instance().SetValues(); }