public void Summon() { bool capableToSummon = MaxServant > Chars.Count; if (capableToSummon) { Character summoned = CharList.Randomise(); Chars.Add(summoned); Console.Clear(); Console.WriteLine($"Successfully summoned {summoned.CharType} - {summoned.Name} on slot {Chars.IndexOf(summoned) + 1}."); if (Program.MustSave) { using (var context = new DataContext()) { context.Attach <Player>(this); context.SaveChanges(); }; } } else { Console.Clear(); Console.WriteLine("Summon failed. (not enough slots)"); } }
public Battle(Player player, int enemyLevel, bool isServant = false) { Player = player; WinExp = (enemyLevel * enemyLevel) / 2 + 25; LoseExp = enemyLevel * 5; BattleStrings = new List <BattleString>(); SelfName = player.UsingChar.Name; SelfAliases = player.UsingChar.Aliases; SelfType = player.UsingChar.CharType; SelfHint = player.UsingChar.Hint; SelfNP = player.UsingChar.NoblePhantasm; SelfNPPoint = 0; SelfDMGDealt = 1; SelfDMGTaken = 1; SelfStrength = player.PlayerStat.Strength + player.UsingChar.CharacterStat.Strength; SelfEndurance = player.PlayerStat.Endurance + player.UsingChar.CharacterStat.Endurance; SelfAgility = player.PlayerStat.Agility + player.UsingChar.CharacterStat.Agility; SelfMana = (player.PlayerStat.Mana + player.UsingChar.CharacterStat.Mana); SelfCurrentHealth = SelfMaxHealth - (player.UsingChar.Health - player.UsingChar.CurrentHealth); if (isServant) { Character enemy = CharList.Randomise(); EnemyName = enemy.Name; EnemyAliases = enemy.Aliases; EnemyType = enemy.CharType; EnemyHint = enemy.Hint; EnemyNP = enemy.NoblePhantasm; EnemyNPPoint = 0; EnemyDMGDealt = 1; EnemyDMGTaken = 1; EnemyStrength = enemy.CharacterStat.Strength + enemyLevel * 2 - 2; EnemyEndurance = enemy.CharacterStat.Endurance + enemyLevel * 2 - 2; EnemyAgility = enemy.CharacterStat.Agility + enemyLevel * 2 - 2; EnemyMana = enemy.CharacterStat.Mana + enemyLevel * 2 - 2; EnemyCurrentHealth = EnemyMaxHealth; IsServant = true; } else { NormEnemy enemy = NormCharList.Randomise(enemyLevel); EnemyName = enemy.Name; EnemyAliases = enemy.Aliases; EnemyHint = enemy.Hint; EnemyDMGDealt = 1; EnemyDMGTaken = 1; EnemyStrength = enemy.Stats.Strength; EnemyEndurance = enemy.Stats.Endurance; EnemyAgility = enemy.Stats.Agility; EnemyMana = enemy.Stats.Mana; EnemyCurrentHealth = EnemyMaxHealth; } EnemyLevel = enemyLevel; }