static void Postfix(RelicManager __instance, CardManager.DiscardCardParams discardCardParams)
        {
            if (!discardCardParams.wasPlayed || !discardCardParams.discardCard.HasTrait(typeof(CardTraitExhaustState)))
            {
                return;
            }

            CombatManager combatManager;

            ProviderManager.TryGetProvider <CombatManager>(out combatManager);

            CardManager cardManager;

            ProviderManager.TryGetProvider <CardManager>(out cardManager);
            foreach (var card in cardManager.GetHand())
            {
                foreach (var trait in card.GetTraitStates())
                {
                    CardTraitSuppressExhaust cardTraitSuppressExhaust;
                    if ((cardTraitSuppressExhaust = (trait as CardTraitSuppressExhaust)) != null)
                    {
                        discardCardParams.outSuppressTraitOnDiscard = typeof(CardTraitExhaustState);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private IEnumerator OnEnemyDeath(CharacterDeathParams deathParams)
        {
            if (deathParams == null)
            {
                yield break;
            }
            CharacterState attackingCharacter = deathParams.attackingCharacter;
            RelicManager   relicManager       = deathParams.relicManager;
            SaveManager    saveManager        = deathParams.saveManager;

            if (attackingCharacter != null && attackingCharacter.IsPyreHeart())
            {
                if (!saveManager.PreviewMode)
                {
                    //attackingCharacter.GetCharacterUI().ShowEffectVFX(attackingCharacter, _srcRelicEffectData.GetAppliedVfx());
                    if (!ProviderManager.TryGetProvider <PlayerManager>(out PlayerManager playerManager))
                    {
                        yield break;
                    }
                    playerManager.AdjustGold(goldAmount, isReward: false);
                    deathParams.deadCharacter.ShowNotification("HudNotification_TreasureHeroTriggered".Localize(new LocalizedInteger(deathParams.saveManager.GetAdjustedGoldAmount(goldAmount, isReward: false))), PopupNotificationUI.Source.General);

                    NotifyRelicTriggered(relicManager, attackingCharacter);
                }
            }
        }
Exemplo n.º 3
0
    // Use this for initialization
    IEnumerator Start()
    {
        yield return new WaitForSeconds(.05f);
        Lighton = GetComponent<Light>();
        Player = CharController.Instance.transform.gameObject;
        myMan = Player.GetComponent<RelicManager>();

        if (GuideBehavior == GuideType.WallJump)
        {
            Lighton.color = Color.green;
        }

        if (GuideBehavior == GuideType.DoubleJump)
        {
            Lighton.color = Color.yellow;
        }

        if (GuideBehavior == GuideType.Dash)
        {
            Lighton.color = Color.red;
        }

        if (GuideBehavior == GuideType.Slash)
        {
            Lighton.color = Color.cyan;
        }
    }
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        manager = GameObject.FindGameObjectWithTag("Player").GetComponent <RelicManager> ();

        Slash    = transform.FindChild("Canvas/Base/Slash/Image").gameObject.GetComponent <Image>();
        Jump     = transform.FindChild("Canvas/Base/Jump/Image").gameObject.GetComponent <Image>();
        WallJump = transform.FindChild("Canvas/Base/WallJump/Image").gameObject.GetComponent <Image>();
        Dash     = transform.FindChild("Canvas/Base/Dash/Image").gameObject.GetComponent <Image>();
    }
Exemplo n.º 5
0
        public override string GetCardText(CardEffectState cardEffectState, RelicManager relicManager = null)
        {
            LocalizationUtil.GeneratedTextDisplay = LocalizationUtil.GeneratedTextDisplayType.Show;
            var status = GetStatusEffectStack(cardEffectState);

            if (status == null)
            {
                return("Apply a status dependent on your paired clan.<br><i>(See tooltips)</i>");
            }
            return("Apply " + StatusEffectManager.GetLocalizedName(status.statusId, status.count, true));
        }
        public override string GetCardText(CardEffectState cardEffectState, RelicManager relicManager = null)
        {
            int damage = 0;

            try
            {
                damage = GetDamageAmount();
            }
            catch (System.Exception)
            {
            }
            return("Flashfire_EffectDesc".Localize(new LocalizedIntegers(damage)));
        }
Exemplo n.º 7
0
    // Use this for initialization
    void Start()
    {
        rb      = this.gameObject.GetComponent <Rigidbody> ();
        manager = this.GetComponent <RelicManager> ();
        lg      = GameObject.Find("LevelGenerator").GetComponent <LevelGenerator>();
        //	ATTENSION - from this line forth, nothing makes sense. The manager can be debugged, but no method within it can be called, without a null-point-exception. After 1,5 hours of trying to resolve this error, I give up. /Nils
        //manager.UpdateFreezeRotation (false);
        movingToTarget = false;

        minX = 0; maxX = 10.5f; minY = 0; minZ = -150;         //Bounds - should be put in a LevelManager script

        camera = GameObject.Find("LeapControllerBlockHand");
    }
Exemplo n.º 8
0
        private void Inventory_Load(object sender, EventArgs e)
        {
            p  = SaveManager.LoadGame();
            rm = SaveManager.LoadRelicManager();

            if (p.BountyKeys.Count > 0 || p.EXBountyKeys.Count > 0)
            {
                checkKeysToolStripMenuItem.Enabled = true;
            }

            if (p.Tier >= 20)
            {
                relicsToolStripMenuItem.Visible = true;
            }

            mm = new MusicManager();
            mm.SetIdleTheme(p.Tier);
            musicBot.RunWorkerAsync();
            UpdateInventory();
        }
Exemplo n.º 9
0
    // Use this for initialization
    void Awake()
    {
        audioManager = GameObject.Find("AudioManager").GetComponent <AudioManager> ();

        health  = startHealth;
        rb      = GetComponent <Rigidbody> ();
        manager = GetComponent <RelicManager> ();
        ps      = this.gameObject.GetComponent <PlayerScore> ();

        sphere = GameObject.Find("RelicSphere");

        specularColor = new Color(1f, 0.8f, 0.3f, 1f);      // new Color (1, 0.5f, 0.5f);//
        baseColor     = new Color(1f, 0.7f, 0.2f, 1f);      // new Color (1, 0.5f, 0.5f);//

        //Get the core ball of the hand
        handCore = GameObject.Find("ball");
        trail    = GameObject.Find("RelicSphere/trailRelic").GetComponent <ParticleSystem>();
        glow     = GameObject.Find("RelicSphere/glowRelic").GetComponent <ParticleSystem>();

        impactSparks = GameObject.Find("RelicSphere/impactSparks");
        impactSparks.SetActive(false);
    }
Exemplo n.º 10
0
 static bool Prefix(RelicEffectAddTrait __instance, CardState cardState, SaveManager saveManager, CardManager cardManager, RelicManager relicManager)
 {
     if (cardManager == null)
     {
         return(false);
     }
     return(true);
 }
 public override string GetCurrentEffectText(CardStatistics cardStatistics, SaveManager saveManager, RelicManager relicManager)
 {
     if (cardStatistics != null && cardStatistics.GetStatValueShouldDisplayOnCardNow(base.StatValueData))
     {
         return("CardTraitScalingReturnConsumedCards_CurrentScaling_CardText".Localize(new LocalizedIntegers(GetAdditionalCardCount(cardStatistics))));
     }
     return(string.Empty);
 }
Exemplo n.º 12
0
 public override string GetCurrentEffectText(CardStatistics cardStatistics, SaveManager saveManager, RelicManager relicManager)
 {
     //if (cardStatistics.GetStatValueShouldDisplayOnCardNow(base.StatValueData))
     //{
     //	return string.Format("CardTraitScalingUpgradeUnitAttack_CurrentScaling_CardText".Localize(), GetMultiplier(cardStatistics));
     //}
     return(string.Empty);
 }
Exemplo n.º 13
0
        public override string GetCurrentEffectText(CardStatistics cardStatistics, SaveManager saveManager, RelicManager relicManager)
        {
            int baseDamage  = GetTotalPyreDamage();
            int extraDamage = GetExtraDamage(GetCard());

            // The card text must be different if we're in combat or out of it
            if (cardStatistics != null && cardStatistics.GetIsInActiveBattle())
            {
                // In combat
                if (extraDamage > 0)
                {
                    return(string.Format("Pyreboost_CardText_InsideCombat_WithUpgrades".Localize(), extraDamage, "tempUpgradeHighlight", baseDamage));
                }
                else
                {
                    return(string.Format("Pyreboost_CardText_InsideCombat_NoUpgrades".Localize(), baseDamage));
                }
            }

            // Out of combat
            if (extraDamage > 0)
            {
                return(string.Format(("Pyreboost_CardText_OutsideCombat").Localize(), extraDamage, "tempUpgradeHighlight"));
            }

            return(string.Empty);
        }
 // This exists because the base form implemented in the game (but unused) is broken and causes problems with CardStatistics counting
 public override IEnumerator OnCardDiscarded(CardManager.DiscardCardParams discardCardParams, CardManager cardManager, RelicManager relicManager, CombatManager combatManager)
 {
     if (discardCardParams.wasPlayed)
     {
         int additionalCardCount = GetAdditionalCardCount(cardManager.GetCardStatistics());
         for (int i = 0; i < additionalCardCount; i++)
         {
             if (!cardManager.RestoreNextExhaustedCard())
             {
                 break;
             }
         }
     }
     yield break;
 }
Exemplo n.º 15
0
        /// <summary>
        /// Gets a list of all cards added to the given card pool by mods
        /// which satisfy the constraints specified by the mask data passed in.
        /// Cards which naturally appear in the pool will not be returned.
        /// </summary>
        /// <param name="cardPoolID">ID of the card pool to get cards for</param>
        /// <param name="paramCardFilter">Constraints to satisfy</param>
        /// <param name="relicManager">a RelicManager</param>
        /// <returns>A list of cards added to the card pool with given ID by mods, all of which satisfy the given constraints.</returns>
        public static List <CardData> GetCardsForPoolSatisfyingConstraints(string cardPoolID, CardUpgradeMaskData paramCardFilter, RelicManager relicManager)
        {
            var allValidCards = GetCardsForPool(cardPoolID);
            var validCards    = new List <CardData>();

            foreach (CardData cardData in allValidCards)
            {
                if (paramCardFilter == null)
                {
                    validCards.Add(cardData);
                }
                else if (paramCardFilter.FilterCard <CardData>(cardData, relicManager))
                {
                    validCards.Add(cardData);
                }
            }
            return(validCards);
        }
 public override string GetCardText(CardEffectState cardEffectState, RelicManager relicManager = null)
 {
     return("GET CARD TEXT");
 }
Exemplo n.º 17
0
        public override IEnumerator OnCardDiscarded(CardManager.DiscardCardParams discardCardParams, CardManager cardManager, RelicManager relicManager, CombatManager combatManager)
        {
            foreach (CardState item in cardManager.GetAllCards())
            {
                if (item.GetTemporaryCardStateModifiers().HasUpgrade(upgrade))
                {
                    item.GetTemporaryCardStateModifiers().RemoveUpgrade(upgrade);
                }
            }

            yield break;
        }
        public override int OnStatusEffectApplied(CharacterState affectedCharacter, CardState thisCard, CardManager cardManager, RelicManager relicManager, string statusId, int sourceStacks = 0)
        {
            int statValue  = cardManager.GetCardStatistics().GetStatValue(base.StatValueData);
            int multiplier = GetParamInt();

            if (thisCard.HasTrait(typeof(CardTraitJuice)))
            {
                multiplier *= 2;
            }

            return(statValue * multiplier);
        }
Exemplo n.º 19
0
 static void Postfix(ref bool __result, CardPool paramCardPool, CardUpgradeMaskData paramCardFilter, RelicManager relicManager, ref List <CardData> toProcessCards)
 {
     if (paramCardPool != null)
     {
         List <CardData> customCardsToAddToPool = CustomCardPoolManager.GetCardsForPoolSatisfyingConstraints(paramCardPool.name, paramCardFilter, relicManager);
         toProcessCards.AddRange(customCardsToAddToPool);
         __result = toProcessCards.Count > 0;
     }
 }
Exemplo n.º 20
0
 public static void SaveRelicManager(RelicManager rm)
 {
     EncryptionManager.EncryptFile(rPath, rm);
 }
Exemplo n.º 21
0
 public override IEnumerator OnCharacterAdded(CharacterState character, CardState fromCard, RelicManager relicManager, SaveManager saveManager, PlayerManager playerManager, RoomManager roomManager, CombatManager combatManager, CardManager cardManager)
 {
     if (character.GetTeamType() == Team.Type.Heroes)
     {
         character.AddDeathSignal(OnEnemyDeath);
     }
     yield break;
 }
        public override string GetCurrentEffectText(CardStatistics cardStats, SaveManager saveManager, RelicManager relicManager)
        {
            int extraDamage = GetExtraDamage(GetCard());

            if (cardStats == null)
            {
                if (extraDamage > 0)
                {
                    return(string.Format("CardTraitScalingAddDamage_ExtraDamage_XCostOutsideBattle_CardText".Localize(), extraDamage, "tempUpgradeHighlight"));
                }
                return(string.Empty);
            }
            int baseDamage = GetBaseDamage(GetCard());

            if (extraDamage > 0)
            {
                if (!CardStatistics.GetTrackedValueIsValidOutsideBattle(base.StatValueData.trackedValue) && !cardStats.GetIsInActiveBattle())
                {
                    return(string.Format("CardTraitScalingAddDamage_ExtraDamage_XCostOutsideBattle_CardText".Localize(), extraDamage, "tempUpgradeHighlight"));
                }
                return(string.Format("CardTraitScalingAddDamage_ExtraDamage_CardText".Localize(new LocalizedInteger(baseDamage, baseDamage + extraDamage)), extraDamage, "tempUpgradeHighlight"));
            }
            if (!cardStats.GetStatValueShouldDisplayOnCardNow(base.StatValueData))
            {
                return(string.Empty);
            }
            return("CardTraitScalingAddDamage_CurrentScaling_CardText".Localize(new LocalizedIntegers(baseDamage)));
        }
Exemplo n.º 23
0
        private void DungeonGUI_Load(object sender, EventArgs e)
        {
            p = SaveManager.LoadGame();

            RelicManager rm = SaveManager.LoadRelicManager();

            relic = rm.Current;

            ProfilePic.Image = Image.FromFile(p.Picture);

            RegisterPlayerOffensives();

            RegisterPlayerPassives();

            RegisterBountyKeys();

            RegisterEXBountyKeys();

            if (p.GodLordKeys > 0 && d.CanUseBountyKey())
            {
                useElderKeyToolStripMenuItem.Enabled = true;
            }

            RegisterItems();

            int hp = p.GetHP() + p.Set.GetDefense() + p.stats[Stat.DEFENSE];

            PlayerHealth.Maximum = hp;
            PlayerHealth.Value   = hp;

            if (relic != null)
            {
                NameBox.Text = $"{rm.Current.ToString()} {p.Name}";
            }
            else
            {
                NameBox.Text = $"[None] {p.Name}";
            }

            Text = $"Tier {d.tier} Dungeon";

            sbars.Add(SubBar1);
            sbars.Add(SubBar2);
            sbars.Add(SubBar3);
            sbars.Add(SubBar4);
            sbars.Add(SubBar5);
            sbars.Add(SubBar6);
            sbars.Add(SubBar7);
            sbars.Add(SubBar8);
            sbars.Add(SubBar9);
            sbars.Add(SubBar10);
            sbars.Add(SubBar11);
            sbars.Add(SubBar12);
            sbars.Add(SubBar13);
            sbars.Add(SubBar14);
            sbars.Add(SubBar15);
            sbars.Add(SubBar16);
            sbars.Add(SubBar17);
            sbars.Add(SubBar18);
            sbars.Add(SubBar19);

            mm.SetFloorSong(d.tier);

            mm.SetBossSong(r.Next(1, d.tier));

            mm.SetInvaderSong(d.tier);

            mm.SetBountySong(d.tier);

            mm.SetEXSong();

            mm.PlayFloorSong();

            mm.SetElderSong(d.tier);

            FightsLeft.Text = $"Fights remaining: {d.GetFights()}";

            CurrentFight.Text = $"Current Fight: {d.GetCurrentFight()}";

            CreateEnemies();
        }
Exemplo n.º 24
0
 public override string GetCardText(CardEffectState cardEffectState, RelicManager relicManager = null)
 {
     LocalizationUtil.GeneratedTextDisplay = LocalizationUtil.GeneratedTextDisplayType.Show;
     return("Emberwave_Fib".Localize(new LocalizedIntegers(GetDamageAmount(cardEffectState))));
 }
 public bool ApplyCardStateModifiers(CardState cardState, SaveManager saveManager, CardManager cardManager, RelicManager relicManager)
 {
     // Unused. We use this interface mostly to trick the game into putting the tooltip we want onto the relic with minimal effort.
     return(false);
 }