Inheritance: MonoBehaviour
Beispiel #1
0
        /// <summary>
        /// Create an empty instance of a scroll bar
        /// </summary>
        /// <param name="position"></param>
        /// <param name="size"></param>
        public ScrollBar(Pair<int> position, Pair<int> size, int depth)
            : base(depth)
        {
            this.Position = position;
            this.Size = size;

            this.elements = new List<ScrollElement>();

            this.scroll = new Scroll(this, depth);
            this.AddChild(this.scroll);
        }
    public void Open(Scroll scroll)
    {
        gameObject.SetActive(true);
        _scroll = scroll;
        nameView.text = scroll.ingameName;
        icon.sprite = scroll.output.sprite;

        foreach (var ingredientSlot in ingredientSlots)
            ingredientSlot.Hide();
        var ingredients = scroll.ingredients;
        for (int i=0;i<ingredients.Count;i++)
            ingredientSlots[i].Reset(ingredients[i]);
    }
Beispiel #3
0
        private void MoveTo(double value, Scroll scroll)
        {
            double beforeScrollValue = Value;
            double beforeScrollPercentage = ScrollPercentage;
            while (!(value).Equals(beforeScrollValue))
            {
                scroll();
                double currentScrollValue = Value;
                double currentScrollPercentage = ScrollPercentage;

                CheckChangeInScrollPosition(beforeScrollValue, currentScrollValue, beforeScrollPercentage, currentScrollPercentage);

                beforeScrollValue = currentScrollValue;
                beforeScrollPercentage = currentScrollPercentage;
            }
        }
Beispiel #4
0
        public override void Initialize()
        {
            var l1 = new AbsoluteLayout(10, 10, 300, 300, Color.White);
            var l2 = new AbsoluteLayout(10, 10, 100, 100, Color.Green);

            l1.AddComponent(l2);
            var tb     = new TextBlock(50, 20, "STAS", "Arial", 11, StringAlignment.Center, Color.Black);
            var button = new ButtonCircle(10, 20, 25, new Font("Arial", 10), "BUTTON", Color.FromArgb(50, 50, 50));

            l2.AddComponent(button);
            l1.ListenerMouse.AddDown((m) =>
            {
                Console.WriteLine(m.UI);
            });
            AddComponent(l1);

            LayoutGrid grid = new LayoutGrid(400, 100, 400, 400, Color.FromArgb(0, 0, 0));

            grid.InitGrid(2, 2);
            grid.AddComponent(0, 0, new AbsoluteLayout(0, 0, 10, 10, Color.Green));
            grid.AddComponent(1, 0, new AbsoluteLayout(0, 0, 10, 10, Color.Red));
            grid.AddComponent(0, 1, new AbsoluteLayout(0, 0, 10, 10, Color.Blue));
            grid.AddComponent(1, 1, new AbsoluteLayout(0, 0, 10, 10, Color.Gray));
            this.AddComponent(grid);

            Window win    = new Window(400, 400, 500, 500, "My Window");
            var    scroll = new Scroll(10, 150, 100);
            var    lsb    = new ListBox(200, 200, 200, 200);

            scroll.ChangeScroll += (o, e) => { win.Title.Value = scroll.Value.ToString(); };
            win.AddComponent(lsb);
            lsb.AddItem(new ButtonRect(0, 0, 20, 40, new Font("Arial", 12), "Sta", Color.Blue));
            this.AddComponent(win);

            var tabs = new TabLayout <TextBlock>(100, 100, 400, 30, Color.Silver);

            this.AddComponent(tabs);
            for (int i = 0; i < 3; i++)
            {
                tabs.AddTab($"File {i}.cs", new TextBlock(10, 10, "1", "Arial", 14,
                                                          StringAlignment.Center, Color.Red)).Active = (name, ui) => {
                    Console.WriteLine("name: " + name);
                }
            }
            ;
        }
Beispiel #5
0
        public IWorld LoadLevel(string id)
        {
            foreach (IWorld world in session.ScanWorlds())
            {
                if (world.ID == id)
                {
                    return(world);
                }
            }

            // note: use static generator for normal game
            if (Mode == GameMode.normal)
            {
                Static generator = new Static();

                IWorld newWorld = new World(
                    id,
                    WorldType.normal,
                    generator,
                    new List <Point>
                {
                    new Point(0, 128)     // TODO
                });

                game.LevelIOJson.Load(map, id, newWorld, generator);

                return(newWorld);
            }
            else
            {
                IGenerator generator = new Scroll(scoreListener, new SoundEffectListener()); // TODO: do not init it here

                IWorld newWorld = new World(
                    id,
                    WorldType.normal,
                    generator,
                    new List <Point>
                {
                    new Point(0, 128)     // TODO
                });

                newWorld.Extend(0, 0, 0, Const.GRID * 16);

                return(newWorld);
            }
        }
Beispiel #6
0
        private void MoveTo(double value, Scroll scroll)
        {
            double beforeScrollValue      = Value;
            double beforeScrollPercentage = ScrollPercentage;

            while (!(value).Equals(beforeScrollValue))
            {
                scroll();
                double currentScrollValue      = Value;
                double currentScrollPercentage = ScrollPercentage;

                CheckChangeInScrollPosition(beforeScrollValue, currentScrollValue, beforeScrollPercentage, currentScrollPercentage);

                beforeScrollValue      = currentScrollValue;
                beforeScrollPercentage = currentScrollPercentage;
            }
        }
Beispiel #7
0
        /// <summary>
        /// Creates a new <see cref="ScorePanelList"/>.
        /// </summary>
        public ScorePanelList()
        {
            RelativeSizeAxes = Axes.Both;

            InternalChild = scroll = new Scroll
            {
                RelativeSizeAxes = Axes.Both,
                Child            = flow = new Flow
                {
                    Anchor       = Anchor.Centre,
                    Origin       = Anchor.Centre,
                    Direction    = FillDirection.Horizontal,
                    Spacing      = new Vector2(panel_spacing, 0),
                    AutoSizeAxes = Axes.Both,
                }
            };
        }
Beispiel #8
0
    private IEnumerator CutPageRoutine()
    {
        UpdateDescriptionForSelectedScroll();
        Result <InputManager.Command> selectResult = new Result <InputManager.Command>();

        yield return(scrollBox.SelectRoutine(selectResult, (int selection) => {
            UpdateDescriptionForSelectedScroll();
        }));

        if (selectResult.canceled)
        {
            UpdateDescriptionForSelectedBook();
        }
        else
        {
            Scroll    scroll = pc.activeBook.spells[scrollBox.selection].scroll;
            Spellbook book   = pc.books[bookBox.selection];
            if (pc.activeBook == book)
            {
                textbox.textbox.text = "Can't destroy the equipped spellbook.";
            }
            else
            {
                descriptionNameBox.text = "Really?";
                textbox.textbox.text    = "Extract scroll of " + scroll.skill.skillName + " from \"" +
                                          pc.books[bookBox.selection].bookName + "\"? This will destroy the spellbook.";
                Result <bool> confirmResult = new Result <bool>();
                yield return(ConfirmRoutine(confirmResult));

                if (confirmResult.value)
                {
                    pc.scrolls.Add(scroll);
                    pc.books.RemoveAt(bookBox.selection);
                    PopulateScrollBoxForSelectedBook();
                    PopulateBookData();
                    UpdateDescriptionForSelectedBook();
                    pc.scissors -= 1;
                    PopulateTools();
                }
                else
                {
                    PopulateScrollBoxForSelectedBook();
                }
            }
        }
    }
