Fixes several more expression issues and cast type check merges.
This commit is contained in:
parent
f93c3b992e
commit
9542c79ea4
24 changed files with 106 additions and 145 deletions
|
|
@ -69,10 +69,10 @@ namespace Server.Mobiles
|
|||
|
||||
Item artifact = Loot.Construct(type);
|
||||
|
||||
if (artifact is MonsterStatuette && StatueTypes.Length > 0)
|
||||
if (artifact is MonsterStatuette statuette && StatueTypes.Length > 0)
|
||||
{
|
||||
((MonsterStatuette)artifact).Type = StatueTypes[Utility.Random(StatueTypes.Length)];
|
||||
((MonsterStatuette)artifact).LootType = LootType.Regular;
|
||||
statuette.Type = StatueTypes[Utility.Random(StatueTypes.Length)];
|
||||
statuette.LootType = LootType.Regular;
|
||||
}
|
||||
|
||||
return artifact;
|
||||
|
|
|
|||
|
|
@ -111,9 +111,8 @@ namespace Server.Mobiles
|
|||
e.Handled = true;
|
||||
|
||||
Mobile from = e.Mobile;
|
||||
Guild g = from.Guild as Guild;
|
||||
|
||||
if (g == null || g.Type != Type)
|
||||
if (!(from.Guild is Guild g) || g.Type != Type)
|
||||
{
|
||||
Say(SignupNumber);
|
||||
}
|
||||
|
|
@ -124,7 +123,7 @@ namespace Server.Mobiles
|
|||
Item twoHanded = from.FindItemOnLayer(Layer.TwoHanded);
|
||||
|
||||
if (pack?.FindItemByType(shield.GetType()) != null ||
|
||||
twoHanded != null && shield.GetType().IsAssignableFrom(twoHanded.GetType()))
|
||||
twoHanded != null && shield.GetType().IsInstanceOfType(twoHanded))
|
||||
{
|
||||
Say(1007110); // Why dost thou ask about virtue guards when thou art one?
|
||||
shield.Delete();
|
||||
|
|
|
|||
|
|
@ -323,8 +323,8 @@ namespace Server.Mobiles
|
|||
{
|
||||
DamageStore ds = rights[i];
|
||||
|
||||
if (ds.m_HasRight && ds.m_Mobile is PlayerMobile)
|
||||
PlayerMobile.ChampionTitleInfo.AwardHarrowerTitle((PlayerMobile)ds.m_Mobile);
|
||||
if (ds.m_HasRight && ds.m_Mobile is PlayerMobile mobile)
|
||||
PlayerMobile.ChampionTitleInfo.AwardHarrowerTitle(mobile);
|
||||
}
|
||||
|
||||
if (!NoKillAwards)
|
||||
|
|
|
|||
|
|
@ -102,8 +102,8 @@ namespace Server.Mobiles
|
|||
if (m == this || !CanBeHarmful(m))
|
||||
continue;
|
||||
|
||||
if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned ||
|
||||
((BaseCreature)m).Team != Team))
|
||||
if (m is BaseCreature creature && (creature.Controlled || creature.Summoned ||
|
||||
creature.Team != Team))
|
||||
targets.Add(m);
|
||||
else if (m.Player)
|
||||
targets.Add(m);
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ namespace Server.Mobiles
|
|||
if (m == this || !CanBeHarmful(m))
|
||||
continue;
|
||||
|
||||
if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned ||
|
||||
((BaseCreature)m).Team != Team))
|
||||
if (m is BaseCreature creature && (creature.Controlled || creature.Summoned ||
|
||||
creature.Team != Team))
|
||||
list.Add(m);
|
||||
else if (m.Player)
|
||||
list.Add(m);
|
||||
|
|
|
|||
|
|
@ -122,58 +122,55 @@ namespace Server.Mobiles
|
|||
|
||||
private void DoCounter(Mobile attacker)
|
||||
{
|
||||
if (Map == null || attacker is BaseCreature && ((BaseCreature)attacker).BardProvoked)
|
||||
if (Map == null)
|
||||
return;
|
||||
|
||||
if (0.2 > Utility.RandomDouble())
|
||||
{
|
||||
/* Counterattack with Hit Poison Area
|
||||
if (!(0.2 > Utility.RandomDouble()))
|
||||
return;
|
||||
|
||||
BaseCreature bc = attacker as BaseCreature;
|
||||
|
||||
if (bc?.BardProvoked == true)
|
||||
return;
|
||||
|
||||
/* Counterattack with Hit Poison Area
|
||||
* 20-25 damage, unresistable
|
||||
* Lethal poison, 100% of the time
|
||||
* Particle effect: Type: "2" From: "0x4061A107" To: "0x0" ItemId: "0x36BD" ItemIdName: "explosion" FromLocation: "(296 615, 17)" ToLocation: "(296 615, 17)" Speed: "1" Duration: "10" FixedDirection: "True" Explode: "False" Hue: "0xA6" RenderMode: "0x0" Effect: "0x1F78" ExplodeEffect: "0x1" ExplodeSound: "0x0" Serial: "0x4061A107" Layer: "255" Unknown: "0x0"
|
||||
* Doesn't work on provoked monsters
|
||||
*/
|
||||
|
||||
Mobile target = null;
|
||||
Mobile target = bc?.GetMaster();
|
||||
|
||||
if (attacker is BaseCreature)
|
||||
{
|
||||
Mobile m = ((BaseCreature)attacker).GetMaster();
|
||||
if (target == null || !target.InRange(this, 25))
|
||||
target = attacker;
|
||||
|
||||
if (m != null)
|
||||
target = m;
|
||||
}
|
||||
Animate(10, 4, 1, true, false, 0);
|
||||
|
||||
if (target == null || !target.InRange(this, 25))
|
||||
target = attacker;
|
||||
ArrayList targets = new ArrayList();
|
||||
|
||||
Animate(10, 4, 1, true, false, 0);
|
||||
foreach (Mobile m in target.GetMobilesInRange(8))
|
||||
{
|
||||
if (m == this || !CanBeHarmful(m))
|
||||
continue;
|
||||
|
||||
ArrayList targets = new ArrayList();
|
||||
if (m is BaseCreature creature && (creature.Controlled || creature.Summoned ||
|
||||
creature.Team != Team))
|
||||
targets.Add(m);
|
||||
else if (m.Player)
|
||||
targets.Add(m);
|
||||
}
|
||||
|
||||
foreach (Mobile m in target.GetMobilesInRange(8))
|
||||
{
|
||||
if (m == this || !CanBeHarmful(m))
|
||||
continue;
|
||||
for (int i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
Mobile m = (Mobile)targets[i];
|
||||
|
||||
if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned ||
|
||||
((BaseCreature)m).Team != Team))
|
||||
targets.Add(m);
|
||||
else if (m.Player)
|
||||
targets.Add(m);
|
||||
}
|
||||
DoHarmful(m);
|
||||
|
||||
for (int i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
Mobile m = (Mobile)targets[i];
|
||||
AOS.Damage(m, this, Utility.RandomMinMax(20, 25), true, 0, 0, 0, 100, 0);
|
||||
|
||||
DoHarmful(m);
|
||||
|
||||
AOS.Damage(m, this, Utility.RandomMinMax(20, 25), true, 0, 0, 0, 100, 0);
|
||||
|
||||
m.FixedParticles(0x36BD, 1, 10, 0x1F78, 0xA6, 0, (EffectLayer)255);
|
||||
m.ApplyPoison(this, Poison.Lethal);
|
||||
}
|
||||
m.FixedParticles(0x36BD, 1, 10, 0x1F78, 0xA6, 0, (EffectLayer)255);
|
||||
m.ApplyPoison(this, Poison.Lethal);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue