class MWO::Weapon

Attributes

ammo_per_shot[RW]
ammo_type[RW]
artemis_ammo_type[RW]
category[RW]
clan[RW]
coneoffire[RW]
cooldown[RW]
crit_chance_increase[RW]
crit_dam_mult[RW]
damage[RW]
duration[RW]
emp[RW]
explode_chance[RW]
falloffexponent[RW]
formation_size[RW]
formation_size_per_index[RW]
formation_speed[RW]
gravity[RW]
groupedlocally[RW]
health[RW]
heat[RW]
heat_penalty_id[RW]
heatdamage[RW]
heatinctime[RW]
heatpenalty[RW]
hitpoints[RW]
impulse[RW]
inner_sphere[RW]
internal_explosion_dmg[RW]
jammed_time[RW]
jamming_chance[RW]
lifetime[RW]
long_range[RW]
max_depth[RW]
max_range[RW]
maxheight[RW]
min_range[RW]
minheatpenaltylevel[RW]
minheight[RW]
name[RW]
needlock[RW]
null_range[RW]
num_firing[RW]
num_per_shot[RW]
peakdist[RW]
peaktime[RW]
projectileclass[RW]
radius[RW]
rof[RW]
shots_during_cooldown[RW]
slots[RW]
speed[RW]
splash_percent[RW]
spread[RW]
tag[RW]
tag_decay[RW]
tag_duration[RW]
tag_spread_factor[RW]
tons[RW]
trackingstrength[RW]
trgheatinctime[RW]
type[RW]
use_tag[RW]
uselock[RW]
vis_range[RW]
volleydelay[RW]
volleysize[RW]
weapon_id[RW]

Public Class Methods

all(overrides: {}) click to toggle source
# File lib/mwo/weapon.rb, line 30
def self.all(overrides: {})
  weapons = []

  all_raw.each do |weapon_id, attrs|
    if attrs["category"] == "weapon"

      weapon = {weapon_id: weapon_id.to_i,
                name: attrs["name"],
                category: attrs["category"]
      }

      if attrs["factions"]
        weapon[:clan] = attrs["factions"]["Clan"]
        weapon[:inner_sphere] = attrs["factions"]["InnerSphere"]
      end

      attrs["stats"].each do |k,v|
        weapon[to_symbol(k)] = v
      end

      weapons << new(weapon)
    end

  end

  return weapons.extend MWO::CollectionUtils

end
all_raw(overrides: {}) click to toggle source
# File lib/mwo/weapon.rb, line 25
def self.all_raw(overrides: {})
  client = MWO::Client.new(overrides: {})
  raw = fetch(client.items_url)
end
ballistic() click to toggle source
# File lib/mwo/weapon.rb, line 63
def self.ballistic
  all.filter({type: 'Ballistic'})
end
clan() click to toggle source
# File lib/mwo/weapon.rb, line 75
def self.clan
  all.filter({clan: true})
end
energy() click to toggle source
# File lib/mwo/weapon.rb, line 59
def self.energy
  all.filter({type: 'Energy'})
end
inner_sphere() click to toggle source
# File lib/mwo/weapon.rb, line 71
def self.inner_sphere
  all.filter({inner_sphere: true})
end
missile() click to toggle source
# File lib/mwo/weapon.rb, line 67
def self.missile
  all.filter({type: 'Missile'})
end
new(args = {}) click to toggle source
# File lib/mwo/weapon.rb, line 19
def initialize args = {}
  args.each do |k,v|
    instance_variable_set("@#{k}", v) unless v.nil?
  end
end