public void OpenBossInfo(int bossId) { foreach (BossInfo bossInfo in BossesInfo) { if (bossInfo.bossId == bossId) { opennedBossInfo = bossInfo; infoPanel.SetActive(true); nameText.text = bossInfo.bossName; tipText.GetComponent <TextMeshProUGUI>().text = bossInfo.tipText; sceneToChangeName = bossInfo.sceneName; if (bossInfo.debuf1InfoText != "") { debuff1.SetActive(true); debuf1InfoText.text = bossInfo.debuf1InfoText; image1.sprite = sprites[bossId]; } else { debuff1.SetActive(false); } if (bossInfo.debuf2InfoText != "") { debuff2.SetActive(true); debuf2InfoText.text = bossInfo.debuf2InfoText; image2.sprite = sprites[bossId + 1]; } else { debuff2.SetActive(false); } } } }
void Init() { GameManager.Instance.bossType = eBossType.BossC; switch (GameManager.Instance.bossType) { case eBossType.BossA: bossHp = arrBossHp [0]; break; case eBossType.BossB: bossHp = arrBossHp[1]; break; case eBossType.BossC: bossHp = arrBossHp[2]; break; } uiManager.SetMaxSliderBossHP(bossHp); bossInfo = GameObject.FindGameObjectWithTag("Boss").GetComponent <BossInfo>(); bossInfo.hp = bossHp; leftTime = maxTimeLimit; uiManager.SetMaxSliderLimitTime(maxTimeLimit); isTimeLimitUpdating = false; playState = PlayState.Init; }
public UIBossCheckbox(BossInfo boss) { this.boss = boss; Width = StyleDimension.Fill; Height.Pixels = 15; checkbox = new UICheckbox(boss.progression, boss.name, 1f, false); if (boss.type == EntryType.Event) { checkbox.TextColor = Color.MediumPurple; } if (boss.type == EntryType.MiniBoss) { checkbox.TextColor = Color.CornflowerBlue; } if (boss.hidden) { checkbox.TextColor = Color.DarkGreen; } checkbox.Selected = boss.downed(); //checkbox.spawnItemID = boss.spawnItemID; Append(checkbox); moreInfo = new UIHoverImageButton(ModContent.GetTexture("BossChecklist/UIElements/info"), "More Info"); moreInfo.Left.Set(-24, 1f); moreInfo.SetVisibility(1f, 0.7f); moreInfo.OnClick += MoreInfo_OnClick; int index = BossChecklist.bossTracker.SortedBosses.IndexOf(boss); moreInfo.Id = index.ToString(); OnClick += Box_OnClick; }
// Use this for initialization void Start() { bossInfo = GetComponent <BossInfo>(); //bossInfo.HitByObjectsOfType ="None"; //bossInfo.rageIncreaseSpeed = 0.5f; //bossInfo.rageByObjectCoefficient = -1; }
public void DisPlay() { BossInfo temp = EiderToolPage.Instance.SongObject.BossInfos; m_StartTime.text = temp.StartTime.ToString(); m_DelayTime.text = temp.DelayTime.ToString(); int tempCount = temp.BossLineObject.Count; m_Scroll.content.GetComponent <RectTransform>().sizeDelta = new Vector2(m_Scroll.content.GetComponent <RectTransform>().sizeDelta.x, 110 * (tempCount + 1)); if (m_BossLine.Count > temp.BossLineObject.Count) { for (int i = m_BossLine.Count - 1; i >= temp.BossLineObject.Count; i--) { Destroy(m_BossLine[i]); m_BossLine.RemoveAt(i); } } else { for (int i = m_BossLine.Count; i < temp.BossLineObject.Count; i++) { GameObject newLine = Instantiate(m_LineItem) as GameObject; newLine.GetComponentInChildren <Text>().text = (i + 1).ToString(); newLine.transform.SetParent(m_Scroll.content); newLine.SetActive(true); newLine.transform.localScale = Vector3.one; newLine.transform.localPosition = new Vector3(750, 50 - 110 * (i + 2), 0); m_BossLine.Add(newLine); } } }
void m_ShowIntro(BossInfo info) { canSkip = false; bossName.text = info.bossName; bossFightImage.sprite = info.bossFightImage; gameObject.SetActive(true); StartCoroutine(WaitAndEnableSkip()); }
void Start() { stunned = false; bossInfo = Boss.GetComponent <BossInfo>(); anim = GetComponentInChildren <Animator>(); vert = GetComponent <ControllerVerticalMove>(); rb = GetComponent <Rigidbody2D>(); }
void Awake() { playerController = FindObjectOfType <PlayerController> (); bossInfo = FindObjectOfType <BossInfo> (); numberOfPassedLevel = 0; currentDifficult = 1; }
void Awake() { //Boss id co 2, bo dwie ikony debufu BossInfo boss1 = new BossInfo(0, "Wolf", "", "", "If you lose, better go afk for this fight.", "Boss1"); BossInfo boss2 = new BossInfo(2, "Goblin", "", "", "Flash Heal - your main single target heal.", "Boss2"); BossInfo boss3 = new BossInfo(4, "Troll", "", "", "Use renew on tanks.", "Boss3"); BossInfo boss4 = new BossInfo(6, "Gnoll", "", "", "You dont need heal all time, try safe your mana.", "Boss3.1"); BossInfo boss5 = new BossInfo(8, "Harpie", "", "", "Heal have higher cast time than Flash Heal, but is more effective.", "Boss4"); BossInfo boss6 = new BossInfo(10, "Harpie Queen", "", "", "Prayer of Healing is your main AoE heal.", "Boss5"); BossInfo boss7 = new BossInfo(12, "Murlocs", "", "", "Tanks have a lot of stamina and armor, their main aim is keep agro.", "Boss5.1"); BossInfo boss8 = new BossInfo(14, "Murlocs", "", "", "Healer and Dps get more damage than tanks.", "Boss5.2"); BossInfo boss9 = new BossInfo(16, "Murloc King", "", "", "Healers in your group help you heal raid.", "Boss5.3"); BossInfo boss10 = new BossInfo(18, "Assasin Troll", "Bleed - deal damage over time.", "", "Try to keep alive tanks, you need them.", "Boss6"); BossInfo boss11 = new BossInfo(20, "Hunter Troll", "Poison - deal damage over time.", "", "You need to learn your spells for better heal your group.", "Boss6.1"); BossInfo boss12 = new BossInfo(22, "Berserker Troll", "", "", "Before start fight, read boss abilites, not all debuffs you need to dispel.", "Boss6.2"); BossInfo boss13 = new BossInfo(24, "Vodo Troll", "Dark Bomb - deal huge damage if not dispeled.", "", "Don't wait too long with your highest cooldown spless, better use it multiple times.", "Boss6.3"); BossInfo boss14 = new BossInfo(26, "Ranger Troll", "Poison - deal damage over time.", "", "Try to not overheall raid.", "Boss6.4"); BossInfo boss15 = new BossInfo(28, "King Troll", "Endless Power - give awesome buff to stats.", "", "Use renew on tanks.", "Boss6.5"); BossInfo boss16 = new BossInfo(30, "Hunter Gnoll", "", "", "You dont need heal all time, try safe your mana.", "Boss7"); BossInfo boss17 = new BossInfo(32, "Rogue Gnoll", "Toxic - deal damage over time.", "", "Flash Heal - your main single target heal.", "Boss7.1"); BossInfo boss18 = new BossInfo(34, "Assasin Gnoll", "Bleed - deal damage over time.", "", "Prayer of Healing is your main AoE heal.", "Boss7.2"); BossInfo boss19 = new BossInfo(36, "Kobold", "CandleFire - deal huge damage if not dispelled.", "", "Healers in your group help you heal raid.", "Boss7.3"); BossInfo boss20 = new BossInfo(38, "Skeleton", "", "", "Tanks have a lot of stamina and armor, their main aim is keep agro.", "Boss8"); BossInfo boss21 = new BossInfo(40, "Zombie", "", "", "Healer and Dps get more damage than tanks.", "Boss8.1"); BossInfo boss22 = new BossInfo(42, "Ghost", "", "", "Try to keep alive tanks, you need them.", "Boss8.2"); BossInfo boss23 = new BossInfo(44, "Abonimation", "Plague - deal damage over time.", "", "Try to not overheall raid.", "Boss8.3"); BossInfo boss24 = new BossInfo(46, "Vampir", "Bleed - deal damage over time.", "", "Before start fight, read boss abilites.", "Boss8.4"); BossInfo boss25 = new BossInfo(48, "Lich", "Frozen Tomb - kill target if not dispelled.", "", "Don't wait too long with your highest cooldown spless, better use it multiple times.", "Boss8.5"); BossInfo boss26 = new BossInfo(50, "Nathrezim", "Plague - deal damage over time.", "Mind Blast - kill target if not dispelled.", "Use holy Words on cooldown.", "Boss9"); BossesInfo.Add(boss1); BossesInfo.Add(boss2); BossesInfo.Add(boss3); BossesInfo.Add(boss4); BossesInfo.Add(boss5); BossesInfo.Add(boss6); BossesInfo.Add(boss7); BossesInfo.Add(boss8); BossesInfo.Add(boss9); BossesInfo.Add(boss10); BossesInfo.Add(boss11); BossesInfo.Add(boss12); BossesInfo.Add(boss13); BossesInfo.Add(boss14); BossesInfo.Add(boss15); BossesInfo.Add(boss16); BossesInfo.Add(boss17); BossesInfo.Add(boss18); BossesInfo.Add(boss19); BossesInfo.Add(boss20); BossesInfo.Add(boss21); BossesInfo.Add(boss22); BossesInfo.Add(boss23); BossesInfo.Add(boss24); BossesInfo.Add(boss25); BossesInfo.Add(boss26); }
//Load boss info void Load() { BossInfo bossIfo = EnemyCommander.EnemyCommanderInstance.bossInfo; MachineGunFireRate = bossIfo.MachineGunFireRate; CentralGunFireRate = bossIfo.CentralGunFireRate; SpreadingGunFireRate = bossIfo.SpreadingGunFireRate; health = bossIfo.health; speed = bossIfo.speed; }
public Transform userPos; //outboundary로 부터 입력됨. void OnEnable() { HPGauge = transform.GetChild(3).GetChild(0).GetChild(0).gameObject.GetComponent <RectTransform> (); BossInfo bossInfo = GameObject.FindGameObjectWithTag("BossInfo").GetComponent <BossInfo>(); this.bossInfo = bossInfo; defaultX = transform.position.x - bossInfo.transform.position.x; bossInfo.delegateSyncBossHealthBar += SyncBossHealthInfo; bossInfo.health = bossInfo.maxHealth; }
//Boss public void DoBossDamage() { BossInfo bInfo = GetComponentInParent <BossInfo>(); float randomSide = Random.Range(0, 2); Collider[] c = Physics.OverlapSphere(bInfo.actualRayStart, bInfo.attackRange * 2, bInfo.targetMask); for (int i = 0; i < c.Length; i++) { if (c[i].transform.tag == "Player") { PlayerMovement pMove = c[i].GetComponent <PlayerMovement>(); if (GameManager.gameTime == 0) { bInfo.orb.StopCoroutine(bInfo.orb.SizeIncrease()); bInfo.orb.StartCoroutine(bInfo.orb.SizeDecrease()); bInfo.agent.speed /= bInfo.speedMultiplier; bInfo.reset = true; bInfo.drainChase = false; bInfo.curBossState = BossState.Return; bInfo.orb.HoldDamage(bInfo.damage); bInfo.orb.HoldUpforce(transform.up, bossUpForce); if (randomSide == 0) { bInfo.orb.HoldForce(transform.right, bossForce); } else { bInfo.orb.HoldForce(-transform.right, bossForce); } } else { pMove.DoDamage(bInfo.damage); pMove.AddForceToPlayer(transform.up, bossUpForce); if (randomSide == 0) { pMove.AddForceToPlayer(transform.right, bossForce); } else { pMove.AddForceToPlayer(-transform.right, bossForce); } bInfo.CheckCharge(); } pMove.attackHit = true; break; } } if (c.Length == 0) { bInfo.Invoke("HitStun", 0f); } }
public void Load(byte[] bytes) { BinaryHelper helper = new BinaryHelper(bytes); int length = helper.ReadInt(); BossInfoList = new List <BossInfo>(length); for (int index = 0; index < length; ++index) { BossInfo info = new BossInfo(); info.Load(helper); BossInfoList.Add(info); } }
// Fill the dropdown with from our BossInfoDictionary and set the value to the first item in the list private void FillBossDropdown() { thisDropdown.ClearOptions(); Debug.Log("Adding boss names to dropdown"); thisDropdown.AddOptions(DataController.Instance.bossInfoDictionary.GetBossNames()); if (ProgramState.CurrentState == ProgramState.states.Loading) { BossInfo currentBoss = DataController.Instance.bossInfoDictionary.GetBossByName(thisDropdown.options[0].text); CacheManager.currentBoss = currentBoss; CacheManager.SetupTab.CurrentSubBossList = currentBoss.combatData; } }
private void Start() { fadeScreen.GetComponent <Animator>().Play("FadeIn"); if (tutorial.activeSelf == false) { tutorial.SetActive(true); } p = GameManager.instance.pillarMan; playerAbilities = GameManager.instance.player.GetComponent <AbilityBase>(); bInfo = GameManager.instance.bInfo; for (int i = 0; i < p.pylons.Count; i++) { pylonsChargeText[i].text = "Remaining: " + Mathf.Round(p.pylons[i].chargeTimer).ToString() + " / " + p.pylons[i].chargeTimerMax.ToString(); } }
//Get Based enemy info void GetEnemyInfo() { //Debug.Log("Enemy info loading"); string json; EnemyInfo ob; foreach (string f in EnemyType) { json = File.ReadAllText(Application.persistentDataPath + "/" + f + ".json"); ob = JsonUtility.FromJson <EnemyInfo>(json); EDictionary.Add(f, ob); } json = File.ReadAllText(Application.persistentDataPath + "/Boss1.json"); bossInfo = JsonUtility.FromJson <BossInfo>(json); //Debug.Log(json); }
void m_ShowIntro(BossInfo info) { canSkip = false; bossName.text = info.bossName; bossFightImage.sprite = info.bossFightImage; if (!string.IsNullOrEmpty(info.playerName)) { playerName.text = info.playerName; } else { playerName.text = defaultPlayerName; } gameObject.SetActive(true); GlobalController.pc.EnterCutscene(); StartCoroutine(WaitAndEnableSkip()); }
public DGSerControllerImpl() { ChannelFactory <IDGDataController> DGData; NetTcpBinding tcpBinding = new NetTcpBinding(); //release the limitation of the size of message which can be sent tcpBinding.MaxReceivedMessageSize = System.Int32.MaxValue; tcpBinding.ReaderQuotas.MaxArrayLength = System.Int32.MaxValue; try { //connect to Data Tier DGData = new ChannelFactory <IDGDataController>(tcpBinding, "net.tcp://localhost:50001/DGData"); m_DGData = DGData.CreateChannel(); } catch (CommunicationObjectFaultedException ex) { Console.WriteLine(ex.Message); } catch (Exception e) { Console.WriteLine("From DGSerControllerImpl.cs > DGSerControllerImpl\n" + e.Message); } calculation = new Calculation(); heroInfoList = new List <String>(); heroNameList = new List <String>(); try { heroInfo = m_DGData.GetHeroInfo(); bossInfo = m_DGData.GetBossInfo(); buildHeroInfoList(); initServer(); } catch (Exception e) { Console.WriteLine("From DGSerControllerImpl.cs > DGSerControllerImpl\n" + e.Message); } Console.WriteLine("Server1 Object Created"); }
private void DoorAndKeyCheck() // Checks if boss key has been aquired and whether { BossInfo bossInfo = BossManager.instance.GetBossInfo(bossName); // Find the boss attached to this area in the Boss Manager if (bossInfo == null) { return; // If the boss is not found, it does nothing } if (bossInfo.keyAquired) { Destroy(key.gameObject); door.LockDoor(false); } if (bossInfo.doorUnlocked) { door.OnDoorCheck -= DoorCheck; door.LockDoor(false); door.transform.DOMoveY(transform.position.y + 4, 1f); } //if (door != null) door.LockDoor(bossInfo.doorUnlocked); }
// Use this for initialization void Start() { bossInfo = GetComponent <BossInfo>(); //StartCoroutine(IncreaseRage()); }
public void WriteSongtoTxt(SongTxtObject songInfo) { m_filePath = Application.dataPath + filePath; m_fileName = m_filePath + "/" + songInfo.SongInfos.SongName + ".txt"; LogManager.Log(m_fileName); if (!Directory.Exists(m_filePath)) { Directory.CreateDirectory(m_filePath); } FileStream fs; StreamWriter sw; if (File.Exists(m_fileName)) { fs = new FileStream(m_fileName, FileMode.Create, FileAccess.Write); } else { fs = new FileStream(m_fileName, FileMode.Create, FileAccess.Write); } sw = new StreamWriter(fs); sw.WriteLine("[General]"); sw.WriteLine("AudioFileName:" + songInfo.SongInfos.AudioFileName + ".mp3"); sw.WriteLine("BPM:" + songInfo.SongInfos.BPM); sw.WriteLine("[HitObjects]"); if (songInfo.HitInfos.Count > 0 && songInfo.BossInfos.IsBoss == false) { for (int i = 0; i < songInfo.HitInfos.Count; i++) { float x = (songInfo.HitInfos[i].Position[0] + 700) * 512f / 1400f; float y = (525 - songInfo.HitInfos[i].Position[1]) * 512f / 1400f; if (songInfo.HitInfos[i].Type == SentenceInfo.SentenceType.SoundNode) { sw.WriteLine((int)x + "," + (int)y + "," + (songInfo.HitInfos[i].StartHitTime + songInfo.HitInfos[i].EndHitTime) / 2 + ",1,0,0:0:0:0:"); } else { sw.WriteLine((int)x + "," + (int)y + "," + songInfo.HitInfos[i].HitTime + ",1,0,0:0:0:0:"); } } sw.WriteLine("[SentenceInfo]"); int startTime = songInfo.HitInfos[0].StartHitTime; int endTime = songInfo.HitInfos[0].EndHitTime; string soundText = ""; string clickText = songInfo.HitInfos[0].ClickText; if (songInfo.HitInfos[0].Type == SentenceInfo.SentenceType.SoundNode) { soundText = "#" + songInfo.HitInfos[0].SoundText; } else { soundText = songInfo.HitInfos[0].SoundText; } for (int i = 1; i < songInfo.HitInfos.Count; i++) { if (songInfo.HitInfos[i].StartHitTime == startTime) { if (!string.IsNullOrEmpty(songInfo.HitInfos[i].SoundText) && !string.IsNullOrEmpty(songInfo.HitInfos[i].ClickText)) { soundText = soundText + "$" + songInfo.HitInfos[i].SoundText; clickText = clickText + "$" + songInfo.HitInfos[i].ClickText; } } else { if (string.IsNullOrEmpty(soundText) == false && string.IsNullOrEmpty(clickText) == false) { sw.WriteLine(startTime + "," + endTime + "," + soundText + "," + clickText); } startTime = songInfo.HitInfos[i].StartHitTime; endTime = songInfo.HitInfos[i].EndHitTime; clickText = songInfo.HitInfos[i].ClickText; if (songInfo.HitInfos[i].Type == SentenceInfo.SentenceType.SoundNode) { soundText = "#" + songInfo.HitInfos[i].SoundText; } else { soundText = songInfo.HitInfos[i].SoundText; } } } if (string.IsNullOrEmpty(soundText) == false && string.IsNullOrEmpty(clickText) == false) { sw.WriteLine(startTime + "," + endTime + "," + soundText + "," + clickText); } } else { sw.WriteLine("[SentenceInfo]"); } BossInfo tempBoss = songInfo.BossInfos; if (tempBoss.BossLineObject.Count > 0) { if (tempBoss.IsBoss) { sw.WriteLine("@@" + tempBoss.StartTime + "," + tempBoss.DelayTime); for (int i = 0; i < tempBoss.BossLineObject.Count; i++) { BossLineInfo tempLine = tempBoss.BossLineObject[i]; string isEnd = ""; if (tempLine.IsEnd == true) { isEnd = "BB"; } if (tempLine.Type == SentenceInfo.SentenceType.SoundNode) { sw.WriteLine(tempLine.KeepTimeLength + ",#" + tempLine.SoundText + "," + tempLine.ClickText + "," + tempLine.MusicFileName + "," + isEnd); } else { sw.WriteLine(tempLine.KeepTimeLength + "," + tempLine.SoundText + "," + tempLine.ClickText + "," + tempLine.MusicFileName + "," + isEnd); } } } else { sw.WriteLine("@@VoiceStart," + tempBoss.DelayTime); for (int i = 0; i < tempBoss.BossLineObject.Count; i++) { BossLineInfo tempLine = tempBoss.BossLineObject[i]; if (tempLine.Type == SentenceInfo.SentenceType.SoundNode) { sw.WriteLine(tempLine.KeepTimeLength + ",#" + tempLine.SoundText + "," + tempLine.ClickText + "," + tempLine.MusicFileName); } else { sw.WriteLine(tempLine.KeepTimeLength + "," + tempLine.SoundText + "," + tempLine.ClickText + "," + tempLine.MusicFileName); } } } } sw.Close(); fs.Close(); }
// Use this for initialization void Start() { bossVerticalMove = GetComponentInParent <BossVerticalMove>(); bossInfo = GetComponent <BossInfo>(); }
public MinionInfo(BossInfo _bossInfo) { bossInfo = _bossInfo; }
// Use this for initialization void Start() { bossInfo = GetComponent <BossInfo>(); //bossInfo.rageCoefficient = 3; //bossInfo.bonusCoefficient = 2; }
/// <summary> /// Coroutine logic to execute. /// </summary> /// <param name="type">The requested type of logic to execute.</param> /// <param name="param">Data sent to the object from the caller.</param> /// <returns>true if logic was executed to handle this type and false otherwise.</returns> public async Task <bool> Logic(string type, params dynamic[] param) { if (!LokiPoe.IsInGame || LokiPoe.Me.IsDead || LokiPoe.Me.IsInTown || LokiPoe.Me.IsInHideout) { return(false); } if ((!DangerDodgerSettings.Instance.DodgeExplodingBeacons || beaconStopwatch.ElapsedMilliseconds < BEACON_COOLDOWN) && (!DangerDodgerSettings.Instance.DodgeBonespire || bonespireStopwatch.ElapsedMilliseconds < BONESPIRE_COOLDOWN) && (!DangerDodgerSettings.Instance.DodgeSuicideExplosion || suicideStopwatch.ElapsedMilliseconds < SUICIDE_COOLDOWN) && (!bossesToDodge.Any() || bossDetectionStopwatch.ElapsedMilliseconds < BOSS_DETECTION_COOLDOWN) && ((!DangerDodgerSettings.Instance.DodgeUniqueMonsters && !DangerDodgerSettings.Instance.DodgeRareMonsters && !DangerDodgerSettings.Instance.DodgeMonsterPacks) || monsterStopwatch.ElapsedMilliseconds < DangerDodgerSettings.Instance.MonsterCooldown)) { return(false); } IEnumerable <CachedNetworkObject> surroundingObjects; IEnumerable <CachedMonster> surroundingMonsters; //caching monster to avoid exceptions. lock (LokiPoe.ObjectManager.Objects) { surroundingObjects = LokiPoe.ObjectManager.Objects .Where(o => o.Distance <= SCAN_RADIUS) .OrderBy(m => m.Distance) .Select(o => new CachedNetworkObject() { Name = o.Name, Distance = o.Distance, Position = new Vector2i(o.Position.X, o.Position.Y) }); surroundingMonsters = LokiPoe.ObjectManager.GetObjectsByType <Monster>() .Where(m => m.Distance <= SCAN_RADIUS && m.IsHostile && !m.IsDead) .OrderBy(m => m.Distance) .Select(m => new CachedMonster() { Name = m.Name, Distance = m.Distance, Position = new Vector2i(m.Position.X, m.Position.Y), Rarity = m.Rarity, MonsterTypeMetadata = m.MonsterTypeMetadata, currentSkillName = (m.CurrentAction == null) ? "" : (m.CurrentAction.Skill == null) ? "" : m.CurrentAction.Skill.Name, currentSkillDestination = (m.CurrentAction == null) ? new Vector2i() : m.CurrentAction.Destination, hasAuraMonsterCannotDie = m.HasAura("monster_aura_cannot_die"), hasSkillSuicideExplosion = m.AvailableSkills.Any(s => s.Name == "suicide_explosion") }); } //Handle exploding beacons if (DangerDodgerSettings.Instance.DodgeExplodingBeacons && beaconStopwatch.ElapsedMilliseconds >= BEACON_COOLDOWN) { var dangerousObjects = surroundingObjects.Where(o => o.Name.Contains("Metadata/Effects/Spells/monsters_effects/elemental_beacon")); await PerformKiting(dangerousObjects, dangerousObjects.FirstOrDefault(), BEACON_RADIUS, beaconStopwatch); } //Handle bonespires's spikes if (DangerDodgerSettings.Instance.DodgeBonespire && bonespireStopwatch.ElapsedMilliseconds >= BONESPIRE_COOLDOWN) {//TODO: Change logic to make the bot kite "forward". We need to get away from the bonespire, but keep close to the monster casting them. var dangerousObjects = surroundingMonsters.Where(m => m.MonsterTypeMetadata == "Metadata/Monsters/Daemon/TalismanT1Bonespire"); await PerformKiting(dangerousObjects, dangerousObjects.FirstOrDefault(), BONESPIRE_RADIUS, bonespireStopwatch); } //Handle suicide explosions if (DangerDodgerSettings.Instance.DodgeSuicideExplosion && suicideStopwatch.ElapsedMilliseconds >= SUICIDE_COOLDOWN) { var dangerousObjects = surroundingMonsters.Where(m => m.hasSkillSuicideExplosion); await PerformKiting(dangerousObjects, dangerousObjects.FirstOrDefault(m => m.currentSkillName == "suicide_explosion"), SUICIDE_RADIUS, suicideStopwatch); } //Handle boss attack dodging if (false && bossDetectionStopwatch.ElapsedMilliseconds >= BOSS_DETECTION_COOLDOWN) { bool detectedBoss = false; foreach (CachedMonster monster in surroundingMonsters.Where(m => m.Rarity == Rarity.Unique)) { BossInfo correspondingBoss = bossesToDodge.FirstOrDefault(b => b.Name == monster.Name); if (correspondingBoss != null) { if (correspondingBoss.Attacks.Select(a => a.Name).Contains(monster.currentSkillName)) { return(false); } detectedBoss = true; } } if (!detectedBoss) { bossDetectionStopwatch.Restart(); } } //return if a monster with the immortal aura is nearby. We don't want to run away from such monsters. if (surroundingMonsters.Any(m => m.hasAuraMonsterCannotDie)) { return(false);//TODO: Add logic to move towards this monster? } //Handle monster kiting if (monsterStopwatch.ElapsedMilliseconds >= DangerDodgerSettings.Instance.MonsterCooldown) { monsterStopwatch.Restart(); if (DangerDodgerSettings.Instance.DodgeUniqueMonsters && await PerformKiting(surroundingMonsters, surroundingMonsters.FirstOrDefault(m => m.Rarity == Rarity.Unique && !m.Name.Contains("Tormented")), DangerDodgerSettings.Instance.MonsterDangerRadius)) { return(false); } if (DangerDodgerSettings.Instance.DodgeRareMonsters && await PerformKiting(surroundingMonsters, surroundingMonsters.FirstOrDefault(m => m.Rarity == Rarity.Rare), DangerDodgerSettings.Instance.MonsterDangerRadius)) { return(false); } if (DangerDodgerSettings.Instance.DodgeMonsterPacks && surroundingMonsters.Count() >= DangerDodgerSettings.Instance.MonsterPackSize && await PerformKiting(surroundingMonsters, surroundingMonsters.FirstOrDefault(), DangerDodgerSettings.Instance.MonsterDangerRadius)) { return(false); } } //TODO: Add exploding monsters kiting? //Monster Name: [Alira's Martyr], Skill Name: [suicide_explosion], Skill Destination: [{1685, 1302}], Skill Destination Distance: [0] //TODO: Add corpse kiting if detonate dead nearby? //TODO: Add storm call dodging? Does not appear in LokiPoe.ObjectManager.Objects //TODO: Add Flameblast dodging? Does not appear in LokiPoe.ObjectManager.Objects. Could try monster.CurrentAction.Skill.Name and monster.CurrentAction.Destination //TODO: Allow the user to give specific monster names? Dodge monster by name //TODO: Add support to dodge boss attacks? I'm wayyyyy to lazy to implement the attack detection for all the bosses. //TODO: Add exploding monster dodging if too many nearby (Alira's Martyr, Carrion Minion and Unstable Larvae) //TODO: Add leapslam dodging is too many monster are doing it at the same time //Monster Name: Goatman, Skill Name: Leap Slam, Skill Destination: {922, 996}, Skill Destination Distance: 4 //TODO: Dodge poison bombs / caustic arrow? Do they even do that much dmg? Maybe if the monster casting is Rare / Unique //TODO: Dodge poison cloud created on zombie death? return(false); }
void Awake() { //Based value for object attributes Debug.Log(Application.persistentDataPath); if (!File.Exists(Application.persistentDataPath + "/Items.json")) { Items i = new Items(); i.enemy = new string[4]; i.enemy[0] = "EnemyBlue"; i.enemy[1] = "EnemyGreen"; i.enemy[2] = "EnemyRed"; i.enemy[3] = "Asteroid"; i.gun = new string[3]; i.gun[0] = "PlayerRegularShot"; i.gun[1] = "PlayerTracingShot"; i.gun[2] = "PlayerBurstShot"; string json = JsonUtility.ToJson(i, true); File.WriteAllText(Application.persistentDataPath + "/Items.json", json); } if (!File.Exists(Application.persistentDataPath + "/EnemyBlue.json")) { enemyInfo = new EnemyInfo(); enemyInfo.name = "EnemyBlue"; enemyInfo.speed = 2; enemyInfo.health = 2; enemyInfo.ScoreValue = 15; enemyInfo.fireRate = 4F; string json = JsonUtility.ToJson(enemyInfo, true); File.WriteAllText(Application.persistentDataPath + "/EnemyBlue.json", json); } if (!File.Exists(Application.persistentDataPath + "/EnemyGreen.json")) { enemyInfo = new EnemyInfo(); enemyInfo.name = "EnemyGreen"; enemyInfo.speed = 3; enemyInfo.health = 4; enemyInfo.ScoreValue = 25; enemyInfo.fireRate = 3F; string json = JsonUtility.ToJson(enemyInfo, true); File.WriteAllText(Application.persistentDataPath + "/EnemyGreen.json", json); } if (!File.Exists(Application.persistentDataPath + "/EnemyRed.json")) { enemyInfo = new EnemyInfo(); enemyInfo.name = "EnemyRed"; enemyInfo.speed = 1.5f; enemyInfo.health = 25; enemyInfo.ScoreValue = 100; enemyInfo.fireRate = 3F; string json = JsonUtility.ToJson(enemyInfo, true); File.WriteAllText(Application.persistentDataPath + "/EnemyRed.json", json); } if (!File.Exists(Application.persistentDataPath + "/Asteroid.json")) { enemyInfo = new EnemyInfo(); enemyInfo.name = "Asteroid"; enemyInfo.speed = 2f; enemyInfo.health = 20; enemyInfo.ScoreValue = 10; string json = JsonUtility.ToJson(enemyInfo, true); File.WriteAllText(Application.persistentDataPath + "/Asteroid.json", json); } if (!File.Exists(Application.persistentDataPath + "/Boss1.json")) { BossInfo bossInfo = new BossInfo(); bossInfo.MachineGunFireRate = 0.3f; bossInfo.CentralGunFireRate = 0.4f; bossInfo.SpreadingGunFireRate = 0.6f; bossInfo.health = 300; bossInfo.speed = 1.5f; bossInfo.ScoreValue = 1000; string json = JsonUtility.ToJson(bossInfo, true); File.WriteAllText(Application.persistentDataPath + "/Boss1.json", json); } if (!File.Exists(Application.persistentDataPath + "/PlayerRegularGun.json")) { gun = new PlayerWeapon(); gun.shotType = "PlayerRegularShot"; gun.nextFire = 0f; gun.fireRate = 0.4f; gun.shotDamage = 1; gun.shotSpeed = 9f; gun.level = 1; Debug.Log(Application.persistentDataPath + "/PlayerRegularGun.json"); string json = JsonUtility.ToJson(gun, true); File.WriteAllText(Application.persistentDataPath + "/PlayerRegularGun.json", json); } // if (!File.Exists(Application.persistentDataPath + "/PlayerBurstGun.json")) { gun = new PlayerWeapon(); gun.shotType = "PlayerBurstShot"; gun.nextFire = 0f; gun.fireRate = 1.5f; gun.shotDamage = 5; gun.shotSpeed = 8f; gun.level = 1; Debug.Log(Application.persistentDataPath + "/PlayerBurstGun.json"); string json = JsonUtility.ToJson(gun, true); File.WriteAllText(Application.persistentDataPath + "/PlayerBurstGun.json", json); } if (!File.Exists(Application.persistentDataPath + "/PlayerTracingGun.json")) { gun = new PlayerWeapon(); gun.shotType = "PlayerTracingShot"; gun.nextFire = 0f; gun.fireRate = 3f; gun.shotDamage = 3; gun.shotSpeed = 3f; gun.level = 1; Debug.Log(Application.persistentDataPath + "/PlayerTracingGun.json"); string json = JsonUtility.ToJson(gun, true); File.WriteAllText(Application.persistentDataPath + "//PlayerTracingGun.json", json); } if (!File.Exists(Application.persistentDataPath + "/Level_1.json")) { Level level = new Level(); level.name = "Level_1"; level.events = new SpawnInfo[2]; level.events[0] = new SpawnInfo(); level.events[0].ID = "LV1_Event00"; level.events[0].enemyTag = "EnemyBlue"; level.events[0].typeOfSpawn = "EnemyRandomSpawn"; level.events[0].numberOfWave = 5; level.events[0].numberOfObject = 4; level.events[0].RandomSpawnWaitMin = 6; level.events[0].RandomSpawnWaitMax = 6; level.events[0].wavewaitMin = 6; level.events[0].wavewaitMax = 8; level.events[0].position = new Vector2(3, 6); level.events[0].duration = 85; level.events[1] = new SpawnInfo(); level.events[1].ID = "LV1_Event01"; level.events[1].enemyTag = "EnemyStream1"; level.events[1].typeOfSpawn = "EnemyRandomSpawn"; level.events[1].numberOfWave = 4; level.events[1].numberOfObject = 2; level.events[1].RandomSpawnWaitMin = 12; level.events[1].RandomSpawnWaitMax = 12; level.events[1].wavewaitMin = 6; level.events[1].wavewaitMax = 6; level.events[1].position = new Vector2(3, 6); level.events[1].duration = 80; level.timeToStartEachEvent = new float[2] { 3, 85 }; string json = JsonUtility.ToJson(level, true); File.WriteAllText(Application.persistentDataPath + "//Level_1.json", json); } if (!File.Exists(Application.persistentDataPath + "/Level_2.json")) { Level level = new Level(); level.name = "Level_2"; level.events = new SpawnInfo[4]; level.events[0] = new SpawnInfo(); level.events[0].ID = "LV2_Event00"; level.events[0].enemyTag = "EnemyStream1"; level.events[0].typeOfSpawn = "EnemyRandomSpawn"; level.events[0].numberOfWave = 4; level.events[0].numberOfObject = 2; level.events[0].RandomSpawnWaitMin = 12; level.events[0].RandomSpawnWaitMax = 12; level.events[0].wavewaitMin = 6; level.events[0].wavewaitMax = 6; level.events[0].position = new Vector2(3, 6); level.events[0].duration = 20; level.timeToStartEachEvent = new float[2] { 3, 85 }; level.events[3] = new SpawnInfo(); level.events[3].ID = "LV2_Event04"; level.events[3].enemyTag = "EnemyGreen"; level.events[3].typeOfSpawn = "EnemyRandomSpawn"; level.events[3].numberOfWave = 8; level.events[3].numberOfObject = 4; level.events[3].RandomSpawnWaitMin = 2; level.events[3].RandomSpawnWaitMax = 5; level.events[3].wavewaitMin = 4; level.events[3].wavewaitMax = 6; level.events[3].position = new Vector2(3, 6); level.events[3].duration = 80; level.events[1] = new SpawnInfo(); level.events[1].ID = "LV2_Event01"; level.events[1].enemyTag = "EnemyStream2"; level.events[1].typeOfSpawn = "EnemyHorizontalRandomSpawn"; level.events[1].numberOfWave = 5; level.events[1].numberOfObject = 2; level.events[1].RandomSpawnWaitMin = 7; level.events[1].RandomSpawnWaitMax = 10; level.events[1].wavewaitMin = 8; level.events[1].wavewaitMax = 8; level.events[1].position = new Vector2(-5, 4); level.events[1].duration = 50; level.events[2] = new SpawnInfo(); level.events[2].ID = "LV2_Event03"; level.events[2].enemyTag = "EnemyStream3"; level.events[2].typeOfSpawn = "EnemyHorizontalRandomSpawn"; level.events[2].numberOfWave = 5; level.events[2].numberOfObject = 2; level.events[2].RandomSpawnWaitMin = 7; level.events[2].RandomSpawnWaitMax = 10; level.events[2].wavewaitMin = 8; level.events[2].wavewaitMax = 8; level.events[2].position = new Vector2(5, 4); level.events[2].duration = 50; level.timeToStartEachEvent = new float[4] { 3, 20, 20, 20 }; string json = JsonUtility.ToJson(level, true); File.WriteAllText(Application.persistentDataPath + "//Level_2.json", json); } if (!File.Exists(Application.persistentDataPath + "/Level_3.json")) { Level level = new Level(); level.name = "Level_3"; level.events = new SpawnInfo[8]; level.events[0] = new SpawnInfo(); level.events[0].ID = "LV3_Event00"; level.events[0].enemyTag = "Asteroid"; level.events[0].typeOfSpawn = "EnemyRandomSpawn"; level.events[0].numberOfWave = 10; level.events[0].numberOfObject = 6; level.events[0].RandomSpawnWaitMin = 2; level.events[0].RandomSpawnWaitMax = 6; level.events[0].wavewaitMin = 3; level.events[0].wavewaitMax = 8; level.events[0].position = new Vector2(3, 6); level.events[0].duration = 45; level.events[1] = new SpawnInfo(); level.events[1].ID = "LV3_Event01"; level.events[1].enemyTag = "EnemyRed"; level.events[1].typeOfSpawn = "SingleSpawn"; level.events[1].position = new Vector2(3, 6); level.events[1].duration = 60; level.events[2] = new SpawnInfo(); level.events[2].ID = "LV3_Event02"; level.events[2].enemyTag = "EnemyRed"; level.events[2].typeOfSpawn = "EnemyRandomSpawn"; level.events[2].numberOfWave = 1; level.events[2].numberOfObject = 2; level.events[2].RandomSpawnWaitMin = 2; level.events[2].RandomSpawnWaitMax = 5; level.events[2].wavewaitMin = 5; level.events[2].wavewaitMax = 8; level.events[2].position = new Vector2(3, 6); level.events[2].duration = 60; level.events[3] = new SpawnInfo(); level.events[3].ID = "LV3_Event03"; level.events[3].enemyTag = "EnemyStream2"; level.events[3].typeOfSpawn = "EnemyHorizontalRandomSpawn"; level.events[3].numberOfWave = 3; level.events[3].numberOfObject = 2; level.events[3].RandomSpawnWaitMin = 7; level.events[3].RandomSpawnWaitMax = 10; level.events[3].wavewaitMin = 8; level.events[3].wavewaitMax = 8; level.events[3].position = new Vector2(-5, 4); level.events[3].duration = 20; level.events[4] = new SpawnInfo(); level.events[4].ID = "LV3_Event04"; level.events[4].enemyTag = "EnemyGreen"; level.events[4].typeOfSpawn = "EnemyRandomSpawn"; level.events[4].numberOfWave = 8; level.events[4].numberOfObject = 4; level.events[4].RandomSpawnWaitMin = 2; level.events[4].RandomSpawnWaitMax = 5; level.events[4].wavewaitMin = 4; level.events[4].wavewaitMax = 6; level.events[4].position = new Vector2(3, 6); level.events[4].duration = 80; level.events[5] = new SpawnInfo(); level.events[5].ID = "LV3_Event04"; level.events[5].enemyTag = "EnemyStream3"; level.events[5].typeOfSpawn = "EnemyHorizontalRandomSpawn"; level.events[5].numberOfWave = 3; level.events[5].numberOfObject = 2; level.events[5].RandomSpawnWaitMin = 7; level.events[5].RandomSpawnWaitMax = 10; level.events[5].wavewaitMin = 8; level.events[5].wavewaitMax = 8; level.events[5].position = new Vector2(5, 4); level.events[5].duration = 20; level.events[6] = new SpawnInfo(); level.events[6].ID = "LV3_Event05"; level.events[6].enemyTag = "EnemyStream4"; level.events[6].typeOfSpawn = "EnemyHorizontalRandomSpawn"; level.events[6].numberOfWave = 3; level.events[6].numberOfObject = 2; level.events[6].RandomSpawnWaitMin = 7; level.events[6].RandomSpawnWaitMax = 10; level.events[6].wavewaitMin = 8; level.events[6].wavewaitMax = 8; level.events[6].position = new Vector2(-5, 4); level.events[6].duration = 20; level.events[7] = new SpawnInfo(); level.events[7].ID = "LV3_Event06"; level.events[7].enemyTag = "EnemyStream5"; level.events[7].typeOfSpawn = "EnemyHorizontalRandomSpawn"; level.events[7].numberOfWave = 3; level.events[7].numberOfObject = 2; level.events[7].RandomSpawnWaitMin = 7; level.events[7].RandomSpawnWaitMax = 10; level.events[7].wavewaitMin = 8; level.events[7].wavewaitMax = 8; level.events[7].position = new Vector2(5, 4); level.events[7].duration = 20; level.timeToStartEachEvent = new float[8] { 3, 45, 45, 60, 10, 30, 20, 15 }; string json = JsonUtility.ToJson(level, true); File.WriteAllText(Application.persistentDataPath + "//Level_3.json", json); } if (!File.Exists(Application.persistentDataPath + "/Level_4.json")) { Level level = new Level(); level.name = "Level_4"; level.events = new SpawnInfo[6]; level.events[0] = new SpawnInfo(); level.events[0].ID = "LV4_Event00"; level.events[0].enemyTag = "Asteroid"; level.events[0].typeOfSpawn = "EnemyRandomSpawn"; level.events[0].numberOfWave = 10; level.events[0].numberOfObject = 6; level.events[0].RandomSpawnWaitMin = 2; level.events[0].RandomSpawnWaitMax = 3; level.events[0].wavewaitMin = 5; level.events[0].wavewaitMax = 8; level.events[0].position = new Vector2(3, 6); level.events[0].duration = 60; level.events[1] = new SpawnInfo(); level.events[1].ID = "LV4_Event01"; level.events[1].enemyTag = "EnemyRed"; level.events[1].typeOfSpawn = "SingleSpawn"; level.events[1].position = new Vector2(3, 6); level.events[2] = new SpawnInfo(); level.events[2].ID = "LV4_Event02"; level.events[2].enemyTag = "EnemyStream1"; level.events[2].typeOfSpawn = "EnemyRandomSpawn"; level.events[2].numberOfWave = 5; level.events[2].numberOfObject = 2; level.events[2].RandomSpawnWaitMin = 12; level.events[2].RandomSpawnWaitMax = 12; level.events[2].wavewaitMin = 6; level.events[2].wavewaitMax = 6; level.events[2].position = new Vector2(3, 6); level.events[2].duration = 60; level.events[3] = new SpawnInfo(); level.events[3].ID = "LV4_Event03"; level.events[3].enemyTag = "EnemyGreen"; level.events[3].typeOfSpawn = "EnemyRandomSpawn"; level.events[3].numberOfWave = 8; level.events[3].numberOfObject = 4; level.events[3].RandomSpawnWaitMin = 2; level.events[3].RandomSpawnWaitMax = 5; level.events[3].wavewaitMin = 4; level.events[3].wavewaitMax = 6; level.events[3].position = new Vector2(3, 6); level.events[3].duration = 80; level.events[4] = new SpawnInfo(); level.events[4].ID = "LV4_Event04"; level.events[4].enemyTag = "EnemyStream4"; level.events[4].typeOfSpawn = "EnemyHorizontalRandomSpawn"; level.events[4].numberOfWave = 6; level.events[4].numberOfObject = 2; level.events[4].RandomSpawnWaitMin = 7; level.events[4].RandomSpawnWaitMax = 10; level.events[4].wavewaitMin = 8; level.events[4].wavewaitMax = 8; level.events[4].position = new Vector2(-5, 4); level.events[4].duration = 80; level.events[5] = new SpawnInfo(); level.events[5].ID = "LV4_Event05"; level.events[5].enemyTag = "EnemyRed"; level.events[5].typeOfSpawn = "EnemyRandomSpawn"; level.events[5].numberOfWave = 2; level.events[5].numberOfObject = 2; level.events[5].RandomSpawnWaitMin = 2; level.events[5].RandomSpawnWaitMax = 5; level.events[5].wavewaitMin = 50; level.events[5].wavewaitMax = 50; level.events[5].position = new Vector2(3, 6); level.events[5].duration = 140; level.timeToStartEachEvent = new float[6] { 3, 15, 30, 15, 20, 15 }; string json = JsonUtility.ToJson(level, true); File.WriteAllText(Application.persistentDataPath + "//Level_4.json", json); } if (!File.Exists(Application.persistentDataPath + "/Level_5.json")) { Level level = new Level(); level.name = "Level_5"; level.events = new SpawnInfo[2]; level.events[0] = new SpawnInfo(); level.events[0].ID = "LV5_Event00"; level.events[0].enemyTag = "EnemyGreen"; level.events[0].typeOfSpawn = "EnemyRandomSpawn"; level.events[0].numberOfWave = 10; level.events[0].numberOfObject = 5; level.events[0].RandomSpawnWaitMin = 2; level.events[0].RandomSpawnWaitMax = 5; level.events[0].wavewaitMin = 4; level.events[0].wavewaitMax = 6; level.events[0].position = new Vector2(3, 6); level.events[0].duration = 80; level.events[1] = new SpawnInfo(); level.events[1].ID = "LV5_Event01"; level.events[1].enemyTag = "EnemyRed"; level.events[1].typeOfSpawn = "EnemyRandomSpawn"; level.events[1].numberOfWave = 3; level.events[1].numberOfObject = 2; level.events[1].RandomSpawnWaitMin = 2; level.events[1].RandomSpawnWaitMax = 5; level.events[1].wavewaitMin = 50; level.events[1].wavewaitMax = 50; level.events[1].position = new Vector2(3, 6); level.events[1].duration = 160; level.timeToStartEachEvent = new float[2] { 3, 15 }; string json = JsonUtility.ToJson(level, true); File.WriteAllText(Application.persistentDataPath + "//Level_5.json", json); } if (!File.Exists(Application.persistentDataPath + "/Level_6.json")) { Level level = new Level(); level.name = "Level_6"; level.events = new SpawnInfo[1]; level.events[0] = new SpawnInfo(); level.events[0].ID = "LV6_Event00"; level.events[0].enemyTag = "Boss1"; level.events[0].typeOfSpawn = "BossSpawn"; level.events[0].duration = 180; level.timeToStartEachEvent = new float[1] { 6 }; string json = JsonUtility.ToJson(level, true); File.WriteAllText(Application.persistentDataPath + "//Level_6.json", json); } }
public DoorInfo(BossInfo _bossInfo, DoorType _type) { bossInfo = _bossInfo; type = _type; }
// Use this for initialization void Start() { bossInfo = GetComponent <BossInfo>(); }
public static void ShowIntro(BossInfo info) { GlobalController.bossFightIntro.m_ShowIntro(info); }