Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions data/json/item_actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1023,5 +1023,10 @@
"type": "item_action",
"id": "flowerpot_collect",
"name": { "str": "Collect a plant" }
},
{
"type": "item_action",
"id": "dimension_travel",
"name": { "str": "Travel to another dimension" }
}
]
56 changes: 56 additions & 0 deletions data/json/items/tool/misc.json
Original file line number Diff line number Diff line change
Expand Up @@ -888,5 +888,61 @@
"price": "250 USD",
"price_postapoc": "1 USD",
"material": [ "iron", "glass" ]
},
{
"id": "debug_testing_dimension_travel",
"type": "TOOL",
"copy-from": "pocketwatch",
"name": { "str": "Dimensional Pocket Watch (Desert)" },
"description": "A pocket watch that allows the user to travel to the desert dimension. Used for debugging purposes only. Transforms after use.",
"looks_like": "pocketwatch",
"weight": "500 g",
"volume": "500 ml",
"price": "1 kUSD",
"price_postapoc": "1 USD",
"material": [ "brass", "glass" ],
"use_action": [
{
"type": "dimension_travel",
"destination": "desert_test",
"travel_radius": 5,
"need_charges": 0,
"allow_npcs": true,
"allow_vehicles": true,
"fail_message": "The watch vibrates but nothing happens.",
"success_message": "You feel a wrenching sensation as you are pulled through space and time."
},
{
"type": "transform",
"target": "debug_testing_dimension_travel_return",
"msg": "The watch reconfigures itself."
}
]
},
{
"id": "debug_testing_dimension_travel_return",
"type": "TOOL",
"copy-from": "pocketwatch",
"name": { "str": "Dimensional Pocket Watch (Default)" },
"description": "A pocket watch that allows the user to return to the default dimension. Used for debugging purposes only.",
"looks_like": "pocketwatch",
"weight": "500 g",
"volume": "500 ml",
"price": "1 kUSD",
"price_postapoc": "1 USD",
"material": [ "brass", "glass" ],
"use_action": [
{
"type": "dimension_travel",
"destination": "default",
"travel_radius": 5,
"need_charges": 0,
"allow_npcs": true,
"allow_vehicles": true,
"fail_message": "The watch vibrates but nothing happens.",
"success_message": "You feel reality snap back into place."
},
{ "type": "transform", "target": "debug_testing_dimension_travel", "msg": "The watch reconfigures itself." }
]
}
]
5 changes: 5 additions & 0 deletions src/avatar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@
player_map_memory->load( g->m.getabs( pos() ) );
}

void avatar::clear_map_memory()
{
player_map_memory->clear();
}

void avatar::prepare_map_memory_region( const tripoint &p1, const tripoint &p2 )
{
player_map_memory->prepare_region( p1, p2 );
Expand Down Expand Up @@ -917,13 +922,13 @@
min_ex = adjust_for_focus( min_ex );
max_ex = adjust_for_focus( max_ex );

if( max_ex < 2 ) {

Check warning on line 925 in src/avatar.cpp

View workflow job for this annotation

GitHub Actions / build

use `std::max` instead of `<` [readability-use-std-min-max]
max_ex = 2;
}
if( max_ex > 10 ) {

Check warning on line 928 in src/avatar.cpp

View workflow job for this annotation

GitHub Actions / build

use `std::min` instead of `>` [readability-use-std-min-max]
max_ex = 10;
}
if( max_ex < min_ex ) {

Check warning on line 931 in src/avatar.cpp

View workflow job for this annotation

GitHub Actions / build

use `std::max` instead of `<` [readability-use-std-min-max]
max_ex = min_ex;
}

Expand Down Expand Up @@ -1460,7 +1465,7 @@
umenu.query();

int choice = umenu.ret;
if( choice < 0 || choice >= static_cast<int>( use_methods.size() ) ) {

Check warning on line 1468 in src/avatar.cpp

View workflow job for this annotation

GitHub Actions / build

comparison between 'signed' and 'unsigned' integers [modernize-use-integer-sign-comparison]
return false;
}

Expand Down
1 change: 1 addition & 0 deletions src/avatar.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class avatar : public player
void deserialize( JsonIn &jsin ) override;
bool save_map_memory();
void load_map_memory();
void clear_map_memory();

// newcharacter.cpp
bool create( character_type type, const std::string &tempname = "" );
Expand Down
11 changes: 11 additions & 0 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12276,3 +12276,14 @@ detached_ptr<item> Character::reduce_charges( item *it, int quantity )
taken->charges = quantity;
return taken;
}

// signal_lost getter and setter
bool Character::get_signal_lost() const
{
return signal_lost;
}

void Character::set_signal_lost( bool lost )
{
signal_lost = lost;
}
8 changes: 8 additions & 0 deletions src/character.h
Original file line number Diff line number Diff line change
Expand Up @@ -2616,6 +2616,14 @@ class Character : public Creature, public location_visitable<Character>
// Relative direction of a grab, add to posx, posy to get the coordinates of the grabbed thing.
tripoint grab_point = tripoint_zero;

private:
// Whether the player can open overmap.
bool signal_lost = false;
public:
// And its getter and setter
bool get_signal_lost() const;
void set_signal_lost( bool lost );

};

Character &get_player_character();
Expand Down
6 changes: 6 additions & 0 deletions src/distribution_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,12 @@ void distribution_grid_tracker::on_changed( const tripoint_abs_ms &p )
}
}

void distribution_grid_tracker::clear()
{
parent_distribution_grids.clear();
grids_requiring_updates.clear();
}

void distribution_grid_tracker::on_options_changed()
{
on_saved();
Expand Down
5 changes: 5 additions & 0 deletions src/distribution_grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ class distribution_grid_tracker
void on_changed( const tripoint_abs_ms &p );
void on_saved();
void on_options_changed();

/**
* Clears all grids. Used when changing dimensions.
*/
void clear();
};

class vehicle;
Expand Down
Loading
Loading