Reorganizes Project (#41)
This commit is contained in:
parent
08bf44af9a
commit
3614a66aee
3499 changed files with 79 additions and 55 deletions
89
Projects/Scripts/Items/Traps/SawTrap.cs
Normal file
89
Projects/Scripts/Items/Traps/SawTrap.cs
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum SawTrapType
|
||||
{
|
||||
WestWall,
|
||||
NorthWall,
|
||||
WestFloor,
|
||||
NorthFloor
|
||||
}
|
||||
|
||||
public class SawTrap : BaseTrap
|
||||
{
|
||||
[Constructible]
|
||||
public SawTrap(SawTrapType type = SawTrapType.NorthFloor) : base(GetBaseID(type))
|
||||
{
|
||||
}
|
||||
|
||||
public SawTrap(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SawTrapType Type
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (ItemID)
|
||||
{
|
||||
case 0x1103: return SawTrapType.NorthWall;
|
||||
case 0x1116: return SawTrapType.WestWall;
|
||||
case 0x11AC: return SawTrapType.NorthFloor;
|
||||
case 0x11B1: return SawTrapType.WestFloor;
|
||||
}
|
||||
|
||||
return SawTrapType.NorthWall;
|
||||
}
|
||||
set => ItemID = GetBaseID(value);
|
||||
}
|
||||
|
||||
public override bool PassivelyTriggered => false;
|
||||
public override TimeSpan PassiveTriggerDelay => TimeSpan.Zero;
|
||||
public override int PassiveTriggerRange => 0;
|
||||
public override TimeSpan ResetDelay => TimeSpan.FromSeconds(0.0);
|
||||
|
||||
public static int GetBaseID(SawTrapType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case SawTrapType.NorthWall: return 0x1103;
|
||||
case SawTrapType.WestWall: return 0x1116;
|
||||
case SawTrapType.NorthFloor: return 0x11AC;
|
||||
case SawTrapType.WestFloor: return 0x11B1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void OnTrigger(Mobile from)
|
||||
{
|
||||
if (!from.Alive || from.AccessLevel > AccessLevel.Player)
|
||||
return;
|
||||
|
||||
Effects.SendLocationEffect(Location, Map, GetBaseID(Type) + 1, 6, 3, GetEffectHue(), 0);
|
||||
Effects.PlaySound(Location, Map, 0x21C);
|
||||
|
||||
SpellHelper.Damage(TimeSpan.FromTicks(1), from, from, Utility.RandomMinMax(5, 15));
|
||||
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x22, 500853); // You stepped onto a blade trap!
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue