コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
ファイル: PerkSystem.cs プロジェクト: hackerlank/UnityGameSrc
        protected void FixedUpdate()
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if ((activeDungeon != null) && (activeDungeon.CurrentGameplayState == GameplayState.ACTION))
            {
                CharacterInstance primaryPlayerCharacter = activeDungeon.PrimaryPlayerCharacter;
                if (!primaryPlayerCharacter.IsDead)
                {
                    float num = Time.deltaTime * Time.timeScale;
                    if (primaryPlayerCharacter.getPerkInstanceCount(PerkType.PassiveDamage) > 0)
                    {
                        List <KeyValuePair <PerkInstance, BuffSource> > perkInstancesOfType = CharacterStatModifierUtil.GetPerkInstancesOfType(primaryPlayerCharacter, PerkType.PassiveDamage);
                        for (int i = 0; i < perkInstancesOfType.Count; i++)
                        {
                            KeyValuePair <PerkInstance, BuffSource> pair = perkInstancesOfType[i];
                            PerkInstance key = pair.Key;
                            key.Timer -= num;
                            if (key.Timer <= 0f)
                            {
                                List <CharacterInstance> list2 = activeDungeon.ActiveRoom.getEnemyCharactersWithinRadius(primaryPlayerCharacter.PhysicsBody.Transform.position, ConfigPerks.MassDamageDeflection.Radius, primaryPlayerCharacter);
                                for (int j = 0; j < list2.Count; j++)
                                {
                                    CharacterInstance targetCharacter = list2[j];
                                    double            baseAmount      = targetCharacter.MaxLife(false) * primaryPlayerCharacter.getGenericModifierForPerkType(PerkType.PassiveDamage);
                                    CmdDealDamageToCharacter.ExecuteStatic(primaryPlayerCharacter, targetCharacter, baseAmount, false, DamageType.Magic, SkillType.NONE);
                                }
                                key.Timer = ConfigPerks.PassiveDamage.Interval;
                            }
                        }
                    }
                }
            }
        }
コード例 #3
0
 protected void FixedUpdate()
 {
     if (this.CharacterController.enabled)
     {
         if (this.AttachedCharacter.Velocity == Vector3.zero)
         {
             this.AttachedCharacter.RunAccelerationTimer.reset();
         }
         this.AttachedCharacter.RunAccelerationTimer.tick(Time.fixedDeltaTime * Time.timeScale);
         if (ConfigGameplay.OUT_OF_BOUNDS_CHECKING_ENABLED && (Time.fixedTime >= this.m_nextOutOfBoundsCheck))
         {
             ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;
             if (((activeDungeon != null) && (activeDungeon.ActiveRoom != null)) && (activeDungeon.CurrentGameplayState == GameplayState.ACTION))
             {
                 Room activeRoom = activeDungeon.ActiveRoom;
                 if (!PhysicsUtil.IsOnSurface(this.Transform.position + ((Vector3)(Vector3.up * 0.5f)), float.MaxValue, Layers.GroundLayerMask))
                 {
                     Vector3 worldPt = activeRoom.adjustToNearestGridPoint(this.Transform.position);
                     Vector3 vector2 = activeRoom.calculateNearestEmptySpot(worldPt, Vector3.zero, 1f, 1f, 6f, null);
                     this.Transform.position = vector2;
                 }
                 this.m_nextOutOfBoundsCheck = Time.fixedTime + (0.5f * UnityEngine.Random.Range((float)1f, (float)2f));
             }
         }
     }
 }
コード例 #4
0
        private void onDungeonBoostActivated(DungeonBoost dungeonBoost, SkillType fromSkill)
        {
            Buff          buff4;
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if (activeDungeon.hasDungeonModifier(DungeonModifierType.DungeonBoostBoxBonusSkillDamage))
            {
                buff4                 = new Buff();
                buff4.BaseStat1       = BaseStatProperty.SkillDamage;
                buff4.Modifier        = ConfigDungeonModifiers.DungeonBoostBoxBonusSkillDamage.SkillDamageModifier;
                buff4.DurationSeconds = ConfigDungeonModifiers.DungeonBoostBoxBonusSkillDamage.BuffDurationSeconds;
                Buff buff = buff4;
                this.startBuff(activeDungeon.PrimaryPlayerCharacter, buff);
            }
            if (activeDungeon.hasDungeonModifier(DungeonModifierType.DungeonBoostBoxBonusWeaponDamage))
            {
                buff4                 = new Buff();
                buff4.BaseStat1       = BaseStatProperty.DamagePerHit;
                buff4.Modifier        = ConfigDungeonModifiers.DungeonBoostBoxBonusWeaponDamage.DamagePerHitModifier;
                buff4.DurationSeconds = ConfigDungeonModifiers.DungeonBoostBoxBonusWeaponDamage.BuffDurationSeconds;
                Buff buff2 = buff4;
                this.startBuff(activeDungeon.PrimaryPlayerCharacter, buff2);
            }
            if (activeDungeon.hasDungeonModifier(DungeonModifierType.DungeonBoostBoxBonusUniversalDamage))
            {
                buff4                 = new Buff();
                buff4.BaseStat1       = BaseStatProperty.DamagePerHit;
                buff4.BaseStat2       = BaseStatProperty.SkillDamage;
                buff4.Modifier        = ConfigDungeonModifiers.DungeonBoostBoxBonusUniversalDamage.Modifier;
                buff4.DurationSeconds = ConfigDungeonModifiers.DungeonBoostBoxBonusUniversalDamage.BuffDurationSeconds;
                Buff buff3 = buff4;
                this.startBuff(activeDungeon.PrimaryPlayerCharacter, buff3);
            }
        }
コード例 #5
0
        public void refreshPetSummons(Player player)
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if (((activeDungeon != null) && (activeDungeon.ActiveRoom != null)) && (((activeDungeon.CurrentGameplayState != GameplayState.ROOM_COMPLETION) && (activeDungeon.CurrentGameplayState != GameplayState.ENDED)) && (activeDungeon.CurrentGameplayState != GameplayState.END_CEREMONY)))
            {
                PetInstance instance = player.Pets.getSelectedPetInstance();
                if ((instance != null) && !App.Binder.ConfigMeta.GetPetConfig(instance.CharacterId).Enabled)
                {
                    CmdSelectPet.ExecuteStatic(player, null);
                }
                else if ((instance != null) && (instance.SpawnedCharacterInstance == null))
                {
                    CharacterInstance activeCharacter = player.ActiveCharacter;
                    Vector3           worldPt         = Vector3Extensions.ToXzVector3(activeCharacter.PhysicsBody.Transform.position) + ((Vector3)(activeCharacter.PhysicsBody.Transform.forward * 3f));
                    worldPt.x += UnityEngine.Random.Range((float)-1.5f, (float)1.5f);
                    worldPt.z += UnityEngine.Random.Range((float)-1.5f, (float)1.5f);
                    worldPt    = activeDungeon.ActiveRoom.calculateNearestEmptySpot(worldPt, activeCharacter.PhysicsBody.Transform.position - worldPt, 1f, 1f, 6f, null);
                    Character character = instance.Character;
                    CmdSpawnCharacter.SpawningData data2 = new CmdSpawnCharacter.SpawningData();
                    data2.CharacterPrototype = character;
                    data2.Rank                     = instance.Level;
                    data2.SpawnWorldPos            = worldPt;
                    data2.SpawnWorlRot             = activeCharacter.PhysicsBody.Transform.rotation;
                    data2.IsPlayerCharacter        = true;
                    data2.IsPlayerSupportCharacter = true;
                    data2.IsPet                    = true;
                    CmdSpawnCharacter.SpawningData data = data2;
                    instance.SpawnedCharacterInstance = CmdSpawnCharacter.ExecuteStatic(data);
                }
            }
        }
コード例 #6
0
        protected void FixedUpdate()
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if ((activeDungeon != null) && (activeDungeon.CurrentGameplayState == GameplayState.ACTION))
            {
                this.refreshAuraBuffs();
                this.refreshBuildupBuffs();
                this.refreshTickBuffs();
                for (int i = this.m_allBuffs.Count - 1; i >= 0; i--)
                {
                    Buff buff = this.m_allBuffs[i];
                    buff.TimeRemaining = Mathf.Max((float)(buff.TimeRemaining - (Time.deltaTime * Time.timeScale)), (float)0f);
                    if (buff.TimeRemaining <= 0f)
                    {
                        this.endBuff(buff);
                    }
                }
                if (GameLogic.Binder.FrenzySystem.isFrenzyActive() || activeDungeon.hasDungeonModifier(DungeonModifierType.HeroMaxSpeed))
                {
                    CharacterInstance primaryPlayerCharacter = activeDungeon.PrimaryPlayerCharacter;
                    for (int j = GameLogic.Binder.BuffSystem.getNumberOfBuffsWithId(primaryPlayerCharacter, ConfigGameplay.SPURT_BUFF_ID); j <= ConfigGameplay.SPURTING_MAX_NUM_BUFFS; j++)
                    {
                        this.grantSpurtBuff(primaryPlayerCharacter);
                    }
                }
            }
        }
