Fixes brace style (#248)
This commit is contained in:
parent
a236617ad9
commit
8149620b0c
1503 changed files with 28575 additions and 1717 deletions
|
|
@ -28,7 +28,9 @@ namespace Server.Items
|
|||
public virtual bool Dye(Mobile from, DyeTub sender)
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
|
|
@ -73,7 +75,9 @@ namespace Server.Items
|
|||
private static void EventSink_BandageTargetRequest(Mobile from, Item item, Mobile target)
|
||||
{
|
||||
if (!(item is Bandage b) || b.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!from.InRange(b.GetWorldLocation(), Range))
|
||||
{
|
||||
|
|
@ -103,14 +107,18 @@ namespace Server.Items
|
|||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Bandage.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (targeted is Mobile mobile)
|
||||
{
|
||||
if (from.InRange(m_Bandage.GetWorldLocation(), Bandage.Range))
|
||||
{
|
||||
if (!(BandageContext.BeginHeal(from, mobile) == null || DuelContext.IsFreeConsume(from)))
|
||||
{
|
||||
m_Bandage.Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -120,7 +128,9 @@ namespace Server.Items
|
|||
else if (targeted is PlagueBeastInnard innard)
|
||||
{
|
||||
if (innard.OnBandage(from))
|
||||
{
|
||||
m_Bandage.Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -133,7 +143,9 @@ namespace Server.Items
|
|||
if (targeted is PlagueBeastInnard innard)
|
||||
{
|
||||
if (innard.OnBandage(from))
|
||||
{
|
||||
m_Bandage.Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -186,14 +198,20 @@ namespace Server.Items
|
|||
public static SkillName GetPrimarySkill(Mobile m)
|
||||
{
|
||||
if (!m.Player && (m.Body.IsMonster || m.Body.IsAnimal))
|
||||
{
|
||||
return SkillName.Veterinary;
|
||||
}
|
||||
|
||||
return SkillName.Healing;
|
||||
}
|
||||
|
||||
public static SkillName GetSecondarySkill(Mobile m)
|
||||
{
|
||||
if (!m.Player && (m.Body.IsMonster || m.Body.IsAnimal))
|
||||
{
|
||||
return SkillName.AnimalLore;
|
||||
}
|
||||
|
||||
return SkillName.Anatomy;
|
||||
}
|
||||
|
||||
|
|
@ -259,7 +277,10 @@ namespace Server.Items
|
|||
{
|
||||
petPatient.ResurrectPet();
|
||||
|
||||
for (var i = 0; i < petPatient.Skills.Length; ++i) petPatient.Skills[i].Base -= 0.1;
|
||||
for (var i = 0; i < petPatient.Skills.Length; ++i)
|
||||
{
|
||||
petPatient.Skills[i].Base -= 0.1;
|
||||
}
|
||||
}
|
||||
else if (master?.InRange(petPatient, 3) == true)
|
||||
{
|
||||
|
|
@ -291,7 +312,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
healerNumber = 1049670; // The pet's owner must be nearby to attempt resurrection.
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -304,9 +327,13 @@ namespace Server.Items
|
|||
else
|
||||
{
|
||||
if (petPatient?.IsDeadPet == true)
|
||||
{
|
||||
healerNumber = 503256; // You fail to resurrect the creature.
|
||||
}
|
||||
else
|
||||
{
|
||||
healerNumber = 500966; // You are unable to resurrect your patient.
|
||||
}
|
||||
|
||||
patientNumber = -1;
|
||||
}
|
||||
|
|
@ -385,12 +412,18 @@ namespace Server.Items
|
|||
var toHeal = min + Utility.RandomDouble() * (max - min);
|
||||
|
||||
if (Patient.Body.IsMonster || Patient.Body.IsAnimal)
|
||||
{
|
||||
toHeal += Patient.HitsMax / 100.0;
|
||||
}
|
||||
|
||||
if (Core.AOS)
|
||||
{
|
||||
toHeal -= toHeal * Slips * 0.35; // TODO: Verify algorithm
|
||||
}
|
||||
else
|
||||
{
|
||||
toHeal -= Slips * 4;
|
||||
}
|
||||
|
||||
if (toHeal < 1)
|
||||
{
|
||||
|
|
@ -408,13 +441,19 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (healerNumber != -1)
|
||||
{
|
||||
Healer.SendLocalizedMessage(healerNumber);
|
||||
}
|
||||
|
||||
if (patientNumber != -1)
|
||||
{
|
||||
Patient.SendLocalizedMessage(patientNumber);
|
||||
}
|
||||
|
||||
if (playSound)
|
||||
{
|
||||
Patient.PlaySound(0x57);
|
||||
}
|
||||
|
||||
if (checkSkills)
|
||||
{
|
||||
|
|
@ -457,9 +496,13 @@ namespace Server.Items
|
|||
if (onSelf)
|
||||
{
|
||||
if (Core.AOS)
|
||||
{
|
||||
seconds = 5.0 + 0.5 * ((double)(120 - dex) / 10); // TODO: Verify algorithm
|
||||
}
|
||||
else
|
||||
{
|
||||
seconds = 9.4 + 0.6 * ((double)(120 - dex) / 10);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -470,18 +513,28 @@ namespace Server.Items
|
|||
else if (Core.AOS)
|
||||
{
|
||||
if (dex < 204)
|
||||
{
|
||||
seconds = 3.2 - Math.Sin((double)dex / 130) * 2.5 + resDelay;
|
||||
}
|
||||
else
|
||||
{
|
||||
seconds = 0.7 + resDelay;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dex >= 100)
|
||||
{
|
||||
seconds = 3.0 + resDelay;
|
||||
}
|
||||
else if (dex >= 40)
|
||||
{
|
||||
seconds = 4.0 + resDelay;
|
||||
}
|
||||
else
|
||||
{
|
||||
seconds = 5.0 + resDelay;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -495,7 +548,9 @@ namespace Server.Items
|
|||
m_Table[healer] = context;
|
||||
|
||||
if (!onSelf)
|
||||
{
|
||||
patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you.
|
||||
}
|
||||
|
||||
healer.SendLocalizedMessage(500956); // You begin applying the bandages.
|
||||
return context;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ namespace Server.Items
|
|||
private bool CheckUse(Mobile from)
|
||||
{
|
||||
if (!IsAccessibleTo(from))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (from.Map != Map || !from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
|
|
@ -39,7 +41,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (from.Backpack?.GetAmount(typeof(SulfurousAsh)) >= (Core.AOS ? 4 : 15))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(1049617); // You do not have enough sulfurous ash.
|
||||
return false;
|
||||
|
|
@ -57,7 +61,9 @@ namespace Server.Items
|
|||
public void Use(Mobile from, IPoint3D loc)
|
||||
{
|
||||
if (!CheckUse(from))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
from.BeginAction<FireHorn>();
|
||||
Timer.DelayCall(Core.AOS ? TimeSpan.FromSeconds(6.0) : TimeSpan.FromSeconds(12.0), EndAction, from);
|
||||
|
|
@ -105,10 +111,14 @@ namespace Server.Items
|
|||
{
|
||||
if (from == m || !SpellHelper.ValidIndirectTarget(from, m) || !from.CanBeHarmful(m, false)
|
||||
|| Core.AOS && !from.InLOS(m))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m.Player)
|
||||
{
|
||||
playerVsPlayer = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -136,9 +146,13 @@ namespace Server.Items
|
|||
|
||||
int avgDamage;
|
||||
if (playerVsPlayer)
|
||||
{
|
||||
avgDamage = weightAvg / 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
avgDamage = weightAvg / 2;
|
||||
}
|
||||
|
||||
minDamage = avgDamage * 9 / 10;
|
||||
maxDamage = avgDamage * 10 / 9;
|
||||
|
|
@ -148,7 +162,9 @@ namespace Server.Items
|
|||
var total = prov + disc / 5 + peace / 5;
|
||||
|
||||
if (playerVsPlayer)
|
||||
{
|
||||
total /= 3;
|
||||
}
|
||||
|
||||
maxDamage = total * 2 / 30;
|
||||
minDamage = maxDamage * 7 / 10;
|
||||
|
|
@ -157,9 +173,13 @@ namespace Server.Items
|
|||
double damage = Utility.RandomMinMax(minDamage, maxDamage);
|
||||
|
||||
if (Core.AOS && targets.Count > 1)
|
||||
{
|
||||
damage = damage * 2 / targets.Count;
|
||||
}
|
||||
else if (!Core.AOS)
|
||||
{
|
||||
damage /= targets.Count;
|
||||
}
|
||||
|
||||
for (var i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
|
|
@ -217,13 +237,19 @@ namespace Server.Items
|
|||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Horn.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IPoint3D loc;
|
||||
if (targeted is Item item)
|
||||
{
|
||||
loc = item.GetWorldLocation();
|
||||
}
|
||||
else
|
||||
{
|
||||
loc = targeted as IPoint3D;
|
||||
}
|
||||
|
||||
m_Horn.Use(from, loc);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,9 @@ namespace Server.Items
|
|||
var r = Recipe;
|
||||
|
||||
if (r != null)
|
||||
{
|
||||
list.Add(1049644, r.TextDefinition.ToString()); // [~1_stuff~]
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
|
|
|
|||
|
|
@ -39,9 +39,13 @@ namespace Server.Items
|
|||
) : base(0x14F0)
|
||||
{
|
||||
if (normalizeLevel)
|
||||
{
|
||||
SkillLevel = (int)(level / 10) * 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
SkillLevel = level;
|
||||
}
|
||||
|
||||
m_Skill = skill;
|
||||
m_Crafter = crafter;
|
||||
|
|
@ -101,7 +105,9 @@ namespace Server.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (m_Crafter != null)
|
||||
{
|
||||
list.Add(1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
}
|
||||
|
||||
// On OSI it says it's exceptional. Intentional difference.
|
||||
}
|
||||
|
|
@ -109,7 +115,9 @@ namespace Server.Items
|
|||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
if (Deleted || !from.CanSee(this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LabelTo(
|
||||
from,
|
||||
|
|
@ -118,7 +126,9 @@ namespace Server.Items
|
|||
); // A repair service contract from ~1_SKILL_TITLE~ ~2_SKILL_NAME~.
|
||||
|
||||
if (m_Crafter != null)
|
||||
LabelTo(from, 1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
{
|
||||
LabelTo(@from, 1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
}
|
||||
}
|
||||
|
||||
private static TextDefinition GetSkillTitle(double skillLevel)
|
||||
|
|
@ -126,9 +136,14 @@ namespace Server.Items
|
|||
var skill = (int)(skillLevel / 10);
|
||||
|
||||
if (skill >= 11)
|
||||
{
|
||||
return 1062008 + skill - 11;
|
||||
}
|
||||
|
||||
if (skill >= 5)
|
||||
{
|
||||
return 1061123 + skill - 5;
|
||||
}
|
||||
|
||||
return skill switch
|
||||
{
|
||||
|
|
@ -141,8 +156,12 @@ namespace Server.Items
|
|||
public static RepairSkillType GetTypeFor(CraftSystem s)
|
||||
{
|
||||
for (var i = 0; i < RepairSkillInfo.Table.Length; i++)
|
||||
{
|
||||
if (RepairSkillInfo.Table[i].System == s)
|
||||
{
|
||||
return (RepairSkillType)i;
|
||||
}
|
||||
}
|
||||
|
||||
return RepairSkillType.Smithing;
|
||||
}
|
||||
|
|
@ -150,17 +169,25 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Check(from))
|
||||
Repair.Do(from, RepairSkillInfo.GetInfo(m_Skill).System, this);
|
||||
{
|
||||
Repair.Do(@from, RepairSkillInfo.GetInfo(m_Skill).System, this);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Check(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
from.SendLocalizedMessage(1047012); // The contract must be in your backpack to use it.
|
||||
{
|
||||
@from.SendLocalizedMessage(1047012); // The contract must be in your backpack to use it.
|
||||
}
|
||||
else if (!VerifyRegion(from))
|
||||
TextDefinition.SendMessageTo(from, RepairSkillInfo.GetInfo(m_Skill).NotNearbyMessage);
|
||||
{
|
||||
TextDefinition.SendMessageTo(@from, RepairSkillInfo.GetInfo(m_Skill).NotNearbyMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -238,7 +265,9 @@ namespace Server.Items
|
|||
var v = (int)type;
|
||||
|
||||
if (v < 0 || v >= Table.Length)
|
||||
{
|
||||
v = 0;
|
||||
}
|
||||
|
||||
return Table[v];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue