using Preparation.Interface; using Preparation.Utility; namespace GameClass.GameObj { public abstract class Prop : ObjOfCharacter { public override bool IsRigid => true; public override bool IgnoreCollideExecutor(IGameObj targetObj) { if (targetObj.Type == GameObjType.Prop || targetObj.Type == GameObjType.Bullet || targetObj.Type == GameObjType.Character || targetObj.Type == GameObjType.Chest) return true; return false; } public override ShapeType Shape => ShapeType.Square; public abstract PropType GetPropType(); public Prop(XY initPos, PlaceType place, int radius = GameData.PropRadius) : base(initPos, radius, GameObjType.Prop) { this.place = place; this.CanMove = false; this.moveSpeed = GameData.PropMoveSpeed; } } ///// ///// 坑人地雷 ///// // public abstract class DebuffMine : Prop //{ // public DebuffMine(XYPosition initPos) : base(initPos) { } // } #region 所有增益道具 /// /// 增加速度 /// public sealed class AddSpeed : Prop { public AddSpeed(XY initPos, PlaceType placeType) : base(initPos, placeType) { } public override PropType GetPropType() => PropType.AddSpeed; } /// /// 复活甲 /// public sealed class AddLifeOrClairaudience : Prop { public AddLifeOrClairaudience(XY initPos, PlaceType placeType) : base(initPos, placeType) { } public override PropType GetPropType() => PropType.AddLifeOrClairaudience; } public sealed class AddHpOrAp : Prop { public AddHpOrAp(XY initPos, PlaceType placeType) : base(initPos, placeType) { } public override PropType GetPropType() => PropType.AddHpOrAp; } public sealed class RecoveryFromDizziness : Prop { public RecoveryFromDizziness(XY initPos, PlaceType placeType) : base(initPos, placeType) { } public override PropType GetPropType() => PropType.RecoveryFromDizziness; } /// /// 矛盾 /// public sealed class ShieldOrSpear : Prop { public ShieldOrSpear(XY initPos, PlaceType placeType) : base(initPos, placeType) { } public override PropType GetPropType() => PropType.ShieldOrSpear; } public sealed class Key3 : Prop { public Key3(XY initPos, PlaceType placeType) : base(initPos, placeType) { } public override PropType GetPropType() => PropType.Key3; } public sealed class Key5 : Prop { public Key5(XY initPos, PlaceType placeType) : base(initPos, placeType) { } public override PropType GetPropType() => PropType.Key5; } public sealed class Key6 : Prop { public Key6(XY initPos, PlaceType placeType) : base(initPos, placeType) { } public override PropType GetPropType() => PropType.Key6; } public sealed class NullProp : Prop { public NullProp(PlaceType placeType = PlaceType.Wall) : base(new XY(1, 1), placeType) { } public override PropType GetPropType() => PropType.Null; } #endregion // #region 所有坑人地雷 ///// ///// 减速 ///// // public sealed class MinusSpeed : DebuffMine //{ // public MinusSpeed(XYPosition initPos) : base(initPos) { } // public override PropType GetPropType() => PropType.minusSpeed; // } ///// ///// 减少攻击力 ///// // public sealed class MinusAP : DebuffMine //{ // public MinusAP(XYPosition initPos) : base(initPos) { } // public override PropType GetPropType() => PropType.minusAP; // } ///// ///// 增加冷却 ///// // public sealed class AddCD : DebuffMine //{ // public AddCD(XYPosition initPos) : base(initPos) { } // public override PropType GetPropType() => PropType.addCD; // } // #endregion public static class PropFactory { public static Prop GetProp(PropType propType, XY pos, PlaceType place) { switch (propType) { case PropType.AddSpeed: return new AddSpeed(pos, place); case PropType.AddLifeOrClairaudience: return new AddLifeOrClairaudience(pos, place); case PropType.ShieldOrSpear: return new ShieldOrSpear(pos, place); case PropType.AddHpOrAp: return new AddHpOrAp(pos, place); case PropType.RecoveryFromDizziness: return new RecoveryFromDizziness(pos, place); case PropType.Key3: return new Key3(pos, place); case PropType.Key5: return new Key5(pos, place); case PropType.Key6: return new Key6(pos, place); default: return new NullProp(); } } } }