コード例 #1
0
 void Update()
 {
     if (Activate == true)
     {
         this.GetComponent <Animator>().SetBool("Activation", true);
         Multiply.GetComponent <Animator>().SetBool("Activation", true);
         Lvl.text = this.transform.parent.GetComponent <SlaveProperties>().Level.ToString();
         Pow.text = this.transform.parent.GetComponent <SlaveProperties>().PowerOfShot.ToString();
         if (this.transform.parent.GetComponent <SlaveProperties>().WeaponXRef != null)
         {
             WeaponProperties wpn = this.transform.parent.GetComponent <SlaveProperties>().WeaponXRef.gameObject.GetComponent <WeaponProperties>();
             if (wpn.Bullets >= 10)
             {
                 Bul.text = wpn.Bullets.ToString();
             }
             else if (wpn.Bullets < 10)
             {
                 Bul.text = "0" + wpn.Bullets.ToString();
             }
         }
         else
         {
             Bul.text = "00";
         }
         //this.transform.parent.GetComponent<SlaveProperties>().ShowHealthbar = true;
     }
     else
     {
         this.GetComponent <Animator>().SetBool("Activation", false);
         Multiply.GetComponent <Animator>().SetBool("Activation", false);
         HealthBar.transform.localPosition = new Vector3(HealthBar.transform.localPosition.x, HealthBar.transform.localPosition.y, -0.1f);
         //this.transform.parent.GetComponent<SlaveProperties>().ShowHealthbar = false;
     }
 }
コード例 #2
0
    public static void fireProjectile(WeaponProperties weaponProperties, TargetProperties targetProperties)
    {
        GameObject newGameObject = new GameObject();

        Projectile.SetProjectile(weaponProperties, targetProperties, newGameObject);
        newGameObject.transform.parent = GameObject.Find("playerProjectileLayer").transform;
    }
コード例 #3
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (!(value is WeaponProperties))
            {
                return("");
            }

            WeaponProperties prop    = (WeaponProperties)value;
            List <string>    results = new List <string>();

            foreach (WeaponProperties iProp in Enum.GetValues(typeof(WeaponProperties)))
            {
                if (iProp == WeaponProperties.None)
                {
                    continue;
                }

                if ((prop & iProp) == iProp)
                {
                    results.Add(Utility.GetWeaponPropertyName(iProp));
                }
            }

            return(String.Join(", ", results.ToArray()));
        }
コード例 #4
0
ファイル: Utility.cs プロジェクト: battousai999/CharPad
        public static string GetWeaponPropertyName(WeaponProperties property)
        {
            switch (property)
            {
            case WeaponProperties.Brutal_1:
                return("Brutal 1");

            case WeaponProperties.Brutal_2:
                return("Brutal 2");

            case WeaponProperties.HeavyThrown:
                return("Heavy thrown");

            case WeaponProperties.HighCrit:
                return("High crit");

            case WeaponProperties.LightThrown:
                return("Light thrown");

            case WeaponProperties.LoadFree:
                return("Load free");

            case WeaponProperties.LoadMinor:
                return("Load minor");

            case WeaponProperties.OffHand:
                return("Off-hand");

            default:
                return(Enum.Format(typeof(WeaponProperties), property, "G"));
            }
        }
コード例 #5
0
    public void HitRegistered(Collision col)
    {
        WeaponProperties wp = col.gameObject.GetComponent <WeaponProperties>();

        if (timeSinceLastHit > 0.3f)
        {
            float damage = CalculateDamage(wp.hitDmg);

            if (damage > 200)
            {
                damage = 200;
            }

            healthLossIndicatorVignette.FadeIn(0.3f);
            playerHealthController.DecreaseCurrentHP(damage);
            timeSinceLastHit = 0;

            if (col.gameObject.tag == "bossGlove")
            {
                FMODUnity.RuntimeManager.PlayOneShot("event:/Boss/Abilities/PunchTalk", GetComponent <Transform>().position);
                FMODUnity.RuntimeManager.PlayOneShot("event:/Boss/Abilities/Punch", GetComponent <Transform>().position);
                Debug.Log("Sound");
            }
        }
    }
コード例 #6
0
ファイル: Equipment.cs プロジェクト: knightlyj/NG
    /// <summary>
    /// 切换武器
    /// </summary>
    /// <param name="idx"></param>
    /// <returns></returns>
    bool SwitchWeapon(int idx)
    {
        if (idx < 0 || idx >= weaponAmount)
        {
            return(false);
        }

        //移除当前使用武器的属性
        if (_weapons[curWeaponIdx] != null)
        {
            WeaponProperties weaponProp = EquipTable.GetWeaponProp(_weapons[curWeaponIdx].Type.weaponId);
            if (weaponProp != null)
            {
                RemoveWeaponProp(bindPlayer, weaponProp);
            }
        }

        //添加要使用的武器的属性
        if (Weapons[idx] != null)
        {
            WeaponProperties weaponProp = EquipTable.GetWeaponProp(_weapons[idx].Type.weaponId);
            if (weaponProp != null)
            {
                AddWeaponProp(bindPlayer, weaponProp);
            }
        }

        curWeaponIdx = idx;

        return(true);
    }
コード例 #7
0
    public void HitRegistered(Collision col)
    {
        if (!animator.GetBool("isCharging"))
        {
            WeaponProperties wp = col.gameObject.GetComponent <WeaponProperties>();

            if (timeSinceLastHit > 0.2f)
            {
                float damage = CalculateDamage(wp.hitDmg, col.transform.position);

                if (col.gameObject.tag == "Sword" || col.gameObject.tag == "Torch")
                {
                    damage *= damageMultiplier;
                }


                if (damage > 200)
                {
                    damage = 200;
                }

                if (damage >= 1)
                {
                    animator.SetTrigger("bodyHit");
                    bossHealth.DecreaseCurrentHP(damage);
                    timeSinceLastHit = 0;
                }
            }
        }
    }
コード例 #8
0
ファイル: PlayerWeapon.cs プロジェクト: rumpff/t4nks
    /// <summary>
    /// Override the current weapon with a new weapon
    /// </summary>
    /// <param name="newWeapon"></param>
    public void SwitchWeapon(WeaponProperties newWeapon)
    {
        // Swap out weapons
        m_EquippedWeapon = newWeapon;

        // Remove the old barrel objects
        foreach (Transform obj in m_BarrelParent.GetComponentInChildren <Transform>())
        {
            if (obj != null)
            {
                Destroy(obj.gameObject);
            }
        }

        // Spawn new barrel mesh
        GameObject newBarrel = Instantiate(newWeapon.BarrelPrefab, TankBarrel);

        // Assign the new gameobjects
        m_BarrelEnd = newBarrel.transform.Find("BarrelEnd");
        m_Barrel    = newBarrel.transform;

        // Update layermasks
        m_Player.UpdatePlayerLayerMasks(newBarrel.GetComponentsInChildren <MeshRenderer>(), m_Player.Index);

        // Update ammo and etc. values
        m_CurrentAmmo = newWeapon.StartingAmmo;
    }
コード例 #9
0
    public int mines;                 //当前可持有的最大地雷数量


    void Start()
    {
        player   = GameManager.Instance.player;
        gunLevel = GameManager.Instance.gunLevel;
        weapons[gunLevel - 1].SetActive(true);
        hasTurret        = true;
        curMine          = mines = 3;
        weaponProperties = GameManager.Instance.weaponPropertiesList[GameManager.Instance.gunLevel - 1];
        maxInaccuracy    = (float)weaponProperties.maxInaccuracy;
        recoilForce      = (float)weaponProperties.recoilForce;
        destabilization  = (float)weaponProperties.destabilization;
        aimingDeSpeed    = (float)weaponProperties.aimingDeSpeed;
        minInaccuracy    = (float)weaponProperties.minInaccuracy;
        attackCD         = (float)weaponProperties.attackCD;
        magazine         = weaponProperties.magazine;
        totalBullets     = weaponProperties.totalBullets;
        reload           = (float)weaponProperties.reload;
        weight           = (float)weaponProperties.weight;
        repulsion        = weaponProperties.repulsion;
        audioSource      = GetComponent <AudioSource>();
        //当前属性赋值
        curBullets  = totalBullets;
        curMagazine = magazine;
        curReload   = curAttackCD = 0;
        turretLevel = GameManager.Instance.gunLevel / 2;
        if (turretLevel == 0)
        {
            turretLevel = 1;
        }

        player.playerShooting = this;
    }
