Formatting #2 (#59)

This commit is contained in:
Kamron Batman 2019-10-05 00:37:03 -07:00 committed by GitHub
parent 096d39609e
commit 8e9221bb5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
400 changed files with 3688 additions and 5969 deletions

View file

@ -284,33 +284,17 @@ namespace Server.Items
if (!DesignContext.Check(from))
return; // They are customizing
SpellbookType type;
switch (e.Type)
var type = e.Type switch
{
default:
case 1:
type = SpellbookType.Regular;
break;
case 2:
type = SpellbookType.Necromancer;
break;
case 3:
type = SpellbookType.Paladin;
break;
case 4:
type = SpellbookType.Ninja;
break;
case 5:
type = SpellbookType.Samurai;
break;
case 6:
type = SpellbookType.Arcanist;
break;
case 7:
type = SpellbookType.Mystic;
break;
}
1 => SpellbookType.Regular,
2 => SpellbookType.Necromancer,
3 => SpellbookType.Paladin,
4 => SpellbookType.Ninja,
5 => SpellbookType.Samurai,
6 => SpellbookType.Arcanist,
7 => SpellbookType.Mystic,
_ => SpellbookType.Regular
};
Spellbook book = Find(from, -1, type);
@ -453,10 +437,8 @@ namespace Server.Items
Container pack = from.Backpack;
for (int i = 0; i < pack?.Items.Count; ++i)
{
if (pack.Items[i] is Spellbook sp)
list.Add(sp);
}
return list;
}
@ -541,13 +523,13 @@ namespace Server.Items
string modName = Serial.ToString();
if (strBonus != 0)
from.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
from.AddStatMod(new StatMod(StatType.Str, $"{modName}Str", strBonus, TimeSpan.Zero));
if (dexBonus != 0)
from.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
from.AddStatMod(new StatMod(StatType.Dex, $"{modName}Dex", dexBonus, TimeSpan.Zero));
if (intBonus != 0)
from.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
from.AddStatMod(new StatMod(StatType.Int, $"{modName}Int", intBonus, TimeSpan.Zero));
}
from.CheckStatTimers();
@ -562,9 +544,9 @@ namespace Server.Items
string modName = Serial.ToString();
from.RemoveStatMod(modName + "Str");
from.RemoveStatMod(modName + "Dex");
from.RemoveStatMod(modName + "Int");
from.RemoveStatMod($"{modName}Str");
from.RemoveStatMod($"{modName}Dex");
from.RemoveStatMod($"{modName}Int");
from.CheckStatTimers();
}
@ -574,7 +556,7 @@ namespace Server.Items
{
spellID -= BookOffset;
return spellID >= 0 && spellID < BookCount && (m_Content & ((ulong)1 << spellID)) != 0;
return spellID >= 0 && spellID < BookCount && (m_Content & (ulong)1 << spellID) != 0;
}
public void DisplayTo(Mobile to)
@ -848,13 +830,13 @@ namespace Server.Items
string modName = Serial.ToString();
if (strBonus != 0)
m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
m.AddStatMod(new StatMod(StatType.Str, $"{modName}Str", strBonus, TimeSpan.Zero));
if (dexBonus != 0)
m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
m.AddStatMod(new StatMod(StatType.Dex, $"{modName}Dex", dexBonus, TimeSpan.Zero));
if (intBonus != 0)
m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
m.AddStatMod(new StatMod(StatType.Int, $"{modName}Int", intBonus, TimeSpan.Zero));
}
m.CheckStatTimers();