public EActResults Interract(Creature _creature, LiveMapCell _liveMapCell) { var tuple = World.TheWorld.GetRemoteActivation(MechanismId); tuple.Item1.RemoteActivation(_creature, tuple.Item2); return(EActResults.DONE); }
public SplatterDropper(WorldLayer _layer, LiveMapCell _from, int _strength, FColor _color, LiveMapCell _to): base(EALNouns.NONE, _layer, 0) { m_strenght = _strength; m_color = _color; var d = _to.PathMapCoords - _from.PathMapCoords; World.TheWorld.CreatureManager.AddCreature(this, _from.WorldCoords, _from.LiveCoords, _layer); m_path = _from.LiveCoords.GetLineToPoints(_from.LiveCoords + d * 10).ToList(); }
public SplatterDropper(WorldLayer _layer, LiveMapCell _from, int _strength, FColor _color, LiveMapCell _to) : base(EALNouns.NONE, _layer, 0) { m_strenght = _strength; m_color = _color; var d = _to.PathMapCoords - _from.PathMapCoords; World.TheWorld.CreatureManager.AddCreature(this, _from.WorldCoords, _from.LiveCoords, _layer); m_path = _from.LiveCoords.GetLineToPoints(_from.LiveCoords + d * 10).ToList(); }
public EActResults Close(Creature _creature, LiveMapCell _liveMapCell) { var door = new ClosedDoor(Material); door.SetLockType(m_eLockType); _liveMapCell.Thing = door; if (_creature.IsAvatar) { MessageManager.SendXMessage(this, new XMessage(EALTurnMessage.CREATURE_CLOSES_IT, _creature, this)); //MessageManager.SendMessage(this, this[EPadej.IMEN] + " закрыта."); } return EActResults.DONE; }
public static bool IsLockedFor(this Essence _essence, LiveMapCell _cell, Creature _creature) { if (_essence == null) { return(false); } if (_essence.IsFake()) { _essence = _cell.ResolveFakeThing(_creature); } return(_essence is ICanbeOpened && ((ICanbeOpened)_essence).ELockType != ELockType.OPEN); }
public static bool CanBeClosed(this Essence _essence, LiveMapCell _cell, Creature _creature) { if (!(_essence is Thing)) { return(false); } if (_essence.IsFake()) { _essence = _cell.ResolveFakeThing(_creature); } return(_essence is ICanbeClosed && ((ICanbeClosed)_essence).ELockType == ELockType.OPEN); }
public EActResults Open(Creature _creature, LiveMapCell _liveMapCell) { var door = new OpenDoor(Material); door.SetLockType(m_eLockType); _liveMapCell.Thing = door; if (_creature.IsAvatar) { MessageManager.SendXMessage(this, new XMessage(EALTurnMessage.CREATURE_OPENS_IT, _creature, this)); } return EActResults.DONE; }
public EActResults Open(Creature _creature, LiveMapCell _liveMapCell) { var door = new OpenDoor(Material); door.SetLockType(m_eLockType); _liveMapCell.Thing = door; if (_creature.IsAvatar) { MessageManager.SendXMessage(this, new XMessage(EALTurnMessage.CREATURE_OPENS_IT, _creature, this)); } return(EActResults.DONE); }
public Missile(WorldLayer _layer, LiveMapCell _from, int _speed, Item _ammo, LiveMapCell _to) : base(_ammo.ENoun, _layer, _speed) { Ammo = _ammo; var d = (_to.PathMapCoords - _from.PathMapCoords)*10; if(d.Lenght>32) { d = d*31/(int)d.Lenght; } World.TheWorld.CreatureManager.AddCreature(this, _from.WorldCoords, _from.LiveCoords, _layer); m_path = _from.LiveCoords.GetLineToPoints(_from.LiveCoords + d).ToList(); m_light = new LightSource(10, new FColor(2f, 1f, 0.8f, 0.4f)); }
public EActResults Close(Creature _creature, LiveMapCell _liveMapCell) { var door = new ClosedDoor(Material); door.SetLockType(m_eLockType); _liveMapCell.Thing = door; if (_creature.IsAvatar) { MessageManager.SendXMessage(this, new XMessage(EALTurnMessage.CREATURE_CLOSES_IT, _creature, this)); //MessageManager.SendMessage(this, this[EPadej.IMEN] + " закрыта."); } return(EActResults.DONE); }
public Missile(WorldLayer _layer, LiveMapCell _from, int _speed, Item _ammo, LiveMapCell _to) : base(_ammo.ENoun, _layer, _speed) { Ammo = _ammo; var d = (_to.PathMapCoords - _from.PathMapCoords) * 10; if (d.Lenght > 32) { d = d * 31 / (int)d.Lenght; } World.TheWorld.CreatureManager.AddCreature(this, _from.WorldCoords, _from.LiveCoords, _layer); m_path = _from.LiveCoords.GetLineToPoints(_from.LiveCoords + d).ToList(); m_light = new LightSource(10, new FColor(2f, 1f, 0.8f, 0.4f)); }
public EActResults Open(Creature _creature, LiveMapCell _liveMapCell) { if (ELockType != ELockType.OPEN) { MessageManager.SendXMessage(this, new XMessage(EALTurnMessage.CREATURE_OPENS_IT, _creature, this)); ELockType = ELockType.OPEN; var collection = GetItems(_creature); if (collection.Any) { //обязать по любасу показать диалог выбора предметов _creature.AddActToPool(new TakeAct(), true, collection.Items, _liveMapCell.LiveCoords); } else { MessageManager.SendXMessage(this, new XMessage(EALTurnMessage.CONTAINER_IS_EMPTY, _creature, this)); } return(EActResults.DONE); } throw new NotImplementedException(); }
public EActResults Open(Creature _creature, LiveMapCell _liveMapCell) { if (ELockType != ELockType.OPEN) { MessageManager.SendXMessage(this, new XMessage(EALTurnMessage.CREATURE_OPENS_IT, _creature, this)); ELockType = ELockType.OPEN; var collection = GetItems(_creature); if (collection.Any) { //обязать по любасу показать диалог выбора предметов _creature.AddActToPool(new TakeAct(), true, collection.Items, _liveMapCell.LiveCoords); } else { MessageManager.SendXMessage(this, new XMessage(EALTurnMessage.CONTAINER_IS_EMPTY, _creature, this)); } return EActResults.DONE; } throw new NotImplementedException(); }
public EssenceDescriptor(Essence _essence, LiveMapCell _cell, IContainer _container, Creature _creature) { m_creature = _creature; if (_essence is IFaked) { if (_container != null) { if (_essence is Item) { _essence = _container.ResolveFakeItem(_creature, (FakedItem)_essence); } else { throw new NotImplementedException("Как так?"); } } else if(_cell!=null) { if (_essence is Item) { _essence = _cell.ResolveFakeItem(_creature, (FakedItem)_essence); } else if (_essence is Thing) { _essence = _cell.ResolveFakeThing(_creature); } } else { throw new NotImplementedException("Как так?"); } } Essence = _essence; LiveCoords = _cell!=null?_cell.LiveCoords:null; Container = _container; }
public LiveMap() { m_visibilityManager = new LosManager(AVATAR_SIGHT); Blocks = new LiveMapBlock[SIZE_IN_BLOCKS,SIZE_IN_BLOCKS]; Cells = new LiveMapCell[SIZE_IN_CELLS,SIZE_IN_CELLS]; CenterLiveBlock = Point.Zero; { var blockIds = new List<Point>(); for (var i = 0; i < SIZE_IN_BLOCKS; i++) for (var j = 0; j < SIZE_IN_BLOCKS; j++) blockIds.Add(new Point(i, j)); m_blockIds = blockIds.ToArray(); } for (var index = 0; index < m_blockIds.Length; index++) { var id = m_blockIds[index]; Blocks[id.X, id.Y] = new LiveMapBlock(this, id, index); } PathFinder = new PathFinder(SIZE_IN_CELLS); }
public EssenceDescriptor(Essence _essence, LiveMapCell _cell, IContainer _container, Creature _creature) { m_creature = _creature; if (_essence is IFaked) { if (_container != null) { if (_essence is Item) { _essence = _container.ResolveFakeItem(_creature, (FakedItem)_essence); } else { throw new NotImplementedException("Как так?"); } } else if (_cell != null) { if (_essence is Item) { _essence = _cell.ResolveFakeItem(_creature, (FakedItem)_essence); } else if (_essence is Thing) { _essence = _cell.ResolveFakeThing(_creature); } } else { throw new NotImplementedException("Как так?"); } } Essence = _essence; LiveCoords = _cell != null?_cell.LiveCoords:null; Container = _container; }
public EActResults Interract(Creature _creature, LiveMapCell _liveMapCell) { throw new NotImplementedException(); }
public EActResults Interract(Creature _creature, LiveMapCell _liveMapCell) { throw new NotImplementedException(); }
public EActResults Interract(Creature _creature, LiveMapCell _liveMapCell) { var tuple = World.TheWorld.GetRemoteActivation(MechanismId); tuple.Item1.RemoteActivation(_creature, tuple.Item2); return EActResults.DONE; }
public override float GetFogColorMultiplier(LiveMapCell _liveCell) { return _liveCell.DungeonFogColorMultiplier; }
public virtual float GetFogColorMultiplier(LiveMapCell _liveCell) { return(_liveCell.FogColorMultiplier); }
protected EActResults Find(Creature _creature, Func <Essence, LiveMapCell, bool> _predicate, out LiveMapCell _liveMapCell) { _liveMapCell = null; var list = new List <Point>(); foreach (var point in Point.NearestDPoints) { var cc = _creature[point]; if (cc.Thing != null && _predicate(cc.Thing, cc)) { list.Add(point); } else if (cc.GetAllAvailableItemDescriptors <Thing>(_creature).Any(_descriptor => _predicate(_descriptor.Essence, cc))) { list.Add(point); } } if (_creature.GetBackPackItems().Any(_descriptor => _predicate(_descriptor.Essence, null))) { list.Add(Point.Zero); } var coords = list.Distinct().ToList(); if (GetParameter <Point>().Any()) { coords = coords.Intersect(GetParameter <Point>()).ToList(); } if (!coords.Any()) { return(EActResults.QUICK_FAIL); } if (coords.Count() > 1) { MessageManager.SendMessage(this, new AskMessageNg(this, EAskMessageType.ASK_DIRECTION)); return(EActResults.NEED_ADDITIONAL_PARAMETERS); } _liveMapCell = _creature[coords.First()]; return(EActResults.NONE); }
protected EActResults FindCreature(Creature _creature, Func <Creature, LiveMapCell, bool> _predicate, out LiveMapCell _liveMapCell) { _liveMapCell = null; var list = new List <Point>(); foreach (var point in Point.NearestDPoints) { var cc = _creature[point]; if (cc.Creature != null && _predicate(cc.Creature, cc)) { list.Add(point); } } var coords = list.Distinct().ToList(); if (GetParameter <Point>().Any()) { coords = coords.Intersect(GetParameter <Point>()).ToList(); } if (!coords.Any()) { return(EActResults.QUICK_FAIL); } if (coords.Count() > 1) { MessageManager.SendMessage(this, new AskMessageNg(this, EAskMessageType.ASK_DIRECTION)); return(EActResults.NEED_ADDITIONAL_PARAMETERS); } _liveMapCell = _creature[coords.First()]; return(EActResults.NONE); }
public virtual float GetFogColorMultiplier(LiveMapCell _liveCell) { return _liveCell.FogColorMultiplier; }
public override float GetFogColorMultiplier(LiveMapCell _liveCell) { return(_liveCell.DungeonFogColorMultiplier); }