예제 #1
0
 public void HandlePush(Player player, Position posFrom, ushort thingID,
     byte stackpos, Position posTo, byte count, Creature creatureMoved)
 {
     HandlePush(player, posFrom, thingID, stackpos, posTo, count);
     creatureToMove = creatureMoved;
     if (!creatureMoved.IsOfType(Constants.TYPE_MOVEABLE)
         || map.GetTile(posTo) == null) {
         return;
     }
     if (map.GetTile(posTo).ContainsType(Constants.TYPE_BLOCKS_AUTO_WALK)
         || !creatureToMove.IsNextTo(posTo) || !player.IsNextTo(posFrom)) {
         return;
     }
     world.HandleMove(creatureMoved, posTo, creatureToMove.CurrentDirection);
 }
예제 #2
0
파일: item.cs 프로젝트: brewsterl/cyclops
 protected string AddDesc(Player player)
 {
     string desc = GetAttribute(Constants.ATTRIBUTE_DESCRIPTION);
     if (desc != null &&
         (player.HasSpecificThing(this) || player.IsNextTo(this))) {
         return " " + desc + ".";
     }
     return "";
 }
예제 #3
0
파일: item.cs 프로젝트: brewsterl/cyclops
 protected string AddWeight(Player player)
 {
     double weight = GetWeight();
     if (weight > 0 && (player.HasSpecificThing(this) || player.IsNextTo(this))) {
         string pronoun = Count > 1 ? " They" : " It";
         return pronoun + " weighs " + GetWeight() + ".0 oz.";
     }
     return "";
 }
예제 #4
0
        public virtual void HandleUseItem(Player player, byte itemType,
            Position pos, ushort itemID, byte stackpos)
        {
            lock (lockThis) {
                Thing thing = movingSystem.GetThing(player, pos, stackpos);
                if (thing == null) {
                    return;
                }
                bool carrying = player.HasSpecificThing(thing);
                bool nextTo = player.IsNextTo(thing);

                if (carrying || nextTo) {
                    thing.UseThing(player, this);
                } else if (!nextTo) {
                    player.CurrentWalkSettings.Destination = pos;
                    player.CurrentWalkSettings.IntendingToReachDes = false;
                    player.CurrentDelayedAction =
                        new UseItemAction(player, itemType, pos, itemID, stackpos);
                }
                SendProtocolMessages();
            }
        }