Esempio n. 1
0
 public Item(
     string itemName = "Default",
     ItemType itemType = ItemType.None,
     StatSystem itemStats = null,
     DamageType damageType = DamageType.None,
     AmmoType itemShoots = AmmoType.None,
     ItemQuality itemQuality = ItemQuality.None,
     double value = 0.0,
     int x = 0,
     int y = 0,
     int quantity = 1)
 {
     if (itemStats != null)
     {
         Stats = itemStats;
     }
     else
     {
         Stats = new StatSystem();
     }
     Name = itemName;
     type = itemType;
     ammo = itemShoots;
     Count = quantity;
     Quality = itemQuality;
     damage = damageType;
     Value = value;
     MapX = x;
     MapY = y;
 }
Esempio n. 2
0
 /// <summary>
 /// Get the price of a specified bullet type.
 /// </summary>
 /// <param name='ammo'>
 /// The type of ammo to get the price of.
 /// </param>
 public static float Get(AmmoType ammo)
 {
     switch (ammo) {
     case AmmoType.Parabellum9x19mm:	return 1;
     case AmmoType.NATO762x51mm:		return 2;
     case AmmoType.FMJ762x39mm: 		return 3;
     case AmmoType.FourtyCMBolt:		return 4;
     case AmmoType.Grenade40mm:		return 20;
     case AmmoType.BMG50:			return 5;
     case AmmoType.ChargeCapsule:	return 20;
     default:						return 1;
     }
 }
Esempio n. 3
0
	public Item(string name,string desc, ItemType type,int value,AmmoType ammo,int clips,int currenta,bool stack,float food,float drink)
	{
		itemName = name;
		itemDesc = desc;
		itemType = type;
		itemIcon = Resources.Load<Sprite>(name);
		itemValue = value;
		ammoType = ammo;
		clipSize = clips;
		currentAmmo = currenta;
		itemModel = Resources.Load<GameObject>(name);
		Stackable = stack;
		DrinkAmount = drink;
		FeedAmount = food;
	}
Esempio n. 4
0
 public WeaponInfo(WeaponData data)
 {
     this.power = data.power;
     this.ammoType = data.ammoType;
     this.ammo = data.maxAmmo;
     this.maxAmmo = data.maxAmmo;
     this.fireType = data.fireType;
     this.fireRate = data.fireRate;
     this.fireTimer = 0f;
     this.isCharging = false;
     this.maxChargeTime = data.maxChargeTime;
     this.chargeTimer = 0f;
     this.weaponType = data.weaponType;
     this.weaponPrefab = data.weaponPrefab;
 }
Esempio n. 5
0
        /// <summary>
        /// Used to refile ammo when ammo box picked up
        /// </summary>
        public void PickUpAmmo(AmmoType ammoType, int amount)
        {
            PlayerController pc = GameController.Player;

            if (ammoType == AmmoType.AmmoType0)
            {
                ammoCarriedType0 += amount;

                if (pc.isCarter())
                {
                    pc.DisplayInfoWeapon1(ammoCarriedType0, pc.weapCCarter.doubleGuns.magazine);
                }
                else
                {
                    pc.DisplayInfoWeapon1(ammoCarriedType0, pc.weapCHartman.assaultRifle.magazineBullet);
                }
            }
            else
            {
                ammoCarriedType1 += amount;

                if (pc.isCarter())
                {
                    pc.DisplayInfoWeapon2(ammoCarriedType1, pc.weapCCarter.flamethrower.magazine);
                }
                else
                {
                    pc.DisplayInfoWeapon2(ammoCarriedType1, pc.weapCHartman.assaultRifle.magazineGrenade);
                }
            }

            GameController.NotifyPlayer("+" + amount + " Ammo !", Color.green, 1);

            /*SOUNDS*/

            if (sndPickUp)
            {
                AudioSource listener = GetComponent<AudioSource>();
                listener.PlayOneShot(sndPickUp, 2.5f);
            }
            
        }
Esempio n. 6
0
 public int GetAmmo(AmmoType ammoType)
 {
     return _ammo.ContainsKey(ammoType) ? _ammo[ammoType] : 0;
 }
Esempio n. 7
0
 public bool HasAmmo(AmmoType ammoType, int amount)
 {
     return ammoType == AmmoType.Infinite || GetAmmo(ammoType) > amount;
 }
Esempio n. 8
0
 public static string ToString(AmmoType type)
 {
     switch(type)
     {
         case AmmoType.Bullet9mm:
             return "9 mm";
         default:
             throw new InvalidEnumArgumentException("type", (int)type, typeof(AmmoType));
     }
 }
Esempio n. 9
0
 public void RemoveAmmo(AmmoType ammoType, int amount)
 {
     if (_ammo.ContainsKey(ammoType))
     {
         _ammo[ammoType] -= amount;
     }
 }
Esempio n. 10
0
 public BaseCannon(BaseGalleon galleon)
 {
     Movable = false;
     m_Cleaned = true;
     m_Charged = false;
     m_Primed = false;
     m_Galleon = galleon;
     m_AmmoType = AmmoType.Empty;
     m_Hits = MaxHits;
     m_DamageState = DamageLevel.Pristine;
 }
Esempio n. 11
0
        public void Load(object state)
        {
            object[] obj = (object[])state;
            Mobile from = obj[0] as Mobile;
            Item ammo = obj[1] as Item;
            int cliloc = 1116062;

            if (ammo is ICannonAmmo && ((ICannonAmmo)ammo).AmmoType == AmmoType.Grapeshot)
                cliloc = 1116063;

            if (m_AmmoType != AmmoType.Empty)
            {
                AddAction(from, 1149663); //Must unload first.
                from.SendLocalizedMessage(1149663);
            }
            else if (from.InRange(this.Location, 3))
            {
                if (TryLoadAmmo(ammo) && ammo is ICannonAmmo)
                {
                    AddAction(from, 1149649); //Loading finished
                    DoAreaMessage(cliloc, 10, from); //~1_NAME~ finishes loading the cannon with a cannonball.
                    m_AmmoType = ((ICannonAmmo)ammo).AmmoType;
                    m_LoadedAmmo = ammo.GetType();
                    ammo.Consume();
                }
            }
            else
            {
                cliloc = ammo is ICannonAmmo && ((ICannonAmmo)ammo).AmmoType == AmmoType.Cannonball ? 1116057 : 1116058;
                AddAction(from, 1149648); //Loading canceled.
                DoAreaMessage(cliloc, 10, from); //~1_NAME~ cancels the effort of loading the cannon and retrieves the cannonball.
            }

            if (from.HasGump(typeof(CannonGump)))
                ResendGump(from);

            InvalidateProperties();
        }
Esempio n. 12
0
 /// <summary>
 /// Sets the amount of a specified <see cref="AmmoType">ammo type</see>.
 /// </summary>
 /// <param name="player"></param>
 /// <param name="ammoType"></param>
 /// <param name="amount"></param>
 public static void SetAmmo(this ReferenceHub player, AmmoType ammoType, int amount) => player.ammoBox.SetOneAmount((int)ammoType, amount.ToString());
Esempio n. 13
0
 public AmmoItemModel(string name, float weight, float value, float maxCondition, int maxQuantity, bool hidden, bool essential, string[] flags, ItemScriptNode scripts, string worldModel, AmmoType type) :
     base(name, weight, value, maxCondition, maxQuantity, hidden, essential, flags, scripts, worldModel)
 {
     Type      = type;
     Stackable = true;
 }
Esempio n. 14
0
 public static void PlayGunSound(AmmoType type)
 {
     gunSound[type].Play();
 }
Esempio n. 15
0
 public void AddAmmo(AmmoType ammoType, int amount)
 {
     if (_ammo.ContainsKey(ammoType))
     {
         _ammo[ammoType] += amount;
     }
     else
     {
         _ammo.Add(ammoType, amount);
     }
 }
