Exemple #1
0
    void ActiveBash(Blessing _input)
    {
        if (pStats.stamina >= 2)
        {
            if (((Input.GetButtonDown("Skill_Use_Left") || SwipeControls.SwipeUp) && blessing_inven[0].GetBlessingType() == _input.GetBlessingType()) ||
                ((Input.GetButtonDown("Skill_Use_Right") || SwipeControls.SwipeDown) && blessing_inven[1].GetBlessingType() == _input.GetBlessingType()))
            {
                List <List <GameObject> > list = SpawnerManager.Instance.GetAllEntity();

                foreach (List <GameObject> i in list)
                {
                    foreach (GameObject obj in i)
                    {
                        Vector3 target = new Vector3(transform.position.x, 0, transform.position.z) - new Vector3(obj.transform.position.x, 0, obj.transform.position.z);
                        float   Angle  = Vector3.Angle(model.forward, target);

                        if (Angle < 90f && Angle > -90f)
                        {
                            if (obj.GetComponent <EnemyScript>() != null)
                            {
                                obj.GetComponent <EnemyScript>().SetKnockBack(-target.normalized);
                            }
                        }
                    }
                }

                pStats.stamina -= 2;
            }
        }
    }
Exemple #2
0
 public Weapon(string name, string id = null,
               bool offhand           = false, int power           = 0, int weight = 0,
               Innate innate          = null, Blessing blessing    = null,
               Innate offInnate       = null, Blessing offBlessing = null) : base(name, id, power, weight, innate, blessing)
 {
     IsOffhand   = offhand;
     OffInnate   = offInnate ?? new Innate();
     OffBlessing = offBlessing ?? new Blessing();
 }
Exemple #3
0
    // Use this for initialization
    void Start()
    {
        blessing_inven[0] = new Blessing();
        blessing_inven[0].SetBlessingType(Blessing.TYPE.SMITE);   //SET BLESSING TYPE TO HEALING

        blessing_inven[1] = new Blessing();
        blessing_inven[1].SetBlessingType(Blessing.TYPE.ULT_DEF);   //SET BLESSING TYPE TO NONE

        // Debug.Log(gameObject.GetHashCode());
    }
Exemple #4
0
 public void SetPlayerBlessing(bool set_first_slot, Blessing _input)
 {
     if (set_first_slot)
     {
         blessing_inven[0] = _input;
     }
     else
     {
         blessing_inven[1] = _input;
     }
 }
    public static ToolTip GenerateBlessingToolTip(Blessing blessing)
    {
        var fontSizeToolTipname       = (double)Application.Current.FindResource("FontSizeToolTipName");
        var fontFamilyRegularDemiBold = (FontFamily)Application.Current.FindResource("FontRegularDemiBold");

        var blessingToolTip = new ToolTip();

        var blessingToolTipBlock = new TextBlock
        {
            Style = (Style)Application.Current.FindResource("ToolTipTextBlockBase")
        };

        if (blessing != null)
        {
            blessingToolTip.BorderBrush = ColorsHelper.GetRarityColor(blessing.Rarity);

            blessingToolTipBlock.Inlines.Add(new Run($"{blessing.Name}")
            {
                FontSize = fontSizeToolTipname
            });
            blessingToolTipBlock.Inlines.Add(new LineBreak());
            blessingToolTipBlock.Inlines.Add(new Run($"*{blessing.RarityString}*")
            {
                Foreground = ColorsHelper.GetRarityColor(blessing.Rarity),
                FontFamily = fontFamilyRegularDemiBold
            });

            blessingToolTipBlock.Inlines.Add(new LineBreak());
            blessingToolTipBlock.Inlines.Add(GenerateTextSeparator());
            blessingToolTipBlock.Inlines.Add(new LineBreak());

            blessingToolTipBlock.Inlines.Add(new Run($"{blessing.Description}"));

            blessingToolTipBlock.Inlines.Add(new LineBreak());
            blessingToolTipBlock.Inlines.Add(GenerateTextSeparator());
            blessingToolTipBlock.Inlines.Add(new LineBreak());

            blessingToolTipBlock.Inlines.Add(new Run($"{blessing.Lore}")
            {
                FontFamily = (FontFamily)Application.Current.FindResource("FontRegularItalic"),
                Foreground = (SolidColorBrush)Application.Current.FindResource("BrushGray3")
            });
        }
        else
        {
            blessingToolTipBlock.Text = "No blessing is currently active";
            blessingToolTip.Style     = (Style)Application.Current.FindResource("ToolTipSimple");
        }

        blessingToolTip.Content = blessingToolTipBlock;

        return(blessingToolTip);
    }
