protected string AddDesc(Player player) { string desc = GetAttribute(Constants.ATTRIBUTE_DESCRIPTION); if (desc != null && (player.HasSpecificThing(this) || player.IsNextTo(this))) { return " " + desc + "."; } return ""; }
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 ""; }
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(); } }