tjc12821

travel action

Oct 6th, 2017
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1.     struct travel_t: public action_t
  2.     {
  3.       travel_t( player_t* player ): action_t( ACTION_OTHER, "travel", player ) {}
  4.       void execute() override { player -> current.distance = 1; }
  5.       timespan_t execute_time() const override { return timespan_t::from_seconds( player->current.distance / 33.0 ); }
  6.       bool ready() override { return ( player -> current.distance > 1 ); }
  7.       bool usable_moving() const override { return true; }
  8.     };
  9.  
  10.     action_t* create_action( const std::string& name,
  11.       const std::string& options_str ) override
  12.     {
  13.       if ( name == "travel" ) return new travel_t( this );
  14.  
  15.       return pet_t::create_action( name, options_str );
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment