コード例 #1
0
        /// <summary>
        /// Creates new AdvancesSolverSettings.
        /// </summary>
        /// <param name="baseSettings">Base settings to copy.</param>
        /// <param name="totalPoints">Maximum for points spent in the result tree. (>= 0)</param>
        /// <param name="initialAttributes">Starting attributes of stats that calculations are based on.</param>
        /// <param name="attributeConstraints">The attribute constraints the solver should try to fullfill.</param>
        /// <param name="pseudoAttributeConstraints">The pseudo attribute constraints the solver should try to fullfill.</param>
        /// <param name="weaponClass">WeaponClass used for pseudo attribute calculation.</param>
        /// <param name="tags">Tags used for pseudo attribute calculation.</param>
        /// <param name="offHand">OffHand used for pseudo attribute calculation.</param>
        public AdvancedSolverSettings(SolverSettings baseSettings,
            int totalPoints,
            Dictionary<string, float> initialAttributes,
            Dictionary<string, Tuple<float, double>> attributeConstraints,
            Dictionary<PseudoAttribute, Tuple<float, double>> pseudoAttributeConstraints,
            WeaponClass weaponClass, Tags tags, OffHand offHand)
            : base(baseSettings)
        {
            if (totalPoints < 0) throw new ArgumentOutOfRangeException(nameof(totalPoints), totalPoints, "must be >= 0");

            TotalPoints = totalPoints;
            WeaponClass = weaponClass;
            Tags = tags;
            OffHand = offHand;
            AttributeConstraints = attributeConstraints ?? new Dictionary<string, Tuple<float, double>>();
            PseudoAttributeConstraints = pseudoAttributeConstraints ?? new Dictionary<PseudoAttribute, Tuple<float, double>>();
            InitialAttributes = initialAttributes ?? new Dictionary<string, float>();

            if (AttributeConstraints.Values.Any(tuple => tuple.Item2 < 0 || tuple.Item2 > 1))
                throw new ArgumentException("Weights need to be between 0 and 1", "attributeConstraints");
            if (AttributeConstraints.Values.Any(t => t.Item1 <= 0))
                throw new ArgumentException("Target values need to be greater zero", "attributeConstraints");
            if (PseudoAttributeConstraints.Values.Any(tuple => tuple.Item2 < 0 || tuple.Item2 > 1))
                throw new ArgumentException("Weights need to be between 0 and 1", "pseudoAttributeConstraints");
            if (PseudoAttributeConstraints.Values.Any(t => t.Item1 <= 0))
                throw new ArgumentException("Target values need to be greater zero", "pseudoAttributeConstraints");
        }
コード例 #2
0
 public void SetValues(RootCharacterController c, WeaponClass w, int n)
 {
     weapon = w;
     controller = c;
     numb = n;
     activity = weapon.moveset [numb];
 }
コード例 #3
0
 public Weapon(string n, int p, int e, WeaponClass wc, Dictionary <string, SpecialAttack> a)
 {
     Name    = n;
     Power   = p;
     Energy  = e;
     Rarity  = wc;
     Attacks = a;
 }
コード例 #4
0
        private void WeapontypeBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            WeaponClass selectedItemType = GetSelectedWeaponClass();

            _itemsToEnhance = WeaponsTable.GetWeaponTable(selectedItemType);
            InitWeapons();
            ResetEnhancementLevel();
        }
コード例 #5
0
 public WeaponItemFactory(string name, float weight, IEnumerable <IAttackFactory> attackCombo, IEnumerable <IStorageType> carryLocation, int?deltaEnergy, WeaponClass @class, int kineticEnergy, int shootDamage, int strength) : base(name, weight, attackCombo, carryLocation)
 {
     DeltaEnergy   = deltaEnergy;
     Class         = @class;
     KineticEnergy = kineticEnergy;
     ShootDamage   = shootDamage;
     Strength      = strength;
 }
コード例 #6
0
 public ConditionSettings(Tags tags, OffHand offHand, string[] keystones, WeaponClass weaponClass)
 {
     if (keystones == null) throw new ArgumentNullException("keystones");
     Tags = tags;
     OffHand = offHand;
     Keystones = keystones;
     WeaponClass = weaponClass;
 }
コード例 #7
0
ファイル: WeaponInventory.cs プロジェクト: ColinHite/DGM-2670
	void AddToInventory (WeaponClass _weapon) 
	{
//		print (_weapon.name);

		weapons.Add (_weapon);
		_weapon.transform.parent = weaponHolder;
		_weapon.transform.localPosition = Vector3.zero;
	}
コード例 #8
0
    private void Start()
    {
        //If the rotation is controled by accelero New In 1.2
        if (RotateControl == RotateC.Accelerometer)
        {
            MSPControl.AccelGyroCtrl = MSP.GyroAccel.Accelero;
        }
        else if (RotateControl == RotateC.gyroscope && SystemInfo.supportsGyroscope)
        {
            MSPControl.AccelGyroCtrl = MSP.GyroAccel.Gyro;
            //Fake Cam4Gyro
            GameObject FakecamObj = new GameObject("FakeCam4Gyro");
            Fakecam = FakecamObj.transform;
            Transform  currentParent = Fakecam.parent;
            GameObject camParent     = new GameObject("camParent");
            camParent.transform.position = Fakecam.position;
            Fakecam.parent = camParent.transform;
            GameObject camGrandparent = new GameObject("camGrandParent");
            camGrandparent.transform.position = Fakecam.position;
            camParent.transform.parent        = camGrandparent.transform;
            camGrandparent.transform.parent   = currentParent;

            camParent.transform.eulerAngles = new Vector3(90.0f, 90.0f, 0.0f);
        }
        else
        {
            RotateControl = RotateC.Classic;
        }
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        //Initialize the MSP Script
        MSPControl.InitControl();

        controller = GetComponent <CharacterController>();

        //Initialize the original rotation
        originalRotation = transform.rotation.eulerAngles.y;

        //Put my object to variable
        myTransform = transform;

        CurrentWeapon = WeaponList[0];
        //Set Health  by number of GUI Texture
        MaxHealth = Health = MSPControl.LifeCounterGUI.Length;

        CurrentWeapon.NbClip     = CurrentWeapon.MaxNbrClip = CurrentWeapon.WeaponBulletGUI.Length - 1;
        CurrentWeapon.bulletleft = (int)CurrentWeapon.NbClip * CurrentWeapon.bulletperClip;

        //GUIMAX
        GUIPosXMax  = (1.5f * MSPControl.ScreenSize.x) / 100f;
        GUIPosYMax  = (1.2f * MSPControl.ScreenSize.y) / 100f;
        GUIPosY2Max = (6.6f * MSPControl.ScreenSize.y) / 100f;

        //Add a full clip at start
        CurrentWeapon.bulletinMagasine = CurrentWeapon.bulletperClip;

        //Update GUI
        UpdateGUI(GUIComponent.Init);
    }
