/// <summary> /// あたり判定 /// </summary> /// <param name="col"></param> private void OnCollisionEnter2D(Collision2D col) { if (!isDash) { return; } if (col.transform.tag == "Wall") { if (tag == "Boss") { mainCamera.SetShake(true, 0.0f); } if (isWall) { mainCamera.SetShake(true, 0.0f); GetComponent <Enemy>().Dead(); } } ///水晶に当たった場合の処理 if (col.transform.tag == "Attack") { Smash smash = FindObjectOfType <Smash>(); if (smash.IsAttack) { return; } var p = player.GetComponent <Player>(); p.SetBrown(); } }
void OnTriggerStay2D(Collider2D col) { //プレイヤーに攻撃されたらプレイヤーが向いてる方向に吹き飛ぶ if (col.transform.tag == "Attack") { Smash smash = FindObjectOfType <Smash>(); if (tag == "Enemy") { Shoot(); } smash.Hit(tag); } }
public AutoSave(Context context) : base(context) { smash = context.Combo.Smash; enchant = context.Combo.Enchant; minHpPercentForSave = rootMenu.CreateSlider("Min. HP% for save with enchant", 0, 0, 50) .SetTooltip("Uses enchant + smash for save") .SetAbilityImage(AbilityId.item_ultimate_scepter); myFountain = EntityManager.GetEntities <Unit>().FirstOrDefault(x => x.Name == fountainName && x.IsAlly(localHero)); }
/// <summary> /// あたり判定(トリガー) /// </summary> void OnTriggerEnter2D(Collider2D col) { //プレイヤーに攻撃されたらプレイヤーが向いてる方向に吹き飛ぶ if (col.transform.tag == "Attack") { Smash smash = FindObjectOfType <Smash>(); if (tag == "Boss") { Damage(smash); } smash.Hit(tag); } }
void Start() { Currentcheckpoint = PlayerPrefs.GetInt("CheckPoint"); player = GameObject.FindGameObjectWithTag("Player"); player.GetComponent <LifeSystem>().ActiveCamera = camCinemachineMain; camAudioSource = cam.GetComponent <AudioSource>(); lifeSystemScript = player.GetComponent <LifeSystem>(); animatorNamesScript = player.GetComponent <AnimatorNames>(); smashScript = player.GetComponent <Smash>(); powerScreenAnimator = powerScreen.GetComponent <Animator>(); inputManager = GameObject.Find("InputManager"); inputManagerScript = inputManager.GetComponent <InputManager>(); camCinemachineMainVirtualCamera = camCinemachineMain.GetComponent <CinemachineVirtualCamera>(); camCinemachineLock1VirtualCamera = camCinemachineLock1.GetComponent <CinemachineVirtualCamera>(); camCinemachineLock2VirtualCamera = camCinemachineLock2.GetComponent <CinemachineVirtualCamera>(); endGameScript = GetComponent <EndGame>(); backgroundParallax = background.GetComponent <Parallax>(); treesParallax = trees.GetComponent <Parallax>(); mixer.SetFloat("MasterVolume", PlayerPrefs.GetFloat("Volume") / volumeScale); if (PlayerPrefs.GetInt("CheckPoint") == 0) { player.transform.position = cp0.position; } else if (PlayerPrefs.GetInt("CheckPoint") == 1) { player.transform.position = cp1.position; UpgradePlayer(2); wallB11.SetActive(true); BossArmsDead = true; Destroy(boss1); camCinemachineMainVirtualCamera.Priority = cameraHighPrority; camCinemachineLock1VirtualCamera.Priority = cameraLowPriority; } else if (PlayerPrefs.GetInt("CheckPoint") == 2) { UpgradePlayer(3); player.transform.position = cp2.position; wallB21.SetActive(true); BossArmsDead = true; BossLegsDead = true; endGameScript.enabled = true; Destroy(boss1); Destroy(boss2); camCinemachineMainVirtualCamera.Priority = cameraHighPrority; camCinemachineLock1VirtualCamera.Priority = cameraLowPriority; camCinemachineLock2VirtualCamera.Priority = cameraLowPriority; EnableLegs(); } }
public Combo(Context context) { this.context = context; localHero = context.LocalHero; ComboItems = context.RootMenu.CreateItemToggler("Items", items) .SetTooltip("Select combo items"); Smash = new Smash(localHero.GetAbilityById(AbilityId.earth_spirit_boulder_smash)); Roll = new Roll(localHero.GetAbilityById(AbilityId.earth_spirit_rolling_boulder)); Grip = new Grip(localHero.GetAbilityById(AbilityId.earth_spirit_geomagnetic_grip)); Stone = new Stone(localHero.GetAbilityById(AbilityId.earth_spirit_stone_caller)); Enchant = new Enchant(localHero.GetAbilityById(AbilityId.earth_spirit_petrify)); Magnetize = new Magnetize(localHero.GetAbilityById(AbilityId.earth_spirit_magnetize)); }
void Start() { animatorComponent = GetComponent <Animator>(); inputs = GameObject.FindGameObjectWithTag("InputManager"); rb = GetComponent <Rigidbody2D>(); animatorNamesScript = GetComponent <AnimatorNames>(); dashScript = GetComponent <Dash>(); inhaleScript = GetComponent <Inhale>(); smashScript = GetComponent <Smash>(); inputsManagerScript = inputs.GetComponent <InputManager>(); areaEffectorInhale = inhaleZone.GetComponent <AreaEffector2D>(); StartCoroutine("GetKey"); }
public AutoPushInAlliesDirection(Context context) : base(context) { smash = context.Combo.Smash; enchant = context.Combo.Enchant; featureMenu = rootMenu.CreateMenu("Auto push under allies") .SetAbilityImage(AbilityId.earth_spirit_boulder_smash); modeSelector = featureMenu.CreateSelector("Mode", new string[3] { "Off", "On", "Also with agha" }) .SetTooltip("Auto use smash for push in allies"); minAllyHpPercent = featureMenu.CreateSlider("Min. ally hp %", 20, 0, 80); }
public AutoPushInTowerDirection(Context context) : base(context) { smash = context.Combo.Smash; enchant = context.Combo.Enchant; featureMenu = rootMenu.CreateMenu("Auto push under towers") .SetAbilityImage(AbilityId.earth_spirit_boulder_smash); modeSelector = featureMenu.CreateSelector("Mode", new string[3] { "Off", "On", "Also with agha" }) .SetTooltip("Auto use smash for push under tower"); additionalRange = featureMenu.CreateSlider("Additional range around tower", 0, -500, 1000); }
/// <summary> /// ダメージ /// </summary> /// <param name="damage"></param> private void Damage(Smash smash) { if (!smashGage.IsMax) { return; } //ダメージ int damage = smash.GetParam.power; hp = Mathf.Max(hp - damage, 0); isStan = true; if (hp <= 0) { hp = 0; mainCamera.Stop(); } }
// Use this for initialization void Start() { pieces = new List <GameObject>(); gp = GetComponent <GeneratePieces>(); showPoint = GetComponent <ShowPoint>(); smash = GetComponent <Smash>(); randomPoint = new RandomPoint(); voronoi = new VoronoiCell(); resetButton.onClick.AddListener(ResetGame); prompt.active = true; _broken = true; ResetGlass(); }
// Use this for initialization void Awake() { GameObject debugObj = FindObjectOfType <DebugCommand>().gameObject; GameObject stageObj = GameObject.FindGameObjectWithTag("Stage"); player = FindObjectOfType <Player>(); smash = FindObjectOfType <Smash>(); mainCamera = FindObjectOfType <MainCamera>(); if (stageObj == null) { Instantiate(stages[stageNum]); debugObj.SetActive(false); if (stageNum == 0) { player.enabled = true; smash.enabled = true; BGM.gameObject.SetActive(true); } } else { debugObj.SetActive(true); player.enabled = true; smash.enabled = true; } stopDelay = stopTime; if (stageNum >= 1 || stageObj != null) { mainCamera.followSpeed = 0.0f; mainCamera.gameObject.transform.position = new Vector3(0.0f, 0.0f, -10.0f); } warpZone = FindObjectOfType <SceneWarpZone>(); Time.timeScale = 1.0f; BGM.clip = se[stageNum]; SetStageRange(); }
public SmartSpells(Context context) : base(context) { stone = context.Combo.Stone; smash = context.Combo.Smash; roll = context.Combo.Roll; grip = context.Combo.Grip; stoneName = StoneExtensions.StoneName; var smartSpellsMenu = rootMenu.CreateMenu("Smart spells") .SetTooltip("Auto place stone when it is necessary"); smartSmash = smartSpellsMenu.CreateSwitcher("When using smash") .SetAbilityImage(AbilityId.earth_spirit_boulder_smash); smartRoll = smartSpellsMenu.CreateSwitcher("When using roll") .SetAbilityImage(AbilityId.earth_spirit_rolling_boulder); smartGrip = smartSpellsMenu.CreateSwitcher("When using grip") .SetAbilityImage(AbilityId.earth_spirit_geomagnetic_grip); }
public Ultimate(Context context) : base(context) { stone = context.Combo.Stone; magnetize = context.Combo.Magnetize; smash = context.Combo.Smash; grip = context.Combo.Grip; ultimateFeaturesMenu = rootMenu.CreateMenu("Ultimate") .SetTooltip("Ultimate features") .SetAbilityImage(AbilityId.earth_spirit_magnetize); autoUseMagnetize = ultimateFeaturesMenu.CreateSlider("Min. enemies for auto ultimate", 2, 0, 5) .SetTooltip("Set 0 for disable this feature"); extendMagnetizeTime = ultimateFeaturesMenu.CreateSwitcher("Extend magnetize debuff") .SetTooltip("Place stone for update magnetize"); minStones = ultimateFeaturesMenu.CreateSlider("Min stones for extend magnetize debuff", 2, 0, 5) .SetTooltip("If stones charges < this value then no stones will be placed"); minStones.IsHidden = true; }
/// <summary> /// あたり判定(トリガー) /// </summary> void OnTriggerEnter2D(Collider2D col) { //プレイヤーに攻撃されたらプレイヤーが向いてる方向に吹き飛ぶ if (col.transform.tag == "Attack") { Smash smash = FindObjectOfType <Smash>(); if (tag == "Enemy") { Shoot(); } smash.Hit(tag); } if (col.transform.tag == "Barrier" || col.transform.tag == "BarrierPoint") { if (col.transform.tag == "BarrierPoint") { Destroy(col.gameObject); } Dead(); } if (col.tag == "Wall") { Dead(); } if (col.tag == "Enemy") { if (!col.gameObject.GetComponent <Enemy>().IsStan) { col.GetComponent <Enemy>().ComboDead(); } } }
private void Awake() { instance = this; }
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; } }