Skip to content

Problems with take ALL and drop ALL (5.8 beta) #1017

@KVonGit

Description

@KVonGit

Default behavior

You are in a room.
You can see a table (on which there is a basket (containing a bag (containing a ball))).

> get all
basket: You pick it up.
bag: You pick it up.
ball: You pick it up.

> drop all
basket: You drop it.
bag: You drop it.
ball: You drop it.

> undo
Undo: drop all

> undo
Undo: get all

> l
You are in a room.
You can see a table (on which there is a basket (containing a bag (containing a ball))).

> get basket
You pick it up.

> i
You are carrying a basket (containing a bag (containing a ball)).

> drop all
basket: You drop it.
bag: You are not carrying it.
ball: You are not carrying it.


My "fixes"

EDIT This is no good!

This may not be the best way to handle this, but it seems to work VERY well UNLESS directly dealing with an object in a held container.


Take

if (multiple and ListCount(object) = 0) {
 msg ("Nothing here to take.")
}
else {
 foreach (obj, object) {
   if (not ListContains(GetAllChildObjects(game.pov),obj)) {
     DoTake (obj, multiple)
   }
 }
}

Drop

if (multiple and ListCount(object) = 0) {
  msg ("You are not carrying anything.")
}
else {
  foreach (obj, object) {
    if (obj.parent = game.pov) {
      DoDrop (obj, multiple)
    }
  }
}

You are in a room.
You can see a table (on which there is a basket (containing a bag (containing a ball))).

> get all
basket: You pick it up.

> i
You are carrying a basket (containing a bag (containing a ball)).

> drop all
basket: You drop it.

> i
You are not carrying anything.

> l
You are in a room.
You can see a table and a basket (containing a bag (containing a ball)).

> get all
basket: You pick it up.

> i
You are carrying a basket (containing a bag (containing a ball)).

> l
You are in a room.
You can see a table.

> put basket on table
Done.

> i
You are not carrying anything.

> l
You are in a room.
You can see a table (on which there is a basket (containing a bag (containing a ball))).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions