コード例 #1
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 "";
 }
コード例 #2
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 "";
 }
コード例 #3
0
ファイル: gameworld.cs プロジェクト: brewsterl/cyclops
        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();
            }
        }