コード例 #10
0
    private void Start()
    {
        viewModel = GameObject.FindGameObjectWithTag("weaponViewModel");

        for (int i = 0; i < weaponList.Count; i++)
        {
            WeaponProperties weapon = weaponList[i];

            GameObject wepInst = Instantiate(weapon.Model, viewModel.transform);
            wepInst.transform.localScale = weapon.modelScale;

            weaponObjects.Add(wepInst);

            // Only show the first weapon.
            if (i == 0)
            {
                weaponObjects[i].SetActive(true);
            }
            else
            {
                weaponObjects[i].SetActive(false);
            }

            weaponIndex = 0;
        }
    }
コード例 #11
0
 public void ShowWeaponInfo()
 {
     if (ITEMS.gameObject != null)
     {
         if (ITEMS.active == true)
         {
             BoughtItems.active = false;
             if (Info != null)
             {
                 Info.gameObject.active = true;
             }
             ItemsSource.active = false;
             if (Icon != null)
             {
                 Icon.GetComponent <WeaponProperties>().Skin = isActiveItem.GetComponent <WeaponProperties>().Skin;
             }
             WeaponProperties Item = isActiveItem.GetComponent <WeaponProperties>();
             string           eff  = "";
             for (int a = 0; a < Item.Efficiency / 10; a++)
             {
                 if (Item.Efficiency / 10 < 60)
                 {
                     eff += "i";
                 }
             }
             if (Info != null)
             {
                 Info.text = Item.WeapName + "\n\ndamage: " + Item.Damage + "\ncondition:" + Item.Condition
                             + "\nbullets: " + Item.Bullets + "\nEfficiency: " + Item.Efficiency + "\n" + eff + "\n\nprice: " + Item.Price;
             }
         }
     }
 }
コード例 #12
0
    void Item_Show()
    {
        if (isActiveItem.GetComponent <OtherStuff>() != null)
        {
            OtherStuff prop = isActiveItem.GetComponent <OtherStuff>();
            Description.text = prop.ShortDescription;
            //if (Sell_Button != null) {
            //    Sell_Button.active = true;
            //}
        }

        if (isActiveItem.GetComponent <WeaponProperties>() != null)
        {
            WeaponProperties prop = isActiveItem.GetComponent <WeaponProperties>();
            Description.text = prop.WeapName + "\n\ndamage: " + prop.Damage + "\ncondition: " + prop.Condition + "\nbullets: " + prop.Bullets;
            //    int RepairPrice = (10 - prop.Condition) * (prop.Price / prop.Condition);
            //    Description.text = prop.WeapName + "\ndamage: " + prop.Damage + "\ncondition: " + prop.Condition + "\nbullets: " + prop.Bullets +
            //        "\n\n\n\nfor: " + RepairPrice.ToString() + "$" + "\n\n\n\nfor: " + (int)(0.8f * prop.Price) + "$";
            //    Repair_Button.active = true;
            //    Sell_Button.active = true;
            //    if (PlayInv.Money < RepairPrice) {
            //        Repair_Button.GetComponent<ButtonSample>().isActive = false;
            //    } else {
            //        Repair_Button.GetComponent<ButtonSample>().isActive = true;
            //    }
            //}
        }

        Heal_Button.active = false;
    }
コード例 #13
0
        public static string Name(this WeaponProperties property, Weapon weapon)
        {
            var sb   = new StringBuilder();
            var prop = property;

            // Composite flags.
            if (prop.HasFlag(WeaponProperties.TrueHealing))
            {
                sb.Append($"{Enum.GetName(typeof(WeaponProperties), WeaponProperties.TrueHealing)}, ");
                prop &= ~(WeaponProperties.Piercing | WeaponProperties.Healing);
            }

            // Independent flags.
            if (prop.HasFlag(WeaponProperties.Piercing))
            {
                sb.Append($"{Enum.GetName(typeof(WeaponProperties), WeaponProperties.Piercing)}, ");
            }
            if (prop.HasFlag(WeaponProperties.Healing))
            {
                sb.Append($"{Enum.GetName(typeof(WeaponProperties), WeaponProperties.Healing)}, ");
            }
            if (prop.HasFlag(WeaponProperties.Stun))
            {
                sb.Append($"{Enum.GetName(typeof(WeaponProperties), WeaponProperties.Stun)} {weapon.Stun}, ");
            }

            return(sb.ToString().TrimEnd(new char[2] {
                ' ', ','
            }));
        }
コード例 #14
0
ファイル: RandomWeapon.cs プロジェクト: Zapliin/Zombie
    // Use this for initialization
    void Start()
    {
        GameObject weapon = GameObject.Find("Weapon");

        weaponProperties = weapon.GetComponent <WeaponProperties>();
        weapons          = weapon.transform.gameObject.GetComponentsInChildren <Weapon>();
        enterText        = GameObject.Find("RandomBoxText").GetComponent <Text>();
    }
コード例 #15
0
 void CmdSwitchToPistol()
 {
     weapon = pistol.GetComponent <WeaponProperties>();
     knife.SetActive(false);
     pistol.SetActive(true);
     unarmed.SetActive(false);
     RpcSwitchToPistol();
 }
コード例 #16
0
ファイル: PlayerWeapon.cs プロジェクト: MickSemps/Platformer
 bool CheckWeaponIsSetUp(WeaponProperties.Weapon w)
 {
     if (w.prefab == null)
     {
         Debug.LogWarning(w + " not set up");
         return false;
     }
     return true;
 }
コード例 #17
0
        public void Initialize()
        {
            properties = new WeaponProperties();
            properties.modelInstance    = Instantiate(modelPrefab);
            properties.weaponController = properties.modelInstance.GetComponent <WeaponController> ();
            properties.weaponController.Initialization();
            properties.lastFireTime = 0;

            ammoType = Managers.GameManagers.GetAmmoManager().GetAmmo(ammoType.name);
        }
コード例 #18
0
 private int GetDamageOnHit(Actor attacker, Actor target, WeaponProperties properties)
 {
     var damage = properties.Damage;
     var critRoll = UnityEngine.Random.Range(0.0f, 1.0f);
     if (critRoll <= properties.CritChance)
     {
         damage += properties.AdditionalCritDamage;
     }
     return damage;
 }
コード例 #19
0
    // NO DamageType Effectiveness
    // public Vector2Int CalculateDamageRange(FiringZone.Face face)
    // {
    //     Vector2Int damageRange = new Vector2Int();
    //     damage.AddModifier(properties.Profile[(int)face]);
    //     // if (shield) {

    //     // } else {
    //     damage.BaseValue = activeWeapon.HullDamage.x;
    //     damageRange.x = (int)damage.Value;
    //     damage.BaseValue = activeWeapon.HullDamage.y;
    //     damageRange.y = (int)damage.Value;
    //     damage.RemoveModifier(properties.Profile[(int)face]);
    //     // }
    //     return damageRange;
    // }

    public float CalculateAccuracy(WeaponProperties weapon, Vector3 targetPosition, float targetEvasion, Vector3?position = null)
    {
        float range = Vector3.Distance(targetPosition, position ?? transform.position);

        accuracy.BaseValue = weapon.Accuracy;
        float accuracyVal = (accuracy.Value - targetEvasion) / (100 * range); // TODO change

        accuracyVal = Mathf.Clamp(accuracyVal, 0, 1);
        return(accuracyVal);
    }
