lib/goby/entity/entity.rb
# Prints the status in a nice format.
# TODO: encapsulate print_stats and print_equipment in own functions.
Prints the status in a nice format.
TODO: encapsulate print_stats and print_equipment in own functions.
Prints the status in a nice format . TODO : encapsulate print_stats and print_equipment in own functions .
def print_status
      puts "Stats:"
      puts "* HP: #{@stats[:hp]}/#{@stats[:max_hp]}"
      puts "* Attack: #{@stats[:attack]}"
      puts "* Defense: #{@stats[:defense]}"
      puts "* Agility: #{@stats[:agility]}"
      print "\n"
      puts "Equipment:"
      print "* Weapon: "
      puts @outfit[:weapon] ? "#{@outfit[:weapon].name}" : "none"
      print "* Shield: "
      puts @outfit[:shield] ? "#{@outfit[:shield].name}" : "none"
      print "* Helmet: "
      puts @outfit[:helmet] ? "#{@outfit[:helmet].name}" : "none"
      print "* Torso: "
      puts @outfit[:torso] ? "#{@outfit[:torso].name}" : "none"
      print "* Legs: "
      puts @outfit[:legs] ? "#{@outfit[:legs].name}" : "none"
      print "\n"
    end
def print_status puts "Stats:" puts "* HP: #{@stats[:hp]}/#{@stats[:max_hp]}" puts "* Attack: #{@stats[:attack]}" puts "* Defense: #{@stats[:defense]}" puts "* Agility: #{@stats[:agility]}" print "\n" puts "Equipment:" print "* Weapon: " puts @outfit [ :weapon ] ? "#{@outfit[:weapon].name}" : "none" print "* Shield: " puts @outfit [ :shield ] ? "#{@outfit[:shield].name}" : "none" print "* Helmet: " puts @outfit [ :helmet ] ? "#{@outfit[:helmet].name}" : "none" print "* Torso: " puts @outfit [ :torso ] ? "#{@outfit[:torso].name}" : "none" print "* Legs: " puts @outfit [ :legs ] ? "#{@outfit[:legs].name}" : "none" print "\n" end
Prints the status in a nice format.
Prints the status in a nice format .