コード例 #9
0
        public static Mod Consolidate(this IReadOnlyCollection <Mod> p, string pName)
        {
            Percent     CritChance   = Percent.Zero;
            Percent     CritDamage   = Percent.Zero;
            Percent     MagazineSize = Percent.Zero;
            Percent     Multishot    = Percent.Zero;
            Percent     Damage       = Percent.Zero;
            Percent     Impact       = Percent.Zero;
            Percent     Puncture     = Percent.Zero;
            Percent     Slash        = Percent.Zero;
            Percent     FireRate     = Percent.Zero;
            Percent     Reload       = Percent.Zero;
            Percent     Cold         = Percent.Zero;
            Percent     Heat         = Percent.Zero;
            Percent     Electric     = Percent.Zero;
            Percent     Toxin        = Percent.Zero;
            Percent     AugmentBonus = Percent.Zero;
            WeaponClass WeaponClass  = 0;

            foreach (var mod in p)
            {
                CritChance   += mod.CritChance;
                CritDamage   += mod.CritDamage;
                MagazineSize += mod.MagazineSize;
                Multishot    += mod.Multishot;
                Damage       += mod.Damage;
                Impact       += mod.Impact;
                Puncture     += mod.Puncture;
                Slash        += mod.Slash;
                FireRate     += mod.FireRate;
                Reload       += mod.Reload;
                Cold         += mod.Cold;
                Heat         += mod.Heat;
                Electric     += mod.Electric;
                Toxin        += mod.Toxin;
                AugmentBonus += mod.AugmentBonus;
                WeaponClass  |= mod.WeaponClass;
            }

            return(new Mod(
                       pName,
                       WeaponClass,
                       CritChance,
                       CritDamage,
                       MagazineSize,
                       Multishot,
                       Damage,
                       Impact,
                       Puncture,
                       Slash,
                       FireRate,
                       Reload,
                       Cold,
                       Heat,
                       Electric,
                       Toxin,
                       AugmentBonus));
        }
コード例 #10
0
ファイル: WeaponInventory.cs プロジェクト: rp17000/DGM-2670
	void AddToInventory (WeaponClass _weapon)
	{
		weapons.Add (_weapon);
		_weapon.transform.parent = weaponHolder;
		_weapon.transform.localPosition = Vector3.zero;

		if (weapons.Count == 1)
			weapons [0].gameObject.SetActive (true);
	}
コード例 #11
0
        public static RPGItem CreateRandomWeapon()
        {
            // roll for all types of weapons
            int c = new RPGCalc().Roll(Enum.GetValues(typeof(WeaponClass)).Length);
            // create a weapon of that type
            WeaponClass wc = (WeaponClass)Enum.Parse(typeof(WeaponClass), c.ToString());

            return(new RPGWeapon(wc));
        }
コード例 #12
0
ファイル: WeaponClass.cs プロジェクト: ManuelOTuga/PoE
 /// <summary>
 /// Returns whether the given WeaponClass has the given string as an alias.
 /// (case insensitive)
 /// </summary>
 public static bool HasAlias(this WeaponClass weaponClass, string alias)
 {
     if (alias == null)
     {
         return(false);
     }
     alias = alias.ToLowerInvariant();
     return(Aliases[weaponClass].Any(s => s == alias));
 }
 public abstract float CalculateStrikeMagnitudeForThrust(
     BasicCharacterObject attackerCharacter,
     BasicCharacterObject attackerCaptainCharacter,
     float thrustWeaponSpeed,
     float weaponWeight,
     float extraLinearSpeed,
     bool doesAtttackerHaveMount,
     WeaponClass weaponClass,
     bool isThrown = false);
コード例 #14
0
 public void Init(
     string weaponUsageName,
     string physicsMaterial,
     string itemUsage,
     DamageTypes thrustDamageType,
     DamageTypes swingDamageType,
     int bodyArmor,
     int weaponLength,
     float weaponBalance,
     float inertia,
     float centerOfMass,
     int handling,
     float swingDamageFactor,
     float thrustDamageFactor,
     short maxDataValue,
     string passBySoundCode,
     int accuracy,
     int missileSpeed,
     MatrixFrame stickingFrame,
     WeaponClass ammoClass,
     float sweetSpot,
     int swingSpeed,
     int swingDamage,
     int thrustSpeed,
     int thrustDamage,
     Vec3 rotationSpeed,
     WeaponComponentData.WeaponTiers tier)
 {
     this.WeaponUsageId      = weaponUsageName;
     this.PhysicsMaterial    = physicsMaterial;
     this.ItemUsage          = itemUsage;
     this.ThrustDamageType   = thrustDamageType;
     this.SwingDamageType    = swingDamageType;
     this.BodyArmor          = bodyArmor;
     this.WeaponLength       = weaponLength;
     this.WeaponBalance      = weaponBalance;
     this.Inertia            = inertia;
     this.CenterOfMass       = centerOfMass;
     this.Handling           = handling;
     this.SwingDamageFactor  = swingDamageFactor;
     this.ThrustDamageFactor = thrustDamageFactor;
     this.MaxDataValue       = maxDataValue;
     this.PassbySoundCode    = passBySoundCode;
     this.Accuracy           = accuracy;
     this.MissileSpeed       = missileSpeed;
     this.StickingFrame      = stickingFrame;
     this.AmmoClass          = ammoClass;
     this.SweetSpotReach     = sweetSpot;
     this.SwingSpeed         = swingSpeed;
     this.SwingDamage        = swingDamage;
     this.ThrustSpeed        = thrustSpeed;
     this.ThrustDamage       = thrustDamage;
     this.Frame          = MatrixFrame.Identity;
     this.CenterOfMass3D = new Vec3(z: centerOfMass);
     this.RotationSpeed  = rotationSpeed;
     this.WeaponTier     = tier;
 }