Beispiel #9
0
 private void UpToTopButton_Click(object sender, RoutedEventArgs e)
 {
     if (Scroll.Visibility == Visibility.Visible)
     {
         return;
     }
     Scroll.SetVisibility(true);
     Scroll.Margin = new Thickness(0, -Scroll.ActualHeight, 0, 0);
     board         = new Storyboard();
     anima         = new DoubleAnimation {
         EasingFunction = new CubicEase {
             EasingMode = EasingMode.EaseOut
         },
         Duration = new Duration(TimeSpan.FromMilliseconds(1000)),
         From     = 0,
         To       = Scroll.ActualHeight
     };
     anima.Completed += (obj, args) => {
         Scroll.Margin = new Thickness(0, 0, 0, 0);
         transform.Y   = 0;
     };
     Storyboard.SetTarget(anima, transform);
     Storyboard.SetTargetProperty(anima, "Y");
     board.Children.Add(anima);
     anima = new DoubleAnimation {
         EasingFunction = new CubicEase {
             EasingMode = EasingMode.EaseOut
         },
         Duration = new Duration(TimeSpan.FromMilliseconds(1000)),
         From     = 0,
         To       = Scroll.ActualHeight
     };
     anima.Completed += (obj, args) => {
         listBorder.Height = ActualHeight - Scroll.ActualHeight - 20;
         listBorder.Margin = new Thickness(0, 20 + Scroll.ActualHeight, 0, 0);
         borderTrans.Y     = 0;
         allSlide.SetVisibility(true);
     };
     Storyboard.SetTarget(anima, borderTrans);
     Storyboard.SetTargetProperty(anima, "Y");
     board.Children.Add(anima);
     board.Completed += (obj, args) => board.Stop();
     board.Begin();
     TitleBackRec.Opacity = 0;
 }
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                if (this.Scroll != null)
                {
                    Scroll.Consume();
                }
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                if (m.Spell != null)
                {
                    m.Spell.OnCasterHurt();
                }

                m.Paralyzed = false;

                if (CheckResisted(m))
                {
                    m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
                }
                else
                {
                    if (!m_Table.Contains(m))
                    {
                        Timer t = new InternalTimer(m, Caster);
                        t.Start();

                        m_Table[m] = t;
                    }

                    m.SendMessage("A swarm of insects surrounds you, and starts to sting you!");
                    m.FixedParticles(0x91B, 1, 240, 9916, 1159, 3, EffectLayer.Head);
                    m.PlaySound(0x230);
                }
            }

            FinishSequence();
        }
        private void StudentSearch_TextChanged(object sender, TextChangedEventArgs e)
        {
            if ((e.OldTextValue ?? "").Length > (e.NewTextValue ?? "").Length)
            {
                InGrade = Attendance.StudentsOfGrade(ClassName);
                InitializeTeachers();
                InitializeStudents();
            }
            else
            {
                NamesTable = new TableSection();
                List <ViewCell> visible = new List <ViewCell>();
                string          filter  = StudentSearch.Text.Trim().ToLower();
                int             count   = 0;
                foreach (ViewCell c in Backup)
                {
                    StackLayout s = c.View as StackLayout;
                    Label       l = s.Children[2] as Label;
                    if (l.Text.ToLower().Contains(filter))
                    {
                        // make visible
                        s.Children[1] = GetPhoto(new KeyValuePair <string, string>((s.Children[0] as Label).Text, l.Text), true);
                        visible.Add(c);
                        count++;
                    }
                }
                foreach (ViewCell v in visible)
                {
                    NamesTable.Add(v);
                }

                if (count == 0)
                {
                    // there are no students that match this filter
                    NotFoundStack.IsVisible = true;
                }
                else
                {
                    NotFoundStack.IsVisible = false;
                }
                NamesTableRoot.Clear();
                NamesTableRoot.Add(NamesTable);
                Scroll.ScrollToAsync(0, 0, false);
            }
        }
Beispiel #12
0
    public Skill(Scroll scroll)
    {
        this.scroll = scroll;
        data        = scroll.data;
        mods        = new List <SkillModifier>();
        foreach (SkillModifier.Type type in scroll.mods)
        {
            mods.Add(new SkillModifier(type));
        }

        // generation
        if (data.prohibitedToBeCD)
        {
            costMP = data.baseCost;
        }
        else if (data.prohibitedToBeMP)
        {
            costCD = data.baseCost;
        }
        else if (RandUtils.Chance(0.7f))
        {
            costMP = data.baseCost;
        }
        else
        {
            costCD = Mathf.CeilToInt(data.baseCost / 8.0f);
        }

        pageCost     = data.basePages;
        longformName = "";
        foreach (SkillModifier mod in mods)
        {
            longformName = mod.MutateName(longformName);
            pageCost     = mod.MutatePages(pageCost);
            if (costMP > 0)
            {
                costMP = mod.MutateCost(costMP);
            }
            else
            {
                costCD = mod.MutateCost(costCD);
            }
        }
        longformName = skillName + " [ " + pageCost + "pg " + (costMP > 0 ? costMP + "mp" : costCD + "cd") + " ] " + longformName;
    }
    /* public int generateRandom(List<int> range)
     * {
     *  Debug.Log("Scrolls in deck:" + scrollsInDeck);
     *  int tryNum = -1;
     *  if(TurnManagerSingle.singleDeck.Count > 0)
     *  {
     *      tryNum = (int)Random.Range(0, scrollsInDeck);
     *      if (!TurnManagerSingle.singleDeck.ContainsKey("scroll" + tryNum))
     *      {
     *          tryNum = generateRandom(range);
     *      }
     *      if (range.Contains(tryNum))
     *      {
     *          tryNum = generateRandom(range);
     *      }
     *  }
     *  return tryNum;
     * } */

    public void assignScroll(Scroll deckScroll1, Scroll deckScroll2, Scroll deckScroll3)
    {
        if (deckScroll1)
        {
            scrollDisplay1.scroll = deckScroll1;
            scrollDisplay1.setInfo();
        }
        if (deckScroll2)
        {
            scrollDisplay2.scroll = deckScroll2;
            scrollDisplay2.setInfo();
        }
        if (deckScroll3)
        {
            scrollDisplay3.scroll = deckScroll3;
            scrollDisplay3.setInfo();
        }
    }
Beispiel #14
0
        private void GetService_Click(object sender, RoutedEventArgs e)
        {
            GetService.IsEnabled = false;

            var Parameters = new Dictionary <string, object>();

            Parameters.Add("Name", ServiceName.Text);

            var result = RunPS("Get-Service", Parameters);

            foreach (var r in result)
            {
                Output.Text += r.ToString();
            }

            Scroll.ScrollToBottom();
            GetService.IsEnabled = true;
        }
 private async void TimerAsync(object state)
 {
     time     = DateTimeOffset.Now;
     selapsed = (time - starttime).ToString(@"hh\:mm\:ss");
     //elapsed = new TimeSpan(elapsed.Hours, elapsed.Minutes, elapsed.Seconds);
     scrollnow = true;
     if ((time - lasttime).TotalSeconds > 10.0)
     {
         lasttime = time;
         var mess = $"Video Play Timer: {selapsed}\n" + Getstats();
         await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                                                       () =>
         {
             OT.Text += mess;
             Scroll.ChangeView(0.0f, Scroll.ExtentHeight, 1.0f);
         });
     }
 }
    /// <summary>
    /// 生成コルーチン
    /// </summary>
    /// <returns></returns>
    private IEnumerator Create()
    {
        while (true)
        {
            yield return(new WaitForSeconds(createInterval));

            // 座標を設定
            Vector3 pos = Vector3.zero;
            pos.x = Random.Range(-CreateRange, CreateRange);
            pos.y = CreateHeight;
            // 生成
            GameObject obj         = Instantiate(obstacle, pos, Quaternion.identity);
            float      scrollSpeed = bg1.GetSpeed();
            Scroll     scroll      = obj.GetComponent <Scroll>();
            scroll.SetSpeed(scrollSpeed);
            obstacles.Add(scroll);
        }
    }
