Beispiel #1
0
        public void gain_stats(Dictionary <TactileLibrary.Boosts, int> boosts)
        {
            Glow_Timer = 0;
            Timer      = STAT_GAIN_TIME;
            Arrows.Clear();
            Stat_Gains.Clear();
            Swirls.Clear();

            foreach (KeyValuePair <TactileLibrary.Boosts, int> pair in boosts)
            {
                Vector2 loc;
                if (pair.Key == TactileLibrary.Boosts.Con)
                {
                    loc = new Vector2(16 + ((((int)Stat_Labels.Con) / 4) * SPACING()), (((int)Stat_Labels.Con) % 4) * 16);
                }
                else
                {
                    loc = new Vector2(16 + ((((int)pair.Key) / 4) * SPACING()), ((((int)pair.Key) % 4) * 16));
                }

                Stat_Gains.Add(new Quick_Stat_Up_Num(new List <Texture2D> {
                    Global.Content.Load <Texture2D>(@"Graphics/Fonts/" + Config.PROMOTION_STAT_FONT),
                    Global.Content.Load <Texture2D>(@"Graphics/Fonts/" + Config.LEVEL_STAT_FONT)
                }));
                Stat_Gains[Stat_Gains.Count - 1].value = pair.Value;
                Stat_Gains[Stat_Gains.Count - 1].loc   = loc + new Vector2(40, 23);
                Arrows.Add(new Stat_Change_Arrow());
                Arrows[Arrows.Count - 1].texture = Global.Content.Load <Texture2D>(@"Graphics/Pictures/" + Stat_Change_Arrow.FILENAME);
                Arrows[Arrows.Count - 1].loc     = loc + new Vector2(32, 1);
                ((Stat_Change_Arrow)Arrows[Arrows.Count - 1]).update(0);
                Swirls.Add(new Stat_Up_Spark());
                Swirls[Swirls.Count - 1].loc = loc + new Vector2(-5, -7);
                Swirls[Swirls.Count - 1].update();
            }
        }
Beispiel #2
0
        private void Shoot()
        {
            var arrow = new Arrow(Game, Position);

            Arrows.Add(arrow);
            arrow.LoadContent(Game.Content, "Arrow");
            arrow.Position          = Position;
            arrow.Direction         = Rotation;
            arrow.RotationInRadians = new Vector3(Rotation.X, Rotation.Y, Rotation.Z);
            //    arrow.Direction.Normalize();
            arrow.Fire(ArrowForce);
        }
Beispiel #3
0
        private void AddArrow(Vector3 position, Vector3 normal, Color color)
        {
            Arrow outerArrow = new Arrow(GraphicsDevice);

            outerArrow.Thickness    = 0.005f;
            outerArrow.HeadSize     = new Vector2(0.03f, 0.1f);
            outerArrow.FromPosition = position;
            outerArrow.ToPosition   = position + normal * 0.5f;
            outerArrow.BodyColor    = color;
            outerArrow.HeadColor    = Color.White;
            outerArrow.UpdateValues();
            Arrows.Add(outerArrow);
        }
Beispiel #4
0
        private void LoadArrows()
        {
            foreach (var path in ArrowsPath)
            {
                Arrow obj = Resources.Load <Arrow>(path);

                if (Arrows.ContainsKey(obj.name))
                {
                    throw new System.Exception($"存在重名文件{obj.name}!");
                }

                Arrows.Add(obj.name, obj);
            }
        }
        public override void SetScale(double value)
        {
            HeaderLine.SetScale(value);
            HeaderLine.SetTranslate(0, -Height * value + Height);
            Arrows.ForEach(e => e.Remove());

            Spacings = 10 * value;
            var span = Math.Sqrt(
                Math.Pow(StartPoint.X - EndPoint.X, 2) +
                Math.Pow(StartPoint.Y - EndPoint.Y, 2));

            var spaces = Split.Equal(span * value, Spacings);

            foreach (var space in spaces)
            {
                var arrow = new Arrow(GCanvas, new Point(StartPoint.X + space, StartPoint.Y), Height * value);
                arrow.Rotate(180);

                Arrows.Add(arrow);
            }
            HeaderLine.Remove();
            Render();
        }
        protected virtual bool update_stat()
        {
            bool stat_sound = false;

            switch (Timer)
            {
            case 0:
                if (OnLevelGain)
                {
                    get_stats();
                    Global.Audio.play_se("System Sounds", "Level_Up_Level");
                }
                else
                {
                    Stat_Gain = LevelUp.StatGain((Stat_Labels)ActiveStat);
                    gain_stat((Stat_Labels)ActiveStat);
                    if (Skipping)
                    {
                        stat_sound = true;
                    }
                    else
                    {
                        Global.game_system.play_se(System_Sounds.Level_Up_Stat);
                    }
                }
                refresh();
                break;

            case 1:
                Swirls.Add(new Stat_Up_Spark());
                if (OnLevelGain)
                {
                    Swirls[Swirls.Count - 1].loc = Header_Loc + new Vector2(80, -16) - Header_Offset + new Vector2(1, 1);
                }
                else
                {
                    Vector2 stat_loc = new Vector2(
                        (ActiveStat / COLUMN_HEIGHT) * 64,
                        (ActiveStat % COLUMN_HEIGHT) * 16);

                    Swirls[Swirls.Count - 1].loc = loc + stat_loc +
                                                   new Vector2(16, -16) +
                                                   new Vector2(0, -2);
                    Arrows.Add(new Stat_Change_Arrow());
                    Arrows[Arrows.Count - 1].texture = Arrow_Texture;
                    Arrows[Arrows.Count - 1].loc     = loc + stat_loc +
                                                       new Vector2(56, -8) +
                                                       new Vector2(-3, -2);
                    if (Stat_Gain > 0)
                    {
                        Bars.Add(new Stat_Change_Bar());
                        Bars[Bars.Count - 1].texture = Bar_Texture;
                        Bars[Bars.Count - 1].loc     = loc + stat_loc +
                                                       new Vector2(12, 12) +
                                                       new Vector2(-2, -3);
                    }
                }
                // Effects
                break;

            case 15:
                if (!OnLevelGain)
                {
                    Stat_Gains.Add(new Stat_Up_Num(Stat_Gain_Textures));
                    Stat_Gains[Stat_Gains.Count - 1].value = Stat_Gain;
                    Stat_Gains[Stat_Gains.Count - 1].loc   = loc +
                                                             new Vector2(
                        64 + ((ActiveStat / COLUMN_HEIGHT) * 64),
                        14 + ((ActiveStat % COLUMN_HEIGHT) * 16)) +
                                                             new Vector2(-3, -3);
                }
                // Numbers
                break;

            case 17:
                // Large numbers appear here on promotion? //Yeti
                break;

            case 20:
                get_next_stat();
                Timer = 0;
                return(false);
            }
            Timer++;
            return(stat_sound);
        }
 void CreateArrows()
 {
     Arrows.Add(new BigArrow(new Point(inputNodes[0].X - arrowLength, inputNodes[0].Y), inputNodes[0]));
     Arrows.Add(new BigArrow(inputNodes[1], new Point(inputNodes[1].X + arrowLength, inputNodes[1].Y)));
 }
 void CreateArrows()
 {
     Arrows.Add(new BigArrow(inputNodes[0], new Point(center.X + offsetX, center.Y - offsetY - Height / 2)));
     Arrows.Add(new BigArrow(inputNodes[1], new Point(center.X, center.Y - offsetY - Height / 2)));
     Arrows.Add(new BigArrow(inputNodes[2], new Point(center.X - offsetX, center.Y - offsetY - Height / 2)));
 }
Beispiel #9
0
 public void AddArrow(VectorArrow arrow)
 {
     Arrows.Add(arrow);
 }
Beispiel #10
0
        public void TakeString(string Arrow, string Drop, string Player)
        {
            var           arr    = Arrow.Split(',');
            HashSet <int> IsUsed = new HashSet <int>();

            for (int i = 0; i < arr.Length; i++)
            {
                var small = arr[i].Split(' ');
                int tag   = Utily.Parse(small[0]);
                int dmg   = Utily.Parse(small[1]);
                int id    = Utily.Parse(small[2]);
                if (Arrows.ContainsKey(tag))
                {
                    Arrows[tag].dmg = dmg;
                    Arrows[tag].id  = id;
                }
                else
                {
                    Arrows.Add(tag, new AArrow(dmg, id));
                    ArrowEvent.Enqueue(tag);
                }
                IsUsed.Add(tag);
            }
            List <int> ForRemove = new List <int>();

            foreach (var i in Arrows)
            {
                if (!IsUsed.Contains(i.Key))
                {
                    ForRemove.Add(i.Key);
                    ArrowEvent.Enqueue(-i.Key);
                }
            }
            foreach (var i in ForRemove)
            {
                Arrows.Remove(i);
            }

            var dro = Drop.Split(',');

            IsUsed.Clear();
            for (int i = 0; i < arr.Length; i++)
            {
                var small = dro[i].Split(' ');
                int tag   = Utily.Parse(small[0]);
                int cnt   = Utily.Parse(small[1]);
                int id    = Utily.Parse(small[2]);
                if (Drops.ContainsKey(tag))
                {
                    Drops[tag].Count = cnt;
                    Drops[tag].id    = id;
                }
                else
                {
                    Drops.Add(tag, new ADrop(cnt, id));
                    DropEvent.Enqueue(tag);
                }
                IsUsed.Add(tag);
            }
            ForRemove.Clear();
            foreach (var i in Drops)
            {
                if (!IsUsed.Contains(i.Key))
                {
                    ForRemove.Add(i.Key);
                    DropEvent.Enqueue(-i.Key);
                }
            }
            foreach (var i in ForRemove)
            {
                Drops.Remove(i);
            }

            var pla = Player.Split(',');

            IsUsed.Clear();
            for (int i = 0; i < arr.Length; i++)
            {
                var small = pla[i].Split(' ');
                int tag   = Utily.Parse(small[0]);
                int kill  = Utily.Parse(small[1]);
                int death = Utily.Parse(small[2]);
                if (ArenaPlayer.ContainsKey(tag))
                {
                    ArenaPlayer[tag].RealName = small[3];
                    IsUsed.Add(tag);
                }
                else
                {
                    ArenaPlayer.Add(tag, new APlayer(small[3]));
                }
                ArenaPlayer[tag].Kill  = kill;
                ArenaPlayer[tag].Death = death;
            }
            ForRemove.Clear();
            foreach (var i in ArenaPlayer)
            {
                if (!IsUsed.Contains(i.Key))
                {
                    ForRemove.Add(i.Key);
                }
            }
            foreach (var i in ForRemove)
            {
                ArenaPlayer.Remove(i);
            }
        }