Module: Core::Game

Defined in:
lib/game/magic.rb,
lib/game/item.rb,
lib/game/mind.rb,
lib/game/party.rb,
lib/game/spell.rb,
lib/game/skills.rb,
lib/game/map/fog.rb,
lib/game/map/map.rb,
lib/game/npc/npc.rb,
lib/game/map/tile.rb,
lib/game/npc/goal.rb,
lib/game/character.rb,
lib/game/equipment.rb,
lib/game/inventory.rb,
lib/game/osd/magic.rb,
lib/game/map/events.rb,
lib/game/map/player.rb,
lib/game/npc/bubble.rb,
lib/game/constitution.rb,
lib/game/combat/battle.rb,
lib/game/alchemy/recipe.rb,
lib/game/map/map_loader.rb,
lib/game/map/map_object.rb,
lib/game/map/map_particle.rb,
lib/game/map/map_animation.rb

Overview

FIXME policy = :recalc doesnt work

Defined Under Namespace

Modules: Alchemy, Combat, Events, NPC, OSD, Spells Classes: Bubble, Character, CompositeGoal, Constitution, Equipment, Fog, Goal, Inventory, Item, Magic, Map, MapAnimation, MapLoader, MapNPC, MapObject, MapParticle, Mind, MotionGoal, Party, Player, Skill, Skills, Spell, Thought, Tile, Wound

Constant Summary collapse

NORMAL =

Character states

0
ASLEEP =
1
DEAD =
2
UNCONSCIOUS =
3
WOUND_LOCATIONS =
[:head, :neck, :torso, :abdomen, :leg, :foot, :arm]

Class Method Summary collapse

Class Method Details

.charactersObject



10
11
12
# File 'lib/game/character.rb', line 10

def self.characters
  return @characters
end

.characters=(ary) ⇒ Object



13
14
15
# File 'lib/game/character.rb', line 13

def self.characters=(ary)
  @characters = ary
end

.enemiesObject



4
5
6
# File 'lib/game/combat/battle.rb', line 4

def self.enemies
  return @enemies
end

.enemies=(ary) ⇒ Object



8
9
10
# File 'lib/game/combat/battle.rb', line 8

def self.enemies=(ary)
  @enemies = ary
end

.find_enemy(name) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/game/combat/battle.rb', line 12

def self.find_enemy(name)
  @enemies.each { |enemy|
    if enemy.name == name
      return enemy
    end
  }
  return nil
end

.find_item(name) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/game/item.rb', line 17

def self.find_item(name)
  @items.each { |item|
    if item.name == name
      return item
    end
  }
end

.find_skill(name) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/game/skills.rb', line 13

def self.find_skill(name)
  @skills.each { |skill|
    if skill.name == name
      return skill
    end
  }
end

.find_spell(name) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/game/spell.rb', line 14

def self.find_spell(name)
  @spells.each { |spell|
    if spell.name == name
      return spell
    end
  }
  return nil
end

.find_weapon(name) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/game/combat/battle.rb', line 29

def self.find_weapon(name)
  @weapons.each { |w|
    if w.name == name
      return w
    end
  }
end

.itemsObject



9
10
11
# File 'lib/game/item.rb', line 9

def self.items
  return @items
end

.items=(ary) ⇒ Object



13
14
15
# File 'lib/game/item.rb', line 13

def self.items=(ary)
  @items = ary
end

.itemtype_to_locations(type, equip) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/game/item.rb', line 25

def self.itemtype_to_locations(type, equip)
  ary = []
  case type
  when :armor
    ary = [:torso]
  when :cloth
    ary = [:torso]
  when :melee
    ary = []
    if equip.at(:rarm) != nil and equip.at(:rarm).type != :ranged
      ary = [:larm, :rarm]
    elsif equip.at(:rarm) == nil
      ary = [:larm, :rarm]
    end
  when :pants
    ary = [:legs]
  when :boots
    ary = [:feet]
  when :ranged
    ary = [:back]
    if equip.at(:larm) == nil
      ary.push(:rarm)
    end
  when :ammo
    ary = [:back]
  end
  return ary
end

.skillsObject



5
6
7
# File 'lib/game/skills.rb', line 5

def self.skills
  return @skills
end

.skills=(ary) ⇒ Object



9
10
11
# File 'lib/game/skills.rb', line 9

def self.skills=(ary)
  @skills = ary
end

.spellsObject



6
7
8
# File 'lib/game/spell.rb', line 6

def self.spells
  return @spells
end

.spells=(ary) ⇒ Object



10
11
12
# File 'lib/game/spell.rb', line 10

def self.spells=(ary)
  @spells = ary
end

.weaponsObject



21
22
23
# File 'lib/game/combat/battle.rb', line 21

def self.weapons
  return @weapons
end

.weapons=(hash) ⇒ Object



25
26
27
# File 'lib/game/combat/battle.rb', line 25

def self.weapons=(hash)
  @weapons = hash
end