コード例 #20
0
 void Start()
 {
     //laserLine = GetComponent<LineRenderer>();
     //gunAudio = GetComponent<AudioSource>();
     fpsCam    = GetComponentInParent <Camera>();
     weapon    = GetComponent <WeaponProperties>();
     inventory = GetComponentInParent <PlayerInventory>();
     anim      = GetComponentInChildren <Animator>();
     print("player inventory is " + inventory);
 }
コード例 #21
0
        static WeaponProperties GetWeaponProperties(WeaponDto weaponDto)
        {
            WeaponProperties result = WeaponProperties.None;

            if (MathUtils.IsChecked(weaponDto.Ammo))
            {
                result |= WeaponProperties.Ammunition;
            }
            if (MathUtils.IsChecked(weaponDto.Finesse))
            {
                result |= WeaponProperties.Finesse;
            }
            if (MathUtils.IsChecked(weaponDto.Heavy))
            {
                result |= WeaponProperties.Heavy;
            }
            if (MathUtils.IsChecked(weaponDto.Light))
            {
                result |= WeaponProperties.Light;
            }
            if (MathUtils.IsChecked(weaponDto.Martial))
            {
                result |= WeaponProperties.Martial;
            }
            if (MathUtils.IsChecked(weaponDto.Melee))
            {
                result |= WeaponProperties.Melee;
            }
            if (MathUtils.IsChecked(weaponDto.Ranged))
            {
                result |= WeaponProperties.Ranged;
            }
            if (MathUtils.IsChecked(weaponDto.Reach))
            {
                result |= WeaponProperties.Reach;
            }
            if (MathUtils.IsChecked(weaponDto.Special))
            {
                result |= WeaponProperties.Special;
            }
            if (MathUtils.IsChecked(weaponDto.Thrown))
            {
                result |= WeaponProperties.Thrown;
            }
            if (MathUtils.IsChecked(weaponDto.TwoHanded))
            {
                result |= WeaponProperties.TwoHanded;
            }
            if (MathUtils.IsChecked(weaponDto.Versatile))
            {
                result |= WeaponProperties.Versatile;
            }

            return(result);
        }
コード例 #22
0
    public WeaponDamageRange CalculateDamageRange(WeaponProperties weapon, float accuracy, FiringZone.Face face, float targetShield, float priorShieldDamage = 0)
    {
        WeaponDamageRange damageRange = new WeaponDamageRange();

        damage.AddModifier(properties.Profile[(int)face]);
        // target has a shield - need to factor in each weapon types effectiveness
        if (targetShield - priorShieldDamage > 0)
        {
            // a list going from most effective to least effective against shields
            foreach (var shieldPriority in DamageTypeEffect.SHIELD_PRIORITY_LIST)
            {
                Vector2Int range = weapon.Damage[shieldPriority];
                // TODO add modifiers of effect
                // THIS IS PROBLEM AREA
                // TODO doing targetDamage.shieldRange.x is being conservative
                // doing targetDamage.shieldRange.y would be greedy
                if (damageRange.shieldRange.x >= targetShield - priorShieldDamage)
                {
                    damage.BaseValue         = range.x;
                    damageRange.hullRange.x += damage.Value * DamageTypeEffect.HullEffect(shieldPriority);
                    damage.BaseValue         = range.y;
                    damageRange.hullRange.y += damage.Value * DamageTypeEffect.HullEffect(shieldPriority);
                }
                // else if (damageRange.shieldRange.y >= targetShield - targetDamage.shieldRange.x)
                // {
                //     damage.BaseValue = range.x;
                //     damageRange.shieldRange.x += damage.Value;
                //     damage.BaseValue = range.y;
                //     damageRange.hullRange.y += damage.Value;
                // }
                else
                {
                    damage.BaseValue           = range.x;
                    damageRange.shieldRange.x += damage.Value * DamageTypeEffect.ShieldEffect(shieldPriority);
                    damage.BaseValue           = range.y;
                    damageRange.shieldRange.y += damage.Value * DamageTypeEffect.ShieldEffect(shieldPriority);
                }
            }
            damageRange *= accuracy;
            damageRange.shieldRange.x = Mathf.Clamp(damageRange.shieldRange.x, 0, targetShield);
            damageRange.shieldRange.y = Mathf.Clamp(damageRange.shieldRange.y, 0, targetShield);
        }
        else
        {
            // if the target has no shield it is simply hull damage
            // hull damage of a weapon can be precomputed and cached with effectivenesses
            damage.BaseValue        = weapon.HullDamage.x;
            damageRange.hullRange.x = damage.Value;
            damage.BaseValue        = weapon.HullDamage.y;
            damageRange.hullRange.y = damage.Value;
            damageRange            *= accuracy;
        }
        damage.RemoveModifier(properties.Profile[(int)face]);
        return(damageRange);
    }
コード例 #23
0
    // Use this for initialization
    void Start()
    {
        equippedWeaponProperties = GetComponent <WeaponProperties>();
        meleeWeapon    = equippedWeaponProperties.meleeWeapon;
        weaponAnimator = GetComponent <Animator>();
        audioSource    = GetComponent <AudioSource>();

        //if this is a ranged weapon
        //BulletExit should be an empty GameObject placed at where the bullet should first appear on the gun
        bulletExitPosition = transform.Find("BulletExit");
    }
コード例 #24
0
    public void Initialize(WeaponProperties weaponProperties, TargetProperties targetProperties)
    {
        this.weaponProperties = weaponProperties;
        this.targetProperties = targetProperties;

        gameObject.transform.position = targetProperties.getStartPosition();

        Vector2 test = Vector3.Normalize(targetProperties.getTargetPosition() - targetProperties.getStartPosition());

//		gameObject.GetComponent<Rigidbody2D> ().AddForce (test);
    }
コード例 #25
0
    private int GetDamageOnHit(Actor attacker, Actor target, WeaponProperties properties)
    {
        var damage   = properties.Damage;
        var critRoll = UnityEngine.Random.Range(0.0f, 1.0f);

        if (critRoll <= properties.CritChance)
        {
            damage += properties.AdditionalCritDamage;
        }
        return(damage);
    }
コード例 #26
0
ファイル: ProjectileBehaviour.cs プロジェクト: rumpff/t4nks
    public void Initalize(Player ownerIndex, WeaponProperties weaponInfo, Vector3 aimDirection)
    {
        m_Owner            = ownerIndex;
        m_WeaponProperties = weaponInfo;

        m_Rigidbody.mass = weaponInfo.Mass;
        m_Rigidbody.AddForce(aimDirection * weaponInfo.InitialForce);

        AddDistancePoint();
        StartCoroutine(TrackDistance());
        StartCoroutine(AutoDestroy());
    }
コード例 #27
0
 void Start()
 {
     gunProperties    = GetComponentInChildren <WeaponProperties>();
     playerController = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>();
     gunParticles     = GetComponentInChildren <ParticleSystem>();
     gunLine          = GetComponentInChildren <LineRenderer>();
     gunLight         = GetComponentInChildren <Light>();
     magazineCapacity = gunProperties.Magazine;
     gunShootSound    = GetComponentsInChildren <AudioSource>()[0];
     gunReloadSound   = GetComponentsInChildren <AudioSource>()[1];
     ammo             = gunProperties.Ammo;
     currentMagazine  = magazineCapacity;
 }
コード例 #28
0
    protected virtual void Start()
    {
        properties = ShipProperties.Instantiate(properties);
        zone       = GetComponent <FiringZone>();
        TurnOrder.Instance.Subscribe(this);

        actions = new ActionProperties[weapons.Length];
        for (int i = 0; i < weapons.Length; i++)
        {
            weapons[i] = WeaponProperties.Instantiate(weapons[i]);
            actions[i] = weapons[i];
        }
    }
コード例 #29
0
 public Weapon(string name, int proficiencyBonus, Dice damage, string range, WeaponGroup group, WeaponProperties properties, int basePrice, WeaponCategory category, bool isTwoHanded, int enhancementBonus)
 {
     this.name             = name;
     this.proficiencyBonus = proficiencyBonus;
     this.damage           = damage;
     this.range            = range;
     this.group            = group;
     this.properties       = properties;
     this.enhancementBonus = enhancementBonus;
     this.basePrice        = basePrice;
     this.category         = category;
     this.isTwoHanded      = isTwoHanded;
 }
