public static List<Save> parseLevelFile() { saves = new List<Save> (); JSONNode root = getJsonFile ("Saves/saves.JSON"); slots = root ["slots"].AsArray; int size = slots.Count; for (int i=0; i<size; i++) { string name = slots[i]["name"]; int score = slots[i]["score"].AsInt; string currentLevel = slots[i]["currentLevel"]; int xp = slots[i]["xp"].AsInt; string className = slots[i]["class"]; // HERO Hero hero; if (className == "Warrior") hero = new Warrior(); else if (className == "Monk") hero = new Monk(); else if (className == "Wizard") hero = new Wizard(); else hero = new Warrior(); hero.Name = name; hero.XpQuantity = xp; // LEVEL int levelId = GameModel.getLevelIdByName(currentLevel); saves.Add(new Save(hero, levelId, score)); } return saves; }
public Player CreateCharacter(string Class, UserInteraction ui) { Class = Class.ToLower(); Player newChar; switch(Class) { case "barbarian": newChar = new Barbarian(new int[] { 15, 15, 15, 10, 9, 10 }); newChar.SetArmor(Armors.chainShirt); newChar.SetMainHand(new MasterworkWeapon(Weapons.battleaxe)); newChar.SetName("Bob"); break; case "bard": newChar = new Bard(new int[] { 15, 10, 15, 10, 9, 15 }); newChar.SetArmor(Armors.leatherArmor); newChar.SetMainHand(new MasterworkWeapon(Weapons.rapier)); newChar.SetName("Bill"); break; case "cleric": newChar = new Cleric(new int[] { 15, 10, 15, 15, 9, 10 }); newChar.SetArmor(Armors.breastplate); newChar.SetMainHand(new MasterworkWeapon(Weapons.heavyMace)); newChar.SetOffHand(Armors.heavyWoodenShield); newChar.SetName("Chad"); break; case "druid": newChar = new Druid(new int[] { 15, 10, 15, 15, 9, 10 }); newChar.SetArmor(Armors.hideArmor); newChar.SetMainHand(new MasterworkWeapon(Weapons.club)); newChar.SetOffHand(Armors.heavyWoodenShield); newChar.SetName("Dave"); break; case "fighter": newChar = new Fighter(new int[] { 15, 15, 15, 10, 9, 10 }); newChar.SetArmor(Armors.breastplate); newChar.SetMainHand(new MasterworkWeapon(Weapons.longsword)); newChar.SetOffHand(Armors.heavyWoodenShield); newChar.SetName("Frank"); break; case "monk": newChar = new Monk(new int[] { 15, 10, 15, 10, 15, 9 }); newChar.SetMainHand(new MasterworkWeapon(Weapons.quarterstaff)); newChar.SetName("Molly"); break; case "paladin": newChar = new Paladin(new int[] { 15, 10, 15, 9, 15, 10 }); newChar.SetArmor(Armors.breastplate); newChar.SetMainHand(new MasterworkWeapon(Weapons.longsword)); newChar.SetOffHand(Armors.heavyWoodenShield); newChar.SetName("Phil"); break; case "ranger": newChar = new Ranger(new int[] { 15, 10, 15, 9, 15, 10 }); newChar.SetArmor(Armors.leatherArmor); newChar.SetMainHand(new MasterworkWeapon(Weapons.longbow)); newChar.SetName("Randy"); break; case "rogue": newChar = new Rogue(new int[] { 15, 10, 15, 15, 9, 10 }); newChar.SetArmor(Armors.leatherArmor); newChar.SetMainHand(new MasterworkWeapon(Weapons.rapier)); newChar.SetName("Rudy"); break; case "sorcerer": newChar = new Sorcerer(new int[] { 10, 15, 15, 10, 9, 15 }); newChar.SetMainHand(new MasterworkWeapon(Weapons.lightCrossbow)); newChar.SetName("Steve"); break; case "wizard": newChar = new Wizard(new int[] { 10, 15, 15, 15, 9, 10 }); newChar.SetMainHand(new MasterworkWeapon(Weapons.lightCrossbow)); newChar.SetName("Willis"); break; default: newChar = new Barbarian(new int[] { 10, 10, 10, 10, 10, 10 }); newChar.SetArmor(Armors.chainShirt); newChar.SetMainHand(new MasterworkWeapon(Weapons.battleaxe)); newChar.SetName("Default"); break; } newChar.SetUI(ui); newChar.AddItems(new Item[] { Consumables.minorHealthPotion, Consumables.minorHealthPotion, Consumables.minorManaPotion, Consumables.minorManaPotion, Consumables.minorHarmingPotion, Consumables.minorHarmingPotion }); return newChar; }
public void MonkGetsSixHitPointsPerLevel() { var monk = new Monk(); monk.GainExperience(1000); Assert.AreEqual(11, monk.HitPoints); }
// Use this for initialization void Start () { monk = GetComponent<Monk>(); }
public void CreatePlayerClass(string playerClass) { switch (playerClass) { case "Barbarian": PlayerClass = new Barbarian(); break; case "Bard": PlayerClass = new Bard(); break; case "Cleric": PlayerClass = new Cleric(); break; case "Druid": PlayerClass = new Druid(); break; case "Fighter": PlayerClass = new Fighter(); break; case "Monk": PlayerClass = new Monk(); break; case "Paladin": PlayerClass = new Paladin(); break; case "Ranger": PlayerClass = new Ranger(); break; case "Rogue": PlayerClass = new Rogue(); break; case "Sorcerer": PlayerClass = new Sorcerer(); break; case "Wizard": PlayerClass = new Wizard(); break; } }
// Use this for initialization void Awake() { monk = GetComponent<Monk>(); }
private static TimeSpan Mobile_HitsRegenRate(Mobile from) { int points = AosAttributes.GetValue(from, AosAttribute.RegenHits); if (from is BaseCreature) { BaseCreature bc = from as BaseCreature; if (bc.ControlMaster != null && bc.ControlMaster is Player) { Player master = bc.ControlMaster as Player; Beastmaster bmr = Perk.GetByType <Beastmaster>((Player)master); if (bmr != null) { points += bmr.PackRegenBonus(); } } } if (from is Player) { if (((Player)from).Race == Race.HalfDaemon && ((Player)from).AbilityActive == true) { points += 16; } if (from.Hunger != 0 && from.Thirst != 0) { int hungerRegen = (int)((from.Hunger + from.Thirst) * 0.085); if (hungerRegen != 0) { points += hungerRegen; } } Beastmaster bmr = Perk.GetByType <Beastmaster>((Player)from); if (bmr != null) { points += bmr.BMasterRegenBonus(); } Monk mk = Perk.GetByType <Monk>((Player)from); if (mk != null) { points += mk.MeditationMastery(); } } if (!(from is Player)) { points += (int)(from.Str * 0.03); } if (points < 0) { points = 0; } return(TimeSpan.FromSeconds(1.0 / (0.1 * (1 + points)))); }
private static TimeSpan Mobile_StamRegenRate(Mobile from) { if (from.Skills == null) { return(Mobile.DefaultStamRate); } CheckBonusSkill(from, from.Stam, from.StamMax, SkillName.Focus); int points = (int)(from.Skills[SkillName.Focus].Value * 0.08); int cappedPoints = AosAttributes.GetValue(from, AosAttribute.RegenStam); points += cappedPoints; if (from.Player) { if (from.Stam < from.StamMax * 0.15) { points += 8; } if (from.Stam < from.StamMax * 0.25) { points += 8; } bool running = ((Player)from).isRunning && from.Mounted == false; if (((Player)from).lastMove < DateTime.Now) { running = false; } if (running) { points -= 32; } Beastmaster bmr = Perk.GetByType <Beastmaster>((Player)from); if (bmr != null) { points += bmr.BMasterRegenBonus(); } Acrobat acr = Perk.GetByType <Acrobat>((Player)from); if (acr != null) { points += acr.GetStamRegenBonus(); } Adventurer adv = Perk.GetByType <Adventurer>((Player)from); if (adv != null) { points += adv.GetStamRegenBonus(); } Scout sct = Perk.GetByType <Scout>((Player)from); if (sct != null) { points += sct.StamRegenBonus(); } Dragoon drg = Perk.GetByType <Dragoon>((Player)from); if (drg != null) { points += drg.Symbiosis(); } Monk mk = Perk.GetByType <Monk>((Player)from); if (mk != null) { points += mk.MeditationMastery(); } int hungerRegen = (int)((from.Hunger + from.Thirst) * 0.10); if (hungerRegen != 0) { points += hungerRegen; } if (from.Hits != 0 && from.HitsMax != 0) { double hitsratio = (int)((from.HitsMax / from.Hits) / 3); if (hitsratio >= 1.0) { points = (int)(points * hitsratio); } } } if (!(from is Player)) { points += (int)(from.Dex * 0.04); } if (from is BaseCreature) { BaseCreature bc = from as BaseCreature; if (bc.ControlMaster != null && bc.ControlMaster is Player) { Player master = bc.ControlMaster as Player; Beastmaster bmr = Perk.GetByType <Beastmaster>((Player)master); if (bmr != null) { points += bmr.PackRegenBonus(); } } } if (from is BaseMount) { BaseMount mount = from as BaseMount; if (mount.Rider != null && mount.Rider is Player) { Player rider = mount.Rider as Player; Dragoon drg = Perk.GetByType <Dragoon>((Player)rider); if (drg != null) { points += drg.Symbiosis(); } } } if (points < -1) { points = -1; } return(TimeSpan.FromSeconds(1.0 / (0.1 * (2 + points)))); }
public void Init() { Monk = new Monk(); }
void Awake() { switch (PlayerStatus.playerData.characterNumber) { case 0: // 青年を出す処理を書く break; case 1: // ムキムキを出す player = PhotonNetwork.Instantiate("Player/mukimuki", new Vector3(PlayerStatus.playerData.x, PlayerStatus.playerData.y, PlayerStatus.playerData.z), Quaternion.identity, 0); break; case 2: // 少女を出す break; case 3: // BBAを出す break; } // 職業によって処理分け switch (PlayerStatus.playerData.job) { // アーチャー case 0: // アーチャーを入れる Archer archer = player.AddComponent <Archer>(); // PhotonViewの通信を使うリストにアーチャーを登録する player.GetComponent <PhotonView>().ObservedComponents.Add(archer); // アニメーションを変更する player.GetComponent <Animator>().runtimeAnimatorController = archerAnimationController; break; case 1: // ウォーリアを入れる Warrior warrior = player.AddComponent <Warrior>(); // PhotonViewの通信を使うリストにアーチャーを登録する player.GetComponent <PhotonView>().ObservedComponents.Add(warrior); warrior.Initialize(); Debug.Log(warrior.GetPlayerData().name); // アニメーションを変更する player.GetComponent <Animator>().runtimeAnimatorController = warriorAnimationController; break; case 2: // ソーサラーを入れる Sorcerer sorcerer = player.AddComponent <Sorcerer>(); // PhotonViewの通信を使うリストにアーチャーを登録する player.GetComponent <PhotonView>().ObservedComponents.Add(sorcerer); // アニメーションを変更する player.GetComponent <Animator>().runtimeAnimatorController = sorcererAnimationController; break; case 3: // アーチャーを入れる Monk monk = player.AddComponent <Monk>(); // PhotonViewの通信を使うリストにアーチャーを登録する player.GetComponent <PhotonView>().ObservedComponents.Add(monk); // アニメーションを変更する player.GetComponent <Animator>().runtimeAnimatorController = monkAnimationController; break; } }