コード例 #7
0
        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();
            }
        }
コード例 #8
0
 private void onGameplayStarted(ActiveDungeon activeDungeon)
 {
     if (this.PhysicsBody.AttachedCharacter.IsPlayerCharacter)
     {
         this.releaseActivePath();
         this.recalculatePath();
     }
 }
コード例 #9
0
ファイル: PerkSystem.cs プロジェクト: hackerlank/UnityGameSrc
 private void onCharacterKilled(CharacterInstance killedCharacter, CharacterInstance killer, bool critted, SkillType fromSkill)
 {
     if (killer != null)
     {
         ActiveDungeon     activeDungeon          = GameLogic.Binder.GameState.ActiveDungeon;
         CharacterInstance primaryPlayerCharacter = activeDungeon.PrimaryPlayerCharacter;
         if (killedCharacter.IsSupport && (primaryPlayerCharacter.getPerkInstanceCount(PerkType.SummonCoinExplosion) > 0))
         {
             float   num            = primaryPlayerCharacter.OwningPlayer.ActiveCharacter.getGenericModifierForPerkType(PerkType.SummonCoinExplosion);
             double  amountPerDrop  = Math.Max((double)1.0, (double)((App.Binder.ConfigMeta.MinionCoinDropCurve(activeDungeon.Floor) * num) * App.Binder.ConfigMeta.COIN_GAIN_CONTROLLER));
             int     dropCount      = ConfigPerks.CoinExplosion.DropCountMinMax.getRandom();
             Vector3 centerWorldPos = !killedCharacter.IsDead ? killedCharacter.PhysicsBody.Transform.position : killedCharacter.PositionAtTimeOfDeath;
             GameLogic.Binder.LootSystem.triggerResourceExplosion(ResourceType.Coin, centerWorldPos, amountPerDrop, dropCount, "TRACKING_ID_GAMEPLAY_LOOT_GAIN");
         }
         List <KeyValuePair <PerkInstance, BuffSource> > perkInstancesOfType = CharacterStatModifierUtil.GetPerkInstancesOfType(primaryPlayerCharacter, PerkType.SummonCritterOnKill);
         for (int i = 0; i < perkInstancesOfType.Count; i++)
         {
             KeyValuePair <PerkInstance, BuffSource> pair = perkInstancesOfType[i];
             float modifier = pair.Key.Modifier;
             if (UnityEngine.Random.Range((float)0f, (float)1f) <= modifier)
             {
                 GameLogic.Binder.CharacterSpawningSystem.summonSupportCritters(primaryPlayerCharacter, 1, new Vector3?(killedCharacter.PositionAtTimeOfDeath));
             }
         }
         if (killer.IsPrimaryPlayerCharacter)
         {
             perkInstancesOfType = CharacterStatModifierUtil.GetPerkInstancesOfType(primaryPlayerCharacter, PerkType.KillArmor);
             for (int j = 0; j < perkInstancesOfType.Count; j++)
             {
                 KeyValuePair <PerkInstance, BuffSource> pair2 = perkInstancesOfType[j];
                 KeyValuePair <PerkInstance, BuffSource> pair3 = perkInstancesOfType[j];
                 GameLogic.Binder.BuffSystem.startBuffFromPerk(primaryPlayerCharacter, PerkType.KillArmor, ConfigPerks.SHARED_DATA[PerkType.KillArmor].DurationSeconds, (double)pair2.Key.Modifier, pair3.Value, null);
             }
             perkInstancesOfType = CharacterStatModifierUtil.GetPerkInstancesOfType(primaryPlayerCharacter, PerkType.KillAttackSpeed);
             for (int k = 0; k < perkInstancesOfType.Count; k++)
             {
                 KeyValuePair <PerkInstance, BuffSource> pair4 = perkInstancesOfType[k];
                 KeyValuePair <PerkInstance, BuffSource> pair5 = perkInstancesOfType[k];
                 GameLogic.Binder.BuffSystem.startBuffFromPerk(primaryPlayerCharacter, PerkType.KillAttackSpeed, ConfigPerks.SHARED_DATA[PerkType.KillAttackSpeed].DurationSeconds, (double)pair4.Key.Modifier, pair5.Value, null);
             }
             perkInstancesOfType = CharacterStatModifierUtil.GetPerkInstancesOfType(primaryPlayerCharacter, PerkType.KillDamage);
             for (int m = 0; m < perkInstancesOfType.Count; m++)
             {
                 KeyValuePair <PerkInstance, BuffSource> pair6 = perkInstancesOfType[m];
                 KeyValuePair <PerkInstance, BuffSource> pair7 = perkInstancesOfType[m];
                 GameLogic.Binder.BuffSystem.startBuffFromPerk(primaryPlayerCharacter, PerkType.KillDamage, ConfigPerks.SHARED_DATA[PerkType.KillDamage].DurationSeconds, (double)pair6.Key.Modifier, pair7.Value, null);
             }
             perkInstancesOfType = CharacterStatModifierUtil.GetPerkInstancesOfType(primaryPlayerCharacter, PerkType.KillCritChance);
             for (int n = 0; n < perkInstancesOfType.Count; n++)
             {
                 KeyValuePair <PerkInstance, BuffSource> pair8 = perkInstancesOfType[n];
                 KeyValuePair <PerkInstance, BuffSource> pair9 = perkInstancesOfType[n];
                 GameLogic.Binder.BuffSystem.startBuffFromPerk(primaryPlayerCharacter, PerkType.KillCritChance, ConfigPerks.SHARED_DATA[PerkType.KillCritChance].DurationSeconds, (double)pair8.Key.Modifier, pair9.Value, null);
             }
         }
     }
 }
