Esempio n. 1
0
        public static EquipEntity createEntity(Rank rank, ItemID id)
        {
            if (!base_resources.ContainsKey(rank) || !base_resources[rank].ContainsKey(id))
            {
                throw new KeyNotFoundException();
            }

            EquipEntity entity = base_resources[rank][id].clone();

            entity.id     = entity_id;
            entity.atk_op = Random.Range(base_random[rank].Item1, base_random[rank].Item2);
            entity.def_op = Random.Range(base_random[rank].Item1, base_random[rank].Item2);
            entity.spd_op = Random.Range(base_random[rank].Item1, base_random[rank].Item2);

/*
 *          Debug.Log("Equip spawn; " +
 *              entity.name + " / " +
 *              entity.rank.ToString() + " / " +
 *              (entity.atk + entity.atk_op).ToString() + " / " +
 *              (entity.def + entity.def_op).ToString() + " / " +
 *              (entity.spd + entity.spd_op).ToString()
 *          );
 */

            entity_id += 1;
            return(entity);
        }
Esempio n. 2
0
        public static int get_detect_interval(Rank rank)
        {
            if (!player_detect_interval.ContainsKey(rank))
            {
                throw new System.Exception("player_detect_interval is not contains key: " + rank);
            }

            return(player_detect_interval[rank]);
        }
Esempio n. 3
0
        public static Entity get(Rank rank)
        {
            if (!base_resources.ContainsKey(rank))
            {
                throw new KeyNotFoundException();
            }

            return(base_resources[rank]);
        }
Esempio n. 4
0
        public static string getPlayerAttack(Rank rank, Type type)
        {
            var key = type.ToString() + rank.ToString();

            if (!player_attack_se.ContainsKey(key))
            {
                throw new Exception();
            }

            return(player_attack_se[key]);
        }
Esempio n. 5
0
        public static EnemyEntity createEntity(Rank rank, EnemyType id)
        {
            if (!base_resources.ContainsKey(rank) || !base_resources[rank].ContainsKey(id))
            {
                throw new KeyNotFoundException();
            }

            var enemy_strength = GameStageService.status("enemy_strength");
            var entity         = base_resources[rank][id].clone();

            entity.id  = entity_id;
            entity_id += 1;

            var strength = Mathf.RoundToInt(enemy_strength * strength_scale);
            //var exp = Mathf.RoundToInt(GameStageService.status("clear_count") * exp_scale);
            var exp = Mathf.RoundToInt(enemy_strength * exp_scale);

            if (exp < 1)
            {
                exp = 1;
            }

            //Debug.Log("EnemyFactory : enemy_strength * exp_scale : " + (enemy_strength * exp_scale).ToString());
            //Debug.Log("EnemyFactory : exp : " + exp.ToString());

            entity.lv  = GameStageService.status("clear_count") + 1;
            entity.exp = exp;

            var hp = entity.hp + Mathf.RoundToInt(entity.lv * hp_scale);

            entity.hp     = hp;
            entity.hp_max = hp;

            entity.atk = Random.Range(base_random[rank].Item1, base_random[rank].Item2) + strength;
            entity.def = Random.Range(base_random[rank].Item1, base_random[rank].Item2) + strength;
            entity.spd = Random.Range(base_random[rank].Item1, base_random[rank].Item2) + strength;
            //Debug.Log("atk: " + entity.atk);
            //Debug.Log("def: " + entity.def);
            //Debug.Log("spd: " + entity.spd);

/*
 *          Debug.Log("Enemy spawn; " +
 *              entity.lv.ToString() + " / " +
 *              entity.exp.ToString() + " / " +
 *              entity.hp_max.ToString() + " / " +
 *              entity.atk.ToString() + " / " +
 *              entity.def.ToString() + " / " +
 *              entity.spd.ToString()
 *          );
 */

            return(entity);
        }
Esempio n. 6
0
        public static FieldObjectEntity createEntity(Rank rank, FieldObjectID id)
        {
            if (!base_resources.ContainsKey(rank) || !base_resources[rank].ContainsKey(id))
            {
                throw new KeyNotFoundException();
            }

            var entity = base_resources[rank][id].clone();

            entity.id = entity_id;

            entity_id += 1;
            return(entity);
        }
Esempio n. 7
0
        public static string getEnemyAttack(Rank rank)
        {
            switch (rank)
            {
            case Rank.D: return("Hit_Hurt1");

            case Rank.C: return("Hit_Hurt2");

            case Rank.B: return("Hit_Hurt3");

            case Rank.A: return("Hit_Hurt4");

            case Rank.S: return("Hit_Hurt5");

            default: return("Hit_Hurt1");
            }
        }
Esempio n. 8
0
        public static void rankLog(Rank rank)
        {
            switch (rank)
            {
            case Rank.None: Debug.Log("Rank.None"); break;

            case Rank.D: Debug.Log("Rank.D"); break;

            case Rank.C: Debug.Log("Rank.C"); break;

            case Rank.B: Debug.Log("Rank.B"); break;

            case Rank.A: Debug.Log("Rank.A"); break;

            case Rank.S: Debug.Log("Rank.S"); break;

            default: Debug.Log("None"); break;
            }
        }