Module: Destiny::ManifestDefinitions

Included in:
Client
Defined in:
lib/destiny_rb/manifest_definitions.rb

Overview

Destiny Manifest definitions Pulled from sqlite file in the EN manifest www.bungie.net/Platform/Destiny/Manifest/

Instance Method Summary collapse

Instance Method Details

#character_class(type) ⇒ Object

Character Class definitions

Usage:

client.character_class(:titan)
client.character_class(0)

Arguments:

type: (String/Symbol)

Returns:

Either the numeric representation of a character class or a symbol of said class.


39
40
41
42
43
44
45
46
47
# File 'lib/destiny_rb/manifest_definitions.rb', line 39

def character_class(type)
  classes = {
    titan: 0,
    hunter: 1,
    warlock: 2,
    unknown: 3
    }
  type_checker(type, classes)
end

#enemy_race(type) ⇒ Object

Enemy Race definitions

Usage:

client.enemy_race(:vex)
client.enemy_race(711470098)

Arguments:

type: (String/Symbol)

Returns:

Either the numeric representation of a enemy race or a symbol of said race.


60
61
62
63
64
65
66
67
68
69
# File 'lib/destiny_rb/manifest_definitions.rb', line 60

def enemy_race(type)
  races = {
    none: 0, # Not a real Bungie value
    fallen: 1636291695,
    vex: 711470098,
    cabal: 546070638,
    hive: 3265589059
  }
  type_checker(type, races)
end

#skulls(type) ⇒ Object

Skull (modifier) definitions

Usage:

client.skulls(:juggler)
client.skulls(13)

Arguments:

type: (String/Symbol)

Returns:

Either the numeric representation of a skull or a symbol of said skull.


82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/destiny_rb/manifest_definitions.rb', line 82

def skulls(type)
  skulls = {
    none: 0, # Not a real Bungie value
    trickle: 1,
    grounded: 2,
    exposure: 3,
    airborne: 4,
    small_arms: 5,
    brawler: 6,
    catapult: 7,
    specialist: 8,
    arc_burn: 9,
    solar_burn: 10,
    void_burn: 11,
    angry: 12,
    juggler: 13,
    lightswitch: 19,
    melee_damage_boost: 20
  }
  type_checker(type, skulls)
end

#type_checker(type, hash) ⇒ Object

Type Checker Helper Method

Usage:

type_checker(type, hash)

Arguments:

type: (String/Symbol)
hash: (Ruby Hash)

Returns:

Either a numberic value or symbol extracted from a source hash depending on what type was supplied.


19
20
21
22
23
24
25
# File 'lib/destiny_rb/manifest_definitions.rb', line 19

def type_checker(type, hash)
  if type.is_a? Numeric
      requested_type = hash.key(type) || :none# Fetch type from hash, if type doesn't match return 'none'
  else type.is_a? Symbol
      requested_type = hash.fetch(type, 0) # Fetch type from hash, if type doesn't match return 0 for 'none'
  end
end