Exemplo n.º 1
0
 public WeaponAmmoTuple(WeaponDefinition weapon, int ammo)
 {
     this.weapon = weapon;
     this.ammo   = ammo;
 }
Exemplo n.º 2
0
 public static void GiveWeapon(WeaponDefinition weapon, int ammo)
 {
     player.model.pickupWeapon.Try(new WeaponAmmoTuple(weapon, ammo));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Condition for <see cref="EntityModel.dropWeapon"/>
 /// </summary>
 /// <param name="weaponDefinition">The weapon definition to drop.</param>
 /// <returns>Whether or not the weapon can be dropped.</returns>
 public virtual bool CanDropWeapon(WeaponDefinition weaponDefinition)
 {
     return(this.inventory.ContainsKey(weaponDefinition));
 }
Exemplo n.º 4
0
        protected virtual bool CanSelectWeapon(WeaponDefinition def)
        {
            var weapon = GetWeaponInstance(def);

            return(weapon != null);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Called when the specified weapon needs to be created.
 /// Usually fired when the weapon was picked up.
 /// </summary>
 protected abstract bool _CreateWeapon(WeaponDefinition definition, out Weapon weaponInstance);
Exemplo n.º 6
0
 /// <summary>
 /// Returns the weapon instance held for the specified definition.
 /// Will return null if there is no weapon held for the specified definition.
 /// </summary>
 protected virtual Weapon GetWeaponInstance(WeaponDefinition def)
 {
     return(weapons.Where((w) => w.weaponDefinition == def).FirstOrDefault());
 }