コード例 #10
0
        protected void FixedUpdate()
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if ((activeDungeon != null) && (activeDungeon.CurrentGameplayState == GameplayState.ACTION))
            {
                this.RealtimeCombatStats.tick(Time.deltaTime);
            }
        }
コード例 #11
0
        private void onGameplayStarted(ActiveDungeon ad)
        {
            Player owningPlayer = ad.PrimaryPlayerCharacter.OwningPlayer;

            if (owningPlayer.doUnlockMissions())
            {
                owningPlayer.HasUnlockedMissions = true;
            }
        }
コード例 #12
0
 private void onGameplayLoadingStarted(ActiveDungeon ad)
 {
     if (GameLogic.Binder.FrenzySystem.isFrenzyActive() && ad.SeamlessTransition)
     {
         Player          player              = GameLogic.Binder.GameState.Player;
         int             spawnCount          = 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()));
         Room.Spawnpoint randomValueFromList = LangUtil.GetRandomValueFromList <Room.Spawnpoint>(ad.ActiveRoom.CharacterSpawnpoints);
         this.spawnRoomMinionHordeAtSpawnpoint(ad.ActiveRoom, randomValueFromList, spawnCount, null);
         this.m_prevMobSpawnpointIndex = ad.ActiveRoom.CharacterSpawnpoints.IndexOf(randomValueFromList);
     }
 }
コード例 #13
0
 private void onRewardConsumed(Player player, Reward reward)
 {
     if (reward.ShopEntryId == ConfigShops.IAP_STARTER_BUNDLE_ID)
     {
         ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;
         if (((activeDungeon.CurrentGameplayState != GameplayState.END_CEREMONY) && (activeDungeon.CurrentGameplayState != GameplayState.ENDED)) && (activeDungeon.CurrentGameplayState != GameplayState.RETIREMENT))
         {
             this.refreshPetSummons(player);
         }
     }
 }
コード例 #14
0
        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);
            }
        }
コード例 #15
0
        private void onCharacterSpawned(CharacterInstance c)
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if (c.IsBoss && (activeDungeon.Floor == 2))
            {
                for (int i = 0; i < this.m_heroStats.Count; i++)
                {
                    HeroStats local1 = this.m_heroStats[i];
                    local1.FirstBossSummonCount++;
                }
            }
        }
コード例 #16
0
        private void onCharacterHordeSpawned(Room.Spawnpoint spawnpoint, bool isBoss)
        {
            ActiveDungeon activeDungeon = Binder.GameState.ActiveDungeon;

            if (activeDungeon != null)
            {
                CharacterInstance primaryPlayerCharacter = activeDungeon.PrimaryPlayerCharacter;
                if ((!Binder.FrenzySystem.isFrenzyActive() && primaryPlayerCharacter.isAtBlinkDistance(spawnpoint.WorldPt)) && ((primaryPlayerCharacter.getPerkInstanceCount(PerkType.BlinkTravel) > 0) && (primaryPlayerCharacter.getGenericModifierForPerkType(PerkType.BlinkTravel) >= UnityEngine.Random.value)))
                {
                    this.blinkCharacterQueued(primaryPlayerCharacter, spawnpoint.WorldPt);
                }
            }
        }
コード例 #17
0
 private void onCharacterMeleeAttackContact(CharacterInstance sourceCharacter, Vector3 contactWorldPt, bool critted)
 {
     if (sourceCharacter.IsPlayerCharacter)
     {
         Buff buff = GameLogic.Binder.BuffSystem.getBuffFromBoost(sourceCharacter, BoostType.Midas);
         if (buff != null)
         {
             ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;
             double        amountPerDrop = Math.Max((double)(App.Binder.ConfigMeta.MinionCoinDropCurve(activeDungeon.Floor) * App.Binder.ConfigMeta.COIN_GAIN_CONTROLLER), (double)1.0);
             int           dropCount     = UnityEngine.Random.Range(1, ((int)buff.TotalModifier) + 1);
             this.triggerResourceExplosion(ResourceType.Coin, contactWorldPt, amountPerDrop, dropCount, "TRACKING_ID_GAMEPLAY_LOOT_GAIN");
         }
     }
 }
コード例 #18
0
ファイル: PerkSystem.cs プロジェクト: hackerlank/UnityGameSrc
 private void onCharacterSkillExecutionMidpoint(CharacterInstance c, SkillType skillType, SkillExecutionStats executionStats)
 {
     if (c.IsPrimaryPlayerCharacter)
     {
         Player        owningPlayer  = c.OwningPlayer;
         ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;
         if ((skillType == SkillType.Leap) && (c.getPerkInstanceCount(PerkType.SkillUpgradeLeap1) > 0))
         {
             double baseCoinReward = App.Binder.ConfigMeta.MinionCoinDropCurve(activeDungeon.Floor) * ConfigSkills.Leap.UpgradedBonusCoinCountPerUsage;
             double amountPerDrop  = Math.Max(Math.Round((double)(owningPlayer.calculateStandardCoinRoll(baseCoinReward, GameLogic.CharacterType.UNSPECIFIED, 1) / 5.0)), 1.0);
             GameLogic.Binder.LootSystem.triggerResourceExplosion(ResourceType.Coin, c.PhysicsBody.Transform.position, amountPerDrop, 5, "TRACKING_ID_GAMEPLAY_LOOT_GAIN");
         }
     }
 }
コード例 #19
0
        public void killCharacter(CharacterInstance target, CharacterInstance killer, bool critted, bool instantDestruction, [Optional, DefaultParameterValue(0)] SkillType fromSkill)
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if (this.m_characterDestructionQueue.Contains(target))
            {
                if (instantDestruction)
                {
                    this.m_characterDestructionTimers[target] = 0f;
                }
            }
            else
            {
                CmdKillCharacter.ExecuteStatic(target, killer, critted, instantDestruction, fromSkill);
                if ((target == activeDungeon.PrimaryPlayerCharacter) && !instantDestruction)
                {
                    for (int i = 0; i < GameLogic.Binder.GameState.PersistentCharacters.Count; i++)
                    {
                        CharacterInstance instance = GameLogic.Binder.GameState.PersistentCharacters[i];
                        if (instance != target)
                        {
                            this.killCharacter(instance, null, false, false, SkillType.NONE);
                        }
                    }
                }
                if (!target.IsPersistent)
                {
                    this.m_characterDestructionQueue.Add(target);
                    if (instantDestruction)
                    {
                        this.m_characterDestructionTimers.Add(target, 0f);
                    }
                    else
                    {
                        float num2 = (ConfigGameplay.DEATH_ENTRY_DURATION + ConfigGameplay.DEATH_REMAIN_DURATION) + UnityEngine.Random.Range((float)0f, (float)1f);
                        if (Time.timeScale > 1f)
                        {
                            num2 *= Time.timeScale;
                        }
                        this.m_characterDestructionTimers.Add(target, num2);
                    }
                }
                if ((!target.IsPlayerCharacter && activeDungeon.hasDungeonModifier(DungeonModifierType.MonsterExploding)) && (UnityEngine.Random.Range((float)0f, (float)1f) <= ConfigDungeonModifiers.MonsterExploding.ProcChance))
                {
                    ExplosionSkill.ExecuteStatic(null, target.PositionAtTimeOfDeath, null, ConfigDungeonModifiers.MonsterExploding.DamagePct);
                }
            }
        }
コード例 #20
0
 private void onDungeonBoostActivated(DungeonBoost dungeonBoost, SkillType fromSkill)
 {
     if (dungeonBoost.Properties.Type == DungeonBoostType.EmptyBox)
     {
         ActiveDungeon activeDungeon  = GameLogic.Binder.GameState.ActiveDungeon;
         Player        player         = GameLogic.Binder.GameState.Player;
         double        baseCoinReward = App.Binder.ConfigMeta.MinionCoinDropCurve(activeDungeon.Floor);
         double        v = player.calculateStandardCoinRoll(baseCoinReward, GameLogic.CharacterType.UNSPECIFIED, 1) * App.Binder.ConfigMeta.DUNGEON_BOOST_EMPTY_BOX_COIN_GAIN_CONTROLLER;
         if (activeDungeon.hasDungeonModifier(DungeonModifierType.DungeonBoostBoxBonusCoins))
         {
             v *= ConfigDungeonModifiers.DungeonBoostBoxBonusCoins.CoinMultiplier;
         }
         v = MathUtil.Clamp(v, 1.0, double.MaxValue);
         CmdGainResources.ExecuteStatic(player, ResourceType.Coin, v, true, "TRACKING_ID_GAMEPLAY_LOOT_GAIN", new Vector3?(dungeonBoost.Transform.position));
     }
 }
コード例 #21
0
        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();
                }
            }
        }
コード例 #22
0
        private void onGameplayStarted(ActiveDungeon activeDungeon)
        {
            Player player = GameLogic.Binder.GameState.Player;

            this.unregisterAllHeroStatsTargets();
            this.registerHeroStatsTarget(player.ActiveCharacter.HeroStats);
            if (activeDungeon.ActiveTournament != null)
            {
                this.registerHeroStatsTarget(activeDungeon.ActiveTournament.HeroStats);
            }
            for (int i = 0; i < this.m_heroStats.Count; i++)
            {
                HeroStats stats = this.m_heroStats[i];
                stats.HighestFloor           = Mathf.Max(stats.HighestFloor, activeDungeon.Floor);
                stats.HighestTokenMultiplier = Math.Max(stats.HighestTokenMultiplier, player.getActiveTokenRewardFloorMultiplier());
            }
        }
コード例 #23
0
        protected void FixedUpdate()
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if (((activeDungeon != null) && (activeDungeon.ActiveRoom != null)) && (!activeDungeon.ActiveRoom.MainBossSummoned && !activeDungeon.WildBossMode))
            {
                for (int i = this.m_characters.Count - 1; i >= 0; i--)
                {
                    CharacterInstance c = this.m_characters[i];
                    if (((this.m_hpRegenNextTick[c] > 0f) && (Time.fixedTime >= this.m_hpRegenNextTick[c])) && (c.CurrentHp < c.MaxLife(true)))
                    {
                        CmdGainHp.ExecuteStatic(c, c.MaxLife(true) * ConfigGameplay.PASSIVE_HP_REGEN_PCT_PER_TICK, true);
                        this.m_hpRegenNextTick[c] = Time.fixedTime + ConfigGameplay.PASSIVE_HP_REGEN_TICK_INTERVAL;
                    }
                }
            }
        }
コード例 #24
0
        protected void FixedUpdate()
        {
            ActiveDungeon activeDungeon = Binder.GameState.ActiveDungeon;

            if ((activeDungeon != null) && (activeDungeon.CurrentGameplayState == GameplayState.ACTION))
            {
                CharacterInstance activeCharacter = Binder.GameState.Player.ActiveCharacter;
                if (this.m_queue.Count > 0)
                {
                    Vector3 targetWorldPt = this.m_queue.Peek().Value;
                    if (activeCharacter.canBlink(targetWorldPt))
                    {
                        this.m_queue.Dequeue();
                        this.blinkCharacter(activeCharacter, targetWorldPt, 0f);
                    }
                }
            }
        }
コード例 #25
0
        protected void FixedUpdate()
        {
            ActiveDungeon activeDungeon = Binder.GameState.ActiveDungeon;

            if ((activeDungeon != null) && (activeDungeon.ActiveRoom != null))
            {
                this.freeOccupiedNodes();
                for (int i = 0; i < activeDungeon.ActiveRoom.ActiveCharacters.Count; i++)
                {
                    CharacterInstance instance = activeDungeon.ActiveRoom.ActiveCharacters[i];
                    if (!instance.IsDead)
                    {
                        uint tag = 0;
                        if (instance.IsSupport)
                        {
                            tag = 0x1f;
                        }
                        else if (instance.IsPlayerCharacter)
                        {
                            tag = 30;
                        }
                        else
                        {
                            tag = 0x1d;
                        }
                        NNInfo nearest = activeDungeon.ActiveRoom.AstarPath.GetNearest(instance.PhysicsBody.Transform.position, this.m_defaultAstarConstraint);
                        if (nearest.node != null)
                        {
                            this.occupyNode(nearest.node, tag);
                            if (!instance.IsPlayerCharacter)
                            {
                                List <GraphNode> list = this.getNodeConnections(nearest);
                                for (int j = 0; j < list.Count; j++)
                                {
                                    this.occupyNode(list[j], tag);
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #26
0
ファイル: PerkSystem.cs プロジェクト: hackerlank/UnityGameSrc
        private void onPlayerCharacterDealedDamage(CharacterInstance sourceCharacter, CharacterInstance targetCharacter, Vector3 worldPos, double amount, bool critted, bool damageReduced, DamageType damageType, SkillType fromSkill)
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if ((damageType == DamageType.Melee) && activeDungeon.hasDungeonModifier(DungeonModifierType.MonsterWeaponDeflect))
            {
                double baseAmount = MathUtil.Clamp(Math.Round((double)(amount * ConfigDungeonModifiers.MonsterWeaponDeflect.DeflectionPct)), 0.0, double.MaxValue);
                if (baseAmount > 0.0)
                {
                    CmdDealDamageToCharacter.ExecuteStatic(targetCharacter, sourceCharacter, baseAmount, false, damageType, SkillType.NONE);
                }
            }
            if ((damageType == DamageType.Magic) && activeDungeon.hasDungeonModifier(DungeonModifierType.MonsterSkillDeflect))
            {
                double num2 = MathUtil.Clamp(Math.Round((double)(amount * ConfigDungeonModifiers.MonsterSkillDeflect.DeflectionPct)), 0.0, double.MaxValue);
                if (num2 > 0.0)
                {
                    CmdDealDamageToCharacter.ExecuteStatic(targetCharacter, sourceCharacter, num2, false, damageType, SkillType.NONE);
                }
            }
        }
コード例 #27
0
        protected void FixedUpdate()
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if (((activeDungeon != null) && (activeDungeon.ActiveRoom != null)) && (activeDungeon.CurrentGameplayState == GameplayState.ACTION))
            {
                for (int j = 0; j < activeDungeon.ActiveRoom.ActiveCharacters.Count; j++)
                {
                    CharacterInstance instance = activeDungeon.ActiveRoom.ActiveCharacters[j];
                    instance.AttackCooldownTimer = Mathf.Clamp(instance.AttackCooldownTimer - (Time.deltaTime * Time.timeScale), 0f, float.MaxValue);
                }
            }
            if ((activeDungeon != null) && (activeDungeon.ActiveRoom != null))
            {
                bool isDead = activeDungeon.PrimaryPlayerCharacter.IsDead;
                for (int k = 0; k < activeDungeon.ActiveRoom.ActiveCharacters.Count; k++)
                {
                    CharacterInstance target = activeDungeon.ActiveRoom.ActiveCharacters[k];
                    if (target.IsSupport && (isDead || ((target.FutureTimeOfDeath > 0f) && (Time.fixedTime > target.FutureTimeOfDeath))))
                    {
                        this.killCharacter(target, target, false, false, SkillType.NONE);
                    }
                }
            }
            for (int i = this.m_characterDestructionQueue.Count - 1; i >= 0; i--)
            {
                Dictionary <CharacterInstance, float> dictionary;
                CharacterInstance instance4;
                CharacterInstance c    = this.m_characterDestructionQueue[i];
                float             num4 = dictionary[instance4];
                (dictionary = this.m_characterDestructionTimers)[instance4 = c] = num4 - (Time.deltaTime * Time.timeScale);
                if (this.m_characterDestructionTimers[c] <= 0f)
                {
                    CmdDestroyCharacter.ExecuteStatic(c);
                    this.m_characterDestructionTimers.Remove(c);
                    this.m_characterDestructionQueue.Remove(c);
                }
            }
        }
コード例 #28
0
        protected void FixedUpdate()
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if (((activeDungeon != null) && (activeDungeon.ActiveRoom != null)) && (activeDungeon.CurrentGameplayState == GameplayState.ACTION))
            {
                Player            player          = GameLogic.Binder.GameState.Player;
                CharacterInstance activeCharacter = player.ActiveCharacter;
                for (int i = 0; i < ConfigBoosts.ALL_BOOSTS.Count; i++)
                {
                    BoostType boost = ConfigBoosts.ALL_BOOSTS[i];
                    if (player.boostEntryExists(boost))
                    {
                        float num2 = player.getRemainingBoostSeconds(boost);
                        if (num2 > 0f)
                        {
                            bool flag = GameLogic.Binder.BuffSystem.hasBuffFromBoost(activeCharacter, boost);
                            if (!activeCharacter.IsDead && !flag)
                            {
                                ConfigBoosts.SharedData data = ConfigBoosts.SHARED_DATA[boost];
                                Buff buff = new Buff();
                                buff.FromBoost       = boost;
                                buff.DurationSeconds = data.DurationSeconds;
                                buff.TimeRemaining   = num2;
                                buff.HudSprite       = data.Sprite.SpriteId;
                                buff.BaseStat1       = data.BaseStat1;
                                buff.BaseStat2       = data.BaseStat2;
                                buff.Modifier        = data.Modifier;
                                GameLogic.Binder.BuffSystem.startBuff(activeCharacter, buff);
                            }
                        }
                        else
                        {
                            CmdStopBoost.ExecuteStatic(player, boost);
                        }
                    }
                }
            }
        }
コード例 #29
0
        private void onCharacterHordeSpawned(Room.Spawnpoint spawnpoint, bool isBoss)
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;
            Player        player        = GameLogic.Binder.GameState.Player;

            activeDungeon.ActiveRoom.flagAllDungeonBoostsForOffscreenDestroy();
            Room.Spawnpoint             islandSpawnpoint = activeDungeon.ActiveRoom.getClosestIslandSpawnpoint(spawnpoint.WorldPt);
            List <MarkerSpawnPointDeco> list             = activeDungeon.ActiveRoom.getDecoSpawnpointMarkersForIsland(islandSpawnpoint);

            if ((App.Binder.ConfigMeta.DUNGEON_BOOST_BOX_SPAWN_ENABLED_DURING_FRENZY || !GameLogic.Binder.FrenzySystem.isFrenzyActive()) && (islandSpawnpoint != this.m_lastIslandSpawnpointForBoxes))
            {
                this.m_validDecoSpawnpoints.Clear();
                for (int i = 0; i < list.Count; i++)
                {
                    MarkerSpawnPointDeco item = list[i];
                    if (ConfigDungeons.DUNGEON_DECO_CATEGORIES_AS_DUNGEON_BOOST_SPAWNPOINTS.Contains(item.DecoCategoryType) && (item.ActiveDeco != null))
                    {
                        this.m_validDecoSpawnpoints.Add(item);
                    }
                }
                int num2 = ConfigDungeonBoosts.GetBoxSpawnCountForFloor(player, activeDungeon.Floor, this.m_validDecoSpawnpoints.Count);
                for (int j = 0; (j < this.m_validDecoSpawnpoints.Count) && (j < num2); j++)
                {
                    MarkerSpawnPointDeco deco2 = this.m_validDecoSpawnpoints[j];
                    Vector3 position           = deco2.transform.position;
                    Vector3 vector4            = islandSpawnpoint.WorldPt - deco2.transform.position;
                    Vector3 normalized         = vector4.normalized;
                    Vector3 worldPt            = position + ((Vector3)(normalized * 1f));
                    float   fallbackStep       = ConfigDungeonBoosts.BOX_RADIUS;
                    worldPt   = activeDungeon.ActiveRoom.calculateNearestEmptySpot(worldPt, normalized, 1f, fallbackStep, 6f, new int?(Layers.DungeonBoostEmptySpotLayerMask));
                    worldPt.y = activeDungeon.ActiveRoom.WorldGroundPosY;
                    SpawnBox(CmdRollDungeonBoostBoxTable.ExecuteStatic(App.Binder.ConfigLootTables.DungeonBoostBoxTable, player), player, worldPt);
                }
            }
            this.m_lastIslandSpawnpointForBoxes = islandSpawnpoint;
        }
コード例 #30
0
        protected void FixedUpdate()
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if ((activeDungeon != null) && (activeDungeon.CurrentGameplayState == GameplayState.ACTION))
            {
                CharacterInstance primaryPlayerCharacter = GameLogic.Binder.GameState.ActiveDungeon.PrimaryPlayerCharacter;
                if (this.isFrenzyActive())
                {
                    for (int i = 0; i < this.m_activeFrenzyBuffs.Count; i++)
                    {
                        GameLogic.Binder.BuffSystem.startOrRefreshBuff(this.m_activeFrenzyBuffs[i], 1f);
                    }
                    if ((primaryPlayerCharacter.TargetCharacter != null) && primaryPlayerCharacter.canBlink(primaryPlayerCharacter.TargetCharacter.PhysicsBody.Transform.position))
                    {
                        GameLogic.Binder.BlinkSystem.blinkCharacter(primaryPlayerCharacter, primaryPlayerCharacter.TargetCharacter.PhysicsBody.Transform.position, 0f);
                    }
                    if (this.m_frenzyTimer.tick(Time.deltaTime * Time.timeScale))
                    {
                        this.deactivateFrenzy();
                    }
                }
            }
        }