コード例 #30
0
        public bool SwitchAmmoMagazine(MyDefinitionId ammoMagazineId)
        {
            m_remainingAmmos[CurrentAmmoMagazineId] = CurrentAmmo;
            WeaponProperties.ChangeAmmoMagazine(ammoMagazineId);

            int newCurrentAmmo = 0;

            m_remainingAmmos.TryGetValue(ammoMagazineId, out newCurrentAmmo);
            CurrentAmmo = newCurrentAmmo;

            RefreshAmmunitionAmount();

            return(ammoMagazineId == WeaponProperties.AmmoMagazineId);
        }
コード例 #31
0
ファイル: Equipment.cs プロジェクト: knightlyj/NG
 void AddWeaponProp(Player player, WeaponProperties weaponProp)
 {
     if (player != null && weaponProp != null)
     {
         player.minAttack      += weaponProp.minAtkBonus;     //最小攻击
         player.maxAttack      += weaponProp.maxAtkBonus;     //最大攻击
         player.atkInterval     = weaponProp.atkInterval;     //攻击间隔
         player.recoil          = weaponProp.recoil;          //后坐力
         player.knockBack       = weaponProp.beatBack;        //击退
         player.criticalChance += weaponProp.crtlChanceBonus; //暴击几率
         player.criticalRate   += weaponProp.crtlRateBonus;   //暴击伤害
         player.rcr            += weaponProp.rcrBonus;        //rcr
     }
 }
コード例 #32
0
ファイル: Equipment.cs プロジェクト: knightlyj/NG
 void RemoveWeaponProp(Player player, WeaponProperties weaponProp)
 {
     if (player != null && weaponProp != null)
     {
         player.minAttack      -= weaponProp.minAtkBonus;     //最小攻击
         player.maxAttack      -= weaponProp.maxAtkBonus;     //最大攻击
         player.atkInterval     = 0.5f;                       //攻击间隔
         player.recoil          = 0;                          //后坐力
         player.knockBack       = 0;                          //击退
         player.criticalChance -= weaponProp.crtlChanceBonus; //暴击几率
         player.criticalRate   -= weaponProp.crtlRateBonus;   //暴击伤害
         player.rcr            -= weaponProp.rcrBonus;        //rcr
     }
 }
コード例 #33
0
 public override IEnumerable<Vector2i> GetAttackableLocations(Map map, Actor actor, WeaponProperties weapon)
 {
     return AttackHelper.GetTargetablePoints(map, actor, weapon.MinRange, weapon.MaxRange, true, false);
 }
コード例 #34
0
 private float GetChanceToHitActor(Actor attacker, Actor target, WeaponProperties properties)
 {
     return 0.80f;
 }
コード例 #35
0
ファイル: AttackAbility.cs プロジェクト: HaKDMoDz/awayteam
 public abstract IEnumerable<Vector2i> GetAttackableLocations(Map map, Actor actor, WeaponProperties weapon);
コード例 #36
0
ファイル: Chef.cs プロジェクト: tehr0b/heartillery
    /// <summary>
    /// Called once before other scripts in the scene
    /// </summary>
    void Awake()
    {
        // cache the controller's transform for quicker lookup
        _controllerTransform = controller.transform;

        // initialize the weapon
        _currentWeapon = new WeaponProperties();
        _currentWeapon.weaponType = Weapon.WEAPON_TYPE.RollingPin;
        _currentWeapon.damage = gameManager.weapon.GetWeaponDamage(_currentWeapon.weaponType);

        // store the start position and rotation for resetting
        _startPosition = _controllerTransform.position;
        _startRotation = _controllerTransform.localRotation;

        // make sure the probability is in the range between zero and one
        idleAnimationProbability = Mathf.Clamp01(idleAnimationProbability);

        // register the collider and user delegates
        boneAnimation.RegisterColliderTriggerDelegate(ColliderTrigger);
        boneAnimation.RegisterUserTriggerDelegate(UserTrigger);
    }