Esempio n. 16
0
 public static AmmoInfo DefaultAmmoInfo(AmmoType type)
 {
     return defaultAmmoInfo[type];
 }
Esempio n. 17
0
        public Ammo(SpriteInfo spriteInfo, AmmoState ammoState, Vector2 position)
            : base(spriteInfo, ammoState.ammoInfo.realSize, position, ammoState.ammoInfo.speed)
        {
            this.team = ammoState.team;
            this.tankIndex = ammoState.tankIndex;
            this.needCheckForCollision = true;

            switch (ammoState.direction)
            {
                case Direction.Up:
                    SetSheetRow(0);
                    break;
                case Direction.Down:
                    SetSheetRow(1);
                    break;
                case Direction.Left:
                    SetSheetRow(2);
                    break;
                case Direction.Right:
                    SetSheetRow(3);
                    break;
            }
            this.ammoType = ammoState.ammoInfo.type;
            this.damage = ammoState.ammoInfo.damage;
            MovingDirection = ammoState.direction;
            this.range = ammoState.ammoInfo.range;
            this.damagedSprites = new List<Sprite>();
        }
Esempio n. 18
0
    private void Attacking()
    {
        throwStamina = Mathf.Clamp(throwStamina + Time.deltaTime * staminaRecoverySpeed, -1, totalThrowStamina);
        if (throwStamina >= totalThrowStamina)
        {
            staminaDepleted = false;
            StopParticleSystem(fatiguedPfx, true);
        }

        if (!input.Attacked || staminaDepleted)
        {
            return;
        }

        Vector2 direction = input.RightStick.normalized;

        if (direction.magnitude < 0.25f)
        {
            return;
        }

        GameObject currentProjectile;

        switch (ammoType)
        {
        case AmmoType.Normal:
            currentProjectile = projectilePrefab;
            break;

        case AmmoType.Phase:
            currentProjectile = phaseProjectilePrefab;
            break;

        default:
            currentProjectile = projectilePrefab;
            break;
        }
        if (ammoType != AmmoType.Normal)
        {
            specialAmmoCount--;
            if (specialAmmoCount == 0)
            {
                ammoType = AmmoType.Normal;
                phasePfx.Stop();
                //TODO reset visual effects
            }
        }


        var projectile = Instantiate(currentProjectile, (Vector2)transform.position + direction, Quaternion.identity);

        projectile.GetComponent <Rigidbody2D>().AddForce(direction * projectileSpeed, ForceMode2D.Impulse);
        projectile.GetComponent <NinjaStarController>().Thrower = this;
        audioSource.PlayOneShot(throwing);

        throwStamina -= throwStaminaDrain;
        if (throwStamina <= 0)
        {
            staminaDepleted = true;
            fatiguedPfx.Play();
            audioSource.PlayOneShot(fatigued);
        }
    }
