Ejemplo n.º 1
0
        // ***************************************************************************
        // Clont Object
        public Munition Clone()
        {
            Munition m = new Munition(TypeId, Group, Name, new List<int>(buffIDs), Count, ShotId, Damage, Description, Weight, LocationBehavior.Clone());
            m.Renderer = Renderer;

            if (ShotRenderer == null)
                m.ShotRenderer = Renderer;
            else
                m.ShotRenderer = ShotRenderer;

            return m;
        }
Ejemplo n.º 2
0
        private void SwitchMun( Munition newMunition, UIShortcutButton button )
        {
            Weapon oldWeapon = button.Weapon;

            if ( oldWeapon != null )
            {
                if ( oldWeapon.Munition != null )
                {
                    Munition oldMun = button.Weapon.Munition;
                    Munition newMun = newMunition.Clone();

                    if ( newMun.TypeId == oldMun.TypeId )
                    {
                        button.Weapon.Reload();
                    }
                    else
                    {
                        //mun setzten
                        player.AddItemToInventar( oldMun );
                        filteredInventarList.AddItem( oldMun );

                        newMun.Count = Math.Min( player.Inventar[ newMun.TypeId ], newMun.MagazineSize );

                        button.Weapon.Munition = newMun;
                        player.RemoveItemFromInventar( newMun );
                    }

                }
                else
                {
                    //mun ändern
                    // Wenn die Waffe, die am Shortcut "klebt" auch munition hat
                    newMunition.Count = Math.Min( player.GetItemCountFromInventar( newMunition.TypeId ), newMunition.MagazineSize );
                    button.Weapon.Munition = newMunition;
                    player.RemoveItemFromInventar( newMunition );
                }
            }
        }
Ejemplo n.º 3
0
 private void DrawMun( Microsoft.Xna.Framework.Graphics.SpriteBatch sb, Munition mun )
 {
     sb.DrawString( UIButton.FONT_DEFAULT, mun.Name, new Vector2( TEXT_PADDING + textX, TEXT_PADDING + textY ), Color.Black );
     sb.DrawString( UIButton.FONT_DEFAULT, "Schaden: " + mun.Damage, new Vector2( TEXT_PADDING + textX, TEXT_PADDING + textY + TEXT_LINE_HEIGHT * 2 ), Color.Black );
     sb.DrawString( UIButton.FONT_DEFAULT, "Magazin: " + mun.MagazineSize, new Vector2( TEXT_PADDING + textX, TEXT_PADDING + textY + TEXT_LINE_HEIGHT * 3 ), Color.Black );
     sb.DrawString( UIButton.FONT_DEFAULT, "Gewicht: " + mun.Weight, new Vector2( TEXT_PADDING + textX, TEXT_PADDING + textY + TEXT_LINE_HEIGHT * 4 ), Color.Black );
 }
Ejemplo n.º 4
0
        private void DrawMun(Microsoft.Xna.Framework.Graphics.SpriteBatch sb, Munition mun)
        {
            int x = (int)(GetPosition().X);
            int y = (int)(GetPosition().Y);

            sb.DrawString(UIButton.FONT_DEFAULT, mun.Name, new Vector2(padding + x, padding + y), Color.Black);
            sb.DrawString(UIButton.FONT_DEFAULT, "Schaden: " + mun.Damage + " Magazin: " + mun.MagazineSize, new Vector2(padding + x, padding + y + lineHeight), Color.Black);
            sb.DrawString(UIButton.FONT_DEFAULT, "Gewicht: " + mun.Weight, new Vector2(padding + x, padding + y + lineHeight * 2), Color.Black);
        }