private void creatEnemy() { int enemyId = EnemyHelper.getRandomEnemyFromLevel(level); int blankRand = Random.Range(0, 2); float xBlank = (blankRand == 0) ? 50 : 0; float zBlank = (blankRand == 1) ? 50 : 0; float xPos = Random.Range(0, 50); int xRand = (Random.Range(0, 2) == 0) ? 1:-1; xPos = (xPos + xBlank) * xRand; xPos += transform.position.x; float zPos = Random.Range(0, 50); int zRand = (Random.Range(0, 2) == 0) ? 1 : -1; zPos = (zPos + zBlank) * zRand; zPos += transform.position.z; float yPos = Terrain.activeTerrain.terrainData.GetInterpolatedHeight( xPos / Terrain.activeTerrain.terrainData.size.x, zPos / Terrain.activeTerrain.terrainData.size.z ); var enemy = EnemyMasterManager.getInstance().getEnemyFromId(enemyId); enemy.getContainer().transform.position = new Vector3(xPos, yPos, zPos); }
public void loadProgresses(int id) { EnemyMasterManager.getInstance().addProgress(id); AttackSkillMasterManager.getInstance().addProgress(id); HealSkillMasterManager.getInstance().addProgress(id); BufSkillMasterManager.getInstance().addProgress(id); DebufSkillMasterManager.getInstance().addProgress(id); HealItemMasterManager.getInstance().addProgress(id); ItemMaterialMasterManager.getInstance().addProgress(id); }
// Update is called once per frame void Update() { if (player != null) { if (Input.GetKey(KeyCode.O)) { Debug.Log("adding"); player.getFlagList().addEnemyKilled(EnemyMasterManager.getInstance().getEnemyFromId(1)); } } }
public ExterminationMissonBuilder(int baseLevel) { this.LEVEL = 1; var ids = EnemyMasterManager.getInstance().getEnemyIdsFromLevel(LEVEL); int idRand = UnityEngine.Random.Range(0, ids.Count); this.TARGET_ID = idRand; EXTERMINATION_NUMBER = LEVEL + UnityEngine.Random.Range(10, 15); this.NAME = "修行"; this.DESCRIPTION = EnemyMasterManager.getInstance().getEnemyNameFromId(TARGET_ID) + "を" + EXTERMINATION_NUMBER + "体倒す"; this.FLAVOR_TEXT = "あなたは強さを求めている。"; this.FLAVOR_TEXT += "そのために、" + EnemyMasterManager.getInstance().getEnemyNameFromId(TARGET_ID) + "を倒すのが最適だと考えた。"; }
public ExterminationQuest(FlagList flags, Client client) { this.LEVEL = client.Level; this.client = client; this.flags = flags; this.TARGET_ID = EnemyHelper.getRandomEnemyFromLevel(LEVEL); this.INTERNAL_NUMBER = flags.getEnemyKilled(TARGET_ID); var compensationTypes = Enum.GetValues(typeof(CompentionType)); int compensationTypeRand = UnityEngine.Random.Range(0, compensationTypes.Length - 1); this.compentionType = (CompentionType)compensationTypes.GetValue(compensationTypeRand); EXTERMINATION_NUMBER = LEVEL + UnityEngine.Random.Range(2, 6); var targetName = EnemyMasterManager.getInstance().getEnemyBuilderFromId(TARGET_ID).getName(); NAME = "駆除依頼"; DESCRIPTION = targetName + "を" + EXTERMINATION_NUMBER + "匹倒す"; FLAVOR_TEXT = "最近問題になっている" + targetName + "を駆除しよう"; }
private void setBattle() { en = EnemyMasterManager.getInstance().getEnemyFromId(0); var list = new List <Identity>() { IdentityMasterManager.getInstance().getIdentityFromId(0) }; //hero = new Player(JobMasterManager.getJobFromId(0),HumanityMasterManager.getHumanityFromId(0), list,con); //hero.addSkill(ReactionSkillMasterManager.getReactionSkillFromId(0)); //hero.addSkill(ReactionSkillMasterManager.getReactionSkillFromId(1)); // hero.addSkill(AttackSkillMasterManager.getInstance().getAttackSkillFromId(0)); // hero.addSkill(AttackSkillMasterManager.getInstance().getAttackSkillFromId(1)); //hero.addSkill(MoveSkillMasterManager.getMoveSkillFromId(0)); //hero.addSkill(BufSkillMasterManager.getBufSkillFromId(0)); //hero.addSkill(DebufSkillMasterManager.getDebufSkillFromId(0)); //hero.addSkill(HealSkillMasterManager.getHealSkillFromId(0)); //hero.addSkill(DebufSkillMasterManager.getDebufSkillFromId(2)); //hero.addSkill(AttackSkillMasterManager.getInstance().getAttackSkillFromId(7)); con.setCharacter(hero); }
public void report(int worldId) { observeEnemyBuilder = EnemyMasterManager.getInstance().getEnemyBuilderFromId(OBSERVE_ENEMY_ID); var abilities = new Dictionary <BattleAbility, int>(); var keys = Enum.GetValues(typeof(BattleAbility)); foreach (BattleAbility ability in keys) { if (ability == MFT || ability == FFT || ability == MGP) { if (judgeAttackAbilityProgressed()) { abilities.Add(ability, progressAttackAbility()); } else { abilities.Add(ability, 0); } } else { if (judgeExserciseAbilityProgressed()) { abilities.Add(ability, progressExserciseAbility()); } else { abilities.Add(ability, 0); } } } var attributeTable = new Dictionary <AttackSkillAttribute, float>(); var attributeKeys = Enum.GetValues(typeof(AttackSkillAttribute)); foreach (AttackSkillAttribute attribute in attributeKeys) { if (judgeResistanceProsessed(attribute)) { attributeTable.Add(attribute, progressResistance(attribute)); } else { attributeTable.Add(attribute, 0); } } int weponLevel; if (judgeWeponLevelUped()) { weponLevel = weponLevelUp(); } else { weponLevel = 0; } var progress = EnemyMasterManager.getInstance().getProgressFromId(OBSERVE_ENEMY_ID); var abilityKeys = abilities.Keys; foreach (var key in abilityKeys) { progress.Abilities[key] += abilities[key]; } foreach (AttackSkillAttribute key in attributeKeys) { progress.AttributeResistances[key] += attributeTable[key]; } progress.WeponLevel += weponLevel; ObserverHelper.saveToFile <EnemyProgress>(progress, "EnemyProgress", OBSERVE_ENEMY_ID, worldId); }
/// <summary> /// 与えられたレベルに準じたエネミーのIDを返します /// </summary> /// <returns>適正レベル</returns> /// <param name="enemyLevel">エネミーのID</param> public static int getRandomEnemyFromLevel(int enemyLevel) { var levelEnemies = EnemyMasterManager.getInstance().getEnemyIdsFromLevel(enemyLevel); return(MathHelper.getRandomKeyLowerOrderProbality(levelEnemies)); }