コード例 #15
0
 private void Rb_ShowAll_Checked(object sender, System.Windows.RoutedEventArgs e)
 {
     if (_itemsToEnhance != null && _itemsToEnhance.Any())
     {
         WeaponClass selectedItemType = GetSelectedWeaponClass();
         _itemsToEnhance = WeaponsTable.GetWeaponTable(selectedItemType);
         InitWeapons();
     }
 }
コード例 #16
0
ファイル: SurvivorClass.cs プロジェクト: christ0089/UnityGame
 public SurvivorClass(string name, WeaponClass weapon, GameObject gameObject, float health, float velocity)
 {
     s_name       = name;
     s_gameObject = gameObject;
     s_transform  = gameObject.transform;
     s_health     = health;
     s_velocity   = velocity;
     s_weapon     = weapon;
 }
コード例 #17
0
ファイル: WeaponManager.cs プロジェクト: Mayzhy/CS
    public WeaponClass[] weaponList;           //List for weapons

    public WeaponClass findWeapon(string name) //Find weapon using name
    {
        WeaponClass w = Array.Find(weaponList, weaponList => weaponList.bulletType == name);

        if (w == null)
        {
            Debug.LogWarning(name + " Not Found!");
        }
        return(w);
    }
コード例 #18
0
ファイル: Weapon.cs プロジェクト: layagyasz/OpenPanzerBlitz
        public Weapon(ParseBlock Block)
        {
            var attributes = Block.BreakToAttributes <object>(typeof(Attribute));

            WeaponClass    = (WeaponClass)attributes[(int)Attribute.WEAPON_CLASS];
            Attack         = (byte)attributes[(int)Attribute.ATTACK];
            Range          = (byte)attributes[(int)Attribute.RANGE];
            CanDoubleRange = (bool)(attributes[(int)Attribute.CAN_DOUBLE_RANGE] ?? false);
            Ammunition     = (byte)(attributes[(int)Attribute.AMMUNITION] ?? (byte)0);
        }
コード例 #19
0
 /// <summary>
 /// Creates new AdvancesSolverSettings.
 /// </summary>
 /// <param name="baseSettings">Base settings to copy.</param>
 /// <param name="initialAttributes">Starting attributes of stats that calculations are based on.</param>
 /// <param name="attributeConstraints">The attribute constraints the solver should try to fullfill.</param>
 /// <param name="pseudoAttributeConstraints">The pseudo attribute constraints the solver should try to fullfill.</param>
 /// <param name="weaponClass">WeaponClass used for pseudo attribute calculation.</param>
 /// <param name="tags">Tags used for pseudo attribute calculation.</param>
 /// <param name="offHand">OffHand used for pseudo attribute calculation.</param>
 public AdvancedSolverSettings(SolverSettings baseSettings,
                               Dictionary <string, float> initialAttributes,
                               Dictionary <string, Tuple <float, double> > attributeConstraints,
                               Dictionary <PseudoAttribute, Tuple <float, double> > pseudoAttributeConstraints,
                               WeaponClass weaponClass, Tags tags, OffHand offHand)
     : this(baseSettings.Level, baseSettings.TotalPoints, baseSettings.Checked, baseSettings.Crossed,
            baseSettings.SubsetTree, baseSettings.InitialTree, baseSettings.Iterations, initialAttributes,
            attributeConstraints, pseudoAttributeConstraints, weaponClass, tags, offHand)
 {
 }
コード例 #20
0
        static bool Prefix(Object __instance)
        {
            // Need this type to use reflection to retrieve the field values
            Type QuestBehaviorType = typeof(GangLeaderNeedsWeaponsIssueQuestBehavior).GetNestedType("GangLeaderNeedsWeaponsIssueQuest", BindingFlags.NonPublic | BindingFlags.Instance);

            // Get the field values we need via reflection
            int         requestedWeaponAmount = (int)QuestBehaviorType.GetField("_requestedWeaponAmount", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(__instance);
            WeaponClass requestedWeaponClass  = (WeaponClass)QuestBehaviorType.GetField("_requestedWeaponClass", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(__instance);

            ItemRosterElement[] copyOfAllElements = PartyBase.MainParty.ItemRoster.GetCopyOfAllElements();

            List <ItemRosterElement> requestedWeapons = new List <ItemRosterElement>();

            // Only consider weapons of the requested class
            foreach (ItemRosterElement itemRosterElement in copyOfAllElements)
            {
                if (itemRosterElement.EquipmentElement.Item != null)
                {
                    if (itemRosterElement.EquipmentElement.Item.WeaponComponent != null)
                    {
                        if (itemRosterElement.EquipmentElement.Item.WeaponComponent.PrimaryWeapon.WeaponClass == requestedWeaponClass)
                        {
                            requestedWeapons.Add(itemRosterElement);
                        }
                    }
                }
            }

            // Sort the weapons by increasing value so that we take the cheapest ones first
            requestedWeapons.Sort(CompareItemValue);

            // Remove the weapons.
            // Since we've sorted by increasing value, we will remove the cheapest weapons first.
            foreach (ItemRosterElement itemRosterElement in requestedWeapons)
            {
                if (itemRosterElement.EquipmentElement.Item != null && (itemRosterElement.EquipmentElement.Item.WeaponComponent != null && itemRosterElement.Amount > 0))
                {
                    if (requestedWeaponAmount >= itemRosterElement.Amount)
                    {
                        PartyBase.MainParty.ItemRoster.AddToCounts(itemRosterElement.EquipmentElement, -itemRosterElement.Amount, true);
                        requestedWeaponAmount -= itemRosterElement.Amount;
                    }
                    else
                    {
                        PartyBase.MainParty.ItemRoster.AddToCounts(itemRosterElement.EquipmentElement, -requestedWeaponAmount, true);
                        break;
                    }
                }
            }

            // Returning false will skip the original function complately
            // This is completely overriding behavior of the original function
            // If another mod touched this function, it will cause incompatibility
            return(false);
        }
コード例 #21
0
 public ConditionSettings(Tags tags, OffHand offHand, string[] keystones, WeaponClass weaponClass)
 {
     if (keystones == null)
     {
         throw new ArgumentNullException("keystones");
     }
     Tags        = tags;
     OffHand     = offHand;
     Keystones   = keystones;
     WeaponClass = weaponClass;
 }
コード例 #22
0
    public EquipmentInfo(WeaponClass _weapon, List <ItemClass> _items)
    {
        weapon = _weapon != null ? _weapon.itemName : string.Empty;

        bagItems = new List <string>();

        foreach (ItemClass _item in _items)
        {
            bagItems.Add(_item != null ? _item.itemName : string.Empty);
        }
    }
コード例 #23
0
 public static bool HasWeaponOfClass(this Agent agent, WeaponClass weaponClass)
 {
     for (int i = 0; i < (int)EquipmentIndex.NumAllWeaponSlots; i++)
     {
         if (!agent.Equipment[i].IsEmpty && agent.Equipment[i].Item.PrimaryWeapon.WeaponClass == weaponClass)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #24
0
 public static bool IsWeaponClass(this ServerAPI api, WeaponHash weapon, WeaponClass weapclass)
 {
     if (GetWeaponClass(api, weapon) == weapclass)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #25
0
    public void SetValues(RootCharacterController c,
	                      WeaponClass w,
	                      int n, int b, int e,
	                      SpFunctions s,
	                      HitController h)
    {
        bTime = b; eTime = e; controller = c; weapon = w; numb = n;
        activity = weapon.moveset [numb];
        stats = controller.gameObject.GetComponent<Stats> ();
        sp = s;
        hitBox = h;
    }
コード例 #26
0
 public Weapon(string name, WeaponClass item)
 {
     Name       = name;
     Type       = Type;
     Category   = Category;
     Damage     = new Stat();
     DamageType = DamageType;
     ItemRarity = ItemRarity;
     Properties = Properties;
     Weight     = Weight;
     Cost       = Cost;
 }
コード例 #27
0
 void initializeObject()
 {
     Weapons[0] = new WeaponClass("Magnum", weapons[0], 40, .75f, 8, 5);
     Weapons[1] = new WeaponClass("c_Riffle", weapons[1], 30, .75f, 6, 125);
     Weapons[2] = new WeaponClass("S_machinegun", weapons[2], 30, .5f, 12, 150);
     Weapons[3] = new WeaponClass("Shotgun", weapons[3], 40, 1.5f, 6, 20);
     Weapons[4] = new WeaponClass("Bazooka", weapons[4], 30, 2, 10, 100);
     Weapons[5] = new WeaponClass("GranadeLauncher", weapons[5], 50, 2, 5, 30);
     Weapons[6] = new WeaponClass("AcidBullet", weapons[6], 30, 1.5f, 5, 100);
     survivor   = new SurvivorClass("Mike", Weapons[0], survivorGameObject, 100.0f, movementSpeed);
     survivor.getSurvivorWeapon().ActivateWeapon();
 }
コード例 #28
0
        public static RPGItem CreateRandomThrownWeapon()
        {
            /*
             * ThrowingAxe = 5,
             * Dart = 6,
             */

            int         c  = new RPGCalc().Roll(2) + 4;
            WeaponClass wc = (WeaponClass)Enum.Parse(typeof(WeaponClass), c.ToString());

            return(new RPGWeapon(wc));
        }
 public override float CalculateStrikeMagnitudeForThrust(
     BasicCharacterObject attackerCharacter,
     BasicCharacterObject attackerCaptainCharacter,
     float thrustWeaponSpeed,
     float weaponWeight,
     float extraLinearSpeed,
     bool doesAttackerHaveMount,
     WeaponClass weaponClass,
     bool isThrown = false)
 {
     return(CombatStatCalculator.CalculateStrikeMagnitudeForThrust(thrustWeaponSpeed, weaponWeight, extraLinearSpeed, isThrown));
 }
 public abstract float CalculateStrikeMagnitudeForSwing(
     BasicCharacterObject attackerCharacter,
     BasicCharacterObject attackerCaptainCharacter,
     float swingSpeed,
     float impactPointAsPercent,
     float weaponWeight,
     float weaponLength,
     float weaponInertia,
     float weaponCoM,
     float extraLinearSpeed,
     bool doesAttackerHaveMount,
     WeaponClass weaponClass);
コード例 #31
0
 public Firearm(
     string name,
     WeaponCategory weaponCategory,
     WeaponClass weaponClass,
     InventorySlot inventorySlot,
     int unlockCost,
     int roundsPerMagazine,
     decimal roundsPerSecond,
     int damagePerBullet,
     int armorPiercingLevel,
     decimal muzzleDropDistanceMeters,
     int moveSpeedLocalModifierPercent,
     int turnSpeedLocalModifierPercent,
     int numPellets,
     decimal spreadAt10Meters,
     bool silenced,
     decimal shotSoundMeters,
     bool closedBolt,
     bool cyclicReload,
     int reloadTime,
     int reloadEmptyTime,
     int changeInTime,
     int changeOutTime,
     int readyTime,
     int guardTime
     )
 {
     Name                          = name;
     WeaponCategory                = weaponCategory;
     WeaponClass                   = weaponClass;
     InventorySlot                 = inventorySlot;
     UnlockCost                    = unlockCost;
     RoundsPerMagazine             = roundsPerMagazine;
     RoundsPerSecond               = roundsPerSecond;
     DamagePerBullet               = damagePerBullet;
     ArmorPiercingLevel            = armorPiercingLevel;
     MuzzleDropDistanceMeters      = muzzleDropDistanceMeters;
     MoveSpeedLocalModifierPercent = moveSpeedLocalModifierPercent;
     TurnSpeedLocalModifierPercent = turnSpeedLocalModifierPercent;
     NumPellets                    = numPellets;
     SpreadAt10Meters              = spreadAt10Meters;
     Silenced                      = silenced;
     ShotSoundMeters               = shotSoundMeters;
     ClosedBolt                    = closedBolt;
     CyclicReload                  = cyclicReload;
     ReloadTime                    = reloadTime;
     ReloadEmptyTime               = reloadEmptyTime;
     ChangeInTime                  = changeInTime;
     ChangeOutTime                 = changeOutTime;
     ReadyTime                     = readyTime;
     GuardTime                     = guardTime;
 }
コード例 #32
0
ファイル: Weapon.cs プロジェクト: Interrupt/zunehack
        /// <summary>
        /// Creates a weapon
        /// </summary>
        public Weapon(WeaponData data)
            : base(ItemType.Weapon)
        {
            name = data.name;

            // Get or load a texture
            texture = GameManager.GetInstance().GetTexture(data.image);
            if (texture == null) texture = GameManager.GetInstance().LoadTexture(data.image);

            damage = data.damage;
            bonus = data.bonus;
            weaponClass = data.wpnclass;
        }
コード例 #33
0
    public void AddWeapon(WeaponClass w)
    {
        string sql = "INSERT INTO weapons (name, description, price) VALUES (@name, @description, @price)";

        using (SqlCommand cmd = new SqlCommand(sql, conn))
        {
            cmd.Parameters.AddWithValue("@name", w.Name);
            cmd.Parameters.AddWithValue("@description", w.Description);
            cmd.Parameters.AddWithValue("@price", w.Price);
            int affectedRows = cmd.ExecuteNonQuery();
            Debug.Log(affectedRows + " rows inserted!");
        }
    }
コード例 #34
0
    public void SetValues(RootCharacterController c,
	                      WeaponClass w,
	                      int n, int cN1, int cN2, int b, int e,
	                      SpFunctions s,
	                      clavisher cl, Vector3 p)
    {
        bTime = b; eTime = e; controller = c; weapon = w; numb = n; clavNumb1 = cN1; clavNumb2 = cN2;
        activity = weapon.moveset [numb];
        stats = controller.gameObject.GetComponent<Organism> ();
        sp = s;
        clav = cl;
        pos = new Vector3 (p.x, p.y, p.z);
    }
コード例 #35
0
 public override void OnStartLocalPlayer()
 {
     playerName = PlayerPrefs.GetString("PlayerName");
     randColor  = new Color(Random.value, Random.value, Random.value);
     CmdSetColour(randColor);
     CmdSetName(playerName);
     rbody = GetComponent <Rigidbody>();
     CursorLockManager.instance.CursorLockable = true;
     CursorLockManager.instance.LockCursor();
     gameObject.layer           = 8;
     HealthBarOverhead.maxValue = MaxHealth;
     CurrentWeapon = GetComponentInChildren <WeaponClass>();
 }
コード例 #36
0
        public static RPGItem CreateRandomLauncherWeapon()
        {
            /*
             * Bow = 7,
             * Crossbow = 8,
             * Sling = 9,
             */

            int         c  = new RPGCalc().Roll(3) + 6;
            WeaponClass wc = (WeaponClass)Enum.Parse(typeof(WeaponClass), c.ToString());

            return(new RPGWeapon(wc));
        }
コード例 #37
0
    // Start is called before the first frame update
    void Start()
    {
        ID               = 7;
        Hit.enabled      = false;
        HitImage.enabled = false;
        seeker           = GetComponent <Seeker>();
        AM               = FindObjectOfType <AudioManager>();
        GM               = FindObjectOfType <GameManager>();
        //GM = GameObject.FindGameObjectWithTag("GameManager");
        LC  = GM.LegList[7];
        HC  = GM.HeadList[7];
        TC  = GM.TorsoList[7];
        WrC = GM.WeaponRList[7];
        WlC = GM.WeaponLList[7];

        SRLegs.sprite      = LC.part;
        SRLegs.material    = LC.Emitter;
        SRHead.sprite      = HC.part;
        SRHead.material    = HC.Emitter;
        SRTorso.sprite     = TC.part;
        SRTorso.material   = TC.Emitter;
        SRWeaponR.sprite   = WrC.part;
        SRWeaponR.material = WrC.Emitter;
        SRWeaponL.sprite   = WlC.part;
        SRWeaponL.material = WlC.Emitter;
        Anim = legsChildren.GetComponent <Animator>();
        Anim.SetInteger("ArmorID", 7);
        Anim.speed       = 0;
        SRLegs.sprite    = LC.part;
        currentHP        = HC.hp + TC.hp + LC.hp;
        maxHP            = HC.hp + TC.hp + LC.hp;
        maxEnergy        = TC.energy;
        currentEnergy    = maxEnergy;
        currentAmmoL     = WlC.ammo;
        currentAmmoR     = WrC.ammo;
        BarrelL.position = new Vector2(BarrelL.position.x, BarrelL.position.y + WlC.barrelLength);
        BarrelR.position = new Vector2(BarrelR.position.x, BarrelR.position.y + WrC.barrelLength);

        if (AM.Playing("MenuSong"))
        {
            AM.Stop("MenuSong");
        }


        //AM.Play("TempleSong");
        if (Boosters.isPlaying)
        {
            Boosters.Stop();
        }
        InvokeRepeating("UpdatePath", 0f, 0.5f);
    }
コード例 #38
0
    public override void DockableWindowFunc(int id)
    {
        DoResizing();
        GUILayout.Space(GameManager.Instance.GUIManager.MinimizeButtonRect.height);

        if (_SelectedUnit != null)
        {
            foreach (WeaponInfo wi in _SelectedUnit.Info.Weapons)
            {
                WeaponClass wc = GameManager.Instance.GetWeaponClass(wi.WeaponClassId);
                if (wc != null)
                {
                    if (GUILayout.Button(wc.WeaponClassName))
                    {
                        _SelectedWeapon = wi;
                    }
                }
                //~ else if(_SelectedWeapon != null)
                //~ {
                //~ if(_SelectedWeapon.Id == wi.Id)
                //~ {
                //~ if(_SelectedWeapon.IsActive != wi.IsActive)
                //~ {
                //~ _SelectedWeapon = wi;
                //~ }
                //~ }
                //~ }
                //~ }
            }

            if (_SelectedWeapon != null)
            {
                Separator.fixedWidth = WindowRect.width - this.PaddingLeft * 2;

                GUILayout.Label("", Separator);

                GUILayout.BeginVertical();

                GUILayout.Label(_SelectedWeapon.ToString());

                GUILayout.Label(string.Format("Ready in : {0} seconds", _SelectedWeapon.ReadyInSec));

                GUILayout.EndVertical();
            }
        }
        else
        {
            GUILayout.Label("Not Connected");
        }
    }
コード例 #39
0
    public void SetValues(RootCharacterController c,
	                      WeaponClass w,
	                      int n, int b, int cN,
	                      SpFunctions s,
	                      clavisher cl)
    {
        bTime = b; controller = c; weapon = w; numb = n; claveNumb = cN;
        activity = weapon.moveset [numb];
        stats = controller.gameObject.GetComponent<Organism> ();
        stats.shield = this;
        sp = s;
        clav = cl;
        time = 0;
        rigid = controller.gameObject.GetComponent<Rigidbody2D>();
        animNumb = 0;
    }
コード例 #40
0
	void Awake(){

		weaponManager = GameObject.Find ("WeaponManagerContainer").GetComponent<WeaponManager>();
		WeaponAPrefab = weaponManager.ASetter;
		WeaponWPrefab = weaponManager.WSetter;
		WeaponDPrefab = weaponManager.DSetter;
		WeaponSPrefab = weaponManager.SSetter;

		//instantiate weapons
		if (WeaponAPrefab != null)
			WeaponA = Instantiate (WeaponAPrefab);
		if (WeaponWPrefab != null)
			WeaponW = Instantiate (WeaponWPrefab);
		if (WeaponDPrefab != null)
			WeaponD = Instantiate (WeaponDPrefab);
		if (WeaponSPrefab != null)
			WeaponS = Instantiate (WeaponSPrefab);
		
	}
コード例 #41
0
        private AdvancedSolverSettings(int level, int totalPoints, HashSet<ushort> @checked, HashSet<ushort> crossed,
            HashSet<ushort> subsetTree, HashSet<ushort> initialTree, Dictionary<string, float> initialAttributes,
            Dictionary<string, Tuple<float, double>> attributeConstraints, Dictionary<PseudoAttribute, Tuple<float, double>> pseudoAttributeConstraints,
            WeaponClass weaponClass, Tags tags, OffHand offHand)
            : base(level, totalPoints, @checked, crossed, subsetTree, initialTree)
        {
            WeaponClass = weaponClass;
            Tags = tags;
            OffHand = offHand;
            AttributeConstraints = attributeConstraints ?? new Dictionary<string, Tuple<float, double>>();
            PseudoAttributeConstraints = pseudoAttributeConstraints ?? new Dictionary<PseudoAttribute, Tuple<float, double>>();
            InitialAttributes = initialAttributes ?? new Dictionary<string, float>();

            if (AttributeConstraints.Values.Any(tuple => tuple.Item2 < 0 || tuple.Item2 > 1))
                throw new ArgumentException("Weights need to be between 0 and 1", "attributeConstraints");
            if (AttributeConstraints.Values.Any(t => t.Item1 <= 0))
                throw new ArgumentException("Target values need to be greater zero", "attributeConstraints");
            if (PseudoAttributeConstraints.Values.Any(tuple => tuple.Item2 < 0 || tuple.Item2 > 1))
                throw new ArgumentException("Weights need to be between 0 and 1", "pseudoAttributeConstraints");
            if (PseudoAttributeConstraints.Values.Any(t => t.Item1 <= 0))
                throw new ArgumentException("Target values need to be greater zero", "pseudoAttributeConstraints");
        }
コード例 #42
0
ファイル: Character.cs プロジェクト: Gnusznak/CrystalsOfTime
        private void LearnNewProficiency(WeaponClass wc)
        {
            //get racial bonuses
            Dictionary<WeaponClass, int> rb = Race.RaceProficiencyBonusTable[race];
            int raceBonus = 0;
            if (rb.ContainsKey(wc))
            {
                raceBonus = rb[wc];
            }
            //get class base
            int classBonus = PlayerClass.ClassProficiencyTable[playerClass][1];
            int profValue = raceBonus + classBonus + Dice.Roll("d50");

            _weaponProficiencies.Add(new WeaponProficiency((WeaponClass)wc, profValue, (StringName)Enum.Parse(typeof(StringName), "WEAPONCLASS_" + (WeaponClass)wc)));
            _freeProficiences--;
        }
コード例 #43
0
    //тип 6 номер 2
    public void Twodifferentweaponslock(TwoDifferentWeaponsLock t,
	                                     Equipment e,
	                                     WeaponClass w,
	                                     RootCharacterController c,
	                                     int n)
    {
        t.SetEquip (e);
        t.SetValues (c, w, n);
        t.Work ();
    }
コード例 #44
0
    //тип 6 номер 6
    public void Shieldcontroller(ShieldController sh, 
	                              RootCharacterController c,
	                              WeaponClass w,
	                              int n, int b,int cN,
	                              SpFunctions s,
	                              clavisher cl)
    {
        if (sh.stage == 0)
            sh.SetValues (c, w, n, b, cN, s, cl);
        sh.Work ();
    }
コード例 #45
0
 public GameObject GenerateAndBuildWeapon(WeaponClass c)
 {
     return GenerateWeapon (c).Build ();
 }
コード例 #46
0
ファイル: WeaponManager.cs プロジェクト: sutatsu/Spirit-Mecha
	public void changeD(WeaponClass newWeapon){
		DSetter = newWeapon;
		setText (DText, newWeapon.weaponName);
	}
コード例 #47
0
 public void DeleteWeapon(Equipment equip, int numb, bool right, int wActNumb, SpFunctions sp, WeaponClass defWeapon)
 {
     int i,j;
     int cLen = equip.bag [numb].GetComponent<ItemClass>().coordinates.Length/3;
     CharacterAnimator anim = equip.gameObject.GetComponent<CharacterAnimator> ();
     ItemClass item = equip.bag [numb].GetComponent<ItemClass> ();
     GameObject weapon;
     weapon=null;
     j = 0;
     weapon=equip.gameObject.GetComponent<Actions> ().activities [wActNumb].weapon.gameObject;
     while (j<item.parametres1.Length) {
         if (item.parametres1 [j] != 0)
             break;
         anim.allParts [item.parametres2 [j]].parts.Remove (weapon.GetComponent<PartConroller> ());
         j++;
     }
     Destroy (weapon);
     for (i=2; i<item.objects.Length; i++)
     {
         obj=sp.FindPart(anim.allParts, item.objects[i].name);
         s=item.objects[i].name;
         listOfObjects.Add (obj);
         while (j<item.parametres1.Length) {
             if (item.parametres1 [j] != i)
                 break;
             anim.allParts [item.parametres2 [j]].parts.Remove (listOfObjects [i-2].GetComponent<PartConroller> ());
             j++;
         }
     }
     for (i=listOfObjects.Count-1;i>=0;i--)
     {
         Destroy(listOfObjects[i]);
         listOfObjects.RemoveAt(i);
     }
     equip.gameObject.GetComponent<Actions> ().activities [wActNumb].weapon = defWeapon;
     if (weapon.GetComponent<WeaponClass> ().handEmployment == 2)
     {
         equip.gameObject.GetComponent<Actions> ().activities [right==true? wActNumb-1:wActNumb+1].weapon = (right==true? equip.defLeftWeapon: equip.defRightWeapon).GetComponent<WeaponClass>();
         equip.gameObject.GetComponent<Actions> ().activities [right==true? wActNumb-1:wActNumb+1].actMode = 0;
         equip.leftWeapon=equip.defLeftWeapon.GetComponent<WeaponClass>();
     }
     if (right)
         equip.rightWeapon=defWeapon;
     else
         equip.leftWeapon=defWeapon;
     equip.gameObject.GetComponent<Actions> ().activities [wActNumb].actMode = 0;
 }
コード例 #48
0
    //тип 6 номер 4
    public void Aimingshoot(AimingShoot a, 
	                        RootCharacterController c,
	                        WeaponClass w,
	                        int n, int cN1, int cN2, int b, int e,
	                        SpFunctions s,
	                        clavisher cl, Vector3 p)
    {
        if (a.stage == 0)
            a.SetValues (c,w,n,cN1,cN2,b,e,s,cl,p);
        a.Work ();
    }
コード例 #49
0
ファイル: Character.cs プロジェクト: Gnusznak/CrystalsOfTime
 public WeaponProficiency GetWeaponProficiency(WeaponClass wc)
 {
     foreach (WeaponProficiency wp in _weaponProficiencies)
     {
         if (wp.WeaponClass == wc)
         {
             return wp;
         }
     }
     return null;
 }
コード例 #50
0
    public SavedWeapon GenerateWeapon(WeaponClass c)
    {
        // Randomly choose and spawn every weapon part.
        SavedWeapon weapon = SavedWeapon.CreateInstance<SavedWeapon>();

        weapon.bodyID = Random.Range (0, c.bodies.Length);
        weapon.barrelID = Random.Range (0, c.barrels.Length);
        weapon.classID = GetClassIndex (c);

        if (c.stocks.Length > 0) {
            weapon.stockID = Random.Range (0, c.stocks.Length);
        }else{
            weapon.stockID = -1;
        }

        if (c.optics.Length > 0) {
            weapon.opticID = Random.Range (-c.optics.Length, c.optics.Length);
        }else{
            weapon.opticID = -1;
        }

        if (c.underBarrels.Length > 0) {
            weapon.underBarrelID = Random.Range (-(c.underBarrels.Length * 2), c.underBarrels.Length);
        }else{
            weapon.underBarrelID = -1;
        }

        if (c.mags.Length > 0) {
            weapon.magazineID = Random.Range (0, c.mags.Length);
        }else{
            weapon.magazineID = -1;
        }

        return weapon;
    }
コード例 #51
0
 public void SetMoveset(GameObject obj, WeaponClass weapon)
 {
     for (int i=0; i<weapon.moveset.Length; i++)
     {
         for (int j=0; j<weapon.moveset[i].what.Length; j++)
             for (int k=0; k<weapon.moveset[i].what[j].OBJDescription.Length; k++)
                 weapon.moveset [i].what [j].OBJ [k] = FindObject (obj, weapon.moveset [i].what [j].OBJDescription[k]);
         for (int j=0; j<weapon.moveset[i].whatIf.Length; j++)
             for (int k=0; k<weapon.moveset[i].whatIf[j].OBJDescription.Length; k++)
                 weapon.moveset [i].whatIf [j].OBJ [k] = FindObject (obj, weapon.moveset [i].whatIf [j].OBJDescription[k]);
     }
 }
コード例 #52
0
 /// <summary>
 /// Creates new AdvancesSolverSettings.
 /// </summary>
 /// <param name="baseSettings">Base settings to copy.</param>
 /// <param name="initialAttributes">Starting attributes of stats that calculations are based on.</param>
 /// <param name="attributeConstraints">The attribute constraints the solver should try to fullfill.</param>
 /// <param name="pseudoAttributeConstraints">The pseudo attribute constraints the solver should try to fullfill.</param>
 /// <param name="weaponClass">WeaponClass used for pseudo attribute calculation.</param>
 /// <param name="tags">Tags used for pseudo attribute calculation.</param>
 /// <param name="offHand">OffHand used for pseudo attribute calculation.</param>
 public AdvancedSolverSettings(SolverSettings baseSettings,
     Dictionary<string, float> initialAttributes,
     Dictionary<string, Tuple<float, double>> attributeConstraints,
     Dictionary<PseudoAttribute, Tuple<float, double>> pseudoAttributeConstraints,
     WeaponClass weaponClass, Tags tags, OffHand offHand)
     : this(baseSettings.Level, baseSettings.TotalPoints, baseSettings.Checked, baseSettings.Crossed,
         baseSettings.SubsetTree, baseSettings.InitialTree, initialAttributes,
         attributeConstraints, pseudoAttributeConstraints, weaponClass, tags, offHand)
 { }
コード例 #53
0
ファイル: Weapon.cs プロジェクト: Gnusznak/CrystalsOfTime
 public Weapon(string[] data)
 {
     int col = 0;
     foreach (string s in data)
     {
         switch (col)
         {
             case 0:
                 {
                     _name = s;
                     break;
                 }
             case 1:
                 {
                     _weight = Convert.ToInt16(s);
                     break;
                 }
             case 2:
                 {
                     _value = Convert.ToInt16(s);
                     break;
                 }
             case 3:
                 {
                     _visual = Convert.ToChar(s);
                     break;
                 }
             case 4:
                 {
                     _color = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), s);
                     break;
                 }
             case 5:
                 {
                     _durability = new Stat(Convert.ToInt16(s));
                     break;
                 }
             case 6:
                 {
                     _Desc = (StringName)Enum.Parse(typeof(StringName), s);
                     break;
                 }
             case 7:
                 {
                     _itemClass = (ItemClass)Enum.Parse(typeof(ItemClass), s);
                     break;
                 }
             case 8:
                 {
                     _slot = (SlotType)Enum.Parse(typeof(SlotType), s);
                     break;
                 }
             case 9:
                 {
                     _weaponClass = (WeaponClass)Enum.Parse(typeof(WeaponClass), s);
                     break;
                 }
             case 10:
                 {
                     _weaponType = (WeaponType)Enum.Parse(typeof(WeaponType), s);
                     break;
                 }
             case 11:
                 {
                     _range = Convert.ToInt16(s);
                     break;
                 }
             case 12:
                 {
                     _minStrReq = Convert.ToInt16(s);
                     break;
                 }
             case 13:
                 {
                     _latency = Convert.ToInt16(s);
                     break;
                 }
             case 14:
                 {
                     _dmg = new int[3];
                     string[] dmg = s.Split('/');
                     _dmg[0] = Convert.ToInt16(dmg[0]);
                     _dmg[1] = Convert.ToInt16(dmg[1]);
                     _dmg[2] = Convert.ToInt16(dmg[2]);
                     break;
                 }
             case 15:
                 {
                     _rangeDmg = new int[3];
                     string[] dmg = s.Split('/');
                     _rangeDmg[0] = Convert.ToInt16(dmg[0]);
                     _rangeDmg[1] = Convert.ToInt16(dmg[1]);
                     _rangeDmg[2] = Convert.ToInt16(dmg[2]);
                     break;
                 }
             case 16:
                 {
                     _defenceBonus = Convert.ToInt16(s);
                     break;
                 }
             case 17:
                 {
                     _armorDmgMultipiers = Single.Parse(s);
                     break;
                 }
             case 18:
                 {
                     _attack = Convert.ToInt16(s);
                     break;
                 }
             case 19:
                 {
                     _heightReq = Convert.ToInt16(s);
                     break;
                 }
         }
         col++;
     }
         //set posx and posy to 0
         _posX = 0;
         _oldX = 0;
         _posY = 0;
         _oldY = 0;
         _isPassable = true;
         _blockVision = false;
         _type = ObjectType.O_ITEM;
         _seen = false;
 }
コード例 #54
0
ファイル: WeaponManager.cs プロジェクト: sutatsu/Spirit-Mecha
	public void changeA(WeaponClass newWeapon){
		ASetter = newWeapon;
		setText (AText, newWeapon.weaponName);
	}
コード例 #55
0
ファイル: WeaponManager.cs プロジェクト: sutatsu/Spirit-Mecha
	public void changeW(WeaponClass newWeapon){
		WSetter = newWeapon;
		setText (WText, newWeapon.weaponName);
	}
コード例 #56
0
    //тип 6 номер 3
    public void Holdandunleash(HoldAndUnleash hld, 
	                             RootCharacterController c,
	                             WeaponClass w,
	                             int n, int b, int e, int cN,
	                             SpFunctions s,
	                             HitController h,
	                           clavisher cl)
    {
        if (hld.stage == 0)
            hld.SetValues (c, w, n, b, e,cN, s, h, cl);
        hld.Work ();
    }
コード例 #57
0
ファイル: WeaponManager.cs プロジェクト: sutatsu/Spirit-Mecha
	public void changeS(WeaponClass newWeapon){
		SSetter = newWeapon;
		setText (SText, newWeapon.weaponName);
	}
コード例 #58
0
 //тип 3 номер 0
 public void PrepareWeapon(WeaponClass weapon, SmartObjectController obj, int ready, bool b)
 {
     obj.battleStance = b;
     weapon.active = b;
     weapon.ready = ready;
 }
コード例 #59
0
 public int GetClassIndex(WeaponClass c)
 {
     for (int i = 0; i < weaponClasses.Length; i++) {
         if (c == weaponClasses[i])
             return i;
     }
     return -1;
 }
コード例 #60
0
    //тип 6 номер 5
    public void Punchuntiltarget(PunchUntilTarget p, 
	                             RootCharacterController c,
	                             WeaponClass w,
	                             int n, int b, int e,
	                             SpFunctions s,
	                             HitController h)
    {
        if (p.stage == 0)
            p.SetValues (c, w, n, b, e, s, h);
        p.Work ();
    }