Beispiel #17
0
 private void txtSend_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         if (txtSend.Text != "" && txtSend.Text != " " && txtSend.Text != "  " &&
             txtSend.Text != "   " && txtSend.Text != "    " && txtSend.Text != "     ")
         {
             var send = Program.vk.Messages.Send(new MessagesSendParams
             {
                 UserId  = Program.chatID,
                 Message = Program.name + "♦" + txtSend.Text
             });
         }
         txtSend.Text = "";
         goo          = true;
         Dispatcher.Invoke(() => Scroll.ScrollToBottom());
     }
 }
Beispiel #18
0
        /// <summary>
        /// Creates a new <see cref="ScorePanelList"/>.
        /// </summary>
        public ScorePanelList()
        {
            RelativeSizeAxes = Axes.Both;

            InternalChild = scroll = new Scroll
            {
                RelativeSizeAxes = Axes.Both,
                HandleScroll     = () => expandedPanel?.IsHovered != true, // handle horizontal scroll only when not hovering the expanded panel.
                Child            = flow = new Flow
                {
                    Anchor       = Anchor.Centre,
                    Origin       = Anchor.Centre,
                    Direction    = FillDirection.Horizontal,
                    Spacing      = new Vector2(panel_spacing, 0),
                    AutoSizeAxes = Axes.Both,
                }
            };
        }
Beispiel #19
0
 //attempts to cast a given spell using spells in the pool
 public bool castSpell(Scroll scroll)
 {
     if (spells.Count < 1)
     {
         return(false);
     }
     foreach (Spell s in spells)
     {
         if (!s.IsRunning())
         {
             s.SetScroll(scroll);
             s.onFinish = this.notifyFinish;
             s.Run();
             return(true);
         }
     }
     return(false);
 }
Beispiel #20
0
    public void Initialize()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        scroll   = GetComponentInChildren <Scroll>(true);
        flexMenu = GetComponent <FlexMenu>();
        AccountMenuResponder responder = new AccountMenuResponder(this, flexMenu);

        flexMenu.RegisterResponder(responder);
        accountsPanel = GetComponentInChildren <MultiSelectFlexPanel>(true);
        accountsPanel.Initialize();
        joyStickAggregator = scroll.GetComponent <JoyStickAggregator>();

        initialized = true;
    }
Beispiel #21
0
    public void Open(Scroll scroll)
    {
        gameObject.SetActive(true);
        _scroll       = scroll;
        nameView.text = scroll.name;
        icon.sprite   = scroll.output.sprite;

        foreach (var ingredientSlot in ingredientSlots)
        {
            ingredientSlot.Hide();
        }
        var ingredients = scroll.ingredients;

        for (int i = 0; i < ingredients.Count; i++)
        {
            ingredientSlots[i].Reset(ingredients[i]);
        }
    }
Beispiel #22
0
    private Scroll GenerateScroll(int level)
    {
        int modCount = 0;

        if (level >= 8)
        {
            modCount = RandUtils.Chance(0.6f) ? 1 : 0;
        }
        else if (level >= 4)
        {
            modCount = RandUtils.Chance(0.35f) ? 1 : 0;
        }
        else
        {
            modCount = RandUtils.Chance(0.1f) ? 1 : 0;
        }

        List <SkillModifier.Type> toApply = new List <SkillModifier.Type>();
        List <SkillModifier.Type> mods    = new List <SkillModifier.Type>(
            (SkillModifier.Type[])System.Enum.GetValues(typeof(SkillModifier.Type)));

        while (toApply.Count < modCount)
        {
            SkillModifier.Type mod = mods[Random.Range(0, mods.Count)];
            if (!toApply.Contains(mod))
            {
                toApply.Add(mod);
            }
        }

        Scroll scroll = Instantiate(this.scroll);

        scroll.mods = toApply;
        while (scroll.data == null)
        {
            SkillData skill = skills[Random.Range(0, skills.Count)];
            if (RandUtils.Chance((skill.rarity - level) / 100.0f))
            {
                scroll.data = skill;
            }
        }

        return(scroll);
    }
Beispiel #23
0
        /// <summary>
        /// 导出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtId.Text) || string.IsNullOrWhiteSpace(txtInterval.Text) || string.IsNullOrWhiteSpace(txtZh.Text) || string.IsNullOrWhiteSpace(txtUg.Text) || string.IsNullOrWhiteSpace(txtEn.Text))
            {
                KryptonMessageBox.Show(this, "请完整输入信息!", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }



            Scroll scroll = new Scroll();

            scroll.Interval = int.Parse(txtInterval.Text);
            scroll.MsgZH    = txtZh.Text;
            scroll.MsgUG    = txtUg.Text;
            scroll.MsgEN    = txtEn.Text;



            string encryptedStr = Encrypt(JsonConvert.SerializeObject(scroll), txtId.Text.Trim(), Encoding.UTF8.GetBytes("OybabCorp8888000"));

            //选择导出位置
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Title    = "导出";
            saveFileDialog.Filter   = "Vod Data File(*.dll)|*.dll";
            saveFileDialog.FileName = "VScroll";

            DialogResult result = saveFileDialog.ShowDialog(this);

            if (result != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }



            using (StreamWriter stream = new StreamWriter(saveFileDialog.FileName, false, Encoding.UTF8))
            {
                stream.Write(encryptedStr);
            }

            KryptonMessageBox.Show(this, "导出成功!", Res.Resources.GetRes().GetString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Beispiel #24
0
    private IEnumerator AddPageRoutine()
    {
        PopulateScrollBoxForOwnScrolls();
        UpdateDescriptionForSelectedScroll();
        Result <InputManager.Command> selectResult = new Result <InputManager.Command>();

        yield return(scrollBox.SelectRoutine(selectResult, (int selection) => {
            UpdateDescriptionForSelectedScroll();
        }));

        if (selectResult.canceled)
        {
            UpdateDescriptionForSelectedBook();
        }
        else
        {
            Scroll    scroll = pc.scrolls[scrollBox.selection];
            Spellbook book   = pc.books[bookBox.selection];
            if (scroll.skill.pageCost + book.pagesFilled > book.totalPages)
            {
                textbox.textbox.text = "That scroll is too many pages long.";
            }
            else
            {
                descriptionNameBox.text = "Really?";
                textbox.textbox.text    = "Add scroll of " + scroll.skill.skillName + " to \"" +
                                          pc.books[bookBox.selection].bookName + "\"? This is not easily reversible.";
                Result <bool> confirmResult = new Result <bool>();
                yield return(ConfirmRoutine(confirmResult));

                if (confirmResult.value)
                {
                    pc.scrolls.Remove(scroll);
                    book.AddScroll(scroll);
                    UpdateDescriptionForSelectedBook();
                    PopulateBookData();
                }
                else
                {
                    UpdateDescriptionForSelectedBook();
                }
            }
        }
    }
Beispiel #25
0
        /** constructor
         */
        public static Scroll <ITEM> Create(Fee.Deleter.Deleter a_deleter, long a_drawpriority, Scroll_Type a_scroll_type, int a_item_length)
        {
            //Scroll t_this = Fee.Ui.Ui.GetInstance().GetPoolList_Scroll().PoolNew();
            Scroll <ITEM> t_this = new Scroll <ITEM>();

            {
                //プールから作成。
                t_this.InitializeFromPool(a_drawpriority, a_scroll_type, a_item_length);

                //背景。
                t_this.bg = Fee.Render2D.Sprite2D.Create(null, a_drawpriority);
                t_this.bg.SetTexture(UnityEngine.Texture2D.whiteTexture);
                t_this.bg.SetRect(0, 0, 0, 0);
                t_this.bg.SetTextureRect(in Fee.Render2D.Config.TEXTURE_RECT_MAX);
                t_this.bg.SetColor(0.0f, 0.0f, 0.0f, 1.0f);
                t_this.bg.SetMaterialType(Fee.Render2D.MaterialType.Alpha);

                //背景。
                t_this.bg_enable = true;

                //バー。
                t_this.bar_drawpriority_offset = 1;
                t_this.bar_size   = 5;
                t_this.bar_offset = 1;

                //バー。
                t_this.bar = Fee.Render2D.Sprite2D.Create(null, a_drawpriority + t_this.bar_drawpriority_offset);
                t_this.bar.SetTexture(UnityEngine.Texture2D.whiteTexture);
                t_this.bar.SetRect(0, 0, 0, 0);
                t_this.bar.SetTextureRect(in Fee.Render2D.Config.TEXTURE_RECT_MAX);
                t_this.bar.SetColor(1.0f, 1.0f, 1.0f, 1.0f);
                t_this.bar.SetMaterialType(Fee.Render2D.MaterialType.Alpha);
                t_this.bar.SetVisible(false);

                //バー。
                t_this.bar_enable = true;

                if (a_deleter != null)
                {
                    a_deleter.Regist(t_this);
                }
            }
            return(t_this);
        }
Beispiel #26
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            //	Only respond to left mouse button events
            if (e.Button != MouseButtons.Left)
            {
                return;
            }

            //	Begin dragging which notifies MouseMove function that it needs to update the marker
            _isDragging = true;

            int x = e.X - 2, y = e.Y - 2;

            if (x < 0)
            {
                x = 0;
            }
            if (x > this.Width - 4)
            {
                x = this.Width - 4;                 //	Calculate marker position
            }
            if (y < 0)
            {
                y = 0;
            }
            if (y > this.Height - 4)
            {
                y = this.Height - 4;
            }

            //	If the marker hasn't moved, no need to redraw it.
            //	or send a scroll notification
            if (x == _markerX && y == _markerY)
            {
                return;
            }

            DrawMarker(x, y, true);             //	Redraw the marker
            ResetHSLRGB();                      //	Reset the color

            //	Notify anyone who cares that the controls marker (selected color) has changed
            Scroll?.Invoke(this, e);
        }
Beispiel #27
0
 public void Reset(Scroll.Ingradient ingredient)
 {
     gameObject.SetActive(true);
     icon.sprite = ingredient.item.sprite;
     var need = ingredient.count;
     var have = Player.mine.ItemCount(ingredient.item);
     needAmount.text = need.ToString();
     haveAmount.text = have.ToString();
     if (have >= need)
     {
         _isSatisfied = true;
         img.color = new Color(0, 200, 255, 255);
     }
     else
     {
         _isSatisfied = false;
         img.color = new Color(255, 0, 10, 255);
     }
 }
Beispiel #28
0
        public override void OnCast()
        {
            if (CheckSequence())
            {
                if (this.Scroll != null)
                {
                    Scroll.Consume();
                }
                int  xLong = 0, yLat = 0;
                int  xMins = 0, yMins = 0;
                bool xEast = false, ySouth = false;

                if (AncientLocateSpell.Format(Caster.Location, Caster.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth))
                {
                    string location = String.Format("Your current location is: {0} {1}'{2}, {3} {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W");
                    Caster.LocalOverheadMessage(MessageType.Regular, Caster.SpeechHue, false, location);
                }
            }
        }
Beispiel #29
0
        protected override void Create()
        {
            Func <string, Scroll> createScroll = (string tag) =>
            {
                var scroll = new Scroll();
                scroll.tag1  = tag;
                scroll.Kind  = Scroll.DiscoverKindFromName(tag);
                scroll.Count = Enumerable.Range(1, 3).ToList().GetRandomElem();
                return(scroll);
            };
            var names = new[] { "fire_ball_scroll", "ice_ball_scroll", "poison_ball_scroll",
                                "identify_scroll", "teleport_scroll", "portal_scroll", "transform_scroll", "mana_shield_scroll",
                                "rage_scroll", "skeleton_scroll" };

            foreach (var name in names)
            {
                factory[name] = createScroll;
            }
        }
Beispiel #30
0
        /// <summary>
        /// 滚动到最底端
        /// </summary>
        public void ScrollBottom()
        {
            if (_panel == null)
            {
                return;
            }

            if (Scroll.Content == _panel)
            {
                // 内部滚动栏
                Scroll.ChangeView(null, Scroll.ScrollableHeight, null);
            }
            else
            {
                // 外部滚动栏
                Point pt = _panel.TransformToVisual(Scroll).TransformPoint(new Point());
                Scroll.ChangeView(null, Scroll.VerticalOffset + pt.Y + _panel.ActualHeight - Scroll.ViewportHeight, null);
            }
        }
Beispiel #31
0
        public LoadRom(Compound gui)
            : base(gui, new Rectangle(), new DisplayCaption("Load Rom"), new List <Atom>())
        {
            Width  = 232;
            Height = 198;

            directory = baseDirectory;

            guiList   = new ListBox(gui, new Rectangle(3, 3, 192, 128), new List <DisplayCaption>(), onList);
            guiScroll = new Scroll(gui, new Rectangle(199, 3, 32, 128), new Range(0, 0), onScroll);

            Add(guiScroll);
            Add(guiList);
            Add(new Button(gui, new Rectangle(151, 135, 64, 24), new DisplayCaption("Load"), onLoad));
            Add(new Button(gui, new Rectangle(83, 135, 64, 24), new DisplayCaption("Profile"), onProfile));
            Add(new Button(gui, new Rectangle(3, 135, 64, 24), new DisplayCaption("Up"), onFolderUp));

            BuildList();
        }
Beispiel #32
0
    public IEnumerator EmulateWordActivation(string word)
    {
        Scroll activeScroll = _scrollManager.GetActiveScroll();

        yield return(StartCoroutine(activeScroll.SelectWord(word)));

        //if (word != activeScroll.GetSelectedWord())
        //{
        //    Debug.LogError("Somehow word \"" + word + "\" couldn't have been selected in a pentagram, but the Mage doesn't give a f**k");
        //    yield break;
        //}

        activeScroll.GetPentagram().TryToUseWord(word);
        IncreaseWordsSelectedText();

        activeScroll.UnselectLetters();
        _liner.Clear(null);
        _wordActivationCallback(word, SpellEffect.None);
    }
Beispiel #33
0
        /// <summary>
        /// 滚动到最顶端
        /// </summary>
        public void ScrollTop()
        {
            if (_panel == null)
            {
                return;
            }

            if (Scroll.Content == _panel)
            {
                // 内部滚动栏
                Scroll.ChangeView(null, 0, null);
            }
            else
            {
                // 外部滚动栏
                Point pt = _panel.TransformToVisual(Scroll).TransformPoint(new Point());
                Scroll.ChangeView(null, Scroll.VerticalOffset + pt.Y, null);
            }
        }
Beispiel #34
0
        public static void Init()
        {
#if !Console
            Challenges = PixelDungeon.Challenges();
#endif

            Actor.Clear();

            PathFinder.SetMapSize(Level.Width, Level.Height);

            Scroll.InitLabels();
            Potion.InitColors();
            Wand.InitWoods();
            Ring.InitGems();

            Statistics.Reset();
            Journal.Reset();

            Depth = 0;
            Gold  = 0;

            PotionOfStrength = 0;
            ScrollsOfUpgrade = 0;
            ArcaneStyli      = 0;
            DewVial          = true;
            Transmutation    = Random.IntRange(6, 14);

            Chapters = new HashSet <int?>();

            Ghost.Quest.reset();
            Wandmaker.Quest.Reset();
            Blacksmith.Quest.Reset();
            Imp.Quest.Reset();

            Room.ShuffleTypes();

            Hero = new Hero();
            Hero.Live();

            Badge.Reset();

            StartScene.curClass.InitHero(Hero);
        }
Beispiel #35
0
    public Equipment(Weapon mainHand, Weapon offHand, Armor shield, Weapon ammunition, Weapon hidden1, Weapon hidden2, Weapon hidden3, Weapon hidden4, 
	Armor armor, Potion potion1, Potion potion2, Potion potion3, Potion potion4, Scroll scroll1, Scroll scroll2, Scroll scroll3, Scroll scroll4)
    {
        this.mainHand = mainHand;
        this.offHand = offHand;
        this.shield = shield;
        this.ammunition = ammunition;
        this.hidden1 = hidden1;
        this.hidden2 = hidden2;
        this.hidden3 = hidden3;
        this.hidden4 = hidden4;
        this.armor = armor;
        this.potion1 = potion1;
        this.potion2 = potion2;
        this.potion3 = potion3;
        this.potion4 = potion4;
        this.scroll1 = scroll1;
        this.scroll2 = scroll2;
        this.scroll3 = scroll3;
        this.scroll4 = scroll4;
    }
Beispiel #36
0
 public void RemoveScroll(Scroll scroll)
 {
     itemManager.allItems.Remove (scroll);
     allScrolls.Remove (scroll);
 }
Beispiel #37
0
 public void UseScroll(Scroll scroll)
 {
 }
			public static Scroll ScrollView(ref Vector2 scrollPosition, bool alwaysShowHorizontal, bool alwaysShowVertical, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar, GUIStyle background, params GUILayoutOption[] options)
            {
                Scroll scrl = new Scroll();
				scrollPosition = GUILayout.BeginScrollView(scrollPosition, alwaysShowHorizontal, alwaysShowVertical, horizontalScrollbar, verticalScrollbar, background, options);
                return scrl;
            }
Beispiel #39
0
 public void AddScroll(Scroll scroll)
 {
     scroll.sellFraction = 4;
     itemManager.allItems.Add (scroll);
     allScrolls.Add (scroll);
 }
Beispiel #40
0
 public void init(Scroll scroll, int x, int y)
 {
     this.x = x;
     this.y = y;
     this.scroll = scroll;
 }
Beispiel #41
0
 public void remove_specific_effect(Scroll.Status_Type effect)
 {
     for (int i = 0; i < BuffDebuffTracker.Count; i++)
         if (BuffDebuffTracker[i].get_my_type() == effect)
             BuffDebuffTracker.RemoveAt(i);
 }
Beispiel #42
0
 public void setScroll4(Scroll i)
 {
     scroll4 = i;
 }
Beispiel #43
0
        public void acquire_item(Item thing)
        {
            if (thing is Armor)
            {
                Armor acquired_armor = new Armor((Armor)thing);
                acquired_armor.set_ID_number(new_random_ID_number());
                inventory.Add(acquired_armor);
            }
            else if (thing is Weapon)
            {
                Weapon acquired_weapon = new Weapon((Weapon)thing);
                acquired_weapon.set_ID_number(new_random_ID_number());
                inventory.Add(acquired_weapon);
            }
            else if (thing is Scroll)
            {
                Scroll acquired_scroll = new Scroll((Scroll)thing);
                acquired_scroll.set_ID_number(new_random_ID_number());
                inventory.Add(acquired_scroll);
            }
            else if (thing is Talisman)
            {
                Talisman acquired_talisman = new Talisman((Talisman)thing);
                acquired_talisman.set_ID_number(new_random_ID_number());
                inventory.Add(acquired_talisman);
            }

            //inventory.Add(thing);
        }
Beispiel #44
0
 public void setScroll1(Scroll i)
 {
     scroll1 = i;
 }
Beispiel #45
0
        public void set_ranged_attack_aura(Floor fl, gridCoordinate pl_gc, Scroll s, RACursor r1)
        {
            int bow_range = 0;
            if (s == null)
            {
                if (main_hand != null && (main_hand.get_my_weapon_type() == Weapon.Type.Bow ||
                                          main_hand.get_my_weapon_type() == Weapon.Type.Crossbow))
                    bow_range = main_hand.get_my_range();
                else
                    bow_range = off_hand.get_my_range();
            }
            else
                bow_range = s.get_range();

            List<gridCoordinate> endpoints = new List<gridCoordinate>();
            if ((is_bow_equipped() && !is_cbow_equipped()) || s != null)
            {
                endpoints = calculate_endpoints(pl_gc, bow_range);
            }
            else
            {
                endpoints.Add(new gridCoordinate(pl_gc.x, pl_gc.y + bow_range));
                endpoints.Add(new gridCoordinate(pl_gc.x, pl_gc.y - bow_range));
                endpoints.Add(new gridCoordinate(pl_gc.x + bow_range, pl_gc.y));
                endpoints.Add(new gridCoordinate(pl_gc.x - bow_range, pl_gc.y));
            }
            List<VisionRay> range_rays = new List<VisionRay>();

            for (int i = 0; i < endpoints.Count; i++)
            {
                range_rays.Add(new VisionRay(pl_gc, endpoints[i]));
            }
            endpoints.Clear();

            int monsterID = -1;
            while (range_rays.Count > 0)
            {
                for (int i = 0; i < range_rays.Count; i++)
                {
                    bool remove = false;
                    int whoCares = -1;

                    range_rays[i].update();
                    gridCoordinate current_ray_position = new gridCoordinate((int)range_rays[i].my_current_position.X / 32, (int)range_rays[i].my_current_position.Y / 32);
                    int x_difference = positive_difference(pl_gc.x, current_ray_position.x);
                    int y_difference = positive_difference(pl_gc.y, current_ray_position.y);

                    if (!fl.is_tile_opaque(current_ray_position) && (x_difference > 1 || y_difference > 1))
                            fl.set_tile_aura(current_ray_position, Tile.Aura.Attack);

                    if (fl.is_tile_opaque(current_ray_position) ||
                        fl.is_los_blocking_Doodad_here(current_ray_position))
                    {
                        remove = true;
                        if(s != null && s.spell_destroys_walls())
                            fl.set_tile_aura(current_ray_position, Tile.Aura.Attack);
                    }

                    if ((main_hand != null && main_hand.get_my_weapon_type() == Weapon.Type.Crossbow) ||
                        (off_hand != null && off_hand.get_my_weapon_type() == Weapon.Type.Crossbow))
                        if (fl.is_monster_here(current_ray_position, out monsterID) ||
                            fl.is_destroyable_Doodad_here(current_ray_position, out whoCares))
                            remove = true;

                    if (range_rays[i].is_at_end() || remove)
                        range_rays.RemoveAt(i);
                }
            }

            range_rays.Clear();
            if (s != null && s.get_aoe_size() > 1)
            {
                int aoe_range = s.get_aoe_size() / 2;
                endpoints = calculate_endpoints(r1.my_grid_coord, aoe_range);
                bool destroys_walls = s.spell_destroys_walls();

                for (int i = 0; i < endpoints.Count; i++)
                {
                    range_rays.Add(new VisionRay(r1.my_grid_coord, endpoints[i]));
                }
                while (range_rays.Count > 0)
                {
                    for (int i = 0; i < range_rays.Count; i++)
                    {
                        bool remove = false;

                        range_rays[i].update();
                        gridCoordinate current_ray_position = new gridCoordinate((int)range_rays[i].my_current_position.X / 32, (int)range_rays[i].my_current_position.Y / 32);

                        if (!fl.is_tile_opaque(current_ray_position))
                            if (fl.aura_of_specific_tile(current_ray_position) == Tile.Aura.Attack)
                                fl.set_tile_aura(current_ray_position, Tile.Aura.AtkAndAOE);
                            else if(fl.aura_of_specific_tile(current_ray_position) != Tile.Aura.AtkAndAOE &&
                                    fl.aura_of_specific_tile(current_ray_position) != Tile.Aura.Attack)
                                fl.set_tile_aura(current_ray_position, Tile.Aura.AOE_Range);

                        if (fl.is_tile_opaque(current_ray_position) && !destroys_walls)
                            remove = true;

                        if (range_rays[i].is_at_end() || remove)
                            range_rays.RemoveAt(i);
                    }
                }
            }
        }
Beispiel #46
0
 public void setScroll2(Scroll i)
 {
     scroll2 = i;
 }
Beispiel #47
0
 public bool addScroll(Scroll s)
 {
     if(s.getWeight() + weight > weightLimit) {
         return false;
     } else {
         scrolls.Add(s);
         weight += s.getWeight();
         return true;
     }
 }
Beispiel #48
0
 public void setScroll3(Scroll i)
 {
     scroll3 = i;
 }
Beispiel #49
0
 protected void CalculatePrice(Scroll scroll)
 {
     scroll.price = 100;
 }
			public static Scroll ScrollView(ref Vector2 scrollPosition, GUIStyle style)
            {
                Scroll scrl = new Scroll();
				scrollPosition = GUILayout.BeginScrollView(scrollPosition, style);
                return scrl;
            }
 public override void Process()
 {
     base.Process();
     if (TAB_PARENT.ITEM_SELECTED != INDEX)
     {
         PRODUCT_SCROLL = new Scroll(0, 0.3, 20);
         return;
     }
     PutOnProductInfo();
     PRODUCT_SCROLL.Process();
 }
			public static Scroll ScrollView(ref Vector2 scrollPosition, params GUILayoutOption[] options)
            {
                Scroll scrl = new Scroll();
				scrollPosition = GUILayout.BeginScrollView(scrollPosition, options);
                return scrl;
            }
 public TabButton(int index, Dictionary<string, Bitmap> images, string text, Station parent, Rectangle rect, Rectangle region = default(Rectangle))
     : base(index, text, parent, rect, null, region)
 {
     ITEM_SCROLL = new Scroll(0, 0.3, ITEM_RECT.Width);
     Rectangle item_rect = ITEM_RECT;
     for (int i = 0; ; i++, item_rect.X += item_rect.Width)
     {
         string s = text + i.ToString();
         if (UpgradeInfo.Get(s) == null) return;
         ItemButton item = new ItemButton(this, i, s, parent, item_rect, text != "Blade" && text != "Swashplate" ? images[s] : null, ITEM_REGION);
         item.Click += ITEM_Click;
         item.ClickLocked += item_ClickLocked;
         ITEM.Add(item);
     }
 }
			public static Scroll ScrollView(ref Vector2 scrollPosition, bool alwaysShowHorizontal, bool alwaysShowVertical, params GUILayoutOption[] options)
            {
                Scroll scrl = new Scroll();
				scrollPosition = GUILayout.BeginScrollView(scrollPosition, alwaysShowHorizontal, alwaysShowVertical, options);
                return scrl;
            }
Beispiel #55
0
 void Start()
 {
     switch(baseItemType) {
     case BaseItem.BaseItemType.Weapon:
         weaponItem = new Weapon(material, plus, weaponType);
         break;
     case BaseItem.BaseItemType.Armor:
         armorItem = new Armor(material, plus, armorType);
         break;
     case BaseItem.BaseItemType.Ingredient:
         ingredientItem = new Ingredient(ingredientName);
         break;
     case BaseItem.BaseItemType.Food:
         foodItem = new Food(foodName);
         break;
     case BaseItem.BaseItemType.Potion:
         potionItem = new Potion(potionName);
         break;
     case BaseItem.BaseItemType.Scroll:
         scrollItem = new Scroll(scrollName);
         break;
     case BaseItem.BaseItemType.Book:
         bookItem = new Book(bookName);
         break;
     case BaseItem.BaseItemType.Misc:
         miscItem = new Misc(miscName);
         break;
     default:
         break;
     }
 }
Beispiel #56
0
        //Functions for handling attack lists and talismans
        public void handle_attack_damage(Weapon w, Scroll s, double initialMultiplier, bool charge_attack, out bool rolledMax,
                                         ref List<Attack> attacksOut, ref List<StatusEffect> effectsOut)
        {
            rolledMax = false;

            int mindmg = 0;
            int maxdmg = 0;
            Attack.Damage dmgTyp = 0;
            List<Talisman> equipped_talismans = new List<Talisman>();
            List<Attack> temp_attacks = new List<Attack>();
            if (w != null)
            {
                mindmg = w.specific_damage_val(false);
                maxdmg = w.specific_damage_val(true);
                dmgTyp = w.get_my_damage_type();
                equipped_talismans = w.get_my_equipped_talismans();
            }
            else if (s != null)
            {
                mindmg = s.get_specific_damage(false);
                maxdmg = s.get_specific_damage(true);
                dmgTyp = s.get_damage_type();
                equipped_talismans = s.get_my_equipped_talismans();
            }

            int baseDamage = rGen.Next(mindmg, maxdmg + 1);
            if(w != null)
                rolledMax = baseDamage == w.specific_damage_val(true);

            //next we check for a talisman of expediency.
            for (int i = 0; i < equipped_talismans.Count; i++)
            {
                if (equipped_talismans[i].get_my_type() == Talisman.Talisman_Type.Expediency)
                {
                    int base_val = (int)equipped_talismans[i].get_my_prefix() + 2;
                    int min_damage_modifier = base_val;
                    int max_damage_modifier = (base_val * 2);
                    if (baseDamage > 0)
                        baseDamage += rGen.Next(min_damage_modifier, max_damage_modifier + 1);
                }
            }

            //Next we check for Thrashing damage
            int thrashing_slot = check_for_status_effect(Scroll.Status_Type.Thrashing);
            if (thrashing_slot != -1)
            {
                int thrashing_stacks = BuffDebuffTracker[thrashing_slot].get_current_stacks();
                int thrashing_bonus = rGen.Next( thrashing_stacks * 2, (thrashing_stacks * 3) + 1);
                baseDamage += thrashing_bonus;
            }

            //Next we see if the spell is a rage dump and add bonus damage as appropriate
            if (s != null && s.spell_is_rage_dump())
            {
                baseDamage += s.get_rage_bonus(c_energy, rGen);
                c_energy = 0;
            }

            //Now we add any talisman based attacks.
            for (int i = 0; i < equipped_talismans.Count; i++)
            {
                if (equipped_talismans[i].extra_damage_specific_type_talisman())
                {
                    int base_val = (int)equipped_talismans[i].get_my_prefix() + 1;
                    Attack.Damage dmg_typ = 0;
                    switch (equipped_talismans[i].get_my_type())
                    {
                        case Talisman.Talisman_Type.Pressure:
                            dmg_typ = Attack.Damage.Crushing;
                            break;
                        case Talisman.Talisman_Type.Heat:
                            dmg_typ = Attack.Damage.Fire;
                            break;
                        case Talisman.Talisman_Type.Snow:
                            dmg_typ = Attack.Damage.Frost;
                            break;
                        case Talisman.Talisman_Type.Razors:
                            dmg_typ = Attack.Damage.Slashing;
                            break;
                        case Talisman.Talisman_Type.Heartsblood:
                            dmg_typ = Attack.Damage.Piercing;
                            break;
                        case Talisman.Talisman_Type.Toxicity:
                            dmg_typ = Attack.Damage.Acid;
                            break;
                        case Talisman.Talisman_Type.Sparks:
                            dmg_typ = Attack.Damage.Electric;
                            break;
                    }
                    temp_attacks.Add(new Attack(dmg_typ, rGen.Next(base_val, (base_val * 2) + 1), Weapon.Type.Talisman));
                }
            }
            //next, for characters. Falsael gets a bonus to all nonbow weapons
            //and melee spells. Petaer gets a bonus to all spells.
            if ((my_character == Character.Petaer && s != null) ||
               (my_character == Character.Falsael && ((w != null && w.get_my_weapon_type() != Weapon.Type.Bow) ||
                                                      (s != null && s.is_melee_range_spell()))))
                baseDamage = (int)(Math.Ceiling((double)baseDamage * 1.2));

            //Okay we're not quite done yet. First we need to check for weapon damage enhancing buffs.
            if (w != null) //This only works for weapons, not for spells.
            {
                for (int i = 0; i < BuffDebuffTracker.Count; i++)
                {
                    Scroll.Status_Type effect_typ = BuffDebuffTracker[i].get_my_type();

                    if (w != null && effect_typ == Scroll.Status_Type.LynxFer)
                        initialMultiplier += .2;
                    else if (w != null && effect_typ == Scroll.Status_Type.PantherFer)
                        initialMultiplier += .4;
                    else if (w != null && effect_typ == Scroll.Status_Type.TigerFer)
                        initialMultiplier += .6;
                }
                //Then we multiply all the attacks by that.
                baseDamage = (int)((double)baseDamage * initialMultiplier);
                for (int i = 0; i < temp_attacks.Count; i++)
                {
                    double attack_basedmg = (double)temp_attacks[i].get_damage_amt();
                    attack_basedmg *= initialMultiplier;
                    temp_attacks[i].reset_dmg((int)attack_basedmg);
                }
            }

            if (baseDamage > 0)
            {
                Weapon.Type w_typ = Weapon.Type.Monster;
                if (w != null)
                    w_typ = w.get_my_weapon_type();

                Attack baseAttack = new Attack(dmgTyp, baseDamage, w_typ);
                attacksOut.Add(baseAttack);
            }
            attacksOut.AddRange(temp_attacks);

            //Now we apply damage penalties where appropriate
            if (!charge_attack && w != null && w.get_my_weapon_type() == Weapon.Type.Lance)
                for (int i = 0; i < attacksOut.Count; i++)
                {
                    int atkdmg = attacksOut[i].get_damage_amt();
                    attacksOut[i].reset_dmg(atkdmg / 4);
                }
            //Horray, we're done with attacks! But we still need to do debuffs.
            if (s != null && s.get_spell_type() == Scroll.Atk_Area_Type.enemyDebuff)
                effectsOut.Add(new StatusEffect(s.get_status_effect(), s.get_duration(), s.does_spell_buff_count_down(), s.get_cost_per_turn(), s.get_cost_per_turn_per_turn(), false));

            for (int i = 0; i < equipped_talismans.Count; i++)
            {
                bool add_fx = false;
                int talisman_qualVal = 1 + (int)equipped_talismans[i].get_my_prefix();
                int fx_chance = 0;
                int fx_duration = 0;
                Scroll.Status_Type fx_type = Scroll.Status_Type.None;
                switch (equipped_talismans[i].get_my_type())
                {
                    case Talisman.Talisman_Type.Distruption:
                        add_fx = true;
                        fx_chance = talisman_qualVal * 4;
                        fx_duration = talisman_qualVal + 2;
                        fx_type = Scroll.Status_Type.Disrupt;
                        break;
                    case Talisman.Talisman_Type.Thunder:
                        add_fx = true;
                        fx_chance = talisman_qualVal * 2;
                        fx_duration = Math.Max(talisman_qualVal - 1, 1);
                        fx_type = Scroll.Status_Type.Stun;
                        break;
                    case Talisman.Talisman_Type.Grasping:
                        add_fx = true;
                        fx_chance = talisman_qualVal * 4;
                        fx_duration = talisman_qualVal;
                        fx_type = Scroll.Status_Type.Root;
                        break;
                }

                if (add_fx)
                {
                    if (rGen.Next(100) < fx_chance)
                        effectsOut.Add(new StatusEffect(fx_type, fx_duration, true, 0, 0, false));
                }
            }

            //Last but not least, attacking breaks lesser invisibility.
            for (int i = 0; i < BuffDebuffTracker.Count; i++)
                if (BuffDebuffTracker[i].get_my_type() == Scroll.Status_Type.Invisibility_Lesser)
                    BuffDebuffTracker.RemoveAt(i);
        }
Beispiel #57
0
        public void cast_spell(Scroll s, Floor fl, gridCoordinate spell_target, int target_monster_ID, int target_Doodad_ID)
        {
            string spell_name = s.get_my_name();
            Projectile.projectile_type prj_type = s.get_assoc_projectile();
            Attack.Damage spell_dmg_type = s.get_damage_type();
            gridCoordinate starting_coord = my_grid_coord;
            Projectile.special_anim spec_prj_anim = s.get_spec_impact_anim();

            c_energy -= s.get_manaCost();
            max_energy += s.get_en_cap_adj();

            if (max_energy > 100)
                max_energy = 100;
            if (max_energy < 0)
                max_energy = 0;

            if (s.get_spell_type() == Scroll.Atk_Area_Type.piercingBolt)
            {
                int spell_range = s.get_range();
                int relative_x = (spell_target.x - my_grid_coord.x) * spell_range;
                int relative_y = (spell_target.y - my_grid_coord.y) * spell_range;
                starting_coord = new gridCoordinate(spell_target);
                spell_target = new gridCoordinate(my_grid_coord.x + relative_x, my_grid_coord.y + relative_y);
            }

            if (s.get_spell_type() != Scroll.Atk_Area_Type.personalBuff)
            {
                Projectile prj = new Projectile(starting_coord, spell_target, prj_type,
                                                 ref cont, false, s.get_spell_type());
                prj.attach_scroll(s);
                prj.set_wall_destroying(s.spell_destroys_walls());
                prj.set_special_anim(spec_prj_anim);

                if (s.get_spell_type() == Scroll.Atk_Area_Type.enemyDebuff)
                {
                    prj.attach_status_effect(s.get_status_effect(), s.get_duration(), s.does_spell_buff_count_down(), s.get_cost_per_turn(), s.get_cost_per_turn_per_turn());
                }

                if (s.get_spell_type() == Scroll.Atk_Area_Type.cloudAOE ||
                    s.get_spell_type() == Scroll.Atk_Area_Type.solidblockAOE ||
                    s.get_spell_type() == Scroll.Atk_Area_Type.randomblockAOE)
                    prj.set_AOE_size(s.get_aoe_size());

                if (s.get_spell_type() == Scroll.Atk_Area_Type.chainedBolt)
                {
                    prj.set_bounce(s.get_range());
                    prj.set_bounces_left(s.get_t_impacts());
                }

                if (String.Compare(s.get_my_name(), "Earthquake") == 0)
                    prj.set_special_anim(Projectile.special_anim.Earthquake);

                prj.set_talisman_effects(s.get_my_equipped_talismans());
                fl.create_new_projectile(prj);
            }
            else
            {
                int base_buff_time = s.get_duration();
                int modified_buff_time = base_buff_time;
                if (my_character == Character.Petaer)
                {
                    double buff_time_bonus = (double)modified_buff_time * .3;
                    modified_buff_time = (int)Math.Ceiling((double)modified_buff_time + buff_time_bonus);
                }
                add_single_statusEffect(new StatusEffect(s.get_status_effect(), modified_buff_time+1, s.does_spell_buff_count_down(), s.get_cost_per_turn(), s.get_cost_per_turn_per_turn(), false));
            }
        }
Beispiel #58
0
        public int check_for_status_effect(Scroll.Status_Type seffect)
        {
            int target_index = -1;
            for (int i = 0; i < BuffDebuffTracker.Count; i++)
                if (seffect == BuffDebuffTracker[i].get_my_type())
                    target_index = i;

            return target_index;
        }
Beispiel #59
0
        public void handle_armor_buffs(Scroll.Status_Type fx_type, ref Attack atk)
        {
            int slash_resist = 0;
            int crush_resist = 0;
            int pierce_resist = 0;
            int fire_resist = 0;
            int acid_resist = 0;
            int frost_resist = 0;
            int elec_resist = 0;

            switch (fx_type)
            {
                case Scroll.Status_Type.LesserMageArmor:
                    slash_resist = 3;
                    crush_resist = 2;
                    pierce_resist = 3;
                    fire_resist = 1;
                    frost_resist = 1;
                    acid_resist = 1;
                    elec_resist = 2;
                    break;
                case Scroll.Status_Type.LesserSOF:
                    slash_resist = 1;
                    crush_resist = 1;
                    pierce_resist = 2;
                    fire_resist = 1;
                    frost_resist = 2;
                    acid_resist = 1;
                    elec_resist = 1;
                    break;
            }

            int atk_dmg = atk.get_damage_amt();
            switch (atk.get_dmg_type())
            {
                case Attack.Damage.Acid:
                    atk.reset_dmg(atk_dmg - acid_resist);
                    break;
                case Attack.Damage.Crushing:
                    atk.reset_dmg(atk_dmg - crush_resist);
                    break;
                case Attack.Damage.Electric:
                    atk.reset_dmg(atk_dmg - elec_resist);
                    break;
                case Attack.Damage.Fire:
                    atk.reset_dmg(atk_dmg - fire_resist);
                    break;
                case Attack.Damage.Frost:
                    atk.reset_dmg(atk_dmg - frost_resist);
                    break;
                case Attack.Damage.Piercing:
                    atk.reset_dmg(atk_dmg - pierce_resist);
                    break;
                case Attack.Damage.Slashing:
                    atk.reset_dmg(atk_dmg - slash_resist);
                    break;
            }
        }
Beispiel #60
0
        public void add_starting_gear()
        {
            switch (my_class)
            {
                case Chara_Class.Warrior:
                    main_hand = new Weapon(new_random_ID_number(), 100, "Knife", "ICON1_ICON", new List<Item.Item_Properties>(), Weapon.Type.Sword, 1, 3, 4, 1);
                    off_hand = null;
                    over_armor = new Armor(new_random_ID_number(), 100, "Shoddy Leather", "ICON1_ICON", 2, 2, 1, 0, 1, 1, 1, 23, Armor.Armor_Type.Overarmor);
                    under_armor = new Armor(new_random_ID_number(), 100, "Linen Rags", "ICON1_ICON", 0, 1, 0, 0, 2, 1, 2, 12, Armor.Armor_Type.Underarmor);

                    c_energy = 0;
                    max_energy = 100;
                    break;
                case Chara_Class.Rogue:
                    main_hand = new Weapon(new_random_ID_number(), 100, "Knife", "ICON1_ICON", new List<Item.Item_Properties>(), Weapon.Type.Dagger, 1, 1, 2, 1);
                    off_hand = new Weapon(new_random_ID_number(), 100, "Knife", "ICON1_ICON", new List<Item.Item_Properties>(), Weapon.Type.Dagger, 1, 1, 2, 1);
                    over_armor = new Armor(new_random_ID_number(), 100, "Shoddy Leather", "ICON1_ICON", 1, 2, 1, 0, 1, 1, 1, 21, Armor.Armor_Type.Overarmor);
                    under_armor = null;

                    /*Scroll spell_1 = new Scroll(new_random_ID_number(), 200, "Fr0c Blind", 1, 15, 3, 1, 0, 0, false, Scroll.Atk_Area_Type.enemyDebuff,
                                                Projectile.projectile_type.Lightning_Bolt, Attack.Damage.Crushing, false, 0,
                                                Scroll.Status_Type.Blind, 5, Projectile.special_anim.None, false, 0, 0, 0, 3);
                    inventory.Add(spell_1); */

                    c_energy = 50;
                    max_energy = 50;
                    break;
                case Chara_Class.Mage:
                    main_hand = null;
                    off_hand = null;
                    over_armor = new Armor(new_random_ID_number(), 100, "Linen Rags", "ICON1_ICON", 0, 0, 0, 1, 1, 1, 2, 20, Armor.Armor_Type.Overarmor);
                    under_armor = null;
                    Scroll spell_2 = new Scroll(new_random_ID_number(), 200, "Force Needle", "ICON1_ICON", 1, 15, 3, 1, 2, 4, false, Scroll.Atk_Area_Type.singleTile,
                                                Projectile.projectile_type.Lightning_Bolt, Attack.Damage.Crushing, false, 0,
                                                Scroll.Status_Type.None, 0, false, 0, 0, Projectile.special_anim.None, false, 0, 0, 0, 0);
                    inventory.Add(spell_2);

                    c_energy = 100;
                    max_energy = 100;
                    break;
                case Chara_Class.ExPriest:
                    main_hand = new Weapon(new_random_ID_number(), 100, "Flanged Mace", "ICON1_ICON", new List<Item.Item_Properties>(), Weapon.Type.Mace, 1, 3, 4, 1);
                    off_hand = null;
                    over_armor = new Armor(new_random_ID_number(), 100, "Shoddy Leather", "ICON1_ICON", 2, 2, 1, 0, 1, 1, 1, 30, Armor.Armor_Type.Overarmor);
                    under_armor = new Armor(new_random_ID_number(), 100, "Linen Rags", "ICON1_ICON", 0, 1, 0, 0, 2, 1, 2, 10, Armor.Armor_Type.Underarmor);

                    c_energy = 100;
                    max_energy = 100;
                    break;
            }
        }