Exemple #6
0
 public override string ToJson()
 {
     return("{" +
            "\"id\" : " + "\"" + Id + "\", " +
            "\"name\" : " + "\"" + Name + "\", " +
            "\"power\" : " + Power + ", " +
            "\"weight\" : " + Weight + ", " +
            "\"isOffHand\" : " + (IsOffhand? "true" : "false") + ", " +
            "\"innate\" : " + Innate.ToJson() + ", " +
            "\"blessing\" : " + Blessing.ToJson() + ", " +
            "\"offInnate\" : " + OffInnate.ToJson() + ", " +
            "\"offBlessing\" : " + OffBlessing.ToJson() + "}");
 }
Exemple #7
0
    public void Reset()
    {
        pStatsLevel = new List <PlayerStatisticsLevel>();
        pStatsLevel.Add(new PlayerStatisticsLevel("Weapon", 0, 100, 0, 100));
        pStatsLevel.Add(new PlayerStatisticsLevel("Armor", 0, 50, 0, 100));
        pStatsLevel.Add(new PlayerStatisticsLevel("Stamina", 0, 100, 0, 100, 1));
        pStatsLevel.Add(new PlayerStatisticsLevel("Strength", 0, 100, 0, 100));

        blessing_inven[0] = new Blessing();
        blessing_inven[0].SetBlessingType(Blessing.TYPE.REGEN);   //SET BLESSING TYPE TO HEALING

        blessing_inven[1] = new Blessing();
        blessing_inven[1].SetBlessingType(Blessing.TYPE.NONE);   //SET BLESSING TYPE TO NONE
    }
    private void AddNewObjectButton_Click(object sender, RoutedEventArgs e)
    {
        Save();

        var nextId = (GameAssets.Blessings.Max(x => x.Id as int?) ?? 0) + 1;

        _dataContext = new Blessing
        {
            Id = nextId
        };
        ContentSelectionBox.SelectedIndex = -1;
        RefreshStaticValuesPanel();

        DeleteObjectButton.Visibility = Visibility.Visible;
    }
Exemple #9
0
    void ActiveDash(Blessing _input)
    {
        if (pStats.stamina >= 1 && !sm.IsCurrentState("Dash"))
        {
            if (((Input.GetButtonDown("Skill_Use_Left") || SwipeControls.SwipeUp) && blessing_inven[0].GetBlessingType() == _input.GetBlessingType()) ||
                ((Input.GetButtonDown("Skill_Use_Right") || SwipeControls.SwipeDown) && blessing_inven[1].GetBlessingType() == _input.GetBlessingType()))
            {
                //print("BLESSING TPYE: " + _input.GetBlessingType());
                //print("BLESSING SLOT 0: " + blessing_inven[0].GetBlessingType());
                //print("BLESSING SLOT 1: " + blessing_inven[1].GetBlessingType());

                sm.SetNextState("Dash");
                pStats.stamina -= 1;
            }
        }
    }
Exemple #10
0
    public override void OnBlessingStarted(Blessing blessing)
    {
        if (_timer.IsEnabled)
        {
            _timer.Stop();
            User.Instance.CurrentHero.ClickDamage     -= ClickDamageIncrease;
            User.Instance.CurrentHero.AuraAttackSpeed -= AuraSpeedIncrease;
        }

        _timer.Interval = TimeSpan.FromSeconds(blessing.Duration);
        _timer.Start();

        User.Instance.CurrentHero.ClickDamage     += ClickDamageIncrease;
        User.Instance.CurrentHero.AuraAttackSpeed += AuraSpeedIncrease;

        base.OnUnequip();
    }
    private void ContentSelectionBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        var selectedName = (e.Source as ComboBox)?.SelectedValue?.ToString();

        if (selectedName is null)
        {
            return;
        }

        if (_dataContext is not null)
        {
            Save();
        }

        _dataContext = GameAssets.Blessings.FirstOrDefault(x => x.Name == selectedName);
        RefreshStaticValuesPanel();
        DeleteObjectButton.Visibility = Visibility.Visible;
    }
Exemple #12
0
    public Blessing CopyBlessing()
    {
        var copy = new Blessing
        {
            Id                      = Id,
            Name                    = Name,
            Type                    = Type,
            Rarity                  = Rarity,
            Duration                = Duration,
            Description             = Description,
            Lore                    = Lore,
            Buff                    = Buff,
            Value                   = Value,
            AchievementBonusGranted = false
        };

        return(copy);
    }
        public async Task <IActionResult> Edit(
            [FromServices] IMemoryCache cache,
            Blessing blessing,
            CancellationToken requestAborted)
        {
            if (ModelState.IsValid)
            {
                DbContext.Update(blessing);
                await DbContext.SaveChangesAsync(requestAborted);

                //Invalidate the cache entry as it is modified
                cache.Remove(GetCacheKey(blessing.BlessingId));
                return(RedirectToAction("Index"));
            }

            ViewBag.GenreId   = new SelectList(DbContext.Genres, "GenreId", "Name", blessing.GenreId);
            ViewBag.UnicornId = new SelectList(DbContext.Unicorns, "UnicornId", "Name", blessing.UnicornId);
            return(View(blessing));
        }
Exemple #14
0
    void ActiveUltDef(Blessing _input)
    {
        if (pStats.stamina >= 10)
        {
            if (((Input.GetButtonDown("Skill_Use_Left") || SwipeControls.SwipeUp) && blessing_inven[0].GetBlessingType() == _input.GetBlessingType() && _input.GetDuration() <= 0) ||
                ((Input.GetButtonDown("Skill_Use_Right") || SwipeControls.SwipeDown) && blessing_inven[1].GetBlessingType() == _input.GetBlessingType() && _input.GetDuration() <= 0))
            {
                pStats.stamina -= 10;
                _input.SetDuration(3);

                PlayerAudio.Ult();
                sm.SetNextState("UltDef");
            }
        }

        if (_input.GetDuration() > 0)
        {
            pStats.passiveDefMultiplyer += 100;
        }
    }
Exemple #15
0
    void ActiveWarCry(Blessing _input)
    {
        if (pStats.stamina >= 5)
        {
            if (((Input.GetButtonDown("Skill_Use_Left") || SwipeControls.SwipeUp) && blessing_inven[0].GetBlessingType() == _input.GetBlessingType() && _input.GetDuration() <= 0) ||
                ((Input.GetButtonDown("Skill_Use_Right") || SwipeControls.SwipeDown) && blessing_inven[1].GetBlessingType() == _input.GetBlessingType() && _input.GetDuration() <= 0))
            {
                pStats.stamina -= 5;
                _input.SetDuration(10);

                PlayerAudio.Roar();
                sm.SetNextState("WarCry");
            }
        }

        if (_input.GetDuration() > 0)
        {
            pStats.passiveDmgMultiplyer += 30;
            pStats.passiveDefMultiplyer += 40;
        }
    }
Exemple #16
0
    void ActiveSmite(Blessing _input)
    {
        if (pStats.stamina >= 5)
        {
            if (((Input.GetButtonDown("Skill_Use_Left") || SwipeControls.SwipeUp) && blessing_inven[0].GetBlessingType() == _input.GetBlessingType() && _input.GetDuration() <= 0) ||
                ((Input.GetButtonDown("Skill_Use_Right") || SwipeControls.SwipeDown) && blessing_inven[1].GetBlessingType() == _input.GetBlessingType() && _input.GetDuration() <= 0))
            {
                pStats.stamina -= 5;

                for (int i = 0; i < 3; ++i)
                {
                    GameObject obj = SpawnerManager.Instance.GetSkillEntityObjectFromPool("firebomb");
                    obj.GetComponent <SkillFireBomb>().SetParent(gameObject.GetInstanceID());

                    obj.transform.position = new Vector3(transform.position.x + (new IntRange(-2, 2).Random), 1f, transform.position.z + (new IntRange(-2, 2).Random));
                }

                sm.SetNextState("Smite");
            }
        }
    }
Exemple #17
0
    private void AssignRewards()
    {
        User.Instance.Achievements.NumericAchievementCollection[NumericAchievementType.QuestsCompleted]++;

        foreach (var materialRewardPattern in QuestRewardPatterns.Where(x => x.QuestRewardType == RewardType.Material))
        {
            var material = GameAssets.Materials.FirstOrDefault(x => x.Id == materialRewardPattern.QuestRewardId);
            material.AddItem(materialRewardPattern.Quantity);
        }

        foreach (var artifactRewardPattern in QuestRewardPatterns.Where(x => x.QuestRewardType == RewardType.Artifact))
        {
            var artifact = GameAssets.Artifacts.FirstOrDefault(x => x.Id == artifactRewardPattern.QuestRewardId);
            artifact.AddItem(artifactRewardPattern.Quantity);
        }

        foreach (var recipeRewardPattern in QuestRewardPatterns.Where(x => x.QuestRewardType == RewardType.Recipe))
        {
            var recipe = GameAssets.Recipes.FirstOrDefault(x => x.Id == recipeRewardPattern.QuestRewardId);
            recipe.AddItem(recipeRewardPattern.Quantity);
        }

        foreach (var ingotRewardPattern in QuestRewardPatterns.Where(x => x.QuestRewardType == RewardType.Ingot))
        {
            var ingot = GameAssets.Ingots.FirstOrDefault(x => x.Id == ingotRewardPattern.QuestRewardId);
            ingot.AddItem(ingotRewardPattern.Quantity);
        }

        foreach (var blessingRewardPattern in QuestRewardPatterns.Where(x => x.QuestRewardType == RewardType.Blessing))
        {
            Blessing.AskUserAndSwapBlessing(blessingRewardPattern.QuestRewardId);
        }

        var experienceReward = ExperienceHelper.CalculateQuestXpReward(Duration);

        User.Instance.CurrentHero.GainExperience(experienceReward);

        InterfaceHelper.RefreshCurrentEquipmentPanelTabOnCurrentPage();
        InterfaceHelper.RefreshQuestInterfaceOnCurrentPage();
    }
Exemple #18
0
        private async Task AwardUserAsync(Blessing blessing, SocketGuild guild, SocketGuildUser guildUser)
        {
            if (blessing.Type == BlessingType.Kiss)
            {
                var role = guild.GetRole(731807968940523560);
                await guildUser.AddRoleAsync(role);
            }

            var user = await _db.Users
                       .Include(u => u.Stats)
                       .Include(u => u.Stats.BlessingResults)
                       .FirstOrDefaultAsync(u => u.Id == guildUser.Id);

            if (user is null)
            {
                return;
            }

            user.Stats.Rolls++;
            user.Stats[blessing.Type].Amount++;

            await _db.SaveChangesAsync();
        }
    private void DeleteObjectButton_Click(object sender, RoutedEventArgs e)
    {
        Save();

        var objectToDelete = GameAssets.Blessings.FirstOrDefault(x => x.Id == int.Parse((_controls["IdBox"] as TextBox).Text));

        var result = MessageBox.Show($"Are you sure you want to delete {objectToDelete.Name}? This action will close ContentManager, check Logs directory (for missing references after deleting).", "Are you sure?", MessageBoxButton.YesNo, MessageBoxImage.Question);

        if (result == MessageBoxResult.No)
        {
            return;
        }

        GameAssets.Blessings.Remove(objectToDelete);

        PopulateContentSelectionBox();
        ContentSelectionBox.SelectedIndex = -1;
        _currentPanel.Children.Clear();
        DeleteObjectButton.Visibility = Visibility.Hidden;
        _dataContext = null;

        Application.Current.MainWindow.Close();
    }
        public async Task <IActionResult> Create(
            Blessing blessing,
            [FromServices] IMemoryCache cache,
            CancellationToken requestAborted)
        {
            if (ModelState.IsValid)
            {
                DbContext.Blessings.Add(blessing);
                await DbContext.SaveChangesAsync(requestAborted);

                var blessingData = new BlessingData
                {
                    Title = blessing.Title,
                    Url   = Url.Action("Details", "Store", new { id = blessing.BlessingId })
                };

                cache.Remove("latestBlessing");
                return(RedirectToAction("Index"));
            }

            ViewBag.GenreId   = new SelectList(DbContext.Genres, "GenreId", "Name", blessing.GenreId);
            ViewBag.UnicornId = new SelectList(DbContext.Unicorns, "UnicornId", "Name", blessing.UnicornId);
            return(View(blessing));
        }
 public override void OnBlessingStarted(Blessing blessing)
 {
     blessing.Buff = (int)Math.Ceiling(blessing.Buff * EffectivenessIncrease);
 }
Exemple #22
0
 public Trinket(string name, string id = null,
                int power     = 0, int weight = 0,
                Innate innate = null, Blessing blessing = null) : base(name, id, power, weight, innate, blessing)
 {
 }
Exemple #23
0
 void PassiveIronSkin(Blessing _input)
 {
     pStats.passiveDefMultiplyer += 10;
 }
Exemple #24
0
 void PassiveEvasion(Blessing _input)
 {
     pStats.passiveEvaMultiplyer += 10;
 }
	public Event InstantiateBlessing (Blessing blessingPrefab)
	{
		AudioManager.Instance.PlayBlessing ();
		return InstantiateEvent (blessingPrefab);
	}
Exemple #26
0
    private void BuyButton_Click(object sender, RoutedEventArgs e)
    {
        var b = sender as Button;
        var blessingBlueprint = b.CommandParameter as Blessing;

        if (User.Instance.Gold >= blessingBlueprint.Value)
        {
            var buyInlines = new List <Inline>
            {
                new Run("Are you sure you want to buy "),
                new Run($"{blessingBlueprint.Name}")
                {
                    FontFamily = (FontFamily)FindResource("FontRegularDemiBold")
                },
                new Run(" for "),
                new Run($"{blessingBlueprint.Value} gold")
                {
                    Foreground = (SolidColorBrush)FindResource("BrushGold"),
                    FontFamily = (FontFamily)FindResource("FontRegularDemiBold")
                },
                new Run("?")
            };

            var result = AlertBox.Show(buyInlines);

            if (result == MessageBoxResult.No)
            {
                return;
            }

            var hasBlessingActive = User.Instance.CurrentHero.Blessing != null;

            if (hasBlessingActive)
            {
                var doesUserWantToSwap = Blessing.AskUserAndSwapBlessing(blessingBlueprint.Id);

                if (doesUserWantToSwap == false)
                {
                    return;
                }
            }
            else
            {
                Blessing.AddOrReplaceBlessing(blessingBlueprint.Id);
            }

            (Application.Current.MainWindow as GameWindow).CreateFloatingTextUtility($"-{blessingBlueprint.Value}", (SolidColorBrush)FindResource("BrushGold"), FloatingTextHelper.GoldPositionPoint);

            User.Instance.Gold -= blessingBlueprint.Value;

            UpdatePriest();
        }
        else
        {
            var notEnoughGoldInlines = new List <Inline>
            {
                new Run("You do not have enough gold to buy this blessing.\nIt costs "),
                new Run($"{blessingBlueprint.Value} gold")
                {
                    Foreground = (SolidColorBrush)FindResource("BrushGold"),
                    FontFamily = (FontFamily)FindResource("FontRegularDemiBold")
                },
                new Run(".\nYou can get more gold by completing quests and selling loot from monsters and bosses.")
            };

            AlertBox.Show(notEnoughGoldInlines, MessageBoxButton.OK);
        }
    }
 // Used to trigger an effect upon gaining a blessing.
 // Triggered: when gaining a blessing, before increasing a hero's stats and starting the blessing timer.
 // blessing - blessing that is being gained.
 public virtual void OnBlessingStarted(Blessing blessing)
 {
 }
