Class: MWO::Weapon
Instance Attribute Summary collapse
-
#ammo_per_shot ⇒ Object
Returns the value of attribute ammo_per_shot.
-
#ammo_type ⇒ Object
Returns the value of attribute ammo_type.
-
#artemis_ammo_type ⇒ Object
Returns the value of attribute artemis_ammo_type.
-
#category ⇒ Object
Returns the value of attribute category.
-
#clan ⇒ Object
Returns the value of attribute clan.
-
#coneoffire ⇒ Object
Returns the value of attribute coneoffire.
-
#cooldown ⇒ Object
Returns the value of attribute cooldown.
-
#crit_chance_increase ⇒ Object
Returns the value of attribute crit_chance_increase.
-
#crit_dam_mult ⇒ Object
Returns the value of attribute crit_dam_mult.
-
#damage ⇒ Object
Returns the value of attribute damage.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#emp ⇒ Object
Returns the value of attribute emp.
-
#explode_chance ⇒ Object
Returns the value of attribute explode_chance.
-
#falloffexponent ⇒ Object
Returns the value of attribute falloffexponent.
-
#formation_size ⇒ Object
Returns the value of attribute formation_size.
-
#formation_size_per_index ⇒ Object
Returns the value of attribute formation_size_per_index.
-
#formation_speed ⇒ Object
Returns the value of attribute formation_speed.
-
#gravity ⇒ Object
Returns the value of attribute gravity.
-
#groupedlocally ⇒ Object
Returns the value of attribute groupedlocally.
-
#health ⇒ Object
Returns the value of attribute health.
-
#heat ⇒ Object
Returns the value of attribute heat.
-
#heat_penalty_id ⇒ Object
Returns the value of attribute heat_penalty_id.
-
#heatdamage ⇒ Object
Returns the value of attribute heatdamage.
-
#heatinctime ⇒ Object
Returns the value of attribute heatinctime.
-
#heatpenalty ⇒ Object
Returns the value of attribute heatpenalty.
-
#hitpoints ⇒ Object
Returns the value of attribute hitpoints.
-
#impulse ⇒ Object
Returns the value of attribute impulse.
-
#inner_sphere ⇒ Object
Returns the value of attribute inner_sphere.
-
#internal_explosion_dmg ⇒ Object
Returns the value of attribute internal_explosion_dmg.
-
#jammed_time ⇒ Object
Returns the value of attribute jammed_time.
-
#jamming_chance ⇒ Object
Returns the value of attribute jamming_chance.
-
#lifetime ⇒ Object
Returns the value of attribute lifetime.
-
#long_range ⇒ Object
Returns the value of attribute long_range.
-
#max_depth ⇒ Object
Returns the value of attribute max_depth.
-
#max_range ⇒ Object
Returns the value of attribute max_range.
-
#maxheight ⇒ Object
Returns the value of attribute maxheight.
-
#min_range ⇒ Object
Returns the value of attribute min_range.
-
#minheatpenaltylevel ⇒ Object
Returns the value of attribute minheatpenaltylevel.
-
#minheight ⇒ Object
Returns the value of attribute minheight.
-
#name ⇒ Object
Returns the value of attribute name.
-
#needlock ⇒ Object
Returns the value of attribute needlock.
-
#null_range ⇒ Object
Returns the value of attribute null_range.
-
#num_firing ⇒ Object
Returns the value of attribute num_firing.
-
#num_per_shot ⇒ Object
Returns the value of attribute num_per_shot.
-
#peakdist ⇒ Object
Returns the value of attribute peakdist.
-
#peaktime ⇒ Object
Returns the value of attribute peaktime.
-
#projectileclass ⇒ Object
Returns the value of attribute projectileclass.
-
#radius ⇒ Object
Returns the value of attribute radius.
-
#rof ⇒ Object
Returns the value of attribute rof.
-
#shots_during_cooldown ⇒ Object
Returns the value of attribute shots_during_cooldown.
-
#slots ⇒ Object
Returns the value of attribute slots.
-
#speed ⇒ Object
Returns the value of attribute speed.
-
#splash_percent ⇒ Object
Returns the value of attribute splash_percent.
-
#spread ⇒ Object
Returns the value of attribute spread.
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#tag_decay ⇒ Object
Returns the value of attribute tag_decay.
-
#tag_duration ⇒ Object
Returns the value of attribute tag_duration.
-
#tag_spread_factor ⇒ Object
Returns the value of attribute tag_spread_factor.
-
#tons ⇒ Object
Returns the value of attribute tons.
-
#trackingstrength ⇒ Object
Returns the value of attribute trackingstrength.
-
#trgheatinctime ⇒ Object
Returns the value of attribute trgheatinctime.
-
#type ⇒ Object
Returns the value of attribute type.
-
#use_tag ⇒ Object
Returns the value of attribute use_tag.
-
#uselock ⇒ Object
Returns the value of attribute uselock.
-
#vis_range ⇒ Object
Returns the value of attribute vis_range.
-
#volleydelay ⇒ Object
Returns the value of attribute volleydelay.
-
#volleysize ⇒ Object
Returns the value of attribute volleysize.
-
#weapon_id ⇒ Object
Returns the value of attribute weapon_id.
Class Method Summary collapse
- .all(overrides: {}) ⇒ Object
- .all_raw(overrides: {}) ⇒ Object
- .ballistic ⇒ Object
- .clan ⇒ Object
- .energy ⇒ Object
- .inner_sphere ⇒ Object
- .missile ⇒ Object
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Weapon
constructor
A new instance of Weapon.
Methods included from Utils
Constructor Details
#initialize(args = {}) ⇒ Weapon
Returns a new instance of Weapon.
19 20 21 22 23 |
# 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 |
Instance Attribute Details
#ammo_per_shot ⇒ Object
Returns the value of attribute ammo_per_shot.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def ammo_per_shot @ammo_per_shot end |
#ammo_type ⇒ Object
Returns the value of attribute ammo_type.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def ammo_type @ammo_type end |
#artemis_ammo_type ⇒ Object
Returns the value of attribute artemis_ammo_type.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def artemis_ammo_type @artemis_ammo_type end |
#category ⇒ Object
Returns the value of attribute category.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def category @category end |
#clan ⇒ Object
Returns the value of attribute clan.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def clan @clan end |
#coneoffire ⇒ Object
Returns the value of attribute coneoffire.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def coneoffire @coneoffire end |
#cooldown ⇒ Object
Returns the value of attribute cooldown.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def cooldown @cooldown end |
#crit_chance_increase ⇒ Object
Returns the value of attribute crit_chance_increase.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def crit_chance_increase @crit_chance_increase end |
#crit_dam_mult ⇒ Object
Returns the value of attribute crit_dam_mult.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def crit_dam_mult @crit_dam_mult end |
#damage ⇒ Object
Returns the value of attribute damage.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def damage @damage end |
#duration ⇒ Object
Returns the value of attribute duration.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def duration @duration end |
#emp ⇒ Object
Returns the value of attribute emp.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def emp @emp end |
#explode_chance ⇒ Object
Returns the value of attribute explode_chance.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def explode_chance @explode_chance end |
#falloffexponent ⇒ Object
Returns the value of attribute falloffexponent.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def falloffexponent @falloffexponent end |
#formation_size ⇒ Object
Returns the value of attribute formation_size.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def formation_size @formation_size end |
#formation_size_per_index ⇒ Object
Returns the value of attribute formation_size_per_index.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def formation_size_per_index @formation_size_per_index end |
#formation_speed ⇒ Object
Returns the value of attribute formation_speed.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def formation_speed @formation_speed end |
#gravity ⇒ Object
Returns the value of attribute gravity.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def gravity @gravity end |
#groupedlocally ⇒ Object
Returns the value of attribute groupedlocally.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def groupedlocally @groupedlocally end |
#health ⇒ Object
Returns the value of attribute health.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def health @health end |
#heat ⇒ Object
Returns the value of attribute heat.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def heat @heat end |
#heat_penalty_id ⇒ Object
Returns the value of attribute heat_penalty_id.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def heat_penalty_id @heat_penalty_id end |
#heatdamage ⇒ Object
Returns the value of attribute heatdamage.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def heatdamage @heatdamage end |
#heatinctime ⇒ Object
Returns the value of attribute heatinctime.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def heatinctime @heatinctime end |
#heatpenalty ⇒ Object
Returns the value of attribute heatpenalty.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def heatpenalty @heatpenalty end |
#hitpoints ⇒ Object
Returns the value of attribute hitpoints.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def hitpoints @hitpoints end |
#impulse ⇒ Object
Returns the value of attribute impulse.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def impulse @impulse end |
#inner_sphere ⇒ Object
Returns the value of attribute inner_sphere.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def inner_sphere @inner_sphere end |
#internal_explosion_dmg ⇒ Object
Returns the value of attribute internal_explosion_dmg.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def internal_explosion_dmg @internal_explosion_dmg end |
#jammed_time ⇒ Object
Returns the value of attribute jammed_time.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def jammed_time @jammed_time end |
#jamming_chance ⇒ Object
Returns the value of attribute jamming_chance.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def jamming_chance @jamming_chance end |
#lifetime ⇒ Object
Returns the value of attribute lifetime.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def lifetime @lifetime end |
#long_range ⇒ Object
Returns the value of attribute long_range.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def long_range @long_range end |
#max_depth ⇒ Object
Returns the value of attribute max_depth.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def max_depth @max_depth end |
#max_range ⇒ Object
Returns the value of attribute max_range.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def max_range @max_range end |
#maxheight ⇒ Object
Returns the value of attribute maxheight.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def maxheight @maxheight end |
#min_range ⇒ Object
Returns the value of attribute min_range.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def min_range @min_range end |
#minheatpenaltylevel ⇒ Object
Returns the value of attribute minheatpenaltylevel.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def minheatpenaltylevel @minheatpenaltylevel end |
#minheight ⇒ Object
Returns the value of attribute minheight.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def minheight @minheight end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def name @name end |
#needlock ⇒ Object
Returns the value of attribute needlock.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def needlock @needlock end |
#null_range ⇒ Object
Returns the value of attribute null_range.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def null_range @null_range end |
#num_firing ⇒ Object
Returns the value of attribute num_firing.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def num_firing @num_firing end |
#num_per_shot ⇒ Object
Returns the value of attribute num_per_shot.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def num_per_shot @num_per_shot end |
#peakdist ⇒ Object
Returns the value of attribute peakdist.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def peakdist @peakdist end |
#peaktime ⇒ Object
Returns the value of attribute peaktime.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def peaktime @peaktime end |
#projectileclass ⇒ Object
Returns the value of attribute projectileclass.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def projectileclass @projectileclass end |
#radius ⇒ Object
Returns the value of attribute radius.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def radius @radius end |
#rof ⇒ Object
Returns the value of attribute rof.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def rof @rof end |
#shots_during_cooldown ⇒ Object
Returns the value of attribute shots_during_cooldown.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def shots_during_cooldown @shots_during_cooldown end |
#slots ⇒ Object
Returns the value of attribute slots.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def slots @slots end |
#speed ⇒ Object
Returns the value of attribute speed.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def speed @speed end |
#splash_percent ⇒ Object
Returns the value of attribute splash_percent.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def splash_percent @splash_percent end |
#spread ⇒ Object
Returns the value of attribute spread.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def spread @spread end |
#tag ⇒ Object
Returns the value of attribute tag.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def tag @tag end |
#tag_decay ⇒ Object
Returns the value of attribute tag_decay.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def tag_decay @tag_decay end |
#tag_duration ⇒ Object
Returns the value of attribute tag_duration.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def tag_duration @tag_duration end |
#tag_spread_factor ⇒ Object
Returns the value of attribute tag_spread_factor.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def tag_spread_factor @tag_spread_factor end |
#tons ⇒ Object
Returns the value of attribute tons.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def tons @tons end |
#trackingstrength ⇒ Object
Returns the value of attribute trackingstrength.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def trackingstrength @trackingstrength end |
#trgheatinctime ⇒ Object
Returns the value of attribute trgheatinctime.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def trgheatinctime @trgheatinctime end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def type @type end |
#use_tag ⇒ Object
Returns the value of attribute use_tag.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def use_tag @use_tag end |
#uselock ⇒ Object
Returns the value of attribute uselock.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def uselock @uselock end |
#vis_range ⇒ Object
Returns the value of attribute vis_range.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def vis_range @vis_range end |
#volleydelay ⇒ Object
Returns the value of attribute volleydelay.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def volleydelay @volleydelay end |
#volleysize ⇒ Object
Returns the value of attribute volleysize.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def volleysize @volleysize end |
#weapon_id ⇒ Object
Returns the value of attribute weapon_id.
3 4 5 |
# File 'lib/mwo/weapon.rb', line 3 def weapon_id @weapon_id end |
Class Method Details
.all(overrides: {}) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# 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: {}) ⇒ Object
25 26 27 28 |
# File 'lib/mwo/weapon.rb', line 25 def self.all_raw(overrides: {}) client = MWO::Client.new(overrides: {}) raw = fetch(client.items_url) end |
.ballistic ⇒ Object
63 64 65 |
# File 'lib/mwo/weapon.rb', line 63 def self.ballistic all.filter({type: 'Ballistic'}) end |
.clan ⇒ Object
75 76 77 |
# File 'lib/mwo/weapon.rb', line 75 def self.clan all.filter({clan: true}) end |
.energy ⇒ Object
59 60 61 |
# File 'lib/mwo/weapon.rb', line 59 def self.energy all.filter({type: 'Energy'}) end |
.inner_sphere ⇒ Object
71 72 73 |
# File 'lib/mwo/weapon.rb', line 71 def self.inner_sphere all.filter({inner_sphere: true}) end |
.missile ⇒ Object
67 68 69 |
# File 'lib/mwo/weapon.rb', line 67 def self.missile all.filter({type: 'Missile'}) end |