public Character(string name, BeginClasses className, Weapon weapon) : base(name, weapon) { Potions = 2; NeededExperiences = 14; ClassName = (Classes)className; LevelingManager = new LevelingManager(this); InitStats initStats = Json.GetInitStats(className.ToString()); Inventory = new Inventory(16); initStats.Init(); EntityStats = initStats; switch (className) { case BeginClasses.Mage: case BeginClasses.Priest: case BeginClasses.Thief: HasSpells = true; Spells.Add(new Spell("Fireball", 3, 6, "attack")); break; default: HasSpells = false; break; } }
public Character( string name, EntityStats entityStats, Weapon weapon, List <Spell> spells, Shield shield, Armor head, Armor torso, Armor arms, Armor legs, Armor feet, int neededExperiences, byte className, bool hasSpells, Inventory inventory ) : base(name, entityStats, weapon, spells, shield, head, torso, arms, legs, feet) { NeededExperiences = neededExperiences; ClassName = (Classes)className; HasSpells = hasSpells; Inventory = inventory ?? new Inventory(16); LevelingManager = new LevelingManager(this); }
public void AddExperiences(int experiences) { EntityStats.Experiences += experiences; if (EntityStats.Experiences >= NeededExperiences) { EntityStats.Experiences -= NeededExperiences; NeededExperiences *= 2; Utils.Endl(2); Utils.Cconsole.Green.WriteLine("{0} has level up", Name); LevelingManager.LevelUp(); Utils.Endl(); GetAllStats(); } }
public void Update() { int courseIndex = m_gameScript.getCourseIndex(); string userName = playerName; int totalScore = m_gameScript.getTotalScore(); int totalPar = m_gameScript.getTotalPar(); #if PHOTON_MULTIPLAYER //if we are online, and we have an opponent lets show the results if (PhotonNetwork.offlineMode == false && Misc.haveOpponent()) { if (m_oneTime == false) { resultsGT.text = LevelingManager.setResults(totalScore); m_oneTime = true; } } #endif if (RuntimePlatform.IPhonePlayer == RuntimePlatform.IPhonePlayer) { #if GOT_PRIME31_GAMECENTER userName = GameCenterBinding.playerAlias(); #endif } if (usernameGT) { usernameGT.text = userName; } if (totalScoreGT) { totalScoreGT.text = totalScore.ToString(); } if (totalParGT) { totalParGT.text = totalPar.ToString(); } }