Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Template for new versions:
- `spectate`: added prefer nicknamed units
- `blueprint`: support for recording zones
- `blueprint`: support for recording stockpile properties like names and stockpile links; does not yet support recording detailed contents configuration
- `strangemood`: support added for specifying unit id instead of selected unit or random one.

## Documentation

Expand Down
4 changes: 4 additions & 0 deletions docs/plugins/strangemood.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Options
Make the strange mood strike the selected unit instead of picking one
randomly. Unit eligibility is still enforced (unless ``--force`` is also
specified).
``--id``
Make the strange mood strike the unit with the given id instead of picking one
randomly. Unit eligibility is still enforced (unless ``--force`` is also
specified).
``--type <type>``
Force the mood to be of a particular type instead of choosing randomly based
on happiness. Valid values are "fey", "secretive", "possessed", "fell", and
Expand Down
12 changes: 12 additions & 0 deletions plugins/strangemood.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,18 @@ command_result df_strangemood (color_ostream &out, vector <string> & parameters)
return CR_WRONG_USAGE;
else if(parameters[i] == "--force")
force = true;
else if(parameters[i] == "--id")
{
i++;
if (i == parameters.size())
{
out.printerr("No unit id specified!\n");
return CR_WRONG_USAGE;
}
unit = df::unit::find(std::stoi(parameters[i]));
if (!unit)
return CR_FAILURE;
}
else if(parameters[i] == "--unit")
{
unit = DFHack::Gui::getSelectedUnit(out);
Expand Down
Loading