Esempio n. 19
0
    void TeamAttack(Team team, Team targetTeam, float deltaTime)
    {
        Piece attackPiece;
        Piece pieceToHit;
        int   i;

        for (i = 0; i < team.Pieces.Count; i++)
        {
            attackPiece = team.Pieces[i];

            if (attackPiece.Status == PieceStatus.NORMAL && attackPiece.Ammo.AmmoCount() > 0 && !attackPiece.HasFlag)
            {
                if (attackPiece.CoolDownTimer <= 0.0f)
                {
                    AmmoData ammoData = AmmoManager.Instance.GetAmmoData((int)attackPiece.Ammo.GetNextAmmoType());
                    pieceToHit = targetTeam.FindClosestPiece(attackPiece.Position, attackPiece.RangeCalc, ammoData.RangeBonus);
                    if (pieceToHit != null)
                    {
                        AmmoType ammoType = attackPiece.Throw();
                        ThrowBalloon(attackPiece.GetTeam.GetColor, attackPiece.transform.localPosition, pieceToHit.transform.localPosition, ammoType);
                        if (pieceToHit.GetHit(ammoData.Damage))
                        {
                            // if flag was dropped (true for GetHit), set status of flag
                            if (team.GetColor == TeamColor.RED)
                            {
                                _redFlag.Status = FlagStatus.DROPPED;
                            }
                            else
                            {
                                _blueFlag.Status = FlagStatus.DROPPED;
                            }
                        }

                        // increment takedowns
                        if (pieceToHit.Status == PieceStatus.OUT)
                        {
                            attackPiece.Takedowns++;
                        }

                        //DataRecorder.AddHitToTurnData(attackPiece.ID, pieceToHit.ID);
                        attackPiece.CoolDownTimer = attackPiece.CoolDownTime;

                        // check the ranged damage
                        if (ammoData.SplashDamage != 0)
                        {
                            for (int j = 0; j < targetTeam.Pieces.Count; j++)
                            {
                                Piece pieceToCheck = targetTeam.Pieces[j];
                                if (pieceToCheck.Status == PieceStatus.NORMAL && pieceToCheck != pieceToHit)
                                {
                                    float distance = (pieceToHit.Position - pieceToCheck.Position).magnitude;
                                    if (distance <= ammoData.SplashRadius)
                                    {
                                        bool hasFlag = pieceToCheck.GetHit(ammoData.SplashDamage);
                                        if (pieceToCheck.Status == PieceStatus.OUT)
                                        {
                                            if (hasFlag)
                                            {
                                                if (team.GetColor == TeamColor.RED)
                                                {
                                                    _redFlag.Status = FlagStatus.DROPPED;
                                                }
                                                else
                                                {
                                                    _blueFlag.Status = FlagStatus.DROPPED;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    attackPiece.CoolDownTimer -= deltaTime;
                    if (attackPiece.CoolDownTimer <= 0.0f)
                    {
                        attackPiece.CoolDownTimer = 0.0f;
                    }
                    //Debug.Log("now timer = " + attackPlayer.CoolDownTimer);
                }
            }
        }
    }
Esempio n. 20
0
 /// <summary>
 /// Gets the amount of a specified <see cref="AmmoType">ammo type</see>.
 /// </summary>
 /// <param name="player"></param>
 /// <param name="ammoType"></param>
 public static int GetAmmo(this ReferenceHub player, AmmoType ammoType) => player.ammoBox.GetAmmo((int)ammoType);
Esempio n. 21
0
        public void RemoveLoad(Mobile from)
        {
            if (from == null || m_AmmoType == AmmoType.Empty)
                return;

            if (m_Charged)
                AddAction(from, 1149662); //Must remove charge first.
            else
            {
                int cliloc = 0;

                switch (m_AmmoType)
                {
                    case AmmoType.Cannonball:
                        cliloc = 1116066; //~1_NAME~ carefully removes the cannonball from the cannon.
                        break;
                    case AmmoType.Grapeshot:
                        cliloc = 1116067; //~1_NAME~ carefully removes the grapeshot from the cannon.
                        break;
                }

                Item item = Loot.Construct(m_LoadedAmmo);

                if (item != null)
                {
                    Container pack = from.Backpack;
                    if (pack != null || !pack.TryDropItem(from, item, false))
                        item.MoveToWorld(from.Location, from.Map);
                }

                m_AmmoType = AmmoType.Empty;
                AddAction(from, 1149685); //Ammunition removed.
                m_LoadedAmmo = null;

                if (cliloc > 0)
                    DoAreaMessage(cliloc, 10, from); //~1_NAME~ carefully removes the powder charge from the cannon.
            }

            if (from.HasGump(typeof(CannonGump)))
                ResendGump(from);

            InvalidateProperties();
        }
Esempio n. 22
0
        public static void Initialize(ShopContext db)
        {
            db.Database.EnsureCreated();

            if (db.Guns.Any())
            {
                return;
            }

            var pistolType  = new Type("Pistol", "Simple pistol");
            var rifleType   = new Type("Rifle", "Good rifle");
            var shotgunType = new Type("Shotgun", "Nice shotgun");

            db.Types.AddRange(pistolType, rifleType, shotgunType);
            db.SaveChanges();

            var pistolAmmo  = new AmmoType("9mm", "Ammo for pistols");
            var rifleAmmo   = new AmmoType("7.62×39mm", "Ammo for rifles");
            var shotgunAmmo = new AmmoType(".410 bore", "Ammo for shotguns");

            db.AmmoTypes.AddRange(pistolAmmo, rifleAmmo, shotgunAmmo);
            db.SaveChanges();

            db.Guns.AddRange(new List <Gun>
            {
                new Gun
                {
                    Name        = "Glock",
                    Model       = "18",
                    AmmoTypeId  = pistolAmmo.Id,
                    TypeId      = pistolType.Id,
                    Description = "The Glock pistol is a series of polymer-framed, short recoil-operated, " +
                                  "locked-breech semi-automatic pistols designed and produced by Austrian" +
                                  " Glock Ges.m.b.H.. It entered Austrian military and police service by " +
                                  "1982 after it was the top performer in reliability and safety tests.",
                    Year  = 1999,
                    Photo = "https://www.armurerie-steflo-lyon.com/2667-large_default/glock-43-9x19.jpg"
                },
                new Gun
                {
                    Name        = "AK",
                    Model       = "47",
                    AmmoTypeId  = rifleAmmo.Id,
                    TypeId      = rifleType.Id,
                    Description = "Design work on the AK-47 began in 1945. In 1946, the AK-47 was presented for " +
                                  "official military trials, and in 1948, the fixed-stock version was introduced " +
                                  "into active service with selected units of the Soviet Army. An early development " +
                                  "of the design was the AKS (S—Skladnoy or 'folding'), which was equipped with an " +
                                  "underfolding metal shoulder stock. In early 1949, the AK-47 was officially accepted " +
                                  "by the Soviet Armed Forces[8] and used by the majority of the member states of the Warsaw Pact.",
                    Year  = 1949,
                    Photo = "https://ii.cheaperthandirt.com/fcgi-bin/iipsrv.fcgi?FIF=/images/cheaperthandirt/source/2-cari2399-n_1.tif&wid=575&cvt=jpeg"
                },
                new Gun
                {
                    Name        = "Remington",
                    Model       = "870",
                    AmmoTypeId  = shotgunAmmo.Id,
                    TypeId      = shotgunType.Id,
                    Description = "The Remington Model 870 is a pump-action shotgun manufactured by Remington Arms Company, " +
                                  "LLC. It is widely used by the public for sport shooting, hunting, and self-defense and " +
                                  "used by law enforcement and military organizations worldwide.",
                    Year  = 1950,
                    Photo = "https://www.remington.com/sites/all/themes/remington2016/technology/img/product-tech-slider/shotgun/Model870-Wingmaster.jpg"
                }
            });

            db.Users.Add(new User
            {
                Name     = "Nikita",
                Password = "******",
                Username = "******"
            });

            db.SaveChanges();
        }
Esempio n. 23
0
        public string GetCommand(int entry, ItemClass iClass, int subClass, int unk0, string[] name,
            int dispId, ItemQuality quality, ItemFlag flags, ItemFlagExtra flags2, int buyPrice,
            int sellPrice, InventoryType invType, ClassMask allowClass, RaceMask allowRace, int itemLvl,
            int reqLvl, int reqSkill, int reqSkLvl, int reqSpell, int reqHonor, int reqCity,
            int reqRepFaction, int reqRepValue, int maxCount, int stacks, int contSlots, int statsCount,
            ItemModType[] statType, int[] statValue, int ssdId, int ssdVal, float[] dmgMin,
            float[] dmgMax, DamageType[] dmgType, int[] resistance, int delay, AmmoType ammoType,
            float rangedMod, int[] spellId, ItemSpellTriggerType[] spellTrigger, int[] spellCharges,
            int[] spellCooldown, int[] spellCategory, int[] spellCatCooldown, ItemBonding binding,
            string description, int pageText, Language langId, PageMaterial pageMat, int startQuest,
            int lockId, Material material, SheathType sheath, int randomProp, int randomSuffix,
            int block, int itemSet, int maxDura, int area, int map, BagFamilyMask bagFamily,
            TotemCategory totemCat, ItemSocketColor[] color, int[] content, int socketBonus,
            int gemProps, int reqDisEnchSkill, float armorDmgMod, int duration, int limitCategory,
            Holiday holidayId)
        {
            var builder = new CommandBuilder("item_template");

            builder.AddColumnValue("entry", entry);
            builder.AddColumnValue("class", (int)iClass);
            builder.AddColumnValue("subclass", subClass);
            builder.AddColumnValue("unk0", unk0);
            builder.AddColumnValue("name", name[0]);
            builder.AddColumnValue("displayid", dispId);
            builder.AddColumnValue("Quality", (int)quality);
            builder.AddColumnValue("Flags", (int)flags);
            builder.AddColumnValue("BuyCount", 1);
            builder.AddColumnValue("BuyPrice", buyPrice);
            builder.AddColumnValue("SellPrice", sellPrice);
            builder.AddColumnValue("InventoryType", (int)invType);
            builder.AddColumnValue("AllowableClass", (int)allowClass);
            builder.AddColumnValue("AllowableRace", (int)allowRace);
            builder.AddColumnValue("ItemLevel", itemLvl);
            builder.AddColumnValue("RequiredLevel", reqLvl);
            builder.AddColumnValue("RequiredSkill", reqSkill);
            builder.AddColumnValue("RequiredSkillRank", reqSkLvl);
            builder.AddColumnValue("requiredspell", reqSpell);
            builder.AddColumnValue("requiredhonorrank", reqHonor);
            builder.AddColumnValue("RequiredCityRank", reqCity);
            builder.AddColumnValue("RequiredReputationFaction", reqRepFaction);
            builder.AddColumnValue("RequiredReputationRank", reqRepValue);
            builder.AddColumnValue("maxcount", maxCount);

            var stackVal = stacks;
            if (SQLOutput.Format == SqlFormat.Mangos && stacks > 1000)
                stackVal = -1;

            builder.AddColumnValue("stackable", stackVal);
            builder.AddColumnValue("ContainerSlots", contSlots);
            builder.AddColumnValue("StatsCount", statsCount);

            for (var i = 0; i < 10; i++)
            {
                int type;
                int value;

                if (i > statsCount - 1)
                {
                    type = 0;
                    value = 0;
                }
                else
                {
                    type = (int)statType[i];
                    value = statValue[i];
                }

                builder.AddColumnValue("stat_type" + (i + 1), type);
                builder.AddColumnValue("stat_value" + (i + 1), value);
            }

            builder.AddColumnValue("ScalingStatDistribution", ssdId);
            builder.AddColumnValue("ScalingStatValue", ssdVal);

            for (var i = 0; i < 2; i++)
            {
                builder.AddColumnValue("dmg_min" + (i + 1), dmgMin[i]);
                builder.AddColumnValue("dmg_max" + (i + 1), dmgMax[i]);
                builder.AddColumnValue("dmg_type" + (i + 1), (int)dmgType[i]);
            }

            builder.AddColumnValue("armor", resistance[0]);
            builder.AddColumnValue("holy_res", resistance[1]);
            builder.AddColumnValue("fire_res", resistance[2]);
            builder.AddColumnValue("nature_res", resistance[3]);
            builder.AddColumnValue("frost_res", resistance[4]);
            builder.AddColumnValue("shadow_res", resistance[5]);
            builder.AddColumnValue("arcane_res", resistance[6]);
            builder.AddColumnValue("delay", delay);
            builder.AddColumnValue("ammo_type", (int)ammoType);
            builder.AddColumnValue("RangedModRange", rangedMod);

            for (var i = 0; i < 5; i++)
            {
                builder.AddColumnValue("spellid_" + (i + 1), spellId[i]);
                builder.AddColumnValue("spelltrigger_" + (i + 1), (int)spellTrigger[i]);
                builder.AddColumnValue("spellcharges_" + (i + 1), spellCharges[i]);
                builder.AddColumnValue("spellppmRate_" + (i + 1), 0);
                builder.AddColumnValue("spellcooldown_" + (i + 1), spellCooldown[i]);
                builder.AddColumnValue("spellcategory_" + (i + 1), spellCategory[i]);
                builder.AddColumnValue("spellcategorycooldown_" + (i + 1), spellCatCooldown[i]);
            }

            builder.AddColumnValue("bonding", (int)binding);
            builder.AddColumnValue("description", description);
            builder.AddColumnValue("PageText", pageText);
            builder.AddColumnValue("LanguageID", (int)langId);
            builder.AddColumnValue("PageMaterial", (int)pageMat);
            builder.AddColumnValue("startquest", startQuest);
            builder.AddColumnValue("lockid", lockId);
            builder.AddColumnValue("Material", (int)material);
            builder.AddColumnValue("sheath", (int)sheath);
            builder.AddColumnValue("RandomProperty", randomProp);
            builder.AddColumnValue("RandomSuffix", randomSuffix);
            builder.AddColumnValue("block", block);
            builder.AddColumnValue("itemset", itemSet);
            builder.AddColumnValue("MaxDurability", maxDura);
            builder.AddColumnValue("area", area);
            builder.AddColumnValue("map", map);
            builder.AddColumnValue("BagFamily", (int)bagFamily);
            builder.AddColumnValue("TotemCategory", (int)totemCat);

            for (var i = 0; i < 3; i++)
            {
                builder.AddColumnValue("socketColor_" + (i + 1), (int)color[i]);
                builder.AddColumnValue("socketContent_" + (i + 1), content[i]);
            }

            builder.AddColumnValue("socketBonus", socketBonus);
            builder.AddColumnValue("GemProperties", gemProps);
            builder.AddColumnValue("RequiredDisenchantSkill", reqDisEnchSkill);
            builder.AddColumnValue("ArmorDamageModifier", armorDmgMod);
            builder.AddColumnValue("Duration", duration);
            builder.AddColumnValue("ItemLimitCategory", limitCategory);
            builder.AddColumnValue("HolidayID", (int)holidayId);
            builder.AddColumnValue("ScriptName", string.Empty);
            builder.AddColumnValue("DisenchantID", 0);
            builder.AddColumnValue("FoodType", 0);
            builder.AddColumnValue("minMoneyLoot", 0);
            builder.AddColumnValue("maxMoneyLoot", 0);
            builder.AddColumnValue("NonConsumable", 0);

            return builder.BuildInsert(true);
        }
Esempio n. 24
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            if (version > 1)
                m_Cleansliness = reader.ReadInt();
            else
            {
                m_Cleaned = true;
                m_Cleansliness = 0;
            }

            if (version > 0)
            {
                if (reader.ReadBool())
                {
                    string name = reader.ReadString();
                    m_LoadedAmmo = ScriptCompiler.FindTypeByName(name);
                }
            }

            m_Cleaned = reader.ReadBool();
            m_Charged = reader.ReadBool();
            m_Primed = reader.ReadBool();
            m_Galleon = reader.ReadItem() as BaseGalleon;
            m_Hits = reader.ReadInt();
            m_AmmoType = (AmmoType)reader.ReadInt();
            m_Position = (ShipPosition)reader.ReadInt();

            if (m_LoadedAmmo == null && m_AmmoType != AmmoType.Empty)
                m_AmmoType = AmmoType.Empty;

            InvalidateDamageState();
        }
Esempio n. 25
0
 public void ClearCannon()
 {
     CheckDirty();
     m_Charged = false;
     m_Primed = false;
     m_AmmoType = AmmoType.Empty;
     m_LoadedAmmo = null;
     InvalidateProperties();
 }
Esempio n. 26
0
 public ViscousAcidLiquor_Bullet(float xval, float yval, AmmoType type, float ang = -1, Thing owner = null, bool rbound = false, float distance = -1, bool tracer = false, bool network = true) : base(xval, yval, type, ang, owner, rbound, distance, tracer, network)
 {
 }