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); }
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(); } }