Exemple #28
0
        private static Blessing[] GetBlessings(string imgUrl, Dictionary <string, Genre> genres, Dictionary <string, Unicorn> unicorns)
        {
            var blessings = new Blessing[]
            {
                new Blessing {
                    Title = "The fiery one", Genre = genres["Dark Riders"], Price = 8.99M, Unicorn = unicorns["Adiana"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The cheerful one", Genre = genres["Dark Riders"], Price = 8.99M, Unicorn = unicorns["Alairia"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Fair and Beautiful", Genre = genres["Dark Riders"], Price = 8.99M, Unicorn = unicorns["Alanala"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Fair of face", Genre = genres["Dark Riders"], Price = 8.99M, Unicorn = unicorns["Albany"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The Truthful one", Genre = genres["Dark Riders"], Price = 8.99M, Unicorn = unicorns["Aletha"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "One who charms", Genre = genres["Dark Riders"], Price = 8.99M, Unicorn = unicorns["Alize"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Peaceful and Attractive", Genre = genres["Dark Riders"], Price = 8.99M, Unicorn = unicorns["Allena"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The Powerful one", Genre = genres["Dark Riders"], Price = 8.99M, Unicorn = unicorns["Amandaria"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The Eternal one", Genre = genres["Dark Riders"], Price = 8.99M, Unicorn = unicorns["Amara"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Strong and Courageous", Genre = genres["Dark Riders"], Price = 8.99M, Unicorn = unicorns["Andra"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The Angelic one", Genre = genres["MagiCorns"], Price = 8.99M, Unicorn = unicorns["Angelina"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Full of Grace", Genre = genres["MagiCorns"], Price = 8.99M, Unicorn = unicorns["Annamika"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Bright as a Star", Genre = genres["MagiCorns"], Price = 8.99M, Unicorn = unicorns["Astra"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Little blessed one", Genre = genres["MagiCorns"], Price = 8.99M, Unicorn = unicorns["Bennettia"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Simply beautiful", Genre = genres["MagiCorns"], Price = 8.99M, Unicorn = unicorns["Bellini"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "One who is blessed", Genre = genres["MagiCorns"], Price = 8.99M, Unicorn = unicorns["Benicia"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "White power", Genre = genres["MagiCorns"], Price = 8.99M, Unicorn = unicorns["Biancha"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Perfect joy", Genre = genres["MagiCorns"], Price = 8.99M, Unicorn = unicorns["Blissia"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Swift and strong", Genre = genres["Rainbow Unicorns"], Price = 8.99M, Unicorn = unicorns["Boaz"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The pretty one", Genre = genres["Rainbow Unicorns"], Price = 8.99M, Unicorn = unicorns["Bonita"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Pure and Virtuous", Genre = genres["Rainbow Unicorns"], Price = 8.99M, Unicorn = unicorns["Breanna"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The strong one", Genre = genres["Rainbow Unicorns"], Price = 8.99M, Unicorn = unicorns["Bryanne"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "From the moon", Genre = genres["Rainbow Unicorns"], Price = 8.99M, Unicorn = unicorns["Celina"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "From the stars", Genre = genres["Rainbow Unicorns"], Price = 8.99M, Unicorn = unicorns["Celestia"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The Gentle one", Genre = genres["Rainbow Unicorns"], Price = 8.99M, Unicorn = unicorns["Clementine"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The bold one", Genre = genres["Rainbow Unicorns"], Price = 8.99M, Unicorn = unicorns["Cortesia"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Morning Star", Genre = genres["Rainbow Unicorns"], Price = 8.99M, Unicorn = unicorns["Danika"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The Noble one", Genre = genres["Rainbow Unicorns"], Price = 8.99M, Unicorn = unicorns["Della"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Lover of the Earth", Genre = genres["Dark Wings"], Price = 8.99M, Unicorn = unicorns["Demetrius"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The great one", Genre = genres["Dark Wings"], Price = 8.99M, Unicorn = unicorns["Denali"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The Roamer", Genre = genres["Dark Wings"], Price = 8.99M, Unicorn = unicorns["Dessa"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Celestial Spirit", Genre = genres["Dark Wings"], Price = 8.99M, Unicorn = unicorns["Deva"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Child of the sun", Genre = genres["Dark Wings"], Price = 8.99M, Unicorn = unicorns["Drisana"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The Sweet one", Genre = genres["Dark Wings"], Price = 8.99M, Unicorn = unicorns["Dulcea"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Divine Spirit", Genre = genres["Dark Wings"], Price = 8.99M, Unicorn = unicorns["Duscha"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The Shining one", Genre = genres["Dark Wings"], Price = 8.99M, Unicorn = unicorns["Electra"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The Chosen One", Genre = genres["Dark Wings"], Price = 8.99M, Unicorn = unicorns["Elita"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Full of determination", Genre = genres["Jewel Unicorns"], Price = 8.99M, Unicorn = unicorns["Etana"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Eternal friend", Genre = genres["Jewel Unicorns"], Price = 8.99M, Unicorn = unicorns["Eternia"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Always tranquil", Genre = genres["Jewel Unicorns"], Price = 8.99M, Unicorn = unicorns["Evania"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "To be trusted", Genre = genres["Jewel Unicorns"], Price = 8.99M, Unicorn = unicorns["Faith"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Happiness always", Genre = genres["Jewel Unicorns"], Price = 8.99M, Unicorn = unicorns["Felicia"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The Fair One", Genre = genres["Jewel Unicorns"], Price = 8.99M, Unicorn = unicorns["Fenella"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The Daring One", Genre = genres["Jewel Unicorns"], Price = 8.99M, Unicorn = unicorns["Fernaco"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Little Star", Genre = genres["Jewel Unicorns"], Price = 8.99M, Unicorn = unicorns["Estrellita"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The Swift one", Genre = genres["Jewel Unicorns"], Price = 8.99M, Unicorn = unicorns["Fleta"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Prosperous", Genre = genres["Jewel Unicorns"], Price = 8.99M, Unicorn = unicorns["Floriana"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The protective one", Genre = genres["Jewel Unicorns"], Price = 8.99M, Unicorn = unicorns["Gerda"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Forever young", Genre = genres["Jewel Unicorns"], Price = 8.99M, Unicorn = unicorns["Giulio"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "The graceful one", Genre = genres["Jewel Unicorns"], Price = 8.99M, Unicorn = unicorns["Gratiana"], BlessingArtUrl = imgUrl
                },
                new Blessing {
                    Title = "Brown Eyed Buttons", Genre = genres["Jewel Unicorns"], Price = 8.99M, Unicorn = unicorns["Yana"], BlessingArtUrl = imgUrl
                }
            };

            foreach (var blessing in blessings)
            {
                blessing.UnicornId = blessing.Unicorn.UnicornId;
                blessing.GenreId   = blessing.Genre.GenreId;
            }

            return(blessings);
        }
Exemple #29
0
        public Skill CreateSkill(Player player)
        {
            List <Skill> playerSkills = player.ListOfSkills;
            Skill        known        = CheckContent(playerSkills); // check what spells from the BasicSpells category are known by the player already

            if (known == null)                                      // no BasicSpells known - we will return one of them
            {
                MagicArrow     s1 = new MagicArrow();
                StoneSkin      s2 = new StoneSkin();
                Blessing       s3 = new Blessing();
                AuraOfTheSword s4 = new AuraOfTheSword();

                // only include elligible spells
                List <Skill> tmp = new List <Skill>();
                if (s1.MinimumLevel <= player.Level)
                {
                    tmp.Add(s1);                                  // check level requirements
                }
                if (s2.MinimumLevel <= player.Level)
                {
                    tmp.Add(s2);
                }
                if (s3.MinimumLevel <= player.Level)
                {
                    tmp.Add(s3);
                }
                if (tmp.Count == 0)
                {
                    return(null);
                }
                return(tmp[Index.RNG(0, tmp.Count)]); // use Index.RNG for safe random numbers
            }
            else if (known.decoratedSkill == null)    // a BasicSpell has been already learned, use decorator to create a combo
            {
                MagicArrowDecorator     s1 = new MagicArrowDecorator(known);
                StoneSkinDecorator      s2 = new StoneSkinDecorator(known);
                BlessingDecorator       s3 = new BlessingDecorator(known);
                AuraOfTheSwordDecorator s4 = new AuraOfTheSwordDecorator(known);

                List <Skill> tmp = new List <Skill>();
                if (s1.MinimumLevel <= player.Level)
                {
                    tmp.Add(s1);                                  // check level requirements
                }
                if (s2.MinimumLevel <= player.Level)
                {
                    tmp.Add(s2);
                }
                if (s3.MinimumLevel <= player.Level)
                {
                    tmp.Add(s3);
                }
                if (tmp.Count == 0)
                {
                    return(null);
                }
                return(tmp[Index.RNG(0, tmp.Count)]);
            }
            else
            {
                return(null); // a combo of BasicSpells has been already learned - this factory doesn't offer double combos so we stop here
            }
        }
Exemple #30
0
    void InitSwaps()
    {
        Angry.setPosition(new Position(Level.Excluded, Circle.Green));
        Blessing.setPosition(new Position(Level.Excluded, Circle.Purple));
        Child.setPosition(new Position(Level.Excluded, Circle.Red));
        Curse.setPosition(new Position(Level.Excluded, Circle.Cyan));
        Heaven.setPosition(new Position(Level.Tertiary, Circle.GreenPurpleRed));
        Happiness.setPosition(new Position(Level.Tertiary, Circle.GreenRedCyan));
        Dragon.setPosition(new Position(Level.Tertiary, Circle.RedCyanPurple));
        Dream.setPosition(new Position(Level.Secondary, Circle.CyanRed));
        Energy.setPosition(new Position(Level.Secondary, Circle.GreenRed));
        Female.setPosition(new Position(Level.Secondary, Circle.CyanPurple));
        Force.setPosition(new Position(Level.Quaternary, Circle.GreenRedCyanPurple));
        Forest.setPosition(new Position(Level.Excluded, Circle.Purple));
        Friend.setPosition(new Position(Level.Secondary, Circle.GreenPurple));
        Hate.setPosition(new Position(Level.Secondary, Circle.GreenPurple));
        Hope.setPosition(new Position(Level.Excluded, Circle.Green));
        Kindness.setPosition(new Position(Level.Tertiary, Circle.CyanPurpleGreen));
        Longevity.setPosition(new Position(Level.Secondary, Circle.CyanPurple));
        Love.setPosition(new Position(Level.Secondary, Circle.CyanPurple));
        Loyal.setPosition(new Position(Level.Secondary, Circle.GreenRed));
        Spirit.setPosition(new Position(Level.Secondary, Circle.CyanRed));
        Male.setPosition(new Position(Level.Quaternary, Circle.GreenRedCyanPurple));
        Mountain.setPosition(new Position(Level.Secondary, Circle.GreenRed));
        Night.setPosition(new Position(Level.Excluded, Circle.Red));
        Pure.setPosition(new Position(Level.Secondary, Circle.GreenPurple));
        Heart.setPosition(new Position(Level.Secondary, Circle.CyanRed));
        River.setPosition(new Position(Level.Excluded, Circle.Cyan));
        Emotion.setPosition(new Position(Level.Excluded, Circle.Cyan));
        Soul.setPosition(new Position(Level.Excluded, Circle.Purple));
        Urgency.setPosition(new Position(Level.Excluded, Circle.Red));
        Wind.setPosition(new Position(Level.Excluded, Circle.Green));

        Debug.LogFormat("[Dragon Energy #{0}] Before swapping, the displayed words are:", _moduleId);
        for (int i = 0; i < displayed.Length; i++)
        {
            Debug.LogFormat("[Dragon Energy #{0}] {1} = {2}", _moduleId, displayed[i].getWord(), displayed[i].getPosition().getCircle().ToReadable());
        }

        char[] letters    = info.GetSerialNumberLetters().ToArray();
        int    vowelCount = 0;

        foreach (char letter in letters)
        {
            if (letter == 'A' || letter == 'E' || letter == 'I' || letter == 'O' || letter == 'U')
            {
                vowelCount++;
            }
        }

        if (info.GetBatteryCount() > 10 && (info.GetSerialNumberNumbers().ToArray()[info.GetSerialNumberNumbers().ToArray().Length - 1] == 5 || info.GetSerialNumberNumbers().ToArray()[info.GetSerialNumberNumbers().ToArray().Length - 1] == 7))
        {
            Swaps(1);
        }
        else if (info.GetPortPlateCount() > info.GetBatteryHolderCount() && (modules.Contains("Morse War") || modules.Contains("Double Color")))
        {
            Swaps(2);
        }
        else if ((info.IsIndicatorOn(Indicator.SIG) && info.IsIndicatorOn(Indicator.FRK)) || (info.GetOffIndicators().Count() == 3))
        {
            Swaps(3);
        }
        else if (info.GetModuleNames().Count() > 8)
        {
            Swaps(4);
        }
        else if (vowelCount >= 2)
        {
            Swaps(5);
        }
        else if (info.GetSolvedModuleNames().Count() == 0)
        {
            Swaps(6);
            dependsOnSolvedModules = true;
        }
        else
        {
            Swaps(7);
        }

        Debug.LogFormat("[Dragon Energy #{0}] After swapping, the displayed words are:", _moduleId);
        for (int i = 0; i < displayed.Length; i++)
        {
            Debug.LogFormat("[Dragon Energy #{0}] {1} = {2}", _moduleId, displayed[i].getWord(), displayed[i].getPosition().getCircle().ToReadable());
        }
    }
Exemple #31
0
 void PassiveRegen(Blessing _input)
 {
     pStats.passiveHPRegenMultiplyer++;
 }