제가 주인공의 능력치를 추가해 그걸로 문자열을 띄우려고합니다
그래서 데이터베이스 변수인
$data_actors
RPG::Actor 의 배열을
아래에 처럼 넣었습니다
@myhp = 500
라는 글로벌 변수
def initialize
안에넣고
아래에
case @myhp
when 500
print "풀피"
end
를 추가했는데 게임시작하면 풀피라는문자열이나오지않습니다..
module RPG
class Actor
def initialize
@id = 1
@name = "쭈꾸미"
@class_id = 1
@initial_level = 1
@final_level = 99
@exp_basis = 30
@exp_inflation = 30
@character_name = ""
@character_hue = 0
@battler_name = ""
@battler_hue = 0
@parameters = Table.new(6,100)
@myhp = 500
for i in 1..99
@parameters[0, i] = 500+i*50
@parameters[1, i] = 500+i*50
@parameters[2, i] = 50+i*5
@parameters[3, i] = 50+i*5
@parameters[4, i] = 50+i*5
@parameters[5, i] = 50+i*5
end
@weapon_id = 0
@armor1_id = 0
@armor2_id = 0
@armor3_id = 0
@armor4_id = 0
@weapon_fix = false
@armor1_fix = false
@armor2_fix = false
@armor3_fix = false
@armor4_fix = false
end
attr_accessor :id
attr_accessor :name
attr_accessor :class_id
attr_accessor :initial_level
attr_accessor :final_level
attr_accessor :exp_basis
attr_accessor :exp_inflation
attr_accessor :character_name
attr_accessor :character_hue
attr_accessor :battler_name
attr_accessor :battler_hue
attr_accessor :parameters
attr_accessor :weapon_id
attr_accessor :armor1_id
attr_accessor :armor2_id
attr_accessor :armor3_id
attr_accessor :armor4_id
attr_accessor :weapon_fix
attr_accessor :armor1_fix
attr_accessor :armor2_fix
attr_accessor :armor3_fix
attr_accessor :armor4_fix
end
end
case @myhp
when 500
print "풀피"
end