Skip to content

Target resolver #3375

@Svjatovit

Description

@Svjatovit
  1. Scan the src/engine/core/handler(h/cpp) file and the src/engine/core/action_targeting(h/cpp) file. Rename the latter file to target_resolver. Rename its namaspace accordingly.
  2. The handler.h file contains many functions like:
    RoomRnum FindRoomRnum(CharData *ch, char *rawroomstr, int trig)
    ObjData *SearchObjByRnum(ObjRnum rnum)
    CharData *SearchCharInRoomByName(const char *name, RoomRnum room)
  3. Move these functions to the target resolver.
  4. Scan the code, especially interpreter.cpp, for other functions with similar tasks. Pay attention to the PerformImmortWhere function. 5. It's necessary to implement a general target resolving mechanism, focusing on classes like FoesRosterType.
  5. The resolver, or one of its classes if there are multiple classes, receives instructions on where exactly to search (equipment, inventory, room, container, containers, world, and so on). The order in which to search is determined. Search by name or some other method. Are we looking for one target or several? Provide the ability to specify a custom filter, for example by passing a functor, as is done in FoesRoster. Keep in mind that the "enemy list" itself (not all characters in the room) is already a type of filter. That is, the module itself can have built-in standard filters like "enemies only," "allies only," or "visible only," so that each user of the class isn't forced to write their own filter. The output is a target or list of targets.
  6. The class's users will be spells, abilities, commands, and generally anyone who needs to find a specific object (item, monster, player, etc.) or a list of objects in the world.

Metadata

Metadata

Assignees

Labels

EpicIt is a large task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions