//プレイヤーキャラクター設定 class Player { //HP,MP設定 int hp; //HP int max_Hp; //MAXHP int mp; //MP int max_Mp; //MP int a; //攻撃力 int b; //防御力 int[] exp; //経験値 int level = 1; //レベル boolean[] skill; //覚えている魔法(true ならその魔法を習得) int type; //type int a_up; int b_up; int Hp_up; int Mp_up; Player(int select) { if (select == 0) { //攻撃タイプ type = 4; hp = 80; mp = 20; max_Hp = hp; max_Mp = mp; a = 30; b = 15; Hp_up = 20; Mp_up= 5; a_up = 4; b_up = 3; } else if (select == 1) { //防御タイプ type = 3; hp = 60; mp = 60; max_Hp = hp; max_Mp = mp; a=15; b=25; Hp_up = 10; Mp_up= 20; a_up = 3; b_up = 4; } else if (select == 2 ) { //魔法タイプ type =1; hp = 40; mp = 100; max_Hp = hp; max_Mp = mp; a = 10; b = 15; Hp_up = 10; Mp_up= 30; a_up = 2; b_up = 2; } else { //体力タイプ type =2; hp = 100; mp = 40; max_Hp = hp; max_Mp = mp; a= 20; b= 20; Hp_up = 50; Mp_up= 20; a_up = 3; b_up = 4; } exp = new int[50]; for (int k=0; k<50; k++) exp[k] = 0; skill = new boolean[10]; skill[0] = true; for ( int i = level ; i < 10; i++) skill[i] = false; } //死亡判定 //HPが0以下になった場合、trueを返す。 boolean isDead() { if (hp <= 0) return true; else return false; } } //level_upの関数、経験値を引数ともらう boolean level_up(int e) { if (player.level != 50) { player.exp[player.level] += e; if (player.exp[player.level] > player.level * 10) player.level+=1; if(player.level <= 10) if (player.level%player.type==0) player.skill[player.level-1]=true; return true; } return false; } void stats_up() { player.a += player.a_up; player.b += player.b_up; player.max_Hp += player.Hp_up; player.max_Mp += player.Mp_up; } class Magic { String name; int a; //攻撃 int mp; //消費MP int type; //1:攻撃系 2:HP回復 3:MP回復 4:攻撃力強化 5:防御力強化 Magic(String n, int at, int m, int t) { name = n; a = at; mp = m; type = t; } } void skill_ac() { if (player.skill[0]) magic[0] = new Magic("ヒール", 100, 20, 2); if (player.skill[1]) magic[1] = new Magic("ファイア", 50, 20, 1); if (player.skill[2]) magic[2] = new Magic("MPリゲイン", 50, 0, 3); if (player.skill[3]) magic[3] = new Magic("かちんこちん", 0, 50, 5); if (player.skill[4]) magic[4] = new Magic("むきむきーる", 0, 50, 4); if (player.skill[5]) magic[5] = new Magic("ファイラ", 120, 60, 1); if (player.skill[6]) magic[6] = new Magic("超回復", 300, 100, 2); if (player.skill[7]) magic[7] = new Magic("ダークフレア", 200, 150, 1); if (player.skill[8]) magic[8] = new Magic("ラースオブゴット", 250, 200, 1); if (player.skill[9]) magic[9] = new Magic("天衣無縫", 500, 400, 1); }