private void onGameplayStateChanged(GameplayState previousState, GameplayState currentState) { ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon; if (currentState == GameplayState.START_CEREMONY_STEP1) { int num = activeDungeon.ActiveRoom.getNextCharacterSpawnpointIndex(activeDungeon.ActiveRoom.PlayerStartingSpawnpointIndex); if (!activeDungeon.isTutorialDungeon()) { Player player = GameLogic.Binder.GameState.Player; this.refreshPetSummons(player); int spawnCount = Mathf.FloorToInt(Mathf.Lerp((float)ConfigGameplay.MOB_SPAWNCOUNT_PER_SPAWNPOINT_MIN_RANGE.getRandom(), (float)ConfigGameplay.MOB_SPAWNCOUNT_PER_SPAWNPOINT_MAX_RANGE.getRandom(), player.ActiveCharacter.getSpurtBuffStrength())); this.spawnRoomMinionHordeAtSpawnpoint(activeDungeon.ActiveRoom, activeDungeon.ActiveRoom.CharacterSpawnpoints[num], spawnCount, null); } this.m_prevMobSpawnpointIndex = num; } else if (currentState == GameplayState.ACTION) { this.m_spawnWaveTimer.set(2f); this.m_spawnWaveTimer.end(); } else if (currentState == GameplayState.BOSS_START) { UnityUtils.StopCoroutine(this, ref this.m_hordeSpawnRoutine); } else if (currentState == GameplayState.BOSS_FIGHT) { this.summonActiveRoomBoss(); } }
private void grantMultikillReward(int killCount) { ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon; if (!activeDungeon.isTutorialDungeon()) { Player player = GameLogic.Binder.GameState.Player; double baseAmount = App.Binder.ConfigMeta.MultikillCoinGainCurve(killCount, activeDungeon.Floor); baseAmount = CharacterStatModifierUtil.ApplyCoinBonuses(player.ActiveCharacter, GameLogic.CharacterType.UNSPECIFIED, baseAmount, false); CmdGainResources.ExecuteStatic(player, ResourceType.Coin, baseAmount, true, "TRACKING_ID_GAMEPLAY_LOOT_GAIN", null); GameLogic.Binder.EventBus.MultikillBonusGranted(player, killCount, baseAmount); } }
private void onCharacterKilled(CharacterInstance target, CharacterInstance killer, bool critted, SkillType fromSkill) { Player player = GameLogic.Binder.GameState.Player; ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon; if (((killer != null) && !target.IsPlayerCharacter) && (killer.IsPlayerCharacter && !activeDungeon.isTutorialDungeon())) { Vector3 positionAtTimeOfDeath = target.PositionAtTimeOfDeath; if (target.IsBoss && (activeDungeon.ActiveRoom.numberOfBossesAlive() == 0)) { activeDungeon.LastBossKillWorldPt = positionAtTimeOfDeath; } else if (!activeDungeon.ActiveRoom.MainBossSummoned) { if (!activeDungeon.hasDungeonModifier(DungeonModifierType.MonsterNoCoins)) { double baseCoinReward = App.Binder.ConfigMeta.MinionCoinDropCurve(activeDungeon.Floor); double num2 = player.calculateStandardCoinRoll(baseCoinReward, target.Type, 1); CmdGainResources.ExecuteStatic(player, ResourceType.Coin, num2, true, "TRACKING_ID_GAMEPLAY_LOOT_GAIN", new Vector3?(positionAtTimeOfDeath)); } CharacterInstance primaryPlayerCharacter = activeDungeon.PrimaryPlayerCharacter; double amount = App.Binder.ConfigMeta.XpFromMinionKill(activeDungeon.Floor); float num4 = primaryPlayerCharacter.getCharacterTypeXpModifier(target.Type) + primaryPlayerCharacter.UniversalXpBonus(true); amount += amount * num4; CmdGainResources.ExecuteStatic(player, ResourceType.Xp, amount, true, string.Empty, new Vector3?(positionAtTimeOfDeath)); CmdRollDropLootTable.ExecuteStatic(App.Binder.ConfigLootTables.MinionDropLootTable, player, positionAtTimeOfDeath, target.Type, null, ChestType.NONE); } if (target.IsWildBoss && !target.IsBossClone) { GameLogic.Binder.LootSystem.awardBossRewards(activeDungeon, target.Type, true); } } }
protected void FixedUpdate() { ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon; if (((activeDungeon != null) && (activeDungeon.ActiveRoom != null)) && ((!activeDungeon.ActiveRoom.MainBossSummoned && !activeDungeon.ActiveRoom.CompletionTriggered) && (!activeDungeon.isTutorialDungeon() && (activeDungeon.CurrentGameplayState == GameplayState.ACTION)))) { Player player = GameLogic.Binder.GameState.Player; bool flag = true; for (int i = 0; i < activeDungeon.ActiveRoom.ActiveCharacters.Count; i++) { CharacterInstance instance = activeDungeon.ActiveRoom.ActiveCharacters[i]; if (!instance.IsPlayerCharacter && !instance.IsDead) { flag = false; break; } } if (flag) { int num3; int num2 = activeDungeon.ActiveRoom.getNextCharacterSpawnpointIndex(this.m_prevMobSpawnpointIndex); if (activeDungeon.hasDungeonModifier(DungeonModifierType.HordeMaxSize)) { num3 = App.Binder.ConfigMeta.FRENZY_MOB_SPAWNCOUNT_PER_SPAWNPOINT_MAX; } else if (GameLogic.Binder.FrenzySystem.isFrenzyActive()) { num3 = Mathf.FloorToInt(Mathf.Lerp((float)App.Binder.ConfigMeta.FRENZY_MOB_SPAWNCOUNT_PER_SPAWNPOINT_MIN, (float)App.Binder.ConfigMeta.FRENZY_MOB_SPAWNCOUNT_PER_SPAWNPOINT_MAX, player.ActiveCharacter.getSpurtBuffStrength())); } else { num3 = Mathf.FloorToInt(Mathf.Lerp((float)ConfigGameplay.MOB_SPAWNCOUNT_PER_SPAWNPOINT_MIN_RANGE.getRandom(), (float)ConfigGameplay.MOB_SPAWNCOUNT_PER_SPAWNPOINT_MAX_RANGE.getRandom(), player.ActiveCharacter.getSpurtBuffStrength())); } int num4 = player.getRemainingMinionKillsUntilFloorCompletion(activeDungeon.Floor, activeDungeon.isTutorialDungeon(), player.getLastBossEncounterFailed(false)); if (!activeDungeon.isBossFloor() && (num4 < num3)) { num3 = num4; } this.spawnRoomMinionHordeAtSpawnpoint(activeDungeon.ActiveRoom, activeDungeon.ActiveRoom.CharacterSpawnpoints[num2], num3, null); this.m_prevMobSpawnpointIndex = num2; } if (this.m_pendingWildBossSpawn) { this.trySummonWildBoss(); } } }