Fixes string interpolation

This commit is contained in:
Kamron Batman 2018-09-14 13:07:43 -07:00
parent 42d0b6271f
commit 7d3a0ca265
233 changed files with 758 additions and 690 deletions

View file

@ -75,7 +75,7 @@ namespace Server.Spells
{
if ( m.Skills[MoveSkill].Value < RequiredSkill )
{
string args = String.Format( "{0}\t{1}\t ", RequiredSkill.ToString( "F1" ), MoveSkill.ToString() );
string args = $"{RequiredSkill.ToString("F1")}\t{MoveSkill.ToString()}\t ";
m.SendLocalizedMessage( 1063013, args ); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
return false;
}

View file

@ -224,7 +224,7 @@ namespace Server.Spells
public static bool AddStatBonus( Mobile caster, Mobile target, StatType type, int bonus, TimeSpan duration )
{
int offset = bonus;
string name = String.Format( "[Magic] {0} Offset", type );
string name = $"[Magic] {type} Offset";
StatMod mod = target.GetStatMod( name );
@ -250,7 +250,7 @@ namespace Server.Spells
public static bool AddStatCurse( Mobile caster, Mobile target, StatType type, int curse, TimeSpan duration )
{
int offset = -curse;
string name = String.Format( "[Magic] {0} Offset", type );
string name = $"[Magic] {type} Offset";
StatMod mod = target.GetStatMod( name );

View file

@ -148,7 +148,7 @@ namespace Server.Spells
{
for ( int i = 0; i < m_CircleNames.Length; ++i )
{
Type t = ScriptCompiler.FindTypeByFullName( String.Format( "Server.Spells.{0}.{1}", m_CircleNames[i], name ) );
Type t = ScriptCompiler.FindTypeByFullName($"Server.Spells.{m_CircleNames[i]}.{name}");
if ( t != null && !t.IsSubclassOf( typeof( SpecialMove ) ) )
{

View file

@ -51,7 +51,7 @@ namespace Server.Spells.Bushido
if ( Caster.Skills[CastSkill].Value < RequiredSkill )
{
string args = String.Format( "{0}\t{1}\t ", RequiredSkill.ToString( "F1" ), CastSkill.ToString() );
string args = $"{RequiredSkill.ToString("F1")}\t{CastSkill.ToString()}\t ";
Caster.SendLocalizedMessage( 1063013, args ); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
return false;
}

View file

@ -79,7 +79,7 @@ namespace Server.Spells.First
targ.AddResistanceMod( mods[i] );
int physresist = 15 + (int)(targ.Skills[SkillName.Inscribe].Value / 20);
string args = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", physresist, 5, 5, 5, 5);
string args = $"{physresist}\t{5}\t{5}\t{5}\t{5}";
BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.ReactiveArmor, 1075812, 1075813, args.ToString()));
}

View file

@ -78,7 +78,7 @@ namespace Server.Spells.Fourth
int percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, true) * 100);
TimeSpan length = SpellHelper.GetDuration(Caster, m);
string args = String.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}", percentage, percentage, percentage, 10, 10, 10, 10);
string args = $"{percentage}\t{percentage}\t{percentage}\t{10}\t{10}\t{10}\t{10}";
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.Curse, 1075835, 1075836, length, m, args.ToString() ) );

View file

@ -59,7 +59,7 @@ namespace Server.Spells.Mysticism
if ( Caster.Skills[CastSkill].Value < RequiredSkill )
{
Caster.SendLocalizedMessage( 1063013, String.Format( "{0}\t{1}\t ", RequiredSkill.ToString( "F1" ), CastSkill.ToString() ) ); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
Caster.SendLocalizedMessage( 1063013, $"{RequiredSkill.ToString("F1")}\t{CastSkill.ToString()}\t "); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
return false;
}

View file

@ -118,7 +118,7 @@ namespace Server.Spells.Mysticism
Caster.Delta( MobileDelta.Resistances );
BuffInfo.AddBuff( Caster, new BuffInfo( BuffIcon.StoneForm, 1080145, 1080146,
string.Format( "-10\t-2\t{0}\t{1}\t{2}", offset, GetResistCapBonus( Caster ), GetDIBonus( Caster ) ), false ) );
$"-10\t-2\t{offset}\t{GetResistCapBonus(Caster)}\t{GetDIBonus(Caster)}", false ) );
}
}

View file

@ -74,7 +74,7 @@ namespace Server.Spells.Necromancy
spiritlevel = 4;
int d_MinDamage = 4;
int d_MaxDamage = ((int)spiritlevel + 1) * 3;
string args = String.Format("{0}\t{1}", d_MinDamage, d_MaxDamage);
string args = $"{d_MinDamage}\t{d_MaxDamage}";
int i_Count = (int)spiritlevel;
int i_MaxCount = i_Count;

View file

@ -136,7 +136,8 @@ namespace Server.Spells.Necromancy
if ( name is int )
AddHtmlLocalized( 50, 51 + (i * 21), 150, 20, (int)name, enabled ? EnabledColor16 : DisabledColor16, false, false );
else if ( name is string )
AddHtml( 50, 51 + (i * 21), 150, 20, String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", enabled ? EnabledColor32 : DisabledColor32, name ), false, false );
AddHtml( 50, 51 + (i * 21), 150, 20,
$"<BASEFONT COLOR=#{(enabled ? EnabledColor32 : DisabledColor32):X6}>{name}</BASEFONT>", false, false );
}
}
@ -167,7 +168,7 @@ namespace Server.Spells.Necromancy
else if ( necro < entry.ReqNecromancy || spirit < entry.ReqSpiritSpeak )
{
// That familiar requires ~1_NECROMANCY~ Necromancy and ~2_SPIRIT~ Spirit Speak.
m_From.SendLocalizedMessage( 1061606, String.Format( "{0:F1}\t{1:F1}", entry.ReqNecromancy, entry.ReqSpiritSpeak ) );
m_From.SendLocalizedMessage( 1061606, $"{entry.ReqNecromancy:F1}\t{entry.ReqSpiritSpeak:F1}");
m_From.CloseGump( typeof( SummonFamiliarGump ) );
m_From.SendGump( new SummonFamiliarGump( m_From, SummonFamiliarSpell.Entries, m_Spell ) );

View file

@ -185,7 +185,7 @@ namespace Server.Spells.Ninjitsu
if (m.Skills.Ninjitsu.Value < entry.ReqSkill)
{
string args = String.Format("{0}\t{1}\t ", entry.ReqSkill.ToString("F1"), SkillName.Ninjitsu);
string args = $"{entry.ReqSkill.ToString("F1")}\t{SkillName.Ninjitsu}\t ";
m.SendLocalizedMessage(1063013, args); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
return MorphResult.NoSkill;
}

View file

@ -51,7 +51,7 @@ namespace Server.Spells.Ninjitsu
if ( Caster.Skills[CastSkill].Value < RequiredSkill )
{
string args = String.Format( "{0}\t{1}\t ", RequiredSkill.ToString( "F1" ), CastSkill.ToString() );
string args = $"{RequiredSkill.ToString("F1")}\t{CastSkill.ToString()}\t ";
Caster.SendLocalizedMessage( 1063013, args ); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
return false;
}

View file

@ -76,7 +76,7 @@ namespace Server.Spells.Second
int physloss = -15 + (int) (caster.Skills[SkillName.Inscribe].Value / 20);
int resistloss = -35 + (int) (caster.Skills[SkillName.Inscribe].Value / 20);
string args = String.Format("{0}\t{1}", physloss, resistloss);
string args = $"{physloss}\t{resistloss}";
BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args.ToString()));
}
else

View file

@ -89,7 +89,7 @@ namespace Server.Spells.Spellweaving
}
else if ( caster.Skills[CastSkill].Value < RequiredSkill )
{
caster.SendLocalizedMessage( 1063013, String.Format( "{0}\t{1}", RequiredSkill.ToString( "F1" ), "#1044114" ) ); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
caster.SendLocalizedMessage( 1063013, $"{RequiredSkill.ToString("F1")}\t{"#1044114"}"); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
return false;
}

View file

@ -76,7 +76,7 @@ namespace Server.Spells.Spellweaving
damage -= absorbed;
defender.MeleeDamageAbsorb -= absorbed;
defender.SendLocalizedMessage( 1075127, String.Format( "{0}\t{1}", absorbed, defender.MeleeDamageAbsorb ) ); // ~1_damage~ point(s) of damage have been absorbed. A total of ~2_remaining~ point(s) of shielding remain.
defender.SendLocalizedMessage( 1075127, $"{absorbed}\t{defender.MeleeDamageAbsorb}"); // ~1_damage~ point(s) of damage have been absorbed. A total of ~2_remaining~ point(s) of shielding remain.
if ( defender.MeleeDamageAbsorb <= 0 )
StopAbsorbing( defender, true );

View file

@ -52,7 +52,8 @@ namespace Server.Spells.Spellweaving
{
m_Table[m] = new EssenceOfWindInfo( m, fcMalus, ssiMalus, duration );
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.EssenceOfWind, 1075802, duration, m, String.Format( "{0}\t{1}", fcMalus.ToString(), ssiMalus.ToString() ) ) );
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.EssenceOfWind, 1075802, duration, m,
$"{fcMalus.ToString()}\t{ssiMalus.ToString()}") );
}
}
}

View file

@ -39,7 +39,7 @@ namespace Server.Items
public virtual void Expire( Mobile parent )
{
if ( parent != null )
parent.SendLocalizedMessage( 1072515, (Name == null ? String.Format( "#{0}", LabelNumber ): Name) ); // The ~1_name~ expired...
parent.SendLocalizedMessage( 1072515, (Name == null ? $"#{LabelNumber}" : Name) ); // The ~1_name~ expired...
Effects.PlaySound( GetWorldLocation(), Map, 0x201 );
@ -48,7 +48,8 @@ namespace Server.Items
public virtual void SendTimeRemainingMessage( Mobile to )
{
to.SendLocalizedMessage( 1072516, String.Format( "{0}\t{1}", (Name == null ? String.Format( "#{0}", LabelNumber ): Name), (int)m_LifeSpan.TotalSeconds ) ); // ~1_name~ will expire in ~2_val~ seconds!
to.SendLocalizedMessage( 1072516,
$"{(Name == null ? $"#{LabelNumber}" : Name)}\t{(int) m_LifeSpan.TotalSeconds}"); // ~1_name~ will expire in ~2_val~ seconds!
}
public override void OnDelete()

View file

@ -55,7 +55,7 @@ namespace Server.Spells.Third
int percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, false) * 100);
TimeSpan length = SpellHelper.GetDuration(Caster, m);
string args = String.Format("{0}\t{1}\t{2}", percentage, percentage, percentage);
string args = $"{percentage}\t{percentage}\t{percentage}";
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Bless, 1075847, 1075848, length, m, args.ToString()));
}